MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / _s

Function _s

public/iframe/lib/js/echarts-gl.min.js:15–15  ·  view source on GitHub ↗
(t,e)

Source from the content-addressed store, hash-verified

13See the Apache Version 2.0 License for specific language governing permissions
14and limitations under the License.
15***************************************************************************** */function bo(t,e){function r(){this.constructor=t}To(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var wo=new qr(50);function So(t){if("string"==typeof t){var e=wo.get(t);return e&&e.image}return t}function Eo(t){return t&&t.width&&t.height}function Ao(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Mo(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Co(t,e,r){var i=e[0]*r[0]+e[2]*r[1],n=e[1]*r[0]+e[3]*r[1],a=e[0]*r[2]+e[2]*r[3],o=e[1]*r[2]+e[3]*r[3],s=e[0]*r[4]+e[2]*r[5]+e[4],l=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=i,t[1]=n,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t}function Do(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t}function Lo(t,e){var r=e[0],i=e[2],n=e[4],a=e[1],o=e[3],s=e[5],l=r*o-a*i;return l?(l=1/l,t[0]=o*l,t[1]=-a*l,t[2]=-i*l,t[3]=r*l,t[4]=(i*s-o*n)*l,t[5]=(a*n-r*s)*l,t):null}var Po,No,Ro=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,r=this.y-t.y;return e*e+r*r},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,r=this.y;return this.x=t[0]*e+t[2]*r+t[4],this.y=t[1]*e+t[3]*r+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,r){t.x=e,t.y=r},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,r){t.x=e.x+r.x,t.y=e.y+r.y},t.sub=function(t,e,r){t.x=e.x-r.x,t.y=e.y-r.y},t.scale=function(t,e,r){t.x=e.x*r,t.y=e.y*r},t.scaleAndAdd=function(t,e,r,i){t.x=e.x+r.x*i,t.y=e.y+r.y*i},t.lerp=function(t,e,r,i){var n=1-i;t.x=n*e.x+i*r.x,t.y=n*e.y+i*r.y},t}(),Io=Math.min,Oo=Math.max,Bo=new Ro,Fo=new Ro,zo=new Ro,Uo=new Ro,ko=new Ro,Go=new Ro,Ho=function(){function t(t,e,r,i){r<0&&isFinite(r)&&(t+=r,r=-r),i<0&&isFinite(i)&&(e+=i,i=-i),this.x=t,this.y=e,this.width=r,this.height=i}return t.prototype.union=function(t){var e=Io(t.x,this.x),r=Io(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Oo(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Oo(t.y+t.height,this.y+this.height)-r:this.height=t.height,this.x=e,this.y=r},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){var e=this,r=t.width/e.width,i=t.height/e.height,n=[1,0,0,1,0,0];return Do(n,n,[-e.x,-e.y]),function(t,e,r){var i=r[0],n=r[1];t[0]=e[0]*i,t[1]=e[1]*n,t[2]=e[2]*i,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*n}(n,n,[r,i]),Do(n,n,[t.x,t.y]),n},t.prototype.intersect=function(e,r){if(!e)return!1;e instanceof t||(e=t.create(e));var i=this,n=i.x,a=i.x+i.width,o=i.y,s=i.y+i.height,l=e.x,h=e.x+e.width,u=e.y,c=e.y+e.height,d=!(a<l||h<n||s<u||c<o);if(r){var f=1/0,p=0,m=Math.abs(a-l),g=Math.abs(h-n),_=Math.abs(s-u),v=Math.abs(c-o),y=Math.min(m,g),x=Math.min(_,v);a<l||h<n?y>p&&(p=y,m<g?Ro.set(Go,-m,0):Ro.set(Go,g,0)):y<f&&(f=y,m<g?Ro.set(ko,m,0):Ro.set(ko,-g,0)),s<u||c<o?x>p&&(p=x,_<v?Ro.set(Go,0,-_):Ro.set(Go,0,v)):y<f&&(f=y,_<v?Ro.set(ko,0,_):Ro.set(ko,0,-v))}return r&&Ro.copy(r,d?ko:Go),d},t.prototype.contain=function(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.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],a=i[3],o=i[4],s=i[5];return e.x=r.x*n+o,e.y=r.y*a+s,e.width=r.width*n,e.height=r.height*a,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}Bo.x=zo.x=r.x,Bo.y=Uo.y=r.y,Fo.x=Uo.x=r.x+r.width,Fo.y=zo.y=r.y+r.height,Bo.transform(i),Uo.transform(i),Fo.transform(i),zo.transform(i),e.x=Io(Bo.x,Fo.x,zo.x,Uo.x),e.y=Io(Bo.y,Fo.y,zo.y,Uo.y);var l=Oo(Bo.x,Fo.x,zo.x,Uo.x),h=Oo(Bo.y,Fo.y,zo.y,Uo.y);e.width=l-e.x,e.height=h-e.y}else e!==r&&t.copy(e,r)},t}(),Vo={},Wo="12px sans-serif";var Xo={measureText:function(t,e){return Po||(Po=Yn().getContext("2d")),No!==e&&(No=Po.font=e||Wo),Po.measureText(t)}};function jo(t,e){var r=Vo[e=e||Wo];r||(r=Vo[e]=new qr(500));var i=r.get(t);return null==i&&(i=Xo.measureText(t,e).width,r.put(t,i)),i}function qo(t,e,r,i){var n=jo(t,e),a=Ko(e),o=Zo(0,n,r),s=Yo(0,a,i);return new Ho(o,s,n,a)}function Zo(t,e,r){return"right"===r?t-=e:"center"===r&&(t-=e/2),t}function Yo(t,e,r){return"middle"===r?t-=e/2:"bottom"===r&&(t-=e),t}function Ko(t){return jo("国",t)}function Qo(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}var Jo=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function $o(t,e,r,i,n){if(!e)return"";var a=(t+"").split("\n");n=ts(e,r,i,n);for(var o=0,s=a.length;o<s;o++)a[o]=es(a[o],n);return a.join("\n")}function ts(t,e,r,i){var n=qn({},i=i||{});n.font=e,r=ua(r,"..."),n.maxIterations=ua(i.maxIterations,2);var a=n.minChar=ua(i.minChar,0);n.cnCharWidth=jo("国",e);var o=n.ascCharWidth=jo("a",e);n.placeholder=ua(i.placeholder,"");for(var s=t=Math.max(0,t-1),l=0;l<a&&s>=o;l++)s-=o;var h=jo(r,e);return h>s&&(r="",h=0),s=t-h,n.ellipsis=r,n.ellipsisWidth=h,n.contentWidth=s,n.containerWidth=t,n}function es(t,e){var r=e.containerWidth,i=e.font,n=e.contentWidth;if(!r)return"";var a=jo(t,i);if(a<=r)return t;for(var o=0;;o++){if(a<=n||o>=e.maxIterations){t+=e.ellipsis;break}var s=0===o?rs(t,n,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(t.length*n/a):0;a=jo(t=t.substr(0,s),i)}return""===t&&(t=e.placeholder),t}function rs(t,e,r,i){for(var n=0,a=0,o=t.length;a<o&&n<e;a++){var s=t.charCodeAt(a);n+=0<=s&&s<=127?r:i}return a}var is=function(){return function(){}}(),ns=function(){return function(t){this.tokens=[],t&&(this.tokens=t)}}(),as=function(){return function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[]}}();function os(t,e,r,i,n){var a,o,s=""===e,l=n&&r.rich[n]||{},h=t.lines,u=l.font||r.font,c=!1;if(i){var d=l.padding,f=d?d[1]+d[3]:0;if(null!=l.width&&"auto"!==l.width){var p=function(t,e){if("string"==typeof t)return t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t);return t}(l.width,i.width)+f;h.length>0&&p+i.accumWidth>i.width&&(a=e.split("\n"),c=!0),i.accumWidth=p}else{var m=hs(e,u,i.width,i.breakAll,i.accumWidth);i.accumWidth=m.accumWidth+f,o=m.linesWidths,a=m.lines}}else a=e.split("\n");for(var g=0;g<a.length;g++){var _=a[g],v=new is;if(v.styleName=n,v.text=_,v.isLineHolder=!_&&!s,"number"==typeof l.width?v.width=l.width:v.width=o?o[g]:jo(_,u),g||c)h.push(new ns([v]));else{var y=(h[h.length-1]||(h[0]=new ns)).tokens,x=y.length;1===x&&y[0].isLineHolder?y[0]=v:(_||!x||s)&&y.push(v)}}}var ss=ea(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{});function ls(t){return!function(t){var e=t.charCodeAt(0);return e>=33&&e<=255}(t)||!!ss[t]}function hs(t,e,r,i,n){for(var a=[],o=[],s="",l="",h=0,u=0,c=0;c<t.length;c++){var d=t.charAt(c);if("\n"!==d){var f=jo(d,e),p=!i&&!ls(d);(a.length?u+f>r:n+u+f>r)?u?(s||l)&&(p?(s||(s=l,l="",u=h=0),a.push(s),o.push(u-h),l+=d,s="",u=h+=f):(l&&(s+=l,u+=h,l="",h=0),a.push(s),o.push(u),s=d,u=f)):p?(a.push(l),o.push(h),l=d,h=f):(a.push(d),o.push(f)):(u+=f,p?(l+=d,h+=f):(l&&(s+=l,l="",h=0),s+=d))}else l&&(s+=l,u+=h),a.push(s),o.push(u),s="",l="",h=0,u=0}return a.length||s||(s=t,l="",h=0),l&&(s+=l),s&&(a.push(s),o.push(u)),1===a.length&&(u+=n),{accumWidth:u,lines:a,linesWidths:o}}function us(t,e){return null==t&&(t=0),null==e&&(e=0),[t,e]}function cs(t){return[t[0],t[1]]}function ds(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function fs(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function ps(t){return Math.sqrt(ms(t))}function ms(t){return t[0]*t[0]+t[1]*t[1]}function gs(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function _s(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var vs=function(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])};function ys(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n+r[4],t[1]=r[1]*i+r[3]*n+r[5],t}function xs(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function Ts(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}var bs=Ao,ws=5e-5;function Ss(t){return t>ws||t<-ws}var Es=[],As=[],Ms=[1,0,0,1,0,0],Cs=Math.abs,Ds=function(){function t(){}var e;return 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.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return Ss(this.rotation)||Ss(this.x)||Ss(this.y)||Ss(this.scaleX-1)||Ss(this.scaleY-1)},t.prototype.updateTransform=function(){var t=this.parent,e=t&&t.transform,r=this.needLocalTransform(),i=this.transform;r||e?(i=i||[1,0,0,1,0,0],r?this.getLocalTransform(i):bs(i),e&&(r?Co(i,t.transform,i):Mo(i,t.transform)),this.transform=i,this._resolveGlobalScaleRatio(i)):i&&bs(i)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(Es);var r=Es[0]<0?-1:1,i=Es[1]<0?-1:1,n=((Es[0]-r)*e+r)/Es[0]||0,a=((Es[1]-i)*e+i)/Es[1]||0;t[0]*=n,t[1]*=n,t[2]*=a,t[3]*=a}this.invTransform=this.invTransform||[1,0,0,1,0,0],Lo(this.invTransform,t)},t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},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];Ss(e-1)&&(e=Math.sqrt(e)),Ss(r-1)&&(r=Math.sqrt(r)),t[0]<0&&(e=-e),t[3]<0&&(r=-r),this.rotation=Math.atan2(-t[1]/r,t[0]/e),e<0&&r<0&&(this.rotation+=Math.PI,e=-e,r=-r),this.x=t[4],this.y=t[5],this.scaleX=e,this.scaleY=r}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(Co(As,t.invTransform,e),e=As);var r=this.originX,i=this.originY;(r||i)&&(Ms[4]=r,Ms[5]=i,Co(As,e,Ms),As[4]-=r,As[5]-=i,e=As),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&&ys(r,r,i),r},t.prototype.transformCoordToGlobal=function(t,e){var r=[t,e],i=this.transform;return i&&ys(r,r,i),r},t.prototype.getLineScale=function(){var t=this.transform;return t&&Cs(t[0]-1)>1e-10&&Cs(t[3]-1)>1e-10?Math.sqrt(Cs(t[0]*t[3]-t[2]*t[1])):1},t.getLocalTransform=function(t,e){bs(e=e||[]);var r,i,n,a,o,s,l,h,u,c,d,f=t.originX||0,p=t.originY||0,m=t.scaleX,g=t.scaleY,_=t.rotation||0,v=t.x,y=t.y;return e[4]-=f,e[5]-=p,e[0]*=m,e[1]*=g,e[2]*=m,e[3]*=g,e[4]*=m,e[5]*=g,_&&(r=e,n=_,a=(i=e)[0],o=i[2],s=i[4],l=i[1],h=i[3],u=i[5],c=Math.sin(n),d=Math.cos(n),r[0]=a*d+l*c,r[1]=-a*c+l*d,r[2]=o*d+h*c,r[3]=-o*c+d*h,r[4]=d*s+c*u,r[5]=d*u-c*s),e[4]+=f,e[5]+=p,e[4]+=v,e[5]+=y,e},t.initDefaultProps=((e=t.prototype).x=0,e.y=0,e.scaleX=1,e.scaleY=1,e.originX=0,e.originY=0,e.rotation=0,void(e.globalScaleRatio=1)),t}(),Ls=function(){function t(t){t&&(this._$eventProcessor=t)}return t.prototype.on=function(t,e,r,i){this._$handlers||(this._$handlers={});var n=this._$handlers;if("function"==typeof e&&(i=r,r=e,e=null),!r||!t)return this;var a=this._$eventProcessor;null!=e&&a&&a.normalizeQuery&&(e=a.normalizeQuery(e)),n[t]||(n[t]=[]);for(var o=0;o<n[t].length;o++)if(n[t][o].h===r)return this;var s={h:r,query:e,ctx:i||this,callAtLast:r.zrEventfulCallAtLast},l=n[t].length-1,h=n[t][l];return h&&h.callAtLast?n[t].splice(l,0,s):n[t].push(s),this},t.prototype.isSilent=function(t){var e=this._$handlers;return!e||!e[t]||!e[t].length},t.prototype.off=function(t,e){var r=this._$handlers;if(!r)return this;if(!t)return this._$handlers={},this;if(e){if(r[t]){for(var i=[],n=0,a=r[t].length;n<a;n++)r[t][n].h!==e&&i.push(r[t][n]);r[t]=i}r[t]&&0===r[t].length&&delete r[t]}else delete r[t];return this},t.prototype.trigger=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(!this._$handlers)return this;var i=this._$handlers[t],n=this._$eventProcessor;if(i)for(var a=e.length,o=i.length,s=0;s<o;s++){var l=i[s];if(!n||!n.filter||null==l.query||n.filter(t,l.query))switch(a){case 0:l.h.call(l.ctx);break;case 1:l.h.call(l.ctx,e[0]);break;case 2:l.h.call(l.ctx,e[0],e[1]);break;default:l.h.apply(l.ctx,e)}}return n&&n.afterTrigger&&n.afterTrigger(t),this},t.prototype.triggerWithContext=function(t){if(!this._$handlers)return this;var e=this._$handlers[t],r=this._$eventProcessor;if(e)for(var i=arguments,n=i.length,a=i[n-1],o=e.length,s=0;s<o;s++){var l=e[s];if(!r||!r.filter||null==l.query||r.filter(t,l.query))switch(n){case 0:l.h.call(a);break;case 1:l.h.call(a,i[0]);break;case 2:l.h.call(a,i[0],i[1]);break;default:l.h.apply(a,i.slice(1,n-1))}}return r&&r.afterTrigger&&r.afterTrigger(t),this},t}(),Ps=1;"undefined"!=typeof window&&(Ps=Math.max(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var Ns=Ps,Rs=function(){return function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.weChat=!1}}(),Is=new(function(){return function(){this.browser=new Rs,this.node=!1,this.wxa=!1,this.worker=!1,this.canvasSupported=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1}}());"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(Is.wxa=!0,Is.canvasSupported=!0,Is.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?(Is.worker=!0,Is.canvasSupported=!0):"undefined"==typeof navigator?(Is.node=!0,Is.canvasSupported=!0,Is.svgSupported=!0):function(t,e){var r=e.browser,i=t.match(/Firefox\/([\d.]+)/),n=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),a=t.match(/Edge\/([\d.]+)/),o=/micromessenger/i.test(t);i&&(r.firefox=!0,r.version=i[1]);n&&(r.ie=!0,r.version=n[1]);a&&(r.edge=!0,r.version=a[1]);o&&(r.weChat=!0);e.canvasSupported=!!document.createElement("canvas").getContext,e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11),e.domSupported="undefined"!=typeof document}(navigator.userAgent,Is);var Os=Is,Bs=["x","y","scaleX","scaleY","originX","originY","rotation","ignore"],Fs={x:!0,y:!0,scaleX:!0,scaleY:!0,originX:!0,originY:!0,rotation:!0,ignore:!1},zs={},Us=new Ho(0,0,0,0),ks=function(){function t(t){this.id=Vn++,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.attachedTransform,a=void 0,o=void 0,s=!1;n.parent=i?this:null;var l=!1;if(n.x=e.x,n.y=e.y,n.originX=e.originX,n.originY=e.originY,n.rotation=e.rotation,n.scaleX=e.scaleX,n.scaleY=e.scaleY,null!=r.position){var h=Us;r.layoutRect?h.copy(r.layoutRect):h.copy(this.getBoundingRect()),i||h.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(zs,r,h):function(t,e,r){var i=e.position||"inside",n=null!=e.distance?e.distance:5,a=r.height,o=r.width,s=a/2,l=r.x,h=r.y,u="left",c="top";if(i instanceof Array)l+=Qo(i[0],r.width),h+=Qo(i[1],r.height),u=null,c=null;else switch(i){case"left":l-=n,h+=s,u="right",c="middle";break;case"right":l+=n+o,h+=s,c="middle";break;case"top":l+=o/2,h-=n,u="center",c="bottom";break;case"bottom":l+=o/2,h+=a+n,u="center";break;case"inside":l+=o/2,h+=s,u="center",c="middle";break;case"insideLeft":l+=n,h+=s,c="middle";break;case"insideRight":l+=o-n,h+=s,u="right",c="middle";break;case"insideTop":l+=o/2,h+=n,u="center";break;case"insideBottom":l+=o/2,h+=a-n,u="center",c="bottom";break;case"insideTopLeft":l+=n,h+=n;break;case"insideTopRight":l+=o-n,h+=n,u="right";break;case"insideBottomLeft":l+=n,h+=a-n,c="bottom";break;case"insideBottomRight":l+=o-n,h+=a-n,u="right",c="bottom"}(t=t||{}).x=l,t.y=h,t.align=u,t.verticalAlign=c}(zs,r,h),n.x=zs.x,n.y=zs.y,a=zs.align,o=zs.verticalAlign;var u=r.origin;if(u&&null!=r.rotation){var c=void 0,d=void 0;"center"===u?(c=.5*h.width,d=.5*h.height):(c=Qo(u[0],h.width),d=Qo(u[1],h.height)),l=!0,n.originX=-n.x+c+(i?0:h.x),n.originY=-n.y+d+(i?0:h.y)}}null!=r.rotation&&(n.rotation=r.rotation);var f=r.offset;f&&(n.x+=f[0],n.y+=f[1],l||(n.originX=-f[0],n.originY=-f[1]));var p=null==r.inside?"string"==typeof r.position&&r.position.indexOf("inside")>=0:r.inside,m=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),g=void 0,_=void 0,v=void 0;p&&this.canBeInsideText()?(g=r.insideFill,_=r.insideStroke,null!=g&&"auto"!==g||(g=this.getInsideTextFill()),null!=_&&"auto"!==_||(_=this.getInsideTextStroke(g),v=!0)):(g=r.outsideFill,_=r.outsideStroke,null!=g&&"auto"!==g||(g=this.getOutsideFill()),null!=_&&"auto"!==_||(_=this.getOutsideStroke(g),v=!0)),(g=g||"#000")===m.fill&&_===m.stroke&&v===m.autoStroke&&a===m.align&&o===m.verticalAlign||(s=!0,m.fill=g,m.stroke=_,m.autoStroke=v,m.align=a,m.verticalAlign=o,e.setDefaultTextStyle(m)),s&&e.dirtyStyle(),e.markRedraw()}},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()?"#ccc":"#333"},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),r="string"==typeof e&&Cn(e);r||(r=[255,255,255,1]);for(var i=r[3],n=this.__zr.isDarkMode(),a=0;a<3;a++)r[a]=r[a]*i+(n?0:255)*(1-i);return r[3]=1,Ln(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||{},qn(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(sa(t))for(var r=ra(t),i=0;i<r.length;i++){var n=r[i];this.attrKV(n,t[n])}return this.markRedraw(),this},t.prototype.saveCurrentToNormalState=function(t){this._innerSaveToNormal(t);for(var e=this._normalState,r=0;r<this.animators.length;r++){var i=this.animators[r],n=i.__fromStateTransition;if(!n||"__zr_normal__"===n){var a=i.targetName,o=a?e[a]:e;i.saveFinalToTarget(o)}}},t.prototype._innerSaveToNormal=function(t){var e=this._normalState;e||(e=this._normalState={}),t.textConfig&&!e.textConfig&&(e.textConfig=this.textConfig),this._savePrimaryToNormal(t,e,Bs)},t.prototype._savePrimaryToNormal=function(t,e,r){for(var i=0;i<r.length;i++){var n=r[i];null==t[n]||n in e||(e[n]=this[n])}},t.prototype.hasState=function(){return this.currentStates.length>0},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("__zr_normal__",!1,t)},t.prototype.useState=function(e,r,i){var n="__zr_normal__"===e;if(this.hasState()||!n){var a=this.currentStates,o=this.stateTransition;if(!(Kn(a,e)>=0)||!r&&1!==a.length){var s;if(this.stateProxy&&!n&&(s=this.stateProxy(e)),s||(s=this.states&&this.states[e]),s||n){n||this.saveCurrentToNormalState(s);var l=!(!s||!s.hoverLayer);return l&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,s,this._normalState,r,!i&&!this.__inHover&&o&&o.duration>0,o),this._textContent&&this._textContent.useState(e,r),this._textGuide&&this._textGuide.useState(e,r),n?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~t.REDARAW_BIT),s}Wn("State "+e+" not exists.")}}},t.prototype.useStates=function(e,r){if(e.length){var i=[],n=this.currentStates,a=e.length,o=a===n.length;if(o)for(var s=0;s<a;s++)if(e[s]!==n[s]){o=!1;break}if(o)return;for(s=0;s<a;s++){var l=e[s],h=void 0;this.stateProxy&&(h=this.stateProxy(l,e)),h||(h=this.states[l]),h&&i.push(h)}var u=!(!i[a-1]||!i[a-1].hoverLayer);u&&this._toggleHoverLayerFlag(!0);var c=this._mergeStates(i),d=this.stateTransition;this.saveCurrentToNormalState(c),this._applyStateObj(e.join(","),c,this._normalState,!1,!r&&!this.__inHover&&d&&d.duration>0,d),this._textContent&&this._textContent.useStates(e),this._textGuide&&this._textGuide.useStates(e),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!u&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~t.REDARAW_BIT)}else this.clearStates()},t.prototype._updateAnimationTargets=function(){for(var t=0;t<this.animators.length;t++){var e=this.animators[t];e.targetName&&e.changeTarget(this[e.targetName])}},t.prototype.removeState=function(t){var e=Kn(this.currentStates,t);if(e>=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=Kn(i,t),a=Kn(i,e)>=0;n>=0?a?i.splice(n,1):i[n]=e:r&&!a&&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<t.length;i++){var n=t[i];qn(r,n),n.textConfig&&qn(e=e||{},n.textConfig)}return e&&(r.textConfig=e),r},t.prototype._applyStateObj=function(t,e,r,i,n,a){var o=!(e&&i);e&&e.textConfig?(this.textConfig=qn({},i?this.textConfig:r.textConfig),qn(this.textConfig,e.textConfig)):o&&r.textConfig&&(this.textConfig=r.textConfig);for(var s={},l=!1,h=0;h<Bs.length;h++){var u=Bs[h],c=n&&Fs[u];e&&null!=e[u]?c?(l=!0,s[u]=e[u]):this[u]=e[u]:o&&null!=r[u]&&(c?(l=!0,s[u]=r[u]):this[u]=r[u])}if(!n)for(h=0;h<this.animators.length;h++){var d=this.animators[h],f=d.targetName;d.__changeFinalValue(f?(e||r)[f]:e||r)}l&&this._transitionState(t,s,a)},t.prototype._attachComponent=function(t){if(t.__zr&&!t.__hostTarget)throw new Error("Text element has been added to zrender.");if(t===this)throw new Error("Recursive component attachment.");var e=this.__zr;e&&t.addSelfToZr(e),t.__zr=e,t.__hostTarget=this},t.prototype._detachComponent=function(t){t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__hostTarget=null},t.prototype.getClipPath=function(){return this._clipPath},t.prototype.setClipPath=function(t){this._clipPath&&this._clipPath!==t&&this.removeClipPath(),this._attachComponent(t),this._clipPath=t,this.markRedraw()},t.prototype.removeClipPath=function(){var t=this._clipPath;t&&(this._detachComponent(t),this._clipPath=null,this.markRedraw())},t.prototype.getTextContent=function(){return this._textContent},t.prototype.setTextContent=function(t){var e=this._textContent;if(e!==t){if(e&&e!==t&&this.removeTextContent(),t.__zr&&!t.__hostTarget)throw new Error("Text element has been added to zrender.");t.attachedTransform=new Ds,this._attachComponent(t),this._textContent=t,this.markRedraw()}},t.prototype.setTextConfig=function(t){this.textConfig||(this.textConfig={}),qn(this.textConfig,t),this.markRedraw()},t.prototype.removeTextContent=function(){var t=this._textContent;t&&(t.attachedTransform=null,this._detachComponent(t),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},t.prototype.getTextGuideLine=function(){return this._textGuide},t.prototype.setTextGuideLine=function(t){this._textGuide&&this._textGuide!==t&&this.removeTextGuideLine(),this._attachComponent(t),this._textGuide=t,this.markRedraw()},t.prototype.removeTextGuideLine=function(){var t=this._textGuide;t&&(this._detachComponent(t),this._textGuide=null,this.markRedraw())},t.prototype.markRedraw=function(){this.__dirty|=t.REDARAW_BIT;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},t.prototype.dirty=function(){this.markRedraw()},t.prototype._toggleHoverLayerFlag=function(t){this.__inHover=t;var e=this._textContent,r=this._textGuide;e&&(e.__inHover=t),r&&(r.__inHover=t)},t.prototype.addSelfToZr=function(t){this.__zr=t;var e=this.animators;if(e)for(var r=0;r<e.length;r++)t.animation.addAnimator(e[r]);this._clipPath&&this._clipPath.addSelfToZr(t),this._textContent&&this._textContent.addSelfToZr(t),this._textGuide&&this._textGuide.addSelfToZr(t)},t.prototype.removeSelfFromZr=function(t){this.__zr=null;var e=this.animators;if(e)for(var r=0;r<e.length;r++)t.animation.removeAnimator(e[r]);this._clipPath&&this._clipPath.removeSelfFromZr(t),this._textContent&&this._textContent.removeSelfFromZr(t),this._textGuide&&this._textGuide.removeSelfFromZr(t)},t.prototype.animate=function(t,e){var r=t?this[t]:this;if(r){var i=new Oa(r,e);return this.addAnimator(i,t),i}Wn('Property "'+t+'" is not existed in element '+this.id)},t.prototype.addAnimator=function(t,e){var r=this.__zr,i=this;t.during(function(){i.updateDuringAnimation(e)}).done(function(){var e=i.animators,r=Kn(e,t);r>=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=[],a=0;a<i;a++){var o=r[a];t&&t!==o.scope?n.push(o):o.stop(e)}return this.animators=n,this},t.prototype.animateTo=function(t,e,r){Gs(this,t,e,r)},t.prototype.animateFrom=function(t,e,r){Gs(this,t,e,r,!0)},t.prototype._transitionState=function(t,e,r,i){for(var n=Gs(this,e,r,i),a=0;a<n.length;a++)n[a].__fromStateTransition=t},t.prototype.getBoundingRect=function(){return null},t.prototype.getPaintRect=function(){return null},t.REDARAW_BIT=1,t.initDefaultProps=function(){var e=t.prototype;e.type="element",e.name="",e.ignore=!1,e.silent=!1,e.isGroup=!1,e.draggable=!1,e.dragging=!1,e.ignoreClip=!1,e.__inHover=!1,e.__dirty=t.REDARAW_BIT;var r={};function i(t,e,i){r[t+e+i]||(console.warn("DEPRECATED: '"+t+"' has been deprecated. use '"+e+"', '"+i+"' instead"),r[t+e+i]=!0)}function n(t,r,n,a){function o(t,e){Object.defineProperty(e,0,{get:function(){return t[n]},set:function(e){t[n]=e}}),Object.defineProperty(e,1,{get:function(){return t[a]},set:function(e){t[a]=e}})}Object.defineProperty(e,t,{get:function(){(i(t,n,a),this[r])||o(this,this[r]=[]);return this[r]},set:function(e){i(t,n,a),this[n]=e[0],this[a]=e[1],this[r]=e,o(this,e)}})}Object.defineProperty&&(!Os.browser.ie||Os.browser.version>8)&&(n("position","_legacyPos","x","y"),n("scale","_legacyScale","scaleX","scaleY"),n("origin","_legacyOrigin","originX","originY"))}(),t}();function Gs(t,e,r,i,n){var a=[];!function t(e,r,i,n,a,o,s,l){var h=[];var u=[];var c=ra(n);var d=a.duration;var f=a.delay;var p=a.additive;var m=a.setToFinal;var g=!sa(o);for(var _=0;_<c.length;_++){var v=c[_];if(null!=i[v]&&null!=n[v]&&(g||o[v]))if(sa(n[v])&&!Jn(n[v])){if(r){l||(i[v]=n[v],e.updateDuringAnimation(r));continue}t(e,v,i[v],n[v],a,o&&o[v],s,l)}else h.push(v),u.push(v);else l||(i[v]=n[v],e.updateDuringAnimation(r),u.push(v))}var y=h.length;if(y>0||a.force&&!s.length){for(var x=e.animators,T=[],b=0;b<x.length;b++)x[b].targetName===r&&T.push(x[b]);if(!p&&T.length)for(var b=0;b<T.length;b++){var w=T[b].stopTracks(u);if(w){var S=Kn(x,T[b]);x.splice(S,1)}}var E=void 0,A=void 0,M=void 0;if(l){A={},m&&(E={});for(var b=0;b<y;b++){var v=h[b];A[v]=i[v],m?E[v]=n[v]:i[v]=n[v]}}else if(m){M={};for(var b=0;b<y;b++){var v=h[b];M[v]=Pa(i[v]),Vs(i,n,v)}}var C=new Oa(i,!1,p?T:null);C.targetName=r,a.scope&&(C.scope=a.scope),m&&E&&C.whenWithKeys(0,E,h),M&&C.whenWithKeys(0,M,h),C.whenWithKeys(null==d?500:d,l?A:n,h).delay(f||0),e.addAnimator(C,r),s.push(C)}}(t,"",t,e,r=r||{},i,a,n);var o=a.length,s=!1,l=r.done,h=r.aborted,u=function(){s=!0,--o<=0&&(s?l&&l():h&&h())},c=function(){--o<=0&&(s?l&&l():h&&h())};o||l&&l(),a.length>0&&r.during&&a[0].during(function(t,e){r.during(e)});for(var d=0;d<a.length;d++){var f=a[d];u&&f.done(u),c&&f.aborted(c),f.start(r.easing,r.force)}return a}function Hs(t,e,r){for(var i=0;i<r;i++)t[i]=e[i]}function Vs(t,e,r){if(Jn(e[r]))if(Jn(t[r])||(t[r]=[]),h=e[r],Rn[In.call(h)]){var i=e[r].length;t[r].length!==i&&(t[r]=new e[r].constructor(i),Hs(t[r],e[r],i))}else{var n=e[r],a=t[r],o=n.length;if(function(t){return Jn(t[0])}(n))for(var s=n[0].length,l=0;l<o;l++)a[l]?Hs(a[l],n[l],s):a[l]=Array.prototype.slice.call(n[l]);else Hs(a,n,o);a.length=n.length}else t[r]=e[r];var h}Qn(ks,Ls),Qn(ks,Ds);var Ws=ks,Xs="__zr_style_"+Math.round(10*Math.random()),js={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},qs={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};js[Xs]=!0;var Zs=["z","z2","invisible"],Ys=function(t){function e(e){return t.call(this,e)||this}var r;return bo(e,t),e.prototype._init=function(e){for(var r=ra(e),i=0;i<r.length;i++){var n=r[i];"style"===n?this.useStyle(e[n]):t.prototype.attrKV.call(this,n,e[n])}this.style||this.useStyle({})},e.prototype.beforeBrush=function(){},e.prototype.afterBrush=function(){},e.prototype.innerBeforeBrush=function(){},e.prototype.innerAfterBrush=function(){},e.prototype.shouldBePainted=function(t,e,r,i){var n=this.transform;if(this.ignore||this.invisible||0===this.style.opacity||this.culling&&function(t,e,r){Ks.copy(t.getBoundingRect()),t.transform&&Ks.applyTransform(t.transform);return Qs.width=e,Qs.height=r,!Ks.intersect(Qs)}(this,t,e)||n&&!n[0]&&!n[3])return!1;if(r&&this.__clipPaths)for(var a=0;a<this.__clipPaths.length;++a)if(this.__clipPaths[a].isZeroArea())return!1;if(i&&this.parent)for(var o=this.parent;o;){if(o.ignore)return!1;o=o.parent}return!0},e.prototype.contain=function(t,e){return this.rectContain(t,e)},e.prototype.traverse=function(t,e){t.call(e,this)},e.prototype.rectContain=function(t,e){var r=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(r[0],r[1])},e.prototype.getPaintRect=function(){var t=this._paintRect;if(!this._paintRect||this.__dirty){var e=this.transform,r=this.getBoundingRect(),i=this.style,n=i.shadowBlur||0,a=i.shadowOffsetX||0,o=i.shadowOffsetY||0;t=this._paintRect||(this._paintRect=new Ho(0,0,0,0)),e?Ho.applyTransform(t,r,e):t.copy(r),(n||a||o)&&(t.width+=2*n+Math.abs(a),t.height+=2*n+Math.abs(o),t.x=Math.min(t.x,t.x+a-n),t.y=Math.min(t.y,t.y+o-n));var s=this.dirtyRectTolerance;t.isZero()||(t.x=Math.floor(t.x-s),t.y=Math.floor(t.y-s),t.width=Math.ceil(t.width+1+2*s),t.height=Math.ceil(t.height+1+2*s))}return t},e.prototype.setPrevPaintRect=function(t){t?(this._prevPaintRect=this._prevPaintRect||new Ho(0,0,0,0),this._prevPaintRect.copy(t)):this._prevPaintRect=null},e.prototype.getPrevPaintRect=function(){return this._prevPaintRect},e.prototype.animateStyle=function(t){return this.animate("style",t)},e.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():this.markRedraw()},e.prototype.attrKV=function(e,r){"style"!==e?t.prototype.attrKV.call(this,e,r):this.style?this.setStyle(r):this.useStyle(r)},e.prototype.setStyle=function(t,e){return"string"==typeof t?this.style[t]=e:qn(this.style,t),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(){this.markRedraw(),this.__dirty|=e.STYLE_CHANGED_BIT,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(this.__dirty&e.STYLE_CHANGED_BIT)},e.prototype.styleUpdated=function(){this.__dirty&=~e.STYLE_CHANGED_BIT},e.prototype.createStyle=function(t){return Ta(js,t)},e.prototype.useStyle=function(t){t[Xs]||(t=this.createStyle(t)),this.__inHover?this.__hoverStyle=t:this.style=t,this.dirtyStyle()},e.prototype.isStyleObject=function(t){return t[Xs]},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var r=this._normalState;e.style&&!r.style&&(r.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(e,r,Zs)},e.prototype._applyStateObj=function(e,r,i,n,a,o){t.prototype._applyStateObj.call(this,e,r,i,n,a,o);var s,l=!(r&&n);if(r&&r.style?a?n?s=r.style:(s=this._mergeStyle(this.createStyle(),i.style),this._mergeStyle(s,r.style)):(s=this._mergeStyle(this.createStyle(),n?this.style:i.style),this._mergeStyle(s,r.style)):l&&(s=i.style),s)if(a){var h=this.style;if(this.style=this.createStyle(l?{}:h),l)for(var u=ra(h),c=0;c<u.length;c++){(f=u[c])in s&&(s[f]=s[f],this.style[f]=h[f])}var d=ra(s);for(c=0;c<d.length;c++){var f=d[c];this.style[f]=this.style[f]}this._transitionState(e,{style:s},o,this.getAnimationStyleProps())}else this.useStyle(s);for(c=0;c<Zs.length;c++){f=Zs[c];r&&null!=r[f]?this[f]=r[f]:l&&null!=i[f]&&(this[f]=i[f])}},e.prototype._mergeStates=function(e){for(var r,i=t.prototype._mergeStates.call(this,e),n=0;n<e.length;n++){var a=e[n];a.style&&(r=r||{},this._mergeStyle(r,a.style))}return r&&(i.style=r),i},e.prototype._mergeStyle=function(t,e){return qn(t,e),t},e.prototype.getAnimationStyleProps=function(){return qs},e.STYLE_CHANGED_BIT=2,e.initDefaultProps=((r=e.prototype).type="displayable",r.invisible=!1,r.z=0,r.z2=0,r.zlevel=0,r.culling=!1,r.cursor="pointer",r.rectHover=!1,r.incremental=!1,r._rect=null,r.dirtyRectTolerance=0,void(r.__dirty=Ws.REDARAW_BIT|e.STYLE_CHANGED_BIT)),e}(Ws),Ks=new Ho(0,0,0,0),Qs=new Ho(0,0,0,0);var Js=Ys,$s=Math.pow,tl=Math.sqrt,el=1e-8,rl=1e-4,il=tl(3),nl=1/3,al=us(),ol=us(),sl=us();function ll(t){return t>-el&&t<el}function hl(t){return t>el||t<-el}function ul(t,e,r,i,n){var a=1-n;return a*a*(a*t+3*n*e)+n*n*(n*i+3*a*r)}function cl(t,e,r,i,n){var a=1-n;return 3*(((e-t)*a+2*(r-e)*n)*a+(i-r)*n*n)}function dl(t,e,r,i,n){var a=6*r-12*e+6*t,o=9*e+3*i-3*t-9*r,s=3*e-3*t,l=0;if(ll(o)){if(hl(a))(u=-s/a)>=0&&u<=1&&(n[l++]=u)}else{var h=a*a-4*o*s;if(ll(h))n[0]=-a/(2*o);else if(h>0){var u,c=tl(h),d=(-a-c)/(2*o);(u=(-a+c)/(2*o))>=0&&u<=1&&(n[l++]=u),d>=0&&d<=1&&(n[l++]=d)}}return l}function fl(t,e,r,i,n,a){var o=(e-t)*n+t,s=(r-e)*n+e,l=(i-r)*n+r,h=(s-o)*n+o,u=(l-s)*n+s,c=(u-h)*n+h;a[0]=t,a[1]=o,a[2]=h,a[3]=c,a[4]=c,a[5]=u,a[6]=l,a[7]=i}function pl(t,e,r,i,n,a,o,s,l){for(var h=t,u=e,c=0,d=1/l,f=1;f<=l;f++){var p=f*d,m=ul(t,r,n,o,p),g=ul(e,i,a,s,p),_=m-h,v=g-u;c+=Math.sqrt(_*_+v*v),h=m,u=g}return c}function ml(t,e,r,i){var n=1-i;return n*(n*t+2*i*e)+i*i*r}function gl(t,e,r,i){return 2*((1-i)*(e-t)+i*(r-e))}function _l(t,e,r){var i=t+r-2*e;return 0===i?.5:(t-e)/i}function vl(t,e,r,i,n){var a=(e-t)*i+t,o=(r-e)*i+e,s=(o-a)*i+a;n[0]=t,n[1]=a,n[2]=s,n[3]=s,n[4]=o,n[5]=r}function yl(t,e,r,i,n,a,o){for(var s=t,l=e,h=0,u=1/o,c=1;c<=o;c++){var d=c*u,f=ml(t,r,n,d),p=ml(e,i,a,d),m=f-s,g=p-l;h+=Math.sqrt(m*m+g*g),s=f,l=p}return h}var xl=Math.min,Tl=Math.max,bl=Math.sin,wl=Math.cos,Sl=2*Math.PI,El=us(),Al=us(),Ml=us();function Cl(t,e,r,i,n,a){n[0]=xl(t,r),n[1]=xl(e,i),a[0]=Tl(t,r),a[1]=Tl(e,i)}var Dl=[],Ll=[];function Pl(t,e,r,i,n,a,o,s,l,h){var u=dl,c=ul,d=u(t,r,n,o,Dl);l[0]=1/0,l[1]=1/0,h[0]=-1/0,h[1]=-1/0;for(var f=0;f<d;f++){var p=c(t,r,n,o,Dl[f]);l[0]=xl(p,l[0]),h[0]=Tl(p,h[0])}d=u(e,i,a,s,Ll);for(f=0;f<d;f++){var m=c(e,i,a,s,Ll[f]);l[1]=xl(m,l[1]),h[1]=Tl(m,h[1])}l[0]=xl(t,l[0]),h[0]=Tl(t,h[0]),l[0]=xl(o,l[0]),h[0]=Tl(o,h[0]),l[1]=xl(e,l[1]),h[1]=Tl(e,h[1]),l[1]=xl(s,l[1]),h[1]=Tl(s,h[1])}function Nl(t,e,r,i,n,a,o,s){var l=_l,h=ml,u=Tl(xl(l(t,r,n),1),0),c=Tl(xl(l(e,i,a),1),0),d=h(t,r,n,u),f=h(e,i,a,c);o[0]=xl(t,n,d),o[1]=xl(e,a,f),s[0]=Tl(t,n,d),s[1]=Tl(e,a,f)}function Rl(t,e,r,i,n,a,o,s,l){var h=xs,u=Ts,c=Math.abs(n-a);if(c%Sl<1e-4&&c>1e-4)return s[0]=t-r,s[1]=e-i,l[0]=t+r,void(l[1]=e+i);if(El[0]=wl(n)*r+t,El[1]=bl(n)*i+e,Al[0]=wl(a)*r+t,Al[1]=bl(a)*i+e,h(s,El,Al),u(l,El,Al),(n%=Sl)<0&&(n+=Sl),(a%=Sl)<0&&(a+=Sl),n>a&&!o?a+=Sl:n<a&&o&&(n+=Sl),o){var d=a;a=n,n=d}for(var f=0;f<a;f+=Math.PI/2)f>n&&(Ml[0]=wl(f)*r+t,Ml[1]=bl(f)*i+e,h(s,Ml,s),u(l,Ml,l))}var Il={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Ol=[],Bl=[],Fl=[],zl=[],Ul=[],kl=[],Gl=Math.min,Hl=Math.max,Vl=Math.cos,Wl=Math.sin,Xl=Math.sqrt,jl=Math.abs,ql=Math.PI,Zl=2*ql,Yl="undefined"!=typeof Float32Array,Kl=[];function Ql(t){return Math.round(t/ql*1e8)/1e8%2*ql}function Jl(t,e){var r=Ql(t[0]);r<0&&(r+=Zl);var i=r-t[0],n=t[1];n+=i,!e&&n-r>=Zl?n=r+Zl:e&&r-n>=Zl?n=r-Zl:!e&&r>n?n=r+(Zl-Ql(r-n)):e&&r<n&&(n=r-(Zl-Ql(n-r))),t[0]=r,t[1]=n}var $l=function(){function t(t){this.dpr=1,this._version=0,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=jl(r/Ns/t)||0,this._uy=jl(r/Ns/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._lineDash&&(this._lineDash=null,this._dashOffset=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this.addData(Il.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=jl(t-this._xi)>this._ux||jl(e-this._yi)>this._uy||this._len<5;return this.addData(Il.L,t,e),this._ctx&&r&&(this._needsDash?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),r&&(this._xi=t,this._yi=e),this},t.prototype.bezierCurveTo=function(t,e,r,i,n,a){return this.addData(Il.C,t,e,r,i,n,a),this._ctx&&(this._needsDash?this._dashedBezierTo(t,e,r,i,n,a):this._ctx.bezierCurveTo(t,e,r,i,n,a)),this._xi=n,this._yi=a,this},t.prototype.quadraticCurveTo=function(t,e,r,i){return this.addData(Il.Q,t,e,r,i),this._ctx&&(this._needsDash?this._dashedQuadraticTo(t,e,r,i):this._ctx.quadraticCurveTo(t,e,r,i)),this._xi=r,this._yi=i,this},t.prototype.arc=function(t,e,r,i,n,a){Kl[0]=i,Kl[1]=n,Jl(Kl,a),i=Kl[0];var o=(n=Kl[1])-i;return this.addData(Il.A,t,e,r,r,i,o,0,a?0:1),this._ctx&&this._ctx.arc(t,e,r,i,n,a),this._xi=Vl(n)*r+t,this._yi=Wl(n)*r+e,this},t.prototype.arcTo=function(t,e,r,i,n){return this._ctx&&this._ctx.arcTo(t,e,r,i,n),this},t.prototype.rect=function(t,e,r,i){return this._ctx&&this._ctx.rect(t,e,r,i),this.addData(Il.R,t,e,r,i),this},t.prototype.closePath=function(){this.addData(Il.Z);var t=this._ctx,e=this._x0,r=this._y0;return t&&(this._needsDash&&this._dashedLineTo(e,r),t.closePath()),this._xi=e,this._yi=r,this},t.prototype.fill=function(t){t&&t.fill(),this.toStatic()},t.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},t.prototype.setLineDash=function(t){if(t instanceof Array){this._lineDash=t,this._dashIdx=0;for(var e=0,r=0;r<t.length;r++)e+=t[r];this._dashSum=e,this._needsDash=!0}else this._lineDash=null,this._needsDash=!1;return this},t.prototype.setLineDashOffset=function(t){return this._dashOffset=t,this},t.prototype.len=function(){return this._len},t.prototype.setData=function(t){var e=t.length;this.data&&this.data.length===e||!Yl||(this.data=new Float32Array(e));for(var r=0;r<e;r++)this.data[r]=t[r];this._len=e},t.prototype.appendPath=function(t){t instanceof Array||(t=[t]);for(var e=t.length,r=0,i=this._len,n=0;n<e;n++)r+=t[n].len();Yl&&this.data instanceof Float32Array&&(this.data=new Float32Array(i+r));for(n=0;n<e;n++)for(var a=t[n].data,o=0;o<a.length;o++)this.data[i++]=a[o];this._len=i},t.prototype.addData=function(t,e,r,i,n,a,o,s,l){if(this._saveData){var h=this.data;this._len+arguments.length>h.length&&(this._expandData(),h=this.data);for(var u=0;u<arguments.length;u++)h[this._len++]=arguments[u]}},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e<this._len;e++)t[e]=this.data[e];this.data=t}},t.prototype._dashedLineTo=function(t,e){var r,i,n=this._dashSum,a=this._lineDash,o=this._ctx,s=this._dashOffset,l=this._xi,h=this._yi,u=t-l,c=e-h,d=Xl(u*u+c*c),f=l,p=h,m=a.length;for(u/=d,c/=d,s<0&&(s=n+s),f-=(s%=n)*u,p-=s*c;u>0&&f<=t||u<0&&f>=t||0===u&&(c>0&&p<=e||c<0&&p>=e);)f+=u*(r=a[i=this._dashIdx]),p+=c*r,this._dashIdx=(i+1)%m,u>0&&f<l||u<0&&f>l||c>0&&p<h||c<0&&p>h||o[i%2?"moveTo":"lineTo"](u>=0?Gl(f,t):Hl(f,t),c>=0?Gl(p,e):Hl(p,e));u=f-t,c=p-e,this._dashOffset=-Xl(u*u+c*c)},t.prototype._dashedBezierTo=function(t,e,r,i,n,a){var o,s,l,h,u,c=this._ctx,d=this._dashSum,f=this._dashOffset,p=this._lineDash,m=this._xi,g=this._yi,_=0,v=this._dashIdx,y=p.length,x=0;for(f<0&&(f=d+f),f%=d,o=0;o<1;o+=.1)s=ul(m,t,r,n,o+.1)-ul(m,t,r,n,o),l=ul(g,e,i,a,o+.1)-ul(g,e,i,a,o),_+=Xl(s*s+l*l);for(;v<y&&!((x+=p[v])>f);v++);for(o=(x-f)/_;o<=1;)h=ul(m,t,r,n,o),u=ul(g,e,i,a,o),v%2?c.moveTo(h,u):c.lineTo(h,u),o+=p[v]/_,v=(v+1)%y;v%2!=0&&c.lineTo(n,a),s=n-h,l=a-u,this._dashOffset=-Xl(s*s+l*l)},t.prototype._dashedQuadraticTo=function(t,e,r,i){var n=r,a=i;r=(r+2*t)/3,i=(i+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,r,i,n,a)},t.prototype.toStatic=function(){if(this._saveData){var t=this.data;t instanceof Array&&(t.length=this._len,Yl&&this._len>11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){Fl[0]=Fl[1]=Ul[0]=Ul[1]=Number.MAX_VALUE,zl[0]=zl[1]=kl[0]=kl[1]=-Number.MAX_VALUE;var t,e=this.data,r=0,i=0,n=0,a=0;for(t=0;t<this._len;){var o=e[t++],s=1===t;switch(s&&(n=r=e[t],a=i=e[t+1]),o){case Il.M:r=n=e[t++],i=a=e[t++],Ul[0]=n,Ul[1]=a,kl[0]=n,kl[1]=a;break;case Il.L:Cl(r,i,e[t],e[t+1],Ul,kl),r=e[t++],i=e[t++];break;case Il.C:Pl(r,i,e[t++],e[t++],e[t++],e[t++],e[t],e[t+1],Ul,kl),r=e[t++],i=e[t++];break;case Il.Q:Nl(r,i,e[t++],e[t++],e[t],e[t+1],Ul,kl),r=e[t++],i=e[t++];break;case Il.A:var l=e[t++],h=e[t++],u=e[t++],c=e[t++],d=e[t++],f=e[t++]+d;t+=1;var p=!e[t++];s&&(n=Vl(d)*u+l,a=Wl(d)*c+h),Rl(l,h,u,c,d,f,p,Ul,kl),r=Vl(f)*u+l,i=Wl(f)*c+h;break;case Il.R:Cl(n=r=e[t++],a=i=e[t++],n+e[t++],a+e[t++],Ul,kl);break;case Il.Z:r=n,i=a}xs(Fl,Fl,Ul),Ts(zl,zl,kl)}return 0===t&&(Fl[0]=Fl[1]=zl[0]=zl[1]=0),new Ho(Fl[0],Fl[1],zl[0]-Fl[0],zl[1]-Fl[1])},t.prototype._calculateLength=function(){var t=this.data,e=this._len,r=this._ux,i=this._uy,n=0,a=0,o=0,s=0;this._pathSegLen||(this._pathSegLen=[]);for(var l=this._pathSegLen,h=0,u=0,c=0;c<e;){var d=t[c++],f=1===c;f&&(o=n=t[c],s=a=t[c+1]);var p=-1;switch(d){case Il.M:n=o=t[c++],a=s=t[c++];break;case Il.L:var m=t[c++],g=(y=t[c++])-a;(jl(D=m-n)>r||jl(g)>i||c===e-1)&&(p=Math.sqrt(D*D+g*g),n=m,a=y);break;case Il.C:var _=t[c++],v=t[c++],y=(m=t[c++],t[c++]),x=t[c++],T=t[c++];p=pl(n,a,_,v,m,y,x,T,10),n=x,a=T;break;case Il.Q:p=yl(n,a,_=t[c++],v=t[c++],m=t[c++],y=t[c++],10),n=m,a=y;break;case Il.A:var b=t[c++],w=t[c++],S=t[c++],E=t[c++],A=t[c++],M=t[c++],C=M+A;c+=1;t[c++];f&&(o=Vl(A)*S+b,s=Wl(A)*E+w),p=Hl(S,E)*Gl(Zl,Math.abs(M)),n=Vl(C)*S+b,a=Wl(C)*E+w;break;case Il.R:o=n=t[c++],s=a=t[c++],p=2*t[c++]+2*t[c++];break;case Il.Z:var D=o-n;g=s-a;p=Math.sqrt(D*D+g*g),n=o,a=s}p>=0&&(l[u++]=p,h+=p)}return this._pathLen=h,h},t.prototype.rebuildPath=function(t,e){var r,i,n,a,o,s,l,h,u=this.data,c=this._ux,d=this._uy,f=this._len,p=e<1,m=0,g=0;if(!p||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,h=e*this._pathLen))t:for(var _=0;_<f;){var v=u[_++],y=1===_;switch(y&&(r=n=u[_],i=a=u[_+1]),v){case Il.M:r=n=u[_++],i=a=u[_++],t.moveTo(n,a);break;case Il.L:if(o=u[_++],s=u[_++],jl(o-n)>c||jl(s-a)>d||_===f-1){if(p){if(m+(H=l[g++])>h){var x=(h-m)/H;t.lineTo(n*(1-x)+o*x,a*(1-x)+s*x);break t}m+=H}t.lineTo(o,s),n=o,a=s}break;case Il.C:var T=u[_++],b=u[_++],w=u[_++],S=u[_++],E=u[_++],A=u[_++];if(p){if(m+(H=l[g++])>h){fl(n,T,w,E,x=(h-m)/H,Ol),fl(a,b,S,A,x,Bl),t.bezierCurveTo(Ol[1],Bl[1],Ol[2],Bl[2],Ol[3],Bl[3]);break t}m+=H}t.bezierCurveTo(T,b,w,S,E,A),n=E,a=A;break;case Il.Q:T=u[_++],b=u[_++],w=u[_++],S=u[_++];if(p){if(m+(H=l[g++])>h){vl(n,T,w,x=(h-m)/H,Ol),vl(a,b,S,x,Bl),t.quadraticCurveTo(Ol[1],Bl[1],Ol[2],Bl[2]);break t}m+=H}t.quadraticCurveTo(T,b,w,S),n=w,a=S;break;case Il.A:var M=u[_++],C=u[_++],D=u[_++],L=u[_++],P=u[_++],N=u[_++],R=u[_++],I=!u[_++],O=D>L?D:L,B=jl(D-L)>.001,F=P+N,z=!1;if(p)m+(H=l[g++])>h&&(F=P+N*(h-m)/H,z=!0),m+=H;if(B&&t.ellipse?t.ellipse(M,C,D,L,R,P,F,I):t.arc(M,C,O,P,F,I),z)break t;y&&(r=Vl(P)*D+M,i=Wl(P)*L+C),n=Vl(F)*D+M,a=Wl(F)*L+C;break;case Il.R:r=n=u[_],i=a=u[_+1],o=u[_++],s=u[_++];var U=u[_++],k=u[_++];if(p){if(m+(H=l[g++])>h){var G=h-m;t.moveTo(o,s),t.lineTo(o+Gl(G,U),s),(G-=U)>0&&t.lineTo(o+U,s+Gl(G,k)),(G-=k)>0&&t.lineTo(o+Hl(U-G,0),s+k),(G-=U)>0&&t.lineTo(o,s+Hl(k-G,0));break t}m+=H}t.rect(o,s,U,k);break;case Il.Z:if(p){var H;if(m+(H=l[g++])>h){x=(h-m)/H;t.lineTo(n*(1-x)+r*x,a*(1-x)+i*x);break t}m+=H}t.closePath(),n=r,a=i}}},t.CMD=Il,t.initDefaultProps=((e=t.prototype)._saveData=!0,e._needsDash=!1,e._dashOffset=0,e._dashIdx=0,e._dashSum=0,e._ux=0,void(e._uy=0)),t}();function th(t,e,r,i,n,a,o){if(0===n)return!1;var s=n,l=0;if(o>e+s&&o>i+s||o<e-s&&o<i-s||a>t+s&&a>r+s||a<t-s&&a<r-s)return!1;if(t===r)return Math.abs(a-t)<=s/2;var h=(l=(e-i)/(t-r))*a-o+(t*i-r*e)/(t-r);return h*h/(l*l+1)<=s/2*s/2}function eh(t,e,r,i,n,a,o,s,l,h,u){if(0===l)return!1;var c=l;return!(u>e+c&&u>i+c&&u>a+c&&u>s+c||u<e-c&&u<i-c&&u<a-c&&u<s-c||h>t+c&&h>r+c&&h>n+c&&h>o+c||h<t-c&&h<r-c&&h<n-c&&h<o-c)&&function(t,e,r,i,n,a,o,s,l,h,u){var c,d,f,p,m,g=.005,_=1/0;al[0]=l,al[1]=h;for(var v=0;v<1;v+=.05)ol[0]=ul(t,r,n,o,v),ol[1]=ul(e,i,a,s,v),(p=vs(al,ol))<_&&(c=v,_=p);_=1/0;for(var y=0;y<32&&!(g<rl);y++)d=c-g,f=c+g,ol[0]=ul(t,r,n,o,d),ol[1]=ul(e,i,a,s,d),p=vs(ol,al),d>=0&&p<_?(c=d,_=p):(sl[0]=ul(t,r,n,o,f),sl[1]=ul(e,i,a,s,f),m=vs(sl,al),f<=1&&m<_?(c=f,_=m):g*=.5);return u&&(u[0]=ul(t,r,n,o,c),u[1]=ul(e,i,a,s,c)),tl(_)}(t,e,r,i,n,a,o,s,h,u,null)<=c/2}function rh(t,e,r,i,n,a,o,s,l){if(0===o)return!1;var h=o;return!(l>e+h&&l>i+h&&l>a+h||l<e-h&&l<i-h&&l<a-h||s>t+h&&s>r+h&&s>n+h||s<t-h&&s<r-h&&s<n-h)&&function(t,e,r,i,n,a,o,s,l){var h,u=.005,c=1/0;al[0]=o,al[1]=s;for(var d=0;d<1;d+=.05)ol[0]=ml(t,r,n,d),ol[1]=ml(e,i,a,d),(g=vs(al,ol))<c&&(h=d,c=g);c=1/0;for(var f=0;f<32&&!(u<rl);f++){var p=h-u,m=h+u;ol[0]=ml(t,r,n,p),ol[1]=ml(e,i,a,p);var g=vs(ol,al);if(p>=0&&g<c)h=p,c=g;else{sl[0]=ml(t,r,n,m),sl[1]=ml(e,i,a,m);var _=vs(sl,al);m<=1&&_<c?(h=m,c=_):u*=.5}}return l&&(l[0]=ml(t,r,n,h),l[1]=ml(e,i,a,h)),tl(c)}(t,e,r,i,n,a,s,l,null)<=h/2}var ih=2*Math.PI;function nh(t){return(t%=ih)<0&&(t+=ih),t}var ah=2*Math.PI;function oh(t,e,r,i,n,a,o,s,l){if(0===o)return!1;var h=o;s-=t,l-=e;var u=Math.sqrt(s*s+l*l);if(u-h>r||u+h<r)return!1;if(Math.abs(i-n)%ah<1e-4)return!0;if(a){var c=i;i=nh(n),n=nh(c)}else i=nh(i),n=nh(n);i>n&&(n+=ah);var d=Math.atan2(l,s);return d<0&&(d+=ah),d>=i&&d<=n||d+ah>=i&&d+ah<=n}function sh(t,e,r,i,n,a){if(a>e&&a>i||a<e&&a<i)return 0;if(i===e)return 0;var o=(a-e)/(i-e),s=i<e?1:-1;1!==o&&0!==o||(s=i<e?.5:-.5);var l=o*(r-t)+t;return l===n?1/0:l>n?s:0}var lh=$l.CMD,hh=2*Math.PI,uh=1e-4;var ch=[-1,-1,-1],dh=[-1,-1];function fh(t,e,r,i,n,a,o,s,l,h){if(h>e&&h>i&&h>a&&h>s||h<e&&h<i&&h<a&&h<s)return 0;var u,c=function(t,e,r,i,n,a){var o=i+3*(e-r)-t,s=3*(r-2*e+t),l=3*(e-t),h=t-n,u=s*s-3*o*l,c=s*l-9*o*h,d=l*l-3*s*h,f=0;if(ll(u)&&ll(c))ll(s)?a[0]=0:(S=-l/s)>=0&&S<=1&&(a[f++]=S);else{var p=c*c-4*u*d;if(ll(p)){var m=c/u,g=-m/2;(S=-s/o+m)>=0&&S<=1&&(a[f++]=S),g>=0&&g<=1&&(a[f++]=g)}else if(p>0){var _=tl(p),v=u*s+1.5*o*(-c+_),y=u*s+1.5*o*(-c-_);(S=(-s-((v=v<0?-$s(-v,nl):$s(v,nl))+(y=y<0?-$s(-y,nl):$s(y,nl))))/(3*o))>=0&&S<=1&&(a[f++]=S)}else{var x=(2*u*s-3*o*c)/(2*tl(u*u*u)),T=Math.acos(x)/3,b=tl(u),w=Math.cos(T),S=(-s-2*b*w)/(3*o),E=(g=(-s+b*(w+il*Math.sin(T)))/(3*o),(-s+b*(w-il*Math.sin(T)))/(3*o));S>=0&&S<=1&&(a[f++]=S),g>=0&&g<=1&&(a[f++]=g),E>=0&&E<=1&&(a[f++]=E)}}return f}(e,i,a,s,h,ch);if(0===c)return 0;for(var d=0,f=-1,p=void 0,m=void 0,g=0;g<c;g++){var _=ch[g],v=0===_||1===_?.5:1;ul(t,r,n,o,_)<l||(f<0&&(f=dl(e,i,a,s,dh),dh[1]<dh[0]&&f>1&&(void 0,u=dh[0],dh[0]=dh[1],dh[1]=u),p=ul(e,i,a,s,dh[0]),f>1&&(m=ul(e,i,a,s,dh[1]))),2===f?_<dh[0]?d+=p<e?v:-v:_<dh[1]?d+=m<p?v:-v:d+=s<m?v:-v:_<dh[0]?d+=p<e?v:-v:d+=s<p?v:-v)}return d}function ph(t,e,r,i,n,a,o,s){if(s>e&&s>i&&s>a||s<e&&s<i&&s<a)return 0;var l=function(t,e,r,i,n){var a=t-2*e+r,o=2*(e-t),s=t-i,l=0;if(ll(a))hl(o)&&(u=-s/o)>=0&&u<=1&&(n[l++]=u);else{var h=o*o-4*a*s;if(ll(h))(u=-o/(2*a))>=0&&u<=1&&(n[l++]=u);else if(h>0){var u,c=tl(h),d=(-o-c)/(2*a);(u=(-o+c)/(2*a))>=0&&u<=1&&(n[l++]=u),d>=0&&d<=1&&(n[l++]=d)}}return l}(e,i,a,s,ch);if(0===l)return 0;var h=_l(e,i,a);if(h>=0&&h<=1){for(var u=0,c=ml(e,i,a,h),d=0;d<l;d++){var f=0===ch[d]||1===ch[d]?.5:1;ml(t,r,n,ch[d])<o||(ch[d]<h?u+=c<e?f:-f:u+=a<c?f:-f)}return u}f=0===ch[0]||1===ch[0]?.5:1;return ml(t,r,n,ch[0])<o?0:a<e?f:-f}function mh(t,e,r,i,n,a,o,s){if((s-=e)>r||s<-r)return 0;var l=Math.sqrt(r*r-s*s);ch[0]=-l,ch[1]=l;var h=Math.abs(i-n);if(h<1e-4)return 0;if(h>=hh-1e-4){i=0,n=hh;var u=a?1:-1;return o>=ch[0]+t&&o<=ch[1]+t?u:0}if(i>n){var c=i;i=n,n=c}i<0&&(i+=hh,n+=hh);for(var d=0,f=0;f<2;f++){var p=ch[f];if(p+t>o){var m=Math.atan2(s,p);u=a?1:-1;m<0&&(m=hh+m),(m>=i&&m<=n||m+hh>=i&&m+hh<=n)&&(m>Math.PI/2&&m<1.5*Math.PI&&(u=-u),d+=u)}}return d}function gh(t,e,r,i,n){for(var a,o,s,l,h=t.data,u=t.len(),c=0,d=0,f=0,p=0,m=0,g=0;g<u;){var _=h[g++],v=1===g;switch(_===lh.M&&g>1&&(r||(c+=sh(d,f,p,m,i,n))),v&&(p=d=h[g],m=f=h[g+1]),_){case lh.M:d=p=h[g++],f=m=h[g++];break;case lh.L:if(r){if(th(d,f,h[g],h[g+1],e,i,n))return!0}else c+=sh(d,f,h[g],h[g+1],i,n)||0;d=h[g++],f=h[g++];break;case lh.C:if(r){if(eh(d,f,h[g++],h[g++],h[g++],h[g++],h[g],h[g+1],e,i,n))return!0}else c+=fh(d,f,h[g++],h[g++],h[g++],h[g++],h[g],h[g+1],i,n)||0;d=h[g++],f=h[g++];break;case lh.Q:if(r){if(rh(d,f,h[g++],h[g++],h[g],h[g+1],e,i,n))return!0}else c+=ph(d,f,h[g++],h[g++],h[g],h[g+1],i,n)||0;d=h[g++],f=h[g++];break;case lh.A:var y=h[g++],x=h[g++],T=h[g++],b=h[g++],w=h[g++],S=h[g++];g+=1;var E=!!(1-h[g++]);a=Math.cos(w)*T+y,o=Math.sin(w)*b+x,v?(p=a,m=o):c+=sh(d,f,a,o,i,n);var A=(i-y)*b/T+y;if(r){if(oh(y,x,b,w,w+S,E,e,A,n))return!0}else c+=mh(y,x,b,w,w+S,E,A,n);d=Math.cos(w+S)*T+y,f=Math.sin(w+S)*b+x;break;case lh.R:if(p=d=h[g++],m=f=h[g++],a=p+h[g++],o=m+h[g++],r){if(th(p,m,a,m,e,i,n)||th(a,m,a,o,e,i,n)||th(a,o,p,o,e,i,n)||th(p,o,p,m,e,i,n))return!0}else c+=sh(a,m,a,o,i,n),c+=sh(p,o,p,m,i,n);break;case lh.Z:if(r){if(th(d,f,p,m,e,i,n))return!0}else c+=sh(d,f,p,m,i,n);d=p,f=m}}return r||(s=f,l=m,Math.abs(s-l)<uh)||(c+=sh(d,f,p,m,i,n)||0),0!==c}var _h=Zn({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},js),vh={style:Zn({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},qs.style)},yh=["x","y","rotation","scaleX","scaleY","originX","originY","invisible","culling","z","z2","zlevel","parent"],xh=function(t){function e(e){return t.call(this,e)||this}var r;return bo(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 a=n.style;for(var o in i)a[o]!==i[o]&&(a[o]=i[o]);a.fill=i.fill?i.decal:null,a.decal=null,a.shadowColor=null,i.strokeFirst&&(a.stroke=null);for(var s=0;s<yh.length;++s)n[yh[s]]=this[yh[s]];n.__dirty|=Ws.REDARAW_BIT}else this._decalEl&&(this._decalEl=null)},e.prototype.getDecalElement=function(){return this._decalEl},e.prototype._init=function(e){var r=ra(e);this.shape=this.getDefaultShape();var i=this.getDefaultStyle();i&&this.useStyle(i);for(var n=0;n<r.length;n++){var a=r[n],o=e[a];"style"===a?this.style?qn(this.style,o):this.useStyle(o):"shape"===a?qn(this.shape,o):t.prototype.attrKV.call(this,a,o)}this.style||this.useStyle({})},e.prototype.getDefaultStyle=function(){return null},e.prototype.getDefaultShape=function(){return{}},e.prototype.canBeInsideText=function(){return this.hasFill()},e.prototype.getInsideTextFill=function(){var t=this.style.fill;if("none"!==t){if(oa(t)){var e=Pn(t,0);return e>.5?"#333":e>.2?"#eee":"#ccc"}if(t)return"#ccc"}return"#333"},e.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(oa(e)){var r=this.__zr;if(!(!r||!r.isDarkMode())===Pn(t,0)<.4)return e}},e.prototype.buildPath=function(t,e,r){},e.prototype.pathUpdated=function(){this.__dirty&=~e.SHAPE_CHANGED_BIT},e.prototype.createPathProxy=function(){this.path=new $l(!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,r=this.style,i=!t;if(i){var n=!1;this.path||(n=!0,this.createPathProxy());var a=this.path;(n||this.__dirty&e.SHAPE_CHANGED_BIT)&&(a.beginPath(),this.buildPath(a,this.shape,!1),this.pathUpdated()),t=a.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectWithStroke||(this._rectWithStroke=t.clone());if(this.__dirty||i){o.copy(t);var s=r.strokeNoScale?this.getLineScale():1,l=r.lineWidth;if(!this.hasFill()){var h=this.strokeContainThreshold;l=Math.max(l,null==h?4:h)}s>1e-10&&(o.width+=l/s,o.height+=l/s,o.x-=l/s/2,o.y-=l/s/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 a=this.path;if(this.hasStroke()){var o=n.lineWidth,s=n.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),function(t,e,r,i){return gh(t,e,!0,r,i)}(a,o/s,t,e)))return!0}if(this.hasFill())return function(t,e,r){return gh(t,0,!1,e,r)}(a,t,e)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=e.SHAPE_CHANGED_BIT,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:qn(r,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&e.SHAPE_CHANGED_BIT)},e.prototype.createStyle=function(t){return Ta(_h,t)},e.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var r=this._normalState;e.shape&&!r.shape&&(r.shape=qn({},this.shape))},e.prototype._applyStateObj=function(e,r,i,n,a,o){t.prototype._applyStateObj.call(this,e,r,i,n,a,o);var s,l=!(r&&n);if(r&&r.shape?a?n?s=r.shape:qn(s=qn({},i.shape),r.shape):qn(s=qn({},n?this.shape:i.shape),r.shape):l&&(s=i.shape),s)if(a){this.shape=qn({},this.shape);for(var h={},u=ra(s),c=0;c<u.length;c++){var d=u[c];"object"==typeof s[d]?this.shape[d]=s[d]:h[d]=s[d]}this._transitionState(e,{shape:h},o)}else this.shape=s,this.dirtyShape()},e.prototype._mergeStates=function(e){for(var r,i=t.prototype._mergeStates.call(this,e),n=0;n<e.length;n++){var a=e[n];a.shape&&(r=r||{},this._mergeStyle(r,a.shape))}return r&&(i.shape=r),i},e.prototype.getAnimationStyleProps=function(){return vh},e.prototype.isZeroArea=function(){return!1},e.extend=function(t){var r=function(e){function r(r){var i=e.call(this,r)||this;return t.init&&t.init.call(i,r),i}return bo(r,e),r.prototype.getDefaultStyle=function(){return Xn(t.style)},r.prototype.getDefaultShape=function(){return Xn(t.shape)},r}(e);for(var i in t)"function"==typeof t[i]&&(r.prototype[i]=t[i]);return r},e.SHAPE_CHANGED_BIT=4,e.initDefaultProps=((r=e.prototype).type="path",r.strokeContainThreshold=5,r.segmentIgnoreThreshold=0,r.subPixelOptimize=!1,r.autoBatch=!1,void(r.__dirty=Ws.REDARAW_BIT|Js.STYLE_CHANGED_BIT|e.SHAPE_CHANGED_BIT)),e}(Js),Th=Zn({strokeFirst:!0,font:Wo,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},_h),bh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return bo(e,t),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.createStyle=function(t){return Ta(Th,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 qo(n[0],e,r,i);for(var a=new Ho(0,0,0,0),o=0;o<n.length;o++){var s=qo(n[o],e,r,i);0===o?a.copy(s):a.union(s)}return a}(e,t.font,t.textAlign,t.textBaseline);if(r.x+=t.x||0,r.y+=t.y||0,this.hasStroke()){var i=t.lineWidth;r.x-=i/2,r.y-=i/2,r.width+=i,r.height+=i}this._rect=r}return this._rect},e.initDefaultProps=void(e.prototype.dirtyRectTolerance=10),e}(Js);bh.prototype.type="tspan";var wh=bh,Sh=Zn({x:0,y:0},js),Eh={style:Zn({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},qs.style)};var Ah=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return bo(e,t),e.prototype.createStyle=function(t){return Ta(Sh,t)},e.prototype._getSize=function(t){var e=this.style,r=e[t];if(null!=r)return r;var i,n=(i=e.image)&&"string"!=typeof i&&i.width&&i.height?e.image:this.__image;if(!n)return 0;var a="width"===t?"height":"width",o=e[a];return null==o?n[t]:n[t]/n[a]*o},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return Eh},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new Ho(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(Js);Ah.prototype.type="image";var Mh=Ah;var Ch=Math.round;function Dh(t,e,r){if(e){var i=e.x1,n=e.x2,a=e.y1,o=e.y2;t.x1=i,t.x2=n,t.y1=a,t.y2=o;var s=r&&r.lineWidth;return s?(Ch(2*i)===Ch(2*n)&&(t.x1=t.x2=Ph(i,s,!0)),Ch(2*a)===Ch(2*o)&&(t.y1=t.y2=Ph(a,s,!0)),t):t}}function Lh(t,e,r){if(e){var i=e.x,n=e.y,a=e.width,o=e.height;t.x=i,t.y=n,t.width=a,t.height=o;var s=r&&r.lineWidth;return s?(t.x=Ph(i,s,!0),t.y=Ph(n,s,!0),t.width=Math.max(Ph(i+a,s,!1)-t.x,0===a?0:1),t.height=Math.max(Ph(n+o,s,!1)-t.y,0===o?0:1),t):t}}function Ph(t,e,r){if(!e)return t;var i=Ch(2*t);return(i+Ch(e))%2==0?i/2:(i+(r?1:-1))/2}var Nh=function(){return function(){this.x=0,this.y=0,this.width=0,this.height=0}}(),Rh={},Ih=function(t){function e(e){return t.call(this,e)||this}return bo(e,t),e.prototype.getDefaultShape=function(){return new Nh},e.prototype.buildPath=function(t,e){var r,i,n,a;if(this.subPixelOptimize){var o=Lh(Rh,e,this.style);r=o.x,i=o.y,n=o.width,a=o.height,o.r=e.r,e=o}else r=e.x,i=e.y,n=e.width,a=e.height;e.r?function(t,e){var r,i,n,a,o,s=e.x,l=e.y,h=e.width,u=e.height,c=e.r;h<0&&(s+=h,h=-h),u<0&&(l+=u,u=-u),"number"==typeof c?r=i=n=a=c:c instanceof Array?1===c.length?r=i=n=a=c[0]:2===c.length?(r=n=c[0],i=a=c[1]):3===c.length?(r=c[0],i=a=c[1],n=c[2]):(r=c[0],i=c[1],n=c[2],a=c[3]):r=i=n=a=0,r+i>h&&(r*=h/(o=r+i),i*=h/o),n+a>h&&(n*=h/(o=n+a),a*=h/o),i+n>u&&(i*=u/(o=i+n),n*=u/o),r+a>u&&(r*=u/(o=r+a),a*=u/o),t.moveTo(s+r,l),t.lineTo(s+h-i,l),0!==i&&t.arc(s+h-i,l+i,i,-Math.PI/2,0),t.lineTo(s+h,l+u-n),0!==n&&t.arc(s+h-n,l+u-n,n,0,Math.PI/2),t.lineTo(s+a,l+u),0!==a&&t.arc(s+a,l+u-a,a,Math.PI/2,Math.PI),t.lineTo(s,l+r),0!==r&&t.arc(s+r,l+r,r,Math.PI,1.5*Math.PI)}(t,e):t.rect(r,i,n,a)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(xh);Ih.prototype.type="rect";var Oh=Ih,Bh={fill:"#000"},Fh={style:Zn({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},qs.style)},zh=function(t){function e(e){var r=t.call(this)||this;return r.type="text",r._children=[],r._defaultStyle=Bh,r.attr(e),r}return bo(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){this.styleChanged()&&this._updateSubTexts();for(var e=0;e<this._children.length;e++){var r=this._children[e];r.zlevel=this.zlevel,r.z=this.z,r.z2=this.z2,r.culling=this.culling,r.cursor=this.cursor,r.invisible=this.invisible}var i=this.attachedTransform;if(i){i.updateTransform();var n=i.transform;n?(this.transform=this.transform||[],Mo(this.transform,n)):this.transform=null}else t.prototype.update.call(this)},e.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),this.attachedTransform?this.attachedTransform.getComputedTransform():t.prototype.getComputedTransform.call(this)},e.prototype._updateSubTexts=function(){var t;this._childCursor=0,Gh(t=this.style),$n(t.rich,Gh),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},e.prototype.addSelfToZr=function(e){t.prototype.addSelfToZr.call(this,e);for(var r=0;r<this._children.length;r++)this._children[r].__zr=e},e.prototype.removeSelfFromZr=function(e){t.prototype.removeSelfFromZr.call(this,e);for(var r=0;r<this._children.length;r++)this._children[r].__zr=null},e.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var t=new Ho(0,0,0,0),e=this._children,r=[],i=null,n=0;n<e.length;n++){var a=e[n],o=a.getBoundingRect(),s=a.getLocalTransform(r);s?(t.copy(o),t.applyTransform(s),(i=i||t.clone()).union(t)):(i=i||o.clone()).union(o)}this._rect=i||t}return this._rect},e.prototype.setDefaultTextStyle=function(t){this._defaultStyle=t||Bh},e.prototype.setTextContent=function(t){throw new Error("Can't attach text on another text")},e.prototype._mergeStyle=function(t,e){if(!e)return t;var r=e.rich,i=t.rich||r&&{};return qn(t,e),r&&i?(this._mergeRich(i,r),t.rich=i):i&&(t.rich=i),t},e.prototype._mergeRich=function(t,e){for(var r=ra(e),i=0;i<r.length;i++){var n=r[i];t[n]=t[n]||{},qn(t[n],e[n])}},e.prototype.getAnimationStyleProps=function(){return Fh},e.prototype._getOrCreateChild=function(t){var e=this._children[this._childCursor];return e&&e instanceof t||(e=new t),this._children[this._childCursor++]=e,e.__zr=this.__zr,e.parent=this,e},e.prototype._updatePlainTexts=function(){var t=this.style,e=t.font||Wo,r=t.padding,i=function(t,e){null!=t&&(t+="");var r,i=e.overflow,n=e.padding,a=e.font,o="truncate"===i,s=Ko(a),l=ua(e.lineHeight,s),h="truncate"===e.lineOverflow,u=e.width,c=(r=null!=u&&"break"===i||"breakAll"===i?t?hs(t,e.font,u,"breakAll"===i,0).lines:[]:t?t.split("\n"):[]).length*l,d=ua(e.height,c);if(c>d&&h){var f=Math.floor(d/l);r=r.slice(0,f)}var p=d,m=u;if(n&&(p+=n[0]+n[2],null!=m&&(m+=n[1]+n[3])),t&&o&&null!=m)for(var g=ts(u,a,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),_=0;_<r.length;_++)r[_]=es(r[_],g);if(null==u){var v=0;for(_=0;_<r.length;_++)v=Math.max(jo(r[_],a),v);u=v}return{lines:r,height:d,outerHeight:p,lineHeight:l,calculatedLineHeight:s,contentHeight:c,width:u}}(Wh(t),t),n=Xh(t),a=!!t.backgroundColor,o=i.outerHeight,s=i.lines,l=i.lineHeight,h=this._defaultStyle,u=t.x||0,c=t.y||0,d=t.align||h.align||"left",f=t.verticalAlign||h.verticalAlign||"top",p=u,m=Yo(c,i.contentHeight,f);if(n||r){var g=i.width;r&&(g+=r[1]+r[3]);var _=Zo(u,g,d),v=Yo(c,o,f);n&&this._renderBackground(t,t,_,v,g,o)}m+=l/2,r&&(p=Vh(u,d,r),"top"===f?m+=r[0]:"bottom"===f&&(m-=r[2]));for(var y,x=0,T=!1,b=(null==(y="fill"in t?t.fill:(T=!0,h.fill))||"none"===y?null:y.image||y.colorStops?"#000":y),w=(Hh("stroke"in t?t.stroke:a||h.autoStroke&&!T?null:(x=2,h.stroke))),S=t.textShadowBlur>0,E=null!=t.width&&("truncate"===t.overflow||"break"===t.overflow||"breakAll"===t.overflow),A=i.calculatedLineHeight,M=0;M<s.length;M++){var C=this._getOrCreateChild(wh),D=C.createStyle();C.useStyle(D),D.text=s[M],D.x=p,D.y=m,d&&(D.textAlign=d),D.textBaseline="middle",D.opacity=t.opacity,D.strokeFirst=!0,S&&(D.shadowBlur=t.textShadowBlur||0,D.shadowColor=t.textShadowColor||"transparent",D.shadowOffsetX=t.textShadowOffsetX||0,D.shadowOffsetY=t.textShadowOffsetY||0),w&&(D.stroke=w,D.lineWidth=t.lineWidth||x,D.lineDash=t.lineDash,D.lineDashOffset=t.lineDashOffset||0),b&&(D.fill=b),D.font=e,m+=l,E&&C.setBoundingRect(new Ho(Zo(D.x,t.width,D.textAlign),Yo(D.y,A,D.textBaseline),t.width,A))}},e.prototype._updateRichTexts=function(){var t=this.style,e=function(t,e){var r=new as;if(null!=t&&(t+=""),!t)return r;for(var i,n=e.width,a=e.height,o=e.overflow,s="break"!==o&&"breakAll"!==o||null==n?null:{width:n,accumWidth:0,breakAll:"breakAll"===o},l=Jo.lastIndex=0;null!=(i=Jo.exec(t));){var h=i.index;h>l&&os(r,t.substring(l,h),e,s),os(r,i[2],e,s,i[1]),l=Jo.lastIndex}l<t.length&&os(r,t.substring(l,t.length),e,s);var u=[],c=0,d=0,f=e.padding,p="truncate"===o,m="truncate"===e.lineOverflow;function g(t,e,r){t.width=e,t.lineHeight=r,c+=r,d=Math.max(d,e)}t:for(var _=0;_<r.lines.length;_++){for(var v=r.lines[_],y=0,x=0,T=0;T<v.tokens.length;T++){var b=(N=v.tokens[T]).styleName&&e.rich[N.styleName]||{},w=N.textPadding=b.padding,S=w?w[1]+w[3]:0,E=N.font=b.font||e.font;N.contentHeight=Ko(E);var A=ua(b.height,N.contentHeight);if(N.innerHeight=A,w&&(A+=w[0]+w[2]),N.height=A,N.lineHeight=ca(b.lineHeight,e.lineHeight,A),N.align=b&&b.align||e.align,N.verticalAlign=b&&b.verticalAlign||"middle",m&&null!=a&&c+N.lineHeight>a){T>0?(v.tokens=v.tokens.slice(0,T),g(v,x,y),r.lines=r.lines.slice(0,_+1)):r.lines=r.lines.slice(0,_);break t}var M=b.width,C=null==M||"auto"===M;if("string"==typeof M&&"%"===M.charAt(M.length-1))N.percentWidth=M,u.push(N),N.contentWidth=jo(N.text,E);else{if(C){var D=b.backgroundColor,L=D&&D.image;L&&Eo(L=So(L))&&(N.width=Math.max(N.width,L.width*A/L.height))}var P=p&&null!=n?n-x:null;null!=P&&P<N.width?!C||P<S?(N.text="",N.width=N.contentWidth=0):(N.text=$o(N.text,P-S,E,e.ellipsis,{minChar:e.truncateMinChar}),N.width=N.contentWidth=jo(N.text,E)):N.contentWidth=jo(N.text,E)}N.width+=S,x+=N.width,b&&(y=Math.max(y,N.lineHeight))}g(v,x,y)}for(r.outerWidth=r.width=ua(n,d),r.outerHeight=r.height=ua(a,c),r.contentHeight=c,r.contentWidth=d,f&&(r.outerWidth+=f[1]+f[3],r.outerHeight+=f[0]+f[2]),_=0;_<u.length;_++){var N,R=(N=u[_]).percentWidth;N.width=parseInt(R,10)/100*r.width}return r}(Wh(t),t),r=e.width,i=e.outerWidth,n=e.outerHeight,a=t.padding,o=t.x||0,s=t.y||0,l=this._defaultStyle,h=t.align||l.align,u=t.verticalAlign||l.verticalAlign,c=Zo(o,i,h),d=Yo(s,n,u),f=c,p=d;a&&(f+=a[3],p+=a[0]);var m=f+r;Xh(t)&&this._renderBackground(t,t,c,d,i,n);for(var g=!!t.backgroundColor,_=0;_<e.lines.length;_++){for(var v=e.lines[_],y=v.tokens,x=y.length,T=v.lineHeight,b=v.width,w=0,S=f,E=m,A=x-1,M=void 0;w<x&&(!(M=y[w]).align||"left"===M.align);)this._placeToken(M,t,T,p,S,"left",g),b-=M.width,S+=M.width,w++;for(;A>=0&&"right"===(M=y[A]).align;)this._placeToken(M,t,T,p,E,"right",g),b-=M.width,E-=M.width,A--;for(S+=(r-(S-f)-(m-E)-b)/2;w<=A;)M=y[w],this._placeToken(M,t,T,p,S+M.width/2,"center",g),S+=M.width,w++;p+=T}},e.prototype._placeToken=function(t,e,r,i,n,a,o){var s=e.rich[t.styleName]||{};s.text=t.text;var l=t.verticalAlign,h=i+r/2;"top"===l?h=i+t.height/2:"bottom"===l&&(h=i+r-t.height/2),!t.isLineHolder&&Xh(s)&&this._renderBackground(s,e,"right"===a?n-t.width:"center"===a?n-t.width/2:n,h-t.height/2,t.width,t.height);var u=!!s.backgroundColor,c=t.textPadding;c&&(n=Vh(n,a,c),h-=t.height/2-c[0]-t.innerHeight/2);var d=this._getOrCreateChild(wh),f=d.createStyle();d.useStyle(f);var p=this._defaultStyle,m=!1,g=0,_=Hh("fill"in s?s.fill:"fill"in e?e.fill:(m=!0,p.fill)),v=Hh("stroke"in s?s.stroke:"stroke"in e?e.stroke:u||o||p.autoStroke&&!m?null:(g=2,p.stroke)),y=s.textShadowBlur>0||e.textShadowBlur>0;f.text=t.text,f.x=n,f.y=h,y&&(f.shadowBlur=s.textShadowBlur||e.textShadowBlur||0,f.shadowColor=s.textShadowColor||e.textShadowColor||"transparent",f.shadowOffsetX=s.textShadowOffsetX||e.textShadowOffsetX||0,f.shadowOffsetY=s.textShadowOffsetY||e.textShadowOffsetY||0),f.textAlign=a,f.textBaseline="middle",f.font=t.font||Wo,f.opacity=ca(s.opacity,e.opacity,1),v&&(f.lineWidth=ca(s.lineWidth,e.lineWidth,g),f.lineDash=ua(s.lineDash,e.lineDash),f.lineDashOffset=e.lineDashOffset||0,f.stroke=v),_&&(f.fill=_);var x=t.contentWidth,T=t.contentHeight;d.setBoundingRect(new Ho(Zo(f.x,x,f.textAlign),Yo(f.y,T,f.textBaseline),x,T))},e.prototype._renderBackground=function(t,e,r,i,n,a){var o,s,l,h=t.backgroundColor,u=t.borderWidth,c=t.borderColor,d=oa(h),f=t.borderRadius,p=this;if(d||u&&c){(o=this._getOrCreateChild(Oh)).useStyle(o.createStyle()),o.style.fill=null;var m=o.shape;m.x=r,m.y=i,m.width=n,m.height=a,m.r=f,o.dirtyShape()}if(d)(l=o.style).fill=h||null,l.fillOpacity=ua(t.fillOpacity,1);else if(h&&h.image){(s=this._getOrCreateChild(Mh)).onload=function(){p.dirtyStyle()};var g=s.style;g.image=h.image,g.x=r,g.y=i,g.width=n,g.height=a}u&&c&&((l=o.style).lineWidth=u,l.stroke=c,l.strokeOpacity=ua(t.strokeOpacity,1),l.lineDash=t.borderDash,l.lineDashOffset=t.borderDashOffset||0,o.strokeContainThreshold=0,o.hasFill()&&o.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var _=(o||s).style;_.shadowBlur=t.shadowBlur||0,_.shadowColor=t.shadowColor||"transparent",_.shadowOffsetX=t.shadowOffsetX||0,_.shadowOffsetY=t.shadowOffsetY||0,_.opacity=ca(t.opacity,e.opacity,1)},e.makeFont=function(t){var e="";if(t.fontSize||t.fontFamily||t.fontWeight){var r="";r="string"!=typeof t.fontSize||-1===t.fontSize.indexOf("px")&&-1===t.fontSize.indexOf("rem")&&-1===t.fontSize.indexOf("em")?isNaN(+t.fontSize)?"12px":t.fontSize+"px":t.fontSize,e=[t.fontStyle,t.fontWeight,r,t.fontFamily||"sans-serif"].join(" ")}return e&&ma(e)||t.textFont||t.font},e}(Js),Uh={left:!0,right:1,center:1},kh={top:1,bottom:1,middle:1};function Gh(t){if(t){t.font=zh.makeFont(t);var e=t.align;"middle"===e&&(e="center"),t.align=null==e||Uh[e]?e:"left";var r=t.verticalAlign;"center"===r&&(r="middle"),t.verticalAlign=null==r||kh[r]?r:"top",t.padding&&(t.padding=fa(t.padding))}}function Hh(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function Vh(t,e,r){return"right"===e?t-r[1]:"center"===e?t+r[3]/2-r[1]/2:t+r[3]}function Wh(t){var e=t.text;return null!=e&&(e+=""),e}function Xh(t){return!!(t.backgroundColor||t.borderWidth&&t.borderColor)}var jh=zh;function qh(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?(r=t,r.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t;var r}"undefined"!=typeof console&&console.warn&&console.log;function Zh(){var t="__ec_inner_"+Yh++;return function(e){return e[t]||(e[t]={})}}var Yh=Math.round(9*Math.random());Zh(),Zh();new qr(100);$l.CMD,Math.sqrt,Math.atan2;Math.sqrt,Math.sin,Math.cos,Math.PI;!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}bo(e,t),e.prototype.applyTransform=function(t){}}(xh);var Kh=function(t){function e(e){var r=t.call(this)||this;return r.isGroup=!0,r._children=[],r.attr(e),r}return bo(e,t),e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(t){return this._children[t]},e.prototype.childOfName=function(t){for(var e=this._children,r=0;r<e.length;r++)if(e[r].name===t)return e[r]},e.prototype.childCount=function(){return this._children.length},e.prototype.add=function(t){if(t&&(t!==this&&t.parent!==this&&(this._children.push(t),this._doAdd(t)),t.__hostTarget))throw"This elemenet has been used as an attachment";return this},e.prototype.addBefore=function(t,e){if(t&&t!==this&&t.parent!==this&&e&&e.parent===this){var r=this._children,i=r.indexOf(e);i>=0&&(r.splice(i,0,t),this._doAdd(t))}return 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=Kn(r,t);return i<0?this:(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;r<t.length;r++){var i=t[r];e&&i.removeSelfFromZr(e),i.parent=null}return t.length=0,this},e.prototype.eachChild=function(t,e){for(var r=this._children,i=0;i<r.length;i++){var n=r[i];t.call(e,n,i)}return this},e.prototype.traverse=function(t,e){for(var r=0;r<this._children.length;r++){var i=this._children[r],n=t.call(e,i);i.isGroup&&!n&&i.traverse(t,e)}return this},e.prototype.addSelfToZr=function(e){t.prototype.addSelfToZr.call(this,e);for(var r=0;r<this._children.length;r++){this._children[r].addSelfToZr(e)}},e.prototype.removeSelfFromZr=function(e){t.prototype.removeSelfFromZr.call(this,e);for(var r=0;r<this._children.length;r++){this._children[r].removeSelfFromZr(e)}},e.prototype.getBoundingRect=function(t){for(var e=new Ho(0,0,0,0),r=t||this._children,i=[],n=null,a=0;a<r.length;a++){var o=r[a];if(!o.ignore&&!o.invisible){var s=o.getBoundingRect(),l=o.getLocalTransform(i);l?(Ho.applyTransform(e,s,l),(n=n||e.clone()).union(e)):(n=n||s.clone()).union(s)}}return n||e},e}(Ws);Kh.prototype.type="group";var Qh=function(){return function(){this.cx=0,this.cy=0,this.r=0}}(),Jh=function(t){function e(e){return t.call(this,e)||this}return bo(e,t),e.prototype.getDefaultShape=function(){return new Qh},e.prototype.buildPath=function(t,e,r){r&&t.moveTo(e.cx+e.r,e.cy),t.arc(e.cx,e.cy,e.r,0,2*Math.PI)},e}(xh);Jh.prototype.type="circle";var $h=Jh,tu=function(){return function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}}(),eu=function(t){function e(e){return t.call(this,e)||this}return bo(e,t),e.prototype.getDefaultShape=function(){return new tu},e.prototype.buildPath=function(t,e){var r=.5522848,i=e.cx,n=e.cy,a=e.rx,o=e.ry,s=a*r,l=o*r;t.moveTo(i-a,n),t.bezierCurveTo(i-a,n-l,i-s,n-o,i,n-o),t.bezierCurveTo(i+s,n-o,i+a,n-l,i+a,n),t.bezierCurveTo(i+a,n+l,i+s,n+o,i,n+o),t.bezierCurveTo(i-s,n+o,i-a,n+l,i-a,n),t.closePath()},e}(xh);eu.prototype.type="ellipse";var ru=eu,iu=Math.PI,nu=2*iu,au=Math.sin,ou=Math.cos,su=Math.acos,lu=Math.atan2,hu=Math.abs,uu=Math.sqrt,cu=Math.max,du=Math.min,fu=1e-4;function pu(t,e,r,i,n,a,o){var s=t-r,l=e-i,h=(o?a:-a)/uu(s*s+l*l),u=h*l,c=-h*s,d=t+u,f=e+c,p=r+u,m=i+c,g=(d+p)/2,_=(f+m)/2,v=p-d,y=m-f,x=v*v+y*y,T=n-a,b=d*m-p*f,w=(y<0?-1:1)*uu(cu(0,T*T*x-b*b)),S=(b*y-v*w)/x,E=(-b*v-y*w)/x,A=(b*y+v*w)/x,M=(-b*v+y*w)/x,C=S-g,D=E-_,L=A-g,P=M-_;return C*C+D*D>L*L+P*P&&(S=A,E=M),{cx:S,cy:E,x01:-u,y01:-c,x11:S*(n/T-1),y11:E*(n/T-1)}}function mu(t,e){var r=cu(e.r,0),i=cu(e.r0||0,0),n=r>0;if(n||i>0){if(n||(r=i,i=0),i>r){var a=r;r=i,i=a}var o=!!e.clockwise,s=e.startAngle,l=e.endAngle,h=[s,l];Jl(h,!o);var u=hu(h[0]-h[1]),c=e.cx,d=e.cy,f=e.cornerRadius||0,p=e.innerCornerRadius||0;if(r>fu)if(u>nu-fu)t.moveTo(c+r*ou(s),d+r*au(s)),t.arc(c,d,r,s,l,!o),i>fu&&(t.moveTo(c+i*ou(l),d+i*au(l)),t.arc(c,d,i,l,s,o));else{var m=hu(r-i)/2,g=du(m,f),_=du(m,p),v=_,y=g,x=r*ou(s),T=r*au(s),b=i*ou(l),w=i*au(l),S=void 0,E=void 0,A=void 0,M=void 0;if((g>fu||_>fu)&&(S=r*ou(l),E=r*au(l),A=i*ou(s),M=i*au(s),u<iu)){var C=function(t,e,r,i,n,a,o,s){var l=r-t,h=i-e,u=o-n,c=s-a,d=c*l-u*h;if(!(d*d<fu))return[t+(d=(u*(e-a)-c*(t-n))/d)*l,e+d*h]}(x,T,A,M,S,E,b,w);if(C){var D=x-C[0],L=T-C[1],P=S-C[0],N=E-C[1],R=1/au(su((D*P+L*N)/(uu(D*D+L*L)*uu(P*P+N*N)))/2),I=uu(C[0]*C[0]+C[1]*C[1]);v=du(_,(i-I)/(R-1)),y=du(g,(r-I)/(R+1))}}if(u>fu)if(y>fu){var O=pu(A,M,x,T,r,y,o),B=pu(S,E,b,w,r,y,o);t.moveTo(c+O.cx+O.x01,d+O.cy+O.y01),y<g?t.arc(c+O.cx,d+O.cy,y,lu(O.y01,O.x01),lu(B.y01,B.x01),!o):(t.arc(c+O.cx,d+O.cy,y,lu(O.y01,O.x01),lu(O.y11,O.x11),!o),t.arc(c,d,r,lu(O.cy+O.y11,O.cx+O.x11),lu(B.cy+B.y11,B.cx+B.x11),!o),t.arc(c+B.cx,d+B.cy,y,lu(B.y11,B.x11),lu(B.y01,B.x01),!o))}else t.moveTo(c+x,d+T),t.arc(c,d,r,s,l,!o);else t.moveTo(c+x,d+T);if(i>fu&&u>fu)if(v>fu){O=pu(b,w,S,E,i,-v,o),B=pu(x,T,A,M,i,-v,o);t.lineTo(c+O.cx+O.x01,d+O.cy+O.y01),v<_?t.arc(c+O.cx,d+O.cy,v,lu(O.y01,O.x01),lu(B.y01,B.x01),!o):(t.arc(c+O.cx,d+O.cy,v,lu(O.y01,O.x01),lu(O.y11,O.x11),!o),t.arc(c,d,i,lu(O.cy+O.y11,O.cx+O.x11),lu(B.cy+B.y11,B.cx+B.x11),o),t.arc(c+B.cx,d+B.cy,v,lu(B.y11,B.x11),lu(B.y01,B.x01),!o))}else t.lineTo(c+b,d+w),t.arc(c,d,i,l,s,o);else t.lineTo(c+b,d+w)}else t.moveTo(c,d);t.closePath()}}var gu=function(){return 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,this.innerCornerRadius=0}}(),_u=function(t){function e(e){return t.call(this,e)||this}return bo(e,t),e.prototype.getDefaultShape=function(){return new gu},e.prototype.buildPath=function(t,e){mu(t,e)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(xh);_u.prototype.type="sector";var vu=_u,yu=function(){return function(){this.cx=0,this.cy=0,this.r=0,this.r0=0}}(),xu=function(t){function e(e){return t.call(this,e)||this}return bo(e,t),e.prototype.getDefaultShape=function(){return new yu},e.prototype.buildPath=function(t,e){var r=e.cx,i=e.cy,n=2*Math.PI;t.moveTo(r+e.r,i),t.arc(r,i,e.r,0,n,!1),t.moveTo(r+e.r0,i),t.arc(r,i,e.r0,0,n,!0)},e}(xh);xu.prototype.type="ring";var Tu=xu;function bu(t,e,r,i,n,a,o){var s=.5*(r-t),l=.5*(i-e);return(2*(e-r)+s+l)*o+(-3*(e-r)-2*s-l)*a+s*n+e}function wu(t,e,r){var i=e.smooth,n=e.points;if(n&&n.length>=2){if(i&&"spline"!==i){var a=function(t,e,r,i){var n,a,o,s,l=[],h=[],u=[],c=[];if(i){o=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,f=t.length;d<f;d++)xs(o,o,t[d]),Ts(s,s,t[d]);xs(o,o,i[0]),Ts(s,s,i[1])}for(d=0,f=t.length;d<f;d++){var p=t[d];if(r)n=t[d?d-1:f-1],a=t[(d+1)%f];else{if(0===d||d===f-1){l.push(cs(t[d]));continue}n=t[d-1],a=t[d+1]}fs(h,a,n),gs(h,h,e);var m=_s(p,n),g=_s(p,a),_=m+g;0!==_&&(m/=_,g/=_),gs(u,h,-m),gs(c,h,g);var v=ds([],p,u),y=ds([],p,c);i&&(Ts(v,v,o),xs(v,v,s),Ts(y,y,o),xs(y,y,s)),l.push(v),l.push(y)}return r&&l.push(l.shift()),l}(n,i,r,e.smoothConstraint);t.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(r?o:o-1);s++){var l=a[2*s],h=a[2*s+1],u=n[(s+1)%o];t.bezierCurveTo(l[0],l[1],h[0],h[1],u[0],u[1])}}else{"spline"===i&&(n=function(t,e){for(var r=t.length,i=[],n=0,a=1;a<r;a++)n+=_s(t[a-1],t[a]);var o=n/2;for(o=o<r?r:o,a=0;a<o;a++){var s=a/(o-1)*(e?r:r-1),l=Math.floor(s),h=s-l,u=void 0,c=t[l%r],d=void 0,f=void 0;e?(u=t[(l-1+r)%r],d=t[(l+1)%r],f=t[(l+2)%r]):(u=t[0===l?l:l-1],d=t[l>r-2?r-1:l+1],f=t[l>r-3?r-1:l+2]);var p=h*h,m=h*p;i.push([bu(u[0],c[0],d[0],f[0],h,p,m),bu(u[1],c[1],d[1],f[1],h,p,m)])}return i}(n,r)),t.moveTo(n[0][0],n[0][1]);s=1;for(var c=n.length;s<c;s++)t.lineTo(n[s][0],n[s][1])}r&&t.closePath()}}var Su=function(){return function(){this.points=null,this.smooth=0,this.smoothConstraint=null}}(),Eu=function(t){function e(e){return t.call(this,e)||this}return bo(e,t),e.prototype.getDefaultShape=function(){return new Su},e.prototype.buildPath=function(t,e){wu(t,e,!0)},e}(xh);Eu.prototype.type="polygon";var Au=Eu,Mu=function(){return function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}}(),Cu=function(t){function e(e){return t.call(this,e)||this}return bo(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Mu},e.prototype.buildPath=function(t,e){wu(t,e,!1)},e}(xh);Cu.prototype.type="polyline";var Du=Cu,Lu={},Pu=function(){return function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}}(),Nu=function(t){function e(e){return t.call(this,e)||this}return bo(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Pu},e.prototype.buildPath=function(t,e){var r,i,n,a;if(this.subPixelOptimize){var o=Dh(Lu,e,this.style);r=o.x1,i=o.y1,n=o.x2,a=o.y2}else r=e.x1,i=e.y1,n=e.x2,a=e.y2;var s=e.percent;0!==s&&(t.moveTo(r,i),s<1&&(n=r*(1-s)+n*s,a=i*(1-s)+a*s),t.lineTo(n,a))},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}(xh);Nu.prototype.type="line";var Ru=Nu,Iu=[],Ou=function(){return function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1}}();function Bu(t,e,r){var i=t.cpx2,n=t.cpy2;return null===i||null===n?[(r?cl:ul)(t.x1,t.cpx1,t.cpx2,t.x2,e),(r?cl:ul)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(r?gl:ml)(t.x1,t.cpx1,t.x2,e),(r?gl:ml)(t.y1,t.cpy1,t.y2,e)]}var Fu=function(t){function e(e){return t.call(this,e)||this}return bo(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Ou},e.prototype.buildPath=function(t,e){var r=e.x1,i=e.y1,n=e.x2,a=e.y2,o=e.cpx1,s=e.cpy1,l=e.cpx2,h=e.cpy2,u=e.percent;0!==u&&(t.moveTo(r,i),null==l||null==h?(u<1&&(vl(r,o,n,u,Iu),o=Iu[1],n=Iu[2],vl(i,s,a,u,Iu),s=Iu[1],a=Iu[2]),t.quadraticCurveTo(o,s,n,a)):(u<1&&(fl(r,o,l,n,u,Iu),o=Iu[1],l=Iu[2],n=Iu[3],fl(i,s,h,a,u,Iu),s=Iu[1],h=Iu[2],a=Iu[3]),t.bezierCurveTo(o,s,l,h,n,a)))},e.prototype.pointAt=function(t){return Bu(this.shape,t,!1)},e.prototype.tangentAt=function(t){var e,r,i,n=Bu(this.shape,t,!0);return e=n,0===(i=ps(r=n))?(e[0]=0,e[1]=0):(e[0]=r[0]/i,e[1]=r[1]/i),e},e}(xh);Fu.prototype.type="bezier-curve";var zu=Fu,Uu=function(){return function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0}}(),ku=function(t){function e(e){return t.call(this,e)||this}return bo(e,t),e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Uu},e.prototype.buildPath=function(t,e){var r=e.cx,i=e.cy,n=Math.max(e.r,0),a=e.startAngle,o=e.endAngle,s=e.clockwise,l=Math.cos(a),h=Math.sin(a);t.moveTo(l*n+r,h*n+i),t.arc(r,i,n,a,o,!s)},e}(xh);ku.prototype.type="arc";var Gu=ku,Hu=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="compound",e}bo(e,t),e.prototype._updatePathDirty=function(){for(var t=this.shape.paths,e=this.shapeChanged(),r=0;r<t.length;r++)e=e||t[r].shapeChanged();e&&this.dirtyShape()},e.prototype.beforeBrush=function(){this._updatePathDirty();for(var t=this.shape.paths||[],e=this.getGlobalScale(),r=0;r<t.length;r++)t[r].path||t[r].createPathProxy(),t[r].path.setScale(e[0],e[1],t[r].segmentIgnoreThreshold)},e.prototype.buildPath=function(t,e){for(var r=e.paths||[],i=0;i<r.length;i++)r[i].buildPath(t,r[i].shape,!0)},e.prototype.afterBrush=function(){for(var t=this.shape.paths||[],e=0;e<t.length;e++)t[e].pathUpdated()},e.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),xh.prototype.getBoundingRect.call(this)}}(xh),function(){function t(t){this.colorStops=t||[]}return t.prototype.addColorStop=function(t,e){this.colorStops.push({offset:t,color:e})},t}()),Vu=(function(t){function e(e,r,i,n,a,o){var s=t.call(this,a)||this;return s.x=null==e?0:e,s.y=null==r?0:r,s.x2=null==i?1:i,s.y2=null==n?0:n,s.type="linear",s.global=o||!1,s}bo(e,t)}(Hu),function(t){function e(e,r,i,n,a){var o=t.call(this,n)||this;return o.x=null==e?.5:e,o.y=null==r?.5:r,o.r=null==i?.5:i,o.type="radial",o.global=a||!1,o}bo(e,t)}(Hu),[0,0]),Wu=[0,0],Xu=new Ro,ju=new Ro,qu=(function(){function t(t,e){this._corners=[],this._axes=[],this._origin=[0,0];for(var r=0;r<4;r++)this._corners[r]=new Ro;for(r=0;r<2;r++)this._axes[r]=new Ro;t&&this.fromBoundingRect(t,e)}t.prototype.fromBoundingRect=function(t,e){var r=this._corners,i=this._axes,n=t.x,a=t.y,o=n+t.width,s=a+t.height;if(r[0].set(n,a),r[1].set(o,a),r[2].set(o,s),r[3].set(n,s),e)for(var l=0;l<4;l++)r[l].transform(e);Ro.sub(i[0],r[1],r[0]),Ro.sub(i[1],r[3],r[0]),i[0].normalize(),i[1].normalize();for(l=0;l<2;l++)this._origin[l]=i[l].dot(r[0])},t.prototype.intersect=function(t,e){var r=!0,i=!e;return Xu.set(1/0,1/0),ju.set(0,0),!this._intersectCheckOneSide(this,t,Xu,ju,i,1)&&(r=!1,i)?r:!this._intersectCheckOneSide(t,this,Xu,ju,i,-1)&&(r=!1,i)?r:(i||Ro.copy(e,r?Xu:ju),r)},t.prototype._intersectCheckOneSide=function(t,e,r,i,n,a){for(var o=!0,s=0;s<2;s++){var l=this._axes[s];if(this._getProjMinMaxOnAxis(s,t._corners,Vu),this._getProjMinMaxOnAxis(s,e._corners,Wu),Vu[1]<Wu[0]||Vu[0]>Wu[1]){if(o=!1,n)return o;var h=Math.abs(Wu[0]-Vu[1]),u=Math.abs(Vu[0]-Wu[1]);Math.min(h,u)>i.len()&&(h<u?Ro.scale(i,l,-h*a):Ro.scale(i,l,u*a))}else if(r){h=Math.abs(Wu[0]-Vu[1]),u=Math.abs(Vu[0]-Wu[1]);Math.min(h,u)<r.len()&&(h<u?Ro.scale(r,l,h*a):Ro.scale(r,l,-u*a))}}return o},t.prototype._getProjMinMaxOnAxis=function(t,e,r){for(var i=this._axes[t],n=this._origin,a=e[0].dot(i)+n[t],o=a,s=a,l=1;l<e.length;l++){var h=e[l].dot(i)+n[t];o=Math.min(h,o),s=Math.max(h,s)}r[0]=o,r[1]=s}}(),[]),Zu=(function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.notClear=!0,e.incremental=!0,e._displayables=[],e._temporaryDisplayables=[],e._cursor=0,e}bo(e,t),e.prototype.traverse=function(t,e){t.call(e,this)},e.prototype.useStyle=function(){this.style={}},e.prototype.getCursor=function(){return this._cursor},e.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},e.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},e.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},e.prototype.addDisplayable=function(t,e){e?this._temporaryDisplayables.push(t):this._displayables.push(t),this.markRedraw()},e.prototype.addDisplayables=function(t,e){e=e||!1;for(var r=0;r<t.length;r++)this.addDisplayable(t[r],e)},e.prototype.getDisplayables=function(){return this._displayables},e.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},e.prototype.eachPendingDisplayable=function(t){for(var e=this._cursor;e<this._displayables.length;e++)t&&t(this._displayables[e]);for(e=0;e<this._temporaryDisplayables.length;e++)t&&t(this._temporaryDisplayables[e])},e.prototype.update=function(){this.updateTransform();for(var t=this._cursor;t<this._displayables.length;t++){(e=this._displayables[t]).parent=this,e.update(),e.parent=null}for(t=0;t<this._temporaryDisplayables.length;t++){var e;(e=this._temporaryDisplayables[t]).parent=this,e.update(),e.parent=null}},e.prototype.getBoundingRect=function(){if(!this._rect){for(var t=new Ho(1/0,1/0,-1/0,-1/0),e=0;e<this._displayables.length;e++){var r=this._displayables[e],i=r.getBoundingRect().clone();r.needLocalTransform()&&i.applyTransform(r.getLocalTransform(qu)),t.union(i)}this._rect=t}return this._rect},e.prototype.contain=function(t,e){var r=this.transformCoordToLocal(t,e);if(this.getBoundingRect().contain(r[0],r[1]))for(var i=0;i<this._displayables.length;i++){if(this._displayables[i].contain(t,e))return!0}return!1}}(Js),Math.max,Math.min,{});function Yu(t,e){Zu[t]=e}Yu("circle",$h),Yu("ellipse",ru),Yu("sector",vu),Yu("ring",Tu),Yu("polygon",Au),Yu("polyline",Du),Yu("rect",Oh),Yu("line",Ru),Yu("bezierCurve",zu),Yu("arc",Gu);var Ku={};function Qu(t,e,r,i,n){var a={};return function(t,e,r,i,n){r=r||Ku;var a,o=e.ecModel,s=o&&o.option.textStyle,l=function(t){var e;for(;t&&t!==t.ecModel;){var r=(t.option||Ku).rich;if(r){e=e||{};for(var i=ra(r),n=0;n<i.length;n++){var a=i[n];e[a]=1}}t=t.parentModel}return e}(e);if(l)for(var h in a={},l)if(l.hasOwnProperty(h)){var u=e.getModel(["rich",h]);ec(a[h]={},u,s,r,i,n,!1,!0)}a&&(t.rich=a);var c=e.get("overflow");c&&(t.overflow=c);var d=e.get("minMargin");null!=d&&(t.margin=d);ec(t,e,s,r,i,n,!0,!1)}(a,t,r,i,n),e&&qn(a,e),a}var Ju=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],$u=["align","lineHeight","width","height","tag","verticalAlign"],tc=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function ec(t,e,r,i,n,a,o,s){r=!n&&r||Ku;var l=i&&i.inheritColor,h=e.getShallow("color"),u=e.getShallow("textBorderColor"),c=ua(e.getShallow("opacity"),r.opacity);"inherit"!==h&&"auto"!==h||(h=l||null),"inherit"!==u&&"auto"!==u||(u=l||null),a||(h=h||r.color,u=u||r.textBorderColor),null!=h&&(t.fill=h),null!=u&&(t.stroke=u);var d=ua(e.getShallow("textBorderWidth"),r.textBorderWidth);null!=d&&(t.lineWidth=d);var f=ua(e.getShallow("textBorderType"),r.textBorderType);null!=f&&(t.lineDash=f);var p=ua(e.getShallow("textBorderDashOffset"),r.textBorderDashOffset);null!=p&&(t.lineDashOffset=p),n||null!=c||s||(c=i&&i.defaultOpacity),null!=c&&(t.opacity=c),n||a||null==t.fill&&i.inheritColor&&(t.fill=i.inheritColor);for(var m=0;m<Ju.length;m++){var g=Ju[m];null!=(v=ua(e.getShallow(g),r[g]))&&(t[g]=v)}for(m=0;m<$u.length;m++){g=$u[m];null!=(v=e.getShallow(g))&&(t[g]=v)}if(null==t.verticalAlign){var _=e.getShallow("baseline");null!=_&&(t.verticalAlign=_)}if(!o||!i.disableBox){for(m=0;m<tc.length;m++){var v;g=tc[m];null!=(v=e.getShallow(g))&&(t[g]=v)}var y=e.getShallow("borderType");null!=y&&(t.borderDash=y),"auto"!==t.backgroundColor&&"inherit"!==t.backgroundColor||!l||(t.backgroundColor=l),"auto"!==t.borderColor&&"inherit"!==t.borderColor||!l||(t.borderColor=l)}}Zh();var rc=qi.firstNotNull,ic={left:0,middle:1,right:2};function nc(t){return t instanceof Array||(t=[t,t]),t}var ac=f.extend(function(){return{zr:null,viewGL:null,_center:new Qt,minDistance:.5,maxDistance:1.5,maxOrthographicSize:300,minOrthographicSize:30,minAlpha:-90,maxAlpha:90,minBeta:-1/0,maxBeta:1/0,autoRotateAfterStill:0,autoRotateDirection:"cw",autoRotateSpeed:60,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",_mode:"rotate",_camera:null,_needsUpdate:!1,_rotating:!1,_phi:0,_theta:0,_mouseX:0,_mouseY:0,_rotateVelocity:new Z,_panVelocity:new Z,_distance:500,_zoomSpeed:0,_stillTimeout:0,_animators:[]}},function(){["_mouseDownHandler","_mouseWheelHandler","_mouseMoveHandler","_mouseUpHandler","_pinchHandler","_contextMenuHandler","_update"].forEach(function(t){this[t]=this[t].bind(this)},this)},{init:function(){var t=this.zr;t&&(t.on("mousedown",this._mouseDownHandler),t.on("globalout",this._mouseUpHandler),t.on("mousewheel",this._mouseWheelHandler),t.on("pinch",this._pinchHandler),t.animation.on("frame",this._update),t.dom.addEventListener("contextmenu",this._contextMenuHandler))},dispose:function(){var t=this.zr;t&&(t.off("mousedown",this._mouseDownHandler),t.off("mousemove",this._mouseMoveHandler),t.off("mouseup",this._mouseUpHandler),t.off("mousewheel",this._mouseWheelHandler),t.off("pinch",this._pinchHandler),t.off("globalout",this._mouseUpHandler),t.dom.removeEventListener("contextmenu",this._contextMenuHandler),t.animation.off("frame",this._update)),this.stopAllAnimation()},getDistance:function(){return this._distance},setDistance:function(t){this._distance=t,this._needsUpdate=!0},getOrthographicSize:function(){return this._orthoSize},setOrthographicSize:function(t){this._orthoSize=t,this._needsUpdate=!0},getAlpha:function(){return this._theta/Math.PI*180},getBeta:function(){return-this._phi/Math.PI*180},getCenter:function(){return this._center.toArray()},setAlpha:function(t){t=Math.max(Math.min(this.maxAlpha,t),this.minAlpha),this._theta=t/180*Math.PI,this._needsUpdate=!0},setBeta:function(t){t=Math.max(Math.min(this.maxBeta,t),this.minBeta),this._phi=-t/180*Math.PI,this._needsUpdate=!0},setCenter:function(t){this._center.setArray(t)},setViewGL:function(t){this.viewGL=t},getCamera:function(){return this.viewGL.camera},setFromViewControlModel:function(t,e){var r=(e=e||{}).baseDistance||0,i=e.baseOrthoSize||1,n=t.get("projection");"perspective"!==n&&"orthographic"!==n&&"isometric"!==n&&(n="perspective"),this._projection=n,this.viewGL.setProjection(n);var a=t.get("distance")+r,o=t.get("orthographicSize")+i;[["damping",.8],["autoRotate",!1],["autoRotateAfterStill",3],["autoRotateDirection","cw"],["autoRotateSpeed",10],["minDistance",30],["maxDistance",400],["minOrthographicSize",30],["maxOrthographicSize",300],["minAlpha",-90],["maxAlpha",90],["minBeta",-1/0],["maxBeta",1/0],["rotateSensitivity",1],["zoomSensitivity",1],["panSensitivity",1],["panMouseButton","left"],["rotateMouseButton","middle"]].forEach(function(e){this[e[0]]=rc(t.get(e[0]),e[1])},this),this.minDistance+=r,this.maxDistance+=r,this.minOrthographicSize+=i,this.maxOrthographicSize+=i;var s=t.ecModel,l={};["animation","animationDurationUpdate","animationEasingUpdate"].forEach(function(e){l[e]=rc(t.get(e),s&&s.get(e))});var h=rc(e.alpha,t.get("alpha"))||0,u=rc(e.beta,t.get("beta"))||0,c=rc(e.center,t.get("center"))||[0,0,0];l.animation&&l.animationDurationUpdate>0&&this._notFirst?this.animateTo({alpha:h,beta:u,center:c,distance:a,orthographicSize:o,easing:l.animationEasingUpdate,duration:l.animationDurationUpdate}):(this.setDistance(a),this.setAlpha(h),this.setBeta(u),this.setCenter(c),this.setOrthographicSize(o)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){0},animateTo:function(t){var e=this.zr,r=this,i={},n={};return null!=t.distance&&(i.distance=this.getDistance(),n.distance=t.distance),null!=t.orthographicSize&&(i.orthographicSize=this.getOrthographicSize(),n.orthographicSize=t.orthographicSize),null!=t.alpha&&(i.alpha=this.getAlpha(),n.alpha=t.alpha),null!=t.beta&&(i.beta=this.getBeta(),n.beta=t.beta),null!=t.center&&(i.center=this.getCenter(),n.center=t.center),this._addAnimator(e.animation.animate(i).when(t.duration||1e3,n).during(function(){null!=i.alpha&&r.setAlpha(i.alpha),null!=i.beta&&r.setBeta(i.beta),null!=i.distance&&r.setDistance(i.distance),null!=i.center&&r.setCenter(i.center),null!=i.orthographicSize&&r.setOrthographicSize(i.orthographicSize),r._needsUpdate=!0})).start(t.easing||"linear")},stopAllAnimation:function(){for(var t=0;t<this._animators.length;t++)this._animators[t].stop();this._animators.length=0},update:function(){this._needsUpdate=!0,this._update(20)},_isAnimating:function(){return this._animators.length>0},_update:function(t){if(this._rotating){var e=("cw"===this.autoRotateDirection?1:-1)*this.autoRotateSpeed/180*Math.PI;this._phi-=e*t/1e3,this._needsUpdate=!0}else this._rotateVelocity.len()>0&&(this._needsUpdate=!0);(Math.abs(this._zoomSpeed)>.1||this._panVelocity.len()>0)&&(this._needsUpdate=!0),this._needsUpdate&&(t=Math.min(t,50),this._updateDistanceOrSize(t),this._updatePan(t),this._updateRotate(t),this._updateTransform(),this.getCamera().update(),this.zr&&this.zr.refresh(),this.trigger("update"),this._needsUpdate=!1)},_updateRotate:function(t){var e=this._rotateVelocity;this._phi=e.y*t/20+this._phi,this._theta=e.x*t/20+this._theta,this.setAlpha(this.getAlpha()),this.setBeta(this.getBeta()),this._vectorDamping(e,Math.pow(this.damping,t/16))},_updateDistanceOrSize:function(t){"perspective"===this._projection?this._setDistance(this._distance+this._zoomSpeed*t/20):this._setOrthoSize(this._orthoSize+this._zoomSpeed*t/20),this._zoomSpeed*=Math.pow(this.damping,t/16)},_setDistance:function(t){this._distance=Math.max(Math.min(t,this.maxDistance),this.minDistance)},_setOrthoSize:function(t){this._orthoSize=Math.max(Math.min(t,this.maxOrthographicSize),this.minOrthographicSize);var e=this.getCamera(),r=this._orthoSize,i=r/this.viewGL.viewport.height*this.viewGL.viewport.width;e.left=-i/2,e.right=i/2,e.top=r/2,e.bottom=-r/2},_updatePan:function(t){var e=this._panVelocity,r=this._distance,i=this.getCamera(),n=i.worldTransform.y,a=i.worldTransform.x;this._center.scaleAndAdd(a,-e.x*r/200).scaleAndAdd(n,-e.y*r/200),this._vectorDamping(e,0)},_updateTransform:function(){var t=this.getCamera(),e=new Qt,r=this._theta+Math.PI/2,i=this._phi+Math.PI/2,n=Math.sin(r);e.x=n*Math.cos(i),e.y=-Math.cos(r),e.z=n*Math.sin(i),t.position.copy(this._center).scaleAndAdd(e,this._distance),t.rotation.identity().rotateY(-this._phi).rotateX(-this._theta)},_startCountingStill:function(){clearTimeout(this._stillTimeout);var t=this.autoRotateAfterStill,e=this;!isNaN(t)&&t>0&&(this._stillTimeout=setTimeout(function(){e._rotating=!0},1e3*t))},_vectorDamping:function(t,e){var r=t.len();(r*=e)<1e-4&&(r=0),t.normalize().scale(r)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var t=this.getCamera().worldTransform.z,e=Math.asin(t.y),r=Math.atan2(t.x,t.z);this._theta=e,this._phi=-r,this.setBeta(this.getBeta()),this.setAlpha(this.getAlpha()),this.getCamera().aspect?this._setDistance(this.getCamera().position.dist(this._center)):this._setOrthoSize(this.getCamera().top-this.getCamera().bottom)}},_mouseDownHandler:function(t){if(!t.target&&!this._isAnimating()){var e=t.offsetX,r=t.offsetY;this.viewGL&&!this.viewGL.containPoint(e,r)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),t.event.targetTouches?1===t.event.targetTouches.length&&(this._mode="rotate"):t.event.button===ic[this.rotateMouseButton]?this._mode="rotate":t.event.button===ic[this.panMouseButton]?this._mode="pan":this._mode="",this._rotateVelocity.set(0,0),this._rotating=!1,this.autoRotate&&this._startCountingStill(),this._mouseX=t.offsetX,this._mouseY=t.offsetY)}},_mouseMoveHandler:function(t){if(!(t.target&&t.target.__isGLToZRProxy||this._isAnimating())){var e=nc(this.panSensitivity),r=nc(this.rotateSensitivity);"rotate"===this._mode?(this._rotateVelocity.y=(t.offsetX-this._mouseX)/this.zr.getHeight()*2*r[0],this._rotateVelocity.x=(t.offsetY-this._mouseY)/this.zr.getWidth()*2*r[1]):"pan"===this._mode&&(this._panVelocity.x=(t.offsetX-this._mouseX)/this.zr.getWidth()*e[0]*400,this._panVelocity.y=(-t.offsetY+this._mouseY)/this.zr.getHeight()*e[1]*400),this._mouseX=t.offsetX,this._mouseY=t.offsetY,t.event.preventDefault()}},_mouseWheelHandler:function(t){if(!this._isAnimating()){var e=t.event.wheelDelta||-t.event.detail;this._zoomHandler(t,e)}},_pinchHandler:function(t){this._isAnimating()||(this._zoomHandler(t,t.pinchScale>1?1:-1),this._mode="")},_zoomHandler:function(t,e){if(0!==e){var r,i=t.offsetX,n=t.offsetY;if(!this.viewGL||this.viewGL.containPoint(i,n))r="perspective"===this._projection?Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(e>0?-1:1)*r*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&"rotate"===this._mode&&this._startCountingStill(),t.event.preventDefault()}},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return"right"===this.rotateMouseButton||"right"===this.panMouseButton},_contextMenuHandler:function(t){this._isRightMouseButtonUsed()&&t.preventDefault()},_addAnimator:function(t){var e=this._animators;return e.push(t),t.done(function(){var r=e.indexOf(t);r>=0&&e.splice(r,1)}),t}});Object.defineProperty(ac.prototype,"autoRotate",{get:function(t){return this._autoRotate},set:function(t){this._autoRotate=t,this._rotating=t}});var oc=ac,sc={convertToDynamicArray:function(t){t&&this.resetOffset();var e=this.attributes;for(var r in e)t||!e[r].value?e[r].value=[]:e[r].value=Array.prototype.slice.call(e[r].value);t||!this.indices?this.indices=[]:this.indices=Array.prototype.slice.call(this.indices)},convertToTypedArray:function(){var t=this.attributes;for(var e in t)t[e].value&&t[e].value.length>0?t[e].value=new Float32Array(t[e].value):t[e].value=null;this.indices&&this.indices.length>0&&(this.indices=this.vertexCount>65535?new Uint32Array(this.indices):new Uint16Array(this.indices)),this.dirty()}},lc={vec2:X,vec3:Mt,vec4:ee,mat2:an,mat2d:hn,mat3:se,mat4:Et,quat:fe},hc=lc.vec3,uc=[[0,0],[1,1]],cc=gr.extend(function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new gr.Attribute("position","float",3,"POSITION"),positionPrev:new gr.Attribute("positionPrev","float",3),positionNext:new gr.Attribute("positionNext","float",3),prevPositionPrev:new gr.Attribute("prevPositionPrev","float",3),prevPosition:new gr.Attribute("prevPosition","float",3),prevPositionNext:new gr.Attribute("prevPositionNext","float",3),offset:new gr.Attribute("offset","float",1),color:new gr.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(t){var e=this.attributes;this.vertexCount!==t&&(e.position.init(t),e.color.init(t),this.useNativeLine||(e.positionPrev.init(t),e.positionNext.init(t),e.offset.init(t)),t>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(t){this.triangleCount!==t&&(this.indices=0===t?null:this.vertexCount>65535?new Uint32Array(3*t):new Uint16Array(3*t))},_getCubicCurveApproxStep:function(t,e,r,i){return 1/(hc.dist(t,e)+hc.dist(r,e)+hc.dist(i,r)+1)*this.segmentScale},getCubicCurveVertexCount:function(t,e,r,i){var n=this._getCubicCurveApproxStep(t,e,r,i),a=Math.ceil(1/n);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(t,e,r,i){var n=this._getCubicCurveApproxStep(t,e,r,i),a=Math.ceil(1/n);return this.useNativeLine?0:2*a},getLineVertexCount:function(){return this.getPolylineVertexCount(uc)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(uc)},getPolylineVertexCount:function(t){var e;"number"==typeof t?e=t:e="number"!=typeof t[0]?t.length:t.length/3;return this.useNativeLine?2*(e-1):2*(e-1)+2},getPolylineTriangleCount:function(t){var e;"number"==typeof t?e=t:e="number"!=typeof t[0]?t.length:t.length/3;return this.useNativeLine?0:2*Math.max(e-1,0)},addCubicCurve:function(t,e,r,i,n,a){null==a&&(a=1);var o=t[0],s=t[1],l=t[2],h=e[0],u=e[1],c=e[2],d=r[0],f=r[1],p=r[2],m=i[0],g=i[1],_=i[2],v=this._getCubicCurveApproxStep(t,e,r,i),y=v*v,x=y*v,T=3*v,b=3*y,w=6*y,S=6*x,E=o-2*h+d,A=s-2*u+f,M=l-2*c+p,C=3*(h-d)-o+m,D=3*(u-f)-s+g,L=3*(c-p)-l+_,P=o,N=s,R=l,I=(h-o)*T+E*b+C*x,O=(u-s)*T+A*b+D*x,B=(c-l)*T+M*b+L*x,F=E*w+C*S,z=A*w+D*S,U=M*w+L*S,k=C*S,G=D*S,H=L*S,V=0,W=0,X=Math.ceil(1/v),j=new Float32Array(3*(X+1)),q=(j=[],0);for(W=0;W<X+1;W++)j[q++]=P,j[q++]=N,j[q++]=R,P+=I,N+=O,R+=B,I+=F,O+=z,B+=U,F+=k,z+=G,U+=H,(V+=v)>1&&(P=I>0?Math.min(P,m):Math.max(P,m),N=O>0?Math.min(N,g):Math.max(N,g),R=B>0?Math.min(R,_):Math.max(R,_));return this.addPolyline(j,n,a)},addLine:function(t,e,r,i){return this.addPolyline([t,e],r,i)},addPolyline:function(t,e,r,i,n){if(t.length){var a="number"!=typeof t[0];if(null==n&&(n=a?t.length:t.length/3),!(n<2)){null==i&&(i=0),null==r&&(r=1),this._itemVertexOffsets.push(this._vertexOffset);var o,s,l=(a="number"!=typeof t[0])?"number"!=typeof e[0]:e.length/4===n,h=this.attributes.position,u=this.attributes.positionPrev,c=this.attributes.positionNext,d=this.attributes.color,f=this.attributes.offset,p=this.indices,m=this._vertexOffset;r=Math.max(r,.01);for(var g=i;g<n;g++){if(a)o=t[g],s=l?e[g]:e;else{var _=3*g;if((o=o||[])[0]=t[_],o[1]=t[_+1],o[2]=t[_+2],l){var v=4*g;(s=s||[])[0]=e[v],s[1]=e[v+1],s[2]=e[v+2],s[3]=e[v+3]}else s=e}if(this.useNativeLine?g>1&&(h.copy(m,m-1),d.copy(m,m-1),m++):(g<n-1&&(u.set(m+2,o),u.set(m+3,o)),g>0&&(c.set(m-2,o),c.set(m-1,o)),h.set(m,o),h.set(m+1,o),d.set(m,s),d.set(m+1,s),f.set(m,r/2),f.set(m+1,-r/2),m+=2),this.useNativeLine)d.set(m,s),h.set(m,o),m++;else if(g>0){var y=3*this._triangleOffset;(p=this.indices)[y]=m-4,p[y+1]=m-3,p[y+2]=m-2,p[y+3]=m-3,p[y+4]=m-1,p[y+5]=m-2,this._triangleOffset+=2}}if(!this.useNativeLine){var x=this._vertexOffset,T=this._vertexOffset+2*n;u.copy(x,x+2),u.copy(x+1,x+3),c.copy(T-1,T-3),c.copy(T-2,T-4)}return this._vertexOffset=m,this._vertexOffset}}},setItemColor:function(t,e){for(var r=this._itemVertexOffsets[t],i=t<this._itemVertexOffsets.length-1?this._itemVertexOffsets[t+1]:this._vertexOffset,n=r;n<i;n++)this.attributes.color.set(n,e);this.dirty("color")},currentTriangleOffset:function(){return this._triangleOffset},currentVertexOffset:function(){return this._vertexOffset}});i.util.defaults(cc.prototype,sc);var dc=cc;function fc(t,e,r,i,n,a,o){this._zr=t,this._x=0,this._y=0,this._rowHeight=0,this.width=i,this.height=n,this.offsetX=e,this.offsetY=r,this.dpr=o,this.gap=a}function pc(t){(t=t||{}).width=t.width||512,t.height=t.height||512,t.devicePixelRatio=t.devicePixelRatio||1,t.gap=null==t.gap?2:t.gap;var e=document.createElement("canvas");e.width=t.width*t.devicePixelRatio,e.height=t.height*t.devicePixelRatio,this._canvas=e,this._texture=new ir({image:e,flipY:!1});var r=this;this._zr=i.zrender.init(e);var n=this._zr.refreshImmediately;this._zr.refreshImmediately=function(){n.call(this),r._texture.dirty(),r.onupdate&&r.onupdate()},this._dpr=t.devicePixelRatio,this._coords={},this.onupdate=t.onupdate,this._gap=t.gap,this._textureAtlasNodes=[new fc(this._zr,0,0,t.width,t.height,this._gap,this._dpr)],this._nodeWidth=t.width,this._nodeHeight=t.height,this._currentNodeIdx=0}fc.prototype={constructor:fc,clear:function(){this._x=0,this._y=0,this._rowHeight=0},add:function(t,e,r){var i=t.getBoundingRect();null==e&&(e=i.width),null==r&&(r=i.height),e*=this.dpr,r*=this.dpr,this._fitElement(t,e,r);var n=this._x,a=this._y,o=this.width*this.dpr,s=this.height*this.dpr,l=this.gap;if(n+e+l>o&&(n=this._x=0,a+=this._rowHeight+l,this._y=a,this._rowHeight=0),this._x+=e+l,this._rowHeight=Math.max(this._rowHeight,r),a+r+l>s)return null;t.x+=this.offsetX*this.dpr+n,t.y+=this.offsetY*this.dpr+a,this._zr.add(t);var h=[this.offsetX/this.width,this.offsetY/this.height];return[[n/o+h[0],a/s+h[1]],[(n+e)/o+h[0],(a+r)/s+h[1]]]},_fitElement:function(t,e,r){var i=t.getBoundingRect(),n=e/i.width,a=r/i.height;t.x=-i.x*n,t.y=-i.y*a,t.scaleX=n,t.scaleY=a,t.update()}},pc.prototype={clear:function(){for(var t=0;t<this._textureAtlasNodes.length;t++)this._textureAtlasNodes[t].clear();this._currentNodeIdx=0,this._zr.clear(),this._coords={}},getWidth:function(){return this._width},getHeight:function(){return this._height},getTexture:function(){return this._texture},getDevicePixelRatio:function(){return this._dpr},getZr:function(){return this._zr},_getCurrentNode:function(){return this._textureAtlasNodes[this._currentNodeIdx]},_expand:function(){if(this._currentNodeIdx++,this._textureAtlasNodes[this._currentNodeIdx])return this._textureAtlasNodes[this._currentNodeIdx];var t=4096/this._dpr,e=this._textureAtlasNodes.length,r=e*this._nodeWidth%t,i=Math.floor(e*this._nodeWidth/t)*this._nodeHeight;if(!(i>=t)){var n=(r+this._nodeWidth)*this._dpr,a=(i+this._nodeHeight)*this._dpr;try{this._zr.resize({width:n,height:a})}catch(t){this._canvas.width=n,this._canvas.height=a}var o=new fc(this._zr,r,i,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(o),o}},add:function(t,e,r){if(this._coords[t.id])return this._coords[t.id];var i=this._getCurrentNode().add(t,e,r);if(!i){var n=this._expand();if(!n)return;i=n.add(t,e,r)}return this._coords[t.id]=i,i},getCoordsScale:function(){var t=this._dpr;return[this._nodeWidth/this._canvas.width*t,this._nodeHeight/this._canvas.height*t]},getCoords:function(t){return this._coords[t]}};var mc=pc;function gc(){}gc.prototype={constructor:gc,setScene:function(t){this._scene=t,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(t){this._lightRoot=t,this.mainLight=new Wa.DirectionalLight({shadowBias:.005}),this.ambientLight=new Wa.AmbientLight,t.add(this.mainLight),t.add(this.ambientLight)},dispose:function(){this._lightRoot&&(this._lightRoot.remove(this.mainLight),this._lightRoot.remove(this.ambientLight))},updateLight:function(t){var e=this.mainLight,r=this.ambientLight,i=t.getModel("light"),n=i.getModel("main"),a=i.getModel("ambient");e.intensity=n.get("intensity"),r.intensity=a.get("intensity"),e.color=Wa.parseColor(n.get("color")).slice(0,3),r.color=Wa.parseColor(a.get("color")).slice(0,3);var o=n.get("alpha")||0,s=n.get("beta")||0;e.position.setArray(Wa.directionFromAlphaBeta(o,s)),e.lookAt(Wa.Vector3.ZERO),e.castShadow=n.get("shadow"),e.shadowResolution=Wa.getShadowResolution(n.get("shadowQuality"))},updateAmbientCubemap:function(t,e,r){var i=e.getModel("light.ambientCubemap"),n=i.get("texture");if(n){this._cubemapLightsCache=this._cubemapLightsCache||{};var a=this._cubemapLightsCache[n];if(!a){var o=this;a=this._cubemapLightsCache[n]=Wa.createAmbientCubemap(i.option,t,r,function(){o._isSkyboxFromAmbientCubemap&&o._skybox.setEnvironmentMap(a.specular.cubemap),r.getZr().refresh()})}this._lightRoot.add(a.diffuse),this._lightRoot.add(a.specular),this._currentCubemapLights=a}else this._currentCubemapLights&&(this._lightRoot.remove(this._currentCubemapLights.diffuse),this._lightRoot.remove(this._currentCubemapLights.specular),this._currentCubemapLights=null)},updateSkybox:function(t,e,r){var n=e.get("environment"),a=this;var o=(a._skybox=a._skybox||new di,a._skybox);if(n&&"none"!==n)if("auto"===n)if(this._isSkyboxFromAmbientCubemap=!0,this._currentCubemapLights){var s=this._currentCubemapLights.specular.cubemap;o.setEnvironmentMap(s),this._scene&&o.attachScene(this._scene),o.material.set("lod",3)}else this._skybox&&this._skybox.detachScene();else if("object"==typeof n&&n.colorStops||"string"==typeof n&&i.color.parse(n)){this._isSkyboxFromAmbientCubemap=!1;var l=new Wa.Texture2D({anisotropic:8,flipY:!1});o.setEnvironmentMap(l);var h=l.image=document.createElement("canvas");h.width=h.height=16;var u=h.getContext("2d"),c=new i.graphic.Rect({shape:{x:0,y:0,width:16,height:16},style:{fill:n}});i.innerDrawElementOnCanvas(u,c),o.attachScene(this._scene)}else{this._isSkyboxFromAmbientCubemap=!1;l=Wa.loadTexture(n,r,{anisotropic:8,flipY:!1});o.setEnvironmentMap(l),o.attachScene(this._scene)}else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var d=e.coordinateSystem;if(this._skybox)if(!d||!d.viewGL||"auto"===n||n.match&&n.match(/.hdr$/))this._skybox.material.undefine("fragment","SRGB_DECODE");else{var f=d.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[f]("fragment","SRGB_DECODE")}}};var _c,vc,yc,xc,Tc=gc,bc=lc.vec3,wc=gr.extend(function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new gr.Attribute("position","float",3,"POSITION"),normal:new gr.Attribute("normal","float",3,"NORMAL"),color:new gr.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(t){var e=this.attributes,r=this.getQuadVertexCount()*t,i=this.getQuadTriangleCount()*t;this.vertexCount!==r&&(e.position.init(r),e.normal.init(r),e.color.init(r)),this.triangleCount!==i&&(this.indices=r>65535?new Uint32Array(3*i):new Uint16Array(3*i))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:(_c=bc.create(),vc=bc.create(),yc=bc.create(),xc=[0,3,1,3,2,1],function(t,e){var r=this.attributes.position,i=this.attributes.normal,n=this.attributes.color;bc.sub(_c,t[1],t[0]),bc.sub(vc,t[2],t[1]),bc.cross(yc,_c,vc),bc.normalize(yc,yc);for(var a=0;a<4;a++)r.set(this._vertexOffset+a,t[a]),n.set(this._vertexOffset+a,e),i.set(this._vertexOffset+a,yc);var o=3*this._faceOffset;for(a=0;a<6;a++)this.indices[o+a]=xc[a]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2})});i.util.defaults(wc.prototype,sc);var Sc=wc,Ec=qi.firstNotNull,Ac={x:0,y:2,z:1};function Mc(t,e,r){this.rootNode=new Wa.Node;var i=new Wa.Mesh({geometry:new dc({useNativeLine:!1}),material:e,castShadow:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:1}),n=new Wa.Mesh({geometry:new Sc,material:r,castShadow:!1,culling:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:0});this.rootNode.add(n),this.rootNode.add(i),this.faceInfo=t,this.plane=new Wa.Plane,this.linesMesh=i,this.quadsMesh=n}Mc.prototype.update=function(t,e,r){var i=t.coordinateSystem,n=[i.getAxis(this.faceInfo[0]),i.getAxis(this.faceInfo[1])],a=this.linesMesh.geometry,o=this.quadsMesh.geometry;a.convertToDynamicArray(!0),o.convertToDynamicArray(!0),this._updateSplitLines(a,n,t,r),this._udpateSplitAreas(o,n,t,r),a.convertToTypedArray(),o.convertToTypedArray();var s=i.getAxis(this.faceInfo[2]);!function(t,e,r,i){var n=[0,0,0],a=i<0?r.getExtentMin():r.getExtentMax();n[Ac[r.dim]]=a,t.position.setArray(n),t.rotation.identity(),e.distance=-Math.abs(a),e.normal.set(0,0,0),"x"===r.dim?(t.rotation.rotateY(i*Math.PI/2),e.normal.x=-i):"z"===r.dim?(t.rotation.rotateX(-i*Math.PI/2),e.normal.y=-i):(i>0&&t.rotation.rotateY(Math.PI),e.normal.z=-i)}(this.rootNode,this.plane,s,this.faceInfo[3])},Mc.prototype._updateSplitLines=function(t,e,r,n){var a=n.getDevicePixelRatio();e.forEach(function(n,o){var s=n.model,l=e[1-o].getExtent();if(!n.scale.isBlank()){var h=s.getModel("splitLine",r.getModel("splitLine"));if(h.get("show")){var u=h.getModel("lineStyle"),c=u.get("color"),d=Ec(u.get("opacity"),1),f=Ec(u.get("width"),1);c=i.util.isArray(c)?c:[c];for(var p=n.getTicksCoords({tickModel:h}),m=0,g=0;g<p.length;g++){var _=p[g].coord,v=Wa.parseColor(c[m%c.length]);v[3]*=d;var y=[0,0,0],x=[0,0,0];y[o]=x[o]=_,y[1-o]=l[0],x[1-o]=l[1],t.addLine(y,x,v,f*a),m++}}}})},Mc.prototype._udpateSplitAreas=function(t,e,r,n){e.forEach(function(n,a){var o=n.model,s=e[1-a].getExtent();if(!n.scale.isBlank()){var l=o.getModel("splitArea",r.getModel("splitArea"));if(l.get("show")){var h=l.getModel("areaStyle"),u=h.get("color"),c=Ec(h.get("opacity"),1);u=i.util.isArray(u)?u:[u];for(var d=n.getTicksCoords({tickModel:l,clamp:!0}),f=0,p=[0,0,0],m=[0,0,0],g=0;g<d.length;g++){var _=d[g].coord,v=[0,0,0],y=[0,0,0];if(v[a]=y[a]=_,v[1-a]=s[0],y[1-a]=s[1],0!==g){var x=Wa.parseColor(u[f%u.length]);x[3]*=c,t.addQuad([p,v,y,m],x),p=v,m=y,f++}else p=v,m=y}}}})};var Cc=Mc,Dc=[0,1,2,0,2,3],Lc=gr.extend(function(){return{attributes:{position:new gr.Attribute("position","float",3,"POSITION"),texcoord:new gr.Attribute("texcoord","float",2,"TEXCOORD_0"),offset:new gr.Attribute("offset","float",2),color:new gr.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setSpriteCount:function(t){this._spriteCount=t;var e=4*t,r=2*t;this.vertexCount!==e&&(this.attributes.position.init(e),this.attributes.offset.init(e),this.attributes.color.init(e)),this.triangleCount!==r&&(this.indices=e>65535?new Uint32Array(3*r):new Uint16Array(3*r))},setSpriteAlign:function(t,e,r,i,n){var a,o,s,l;switch(null==r&&(r="left"),null==i&&(i="top"),n=n||0,r){case"left":a=n,s=e[0]+n;break;case"center":case"middle":a=-e[0]/2,s=e[0]/2;break;case"right":a=-e[0]-n,s=-n}switch(i){case"bottom":o=n,l=e[1]+n;break;case"middle":o=-e[1]/2,l=e[1]/2;break;case"top":o=-e[1]-n,l=-n}var h=4*t,u=this.attributes.offset;u.set(h,[a,l]),u.set(h+1,[s,l]),u.set(h+2,[s,o]),u.set(h+3,[a,o])},addSprite:function(t,e,r,i,n,a){var o=this._vertexOffset;this.setSprite(this._vertexOffset/4,t,e,r,i,n,a);for(var s=0;s<Dc.length;s++)this.indices[3*this._faceOffset+s]=Dc[s]+o;return this._faceOffset+=2,this._vertexOffset+=4,o/4},setSprite:function(t,e,r,i,n,a,o){for(var s=4*t,l=this.attributes,h=0;h<4;h++)l.position.set(s+h,e);var u=l.texcoord;u.set(s,[i[0][0],i[0][1]]),u.set(s+1,[i[1][0],i[0][1]]),u.set(s+2,[i[1][0],i[1][1]]),u.set(s+3,[i[0][0],i[1][1]]),this.setSpriteAlign(t,r,n,a,o)}});i.util.defaults(Lc.prototype,sc);var Pc=Lc;Wa.Shader.import("@export ecgl.labels.vertex\n\nattribute vec3 position: POSITION;\nattribute vec2 texcoord: TEXCOORD_0;\nattribute vec2 offset;\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n vec4 proj = worldViewProjection * vec4(position, 1.0);\n\n vec2 screen = (proj.xy / abs(proj.w) + 1.0) * 0.5 * viewport.zw;\n\n screen += offset;\n\n proj.xy = (screen / viewport.zw - 0.5) * 2.0 * abs(proj.w);\n gl_Position = proj;\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n v_Texcoord = texcoord;\n}\n@end\n\n\n@export ecgl.labels.fragment\n\nuniform vec3 color : [1.0, 1.0, 1.0];\nuniform float alpha : 1.0;\nuniform sampler2D textureAtlas;\nuniform vec2 uvScale: [1.0, 1.0];\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\nvarying float v_Miter;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n gl_FragColor = vec4(color, alpha) * texture2D(textureAtlas, v_Texcoord * uvScale);\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n}\n\n@end");var Nc=Wa.Mesh.extend(function(){return{geometry:new Pc({dynamic:!0}),material:new Wa.Material({shader:Wa.createShader("ecgl.labels"),transparent:!0,depthMask:!1}),culling:!1,castShadow:!1,ignorePicking:!0}}),Rc=qi.firstNotNull,Ic={x:0,y:2,z:1};function Oc(t,e){var r=new Wa.Mesh({geometry:new dc({useNativeLine:!1}),material:e,castShadow:!1,ignorePicking:!0,renderOrder:2}),i=new Nc;i.material.depthMask=!1;var n=new Wa.Node;n.add(r),n.add(i),this.rootNode=n,this.dim=t,this.linesMesh=r,this.labelsMesh=i,this.axisLineCoords=null,this.labelElements=[]}var Bc={x:"y",y:"x",z:"y"};Oc.prototype.update=function(t,e,r){var n=t.coordinateSystem.getAxis(this.dim),a=this.linesMesh.geometry,o=this.labelsMesh.geometry;a.convertToDynamicArray(!0),o.convertToDynamicArray(!0);var s=n.model,l=n.getExtent(),h=r.getDevicePixelRatio(),u=s.getModel("axisLine",t.getModel("axisLine")),c=s.getModel("axisTick",t.getModel("axisTick")),d=s.getModel("axisLabel",t.getModel("axisLabel")),f=u.get("lineStyle.color");if(u.get("show")){var p=u.getModel("lineStyle"),m=[0,0,0];(E=[0,0,0])[A=Ic[n.dim]]=l[0],m[A]=l[1],this.axisLineCoords=[E,m];var g=Wa.parseColor(f),_=Rc(p.get("width"),1),v=Rc(p.get("opacity"),1);g[3]*=v,a.addLine(E,m,g,_*h)}if(c.get("show")){var y=c.getModel("lineStyle"),x=Wa.parseColor(Rc(y.get("color"),f));_=Rc(y.get("width"),1);x[3]*=Rc(y.get("opacity"),1);for(var T=n.getTicksCoords(),b=c.get("length"),w=0;w<T.length;w++){var S=T[w].coord,E=[0,0,0],A=(m=[0,0,0],Ic[n.dim]),M=Ic[Bc[n.dim]];E[A]=m[A]=S,m[M]=b,a.addLine(E,m,x,_*h)}}this.labelElements=[];h=r.getDevicePixelRatio();if(d.get("show")){T=n.getTicksCoords();var C=s.get("data"),D=d.get("margin"),L=n.getViewLabels();for(w=0;w<L.length;w++){var P=L[w].tickValue,N=L[w].formattedLabel,R=L[w].rawLabel,I=(S=n.dataToCoord(P),[0,0,0]);A=Ic[n.dim],M=Ic[Bc[n.dim]];I[A]=I[A]=S,I[M]=D;var O=d;C&&C[P]&&C[P].textStyle&&(O=new i.Model(C[P].textStyle,d,s.ecModel));var B=Rc(O.get("color"),f),F=new i.graphic.Text({style:Qu(O,{text:N,fill:"function"==typeof B?B("category"===n.type?R:"value"===n.type?P+"":P,w):B,verticalAlign:"top",align:"left"})}),z=e.add(F),U=F.getBoundingRect();o.addSprite(I,[U.width*h,U.height*h],z),this.labelElements.push(F)}}if(s.get("name")){var k=s.getModel("nameTextStyle"),G=(I=[0,0,0],A=Ic[n.dim],M=Ic[Bc[n.dim]],Rc(k.get("color"),f)),H=k.get("borderColor");_=k.get("borderWidth");I[A]=I[A]=(l[0]+l[1])/2,I[M]=s.get("nameGap");F=new i.graphic.Text({style:Qu(k,{textFill:G,stroke:H,lineWidth:_})}),z=e.add(F),U=F.getBoundingRect();o.addSprite(I,[U.width*h,U.height*h],z),F.__idx=this.labelElements.length,this.nameLabelElement=F}this.labelsMesh.material.set("textureAtlas",e.getTexture()),this.labelsMesh.material.set("uvScale",e.getCoordsScale()),a.convertToTypedArray(),o.convertToTypedArray()},Oc.prototype.setSpriteAlign=function(t,e,r){for(var i=r.getDevicePixelRatio(),n=this.labelsMesh.geometry,a=0;a<this.labelElements.length;a++){var o=this.labelElements[a].getBoundingRect();n.setSpriteAlign(a,[o.width*i,o.height*i],t,e)}var s=this.nameLabelElement;if(s){o=s.getBoundingRect();n.setSpriteAlign(s.__idx,[o.width*i,o.height*i],t,e),n.dirty()}this.textAlign=t,this.textVerticalAlign=e};var Fc=Oc,zc="@export ecgl.lines3D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, 1.0);\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n}\n@end\n\n\n\n@export ecgl.lines3D.clipNear\n\nvec4 clipNear(vec4 p1, vec4 p2) {\n float n = (p1.w - near) / (p1.w - p2.w);\n return vec4(mix(p1.xy, p2.xy, n), -near, near);\n}\n\n@end\n\n@export ecgl.lines3D.expandLine\n#ifdef VERTEX_ANIMATION\n vec4 prevProj = worldViewProjection * vec4(mix(prevPositionPrev, positionPrev, percent), 1.0);\n vec4 currProj = worldViewProjection * vec4(mix(prevPosition, position, percent), 1.0);\n vec4 nextProj = worldViewProjection * vec4(mix(prevPositionNext, positionNext, percent), 1.0);\n#else\n vec4 prevProj = worldViewProjection * vec4(positionPrev, 1.0);\n vec4 currProj = worldViewProjection * vec4(position, 1.0);\n vec4 nextProj = worldViewProjection * vec4(positionNext, 1.0);\n#endif\n\n if (currProj.w < 0.0) {\n if (nextProj.w > 0.0) {\n currProj = clipNear(currProj, nextProj);\n }\n else if (prevProj.w > 0.0) {\n currProj = clipNear(currProj, prevProj);\n }\n }\n\n vec2 prevScreen = (prevProj.xy / abs(prevProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 currScreen = (currProj.xy / abs(currProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 nextScreen = (nextProj.xy / abs(nextProj.w) + 1.0) * 0.5 * viewport.zw;\n\n vec2 dir;\n float len = offset;\n if (position == positionPrev) {\n dir = normalize(nextScreen - currScreen);\n }\n else if (position == positionNext) {\n dir = normalize(currScreen - prevScreen);\n }\n else {\n vec2 dirA = normalize(currScreen - prevScreen);\n vec2 dirB = normalize(nextScreen - currScreen);\n\n vec2 tanget = normalize(dirA + dirB);\n\n float miter = 1.0 / max(dot(tanget, dirA), 0.5);\n len *= miter;\n dir = tanget;\n }\n\n dir = vec2(-dir.y, dir.x) * len;\n currScreen += dir;\n\n currProj.xy = (currScreen / viewport.zw - 0.5) * 2.0 * abs(currProj.w);\n@end\n\n\n@export ecgl.meshLines3D.vertex\n\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevPositionPrev;\nattribute vec3 prevPositionNext;\nuniform float percent : 1.0;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n}\n@end\n\n\n@export ecgl.meshLines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end",Uc=qi.firstNotNull;Wa.Shader.import(zc),["x","y","z"].forEach(function(t){i.extendComponentView({type:t+"Axis3D"})});var kc={x:0,y:2,z:1},Gc=(i.extendComponentView({type:"grid3D",__ecgl__:!0,init:function(t,e){var r=new Wa.Material({shader:Wa.createShader("ecgl.color"),depthMask:!1,transparent:!0}),i=new Wa.Material({shader:Wa.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});r.define("fragment","DOUBLE_SIDED"),r.define("both","VERTEX_COLOR"),this.groupGL=new Wa.Node,this._control=new oc({zr:e.getZr()}),this._control.init(),this._faces=[["y","z","x",-1,"left"],["y","z","x",1,"right"],["x","y","z",-1,"bottom"],["x","y","z",1,"top"],["x","z","y",-1,"far"],["x","z","y",1,"near"]].map(function(t){var e=new Cc(t,i,r);return this.groupGL.add(e.rootNode),e},this),this._axes=["x","y","z"].map(function(t){var e=new Fc(t,i);return this.groupGL.add(e.rootNode),e},this);var n=e.getDevicePixelRatio();this._axisLabelSurface=new mc({width:256,height:256,devicePixelRatio:n}),this._axisLabelSurface.onupdate=function(){e.getZr().refresh()},this._axisPointerLineMesh=new Wa.Mesh({geometry:new dc({useNativeLine:!1}),material:i,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new mc({width:128,height:128,devicePixelRatio:n}),this._axisPointerLabelsMesh=new Nc({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new Wa.Node,this._sceneHelper=new Tc,this._sceneHelper.initLight(this._lightRoot)},render:function(t,e,r){this._model=t,this._api=r;var i=t.coordinateSystem;i.viewGL.add(this._lightRoot),t.get("show")?i.viewGL.add(this.groupGL):i.viewGL.remove(this.groupGL);var n=this._control;n.setViewGL(i.viewGL);var a=t.getModel("viewControl");n.setFromViewControlModel(a,0),this._axisLabelSurface.clear(),n.off("update"),t.get("show")&&(this._faces.forEach(function(i){i.update(t,e,r)},this),this._axes.forEach(function(e){e.update(t,this._axisLabelSurface,r)},this)),n.on("update",this._onCameraChange.bind(this,t,r),this),this._sceneHelper.setScene(i.viewGL.scene),this._sceneHelper.updateLight(t),i.viewGL.setPostEffect(t.getModel("postEffect"),r),i.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling")),this._initMouseHandler(t)},afterRender:function(t,e,r,i){var n=i.renderer;this._sceneHelper.updateAmbientCubemap(n,t,r),this._sceneHelper.updateSkybox(n,t,r)},showAxisPointer:function(t,e,r,i){this._doShowAxisPointer(),this._updateAxisPointer(i.value)},hideAxisPointer:function(t,e,r,i){this._doHideAxisPointer()},_initMouseHandler:function(t){var e=t.coordinateSystem.viewGL;t.get("show")&&t.get("axisPointer.show")?e.on("mousemove",this._updateAxisPointerOnMousePosition,this):e.off("mousemove",this._updateAxisPointerOnMousePosition)},_updateAxisPointerOnMousePosition:function(t){if(!t.target){for(var e,r=this._model.coordinateSystem,i=r.viewGL,n=i.castRay(t.offsetX,t.offsetY,new Wa.Ray),a=0;a<this._faces.length;a++){var o=this._faces[a];if(!o.rootNode.invisible){o.plane.normal.dot(i.camera.worldTransform.z)<0&&o.plane.normal.negate();var s=n.intersectPlane(o.plane);if(s){var l=r.getAxis(o.faceInfo[0]),h=r.getAxis(o.faceInfo[1]),u=kc[o.faceInfo[0]],c=kc[o.faceInfo[1]];l.contain(s.array[u])&&h.contain(s.array[c])&&(e=s)}}}if(e){var d=r.pointToData(e.array,[],!0);this._updateAxisPointer(d),this._doShowAxisPointer()}else this._doHideAxisPointer()}},_onCameraChange:function(t,e){t.get("show")&&(this._updateFaceVisibility(),this._updateAxisLinePosition());var r=this._control;e.dispatchAction({type:"grid3DChangeCamera",alpha:r.getAlpha(),beta:r.getBeta(),distance:r.getDistance(),center:r.getCenter(),from:this.uid,grid3DId:t.id})},_updateFaceVisibility:function(){var t=this._control.getCamera(),e=new Wa.Vector3;t.update();for(var r=0;r<this._faces.length/2;r++){for(var i=[],n=0;n<2;n++){this._faces[2*r+n].rootNode.getWorldPosition(e),e.transformMat4(t.viewMatrix),i[n]=e.z}var a=i[0]>i[1]?0:1,o=this._faces[2*r+a],s=this._faces[2*r+1-a];o.rootNode.invisible=!0,s.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var t=this._model.coordinateSystem,e=t.getAxis("x"),r=t.getAxis("y"),i=t.getAxis("z"),n=i.getExtentMax(),a=i.getExtentMin(),o=e.getExtentMin(),s=e.getExtentMax(),l=r.getExtentMax(),h=r.getExtentMin(),u=this._axes[0].rootNode,c=this._axes[1].rootNode,d=this._axes[2].rootNode,f=this._faces,p=f[4].rootNode.invisible?h:l,m=f[2].rootNode.invisible?n:a,g=f[0].rootNode.invisible?o:s,_=f[2].rootNode.invisible?n:a,v=f[0].rootNode.invisible?s:o,y=f[4].rootNode.invisible?h:l;u.rotation.identity(),c.rotation.identity(),d.rotation.identity(),f[4].rootNode.invisible&&(this._axes[0].flipped=!0,u.rotation.rotateX(Math.PI)),f[0].rootNode.invisible&&(this._axes[1].flipped=!0,c.rotation.rotateZ(Math.PI)),f[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),u.position.set(0,m,p),c.position.set(g,_,0),d.position.set(v,0,y),u.update(),c.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var t=this._control.getCamera(),e=[new Wa.Vector4,new Wa.Vector4],r=new Wa.Vector4;this.groupGL.getWorldPosition(r),r.w=1,r.transformMat4(t.viewMatrix).transformMat4(t.projectionMatrix),r.x/=r.w,r.y/=r.w,this._axes.forEach(function(i){for(var n=i.axisLineCoords,a=(i.labelsMesh.geometry,0);a<e.length;a++)e[a].setArray(n[a]),e[a].w=1,e[a].transformMat4(i.rootNode.worldTransform).transformMat4(t.viewMatrix).transformMat4(t.projectionMatrix),e[a].x/=e[a].w,e[a].y/=e[a].w;var o,s,l=e[1].x-e[0].x,h=e[1].y-e[0].y,u=(e[1].x+e[0].x)/2,c=(e[1].y+e[0].y)/2;Math.abs(h/l)<.5?(o="center",s=c>r.y?"bottom":"top"):(s="middle",o=u>r.x?"left":"right"),i.setSpriteAlign(o,s,this._api)},this)},_doShowAxisPointer:function(){this._axisPointerLineMesh.invisible&&(this._axisPointerLineMesh.invisible=!1,this._axisPointerLabelsMesh.invisible=!1,this._api.getZr().refresh())},_doHideAxisPointer:function(){this._axisPointerLineMesh.invisible||(this._axisPointerLineMesh.invisible=!0,this._axisPointerLabelsMesh.invisible=!0,this._api.getZr().refresh())},_updateAxisPointer:function(t){var e=this._model.coordinateSystem,r=e.dataToPoint(t),i=this._axisPointerLineMesh.geometry,n=this._model.getModel("axisPointer"),a=this._api.getDevicePixelRatio();function o(t){return qi.firstNotNull(t.model.get("axisPointer.show"),n.get("show"))}function s(t){var e=t.model.getModel("axisPointer",n).getModel("lineStyle"),r=Wa.parseColor(e.get("color")),i=Uc(e.get("width"),1),a=Uc(e.get("opacity"),1);return r[3]*=a,{color:r,lineWidth:i}}i.convertToDynamicArray(!0);for(var l=0;l<this._faces.length;l++){var h=this._faces[l];if(!h.rootNode.invisible){for(var u=h.faceInfo,c=u[3]<0?e.getAxis(u[2]).getExtentMin():e.getAxis(u[2]).getExtentMax(),d=kc[u[2]],f=0;f<2;f++){var p=u[f],m=u[1-f],g=e.getAxis(p),_=e.getAxis(m);if(o(g)){var v=kc[p],y=kc[m];(b=[0,0,0])[v]=(T=[0,0,0])[v]=r[v],b[d]=T[d]=c,b[y]=_.getExtentMin(),T[y]=_.getExtentMax();var x=s(g);i.addLine(b,T,x.color,x.lineWidth*a)}}if(o(e.getAxis(u[2]))){var T,b=r.slice();(T=r.slice())[d]=c;x=s(e.getAxis(u[2]));i.addLine(b,T,x.color,x.lineWidth*a)}}}i.convertToTypedArray(),this._updateAxisPointerLabelsMesh(t),this._api.getZr().refresh()},_updateAxisPointerLabelsMesh:function(t){var e=this._model,r=this._axisPointerLabelsMesh,n=this._axisPointerLabelsSurface,a=e.coordinateSystem,o=e.getModel("axisPointer");r.geometry.convertToDynamicArray(!0),n.clear();var s={x:"y",y:"x",z:"y"};this._axes.forEach(function(e,l){var h=a.getAxis(e.dim),u=h.model.getModel("axisPointer",o),c=u.getModel("label"),d=u.get("lineStyle.color");if(c.get("show")&&u.get("show")){var f=t[l],p=c.get("formatter"),m=h.scale.getLabel({value:f});if(null!=p)m=p(m,t);else if("interval"===h.scale.type||"log"===h.scale.type){var g=i.number.getPrecisionSafe(h.scale.getTicks()[0]);m=f.toFixed(g+2)}var _=c.getModel("textStyle"),v=_.get("color"),y=new i.graphic.Text({style:Qu(_,{text:m,fill:v||d,align:"left",verticalAlign:"top"})}),x=n.add(y),T=y.getBoundingRect(),b=this._api.getDevicePixelRatio(),w=e.rootNode.position.toArray();w[kc[s[e.dim]]]+=(e.flipped?-1:1)*c.get("margin"),w[kc[e.dim]]=h.dataToCoord(t[l]),r.geometry.addSprite(w,[T.width*b,T.height*b],x,e.textAlign,e.textVerticalAlign)}},this),n.getZr().refreshImmediately(),r.material.set("uvScale",n.getCoordsScale()),r.geometry.convertToTypedArray()},dispose:function(){this.groupGL.removeAll(),this._control.dispose()}}),function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return ta(this._dimList,function(t){return this._axes[t]},this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),function(t,e,r){if(!t)return[];if(!e)return da(t);if(t.filter&&t.filter===Fn)return t.filter(e,r);for(var i=[],n=0,a=t.length;n<a;n++)e.call(r,t[n],n,t)&&i.push(t[n]);return i}(this.getAxes(),function(e){return e.scale.type===t})},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}());function Hc(t){Gc.call(this,t),this.type="cartesian3D",this.dimensions=["x","y","z"],this.size=[0,0,0]}Hc.prototype={constructor:Hc,model:null,containPoint:function(t){return this.getAxis("x").contain(t[0])&&this.getAxis("y").contain(t[2])&&this.getAxis("z").contain(t[1])},containData:function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])&&this.getAxis("z").containData(t[2])},dataToPoint:function(t,e,r){return(e=e||[])[0]=this.getAxis("x").dataToCoord(t[0],r),e[2]=this.getAxis("y").dataToCoord(t[1],r),e[1]=this.getAxis("z").dataToCoord(t[2],r),e},pointToData:function(t,e,r){return(e=e||[])[0]=this.getAxis("x").coordToData(t[0],r),e[1]=this.getAxis("y").coordToData(t[2],r),e[2]=this.getAxis("z").coordToData(t[1],r),e}},i.util.inherits(Hc,Gc);var Vc=Hc;function Wc(t,e,r){i.Axis.call(this,t,e,r)}Wc.prototype={constructor:Wc,getExtentMin:function(){var t=this._extent;return Math.min(t[0],t[1])},getExtentMax:function(){var t=this._extent;return Math.max(t[0],t[1])},calculateCategoryInterval:function(){return Math.floor(this.scale.count()/8)}},i.util.inherits(Wc,i.Axis);var Xc=Wc;
16/*! *****************************************************************************
17Copyright (c) Microsoft Corporation. All rights reserved.
18Licensed under the Apache License, Version 2.0 (the "License"); you may not use

Callers 2

wuFunction · 0.85
L7-min.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected