!function t(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.raphael=r():e.raphael=r()}(this,function(){return function(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){var i,n;i=[r(1),r(3),r(4)],n=function(t){return t}.apply(e,i),!(void 0!==n&&(t.exports=n))},function(t,e,r){var i,n;i=[r(2)],n=function(t){function e(r){if(e.is(r,"function"))return w?r():t.on("raphael.domload",r);if(e.is(r,q))return e._engine.create[z](e,r.splice(0,3+e.is(r[0],$))).add(r);var i=array.prototype.slice.call(arguments,0);if(e.is(i[i.length-1],"function")){var n=i.pop();return w?n.call(e._engine.create[z](e,i)):t.on("raphael.domload",function(){n.call(e._engine.create[z](e,i))})}return e._engine.create[z](e,arguments)}function r(t){if("function"==typeof t||object(t)!==t)return t;var e=new t.constructor;for(var i in t)t[a](i)&&(e[i]=r(t[i]));return e}function i(t,e){for(var r=0,i=t.length;r=1e3&&delete o[l.shift()],l.push(s),o[s]=t[z](e,a),r?r(o[s]):o[s])}return n}function a(){return this.hex}function s(t,e){for(var r=[],i=0,n=t.length;n-2*!e>i;i+=2){var a=[{x:+t[i-2],y:+t[i-1]},{x:+t[i],y:+t[i+1]},{x:+t[i+2],y:+t[i+3]},{x:+t[i+4],y:+t[i+5]}];e?i?n-4==i?a[3]={x:+t[0],y:+t[1]}:n-2==i&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[n-2],y:+t[n-1]}:n-4==i?a[3]=a[2]:i||(a[0]={x:+t[i],y:+t[i+1]}),r.push(["c",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return r}function o(t,e,r,i,n){var a=-3*e+9*r-9*i+3*n,s=t*a+6*e-12*r+6*i;return t*s-3*e+3*r}function l(t,e,r,i,n,a,s,l,h){null==h&&(h=1),h=h>1?1:h<0?0:h;for(var u=h/2,c=12,f=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],p=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,g=0;gd;)c/=2,f+=(pw(n,s)||w(e,i)w(a,o))){var l=(t*i-e*r)*(n-s)-(t-r)*(n*o-a*s),h=(t*i-e*r)*(a-o)-(e-i)*(n*o-a*s),u=(t-r)*(a-o)-(e-i)*(n-s);if(u){var c=l/u,f=h/u,p=+c.tofixed(2),d=+f.tofixed(2);if(!(p<+g(t,r).tofixed(2)||p>+w(t,r).tofixed(2)||p<+g(n,s).tofixed(2)||p>+w(n,s).tofixed(2)||d<+g(e,i).tofixed(2)||d>+w(e,i).tofixed(2)||d<+g(a,o).tofixed(2)||d>+w(a,o).tofixed(2)))return{x:c,y:f}}}}function c(t,e){return p(t,e)}function f(t,e){return p(t,e,1)}function p(t,r,i){var n=e.bezierbbox(t),a=e.bezierbbox(r);if(!e.isbboxintersect(n,a))return i?0:[];for(var s=l.apply(0,t),o=l.apply(0,r),h=w(~~(s/5),1),c=w(~~(o/5),1),f=[],p=[],d={},g=i?0:[],v=0;v=0&&s<=1.001&&a>=0&&a<=1.001&&(i?g++:g.push({x:c.x,y:c.y,t1:g(s,1),t2:g(a,1)}))}}return g}function d(t,r,i){t=e._path2curve(t),r=e._path2curve(r);for(var n,a,s,o,l,h,u,c,f,d,g=i?0:[],v=0,x=t.length;vi)return i;for(;ra?r=n:i=n,n=(i-r)/2+r}return n}var h=3*e,u=3*(i-e)-h,c=1-h-u,f=3*r,p=3*(n-r)-f,d=1-f-p;return o(t,1/(200*a))}function m(t,e){var r=[],i={};if(this.ms=e,this.times=1,t){for(var n in t)t[a](n)&&(i[ht(n)]=t[n],r.push(ht(n)));r.sort(bt)}this.anim=i,this.top=r[r.length-1],this.percents=r}function b(r,i,n,a,s,o){n=ht(n);var l,h,u,c=[],f,p,d,v=r.ms,x={},m={},b={};if(a)for(w=0,b=ee.length;wa*r.top){n=r.percents[w],p=r.percents[w-1]||0,v=v/r.top*(n-p),f=r.percents[w+1],l=r.anim[n];break}a&&i.attr(r.anim[r.percents[w]])}if(l){if(h)h.initstatus=a,h.start=new date-h.ms*a;else{for(var c in l)if(l[a](c)&&(pt[a](c)||i.paper.customattributes[a](c)))switch(x[c]=i.attr(c),null==x[c]&&(x[c]=ft[c]),m[c]=l[c],pt[c]){case $:b[c]=(m[c]-x[c])/v;break;case"colour":x[c]=e.getrgb(x[c]);var s=e.getrgb(m[c]);b[c]={r:(s.r-x[c].r)/v,g:(s.g-x[c].g)/v,b:(s.b-x[c].b)/v};break;case"path":var t=qt(x[c],m[c]),e=t[1];for(x[c]=t[0],b[c]=[],w=0,b=x[c].length;w',lt=nt.firstchild,lt.style.behavior="url(#default#vml)",!lt||"object"!=typeof lt.adj)return e.type=r;nt=null}e.svg=!(e.vml="vml"==e.type),e._paper=m,e.fn=n=m.prototype=e.prototype,e._id=0,e.is=function(t,e){return e=o.call(e),"finite"==e?!at[a](+t):"array"==e?t instanceof array:"null"==e&&null===t||e==typeof t&&null!==t||"object"==e&&t===object(t)||"array"==e&&array.isarray&&array.isarray(t)||tt.call(t).slice(8,-1).tolowercase()==e},e.angle=function(t,r,i,n,a,s){if(null==a){var o=t-i,l=r-n;return o||l?(180+180*y.atan2(-l,-o)/u+360)%360:0}return e.angle(t,r,a,s)-e.angle(i,n,a,s)},e.rad=function(t){return t%360*u/180},e.deg=function(t){return math.round(180*t/u%360*1e3)/1e3},e.snapto=function(t,r,i){if(i=e.is(i,"finite")?i:10,e.is(t,q)){for(var n=t.length;n--;)if(h(t[n]-r)<=i)return t[n]}else{t=+t;var a=r%t;if(at-i)return r-a+t}return r};var zt=e.createuuid=function(t,e){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(t,e).touppercase()}}(/[xy]/g,function(t){var e=16*y.random()|0,r="x"==t?e:3&e|8;return r.tostring(16)});e.setwindow=function(r){t("raphael.setwindow",e,t.win,r),t.win=r,t.doc=t.win.document,e._engine.initwin&&e._engine.initwin(t.win)};var pt=function(t){if(e.vml){var r=/^\s+|\s+$/g,i;try{var a=new activexobject("htmlfile");a.write(""),a.close(),i=a.body}catch(s){i=createpopup().document.body}var o=i.createtextrange();pt=n(function(t){try{i.style.color=i(t).replace(r,r);var e=o.querycommandvalue("forecolor");return e=(255&e)<<16|65280&e|(16711680&e)>>>16,"#"+("000000"+e.tostring(16)).slice(-6)}catch(n){return"none"}})}else{var l=t.doc.createelement("i");l.title="raphaël colour picker",l.style.display="none",t.doc.body.appendchild(l),pt=n(function(t){return l.style.color=t,t.doc.defaultview.getcomputedstyle(l,r).getpropertyvalue("color")})}return pt(t)},ft=function(){return"hsb("+[this.h,this.s,this.b]+")"},rt=function(){return"hsl("+[this.h,this.s,this.l]+")"},jt=function(){return this.hex},it=function(t,r,i){if(null==r&&e.is(t,"object")&&"r"in t&&"g"in t&&"b"in t&&(i=t.b,r=t.g,t=t.r),null==r&&e.is(t,z)){var n=e.getrgb(t);t=n.r,r=n.g,i=n.b}return(t>1||r>1||i>1)&&(t/=255,r/=255,i/=255),[t,r,i]},qt=function(t,r,i,n){t*=255,r*=255,i*=255;var a={r:t,g:r,b:i,hex:e.rgb(t,r,i),tostring:jt};return e.is(n,"finite")&&(a.opacity=n),a};e.color=function(t){var r;return e.is(t,"object")&&"h"in t&&"s"in t&&"b"in t?(r=e.hsb2rgb(t),t.r=r.r,t.g=r.g,t.b=r.b,t.hex=r.hex):e.is(t,"object")&&"h"in t&&"s"in t&&"l"in t?(r=e.hsl2rgb(t),t.r=r.r,t.g=r.g,t.b=r.b,t.hex=r.hex):(e.is(t,"string")&&(t=e.getrgb(t)),e.is(t,"object")&&"r"in t&&"g"in t&&"b"in t?(r=e.rgb2hsl(t),t.h=r.h,t.s=r.s,t.l=r.l,r=e.rgb2hsb(t),t.v=r.b):(t={hex:"none"},t.r=t.g=t.b=t.h=t.s=t.v=t.l=-1)),t.tostring=jt,t},e.hsb2rgb=function(t,e,r,i){this.is(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(r=t.b,e=t.s,i=t.o,t=t.h),t*=360;var n,a,s,o,l;return t=t%360/60,l=r*e,o=l*(1-h(t%2-1)),n=a=s=r-l,t=~~t,n+=[l,o,0,0,o,l][t],a+=[o,l,l,o,0,0][t],s+=[0,0,o,l,l,o][t],qt(n,a,s,i)},e.hsl2rgb=function(t,e,r,i){this.is(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(r=t.l,e=t.s,t=t.h),(t>1||e>1||r>1)&&(t/=360,e/=100,r/=100),t*=360;var n,a,s,o,l;return t=t%360/60,l=2*e*(r<.5?r:1-r),o=l*(1-h(t%2-1)),n=a=s=r-l/2,t=~~t,n+=[l,o,0,0,o,l][t],a+=[o,l,l,o,0,0][t],s+=[0,0,o,l,l,o][t],qt(n,a,s,i)},e.rgb2hsb=function(t,e,r){r=it(t,e,r),t=r[0],e=r[1],r=r[2];var i,n,a,s;return a=w(t,e,r),s=a-g(t,e,r),i=0==s?null:a==t?(e-r)/s:a==e?(r-t)/s+2:(t-e)/s+4,i=(i+360)%6*60/360,n=0==s?0:s/a,{h:i,s:n,b:a,tostring:ft}},e.rgb2hsl=function(t,e,r){r=it(t,e,r),t=r[0],e=r[1],r=r[2];var i,n,a,s,o,l;return s=w(t,e,r),o=g(t,e,r),l=s-o,i=0==l?null:s==t?(e-r)/l:s==e?(r-t)/l+2:(t-e)/l+4,i=(i+360)%6*60/360,a=(s+o)/2,n=0==l?0:a<.5?l/(2*a):l/(2-2*a),{h:i,s:n,l:a,tostring:rt}},e._path2string=function(){return this.join(",").replace(xt,"$1")};var dt=e._preload=function(t,e){var r=t.doc.createelement("img");r.style.csstext="position:absolute;left:-9999em;top:-9999em",r.onload=function(){e.call(this),this.onload=null,t.doc.body.removechild(this)},r.onerror=function(){t.doc.body.removechild(this)},t.doc.body.appendchild(r),r.src=t};e.getrgb=n(function(t){if(!t||(t=i(t)).indexof("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,tostring:a};if("none"==t)return{r:-1,g:-1,b:-1,hex:"none",tostring:a};!(vt[a](t.tolowercase().substring(0,2))||"#"==t.charat())&&(t=pt(t));var r,i,n,s,o,l,h,u=t.match(nt);return u?(u[2]&&(s=ut(u[2].substring(5),16),n=ut(u[2].substring(3,5),16),i=ut(u[2].substring(1,3),16)),u[3]&&(s=ut((l=u[3].charat(3))+l,16),n=ut((l=u[3].charat(2))+l,16),i=ut((l=u[3].charat(1))+l,16)),u[4]&&(h=u[4][q](gt),i=ht(h[0]),"%"==h[0].slice(-1)&&(i*=2.55),n=ht(h[1]),"%"==h[1].slice(-1)&&(n*=2.55),s=ht(h[2]),"%"==h[2].slice(-1)&&(s*=2.55),"rgba"==u[1].tolowercase().slice(0,4)&&(o=ht(h[3])),h[3]&&"%"==h[3].slice(-1)&&(o/=100)),u[5]?(h=u[5][q](gt),i=ht(h[0]),"%"==h[0].slice(-1)&&(i*=2.55),n=ht(h[1]),"%"==h[1].slice(-1)&&(n*=2.55),s=ht(h[2]),"%"==h[2].slice(-1)&&(s*=2.55),("deg"==h[0].slice(-3)||"°"==h[0].slice(-1))&&(i/=360),"hsba"==u[1].tolowercase().slice(0,4)&&(o=ht(h[3])),h[3]&&"%"==h[3].slice(-1)&&(o/=100),e.hsb2rgb(i,n,s,o)):u[6]?(h=u[6][q](gt),i=ht(h[0]),"%"==h[0].slice(-1)&&(i*=2.55),n=ht(h[1]),"%"==h[1].slice(-1)&&(n*=2.55),s=ht(h[2]),"%"==h[2].slice(-1)&&(s*=2.55),("deg"==h[0].slice(-3)||"°"==h[0].slice(-1))&&(i/=360),"hsla"==u[1].tolowercase().slice(0,4)&&(o=ht(h[3])),h[3]&&"%"==h[3].slice(-1)&&(o/=100),e.hsl2rgb(i,n,s,o)):(u={r:i,g:n,b:s,tostring:a},u.hex="#"+(16777216|s|n<<8|i<<16).tostring(16).slice(1),e.is(o,"finite")&&(u.opacity=o),u)):{r:-1,g:-1,b:-1,hex:"none",error:1,tostring:a}},e),e.hsb=n(function(t,r,i){return e.hsb2rgb(t,r,i).hex}),e.hsl=n(function(t,r,i){return e.hsl2rgb(t,r,i).hex}),e.rgb=n(function(t,e,r){function i(t){return t+.5|0}return"#"+(16777216|i(r)|i(e)<<8|i(t)<<16).tostring(16).slice(1)}),e.getcolor=function(t){var e=this.getcolor.start=this.getcolor.start||{h:0,s:1,b:t||.75},r=this.hsb2rgb(e.h,e.s,e.b);return e.h+=.075,e.h>1&&(e.h=0,e.s-=.2,e.s<=0&&(this.getcolor.start={h:0,s:1,b:e.b})),r.hex},e.getcolor.reset=function(){delete this.start},e.parsepathstring=function(t){if(!t)return null;var r=vt(t);if(r.arr)return yt(r.arr);var i={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},n=[];return e.is(t,q)&&e.is(t[0],q)&&(n=yt(t)),n.length||i(t).replace(yt,function(t,e,r){var a=[],s=e.tolowercase();if(r.replace(bt,function(t,e){e&&a.push(+e)}),"m"==s&&a.length>2&&(n.push([e][p](a.splice(0,2))),s="l",e="m"==e?"l":"l"),"r"==s)n.push([e][p](a));else for(;a.length>=i[s]&&(n.push([e][p](a.splice(0,i[s]))),i[s]););}),n.tostring=e._path2string,r.arr=yt(n),n},e.parsetransformstring=n(function(t){if(!t)return null;var r={r:3,s:4,t:2,m:6},i=[];return e.is(t,q)&&e.is(t[0],q)&&(i=yt(t)),i.length||i(t).replace(mt,function(t,e,r){var n=[],a=o.call(e);r.replace(bt,function(t,e){e&&n.push(+e)}),i.push([e][p](n))}),i.tostring=e._path2string,i});var vt=function(t){var e=vt.ps=vt.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},settimeout(function(){for(var r in e)e[a](r)&&r!=t&&(e[r].sleep--,!e[r].sleep&&delete e[r])}),e[t]};e.finddotsatsegment=function(t,e,r,i,n,a,s,o,l){var h=1-l,u=x(h,3),c=x(h,2),f=l*l,p=f*l,d=u*t+3*c*l*r+3*h*l*l*n+p*s,g=u*e+3*c*l*i+3*h*l*l*a+p*o,v=t+2*l*(r-t)+f*(n-2*r+t),x=e+2*l*(i-e)+f*(a-2*i+e),y=r+2*l*(n-r)+f*(s-2*n+r),m=i+2*l*(a-i)+f*(o-2*a+i),b=h*t+l*r,_=h*e+l*i,w=h*n+l*s,k=h*a+l*o,b=90-180*y.atan2(v-y,x-m)/u;return(v>y||x=t.x&&e<=t.x2&&r>=t.y&&r<=t.y2},e.isbboxintersect=function(t,r){var i=e.ispointinsidebbox;return i(r,t.x,t.y)||i(r,t.x2,t.y)||i(r,t.x,t.y2)||i(r,t.x2,t.y2)||i(t,r.x,r.y)||i(t,r.x2,r.y)||i(t,r.x,r.y2)||i(t,r.x2,r.y2)||(t.xr.x||r.xt.x)&&(t.yr.y||r.yt.y)},e.pathintersection=function(t,e){return d(t,e)},e.pathintersectionnumber=function(t,e){return d(t,e,1)},e.ispointinsidepath=function(t,r,i){var n=e.pathbbox(t);return e.ispointinsidebbox(n,r,i)&&d(t,[["m",r,i],["h",n.x2+10]],1)%2==1},e._removedfactory=function(e){return function(){t("raphael.log",null,"raphaël: you are calling to method “"+e+"” of removed object",e)}};var ot=e.pathbbox=function(t){var e=vt(t);if(e.bbox)return r(e.bbox);if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};t=qt(t);for(var i=0,n=0,a=[],s=[],o,l=0,h=t.length;l1&&(b=y.sqrt(b),r=b*r,i=b*i);var _=r*r,w=i*i,k=(s==o?-1:1)*y.sqrt(h((_*w-_*m*m-w*y*y)/(_*m*m+w*y*y))),b=k*r*m/i+(t+l)/2,c=k*-i*y/r+(e+h)/2,s=y.asin(((e-c)/i).tofixed(9)),a=y.asin(((h-c)/i).tofixed(9));s=ta&&(s-=2*u),!o&&a>s&&(a-=2*u)}var t=a-s;if(h(t)>c){var e=a,m=l,n=h;a=s+c*(o&&a>s?1:-1),l=b+r*y.cos(a),h=c+i*y.sin(a),p=ut(l,h,r,i,a,0,o,m,n,[a,e,b,c])}t=a-s;var l=y.cos(s),z=y.sin(s),f=y.cos(a),r=y.sin(a),j=y.tan(t/4),i=4/3*r*j,d=4/3*i*j,v=[t,e],o=[t+i*z,e-d*l],w=[l+i*r,h-d*f],g=[l,h];if(o[0]=2*v[0]-o[0],o[1]=2*v[1]-o[1],u)return[o,w,g][p](p);p=[o,w,g][p](p).join()[q](",");for(var x=[],$=0,z=p.length;$"1e12"&&(c=.5),h(f)>"1e12"&&(f=.5),c>0&&c<1&&(g=$t(t,e,r,i,n,a,s,o,c),d.push(g.x),p.push(g.y)),f>0&&f<1&&(g=$t(t,e,r,i,n,a,s,o,f),d.push(g.x),p.push(g.y)),l=a-2*i+e-(o-2*a+i),h=2*(i-e)-2*(a-i),u=e-i,c=(-h+y.sqrt(h*h-4*l*u))/2/l,f=(-h-y.sqrt(h*h-4*l*u))/2/l,h(c)>"1e12"&&(c=.5),h(f)>"1e12"&&(f=.5),c>0&&c<1&&(g=$t(t,e,r,i,n,a,s,o,c),d.push(g.x),p.push(g.y)),f>0&&f<1&&(g=$t(t,e,r,i,n,a,s,o,f),d.push(g.x),p.push(g.y)),{min:{x:g[z](0,d),y:g[z](0,p)},max:{x:w[z](0,d),y:w[z](0,p)}}}),qt=e._path2curve=n(function(t,e){var r=!e&&vt(t);if(!e&&r.curve)return yt(r.curve);for(var i=gt(t),n=e&>(e),a={x:0,y:0,bx:0,by:0,x:0,y:0,qx:null,qy:null},s={x:0,y:0,bx:0,by:0,x:0,y:0,qx:null,qy:null},o=(function(t,e,r){var i,n,a={t:1,q:1};if(!t)return["c",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in a)&&(e.qx=e.qy=null),t[0]){case"m":e.x=t[1],e.y=t[2];break;case"a":t=["c"][p](ut[z](0,[e.x,e.y][p](t.slice(1))));break;case"s":"c"==r||"s"==r?(i=2*e.x-e.bx,n=2*e.y-e.by):(i=e.x,n=e.y),t=["c",i,n][p](t.slice(1));break;case"t":"q"==r||"t"==r?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["c"][p](xt(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"q":e.qx=t[1],e.qy=t[2],t=["c"][p](xt(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"l":t=["c"][p](ht(e.x,e.y,t[1],t[2]));break;case"h":t=["c"][p](ht(e.x,e.y,t[1],e.y));break;case"v":t=["c"][p](ht(e.x,e.y,e.x,t[1]));break;case"z":t=["c"][p](ht(e.x,e.y,e.x,e.y))}return t}),l=function(t,e){if(t[e].length>7){t[e].shift();for(var r=t[e];r.length;)u[e]="a",n&&(c[e]="a"),t.splice(e++,0,["c"][p](r.splice(0,6)));t.splice(e,1),g=w(i.length,n&&n.length||0)}},h=function(t,e,r,a,s){t&&e&&"m"==t[s][0]&&"m"!=e[s][0]&&(e.splice(s,0,["m",a.x,a.y]),r.bx=0,r.by=0,r.x=t[s][1],r.y=t[s][2],g=w(i.length,n&&n.length||0))},u=[],c=[],f="",p="",d=0,g=w(i.length,n&&n.length||0);dn){if(r&&!c.start){if(f=ke(s,o,l[1],l[2],l[3],l[4],l[5],l[6],n-p),u+=["c"+f.start.x,f.start.y,f.m.x,f.m.y,f.x,f.y],a)return u;c.start=u,u=["m"+f.x,f.y+"c"+f.n.x,f.n.y,f.end.x,f.end.y,l[5],l[6]].join(),p+=h,s=+l[5],o=+l[6];continue}if(!t&&!r)return f=ke(s,o,l[1],l[2],l[3],l[4],l[5],l[6],n-p),{x:f.x,y:f.y,alpha:f.alpha}}p+=h,s=+l[5],o=+l[6]}u+=l.shift()+l}return c.end=u,f=t?p:r?c:e.finddotsatsegment(s,o,l[0],l[1],l[2],l[3],l[4],l[5],1),f.alpha&&(f={x:f.x,y:f.y,alpha:f.alpha}),f}},ce=be(1),se=be(),ae=be(0,1);e.gettotallength=ce,e.getpointatlength=se,e.getsubpath=function(t,e,r){if(this.gettotallength(t)-r<1e-6)return ae(t,e).end;var i=ae(t,r,1);return e?ae(i,e).end:i},ye.gettotallength=function(){var t=this.getpath();if(t)return this.node.gettotallength?this.node.gettotallength():ce(t)},ye.getpointatlength=function(t){var e=this.getpath();if(e)return se(e,t)},ye.getpath=function(){var t,r=e._getpath[this.type];if("text"!=this.type&&"set"!=this.type)return r&&(t=r(this)),t},ye.getsubpath=function(t,r){var i=this.getpath();if(i)return e.getsubpath(i,t,r)};var te=e.easing_formulas={linear:function(t){return t},"<":function(t){return x(t,1.7)},">":function(t){return x(t,.48)},"<>":function(t){var e=.48-t/1.04,r=y.sqrt(.1734+e*e),i=r-e,n=x(h(i),1/3)*(i<0?-1:1),a=-r-e,s=x(h(a),1/3)*(a<0?-1:1),o=n+s+.5;return 3*(1-o)*o*o+o*o*o},backin:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backout:function(t){t-=1;var e=1.70158;return t*t*((e+1)*t+e)+1},elastic:function(t){return t==!!t?t:x(2,-10*t)*y.sin((t-.075)*(2*u)/.3)+1},bounce:function(t){var e=7.5625,r=2.75,i;return t<1/r?i=e*t*t:t<2/r?(t-=1.5/r,i=e*t*t+.75):t<2.5/r?(t-=2.25/r,i=e*t*t+.9375):(t-=2.625/r,i=e*t*t+.984375),i}};te.easein=te["ease-in"]=te["<"],te.easeout=te["ease-out"]=te[">"],te.easeinout=te["ease-in-out"]=te["<>"],te["back-in"]=te.backin,te["back-out"]=te.backout;var ee=[],me=window.requestanimationframe||window.webkitrequestanimationframe||window.mozrequestanimationframe||window.orequestanimationframe||window.msrequestanimationframe||function(t){settimeout(t,16)},ne=function(){for(var r=+new date,i=0;i1&&!n.next){for(v in u)u[a](v)&&(g[v]=n.totalorigin[v]);n.el.attr(g),b(n.anim,n.el,n.anim.percents[0],null,n.totalorigin,n.repeat-1)}n.next&&!n.stop&&b(n.anim,n.el,n.next,null,n.totalorigin,n.repeat)}}}ee.length&&me(ne)},le=function(t){return t>255?255:t<0?0:t};ye.animatewith=function(t,r,i,n,a,s){var o=this;if(o.removed)return s&&s.call(o),o;var l=i instanceof m?i:e.animation(i,n,a,s),h,u;b(l,o,l.percents[0],null,o.attr());for(var c=0,f=ee.length;cl&&(l=u)}l+="%",!t[l].callback&&(t[l].callback=n)}return new m(t,r)},ye.animate=function(t,r,i,n){var a=this;if(a.removed)return n&&n.call(a),a;var s=t instanceof m?t:e.animation(t,r,i,n);return b(s,a,s.percents[0],null,a.attr()),a},ye.settime=function(t,e){return t&&null!=e&&this.status(t,g(e,t.ms)/t.ms),this},ye.status=function(t,e){var r=[],i=0,n,a;if(null!=e)return b(t,this,-1,g(e,1)),this;for(n=ee.length;i1)for(var i=0,n=r.length;i.5)-1;l(f-.5,2)+l(p-.5,2)>.25&&(p=a.sqrt(.25-l(f-.5,2))*n+.5)&&.5!=p&&(p=p.tofixed(5)-1e-5*n)}return c}),n=n.split(/\s*\-\s*/),"linear"==h){var b=n.shift();if(b=-i(b),isnan(b))return null;var _=[0,0,a.cos(t.rad(b)),a.sin(t.rad(b))],w=1/(s(o(_[2]),o(_[3]))||1);_[2]*=w,_[3]*=w,_[2]<0&&(_[0]=-_[2],_[2]=0),_[3]<0&&(_[1]=-_[3],_[3]=0)}var k=t._parsedots(n);if(!k)return null;if(u=u.replace(/[\(\)\s,\xb0#]/g,"_"),e.gradient&&u!=e.gradient.id&&(g.defs.removechild(e.gradient),delete e.gradient),!e.gradient){y=v(h+"gradient",{id:u}),e.gradient=y,v(y,"radial"==h?{fx:f,fy:p}:{x1:_[0],y1:_[1],x2:_[2],y2:_[3],gradienttransform:e.matrix.invert()}),g.defs.appendchild(y);for(var b=0,c=k.length;b1?z.opacity/100:z.opacity});case"stroke":z=t.getrgb(g),l.setattribute(d,z.hex),"stroke"==d&&z[e]("opacity")&&v(l,{"stroke-opacity":z.opacity>1?z.opacity/100:z.opacity}),"stroke"==d&&i._.arrows&&("startstring"in i._.arrows&&_(i,i._.arrows.startstring),"endstring"in i._.arrows&&_(i,i._.arrows.endstring,1));break;case"gradient":("circle"==i.type||"ellipse"==i.type||"r"!=r(g).charat())&&x(i,g);break;case"opacity":u.gradient&&!u[e]("stroke-opacity")&&v(l,{"stroke-opacity":g>1?g/100:g});case"fill-opacity":if(u.gradient){p=t._g.doc.getelementbyid(l.getattribute("fill").replace(/^url\(#|\)$/g,c)),p&&(f=p.getelementsbytagname("stop"),v(f[f.length-1],{"stop-opacity":g}));break}default:"font-size"==d&&(g=n(g,10)+"px");var r=d.replace(/(\-.)/g,function(t){return t.substring(1).touppercase()});l.style[r]=g,i._.dirty=1,l.setattribute(d,g)}}s(i,a),l.style.visibility=f},c=1.2,s=function(i,a){if("text"==i.type&&(a[e]("text")||a[e]("font")||a[e]("font-size")||a[e]("x")||a[e]("y"))){var s=i.attrs,o=i.node,l=o.firstchild?n(t._g.doc.defaultview.getcomputedstyle(o.firstchild,c).getpropertyvalue("font-size"),10):10;if(a[e]("text")){for(s.text=a.text;o.firstchild;)o.removechild(o.firstchild);for(var h=r(a.text).split("\n"),u=[],f,p=0,d=h.length;p"));var z=x.getboundingclientrect();m.w=f.w=(z.right-z.left)/u,m.h=f.h=(z.bottom-z.top)/u,m.x=f.x,m.y=f.y+m.h/2,("x"in l||"y"in l)&&(m.path.v=t.format("m{0},{1}l{2},{1}",a(f.x*b),a(f.y*b),a(f.x*b)+1));for(var q=["x","y","text","font","font-family","font-weight","font-style","font-size"],j=0,k=q.length;j.25&&(r=n.sqrt(.25-l(e-.5,2))*(2*(r>.5)-1)+.5),f=e+p+r),d}),a=a.split(/\s*\-\s*/),"linear"==c){var g=a.shift();if(g=-i(g),isnan(g))return null}var v=t._parsedots(a);if(!v)return null;if(e=e.shape||e.node,v.length){e.removechild(s),s.on=!0,s.method="none",s.color=v[0].color,s.color2=v[v.length-1].color;for(var x=[],y=0,m=v.length;y')}}catch(r){n=function(t){return e.createelement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},t._engine.initwin(t._g.win),t._engine.create=function(){var e=t._getcontainer.apply(0,arguments),r=e.container,i=e.height,n,a=e.width,s=e.x,o=e.y;if(!r)throw new error("vml container not found.");var l=new t._paper,h=l.canvas=t._g.doc.createelement("div"),u=h.style;return s=s||0,o=o||0,a=a||512,i=i||342,l.width=a,l.height=i,a==+a&&(a+="px"),i==+i&&(i+="px"),l.coordsize=1e3*b+p+1e3*b,l.coordorigin="0 0",l.span=t._g.doc.createelement("span"),l.span.style.csstext="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",h.appendchild(l.span),u.csstext=t.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",a,i),1==r?(t._g.doc.body.appendchild(h),u.left=s+"px",u.top=o+"px",u.position="absolute"):r.firstchild?r.insertbefore(h,r.firstchild):r.appendchild(h),l.renderfix=function(){},l},t.prototype.clear=function(){t.eve("raphael.clear",this),this.canvas.innerhtml=d,this.span=t._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},t.prototype.remove=function(){t.eve("raphael.remove",this),this.canvas.parentnode.removechild(this.canvas);for(var e in this)this[e]="function"==typeof this[e]?t._removedfactory(e):null;return!0};var l=t.st;for(var z in m)m[e](z)&&!l[e](z)&&(l[z]=function(t){return function(){var e=arguments;return this.foreach(function(r){r[t].apply(r,e)})}}(z))}}.apply(e,i),!(void 0!==n&&(t.exports=n))}])});