!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.zrender={})}(this,function(t){"use strict";function e(t){if(null==t||"object"!=typeof t)return t;var i=t,r=kr.call(t);if("[object Array]"===r){if(!k(t)){i=[];for(var n=0,a=t.length;nZr||t<-Zr}function K(t){this._target=t.target,this._life=t.life||1e3,this._delay=t.delay||0,this._initialized=!1,this.loop=null!=t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"Linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart,this._pausedTime=0,this._paused=!1}function J(t){return(t=Math.round(t))<0?0:t>255?255:t}function tt(t){return(t=Math.round(t))<0?0:t>360?360:t}function et(t){return t<0?0:t>1?1:t}function it(t){return J(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100*255:parseInt(t,10))}function rt(t){return et(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100:parseFloat(t))}function nt(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}function at(t,e,i){return t+(e-t)*i}function ot(t,e,i,r,n){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t}function st(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function ht(t,e){hn&&st(hn,e),hn=sn.put(t,hn||e.slice())}function lt(t,e){if(t){e=e||[];var i=sn.get(t);if(i)return st(e,i);var r=(t+="").replace(/ /g,"").toLowerCase();if(r in on)return st(e,on[r]),ht(t,e),e;if("#"!==r.charAt(0)){var n=r.indexOf("("),a=r.indexOf(")");if(-1!==n&&a+1===r.length){var o=r.substr(0,n),s=r.substr(n+1,a-(n+1)).split(","),h=1;switch(o){case"rgba":if(4!==s.length)return void ot(e,0,0,0,1);h=rt(s.pop());case"rgb":return 3!==s.length?void ot(e,0,0,0,1):(ot(e,it(s[0]),it(s[1]),it(s[2]),h),ht(t,e),e);case"hsla":return 4!==s.length?void ot(e,0,0,0,1):(s[3]=rt(s[3]),ut(s,e),ht(t,e),e);case"hsl":return 3!==s.length?void ot(e,0,0,0,1):(ut(s,e),ht(t,e),e);default:return}}ot(e,0,0,0,1)}else{if(4===r.length)return(l=parseInt(r.substr(1),16))>=0&&l<=4095?(ot(e,(3840&l)>>4|(3840&l)>>8,240&l|(240&l)>>4,15&l|(15&l)<<4,1),ht(t,e),e):void ot(e,0,0,0,1);if(7===r.length){var l=parseInt(r.substr(1),16);return l>=0&&l<=16777215?(ot(e,(16711680&l)>>16,(65280&l)>>8,255&l,1),ht(t,e),e):void ot(e,0,0,0,1)}}}}function ut(t,e){var i=(parseFloat(t[0])%360+360)%360/360,r=rt(t[1]),n=rt(t[2]),a=n<=.5?n*(r+1):n+r-n*r,o=2*n-a;return e=e||[],ot(e,J(255*nt(o,a,i+1/3)),J(255*nt(o,a,i)),J(255*nt(o,a,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function ct(t){if(t){var e,i,r=t[0]/255,n=t[1]/255,a=t[2]/255,o=Math.min(r,n,a),s=Math.max(r,n,a),h=s-o,l=(s+o)/2;if(0===h)e=0,i=0;else{i=l<.5?h/(s+o):h/(2-s-o);var u=((s-r)/6+h/2)/h,c=((s-n)/6+h/2)/h,f=((s-a)/6+h/2)/h;r===s?e=f-c:n===s?e=1/3+u-f:a===s&&(e=2/3+c-u),e<0&&(e+=1),e>1&&(e-=1)}var d=[360*e,i,l];return null!=t[3]&&d.push(t[3]),d}}function ft(t,e,i){if(e&&e.length&&t>=0&&t<=1){i=i||[];var r=t*(e.length-1),n=Math.floor(r),a=Math.ceil(r),o=e[n],s=e[a],h=r-n;return i[0]=J(at(o[0],s[0],h)),i[1]=J(at(o[1],s[1],h)),i[2]=J(at(o[2],s[2],h)),i[3]=et(at(o[3],s[3],h)),i}}function dt(t,e,i){if(e&&e.length&&t>=0&&t<=1){var r=t*(e.length-1),n=Math.floor(r),a=Math.ceil(r),o=lt(e[n]),s=lt(e[a]),h=r-n,l=pt([J(at(o[0],s[0],h)),J(at(o[1],s[1],h)),J(at(o[2],s[2],h)),et(at(o[3],s[3],h))],"rgba");return i?{color:l,leftIndex:n,rightIndex:a,value:r}:l}}function pt(t,e){if(t&&t.length){var i=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(i+=","+t[3]),e+"("+i+")"}}function vt(t,e){return t[e]}function gt(t,e,i){t[e]=i}function _t(t,e,i){return(e-t)*i+t}function mt(t,e,i){return i>.5?e:t}function yt(t,e,i,r,n){var a=t.length;if(1==n)for(s=0;sn)t.length=n;else for(o=r;o=0&&!(g[i]<=e);i--);i=Math.min(i,u-2)}else{for(i=A;ie);i++);i=Math.min(i-1,u-2)}A=i,z=e;var r=g[i+1]-g[i];if(0!==r)if(M=(e-g[i])/r,h)if(C=_[i],S=_[0===i?i:i-1],P=_[i>u-2?u-1:i+1],L=_[i>u-3?u-1:i+2],f)bt(S,C,P,L,M,M*M,M*M*M,o(t,n),v);else{if(d)a=bt(S,C,P,L,M,M*M,M*M*M,D,1),a=Mt(D);else{if(p)return mt(C,P,M);a=kt(S,C,P,L,M,M*M,M*M*M)}s(t,n,a)}else if(f)yt(_[i],_[i+1],M,o(t,n),v);else{var a;if(d)yt(_[i],_[i+1],M,D,1),a=Mt(D);else{if(p)return mt(_[i],_[i+1],M);a=_t(_[i],_[i+1],M)}s(t,n,a)}},ondestroy:i});return e&&"spline"!==e&&(I.easing=e),I}}}function Pt(t,e,i,r){i<0&&(t+=i,i=-i),r<0&&(e+=r,r=-r),this.x=t,this.y=e,this.width=i,this.height=r}function Lt(t){for(var e=0;t>=Tn;)e|=1&t,t>>=1;return t+e}function At(t,e,i,r){var n=e+1;if(n===i)return 1;if(r(t[n++],t[e])<0){for(;n=0;)n++;return n-e}function zt(t,e,i){for(i--;e>>1])<0?h=a:s=a+1;var l=r-s;switch(l){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;l>0;)t[s+l]=t[s+l-1],l--}t[s]=o}}function It(t,e,i,r,n,a){var o=0,s=0,h=1;if(a(t,e[i+n])>0){for(s=r-n;h0;)o=h,(h=1+(h<<1))<=0&&(h=s);h>s&&(h=s),o+=n,h+=n}else{for(s=n+1;hs&&(h=s);var l=o;o=n-h,h=n-l}for(o++;o>>1);a(t,e[i+u])>0?o=u+1:h=u}return h}function Bt(t,e,i,r,n,a){var o=0,s=0,h=1;if(a(t,e[i+n])<0){for(s=n+1;hs&&(h=s);var l=o;o=n-h,h=n-l}else{for(s=r-n;h=0;)o=h,(h=1+(h<<1))<=0&&(h=s);h>s&&(h=s),o+=n,h+=n}for(o++;o>>1);a(t,e[i+u])<0?h=u:o=u+1}return h}function Rt(t,e){function i(i){var s=a[i],l=o[i],u=a[i+1],c=o[i+1];o[i]=l+c,i===h-3&&(a[i+1]=a[i+2],o[i+1]=o[i+2]),h--;var f=Bt(t[u],t,s,l,0,e);s+=f,0!==(l-=f)&&0!==(c=It(t[s+l-1],t,u,c,c-1,e))&&(l<=c?r(s,l,u,c):n(s,l,u,c))}function r(i,r,n,a){var o=0;for(o=0;o=Mn||d>=Mn);if(p)break;v<0&&(v=0),v+=2}if((s=v)<1&&(s=1),1===r){for(o=0;o=0;o--)t[d+o]=t[f+o];if(0===r){_=!0;break}}if(t[c--]=l[u--],1==--a){_=!0;break}if(0!=(g=a-It(t[h],l,0,a,a-1,e))){for(a-=g,d=(c-=g)+1,f=(u-=g)+1,o=0;o=Mn||g>=Mn);if(_)break;p<0&&(p=0),p+=2}if((s=p)<1&&(s=1),1===a){for(d=(c-=r)+1,f=(h-=r)+1,o=r-1;o>=0;o--)t[d+o]=t[f+o];t[c]=l[u]}else{if(0===a)throw new Error;for(f=c-(a-1),o=0;o=0;o--)t[d+o]=t[f+o];t[c]=l[u]}else for(f=c-(a-1),o=0;o1;){var t=h-2;if(t>=1&&o[t-1]<=o[t]+o[t+1]||t>=2&&o[t-2]<=o[t]+o[t-1])o[t-1]o[t+1])break;i(t)}},this.forceMergeRuns=function(){for(;h>1;){var t=h-2;t>0&&o[t-1]s&&(h=s),Dt(t,i,i+h,i+a,e),a=h}o.pushRun(i,a),o.mergeRuns(),n-=a,i+=a}while(0!==n);o.forceMergeRuns()}}function Ot(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}function Ht(t,e,i){var r=null==e.x?0:e.x,n=null==e.x2?1:e.x2,a=null==e.y?0:e.y,o=null==e.y2?0:e.y2;return e.global||(r=r*i.width+i.x,n=n*i.width+i.x,a=a*i.height+i.y,o=o*i.height+i.y),r=isNaN(r)?0:r,n=isNaN(n)?1:n,a=isNaN(a)?0:a,o=isNaN(o)?0:o,t.createLinearGradient(r,a,n,o)}function Ft(t,e,i){var r=i.width,n=i.height,a=Math.min(r,n),o=null==e.x?.5:e.x,s=null==e.y?.5:e.y,h=null==e.r?.5:e.r;return e.global||(o=o*r+i.x,s=s*n+i.y,h*=a),t.createRadialGradient(o,s,0,o,s,h)}function Nt(){return!1}function Wt(t,e,i){var r=zr(),n=e.getWidth(),a=e.getHeight(),o=r.style;return o&&(o.position="absolute",o.left=0,o.top=0,o.width=n+"px",o.height=a+"px",r.setAttribute("data-zr-dom-id",t)),r.width=n*i,r.height=a*i,r}function Vt(t){if("string"==typeof t){var e=On.get(t);return e&&e.image}return t}function jt(t,e,i,r,n){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!i)return e;var a=On.get(t),o={hostEl:i,cb:r,cbPayload:n};return a?!Xt(e=a.image)&&a.pending.push(o):(!e&&(e=new Image),e.onload=qt,On.put(t,e.__cachedImgObj={image:e,pending:[o]}),e.src=e.__zrImageSrc=t),e}return t}return e}function qt(){var t=this.__cachedImgObj;this.onload=this.__cachedImgObj=null;for(var e=0;eNn&&(Fn=0,Hn={}),Fn++,Hn[i]=n,n}function Yt(t,e,i,r,n,a,o){return a?Zt(t,e,i,r,n,a,o):Gt(t,e,i,r,n,o)}function Gt(t,e,i,r,n,a){var o=ae(t,e,n,a),s=Ut(t,e);n&&(s+=n[1]+n[3]);var h=o.outerHeight,l=new Pt(Qt(0,s,i),$t(0,h,r),s,h);return l.lineHeight=o.lineHeight,l}function Zt(t,e,i,r,n,a,o){var s=oe(t,{rich:a,truncate:o,font:e,textAlign:i,textPadding:n}),h=s.outerWidth,l=s.outerHeight;return new Pt(Qt(0,h,i),$t(0,l,r),h,l)}function Qt(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function $t(t,e,i){return"middle"===i?t-=e/2:"bottom"===i&&(t-=e),t}function Kt(t,e,i){var r=e.x,n=e.y,a=e.height,o=e.width,s=a/2,h="left",l="top";switch(t){case"left":r-=i,n+=s,h="right",l="middle";break;case"right":r+=i+o,n+=s,l="middle";break;case"top":r+=o/2,n-=i,h="center",l="bottom";break;case"bottom":r+=o/2,n+=a+i,h="center";break;case"inside":r+=o/2,n+=s,h="center",l="middle";break;case"insideLeft":r+=i,n+=s,l="middle";break;case"insideRight":r+=o-i,n+=s,h="right",l="middle";break;case"insideTop":r+=o/2,n+=i,h="center";break;case"insideBottom":r+=o/2,n+=a-i,h="center",l="bottom";break;case"insideTopLeft":r+=i,n+=i;break;case"insideTopRight":r+=o-i,n+=i,h="right";break;case"insideBottomLeft":r+=i,n+=a-i,l="bottom";break;case"insideBottomRight":r+=o-i,n+=a-i,h="right",l="bottom"}return{x:r,y:n,textAlign:h,textVerticalAlign:l}}function Jt(t,e,i,r,n){if(!e)return"";var a=(t+"").split("\n");n=te(e,i,r,n);for(var o=0,s=a.length;o=o;h++)s-=o;var l=Ut(i);return l>s&&(i="",l=0),s=t-l,n.ellipsis=i,n.ellipsisWidth=l,n.contentWidth=s,n.containerWidth=t,n}function ee(t,e){var i=e.containerWidth,r=e.font,n=e.contentWidth;if(!i)return"";var a=Ut(t,r);if(a<=i)return t;for(var o=0;;o++){if(a<=n||o>=e.maxIterations){t+=e.ellipsis;break}var s=0===o?ie(t,n,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(t.length*n/a):0;a=Ut(t=t.substr(0,s),r)}return""===t&&(t=e.placeholder),t}function ie(t,e,i,r){for(var n=0,a=0,o=t.length;ah)t="",a=[];else if(null!=l)for(var u=te(l-(i?i[1]+i[3]:0),e,r.ellipsis,{minChar:r.minChar,placeholder:r.placeholder}),c=0,f=a.length;cn&&se(i,t.substring(n,a)),se(i,r[2],r[1]),n=Wn.lastIndex}nd)return{lines:[],width:0,height:0};z.textWidth=Ut(z.text,b);var T=m.textWidth,M=null==T||"auto"===T;if("string"==typeof T&&"%"===T.charAt(T.length-1))z.percentWidth=T,l.push(z),T=0;else{if(M){T=z.textWidth;var S=m.textBackgroundColor,C=S&&S.image;C&&Xt(C=Vt(C))&&(T=Math.max(T,C.width*k/C.height))}var P=w?w[1]+w[3]:0;T+=P;var L=null!=f?f-g:null;null!=L&&Lh&&(i*=h/(c=i+r),r*=h/c),n+a>h&&(n*=h/(c=n+a),a*=h/c),r+n>l&&(r*=l/(c=r+n),n*=l/c),i+a>l&&(i*=l/(c=i+a),a*=l/c),t.moveTo(o+i,s),t.lineTo(o+h-r,s),0!==r&&t.arc(o+h-r,s+r,r,-Math.PI/2,0),t.lineTo(o+h,s+l-n),0!==n&&t.arc(o+h-n,s+l-n,n,0,Math.PI/2),t.lineTo(o+a,s+l),0!==a&&t.arc(o+a,s+l-a,a,Math.PI/2,Math.PI),t.lineTo(o,s+i),0!==i&&t.arc(o+i,s+i,i,Math.PI,1.5*Math.PI)}function ue(t){return ce(t),u(t.rich,ce),t}function ce(t){if(t){t.font=he(t);var e=t.textAlign;"middle"===e&&(e="center"),t.textAlign=null==e||qn[e]?e:"left";var i=t.textVerticalAlign||t.textBaseline;"center"===i&&(i="middle"),t.textVerticalAlign=null==i||Xn[i]?i:"top",t.textPadding&&(t.textPadding=w(t.textPadding))}}function fe(t,e,i,r,n){r.rich?pe(t,e,i,r,n):de(t,e,i,r,n)}function de(t,e,i,r,n){var a=be(e,"font",r.font||Vn),o=r.textPadding,s=t.__textCotentBlock;s&&!t.__dirty||(s=t.__textCotentBlock=ae(i,a,o,r.truncate));var h=s.outerHeight,l=s.lines,u=s.lineHeight,c=we(h,r,n),f=c.baseX,d=c.baseY,p=c.textAlign,v=c.textVerticalAlign;ge(e,r,n,f,d);var g=$t(d,h,v),_=f,m=g,y=me(r);if(y||o){var x=Ut(i,a);o&&(x+=o[1]+o[3]);var w=Qt(f,x,p);y&&ye(t,e,r,w,g,x,h),o&&(_=Se(f,p,o),m+=o[0])}be(e,"textAlign",p||"left"),be(e,"textBaseline","middle"),be(e,"shadowBlur",r.textShadowBlur||0),be(e,"shadowColor",r.textShadowColor||"transparent"),be(e,"shadowOffsetX",r.textShadowOffsetX||0),be(e,"shadowOffsetY",r.textShadowOffsetY||0),m+=u/2;var b=r.textStrokeWidth,k=ke(r.textStroke,b),T=Te(r.textFill);k&&(be(e,"lineWidth",b),be(e,"strokeStyle",k)),T&&be(e,"fillStyle",T);for(var M=0;M=0&&"right"===(x=b[L]).textAlign;)_e(t,e,x,r,T,_,P,"right"),M-=x.width,P-=x.width,L--;for(C+=(a-(C-g)-(m-P)-M)/2;S<=L;)_e(t,e,x=b[S],r,T,_,C+x.width/2,"center"),C+=x.width,S++;_+=T}}function ge(t,e,i,r,n){if(i&&e.textRotation){var a=e.textOrigin;"center"===a?(r=i.width/2+i.x,n=i.height/2+i.y):a&&(r=a[0]+i.x,n=a[1]+i.y),t.translate(r,n),t.rotate(-e.textRotation),t.translate(-r,-n)}}function _e(t,e,i,r,n,a,o,s){var h=r.rich[i.styleName]||{},l=i.textVerticalAlign,u=a+n/2;"top"===l?u=a+i.height/2:"bottom"===l&&(u=a+n-i.height/2),!i.isLineHolder&&me(h)&&ye(t,e,h,"right"===s?o-i.width:"center"===s?o-i.width/2:o,u-i.height/2,i.width,i.height);var c=i.textPadding;c&&(o=Se(o,s,c),u-=i.height/2-c[2]-i.textHeight/2),be(e,"shadowBlur",x(h.textShadowBlur,r.textShadowBlur,0)),be(e,"shadowColor",h.textShadowColor||r.textShadowColor||"transparent"),be(e,"shadowOffsetX",x(h.textShadowOffsetX,r.textShadowOffsetX,0)),be(e,"shadowOffsetY",x(h.textShadowOffsetY,r.textShadowOffsetY,0)),be(e,"textAlign",s),be(e,"textBaseline","middle"),be(e,"font",i.font||Vn);var f=ke(h.textStroke||r.textStroke,p),d=Te(h.textFill||r.textFill),p=y(h.textStrokeWidth,r.textStrokeWidth);f&&(be(e,"lineWidth",p),be(e,"strokeStyle",f),e.strokeText(i.text,o,u)),d&&(be(e,"fillStyle",d),e.fillText(i.text,o,u))}function me(t){return t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor}function ye(t,e,i,r,n,a,o){var s=i.textBackgroundColor,h=i.textBorderWidth,l=i.textBorderColor,u=v(s);if(be(e,"shadowBlur",i.textBoxShadowBlur||0),be(e,"shadowColor",i.textBoxShadowColor||"transparent"),be(e,"shadowOffsetX",i.textBoxShadowOffsetX||0),be(e,"shadowOffsetY",i.textBoxShadowOffsetY||0),u||h&&l){e.beginPath();var c=i.textBorderRadius;c?le(e,{x:r,y:n,width:a,height:o,r:c}):e.rect(r,n,a,o),e.closePath()}if(u)be(e,"fillStyle",s),e.fill();else if(g(s)){var f=s.image;(f=jt(f,null,t,xe,s))&&Xt(f)&&e.drawImage(f,r,n,a,o)}h&&l&&(be(e,"lineWidth",h),be(e,"strokeStyle",l),e.stroke())}function xe(t,e){e.image=t}function we(t,e,i){var r=e.x||0,n=e.y||0,a=e.textAlign,o=e.textVerticalAlign;if(i){var s=e.textPosition;if(s instanceof Array)r=i.x+Me(s[0],i.width),n=i.y+Me(s[1],i.height);else{var h=Kt(s,i,e.textDistance);r=h.x,n=h.y,a=a||h.textAlign,o=o||h.textVerticalAlign}var l=e.textOffset;l&&(r+=l[0],n+=l[1])}return{baseX:r,baseY:n,textAlign:a,textVerticalAlign:o}}function be(t,e,i){return t[e]=Pn(t,e,i),t[e]}function ke(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function Te(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function Me(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function Se(t,e,i){return"right"===e?t-i[1]:"center"===e?t+i[3]/2-i[1]/2:t+i[3]}function Ce(t,e){return null!=t&&(t||e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor||e.textPadding)}function Pe(t){t=t||{},yn.call(this,t);for(var e in t)t.hasOwnProperty(e)&&"style"!==e&&(this[e]=t[e]);this.style=new An(t.style,this),this._rect=null,this.__clipPaths=[]}function Le(t){Pe.call(this,t)}function Ae(t){return parseInt(t,10)}function ze(t){return!!t&&(!!t.__builtin__||"function"==typeof t.resize&&"function"==typeof t.refresh)}function De(t,e,i){return Gn.copy(t.getBoundingRect()),t.transform&&Gn.applyTransform(t.transform),Zn.width=e,Zn.height=i,!Gn.intersect(Zn)}function Ie(t,e){if(t==e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var i=0;i=0){var n="touchend"!=r?e.targetTouches[0]:e.changedTouches[0];n&&Oe(t,n,e,i)}else Oe(t,e,e,i),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;var a=e.button;return null==e.which&&void 0!==a&&Kn.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function Ne(t,e,i){$n?t.addEventListener(e,i):t.attachEvent("on"+e,i)}function We(t,e,i){$n?t.removeEventListener(e,i):t.detachEvent("on"+e,i)}function Ve(t){var e=t[1][0]-t[0][0],i=t[1][1]-t[0][1];return Math.sqrt(e*e+i*i)}function je(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}function qe(t){return"mousewheel"===t&&xr.browser.firefox?"DOMMouseScroll":t}function Xe(t,e,i){var r=t._gestureMgr;"start"===i&&r.clear();var n=r.recognize(e,t.handler.findHover(e.zrX,e.zrY,null).target,t.dom);if("end"===i&&r.clear(),n){var a=n.type;e.gestureEvent=a,t.handler.dispatchToElement({target:n.target},a,n.event)}}function Ue(t){t._touching=!0,clearTimeout(t._touchTimer),t._touchTimer=setTimeout(function(){t._touching=!1},700)}function Ye(t){var e=t.pointerType;return"pen"===e||"touch"===e}function Ge(t){function e(t,e){return function(){if(!e._touching)return t.apply(e,arguments)}}u(ra,function(e){t._handlers[e]=f(oa[e],t)}),u(aa,function(e){t._handlers[e]=f(oa[e],t)}),u(ia,function(i){t._handlers[i]=e(oa[i],t)})}function Ze(t){function e(e,i){u(e,function(e){Ne(t,qe(e),i._handlers[e])},i)}Vr.call(this),this.dom=t,this._touching=!1,this._touchTimer,this._gestureMgr=new ta,this._handlers={},Ge(this),xr.pointerEventsSupported?e(aa,this):(xr.touchEventsSupported&&e(ra,this),e(ia,this))}function Qe(t,e){la[t]=e}function $e(t){delete ua[t]}function Ke(t){return t>-pa&&tpa||t<-pa}function ti(t,e,i,r,n){var a=1-n;return a*a*(a*t+3*n*e)+n*n*(n*r+3*a*i)}function ei(t,e,i,r,n){var a=1-n;return 3*(((e-t)*a+2*(i-e)*n)*a+(r-i)*n*n)}function ii(t,e,i,r,n,a){var o=r+3*(e-i)-t,s=3*(i-2*e+t),h=3*(e-t),l=t-n,u=s*s-3*o*h,c=s*h-9*o*l,f=h*h-3*s*l,d=0;if(Ke(u)&&Ke(c))Ke(s)?a[0]=0:(T=-h/s)>=0&&T<=1&&(a[d++]=T);else{var p=c*c-4*u*f;if(Ke(p)){var v=c/u,g=-v/2;(T=-s/o+v)>=0&&T<=1&&(a[d++]=T),g>=0&&g<=1&&(a[d++]=g)}else if(p>0){var _=da(p),m=u*s+1.5*o*(-c+_),y=u*s+1.5*o*(-c-_);(T=(-s-((m=m<0?-fa(-m,_a):fa(m,_a))+(y=y<0?-fa(-y,_a):fa(y,_a))))/(3*o))>=0&&T<=1&&(a[d++]=T)}else{var x=(2*u*s-3*o*c)/(2*da(u*u*u)),w=Math.acos(x)/3,b=da(u),k=Math.cos(w),T=(-s-2*b*k)/(3*o),g=(-s+b*(k+ga*Math.sin(w)))/(3*o),M=(-s+b*(k-ga*Math.sin(w)))/(3*o);T>=0&&T<=1&&(a[d++]=T),g>=0&&g<=1&&(a[d++]=g),M>=0&&M<=1&&(a[d++]=M)}}return d}function ri(t,e,i,r,n){var a=6*i-12*e+6*t,o=9*e+3*r-3*t-9*i,s=3*e-3*t,h=0;if(Ke(o))Je(a)&&(c=-s/a)>=0&&c<=1&&(n[h++]=c);else{var l=a*a-4*o*s;if(Ke(l))n[0]=-a/(2*o);else if(l>0){var u=da(l),c=(-a+u)/(2*o),f=(-a-u)/(2*o);c>=0&&c<=1&&(n[h++]=c),f>=0&&f<=1&&(n[h++]=f)}}return h}function ni(t,e,i,r,n,a){var o=(e-t)*n+t,s=(i-e)*n+e,h=(r-i)*n+i,l=(s-o)*n+o,u=(h-s)*n+s,c=(u-l)*n+l;a[0]=t,a[1]=o,a[2]=l,a[3]=c,a[4]=c,a[5]=u,a[6]=h,a[7]=r}function ai(t,e,i,r,n,a,o,s,h,l,u){var c,f,d,p,v,g=.005,_=1/0;ma[0]=h,ma[1]=l;for(var m=0;m<1;m+=.05)ya[0]=ti(t,i,n,o,m),ya[1]=ti(e,r,a,s,m),(p=Fr(ma,ya))<_&&(c=m,_=p);_=1/0;for(var y=0;y<32&&!(g=0&&p<_?(c=f,_=p):(xa[0]=ti(t,i,n,o,d),xa[1]=ti(e,r,a,s,d),v=Fr(xa,ma),d<=1&&v<_?(c=d,_=v):g*=.5);return u&&(u[0]=ti(t,i,n,o,c),u[1]=ti(e,r,a,s,c)),da(_)}function oi(t,e,i,r){var n=1-r;return n*(n*t+2*r*e)+r*r*i}function si(t,e,i,r){return 2*((1-r)*(e-t)+r*(i-e))}function hi(t,e,i,r,n){var a=t-2*e+i,o=2*(e-t),s=t-r,h=0;if(Ke(a))Je(o)&&(c=-s/o)>=0&&c<=1&&(n[h++]=c);else{var l=o*o-4*a*s;if(Ke(l))(c=-o/(2*a))>=0&&c<=1&&(n[h++]=c);else if(l>0){var u=da(l),c=(-o+u)/(2*a),f=(-o-u)/(2*a);c>=0&&c<=1&&(n[h++]=c),f>=0&&f<=1&&(n[h++]=f)}}return h}function li(t,e,i){var r=t+i-2*e;return 0===r?.5:(t-e)/r}function ui(t,e,i,r,n){var a=(e-t)*r+t,o=(i-e)*r+e,s=(o-a)*r+a;n[0]=t,n[1]=a,n[2]=s,n[3]=s,n[4]=o,n[5]=i}function ci(t,e,i,r,n,a,o,s,h){var l,u=.005,c=1/0;ma[0]=o,ma[1]=s;for(var f=0;f<1;f+=.05)ya[0]=oi(t,i,n,f),ya[1]=oi(e,r,a,f),(g=Fr(ma,ya))=0&&g1e-4)return s[0]=t-i,s[1]=e-r,h[0]=t+i,void(h[1]=e+r);if(Sa[0]=Ta(n)*i+t,Sa[1]=ka(n)*r+e,Ca[0]=Ta(a)*i+t,Ca[1]=ka(a)*r+e,l(s,Sa,Ca),u(h,Sa,Ca),(n%=Ma)<0&&(n+=Ma),(a%=Ma)<0&&(a+=Ma),n>a&&!o?a+=Ma:nn&&(Pa[0]=Ta(d)*i+t,Pa[1]=ka(d)*r+e,l(s,Pa,s),u(h,Pa,h))}function gi(t,e,i,r,n,a,o){if(0===n)return!1;var s=n,h=0,l=t;if(o>e+s&&o>r+s||ot+s&&a>i+s||ae+c&&u>r+c&&u>a+c&&u>s+c||ut+c&&l>i+c&&l>n+c&&l>o+c||le+l&&h>r+l&&h>a+l||ht+l&&s>i+l&&s>n+l||si||u+ln&&(n+=Xa);var f=Math.atan2(h,s);return f<0&&(f+=Xa),f>=r&&f<=n||f+Xa>=r&&f+Xa<=n}function wi(t,e,i,r,n,a){if(a>e&&a>r||an?o:0}function bi(t,e){return Math.abs(t-e)e&&l>r&&l>a&&l>s||l1&&ki(),c=ti(e,r,a,s,Qa[0]),p>1&&(f=ti(e,r,a,s,Qa[1]))),2==p?ge&&s>r&&s>a||s=0&&l<=1){for(var u=0,c=oi(e,r,a,l),f=0;fi||s<-i)return 0;l=Math.sqrt(i*i-s*s);Za[0]=-l,Za[1]=l;var h=Math.abs(r-n);if(h<1e-4)return 0;if(h%Ya<1e-4){r=0,n=Ya;p=a?1:-1;return o>=Za[0]+t&&o<=Za[1]+t?p:0}if(a){var l=r;r=yi(n),n=yi(l)}else r=yi(r),n=yi(n);r>n&&(n+=Ya);for(var u=0,c=0;c<2;c++){var f=Za[c];if(f+t>o){var d=Math.atan2(s,f),p=a?1:-1;d<0&&(d=Ya+d),(d>=r&&d<=n||d+Ya>=r&&d+Ya<=n)&&(d>Math.PI/2&&d<1.5*Math.PI&&(p=-p),u+=p)}}return u}function Ci(t,e,i,r,n){for(var a=0,o=0,s=0,h=0,l=0,u=0;u1&&(i||(a+=wi(o,s,h,l,r,n))),1==u&&(h=o=t[u],l=s=t[u+1]),c){case Ua.M:o=h=t[u++],s=l=t[u++];break;case Ua.L:if(i){if(gi(o,s,t[u],t[u+1],e,r,n))return!0}else a+=wi(o,s,t[u],t[u+1],r,n)||0;o=t[u++],s=t[u++];break;case Ua.C:if(i){if(_i(o,s,t[u++],t[u++],t[u++],t[u++],t[u],t[u+1],e,r,n))return!0}else a+=Ti(o,s,t[u++],t[u++],t[u++],t[u++],t[u],t[u+1],r,n)||0;o=t[u++],s=t[u++];break;case Ua.Q:if(i){if(mi(o,s,t[u++],t[u++],t[u],t[u+1],e,r,n))return!0}else a+=Mi(o,s,t[u++],t[u++],t[u],t[u+1],r,n)||0;o=t[u++],s=t[u++];break;case Ua.A:var f=t[u++],d=t[u++],p=t[u++],v=t[u++],g=t[u++],_=t[u++],m=(t[u++],1-t[u++]),y=Math.cos(g)*p+f,x=Math.sin(g)*v+d;u>1?a+=wi(o,s,y,x,r,n):(h=y,l=x);var w=(r-f)*v/p+f;if(i){if(xi(f,d,v,g,g+_,m,e,w,n))return!0}else a+=Si(f,d,v,g,g+_,m,w,n);o=Math.cos(g+_)*p+f,s=Math.sin(g+_)*v+d;break;case Ua.R:h=o=t[u++],l=s=t[u++];var y=h+t[u++],x=l+t[u++];if(i){if(gi(h,l,y,l,e,r,n)||gi(y,l,y,x,e,r,n)||gi(y,x,h,x,e,r,n)||gi(h,x,h,l,e,r,n))return!0}else a+=wi(y,l,y,x,r,n),a+=wi(h,x,h,l,r,n);break;case Ua.Z:if(i){if(gi(o,s,h,l,e,r,n))return!0}else a+=wi(o,s,h,l,r,n);o=h,s=l}}return i||bi(s,l)||(a+=wi(o,s,h,l,r,n)||0),0!==a}function Pi(t,e,i){return Ci(t,0,!1,e,i)}function Li(t,e,i,r){return Ci(t,e,!0,i,r)}function Ai(t){Pe.call(this,t),this.path=null}function zi(t,e,i,r,n,a,o,s,h,l,u){var c=h*(lo/180),f=ho(c)*(t-i)/2+so(c)*(e-r)/2,d=-1*so(c)*(t-i)/2+ho(c)*(e-r)/2,p=f*f/(o*o)+d*d/(s*s);p>1&&(o*=oo(p),s*=oo(p));var v=(n===a?-1:1)*oo((o*o*(s*s)-o*o*(d*d)-s*s*(f*f))/(o*o*(d*d)+s*s*(f*f)))||0,g=v*o*d/s,_=v*-s*f/o,m=(t+i)/2+ho(c)*g-so(c)*_,y=(e+r)/2+so(c)*g+ho(c)*_,x=fo([1,0],[(f-g)/o,(d-_)/s]),w=[(f-g)/o,(d-_)/s],b=[(-1*f-g)/o,(-1*d-_)/s],k=fo(w,b);co(w,b)<=-1&&(k=lo),co(w,b)>=1&&(k=0),0===a&&k>0&&(k-=2*lo),1===a&&k<0&&(k+=2*lo),u.addData(l,m,y,o,s,x,k,c,a)}function Di(t){if(!t)return[];var e,i=t.replace(/-/g," -").replace(/ /g," ").replace(/ /g,",").replace(/,,/g,",");for(e=0;e0&&""===d[0]&&d.shift();for(var p=0;p=2){if(n&&"spline"!==n){var a=zo(r,n,i,e.smoothConstraint);t.moveTo(r[0][0],r[0][1]);for(var o=r.length,s=0;s<(i?o:o-1);s++){var h=a[2*s],l=a[2*s+1],u=r[(s+1)%o];t.bezierCurveTo(h[0],h[1],l[0],l[1],u[0],u[1])}}else{"spline"===n&&(r=Ao(r,i)),t.moveTo(r[0][0],r[0][1]);for(var s=1,c=r.length;s-hs}function Wi(t,e){var i=e?t.textFill:t.fill;return null!=i&&i!==es}function Vi(t,e){var i=e?t.textStroke:t.stroke;return null!=i&&i!==es}function ji(t,e){e&&qi(t,"transform","matrix("+ts.call(e,",")+")")}function qi(t,e,i){(!i||"linear"!==i.type&&"radial"!==i.type)&&("string"==typeof i&&i.indexOf("NaN")>-1&&console.log(i),t.setAttribute(e,i))}function Xi(t,e,i){t.setAttributeNS("http://www.w3.org/1999/xlink",e,i)}function Ui(t,e,i){if(Wi(e,i)){var r=i?e.textFill:e.fill;r="transparent"===r?es:r,"none"!==t.getAttribute("clip-path")&&r===es&&(r="rgba(0, 0, 0, 0.002)"),qi(t,"fill",r),qi(t,"fill-opacity",e.opacity)}else qi(t,"fill",es);if(Vi(e,i)){var n=i?e.textStroke:e.stroke;qi(t,"stroke",n="transparent"===n?es:n),qi(t,"stroke-width",(i?e.textStrokeWidth:e.lineWidth)/(!i&&e.strokeNoScale?e.host.getLineScale():1)),qi(t,"paint-order",i?"stroke":"fill"),qi(t,"stroke-opacity",e.opacity),e.lineDash?(qi(t,"stroke-dasharray",e.lineDash.join(",")),qi(t,"stroke-dashoffset",is(e.lineDashOffset||0))):qi(t,"stroke-dasharray",""),e.lineCap&&qi(t,"stroke-linecap",e.lineCap),e.lineJoin&&qi(t,"stroke-linejoin",e.lineJoin),e.miterLimit&&qi(t,"stroke-miterlimit",e.miterLimit)}else qi(t,"stroke",es)}function Yi(t){for(var e=[],i=t.data,r=t.len(),n=0;n=os||!Ni(v)&&(f>-as&&f<0||f>as)==!!p;var m=Fi(s+l*ns(c)),y=Fi(h+u*rs(c));g&&(f=p?os-1e-4:1e-4-os,_=!0,9===n&&e.push("M",m,y));var x=Fi(s+l*ns(c+f)),w=Fi(h+u*rs(c+f));e.push("A",Fi(l),Fi(u),is(d*ss),+_,+p,x,w);break;case Jo.Z:a="Z";break;case Jo.R:var x=Fi(i[n++]),w=Fi(i[n++]),b=Fi(i[n++]),k=Fi(i[n++]);e.push("M",x,w,"L",x+b,w,"L",x+b,w+k,"L",x,w+k,"L",x,w)}a&&e.push(a);for(var T=0;T=11)}}(navigator.userAgent),wr={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},br={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},kr=Object.prototype.toString,Tr=Array.prototype,Mr=Tr.forEach,Sr=Tr.filter,Cr=Tr.slice,Pr=Tr.map,Lr=Tr.reduce,Ar={},zr=function(){return Ar.createCanvas()};Ar.createCanvas=function(){return document.createElement("canvas")};var Dr,Ir="__ec_primitive__";T.prototype={constructor:T,get:function(t){return this.hasOwnProperty(t)?this[t]:null},set:function(t,e){return this[t]=e},each:function(t,e){void 0!==e&&(t=f(t,e));for(var i in this)this.hasOwnProperty(i)&&t(this[i],i)},removeKey:function(t){delete this[t]}};var Br=(Object.freeze||Object)({$override:function(t,e){"createCanvas"===t&&(Dr=null),Ar[t]=e},clone:e,merge:i,mergeAll:function(t,e){for(var r=t[0],n=1,a=t.length;n3&&(e=Wr.call(e,1));for(var r=this._$handlers[t],n=r.length,a=0;a4&&(e=Wr.call(e,1,e.length-1));for(var r=e[e.length-1],n=this._$handlers[t],a=n.length,o=0;o=0;a--){var o;if(r[a]!==i&&!r[a].ignore&&(o=V(r[a],t,e))&&(!n.topTarget&&(n.topTarget=r[a]),o!==jr)){n.target=r[a];break}}return n}},u(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){Xr.prototype[t]=function(e){var i=this.findHover(e.zrX,e.zrY),r=i.target;if("mousedown"===t)this._downEl=r,this._downPoint=[e.zrX,e.zrY],this._upEl=r;else if("mouseup"===t)this._upEl=r;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||Hr(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,t,e)}}),h(Xr,Vr),h(Xr,H);var Ur="undefined"==typeof Float32Array?Array:Float32Array,Yr=(Object.freeze||Object)({create:j,identity:q,copy:X,mul:U,translate:Y,rotate:G,scale:Z,invert:Q,clone:function(t){var e=j();return X(e,t),e}}),Gr=q,Zr=5e-5,Qr=function(t){(t=t||{}).position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null},$r=Qr.prototype;$r.transform=null,$r.needLocalTransform=function(){return $(this.rotation)||$(this.position[0])||$(this.position[1])||$(this.scale[0]-1)||$(this.scale[1]-1)},$r.updateTransform=function(){var t=this.parent,e=t&&t.transform,i=this.needLocalTransform(),r=this.transform;i||e?(r=r||j(),i?this.getLocalTransform(r):Gr(r),e&&(i?U(r,t.transform,r):X(r,t.transform)),this.transform=r,this.invTransform=this.invTransform||j(),Q(this.invTransform,r)):r&&Gr(r)},$r.getLocalTransform=function(t){return Qr.getLocalTransform(this,t)},$r.setTransform=function(t){var e=this.transform,i=t.dpr||1;e?t.setTransform(i*e[0],i*e[1],i*e[2],i*e[3],i*e[4],i*e[5]):t.setTransform(i,0,0,i,0,0)},$r.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var Kr=[];$r.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(U(Kr,t.invTransform,e),e=Kr);var i=e[0]*e[0]+e[1]*e[1],r=e[2]*e[2]+e[3]*e[3],n=this.position,a=this.scale;$(i-1)&&(i=Math.sqrt(i)),$(r-1)&&(r=Math.sqrt(r)),e[0]<0&&(i=-i),e[3]<0&&(r=-r),n[0]=e[4],n[1]=e[5],a[0]=i,a[1]=r,this.rotation=Math.atan2(-e[1]/r,e[0]/i)}},$r.getGlobalScale=function(){var t=this.transform;if(!t)return[1,1];var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]),i=Math.sqrt(t[2]*t[2]+t[3]*t[3]);return t[0]<0&&(e=-e),t[3]<0&&(i=-i),[e,i]},$r.transformCoordToLocal=function(t,e){var i=[t,e],r=this.invTransform;return r&&R(i,i,r),i},$r.transformCoordToGlobal=function(t,e){var i=[t,e],r=this.transform;return r&&R(i,i,r),i},Qr.getLocalTransform=function(t,e){Gr(e=e||[]);var i=t.origin,r=t.scale||[1,1],n=t.rotation||0,a=t.position||[0,0];return i&&(e[4]-=i[0],e[5]-=i[1]),Z(e,e,r),n&&G(e,e,n),i&&(e[4]+=i[0],e[5]+=i[1]),e[4]+=a[0],e[5]+=a[1],e};var Jr={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-Jr.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*Jr.bounceIn(2*t):.5*Jr.bounceOut(2*t-1)+.5}};K.prototype={constructor:K,step:function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),this._paused)this._pausedTime+=e;else{var i=(t-this._startTime-this._pausedTime)/this._life;if(!(i<0)){i=Math.min(i,1);var r=this.easing,n="string"==typeof r?Jr[r]:r,a="function"==typeof n?n(i):i;return this.fire("frame",a),1==i?this.loop?(this.restart(t),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(t,e){this[t="on"+t]&&this[t](this._target,e)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var tn=function(){this.head=null,this.tail=null,this._len=0},en=tn.prototype;en.insert=function(t){var e=new rn(t);return this.insertEntry(e),e},en.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},en.remove=function(t){var e=t.prev,i=t.next;e?e.next=i:this.head=i,i?i.prev=e:this.tail=e,t.next=t.prev=null,this._len--},en.len=function(){return this._len},en.clear=function(){this.head=this.tail=null,this._len=0};var rn=function(t){this.value=t,this.next,this.prev},nn=function(t){this._list=new tn,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null},an=nn.prototype;an.put=function(t,e){var i=this._list,r=this._map,n=null;if(null==r[t]){var a=i.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=i.head;i.remove(s),delete r[s.key],n=s.value,this._lastRemovedEntry=s}o?o.value=e:o=new rn(e),o.key=t,i.insertEntry(o),r[t]=o}return n},an.get=function(t){var e=this._map[t],i=this._list;if(null!=e)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},an.clear=function(){this._list.clear(),this._map={}};var on={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]},sn=new nn(20),hn=null,ln=ft,un=dt,cn=(Object.freeze||Object)({parse:lt,lift:function(t,e){var i=lt(t);if(i){for(var r=0;r<3;r++)i[r]=e<0?i[r]*(1-e)|0:(255-i[r])*e+i[r]|0,i[r]>255?i[r]=255:t[r]<0&&(i[r]=0);return pt(i,4===i.length?"rgba":"rgb")}},toHex:function(t){var e=lt(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)},fastLerp:ft,fastMapToColor:ln,lerp:dt,mapToColor:un,modifyHSL:function(t,e,i,r){if(t=lt(t))return t=ct(t),null!=e&&(t[0]=tt(e)),null!=i&&(t[1]=rt(i)),null!=r&&(t[2]=rt(r)),pt(ut(t),"rgba")},modifyAlpha:function(t,e){if((t=lt(t))&&null!=e)return t[3]=et(e),pt(t,"rgba")},stringify:pt}),fn=Array.prototype.slice,dn=function(t,e,i,r){this._tracks={},this._target=t,this._loop=e||!1,this._getter=i||vt,this._setter=r||gt,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};dn.prototype={when:function(t,e){var i=this._tracks;for(var r in e)if(e.hasOwnProperty(r)){if(!i[r]){i[r]=[];var n=this._getter(this._target,r);if(null==n)continue;0!==t&&i[r].push({time:0,value:Tt(n)})}i[r].push({time:t,value:e[r]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t0&&this.animate(t,!1).when(null==r?500:r,a).delay(n||0),this}};var yn=function(t){Qr.call(this,t),Vr.call(this,t),mn.call(this,t),this.id=t.id||mr()};yn.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(t,e){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(t,e){},attrKV:function(t,e){if("position"===t||"scale"===t||"origin"===t){if(e){var i=this[t];i||(i=this[t]=[]),i[0]=e[0],i[1]=e[1]}}else this[t]=e},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(g(t))for(var i in t)t.hasOwnProperty(i)&&this.attrKV(i,t[i]);return this.dirty(!1),this},setClipPath:function(t){var e=this.__zr;e&&t.addSelfToZr(e),this.clipPath&&this.clipPath!==t&&this.removeClipPath(),this.clipPath=t,t.__zr=e,t.__clipTarget=this,this.dirty(!1)},removeClipPath:function(){var t=this.clipPath;t&&(t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(t){this.__zr=t;var e=this.animators;if(e)for(var i=0;i=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},clone:function(){return new Pt(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},Pt.create=function(t){return new Pt(t.x,t.y,t.width,t.height)};var kn=function(t){t=t||{},yn.call(this,t);for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);this._children=[],this.__storage=null,this.__dirty=!0};kn.prototype={constructor:kn,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},childOfName:function(t){for(var e=this._children,i=0;i=0&&(i.splice(r,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__storage,i=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),t instanceof kn&&t.addChildrenToStorage(e)),i&&i.refresh()},remove:function(t){var e=this.__zr,i=this.__storage,r=this._children,n=o(r,t);return n<0?this:(r.splice(n,1),t.parent=null,i&&(i.delFromStorage(t),t instanceof kn&&t.delChildrenFromStorage(i)),e&&e.refresh(),this)},removeAll:function(){var t,e,i=this._children,r=this.__storage;for(e=0;e=0&&(this.delFromStorage(t),this._roots.splice(n,1),t instanceof kn&&t.delChildrenFromStorage(this))}},addToStorage:function(t){return t&&(t.__storage=this,t.dirty(!1)),this},delFromStorage:function(t){return t&&(t.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:Ot};var Cn={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1},Pn=function(t,e,i){return Cn.hasOwnProperty(e)?i*=t.dpr:i},Ln=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],An=function(t,e){this.extendFrom(t,!1),this.host=e};An.prototype={constructor:An,host:null,fill:"#000",stroke:null,opacity:1,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(t,e,i){for(var r=this,n=i&&i.style,a=!n,o=0;o0},extendFrom:function(t,e){if(t)for(var i in t)!t.hasOwnProperty(i)||!0!==e&&(!1===e?this.hasOwnProperty(i):null==t[i])||(this[i]=t[i])},set:function(t,e){"string"==typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,i){for(var r=("radial"===e.type?Ft:Ht)(t,e,i),n=e.colorStops,a=0;a=0&&i.splice(r,1),t.__hoverMir=null},clearHover:function(t){for(var e=this._hoverElements,i=0;i15)break}s.__drawIndex=g,s.__drawIndex0&&t>r[0]){for(o=0;ot);o++);a=i[r[o]]}if(r.splice(o+1,0,t),i[t]=e,!e.virtual)if(a){var h=a.dom;h.nextSibling?s.insertBefore(e.dom,h.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)}else _n("Layer of zlevel "+t+" is not valid")},eachLayer:function(t,e){var i,r,n=this._zlevelList;for(r=0;r0?.01:0),this._needsManuallyCompositing),a.__builtin__||_n("ZLevel "+s+" has been used by unkown layer "+a.id),a!==i&&(a.__used=!0,a.__startIndex!==n&&(a.__dirty=!0),a.__startIndex=n,a.incremental?a.__drawIndex=-1:a.__drawIndex=n,e(n),i=a),o.__dirty&&(a.__dirty=!0,a.incremental&&a.__drawIndex<0&&(a.__drawIndex=n))}e(n),this.eachBuiltinLayer(function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(t){t.clear()},setBackgroundColor:function(t){this._backgroundColor=t},configLayer:function(t,e){if(e){var r=this._layerConfig;r[t]?i(r[t],e,!0):r[t]=e;for(var n=0;n=0&&this._clips.splice(e,1)},removeAnimator:function(t){for(var e=t.getClips(),i=0;i1&&r&&r.length>1){var a=Ve(r)/Ve(n);!isFinite(a)&&(a=1),e.pinchScale=a;var o=je(r);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:t[0].target,event:e}}}}},ia=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],ra=["touchstart","touchend","touchmove"],na={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},aa=c(ia,function(t){var e=t.replace("mouse","pointer");return na[e]?e:t}),oa={mousemove:function(t){t=Fe(this.dom,t),this.trigger("mousemove",t)},mouseout:function(t){var e=(t=Fe(this.dom,t)).toElement||t.relatedTarget;if(e!=this.dom)for(;e&&9!=e.nodeType;){if(e===this.dom)return;e=e.parentNode}this.trigger("mouseout",t)},touchstart:function(t){(t=Fe(this.dom,t)).zrByTouch=!0,this._lastTouchMoment=new Date,Xe(this,t,"start"),oa.mousemove.call(this,t),oa.mousedown.call(this,t),Ue(this)},touchmove:function(t){(t=Fe(this.dom,t)).zrByTouch=!0,Xe(this,t,"change"),oa.mousemove.call(this,t),Ue(this)},touchend:function(t){(t=Fe(this.dom,t)).zrByTouch=!0,Xe(this,t,"end"),oa.mouseup.call(this,t),+new Date-this._lastTouchMoment<300&&oa.click.call(this,t),Ue(this)},pointerdown:function(t){oa.mousedown.call(this,t)},pointermove:function(t){Ye(t)||oa.mousemove.call(this,t)},pointerup:function(t){oa.mouseup.call(this,t)},pointerout:function(t){Ye(t)||oa.mouseout.call(this,t)}};u(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){oa[t]=function(e){e=Fe(this.dom,e),this.trigger(t,e)}});var sa=Ze.prototype;sa.dispose=function(){for(var t=ia.concat(ra),e=0;ethis._ux||Wa(e-this._yi)>this._uy||this._len<5;return this.addData(za.L,t,e),this._ctx&&i&&(this._needsDash()?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),i&&(this._xi=t,this._yi=e),this},bezierCurveTo:function(t,e,i,r,n,a){return this.addData(za.C,t,e,i,r,n,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,i,r,n,a):this._ctx.bezierCurveTo(t,e,i,r,n,a)),this._xi=n,this._yi=a,this},quadraticCurveTo:function(t,e,i,r){return this.addData(za.Q,t,e,i,r),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,i,r):this._ctx.quadraticCurveTo(t,e,i,r)),this._xi=i,this._yi=r,this},arc:function(t,e,i,r,n,a){return this.addData(za.A,t,e,i,i,r,n-r,0,a?0:1),this._ctx&&this._ctx.arc(t,e,i,r,n,a),this._xi=Ha(n)*i+t,this._yi=Fa(n)*i+t,this},arcTo:function(t,e,i,r,n){return this._ctx&&this._ctx.arcTo(t,e,i,r,n),this},rect:function(t,e,i,r){return this._ctx&&this._ctx.rect(t,e,i,r),this.addData(za.R,t,e,i,r),this},closePath:function(){this.addData(za.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,i),t.closePath()),this._xi=e,this._yi=i,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if(t instanceof Array){this._lineDash=t,this._dashIdx=0;for(var e=0,i=0;ie.length&&(this._expandData(),e=this.data);for(var i=0;i0&&d<=t||u<0&&d>=t||0==u&&(c>0&&p<=e||c<0&&p>=e);)d+=u*(i=o[r=this._dashIdx]),p+=c*i,this._dashIdx=(r+1)%v,u>0&&dh||c>0&&pl||s[r%2?"moveTo":"lineTo"](u>=0?Ea(d,t):Oa(d,t),c>=0?Ea(p,e):Oa(p,e));u=d-t,c=p-e,this._dashOffset=-Na(u*u+c*c)},_dashedBezierTo:function(t,e,i,r,n,a){var o,s,h,l,u,c=this._dashSum,f=this._dashOffset,d=this._lineDash,p=this._ctx,v=this._xi,g=this._yi,_=ti,m=0,y=this._dashIdx,x=d.length,w=0;for(f<0&&(f=c+f),f%=c,o=0;o<1;o+=.1)s=_(v,t,i,n,o+.1)-_(v,t,i,n,o),h=_(g,e,r,a,o+.1)-_(g,e,r,a,o),m+=Na(s*s+h*h);for(;yf);y++);for(o=(w-f)/m;o<=1;)l=_(v,t,i,n,o),u=_(g,e,r,a,o),y%2?p.moveTo(l,u):p.lineTo(l,u),o+=d[y]/m,y=(y+1)%x;y%2!=0&&p.lineTo(n,a),s=n-l,h=a-u,this._dashOffset=-Na(s*s+h*h)},_dashedQuadraticTo:function(t,e,i,r){var n=i,a=r;i=(i+2*t)/3,r=(r+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,i,r,n,a)},toStatic:function(){var t=this.data;t instanceof Array&&(t.length=this._len,Va&&(this.data=new Float32Array(t)))},getBoundingRect:function(){Da[0]=Da[1]=Ba[0]=Ba[1]=Number.MAX_VALUE,Ia[0]=Ia[1]=Ra[0]=Ra[1]=-Number.MAX_VALUE;for(var t=this.data,e=0,i=0,r=0,n=0,a=0;ah||Wa(o-n)>l||c===u-1)&&(t.lineTo(a,o),r=a,n=o);break;case za.C:t.bezierCurveTo(s[c++],s[c++],s[c++],s[c++],s[c++],s[c++]),r=s[c-2],n=s[c-1];break;case za.Q:t.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),r=s[c-2],n=s[c-1];break;case za.A:var d=s[c++],p=s[c++],v=s[c++],g=s[c++],_=s[c++],m=s[c++],y=s[c++],x=s[c++],w=v>g?v:g,b=v>g?1:v/g,k=v>g?g/v:1,T=_+m;Math.abs(v-g)>.001?(t.translate(d,p),t.rotate(y),t.scale(b,k),t.arc(0,0,w,_,T,1-x),t.scale(1/b,1/k),t.rotate(-y),t.translate(-d,-p)):t.arc(d,p,w,_,T,1-x),1==c&&(e=Ha(_)*v+d,i=Fa(_)*g+p),r=Ha(T)*v+d,n=Fa(T)*g+p;break;case za.R:e=r=s[c],i=n=s[c+1],t.rect(s[c++],s[c++],s[c++],s[c++]);break;case za.Z:t.closePath(),r=e,n=i}}}},ja.CMD=za;var qa=2*Math.PI,Xa=2*Math.PI,Ua=ja.CMD,Ya=2*Math.PI,Ga=1e-4,Za=[-1,-1,-1],Qa=[-1,-1],$a=Bn.prototype.getCanvasPattern,Ka=Math.abs,Ja=new ja(!0);Ai.prototype={constructor:Ai,type:"path",__dirtyPath:!0,strokeContainThreshold:5,brush:function(t,e){var i=this.style,r=this.path||Ja,n=i.hasStroke(),a=i.hasFill(),o=i.fill,s=i.stroke,h=a&&!!o.colorStops,l=n&&!!s.colorStops,u=a&&!!o.image,c=n&&!!s.image;if(i.bind(t,this,e),this.setTransform(t),this.__dirty){var f;h&&(f=f||this.getBoundingRect(),this._fillGradient=i.getGradient(t,o,f)),l&&(f=f||this.getBoundingRect(),this._strokeGradient=i.getGradient(t,s,f))}h?t.fillStyle=this._fillGradient:u&&(t.fillStyle=$a.call(o,t)),l?t.strokeStyle=this._strokeGradient:c&&(t.strokeStyle=$a.call(s,t));var d=i.lineDash,p=i.lineDashOffset,v=!!t.setLineDash,g=this.getGlobalScale();r.setScale(g[0],g[1]),this.__dirtyPath||d&&!v&&n?(r.beginPath(t),d&&!v&&(r.setLineDash(d),r.setLineDashOffset(p)),this.buildPath(r,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(t.beginPath(),this.path.rebuildPath(t)),a&&r.fill(t),d&&v&&(t.setLineDash(d),t.lineDashOffset=p),n&&r.stroke(t),d&&v&&t.setLineDash([]),null!=i.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))},buildPath:function(t,e,i){},createPathProxy:function(){this.path=new ja},getBoundingRect:function(){var t=this._rect,e=this.style,i=!t;if(i){var r=this.path;r||(r=this.path=new ja),this.__dirtyPath&&(r.beginPath(),this.buildPath(r,this.shape,!1)),t=r.getBoundingRect()}if(this._rect=t,e.hasStroke()){var n=this._rectWithStroke||(this._rectWithStroke=t.clone());if(this.__dirty||i){n.copy(t);var a=e.lineWidth,o=e.strokeNoScale?this.getLineScale():1;e.hasFill()||(a=Math.max(a,this.strokeContainThreshold||4)),o>1e-10&&(n.width+=a/o,n.height+=a/o,n.x-=a/o/2,n.y-=a/o/2)}return n}return t},contain:function(t,e){var i=this.transformCoordToLocal(t,e),r=this.getBoundingRect(),n=this.style;if(t=i[0],e=i[1],r.contain(t,e)){var a=this.path.data;if(n.hasStroke()){var o=n.lineWidth,s=n.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(n.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),Li(a,o/s,t,e)))return!0}if(n.hasFill())return Pi(a,t,e)}return!1},dirty:function(t){null==t&&(t=!0),t&&(this.__dirtyPath=t,this._rect=null),this.__dirty=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(t){return this.animate("shape",t)},attrKV:function(t,e){"shape"===t?(this.setShape(e),this.__dirtyPath=!0,this._rect=null):Pe.prototype.attrKV.call(this,t,e)},setShape:function(t,e){var i=this.shape;if(i){if(g(t))for(var r in t)t.hasOwnProperty(r)&&(i[r]=t[r]);else i[t]=e;this.dirty(!0)}return this},getLineScale:function(){var t=this.transform;return t&&Ka(t[0]-1)>1e-10&&Ka(t[3]-1)>1e-10?Math.sqrt(Ka(t[0]*t[3]-t[2]*t[1])):1}},Ai.extend=function(t){var e=function(e){Ai.call(this,e),t.style&&this.style.extendFrom(t.style,!1);var i=t.shape;if(i){this.shape=this.shape||{};var r=this.shape;for(var n in i)!r.hasOwnProperty(n)&&i.hasOwnProperty(n)&&(r[n]=i[n])}t.init&&t.init.call(this,e)};s(e,Ai);for(var i in t)"style"!==i&&"shape"!==i&&(e.prototype[i]=t[i]);return e},s(Ai,Pe);var to=ja.CMD,eo=[[],[],[]],io=Math.sqrt,ro=Math.atan2,no=function(t,e){var i,r,n,a,o,s,h=t.data,l=to.M,u=to.C,c=to.L,f=to.R,d=to.A,p=to.Q;for(n=0,a=0;ni-2?i-1:c+1],l=t[c>i-3?i-1:c+2]);var p=f*f,v=f*p;r.push([Ei(s[0],d[0],h[0],l[0],f,p,v),Ei(s[1],d[1],h[1],l[1],f,p,v)])}return r},zo=function(t,e,i,r){var n,a,o,s,h=[],l=[],u=[],c=[];if(r){o=[1/0,1/0],s=[-1/0,-1/0];for(var f=0,d=t.length;f=11?function(){var e,i=this.__clipPaths,r=this.style;if(i)for(var n=0;n4?a*jo(2*Vo/i)/jo(Vo/i):a/3);var s=Vo/i,h=-Vo/2,l=r+a*jo(h),u=n+a*qo(h);h+=s,t.moveTo(l,u);for(var c,f=0,d=2*i-1;f=n&&l+1>=a){for(var u=[],c=0;c=n&&c+1>=a)return Qi(0,s.components);h[i]=s}else h[i]=void 0}o++}();if(f)return f}},pushComponent:function(t,e,i){var r=t[t.length-1];r&&r.added===e&&r.removed===i?t[t.length-1]={count:r.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i})},extractCommon:function(t,e,i,r){for(var n=e.length,a=i.length,o=t.newPos,s=o-r,h=0;o+1=0;--r)if(e[r]===t)return!0;return!1}),i):null:i[0]},Ki.prototype.update=function(t,e){if(t){var i=this.getDefs(!1);if(t[this._domName]&&i.contains(t[this._domName]))"function"==typeof e&&e(t);else{var r=this.add(t);r&&(t[this._domName]=r)}}},Ki.prototype.addDom=function(t){this.getDefs(!0).appendChild(t)},Ki.prototype.removeDom=function(t){var e=this.getDefs(!1);e&&t[this._domName]&&(e.removeChild(t[this._domName]),t[this._domName]=null)},Ki.prototype.getDoms=function(){var t=this.getDefs(!1);if(!t)return[];var e=[];return u(this._tagNames,function(i){var r=t.getElementsByTagName(i);e=e.concat([].slice.call(r))}),e},Ki.prototype.markAllUnused=function(){var t=this;u(this.getDoms(),function(e){e[t._markLabel]="0"})},Ki.prototype.markUsed=function(t){t&&(t[this._markLabel]="1")},Ki.prototype.removeUnused=function(){var t=this.getDefs(!1);if(t){var e=this;u(this.getDoms(),function(i){"1"!==i[e._markLabel]&&t.removeChild(i)})}},Ki.prototype.getSvgProxy=function(t){return t instanceof Ai?ls:t instanceof Le?us:t instanceof go?cs:ls},Ki.prototype.getTextSvgElement=function(t){return t.__textSvgEl},Ki.prototype.getSvgElement=function(t){return t.__svgEl},s(Ji,Ki),Ji.prototype.addWithoutUpdate=function(t,e){if(e&&e.style){var i=this;u(["fill","stroke"],function(r){if(e.style[r]&&("linear"===e.style[r].type||"radial"===e.style[r].type)){var n,a=e.style[r],o=i.getDefs(!0);a._dom?(n=a._dom,o.contains(a._dom)||i.addDom(n)):n=i.add(a),i.markUsed(e);var s=n.getAttribute("id");t.setAttribute(r,"url(#"+s+")")}})}},Ji.prototype.add=function(t){var e;if("linear"===t.type)e=this.createElement("linearGradient");else{if("radial"!==t.type)return _n("Illegal gradient type."),null;e=this.createElement("radialGradient")}return t.id=t.id||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-gradient-"+t.id),this.updateDom(t,e),this.addDom(e),e},Ji.prototype.update=function(t){var e=this;Ki.prototype.update.call(this,t,function(){var i=t.type,r=t._dom.tagName;"linear"===i&&"linearGradient"===r||"radial"===i&&"radialGradient"===r?e.updateDom(t,t._dom):(e.removeDom(t),e.add(t))})},Ji.prototype.updateDom=function(t,e){if("linear"===t.type)e.setAttribute("x1",t.x),e.setAttribute("y1",t.y),e.setAttribute("x2",t.x2),e.setAttribute("y2",t.y2);else{if("radial"!==t.type)return void _n("Illegal gradient type.");e.setAttribute("cx",t.x),e.setAttribute("cy",t.y),e.setAttribute("r",t.r)}t.global?e.setAttribute("gradientUnits","userSpaceOnUse"):e.setAttribute("gradientUnits","objectBoundingBox"),e.innerHTML="";for(var i=t.colorStops,r=0,n=i.length;r0){var r,n,a=this.getDefs(!0),o=e[0],s=i?"_textDom":"_dom";o[s]?(n=o[s].getAttribute("id"),r=o[s],a.contains(r)||a.appendChild(r)):(n="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(r=this.createElement("clipPath")).setAttribute("id",n),a.appendChild(r),o[s]=r);var h=this.getSvgProxy(o);if(o.transform&&o.parent.invTransform&&!i){var l=Array.prototype.slice.call(o.transform);U(o.transform,o.parent.invTransform,o.transform),h.brush(o),o.transform=l}else h.brush(o);var u=this.getSvgElement(o);r.innerHTML="",r.appendChild(u.cloneNode()),t.setAttribute("clip-path","url(#"+n+")"),e.length>1&&this.updateDom(r,e.slice(1),i)}else t&&t.setAttribute("clip-path","none")},tr.prototype.markUsed=function(t){var e=this;t.__clipPaths&&t.__clipPaths.length>0&&u(t.__clipPaths,function(t){t._dom&&Ki.prototype.markUsed.call(e,t._dom),t._textDom&&Ki.prototype.markUsed.call(e,t._textDom)})},s(er,Ki),er.prototype.addWithoutUpdate=function(t,e){if(e&&ir(e.style)){var i,r=e.style;r._shadowDom?(i=r._shadowDom,this.getDefs(!0).contains(r._shadowDom)||this.addDom(i)):i=this.add(e),this.markUsed(e);var n=i.getAttribute("id");t.style.filter="url(#"+n+")"}},er.prototype.add=function(t){var e=this.createElement("filter"),i=t.style;return i._shadowDomId=i._shadowDomId||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-shadow-"+i._shadowDomId),this.updateDom(t,e),this.addDom(e),e},er.prototype.update=function(t,e){var i=e.style;if(ir(i)){var r=this;Ki.prototype.update.call(this,e,function(t){r.updateDom(e,t._shadowDom)})}else this.remove(t,i)},er.prototype.remove=function(t,e){null!=e._shadowDomId&&(this.removeDom(e),t.style.filter="")},er.prototype.updateDom=function(t,e){var i=e.getElementsByTagName("feDropShadow");i=0===i.length?this.createElement("feDropShadow"):i[0];var r,n,a,o,s=t.style,h=t.scale?t.scale[0]||1:1,l=t.scale?t.scale[1]||1:1;if(s.shadowBlur||s.shadowOffsetX||s.shadowOffsetY)r=s.shadowOffsetX||0,n=s.shadowOffsetY||0,a=s.shadowBlur,o=s.shadowColor;else{if(!s.textShadowBlur)return void this.removeDom(e,s);r=s.textShadowOffsetX||0,n=s.textShadowOffsetY||0,a=s.textShadowBlur,o=s.textShadowColor}i.setAttribute("dx",r/h),i.setAttribute("dy",n/l),i.setAttribute("flood-color",o);var u=a/2/h+" "+a/2/l;i.setAttribute("stdDeviation",u),e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width",Math.ceil(a/2*200)+"%"),e.setAttribute("height",Math.ceil(a/2*200)+"%"),e.appendChild(i),s._shadowDom=e},er.prototype.markUsed=function(t){var e=t.style;e&&e._shadowDom&&Ki.prototype.markUsed.call(this,e._shadowDom)};var gs=function(t,e,i,n){this.root=t,this.storage=e,this._opts=i=r({},i||{});var a=Hi("svg");a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("version","1.1"),a.setAttribute("baseProfile","full"),a.style.cssText="user-select:none;position:absolute;left:0;top:0;",this.gradientManager=new Ji(n,a),this.clipPathManager=new tr(n,a),this.shadowManager=new er(n,a);var o=document.createElement("div");o.style.cssText="overflow:hidden;position:relative",this._svgRoot=a,this._viewport=o,t.appendChild(o),o.appendChild(a),this.resize(i.width,i.height),this._visibleList=[]};gs.prototype={constructor:gs,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(){var t=this.storage.getDisplayList(!0);this._paintList(t)},setBackgroundColor:function(t){this._viewport.style.background=t},_paintList:function(t){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var e,i=this._svgRoot,r=this._visibleList,n=t.length,a=[];for(e=0;e=0;--r)if(e[r]===t)return!0;return!1}),i):null:i[0]},resize:function(t,e){var i=this._viewport;i.style.display="none";var r=this._opts;if(null!=t&&(r.width=t),null!=e&&(r.height=e),t=this._getSize(0),e=this._getSize(1),i.style.display="",this._width!==t||this._height!==e){this._width=t,this._height=e;var n=i.style;n.width=t+"px",n.height=e+"px";var a=this._svgRoot;a.setAttribute("width",t),a.setAttribute("height",e)}},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(t){var e=this._opts,i=["width","height"][t],r=["clientWidth","clientHeight"][t],n=["paddingLeft","paddingTop"][t],a=["paddingRight","paddingBottom"][t];if(null!=e[i]&&"auto"!==e[i])return parseFloat(e[i]);var o=this.root,s=document.defaultView.getComputedStyle(o);return(o[r]||rr(s[i])||rr(o.style[i]))-(rr(s[n])||0)-(rr(s[a])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},pathToDataUrl:function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+this._svgRoot.outerHTML}},u(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],function(t){gs.prototype[t]=cr(t)}),Qe("svg",gs);var _s,ms="urn:schemas-microsoft-com:vml",ys="undefined"==typeof window?null:window,xs=!1,ws=ys&&ys.document;if(ws&&!xr.canvasSupported)try{!ws.namespaces.zrvml&&ws.namespaces.add("zrvml",ms),_s=function(t){return ws.createElement("')}}catch(t){_s=function(t){return ws.createElement("<"+t+' xmlns="'+ms+'" class="zrvml">')}}var bs=ja.CMD,ks=Math.round,Ts=Math.sqrt,Ms=Math.abs,Ss=Math.cos,Cs=Math.sin,Ps=Math.max;if(!xr.canvasSupported){var Ls=21600,As=Ls/2,zs=function(t){t.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",t.coordsize=Ls+","+Ls,t.coordorigin="0,0"},Ds=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""")},Is=function(t,e,i){return"rgb("+[t,e,i].join(",")+")"},Bs=function(t,e){e&&t&&e.parentNode!==t&&t.appendChild(e)},Rs=function(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)},Es=function(t,e,i){return 1e5*(parseFloat(t)||0)+1e3*(parseFloat(e)||0)+i},Os=function(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t},Hs=function(t,e,i){var r=lt(e);i=+i,isNaN(i)&&(i=1),r&&(t.color=Is(r[0],r[1],r[2]),t.opacity=i*r[3])},Fs=function(t){var e=lt(t);return[Is(e[0],e[1],e[2]),e[3]]},Ns=function(t,e,i){var r=e.fill;if(null!=r)if(r instanceof Zo){var n,a=0,o=[0,0],s=0,h=1,l=i.getBoundingRect(),u=l.width,c=l.height;if("linear"===r.type){n="gradient";var f=i.transform,d=[r.x*u,r.y*c],p=[r.x2*u,r.y2*c];f&&(R(d,d,f),R(p,p,f));var v=p[0]-d[0],g=p[1]-d[1];(a=180*Math.atan2(v,g)/Math.PI)<0&&(a+=360),a<1e-6&&(a=0)}else{n="gradientradial";var d=[r.x*u,r.y*c],f=i.transform,_=i.scale,m=u,y=c;o=[(d[0]-l.x)/m,(d[1]-l.y)/y],f&&R(d,d,f),m/=_[0]*Ls,y/=_[1]*Ls;var x=Ps(m,y);s=0/x,h=2*r.r/x-s}var w=r.colorStops.slice();w.sort(function(t,e){return t.offset-e.offset});for(var b=w.length,k=[],T=[],M=0;M=2){var P=k[0][0],L=k[1][0],A=k[0][1]*e.opacity,z=k[1][1]*e.opacity;t.type=n,t.method="none",t.focus="100%",t.angle=a,t.color=P,t.color2=L,t.colors=T.join(","),t.opacity=z,t.opacity2=A}"radial"===n&&(t.focusposition=o.join(","))}else Hs(t,r,e.opacity)},Ws=function(t,e){null!=e.lineDash&&(t.dashstyle=e.lineDash.join(" ")),null==e.stroke||e.stroke instanceof Zo||Hs(t,e.stroke,e.opacity)},Vs=function(t,e,i,r){var n="fill"==e,a=t.getElementsByTagName(e)[0];null!=i[e]&&"none"!==i[e]&&(n||!n&&i.lineWidth)?(t[n?"filled":"stroked"]="true",i[e]instanceof Zo&&Rs(t,a),a||(a=fr(e)),n?Ns(a,i,r):Ws(a,i),Bs(t,a)):(t[n?"filled":"stroked"]="false",Rs(t,a))},js=[[],[],[]],qs=function(t,e){var i,r,n,a,o,s,h=bs.M,l=bs.C,u=bs.L,c=bs.A,f=bs.Q,d=[],p=t.data,v=t.len();for(a=0;a.01?I&&(B+=.0125):Math.abs(E-P)<1e-4?I&&BC?y-=.0125:y+=.0125:I&&EP?m+=.0125:m-=.0125),d.push(O,ks(((C-L)*T+b)*Ls-As),",",ks(((P-A)*M+k)*Ls-As),",",ks(((C+L)*T+b)*Ls-As),",",ks(((P+A)*M+k)*Ls-As),",",ks((B*T+b)*Ls-As),",",ks((E*M+k)*Ls-As),",",ks((m*T+b)*Ls-As),",",ks((y*M+k)*Ls-As)),o=m,s=y;break;case bs.R:var H=js[0],F=js[1];H[0]=p[a++],H[1]=p[a++],F[0]=H[0]+p[a++],F[1]=H[1]+p[a++],e&&(R(H,H,e),R(F,F,e)),H[0]=ks(H[0]*Ls-As),F[0]=ks(F[0]*Ls-As),H[1]=ks(H[1]*Ls-As),F[1]=ks(F[1]*Ls-As),d.push(" m ",H[0],",",H[1]," l ",F[0],",",H[1]," l ",F[0],",",F[1]," l ",H[0],",",F[1]);break;case bs.Z:d.push(" x ")}if(i>0){d.push(r);for(var N=0;N100&&(Gs=0,Ys={});var i,r=Zs.style;try{r.font=t,i=r.fontFamily.split(",")[0]}catch(t){}e={style:r.fontStyle||"normal",variant:r.fontVariant||"normal",weight:r.fontWeight||"normal",size:0|parseFloat(r.fontSize||12),family:i||"Microsoft YaHei"},Ys[t]=e,Gs++}return e};!function(t,e){jn[t]=e}("measureText",function(t,e){var i=ws;Us||((Us=i.createElement("div")).style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",ws.body.appendChild(Us));try{Us.style.font=e}catch(t){}return Us.innerHTML="",Us.appendChild(i.createTextNode(t)),{width:Us.offsetWidth}});for(var $s=new Pt,Ks=[Yn,Pe,Le,Ai,go],Js=0;Js