import{_ as B}from"./tslib.60310f1a.js";var ms=function(){function e(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return e}(),ws=function(){function e(){this.browser=new ms,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return e}(),hr=new ws;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(hr.wxa=!0,hr.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?hr.worker=!0:typeof navigator>"u"?(hr.node=!0,hr.svgSupported=!0):Ts(navigator.userAgent,hr);function Ts(e,t){var r=t.browser,i=e.match(/Firefox\/([\d.]+)/),a=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),n=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);i&&(r.firefox=!0,r.version=i[1]),a&&(r.ie=!0,r.version=a[1]),n&&(r.edge=!0,r.version=n[1],r.newEdge=+n[1].split(".")[0]>18),o&&(r.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,t.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11),t.domSupported=typeof document<"u";var s=document.documentElement.style;t.transform3dSupported=(r.ie&&"transition"in s||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),t.transformSupported=t.transform3dSupported||r.ie&&+r.version>=9}const tt=hr;var ba=12,bs="sans-serif",cr=ba+"px "+bs,Cs=20,Ls=100,Ms="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function Ss(e){var t={};if(typeof JSON>"u")return t;for(var r=0;r=0)s=o*r.length;else for(var f=0;f>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[f]+":0",a[h]+":0",i[1-f]+":auto",a[1-h]+":auto",""].join("!important;"),e.appendChild(o),r.push(o)}return r}function Js(e,t,r){for(var i=r?"invTrans":"trans",a=t[i],n=t.srcCoords,o=[],s=[],f=!0,h=0;h<4;h++){var u=e[h].getBoundingClientRect(),l=2*h,v=u.left,c=u.top;o.push(v,c),f=f&&n&&v===n[l]&&c===n[l+1],s.push(e[h].offsetLeft,e[h].offsetTop)}return f&&a?a:(t.srcCoords=o,t[i]=r?ka(s,o):ka(o,s))}function uo(e){return e.nodeName.toUpperCase()==="CANVAS"}var js=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,di=[],tf=tt.browser.firefox&&+tt.browser.version.split(".")[0]<39;function ji(e,t,r,i){return r=r||{},i?$a(e,t,r):tf&&t.layerX!=null&&t.layerX!==t.offsetX?(r.zrX=t.layerX,r.zrY=t.layerY):t.offsetX!=null?(r.zrX=t.offsetX,r.zrY=t.offsetY):$a(e,t,r),r}function $a(e,t,r){if(tt.domSupported&&e.getBoundingClientRect){var i=t.clientX,a=t.clientY;if(uo(e)){var n=e.getBoundingClientRect();r.zrX=i-n.left,r.zrY=a-n.top;return}else if(Ji(di,e,i,a)){r.zrX=di[0],r.zrY=di[1];return}}r.zrX=r.zrY=0}function Pa(e){return e||window.event}function yt(e,t,r){if(t=Pa(t),t.zrX!=null)return t;var i=t.type,a=i&&i.indexOf("touch")>=0;if(a){var o=i!=="touchend"?t.targetTouches[0]:t.changedTouches[0];o&&ji(e,o,t,r)}else{ji(e,t,t,r);var n=rf(t);t.zrDelta=n?n/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&js.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function rf(e){var t=e.wheelDelta;if(t)return t;var r=e.deltaX,i=e.deltaY;if(r==null||i==null)return t;var a=Math.abs(i!==0?i:r),n=i>0?-1:i<0?1:r>0?-1:1;return 3*a*n}function ef(e,t,r,i){e.addEventListener(t,r,i)}function af(e,t,r,i){e.removeEventListener(t,r,i)}var nf=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function Nl(e){return e.which===2||e.which===3}var of=function(){function e(){this._track=[]}return e.prototype.recognize=function(t,r,i){return this._doTrack(t,r,i),this._recognize(t)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(t,r,i){var a=t.touches;if(!!a){for(var n={points:[],touches:[],target:r,event:t},o=0,s=a.length;o1&&i&&i.length>1){var n=Ya(i)/Ya(a);!isFinite(n)&&(n=1),t.pinchScale=n;var o=sf(i);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:e[0].target,event:t}}}}},lo="silent";function ff(e,t,r){return{type:e,event:r,target:t.target,topTarget:t.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:hf}}function hf(){nf(this.event)}var uf=function(e){B(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.handler=null,r}return t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}($r),Wr=function(){function e(t,r){this.x=t,this.y=r}return e}(),lf=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],vo=function(e){B(t,e);function t(r,i,a,n){var o=e.call(this)||this;return o._hovered=new Wr(0,0),o.storage=r,o.painter=i,o.painterRoot=n,a=a||new uf,o.proxy=null,o.setHandlerProxy(a),o._draggingMgr=new Ns(o),o}return t.prototype.setHandlerProxy=function(r){this.proxy&&this.proxy.dispose(),r&&(J(lf,function(i){r.on&&r.on(i,this[i],this)},this),r.handler=this),this.proxy=r},t.prototype.mousemove=function(r){var i=r.zrX,a=r.zrY,n=co(this,i,a),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var f=this._hovered=n?new Wr(i,a):this.findHover(i,a),h=f.target,u=this.proxy;u.setCursor&&u.setCursor(h?h.cursor:"default"),s&&h!==s&&this.dispatchToElement(o,"mouseout",r),this.dispatchToElement(f,"mousemove",r),h&&h!==s&&this.dispatchToElement(f,"mouseover",r)},t.prototype.mouseout=function(r){var i=r.zrEventControl;i!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",r),i!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:r})},t.prototype.resize=function(){this._hovered=new Wr(0,0)},t.prototype.dispatch=function(r,i){var a=this[r];a&&a.call(this,i)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(r){var i=this.proxy;i.setCursor&&i.setCursor(r)},t.prototype.dispatchToElement=function(r,i,a){r=r||{};var n=r.target;if(!(n&&n.silent)){for(var o="on"+i,s=ff(i,r,a);n&&(n[o]&&(s.cancelBubble=!!n[o].call(n,s)),n.trigger(i,s),n=n.__hostTarget?n.__hostTarget:n.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(i,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(f){typeof f[o]=="function"&&f[o].call(f,s),f.trigger&&f.trigger(i,s)}))}},t.prototype.findHover=function(r,i,a){for(var n=this.storage.getDisplayList(),o=new Wr(r,i),s=n.length-1;s>=0;s--){var f=void 0;if(n[s]!==a&&!n[s].ignore&&(f=vf(n[s],r,i))&&(!o.topTarget&&(o.topTarget=n[s]),f!==lo)){o.target=n[s];break}}return o},t.prototype.processGesture=function(r,i){this._gestureMgr||(this._gestureMgr=new of);var a=this._gestureMgr;i==="start"&&a.clear();var n=a.recognize(r,this.findHover(r.zrX,r.zrY,null).target,this.proxy.dom);if(i==="end"&&a.clear(),n){var o=n.type;r.gestureEvent=o;var s=new Wr;s.target=n.target,this.dispatchToElement(s,o,n.event)}},t}($r);J(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(e){vo.prototype[e]=function(t){var r=t.zrX,i=t.zrY,a=co(this,r,i),n,o;if((e!=="mouseup"||!a)&&(n=this.findHover(r,i),o=n.target),e==="mousedown")this._downEl=o,this._downPoint=[t.zrX,t.zrY],this._upEl=o;else if(e==="mouseup")this._upEl=o;else if(e==="click"){if(this._downEl!==this._upEl||!this._downPoint||Gs(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,e,t)}});function vf(e,t,r){if(e[e.rectHover?"rectContain":"contain"](t,r)){for(var i=e,a=void 0,n=!1;i;){if(i.ignoreClip&&(n=!0),!n){var o=i.getClipPath();if(o&&!o.contain(t,r))return!1;i.silent&&(a=!0)}var s=i.__hostTarget;i=s||i.parent}return a?lo:!0}return!1}function co(e,t,r){var i=e.painter;return t<0||t>i.getWidth()||r<0||r>i.getHeight()}const cf=vo;var po=32,Xr=7;function df(e){for(var t=0;e>=po;)t|=e&1,e>>=1;return e+t}function Wa(e,t,r,i){var a=t+1;if(a===r)return 1;if(i(e[a++],e[t])<0){for(;a=0;)a++;return a-t}function pf(e,t,r){for(r--;t>>1,a(n,e[f])<0?s=f:o=f+1;var h=i-o;switch(h){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;h>0;)e[o+h]=e[o+h-1],h--}e[o]=n}}function _i(e,t,r,i,a,n){var o=0,s=0,f=1;if(n(e,t[r+a])>0){for(s=i-a;f0;)o=f,f=(f<<1)+1,f<=0&&(f=s);f>s&&(f=s),o+=a,f+=a}else{for(s=a+1;fs&&(f=s);var h=o;o=a-f,f=a-h}for(o++;o>>1);n(e,t[r+u])>0?o=u+1:f=u}return f}function gi(e,t,r,i,a,n){var o=0,s=0,f=1;if(n(e,t[r+a])<0){for(s=a+1;fs&&(f=s);var h=o;o=a-f,f=a-h}else{for(s=i-a;f=0;)o=f,f=(f<<1)+1,f<=0&&(f=s);f>s&&(f=s),o+=a,f+=a}for(o++;o>>1);n(e,t[r+u])<0?f=u:o=u+1}return f}function _f(e,t){var r=Xr,i,a,n=0;e.length;var o=[];i=[],a=[];function s(c,_){i[n]=c,a[n]=_,n+=1}function f(){for(;n>1;){var c=n-2;if(c>=1&&a[c-1]<=a[c]+a[c+1]||c>=2&&a[c-2]<=a[c]+a[c-1])a[c-1]a[c+1])break;u(c)}}function h(){for(;n>1;){var c=n-2;c>0&&a[c-1]=Xr||L>=Xr);if(C)break;b<0&&(b=0),b+=2}if(r=b,r<1&&(r=1),_===1){for(p=0;p=0;p--)e[w+p]=e[b+p];e[T]=o[m];return}for(var L=r;;){var C=0,M=0,S=!1;do if(t(o[m],e[y])<0){if(e[T--]=e[y--],C++,M=0,--_===0){S=!0;break}}else if(e[T--]=o[m--],M++,C=0,--d===1){S=!0;break}while((C|M)=0;p--)e[w+p]=e[b+p];if(_===0){S=!0;break}}if(e[T--]=o[m--],--d===1){S=!0;break}if(M=d-_i(e[y],o,0,d,d-1,t),M!==0){for(T-=M,m-=M,d-=M,w=T+1,b=m+1,p=0;p=Xr||M>=Xr);if(S)break;L<0&&(L=0),L+=2}if(r=L,r<1&&(r=1),d===1){for(T-=_,y-=_,w=T+1,b=y+1,p=_-1;p>=0;p--)e[w+p]=e[b+p];e[T]=o[m]}else{if(d===0)throw new Error;for(b=T-(d-1),p=0;ps&&(f=s),Xa(e,r,r+f,r+n,t),n=f}o.pushRun(r,n),o.mergeRuns(),a-=n,r+=n}while(a!==0);o.forceMergeRuns()}}var ht=1,Qr=2,Cr=4,Ga=!1;function yi(){Ga||(Ga=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function qa(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var yf=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=qa}return e.prototype.traverse=function(t,r){for(var i=0;i0&&(u.__clipPaths=[]),isNaN(u.z)&&(yi(),u.z=0),isNaN(u.z2)&&(yi(),u.z2=0),isNaN(u.zlevel)&&(yi(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var l=t.getDecalElement&&t.getDecalElement();l&&this._updateAndAddDisplayable(l,r,i);var v=t.getTextGuideLine();v&&this._updateAndAddDisplayable(v,r,i);var c=t.getTextContent();c&&this._updateAndAddDisplayable(c,r,i)}},e.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},e.prototype.delRoot=function(t){if(t instanceof Array){for(var r=0,i=t.length;r=0&&this._roots.splice(a,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}();const mf=yf;var _o;_o=tt.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};const ta=_o;var ke={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:Math.pow(1024,e-1)},exponentialOut:function(e){return e===1?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,r=.1,i=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)))},elasticOut:function(e){var t,r=.1,i=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/i)+1)},elasticInOut:function(e){var t,r=.1,i=.4;return e===0?0:e===1?1:(!r||r<1?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?-.5*(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)):r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-ke.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?ke.bounceIn(e*2)*.5:ke.bounceOut(e*2-1)*.5+.5}};const go=ke;var _e=Math.pow,Wt=Math.sqrt,Ue=1e-8,yo=1e-4,Ua=Wt(3),ge=1/3,Rt=zr(),dt=zr(),Hr=zr();function $t(e){return e>-Ue&&eUe||e<-Ue}function N(e,t,r,i,a){var n=1-a;return n*n*(n*e+3*a*t)+a*a*(a*i+3*n*r)}function Za(e,t,r,i,a){var n=1-a;return 3*(((t-e)*n+2*(r-t)*a)*n+(i-r)*a*a)}function wo(e,t,r,i,a,n){var o=i+3*(t-r)-e,s=3*(r-t*2+e),f=3*(t-e),h=e-a,u=s*s-3*o*f,l=s*f-9*o*h,v=f*f-3*s*h,c=0;if($t(u)&&$t(l))if($t(s))n[0]=0;else{var _=-f/s;_>=0&&_<=1&&(n[c++]=_)}else{var g=l*l-4*u*v;if($t(g)){var d=l/u,_=-s/o+d,p=-d/2;_>=0&&_<=1&&(n[c++]=_),p>=0&&p<=1&&(n[c++]=p)}else if(g>0){var y=Wt(g),m=u*s+1.5*o*(-l+y),T=u*s+1.5*o*(-l-y);m<0?m=-_e(-m,ge):m=_e(m,ge),T<0?T=-_e(-T,ge):T=_e(T,ge);var _=(-s-(m+T))/(3*o);_>=0&&_<=1&&(n[c++]=_)}else{var b=(2*u*s-3*o*l)/(2*Wt(u*u*u)),w=Math.acos(b)/3,L=Wt(u),C=Math.cos(w),_=(-s-2*L*C)/(3*o),p=(-s+L*(C+Ua*Math.sin(w)))/(3*o),M=(-s+L*(C-Ua*Math.sin(w)))/(3*o);_>=0&&_<=1&&(n[c++]=_),p>=0&&p<=1&&(n[c++]=p),M>=0&&M<=1&&(n[c++]=M)}}return c}function To(e,t,r,i,a){var n=6*r-12*t+6*e,o=9*t+3*i-3*e-9*r,s=3*t-3*e,f=0;if($t(o)){if(mo(n)){var h=-s/n;h>=0&&h<=1&&(a[f++]=h)}}else{var u=n*n-4*o*s;if($t(u))a[0]=-n/(2*o);else if(u>0){var l=Wt(u),h=(-n+l)/(2*o),v=(-n-l)/(2*o);h>=0&&h<=1&&(a[f++]=h),v>=0&&v<=1&&(a[f++]=v)}}return f}function Xt(e,t,r,i,a,n){var o=(t-e)*a+e,s=(r-t)*a+t,f=(i-r)*a+r,h=(s-o)*a+o,u=(f-s)*a+s,l=(u-h)*a+h;n[0]=e,n[1]=o,n[2]=h,n[3]=l,n[4]=l,n[5]=u,n[6]=f,n[7]=i}function wf(e,t,r,i,a,n,o,s,f,h,u){var l,v=.005,c=1/0,_,g,d,p;Rt[0]=f,Rt[1]=h;for(var y=0;y<1;y+=.05)dt[0]=N(e,r,a,o,y),dt[1]=N(t,i,n,s,y),d=Or(Rt,dt),d=0&&d=0&&h<=1&&(a[f++]=h)}}else{var u=o*o-4*n*s;if($t(u)){var h=-o/(2*n);h>=0&&h<=1&&(a[f++]=h)}else if(u>0){var l=Wt(u),h=(-o+l)/(2*n),v=(-o-l)/(2*n);h>=0&&h<=1&&(a[f++]=h),v>=0&&v<=1&&(a[f++]=v)}}return f}function bo(e,t,r){var i=e+r-2*t;return i===0?.5:(e-t)/i}function Ze(e,t,r,i,a){var n=(t-e)*i+e,o=(r-t)*i+t,s=(o-n)*i+n;a[0]=e,a[1]=n,a[2]=s,a[3]=s,a[4]=o,a[5]=r}function Cf(e,t,r,i,a,n,o,s,f){var h,u=.005,l=1/0;Rt[0]=o,Rt[1]=s;for(var v=0;v<1;v+=.05){dt[0]=Q(e,r,a,v),dt[1]=Q(t,i,n,v);var c=Or(Rt,dt);c=0&&c=1?1:wo(0,i,n,1,f,s)&&N(0,a,o,1,s[0])}}}var Sf=function(){function e(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||Ir,this.ondestroy=t.ondestroy||Ir,this.onrestart=t.onrestart||Ir,t.easing&&this.setEasing(t.easing)}return e.prototype.step=function(t,r){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var i=this._life,a=t-this._startTime-this._pausedTime,n=a/i;n<0&&(n=0),n=Math.min(n,1);var o=this.easingFunc,s=o?o(n):n;if(this.onframe(s),n===1)if(this.loop){var f=a%i;this._startTime=t-f,this._pausedTime=0,this.onrestart()}else return!0;return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(t){this.easing=t,this.easingFunc=si(t)?t:go[t]||Co(t)},e}();const Pf=Sf;var Lo=function(){function e(t){this.value=t}return e}(),Rf=function(){function e(){this._len=0}return e.prototype.insert=function(t){var r=new Lo(t);return this.insertEntry(r),r},e.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++},e.prototype.remove=function(t){var r=t.prev,i=t.next;r?r.next=i:this.head=i,i?i.prev=r:this.tail=r,t.next=t.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),Df=function(){function e(t){this._list=new Rf,this._maxSize=10,this._map={},this._maxSize=t}return e.prototype.put=function(t,r){var i=this._list,a=this._map,n=null;if(a[t]==null){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var f=i.head;i.remove(f),delete a[f.key],n=f.value,this._lastRemovedEntry=f}s?s.value=r:s=new Lo(r),s.key=t,i.insertEntry(s),a[t]=s}return n},e.prototype.get=function(t){var r=this._map[t],i=this._list;if(r!=null)return r!==i.tail&&(i.remove(r),i.insertEntry(r)),r.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}();const Ra=Df;var Va={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 wt(e){return e=Math.round(e),e<0?0:e>255?255:e}function Af(e){return e=Math.round(e),e<0?0:e>360?360:e}function oe(e){return e<0?0:e>1?1:e}function mi(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?wt(parseFloat(t)/100*255):wt(parseInt(t,10))}function kr(e){var t=e;return t.length&&t.charAt(t.length-1)==="%"?oe(parseFloat(t)/100):oe(parseFloat(t))}function wi(e,t,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?e+(t-e)*r*6:r*2<1?t:r*3<2?e+(t-e)*(2/3-r)*6:e}function Yt(e,t,r){return e+(t-e)*r}function vt(e,t,r,i,a){return e[0]=t,e[1]=r,e[2]=i,e[3]=a,e}function ra(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var Mo=new Ra(20),ye=null;function _r(e,t){ye&&ra(ye,t),ye=Mo.put(e,ye||t.slice())}function Dt(e,t){if(!!e){t=t||[];var r=Mo.get(e);if(r)return ra(t,r);e=e+"";var i=e.replace(/ /g,"").toLowerCase();if(i in Va)return ra(t,Va[i]),_r(e,t),t;var a=i.length;if(i.charAt(0)==="#"){if(a===4||a===5){var n=parseInt(i.slice(1,4),16);if(!(n>=0&&n<=4095)){vt(t,0,0,0,1);return}return vt(t,(n&3840)>>4|(n&3840)>>8,n&240|(n&240)>>4,n&15|(n&15)<<4,a===5?parseInt(i.slice(4),16)/15:1),_r(e,t),t}else if(a===7||a===9){var n=parseInt(i.slice(1,7),16);if(!(n>=0&&n<=16777215)){vt(t,0,0,0,1);return}return vt(t,(n&16711680)>>16,(n&65280)>>8,n&255,a===9?parseInt(i.slice(7),16)/255:1),_r(e,t),t}return}var o=i.indexOf("("),s=i.indexOf(")");if(o!==-1&&s+1===a){var f=i.substr(0,o),h=i.substr(o+1,s-(o+1)).split(","),u=1;switch(f){case"rgba":if(h.length!==4)return h.length===3?vt(t,+h[0],+h[1],+h[2],1):vt(t,0,0,0,1);u=kr(h.pop());case"rgb":if(h.length!==3){vt(t,0,0,0,1);return}return vt(t,mi(h[0]),mi(h[1]),mi(h[2]),u),_r(e,t),t;case"hsla":if(h.length!==4){vt(t,0,0,0,1);return}return h[3]=kr(h[3]),ea(h,t),_r(e,t),t;case"hsl":if(h.length!==3){vt(t,0,0,0,1);return}return ea(h,t),_r(e,t),t;default:return}}vt(t,0,0,0,1)}}function ea(e,t){var r=(parseFloat(e[0])%360+360)%360/360,i=kr(e[1]),a=kr(e[2]),n=a<=.5?a*(i+1):a+i-a*i,o=a*2-n;return t=t||[],vt(t,wt(wi(o,n,r+1/3)*255),wt(wi(o,n,r)*255),wt(wi(o,n,r-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function xf(e){if(!!e){var t=e[0]/255,r=e[1]/255,i=e[2]/255,a=Math.min(t,r,i),n=Math.max(t,r,i),o=n-a,s=(n+a)/2,f,h;if(o===0)f=0,h=0;else{s<.5?h=o/(n+a):h=o/(2-n-a);var u=((n-t)/6+o/2)/o,l=((n-r)/6+o/2)/o,v=((n-i)/6+o/2)/o;t===n?f=v-l:r===n?f=1/3+u-v:i===n&&(f=2/3+l-u),f<0&&(f+=1),f>1&&(f-=1)}var c=[f*360,h,s];return e[3]!=null&&c.push(e[3]),c}}function Vl(e,t){var r=Dt(e);if(r){for(var i=0;i<3;i++)t<0?r[i]=r[i]*(1-t)|0:r[i]=(255-r[i])*t+r[i]|0,r[i]>255?r[i]=255:r[i]<0&&(r[i]=0);return ce(r,r.length===4?"rgba":"rgb")}}function Ql(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){r=r||[];var i=e*(t.length-1),a=Math.floor(i),n=Math.ceil(i),o=t[a],s=t[n],f=i-a;return r[0]=wt(Yt(o[0],s[0],f)),r[1]=wt(Yt(o[1],s[1],f)),r[2]=wt(Yt(o[2],s[2],f)),r[3]=oe(Yt(o[3],s[3],f)),r}}function Kl(e,t,r){if(!(!(t&&t.length)||!(e>=0&&e<=1))){var i=e*(t.length-1),a=Math.floor(i),n=Math.ceil(i),o=Dt(t[a]),s=Dt(t[n]),f=i-a,h=ce([wt(Yt(o[0],s[0],f)),wt(Yt(o[1],s[1],f)),wt(Yt(o[2],s[2],f)),oe(Yt(o[3],s[3],f))],"rgba");return r?{color:h,leftIndex:a,rightIndex:n,value:i}:h}}function Jl(e,t,r,i){var a=Dt(e);if(e)return a=xf(a),t!=null&&(a[0]=Af(t)),r!=null&&(a[1]=kr(r)),i!=null&&(a[2]=kr(i)),ce(ea(a),"rgba")}function jl(e,t){var r=Dt(e);if(r&&t!=null)return r[3]=oe(t),ce(r,"rgba")}function ce(e,t){if(!(!e||!e.length)){var r=e[0]+","+e[1]+","+e[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(r+=","+e[3]),t+"("+r+")"}}function Ne(e,t){var r=Dt(e);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*t:0}function Ef(e){return e.type==="linear"}function Ff(e){return e.type==="radial"}(function(){return tt.hasGlobalWindow&&si(window.btoa)?function(e){return window.btoa(unescape(e))}:typeof Buffer<"u"?function(e){return Buffer.from(e).toString("base64")}:function(e){return null}})();var ia=Array.prototype.slice;function It(e,t,r){return(t-e)*r+e}function Ti(e,t,r,i){for(var a=t.length,n=0;ni?t:e,n=Math.min(r,i),o=a[n-1]||{color:[0,0,0,0],offset:0},s=n;so;if(s)i.length=o;else for(var f=n;f=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(t,r,i){this._needsSort=!0;var a=this.keyframes,n=a.length,o=!1,s=Ka,f=r;if(At(r)){var h=Bf(r);s=h,(h===1&&!He(r[0])||h===2&&!He(r[0][0]))&&(o=!0)}else if(He(r)&&!Os(r))s=we;else if(Ge(r))if(!isNaN(+r))s=we;else{var u=Dt(r);u&&(f=u,s=Kr)}else if(Sa(r)){var l=$({},f);l.colorStops=xt(r.colorStops,function(c){return{offset:c.offset,color:Dt(c.color)}}),Ef(r)?s=aa:Ff(r)&&(s=na),f=l}n===0?this.valType=s:(s!==this.valType||s===Ka)&&(o=!0),this.discrete=this.discrete||o;var v={time:t,value:f,rawValue:r,percent:0};return i&&(v.easing=i,v.easingFunc=si(i)?i:go[i]||Co(i)),a.push(v),v},e.prototype.prepare=function(t,r){var i=this.keyframes;this._needsSort&&i.sort(function(g,d){return g.time-d.time});for(var a=this.valType,n=i.length,o=i[n-1],s=this.discrete,f=Te(a),h=Ja(a),u=0;u=0&&!(o[u].percent<=r);u--);u=v(u,s-2)}else{for(u=l;ur);u++);u=v(u-1,s-2)}_=o[u+1],c=o[u]}if(!!(c&&_)){this._lastFr=u,this._lastFrP=r;var d=_.percent-c.percent,p=d===0?1:v((r-c.percent)/d,1);_.easingFunc&&(p=_.easingFunc(p));var y=i?this._additiveValue:h?Gr:t[f];if((Te(n)||h)&&!y&&(y=this._additiveValue=[]),this.discrete)t[f]=p<1?c.rawValue:_.rawValue;else if(Te(n))n===Ye?Ti(y,c[a],_[a],p):If(y,c[a],_[a],p);else if(Ja(n)){var m=c[a],T=_[a],b=n===aa;t[f]={type:b?"linear":"radial",x:It(m.x,T.x,p),y:It(m.y,T.y,p),colorStops:xt(m.colorStops,function(L,C){var M=T.colorStops[C];return{offset:It(L.offset,M.offset,p),color:$e(Ti([],L.color,M.color,p))}}),global:T.global},b?(t[f].x2=It(m.x2,T.x2,p),t[f].y2=It(m.y2,T.y2,p)):t[f].r=It(m.r,T.r,p)}else if(h)Ti(y,c[a],_[a],p),i||(t[f]=$e(y));else{var w=It(c[a],_[a],p);i?this._additiveValue=w:t[f]=w}i&&this._addToTarget(t)}}},e.prototype._addToTarget=function(t){var r=this.valType,i=this.propName,a=this._additiveValue;r===we?t[i]=t[i]+a:r===Kr?(Dt(t[i],Gr),me(Gr,Gr,a,1),t[i]=$e(Gr)):r===Ye?me(t[i],t[i],a,1):r===So&&Qa(t[i],t[i],a,1)},e}(),Da=function(){function e(t,r,i,a){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=r,r&&a){Ma("Can' use additive animation on looped animation.");return}this._additiveAnimators=a,this._allowDiscrete=i}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(t){this._target=t},e.prototype.when=function(t,r,i){return this.whenWithKeys(t,r,j(r),i)},e.prototype.whenWithKeys=function(t,r,i,a){for(var n=this._tracks,o=0;o0&&f.addKeyframe(0,ze(h),a),this._trackKeys.push(s)}f.addKeyframe(t,ze(r[s]),a)}return this._maxTime=Math.max(this._maxTime,t),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var r=t.length,i=0;i0)){this._started=1;for(var r=this,i=[],a=this._maxTime||0,n=0;n1){var s=o.pop();n.addKeyframe(s.time,t[a]),n.prepare(this._maxTime,n.getAdditiveTrack())}}}},e}();function Ar(){return new Date().getTime()}var zf=function(e){B(t,e);function t(r){var i=e.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,r=r||{},i.stage=r.stage||{},i}return t.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},t.prototype.addAnimator=function(r){r.animation=this;var i=r.getClip();i&&this.addClip(i)},t.prototype.removeClip=function(r){if(!!r.animation){var i=r.prev,a=r.next;i?i.next=a:this._head=a,a?a.prev=i:this._tail=i,r.next=r.prev=r.animation=null}},t.prototype.removeAnimator=function(r){var i=r.getClip();i&&this.removeClip(i),r.animation=null},t.prototype.update=function(r){for(var i=Ar()-this._pausedTime,a=i-this._time,n=this._head;n;){var o=n.next,s=n.step(i,a);s&&(n.ondestroy(),this.removeClip(n)),n=o}this._time=i,r||(this.trigger("frame",a),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var r=this;this._running=!0;function i(){r._running&&(ta(i),!r._paused&&r.update())}ta(i)},t.prototype.start=function(){this._running||(this._time=Ar(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Ar(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Ar()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var r=this._head;r;){var i=r.next;r.prev=r.next=r.animation=null,r=i}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(r,i){i=i||{},this.start();var a=new Da(r,i.loop);return this.addAnimator(a),a},t}($r);const $f=zf;var Yf=300,bi=tt.domSupported,Ci=function(){var e=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=xt(e,function(a){var n=a.replace("mouse","pointer");return r.hasOwnProperty(n)?n:a});return{mouse:e,touch:t,pointer:i}}(),ja={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},tn=!1;function oa(e){var t=e.pointerType;return t==="pen"||t==="touch"}function Wf(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function Li(e){e&&(e.zrByTouch=!0)}function Xf(e,t){return yt(e.dom,new Gf(e,t),!0)}function Po(e,t){for(var r=t,i=!1;r&&r.nodeType!==9&&!(i=r.domBelongToZr||r!==t&&r===e.painterRoot);)r=r.parentNode;return i}var Gf=function(){function e(t,r){this.stopPropagation=Ir,this.stopImmediatePropagation=Ir,this.preventDefault=Ir,this.type=r.type,this.target=this.currentTarget=t.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return e}(),mt={mousedown:function(e){e=yt(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=yt(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",e)},mouseup:function(e){e=yt(this.dom,e),this.__togglePointerCapture(!1),this.trigger("mouseup",e)},mouseout:function(e){e=yt(this.dom,e);var t=e.toElement||e.relatedTarget;Po(this,t)||(this.__pointerCapturing&&(e.zrEventControl="no_globalout"),this.trigger("mouseout",e))},wheel:function(e){tn=!0,e=yt(this.dom,e),this.trigger("mousewheel",e)},mousewheel:function(e){tn||(e=yt(this.dom,e),this.trigger("mousewheel",e))},touchstart:function(e){e=yt(this.dom,e),Li(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,"start"),mt.mousemove.call(this,e),mt.mousedown.call(this,e)},touchmove:function(e){e=yt(this.dom,e),Li(e),this.handler.processGesture(e,"change"),mt.mousemove.call(this,e)},touchend:function(e){e=yt(this.dom,e),Li(e),this.handler.processGesture(e,"end"),mt.mouseup.call(this,e),+new Date-+this.__lastTouchMomentan||e<-an}var Nt=[],gr=[],Si=se(),Pi=Math.abs,jf=function(){function e(){}return e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},e.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},e.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},e.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},e.prototype.needLocalTransform=function(){return Zt(this.rotation)||Zt(this.x)||Zt(this.y)||Zt(this.scaleX-1)||Zt(this.scaleY-1)||Zt(this.skewX)||Zt(this.skewY)},e.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,r=this.needLocalTransform(),i=this.transform;if(!(r||t)){i&&en(i);return}i=i||se(),r?this.getLocalTransform(i):en(i),t&&(r?ee(i,t,i):Kf(i,t)),this.transform=i,this._resolveGlobalScaleRatio(i)},e.prototype._resolveGlobalScaleRatio=function(t){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Nt);var i=Nt[0]<0?-1:1,a=Nt[1]<0?-1:1,n=((Nt[0]-i)*r+i)/Nt[0]||0,o=((Nt[1]-a)*r+a)/Nt[1]||0;t[0]*=n,t[1]*=n,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||se(),Jf(this.invTransform,t)},e.prototype.getComputedTransform=function(){for(var t=this,r=[];t;)r.push(t),t=t.parent;for(;t=r.pop();)t.updateTransform();return this.transform},e.prototype.setLocalTransform=function(t){if(!!t){var r=t[0]*t[0]+t[1]*t[1],i=t[2]*t[2]+t[3]*t[3],a=Math.atan2(t[1],t[0]),n=Math.PI/2+a-Math.atan2(t[3],t[2]);i=Math.sqrt(i)*Math.cos(n),r=Math.sqrt(r),this.skewX=n,this.skewY=0,this.rotation=-a,this.x=+t[4],this.y=+t[5],this.scaleX=r,this.scaleY=i,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(!!this.transform){var t=this.parent,r=this.transform;t&&t.transform&&(ee(gr,t.invTransform,r),r=gr);var i=this.originX,a=this.originY;(i||a)&&(Si[4]=i,Si[5]=a,ee(gr,r,Si),gr[4]-=i,gr[5]-=a,r=gr),this.setLocalTransform(r)}},e.prototype.getGlobalScale=function(t){var r=this.transform;return t=t||[],r?(t[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),t[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(t[0]=-t[0]),r[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},e.prototype.transformCoordToLocal=function(t,r){var i=[t,r],a=this.invTransform;return a&&re(i,i,a),i},e.prototype.transformCoordToGlobal=function(t,r){var i=[t,r],a=this.transform;return a&&re(i,i,a),i},e.prototype.getLineScale=function(){var t=this.transform;return t&&Pi(t[0]-1)>1e-10&&Pi(t[3]-1)>1e-10?Math.sqrt(Pi(t[0]*t[3]-t[2]*t[1])):1},e.prototype.copyTransform=function(t){th(this,t)},e.getLocalTransform=function(t,r){r=r||[];var i=t.originX||0,a=t.originY||0,n=t.scaleX,o=t.scaleY,s=t.anchorX,f=t.anchorY,h=t.rotation||0,u=t.x,l=t.y,v=t.skewX?Math.tan(t.skewX):0,c=t.skewY?Math.tan(-t.skewY):0;if(i||a||s||f){var _=i+s,g=a+f;r[4]=-_*n-v*g*o,r[5]=-g*o-c*_*n}else r[4]=r[5]=0;return r[0]=n,r[3]=o,r[1]=c*n,r[2]=v*o,h&&Do(r,r,h),r[4]+=i+u,r[5]+=a+l,r},e.initDefaultProps=function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0}(),e}(),fe=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function th(e,t){for(var r=0;r_&&(_=m,g_&&(_=T,p=i.x&&t<=i.x+i.width&&r>=i.y&&r<=i.y+i.height},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(t,r){t.x=r.x,t.y=r.y,t.width=r.width,t.height=r.height},e.applyTransform=function(t,r,i){if(!i){t!==r&&e.copy(t,r);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var a=i[0],n=i[3],o=i[4],s=i[5];t.x=r.x*a+o,t.y=r.y*n+s,t.width=r.width*a,t.height=r.height*n,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}Vt.x=Kt.x=r.x,Vt.y=Jt.y=r.y,Qt.x=Jt.x=r.x+r.width,Qt.y=Kt.y=r.y+r.height,Vt.transform(i),Jt.transform(i),Qt.transform(i),Kt.transform(i),t.x=be(Vt.x,Qt.x,Kt.x,Jt.x),t.y=be(Vt.y,Qt.y,Kt.y,Jt.y);var f=Ce(Vt.x,Qt.x,Kt.x,Jt.x),h=Ce(Vt.y,Qt.y,Kt.y,Jt.y);t.width=f-t.x,t.height=h-t.y},e}();const W=eh;var nn={};function ut(e,t){t=t||cr;var r=nn[t];r||(r=nn[t]=new Ra(500));var i=r.get(e);return i==null&&(i=le.measureText(e,t).width,r.put(e,i)),i}function on(e,t,r,i){var a=ut(e,t),n=xa(t),o=Jr(0,a,r),s=Lr(0,n,i),f=new W(o,s,a,n);return f}function ih(e,t,r,i){var a=((e||"")+"").split(` `),n=a.length;if(n===1)return on(a[0],t,r,i);for(var o=new W(0,0,0,0),s=0;s=0?parseFloat(e)/100*t:parseFloat(e):e}function ah(e,t,r){var i=t.position||"inside",a=t.distance!=null?t.distance:5,n=r.height,o=r.width,s=n/2,f=r.x,h=r.y,u="left",l="top";if(i instanceof Array)f+=he(i[0],r.width),h+=he(i[1],r.height),u=null,l=null;else switch(i){case"left":f-=a,h+=s,u="right",l="middle";break;case"right":f+=a+o,h+=s,l="middle";break;case"top":f+=o/2,h-=a,u="center",l="bottom";break;case"bottom":f+=o/2,h+=n+a,u="center";break;case"inside":f+=o/2,h+=s,u="center",l="middle";break;case"insideLeft":f+=a,h+=s,l="middle";break;case"insideRight":f+=o-a,h+=s,u="right",l="middle";break;case"insideTop":f+=o/2,h+=a,u="center";break;case"insideBottom":f+=o/2,h+=n-a,u="center",l="bottom";break;case"insideTopLeft":f+=a,h+=a;break;case"insideTopRight":f+=o-a,h+=a,u="right";break;case"insideBottomLeft":f+=a,h+=n-a,l="bottom";break;case"insideBottomRight":f+=o-a,h+=n-a,u="right",l="bottom";break}return e=e||{},e.x=f,e.y=h,e.align=u,e.verticalAlign=l,e}var Ri="__zr_normal__",Di=fe.concat(["ignore"]),nh=oi(fe,function(e,t){return e[t]=!0,e},{ignore:!1}),yr={},oh=new W(0,0,0,0),Ea=function(){function e(t){this.id=no(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return e.prototype._init=function(t){this.attr(t)},e.prototype.drift=function(t,r,i){switch(this.draggable){case"horizontal":r=0;break;case"vertical":t=0;break}var a=this.transform;a||(a=this.transform=[1,0,0,1,0,0]),a[4]+=t,a[5]+=r,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(t){var r=this._textContent;if(r&&(!r.ignore||t)){this.textConfig||(this.textConfig={});var i=this.textConfig,a=i.local,n=r.innerTransformable,o=void 0,s=void 0,f=!1;n.parent=a?this:null;var h=!1;if(n.copyTransform(r),i.position!=null){var u=oh;i.layoutRect?u.copy(i.layoutRect):u.copy(this.getBoundingRect()),a||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(yr,i,u):ah(yr,i,u),n.x=yr.x,n.y=yr.y,o=yr.align,s=yr.verticalAlign;var l=i.origin;if(l&&i.rotation!=null){var v=void 0,c=void 0;l==="center"?(v=u.width*.5,c=u.height*.5):(v=he(l[0],u.width),c=he(l[1],u.height)),h=!0,n.originX=-n.x+v+(a?0:u.x),n.originY=-n.y+c+(a?0:u.y)}}i.rotation!=null&&(n.rotation=i.rotation);var _=i.offset;_&&(n.x+=_[0],n.y+=_[1],h||(n.originX=-_[0],n.originY=-_[1]));var g=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,d=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),p=void 0,y=void 0,m=void 0;g&&this.canBeInsideText()?(p=i.insideFill,y=i.insideStroke,(p==null||p==="auto")&&(p=this.getInsideTextFill()),(y==null||y==="auto")&&(y=this.getInsideTextStroke(p),m=!0)):(p=i.outsideFill,y=i.outsideStroke,(p==null||p==="auto")&&(p=this.getOutsideFill()),(y==null||y==="auto")&&(y=this.getOutsideStroke(p),m=!0)),p=p||"#000",(p!==d.fill||y!==d.stroke||m!==d.autoStroke||o!==d.align||s!==d.verticalAlign)&&(f=!0,d.fill=p,d.stroke=y,d.autoStroke=m,d.align=o,d.verticalAlign=s,r.setDefaultTextStyle(d)),r.__dirty|=ht,f&&r.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return"#fff"},e.prototype.getInsideTextStroke=function(t){return"#000"},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?ua:ha},e.prototype.getOutsideStroke=function(t){var r=this.__zr&&this.__zr.getBackgroundColor(),i=typeof r=="string"&&Dt(r);i||(i=[255,255,255,1]);for(var a=i[3],n=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*a+(n?0:255)*(1-a);return i[3]=1,ce(i,"rgba")},e.prototype.traverse=function(t,r){},e.prototype.attrKV=function(t,r){t==="textConfig"?this.setTextConfig(r):t==="textContent"?this.setTextContent(r):t==="clipPath"?this.setClipPath(r):t==="extra"?(this.extra=this.extra||{},$(this.extra,r)):this[t]=r},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(t,r){if(typeof t=="string")this.attrKV(t,r);else if(zt(t))for(var i=t,a=j(i),n=0;n0},e.prototype.getState=function(t){return this.states[t]},e.prototype.ensureState=function(t){var r=this.states;return r[t]||(r[t]={}),r[t]},e.prototype.clearStates=function(t){this.useState(Ri,!1,t)},e.prototype.useState=function(t,r,i,a){var n=t===Ri,o=this.hasState();if(!(!o&&n)){var s=this.currentStates,f=this.stateTransition;if(!(Pt(s,t)>=0&&(r||s.length===1))){var h;if(this.stateProxy&&!n&&(h=this.stateProxy(t)),h||(h=this.states&&this.states[t]),!h&&!n){Ma("State "+t+" not exists.");return}n||this.saveCurrentToNormalState(h);var u=!!(h&&h.hoverLayer||a);u&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,h,this._normalState,r,!i&&!this.__inHover&&f&&f.duration>0,f);var l=this._textContent,v=this._textGuide;return l&&l.useState(t,r,i,u),v&&v.useState(t,r,i,u),n?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!u&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~ht),h}}},e.prototype.useStates=function(t,r,i){if(!t.length)this.clearStates();else{var a=[],n=this.currentStates,o=t.length,s=o===n.length;if(s){for(var f=0;f0,_);var g=this._textContent,d=this._textGuide;g&&g.useStates(t,r,v),d&&d.useStates(t,r,v),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!v&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~ht)}},e.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var i=this.currentStates.slice();i.splice(r,1),this.useStates(i)}},e.prototype.replaceState=function(t,r,i){var a=this.currentStates.slice(),n=Pt(a,t),o=Pt(a,r)>=0;n>=0?o?a.splice(n,1):a[n]=r:i&&!o&&a.push(r),this.useStates(a)},e.prototype.toggleState=function(t,r){r?this.useState(t,!0):this.removeState(t)},e.prototype._mergeStates=function(t){for(var r={},i,a=0;a=0&&n.splice(o,1)}),this.animators.push(t),i&&i.animation.addAnimator(t),i&&i.wakeUp()},e.prototype.updateDuringAnimation=function(t){this.markRedraw()},e.prototype.stopAnimation=function(t,r){for(var i=this.animators,a=i.length,n=[],o=0;o0&&r.during&&n[0].during(function(_,g){r.during(g)});for(var v=0;v0||a.force&&!o.length){var C=void 0,M=void 0,S=void 0;if(s){M={},v&&(C={});for(var T=0;T=0&&(a.splice(n,0,r),this._doAdd(r))}return this},t.prototype.replace=function(r,i){var a=Pt(this._children,r);return a>=0&&this.replaceAt(i,a),this},t.prototype.replaceAt=function(r,i){var a=this._children,n=a[i];if(r&&r!==this&&r.parent!==this&&r!==n){a[i]=r,n.parent=null;var o=this.__zr;o&&n.removeSelfFromZr(o),this._doAdd(r)}return this},t.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var i=this.__zr;i&&i!==r.__zr&&r.addSelfToZr(i),i&&i.refresh()},t.prototype.remove=function(r){var i=this.__zr,a=this._children,n=Pt(a,r);return n<0?this:(a.splice(n,1),r.parent=null,i&&r.removeSelfFromZr(i),i&&i.refresh(),this)},t.prototype.removeAll=function(){for(var r=this._children,i=this.__zr,a=0;a0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},e.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover()},e.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},e.prototype.clearAnimation=function(){this.animation.clear()},e.prototype.getWidth=function(){return this.painter.getWidth()},e.prototype.getHeight=function(){return this.painter.getHeight()},e.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},e.prototype.findHover=function(t,r){return this.handler.findHover(t,r)},e.prototype.on=function(t,r,i){return this.handler.on(t,r,i),this},e.prototype.off=function(t,r){this.handler.off(t,r)},e.prototype.trigger=function(t,r){this.handler.trigger(t,r)},e.prototype.clear=function(){for(var t=this.storage.getRoots(),r=0;r=o;f++)s-=o;var h=ut(r,t);return h>s&&(r="",h=0),s=e-h,a.ellipsis=r,a.ellipsisWidth=h,a.contentWidth=s,a.containerWidth=e,a}function Bo(e,t){var r=t.containerWidth,i=t.font,a=t.contentWidth;if(!r)return"";var n=ut(e,i);if(n<=r)return e;for(var o=0;;o++){if(n<=a||o>=t.maxIterations){e+=t.ellipsis;break}var s=o===0?_h(e,a,t.ascCharWidth,t.cnCharWidth):n>0?Math.floor(e.length*a/n):0;e=e.substr(0,s),n=ut(e,i)}return e===""&&(e=t.placeholder),e}function _h(e,t,r,i){for(var a=0,n=0,o=e.length;nc&&h){var _=Math.floor(c/s);l=l.slice(0,_)}if(e&&n&&u!=null)for(var g=Ho(u,a,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),d=0;ds&&Fi(r,e.substring(s,h),t,o),Fi(r,f[2],t,o,f[1]),s=Ei.lastIndex}sa){b>0?(y.tokens=y.tokens.slice(0,b),d(y,T,m),r.lines=r.lines.slice(0,p+1)):r.lines=r.lines.slice(0,p);break t}var R=L.width,x=R==null||R==="auto";if(typeof R=="string"&&R.charAt(R.length-1)==="%")w.percentWidth=R,u.push(w),w.contentWidth=ut(w.text,S);else{if(x){var A=L.backgroundColor,E=A&&A.image;E&&(E=dh(E),hi(E)&&(w.width=Math.max(w.width,E.width*P/E.height)))}var D=_&&i!=null?i-T:null;D!=null&&D0&&_+i.accumWidth>i.width&&(u=t.split(` `),h=!0),i.accumWidth=_}else{var g=ko(t,f,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+c,l=g.linesWidths,u=g.lines}}else u=t.split(` `);for(var d=0;d=33&&t<=383}var bh=oi(",&?/;] ".split(""),function(e,t){return e[t]=!0,e},{});function Ch(e){return Th(e)?!!bh[e]:!0}function ko(e,t,r,i,a){for(var n=[],o=[],s="",f="",h=0,u=0,l=0;lr:a+u+c>r){u?(s||f)&&(_?(s||(s=f,f="",h=0,u=h),n.push(s),o.push(u-h),f+=v,h+=c,s="",u=h):(f&&(s+=f,f="",h=0),n.push(s),o.push(u),s=v,u=c)):_?(n.push(f),o.push(h),f=v,h=c):(n.push(v),o.push(c));continue}u+=c,_?(f+=v,h+=c):(f&&(s+=f,f="",h=0),s+=v)}return!n.length&&!s&&(s=e,f="",h=0),f&&(s+=f),s&&(n.push(s),o.push(u)),n.length===1&&(u+=a),{accumWidth:u,lines:n,linesWidths:o}}var ca="__zr_style_"+Math.round(Math.random()*10),vr={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},ui={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};vr[ca]=!0;var hn=["z","z2","invisible"],Lh=["invisible"],Mh=function(e){B(t,e);function t(r){return e.call(this,r)||this}return t.prototype._init=function(r){for(var i=j(r),a=0;a1e-4){s[0]=e-r,s[1]=t-i,f[0]=e+r,f[1]=t+i;return}if(Le[0]=Bi(a)*r+e,Le[1]=Hi(a)*i+t,Me[0]=Bi(n)*r+e,Me[1]=Hi(n)*i+t,h(s,Le,Me),u(f,Le,Me),a=a%jt,a<0&&(a=a+jt),n=n%jt,n<0&&(n=n+jt),a>n&&!o?n+=jt:aa&&(Se[0]=Bi(c)*r+e,Se[1]=Hi(c)*i+t,h(s,Se,s),u(f,Se,f))}var H={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},tr=[],rr=[],bt=[],Ht=[],Ct=[],Lt=[],ki=Math.min,zi=Math.max,er=Math.cos,ir=Math.sin,Ft=Math.abs,da=Math.PI,kt=da*2,$i=typeof Float32Array<"u",Zr=[];function Yi(e){var t=Math.round(e/da*1e8)/1e8;return t%2*da}function Ah(e,t){var r=Yi(e[0]);r<0&&(r+=kt);var i=r-e[0],a=e[1];a+=i,!t&&a-r>=kt?a=r+kt:t&&r-a>=kt?a=r-kt:!t&&r>a?a=r+(kt-Yi(r-a)):t&&r0&&(this._ux=Ft(i/Ve/t)||0,this._uy=Ft(i/Ve/r)||0)},e.prototype.setDPR=function(t){this.dpr=t},e.prototype.setContext=function(t){this._ctx=t},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(t,r){return this._drawPendingPt(),this.addData(H.M,t,r),this._ctx&&this._ctx.moveTo(t,r),this._x0=t,this._y0=r,this._xi=t,this._yi=r,this},e.prototype.lineTo=function(t,r){var i=Ft(t-this._xi),a=Ft(r-this._yi),n=i>this._ux||a>this._uy;if(this.addData(H.L,t,r),this._ctx&&n&&this._ctx.lineTo(t,r),n)this._xi=t,this._yi=r,this._pendingPtDist=0;else{var o=i*i+a*a;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=r,this._pendingPtDist=o)}return this},e.prototype.bezierCurveTo=function(t,r,i,a,n,o){return this._drawPendingPt(),this.addData(H.C,t,r,i,a,n,o),this._ctx&&this._ctx.bezierCurveTo(t,r,i,a,n,o),this._xi=n,this._yi=o,this},e.prototype.quadraticCurveTo=function(t,r,i,a){return this._drawPendingPt(),this.addData(H.Q,t,r,i,a),this._ctx&&this._ctx.quadraticCurveTo(t,r,i,a),this._xi=i,this._yi=a,this},e.prototype.arc=function(t,r,i,a,n,o){this._drawPendingPt(),Zr[0]=a,Zr[1]=n,Ah(Zr,o),a=Zr[0],n=Zr[1];var s=n-a;return this.addData(H.A,t,r,i,i,a,s,0,o?0:1),this._ctx&&this._ctx.arc(t,r,i,a,n,o),this._xi=er(n)*i+t,this._yi=ir(n)*i+r,this},e.prototype.arcTo=function(t,r,i,a,n){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,r,i,a,n),this},e.prototype.rect=function(t,r,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,r,i,a),this.addData(H.R,t,r,i,a),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(H.Z);var t=this._ctx,r=this._x0,i=this._y0;return t&&t.closePath(),this._xi=r,this._yi=i,this},e.prototype.fill=function(t){t&&t.fill(),this.toStatic()},e.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(t){var r=t.length;!(this.data&&this.data.length===r)&&$i&&(this.data=new Float32Array(r));for(var i=0;iu.length&&(this._expandData(),u=this.data);for(var l=0;l0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],r=0;r11&&(this.data=new Float32Array(t)))}},e.prototype.getBoundingRect=function(){bt[0]=bt[1]=Ct[0]=Ct[1]=Number.MAX_VALUE,Ht[0]=Ht[1]=Lt[0]=Lt[1]=-Number.MAX_VALUE;var t=this.data,r=0,i=0,a=0,n=0,o;for(o=0;oi||Ft(m)>a||v===r-1)&&(g=Math.sqrt(y*y+m*m),n=d,o=p);break}case H.C:{var T=t[v++],b=t[v++],d=t[v++],p=t[v++],w=t[v++],L=t[v++];g=Tf(n,o,T,b,d,p,w,L,10),n=w,o=L;break}case H.Q:{var T=t[v++],b=t[v++],d=t[v++],p=t[v++];g=Lf(n,o,T,b,d,p,10),n=d,o=p;break}case H.A:var C=t[v++],M=t[v++],S=t[v++],P=t[v++],R=t[v++],x=t[v++],A=x+R;v+=1,t[v++],_&&(s=er(R)*S+C,f=ir(R)*P+M),g=zi(S,P)*ki(kt,Math.abs(x)),n=er(A)*S+C,o=ir(A)*P+M;break;case H.R:{s=n=t[v++],f=o=t[v++];var E=t[v++],D=t[v++];g=E*2+D*2;break}case H.Z:{var y=s-n,m=f-o;g=Math.sqrt(y*y+m*m),n=s,o=f;break}}g>=0&&(h[l++]=g,u+=g)}return this._pathLen=u,u},e.prototype.rebuildPath=function(t,r){var i=this.data,a=this._ux,n=this._uy,o=this._len,s,f,h,u,l,v,c=r<1,_,g,d=0,p=0,y,m=0,T,b;if(c&&(this._pathSegLen||this._calculateLength(),_=this._pathSegLen,g=this._pathLen,y=r*g,!y))return;t:for(var w=0;w0&&(t.lineTo(T,b),m=0),L){case H.M:s=h=i[w++],f=u=i[w++],t.moveTo(h,u);break;case H.L:{l=i[w++],v=i[w++];var M=Ft(l-h),S=Ft(v-u);if(M>a||S>n){if(c){var P=_[p++];if(d+P>y){var R=(y-d)/P;t.lineTo(h*(1-R)+l*R,u*(1-R)+v*R);break t}d+=P}t.lineTo(l,v),h=l,u=v,m=0}else{var x=M*M+S*S;x>m&&(T=l,b=v,m=x)}break}case H.C:{var A=i[w++],E=i[w++],D=i[w++],k=i[w++],z=i[w++],Y=i[w++];if(c){var P=_[p++];if(d+P>y){var R=(y-d)/P;Xt(h,A,D,z,R,tr),Xt(u,E,k,Y,R,rr),t.bezierCurveTo(tr[1],rr[1],tr[2],rr[2],tr[3],rr[3]);break t}d+=P}t.bezierCurveTo(A,E,D,k,z,Y),h=z,u=Y;break}case H.Q:{var A=i[w++],E=i[w++],D=i[w++],k=i[w++];if(c){var P=_[p++];if(d+P>y){var R=(y-d)/P;Ze(h,A,D,R,tr),Ze(u,E,k,R,rr),t.quadraticCurveTo(tr[1],rr[1],tr[2],rr[2]);break t}d+=P}t.quadraticCurveTo(A,E,D,k),h=D,u=k;break}case H.A:var q=i[w++],Z=i[w++],X=i[w++],ot=i[w++],st=i[w++],Et=i[w++],Gt=i[w++],qt=!i[w++],Ut=X>ot?X:ot,rt=Ft(X-ot)>.001,U=st+Et,F=!1;if(c){var P=_[p++];d+P>y&&(U=st+Et*(y-d)/P,F=!0),d+=P}if(rt&&t.ellipse?t.ellipse(q,Z,X,ot,Gt,st,U,qt):t.arc(q,Z,Ut,st,U,qt),F)break t;C&&(s=er(st)*X+q,f=ir(st)*ot+Z),h=er(U)*X+q,u=ir(U)*ot+Z;break;case H.R:s=h=i[w],f=u=i[w+1],l=i[w++],v=i[w++];var O=i[w++],Yr=i[w++];if(c){var P=_[p++];if(d+P>y){var Tt=y-d;t.moveTo(l,v),t.lineTo(l+ki(Tt,O),v),Tt-=O,Tt>0&&t.lineTo(l+O,v+ki(Tt,Yr)),Tt-=Yr,Tt>0&&t.lineTo(l+zi(O-Tt,0),v+Yr),Tt-=O,Tt>0&&t.lineTo(l,v+zi(Yr-Tt,0));break t}d+=P}t.rect(l,v,O,Yr);break;case H.Z:if(c){var P=_[p++];if(d+P>y){var R=(y-d)/P;t.lineTo(h*(1-R)+s*R,u*(1-R)+f*R);break t}d+=P}t.closePath(),h=s,u=f}}},e.prototype.clone=function(){var t=new e,r=this.data;return t.data=r.slice?r.slice():Array.prototype.slice.call(r),t._len=this._len,t},e.CMD=H,e.initDefaultProps=function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),e}();const dr=xh;function mr(e,t,r,i,a,n,o){if(a===0)return!1;var s=a,f=0,h=e;if(o>t+s&&o>i+s||oe+s&&n>r+s||nt+l&&u>i+l&&u>n+l&&u>s+l||ue+l&&h>r+l&&h>a+l&&h>o+l||ht+h&&f>i+h&&f>n+h||fe+h&&s>r+h&&s>a+h||sr||u+ha&&(a+=Nr);var v=Math.atan2(f,s);return v<0&&(v+=Nr),v>=i&&v<=a||v+Nr>=i&&v+Nr<=a}function Ot(e,t,r,i,a,n){if(n>t&&n>i||na?s:0}var Bt=dr.CMD,ar=Math.PI*2,Oh=1e-4;function Hh(e,t){return Math.abs(e-t)t&&h>i&&h>n&&h>s||h1&&Bh(),c=N(t,i,n,s,ct[0]),v>1&&(_=N(t,i,n,s,ct[1]))),v===2?dt&&s>i&&s>n||s=0&&h<=1){for(var u=0,l=Q(t,i,n,h),v=0;vr||s<-r)return 0;var f=Math.sqrt(r*r-s*s);K[0]=-f,K[1]=f;var h=Math.abs(i-a);if(h<1e-4)return 0;if(h>=ar-1e-4){i=0,a=ar;var u=n?1:-1;return o>=K[0]+e&&o<=K[1]+e?u:0}if(i>a){var l=i;i=a,a=l}i<0&&(i+=ar,a+=ar);for(var v=0,c=0;c<2;c++){var _=K[c];if(_+e>o){var g=Math.atan2(s,_),u=n?1:-1;g<0&&(g=ar+g),(g>=i&&g<=a||g+ar>=i&&g+ar<=a)&&(g>Math.PI/2&&g1&&(r||(s+=Ot(f,h,u,l,i,a))),d&&(f=n[_],h=n[_+1],u=f,l=h),g){case Bt.M:u=n[_++],l=n[_++],f=u,h=l;break;case Bt.L:if(r){if(mr(f,h,n[_],n[_+1],t,i,a))return!0}else s+=Ot(f,h,n[_],n[_+1],i,a)||0;f=n[_++],h=n[_++];break;case Bt.C:if(r){if(Eh(f,h,n[_++],n[_++],n[_++],n[_++],n[_],n[_+1],t,i,a))return!0}else s+=kh(f,h,n[_++],n[_++],n[_++],n[_++],n[_],n[_+1],i,a)||0;f=n[_++],h=n[_++];break;case Bt.Q:if(r){if(Fh(f,h,n[_++],n[_++],n[_],n[_+1],t,i,a))return!0}else s+=zh(f,h,n[_++],n[_++],n[_],n[_+1],i,a)||0;f=n[_++],h=n[_++];break;case Bt.A:var p=n[_++],y=n[_++],m=n[_++],T=n[_++],b=n[_++],w=n[_++];_+=1;var L=!!(1-n[_++]);v=Math.cos(b)*m+p,c=Math.sin(b)*T+y,d?(u=v,l=c):s+=Ot(f,h,v,c,i,a);var C=(i-p)*T/m+p;if(r){if(Ih(p,y,T,b,b+w,L,t,C,a))return!0}else s+=$h(p,y,T,b,b+w,L,C,a);f=Math.cos(b+w)*m+p,h=Math.sin(b+w)*T+y;break;case Bt.R:u=f=n[_++],l=h=n[_++];var M=n[_++],S=n[_++];if(v=u+M,c=l+S,r){if(mr(u,l,v,l,t,i,a)||mr(v,l,v,c,t,i,a)||mr(v,c,u,c,t,i,a)||mr(u,c,u,l,t,i,a))return!0}else s+=Ot(v,l,v,c,i,a),s+=Ot(u,c,u,l,i,a);break;case Bt.Z:if(r){if(mr(f,h,u,l,t,i,a))return!0}else s+=Ot(f,h,u,l,i,a);f=u,h=l;break}}return!r&&!Hh(h,l)&&(s+=Ot(f,h,u,l,i,a)||0),s!==0}function Yh(e,t,r){return $o(e,0,!1,t,r)}function Wh(e,t,r,i){return $o(e,t,!0,r,i)}var Yo=_t({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},vr),Xh={style:_t({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},ui.style)},Wi=fe.concat(["invisible","culling","z","z2","zlevel","parent"]),Gh=function(e){B(t,e);function t(r){return e.call(this,r)||this}return t.prototype.update=function(){var r=this;e.prototype.update.call(this);var i=this.style;if(i.decal){var a=this._decalEl=this._decalEl||new t;a.buildPath===t.prototype.buildPath&&(a.buildPath=function(f){r.buildPath(f,r.shape)}),a.silent=!0;var n=a.style;for(var o in i)n[o]!==i[o]&&(n[o]=i[o]);n.fill=i.fill?i.decal:null,n.decal=null,n.shadowColor=null,i.strokeFirst&&(n.stroke=null);for(var s=0;s.5?ha:i>.2?Vf:ua}else if(r)return ua}return ha},t.prototype.getInsideTextStroke=function(r){var i=this.style.fill;if(Ge(i)){var a=this.__zr,n=!!(a&&a.isDarkMode()),o=Ne(r,0)0))},t.prototype.hasFill=function(){var r=this.style,i=r.fill;return i!=null&&i!=="none"},t.prototype.getBoundingRect=function(){var r=this._rect,i=this.style,a=!r;if(a){var n=!1;this.path||(n=!0,this.createPathProxy());var o=this.path;(n||this.__dirty&Cr)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||a){s.copy(r);var f=i.strokeNoScale?this.getLineScale():1,h=i.lineWidth;if(!this.hasFill()){var u=this.strokeContainThreshold;h=Math.max(h,u==null?4:u)}f>1e-10&&(s.width+=h/f,s.height+=h/f,s.x-=h/f/2,s.y-=h/f/2)}return s}return r},t.prototype.contain=function(r,i){var a=this.transformCoordToLocal(r,i),n=this.getBoundingRect(),o=this.style;if(r=a[0],i=a[1],n.contain(r,i)){var s=this.path;if(this.hasStroke()){var f=o.lineWidth,h=o.strokeNoScale?this.getLineScale():1;if(h>1e-10&&(this.hasFill()||(f=Math.max(f,this.strokeContainThreshold)),Wh(s,f/h,r,i)))return!0}if(this.hasFill())return Yh(s,r,i)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=Cr,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(r){return this.animate("shape",r)},t.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(r,i){r==="shape"?this.setShape(i):e.prototype.attrKV.call(this,r,i)},t.prototype.setShape=function(r,i){var a=this.shape;return a||(a=this.shape={}),typeof r=="string"?a[r]=i:$(a,r),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&Cr)},t.prototype.createStyle=function(r){return fi(Yo,r)},t.prototype._innerSaveToNormal=function(r){e.prototype._innerSaveToNormal.call(this,r);var i=this._normalState;r.shape&&!i.shape&&(i.shape=$({},this.shape))},t.prototype._applyStateObj=function(r,i,a,n,o,s){e.prototype._applyStateObj.call(this,r,i,a,n,o,s);var f=!(i&&n),h;if(i&&i.shape?o?n?h=i.shape:(h=$({},a.shape),$(h,i.shape)):(h=$({},n?this.shape:a.shape),$(h,i.shape)):f&&(h=a.shape),h)if(o){this.shape=$({},this.shape);for(var u={},l=j(h),v=0;v0},t.prototype.hasFill=function(){var r=this.style,i=r.fill;return i!=null&&i!=="none"},t.prototype.createStyle=function(r){return fi(qh,r)},t.prototype.setBoundingRect=function(r){this._rect=r},t.prototype.getBoundingRect=function(){var r=this.style;if(!this._rect){var i=r.text;i!=null?i+="":i="";var a=ih(i,r.font,r.textAlign,r.textBaseline);if(a.x+=r.x||0,a.y+=r.y||0,this.hasStroke()){var n=r.lineWidth;a.x-=n/2,a.y-=n/2,a.width+=n,a.height+=n}this._rect=a}return this._rect},t.initDefaultProps=function(){var r=t.prototype;r.dirtyRectTolerance=10}(),t}(de);Wo.prototype.type="tspan";const Qe=Wo;var Uh=_t({x:0,y:0},vr),Zh={style:_t({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},ui.style)};function Nh(e){return!!(e&&typeof e!="string"&&e.width&&e.height)}var Xo=function(e){B(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.createStyle=function(r){return fi(Uh,r)},t.prototype._getSize=function(r){var i=this.style,a=i[r];if(a!=null)return a;var n=Nh(i.image)?i.image:this.__image;if(!n)return 0;var o=r==="width"?"height":"width",s=i[o];return s==null?n[r]:n[r]/n[o]*s},t.prototype.getWidth=function(){return this._getSize("width")},t.prototype.getHeight=function(){return this._getSize("height")},t.prototype.getAnimationStyleProps=function(){return Zh},t.prototype.getBoundingRect=function(){var r=this.style;return this._rect||(this._rect=new W(r.x||0,r.y||0,this.getWidth(),this.getHeight())),this._rect},t}(de);Xo.prototype.type="image";const Fa=Xo;function Vh(e,t){var r=t.x,i=t.y,a=t.width,n=t.height,o=t.r,s,f,h,u;a<0&&(r=r+a,a=-a),n<0&&(i=i+n,n=-n),typeof o=="number"?s=f=h=u=o:o instanceof Array?o.length===1?s=f=h=u=o[0]:o.length===2?(s=h=o[0],f=u=o[1]):o.length===3?(s=o[0],f=u=o[1],h=o[2]):(s=o[0],f=o[1],h=o[2],u=o[3]):s=f=h=u=0;var l;s+f>a&&(l=s+f,s*=a/l,f*=a/l),h+u>a&&(l=h+u,h*=a/l,u*=a/l),f+h>n&&(l=f+h,f*=n/l,h*=n/l),s+u>n&&(l=s+u,s*=n/l,u*=n/l),e.moveTo(r+s,i),e.lineTo(r+a-f,i),f!==0&&e.arc(r+a-f,i+f,f,-Math.PI/2,0),e.lineTo(r+a,i+n-h),h!==0&&e.arc(r+a-h,i+n-h,h,0,Math.PI/2),e.lineTo(r+u,i+n),u!==0&&e.arc(r+u,i+n-u,u,Math.PI/2,Math.PI),e.lineTo(r,i+s),s!==0&&e.arc(r+s,i+s,s,Math.PI,Math.PI*1.5)}var xr=Math.round;function Qh(e,t,r){if(!!t){var i=t.x1,a=t.x2,n=t.y1,o=t.y2;e.x1=i,e.x2=a,e.y1=n,e.y2=o;var s=r&&r.lineWidth;return s&&(xr(i*2)===xr(a*2)&&(e.x1=e.x2=Er(i,s,!0)),xr(n*2)===xr(o*2)&&(e.y1=e.y2=Er(n,s,!0))),e}}function Kh(e,t,r){if(!!t){var i=t.x,a=t.y,n=t.width,o=t.height;e.x=i,e.y=a,e.width=n,e.height=o;var s=r&&r.lineWidth;return s&&(e.x=Er(i,s,!0),e.y=Er(a,s,!0),e.width=Math.max(Er(i+n,s,!1)-e.x,n===0?0:1),e.height=Math.max(Er(a+o,s,!1)-e.y,o===0?0:1)),e}}function Er(e,t,r){if(!t)return e;var i=xr(e*2);return(i+xr(t))%2===0?i/2:(i+(r?1:-1))/2}var Jh=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),jh={},Go=function(e){B(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new Jh},t.prototype.buildPath=function(r,i){var a,n,o,s;if(this.subPixelOptimize){var f=Kh(jh,i,this.style);a=f.x,n=f.y,o=f.width,s=f.height,f.r=i.r,i=f}else a=i.x,n=i.y,o=i.width,s=i.height;i.r?Vh(r,i):r.rect(a,n,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(G);Go.prototype.type="rect";const Ke=Go;var dn={fill:"#000"},pn=2,tu={style:_t({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},ui.style)},qo=function(e){B(t,e);function t(r){var i=e.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=dn,i.attr(r),i}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r0,R=r.width!=null&&(r.overflow==="truncate"||r.overflow==="break"||r.overflow==="breakAll"),x=o.calculatedLineHeight,A=0;A=0&&(A=w[x],A.align==="right");)this._placeToken(A,r,C,p,R,"right",m),M-=A.width,R-=A.width,x--;for(P+=(n-(P-d)-(y-R)-M)/2;S<=x;)A=w[S],this._placeToken(A,r,C,p,P+A.width/2,"center",m),P+=A.width,S++;p+=C}},t.prototype._placeToken=function(r,i,a,n,o,s,f){var h=i.rich[r.styleName]||{};h.text=r.text;var u=r.verticalAlign,l=n+a/2;u==="top"?l=n+r.height/2:u==="bottom"&&(l=n+a-r.height/2);var v=!r.isLineHolder&&Xi(h);v&&this._renderBackground(h,i,s==="right"?o-r.width:s==="center"?o-r.width/2:o,l-r.height/2,r.width,r.height);var c=!!h.backgroundColor,_=r.textPadding;_&&(o=Tn(o,s,_),l-=r.height/2-_[0]-r.innerHeight/2);var g=this._getOrCreateChild(Qe),d=g.createStyle();g.useStyle(d);var p=this._defaultStyle,y=!1,m=0,T=wn("fill"in h?h.fill:"fill"in i?i.fill:(y=!0,p.fill)),b=mn("stroke"in h?h.stroke:"stroke"in i?i.stroke:!c&&!f&&(!p.autoStroke||y)?(m=pn,p.stroke):null),w=h.textShadowBlur>0||i.textShadowBlur>0;d.text=r.text,d.x=o,d.y=l,w&&(d.shadowBlur=h.textShadowBlur||i.textShadowBlur||0,d.shadowColor=h.textShadowColor||i.textShadowColor||"transparent",d.shadowOffsetX=h.textShadowOffsetX||i.textShadowOffsetX||0,d.shadowOffsetY=h.textShadowOffsetY||i.textShadowOffsetY||0),d.textAlign=s,d.textBaseline="middle",d.font=r.font||cr,d.opacity=Be(h.opacity,i.opacity,1),gn(d,h),b&&(d.lineWidth=Be(h.lineWidth,i.lineWidth,m),d.lineDash=pt(h.lineDash,i.lineDash),d.lineDashOffset=i.lineDashOffset||0,d.stroke=b),T&&(d.fill=T);var L=r.contentWidth,C=r.contentHeight;g.setBoundingRect(new W(Jr(d.x,L,d.textAlign),Lr(d.y,C,d.textBaseline),L,C))},t.prototype._renderBackground=function(r,i,a,n,o,s){var f=r.backgroundColor,h=r.borderWidth,u=r.borderColor,l=f&&f.image,v=f&&!l,c=r.borderRadius,_=this,g,d;if(v||r.lineHeight||h&&u){g=this._getOrCreateChild(Ke),g.useStyle(g.createStyle()),g.style.fill=null;var p=g.shape;p.x=a,p.y=n,p.width=o,p.height=s,p.r=c,g.dirtyShape()}if(v){var y=g.style;y.fill=f||null,y.fillOpacity=pt(r.fillOpacity,1)}else if(l){d=this._getOrCreateChild(Fa),d.onload=function(){_.dirtyStyle()};var m=d.style;m.image=f.image,m.x=a,m.y=n,m.width=o,m.height=s}if(h&&u){var y=g.style;y.lineWidth=h,y.stroke=u,y.strokeOpacity=pt(r.strokeOpacity,1),y.lineDash=r.borderDash,y.lineDashOffset=r.borderDashOffset||0,g.strokeContainThreshold=0,g.hasFill()&&g.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var T=(g||d).style;T.shadowBlur=r.shadowBlur||0,T.shadowColor=r.shadowColor||"transparent",T.shadowOffsetX=r.shadowOffsetX||0,T.shadowOffsetY=r.shadowOffsetY||0,T.opacity=Be(r.opacity,i.opacity,1)},t.makeFont=function(r){var i="";return au(r)&&(i=[r.fontStyle,r.fontWeight,iu(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),i&&Pr(i)||r.textFont||r.font},t}(de),ru={left:!0,right:1,center:1},eu={top:1,bottom:1,middle:1},_n=["fontStyle","fontWeight","fontSize","fontFamily"];function iu(e){return typeof e=="string"&&(e.indexOf("px")!==-1||e.indexOf("rem")!==-1||e.indexOf("em")!==-1)?e:isNaN(+e)?ba+"px":e+"px"}function gn(e,t){for(var r=0;r<_n.length;r++){var i=_n[r],a=t[i];a!=null&&(e[i]=a)}}function au(e){return e.fontSize!=null||e.fontFamily||e.fontWeight}function nu(e){return yn(e),J(e.rich,yn),e}function yn(e){if(e){e.font=qo.makeFont(e);var t=e.align;t==="middle"&&(t="center"),e.align=t==null||ru[t]?t:"left";var r=e.verticalAlign;r==="center"&&(r="middle"),e.verticalAlign=r==null||eu[r]?r:"top";var i=e.padding;i&&(e.padding=Hs(e.padding))}}function mn(e,t){return e==null||t<=0||e==="transparent"||e==="none"?null:e.image||e.colorStops?"#000":e}function wn(e){return e==null||e==="none"?null:e.image||e.colorStops?"#000":e}function Tn(e,t,r){return t==="right"?e-r[1]:t==="center"?e+r[3]/2-r[1]/2:e+r[3]}function bn(e){var t=e.text;return t!=null&&(t+=""),t}function Xi(e){return!!(e.backgroundColor||e.lineHeight||e.borderWidth&&e.borderColor)}const ev=qo;var wr=dr.CMD,ou=[[],[],[]],Cn=Math.sqrt,su=Math.atan2;function Uo(e,t){if(!!t){var r=e.data,i=e.len(),a,n,o,s,f,h,u=wr.M,l=wr.C,v=wr.L,c=wr.R,_=wr.A,g=wr.Q;for(o=0,s=0;o1&&(o*=Gi(_),s*=Gi(_));var g=(a===n?-1:1)*Gi((o*o*(s*s)-o*o*(c*c)-s*s*(v*v))/(o*o*(c*c)+s*s*(v*v)))||0,d=g*o*c/s,p=g*-s*v/o,y=(e+r)/2+De(l)*d-Re(l)*p,m=(t+i)/2+Re(l)*d+De(l)*p,T=Mn([1,0],[(v-d)/o,(c-p)/s]),b=[(v-d)/o,(c-p)/s],w=[(-1*v-d)/o,(-1*c-p)/s],L=Mn(b,w);if(pa(b,w)<=-1&&(L=Vr),pa(b,w)>=1&&(L=0),L<0){var C=Math.round(L/Vr*1e6)/1e6;L=Vr*2+C%2*Vr}u.addData(h,y,m,o,s,T,L,l,n)}var fu=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,hu=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function uu(e){var t=new dr;if(!e)return t;var r=0,i=0,a=r,n=i,o,s=dr.CMD,f=e.match(fu);if(!f)return t;for(var h=0;hA*A+E*E&&(C=S,M=P),{cx:C,cy:M,x0:-u,y0:-l,x1:C*(a/b-1),y1:M*(a/b-1)}}function yu(e){var t;if(ne(e)){var r=e.length;if(!r)return e;r===1?t=[e[0],e[0],0,0]:r===2?t=[e[0],e[0],e[1],e[1]]:r===3?t=e.concat(e[2]):t=e}else t=[e,e,e,e];return t}function mu(e,t){var r,i=jr(t.r,0),a=jr(t.r0||0,0),n=i>0,o=a>0;if(!(!n&&!o)){if(n||(i=a,a=0),a>i){var s=i;i=a,a=s}var f=t.startAngle,h=t.endAngle;if(!(isNaN(f)||isNaN(h))){var u=t.cx,l=t.cy,v=!!t.clockwise,c=Pn(h-f),_=c>qi&&c%qi;if(_>gt&&(c=_),!(i>gt))e.moveTo(u,l);else if(c>qi-gt)e.moveTo(u+i*Tr(f),l+i*nr(f)),e.arc(u,l,i,f,h,!v),a>gt&&(e.moveTo(u+a*Tr(h),l+a*nr(h)),e.arc(u,l,a,h,f,v));else{var g=void 0,d=void 0,p=void 0,y=void 0,m=void 0,T=void 0,b=void 0,w=void 0,L=void 0,C=void 0,M=void 0,S=void 0,P=void 0,R=void 0,x=void 0,A=void 0,E=i*Tr(f),D=i*nr(f),k=a*Tr(h),z=a*nr(h),Y=c>gt;if(Y){var q=t.cornerRadius;q&&(r=yu(q),g=r[0],d=r[1],p=r[2],y=r[3]);var Z=Pn(i-a)/2;if(m=Mt(Z,p),T=Mt(Z,y),b=Mt(Z,g),w=Mt(Z,d),M=L=jr(m,T),S=C=jr(b,w),(L>gt||C>gt)&&(P=i*Tr(h),R=i*nr(h),x=a*Tr(f),A=a*nr(f),cgt){var rt=Mt(p,M),U=Mt(y,M),F=Ae(x,A,E,D,i,rt,v),O=Ae(P,R,k,z,i,U,v);e.moveTo(u+F.cx+F.x0,l+F.cy+F.y0),M0&&e.arc(u+F.cx,l+F.cy,rt,V(F.y0,F.x0),V(F.y1,F.x1),!v),e.arc(u,l,i,V(F.cy+F.y1,F.cx+F.x1),V(O.cy+O.y1,O.cx+O.x1),!v),U>0&&e.arc(u+O.cx,l+O.cy,U,V(O.y1,O.x1),V(O.y0,O.x0),!v))}else e.moveTo(u+E,l+D),e.arc(u,l,i,f,h,!v);if(!(a>gt)||!Y)e.lineTo(u+k,l+z);else if(S>gt){var rt=Mt(g,S),U=Mt(d,S),F=Ae(k,z,P,R,a,-U,v),O=Ae(E,D,x,A,a,-rt,v);e.lineTo(u+F.cx+F.x0,l+F.cy+F.y0),S0&&e.arc(u+F.cx,l+F.cy,U,V(F.y0,F.x0),V(F.y1,F.x1),!v),e.arc(u,l,a,V(F.cy+F.y1,F.cx+F.x1),V(O.cy+O.y1,O.cx+O.x1),v),rt>0&&e.arc(u+O.cx,l+O.cy,rt,V(O.y1,O.x1),V(O.y0,O.x0),!v))}else e.lineTo(u+k,l+z),e.arc(u,l,a,h,f,v)}e.closePath()}}}var wu=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return e}(),ts=function(e){B(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new wu},t.prototype.buildPath=function(r,i){mu(r,i)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(G);ts.prototype.type="sector";const Rn=ts;var Tu=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),rs=function(e){B(t,e);function t(r){return e.call(this,r)||this}return t.prototype.getDefaultShape=function(){return new Tu},t.prototype.buildPath=function(r,i){var a=i.cx,n=i.cy,o=Math.PI*2;r.moveTo(a+i.r,n),r.arc(a,n,i.r,0,o,!1),r.moveTo(a+i.r0,n),r.arc(a,n,i.r0,0,o,!0)},t}(G);rs.prototype.type="ring";const nv=rs;function bu(e,t,r,i){var a=[],n=[],o=[],s=[],f,h,u,l;if(i){u=[1/0,1/0],l=[-1/0,-1/0];for(var v=0,c=e.length;v=2){if(i){var n=bu(a,i,r,t.smoothConstraint);e.moveTo(a[0][0],a[0][1]);for(var o=a.length,s=0;s<(r?o:o-1);s++){var f=n[s*2],h=n[s*2+1],u=a[(s+1)%o];e.bezierCurveTo(f[0],f[1],h[0],h[1],u[0],u[1])}}else{e.moveTo(a[0][0],a[0][1]);for(var s=1,l=a.length;ssr[1]){if(s=!1,n)return s;var u=Math.abs(sr[0]-or[1]),l=Math.abs(or[0]-sr[1]);Math.min(u,l)>a.len()&&(u=0&&ur(f)?f:.5;var h=e.createRadialGradient(o,s,0,o,s,f);return h}function _a(e,t,r){for(var i=t.type==="radial"?Gu(e,t,r):Xu(e,t,r),a=t.colorStops,n=0;n0)?null:e==="dashed"?[4*t,2*t]:e==="dotted"?[t]:He(e)?[e]:ne(e)?e:null}function us(e){var t=e.style,r=t.lineDash&&t.lineWidth>0&&Uu(t.lineDash,t.lineWidth),i=t.lineDashOffset;if(r){var a=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;a&&a!==1&&(r=xt(r,function(n){return n/a}),i/=a)}return[r,i]}var Zu=new dr(!0);function Je(e){var t=e.stroke;return!(t==null||t==="none"||!(e.lineWidth>0))}function An(e){return typeof e=="string"&&e!=="none"}function je(e){var t=e.fill;return t!=null&&t!=="none"}function xn(e,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var r=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=r}else e.fill()}function En(e,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var r=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=r}else e.stroke()}function ga(e,t,r){var i=Oo(t.image,t.__image,r);if(hi(i)){var a=e.createPattern(i,t.repeat||"repeat");if(typeof DOMMatrix=="function"&&a&&a.setTransform){var n=new DOMMatrix;n.translateSelf(t.x||0,t.y||0),n.rotateSelf(0,0,(t.rotation||0)*ks),n.scaleSelf(t.scaleX||1,t.scaleY||1),a.setTransform(n)}return a}}function Nu(e,t,r,i){var a,n=Je(r),o=je(r),s=r.strokePercent,f=s<1,h=!t.path;(!t.silent||f)&&h&&t.createPathProxy();var u=t.path||Zu,l=t.__dirty;if(!i){var v=r.fill,c=r.stroke,_=o&&!!v.colorStops,g=n&&!!c.colorStops,d=o&&!!v.image,p=n&&!!c.image,y=void 0,m=void 0,T=void 0,b=void 0,w=void 0;(_||g)&&(w=t.getBoundingRect()),_&&(y=l?_a(e,v,w):t.__canvasFillGradient,t.__canvasFillGradient=y),g&&(m=l?_a(e,c,w):t.__canvasStrokeGradient,t.__canvasStrokeGradient=m),d&&(T=l||!t.__canvasFillPattern?ga(e,v,t):t.__canvasFillPattern,t.__canvasFillPattern=T),p&&(b=l||!t.__canvasStrokePattern?ga(e,c,t):t.__canvasStrokePattern,t.__canvasStrokePattern=T),_?e.fillStyle=y:d&&(T?e.fillStyle=T:o=!1),g?e.strokeStyle=m:p&&(b?e.strokeStyle=b:n=!1)}var L=t.getGlobalScale();u.setScale(L[0],L[1],t.segmentIgnoreThreshold);var C,M;e.setLineDash&&r.lineDash&&(a=us(t),C=a[0],M=a[1]);var S=!0;(h||l&Cr)&&(u.setDPR(e.dpr),f?u.setContext(null):(u.setContext(e),S=!1),u.reset(),t.buildPath(u,t.shape,i),u.toStatic(),t.pathUpdated()),S&&u.rebuildPath(e,f?s:1),C&&(e.setLineDash(C),e.lineDashOffset=M),i||(r.strokeFirst?(n&&En(e,r),o&&xn(e,r)):(o&&xn(e,r),n&&En(e,r))),C&&e.setLineDash([])}function Vu(e,t,r){var i=t.__image=Oo(r.image,t.__image,t,t.onload);if(!(!i||!hi(i))){var a=r.x||0,n=r.y||0,o=t.getWidth(),s=t.getHeight(),f=i.width/i.height;if(o==null&&s!=null?o=s*f:s==null&&o!=null?s=o/f:o==null&&s==null&&(o=i.width,s=i.height),r.sWidth&&r.sHeight){var h=r.sx||0,u=r.sy||0;e.drawImage(i,h,u,r.sWidth,r.sHeight,a,n,o,s)}else if(r.sx&&r.sy){var h=r.sx,u=r.sy,l=o-h,v=s-u;e.drawImage(i,h,u,l,v,a,n,o,s)}else e.drawImage(i,a,n,o,s)}}function Qu(e,t,r){var i,a=r.text;if(a!=null&&(a+=""),a){e.font=r.font||cr,e.textAlign=r.textAlign,e.textBaseline=r.textBaseline;var n=void 0,o=void 0;e.setLineDash&&r.lineDash&&(i=us(t),n=i[0],o=i[1]),n&&(e.setLineDash(n),e.lineDashOffset=o),r.strokeFirst?(Je(r)&&e.strokeText(a,r.x,r.y),je(r)&&e.fillText(a,r.x,r.y)):(je(r)&&e.fillText(a,r.x,r.y),Je(r)&&e.strokeText(a,r.x,r.y)),n&&e.setLineDash([])}}var Fn=["shadowBlur","shadowOffsetX","shadowOffsetY"],In=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function ls(e,t,r,i,a){var n=!1;if(!i&&(r=r||{},t===r))return!1;if(i||t.opacity!==r.opacity){nt(e,a),n=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?vr.opacity:o}(i||t.blend!==r.blend)&&(n||(nt(e,a),n=!0),e.globalCompositeOperation=t.blend||vr.blend);for(var s=0;s=4&&(u={x:parseFloat(v[0]||0),y:parseFloat(v[1]||0),width:parseFloat(v[2]),height:parseFloat(v[3])})}if(u&&s!=null&&f!=null&&(l=cl(u,{x:0,y:0,width:s,height:f}),!r.ignoreViewBox)){var c=a;a=new Mr,a.add(c),c.scaleX=c.scaleY=l.scale,c.x=l.x,c.y=l.y}return!r.ignoreRootClip&&s!=null&&f!=null&&a.setClipPath(new Ke({shape:{x:0,y:0,width:s,height:f}})),{root:a,width:s,height:f,viewBoxRect:u,viewBoxTransform:l,named:n}},e.prototype._parseNode=function(t,r,i,a,n,o){var s=t.nodeName.toLowerCase(),f,h=a;if(s==="defs"&&(n=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")f=r;else{if(!n){var u=Ui[s];if(u&&qe(Ui,s)){f=u.call(this,t,r);var l=t.getAttribute("name");if(l){var v={name:l,namedFrom:null,svgNodeTagLower:s,el:f};i.push(v),s==="g"&&(h=v)}else a&&i.push({name:a.name,namedFrom:a,svgNodeTagLower:s,el:f});r.add(f)}}var c=Xn[s];if(c&&qe(Xn,s)){var _=c.call(this,t),g=t.getAttribute("id");g&&(this._defs[g]=_)}}if(f&&f.isGroup)for(var d=t.firstChild;d;)d.nodeType===1?this._parseNode(d,f,i,h,n,o):d.nodeType===3&&o&&this._parseText(d,f),d=d.nextSibling},e.prototype._parseText=function(t,r){var i=new Qe({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});lt(r,i),ft(t,i,this._defsUsePending,!1,!1),ol(i,r);var a=i.style,n=a.fontSize;n&&n<9&&(a.fontSize=9,i.scaleX*=n/9,i.scaleY*=n/9);var o=(a.fontSize||a.fontFamily)&&[a.fontStyle,a.fontWeight,(a.fontSize||12)+"px",a.fontFamily||"sans-serif"].join(" ");a.font=o;var s=i.getBoundingRect();return this._textX+=s.width,r.add(i),i},e.internalField=function(){Ui={g:function(t,r){var i=new Mr;return lt(r,i),ft(t,i,this._defsUsePending,!1,!1),i},rect:function(t,r){var i=new Ke;return lt(r,i),ft(t,i,this._defsUsePending,!1,!1),i.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")}),i.silent=!0,i},circle:function(t,r){var i=new cu;return lt(r,i),ft(t,i,this._defsUsePending,!1,!1),i.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),i.silent=!0,i},line:function(t,r){var i=new Ru;return lt(r,i),ft(t,i,this._defsUsePending,!1,!1),i.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")}),i.silent=!0,i},ellipse:function(t,r){var i=new pu;return lt(r,i),ft(t,i,this._defsUsePending,!1,!1),i.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")}),i.silent=!0,i},polygon:function(t,r){var i=t.getAttribute("points"),a;i&&(a=Un(i));var n=new as({shape:{points:a||[]},silent:!0});return lt(r,n),ft(t,n,this._defsUsePending,!1,!1),n},polyline:function(t,r){var i=t.getAttribute("points"),a;i&&(a=Un(i));var n=new Mu({shape:{points:a||[]},silent:!0});return lt(r,n),ft(t,n,this._defsUsePending,!1,!1),n},image:function(t,r){var i=new Fa;return lt(r,i),ft(t,i,this._defsUsePending,!1,!1),i.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")}),i.silent=!0,i},text:function(t,r){var i=t.getAttribute("x")||"0",a=t.getAttribute("y")||"0",n=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0";this._textX=parseFloat(i)+parseFloat(n),this._textY=parseFloat(a)+parseFloat(o);var s=new Mr;return lt(r,s),ft(t,s,this._defsUsePending,!1,!0),s},tspan:function(t,r){var i=t.getAttribute("x"),a=t.getAttribute("y");i!=null&&(this._textX=parseFloat(i)),a!=null&&(this._textY=parseFloat(a));var n=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0",s=new Mr;return lt(r,s),ft(t,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(n),this._textY+=parseFloat(o),s},path:function(t,r){var i=t.getAttribute("d")||"",a=lu(i);return lt(r,a),ft(t,a,this._defsUsePending,!1,!1),a.silent=!0,a}}}(),e}(),Xn={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||"0",10),r=parseInt(e.getAttribute("y1")||"0",10),i=parseInt(e.getAttribute("x2")||"10",10),a=parseInt(e.getAttribute("y2")||"0",10),n=new Iu(t,r,i,a);return Gn(e,n),qn(e,n),n},radialgradient:function(e){var t=parseInt(e.getAttribute("cx")||"0",10),r=parseInt(e.getAttribute("cy")||"0",10),i=parseInt(e.getAttribute("r")||"0",10),a=new Hu(t,r,i);return Gn(e,a),qn(e,a),a}};function Gn(e,t){var r=e.getAttribute("gradientUnits");r==="userSpaceOnUse"&&(t.global=!0)}function qn(e,t){for(var r=e.firstChild;r;){if(r.nodeType===1&&r.nodeName.toLocaleLowerCase()==="stop"){var i=r.getAttribute("offset"),a=void 0;i&&i.indexOf("%")>0?a=parseInt(i,10)/100:i?a=parseFloat(i):a=0;var n={};cs(r,n,n);var o=n.stopColor||r.getAttribute("stop-color")||"#000000";t.colorStops.push({offset:a,color:o})}r=r.nextSibling}}function lt(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),_t(t.__inheritedStyle,e.__inheritedStyle))}function Un(e){for(var t=li(e),r=[],i=0;i0;n-=2){var o=i[n],s=i[n-1],f=li(o);switch(a=a||se(),s){case"translate":la(a,a,[parseFloat(f[0]),parseFloat(f[1]||"0")]);break;case"scale":Ao(a,a,[parseFloat(f[0]),parseFloat(f[1]||f[0])]);break;case"rotate":Do(a,a,-parseFloat(f[0])*Zi);break;case"skewX":var h=Math.tan(parseFloat(f[0])*Zi);ee(a,[1,0,h,1,0,0],a);break;case"skewY":var u=Math.tan(parseFloat(f[0])*Zi);ee(a,[1,u,0,1,0,0],a);break;case"matrix":a[0]=parseFloat(f[0]),a[1]=parseFloat(f[1]),a[2]=parseFloat(f[2]),a[3]=parseFloat(f[3]),a[4]=parseFloat(f[4]),a[5]=parseFloat(f[5]);break}}t.setLocalTransform(a)}}var Nn=/([^\s:;]+)\s*:\s*([^:;]+)/g;function cs(e,t,r){var i=e.getAttribute("style");if(!!i){Nn.lastIndex=0;for(var a;(a=Nn.exec(i))!=null;){var n=a[1],o=qe(ti,n)?ti[n]:null;o&&(t[o]=a[2]);var s=qe(ri,n)?ri[n]:null;s&&(r[s]=a[2])}}}function vl(e,t,r){for(var i=0;i=s)}}for(var l=this.__startIndex;l15)break}}A.prevElClipPaths&&p.restore()};if(y)if(y.length===0)C=d.__endIndex;else for(var S=c.dpr,P=0;P0&&t>a[0]){for(f=0;ft);f++);s=i[a[f]]}if(a.splice(f+1,0,t),i[t]=r,!r.virtual)if(s){var h=s.dom;h.nextSibling?o.insertBefore(r.dom,h.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.__painter=this}},e.prototype.eachLayer=function(t,r){for(var i=this._zlevelList,a=0;a0?Oe:0),this._needsManuallyCompositing),u.__builtin__||Ma("ZLevel "+h+" has been used by unkown layer "+u.id),u!==n&&(u.__used=!0,u.__startIndex!==f&&(u.__dirty=!0),u.__startIndex=f,u.incremental?u.__drawIndex=-1:u.__drawIndex=f,r(f),n=u),a.__dirty&ht&&!a.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=f))}r(f),this.eachBuiltinLayer(function(l,v){!l.__used&&l.getElementCount()>0&&(l.__dirty=!0,l.__startIndex=l.__endIndex=l.__drawIndex=0),l.__dirty&&l.__drawIndex<0&&(l.__drawIndex=l.__startIndex)})},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(t){t.clear()},e.prototype.setBackgroundColor=function(t){this._backgroundColor=t,J(this._layers,function(r){r.setUnpainted()})},e.prototype.configLayer=function(t,r){if(r){var i=this._layerConfig;i[t]?Sr(i[t],r,!0):i[t]=r;for(var a=0;a2&&i.push(a),a=[x,A]}function u(x,A,E,D){Fr(x,E)&&Fr(A,D)||a.push(x,A,E,D,E,D)}function l(x,A,E,D,k,z){var Y=Math.abs(A-x),q=Math.tan(Y/4)*4/3,Z=AC:P2&&i.push(a),i}function ma(e,t,r,i,a,n,o,s,f,h){if(Fr(e,r)&&Fr(t,i)&&Fr(a,o)&&Fr(n,s)){f.push(o,s);return}var u=2/h,l=u*u,v=o-e,c=s-t,_=Math.sqrt(v*v+c*c);v/=_,c/=_;var g=r-e,d=i-t,p=a-o,y=n-s,m=g*g+d*d,T=p*p+y*y;if(m=0&&C=0){f.push(o,s);return}var M=[],S=[];Xt(e,r,a,o,.5,M),Xt(t,i,n,s,.5,S),ma(M[0],S[0],M[1],S[1],M[2],S[2],M[3],S[3],f,h),ma(M[4],S[4],M[5],S[5],M[6],S[6],M[7],S[7],f,h)}function ml(e,t){var r=ya(e),i=[];t=t||1;for(var a=0;a0)for(var h=0;hMath.abs(h),l=ds([f,h],u?0:1,t),v=(u?s:h)/l.length,c=0;ca,o=ds([i,a],n?0:1,t),s=n?"width":"height",f=n?"height":"width",h=n?"x":"y",u=n?"y":"x",l=e[s]/o.length,v=0;v1?null:new I(g*f+e,g*h+t)}function bl(e,t,r){var i=new I;I.sub(i,r,t),i.normalize();var a=new I;I.sub(a,e,t);var n=a.dot(i);return n}function br(e,t){var r=e[e.length-1];r&&r[0]===t[0]&&r[1]===t[1]||e.push(t)}function Cl(e,t,r){for(var i=e.length,a=[],n=0;no?(h.x=u.x=s+n/2,h.y=f,u.y=f+o):(h.y=u.y=f+o/2,h.x=s,u.x=s+n),Cl(t,h,u)}function ei(e,t,r,i){if(r===1)i.push(t);else{var a=Math.floor(r/2),n=e(t);ei(e,n[0],a,i),ei(e,n[1],r-a,i)}return i}function Ll(e,t){for(var r=[],i=0;i0)for(var b=i/r,w=-i/2;w<=i/2;w+=b){for(var L=Math.sin(w),C=Math.cos(w),M=0,m=0;m0;h/=2){var u=0,l=0;(e&h)>0&&(u=1),(t&h)>0&&(l=1),s+=h*h*(3*u^l),l===0&&(u===1&&(e=h-1-e,t=h-1-t),f=e,e=t,t=f)}return s}function ai(e){var t=1/0,r=1/0,i=-1/0,a=-1/0,n=xt(e,function(s){var f=s.getBoundingRect(),h=s.getComputedTransform(),u=f.x+f.width/2+(h?h[4]:0),l=f.y+f.height/2+(h?h[5]:0);return t=Math.min(u,t),r=Math.min(l,r),i=Math.max(u,i),a=Math.max(l,a),[u,l]}),o=xt(n,function(s,f){return{cp:s,z:Fl(s[0],s[1],t,r,i,a),path:e[f]}});return o.sort(function(s,f){return s.z-f.z}).map(function(s){return s.path})}function ys(e){return Pl(e.path,e.count)}function Ta(){return{fromIndividuals:[],toIndividuals:[],count:0}}function pv(e,t,r){var i=[];function a(b){for(var w=0;w