diff --git a/.gitignore b/.gitignore index a040033..aa5bc37 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ node_modules npm-edubg.log dr.js *.sublime-* -!redraphael.sublime-project \ No newline at end of file +!redraphael.sublime-project + +tests/spec-*.html \ No newline at end of file diff --git a/README.md b/README.md index 85a19bd..2223921 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,9 @@ Raphael.define( [See it in action](http://jsfiddle.net/sushantbs/khBQj/6/) +## Unreleased features and improvements + +- array as multi-line text ## Guidelines for contribution diff --git a/package.json b/package.json index feae994..0159507 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "redraphael", "filename": "raphael", - "version": "1.0.11", + "version": "1.1.0", "rversion": "2.1.0", "description": "RedRaphael", "main": "index.js", diff --git a/package/raphael-fusioncharts.js b/package/raphael-fusioncharts.js index 6cb514b..a1e4aa1 100644 --- a/package/raphael-fusioncharts.js +++ b/package/raphael-fusioncharts.js @@ -16,7 +16,7 @@ window.FusionCharts && window.FusionCharts.register('module', ['private', 'vendo /**! - * RedRaphael 1.0.11 - JavaScript Vector Library + * RedRaphael 1.1.0 - JavaScript Vector Library * Copyright (c) 2012-2013 FusionCharts Technologies * * Raphael 2.1.0 @@ -6820,15 +6820,17 @@ window.FusionCharts && window.FusionCharts.register('module', ['private', 'vendo var updateGradientReference = function (element, newGradient) { var gradient = element.gradient; + if (gradient) { if (gradient === newGradient) { return; // no change } + // else gradient is specified and it is not same as newGradient, implying a dereference gradient.refCount--; if (!gradient.refCount) { gradient.parentNode.removeChild(gradient); - delete element.gradient; } + delete element.gradient; } if (newGradient) { // add new gradient @@ -7573,7 +7575,7 @@ window.FusionCharts && window.FusionCharts.register('module', ['private', 'vendo } } - tuneText(o, params); + (o.type === 'text') && tuneText(o, params); s.visibility = vis; }, leading = 1.2, @@ -7584,16 +7586,21 @@ window.FusionCharts && window.FusionCharts.register('module', ['private', 'vendo return; } var a = el.attrs, - node = el.node, - computedStyle = node.firstChild && R._g.doc.defaultView.getComputedStyle(node.firstChild, E), - fontSize = computedStyle ? toFloat(R._g.doc.defaultView.getComputedStyle(node.firstChild, E).getPropertyValue("font-size")) : 10, - lineHeight = toFloat(params['line-height'] || a['line-height']) || fontSize * leading, - valign = a[has]("vertical-align") ? a["vertical-align"] : "middle"; + node = el.node, + computedStyle = node.firstChild && R._g.doc.defaultView.getComputedStyle(node.firstChild, E), + fontSize = computedStyle ? + toFloat(R._g.doc.defaultView.getComputedStyle(node.firstChild, E).getPropertyValue("font-size")) : 10, + lineHeight = toFloat(params['line-height'] || a['line-height']) || fontSize * leading, + valign = a[has]("vertical-align") ? a["vertical-align"] : "middle"; if (isNaN(lineHeight)) { lineHeight = fontSize * leading; } + if (R.is(params.text, 'array')) { + params.text = params.text.join('
'); + } + valign = valign === 'top' ? -0.5 : (valign === 'bottom' ? 0.5 : 0); if (params[has]("text") && (params.text !== a.text || el._textdirty)) { @@ -8658,7 +8665,7 @@ window.FusionCharts && window.FusionCharts.register('module', ['private', 'vendo } node.appendChild(fill); var stroke = (node.getElementsByTagName("stroke") && node.getElementsByTagName("stroke")[0]), - newstroke = false; + newstroke = false; !stroke && (newstroke = stroke = createNode("stroke")); if ((params.stroke && params.stroke != "none") || params["stroke-width"] || @@ -9138,6 +9145,9 @@ window.FusionCharts && window.FusionCharts.register('module', ['private', 'vendo } // this.paper.canvas.style.display = "none"; if ('text' in params && this.type == "text") { + if (R.is(params.text, 'array')) { + params.text = params.text.join('
'); + } this.textpath.string = params.text.replace(//ig, '\n'); } setFillAndStroke(this, params); diff --git a/package/raphael-min.js b/package/raphael-min.js index 07959a8..0ad7698 100644 --- a/package/raphael-min.js +++ b/package/raphael-min.js @@ -1,5 +1,5 @@ /**! - * RedRaphael 1.0.11 - JavaScript Vector Library + * RedRaphael 1.1.0 - JavaScript Vector Library * Copyright (c) 2012-2013 FusionCharts Technologies * * Raphael 2.1.0 @@ -9,7 +9,7 @@ * Licensed under the MIT license. */ !function(a){var b,c,d="0.4.2",e="hasOwnProperty",f=/[\.\/]/,g="*",h=function(){},i=function(a,b){return a-b},j={n:{}},k=function(a,d){a=String(a);var e,f=c,g=Array.prototype.slice.call(arguments,2),h=k.listeners(a),j=0,l=[],m={},n=[],o=b;b=a,c=0;for(var p=0,q=h.length;q>p;p++)"zIndex"in h[p]&&(l.push(h[p].zIndex),h[p].zIndex<0&&(m[h[p].zIndex]=h[p]));for(l.sort(i);l[j]<0;)if(e=m[l[j++]],n.push(e.apply(d,g)),c)return c=f,n;for(p=0;q>p;p++)if(e=h[p],"zIndex"in e)if(e.zIndex==l[j]){if(n.push(e.apply(d,g)),c)break;do if(j++,e=m[l[j]],e&&n.push(e.apply(d,g)),c)break;while(e)}else m[e.zIndex]=e;else if(n.push(e.apply(d,g)),c)break;return c=f,b=o,n.length?n:null};k._events=j,k.listeners=function(a){var b,c,d,e,h,i,k,l,m=a.split(f),n=j,o=[n],p=[];for(e=0,h=m.length;h>e;e++){for(l=[],i=0,k=o.length;k>i;i++)for(n=o[i].n,c=[n[m[e]],n[g]],d=2;d--;)b=c[d],b&&(l.push(b),p=p.concat(b.f||[]));o=l}return p},k.on=function(a,b){if(a=String(a),"function"!=typeof b)return function(){};for(var c=a.split(f),d=j,e=0,g=c.length;g>e;e++)d=d.n,d=d.hasOwnProperty(c[e])&&d[c[e]]||(d[c[e]]={n:{}});for(d.f=d.f||[],e=0,g=d.f.length;g>e;e++)if(d.f[e]==b)return h;return d.f.push(b),function(a){+a==+a&&(b.zIndex=+a)}},k.f=function(a){var b=[].slice.call(arguments,1);return function(){k.apply(null,[a,null].concat(b).concat([].slice.call(arguments,0)))}},k.stop=function(){c=1},k.nt=function(a){return a?new RegExp("(?:\\.|\\/|^)"+a+"(?:\\.|\\/|$)").test(b):b},k.nts=function(){return b.split(f)},k.off=k.unbind=function(a,b){if(!a)return void(k._events=j={n:{}});var c,d,h,i,l,m,n,o=a.split(f),p=[j];for(i=0,l=o.length;l>i;i++)for(m=0;mi;i++)for(c=p[i];c.n;){if(b){if(c.f){for(m=0,n=c.f.length;n>m;m++)if(c.f[m]==b){c.f.splice(m,1);break}!c.f.length&&delete c.f}for(d in c.n)if(c.n[e](d)&&c.n[d].f){var q=c.n[d].f;for(m=0,n=q.length;n>m;m++)if(q[m]==b){q.splice(m,1);break}!q.length&&delete c.n[d].f}}else{delete c.f;for(d in c.n)c.n[e](d)&&c.n[d].f&&delete c.n[d].f}c=c.n}},k.once=function(a,b){var c=function(){return k.unbind(a,c),b.apply(this,arguments)};return k.on(a,c)},k.version=d,k.toString=function(){return"You are running Eve "+d},"undefined"!=typeof module&&module.exports?module.exports=k:"undefined"!=typeof define?define("eve",[],function(){return k}):a.eve=k}(this),function(a,b){"function"==typeof define&&define.amd?define(["eve"],function(c){return b(a,c)}):b(a,a.eve)}(this,function(a,b){function c(a){var d,e;return c._url="",c.is(a,"function")?t?a():b.on("raphael.DOMload",a):c.is(a,F)?c._engine.create[B](c,a.splice(0,3+c.is(a[0],D))).add(a):(d=Array.prototype.slice.call(arguments,0),c.is(d[d.length-1],"function")?(e=d.pop(),t?e.call(c._engine.create[B](c,d)):b.on("raphael.DOMload",function(){e.call(c._engine.create[B](c,d))})):c._engine.create[B](c,arguments))}function d(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return a.push(a.splice(c,1)[0])}function e(){return this.hex}function f(a,b){for(var c=[],d=0,e=a.length;e-2*!b>d;d+=2){var f=[{x:+a[d-2],y:+a[d-1]},{x:+a[d],y:+a[d+1]},{x:+a[d+2],y:+a[d+3]},{x:+a[d+4],y:+a[d+5]}];b?d?e-4==d?f[3]={x:+a[0],y:+a[1]}:e-2==d&&(f[2]={x:+a[0],y:+a[1]},f[3]={x:+a[2],y:+a[3]}):f[0]={x:+a[e-2],y:+a[e-1]}:e-4==d?f[3]=f[2]:d||(f[0]={x:+a[d],y:+a[d+1]}),c.push(["C",(-f[0].x+6*f[1].x+f[2].x)/6,(-f[0].y+6*f[1].y+f[2].y)/6,(f[1].x+6*f[2].x-f[3].x)/6,(f[1].y+6*f[2].y-f[3].y)/6,f[2].x,f[2].y])}return c}function g(a,b,c,d,e){var f=-3*b+9*c-9*d+3*e,g=a*f+6*b-12*c+6*d;return a*g-3*b+3*c}function i(a,b,c,d,e,f,h,i,j){null==j&&(j=1),j=j>1?1:0>j?0:j;for(var k=j/2,l=12,m=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],n=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],o=0,p=0;l>p;p++){var q=k*m[p]+k,r=g(q,a,c,e,h),s=g(q,b,d,f,i),t=r*r+s*s;o+=n[p]*jb(t)}return k*o}function j(a,b,c,d,e,f,g,h,j){if(!(0>j||i(a,b,c,d,e,f,g,h)o;)m/=2,n+=(j>k?1:-1)*m,k=i(a,b,c,d,e,f,g,h,n);return n}}function k(a,b,c,d,e,f,g,h){if(!(db(a,c)db(e,g)||db(b,d)db(f,h))){var i=(a*d-b*c)*(e-g)-(a-c)*(e*h-f*g),j=(a*d-b*c)*(f-h)-(b-d)*(e*h-f*g),k=(a-c)*(f-h)-(b-d)*(e-g);if(k){var l=i/k,m=j/k,n=+l.toFixed(2),o=+m.toFixed(2);if(!(n<+eb(a,c).toFixed(2)||n>+db(a,c).toFixed(2)||n<+eb(e,g).toFixed(2)||n>+db(e,g).toFixed(2)||o<+eb(b,d).toFixed(2)||o>+db(b,d).toFixed(2)||o<+eb(f,h).toFixed(2)||o>+db(f,h).toFixed(2)))return{x:l,y:m}}}}function l(a,b,d){var e=c.bezierBBox(a),f=c.bezierBBox(b);if(!c.isBBoxIntersect(e,f))return d?0:[];for(var g=i.apply(0,a),h=i.apply(0,b),j=db(~~(g/5),1),l=db(~~(h/5),1),m=[],n=[],o={},p=d?0:[],q=0;j+1>q;q++){var r=c.findDotsAtSegment.apply(c,a.concat(q/j));m.push({x:r.x,y:r.y,t:q/j})}for(q=0;l+1>q;q++)r=c.findDotsAtSegment.apply(c,b.concat(q/l)),n.push({x:r.x,y:r.y,t:q/l});for(q=0;j>q;q++)for(var s=0;l>s;s++){var t=m[q],u=m[q+1],v=n[s],w=n[s+1],x=fb(u.x-t.x)<.001?"y":"x",y=fb(w.x-v.x)<.001?"y":"x",z=k(t.x,t.y,u.x,u.y,v.x,v.y,w.x,w.y);if(z){if(o[z.x.toFixed(4)]==z.y.toFixed(4))continue;o[z.x.toFixed(4)]=z.y.toFixed(4);var A=t.t+fb((z[x]-t[x])/(u[x]-t[x]))*(u.t-t.t),B=v.t+fb((z[y]-v[y])/(w[y]-v[y]))*(w.t-v.t);A>=0&&1.001>=A&&B>=0&&1.001>=B&&(d?p++:p.push({x:z.x,y:z.y,t1:eb(A,1),t2:eb(B,1)}))}}return p}function m(a,b,d){a=c._path2curve(a),b=c._path2curve(b);for(var e,f,g,h,i,j,k,m,n,o,p=d?0:[],q=0,r=a.length;r>q;q++){var s=a[q];if("M"==s[0])e=i=s[1],f=j=s[2];else{"C"==s[0]?(n=[e,f].concat(s.slice(1)),e=n[6],f=n[7]):(n=[e,f,e,f,i,j,i,j],e=i,f=j);for(var t=0,u=b.length;u>t;t++){var v=b[t];if("M"==v[0])g=k=v[1],h=m=v[2];else{"C"==v[0]?(o=[g,h].concat(v.slice(1)),g=o[6],h=o[7]):(o=[g,h,g,h,k,m,k,m],g=k,h=m);var w=l(n,o,d);if(d)p+=w;else{for(var x=0,y=w.length;y>x;x++)w[x].segment1=q,w[x].segment2=t,w[x].bez1=n,w[x].bez2=o;p=p.concat(w)}}}}}return p}function n(a,b,c,d,e,f){null!=a?(this.a=+a,this.b=+b,this.c=+c,this.d=+d,this.e=+e,this.f=+f):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function o(){return this.x+z+this.y+z+this.width+" × "+this.height}function p(a,b,c,d,e,f){function g(a){return((l*a+k)*a+j)*a}function h(a,b){var c=i(a,b);return((o*c+n)*c+m)*c}function i(a,b){var c,d,e,f,h,i;for(e=a,i=0;8>i;i++){if(f=g(e)-a,fb(f)e)return c;if(e>d)return d;for(;d>c;){if(f=g(e),fb(f-a)f?c=e:d=e,e=(d-c)/2+c}return e}var j=3*b,k=3*(d-b)-j,l=1-j-k,m=3*c,n=3*(e-c)-m,o=1-m-n;return h(a,1/(200*f))}function q(a,b){var c=[],d={};if(this.ms=b,this.times=1,a){for(var e in a)a[A](e)&&(d[ab(e)]=a[e],c.push(ab(e)));c.sort(Fb)}this.anim=d,this.top=c[c.length-1],this.percents=c}function r(a,d,e,f,g,h){e=ab(e);var i,j,k,l,m,o,q=a.ms,r={},s={},t={};if(f)for(v=0,w=Kc.length;w>v;v++){var u=Kc[v];if(u.el.id==d.id&&u.anim==a){u.percent!=e?(Kc.splice(v,1),k=1):j=u,d.attr(u.totalOrigin);break}}else f=+s;for(var v=0,w=a.percents.length;w>v;v++){if(a.percents[v]==e||a.percents[v]>f*a.top){e=a.percents[v],m=a.percents[v-1]||0,q=q/a.top*(e-m),l=a.percents[v+1],i=a.anim[e];break}f&&d.attr(a.anim[a.percents[v]])}if(i){if(j)j.initstatus=f,j.start=new Date-j.ms*f;else{for(var x in i)if(i[A](x)&&(Db[A](x)||d.ca[x]))switch(r[x]=d.attr(x),null==r[x]&&(r[x]=Cb[x]),s[x]=i[x],Db[x]){case D:t[x]=(s[x]-r[x])/q;break;case"colour":r[x]=c.getRGB(r[x]);var y=c.getRGB(s[x]);t[x]={r:(y.r-r[x].r)/q,g:(y.g-r[x].g)/q,b:(y.b-r[x].b)/q};break;case"path":var z=ic(r[x],s[x]),B=z[1];for(r[x]=z[0],t[x]=[],v=0,w=r[x].length;w>v;v++){t[x][v]=[0];for(var E=1,F=r[x][v].length;F>E;E++)t[x][v][E]=(B[v][E]-r[x][v][E])/q}break;case"transform":var G=d._,H=nc(G[x],s[x]);if(H)for(r[x]=H.from,s[x]=H.to,t[x]=[],t[x].real=!0,v=0,w=r[x].length;w>v;v++)for(t[x][v]=[r[x][v][0]],E=1,F=r[x][v].length;F>E;E++)t[x][v][E]=(s[x][v][E]-r[x][v][E])/q;else{var J=d.matrix||new n,K={_:{transform:G.transform},getBBox:function(){return d.getBBox(1)}};r[x]=[J.a,J.b,J.c,J.d,J.e,J.f],lc(K,s[x]),s[x]=K._.transform,t[x]=[(K.matrix.a-J.a)/q,(K.matrix.b-J.b)/q,(K.matrix.c-J.c)/q,(K.matrix.d-J.d)/q,(K.matrix.e-J.e)/q,(K.matrix.f-J.f)/q]}break;case"csv":var L=_(i[x])[I](rb),M=_(r[x])[I](rb);if("clip-rect"==x)for(r[x]=M,t[x]=[],v=M.length;v--;)t[x][v]=(L[v]-r[x][v])/q;s[x]=L;break;default:for(L=[][C](i[x]),M=[][C](r[x]),t[x]=[],v=d.ca[x].length;v--;)t[x][v]=((L[v]||0)-(M[v]||0))/q}var N=i.easing,O=c.easing_formulas[N];if(!O)if(O=_(N).match(ub),O&&5==O.length){var P=O;O=function(a){return p(a,+P[1],+P[2],+P[3],+P[4],q)}}else O=Hb;if(o=i.start||a.start||+new Date,u={anim:a,percent:e,timestamp:o,start:o+(a.del||0),status:0,initstatus:f||0,stop:!1,ms:q,easing:O,from:r,diff:t,to:s,el:d,callback:i.callback,prev:m,next:l,repeat:h||a.times,origin:d.attr(),totalOrigin:g},Kc.push(u),f&&!j&&!k&&(u.stop=!0,u.start=new Date-q*f,1==Kc.length))return Mc();k&&(u.start=new Date-u.ms*f),1==Kc.length&&Lc(Mc)}b("raphael.anim.start."+d.id,d,a)}}function s(a){for(var b=0;be;e++)for(i=a[e],f=1,h=i.length;h>f;f+=2)c=b.x(i[f],i[f+1]),d=b.y(i[f],i[f+1]),i[f]=c,i[f+1]=d;return a},Mb=(c.pick=function(){for(var a,b=0,c=arguments.length;c>b;b+=1)if(a=arguments[b],a||a===!1||0===a)return a;return u},c._lastArgIfGroup=function(a,b){var d=a.length-1,e=a[d];return e&&e.constructor===c.el.constructor&&"group"===e.type?(b&&P.call(a,d,1),e):void 0}),Nb=c._serializeArgs=function(a){var b,d,e,f=a[0];if(c.is(f,"object")&&!c.is(f,"array")&&"group"!==f.type)for(b=f,f.path&&(pathString=f.path,pathString&&!c.is(pathString,E)&&!c.is(pathString[0],F)&&(pathString+=v)),d=1,e=arguments.length;e>d;d+=2)b[arguments[d]]||(b[arguments[d]]=arguments[d+1]);else for(b={},d=1,e=arguments.length;e>d;d+=2)b[arguments[d]]=a[(d-1)/2]||arguments[d+1];return b},Ob=c.merge=function(a,b,c,d,e){var f,g,h,i,j;if(e?(d.push(a),e.push(b)):(d=[a],e=[b]),b instanceof Array)for(f=0;f',Rb=Sb.firstChild,Rb.style.behavior="url(#default#VML)",!Rb||typeof Rb.adj!=G)return c.type=v;Sb=null}c.svg=!((c.vml="VML"==c.type)||(c.canvas="CANVAS"==c.type)),c._Paper=W,c._id=0,c._oid=0,c.angle=function(a,b,d,e,f,g){if(null==f){var h=a-d,i=b-e;return h||i?(180+cb.atan2(-i,-h)*nb+360)%360:0}return c.angle(a,b,f,g)-c.angle(d,e,f,g)},c.rad=function(a){return a%360*mb},c.deg=function(a){return a*nb%360},c.snapTo=function(a,b,c){var d,e;if(Pb(c,H)||(c=10),Pb(a,F)){for(e=a.length;e--;)if(fb(a[e]-b)<=c)return a[e]}else{if(a=+a,d=b%a,c>d)return b-d;if(d>a-c)return b-d+a}return b},c.setWindow=function(a){b("raphael.setWindow",c,Q.win,a),T=Q.win=a,S=Q.doc=Q.win.document,c._engine.initWin&&c._engine.initWin(Q.win)};var Tb=function(a){if(c.vml){var b,d=/^\s+|\s+$/g;try{var e=new ActiveXObject("htmlfile");e.write(""),e.close(),b=e.body}catch(f){b=createPopup().document.body}var g=b.createTextRange();Tb=Zb(function(a){try{b.style.color=_(a).replace(d,v);var c=g.queryCommandValue("ForeColor");return c=(255&c)<<16|65280&c|(16711680&c)>>>16,"#"+("000000"+c.toString(16)).slice(-6)}catch(e){return J}})}else{var h=Q.doc.createElement("i");h.title="Raphaël Colour Picker",h.style.display=J,Q.doc.body.appendChild(h),Tb=Zb(function(a){return h.style.color=a,Q.doc.defaultView.getComputedStyle(h,v).getPropertyValue("color")})}return Tb(a)},Ub=function(){return"hsb("+[this.h,this.s,this.b]+")"},Vb=function(){return"hsl("+[this.h,this.s,this.l]+")"},Wb=function(){return this.hex},Xb=function(a,b,d){if(null==b&&Pb(a,G)&&"r"in a&&"g"in a&&"b"in a&&(d=a.b,b=a.g,a=a.r),null==b&&Pb(a,E)){var e=c.getRGB(a);a=e.r,b=e.g,d=e.b}return(a>1||b>1||d>1)&&(a/=255,b/=255,d/=255),[a,b,d]},Yb=function(a,b,d,e){var f={r:a*=255,g:b*=255,b:d*=255,hex:c.rgb(a,b,d),toString:Wb};return Pb(e,"finite")&&(f.opacity=e),f};c.color=function(a){var b;return c.is(a,G)&&"h"in a&&"s"in a&&"b"in a?(b=c.hsb2rgb(a),a.r=b.r,a.g=b.g,a.b=b.b,a.hex=b.hex):c.is(a,G)&&"h"in a&&"s"in a&&"l"in a?(b=c.hsl2rgb(a),a.r=b.r,a.g=b.g,a.b=b.b,a.hex=b.hex):(c.is(a,"string")&&(a=c.getRGB(a)),c.is(a,G)&&"r"in a&&"g"in a&&"b"in a?(b=c.rgb2hsl(a),a.h=b.h,a.s=b.s,a.l=b.l,b=c.rgb2hsb(a),a.v=b.b):(a={hex:J},a.r=a.g=a.b=a.h=a.s=a.v=a.l=-1)),a.toString=Wb,a},c.hsb2rgb=function(a,b,c,d){this.is(a,G)&&"h"in a&&"s"in a&&"b"in a&&(c=a.b,b=a.s,a=a.h,d=a.o),a*=360;var e,f,g,h,i;return a=a%360/60,i=c*b,h=i*(1-fb(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a],Yb(e,f,g,d)},c.hsl2rgb=function(a,b,c,d){this.is(a,G)&&"h"in a&&"s"in a&&"l"in a&&(c=a.l,b=a.s,a=a.h),(a>1||b>1||c>1)&&(a/=360,b/=100,c/=100),a*=360;var e,f,g,h,i;return a=a%360/60,i=2*b*(.5>c?c:1-c),h=i*(1-fb(a%2-1)),e=f=g=c-i/2,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a],Yb(e,f,g,d)},c.rgb2hsb=function(a,b,c){c=Xb(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g;return f=db(a,b,c),g=f-eb(a,b,c),d=0==g?null:f==a?(b-c)/g:f==b?(c-a)/g+2:(a-b)/g+4,d=(d+360)%6*60/360,e=0==g?0:g/f,{h:d,s:e,b:f,toString:Ub}},c.rgb2hsl=function(a,b,c){c=Xb(a,b,c),a=c[0],b=c[1],c=c[2];var d,e,f,g,h,i;return g=db(a,b,c),h=eb(a,b,c),i=g-h,d=0==i?null:g==a?(b-c)/i:g==b?(c-a)/i+2:(a-b)/i+4,d=(d+360)%6*60/360,f=(g+h)/2,e=0==i?0:.5>f?i/(2*f):i/(2-2*f),{h:d,s:e,l:f,toString:Vb}},c._path2string=function(){return this.join(",").replace(wb,"$1")};{var Zb=c._cacher=function(a,b,c){function e(){var f=O.call(arguments,0),g=f.join("␀"),h=e.cache=e.cache||{},i=e.count=e.count||[];return h[A](g)?(d(i,g),c?c(h[g]):h[g]):(i.length>=1e3&&delete h[i.shift()],i.push(g),h[g]=a[B](b,f),c?c(h[g]):h[g])}return e};c._preload=function(a,b){var c=S.createElement("img");c.style.cssText="position:absolute;left:-9999em;top:-9999em",c.onload=function(){b.call(this),this.onload=null,S.body.removeChild(this)},c.onerror=function(){S.body.removeChild(this)},S.body.appendChild(c),c.src=a}}c.getRGB=Zb(function(a){var b,d,f,g,h,i,j;return a&&Pb(a,"object")&&"opacity"in a&&(b=a.opacity),!a||(a=_(a)).indexOf("-")+1?{r:-1,g:-1,b:-1,hex:J,error:1,toString:e}:a==J?{r:-1,g:-1,b:-1,hex:J,toString:e}:(!(Bb[A](a.toLowerCase().substring(0,2))||"#"===a.charAt())&&(a=Tb(a)),(j=a.match(tb))?(j[2]&&(g=bb(j[2].substring(5),16),f=bb(j[2].substring(3,5),16),d=bb(j[2].substring(1,3),16)),j[3]&&(g=bb((h=j[3].charAt(3))+h,16),f=bb((h=j[3].charAt(2))+h,16),d=bb((h=j[3].charAt(1))+h,16)),j[4]&&(i=j[4][I](vb),d=ab(i[0]),"%"==i[0].slice(-1)&&(d*=2.55),f=ab(i[1]),"%"==i[1].slice(-1)&&(f*=2.55),g=ab(i[2]),"%"==i[2].slice(-1)&&(g*=2.55),"rgba"==j[1].toLowerCase().slice(0,4)&&(b=ab(i[3])),i[3]&&"%"==i[3].slice(-1)&&(b/=100)),j[5]?(i=j[5][I](vb),d=ab(i[0]),"%"==i[0].slice(-1)&&(d*=2.55),f=ab(i[1]),"%"==i[1].slice(-1)&&(f*=2.55),g=ab(i[2]),"%"==i[2].slice(-1)&&(g*=2.55),("deg"==i[0].slice(-3)||"°"==i[0].slice(-1))&&(d/=360),"hsba"==j[1].toLowerCase().slice(0,4)&&(b=ab(i[3])),i[3]&&"%"==i[3].slice(-1)&&(b/=100),c.hsb2rgb(d,f,g,b)):j[6]?(i=j[6][I](vb),d=ab(i[0]),"%"==i[0].slice(-1)&&(d*=2.55),f=ab(i[1]),"%"==i[1].slice(-1)&&(f*=2.55),g=ab(i[2]),"%"==i[2].slice(-1)&&(g*=2.55),("deg"==i[0].slice(-3)||"°"==i[0].slice(-1))&&(d/=360),"hsla"==j[1].toLowerCase().slice(0,4)&&(b=ab(i[3])),i[3]&&"%"==i[3].slice(-1)&&(b/=100),c.hsl2rgb(d,f,g,b)):(j={r:d,g:f,b:g,toString:e},j.hex="#"+(16777216|g|f<<8|d<<16).toString(16).slice(1),c.is(b,"finite")&&(j.opacity=b),j)):{r:-1,g:-1,b:-1,hex:J,error:1,toString:e})},c),c.tintshade=Zb(function(a,b){var d,f=c.getRGB(a),g=255;return 0>b&&(b*=-1,g=0),b>1&&(b=1),d=0===b?f:{r:g-(g-f.r)*b,g:g-(g-f.g)*b,b:g-(g-f.b)*b,toString:e},d.hex=c.rgb(d.r,d.g,d.b),f.error&&(d.error=f.error),"opacity"in f?(d.rgba="rgba("+[d.r,d.g,d.b,f.opacity].join(",")+")",d.opacity=f.opacity):d.rgba="rgb("+[d.r,d.g,d.b].join(",")+")",d},c),c.hsb=Zb(function(a,b,d){return c.hsb2rgb(a,b,d).hex}),c.hsl=Zb(function(a,b,d){return c.hsl2rgb(a,b,d).hex}),c.rgb=Zb(function(a,b,c){return"#"+(16777216|c|b<<8|a<<16).toString(16).slice(1)}),c.getColor=function(a){var b=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||.75},c=this.hsb2rgb(b.h,b.s,b.b);return b.h+=.075,b.h>1&&(b.h=0,b.s-=.2,b.s<=0&&(this.getColor.start={h:0,s:1,b:b.b})),c.hex},c.getColor.reset=function(){delete this.start},c.parsePathString=function(a){if(!a)return null;var b=$b(a);if(b.arr)return ac(b.arr);var d={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},e=[];return c.is(a,F)&&c.is(a[0],F)&&(e=ac(a)),e.length||_(a).replace(xb,function(a,b,c){var f=[],g=b.toLowerCase();if(c.replace(zb,function(a,b){b&&f.push(+b)}),"m"==g&&f.length>2&&(e.push([b][C](f.splice(0,2))),g="l",b="m"==b?"l":"L"),"r"==g)e.push([b][C](f));else for(;f.length>=d[g]&&(e.push([b][C](f.splice(0,d[g]))),d[g]););}),e.toString=c._path2string,b.arr=ac(e),e},c.parseTransformString=Zb(function(a){if(!a)return null;var b=[];return c.is(a,F)&&c.is(a[0],F)&&(b=ac(a)),b.length||_(a).replace(yb,function(a,c,d){{var e=[];ob.call(c)}d.replace(zb,function(a,b){b&&e.push(+b)}),b.push([c][C](e))}),b.toString=c._path2string,b});var $b=function(a){var b=$b.ps=$b.ps||{};return b[a]?b[a].sleep=100:b[a]={sleep:100},setTimeout(function(){for(var c in b)b[A](c)&&c!=a&&(b[c].sleep--,!b[c].sleep&&delete b[c])}),b[a]};c.findDotsAtSegment=function(a,b,c,d,e,f,g,h,i){var j=1-i,k=gb(j,3),l=gb(j,2),m=i*i,n=m*i,o=k*a+3*l*i*c+3*j*i*i*e+n*g,p=k*b+3*l*i*d+3*j*i*i*f+n*h,q=a+2*i*(c-a)+m*(e-2*c+a),r=b+2*i*(d-b)+m*(f-2*d+b),s=c+2*i*(e-c)+m*(g-2*e+c),t=d+2*i*(f-d)+m*(h-2*f+d),u=j*a+i*c,v=j*b+i*d,w=j*e+i*g,x=j*f+i*h,y=90-180*cb.atan2(q-s,r-t)/lb;return(q>s||t>r)&&(y+=180),{x:o,y:p,m:{x:q,y:r},n:{x:s,y:t},start:{x:u,y:v},end:{x:w,y:x},alpha:y}},c.bezierBBox=function(a,b,d,e,f,g,h,i){c.is(a,"array")||(a=[a,b,d,e,f,g,h,i]);var j=hc.apply(null,a);return{x:j.min.x,y:j.min.y,x2:j.max.x,y2:j.max.y,width:j.max.x-j.min.x,height:j.max.y-j.min.y}},c.isPointInsideBBox=function(a,b,c){return b>=a.x&&b<=a.x2&&c>=a.y&&c<=a.y2},c.isBBoxIntersect=function(a,b){var d=c.isPointInsideBBox;return d(b,a.x,a.y)||d(b,a.x2,a.y)||d(b,a.x,a.y2)||d(b,a.x2,a.y2)||d(a,b.x,b.y)||d(a,b.x2,b.y)||d(a,b.x,b.y2)||d(a,b.x2,b.y2)||(a.xb.x||b.xa.x)&&(a.yb.y||b.ya.y)},c.pathIntersection=function(a,b){return m(a,b)},c.pathIntersectionNumber=function(a,b){return m(a,b,1)},c.isPointInsidePath=function(a,b,d){var e=c.pathBBox(a);return c.isPointInsideBBox(e,b,d)&&(m(a,[["M",b,d],["H",e.x2+10]],1)%2==1||m(a,[["M",b,d],["V",e.y2+10]],1)%2==1)},c._removedFactory=function(a){return function(){b("raphael.log",null,"Raphaël: you are calling to method “"+a+"” of removed object",a)}};var _b=c.pathBBox=function(a){var b=$b(a);if(b.bbox)return b.bbox;if(!a)return{x:0,y:0,width:0,height:0,x2:0,y2:0};a=ic(a);for(var c,d=0,e=0,f=[],g=[],h=0,i=a.length;i>h;h++)if(c=a[h],"M"==c[0])d=c[1],e=c[2],f.push(d),g.push(e);else{var j=hc(d,e,c[1],c[2],c[3],c[4],c[5],c[6]);f=f[C](j.min.x,j.max.x),g=g[C](j.min.y,j.max.y),d=c[5],e=c[6]}var k=eb[B](0,f),l=eb[B](0,g),m=db[B](0,f),n=db[B](0,g),o={x:k,y:l,x2:m,y2:n,width:m-k,height:n-l};return b.bbox=Qb(o),o},ac=function(a){var b=Qb(a);return b.toString=c._path2string,b},bc=c._pathToRelative=function(a){var b=$b(a);if(b.rel)return ac(b.rel);c.is(a,F)&&c.is(a&&a[0],F)||(a=c.parsePathString(a));var d=[],e=0,f=0,g=0,h=0,i=0;"M"==a[0][0]&&(e=a[0][1],f=a[0][2],g=e,h=f,i++,d.push(["M",e,f]));for(var j=i,k=a.length;k>j;j++){var l=d[j]=[],m=a[j];if(m[0]!=ob.call(m[0]))switch(l[0]=ob.call(m[0]),l[0]){case"a":l[1]=m[1],l[2]=m[2],l[3]=m[3],l[4]=m[4],l[5]=m[5],l[6]=+(m[6]-e).toFixed(3),l[7]=+(m[7]-f).toFixed(3);break;case"v":l[1]=+(m[1]-f).toFixed(3);break;case"m":g=m[1],h=m[2];default:for(var n=1,o=m.length;o>n;n++)l[n]=+(m[n]-(n%2?e:f)).toFixed(3)}else{l=d[j]=[],"m"==m[0]&&(g=m[1]+e,h=m[2]+f);for(var p=0,q=m.length;q>p;p++)d[j][p]=m[p]}var r=d[j].length;switch(d[j][0]){case"z":e=g,f=h;break;case"h":e+=+d[j][r-1];break;case"v":f+=+d[j][r-1];break;default:e+=+d[j][r-2],f+=+d[j][r-1]}}return d.toString=c._path2string,b.rel=ac(d),d},cc=c._pathToAbsolute=function(a){var b,d=$b(a);if(d.abs)return ac(d.abs);if(c.is(a,F)&&c.is(a&&a[0],F)||(a=c.parsePathString(a)),!a||!a.length)return b=["M",0,0],b.toString=c._path2string,b;var e=0,g=0,h=0,i=0,j=0;b=[],"M"==a[0][0]&&(e=+a[0][1],g=+a[0][2],h=e,i=g,j++,b[0]=["M",e,g]);for(var k,l,m=3==a.length&&"M"==a[0][0]&&"R"==a[1][0].toUpperCase()&&"Z"==a[2][0].toUpperCase(),n=j,o=a.length;o>n;n++){if(b.push(k=[]),l=a[n],l[0]!=pb.call(l[0]))switch(k[0]=pb.call(l[0]),k[0]){case"A":k[1]=l[1],k[2]=l[2],k[3]=l[3],k[4]=l[4],k[5]=l[5],k[6]=+(l[6]+e),k[7]=+(l[7]+g);break;case"V":k[1]=+l[1]+g;break;case"H":k[1]=+l[1]+e;break;case"R":for(var p=[e,g][C](l.slice(1)),q=2,r=p.length;r>q;q++)p[q]=+p[q]+e,p[++q]=+p[q]+g;b.pop(),b=b[C](f(p,m));break;case"M":h=+l[1]+e,i=+l[2]+g;default:for(q=1,r=l.length;r>q;q++)k[q]=+l[q]+(q%2?e:g)}else if("R"==l[0])p=[e,g][C](l.slice(1)),b.pop(),b=b[C](f(p,m)),k=["R"][C](l.slice(-2));else for(var s=0,t=l.length;t>s;s++)k[s]=l[s];switch(k[0]){case"Z":e=h,g=i;break;case"H":e=k[1];break;case"V":g=k[1];break;case"M":h=k[k.length-2],i=k[k.length-1];default:e=k[k.length-2],g=k[k.length-1]}}return b.toString=c._path2string,d.abs=ac(b),b},dc=function(a,b,c,d){return[a,b,c,d,c,d]},ec=function(a,b,c,d,e,f){var g=1/3,h=2/3;return[g*a+h*c,g*b+h*d,g*e+h*c,g*f+h*d,e,f]},fc=function(a,b,c,d,e,f,g,h,i,j){var k,l=120*lb/180,m=mb*(+e||0),n=[],o=Zb(function(a,b,c){var d=a*hb(c)-b*ib(c),e=a*ib(c)+b*hb(c);return{x:d,y:e}});if(j)x=j[0],y=j[1],v=j[2],w=j[3];else{k=o(a,b,-m),a=k.x,b=k.y,k=o(h,i,-m),h=k.x,i=k.y;var p=(hb(mb*e),ib(mb*e),(a-h)/2),q=(b-i)/2,r=p*p/(c*c)+q*q/(d*d);r>1&&(r=jb(r),c=r*c,d=r*d);var s=c*c,t=d*d,u=(f==g?-1:1)*jb(fb((s*t-s*q*q-t*p*p)/(s*q*q+t*p*p))),v=u*c*q/d+(a+h)/2,w=u*-d*p/c+(b+i)/2,x=cb.asin(((b-w)/d).toFixed(9)),y=cb.asin(((i-w)/d).toFixed(9));x=v>a?lb-x:x,y=v>h?lb-y:y,0>x&&(x=2*lb+x),0>y&&(y=2*lb+y),g&&x>y&&(x-=2*lb),!g&&y>x&&(y-=2*lb)}var z=y-x;if(fb(z)>l){var A=y,B=h,D=i;y=x+l*(g&&y>x?1:-1),h=v+c*hb(y),i=w+d*ib(y),n=fc(h,i,c,d,e,0,g,B,D,[y,A,v,w])}z=y-x;var E=hb(x),F=ib(x),G=hb(y),H=ib(y),J=cb.tan(z/4),K=4/3*c*J,L=4/3*d*J,M=[a,b],N=[a+K*F,b-L*E],O=[h+K*H,i-L*G],P=[h,i];if(N[0]=2*M[0]-N[0],N[1]=2*M[1]-N[1],j)return[N,O,P][C](n);n=[N,O,P][C](n).join()[I](",");for(var Q=[],R=0,S=n.length;S>R;R++)Q[R]=R%2?o(n[R-1],n[R],m).y:o(n[R],n[R+1],m).x;return Q},gc=function(a,b,c,d,e,f,g,h,i){var j=1-i;return{x:gb(j,3)*a+3*gb(j,2)*i*c+3*j*i*i*e+gb(i,3)*g,y:gb(j,3)*b+3*gb(j,2)*i*d+3*j*i*i*f+gb(i,3)*h}},hc=Zb(function(a,b,c,d,e,f,g,h){var i,j=e-2*c+a-(g-2*e+c),k=2*(c-a)-2*(e-c),l=a-c,m=(-k+jb(k*k-4*j*l))/2/j,n=(-k-jb(k*k-4*j*l))/2/j,o=[b,h],p=[a,g];return fb(m)>"1e12"&&(m=.5),fb(n)>"1e12"&&(n=.5),m>0&&1>m&&(i=gc(a,b,c,d,e,f,g,h,m),p.push(i.x),o.push(i.y)),n>0&&1>n&&(i=gc(a,b,c,d,e,f,g,h,n),p.push(i.x),o.push(i.y)),j=f-2*d+b-(h-2*f+d),k=2*(d-b)-2*(f-d),l=b-d,m=(-k+jb(k*k-4*j*l))/2/j,n=(-k-jb(k*k-4*j*l))/2/j,fb(m)>"1e12"&&(m=.5),fb(n)>"1e12"&&(n=.5),m>0&&1>m&&(i=gc(a,b,c,d,e,f,g,h,m),p.push(i.x),o.push(i.y)),n>0&&1>n&&(i=gc(a,b,c,d,e,f,g,h,n),p.push(i.x),o.push(i.y)),{min:{x:eb[B](0,p),y:eb[B](0,o)},max:{x:db[B](0,p),y:db[B](0,o)}}}),ic=c._path2curve=Zb(function(a,b){var c=!b&&$b(a);if(!b&&c.curve)return ac(c.curve);for(var d=cc(a),e=b&&cc(b),f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},h=(function(a,b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];switch(!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null),a[0]){case"M":b.X=a[1],b.Y=a[2];break;case"A":a=["C"][C](fc[B](0,[b.x,b.y][C](a.slice(1))));break;case"S":c=b.x+(b.x-(b.bx||b.x)),d=b.y+(b.y-(b.by||b.y)),a=["C",c,d][C](a.slice(1));break;case"T":b.qx=b.x+(b.x-(b.qx||b.x)),b.qy=b.y+(b.y-(b.qy||b.y)),a=["C"][C](ec(b.x,b.y,b.qx,b.qy,a[1],a[2]));break;case"Q":b.qx=a[1],b.qy=a[2],a=["C"][C](ec(b.x,b.y,a[1],a[2],a[3],a[4]));break;case"L":a=["C"][C](dc(b.x,b.y,a[1],a[2]));break;case"H":a=["C"][C](dc(b.x,b.y,a[1],b.y));break;case"V":a=["C"][C](dc(b.x,b.y,b.x,a[1]));break;case"Z":a=["C"][C](dc(b.x,b.y,b.X,b.Y))}return a}),i=function(a,b){if(a[b].length>7){a[b].shift();for(var c=a[b];c.length;)a.splice(b++,0,["C"][C](c.splice(0,6)));a.splice(b,1),l=db(d.length,e&&e.length||0)}},j=function(a,b,c,f,g){a&&b&&"M"==a[g][0]&&"M"!=b[g][0]&&(b.splice(g,0,["M",f.x,f.y]),c.bx=0,c.by=0,c.x=a[g][1],c.y=a[g][2],l=db(d.length,e&&e.length||0))},k=0,l=db(d.length,e&&e.length||0);l>k;k++){d[k]=h(d[k],f),i(d,k),e&&(e[k]=h(e[k],g)),e&&i(e,k),j(d,e,f,g,k),j(e,d,g,f,k);var m=d[k],n=e&&e[k],o=m.length,p=e&&n.length;f.x=m[o-2],f.y=m[o-1],f.bx=ab(m[o-4])||f.x,f.by=ab(m[o-3])||f.y,g.bx=e&&(ab(n[p-4])||g.x),g.by=e&&(ab(n[p-3])||g.y),g.x=e&&n[p-2],g.y=e&&n[p-1]}return e||(c.curve=ac(d)),e?[d,e]:d},null,ac),jc=(c._parseDots=Zb(function(a){for(var b=[],d=0,e=a.length;e>d;d++){var f={},g=a[d].match(/^([^:]*):?([\d\.]*)/);if(f.color=c.getRGB(g[1]),f.color.error)return null;f.opacity=f.color.opacity,f.color=f.color.hex,g[2]&&(f.offset=g[2]+"%"),b.push(f)}for(d=1,e=b.length-1;e>d;d++)if(!b[d].offset){for(var h=ab(b[d-1].offset||0),i=0,j=d+1;e>j;j++)if(b[j].offset){i=b[j].offset;break}i||(i=100,j=e),i=ab(i);for(var k=(i-h)/(j-d+1);j>d;d++)h+=k,b[d].offset=h+"%"}return b}),c._tear=function(a,b){a==b.top&&(b.top=a.prev),a==b.bottom&&(b.bottom=a.next),a.next&&(a.next.prev=a.prev),a.prev&&(a.prev.next=a.next)}),kc=(c._tofront=function(a,b){return b.top===a?!1:(jc(a,b),a.next=null,a.prev=b.top,b.top.next=a,b.top=a,!0)},c._toback=function(a,b){return b.bottom===a?!1:(jc(a,b),a.next=b.bottom,a.prev=null,b.bottom.prev=a,b.bottom=a,!0) -},c._insertafter=function(a,b,c,d){jc(a,c),a.parent=d,b===d.top&&(d.top=a),b.next&&(b.next.prev=a),a.next=b.next,a.prev=b,b.next=a},c._insertbefore=function(a,b,c,d){jc(a,c),a.parent=d,b===d.bottom&&(d.bottom=a),b.prev&&(b.prev.next=a),a.prev=b.prev,b.prev=a,a.next=b},c.toMatrix=function(a,b){var c=_b(a),d={_:{transform:v},getBBox:function(){return c}};return lc(d,b),d.matrix}),lc=(c.transformPath=function(a,b){return Lb(a,kc(a,b))},c._extractTransform=function(a,b){if(null==b)return a._.transform;b=_(b).replace(/\.{3}|\u2026/g,a._.transform||v);var d=c.parseTransformString(b),e=0,f=0,g=0,h=1,i=1,j=a._,k=new n;if(j.transform=d||[],d)for(var l=0,m=d.length;m>l;l++){var o,p,q,r,s,t=d[l],u=t.length,w=_(t[0]).toLowerCase(),x=t[0]!=w,y=x?k.invert():0;"t"==w&&3==u?x?(o=y.x(0,0),p=y.y(0,0),q=y.x(t[1],t[2]),r=y.y(t[1],t[2]),k.translate(q-o,r-p)):k.translate(t[1],t[2]):"r"==w?2==u?(s=s||a.getBBox(1),k.rotate(t[1],s.x+s.width/2,s.y+s.height/2),e+=t[1]):4==u&&(x?(q=y.x(t[2],t[3]),r=y.y(t[2],t[3]),k.rotate(t[1],q,r)):k.rotate(t[1],t[2],t[3]),e+=t[1]):"s"==w?2==u||3==u?(s=s||a.getBBox(1),k.scale(t[1],t[u-1],s.x+s.width/2,s.y+s.height/2),h*=t[1],i*=t[u-1]):5==u&&(x?(q=y.x(t[3],t[4]),r=y.y(t[3],t[4]),k.scale(t[1],t[2],q,r)):k.scale(t[1],t[2],t[3],t[4]),h*=t[1],i*=t[2]):"m"==w&&7==u&&k.add(t[1],t[2],t[3],t[4],t[5],t[6]),j.dirtyT=1,a.matrix=k}a.matrix=k,j.sx=h,j.sy=i,j.deg=e,j.dx=f=k.e,j.dy=g=k.f,1==h&&1==i&&!e&&j.bbox?(j.bbox.x+=+f,j.bbox.y+=+g):j.dirtyT=1}),mc=function(a){var b=a[0];switch(b.toLowerCase()){case"t":return[b,0,0];case"m":return[b,1,0,0,1,0,0];case"r":return 4==a.length?[b,0,a[2],a[3]]:[b,0];case"s":return 5==a.length?[b,1,1,a[3],a[4]]:3==a.length?[b,1,1]:[b,1]}},nc=c._equaliseTransform=function(a,b){b=_(b).replace(/\.{3}|\u2026/g,a),a=c.parseTransformString(a)||[],b=c.parseTransformString(b)||[];for(var d,e,f,g,h=db(a.length,b.length),i=[],j=[],k=0;h>k;k++){if(f=a[k]||mc(b[k]),g=b[k]||mc(f),f[0]!=g[0]||"r"==f[0].toLowerCase()&&(f[2]!=g[2]||f[3]!=g[3])||"s"==f[0].toLowerCase()&&(f[3]!=g[3]||f[4]!=g[4]))return;for(i[k]=[],j[k]=[],d=0,e=db(f.length,g.length);e>d;d++)d in f&&(i[k][d]=f[d]),d in g&&(j[k][d]=g[d])}return{from:i,to:j}};c._getContainer=function(a,b,d,e){var f;return f=null!=e||c.is(a,G)?a:Q.doc.getElementById(a),null!=f?f.tagName?null==b?{container:f,width:f.style.pixelWidth||f.offsetWidth,height:f.style.pixelHeight||f.offsetHeight}:{container:f,width:b,height:d}:{container:1,x:a,y:b,width:d,height:e}:void 0},c.pathToRelative=bc,c._engine={},c.path2curve=ic,c.matrix=function(a,b,c,d,e,f){return new n(a,b,c,d,e,f)},function(a){function b(a){return a[0]*a[0]+a[1]*a[1]}function d(a){var c=jb(b(a));a[0]&&(a[0]/=c),a[1]&&(a[1]/=c)}a.add=function(a,b,c,d,e,f){var g,h,i,j,k=[[],[],[]],l=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],m=[[a,c,e],[b,d,f],[0,0,1]];for(a&&a instanceof n&&(m=[[a.a,a.c,a.e],[a.b,a.d,a.f],[0,0,1]]),g=0;3>g;g++)for(h=0;3>h;h++){for(j=0,i=0;3>i;i++)j+=l[g][i]*m[i][h];k[g][h]=j}this.a=k[0][0],this.b=k[1][0],this.c=k[0][1],this.d=k[1][1],this.e=k[0][2],this.f=k[1][2]},a.invert=function(){var a=this,b=a.a*a.d-a.b*a.c;return new n(a.d/b,-a.b/b,-a.c/b,a.a/b,(a.c*a.f-a.d*a.e)/b,(a.b*a.e-a.a*a.f)/b)},a.clone=function(){return new n(this.a,this.b,this.c,this.d,this.e,this.f)},a.translate=function(a,b){this.add(1,0,0,1,a,b)},a.scale=function(a,b,c,d){null==b&&(b=a),(c||d)&&this.add(1,0,0,1,c,d),this.add(a,0,0,b,0,0),(c||d)&&this.add(1,0,0,1,-c,-d)},a.rotate=function(a,b,d){a=c.rad(a),b=b||0,d=d||0;var e=+hb(a).toFixed(9),f=+ib(a).toFixed(9);this.add(e,f,-f,e,b,d),this.add(1,0,0,1,-b,-d)},a.x=function(a,b){return a*this.a+b*this.c+this.e},a.y=function(a,b){return a*this.b+b*this.d+this.f},a.get=function(a){return+this[_.fromCharCode(97+a)].toFixed(4)},a.toString=function(){return c.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},a.toMatrixString=function(){return"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")"},a.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},a.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},a.split=function(){var a={};a.dx=this.e,a.dy=this.f;var e=[[this.a,this.c],[this.b,this.d]];a.scalex=jb(b(e[0])),d(e[0]),a.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*a.shear,e[1][1]-e[0][1]*a.shear],a.scaley=jb(b(e[1])),d(e[1]),a.shear/=a.scaley;var f=-e[0][1],g=e[1][1];return 0>g?(a.rotate=c.deg(cb.acos(g)),0>f&&(a.rotate=360-a.rotate)):a.rotate=c.deg(cb.asin(f)),a.isSimple=!(+a.shear.toFixed(9)||a.scalex.toFixed(9)!=a.scaley.toFixed(9)&&a.rotate),a.isSuperSimple=!+a.shear.toFixed(9)&&a.scalex.toFixed(9)==a.scaley.toFixed(9)&&!a.rotate,a.noRotation=!+a.shear.toFixed(9)&&!a.rotate,a},a.toTransformString=function(a){var b=a||this[I]();return b.isSimple?(b.scalex=+b.scalex.toFixed(4),b.scaley=+b.scaley.toFixed(4),b.rotate=+b.rotate.toFixed(4),(b.dx||b.dy?"t"+[b.dx,b.dy]:v)+(1!=b.scalex||1!=b.scaley?"s"+[b.scalex,b.scaley,0,0]:v)+(b.rotate?"r"+[b.rotate,0,0]:v)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(n.prototype);var oc=navigator.userAgent.match(/Version\/(.*?)\s/)||navigator.userAgent.match(/Chrome\/(\d+)/);X.safari="Apple Computer, Inc."==navigator.vendor&&(oc&&oc[1]<4||"iP"==navigator.platform.slice(0,2))||"Google Inc."==navigator.vendor&&oc&&oc[1]<8?function(){var a=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});return setTimeout(function(){a.remove()}),!0}:Gb;for(var pc=function(){this.returnValue=!1},qc=function(){return this.originalEvent.preventDefault()},rc=function(){this.cancelBubble=!0},sc=function(){return this.originalEvent.stopPropagation()},tc=c.addEvent=function(){return Q.doc.addEventListener?function(a,b,c,d){var e=U&&$[b]?$[b]:b,f=function(e){var f=Q.doc.documentElement.scrollTop||Q.doc.body.scrollTop,g=Q.doc.documentElement.scrollLeft||Q.doc.body.scrollLeft;if(U&&$[A](b))for(var h=0,i=e.targetTouches&&e.targetTouches.length;i>h;h++)if(e.targetTouches[h].target==a){var j=e;e=e.targetTouches[h],e.originalEvent=j,e.preventDefault=qc,e.stopPropagation=sc;break}return c.call(d,e,e.clientX+g,e.clientY+f)};return a.addEventListener(e,f,!1),function(){return a.removeEventListener(e,f,!1),!0}}:Q.doc.attachEvent?function(a,b,c,d){var e=function(a){a=a||Q.win.event;var b=Q.doc.documentElement.scrollTop||Q.doc.body.scrollTop,e=Q.doc.documentElement.scrollLeft||Q.doc.body.scrollLeft,f=a.clientX+e,g=a.clientY+b;return a.preventDefault=a.preventDefault||pc,a.stopPropagation=a.stopPropagation||rc,c.call(d,a,f,g)};a.attachEvent("on"+b,e);var f=function(){return a.detachEvent("on"+b,e),!0};return f}:void 0}(),uc=[],vc=function(a){for(var c,d=a.clientX,e=a.clientY,f=Q.doc.documentElement.scrollTop||Q.doc.body.scrollTop,g=Q.doc.documentElement.scrollLeft||Q.doc.body.scrollLeft,h=uc.length;h--;){if(c=uc[h],U){for(var i,j=a.touches.length;j--;)if(i=a.touches[j],i.identifier==c.el._drag.id){d=i.clientX,e=i.clientY,(a.originalEvent?a.originalEvent:a).preventDefault();break}}else a.preventDefault();var k,l=c.el.node,m=l.nextSibling,n=l.parentNode,o=l.style.display;Q.win.opera&&n.removeChild(l),l.style.display="none",k=c.el.paper.getElementByPoint(d,e),l.style.display=o,Q.win.opera&&(m?n.insertBefore(l,m):n.appendChild(l)),k&&b("raphael.drag.over."+c.el.id,c.el,k),d+=g,e+=f,b("raphael.drag.move."+c.el.id,c.move_scope||c.el,d-c.el._drag.x,e-c.el._drag.y,d,e,a)}},wc=function(a){c.unmousemove(vc).unmouseup(wc);for(var d,e=uc.length;e--;)d=uc[e],d.el._drag={},b("raphael.drag.end."+d.el.id,d.end_scope||d.start_scope||d.move_scope||d.el,a);uc=[]},xc=c.el={},yc=Z.length;yc--;)!function(a){c[a]=xc[a]=function(b,d){return c.is(b,"function")&&(this.events=this.events||[],this.events.push({name:a,f:b,unbind:tc(this.shape||this.node||Q.doc,a,b,d||this)})),this},c["un"+a]=xc["un"+a]=function(b){for(var c=this.events||[],d=c.length;d--;)if(c[d].name==a&&c[d].f==b)return c[d].unbind(),c.splice(d,1),!c.length&&delete this.events,this;return this}}(Z[yc]);xc.data=function(a,d){var e=Eb[this.id]=Eb[this.id]||{};if(1==arguments.length){if(c.is(a,G)){for(var f in a)a[A](f)&&this.data(f,a[f]);return this}return b("raphael.data.get."+this.id,this,e[a],a),e[a]}return e[a]=d,b("raphael.data.set."+this.id,this,d,a),this},xc.removeData=function(a){return null==a?Eb[this.id]={}:Eb[this.id]&&delete Eb[this.id][a],this},xc.getData=function(){return Qb(Eb[this.id]||{})};var zc=[],Ac=function(){this.untrack=tc(Q.doc,"mouseup",Bc,this)},Bc=function(){return this.untrack(),this.untrack=null,this.fn&&this.fn.apply(this.scope||this.el,arguments)};xc.mouseup=function(a,b,d){return d?(zc.push(d={el:this,fn:a,scope:b}),d.unbind=tc(this.shape||this.node||Q.doc,"mousedown",Ac,d),this):c.mouseup.apply(this,arguments)},xc.unmouseup=function(a){for(var b,d=zc.length;d--;)zc[d].el===this&&zc[d].fn===a&&(b=zc[d],b.unbind(),b.untrack&&b.untrack(),zc.splice(d,1));return b?this:c.unmouseup.apply(this,arguments)},xc.hover=function(a,b,c,d){return this.mouseover(a,c).mouseout(b,d||c)},xc.unhover=function(a,b){return this.unmouseover(a).unmouseout(b)};var Cc=[];xc.drag=function(a,d,e,f,g,h){function i(i){(i.originalEvent||i).preventDefault();var j=Q.doc.documentElement.scrollTop||Q.doc.body.scrollTop,k=Q.doc.documentElement.scrollLeft||Q.doc.body.scrollLeft;this._drag.x=i.clientX+k,this._drag.y=i.clientY+j,this._drag.id=i.identifier,!uc.length&&c.mousemove(vc).mouseup(wc),uc.push({el:this,move_scope:f,start_scope:g,end_scope:h}),d&&b.on("raphael.drag.start."+this.id,d),a&&b.on("raphael.drag.move."+this.id,a),e&&b.on("raphael.drag.end."+this.id,e),b("raphael.drag.start."+this.id,g||f||this,i.clientX+k,i.clientY+j,i)}return this._drag={},Cc.push({el:this,start:i}),this.mousedown(i),this},xc.onDragOver=function(a){a?b.on("raphael.drag.over."+this.id,a):b.unbind("raphael.drag.over."+this.id)},xc.undrag=function(){for(var a=Cc.length;a--;)Cc[a].el==this&&(this.unmousedown(Cc[a].start),Cc.splice(a,1),b.unbind("raphael.drag.*."+this.id));!Cc.length&&c.unmousemove(vc).unmouseup(wc)},xc.follow=function(a,b,d){return a.removed||a.constructor!==c.el.constructor?this:(a.followers.push({el:this,stalk:d={before:"insertBefore",after:"insertAfter"}[d],cb:b}),d&&this[d](a),this)},xc.unfollow=function(a){if(a.removed||a.constructor!==c.el.constructor)return this;for(var b=0,d=a.followers.length;d>b;b++)if(a.followers[b].el===this){a.followers.splice(b,1);break}return this},X.hide=function(){var a=this;return a.canvas.style.visibility="hidden",a},X.show=function(){var a=this;return a.canvas.style.visibility=v,a},X.group=function(){var a=this,b=arguments,d=Mb(b,!0),e=c._engine.group(a,b[0],d);return a.__set__&&a.__set__.push(e),a._elementsById[e.id]=e},X.circle=function(){var a=this,b=arguments,d=Mb(b,!0),e=Nb(b,"cx",0,"cy",0,"r",0,"fill",J,"stroke",K),f=c._engine.circle(a,e,d);return a.__set__&&a.__set__.push(f),a._elementsById[f.id]=f},X.rect=function(){var a=this,b=arguments,d=Mb(b,!0),e=Nb(b,"x",0,"y",0,"width",0,"height",0,"r",0,"fill",J,"stroke",K),f=c._engine.rect(a,e,d);return a.__set__&&a.__set__.push(f),a._elementsById[f.id]=f},X.ellipse=function(){var a=this,b=arguments,d=Mb(b,!0),e=Nb(b,"x",0,"y",0,"rx",0,"ry",0,"fill",J,"stroke",K),f=c._engine.ellipse(this,e,d);return a.__set__&&a.__set__.push(f),a._elementsById[f.id]=f},X.path=function(){var a=this,b=arguments,d=Mb(b,!0),e=Nb(b,"path",v,"fill",J,"stroke",K),f=c._engine.path(a,e,d);return a.__set__&&a.__set__.push(f),a._elementsById[f.id]=f},X.image=function(){var a=this,b=arguments,d=Mb(b,!0),e=Nb(b,"src","about:blank","x",0,"y",0,"width",0,"height",0);return out=c._engine.image(a,e,d),a.__set__&&a.__set__.push(out),a._elementsById[out.id]=out},X.text=function(){var a=this,b=arguments,d=Mb(b,!0),e=Nb(b,"x",0,"y",0,"text",v,"stroke",J,"fill",K,"text-anchor","middle","vertical-align","middle"),f=c._engine.text(a,e,d);return a.__set__&&a.__set__.push(f),a._elementsById[f.id]=f},X.set=function(a){!c.is(a,"array")&&(a=P.call(arguments,0,arguments.length));var b=new Oc(a);return this.__set__&&this.__set__.push(b),b},X.setStart=function(a){this.__set__=a||this.set()},X.setFinish=function(){var a=this.__set__;return delete this.__set__,a},X.setSize=function(a,b){return c._engine.setSize.call(this,a,b)},X.setViewBox=function(a,b,d,e,f){return c._engine.setViewBox.call(this,a,b,d,e,f)},X.top=X.bottom=null,X.raphael=c;var Dc=function(a){var b=a.getBoundingClientRect(),c=a.ownerDocument,d=c.body,e=c.documentElement,f=e.clientTop||d.clientTop||0,g=e.clientLeft||d.clientLeft||0,h=b.top+(Q.win.pageYOffset||e.scrollTop||d.scrollTop)-f,i=b.left+(Q.win.pageXOffset||e.scrollLeft||d.scrollLeft)-g;return{y:h,x:i}};X.getElementByPoint=function(a,b){var c=this,d=c.canvas,e=Q.doc.elementFromPoint(a,b);if(Q.win.opera&&"svg"==e.tagName){var f=Dc(d),g=d.createSVGRect();g.x=a-f.x,g.y=b-f.y,g.width=g.height=1;var h=d.getIntersectionList(g,null);h.length&&(e=h[h.length-1])}if(!e)return null;for(;e.parentNode&&e!=d.parentNode&&!e.raphael;)e=e.parentNode;return e==c.canvas.parentNode&&(e=d),e=e&&e.raphael?c.getById(e.raphaelid):null},X.getElementsByBBox=function(a){var b=this.set();return this.forEach(function(d){c.isBBoxIntersect(d.getBBox(),a)&&b.push(d)}),b},X.getById=function(a){return this._elementsById[a]||null},X.forEach=function(a,b){for(var c=this.bottom;c;){if(a.call(b,c)===!1)return this;c=c.next}return this},X.getElementsByPoint=function(a,b){var c=this.set();return this.forEach(function(d){d.isPointInside(a,b)&&c.push(d)}),c},xc.isPointInside=function(a,b){var d,e=this.realPath=this.realPath||Kb[this.type](this);return c.isPointInsidePath((d=this.attr("transform"))&&d.length&&c.transformPath(e,d)||e,a,b)},xc.getBBox=function(a){if(this.removed)return{};var b=this._;return a?((b.dirty||!b.bboxwt)&&(this.realPath=Kb[this.type](this),b.bboxwt=_b(this.realPath),b.bboxwt.toString=o,b.dirty=0),b.bboxwt):((b.dirty||b.dirtyT||!b.bbox)&&((b.dirty||!this.realPath)&&(b.bboxwt=0,this.realPath=Kb[this.type](this)),b.bbox=_b(Lb(this.realPath,this.matrix)),b.bbox.toString=o,b.dirty=b.dirtyT=0),b.bbox)},xc.clone=function(){if(this.removed)return null;var a=this,b=a.paper[a.type]().attr(a.attr());return a.__set__&&a.__set__.push(b),b},xc.glow=function(a){if("text"==this.type)return null;a=a||{};var b={width:(a.width||10)+(+this.attr("stroke-width")||1),fill:a.fill||!1,opacity:a.opacity||.5,offsetx:a.offsetx||0,offsety:a.offsety||0,color:a.color||"#000"},c=b.width/2,d=this.paper,e=d.set(),f=this.realPath||Kb[this.type](this);f=this.matrix?Lb(f,this.matrix):f;for(var g=1;c+1>g;g++)e.push(d.path(f).attr({stroke:b.color,fill:b.fill?b.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(b.width/c*g).toFixed(3),opacity:+(b.opacity/c).toFixed(3)}));return e.insertBefore(this).translate(b.offsetx,b.offsety)};var Ec=function(a,b,d,e,f,g,h,k,l){return null==l?i(a,b,d,e,f,g,h,k):c.findDotsAtSegment(a,b,d,e,f,g,h,k,j(a,b,d,e,f,g,h,k,l))},Fc=function(a,b){return function(d,e,f){d=ic(d);for(var g,h,i,j,k,l="",m={},n=0,o=0,p=d.length;p>o;o++){if(i=d[o],"M"==i[0])g=+i[1],h=+i[2];else{if(j=Ec(g,h,i[1],i[2],i[3],i[4],i[5],i[6]),n+j>e){if(b&&!m.start){if(k=Ec(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),l+=["C"+k.start.x,k.start.y,k.m.x,k.m.y,k.x,k.y],f)return l;m.start=l,l=["M"+k.x,k.y+"C"+k.n.x,k.n.y,k.end.x,k.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!a&&!b)return k=Ec(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),{x:k.x,y:k.y,alpha:k.alpha}}n+=j,g=+i[5],h=+i[6]}l+=i.shift()+i}return m.end=l,k=a?n:b?m:c.findDotsAtSegment(g,h,i[0],i[1],i[2],i[3],i[4],i[5],1),k.alpha&&(k={x:k.x,y:k.y,alpha:k.alpha}),k}},Gc=Fc(1),Hc=Fc(),Ic=Fc(0,1);c.getTotalLength=Gc,c.getPointAtLength=Hc,c.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return Ic(a,b).end;var d=Ic(a,c,1);return b?Ic(d,b).end:d},xc.getTotalLength=function(){return"path"==this.type?this.node.getTotalLength?this.node.getTotalLength():Gc(this.attrs.path):void 0},xc.getPointAtLength=function(a){return"path"==this.type?Hc(this.attrs.path,a):void 0},xc.getSubpath=function(a,b){return"path"==this.type?c.getSubpath(this.attrs.path,a,b):void 0};var Jc=c.easing_formulas={linear:function(a){return a},"<":function(a){return gb(a,1.7)},">":function(a){return gb(a,.48)},"<>":function(a){var b=.48-a/1.04,c=jb(.1734+b*b),d=c-b,e=gb(fb(d),1/3)*(0>d?-1:1),f=-c-b,g=gb(fb(f),1/3)*(0>f?-1:1),h=e+g+.5;return 3*(1-h)*h*h+h*h*h},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a-=1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){return a==!!a?a:gb(2,-10*a)*ib(2*(a-.075)*lb/.3)+1},bounce:function(a){var b,c=7.5625,d=2.75;return 1/d>a?b=c*a*a:2/d>a?(a-=1.5/d,b=c*a*a+.75):2.5/d>a?(a-=2.25/d,b=c*a*a+.9375):(a-=2.625/d,b=c*a*a+.984375),b}};Jc.easeIn=Jc["ease-in"]=Jc["<"],Jc.easeOut=Jc["ease-out"]=Jc[">"],Jc.easeInOut=Jc["ease-in-out"]=Jc["<>"],Jc["back-in"]=Jc.backIn,Jc["back-out"]=Jc.backOut;var Kc=[],Lc=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||function(a){setTimeout(a,16)},Mc=function(){for(var a=+new Date,d=0;dh))if(i>h){var q=j(h/i);for(var s in k)if(k[A](s)){switch(Db[s]){case D:f=+k[s]+q*i*l[s];break;case"colour":f="rgb("+[Nc(kb(k[s].r+q*i*l[s].r)),Nc(kb(k[s].g+q*i*l[s].g)),Nc(kb(k[s].b+q*i*l[s].b))].join(",")+")";break;case"path":f=[];for(var t=0,u=k[s].length;u>t;t++){f[t]=[k[s][t][0]];for(var v=1,w=k[s][t].length;w>v;v++)f[t][v]=(+k[s][t][v]+q*i*l[s][t][v]).toFixed(4);f[t]=f[t].join(z)}f=f.join(z);break;case"transform":if(l[s].real)for(f=[],t=0,u=k[s].length;u>t;t++)for(f[t]=[k[s][t][0]],v=1,w=k[s][t].length;w>v;v++)f[t][v]=k[s][t][v]+q*i*l[s][t][v];else{var x=function(a){return+k[s][a]+q*i*l[s][a]};f=[["m",x(0),x(1),x(2),x(3),x(4),x(5)]]}break;case"csv":if("clip-rect"==s)for(f=[],t=4;t--;)f[t]=+k[s][t]+q*i*l[s][t];break;default:var y=[][C](k[s]);for(f=[],t=n.ca[s].length;t--;)f[t]=+y[t]+q*i*l[s][t]}o[s]=f}n.attr(o),function(a,c,d){setTimeout(function(){b("raphael.anim.frame."+a,c,d)})}(n.id,n,e.anim)}else{if(function(a,d,e){setTimeout(function(){b("raphael.anim.frame."+d.id,d,e),b("raphael.anim.finish."+d.id,d,e),c.is(a,"function")&&a.call(d)})}(e.callback,n,e.anim),n.attr(m),Kc.splice(d--,1),e.repeat>1&&!e.next){for(g in m)m[A](g)&&(p[g]=e.totalOrigin[g]);e.el.attr(p),r(e.anim,e.el,e.anim.percents[0],null,e.totalOrigin,e.repeat-1)}e.next&&!e.stop&&r(e.anim,e.el,e.next,null,e.totalOrigin,e.repeat)}}}c.svg&&n&&n.paper&&n.paper.safari(),Kc.length&&Lc(Mc)},Nc=function(a){return a>255?255:0>a?0:a};xc.animateWith=function(a,b,d,e,f,g){var h=this;if(h.removed)return g&&g.call(h),h;var i=d instanceof q?d:c.animation(d,e,f,g);r(i,h,i.percents[0],null,h.attr());for(var j=0,k=Kc.length;k>j;j++)if(Kc[j].anim==b&&Kc[j].el==a){Kc[k-1].start=Kc[j].start;break}return h},xc.onAnimation=function(a){return a?b.on("raphael.anim.frame."+this.id,a):b.unbind("raphael.anim.frame."+this.id),this},q.prototype.delay=function(a){var b=new q(this.anim,this.ms);return b.times=this.times,b.del=+a||0,b},q.prototype.repeat=function(a){var b=new q(this.anim,this.ms);return b.del=this.del,b.times=cb.floor(db(a,0))||1,b},c.animation=function(a,b,d,e){if(a instanceof q)return a;(c.is(d,"function")||!d)&&(e=e||d||null,d=null),a=Object(a),b=+b||0;var f,g,h={};for(g in a)a[A](g)&&ab(g)!=g&&ab(g)+"%"!=g&&(f=!0,h[g]=a[g]);return f?(d&&(h.easing=d),e&&(h.callback=e),new q({100:h},b)):new q(a,b)},xc.animate=function(a,b,d,e){var f=this;if(f.removed)return e&&e.call(f),f;var g=a instanceof q?a:c.animation(a,b,d,e);return r(g,f,g.percents[0],null,f.attr()),f},xc.setTime=function(a,b){return a&&null!=b&&this.status(a,eb(b,a.ms)/a.ms),this},xc.status=function(a,b){var c,d,e=[],f=0;if(null!=b)return r(a,this,-1,eb(b,1)),this;for(c=Kc.length;c>f;f++)if(d=Kc[f],d.el.id==this.id&&(!a||d.anim==a)){if(a)return d.status;e.push({anim:d.anim,status:d.status})}return a?0:e},xc.pause=function(a){for(var c=0;cb;b++)(a=h[b]).stalk&&a.el[a.stalk](e);return e},xc.toBack=function(){if(this.removed)return this;var a,b,d,e=this,f=c._engine.getNode(e),g=e.parent,h=e.followers;for(c._toback(e,g)&&g.canvas.insertBefore(f,g.canvas.firstChild),b=0,d=h.length;d>b;b++)(a=h[b]).stalk&&a.el[a.stalk](e);return e},xc.insertAfter=function(a){if(this.removed)return this;var b,d,e,f=this,g=c._engine.getNode(f),h=c._engine.getLastNode(a),i=a.parent.canvas,j=f.followers;for(h.nextSibling?i.insertBefore(g,h.nextSibling):i.appendChild(g),c._insertafter(f,a,f.parent,a.parent),d=0,e=j.length;e>d;d++)(b=j[d]).stalk&&b.el[b.stalk](a);return f},xc.insertBefore=function(a){if(this.removed)return this;var b,d,e,f=this,g=c._engine.getNode(f),h=c._engine.getNode(a),i=f.followers;for(a.parent.canvas.insertBefore(g,h),c._insertbefore(f,a,f.parent,a.parent),f.parent=a.parent,d=0,e=i.length;e>d;d++)(b=i[d]).stalk&&b.el[b.stalk](a);return this},xc.appendChild=function(a){if(this.removed||"group"!==this.type)return this;var b,d,e,f,g=this,h=g.followers;if(a.parent===g)return a.toFront(),g;for(d=c._engine.getNode(a),c._tear(a,a.parent),g.canvas.appendChild(d),a.parent=g,!g.bottom&&(g.bottom=a),a.prev=g.top,a.next=null,g.top&&(g.top.next=a),g.top=a,e=0,f=h.length;f>e;e++)(b=h[e]).stalk&&b.el[b.stalk](a);return g},xc.removeChild=function(a){if(this.removed||"group"!==this.type||a.parent!==this)return this;var b=this,d=c._engine.getNode(a),e=b.paper;return c._tear(a,b),e.canvas.appendChild(d),b.parent=e,!e.bottom&&(e.bottom=b),b.prev=e.top,e.top&&(e.top.next=b),e.top=b,b.next=null,b};var Oc=function(a){if(this.items=[],this.length=0,this.type="set",a)for(var b=0,c=a.length;c>b;b++)!a[b]||a[b].constructor!=xc.constructor&&a[b].constructor!=Oc||(this[this.items.length]=this.items[this.items.length]=a[b],this.length++)},Pc=Oc.prototype;Pc.push=function(){for(var a,b,c=0,d=arguments.length;d>c;c++)a=arguments[c],!a||a.constructor!=xc.constructor&&a.constructor!=Oc||(b=this.items.length,this[b]=this.items[b]=a,this.length++);return this},Pc.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},Pc.forEach=function(a,b){for(var c=0,d=this.items.length;d>c;c++)if(a.call(b,this.items[c],c)===!1)return this;return this};for(var Qc in xc)xc[A](Qc)&&(Pc[Qc]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a][B](c,b)})}}(Qc));Pc.attr=function(a,b){if(a&&c.is(a,F)&&c.is(a[0],G))for(var d=0,e=a.length;e>d;d++)this.items[d].attr(a[d]);else for(var f=0,g=this.items.length;g>f;f++)this.items[f].attr(a,b);return this},Pc.clear=function(){for(;this.length;)this.pop()},Pc.splice=function(a,b){a=0>a?db(this.length+a,0):a,b=db(0,eb(this.length-a,isNaN(b)&&this.length||b));var c,d=[],e=[],f=[];for(c=2;cc;c++)e.push(this[a+c]);for(;cc?f[c]:d[c-g];for(c=this.items.length=this.length-=b-g;this[c];)delete this[c++];return new Oc(e)},Pc.exclude=function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]==a)return this.splice(b,1),!0},Pc.animate=function(a,b,d,e){(c.is(d,"function")||!d)&&(e=d||null);var f,g,h=this.items.length,i=h,j=this;if(!h)return this;e&&(g=function(){!--h&&e.call(j)}),d=c.is(d,E)?d:g;var k=c.animation(a,b,d,g);for(f=this.items[--i].animate(k);i--;)this.items[i]&&!this.items[i].removed&&this.items[i].animateWith(f,k,k);return this},Pc.insertAfter=function(a){for(var b=this.items.length;b--;)this.items[b].insertAfter(a);return this},Pc.getBBox=function(){for(var a=[],b=[],c=[],d=[],e=this.items.length;e--;)if(!this.items[e].removed){var f=this.items[e].getBBox();a.push(f.x),b.push(f.y),c.push(f.x+f.width),d.push(f.y+f.height)}return a=eb[B](0,a),b=eb[B](0,b),c=db[B](0,c),d=db[B](0,d),{x:a,y:b,x2:c,y2:d,width:c-a,height:d-b}},Pc.clone=function(a){a=new Oc;for(var b=0,c=this.items.length;c>b;b++)a.push(this.items[b].clone());return a},Pc.toString=function(){return"Raphaël‘s set"},Pc.glow=function(a){var b=this.paper.set();return this.forEach(function(c){var d=c.glow(a);null!=d&&d.forEach(function(a){b.push(a)})}),b},c.registerFont=function(a){if(!a.face)return a;this.fonts=this.fonts||{};var b={w:a.w,face:{},glyphs:{}},c=a.face["font-family"];for(var d in a.face)a.face[A](d)&&(b.face[d]=a.face[d]);if(this.fonts[c]?this.fonts[c].push(b):this.fonts[c]=[b],!a.svg){b.face["units-per-em"]=bb(a.face["units-per-em"],10);for(var e in a.glyphs)if(a.glyphs[A](e)){var f=a.glyphs[e];if(b.glyphs[e]={w:f.w,k:{},d:f.d&&"M"+f.d.replace(/[mlcxtrv]/g,function(a){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[a]||"M"})+"z"},f.k)for(var g in f.k)f[A](g)&&(b.glyphs[e].k[g]=f.k[g])}}return a},X.getFont=function(a,b,d,e){if(e=e||"normal",d=d||"normal",b=+b||{normal:400,bold:700,lighter:300,bolder:800}[b]||400,c.fonts){var f=c.fonts[a];if(!f){var g=new RegExp("(^|\\s)"+a.replace(/[^\w\d\s+!~.:_-]/g,v)+"(\\s|$)","i");for(var h in c.fonts)if(c.fonts[A](h)&&g.test(h)){f=c.fonts[h];break}}var i;if(f)for(var j=0,k=f.length;k>j&&(i=f[j],i.face["font-weight"]!=b||i.face["font-style"]!=d&&i.face["font-style"]||i.face["font-stretch"]!=e);j++);return i}},X.print=function(a,b,d,e,f,g,h){g=g||"middle",h=db(eb(h||0,1),-1);var i,j=_(d)[I](v),k=0,l=0,m=v;if(c.is(e,d)&&(e=this.getFont(e)),e){i=(f||16)/e.face["units-per-em"];for(var n=e.face.bbox[I](rb),o=+n[0],p=n[3]-n[1],q=0,r=+n[1]+("baseline"==g?p+ +e.face.descent:p/2),s=0,t=j.length;t>s;s++){if("\n"==j[s])k=0,w=0,l=0,q+=p;else{var u=l&&e.glyphs[j[s-1]]||{},w=e.glyphs[j[s]];k+=l?(u.w||e.w)+(u.k&&u.k[j[s]]||0)+e.w*h:0,l=1}w&&w.d&&(m+=c.transformPath(w.d,["t",k*i,q*i,"s",i,i,o,r,"t",(a-o)/i,(b-r)/i]))}}return this.path(m).attr({fill:"#000",stroke:"none"})},X.add=function(a){if(c.is(a,"array"))for(var b,d=this.set(),e=0,f=a.length;f>e;e++)b=a[e]||{},Y[A](b.type)&&d.push(this[b.type]().attr(b));return d},c.format=function(a,b){var d=c.is(b,F)?[0][C](b):arguments;return a&&c.is(a,E)&&d.length-1&&(a=a.replace(sb,function(a,b){return null==d[++b]?v:d[b]})),a||v},c.fullfill=function(){var a=/\{([^\}]+)\}/g,b=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,c=function(a,c,d){var e=d;return c.replace(b,function(a,b,c,d,f){b=b||d,e&&(b in e&&(e=e[b]),"function"==typeof e&&f&&(e=e()))}),e=(null==e||e==d?a:e)+""};return function(b,d){return String(b).replace(a,function(a,b){return c(a,b,d)})}}(),c.ninja=function(){return R.was?Q.win.Raphael=R.is:delete Raphael,c};var Rc=c.vml&&.5||0;return c.crispBound=Zb(function(a,b,c,d,e){var f,g={};return a=a||0,b=b||0,c=c||0,d=d||0,e=e||0,f=e%2/2+Rc,g.x=kb(a+f)-f,g.y=kb(b+f)-f,g.width=kb(a+c+f)-f-g.x,g.height=kb(b+d+f)-f-g.y,g["stroke-width"]=e,0===g.width&&0!==c&&(g.width=1),0===g.height&&0!==d&&(g.height=1),g},c),xc.crisp=function(){var a,b=this,d=b.attrs,e=b.attr(["x","y","width","height","stroke-width"]);e=c.crispBound(e.x,e.y,e.width,e.height,e["stroke-width"]);for(a in e)d[a]===e[a]&&delete e[a];return b.attr(e)},c.st=Pc,c.define=function(a,b,d,e,f,g){var h,i;if(c.is(a,F))for(h=0,i=a.length;i>h;h++)c.define(a[h]);else{if(c.is(a,G))return void c.define(a.name,a[a.name],a.ca,a.fn,a.e,a.data);if(a&&!c.fn[a])return c.fn[a]=function(){var g,h=arguments,i=b.apply(this,h);if(e&&c.is(e,G))for(g in e)i[g]=e[g];if(f&&c.is(f,G))for(g in f)i[g]&&i[g](f[g]);if(d){if(c.is(d,"function"))i.ca[a]=d;else for(g in d)i.ca[g]=d[g];i.ca[a]&&(c._lastArgIfGroup(h,!0),i.attr(a,O.call(h)))}return i},d&&(c.fn[a].ca=d),e&&(c.fn[a].fn=e),f&&(c.fn[a].e=f),g&&(c.fn[a].data=g),c.fn[a]}},function(a,b,d){function e(){/in/.test(a.readyState)?setTimeout(e,9):c.eve("raphael.DOMload")}null==a.readyState&&a.addEventListener&&(a.addEventListener(b,d=function(){a.removeEventListener(b,d,!1),a.readyState="complete"},!1),a.readyState="loading"),e()}(document,"DOMContentLoaded"),b.on("raphael.DOMload",function(){t=!0}),function(){if(c.svg){var a="hasOwnProperty",b=String,d=parseFloat,e=parseInt,f=Math,g=f.max,h=f.abs,i=f.pow,j=f.sqrt,k=/[, ]+/,l=!(!/AppleWebKit/.test(c._g.win.navigator.userAgent)||/Chrome/.test(c._g.win.navigator.userAgent)&&!(c._g.win.navigator.appVersion.match(/Chrome\/(\d+)\./)[1]<29)),m=c.eve,n="",o=" ",p="http://www.w3.org/1999/xlink",q={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},r={};c.toString=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version},c._url=n;var s=function(a,b){var c=a.gradient;if(c){if(c===b)return;c.refCount--,c.refCount||(c.parentNode.removeChild(c),delete a.gradient)}b&&(a.gradient=b,b.refCount++)},t=c._createNode=function(d,e){if(e){"string"==typeof d&&(d=t(d));for(var f in e)e[a](f)&&("xlink:"==f.substring(0,6)?d.setAttributeNS(p,f.substring(6),b(e[f])):d.setAttribute(f,b(e[f])))}else d=c._g.doc.createElementNS("http://www.w3.org/2000/svg",d);return d},u={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},v={pad:"pad",redlect:"reflect",repeat:"repeat"},w=function(a,e){if(!a.paper||!a.paper.defs)return 0;var k,l,m,o,p,q="linear",r=a.paper,w=(r.id+"-"+e).replace(/[\(\)\s,\xb0#]/g,"_"),x=.5,y=.5,z=a.node,A=z.style,B=c._g.doc.getElementById(w);if(!B){if(e=b(e).replace(c._radial_gradient,function(a,b){q="radial",b=b&&b.split(",")||[],o=b[5],p=b[6];var c,e,f=b[0],g=b[1],h=b[2],r=b[3],s=b[4],t=f&&g;return h&&(k=/\%/.test(h)?h:d(h)),o===u.userSpaceOnUse?(t&&(x=f,y=g),r&&s&&(l=r,m=s,t||(x=l,y=m)),n):(t&&(x=d(f),y=d(g),c=2*(y>.5)-1,(e=i(x-.5,2))+i(y-.5,2)>.25&&.25>e&&(y=j(.25-e)*c+.5)&&.5!==y&&(y=y.toFixed(5)-1e-5*c)),r&&s&&(l=d(r),m=d(s),c=2*(m>.5)-1,(e=i(l-.5,2))+i(m-.5,2)>.25&&.25>e&&(m=j(.25-e)*c+.5)&&.5!==m&&(m=m.toFixed(5)-1e-5*c),t||(x=l,y=m)),n)}),e=e.split(/\s*\-\s*/),"linear"==q){var C,D,E=e.shift(),F=E.match(/\((.*)\)/);if(F=F&&F[1]&&F[1].split(/\s*\,\s*/),E=-d(E),isNaN(E))return null;F&&F.length?(F[0]in u?(o=F.shift(),F[0]in v&&(p=F.shift())):(F[4]&&(o=F[4]),F[5]&&(p=F[5])),C=[F[0]||"0%",F[1]||"0%",F[2]||"100%",F[3]||"0%"]):(C=[0,0,f.cos(c.rad(E)),f.sin(c.rad(E))],D=1/(g(h(C[2]),h(C[3]))||1),C[2]*=D,C[3]*=D,C[2]<0&&(C[0]=-C[2],C[2]=0),C[3]<0&&(C[1]=-C[3],C[3]=0))}var G=c._parseDots(e);if(!G)return null;B=t(q+"Gradient",{id:w}),B.refCount=0,o in u&&B.setAttribute("gradientUnits",b(o)),p in v&&B.setAttribute("spreadMethod",b(p)),"radial"===q?(void 0!==k&&B.setAttribute("r",b(k)),void 0!==l&&void 0!==m&&(B.setAttribute("cx",b(l)),B.setAttribute("cy",b(m))),B.setAttribute("fx",b(x)),B.setAttribute("fy",b(y))):t(B,{x1:C[0],y1:C[1],x2:C[2],y2:C[3]});for(var H=0,I=G.length;I>H;H++)B.appendChild(t("stop",{offset:G[H].offset?G[H].offset:H?"100%":"0%","stop-color":G[H].color||"#fff","stop-opacity":void 0===G[H].opacity?1:G[H].opacity}));r.defs.appendChild(B) -}return s(a,B),t(z,{fill:"url('"+c._url+"#"+w+"')",opacity:1,"fill-opacity":1}),A.fill=n,A.opacity=1,A.fillOpacity=1,1},x=function(a){var b=a.getBBox(1);t(a.pattern,{patternTransform:a.matrix.invert()+" translate("+b.x+","+b.y+")"})},y=function(d,e,f){if("path"==d.type){for(var g,h,i,j,k,l=b(e).toLowerCase().split("-"),m=d.paper,o=f?"end":"start",p=d.node,s=d.attrs,u=s["stroke-width"],v=l.length,w="classic",x=3,y=3,z=5;v--;)switch(l[v]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":w=l[v];break;case"wide":y=5;break;case"narrow":y=2;break;case"long":x=5;break;case"short":x=2}if("open"==w?(x+=2,y+=2,z+=2,i=1,j=f?4:1,k={fill:"none",stroke:s.stroke}):(j=i=x/2,k={fill:s.stroke,stroke:"none"}),d._.arrows?f?(d._.arrows.endPath&&r[d._.arrows.endPath]--,d._.arrows.endMarker&&r[d._.arrows.endMarker]--):(d._.arrows.startPath&&r[d._.arrows.startPath]--,d._.arrows.startMarker&&r[d._.arrows.startMarker]--):d._.arrows={},"none"!=w){var A="raphael-marker-"+w,B="raphael-marker-"+o+w+x+y+"-obj"+d.id;c._g.doc.getElementById(A)?r[A]++:(m.defs.appendChild(t(t("path"),{"stroke-linecap":"round",d:q[w],id:A})),r[A]=1);var C,D=c._g.doc.getElementById(B);D?(r[B]++,C=D.getElementsByTagName("use")[0]):(D=t(t("marker"),{id:B,markerHeight:y,markerWidth:x,orient:"auto",refX:j,refY:y/2}),C=t(t("use"),{"xlink:href":"#"+A,transform:(f?"rotate(180 "+x/2+" "+y/2+") ":n)+"scale("+x/z+","+y/z+")","stroke-width":(1/((x/z+y/z)/2)).toFixed(4)}),D.appendChild(C),m.defs.appendChild(D),r[B]=1),t(C,k);var E=i*("diamond"!=w&&"oval"!=w);f?(g=d._.arrows.startdx*u||0,h=c.getTotalLength(s.path)-E*u):(g=E*u,h=c.getTotalLength(s.path)-(d._.arrows.enddx*u||0)),k={},k["marker-"+o]="url('"+c._url+"#"+B+"')",(h||g)&&(k.d=Raphael.getSubpath(s.path,g,h)),t(p,k),d._.arrows[o+"Path"]=A,d._.arrows[o+"Marker"]=B,d._.arrows[o+"dx"]=E,d._.arrows[o+"Type"]=w,d._.arrows[o+"String"]=e}else f?(g=d._.arrows.startdx*u||0,h=c.getTotalLength(s.path)-g):(g=0,h=c.getTotalLength(s.path)-(d._.arrows.enddx*u||0)),d._.arrows[o+"Path"]&&t(p,{d:Raphael.getSubpath(s.path,g,h)}),delete d._.arrows[o+"Path"],delete d._.arrows[o+"Marker"],delete d._.arrows[o+"dx"],delete d._.arrows[o+"Type"],delete d._.arrows[o+"String"];for(k in r)if(r[a](k)&&!r[k]){var F=c._g.doc.getElementById(k);F&&F.parentNode.removeChild(F)}}},z={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},A=function(a,d,e){var f=z[b(d).toLowerCase()];if(d=f||void 0!==d&&[].concat(d)){var g,h=a.attrs["stroke-width"]||"1",i={round:h,square:h,butt:0}[a.attrs["stroke-linecap"]||e["stroke-linecap"]]||0,j=g=d.length;if(f)for(;g--;)d[g]=d[g]*h+(g%2?1:-1)*i;else for(g=0;j>g;g+=2)d[g]-=i,d[g+1]&&(d[g+1]+=i),d[g]<=0&&(d[g]=.1);c.is(d,"array")&&t(a.node,{"stroke-dasharray":d.join(",")})}},B=c._setFillAndStroke=function(d,f){if(d.paper.canvas){var i=d.node,j=d.attrs,m=d.paper,o=i.style,q=o.visibility;o.visibility="hidden";for(var r in f)if(f[a](r)){if(!c._availableAttrs[a](r))continue;var u=f[r];switch(j[r]=u,r){case"blur":d.blur(u);break;case"href":case"title":case"target":var v=i.parentNode;if("a"!=v.tagName.toLowerCase()){if(u==n)break;var z=t("a");z.raphael=!0,z.raphaelid=i.raphaelid,v.insertBefore(z,i),z.appendChild(i),v=z}"target"==r?v.setAttributeNS(p,"show","blank"==u?"new":u):v.setAttributeNS(p,r,u),i.titleNode=v;break;case"cursor":o.cursor=u;break;case"transform":d.transform(u);break;case"rotation":c.is(u,"array")?d.rotate.apply(d,u):d.rotate(u);break;case"arrow-start":y(d,u);break;case"arrow-end":y(d,u,1);break;case"clip-path":var B=!0;case"clip-rect":var C=!B&&b(u).split(k);if(d._.clipispath=!!B,B||4==C.length){d.clip&&d.clip.parentNode.parentNode.removeChild(d.clip.parentNode);var E=t("clipPath"),F=t(B?"path":"rect");E.id=c.createUUID(),t(F,B?{d:u?j["clip-path"]=c._pathToAbsolute(u):c._availableAttrs.path,fill:"none"}:{x:C[0],y:C[1],width:C[2],height:C[3],transform:d.matrix.invert()}),E.appendChild(F),m.defs.appendChild(E),t(i,{"clip-path":"url('"+c._url+"#"+E.id+"')"}),d.clip=F}if(!u){var G=i.getAttribute("clip-path");if(G){var H=c._g.doc.getElementById(G.replace(/(^url\(#|\)$)/g,n));H&&H.parentNode.removeChild(H),t(i,{"clip-path":n}),delete d.clip}}break;case"path":"path"==d.type&&(t(i,{d:u?j.path=c._pathToAbsolute(u):c._availableAttrs.path}),d._.dirty=1,d._.arrows&&("startString"in d._.arrows&&y(d,d._.arrows.startString),"endString"in d._.arrows&&y(d,d._.arrows.endString,1)));break;case"width":if(i.setAttribute(r,u),d._.dirty=1,!j.fx)break;r="x",u=j.x;case"x":j.fx&&(u=-j.x-(j.width||0));case"rx":if("rx"==r&&"rect"==d.type)break;case"cx":i.setAttribute(r,u),d.pattern&&x(d),d._.dirty=1;break;case"height":if(i.setAttribute(r,u),d._.dirty=1,!j.fy)break;r="y",u=j.y;case"y":j.fy&&(u=-j.y-(j.height||0));case"ry":if("ry"==r&&"rect"==d.type)break;case"cy":i.setAttribute(r,u),d.pattern&&x(d),d._.dirty=1;break;case"r":"rect"==d.type?t(i,{rx:u,ry:u}):i.setAttribute(r,u),d._.dirty=1;break;case"src":"image"==d.type&&i.setAttributeNS(p,"href",u);break;case"stroke-width":(1!=d._.sx||1!=d._.sy)&&(u/=g(h(d._.sx),h(d._.sy))||1),m._vbSize&&(u*=m._vbSize),l&&0===u&&(u=1e-6),i.setAttribute(r,u),j["stroke-dasharray"]&&A(d,j["stroke-dasharray"],f),d._.arrows&&("startString"in d._.arrows&&y(d,d._.arrows.startString),"endString"in d._.arrows&&y(d,d._.arrows.endString,1));break;case"stroke-dasharray":A(d,u,f);break;case"fill":var I=b(u).match(c._ISURL);if(I){E=t("pattern");var J=t("image");E.id=c.createUUID(),t(E,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),t(J,{x:0,y:0,"xlink:href":I[1]}),E.appendChild(J),function(a){c._preload(I[1],function(){var b=this.offsetWidth,c=this.offsetHeight;t(a,{width:b,height:c}),t(J,{width:b,height:c}),m.safari()})}(E),m.defs.appendChild(E),t(i,{fill:"url('"+c._url+"#"+E.id+"')"}),d.pattern=E,d.pattern&&x(d);break}var K=c.getRGB(u);if(K.error){if(("circle"==d.type||"ellipse"==d.type||"r"!=b(u).charAt())&&w(d,u)){if("opacity"in j||"fill-opacity"in j){var L=c._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,n));if(L){var M=L.getElementsByTagName("stop");t(M[M.length-1],{"stop-opacity":("opacity"in j?j.opacity:1)*("fill-opacity"in j?j["fill-opacity"]:1)})}}j.gradient=u,j.fill="none";break}}else delete f.gradient,delete j.gradient,!c.is(j.opacity,"undefined")&&c.is(f.opacity,"undefined")&&t(i,{opacity:j.opacity}),!c.is(j["fill-opacity"],"undefined")&&c.is(f["fill-opacity"],"undefined")&&t(i,{"fill-opacity":j["fill-opacity"]}),d.gradient&&s(d);K[a]("opacity")?(t(i,{"fill-opacity":o.fillOpacity=K.opacity>1?K.opacity/100:K.opacity}),d._.opacitydirty=!0):d._.opacitydirty&&c.is(j["fill-opacity"],"undefined")&&c.is(f["fill-opacity"],"undefined")&&(i.removeAttribute("fill-opacity"),o.fillOpacity=n,delete d._.opacitydirty);case"stroke":K=c.getRGB(u),i.setAttribute(r,K.hex),"stroke"==r&&K[a]("opacity")&&t(i,{"stroke-opacity":K.opacity>1?K.opacity/100:K.opacity}),"stroke"==r&&d._.arrows&&("startString"in d._.arrows&&y(d,d._.arrows.startString),"endString"in d._.arrows&&y(d,d._.arrows.endString,1));break;case"gradient":("circle"==d.type||"ellipse"==d.type||"r"!=b(u).charAt())&&w(d,u);break;case"line-height":case"vertical-align":break;case"visibility":"hidden"===u?d.hide():d.show();break;case"opacity":j.gradient&&!j[a]("stroke-opacity")&&t(i,{"stroke-opacity":u>1?u/100:u});case"fill-opacity":if(j.gradient){L=c._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,n)),L&&(M=L.getElementsByTagName("stop"),t(M[M.length-1],{"stop-opacity":u}));break}default:"font-size"==r&&(u=e(u,10)+"px");var N=r.replace(/(\-.)/g,function(a){return a.substring(1).toUpperCase()});o[N]=u,d._.dirty=1,i.setAttribute(r,u)}}D(d,f),o.visibility=q}},C=1.2,D=function(e,f){if("text"==e.type&&(f[a]("text")||f[a]("font")||f[a]("font-size")||f[a]("x")||f[a]("y")||f[a]("line-height")||f[a]("vertical-align"))){var g=e.attrs,h=e.node,i=h.firstChild&&c._g.doc.defaultView.getComputedStyle(h.firstChild,n),j=i?d(c._g.doc.defaultView.getComputedStyle(h.firstChild,n).getPropertyValue("font-size")):10,k=d(f["line-height"]||g["line-height"])||j*C,l=g[a]("vertical-align")?g["vertical-align"]:"middle";if(isNaN(k)&&(k=j*C),l="top"===l?-.5:"bottom"===l?.5:0,f[a]("text")&&(f.text!==g.text||e._textdirty)){for(g.text=f.text;h.firstChild;)h.removeChild(h.firstChild);for(var m,o=b(f.text).split(/\n|/gi),p=[],q=0,r=o.length;r>q;q++)m=t("tspan"),q?t(m,{dy:k,x:g.x}):t(m,{dy:k*o.length*l,x:g.x}),o[q]||(m.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o[q]=" "),m.appendChild(c._g.doc.createTextNode(o[q])),h.appendChild(m),p[q]=m;e._textdirty=!1}else for(p=h.getElementsByTagName("tspan"),q=0,r=p.length;r>q;q++)q?t(p[q],{dy:k,x:g.x}):t(p[0],{dy:k*p.length*l,x:g.x});t(h,{x:g.x,y:g.y}),e._.dirty=1;var s=e._getBBox(),u=g.y-(s.y+s.height/2);if(s.isCalculated)switch(g["vertical-align"]){case"top":u=.75*s.height;break;case"bottom":u=-(.25*s.height);break;default:u=g.y-(s.y+.25*s.height)}u&&c.is(u,"finite")&&p[0]&&t(p[0],{dy:u})}},E=function(a,b,d){var e=this,f=d||b;f.canvas&&f.canvas.appendChild(a),e.node=e[0]=a,a.raphael=!0,a.raphaelid=e.id=c._oid++,e.matrix=c.matrix(),e.realPath=null,e.attrs=e.attrs||{},e.followers=e.followers||[],e.paper=b,e.ca=e.customAttributes=e.customAttributes||new b._CustomAttributes,e._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},e.parent=f,!f.bottom&&(f.bottom=e),e.prev=f.top,f.top&&(f.top.next=e),f.top=e,e.next=null},F=c.el;E.prototype=F,F.constructor=E,c._engine.getNode=function(a){var b=a.node||a[0].node;return b.titleNode||b},c._engine.getLastNode=function(a){var b=a.node||a[a.length-1].node;return b.titleNode||b},F.rotate=function(a,c,e){var f,g=this;return g.removed?g:(a=b(a).split(k),a.length-1&&(c=d(a[1]),e=d(a[2])),a=d(a[0]),null==e&&(c=e),(null==c||null==e)&&(f=g.getBBox(1),c=f.x+f.width/2,e=f.y+f.height/2),g.transform(g._.transform.concat([["r",a,c,e]])),g)},F.scale=function(a,c,e,f){var g,h=this;return h.removed?h:(a=b(a).split(k),a.length-1&&(c=d(a[1]),e=d(a[2]),f=d(a[3])),a=d(a[0]),null==c&&(c=a),null==f&&(e=f),(null==e||null==f)&&(g=h.getBBox(1)),e=null==e?g.x+g.width/2:e,f=null==f?g.y+g.height/2:f,h.transform(h._.transform.concat([["s",a,c,e,f]])),h)},F.translate=function(a,c){var e=this;return e.removed?e:(a=b(a).split(k),a.length-1&&(c=d(a[1])),a=d(a[0])||0,c=+c||0,e.transform(e._.transform.concat([["t",a,c]])),e)},F.transform=function(b){var d,e=this,f=e._;return null==b?f.transform:(c._extractTransform(e,b),e.clip&&!f.clipispath&&t(e.clip,{transform:e.matrix.invert()}),e.pattern&&x(e),e.node&&t(e.node,{transform:e.matrix}),(1!=f.sx||1!=f.sy)&&(d=e.attrs[a]("stroke-width")?e.attrs["stroke-width"]:1,e.attr({"stroke-width":d})),e)},F.hide=function(){var a=this;return!a.removed&&a.paper.safari(a.node.style.display="none"),a},F.show=function(){var a=this;return!a.removed&&a.paper.safari(a.node.style.display=n),a},F.remove=function(){if(!this.removed&&this.parent.canvas){var a,b=this,d=c._engine.getNode(b),e=b.paper,f=e.defs;for(e.__set__&&e.__set__.exclude(b),m.unbind("raphael.*.*."+b.id),b.gradient&&f&&s(b);a=b.followers.pop();)a.el.remove();for(;a=b.bottom;)a.remove();if(b.events)for(;a=b.events.pop();)a.unbind();b.parent.canvas.removeChild(d),b.removeData(),delete e._elementsById[b.id],c._tear(b,b.parent);for(a in b)b[a]="function"==typeof b[a]?c._removedFactory(a):null;b.removed=!0}},F._getBBox=function(){var a,b,c=this,d=c.node,e={},f=c.attrs;"none"===d.style.display&&(c.show(),b=!0);try{e=d.getBBox(),"text"==c.type&&(void 0===e.x&&(e.isCalculated=!0,a=f["text-anchor"],e.x=(f.x||0)-e.width*("start"===a?0:"middle"===a?.5:1)),void 0===e.y&&(e.isCalculated=!0,a=f["vertical-align"],e.y=(f.y||0)-e.height*("bottom"===a?1:"middle"===a?.5:0)))}catch(g){}finally{e=e||{}}return b&&c.hide(),e},F.attr=function(b,d){if(this.removed)return this;if(null==b){var e={};for(var f in this.attrs)this.attrs[a](f)&&(e[f]=this.attrs[f]);return e.gradient&&"none"==e.fill&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform,e.visibility="none"===this.node.style.display?"hidden":"visible",e}if(null==d&&c.is(b,"string")){if("fill"==b&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("transform"==b)return this._.transform;if("visibility"==b)return"none"===this.node.style.display?"hidden":"visible";for(var g=b.split(k),h={},i=0,j=g.length;j>i;i++)b=g[i],h[b]=b in this.attrs?this.attrs[b]:c.is(this.ca[b],"function")?this.ca[b].def:c._availableAttrs[b];return j-1?h:h[g[0]]}if(null==d&&c.is(b,"array")){for(h={},i=0,j=b.length;j>i;i++)h[b[i]]=this.attr(b[i]);return h}if(null!=d){var l={};l[b]=d}else null!=b&&c.is(b,"object")&&(l=b);for(var n in l)m("raphael.attr."+n+"."+this.id,this,l[n],n);var o={};for(n in this.ca)if(this.ca[n]&&l[a](n)&&c.is(this.ca[n],"function")&&!this.ca["_invoked"+n]){this.ca["_invoked"+n]=!0;var p=this.ca[n].apply(this,[].concat(l[n]));delete this.ca["_invoked"+n];for(var q in p)p[a](q)&&(l[q]=p[q]);this.attrs[n]=l[n],p===!1&&(o[n]=l[n],delete l[n])}B(this,l);var r;for(i=0,j=this.followers.length;j>i;i++)r=this.followers[i],r.cb&&!r.cb.call(r.el,l,this)||r.el.attr(l);for(q in o)l[q]=o[q];return this},F.blur=function(a){var b=this;if(0!==+a){var d=t("filter"),e=t("feGaussianBlur");b.attrs.blur=a,d.id=c.createUUID(),t(e,{stdDeviation:+a||1.5}),d.appendChild(e),b.paper.defs.appendChild(d),b._blur=d,t(b.node,{filter:"url('"+c._url+"#"+d.id+"')"})}else b._blur&&(b._blur.parentNode.removeChild(b._blur),delete b._blur,delete b.attrs.blur),b.node.removeAttribute("filter")},F.on=function(a,b){if(this.removed)return this;var d=b;return c.supportsTouch&&(a=c._touchMap[a]||"click"===a&&"touchstart"||a,d=function(a){a.preventDefault(),b()}),this.node["on"+a]=d,this},c._engine.path=function(a,b,c){var d=t("path"),e=new E(d,a,c);return e.type="path",B(e,b),e},c._engine.group=function(a,b,c){var d=t("g"),e=new E(d,a,c);return e.type="group",e.canvas=e.node,e.top=e.bottom=null,e._id=b||n,b&&d.setAttribute("class","raphael-group-"+e.id+"-"+b),e},c._engine.circle=function(a,b,c){var d=t("circle"),e=new E(d,a,c);return e.type="circle",B(e,b),e},c._engine.rect=function(a,b,c){var d=t("rect"),e=new E(d,a,c);return e.type="rect",b.rx=b.ry=b.r,B(e,b),e},c._engine.ellipse=function(a,b,c){var d=t("ellipse"),e=new E(d,a,c);return e.type="ellipse",B(e,b),e},c._engine.image=function(a,b,c){var d=t("image"),e=(b.src,new E(d,a,c));return e.type="image",d.setAttribute("preserveAspectRatio","none"),B(e,b),e},c._engine.text=function(a,b,c){var d=t("text"),e=new E(d,a,c);return e.type="text",e._textdirty=!0,B(e,b),e},c._engine.setSize=function(a,b){return this.width=a||this.width,this.height=b||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},c._engine.create=function(){var a=c._getContainer.apply(0,arguments),b=a&&a.container,d=a.x,e=a.y,f=a.width,g=a.height;if(!b)throw new Error("SVG container not found.");var h,i=t("svg"),j="overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-user-select:none;-moz-user-select:-moz-none;-khtml-user-select:none;-ms-user-select:none;user-select:none;-o-user-select:none;cursor:default;";return d=d||0,e=e||0,f=f||512,g=g||342,t(i,{height:g,version:1.1,width:f,xmlns:"http://www.w3.org/2000/svg"}),1==b?(i.style.cssText=j+"position:absolute;left:"+d+"px;top:"+e+"px",c._g.doc.body.appendChild(i),h=1):(i.style.cssText=j+"position:relative",b.firstChild?b.insertBefore(i,b.firstChild):b.appendChild(i)),b=new c._Paper,b.width=f,b.height=g,b.canvas=i,t(i,{id:"raphael-paper-"+b.id}),b.clear(),b._left=b._top=0,h&&(b.renderfix=function(){}),b.renderfix(),b},c._engine.setViewBox=function(a,b,c,d,e){m("raphael.setViewBox",this,this._viewBox,[a,b,c,d,e]);var f,h,i=g(c/this.width,d/this.height),j=this.top,k=e?"meet":"xMinYMin";for(null==a?(this._vbSize&&(i=1),delete this._vbSize,f="0 0 "+this.width+o+this.height):(this._vbSize=i,f=a+o+b+o+c+o+d),t(this.canvas,{viewBox:f,preserveAspectRatio:k});i&&j;)h="stroke-width"in j.attrs?j.attrs["stroke-width"]:1,j.attr({"stroke-width":h}),j._.dirty=1,j._.dirtyT=1,j=j.prev;return this._viewBox=[a,b,c,d,!!e],this},c.prototype.renderfix=function(){var a,b=this.canvas,c=b.style;try{a=b.getScreenCTM()||b.createSVGMatrix()}catch(d){a=b.createSVGMatrix()}var e=-a.e%1,f=-a.f%1;(e||f)&&(e&&(this._left=(this._left+e)%1,c.left=this._left+"px"),f&&(this._top=(this._top+f)%1,c.top=this._top+"px"))},c.prototype._desc=function(a){var b=this.desc;if(b)for(;b.firstChild;)b.removeChild(b.firstChild);else this.desc=b=t("desc"),this.canvas.appendChild(b);b.appendChild(c._g.doc.createTextNode(c.is(a,"string")?a:"Created with Red Raphaël "+c.version))},c.prototype.clear=function(){var a;for(m("raphael.clear",this);a=this.bottom;)a.remove();for(a=this.canvas;a.firstChild;)a.removeChild(a.firstChild);this.bottom=this.top=null,a.appendChild(this.desc=t("desc")),a.appendChild(this.defs=t("defs"))},c.prototype.remove=function(){var a;for(m("raphael.remove",this);a=this.bottom;)a.remove();this.defs&&this.defs.parentNode.removeChild(this.defs),this.desc&&this.desc.parentNode.removeChild(this.desc),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(a in this)this[a]="function"==typeof this[a]?c._removedFactory(a):null;this.removed=!0};var G=c.st;for(var H in F)F[a](H)&&!G[a](H)&&(G[H]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(H))}}(),function(){if(c.vml){var a="hasOwnProperty",b=String,d=parseFloat,e=Math,f=e.round,g=e.max,i=e.min,j=e.sqrt,k=e.abs,l="fill",m=/[, ]+/,n=c.eve,o=" progid:DXImageTransform.Microsoft",p=" ",q="",r={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},s=/([clmz]),?([^clmz]*)/gi,t=/ progid:\S+Blur\([^\)]+\)/g,u=/-?[^,\s-]+/g,v="position:absolute;left:0;top:0;width:1px;height:1px",z=21600,A={path:1,rect:1,image:1},B={circle:1,ellipse:1},C=function(a){var d=/[ahqstv]/gi,e=c._pathToAbsolute;if(b(a).match(d)&&(e=c._path2curve),d=/[clmz]/g,e==c._pathToAbsolute&&!b(a).match(d)){var g=b(a).replace(s,function(a,b,c){var d=[],e="m"==b.toLowerCase(),g=r[b];return c.replace(u,function(a){e&&2==d.length&&(g+=d+r["m"==b?"l":"L"],d=[]),d.push(f(a*z))}),g+d});return g||"m0,0"}var h,i,j=e(a);g=[];for(var k=0,l=j.length;l>k;k++){h=j[k],i=j[k][0].toLowerCase(),"z"==i&&(i="x");for(var m=1,n=h.length;n>m;m++)i+=f(h[m]*z)+(m!=n-1?",":q);g.push(i)}return g.length?g.join(p):"m0,0"},D=function(a,b,d){var e=c.matrix();return e.rotate(-a,.5,.5),{dx:e.x(b,d),dy:e.y(b,d)}},E=function(a,b,c,d,e,f){var g=a._,h=a.matrix,i=g.fillpos,j=a.node,m=j.style,n=1,o="",q=z/b,r=z/c;if(m.visibility="hidden",b&&c){if(j.coordsize=k(q)+p+k(r),m.rotation=f*(0>b*c?-1:1),f){var s=D(f,d,e);d=s.dx,e=s.dy}if(0>b&&(o+="x"),0>c&&(o+=" y")&&(n=-1),m.flip=o,j.coordorigin=d*-q+p+e*-r,i||g.fillsize){var t=j.getElementsByTagName(l);t=t&&t[0],j.removeChild(t),i&&(s=D(f,h.x(i[0],i[1]),h.y(i[0],i[1])),t.position=s.dx*n+p+s.dy*n),g.fillsize&&(t.size=g.fillsize[0]*k(b)+p+g.fillsize[1]*k(c)),j.appendChild(t)}m.visibility="visible"}};c._url=q,c.toString=function(){return"Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël "+this.version};var F=function(a,c,d){for(var e=b(c).toLowerCase().split("-"),f=d?"end":"start",g=e.length,h="classic",i="medium",j="medium";g--;)switch(e[g]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":h=e[g];break;case"wide":case"narrow":j=e[g];break;case"long":case"short":i=e[g]}var k=a.node.getElementsByTagName("stroke")[0];k[f+"arrow"]=h,k[f+"arrowlength"]=i,k[f+"arrowwidth"]=j},G=c._setFillAndStroke=function(e,h){if(e.paper.canvas){e.attrs=e.attrs||{};var j=e.node,k=e.attrs,n=j.style,o=A[e.type]&&(h.x!=k.x||h.y!=k.y||h.width!=k.width||h.height!=k.height||h.cx!=k.cx||h.cy!=k.cy||h.rx!=k.rx||h.ry!=k.ry||h.r!=k.r),r=B[e.type]&&(k.cx!=h.cx||k.cy!=h.cy||k.r!=h.r||k.rx!=h.rx||k.ry!=h.ry),s="group"===e.type,t=e;for(var u in h)h[a](u)&&(k[u]=h[u]);if(o&&(k.path=c._getPath[e.type](e),e._.dirty=1),h.href&&(j.href=h.href),h.title&&(j.title=h.title),h.target&&(j.target=h.target),h.cursor&&(n.cursor=h.cursor),"blur"in h&&e.blur(h.blur),(h.path&&"path"==e.type||o)&&(j.path=C(~b(k.path).toLowerCase().indexOf("r")?c._pathToAbsolute(k.path):k.path),"image"==e.type&&(e._.fillpos=[k.x,k.y],e._.fillsize=[k.width,k.height],E(e,1,1,0,0,0))),"transform"in h&&e.transform(h.transform),"rotation"in h){var v=h.rotation;c.is(v,"array")?e.rotate.apply(e,v):e.rotate(v)}if("visibility"in h&&("hidden"===h.visibility?e.hide():e.show()),r){var w=+k.cx,x=+k.cy,y=+k.rx||+k.r||0,D=+k.ry||+k.r||0;j.path=c.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",f((w-y)*z),f((x-D)*z),f((w+y)*z),f((x+D)*z),f(w*z))}if("clip-rect"in h){var G=b(h["clip-rect"]).split(m);if(4==G.length){G[0]=+G[0],G[1]=+G[1],G[2]=+G[2]+G[0],G[3]=+G[3]+G[1];var I,J=s?j:j.clipRect||c._g.doc.createElement("div"),L=J.style;s?(e.clip=G.slice(),I=e.matrix.offset(),I=[d(I[0]),d(I[1])],G[0]-=I[0],G[1]-=I[1],G[2]-=I[0],G[3]-=I[1],L.width="10800px",L.height="10800px"):j.clipRect||(L.top="0",L.left="0",L.width=e.paper.width+"px",L.height=e.paper.height+"px",j.parentNode.insertBefore(J,j),J.appendChild(j),J.raphael=!0,J.raphaelid=j.raphaelid,j.clipRect=J),L.position="absolute",L.clip=c.format("rect({1}px {2}px {3}px {0}px)",G)}h["clip-rect"]||(s&&e.clip?(j.style.clip="rect(auto auto auto auto)",delete e.clip):j.clipRect&&(j.clipRect.style.clip="rect(auto auto auto auto)"))}if(e.textpath){var M=e.textpath.style;h.font&&(M.font=h.font),h["font-family"]&&(M.fontFamily='"'+h["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,q)+'"'),h["font-size"]&&(M.fontSize=h["font-size"]),h["font-weight"]&&(M.fontWeight=h["font-weight"]),h["font-style"]&&(M.fontStyle=h["font-style"])}if("arrow-start"in h&&F(t,h["arrow-start"]),"arrow-end"in h&&F(t,h["arrow-end"],1),null!=h.opacity||null!=h["stroke-width"]||null!=h.fill||null!=h.src||null!=h.stroke||null!=h["stroke-width"]||null!=h["stroke-opacity"]||null!=h["fill-opacity"]||null!=h["stroke-dasharray"]||null!=h["stroke-miterlimit"]||null!=h["stroke-linejoin"]||null!=h["stroke-linecap"]){var N=j.getElementsByTagName(l),O=!1,P=-1;if(N=N&&N[0],!N&&(O=N=K(l)),"image"==e.type&&h.src&&(N.src=h.src),h.fill&&(N.on=!0),(null==N.on||"none"==h.fill||null===h.fill)&&(N.on=!1),N.on&&h.fill){var Q=b(h.fill).match(c._ISURL);if(Q){N.parentNode==j&&j.removeChild(N),N.rotate=!0,N.src=Q[1],N.type="tile";var R=e.getBBox(1);N.position=R.x+p+R.y,e._.fillpos=[R.x,R.y],c._preload(Q[1],function(){e._.fillsize=[this.offsetWidth,this.offsetHeight]})}else{var S=c.getRGB(h.fill);N.color=S.hex,N.src=q,N.type="solid",S.error&&(t.type in{circle:1,ellipse:1}||"r"!=b(h.fill).charAt())&&H(t,h.fill,N)?(k.fill="none",k.gradient=h.fill,N.rotate=!1):"opacity"in S&&!("fill-opacity"in h)&&(P=S.opacity)}}if(-1!==P||"fill-opacity"in h||"opacity"in h){var T=((+k["fill-opacity"]+1||2)-1)*((+k.opacity+1||2)-1)*((+P+1||2)-1);T=i(g(T,0),1),N.opacity=T,N.src&&(N.color="none")}j.appendChild(N);var U=j.getElementsByTagName("stroke")&&j.getElementsByTagName("stroke")[0],V=!1;!U&&(V=U=K("stroke")),(h.stroke&&"none"!=h.stroke||h["stroke-width"]||null!=h["stroke-opacity"]||h["stroke-dasharray"]||h["stroke-miterlimit"]||h["stroke-linejoin"]||h["stroke-linecap"])&&(U.on=!0),("none"==h.stroke||null===h.stroke||null==U.on||0==h.stroke||0==h["stroke-width"])&&(U.on=!1);var W=c.getRGB("stroke"in h?h.stroke:k.stroke);U.on&&h.stroke&&(U.color=W.hex),T=((+k["stroke-opacity"]+1||2)-1)*((+k.opacity+1||2)-1)*((+W.opacity+1||2)-1);var X=.75*(d(h["stroke-width"])||1);if(T=i(g(T,0),1),null==h["stroke-width"]&&(X=k["stroke-width"]),h["stroke-width"]&&(U.weight=X),X&&1>X&&(T*=X)&&(U.weight=1),U.opacity=T,h["stroke-linejoin"]&&(U.joinstyle=h["stroke-linejoin"])||V&&(V.joinstyle="miter"),U.miterlimit=h["stroke-miterlimit"]||8,h["stroke-linecap"]&&(U.endcap="butt"==h["stroke-linecap"]?"flat":"square"==h["stroke-linecap"]?"square":"round"),h["stroke-dasharray"]){var Y={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};U.dashstyle=Y[a](h["stroke-dasharray"])?Y[h["stroke-dasharray"]]:h["stroke-dasharray"].join&&h["stroke-dasharray"].join(" ")||q}V&&j.appendChild(U)}if("text"==t.type){t.paper.canvas.style.display=q;var Z=t.paper.span,$=100,_=k.font&&k.font.match(/\d+(?:\.\d*)?(?=px)/),ab=k["line-height"]&&(k["line-height"]+q).match(/\d+(?:\.\d*)?(?=px)/);n=Z.style,k.font&&(n.font=k.font),k["font-family"]&&(n.fontFamily=k["font-family"]),k["font-weight"]&&(n.fontWeight=k["font-weight"]),k["font-style"]&&(n.fontStyle=k["font-style"]),_=d(k["font-size"]||_&&_[0])||10,n.fontSize=_*$+"px",ab=d(k["line-height"]||ab&&ab[0])||12,k["line-height"]&&(n.lineHeight=ab*$+"px"),t.textpath.string&&(Z.innerHTML=b(t.textpath.string).replace(/"));var bb=Z.getBoundingClientRect();t.W=k.w=(bb.right-bb.left)/$,t.H=k.h=(bb.bottom-bb.top)/$,t.X=k.x,t.Y=k.y;switch(k["vertical-align"]){case"top":t.bby=t.H/2;break;case"bottom":t.bby=-t.H/2;break;default:t.bby=0}("x"in h||"y"in h||void 0!==t.bby)&&(t.path.v=c.format("m{0},{1}l{2},{1}",f(k.x*z),f((k.y+(t.bby||0))*z),f(k.x*z)+1));for(var cb=["x","y","text","font","font-family","font-weight","font-style","font-size","line-height"],db=0,eb=cb.length;eb>db;db++)if(cb[db]in h){t._.dirty=1;break}switch(k["text-anchor"]){case"start":t.textpath.style["v-text-align"]="left",t.bbx=t.W/2;break;case"end":t.textpath.style["v-text-align"]="right",t.bbx=-t.W/2;break;default:t.textpath.style["v-text-align"]="center",t.bbx=0}t.textpath.style["v-text-kern"]=!0}}},H=function(a,e,f){a.attrs=a.attrs||{};var g=(a.attrs,Math.pow),h="linear",i=".5 .5";if(a.attrs.gradient=e,e=b(e).replace(c._radial_gradient,function(a,b){h="radial",b=b&&b.split(",")||[];{var c=(b[0],b[1],b[2],b[3]),e=b[4];b[5]}return c&&e&&(c=d(c),e=d(e),g(c-.5,2)+g(e-.5,2)>.25&&(e=j(.25-g(c-.5,2))*(2*(e>.5)-1)+.5),i=c+p+e),q}),e=e.split(/\s*\-\s*/),"linear"==h){var k=e.shift();if(k=-d(k),isNaN(k))return null}var l=c._parseDots(e);if(!l)return null;if(a=a.shape||a.node,l.length){f.parentNode==a&&a.removeChild(f),f.on=!0,f.method="none",f.color=l[0].color,f.color2=l[l.length-1].color;for(var m=[],n=1,o=void 0===l[0].opacity?1:l[0].opacity,r=0,s=l.length;s>r;r++)l[r].offset&&m.push(l[r].offset+p+l[r].color),void 0!==l[r].opacity&&(n=l[r].opacity);f.colors=m.length?m.join():"0% "+f.color,f.opacity=n,f["o:opacity2"]=o,"radial"==h?(f.type="gradientTitle",f.focus="100%",f.focussize="0 0",f.focusposition=i,f.angle=0):(f.type="gradient",f.angle=(270-k)%360),a.appendChild(f)}return 1},I=function(a,b,d){var e,f=this,g=d||b;g.canvas&&g.canvas.appendChild(a),e=K("skew"),e.on=!0,a.appendChild(e),f.skew=e,f.node=f[0]=a,a.raphael=!0,a.raphaelid=f.id=c._oid++,f.X=0,f.Y=0,f.attrs=f.attrs||{},f.followers=f.followers||[],f.paper=b,f.ca=f.customAttributes=f.customAttributes||new b._CustomAttributes,f.matrix=c.matrix(),f._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},f.parent=g,!g.bottom&&(g.bottom=f),f.prev=g.top,g.top&&(g.top.next=f),g.top=f,f.next=null},J=c.el;I.prototype=J,J.constructor=I,J.transform=function(a){if(null==a)return this._.transform;var d,e=this.paper._viewBoxShift,f=e?"s"+[e.scale,e.scale]+"-1-1t"+[e.dx,e.dy]:q;e&&(d=a=b(a).replace(/\.{3}|\u2026/g,this._.transform||q)),c._extractTransform(this,f+a);var g,h=this.matrix.clone(),i=this.skew,j=this.node,k=~b(this.attrs.fill).indexOf("-"),l=!b(this.attrs.fill).indexOf("url(");if(h.translate(-.5,-.5),l||k||"image"==this.type)if(i.matrix="1 0 0 1",i.offset="0 0",g=h.split(),k&&g.noRotation||!g.isSimple){j.style.filter=h.toFilter();var m=this.getBBox(),n=this.getBBox(1),o=m.x2&&n.x2&&"x2"||"x",r=m.y2&&n.y2&&"y2"||"y",s=m[o]-n[o],t=m[r]-n[r];j.coordorigin=s*-z+p+t*-z,E(this,1,1,s,t,0)}else j.style.filter=q,E(this,g.scalex,g.scaley,g.dx,g.dy,g.rotate);else j.style.filter=q,i.matrix=b(h),i.offset=h.offset();return d&&(this._.transform=d),this},J.rotate=function(a,c,e){if(this.removed)return this;if(null!=a){if(a=b(a).split(m),a.length-1&&(c=d(a[1]),e=d(a[2])),a=d(a[0]),null==e&&(c=e),null==c||null==e){var f=this.getBBox(1);c=f.x+f.width/2,e=f.y+f.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",a,c,e]])),this}},J.translate=function(a,c){return this.removed?this:(a=b(a).split(m),a.length-1&&(c=d(a[1])),a=d(a[0])||0,c=+c||0,this._.bbox&&(this._.bbox.x+=a,this._.bbox.y+=c),this.transform(this._.transform.concat([["t",a,c]])),this)},J.scale=function(a,c,e,f){if(this.removed)return this;if(a=b(a).split(m),a.length-1&&(c=d(a[1]),e=d(a[2]),f=d(a[3]),isNaN(e)&&(e=null),isNaN(f)&&(f=null)),a=d(a[0]),null==c&&(c=a),null==f&&(e=f),null==e||null==f)var g=this.getBBox(1);return e=null==e?g.x+g.width/2:e,f=null==f?g.y+g.height/2:f,this.transform(this._.transform.concat([["s",a,c,e,f]])),this._.dirtyT=1,this},J.hide=function(){var a=this;return!a.removed&&(a.node.style.display="none"),a},J.show=function(){var a=this;return!a.removed&&(a.node.style.display=q),a},J._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y+(this.bby||0)-this.H/2,width:this.W,height:this.H}},J.remove=function(){if(!this.removed&&this.parent.canvas){var a,b=this,d=c._engine.getNode(b),e=b.paper,f=b.shape;for(e.__set__&&e.__set__.exclude(b),n.unbind("raphael.*.*."+b.id);a=b.followers.pop();)a.el.remove();for(;a=b.bottom;)a.remove();if(b.events)for(;a=b.events.pop();)a.unbind();f&&f.parentNode.removeChild(f),d.clipRect&&b.node.clipRect.parentNode.removeChild(d.clipRect),d.clipRect=null,d.parentNode&&d.parentNode.removeChild(d),b.removeData(),delete e._elementsById[b.id],c._tear(b,b.parent);for(var a in b)b[a]="function"==typeof b[a]?c._removedFactory(a):null;b.removed=!0}},J.attr=function(b,d){if(this.removed)return this;if(null==b){var e={};for(var f in this.attrs)this.attrs[a](f)&&(e[f]=this.attrs[f]);return e.gradient&&"none"==e.fill&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform,e.visibility="none"===this.node.style.display?"hidden":"visible",e}if(null==d&&c.is(b,"string")){if(b==l&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("visibility"==b)return"none"===this.node.style.display?"hidden":"visible";for(var g=b.split(m),h={},i=0,j=g.length;j>i;i++)b=g[i],h[b]=b in this.attrs?this.attrs[b]:c.is(this.ca[b],"function")?this.ca[b].def:c._availableAttrs[b];return j-1?h:h[g[0]]}if(this.attrs&&null==d&&c.is(b,"array")){for(h={},i=0,j=b.length;j>i;i++)h[b[i]]=this.attr(b[i]);return h}var k;null!=d&&(k={},k[b]=d),null==d&&c.is(b,"object")&&(k=b);for(var o in k)n("raphael.attr."+o+"."+this.id,this,k[o],o);if(k){var p={};for(o in this.ca)if(this.ca[o]&&k[a](o)&&c.is(this.ca[o],"function")&&!this.ca["_invoked"+o]){this.ca["_invoked"+o]=!0;var q=this.ca[o].apply(this,[].concat(k[o]));delete this.ca["_invoked"+o];for(var r in q)q[a](r)&&(k[r]=q[r]);this.attrs[o]=k[o],q===!1&&(p[o]=k[o],delete k[o])}"text"in k&&"text"==this.type&&(this.textpath.string=k.text.replace(//gi,"\n")),G(this,k);var s;for(i=0,j=this.followers.length;j>i;i++)s=this.followers[i],s.cb&&!s.cb.call(s.el,k,this)||s.el.attr(k);for(var r in p)k[r]=p[r]}return this},J.blur=function(a){var b=this.node.runtimeStyle,d=b.filter;return d=d.replace(t,q),0!==+a?(this.attrs.blur=a,b.filter=d+p+o+".Blur(pixelradius="+(+a||1.5)+")",b.margin=c.format("-{0}px 0 0 -{0}px",f(+a||1.5))):(b.filter=d,b.margin=0,delete this.attrs.blur),this},J.on=function(a,b){return this.removed?this:(this.node["on"+a]=function(){var a=c._g.win.event;a.target=a.srcElement,b(a)},this)},c._engine.getNode=function(a){var b=a.node||a[0].node;return b.clipRect||b},c._engine.getLastNode=function(a){var b=a.node||a[a.length-1].node;return b.clipRect||b},c._engine.group=function(a,b,d){var e=c._g.doc.createElement("div"),f=new I(e,a,d);return e.style.cssText=v,f._id=b||q,b&&(e.className="raphael-group-"+f.id+"-"+b),(d||a).canvas.appendChild(e),f.type="group",f.canvas=f.node,f.transform=c._engine.group.transform,f.top=null,f.bottom=null,f +},c._insertafter=function(a,b,c,d){jc(a,c),a.parent=d,b===d.top&&(d.top=a),b.next&&(b.next.prev=a),a.next=b.next,a.prev=b,b.next=a},c._insertbefore=function(a,b,c,d){jc(a,c),a.parent=d,b===d.bottom&&(d.bottom=a),b.prev&&(b.prev.next=a),a.prev=b.prev,b.prev=a,a.next=b},c.toMatrix=function(a,b){var c=_b(a),d={_:{transform:v},getBBox:function(){return c}};return lc(d,b),d.matrix}),lc=(c.transformPath=function(a,b){return Lb(a,kc(a,b))},c._extractTransform=function(a,b){if(null==b)return a._.transform;b=_(b).replace(/\.{3}|\u2026/g,a._.transform||v);var d=c.parseTransformString(b),e=0,f=0,g=0,h=1,i=1,j=a._,k=new n;if(j.transform=d||[],d)for(var l=0,m=d.length;m>l;l++){var o,p,q,r,s,t=d[l],u=t.length,w=_(t[0]).toLowerCase(),x=t[0]!=w,y=x?k.invert():0;"t"==w&&3==u?x?(o=y.x(0,0),p=y.y(0,0),q=y.x(t[1],t[2]),r=y.y(t[1],t[2]),k.translate(q-o,r-p)):k.translate(t[1],t[2]):"r"==w?2==u?(s=s||a.getBBox(1),k.rotate(t[1],s.x+s.width/2,s.y+s.height/2),e+=t[1]):4==u&&(x?(q=y.x(t[2],t[3]),r=y.y(t[2],t[3]),k.rotate(t[1],q,r)):k.rotate(t[1],t[2],t[3]),e+=t[1]):"s"==w?2==u||3==u?(s=s||a.getBBox(1),k.scale(t[1],t[u-1],s.x+s.width/2,s.y+s.height/2),h*=t[1],i*=t[u-1]):5==u&&(x?(q=y.x(t[3],t[4]),r=y.y(t[3],t[4]),k.scale(t[1],t[2],q,r)):k.scale(t[1],t[2],t[3],t[4]),h*=t[1],i*=t[2]):"m"==w&&7==u&&k.add(t[1],t[2],t[3],t[4],t[5],t[6]),j.dirtyT=1,a.matrix=k}a.matrix=k,j.sx=h,j.sy=i,j.deg=e,j.dx=f=k.e,j.dy=g=k.f,1==h&&1==i&&!e&&j.bbox?(j.bbox.x+=+f,j.bbox.y+=+g):j.dirtyT=1}),mc=function(a){var b=a[0];switch(b.toLowerCase()){case"t":return[b,0,0];case"m":return[b,1,0,0,1,0,0];case"r":return 4==a.length?[b,0,a[2],a[3]]:[b,0];case"s":return 5==a.length?[b,1,1,a[3],a[4]]:3==a.length?[b,1,1]:[b,1]}},nc=c._equaliseTransform=function(a,b){b=_(b).replace(/\.{3}|\u2026/g,a),a=c.parseTransformString(a)||[],b=c.parseTransformString(b)||[];for(var d,e,f,g,h=db(a.length,b.length),i=[],j=[],k=0;h>k;k++){if(f=a[k]||mc(b[k]),g=b[k]||mc(f),f[0]!=g[0]||"r"==f[0].toLowerCase()&&(f[2]!=g[2]||f[3]!=g[3])||"s"==f[0].toLowerCase()&&(f[3]!=g[3]||f[4]!=g[4]))return;for(i[k]=[],j[k]=[],d=0,e=db(f.length,g.length);e>d;d++)d in f&&(i[k][d]=f[d]),d in g&&(j[k][d]=g[d])}return{from:i,to:j}};c._getContainer=function(a,b,d,e){var f;return f=null!=e||c.is(a,G)?a:Q.doc.getElementById(a),null!=f?f.tagName?null==b?{container:f,width:f.style.pixelWidth||f.offsetWidth,height:f.style.pixelHeight||f.offsetHeight}:{container:f,width:b,height:d}:{container:1,x:a,y:b,width:d,height:e}:void 0},c.pathToRelative=bc,c._engine={},c.path2curve=ic,c.matrix=function(a,b,c,d,e,f){return new n(a,b,c,d,e,f)},function(a){function b(a){return a[0]*a[0]+a[1]*a[1]}function d(a){var c=jb(b(a));a[0]&&(a[0]/=c),a[1]&&(a[1]/=c)}a.add=function(a,b,c,d,e,f){var g,h,i,j,k=[[],[],[]],l=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],m=[[a,c,e],[b,d,f],[0,0,1]];for(a&&a instanceof n&&(m=[[a.a,a.c,a.e],[a.b,a.d,a.f],[0,0,1]]),g=0;3>g;g++)for(h=0;3>h;h++){for(j=0,i=0;3>i;i++)j+=l[g][i]*m[i][h];k[g][h]=j}this.a=k[0][0],this.b=k[1][0],this.c=k[0][1],this.d=k[1][1],this.e=k[0][2],this.f=k[1][2]},a.invert=function(){var a=this,b=a.a*a.d-a.b*a.c;return new n(a.d/b,-a.b/b,-a.c/b,a.a/b,(a.c*a.f-a.d*a.e)/b,(a.b*a.e-a.a*a.f)/b)},a.clone=function(){return new n(this.a,this.b,this.c,this.d,this.e,this.f)},a.translate=function(a,b){this.add(1,0,0,1,a,b)},a.scale=function(a,b,c,d){null==b&&(b=a),(c||d)&&this.add(1,0,0,1,c,d),this.add(a,0,0,b,0,0),(c||d)&&this.add(1,0,0,1,-c,-d)},a.rotate=function(a,b,d){a=c.rad(a),b=b||0,d=d||0;var e=+hb(a).toFixed(9),f=+ib(a).toFixed(9);this.add(e,f,-f,e,b,d),this.add(1,0,0,1,-b,-d)},a.x=function(a,b){return a*this.a+b*this.c+this.e},a.y=function(a,b){return a*this.b+b*this.d+this.f},a.get=function(a){return+this[_.fromCharCode(97+a)].toFixed(4)},a.toString=function(){return c.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},a.toMatrixString=function(){return"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")"},a.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},a.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},a.split=function(){var a={};a.dx=this.e,a.dy=this.f;var e=[[this.a,this.c],[this.b,this.d]];a.scalex=jb(b(e[0])),d(e[0]),a.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*a.shear,e[1][1]-e[0][1]*a.shear],a.scaley=jb(b(e[1])),d(e[1]),a.shear/=a.scaley;var f=-e[0][1],g=e[1][1];return 0>g?(a.rotate=c.deg(cb.acos(g)),0>f&&(a.rotate=360-a.rotate)):a.rotate=c.deg(cb.asin(f)),a.isSimple=!(+a.shear.toFixed(9)||a.scalex.toFixed(9)!=a.scaley.toFixed(9)&&a.rotate),a.isSuperSimple=!+a.shear.toFixed(9)&&a.scalex.toFixed(9)==a.scaley.toFixed(9)&&!a.rotate,a.noRotation=!+a.shear.toFixed(9)&&!a.rotate,a},a.toTransformString=function(a){var b=a||this[I]();return b.isSimple?(b.scalex=+b.scalex.toFixed(4),b.scaley=+b.scaley.toFixed(4),b.rotate=+b.rotate.toFixed(4),(b.dx||b.dy?"t"+[b.dx,b.dy]:v)+(1!=b.scalex||1!=b.scaley?"s"+[b.scalex,b.scaley,0,0]:v)+(b.rotate?"r"+[b.rotate,0,0]:v)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(n.prototype);var oc=navigator.userAgent.match(/Version\/(.*?)\s/)||navigator.userAgent.match(/Chrome\/(\d+)/);X.safari="Apple Computer, Inc."==navigator.vendor&&(oc&&oc[1]<4||"iP"==navigator.platform.slice(0,2))||"Google Inc."==navigator.vendor&&oc&&oc[1]<8?function(){var a=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});return setTimeout(function(){a.remove()}),!0}:Gb;for(var pc=function(){this.returnValue=!1},qc=function(){return this.originalEvent.preventDefault()},rc=function(){this.cancelBubble=!0},sc=function(){return this.originalEvent.stopPropagation()},tc=c.addEvent=function(){return Q.doc.addEventListener?function(a,b,c,d){var e=U&&$[b]?$[b]:b,f=function(e){var f=Q.doc.documentElement.scrollTop||Q.doc.body.scrollTop,g=Q.doc.documentElement.scrollLeft||Q.doc.body.scrollLeft;if(U&&$[A](b))for(var h=0,i=e.targetTouches&&e.targetTouches.length;i>h;h++)if(e.targetTouches[h].target==a){var j=e;e=e.targetTouches[h],e.originalEvent=j,e.preventDefault=qc,e.stopPropagation=sc;break}return c.call(d,e,e.clientX+g,e.clientY+f)};return a.addEventListener(e,f,!1),function(){return a.removeEventListener(e,f,!1),!0}}:Q.doc.attachEvent?function(a,b,c,d){var e=function(a){a=a||Q.win.event;var b=Q.doc.documentElement.scrollTop||Q.doc.body.scrollTop,e=Q.doc.documentElement.scrollLeft||Q.doc.body.scrollLeft,f=a.clientX+e,g=a.clientY+b;return a.preventDefault=a.preventDefault||pc,a.stopPropagation=a.stopPropagation||rc,c.call(d,a,f,g)};a.attachEvent("on"+b,e);var f=function(){return a.detachEvent("on"+b,e),!0};return f}:void 0}(),uc=[],vc=function(a){for(var c,d=a.clientX,e=a.clientY,f=Q.doc.documentElement.scrollTop||Q.doc.body.scrollTop,g=Q.doc.documentElement.scrollLeft||Q.doc.body.scrollLeft,h=uc.length;h--;){if(c=uc[h],U){for(var i,j=a.touches.length;j--;)if(i=a.touches[j],i.identifier==c.el._drag.id){d=i.clientX,e=i.clientY,(a.originalEvent?a.originalEvent:a).preventDefault();break}}else a.preventDefault();var k,l=c.el.node,m=l.nextSibling,n=l.parentNode,o=l.style.display;Q.win.opera&&n.removeChild(l),l.style.display="none",k=c.el.paper.getElementByPoint(d,e),l.style.display=o,Q.win.opera&&(m?n.insertBefore(l,m):n.appendChild(l)),k&&b("raphael.drag.over."+c.el.id,c.el,k),d+=g,e+=f,b("raphael.drag.move."+c.el.id,c.move_scope||c.el,d-c.el._drag.x,e-c.el._drag.y,d,e,a)}},wc=function(a){c.unmousemove(vc).unmouseup(wc);for(var d,e=uc.length;e--;)d=uc[e],d.el._drag={},b("raphael.drag.end."+d.el.id,d.end_scope||d.start_scope||d.move_scope||d.el,a);uc=[]},xc=c.el={},yc=Z.length;yc--;)!function(a){c[a]=xc[a]=function(b,d){return c.is(b,"function")&&(this.events=this.events||[],this.events.push({name:a,f:b,unbind:tc(this.shape||this.node||Q.doc,a,b,d||this)})),this},c["un"+a]=xc["un"+a]=function(b){for(var c=this.events||[],d=c.length;d--;)if(c[d].name==a&&c[d].f==b)return c[d].unbind(),c.splice(d,1),!c.length&&delete this.events,this;return this}}(Z[yc]);xc.data=function(a,d){var e=Eb[this.id]=Eb[this.id]||{};if(1==arguments.length){if(c.is(a,G)){for(var f in a)a[A](f)&&this.data(f,a[f]);return this}return b("raphael.data.get."+this.id,this,e[a],a),e[a]}return e[a]=d,b("raphael.data.set."+this.id,this,d,a),this},xc.removeData=function(a){return null==a?Eb[this.id]={}:Eb[this.id]&&delete Eb[this.id][a],this},xc.getData=function(){return Qb(Eb[this.id]||{})};var zc=[],Ac=function(){this.untrack=tc(Q.doc,"mouseup",Bc,this)},Bc=function(){return this.untrack(),this.untrack=null,this.fn&&this.fn.apply(this.scope||this.el,arguments)};xc.mouseup=function(a,b,d){return d?(zc.push(d={el:this,fn:a,scope:b}),d.unbind=tc(this.shape||this.node||Q.doc,"mousedown",Ac,d),this):c.mouseup.apply(this,arguments)},xc.unmouseup=function(a){for(var b,d=zc.length;d--;)zc[d].el===this&&zc[d].fn===a&&(b=zc[d],b.unbind(),b.untrack&&b.untrack(),zc.splice(d,1));return b?this:c.unmouseup.apply(this,arguments)},xc.hover=function(a,b,c,d){return this.mouseover(a,c).mouseout(b,d||c)},xc.unhover=function(a,b){return this.unmouseover(a).unmouseout(b)};var Cc=[];xc.drag=function(a,d,e,f,g,h){function i(i){(i.originalEvent||i).preventDefault();var j=Q.doc.documentElement.scrollTop||Q.doc.body.scrollTop,k=Q.doc.documentElement.scrollLeft||Q.doc.body.scrollLeft;this._drag.x=i.clientX+k,this._drag.y=i.clientY+j,this._drag.id=i.identifier,!uc.length&&c.mousemove(vc).mouseup(wc),uc.push({el:this,move_scope:f,start_scope:g,end_scope:h}),d&&b.on("raphael.drag.start."+this.id,d),a&&b.on("raphael.drag.move."+this.id,a),e&&b.on("raphael.drag.end."+this.id,e),b("raphael.drag.start."+this.id,g||f||this,i.clientX+k,i.clientY+j,i)}return this._drag={},Cc.push({el:this,start:i}),this.mousedown(i),this},xc.onDragOver=function(a){a?b.on("raphael.drag.over."+this.id,a):b.unbind("raphael.drag.over."+this.id)},xc.undrag=function(){for(var a=Cc.length;a--;)Cc[a].el==this&&(this.unmousedown(Cc[a].start),Cc.splice(a,1),b.unbind("raphael.drag.*."+this.id));!Cc.length&&c.unmousemove(vc).unmouseup(wc)},xc.follow=function(a,b,d){return a.removed||a.constructor!==c.el.constructor?this:(a.followers.push({el:this,stalk:d={before:"insertBefore",after:"insertAfter"}[d],cb:b}),d&&this[d](a),this)},xc.unfollow=function(a){if(a.removed||a.constructor!==c.el.constructor)return this;for(var b=0,d=a.followers.length;d>b;b++)if(a.followers[b].el===this){a.followers.splice(b,1);break}return this},X.hide=function(){var a=this;return a.canvas.style.visibility="hidden",a},X.show=function(){var a=this;return a.canvas.style.visibility=v,a},X.group=function(){var a=this,b=arguments,d=Mb(b,!0),e=c._engine.group(a,b[0],d);return a.__set__&&a.__set__.push(e),a._elementsById[e.id]=e},X.circle=function(){var a=this,b=arguments,d=Mb(b,!0),e=Nb(b,"cx",0,"cy",0,"r",0,"fill",J,"stroke",K),f=c._engine.circle(a,e,d);return a.__set__&&a.__set__.push(f),a._elementsById[f.id]=f},X.rect=function(){var a=this,b=arguments,d=Mb(b,!0),e=Nb(b,"x",0,"y",0,"width",0,"height",0,"r",0,"fill",J,"stroke",K),f=c._engine.rect(a,e,d);return a.__set__&&a.__set__.push(f),a._elementsById[f.id]=f},X.ellipse=function(){var a=this,b=arguments,d=Mb(b,!0),e=Nb(b,"x",0,"y",0,"rx",0,"ry",0,"fill",J,"stroke",K),f=c._engine.ellipse(this,e,d);return a.__set__&&a.__set__.push(f),a._elementsById[f.id]=f},X.path=function(){var a=this,b=arguments,d=Mb(b,!0),e=Nb(b,"path",v,"fill",J,"stroke",K),f=c._engine.path(a,e,d);return a.__set__&&a.__set__.push(f),a._elementsById[f.id]=f},X.image=function(){var a=this,b=arguments,d=Mb(b,!0),e=Nb(b,"src","about:blank","x",0,"y",0,"width",0,"height",0);return out=c._engine.image(a,e,d),a.__set__&&a.__set__.push(out),a._elementsById[out.id]=out},X.text=function(){var a=this,b=arguments,d=Mb(b,!0),e=Nb(b,"x",0,"y",0,"text",v,"stroke",J,"fill",K,"text-anchor","middle","vertical-align","middle"),f=c._engine.text(a,e,d);return a.__set__&&a.__set__.push(f),a._elementsById[f.id]=f},X.set=function(a){!c.is(a,"array")&&(a=P.call(arguments,0,arguments.length));var b=new Oc(a);return this.__set__&&this.__set__.push(b),b},X.setStart=function(a){this.__set__=a||this.set()},X.setFinish=function(){var a=this.__set__;return delete this.__set__,a},X.setSize=function(a,b){return c._engine.setSize.call(this,a,b)},X.setViewBox=function(a,b,d,e,f){return c._engine.setViewBox.call(this,a,b,d,e,f)},X.top=X.bottom=null,X.raphael=c;var Dc=function(a){var b=a.getBoundingClientRect(),c=a.ownerDocument,d=c.body,e=c.documentElement,f=e.clientTop||d.clientTop||0,g=e.clientLeft||d.clientLeft||0,h=b.top+(Q.win.pageYOffset||e.scrollTop||d.scrollTop)-f,i=b.left+(Q.win.pageXOffset||e.scrollLeft||d.scrollLeft)-g;return{y:h,x:i}};X.getElementByPoint=function(a,b){var c=this,d=c.canvas,e=Q.doc.elementFromPoint(a,b);if(Q.win.opera&&"svg"==e.tagName){var f=Dc(d),g=d.createSVGRect();g.x=a-f.x,g.y=b-f.y,g.width=g.height=1;var h=d.getIntersectionList(g,null);h.length&&(e=h[h.length-1])}if(!e)return null;for(;e.parentNode&&e!=d.parentNode&&!e.raphael;)e=e.parentNode;return e==c.canvas.parentNode&&(e=d),e=e&&e.raphael?c.getById(e.raphaelid):null},X.getElementsByBBox=function(a){var b=this.set();return this.forEach(function(d){c.isBBoxIntersect(d.getBBox(),a)&&b.push(d)}),b},X.getById=function(a){return this._elementsById[a]||null},X.forEach=function(a,b){for(var c=this.bottom;c;){if(a.call(b,c)===!1)return this;c=c.next}return this},X.getElementsByPoint=function(a,b){var c=this.set();return this.forEach(function(d){d.isPointInside(a,b)&&c.push(d)}),c},xc.isPointInside=function(a,b){var d,e=this.realPath=this.realPath||Kb[this.type](this);return c.isPointInsidePath((d=this.attr("transform"))&&d.length&&c.transformPath(e,d)||e,a,b)},xc.getBBox=function(a){if(this.removed)return{};var b=this._;return a?((b.dirty||!b.bboxwt)&&(this.realPath=Kb[this.type](this),b.bboxwt=_b(this.realPath),b.bboxwt.toString=o,b.dirty=0),b.bboxwt):((b.dirty||b.dirtyT||!b.bbox)&&((b.dirty||!this.realPath)&&(b.bboxwt=0,this.realPath=Kb[this.type](this)),b.bbox=_b(Lb(this.realPath,this.matrix)),b.bbox.toString=o,b.dirty=b.dirtyT=0),b.bbox)},xc.clone=function(){if(this.removed)return null;var a=this,b=a.paper[a.type]().attr(a.attr());return a.__set__&&a.__set__.push(b),b},xc.glow=function(a){if("text"==this.type)return null;a=a||{};var b={width:(a.width||10)+(+this.attr("stroke-width")||1),fill:a.fill||!1,opacity:a.opacity||.5,offsetx:a.offsetx||0,offsety:a.offsety||0,color:a.color||"#000"},c=b.width/2,d=this.paper,e=d.set(),f=this.realPath||Kb[this.type](this);f=this.matrix?Lb(f,this.matrix):f;for(var g=1;c+1>g;g++)e.push(d.path(f).attr({stroke:b.color,fill:b.fill?b.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(b.width/c*g).toFixed(3),opacity:+(b.opacity/c).toFixed(3)}));return e.insertBefore(this).translate(b.offsetx,b.offsety)};var Ec=function(a,b,d,e,f,g,h,k,l){return null==l?i(a,b,d,e,f,g,h,k):c.findDotsAtSegment(a,b,d,e,f,g,h,k,j(a,b,d,e,f,g,h,k,l))},Fc=function(a,b){return function(d,e,f){d=ic(d);for(var g,h,i,j,k,l="",m={},n=0,o=0,p=d.length;p>o;o++){if(i=d[o],"M"==i[0])g=+i[1],h=+i[2];else{if(j=Ec(g,h,i[1],i[2],i[3],i[4],i[5],i[6]),n+j>e){if(b&&!m.start){if(k=Ec(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),l+=["C"+k.start.x,k.start.y,k.m.x,k.m.y,k.x,k.y],f)return l;m.start=l,l=["M"+k.x,k.y+"C"+k.n.x,k.n.y,k.end.x,k.end.y,i[5],i[6]].join(),n+=j,g=+i[5],h=+i[6];continue}if(!a&&!b)return k=Ec(g,h,i[1],i[2],i[3],i[4],i[5],i[6],e-n),{x:k.x,y:k.y,alpha:k.alpha}}n+=j,g=+i[5],h=+i[6]}l+=i.shift()+i}return m.end=l,k=a?n:b?m:c.findDotsAtSegment(g,h,i[0],i[1],i[2],i[3],i[4],i[5],1),k.alpha&&(k={x:k.x,y:k.y,alpha:k.alpha}),k}},Gc=Fc(1),Hc=Fc(),Ic=Fc(0,1);c.getTotalLength=Gc,c.getPointAtLength=Hc,c.getSubpath=function(a,b,c){if(this.getTotalLength(a)-c<1e-6)return Ic(a,b).end;var d=Ic(a,c,1);return b?Ic(d,b).end:d},xc.getTotalLength=function(){return"path"==this.type?this.node.getTotalLength?this.node.getTotalLength():Gc(this.attrs.path):void 0},xc.getPointAtLength=function(a){return"path"==this.type?Hc(this.attrs.path,a):void 0},xc.getSubpath=function(a,b){return"path"==this.type?c.getSubpath(this.attrs.path,a,b):void 0};var Jc=c.easing_formulas={linear:function(a){return a},"<":function(a){return gb(a,1.7)},">":function(a){return gb(a,.48)},"<>":function(a){var b=.48-a/1.04,c=jb(.1734+b*b),d=c-b,e=gb(fb(d),1/3)*(0>d?-1:1),f=-c-b,g=gb(fb(f),1/3)*(0>f?-1:1),h=e+g+.5;return 3*(1-h)*h*h+h*h*h},backIn:function(a){var b=1.70158;return a*a*((b+1)*a-b)},backOut:function(a){a-=1;var b=1.70158;return a*a*((b+1)*a+b)+1},elastic:function(a){return a==!!a?a:gb(2,-10*a)*ib(2*(a-.075)*lb/.3)+1},bounce:function(a){var b,c=7.5625,d=2.75;return 1/d>a?b=c*a*a:2/d>a?(a-=1.5/d,b=c*a*a+.75):2.5/d>a?(a-=2.25/d,b=c*a*a+.9375):(a-=2.625/d,b=c*a*a+.984375),b}};Jc.easeIn=Jc["ease-in"]=Jc["<"],Jc.easeOut=Jc["ease-out"]=Jc[">"],Jc.easeInOut=Jc["ease-in-out"]=Jc["<>"],Jc["back-in"]=Jc.backIn,Jc["back-out"]=Jc.backOut;var Kc=[],Lc=a.requestAnimationFrame||a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame||a.msRequestAnimationFrame||function(a){setTimeout(a,16)},Mc=function(){for(var a=+new Date,d=0;dh))if(i>h){var q=j(h/i);for(var s in k)if(k[A](s)){switch(Db[s]){case D:f=+k[s]+q*i*l[s];break;case"colour":f="rgb("+[Nc(kb(k[s].r+q*i*l[s].r)),Nc(kb(k[s].g+q*i*l[s].g)),Nc(kb(k[s].b+q*i*l[s].b))].join(",")+")";break;case"path":f=[];for(var t=0,u=k[s].length;u>t;t++){f[t]=[k[s][t][0]];for(var v=1,w=k[s][t].length;w>v;v++)f[t][v]=(+k[s][t][v]+q*i*l[s][t][v]).toFixed(4);f[t]=f[t].join(z)}f=f.join(z);break;case"transform":if(l[s].real)for(f=[],t=0,u=k[s].length;u>t;t++)for(f[t]=[k[s][t][0]],v=1,w=k[s][t].length;w>v;v++)f[t][v]=k[s][t][v]+q*i*l[s][t][v];else{var x=function(a){return+k[s][a]+q*i*l[s][a]};f=[["m",x(0),x(1),x(2),x(3),x(4),x(5)]]}break;case"csv":if("clip-rect"==s)for(f=[],t=4;t--;)f[t]=+k[s][t]+q*i*l[s][t];break;default:var y=[][C](k[s]);for(f=[],t=n.ca[s].length;t--;)f[t]=+y[t]+q*i*l[s][t]}o[s]=f}n.attr(o),function(a,c,d){setTimeout(function(){b("raphael.anim.frame."+a,c,d)})}(n.id,n,e.anim)}else{if(function(a,d,e){setTimeout(function(){b("raphael.anim.frame."+d.id,d,e),b("raphael.anim.finish."+d.id,d,e),c.is(a,"function")&&a.call(d)})}(e.callback,n,e.anim),n.attr(m),Kc.splice(d--,1),e.repeat>1&&!e.next){for(g in m)m[A](g)&&(p[g]=e.totalOrigin[g]);e.el.attr(p),r(e.anim,e.el,e.anim.percents[0],null,e.totalOrigin,e.repeat-1)}e.next&&!e.stop&&r(e.anim,e.el,e.next,null,e.totalOrigin,e.repeat)}}}c.svg&&n&&n.paper&&n.paper.safari(),Kc.length&&Lc(Mc)},Nc=function(a){return a>255?255:0>a?0:a};xc.animateWith=function(a,b,d,e,f,g){var h=this;if(h.removed)return g&&g.call(h),h;var i=d instanceof q?d:c.animation(d,e,f,g);r(i,h,i.percents[0],null,h.attr());for(var j=0,k=Kc.length;k>j;j++)if(Kc[j].anim==b&&Kc[j].el==a){Kc[k-1].start=Kc[j].start;break}return h},xc.onAnimation=function(a){return a?b.on("raphael.anim.frame."+this.id,a):b.unbind("raphael.anim.frame."+this.id),this},q.prototype.delay=function(a){var b=new q(this.anim,this.ms);return b.times=this.times,b.del=+a||0,b},q.prototype.repeat=function(a){var b=new q(this.anim,this.ms);return b.del=this.del,b.times=cb.floor(db(a,0))||1,b},c.animation=function(a,b,d,e){if(a instanceof q)return a;(c.is(d,"function")||!d)&&(e=e||d||null,d=null),a=Object(a),b=+b||0;var f,g,h={};for(g in a)a[A](g)&&ab(g)!=g&&ab(g)+"%"!=g&&(f=!0,h[g]=a[g]);return f?(d&&(h.easing=d),e&&(h.callback=e),new q({100:h},b)):new q(a,b)},xc.animate=function(a,b,d,e){var f=this;if(f.removed)return e&&e.call(f),f;var g=a instanceof q?a:c.animation(a,b,d,e);return r(g,f,g.percents[0],null,f.attr()),f},xc.setTime=function(a,b){return a&&null!=b&&this.status(a,eb(b,a.ms)/a.ms),this},xc.status=function(a,b){var c,d,e=[],f=0;if(null!=b)return r(a,this,-1,eb(b,1)),this;for(c=Kc.length;c>f;f++)if(d=Kc[f],d.el.id==this.id&&(!a||d.anim==a)){if(a)return d.status;e.push({anim:d.anim,status:d.status})}return a?0:e},xc.pause=function(a){for(var c=0;cb;b++)(a=h[b]).stalk&&a.el[a.stalk](e);return e},xc.toBack=function(){if(this.removed)return this;var a,b,d,e=this,f=c._engine.getNode(e),g=e.parent,h=e.followers;for(c._toback(e,g)&&g.canvas.insertBefore(f,g.canvas.firstChild),b=0,d=h.length;d>b;b++)(a=h[b]).stalk&&a.el[a.stalk](e);return e},xc.insertAfter=function(a){if(this.removed)return this;var b,d,e,f=this,g=c._engine.getNode(f),h=c._engine.getLastNode(a),i=a.parent.canvas,j=f.followers;for(h.nextSibling?i.insertBefore(g,h.nextSibling):i.appendChild(g),c._insertafter(f,a,f.parent,a.parent),d=0,e=j.length;e>d;d++)(b=j[d]).stalk&&b.el[b.stalk](a);return f},xc.insertBefore=function(a){if(this.removed)return this;var b,d,e,f=this,g=c._engine.getNode(f),h=c._engine.getNode(a),i=f.followers;for(a.parent.canvas.insertBefore(g,h),c._insertbefore(f,a,f.parent,a.parent),f.parent=a.parent,d=0,e=i.length;e>d;d++)(b=i[d]).stalk&&b.el[b.stalk](a);return this},xc.appendChild=function(a){if(this.removed||"group"!==this.type)return this;var b,d,e,f,g=this,h=g.followers;if(a.parent===g)return a.toFront(),g;for(d=c._engine.getNode(a),c._tear(a,a.parent),g.canvas.appendChild(d),a.parent=g,!g.bottom&&(g.bottom=a),a.prev=g.top,a.next=null,g.top&&(g.top.next=a),g.top=a,e=0,f=h.length;f>e;e++)(b=h[e]).stalk&&b.el[b.stalk](a);return g},xc.removeChild=function(a){if(this.removed||"group"!==this.type||a.parent!==this)return this;var b=this,d=c._engine.getNode(a),e=b.paper;return c._tear(a,b),e.canvas.appendChild(d),b.parent=e,!e.bottom&&(e.bottom=b),b.prev=e.top,e.top&&(e.top.next=b),e.top=b,b.next=null,b};var Oc=function(a){if(this.items=[],this.length=0,this.type="set",a)for(var b=0,c=a.length;c>b;b++)!a[b]||a[b].constructor!=xc.constructor&&a[b].constructor!=Oc||(this[this.items.length]=this.items[this.items.length]=a[b],this.length++)},Pc=Oc.prototype;Pc.push=function(){for(var a,b,c=0,d=arguments.length;d>c;c++)a=arguments[c],!a||a.constructor!=xc.constructor&&a.constructor!=Oc||(b=this.items.length,this[b]=this.items[b]=a,this.length++);return this},Pc.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},Pc.forEach=function(a,b){for(var c=0,d=this.items.length;d>c;c++)if(a.call(b,this.items[c],c)===!1)return this;return this};for(var Qc in xc)xc[A](Qc)&&(Pc[Qc]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a][B](c,b)})}}(Qc));Pc.attr=function(a,b){if(a&&c.is(a,F)&&c.is(a[0],G))for(var d=0,e=a.length;e>d;d++)this.items[d].attr(a[d]);else for(var f=0,g=this.items.length;g>f;f++)this.items[f].attr(a,b);return this},Pc.clear=function(){for(;this.length;)this.pop()},Pc.splice=function(a,b){a=0>a?db(this.length+a,0):a,b=db(0,eb(this.length-a,isNaN(b)&&this.length||b));var c,d=[],e=[],f=[];for(c=2;cc;c++)e.push(this[a+c]);for(;cc?f[c]:d[c-g];for(c=this.items.length=this.length-=b-g;this[c];)delete this[c++];return new Oc(e)},Pc.exclude=function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]==a)return this.splice(b,1),!0},Pc.animate=function(a,b,d,e){(c.is(d,"function")||!d)&&(e=d||null);var f,g,h=this.items.length,i=h,j=this;if(!h)return this;e&&(g=function(){!--h&&e.call(j)}),d=c.is(d,E)?d:g;var k=c.animation(a,b,d,g);for(f=this.items[--i].animate(k);i--;)this.items[i]&&!this.items[i].removed&&this.items[i].animateWith(f,k,k);return this},Pc.insertAfter=function(a){for(var b=this.items.length;b--;)this.items[b].insertAfter(a);return this},Pc.getBBox=function(){for(var a=[],b=[],c=[],d=[],e=this.items.length;e--;)if(!this.items[e].removed){var f=this.items[e].getBBox();a.push(f.x),b.push(f.y),c.push(f.x+f.width),d.push(f.y+f.height)}return a=eb[B](0,a),b=eb[B](0,b),c=db[B](0,c),d=db[B](0,d),{x:a,y:b,x2:c,y2:d,width:c-a,height:d-b}},Pc.clone=function(a){a=new Oc;for(var b=0,c=this.items.length;c>b;b++)a.push(this.items[b].clone());return a},Pc.toString=function(){return"Raphaël‘s set"},Pc.glow=function(a){var b=this.paper.set();return this.forEach(function(c){var d=c.glow(a);null!=d&&d.forEach(function(a){b.push(a)})}),b},c.registerFont=function(a){if(!a.face)return a;this.fonts=this.fonts||{};var b={w:a.w,face:{},glyphs:{}},c=a.face["font-family"];for(var d in a.face)a.face[A](d)&&(b.face[d]=a.face[d]);if(this.fonts[c]?this.fonts[c].push(b):this.fonts[c]=[b],!a.svg){b.face["units-per-em"]=bb(a.face["units-per-em"],10);for(var e in a.glyphs)if(a.glyphs[A](e)){var f=a.glyphs[e];if(b.glyphs[e]={w:f.w,k:{},d:f.d&&"M"+f.d.replace(/[mlcxtrv]/g,function(a){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[a]||"M"})+"z"},f.k)for(var g in f.k)f[A](g)&&(b.glyphs[e].k[g]=f.k[g])}}return a},X.getFont=function(a,b,d,e){if(e=e||"normal",d=d||"normal",b=+b||{normal:400,bold:700,lighter:300,bolder:800}[b]||400,c.fonts){var f=c.fonts[a];if(!f){var g=new RegExp("(^|\\s)"+a.replace(/[^\w\d\s+!~.:_-]/g,v)+"(\\s|$)","i");for(var h in c.fonts)if(c.fonts[A](h)&&g.test(h)){f=c.fonts[h];break}}var i;if(f)for(var j=0,k=f.length;k>j&&(i=f[j],i.face["font-weight"]!=b||i.face["font-style"]!=d&&i.face["font-style"]||i.face["font-stretch"]!=e);j++);return i}},X.print=function(a,b,d,e,f,g,h){g=g||"middle",h=db(eb(h||0,1),-1);var i,j=_(d)[I](v),k=0,l=0,m=v;if(c.is(e,d)&&(e=this.getFont(e)),e){i=(f||16)/e.face["units-per-em"];for(var n=e.face.bbox[I](rb),o=+n[0],p=n[3]-n[1],q=0,r=+n[1]+("baseline"==g?p+ +e.face.descent:p/2),s=0,t=j.length;t>s;s++){if("\n"==j[s])k=0,w=0,l=0,q+=p;else{var u=l&&e.glyphs[j[s-1]]||{},w=e.glyphs[j[s]];k+=l?(u.w||e.w)+(u.k&&u.k[j[s]]||0)+e.w*h:0,l=1}w&&w.d&&(m+=c.transformPath(w.d,["t",k*i,q*i,"s",i,i,o,r,"t",(a-o)/i,(b-r)/i]))}}return this.path(m).attr({fill:"#000",stroke:"none"})},X.add=function(a){if(c.is(a,"array"))for(var b,d=this.set(),e=0,f=a.length;f>e;e++)b=a[e]||{},Y[A](b.type)&&d.push(this[b.type]().attr(b));return d},c.format=function(a,b){var d=c.is(b,F)?[0][C](b):arguments;return a&&c.is(a,E)&&d.length-1&&(a=a.replace(sb,function(a,b){return null==d[++b]?v:d[b]})),a||v},c.fullfill=function(){var a=/\{([^\}]+)\}/g,b=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,c=function(a,c,d){var e=d;return c.replace(b,function(a,b,c,d,f){b=b||d,e&&(b in e&&(e=e[b]),"function"==typeof e&&f&&(e=e()))}),e=(null==e||e==d?a:e)+""};return function(b,d){return String(b).replace(a,function(a,b){return c(a,b,d)})}}(),c.ninja=function(){return R.was?Q.win.Raphael=R.is:delete Raphael,c};var Rc=c.vml&&.5||0;return c.crispBound=Zb(function(a,b,c,d,e){var f,g={};return a=a||0,b=b||0,c=c||0,d=d||0,e=e||0,f=e%2/2+Rc,g.x=kb(a+f)-f,g.y=kb(b+f)-f,g.width=kb(a+c+f)-f-g.x,g.height=kb(b+d+f)-f-g.y,g["stroke-width"]=e,0===g.width&&0!==c&&(g.width=1),0===g.height&&0!==d&&(g.height=1),g},c),xc.crisp=function(){var a,b=this,d=b.attrs,e=b.attr(["x","y","width","height","stroke-width"]);e=c.crispBound(e.x,e.y,e.width,e.height,e["stroke-width"]);for(a in e)d[a]===e[a]&&delete e[a];return b.attr(e)},c.st=Pc,c.define=function(a,b,d,e,f,g){var h,i;if(c.is(a,F))for(h=0,i=a.length;i>h;h++)c.define(a[h]);else{if(c.is(a,G))return void c.define(a.name,a[a.name],a.ca,a.fn,a.e,a.data);if(a&&!c.fn[a])return c.fn[a]=function(){var g,h=arguments,i=b.apply(this,h);if(e&&c.is(e,G))for(g in e)i[g]=e[g];if(f&&c.is(f,G))for(g in f)i[g]&&i[g](f[g]);if(d){if(c.is(d,"function"))i.ca[a]=d;else for(g in d)i.ca[g]=d[g];i.ca[a]&&(c._lastArgIfGroup(h,!0),i.attr(a,O.call(h)))}return i},d&&(c.fn[a].ca=d),e&&(c.fn[a].fn=e),f&&(c.fn[a].e=f),g&&(c.fn[a].data=g),c.fn[a]}},function(a,b,d){function e(){/in/.test(a.readyState)?setTimeout(e,9):c.eve("raphael.DOMload")}null==a.readyState&&a.addEventListener&&(a.addEventListener(b,d=function(){a.removeEventListener(b,d,!1),a.readyState="complete"},!1),a.readyState="loading"),e()}(document,"DOMContentLoaded"),b.on("raphael.DOMload",function(){t=!0}),function(){if(c.svg){var a="hasOwnProperty",b=String,d=parseFloat,e=parseInt,f=Math,g=f.max,h=f.abs,i=f.pow,j=f.sqrt,k=/[, ]+/,l=!(!/AppleWebKit/.test(c._g.win.navigator.userAgent)||/Chrome/.test(c._g.win.navigator.userAgent)&&!(c._g.win.navigator.appVersion.match(/Chrome\/(\d+)\./)[1]<29)),m=c.eve,n="",o=" ",p="http://www.w3.org/1999/xlink",q={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},r={};c.toString=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version},c._url=n;var s=function(a,b){var c=a.gradient;if(c){if(c===b)return;c.refCount--,c.refCount||c.parentNode.removeChild(c),delete a.gradient}b&&(a.gradient=b,b.refCount++)},t=c._createNode=function(d,e){if(e){"string"==typeof d&&(d=t(d));for(var f in e)e[a](f)&&("xlink:"==f.substring(0,6)?d.setAttributeNS(p,f.substring(6),b(e[f])):d.setAttribute(f,b(e[f])))}else d=c._g.doc.createElementNS("http://www.w3.org/2000/svg",d);return d},u={userSpaceOnUse:"userSpaceOnUse",objectBoundingBox:"objectBoundingBox"},v={pad:"pad",redlect:"reflect",repeat:"repeat"},w=function(a,e){if(!a.paper||!a.paper.defs)return 0;var k,l,m,o,p,q="linear",r=a.paper,w=(r.id+"-"+e).replace(/[\(\)\s,\xb0#]/g,"_"),x=.5,y=.5,z=a.node,A=z.style,B=c._g.doc.getElementById(w);if(!B){if(e=b(e).replace(c._radial_gradient,function(a,b){q="radial",b=b&&b.split(",")||[],o=b[5],p=b[6];var c,e,f=b[0],g=b[1],h=b[2],r=b[3],s=b[4],t=f&&g;return h&&(k=/\%/.test(h)?h:d(h)),o===u.userSpaceOnUse?(t&&(x=f,y=g),r&&s&&(l=r,m=s,t||(x=l,y=m)),n):(t&&(x=d(f),y=d(g),c=2*(y>.5)-1,(e=i(x-.5,2))+i(y-.5,2)>.25&&.25>e&&(y=j(.25-e)*c+.5)&&.5!==y&&(y=y.toFixed(5)-1e-5*c)),r&&s&&(l=d(r),m=d(s),c=2*(m>.5)-1,(e=i(l-.5,2))+i(m-.5,2)>.25&&.25>e&&(m=j(.25-e)*c+.5)&&.5!==m&&(m=m.toFixed(5)-1e-5*c),t||(x=l,y=m)),n)}),e=e.split(/\s*\-\s*/),"linear"==q){var C,D,E=e.shift(),F=E.match(/\((.*)\)/);if(F=F&&F[1]&&F[1].split(/\s*\,\s*/),E=-d(E),isNaN(E))return null;F&&F.length?(F[0]in u?(o=F.shift(),F[0]in v&&(p=F.shift())):(F[4]&&(o=F[4]),F[5]&&(p=F[5])),C=[F[0]||"0%",F[1]||"0%",F[2]||"100%",F[3]||"0%"]):(C=[0,0,f.cos(c.rad(E)),f.sin(c.rad(E))],D=1/(g(h(C[2]),h(C[3]))||1),C[2]*=D,C[3]*=D,C[2]<0&&(C[0]=-C[2],C[2]=0),C[3]<0&&(C[1]=-C[3],C[3]=0))}var G=c._parseDots(e);if(!G)return null;B=t(q+"Gradient",{id:w}),B.refCount=0,o in u&&B.setAttribute("gradientUnits",b(o)),p in v&&B.setAttribute("spreadMethod",b(p)),"radial"===q?(void 0!==k&&B.setAttribute("r",b(k)),void 0!==l&&void 0!==m&&(B.setAttribute("cx",b(l)),B.setAttribute("cy",b(m))),B.setAttribute("fx",b(x)),B.setAttribute("fy",b(y))):t(B,{x1:C[0],y1:C[1],x2:C[2],y2:C[3]});for(var H=0,I=G.length;I>H;H++)B.appendChild(t("stop",{offset:G[H].offset?G[H].offset:H?"100%":"0%","stop-color":G[H].color||"#fff","stop-opacity":void 0===G[H].opacity?1:G[H].opacity}));r.defs.appendChild(B) +}return s(a,B),t(z,{fill:"url('"+c._url+"#"+w+"')",opacity:1,"fill-opacity":1}),A.fill=n,A.opacity=1,A.fillOpacity=1,1},x=function(a){var b=a.getBBox(1);t(a.pattern,{patternTransform:a.matrix.invert()+" translate("+b.x+","+b.y+")"})},y=function(d,e,f){if("path"==d.type){for(var g,h,i,j,k,l=b(e).toLowerCase().split("-"),m=d.paper,o=f?"end":"start",p=d.node,s=d.attrs,u=s["stroke-width"],v=l.length,w="classic",x=3,y=3,z=5;v--;)switch(l[v]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":w=l[v];break;case"wide":y=5;break;case"narrow":y=2;break;case"long":x=5;break;case"short":x=2}if("open"==w?(x+=2,y+=2,z+=2,i=1,j=f?4:1,k={fill:"none",stroke:s.stroke}):(j=i=x/2,k={fill:s.stroke,stroke:"none"}),d._.arrows?f?(d._.arrows.endPath&&r[d._.arrows.endPath]--,d._.arrows.endMarker&&r[d._.arrows.endMarker]--):(d._.arrows.startPath&&r[d._.arrows.startPath]--,d._.arrows.startMarker&&r[d._.arrows.startMarker]--):d._.arrows={},"none"!=w){var A="raphael-marker-"+w,B="raphael-marker-"+o+w+x+y+"-obj"+d.id;c._g.doc.getElementById(A)?r[A]++:(m.defs.appendChild(t(t("path"),{"stroke-linecap":"round",d:q[w],id:A})),r[A]=1);var C,D=c._g.doc.getElementById(B);D?(r[B]++,C=D.getElementsByTagName("use")[0]):(D=t(t("marker"),{id:B,markerHeight:y,markerWidth:x,orient:"auto",refX:j,refY:y/2}),C=t(t("use"),{"xlink:href":"#"+A,transform:(f?"rotate(180 "+x/2+" "+y/2+") ":n)+"scale("+x/z+","+y/z+")","stroke-width":(1/((x/z+y/z)/2)).toFixed(4)}),D.appendChild(C),m.defs.appendChild(D),r[B]=1),t(C,k);var E=i*("diamond"!=w&&"oval"!=w);f?(g=d._.arrows.startdx*u||0,h=c.getTotalLength(s.path)-E*u):(g=E*u,h=c.getTotalLength(s.path)-(d._.arrows.enddx*u||0)),k={},k["marker-"+o]="url('"+c._url+"#"+B+"')",(h||g)&&(k.d=Raphael.getSubpath(s.path,g,h)),t(p,k),d._.arrows[o+"Path"]=A,d._.arrows[o+"Marker"]=B,d._.arrows[o+"dx"]=E,d._.arrows[o+"Type"]=w,d._.arrows[o+"String"]=e}else f?(g=d._.arrows.startdx*u||0,h=c.getTotalLength(s.path)-g):(g=0,h=c.getTotalLength(s.path)-(d._.arrows.enddx*u||0)),d._.arrows[o+"Path"]&&t(p,{d:Raphael.getSubpath(s.path,g,h)}),delete d._.arrows[o+"Path"],delete d._.arrows[o+"Marker"],delete d._.arrows[o+"dx"],delete d._.arrows[o+"Type"],delete d._.arrows[o+"String"];for(k in r)if(r[a](k)&&!r[k]){var F=c._g.doc.getElementById(k);F&&F.parentNode.removeChild(F)}}},z={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},A=function(a,d,e){var f=z[b(d).toLowerCase()];if(d=f||void 0!==d&&[].concat(d)){var g,h=a.attrs["stroke-width"]||"1",i={round:h,square:h,butt:0}[a.attrs["stroke-linecap"]||e["stroke-linecap"]]||0,j=g=d.length;if(f)for(;g--;)d[g]=d[g]*h+(g%2?1:-1)*i;else for(g=0;j>g;g+=2)d[g]-=i,d[g+1]&&(d[g+1]+=i),d[g]<=0&&(d[g]=.1);c.is(d,"array")&&t(a.node,{"stroke-dasharray":d.join(",")})}},B=c._setFillAndStroke=function(d,f){if(d.paper.canvas){var i=d.node,j=d.attrs,m=d.paper,o=i.style,q=o.visibility;o.visibility="hidden";for(var r in f)if(f[a](r)){if(!c._availableAttrs[a](r))continue;var u=f[r];switch(j[r]=u,r){case"blur":d.blur(u);break;case"href":case"title":case"target":var v=i.parentNode;if("a"!=v.tagName.toLowerCase()){if(u==n)break;var z=t("a");z.raphael=!0,z.raphaelid=i.raphaelid,v.insertBefore(z,i),z.appendChild(i),v=z}"target"==r?v.setAttributeNS(p,"show","blank"==u?"new":u):v.setAttributeNS(p,r,u),i.titleNode=v;break;case"cursor":o.cursor=u;break;case"transform":d.transform(u);break;case"rotation":c.is(u,"array")?d.rotate.apply(d,u):d.rotate(u);break;case"arrow-start":y(d,u);break;case"arrow-end":y(d,u,1);break;case"clip-path":var B=!0;case"clip-rect":var C=!B&&b(u).split(k);if(d._.clipispath=!!B,B||4==C.length){d.clip&&d.clip.parentNode.parentNode.removeChild(d.clip.parentNode);var E=t("clipPath"),F=t(B?"path":"rect");E.id=c.createUUID(),t(F,B?{d:u?j["clip-path"]=c._pathToAbsolute(u):c._availableAttrs.path,fill:"none"}:{x:C[0],y:C[1],width:C[2],height:C[3],transform:d.matrix.invert()}),E.appendChild(F),m.defs.appendChild(E),t(i,{"clip-path":"url('"+c._url+"#"+E.id+"')"}),d.clip=F}if(!u){var G=i.getAttribute("clip-path");if(G){var H=c._g.doc.getElementById(G.replace(/(^url\(#|\)$)/g,n));H&&H.parentNode.removeChild(H),t(i,{"clip-path":n}),delete d.clip}}break;case"path":"path"==d.type&&(t(i,{d:u?j.path=c._pathToAbsolute(u):c._availableAttrs.path}),d._.dirty=1,d._.arrows&&("startString"in d._.arrows&&y(d,d._.arrows.startString),"endString"in d._.arrows&&y(d,d._.arrows.endString,1)));break;case"width":if(i.setAttribute(r,u),d._.dirty=1,!j.fx)break;r="x",u=j.x;case"x":j.fx&&(u=-j.x-(j.width||0));case"rx":if("rx"==r&&"rect"==d.type)break;case"cx":i.setAttribute(r,u),d.pattern&&x(d),d._.dirty=1;break;case"height":if(i.setAttribute(r,u),d._.dirty=1,!j.fy)break;r="y",u=j.y;case"y":j.fy&&(u=-j.y-(j.height||0));case"ry":if("ry"==r&&"rect"==d.type)break;case"cy":i.setAttribute(r,u),d.pattern&&x(d),d._.dirty=1;break;case"r":"rect"==d.type?t(i,{rx:u,ry:u}):i.setAttribute(r,u),d._.dirty=1;break;case"src":"image"==d.type&&i.setAttributeNS(p,"href",u);break;case"stroke-width":(1!=d._.sx||1!=d._.sy)&&(u/=g(h(d._.sx),h(d._.sy))||1),m._vbSize&&(u*=m._vbSize),l&&0===u&&(u=1e-6),i.setAttribute(r,u),j["stroke-dasharray"]&&A(d,j["stroke-dasharray"],f),d._.arrows&&("startString"in d._.arrows&&y(d,d._.arrows.startString),"endString"in d._.arrows&&y(d,d._.arrows.endString,1));break;case"stroke-dasharray":A(d,u,f);break;case"fill":var I=b(u).match(c._ISURL);if(I){E=t("pattern");var J=t("image");E.id=c.createUUID(),t(E,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),t(J,{x:0,y:0,"xlink:href":I[1]}),E.appendChild(J),function(a){c._preload(I[1],function(){var b=this.offsetWidth,c=this.offsetHeight;t(a,{width:b,height:c}),t(J,{width:b,height:c}),m.safari()})}(E),m.defs.appendChild(E),t(i,{fill:"url('"+c._url+"#"+E.id+"')"}),d.pattern=E,d.pattern&&x(d);break}var K=c.getRGB(u);if(K.error){if(("circle"==d.type||"ellipse"==d.type||"r"!=b(u).charAt())&&w(d,u)){if("opacity"in j||"fill-opacity"in j){var L=c._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,n));if(L){var M=L.getElementsByTagName("stop");t(M[M.length-1],{"stop-opacity":("opacity"in j?j.opacity:1)*("fill-opacity"in j?j["fill-opacity"]:1)})}}j.gradient=u,j.fill="none";break}}else delete f.gradient,delete j.gradient,!c.is(j.opacity,"undefined")&&c.is(f.opacity,"undefined")&&t(i,{opacity:j.opacity}),!c.is(j["fill-opacity"],"undefined")&&c.is(f["fill-opacity"],"undefined")&&t(i,{"fill-opacity":j["fill-opacity"]}),d.gradient&&s(d);K[a]("opacity")?(t(i,{"fill-opacity":o.fillOpacity=K.opacity>1?K.opacity/100:K.opacity}),d._.opacitydirty=!0):d._.opacitydirty&&c.is(j["fill-opacity"],"undefined")&&c.is(f["fill-opacity"],"undefined")&&(i.removeAttribute("fill-opacity"),o.fillOpacity=n,delete d._.opacitydirty);case"stroke":K=c.getRGB(u),i.setAttribute(r,K.hex),"stroke"==r&&K[a]("opacity")&&t(i,{"stroke-opacity":K.opacity>1?K.opacity/100:K.opacity}),"stroke"==r&&d._.arrows&&("startString"in d._.arrows&&y(d,d._.arrows.startString),"endString"in d._.arrows&&y(d,d._.arrows.endString,1));break;case"gradient":("circle"==d.type||"ellipse"==d.type||"r"!=b(u).charAt())&&w(d,u);break;case"line-height":case"vertical-align":break;case"visibility":"hidden"===u?d.hide():d.show();break;case"opacity":j.gradient&&!j[a]("stroke-opacity")&&t(i,{"stroke-opacity":u>1?u/100:u});case"fill-opacity":if(j.gradient){L=c._g.doc.getElementById(i.getAttribute("fill").replace(/^url\(#|\)$/g,n)),L&&(M=L.getElementsByTagName("stop"),t(M[M.length-1],{"stop-opacity":u}));break}default:"font-size"==r&&(u=e(u,10)+"px");var N=r.replace(/(\-.)/g,function(a){return a.substring(1).toUpperCase()});o[N]=u,d._.dirty=1,i.setAttribute(r,u)}}"text"===d.type&&D(d,f),o.visibility=q}},C=1.2,D=function(e,f){if("text"==e.type&&(f[a]("text")||f[a]("font")||f[a]("font-size")||f[a]("x")||f[a]("y")||f[a]("line-height")||f[a]("vertical-align"))){var g=e.attrs,h=e.node,i=h.firstChild&&c._g.doc.defaultView.getComputedStyle(h.firstChild,n),j=i?d(c._g.doc.defaultView.getComputedStyle(h.firstChild,n).getPropertyValue("font-size")):10,k=d(f["line-height"]||g["line-height"])||j*C,l=g[a]("vertical-align")?g["vertical-align"]:"middle";if(isNaN(k)&&(k=j*C),c.is(f.text,"array")&&(f.text=f.text.join("
")),l="top"===l?-.5:"bottom"===l?.5:0,f[a]("text")&&(f.text!==g.text||e._textdirty)){for(g.text=f.text;h.firstChild;)h.removeChild(h.firstChild);for(var m,o=b(f.text).split(/\n|/gi),p=[],q=0,r=o.length;r>q;q++)m=t("tspan"),q?t(m,{dy:k,x:g.x}):t(m,{dy:k*o.length*l,x:g.x}),o[q]||(m.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),o[q]=" "),m.appendChild(c._g.doc.createTextNode(o[q])),h.appendChild(m),p[q]=m;e._textdirty=!1}else for(p=h.getElementsByTagName("tspan"),q=0,r=p.length;r>q;q++)q?t(p[q],{dy:k,x:g.x}):t(p[0],{dy:k*p.length*l,x:g.x});t(h,{x:g.x,y:g.y}),e._.dirty=1;var s=e._getBBox(),u=g.y-(s.y+s.height/2);if(s.isCalculated)switch(g["vertical-align"]){case"top":u=.75*s.height;break;case"bottom":u=-(.25*s.height);break;default:u=g.y-(s.y+.25*s.height)}u&&c.is(u,"finite")&&p[0]&&t(p[0],{dy:u})}},E=function(a,b,d){var e=this,f=d||b;f.canvas&&f.canvas.appendChild(a),e.node=e[0]=a,a.raphael=!0,a.raphaelid=e.id=c._oid++,e.matrix=c.matrix(),e.realPath=null,e.attrs=e.attrs||{},e.followers=e.followers||[],e.paper=b,e.ca=e.customAttributes=e.customAttributes||new b._CustomAttributes,e._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},e.parent=f,!f.bottom&&(f.bottom=e),e.prev=f.top,f.top&&(f.top.next=e),f.top=e,e.next=null},F=c.el;E.prototype=F,F.constructor=E,c._engine.getNode=function(a){var b=a.node||a[0].node;return b.titleNode||b},c._engine.getLastNode=function(a){var b=a.node||a[a.length-1].node;return b.titleNode||b},F.rotate=function(a,c,e){var f,g=this;return g.removed?g:(a=b(a).split(k),a.length-1&&(c=d(a[1]),e=d(a[2])),a=d(a[0]),null==e&&(c=e),(null==c||null==e)&&(f=g.getBBox(1),c=f.x+f.width/2,e=f.y+f.height/2),g.transform(g._.transform.concat([["r",a,c,e]])),g)},F.scale=function(a,c,e,f){var g,h=this;return h.removed?h:(a=b(a).split(k),a.length-1&&(c=d(a[1]),e=d(a[2]),f=d(a[3])),a=d(a[0]),null==c&&(c=a),null==f&&(e=f),(null==e||null==f)&&(g=h.getBBox(1)),e=null==e?g.x+g.width/2:e,f=null==f?g.y+g.height/2:f,h.transform(h._.transform.concat([["s",a,c,e,f]])),h)},F.translate=function(a,c){var e=this;return e.removed?e:(a=b(a).split(k),a.length-1&&(c=d(a[1])),a=d(a[0])||0,c=+c||0,e.transform(e._.transform.concat([["t",a,c]])),e)},F.transform=function(b){var d,e=this,f=e._;return null==b?f.transform:(c._extractTransform(e,b),e.clip&&!f.clipispath&&t(e.clip,{transform:e.matrix.invert()}),e.pattern&&x(e),e.node&&t(e.node,{transform:e.matrix}),(1!=f.sx||1!=f.sy)&&(d=e.attrs[a]("stroke-width")?e.attrs["stroke-width"]:1,e.attr({"stroke-width":d})),e)},F.hide=function(){var a=this;return!a.removed&&a.paper.safari(a.node.style.display="none"),a},F.show=function(){var a=this;return!a.removed&&a.paper.safari(a.node.style.display=n),a},F.remove=function(){if(!this.removed&&this.parent.canvas){var a,b=this,d=c._engine.getNode(b),e=b.paper,f=e.defs;for(e.__set__&&e.__set__.exclude(b),m.unbind("raphael.*.*."+b.id),b.gradient&&f&&s(b);a=b.followers.pop();)a.el.remove();for(;a=b.bottom;)a.remove();if(b.events)for(;a=b.events.pop();)a.unbind();b.parent.canvas.removeChild(d),b.removeData(),delete e._elementsById[b.id],c._tear(b,b.parent);for(a in b)b[a]="function"==typeof b[a]?c._removedFactory(a):null;b.removed=!0}},F._getBBox=function(){var a,b,c=this,d=c.node,e={},f=c.attrs;"none"===d.style.display&&(c.show(),b=!0);try{e=d.getBBox(),"text"==c.type&&(void 0===e.x&&(e.isCalculated=!0,a=f["text-anchor"],e.x=(f.x||0)-e.width*("start"===a?0:"middle"===a?.5:1)),void 0===e.y&&(e.isCalculated=!0,a=f["vertical-align"],e.y=(f.y||0)-e.height*("bottom"===a?1:"middle"===a?.5:0)))}catch(g){}finally{e=e||{}}return b&&c.hide(),e},F.attr=function(b,d){if(this.removed)return this;if(null==b){var e={};for(var f in this.attrs)this.attrs[a](f)&&(e[f]=this.attrs[f]);return e.gradient&&"none"==e.fill&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform,e.visibility="none"===this.node.style.display?"hidden":"visible",e}if(null==d&&c.is(b,"string")){if("fill"==b&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("transform"==b)return this._.transform;if("visibility"==b)return"none"===this.node.style.display?"hidden":"visible";for(var g=b.split(k),h={},i=0,j=g.length;j>i;i++)b=g[i],h[b]=b in this.attrs?this.attrs[b]:c.is(this.ca[b],"function")?this.ca[b].def:c._availableAttrs[b];return j-1?h:h[g[0]]}if(null==d&&c.is(b,"array")){for(h={},i=0,j=b.length;j>i;i++)h[b[i]]=this.attr(b[i]);return h}if(null!=d){var l={};l[b]=d}else null!=b&&c.is(b,"object")&&(l=b);for(var n in l)m("raphael.attr."+n+"."+this.id,this,l[n],n);var o={};for(n in this.ca)if(this.ca[n]&&l[a](n)&&c.is(this.ca[n],"function")&&!this.ca["_invoked"+n]){this.ca["_invoked"+n]=!0;var p=this.ca[n].apply(this,[].concat(l[n]));delete this.ca["_invoked"+n];for(var q in p)p[a](q)&&(l[q]=p[q]);this.attrs[n]=l[n],p===!1&&(o[n]=l[n],delete l[n])}B(this,l);var r;for(i=0,j=this.followers.length;j>i;i++)r=this.followers[i],r.cb&&!r.cb.call(r.el,l,this)||r.el.attr(l);for(q in o)l[q]=o[q];return this},F.blur=function(a){var b=this;if(0!==+a){var d=t("filter"),e=t("feGaussianBlur");b.attrs.blur=a,d.id=c.createUUID(),t(e,{stdDeviation:+a||1.5}),d.appendChild(e),b.paper.defs.appendChild(d),b._blur=d,t(b.node,{filter:"url('"+c._url+"#"+d.id+"')"})}else b._blur&&(b._blur.parentNode.removeChild(b._blur),delete b._blur,delete b.attrs.blur),b.node.removeAttribute("filter")},F.on=function(a,b){if(this.removed)return this;var d=b;return c.supportsTouch&&(a=c._touchMap[a]||"click"===a&&"touchstart"||a,d=function(a){a.preventDefault(),b()}),this.node["on"+a]=d,this},c._engine.path=function(a,b,c){var d=t("path"),e=new E(d,a,c);return e.type="path",B(e,b),e},c._engine.group=function(a,b,c){var d=t("g"),e=new E(d,a,c);return e.type="group",e.canvas=e.node,e.top=e.bottom=null,e._id=b||n,b&&d.setAttribute("class","raphael-group-"+e.id+"-"+b),e},c._engine.circle=function(a,b,c){var d=t("circle"),e=new E(d,a,c);return e.type="circle",B(e,b),e},c._engine.rect=function(a,b,c){var d=t("rect"),e=new E(d,a,c);return e.type="rect",b.rx=b.ry=b.r,B(e,b),e},c._engine.ellipse=function(a,b,c){var d=t("ellipse"),e=new E(d,a,c);return e.type="ellipse",B(e,b),e},c._engine.image=function(a,b,c){var d=t("image"),e=(b.src,new E(d,a,c));return e.type="image",d.setAttribute("preserveAspectRatio","none"),B(e,b),e},c._engine.text=function(a,b,c){var d=t("text"),e=new E(d,a,c);return e.type="text",e._textdirty=!0,B(e,b),e},c._engine.setSize=function(a,b){return this.width=a||this.width,this.height=b||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},c._engine.create=function(){var a=c._getContainer.apply(0,arguments),b=a&&a.container,d=a.x,e=a.y,f=a.width,g=a.height;if(!b)throw new Error("SVG container not found.");var h,i=t("svg"),j="overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-user-select:none;-moz-user-select:-moz-none;-khtml-user-select:none;-ms-user-select:none;user-select:none;-o-user-select:none;cursor:default;";return d=d||0,e=e||0,f=f||512,g=g||342,t(i,{height:g,version:1.1,width:f,xmlns:"http://www.w3.org/2000/svg"}),1==b?(i.style.cssText=j+"position:absolute;left:"+d+"px;top:"+e+"px",c._g.doc.body.appendChild(i),h=1):(i.style.cssText=j+"position:relative",b.firstChild?b.insertBefore(i,b.firstChild):b.appendChild(i)),b=new c._Paper,b.width=f,b.height=g,b.canvas=i,t(i,{id:"raphael-paper-"+b.id}),b.clear(),b._left=b._top=0,h&&(b.renderfix=function(){}),b.renderfix(),b},c._engine.setViewBox=function(a,b,c,d,e){m("raphael.setViewBox",this,this._viewBox,[a,b,c,d,e]);var f,h,i=g(c/this.width,d/this.height),j=this.top,k=e?"meet":"xMinYMin";for(null==a?(this._vbSize&&(i=1),delete this._vbSize,f="0 0 "+this.width+o+this.height):(this._vbSize=i,f=a+o+b+o+c+o+d),t(this.canvas,{viewBox:f,preserveAspectRatio:k});i&&j;)h="stroke-width"in j.attrs?j.attrs["stroke-width"]:1,j.attr({"stroke-width":h}),j._.dirty=1,j._.dirtyT=1,j=j.prev;return this._viewBox=[a,b,c,d,!!e],this},c.prototype.renderfix=function(){var a,b=this.canvas,c=b.style;try{a=b.getScreenCTM()||b.createSVGMatrix()}catch(d){a=b.createSVGMatrix()}var e=-a.e%1,f=-a.f%1;(e||f)&&(e&&(this._left=(this._left+e)%1,c.left=this._left+"px"),f&&(this._top=(this._top+f)%1,c.top=this._top+"px"))},c.prototype._desc=function(a){var b=this.desc;if(b)for(;b.firstChild;)b.removeChild(b.firstChild);else this.desc=b=t("desc"),this.canvas.appendChild(b);b.appendChild(c._g.doc.createTextNode(c.is(a,"string")?a:"Created with Red Raphaël "+c.version))},c.prototype.clear=function(){var a;for(m("raphael.clear",this);a=this.bottom;)a.remove();for(a=this.canvas;a.firstChild;)a.removeChild(a.firstChild);this.bottom=this.top=null,a.appendChild(this.desc=t("desc")),a.appendChild(this.defs=t("defs"))},c.prototype.remove=function(){var a;for(m("raphael.remove",this);a=this.bottom;)a.remove();this.defs&&this.defs.parentNode.removeChild(this.defs),this.desc&&this.desc.parentNode.removeChild(this.desc),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(a in this)this[a]="function"==typeof this[a]?c._removedFactory(a):null;this.removed=!0};var G=c.st;for(var H in F)F[a](H)&&!G[a](H)&&(G[H]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(H))}}(),function(){if(c.vml){var a="hasOwnProperty",b=String,d=parseFloat,e=Math,f=e.round,g=e.max,i=e.min,j=e.sqrt,k=e.abs,l="fill",m=/[, ]+/,n=c.eve,o=" progid:DXImageTransform.Microsoft",p=" ",q="",r={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},s=/([clmz]),?([^clmz]*)/gi,t=/ progid:\S+Blur\([^\)]+\)/g,u=/-?[^,\s-]+/g,v="position:absolute;left:0;top:0;width:1px;height:1px",z=21600,A={path:1,rect:1,image:1},B={circle:1,ellipse:1},C=function(a){var d=/[ahqstv]/gi,e=c._pathToAbsolute;if(b(a).match(d)&&(e=c._path2curve),d=/[clmz]/g,e==c._pathToAbsolute&&!b(a).match(d)){var g=b(a).replace(s,function(a,b,c){var d=[],e="m"==b.toLowerCase(),g=r[b];return c.replace(u,function(a){e&&2==d.length&&(g+=d+r["m"==b?"l":"L"],d=[]),d.push(f(a*z))}),g+d});return g||"m0,0"}var h,i,j=e(a);g=[];for(var k=0,l=j.length;l>k;k++){h=j[k],i=j[k][0].toLowerCase(),"z"==i&&(i="x");for(var m=1,n=h.length;n>m;m++)i+=f(h[m]*z)+(m!=n-1?",":q);g.push(i)}return g.length?g.join(p):"m0,0"},D=function(a,b,d){var e=c.matrix();return e.rotate(-a,.5,.5),{dx:e.x(b,d),dy:e.y(b,d)}},E=function(a,b,c,d,e,f){var g=a._,h=a.matrix,i=g.fillpos,j=a.node,m=j.style,n=1,o="",q=z/b,r=z/c;if(m.visibility="hidden",b&&c){if(j.coordsize=k(q)+p+k(r),m.rotation=f*(0>b*c?-1:1),f){var s=D(f,d,e);d=s.dx,e=s.dy}if(0>b&&(o+="x"),0>c&&(o+=" y")&&(n=-1),m.flip=o,j.coordorigin=d*-q+p+e*-r,i||g.fillsize){var t=j.getElementsByTagName(l);t=t&&t[0],j.removeChild(t),i&&(s=D(f,h.x(i[0],i[1]),h.y(i[0],i[1])),t.position=s.dx*n+p+s.dy*n),g.fillsize&&(t.size=g.fillsize[0]*k(b)+p+g.fillsize[1]*k(c)),j.appendChild(t)}m.visibility="visible"}};c._url=q,c.toString=function(){return"Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël "+this.version};var F=function(a,c,d){for(var e=b(c).toLowerCase().split("-"),f=d?"end":"start",g=e.length,h="classic",i="medium",j="medium";g--;)switch(e[g]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":h=e[g];break;case"wide":case"narrow":j=e[g];break;case"long":case"short":i=e[g]}var k=a.node.getElementsByTagName("stroke")[0];k[f+"arrow"]=h,k[f+"arrowlength"]=i,k[f+"arrowwidth"]=j},G=c._setFillAndStroke=function(e,h){if(e.paper.canvas){e.attrs=e.attrs||{};var j=e.node,k=e.attrs,n=j.style,o=A[e.type]&&(h.x!=k.x||h.y!=k.y||h.width!=k.width||h.height!=k.height||h.cx!=k.cx||h.cy!=k.cy||h.rx!=k.rx||h.ry!=k.ry||h.r!=k.r),r=B[e.type]&&(k.cx!=h.cx||k.cy!=h.cy||k.r!=h.r||k.rx!=h.rx||k.ry!=h.ry),s="group"===e.type,t=e;for(var u in h)h[a](u)&&(k[u]=h[u]);if(o&&(k.path=c._getPath[e.type](e),e._.dirty=1),h.href&&(j.href=h.href),h.title&&(j.title=h.title),h.target&&(j.target=h.target),h.cursor&&(n.cursor=h.cursor),"blur"in h&&e.blur(h.blur),(h.path&&"path"==e.type||o)&&(j.path=C(~b(k.path).toLowerCase().indexOf("r")?c._pathToAbsolute(k.path):k.path),"image"==e.type&&(e._.fillpos=[k.x,k.y],e._.fillsize=[k.width,k.height],E(e,1,1,0,0,0))),"transform"in h&&e.transform(h.transform),"rotation"in h){var v=h.rotation;c.is(v,"array")?e.rotate.apply(e,v):e.rotate(v)}if("visibility"in h&&("hidden"===h.visibility?e.hide():e.show()),r){var w=+k.cx,x=+k.cy,y=+k.rx||+k.r||0,D=+k.ry||+k.r||0;j.path=c.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",f((w-y)*z),f((x-D)*z),f((w+y)*z),f((x+D)*z),f(w*z))}if("clip-rect"in h){var G=b(h["clip-rect"]).split(m);if(4==G.length){G[0]=+G[0],G[1]=+G[1],G[2]=+G[2]+G[0],G[3]=+G[3]+G[1];var I,J=s?j:j.clipRect||c._g.doc.createElement("div"),L=J.style;s?(e.clip=G.slice(),I=e.matrix.offset(),I=[d(I[0]),d(I[1])],G[0]-=I[0],G[1]-=I[1],G[2]-=I[0],G[3]-=I[1],L.width="10800px",L.height="10800px"):j.clipRect||(L.top="0",L.left="0",L.width=e.paper.width+"px",L.height=e.paper.height+"px",j.parentNode.insertBefore(J,j),J.appendChild(j),J.raphael=!0,J.raphaelid=j.raphaelid,j.clipRect=J),L.position="absolute",L.clip=c.format("rect({1}px {2}px {3}px {0}px)",G)}h["clip-rect"]||(s&&e.clip?(j.style.clip="rect(auto auto auto auto)",delete e.clip):j.clipRect&&(j.clipRect.style.clip="rect(auto auto auto auto)"))}if(e.textpath){var M=e.textpath.style;h.font&&(M.font=h.font),h["font-family"]&&(M.fontFamily='"'+h["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,q)+'"'),h["font-size"]&&(M.fontSize=h["font-size"]),h["font-weight"]&&(M.fontWeight=h["font-weight"]),h["font-style"]&&(M.fontStyle=h["font-style"])}if("arrow-start"in h&&F(t,h["arrow-start"]),"arrow-end"in h&&F(t,h["arrow-end"],1),null!=h.opacity||null!=h["stroke-width"]||null!=h.fill||null!=h.src||null!=h.stroke||null!=h["stroke-width"]||null!=h["stroke-opacity"]||null!=h["fill-opacity"]||null!=h["stroke-dasharray"]||null!=h["stroke-miterlimit"]||null!=h["stroke-linejoin"]||null!=h["stroke-linecap"]){var N=j.getElementsByTagName(l),O=!1,P=-1;if(N=N&&N[0],!N&&(O=N=K(l)),"image"==e.type&&h.src&&(N.src=h.src),h.fill&&(N.on=!0),(null==N.on||"none"==h.fill||null===h.fill)&&(N.on=!1),N.on&&h.fill){var Q=b(h.fill).match(c._ISURL);if(Q){N.parentNode==j&&j.removeChild(N),N.rotate=!0,N.src=Q[1],N.type="tile";var R=e.getBBox(1);N.position=R.x+p+R.y,e._.fillpos=[R.x,R.y],c._preload(Q[1],function(){e._.fillsize=[this.offsetWidth,this.offsetHeight]})}else{var S=c.getRGB(h.fill);N.color=S.hex,N.src=q,N.type="solid",S.error&&(t.type in{circle:1,ellipse:1}||"r"!=b(h.fill).charAt())&&H(t,h.fill,N)?(k.fill="none",k.gradient=h.fill,N.rotate=!1):"opacity"in S&&!("fill-opacity"in h)&&(P=S.opacity)}}if(-1!==P||"fill-opacity"in h||"opacity"in h){var T=((+k["fill-opacity"]+1||2)-1)*((+k.opacity+1||2)-1)*((+P+1||2)-1);T=i(g(T,0),1),N.opacity=T,N.src&&(N.color="none")}j.appendChild(N);var U=j.getElementsByTagName("stroke")&&j.getElementsByTagName("stroke")[0],V=!1;!U&&(V=U=K("stroke")),(h.stroke&&"none"!=h.stroke||h["stroke-width"]||null!=h["stroke-opacity"]||h["stroke-dasharray"]||h["stroke-miterlimit"]||h["stroke-linejoin"]||h["stroke-linecap"])&&(U.on=!0),("none"==h.stroke||null===h.stroke||null==U.on||0==h.stroke||0==h["stroke-width"])&&(U.on=!1);var W=c.getRGB("stroke"in h?h.stroke:k.stroke);U.on&&h.stroke&&(U.color=W.hex),T=((+k["stroke-opacity"]+1||2)-1)*((+k.opacity+1||2)-1)*((+W.opacity+1||2)-1);var X=.75*(d(h["stroke-width"])||1);if(T=i(g(T,0),1),null==h["stroke-width"]&&(X=k["stroke-width"]),h["stroke-width"]&&(U.weight=X),X&&1>X&&(T*=X)&&(U.weight=1),U.opacity=T,h["stroke-linejoin"]&&(U.joinstyle=h["stroke-linejoin"])||V&&(V.joinstyle="miter"),U.miterlimit=h["stroke-miterlimit"]||8,h["stroke-linecap"]&&(U.endcap="butt"==h["stroke-linecap"]?"flat":"square"==h["stroke-linecap"]?"square":"round"),h["stroke-dasharray"]){var Y={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};U.dashstyle=Y[a](h["stroke-dasharray"])?Y[h["stroke-dasharray"]]:h["stroke-dasharray"].join&&h["stroke-dasharray"].join(" ")||q}V&&j.appendChild(U)}if("text"==t.type){t.paper.canvas.style.display=q;var Z=t.paper.span,$=100,_=k.font&&k.font.match(/\d+(?:\.\d*)?(?=px)/),ab=k["line-height"]&&(k["line-height"]+q).match(/\d+(?:\.\d*)?(?=px)/);n=Z.style,k.font&&(n.font=k.font),k["font-family"]&&(n.fontFamily=k["font-family"]),k["font-weight"]&&(n.fontWeight=k["font-weight"]),k["font-style"]&&(n.fontStyle=k["font-style"]),_=d(k["font-size"]||_&&_[0])||10,n.fontSize=_*$+"px",ab=d(k["line-height"]||ab&&ab[0])||12,k["line-height"]&&(n.lineHeight=ab*$+"px"),t.textpath.string&&(Z.innerHTML=b(t.textpath.string).replace(/"));var bb=Z.getBoundingClientRect();t.W=k.w=(bb.right-bb.left)/$,t.H=k.h=(bb.bottom-bb.top)/$,t.X=k.x,t.Y=k.y;switch(k["vertical-align"]){case"top":t.bby=t.H/2;break;case"bottom":t.bby=-t.H/2;break;default:t.bby=0}("x"in h||"y"in h||void 0!==t.bby)&&(t.path.v=c.format("m{0},{1}l{2},{1}",f(k.x*z),f((k.y+(t.bby||0))*z),f(k.x*z)+1));for(var cb=["x","y","text","font","font-family","font-weight","font-style","font-size","line-height"],db=0,eb=cb.length;eb>db;db++)if(cb[db]in h){t._.dirty=1;break}switch(k["text-anchor"]){case"start":t.textpath.style["v-text-align"]="left",t.bbx=t.W/2;break;case"end":t.textpath.style["v-text-align"]="right",t.bbx=-t.W/2;break;default:t.textpath.style["v-text-align"]="center",t.bbx=0}t.textpath.style["v-text-kern"]=!0}}},H=function(a,e,f){a.attrs=a.attrs||{};var g=(a.attrs,Math.pow),h="linear",i=".5 .5";if(a.attrs.gradient=e,e=b(e).replace(c._radial_gradient,function(a,b){h="radial",b=b&&b.split(",")||[];{var c=(b[0],b[1],b[2],b[3]),e=b[4];b[5]}return c&&e&&(c=d(c),e=d(e),g(c-.5,2)+g(e-.5,2)>.25&&(e=j(.25-g(c-.5,2))*(2*(e>.5)-1)+.5),i=c+p+e),q}),e=e.split(/\s*\-\s*/),"linear"==h){var k=e.shift();if(k=-d(k),isNaN(k))return null}var l=c._parseDots(e);if(!l)return null;if(a=a.shape||a.node,l.length){f.parentNode==a&&a.removeChild(f),f.on=!0,f.method="none",f.color=l[0].color,f.color2=l[l.length-1].color;for(var m=[],n=1,o=void 0===l[0].opacity?1:l[0].opacity,r=0,s=l.length;s>r;r++)l[r].offset&&m.push(l[r].offset+p+l[r].color),void 0!==l[r].opacity&&(n=l[r].opacity);f.colors=m.length?m.join():"0% "+f.color,f.opacity=n,f["o:opacity2"]=o,"radial"==h?(f.type="gradientTitle",f.focus="100%",f.focussize="0 0",f.focusposition=i,f.angle=0):(f.type="gradient",f.angle=(270-k)%360),a.appendChild(f)}return 1},I=function(a,b,d){var e,f=this,g=d||b;g.canvas&&g.canvas.appendChild(a),e=K("skew"),e.on=!0,a.appendChild(e),f.skew=e,f.node=f[0]=a,a.raphael=!0,a.raphaelid=f.id=c._oid++,f.X=0,f.Y=0,f.attrs=f.attrs||{},f.followers=f.followers||[],f.paper=b,f.ca=f.customAttributes=f.customAttributes||new b._CustomAttributes,f.matrix=c.matrix(),f._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},f.parent=g,!g.bottom&&(g.bottom=f),f.prev=g.top,g.top&&(g.top.next=f),g.top=f,f.next=null},J=c.el;I.prototype=J,J.constructor=I,J.transform=function(a){if(null==a)return this._.transform;var d,e=this.paper._viewBoxShift,f=e?"s"+[e.scale,e.scale]+"-1-1t"+[e.dx,e.dy]:q;e&&(d=a=b(a).replace(/\.{3}|\u2026/g,this._.transform||q)),c._extractTransform(this,f+a);var g,h=this.matrix.clone(),i=this.skew,j=this.node,k=~b(this.attrs.fill).indexOf("-"),l=!b(this.attrs.fill).indexOf("url(");if(h.translate(-.5,-.5),l||k||"image"==this.type)if(i.matrix="1 0 0 1",i.offset="0 0",g=h.split(),k&&g.noRotation||!g.isSimple){j.style.filter=h.toFilter();var m=this.getBBox(),n=this.getBBox(1),o=m.x2&&n.x2&&"x2"||"x",r=m.y2&&n.y2&&"y2"||"y",s=m[o]-n[o],t=m[r]-n[r];j.coordorigin=s*-z+p+t*-z,E(this,1,1,s,t,0)}else j.style.filter=q,E(this,g.scalex,g.scaley,g.dx,g.dy,g.rotate);else j.style.filter=q,i.matrix=b(h),i.offset=h.offset();return d&&(this._.transform=d),this},J.rotate=function(a,c,e){if(this.removed)return this;if(null!=a){if(a=b(a).split(m),a.length-1&&(c=d(a[1]),e=d(a[2])),a=d(a[0]),null==e&&(c=e),null==c||null==e){var f=this.getBBox(1);c=f.x+f.width/2,e=f.y+f.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",a,c,e]])),this}},J.translate=function(a,c){return this.removed?this:(a=b(a).split(m),a.length-1&&(c=d(a[1])),a=d(a[0])||0,c=+c||0,this._.bbox&&(this._.bbox.x+=a,this._.bbox.y+=c),this.transform(this._.transform.concat([["t",a,c]])),this)},J.scale=function(a,c,e,f){if(this.removed)return this;if(a=b(a).split(m),a.length-1&&(c=d(a[1]),e=d(a[2]),f=d(a[3]),isNaN(e)&&(e=null),isNaN(f)&&(f=null)),a=d(a[0]),null==c&&(c=a),null==f&&(e=f),null==e||null==f)var g=this.getBBox(1);return e=null==e?g.x+g.width/2:e,f=null==f?g.y+g.height/2:f,this.transform(this._.transform.concat([["s",a,c,e,f]])),this._.dirtyT=1,this},J.hide=function(){var a=this;return!a.removed&&(a.node.style.display="none"),a},J.show=function(){var a=this;return!a.removed&&(a.node.style.display=q),a},J._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y+(this.bby||0)-this.H/2,width:this.W,height:this.H}},J.remove=function(){if(!this.removed&&this.parent.canvas){var a,b=this,d=c._engine.getNode(b),e=b.paper,f=b.shape;for(e.__set__&&e.__set__.exclude(b),n.unbind("raphael.*.*."+b.id);a=b.followers.pop();)a.el.remove();for(;a=b.bottom;)a.remove();if(b.events)for(;a=b.events.pop();)a.unbind();f&&f.parentNode.removeChild(f),d.clipRect&&b.node.clipRect.parentNode.removeChild(d.clipRect),d.clipRect=null,d.parentNode&&d.parentNode.removeChild(d),b.removeData(),delete e._elementsById[b.id],c._tear(b,b.parent);for(var a in b)b[a]="function"==typeof b[a]?c._removedFactory(a):null;b.removed=!0}},J.attr=function(b,d){if(this.removed)return this;if(null==b){var e={};for(var f in this.attrs)this.attrs[a](f)&&(e[f]=this.attrs[f]);return e.gradient&&"none"==e.fill&&(e.fill=e.gradient)&&delete e.gradient,e.transform=this._.transform,e.visibility="none"===this.node.style.display?"hidden":"visible",e}if(null==d&&c.is(b,"string")){if(b==l&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("visibility"==b)return"none"===this.node.style.display?"hidden":"visible";for(var g=b.split(m),h={},i=0,j=g.length;j>i;i++)b=g[i],h[b]=b in this.attrs?this.attrs[b]:c.is(this.ca[b],"function")?this.ca[b].def:c._availableAttrs[b];return j-1?h:h[g[0]]}if(this.attrs&&null==d&&c.is(b,"array")){for(h={},i=0,j=b.length;j>i;i++)h[b[i]]=this.attr(b[i]);return h}var k;null!=d&&(k={},k[b]=d),null==d&&c.is(b,"object")&&(k=b);for(var o in k)n("raphael.attr."+o+"."+this.id,this,k[o],o);if(k){var p={};for(o in this.ca)if(this.ca[o]&&k[a](o)&&c.is(this.ca[o],"function")&&!this.ca["_invoked"+o]){this.ca["_invoked"+o]=!0;var q=this.ca[o].apply(this,[].concat(k[o]));delete this.ca["_invoked"+o];for(var r in q)q[a](r)&&(k[r]=q[r]);this.attrs[o]=k[o],q===!1&&(p[o]=k[o],delete k[o])}"text"in k&&"text"==this.type&&(c.is(k.text,"array")&&(k.text=k.text.join("
")),this.textpath.string=k.text.replace(//gi,"\n")),G(this,k);var s;for(i=0,j=this.followers.length;j>i;i++)s=this.followers[i],s.cb&&!s.cb.call(s.el,k,this)||s.el.attr(k);for(var r in p)k[r]=p[r]}return this},J.blur=function(a){var b=this.node.runtimeStyle,d=b.filter;return d=d.replace(t,q),0!==+a?(this.attrs.blur=a,b.filter=d+p+o+".Blur(pixelradius="+(+a||1.5)+")",b.margin=c.format("-{0}px 0 0 -{0}px",f(+a||1.5))):(b.filter=d,b.margin=0,delete this.attrs.blur),this},J.on=function(a,b){return this.removed?this:(this.node["on"+a]=function(){var a=c._g.win.event;a.target=a.srcElement,b(a)},this)},c._engine.getNode=function(a){var b=a.node||a[0].node;return b.clipRect||b},c._engine.getLastNode=function(a){var b=a.node||a[a.length-1].node;return b.clipRect||b},c._engine.group=function(a,b,d){var e=c._g.doc.createElement("div"),f=new I(e,a,d);return e.style.cssText=v,f._id=b||q,b&&(e.className="raphael-group-"+f.id+"-"+b),(d||a).canvas.appendChild(e),f.type="group",f.canvas=f.node,f.transform=c._engine.group.transform,f.top=null,f.bottom=null,f },c._engine.group.transform=function(a){if(null==a)return this._.transform;var e,f,g,h,i,j=this,k=j.node.style,l=j.clip,m=j.paper._viewBoxShift,n=m?"s"+[m.scale,m.scale]+"-1-1t"+[m.dx,m.dy]:q;return m&&(e=a=b(a).replace(/\.{3}|\u2026/g,j._.transform||q)),c._extractTransform(j,n+a),f=j.matrix,g=f.offset(),h=d(g[0])||0,i=d(g[1])||0,k.left=h+"px",k.top=i+"px",k.zoom=(j._.tzoom=f.get(0))+q,l&&(k.clip=c.format("rect({1}px {2}px {3}px {0}px)",[l[0]-h,l[1]-i,l[2]-h,l[3]-i])),j},c._engine.path=function(a,b,c){var d=K("shape");d.style.cssText=v,d.coordsize=z+p+z,d.coordorigin=a.coordorigin;var e=new I(d,a,c);return e.type=b.type||"path",e.path=[],e.Path=q,b.type&&delete b.type,G(e,b),e},c._engine.rect=function(a,b,d){var e=c._rectPath(b.x,b.y,b.w,b.h,b.r);b.path=e,b.type="rect";var f=a.path(b,d),g=f.attrs;return f.X=g.x,f.Y=g.y,f.W=g.width,f.H=g.height,g.path=e,f},c._engine.ellipse=function(a,b,c){b.type="ellipse";var d=a.path(b,c),e=d.attrs;return d.X=e.x-e.rx,d.Y=e.y-e.ry,d.W=2*e.rx,d.H=2*e.ry,d},c._engine.circle=function(a,b,c){b.type="circle";var d=a.path(b,c),e=d.attrs;return d.X=e.x-e.r,d.Y=e.y-e.r,d.W=d.H=2*e.r,d},c._engine.image=function(a,b,d){var e=c._rectPath(b.x,b.y,b.w,b.h);b.path=e,b.type="image",b.stroke="none";var f=a.path(b,d),g=f.attrs,i=f.node,j=i.getElementsByTagName(l)[0];return g.src=b.src,f.X=g.x=x,f.Y=g.y=y,f.W=g.width=w,f.H=g.height=h,j.parentNode==i&&i.removeChild(j),j.rotate=!0,j.src=g.src,j.type="tile",f._.fillpos=[g.x,g.y],f._.fillsize=[g.w,g.h],i.appendChild(j),E(f,1,1,0,0,0),f},c._engine.text=function(a,d,e){var g=K("shape"),h=K("path"),i=K("textpath");x=d.x||0,y=d.y||0,text=d.text,h.v=c.format("m{0},{1}l{2},{1}",f(d.x*z),f(d.y*z),f(d.x*z)+1),h.textpathok=!0,i.string=b(d.text).replace(//gi,"\n"),i.on=!0,g.style.cssText=v,g.coordsize=z+p+z,g.coordorigin="0 0";var j=new I(g,a,e);return j.shape=g,j.path=h,j.textpath=i,j.type="text",j.attrs.text=b(d.text||q),j.attrs.x=d.x,j.attrs.y=d.y,j.attrs.w=1,j.attrs.h=1,G(j,d),g.appendChild(i),g.appendChild(h),j},c._engine.setSize=function(a,b){var d=this.canvas.style;return this.width=a,this.height=b,a==+a&&(a+="px"),b==+b&&(b+="px"),d.width=a,d.height=b,d.clip="rect(0 "+a+" "+b+" 0)",this._viewBox&&c._engine.setViewBox.apply(this,this._viewBox),this},c._engine.setViewBox=function(a,b,c,d,e){n("raphael.setViewBox",this,this._viewBox,[a,b,c,d,e]);var f,h,i=this.width,j=this.height,k=1/g(c/i,d/j);return e&&(f=j/d,h=i/c,i>c*f&&(a-=(i-c*f)/2/f),j>d*h&&(b-=(j-d*h)/2/h)),this._viewBox=[a,b,c,d,!!e],this._viewBoxShift={dx:-a,dy:-b,scale:k},this.forEach(function(a){a.transform("...")}),this};var K;c._engine.initWin=function(a){var d=a.document;d.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)");try{!d.namespaces.rvml&&d.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),K=c._createNode=function(a,c){var e,f=d.createElement("');for(e in c)f[e]=b(c[e]);return f}}catch(e){K=c._createNode=function(a,c){var e,f=d.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');for(e in c)f[e]=b(c[e]);return f}}},c._engine.initWin(c._g.win),c._engine.create=function(){var a=c._getContainer.apply(0,arguments),b=a.container,d=a.height,e=a.width,f=a.x,g=a.y;if(!b)throw new Error("VML container not found.");var h=new c._Paper,i=h.canvas=c._g.doc.createElement("div"),j=i.style;return f=f||0,g=g||0,e=e||512,d=d||342,h.width=e,h.height=d,e==+e&&(e+="px"),d==+d&&(d+="px"),h.coordsize=1e3*z+p+1e3*z,h.coordorigin="0 0",i.id="raphael-paper-"+h.id,h.span=c._g.doc.createElement("span"),h.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",i.appendChild(h.span),j.cssText=c.format("top:0;left:0;width:{0};height:{1};display:inline-block;cursor:default;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",e,d),1==b?(c._g.doc.body.appendChild(i),j.left=f+"px",j.top=g+"px",j.position="absolute"):b.firstChild?b.insertBefore(i,b.firstChild):b.appendChild(i),h.renderfix=function(){},h},c.prototype.clear=function(){var a;for(n("raphael.clear",this);a=this.bottom;)a.remove();this.canvas.innerHTML=q,this.span=c._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},c.prototype.remove=function(){var a;for(n("raphael.remove",this);a=this.bottom;)a.remove();this.canvas.parentNode.removeChild(this.canvas);for(a in this)this[a]="function"==typeof this[a]?c._removedFactory(a):null;return!0};var L=c.st;for(var M in J)J[a](M)&&!L[a](M)&&(L[M]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(M))}}(),function(){if(c.canvas){var a,b,d,e=c._g.win,f=c._g.doc,g=c._g,h="string",i="px",j=/[, ]+/,k=e.String,l=e.parseInt,m=e.parseFloat,n=e.Math,o=n.max,p=n.min,q=n.PI,r=(n.floor,c.eve),s=c.fn,t=c.el,u=c.st,v=c.clone,w=q/180,x="hasOwnProperty",y=" ",z="ontouchstart"in e||navigator.msMaxTouchPoints>0,A=("click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel".split(y),!1),B=[],C=[],D=function(a){for(var b,c=a.clientX,d=a.clientY,e=g.doc.documentElement.scrollTop||g.doc.body.scrollTop,f=g.doc.documentElement.scrollLeft||g.doc.body.scrollLeft,h=C.length;h--;){if(b=C[h],z){for(var i,j=a.touches.length;j--;)if(i=a.touches[j],i.identifier==b.el._drag.id){c=i.clientX,d=i.clientY,(a.originalEvent?a.originalEvent:a).preventDefault();break}}else a.preventDefault();c+=f,d+=e,r("raphael.drag.move."+b.el.id,b.move_scope||b.el,c-b.el._drag.x,d-b.el._drag.y,c,d,a)}},E=function(a){c.unmousemove(D).unmouseup(E);for(var b,d=C.length;d--;)b=C[d],b.el._drag={},r("raphael.drag.end."+b.el.id,b.end_scope||b.start_scope||b.move_scope||b.el,a);C=[]};if(c.canvas){a=c._createNode=function(b,c){if(c){typeof b===h&&(b=a(b));for(var d in c)c.hasOwnProperty(d)&&b.setAttribute(d,k(c[d]))}else b=f.createElement(b);return b},c._getConnectedNodes=function(){return{above:[],below:[]}},c._getTargetNode=function(a){a[0],a[1]},c._containerEventHandler=function(a){if(a=a||e.event,!A){var b=a.offsetX,d=a.offsetY;a.type,c._getTargetNode([b,d])}},b=function(a){this.type="basic",this.owner=a,this._rElement=null,this.mouseInteractions=!1,this.matrix=null,this.outlinePath=null,this.conf={}},b.prototype={constructor:b,render:function(){var a=this;return a.draw(),a.setBBox(),a},draw:function(){var a,b=this,c=b.context,d=b._rElement,e=d.matrix,f=b.isClipped,g=b.validateAttrs();d.attrs=g,c.save(),c.fillStyle=g.fill,c.strokeStyle=g.stroke,c.lineWidth=g["stroke-width"],(a=g["clip-rect"])&&(a=a.split(" "),c.rect(a[0],a[1],a[2],a[3]),c.clip(),f=b.isClipped=!0),b.applyTransform(e),b.paint(),c.restore()},paint:function(){},redraw:function(){this.COMInstance.redraw(this)},clear:function(){var a=this,b=a.context,c=a._bbox;c&&b.clearRect(c.x,c.y,c.width,c.height)},addMouseInteractivity:function(){var b,c=this,d=c._rElement.attrs,e=c._bbox,f=c.owner.wrapper._map,g="circle"===c.type?"circle":"rect",h="circle"===g?[d.cx,d.cy,d.r].join(","):[e.x,e.y,e.x2,e.y2].join(",");b=a("area",{shape:g,coords:h}),f.firstChild?f.insertBefore(b,f.firstChild):f.appendChild(b),c._mouseArea=b,c.eventListeners={}},updateMapAreaCoords:function(){var a=this,b=a._mouseArea,c=a._bbox;if(b)if(a instanceof K){var d=c.width/2;b.setAttribute("coords",[c.x+d,c.y+d,d].join(","))}else b.setAttribute("coords",[c.x,c.y,c.x2,c.y2].join(","))},applyTransform:function(a){var b,c=this,d=c.context;a&&(b=a.split(),d.translate(b.dx,b.dy),!b.noRotation&&d.rotate(w*b.rotate),d.scale(b.scalex,b.scaley))},setBBox:function(){var a=this,b=a._rElement,d=b.matrix,e=a.owner,f=e.getTransformMatrix&&e.getTransformMatrix();f&&(f=f.clone(),f.add(d),d=f),a.outlinePath?a._bbox=c.pathBBox(c.transformPath(a.outlinePath,d.toTransformString()).toString()):a.setShapeBBox(d),a._mouseArea&&a.updateMapAreaCoords()},getBBox:function(){return this._bbox},drawPath:function(a){var b=this,c=b.context,d=(a&&a.length||0,PathParser);for(d.reset(),d.setTokens(a),null!=c&&c.beginPath();!d.isEnd();)switch(d.nextCommand(),d.command){case"M":case"m":var e=d.getAsCurrentPoint();for(d.addMarker(e),null!=c&&c.moveTo(e.x,e.y),d.start=d.current;!d.isCommandOrEnd();){var e=d.getAsCurrentPoint();d.addMarker(e,d.start),null!=c&&c.lineTo(e.x,e.y)}break;case"L":case"l":for(;!d.isCommandOrEnd();){var f=d.current,e=d.getAsCurrentPoint();d.addMarker(e,f),null!=c&&c.lineTo(e.x,e.y)}break;case"H":case"h":for(;!d.isCommandOrEnd();){var g=new Point((d.isRelativeCommand()?d.current.x:0)+d.getScalar(),d.current.y);d.addMarker(g,d.current),d.current=g,null!=c&&c.lineTo(d.current.x,d.current.y)}break;case"V":case"v":for(;!d.isCommandOrEnd();){var g=new Point(d.current.x,(d.isRelativeCommand()?d.current.y:0)+d.getScalar());d.addMarker(g,d.current),d.current=g,null!=c&&c.lineTo(d.current.x,d.current.y)}break;case"C":case"c":for(;!d.isCommandOrEnd();){var h=d.current,i=d.getPoint(),j=d.getAsControlPoint(),k=d.getAsCurrentPoint();d.addMarker(k,j,i),null!=c&&c.bezierCurveTo(i.x,i.y,j.x,j.y,k.x,k.y)}break;case"S":case"s":for(;!d.isCommandOrEnd();){var h=d.current,i=d.getReflectedControlPoint(),j=d.getAsControlPoint(),k=d.getAsCurrentPoint();d.addMarker(k,j,i),null!=c&&c.bezierCurveTo(i.x,i.y,j.x,j.y,k.x,k.y)}break;case"Q":case"q":for(;!d.isCommandOrEnd();){var h=d.current,j=d.getAsControlPoint(),k=d.getAsCurrentPoint();d.addMarker(k,j,j),null!=c&&c.quadraticCurveTo(j.x,j.y,k.x,k.y)}break;case"T":case"t":for(;!d.isCommandOrEnd();){var h=d.current,j=d.getReflectedControlPoint();d.control=j;var k=d.getAsCurrentPoint();d.addMarker(k,j,j),null!=c&&c.quadraticCurveTo(j.x,j.y,k.x,k.y)}break;case"A":case"a":for(;!d.isCommandOrEnd();){var h=d.current,l=d.getScalar(),m=d.getScalar(),n=d.getScalar()*(Math.PI/180),o=d.getScalar(),p=d.getScalar(),k=d.getAsCurrentPoint(),q=new Point(Math.cos(n)*(h.x-k.x)/2+Math.sin(n)*(h.y-k.y)/2,-Math.sin(n)*(h.x-k.x)/2+Math.cos(n)*(h.y-k.y)/2),r=Math.pow(q.x,2)/Math.pow(l,2)+Math.pow(q.y,2)/Math.pow(m,2);r>1&&(l*=Math.sqrt(r),m*=Math.sqrt(r));var s=(o==p?-1:1)*Math.sqrt((Math.pow(l,2)*Math.pow(m,2)-Math.pow(l,2)*Math.pow(q.y,2)-Math.pow(m,2)*Math.pow(q.x,2))/(Math.pow(l,2)*Math.pow(q.y,2)+Math.pow(m,2)*Math.pow(q.x,2)));isNaN(s)&&(s=0);var t=new Point(s*l*q.y/m,s*-m*q.x/l),u=new Point((h.x+k.x)/2+Math.cos(n)*t.x-Math.sin(n)*t.y,(h.y+k.y)/2+Math.sin(n)*t.x+Math.cos(n)*t.y),v=function(a){return Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2))},w=function(a,b){return(a[0]*b[0]+a[1]*b[1])/(v(a)*v(b))},x=function(a,b){return(a[0]*b[1]=1&&(B=0);var C=1-p?1:-1,D=y+C*(B/2),E=new Point(u.x+l*Math.cos(D),u.y+m*Math.sin(D));if(d.addMarkerAngle(E,D-C*Math.PI/2),d.addMarkerAngle(k,D-C*Math.PI),null!=c){var w=l>m?l:m,F=l>m?1:l/m,G=l>m?m/l:1;c.translate(u.x,u.y),c.rotate(n),c.scale(F,G),c.arc(0,0,w,y,y+B,1-p),c.scale(1/F,1/G),c.rotate(-n),c.translate(-u.x,-u.y)}}break;case"Z":case"z":null!=c&&c.closePath(),d.current=d.start}return b.outlinePath=a,b},addEventListener:function(){var a,b,d=this,e=arguments,f=e&&e[0],g=e&&e[1];if(d._mouseArea||d.addMouseInteractivity(),a=d._mouseArea,"string"==typeof f&&"function"==typeof g)if(d._path)if("mouseover"===f||"mouseout"===f||"mousemove"===f){if(!d._mousemoveAdded){var h=function(a){var b=!1,d=!0,e=!1;return function(f){var g=f.layerX,h=f.layerY;e=!1,c.isPointInsidePath(a._transformPath,g,h)?(b=!0,d&&(d=!1,e=!0)):(d=!0,b&&(b=!1,e=!0)),d&&e&&a.eventListeners.mouseout&&a.eventListeners.mouseout.apply(this,arguments),b&&(e&&a.eventListeners.mouseover&&a.eventListeners.mouseover.apply(this,arguments),a.eventListeners.mousemove&&a.eventListeners.mousemove.apply(this,arguments))}}(d);a.addEventListener("mousemove",h,!1),d._mousemoveAdded=!0}d.eventListeners[f]=g}else{var b=function(a,b){return function(d){c.isPointInsidePath(a._path,d.layerX,d.layerY)&&b.apply(this,arguments)}}(d,g);a.addEventListener(f,b,!1)}else a.addEventListener(f,g,!1)},removeEventListener:function(){var a,b=this,c=arguments,d=c&&c[0],e=c&&c[1];b._mouseArea&&(a=b._mouseArea,"string"==typeof d&&"function"==typeof e&&a.removeEventListener(d,e))},attachEvent:function(){},detachEvent:function(){},validateAttrs:function(a){var b,c,d=this,e=v(d._rElement.attrs);if(null===a){if(d._isValid)return e;d._isValid=!0}a=a||e;for(b in a)switch(c=a[b],b){default:continue}return a},attrs:function(){}};var F=function(a){this.node=a,this.next=null,this.prev=null},G=function(){this.top=null,this.bottom=null};G.prototype={constructor:G,add:function(a){a=new F(a),this.bottom||(this.bottom=a),this.top&&(this.top.next=a),a.next=null,a.prev=this.top,this.top=a},addList:function(a){this.bottom||(this.bottom=a.bottom),this.top&&(this.top.next=a.bottom,a.bottom.prev=this.top),this.top=a.top},toFront:function(a){return this.top===a?!1:(this.bottom===a&&(this.bottom=a.next),a.prev&&(a.prev.next=a.next),a.next&&(a.next.prev=a.prev),this.top.next=a,a.prev=this.top,a.next=null,void(this.top=a))},toBack:function(a){return this.bottom===a?!1:(this.top===a&&(this.top=a.prev),a.prev&&(a.prev.next=a.next),a.next&&(a.next.prev=a.prev),this.bottom.prev=a,a.prev=null,a.next=this.bottom,void(this.bottom=a))},insertBefore:function(){},insertAfter:function(){},each:function(a,b){for(var c=this.bottom;c;)a.apply(c.node,b),c=c.next},iterate:function(a,b){for(var c=this.bottom,d=!0;c&&(d=a.apply(c.node,b),d!==!1);)c=c.next},dispose:function(){this.each(function(){this.node.dispose&&this.node.dispose()}),this.top=null,this.bottom=null}};var H=function(a,b){this.items=new G,this.owner=a,this.element=null,b?this.element=b:this.init()};H.prototype={constructor:H,appendChild:function(){var a=this,b=a.owner.wrapper,c=this.element;b._image?b.insertBefore(c,b._image):b.appendChild(c)},insertBefore:function(){},insertAfter:function(){},init:function(){this.element=a("canvas"),a(this.element,{width:this.owner.wrapper.offsetWidth,height:this.owner.wrapper.offsetHeight}),this.element.style.cssText="position:absolute;left:0;top:0;",this.appendChild()},getCanvas:function(){return this.element},getContext:function(){return this.element.getContext("2d")},addToLayer:function(a){this.items.add(a)},mergeWithLayerOnTop:function(a){this.items.addList(a.items),a.dispose(!0)},mergeWithLayerOnBottom:function(a){a.items.addList(this.items),this.items=a.items,a.dispose(!0)},dispose:function(a){a||this.items.each(function(){this.dispose()}),this.items=null,this.owner=null,this.element.parentNode.removeChild(this.element),this.element=null}};var I=function(a,b,c){this.nodeItems=new G,this.collectionItems=new G,this.layerItems=new G,this.owner=this.parent=a,this.layerOnTop=null,this.currentLayer=null,this.baseLayer=null,b?(this.wrapper=b,this.currentLayer=this.baseLayer=new H(this,c)):this.init()};I.prototype={constructor:I,init:function(){var b=this,c=b.parent,d=c.wrapper._image,e=a("div");e.style.cssText="width:100%;height:100%;position:absolute;left:0;top:0;",e._map=c.wrapper._map,d?c.wrapper.insertBefore(e,d):c.wrapper.appendChild(e),b.wrapper=e,b.currentLayer=b.baseLayer=new H(b)},getCurrentContext:function(){return this.currentLayer.getContext()},setLayerOnTop:function(a){this.layerOnTop=a},getCurrentCanvas:function(){return this.currentLayer.getCanvas()},addNode:function(a){this.nodeItems.add(a),"group"===a.type?this.addCollection(a):this.currentLayer.addToLayer(a)},addCollection:function(a){a=a||new I(this),this.collectionItems.add(a),this.currentLayer=new H(this),this.layerItems.add(this.currentLayer),a.setLayerOnTop(this.currentLayer)},dispose:function(){this.nodeItems.dispose(),this.collectionItems.dispose(),this.layerItems.dispose(),this.owner=this.parent=null,this.ownerLayer=null,this.currentLayer=null,this.baseLayer=null}};var J=function(a,c,d,e){var f=this,g=new I(null,c,a);f.width=d,f.height=e,f.createNode=function(a,c){c=c||g;var d,e=c.nodeItems,f=c.currentLayer,h=f.getCanvas();switch(a){case"rect":d=new RectFauxNode(c);break;case"circle":d=new K(c);break;case"path":d=new L(c);break;case"text":d=new M(c);break;case"group":d=new N(c),c.addCollection(d);break;default:d=new b(h)}return d.COMInstance=this,e.add(d),f.addToLayer(d),d},f.redraw=function(a){var b,c,d;if("group"===a.type)b=a.nodeItems,a.render();else for(d=a.layer,b=d.items,c=b.bottom,d.element.width=d.element.width;c;)fNode=c.node,"group"!==fNode.type&&fNode.render(),c=c.next},f.insertBefore=function(){},f.insertAfter=function(){},f.removeNode=function(){},f.refreshNode=function(){},f.refreshAll=function(){}};Point=function(a,b){this.x=a,this.y=b},Point.prototype.angleTo=function(a){return Math.atan2(a.y-this.y,a.x-this.x)},Point.prototype.applyTransform=function(a){var b=this.x*a[0]+this.y*a[2]+a[4],c=this.x*a[1]+this.y*a[3]+a[5];this.x=b,this.y=c},PathParser=new function(){this.tokens=null,this.setTokens=function(a){this.tokens="string"==typeof a?a.split(" "):a},this.reset=function(){this.i=-1,this.command="",this.previousCommand="",this.start=new Point(0,0),this.control=new Point(0,0),this.current=new Point(0,0),this.points=[],this.angles=[]},this.isEnd=function(){return this.i>=this.tokens.length-1},this.isCommandOrEnd=function(){return this.isEnd()?!0:null!=this.tokens[this.i+1].toString().match(/^[A-Za-z]$/)},this.isRelativeCommand=function(){switch(this.command){case"m":case"l":case"h":case"v":case"c":case"s":case"q":case"t":case"a":case"z":return!0}return!1},this.getToken=function(){return this.i++,this.tokens[this.i]},this.getScalar=function(){return parseFloat(this.getToken())},this.nextCommand=function(){this.previousCommand=this.command,this.command=this.getToken()},this.getPoint=function(){var a=new Point(this.getScalar(),this.getScalar());return this.makeAbsolute(a)},this.getAsControlPoint=function(){var a=this.getPoint();return this.control=a,a},this.getAsCurrentPoint=function(){var a=this.getPoint();return this.current=a,a},this.getReflectedControlPoint=function(){if("c"!=this.previousCommand.toLowerCase()&&"s"!=this.previousCommand.toLowerCase()&&"q"!=this.previousCommand.toLowerCase()&&"t"!=this.previousCommand.toLowerCase())return this.current;var a=new Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y);return a},this.makeAbsolute=function(a){return this.isRelativeCommand()&&(a.x+=this.current.x,a.y+=this.current.y),a},this.addMarker=function(a,b,c){null!=c&&this.angles.length>0&&null==this.angles[this.angles.length-1]&&(this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(c)),this.addMarkerAngle(a,null==b?null:b.angleTo(a))},this.addMarkerAngle=function(a,b){this.points.push(a),this.angles.push(b)},this.getMarkerPoints=function(){return this.points},this.getMarkerAngles=function(){for(var a=0;ah&&(a.r=h),0>c&&(a.r=0);break;case"width":case"height":0>c&&(a[b]=0);break;default:continue}return a},setShapeBBox:function(a){var b=this,c=b._rElement,d=c.attrs,e=a.get(0),f=a.get(3),g=a.get(4),h=a.get(5),i=d["stroke-width"];b._bbox={x:d.x*e+g-i,y:d.y*f+h-i,width:d.width*e+2*i,height:d.height*f+2*i},b._bbox.x2=b._bbox.x+b._bbox.width,b._bbox.y2=b._bbox.y+b._bbox.height,b.X=b._bbox.x,b.Y=b._bbox.y,b.W=b._bbox.width,b.H=b._bbox.height}});var K=function(a){this.type="circle",this._isValid=!1,this.parent=this.owner=a,this.context=a.getCurrentContext(),this.layer=a.currentLayer},L=function(a){this.type="path",this._isValid=!1,this.parent=this.owner=a,this.context=a.getCurrentContext(),this.layer=a.currentLayer},M=function(a){this.type="text",this._isValid=!1,this.parent=this.owner=a,this.context=a.getCurrentContext(),this.layer=a.currentLayer},N=function(a){this.type="group",this.nodeItems=new G,this.collectionItems=new G,this.layerItems=new G,this.owner=this.parent=a,this.layerOnTop=a.currentLayer,this.currentLayer=null,this.baseLayer=null,this.init()};K.prototype=c.extend(new b,{constructor:K,paint:function(){var a=this,b=a.context,c=a.validateAttrs(),d=c.cx,e=c.cy,f=c.r,g=f||c.rx,h=f||c.ry;if(c.r){if(a.drawPath(["M",d+f,e,"A",g,h,0,1,0,d-f,e,"A",g,h,0,1,0,d+f,e,"Z"]),c["stroke-width"]){var i=void 0===c["stroke-opacity"]?c.opacity:c["stroke-opacity"];void 0!==i&&(b.globalAlpha=i),b.stroke()}var j=void 0===c["fill-opacity"]?c.opacity:c["fill-opacity"];void 0!==j&&(b.globalAlpha=j),b.fill()}},setShapeBBox:function(a){var b=this,c=b._rElement,d=c.attrs,e=a.get(0),f=a.get(3),g=a.get(4),h=a.get(5),i=d["stroke-width"];b._bbox={x:g+(d.cx-d.r)*e-i,y:h+(d.cy-d.r)*f-i,width:2*(i+d.r*e),height:2*(d.r*f+i)},b._bbox.x2=b._bbox.x+b._bbox.width,b._bbox.y2=b._bbox.y+b._bbox.height,b.X=b._bbox.x,b.Y=b._bbox.y,b.W=b._bbox.width,b.H=b._bbox.height}}),L.prototype=c.extend(new b,{constructor:L,paint:function(){var a=this,b=a._rElement,d=b.attrs,e=b.attr("path"),f=b.matrix,g=a.context;a.drawPath(e),a._transformPath=c.transformPath(e,f.toTransformString());var h=void 0===d["stroke-opacity"]?d.opacity:d["stroke-opacity"];void 0!==h&&(g.globalAlpha=h),g.stroke();var i=void 0===d["fill-opacity"]?d.opacity:d["fill-opacity"];void 0!==i&&(g.globalAlpha=i),g.fill()}}),M.prototype=c.extend(new b,{constructor:M,paint:function(){var a=this,b=a._rElement,c=b.attr(),d=c.text,e=c.stroke,f=c["vertical-align"],g=c["text-anchor"],h=c.x,i=c.y,j=(b.matrix,a.context),m=c["font-size"]||10,n=c["line-height"]||1.2*l(m,10),q=["normal",m,c.font];if(j.fillStyle=e,j.font=q.join(" "),d){var r,s,t,u,v=k(d).split(/\n|/gi),w=v.length*n,x=-1/0,y=1/0;r="top"===f?i+n:"middle"===f?i-w/2+n/2:i-w+n;for(var z=0,A=v.length;A>z;z+=1)d=v[z],u=r+n*z,s=j.measureText(d).width,t="start"===g?h:"middle"===g?h-s/2:h-s,x=o(x,s),y=p(y,t),j.fillText(d,t,u);b._textdirty=!1}a.outlinePath=["M",y,r-n/1.4,"H",y+x,"V",r-n+w,"H",y,"V",r-n/1.4]}}),N.prototype=c.extend(c.extend(new b,I.prototype),{constructor:N,draw:function(){this.layerItems.each(function(){this.element.width=this.element.width}),b.prototype.draw.apply(this,arguments)},render:function(){var a=this;return a.draw(),a.setBBox(),a},paint:function(){var a=this,b=a.nodeList,c=a._rElement,d=(a.canvas,c.attrs),e=b.bottom;for(void 0!==d.opacity&&this.layerItems.each(function(){this.getContext().globalAlpha=d.opacity});e;)e.render(),e=e.next},setBBox:function(){},addMouseInteractivity:function(){},applyTransform:function(a){var c=this,d=c.parent,e=d.getTransformMatrix&&d.getTransformMatrix();e?(c.matrixApplied=e.clone(),c.matrixApplied.add(a.a,a.b,a.c,a.d,a.e,a.f)):c.matrixApplied=a,this.layerItems.each(function(){b.prototype.applyTransform.apply(this,[c.matrixApplied])})},getTransformMatrix:function(){return this.matrixApplied}}),d=function(a,b,d){var e=this,f=d||b;e.node=e[0]=a,a.raphael=!0,a.raphaelid=e.id=c._oid++,a._rElement=e,e.X=0,e.Y=0,e.attrs=e.attrs||{},e.styles=e.styles||{},e.followers=e.followers||[],e.paper=b,e.com=f.com,e.ca=e.customAttributes=e.customAttributes||new b._CustomAttributes,e.matrix=c.matrix(),e._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0},e.parent=f,!f.bottom&&(f.bottom=e),e.prev=f.top||null,f.top&&(f.top.next=e),f.top=e,e.next=null},d.prototype=t,t.constructor=d;var O=function(a,b){{var d,e=S(a),f=c._getConnectedNodes(e),g=a.attrs;f.above,f.below}for(d in b)g[d]=b[d];e.redraw()},P=function(a,b){var d,e,f=(a.attrs,a.node),g={},h=!1,i=!1,j=!1;for(d in b)if(b[x](d)){if(!c._availableAttrs[x](d))continue;switch(e=b[d],d){case"fill-opacity":case"opacity":case"stroke-opcaity":case"stroke":case"fill":g[d]=e,h=!0;break;case"stroke-width":case"cx":case"cy":case"x":case"y":g[d]=e,i=!0;break;case"width":case"height":g[d]=e,j=!0;break;case"clip-rect":g[d]=e,h=!0;break;case"font-size":case"font":case"vertical-align":case"text-anchor":g[d]=e,h=!0;default:continue}}R(a,b,g),g=f.validateAttrs(g),(h||i||j)&&O(a,g,i,j)},Q=1.2,R=function(a,b,c){if("text"==a.type&&(b[x]("text")||b[x]("font")||b[x]("font-size")||b[x]("x")||b[x]("y")||b[x]("line-height")||b[x]("vertical-align"))){var d=a.attr(),e=b["font-size"]||d["font-size"]||10,f=m(b["line-height"]||d["line-height"])||l(e,10)*Q,g=b["vertical-align"]||d["vertical-align"]||"middle";isNaN(f)&&(f=e*Q),c["font-size"]=l(e,10)+"px",c.font=b.font||d.font||"Verdana",c["vertical-align"]=g,c.x=b.x||d.x||0,c.y=b.y||d.y||0,c["line-height"]=l(f,10),c["text-anchor"]=b["text-anchor"]||d["text-anchor"]||"middle"}};c._engine.initWin=function(a){a=a,f=a.document},c._engine.setSize=function(a,b){var c=this,d=c.canvas.style;return d.width=(c.width=+a||c.width)+i,d.height=(c.height=+b||c.height)+i,c},c._engine.create=function(){var b,d,e,g,h,i,j=c._getContainer.apply(0,arguments)||{},k=j.container,l=j.x,m=j.y,n=j.width,o=j.height;if(!k)throw new Error("Canvas container not found.");return h=new c._Paper,h.canvas=b=a("div"),l=l||0,m=m||0,h.width=n=n||512,h.height=o=o||342,h.left=h.top=0,1==k?(b.style.cssText=d+c.format(";width:100%;height:100%;position:absolute;left:{0}px;top:{1}px;",[l,m]),f.body.appendChild(b)):(b.style.cssText=d+";width:100%;height:100%;position:absolute",k.firstChild?k.insertBefore(b,k.firstChild):k.appendChild(b)),d="overflow:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-user-select:none;-moz-user-select:-moz-none;-khtml-user-select:none;-ms-user-select:none;user-select:none;-o-user-select:none;cursor:default;"+c.format("width:{0}px;height:{1}px;",[n,o]),i=a("canvas"),i.style.cssText="position:absolute;left:0;top:0",i.setAttribute("width",h.width),i.setAttribute("height",h.height),h.com=new J(i,b,h.width,h.height),b.appendChild(i),e=a("img"),e.src="image1.png",e.style.cssText="opacity: 0;z-index: 100;background: transparent;position: absolute;left: 0;top: 0;width: "+n+"px;height: "+o+"px",b.appendChild(e),g=a("map"),g.setAttribute("name","mousemap"),g.setAttribute("id","mousemap"),b.appendChild(g),e.setAttribute("usemap","#mousemap"),b._image=e,b._map=g,h};var S=c._engine.getNode=function(a){return a.node||a[0].node};c._engine.getLastNode=function(a){return a.node||a[a.length-1].node},c._engine.rect=function(a,b,c,e,f,g,h){var i=a.com.createNode("rect",h&&h.node),j=new d(i,a,h),k=j.attrs;return k.x=b,k.y=c,k.width=e,k.height=f,k.fill="#fff",k.stroke="#000",k["stroke-width"]=1,k.r=g||0,k.rx=g||0,k.ry=g||0,j.type="rect",i.render(),j},c._engine.circle=function(a,b,c,e,f){var g=a.com.createNode("circle",f&&f.node),h=new d(g,a,f),i=h.attrs;return i.cx=b,i.cy=c,i.r=e,i.fill="none",i.stroke="#000",i["stroke-width"]=1,h.type="circle",g.render(),h},c._engine.ellipse=function(a,c,e,f,g,h){var i=new b,j=new d(i,a,h);return j.type="ellipse",j},c._engine.image=function(a,c,e,f,g,h,i){var j=new b,k=new d(j,a,i);return k.type="image",k},c._engine.text=function(a,b,c,e,f){var g=a.com.createNode("text",f&&f.node),h=new d(g,a,f),i=h.attrs;return i.x=b,i.y=c,i.text=e,i.fill="none",i.stroke="#000",i.font="Verdana",i["font-size"]="12px",i["vertical-align"]="middle",i["text-anchor"]="middle",h.type="text",g.render(),h},c._engine.path=function(a,b,c){var e=b.com.createNode("path",c&&c.node),f=new d(e,b,c),g=f.attrs;return g.path=a,g.fill="#fff",g.stroke="#000",g["stroke-width"]=1,f.type="path",e.render(),f},c._engine.group=function(a,b,c){var e=a.com.createNode("group",c&&c.node),f=new d(e,a,c),g=e.wrapper;return b&&g.setAttribute("class",["red",b].join("-")),f.canvas=g,f.type="group",f},t._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y+(this.bby||0)-this.H/2,width:this.W,height:this.H}},t.toFront=function(){if(this.removed)return this;var a,b,d,e=this,f=e.node,g=e.parent,h=f.owner,i=e.followers;for(c._tofront(e,g)&&("group"===t.type?g.canvas.appendChild(f):h.nodeList.tofront(f)),b=0,d=i.length;d>b;b++)(a=i[b]).stalk&&a.el[a.stalk](e);return e},t.toBack=function(){if(this.removed)return this;var a,b,d,e=this,f=e.node,g=e.parent,h=f.owner,i=e.followers;for(c._toback(e,g)&&("group"===t.type?g.canvas.appendChild(f):h.nodeList.toback(f)),b=0,d=i.length;d>b;b++)(a=i[b]).stalk&&a.el[a.stalk](e);return e},t.insertAfter=function(a){if(this.removed)return this;var b,d,e,f=this,g=f.node,h=a.node,i=h.owner,j=f.followers;for(h.next?i.nodeList.insertBefore(g,h.next):i.appendChild(g),c._insertafter(f,a,f.parent,a.parent),d=0,e=j.length;e>d;d++)(b=j[d]).stalk&&b.el[b.stalk](a);return f},t.insertBefore=function(a){if(this.removed)return this;var b,d,e,f=this,g=f.node,h=a.node,i=h.owner,j=f.followers;for(h?i.nodeList.insertBefore(g,h):i.appendChild(g),c._insertafter(f,a,f.parent,a.parent),d=0,e=j.length;e>d;d++)(b=j[d]).stalk&&b.el[b.stalk](a);return f},t.appendChild=function(){return this},t.removeChild=function(){return this},t.attr=function(a,b){if(this.removed)return this;var d,e,f,g,h,i,k,l,m,n,o,p=this,q=p.attrs,s=p.ca;if(null==a){g={};for(h in q)q.hasOwnProperty(h)&&(g[h]=q[h]);return g.gradient&&"none"==g.fill&&(g.fill=g.gradient)&&delete g.gradient,g.transform=p._.transform,g}if(null==b&&c.is(a,"string")){if("fill"==a&&"none"==q.fill&&q.gradient)return q.gradient;if("transform"==a)return p._.transform;for(d=a.split(j),i={},o=0,n=d.length;n>o;o++)a=d[o],i[a]=a in q?q[a]:c.is(s[a],"function")?s[a].def:c._availableAttrs[a];return n-1?i:i[d[0]]}if(null==b&&c.is(a,"array")){for(i={},o=0,n=a.length;n>o;o++)i[a[o]]=p.attr(a[o]);return i}null!=b?(e={},e[a]=b):null!=a&&c.is(a,"object")&&(e=a);for(h in e)r("raphael.attr."+h+"."+p.id,p,e[h],h);l={};for(h in s)if(s[h]&&e.hasOwnProperty(h)&&c.is(s[h],"function")&&!s["_invoked"+h]){s["_invoked"+h]=!0,f=s[h].apply(p,[].concat(e[h])),delete s["_invoked"+h];for(k in f)f.hasOwnProperty(k)&&(e[k]=f[k]);q[h]=e[h],f===!1&&(l[h]=e[h],delete e[h])}for(P(this,e),o=0,n=p.followers.length;n>o;o++)m=p.followers[o],m.cb&&!m.cb.call(m.el,e,p)||m.el.attr(e);for(k in l)e[k]=l[k];return this},t.drag=function(a,b,d,e,f,h){function i(i){(i.originalEvent||i).preventDefault();var j=g.doc.documentElement.scrollTop||g.doc.body.scrollTop,k=g.doc.documentElement.scrollLeft||g.doc.body.scrollLeft;this._drag.x=i.clientX+k,this._drag.y=i.clientY+j,this._drag.id=i.identifier,!C.length&&c.mousemove(D).mouseup(E),C.push({el:this,move_scope:e,start_scope:f,end_scope:h}),b&&r.on("raphael.drag.start."+this.id,b),a&&r.on("raphael.drag.move."+this.id,a),d&&r.on("raphael.drag.end."+this.id,d),r("raphael.drag.start."+this.id,f||e||this,i.clientX+k,i.clientY+j,i)}return this._drag={},B.push({el:this,start:i}),this.mousedown(i),this},t.undrag=function(){for(var a=B.length;a--;)B[a].el==this&&(this.unmousedown(B[a].start),B.splice(a,1),r.unbind("raphael.drag.*."+this.id));!B.length&&c.unmousemove(D).unmouseup(E)},t.rotate=function(a,b,c){var d,e=this;return e.removed?e:(a=k(a).split(j),a.length-1&&(b=m(a[1]),c=m(a[2])),a=m(a[0]),null==c&&(b=c),(null==b||null==c)&&(d=e.getBBox(1),b=d.x+d.width/2,c=d.y+d.height/2),e.transform(e._.transform.concat([["r",a,b,c]])),e)},t.scale=function(a,b,c,d){var e,f=this;return f.removed?f:(a=k(a).split(j),a.length-1&&(b=m(a[1]),c=m(a[2]),d=m(a[3])),a=m(a[0]),null==b&&(b=a),null==d&&(c=d),(null==c||null==d)&&(e=f.getBBox(1)),c=null==c?e.x+e.width/2:c,d=null==d?e.y+e.height/2:d,f.transform(f._.transform.concat([["s",a,b,c,d]])),f) },t.translate=function(a,b){var c=this;return c.removed?c:(a=k(a).split(j),a.length-1&&(b=m(a[1])),a=m(a[0])||0,b=+b||0,c.transform(c._.transform.concat([["t",a,b]])),c)},t.transform=function(a){var b,d=this,e=d._;return null===a?e.transform:(c._extractTransform(d,a),(1!=e.sx||1!=e.sy)&&(b=d.attrs[x]("stroke-width")?d.attrs["stroke-width"]:1,d.attr({"stroke-width":b})),d.node&&d.node.redraw(),d)},t.hide=function(){return this},t.show=function(){return this},t.blur=function(){return this},t.on=function(a,b){var c=this,d=c.listeners;d||(d=c.listeners={}),d[a]||(d[a]=[]),d[a].push(b)},t.remove=function(){return this},s.clear=function(){return r("raphael.clear",this),this},s.remove=function(){if(!this.removed){var a,b=this,d=b.canvas,e=d.parentNode;r("raphael.remove",b),e.removeChild(d);for(a in b)b[a]="function"==typeof b[a]?c._removedFactory(a):null;this.removed=!0}},c.toString=function(){return"Your browser supports canvas.\nYou are running RedRaphael "+c.version};for(var T in t)t.hasOwnProperty(T)&&!u.hasOwnProperty(T)&&(u[T]=function(a){return function(){var b=arguments;return this.forEach(function(c){c[a].apply(c,b)})}}(T))}}}(),R.was?Q.win.Raphael=c:Raphael=c,c}); \ No newline at end of file diff --git a/package/raphael.js b/package/raphael.js index 246f95b..3e7104e 100644 --- a/package/raphael.js +++ b/package/raphael.js @@ -1,5 +1,5 @@ /**! - * RedRaphael 1.0.11 - JavaScript Vector Library + * RedRaphael 1.1.0 - JavaScript Vector Library * Copyright (c) 2012-2013 FusionCharts Technologies * * Raphael 2.1.0 @@ -6803,15 +6803,17 @@ var updateGradientReference = function (element, newGradient) { var gradient = element.gradient; + if (gradient) { if (gradient === newGradient) { return; // no change } + // else gradient is specified and it is not same as newGradient, implying a dereference gradient.refCount--; if (!gradient.refCount) { gradient.parentNode.removeChild(gradient); - delete element.gradient; } + delete element.gradient; } if (newGradient) { // add new gradient @@ -7556,7 +7558,7 @@ } } - tuneText(o, params); + (o.type === 'text') && tuneText(o, params); s.visibility = vis; }, leading = 1.2, @@ -7567,16 +7569,21 @@ return; } var a = el.attrs, - node = el.node, - computedStyle = node.firstChild && R._g.doc.defaultView.getComputedStyle(node.firstChild, E), - fontSize = computedStyle ? toFloat(R._g.doc.defaultView.getComputedStyle(node.firstChild, E).getPropertyValue("font-size")) : 10, - lineHeight = toFloat(params['line-height'] || a['line-height']) || fontSize * leading, - valign = a[has]("vertical-align") ? a["vertical-align"] : "middle"; + node = el.node, + computedStyle = node.firstChild && R._g.doc.defaultView.getComputedStyle(node.firstChild, E), + fontSize = computedStyle ? + toFloat(R._g.doc.defaultView.getComputedStyle(node.firstChild, E).getPropertyValue("font-size")) : 10, + lineHeight = toFloat(params['line-height'] || a['line-height']) || fontSize * leading, + valign = a[has]("vertical-align") ? a["vertical-align"] : "middle"; if (isNaN(lineHeight)) { lineHeight = fontSize * leading; } + if (R.is(params.text, 'array')) { + params.text = params.text.join('
'); + } + valign = valign === 'top' ? -0.5 : (valign === 'bottom' ? 0.5 : 0); if (params[has]("text") && (params.text !== a.text || el._textdirty)) { @@ -8641,7 +8648,7 @@ } node.appendChild(fill); var stroke = (node.getElementsByTagName("stroke") && node.getElementsByTagName("stroke")[0]), - newstroke = false; + newstroke = false; !stroke && (newstroke = stroke = createNode("stroke")); if ((params.stroke && params.stroke != "none") || params["stroke-width"] || @@ -9121,6 +9128,9 @@ } // this.paper.canvas.style.display = "none"; if ('text' in params && this.type == "text") { + if (R.is(params.text, 'array')) { + params.text = params.text.join('
'); + } this.textpath.string = params.text.replace(//ig, '\n'); } setFillAndStroke(this, params); diff --git a/source/raphael.svg.js b/source/raphael.svg.js index 8fb128f..c6f1de3 100644 --- a/source/raphael.svg.js +++ b/source/raphael.svg.js @@ -61,15 +61,17 @@ window.Raphael && window.Raphael.svg && function(R) { var updateGradientReference = function (element, newGradient) { var gradient = element.gradient; + if (gradient) { if (gradient === newGradient) { return; // no change } + // else gradient is specified and it is not same as newGradient, implying a dereference gradient.refCount--; if (!gradient.refCount) { gradient.parentNode.removeChild(gradient); - delete element.gradient; } + delete element.gradient; } if (newGradient) { // add new gradient @@ -814,7 +816,7 @@ window.Raphael && window.Raphael.svg && function(R) { } } - tuneText(o, params); + (o.type === 'text') && tuneText(o, params); s.visibility = vis; }, leading = 1.2, @@ -825,16 +827,21 @@ window.Raphael && window.Raphael.svg && function(R) { return; } var a = el.attrs, - node = el.node, - computedStyle = node.firstChild && R._g.doc.defaultView.getComputedStyle(node.firstChild, E), - fontSize = computedStyle ? toFloat(R._g.doc.defaultView.getComputedStyle(node.firstChild, E).getPropertyValue("font-size")) : 10, - lineHeight = toFloat(params['line-height'] || a['line-height']) || fontSize * leading, - valign = a[has]("vertical-align") ? a["vertical-align"] : "middle"; + node = el.node, + computedStyle = node.firstChild && R._g.doc.defaultView.getComputedStyle(node.firstChild, E), + fontSize = computedStyle ? + toFloat(R._g.doc.defaultView.getComputedStyle(node.firstChild, E).getPropertyValue("font-size")) : 10, + lineHeight = toFloat(params['line-height'] || a['line-height']) || fontSize * leading, + valign = a[has]("vertical-align") ? a["vertical-align"] : "middle"; if (isNaN(lineHeight)) { lineHeight = fontSize * leading; } + if (R.is(params.text, 'array')) { + params.text = params.text.join('
'); + } + valign = valign === 'top' ? -0.5 : (valign === 'bottom' ? 0.5 : 0); if (params[has]("text") && (params.text !== a.text || el._textdirty)) { diff --git a/source/raphael.vml.js b/source/raphael.vml.js index d22d279..4da7ea6 100644 --- a/source/raphael.vml.js +++ b/source/raphael.vml.js @@ -360,7 +360,7 @@ window.Raphael && window.Raphael.vml && function(R) { } node.appendChild(fill); var stroke = (node.getElementsByTagName("stroke") && node.getElementsByTagName("stroke")[0]), - newstroke = false; + newstroke = false; !stroke && (newstroke = stroke = createNode("stroke")); if ((params.stroke && params.stroke != "none") || params["stroke-width"] || @@ -838,6 +838,9 @@ window.Raphael && window.Raphael.vml && function(R) { } // this.paper.canvas.style.display = "none"; if ('text' in params && this.type == "text") { + if (R.is(params.text, 'array')) { + params.text = params.text.join('
'); + } this.textpath.string = params.text.replace(//ig, '\n'); } setFillAndStroke(this, params); @@ -1214,4 +1217,4 @@ window.Raphael && window.Raphael.vml && function(R) { }; })(method); } -}(window.Raphael); \ No newline at end of file +}(window.Raphael); diff --git a/tests/index.html b/tests/index.html index 9f9c742..328ba90 100644 --- a/tests/index.html +++ b/tests/index.html @@ -1,51 +1,26 @@ - - - - - - - + + + + + - r = p.rect({ - x: 10, - y: 10, - width: 100, - height: 100, - fill: '#ff0000' - }, g); - - r2 = p.rect({ - x: 110, - y: 110, - width: 100, - height: 100, - fill: '#ff0000' - }, g); - - p.text({ - text: 'hello world', - title: 'blah' - }); - - p.clear(); - - }; - - - -
- + + \ No newline at end of file