-
Notifications
You must be signed in to change notification settings - Fork 0
/
raphael-min.js
123 lines (123 loc) · 58.6 KB
/
raphael-min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*
* Raphael 1.5.2 - JavaScript Vector Library
*
* Copyright (c) 2010 Dmitry Baranovskiy (http://raphaeljs.com)
* Licensed under the MIT (http://raphaeljs.com/license.html) license.
*/
(function(){function k(){if(k.is(arguments[0],N)){for(var a=arguments[0],b=sa[D](k,a.splice(0,3+k.is(a[0],G))),c=b.set(),e=0,f=a[o];e<f;e++){var d=a[e]||{};fb[q](d.type)&&c[z](b[d.type]().attr(d))}return c}return sa[D](k,arguments)}function ga(){for(var a=[],b=0;b<32;b++)a[b]=(~~(v.random()*16))[U](16);a[12]=4;a[16]=(a[16]&3|8)[U](16);return"r-"+a[H]("")}function V(a,b,c){function e(){var f=Array[u].slice.call(arguments,0),d=f[H]("\u25ba"),g=e.cache=e.cache||{},j=e.count=e.count||[];if(g[q](d))return c?
c(g[d]):g[d];j[o]>=1E3&&delete g[j.shift()];j[z](d);g[d]=a[D](b,f);return c?c(g[d]):g[d]}return e}function Ha(){return this.x+E+this.y}function Ia(a){return function(b,c,e,f){var d={back:a};k.is(e,"function")?f=e:d.rot=e;b&&b.constructor==y&&(b=b.attrs.path);b&&(d.along=b);return this.animate(d,c,f)}}function gb(a,b,c,e,f,d){function g(a,b){var c,d,e,f;e=a;for(d=0;d<8;d++){f=((i*e+h)*e+j)*e-a;if(F(f)<b)return e;c=(3*i*e+2*h)*e+j;if(F(c)<1.0E-6)break;e-=f/c}c=0;d=1;e=a;if(e<c)return c;if(e>d)return d;
for(;c<d;){f=((i*e+h)*e+j)*e;if(F(f-a)<b)break;a>f?c=e:d=e;e=(d-c)/2+c}return e}var j=3*b,h=3*(e-b)-j,i=1-j-h,l=3*c,k=3*(f-c)-l,n=1-l-k;return function(a,b){var c=g(a,b);return((n*c+k)*c+l)*c}(a,1/(200*d))}k.version="1.5.2";var P=/[, ]+/,fb={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},hb=/\{(\d+)\}/g,u="prototype",q="hasOwnProperty",p=document,X=window,ta={was:Object[u][q].call(X,"Raphael"),is:X.Raphael},ha=function(){this.customAttributes={}},C,D="apply",ua="createTouch"in p,E=" ",t=String,
$="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend orientationchange touchcancel gesturestart gesturechange gestureend".split(E),va={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},H="join",o="length",Z=t[u].toLowerCase,v=Math,M=v.max,T=v.min,F=v.abs,B=v.pow,K=v.PI,G="number",N="array",U="toString",ib=Object[u][U],z="push",Ja=/^url\(['"]?([^\)]+?)['"]?\)$/i,jb=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,
kb={NaN:1,Infinity:1,"-Infinity":1},lb=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,J=v.round,w=parseFloat,W=parseInt,ia=t[u].toUpperCase,ja={blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/",opacity:1,path:"M0,0",r:0,rotation:0,rx:0,ry:0,scale:"1 1",src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt",
"stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",translation:"0 0",width:0,x:0,y:0},wa={along:"along",blur:G,"clip-rect":"csv",cx:G,cy:G,fill:"colour","fill-opacity":G,"font-size":G,height:G,opacity:G,path:"path",r:G,rotation:"csv",rx:G,ry:G,scale:"csv",stroke:"colour","stroke-opacity":G,"stroke-width":G,translation:"csv",width:G,x:G,y:G},mb=/^(from|to|\d+%?)$/,xa=/\s*,\s*/,nb={hs:1,rg:1},ob=/,?([achlmqrstvxz]),?/gi,
pb=/([achlmqstvz])[\s,]*((-?\d*\.?\d*(?:e[-+]?\d+)?\s*,?\s*)+)/ig,qb=/(-?\d*\.?\d*(?:e[-+]?\d+)?)\s*,?\s*/ig,Ka=/^r(?:\(([^,]+?)\s*,\s*([^\)]+?)\))?/,rb=function(a,b){return a.key-b.key};k.type=X.SVGAngle||p.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML";if(k.type=="VML"){var Q=p.createElement("div");Q.innerHTML='<v:shape adj="1"/>';Q=Q.firstChild;Q.style.behavior="url(#default#VML)";if(!(Q&&typeof Q.adj=="object"))return k.type=null;Q=null}k.svg=
!(k.vml=k.type=="VML");ha[u]=k[u];C=ha[u];k._id=0;k._oid=0;k.fn={};k.is=function(a,b){b=Z.call(b);if(b=="finite")return!kb[q](+a);return b=="null"&&a===null||b==typeof a||b=="object"&&a===Object(a)||b=="array"&&Array.isArray&&Array.isArray(a)||ib.call(a).slice(8,-1).toLowerCase()==b};k.angle=function(a,b,c,e,f,d){if(f==null){a-=c;b-=e;if(!a&&!b)return 0;return((a<0)*180+v.atan(-b/-a)*180/K+360)%360}else return k.angle(a,b,f,d)-k.angle(c,e,f,d)};k.rad=function(a){return a%360*K/180};k.deg=function(a){return a*
180/K%360};k.snapTo=function(a,b,c){c=k.is(c,"finite")?c:10;if(k.is(a,N))for(var e=a.length;e--;){if(F(a[e]-b)<=c)return a[e]}else{a=+a;e=b%a;if(e<c)return b-e;if(e>a-c)return b-e+a}return b};k.setWindow=function(a){X=a;p=X.document};var ka=function(a){if(k.vml){var b=/^\s+|\s+$/g,c;try{var e=new ActiveXObject("htmlfile");e.write("<body>");e.close();c=e.body}catch(f){c=createPopup().document.body}var d=c.createTextRange();ka=V(function(a){try{c.style.color=t(a).replace(b,"");var e=d.queryCommandValue("ForeColor");
return"#"+("000000"+((e&255)<<16|e&65280|(e&16711680)>>>16)[U](16)).slice(-6)}catch(f){return"none"}})}else{var g=p.createElement("i");g.title="Rapha\u00ebl Colour Picker";g.style.display="none";p.body.appendChild(g);ka=V(function(a){g.style.color=a;return p.defaultView.getComputedStyle(g,"").getPropertyValue("color")})}return ka(a)},La=function(){return"hsb("+[this.h,this.s,this.b]+")"},sb=function(){return"hsl("+[this.h,this.s,this.l]+")"},tb=function(){return this.hex};k.hsb2rgb=function(a,b,c,
e){if(k.is(a,"object")&&"h"in a&&"s"in a&&"b"in a)c=a.b,b=a.s,a=a.h,e=a.o;return k.hsl2rgb(a,b,c/2,e)};k.hsl2rgb=function(a,b,c,e){if(k.is(a,"object")&&"h"in a&&"s"in a&&"l"in a)c=a.l,b=a.s,a=a.h;if(a>1||b>1||c>1)a/=360,b/=100,c/=100;var f={},d=["r","g","b"],g;if(b)for(var b=c<0.5?c*(1+b):c+b-c*b,c=2*c-b,j=0;j<3;j++)g=a+1/3*-(j-1),g<0&&g++,g>1&&g--,f[d[j]]=g*6<1?c+(b-c)*6*g:g*2<1?b:g*3<2?c+(b-c)*(2/3-g)*6:c;else f={r:c,g:c,b:c};f.r*=255;f.g*=255;f.b*=255;f.hex="#"+(16777216|f.b|f.g<<8|f.r<<16).toString(16).slice(1);
k.is(e,"finite")&&(f.opacity=e);f.toString=tb;return f};k.rgb2hsb=function(a,b,c){if(b==null&&k.is(a,"object")&&"r"in a&&"g"in a&&"b"in a)c=a.b,b=a.g,a=a.r;if(b==null&&k.is(a,"string"))var e=k.getRGB(a),a=e.r,b=e.g,c=e.b;if(a>1||b>1||c>1)a/=255,b/=255,c/=255;var e=M(a,b,c),f=T(a,b,c);if(f==e)return{h:0,s:0,b:e,toString:La};else f=e-f,a=a==e?(b-c)/f:b==e?2+(c-a)/f:4+(a-b)/f,a/=6,a<0&&a++,a>1&&a--;return{h:a,s:f/e,b:e,toString:La}};k.rgb2hsl=function(a,b,c){if(b==null&&k.is(a,"object")&&"r"in a&&"g"in
a&&"b"in a)c=a.b,b=a.g,a=a.r;if(b==null&&k.is(a,"string"))var e=k.getRGB(a),a=e.r,b=e.g,c=e.b;if(a>1||b>1||c>1)a/=255,b/=255,c/=255;var e=M(a,b,c),f=T(a,b,c),d=(e+f)/2;if(f==e)a={h:0,s:0,l:d};else{var g=e-f,a=a==e?(b-c)/g:b==e?2+(c-a)/g:4+(a-b)/g;a/=6;a<0&&a++;a>1&&a--;a={h:a,s:d<0.5?g/(e+f):g/(2-e-f),l:d}}a.toString=sb;return a};k._path2string=function(){return this.join(",").replace(ob,"$1")};k.getRGB=V(function(a){if(!a||(a=t(a)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1};if(a=="none")return{r:-1,
g:-1,b:-1,hex:"none"};!(nb[q](a.toLowerCase().substring(0,2))||a.charAt()=="#")&&(a=ka(a));var b,c,e,f,d;if(a=a.match(jb)){a[2]&&(e=W(a[2].substring(5),16),c=W(a[2].substring(3,5),16),b=W(a[2].substring(1,3),16));a[3]&&(e=W((d=a[3].charAt(3))+d,16),c=W((d=a[3].charAt(2))+d,16),b=W((d=a[3].charAt(1))+d,16));a[4]&&(d=a[4].split(xa),b=w(d[0]),d[0].slice(-1)=="%"&&(b*=2.55),c=w(d[1]),d[1].slice(-1)=="%"&&(c*=2.55),e=w(d[2]),d[2].slice(-1)=="%"&&(e*=2.55),a[1].toLowerCase().slice(0,4)=="rgba"&&(f=w(d[3])),
d[3]&&d[3].slice(-1)=="%"&&(f/=100));if(a[5])return d=a[5].split(xa),b=w(d[0]),d[0].slice(-1)=="%"&&(b*=2.55),c=w(d[1]),d[1].slice(-1)=="%"&&(c*=2.55),e=w(d[2]),d[2].slice(-1)=="%"&&(e*=2.55),(d[0].slice(-3)=="deg"||d[0].slice(-1)=="\u00b0")&&(b/=360),a[1].toLowerCase().slice(0,4)=="hsba"&&(f=w(d[3])),d[3]&&d[3].slice(-1)=="%"&&(f/=100),k.hsb2rgb(b,c,e,f);if(a[6])return d=a[6].split(xa),b=w(d[0]),d[0].slice(-1)=="%"&&(b*=2.55),c=w(d[1]),d[1].slice(-1)=="%"&&(c*=2.55),e=w(d[2]),d[2].slice(-1)=="%"&&
(e*=2.55),(d[0].slice(-3)=="deg"||d[0].slice(-1)=="\u00b0")&&(b/=360),a[1].toLowerCase().slice(0,4)=="hsla"&&(f=w(d[3])),d[3]&&d[3].slice(-1)=="%"&&(f/=100),k.hsl2rgb(b,c,e,f);a={r:b,g:c,b:e};a.hex="#"+(16777216|e|c<<8|b<<16).toString(16).slice(1);k.is(f,"finite")&&(a.opacity=f);return a}return{r:-1,g:-1,b:-1,hex:"none",error:1}},k);k.getColor=function(a){var a=this.getColor.start=this.getColor.start||{h:0,s:1,b:a||0.75},b=this.hsb2rgb(a.h,a.s,a.b);a.h+=0.075;if(a.h>1)a.h=0,a.s-=0.2,a.s<=0&&(this.getColor.start=
{h:0,s:1,b:a.b});return b.hex};k.getColor.reset=function(){delete this.start};k.parsePathString=V(function(a){if(!a)return null;var b={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},c=[];k.is(a,N)&&k.is(a[0],N)&&(c=la(a));c[o]||t(a).replace(pb,function(a,f,d){var g=[],a=Z.call(f);d.replace(qb,function(a,b){b&&g[z](+b)});a=="m"&&g[o]>2&&(c[z]([f].concat(g.splice(0,2))),a="l",f=f=="m"?"l":"L");for(;g[o]>=b[a];)if(c[z]([f].concat(g.splice(0,b[a]))),!b[a])break});c[U]=k._path2string;return c});k.findDotsAtSegment=
function(a,b,c,e,f,d,g,j,h){var i=1-h,l=B(i,3)*a+B(i,2)*3*h*c+i*3*h*h*f+B(h,3)*g,i=B(i,3)*b+B(i,2)*3*h*e+i*3*h*h*d+B(h,3)*j,k=a+2*h*(c-a)+h*h*(f-2*c+a),n=b+2*h*(e-b)+h*h*(d-2*e+b),o=c+2*h*(f-c)+h*h*(g-2*f+c),m=e+2*h*(d-e)+h*h*(j-2*d+e),a=(1-h)*a+h*c,b=(1-h)*b+h*e,f=(1-h)*f+h*g,d=(1-h)*d+h*j,j=90-v.atan((k-o)/(n-m))*180/K;(k>o||n<m)&&(j+=180);return{x:l,y:i,m:{x:k,y:n},n:{x:o,y:m},start:{x:a,y:b},end:{x:f,y:d},alpha:j}};var na=V(function(a){if(!a)return{x:0,y:0,width:0,height:0};for(var a=ma(a),b=
0,c=0,e=[],f=[],d,g=0,j=a[o];g<j;g++)d=a[g],d[0]=="M"?(b=d[1],c=d[2],e[z](b),f[z](c)):(b=ub(b,c,d[1],d[2],d[3],d[4],d[5],d[6]),e=e.concat(b.min.x,b.max.x),f=f.concat(b.min.y,b.max.y),b=d[5],c=d[6]);a=T[D](0,e);d=T[D](0,f);return{x:a,y:d,width:M[D](0,e)-a,height:M[D](0,f)-d}}),la=function(a){var b=[];if(!k.is(a,N)||!k.is(a&&a[0],N))a=k.parsePathString(a);for(var c=0,e=a[o];c<e;c++){b[c]=[];for(var f=0,d=a[c][o];f<d;f++)b[c][f]=a[c][f]}b[U]=k._path2string;return b},ya=V(function(a){if(!k.is(a,N)||!k.is(a&&
a[0],N))a=k.parsePathString(a);var b=[],c=0,e=0,f=0,d=0,g=0;a[0][0]=="M"&&(c=a[0][1],e=a[0][2],f=c,d=e,g++,b[z](["M",c,e]));for(var j=a[o];g<j;g++){var h=b[g]=[],i=a[g];if(i[0]!=Z.call(i[0]))switch(h[0]=Z.call(i[0]),h[0]){case "a":h[1]=i[1];h[2]=i[2];h[3]=i[3];h[4]=i[4];h[5]=i[5];h[6]=+(i[6]-c).toFixed(3);h[7]=+(i[7]-e).toFixed(3);break;case "v":h[1]=+(i[1]-e).toFixed(3);break;case "m":f=i[1],d=i[2];default:for(var l=1,A=i[o];l<A;l++)h[l]=+(i[l]-(l%2?c:e)).toFixed(3)}else{b[g]=[];i[0]=="m"&&(f=i[1]+
c,d=i[2]+e);h=0;for(l=i[o];h<l;h++)b[g][h]=i[h]}i=b[g][o];switch(b[g][0]){case "z":c=f;e=d;break;case "h":c+=+b[g][i-1];break;case "v":e+=+b[g][i-1];break;default:c+=+b[g][i-2],e+=+b[g][i-1]}}b[U]=k._path2string;return b},0,la),ca=V(function(a){if(!k.is(a,N)||!k.is(a&&a[0],N))a=k.parsePathString(a);var b=[],c=0,e=0,f=0,d=0,g=0;a[0][0]=="M"&&(c=+a[0][1],e=+a[0][2],f=c,d=e,g++,b[0]=["M",c,e]);for(var j=a[o];g<j;g++){var h=b[g]=[],i=a[g];if(i[0]!=ia.call(i[0]))switch(h[0]=ia.call(i[0]),h[0]){case "A":h[1]=
i[1];h[2]=i[2];h[3]=i[3];h[4]=i[4];h[5]=i[5];h[6]=+(i[6]+c);h[7]=+(i[7]+e);break;case "V":h[1]=+i[1]+e;break;case "H":h[1]=+i[1]+c;break;case "M":f=+i[1]+c,d=+i[2]+e;default:for(var l=1,A=i[o];l<A;l++)h[l]=+i[l]+(l%2?c:e)}else{l=0;for(A=i[o];l<A;l++)b[g][l]=i[l]}switch(h[0]){case "Z":c=f;e=d;break;case "H":c=h[1];break;case "V":e=h[1];break;case "M":f=b[g][b[g][o]-2],d=b[g][b[g][o]-1];default:c=b[g][b[g][o]-2],e=b[g][b[g][o]-1]}}b[U]=k._path2string;return b},null,la),Ma=function(a,b,c,e,f,d){var g=
1/3,j=2/3;return[g*a+j*c,g*b+j*e,g*f+j*c,g*d+j*e,f,d]},Na=function(a,b,c,e,f,d,g,j,h,i){var l=K*120/180,k=K/180*(+f||0),n=[],r,m=V(function(a,b,c){var d=a*v.cos(c)-b*v.sin(c),a=a*v.sin(c)+b*v.cos(c);return{x:d,y:a}});if(i)x=i[0],r=i[1],d=i[2],I=i[3];else{r=m(a,b,-k);a=r.x;b=r.y;r=m(j,h,-k);j=r.x;h=r.y;v.cos(K/180*f);v.sin(K/180*f);r=(a-j)/2;x=(b-h)/2;I=r*r/(c*c)+x*x/(e*e);I>1&&(I=v.sqrt(I),c*=I,e*=I);var I=c*c,ba=e*e,I=(d==g?-1:1)*v.sqrt(F((I*ba-I*x*x-ba*r*r)/(I*x*x+ba*r*r))),d=I*c*x/e+(a+j)/2,I=
I*-e*r/c+(b+h)/2,x=v.asin(((b-I)/e).toFixed(9));r=v.asin(((h-I)/e).toFixed(9));x=a<d?K-x:x;r=j<d?K-r:r;x<0&&(x=K*2+x);r<0&&(r=K*2+r);g&&x>r&&(x-=K*2);!g&&r>x&&(r-=K*2)}if(F(r-x)>l){var n=r,ba=j,q=h;r=x+l*(g&&r>x?1:-1);j=d+c*v.cos(r);h=I+e*v.sin(r);n=Na(j,h,c,e,f,0,g,ba,q,[r,n,d,I])}d=r-x;f=v.cos(x);l=v.sin(x);g=v.cos(r);r=v.sin(r);d=v.tan(d/4);c=4/3*c*d;d*=4/3*e;e=[a,b];a=[a+c*l,b-d*f];b=[j+c*r,h-d*g];j=[j,h];a[0]=2*e[0]-a[0];a[1]=2*e[1]-a[1];if(i)return[a,b,j].concat(n);else{n=[a,b,j].concat(n)[H]().split(",");
i=[];j=0;for(h=n[o];j<h;j++)i[j]=j%2?m(n[j-1],n[j],k).y:m(n[j],n[j+1],k).x;return i}},oa=function(a,b,c,e,f,d,g,j,h){var i=1-h;return{x:B(i,3)*a+B(i,2)*3*h*c+i*3*h*h*f+B(h,3)*g,y:B(i,3)*b+B(i,2)*3*h*e+i*3*h*h*d+B(h,3)*j}},ub=V(function(a,b,c,e,f,d,g,j){var h=f-2*c+a-(g-2*f+c),i=2*(c-a)-2*(f-c),l=a-c,k=(-i+v.sqrt(i*i-4*h*l))/2/h,h=(-i-v.sqrt(i*i-4*h*l))/2/h,n=[b,j],o=[a,g];F(k)>"1e12"&&(k=0.5);F(h)>"1e12"&&(h=0.5);k>0&&k<1&&(k=oa(a,b,c,e,f,d,g,j,k),o[z](k.x),n[z](k.y));h>0&&h<1&&(k=oa(a,b,c,e,f,d,
g,j,h),o[z](k.x),n[z](k.y));h=d-2*e+b-(j-2*d+e);i=2*(e-b)-2*(d-e);l=b-e;k=(-i+v.sqrt(i*i-4*h*l))/2/h;h=(-i-v.sqrt(i*i-4*h*l))/2/h;F(k)>"1e12"&&(k=0.5);F(h)>"1e12"&&(h=0.5);k>0&&k<1&&(k=oa(a,b,c,e,f,d,g,j,k),o[z](k.x),n[z](k.y));h>0&&h<1&&(k=oa(a,b,c,e,f,d,g,j,h),o[z](k.x),n[z](k.y));return{min:{x:T[D](0,o),y:T[D](0,n)},max:{x:M[D](0,o),y:M[D](0,n)}}}),ma=V(function(a,b){var c=ca(a),e=b&&ca(b),f={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},d={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},g=function(a,
b){var c,d;if(!a)return["C",b.x,b.y,b.x,b.y,b.x,b.y];!(a[0]in{T:1,Q:1})&&(b.qx=b.qy=null);switch(a[0]){case "M":b.X=a[1];b.Y=a[2];break;case "A":a=["C"].concat(Na[D](0,[b.x,b.y].concat(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].concat(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"].concat(Ma(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"].concat(Ma(b.x,b.y,a[1],a[2],a[3],a[4]));break;case "L":a=
["C"].concat([b.x,b.y,a[1],a[2],a[1],a[2]]);break;case "H":a=["C"].concat([b.x,b.y,a[1],b.y,a[1],b.y]);break;case "V":a=["C"].concat([b.x,b.y,b.x,a[1],b.x,a[1]]);break;case "Z":a=["C"].concat([b.x,b.y,b.X,b.Y,b.X,b.Y])}return a},j=function(a,b){if(a[b][o]>7){a[b].shift();for(var d=a[b];d[o];)a.splice(b++,0,["C"].concat(d.splice(0,6)));a.splice(b,1);k=M(c[o],e&&e[o]||0)}},h=function(a,b,d,f,g){if(a&&b&&a[g][0]=="M"&&b[g][0]!="M")b.splice(g,0,["M",f.x,f.y]),d.bx=0,d.by=0,d.x=a[g][1],d.y=a[g][2],k=M(c[o],
e&&e[o]||0)},i=0,k=M(c[o],e&&e[o]||0);for(;i<k;i++){c[i]=g(c[i],f);j(c,i);e&&(e[i]=g(e[i],d));e&&j(e,i);h(c,e,f,d,i);h(e,c,d,f,i);var A=c[i],n=e&&e[i],r=A[o],m=e&&n[o];f.x=A[r-2];f.y=A[r-1];f.bx=w(A[r-4])||f.x;f.by=w(A[r-3])||f.y;d.bx=e&&(w(n[m-4])||d.x);d.by=e&&(w(n[m-3])||d.y);d.x=e&&n[m-2];d.y=e&&n[m-1]}return e?[c,e]:c},null,la),Oa=V(function(a){for(var b=[],c=0,e=a[o];c<e;c++){var f={},d=a[c].match(/^([^:]*):?([\d\.]*)/);f.color=k.getRGB(d[1]);if(f.color.error)return null;f.color=f.color.hex;
d[2]&&(f.offset=d[2]+"%");b[z](f)}c=1;for(e=b[o]-1;c<e;c++)if(!b[c].offset){a=w(b[c-1].offset||0);d=0;for(f=c+1;f<e;f++)if(b[f].offset){d=b[f].offset;break}d||(d=100,f=e);d=w(d);for(d=(d-a)/(f-c+1);c<f;c++)a+=d,b[c].offset=a+"%"}return b}),Pa=function(a,b,c,e){if(k.is(a,"string")||k.is(a,"object")){if(a=k.is(a,"string")?p.getElementById(a):a,a.tagName)return b==null?{container:a,width:a.style.pixelWidth||a.offsetWidth,height:a.style.pixelHeight||a.offsetHeight}:{container:a,width:b,height:c}}else return{container:1,
x:a,y:b,width:c,height:e}},za=function(a,b){var c=this,e;for(e in b)if(b[q](e)&&!(e in a))switch(typeof b[e]){case "function":(function(b){a[e]=a===c?b:function(){return b[D](c,arguments)}})(b[e]);break;case "object":a[e]=a[e]||{};za.call(this,a[e],b[e]);break;default:a[e]=b[e]}},aa=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)},Qa=function(a,b){if(b.top!==a)aa(a,b),a.next=null,a.prev=b.top,b.top.next=a,b.top=a},Ra=
function(a,b){if(b.bottom!==a)aa(a,b),a.next=b.bottom,a.prev=null,b.bottom.prev=a,b.bottom=a},Sa=function(a,b,c){aa(a,c);b==c.top&&(c.top=a);b.next&&(b.next.prev=a);a.next=b.next;a.prev=b;b.next=a},Ta=function(a,b,c){aa(a,c);b==c.bottom&&(c.bottom=a);b.prev&&(b.prev.next=a);a.prev=b.prev;b.prev=a;a.next=b},Ua=function(a){return function(){throw Error("Rapha\u00ebl: you are calling to method \u201c"+a+"\u201d of removed object");}};k.pathToRelative=ya;if(k.svg){C.svgns="http://www.w3.org/2000/svg";
C.xlink="http://www.w3.org/1999/xlink";var J=function(a){return+a+(~~a===a)*0.5},m=function(a,b){if(b)for(var c in b)b[q](c)&&a.setAttribute(c,t(b[c]));else return a=p.createElementNS(C.svgns,a),a.style.webkitTapHighlightColor="rgba(0,0,0,0)",a};k[U]=function(){return"Your browser supports SVG.\nYou are running Rapha\u00ebl "+this.version};var Va=function(a,b){var c=m("path");b.canvas&&b.canvas.appendChild(c);c=new y(c,b);c.type="path";Y(c,{fill:"none",stroke:"#000",path:a});return c},da=function(a,
b,c){var e="linear",f=0.5,d=0.5,g=a.style,b=t(b).replace(Ka,function(a,b,c){e="radial";b&&c&&(f=w(b),d=w(c),a=(d>0.5)*2-1,B(f-0.5,2)+B(d-0.5,2)>0.25&&(d=v.sqrt(0.25-B(f-0.5,2))*a+0.5)&&d!=0.5&&(d=d.toFixed(5)-1.0E-5*a));return""}),b=b.split(/\s*\-\s*/);if(e=="linear"){var j=b.shift(),j=-w(j);if(isNaN(j))return null;var j=[0,0,v.cos(j*K/180),v.sin(j*K/180)],h=1/(M(F(j[2]),F(j[3]))||1);j[2]*=h;j[3]*=h;j[2]<0&&(j[0]=-j[2],j[2]=0);j[3]<0&&(j[1]=-j[3],j[3]=0)}b=Oa(b);if(!b)return null;h=a.getAttribute("fill");
(h=h.match(/^url\(#(.*)\)$/))&&c.defs.removeChild(p.getElementById(h[1]));h=m(e+"Gradient");h.id=ga();m(h,e=="radial"?{fx:f,fy:d}:{x1:j[0],y1:j[1],x2:j[2],y2:j[3]});c.defs.appendChild(h);c=0;for(j=b[o];c<j;c++){var i=m("stop");m(i,{offset:b[c].offset?b[c].offset:!c?"0%":"100%","stop-color":b[c].color||"#fff"});h.appendChild(i)}m(a,{fill:"url(#"+h.id+")",opacity:1,"fill-opacity":1});g.fill="";g.opacity=1;return g.fillOpacity=1},Aa=function(a){var b=a.getBBox();m(a.pattern,{patternTransform:k.format("translate({0},{1})",
b.x,b.y)})},Y=function(a,b){var c={"":[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]},e=a.node,f=a.attrs,d=a.rotate(),g=function(a,d){if(d=c[Z.call(d)]){for(var f=a.attrs["stroke-width"]||"1",g={round:f,square:f,butt:0}[a.attrs["stroke-linecap"]||b["stroke-linecap"]]||0,i=[],h=d[o];h--;)i[h]=d[h]*f+(h%2?1:-1)*g;m(e,{"stroke-dasharray":i[H](",")})}};b[q]("rotation")&&(d=b.rotation);var j=t(d).split(P);
j.length-1?(j[1]=+j[1],j[2]=+j[2]):j=null;w(d)&&a.rotate(0,!0);for(var h in b)if(b[q](h)&&ja[q](h)){var i=b[h];f[h]=i;switch(h){case "blur":a.blur(i);break;case "rotation":a.rotate(i,!0);break;case "href":case "title":case "target":var l=e.parentNode;if(Z.call(l.tagName)!="a"){var A=m("a");l.insertBefore(A,e);A.appendChild(e);l=A}h=="target"&&i=="blank"?l.setAttributeNS(a.paper.xlink,"show","new"):l.setAttributeNS(a.paper.xlink,h,i);break;case "cursor":e.style.cursor=i;break;case "clip-rect":l=t(i).split(P);
if(l[o]==4){a.clip&&a.clip.parentNode.parentNode.removeChild(a.clip.parentNode);var n=m("clipPath"),A=m("rect");n.id=ga();m(A,{x:l[0],y:l[1],width:l[2],height:l[3]});n.appendChild(A);a.paper.defs.appendChild(n);m(e,{"clip-path":"url(#"+n.id+")"});a.clip=A}i||((i=p.getElementById(e.getAttribute("clip-path").replace(/(^url\(#|\)$)/g,"")))&&i.parentNode.removeChild(i),m(e,{"clip-path":""}),delete a.clip);break;case "path":if(a.type=="path")m(e,{d:i?f.path=ca(i):"M0,0"});break;case "width":if(e.setAttribute(h,
i),f.fx)h="x",i=f.x;else break;case "x":f.fx&&(i=-f.x-(f.width||0));case "rx":if(h=="rx"&&a.type=="rect")break;case "cx":j&&(h=="x"||h=="cx")&&(j[1]+=i-f[h]);e.setAttribute(h,i);a.pattern&&Aa(a);break;case "height":if(e.setAttribute(h,i),f.fy)h="y",i=f.y;else break;case "y":f.fy&&(i=-f.y-(f.height||0));case "ry":if(h=="ry"&&a.type=="rect")break;case "cy":j&&(h=="y"||h=="cy")&&(j[2]+=i-f[h]);e.setAttribute(h,i);a.pattern&&Aa(a);break;case "r":a.type=="rect"?m(e,{rx:i,ry:i}):e.setAttribute(h,i);break;
case "src":a.type=="image"&&e.setAttributeNS(a.paper.xlink,"href",i);break;case "stroke-width":e.style.strokeWidth=i;e.setAttribute(h,i);f["stroke-dasharray"]&&g(a,f["stroke-dasharray"]);break;case "stroke-dasharray":g(a,i);break;case "translation":i=t(i).split(P);i[0]=+i[0]||0;i[1]=+i[1]||0;j&&(j[1]+=i[0],j[2]+=i[1]);pa.call(a,i[0],i[1]);break;case "scale":i=t(i).split(P);a.scale(+i[0]||1,+i[1]||+i[0]||1,isNaN(w(i[2]))?null:+i[2],isNaN(w(i[3]))?null:+i[3]);break;case "fill":if(l=t(i).match(Ja)){var n=
m("pattern"),r=m("image");n.id=ga();m(n,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1});m(r,{x:0,y:0});r.setAttributeNS(a.paper.xlink,"href",l[1]);n.appendChild(r);i=p.createElement("img");i.style.cssText="position:absolute;left:-9999em;top-9999em";i.onload=function(){m(n,{width:this.offsetWidth,height:this.offsetHeight});m(r,{width:this.offsetWidth,height:this.offsetHeight});p.body.removeChild(this);a.paper.safari()};p.body.appendChild(i);i.src=l[1];a.paper.defs.appendChild(n);e.style.fill=
"url(#"+n.id+")";m(e,{fill:"url(#"+n.id+")"});a.pattern=n;a.pattern&&Aa(a);break}l=k.getRGB(i);if(l.error){if(({circle:1,ellipse:1}[q](a.type)||t(i).charAt()!="r")&&da(e,i,a.paper)){f.gradient=i;f.fill="none";break}}else delete b.gradient,delete f.gradient,!k.is(f.opacity,"undefined")&&k.is(b.opacity,"undefined")&&m(e,{opacity:f.opacity}),!k.is(f["fill-opacity"],"undefined")&&k.is(b["fill-opacity"],"undefined")&&m(e,{"fill-opacity":f["fill-opacity"]});l[q]("opacity")&&m(e,{"fill-opacity":l.opacity>
1?l.opacity/100:l.opacity});case "stroke":l=k.getRGB(i);e.setAttribute(h,l.hex);h=="stroke"&&l[q]("opacity")&&m(e,{"stroke-opacity":l.opacity>1?l.opacity/100:l.opacity});break;case "gradient":(({circle:1,ellipse:1})[q](a.type)||t(i).charAt()!="r")&&da(e,i,a.paper);break;case "opacity":f.gradient&&!f[q]("stroke-opacity")&&m(e,{"stroke-opacity":i>1?i/100:i});case "fill-opacity":if(f.gradient){if(l=p.getElementById(e.getAttribute("fill").replace(/^url\(#|\)$/g,"")))l=l.getElementsByTagName("stop"),l[l[o]-
1].setAttribute("stop-opacity",i);break}default:h=="font-size"&&(i=W(i,10)+"px"),l=h.replace(/(\-.)/g,function(a){return ia.call(a.substring(1))}),e.style[l]=i,e.setAttribute(h,i)}}vb(a,b);j?a.rotate(j.join(E)):w(d)&&a.rotate(d,!0)},vb=function(a,b){if(!(a.type!="text"||!b[q]("text")&&!b[q]("font")&&!b[q]("font-size")&&!b[q]("x")&&!b[q]("y"))){var c=a.attrs,e=a.node,f=e.firstChild?W(p.defaultView.getComputedStyle(e.firstChild,"").getPropertyValue("font-size"),10):10;if(b[q]("text")){for(c.text=b.text;e.firstChild;)e.removeChild(e.firstChild);
for(var d=t(b.text).split("\n"),g=0,j=d[o];g<j;g++)if(d[g]){var h=m("tspan");g&&m(h,{dy:f*1.2,x:c.x});h.appendChild(p.createTextNode(d[g]));e.appendChild(h)}}else{d=e.getElementsByTagName("tspan");g=0;for(j=d[o];g<j;g++)g&&m(d[g],{dy:f*1.2,x:c.x})}m(e,{y:c.y});f=a.getBBox();(f=c.y-(f.y+f.height/2))&&k.is(f,"finite")&&m(e,{y:c.y+f})}},y=function(a,b){this[0]=a;this.id=k._oid++;this.node=a;a.raphael=this;this.paper=b;this.attrs=this.attrs||{};this.transformations=[];this._={tx:0,ty:0,rt:{deg:0,cx:0,
cy:0},sx:1,sy:1};!b.bottom&&(b.bottom=this);(this.prev=b.top)&&(b.top.next=this);b.top=this;this.next=null},s=y[u];y[u].rotate=function(a,b,c){if(this.removed)return this;if(a==null){if(this._.rt.cx)return[this._.rt.deg,this._.rt.cx,this._.rt.cy][H](E);return this._.rt.deg}var e=this.getBBox(),a=t(a).split(P);a[o]-1&&(b=w(a[1]),c=w(a[2]));a=w(a[0]);b!=null&&b!==!1?this._.rt.deg=a:this._.rt.deg+=a;c==null&&(b=null);this._.rt.cx=b;this._.rt.cy=c;b=b==null?e.x+e.width/2:b;c=c==null?e.y+e.height/2:c;
this._.rt.deg?(this.transformations[0]=k.format("rotate({0} {1} {2})",this._.rt.deg,b,c),this.clip&&m(this.clip,{transform:k.format("rotate({0} {1} {2})",-this._.rt.deg,b,c)})):(this.transformations[0]="",this.clip&&m(this.clip,{transform:""}));m(this.node,{transform:this.transformations[H](E)});return this};y[u].hide=function(){!this.removed&&(this.node.style.display="none");return this};y[u].show=function(){!this.removed&&(this.node.style.display="");return this};y[u].remove=function(){if(!this.removed){aa(this,
this.paper);this.node.parentNode.removeChild(this.node);for(var a in this)delete this[a];this.removed=!0}};y[u].getBBox=function(){if(this.removed)return this;if(this.type=="path")return na(this.attrs.path);if(this.node.style.display=="none"){this.show();var a=!0}var b={};try{b=this.node.getBBox()}catch(c){}finally{b=b||{}}if(this.type=="text")for(var b={x:b.x,y:Infinity,width:0,height:0},e=0,f=this.node.getNumberOfChars();e<f;e++){var d=this.node.getExtentOfChar(e);d.y<b.y&&(b.y=d.y);d.y+d.height-
b.y>b.height&&(b.height=d.y+d.height-b.y);d.x+d.width-b.x>b.width&&(b.width=d.x+d.width-b.x)}a&&this.hide();return b};y[u].attr=function(a,b){if(this.removed)return this;if(a==null){var c={},e;for(e in this.attrs)this.attrs[q](e)&&(c[e]=this.attrs[e]);this._.rt.deg&&(c.rotation=this.rotate());(this._.sx!=1||this._.sy!=1)&&(c.scale=this.scale());c.gradient&&c.fill=="none"&&(c.fill=c.gradient)&&delete c.gradient;return c}if(b==null&&k.is(a,"string")){if(a=="translation")return pa.call(this);if(a=="rotation")return this.rotate();
if(a=="scale")return this.scale();if(a=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;return this.attrs[a]}if(b==null&&k.is(a,N)){e={};for(var c=0,f=a.length;c<f;c++)e[a[c]]=this.attr(a[c]);return e}b!=null?(c={},c[a]=b):a!=null&&k.is(a,"object")&&(c=a);for(f in this.paper.customAttributes)if(this.paper.customAttributes[q](f)&&c[q](f)&&k.is(this.paper.customAttributes[f],"function"))for(var d in e=this.paper.customAttributes[f].apply(this,[].concat(c[f])),this.attrs[f]=
c[f],e)e[q](d)&&(c[d]=e[d]);Y(this,c);return this};y[u].toFront=function(){if(this.removed)return this;this.node.parentNode.appendChild(this.node);var a=this.paper;a.top!=this&&Qa(this,a);return this};y[u].toBack=function(){if(this.removed)return this;this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),Ra(this,this.paper));return this};y[u].insertAfter=function(a){if(this.removed)return this;var b=a.node||a[a.length-1].node;b.nextSibling?
b.parentNode.insertBefore(this.node,b.nextSibling):b.parentNode.appendChild(this.node);Sa(this,a,this.paper);return this};y[u].insertBefore=function(a){if(this.removed)return this;var b=a.node||a[0].node;b.parentNode.insertBefore(this.node,b);Ta(this,a,this.paper);return this};y[u].blur=function(a){if(+a!==0){var b=m("filter"),c=m("feGaussianBlur");this.attrs.blur=a;b.id=ga();m(c,{stdDeviation:+a||1.5});b.appendChild(c);this.paper.defs.appendChild(b);this._blur=b;m(this.node,{filter:"url(#"+b.id+
")"})}else this._blur&&(this._blur.parentNode.removeChild(this._blur),delete this._blur,delete this.attrs.blur),this.node.removeAttribute("filter")};var Wa=function(a,b,c,e){var f=m("circle");a.canvas&&a.canvas.appendChild(f);a=new y(f,a);a.attrs={cx:b,cy:c,r:e,fill:"none",stroke:"#000"};a.type="circle";m(f,a.attrs);return a},Xa=function(a,b,c,e,f,d){var g=m("rect");a.canvas&&a.canvas.appendChild(g);a=new y(g,a);a.attrs={x:b,y:c,width:e,height:f,r:d||0,rx:d||0,ry:d||0,fill:"none",stroke:"#000"};a.type=
"rect";m(g,a.attrs);return a},Ya=function(a,b,c,e,f){var d=m("ellipse");a.canvas&&a.canvas.appendChild(d);a=new y(d,a);a.attrs={cx:b,cy:c,rx:e,ry:f,fill:"none",stroke:"#000"};a.type="ellipse";m(d,a.attrs);return a},Za=function(a,b,c,e,f,d){var g=m("image");m(g,{x:c,y:e,width:f,height:d,preserveAspectRatio:"none"});g.setAttributeNS(a.xlink,"href",b);a.canvas&&a.canvas.appendChild(g);a=new y(g,a);a.attrs={x:c,y:e,width:f,height:d,src:b};a.type="image";return a},$a=function(a,b,c,e){var f=m("text");
m(f,{x:b,y:c,"text-anchor":"middle"});a.canvas&&a.canvas.appendChild(f);a=new y(f,a);a.attrs={x:b,y:c,"text-anchor":"middle",text:e,font:ja.font,stroke:"none",fill:"#000"};a.type="text";Y(a,a.attrs);return a},ab=function(a,b){this.width=a||this.width;this.height=b||this.height;this.canvas.setAttribute("width",this.width);this.canvas.setAttribute("height",this.height);return this},sa=function(){var a=Pa[D](0,arguments),b=a&&a.container,c=a.x,e=a.y,f=a.width,a=a.height;if(!b)throw Error("SVG container not found.");
var d=m("svg"),c=c||0,e=e||0,f=f||512,a=a||342;m(d,{xmlns:"http://www.w3.org/2000/svg",version:1.1,width:f,height:a});b==1?(d.style.cssText="position:absolute;left:"+c+"px;top:"+e+"px",p.body.appendChild(d)):b.firstChild?b.insertBefore(d,b.firstChild):b.appendChild(d);b=new ha;b.width=f;b.height=a;b.canvas=d;za.call(b,b,k.fn);b.clear();return b};C.clear=function(){for(var a=this.canvas;a.firstChild;)a.removeChild(a.firstChild);this.bottom=this.top=null;(this.desc=m("desc")).appendChild(p.createTextNode("Created with Rapha\u00ebl"));
a.appendChild(this.desc);a.appendChild(this.defs=m("defs"))};C.remove=function(){this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=Ua(a)}}if(k.vml){var bb={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},wb=/([clmz]),?([^clmz]*)/gi,xb=/ progid:\S+Blur\([^\)]+\)/g,yb=/-?[^,\s-]+/g,ea=1E3+E+1E3,fa={path:1,rect:1},zb=function(a){var b=/[ahqstv]/ig,c=ca;t(a).match(b)&&(c=ma);b=/[clmz]/g;if(c==ca&&!t(a).match(b))return a=t(a).replace(wb,function(a,b,c){var d=
[],e=Z.call(b)=="m",f=bb[b];c.replace(yb,function(a){e&&d[o]==2&&(f+=d+bb[b=="m"?"l":"L"],d=[]);d[z](J(a*10))});return f+d});for(var b=c(a),e,a=[],f=0,d=b[o];f<d;f++){c=b[f];e=Z.call(b[f][0]);e=="z"&&(e="x");for(var g=1,j=c[o];g<j;g++)e+=J(c[g]*10)+(g!=j-1?",":"");a[z](e)}return a[H](E)};k[U]=function(){return"Your browser doesn\u2019t support SVG. Falling down to VML.\nYou are running Rapha\u00ebl "+this.version};Va=function(a,b){var c=L("group");c.style.cssText="position:absolute;left:0;top:0;width:"+
b.width+"px;height:"+b.height+"px";c.coordsize=b.coordsize;c.coordorigin=b.coordorigin;var e=L("shape"),f=e.style;f.width=b.width+"px";f.height=b.height+"px";e.coordsize=ea;e.coordorigin=b.coordorigin;c.appendChild(e);e=new y(e,c,b);f={fill:"none",stroke:"#000"};a&&(f.path=a);e.type="path";e.path=[];e.Path="";Y(e,f);b.canvas.appendChild(c);return e};Y=function(a,b){a.attrs=a.attrs||{};var c=a.node,e=a.attrs,f=c.style,d;d=(b.x!=e.x||b.y!=e.y||b.width!=e.width||b.height!=e.height||b.r!=e.r)&&a.type==
"rect";for(var g in b)b[q](g)&&(e[g]=b[g]);if(d)e.path=cb(e.x,e.y,e.width,e.height,e.r),a.X=e.x,a.Y=e.y,a.W=e.width,a.H=e.height;b.href&&(c.href=b.href);b.title&&(c.title=b.title);b.target&&(c.target=b.target);b.cursor&&(f.cursor=b.cursor);"blur"in b&&a.blur(b.blur);if(b.path&&a.type=="path"||d)c.path=zb(e.path);b.rotation!=null&&a.rotate(b.rotation,!0);b.translation&&(d=t(b.translation).split(P),pa.call(a,d[0],d[1]),a._.rt.cx!=null&&(a._.rt.cx+=+d[0],a._.rt.cy+=+d[1],a.setBox(a.attrs,d[0],d[1])));
b.scale&&(d=t(b.scale).split(P),a.scale(+d[0]||1,+d[1]||+d[0]||1,+d[2]||null,+d[3]||null));if("clip-rect"in b){d=t(b["clip-rect"]).split(P);if(d[o]==4){d[2]=+d[2]+ +d[0];d[3]=+d[3]+ +d[1];g=c.clipRect||p.createElement("div");var j=g.style,h=c.parentNode;j.clip=k.format("rect({1}px {2}px {3}px {0}px)",d);if(!c.clipRect)j.position="absolute",j.top=0,j.left=0,j.width=a.paper.width+"px",j.height=a.paper.height+"px",h.parentNode.insertBefore(g,h),g.appendChild(h),c.clipRect=g}if(!b["clip-rect"])c.clipRect&&
(c.clipRect.style.clip="")}if(a.type=="image"&&b.src)c.src=b.src;if(a.type=="image"&&b.opacity)c.filterOpacity=" progid:DXImageTransform.Microsoft.Alpha(opacity="+b.opacity*100+")",f.filter=(c.filterMatrix||"")+(c.filterOpacity||"");b.font&&(f.font=b.font);b["font-family"]&&(f.fontFamily='"'+b["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,"")+'"');b["font-size"]&&(f.fontSize=b["font-size"]);b["font-weight"]&&(f.fontWeight=b["font-weight"]);b["font-style"]&&(f.fontStyle=b["font-style"]);if(b.opacity!=
null||b["stroke-width"]!=null||b.fill!=null||b.stroke!=null||b["stroke-width"]!=null||b["stroke-opacity"]!=null||b["fill-opacity"]!=null||b["stroke-dasharray"]!=null||b["stroke-miterlimit"]!=null||b["stroke-linejoin"]!=null||b["stroke-linecap"]!=null){c=a.shape||c;d=c.getElementsByTagName("fill")&&c.getElementsByTagName("fill")[0];g=!1;!d&&(g=d=L("fill"));if("fill-opacity"in b||"opacity"in b)f=((+e["fill-opacity"]+1||2)-1)*((+e.opacity+1||2)-1)*((+k.getRGB(b.fill).o+1||2)-1),f=T(M(f,0),1),d.opacity=
f;b.fill&&(d.on=!0);if(d.on==null||b.fill=="none")d.on=!1;if(d.on&&b.fill)if(f=b.fill.match(Ja))d.src=f[1],d.type="tile";else if(d.color=k.getRGB(b.fill).hex,d.src="",d.type="solid",k.getRGB(b.fill).error&&(a.type in{circle:1,ellipse:1}||t(b.fill).charAt()!="r")&&da(a,b.fill))e.fill="none",e.gradient=b.fill;g&&c.appendChild(d);d=c.getElementsByTagName("stroke")&&c.getElementsByTagName("stroke")[0];g=!1;!d&&(g=d=L("stroke"));if(b.stroke&&b.stroke!="none"||b["stroke-width"]||b["stroke-opacity"]!=null||
b["stroke-dasharray"]||b["stroke-miterlimit"]||b["stroke-linejoin"]||b["stroke-linecap"])d.on=!0;(b.stroke=="none"||d.on==null||b.stroke==0||b["stroke-width"]==0)&&(d.on=!1);f=k.getRGB(b.stroke);d.on&&b.stroke&&(d.color=f.hex);f=((+e["stroke-opacity"]+1||2)-1)*((+e.opacity+1||2)-1)*((+f.o+1||2)-1);j=(w(b["stroke-width"])||1)*0.75;f=T(M(f,0),1);b["stroke-width"]==null&&(j=e["stroke-width"]);b["stroke-width"]&&(d.weight=j);j&&j<1&&(f*=j)&&(d.weight=1);d.opacity=f;b["stroke-linejoin"]&&(d.joinstyle=
b["stroke-linejoin"]||"miter");d.miterlimit=b["stroke-miterlimit"]||8;b["stroke-linecap"]&&(d.endcap=b["stroke-linecap"]=="butt"?"flat":b["stroke-linecap"]=="square"?"square":"round");if(b["stroke-dasharray"])f={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"},d.dashstyle=f[q](b["stroke-dasharray"])?f[b["stroke-dasharray"]]:"";g&&c.appendChild(d)}if(a.type=="text")switch(f=
a.paper.span.style,e.font&&(f.font=e.font),e["font-family"]&&(f.fontFamily=e["font-family"]),e["font-size"]&&(f.fontSize=e["font-size"]),e["font-weight"]&&(f.fontWeight=e["font-weight"]),e["font-style"]&&(f.fontStyle=e["font-style"]),a.node.string&&(a.paper.span.innerHTML=t(a.node.string).replace(/</g,"<").replace(/&/g,"&").replace(/\n/g,"<br>")),a.W=e.w=a.paper.span.offsetWidth,a.H=e.h=a.paper.span.offsetHeight,a.X=e.x,a.Y=e.y+J(a.H/2),e["text-anchor"]){case "start":a.node.style["v-text-align"]=
"left";a.bbx=J(a.W/2);break;case "end":a.node.style["v-text-align"]="right";a.bbx=-J(a.W/2);break;default:a.node.style["v-text-align"]="center"}};da=function(a,b){a.attrs=a.attrs||{};var c,e="linear",f=".5 .5";a.attrs.gradient=b;b=t(b).replace(Ka,function(a,b,c){e="radial";b&&c&&(b=w(b),c=w(c),B(b-0.5,2)+B(c-0.5,2)>0.25&&(c=v.sqrt(0.25-B(b-0.5,2))*((c>0.5)*2-1)+0.5),f=b+E+c);return""});b=b.split(/\s*\-\s*/);if(e=="linear"){var d=b.shift(),d=-w(d);if(isNaN(d))return null}var g=Oa(b);if(!g)return null;
a=a.shape||a.node;c=a.getElementsByTagName("fill")[0]||L("fill");!c.parentNode&&a.appendChild(c);if(g[o]){c.on=!0;c.method="none";c.color=g[0].color;c.color2=g[g[o]-1].color;for(var j=[],h=0,i=g[o];h<i;h++)g[h].offset&&j[z](g[h].offset+E+g[h].color);c.colors&&(c.colors.value=j[o]?j[H]():"0% "+c.color);e=="radial"?(c.type="gradientradial",c.focus="100%",c.focussize=f,c.focusposition=f):(c.type="gradient",c.angle=(270-d)%360)}return 1};y=function(a,b,c){this[0]=a;this.id=k._oid++;this.node=a;a.raphael=
this;this.Y=this.X=0;this.attrs={};this.Group=b;this.paper=c;this._={tx:0,ty:0,rt:{deg:0},sx:1,sy:1};!c.bottom&&(c.bottom=this);(this.prev=c.top)&&(c.top.next=this);c.top=this;this.next=null};s=y[u];s.rotate=function(a,b,c){if(this.removed)return this;if(a==null){if(this._.rt.cx)return[this._.rt.deg,this._.rt.cx,this._.rt.cy][H](E);return this._.rt.deg}a=t(a).split(P);a[o]-1&&(b=w(a[1]),c=w(a[2]));a=w(a[0]);b!=null?this._.rt.deg=a:this._.rt.deg+=a;c==null&&(b=null);this._.rt.cx=b;this._.rt.cy=c;this.setBox(this.attrs,
b,c);this.Group.style.rotation=this._.rt.deg;return this};s.setBox=function(a,b,c){if(this.removed)return this;var e=this.Group.style,f=this.shape&&this.shape.style||this.node.style,a=a||{},d;for(d in a)a[q](d)&&(this.attrs[d]=a[d]);var b=b||this._.rt.cx,c=c||this._.rt.cy,g=this.attrs,j;switch(this.type){case "circle":a=g.cx-g.r;d=g.cy-g.r;j=g=g.r*2;break;case "ellipse":a=g.cx-g.rx;d=g.cy-g.ry;j=g.rx*2;g=g.ry*2;break;case "image":a=+g.x;d=+g.y;j=g.width||0;g=g.height||0;break;case "text":this.textpath.v=
["m",J(g.x),", ",J(g.y-2),"l",J(g.x)+1,", ",J(g.y-2)][H]("");a=g.x-J(this.W/2);d=g.y-this.H/2;j=this.W;g=this.H;break;case "rect":case "path":this.attrs.path?(g=na(this.attrs.path),a=g.x,d=g.y,j=g.width,g=g.height):(d=a=0,j=this.paper.width,g=this.paper.height);break;default:d=a=0,j=this.paper.width,g=this.paper.height}var b=(b==null?a+j/2:b)-this.paper.width/2,c=(c==null?d+g/2:c)-this.paper.height/2,h;e.left!=(h=b+"px")&&(e.left=h);e.top!=(h=c+"px")&&(e.top=h);this.X=fa[q](this.type)?-b:a;this.Y=
fa[q](this.type)?-c:d;this.W=j;this.H=g;fa[q](this.type)?(f.left!=(h=-b*10+"px")&&(f.left=h),f.top!=(h=-c*10+"px")&&(f.top=h)):this.type=="text"?(f.left!=(h=-b+"px")&&(f.left=h),f.top!=(h=-c+"px")&&(f.top=h)):(e.width!=(h=this.paper.width+"px")&&(e.width=h),e.height!=(h=this.paper.height+"px")&&(e.height=h),f.left!=(h=a-b+"px")&&(f.left=h),f.top!=(h=d-c+"px")&&(f.top=h),f.width!=(h=j+"px")&&(f.width=h),f.height!=(h=g+"px")&&(f.height=h))};s.hide=function(){!this.removed&&(this.Group.style.display=
"none");return this};s.show=function(){!this.removed&&(this.Group.style.display="block");return this};s.getBBox=function(){if(this.removed)return this;if(fa[q](this.type))return na(this.attrs.path);return{x:this.X+(this.bbx||0),y:this.Y,width:this.W,height:this.H}};s.remove=function(){if(!this.removed){aa(this,this.paper);this.node.parentNode.removeChild(this.node);this.Group.parentNode.removeChild(this.Group);this.shape&&this.shape.parentNode.removeChild(this.shape);for(var a in this)delete this[a];
this.removed=!0}};s.attr=function(a,b){if(this.removed)return this;if(a==null){var c={},e;for(e in this.attrs)this.attrs[q](e)&&(c[e]=this.attrs[e]);this._.rt.deg&&(c.rotation=this.rotate());(this._.sx!=1||this._.sy!=1)&&(c.scale=this.scale());c.gradient&&c.fill=="none"&&(c.fill=c.gradient)&&delete c.gradient;return c}if(b==null&&k.is(a,"string")){if(a=="translation")return pa.call(this);if(a=="rotation")return this.rotate();if(a=="scale")return this.scale();if(a=="fill"&&this.attrs.fill=="none"&&
this.attrs.gradient)return this.attrs.gradient;return this.attrs[a]}if(this.attrs&&b==null&&k.is(a,N)){var f={};e=0;for(c=a[o];e<c;e++)f[a[e]]=this.attr(a[e]);return f}b!=null&&(c={},c[a]=b);b==null&&k.is(a,"object")&&(c=a);if(c){for(f in this.paper.customAttributes)if(this.paper.customAttributes[q](f)&&c[q](f)&&k.is(this.paper.customAttributes[f],"function"))for(var d in e=this.paper.customAttributes[f].apply(this,[].concat(c[f])),this.attrs[f]=c[f],e)e[q](d)&&(c[d]=e[d]);if(c.text&&this.type=="text")this.node.string=
c.text;Y(this,c);c.gradient&&({circle:1,ellipse:1}[q](this.type)||t(c.gradient).charAt()!="r")&&da(this,c.gradient);(!fa[q](this.type)||this._.rt.deg)&&this.setBox(this.attrs)}return this};s.toFront=function(){!this.removed&&this.Group.parentNode.appendChild(this.Group);this.paper.top!=this&&Qa(this,this.paper);return this};s.toBack=function(){if(this.removed)return this;this.Group.parentNode.firstChild!=this.Group&&(this.Group.parentNode.insertBefore(this.Group,this.Group.parentNode.firstChild),
Ra(this,this.paper));return this};s.insertAfter=function(a){if(this.removed)return this;a.constructor==O&&(a=a[a.length-1]);a.Group.nextSibling?a.Group.parentNode.insertBefore(this.Group,a.Group.nextSibling):a.Group.parentNode.appendChild(this.Group);Sa(this,a,this.paper);return this};s.insertBefore=function(a){if(this.removed)return this;a.constructor==O&&(a=a[0]);a.Group.parentNode.insertBefore(this.Group,a.Group);Ta(this,a,this.paper);return this};s.blur=function(a){var b=this.node.runtimeStyle,
c=b.filter,c=c.replace(xb,"");+a!==0?(this.attrs.blur=a,b.filter=c+E+" progid:DXImageTransform.Microsoft.Blur(pixelradius="+(+a||1.5)+")",b.margin=k.format("-{0}px 0 0 -{0}px",J(+a||1.5))):(b.filter=c,b.margin=0,delete this.attrs.blur)};var Wa=function(a,b,c,e){var f=L("group"),d=L("oval");f.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px";f.coordsize=ea;f.coordorigin=a.coordorigin;f.appendChild(d);d=new y(d,f,a);d.type="circle";Y(d,{stroke:"#000",fill:"none"});
d.attrs.cx=b;d.attrs.cy=c;d.attrs.r=e;d.setBox({x:b-e,y:c-e,width:e*2,height:e*2});a.canvas.appendChild(f);return d},cb=function(a,b,c,e,f){return f?k.format("M{0},{1}l{2},0a{3},{3},0,0,1,{3},{3}l0,{5}a{3},{3},0,0,1,{4},{3}l{6},0a{3},{3},0,0,1,{4},{4}l0,{7}a{3},{3},0,0,1,{3},{4}z",a+f,b,c-f*2,f,-f,e-f*2,f*2-c,f*2-e):k.format("M{0},{1}l{2},0,0,{3},{4},0z",a,b,c,e,-c)},Xa=function(a,b,c,e,f,d){var g=cb(b,c,e,f,d),a=a.path(g),j=a.attrs;a.X=j.x=b;a.Y=j.y=c;a.W=j.width=e;a.H=j.height=f;j.r=d;j.path=g;
a.type="rect";return a},Ya=function(a,b,c,e,f){var d=L("group"),g=L("oval");d.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px";d.coordsize=ea;d.coordorigin=a.coordorigin;d.appendChild(g);g=new y(g,d,a);g.type="ellipse";Y(g,{stroke:"#000"});g.attrs.cx=b;g.attrs.cy=c;g.attrs.rx=e;g.attrs.ry=f;g.setBox({x:b-e,y:c-f,width:e*2,height:f*2});a.canvas.appendChild(d);return g},Za=function(a,b,c,e,f,d){var g=L("group"),j=L("image");g.style.cssText="position:absolute;left:0;top:0;width:"+
a.width+"px;height:"+a.height+"px";g.coordsize=ea;g.coordorigin=a.coordorigin;j.src=b;g.appendChild(j);j=new y(j,g,a);j.type="image";j.attrs.src=b;j.attrs.x=c;j.attrs.y=e;j.attrs.w=f;j.attrs.h=d;j.setBox({x:c,y:e,width:f,height:d});a.canvas.appendChild(g);return j},$a=function(a,b,c,e){var f=L("group"),d=L("shape"),g=d.style,j=L("path"),h=L("textpath");f.style.cssText="position:absolute;left:0;top:0;width:"+a.width+"px;height:"+a.height+"px";f.coordsize=ea;f.coordorigin=a.coordorigin;j.v=k.format("m{0},{1}l{2},{1}",
J(b*10),J(c*10),J(b*10)+1);j.textpathok=!0;g.width=a.width;g.height=a.height;h.string=t(e);h.on=!0;d.appendChild(h);d.appendChild(j);f.appendChild(d);g=new y(h,f,a);g.shape=d;g.textpath=j;g.type="text";g.attrs.text=e;g.attrs.x=b;g.attrs.y=c;g.attrs.w=1;g.attrs.h=1;Y(g,{font:ja.font,stroke:"none",fill:"#000"});g.setBox();a.canvas.appendChild(f);return g},ab=function(a,b){var c=this.canvas.style;a==+a&&(a+="px");b==+b&&(b+="px");c.width=a;c.height=b;c.clip="rect(0 "+a+" "+b+" 0)";return this},L;p.createStyleSheet().addRule(".rvml",
"behavior:url(#default#VML)");try{!p.namespaces.rvml&&p.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),L=function(a){return p.createElement("<rvml:"+a+' class="rvml">')}}catch(Gb){L=function(a){return p.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}sa=function(){var a=Pa[D](0,arguments),b=a.container,c=a.height,e=a.width,f=a.x,a=a.y;if(!b)throw Error("VML container not found.");var d=new ha,g=d.canvas=p.createElement("div"),j=g.style,f=f||0,a=a||0,e=e||512,c=
c||342;e==+e&&(e+="px");c==+c&&(c+="px");d.width=1E3;d.height=1E3;d.coordsize=1E4+E+1E4;d.coordorigin="0 0";d.span=p.createElement("span");d.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;";g.appendChild(d.span);j.cssText=k.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",e,c);b==1?(p.body.appendChild(g),j.left=f+"px",j.top=a+"px",j.position="absolute"):b.firstChild?
b.insertBefore(g,b.firstChild):b.appendChild(g);za.call(d,d,k.fn);return d};C.clear=function(){this.canvas.innerHTML="";this.span=p.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.remove=function(){this.canvas.parentNode.removeChild(this.canvas);for(var a in this)this[a]=Ua(a);return!0}}Q=navigator.userAgent.match(/Version\/(.*?)\s/);C.safari=
navigator.vendor=="Apple Computer, Inc."&&(Q&&Q[1]<4||navigator.platform.slice(0,2)=="iP")?function(){var a=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});X.setTimeout(function(){a.remove()})}:function(){};for(var Ab=function(){this.returnValue=!1},Bb=function(){return this.originalEvent.preventDefault()},Cb=function(){this.cancelBubble=!0},Db=function(){return this.originalEvent.stopPropagation()},Eb=function(){if(p.addEventListener)return function(a,b,c,e){var f=ua&&va[b]?
va[b]:b,d=function(d){if(ua&&va[q](b))for(var f=0,h=d.targetTouches&&d.targetTouches.length;f<h;f++)if(d.targetTouches[f].target==a){h=d;d=d.targetTouches[f];d.originalEvent=h;d.preventDefault=Bb;d.stopPropagation=Db;break}return c.call(e,d)};a.addEventListener(f,d,!1);return function(){a.removeEventListener(f,d,!1);return!0}};else if(p.attachEvent)return function(a,b,c,e){var f=function(a){a=a||X.event;a.preventDefault=a.preventDefault||Ab;a.stopPropagation=a.stopPropagation||Cb;return c.call(e,
a)};a.attachEvent("on"+b,f);return function(){a.detachEvent("on"+b,f);return!0}}}(),R=[],Ba=function(a){for(var b=a.clientX,c=a.clientY,e=p.documentElement.scrollTop||p.body.scrollTop,f=p.documentElement.scrollLeft||p.body.scrollLeft,d,g=R.length;g--;){d=R[g];if(ua)for(var j=a.touches.length,h;j--;){if(h=a.touches[j],h.identifier==d.el._drag.id){b=h.clientX;c=h.clientY;(a.originalEvent?a.originalEvent:a).preventDefault();break}}else a.preventDefault();b+=f;c+=e;d.move&&d.move.call(d.move_scope||d.el,
b-d.el._drag.x,c-d.el._drag.y,b,c,a)}},Ca=function(a){k.unmousemove(Ba).unmouseup(Ca);for(var b=R.length,c;b--;)c=R[b],c.el._drag={},c.end&&c.end.call(c.end_scope||c.start_scope||c.move_scope||c.el,a);R=[]},Q=$[o];Q--;)(function(a){k[a]=y[u][a]=function(b,c){if(k.is(b,"function"))this.events=this.events||[],this.events.push({name:a,f:b,unbind:Eb(this.shape||this.node||p,a,b,c||this)});return this};k["un"+a]=y[u]["un"+a]=function(b){for(var c=this.events,e=c[o];e--;)if(c[e].name==a&&c[e].f==b){c[e].unbind();
c.splice(e,1);!c.length&&delete this.events;break}return this}})($[Q]);s.hover=function(a,b,c,e){return this.mouseover(a,c).mouseout(b,e||c)};s.unhover=function(a,b){return this.unmouseover(a).unmouseout(b)};s.drag=function(a,b,c,e,f,d){this._drag={};this.mousedown(function(g){(g.originalEvent||g).preventDefault();var j=p.documentElement.scrollTop||p.body.scrollTop,h=p.documentElement.scrollLeft||p.body.scrollLeft;this._drag.x=g.clientX+h;this._drag.y=g.clientY+j;this._drag.id=g.identifier;b&&b.call(f||
e||this,g.clientX+h,g.clientY+j,g);!R.length&&k.mousemove(Ba).mouseup(Ca);R.push({el:this,move:a,end:c,move_scope:e,start_scope:f,end_scope:d})});return this};s.undrag=function(a,b,c){for(b=R.length;b--;)R[b].el==this&&R[b].move==a&&R[b].end==c&&R.splice(b++,1);!R.length&&k.unmousemove(Ba).unmouseup(Ca)};C.circle=function(a,b,c){return Wa(this,a||0,b||0,c||0)};C.rect=function(a,b,c,e,f){return Xa(this,a||0,b||0,c||0,e||0,f||0)};C.ellipse=function(a,b,c,e){return Ya(this,a||0,b||0,c||0,e||0)};C.path=
function(a){a&&!k.is(a,"string")&&!k.is(a[0],N)&&(a+="");return Va(k.format[D](k,arguments),this)};C.image=function(a,b,c,e,f){return Za(this,a||"about:blank",b||0,c||0,e||0,f||0)};C.text=function(a,b,c){return $a(this,a||0,b||0,t(c))};C.set=function(a){arguments[o]>1&&(a=Array[u].splice.call(arguments,0,arguments[o]));return new O(a)};C.setSize=ab;C.top=C.bottom=null;C.raphael=k;s.resetScale=function(){if(this.removed)return this;this._.sx=1;this._.sy=1;this.attrs.scale="1 1"};s.scale=function(a,
b,c,e){if(this.removed)return this;if(a==null&&b==null)return{x:this._.sx,y:this._.sy,toString:Ha};b=b||a;!+b&&(b=a);var f,d,g=this.attrs;if(a!=0){var j=this.getBBox(),h=j.x+j.width/2,i=j.y+j.height/2;f=F(a/this._.sx);d=F(b/this._.sy);var c=+c||c==0?c:h,e=+e||e==0?e:i,k=this._.sx>0,A=this._.sy>0,j=~~(a/F(a)),n=~~(b/F(b)),r=f*j,m=d*n,q=this.node.style,h=c+F(h-c)*r*(h>c==k?1:-1),i=e+F(i-e)*m*(i>e==A?1:-1),p=a*j>b*n?d:f;switch(this.type){case "rect":case "image":var x=g.width*f,w=g.height*d;this.attr({height:w,
r:g.r*p,width:x,x:h-x/2,y:i-w/2});break;case "circle":case "ellipse":this.attr({rx:g.rx*f,ry:g.ry*d,r:g.r*p,cx:h,cy:i});break;case "text":this.attr({x:h,y:i});break;case "path":for(var p=ya(g.path),v=!0,k=k?r:f,A=A?m:d,m=0,r=p[o];m<r;m++){var t=p[m],s=ia.call(t[0]);if(!(s=="M"&&v))if(v=!1,s=="A")t[p[m][o]-2]*=k,t[p[m][o]-1]*=A,t[1]*=f,t[2]*=d,t[5]=+(j+n?!!+t[5]:!+t[5]);else if(s=="H")for(var s=1,u=t[o];s<u;s++)t[s]*=k;else if(s=="V"){s=1;for(u=t[o];s<u;s++)t[s]*=A}else{s=1;for(u=t[o];s<u;s++)t[s]*=
s%2?k:A}}d=na(p);f=h-d.x-d.width/2;d=i-d.y-d.height/2;p[0][1]+=f;p[0][2]+=d;this.attr({path:p})}this.type in{text:1,image:1}&&(j!=1||n!=1)?this.transformations?(this.transformations[2]="scale(".concat(j,",",n,")"),this.node.setAttribute("transform",this.transformations[H](E)),f=j==-1?-g.x-(x||0):g.x,d=n==-1?-g.y-(w||0):g.y,this.attr({x:f,y:d}),g.fx=j-1,g.fy=n-1):(this.node.filterMatrix=" progid:DXImageTransform.Microsoft"+".Matrix(M11=".concat(j,", M12=0, M21=0, M22=",n,", Dx=0, Dy=0, sizingmethod='auto expand', filtertype='bilinear')"),
q.filter=(this.node.filterMatrix||"")+(this.node.filterOpacity||"")):this.transformations?(this.transformations[2]="",this.node.setAttribute("transform",this.transformations[H](E)),g.fx=0,g.fy=0):(this.node.filterMatrix="",q.filter=(this.node.filterMatrix||"")+(this.node.filterOpacity||""));g.scale=[a,b,c,e][H](E);this._.sx=a;this._.sy=b}return this};s.clone=function(){if(this.removed)return null;var a=this.attr();delete a.scale;delete a.translation;return this.paper[this.type]().attr(a)};var Da=
{},qa=function(a,b,c,e,f,d,g,j,h){var i=0,l=100,o=[a,b,c,e,f,d,g,j].join(),n=Da[o],m,q;!n&&(Da[o]=n={data:[]});n.timer&&clearTimeout(n.timer);n.timer=setTimeout(function(){delete Da[o]},2E3);h!=null&&(l=~~qa(a,b,c,e,f,d,g,j)*10);for(var p=0;p<l+1;p++){n.data[h]>p?q=n.data[p*l]:(q=k.findDotsAtSegment(a,b,c,e,f,d,g,j,p/l),n.data[p]=q);p&&(i+=B(B(m.x-q.x,2)+B(m.y-q.y,2),0.5));if(h!=null&&i>=h)return q;m=q}if(h==null)return i},$=function(a,b){return function(c,e,f){for(var c=ma(c),d,g,j,h,i="",l={},o=
0,n=0,m=c.length;n<m;n++){j=c[n];if(j[0]=="M")d=+j[1],g=+j[2];else{h=qa(d,g,j[1],j[2],j[3],j[4],j[5],j[6]);if(o+h>e){if(b&&!l.start){d=qa(d,g,j[1],j[2],j[3],j[4],j[5],j[6],e-o);i+=["C",d.start.x,d.start.y,d.m.x,d.m.y,d.x,d.y];if(f)return i;l.start=i;i=["M",d.x,d.y+"C",d.n.x,d.n.y,d.end.x,d.end.y,j[5],j[6]][H]();o+=h;d=+j[5];g=+j[6];continue}if(!a&&!b)return d=qa(d,g,j[1],j[2],j[3],j[4],j[5],j[6],e-o),{x:d.x,y:d.y,alpha:d.alpha}}o+=h;d=+j[5];g=+j[6]}i+=j}l.end=i;d=a?o:b?l:k.findDotsAtSegment(d,g,j[1],
j[2],j[3],j[4],j[5],j[6],1);d.alpha&&(d={x:d.x,y:d.y,alpha:d.alpha});return d}},db=$(1),ra=$(),Ea=$(0,1);s.getTotalLength=function(){if(this.type=="path"){if(this.node.getTotalLength)return this.node.getTotalLength();return db(this.attrs.path)}};s.getPointAtLength=function(a){if(this.type=="path")return ra(this.attrs.path,a)};s.getSubpath=function(a,b){if(this.type=="path"){if(F(this.getTotalLength()-b)<"1e-6")return Ea(this.attrs.path,a).end;var c=Ea(this.attrs.path,b,1);return a?Ea(c,a).end:c}};
k.easing_formulas={linear:function(a){return a},"<":function(a){return B(a,3)},">":function(a){return B(a-1,3)+1},"<>":function(a){a*=2;if(a<1)return B(a,3)/2;a-=2;return(B(a,3)+2)/2},backIn:function(a){return a*a*(2.70158*a-1.70158)},backOut:function(a){a-=1;return a*a*(2.70158*a+1.70158)+1},elastic:function(a){if(a==0||a==1)return a;return B(2,-10*a)*v.sin((a-0.075)*2*K/0.3)+1},bounce:function(a){a<1/2.75?a*=7.5625*a:a<2/2.75?(a-=1.5/2.75,a=7.5625*a*a+0.75):a<2.5/2.75?(a-=2.25/2.75,a=7.5625*a*a+
0.9375):(a-=2.625/2.75,a=7.5625*a*a+0.984375);return a}};var S=[],eb=function(){for(var a=+new Date,b=0;b<S[o];b++){var c=S[b];if(!c.stop&&!c.el.removed){var e=a-c.start,f=c.ms,d=c.easing,g=c.from,j=c.diff,h=c.to,i=c.t,l=c.el,c={},m;if(e<f){var e=d(e/f),n;for(n in g)if(g[q](n)){switch(wa[n]){case "along":m=e*f*j[n];h.back&&(m=h.len-m);d=ra(h[n],m);l.translate(j.sx-j.x||0,j.sy-j.y||0);j.x=d.x;j.y=d.y;l.translate(d.x-j.sx,d.y-j.sy);h.rot&&l.rotate(j.r+d.alpha,d.x,d.y);break;case G:m=+g[n]+e*f*j[n];
break;case "colour":m="rgb("+[Fa(J(g[n].r+e*f*j[n].r)),Fa(J(g[n].g+e*f*j[n].g)),Fa(J(g[n].b+e*f*j[n].b))][H](",")+")";break;case "path":m=[];for(var d=0,r=g[n][o];d<r;d++){m[d]=[g[n][d][0]];for(var p=1,s=g[n][d][o];p<s;p++)m[d][p]=+g[n][d][p]+e*f*j[n][d][p];m[d]=m[d][H](E)}m=m[H](E);break;case "csv":switch(n){case "translation":m=e*f*j[n][0]-i.x;d=e*f*j[n][1]-i.y;i.x+=m;i.y+=d;m=m+E+d;break;case "rotation":m=+g[n][0]+e*f*j[n][0];g[n][1]&&(m+=","+g[n][1]+","+g[n][2]);break;case "scale":m=[+g[n][0]+
e*f*j[n][0],+g[n][1]+e*f*j[n][1],2 in h[n]?h[n][2]:"",3 in h[n]?h[n][3]:""][H](E);break;case "clip-rect":m=[];for(d=4;d--;)m[d]=+g[n][d]+e*f*j[n][d]}break;default:r=[].concat(g[n]);m=[];for(d=l.paper.customAttributes[n].length;d--;)m[d]=+r[d]+e*f*j[n][d]}c[n]=m}l.attr(c);l._run&&l._run.call(l)}else h.along&&(d=ra(h.along,h.len*!h.back),l.translate(j.sx-(j.x||0)+d.x-j.sx,j.sy-(j.y||0)+d.y-j.sy),h.rot&&l.rotate(j.r+d.alpha,d.x,d.y)),(i.x||i.y)&&l.translate(-i.x,-i.y),h.scale&&(h.scale+=""),l.attr(h),
S.splice(b--,1)}}k.svg&&l&&l.paper&&l.paper.safari();S[o]&&setTimeout(eb)},Fb=function(a,b,c,e,f){var d=c-e;b.timeouts.push(setTimeout(function(){k.is(f,"function")&&f.call(b);b.animate(a,d,a.easing)},e))},Fa=function(a){return M(T(a,255),0)},pa=function(a,b){if(a==null)return{x:this._.tx,y:this._.ty,toString:Ha};this._.tx+=+a;this._.ty+=+b;switch(this.type){case "circle":case "ellipse":this.attr({cx:+a+this.attrs.cx,cy:+b+this.attrs.cy});break;case "rect":case "image":case "text":this.attr({x:+a+
this.attrs.x,y:+b+this.attrs.y});break;case "path":var c=ya(this.attrs.path);c[0][1]+=+a;c[0][2]+=+b;this.attr({path:c})}return this};s.animateWith=function(a,b,c,e,f){for(var d=0,g=S.length;d<g;d++)if(S[d].el.id==a.id)b.start=S[d].start;return this.animate(b,c,e,f)};s.animateAlong=Ia();s.animateAlongBack=Ia(1);s.onAnimation=function(a){this._run=a||0;return this};s.animate=function(a,b,c,e){var f=this;f.timeouts=f.timeouts||[];if(k.is(c,"function")||!c)e=c||null;if(f.removed)return e&&e.call(f),
f;var d={},g={},j=!1,h={},i;for(i in a)if(a[q](i)&&(wa[q](i)||f.paper.customAttributes[q](i)))switch(j=!0,d[i]=f.attr(i),d[i]==null&&(d[i]=ja[i]),g[i]=a[i],wa[i]){case "along":var l=db(a[i]),m=ra(a[i],l*!!a.back),n=f.getBBox();h[i]=l/b;h.tx=n.x;h.ty=n.y;h.sx=m.x;h.sy=m.y;g.rot=a.rot;g.back=a.back;g.len=l;a.rot&&(h.r=w(f.rotate())||0);break;case G:h[i]=(g[i]-d[i])/b;break;case "colour":d[i]=k.getRGB(d[i]);l=k.getRGB(g[i]);h[i]={r:(l.r-d[i].r)/b,g:(l.g-d[i].g)/b,b:(l.b-d[i].b)/b};break;case "path":l=
ma(d[i],g[i]);d[i]=l[0];n=l[1];h[i]=[];l=0;for(m=d[i][o];l<m;l++){h[i][l]=[0];for(var p=1,s=d[i][l][o];p<s;p++)h[i][l][p]=(n[l][p]-d[i][l][p])/b}break;case "csv":m=t(a[i]).split(P);n=t(d[i]).split(P);switch(i){case "translation":d[i]=[0,0];h[i]=[m[0]/b,m[1]/b];break;case "rotation":d[i]=n[1]==m[1]&&n[2]==m[2]?n:[0,m[1],m[2]];h[i]=[(m[0]-d[i][0])/b,0,0];break;case "scale":a[i]=m;d[i]=t(d[i]).split(P);h[i]=[(m[0]-d[i][0])/b,(m[1]-d[i][1])/b,0,0];break;case "clip-rect":d[i]=t(d[i]).split(P);h[i]=[];
for(l=4;l--;)h[i][l]=(m[l]-d[i][l])/b}g[i]=m;break;default:m=[].concat(a[i]);n=[].concat(d[i]);h[i]=[];for(l=f.paper.customAttributes[i][o];l--;)h[i][l]=((m[l]||0)-(n[l]||0))/b}if(j){i=k.easing_formulas[c];if(!i)if((i=t(c).match(lb))&&i[o]==5){var u=i;i=function(a){return gb(a,+u[1],+u[2],+u[3],+u[4],b)}}else i=function(a){return a};S.push({start:a.start||+new Date,ms:b,easing:i,from:d,diff:h,to:g,el:f,t:{x:0,y:0}});k.is(e,"function")&&(f._ac=setTimeout(function(){e.call(f)},b));S[o]==1&&setTimeout(eb)}else{var c=
[],v,x;for(x in a)if(a[q](x)&&mb.test(x))i={value:a[x]},x=="from"&&(x=0),x=="to"&&(x=100),i.key=W(x,10),c.push(i);c.sort(rb);c[0].key&&c.unshift({key:0,value:f.attrs});l=0;for(m=c[o];l<m;l++)Fb(c[l].value,f,b/100*c[l].key,b/100*(c[l-1]&&c[l-1].key||0),c[l-1]&&c[l-1].value.callback);(v=c[c[o]-1].value.callback)&&f.timeouts.push(setTimeout(function(){v.call(f)},b))}return this};s.stop=function(){for(var a=0;a<S.length;a++)S[a].el.id==this.id&&S.splice(a--,1);a=0;for(ii=this.timeouts&&this.timeouts.length;a<
ii;a++)clearTimeout(this.timeouts[a]);this.timeouts=[];clearTimeout(this._ac);delete this._ac;return this};s.translate=function(a,b){return this.attr({translation:a+" "+b})};s[U]=function(){return"Rapha\u00ebl\u2019s object"};k.ae=S;var O=function(a){this.items=[];this[o]=0;this.type="set";if(a)for(var b=0,c=a[o];b<c;b++)if(a[b]&&(a[b].constructor==y||a[b].constructor==O))this[this.items[o]]=this.items[this.items[o]]=a[b],this[o]++};O[u][z]=function(){for(var a,b,c=0,e=arguments[o];c<e;c++)if((a=
arguments[c])&&(a.constructor==y||a.constructor==O))b=this.items[o],this[b]=this.items[b]=a,this[o]++;return this};O[u].pop=function(){delete this[this[o]--];return this.items.pop()};for(var Ga in s)s[q](Ga)&&(O[u][Ga]=function(a){return function(){for(var b=0,c=this.items[o];b<c;b++)this.items[b][a][D](this.items[b],arguments);return this}}(Ga));O[u].attr=function(a,b){if(a&&k.is(a,N)&&k.is(a[0],"object"))for(var c=0,e=a[o];c<e;c++)this.items[c].attr(a[c]);else{c=0;for(e=this.items[o];c<e;c++)this.items[c].attr(a,
b)}return this};O[u].animate=function(a,b,c,e){(k.is(c,"function")||!c)&&(e=c||null);var f=this.items[o],d=f,g,j=this,h;e&&(h=function(){!--f&&e.call(j)});c=k.is(c,"string")?c:h;for(g=this.items[--d].animate(a,b,c,h);d--;)this.items[d]&&!this.items[d].removed&&this.items[d].animateWith(g,a,b,c,h);return this};O[u].insertAfter=function(a){for(var b=this.items[o];b--;)this.items[b].insertAfter(a);return this};O[u].getBBox=function(){for(var a=[],b=[],c=[],e=[],f=this.items[o];f--;){var d=this.items[f].getBBox();
a[z](d.x);b[z](d.y);c[z](d.x+d.width);e[z](d.y+d.height)}a=T[D](0,a);b=T[D](0,b);return{x:a,y:b,width:M[D](0,c)-a,height:M[D](0,e)-b}};O[u].clone=function(a){for(var a=new O,b=0,c=this.items[o];b<c;b++)a[z](this.items[b].clone());return a};k.registerFont=function(a){if(!a.face)return a;this.fonts=this.fonts||{};var b={w:a.w,face:{},glyphs:{}},c=a.face["font-family"],e;for(e in a.face)a.face[q](e)&&(b.face[e]=a.face[e]);if(this.fonts[c])this.fonts[c][z](b);else this.fonts[c]=[b];if(!a.svg)for(var f in b.face["units-per-em"]=
W(a.face["units-per-em"],10),a.glyphs)if(a.glyphs[q](f)&&(c=a.glyphs[f],b.glyphs[f]={w:c.w,k:{},d:c.d&&"M"+c.d.replace(/[mlcxtrv]/g,function(a){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[a]||"M"})+"z"},c.k))for(var d in c.k)c[q](d)&&(b.glyphs[f].k[d]=c.k[d]);return a};C.getFont=function(a,b,c,e){e=e||"normal";c=c||"normal";b=+b||{normal:400,bold:700,lighter:300,bolder:800}[b]||400;if(k.fonts){var f=k.fonts[a];if(!f){var a=RegExp("(^|\\s)"+a.replace(/[^\w\d\s+!~.:_-]/g,"")+"(\\s|$)","i"),d;for(d in k.fonts)if(k.fonts[q](d)&&
a.test(d)){f=k.fonts[d];break}}var g;if(f){d=0;for(a=f[o];d<a;d++)if(g=f[d],g.face["font-weight"]==b&&(g.face["font-style"]==c||!g.face["font-style"])&&g.face["font-stretch"]==e)break}return g}};C.print=function(a,b,c,e,f,d,g){var d=d||"middle",g=M(T(g||0,1),-1),j=this.set(),h=t(c).split(""),i=0;k.is(e,c)&&(e=this.getFont(e));if(e){for(var c=(f||16)/e.face["units-per-em"],l=e.face.bbox.split(P),f=+l[0],d=+l[1]+(d=="baseline"?l[3]-l[1]+ +e.face.descent:(l[3]-l[1])/2),l=0,m=h[o];l<m;l++){var n=l&&e.glyphs[h[l-
1]]||{},p=e.glyphs[h[l]];i+=l?(n.w||e.w)+(n.k&&n.k[h[l]]||0)+e.w*g:0;p&&p.d&&j[z](this.path(p.d).attr({fill:"#000",stroke:"none",translation:[i,0]}))}j.scale(c,c,f,d).translate(a-f,b-d)}return j};k.format=function(a,b){var c=k.is(b,N)?[0].concat(b):arguments;a&&k.is(a,"string")&&c[o]-1&&(a=a.replace(hb,function(a,b){return c[++b]==null?"":c[b]}));return a||""};k.ninja=function(){ta.was?X.Raphael=ta.is:delete Raphael;return k};k.el=s;k.st=O[u];ta.was?X.Raphael=k:Raphael=k})();