d&&(d=x,g<_?se.set(ve,0,-g):se.set(ve,0,_)):m=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},t.applyTransform=function(e,r,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var n=i[0],o=i[3],a=i[4],s=i[5];return e.x=r.x*n+a,e.y=r.y*o+s,e.width=r.width*n,e.height=r.height*o,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}ue.x=fe.x=r.x,ue.y=pe.y=r.y,ce.x=pe.x=r.x+r.width,ce.y=fe.y=r.y+r.height,ue.transform(i),pe.transform(i),ce.transform(i),fe.transform(i),e.x=he(ue.x,ce.x,fe.x,pe.x),e.y=he(ue.y,ce.y,fe.y,pe.y);var h=le(ue.x,ce.x,fe.x,pe.x),l=le(ue.y,ce.y,fe.y,pe.y);e.width=h-e.x,e.height=l-e.y}else e!==r&&t.copy(e,r)},t}(),ge="silent";function _e(){!function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}(this.event)}var me=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return ft(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Rt),xe=function(t,e){this.x=t,this.y=e},we=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],be=new ye(0,0,0,0),Se=function(t){function e(e,r,i,n,o){var a=t.call(this)||this;return a._hovered=new xe(0,0),a.storage=e,a.painter=r,a.painterRoot=n,a._pointerSize=o,i=i||new me,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new It(a),a}return ft(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(D(we,(function(e){t.on&&t.on(e,this[e],this)}),this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,r=t.zrY,i=Ce(this,e,r),n=this._hovered,o=n.target;o&&!o.__zr&&(o=(n=this.findHover(n.x,n.y)).target);var a=this._hovered=i?new xe(e,r):this.findHover(e,r),s=a.target,h=this.proxy;h.setCursor&&h.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(n,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==o&&this.dispatchToElement(a,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new xe(0,0)},e.prototype.dispatch=function(t,e){var r=this[t];r&&r.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,r){var i=(t=t||{}).target;if(!i||!i.silent){for(var n="on"+e,o=function(t,e,r){return{type:t,event:r,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:r.zrX,offsetY:r.zrY,gestureEvent:r.gestureEvent,pinchX:r.pinchX,pinchY:r.pinchY,pinchScale:r.pinchScale,wheelDelta:r.zrDelta,zrByTouch:r.zrByTouch,which:r.which,stop:_e}}(e,t,r);i&&(i[n]&&(o.cancelBubble=!!i[n].call(i,o)),i.trigger(e,o),i=i.__hostTarget?i.__hostTarget:i.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer((function(t){"function"==typeof t[n]&&t[n].call(t,o),t.trigger&&t.trigger(e,o)})))}},e.prototype.findHover=function(t,e,r){var i=this.storage.getDisplayList(),n=new xe(t,e);if(Te(i,n,t,e,r),this._pointerSize&&!n.target){for(var o=[],a=this._pointerSize,s=a/2,h=new ye(t-s,e-s,a,a),l=i.length-1;l>=0;l--){var u=i[l];u===r||u.ignore||u.ignoreCoarsePointer||u.parent&&u.parent.ignoreCoarsePointer||(be.copy(u.getBoundingRect()),u.transform&&be.applyTransform(u.transform),be.intersect(h)&&o.push(u))}if(o.length)for(var c=Math.PI/12,f=2*Math.PI,p=0;p=0;o--){var a=t[o],s=void 0;if(a!==n&&!a.ignore&&(s=ke(a,r,i))&&(!e.topTarget&&(e.topTarget=a),s!==ge)){e.target=a;break}}}function Ce(t,e,r){var i=t.painter;return e<0||e>i.getWidth()||r<0||r>i.getHeight()}function Pe(t,e,r,i){var n=e+1;if(n===r)return 1;if(i(t[n++],t[e])<0){for(;n=0;)n++;return n-e}function Me(t,e,r,i,n){for(i===e&&i++;i>>1])<0?h=o:s=o+1;var l=i-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]=a}}function Ae(t,e,r,i,n,o){var a=0,s=0,h=1;if(o(t,e[r+n])>0){for(s=i-n;h0;)a=h,(h=1+(h<<1))<=0&&(h=s);h>s&&(h=s),a+=n,h+=n}else{for(s=n+1;hs&&(h=s);var l=a;a=n-h,h=n-l}for(a++;a>>1);o(t,e[r+u])>0?a=u+1:h=u}return h}function Le(t,e,r,i,n,o){var a=0,s=0,h=1;if(o(t,e[r+n])<0){for(s=n+1;hs&&(h=s);var l=a;a=n-h,h=n-l}else{for(s=i-n;h=0;)a=h,(h=1+(h<<1))<=0&&(h=s);h>s&&(h=s),a+=n,h+=n}for(a++;a>>1);o(t,e[r+u])<0?h=u:a=u+1}return h}function De(t,e){var r,i,n=7,o=0;t.length;var a=[];function s(s){var h=r[s],l=i[s],u=r[s+1],c=i[s+1];i[s]=l+c,s===o-3&&(r[s+1]=r[s+2],i[s+1]=i[s+2]),o--;var f=Le(t[u],t,h,l,0,e);h+=f,0!=(l-=f)&&0!==(c=Ae(t[h+l-1],t,u,c,c-1,e))&&(l<=c?function(r,i,o,s){var h=0;for(h=0;h=7||p>=7);if(d)break;v<0&&(v=0),v+=2}if((n=v)<1&&(n=1),1===i){for(h=0;h=0;h--)t[p+h]=t[f+h];if(0===i){g=!0;break}}if(t[c--]=a[u--],1==--s){g=!0;break}if(0!=(y=s-Ae(t[l],a,0,s,s-1,e))){for(s-=y,p=1+(c-=y),f=1+(u-=y),h=0;h=7||y>=7);if(g)break;d<0&&(d=0),d+=2}if((n=d)<1&&(n=1),1===s){for(p=1+(c-=i),f=1+(l-=i),h=i-1;h>=0;h--)t[p+h]=t[f+h];t[c]=a[u]}else{if(0===s)throw new Error;for(f=c-(s-1),h=0;h=0;h--)t[p+h]=t[f+h];t[c]=a[u]}else for(f=c-(s-1),h=0;h1;){var t=o-2;if(t>=1&&i[t-1]<=i[t]+i[t+1]||t>=2&&i[t-2]<=i[t]+i[t-1])i[t-1]i[t+1])break;s(t)}},forceMergeRuns:function(){for(;o>1;){var t=o-2;t>0&&i[t-1]4)return;this._downPoint=null}this.dispatchToElement(r,t,e)}}));var ze=!1;function Ie(){ze||(ze=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Re(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var Oe=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Re}return t.prototype.traverse=function(t,e){for(var r=0;r=32;)e|=1&t,t>>=1;return t+e}(n);do{if((o=Pe(t,r,i,e))s&&(h=s),Me(t,r,r+h,r+o,e),o=h}a.pushRun(r,o),a.mergeRuns(),n-=o,r+=o}while(0!==n);a.forceMergeRuns()}}}(r,Re)},t.prototype._updateAndAddDisplayable=function(t,e,r){if(!t.ignore||r){t.beforeUpdate(),t.update(),t.afterUpdate();var i=t.getClipPath();if(t.ignoreClip)e=null;else if(i){e=e?e.slice():[];for(var n=i,o=t;n;)n.parent=o,n.updateTransform(),e.push(n),o=n,n=n.getClipPath()}if(t.childrenRef){for(var a=t.childrenRef(),s=0;s0&&(l.__clipPaths=[]),isNaN(l.z)&&(Ie(),l.z=0),isNaN(l.z2)&&(Ie(),l.z2=0),isNaN(l.zlevel)&&(Ie(),l.zlevel=0),this._displayList[this._displayListLen++]=l}var u=t.getDecalElement&&t.getDecalElement();u&&this._updateAndAddDisplayable(u,e,r);var c=t.getTextGuideLine();c&&this._updateAndAddDisplayable(c,e,r);var f=t.getTextContent();f&&this._updateAndAddDisplayable(f,e,r)}},t.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},t.prototype.delRoot=function(t){if(t instanceof Array)for(var e=0,r=t.length;e=0&&this._roots.splice(i,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}(),Fe=r.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)},Be={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,r=.1;return 0===t?0:1===t?1:(!r||r<1?(r=1,e=.1):e=.4*Math.asin(1/r)/(2*Math.PI),-r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,r=.1;return 0===t?0:1===t?1:(!r||r<1?(r=1,e=.1):e=.4*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,r=.1,i=.4;return 0===t?0:1===t?1:(!r||r<1?(r=1,e=.1):e=i*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:r*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.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-Be.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*Be.bounceIn(2*t):.5*Be.bounceOut(2*t-1)+.5}},Ee=Math.pow,He=Math.sqrt,Ne=1e-8,We=1e-4,Xe=He(3),qe=1/3,Ye=pt(),je=pt(),Ve=pt();function Ue(t){return t>-1e-8&&tNe||t<-1e-8}function Ze(t,e,r,i,n){var o=1-n;return o*o*(o*t+3*n*e)+n*n*(n*i+3*o*r)}function Ke(t,e,r,i,n){var o=1-n;return 3*(((e-t)*o+2*(r-e)*n)*o+(i-r)*n*n)}function Qe(t,e,r,i,n,o){var a=i+3*(e-r)-t,s=3*(r-2*e+t),h=3*(e-t),l=t-n,u=s*s-3*a*h,c=s*h-9*a*l,f=h*h-3*s*l,p=0;if(Ue(u)&&Ue(c))Ue(s)?o[0]=0:(k=-h/s)>=0&&k<=1&&(o[p++]=k);else{var d=c*c-4*u*f;if(Ue(d)){var v=c/u,y=-v/2;(k=-s/a+v)>=0&&k<=1&&(o[p++]=k),y>=0&&y<=1&&(o[p++]=y)}else if(d>0){var g=He(d),_=u*s+1.5*a*(-c+g),m=u*s+1.5*a*(-c-g);(k=(-s-((_=_<0?-Ee(-_,qe):Ee(_,qe))+(m=m<0?-Ee(-m,qe):Ee(m,qe))))/(3*a))>=0&&k<=1&&(o[p++]=k)}else{var x=(2*u*s-3*a*c)/(2*He(u*u*u)),w=Math.acos(x)/3,b=He(u),S=Math.cos(w),k=(-s-2*b*S)/(3*a),T=(y=(-s+b*(S+Xe*Math.sin(w)))/(3*a),(-s+b*(S-Xe*Math.sin(w)))/(3*a));k>=0&&k<=1&&(o[p++]=k),y>=0&&y<=1&&(o[p++]=y),T>=0&&T<=1&&(o[p++]=T)}}return p}function $e(t,e,r,i,n){var o=6*r-12*e+6*t,a=9*e+3*i-3*t-9*r,s=3*e-3*t,h=0;if(Ue(a))Ge(o)&&(u=-s/o)>=0&&u<=1&&(n[h++]=u);else{var l=o*o-4*a*s;if(Ue(l))n[0]=-o/(2*a);else if(l>0){var u,c=He(l),f=(-o-c)/(2*a);(u=(-o+c)/(2*a))>=0&&u<=1&&(n[h++]=u),f>=0&&f<=1&&(n[h++]=f)}}return h}function Je(t,e,r,i,n,o){var a=(e-t)*n+t,s=(r-e)*n+e,h=(i-r)*n+r,l=(s-a)*n+a,u=(h-s)*n+s,c=(u-l)*n+l;o[0]=t,o[1]=a,o[2]=l,o[3]=c,o[4]=c,o[5]=u,o[6]=h,o[7]=i}function tr(t,e,r,i,n,o,a,s,h){for(var l=t,u=e,c=0,f=1/h,p=1;p<=h;p++){var d=p*f,v=Ze(t,r,n,a,d),y=Ze(e,i,o,s,d),g=v-l,_=y-u;c+=Math.sqrt(g*g+_*_),l=v,u=y}return c}function er(t,e,r,i){var n=1-i;return n*(n*t+2*i*e)+i*i*r}function rr(t,e,r,i){return 2*((1-i)*(e-t)+i*(r-e))}function ir(t,e,r){var i=t+r-2*e;return 0===i?.5:(t-e)/i}function nr(t,e,r,i,n){var o=(e-t)*i+t,a=(r-e)*i+e,s=(a-o)*i+o;n[0]=t,n[1]=o,n[2]=s,n[3]=s,n[4]=a,n[5]=r}function or(t,e,r,i,n,o,a){for(var s=t,h=e,l=0,u=1/a,c=1;c<=a;c++){var f=c*u,p=er(t,r,n,f),d=er(e,i,o,f),v=p-s,y=d-h;l+=Math.sqrt(v*v+y*y),s=p,h=d}return l}var ar=/cubic-bezier\(([0-9,\.e ]+)\)/;function sr(t){var e=t&&ar.exec(t);if(e){var r=e[1].split(","),i=+J(r[0]),n=+J(r[1]),o=+J(r[2]),a=+J(r[3]);if(isNaN(i+n+o+a))return;var s=[];return function(t){return t<=0?0:t>=1?1:Qe(0,i,o,1,t,s)&&Ze(0,n,a,1,s[0])}}}var hr=function(){function t(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||ht,this.ondestroy=t.ondestroy||ht,this.onrestart=t.onrestart||ht,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var r=this._life,i=t-this._startTime-this._pausedTime,n=i/r;n<0&&(n=0),n=Math.min(n,1);var o=this.easingFunc,a=o?o(n):n;if(this.onframe(a),1===n){if(!this.loop)return!0;var s=i%r;this._startTime=t-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=E(t)?t:Be[t]||sr(t)},t}(),lr=function(t){this.value=t},ur=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new lr(t);return this.insertEntry(e),e},t.prototype.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++},t.prototype.remove=function(t){var e=t.prev,r=t.next;e?e.next=r:this.head=r,r?r.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),cr=function(){function t(t){this._list=new ur,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var r=this._list,i=this._map,n=null;if(null==i[t]){var o=r.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=r.head;r.remove(s),delete i[s.key],n=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new lr(e),a.key=t,r.insertEntry(a),i[t]=a}return n},t.prototype.get=function(t){var e=this._map[t],r=this._list;if(null!=e)return e!==r.tail&&(r.remove(e),r.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}(),fr={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]};function pr(t){return(t=Math.round(t))<0?0:t>255?255:t}function dr(t){return t<0?0:t>1?1:t}function vr(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?pr(parseFloat(e)/100*255):pr(parseInt(e,10))}function yr(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?dr(parseFloat(e)/100):dr(parseFloat(e))}function gr(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function _r(t,e,r){return t+(e-t)*r}function mr(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}function xr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var wr=new cr(20),br=null;function Sr(t,e){br&&xr(br,e),br=wr.put(t,br||e.slice())}function kr(t,e){if(t){e=e||[];var r=wr.get(t);if(r)return xr(e,r);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in fr)return xr(e,fr[i]),Sr(t,e),e;var n,o=i.length;if("#"===i.charAt(0))return 4===o||5===o?(n=parseInt(i.slice(1,4),16))>=0&&n<=4095?(mr(e,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,5===o?parseInt(i.slice(4),16)/15:1),Sr(t,e),e):void mr(e,0,0,0,1):7===o||9===o?(n=parseInt(i.slice(1,7),16))>=0&&n<=16777215?(mr(e,(16711680&n)>>16,(65280&n)>>8,255&n,9===o?parseInt(i.slice(7),16)/255:1),Sr(t,e),e):void mr(e,0,0,0,1):void 0;var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===o){var h=i.substr(0,a),l=i.substr(a+1,s-(a+1)).split(","),u=1;switch(h){case"rgba":if(4!==l.length)return 3===l.length?mr(e,+l[0],+l[1],+l[2],1):mr(e,0,0,0,1);u=yr(l.pop());case"rgb":return l.length>=3?(mr(e,vr(l[0]),vr(l[1]),vr(l[2]),3===l.length?u:yr(l[3])),Sr(t,e),e):void mr(e,0,0,0,1);case"hsla":return 4!==l.length?void mr(e,0,0,0,1):(l[3]=yr(l[3]),Tr(l,e),Sr(t,e),e);case"hsl":return 3!==l.length?void mr(e,0,0,0,1):(Tr(l,e),Sr(t,e),e);default:return}}mr(e,0,0,0,1)}}function Tr(t,e){var r=(parseFloat(t[0])%360+360)%360/360,i=yr(t[1]),n=yr(t[2]),o=n<=.5?n*(i+1):n+i-n*i,a=2*n-o;return mr(e=e||[],pr(255*gr(a,o,r+1/3)),pr(255*gr(a,o,r)),pr(255*gr(a,o,r-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Cr(t,e,r){if(e&&e.length&&t>=0&&t<=1){r=r||[];var i=t*(e.length-1),n=Math.floor(i),o=Math.ceil(i),a=e[n],s=e[o],h=i-n;return r[0]=pr(_r(a[0],s[0],h)),r[1]=pr(_r(a[1],s[1],h)),r[2]=pr(_r(a[2],s[2],h)),r[3]=dr(_r(a[3],s[3],h)),r}}var Pr=Cr;function Mr(t,e,r){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),n=Math.floor(i),o=Math.ceil(i),a=kr(e[n]),s=kr(e[o]),h=i-n,l=Lr([pr(_r(a[0],s[0],h)),pr(_r(a[1],s[1],h)),pr(_r(a[2],s[2],h)),dr(_r(a[3],s[3],h))],"rgba");return r?{color:l,leftIndex:n,rightIndex:o,value:i}:l}}var Ar=Mr;function Lr(t,e){if(t&&t.length){var r=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(r+=","+t[3]),e+"("+r+")"}}function Dr(t,e){var r=kr(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}var zr=Object.freeze({__proto__:null,parse:kr,lift:function(t,e){var r=kr(t);if(r){for(var i=0;i<3;i++)r[i]=e<0?r[i]*(1-e)|0:(255-r[i])*e+r[i]|0,r[i]>255?r[i]=255:r[i]<0&&(r[i]=0);return Lr(r,4===r.length?"rgba":"rgb")}},toHex:function(t){var e=kr(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)},fastLerp:Cr,fastMapToColor:Pr,lerp:Mr,mapToColor:Ar,modifyHSL:function(t,e,r,i){var n,o=kr(t);if(t)return o=function(t){if(t){var e,r,i=t[0]/255,n=t[1]/255,o=t[2]/255,a=Math.min(i,n,o),s=Math.max(i,n,o),h=s-a,l=(s+a)/2;if(0===h)e=0,r=0;else{r=l<.5?h/(s+a):h/(2-s-a);var u=((s-i)/6+h/2)/h,c=((s-n)/6+h/2)/h,f=((s-o)/6+h/2)/h;i===s?e=f-c:n===s?e=1/3+u-f:o===s&&(e=2/3+c-u),e<0&&(e+=1),e>1&&(e-=1)}var p=[360*e,r,l];return null!=t[3]&&p.push(t[3]),p}}(o),null!=e&&(o[0]=(n=e,(n=Math.round(n))<0?0:n>360?360:n)),null!=r&&(o[1]=yr(r)),null!=i&&(o[2]=yr(i)),Lr(Tr(o),"rgba")},modifyAlpha:function(t,e){var r=kr(t);if(r&&null!=e)return r[3]=dr(e),Lr(r,"rgba")},stringify:Lr,lum:Dr,random:function(){return Lr([Math.round(255*Math.random()),Math.round(255*Math.random()),Math.round(255*Math.random())],"rgb")}}),Ir=Math.round;function Rr(t){var e;if(t&&"transparent"!==t){if("string"==typeof t&&t.indexOf("rgba")>-1){var r=kr(t);r&&(t="rgb("+r[0]+","+r[1]+","+r[2]+")",e=r[3])}}else t="none";return{color:t,opacity:null==e?1:e}}var Or=1e-4;function Fr(t){return t-1e-4}function Br(t){return Ir(1e3*t)/1e3}function Er(t){return Ir(1e4*t)/1e4}var Hr={left:"start",right:"end",center:"middle",middle:"middle"};function Nr(t){return t&&!!t.image}function Wr(t){return Nr(t)||function(t){return t&&!!t.svgElement}(t)}function Xr(t){return"linear"===t.type}function qr(t){return"radial"===t.type}function Yr(t){return t&&("linear"===t.type||"radial"===t.type)}function jr(t){return"url(#"+t+")"}function Vr(t){var e=t.getGlobalScale(),r=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(r)/Math.log(10)),1)}function Ur(t){var e=t.x||0,r=t.y||0,i=(t.rotation||0)*lt,n=G(t.scaleX,1),o=G(t.scaleY,1),a=t.skewX||0,s=t.skewY||0,h=[];return(e||r)&&h.push("translate("+e+"px,"+r+"px)"),i&&h.push("rotate("+i+")"),1===n&&1===o||h.push("scale("+n+","+o+")"),(a||s)&&h.push("skew("+Ir(a*lt)+"deg, "+Ir(s*lt)+"deg)"),h.join(" ")}var Gr=r.hasGlobalWindow&&E(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:"undefined"!=typeof Buffer?function(t){return Buffer.from(t).toString("base64")}:function(t){return b("Base64 isn't natively supported in the current environment."),null},Zr=Array.prototype.slice;function Kr(t,e,r){return(e-t)*r+t}function Qr(t,e,r,i){for(var n=e.length,o=0;oi?e:t,o=Math.min(r,i),a=n[o-1]||{color:[0,0,0,0],offset:0},s=o;sa)i.length=a;else for(var s=o;s=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,r){this._needsSort=!0;var i=this.keyframes,n=i.length,o=!1,a=6,s=e;if(L(e)){var h=function(t){return L(t&&t[0])?2:1}(e);a=h,(1===h&&!N(e[0])||2===h&&!N(e[0][0]))&&(o=!0)}else if(N(e)&&!U(e))a=0;else if(H(e))if(isNaN(+e)){var l=kr(e);l&&(s=l,a=3)}else a=0;else if(j(e)){var u=T({},s);u.colorStops=z(e.colorStops,(function(t){return{offset:t.offset,color:kr(t.color)}})),Xr(e)?a=4:qr(e)&&(a=5),s=u}0===n?this.valType=a:a===this.valType&&6!==a||(o=!0),this.discrete=this.discrete||o;var c={time:t,value:s,rawValue:e,percent:0};return r&&(c.easing=r,c.easingFunc=E(r)?r:Be[r]||sr(r)),i.push(c),c},t.prototype.prepare=function(t,e){var r=this.keyframes;this._needsSort&&r.sort((function(t,e){return t.time-e.time}));for(var i=this.valType,n=r.length,o=r[n-1],a=this.discrete,s=oi(i),h=ni(i),l=0;l=0&&!(h[r].percent<=e);r--);r=p(r,l-2)}else{for(r=f;re);r++);r=p(r-1,l-2)}n=h[r+1],i=h[r]}if(i&&n){this._lastFr=r,this._lastFrP=e;var d=n.percent-i.percent,v=0===d?1:p((e-i.percent)/d,1);n.easingFunc&&(v=n.easingFunc(v));var y=o?this._additiveValue:c?ai:t[u];if(!oi(s)&&!c||y||(y=this._additiveValue=[]),this.discrete)t[u]=v<1?i.rawValue:n.rawValue;else if(oi(s))1===s?Qr(y,i[a],n[a],v):function(t,e,r,i){for(var n=e.length,o=n&&e[0].length,a=0;a0&&s.addKeyframe(0,ri(h),i),this._trackKeys.push(a)}s.addKeyframe(t,ri(e[a]),i)}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,r=0;r0)){this._started=1;for(var e=this,r=[],i=this._maxTime||0,n=0;n1){var a=o.pop();n.addKeyframe(a.time,t[i]),n.prepare(this._maxTime,n.getAdditiveTrack())}}}},t}();function li(){return(new Date).getTime()}var ui,ci,fi=function(t){function e(e){var r=t.call(this)||this;return r._running=!1,r._time=0,r._pausedTime=0,r._pauseStart=0,r._paused=!1,e=e||{},r.stage=e.stage||{},r}return ft(e,t),e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},e.prototype.removeClip=function(t){if(t.animation){var e=t.prev,r=t.next;e?e.next=r:this._head=r,r?r.prev=e:this._tail=e,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},e.prototype.update=function(t){for(var e=li()-this._pausedTime,r=e-this._time,i=this._head;i;){var n=i.next;i.step(e,r)?(i.ondestroy(),this.removeClip(i),i=n):i=n}this._time=e,t||(this.trigger("frame",r),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0,Fe((function e(){t._running&&(Fe(e),!t._paused&&t.update())}))},e.prototype.start=function(){this._running||(this._time=li(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=li(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=li()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._head=this._tail=null},e.prototype.isFinished=function(){return null==this._head},e.prototype.animate=function(t,e){e=e||{},this.start();var r=new hi(t,e.loop);return this.addAnimator(r),r},e}(Rt),pi=r.domSupported,di=(ci={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:ui=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:z(ui,(function(t){var e=t.replace("mouse","pointer");return ci.hasOwnProperty(e)?e:t}))}),vi=["mousemove","mouseup"],yi=["pointermove","pointerup"],gi=!1;function _i(t){var e=t.pointerType;return"pen"===e||"touch"===e}function mi(t){t&&(t.zrByTouch=!0)}function xi(t,e){for(var r=e,i=!1;r&&9!==r.nodeType&&!(i=r.domBelongToZr||r!==e&&r===t.painterRoot);)r=r.parentNode;return i}var wi=function(t,e){this.stopPropagation=ht,this.stopImmediatePropagation=ht,this.preventDefault=ht,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY},bi={mousedown:function(t){t=Gt(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=Gt(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=Gt(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){xi(this,(t=Gt(this.dom,t)).toElement||t.relatedTarget)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){gi=!0,t=Gt(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){gi||(t=Gt(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){mi(t=Gt(this.dom,t)),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),bi.mousemove.call(this,t),bi.mousedown.call(this,t)},touchmove:function(t){mi(t=Gt(this.dom,t)),this.handler.processGesture(t,"change"),bi.mousemove.call(this,t)},touchend:function(t){mi(t=Gt(this.dom,t)),this.handler.processGesture(t,"end"),bi.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<300&&bi.click.call(this,t)},pointerdown:function(t){bi.mousedown.call(this,t)},pointermove:function(t){_i(t)||bi.mousemove.call(this,t)},pointerup:function(t){bi.mouseup.call(this,t)},pointerout:function(t){_i(t)||bi.mouseout.call(this,t)}};D(["click","dblclick","contextmenu"],(function(t){bi[t]=function(e){e=Gt(this.dom,e),this.trigger(t,e)}}));var Si={pointermove:function(t){_i(t)||Si.mousemove.call(this,t)},pointerup:function(t){Si.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function ki(t,e){var i=e.domHandlers;r.pointerEventsSupported?D(di.pointer,(function(r){Ci(e,r,(function(e){i[r].call(t,e)}))})):(r.touchEventsSupported&&D(di.touch,(function(r){Ci(e,r,(function(n){i[r].call(t,n),function(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout((function(){t.touching=!1,t.touchTimer=null}),700)}(e)}))})),D(di.mouse,(function(r){Ci(e,r,(function(n){n=Ut(n),e.touching||i[r].call(t,n)}))})))}function Ti(t,e){function i(r){Ci(e,r,(function(i){i=Ut(i),xi(t,i.target)||(i=function(t,e){return Gt(t.dom,new wi(t,e),!0)}(t,i),e.domHandlers[r].call(t,i))}),{capture:!0})}r.pointerEventsSupported?D(yi,i):r.touchEventsSupported||D(vi,i)}function Ci(t,e,r,i){t.mounted[e]=r,t.listenerOpts[e]=i,function(t,e,r,i){t.addEventListener(e,r,i)}(t.domTarget,e,r,i)}function Pi(t){var e,r,i,n,o=t.mounted;for(var a in o)o.hasOwnProperty(a)&&(e=t.domTarget,r=a,i=o[a],n=t.listenerOpts[a],e.removeEventListener(r,i,n));t.mounted={}}var Mi=function(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e},Ai=function(t){function e(e,r){var i=t.call(this)||this;return i.__pointerCapturing=!1,i.dom=e,i.painterRoot=r,i._localHandlerScope=new Mi(e,bi),pi&&(i._globalHandlerScope=new Mi(document,Si)),ki(i,i._localHandlerScope),i}return ft(e,t),e.prototype.dispose=function(){Pi(this._localHandlerScope),pi&&Pi(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,pi&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var e=this._globalHandlerScope;t?Ti(this,e):Pi(e)}},e}(Rt),Li=1;r.hasGlobalWindow&&(Li=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var Di=Li,zi="#333",Ii="#ccc",Ri=Jt,Oi=5e-5;function Fi(t){return t>Oi||t<-5e-5}var Bi=[],Ei=[],Hi=[1,0,0,1,0,0],Ni=Math.abs,Wi=function(){function t(){}var e;return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return Fi(this.rotation)||Fi(this.x)||Fi(this.y)||Fi(this.scaleX-1)||Fi(this.scaleY-1)||Fi(this.skewX)||Fi(this.skewY)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),r=this.transform;e||t?(r=r||[1,0,0,1,0,0],e?this.getLocalTransform(r):Ri(r),t&&(e?ee(r,t,r):te(r,t)),this.transform=r,this._resolveGlobalScaleRatio(r)):r&&Ri(r)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(Bi);var r=Bi[0]<0?-1:1,i=Bi[1]<0?-1:1,n=((Bi[0]-r)*e+r)/Bi[0]||0,o=((Bi[1]-i)*e+i)/Bi[1]||0;t[0]*=n,t[1]*=n,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||[1,0,0,1,0,0],oe(this.invTransform,t)},t.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],r=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),n=Math.PI/2+i-Math.atan2(t[3],t[2]);r=Math.sqrt(r)*Math.cos(n),e=Math.sqrt(e),this.skewX=n,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=r,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(ee(Ei,t.invTransform,e),e=Ei);var r=this.originX,i=this.originY;(r||i)&&(Hi[4]=r,Hi[5]=i,ee(Ei,e,Hi),Ei[4]-=r,Ei[5]-=i,e=Ei),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var r=[t,e],i=this.invTransform;return i&&Mt(r,r,i),r},t.prototype.transformCoordToGlobal=function(t,e){var r=[t,e],i=this.transform;return i&&Mt(r,r,i),r},t.prototype.getLineScale=function(){var t=this.transform;return t&&Ni(t[0]-1)>1e-10&&Ni(t[3]-1)>1e-10?Math.sqrt(Ni(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){qi(this,t)},t.getLocalTransform=function(t,e){e=e||[];var r=t.originX||0,i=t.originY||0,n=t.scaleX,o=t.scaleY,a=t.anchorX,s=t.anchorY,h=t.rotation||0,l=t.x,u=t.y,c=t.skewX?Math.tan(t.skewX):0,f=t.skewY?Math.tan(-t.skewY):0;if(r||i||a||s){var p=r+a,d=i+s;e[4]=-p*n-c*d*o,e[5]=-d*o-f*p*n}else e[4]=e[5]=0;return e[0]=n,e[3]=o,e[1]=f*n,e[2]=c*o,h&&ie(e,e,h),e[4]+=r+l,e[5]+=i+u,e},t.initDefaultProps=((e=t.prototype).scaleX=e.scaleY=e.globalScaleRatio=1,void(e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0)),t}(),Xi=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function qi(t,e){for(var r=0;r=0?parseFloat(t)/100*e:parseFloat(t):t}var Qi="__zr_normal__",$i=Xi.concat(["ignore"]),Ji=I(Xi,(function(t,e){return t[e]=!0,t}),{ignore:!1}),tn={},en=new ye(0,0,0,0),rn=function(){function t(t){this.id=w(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,r){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.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var r=this.textConfig,i=r.local,n=e.innerTransformable,o=void 0,a=void 0,s=!1;n.parent=i?this:null;var h=!1;if(n.copyTransform(e),null!=r.position){var l=en;r.layoutRect?l.copy(r.layoutRect):l.copy(this.getBoundingRect()),i||l.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(tn,r,l):function(t,e,r){var i=e.position||"inside",n=null!=e.distance?e.distance:5,o=r.height,a=r.width,s=o/2,h=r.x,l=r.y,u="left",c="top";if(i instanceof Array)h+=Ki(i[0],r.width),l+=Ki(i[1],r.height),u=null,c=null;else switch(i){case"left":h-=n,l+=s,u="right",c="middle";break;case"right":h+=n+a,l+=s,c="middle";break;case"top":h+=a/2,l-=n,u="center",c="bottom";break;case"bottom":h+=a/2,l+=o+n,u="center";break;case"inside":h+=a/2,l+=s,u="center",c="middle";break;case"insideLeft":h+=n,l+=s,c="middle";break;case"insideRight":h+=a-n,l+=s,u="right",c="middle";break;case"insideTop":h+=a/2,l+=n,u="center";break;case"insideBottom":h+=a/2,l+=o-n,u="center",c="bottom";break;case"insideTopLeft":h+=n,l+=n;break;case"insideTopRight":h+=a-n,l+=n,u="right";break;case"insideBottomLeft":h+=n,l+=o-n,c="bottom";break;case"insideBottomRight":h+=a-n,l+=o-n,u="right",c="bottom"}(t=t||{}).x=h,t.y=l,t.align=u,t.verticalAlign=c}(tn,r,l),n.x=tn.x,n.y=tn.y,o=tn.align,a=tn.verticalAlign;var u=r.origin;if(u&&null!=r.rotation){var c=void 0,f=void 0;"center"===u?(c=.5*l.width,f=.5*l.height):(c=Ki(u[0],l.width),f=Ki(u[1],l.height)),h=!0,n.originX=-n.x+c+(i?0:l.x),n.originY=-n.y+f+(i?0:l.y)}}null!=r.rotation&&(n.rotation=r.rotation);var p=r.offset;p&&(n.x+=p[0],n.y+=p[1],h||(n.originX=-p[0],n.originY=-p[1]));var d=null==r.inside?"string"==typeof r.position&&r.position.indexOf("inside")>=0:r.inside,v=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),y=void 0,g=void 0,_=void 0;d&&this.canBeInsideText()?(y=r.insideFill,g=r.insideStroke,null!=y&&"auto"!==y||(y=this.getInsideTextFill()),null!=g&&"auto"!==g||(g=this.getInsideTextStroke(y),_=!0)):(y=r.outsideFill,g=r.outsideStroke,null!=y&&"auto"!==y||(y=this.getOutsideFill()),null!=g&&"auto"!==g||(g=this.getOutsideStroke(y),_=!0)),(y=y||"#000")===v.fill&&g===v.stroke&&_===v.autoStroke&&o===v.align&&a===v.verticalAlign||(s=!0,v.fill=y,v.stroke=g,v.autoStroke=_,v.align=o,v.verticalAlign=a,e.setDefaultTextStyle(v)),e.__dirty|=1,s&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Ii:zi},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),r="string"==typeof e&&kr(e);r||(r=[255,255,255,1]);for(var i=r[3],n=this.__zr.isDarkMode(),o=0;o<3;o++)r[o]=r[o]*i+(n?0:255)*(1-i);return r[3]=1,Lr(r,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},T(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(W(t))for(var r=O(t),i=0;i0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(Qi,!1,t)},t.prototype.useState=function(t,e,r,i){var n=t===Qi;if(this.hasState()||!n){var o=this.currentStates,a=this.stateTransition;if(!(M(o,t)>=0)||!e&&1!==o.length){var s;if(this.stateProxy&&!n&&(s=this.stateProxy(t)),s||(s=this.states&&this.states[t]),s||n){n||this.saveCurrentToNormalState(s);var h=!!(s&&s.hoverLayer||i);h&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,s,this._normalState,e,!r&&!this.__inHover&&a&&a.duration>0,a);var l=this._textContent,u=this._textGuide;return l&&l.useState(t,e,r,h),u&&u.useState(t,e,r,h),n?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),s}b("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,r){if(t.length){var i=[],n=this.currentStates,o=t.length,a=o===n.length;if(a)for(var s=0;s0,p);var d=this._textContent,v=this._textGuide;d&&d.useStates(t,e,c),v&&v.useStates(t,e,c),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}else this.clearStates()},t.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var r=this.currentStates.slice();r.splice(e,1),this.useStates(r)}},t.prototype.replaceState=function(t,e,r){var i=this.currentStates.slice(),n=M(i,t),o=M(i,e)>=0;n>=0?o?i.splice(n,1):i[n]=e:r&&!o&&i.push(e),this.useStates(i)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,r={},i=0;i=0&&e.splice(r,1)})),this.animators.push(t),r&&r.animation.addAnimator(t),r&&r.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var r=this.animators,i=r.length,n=[],o=0;o0&&r.during&&o[0].during((function(t,e){r.during(e)}));for(var f=0;f0||n.force&&!a.length){var b,S=void 0,k=void 0,T=void 0;if(s)for(k={},f&&(S={}),x=0;x=0&&(r.splice(i,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,e){var r=M(this._children,t);return r>=0&&this.replaceAt(e,r),this},e.prototype.replaceAt=function(t,e){var r=this._children,i=r[e];if(t&&t!==this&&t.parent!==this&&t!==i){r[e]=t,i.parent=null;var n=this.__zr;n&&i.removeSelfFromZr(n),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},e.prototype.remove=function(t){var e=this.__zr,r=this._children,i=M(r,t);return i<0||(r.splice(i,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},e.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,r=0;r0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},t.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},t.prototype.clearAnimation=function(){this.animation.clear()},t.prototype.getWidth=function(){return this.painter.getWidth()},t.prototype.getHeight=function(){return this.painter.getHeight()},t.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},t.prototype.on=function(t,e,r){return this.handler.on(t,e,r),this},t.prototype.off=function(t,e){this.handler.off(t,e)},t.prototype.trigger=function(t,e){this.handler.trigger(t,e)},t.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e1e-4)return s[0]=t-r,s[1]=e-i,h[0]=t+r,void(h[1]=e+i);if(Cn[0]=kn(n)*r+t,Cn[1]=Sn(n)*i+e,Pn[0]=kn(o)*r+t,Pn[1]=Sn(o)*i+e,l(s,Cn,Pn),u(h,Cn,Pn),(n%=Tn)<0&&(n+=Tn),(o%=Tn)<0&&(o+=Tn),n>o&&!a?o+=Tn:nn&&(Mn[0]=kn(p)*r+t,Mn[1]=Sn(p)*i+e,l(s,Mn,s),u(h,Mn,h))}var Fn={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Bn=[],En=[],Hn=[],Nn=[],Wn=[],Xn=[],qn=Math.min,Yn=Math.max,jn=Math.cos,Vn=Math.sin,Un=Math.abs,Gn=Math.PI,Zn=2*Gn,Kn="undefined"!=typeof Float32Array,Qn=[];function $n(t){return Math.round(t/Gn*1e8)/1e8%2*Gn}var Jn=function(){function t(t){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,t&&(this._saveData=!1),this._saveData&&(this.data=[])}var e;return t.prototype.increaseVersion=function(){this._version++},t.prototype.getVersion=function(){return this._version},t.prototype.setScale=function(t,e,r){(r=r||0)>0&&(this._ux=Un(r/Di/t)||0,this._uy=Un(r/Di/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(Fn.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var r=Un(t-this._xi),i=Un(e-this._yi),n=r>this._ux||i>this._uy;if(this.addData(Fn.L,t,e),this._ctx&&n&&this._ctx.lineTo(t,e),n)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=r*r+i*i;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._drawPendingPt(),this.addData(Fn.C,t,e,r,i,n,o),this._ctx&&this._ctx.bezierCurveTo(t,e,r,i,n,o),this._xi=n,this._yi=o,this},t.prototype.quadraticCurveTo=function(t,e,r,i){return this._drawPendingPt(),this.addData(Fn.Q,t,e,r,i),this._ctx&&this._ctx.quadraticCurveTo(t,e,r,i),this._xi=r,this._yi=i,this},t.prototype.arc=function(t,e,r,i,n,o){this._drawPendingPt(),Qn[0]=i,Qn[1]=n,function(t,e){var r=$n(t[0]);r<0&&(r+=Zn);var i=r-t[0],n=t[1];n+=i,!e&&n-r>=Zn?n=r+Zn:e&&r-n>=Zn?n=r-Zn:!e&&r>n?n=r+(Zn-$n(r-n)):e&&rl.length&&(this._expandData(),l=this.data);for(var u=0;u0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){Hn[0]=Hn[1]=Wn[0]=Wn[1]=Number.MAX_VALUE,Nn[0]=Nn[1]=Xn[0]=Xn[1]=-Number.MAX_VALUE;var t,e=this.data,r=0,i=0,n=0,o=0;for(t=0;tr||Un(y)>i||c===e-1)&&(d=Math.sqrt(A*A+y*y),n=v,o=m);break;case Fn.C:var g=t[c++],_=t[c++],m=(v=t[c++],t[c++]),x=t[c++],w=t[c++];d=tr(n,o,g,_,v,m,x,w,10),n=x,o=w;break;case Fn.Q:d=or(n,o,g=t[c++],_=t[c++],v=t[c++],m=t[c++],10),n=v,o=m;break;case Fn.A:var b=t[c++],S=t[c++],k=t[c++],T=t[c++],C=t[c++],P=t[c++],M=P+C;c+=1,t[c++],p&&(a=jn(C)*k+b,s=Vn(C)*T+S),d=Yn(k,T)*qn(Zn,Math.abs(P)),n=jn(M)*k+b,o=Vn(M)*T+S;break;case Fn.R:a=n=t[c++],s=o=t[c++],d=2*t[c++]+2*t[c++];break;case Fn.Z:var A=a-n;y=s-o,d=Math.sqrt(A*A+y*y),n=a,o=s}d>=0&&(h[u++]=d,l+=d)}return this._pathLen=l,l},t.prototype.rebuildPath=function(t,e){var r,i,n,o,a,s,h,l,u,c,f=this.data,p=this._ux,d=this._uy,v=this._len,y=e<1,g=0,_=0,m=0;if(!y||(this._pathSegLen||this._calculateLength(),h=this._pathSegLen,l=e*this._pathLen))t:for(var x=0;x0&&(t.lineTo(u,c),m=0),w){case Fn.M:r=n=f[x++],i=o=f[x++],t.moveTo(n,o);break;case Fn.L:a=f[x++],s=f[x++];var S=Un(a-n),k=Un(s-o);if(S>p||k>d){if(y){if(g+(G=h[_++])>l){var T=(l-g)/G;t.lineTo(n*(1-T)+a*T,o*(1-T)+s*T);break t}g+=G}t.lineTo(a,s),n=a,o=s,m=0}else{var C=S*S+k*k;C>m&&(u=a,c=s,m=C)}break;case Fn.C:var P=f[x++],M=f[x++],A=f[x++],L=f[x++],D=f[x++],z=f[x++];if(y){if(g+(G=h[_++])>l){Je(n,P,A,D,T=(l-g)/G,Bn),Je(o,M,L,z,T,En),t.bezierCurveTo(Bn[1],En[1],Bn[2],En[2],Bn[3],En[3]);break t}g+=G}t.bezierCurveTo(P,M,A,L,D,z),n=D,o=z;break;case Fn.Q:if(P=f[x++],M=f[x++],A=f[x++],L=f[x++],y){if(g+(G=h[_++])>l){nr(n,P,A,T=(l-g)/G,Bn),nr(o,M,L,T,En),t.quadraticCurveTo(Bn[1],En[1],Bn[2],En[2]);break t}g+=G}t.quadraticCurveTo(P,M,A,L),n=A,o=L;break;case Fn.A:var I=f[x++],R=f[x++],O=f[x++],F=f[x++],B=f[x++],E=f[x++],H=f[x++],N=!f[x++],W=O>F?O:F,X=Un(O-F)>.001,q=B+E,Y=!1;if(y&&(g+(G=h[_++])>l&&(q=B+E*(l-g)/G,Y=!0),g+=G),X&&t.ellipse?t.ellipse(I,R,O,F,H,B,q,N):t.arc(I,R,W,B,q,N),Y)break t;b&&(r=jn(B)*O+I,i=Vn(B)*F+R),n=jn(q)*O+I,o=Vn(q)*F+R;break;case Fn.R:r=n=f[x],i=o=f[x+1],a=f[x++],s=f[x++];var j=f[x++],V=f[x++];if(y){if(g+(G=h[_++])>l){var U=l-g;t.moveTo(a,s),t.lineTo(a+qn(U,j),s),(U-=j)>0&&t.lineTo(a+j,s+qn(U,V)),(U-=V)>0&&t.lineTo(a+Yn(j-U,0),s+V),(U-=j)>0&&t.lineTo(a,s+Yn(V-U,0));break t}g+=G}t.rect(a,s,j,V);break;case Fn.Z:if(y){var G;if(g+(G=h[_++])>l){T=(l-g)/G,t.lineTo(n*(1-T)+r*T,o*(1-T)+i*T);break t}g+=G}t.closePath(),n=r,o=i}}},t.prototype.clone=function(){var e=new t,r=this.data;return e.data=r.slice?r.slice():Array.prototype.slice.call(r),e._len=this._len,e},t.CMD=Fn,t.initDefaultProps=((e=t.prototype)._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,void(e._version=0)),t}();function to(t,e,r,i,n,o,a){if(0===n)return!1;var s=n,h=0;if(a>e+s&&a>i+s||at+s&&o>r+s||oe+c&&u>i+c&&u>o+c&&u>s+c||ut+c&&l>r+c&&l>n+c&&l>a+c||l=0&&de+l&&h>i+l&&h>o+l||ht+l&&s>r+l&&s>n+l||s=0&&yr||u+ln&&(n+=oo);var f=Math.atan2(h,s);return f<0&&(f+=oo),f>=i&&f<=n||f+oo>=i&&f+oo<=n}function so(t,e,r,i,n,o){if(o>e&&o>i||on?s:0}var ho=Jn.CMD,lo=2*Math.PI,uo=[-1,-1,-1],co=[-1,-1];function fo(t,e,r,i,n,o,a,s,h,l){if(l>e&&l>i&&l>o&&l>s||l1&&(u=void 0,u=co[0],co[0]=co[1],co[1]=u),d=Ze(e,i,o,s,co[0]),p>1&&(v=Ze(e,i,o,s,co[1]))),2===p?ge&&s>i&&s>o||s=0&&u<=1&&(n[h++]=u);else{var l=a*a-4*o*s;if(Ue(l))(u=-a/(2*o))>=0&&u<=1&&(n[h++]=u);else if(l>0){var u,c=He(l),f=(-a-c)/(2*o);(u=(-a+c)/(2*o))>=0&&u<=1&&(n[h++]=u),f>=0&&f<=1&&(n[h++]=f)}}return h}(e,i,o,s,uo);if(0===h)return 0;var l=ir(e,i,o);if(l>=0&&l<=1){for(var u=0,c=er(e,i,o,l),f=0;fr||s<-r)return 0;var h=Math.sqrt(r*r-s*s);uo[0]=-h,uo[1]=h;var l=Math.abs(i-n);if(l<1e-4)return 0;if(l>=lo-1e-4){i=0,n=lo;var u=o?1:-1;return a>=uo[0]+t&&a<=uo[1]+t?u:0}if(i>n){var c=i;i=n,n=c}i<0&&(i+=lo,n+=lo);for(var f=0,p=0;p<2;p++){var d=uo[p];if(d+t>a){var v=Math.atan2(s,d);u=o?1:-1,v<0&&(v=lo+v),(v>=i&&v<=n||v+lo>=i&&v+lo<=n)&&(v>Math.PI/2&&v<1.5*Math.PI&&(u=-u),f+=u)}}return f}function yo(t,e,r,i,n){for(var o,a,s,h,l=t.data,u=t.len(),c=0,f=0,p=0,d=0,v=0,y=0;y1&&(r||(c+=so(f,p,d,v,i,n))),_&&(d=f=l[y],v=p=l[y+1]),g){case ho.M:f=d=l[y++],p=v=l[y++];break;case ho.L:if(r){if(to(f,p,l[y],l[y+1],e,i,n))return!0}else c+=so(f,p,l[y],l[y+1],i,n)||0;f=l[y++],p=l[y++];break;case ho.C:if(r){if(eo(f,p,l[y++],l[y++],l[y++],l[y++],l[y],l[y+1],e,i,n))return!0}else c+=fo(f,p,l[y++],l[y++],l[y++],l[y++],l[y],l[y+1],i,n)||0;f=l[y++],p=l[y++];break;case ho.Q:if(r){if(ro(f,p,l[y++],l[y++],l[y],l[y+1],e,i,n))return!0}else c+=po(f,p,l[y++],l[y++],l[y],l[y+1],i,n)||0;f=l[y++],p=l[y++];break;case ho.A:var m=l[y++],x=l[y++],w=l[y++],b=l[y++],S=l[y++],k=l[y++];y+=1;var T=!!(1-l[y++]);o=Math.cos(S)*w+m,a=Math.sin(S)*b+x,_?(d=o,v=a):c+=so(f,p,o,a,i,n);var C=(i-m)*b/w+m;if(r){if(ao(m,x,b,S,S+k,T,e,C,n))return!0}else c+=vo(m,x,b,S,S+k,T,C,n);f=Math.cos(S+k)*w+m,p=Math.sin(S+k)*b+x;break;case ho.R:if(d=f=l[y++],v=p=l[y++],o=d+l[y++],a=v+l[y++],r){if(to(d,v,o,v,e,i,n)||to(o,v,o,a,e,i,n)||to(o,a,d,a,e,i,n)||to(d,a,d,v,e,i,n))return!0}else c+=so(o,v,o,a,i,n),c+=so(d,a,d,v,i,n);break;case ho.Z:if(r){if(to(f,p,d,v,e,i,n))return!0}else c+=so(f,p,d,v,i,n);f=d,p=v}}return r||(s=p,h=v,Math.abs(s-h)<1e-4)||(c+=so(f,p,d,v,i,n)||0),0!==c}var go=C({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},dn),_o={style:C({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},vn.style)},mo=Xi.concat(["invisible","culling","z","z2","zlevel","parent"]),xo=function(t){function e(e){return t.call(this,e)||this}var r;return ft(e,t),e.prototype.update=function(){var r=this;t.prototype.update.call(this);var i=this.style;if(i.decal){var n=this._decalEl=this._decalEl||new e;n.buildPath===e.prototype.buildPath&&(n.buildPath=function(t){r.buildPath(t,r.shape)}),n.silent=!0;var o=n.style;for(var a in i)o[a]!==i[a]&&(o[a]=i[a]);o.fill=i.fill?i.decal:null,o.decal=null,o.shadowColor=null,i.strokeFirst&&(o.stroke=null);for(var s=0;s.5?zi:e>.2?"#eee":Ii}if(t)return Ii}return zi},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(H(e)){var r=this.__zr;if(!(!r||!r.isDarkMode())==Dr(t,0)<.4)return e}},e.prototype.buildPath=function(t,e,r){},e.prototype.pathUpdated=function(){this.__dirty&=-5},e.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},e.prototype.createPathProxy=function(){this.path=new Jn(!1)},e.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,r=!t;if(r){var i=!1;this.path||(i=!0,this.createPathProxy());var n=this.path;(i||4&this.__dirty)&&(n.beginPath(),this.buildPath(n,this.shape,!1),this.pathUpdated()),t=n.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||r){o.copy(t);var a=e.strokeNoScale?this.getLineScale():1,s=e.lineWidth;if(!this.hasFill()){var h=this.strokeContainThreshold;s=Math.max(s,null==h?4:h)}a>1e-10&&(o.width+=s/a,o.height+=s/a,o.x-=s/a/2,o.y-=s/a/2)}return o}return t},e.prototype.contain=function(t,e){var r=this.transformCoordToLocal(t,e),i=this.getBoundingRect(),n=this.style;if(t=r[0],e=r[1],i.contain(t,e)){var o=this.path;if(this.hasStroke()){var a=n.lineWidth,s=n.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),function(t,e,r,i){return yo(t,e,!0,r,i)}(o,a/s,t,e)))return!0}if(this.hasFill())return function(t,e,r){return yo(t,0,!1,e,r)}(o,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(e,r){"shape"===e?this.setShape(r):t.prototype.attrKV.call(this,e,r)},e.prototype.setShape=function(t,e){var r=this.shape;return r||(r=this.shape={}),"string"==typeof t?r[t]=e:T(r,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(4&this.__dirty)},e.prototype.createStyle=function(t){return ot(go,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var r=this._normalState;e.shape&&!r.shape&&(r.shape=T({},this.shape))},e.prototype._applyStateObj=function(e,r,i,n,o,a){t.prototype._applyStateObj.call(this,e,r,i,n,o,a);var s,h=!(r&&n);if(r&&r.shape?o?n?s=r.shape:(s=T({},i.shape),T(s,r.shape)):(s=T({},n?this.shape:i.shape),T(s,r.shape)):h&&(s=i.shape),s)if(o){this.shape=T({},this.shape);for(var l={},u=O(s),c=0;c1&&(a*=Co(d),s*=Co(d));var v=(n===o?-1:1)*Co((a*a*(s*s)-a*a*(p*p)-s*s*(f*f))/(a*a*(p*p)+s*s*(f*f)))||0,y=v*a*p/s,g=v*-s*f/a,_=(t+r)/2+Mo(c)*y-Po(c)*g,m=(e+i)/2+Po(c)*y+Mo(c)*g,x=zo([1,0],[(f-y)/a,(p-g)/s]),w=[(f-y)/a,(p-g)/s],b=[(-1*f-y)/a,(-1*p-g)/s],S=zo(w,b);if(Do(w,b)<=-1&&(S=Ao),Do(w,b)>=1&&(S=0),S<0){var k=Math.round(S/Ao*1e6)/1e6;S=2*Ao+k%2*Ao}u.addData(l,_,m,a,s,x,S,c,o)}var Ro=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Oo=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g,Fo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ft(e,t),e.prototype.applyTransform=function(t){},e}(xo);function Bo(t){return null!=t.setData}function Eo(t,e){var r=function(t){var e=new Jn;if(!t)return e;var r,i=0,n=0,o=i,a=n,s=Jn.CMD,h=t.match(Ro);if(!h)return e;for(var l=0;ll&&(r*=l/(a=r+i),i*=l/a),n+o>l&&(n*=l/(a=n+o),o*=l/a),i+n>u&&(i*=u/(a=i+n),n*=u/a),r+o>u&&(r*=u/(a=r+o),o*=u/a),t.moveTo(s+r,h),t.lineTo(s+l-i,h),0!==i&&t.arc(s+l-i,h+i,i,-Math.PI/2,0),t.lineTo(s+l,h+u-n),0!==n&&t.arc(s+l-n,h+u-n,n,0,Math.PI/2),t.lineTo(s+o,h+u),0!==o&&t.arc(s+o,h+u-o,o,Math.PI/2,Math.PI),t.lineTo(s,h+r),0!==r&&t.arc(s+r,h+r,r,Math.PI,1.5*Math.PI)}(t,e):t.rect(r,i,n,o)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(xo);Qo.prototype.type="rect";var $o=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},Jo=function(t){function e(e){return t.call(this,e)||this}return ft(e,t),e.prototype.getDefaultShape=function(){return new $o},e.prototype.buildPath=function(t,e){var r=.5522848,i=e.cx,n=e.cy,o=e.rx,a=e.ry,s=o*r,h=a*r;t.moveTo(i-o,n),t.bezierCurveTo(i-o,n-h,i-s,n-a,i,n-a),t.bezierCurveTo(i+s,n-a,i+o,n-h,i+o,n),t.bezierCurveTo(i+o,n+h,i+s,n+a,i,n+a),t.bezierCurveTo(i-s,n+a,i-o,n+h,i-o,n),t.closePath()},e}(xo);Jo.prototype.type="ellipse";var ta={},ea=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},ra=function(t){function e(e){return t.call(this,e)||this}return ft(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ea},e.prototype.buildPath=function(t,e){var r,i,n,o;if(this.subPixelOptimize){var a=function(t,e,r){if(e){var i=e.x1,n=e.x2,o=e.y1,a=e.y2;t.x1=i,t.x2=n,t.y1=o,t.y2=a;var s=r&&r.lineWidth;return s?(Uo(2*i)===Uo(2*n)&&(t.x1=t.x2=Go(i,s,!0)),Uo(2*o)===Uo(2*a)&&(t.y1=t.y2=Go(o,s,!0)),t):t}}(ta,e,this.style);r=a.x1,i=a.y1,n=a.x2,o=a.y2}else r=e.x1,i=e.y1,n=e.x2,o=e.y2;var s=e.percent;0!==s&&(t.moveTo(r,i),s<1&&(n=r*(1-s)+n*s,o=i*(1-s)+o*s),t.lineTo(n,o))},e.prototype.pointAt=function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]},e}(xo);function ia(t,e,r){var i=e.smooth,n=e.points;if(n&&n.length>=2){if(i){var o=function(t,e,r,i){var n,o,a,s,h=[],l=[],u=[],c=[];if(i){a=[1/0,1/0],s=[-1/0,-1/0];for(var f=0,p=t.length;f0},e.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},e.prototype.createStyle=function(t){return ot(fa,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var e=t.text;null!=e?e+="":e="";var r=function(t,e,r,i){var n=((t||"")+"").split("\n");if(1===n.length)return Vi(n[0],e,r,i);for(var o=new ye(0,0,0,0),a=0;a=4&&(h={x:parseFloat(c[0]||0),y:parseFloat(c[1]||0),width:parseFloat(c[2]),height:parseFloat(c[3])})}if(h&&null!=a&&null!=s&&(l=function(t,e){var r=e.width/t.width,i=e.height/t.height,n=Math.min(r,i);return{scale:n,x:-(t.x+t.width/2)*n+(e.x+e.width/2),y:-(t.y+t.height/2)*n+(e.y+e.height/2)}}(h,{x:0,y:0,width:a,height:s}),!e.ignoreViewBox)){var f=i;(i=new hn).add(f),f.scaleX=f.scaleY=l.scale,f.x=l.x,f.y=l.y}return e.ignoreRootClip||null==a||null==s||i.setClipPath(new Qo({shape:{x:0,y:0,width:a,height:s}})),{root:i,width:a,height:s,viewBoxRect:h,viewBoxTransform:l,named:n}},t.prototype._parseNode=function(t,e,r,i,n,o){var a,s=t.nodeName.toLowerCase(),h=i;if("defs"===s&&(n=!0),"text"===s&&(o=!0),"defs"===s||"switch"===s)a=e;else{if(!n){var l=ha[s];if(l&&st(ha,s)){a=l.call(this,t,e);var u=t.getAttribute("name");if(u){var c={name:u,namedFrom:null,svgNodeTagLower:s,el:a};r.push(c),"g"===s&&(h=c)}else i&&r.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:a});e.add(a)}}var f=ma[s];if(f&&st(ma,s)){var p=f.call(this,t),d=t.getAttribute("id");d&&(this._defs[d]=p)}}if(a&&a.isGroup)for(var v=t.firstChild;v;)1===v.nodeType?this._parseNode(v,a,r,h,n,o):3===v.nodeType&&o&&this._parseText(v,a),v=v.nextSibling},t.prototype._parseText=function(t,e){var r=new pa({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});ba(e,r),ka(t,r,this._defsUsePending,!1,!1),function(t,e){var r=e.__selfStyle;if(r){var i=r.textBaseline,n=i;i&&"auto"!==i?"baseline"===i?n="alphabetic":"before-edge"===i||"text-before-edge"===i?n="top":"after-edge"===i||"text-after-edge"===i?n="bottom":"central"!==i&&"mathematical"!==i||(n="middle"):n="alphabetic",t.style.textBaseline=n}var o=e.__inheritedStyle;if(o){var a=o.textAlign,s=a;a&&("middle"===a&&(s="center"),t.style.textAlign=s)}}(r,e);var i=r.style,n=i.fontSize;n&&n<9&&(i.fontSize=9,r.scaleX*=n/9,r.scaleY*=n/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var a=r.getBoundingRect();return this._textX+=a.width,e.add(r),r},t.internalField=void(ha={g:function(t,e){var r=new hn;return ba(e,r),ka(t,r,this._defsUsePending,!1,!1),r},rect:function(t,e){var r=new Qo;return ba(e,r),ka(t,r,this._defsUsePending,!1,!1),r.setShape({x:parseFloat(t.getAttribute("x")||"0"),y:parseFloat(t.getAttribute("y")||"0"),width:parseFloat(t.getAttribute("width")||"0"),height:parseFloat(t.getAttribute("height")||"0")}),r.silent=!0,r},circle:function(t,e){var r=new Vo;return ba(e,r),ka(t,r,this._defsUsePending,!1,!1),r.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),r.silent=!0,r},line:function(t,e){var r=new ra;return ba(e,r),ka(t,r,this._defsUsePending,!1,!1),r.setShape({x1:parseFloat(t.getAttribute("x1")||"0"),y1:parseFloat(t.getAttribute("y1")||"0"),x2:parseFloat(t.getAttribute("x2")||"0"),y2:parseFloat(t.getAttribute("y2")||"0")}),r.silent=!0,r},ellipse:function(t,e){var r=new Jo;return ba(e,r),ka(t,r,this._defsUsePending,!1,!1),r.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),rx:parseFloat(t.getAttribute("rx")||"0"),ry:parseFloat(t.getAttribute("ry")||"0")}),r.silent=!0,r},polygon:function(t,e){var r,i=t.getAttribute("points");i&&(r=Sa(i));var n=new oa({shape:{points:r||[]},silent:!0});return ba(e,n),ka(t,n,this._defsUsePending,!1,!1),n},polyline:function(t,e){var r,i=t.getAttribute("points");i&&(r=Sa(i));var n=new sa({shape:{points:r||[]},silent:!0});return ba(e,n),ka(t,n,this._defsUsePending,!1,!1),n},image:function(t,e){var r=new Yo;return ba(e,r),ka(t,r,this._defsUsePending,!1,!1),r.setStyle({image:t.getAttribute("xlink:href")||t.getAttribute("href"),x:+t.getAttribute("x"),y:+t.getAttribute("y"),width:+t.getAttribute("width"),height:+t.getAttribute("height")}),r.silent=!0,r},text:function(t,e){var r=t.getAttribute("x")||"0",i=t.getAttribute("y")||"0",n=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0";this._textX=parseFloat(r)+parseFloat(n),this._textY=parseFloat(i)+parseFloat(o);var a=new hn;return ba(e,a),ka(t,a,this._defsUsePending,!1,!0),a},tspan:function(t,e){var r=t.getAttribute("x"),i=t.getAttribute("y");null!=r&&(this._textX=parseFloat(r)),null!=i&&(this._textY=parseFloat(i));var n=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0",a=new hn;return ba(e,a),ka(t,a,this._defsUsePending,!1,!0),this._textX+=parseFloat(n),this._textY+=parseFloat(o),a},path:function(t,e){var r=Ho(t.getAttribute("d")||"");return ba(e,r),ka(t,r,this._defsUsePending,!1,!1),r.silent=!0,r}}),t}(),ma={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||"0",10),r=parseInt(t.getAttribute("y1")||"0",10),i=parseInt(t.getAttribute("x2")||"10",10),n=parseInt(t.getAttribute("y2")||"0",10),o=new ua(e,r,i,n);return xa(t,o),wa(t,o),o},radialgradient:function(t){var e=parseInt(t.getAttribute("cx")||"0",10),r=parseInt(t.getAttribute("cy")||"0",10),i=parseInt(t.getAttribute("r")||"0",10),n=new ca(e,r,i);return xa(t,n),wa(t,n),n}};function xa(t,e){"userSpaceOnUse"===t.getAttribute("gradientUnits")&&(e.global=!0)}function wa(t,e){for(var r=t.firstChild;r;){if(1===r.nodeType&&"stop"===r.nodeName.toLocaleLowerCase()){var i=r.getAttribute("offset"),n=void 0;n=i&&i.indexOf("%")>0?parseInt(i,10)/100:i?parseFloat(i):0;var o={};za(r,o,o);var a=o.stopColor||r.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:n,color:a})}r=r.nextSibling}}function ba(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),C(e.__inheritedStyle,t.__inheritedStyle))}function Sa(t){for(var e=Ma(t),r=[],i=0;i0;o-=2){var a=i[o],s=i[o-1],h=Ma(a);switch(n=n||[1,0,0,1,0,0],s){case"translate":re(n,n,[parseFloat(h[0]),parseFloat(h[1]||"0")]);break;case"scale":ne(n,n,[parseFloat(h[0]),parseFloat(h[1]||h[0])]);break;case"rotate":ie(n,n,-parseFloat(h[0])*La);break;case"skewX":ee(n,[1,0,Math.tan(parseFloat(h[0])*La),1,0,0],n);break;case"skewY":ee(n,[1,Math.tan(parseFloat(h[0])*La),0,1,0,0],n);break;case"matrix":n[0]=parseFloat(h[0]),n[1]=parseFloat(h[1]),n[2]=parseFloat(h[2]),n[3]=parseFloat(h[3]),n[4]=parseFloat(h[4]),n[5]=parseFloat(h[5])}}e.setLocalTransform(n)}}(t,e),za(t,a,s),i||function(t,e,r){for(var i=0;iL*L+D*D&&(k=C,T=P),{cx:k,cy:T,x0:-u,y0:-c,x1:k*(n/w-1),y1:T*(n/w-1)}}function ja(t,e){var r,i=Wa(e.r,0),n=Wa(e.r0||0,0),o=i>0;if(o||n>0){if(o||(i=n,n=0),n>i){var a=i;i=n,n=a}var s=e.startAngle,h=e.endAngle;if(!isNaN(s)&&!isNaN(h)){var l=e.cx,u=e.cy,c=!!e.clockwise,f=Ha(h-s),p=f>Ra&&f%Ra;if(p>qa&&(f=p),i>qa)if(f>Ra-qa)t.moveTo(l+i*Fa(s),u+i*Oa(s)),t.arc(l,u,i,s,h,!c),n>qa&&(t.moveTo(l+n*Fa(h),u+n*Oa(h)),t.arc(l,u,n,h,s,c));else{var d=void 0,v=void 0,y=void 0,g=void 0,_=void 0,m=void 0,x=void 0,w=void 0,b=void 0,S=void 0,k=void 0,T=void 0,C=void 0,P=void 0,M=void 0,A=void 0,L=i*Fa(s),D=i*Oa(s),z=n*Fa(h),I=n*Oa(h),R=f>qa;if(R){var O=e.cornerRadius;O&&(r=function(t){var e;if(B(t)){var r=t.length;if(!r)return t;e=1===r?[t[0],t[0],0,0]:2===r?[t[0],t[0],t[1],t[1]]:3===r?t.concat(t[2]):t}else e=[t,t,t,t];return e}(O),d=r[0],v=r[1],y=r[2],g=r[3]);var F=Ha(i-n)/2;if(_=Xa(F,y),m=Xa(F,g),x=Xa(F,d),w=Xa(F,v),k=b=Wa(_,m),T=S=Wa(x,w),(b>qa||S>qa)&&(C=i*Fa(h),P=i*Oa(h),M=n*Fa(s),A=n*Oa(s),fqa){var j=Xa(y,k),V=Xa(g,k),U=Ya(M,A,L,D,i,j,c),G=Ya(C,P,z,I,i,V,c);t.moveTo(l+U.cx+U.x0,u+U.cy+U.y0),k0&&t.arc(l+U.cx,u+U.cy,j,Ea(U.y0,U.x0),Ea(U.y1,U.x1),!c),t.arc(l,u,i,Ea(U.cy+U.y1,U.cx+U.x1),Ea(G.cy+G.y1,G.cx+G.x1),!c),V>0&&t.arc(l+G.cx,u+G.cy,V,Ea(G.y1,G.x1),Ea(G.y0,G.x0),!c))}else t.moveTo(l+L,u+D),t.arc(l,u,i,s,h,!c);else t.moveTo(l+L,u+D);n>qa&&R?T>qa?(j=Xa(d,T),U=Ya(z,I,C,P,n,-(V=Xa(v,T)),c),G=Ya(L,D,M,A,n,-j,c),t.lineTo(l+U.cx+U.x0,u+U.cy+U.y0),T0&&t.arc(l+U.cx,u+U.cy,V,Ea(U.y0,U.x0),Ea(U.y1,U.x1),!c),t.arc(l,u,n,Ea(U.cy+U.y1,U.cx+U.x1),Ea(G.cy+G.y1,G.cx+G.x1),c),j>0&&t.arc(l+G.cx,u+G.cy,j,Ea(G.y1,G.x1),Ea(G.y0,G.x0),!c))):(t.lineTo(l+z,u+I),t.arc(l,u,n,h,s,c)):t.lineTo(l+z,u+I)}else t.moveTo(l,u);t.closePath()}}}var Va=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},Ua=function(t){function e(e){return t.call(this,e)||this}return ft(e,t),e.prototype.getDefaultShape=function(){return new Va},e.prototype.buildPath=function(t,e){ja(t,e)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(xo);Ua.prototype.type="sector";var Ga=Jn.CMD;function Za(t,e){return Math.abs(t-e)<1e-5}function Ka(t){var e,r,i,n,o,a=t.data,s=t.len(),h=[],l=0,u=0,c=0,f=0;function p(t,r){e&&e.length>2&&h.push(e),e=[t,r]}function d(t,r,i,n){Za(t,i)&&Za(r,n)||e.push(t,r,i,n,i,n)}function v(t,r,i,n,o,a){var s=Math.abs(r-t),h=4*Math.tan(s/4)/3,l=rk:P2&&h.push(e),h}function Qa(t,e,r,i,n,o,a,s,h,l){if(Za(t,r)&&Za(e,i)&&Za(n,a)&&Za(o,s))h.push(a,s);else{var u=2/l,c=u*u,f=a-t,p=s-e,d=Math.sqrt(f*f+p*p);f/=d,p/=d;var v=r-t,y=i-e,g=n-a,_=o-s,m=v*v+y*y,x=g*g+_*_;if(m=0&&x-b*b=0)h.push(a,s);else{var S=[],k=[];Je(t,r,n,a,.5,S),Je(e,i,o,s,.5,k),Qa(S[0],k[0],S[1],k[1],S[2],k[2],S[3],k[3],h,l),Qa(S[4],k[4],S[5],k[5],S[6],k[6],S[7],k[7],h,l)}}}}function $a(t,e,r){var i=t[e],n=t[1-e],o=Math.abs(i/n),a=Math.ceil(Math.sqrt(o*r)),s=Math.floor(r/a);0===s&&(s=1,a=r);for(var h=[],l=0;l0)for(l=0;lMath.abs(l),c=$a([h,l],u?0:1,e),f=(u?s:l)/c.length,p=0;p1?null:new se(p*h+t,p*l+e)}function rs(t,e,r){var i=new se;se.sub(i,r,e),i.normalize();var n=new se;return se.sub(n,t,e),n.dot(i)}function is(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function ns(t){var e=t.points,r=[],i=[];An(e,r,i);var n=new ye(r[0],r[1],i[0]-r[0],i[1]-r[1]),o=n.width,a=n.height,s=n.x,h=n.y,l=new se,u=new se;return o>a?(l.x=u.x=s+o/2,l.y=h,u.y=h+a):(l.y=u.y=h+a/2,l.x=s,u.x=s+o),function(t,e,r){for(var i=t.length,n=[],o=0;on,a=$a([i,n],o?0:1,e),s=o?"width":"height",h=o?"height":"width",l=o?"x":"y",u=o?"y":"x",c=t[s]/a.length,f=0;f0)for(var w=i/r,b=-i/2;b<=i/2;b+=w){var S=Math.sin(b),k=Math.cos(b),T=0;for(m=0;m0;h/=2){var l=0,u=0;(t&h)>0&&(l=1),(e&h)>0&&(u=1),s+=h*h*(3*l^u),0===u&&(1===l&&(t=h-1-t,e=h-1-e),a=t,t=e,e=a)}return s}function ws(t){var e=1/0,r=1/0,i=-1/0,n=-1/0,o=z(t,(function(t){var o=t.getBoundingRect(),a=t.getComputedTransform(),s=o.x+o.width/2+(a?a[4]:0),h=o.y+o.height/2+(a?a[5]:0);return e=Math.min(s,e),r=Math.min(h,r),i=Math.max(s,i),n=Math.max(h,n),[s,h]}));return z(o,(function(o,a){return{cp:o,z:xs(o[0],o[1],e,r,i,n),path:t[a]}})).sort((function(t,e){return t.z-e.z})).map((function(t){return t.path}))}function bs(t){return as(t.path,t.count)}var Ss=Object.freeze({__proto__:null,alignBezierCurves:ls,centroid:us,isCombineMorphing:ps,isMorphing:function(t){return t.__morphT>=0},morphPath:ms,combineMorph:function(t,e,r){var i=[];!function t(e){for(var r=0;r=a;h++)s-=a;var l=ji(r,e);return l>s&&(r="",l=0),s=t-l,n.ellipsis=r,n.ellipsisWidth=l,n.contentWidth=s,n.containerWidth=t,n}function Os(t,e){var r=e.containerWidth,i=e.font,n=e.contentWidth;if(!r)return"";var o=ji(t,i);if(o<=r)return t;for(var a=0;;a++){if(o<=n||a>=e.maxIterations){t+=e.ellipsis;break}var s=0===a?Fs(t,n,e.ascCharWidth,e.cnCharWidth):o>0?Math.floor(t.length*n/o):0;o=ji(t=t.substr(0,s),i)}return""===t&&(t=e.placeholder),t}function Fs(t,e,r,i){for(var n=0,o=0,a=t.length;o0&&d+i.accumWidth>i.width&&(o=e.split("\n"),c=!0),i.accumWidth=d}else{var v=qs(e,u,i.width,i.breakAll,i.accumWidth);i.accumWidth=v.accumWidth+p,a=v.linesWidths,o=v.lines}}else o=e.split("\n");for(var y=0;y=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}(t)||!!Ws[t]}function qs(t,e,r,i,n){for(var o=[],a=[],s="",h="",l=0,u=0,c=0;cr:n+u+p>r)?u?(s||h)&&(d?(s||(s=h,h="",u=l=0),o.push(s),a.push(u-l),h+=f,s="",u=l+=p):(h&&(s+=h,h="",l=0),o.push(s),a.push(u),s=f,u=p)):d?(o.push(h),a.push(l),h=f,l=p):(o.push(f),a.push(p)):(u+=p,d?(h+=f,l+=p):(h&&(s+=h,h="",l=0),s+=f))}else h&&(s+=h,u+=l),o.push(s),a.push(u),s="",h="",l=0,u=0}return o.length||s||(s=t,h="",l=0),h&&(s+=h),s&&(o.push(s),a.push(u)),1===o.length&&(u+=n),{accumWidth:u,lines:o,linesWidths:a}}var Ys={fill:"#000"},js={style:C({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},vn.style)},Vs=function(t){function e(e){var r=t.call(this)||this;return r.type="text",r._children=[],r._defaultStyle=Ys,r.attr(e),r}return ft(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;ep&&u){var d=Math.floor(p/h);r=r.slice(0,d)}if(t&&a&&null!=c)for(var v=Rs(c,o,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),y=0;y0,C=null!=t.width&&("truncate"===t.overflow||"break"===t.overflow||"breakAll"===t.overflow),P=i.calculatedLineHeight,M=0;Mh&&Ns(r,t.substring(h,l),e,s),Ns(r,i[2],e,s,i[1]),h=zs.lastIndex}ho){w>0?(_.tokens=_.tokens.slice(0,w),y(_,x,m),r.lines=r.lines.slice(0,g+1)):r.lines=r.lines.slice(0,g);break t}var P=b.width,M=null==P||"auto"===P;if("string"==typeof P&&"%"===P.charAt(P.length-1))z.percentWidth=P,u.push(z),z.contentWidth=ji(z.text,T);else{if(M){var A=b.backgroundColor,L=A&&A.image;L&&Ds(L=Ms(L))&&(z.width=Math.max(z.width,L.width*C/L.height))}var D=d&&null!=n?n-x:null;null!=D&&D=0&&"right"===(P=m[C]).align;)this._placeToken(P,t,w,d,T,"right",y),b-=P.width,T-=P.width,C--;for(k+=(r-(k-p)-(v-T)-b)/2;S<=C;)P=m[S],this._placeToken(P,t,w,d,k+P.width/2,"center",y),k+=P.width,S++;d+=w}},e.prototype._placeToken=function(t,e,r,i,n,o,s){var h=e.rich[t.styleName]||{};h.text=t.text;var l=t.verticalAlign,u=i+r/2;"top"===l?u=i+t.height/2:"bottom"===l&&(u=i+r-t.height/2),!t.isLineHolder&&nh(h)&&this._renderBackground(h,e,"right"===o?n-t.width:"center"===o?n-t.width/2:n,u-t.height/2,t.width,t.height);var c=!!h.backgroundColor,f=t.textPadding;f&&(n=rh(n,o,f),u-=t.height/2-f[0]-t.innerHeight/2);var p=this._getOrCreateChild(pa),d=p.createStyle();p.useStyle(d);var v=this._defaultStyle,y=!1,g=0,_=eh("fill"in h?h.fill:"fill"in e?e.fill:(y=!0,v.fill)),m=th("stroke"in h?h.stroke:"stroke"in e?e.stroke:c||s||v.autoStroke&&!y?null:(g=2,v.stroke)),x=h.textShadowBlur>0||e.textShadowBlur>0;d.text=t.text,d.x=n,d.y=u,x&&(d.shadowBlur=h.textShadowBlur||e.textShadowBlur||0,d.shadowColor=h.textShadowColor||e.textShadowColor||"transparent",d.shadowOffsetX=h.textShadowOffsetX||e.textShadowOffsetX||0,d.shadowOffsetY=h.textShadowOffsetY||e.textShadowOffsetY||0),d.textAlign=o,d.textBaseline="middle",d.font=t.font||a,d.opacity=Z(h.opacity,e.opacity,1),Qs(d,h),m&&(d.lineWidth=Z(h.lineWidth,e.lineWidth,g),d.lineDash=G(h.lineDash,e.lineDash),d.lineDashOffset=e.lineDashOffset||0,d.stroke=m),_&&(d.fill=_);var w=t.contentWidth,b=t.contentHeight;p.setBoundingRect(new ye(Ui(d.x,w,d.textAlign),Gi(d.y,b,d.textBaseline),w,b))},e.prototype._renderBackground=function(t,e,r,i,n,o){var a,s,h,l=t.backgroundColor,u=t.borderWidth,c=t.borderColor,f=l&&l.image,p=l&&!f,d=t.borderRadius,v=this;if(p||t.lineHeight||u&&c){(a=this._getOrCreateChild(Qo)).useStyle(a.createStyle()),a.style.fill=null;var y=a.shape;y.x=r,y.y=i,y.width=n,y.height=o,y.r=d,a.dirtyShape()}if(p)(h=a.style).fill=l||null,h.fillOpacity=G(t.fillOpacity,1);else if(f){(s=this._getOrCreateChild(Yo)).onload=function(){v.dirtyStyle()};var g=s.style;g.image=l.image,g.x=r,g.y=i,g.width=n,g.height=o}u&&c&&((h=a.style).lineWidth=u,h.stroke=c,h.strokeOpacity=G(t.strokeOpacity,1),h.lineDash=t.borderDash,h.lineDashOffset=t.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(h.strokeFirst=!0,h.lineWidth*=2));var _=(a||s).style;_.shadowBlur=t.shadowBlur||0,_.shadowColor=t.shadowColor||"transparent",_.shadowOffsetX=t.shadowOffsetX||0,_.shadowOffsetY=t.shadowOffsetY||0,_.opacity=Z(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";return $s(t)&&(e=[t.fontStyle,t.fontWeight,Ks(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),e&&J(e)||t.textFont||t.font},e}(_n),Us={left:!0,right:1,center:1},Gs={top:1,bottom:1,middle:1},Zs=["fontStyle","fontWeight","fontSize","fontFamily"];function Ks(t){return"string"!=typeof t||-1===t.indexOf("px")&&-1===t.indexOf("rem")&&-1===t.indexOf("em")?isNaN(+t)?"12px":t+"px":t}function Qs(t,e){for(var r=0;r4?o*Mh(2*Ph/r)/Mh(Ph/r):o/3);var s=Ph/r,h=-Ph/2,l=i+o*Mh(h),u=n+o*Ah(h);h+=s,t.moveTo(l,u);for(var c=0,f=2*r-1,p=void 0;cEh[1]){if(a=!1,n)return a;var l=Math.abs(Eh[0]-Bh[1]),u=Math.abs(Bh[0]-Eh[1]);Math.min(l,u)>i.len()&&(l=0&&qh(h)?h:.5,t.createRadialGradient(a,s,0,a,s,h)}(t,e,r):function(t,e,r){var i=null==e.x?0:e.x,n=null==e.x2?1:e.x2,o=null==e.y?0:e.y,a=null==e.y2?0:e.y2;return e.global||(i=i*r.width+r.x,n=n*r.width+r.x,o=o*r.height+r.y,a=a*r.height+r.y),i=qh(i)?i:0,n=qh(n)?n:1,o=qh(o)?o:0,a=qh(a)?a:0,t.createLinearGradient(i,o,n,a)}(t,e,r),n=e.colorStops,o=0;o0&&(e=i.lineDash,r=i.lineWidth,e&&"solid"!==e&&r>0?"dashed"===e?[4*r,2*r]:"dotted"===e?[r]:N(e)?[e]:B(e)?e:null:null),o=i.lineDashOffset;if(n){var a=i.strokeNoScale&&t.getLineScale?t.getLineScale():1;a&&1!==a&&(n=z(n,(function(t){return t/a})),o/=a)}return[n,o]}var Gh=new Jn(!0);function Zh(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function Kh(t){return"string"==typeof t&&"none"!==t}function Qh(t){var e=t.fill;return null!=e&&"none"!==e}function $h(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var r=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=r}else t.fill()}function Jh(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var r=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=r}else t.stroke()}function tl(t,e,r){var i=As(e.image,e.__image,r);if(Ds(i)){var n=t.createPattern(i,e.repeat||"repeat");if("function"==typeof DOMMatrix&&n&&n.setTransform){var o=new DOMMatrix;o.translateSelf(e.x||0,e.y||0),o.rotateSelf(0,0,(e.rotation||0)*lt),o.scaleSelf(e.scaleX||1,e.scaleY||1),n.setTransform(o)}return n}}var el=["shadowBlur","shadowOffsetX","shadowOffsetY"],rl=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function il(t,e,r,i,n){var o=!1;if(!i&&e===(r=r||{}))return!1;if(i||e.opacity!==r.opacity){al(t,n),o=!0;var a=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(a)?dn.opacity:a}(i||e.blend!==r.blend)&&(o||(al(t,n),o=!0),t.globalCompositeOperation=e.blend||dn.blend);for(var s=0;s=a)}}for(var u=this.__startIndex;u15)break}r.prevElClipPaths&&l.restore()};if(f)if(0===f.length)s=h.__endIndex;else for(var x=p.dpr,w=0;w0&&t>i[0]){for(s=0;st);s++);a=r[i[s]]}if(i.splice(s+1,0,t),r[t]=e,!e.virtual)if(a){var h=a.dom;h.nextSibling?o.insertBefore(e.dom,h.nextSibling):o.appendChild(e.dom)}else o.firstChild?o.insertBefore(e.dom,o.firstChild):o.appendChild(e.dom);e.__painter=this}else b("Layer of zlevel "+t+" is not valid")},t.prototype.eachLayer=function(t,e){for(var r=this._zlevelList,i=0;i0?pl:0),this._needsManuallyCompositing),l.__builtin__||b("ZLevel "+h+" has been used by unkown layer "+l.id),l!==o&&(l.__used=!0,l.__startIndex!==n&&(l.__dirty=!0),l.__startIndex=n,l.incremental?l.__drawIndex=-1:l.__drawIndex=n,e(n),o=l),1&s.__dirty&&!s.__inHover&&(l.__dirty=!0,l.incremental&&l.__drawIndex<0&&(l.__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)}))},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,D(this._layers,(function(t){t.setUnpainted()}))},t.prototype.configLayer=function(t,e){if(e){var r=this._layerConfig;r[t]?k(r[t],e,!0):r[t]=e;for(var i=0;i=_l:-h>=_l),f=h>0?h%_l:h%_l+_l,p=!1;p=!!c||!Fr(u)&&f>=gl==!!l;var d=t+r*yl(o),v=e+i*vl(o);this._start&&this._add("M",d,v);var y=Math.round(n*ml);if(c){var g=1/this._p,_=(l?1:-1)*(_l-g);this._add("A",r,i,y,1,+l,t+r*yl(o+_),e+i*vl(o+_)),g>.01&&this._add("A",r,i,y,0,+l,d,v)}else{var m=t+r*yl(a),x=e+i*vl(a);this._add("A",r,i,y,+p,+l,m,x)}},t.prototype.rect=function(t,e,r,i){this._add("M",t,e),this._add("l",r,0),this._add("l",0,i),this._add("l",-r,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(t,e,r,i,n,o,a,s,h){for(var l=[],u=this._p,c=1;c