import{V as ox,d as Kb,s as Ah,i as dl,t as jb,c as _a,g as Qb,w as pl,a as Gg,o as Jb,b as tA,h as eA,n as rA,u as iA}from"./index-8450f0d6.js";var Lv=ox;ox.util.warn;/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Rv=function(t,e){return Rv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},Rv(t,e)};function G(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Rv(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var nA=function(){function t(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return t}(),aA=function(){function t(){this.browser=new nA,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return t}(),Hn=new aA;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(Hn.wxa=!0,Hn.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?Hn.worker=!0:typeof navigator>"u"?(Hn.node=!0,Hn.svgSupported=!0):oA(navigator.userAgent,Hn);function oA(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],r.newEdge=+a[1].split(".")[0]>18),o&&(r.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11),e.domSupported=typeof document<"u";var s=document.documentElement.style;e.transform3dSupported=(r.ie&&"transition"in s||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||r.ie&&+r.version>=9}const At=Hn;var ip=12,sx="sans-serif",nn=ip+"px "+sx,sA=20,lA=100,uA="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function fA(t){var e={};if(typeof JSON>"u")return e;for(var r=0;r<t.length;r++){var i=String.fromCharCode(r+32),n=(t.charCodeAt(r)-sA)/lA;e[i]=n}return e}var hA=fA(uA),xo={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:function(){var t,e;return function(r,i){if(!t){var n=xo.createCanvas();t=n&&n.getContext("2d")}if(t)return e!==i&&(e=t.font=i||nn),t.measureText(r);r=r||"",i=i||nn;var a=/(\d+)px/.exec(i),o=a&&+a[1]||ip,s=0;if(i.indexOf("mono")>=0)s=o*r.length;else for(var l=0;l<r.length;l++){var u=hA[r[l]];s+=u==null?o:u*o}return{width:s}}}(),loadImage:function(t,e,r){var i=new Image;return i.onload=e,i.onerror=r,i.src=t,i}},lx=ha(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(t,e){return t["[object "+e+"]"]=!0,t},{}),ux=ha(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(t,e){return t["[object "+e+"Array]"]=!0,t},{}),el=Object.prototype.toString,Ff=Array.prototype,cA=Ff.forEach,vA=Ff.filter,np=Ff.slice,dA=Ff.map,Wg=(function(){}).constructor,gl=Wg?Wg.prototype:null,ap="__proto__",pA=2311;function fx(){return pA++}function op(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];typeof console<"u"&&console.error.apply(console,t)}function ft(t){if(t==null||typeof t!="object")return t;var e=t,r=el.call(t);if(r==="[object Array]"){if(!ms(t)){e=[];for(var i=0,n=t.length;i<n;i++)e[i]=ft(t[i])}}else if(ux[r]){if(!ms(t)){var a=t.constructor;if(a.from)e=a.from(t);else{e=new a(t.length);for(var i=0,n=t.length;i<n;i++)e[i]=t[i]}}}else if(!lx[r]&&!ms(t)&&!Vu(t)){e={};for(var o in t)t.hasOwnProperty(o)&&o!==ap&&(e[o]=ft(t[o]))}return e}function dt(t,e,r){if(!j(e)||!j(t))return r?ft(e):t;for(var i in e)if(e.hasOwnProperty(i)&&i!==ap){var n=t[i],a=e[i];j(a)&&j(n)&&!X(a)&&!X(n)&&!Vu(a)&&!Vu(n)&&!Xg(a)&&!Xg(n)&&!ms(a)&&!ms(n)?dt(n,a,r):(r||!(i in t))&&(t[i]=ft(e[i]))}return t}function U(t,e){if(Object.assign)Object.assign(t,e);else for(var r in e)e.hasOwnProperty(r)&&r!==ap&&(t[r]=e[r]);return t}function Lt(t,e,r){for(var i=yt(e),n=0;n<i.length;n++){var a=i[n];(r?e[a]!=null:t[a]==null)&&(t[a]=e[a])}return t}function Dt(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r}return-1}function sp(t,e){var r=t.prototype;function i(){}i.prototype=e.prototype,t.prototype=new i;for(var n in r)r.hasOwnProperty(n)&&(t.prototype[n]=r[n]);t.prototype.constructor=t,t.superClass=e}function qr(t,e,r){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var i=Object.getOwnPropertyNames(e),n=0;n<i.length;n++){var a=i[n];a!=="constructor"&&(r?e[a]!=null:t[a]==null)&&(t[a]=e[a])}else Lt(t,e,r)}function $e(t){return!t||typeof t=="string"?!1:typeof t.length=="number"}function M(t,e,r){if(t&&e)if(t.forEach&&t.forEach===cA)t.forEach(e,r);else if(t.length===+t.length)for(var i=0,n=t.length;i<n;i++)e.call(r,t[i],i,t);else for(var a in t)t.hasOwnProperty(a)&&e.call(r,t[a],a,t)}function K(t,e,r){if(!t)return[];if(!e)return lp(t);if(t.map&&t.map===dA)return t.map(e,r);for(var i=[],n=0,a=t.length;n<a;n++)i.push(e.call(r,t[n],n,t));return i}function ha(t,e,r,i){if(t&&e){for(var n=0,a=t.length;n<a;n++)r=e.call(i,r,t[n],n,t);return r}}function ce(t,e,r){if(!t)return[];if(!e)return lp(t);if(t.filter&&t.filter===vA)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}function yt(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e}function gA(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return function(){return t.apply(e,r.concat(np.call(arguments)))}}var et=gl&&ct(gl.bind)?gl.call.bind(gl.bind):gA;function de(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return function(){return t.apply(this,e.concat(np.call(arguments)))}}function X(t){return Array.isArray?Array.isArray(t):el.call(t)==="[object Array]"}function ct(t){return typeof t=="function"}function Z(t){return typeof t=="string"}function Pv(t){return el.call(t)==="[object String]"}function Qt(t){return typeof t=="number"}function j(t){var e=typeof t;return e==="function"||!!t&&e==="object"}function Xg(t){return!!lx[el.call(t)]}function cr(t){return!!ux[el.call(t)]}function Vu(t){return typeof t=="object"&&typeof t.nodeType=="number"&&typeof t.ownerDocument=="object"}function kf(t){return t.colorStops!=null}function mA(t){return t.image!=null}function Gu(t){return t!==t}function fo(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0,i=t.length;r<i;r++)if(t[r]!=null)return t[r]}function mt(t,e){return t??e}function gu(t,e,r){return t??e??r}function lp(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return np.apply(t,e)}function hx(t){if(typeof t=="number")return[t,t,t,t];var e=t.length;return e===2?[t[0],t[1],t[0],t[1]]:e===3?[t[0],t[1],t[2],t[1]]:t}function Rr(t,e){if(!t)throw new Error(e)}function li(t){return t==null?null:typeof t.trim=="function"?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var cx="__ec_primitive__";function Wu(t){t[cx]=!0}function ms(t){return t[cx]}var _A=function(){function t(){this.data={}}return t.prototype.delete=function(e){var r=this.has(e);return r&&delete this.data[e],r},t.prototype.has=function(e){return this.data.hasOwnProperty(e)},t.prototype.get=function(e){return this.data[e]},t.prototype.set=function(e,r){return this.data[e]=r,this},t.prototype.keys=function(){return yt(this.data)},t.prototype.forEach=function(e){var r=this.data;for(var i in r)r.hasOwnProperty(i)&&e(r[i],i)},t}(),vx=typeof Map=="function";function yA(){return vx?new Map:new _A}var xA=function(){function t(e){var r=X(e);this.data=yA();var i=this;e instanceof t?e.each(n):e&&M(e,n);function n(a,o){r?i.set(a,o):i.set(o,a)}}return t.prototype.hasKey=function(e){return this.data.has(e)},t.prototype.get=function(e){return this.data.get(e)},t.prototype.set=function(e,r){return this.data.set(e,r),r},t.prototype.each=function(e,r){this.data.forEach(function(i,n){e.call(r,i,n)})},t.prototype.keys=function(){var e=this.data.keys();return vx?Array.from(e):e},t.prototype.removeKey=function(e){this.data.delete(e)},t}();function ht(t){return new xA(t)}function TA(t,e){for(var r=new t.constructor(t.length+e.length),i=0;i<t.length;i++)r[i]=t[i];for(var n=t.length,i=0;i<e.length;i++)r[i+n]=e[i];return r}function zf(t,e){var r;if(Object.create)r=Object.create(t);else{var i=function(){};i.prototype=t,r=new i}return e&&U(r,e),r}function dx(t){var e=t.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function _t(t,e){return t.hasOwnProperty(e)}function De(){}var mu=180/Math.PI;function To(t,e){return t==null&&(t=0),e==null&&(e=0),[t,e]}function SA(t){return[t[0],t[1]]}function Yg(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function wA(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function bA(t){return Math.sqrt(AA(t))}function AA(t){return t[0]*t[0]+t[1]*t[1]}function Eh(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function EA(t,e){var r=bA(e);return r===0?(t[0]=0,t[1]=0):(t[0]=e[0]/r,t[1]=e[1]/r),t}function Iv(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var Nv=Iv;function CA(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var ro=CA;function Ch(t,e,r,i){return t[0]=e[0]+i*(r[0]-e[0]),t[1]=e[1]+i*(r[1]-e[1]),t}function Lr(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 $a(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function Za(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}var ya=function(){function t(e,r){this.target=e,this.topTarget=r&&r.topTarget}return t}(),MA=function(){function t(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return t.prototype._dragStart=function(e){for(var r=e.target;r&&!r.draggable;)r=r.parent||r.__hostTarget;r&&(this._draggingTarget=r,r.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new ya(r,e),"dragstart",e.event))},t.prototype._drag=function(e){var r=this._draggingTarget;if(r){var i=e.offsetX,n=e.offsetY,a=i-this._x,o=n-this._y;this._x=i,this._y=n,r.drift(a,o,e),this.handler.dispatchToElement(new ya(r,e),"drag",e.event);var s=this.handler.findHover(i,n,r).target,l=this._dropTarget;this._dropTarget=s,r!==s&&(l&&s!==l&&this.handler.dispatchToElement(new ya(l,e),"dragleave",e.event),s&&s!==l&&this.handler.dispatchToElement(new ya(s,e),"dragenter",e.event))}},t.prototype._dragEnd=function(e){var r=this._draggingTarget;r&&(r.dragging=!1),this.handler.dispatchToElement(new ya(r,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new ya(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},t}();const DA=MA;var LA=function(){function t(e){e&&(this._$eventProcessor=e)}return t.prototype.on=function(e,r,i,n){this._$handlers||(this._$handlers={});var a=this._$handlers;if(typeof r=="function"&&(n=i,i=r,r=null),!i||!e)return this;var o=this._$eventProcessor;r!=null&&o&&o.normalizeQuery&&(r=o.normalizeQuery(r)),a[e]||(a[e]=[]);for(var s=0;s<a[e].length;s++)if(a[e][s].h===i)return this;var l={h:i,query:r,ctx:n||this,callAtLast:i.zrEventfulCallAtLast},u=a[e].length-1,f=a[e][u];return f&&f.callAtLast?a[e].splice(u,0,l):a[e].push(l),this},t.prototype.isSilent=function(e){var r=this._$handlers;return!r||!r[e]||!r[e].length},t.prototype.off=function(e,r){var i=this._$handlers;if(!i)return this;if(!e)return this._$handlers={},this;if(r){if(i[e]){for(var n=[],a=0,o=i[e].length;a<o;a++)i[e][a].h!==r&&n.push(i[e][a]);i[e]=n}i[e]&&i[e].length===0&&delete i[e]}else delete i[e];return this},t.prototype.trigger=function(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];if(!this._$handlers)return this;var n=this._$handlers[e],a=this._$eventProcessor;if(n)for(var o=r.length,s=n.length,l=0;l<s;l++){var u=n[l];if(!(a&&a.filter&&u.query!=null&&!a.filter(e,u.query)))switch(o){case 0:u.h.call(u.ctx);break;case 1:u.h.call(u.ctx,r[0]);break;case 2:u.h.call(u.ctx,r[0],r[1]);break;default:u.h.apply(u.ctx,r);break}}return a&&a.afterTrigger&&a.afterTrigger(e),this},t.prototype.triggerWithContext=function(e){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];if(!this._$handlers)return this;var n=this._$handlers[e],a=this._$eventProcessor;if(n)for(var o=r.length,s=r[o-1],l=n.length,u=0;u<l;u++){var f=n[u];if(!(a&&a.filter&&f.query!=null&&!a.filter(e,f.query)))switch(o){case 0:f.h.call(s);break;case 1:f.h.call(s,r[0]);break;case 2:f.h.call(s,r[0],r[1]);break;default:f.h.apply(s,r.slice(1,o-1));break}}return a&&a.afterTrigger&&a.afterTrigger(e),this},t}();const Kr=LA;var RA=Math.log(2);function Ov(t,e,r,i,n,a){var o=i+"-"+n,s=t.length;if(a.hasOwnProperty(o))return a[o];if(e===1){var l=Math.round(Math.log((1<<s)-1&~n)/RA);return t[r][l]}for(var u=i|1<<r,f=r+1;i&1<<f;)f++;for(var h=0,v=0,c=0;v<s;v++){var d=1<<v;d&n||(h+=(c%2?-1:1)*t[r][v]*Ov(t,e-1,f,u,n|d,a),c++)}return a[o]=h,h}function $g(t,e){var r=[[t[0],t[1],1,0,0,0,-e[0]*t[0],-e[0]*t[1]],[0,0,0,t[0],t[1],1,-e[1]*t[0],-e[1]*t[1]],[t[2],t[3],1,0,0,0,-e[2]*t[2],-e[2]*t[3]],[0,0,0,t[2],t[3],1,-e[3]*t[2],-e[3]*t[3]],[t[4],t[5],1,0,0,0,-e[4]*t[4],-e[4]*t[5]],[0,0,0,t[4],t[5],1,-e[5]*t[4],-e[5]*t[5]],[t[6],t[7],1,0,0,0,-e[6]*t[6],-e[6]*t[7]],[0,0,0,t[6],t[7],1,-e[7]*t[6],-e[7]*t[7]]],i={},n=Ov(r,8,0,0,0,i);if(n!==0){for(var a=[],o=0;o<8;o++)for(var s=0;s<8;s++)a[s]==null&&(a[s]=0),a[s]+=((o+s)%2?-1:1)*Ov(r,7,o===0?1:0,1<<o,1<<s,i)/n*e[o];return function(l,u,f){var h=u*a[6]+f*a[7]+1;l[0]=(u*a[0]+f*a[1]+a[2])/h,l[1]=(u*a[3]+f*a[4]+a[5])/h}}}var Zg="___zrEVENTSAVED",Mh=[];function PA(t,e,r,i,n){return Bv(Mh,e,i,n,!0)&&Bv(t,r,Mh[0],Mh[1])}function Bv(t,e,r,i,n){if(e.getBoundingClientRect&&At.domSupported&&!px(e)){var a=e[Zg]||(e[Zg]={}),o=IA(e,a),s=NA(o,a,n);if(s)return s(t,r,i),!0}return!1}function IA(t,e){var r=e.markers;if(r)return r;r=e.markers=[];for(var i=["left","right"],n=["top","bottom"],a=0;a<4;a++){var o=document.createElement("div"),s=o.style,l=a%2,u=(a>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",n[u]+":0",i[1-l]+":auto",n[1-u]+":auto",""].join("!important;"),t.appendChild(o),r.push(o)}return r}function NA(t,e,r){for(var i=r?"invTrans":"trans",n=e[i],a=e.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var f=t[u].getBoundingClientRect(),h=2*u,v=f.left,c=f.top;o.push(v,c),l=l&&a&&v===a[h]&&c===a[h+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&n?n:(e.srcCoords=o,e[i]=r?$g(s,o):$g(o,s))}function px(t){return t.nodeName.toUpperCase()==="CANVAS"}var OA=/([&<>"'])/g,BA={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Me(t){return t==null?"":(t+"").replace(OA,function(e,r){return BA[r]})}var FA=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Dh=[],kA=At.browser.firefox&&+At.browser.version.split(".")[0]<39;function Fv(t,e,r,i){return r=r||{},i?qg(t,e,r):kA&&e.layerX!=null&&e.layerX!==e.offsetX?(r.zrX=e.layerX,r.zrY=e.layerY):e.offsetX!=null?(r.zrX=e.offsetX,r.zrY=e.offsetY):qg(t,e,r),r}function qg(t,e,r){if(At.domSupported&&t.getBoundingClientRect){var i=e.clientX,n=e.clientY;if(px(t)){var a=t.getBoundingClientRect();r.zrX=i-a.left,r.zrY=n-a.top;return}else if(Bv(Dh,t,i,n)){r.zrX=Dh[0],r.zrY=Dh[1];return}}r.zrX=r.zrY=0}function up(t){return t||window.event}function yr(t,e,r){if(e=up(e),e.zrX!=null)return e;var i=e.type,n=i&&i.indexOf("touch")>=0;if(n){var o=i!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&Fv(t,o,e,r)}else{Fv(t,e,e,r);var a=zA(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&FA.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function zA(t){var e=t.wheelDelta;if(e)return e;var r=t.deltaX,i=t.deltaY;if(r==null||i==null)return e;var n=Math.abs(i!==0?i:r),a=i>0?-1:i<0?1:r>0?-1:1;return 3*n*a}function UA(t,e,r,i){t.addEventListener(e,r,i)}function HA(t,e,r,i){t.removeEventListener(e,r,i)}var Ei=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function Kg(t){return t.which===2||t.which===3}var VA=function(){function t(){this._track=[]}return t.prototype.recognize=function(e,r,i){return this._doTrack(e,r,i),this._recognize(e)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(e,r,i){var n=e.touches;if(n){for(var a={points:[],touches:[],target:r,event:e},o=0,s=n.length;o<s;o++){var l=n[o],u=Fv(i,l,{});a.points.push([u.zrX,u.zrY]),a.touches.push(l)}this._track.push(a)}},t.prototype._recognize=function(e){for(var r in Lh)if(Lh.hasOwnProperty(r)){var i=Lh[r](this._track,e);if(i)return i}},t}();function jg(t){var e=t[1][0]-t[0][0],r=t[1][1]-t[0][1];return Math.sqrt(e*e+r*r)}function GA(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}var Lh={pinch:function(t,e){var r=t.length;if(r){var i=(t[r-1]||{}).points,n=(t[r-2]||{}).points||i;if(n&&n.length>1&&i&&i.length>1){var a=jg(i)/jg(n);!isFinite(a)&&(a=1),e.pinchScale=a;var o=GA(i);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:t[0].target,event:e}}}}};function Rs(){return[1,0,0,1,0,0]}function fp(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function WA(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 io(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 kv(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 hp(t,e,r){var i=e[0],n=e[2],a=e[4],o=e[1],s=e[3],l=e[5],u=Math.sin(r),f=Math.cos(r);return t[0]=i*f+o*u,t[1]=-i*u+o*f,t[2]=n*f+s*u,t[3]=-n*u+f*s,t[4]=f*a+u*l,t[5]=f*l-u*a,t}function XA(t,e,r){var i=r[0],n=r[1];return 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,t}function Uf(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 YA=function(){function t(e,r){this.x=e||0,this.y=r||0}return t.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(e,r){return this.x=e,this.y=r,this},t.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},t.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},t.prototype.scale=function(e){this.x*=e,this.y*=e},t.prototype.scaleAndAdd=function(e,r){this.x+=e.x*r,this.y+=e.y*r},t.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},t.prototype.dot=function(e){return this.x*e.x+this.y*e.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 e=this.len();return this.x/=e,this.y/=e,this},t.prototype.distance=function(e){var r=this.x-e.x,i=this.y-e.y;return Math.sqrt(r*r+i*i)},t.prototype.distanceSquare=function(e){var r=this.x-e.x,i=this.y-e.y;return r*r+i*i},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(e){if(e){var r=this.x,i=this.y;return this.x=e[0]*r+e[2]*i+e[4],this.y=e[1]*r+e[3]*i+e[5],this}},t.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},t.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},t.set=function(e,r,i){e.x=r,e.y=i},t.copy=function(e,r){e.x=r.x,e.y=r.y},t.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},t.lenSquare=function(e){return e.x*e.x+e.y*e.y},t.dot=function(e,r){return e.x*r.x+e.y*r.y},t.add=function(e,r,i){e.x=r.x+i.x,e.y=r.y+i.y},t.sub=function(e,r,i){e.x=r.x-i.x,e.y=r.y-i.y},t.scale=function(e,r,i){e.x=r.x*i,e.y=r.y*i},t.scaleAndAdd=function(e,r,i,n){e.x=r.x+i.x*n,e.y=r.y+i.y*n},t.lerp=function(e,r,i,n){var a=1-n;e.x=a*r.x+n*i.x,e.y=a*r.y+n*i.y},t}();const wt=YA;var ml=Math.min,_l=Math.max,un=new wt,fn=new wt,hn=new wt,cn=new wt,Co=new wt,Mo=new wt,$A=function(){function t(e,r,i,n){i<0&&(e=e+i,i=-i),n<0&&(r=r+n,n=-n),this.x=e,this.y=r,this.width=i,this.height=n}return t.prototype.union=function(e){var r=ml(e.x,this.x),i=ml(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=_l(e.x+e.width,this.x+this.width)-r:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=_l(e.y+e.height,this.y+this.height)-i:this.height=e.height,this.x=r,this.y=i},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(e){var r=this,i=e.width/r.width,n=e.height/r.height,a=Rs();return kv(a,a,[-r.x,-r.y]),XA(a,a,[i,n]),kv(a,a,[e.x,e.y]),a},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,u=e.x+e.width,f=e.y,h=e.y+e.height,v=!(a<l||u<n||s<f||h<o);if(r){var c=1/0,d=0,p=Math.abs(a-l),g=Math.abs(u-n),m=Math.abs(s-f),_=Math.abs(h-o),y=Math.min(p,g),x=Math.min(m,_);a<l||u<n?y>d&&(d=y,p<g?wt.set(Mo,-p,0):wt.set(Mo,g,0)):y<c&&(c=y,p<g?wt.set(Co,p,0):wt.set(Co,-g,0)),s<f||h<o?x>d&&(d=x,m<_?wt.set(Mo,0,-m):wt.set(Mo,0,_)):y<c&&(c=y,m<_?wt.set(Co,0,m):wt.set(Co,0,-_))}return r&&wt.copy(r,v?Co:Mo),v},t.prototype.contain=function(e,r){var i=this;return e>=i.x&&e<=i.x+i.width&&r>=i.y&&r<=i.y+i.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 this.width===0||this.height===0},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(e,r){e.x=r.x,e.y=r.y,e.width=r.width,e.height=r.height},t.applyTransform=function(e,r,i){if(!i){e!==r&&t.copy(e,r);return}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];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),e.height<0&&(e.y+=e.height,e.height=-e.height);return}un.x=hn.x=r.x,un.y=cn.y=r.y,fn.x=cn.x=r.x+r.width,fn.y=hn.y=r.y+r.height,un.transform(i),cn.transform(i),fn.transform(i),hn.transform(i),e.x=ml(un.x,fn.x,hn.x,cn.x),e.y=ml(un.y,fn.y,hn.y,cn.y);var l=_l(un.x,fn.x,hn.x,cn.x),u=_l(un.y,fn.y,hn.y,cn.y);e.width=l-e.x,e.height=u-e.y},t}();const Nt=$A;var gx="silent";function ZA(t,e,r){return{type:t,event:r,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:r.zrX,offsetY:r.zrY,gestureEvent:r.gestureEvent,pinchX:r.pinchX,pinchY:r.pinchY,pinchScale:r.pinchScale,wheelDelta:r.zrDelta,zrByTouch:r.zrByTouch,which:r.which,stop:qA}}function qA(){Ei(this.event)}var KA=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.handler=null,r}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(Kr),Do=function(){function t(e,r){this.x=e,this.y=r}return t}(),jA=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Rh=new Nt(0,0,0,0),mx=function(t){G(e,t);function e(r,i,n,a,o){var s=t.call(this)||this;return s._hovered=new Do(0,0),s.storage=r,s.painter=i,s.painterRoot=a,s._pointerSize=o,n=n||new KA,s.proxy=null,s.setHandlerProxy(n),s._draggingMgr=new DA(s),s}return e.prototype.setHandlerProxy=function(r){this.proxy&&this.proxy.dispose(),r&&(M(jA,function(i){r.on&&r.on(i,this[i],this)},this),r.handler=this),this.proxy=r},e.prototype.mousemove=function(r){var i=r.zrX,n=r.zrY,a=_x(this,i,n),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=a?new Do(i,n):this.findHover(i,n),u=l.target,f=this.proxy;f.setCursor&&f.setCursor(u?u.cursor:"default"),s&&u!==s&&this.dispatchToElement(o,"mouseout",r),this.dispatchToElement(l,"mousemove",r),u&&u!==s&&this.dispatchToElement(l,"mouseover",r)},e.prototype.mouseout=function(r){var i=r.zrEventControl;i!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",r),i!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:r})},e.prototype.resize=function(){this._hovered=new Do(0,0)},e.prototype.dispatch=function(r,i){var n=this[r];n&&n.call(this,i)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(r){var i=this.proxy;i.setCursor&&i.setCursor(r)},e.prototype.dispatchToElement=function(r,i,n){r=r||{};var a=r.target;if(!(a&&a.silent)){for(var o="on"+i,s=ZA(i,r,n);a&&(a[o]&&(s.cancelBubble=!!a[o].call(a,s)),a.trigger(i,s),a=a.__hostTarget?a.__hostTarget:a.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(i,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(i,s)}))}},e.prototype.findHover=function(r,i,n){var a=this.storage.getDisplayList(),o=new Do(r,i);if(Qg(a,o,r,i,n),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,u=l/2,f=new Nt(r-u,i-u,l,l),h=a.length-1;h>=0;h--){var v=a[h];v!==n&&!v.ignore&&!v.ignoreCoarsePointer&&(!v.parent||!v.parent.ignoreCoarsePointer)&&(Rh.copy(v.getBoundingRect()),v.transform&&Rh.applyTransform(v.transform),Rh.intersect(f)&&s.push(v))}if(s.length)for(var c=4,d=Math.PI/12,p=Math.PI*2,g=0;g<u;g+=c)for(var m=0;m<p;m+=d){var _=r+g*Math.cos(m),y=i+g*Math.sin(m);if(Qg(s,o,_,y,n),o.target)return o}}return o},e.prototype.processGesture=function(r,i){this._gestureMgr||(this._gestureMgr=new VA);var n=this._gestureMgr;i==="start"&&n.clear();var a=n.recognize(r,this.findHover(r.zrX,r.zrY,null).target,this.proxy.dom);if(i==="end"&&n.clear(),a){var o=a.type;r.gestureEvent=o;var s=new Do;s.target=a.target,this.dispatchToElement(s,o,a.event)}},e}(Kr);M(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){mx.prototype[t]=function(e){var r=e.zrX,i=e.zrY,n=_x(this,r,i),a,o;if((t!=="mouseup"||!n)&&(a=this.findHover(r,i),o=a.target),t==="mousedown")this._downEl=o,this._downPoint=[e.zrX,e.zrY],this._upEl=o;else if(t==="mouseup")this._upEl=o;else if(t==="click"){if(this._downEl!==this._upEl||!this._downPoint||Nv(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(a,t,e)}});function QA(t,e,r){if(t[t.rectHover?"rectContain":"contain"](e,r)){for(var i=t,n=void 0,a=!1;i;){if(i.ignoreClip&&(a=!0),!a){var o=i.getClipPath();if(o&&!o.contain(e,r))return!1;i.silent&&(n=!0)}var s=i.__hostTarget;i=s||i.parent}return n?gx:!0}return!1}function Qg(t,e,r,i,n){for(var a=t.length-1;a>=0;a--){var o=t[a],s=void 0;if(o!==n&&!o.ignore&&(s=QA(o,r,i))&&(!e.topTarget&&(e.topTarget=o),s!==gx)){e.target=o;break}}}function _x(t,e,r){var i=t.painter;return e<0||e>i.getWidth()||r<0||r>i.getHeight()}const JA=mx;var yx=32,Lo=7;function tE(t){for(var e=0;t>=yx;)e|=t&1,t>>=1;return t+e}function Jg(t,e,r,i){var n=e+1;if(n===r)return 1;if(i(t[n++],t[e])<0){for(;n<r&&i(t[n],t[n-1])<0;)n++;eE(t,e,n)}else for(;n<r&&i(t[n],t[n-1])>=0;)n++;return n-e}function eE(t,e,r){for(r--;e<r;){var i=t[e];t[e++]=t[r],t[r--]=i}}function tm(t,e,r,i,n){for(i===e&&i++;i<r;i++){for(var a=t[i],o=e,s=i,l;o<s;)l=o+s>>>1,n(a,t[l])<0?s=l:o=l+1;var u=i-o;switch(u){case 3:t[o+3]=t[o+2];case 2:t[o+2]=t[o+1];case 1:t[o+1]=t[o];break;default:for(;u>0;)t[o+u]=t[o+u-1],u--}t[o]=a}}function Ph(t,e,r,i,n,a){var o=0,s=0,l=1;if(a(t,e[r+n])>0){for(s=i-n;l<s&&a(t,e[r+n+l])>0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}else{for(s=n+1;l<s&&a(t,e[r+n-l])<=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var u=o;o=n-l,l=n-u}for(o++;o<l;){var f=o+(l-o>>>1);a(t,e[r+f])>0?o=f+1:l=f}return l}function Ih(t,e,r,i,n,a){var o=0,s=0,l=1;if(a(t,e[r+n])<0){for(s=n+1;l<s&&a(t,e[r+n-l])<0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var u=o;o=n-l,l=n-u}else{for(s=i-n;l<s&&a(t,e[r+n+l])>=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=n,l+=n}for(o++;o<l;){var f=o+(l-o>>>1);a(t,e[r+f])<0?l=f:o=f+1}return l}function rE(t,e){var r=Lo,i,n,a=0;t.length;var o=[];i=[],n=[];function s(c,d){i[a]=c,n[a]=d,a+=1}function l(){for(;a>1;){var c=a-2;if(c>=1&&n[c-1]<=n[c]+n[c+1]||c>=2&&n[c-2]<=n[c]+n[c-1])n[c-1]<n[c+1]&&c--;else if(n[c]>n[c+1])break;f(c)}}function u(){for(;a>1;){var c=a-2;c>0&&n[c-1]<n[c+1]&&c--,f(c)}}function f(c){var d=i[c],p=n[c],g=i[c+1],m=n[c+1];n[c]=p+m,c===a-3&&(i[c+1]=i[c+2],n[c+1]=n[c+2]),a--;var _=Ih(t[g],t,d,p,0,e);d+=_,p-=_,p!==0&&(m=Ph(t[d+p-1],t,g,m,m-1,e),m!==0&&(p<=m?h(d,p,g,m):v(d,p,g,m)))}function h(c,d,p,g){var m=0;for(m=0;m<d;m++)o[m]=t[c+m];var _=0,y=p,x=c;if(t[x++]=t[y++],--g===0){for(m=0;m<d;m++)t[x+m]=o[_+m];return}if(d===1){for(m=0;m<g;m++)t[x+m]=t[y+m];t[x+g]=o[_];return}for(var S=r,T,b,w;;){T=0,b=0,w=!1;do if(e(t[y],o[_])<0){if(t[x++]=t[y++],b++,T=0,--g===0){w=!0;break}}else if(t[x++]=o[_++],T++,b=0,--d===1){w=!0;break}while((T|b)<S);if(w)break;do{if(T=Ih(t[y],o,_,d,0,e),T!==0){for(m=0;m<T;m++)t[x+m]=o[_+m];if(x+=T,_+=T,d-=T,d<=1){w=!0;break}}if(t[x++]=t[y++],--g===0){w=!0;break}if(b=Ph(o[_],t,y,g,0,e),b!==0){for(m=0;m<b;m++)t[x+m]=t[y+m];if(x+=b,y+=b,g-=b,g===0){w=!0;break}}if(t[x++]=o[_++],--d===1){w=!0;break}S--}while(T>=Lo||b>=Lo);if(w)break;S<0&&(S=0),S+=2}if(r=S,r<1&&(r=1),d===1){for(m=0;m<g;m++)t[x+m]=t[y+m];t[x+g]=o[_]}else{if(d===0)throw new Error;for(m=0;m<d;m++)t[x+m]=o[_+m]}}function v(c,d,p,g){var m=0;for(m=0;m<g;m++)o[m]=t[p+m];var _=c+d-1,y=g-1,x=p+g-1,S=0,T=0;if(t[x--]=t[_--],--d===0){for(S=x-(g-1),m=0;m<g;m++)t[S+m]=o[m];return}if(g===1){for(x-=d,_-=d,T=x+1,S=_+1,m=d-1;m>=0;m--)t[T+m]=t[S+m];t[x]=o[y];return}for(var b=r;;){var w=0,A=0,C=!1;do if(e(o[y],t[_])<0){if(t[x--]=t[_--],w++,A=0,--d===0){C=!0;break}}else if(t[x--]=o[y--],A++,w=0,--g===1){C=!0;break}while((w|A)<b);if(C)break;do{if(w=d-Ih(o[y],t,c,d,d-1,e),w!==0){for(x-=w,_-=w,d-=w,T=x+1,S=_+1,m=w-1;m>=0;m--)t[T+m]=t[S+m];if(d===0){C=!0;break}}if(t[x--]=o[y--],--g===1){C=!0;break}if(A=g-Ph(t[_],o,0,g,g-1,e),A!==0){for(x-=A,y-=A,g-=A,T=x+1,S=y+1,m=0;m<A;m++)t[T+m]=o[S+m];if(g<=1){C=!0;break}}if(t[x--]=t[_--],--d===0){C=!0;break}b--}while(w>=Lo||A>=Lo);if(C)break;b<0&&(b=0),b+=2}if(r=b,r<1&&(r=1),g===1){for(x-=d,_-=d,T=x+1,S=_+1,m=d-1;m>=0;m--)t[T+m]=t[S+m];t[x]=o[y]}else{if(g===0)throw new Error;for(S=x-(g-1),m=0;m<g;m++)t[S+m]=o[m]}}return{mergeRuns:l,forceMergeRuns:u,pushRun:s}}function _u(t,e,r,i){r||(r=0),i||(i=t.length);var n=i-r;if(!(n<2)){var a=0;if(n<yx){a=Jg(t,r,i,e),tm(t,r,i,r+a,e);return}var o=rE(t,e),s=tE(n);do{if(a=Jg(t,r,i,e),a<s){var l=n;l>s&&(l=s),tm(t,r,r+l,r+a,e),a=l}o.pushRun(r,a),o.mergeRuns(),n-=a,r+=a}while(n!==0);o.forceMergeRuns()}}var fr=1,os=2,Ga=4,em=!1;function Nh(){em||(em=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function rm(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var iE=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=rm}return t.prototype.traverse=function(e,r){for(var i=0;i<this._roots.length;i++)this._roots[i].traverse(e,r)},t.prototype.getDisplayList=function(e,r){r=r||!1;var i=this._displayList;return(e||!i.length)&&this.updateDisplayList(r),i},t.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var r=this._roots,i=this._displayList,n=0,a=r.length;n<a;n++)this._updateAndAddDisplayable(r[n],null,e);i.length=this._displayListLen,_u(i,rm)},t.prototype._updateAndAddDisplayable=function(e,r,i){if(!(e.ignore&&!i)){e.beforeUpdate(),e.update(),e.afterUpdate();var n=e.getClipPath();if(e.ignoreClip)r=null;else if(n){r?r=r.slice():r=[];for(var a=n,o=e;a;)a.parent=o,a.updateTransform(),r.push(a),o=a,a=a.getClipPath()}if(e.childrenRef){for(var s=e.childrenRef(),l=0;l<s.length;l++){var u=s[l];e.__dirty&&(u.__dirty|=fr),this._updateAndAddDisplayable(u,r,i)}e.__dirty=0}else{var f=e;r&&r.length?f.__clipPaths=r:f.__clipPaths&&f.__clipPaths.length>0&&(f.__clipPaths=[]),isNaN(f.z)&&(Nh(),f.z=0),isNaN(f.z2)&&(Nh(),f.z2=0),isNaN(f.zlevel)&&(Nh(),f.zlevel=0),this._displayList[this._displayListLen++]=f}var h=e.getDecalElement&&e.getDecalElement();h&&this._updateAndAddDisplayable(h,r,i);var v=e.getTextGuideLine();v&&this._updateAndAddDisplayable(v,r,i);var c=e.getTextContent();c&&this._updateAndAddDisplayable(c,r,i)}},t.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},t.prototype.delRoot=function(e){if(e instanceof Array){for(var r=0,i=e.length;r<i;r++)this.delRoot(e[r]);return}var n=Dt(this._roots,e);n>=0&&this._roots.splice(n,1)},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}();const nE=iE;var xx;xx=At.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};const Xu=xx;var yu={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return .5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return t===0?0:Math.pow(1024,t-1)},exponentialOut:function(t){return t===1?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,r=.1,i=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=i/4):e=i*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)))},elasticOut:function(t){var e,r=.1,i=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=i/4):e=i*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/i)+1)},elasticInOut:function(t){var e,r=.1,i=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=i/4):e=i*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?-.5*(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)):r*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-yu.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?yu.bounceIn(t*2)*.5:yu.bounceOut(t*2-1)*.5+.5}};const Tx=yu;var yl=Math.pow,tn=Math.sqrt,Yu=1e-8,Sx=1e-4,im=tn(3),xl=1/3,si=To(),wr=To(),no=To();function Zi(t){return t>-Yu&&t<Yu}function bx(t){return t>Yu||t<-Yu}function ye(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 nm(t,e,r,i,n){var a=1-n;return 3*(((e-t)*a+2*(r-e)*n)*a+(i-r)*n*n)}function $u(t,e,r,i,n,a){var o=i+3*(e-r)-t,s=3*(r-e*2+t),l=3*(e-t),u=t-n,f=s*s-3*o*l,h=s*l-9*o*u,v=l*l-3*s*u,c=0;if(Zi(f)&&Zi(h))if(Zi(s))a[0]=0;else{var d=-l/s;d>=0&&d<=1&&(a[c++]=d)}else{var p=h*h-4*f*v;if(Zi(p)){var g=h/f,d=-s/o+g,m=-g/2;d>=0&&d<=1&&(a[c++]=d),m>=0&&m<=1&&(a[c++]=m)}else if(p>0){var _=tn(p),y=f*s+1.5*o*(-h+_),x=f*s+1.5*o*(-h-_);y<0?y=-yl(-y,xl):y=yl(y,xl),x<0?x=-yl(-x,xl):x=yl(x,xl);var d=(-s-(y+x))/(3*o);d>=0&&d<=1&&(a[c++]=d)}else{var S=(2*f*s-3*o*h)/(2*tn(f*f*f)),T=Math.acos(S)/3,b=tn(f),w=Math.cos(T),d=(-s-2*b*w)/(3*o),m=(-s+b*(w+im*Math.sin(T)))/(3*o),A=(-s+b*(w-im*Math.sin(T)))/(3*o);d>=0&&d<=1&&(a[c++]=d),m>=0&&m<=1&&(a[c++]=m),A>=0&&A<=1&&(a[c++]=A)}}return c}function Ax(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(Zi(o)){if(bx(a)){var u=-s/a;u>=0&&u<=1&&(n[l++]=u)}}else{var f=a*a-4*o*s;if(Zi(f))n[0]=-a/(2*o);else if(f>0){var h=tn(f),u=(-a+h)/(2*o),v=(-a-h)/(2*o);u>=0&&u<=1&&(n[l++]=u),v>=0&&v<=1&&(n[l++]=v)}}return l}function Zu(t,e,r,i,n,a){var o=(e-t)*n+t,s=(r-e)*n+e,l=(i-r)*n+r,u=(s-o)*n+o,f=(l-s)*n+s,h=(f-u)*n+u;a[0]=t,a[1]=o,a[2]=u,a[3]=h,a[4]=h,a[5]=f,a[6]=l,a[7]=i}function Ex(t,e,r,i,n,a,o,s,l,u,f){var h,v=.005,c=1/0,d,p,g,m;si[0]=l,si[1]=u;for(var _=0;_<1;_+=.05)wr[0]=ye(t,r,n,o,_),wr[1]=ye(e,i,a,s,_),g=ro(si,wr),g<c&&(h=_,c=g);c=1/0;for(var y=0;y<32&&!(v<Sx);y++)d=h-v,p=h+v,wr[0]=ye(t,r,n,o,d),wr[1]=ye(e,i,a,s,d),g=ro(wr,si),d>=0&&g<c?(h=d,c=g):(no[0]=ye(t,r,n,o,p),no[1]=ye(e,i,a,s,p),m=ro(no,si),p<=1&&m<c?(h=p,c=m):v*=.5);return f&&(f[0]=ye(t,r,n,o,h),f[1]=ye(e,i,a,s,h)),tn(c)}function aE(t,e,r,i,n,a,o,s,l){for(var u=t,f=e,h=0,v=1/l,c=1;c<=l;c++){var d=c*v,p=ye(t,r,n,o,d),g=ye(e,i,a,s,d),m=p-u,_=g-f;h+=Math.sqrt(m*m+_*_),u=p,f=g}return h}function Pe(t,e,r,i){var n=1-i;return n*(n*t+2*i*e)+i*i*r}function am(t,e,r,i){return 2*((1-i)*(e-t)+i*(r-e))}function oE(t,e,r,i,n){var a=t-2*e+r,o=2*(e-t),s=t-i,l=0;if(Zi(a)){if(bx(o)){var u=-s/o;u>=0&&u<=1&&(n[l++]=u)}}else{var f=o*o-4*a*s;if(Zi(f)){var u=-o/(2*a);u>=0&&u<=1&&(n[l++]=u)}else if(f>0){var h=tn(f),u=(-o+h)/(2*a),v=(-o-h)/(2*a);u>=0&&u<=1&&(n[l++]=u),v>=0&&v<=1&&(n[l++]=v)}}return l}function Cx(t,e,r){var i=t+r-2*e;return i===0?.5:(t-e)/i}function qu(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 Mx(t,e,r,i,n,a,o,s,l){var u,f=.005,h=1/0;si[0]=o,si[1]=s;for(var v=0;v<1;v+=.05){wr[0]=Pe(t,r,n,v),wr[1]=Pe(e,i,a,v);var c=ro(si,wr);c<h&&(u=v,h=c)}h=1/0;for(var d=0;d<32&&!(f<Sx);d++){var p=u-f,g=u+f;wr[0]=Pe(t,r,n,p),wr[1]=Pe(e,i,a,p);var c=ro(wr,si);if(p>=0&&c<h)u=p,h=c;else{no[0]=Pe(t,r,n,g),no[1]=Pe(e,i,a,g);var m=ro(no,si);g<=1&&m<h?(u=g,h=m):f*=.5}}return l&&(l[0]=Pe(t,r,n,u),l[1]=Pe(e,i,a,u)),tn(h)}function sE(t,e,r,i,n,a,o){for(var s=t,l=e,u=0,f=1/o,h=1;h<=o;h++){var v=h*f,c=Pe(t,r,n,v),d=Pe(e,i,a,v),p=c-s,g=d-l;u+=Math.sqrt(p*p+g*g),s=c,l=d}return u}var lE=/cubic-bezier\(([0-9,\.e ]+)\)/;function cp(t){var e=t&&lE.exec(t);if(e){var r=e[1].split(","),i=+li(r[0]),n=+li(r[1]),a=+li(r[2]),o=+li(r[3]);if(isNaN(i+n+a+o))return;var s=[];return function(l){return l<=0?0:l>=1?1:$u(0,i,a,1,l,s)&&ye(0,n,o,1,s[0])}}}var uE=function(){function t(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||De,this.ondestroy=e.ondestroy||De,this.onrestart=e.onrestart||De,e.easing&&this.setEasing(e.easing)}return t.prototype.step=function(e,r){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var i=this._life,n=e-this._startTime-this._pausedTime,a=n/i;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=n%i;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(e){this.easing=e,this.easingFunc=ct(e)?e:Tx[e]||cp(e)},t}();const fE=uE;var Dx=function(){function t(e){this.value=e}return t}(),hE=function(){function t(){this._len=0}return t.prototype.insert=function(e){var r=new Dx(e);return this.insertEntry(r),r},t.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},t.prototype.remove=function(e){var r=e.prev,i=e.next;r?r.next=i:this.head=i,i?i.prev=r:this.tail=r,e.next=e.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),cE=function(){function t(e){this._list=new hE,this._maxSize=10,this._map={},this._maxSize=e}return t.prototype.put=function(e,r){var i=this._list,n=this._map,a=null;if(n[e]==null){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=i.head;i.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new Dx(r),s.key=e,i.insertEntry(s),n[e]=s}return a},t.prototype.get=function(e){var r=this._map[e],i=this._list;if(r!=null)return r!==i.tail&&(i.remove(r),i.insertEntry(r)),r.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}();const So=cE;var om={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Xr(t){return t=Math.round(t),t<0?0:t>255?255:t}function vE(t){return t=Math.round(t),t<0?0:t>360?360:t}function Ps(t){return t<0?0:t>1?1:t}function Oh(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?Xr(parseFloat(e)/100*255):Xr(parseInt(e,10))}function Jn(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?Ps(parseFloat(e)/100):Ps(parseFloat(e))}function Bh(t,e,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?t+(e-t)*r*6:r*2<1?e:r*3<2?t+(e-t)*(2/3-r)*6:t}function qi(t,e,r){return t+(e-t)*r}function _r(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}function zv(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Lx=new So(20),Tl=null;function xa(t,e){Tl&&zv(Tl,e),Tl=Lx.put(t,Tl||e.slice())}function Xe(t,e){if(t){e=e||[];var r=Lx.get(t);if(r)return zv(e,r);t=t+"";var i=t.replace(/ /g,"").toLowerCase();if(i in om)return zv(e,om[i]),xa(t,e),e;var n=i.length;if(i.charAt(0)==="#"){if(n===4||n===5){var a=parseInt(i.slice(1,4),16);if(!(a>=0&&a<=4095)){_r(e,0,0,0,1);return}return _r(e,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,n===5?parseInt(i.slice(4),16)/15:1),xa(t,e),e}else if(n===7||n===9){var a=parseInt(i.slice(1,7),16);if(!(a>=0&&a<=16777215)){_r(e,0,0,0,1);return}return _r(e,(a&16711680)>>16,(a&65280)>>8,a&255,n===9?parseInt(i.slice(7),16)/255:1),xa(t,e),e}return}var o=i.indexOf("("),s=i.indexOf(")");if(o!==-1&&s+1===n){var l=i.substr(0,o),u=i.substr(o+1,s-(o+1)).split(","),f=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?_r(e,+u[0],+u[1],+u[2],1):_r(e,0,0,0,1);f=Jn(u.pop());case"rgb":if(u.length>=3)return _r(e,Oh(u[0]),Oh(u[1]),Oh(u[2]),u.length===3?f:Jn(u[3])),xa(t,e),e;_r(e,0,0,0,1);return;case"hsla":if(u.length!==4){_r(e,0,0,0,1);return}return u[3]=Jn(u[3]),Uv(u,e),xa(t,e),e;case"hsl":if(u.length!==3){_r(e,0,0,0,1);return}return Uv(u,e),xa(t,e),e;default:return}}_r(e,0,0,0,1)}}function Uv(t,e){var r=(parseFloat(t[0])%360+360)%360/360,i=Jn(t[1]),n=Jn(t[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return e=e||[],_r(e,Xr(Bh(o,a,r+1/3)*255),Xr(Bh(o,a,r)*255),Xr(Bh(o,a,r-1/3)*255),1),t.length===4&&(e[3]=t[3]),e}function dE(t){if(t){var e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.min(e,r,i),a=Math.max(e,r,i),o=a-n,s=(a+n)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+n):u=o/(2-a-n);var f=((a-e)/6+o/2)/o,h=((a-r)/6+o/2)/o,v=((a-i)/6+o/2)/o;e===a?l=v-h:r===a?l=1/3+f-v:i===a&&(l=2/3+h-f),l<0&&(l+=1),l>1&&(l-=1)}var c=[l*360,u,s];return t[3]!=null&&c.push(t[3]),c}}function sm(t,e){var r=Xe(t);if(r){for(var i=0;i<3;i++)e<0?r[i]=r[i]*(1-e)|0:r[i]=(255-r[i])*e+r[i]|0,r[i]>255?r[i]=255:r[i]<0&&(r[i]=0);return bi(r,r.length===4?"rgba":"rgb")}}function Fh(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){r=r||[];var i=t*(e.length-1),n=Math.floor(i),a=Math.ceil(i),o=e[n],s=e[a],l=i-n;return r[0]=Xr(qi(o[0],s[0],l)),r[1]=Xr(qi(o[1],s[1],l)),r[2]=Xr(qi(o[2],s[2],l)),r[3]=Ps(qi(o[3],s[3],l)),r}}function pE(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){var i=t*(e.length-1),n=Math.floor(i),a=Math.ceil(i),o=Xe(e[n]),s=Xe(e[a]),l=i-n,u=bi([Xr(qi(o[0],s[0],l)),Xr(qi(o[1],s[1],l)),Xr(qi(o[2],s[2],l)),Ps(qi(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:n,rightIndex:a,value:i}:u}}function kh(t,e,r,i){var n=Xe(t);if(t)return n=dE(n),e!=null&&(n[0]=vE(e)),r!=null&&(n[1]=Jn(r)),i!=null&&(n[2]=Jn(i)),bi(Uv(n),"rgba")}function gE(t,e){var r=Xe(t);if(r&&e!=null)return r[3]=Ps(e),bi(r,"rgba")}function bi(t,e){if(!(!t||!t.length)){var r=t[0]+","+t[1]+","+t[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(r+=","+t[3]),e+"("+r+")"}}function Ku(t,e){var r=Xe(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}var ju=Math.round;function Is(t){var e;if(!t||t==="transparent")t="none";else if(typeof t=="string"&&t.indexOf("rgba")>-1){var r=Xe(t);r&&(t="rgb("+r[0]+","+r[1]+","+r[2]+")",e=r[3])}return{color:t,opacity:e??1}}var lm=1e-4;function Ki(t){return t<lm&&t>-lm}function Sl(t){return ju(t*1e3)/1e3}function Hv(t){return ju(t*1e4)/1e4}function mE(t){return"matrix("+Sl(t[0])+","+Sl(t[1])+","+Sl(t[2])+","+Sl(t[3])+","+Hv(t[4])+","+Hv(t[5])+")"}var _E={left:"start",right:"end",center:"middle",middle:"middle"};function yE(t,e,r){return r==="top"?t+=e/2:r==="bottom"&&(t-=e/2),t}function xE(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}function TE(t){var e=t.style,r=t.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),r[0],r[1]].join(",")}function Rx(t){return t&&!!t.image}function SE(t){return t&&!!t.svgElement}function vp(t){return Rx(t)||SE(t)}function Px(t){return t.type==="linear"}function Ix(t){return t.type==="radial"}function Nx(t){return t&&(t.type==="linear"||t.type==="radial")}function Hf(t){return"url(#"+t+")"}function Ox(t){var e=t.getGlobalScale(),r=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(r)/Math.log(10)),1)}function Bx(t){var e=t.x||0,r=t.y||0,i=(t.rotation||0)*mu,n=mt(t.scaleX,1),a=mt(t.scaleY,1),o=t.skewX||0,s=t.skewY||0,l=[];return(e||r)&&l.push("translate("+e+"px,"+r+"px)"),i&&l.push("rotate("+i+")"),(n!==1||a!==1)&&l.push("scale("+n+","+a+")"),(o||s)&&l.push("skew("+ju(o*mu)+"deg, "+ju(s*mu)+"deg)"),l.join(" ")}var wE=function(){return At.hasGlobalWindow&&ct(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:typeof Buffer<"u"?function(t){return Buffer.from(t).toString("base64")}:function(t){return null}}(),Vv=Array.prototype.slice;function _i(t,e,r){return(e-t)*r+t}function zh(t,e,r,i){for(var n=e.length,a=0;a<n;a++)t[a]=_i(e[a],r[a],i);return t}function bE(t,e,r,i){for(var n=e.length,a=n&&e[0].length,o=0;o<n;o++){t[o]||(t[o]=[]);for(var s=0;s<a;s++)t[o][s]=_i(e[o][s],r[o][s],i)}return t}function wl(t,e,r,i){for(var n=e.length,a=0;a<n;a++)t[a]=e[a]+r[a]*i;return t}function um(t,e,r,i){for(var n=e.length,a=n&&e[0].length,o=0;o<n;o++){t[o]||(t[o]=[]);for(var s=0;s<a;s++)t[o][s]=e[o][s]+r[o][s]*i}return t}function AE(t,e){for(var r=t.length,i=e.length,n=r>i?e:t,a=Math.min(r,i),o=n[a-1]||{color:[0,0,0,0],offset:0},s=a;s<Math.max(r,i);s++)n.push({offset:o.offset,color:o.color.slice()})}function EE(t,e,r){var i=t,n=e;if(!(!i.push||!n.push)){var a=i.length,o=n.length;if(a!==o){var s=a>o;if(s)i.length=o;else for(var l=a;l<o;l++)i.push(r===1?n[l]:Vv.call(n[l]))}for(var u=i[0]&&i[0].length,l=0;l<i.length;l++)if(r===1)isNaN(i[l])&&(i[l]=n[l]);else for(var f=0;f<u;f++)isNaN(i[l][f])&&(i[l][f]=n[l][f])}}function _s(t){if($e(t)){var e=t.length;if($e(t[0])){for(var r=[],i=0;i<e;i++)r.push(Vv.call(t[i]));return r}return Vv.call(t)}return t}function xu(t){return t[0]=Math.floor(t[0])||0,t[1]=Math.floor(t[1])||0,t[2]=Math.floor(t[2])||0,t[3]=t[3]==null?1:t[3],"rgba("+t.join(",")+")"}function CE(t){return $e(t&&t[0])?2:1}var bl=0,Tu=1,Fx=2,ss=3,Gv=4,Wv=5,fm=6;function hm(t){return t===Gv||t===Wv}function Al(t){return t===Tu||t===Fx}var Ro=[0,0,0,0],ME=function(){function t(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return t.prototype.isFinished=function(){return this._finished},t.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},t.prototype.needsAnimate=function(){return this.keyframes.length>=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(e,r,i){this._needsSort=!0;var n=this.keyframes,a=n.length,o=!1,s=fm,l=r;if($e(r)){var u=CE(r);s=u,(u===1&&!Qt(r[0])||u===2&&!Qt(r[0][0]))&&(o=!0)}else if(Qt(r)&&!Gu(r))s=bl;else if(Z(r))if(!isNaN(+r))s=bl;else{var f=Xe(r);f&&(l=f,s=ss)}else if(kf(r)){var h=U({},l);h.colorStops=K(r.colorStops,function(c){return{offset:c.offset,color:Xe(c.color)}}),Px(r)?s=Gv:Ix(r)&&(s=Wv),l=h}a===0?this.valType=s:(s!==this.valType||s===fm)&&(o=!0),this.discrete=this.discrete||o;var v={time:e,value:l,rawValue:r,percent:0};return i&&(v.easing=i,v.easingFunc=ct(i)?i:Tx[i]||cp(i)),n.push(v),v},t.prototype.prepare=function(e,r){var i=this.keyframes;this._needsSort&&i.sort(function(p,g){return p.time-g.time});for(var n=this.valType,a=i.length,o=i[a-1],s=this.discrete,l=Al(n),u=hm(n),f=0;f<a;f++){var h=i[f],v=h.value,c=o.value;h.percent=h.time/e,s||(l&&f!==a-1?EE(v,c,n):u&&AE(v.colorStops,c.colorStops))}if(!s&&n!==Wv&&r&&this.needsAnimate()&&r.needsAnimate()&&n===r.valType&&!r._finished){this._additiveTrack=r;for(var d=i[0].value,f=0;f<a;f++)n===bl?i[f].additiveValue=i[f].value-d:n===ss?i[f].additiveValue=wl([],i[f].value,d,-1):Al(n)&&(i[f].additiveValue=n===Tu?wl([],i[f].value,d,-1):um([],i[f].value,d,-1))}},t.prototype.step=function(e,r){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var i=this._additiveTrack!=null,n=i?"additiveValue":"value",a=this.valType,o=this.keyframes,s=o.length,l=this.propName,u=a===ss,f,h=this._lastFr,v=Math.min,c,d;if(s===1)c=d=o[0];else{if(r<0)f=0;else if(r<this._lastFrP){var p=v(h+1,s-1);for(f=p;f>=0&&!(o[f].percent<=r);f--);f=v(f,s-2)}else{for(f=h;f<s&&!(o[f].percent>r);f++);f=v(f-1,s-2)}d=o[f+1],c=o[f]}if(c&&d){this._lastFr=f,this._lastFrP=r;var g=d.percent-c.percent,m=g===0?1:v((r-c.percent)/g,1);d.easingFunc&&(m=d.easingFunc(m));var _=i?this._additiveValue:u?Ro:e[l];if((Al(a)||u)&&!_&&(_=this._additiveValue=[]),this.discrete)e[l]=m<1?c.rawValue:d.rawValue;else if(Al(a))a===Tu?zh(_,c[n],d[n],m):bE(_,c[n],d[n],m);else if(hm(a)){var y=c[n],x=d[n],S=a===Gv;e[l]={type:S?"linear":"radial",x:_i(y.x,x.x,m),y:_i(y.y,x.y,m),colorStops:K(y.colorStops,function(b,w){var A=x.colorStops[w];return{offset:_i(b.offset,A.offset,m),color:xu(zh([],b.color,A.color,m))}}),global:x.global},S?(e[l].x2=_i(y.x2,x.x2,m),e[l].y2=_i(y.y2,x.y2,m)):e[l].r=_i(y.r,x.r,m)}else if(u)zh(_,c[n],d[n],m),i||(e[l]=xu(_));else{var T=_i(c[n],d[n],m);i?this._additiveValue=T:e[l]=T}i&&this._addToTarget(e)}}},t.prototype._addToTarget=function(e){var r=this.valType,i=this.propName,n=this._additiveValue;r===bl?e[i]=e[i]+n:r===ss?(Xe(e[i],Ro),wl(Ro,Ro,n,1),e[i]=xu(Ro)):r===Tu?wl(e[i],e[i],n,1):r===Fx&&um(e[i],e[i],n,1)},t}(),DE=function(){function t(e,r,i,n){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=r,r&&n){op("Can' use additive animation on looped animation.");return}this._additiveAnimators=n,this._allowDiscrete=i}return t.prototype.getMaxTime=function(){return this._maxTime},t.prototype.getDelay=function(){return this._delay},t.prototype.getLoop=function(){return this._loop},t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(e){this._target=e},t.prototype.when=function(e,r,i){return this.whenWithKeys(e,r,yt(r),i)},t.prototype.whenWithKeys=function(e,r,i,n){for(var a=this._tracks,o=0;o<i.length;o++){var s=i[o],l=a[s];if(!l){l=a[s]=new ME(s);var u=void 0,f=this._getAdditiveTrack(s);if(f){var h=f.keyframes,v=h[h.length-1];u=v&&v.value,f.valType===ss&&u&&(u=xu(u))}else u=this._target[s];if(u==null)continue;e>0&&l.addKeyframe(0,_s(u),n),this._trackKeys.push(s)}l.addKeyframe(e,_s(r[s]),n)}return this._maxTime=Math.max(this._maxTime,e),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var r=e.length,i=0;i<r;i++)e[i].call(this)},t.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,r=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,r)for(var i=0;i<r.length;i++)r[i].call(this)},t.prototype._setTracksFinished=function(){for(var e=this._tracks,r=this._trackKeys,i=0;i<r.length;i++)e[r[i]].setFinished()},t.prototype._getAdditiveTrack=function(e){var r,i=this._additiveAnimators;if(i)for(var n=0;n<i.length;n++){var a=i[n].getTrack(e);a&&(r=a)}return r},t.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var r=this,i=[],n=this._maxTime||0,a=0;a<this._trackKeys.length;a++){var o=this._trackKeys[a],s=this._tracks[o],l=this._getAdditiveTrack(o),u=s.keyframes,f=u.length;if(s.prepare(n,l),s.needsAnimate())if(!this._allowDiscrete&&s.discrete){var h=u[f-1];h&&(r._target[s.propName]=h.rawValue),s.setFinished()}else i.push(s)}if(i.length||this._force){var v=new fE({life:n,loop:this._loop,delay:this._delay||0,onframe:function(c){r._started=2;var d=r._additiveAnimators;if(d){for(var p=!1,g=0;g<d.length;g++)if(d[g]._clip){p=!0;break}p||(r._additiveAnimators=null)}for(var g=0;g<i.length;g++)i[g].step(r._target,c);var m=r._onframeCbs;if(m)for(var g=0;g<m.length;g++)m[g](r._target,c)},ondestroy:function(){r._doneCallback()}});this._clip=v,this.animation&&this.animation.addClip(v),e&&v.setEasing(e)}else this._doneCallback();return this}},t.prototype.stop=function(e){if(this._clip){var r=this._clip;e&&r.onframe(1),this._abortedCallback()}},t.prototype.delay=function(e){return this._delay=e,this},t.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},t.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},t.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},t.prototype.getClip=function(){return this._clip},t.prototype.getTrack=function(e){return this._tracks[e]},t.prototype.getTracks=function(){var e=this;return K(this._trackKeys,function(r){return e._tracks[r]})},t.prototype.stopTracks=function(e,r){if(!e.length||!this._clip)return!0;for(var i=this._tracks,n=this._trackKeys,a=0;a<e.length;a++){var o=i[e[a]];o&&!o.isFinished()&&(r?o.step(this._target,1):this._started===1&&o.step(this._target,0),o.setFinished())}for(var s=!0,a=0;a<n.length;a++)if(!i[n[a]].isFinished()){s=!1;break}return s&&this._abortedCallback(),s},t.prototype.saveTo=function(e,r,i){if(e){r=r||this._trackKeys;for(var n=0;n<r.length;n++){var a=r[n],o=this._tracks[a];if(!(!o||o.isFinished())){var s=o.keyframes,l=s[i?0:s.length-1];l&&(e[a]=_s(l.rawValue))}}}},t.prototype.__changeFinalValue=function(e,r){r=r||yt(e);for(var i=0;i<r.length;i++){var n=r[i],a=this._tracks[n];if(a){var o=a.keyframes;if(o.length>1){var s=o.pop();a.addKeyframe(s.time,e[n]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},t}();const Vf=DE;function qa(){return new Date().getTime()}var LE=function(t){G(e,t);function e(r){var i=t.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,r=r||{},i.stage=r.stage||{},i}return e.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},e.prototype.addAnimator=function(r){r.animation=this;var i=r.getClip();i&&this.addClip(i)},e.prototype.removeClip=function(r){if(r.animation){var i=r.prev,n=r.next;i?i.next=n:this._head=n,n?n.prev=i:this._tail=i,r.next=r.prev=r.animation=null}},e.prototype.removeAnimator=function(r){var i=r.getClip();i&&this.removeClip(i),r.animation=null},e.prototype.update=function(r){for(var i=qa()-this._pausedTime,n=i-this._time,a=this._head;a;){var o=a.next,s=a.step(i,n);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=i,r||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var r=this;this._running=!0;function i(){r._running&&(Xu(i),!r._paused&&r.update())}Xu(i)},e.prototype.start=function(){this._running||(this._time=qa(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=qa(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=qa()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var r=this._head;r;){var i=r.next;r.prev=r.next=r.animation=null,r=i}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(r,i){i=i||{},this.start();var n=new Vf(r,i.loop);return this.addAnimator(n),n},e}(Kr);const RE=LE;var PE=300,Uh=At.domSupported,Hh=function(){var t=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=K(t,function(n){var a=n.replace("mouse","pointer");return r.hasOwnProperty(a)?a:n});return{mouse:t,touch:e,pointer:i}}(),cm={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},vm=!1;function Xv(t){var e=t.pointerType;return e==="pen"||e==="touch"}function IE(t){t.touching=!0,t.touchTimer!=null&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}function Vh(t){t&&(t.zrByTouch=!0)}function NE(t,e){return yr(t.dom,new OE(t,e),!0)}function kx(t,e){for(var r=e,i=!1;r&&r.nodeType!==9&&!(i=r.domBelongToZr||r!==e&&r===t.painterRoot);)r=r.parentNode;return i}var OE=function(){function t(e,r){this.stopPropagation=De,this.stopImmediatePropagation=De,this.preventDefault=De,this.type=r.type,this.target=this.currentTarget=e.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return t}(),Vr={mousedown:function(t){t=yr(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=yr(this.dom,t);var e=this.__mayPointerCapture;e&&(t.zrX!==e[0]||t.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=yr(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){t=yr(this.dom,t);var e=t.toElement||t.relatedTarget;kx(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){vm=!0,t=yr(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){vm||(t=yr(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=yr(this.dom,t),Vh(t),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Vr.mousemove.call(this,t),Vr.mousedown.call(this,t)},touchmove:function(t){t=yr(this.dom,t),Vh(t),this.handler.processGesture(t,"change"),Vr.mousemove.call(this,t)},touchend:function(t){t=yr(this.dom,t),Vh(t),this.handler.processGesture(t,"end"),Vr.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<PE&&Vr.click.call(this,t)},pointerdown:function(t){Vr.mousedown.call(this,t)},pointermove:function(t){Xv(t)||Vr.mousemove.call(this,t)},pointerup:function(t){Vr.mouseup.call(this,t)},pointerout:function(t){Xv(t)||Vr.mouseout.call(this,t)}};M(["click","dblclick","contextmenu"],function(t){Vr[t]=function(e){e=yr(this.dom,e),this.trigger(t,e)}});var Yv={pointermove:function(t){Xv(t)||Yv.mousemove.call(this,t)},pointerup:function(t){Yv.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function BE(t,e){var r=e.domHandlers;At.pointerEventsSupported?M(Hh.pointer,function(i){Su(e,i,function(n){r[i].call(t,n)})}):(At.touchEventsSupported&&M(Hh.touch,function(i){Su(e,i,function(n){r[i].call(t,n),IE(e)})}),M(Hh.mouse,function(i){Su(e,i,function(n){n=up(n),e.touching||r[i].call(t,n)})}))}function FE(t,e){At.pointerEventsSupported?M(cm.pointer,r):At.touchEventsSupported||M(cm.mouse,r);function r(i){function n(a){a=up(a),kx(t,a.target)||(a=NE(t,a),e.domHandlers[i].call(t,a))}Su(e,i,n,{capture:!0})}}function Su(t,e,r,i){t.mounted[e]=r,t.listenerOpts[e]=i,UA(t.domTarget,e,r,i)}function Gh(t){var e=t.mounted;for(var r in e)e.hasOwnProperty(r)&&HA(t.domTarget,r,e[r],t.listenerOpts[r]);t.mounted={}}var dm=function(){function t(e,r){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=r}return t}(),kE=function(t){G(e,t);function e(r,i){var n=t.call(this)||this;return n.__pointerCapturing=!1,n.dom=r,n.painterRoot=i,n._localHandlerScope=new dm(r,Vr),Uh&&(n._globalHandlerScope=new dm(document,Yv)),BE(n,n._localHandlerScope),n}return e.prototype.dispose=function(){Gh(this._localHandlerScope),Uh&&Gh(this._globalHandlerScope)},e.prototype.setCursor=function(r){this.dom.style&&(this.dom.style.cursor=r||"default")},e.prototype.__togglePointerCapture=function(r){if(this.__mayPointerCapture=null,Uh&&+this.__pointerCapturing^+r){this.__pointerCapturing=r;var i=this._globalHandlerScope;r?FE(this,i):Gh(i)}},e}(Kr);const zE=kE;var zx=1;At.hasGlobalWindow&&(zx=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var Qu=zx,$v=.4,Zv="#333",qv="#ccc",UE="#eee",pm=fp,gm=5e-5;function vn(t){return t>gm||t<-gm}var dn=[],Ta=[],Wh=Rs(),Xh=Math.abs,HE=function(){function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},t.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},t.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},t.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},t.prototype.needLocalTransform=function(){return vn(this.rotation)||vn(this.x)||vn(this.y)||vn(this.scaleX-1)||vn(this.scaleY-1)||vn(this.skewX)||vn(this.skewY)},t.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,r=this.needLocalTransform(),i=this.transform;if(!(r||e)){i&&(pm(i),this.invTransform=null);return}i=i||Rs(),r?this.getLocalTransform(i):pm(i),e&&(r?io(i,e,i):WA(i,e)),this.transform=i,this._resolveGlobalScaleRatio(i)},t.prototype._resolveGlobalScaleRatio=function(e){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(dn);var i=dn[0]<0?-1:1,n=dn[1]<0?-1:1,a=((dn[0]-i)*r+i)/dn[0]||0,o=((dn[1]-n)*r+n)/dn[1]||0;e[0]*=a,e[1]*=a,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||Rs(),Uf(this.invTransform,e)},t.prototype.getComputedTransform=function(){for(var e=this,r=[];e;)r.push(e),e=e.parent;for(;e=r.pop();)e.updateTransform();return this.transform},t.prototype.setLocalTransform=function(e){if(e){var r=e[0]*e[0]+e[1]*e[1],i=e[2]*e[2]+e[3]*e[3],n=Math.atan2(e[1],e[0]),a=Math.PI/2+n-Math.atan2(e[3],e[2]);i=Math.sqrt(i)*Math.cos(a),r=Math.sqrt(r),this.skewX=a,this.skewY=0,this.rotation=-n,this.x=+e[4],this.y=+e[5],this.scaleX=r,this.scaleY=i,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,r=this.transform;e&&e.transform&&(io(Ta,e.invTransform,r),r=Ta);var i=this.originX,n=this.originY;(i||n)&&(Wh[4]=i,Wh[5]=n,io(Ta,r,Wh),Ta[4]-=i,Ta[5]-=n,r=Ta),this.setLocalTransform(r)}},t.prototype.getGlobalScale=function(e){var r=this.transform;return e=e||[],r?(e[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),e[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(e[0]=-e[0]),r[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},t.prototype.transformCoordToLocal=function(e,r){var i=[e,r],n=this.invTransform;return n&&Lr(i,i,n),i},t.prototype.transformCoordToGlobal=function(e,r){var i=[e,r],n=this.transform;return n&&Lr(i,i,n),i},t.prototype.getLineScale=function(){var e=this.transform;return e&&Xh(e[0]-1)>1e-10&&Xh(e[3]-1)>1e-10?Math.sqrt(Xh(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){Ux(this,e)},t.getLocalTransform=function(e,r){r=r||[];var i=e.originX||0,n=e.originY||0,a=e.scaleX,o=e.scaleY,s=e.anchorX,l=e.anchorY,u=e.rotation||0,f=e.x,h=e.y,v=e.skewX?Math.tan(e.skewX):0,c=e.skewY?Math.tan(-e.skewY):0;if(i||n||s||l){var d=i+s,p=n+l;r[4]=-d*a-v*p*o,r[5]=-p*o-c*d*a}else r[4]=r[5]=0;return r[0]=a,r[3]=o,r[1]=c*a,r[2]=v*o,u&&hp(r,r,u),r[4]+=i+f,r[5]+=n+h,r},t.initDefaultProps=function(){var e=t.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),t}(),ci=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Ux(t,e){for(var r=0;r<ci.length;r++){var i=ci[r];t[i]=e[i]}}const Gf=HE;var mm={};function hr(t,e){e=e||nn;var r=mm[e];r||(r=mm[e]=new So(500));var i=r.get(t);return i==null&&(i=xo.measureText(t,e).width,r.put(t,i)),i}function _m(t,e,r,i){var n=hr(t,e),a=Wf(e),o=ls(0,n,r),s=Wa(0,a,i),l=new Nt(o,s,n,a);return l}function dp(t,e,r,i){var n=((t||"")+"").split(`
`),a=n.length;if(a===1)return _m(n[0],e,r,i);for(var o=new Nt(0,0,0,0),s=0;s<n.length;s++){var l=_m(n[s],e,r,i);s===0?o.copy(l):o.union(l)}return o}function ls(t,e,r){return r==="right"?t-=e:r==="center"&&(t-=e/2),t}function Wa(t,e,r){return r==="middle"?t-=e/2:r==="bottom"&&(t-=e),t}function Wf(t){return hr("国",t)}function Ci(t,e){return typeof t=="string"?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function Hx(t,e,r){var i=e.position||"inside",n=e.distance!=null?e.distance:5,a=r.height,o=r.width,s=a/2,l=r.x,u=r.y,f="left",h="top";if(i instanceof Array)l+=Ci(i[0],r.width),u+=Ci(i[1],r.height),f=null,h=null;else switch(i){case"left":l-=n,u+=s,f="right",h="middle";break;case"right":l+=n+o,u+=s,h="middle";break;case"top":l+=o/2,u-=n,f="center",h="bottom";break;case"bottom":l+=o/2,u+=a+n,f="center";break;case"inside":l+=o/2,u+=s,f="center",h="middle";break;case"insideLeft":l+=n,u+=s,h="middle";break;case"insideRight":l+=o-n,u+=s,f="right",h="middle";break;case"insideTop":l+=o/2,u+=n,f="center";break;case"insideBottom":l+=o/2,u+=a-n,f="center",h="bottom";break;case"insideTopLeft":l+=n,u+=n;break;case"insideTopRight":l+=o-n,u+=n,f="right";break;case"insideBottomLeft":l+=n,u+=a-n,h="bottom";break;case"insideBottomRight":l+=o-n,u+=a-n,f="right",h="bottom";break}return t=t||{},t.x=l,t.y=u,t.align=f,t.verticalAlign=h,t}var Yh="__zr_normal__",$h=ci.concat(["ignore"]),VE=ha(ci,function(t,e){return t[e]=!0,t},{ignore:!1}),Sa={},GE=new Nt(0,0,0,0),pp=function(){function t(e){this.id=fx(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return t.prototype._init=function(e){this.attr(e)},t.prototype.drift=function(e,r,i){switch(this.draggable){case"horizontal":r=0;break;case"vertical":e=0;break}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=e,n[5]+=r,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(e){var r=this._textContent;if(r&&(!r.ignore||e)){this.textConfig||(this.textConfig={});var i=this.textConfig,n=i.local,a=r.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=n?this:null;var u=!1;if(a.copyTransform(r),i.position!=null){var f=GE;i.layoutRect?f.copy(i.layoutRect):f.copy(this.getBoundingRect()),n||f.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Sa,i,f):Hx(Sa,i,f),a.x=Sa.x,a.y=Sa.y,o=Sa.align,s=Sa.verticalAlign;var h=i.origin;if(h&&i.rotation!=null){var v=void 0,c=void 0;h==="center"?(v=f.width*.5,c=f.height*.5):(v=Ci(h[0],f.width),c=Ci(h[1],f.height)),u=!0,a.originX=-a.x+v+(n?0:f.x),a.originY=-a.y+c+(n?0:f.y)}}i.rotation!=null&&(a.rotation=i.rotation);var d=i.offset;d&&(a.x+=d[0],a.y+=d[1],u||(a.originX=-d[0],a.originY=-d[1]));var p=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),m=void 0,_=void 0,y=void 0;p&&this.canBeInsideText()?(m=i.insideFill,_=i.insideStroke,(m==null||m==="auto")&&(m=this.getInsideTextFill()),(_==null||_==="auto")&&(_=this.getInsideTextStroke(m),y=!0)):(m=i.outsideFill,_=i.outsideStroke,(m==null||m==="auto")&&(m=this.getOutsideFill()),(_==null||_==="auto")&&(_=this.getOutsideStroke(m),y=!0)),m=m||"#000",(m!==g.fill||_!==g.stroke||y!==g.autoStroke||o!==g.align||s!==g.verticalAlign)&&(l=!0,g.fill=m,g.stroke=_,g.autoStroke=y,g.align=o,g.verticalAlign=s,r.setDefaultTextStyle(g)),r.__dirty|=fr,l&&r.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(e){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?qv:Zv},t.prototype.getOutsideStroke=function(e){var r=this.__zr&&this.__zr.getBackgroundColor(),i=typeof r=="string"&&Xe(r);i||(i=[255,255,255,1]);for(var n=i[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*n+(a?0:255)*(1-n);return i[3]=1,bi(i,"rgba")},t.prototype.traverse=function(e,r){},t.prototype.attrKV=function(e,r){e==="textConfig"?this.setTextConfig(r):e==="textContent"?this.setTextContent(r):e==="clipPath"?this.setClipPath(r):e==="extra"?(this.extra=this.extra||{},U(this.extra,r)):this[e]=r},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(e,r){if(typeof e=="string")this.attrKV(e,r);else if(j(e))for(var i=e,n=yt(i),a=0;a<n.length;a++){var o=n[a];this.attrKV(o,e[o])}return this.markRedraw(),this},t.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var r=this._normalState,i=0;i<this.animators.length;i++){var n=this.animators[i],a=n.__fromStateTransition;if(!(n.getLoop()||a&&a!==Yh)){var o=n.targetName,s=o?r[o]:r;n.saveTo(s)}}},t.prototype._innerSaveToNormal=function(e){var r=this._normalState;r||(r=this._normalState={}),e.textConfig&&!r.textConfig&&(r.textConfig=this.textConfig),this._savePrimaryToNormal(e,r,$h)},t.prototype._savePrimaryToNormal=function(e,r,i){for(var n=0;n<i.length;n++){var a=i[n];e[a]!=null&&!(a in r)&&(r[a]=this[a])}},t.prototype.hasState=function(){return this.currentStates.length>0},t.prototype.getState=function(e){return this.states[e]},t.prototype.ensureState=function(e){var r=this.states;return r[e]||(r[e]={}),r[e]},t.prototype.clearStates=function(e){this.useState(Yh,!1,e)},t.prototype.useState=function(e,r,i,n){var a=e===Yh,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(Dt(s,e)>=0&&(r||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){op("State "+e+" not exists.");return}a||this.saveCurrentToNormalState(u);var f=!!(u&&u.hoverLayer||n);f&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,u,this._normalState,r,!i&&!this.__inHover&&l&&l.duration>0,l);var h=this._textContent,v=this._textGuide;return h&&h.useState(e,r,i,f),v&&v.useState(e,r,i,f),a?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~fr),u}}},t.prototype.useStates=function(e,r,i){if(!e.length)this.clearStates();else{var n=[],a=this.currentStates,o=e.length,s=o===a.length;if(s){for(var l=0;l<o;l++)if(e[l]!==a[l]){s=!1;break}}if(s)return;for(var l=0;l<o;l++){var u=e[l],f=void 0;this.stateProxy&&(f=this.stateProxy(u,e)),f||(f=this.states[u]),f&&n.push(f)}var h=n[o-1],v=!!(h&&h.hoverLayer||i);v&&this._toggleHoverLayerFlag(!0);var c=this._mergeStates(n),d=this.stateTransition;this.saveCurrentToNormalState(c),this._applyStateObj(e.join(","),c,this._normalState,!1,!r&&!this.__inHover&&d&&d.duration>0,d);var p=this._textContent,g=this._textGuide;p&&p.useStates(e,r,v),g&&g.useStates(e,r,v),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!v&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~fr)}},t.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var r=this.animators[e];r.targetName&&r.changeTarget(this[r.targetName])}},t.prototype.removeState=function(e){var r=Dt(this.currentStates,e);if(r>=0){var i=this.currentStates.slice();i.splice(r,1),this.useStates(i)}},t.prototype.replaceState=function(e,r,i){var n=this.currentStates.slice(),a=Dt(n,e),o=Dt(n,r)>=0;a>=0?o?n.splice(a,1):n[a]=r:i&&!o&&n.push(r),this.useStates(n)},t.prototype.toggleState=function(e,r){r?this.useState(e,!0):this.removeState(e)},t.prototype._mergeStates=function(e){for(var r={},i,n=0;n<e.length;n++){var a=e[n];U(r,a),a.textConfig&&(i=i||{},U(i,a.textConfig))}return i&&(r.textConfig=i),r},t.prototype._applyStateObj=function(e,r,i,n,a,o){var s=!(r&&n);r&&r.textConfig?(this.textConfig=U({},n?this.textConfig:i.textConfig),U(this.textConfig,r.textConfig)):s&&i.textConfig&&(this.textConfig=i.textConfig);for(var l={},u=!1,f=0;f<$h.length;f++){var h=$h[f],v=a&&VE[h];r&&r[h]!=null?v?(u=!0,l[h]=r[h]):this[h]=r[h]:s&&i[h]!=null&&(v?(u=!0,l[h]=i[h]):this[h]=i[h])}if(!a)for(var f=0;f<this.animators.length;f++){var c=this.animators[f],d=c.targetName;c.getLoop()||c.__changeFinalValue(d?(r||i)[d]:r||i)}u&&this._transitionState(e,l,o)},t.prototype._attachComponent=function(e){if(!(e.__zr&&!e.__hostTarget)&&e!==this){var r=this.__zr;r&&e.addSelfToZr(r),e.__zr=r,e.__hostTarget=this}},t.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},t.prototype.getClipPath=function(){return this._clipPath},t.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},t.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},t.prototype.getTextContent=function(){return this._textContent},t.prototype.setTextContent=function(e){var r=this._textContent;r!==e&&(r&&r!==e&&this.removeTextContent(),e.innerTransformable=new Gf,this._attachComponent(e),this._textContent=e,this.markRedraw())},t.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),U(this.textConfig,e),this.markRedraw()},t.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},t.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},t.prototype.getTextGuideLine=function(){return this._textGuide},t.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},t.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},t.prototype.markRedraw=function(){this.__dirty|=fr;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(e){this.__inHover=e;var r=this._textContent,i=this._textGuide;r&&(r.__inHover=e),i&&(i.__inHover=e)},t.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var r=this.animators;if(r)for(var i=0;i<r.length;i++)e.animation.addAnimator(r[i]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},t.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var r=this.animators;if(r)for(var i=0;i<r.length;i++)e.animation.removeAnimator(r[i]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},t.prototype.animate=function(e,r,i){var n=e?this[e]:this,a=new Vf(n,r,i);return e&&(a.targetName=e),this.addAnimator(a,e),a},t.prototype.addAnimator=function(e,r){var i=this.__zr,n=this;e.during(function(){n.updateDuringAnimation(r)}).done(function(){var a=n.animators,o=Dt(a,e);o>=0&&a.splice(o,1)}),this.animators.push(e),i&&i.animation.addAnimator(e),i&&i.wakeUp()},t.prototype.updateDuringAnimation=function(e){this.markRedraw()},t.prototype.stopAnimation=function(e,r){for(var i=this.animators,n=i.length,a=[],o=0;o<n;o++){var s=i[o];!e||e===s.scope?s.stop(r):a.push(s)}return this.animators=a,this},t.prototype.animateTo=function(e,r,i){Zh(this,e,r,i)},t.prototype.animateFrom=function(e,r,i){Zh(this,e,r,i,!0)},t.prototype._transitionState=function(e,r,i,n){for(var a=Zh(this,r,i,n),o=0;o<a.length;o++)a[o].__fromStateTransition=e},t.prototype.getBoundingRect=function(){return null},t.prototype.getPaintRect=function(){return null},t.initDefaultProps=function(){var e=t.prototype;e.type="element",e.name="",e.ignore=e.silent=e.isGroup=e.draggable=e.dragging=e.ignoreClip=e.__inHover=!1,e.__dirty=fr;function r(i,n,a,o){Object.defineProperty(e,i,{get:function(){if(!this[n]){var l=this[n]=[];s(this,l)}return this[n]},set:function(l){this[a]=l[0],this[o]=l[1],this[n]=l,s(this,l)}});function s(l,u){Object.defineProperty(u,0,{get:function(){return l[a]},set:function(f){l[a]=f}}),Object.defineProperty(u,1,{get:function(){return l[o]},set:function(f){l[o]=f}})}}Object.defineProperty&&(r("position","_legacyPos","x","y"),r("scale","_legacyScale","scaleX","scaleY"),r("origin","_legacyOrigin","originX","originY"))}(),t}();qr(pp,Kr);qr(pp,Gf);function Zh(t,e,r,i,n){r=r||{};var a=[];Vx(t,"",t,e,r,i,a,n);var o=a.length,s=!1,l=r.done,u=r.aborted,f=function(){s=!0,o--,o<=0&&(s?l&&l():u&&u())},h=function(){o--,o<=0&&(s?l&&l():u&&u())};o||l&&l(),a.length>0&&r.during&&a[0].during(function(d,p){r.during(p)});for(var v=0;v<a.length;v++){var c=a[v];f&&c.done(f),h&&c.aborted(h),r.force&&c.duration(r.duration),c.start(r.easing)}return a}function qh(t,e,r){for(var i=0;i<r;i++)t[i]=e[i]}function WE(t){return $e(t[0])}function XE(t,e,r){if($e(e[r]))if($e(t[r])||(t[r]=[]),cr(e[r])){var i=e[r].length;t[r].length!==i&&(t[r]=new e[r].constructor(i),qh(t[r],e[r],i))}else{var n=e[r],a=t[r],o=n.length;if(WE(n))for(var s=n[0].length,l=0;l<o;l++)a[l]?qh(a[l],n[l],s):a[l]=Array.prototype.slice.call(n[l]);else qh(a,n,o);a.length=n.length}else t[r]=e[r]}function YE(t,e){return t===e||$e(t)&&$e(e)&&$E(t,e)}function $E(t,e){var r=t.length;if(r!==e.length)return!1;for(var i=0;i<r;i++)if(t[i]!==e[i])return!1;return!0}function Vx(t,e,r,i,n,a,o,s){for(var l=yt(i),u=n.duration,f=n.delay,h=n.additive,v=n.setToFinal,c=!j(a),d=t.animators,p=[],g=0;g<l.length;g++){var m=l[g],_=i[m];if(_!=null&&r[m]!=null&&(c||a[m]))if(j(_)&&!$e(_)&&!kf(_)){if(e){s||(r[m]=_,t.updateDuringAnimation(e));continue}Vx(t,m,r[m],_,n,a&&a[m],o,s)}else p.push(m);else s||(r[m]=_,t.updateDuringAnimation(e),p.push(m))}var y=p.length;if(!h&&y)for(var x=0;x<d.length;x++){var S=d[x];if(S.targetName===e){var T=S.stopTracks(p);if(T){var b=Dt(d,S);d.splice(b,1)}}}if(n.force||(p=ce(p,function(E){return!YE(i[E],r[E])}),y=p.length),y>0||n.force&&!o.length){var w=void 0,A=void 0,C=void 0;if(s){A={},v&&(w={});for(var x=0;x<y;x++){var m=p[x];A[m]=r[m],v?w[m]=i[m]:r[m]=i[m]}}else if(v){C={};for(var x=0;x<y;x++){var m=p[x];C[m]=_s(r[m]),XE(r,i,m)}}var S=new Vf(r,!1,!1,h?ce(d,function(D){return D.targetName===e}):null);S.targetName=e,n.scope&&(S.scope=n.scope),v&&w&&S.whenWithKeys(0,w,p),C&&S.whenWithKeys(0,C,p),S.whenWithKeys(u??500,s?A:i,p).delay(f||0),t.addAnimator(S,e),o.push(S)}}const Gx=pp;var Wx=function(t){G(e,t);function e(r){var i=t.call(this)||this;return i.isGroup=!0,i._children=[],i.attr(r),i}return e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(r){return this._children[r]},e.prototype.childOfName=function(r){for(var i=this._children,n=0;n<i.length;n++)if(i[n].name===r)return i[n]},e.prototype.childCount=function(){return this._children.length},e.prototype.add=function(r){return r&&r!==this&&r.parent!==this&&(this._children.push(r),this._doAdd(r)),this},e.prototype.addBefore=function(r,i){if(r&&r!==this&&r.parent!==this&&i&&i.parent===this){var n=this._children,a=n.indexOf(i);a>=0&&(n.splice(a,0,r),this._doAdd(r))}return this},e.prototype.replace=function(r,i){var n=Dt(this._children,r);return n>=0&&this.replaceAt(i,n),this},e.prototype.replaceAt=function(r,i){var n=this._children,a=n[i];if(r&&r!==this&&r.parent!==this&&r!==a){n[i]=r,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(r)}return this},e.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var i=this.__zr;i&&i!==r.__zr&&r.addSelfToZr(i),i&&i.refresh()},e.prototype.remove=function(r){var i=this.__zr,n=this._children,a=Dt(n,r);return a<0?this:(n.splice(a,1),r.parent=null,i&&r.removeSelfFromZr(i),i&&i.refresh(),this)},e.prototype.removeAll=function(){for(var r=this._children,i=this.__zr,n=0;n<r.length;n++){var a=r[n];i&&a.removeSelfFromZr(i),a.parent=null}return r.length=0,this},e.prototype.eachChild=function(r,i){for(var n=this._children,a=0;a<n.length;a++){var o=n[a];r.call(i,o,a)}return this},e.prototype.traverse=function(r,i){for(var n=0;n<this._children.length;n++){var a=this._children[n],o=r.call(i,a);a.isGroup&&!o&&a.traverse(r,i)}return this},e.prototype.addSelfToZr=function(r){t.prototype.addSelfToZr.call(this,r);for(var i=0;i<this._children.length;i++){var n=this._children[i];n.addSelfToZr(r)}},e.prototype.removeSelfFromZr=function(r){t.prototype.removeSelfFromZr.call(this,r);for(var i=0;i<this._children.length;i++){var n=this._children[i];n.removeSelfFromZr(r)}},e.prototype.getBoundingRect=function(r){for(var i=new Nt(0,0,0,0),n=r||this._children,a=[],o=null,s=0;s<n.length;s++){var l=n[s];if(!(l.ignore||l.invisible)){var u=l.getBoundingRect(),f=l.getLocalTransform(a);f?(Nt.applyTransform(i,u,f),o=o||i.clone(),o.union(i)):(o=o||u.clone(),o.union(u))}}return o||i},e}(Gx);Wx.prototype.type="group";const ue=Wx;/*!
* ZRender, a high performance 2d drawing library.
*
* Copyright (c) 2013, Baidu Inc.
* All rights reserved.
*
* LICENSE
* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
*/var wu={},Xx={};function ZE(t){delete Xx[t]}function qE(t){if(!t)return!1;if(typeof t=="string")return Ku(t,1)<$v;if(t.colorStops){for(var e=t.colorStops,r=0,i=e.length,n=0;n<i;n++)r+=Ku(e[n].color,1);return r/=i,r<$v}return!1}var KE=function(){function t(e,r,i){var n=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,i=i||{},this.dom=r,this.id=e;var a=new nE,o=i.renderer||"canvas";wu[o]||(o=yt(wu)[0]),i.useDirtyRect=i.useDirtyRect==null?!1:i.useDirtyRect;var s=new wu[o](r,a,i,e),l=i.ssr||s.ssrOnly;this.storage=a,this.painter=s;var u=!At.node&&!At.worker&&!l?new zE(s.getViewportRoot(),s.root):null,f=i.useCoarsePointer,h=f==null||f==="auto"?At.touchEventsSupported:!!f,v=44,c;h&&(c=mt(i.pointerSize,v)),this.handler=new JA(a,s,u,s.root,c),this.animation=new RE({stage:{update:l?null:function(){return n._flush(!0)}}}),l||this.animation.start()}return t.prototype.add=function(e){e&&(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},t.prototype.remove=function(e){e&&(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},t.prototype.configLayer=function(e,r){this.painter.configLayer&&this.painter.configLayer(e,r),this.refresh()},t.prototype.setBackgroundColor=function(e){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=qE(e)},t.prototype.getBackgroundColor=function(){return this._backgroundColor},t.prototype.setDarkMode=function(e){this._darkMode=e},t.prototype.isDarkMode=function(){return this._darkMode},t.prototype.refreshImmediately=function(e){e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1},t.prototype.refresh=function(){this._needsRefresh=!0,this.animation.start()},t.prototype.flush=function(){this._flush(!1)},t.prototype._flush=function(e){var r,i=qa();this._needsRefresh&&(r=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(r=!0,this.refreshHoverImmediately());var n=qa();r?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:n-i})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},t.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover()},t.prototype.resize=function(e){e=e||{},this.painter.resize(e.width,e.height),this.handler.resize()},t.prototype.clearAnimation=function(){this.animation.clear()},t.prototype.getWidth=function(){return this.painter.getWidth()},t.prototype.getHeight=function(){return this.painter.getHeight()},t.prototype.setCursorStyle=function(e){this.handler.setCursorStyle(e)},t.prototype.findHover=function(e,r){return this.handler.findHover(e,r)},t.prototype.on=function(e,r,i){return this.handler.on(e,r,i),this},t.prototype.off=function(e,r){this.handler.off(e,r)},t.prototype.trigger=function(e,r){this.handler.trigger(e,r)},t.prototype.clear=function(){for(var e=this.storage.getRoots(),r=0;r<e.length;r++)e[r]instanceof ue&&e[r].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()},t.prototype.dispose=function(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,ZE(this.id)},t}();function Kv(t,e){var r=new KE(fx(),t,e);return Xx[r.id]=r,r}function jE(t,e){wu[t]=e}var ym=1e-4,Yx=20;function QE(t){return t.replace(/^\s+|\s+$/g,"")}function ae(t,e,r,i){var n=e[0],a=e[1],o=r[0],s=r[1],l=a-n,u=s-o;if(l===0)return u===0?o:(o+s)/2;if(i)if(l>0){if(t<=n)return o;if(t>=a)return s}else{if(t>=n)return o;if(t<=a)return s}else{if(t===n)return o;if(t===a)return s}return(t-n)/l*u+o}function ve(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%";break}return Z(t)?QE(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):t==null?NaN:+t}function re(t,e,r){return e==null&&(e=10),e=Math.min(Math.max(0,e),Yx),t=(+t).toFixed(e),r?t:+t}function Yn(t){return t.sort(function(e,r){return e-r}),t}function Ti(t){if(t=+t,isNaN(t))return 0;if(t>1e-14){for(var e=1,r=0;r<15;r++,e*=10)if(Math.round(t*e)/e===t)return r}return gp(t)}function gp(t){var e=t.toString().toLowerCase(),r=e.indexOf("e"),i=r>0?+e.slice(r+1):0,n=r>0?r:e.length,a=e.indexOf("."),o=a<0?0:n-1-a;return Math.max(0,o-i)}function $x(t,e){var r=Math.log,i=Math.LN10,n=Math.floor(r(t[1]-t[0])/i),a=Math.round(r(Math.abs(e[1]-e[0]))/i),o=Math.min(Math.max(-n+a,0),20);return isFinite(o)?o:20}function JE(t,e){var r=Math.max(Ti(t),Ti(e)),i=t+e;return r>Yx?i:re(i,r)}function Zx(t){var e=Math.PI*2;return(t%e+e)%e}function Ju(t){return t>-ym&&t<ym}var tC=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function vi(t){if(t instanceof Date)return t;if(Z(t)){var e=tC.exec(t);if(!e)return new Date(NaN);if(e[8]){var r=+e[4]||0;return e[8].toUpperCase()!=="Z"&&(r-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,r,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}else return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0)}else if(t==null)return new Date(NaN);return new Date(Math.round(t))}function eC(t){return Math.pow(10,mp(t))}function mp(t){if(t===0)return 0;var e=Math.floor(Math.log(t)/Math.LN10);return t/Math.pow(10,e)>=10&&e++,e}function qx(t,e){var r=mp(t),i=Math.pow(10,r),n=t/i,a;return e?n<1.5?a=1:n<2.5?a=2:n<4?a=3:n<7?a=5:a=10:n<1?a=1:n<2?a=2:n<3?a=3:n<5?a=5:a=10,t=a*i,r>=-20?+t.toFixed(r<0?-r:0):t}function xm(t){t.sort(function(l,u){return s(l,u,0)?-1:1});for(var e=-1/0,r=1,i=0;i<t.length;){for(var n=t[i].interval,a=t[i].close,o=0;o<2;o++)n[o]<=e&&(n[o]=e,a[o]=o?1:1-r),e=n[o],r=a[o];n[0]===n[1]&&a[0]*a[1]!==1?t.splice(i,1):i++}return t;function s(l,u,f){return l.interval[f]<u.interval[f]||l.interval[f]===u.interval[f]&&(l.close[f]-u.close[f]===(f?-1:1)||!f&&s(l,u,1))}}function tf(t){var e=parseFloat(t);return e==t&&(e!==0||!Z(t)||t.indexOf("x")<=0)?e:NaN}function rC(t){return!isNaN(tf(t))}function Kx(){return Math.round(Math.random()*9)}function jx(t,e){return e===0?t:jx(e,t%e)}function Tm(t,e){return t==null?e:e==null?t:t*e/jx(t,e)}function je(t){throw new Error(t)}function Sm(t,e,r){return(e-t)*r+t}var Qx="series\0",iC="\0_ec_\0";function ge(t){return t instanceof Array?t:t==null?[]:[t]}function wm(t,e,r){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var i=0,n=r.length;i<n;i++){var a=r[i];!t.emphasis[e].hasOwnProperty(a)&&t[e].hasOwnProperty(a)&&(t.emphasis[e][a]=t[e][a])}}}var bm=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function rl(t){return j(t)&&!X(t)&&!(t instanceof Date)?t.value:t}function nC(t){return j(t)&&!(t instanceof Array)}function Jx(t,e,r){var i=r==="normalMerge",n=r==="replaceMerge",a=r==="replaceAll";t=t||[],e=(e||[]).slice();var o=ht();M(e,function(l,u){if(!j(l)){e[u]=null;return}});var s=aC(t,o,r);return(i||n)&&oC(s,t,o,e),i&&sC(s,e),i||n?lC(s,e,n):a&&uC(s,e),fC(s),s}function aC(t,e,r){var i=[];if(r==="replaceAll")return i;for(var n=0;n<t.length;n++){var a=t[n];a&&a.id!=null&&e.set(a.id,n),i.push({existing:r==="replaceMerge"||Ns(a)?null:a,newOption:null,keyInfo:null,brandNew:null})}return i}function oC(t,e,r,i){M(i,function(n,a){if(!(!n||n.id==null)){var o=ys(n.id),s=r.get(o);if(s!=null){var l=t[s];Rr(!l.newOption,'Duplicated option on id "'+o+'".'),l.newOption=n,l.existing=e[s],i[a]=null}}})}function sC(t,e){M(e,function(r,i){if(!(!r||r.name==null))for(var n=0;n<t.length;n++){var a=t[n].existing;if(!t[n].newOption&&a&&(a.id==null||r.id==null)&&!Ns(r)&&!Ns(a)&&tT("name",a,r)){t[n].newOption=r,e[i]=null;return}}})}function lC(t,e,r){M(e,function(i){if(i){for(var n,a=0;(n=t[a])&&(n.newOption||Ns(n.existing)||n.existing&&i.id!=null&&!tT("id",i,n.existing));)a++;n?(n.newOption=i,n.brandNew=r):t.push({newOption:i,brandNew:r,existing:null,keyInfo:null}),a++}})}function uC(t,e){M(e,function(r){t.push({newOption:r,brandNew:!0,existing:null,keyInfo:null})})}function fC(t){var e=ht();M(t,function(r){var i=r.existing;i&&e.set(i.id,r)}),M(t,function(r){var i=r.newOption;Rr(!i||i.id==null||!e.get(i.id)||e.get(i.id)===r,"id duplicates: "+(i&&i.id)),i&&i.id!=null&&e.set(i.id,r),!r.keyInfo&&(r.keyInfo={})}),M(t,function(r,i){var n=r.existing,a=r.newOption,o=r.keyInfo;if(j(a)){if(o.name=a.name!=null?ys(a.name):n?n.name:Qx+i,n)o.id=ys(n.id);else if(a.id!=null)o.id=ys(a.id);else{var s=0;do o.id="\0"+o.name+"\0"+s++;while(e.get(o.id))}e.set(o.id,r)}})}function tT(t,e,r){var i=Ge(e[t],null),n=Ge(r[t],null);return i!=null&&n!=null&&i===n}function ys(t){return Ge(t,"")}function Ge(t,e){return t==null?e:Z(t)?t:Qt(t)||Pv(t)?t+"":e}function _p(t){var e=t.name;return!!(e&&e.indexOf(Qx))}function Ns(t){return t&&t.id!=null&&ys(t.id).indexOf(iC)===0}function hC(t,e,r){M(t,function(i){var n=i.newOption;j(n)&&(i.keyInfo.mainType=e,i.keyInfo.subType=cC(e,n,i.existing,r))})}function cC(t,e,r,i){var n=e.type?e.type:r?r.subType:i.determineSubType(t,e);return n}function vC(t,e){var r={},i={};return n(t||[],r),n(e||[],i,r),[a(r),a(i)];function n(o,s,l){for(var u=0,f=o.length;u<f;u++){var h=Ge(o[u].seriesId,null);if(h==null)return;for(var v=ge(o[u].dataIndex),c=l&&l[h],d=0,p=v.length;d<p;d++){var g=v[d];c&&c[g]?c[g]=null:(s[h]||(s[h]={}))[g]=1}}}function a(o,s){var l=[];for(var u in o)if(o.hasOwnProperty(u)&&o[u]!=null)if(s)l.push(+u);else{var f=a(o[u],!0);f.length&&l.push({seriesId:u,dataIndex:f})}return l}}function sa(t,e){if(e.dataIndexInside!=null)return e.dataIndexInside;if(e.dataIndex!=null)return X(e.dataIndex)?K(e.dataIndex,function(r){return t.indexOfRawIndex(r)}):t.indexOfRawIndex(e.dataIndex);if(e.name!=null)return X(e.name)?K(e.name,function(r){return t.indexOfName(r)}):t.indexOfName(e.name)}function Kt(){var t="__ec_inner_"+dC++;return function(e){return e[t]||(e[t]={})}}var dC=Kx();function Kh(t,e,r){var i=yp(e,r),n=i.mainTypeSpecified,a=i.queryOptionMap,o=i.others,s=o,l=r?r.defaultMainType:null;return!n&&l&&a.set(l,{}),a.each(function(u,f){var h=il(t,f,u,{useDefault:l===f,enableAll:r&&r.enableAll!=null?r.enableAll:!0,enableNone:r&&r.enableNone!=null?r.enableNone:!0});s[f+"Models"]=h.models,s[f+"Model"]=h.models[0]}),s}function yp(t,e){var r;if(Z(t)){var i={};i[t+"Index"]=0,r=i}else r=t;var n=ht(),a={},o=!1;return M(r,function(s,l){if(l==="dataIndex"||l==="dataIndexInside"){a[l]=s;return}var u=l.match(/^(\w+)(Index|Id|Name)$/)||[],f=u[1],h=(u[2]||"").toLowerCase();if(!(!f||!h||e&&e.includeMainTypes&&Dt(e.includeMainTypes,f)<0)){o=o||!!f;var v=n.get(f)||n.set(f,{});v[h]=s}}),{mainTypeSpecified:o,queryOptionMap:n,others:a}}var Je={useDefault:!0,enableAll:!1,enableNone:!1},pC={useDefault:!1,enableAll:!0,enableNone:!0};function il(t,e,r,i){i=i||Je;var n=r.index,a=r.id,o=r.name,s={models:null,specified:n!=null||a!=null||o!=null};if(!s.specified){var l=void 0;return s.models=i.useDefault&&(l=t.getComponent(e))?[l]:[],s}return n==="none"||n===!1?(Rr(i.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[],s):(n==="all"&&(Rr(i.enableAll,'`"all"` is not a valid value on index option.'),n=a=o=null),s.models=t.queryComponents({mainType:e,index:n,id:a,name:o}),s)}function eT(t,e,r){t.setAttribute?t.setAttribute(e,r):t[e]=r}function gC(t,e){return t.getAttribute?t.getAttribute(e):t[e]}function mC(t){return t==="auto"?At.domSupported?"html":"richText":t||"html"}function rT(t,e,r,i,n){var a=e==null||e==="auto";if(i==null)return i;if(Qt(i)){var o=Sm(r||0,i,n);return re(o,a?Math.max(Ti(r||0),Ti(i)):e)}else{if(Z(i))return n<1?r:i;for(var s=[],l=r,u=i,f=Math.max(l?l.length:0,u.length),h=0;h<f;++h){var v=t.getDimensionInfo(h);if(v&&v.type==="ordinal")s[h]=(n<1&&l?l:u)[h];else{var c=l&&l[h]?l[h]:0,d=u[h],o=Sm(c,d,n);s[h]=re(o,a?Math.max(Ti(c),Ti(d)):e)}}return s}}var _C=".",pn="___EC__COMPONENT__CONTAINER___",iT="___EC__EXTENDED_CLASS___";function ui(t){var e={main:"",sub:""};if(t){var r=t.split(_C);e.main=r[0]||"",e.sub=r[1]||""}return e}function yC(t){Rr(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function xC(t){return!!(t&&t[iT])}function xp(t,e){t.$constructor=t,t.extend=function(r){var i=this,n;return TC(i)?n=function(a){G(o,a);function o(){return a.apply(this,arguments)||this}return o}(i):(n=function(){(r.$constructor||i).apply(this,arguments)},sp(n,this)),U(n.prototype,r),n[iT]=!0,n.extend=this.extend,n.superCall=bC,n.superApply=AC,n.superClass=i,n}}function TC(t){return ct(t)&&/^class\s/.test(Function.prototype.toString.call(t))}function nT(t,e){t.extend=e.extend}var SC=Math.round(Math.random()*10);function wC(t){var e=["__\0is_clz",SC++].join("_");t.prototype[e]=!0,t.isInstance=function(r){return!!(r&&r[e])}}function bC(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return this.superClass.prototype[e].apply(t,r)}function AC(t,e,r){return this.superClass.prototype[e].apply(t,r)}function Xf(t){var e={};t.registerClass=function(i){var n=i.type||i.prototype.type;if(n){yC(n),i.prototype.type=n;var a=ui(n);if(!a.sub)e[a.main]=i;else if(a.sub!==pn){var o=r(a);o[a.sub]=i}}return i},t.getClass=function(i,n,a){var o=e[i];if(o&&o[pn]&&(o=n?o[n]:null),a&&!o)throw new Error(n?"Component "+i+"."+(n||"")+" is used but not imported.":i+".type should be specified.");return o},t.getClassesByMainType=function(i){var n=ui(i),a=[],o=e[n.main];return o&&o[pn]?M(o,function(s,l){l!==pn&&a.push(s)}):a.push(o),a},t.hasClass=function(i){var n=ui(i);return!!e[n.main]},t.getAllClassMainTypes=function(){var i=[];return M(e,function(n,a){i.push(a)}),i},t.hasSubTypes=function(i){var n=ui(i),a=e[n.main];return a&&a[pn]};function r(i){var n=e[i.main];return(!n||!n[pn])&&(n=e[i.main]={},n[pn]=!0),n}}function Os(t,e){for(var r=0;r<t.length;r++)t[r][1]||(t[r][1]=t[r][0]);return e=e||!1,function(i,n,a){for(var o={},s=0;s<t.length;s++){var l=t[s][1];if(!(n&&Dt(n,l)>=0||a&&Dt(a,l)<0)){var u=i.getShallow(l,e);u!=null&&(o[t[s][0]]=u)}}return o}}var EC=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],CC=Os(EC),MC=function(){function t(){}return t.prototype.getAreaStyle=function(e,r){return CC(this,e,r)},t}(),jv=new So(50);function DC(t){if(typeof t=="string"){var e=jv.get(t);return e&&e.image}else return t}function Tp(t,e,r,i,n){if(t)if(typeof t=="string"){if(e&&e.__zrImageSrc===t||!r)return e;var a=jv.get(t),o={hostEl:r,cb:i,cbPayload:n};return a?(e=a.image,!Yf(e)&&a.pending.push(o)):(e=xo.loadImage(t,Am,Am),e.__zrImageSrc=t,jv.put(t,e.__cachedImgObj={image:e,pending:[o]})),e}else return t;else return e}function Am(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<t.pending.length;e++){var r=t.pending[e],i=r.cb;i&&i(this,r.cbPayload),r.hostEl.dirty()}t.pending.length=0}function Yf(t){return t&&t.width&&t.height}var jh=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function LC(t,e,r,i,n){if(!e)return"";var a=(t+"").split(`
`);n=aT(e,r,i,n);for(var o=0,s=a.length;o<s;o++)a[o]=oT(a[o],n);return a.join(`
`)}function aT(t,e,r,i){i=i||{};var n=U({},i);n.font=e,r=mt(r,"..."),n.maxIterations=mt(i.maxIterations,2);var a=n.minChar=mt(i.minChar,0);n.cnCharWidth=hr("国",e);var o=n.ascCharWidth=hr("a",e);n.placeholder=mt(i.placeholder,"");for(var s=t=Math.max(0,t-1),l=0;l<a&&s>=o;l++)s-=o;var u=hr(r,e);return u>s&&(r="",u=0),s=t-u,n.ellipsis=r,n.ellipsisWidth=u,n.contentWidth=s,n.containerWidth=t,n}function oT(t,e){var r=e.containerWidth,i=e.font,n=e.contentWidth;if(!r)return"";var a=hr(t,i);if(a<=r)return t;for(var o=0;;o++){if(a<=n||o>=e.maxIterations){t+=e.ellipsis;break}var s=o===0?RC(t,n,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(t.length*n/a):0;t=t.substr(0,s),a=hr(t,i)}return t===""&&(t=e.placeholder),t}function RC(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}function PC(t,e){t!=null&&(t+="");var r=e.overflow,i=e.padding,n=e.font,a=r==="truncate",o=Wf(n),s=mt(e.lineHeight,o),l=!!e.backgroundColor,u=e.lineOverflow==="truncate",f=e.width,h;f!=null&&(r==="break"||r==="breakAll")?h=t?sT(t,e.font,f,r==="breakAll",0).lines:[]:h=t?t.split(`
`):[];var v=h.length*s,c=mt(e.height,v);if(v>c&&u){var d=Math.floor(c/s);h=h.slice(0,d)}if(t&&a&&f!=null)for(var p=aT(f,n,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),g=0;g<h.length;g++)h[g]=oT(h[g],p);for(var m=c,_=0,g=0;g<h.length;g++)_=Math.max(hr(h[g],n),_);f==null&&(f=_);var y=_;return i&&(m+=i[0]+i[2],y+=i[1]+i[3],f+=i[1]+i[3]),l&&(y=f),{lines:h,height:c,outerWidth:y,outerHeight:m,lineHeight:s,calculatedLineHeight:o,contentWidth:_,contentHeight:v,width:f}}var IC=function(){function t(){}return t}(),Em=function(){function t(e){this.tokens=[],e&&(this.tokens=e)}return t}(),NC=function(){function t(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[]}return t}();function OC(t,e){var r=new NC;if(t!=null&&(t+=""),!t)return r;for(var i=e.width,n=e.height,a=e.overflow,o=(a==="break"||a==="breakAll")&&i!=null?{width:i,accumWidth:0,breakAll:a==="breakAll"}:null,s=jh.lastIndex=0,l;(l=jh.exec(t))!=null;){var u=l.index;u>s&&Qh(r,t.substring(s,u),e,o),Qh(r,l[2],e,o,l[1]),s=jh.lastIndex}s<t.length&&Qh(r,t.substring(s,t.length),e,o);var f=[],h=0,v=0,c=e.padding,d=a==="truncate",p=e.lineOverflow==="truncate";function g(O,z,k){O.width=z,O.lineHeight=k,h+=k,v=Math.max(v,z)}t:for(var m=0;m<r.lines.length;m++){for(var _=r.lines[m],y=0,x=0,S=0;S<_.tokens.length;S++){var T=_.tokens[S],b=T.styleName&&e.rich[T.styleName]||{},w=T.textPadding=b.padding,A=w?w[1]+w[3]:0,C=T.font=b.font||e.font;T.contentHeight=Wf(C);var E=mt(b.height,T.contentHeight);if(T.innerHeight=E,w&&(E+=w[0]+w[2]),T.height=E,T.lineHeight=gu(b.lineHeight,e.lineHeight,E),T.align=b&&b.align||e.align,T.verticalAlign=b&&b.verticalAlign||"middle",p&&n!=null&&h+T.lineHeight>n){S>0?(_.tokens=_.tokens.slice(0,S),g(_,x,y),r.lines=r.lines.slice(0,m+1)):r.lines=r.lines.slice(0,m);break t}var D=b.width,L=D==null||D==="auto";if(typeof D=="string"&&D.charAt(D.length-1)==="%")T.percentWidth=D,f.push(T),T.contentWidth=hr(T.text,C);else{if(L){var R=b.backgroundColor,N=R&&R.image;N&&(N=DC(N),Yf(N)&&(T.width=Math.max(T.width,N.width*E/N.height)))}var I=d&&i!=null?i-x:null;I!=null&&I<T.width?!L||I<A?(T.text="",T.width=T.contentWidth=0):(T.text=LC(T.text,I-A,C,e.ellipsis,{minChar:e.truncateMinChar}),T.width=T.contentWidth=hr(T.text,C)):T.contentWidth=hr(T.text,C)}T.width+=A,x+=T.width,b&&(y=Math.max(y,T.lineHeight))}g(_,x,y)}r.outerWidth=r.width=mt(i,v),r.outerHeight=r.height=mt(n,h),r.contentHeight=h,r.contentWidth=v,c&&(r.outerWidth+=c[1]+c[3],r.outerHeight+=c[0]+c[2]);for(var m=0;m<f.length;m++){var T=f[m],F=T.percentWidth;T.width=parseInt(F,10)/100*r.width}return r}function Qh(t,e,r,i,n){var a=e==="",o=n&&r.rich[n]||{},s=t.lines,l=o.font||r.font,u=!1,f,h;if(i){var v=o.padding,c=v?v[1]+v[3]:0;if(o.width!=null&&o.width!=="auto"){var d=Ci(o.width,i.width)+c;s.length>0&&d+i.accumWidth>i.width&&(f=e.split(`
`),u=!0),i.accumWidth=d}else{var p=sT(e,l,i.width,i.breakAll,i.accumWidth);i.accumWidth=p.accumWidth+c,h=p.linesWidths,f=p.lines}}else f=e.split(`
`);for(var g=0;g<f.length;g++){var m=f[g],_=new IC;if(_.styleName=n,_.text=m,_.isLineHolder=!m&&!a,typeof o.width=="number"?_.width=o.width:_.width=h?h[g]:hr(m,l),!g&&!u){var y=(s[s.length-1]||(s[0]=new Em)).tokens,x=y.length;x===1&&y[0].isLineHolder?y[0]=_:(m||!x||a)&&y.push(_)}else s.push(new Em([_]))}}function BC(t){var e=t.charCodeAt(0);return e>=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var FC=ha(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{});function kC(t){return BC(t)?!!FC[t]:!0}function sT(t,e,r,i,n){for(var a=[],o=[],s="",l="",u=0,f=0,h=0;h<t.length;h++){var v=t.charAt(h);if(v===`
`){l&&(s+=l,f+=u),a.push(s),o.push(f),s="",l="",u=0,f=0;continue}var c=hr(v,e),d=i?!1:!kC(v);if(a.length?f+c>r:n+f+c>r){f?(s||l)&&(d?(s||(s=l,l="",u=0,f=u),a.push(s),o.push(f-u),l+=v,u+=c,s="",f=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(f),s=v,f=c)):d?(a.push(l),o.push(u),l=v,u=c):(a.push(v),o.push(c));continue}f+=c,d?(l+=v,u+=c):(l&&(s+=l,l="",u=0),s+=v)}return!a.length&&!s&&(s=t,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(f)),a.length===1&&(f+=n),{accumWidth:f,lines:a,linesWidths:o}}var Qv="__zr_style_"+Math.round(Math.random()*10),ta={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},$f={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};ta[Qv]=!0;var Cm=["z","z2","invisible"],zC=["invisible"],UC=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype._init=function(r){for(var i=yt(r),n=0;n<i.length;n++){var a=i[n];a==="style"?this.useStyle(r[a]):t.prototype.attrKV.call(this,a,r[a])}this.style||this.useStyle({})},e.prototype.beforeBrush=function(){},e.prototype.afterBrush=function(){},e.prototype.innerBeforeBrush=function(){},e.prototype.innerAfterBrush=function(){},e.prototype.shouldBePainted=function(r,i,n,a){var o=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&HC(this,r,i)||o&&!o[0]&&!o[3])return!1;if(n&&this.__clipPaths){for(var s=0;s<this.__clipPaths.length;++s)if(this.__clipPaths[s].isZeroArea())return!1}if(a&&this.parent)for(var l=this.parent;l;){if(l.ignore)return!1;l=l.parent}return!0},e.prototype.contain=function(r,i){return this.rectContain(r,i)},e.prototype.traverse=function(r,i){r.call(i,this)},e.prototype.rectContain=function(r,i){var n=this.transformCoordToLocal(r,i),a=this.getBoundingRect();return a.contain(n[0],n[1])},e.prototype.getPaintRect=function(){var r=this._paintRect;if(!this._paintRect||this.__dirty){var i=this.transform,n=this.getBoundingRect(),a=this.style,o=a.shadowBlur||0,s=a.shadowOffsetX||0,l=a.shadowOffsetY||0;r=this._paintRect||(this._paintRect=new Nt(0,0,0,0)),i?Nt.applyTransform(r,n,i):r.copy(n),(o||s||l)&&(r.width+=o*2+Math.abs(s),r.height+=o*2+Math.abs(l),r.x=Math.min(r.x,r.x+s-o),r.y=Math.min(r.y,r.y+l-o));var u=this.dirtyRectTolerance;r.isZero()||(r.x=Math.floor(r.x-u),r.y=Math.floor(r.y-u),r.width=Math.ceil(r.width+1+u*2),r.height=Math.ceil(r.height+1+u*2))}return r},e.prototype.setPrevPaintRect=function(r){r?(this._prevPaintRect=this._prevPaintRect||new Nt(0,0,0,0),this._prevPaintRect.copy(r)):this._prevPaintRect=null},e.prototype.getPrevPaintRect=function(){return this._prevPaintRect},e.prototype.animateStyle=function(r){return this.animate("style",r)},e.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():this.markRedraw()},e.prototype.attrKV=function(r,i){r!=="style"?t.prototype.attrKV.call(this,r,i):this.style?this.setStyle(i):this.useStyle(i)},e.prototype.setStyle=function(r,i){return typeof r=="string"?this.style[r]=i:U(this.style,r),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(r){r||this.markRedraw(),this.__dirty|=os,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(this.__dirty&os)},e.prototype.styleUpdated=function(){this.__dirty&=~os},e.prototype.createStyle=function(r){return zf(ta,r)},e.prototype.useStyle=function(r){r[Qv]||(r=this.createStyle(r)),this.__inHover?this.__hoverStyle=r:this.style=r,this.dirtyStyle()},e.prototype.isStyleObject=function(r){return r[Qv]},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var i=this._normalState;r.style&&!i.style&&(i.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(r,i,Cm)},e.prototype._applyStateObj=function(r,i,n,a,o,s){t.prototype._applyStateObj.call(this,r,i,n,a,o,s);var l=!(i&&a),u;if(i&&i.style?o?a?u=i.style:(u=this._mergeStyle(this.createStyle(),n.style),this._mergeStyle(u,i.style)):(u=this._mergeStyle(this.createStyle(),a?this.style:n.style),this._mergeStyle(u,i.style)):l&&(u=n.style),u)if(o){var f=this.style;if(this.style=this.createStyle(l?{}:f),l)for(var h=yt(f),v=0;v<h.length;v++){var c=h[v];c in u&&(u[c]=u[c],this.style[c]=f[c])}for(var d=yt(u),v=0;v<d.length;v++){var c=d[v];this.style[c]=this.style[c]}this._transitionState(r,{style:u},s,this.getAnimationStyleProps())}else this.useStyle(u);for(var p=this.__inHover?zC:Cm,v=0;v<p.length;v++){var c=p[v];i&&i[c]!=null?this[c]=i[c]:l&&n[c]!=null&&(this[c]=n[c])}},e.prototype._mergeStates=function(r){for(var i=t.prototype._mergeStates.call(this,r),n,a=0;a<r.length;a++){var o=r[a];o.style&&(n=n||{},this._mergeStyle(n,o.style))}return n&&(i.style=n),i},e.prototype._mergeStyle=function(r,i){return U(r,i),r},e.prototype.getAnimationStyleProps=function(){return $f},e.initDefaultProps=function(){var r=e.prototype;r.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,r.__dirty=fr|os}(),e}(Gx),Jh=new Nt(0,0,0,0),tc=new Nt(0,0,0,0);function HC(t,e,r){return Jh.copy(t.getBoundingRect()),t.transform&&Jh.applyTransform(t.transform),tc.width=e,tc.height=r,!Jh.intersect(tc)}const ca=UC;var br=Math.min,Ar=Math.max,ec=Math.sin,rc=Math.cos,gn=Math.PI*2,El=To(),Cl=To(),Ml=To();function Mm(t,e,r,i,n,a){n[0]=br(t,r),n[1]=br(e,i),a[0]=Ar(t,r),a[1]=Ar(e,i)}var Dm=[],Lm=[];function VC(t,e,r,i,n,a,o,s,l,u){var f=Ax,h=ye,v=f(t,r,n,o,Dm);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var c=0;c<v;c++){var d=h(t,r,n,o,Dm[c]);l[0]=br(d,l[0]),u[0]=Ar(d,u[0])}v=f(e,i,a,s,Lm);for(var c=0;c<v;c++){var p=h(e,i,a,s,Lm[c]);l[1]=br(p,l[1]),u[1]=Ar(p,u[1])}l[0]=br(t,l[0]),u[0]=Ar(t,u[0]),l[0]=br(o,l[0]),u[0]=Ar(o,u[0]),l[1]=br(e,l[1]),u[1]=Ar(e,u[1]),l[1]=br(s,l[1]),u[1]=Ar(s,u[1])}function GC(t,e,r,i,n,a,o,s){var l=Cx,u=Pe,f=Ar(br(l(t,r,n),1),0),h=Ar(br(l(e,i,a),1),0),v=u(t,r,n,f),c=u(e,i,a,h);o[0]=br(t,n,v),o[1]=br(e,a,c),s[0]=Ar(t,n,v),s[1]=Ar(e,a,c)}function WC(t,e,r,i,n,a,o,s,l){var u=$a,f=Za,h=Math.abs(n-a);if(h%gn<1e-4&&h>1e-4){s[0]=t-r,s[1]=e-i,l[0]=t+r,l[1]=e+i;return}if(El[0]=rc(n)*r+t,El[1]=ec(n)*i+e,Cl[0]=rc(a)*r+t,Cl[1]=ec(a)*i+e,u(s,El,Cl),f(l,El,Cl),n=n%gn,n<0&&(n=n+gn),a=a%gn,a<0&&(a=a+gn),n>a&&!o?a+=gn:n<a&&o&&(n+=gn),o){var v=a;a=n,n=v}for(var c=0;c<a;c+=Math.PI/2)c>n&&(Ml[0]=rc(c)*r+t,Ml[1]=ec(c)*i+e,u(s,Ml,s),f(l,Ml,l))}var zt={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},mn=[],_n=[],Qr=[],Bi=[],Jr=[],ti=[],ic=Math.min,nc=Math.max,yn=Math.cos,xn=Math.sin,pi=Math.abs,Jv=Math.PI,Yi=Jv*2,ac=typeof Float32Array<"u",Po=[];function oc(t){var e=Math.round(t/Jv*1e8)/1e8;return e%2*Jv}function XC(t,e){var r=oc(t[0]);r<0&&(r+=Yi);var i=r-t[0],n=t[1];n+=i,!e&&n-r>=Yi?n=r+Yi:e&&r-n>=Yi?n=r-Yi:!e&&r>n?n=r+(Yi-oc(r-n)):e&&r<n&&(n=r-(Yi-oc(n-r))),t[0]=r,t[1]=n}var YC=function(){function t(e){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,e&&(this._saveData=!1),this._saveData&&(this.data=[])}return t.prototype.increaseVersion=function(){this._version++},t.prototype.getVersion=function(){return this._version},t.prototype.setScale=function(e,r,i){i=i||0,i>0&&(this._ux=pi(i/Qu/e)||0,this._uy=pi(i/Qu/r)||0)},t.prototype.setDPR=function(e){this.dpr=e},t.prototype.setContext=function(e){this._ctx=e},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(e,r){return this._drawPendingPt(),this.addData(zt.M,e,r),this._ctx&&this._ctx.moveTo(e,r),this._x0=e,this._y0=r,this._xi=e,this._yi=r,this},t.prototype.lineTo=function(e,r){var i=pi(e-this._xi),n=pi(r-this._yi),a=i>this._ux||n>this._uy;if(this.addData(zt.L,e,r),this._ctx&&a&&this._ctx.lineTo(e,r),a)this._xi=e,this._yi=r,this._pendingPtDist=0;else{var o=i*i+n*n;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=r,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(e,r,i,n,a,o){return this._drawPendingPt(),this.addData(zt.C,e,r,i,n,a,o),this._ctx&&this._ctx.bezierCurveTo(e,r,i,n,a,o),this._xi=a,this._yi=o,this},t.prototype.quadraticCurveTo=function(e,r,i,n){return this._drawPendingPt(),this.addData(zt.Q,e,r,i,n),this._ctx&&this._ctx.quadraticCurveTo(e,r,i,n),this._xi=i,this._yi=n,this},t.prototype.arc=function(e,r,i,n,a,o){this._drawPendingPt(),Po[0]=n,Po[1]=a,XC(Po,o),n=Po[0],a=Po[1];var s=a-n;return this.addData(zt.A,e,r,i,i,n,s,0,o?0:1),this._ctx&&this._ctx.arc(e,r,i,n,a,o),this._xi=yn(a)*i+e,this._yi=xn(a)*i+r,this},t.prototype.arcTo=function(e,r,i,n,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,r,i,n,a),this},t.prototype.rect=function(e,r,i,n){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,r,i,n),this.addData(zt.R,e,r,i,n),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(zt.Z);var e=this._ctx,r=this._x0,i=this._y0;return e&&e.closePath(),this._xi=r,this._yi=i,this},t.prototype.fill=function(e){e&&e.fill(),this.toStatic()},t.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(e){var r=e.length;!(this.data&&this.data.length===r)&&ac&&(this.data=new Float32Array(r));for(var i=0;i<r;i++)this.data[i]=e[i];this._len=r},t.prototype.appendPath=function(e){e instanceof Array||(e=[e]);for(var r=e.length,i=0,n=this._len,a=0;a<r;a++)i+=e[a].len();ac&&this.data instanceof Float32Array&&(this.data=new Float32Array(n+i));for(var a=0;a<r;a++)for(var o=e[a].data,s=0;s<o.length;s++)this.data[n++]=o[s];this._len=n},t.prototype.addData=function(e,r,i,n,a,o,s,l,u){if(this._saveData){var f=this.data;this._len+arguments.length>f.length&&(this._expandData(),f=this.data);for(var h=0;h<arguments.length;h++)f[this._len++]=arguments[h]}},t.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],r=0;r<this._len;r++)e[r]=this.data[r];this.data=e}},t.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,ac&&this._len>11&&(this.data=new Float32Array(e)))}},t.prototype.getBoundingRect=function(){Qr[0]=Qr[1]=Jr[0]=Jr[1]=Number.MAX_VALUE,Bi[0]=Bi[1]=ti[0]=ti[1]=-Number.MAX_VALUE;var e=this.data,r=0,i=0,n=0,a=0,o;for(o=0;o<this._len;){var s=e[o++],l=o===1;switch(l&&(r=e[o],i=e[o+1],n=r,a=i),s){case zt.M:r=n=e[o++],i=a=e[o++],Jr[0]=n,Jr[1]=a,ti[0]=n,ti[1]=a;break;case zt.L:Mm(r,i,e[o],e[o+1],Jr,ti),r=e[o++],i=e[o++];break;case zt.C:VC(r,i,e[o++],e[o++],e[o++],e[o++],e[o],e[o+1],Jr,ti),r=e[o++],i=e[o++];break;case zt.Q:GC(r,i,e[o++],e[o++],e[o],e[o+1],Jr,ti),r=e[o++],i=e[o++];break;case zt.A:var u=e[o++],f=e[o++],h=e[o++],v=e[o++],c=e[o++],d=e[o++]+c;o+=1;var p=!e[o++];l&&(n=yn(c)*h+u,a=xn(c)*v+f),WC(u,f,h,v,c,d,p,Jr,ti),r=yn(d)*h+u,i=xn(d)*v+f;break;case zt.R:n=r=e[o++],a=i=e[o++];var g=e[o++],m=e[o++];Mm(n,a,n+g,a+m,Jr,ti);break;case zt.Z:r=n,i=a;break}$a(Qr,Qr,Jr),Za(Bi,Bi,ti)}return o===0&&(Qr[0]=Qr[1]=Bi[0]=Bi[1]=0),new Nt(Qr[0],Qr[1],Bi[0]-Qr[0],Bi[1]-Qr[1])},t.prototype._calculateLength=function(){var e=this.data,r=this._len,i=this._ux,n=this._uy,a=0,o=0,s=0,l=0;this._pathSegLen||(this._pathSegLen=[]);for(var u=this._pathSegLen,f=0,h=0,v=0;v<r;){var c=e[v++],d=v===1;d&&(a=e[v],o=e[v+1],s=a,l=o);var p=-1;switch(c){case zt.M:a=s=e[v++],o=l=e[v++];break;case zt.L:{var g=e[v++],m=e[v++],_=g-a,y=m-o;(pi(_)>i||pi(y)>n||v===r-1)&&(p=Math.sqrt(_*_+y*y),a=g,o=m);break}case zt.C:{var x=e[v++],S=e[v++],g=e[v++],m=e[v++],T=e[v++],b=e[v++];p=aE(a,o,x,S,g,m,T,b,10),a=T,o=b;break}case zt.Q:{var x=e[v++],S=e[v++],g=e[v++],m=e[v++];p=sE(a,o,x,S,g,m,10),a=g,o=m;break}case zt.A:var w=e[v++],A=e[v++],C=e[v++],E=e[v++],D=e[v++],L=e[v++],R=L+D;v+=1,e[v++],d&&(s=yn(D)*C+w,l=xn(D)*E+A),p=nc(C,E)*ic(Yi,Math.abs(L)),a=yn(R)*C+w,o=xn(R)*E+A;break;case zt.R:{s=a=e[v++],l=o=e[v++];var N=e[v++],I=e[v++];p=N*2+I*2;break}case zt.Z:{var _=s-a,y=l-o;p=Math.sqrt(_*_+y*y),a=s,o=l;break}}p>=0&&(u[h++]=p,f+=p)}return this._pathLen=f,f},t.prototype.rebuildPath=function(e,r){var i=this.data,n=this._ux,a=this._uy,o=this._len,s,l,u,f,h,v,c=r<1,d,p,g=0,m=0,_,y=0,x,S;if(!(c&&(this._pathSegLen||this._calculateLength(),d=this._pathSegLen,p=this._pathLen,_=r*p,!_)))t:for(var T=0;T<o;){var b=i[T++],w=T===1;switch(w&&(u=i[T],f=i[T+1],s=u,l=f),b!==zt.L&&y>0&&(e.lineTo(x,S),y=0),b){case zt.M:s=u=i[T++],l=f=i[T++],e.moveTo(u,f);break;case zt.L:{h=i[T++],v=i[T++];var A=pi(h-u),C=pi(v-f);if(A>n||C>a){if(c){var E=d[m++];if(g+E>_){var D=(_-g)/E;e.lineTo(u*(1-D)+h*D,f*(1-D)+v*D);break t}g+=E}e.lineTo(h,v),u=h,f=v,y=0}else{var L=A*A+C*C;L>y&&(x=h,S=v,y=L)}break}case zt.C:{var R=i[T++],N=i[T++],I=i[T++],F=i[T++],O=i[T++],z=i[T++];if(c){var E=d[m++];if(g+E>_){var D=(_-g)/E;Zu(u,R,I,O,D,mn),Zu(f,N,F,z,D,_n),e.bezierCurveTo(mn[1],_n[1],mn[2],_n[2],mn[3],_n[3]);break t}g+=E}e.bezierCurveTo(R,N,I,F,O,z),u=O,f=z;break}case zt.Q:{var R=i[T++],N=i[T++],I=i[T++],F=i[T++];if(c){var E=d[m++];if(g+E>_){var D=(_-g)/E;qu(u,R,I,D,mn),qu(f,N,F,D,_n),e.quadraticCurveTo(mn[1],_n[1],mn[2],_n[2]);break t}g+=E}e.quadraticCurveTo(R,N,I,F),u=I,f=F;break}case zt.A:var k=i[T++],it=i[T++],$=i[T++],nt=i[T++],rt=i[T++],It=i[T++],gt=i[T++],Ft=!i[T++],Xt=$>nt?$:nt,Ot=pi($-nt)>.001,Mt=rt+It,q=!1;if(c){var E=d[m++];g+E>_&&(Mt=rt+It*(_-g)/E,q=!0),g+=E}if(Ot&&e.ellipse?e.ellipse(k,it,$,nt,gt,rt,Mt,Ft):e.arc(k,it,Xt,rt,Mt,Ft),q)break t;w&&(s=yn(rt)*$+k,l=xn(rt)*nt+it),u=yn(Mt)*$+k,f=xn(Mt)*nt+it;break;case zt.R:s=u=i[T],l=f=i[T+1],h=i[T++],v=i[T++];var bt=i[T++],oe=i[T++];if(c){var E=d[m++];if(g+E>_){var $t=_-g;e.moveTo(h,v),e.lineTo(h+ic($t,bt),v),$t-=bt,$t>0&&e.lineTo(h+bt,v+ic($t,oe)),$t-=oe,$t>0&&e.lineTo(h+nc(bt-$t,0),v+oe),$t-=bt,$t>0&&e.lineTo(h,v+nc(oe-$t,0));break t}g+=E}e.rect(h,v,bt,oe);break;case zt.Z:if(c){var E=d[m++];if(g+E>_){var D=(_-g)/E;e.lineTo(u*(1-D)+s*D,f*(1-D)+l*D);break t}g+=E}e.closePath(),u=s,f=l}}},t.prototype.clone=function(){var e=new t,r=this.data;return e.data=r.slice?r.slice():Array.prototype.slice.call(r),e._len=this._len,e},t.CMD=zt,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}();const Mi=YC;function wa(t,e,r,i,n,a,o){if(n===0)return!1;var s=n,l=0,u=t;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)l=(e-i)/(t-r),u=(t*i-r*e)/(t-r);else return Math.abs(a-t)<=s/2;var f=l*a-o+u,h=f*f/(l*l+1);return h<=s/2*s/2}function $C(t,e,r,i,n,a,o,s,l,u,f){if(l===0)return!1;var h=l;if(f>e+h&&f>i+h&&f>a+h&&f>s+h||f<e-h&&f<i-h&&f<a-h&&f<s-h||u>t+h&&u>r+h&&u>n+h&&u>o+h||u<t-h&&u<r-h&&u<n-h&&u<o-h)return!1;var v=Ex(t,e,r,i,n,a,o,s,u,f,null);return v<=h/2}function ZC(t,e,r,i,n,a,o,s,l){if(o===0)return!1;var u=o;if(l>e+u&&l>i+u&&l>a+u||l<e-u&&l<i-u&&l<a-u||s>t+u&&s>r+u&&s>n+u||s<t-u&&s<r-u&&s<n-u)return!1;var f=Mx(t,e,r,i,n,a,s,l,null);return f<=u/2}var Rm=Math.PI*2;function Si(t){return t%=Rm,t<0&&(t+=Rm),t}var Io=Math.PI*2;function qC(t,e,r,i,n,a,o,s,l){if(o===0)return!1;var u=o;s-=t,l-=e;var f=Math.sqrt(s*s+l*l);if(f-u>r||f+u<r)return!1;if(Math.abs(i-n)%Io<1e-4)return!0;if(a){var h=i;i=Si(n),n=Si(h)}else i=Si(i),n=Si(n);i>n&&(n+=Io);var v=Math.atan2(l,s);return v<0&&(v+=Io),v>=i&&v<=n||v+Io>=i&&v+Io<=n}function Tn(t,e,r,i,n,a){if(a>e&&a>i||a<e&&a<i||i===e)return 0;var o=(a-e)/(i-e),s=i<e?1:-1;(o===1||o===0)&&(s=i<e?.5:-.5);var l=o*(r-t)+t;return l===n?1/0:l>n?s:0}var Fi=Mi.CMD,Sn=Math.PI*2,KC=1e-4;function jC(t,e){return Math.abs(t-e)<KC}var Ue=[-1,-1,-1],Tr=[-1,-1];function QC(){var t=Tr[0];Tr[0]=Tr[1],Tr[1]=t}function JC(t,e,r,i,n,a,o,s,l,u){if(u>e&&u>i&&u>a&&u>s||u<e&&u<i&&u<a&&u<s)return 0;var f=$u(e,i,a,s,u,Ue);if(f===0)return 0;for(var h=0,v=-1,c=void 0,d=void 0,p=0;p<f;p++){var g=Ue[p],m=g===0||g===1?.5:1,_=ye(t,r,n,o,g);_<l||(v<0&&(v=Ax(e,i,a,s,Tr),Tr[1]<Tr[0]&&v>1&&QC(),c=ye(e,i,a,s,Tr[0]),v>1&&(d=ye(e,i,a,s,Tr[1]))),v===2?g<Tr[0]?h+=c<e?m:-m:g<Tr[1]?h+=d<c?m:-m:h+=s<d?m:-m:g<Tr[0]?h+=c<e?m:-m:h+=s<c?m:-m)}return h}function tM(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=oE(e,i,a,s,Ue);if(l===0)return 0;var u=Cx(e,i,a);if(u>=0&&u<=1){for(var f=0,h=Pe(e,i,a,u),v=0;v<l;v++){var c=Ue[v]===0||Ue[v]===1?.5:1,d=Pe(t,r,n,Ue[v]);d<o||(Ue[v]<u?f+=h<e?c:-c:f+=a<h?c:-c)}return f}else{var c=Ue[0]===0||Ue[0]===1?.5:1,d=Pe(t,r,n,Ue[0]);return d<o?0:a<e?c:-c}}function eM(t,e,r,i,n,a,o,s){if(s-=e,s>r||s<-r)return 0;var l=Math.sqrt(r*r-s*s);Ue[0]=-l,Ue[1]=l;var u=Math.abs(i-n);if(u<1e-4)return 0;if(u>=Sn-1e-4){i=0,n=Sn;var f=a?1:-1;return o>=Ue[0]+t&&o<=Ue[1]+t?f:0}if(i>n){var h=i;i=n,n=h}i<0&&(i+=Sn,n+=Sn);for(var v=0,c=0;c<2;c++){var d=Ue[c];if(d+t>o){var p=Math.atan2(s,d),f=a?1:-1;p<0&&(p=Sn+p),(p>=i&&p<=n||p+Sn>=i&&p+Sn<=n)&&(p>Math.PI/2&&p<Math.PI*1.5&&(f=-f),v+=f)}}return v}function lT(t,e,r,i,n){for(var a=t.data,o=t.len(),s=0,l=0,u=0,f=0,h=0,v,c,d=0;d<o;){var p=a[d++],g=d===1;switch(p===Fi.M&&d>1&&(r||(s+=Tn(l,u,f,h,i,n))),g&&(l=a[d],u=a[d+1],f=l,h=u),p){case Fi.M:f=a[d++],h=a[d++],l=f,u=h;break;case Fi.L:if(r){if(wa(l,u,a[d],a[d+1],e,i,n))return!0}else s+=Tn(l,u,a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Fi.C:if(r){if($C(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],e,i,n))return!0}else s+=JC(l,u,a[d++],a[d++],a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Fi.Q:if(r){if(ZC(l,u,a[d++],a[d++],a[d],a[d+1],e,i,n))return!0}else s+=tM(l,u,a[d++],a[d++],a[d],a[d+1],i,n)||0;l=a[d++],u=a[d++];break;case Fi.A:var m=a[d++],_=a[d++],y=a[d++],x=a[d++],S=a[d++],T=a[d++];d+=1;var b=!!(1-a[d++]);v=Math.cos(S)*y+m,c=Math.sin(S)*x+_,g?(f=v,h=c):s+=Tn(l,u,v,c,i,n);var w=(i-m)*x/y+m;if(r){if(qC(m,_,x,S,S+T,b,e,w,n))return!0}else s+=eM(m,_,x,S,S+T,b,w,n);l=Math.cos(S+T)*y+m,u=Math.sin(S+T)*x+_;break;case Fi.R:f=l=a[d++],h=u=a[d++];var A=a[d++],C=a[d++];if(v=f+A,c=h+C,r){if(wa(f,h,v,h,e,i,n)||wa(v,h,v,c,e,i,n)||wa(v,c,f,c,e,i,n)||wa(f,c,f,h,e,i,n))return!0}else s+=Tn(v,h,v,c,i,n),s+=Tn(f,c,f,h,i,n);break;case Fi.Z:if(r){if(wa(l,u,f,h,e,i,n))return!0}else s+=Tn(l,u,f,h,i,n);l=f,u=h;break}}return!r&&!jC(u,h)&&(s+=Tn(l,u,f,h,i,n)||0),s!==0}function rM(t,e,r){return lT(t,0,!1,e,r)}function iM(t,e,r,i){return lT(t,e,!0,r,i)}var ef=Lt({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},ta),nM={style:Lt({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},$f.style)},sc=ci.concat(["invisible","culling","z","z2","zlevel","parent"]),aM=function(t){G(e,t);function e(r){return t.call(this,r)||this}return 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(l){r.buildPath(l,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<sc.length;++s)n[sc[s]]=this[sc[s]];n.__dirty|=fr}else this._decalEl&&(this._decalEl=null)},e.prototype.getDecalElement=function(){return this._decalEl},e.prototype._init=function(r){var i=yt(r);this.shape=this.getDefaultShape();var n=this.getDefaultStyle();n&&this.useStyle(n);for(var a=0;a<i.length;a++){var o=i[a],s=r[o];o==="style"?this.style?U(this.style,s):this.useStyle(s):o==="shape"?U(this.shape,s):t.prototype.attrKV.call(this,o,s)}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 r=this.style.fill;if(r!=="none"){if(Z(r)){var i=Ku(r,0);return i>.5?Zv:i>.2?UE:qv}else if(r)return qv}return Zv},e.prototype.getInsideTextStroke=function(r){var i=this.style.fill;if(Z(i)){var n=this.__zr,a=!!(n&&n.isDarkMode()),o=Ku(r,0)<$v;if(a===o)return i}},e.prototype.buildPath=function(r,i,n){},e.prototype.pathUpdated=function(){this.__dirty&=~Ga},e.prototype.getUpdatedPathProxy=function(r){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,r),this.path},e.prototype.createPathProxy=function(){this.path=new Mi(!1)},e.prototype.hasStroke=function(){var r=this.style,i=r.stroke;return!(i==null||i==="none"||!(r.lineWidth>0))},e.prototype.hasFill=function(){var r=this.style,i=r.fill;return i!=null&&i!=="none"},e.prototype.getBoundingRect=function(){var r=this._rect,i=this.style,n=!r;if(n){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&Ga)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||n){s.copy(r);var l=i.strokeNoScale?this.getLineScale():1,u=i.lineWidth;if(!this.hasFill()){var f=this.strokeContainThreshold;u=Math.max(u,f??4)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return r},e.prototype.contain=function(r,i){var n=this.transformCoordToLocal(r,i),a=this.getBoundingRect(),o=this.style;if(r=n[0],i=n[1],a.contain(r,i)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),iM(s,l/u,r,i)))return!0}if(this.hasFill())return rM(s,r,i)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=Ga,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(r){return this.animate("shape",r)},e.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(r,i){r==="shape"?this.setShape(i):t.prototype.attrKV.call(this,r,i)},e.prototype.setShape=function(r,i){var n=this.shape;return n||(n=this.shape={}),typeof r=="string"?n[r]=i:U(n,r),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&Ga)},e.prototype.createStyle=function(r){return zf(ef,r)},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var i=this._normalState;r.shape&&!i.shape&&(i.shape=U({},this.shape))},e.prototype._applyStateObj=function(r,i,n,a,o,s){t.prototype._applyStateObj.call(this,r,i,n,a,o,s);var l=!(i&&a),u;if(i&&i.shape?o?a?u=i.shape:(u=U({},n.shape),U(u,i.shape)):(u=U({},a?this.shape:n.shape),U(u,i.shape)):l&&(u=n.shape),u)if(o){this.shape=U({},this.shape);for(var f={},h=yt(u),v=0;v<h.length;v++){var c=h[v];typeof u[c]=="object"?this.shape[c]=u[c]:f[c]=u[c]}this._transitionState(r,{shape:f},s)}else this.shape=u,this.dirtyShape()},e.prototype._mergeStates=function(r){for(var i=t.prototype._mergeStates.call(this,r),n,a=0;a<r.length;a++){var o=r[a];o.shape&&(n=n||{},this._mergeStyle(n,o.shape))}return n&&(i.shape=n),i},e.prototype.getAnimationStyleProps=function(){return nM},e.prototype.isZeroArea=function(){return!1},e.extend=function(r){var i=function(a){G(o,a);function o(s){var l=a.call(this,s)||this;return r.init&&r.init.call(l,s),l}return o.prototype.getDefaultStyle=function(){return ft(r.style)},o.prototype.getDefaultShape=function(){return ft(r.shape)},o}(e);for(var n in r)typeof r[n]=="function"&&(i.prototype[n]=r[n]);return i},e.initDefaultProps=function(){var r=e.prototype;r.type="path",r.strokeContainThreshold=5,r.segmentIgnoreThreshold=0,r.subPixelOptimize=!1,r.autoBatch=!1,r.__dirty=fr|os|Ga}(),e}(ca);const Ht=aM;var oM=Lt({strokeFirst:!0,font:nn,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},ef),uT=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.hasStroke=function(){var r=this.style,i=r.stroke;return i!=null&&i!=="none"&&r.lineWidth>0},e.prototype.hasFill=function(){var r=this.style,i=r.fill;return i!=null&&i!=="none"},e.prototype.createStyle=function(r){return zf(oM,r)},e.prototype.setBoundingRect=function(r){this._rect=r},e.prototype.getBoundingRect=function(){var r=this.style;if(!this._rect){var i=r.text;i!=null?i+="":i="";var n=dp(i,r.font,r.textAlign,r.textBaseline);if(n.x+=r.x||0,n.y+=r.y||0,this.hasStroke()){var a=r.lineWidth;n.x-=a/2,n.y-=a/2,n.width+=a,n.height+=a}this._rect=n}return this._rect},e.initDefaultProps=function(){var r=e.prototype;r.dirtyRectTolerance=10}(),e}(ca);uT.prototype.type="tspan";const rf=uT;var sM=Lt({x:0,y:0},ta),lM={style:Lt({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},$f.style)};function uM(t){return!!(t&&typeof t!="string"&&t.width&&t.height)}var fT=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.createStyle=function(r){return zf(sM,r)},e.prototype._getSize=function(r){var i=this.style,n=i[r];if(n!=null)return n;var a=uM(i.image)?i.image:this.__image;if(!a)return 0;var o=r==="width"?"height":"width",s=i[o];return s==null?a[r]:a[r]/a[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return lM},e.prototype.getBoundingRect=function(){var r=this.style;return this._rect||(this._rect=new Nt(r.x||0,r.y||0,this.getWidth(),this.getHeight())),this._rect},e}(ca);fT.prototype.type="image";const Nr=fT;function fM(t,e){var r=e.x,i=e.y,n=e.width,a=e.height,o=e.r,s,l,u,f;n<0&&(r=r+n,n=-n),a<0&&(i=i+a,a=-a),typeof o=="number"?s=l=u=f=o:o instanceof Array?o.length===1?s=l=u=f=o[0]:o.length===2?(s=u=o[0],l=f=o[1]):o.length===3?(s=o[0],l=f=o[1],u=o[2]):(s=o[0],l=o[1],u=o[2],f=o[3]):s=l=u=f=0;var h;s+l>n&&(h=s+l,s*=n/h,l*=n/h),u+f>n&&(h=u+f,u*=n/h,f*=n/h),l+u>a&&(h=l+u,l*=a/h,u*=a/h),s+f>a&&(h=s+f,s*=a/h,f*=a/h),t.moveTo(r+s,i),t.lineTo(r+n-l,i),l!==0&&t.arc(r+n-l,i+l,l,-Math.PI/2,0),t.lineTo(r+n,i+a-u),u!==0&&t.arc(r+n-u,i+a-u,u,0,Math.PI/2),t.lineTo(r+f,i+a),f!==0&&t.arc(r+f,i+a-f,f,Math.PI/2,Math.PI),t.lineTo(r,i+s),s!==0&&t.arc(r+s,i+s,s,Math.PI,Math.PI*1.5)}var Ka=Math.round;function hT(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&&(Ka(i*2)===Ka(n*2)&&(t.x1=t.x2=$n(i,s,!0)),Ka(a*2)===Ka(o*2)&&(t.y1=t.y2=$n(a,s,!0))),t}}function cT(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=$n(i,s,!0),t.y=$n(n,s,!0),t.width=Math.max($n(i+a,s,!1)-t.x,a===0?0:1),t.height=Math.max($n(n+o,s,!1)-t.y,o===0?0:1)),t}}function $n(t,e,r){if(!e)return t;var i=Ka(t*2);return(i+Ka(e))%2===0?i/2:(i+(r?1:-1))/2}var hM=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t}(),cM={},vT=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new hM},e.prototype.buildPath=function(r,i){var n,a,o,s;if(this.subPixelOptimize){var l=cT(cM,i,this.style);n=l.x,a=l.y,o=l.width,s=l.height,l.r=i.r,i=l}else n=i.x,a=i.y,o=i.width,s=i.height;i.r?fM(r,i):r.rect(n,a,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(Ht);vT.prototype.type="rect";const ie=vT;var Pm={fill:"#000"},Im=2,vM={style:Lt({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},$f.style)},dT=function(t){G(e,t);function e(r){var i=t.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=Pm,i.attr(r),i}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r<this._children.length;r++){var i=this._children[r];i.zlevel=this.zlevel,i.z=this.z,i.z2=this.z2,i.culling=this.culling,i.cursor=this.cursor,i.invisible=this.invisible}},e.prototype.updateTransform=function(){var r=this.innerTransformable;r?(r.updateTransform(),r.transform&&(this.transform=r.transform)):t.prototype.updateTransform.call(this)},e.prototype.getLocalTransform=function(r){var i=this.innerTransformable;return i?i.getLocalTransform(r):t.prototype.getLocalTransform.call(this,r)},e.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),t.prototype.getComputedTransform.call(this)},e.prototype._updateSubTexts=function(){this._childCursor=0,gM(this.style),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},e.prototype.addSelfToZr=function(r){t.prototype.addSelfToZr.call(this,r);for(var i=0;i<this._children.length;i++)this._children[i].__zr=r},e.prototype.removeSelfFromZr=function(r){t.prototype.removeSelfFromZr.call(this,r);for(var i=0;i<this._children.length;i++)this._children[i].__zr=null},e.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var r=new Nt(0,0,0,0),i=this._children,n=[],a=null,o=0;o<i.length;o++){var s=i[o],l=s.getBoundingRect(),u=s.getLocalTransform(n);u?(r.copy(l),r.applyTransform(u),a=a||r.clone(),a.union(r)):(a=a||l.clone(),a.union(l))}this._rect=a||r}return this._rect},e.prototype.setDefaultTextStyle=function(r){this._defaultStyle=r||Pm},e.prototype.setTextContent=function(r){},e.prototype._mergeStyle=function(r,i){if(!i)return r;var n=i.rich,a=r.rich||n&&{};return U(r,i),n&&a?(this._mergeRich(a,n),r.rich=a):a&&(r.rich=a),r},e.prototype._mergeRich=function(r,i){for(var n=yt(i),a=0;a<n.length;a++){var o=n[a];r[o]=r[o]||{},U(r[o],i[o])}},e.prototype.getAnimationStyleProps=function(){return vM},e.prototype._getOrCreateChild=function(r){var i=this._children[this._childCursor];return(!i||!(i instanceof r))&&(i=new r),this._children[this._childCursor++]=i,i.__zr=this.__zr,i.parent=this,i},e.prototype._updatePlainTexts=function(){var r=this.style,i=r.font||nn,n=r.padding,a=Um(r),o=PC(a,r),s=lc(r),l=!!r.backgroundColor,u=o.outerHeight,f=o.outerWidth,h=o.contentWidth,v=o.lines,c=o.lineHeight,d=this._defaultStyle,p=r.x||0,g=r.y||0,m=r.align||d.align||"left",_=r.verticalAlign||d.verticalAlign||"top",y=p,x=Wa(g,o.contentHeight,_);if(s||n){var S=ls(p,f,m),T=Wa(g,u,_);s&&this._renderBackground(r,r,S,T,f,u)}x+=c/2,n&&(y=zm(p,m,n),_==="top"?x+=n[0]:_==="bottom"&&(x-=n[2]));for(var b=0,w=!1,A=km("fill"in r?r.fill:(w=!0,d.fill)),C=Fm("stroke"in r?r.stroke:!l&&(!d.autoStroke||w)?(b=Im,d.stroke):null),E=r.textShadowBlur>0,D=r.width!=null&&(r.overflow==="truncate"||r.overflow==="break"||r.overflow==="breakAll"),L=o.calculatedLineHeight,R=0;R<v.length;R++){var N=this._getOrCreateChild(rf),I=N.createStyle();N.useStyle(I),I.text=v[R],I.x=y,I.y=x,m&&(I.textAlign=m),I.textBaseline="middle",I.opacity=r.opacity,I.strokeFirst=!0,E&&(I.shadowBlur=r.textShadowBlur||0,I.shadowColor=r.textShadowColor||"transparent",I.shadowOffsetX=r.textShadowOffsetX||0,I.shadowOffsetY=r.textShadowOffsetY||0),I.stroke=C,I.fill=A,C&&(I.lineWidth=r.lineWidth||b,I.lineDash=r.lineDash,I.lineDashOffset=r.lineDashOffset||0),I.font=i,Om(I,r),x+=c,D&&N.setBoundingRect(new Nt(ls(I.x,r.width,I.textAlign),Wa(I.y,L,I.textBaseline),h,L))}},e.prototype._updateRichTexts=function(){var r=this.style,i=Um(r),n=OC(i,r),a=n.width,o=n.outerWidth,s=n.outerHeight,l=r.padding,u=r.x||0,f=r.y||0,h=this._defaultStyle,v=r.align||h.align,c=r.verticalAlign||h.verticalAlign,d=ls(u,o,v),p=Wa(f,s,c),g=d,m=p;l&&(g+=l[3],m+=l[0]);var _=g+a;lc(r)&&this._renderBackground(r,r,d,p,o,s);for(var y=!!r.backgroundColor,x=0;x<n.lines.length;x++){for(var S=n.lines[x],T=S.tokens,b=T.length,w=S.lineHeight,A=S.width,C=0,E=g,D=_,L=b-1,R=void 0;C<b&&(R=T[C],!R.align||R.align==="left");)this._placeToken(R,r,w,m,E,"left",y),A-=R.width,E+=R.width,C++;for(;L>=0&&(R=T[L],R.align==="right");)this._placeToken(R,r,w,m,D,"right",y),A-=R.width,D-=R.width,L--;for(E+=(a-(E-g)-(_-D)-A)/2;C<=L;)R=T[C],this._placeToken(R,r,w,m,E+R.width/2,"center",y),E+=R.width,C++;m+=w}},e.prototype._placeToken=function(r,i,n,a,o,s,l){var u=i.rich[r.styleName]||{};u.text=r.text;var f=r.verticalAlign,h=a+n/2;f==="top"?h=a+r.height/2:f==="bottom"&&(h=a+n-r.height/2);var v=!r.isLineHolder&&lc(u);v&&this._renderBackground(u,i,s==="right"?o-r.width:s==="center"?o-r.width/2:o,h-r.height/2,r.width,r.height);var c=!!u.backgroundColor,d=r.textPadding;d&&(o=zm(o,s,d),h-=r.height/2-d[0]-r.innerHeight/2);var p=this._getOrCreateChild(rf),g=p.createStyle();p.useStyle(g);var m=this._defaultStyle,_=!1,y=0,x=km("fill"in u?u.fill:"fill"in i?i.fill:(_=!0,m.fill)),S=Fm("stroke"in u?u.stroke:"stroke"in i?i.stroke:!c&&!l&&(!m.autoStroke||_)?(y=Im,m.stroke):null),T=u.textShadowBlur>0||i.textShadowBlur>0;g.text=r.text,g.x=o,g.y=h,T&&(g.shadowBlur=u.textShadowBlur||i.textShadowBlur||0,g.shadowColor=u.textShadowColor||i.textShadowColor||"transparent",g.shadowOffsetX=u.textShadowOffsetX||i.textShadowOffsetX||0,g.shadowOffsetY=u.textShadowOffsetY||i.textShadowOffsetY||0),g.textAlign=s,g.textBaseline="middle",g.font=r.font||nn,g.opacity=gu(u.opacity,i.opacity,1),Om(g,u),S&&(g.lineWidth=gu(u.lineWidth,i.lineWidth,y),g.lineDash=mt(u.lineDash,i.lineDash),g.lineDashOffset=i.lineDashOffset||0,g.stroke=S),x&&(g.fill=x);var b=r.contentWidth,w=r.contentHeight;p.setBoundingRect(new Nt(ls(g.x,b,g.textAlign),Wa(g.y,w,g.textBaseline),b,w))},e.prototype._renderBackground=function(r,i,n,a,o,s){var l=r.backgroundColor,u=r.borderWidth,f=r.borderColor,h=l&&l.image,v=l&&!h,c=r.borderRadius,d=this,p,g;if(v||r.lineHeight||u&&f){p=this._getOrCreateChild(ie),p.useStyle(p.createStyle()),p.style.fill=null;var m=p.shape;m.x=n,m.y=a,m.width=o,m.height=s,m.r=c,p.dirtyShape()}if(v){var _=p.style;_.fill=l||null,_.fillOpacity=mt(r.fillOpacity,1)}else if(h){g=this._getOrCreateChild(Nr),g.onload=function(){d.dirtyStyle()};var y=g.style;y.image=l.image,y.x=n,y.y=a,y.width=o,y.height=s}if(u&&f){var _=p.style;_.lineWidth=u,_.stroke=f,_.strokeOpacity=mt(r.strokeOpacity,1),_.lineDash=r.borderDash,_.lineDashOffset=r.borderDashOffset||0,p.strokeContainThreshold=0,p.hasFill()&&p.hasStroke()&&(_.strokeFirst=!0,_.lineWidth*=2)}var x=(p||g).style;x.shadowBlur=r.shadowBlur||0,x.shadowColor=r.shadowColor||"transparent",x.shadowOffsetX=r.shadowOffsetX||0,x.shadowOffsetY=r.shadowOffsetY||0,x.opacity=gu(r.opacity,i.opacity,1)},e.makeFont=function(r){var i="";return gT(r)&&(i=[r.fontStyle,r.fontWeight,pT(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),i&&li(i)||r.textFont||r.font},e}(ca),dM={left:!0,right:1,center:1},pM={top:1,bottom:1,middle:1},Nm=["fontStyle","fontWeight","fontSize","fontFamily"];function pT(t){return typeof t=="string"&&(t.indexOf("px")!==-1||t.indexOf("rem")!==-1||t.indexOf("em")!==-1)?t:isNaN(+t)?ip+"px":t+"px"}function Om(t,e){for(var r=0;r<Nm.length;r++){var i=Nm[r],n=e[i];n!=null&&(t[i]=n)}}function gT(t){return t.fontSize!=null||t.fontFamily||t.fontWeight}function gM(t){return Bm(t),M(t.rich,Bm),t}function Bm(t){if(t){t.font=dT.makeFont(t);var e=t.align;e==="middle"&&(e="center"),t.align=e==null||dM[e]?e:"left";var r=t.verticalAlign;r==="center"&&(r="middle"),t.verticalAlign=r==null||pM[r]?r:"top";var i=t.padding;i&&(t.padding=hx(t.padding))}}function Fm(t,e){return t==null||e<=0||t==="transparent"||t==="none"?null:t.image||t.colorStops?"#000":t}function km(t){return t==null||t==="none"?null:t.image||t.colorStops?"#000":t}function zm(t,e,r){return e==="right"?t-r[1]:e==="center"?t+r[3]/2-r[1]/2:t+r[3]}function Um(t){var e=t.text;return e!=null&&(e+=""),e}function lc(t){return!!(t.backgroundColor||t.lineHeight||t.borderWidth&&t.borderColor)}const Jt=dT;var kt=Kt(),mM=function(t,e,r,i){if(i){var n=kt(i);n.dataIndex=r,n.dataType=e,n.seriesIndex=t,i.type==="group"&&i.traverse(function(a){var o=kt(a);o.seriesIndex=t,o.dataIndex=r,o.dataType=e})}},Hm=1,Vm={},mT=Kt(),Sp=Kt(),wp=0,Zf=1,qf=2,Pr=["emphasis","blur","select"],nf=["normal","emphasis","blur","select"],_M=10,yM=9,ea="highlight",bu="downplay",xs="select",Au="unselect",Ts="toggleSelect";function ba(t){return t!=null&&t!=="none"}var Gm=new So(100);function Wm(t){if(Z(t)){var e=Gm.get(t);return e||(e=sm(t,-.1),Gm.put(t,e)),e}else if(kf(t)){var r=U({},t);return r.colorStops=K(t.colorStops,function(i){return{offset:i.offset,color:sm(i.color,-.1)}}),r}return t}function Kf(t,e,r){t.onHoverStateChange&&(t.hoverState||0)!==r&&t.onHoverStateChange(e),t.hoverState=r}function _T(t){Kf(t,"emphasis",qf)}function yT(t){t.hoverState===qf&&Kf(t,"normal",wp)}function bp(t){Kf(t,"blur",Zf)}function xT(t){t.hoverState===Zf&&Kf(t,"normal",wp)}function xM(t){t.selected=!0}function TM(t){t.selected=!1}function Xm(t,e,r){e(t,r)}function Li(t,e,r){Xm(t,e,r),t.isGroup&&t.traverse(function(i){Xm(i,e,r)})}function Ym(t,e){switch(e){case"emphasis":t.hoverState=qf;break;case"normal":t.hoverState=wp;break;case"blur":t.hoverState=Zf;break;case"select":t.selected=!0}}function SM(t,e,r,i){for(var n=t.style,a={},o=0;o<e.length;o++){var s=e[o],l=n[s];a[s]=l??(i&&i[s])}for(var o=0;o<t.animators.length;o++){var u=t.animators[o];u.__fromStateTransition&&u.__fromStateTransition.indexOf(r)<0&&u.targetName==="style"&&u.saveTo(a,e)}return a}function wM(t,e,r,i){var n=r&&Dt(r,"select")>=0,a=!1;if(t instanceof Ht){var o=mT(t),s=n&&o.selectFill||o.normalFill,l=n&&o.selectStroke||o.normalStroke;if(ba(s)||ba(l)){i=i||{};var u=i.style||{};u.fill==="inherit"?(a=!0,i=U({},i),u=U({},u),u.fill=s):!ba(u.fill)&&ba(s)?(a=!0,i=U({},i),u=U({},u),u.fill=Wm(s)):!ba(u.stroke)&&ba(l)&&(a||(i=U({},i),u=U({},u)),u.stroke=Wm(l)),i.style=u}}if(i&&i.z2==null){a||(i=U({},i));var f=t.z2EmphasisLift;i.z2=t.z2+(f??_M)}return i}function bM(t,e,r){if(r&&r.z2==null){r=U({},r);var i=t.z2SelectLift;r.z2=t.z2+(i??yM)}return r}function AM(t,e,r){var i=Dt(t.currentStates,e)>=0,n=t.style.opacity,a=i?null:SM(t,["opacity"],e,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=U({},r),o=U({opacity:i?n:a.opacity*.1},o),r.style=o),r}function uc(t,e){var r=this.states[t];if(this.style){if(t==="emphasis")return wM(this,t,e,r);if(t==="blur")return AM(this,t,r);if(t==="select")return bM(this,t,r)}return r}function EM(t){t.stateProxy=uc;var e=t.getTextContent(),r=t.getTextGuideLine();e&&(e.stateProxy=uc),r&&(r.stateProxy=uc)}function $m(t,e){!bT(t,e)&&!t.__highByOuter&&Li(t,_T)}function Zm(t,e){!bT(t,e)&&!t.__highByOuter&&Li(t,yT)}function af(t,e){t.__highByOuter|=1<<(e||0),Li(t,_T)}function of(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&Li(t,yT)}function CM(t){Li(t,bp)}function TT(t){Li(t,xT)}function ST(t){Li(t,xM)}function wT(t){Li(t,TM)}function bT(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function AT(t){var e=t.getModel(),r=[],i=[];e.eachComponent(function(n,a){var o=Sp(a),s=n==="series",l=s?t.getViewOfSeriesModel(a):t.getViewOfComponentModel(a);!s&&i.push(l),o.isBlured&&(l.group.traverse(function(u){xT(u)}),s&&r.push(a)),o.isBlured=!1}),M(i,function(n){n&&n.toggleBlurSeries&&n.toggleBlurSeries(r,!1,e)})}function td(t,e,r,i){var n=i.getModel();r=r||"coordinateSystem";function a(u,f){for(var h=0;h<f.length;h++){var v=u.getItemGraphicEl(f[h]);v&&TT(v)}}if(t!=null&&!(!e||e==="none")){var o=n.getSeriesByIndex(t),s=o.coordinateSystem;s&&s.master&&(s=s.master);var l=[];n.eachSeries(function(u){var f=o===u,h=u.coordinateSystem;h&&h.master&&(h=h.master);var v=h&&s?h===s:f;if(!(r==="series"&&!f||r==="coordinateSystem"&&!v||e==="series"&&f)){var c=i.getViewOfSeriesModel(u);if(c.group.traverse(function(g){g.__highByOuter&&f&&e==="self"||bp(g)}),$e(e))a(u.getData(),e);else if(j(e))for(var d=yt(e),p=0;p<d.length;p++)a(u.getData(d[p]),e[d[p]]);l.push(u),Sp(u).isBlured=!0}}),n.eachComponent(function(u,f){if(u!=="series"){var h=i.getViewOfComponentModel(f);h&&h.toggleBlurSeries&&h.toggleBlurSeries(l,!0,n)}})}}function ed(t,e,r){if(!(t==null||e==null)){var i=r.getModel().getComponent(t,e);if(i){Sp(i).isBlured=!0;var n=r.getViewOfComponentModel(i);!n||!n.focusBlurEnabled||n.group.traverse(function(a){bp(a)})}}}function MM(t,e,r){var i=t.seriesIndex,n=t.getData(e.dataType);if(n){var a=sa(n,e);a=(X(a)?a[0]:a)||0;var o=n.getItemGraphicEl(a);if(!o)for(var s=n.count(),l=0;!o&&l<s;)o=n.getItemGraphicEl(l++);if(o){var u=kt(o);td(i,u.focus,u.blurScope,r)}else{var f=t.get(["emphasis","focus"]),h=t.get(["emphasis","blurScope"]);f!=null&&td(i,f,h,r)}}}function Ap(t,e,r,i){var n={focusSelf:!1,dispatchers:null};if(t==null||t==="series"||e==null||r==null)return n;var a=i.getModel().getComponent(t,e);if(!a)return n;var o=i.getViewOfComponentModel(a);if(!o||!o.findHighDownDispatchers)return n;for(var s=o.findHighDownDispatchers(r),l,u=0;u<s.length;u++)if(kt(s[u]).focus==="self"){l=!0;break}return{focusSelf:l,dispatchers:s}}function DM(t,e,r){var i=kt(t),n=Ap(i.componentMainType,i.componentIndex,i.componentHighDownName,r),a=n.dispatchers,o=n.focusSelf;a?(o&&ed(i.componentMainType,i.componentIndex,r),M(a,function(s){return $m(s,e)})):(td(i.seriesIndex,i.focus,i.blurScope,r),i.focus==="self"&&ed(i.componentMainType,i.componentIndex,r),$m(t,e))}function LM(t,e,r){AT(r);var i=kt(t),n=Ap(i.componentMainType,i.componentIndex,i.componentHighDownName,r).dispatchers;n?M(n,function(a){return Zm(a,e)}):Zm(t,e)}function RM(t,e,r){if(nd(e)){var i=e.dataType,n=t.getData(i),a=sa(n,e);X(a)||(a=[a]),t[e.type===Ts?"toggleSelect":e.type===xs?"select":"unselect"](a,i)}}function qm(t){var e=t.getAllData();M(e,function(r){var i=r.data,n=r.type;i.eachItemGraphicEl(function(a,o){t.isSelected(o,n)?ST(a):wT(a)})})}function PM(t){var e=[];return t.eachSeries(function(r){var i=r.getAllData();M(i,function(n){n.data;var a=n.type,o=r.getSelectedDataIndices();if(o.length>0){var s={dataIndex:o,seriesIndex:r.seriesIndex};a!=null&&(s.dataType=a),e.push(s)}})}),e}function sf(t,e,r){Ep(t,!0),Li(t,EM),NM(t,e,r)}function IM(t){Ep(t,!1)}function rd(t,e,r,i){i?IM(t):sf(t,e,r)}function NM(t,e,r){var i=kt(t);e!=null?(i.focus=e,i.blurScope=r):i.focus&&(i.focus=null)}var Km=["emphasis","blur","select"],OM={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function jm(t,e,r,i){r=r||"itemStyle";for(var n=0;n<Km.length;n++){var a=Km[n],o=e.getModel([a,r]),s=t.ensureState(a);s.style=i?i(o):o[OM[r]]()}}function Ep(t,e){var r=e===!1,i=t;t.highDownSilentOnTouch&&(i.__highDownSilentOnTouch=t.highDownSilentOnTouch),(!r||i.__highDownDispatcher)&&(i.__highByOuter=i.__highByOuter||0,i.__highDownDispatcher=!r)}function id(t){return!!(t&&t.__highDownDispatcher)}function BM(t){var e=Vm[t];return e==null&&Hm<=32&&(e=Vm[t]=Hm++),e}function nd(t){var e=t.type;return e===xs||e===Au||e===Ts}function Qm(t){var e=t.type;return e===ea||e===bu}function FM(t){var e=mT(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var r=t.states.select||{};e.selectFill=r.style&&r.style.fill||null,e.selectStroke=r.style&&r.style.stroke||null}var Aa=Mi.CMD,kM=[[],[],[]],Jm=Math.sqrt,zM=Math.atan2;function UM(t,e){if(e){var r=t.data,i=t.len(),n,a,o,s,l,u,f=Aa.M,h=Aa.C,v=Aa.L,c=Aa.R,d=Aa.A,p=Aa.Q;for(o=0,s=0;o<i;){switch(n=r[o++],s=o,a=0,n){case f:a=1;break;case v:a=1;break;case h:a=3;break;case p:a=2;break;case d:var g=e[4],m=e[5],_=Jm(e[0]*e[0]+e[1]*e[1]),y=Jm(e[2]*e[2]+e[3]*e[3]),x=zM(-e[1]/y,e[0]/_);r[o]*=_,r[o++]+=g,r[o]*=y,r[o++]+=m,r[o++]*=_,r[o++]*=y,r[o++]+=x,r[o++]+=x,o+=2,s=o;break;case c:u[0]=r[o++],u[1]=r[o++],Lr(u,u,e),r[s++]=u[0],r[s++]=u[1],u[0]+=r[o++],u[1]+=r[o++],Lr(u,u,e),r[s++]=u[0],r[s++]=u[1]}for(l=0;l<a;l++){var S=kM[l];S[0]=r[o++],S[1]=r[o++],Lr(S,S,e),r[s++]=S[0],r[s++]=S[1]}}t.increaseVersion()}}var fc=Math.sqrt,Dl=Math.sin,Ll=Math.cos,No=Math.PI;function t_(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ad(t,e){return(t[0]*e[0]+t[1]*e[1])/(t_(t)*t_(e))}function e_(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(ad(t,e))}function r_(t,e,r,i,n,a,o,s,l,u,f){var h=l*(No/180),v=Ll(h)*(t-r)/2+Dl(h)*(e-i)/2,c=-1*Dl(h)*(t-r)/2+Ll(h)*(e-i)/2,d=v*v/(o*o)+c*c/(s*s);d>1&&(o*=fc(d),s*=fc(d));var p=(n===a?-1:1)*fc((o*o*(s*s)-o*o*(c*c)-s*s*(v*v))/(o*o*(c*c)+s*s*(v*v)))||0,g=p*o*c/s,m=p*-s*v/o,_=(t+r)/2+Ll(h)*g-Dl(h)*m,y=(e+i)/2+Dl(h)*g+Ll(h)*m,x=e_([1,0],[(v-g)/o,(c-m)/s]),S=[(v-g)/o,(c-m)/s],T=[(-1*v-g)/o,(-1*c-m)/s],b=e_(S,T);if(ad(S,T)<=-1&&(b=No),ad(S,T)>=1&&(b=0),b<0){var w=Math.round(b/No*1e6)/1e6;b=No*2+w%2*No}f.addData(u,_,y,o,s,x,b,h,a)}var HM=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,VM=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function GM(t){var e=new Mi;if(!t)return e;var r=0,i=0,n=r,a=i,o,s=Mi.CMD,l=t.match(HM);if(!l)return e;for(var u=0;u<l.length;u++){for(var f=l[u],h=f.charAt(0),v=void 0,c=f.match(VM)||[],d=c.length,p=0;p<d;p++)c[p]=parseFloat(c[p]);for(var g=0;g<d;){var m=void 0,_=void 0,y=void 0,x=void 0,S=void 0,T=void 0,b=void 0,w=r,A=i,C=void 0,E=void 0;switch(h){case"l":r+=c[g++],i+=c[g++],v=s.L,e.addData(v,r,i);break;case"L":r=c[g++],i=c[g++],v=s.L,e.addData(v,r,i);break;case"m":r+=c[g++],i+=c[g++],v=s.M,e.addData(v,r,i),n=r,a=i,h="l";break;case"M":r=c[g++],i=c[g++],v=s.M,e.addData(v,r,i),n=r,a=i,h="L";break;case"h":r+=c[g++],v=s.L,e.addData(v,r,i);break;case"H":r=c[g++],v=s.L,e.addData(v,r,i);break;case"v":i+=c[g++],v=s.L,e.addData(v,r,i);break;case"V":i=c[g++],v=s.L,e.addData(v,r,i);break;case"C":v=s.C,e.addData(v,c[g++],c[g++],c[g++],c[g++],c[g++],c[g++]),r=c[g-2],i=c[g-1];break;case"c":v=s.C,e.addData(v,c[g++]+r,c[g++]+i,c[g++]+r,c[g++]+i,c[g++]+r,c[g++]+i),r+=c[g-2],i+=c[g-1];break;case"S":m=r,_=i,C=e.len(),E=e.data,o===s.C&&(m+=r-E[C-4],_+=i-E[C-3]),v=s.C,w=c[g++],A=c[g++],r=c[g++],i=c[g++],e.addData(v,m,_,w,A,r,i);break;case"s":m=r,_=i,C=e.len(),E=e.data,o===s.C&&(m+=r-E[C-4],_+=i-E[C-3]),v=s.C,w=r+c[g++],A=i+c[g++],r+=c[g++],i+=c[g++],e.addData(v,m,_,w,A,r,i);break;case"Q":w=c[g++],A=c[g++],r=c[g++],i=c[g++],v=s.Q,e.addData(v,w,A,r,i);break;case"q":w=c[g++]+r,A=c[g++]+i,r+=c[g++],i+=c[g++],v=s.Q,e.addData(v,w,A,r,i);break;case"T":m=r,_=i,C=e.len(),E=e.data,o===s.Q&&(m+=r-E[C-4],_+=i-E[C-3]),r=c[g++],i=c[g++],v=s.Q,e.addData(v,m,_,r,i);break;case"t":m=r,_=i,C=e.len(),E=e.data,o===s.Q&&(m+=r-E[C-4],_+=i-E[C-3]),r+=c[g++],i+=c[g++],v=s.Q,e.addData(v,m,_,r,i);break;case"A":y=c[g++],x=c[g++],S=c[g++],T=c[g++],b=c[g++],w=r,A=i,r=c[g++],i=c[g++],v=s.A,r_(w,A,r,i,T,b,y,x,S,v,e);break;case"a":y=c[g++],x=c[g++],S=c[g++],T=c[g++],b=c[g++],w=r,A=i,r+=c[g++],i+=c[g++],v=s.A,r_(w,A,r,i,T,b,y,x,S,v,e);break}}(h==="z"||h==="Z")&&(v=s.Z,e.addData(v),r=n,i=a),o=v}return e.toStatic(),e}var ET=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.applyTransform=function(r){},e}(Ht);function CT(t){return t.setData!=null}function MT(t,e){var r=GM(t),i=U({},e);return i.buildPath=function(n){if(CT(n)){n.setData(r.data);var a=n.getContext();a&&n.rebuildPath(a,1)}else{var a=n;r.rebuildPath(a,1)}},i.applyTransform=function(n){UM(r,n),this.dirtyShape()},i}function WM(t,e){return new ET(MT(t,e))}function XM(t,e){var r=MT(t,e),i=function(n){G(a,n);function a(o){var s=n.call(this,o)||this;return s.applyTransform=r.applyTransform,s.buildPath=r.buildPath,s}return a}(ET);return i}function YM(t,e){for(var r=[],i=t.length,n=0;n<i;n++){var a=t[n];r.push(a.getUpdatedPathProxy(!0))}var o=new Ht(e);return o.createPathProxy(),o.buildPath=function(s){if(CT(s)){s.appendPath(r);var l=s.getContext();l&&s.rebuildPath(l,1)}},o}var $M=function(){function t(){this.cx=0,this.cy=0,this.r=0}return t}(),DT=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new $M},e.prototype.buildPath=function(r,i){r.moveTo(i.cx+i.r,i.cy),r.arc(i.cx,i.cy,i.r,0,Math.PI*2)},e}(Ht);DT.prototype.type="circle";const Cp=DT;var ZM=function(){function t(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return t}(),LT=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new ZM},e.prototype.buildPath=function(r,i){var n=.5522848,a=i.cx,o=i.cy,s=i.rx,l=i.ry,u=s*n,f=l*n;r.moveTo(a-s,o),r.bezierCurveTo(a-s,o-f,a-u,o-l,a,o-l),r.bezierCurveTo(a+u,o-l,a+s,o-f,a+s,o),r.bezierCurveTo(a+s,o+f,a+u,o+l,a,o+l),r.bezierCurveTo(a-u,o+l,a-s,o+f,a-s,o),r.closePath()},e}(Ht);LT.prototype.type="ellipse";const RT=LT;var PT=Math.PI,hc=PT*2,wn=Math.sin,Ea=Math.cos,qM=Math.acos,Le=Math.atan2,i_=Math.abs,Ss=Math.sqrt,us=Math.max,ei=Math.min,Ur=1e-4;function KM(t,e,r,i,n,a,o,s){var l=r-t,u=i-e,f=o-n,h=s-a,v=h*l-f*u;if(!(v*v<Ur))return v=(f*(e-a)-h*(t-n))/v,[t+v*l,e+v*u]}function Rl(t,e,r,i,n,a,o){var s=t-r,l=e-i,u=(o?a:-a)/Ss(s*s+l*l),f=u*l,h=-u*s,v=t+f,c=e+h,d=r+f,p=i+h,g=(v+d)/2,m=(c+p)/2,_=d-v,y=p-c,x=_*_+y*y,S=n-a,T=v*p-d*c,b=(y<0?-1:1)*Ss(us(0,S*S*x-T*T)),w=(T*y-_*b)/x,A=(-T*_-y*b)/x,C=(T*y+_*b)/x,E=(-T*_+y*b)/x,D=w-g,L=A-m,R=C-g,N=E-m;return D*D+L*L>R*R+N*N&&(w=C,A=E),{cx:w,cy:A,x0:-f,y0:-h,x1:w*(n/S-1),y1:A*(n/S-1)}}function jM(t){var e;if(X(t)){var r=t.length;if(!r)return t;r===1?e=[t[0],t[0],0,0]:r===2?e=[t[0],t[0],t[1],t[1]]:r===3?e=t.concat(t[2]):e=t}else e=[t,t,t,t];return e}function QM(t,e){var r,i=us(e.r,0),n=us(e.r0||0,0),a=i>0,o=n>0;if(!(!a&&!o)){if(a||(i=n,n=0),n>i){var s=i;i=n,n=s}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var f=e.cx,h=e.cy,v=!!e.clockwise,c=i_(u-l),d=c>hc&&c%hc;if(d>Ur&&(c=d),!(i>Ur))t.moveTo(f,h);else if(c>hc-Ur)t.moveTo(f+i*Ea(l),h+i*wn(l)),t.arc(f,h,i,l,u,!v),n>Ur&&(t.moveTo(f+n*Ea(u),h+n*wn(u)),t.arc(f,h,n,u,l,v));else{var p=void 0,g=void 0,m=void 0,_=void 0,y=void 0,x=void 0,S=void 0,T=void 0,b=void 0,w=void 0,A=void 0,C=void 0,E=void 0,D=void 0,L=void 0,R=void 0,N=i*Ea(l),I=i*wn(l),F=n*Ea(u),O=n*wn(u),z=c>Ur;if(z){var k=e.cornerRadius;k&&(r=jM(k),p=r[0],g=r[1],m=r[2],_=r[3]);var it=i_(i-n)/2;if(y=ei(it,m),x=ei(it,_),S=ei(it,p),T=ei(it,g),A=b=us(y,x),C=w=us(S,T),(b>Ur||w>Ur)&&(E=i*Ea(u),D=i*wn(u),L=n*Ea(l),R=n*wn(l),c<PT)){var $=KM(N,I,L,R,E,D,F,O);if($){var nt=N-$[0],rt=I-$[1],It=E-$[0],gt=D-$[1],Ft=1/wn(qM((nt*It+rt*gt)/(Ss(nt*nt+rt*rt)*Ss(It*It+gt*gt)))/2),Xt=Ss($[0]*$[0]+$[1]*$[1]);A=ei(b,(i-Xt)/(Ft+1)),C=ei(w,(n-Xt)/(Ft-1))}}}if(!z)t.moveTo(f+N,h+I);else if(A>Ur){var Ot=ei(m,A),Mt=ei(_,A),q=Rl(L,R,N,I,i,Ot,v),bt=Rl(E,D,F,O,i,Mt,v);t.moveTo(f+q.cx+q.x0,h+q.cy+q.y0),A<b&&Ot===Mt?t.arc(f+q.cx,h+q.cy,A,Le(q.y0,q.x0),Le(bt.y0,bt.x0),!v):(Ot>0&&t.arc(f+q.cx,h+q.cy,Ot,Le(q.y0,q.x0),Le(q.y1,q.x1),!v),t.arc(f,h,i,Le(q.cy+q.y1,q.cx+q.x1),Le(bt.cy+bt.y1,bt.cx+bt.x1),!v),Mt>0&&t.arc(f+bt.cx,h+bt.cy,Mt,Le(bt.y1,bt.x1),Le(bt.y0,bt.x0),!v))}else t.moveTo(f+N,h+I),t.arc(f,h,i,l,u,!v);if(!(n>Ur)||!z)t.lineTo(f+F,h+O);else if(C>Ur){var Ot=ei(p,C),Mt=ei(g,C),q=Rl(F,O,E,D,n,-Mt,v),bt=Rl(N,I,L,R,n,-Ot,v);t.lineTo(f+q.cx+q.x0,h+q.cy+q.y0),C<w&&Ot===Mt?t.arc(f+q.cx,h+q.cy,C,Le(q.y0,q.x0),Le(bt.y0,bt.x0),!v):(Mt>0&&t.arc(f+q.cx,h+q.cy,Mt,Le(q.y0,q.x0),Le(q.y1,q.x1),!v),t.arc(f,h,n,Le(q.cy+q.y1,q.cx+q.x1),Le(bt.cy+bt.y1,bt.cx+bt.x1),v),Ot>0&&t.arc(f+bt.cx,h+bt.cy,Ot,Le(bt.y1,bt.x1),Le(bt.y0,bt.x0),!v))}else t.lineTo(f+F,h+O),t.arc(f,h,n,u,l,v)}t.closePath()}}}var JM=function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return t}(),IT=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new JM},e.prototype.buildPath=function(r,i){QM(r,i)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(Ht);IT.prototype.type="sector";const Mp=IT;var tD=function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t}(),NT=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new tD},e.prototype.buildPath=function(r,i){var n=i.cx,a=i.cy,o=Math.PI*2;r.moveTo(n+i.r,a),r.arc(n,a,i.r,0,o,!1),r.moveTo(n+i.r0,a),r.arc(n,a,i.r0,0,o,!0)},e}(Ht);NT.prototype.type="ring";const OT=NT;function eD(t,e,r,i){var n=[],a=[],o=[],s=[],l,u,f,h;if(i){f=[1/0,1/0],h=[-1/0,-1/0];for(var v=0,c=t.length;v<c;v++)$a(f,f,t[v]),Za(h,h,t[v]);$a(f,f,i[0]),Za(h,h,i[1])}for(var v=0,c=t.length;v<c;v++){var d=t[v];if(r)l=t[v?v-1:c-1],u=t[(v+1)%c];else if(v===0||v===c-1){n.push(SA(t[v]));continue}else l=t[v-1],u=t[v+1];wA(a,u,l),Eh(a,a,e);var p=Iv(d,l),g=Iv(d,u),m=p+g;m!==0&&(p/=m,g/=m),Eh(o,a,-p),Eh(s,a,g);var _=Yg([],d,o),y=Yg([],d,s);i&&(Za(_,_,f),$a(_,_,h),Za(y,y,f),$a(y,y,h)),n.push(_),n.push(y)}return r&&n.push(n.shift()),n}function BT(t,e,r){var i=e.smooth,n=e.points;if(n&&n.length>=2){if(i){var a=eD(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[s*2],u=a[s*2+1],f=n[(s+1)%o];t.bezierCurveTo(l[0],l[1],u[0],u[1],f[0],f[1])}}else{t.moveTo(n[0][0],n[0][1]);for(var s=1,h=n.length;s<h;s++)t.lineTo(n[s][0],n[s][1])}r&&t.closePath()}}var rD=function(){function t(){this.points=null,this.smooth=0,this.smoothConstraint=null}return t}(),FT=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new rD},e.prototype.buildPath=function(r,i){BT(r,i,!0)},e}(Ht);FT.prototype.type="polygon";const jf=FT;var iD=function(){function t(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return t}(),kT=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new iD},e.prototype.buildPath=function(r,i){BT(r,i,!1)},e}(Ht);kT.prototype.type="polyline";const Qf=kT;var nD={},aD=function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return t}(),zT=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new aD},e.prototype.buildPath=function(r,i){var n,a,o,s;if(this.subPixelOptimize){var l=hT(nD,i,this.style);n=l.x1,a=l.y1,o=l.x2,s=l.y2}else n=i.x1,a=i.y1,o=i.x2,s=i.y2;var u=i.percent;u!==0&&(r.moveTo(n,a),u<1&&(o=n*(1-u)+o*u,s=a*(1-u)+s*u),r.lineTo(o,s))},e.prototype.pointAt=function(r){var i=this.shape;return[i.x1*(1-r)+i.x2*r,i.y1*(1-r)+i.y2*r]},e}(Ht);zT.prototype.type="line";const la=zT;var qe=[],oD=function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1}return t}();function n_(t,e,r){var i=t.cpx2,n=t.cpy2;return i!=null||n!=null?[(r?nm:ye)(t.x1,t.cpx1,t.cpx2,t.x2,e),(r?nm:ye)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(r?am:Pe)(t.x1,t.cpx1,t.x2,e),(r?am:Pe)(t.y1,t.cpy1,t.y2,e)]}var UT=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new oD},e.prototype.buildPath=function(r,i){var n=i.x1,a=i.y1,o=i.x2,s=i.y2,l=i.cpx1,u=i.cpy1,f=i.cpx2,h=i.cpy2,v=i.percent;v!==0&&(r.moveTo(n,a),f==null||h==null?(v<1&&(qu(n,l,o,v,qe),l=qe[1],o=qe[2],qu(a,u,s,v,qe),u=qe[1],s=qe[2]),r.quadraticCurveTo(l,u,o,s)):(v<1&&(Zu(n,l,f,o,v,qe),l=qe[1],f=qe[2],o=qe[3],Zu(a,u,h,s,v,qe),u=qe[1],h=qe[2],s=qe[3]),r.bezierCurveTo(l,u,f,h,o,s)))},e.prototype.pointAt=function(r){return n_(this.shape,r,!1)},e.prototype.tangentAt=function(r){var i=n_(this.shape,r,!0);return EA(i,i)},e}(Ht);UT.prototype.type="bezier-curve";const HT=UT;var sD=function(){function t(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return t}(),VT=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new sD},e.prototype.buildPath=function(r,i){var n=i.cx,a=i.cy,o=Math.max(i.r,0),s=i.startAngle,l=i.endAngle,u=i.clockwise,f=Math.cos(s),h=Math.sin(s);r.moveTo(f*o+n,h*o+a),r.arc(n,a,o,s,l,!u)},e}(Ht);VT.prototype.type="arc";const Dp=VT;var lD=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="compound",r}return e.prototype._updatePathDirty=function(){for(var r=this.shape.paths,i=this.shapeChanged(),n=0;n<r.length;n++)i=i||r[n].shapeChanged();i&&this.dirtyShape()},e.prototype.beforeBrush=function(){this._updatePathDirty();for(var r=this.shape.paths||[],i=this.getGlobalScale(),n=0;n<r.length;n++)r[n].path||r[n].createPathProxy(),r[n].path.setScale(i[0],i[1],r[n].segmentIgnoreThreshold)},e.prototype.buildPath=function(r,i){for(var n=i.paths||[],a=0;a<n.length;a++)n[a].buildPath(r,n[a].shape,!0)},e.prototype.afterBrush=function(){for(var r=this.shape.paths||[],i=0;i<r.length;i++)r[i].pathUpdated()},e.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),Ht.prototype.getBoundingRect.call(this)},e}(Ht);const GT=lD;var uD=function(){function t(e){this.colorStops=e||[]}return t.prototype.addColorStop=function(e,r){this.colorStops.push({offset:e,color:r})},t}();const WT=uD;var fD=function(t){G(e,t);function e(r,i,n,a,o,s){var l=t.call(this,o)||this;return l.x=r??0,l.y=i??0,l.x2=n??1,l.y2=a??0,l.type="linear",l.global=s||!1,l}return e}(WT);const Lp=fD;var hD=function(t){G(e,t);function e(r,i,n,a,o){var s=t.call(this,a)||this;return s.x=r??.5,s.y=i??.5,s.r=n??.5,s.type="radial",s.global=o||!1,s}return e}(WT);const cD=hD;var bn=[0,0],An=[0,0],Pl=new wt,Il=new wt,vD=function(){function t(e,r){this._corners=[],this._axes=[],this._origin=[0,0];for(var i=0;i<4;i++)this._corners[i]=new wt;for(var i=0;i<2;i++)this._axes[i]=new wt;e&&this.fromBoundingRect(e,r)}return t.prototype.fromBoundingRect=function(e,r){var i=this._corners,n=this._axes,a=e.x,o=e.y,s=a+e.width,l=o+e.height;if(i[0].set(a,o),i[1].set(s,o),i[2].set(s,l),i[3].set(a,l),r)for(var u=0;u<4;u++)i[u].transform(r);wt.sub(n[0],i[1],i[0]),wt.sub(n[1],i[3],i[0]),n[0].normalize(),n[1].normalize();for(var u=0;u<2;u++)this._origin[u]=n[u].dot(i[0])},t.prototype.intersect=function(e,r){var i=!0,n=!r;return Pl.set(1/0,1/0),Il.set(0,0),!this._intersectCheckOneSide(this,e,Pl,Il,n,1)&&(i=!1,n)||!this._intersectCheckOneSide(e,this,Pl,Il,n,-1)&&(i=!1,n)||n||wt.copy(r,i?Pl:Il),i},t.prototype._intersectCheckOneSide=function(e,r,i,n,a,o){for(var s=!0,l=0;l<2;l++){var u=this._axes[l];if(this._getProjMinMaxOnAxis(l,e._corners,bn),this._getProjMinMaxOnAxis(l,r._corners,An),bn[1]<An[0]||bn[0]>An[1]){if(s=!1,a)return s;var f=Math.abs(An[0]-bn[1]),h=Math.abs(bn[0]-An[1]);Math.min(f,h)>n.len()&&(f<h?wt.scale(n,u,-f*o):wt.scale(n,u,h*o))}else if(i){var f=Math.abs(An[0]-bn[1]),h=Math.abs(bn[0]-An[1]);Math.min(f,h)<i.len()&&(f<h?wt.scale(i,u,f*o):wt.scale(i,u,-h*o))}}return s},t.prototype._getProjMinMaxOnAxis=function(e,r,i){for(var n=this._axes[e],a=this._origin,o=r[0].dot(n)+a[e],s=o,l=o,u=1;u<r.length;u++){var f=r[u].dot(n)+a[e];s=Math.min(f,s),l=Math.max(f,l)}i[0]=s,i[1]=l},t}();const lf=vD;var dD=[],pD=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.notClear=!0,r.incremental=!0,r._displayables=[],r._temporaryDisplayables=[],r._cursor=0,r}return e.prototype.traverse=function(r,i){r.call(i,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(r,i){i?this._temporaryDisplayables.push(r):this._displayables.push(r),this.markRedraw()},e.prototype.addDisplayables=function(r,i){i=i||!1;for(var n=0;n<r.length;n++)this.addDisplayable(r[n],i)},e.prototype.getDisplayables=function(){return this._displayables},e.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},e.prototype.eachPendingDisplayable=function(r){for(var i=this._cursor;i<this._displayables.length;i++)r&&r(this._displayables[i]);for(var i=0;i<this._temporaryDisplayables.length;i++)r&&r(this._temporaryDisplayables[i])},e.prototype.update=function(){this.updateTransform();for(var r=this._cursor;r<this._displayables.length;r++){var i=this._displayables[r];i.parent=this,i.update(),i.parent=null}for(var r=0;r<this._temporaryDisplayables.length;r++){var i=this._temporaryDisplayables[r];i.parent=this,i.update(),i.parent=null}},e.prototype.getBoundingRect=function(){if(!this._rect){for(var r=new Nt(1/0,1/0,-1/0,-1/0),i=0;i<this._displayables.length;i++){var n=this._displayables[i],a=n.getBoundingRect().clone();n.needLocalTransform()&&a.applyTransform(n.getLocalTransform(dD)),r.union(a)}this._rect=r}return this._rect},e.prototype.contain=function(r,i){var n=this.transformCoordToLocal(r,i),a=this.getBoundingRect();if(a.contain(n[0],n[1]))for(var o=0;o<this._displayables.length;o++){var s=this._displayables[o];if(s.contain(r,i))return!0}return!1},e}(ca);const gD=pD;var mD=Kt();function Rp(t,e,r,i,n){var a;if(e&&e.ecModel){var o=e.ecModel.getUpdatePayload();a=o&&o.animation}var s=e&&e.isAnimationEnabled(),l=t==="update";if(s){var u=void 0,f=void 0,h=void 0;i?(u=mt(i.duration,200),f=mt(i.easing,"cubicOut"),h=0):(u=e.getShallow(l?"animationDurationUpdate":"animationDuration"),f=e.getShallow(l?"animationEasingUpdate":"animationEasing"),h=e.getShallow(l?"animationDelayUpdate":"animationDelay")),a&&(a.duration!=null&&(u=a.duration),a.easing!=null&&(f=a.easing),a.delay!=null&&(h=a.delay)),ct(h)&&(h=h(r,n)),ct(u)&&(u=u(r));var v={duration:u||0,delay:h,easing:f};return v}else return null}function Pp(t,e,r,i,n,a,o){var s=!1,l;ct(n)?(o=a,a=n,n=null):j(n)&&(a=n.cb,o=n.during,s=n.isFrom,l=n.removeOpt,n=n.dataIndex);var u=t==="leave";u||e.stopAnimation("leave");var f=Rp(t,i,n,u?l||{}:null,i&&i.getAnimationDelayParams?i.getAnimationDelayParams(e,n):null);if(f&&f.duration>0){var h=f.duration,v=f.delay,c=f.easing,d={duration:h,delay:v||0,easing:c,done:a,force:!!a||!!o,setToFinal:!u,scope:t,during:o};s?e.animateFrom(r,d):e.animateTo(r,d)}else e.stopAnimation(),!s&&e.attr(r),o&&o(1),a&&a()}function Ir(t,e,r,i,n,a){Pp("update",t,e,r,i,n,a)}function an(t,e,r,i,n,a){Pp("enter",t,e,r,i,n,a)}function ao(t){if(!t.__zr)return!0;for(var e=0;e<t.animators.length;e++){var r=t.animators[e];if(r.scope==="leave")return!0}return!1}function uf(t,e,r,i,n,a){ao(t)||Pp("leave",t,e,r,i,n,a)}function a_(t,e,r,i){t.removeTextContent(),t.removeTextGuideLine(),uf(t,{style:{opacity:0}},e,r,i)}function _D(t,e,r){function i(){t.parent&&t.parent.remove(t)}t.isGroup?t.traverse(function(n){n.isGroup||a_(n,e,r,i)}):a_(t,e,r,i)}function yD(t){mD(t).oldStyle=t.style}var ff=Math.max,hf=Math.min,od={};function xD(t){return Ht.extend(t)}var TD=XM;function SD(t,e){return TD(t,e)}function jr(t,e){od[t]=e}function XT(t){if(od.hasOwnProperty(t))return od[t]}function Ip(t,e,r,i){var n=WM(t,e);return r&&(i==="center"&&(r=$T(r,n.getBoundingRect())),ZT(n,r)),n}function YT(t,e,r){var i=new Nr({style:{image:t,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(n){if(r==="center"){var a={width:n.width,height:n.height};i.setStyle($T(e,a))}}});return i}function $T(t,e){var r=e.width/e.height,i=t.height*r,n;i<=t.width?n=t.height:(i=t.width,n=i/r);var a=t.x+t.width/2,o=t.y+t.height/2;return{x:a-i/2,y:o-n/2,width:i,height:n}}var wD=YM;function ZT(t,e){if(t.applyTransform){var r=t.getBoundingRect(),i=r.calculateTransform(e);t.applyTransform(i)}}function Bs(t,e){return hT(t,t,{lineWidth:e}),t}function bD(t){return cT(t.shape,t.shape,t.style),t}var AD=$n;function ws(t,e){for(var r=fp([]);t&&t!==e;)io(r,t.getLocalTransform(),r),t=t.parent;return r}function en(t,e,r){return e&&!$e(e)&&(e=Gf.getLocalTransform(e)),r&&(e=Uf([],e)),Lr([],t,e)}function Np(t,e,r){var i=e[4]===0||e[5]===0||e[0]===0?1:Math.abs(2*e[4]/e[0]),n=e[4]===0||e[5]===0||e[2]===0?1:Math.abs(2*e[4]/e[2]),a=[t==="left"?-i:t==="right"?i:0,t==="top"?-n:t==="bottom"?n:0];return a=en(a,e,r),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function o_(t){return!t.isGroup}function ED(t){return t.shape!=null}function qT(t,e,r){if(!t||!e)return;function i(o){var s={};return o.traverse(function(l){o_(l)&&l.anid&&(s[l.anid]=l)}),s}function n(o){var s={x:o.x,y:o.y,rotation:o.rotation};return ED(o)&&(s.shape=U({},o.shape)),s}var a=i(t);e.traverse(function(o){if(o_(o)&&o.anid){var s=a[o.anid];if(s){var l=n(o);o.attr(n(s)),Ir(o,l,r,kt(o).dataIndex)}}})}function CD(t,e){return K(t,function(r){var i=r[0];i=ff(i,e.x),i=hf(i,e.x+e.width);var n=r[1];return n=ff(n,e.y),n=hf(n,e.y+e.height),[i,n]})}function MD(t,e){var r=ff(t.x,e.x),i=hf(t.x+t.width,e.x+e.width),n=ff(t.y,e.y),a=hf(t.y+t.height,e.y+e.height);if(i>=r&&a>=n)return{x:r,y:n,width:i-r,height:a-n}}function Op(t,e,r){var i=U({rectHover:!0},e),n=i.style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},t)return t.indexOf("image://")===0?(n.image=t.slice(8),Lt(n,r),new Nr(i)):Ip(t.replace("path://",""),i,r,"center")}function DD(t,e,r,i,n){for(var a=0,o=n[n.length-1];a<n.length;a++){var s=n[a];if(KT(t,e,r,i,s[0],s[1],o[0],o[1]))return!0;o=s}}function KT(t,e,r,i,n,a,o,s){var l=r-t,u=i-e,f=o-n,h=s-a,v=cc(f,h,l,u);if(LD(v))return!1;var c=t-n,d=e-a,p=cc(c,d,l,u)/v;if(p<0||p>1)return!1;var g=cc(c,d,f,h)/v;return!(g<0||g>1)}function cc(t,e,r,i){return t*i-r*e}function LD(t){return t<=1e-6&&t>=-1e-6}function Jf(t){var e=t.itemTooltipOption,r=t.componentModel,i=t.itemName,n=Z(e)?{formatter:e}:e,a=r.mainType,o=r.componentIndex,s={componentType:a,name:i,$vars:["name"]};s[a+"Index"]=o;var l=t.formatterParamsExtra;l&&M(yt(l),function(f){_t(s,f)||(s[f]=l[f],s.$vars.push(f))});var u=kt(t.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:i,option:Lt({content:i,formatterParams:s},n)}}function s_(t,e){var r;t.isGroup&&(r=e(t)),r||t.traverse(e)}function Bp(t,e){if(t)if(X(t))for(var r=0;r<t.length;r++)s_(t[r],e);else s_(t,e)}jr("circle",Cp);jr("ellipse",RT);jr("sector",Mp);jr("ring",OT);jr("polygon",jf);jr("polyline",Qf);jr("rect",ie);jr("line",la);jr("bezierCurve",HT);jr("arc",Dp);const RD=Object.freeze(Object.defineProperty({__proto__:null,Arc:Dp,BezierCurve:HT,BoundingRect:Nt,Circle:Cp,CompoundPath:GT,Ellipse:RT,Group:ue,Image:Nr,IncrementalDisplayable:gD,Line:la,LinearGradient:Lp,OrientedBoundingRect:lf,Path:Ht,Point:wt,Polygon:jf,Polyline:Qf,RadialGradient:cD,Rect:ie,Ring:OT,Sector:Mp,Text:Jt,applyTransform:en,clipPointsByRect:CD,clipRectByRect:MD,createIcon:Op,extendPath:SD,extendShape:xD,getShapeClass:XT,getTransform:ws,groupTransition:qT,initProps:an,isElementRemoved:ao,lineLineIntersect:KT,linePolygonIntersect:DD,makeImage:YT,makePath:Ip,mergePath:wD,registerShape:jr,removeElement:uf,removeElementWithFadeOut:_D,resizePath:ZT,setTooltipConfig:Jf,subPixelOptimize:AD,subPixelOptimizeLine:Bs,subPixelOptimizeRect:bD,transformDirection:Np,traverseElements:Bp,updateProps:Ir},Symbol.toStringTag,{value:"Module"}));var th={};function jT(t,e){for(var r=0;r<Pr.length;r++){var i=Pr[r],n=e[i],a=t.ensureState(i);a.style=a.style||{},a.style.text=n}var o=t.currentStates.slice();t.clearStates(!0),t.setStyle({text:e.normal}),t.useStates(o,!0)}function sd(t,e,r){var i=t.labelFetcher,n=t.labelDataIndex,a=t.labelDimIndex,o=e.normal,s;i&&(s=i.getFormattedLabel(n,"normal",null,a,o&&o.get("formatter"),r!=null?{interpolatedValue:r}:null)),s==null&&(s=ct(t.defaultText)?t.defaultText(n,t,r):t.defaultText);for(var l={normal:s},u=0;u<Pr.length;u++){var f=Pr[u],h=e[f];l[f]=mt(i?i.getFormattedLabel(n,f,null,a,h&&h.get("formatter")):null,s)}return l}function Fp(t,e,r,i){r=r||th;for(var n=t instanceof Jt,a=!1,o=0;o<nf.length;o++){var s=e[nf[o]];if(s&&s.getShallow("show")){a=!0;break}}var l=n?t:t.getTextContent();if(a){n||(l||(l=new Jt,t.setTextContent(l)),t.stateProxy&&(l.stateProxy=t.stateProxy));var u=sd(r,e),f=e.normal,h=!!f.getShallow("show"),v=tr(f,i&&i.normal,r,!1,!n);v.text=u.normal,n||t.setTextConfig(l_(f,r,!1));for(var o=0;o<Pr.length;o++){var c=Pr[o],s=e[c];if(s){var d=l.ensureState(c),p=!!mt(s.getShallow("show"),h);if(p!==h&&(d.ignore=!p),d.style=tr(s,i&&i[c],r,!0,!n),d.style.text=u[c],!n){var g=t.ensureState(c);g.textConfig=l_(s,r,!0)}}}l.silent=!!f.getShallow("silent"),l.style.x!=null&&(v.x=l.style.x),l.style.y!=null&&(v.y=l.style.y),l.ignore=!h,l.useStyle(v),l.dirty(),r.enableTextSetter&&(eh(l).setLabelText=function(m){var _=sd(r,e,m);jT(l,_)})}else l&&(l.ignore=!0);t.dirty()}function kp(t,e){e=e||"label";for(var r={normal:t.getModel(e)},i=0;i<Pr.length;i++){var n=Pr[i];r[n]=t.getModel([n,e])}return r}function tr(t,e,r,i,n){var a={};return PD(a,t,r,i,n),e&&U(a,e),a}function l_(t,e,r){e=e||{};var i={},n,a=t.getShallow("rotate"),o=mt(t.getShallow("distance"),r?null:5),s=t.getShallow("offset");return n=t.getShallow("position")||(r?null:"inside"),n==="outside"&&(n=e.defaultOutsidePosition||"top"),n!=null&&(i.position=n),s!=null&&(i.offset=s),a!=null&&(a*=Math.PI/180,i.rotation=a),o!=null&&(i.distance=o),i.outsideFill=t.get("color")==="inherit"?e.inheritColor||null:"auto",i}function PD(t,e,r,i,n){r=r||th;var a=e.ecModel,o=a&&a.option.textStyle,s=ID(e),l;if(s){l={};for(var u in s)if(s.hasOwnProperty(u)){var f=e.getModel(["rich",u]);c_(l[u]={},f,o,r,i,n,!1,!0)}}l&&(t.rich=l);var h=e.get("overflow");h&&(t.overflow=h);var v=e.get("minMargin");v!=null&&(t.margin=v),c_(t,e,o,r,i,n,!0,!1)}function ID(t){for(var e;t&&t!==t.ecModel;){var r=(t.option||th).rich;if(r){e=e||{};for(var i=yt(r),n=0;n<i.length;n++){var a=i[n];e[a]=1}}t=t.parentModel}return e}var u_=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],f_=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],h_=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function c_(t,e,r,i,n,a,o,s){r=!n&&r||th;var l=i&&i.inheritColor,u=e.getShallow("color"),f=e.getShallow("textBorderColor"),h=mt(e.getShallow("opacity"),r.opacity);(u==="inherit"||u==="auto")&&(l?u=l:u=null),(f==="inherit"||f==="auto")&&(l?f=l:f=null),a||(u=u||r.color,f=f||r.textBorderColor),u!=null&&(t.fill=u),f!=null&&(t.stroke=f);var v=mt(e.getShallow("textBorderWidth"),r.textBorderWidth);v!=null&&(t.lineWidth=v);var c=mt(e.getShallow("textBorderType"),r.textBorderType);c!=null&&(t.lineDash=c);var d=mt(e.getShallow("textBorderDashOffset"),r.textBorderDashOffset);d!=null&&(t.lineDashOffset=d),!n&&h==null&&!s&&(h=i&&i.defaultOpacity),h!=null&&(t.opacity=h),!n&&!a&&t.fill==null&&i.inheritColor&&(t.fill=i.inheritColor);for(var p=0;p<u_.length;p++){var g=u_[p],m=mt(e.getShallow(g),r[g]);m!=null&&(t[g]=m)}for(var p=0;p<f_.length;p++){var g=f_[p],m=e.getShallow(g);m!=null&&(t[g]=m)}if(t.verticalAlign==null){var _=e.getShallow("baseline");_!=null&&(t.verticalAlign=_)}if(!o||!i.disableBox){for(var p=0;p<h_.length;p++){var g=h_[p],m=e.getShallow(g);m!=null&&(t[g]=m)}var y=e.getShallow("borderType");y!=null&&(t.borderDash=y),(t.backgroundColor==="auto"||t.backgroundColor==="inherit")&&l&&(t.backgroundColor=l),(t.borderColor==="auto"||t.borderColor==="inherit")&&l&&(t.borderColor=l)}}function ND(t,e){var r=e&&e.getModel("textStyle");return li([t.fontStyle||r&&r.getShallow("fontStyle")||"",t.fontWeight||r&&r.getShallow("fontWeight")||"",(t.fontSize||r&&r.getShallow("fontSize")||12)+"px",t.fontFamily||r&&r.getShallow("fontFamily")||"sans-serif"].join(" "))}var eh=Kt();function OD(t,e,r,i,n){var a=eh(t);if(!a.valueAnimation||a.prevValue===a.value)return;var o=a.defaultInterpolatedText,s=mt(a.interpolatedValue,a.prevValue),l=a.value;function u(f){var h=rT(r,a.precision,s,l,f);a.interpolatedValue=f===1?null:h;var v=sd({labelDataIndex:e,labelFetcher:n,defaultText:o?o(h):h+""},a.statesModels,h);jT(t,v)}t.percent=0,(a.prevValue==null?an:Ir)(t,{percent:1},i,e,null,u)}var BD=["textStyle","color"],vc=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],dc=new Jt,FD=function(){function t(){}return t.prototype.getTextColor=function(e){var r=this.ecModel;return this.getShallow("color")||(!e&&r?r.get(BD):null)},t.prototype.getFont=function(){return ND({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},t.prototype.getTextRect=function(e){for(var r={text:e,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},i=0;i<vc.length;i++)r[vc[i]]=this.getShallow(vc[i]);return dc.useStyle(r),dc.update(),dc.getBoundingRect()},t}();const kD=FD;var QT=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],zD=Os(QT),UD=function(){function t(){}return t.prototype.getLineStyle=function(e){return zD(this,e)},t}(),JT=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],HD=Os(JT),VD=function(){function t(){}return t.prototype.getItemStyle=function(e,r){return HD(this,e,r)},t}(),va=function(){function t(e,r,i){this.parentModel=r,this.ecModel=i,this.option=e}return t.prototype.init=function(e,r,i){},t.prototype.mergeOption=function(e,r){dt(this.option,e,!0)},t.prototype.get=function(e,r){return e==null?this.option:this._doGet(this.parsePath(e),!r&&this.parentModel)},t.prototype.getShallow=function(e,r){var i=this.option,n=i==null?i:i[e];if(n==null&&!r){var a=this.parentModel;a&&(n=a.getShallow(e))}return n},t.prototype.getModel=function(e,r){var i=e!=null,n=i?this.parsePath(e):null,a=i?this._doGet(n):this.option;return r=r||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(n)),new t(a,r,this.ecModel)},t.prototype.isEmpty=function(){return this.option==null},t.prototype.restoreData=function(){},t.prototype.clone=function(){var e=this.constructor;return new e(ft(this.option))},t.prototype.parsePath=function(e){return typeof e=="string"?e.split("."):e},t.prototype.resolveParentPath=function(e){return e},t.prototype.isAnimationEnabled=function(){if(!At.node&&this.option){if(this.option.animation!=null)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},t.prototype._doGet=function(e,r){var i=this.option;if(!e)return i;for(var n=0;n<e.length&&!(e[n]&&(i=i&&typeof i=="object"?i[e[n]]:null,i==null));n++);return i==null&&r&&(i=r._doGet(this.resolveParentPath(e),r.parentModel)),i},t}();xp(va);wC(va);qr(va,UD);qr(va,VD);qr(va,MC);qr(va,kD);const Te=va;var GD=Math.round(Math.random()*10);function rh(t){return[t||"",GD++].join("_")}function WD(t){var e={};t.registerSubTypeDefaulter=function(r,i){var n=ui(r);e[n.main]=i},t.determineSubType=function(r,i){var n=i.type;if(!n){var a=ui(r).main;t.hasSubTypes(r)&&e[a]&&(n=e[a](i))}return n}}function XD(t,e){t.topologicalTravel=function(a,o,s,l){if(!a.length)return;var u=r(o),f=u.graph,h=u.noEntryList,v={};for(M(a,function(_){v[_]=!0});h.length;){var c=h.pop(),d=f[c],p=!!v[c];p&&(s.call(l,c,d.originalDeps.slice()),delete v[c]),M(d.successor,p?m:g)}M(v,function(){var _="";throw new Error(_)});function g(_){f[_].entryCount--,f[_].entryCount===0&&h.push(_)}function m(_){v[_]=!0,g(_)}};function r(a){var o={},s=[];return M(a,function(l){var u=i(o,l),f=u.originalDeps=e(l),h=n(f,a);u.entryCount=h.length,u.entryCount===0&&s.push(l),M(h,function(v){Dt(u.predecessor,v)<0&&u.predecessor.push(v);var c=i(o,v);Dt(c.successor,v)<0&&c.successor.push(l)})}),{graph:o,noEntryList:s}}function i(a,o){return a[o]||(a[o]={predecessor:[],successor:[]}),a[o]}function n(a,o){var s=[];return M(a,function(l){Dt(o,l)>=0&&s.push(l)}),s}}function nl(t,e){return dt(dt({},t,!0),e,!0)}const YD={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},$D={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表，"},series:{single:{prefix:"",withName:"图表类型是{seriesType}，表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType}，",withoutName:"第{seriesId}个系列是一个{seriesType}，",separator:{middle:"；",end:"。"}}},data:{allData:"其数据是——",partialData:"其中，前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:"，",end:""}}}};var cf="ZH",zp="EN",Fs=zp,Eu={},Up={},tS=At.domSupported?function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage).toUpperCase();return t.indexOf(cf)>-1?cf:Fs}():Fs;function eS(t,e){t=t.toUpperCase(),Up[t]=new Te(e),Eu[t]=e}function ZD(t){if(Z(t)){var e=Eu[t.toUpperCase()]||{};return t===cf||t===zp?ft(e):dt(ft(e),ft(Eu[Fs]),!1)}else return dt(ft(t),ft(Eu[Fs]),!1)}function qD(t){return Up[t]}function KD(){return Up[Fs]}eS(zp,YD);eS(cf,$D);var Hp=1e3,Vp=Hp*60,bs=Vp*60,Mr=bs*24,v_=Mr*365,fs={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},Nl="{yyyy}-{MM}-{dd}",d_={year:"{yyyy}",month:"{yyyy}-{MM}",day:Nl,hour:Nl+" "+fs.hour,minute:Nl+" "+fs.minute,second:Nl+" "+fs.second,millisecond:fs.none},pc=["year","month","day","hour","minute","second","millisecond"],rS=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function He(t,e){return t+="","0000".substr(0,e-t.length)+t}function oo(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function jD(t){return t===oo(t)}function QD(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function ih(t,e,r,i){var n=vi(t),a=n[Gp(r)](),o=n[so(r)]()+1,s=Math.floor((o-1)/3)+1,l=n[nh(r)](),u=n["get"+(r?"UTC":"")+"Day"](),f=n[ks(r)](),h=(f-1)%12+1,v=n[ah(r)](),c=n[oh(r)](),d=n[sh(r)](),p=i instanceof Te?i:qD(i||tS)||KD(),g=p.getModel("time"),m=g.get("month"),_=g.get("monthAbbr"),y=g.get("dayOfWeek"),x=g.get("dayOfWeekAbbr");return(e||"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,He(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,m[o-1]).replace(/{MMM}/g,_[o-1]).replace(/{MM}/g,He(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,He(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,y[u]).replace(/{ee}/g,x[u]).replace(/{e}/g,u+"").replace(/{HH}/g,He(f,2)).replace(/{H}/g,f+"").replace(/{hh}/g,He(h+"",2)).replace(/{h}/g,h+"").replace(/{mm}/g,He(v,2)).replace(/{m}/g,v+"").replace(/{ss}/g,He(c,2)).replace(/{s}/g,c+"").replace(/{SSS}/g,He(d,3)).replace(/{S}/g,d+"")}function JD(t,e,r,i,n){var a=null;if(Z(r))a=r;else if(ct(r))a=r(t.value,e,{level:t.level});else{var o=U({},fs);if(t.level>0)for(var s=0;s<pc.length;++s)o[pc[s]]="{primary|"+o[pc[s]]+"}";var l=r?r.inherit===!1?r:Lt(r,o):o,u=iS(t.value,n);if(l[u])a=l[u];else if(l.inherit){for(var f=rS.indexOf(u),s=f-1;s>=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(X(a)){var h=t.level==null?0:t.level>=0?t.level:a.length+t.level;h=Math.min(h,a.length-1),a=a[h]}}return ih(new Date(t.value),a,n,i)}function iS(t,e){var r=vi(t),i=r[so(e)]()+1,n=r[nh(e)](),a=r[ks(e)](),o=r[ah(e)](),s=r[oh(e)](),l=r[sh(e)](),u=l===0,f=u&&s===0,h=f&&o===0,v=h&&a===0,c=v&&n===1,d=c&&i===1;return d?"year":c?"month":v?"day":h?"hour":f?"minute":u?"second":"millisecond"}function p_(t,e,r){var i=Qt(t)?vi(t):t;switch(e=e||iS(t,r),e){case"year":return i[Gp(r)]();case"half-year":return i[so(r)]()>=6?1:0;case"quarter":return Math.floor((i[so(r)]()+1)/4);case"month":return i[so(r)]();case"day":return i[nh(r)]();case"half-day":return i[ks(r)]()/24;case"hour":return i[ks(r)]();case"minute":return i[ah(r)]();case"second":return i[oh(r)]();case"millisecond":return i[sh(r)]()}}function Gp(t){return t?"getUTCFullYear":"getFullYear"}function so(t){return t?"getUTCMonth":"getMonth"}function nh(t){return t?"getUTCDate":"getDate"}function ks(t){return t?"getUTCHours":"getHours"}function ah(t){return t?"getUTCMinutes":"getMinutes"}function oh(t){return t?"getUTCSeconds":"getSeconds"}function sh(t){return t?"getUTCMilliseconds":"getMilliseconds"}function tL(t){return t?"setUTCFullYear":"setFullYear"}function nS(t){return t?"setUTCMonth":"setMonth"}function aS(t){return t?"setUTCDate":"setDate"}function oS(t){return t?"setUTCHours":"setHours"}function sS(t){return t?"setUTCMinutes":"setMinutes"}function lS(t){return t?"setUTCSeconds":"setSeconds"}function uS(t){return t?"setUTCMilliseconds":"setMilliseconds"}function vf(t){if(!rC(t))return Z(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function fS(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(r,i){return i.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var al=hx;function ld(t,e,r){var i="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function n(f){return f&&li(f)?f:"-"}function a(f){return!!(f!=null&&!isNaN(f)&&isFinite(f))}var o=e==="time",s=t instanceof Date;if(o||s){var l=o?vi(t):t;if(isNaN(+l)){if(s)return"-"}else return ih(l,i,r)}if(e==="ordinal")return Pv(t)?n(t):Qt(t)&&a(t)?t+"":"-";var u=tf(t);return a(u)?vf(u):Pv(t)?n(t):typeof t=="boolean"?t+"":"-"}var g_=["a","b","c","d","e","f","g"],gc=function(t,e){return"{"+t+(e??"")+"}"};function hS(t,e,r){X(e)||(e=[e]);var i=e.length;if(!i)return"";for(var n=e[0].$vars||[],a=0;a<n.length;a++){var o=g_[a];t=t.replace(gc(o),gc(o,0))}for(var s=0;s<i;s++)for(var l=0;l<n.length;l++){var u=e[s][n[l]];t=t.replace(gc(g_[l],s),r?Me(u):u)}return t}function cS(t,e){var r=Z(t)?{color:t,extraCssText:e}:t||{},i=r.color,n=r.type;e=r.extraCssText;var a=r.renderMode||"html";if(!i)return"";if(a==="html")return n==="subItem"?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+Me(i)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+Me(i)+";"+(e||"")+'"></span>';var o=r.markerId||"markerX";return{renderMode:a,content:"{"+o+"|}  ",style:n==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:i}:{width:10,height:10,borderRadius:5,backgroundColor:i}}}function eL(t,e,r){(t==="week"||t==="month"||t==="quarter"||t==="half-year"||t==="year")&&(t=`MM-dd
yyyy`);var i=vi(e),n=r?"getUTC":"get",a=i[n+"FullYear"](),o=i[n+"Month"]()+1,s=i[n+"Date"](),l=i[n+"Hours"](),u=i[n+"Minutes"](),f=i[n+"Seconds"](),h=i[n+"Milliseconds"]();return t=t.replace("MM",He(o,2)).replace("M",o).replace("yyyy",a).replace("yy",He(a%100+"",2)).replace("dd",He(s,2)).replace("d",s).replace("hh",He(l,2)).replace("h",l).replace("mm",He(u,2)).replace("m",u).replace("ss",He(f,2)).replace("s",f).replace("SSS",He(h,3)),t}function ua(t,e){return e=e||"transparent",Z(t)?t:j(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}var Cu=M,vS=["left","right","top","bottom","width","height"],Ol=[["width","left","right"],["height","top","bottom"]];function Wp(t,e,r,i,n){var a=0,o=0;i==null&&(i=1/0),n==null&&(n=1/0);var s=0;e.eachChild(function(l,u){var f=l.getBoundingRect(),h=e.childAt(u+1),v=h&&h.getBoundingRect(),c,d;if(t==="horizontal"){var p=f.width+(v?-v.x+f.x:0);c=a+p,c>i||l.newline?(a=0,c=p,o+=s+r,s=f.height):s=Math.max(s,f.height)}else{var g=f.height+(v?-v.y+f.y:0);d=o+g,d>n||l.newline?(a+=s+r,o=0,d=g,s=f.width):s=Math.max(s,f.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),t==="horizontal"?a=c+r:o=d+r)})}var lo=Wp;de(Wp,"vertical");de(Wp,"horizontal");function on(t,e,r){r=al(r||0);var i=e.width,n=e.height,a=ve(t.left,i),o=ve(t.top,n),s=ve(t.right,i),l=ve(t.bottom,n),u=ve(t.width,i),f=ve(t.height,n),h=r[2]+r[0],v=r[1]+r[3],c=t.aspect;switch(isNaN(u)&&(u=i-s-v-a),isNaN(f)&&(f=n-l-h-o),c!=null&&(isNaN(u)&&isNaN(f)&&(c>i/n?u=i*.8:f=n*.8),isNaN(u)&&(u=c*f),isNaN(f)&&(f=u/c)),isNaN(a)&&(a=i-s-u-v),isNaN(o)&&(o=n-l-f-h),t.left||t.right){case"center":a=i/2-u/2-r[3];break;case"right":a=i-u-v;break}switch(t.top||t.bottom){case"middle":case"center":o=n/2-f/2-r[0];break;case"bottom":o=n-f-h;break}a=a||0,o=o||0,isNaN(u)&&(u=i-v-a-(s||0)),isNaN(f)&&(f=n-h-o-(l||0));var d=new Nt(a+r[3],o+r[0],u,f);return d.margin=r,d}function dS(t,e,r,i,n,a){var o=!n||!n.hv||n.hv[0],s=!n||!n.hv||n.hv[1],l=n&&n.boundingMode||"all";if(a=a||t,a.x=t.x,a.y=t.y,!o&&!s)return!1;var u;if(l==="raw")u=t.type==="group"?new Nt(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(u=t.getBoundingRect(),t.needLocalTransform()){var f=t.getLocalTransform();u=u.clone(),u.applyTransform(f)}var h=on(Lt({width:u.width,height:u.height},e),r,i),v=o?h.x-u.x:0,c=s?h.y-u.y:0;return l==="raw"?(a.x=v,a.y=c):(a.x+=v,a.y+=c),a===t&&t.markRedraw(),!0}function zs(t){var e=t.layoutMode||t.constructor.layoutMode;return j(e)?e:e?{type:e}:null}function fa(t,e,r){var i=r&&r.ignoreSize;!X(i)&&(i=[i,i]);var n=o(Ol[0],0),a=o(Ol[1],1);u(Ol[0],t,n),u(Ol[1],t,a);function o(f,h){var v={},c=0,d={},p=0,g=2;if(Cu(f,function(y){d[y]=t[y]}),Cu(f,function(y){s(e,y)&&(v[y]=d[y]=e[y]),l(v,y)&&c++,l(d,y)&&p++}),i[h])return l(e,f[1])?d[f[2]]=null:l(e,f[2])&&(d[f[1]]=null),d;if(p===g||!c)return d;if(c>=g)return v;for(var m=0;m<f.length;m++){var _=f[m];if(!s(v,_)&&s(t,_)){v[_]=t[_];break}}return v}function s(f,h){return f.hasOwnProperty(h)}function l(f,h){return f[h]!=null&&f[h]!=="auto"}function u(f,h,v){Cu(f,function(c){h[c]=v[c]})}}function ol(t){return pS({},t)}function pS(t,e){return e&&t&&Cu(vS,function(r){e.hasOwnProperty(r)&&(t[r]=e[r])}),t}var rL=Kt(),wo=function(t){G(e,t);function e(r,i,n){var a=t.call(this,r,i,n)||this;return a.uid=rh("ec_cpt_model"),a}return e.prototype.init=function(r,i,n){this.mergeDefaultAndTheme(r,n)},e.prototype.mergeDefaultAndTheme=function(r,i){var n=zs(this),a=n?ol(r):{},o=i.getTheme();dt(r,o.get(this.mainType)),dt(r,this.getDefaultOption()),n&&fa(r,a,n)},e.prototype.mergeOption=function(r,i){dt(this.option,r,!0);var n=zs(this);n&&fa(this.option,r,n)},e.prototype.optionUpdated=function(r,i){},e.prototype.getDefaultOption=function(){var r=this.constructor;if(!xC(r))return r.defaultOption;var i=rL(this);if(!i.defaultOption){for(var n=[],a=r;a;){var o=a.prototype.defaultOption;o&&n.push(o),a=a.superClass}for(var s={},l=n.length-1;l>=0;l--)s=dt(s,n[l],!0);i.defaultOption=s}return i.defaultOption},e.prototype.getReferringComponents=function(r,i){var n=r+"Index",a=r+"Id";return il(this.ecModel,r,{index:this.get(n,!0),id:this.get(a,!0)},i)},e.prototype.getBoxLayoutParams=function(){var r=this;return{left:r.get("left"),top:r.get("top"),right:r.get("right"),bottom:r.get("bottom"),width:r.get("width"),height:r.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(r){this.option.zlevel=r},e.protoInitialize=function(){var r=e.prototype;r.type="component",r.id="",r.name="",r.mainType="",r.subType="",r.componentIndex=0}(),e}(Te);nT(wo,Te);Xf(wo);WD(wo);XD(wo,iL);function iL(t){var e=[];return M(wo.getClassesByMainType(t),function(r){e=e.concat(r.dependencies||r.prototype.dependencies||[])}),e=K(e,function(r){return ui(r).main}),t!=="dataset"&&Dt(e,"dataset")<=0&&e.unshift("dataset"),e}const Vt=wo;var gS="";typeof navigator<"u"&&(gS=navigator.platform||"");var Ca="rgba(0, 0, 0, 0.2)";const nL={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:Ca,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Ca,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Ca,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Ca,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Ca,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Ca,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:gS.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var mS=ht(["tooltip","label","itemName","itemId","itemGroupId","seriesName"]),Or="original",ir="arrayRows",di="objectRows",Ri="keyedColumns",rn="typedArray",_S="unknown",fi="column",bo="row",sr={Must:1,Might:2,Not:3},yS=Kt();function aL(t){yS(t).datasetMap=ht()}function oL(t,e,r){var i={},n=xS(e);if(!n||!t)return i;var a=[],o=[],s=e.ecModel,l=yS(s).datasetMap,u=n.uid+"_"+r.seriesLayoutBy,f,h;t=t.slice(),M(t,function(p,g){var m=j(p)?p:t[g]={name:p};m.type==="ordinal"&&f==null&&(f=g,h=d(m)),i[m.name]=[]});var v=l.get(u)||l.set(u,{categoryWayDim:h,valueWayDim:0});M(t,function(p,g){var m=p.name,_=d(p);if(f==null){var y=v.valueWayDim;c(i[m],y,_),c(o,y,_),v.valueWayDim+=_}else if(f===g)c(i[m],0,_),c(a,0,_);else{var y=v.categoryWayDim;c(i[m],y,_),c(o,y,_),v.categoryWayDim+=_}});function c(p,g,m){for(var _=0;_<m;_++)p.push(g+_)}function d(p){var g=p.dimsDef;return g?g.length:1}return a.length&&(i.itemName=a),o.length&&(i.seriesName=o),i}function xS(t){var e=t.get("data",!0);if(!e)return il(t.ecModel,"dataset",{index:t.get("datasetIndex",!0),id:t.get("datasetId",!0)},Je).models[0]}function sL(t){return!t.get("transform",!0)&&!t.get("fromTransformResult",!0)?[]:il(t.ecModel,"dataset",{index:t.get("fromDatasetIndex",!0),id:t.get("fromDatasetId",!0)},Je).models}function TS(t,e){return lL(t.data,t.sourceFormat,t.seriesLayoutBy,t.dimensionsDefine,t.startIndex,e)}function lL(t,e,r,i,n,a){var o,s=5;if(cr(t))return sr.Not;var l,u;if(i){var f=i[a];j(f)?(l=f.name,u=f.type):Z(f)&&(l=f)}if(u!=null)return u==="ordinal"?sr.Must:sr.Not;if(e===ir){var h=t;if(r===bo){for(var v=h[a],c=0;c<(v||[]).length&&c<s;c++)if((o=x(v[n+c]))!=null)return o}else for(var c=0;c<h.length&&c<s;c++){var d=h[n+c];if(d&&(o=x(d[a]))!=null)return o}}else if(e===di){var p=t;if(!l)return sr.Not;for(var c=0;c<p.length&&c<s;c++){var g=p[c];if(g&&(o=x(g[l]))!=null)return o}}else if(e===Ri){var m=t;if(!l)return sr.Not;var v=m[l];if(!v||cr(v))return sr.Not;for(var c=0;c<v.length&&c<s;c++)if((o=x(v[c]))!=null)return o}else if(e===Or)for(var _=t,c=0;c<_.length&&c<s;c++){var g=_[c],y=rl(g);if(!X(y))return sr.Not;if((o=x(y[a]))!=null)return o}function x(S){var T=Z(S);if(S!=null&&isFinite(S)&&S!=="")return T?sr.Might:sr.Not;if(T&&S!=="-")return sr.Must}return sr.Not}var uL=ht();function fL(t,e,r){var i=uL.get(e);if(!i)return r;var n=i(t);return n?r.concat(n):r}var m_=Kt();Kt();var Xp=function(){function t(){}return t.prototype.getColorFromPalette=function(e,r,i){var n=ge(this.get("color",!0)),a=this.get("colorLayer",!0);return cL(this,m_,n,a,e,r,i)},t.prototype.clearColorPalette=function(){vL(this,m_)},t}();function hL(t,e){for(var r=t.length,i=0;i<r;i++)if(t[i].length>e)return t[i];return t[r-1]}function cL(t,e,r,i,n,a,o){a=a||t;var s=e(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(n))return u[n];var f=o==null||!i?r:hL(i,o);if(f=f||r,!(!f||!f.length)){var h=f[l];return n&&(u[n]=h),s.paletteIdx=(l+1)%f.length,h}}function vL(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var Bl,Oo,__,y_="\0_ec_inner",dL=1,SS=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(r,i,n,a,o,s){a=a||{},this.option=null,this._theme=new Te(a),this._locale=new Te(o),this._optionManager=s},e.prototype.setOption=function(r,i,n){var a=S_(i);this._optionManager.setOption(r,n,a),this._resetOption(null,a)},e.prototype.resetOption=function(r,i){return this._resetOption(r,S_(i))},e.prototype._resetOption=function(r,i){var n=!1,a=this._optionManager;if(!r||r==="recreate"){var o=a.mountOption(r==="recreate");!this.option||r==="recreate"?__(this,o):(this.restoreData(),this._mergeOption(o,i)),n=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var s=a.getTimelineOption(this);s&&(n=!0,this._mergeOption(s,i))}if(!r||r==="recreate"||r==="media"){var l=a.getMediaOption(this);l.length&&M(l,function(u){n=!0,this._mergeOption(u,i)},this)}return n},e.prototype.mergeOption=function(r){this._mergeOption(r,null)},e.prototype._mergeOption=function(r,i){var n=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=ht(),u=i&&i.replaceMergeMainTypeMap;aL(this),M(r,function(h,v){h!=null&&(Vt.hasClass(v)?v&&(s.push(v),l.set(v,!0)):n[v]=n[v]==null?ft(h):dt(n[v],h,!0))}),u&&u.each(function(h,v){Vt.hasClass(v)&&!l.get(v)&&(s.push(v),l.set(v,!0))}),Vt.topologicalTravel(s,Vt.getAllClassMainTypes(),f,this);function f(h){var v=fL(this,h,ge(r[h])),c=a.get(h),d=c?u&&u.get(h)?"replaceMerge":"normalMerge":"replaceAll",p=Jx(c,v,d);hC(p,h,Vt),n[h]=null,a.set(h,null),o.set(h,0);var g=[],m=[],_=0,y;M(p,function(x,S){var T=x.existing,b=x.newOption;if(!b)T&&(T.mergeOption({},this),T.optionUpdated({},!1));else{var w=h==="series",A=Vt.getClass(h,x.keyInfo.subType,!w);if(!A)return;if(h==="tooltip"){if(y)return;y=!0}if(T&&T.constructor===A)T.name=x.keyInfo.name,T.mergeOption(b,this),T.optionUpdated(b,!1);else{var C=U({componentIndex:S},x.keyInfo);T=new A(b,this,this,C),U(T,C),x.brandNew&&(T.__requireNewView=!0),T.init(b,this,this),T.optionUpdated(null,!0)}}T?(g.push(T.option),m.push(T),_++):(g.push(void 0),m.push(void 0))},this),n[h]=g,a.set(h,m),o.set(h,_),h==="series"&&Bl(this)}this._seriesIndices||Bl(this)},e.prototype.getOption=function(){var r=ft(this.option);return M(r,function(i,n){if(Vt.hasClass(n)){for(var a=ge(i),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!Ns(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,r[n]=a}}),delete r[y_],r},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(r){this._payload=r},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(r,i){var n=this._componentsMap.get(r);if(n){var a=n[i||0];if(a)return a;if(i==null){for(var o=0;o<n.length;o++)if(n[o])return n[o]}}},e.prototype.queryComponents=function(r){var i=r.mainType;if(!i)return[];var n=r.index,a=r.id,o=r.name,s=this._componentsMap.get(i);if(!s||!s.length)return[];var l;return n!=null?(l=[],M(ge(n),function(u){s[u]&&l.push(s[u])})):a!=null?l=x_("id",a,s):o!=null?l=x_("name",o,s):l=ce(s,function(u){return!!u}),T_(l,r)},e.prototype.findComponents=function(r){var i=r.query,n=r.mainType,a=s(i),o=a?this.queryComponents(a):ce(this._componentsMap.get(n),function(u){return!!u});return l(T_(o,r));function s(u){var f=n+"Index",h=n+"Id",v=n+"Name";return u&&(u[f]!=null||u[h]!=null||u[v]!=null)?{mainType:n,index:u[f],id:u[h],name:u[v]}:null}function l(u){return r.filter?ce(u,r.filter):u}},e.prototype.eachComponent=function(r,i,n){var a=this._componentsMap;if(ct(r)){var o=i,s=r;a.each(function(h,v){for(var c=0;h&&c<h.length;c++){var d=h[c];d&&s.call(o,v,d,d.componentIndex)}})}else for(var l=Z(r)?a.get(r):j(r)?this.findComponents(r):null,u=0;l&&u<l.length;u++){var f=l[u];f&&i.call(n,f,f.componentIndex)}},e.prototype.getSeriesByName=function(r){var i=Ge(r,null);return ce(this._componentsMap.get("series"),function(n){return!!n&&i!=null&&n.name===i})},e.prototype.getSeriesByIndex=function(r){return this._componentsMap.get("series")[r]},e.prototype.getSeriesByType=function(r){return ce(this._componentsMap.get("series"),function(i){return!!i&&i.subType===r})},e.prototype.getSeries=function(){return ce(this._componentsMap.get("series"),function(r){return!!r})},e.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},e.prototype.eachSeries=function(r,i){Oo(this),M(this._seriesIndices,function(n){var a=this._componentsMap.get("series")[n];r.call(i,a,n)},this)},e.prototype.eachRawSeries=function(r,i){M(this._componentsMap.get("series"),function(n){n&&r.call(i,n,n.componentIndex)})},e.prototype.eachSeriesByType=function(r,i,n){Oo(this),M(this._seriesIndices,function(a){var o=this._componentsMap.get("series")[a];o.subType===r&&i.call(n,o,a)},this)},e.prototype.eachRawSeriesByType=function(r,i,n){return M(this.getSeriesByType(r),i,n)},e.prototype.isSeriesFiltered=function(r){return Oo(this),this._seriesIndicesMap.get(r.componentIndex)==null},e.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},e.prototype.filterSeries=function(r,i){Oo(this);var n=[];M(this._seriesIndices,function(a){var o=this._componentsMap.get("series")[a];r.call(i,o,a)&&n.push(a)},this),this._seriesIndices=n,this._seriesIndicesMap=ht(n)},e.prototype.restoreData=function(r){Bl(this);var i=this._componentsMap,n=[];i.each(function(a,o){Vt.hasClass(o)&&n.push(o)}),Vt.topologicalTravel(n,Vt.getAllClassMainTypes(),function(a){M(i.get(a),function(o){o&&(a!=="series"||!pL(o,r))&&o.restoreData()})})},e.internalField=function(){Bl=function(r){var i=r._seriesIndices=[];M(r._componentsMap.get("series"),function(n){n&&i.push(n.componentIndex)}),r._seriesIndicesMap=ht(i)},Oo=function(r){},__=function(r,i){r.option={},r.option[y_]=dL,r._componentsMap=ht({series:[]}),r._componentsCount=ht();var n=i.aria;j(n)&&n.enabled==null&&(n.enabled=!0),gL(i,r._theme.option),dt(i,nL,!1),r._mergeOption(i,null)}}(),e}(Te);function pL(t,e){if(e){var r=e.seriesIndex,i=e.seriesId,n=e.seriesName;return r!=null&&t.componentIndex!==r||i!=null&&t.id!==i||n!=null&&t.name!==n}}function gL(t,e){var r=t.color&&!t.colorLayer;M(e,function(i,n){n==="colorLayer"&&r||Vt.hasClass(n)||(typeof i=="object"?t[n]=t[n]?dt(t[n],i,!1):ft(i):t[n]==null&&(t[n]=i))})}function x_(t,e,r){if(X(e)){var i=ht();return M(e,function(a){if(a!=null){var o=Ge(a,null);o!=null&&i.set(a,!0)}}),ce(r,function(a){return a&&i.get(a[t])})}else{var n=Ge(e,null);return ce(r,function(a){return a&&n!=null&&a[t]===n})}}function T_(t,e){return e.hasOwnProperty("subType")?ce(t,function(r){return r&&r.subType===e.subType}):t}function S_(t){var e=ht();return t&&M(ge(t.replaceMerge),function(r){e.set(r,!0)}),{replaceMergeMainTypeMap:e}}qr(SS,Xp);const wS=SS;var mL=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],_L=function(){function t(e){M(mL,function(r){this[r]=et(e[r],e)},this)}return t}();const bS=_L;var mc={},yL=function(){function t(){this._coordinateSystems=[]}return t.prototype.create=function(e,r){var i=[];M(mc,function(n,a){var o=n.create(e,r);i=i.concat(o||[])}),this._coordinateSystems=i},t.prototype.update=function(e,r){M(this._coordinateSystems,function(i){i.update&&i.update(e,r)})},t.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},t.register=function(e,r){mc[e]=r},t.get=function(e){return mc[e]},t}();const lh=yL;var xL=/^(min|max)?(.+)$/,TL=function(){function t(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return t.prototype.setOption=function(e,r,i){e&&(M(ge(e.series),function(o){o&&o.data&&cr(o.data)&&Wu(o.data)}),M(ge(e.dataset),function(o){o&&o.source&&cr(o.source)&&Wu(o.source)})),e=ft(e);var n=this._optionBackup,a=SL(e,r,!n);this._newBaseOption=a.baseOption,n?(a.timelineOptions.length&&(n.timelineOptions=a.timelineOptions),a.mediaList.length&&(n.mediaList=a.mediaList),a.mediaDefault&&(n.mediaDefault=a.mediaDefault)):this._optionBackup=a},t.prototype.mountOption=function(e){var r=this._optionBackup;return this._timelineOptions=r.timelineOptions,this._mediaList=r.mediaList,this._mediaDefault=r.mediaDefault,this._currentMediaIndices=[],ft(e?r.baseOption:this._newBaseOption)},t.prototype.getTimelineOption=function(e){var r,i=this._timelineOptions;if(i.length){var n=e.getComponent("timeline");n&&(r=ft(i[n.getCurrentIndex()]))}return r},t.prototype.getMediaOption=function(e){var r=this._api.getWidth(),i=this._api.getHeight(),n=this._mediaList,a=this._mediaDefault,o=[],s=[];if(!n.length&&!a)return s;for(var l=0,u=n.length;l<u;l++)wL(n[l].query,r,i)&&o.push(l);return!o.length&&a&&(o=[-1]),o.length&&!AL(o,this._currentMediaIndices)&&(s=K(o,function(f){return ft(f===-1?a.option:n[f].option)})),this._currentMediaIndices=o,s},t}();function SL(t,e,r){var i=[],n,a,o=t.baseOption,s=t.timeline,l=t.options,u=t.media,f=!!t.media,h=!!(l||s||o&&o.timeline);o?(a=o,a.timeline||(a.timeline=s)):((h||f)&&(t.options=t.media=null),a=t),f&&X(u)&&M(u,function(c){c&&c.option&&(c.query?i.push(c):n||(n=c))}),v(a),M(l,function(c){return v(c)}),M(i,function(c){return v(c.option)});function v(c){M(e,function(d){d(c,r)})}return{baseOption:a,timelineOptions:l||[],mediaDefault:n,mediaList:i}}function wL(t,e,r){var i={width:e,height:r,aspectratio:e/r},n=!0;return M(t,function(a,o){var s=o.match(xL);if(!(!s||!s[1]||!s[2])){var l=s[1],u=s[2].toLowerCase();bL(i[u],a,l)||(n=!1)}}),n}function bL(t,e,r){return r==="min"?t>=e:r==="max"?t<=e:t===e}function AL(t,e){return t.join(",")===e.join(",")}const EL=TL;var Fr=M,Us=j,w_=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function _c(t){var e=t&&t.itemStyle;if(e)for(var r=0,i=w_.length;r<i;r++){var n=w_[r],a=e.normal,o=e.emphasis;a&&a[n]&&(t[n]=t[n]||{},t[n].normal?dt(t[n].normal,a[n]):t[n].normal=a[n],a[n]=null),o&&o[n]&&(t[n]=t[n]||{},t[n].emphasis?dt(t[n].emphasis,o[n]):t[n].emphasis=o[n],o[n]=null)}}function Ie(t,e,r){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var i=t[e].normal,n=t[e].emphasis;i&&(r?(t[e].normal=t[e].emphasis=null,Lt(t[e],i)):t[e]=i),n&&(t.emphasis=t.emphasis||{},t.emphasis[e]=n,n.focus&&(t.emphasis.focus=n.focus),n.blurScope&&(t.emphasis.blurScope=n.blurScope))}}function hs(t){Ie(t,"itemStyle"),Ie(t,"lineStyle"),Ie(t,"areaStyle"),Ie(t,"label"),Ie(t,"labelLine"),Ie(t,"upperLabel"),Ie(t,"edgeLabel")}function he(t,e){var r=Us(t)&&t[e],i=Us(r)&&r.textStyle;if(i)for(var n=0,a=bm.length;n<a;n++){var o=bm[n];i.hasOwnProperty(o)&&(r[o]=i[o])}}function xr(t){t&&(hs(t),he(t,"label"),t.emphasis&&he(t.emphasis,"label"))}function CL(t){if(Us(t)){_c(t),hs(t),he(t,"label"),he(t,"upperLabel"),he(t,"edgeLabel"),t.emphasis&&(he(t.emphasis,"label"),he(t.emphasis,"upperLabel"),he(t.emphasis,"edgeLabel"));var e=t.markPoint;e&&(_c(e),xr(e));var r=t.markLine;r&&(_c(r),xr(r));var i=t.markArea;i&&xr(i);var n=t.data;if(t.type==="graph"){n=n||t.nodes;var a=t.links||t.edges;if(a&&!cr(a))for(var o=0;o<a.length;o++)xr(a[o]);M(t.categories,function(u){hs(u)})}if(n&&!cr(n))for(var o=0;o<n.length;o++)xr(n[o]);if(e=t.markPoint,e&&e.data)for(var s=e.data,o=0;o<s.length;o++)xr(s[o]);if(r=t.markLine,r&&r.data)for(var l=r.data,o=0;o<l.length;o++)X(l[o])?(xr(l[o][0]),xr(l[o][1])):xr(l[o]);t.type==="gauge"?(he(t,"axisLabel"),he(t,"title"),he(t,"detail")):t.type==="treemap"?(Ie(t.breadcrumb,"itemStyle"),M(t.levels,function(u){hs(u)})):t.type==="tree"&&hs(t.leaves)}}function gi(t){return X(t)?t:t?[t]:[]}function b_(t){return(X(t)?t[0]:t)||{}}function ML(t,e){Fr(gi(t.series),function(i){Us(i)&&CL(i)});var r=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&r.push("valueAxis","categoryAxis","logAxis","timeAxis"),Fr(r,function(i){Fr(gi(t[i]),function(n){n&&(he(n,"axisLabel"),he(n.axisPointer,"label"))})}),Fr(gi(t.parallel),function(i){var n=i&&i.parallelAxisDefault;he(n,"axisLabel"),he(n&&n.axisPointer,"label")}),Fr(gi(t.calendar),function(i){Ie(i,"itemStyle"),he(i,"dayLabel"),he(i,"monthLabel"),he(i,"yearLabel")}),Fr(gi(t.radar),function(i){he(i,"name"),i.name&&i.axisName==null&&(i.axisName=i.name,delete i.name),i.nameGap!=null&&i.axisNameGap==null&&(i.axisNameGap=i.nameGap,delete i.nameGap)}),Fr(gi(t.geo),function(i){Us(i)&&(xr(i),Fr(gi(i.regions),function(n){xr(n)}))}),Fr(gi(t.timeline),function(i){xr(i),Ie(i,"label"),Ie(i,"itemStyle"),Ie(i,"controlStyle",!0);var n=i.data;X(n)&&M(n,function(a){j(a)&&(Ie(a,"label"),Ie(a,"itemStyle"))})}),Fr(gi(t.toolbox),function(i){Ie(i,"iconStyle"),Fr(i.feature,function(n){Ie(n,"iconStyle")})}),he(b_(t.axisPointer),"label"),he(b_(t.tooltip).axisPointer,"label")}function DL(t,e){for(var r=e.split(","),i=t,n=0;n<r.length&&(i=i&&i[r[n]],i!=null);n++);return i}function LL(t,e,r,i){for(var n=e.split(","),a=t,o,s=0;s<n.length-1;s++)o=n[s],a[o]==null&&(a[o]={}),a=a[o];(i||a[n[s]]==null)&&(a[n[s]]=r)}function A_(t){t&&M(RL,function(e){e[0]in t&&!(e[1]in t)&&(t[e[1]]=t[e[0]])})}var RL=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],PL=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],yc=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function Bo(t){var e=t&&t.itemStyle;if(e)for(var r=0;r<yc.length;r++){var i=yc[r][1],n=yc[r][0];e[i]!=null&&(e[n]=e[i])}}function E_(t){t&&t.alignTo==="edge"&&t.margin!=null&&t.edgeDistance==null&&(t.edgeDistance=t.margin)}function C_(t){t&&t.downplay&&!t.blur&&(t.blur=t.downplay)}function IL(t){t&&t.focusNodeAdjacency!=null&&(t.emphasis=t.emphasis||{},t.emphasis.focus==null&&(t.emphasis.focus="adjacency"))}function AS(t,e){if(t)for(var r=0;r<t.length;r++)e(t[r]),t[r]&&AS(t[r].children,e)}function ES(t,e){ML(t,e),t.series=ge(t.series),M(t.series,function(r){if(j(r)){var i=r.type;if(i==="line")r.clipOverflow!=null&&(r.clip=r.clipOverflow);else if(i==="pie"||i==="gauge"){r.clockWise!=null&&(r.clockwise=r.clockWise),E_(r.label);var n=r.data;if(n&&!cr(n))for(var a=0;a<n.length;a++)E_(n[a]);r.hoverOffset!=null&&(r.emphasis=r.emphasis||{},(r.emphasis.scaleSize=null)&&(r.emphasis.scaleSize=r.hoverOffset))}else if(i==="gauge"){var o=DL(r,"pointer.color");o!=null&&LL(r,"itemStyle.color",o)}else if(i==="bar"){Bo(r),Bo(r.backgroundStyle),Bo(r.emphasis);var n=r.data;if(n&&!cr(n))for(var a=0;a<n.length;a++)typeof n[a]=="object"&&(Bo(n[a]),Bo(n[a]&&n[a].emphasis))}else if(i==="sunburst"){var s=r.highlightPolicy;s&&(r.emphasis=r.emphasis||{},r.emphasis.focus||(r.emphasis.focus=s)),C_(r),AS(r.data,C_)}else i==="graph"||i==="sankey"?IL(r):i==="map"&&(r.mapType&&!r.map&&(r.map=r.mapType),r.mapLocation&&Lt(r,r.mapLocation));r.hoverAnimation!=null&&(r.emphasis=r.emphasis||{},r.emphasis&&r.emphasis.scale==null&&(r.emphasis.scale=r.hoverAnimation)),A_(r)}}),t.dataRange&&(t.visualMap=t.dataRange),M(PL,function(r){var i=t[r];i&&(X(i)||(i=[i]),M(i,function(n){A_(n)}))})}function NL(t){var e=ht();t.eachSeries(function(r){var i=r.get("stack");if(i){var n=e.get(i)||e.set(i,[]),a=r.getData(),o={stackResultDimension:a.getCalculationInfo("stackResultDimension"),stackedOverDimension:a.getCalculationInfo("stackedOverDimension"),stackedDimension:a.getCalculationInfo("stackedDimension"),stackedByDimension:a.getCalculationInfo("stackedByDimension"),isStackedByIndex:a.getCalculationInfo("isStackedByIndex"),data:a,seriesModel:r};if(!o.stackedDimension||!(o.isStackedByIndex||o.stackedByDimension))return;n.length&&a.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(o)}}),e.each(OL)}function OL(t){M(t,function(e,r){var i=[],n=[NaN,NaN],a=[e.stackResultDimension,e.stackedOverDimension],o=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";o.modify(a,function(u,f,h){var v=o.get(e.stackedDimension,h);if(isNaN(v))return n;var c,d;s?d=o.getRawIndex(h):c=o.get(e.stackedByDimension,h);for(var p=NaN,g=r-1;g>=0;g--){var m=t[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,c)),d>=0){var _=m.data.getByRawIndex(m.stackResultDimension,d);if(l==="all"||l==="positive"&&_>0||l==="negative"&&_<0||l==="samesign"&&v>=0&&_>0||l==="samesign"&&v<=0&&_<0){v=JE(v,_),p=_;break}}}return i[0]=v,i[1]=p,i})})}var uh=function(){function t(e){this.data=e.data||(e.sourceFormat===Ri?{}:[]),this.sourceFormat=e.sourceFormat||_S,this.seriesLayoutBy=e.seriesLayoutBy||fi,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var r=this.dimensionsDefine=e.dimensionsDefine;if(r)for(var i=0;i<r.length;i++){var n=r[i];n.type==null&&TS(this,i)===sr.Must&&(n.type="ordinal")}}return t}();function Yp(t){return t instanceof uh}function ud(t,e,r){r=r||CS(t);var i=e.seriesLayoutBy,n=FL(t,r,i,e.sourceHeader,e.dimensions),a=new uh({data:t,sourceFormat:r,seriesLayoutBy:i,dimensionsDefine:n.dimensionsDefine,startIndex:n.startIndex,dimensionsDetectedCount:n.dimensionsDetectedCount,metaRawOption:ft(e)});return a}function $p(t){return new uh({data:t,sourceFormat:cr(t)?rn:Or})}function BL(t){return new uh({data:t.data,sourceFormat:t.sourceFormat,seriesLayoutBy:t.seriesLayoutBy,dimensionsDefine:ft(t.dimensionsDefine),startIndex:t.startIndex,dimensionsDetectedCount:t.dimensionsDetectedCount})}function CS(t){var e=_S;if(cr(t))e=rn;else if(X(t)){t.length===0&&(e=ir);for(var r=0,i=t.length;r<i;r++){var n=t[r];if(n!=null){if(X(n)){e=ir;break}else if(j(n)){e=di;break}}}}else if(j(t)){for(var a in t)if(_t(t,a)&&$e(t[a])){e=Ri;break}}return e}function FL(t,e,r,i,n){var a,o;if(!t)return{dimensionsDefine:M_(n),startIndex:o,dimensionsDetectedCount:a};if(e===ir){var s=t;i==="auto"||i==null?D_(function(u){u!=null&&u!=="-"&&(Z(u)?o==null&&(o=1):o=0)},r,s,10):o=Qt(i)?i:i?1:0,!n&&o===1&&(n=[],D_(function(u,f){n[f]=u!=null?u+"":""},r,s,1/0)),a=n?n.length:r===bo?s.length:s[0]?s[0].length:null}else if(e===di)n||(n=kL(t));else if(e===Ri)n||(n=[],M(t,function(u,f){n.push(f)}));else if(e===Or){var l=rl(t[0]);a=X(l)&&l.length||1}return{startIndex:o,dimensionsDefine:M_(n),dimensionsDetectedCount:a}}function kL(t){for(var e=0,r;e<t.length&&!(r=t[e++]););if(r)return yt(r)}function M_(t){if(t){var e=ht();return K(t,function(r,i){r=j(r)?r:{name:r};var n={name:r.name,displayName:r.displayName,type:r.type};if(n.name==null)return n;n.name+="",n.displayName==null&&(n.displayName=n.name);var a=e.get(n.name);return a?n.name+="-"+a.count++:e.set(n.name,{count:1}),n})}}function D_(t,e,r,i){if(e===bo)for(var n=0;n<r.length&&n<i;n++)t(r[n]?r[n][0]:null,n);else for(var a=r[0]||[],n=0;n<a.length&&n<i;n++)t(a[n],n)}function MS(t){var e=t.sourceFormat;return e===di||e===Ri}var En,Cn,Mn,L_,R_,DS=function(){function t(e,r){var i=Yp(e)?e:$p(e);this._source=i;var n=this._data=i.data;i.sourceFormat===rn&&(this._offset=0,this._dimSize=r,this._data=n),R_(this,n,i)}return t.prototype.getSource=function(){return this._source},t.prototype.count=function(){return 0},t.prototype.getItem=function(e,r){},t.prototype.appendData=function(e){},t.prototype.clean=function(){},t.protoInitialize=function(){var e=t.prototype;e.pure=!1,e.persistent=!0}(),t.internalField=function(){var e;R_=function(o,s,l){var u=l.sourceFormat,f=l.seriesLayoutBy,h=l.startIndex,v=l.dimensionsDefine,c=L_[Zp(u,f)];if(U(o,c),u===rn)o.getItem=r,o.count=n,o.fillStorage=i;else{var d=LS(u,f);o.getItem=et(d,null,s,h,v);var p=RS(u,f);o.count=et(p,null,s,h,v)}};var r=function(o,s){o=o-this._offset,s=s||[];for(var l=this._data,u=this._dimSize,f=u*o,h=0;h<u;h++)s[h]=l[f+h];return s},i=function(o,s,l,u){for(var f=this._data,h=this._dimSize,v=0;v<h;v++){for(var c=u[v],d=c[0]==null?1/0:c[0],p=c[1]==null?-1/0:c[1],g=s-o,m=l[v],_=0;_<g;_++){var y=f[_*h+v];m[o+_]=y,y<d&&(d=y),y>p&&(p=y)}c[0]=d,c[1]=p}},n=function(){return this._data?this._data.length/this._dimSize:0};L_=(e={},e[ir+"_"+fi]={pure:!0,appendData:a},e[ir+"_"+bo]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[di]={pure:!0,appendData:a},e[Ri]={pure:!0,appendData:function(o){var s=this._data;M(o,function(l,u){for(var f=s[u]||(s[u]=[]),h=0;h<(l||[]).length;h++)f.push(l[h])})}},e[Or]={appendData:a},e[rn]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(o){for(var s=0;s<o.length;s++)this._data.push(o[s])}}(),t}(),P_=function(t,e,r,i){return t[i]},zL=(En={},En[ir+"_"+fi]=function(t,e,r,i){return t[i+e]},En[ir+"_"+bo]=function(t,e,r,i,n){i+=e;for(var a=n||[],o=t,s=0;s<o.length;s++){var l=o[s];a[s]=l?l[i]:null}return a},En[di]=P_,En[Ri]=function(t,e,r,i,n){for(var a=n||[],o=0;o<r.length;o++){var s=r[o].name,l=t[s];a[o]=l?l[i]:null}return a},En[Or]=P_,En);function LS(t,e){var r=zL[Zp(t,e)];return r}var I_=function(t,e,r){return t.length},UL=(Cn={},Cn[ir+"_"+fi]=function(t,e,r){return Math.max(0,t.length-e)},Cn[ir+"_"+bo]=function(t,e,r){var i=t[0];return i?Math.max(0,i.length-e):0},Cn[di]=I_,Cn[Ri]=function(t,e,r){var i=r[0].name,n=t[i];return n?n.length:0},Cn[Or]=I_,Cn);function RS(t,e){var r=UL[Zp(t,e)];return r}var xc=function(t,e,r){return t[e]},HL=(Mn={},Mn[ir]=xc,Mn[di]=function(t,e,r){return t[r]},Mn[Ri]=xc,Mn[Or]=function(t,e,r){var i=rl(t);return i instanceof Array?i[e]:i},Mn[rn]=xc,Mn);function PS(t){var e=HL[t];return e}function Zp(t,e){return t===ir?t+"_"+e:t}function ho(t,e,r){if(t){var i=t.getRawDataItem(e);if(i!=null){var n=t.getStore(),a=n.getSource().sourceFormat;if(r!=null){var o=t.getDimensionIndex(r),s=n.getDimensionProperty(o);return PS(a)(i,o,s)}else{var l=i;return a===Or&&(l=rl(i)),l}}}}var VL=/\{@(.+?)\}/g,GL=function(){function t(){}return t.prototype.getDataParams=function(e,r){var i=this.getData(r),n=this.getRawValue(e,r),a=i.getRawIndex(e),o=i.getName(e),s=i.getRawDataItem(e),l=i.getItemVisual(e,"style"),u=l&&l[i.getItemVisual(e,"drawType")||"fill"],f=l&&l.stroke,h=this.mainType,v=h==="series",c=i.userOutput&&i.userOutput.get();return{componentType:h,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:v?this.subType:null,seriesIndex:this.seriesIndex,seriesId:v?this.id:null,seriesName:v?this.name:null,name:o,dataIndex:a,data:s,dataType:r,value:n,color:u,borderColor:f,dimensionNames:c?c.fullDimensions:null,encode:c?c.encode:null,$vars:["seriesName","name","value"]}},t.prototype.getFormattedLabel=function(e,r,i,n,a,o){r=r||"normal";var s=this.getData(i),l=this.getDataParams(e,i);if(o&&(l.value=o.interpolatedValue),n!=null&&X(l.value)&&(l.value=l.value[n]),!a){var u=s.getItemModel(e);a=u.get(r==="normal"?["label","formatter"]:[r,"label","formatter"])}if(ct(a))return l.status=r,l.dimensionIndex=n,a(l);if(Z(a)){var f=hS(a,l);return f.replace(VL,function(h,v){var c=v.length,d=v;d.charAt(0)==="["&&d.charAt(c-1)==="]"&&(d=+d.slice(1,c-1));var p=ho(s,e,d);if(o&&X(o.interpolatedValue)){var g=s.getDimensionIndex(d);g>=0&&(p=o.interpolatedValue[g])}return p!=null?p+"":""})}},t.prototype.getRawValue=function(e,r){return ho(this.getData(r),e)},t.prototype.formatTooltip=function(e,r,i){},t}();function N_(t){var e,r;return j(t)?t.type&&(r=t):e=t,{text:e,frag:r}}function As(t){return new WL(t)}var WL=function(){function t(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return t.prototype.perform=function(e){var r=this._upstream,i=e&&e.skip;if(this._dirty&&r){var n=this.context;n.data=n.outputData=r.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!i&&(a=this._plan(this.context));var o=f(this._modBy),s=this._modDataCount||0,l=f(e&&e.modBy),u=e&&e.modDataCount||0;(o!==l||s!==u)&&(a="reset");function f(_){return!(_>=1)&&(_=1),_}var h;(this._dirty||a==="reset")&&(this._dirty=!1,h=this._doReset(i)),this._modBy=l,this._modDataCount=u;var v=e&&e.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var c=this._dueIndex,d=Math.min(v!=null?this._dueIndex+v:1/0,this._dueEnd);if(!i&&(h||c<d)){var p=this._progress;if(X(p))for(var g=0;g<p.length;g++)this._doProgress(p[g],c,d,l,u);else this._doProgress(p,c,d,l,u)}this._dueIndex=d;var m=this._settedOutputEnd!=null?this._settedOutputEnd:d;this._outputDueEnd=m}else this._dueIndex=this._outputDueEnd=this._settedOutputEnd!=null?this._settedOutputEnd:this._dueEnd;return this.unfinished()},t.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},t.prototype._doProgress=function(e,r,i,n,a){O_.reset(r,i,n,a),this._callingProgress=e,this._callingProgress({start:r,end:i,count:i-r,next:O_.next},this.context)},t.prototype._doReset=function(e){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null;var r,i;!e&&this._reset&&(r=this._reset(this.context),r&&r.progress&&(i=r.forceFirstProgress,r=r.progress),X(r)&&!r.length&&(r=null)),this._progress=r,this._modBy=this._modDataCount=null;var n=this._downstream;return n&&n.dirty(),i},t.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},t.prototype.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},t.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},t.prototype.getUpstream=function(){return this._upstream},t.prototype.getDownstream=function(){return this._downstream},t.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},t}(),O_=function(){var t,e,r,i,n,a={reset:function(l,u,f,h){e=l,t=u,r=f,i=h,n=Math.ceil(i/r),a.next=r>1&&i>0?s:o}};return a;function o(){return e<t?e++:null}function s(){var l=e%n*r+Math.ceil(e/n),u=e>=t?null:l<i?l:e;return e++,u}}();function Mu(t,e){var r=e&&e.type;return r==="ordinal"?t:(r==="time"&&!Qt(t)&&t!=null&&t!=="-"&&(t=+vi(t)),t==null||t===""?NaN:+t)}ht({number:function(t){return parseFloat(t)},time:function(t){return+vi(t)},trim:function(t){return Z(t)?li(t):t}});var XL=function(){function t(e,r){var i=e==="desc";this._resultLT=i?1:-1,r==null&&(r=i?"min":"max"),this._incomparable=r==="min"?-1/0:1/0}return t.prototype.evaluate=function(e,r){var i=Qt(e)?e:tf(e),n=Qt(r)?r:tf(r),a=isNaN(i),o=isNaN(n);if(a&&(i=this._incomparable),o&&(n=this._incomparable),a&&o){var s=Z(e),l=Z(r);s&&(i=l?e:0),l&&(n=s?r:0)}return i<n?this._resultLT:i>n?-this._resultLT:0},t}(),YL=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(e){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(e){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(e,r){},t.prototype.retrieveValueFromItem=function(e,r){},t.prototype.convertValue=function(e,r){return Mu(e,r)},t}();function $L(t,e){var r=new YL,i=t.data,n=r.sourceFormat=t.sourceFormat,a=t.startIndex,o="";t.seriesLayoutBy!==fi&&je(o);var s=[],l={},u=t.dimensionsDefine;if(u)M(u,function(p,g){var m=p.name,_={index:g,name:m,displayName:p.displayName};if(s.push(_),m!=null){var y="";_t(l,m)&&je(y),l[m]=_}});else for(var f=0;f<t.dimensionsDetectedCount;f++)s.push({index:f});var h=LS(n,fi);e.__isBuiltIn&&(r.getRawDataItem=function(p){return h(i,a,s,p)},r.getRawData=et(ZL,null,t)),r.cloneRawData=et(qL,null,t);var v=RS(n,fi);r.count=et(v,null,i,a,s);var c=PS(n);r.retrieveValue=function(p,g){var m=h(i,a,s,p);return d(m,g)};var d=r.retrieveValueFromItem=function(p,g){if(p!=null){var m=s[g];if(m)return c(p,g,m.name)}};return r.getDimensionInfo=et(KL,null,s,l),r.cloneAllDimensionInfo=et(jL,null,s),r}function ZL(t){var e=t.sourceFormat;if(!qp(e)){var r="";je(r)}return t.data}function qL(t){var e=t.sourceFormat,r=t.data;if(!qp(e)){var i="";je(i)}if(e===ir){for(var n=[],a=0,o=r.length;a<o;a++)n.push(r[a].slice());return n}else if(e===di){for(var n=[],a=0,o=r.length;a<o;a++)n.push(U({},r[a]));return n}}function KL(t,e,r){if(r!=null){if(Qt(r)||!isNaN(r)&&!_t(e,r))return t[r];if(_t(e,r))return e[r]}}function jL(t){return ft(t)}var IS=ht();function QL(t){t=ft(t);var e=t.type,r="";e||je(r);var i=e.split(":");i.length!==2&&je(r);var n=!1;i[0]==="echarts"&&(e=i[1],n=!0),t.__isBuiltIn=n,IS.set(e,t)}function JL(t,e,r){var i=ge(t),n=i.length,a="";n||je(a);for(var o=0,s=n;o<s;o++){var l=i[o];e=tR(l,e),o!==s-1&&(e.length=Math.max(e.length,1))}return e}function tR(t,e,r,i){var n="";e.length||je(n),j(t)||je(n);var a=t.type,o=IS.get(a);o||je(n);var s=K(e,function(u){return $L(u,o)}),l=ge(o.transform({upstream:s[0],upstreamList:s,config:ft(t.config)}));return K(l,function(u,f){var h="";j(u)||je(h),u.data||je(h);var v=CS(u.data);qp(v)||je(h);var c,d=e[0];if(d&&f===0&&!u.dimensions){var p=d.startIndex;p&&(u.data=d.data.slice(0,p).concat(u.data)),c={seriesLayoutBy:fi,sourceHeader:p,dimensions:d.metaRawOption.dimensions}}else c={seriesLayoutBy:fi,sourceHeader:0,dimensions:u.dimensions};return ud(u.data,c,null)})}function qp(t){return t===ir||t===di}var fh="undefined",eR=typeof Uint32Array===fh?Array:Uint32Array,rR=typeof Uint16Array===fh?Array:Uint16Array,NS=typeof Int32Array===fh?Array:Int32Array,B_=typeof Float64Array===fh?Array:Float64Array,OS={float:B_,int:NS,ordinal:Array,number:Array,time:B_},Tc;function Fo(t){return t>65535?eR:rR}function Ma(){return[1/0,-1/0]}function iR(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function F_(t,e,r,i,n){var a=OS[r||"float"];if(n){var o=t[e],s=o&&o.length;if(s!==i){for(var l=new a(i),u=0;u<s;u++)l[u]=o[u];t[e]=l}}else t[e]=new a(i)}var fd=function(){function t(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=ht()}return t.prototype.initData=function(e,r,i){this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var n=e.getSource(),a=this.defaultDimValueGetter=Tc[n.sourceFormat];this._dimValueGetter=i||a,this._rawExtent=[],MS(n),this._dimensions=K(r,function(o){return{type:o.type,property:o.property}}),this._initDataFromProvider(0,e.count())},t.prototype.getProvider=function(){return this._provider},t.prototype.getSource=function(){return this._provider.getSource()},t.prototype.ensureCalculationDimension=function(e,r){var i=this._calcDimNameToIdx,n=this._dimensions,a=i.get(e);if(a!=null){if(n[a].type===r)return a}else a=n.length;return n[a]={type:r},i.set(e,a),this._chunks[a]=new OS[r||"float"](this._rawCount),this._rawExtent[a]=Ma(),a},t.prototype.collectOrdinalMeta=function(e,r){var i=this._chunks[e],n=this._dimensions[e],a=this._rawExtent,o=n.ordinalOffset||0,s=i.length;o===0&&(a[e]=Ma());for(var l=a[e],u=o;u<s;u++){var f=i[u]=r.parseAndCollect(i[u]);isNaN(f)||(l[0]=Math.min(f,l[0]),l[1]=Math.max(f,l[1]))}n.ordinalMeta=r,n.ordinalOffset=s,n.type="ordinal"},t.prototype.getOrdinalMeta=function(e){var r=this._dimensions[e],i=r.ordinalMeta;return i},t.prototype.getDimensionProperty=function(e){var r=this._dimensions[e];return r&&r.property},t.prototype.appendData=function(e){var r=this._provider,i=this.count();r.appendData(e);var n=r.count();return r.persistent||(n+=i),i<n&&this._initDataFromProvider(i,n,!0),[i,n]},t.prototype.appendValues=function(e,r){for(var i=this._chunks,n=this._dimensions,a=n.length,o=this._rawExtent,s=this.count(),l=s+Math.max(e.length,r||0),u=0;u<a;u++){var f=n[u];F_(i,u,f.type,l,!0)}for(var h=[],v=s;v<l;v++)for(var c=v-s,d=0;d<a;d++){var f=n[d],p=Tc.arrayRows.call(this,e[c]||h,f.property,c,d);i[d][v]=p;var g=o[d];p<g[0]&&(g[0]=p),p>g[1]&&(g[1]=p)}return this._rawCount=this._count=l,{start:s,end:l}},t.prototype._initDataFromProvider=function(e,r,i){for(var n=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=K(o,function(_){return _.property}),f=0;f<s;f++){var h=o[f];l[f]||(l[f]=Ma()),F_(a,f,h.type,r,i)}if(n.fillStorage)n.fillStorage(e,r,a,l);else for(var v=[],c=e;c<r;c++){v=n.getItem(c,v);for(var d=0;d<s;d++){var p=a[d],g=this._dimValueGetter(v,u[d],c,d);p[c]=g;var m=l[d];g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}!n.persistent&&n.clean&&n.clean(),this._rawCount=this._count=r,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(e,r){if(!(r>=0&&r<this._count))return NaN;var i=this._chunks[e];return i?i[this.getRawIndex(r)]:NaN},t.prototype.getValues=function(e,r){var i=[],n=[];if(r==null){r=e,e=[];for(var a=0;a<this._dimensions.length;a++)n.push(a)}else n=e;for(var a=0,o=n.length;a<o;a++)i.push(this.get(n[a],r));return i},t.prototype.getByRawIndex=function(e,r){if(!(r>=0&&r<this._rawCount))return NaN;var i=this._chunks[e];return i?i[r]:NaN},t.prototype.getSum=function(e){var r=this._chunks[e],i=0;if(r)for(var n=0,a=this.count();n<a;n++){var o=this.get(e,n);isNaN(o)||(i+=o)}return i},t.prototype.getMedian=function(e){var r=[];this.each([e],function(a){isNaN(a)||r.push(a)});var i=r.sort(function(a,o){return a-o}),n=this.count();return n===0?0:n%2===1?i[(n-1)/2]:(i[n/2]+i[n/2-1])/2},t.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var r=this._indices,i=r[e];if(i!=null&&i<this._count&&i===e)return e;for(var n=0,a=this._count-1;n<=a;){var o=(n+a)/2|0;if(r[o]<e)n=o+1;else if(r[o]>e)a=o-1;else return o}return-1},t.prototype.indicesOfNearest=function(e,r,i){var n=this._chunks,a=n[e],o=[];if(!a)return o;i==null&&(i=1/0);for(var s=1/0,l=-1,u=0,f=0,h=this.count();f<h;f++){var v=this.getRawIndex(f),c=r-a[v],d=Math.abs(c);d<=i&&((d<s||d===s&&c>=0&&l<0)&&(s=d,l=c,u=0),c===l&&(o[u++]=f))}return o.length=u,o},t.prototype.getIndices=function(){var e,r=this._indices;if(r){var i=r.constructor,n=this._count;if(i===Array){e=new i(n);for(var a=0;a<n;a++)e[a]=r[a]}else e=new i(r.buffer,0,n)}else{var i=Fo(this._rawCount);e=new i(this.count());for(var a=0;a<e.length;a++)e[a]=a}return e},t.prototype.filter=function(e,r){if(!this._count)return this;for(var i=this.clone(),n=i.count(),a=Fo(i._rawCount),o=new a(n),s=[],l=e.length,u=0,f=e[0],h=i._chunks,v=0;v<n;v++){var c=void 0,d=i.getRawIndex(v);if(l===0)c=r(v);else if(l===1){var p=h[f][d];c=r(p,v)}else{for(var g=0;g<l;g++)s[g]=h[e[g]][d];s[g]=v,c=r.apply(null,s)}c&&(o[u++]=d)}return u<n&&(i._indices=o),i._count=u,i._extent=[],i._updateGetRawIdx(),i},t.prototype.selectRange=function(e){var r=this.clone(),i=r._count;if(!i)return this;var n=yt(e),a=n.length;if(!a)return this;var o=r.count(),s=Fo(r._rawCount),l=new s(o),u=0,f=n[0],h=e[f][0],v=e[f][1],c=r._chunks,d=!1;if(!r._indices){var p=0;if(a===1){for(var g=c[n[0]],m=0;m<i;m++){var _=g[m];(_>=h&&_<=v||isNaN(_))&&(l[u++]=p),p++}d=!0}else if(a===2){for(var g=c[n[0]],y=c[n[1]],x=e[n[1]][0],S=e[n[1]][1],m=0;m<i;m++){var _=g[m],T=y[m];(_>=h&&_<=v||isNaN(_))&&(T>=x&&T<=S||isNaN(T))&&(l[u++]=p),p++}d=!0}}if(!d)if(a===1)for(var m=0;m<o;m++){var b=r.getRawIndex(m),_=c[n[0]][b];(_>=h&&_<=v||isNaN(_))&&(l[u++]=b)}else for(var m=0;m<o;m++){for(var w=!0,b=r.getRawIndex(m),A=0;A<a;A++){var C=n[A],_=c[C][b];(_<e[C][0]||_>e[C][1])&&(w=!1)}w&&(l[u++]=r.getRawIndex(m))}return u<o&&(r._indices=l),r._count=u,r._extent=[],r._updateGetRawIdx(),r},t.prototype.map=function(e,r){var i=this.clone(e);return this._updateDims(i,e,r),i},t.prototype.modify=function(e,r){this._updateDims(this,e,r)},t.prototype._updateDims=function(e,r,i){for(var n=e._chunks,a=[],o=r.length,s=e.count(),l=[],u=e._rawExtent,f=0;f<r.length;f++)u[r[f]]=Ma();for(var h=0;h<s;h++){for(var v=e.getRawIndex(h),c=0;c<o;c++)l[c]=n[r[c]][v];l[o]=h;var d=i&&i.apply(null,l);if(d!=null){typeof d!="object"&&(a[0]=d,d=a);for(var f=0;f<d.length;f++){var p=r[f],g=d[f],m=u[p],_=n[p];_&&(_[v]=g),g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}}},t.prototype.lttbDownSample=function(e,r){var i=this.clone([e],!0),n=i._chunks,a=n[e],o=this.count(),s=0,l=Math.floor(1/r),u=this.getRawIndex(0),f,h,v,c=new(Fo(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));c[s++]=u;for(var d=1;d<o-1;d+=l){for(var p=Math.min(d+l,o-1),g=Math.min(d+l*2,o),m=(g+p)/2,_=0,y=p;y<g;y++){var x=this.getRawIndex(y),S=a[x];isNaN(S)||(_+=S)}_/=g-p;var T=d,b=Math.min(d+l,o),w=d-1,A=a[u];f=-1,v=T;for(var C=-1,E=0,y=T;y<b;y++){var x=this.getRawIndex(y),S=a[x];if(isNaN(S)){E++,C<0&&(C=x);continue}h=Math.abs((w-m)*(S-A)-(w-y)*(_-A)),h>f&&(f=h,v=x)}E>0&&E<b-T&&(c[s++]=Math.min(C,v),v=Math.max(C,v)),c[s++]=v,u=v}return c[s++]=this.getRawIndex(o-1),i._count=s,i._indices=c,i.getRawIndex=this._getRawIdx,i},t.prototype.downSample=function(e,r,i,n){for(var a=this.clone([e],!0),o=a._chunks,s=[],l=Math.floor(1/r),u=o[e],f=this.count(),h=a._rawExtent[e]=Ma(),v=new(Fo(this._rawCount))(Math.ceil(f/l)),c=0,d=0;d<f;d+=l){l>f-d&&(l=f-d,s.length=l);for(var p=0;p<l;p++){var g=this.getRawIndex(d+p);s[p]=u[g]}var m=i(s),_=this.getRawIndex(Math.min(d+n(s,m)||0,f-1));u[_]=m,m<h[0]&&(h[0]=m),m>h[1]&&(h[1]=m),v[c++]=_}return a._count=c,a._indices=v,a._updateGetRawIdx(),a},t.prototype.each=function(e,r){if(this._count)for(var i=e.length,n=this._chunks,a=0,o=this.count();a<o;a++){var s=this.getRawIndex(a);switch(i){case 0:r(a);break;case 1:r(n[e[0]][s],a);break;case 2:r(n[e[0]][s],n[e[1]][s],a);break;default:for(var l=0,u=[];l<i;l++)u[l]=n[e[l]][s];u[l]=a,r.apply(null,u)}}},t.prototype.getDataExtent=function(e){var r=this._chunks[e],i=Ma();if(!r)return i;var n=this.count(),a=!this._indices,o;if(a)return this._rawExtent[e].slice();if(o=this._extent[e],o)return o.slice();o=i;for(var s=o[0],l=o[1],u=0;u<n;u++){var f=this.getRawIndex(u),h=r[f];h<s&&(s=h),h>l&&(l=h)}return o=[s,l],this._extent[e]=o,o},t.prototype.getRawDataItem=function(e){var r=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(r);for(var i=[],n=this._chunks,a=0;a<n.length;a++)i.push(n[a][r]);return i},t.prototype.clone=function(e,r){var i=new t,n=this._chunks,a=e&&ha(e,function(s,l){return s[l]=!0,s},{});if(a)for(var o=0;o<n.length;o++)i._chunks[o]=a[o]?iR(n[o]):n[o];else i._chunks=n;return this._copyCommonProps(i),r||(i._indices=this._cloneIndices()),i._updateGetRawIdx(),i},t.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=ft(this._extent),e._rawExtent=ft(this._rawExtent)},t.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,r=void 0;if(e===Array){var i=this._indices.length;r=new e(i);for(var n=0;n<i;n++)r[n]=this._indices[n]}else r=new e(this._indices);return r}return null},t.prototype._getRawIdxIdentity=function(e){return e},t.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function e(r,i,n,a){return Mu(r[a],this._dimensions[a])}Tc={arrayRows:e,objectRows:function(r,i,n,a){return Mu(r[i],this._dimensions[a])},keyedColumns:e,original:function(r,i,n,a){var o=r&&(r.value==null?r:r.value);return Mu(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(r,i,n,a){return r[a]}}}(),t}(),BS=function(){function t(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(e,r){this._sourceList=e,this._upstreamSignList=r,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,r=this._getUpstreamSourceManagers(),i=!!r.length,n,a;if(Fl(e)){var o=e,s=void 0,l=void 0,u=void 0;if(i){var f=r[0];f.prepareSource(),u=f.getSource(),s=u.data,l=u.sourceFormat,a=[f._getVersionSign()]}else s=o.get("data",!0),l=cr(s)?rn:Or,a=[];var h=this._getSourceMetaRawOption()||{},v=u&&u.metaRawOption||{},c=mt(h.seriesLayoutBy,v.seriesLayoutBy)||null,d=mt(h.sourceHeader,v.sourceHeader),p=mt(h.dimensions,v.dimensions),g=c!==v.seriesLayoutBy||!!d!=!!v.sourceHeader||p;n=g?[ud(s,{seriesLayoutBy:c,sourceHeader:d,dimensions:p},l)]:[]}else{var m=e;if(i){var _=this._applyTransform(r);n=_.sourceList,a=_.upstreamSignList}else{var y=m.get("source",!0);n=[ud(y,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(n,a)},t.prototype._applyTransform=function(e){var r=this._sourceHost,i=r.get("transform",!0),n=r.get("fromTransformResult",!0);if(n!=null){var a="";e.length!==1&&z_(a)}var o,s=[],l=[];return M(e,function(u){u.prepareSource();var f=u.getSource(n||0),h="";n!=null&&!f&&z_(h),s.push(f),l.push(u._getVersionSign())}),i?o=JL(i,s,{datasetIndex:r.componentIndex}):n!=null&&(o=[BL(s[0])]),{sourceList:o,upstreamSignList:l}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),r=0;r<e.length;r++){var i=e[r];if(i._isDirty()||this._upstreamSignList[r]!==i._getVersionSign())return!0}},t.prototype.getSource=function(e){e=e||0;var r=this._sourceList[e];if(!r){var i=this._getUpstreamSourceManagers();return i[0]&&i[0].getSource(e)}return r},t.prototype.getSharedDataStore=function(e){var r=e.makeStoreSchema();return this._innerGetDataStore(r.dimensions,e.source,r.hash)},t.prototype._innerGetDataStore=function(e,r,i){var n=0,a=this._storeList,o=a[n];o||(o=a[n]={});var s=o[i];if(!s){var l=this._getUpstreamSourceManagers()[0];Fl(this._sourceHost)&&l?s=l._innerGetDataStore(e,r,i):(s=new fd,s.initData(new DS(r,e.length),e)),o[i]=s}return s},t.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(Fl(e)){var r=xS(e);return r?[r.getSourceManager()]:[]}else return K(sL(e),function(i){return i.getSourceManager()})},t.prototype._getSourceMetaRawOption=function(){var e=this._sourceHost,r,i,n;if(Fl(e))r=e.get("seriesLayoutBy",!0),i=e.get("sourceHeader",!0),n=e.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var a=e;r=a.get("seriesLayoutBy",!0),i=a.get("sourceHeader",!0),n=a.get("dimensions",!0)}return{seriesLayoutBy:r,sourceHeader:i,dimensions:n}},t}();function k_(t){var e=t.option.transform;e&&Wu(t.option.transform)}function Fl(t){return t.mainType==="series"}function z_(t){throw new Error(t)}var FS="line-height:1";function kS(t,e){var r=t.color||"#6e7079",i=t.fontSize||12,n=t.fontWeight||"400",a=t.color||"#464646",o=t.fontSize||14,s=t.fontWeight||"900";return e==="html"?{nameStyle:"font-size:"+Me(i+"")+"px;color:"+Me(r)+";font-weight:"+Me(n+""),valueStyle:"font-size:"+Me(o+"")+"px;color:"+Me(a)+";font-weight:"+Me(s+"")}:{nameStyle:{fontSize:i,fill:r,fontWeight:n},valueStyle:{fontSize:o,fill:a,fontWeight:s}}}var nR=[0,10,20,30],aR=["",`
`,`

`,`


`];function Hs(t,e){return e.type=t,e}function hd(t){return t.type==="section"}function zS(t){return hd(t)?oR:sR}function US(t){if(hd(t)){var e=0,r=t.blocks.length,i=r>1||r>0&&!t.noHeader;return M(t.blocks,function(n){var a=US(n);a>=e&&(e=a+ +(i&&(!a||hd(n)&&!n.noHeader)))}),e}return 0}function oR(t,e,r,i){var n=e.noHeader,a=lR(US(e)),o=[],s=e.blocks||[];Rr(!s||X(s)),s=s||[];var l=t.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(_t(u,l)){var f=new XL(u[l],null);s.sort(function(d,p){return f.evaluate(d.sortParam,p.sortParam)})}else l==="seriesDesc"&&s.reverse()}M(s,function(d,p){var g=e.valueFormatter,m=zS(d)(g?U(U({},t),{valueFormatter:g}):t,d,p>0?a.html:0,i);m!=null&&o.push(m)});var h=t.renderMode==="richText"?o.join(a.richText):cd(o.join(""),n?r:a.html);if(n)return h;var v=ld(e.header,"ordinal",t.useUTC),c=kS(i,t.renderMode).nameStyle;return t.renderMode==="richText"?HS(t,v,c)+a.richText+h:cd('<div style="'+c+";"+FS+';">'+Me(v)+"</div>"+h,r)}function sR(t,e,r,i){var n=t.renderMode,a=e.noName,o=e.noValue,s=!e.markerType,l=e.name,u=t.useUTC,f=e.valueFormatter||t.valueFormatter||function(x){return x=X(x)?x:[x],K(x,function(S,T){return ld(S,X(c)?c[T]:c,u)})};if(!(a&&o)){var h=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",n),v=a?"":ld(l,"ordinal",u),c=e.valueType,d=o?[]:f(e.value),p=!s||!a,g=!s&&a,m=kS(i,n),_=m.nameStyle,y=m.valueStyle;return n==="richText"?(s?"":h)+(a?"":HS(t,v,_))+(o?"":hR(t,d,p,g,y)):cd((s?"":h)+(a?"":uR(v,!s,_))+(o?"":fR(d,p,g,y)),r)}}function U_(t,e,r,i,n,a){if(t){var o=zS(t),s={useUTC:n,renderMode:r,orderMode:i,markupStyleCreator:e,valueFormatter:t.valueFormatter};return o(s,t,0,a)}}function lR(t){return{html:nR[t],richText:aR[t]}}function cd(t,e){var r='<div style="clear:both"></div>',i="margin: "+e+"px 0 0";return'<div style="'+i+";"+FS+';">'+t+r+"</div>"}function uR(t,e,r){var i=e?"margin-left:2px":"";return'<span style="'+r+";"+i+'">'+Me(t)+"</span>"}function fR(t,e,r,i){var n=r?"10px":"20px",a=e?"float:right;margin-left:"+n:"";return t=X(t)?t:[t],'<span style="'+a+";"+i+'">'+K(t,function(o){return Me(o)}).join("&nbsp;&nbsp;")+"</span>"}function HS(t,e,r){return t.markupStyleCreator.wrapRichTextStyle(e,r)}function hR(t,e,r,i,n){var a=[n],o=i?10:20;return r&&a.push({padding:[0,0,0,o],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(X(e)?e.join("  "):e,a)}function cR(t,e){var r=t.getData().getItemVisual(e,"style"),i=r[t.visualDrawType];return ua(i)}function VS(t,e){var r=t.get("padding");return r??(e==="richText"?[8,10]:10)}var Sc=function(){function t(){this.richTextStyles={},this._nextStyleNameId=Kx()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(e,r,i){var n=i==="richText"?this._generateStyleName():null,a=cS({color:r,type:e,renderMode:i,markerId:n});return Z(a)?a:(this.richTextStyles[n]=a.style,a.content)},t.prototype.wrapRichTextStyle=function(e,r){var i={};X(r)?M(r,function(a){return U(i,a)}):U(i,r);var n=this._generateStyleName();return this.richTextStyles[n]=i,"{"+n+"|"+e+"}"},t}();function vR(t){var e=t.series,r=t.dataIndex,i=t.multipleSeries,n=e.getData(),a=n.mapDimensionsAll("defaultedTooltip"),o=a.length,s=e.getRawValue(r),l=X(s),u=cR(e,r),f,h,v,c;if(o>1||l&&!o){var d=dR(s,e,r,a,u);f=d.inlineValues,h=d.inlineValueTypes,v=d.blocks,c=d.inlineValues[0]}else if(o){var p=n.getDimensionInfo(a[0]);c=f=ho(n,r,a[0]),h=p.type}else c=f=l?s[0]:s;var g=_p(e),m=g&&e.name||"",_=n.getName(r),y=i?m:_;return Hs("section",{header:m,noHeader:i||!g,sortParam:c,blocks:[Hs("nameValue",{markerType:"item",markerColor:u,name:y,noName:!li(y),value:f,valueType:h})].concat(v||[])})}function dR(t,e,r,i,n){var a=e.getData(),o=ha(t,function(h,v,c){var d=a.getDimensionInfo(c);return h=h||d&&d.tooltip!==!1&&d.displayName!=null},!1),s=[],l=[],u=[];i.length?M(i,function(h){f(ho(a,r,h),h)}):M(t,f);function f(h,v){var c=a.getDimensionInfo(v);!c||c.otherDims.tooltip===!1||(o?u.push(Hs("nameValue",{markerType:"subItem",markerColor:n,name:c.displayName,value:h,valueType:c.type})):(s.push(h),l.push(c.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var ki=Kt();function kl(t,e){return t.getName(e)||t.getId(e)}var pR="__universalTransitionEnabled",hh=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._selectedDataIndicesMap={},r}return e.prototype.init=function(r,i,n){this.seriesIndex=this.componentIndex,this.dataTask=As({count:mR,reset:_R}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,n);var a=ki(this).sourceManager=new BS(this);a.prepareSource();var o=this.getInitialData(r,n);V_(o,this),this.dataTask.context.data=o,ki(this).dataBeforeProcessed=o,H_(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(r,i){var n=zs(this),a=n?ol(r):{},o=this.subType;Vt.hasClass(o)&&(o+="Series"),dt(r,i.getTheme().get(this.subType)),dt(r,this.getDefaultOption()),wm(r,"label",["show"]),this.fillDataTextStyle(r.data),n&&fa(r,a,n)},e.prototype.mergeOption=function(r,i){r=dt(this.option,r,!0),this.fillDataTextStyle(r.data);var n=zs(this);n&&fa(this.option,r,n);var a=ki(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(r,i);V_(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,ki(this).dataBeforeProcessed=o,H_(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(r){if(r&&!cr(r))for(var i=["show"],n=0;n<r.length;n++)r[n]&&r[n].label&&wm(r[n],"label",i)},e.prototype.getInitialData=function(r,i){},e.prototype.appendData=function(r){var i=this.getRawData();i.appendData(r.data)},e.prototype.getData=function(r){var i=vd(this);if(i){var n=i.context.data;return r==null?n:n.getLinkedData(r)}else return ki(this).data},e.prototype.getAllData=function(){var r=this.getData();return r&&r.getLinkedDataAll?r.getLinkedDataAll():[{data:r}]},e.prototype.setData=function(r){var i=vd(this);if(i){var n=i.context;n.outputData=r,i!==this.dataTask&&(n.data=r)}ki(this).data=r},e.prototype.getEncode=function(){var r=this.get("encode",!0);if(r)return ht(r)},e.prototype.getSourceManager=function(){return ki(this).sourceManager},e.prototype.getSource=function(){return this.getSourceManager().getSource()},e.prototype.getRawData=function(){return ki(this).dataBeforeProcessed},e.prototype.getColorBy=function(){var r=this.get("colorBy");return r||"series"},e.prototype.isColorBySeries=function(){return this.getColorBy()==="series"},e.prototype.getBaseAxis=function(){var r=this.coordinateSystem;return r&&r.getBaseAxis&&r.getBaseAxis()},e.prototype.formatTooltip=function(r,i,n){return vR({series:this,dataIndex:r,multipleSeries:i})},e.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(At.node&&!(r&&r.ssr))return!1;var i=this.getShallow("animation");return i&&this.getData().count()>this.getShallow("animationThreshold")&&(i=!1),!!i},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(r,i,n){var a=this.ecModel,o=Xp.prototype.getColorFromPalette.call(this,r,i,n);return o||(o=a.getColorFromPalette(r,i,n)),o},e.prototype.coordDimToDataDim=function(r){return this.getRawData().mapDimensionsAll(r)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(r,i){this._innerSelect(this.getData(i),r)},e.prototype.unselect=function(r,i){var n=this.option.selectedMap;if(n){var a=this.option.selectedMode,o=this.getData(i);if(a==="series"||n==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s<r.length;s++){var l=r[s],u=kl(o,l);n[u]=!1,this._selectedDataIndicesMap[u]=-1}}},e.prototype.toggleSelect=function(r,i){for(var n=[],a=0;a<r.length;a++)n[0]=r[a],this.isSelected(r[a],i)?this.unselect(n,i):this.select(n,i)},e.prototype.getSelectedDataIndices=function(){if(this.option.selectedMap==="all")return[].slice.call(this.getData().getIndices());for(var r=this._selectedDataIndicesMap,i=yt(r),n=[],a=0;a<i.length;a++){var o=r[i[a]];o>=0&&n.push(o)}return n},e.prototype.isSelected=function(r,i){var n=this.option.selectedMap;if(!n)return!1;var a=this.getData(i);return(n==="all"||n[kl(a,r)])&&!a.getItemModel(r).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[pR])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},e.prototype._innerSelect=function(r,i){var n,a,o=this.option,s=o.selectedMode,l=i.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){j(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,f=0;f<l;f++){var h=i[f],v=kl(r,h);u[v]=!0,this._selectedDataIndicesMap[v]=r.getRawIndex(h)}}else if(s==="single"||s===!0){var c=i[l-1],v=kl(r,c);o.selectedMap=(n={},n[v]=!0,n),this._selectedDataIndicesMap=(a={},a[v]=r.getRawIndex(c),a)}}},e.prototype._initSelectedMapFromData=function(r){if(!this.option.selectedMap){var i=[];r.hasItemOption&&r.each(function(n){var a=r.getRawDataItem(n);a&&a.selected&&i.push(n)}),i.length>0&&this._innerSelect(r,i)}},e.registerClass=function(r){return Vt.registerClass(r)},e.protoInitialize=function(){var r=e.prototype;r.type="series.__base__",r.seriesIndex=0,r.ignoreStyleOnData=!1,r.hasSymbolVisual=!1,r.defaultSymbol="circle",r.visualStyleAccessPath="itemStyle",r.visualDrawType="fill"}(),e}(Vt);qr(hh,GL);qr(hh,Xp);nT(hh,Vt);function H_(t){var e=t.name;_p(t)||(t.name=gR(t)||e)}function gR(t){var e=t.getRawData(),r=e.mapDimensionsAll("seriesName"),i=[];return M(r,function(n){var a=e.getDimensionInfo(n);a.displayName&&i.push(a.displayName)}),i.join(" ")}function mR(t){return t.model.getRawData().count()}function _R(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),yR}function yR(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function V_(t,e){M(TA(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(r){t.wrapMethod(r,de(xR,e))})}function xR(t,e){var r=vd(t);return r&&r.setOutputEnd((e||this).count()),e}function vd(t){var e=(t.ecModel||{}).scheduler,r=e&&e.getPipeline(t.uid);if(r){var i=r.currentTask;if(i){var n=i.agentStubMap;n&&(i=n.get(t.uid))}return i}}const co=hh;var Kp=function(){function t(){this.group=new ue,this.uid=rh("viewComponent")}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,i,n){},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,i,n){},t.prototype.updateLayout=function(e,r,i,n){},t.prototype.updateVisual=function(e,r,i,n){},t.prototype.toggleBlurSeries=function(e,r,i){},t.prototype.eachRendered=function(e){var r=this.group;r&&r.traverse(e)},t}();xp(Kp);Xf(Kp);const vr=Kp;function GS(){var t=Kt();return function(e){var r=t(e),i=e.pipelineContext,n=!!r.large,a=!!r.progressiveRender,o=r.large=!!(i&&i.large),s=r.progressiveRender=!!(i&&i.progressiveRender);return(n!==o||a!==s)&&"reset"}}var WS=Kt(),TR=GS(),jp=function(){function t(){this.group=new ue,this.uid=rh("viewChart"),this.renderTask=As({plan:SR,reset:wR}),this.renderTask.context={view:this}}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,i,n){},t.prototype.highlight=function(e,r,i,n){var a=e.getData(n&&n.dataType);a&&W_(a,n,"emphasis")},t.prototype.downplay=function(e,r,i,n){var a=e.getData(n&&n.dataType);a&&W_(a,n,"normal")},t.prototype.remove=function(e,r){this.group.removeAll()},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,i,n){this.render(e,r,i,n)},t.prototype.updateLayout=function(e,r,i,n){this.render(e,r,i,n)},t.prototype.updateVisual=function(e,r,i,n){this.render(e,r,i,n)},t.prototype.eachRendered=function(e){Bp(this.group,e)},t.markUpdateMethod=function(e,r){WS(e).updateMethod=r},t.protoInitialize=function(){var e=t.prototype;e.type="chart"}(),t}();function G_(t,e,r){t&&id(t)&&(e==="emphasis"?af:of)(t,r)}function W_(t,e,r){var i=sa(t,e),n=e&&e.highlightKey!=null?BM(e.highlightKey):null;i!=null?M(ge(i),function(a){G_(t.getItemGraphicEl(a),r,n)}):t.eachItemGraphicEl(function(a){G_(a,r,n)})}xp(jp);Xf(jp);function SR(t){return TR(t.model)}function wR(t){var e=t.model,r=t.ecModel,i=t.api,n=t.payload,a=e.pipelineContext.progressiveRender,o=t.view,s=n&&WS(n).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,r,i,n),bR[l]}var bR={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};const Ai=jp;var df="\0__throttleOriginMethod",X_="\0__throttleRate",Y_="\0__throttleType";function Qp(t,e,r){var i,n=0,a=0,o=null,s,l,u,f;e=e||0;function h(){a=new Date().getTime(),o=null,t.apply(l,u||[])}var v=function(){for(var c=[],d=0;d<arguments.length;d++)c[d]=arguments[d];i=new Date().getTime(),l=this,u=c;var p=f||e,g=f||r;f=null,s=i-(g?n:a)-p,clearTimeout(o),g?o=setTimeout(h,p):s>=0?h():o=setTimeout(h,-s),n=i};return v.clear=function(){o&&(clearTimeout(o),o=null)},v.debounceNextCall=function(c){f=c},v}function ch(t,e,r,i){var n=t[e];if(n){var a=n[df]||n,o=n[Y_],s=n[X_];if(s!==r||o!==i){if(r==null||!i)return t[e]=a;n=t[e]=Qp(a,r,i==="debounce"),n[df]=a,n[Y_]=i,n[X_]=r}return n}}function pf(t,e){var r=t[e];r&&r[df]&&(r.clear&&r.clear(),t[e]=r[df])}var $_=Kt(),Z_={itemStyle:Os(JT,!0),lineStyle:Os(QT,!0)},AR={lineStyle:"stroke",itemStyle:"fill"};function XS(t,e){var r=t.visualStyleMapper||Z_[e];return r||(console.warn("Unknown style type '"+e+"'."),Z_.itemStyle)}function YS(t,e){var r=t.visualDrawType||AR[e];return r||(console.warn("Unknown style type '"+e+"'."),"fill")}var ER={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData(),i=t.visualStyleAccessPath||"itemStyle",n=t.getModel(i),a=XS(t,i),o=a(n),s=n.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=YS(t,i),u=o[l],f=ct(u)?u:null,h=o.fill==="auto"||o.stroke==="auto";if(!o[l]||f||h){var v=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[l]||(o[l]=v,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||ct(o.fill)?v:o.fill,o.stroke=o.stroke==="auto"||ct(o.stroke)?v:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!e.isSeriesFiltered(t)&&f)return r.setVisual("colorFromPalette",!1),{dataEach:function(c,d){var p=t.getDataParams(d),g=U({},o);g[l]=f(p),c.setItemVisual(d,"style",g)}}}},ko=new Te,CR={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!(t.ignoreStyleOnData||e.isSeriesFiltered(t))){var r=t.getData(),i=t.visualStyleAccessPath||"itemStyle",n=XS(t,i),a=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[i]){ko.option=l[i];var u=n(ko),f=o.ensureUniqueItemVisual(s,"style");U(f,u),ko.option.decal&&(o.setItemVisual(s,"decal",ko.option.decal),ko.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},MR={performRawSeries:!0,overallReset:function(t){var e=ht();t.eachSeries(function(r){var i=r.getColorBy();if(!r.isColorBySeries()){var n=r.type+"-"+i,a=e.get(n);a||(a={},e.set(n,a)),$_(r).scope=a}}),t.eachSeries(function(r){if(!(r.isColorBySeries()||t.isSeriesFiltered(r))){var i=r.getRawData(),n={},a=r.getData(),o=$_(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=YS(r,s);a.each(function(u){var f=a.getRawIndex(u);n[f]=u}),i.each(function(u){var f=n[u],h=a.getItemVisual(f,"colorFromPalette");if(h){var v=a.ensureUniqueItemVisual(f,"style"),c=i.getName(u)||u+"",d=i.count();v[l]=r.getColorFromPalette(c,o,d)}})}})}},zl=Math.PI;function DR(t,e){e=e||{},Lt(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var r=new ue,i=new ie({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});r.add(i);var n=new Jt({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new ie({style:{fill:"none"},textContent:n,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});r.add(a);var o;return e.showSpinner&&(o=new Dp({shape:{startAngle:-zl/2,endAngle:-zl/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:zl*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:zl*3/2}).delay(300).start("circularInOut"),r.add(o)),r.resize=function(){var s=n.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(t.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),f=t.getHeight()/2;e.showSpinner&&o.setShape({cx:u,cy:f}),a.setShape({x:u-l,y:f-l,width:l*2,height:l*2}),i.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},r.resize(),r}var LR=function(){function t(e,r,i,n){this._stageTaskMap=ht(),this.ecInstance=e,this.api=r,i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice(),this._allHandlers=i.concat(n)}return t.prototype.restoreData=function(e,r){e.restoreData(r),this._stageTaskMap.each(function(i){var n=i.overallTask;n&&n.dirty()})},t.prototype.getPerformArgs=function(e,r){if(e.__pipeline){var i=this._pipelineMap.get(e.__pipeline.id),n=i.context,a=!r&&i.progressiveEnabled&&(!n||n.progressiveRender)&&e.__idxInPipeline>i.blockIndex,o=a?i.step:null,s=n&&n.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},t.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},t.prototype.updateStreamModes=function(e,r){var i=this._pipelineMap.get(e.uid),n=e.getData(),a=n.count(),o=i.progressiveEnabled&&r.incrementalPrepareRender&&a>=i.threshold,s=e.get("large")&&a>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?a:null;e.pipelineContext=i.context={progressiveRender:o,modDataCount:l,large:s}},t.prototype.restorePipelines=function(e){var r=this,i=r._pipelineMap=ht();e.eachSeries(function(n){var a=n.getProgressive(),o=n.uid;i.set(o,{id:o,head:null,tail:null,threshold:n.getProgressiveThreshold(),progressiveEnabled:a&&!(n.preventIncremental&&n.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),r._pipe(n,n.dataTask)})},t.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,r=this.api.getModel(),i=this.api;M(this._allHandlers,function(n){var a=e.get(n.uid)||e.set(n.uid,{}),o="";Rr(!(n.reset&&n.overallReset),o),n.reset&&this._createSeriesStageTask(n,a,r,i),n.overallReset&&this._createOverallStageTask(n,a,r,i)},this)},t.prototype.prepareView=function(e,r,i,n){var a=e.renderTask,o=a.context;o.model=r,o.ecModel=i,o.api=n,a.__block=!e.incrementalPrepareRender,this._pipe(r,a)},t.prototype.performDataProcessorTasks=function(e,r){this._performStageTasks(this._dataProcessorHandlers,e,r,{block:!0})},t.prototype.performVisualTasks=function(e,r,i){this._performStageTasks(this._visualHandlers,e,r,i)},t.prototype._performStageTasks=function(e,r,i,n){n=n||{};var a=!1,o=this;M(e,function(l,u){if(!(n.visualType&&n.visualType!==l.visualType)){var f=o._stageTaskMap.get(l.uid),h=f.seriesTaskMap,v=f.overallTask;if(v){var c,d=v.agentStubMap;d.each(function(g){s(n,g)&&(g.dirty(),c=!0)}),c&&v.dirty(),o.updatePayload(v,i);var p=o.getPerformArgs(v,n.block);d.each(function(g){g.perform(p)}),v.perform(p)&&(a=!0)}else h&&h.each(function(g,m){s(n,g)&&g.dirty();var _=o.getPerformArgs(g,n.block);_.skip=!l.performRawSeries&&r.isSeriesFiltered(g.context.model),o.updatePayload(g,i),g.perform(_)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},t.prototype.performSeriesTasks=function(e){var r;e.eachSeries(function(i){r=i.dataTask.perform()||r}),this.unfinished=r||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(e){var r=e.tail;do{if(r.__block){e.blockIndex=r.__idxInPipeline;break}r=r.getUpstream()}while(r)})},t.prototype.updatePayload=function(e,r){r!=="remain"&&(e.context.payload=r)},t.prototype._createSeriesStageTask=function(e,r,i,n){var a=this,o=r.seriesTaskMap,s=r.seriesTaskMap=ht(),l=e.seriesType,u=e.getTargetSeries;e.createOnAllSeries?i.eachRawSeries(f):l?i.eachRawSeriesByType(l,f):u&&u(i,n).each(f);function f(h){var v=h.uid,c=s.set(v,o&&o.get(v)||As({plan:OR,reset:BR,count:kR}));c.context={model:h,ecModel:i,api:n,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(h,c)}},t.prototype._createOverallStageTask=function(e,r,i,n){var a=this,o=r.overallTask=r.overallTask||As({reset:RR});o.context={ecModel:i,api:n,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=ht(),u=e.seriesType,f=e.getTargetSeries,h=!0,v=!1,c="";Rr(!e.createOnAllSeries,c),u?i.eachRawSeriesByType(u,d):f?f(i,n).each(d):(h=!1,M(i.getSeries(),d));function d(p){var g=p.uid,m=l.set(g,s&&s.get(g)||(v=!0,As({reset:PR,onDirty:NR})));m.context={model:p,overallProgress:h},m.agent=o,m.__block=h,a._pipe(p,m)}v&&o.dirty()},t.prototype._pipe=function(e,r){var i=e.uid,n=this._pipelineMap.get(i);!n.head&&(n.head=r),n.tail&&n.tail.pipe(r),n.tail=r,r.__idxInPipeline=n.count++,r.__pipeline=n},t.wrapStageHandler=function(e,r){return ct(e)&&(e={overallReset:e,seriesType:zR(e)}),e.uid=rh("stageHandler"),r&&(e.visualType=r),e},t}();function RR(t){t.overallReset(t.ecModel,t.api,t.payload)}function PR(t){return t.overallProgress&&IR}function IR(){this.agent.dirty(),this.getDownstream().dirty()}function NR(){this.agent&&this.agent.dirty()}function OR(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function BR(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=ge(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?K(e,function(r,i){return $S(i)}):FR}var FR=$S(0);function $S(t){return function(e,r){var i=r.data,n=r.resetDefines[t];if(n&&n.dataEach)for(var a=e.start;a<e.end;a++)n.dataEach(i,a);else n&&n.progress&&n.progress(e,i)}}function kR(t){return t.data.count()}function zR(t){gf=null;try{t(Vs,ZS)}catch{}return gf}var Vs={},ZS={},gf;qS(Vs,wS);qS(ZS,bS);Vs.eachSeriesByType=Vs.eachRawSeriesByType=function(t){gf=t};Vs.eachComponent=function(t){t.mainType==="series"&&t.subType&&(gf=t.subType)};function qS(t,e){for(var r in e.prototype)t[r]=De}const KS=LR;var q_=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"];const UR={color:q_,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],q_]};var ze="#B9B8CE",K_="#100C2A",Ul=function(){return{axisLine:{lineStyle:{color:ze}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},j_=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],jS={darkMode:!0,color:j_,backgroundColor:K_,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:ze}},textStyle:{color:ze},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:ze}},dataZoom:{borderColor:"#71708A",textStyle:{color:ze},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:ze}},timeline:{lineStyle:{color:ze},label:{color:ze},controlStyle:{color:ze,borderColor:ze}},calendar:{itemStyle:{color:K_},dayLabel:{color:ze},monthLabel:{color:ze},yearLabel:{color:ze}},timeAxis:Ul(),logAxis:Ul(),valueAxis:Ul(),categoryAxis:Ul(),line:{symbol:"circle"},graph:{color:j_},gauge:{title:{color:ze},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:ze},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};jS.categoryAxis.splitLine.show=!1;const HR=jS;var VR=function(){function t(){}return t.prototype.normalizeQuery=function(e){var r={},i={},n={};if(Z(e)){var a=ui(e);r.mainType=a.main||null,r.subType=a.sub||null}else{var o=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};M(e,function(l,u){for(var f=!1,h=0;h<o.length;h++){var v=o[h],c=u.lastIndexOf(v);if(c>0&&c===u.length-v.length){var d=u.slice(0,c);d!=="data"&&(r.mainType=d,r[v.toLowerCase()]=l,f=!0)}}s.hasOwnProperty(u)&&(i[u]=l,f=!0),f||(n[u]=l)})}return{cptQuery:r,dataQuery:i,otherQuery:n}},t.prototype.filter=function(e,r){var i=this.eventInfo;if(!i)return!0;var n=i.targetEl,a=i.packedEvent,o=i.model,s=i.view;if(!o||!s)return!0;var l=r.cptQuery,u=r.dataQuery;return f(l,o,"mainType")&&f(l,o,"subType")&&f(l,o,"index","componentIndex")&&f(l,o,"name")&&f(l,o,"id")&&f(u,a,"name")&&f(u,a,"dataIndex")&&f(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,r.otherQuery,n,a));function f(h,v,c,d){return h[c]==null||v[d||c]===h[c]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),dd=["symbol","symbolSize","symbolRotate","symbolOffset"],Q_=dd.concat(["symbolKeepAspect"]),GR={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData();if(t.legendIcon&&r.setVisual("legendIcon",t.legendIcon),!t.hasSymbolVisual)return;for(var i={},n={},a=!1,o=0;o<dd.length;o++){var s=dd[o],l=t.get(s);ct(l)?(a=!0,n[s]=l):i[s]=l}if(i.symbol=i.symbol||t.defaultSymbol,r.setVisual(U({legendIcon:t.legendIcon||i.symbol,symbolKeepAspect:t.get("symbolKeepAspect")},i)),e.isSeriesFiltered(t))return;var u=yt(n);function f(h,v){for(var c=t.getRawValue(v),d=t.getDataParams(v),p=0;p<u.length;p++){var g=u[p];h.setItemVisual(v,g,n[g](c,d))}}return{dataEach:a?f:null}}},WR={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.hasSymbolVisual||e.isSeriesFiltered(t))return;var r=t.getData();function i(n,a){for(var o=n.getItemModel(a),s=0;s<Q_.length;s++){var l=Q_[s],u=o.getShallow(l,!0);u!=null&&n.setItemVisual(a,l,u)}}return{dataEach:r.hasItemOption?i:null}}};function QS(t,e,r){switch(r){case"color":var i=t.getItemVisual(e,"style");return i[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,r)}}function JS(t,e){switch(e){case"color":var r=t.getVisual("style");return r[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}function XR(t,e,r,i){switch(r){case"color":var n=t.ensureUniqueItemVisual(e,"style");n[t.getVisual("drawType")]=i,t.setItemVisual(e,"colorFromPalette",!1);break;case"opacity":t.ensureUniqueItemVisual(e,"style").opacity=i;break;case"symbol":case"symbolSize":case"liftZ":t.setItemVisual(e,r,i);break}}function Da(t,e,r,i,n){var a=t+e;r.isSilent(a)||i.eachComponent({mainType:"series",subType:"pie"},function(o){for(var s=o.seriesIndex,l=o.option.selectedMap,u=n.selected,f=0;f<u.length;f++)if(u[f].seriesIndex===s){var h=o.getData(),v=sa(h,n.fromActionPayload);r.trigger(a,{type:a,seriesId:o.id,name:X(v)?h.getName(v[0]):h.getName(v),selected:Z(l)?l:U({},l)})}})}function YR(t,e,r){t.on("selectchanged",function(i){var n=r.getModel();i.isFromClick?(Da("map","selectchanged",e,n,i),Da("pie","selectchanged",e,n,i)):i.fromAction==="select"?(Da("map","selected",e,n,i),Da("pie","selected",e,n,i)):i.fromAction==="unselect"&&(Da("map","unselected",e,n,i),Da("pie","unselected",e,n,i))})}function ja(t,e,r){for(var i;t&&!(e(t)&&(i=t,r));)t=t.__hostTarget||t.parent;return i}var $R=Math.round(Math.random()*9),ZR=typeof Object.defineProperty=="function",qR=function(){function t(){this._id="__ec_inner_"+$R++}return t.prototype.get=function(e){return this._guard(e)[this._id]},t.prototype.set=function(e,r){var i=this._guard(e);return ZR?Object.defineProperty(i,this._id,{value:r,enumerable:!1,configurable:!0}):i[this._id]=r,this},t.prototype.delete=function(e){return this.has(e)?(delete this._guard(e)[this._id],!0):!1},t.prototype.has=function(e){return!!this._guard(e)[this._id]},t.prototype._guard=function(e){if(e!==Object(e))throw TypeError("Value of WeakMap is not a non-null object.");return e},t}();const KR=qR;var jR=Ht.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var r=e.cx,i=e.cy,n=e.width/2,a=e.height/2;t.moveTo(r,i-a),t.lineTo(r+n,i+a),t.lineTo(r-n,i+a),t.closePath()}}),QR=Ht.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var r=e.cx,i=e.cy,n=e.width/2,a=e.height/2;t.moveTo(r,i-a),t.lineTo(r+n,i),t.lineTo(r,i+a),t.lineTo(r-n,i),t.closePath()}}),JR=Ht.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var r=e.x,i=e.y,n=e.width/5*3,a=Math.max(n,e.height),o=n/2,s=o*o/(a-o),l=i-a+o+s,u=Math.asin(s/o),f=Math.cos(u)*o,h=Math.sin(u),v=Math.cos(u),c=o*.6,d=o*.7;t.moveTo(r-f,l+s),t.arc(r,l,o,Math.PI-u,Math.PI*2+u),t.bezierCurveTo(r+f-h*c,l+s+v*c,r,i-d,r,i),t.bezierCurveTo(r,i-d,r-f+h*c,l+s+v*c,r-f,l+s),t.closePath()}}),tP=Ht.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var r=e.height,i=e.width,n=e.x,a=e.y,o=i/3*2;t.moveTo(n,a),t.lineTo(n+o,a+r),t.lineTo(n,a+r/4*3),t.lineTo(n-o,a+r),t.lineTo(n,a),t.closePath()}}),eP={line:la,rect:ie,roundRect:ie,square:ie,circle:Cp,diamond:QR,pin:JR,arrow:tP,triangle:jR},rP={line:function(t,e,r,i,n){n.x1=t,n.y1=e+i/2,n.x2=t+r,n.y2=e+i/2},rect:function(t,e,r,i,n){n.x=t,n.y=e,n.width=r,n.height=i},roundRect:function(t,e,r,i,n){n.x=t,n.y=e,n.width=r,n.height=i,n.r=Math.min(r,i)/4},square:function(t,e,r,i,n){var a=Math.min(r,i);n.x=t,n.y=e,n.width=a,n.height=a},circle:function(t,e,r,i,n){n.cx=t+r/2,n.cy=e+i/2,n.r=Math.min(r,i)/2},diamond:function(t,e,r,i,n){n.cx=t+r/2,n.cy=e+i/2,n.width=r,n.height=i},pin:function(t,e,r,i,n){n.x=t+r/2,n.y=e+i/2,n.width=r,n.height=i},arrow:function(t,e,r,i,n){n.x=t+r/2,n.y=e+i/2,n.width=r,n.height=i},triangle:function(t,e,r,i,n){n.cx=t+r/2,n.cy=e+i/2,n.width=r,n.height=i}},mf={};M(eP,function(t,e){mf[e]=new t});var iP=Ht.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(t,e,r){var i=Hx(t,e,r),n=this.shape;return n&&n.symbolType==="pin"&&e.position==="inside"&&(i.y=r.y+r.height*.4),i},buildPath:function(t,e,r){var i=e.symbolType;if(i!=="none"){var n=mf[i];n||(i="rect",n=mf[i]),rP[i](e.x,e.y,e.width,e.height,n.shape),n.buildPath(t,n.shape,r)}}});function nP(t,e){if(this.type!=="image"){var r=this.style;this.__isEmptyBrush?(r.stroke=t,r.fill=e||"#fff",r.lineWidth=2):this.shape.symbolType==="line"?r.stroke=t:r.fill=t,this.markRedraw()}}function $r(t,e,r,i,n,a,o){var s=t.indexOf("empty")===0;s&&(t=t.substr(5,1).toLowerCase()+t.substr(6));var l;return t.indexOf("image://")===0?l=YT(t.slice(8),new Nt(e,r,i,n),o?"center":"cover"):t.indexOf("path://")===0?l=Ip(t.slice(7),{},new Nt(e,r,i,n),o?"center":"cover"):l=new iP({shape:{symbolType:t,x:e,y:r,width:i,height:n}}),l.__isEmptyBrush=s,l.setColor=nP,a&&l.setColor(a),l}function aP(t){return X(t)||(t=[+t,+t]),[t[0]||0,t[1]||0]}function tw(t,e){if(t!=null)return X(t)||(t=[t,t]),[ve(t[0],e[0])||0,ve(mt(t[1],t[0]),e[1])||0]}function Zn(t){return isFinite(t)}function oP(t,e,r){var i=e.x==null?0:e.x,n=e.x2==null?1:e.x2,a=e.y==null?0:e.y,o=e.y2==null?0:e.y2;e.global||(i=i*r.width+r.x,n=n*r.width+r.x,a=a*r.height+r.y,o=o*r.height+r.y),i=Zn(i)?i:0,n=Zn(n)?n:1,a=Zn(a)?a:0,o=Zn(o)?o:0;var s=t.createLinearGradient(i,a,n,o);return s}function sP(t,e,r){var i=r.width,n=r.height,a=Math.min(i,n),o=e.x==null?.5:e.x,s=e.y==null?.5:e.y,l=e.r==null?.5:e.r;e.global||(o=o*i+r.x,s=s*n+r.y,l=l*a),o=Zn(o)?o:.5,s=Zn(s)?s:.5,l=l>=0&&Zn(l)?l:.5;var u=t.createRadialGradient(o,s,0,o,s,l);return u}function pd(t,e,r){for(var i=e.type==="radial"?sP(t,e,r):oP(t,e,r),n=e.colorStops,a=0;a<n.length;a++)i.addColorStop(n[a].offset,n[a].color);return i}function lP(t,e){if(t===e||!t&&!e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!0;return!1}function Hl(t){return parseInt(t,10)}function Qa(t,e,r){var i=["width","height"][e],n=["clientWidth","clientHeight"][e],a=["paddingLeft","paddingTop"][e],o=["paddingRight","paddingBottom"][e];if(r[i]!=null&&r[i]!=="auto")return parseFloat(r[i]);var s=document.defaultView.getComputedStyle(t);return(t[n]||Hl(s[i])||Hl(t.style[i]))-(Hl(s[a])||0)-(Hl(s[o])||0)|0}function uP(t,e){return!t||t==="solid"||!(e>0)?null:t==="dashed"?[4*e,2*e]:t==="dotted"?[e]:Qt(t)?[t]:X(t)?t:null}function Jp(t){var e=t.style,r=e.lineDash&&e.lineWidth>0&&uP(e.lineDash,e.lineWidth),i=e.lineDashOffset;if(r){var n=e.strokeNoScale&&t.getLineScale?t.getLineScale():1;n&&n!==1&&(r=K(r,function(a){return a/n}),i/=n)}return[r,i]}var fP=new Mi(!0);function _f(t){var e=t.stroke;return!(e==null||e==="none"||!(t.lineWidth>0))}function J_(t){return typeof t=="string"&&t!=="none"}function yf(t){var e=t.fill;return e!=null&&e!=="none"}function t0(t,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=r}else t.fill()}function e0(t,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=r}else t.stroke()}function gd(t,e,r){var i=Tp(e.image,e.__image,r);if(Yf(i)){var n=t.createPattern(i,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&n&&n.setTransform){var a=new DOMMatrix;a.translateSelf(e.x||0,e.y||0),a.rotateSelf(0,0,(e.rotation||0)*mu),a.scaleSelf(e.scaleX||1,e.scaleY||1),n.setTransform(a)}return n}}function hP(t,e,r,i){var n,a=_f(r),o=yf(r),s=r.strokePercent,l=s<1,u=!e.path;(!e.silent||l)&&u&&e.createPathProxy();var f=e.path||fP,h=e.__dirty;if(!i){var v=r.fill,c=r.stroke,d=o&&!!v.colorStops,p=a&&!!c.colorStops,g=o&&!!v.image,m=a&&!!c.image,_=void 0,y=void 0,x=void 0,S=void 0,T=void 0;(d||p)&&(T=e.getBoundingRect()),d&&(_=h?pd(t,v,T):e.__canvasFillGradient,e.__canvasFillGradient=_),p&&(y=h?pd(t,c,T):e.__canvasStrokeGradient,e.__canvasStrokeGradient=y),g&&(x=h||!e.__canvasFillPattern?gd(t,v,e):e.__canvasFillPattern,e.__canvasFillPattern=x),m&&(S=h||!e.__canvasStrokePattern?gd(t,c,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),d?t.fillStyle=_:g&&(x?t.fillStyle=x:o=!1),p?t.strokeStyle=y:m&&(S?t.strokeStyle=S:a=!1)}var b=e.getGlobalScale();f.setScale(b[0],b[1],e.segmentIgnoreThreshold);var w,A;t.setLineDash&&r.lineDash&&(n=Jp(e),w=n[0],A=n[1]);var C=!0;(u||h&Ga)&&(f.setDPR(t.dpr),l?f.setContext(null):(f.setContext(t),C=!1),f.reset(),e.buildPath(f,e.shape,i),f.toStatic(),e.pathUpdated()),C&&f.rebuildPath(t,l?s:1),w&&(t.setLineDash(w),t.lineDashOffset=A),i||(r.strokeFirst?(a&&e0(t,r),o&&t0(t,r)):(o&&t0(t,r),a&&e0(t,r))),w&&t.setLineDash([])}function cP(t,e,r){var i=e.__image=Tp(r.image,e.__image,e,e.onload);if(!(!i||!Yf(i))){var n=r.x||0,a=r.y||0,o=e.getWidth(),s=e.getHeight(),l=i.width/i.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=i.width,s=i.height),r.sWidth&&r.sHeight){var u=r.sx||0,f=r.sy||0;t.drawImage(i,u,f,r.sWidth,r.sHeight,n,a,o,s)}else if(r.sx&&r.sy){var u=r.sx,f=r.sy,h=o-u,v=s-f;t.drawImage(i,u,f,h,v,n,a,o,s)}else t.drawImage(i,n,a,o,s)}}function vP(t,e,r){var i,n=r.text;if(n!=null&&(n+=""),n){t.font=r.font||nn,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline;var a=void 0,o=void 0;t.setLineDash&&r.lineDash&&(i=Jp(e),a=i[0],o=i[1]),a&&(t.setLineDash(a),t.lineDashOffset=o),r.strokeFirst?(_f(r)&&t.strokeText(n,r.x,r.y),yf(r)&&t.fillText(n,r.x,r.y)):(yf(r)&&t.fillText(n,r.x,r.y),_f(r)&&t.strokeText(n,r.x,r.y)),a&&t.setLineDash([])}}var r0=["shadowBlur","shadowOffsetX","shadowOffsetY"],i0=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function ew(t,e,r,i,n){var a=!1;if(!i&&(r=r||{},e===r))return!1;if(i||e.opacity!==r.opacity){Qe(t,n),a=!0;var o=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(o)?ta.opacity:o}(i||e.blend!==r.blend)&&(a||(Qe(t,n),a=!0),t.globalCompositeOperation=e.blend||ta.blend);for(var s=0;s<r0.length;s++){var l=r0[s];(i||e[l]!==r[l])&&(a||(Qe(t,n),a=!0),t[l]=t.dpr*(e[l]||0))}return(i||e.shadowColor!==r.shadowColor)&&(a||(Qe(t,n),a=!0),t.shadowColor=e.shadowColor||ta.shadowColor),a}function n0(t,e,r,i,n){var a=Gs(e,n.inHover),o=i?null:r&&Gs(r,n.inHover)||{};if(a===o)return!1;var s=ew(t,a,o,i,n);if((i||a.fill!==o.fill)&&(s||(Qe(t,n),s=!0),J_(a.fill)&&(t.fillStyle=a.fill)),(i||a.stroke!==o.stroke)&&(s||(Qe(t,n),s=!0),J_(a.stroke)&&(t.strokeStyle=a.stroke)),(i||a.opacity!==o.opacity)&&(s||(Qe(t,n),s=!0),t.globalAlpha=a.opacity==null?1:a.opacity),e.hasStroke()){var l=a.lineWidth,u=l/(a.strokeNoScale&&e.getLineScale?e.getLineScale():1);t.lineWidth!==u&&(s||(Qe(t,n),s=!0),t.lineWidth=u)}for(var f=0;f<i0.length;f++){var h=i0[f],v=h[0];(i||a[v]!==o[v])&&(s||(Qe(t,n),s=!0),t[v]=a[v]||h[1])}return s}function dP(t,e,r,i,n){return ew(t,Gs(e,n.inHover),r&&Gs(r,n.inHover),i,n)}function rw(t,e){var r=e.transform,i=t.dpr||1;r?t.setTransform(i*r[0],i*r[1],i*r[2],i*r[3],i*r[4],i*r[5]):t.setTransform(i,0,0,i,0,0)}function pP(t,e,r){for(var i=!1,n=0;n<t.length;n++){var a=t[n];i=i||a.isZeroArea(),rw(e,a),e.beginPath(),a.buildPath(e,a.shape),e.clip()}r.allClipped=i}function gP(t,e){return t&&e?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&&!e)}var a0=1,o0=2,s0=3,l0=4;function mP(t){var e=yf(t),r=_f(t);return!(t.lineDash||!(+e^+r)||e&&typeof t.fill!="string"||r&&typeof t.stroke!="string"||t.strokePercent<1||t.strokeOpacity<1||t.fillOpacity<1)}function Qe(t,e){e.batchFill&&t.fill(),e.batchStroke&&t.stroke(),e.batchFill="",e.batchStroke=""}function Gs(t,e){return e&&t.__hoverStyle||t.style}function tg(t,e){qn(t,e,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function qn(t,e,r,i){var n=e.transform;if(!e.shouldBePainted(r.viewWidth,r.viewHeight,!1,!1)){e.__dirty&=~fr,e.__isRendered=!1;return}var a=e.__clipPaths,o=r.prevElClipPaths,s=!1,l=!1;if((!o||lP(a,o))&&(o&&o.length&&(Qe(t,r),t.restore(),l=s=!0,r.prevElClipPaths=null,r.allClipped=!1,r.prevEl=null),a&&a.length&&(Qe(t,r),t.save(),pP(a,t,r),s=!0),r.prevElClipPaths=a),r.allClipped){e.__isRendered=!1;return}e.beforeBrush&&e.beforeBrush(),e.innerBeforeBrush();var u=r.prevEl;u||(l=s=!0);var f=e instanceof Ht&&e.autoBatch&&mP(e.style);s||gP(n,u.transform)?(Qe(t,r),rw(t,e)):f||Qe(t,r);var h=Gs(e,r.inHover);e instanceof Ht?(r.lastDrawType!==a0&&(l=!0,r.lastDrawType=a0),n0(t,e,u,l,r),(!f||!r.batchFill&&!r.batchStroke)&&t.beginPath(),hP(t,e,h,f),f&&(r.batchFill=h.fill||"",r.batchStroke=h.stroke||"")):e instanceof rf?(r.lastDrawType!==s0&&(l=!0,r.lastDrawType=s0),n0(t,e,u,l,r),vP(t,e,h)):e instanceof Nr?(r.lastDrawType!==o0&&(l=!0,r.lastDrawType=o0),dP(t,e,u,l,r),cP(t,e,h)):e.getTemporalDisplayables&&(r.lastDrawType!==l0&&(l=!0,r.lastDrawType=l0),_P(t,e,r)),f&&i&&Qe(t,r),e.innerAfterBrush(),e.afterBrush&&e.afterBrush(),r.prevEl=e,e.__dirty=0,e.__isRendered=!0}function _P(t,e,r){var i=e.getDisplayables(),n=e.getTemporalDisplayables();t.save();var a={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:r.viewWidth,viewHeight:r.viewHeight,inHover:r.inHover},o,s;for(o=e.getCursor(),s=i.length;o<s;o++){var l=i[o];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),qn(t,l,a,o===s-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),a.prevEl=l}for(var u=0,f=n.length;u<f;u++){var l=n[u];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),qn(t,l,a,u===f-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),a.prevEl=l}e.clearTemporalDisplayables(),e.notClear=!0,t.restore()}var wc=new KR,u0=new So(100),f0=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function md(t,e){if(t==="none")return null;var r=e.getDevicePixelRatio(),i=e.getZr(),n=i.painter.type==="svg";t.dirty&&wc.delete(t);var a=wc.get(t);if(a)return a;var o=Lt(t,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});o.backgroundColor==="none"&&(o.backgroundColor=null);var s={repeat:"repeat"};return l(s),s.rotation=o.rotation,s.scaleX=s.scaleY=n?1:1/r,wc.set(t,s),t.dirty=!1,s;function l(u){for(var f=[r],h=!0,v=0;v<f0.length;++v){var c=o[f0[v]];if(c!=null&&!X(c)&&!Z(c)&&!Qt(c)&&typeof c!="boolean"){h=!1;break}f.push(c)}var d;if(h){d=f.join(",")+(n?"-svg":"");var p=u0.get(d);p&&(n?u.svgElement=p:u.image=p)}var g=nw(o.dashArrayX),m=yP(o.dashArrayY),_=iw(o.symbol),y=xP(g),x=aw(m),S=!n&&xo.createCanvas(),T=n&&{tag:"g",attrs:{},key:"dcl",children:[]},b=A(),w;S&&(S.width=b.width*r,S.height=b.height*r,w=S.getContext("2d")),C(),h&&u0.put(d,S||T),u.image=S,u.svgElement=T,u.svgWidth=b.width,u.svgHeight=b.height;function A(){for(var E=1,D=0,L=y.length;D<L;++D)E=Tm(E,y[D]);for(var R=1,D=0,L=_.length;D<L;++D)R=Tm(R,_[D].length);E*=R;var N=x*y.length*_.length;return{width:Math.max(1,Math.min(E,o.maxTileWidth)),height:Math.max(1,Math.min(N,o.maxTileHeight))}}function C(){w&&(w.clearRect(0,0,S.width,S.height),o.backgroundColor&&(w.fillStyle=o.backgroundColor,w.fillRect(0,0,S.width,S.height)));for(var E=0,D=0;D<m.length;++D)E+=m[D];if(E<=0)return;for(var L=-x,R=0,N=0,I=0;L<b.height;){if(R%2===0){for(var F=N/2%_.length,O=0,z=0,k=0;O<b.width*2;){for(var it=0,D=0;D<g[I].length;++D)it+=g[I][D];if(it<=0)break;if(z%2===0){var $=(1-o.symbolSize)*.5,nt=O+g[I][z]*$,rt=L+m[R]*$,It=g[I][z]*o.symbolSize,gt=m[R]*o.symbolSize,Ft=k/2%_[F].length;Xt(nt,rt,It,gt,_[F][Ft])}O+=g[I][z],++k,++z,z===g[I].length&&(z=0)}++I,I===g.length&&(I=0)}L+=m[R],++N,++R,R===m.length&&(R=0)}function Xt(Ot,Mt,q,bt,oe){var $t=n?1:r,Be=$r(oe,Ot*$t,Mt*$t,q*$t,bt*$t,o.color,o.symbolKeepAspect);if(n){var Br=i.painter.renderOneToVNode(Be);Br&&T.children.push(Br)}else tg(w,Be)}}}}function iw(t){if(!t||t.length===0)return[["rect"]];if(Z(t))return[[t]];for(var e=!0,r=0;r<t.length;++r)if(!Z(t[r])){e=!1;break}if(e)return iw([t]);for(var i=[],r=0;r<t.length;++r)Z(t[r])?i.push([t[r]]):i.push(t[r]);return i}function nw(t){if(!t||t.length===0)return[[0,0]];if(Qt(t)){var e=Math.ceil(t);return[[e,e]]}for(var r=!0,i=0;i<t.length;++i)if(!Qt(t[i])){r=!1;break}if(r)return nw([t]);for(var n=[],i=0;i<t.length;++i)if(Qt(t[i])){var e=Math.ceil(t[i]);n.push([e,e])}else{var e=K(t[i],function(s){return Math.ceil(s)});e.length%2===1?n.push(e.concat(e)):n.push(e)}return n}function yP(t){if(!t||typeof t=="object"&&t.length===0)return[0,0];if(Qt(t)){var e=Math.ceil(t);return[e,e]}var r=K(t,function(i){return Math.ceil(i)});return t.length%2?r.concat(r):r}function xP(t){return K(t,function(e){return aw(e)})}function aw(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return t.length%2===1?e*2:e}function TP(t,e){t.eachRawSeries(function(r){if(!t.isSeriesFiltered(r)){var i=r.getData();i.hasItemVisual()&&i.each(function(o){var s=i.getItemVisual(o,"decal");if(s){var l=i.ensureUniqueItemVisual(o,"style");l.decal=md(s,e)}});var n=i.getVisual("decal");if(n){var a=i.getVisual("style");a.decal=md(n,e)}}})}var SP=new Kr;const Gr=SP;var ow={};function wP(t,e){ow[t]=e}function bP(t){return ow[t]}var AP=1,EP=800,CP=900,MP=1e3,DP=2e3,LP=5e3,sw=1e3,RP=1100,eg=2e3,lw=3e3,PP=4e3,vh=4500,IP=4600,NP=5e3,OP=6e3,uw=7e3,BP={PROCESSOR:{FILTER:MP,SERIES_FILTER:EP,STATISTIC:LP},VISUAL:{LAYOUT:sw,PROGRESSIVE_LAYOUT:RP,GLOBAL:eg,CHART:lw,POST_CHART_LAYOUT:IP,COMPONENT:PP,BRUSH:NP,CHART_ITEM:vh,ARIA:OP,DECAL:uw}},Re="__flagInMainProcess",Ke="__pendingUpdate",bc="__needsUpdateStatus",h0=/^[a-zA-Z0-9_]+$/,Ac="__connectUpdateStatus",c0=0,FP=1,kP=2;function fw(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(this.isDisposed()){this.id;return}return cw(this,t,e)}}function hw(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return cw(this,t,e)}}function cw(t,e,r){return r[0]=r[0]&&r[0].toLowerCase(),Kr.prototype[e].apply(t,r)}var vw=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Kr),dw=vw.prototype;dw.on=hw("on");dw.off=hw("off");var La,Ec,Vl,zi,Cc,Mc,Dc,zo,Uo,v0,d0,Lc,p0,Gl,g0,pw,gr,m0,gw=function(t){G(e,t);function e(r,i,n){var a=t.call(this,new VR)||this;a._chartsViews=[],a._chartsMap={},a._componentsViews=[],a._componentsMap={},a._pendingActions=[],n=n||{},Z(i)&&(i=mw[i]),a._dom=r;var o="canvas",s="auto",l=!1,u=a._zr=Kv(r,{renderer:n.renderer||o,devicePixelRatio:n.devicePixelRatio,width:n.width,height:n.height,ssr:n.ssr,useDirtyRect:mt(n.useDirtyRect,l),useCoarsePointer:mt(n.useCoarsePointer,s),pointerSize:n.pointerSize});a._ssr=n.ssr,a._throttledZrFlush=Qp(et(u.flush,u),17),i=ft(i),i&&ES(i,!0),a._theme=i,a._locale=ZD(n.locale||tS),a._coordSysMgr=new lh;var f=a._api=g0(a);function h(v,c){return v.__prio-c.__prio}return _u(Tf,h),_u(_d,h),a._scheduler=new KS(a,f,_d,Tf),a._messageCenter=new vw,a._initEvents(),a.resize=et(a.resize,a),u.animation.on("frame",a._onframe,a),v0(u,a),d0(u,a),Wu(a),a}return e.prototype._onframe=function(){if(!this._disposed){m0(this);var r=this._scheduler;if(this[Ke]){var i=this[Ke].silent;this[Re]=!0;try{La(this),zi.update.call(this,null,this[Ke].updateParams)}catch(l){throw this[Re]=!1,this[Ke]=null,l}this._zr.flush(),this[Re]=!1,this[Ke]=null,zo.call(this,i),Uo.call(this,i)}else if(r.unfinished){var n=AP,a=this._model,o=this._api;r.unfinished=!1;do{var s=+new Date;r.performSeriesTasks(a),r.performDataProcessorTasks(a),Mc(this,a),r.performVisualTasks(a),Gl(this,this._model,o,"remain",{}),n-=+new Date-s}while(n>0&&r.unfinished);r.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(r,i,n){if(!this[Re]){if(this._disposed){this.id;return}var a,o,s;if(j(i)&&(n=i.lazyUpdate,a=i.silent,o=i.replaceMerge,s=i.transition,i=i.notMerge),this[Re]=!0,!this._model||i){var l=new EL(this._api),u=this._theme,f=this._model=new wS;f.scheduler=this._scheduler,f.ssr=this._ssr,f.init(null,null,null,u,this._locale,l)}this._model.setOption(r,{replaceMerge:o},yd);var h={seriesTransition:s,optionChanged:!0};if(n)this[Ke]={silent:a,updateParams:h},this[Re]=!1,this.getZr().wakeUp();else{try{La(this),zi.update.call(this,null,h)}catch(v){throw this[Ke]=null,this[Re]=!1,v}this._ssr||this._zr.flush(),this[Ke]=null,this[Re]=!1,zo.call(this,a),Uo.call(this,a)}}},e.prototype.setTheme=function(){},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||At.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(r){return this.renderToCanvas(r)},e.prototype.renderToCanvas=function(r){r=r||{};var i=this._zr.painter;return i.getRenderedCanvas({backgroundColor:r.backgroundColor||this._model.get("backgroundColor"),pixelRatio:r.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(r){r=r||{};var i=this._zr.painter;return i.renderToString({useViewBox:r.useViewBox})},e.prototype.getSvgDataURL=function(){if(At.svgSupported){var r=this._zr,i=r.storage.getDisplayList();return M(i,function(n){n.stopAnimation(null,!0)}),r.painter.toDataURL()}},e.prototype.getDataURL=function(r){if(this._disposed){this.id;return}r=r||{};var i=r.excludeComponents,n=this._model,a=[],o=this;M(i,function(l){n.eachComponent({mainType:l},function(u){var f=o._componentsMap[u.__viewId];f.group.ignore||(a.push(f),f.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return M(a,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var i=r.type==="svg",n=this.group,a=Math.min,o=Math.max,s=1/0;if(_0[n]){var l=s,u=s,f=-s,h=-s,v=[],c=r&&r.pixelRatio||this.getDevicePixelRatio();M(Cs,function(y,x){if(y.group===n){var S=i?y.getZr().painter.getSvgDom().innerHTML:y.renderToCanvas(ft(r)),T=y.getDom().getBoundingClientRect();l=a(T.left,l),u=a(T.top,u),f=o(T.right,f),h=o(T.bottom,h),v.push({dom:S,left:T.left,top:T.top})}}),l*=c,u*=c,f*=c,h*=c;var d=f-l,p=h-u,g=xo.createCanvas(),m=Kv(g,{renderer:i?"svg":"canvas"});if(m.resize({width:d,height:p}),i){var _="";return M(v,function(y){var x=y.left-l,S=y.top-u;_+='<g transform="translate('+x+","+S+')">'+y.dom+"</g>"}),m.painter.getSvgRoot().innerHTML=_,r.connectedBackgroundColor&&m.painter.setBackgroundColor(r.connectedBackgroundColor),m.refreshImmediately(),m.painter.toDataURL()}else return r.connectedBackgroundColor&&m.add(new ie({shape:{x:0,y:0,width:d,height:p},style:{fill:r.connectedBackgroundColor}})),M(v,function(y){var x=new Nr({style:{x:y.left*c-l,y:y.top*c-u,image:y.dom}});m.add(x)}),m.refreshImmediately(),g.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},e.prototype.convertToPixel=function(r,i){return Cc(this,"convertToPixel",r,i)},e.prototype.convertFromPixel=function(r,i){return Cc(this,"convertFromPixel",r,i)},e.prototype.containPixel=function(r,i){if(this._disposed){this.id;return}var n=this._model,a,o=Kh(n,r);return M(o,function(s,l){l.indexOf("Models")>=0&&M(s,function(u){var f=u.coordinateSystem;if(f&&f.containPoint)a=a||!!f.containPoint(i);else if(l==="seriesModels"){var h=this._chartsMap[u.__viewId];h&&h.containPoint&&(a=a||h.containPoint(i,u))}},this)},this),!!a},e.prototype.getVisual=function(r,i){var n=this._model,a=Kh(n,r,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?QS(s,l,i):JS(s,i)},e.prototype.getViewOfComponentModel=function(r){return this._componentsMap[r.__viewId]},e.prototype.getViewOfSeriesModel=function(r){return this._chartsMap[r.__viewId]},e.prototype._initEvents=function(){var r=this;M(zP,function(i){var n=function(a){var o=r.getModel(),s=a.target,l,u=i==="globalout";if(u?l={}:s&&ja(s,function(d){var p=kt(d);if(p&&p.dataIndex!=null){var g=p.dataModel||o.getSeriesByIndex(p.seriesIndex);return l=g&&g.getDataParams(p.dataIndex,p.dataType,s)||{},!0}else if(p.eventData)return l=U({},p.eventData),!0},!0),l){var f=l.componentType,h=l.componentIndex;(f==="markLine"||f==="markPoint"||f==="markArea")&&(f="series",h=l.seriesIndex);var v=f&&h!=null&&o.getComponent(f,h),c=v&&r[v.mainType==="series"?"_chartsMap":"_componentsMap"][v.__viewId];l.event=a,l.type=i,r._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:v,view:c},r.trigger(i,l)}};n.zrEventfulCallAtLast=!0,r._zr.on(i,n,r)}),M(Es,function(i,n){r._messageCenter.on(n,function(a){this.trigger(n,a)},r)}),M(["selectchanged"],function(i){r._messageCenter.on(i,function(n){this.trigger(i,n)},r)}),YR(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var r=this.getDom();r&&eT(this.getDom(),ig,"");var i=this,n=i._api,a=i._model;M(i._componentsViews,function(o){o.dispose(a,n)}),M(i._chartsViews,function(o){o.dispose(a,n)}),i._zr.dispose(),i._dom=i._model=i._chartsMap=i._componentsMap=i._chartsViews=i._componentsViews=i._scheduler=i._api=i._zr=i._throttledZrFlush=i._theme=i._coordSysMgr=i._messageCenter=null,delete Cs[i.id]},e.prototype.resize=function(r){if(!this[Re]){if(this._disposed){this.id;return}this._zr.resize(r);var i=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!i){var n=i.resetOption("media"),a=r&&r.silent;this[Ke]&&(a==null&&(a=this[Ke].silent),n=!0,this[Ke]=null),this[Re]=!0;try{n&&La(this),zi.update.call(this,{type:"resize",animation:U({duration:0},r&&r.animation)})}catch(o){throw this[Re]=!1,o}this[Re]=!1,zo.call(this,a),Uo.call(this,a)}}},e.prototype.showLoading=function(r,i){if(this._disposed){this.id;return}if(j(r)&&(i=r,r=""),r=r||"default",this.hideLoading(),!!xd[r]){var n=xd[r](this._api,i),a=this._zr;this._loadingFX=n,a.add(n)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(r){var i=U({},r);return i.type=Es[r.type],i},e.prototype.dispatchAction=function(r,i){if(this._disposed){this.id;return}if(j(i)||(i={silent:!!i}),!!xf[r.type]&&this._model){if(this[Re]){this._pendingActions.push(r);return}var n=i.silent;Dc.call(this,r,n);var a=i.flush;a?this._zr.flush():a!==!1&&At.browser.weChat&&this._throttledZrFlush(),zo.call(this,n),Uo.call(this,n)}},e.prototype.updateLabelLayout=function(){Gr.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(r){if(this._disposed){this.id;return}var i=r.seriesIndex,n=this.getModel(),a=n.getSeriesByIndex(i);a.appendData(r),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=function(){La=function(h){var v=h._scheduler;v.restorePipelines(h._model),v.prepareStageTasks(),Ec(h,!0),Ec(h,!1),v.plan()},Ec=function(h,v){for(var c=h._model,d=h._scheduler,p=v?h._componentsViews:h._chartsViews,g=v?h._componentsMap:h._chartsMap,m=h._zr,_=h._api,y=0;y<p.length;y++)p[y].__alive=!1;v?c.eachComponent(function(T,b){T!=="series"&&x(b)}):c.eachSeries(x);function x(T){var b=T.__requireNewView;T.__requireNewView=!1;var w="_ec_"+T.id+"_"+T.type,A=!b&&g[w];if(!A){var C=ui(T.type),E=v?vr.getClass(C.main,C.sub):Ai.getClass(C.sub);A=new E,A.init(c,_),g[w]=A,p.push(A),m.add(A.group)}T.__viewId=A.__id=w,A.__alive=!0,A.__model=T,A.group.__ecComponentInfo={mainType:T.mainType,index:T.componentIndex},!v&&d.prepareView(A,T,c,_)}for(var y=0;y<p.length;){var S=p[y];S.__alive?y++:(!v&&S.renderTask.dispose(),m.remove(S.group),S.dispose(c,_),p.splice(y,1),g[S.__id]===S&&delete g[S.__id],S.__id=S.group.__ecComponentInfo=null)}},Vl=function(h,v,c,d,p){var g=h._model;if(g.setUpdatePayload(c),!d){M([].concat(h._componentsViews).concat(h._chartsViews),S);return}var m={};m[d+"Id"]=c[d+"Id"],m[d+"Index"]=c[d+"Index"],m[d+"Name"]=c[d+"Name"];var _={mainType:d,query:m};p&&(_.subType=p);var y=c.excludeSeriesId,x;y!=null&&(x=ht(),M(ge(y),function(T){var b=Ge(T,null);b!=null&&x.set(b,!0)})),g&&g.eachComponent(_,function(T){var b=x&&x.get(T.id)!=null;if(!b)if(Qm(c))if(T instanceof co)c.type===ea&&!c.notBlur&&!T.get(["emphasis","disabled"])&&MM(T,c,h._api);else{var w=Ap(T.mainType,T.componentIndex,c.name,h._api),A=w.focusSelf,C=w.dispatchers;c.type===ea&&A&&!c.notBlur&&ed(T.mainType,T.componentIndex,h._api),C&&M(C,function(E){c.type===ea?af(E):of(E)})}else nd(c)&&T instanceof co&&(RM(T,c,h._api),qm(T),gr(h))},h),g&&g.eachComponent(_,function(T){var b=x&&x.get(T.id)!=null;b||S(h[d==="series"?"_chartsMap":"_componentsMap"][T.__viewId])},h);function S(T){T&&T.__alive&&T[v]&&T[v](T.__model,g,h._api,c)}},zi={prepareAndUpdate:function(h){La(this),zi.update.call(this,h,{optionChanged:h.newOption!=null})},update:function(h,v){var c=this._model,d=this._api,p=this._zr,g=this._coordSysMgr,m=this._scheduler;if(c){c.setUpdatePayload(h),m.restoreData(c,h),m.performSeriesTasks(c),g.create(c,d),m.performDataProcessorTasks(c,h),Mc(this,c),g.update(c,d),r(c),m.performVisualTasks(c,h),Lc(this,c,d,h,v);var _=c.get("backgroundColor")||"transparent",y=c.get("darkMode");p.setBackgroundColor(_),y!=null&&y!=="auto"&&p.setDarkMode(y),Gr.trigger("afterupdate",c,d)}},updateTransform:function(h){var v=this,c=this._model,d=this._api;if(c){c.setUpdatePayload(h);var p=[];c.eachComponent(function(m,_){if(m!=="series"){var y=v.getViewOfComponentModel(_);if(y&&y.__alive)if(y.updateTransform){var x=y.updateTransform(_,c,d,h);x&&x.update&&p.push(y)}else p.push(y)}});var g=ht();c.eachSeries(function(m){var _=v._chartsMap[m.__viewId];if(_.updateTransform){var y=_.updateTransform(m,c,d,h);y&&y.update&&g.set(m.uid,1)}else g.set(m.uid,1)}),r(c),this._scheduler.performVisualTasks(c,h,{setDirty:!0,dirtyMap:g}),Gl(this,c,d,h,{},g),Gr.trigger("afterupdate",c,d)}},updateView:function(h){var v=this._model;v&&(v.setUpdatePayload(h),Ai.markUpdateMethod(h,"updateView"),r(v),this._scheduler.performVisualTasks(v,h,{setDirty:!0}),Lc(this,v,this._api,h,{}),Gr.trigger("afterupdate",v,this._api))},updateVisual:function(h){var v=this,c=this._model;c&&(c.setUpdatePayload(h),c.eachSeries(function(d){d.getData().clearAllVisual()}),Ai.markUpdateMethod(h,"updateVisual"),r(c),this._scheduler.performVisualTasks(c,h,{visualType:"visual",setDirty:!0}),c.eachComponent(function(d,p){if(d!=="series"){var g=v.getViewOfComponentModel(p);g&&g.__alive&&g.updateVisual(p,c,v._api,h)}}),c.eachSeries(function(d){var p=v._chartsMap[d.__viewId];p.updateVisual(d,c,v._api,h)}),Gr.trigger("afterupdate",c,this._api))},updateLayout:function(h){zi.update.call(this,h)}},Cc=function(h,v,c,d){if(h._disposed){h.id;return}for(var p=h._model,g=h._coordSysMgr.getCoordinateSystems(),m,_=Kh(p,c),y=0;y<g.length;y++){var x=g[y];if(x[v]&&(m=x[v](p,_,d))!=null)return m}},Mc=function(h,v){var c=h._chartsMap,d=h._scheduler;v.eachSeries(function(p){d.updateStreamModes(p,c[p.__viewId])})},Dc=function(h,v){var c=this,d=this.getModel(),p=h.type,g=h.escapeConnect,m=xf[p],_=m.actionInfo,y=(_.update||"update").split(":"),x=y.pop(),S=y[0]!=null&&ui(y[0]);this[Re]=!0;var T=[h],b=!1;h.batch&&(b=!0,T=K(h.batch,function(R){return R=Lt(U({},R),h),R.batch=null,R}));var w=[],A,C=nd(h),E=Qm(h);if(E&&AT(this._api),M(T,function(R){if(A=m.action(R,c._model,c._api),A=A||U({},R),A.type=_.event||A.type,w.push(A),E){var N=yp(h),I=N.queryOptionMap,F=N.mainTypeSpecified,O=F?I.keys()[0]:"series";Vl(c,x,R,O),gr(c)}else C?(Vl(c,x,R,"series"),gr(c)):S&&Vl(c,x,R,S.main,S.sub)}),x!=="none"&&!E&&!C&&!S)try{this[Ke]?(La(this),zi.update.call(this,h),this[Ke]=null):zi[x].call(this,h)}catch(R){throw this[Re]=!1,R}if(b?A={type:_.event||p,escapeConnect:g,batch:w}:A=w[0],this[Re]=!1,!v){var D=this._messageCenter;if(D.trigger(A.type,A),C){var L={type:"selectchanged",escapeConnect:g,selected:PM(d),isFromClick:h.isFromClick||!1,fromAction:h.type,fromActionPayload:h};D.trigger(L.type,L)}}},zo=function(h){for(var v=this._pendingActions;v.length;){var c=v.shift();Dc.call(this,c,h)}},Uo=function(h){!h&&this.trigger("updated")},v0=function(h,v){h.on("rendered",function(c){v.trigger("rendered",c),h.animation.isFinished()&&!v[Ke]&&!v._scheduler.unfinished&&!v._pendingActions.length&&v.trigger("finished")})},d0=function(h,v){h.on("mouseover",function(c){var d=c.target,p=ja(d,id);p&&(DM(p,c,v._api),gr(v))}).on("mouseout",function(c){var d=c.target,p=ja(d,id);p&&(LM(p,c,v._api),gr(v))}).on("click",function(c){var d=c.target,p=ja(d,function(_){return kt(_).dataIndex!=null},!0);if(p){var g=p.selected?"unselect":"select",m=kt(p);v._api.dispatchAction({type:g,dataType:m.dataType,dataIndexInside:m.dataIndex,seriesIndex:m.seriesIndex,isFromClick:!0})}})};function r(h){h.clearColorPalette(),h.eachSeries(function(v){v.clearColorPalette()})}function i(h){var v=[],c=[],d=!1;if(h.eachComponent(function(_,y){var x=y.get("zlevel")||0,S=y.get("z")||0,T=y.getZLevelKey();d=d||!!T,(_==="series"?c:v).push({zlevel:x,z:S,idx:y.componentIndex,type:_,key:T})}),d){var p=v.concat(c),g,m;_u(p,function(_,y){return _.zlevel===y.zlevel?_.z-y.z:_.zlevel-y.zlevel}),M(p,function(_){var y=h.getComponent(_.type,_.idx),x=_.zlevel,S=_.key;g!=null&&(x=Math.max(g,x)),S?(x===g&&S!==m&&x++,m=S):m&&(x===g&&x++,m=""),g=x,y.setZLevel(x)})}}Lc=function(h,v,c,d,p){i(v),p0(h,v,c,d,p),M(h._chartsViews,function(g){g.__alive=!1}),Gl(h,v,c,d,p),M(h._chartsViews,function(g){g.__alive||g.remove(v,c)})},p0=function(h,v,c,d,p,g){M(g||h._componentsViews,function(m){var _=m.__model;u(_,m),m.render(_,v,c,d),s(_,m),f(_,m)})},Gl=function(h,v,c,d,p,g){var m=h._scheduler;p=U(p||{},{updatedSeries:v.getSeries()}),Gr.trigger("series:beforeupdate",v,c,p);var _=!1;v.eachSeries(function(y){var x=h._chartsMap[y.__viewId];x.__alive=!0;var S=x.renderTask;m.updatePayload(S,d),u(y,x),g&&g.get(y.uid)&&S.dirty(),S.perform(m.getPerformArgs(S))&&(_=!0),x.group.silent=!!y.get("silent"),o(y,x),qm(y)}),m.unfinished=_||m.unfinished,Gr.trigger("series:layoutlabels",v,c,p),Gr.trigger("series:transition",v,c,p),v.eachSeries(function(y){var x=h._chartsMap[y.__viewId];s(y,x),f(y,x)}),a(h,v),Gr.trigger("series:afterupdate",v,c,p)},gr=function(h){h[bc]=!0,h.getZr().wakeUp()},m0=function(h){h[bc]&&(h.getZr().storage.traverse(function(v){ao(v)||n(v)}),h[bc]=!1)};function n(h){for(var v=[],c=h.currentStates,d=0;d<c.length;d++){var p=c[d];p==="emphasis"||p==="blur"||p==="select"||v.push(p)}h.selected&&h.states.select&&v.push("select"),h.hoverState===qf&&h.states.emphasis?v.push("emphasis"):h.hoverState===Zf&&h.states.blur&&v.push("blur"),h.useStates(v)}function a(h,v){var c=h._zr,d=c.storage,p=0;d.traverse(function(g){g.isGroup||p++}),p>v.get("hoverLayerThreshold")&&!At.node&&!At.worker&&v.eachSeries(function(g){if(!g.preventUsingHoverLayer){var m=h._chartsMap[g.__viewId];m.__alive&&m.eachRendered(function(_){_.states.emphasis&&(_.states.emphasis.hoverLayer=!0)})}})}function o(h,v){var c=h.get("blendMode")||null;v.eachRendered(function(d){d.isGroup||(d.style.blend=c)})}function s(h,v){if(!h.preventAutoZ){var c=h.get("z")||0,d=h.get("zlevel")||0;v.eachRendered(function(p){return l(p,c,d,-1/0),!0})}}function l(h,v,c,d){var p=h.getTextContent(),g=h.getTextGuideLine(),m=h.isGroup;if(m)for(var _=h.childrenRef(),y=0;y<_.length;y++)d=Math.max(l(_[y],v,c,d),d);else h.z=v,h.zlevel=c,d=Math.max(h.z2,d);if(p&&(p.z=v,p.zlevel=c,isFinite(d)&&(p.z2=d+2)),g){var x=h.textGuideLineConfig;g.z=v,g.zlevel=c,isFinite(d)&&(g.z2=d+(x&&x.showAbove?1:-1))}return d}function u(h,v){v.eachRendered(function(c){if(!ao(c)){var d=c.getTextContent(),p=c.getTextGuideLine();c.stateTransition&&(c.stateTransition=null),d&&d.stateTransition&&(d.stateTransition=null),p&&p.stateTransition&&(p.stateTransition=null),c.hasState()?(c.prevStates=c.currentStates,c.clearStates()):c.prevStates&&(c.prevStates=null)}})}function f(h,v){var c=h.getModel("stateAnimation"),d=h.isAnimationEnabled(),p=c.get("duration"),g=p>0?{duration:p,delay:c.get("delay"),easing:c.get("easing")}:null;v.eachRendered(function(m){if(m.states&&m.states.emphasis){if(ao(m))return;if(m instanceof Ht&&FM(m),m.__dirty){var _=m.prevStates;_&&m.useStates(_)}if(d){m.stateTransition=g;var y=m.getTextContent(),x=m.getTextGuideLine();y&&(y.stateTransition=g),x&&(x.stateTransition=g)}m.__dirty&&n(m)}})}g0=function(h){return new(function(v){G(c,v);function c(){return v!==null&&v.apply(this,arguments)||this}return c.prototype.getCoordinateSystems=function(){return h._coordSysMgr.getCoordinateSystems()},c.prototype.getComponentByElement=function(d){for(;d;){var p=d.__ecComponentInfo;if(p!=null)return h._model.getComponent(p.mainType,p.index);d=d.parent}},c.prototype.enterEmphasis=function(d,p){af(d,p),gr(h)},c.prototype.leaveEmphasis=function(d,p){of(d,p),gr(h)},c.prototype.enterBlur=function(d){CM(d),gr(h)},c.prototype.leaveBlur=function(d){TT(d),gr(h)},c.prototype.enterSelect=function(d){ST(d),gr(h)},c.prototype.leaveSelect=function(d){wT(d),gr(h)},c.prototype.getModel=function(){return h.getModel()},c.prototype.getViewOfComponentModel=function(d){return h.getViewOfComponentModel(d)},c.prototype.getViewOfSeriesModel=function(d){return h.getViewOfSeriesModel(d)},c}(bS))(h)},pw=function(h){function v(c,d){for(var p=0;p<c.length;p++){var g=c[p];g[Ac]=d}}M(Es,function(c,d){h._messageCenter.on(d,function(p){if(_0[h.group]&&h[Ac]!==c0){if(p&&p.escapeConnect)return;var g=h.makeActionFromEvent(p),m=[];M(Cs,function(_){_!==h&&_.group===h.group&&m.push(_)}),v(m,c0),M(m,function(_){_[Ac]!==FP&&_.dispatchAction(g)}),v(m,kP)}})})}}(),e}(Kr),rg=gw.prototype;rg.on=fw("on");rg.off=fw("off");rg.one=function(t,e,r){var i=this;function n(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];e&&e.apply&&e.apply(this,a),i.off(t,n)}this.on.call(this,t,n,r)};var zP=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];var xf={},Es={},_d=[],yd=[],Tf=[],mw={},xd={},Cs={},_0={},UP=+new Date-0,ig="_echarts_instance_";function HP(t,e,r){var i=!(r&&r.ssr);if(i){var n=VP(t);if(n)return n}var a=new gw(t,e,r);return a.id="ec_"+UP++,Cs[a.id]=a,i&&eT(t,ig,a.id),pw(a),Gr.trigger("afterinit",a),a}function VP(t){return Cs[gC(t,ig)]}function _w(t,e){mw[t]=e}function ng(t){Dt(yd,t)<0&&yd.push(t)}function yw(t,e){og(_d,t,e,DP)}function xw(t){ag("afterinit",t)}function Tw(t){ag("afterupdate",t)}function ag(t,e){Gr.on(t,e)}function da(t,e,r){ct(e)&&(r=e,e="");var i=j(t)?t.type:[t,t={event:e}][0];t.event=(t.event||i).toLowerCase(),e=t.event,!Es[e]&&(Rr(h0.test(i)&&h0.test(e)),xf[i]||(xf[i]={action:r,actionInfo:t}),Es[e]=i)}function GP(t,e){lh.register(t,e)}function WP(t){var e=lh.get(t);if(e)return e.getDimensionsInfo?e.getDimensionsInfo():e.dimensions.slice()}function XP(t,e){og(Tf,t,e,sw,"layout")}function pa(t,e){og(Tf,t,e,lw,"visual")}var y0=[];function og(t,e,r,i,n){if((ct(e)||j(e))&&(r=e,e=i),!(Dt(y0,r)>=0)){y0.push(r);var a=KS.wrapStageHandler(r,n);a.__prio=e,a.__raw=r,t.push(a)}}function Sw(t,e){xd[t]=e}function YP(t,e,r){var i=bP("registerMap");i&&i(t,e,r)}var $P=QL;pa(eg,ER);pa(vh,CR);pa(vh,MR);pa(eg,GR);pa(vh,WR);pa(uw,TP);ng(ES);yw(CP,NL);Sw("default",DR);da({type:ea,event:ea,update:ea},De);da({type:bu,event:bu,update:bu},De);da({type:xs,event:xs,update:xs},De);da({type:Au,event:Au,update:Au},De);da({type:Ts,event:Ts,update:Ts},De);_w("light",UR);_w("dark",HR);function Ho(t){return t==null?0:t.length||1}function x0(t){return t}var ZP=function(){function t(e,r,i,n,a,o){this._old=e,this._new=r,this._oldKeyGetter=i||x0,this._newKeyGetter=n||x0,this.context=a,this._diffModeMultiple=o==="multiple"}return t.prototype.add=function(e){return this._add=e,this},t.prototype.update=function(e){return this._update=e,this},t.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},t.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},t.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},t.prototype.remove=function(e){return this._remove=e,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var e=this._old,r=this._new,i={},n=new Array(e.length),a=new Array(r.length);this._initIndexMap(e,null,n,"_oldKeyGetter"),this._initIndexMap(r,i,a,"_newKeyGetter");for(var o=0;o<e.length;o++){var s=n[o],l=i[s],u=Ho(l);if(u>1){var f=l.shift();l.length===1&&(i[s]=l[0]),this._update&&this._update(f,o)}else u===1?(i[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,i)},t.prototype._executeMultiple=function(){var e=this._old,r=this._new,i={},n={},a=[],o=[];this._initIndexMap(e,i,a,"_oldKeyGetter"),this._initIndexMap(r,n,o,"_newKeyGetter");for(var s=0;s<a.length;s++){var l=a[s],u=i[l],f=n[l],h=Ho(u),v=Ho(f);if(h>1&&v===1)this._updateManyToOne&&this._updateManyToOne(f,u),n[l]=null;else if(h===1&&v>1)this._updateOneToMany&&this._updateOneToMany(f,u),n[l]=null;else if(h===1&&v===1)this._update&&this._update(f,u),n[l]=null;else if(h>1&&v>1)this._updateManyToMany&&this._updateManyToMany(f,u),n[l]=null;else if(h>1)for(var c=0;c<h;c++)this._remove&&this._remove(u[c]);else this._remove&&this._remove(u)}this._performRestAdd(o,n)},t.prototype._performRestAdd=function(e,r){for(var i=0;i<e.length;i++){var n=e[i],a=r[n],o=Ho(a);if(o>1)for(var s=0;s<o;s++)this._add&&this._add(a[s]);else o===1&&this._add&&this._add(a);r[n]=null}},t.prototype._initIndexMap=function(e,r,i,n){for(var a=this._diffModeMultiple,o=0;o<e.length;o++){var s="_ec_"+this[n](e[o],o);if(a||(i[o]=s),!!r){var l=r[s],u=Ho(l);u===0?(r[s]=o,a&&i.push(s)):u===1?r[s]=[l,o]:l.push(o)}}},t}();const qP=ZP;var KP=function(){function t(e,r){this._encode=e,this._schema=r}return t.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},t.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},t}();function jP(t,e){var r={},i=r.encode={},n=ht(),a=[],o=[],s={};M(t.dimensions,function(v){var c=t.getDimensionInfo(v),d=c.coordDim;if(d){var p=c.coordDimIndex;Rc(i,d)[p]=v,c.isExtraCoord||(n.set(d,1),JP(c.type)&&(a[0]=v),Rc(s,d)[p]=t.getDimensionIndex(c.name)),c.defaultTooltip&&o.push(v)}mS.each(function(g,m){var _=Rc(i,m),y=c.otherDims[m];y!=null&&y!==!1&&(_[y]=c.name)})});var l=[],u={};n.each(function(v,c){var d=i[c];u[c]=d[0],l=l.concat(d)}),r.dataDimsOnCoord=l,r.dataDimIndicesOnCoord=K(l,function(v){return t.getDimensionInfo(v).storeDimIndex}),r.encodeFirstDimNotExtra=u;var f=i.label;f&&f.length&&(a=f.slice());var h=i.tooltip;return h&&h.length?o=h.slice():o.length||(o=a.slice()),i.defaultedLabel=a,i.defaultedTooltip=o,r.userOutput=new KP(s,e),r}function Rc(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function QP(t){return t==="category"?"ordinal":t==="time"?"time":"float"}function JP(t){return!(t==="ordinal"||t==="time")}var tI=function(){function t(e){this.otherDims={},e!=null&&U(this,e)}return t}();const Du=tI;var eI=Kt(),rI={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},ww=function(){function t(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return t.prototype.isDimensionOmitted=function(){return this._dimOmitted},t.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||(this._dimNameMap=Ew(this.source)))},t.prototype.getSourceDimensionIndex=function(e){return mt(this._dimNameMap.get(e),-1)},t.prototype.getSourceDimension=function(e){var r=this.source.dimensionsDefine;if(r)return r[e]},t.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,r=MS(this.source),i=!Cw(e),n="",a=[],o=0,s=0;o<e;o++){var l=void 0,u=void 0,f=void 0,h=this.dimensions[s];if(h&&h.storeDimIndex===o)l=r?h.name:null,u=h.type,f=h.ordinalMeta,s++;else{var v=this.getSourceDimension(o);v&&(l=r?v.name:null,u=v.type)}a.push({property:l,type:u,ordinalMeta:f}),r&&l!=null&&(!h||!h.isCalculationCoord)&&(n+=i?l.replace(/\`/g,"`1").replace(/\$/g,"`2"):l),n+="$",n+=rI[u]||"f",f&&(n+=f.uid),n+="$"}var c=this.source,d=[c.seriesLayoutBy,c.startIndex,n].join("$$");return{dimensions:a,hash:d}},t.prototype.makeOutputDimensionNames=function(){for(var e=[],r=0,i=0;r<this._fullDimCount;r++){var n=void 0,a=this.dimensions[i];if(a&&a.storeDimIndex===r)a.isCalculationCoord||(n=a.name),i++;else{var o=this.getSourceDimension(r);o&&(n=o.name)}e.push(n)}return e},t.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},t}();function bw(t){return t instanceof ww}function Aw(t){for(var e=ht(),r=0;r<(t||[]).length;r++){var i=t[r],n=j(i)?i.name:i;n!=null&&e.get(n)==null&&e.set(n,r)}return e}function Ew(t){var e=eI(t);return e.dimNameMap||(e.dimNameMap=Aw(t.dimensionsDefine))}function Cw(t){return t>30}var Vo=j,Ui=K,iI=typeof Int32Array>"u"?Array:Int32Array,nI="e\0\0",T0=-1,aI=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],oI=["_approximateExtent"],S0,Wl,Go,Wo,Pc,Xl,Ic,sI=function(){function t(e,r){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","lttbDownSample"];var i,n=!1;bw(e)?(i=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(n=!0,i=e),i=i||["x","y"];for(var a={},o=[],s={},l=!1,u={},f=0;f<i.length;f++){var h=i[f],v=Z(h)?new Du({name:h}):h instanceof Du?h:new Du(h),c=v.name;v.type=v.type||"float",v.coordDim||(v.coordDim=c,v.coordDimIndex=0);var d=v.otherDims=v.otherDims||{};o.push(c),a[c]=v,u[c]!=null&&(l=!0),v.createInvertedIndices&&(s[c]=[]),d.itemName===0&&(this._nameDimIdx=f),d.itemId===0&&(this._idDimIdx=f),n&&(v.storeDimIndex=f)}if(this.dimensions=o,this._dimInfos=a,this._initGetDimensionInfo(l),this.hostModel=r,this._invertedIndicesMap=s,this._dimOmitted){var p=this._dimIdxToName=ht();M(o,function(g){p.set(a[g].storeDimIndex,g)})}}return t.prototype.getDimension=function(e){var r=this._recognizeDimIndex(e);if(r==null)return e;if(r=e,!this._dimOmitted)return this.dimensions[r];var i=this._dimIdxToName.get(r);if(i!=null)return i;var n=this._schema.getSourceDimension(r);if(n)return n.name},t.prototype.getDimensionIndex=function(e){var r=this._recognizeDimIndex(e);if(r!=null)return r;if(e==null)return-1;var i=this._getDimInfo(e);return i?i.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},t.prototype._recognizeDimIndex=function(e){if(Qt(e)||e!=null&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},t.prototype._getStoreDimIndex=function(e){var r=this.getDimensionIndex(e);return r},t.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},t.prototype._initGetDimensionInfo=function(e){var r=this._dimInfos;this._getDimInfo=e?function(i){return r.hasOwnProperty(i)?r[i]:void 0}:function(i){return r[i]}},t.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},t.prototype.mapDimension=function(e,r){var i=this._dimSummary;if(r==null)return i.encodeFirstDimNotExtra[e];var n=i.encode[e];return n?n[r]:null},t.prototype.mapDimensionsAll=function(e){var r=this._dimSummary,i=r.encode[e];return(i||[]).slice()},t.prototype.getStore=function(){return this._store},t.prototype.initData=function(e,r,i){var n=this,a;if(e instanceof fd&&(a=e),!a){var o=this.dimensions,s=Yp(e)||$e(e)?new DS(e,o.length):e;a=new fd;var l=Ui(o,function(u){return{type:n._dimInfos[u].type,property:u}});a.initData(s,l,i)}this._store=a,this._nameList=(r||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,a.count()),this._dimSummary=jP(this,this._schema),this.userOutput=this._dimSummary.userOutput},t.prototype.appendData=function(e){var r=this._store.appendData(e);this._doInit(r[0],r[1])},t.prototype.appendValues=function(e,r){var i=this._store.appendValues(e,r.length),n=i.start,a=i.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),r)for(var s=n;s<a;s++){var l=s-n;this._nameList[s]=r[l],o&&Ic(this,s)}},t.prototype._updateOrdinalMeta=function(){for(var e=this._store,r=this.dimensions,i=0;i<r.length;i++){var n=this._dimInfos[r[i]];n.ordinalMeta&&e.collectOrdinalMeta(n.storeDimIndex,n.ordinalMeta)}},t.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return this._idDimIdx==null&&e.getSource().sourceFormat!==rn&&!e.fillStorage},t.prototype._doInit=function(e,r){if(!(e>=r)){var i=this._store,n=i.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=n.getSource().sourceFormat,l=s===Or;if(l&&!n.pure)for(var u=[],f=e;f<r;f++){var h=n.getItem(f,u);if(!this.hasItemOption&&nC(h)&&(this.hasItemOption=!0),h){var v=h.name;a[f]==null&&v!=null&&(a[f]=Ge(v,null));var c=h.id;o[f]==null&&c!=null&&(o[f]=Ge(c,null))}}if(this._shouldMakeIdFromName())for(var f=e;f<r;f++)Ic(this,f);S0(this)}},t.prototype.getApproximateExtent=function(e){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e))},t.prototype.setApproximateExtent=function(e,r){r=this.getDimension(r),this._approximateExtent[r]=e.slice()},t.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},t.prototype.setCalculationInfo=function(e,r){Vo(e)?U(this._calculationInfo,e):this._calculationInfo[e]=r},t.prototype.getName=function(e){var r=this.getRawIndex(e),i=this._nameList[r];return i==null&&this._nameDimIdx!=null&&(i=Go(this,this._nameDimIdx,r)),i==null&&(i=""),i},t.prototype._getCategory=function(e,r){var i=this._store.get(e,r),n=this._store.getOrdinalMeta(e);return n?n.categories[i]:i},t.prototype.getId=function(e){return Wl(this,this.getRawIndex(e))},t.prototype.count=function(){return this._store.count()},t.prototype.get=function(e,r){var i=this._store,n=this._dimInfos[e];if(n)return i.get(n.storeDimIndex,r)},t.prototype.getByRawIndex=function(e,r){var i=this._store,n=this._dimInfos[e];if(n)return i.getByRawIndex(n.storeDimIndex,r)},t.prototype.getIndices=function(){return this._store.getIndices()},t.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e))},t.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},t.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},t.prototype.getValues=function(e,r){var i=this,n=this._store;return X(e)?n.getValues(Ui(e,function(a){return i._getStoreDimIndex(a)}),r):n.getValues(e)},t.prototype.hasValue=function(e){for(var r=this._dimSummary.dataDimIndicesOnCoord,i=0,n=r.length;i<n;i++)if(isNaN(this._store.get(r[i],e)))return!1;return!0},t.prototype.indexOfName=function(e){for(var r=0,i=this._store.count();r<i;r++)if(this.getName(r)===e)return r;return-1},t.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},t.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},t.prototype.rawIndexOf=function(e,r){var i=e&&this._invertedIndicesMap[e],n=i[r];return n==null||isNaN(n)?T0:n},t.prototype.indicesOfNearest=function(e,r,i){return this._store.indicesOfNearest(this._getStoreDimIndex(e),r,i)},t.prototype.each=function(e,r,i){ct(e)&&(i=r,r=e,e=[]);var n=i||this,a=Ui(Wo(e),this._getStoreDimIndex,this);this._store.each(a,n?et(r,n):r)},t.prototype.filterSelf=function(e,r,i){ct(e)&&(i=r,r=e,e=[]);var n=i||this,a=Ui(Wo(e),this._getStoreDimIndex,this);return this._store=this._store.filter(a,n?et(r,n):r),this},t.prototype.selectRange=function(e){var r=this,i={},n=yt(e);return M(n,function(a){var o=r._getStoreDimIndex(a);i[o]=e[a]}),this._store=this._store.selectRange(i),this},t.prototype.mapArray=function(e,r,i){ct(e)&&(i=r,r=e,e=[]),i=i||this;var n=[];return this.each(e,function(){n.push(r&&r.apply(this,arguments))},i),n},t.prototype.map=function(e,r,i,n){var a=i||n||this,o=Ui(Wo(e),this._getStoreDimIndex,this),s=Xl(this);return s._store=this._store.map(o,a?et(r,a):r),s},t.prototype.modify=function(e,r,i,n){var a=i||n||this,o=Ui(Wo(e),this._getStoreDimIndex,this);this._store.modify(o,a?et(r,a):r)},t.prototype.downSample=function(e,r,i,n){var a=Xl(this);return a._store=this._store.downSample(this._getStoreDimIndex(e),r,i,n),a},t.prototype.lttbDownSample=function(e,r){var i=Xl(this);return i._store=this._store.lttbDownSample(this._getStoreDimIndex(e),r),i},t.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},t.prototype.getItemModel=function(e){var r=this.hostModel,i=this.getRawDataItem(e);return new Te(i,r,r&&r.ecModel)},t.prototype.diff=function(e){var r=this;return new qP(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(i){return Wl(e,i)},function(i){return Wl(r,i)})},t.prototype.getVisual=function(e){var r=this._visual;return r&&r[e]},t.prototype.setVisual=function(e,r){this._visual=this._visual||{},Vo(e)?U(this._visual,e):this._visual[e]=r},t.prototype.getItemVisual=function(e,r){var i=this._itemVisuals[e],n=i&&i[r];return n??this.getVisual(r)},t.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},t.prototype.ensureUniqueItemVisual=function(e,r){var i=this._itemVisuals,n=i[e];n||(n=i[e]={});var a=n[r];return a==null&&(a=this.getVisual(r),X(a)?a=a.slice():Vo(a)&&(a=U({},a)),n[r]=a),a},t.prototype.setItemVisual=function(e,r,i){var n=this._itemVisuals[e]||{};this._itemVisuals[e]=n,Vo(r)?U(n,r):n[r]=i},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(e,r){Vo(e)?U(this._layout,e):this._layout[e]=r},t.prototype.getLayout=function(e){return this._layout[e]},t.prototype.getItemLayout=function(e){return this._itemLayouts[e]},t.prototype.setItemLayout=function(e,r,i){this._itemLayouts[e]=i?U(this._itemLayouts[e]||{},r):r},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(e,r){var i=this.hostModel&&this.hostModel.seriesIndex;mM(i,this.dataType,e,r),this._graphicEls[e]=r},t.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},t.prototype.eachItemGraphicEl=function(e,r){M(this._graphicEls,function(i,n){i&&e&&e.call(r,i,n)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:Ui(this.dimensions,this._getDimInfo,this),this.hostModel)),Pc(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(e,r){var i=this[e];ct(i)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var n=i.apply(this,arguments);return r.apply(this,[n].concat(lp(arguments)))})},t.internalField=function(){S0=function(e){var r=e._invertedIndicesMap;M(r,function(i,n){var a=e._dimInfos[n],o=a.ordinalMeta,s=e._store;if(o){i=r[n]=new iI(o.categories.length);for(var l=0;l<i.length;l++)i[l]=T0;for(var l=0;l<s.count();l++)i[s.get(a.storeDimIndex,l)]=l}})},Go=function(e,r,i){return Ge(e._getCategory(r,i),null)},Wl=function(e,r){var i=e._idList[r];return i==null&&e._idDimIdx!=null&&(i=Go(e,e._idDimIdx,r)),i==null&&(i=nI+r),i},Wo=function(e){return X(e)||(e=e!=null?[e]:[]),e},Xl=function(e){var r=new t(e._schema?e._schema:Ui(e.dimensions,e._getDimInfo,e),e.hostModel);return Pc(r,e),r},Pc=function(e,r){M(aI.concat(r.__wrappedMethods||[]),function(i){r.hasOwnProperty(i)&&(e[i]=r[i])}),e.__wrappedMethods=r.__wrappedMethods,M(oI,function(i){e[i]=ft(r[i])}),e._calculationInfo=U({},r._calculationInfo)},Ic=function(e,r){var i=e._nameList,n=e._idList,a=e._nameDimIdx,o=e._idDimIdx,s=i[r],l=n[r];if(s==null&&a!=null&&(i[r]=s=Go(e,a,r)),l==null&&o!=null&&(n[r]=l=Go(e,o,r)),l==null&&s!=null){var u=e._nameRepeatCount,f=u[s]=(u[s]||0)+1;l=s,f>1&&(l+="__ec__"+f),n[r]=l}}}(),t}();const Mw=sI;function lI(t,e){return Dw(t,e).dimensions}function Dw(t,e){Yp(t)||(t=$p(t)),e=e||{};var r=e.coordDimensions||[],i=e.dimensionsDefine||t.dimensionsDefine||[],n=ht(),a=[],o=fI(t,r,i,e.dimensionsCount),s=e.canOmitUnusedDimensions&&Cw(o),l=i===t.dimensionsDefine,u=l?Ew(t):Aw(i),f=e.encodeDefine;!f&&e.encodeDefaulter&&(f=e.encodeDefaulter(t,o));for(var h=ht(f),v=new NS(o),c=0;c<v.length;c++)v[c]=-1;function d(A){var C=v[A];if(C<0){var E=i[A],D=j(E)?E:{name:E},L=new Du,R=D.name;R!=null&&u.get(R)!=null&&(L.name=L.displayName=R),D.type!=null&&(L.type=D.type),D.displayName!=null&&(L.displayName=D.displayName);var N=a.length;return v[A]=N,L.storeDimIndex=A,a.push(L),L}return a[C]}if(!s)for(var c=0;c<o;c++)d(c);h.each(function(A,C){var E=ge(A).slice();if(E.length===1&&!Z(E[0])&&E[0]<0){h.set(C,!1);return}var D=h.set(C,[]);M(E,function(L,R){var N=Z(L)?u.get(L):L;N!=null&&N<o&&(D[R]=N,g(d(N),C,R))})});var p=0;M(r,function(A){var C,E,D,L;if(Z(A))C=A,L={};else{L=A,C=L.name;var R=L.ordinalMeta;L.ordinalMeta=null,L=U({},L),L.ordinalMeta=R,E=L.dimsDef,D=L.otherDims,L.name=L.coordDim=L.coordDimIndex=L.dimsDef=L.otherDims=null}var N=h.get(C);if(N!==!1){if(N=ge(N),!N.length)for(var I=0;I<(E&&E.length||1);I++){for(;p<o&&d(p).coordDim!=null;)p++;p<o&&N.push(p++)}M(N,function(F,O){var z=d(F);if(l&&L.type!=null&&(z.type=L.type),g(Lt(z,L),C,O),z.name==null&&E){var k=E[O];!j(k)&&(k={name:k}),z.name=z.displayName=k.name,z.defaultTooltip=k.defaultTooltip}D&&Lt(z.otherDims,D)})}});function g(A,C,E){mS.get(C)!=null?A.otherDims[C]=E:(A.coordDim=C,A.coordDimIndex=E,n.set(C,!0))}var m=e.generateCoord,_=e.generateCoordCount,y=_!=null;_=m?_||1:0;var x=m||"value";function S(A){A.name==null&&(A.name=A.coordDim)}if(s)M(a,function(A){S(A)}),a.sort(function(A,C){return A.storeDimIndex-C.storeDimIndex});else for(var T=0;T<o;T++){var b=d(T),w=b.coordDim;w==null&&(b.coordDim=hI(x,n,y),b.coordDimIndex=0,(!m||_<=0)&&(b.isExtraCoord=!0),_--),S(b),b.type==null&&(TS(t,T)===sr.Must||b.isExtraCoord&&(b.otherDims.itemName!=null||b.otherDims.seriesName!=null))&&(b.type="ordinal")}return uI(a),new ww({source:t,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function uI(t){for(var e=ht(),r=0;r<t.length;r++){var i=t[r],n=i.name,a=e.get(n)||0;a>0&&(i.name=n+(a-1)),a++,e.set(n,a)}}function fI(t,e,r,i){var n=Math.max(t.dimensionsDetectedCount||1,e.length,r.length,i||0);return M(e,function(a){var o;j(a)&&(o=a.dimsDef)&&(n=Math.max(n,o.length))}),n}function hI(t,e,r){if(r||e.hasKey(t)){for(var i=0;e.hasKey(t+i);)i++;t+=i}return e.set(t,!0),t}var cI=function(){function t(e){this.coordSysDims=[],this.axisMap=ht(),this.categoryAxisMap=ht(),this.coordSysName=e}return t}();function vI(t){var e=t.get("coordinateSystem"),r=new cI(e),i=dI[e];if(i)return i(t,r,r.axisMap,r.categoryAxisMap),r}var dI={cartesian2d:function(t,e,r,i){var n=t.getReferringComponents("xAxis",Je).models[0],a=t.getReferringComponents("yAxis",Je).models[0];e.coordSysDims=["x","y"],r.set("x",n),r.set("y",a),Ra(n)&&(i.set("x",n),e.firstCategoryDimIndex=0),Ra(a)&&(i.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,r,i){var n=t.getReferringComponents("singleAxis",Je).models[0];e.coordSysDims=["single"],r.set("single",n),Ra(n)&&(i.set("single",n),e.firstCategoryDimIndex=0)},polar:function(t,e,r,i){var n=t.getReferringComponents("polar",Je).models[0],a=n.findAxisModel("radiusAxis"),o=n.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],r.set("radius",a),r.set("angle",o),Ra(a)&&(i.set("radius",a),e.firstCategoryDimIndex=0),Ra(o)&&(i.set("angle",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(t,e,r,i){e.coordSysDims=["lng","lat"]},parallel:function(t,e,r,i){var n=t.ecModel,a=n.getComponent("parallel",t.get("parallelIndex")),o=e.coordSysDims=a.dimensions.slice();M(a.parallelAxisIndex,function(s,l){var u=n.getComponent("parallelAxis",s),f=o[l];r.set(f,u),Ra(u)&&(i.set(f,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function Ra(t){return t.get("type")==="category"}function Lw(t,e,r){r=r||{};var i=r.byIndex,n=r.stackedCoordDimension,a,o,s;pI(e)?a=e:(o=e.schema,a=o.dimensions,s=e.store);var l=!!(t&&t.get("stack")),u,f,h,v;if(M(a,function(_,y){Z(_)&&(a[y]=_={name:_}),l&&!_.isExtraCoord&&(!i&&!u&&_.ordinalMeta&&(u=_),!f&&_.type!=="ordinal"&&_.type!=="time"&&(!n||n===_.coordDim)&&(f=_))}),f&&!i&&!u&&(i=!0),f){h="__\0ecstackresult_"+t.id,v="__\0ecstackedover_"+t.id,u&&(u.createInvertedIndices=!0);var c=f.coordDim,d=f.type,p=0;M(a,function(_){_.coordDim===c&&p++});var g={name:h,coordDim:c,coordDimIndex:p,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},m={name:v,coordDim:v,coordDimIndex:p+1,type:d,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(g.storeDimIndex=s.ensureCalculationDimension(v,d),m.storeDimIndex=s.ensureCalculationDimension(h,d)),o.appendCalculationDimension(g),o.appendCalculationDimension(m)):(a.push(g),a.push(m))}return{stackedDimension:f&&f.name,stackedByDimension:u&&u.name,isStackedByIndex:i,stackedOverDimension:v,stackResultDimension:h}}function pI(t){return!bw(t.schema)}function vo(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function Rw(t,e){return vo(t,e)?t.getCalculationInfo("stackResultDimension"):e}function gI(t,e){var r=t.get("coordinateSystem"),i=lh.get(r),n;return e&&e.coordSysDims&&(n=K(e.coordSysDims,function(a){var o={name:a},s=e.axisMap.get(a);if(s){var l=s.get("type");o.type=QP(l)}return o})),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}function mI(t,e,r){var i,n;return r&&M(t,function(a,o){var s=a.coordDim,l=r.categoryAxisMap.get(s);l&&(i==null&&(i=o),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(n=!0)}),!n&&i!=null&&(t[i].otherDims.itemName=0),i}function _I(t,e,r){r=r||{};var i=e.getSourceManager(),n,a=!1;t?(a=!0,n=$p(t)):(n=i.getSource(),a=n.sourceFormat===Or);var o=vI(e),s=gI(e,o),l=r.useEncodeDefaulter,u=ct(l)?l:l?de(oL,s,e):null,f={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},h=Dw(n,f),v=mI(h.dimensions,r.createInvertedIndices,o),c=a?null:i.getSharedDataStore(h),d=Lw(e,{schema:h,store:c}),p=new Mw(h,e);p.setCalculationInfo(d);var g=v!=null&&yI(n)?function(m,_,y,x){return x===v?y:this.defaultDimValueGetter(m,_,y,x)}:null;return p.hasItemOption=!1,p.initData(a?n:c,null,g),p}function yI(t){if(t.sourceFormat===Or){var e=xI(t.data||[]);return!X(rl(e))}}function xI(t){for(var e=0;e<t.length&&t[e]==null;)e++;return t[e]}var Pw=function(){function t(e){this._setting=e||{},this._extent=[1/0,-1/0]}return t.prototype.getSetting=function(e){return this._setting[e]},t.prototype.unionExtent=function(e){var r=this._extent;e[0]<r[0]&&(r[0]=e[0]),e[1]>r[1]&&(r[1]=e[1])},t.prototype.unionExtentFromData=function(e,r){this.unionExtent(e.getApproximateExtent(r))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(e,r){var i=this._extent;isNaN(e)||(i[0]=e),isNaN(r)||(i[1]=r)},t.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(e){this._isBlank=e},t}();Xf(Pw);const Pi=Pw;var TI=0,SI=function(){function t(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++TI}return t.createByAxisModel=function(e){var r=e.option,i=r.data,n=i&&K(i,wI);return new t({categories:n,needCollect:!n,deduplication:r.dedplication!==!1})},t.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},t.prototype.parseAndCollect=function(e){var r,i=this._needCollect;if(!Z(e)&&!i)return e;if(i&&!this._deduplication)return r=this.categories.length,this.categories[r]=e,r;var n=this._getOrCreateMap();return r=n.get(e),r==null&&(i?(r=this.categories.length,this.categories[r]=e,n.set(e,r)):r=NaN),r},t.prototype._getOrCreateMap=function(){return this._map||(this._map=ht(this.categories))},t}();function wI(t){return j(t)&&t.value!=null?t.value:t+""}const Sf=SI;function Td(t){return t.type==="interval"||t.type==="log"}function bI(t,e,r,i){var n={},a=t[1]-t[0],o=n.interval=qx(a/e,!0);r!=null&&o<r&&(o=n.interval=r),i!=null&&o>i&&(o=n.interval=i);var s=n.intervalPrecision=Iw(o),l=n.niceTickExtent=[re(Math.ceil(t[0]/o)*o,s),re(Math.floor(t[1]/o)*o,s)];return AI(l,t),n}function Nc(t){var e=Math.pow(10,mp(t)),r=t/e;return r?r===2?r=3:r===3?r=5:r*=2:r=1,re(r*e)}function Iw(t){return Ti(t)+2}function w0(t,e,r){t[e]=Math.max(Math.min(t[e],r[1]),r[0])}function AI(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),w0(t,0,e),w0(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function dh(t,e){return t>=e[0]&&t<=e[1]}function ph(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function gh(t,e){return t*(e[1]-e[0])+e[0]}var Nw=function(t){G(e,t);function e(r){var i=t.call(this,r)||this;i.type="ordinal";var n=i.getSetting("ordinalMeta");return n||(n=new Sf({})),X(n)&&(n=new Sf({categories:K(n,function(a){return j(a)?a.value:a})})),i._ordinalMeta=n,i._extent=i.getSetting("extent")||[0,n.categories.length-1],i}return e.prototype.parse=function(r){return r==null?NaN:Z(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},e.prototype.contain=function(r){return r=this.parse(r),dh(r,this._extent)&&this._ordinalMeta.categories[r]!=null},e.prototype.normalize=function(r){return r=this._getTickNumber(this.parse(r)),ph(r,this._extent)},e.prototype.scale=function(r){return r=Math.round(gh(r,this._extent)),this.getRawOrdinalNumber(r)},e.prototype.getTicks=function(){for(var r=[],i=this._extent,n=i[0];n<=i[1];)r.push({value:n}),n++;return r},e.prototype.getMinorTicks=function(r){},e.prototype.setSortInfo=function(r){if(r==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var i=r.ordinalNumbers,n=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,i.length);o<l;++o){var u=i[o];n[o]=u,a[u]=o}for(var f=0;o<s;++o){for(;a[f]!=null;)f++;n.push(f),a[f]=o}},e.prototype._getTickNumber=function(r){var i=this._ticksByOrdinalNumber;return i&&r>=0&&r<i.length?i[r]:r},e.prototype.getRawOrdinalNumber=function(r){var i=this._ordinalNumbersByTick;return i&&r>=0&&r<i.length?i[r]:r},e.prototype.getLabel=function(r){if(!this.isBlank()){var i=this.getRawOrdinalNumber(r.value),n=this._ordinalMeta.categories[i];return n==null?"":n+""}},e.prototype.count=function(){return this._extent[1]-this._extent[0]+1},e.prototype.unionExtentFromData=function(r,i){this.unionExtent(r.getApproximateExtent(i))},e.prototype.isInExtentRange=function(r){return r=this._getTickNumber(r),this._extent[0]<=r&&this._extent[1]>=r},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(Pi);Pi.registerClass(Nw);const Ow=Nw;var Dn=re,Bw=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="interval",r._interval=0,r._intervalPrecision=2,r}return e.prototype.parse=function(r){return r},e.prototype.contain=function(r){return dh(r,this._extent)},e.prototype.normalize=function(r){return ph(r,this._extent)},e.prototype.scale=function(r){return gh(r,this._extent)},e.prototype.setExtent=function(r,i){var n=this._extent;isNaN(r)||(n[0]=parseFloat(r)),isNaN(i)||(n[1]=parseFloat(i))},e.prototype.unionExtent=function(r){var i=this._extent;r[0]<i[0]&&(i[0]=r[0]),r[1]>i[1]&&(i[1]=r[1]),this.setExtent(i[0],i[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(r){this._interval=r,this._niceExtent=this._extent.slice(),this._intervalPrecision=Iw(r)},e.prototype.getTicks=function(r){var i=this._interval,n=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=[];if(!i)return s;var l=1e4;n[0]<a[0]&&(r?s.push({value:Dn(a[0]-i,o)}):s.push({value:n[0]}));for(var u=a[0];u<=a[1]&&(s.push({value:u}),u=Dn(u+i,o),u!==s[s.length-1].value);)if(s.length>l)return[];var f=s.length?s[s.length-1].value:a[1];return n[1]>f&&(r?s.push({value:Dn(f+i,o)}):s.push({value:n[1]})),s},e.prototype.getMinorTicks=function(r){for(var i=this.getTicks(!0),n=[],a=this.getExtent(),o=1;o<i.length;o++){for(var s=i[o],l=i[o-1],u=0,f=[],h=s.value-l.value,v=h/r;u<r-1;){var c=Dn(l.value+(u+1)*v);c>a[0]&&c<a[1]&&f.push(c),u++}n.push(f)}return n},e.prototype.getLabel=function(r,i){if(r==null)return"";var n=i&&i.precision;n==null?n=Ti(r.value)||0:n==="auto"&&(n=this._intervalPrecision);var a=Dn(r.value,n,!0);return vf(a)},e.prototype.calcNiceTicks=function(r,i,n){r=r||5;var a=this._extent,o=a[1]-a[0];if(isFinite(o)){o<0&&(o=-o,a.reverse());var s=bI(a,r,i,n);this._intervalPrecision=s.intervalPrecision,this._interval=s.interval,this._niceExtent=s.niceTickExtent}},e.prototype.calcNiceExtent=function(r){var i=this._extent;if(i[0]===i[1])if(i[0]!==0){var n=Math.abs(i[0]);r.fixMax||(i[1]+=n/2),i[0]-=n/2}else i[1]=1;var a=i[1]-i[0];isFinite(a)||(i[0]=0,i[1]=1),this.calcNiceTicks(r.splitNumber,r.minInterval,r.maxInterval);var o=this._interval;r.fixMin||(i[0]=Dn(Math.floor(i[0]/o)*o)),r.fixMax||(i[1]=Dn(Math.ceil(i[1]/o)*o))},e.prototype.setNiceExtent=function(r,i){this._niceExtent=[r,i]},e.type="interval",e}(Pi);Pi.registerClass(Bw);const sl=Bw;var Fw=typeof Float32Array<"u",EI=Fw?Float32Array:Array;function Ja(t){return X(t)?Fw?new Float32Array(t):t:new EI(t)}var CI="__ec_stack_";function kw(t){return t.get("stack")||CI+t.seriesIndex}function zw(t){return t.dim+t.index}function MI(t,e){var r=[];return e.eachSeriesByType(t,function(i){II(i)&&r.push(i)}),r}function DI(t){var e={};M(t,function(l){var u=l.coordinateSystem,f=u.getBaseAxis();if(!(f.type!=="time"&&f.type!=="value"))for(var h=l.getData(),v=f.dim+"_"+f.index,c=h.getDimensionIndex(h.mapDimension(f.dim)),d=h.getStore(),p=0,g=d.count();p<g;++p){var m=d.get(c,p);e[v]?e[v].push(m):e[v]=[m]}});var r={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(n){n.sort(function(l,u){return l-u});for(var a=null,o=1;o<n.length;++o){var s=n[o]-n[o-1];s>0&&(a=a===null?s:Math.min(a,s))}r[i]=a}}return r}function LI(t){var e=DI(t),r=[];return M(t,function(i){var n=i.coordinateSystem,a=n.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=e[l],f=Math.abs(o[1]-o[0]),h=a.scale.getExtent(),v=Math.abs(h[1]-h[0]);s=u?f/v*u:f}else{var c=i.getData();s=Math.abs(o[1]-o[0])/c.count()}var d=ve(i.get("barWidth"),s),p=ve(i.get("barMaxWidth"),s),g=ve(i.get("barMinWidth")||(NI(i)?.5:1),s),m=i.get("barGap"),_=i.get("barCategoryGap");r.push({bandWidth:s,barWidth:d,barMaxWidth:p,barMinWidth:g,barGap:m,barCategoryGap:_,axisKey:zw(a),stackId:kw(i)})}),RI(r)}function RI(t){var e={};M(t,function(i,n){var a=i.axisKey,o=i.bandWidth,s=e[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;e[a]=s;var u=i.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var f=i.barWidth;f&&!l[u].width&&(l[u].width=f,f=Math.min(s.remainedWidth,f),s.remainedWidth-=f);var h=i.barMaxWidth;h&&(l[u].maxWidth=h);var v=i.barMinWidth;v&&(l[u].minWidth=v);var c=i.barGap;c!=null&&(s.gap=c);var d=i.barCategoryGap;d!=null&&(s.categoryGap=d)});var r={};return M(e,function(i,n){r[n]={};var a=i.stacks,o=i.bandWidth,s=i.categoryGap;if(s==null){var l=yt(a).length;s=Math.max(35-l*4,15)+"%"}var u=ve(s,o),f=ve(i.gap,1),h=i.remainedWidth,v=i.autoWidthCount,c=(h-u)/(v+(v-1)*f);c=Math.max(c,0),M(a,function(m){var _=m.maxWidth,y=m.minWidth;if(m.width){var x=m.width;_&&(x=Math.min(x,_)),y&&(x=Math.max(x,y)),m.width=x,h-=x+f*x,v--}else{var x=c;_&&_<x&&(x=Math.min(_,h)),y&&y>x&&(x=y),x!==c&&(m.width=x,h-=x+f*x,v--)}}),c=(h-u)/(v+(v-1)*f),c=Math.max(c,0);var d=0,p;M(a,function(m,_){m.width||(m.width=c),p=m,d+=m.width*(1+f)}),p&&(d-=p.width*f);var g=-d/2;M(a,function(m,_){r[n][_]=r[n][_]||{bandWidth:o,offset:g,width:m.width},g+=m.width*(1+f)})}),r}function PI(t,e,r){if(t&&e){var i=t[zw(e)];return i!=null&&r!=null?i[kw(r)]:i}}function II(t){return t.coordinateSystem&&t.coordinateSystem.type==="cartesian2d"}function NI(t){return t.pipelineContext&&t.pipelineContext.large}var OI=function(t,e,r,i){for(;r<i;){var n=r+i>>>1;t[n][1]<e?r=n+1:i=n}return r},Uw=function(t){G(e,t);function e(r){var i=t.call(this,r)||this;return i.type="time",i}return e.prototype.getLabel=function(r){var i=this.getSetting("useUTC");return ih(r.value,d_[QD(oo(this._minLevelUnit))]||d_.second,i,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(r,i,n){var a=this.getSetting("useUTC"),o=this.getSetting("locale");return JD(r,i,n,o,a)},e.prototype.getTicks=function(){var r=this._interval,i=this._extent,n=[];if(!r)return n;n.push({value:i[0],level:0});var a=this.getSetting("useUTC"),o=VI(this._minLevelUnit,this._approxInterval,a,i);return n=n.concat(o),n.push({value:i[1],level:0}),n},e.prototype.calcNiceExtent=function(r){var i=this._extent;if(i[0]===i[1]&&(i[0]-=Mr,i[1]+=Mr),i[1]===-1/0&&i[0]===1/0){var n=new Date;i[1]=+new Date(n.getFullYear(),n.getMonth(),n.getDate()),i[0]=i[1]-Mr}this.calcNiceTicks(r.splitNumber,r.minInterval,r.maxInterval)},e.prototype.calcNiceTicks=function(r,i,n){r=r||10;var a=this._extent,o=a[1]-a[0];this._approxInterval=o/r,i!=null&&this._approxInterval<i&&(this._approxInterval=i),n!=null&&this._approxInterval>n&&(this._approxInterval=n);var s=Yl.length,l=Math.min(OI(Yl,this._approxInterval,0,s),s-1);this._interval=Yl[l][1],this._minLevelUnit=Yl[Math.max(l-1,0)][0]},e.prototype.parse=function(r){return Qt(r)?r:+vi(r)},e.prototype.contain=function(r){return dh(this.parse(r),this._extent)},e.prototype.normalize=function(r){return ph(this.parse(r),this._extent)},e.prototype.scale=function(r){return gh(r,this._extent)},e.type="time",e}(sl),Yl=[["second",Hp],["minute",Vp],["hour",bs],["quarter-day",bs*6],["half-day",bs*12],["day",Mr*1.2],["half-week",Mr*3.5],["week",Mr*7],["month",Mr*31],["quarter",Mr*95],["half-year",v_/2],["year",v_]];function BI(t,e,r,i){var n=vi(e),a=vi(r),o=function(d){return p_(n,d,i)===p_(a,d,i)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},f=function(){return u()&&o("hour")},h=function(){return f()&&o("minute")},v=function(){return h()&&o("second")},c=function(){return v()&&o("millisecond")};switch(t){case"year":return s();case"month":return l();case"day":return u();case"hour":return f();case"minute":return h();case"second":return v();case"millisecond":return c()}}function FI(t,e){return t/=Mr,t>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function kI(t){var e=30*Mr;return t/=e,t>6?6:t>3?3:t>2?2:1}function zI(t){return t/=bs,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function b0(t,e){return t/=e?Vp:Hp,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function UI(t){return qx(t,!0)}function HI(t,e,r){var i=new Date(t);switch(oo(e)){case"year":case"month":i[nS(r)](0);case"day":i[aS(r)](1);case"hour":i[oS(r)](0);case"minute":i[sS(r)](0);case"second":i[lS(r)](0),i[uS(r)](0)}return i.getTime()}function VI(t,e,r,i){var n=1e4,a=rS,o=0;function s(C,E,D,L,R,N,I){for(var F=new Date(E),O=E,z=F[L]();O<D&&O<=i[1];)I.push({value:O}),z+=C,F[R](z),O=F.getTime();I.push({value:O,notAdd:!0})}function l(C,E,D){var L=[],R=!E.length;if(!BI(oo(C),i[0],i[1],r)){R&&(E=[{value:HI(new Date(i[0]),C,r)},{value:i[1]}]);for(var N=0;N<E.length-1;N++){var I=E[N].value,F=E[N+1].value;if(I!==F){var O=void 0,z=void 0,k=void 0,it=!1;switch(C){case"year":O=Math.max(1,Math.round(e/Mr/365)),z=Gp(r),k=tL(r);break;case"half-year":case"quarter":case"month":O=kI(e),z=so(r),k=nS(r);break;case"week":case"half-week":case"day":O=FI(e),z=nh(r),k=aS(r),it=!0;break;case"half-day":case"quarter-day":case"hour":O=zI(e),z=ks(r),k=oS(r);break;case"minute":O=b0(e,!0),z=ah(r),k=sS(r);break;case"second":O=b0(e,!1),z=oh(r),k=lS(r);break;case"millisecond":O=UI(e),z=sh(r),k=uS(r);break}s(O,I,F,z,k,it,L),C==="year"&&D.length>1&&N===0&&D.unshift({value:D[0].value-O})}}for(var N=0;N<L.length;N++)D.push(L[N]);return L}}for(var u=[],f=[],h=0,v=0,c=0;c<a.length&&o++<n;++c){var d=oo(a[c]);if(jD(a[c])){l(a[c],u[u.length-1]||[],f);var p=a[c+1]?oo(a[c+1]):null;if(d!==p){if(f.length){v=h,f.sort(function(C,E){return C.value-E.value});for(var g=[],m=0;m<f.length;++m){var _=f[m].value;(m===0||f[m-1].value!==_)&&(g.push(f[m]),_>=i[0]&&_<=i[1]&&h++)}var y=(i[1]-i[0])/e;if(h>y*1.5&&v>y/1.5||(u.push(g),h>y||t===a[c]))break}f=[]}}}for(var x=ce(K(u,function(C){return ce(C,function(E){return E.value>=i[0]&&E.value<=i[1]&&!E.notAdd})}),function(C){return C.length>0}),S=[],T=x.length-1,c=0;c<x.length;++c)for(var b=x[c],w=0;w<b.length;++w)S.push({value:b[w].value,level:T-c});S.sort(function(C,E){return C.value-E.value});for(var A=[],c=0;c<S.length;++c)(c===0||S[c].value!==S[c-1].value)&&A.push(S[c]);return A}Pi.registerClass(Uw);const GI=Uw;var A0=Pi.prototype,Ms=sl.prototype,WI=re,XI=Math.floor,YI=Math.ceil,$l=Math.pow,kr=Math.log,sg=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="log",r.base=10,r._originalScale=new sl,r._interval=0,r}return e.prototype.getTicks=function(r){var i=this._originalScale,n=this._extent,a=i.getExtent(),o=Ms.getTicks.call(this,r);return K(o,function(s){var l=s.value,u=re($l(this.base,l));return u=l===n[0]&&this._fixMin?Zl(u,a[0]):u,u=l===n[1]&&this._fixMax?Zl(u,a[1]):u,{value:u}},this)},e.prototype.setExtent=function(r,i){var n=kr(this.base);r=kr(Math.max(0,r))/n,i=kr(Math.max(0,i))/n,Ms.setExtent.call(this,r,i)},e.prototype.getExtent=function(){var r=this.base,i=A0.getExtent.call(this);i[0]=$l(r,i[0]),i[1]=$l(r,i[1]);var n=this._originalScale,a=n.getExtent();return this._fixMin&&(i[0]=Zl(i[0],a[0])),this._fixMax&&(i[1]=Zl(i[1],a[1])),i},e.prototype.unionExtent=function(r){this._originalScale.unionExtent(r);var i=this.base;r[0]=kr(r[0])/kr(i),r[1]=kr(r[1])/kr(i),A0.unionExtent.call(this,r)},e.prototype.unionExtentFromData=function(r,i){this.unionExtent(r.getApproximateExtent(i))},e.prototype.calcNiceTicks=function(r){r=r||10;var i=this._extent,n=i[1]-i[0];if(!(n===1/0||n<=0)){var a=eC(n),o=r/n*a;for(o<=.5&&(a*=10);!isNaN(a)&&Math.abs(a)<1&&Math.abs(a)>0;)a*=10;var s=[re(YI(i[0]/a)*a),re(XI(i[1]/a)*a)];this._interval=a,this._niceExtent=s}},e.prototype.calcNiceExtent=function(r){Ms.calcNiceExtent.call(this,r),this._fixMin=r.fixMin,this._fixMax=r.fixMax},e.prototype.parse=function(r){return r},e.prototype.contain=function(r){return r=kr(r)/kr(this.base),dh(r,this._extent)},e.prototype.normalize=function(r){return r=kr(r)/kr(this.base),ph(r,this._extent)},e.prototype.scale=function(r){return r=gh(r,this._extent),$l(this.base,r)},e.type="log",e}(Pi),Hw=sg.prototype;Hw.getMinorTicks=Ms.getMinorTicks;Hw.getLabel=Ms.getLabel;function Zl(t,e){return WI(t,Ti(e))}Pi.registerClass(sg);const $I=sg;var ZI=function(){function t(e,r,i){this._prepareParams(e,r,i)}return t.prototype._prepareParams=function(e,r,i){i[1]<i[0]&&(i=[NaN,NaN]),this._dataMin=i[0],this._dataMax=i[1];var n=this._isOrdinal=e.type==="ordinal";this._needCrossZero=e.type==="interval"&&r.getNeedCrossZero&&r.getNeedCrossZero();var a=this._modelMinRaw=r.get("min",!0);ct(a)?this._modelMinNum=ql(e,a({min:i[0],max:i[1]})):a!=="dataMin"&&(this._modelMinNum=ql(e,a));var o=this._modelMaxRaw=r.get("max",!0);if(ct(o)?this._modelMaxNum=ql(e,o({min:i[0],max:i[1]})):o!=="dataMax"&&(this._modelMaxNum=ql(e,o)),n)this._axisDataLen=r.getCategories().length;else{var s=r.get("boundaryGap"),l=X(s)?s:[s||0,s||0];typeof l[0]=="boolean"||typeof l[1]=="boolean"?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[Ci(l[0],1),Ci(l[1],1)]}},t.prototype.calculate=function(){var e=this._isOrdinal,r=this._dataMin,i=this._dataMax,n=this._axisDataLen,a=this._boundaryGapInner,o=e?null:i-r||Math.abs(r),s=this._modelMinRaw==="dataMin"?r:this._modelMinNum,l=this._modelMaxRaw==="dataMax"?i:this._modelMaxNum,u=s!=null,f=l!=null;s==null&&(s=e?n?0:NaN:r-a[0]*o),l==null&&(l=e?n?n-1:NaN:i+a[1]*o),(s==null||!isFinite(s))&&(s=NaN),(l==null||!isFinite(l))&&(l=NaN);var h=Gu(s)||Gu(l)||e&&!n;this._needCrossZero&&(s>0&&l>0&&!u&&(s=0),s<0&&l<0&&!f&&(l=0));var v=this._determinedMin,c=this._determinedMax;return v!=null&&(s=v,u=!0),c!=null&&(l=c,f=!0),{min:s,max:l,minFixed:u,maxFixed:f,isBlank:h}},t.prototype.modifyDataMinMax=function(e,r){this[KI[e]]=r},t.prototype.setDeterminedMinMax=function(e,r){var i=qI[e];this[i]=r},t.prototype.freeze=function(){this.frozen=!0},t}(),qI={min:"_determinedMin",max:"_determinedMax"},KI={min:"_dataMin",max:"_dataMax"};function Vw(t,e,r){var i=t.rawExtentInfo;return i||(i=new ZI(t,e,r),t.rawExtentInfo=i,i)}function ql(t,e){return e==null?null:Gu(e)?NaN:t.parse(e)}function Gw(t,e){var r=t.type,i=Vw(t,e,t.getExtent()).calculate();t.setBlank(i.isBlank);var n=i.min,a=i.max,o=e.ecModel;if(o&&r==="time"){var s=MI("bar",o),l=!1;if(M(s,function(h){l=l||h.getBaseAxis()===e.axis}),l){var u=LI(s),f=jI(n,a,e,u);n=f.min,a=f.max}}return{extent:[n,a],fixMin:i.minFixed,fixMax:i.maxFixed}}function jI(t,e,r,i){var n=r.axis.getExtent(),a=n[1]-n[0],o=PI(i,r.axis);if(o===void 0)return{min:t,max:e};var s=1/0;M(o,function(c){s=Math.min(c.offset,s)});var l=-1/0;M(o,function(c){l=Math.max(c.offset+c.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,f=e-t,h=1-(s+l)/a,v=f/h-f;return e+=v*(l/u),t-=v*(s/u),{min:t,max:e}}function Sd(t,e){var r=e,i=Gw(t,r),n=i.extent,a=r.get("splitNumber");t instanceof $I&&(t.base=r.get("logBase"));var o=t.type,s=r.get("interval"),l=o==="interval"||o==="time";t.setExtent(n[0],n[1]),t.calcNiceExtent({splitNumber:a,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:l?r.get("minInterval"):null,maxInterval:l?r.get("maxInterval"):null}),s!=null&&t.setInterval&&t.setInterval(s)}function Ww(t,e){if(e=e||t.get("type"),e)switch(e){case"category":return new Ow({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new GI({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(Pi.getClass(e)||sl)}}function QI(t){var e=t.scale.getExtent(),r=e[0],i=e[1];return!(r>0&&i>0||r<0&&i<0)}function ll(t){var e=t.getLabelModel().get("formatter"),r=t.type==="category"?t.scale.getExtent()[0]:null;return t.scale.type==="time"?function(i){return function(n,a){return t.scale.getFormattedLabel(n,a,i)}}(e):Z(e)?function(i){return function(n){var a=t.scale.getLabel(n),o=i.replace("{value}",a??"");return o}}(e):ct(e)?function(i){return function(n,a){return r!=null&&(a=n.value-r),i(lg(t,n),a,n.level!=null?{level:n.level}:null)}}(e):function(i){return t.scale.getLabel(i)}}function lg(t,e){return t.type==="category"?t.scale.getLabel(e):e.value}function JI(t){var e=t.model,r=t.scale;if(!(!e.get(["axisLabel","show"])||r.isBlank())){var i,n,a=r.getExtent();r instanceof Ow?n=r.count():(i=r.getTicks(),n=i.length);var o=t.getLabelModel(),s=ll(t),l,u=1;n>40&&(u=Math.ceil(n/40));for(var f=0;f<n;f+=u){var h=i?i[f]:{value:a[0]+f},v=s(h,f),c=o.getTextRect(v),d=tN(c,o.get("rotate")||0);l?l.union(d):l=d}return l}}function tN(t,e){var r=e*Math.PI/180,i=t.width,n=t.height,a=i*Math.abs(Math.cos(r))+Math.abs(n*Math.sin(r)),o=i*Math.abs(Math.sin(r))+Math.abs(n*Math.cos(r)),s=new Nt(t.x,t.y,a,o);return s}function ug(t){var e=t.get("interval");return e??"auto"}function Xw(t){return t.type==="category"&&ug(t.getLabelModel())===0}function Yw(t,e){var r={};return M(t.mapDimensionsAll(e),function(i){r[Rw(t,i)]=!0}),yt(r)}function eN(t,e,r){e&&M(Yw(e,r),function(i){var n=e.getApproximateExtent(i);n[0]<t[0]&&(t[0]=n[0]),n[1]>t[1]&&(t[1]=n[1])})}var $w=function(){function t(){}return t.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},t.prototype.getCoordSysModel=function(){},t}(),rN={isDimensionStacked:vo,enableDataStack:Lw,getStackedDimension:Rw};function iN(t,e){var r=e;e instanceof Te||(r=new Te(e));var i=Ww(r);return i.setExtent(t[0],t[1]),Sd(i,r),i}function nN(t){qr(t,$w)}var E0=[],aN={registerPreprocessor:ng,registerProcessor:yw,registerPostInit:xw,registerPostUpdate:Tw,registerUpdateLifecycle:ag,registerAction:da,registerCoordinateSystem:GP,registerLayout:XP,registerVisual:pa,registerTransform:$P,registerLoading:Sw,registerMap:YP,registerImpl:wP,PRIORITY:BP,ComponentModel:Vt,ComponentView:vr,SeriesModel:co,ChartView:Ai,registerComponentModel:function(t){Vt.registerClass(t)},registerComponentView:function(t){vr.registerClass(t)},registerSeriesModel:function(t){co.registerClass(t)},registerChartView:function(t){Ai.registerClass(t)},registerSubTypeDefaulter:function(t,e){Vt.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){jE(t,e)}};function nr(t){if(X(t)){M(t,function(e){nr(e)});return}Dt(E0,t)>=0||(E0.push(t),ct(t)&&(t={install:t}),t.install(aN))}var Ws=Kt();function oN(t){return t.type==="category"?lN(t):fN(t)}function sN(t,e){return t.type==="category"?uN(t,e):{ticks:K(t.scale.getTicks(),function(r){return r.value})}}function lN(t){var e=t.getLabelModel(),r=Zw(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:r.labelCategoryInterval}:r}function Zw(t,e){var r=qw(t,"labels"),i=ug(e),n=Kw(r,i);if(n)return n;var a,o;return ct(i)?a=Jw(t,i):(o=i==="auto"?hN(t):i,a=Qw(t,o)),jw(r,i,{labels:a,labelCategoryInterval:o})}function uN(t,e){var r=qw(t,"ticks"),i=ug(e),n=Kw(r,i);if(n)return n;var a,o;if((!e.get("show")||t.scale.isBlank())&&(a=[]),ct(i))a=Jw(t,i,!0);else if(i==="auto"){var s=Zw(t,t.getLabelModel());o=s.labelCategoryInterval,a=K(s.labels,function(l){return l.tickValue})}else o=i,a=Qw(t,o,!0);return jw(r,i,{ticks:a,tickCategoryInterval:o})}function fN(t){var e=t.scale.getTicks(),r=ll(t);return{labels:K(e,function(i,n){return{level:i.level,formattedLabel:r(i,n),rawLabel:t.scale.getLabel(i),tickValue:i.value}})}}function qw(t,e){return Ws(t)[e]||(Ws(t)[e]=[])}function Kw(t,e){for(var r=0;r<t.length;r++)if(t[r].key===e)return t[r].value}function jw(t,e,r){return t.push({key:e,value:r}),r}function hN(t){var e=Ws(t).autoInterval;return e??(Ws(t).autoInterval=t.calculateCategoryInterval())}function cN(t){var e=vN(t),r=ll(t),i=(e.axisRotate-e.labelRotate)/180*Math.PI,n=t.scale,a=n.getExtent(),o=n.count();if(a[1]-a[0]<1)return 0;var s=1;o>40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=t.dataToCoord(l+1)-t.dataToCoord(l),f=Math.abs(u*Math.cos(i)),h=Math.abs(u*Math.sin(i)),v=0,c=0;l<=a[1];l+=s){var d=0,p=0,g=dp(r({value:l}),e.font,"center","top");d=g.width*1.3,p=g.height*1.3,v=Math.max(v,d,7),c=Math.max(c,p,7)}var m=v/f,_=c/h;isNaN(m)&&(m=1/0),isNaN(_)&&(_=1/0);var y=Math.max(0,Math.floor(Math.min(m,_))),x=Ws(t.model),S=t.getExtent(),T=x.lastAutoInterval,b=x.lastTickCount;return T!=null&&b!=null&&Math.abs(T-y)<=1&&Math.abs(b-o)<=1&&T>y&&x.axisExtent0===S[0]&&x.axisExtent1===S[1]?y=T:(x.lastTickCount=o,x.lastAutoInterval=y,x.axisExtent0=S[0],x.axisExtent1=S[1]),y}function vN(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function Qw(t,e,r){var i=ll(t),n=t.scale,a=n.getExtent(),o=t.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=a[0],f=n.count();u!==0&&l>1&&f/l>2&&(u=Math.round(Math.ceil(u/l)*l));var h=Xw(t),v=o.get("showMinLabel")||h,c=o.get("showMaxLabel")||h;v&&u!==a[0]&&p(a[0]);for(var d=u;d<=a[1];d+=l)p(d);c&&d-l!==a[1]&&p(a[1]);function p(g){var m={value:g};s.push(r?g:{formattedLabel:i(m),rawLabel:n.getLabel(m),tickValue:g})}return s}function Jw(t,e,r){var i=t.scale,n=ll(t),a=[];return M(i.getTicks(),function(o){var s=i.getLabel(o),l=o.value;e(o.value,s)&&a.push(r?l:{formattedLabel:n(o),rawLabel:s,tickValue:l})}),a}var C0=[0,1],dN=function(){function t(e,r,i){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=r,this._extent=i||[0,0]}return t.prototype.contain=function(e){var r=this._extent,i=Math.min(r[0],r[1]),n=Math.max(r[0],r[1]);return e>=i&&e<=n},t.prototype.containData=function(e){return this.scale.contain(e)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(e){return $x(e||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(e,r){var i=this._extent;i[0]=e,i[1]=r},t.prototype.dataToCoord=function(e,r){var i=this._extent,n=this.scale;return e=n.normalize(e),this.onBand&&n.type==="ordinal"&&(i=i.slice(),M0(i,n.count())),ae(e,C0,i,r)},t.prototype.coordToData=function(e,r){var i=this._extent,n=this.scale;this.onBand&&n.type==="ordinal"&&(i=i.slice(),M0(i,n.count()));var a=ae(e,i,C0,r);return this.scale.scale(a)},t.prototype.pointToData=function(e,r){},t.prototype.getTicksCoords=function(e){e=e||{};var r=e.tickModel||this.getTickModel(),i=sN(this,r),n=i.ticks,a=K(n,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return pN(this,a,o,e.clamp),a},t.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var e=this.model.getModel("minorTick"),r=e.get("splitNumber");r>0&&r<100||(r=5);var i=this.scale.getMinorTicks(r),n=K(i,function(a){return K(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return n},t.prototype.getViewLabels=function(){return oN(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var e=this._extent,r=this.scale.getExtent(),i=r[1]-r[0]+(this.onBand?1:0);i===0&&(i=1);var n=Math.abs(e[1]-e[0]);return Math.abs(n)/i},t.prototype.calculateCategoryInterval=function(){return cN(this)},t}();function M0(t,e){var r=t[1]-t[0],i=e,n=r/i/2;t[0]+=n,t[1]-=n}function pN(t,e,r,i){var n=e.length;if(!t.onBand||r||!n)return;var a=t.getExtent(),o,s;if(n===1)e[0].coord=a[0],o=e[1]={coord:a[1]};else{var l=e[n-1].tickValue-e[0].tickValue,u=(e[n-1].coord-e[0].coord)/l;M(e,function(c){c.coord-=u/2});var f=t.scale.getExtent();s=1+f[1]-e[n-1].tickValue,o={coord:e[n-1].coord+u*s},e.push(o)}var h=a[0]>a[1];v(e[0].coord,a[0])&&(i?e[0].coord=a[0]:e.shift()),i&&v(a[0],e[0].coord)&&e.unshift({coord:a[0]}),v(a[1],o.coord)&&(i?o.coord=a[1]:e.pop()),i&&v(o.coord,a[1])&&e.push({coord:a[1]});function v(c,d){return c=re(c),d=re(d),h?c>d:c<d}}const fg=dN;var Xo=Math.PI*2,Ln=Mi.CMD,gN=["top","right","bottom","left"];function mN(t,e,r,i,n){var a=r.width,o=r.height;switch(t){case"top":i.set(r.x+a/2,r.y-e),n.set(0,-1);break;case"bottom":i.set(r.x+a/2,r.y+o+e),n.set(0,1);break;case"left":i.set(r.x-e,r.y+o/2),n.set(-1,0);break;case"right":i.set(r.x+a+e,r.y+o/2),n.set(1,0);break}}function _N(t,e,r,i,n,a,o,s,l){o-=t,s-=e;var u=Math.sqrt(o*o+s*s);o/=u,s/=u;var f=o*r+t,h=s*r+e;if(Math.abs(i-n)%Xo<1e-4)return l[0]=f,l[1]=h,u-r;if(a){var v=i;i=Si(n),n=Si(v)}else i=Si(i),n=Si(n);i>n&&(n+=Xo);var c=Math.atan2(s,o);if(c<0&&(c+=Xo),c>=i&&c<=n||c+Xo>=i&&c+Xo<=n)return l[0]=f,l[1]=h,u-r;var d=r*Math.cos(i)+t,p=r*Math.sin(i)+e,g=r*Math.cos(n)+t,m=r*Math.sin(n)+e,_=(d-o)*(d-o)+(p-s)*(p-s),y=(g-o)*(g-o)+(m-s)*(m-s);return _<y?(l[0]=d,l[1]=p,Math.sqrt(_)):(l[0]=g,l[1]=m,Math.sqrt(y))}function wd(t,e,r,i,n,a,o,s){var l=n-t,u=a-e,f=r-t,h=i-e,v=Math.sqrt(f*f+h*h);f/=v,h/=v;var c=l*f+u*h,d=c/v;s&&(d=Math.min(Math.max(d,0),1)),d*=v;var p=o[0]=t+d*f,g=o[1]=e+d*h;return Math.sqrt((p-n)*(p-n)+(g-a)*(g-a))}function t2(t,e,r,i,n,a,o){r<0&&(t=t+r,r=-r),i<0&&(e=e+i,i=-i);var s=t+r,l=e+i,u=o[0]=Math.min(Math.max(n,t),s),f=o[1]=Math.min(Math.max(a,e),l);return Math.sqrt((u-n)*(u-n)+(f-a)*(f-a))}var Wr=[];function yN(t,e,r){var i=t2(e.x,e.y,e.width,e.height,t.x,t.y,Wr);return r.set(Wr[0],Wr[1]),i}function xN(t,e,r){for(var i=0,n=0,a=0,o=0,s,l,u=1/0,f=e.data,h=t.x,v=t.y,c=0;c<f.length;){var d=f[c++];c===1&&(i=f[c],n=f[c+1],a=i,o=n);var p=u;switch(d){case Ln.M:a=f[c++],o=f[c++],i=a,n=o;break;case Ln.L:p=wd(i,n,f[c],f[c+1],h,v,Wr,!0),i=f[c++],n=f[c++];break;case Ln.C:p=Ex(i,n,f[c++],f[c++],f[c++],f[c++],f[c],f[c+1],h,v,Wr),i=f[c++],n=f[c++];break;case Ln.Q:p=Mx(i,n,f[c++],f[c++],f[c],f[c+1],h,v,Wr),i=f[c++],n=f[c++];break;case Ln.A:var g=f[c++],m=f[c++],_=f[c++],y=f[c++],x=f[c++],S=f[c++];c+=1;var T=!!(1-f[c++]);s=Math.cos(x)*_+g,l=Math.sin(x)*y+m,c<=1&&(a=s,o=l);var b=(h-g)*y/_+g;p=_N(g,m,y,x,x+S,T,b,v,Wr),i=Math.cos(x+S)*_+g,n=Math.sin(x+S)*y+m;break;case Ln.R:a=i=f[c++],o=n=f[c++];var w=f[c++],A=f[c++];p=t2(a,o,w,A,h,v,Wr);break;case Ln.Z:p=wd(i,n,a,o,h,v,Wr,!0),i=a,n=o;break}p<u&&(u=p,r.set(Wr[0],Wr[1]))}return u}var Kn=new wt,Ae=new wt,lr=new wt,to=new wt,Yo=new wt;function D0(t,e){if(t){var r=t.getTextGuideLine(),i=t.getTextContent();if(i&&r){var n=t.textGuideLineConfig||{},a=[[0,0],[0,0],[0,0]],o=n.candidates||gN,s=i.getBoundingRect().clone();s.applyTransform(i.getComputedTransform());var l=1/0,u=n.anchor,f=t.getComputedTransform(),h=f&&Uf([],f),v=e.get("length2")||0;u&&lr.copy(u);for(var c=0;c<o.length;c++){var d=o[c];mN(d,0,s,Kn,to),wt.scaleAndAdd(Ae,Kn,to,v),Ae.transform(h);var p=t.getBoundingRect(),g=u?u.distance(Ae):t instanceof Ht?xN(Ae,t.path,lr):yN(Ae,p,lr);g<l&&(l=g,Ae.transform(f),lr.transform(f),lr.toArray(a[0]),Ae.toArray(a[1]),Kn.toArray(a[2]))}TN(a,e.get("minTurnAngle")),r.setShape({points:a})}}}var L0=[],Rn=new wt;function TN(t,e){if(e<=180&&e>0){e=e/180*Math.PI,Kn.fromArray(t[0]),Ae.fromArray(t[1]),lr.fromArray(t[2]),wt.sub(to,Kn,Ae),wt.sub(Yo,lr,Ae);var r=to.len(),i=Yo.len();if(!(r<.001||i<.001)){to.scale(1/r),Yo.scale(1/i);var n=to.dot(Yo),a=Math.cos(e);if(a<n){var o=wd(Ae.x,Ae.y,lr.x,lr.y,Kn.x,Kn.y,L0,!1);Rn.fromArray(L0),Rn.scaleAndAdd(Yo,o/Math.tan(Math.PI-e));var s=lr.x!==Ae.x?(Rn.x-Ae.x)/(lr.x-Ae.x):(Rn.y-Ae.y)/(lr.y-Ae.y);if(isNaN(s))return;s<0?wt.copy(Rn,Ae):s>1&&wt.copy(Rn,lr),Rn.toArray(t[1])}}}}function R0(t,e,r,i){var n=r==="normal",a=n?t:t.ensureState(r);a.ignore=e;var o=i.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=i.getModel("lineStyle").getLineStyle();n?t.useStyle(s):a.style=s}function SN(t,e){var r=e.smooth,i=e.points;if(i)if(t.moveTo(i[0][0],i[0][1]),r>0&&i.length>=3){var n=Nv(i[0],i[1]),a=Nv(i[1],i[2]);if(!n||!a){t.lineTo(i[1][0],i[1][1]),t.lineTo(i[2][0],i[2][1]);return}var o=Math.min(n,a)*r,s=Ch([],i[1],i[0],o/n),l=Ch([],i[1],i[2],o/a),u=Ch([],s,l,.5);t.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),t.bezierCurveTo(l[0],l[1],l[0],l[1],i[2][0],i[2][1])}else for(var f=1;f<i.length;f++)t.lineTo(i[f][0],i[f][1])}function wN(t,e,r){var i=t.getTextGuideLine(),n=t.getTextContent();if(!n){i&&t.removeTextGuideLine();return}for(var a=e.normal,o=a.get("show"),s=n.ignore,l=0;l<nf.length;l++){var u=nf[l],f=e[u],h=u==="normal";if(f){var v=f.get("show"),c=h?s:mt(n.states[u]&&n.states[u].ignore,s);if(c||!mt(v,o)){var d=h?i:i&&i.states[u];d&&(d.ignore=!0);continue}i||(i=new Qf,t.setTextGuideLine(i),!h&&(s||!o)&&R0(i,!0,"normal",e.normal),t.stateProxy&&(i.stateProxy=t.stateProxy)),R0(i,!1,u,f)}}if(i){Lt(i.style,r),i.style.fill=null;var p=a.get("showAbove"),g=t.textGuideLineConfig=t.textGuideLineConfig||{};g.showAbove=p||!1,i.buildPath=SN}}function bN(t,e){e=e||"labelLine";for(var r={normal:t.getModel(e)},i=0;i<Pr.length;i++){var n=Pr[i];r[n]=t.getModel([n,e])}return r}function e2(t){for(var e=[],r=0;r<t.length;r++){var i=t[r];if(!i.defaultAttr.ignore){var n=i.label,a=n.getComputedTransform(),o=n.getBoundingRect(),s=!a||a[1]<1e-5&&a[2]<1e-5,l=n.style.margin||0,u=o.clone();u.applyTransform(a),u.x-=l/2,u.y-=l/2,u.width+=l,u.height+=l;var f=s?new lf(o,a):null;e.push({label:n,labelLine:i.labelLine,rect:u,localRect:o,obb:f,priority:i.priority,defaultAttr:i.defaultAttr,layoutOption:i.computedLayoutOption,axisAligned:s,transform:a})}}return e}function r2(t,e,r,i,n,a){var o=t.length;if(o<2)return;t.sort(function(w,A){return w.rect[e]-A.rect[e]});for(var s=0,l,u=!1,f=0,h=0;h<o;h++){var v=t[h],c=v.rect;l=c[e]-s,l<0&&(c[e]-=l,v.label[e]-=l,u=!0);var d=Math.max(-l,0);f+=d,s=c[e]+c[r]}f>0&&a&&S(-f/o,0,o);var p=t[0],g=t[o-1],m,_;y(),m<0&&T(-m,.8),_<0&&T(_,.8),y(),x(m,_,1),x(_,m,-1),y(),m<0&&b(-m),_<0&&b(_);function y(){m=p.rect[e]-i,_=n-g.rect[e]-g.rect[r]}function x(w,A,C){if(w<0){var E=Math.min(A,-w);if(E>0){S(E*C,0,o);var D=E+w;D<0&&T(-D*C,1)}else T(-w*C,1)}}function S(w,A,C){w!==0&&(u=!0);for(var E=A;E<C;E++){var D=t[E],L=D.rect;L[e]+=w,D.label[e]+=w}}function T(w,A){for(var C=[],E=0,D=1;D<o;D++){var L=t[D-1].rect,R=Math.max(t[D].rect[e]-L[e]-L[r],0);C.push(R),E+=R}if(E){var N=Math.min(Math.abs(w)/E,A);if(w>0)for(var D=0;D<o-1;D++){var I=C[D]*N;S(I,0,D+1)}else for(var D=o-1;D>0;D--){var I=C[D-1]*N;S(-I,D,o)}}}function b(w){var A=w<0?-1:1;w=Math.abs(w);for(var C=Math.ceil(w/(o-1)),E=0;E<o-1;E++)if(A>0?S(C,0,E+1):S(-C,o-E-1,o),w-=C,w<=0)return}return u}function AN(t,e,r,i){return r2(t,"x","width",e,r,i)}function EN(t,e,r,i){return r2(t,"y","height",e,r,i)}function i2(t){var e=[];t.sort(function(p,g){return g.priority-p.priority});var r=new Nt(0,0,0,0);function i(p){if(!p.ignore){var g=p.ensureState("emphasis");g.ignore==null&&(g.ignore=!1)}p.ignore=!0}for(var n=0;n<t.length;n++){var a=t[n],o=a.axisAligned,s=a.localRect,l=a.transform,u=a.label,f=a.labelLine;r.copy(a.rect),r.width-=.1,r.height-=.1,r.x+=.05,r.y+=.05;for(var h=a.obb,v=!1,c=0;c<e.length;c++){var d=e[c];if(r.intersect(d.rect)){if(o&&d.axisAligned){v=!0;break}if(d.obb||(d.obb=new lf(d.localRect,d.transform)),h||(h=new lf(s,l)),h.intersect(d.obb)){v=!0;break}}}v?(i(u),f&&i(f)):(u.attr("ignore",a.defaultAttr.ignore),f&&f.attr("ignore",a.defaultAttr.labelGuideIgnore),e.push(a))}}function CN(t){if(t){for(var e=[],r=0;r<t.length;r++)e.push(t[r].slice());return e}}function MN(t,e){var r=t.label,i=e&&e.getTextGuideLine();return{dataIndex:t.dataIndex,dataType:t.dataType,seriesIndex:t.seriesModel.seriesIndex,text:t.label.style.text,rect:t.hostRect,labelRect:t.rect,align:r.style.align,verticalAlign:r.style.verticalAlign,labelLinePoints:CN(i&&i.shape.points)}}var P0=["align","verticalAlign","width","height","fontSize"],Fe=new Gf,Oc=Kt(),DN=Kt();function Kl(t,e,r){for(var i=0;i<r.length;i++){var n=r[i];e[n]!=null&&(t[n]=e[n])}}var jl=["x","y","rotation"],LN=function(){function t(){this._labelList=[],this._chartViewList=[]}return t.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},t.prototype._addLabel=function(e,r,i,n,a){var o=n.style,s=n.__hostTarget,l=s.textConfig||{},u=n.getComputedTransform(),f=n.getBoundingRect().plain();Nt.applyTransform(f,f,u),u?Fe.setLocalTransform(u):(Fe.x=Fe.y=Fe.rotation=Fe.originX=Fe.originY=0,Fe.scaleX=Fe.scaleY=1),Fe.rotation=Si(Fe.rotation);var h=n.__hostTarget,v;if(h){v=h.getBoundingRect().plain();var c=h.getComputedTransform();Nt.applyTransform(v,v,c)}var d=v&&h.getTextGuideLine();this._labelList.push({label:n,labelLine:d,seriesModel:i,dataIndex:e,dataType:r,layoutOption:a,computedLayoutOption:null,rect:f,hostRect:v,priority:v?v.width*v.height:0,defaultAttr:{ignore:n.ignore,labelGuideIgnore:d&&d.ignore,x:Fe.x,y:Fe.y,scaleX:Fe.scaleX,scaleY:Fe.scaleY,rotation:Fe.rotation,style:{x:o.x,y:o.y,align:o.align,verticalAlign:o.verticalAlign,width:o.width,height:o.height,fontSize:o.fontSize},cursor:n.cursor,attachedPos:l.position,attachedRot:l.rotation}})},t.prototype.addLabelsOfSeries=function(e){var r=this;this._chartViewList.push(e);var i=e.__model,n=i.get("labelLayout");(ct(n)||yt(n).length)&&e.group.traverse(function(a){if(a.ignore)return!0;var o=a.getTextContent(),s=kt(a);o&&!o.disableLabelLayout&&r._addLabel(s.dataIndex,s.dataType,i,o,n)})},t.prototype.updateLayoutConfig=function(e){var r=e.getWidth(),i=e.getHeight();function n(y,x){return function(){D0(y,x)}}for(var a=0;a<this._labelList.length;a++){var o=this._labelList[a],s=o.label,l=s.__hostTarget,u=o.defaultAttr,f=void 0;ct(o.layoutOption)?f=o.layoutOption(MN(o,l)):f=o.layoutOption,f=f||{},o.computedLayoutOption=f;var h=Math.PI/180;l&&l.setTextConfig({local:!1,position:f.x!=null||f.y!=null?null:u.attachedPos,rotation:f.rotate!=null?f.rotate*h:u.attachedRot,offset:[f.dx||0,f.dy||0]});var v=!1;if(f.x!=null?(s.x=ve(f.x,r),s.setStyle("x",0),v=!0):(s.x=u.x,s.setStyle("x",u.style.x)),f.y!=null?(s.y=ve(f.y,i),s.setStyle("y",0),v=!0):(s.y=u.y,s.setStyle("y",u.style.y)),f.labelLinePoints){var c=l.getTextGuideLine();c&&(c.setShape({points:f.labelLinePoints}),v=!1)}var d=Oc(s);d.needsUpdateLabelLine=v,s.rotation=f.rotate!=null?f.rotate*h:u.rotation,s.scaleX=u.scaleX,s.scaleY=u.scaleY;for(var p=0;p<P0.length;p++){var g=P0[p];s.setStyle(g,f[g]!=null?f[g]:u.style[g])}if(f.draggable){if(s.draggable=!0,s.cursor="move",l){var m=o.seriesModel;if(o.dataIndex!=null){var _=o.seriesModel.getData(o.dataType);m=_.getItemModel(o.dataIndex)}s.on("drag",n(l,m.getModel("labelLine")))}}else s.off("drag"),s.cursor=u.cursor}},t.prototype.layout=function(e){var r=e.getWidth(),i=e.getHeight(),n=e2(this._labelList),a=ce(n,function(l){return l.layoutOption.moveOverlap==="shiftX"}),o=ce(n,function(l){return l.layoutOption.moveOverlap==="shiftY"});AN(a,0,r),EN(o,0,i);var s=ce(n,function(l){return l.layoutOption.hideOverlap});i2(s)},t.prototype.processLabelsOverall=function(){var e=this;M(this._chartViewList,function(r){var i=r.__model,n=r.ignoreLabelLineUpdate,a=i.isAnimationEnabled();r.group.traverse(function(o){if(o.ignore&&!o.forceLabelAnimation)return!0;var s=!n,l=o.getTextContent();!s&&l&&(s=Oc(l).needsUpdateLabelLine),s&&e._updateLabelLine(o,i),a&&e._animateLabels(o,i)})})},t.prototype._updateLabelLine=function(e,r){var i=e.getTextContent(),n=kt(e),a=n.dataIndex;if(i&&a!=null){var o=r.getData(n.dataType),s=o.getItemModel(a),l={},u=o.getItemVisual(a,"style");if(u){var f=o.getVisual("drawType");l.stroke=u[f]}var h=s.getModel("labelLine");wN(e,bN(s),l),D0(e,h)}},t.prototype._animateLabels=function(e,r){var i=e.getTextContent(),n=e.getTextGuideLine();if(i&&(e.forceLabelAnimation||!i.ignore&&!i.invisible&&!e.disableLabelAnimation&&!ao(e))){var a=Oc(i),o=a.oldLayout,s=kt(e),l=s.dataIndex,u={x:i.x,y:i.y,rotation:i.rotation},f=r.getData(s.dataType);if(o){i.attr(o);var v=e.prevStates;v&&(Dt(v,"select")>=0&&i.attr(a.oldLayoutSelect),Dt(v,"emphasis")>=0&&i.attr(a.oldLayoutEmphasis)),Ir(i,u,r,l)}else if(i.attr(u),!eh(i).valueAnimation){var h=mt(i.style.opacity,1);i.style.opacity=0,an(i,{style:{opacity:h}},r,l)}if(a.oldLayout=u,i.states.select){var c=a.oldLayoutSelect={};Kl(c,u,jl),Kl(c,i.states.select,jl)}if(i.states.emphasis){var d=a.oldLayoutEmphasis={};Kl(d,u,jl),Kl(d,i.states.emphasis,jl)}OD(i,l,f,r,r)}if(n&&!n.ignore&&!n.invisible){var a=DN(n),o=a.oldLayout,p={points:n.shape.points};o?(n.attr({shape:o}),Ir(n,{shape:p},r)):(n.setShape(p),n.style.strokePercent=0,an(n,{style:{strokePercent:1}},r)),a.oldLayout=p}},t}();const RN=LN;var Bc=Kt();function PN(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,i){var n=Bc(r).labelManager;n||(n=Bc(r).labelManager=new RN),n.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(e,r,i){var n=Bc(r).labelManager;i.updatedSeries.forEach(function(a){n.addLabelsOfSeries(r.getViewOfSeriesModel(a))}),n.updateLayoutConfig(r),n.layout(r),n.processLabelsOverall()})}var Fc=null;function IN(t){return Fc||(Fc=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){return setTimeout(e,16)}).bind(window)),Fc(t)}var kc=null;function NN(t){kc||(kc=(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(e){clearTimeout(e)}).bind(window)),kc(t)}function ON(t){var e=document.createElement("style");return e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t)),(document.querySelector("head")||document.body).appendChild(e),e}function Ql(t,e){e===void 0&&(e={});var r=document.createElement(t);return Object.keys(e).forEach(function(i){r[i]=e[i]}),r}function n2(t,e,r){var i=window.getComputedStyle(t,r||null)||{display:"none"};return i[e]}function bd(t){if(!document.documentElement.contains(t))return{detached:!0,rendered:!1};for(var e=t;e!==document;){if(n2(e,"display")==="none")return{detached:!1,rendered:!1};e=e.parentNode}return{detached:!1,rendered:!0}}var BN='.resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:"";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}',Ad=0,Lu=null;function FN(t,e){t.__resize_mutation_handler__||(t.__resize_mutation_handler__=UN.bind(t));var r=t.__resize_listeners__;if(!r){if(t.__resize_listeners__=[],window.ResizeObserver){var i=t.offsetWidth,n=t.offsetHeight,a=new ResizeObserver(function(){!t.__resize_observer_triggered__&&(t.__resize_observer_triggered__=!0,t.offsetWidth===i&&t.offsetHeight===n)||wf(t)}),o=bd(t),s=o.detached,l=o.rendered;t.__resize_observer_triggered__=s===!1&&l===!1,t.__resize_observer__=a,a.observe(t)}else if(t.attachEvent&&t.addEventListener)t.__resize_legacy_resize_handler__=function(){wf(t)},t.attachEvent("onresize",t.__resize_legacy_resize_handler__),document.addEventListener("DOMSubtreeModified",t.__resize_mutation_handler__);else if(Ad||(Lu=ON(BN)),HN(t),t.__resize_rendered__=bd(t).rendered,window.MutationObserver){var u=new MutationObserver(t.__resize_mutation_handler__);u.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),t.__resize_mutation_observer__=u}}t.__resize_listeners__.push(e),Ad++}function kN(t,e){var r=t.__resize_listeners__;if(r){if(e&&r.splice(r.indexOf(e),1),!r.length||!e){if(t.detachEvent&&t.removeEventListener){t.detachEvent("onresize",t.__resize_legacy_resize_handler__),document.removeEventListener("DOMSubtreeModified",t.__resize_mutation_handler__);return}t.__resize_observer__?(t.__resize_observer__.unobserve(t),t.__resize_observer__.disconnect(),t.__resize_observer__=null):(t.__resize_mutation_observer__&&(t.__resize_mutation_observer__.disconnect(),t.__resize_mutation_observer__=null),t.removeEventListener("scroll",hg),t.removeChild(t.__resize_triggers__.triggers),t.__resize_triggers__=null),t.__resize_listeners__=null}!--Ad&&Lu&&Lu.parentNode.removeChild(Lu)}}function zN(t){var e=t.__resize_last__,r=e.width,i=e.height,n=t.offsetWidth,a=t.offsetHeight;return n!==r||a!==i?{width:n,height:a}:null}function UN(){var t=bd(this),e=t.rendered,r=t.detached;e!==this.__resize_rendered__&&(!r&&this.__resize_triggers__&&(cg(this),this.addEventListener("scroll",hg,!0)),this.__resize_rendered__=e,wf(this))}function hg(){var t=this;cg(this),this.__resize_raf__&&NN(this.__resize_raf__),this.__resize_raf__=IN(function(){var e=zN(t);e&&(t.__resize_last__=e,wf(t))})}function wf(t){!t||!t.__resize_listeners__||t.__resize_listeners__.forEach(function(e){e.call(t,t)})}function HN(t){var e=n2(t,"position");(!e||e==="static")&&(t.style.position="relative"),t.__resize_old_position__=e,t.__resize_last__={};var r=Ql("div",{className:"resize-triggers"}),i=Ql("div",{className:"resize-expand-trigger"}),n=Ql("div"),a=Ql("div",{className:"resize-contract-trigger"});i.appendChild(n),r.appendChild(i),r.appendChild(a),t.appendChild(r),t.__resize_triggers__={triggers:r,expand:i,expandChild:n,contract:a},cg(t),t.addEventListener("scroll",hg,!0),t.__resize_last__={width:t.offsetWidth,height:t.offsetHeight}}function cg(t){var e=t.__resize_triggers__,r=e.expand,i=e.expandChild,n=e.contract,a=n.scrollWidth,o=n.scrollHeight,s=r.offsetWidth,l=r.offsetHeight,u=r.scrollWidth,f=r.scrollHeight;n.scrollLeft=a,n.scrollTop=o,i.style.width=s+1+"px",i.style.height=l+1+"px",r.scrollLeft=u,r.scrollTop=f}var yi=function(){return yi=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},yi.apply(this,arguments)},VN=["getWidth","getHeight","getDom","getOption","resize","dispatchAction","convertToPixel","convertFromPixel","containPixel","getDataURL","getConnectedDataURL","appendData","clear","isDisposed","dispose"];function GN(t){return e=Object.create(null),VN.forEach(function(r){e[r]=function(i){return function(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(!t.value)throw new Error("ECharts is not initialized yet.");return t.value[i].apply(t.value,n)}}(r)}),e;var e}var WN={autoresize:[Boolean,Object]},XN=/^on[^a-z]/,YN=function(t){return XN.test(t)};function Jl(t,e){var r=iA(t);return r&&typeof r=="object"&&"value"in r?r.value||e:r||e}var $N={loading:Boolean,loadingOptions:Object},$o=null,I0=[],Zo=[];(function(t,e){if(t&&typeof document<"u"){var r,i=e.prepend===!0?"prepend":"append",n=e.singleTag===!0,a=typeof e.container=="string"?document.querySelector(e.container):document.getElementsByTagName("head")[0];if(n){var o=I0.indexOf(a);o===-1&&(o=I0.push(a)-1,Zo[o]={}),r=Zo[o]&&Zo[o][i]?Zo[o][i]:Zo[o][i]=s()}else r=s();t.charCodeAt(0)===65279&&(t=t.substring(1)),r.styleSheet?r.styleSheet.cssText+=t:r.appendChild(document.createTextNode(t))}function s(){var l=document.createElement("style");if(l.setAttribute("type","text/css"),e.attributes)for(var u=Object.keys(e.attributes),f=0;f<u.length;f++)l.setAttribute(u[f],e.attributes[u[f]]);var h=i==="prepend"?"afterbegin":"beforeend";return a.insertAdjacentElement(h,l),l}})(`x-vue-echarts{display:block;width:100%;height:100%;min-width:0}
`,{});var ZN=function(){if($o!=null)return $o;if(typeof HTMLElement>"u"||typeof customElements>"u")return $o=!1;try{new Function("tag",`class EChartsElement extends HTMLElement {
  __dispose = null;

  disconnectedCallback() {
    if (this.__dispose) {
      this.__dispose();
      this.__dispose = null;
    }
  }
}

if (customElements.get(tag) == null) {
  customElements.define(tag, EChartsElement);
}
`)("x-vue-echarts")}catch{return $o=!1}return $o=!0}();Lv&&Lv.config.ignoredElements.push("x-vue-echarts");var BU=Kb({name:"echarts",props:yi(yi({option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean},WN),$N),emits:{},inheritAttrs:!1,setup:function(t,e){var r=e.attrs,i=Ah(),n=Ah(),a=Ah(),o=dl("ecTheme",null),s=dl("ecInitOptions",null),l=dl("ecUpdateOptions",null),u=jb(t),f=u.autoresize,h=u.manualUpdate,v=u.loading,c=u.loadingOptions,d=_a(function(){return a.value||t.option||null}),p=_a(function(){return t.theme||Jl(o,{})}),g=_a(function(){return t.initOptions||Jl(s,{})}),m=_a(function(){return t.updateOptions||Jl(l,{})}),_=_a(function(){return function(w){var A={};for(var C in w)YN(C)||(A[C]=w[C]);return A}(r)}),y=Qb().proxy.$listeners;function x(w){if(i.value){var A=n.value=HP(i.value,p.value,g.value);t.group&&(A.group=t.group);var C=y;C||(C={},Object.keys(r).filter(function(D){return D.indexOf("on")===0&&D.length>2}).forEach(function(D){var L=D.charAt(2).toLowerCase()+D.slice(3);L.substring(L.length-4)==="Once"&&(L="~".concat(L.substring(0,L.length-4))),C[L]=r[D]})),Object.keys(C).forEach(function(D){var L=C[D];if(L){var R=D.toLowerCase();R.charAt(0)==="~"&&(R=R.substring(1),L.__once__=!0);var N=A;if(R.indexOf("zr:")===0&&(N=A.getZr(),R=R.substring(3)),L.__once__){delete L.__once__;var I=L;L=function(){for(var F=[],O=0;O<arguments.length;O++)F[O]=arguments[O];I.apply(void 0,F),N.off(R,L)}}N.on(R,L)}}),f.value?rA(function(){A&&!A.isDisposed()&&A.resize(),E()}):E()}function E(){var D=w||d.value;D&&A.setOption(D,m.value)}}function S(){n.value&&(n.value.dispose(),n.value=void 0)}var T=null;pl(h,function(w){typeof T=="function"&&(T(),T=null),w||(T=pl(function(){return t.option},function(A,C){A&&(n.value?n.value.setOption(A,yi({notMerge:A!==C},m.value)):x())},{deep:!0}))},{immediate:!0}),pl([p,g],function(){S(),x()},{deep:!0}),Gg(function(){t.group&&n.value&&(n.value.group=t.group)});var b=GN(n);return function(w,A,C){var E=dl("ecLoadingOptions",{}),D=_a(function(){return yi(yi({},Jl(E,{})),C==null?void 0:C.value)});Gg(function(){var L=w.value;L&&(A.value?L.showLoading(D.value):L.hideLoading())})}(n,v,c),function(w,A,C){var E=null;pl([C,w,A],function(D,L,R){var N=D[0],I=D[1],F=D[2];if(N&&I&&F){var O=F===!0?{}:F,z=O.throttle,k=z===void 0?100:z,it=O.onResize,$=function(){I.resize(),it==null||it()};E=k?Qp($,k):$,FN(N,E)}R(function(){N&&E&&kN(N,E)})})}(n,f,i),Jb(function(){x()}),tA(function(){ZN&&i.value?i.value.__dispose=S:S()}),yi({chart:n,root:i,setOption:function(w,A){t.manualUpdate&&(a.value=w),n.value?n.value.setOption(w,A||{}):x(w)},nonEventAttrs:_},b)},render:function(){var t=Lv?{attrs:this.nonEventAttrs}:yi({},this.nonEventAttrs);return t.ref="root",t.class=t.class?["echarts"].concat(t.class):"echarts",eA("x-vue-echarts",t)}}),qN=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.hasSymbolVisual=!0,r}return e.prototype.getInitialData=function(r){return _I(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(r){var i=new ue,n=$r("line",0,r.itemHeight/2,r.itemWidth,0,r.lineStyle.stroke,!1);i.add(n),n.setStyle(r.lineStyle);var a=this.getData().getVisual("symbol"),o=this.getData().getVisual("symbolRotate"),s=a==="none"?"circle":a,l=r.itemHeight*.8,u=$r(s,(r.itemWidth-l)/2,(r.itemHeight-l)/2,l,l,r.itemStyle.fill);i.add(u),u.setStyle(r.itemStyle);var f=r.iconRotate==="inherit"?o:r.iconRotate||0;return u.rotation=f*Math.PI/180,u.setOrigin([r.itemWidth/2,r.itemHeight/2]),s.indexOf("empty")>-1&&(u.style.stroke=u.style.fill,u.style.fill="#fff",u.style.lineWidth=2),i},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(co);const KN=qN;function a2(t,e){var r=t.mapDimensionsAll("defaultedLabel"),i=r.length;if(i===1){var n=ho(t,e,r[0]);return n!=null?n+"":null}else if(i){for(var a=[],o=0;o<r.length;o++)a.push(ho(t,e,r[o]));return a.join(" ")}}function jN(t,e){var r=t.mapDimensionsAll("defaultedLabel");if(!X(e))return e+"";for(var i=[],n=0;n<r.length;n++){var a=t.getDimensionIndex(r[n]);a>=0&&i.push(e[a])}return i.join(" ")}var QN=function(t){G(e,t);function e(r,i,n,a){var o=t.call(this)||this;return o.updateData(r,i,n,a),o}return e.prototype._createSymbol=function(r,i,n,a,o){this.removeAll();var s=$r(r,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),s.drift=JN,this._symbolType=r,this.add(s)},e.prototype.stopSymbolAnimation=function(r){this.childAt(0).stopAnimation(null,r)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){af(this.childAt(0))},e.prototype.downplay=function(){of(this.childAt(0))},e.prototype.setZ=function(r,i){var n=this.childAt(0);n.zlevel=r,n.z=i},e.prototype.setDraggable=function(r,i){var n=this.childAt(0);n.draggable=r,n.cursor=!i&&r?"move":n.cursor},e.prototype.updateData=function(r,i,n,a){this.silent=!1;var o=r.getItemVisual(i,"symbol")||"circle",s=r.hostModel,l=e.getSymbolSize(r,i),u=o!==this._symbolType,f=a&&a.disableAnimation;if(u){var h=r.getItemVisual(i,"symbolKeepAspect");this._createSymbol(o,r,i,l,h)}else{var v=this.childAt(0);v.silent=!1;var c={scaleX:l[0]/2,scaleY:l[1]/2};f?v.attr(c):Ir(v,c,s,i),yD(v)}if(this._updateCommon(r,i,l,n,a),u){var v=this.childAt(0);if(!f){var c={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:v.style.opacity}};v.scaleX=v.scaleY=0,v.style.opacity=0,an(v,c,s,i)}}f&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(r,i,n,a,o){var s=this.childAt(0),l=r.hostModel,u,f,h,v,c,d,p,g,m;if(a&&(u=a.emphasisItemStyle,f=a.blurItemStyle,h=a.selectItemStyle,v=a.focus,c=a.blurScope,p=a.labelStatesModels,g=a.hoverScale,m=a.cursorStyle,d=a.emphasisDisabled),!a||r.hasItemOption){var _=a&&a.itemModel?a.itemModel:r.getItemModel(i),y=_.getModel("emphasis");u=y.getModel("itemStyle").getItemStyle(),h=_.getModel(["select","itemStyle"]).getItemStyle(),f=_.getModel(["blur","itemStyle"]).getItemStyle(),v=y.get("focus"),c=y.get("blurScope"),d=y.get("disabled"),p=kp(_),g=y.getShallow("scale"),m=_.getShallow("cursor")}var x=r.getItemVisual(i,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var S=tw(r.getItemVisual(i,"symbolOffset"),n);S&&(s.x=S[0],s.y=S[1]),m&&s.attr("cursor",m);var T=r.getItemVisual(i,"style"),b=T.fill;if(s instanceof Nr){var w=s.style;s.useStyle(U({image:w.image,x:w.x,y:w.y,width:w.width,height:w.height},T))}else s.__isEmptyBrush?s.useStyle(U({},T)):s.useStyle(T),s.style.decal=null,s.setColor(b,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var A=r.getItemVisual(i,"liftZ"),C=this._z2;A!=null?C==null&&(this._z2=s.z2,s.z2+=A):C!=null&&(s.z2=C,this._z2=null);var E=o&&o.useNameLabel;Fp(s,p,{labelFetcher:l,labelDataIndex:i,defaultText:D,inheritColor:b,defaultOpacity:T.opacity});function D(N){return E?r.getName(N):a2(r,N)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var L=s.ensureState("emphasis");L.style=u,s.ensureState("select").style=h,s.ensureState("blur").style=f;var R=g==null||g===!0?Math.max(1.1,3/this._sizeY):isFinite(g)&&g>0?+g:1;L.scaleX=this._sizeX*R,L.scaleY=this._sizeY*R,this.setSymbolScale(1),rd(this,v,c,d)},e.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},e.prototype.fadeOut=function(r,i,n){var a=this.childAt(0),o=kt(this).dataIndex,s=n&&n.animation;if(this.silent=a.silent=!0,n&&n.fadeLabel){var l=a.getTextContent();l&&uf(l,{style:{opacity:0}},i,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();uf(a,{style:{opacity:0},scaleX:0,scaleY:0},i,{dataIndex:o,cb:r,removeOpt:s})},e.getSymbolSize=function(r,i){return aP(r.getItemVisual(i,"symbolSize"))},e}(ue);function JN(t,e){this.parent.drift(t,e)}const vg=QN;function zc(t,e,r,i){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(i.isIgnore&&i.isIgnore(r))&&!(i.clipShape&&!i.clipShape.contain(e[0],e[1]))&&t.getItemVisual(r,"symbol")!=="none"}function N0(t){return t!=null&&!j(t)&&(t={isIgnore:t}),t||{}}function O0(t){var e=t.hostModel,r=e.getModel("emphasis");return{emphasisItemStyle:r.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:r.get("focus"),blurScope:r.get("blurScope"),emphasisDisabled:r.get("disabled"),hoverScale:r.get("scale"),labelStatesModels:kp(e),cursorStyle:e.get("cursor")}}var tO=function(){function t(e){this.group=new ue,this._SymbolCtor=e||vg}return t.prototype.updateData=function(e,r){this._progressiveEls=null,r=N0(r);var i=this.group,n=e.hostModel,a=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=O0(e),u={disableAnimation:s},f=r.getSymbolPoint||function(h){return e.getItemLayout(h)};a||i.removeAll(),e.diff(a).add(function(h){var v=f(h);if(zc(e,v,h,r)){var c=new o(e,h,l,u);c.setPosition(v),e.setItemGraphicEl(h,c),i.add(c)}}).update(function(h,v){var c=a.getItemGraphicEl(v),d=f(h);if(!zc(e,d,h,r)){i.remove(c);return}var p=e.getItemVisual(h,"symbol")||"circle",g=c&&c.getSymbolType&&c.getSymbolType();if(!c||g&&g!==p)i.remove(c),c=new o(e,h,l,u),c.setPosition(d);else{c.updateData(e,h,l,u);var m={x:d[0],y:d[1]};s?c.attr(m):Ir(c,m,n)}i.add(c),e.setItemGraphicEl(h,c)}).remove(function(h){var v=a.getItemGraphicEl(h);v&&v.fadeOut(function(){i.remove(v)},n)}).execute(),this._getSymbolPoint=f,this._data=e},t.prototype.updateLayout=function(){var e=this,r=this._data;r&&r.eachItemGraphicEl(function(i,n){var a=e._getSymbolPoint(n);i.setPosition(a),i.markRedraw()})},t.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=O0(e),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(e,r,i){this._progressiveEls=[],i=N0(i);function n(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=e.start;a<e.end;a++){var o=r.getItemLayout(a);if(zc(r,o,a,i)){var s=new this._SymbolCtor(r,a,this._seriesScope);s.traverse(n),s.setPosition(o),this.group.add(s),r.setItemGraphicEl(a,s),this._progressiveEls.push(s)}}},t.prototype.eachRendered=function(e){Bp(this._progressiveEls||this.group,e)},t.prototype.remove=function(e){var r=this.group,i=this._data;i&&e?i.eachItemGraphicEl(function(n){n.fadeOut(function(){r.remove(n)},i.hostModel)}):r.removeAll()},t}();const eO=tO;function o2(t,e,r){var i=t.getBaseAxis(),n=t.getOtherAxis(i),a=rO(n,r),o=i.dim,s=n.dim,l=e.mapDimension(s),u=e.mapDimension(o),f=s==="x"||s==="radius"?1:0,h=K(t.dimensions,function(d){return e.mapDimension(d)}),v=!1,c=e.getCalculationInfo("stackResultDimension");return vo(e,h[0])&&(v=!0,h[0]=c),vo(e,h[1])&&(v=!0,h[1]=c),{dataDimsForPoint:h,valueStart:a,valueAxisDim:s,baseAxisDim:o,stacked:!!v,valueDim:l,baseDim:u,baseDataOffset:f,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function rO(t,e){var r=0,i=t.scale.getExtent();return e==="start"?r=i[0]:e==="end"?r=i[1]:Qt(e)&&!isNaN(e)?r=e:i[0]>0?r=i[0]:i[1]<0&&(r=i[1]),r}function s2(t,e,r,i){var n=NaN;t.stacked&&(n=r.get(r.getCalculationInfo("stackedOverDimension"),i)),isNaN(n)&&(n=t.valueStart);var a=t.baseDataOffset,o=[];return o[a]=r.get(t.baseDim,i),o[1-a]=n,e.dataToPoint(o)}function iO(t,e){var r=[];return e.diff(t).add(function(i){r.push({cmd:"+",idx:i})}).update(function(i,n){r.push({cmd:"=",idx:n,idx1:i})}).remove(function(i){r.push({cmd:"-",idx:i})}).execute(),r}function nO(t,e,r,i,n,a,o,s){for(var l=iO(t,e),u=[],f=[],h=[],v=[],c=[],d=[],p=[],g=o2(n,e,o),m=t.getLayout("points")||[],_=e.getLayout("points")||[],y=0;y<l.length;y++){var x=l[y],S=!0,T=void 0,b=void 0;switch(x.cmd){case"=":T=x.idx*2,b=x.idx1*2;var w=m[T],A=m[T+1],C=_[b],E=_[b+1];(isNaN(w)||isNaN(A))&&(w=C,A=E),u.push(w,A),f.push(C,E),h.push(r[T],r[T+1]),v.push(i[b],i[b+1]),p.push(e.getRawIndex(x.idx1));break;case"+":var D=x.idx,L=g.dataDimsForPoint,R=n.dataToPoint([e.get(L[0],D),e.get(L[1],D)]);b=D*2,u.push(R[0],R[1]),f.push(_[b],_[b+1]);var N=s2(g,n,e,D);h.push(N[0],N[1]),v.push(i[b],i[b+1]),p.push(e.getRawIndex(D));break;case"-":S=!1}S&&(c.push(x),d.push(d.length))}d.sort(function(It,gt){return p[It]-p[gt]});for(var I=u.length,F=Ja(I),O=Ja(I),z=Ja(I),k=Ja(I),it=[],y=0;y<d.length;y++){var $=d[y],nt=y*2,rt=$*2;F[nt]=u[rt],F[nt+1]=u[rt+1],O[nt]=f[rt],O[nt+1]=f[rt+1],z[nt]=h[rt],z[nt+1]=h[rt+1],k[nt]=v[rt],k[nt+1]=v[rt+1],it[y]=c[$]}return{current:F,next:O,stackedOnCurrent:z,stackedOnNext:k,status:it}}var Hi=Math.min,Vi=Math.max;function ra(t,e){return isNaN(t)||isNaN(e)}function Ed(t,e,r,i,n,a,o,s,l){for(var u,f,h,v,c,d,p=r,g=0;g<i;g++){var m=e[p*2],_=e[p*2+1];if(p>=n||p<0)break;if(ra(m,_)){if(l){p+=a;continue}break}if(p===r)t[a>0?"moveTo":"lineTo"](m,_),h=m,v=_;else{var y=m-u,x=_-f;if(y*y+x*x<.5){p+=a;continue}if(o>0){for(var S=p+a,T=e[S*2],b=e[S*2+1];T===m&&b===_&&g<i;)g++,S+=a,p+=a,T=e[S*2],b=e[S*2+1],m=e[p*2],_=e[p*2+1],y=m-u,x=_-f;var w=g+1;if(l)for(;ra(T,b)&&w<i;)w++,S+=a,T=e[S*2],b=e[S*2+1];var A=.5,C=0,E=0,D=void 0,L=void 0;if(w>=i||ra(T,b))c=m,d=_;else{C=T-u,E=b-f;var R=m-u,N=T-m,I=_-f,F=b-_,O=void 0,z=void 0;if(s==="x"){O=Math.abs(R),z=Math.abs(N);var k=C>0?1:-1;c=m-k*O*o,d=_,D=m+k*z*o,L=_}else if(s==="y"){O=Math.abs(I),z=Math.abs(F);var it=E>0?1:-1;c=m,d=_-it*O*o,D=m,L=_+it*z*o}else O=Math.sqrt(R*R+I*I),z=Math.sqrt(N*N+F*F),A=z/(z+O),c=m-C*o*(1-A),d=_-E*o*(1-A),D=m+C*o*A,L=_+E*o*A,D=Hi(D,Vi(T,m)),L=Hi(L,Vi(b,_)),D=Vi(D,Hi(T,m)),L=Vi(L,Hi(b,_)),C=D-m,E=L-_,c=m-C*O/z,d=_-E*O/z,c=Hi(c,Vi(u,m)),d=Hi(d,Vi(f,_)),c=Vi(c,Hi(u,m)),d=Vi(d,Hi(f,_)),C=m-c,E=_-d,D=m+C*z/O,L=_+E*z/O}t.bezierCurveTo(h,v,c,d,m,_),h=D,v=L}else t.lineTo(m,_)}u=m,f=_,p+=a}return g}var l2=function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t}(),aO=function(t){G(e,t);function e(r){var i=t.call(this,r)||this;return i.type="ec-polyline",i}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new l2},e.prototype.buildPath=function(r,i){var n=i.points,a=0,o=n.length/2;if(i.connectNulls){for(;o>0&&ra(n[o*2-2],n[o*2-1]);o--);for(;a<o&&ra(n[a*2],n[a*2+1]);a++);}for(;a<o;)a+=Ed(r,n,a,o,o,1,i.smooth,i.smoothMonotone,i.connectNulls)+1},e.prototype.getPointOn=function(r,i){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var n=this.path,a=n.data,o=Mi.CMD,s,l,u=i==="x",f=[],h=0;h<a.length;){var v=a[h++],c=void 0,d=void 0,p=void 0,g=void 0,m=void 0,_=void 0,y=void 0;switch(v){case o.M:s=a[h++],l=a[h++];break;case o.L:if(c=a[h++],d=a[h++],y=u?(r-s)/(c-s):(r-l)/(d-l),y<=1&&y>=0){var x=u?(d-l)*y+l:(c-s)*y+s;return u?[r,x]:[x,r]}s=c,l=d;break;case o.C:c=a[h++],d=a[h++],p=a[h++],g=a[h++],m=a[h++],_=a[h++];var S=u?$u(s,c,p,m,r,f):$u(l,d,g,_,r,f);if(S>0)for(var T=0;T<S;T++){var b=f[T];if(b<=1&&b>=0){var x=u?ye(l,d,g,_,b):ye(s,c,p,m,b);return u?[r,x]:[x,r]}}s=m,l=_;break}}},e}(Ht),oO=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(l2),sO=function(t){G(e,t);function e(r){var i=t.call(this,r)||this;return i.type="ec-polygon",i}return e.prototype.getDefaultShape=function(){return new oO},e.prototype.buildPath=function(r,i){var n=i.points,a=i.stackedOnPoints,o=0,s=n.length/2,l=i.smoothMonotone;if(i.connectNulls){for(;s>0&&ra(n[s*2-2],n[s*2-1]);s--);for(;o<s&&ra(n[o*2],n[o*2+1]);o++);}for(;o<s;){var u=Ed(r,n,o,s,s,1,i.smooth,l,i.connectNulls);Ed(r,a,o+u-1,u,s,-1,i.stackedOnSmooth,l,i.connectNulls),o+=u+1,r.closePath()}},e}(Ht);function lO(t,e,r,i,n){var a=t.getArea(),o=a.x,s=a.y,l=a.width,u=a.height,f=r.get(["lineStyle","width"])||2;o-=f/2,s-=f/2,l+=f,u+=f,o=Math.floor(o),l=Math.round(l);var h=new ie({shape:{x:o,y:s,width:l,height:u}});if(e){var v=t.getBaseAxis(),c=v.isHorizontal(),d=v.inverse;c?(d&&(h.shape.x+=l),h.shape.width=0):(d||(h.shape.y+=u),h.shape.height=0);var p=ct(n)?function(g){n(g,h)}:null;an(h,{shape:{width:l,height:u,x:o,y:s}},r,null,i,p)}return h}function uO(t,e,r){var i=t.getArea(),n=re(i.r0,1),a=re(i.r,1),o=new Mp({shape:{cx:re(t.cx,1),cy:re(t.cy,1),r0:n,r:a,startAngle:i.startAngle,endAngle:i.endAngle,clockwise:i.clockwise}});if(e){var s=t.getBaseAxis().dim==="angle";s?o.shape.endAngle=i.startAngle:o.shape.r=n,an(o,{shape:{endAngle:i.endAngle,r:a}},r)}return o}function fO(t,e){return t.type===e}function B0(t,e){if(t.length===e.length){for(var r=0;r<t.length;r++)if(t[r]!==e[r])return;return!0}}function F0(t){for(var e=1/0,r=1/0,i=-1/0,n=-1/0,a=0;a<t.length;){var o=t[a++],s=t[a++];isNaN(o)||(e=Math.min(o,e),i=Math.max(o,i)),isNaN(s)||(r=Math.min(s,r),n=Math.max(s,n))}return[[e,r],[i,n]]}function k0(t,e){var r=F0(t),i=r[0],n=r[1],a=F0(e),o=a[0],s=a[1];return Math.max(Math.abs(i[0]-o[0]),Math.abs(i[1]-o[1]),Math.abs(n[0]-s[0]),Math.abs(n[1]-s[1]))}function z0(t){return Qt(t)?t:t?.5:0}function hO(t,e,r){if(!r.valueDim)return[];for(var i=e.count(),n=Ja(i*2),a=0;a<i;a++){var o=s2(r,t,e,a);n[a*2]=o[0],n[a*2+1]=o[1]}return n}function Gi(t,e,r,i){var n=e.getBaseAxis(),a=n.dim==="x"||n.dim==="radius"?0:1,o=[],s=0,l=[],u=[],f=[],h=[];if(i){for(s=0;s<t.length;s+=2)!isNaN(t[s])&&!isNaN(t[s+1])&&h.push(t[s],t[s+1]);t=h}for(s=0;s<t.length-2;s+=2)switch(f[0]=t[s+2],f[1]=t[s+3],u[0]=t[s],u[1]=t[s+1],o.push(u[0],u[1]),r){case"end":l[a]=f[a],l[1-a]=u[1-a],o.push(l[0],l[1]);break;case"middle":var v=(u[a]+f[a])/2,c=[];l[a]=c[a]=v,l[1-a]=u[1-a],c[1-a]=f[1-a],o.push(l[0],l[1]),o.push(c[0],c[1]);break;default:l[a]=u[a],l[1-a]=f[1-a],o.push(l[0],l[1])}return o.push(t[s++],t[s++]),o}function cO(t,e){var r=[],i=t.length,n,a;function o(f,h,v){var c=f.coord,d=(v-c)/(h.coord-c),p=pE(d,[f.color,h.color]);return{coord:v,color:p}}for(var s=0;s<i;s++){var l=t[s],u=l.coord;if(u<0)n=l;else if(u>e){a?r.push(o(a,l,e)):n&&r.push(o(n,l,0),o(n,l,e));break}else n&&(r.push(o(n,l,0)),n=null),r.push(l),a=l}return r}function vO(t,e,r){var i=t.getVisual("visualMeta");if(!(!i||!i.length||!t.count())&&e.type==="cartesian2d"){for(var n,a,o=i.length-1;o>=0;o--){var s=t.getDimensionInfo(i[o].dimension);if(n=s&&s.coordDim,n==="x"||n==="y"){a=i[o];break}}if(a){var l=e.getAxis(n),u=K(a.stops,function(y){return{coord:l.toGlobalCoord(l.dataToCoord(y.value)),color:y.color}}),f=u.length,h=a.outerColors.slice();f&&u[0].coord>u[f-1].coord&&(u.reverse(),h.reverse());var v=cO(u,n==="x"?r.getWidth():r.getHeight()),c=v.length;if(!c&&f)return u[0].coord<0?h[1]?h[1]:u[f-1].color:h[0]?h[0]:u[0].color;var d=10,p=v[0].coord-d,g=v[c-1].coord+d,m=g-p;if(m<.001)return"transparent";M(v,function(y){y.offset=(y.coord-p)/m}),v.push({offset:c?v[c-1].offset:.5,color:h[1]||"transparent"}),v.unshift({offset:c?v[0].offset:.5,color:h[0]||"transparent"});var _=new Lp(0,0,0,0,v,!0);return _[n]=p,_[n+"2"]=g,_}}}function dO(t,e,r){var i=t.get("showAllSymbol"),n=i==="auto";if(!(i&&!n)){var a=r.getAxesByScale("ordinal")[0];if(a&&!(n&&pO(a,e))){var o=e.mapDimension(a.dim),s={};return M(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function pO(t,e){var r=t.getExtent(),i=Math.abs(r[1]-r[0])/t.scale.count();isNaN(i)&&(i=0);for(var n=e.count(),a=Math.max(1,Math.round(n/5)),o=0;o<n;o+=a)if(vg.getSymbolSize(e,o)[t.isHorizontal()?1:0]*1.5>i)return!1;return!0}function gO(t,e){return isNaN(t)||isNaN(e)}function mO(t){for(var e=t.length/2;e>0&&gO(t[e*2-2],t[e*2-1]);e--);return e-1}function U0(t,e){return[t[e*2],t[e*2+1]]}function _O(t,e,r){for(var i=t.length/2,n=r==="x"?0:1,a,o,s=0,l=-1,u=0;u<i;u++)if(o=t[u*2+n],!(isNaN(o)||isNaN(t[u*2+1-n]))){if(u===0){a=o;continue}if(a<=e&&o>=e||a>=e&&o<=e){l=u;break}s=u,a=o}return{range:[s,l],t:(e-a)/(o-a)}}function u2(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e<Pr.length;e++)if(t.get([Pr[e],"endLabel","show"]))return!0;return!1}function Uc(t,e,r,i){if(fO(e,"cartesian2d")){var n=i.getModel("endLabel"),a=n.get("valueAnimation"),o=i.getData(),s={lastFrameIndex:0},l=u2(i)?function(c,d){t._endLabelOnDuring(c,d,o,s,a,n,e)}:null,u=e.getBaseAxis().isHorizontal(),f=lO(e,r,i,function(){var c=t._endLabel;c&&r&&s.originalX!=null&&c.attr({x:s.originalX,y:s.originalY})},l);if(!i.get("clip",!0)){var h=f.shape,v=Math.max(h.width,h.height);u?(h.y-=v,h.height+=v*2):(h.x-=v,h.width+=v*2)}return l&&l(1,f),f}else return uO(e,r,i)}function yO(t,e){var r=e.getBaseAxis(),i=r.isHorizontal(),n=r.inverse,a=i?n?"right":"left":"center",o=i?"middle":n?"top":"bottom";return{normal:{align:t.get("align")||a,verticalAlign:t.get("verticalAlign")||o}}}var xO=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(){var r=new ue,i=new eO;this.group.add(i.group),this._symbolDraw=i,this._lineGroup=r},e.prototype.render=function(r,i,n){var a=this,o=r.coordinateSystem,s=this.group,l=r.getData(),u=r.getModel("lineStyle"),f=r.getModel("areaStyle"),h=l.getLayout("points")||[],v=o.type==="polar",c=this._coordSys,d=this._symbolDraw,p=this._polyline,g=this._polygon,m=this._lineGroup,_=!i.ssr&&r.isAnimationEnabled(),y=!f.isEmpty(),x=f.get("origin"),S=o2(o,l,x),T=y&&hO(o,l,S),b=r.get("showSymbol"),w=r.get("connectNulls"),A=b&&!v&&dO(r,l,o),C=this._data;C&&C.eachItemGraphicEl(function(gt,Ft){gt.__temp&&(s.remove(gt),C.setItemGraphicEl(Ft,null))}),b||d.remove(),s.add(m);var E=v?!1:r.get("step"),D;o&&o.getArea&&r.get("clip",!0)&&(D=o.getArea(),D.width!=null?(D.x-=.1,D.y-=.1,D.width+=.2,D.height+=.2):D.r0&&(D.r0-=.5,D.r+=.5)),this._clipShapeForSymbol=D;var L=vO(l,o,n)||l.getVisual("style")[l.getVisual("drawType")];if(!(p&&c.type===o.type&&E===this._step))b&&d.updateData(l,{isIgnore:A,clipShape:D,disableAnimation:!0,getSymbolPoint:function(gt){return[h[gt*2],h[gt*2+1]]}}),_&&this._initSymbolLabelAnimation(l,o,D),E&&(h=Gi(h,o,E,w),T&&(T=Gi(T,o,E,w))),p=this._newPolyline(h),y?g=this._newPolygon(h,T):g&&(m.remove(g),g=this._polygon=null),v||this._initOrUpdateEndLabel(r,o,ua(L)),m.setClipPath(Uc(this,o,!0,r));else{y&&!g?g=this._newPolygon(h,T):g&&!y&&(m.remove(g),g=this._polygon=null),v||this._initOrUpdateEndLabel(r,o,ua(L));var R=m.getClipPath();if(R){var N=Uc(this,o,!1,r);an(R,{shape:N.shape},r)}else m.setClipPath(Uc(this,o,!0,r));b&&d.updateData(l,{isIgnore:A,clipShape:D,disableAnimation:!0,getSymbolPoint:function(gt){return[h[gt*2],h[gt*2+1]]}}),(!B0(this._stackedOnPoints,T)||!B0(this._points,h))&&(_?this._doUpdateAnimation(l,T,o,n,E,x,w):(E&&(h=Gi(h,o,E,w),T&&(T=Gi(T,o,E,w))),p.setShape({points:h}),g&&g.setShape({points:h,stackedOnPoints:T})))}var I=r.getModel("emphasis"),F=I.get("focus"),O=I.get("blurScope"),z=I.get("disabled");if(p.useStyle(Lt(u.getLineStyle(),{fill:"none",stroke:L,lineJoin:"bevel"})),jm(p,r,"lineStyle"),p.style.lineWidth>0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var k=p.getState("emphasis").style;k.lineWidth=+p.style.lineWidth+1}kt(p).seriesIndex=r.seriesIndex,rd(p,F,O,z);var it=z0(r.get("smooth")),$=r.get("smoothMonotone");if(p.setShape({smooth:it,smoothMonotone:$,connectNulls:w}),g){var nt=l.getCalculationInfo("stackedOnSeries"),rt=0;g.useStyle(Lt(f.getAreaStyle(),{fill:L,opacity:.7,lineJoin:"bevel",decal:l.getVisual("style").decal})),nt&&(rt=z0(nt.get("smooth"))),g.setShape({smooth:it,stackedOnSmooth:rt,smoothMonotone:$,connectNulls:w}),jm(g,r,"areaStyle"),kt(g).seriesIndex=r.seriesIndex,rd(g,F,O,z)}var It=function(gt){a._changePolyState(gt)};l.eachItemGraphicEl(function(gt){gt&&(gt.onHoverStateChange=It)}),this._polyline.onHoverStateChange=It,this._data=l,this._coordSys=o,this._stackedOnPoints=T,this._points=h,this._step=E,this._valueOrigin=x,r.get("triggerLineEvent")&&(this.packEventData(r,p),g&&this.packEventData(r,g))},e.prototype.packEventData=function(r,i){kt(i).eventData={componentType:"series",componentSubType:"line",componentIndex:r.componentIndex,seriesIndex:r.seriesIndex,seriesName:r.name,seriesType:"line"}},e.prototype.highlight=function(r,i,n,a){var o=r.getData(),s=sa(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var f=l[s*2],h=l[s*2+1];if(isNaN(f)||isNaN(h)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(f,h))return;var v=r.get("zlevel")||0,c=r.get("z")||0;u=new vg(o,s),u.x=f,u.y=h,u.setZ(v,c);var d=u.getSymbolPath().getTextContent();d&&(d.zlevel=v,d.z=c,d.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else Ai.prototype.highlight.call(this,r,i,n,a)},e.prototype.downplay=function(r,i,n,a){var o=r.getData(),s=sa(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else Ai.prototype.downplay.call(this,r,i,n,a)},e.prototype._changePolyState=function(r){var i=this._polygon;Ym(this._polyline,r),i&&Ym(i,r)},e.prototype._newPolyline=function(r){var i=this._polyline;return i&&this._lineGroup.remove(i),i=new aO({shape:{points:r},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(i),this._polyline=i,i},e.prototype._newPolygon=function(r,i){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new sO({shape:{points:r,stackedOnPoints:i},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},e.prototype._initSymbolLabelAnimation=function(r,i,n){var a,o,s=i.getBaseAxis(),l=s.inverse;i.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):i.type==="polar"&&(a=s.dim==="angle",o=!0);var u=r.hostModel,f=u.get("animationDuration");ct(f)&&(f=f(null));var h=u.get("animationDelay")||0,v=ct(h)?h(null):h;r.eachItemGraphicEl(function(c,d){var p=c;if(p){var g=[c.x,c.y],m=void 0,_=void 0,y=void 0;if(n)if(o){var x=n,S=i.pointToCoord(g);a?(m=x.startAngle,_=x.endAngle,y=-S[1]/180*Math.PI):(m=x.r0,_=x.r,y=S[0])}else{var T=n;a?(m=T.x,_=T.x+T.width,y=c.x):(m=T.y+T.height,_=T.y,y=c.y)}var b=_===m?0:(y-m)/(_-m);l&&(b=1-b);var w=ct(h)?h(d):f*b+v,A=p.getSymbolPath(),C=A.getTextContent();p.attr({scaleX:0,scaleY:0}),p.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:w}),C&&C.animateFrom({style:{opacity:0}},{duration:300,delay:w}),A.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(r,i,n){var a=r.getModel("endLabel");if(u2(r)){var o=r.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new Jt({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var f=mO(l);f>=0&&(Fp(s,kp(r,"endLabel"),{inheritColor:n,labelFetcher:r,labelDataIndex:f,defaultText:function(h,v,c){return c!=null?jN(o,c):a2(o,h)},enableTextSetter:!0},yO(a,i)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(r,i,n,a,o,s,l){var u=this._endLabel,f=this._polyline;if(u){r<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var h=n.getLayout("points"),v=n.hostModel,c=v.get("connectNulls"),d=s.get("precision"),p=s.get("distance")||0,g=l.getBaseAxis(),m=g.isHorizontal(),_=g.inverse,y=i.shape,x=_?m?y.x:y.y+y.height:m?y.x+y.width:y.y,S=(m?p:0)*(_?-1:1),T=(m?0:-p)*(_?-1:1),b=m?"x":"y",w=_O(h,x,b),A=w.range,C=A[1]-A[0],E=void 0;if(C>=1){if(C>1&&!c){var D=U0(h,A[0]);u.attr({x:D[0]+S,y:D[1]+T}),o&&(E=v.getRawValue(A[0]))}else{var D=f.getPointOn(x,b);D&&u.attr({x:D[0]+S,y:D[1]+T});var L=v.getRawValue(A[0]),R=v.getRawValue(A[1]);o&&(E=rT(n,d,L,R,w.t))}a.lastFrameIndex=A[0]}else{var N=r===1||a.lastFrameIndex>0?A[0]:0,D=U0(h,N);o&&(E=v.getRawValue(N)),u.attr({x:D[0]+S,y:D[1]+T})}if(o){var I=eh(u);typeof I.setLabelText=="function"&&I.setLabelText(E)}}},e.prototype._doUpdateAnimation=function(r,i,n,a,o,s,l){var u=this._polyline,f=this._polygon,h=r.hostModel,v=nO(this._data,r,this._stackedOnPoints,i,this._coordSys,n,this._valueOrigin),c=v.current,d=v.stackedOnCurrent,p=v.next,g=v.stackedOnNext;if(o&&(c=Gi(v.current,n,o,l),d=Gi(v.stackedOnCurrent,n,o,l),p=Gi(v.next,n,o,l),g=Gi(v.stackedOnNext,n,o,l)),k0(c,p)>3e3||f&&k0(d,g)>3e3){u.stopAnimation(),u.setShape({points:p}),f&&(f.stopAnimation(),f.setShape({points:p,stackedOnPoints:g}));return}u.shape.__points=v.current,u.shape.points=c;var m={shape:{points:p}};v.current!==c&&(m.shape.__points=v.next),u.stopAnimation(),Ir(u,m,h),f&&(f.setShape({points:c,stackedOnPoints:d}),f.stopAnimation(),Ir(f,{shape:{stackedOnPoints:g}},h),u.shape.points!==f.shape.points&&(f.shape.points=u.shape.points));for(var _=[],y=v.status,x=0;x<y.length;x++){var S=y[x].cmd;if(S==="="){var T=r.getItemGraphicEl(y[x].idx1);T&&_.push({el:T,ptIdx:x})}}u.animators&&u.animators.length&&u.animators[0].during(function(){f&&f.dirtyShape();for(var b=u.shape.__points,w=0;w<_.length;w++){var A=_[w].el,C=_[w].ptIdx*2;A.x=b[C],A.y=b[C+1],A.markRedraw()}})},e.prototype.remove=function(r){var i=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),n&&n.eachItemGraphicEl(function(a,o){a.__temp&&(i.remove(a),n.setItemGraphicEl(o,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},e.type="line",e}(Ai);const TO=xO;function SO(t,e){return{seriesType:t,plan:GS(),reset:function(r){var i=r.getData(),n=r.coordinateSystem,a=r.pipelineContext,o=e||a.large;if(n){var s=K(n.dimensions,function(c){return i.mapDimension(c)}).slice(0,2),l=s.length,u=i.getCalculationInfo("stackResultDimension");vo(i,s[0])&&(s[0]=u),vo(i,s[1])&&(s[1]=u);var f=i.getStore(),h=i.getDimensionIndex(s[0]),v=i.getDimensionIndex(s[1]);return l&&{progress:function(c,d){for(var p=c.end-c.start,g=o&&Ja(p*l),m=[],_=[],y=c.start,x=0;y<c.end;y++){var S=void 0;if(l===1){var T=f.get(h,y);S=n.dataToPoint(T,null,_)}else m[0]=f.get(h,y),m[1]=f.get(v,y),S=n.dataToPoint(m,null,_);o?(g[x++]=S[0],g[x++]=S[1]):d.setItemLayout(y,S.slice())}o&&d.setLayout("points",g)}}}}}}var wO={average:function(t){for(var e=0,r=0,i=0;i<t.length;i++)isNaN(t[i])||(e+=t[i],r++);return r===0?NaN:e/r},sum:function(t){for(var e=0,r=0;r<t.length;r++)e+=t[r]||0;return e},max:function(t){for(var e=-1/0,r=0;r<t.length;r++)t[r]>e&&(e=t[r]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,r=0;r<t.length;r++)t[r]<e&&(e=t[r]);return isFinite(e)?e:NaN},nearest:function(t){return t[0]}},bO=function(t){return Math.round(t.length/2)};function AO(t){return{seriesType:t,reset:function(e,r,i){var n=e.getData(),a=e.get("sampling"),o=e.coordinateSystem,s=n.count();if(s>10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),f=l.getExtent(),h=i.getDevicePixelRatio(),v=Math.abs(f[1]-f[0])*(h||1),c=Math.round(s/v);if(isFinite(c)&&c>1){a==="lttb"&&e.setData(n.lttbDownSample(n.mapDimension(u.dim),1/c));var d=void 0;Z(a)?d=wO[a]:ct(a)&&(d=a),d&&e.setData(n.downSample(n.mapDimension(u.dim),1/c,d,bO))}}}}}function EO(t){t.registerChartView(TO),t.registerSeriesModel(KN),t.registerLayout(SO("line",!0)),t.registerVisual({seriesType:"line",reset:function(e){var r=e.getData(),i=e.getModel("lineStyle").getLineStyle();i&&!i.stroke&&(i.stroke=r.getVisual("style").fill),r.setVisual("legendLineStyle",i)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,AO("line"))}var CO=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Vt);const MO=CO;var Cd=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Je).models[0]},e.type="cartesian2dAxis",e}(Vt);qr(Cd,$w);var f2={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},DO=dt({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},f2),dg=dt({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},f2),LO=dt({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},dg),RO=Lt({logBase:10},dg);const PO={category:DO,value:dg,time:LO,log:RO};var IO={value:1,category:1,time:1,log:1};function H0(t,e,r,i){M(IO,function(n,a){var o=dt(dt({},PO[a],!0),i,!0),s=function(l){G(u,l);function u(){var f=l!==null&&l.apply(this,arguments)||this;return f.type=e+"Axis."+a,f}return u.prototype.mergeDefaultAndTheme=function(f,h){var v=zs(this),c=v?ol(f):{},d=h.getTheme();dt(f,d.get(a+"Axis")),dt(f,this.getDefaultOption()),f.type=V0(f),v&&fa(f,c,v)},u.prototype.optionUpdated=function(){var f=this.option;f.type==="category"&&(this.__ordinalMeta=Sf.createByAxisModel(this))},u.prototype.getCategories=function(f){var h=this.option;if(h.type==="category")return f?h.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.type=e+"Axis."+a,u.defaultOption=o,u}(r);t.registerComponentModel(s)}),t.registerSubTypeDefaulter(e+"Axis",V0)}function V0(t){return t.type||(t.data?"category":"value")}var NO=function(){function t(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return t.prototype.getAxis=function(e){return this._axes[e]},t.prototype.getAxes=function(){return K(this._dimList,function(e){return this._axes[e]},this)},t.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),ce(this.getAxes(),function(r){return r.scale.type===e})},t.prototype.addAxis=function(e){var r=e.dim;this._axes[r]=e,this._dimList.push(r)},t}();const pg=NO;var Md=["x","y"];function G0(t){return t.type==="interval"||t.type==="time"}var OO=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=Md,r}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,i=this.getAxis("y").scale;if(!(!G0(r)||!G0(i))){var n=r.getExtent(),a=i.getExtent(),o=this.dataToPoint([n[0],a[0]]),s=this.dataToPoint([n[1],a[1]]),l=n[1]-n[0],u=a[1]-a[0];if(!(!l||!u)){var f=(s[0]-o[0])/l,h=(s[1]-o[1])/u,v=o[0]-n[0]*f,c=o[1]-a[0]*h,d=this._transform=[f,0,0,h,v,c];this._invTransform=Uf([],d)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(r){var i=this.getAxis("x"),n=this.getAxis("y");return i.contain(i.toLocalCoord(r[0]))&&n.contain(n.toLocalCoord(r[1]))},e.prototype.containData=function(r){return this.getAxis("x").containData(r[0])&&this.getAxis("y").containData(r[1])},e.prototype.containZone=function(r,i){var n=this.dataToPoint(r),a=this.dataToPoint(i),o=this.getArea(),s=new Nt(n[0],n[1],a[0]-n[0],a[1]-n[1]);return o.intersect(s)},e.prototype.dataToPoint=function(r,i,n){n=n||[];var a=r[0],o=r[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return Lr(n,r,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return n[0]=s.toGlobalCoord(s.dataToCoord(a,i)),n[1]=l.toGlobalCoord(l.dataToCoord(o,i)),n},e.prototype.clampData=function(r,i){var n=this.getAxis("x").scale,a=this.getAxis("y").scale,o=n.getExtent(),s=a.getExtent(),l=n.parse(r[0]),u=a.parse(r[1]);return i=i||[],i[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),i[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),i},e.prototype.pointToData=function(r,i){var n=[];if(this._invTransform)return Lr(n,r,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return n[0]=a.coordToData(a.toLocalCoord(r[0]),i),n[1]=o.coordToData(o.toLocalCoord(r[1]),i),n},e.prototype.getOtherAxis=function(r){return this.getAxis(r.dim==="x"?"y":"x")},e.prototype.getArea=function(){var r=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),n=Math.min(r[0],r[1]),a=Math.min(i[0],i[1]),o=Math.max(r[0],r[1])-n,s=Math.max(i[0],i[1])-a;return new Nt(n,a,o,s)},e}(pg),BO=function(t){G(e,t);function e(r,i,n,a,o){var s=t.call(this,r,i,n)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var r=this.position;return r==="top"||r==="bottom"},e.prototype.getGlobalExtent=function(r){var i=this.getExtent();return i[0]=this.toGlobalCoord(i[0]),i[1]=this.toGlobalCoord(i[1]),r&&i[0]>i[1]&&i.reverse(),i},e.prototype.pointToData=function(r,i){return this.coordToData(this.toLocalCoord(r[this.dim==="x"?0:1]),i)},e.prototype.setCategorySortInfo=function(r){if(this.type!=="category")return!1;this.model.option.categorySortInfo=r,this.scale.setSortInfo(r)},e}(fg);const FO=BO;function Dd(t,e,r){r=r||{};var i=t.coordinateSystem,n=e.axis,a={},o=n.getAxesOnZeroOf()[0],s=n.position,l=o?"onZero":s,u=n.dim,f=i.getRect(),h=[f.x,f.x+f.width,f.y,f.y+f.height],v={left:0,right:1,top:0,bottom:1,onZero:2},c=e.get("offset")||0,d=u==="x"?[h[2]-c,h[3]+c]:[h[0]-c,h[1]+c];if(o){var p=o.toGlobalCoord(o.dataToCoord(0));d[v.onZero]=Math.max(Math.min(p,d[1]),d[0])}a.position=[u==="y"?d[v[l]]:h[0],u==="x"?d[v[l]]:h[3]],a.rotation=Math.PI/2*(u==="x"?0:1);var g={top:-1,bottom:1,left:-1,right:1};a.labelDirection=a.tickDirection=a.nameDirection=g[s],a.labelOffset=o?d[v[s]]-d[v.onZero]:0,e.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),fo(r.labelInside,e.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var m=e.get(["axisLabel","rotate"]);return a.labelRotate=l==="top"?-m:m,a.z2=1,a}function W0(t){return t.get("coordinateSystem")==="cartesian2d"}function X0(t){var e={xAxisModel:null,yAxisModel:null};return M(e,function(r,i){var n=i.replace(/Model$/,""),a=t.getReferringComponents(n,Je).models[0];e[i]=a}),e}var Hc=Math.log;function kO(t,e,r){var i=sl.prototype,n=i.getTicks.call(r),a=i.getTicks.call(r,!0),o=n.length-1,s=i.getInterval.call(r),l=Gw(t,e),u=l.extent,f=l.fixMin,h=l.fixMax;if(t.type==="log"){var v=Hc(t.base);u=[Hc(u[0])/v,Hc(u[1])/v]}t.setExtent(u[0],u[1]),t.calcNiceExtent({splitNumber:o,fixMin:f,fixMax:h});var c=i.getExtent.call(t);f&&(u[0]=c[0]),h&&(u[1]=c[1]);var d=i.getInterval.call(t),p=u[0],g=u[1];if(f&&h)d=(g-p)/o;else if(f)for(g=u[0]+d*o;g<u[1]&&isFinite(g)&&isFinite(u[1]);)d=Nc(d),g=u[0]+d*o;else if(h)for(p=u[1]-d*o;p>u[0]&&isFinite(p)&&isFinite(u[0]);)d=Nc(d),p=u[1]-d*o;else{var m=t.getTicks().length-1;m>o&&(d=Nc(d));var _=d*o;g=Math.ceil(u[1]/d)*d,p=re(g-_),p<0&&u[0]>=0?(p=0,g=re(_)):g>0&&u[1]<=0&&(g=0,p=-re(_))}var y=(n[0].value-a[0].value)/s,x=(n[o].value-a[o].value)/s;i.setExtent.call(t,p+d*y,g+d*x),i.setInterval.call(t,d),(y||x)&&i.setNiceExtent.call(t,p+d,g-d)}var zO=function(){function t(e,r,i){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=Md,this._initCartesian(e,r,i),this.model=e}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(e,r){var i=this._axesMap;this._updateScale(e,this.model);function n(o){var s,l=yt(o),u=l.length;if(u){for(var f=[],h=u-1;h>=0;h--){var v=+l[h],c=o[v],d=c.model,p=c.scale;Td(p)&&d.get("alignTicks")&&d.get("interval")==null?f.push(c):(Sd(p,d),Td(p)&&(s=c))}f.length&&(s||(s=f.pop(),Sd(s.scale,s.model)),M(f,function(g){kO(g.scale,g.model,s.scale)}))}}n(i.x),n(i.y);var a={};M(i.x,function(o){Y0(i,"y",o,a)}),M(i.y,function(o){Y0(i,"x",o,a)}),this.resize(this.model,r)},t.prototype.resize=function(e,r,i){var n=e.getBoxLayoutParams(),a=!i&&e.get("containLabel"),o=on(n,{width:r.getWidth(),height:r.getHeight()});this._rect=o;var s=this._axesList;l(),a&&(M(s,function(u){if(!u.model.get(["axisLabel","inside"])){var f=JI(u);if(f){var h=u.isHorizontal()?"height":"width",v=u.model.get(["axisLabel","margin"]);o[h]-=f[h]+v,u.position==="top"?o.y+=f.height+v:u.position==="left"&&(o.x+=f.width+v)}}}),l()),M(this._coordsList,function(u){u.calcAffineTransform()});function l(){M(s,function(u){var f=u.isHorizontal(),h=f?[0,o.width]:[0,o.height],v=u.inverse?1:0;u.setExtent(h[v],h[1-v]),UO(u,f?o.x:o.y)})}},t.prototype.getAxis=function(e,r){var i=this._axesMap[e];if(i!=null)return i[r||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(e,r){if(e!=null&&r!=null){var i="x"+e+"y"+r;return this._coordsMap[i]}j(e)&&(r=e.yAxisIndex,e=e.xAxisIndex);for(var n=0,a=this._coordsList;n<a.length;n++)if(a[n].getAxis("x").index===e||a[n].getAxis("y").index===r)return a[n]},t.prototype.getCartesians=function(){return this._coordsList.slice()},t.prototype.convertToPixel=function(e,r,i){var n=this._findConvertTarget(r);return n.cartesian?n.cartesian.dataToPoint(i):n.axis?n.axis.toGlobalCoord(n.axis.dataToCoord(i)):null},t.prototype.convertFromPixel=function(e,r,i){var n=this._findConvertTarget(r);return n.cartesian?n.cartesian.pointToData(i):n.axis?n.axis.coordToData(n.axis.toLocalCoord(i)):null},t.prototype._findConvertTarget=function(e){var r=e.seriesModel,i=e.xAxisModel||r&&r.getReferringComponents("xAxis",Je).models[0],n=e.yAxisModel||r&&r.getReferringComponents("yAxis",Je).models[0],a=e.gridModel,o=this._coordsList,s,l;if(r)s=r.coordinateSystem,Dt(o,s)<0&&(s=null);else if(i&&n)s=this.getCartesian(i.componentIndex,n.componentIndex);else if(i)l=this.getAxis("x",i.componentIndex);else if(n)l=this.getAxis("y",n.componentIndex);else if(a){var u=a.coordinateSystem;u===this&&(s=this._coordsList[0])}return{cartesian:s,axis:l}},t.prototype.containPoint=function(e){var r=this._coordsList[0];if(r)return r.containPoint(e)},t.prototype._initCartesian=function(e,r,i){var n=this,a=this,o={left:!1,right:!1,top:!1,bottom:!1},s={x:{},y:{}},l={x:0,y:0};if(r.eachComponent("xAxis",u("x"),this),r.eachComponent("yAxis",u("y"),this),!l.x||!l.y){this._axesMap={},this._axesList=[];return}this._axesMap=s,M(s.x,function(f,h){M(s.y,function(v,c){var d="x"+h+"y"+c,p=new OO(d);p.master=n,p.model=e,n._coordsMap[d]=p,n._coordsList.push(p),p.addAxis(f),p.addAxis(v)})});function u(f){return function(h,v){if(Vc(h,e)){var c=h.get("position");f==="x"?c!=="top"&&c!=="bottom"&&(c=o.bottom?"top":"bottom"):c!=="left"&&c!=="right"&&(c=o.left?"right":"left"),o[c]=!0;var d=new FO(f,Ww(h),[0,0],h.get("type"),c),p=d.type==="category";d.onBand=p&&h.get("boundaryGap"),d.inverse=h.get("inverse"),h.axis=d,d.model=h,d.grid=a,d.index=v,a._axesList.push(d),s[f][v]=d,l[f]++}}}},t.prototype._updateScale=function(e,r){M(this._axesList,function(n){if(n.scale.setExtent(1/0,-1/0),n.type==="category"){var a=n.model.get("categorySortInfo");n.scale.setSortInfo(a)}}),e.eachSeries(function(n){if(W0(n)){var a=X0(n),o=a.xAxisModel,s=a.yAxisModel;if(!Vc(o,r)||!Vc(s,r))return;var l=this.getCartesian(o.componentIndex,s.componentIndex),u=n.getData(),f=l.getAxis("x"),h=l.getAxis("y");i(u,f),i(u,h)}},this);function i(n,a){M(Yw(n,a.dim),function(o){a.scale.unionExtentFromData(n,o)})}},t.prototype.getTooltipAxes=function(e){var r=[],i=[];return M(this.getCartesians(),function(n){var a=e!=null&&e!=="auto"?n.getAxis(e):n.getBaseAxis(),o=n.getOtherAxis(a);Dt(r,a)<0&&r.push(a),Dt(i,o)<0&&i.push(o)}),{baseAxes:r,otherAxes:i}},t.create=function(e,r){var i=[];return e.eachComponent("grid",function(n,a){var o=new t(n,e,r);o.name="grid_"+a,o.resize(n,r,!0),n.coordinateSystem=o,i.push(o)}),e.eachSeries(function(n){if(W0(n)){var a=X0(n),o=a.xAxisModel,s=a.yAxisModel,l=o.getCoordSysModel(),u=l.coordinateSystem;n.coordinateSystem=u.getCartesian(o.componentIndex,s.componentIndex)}}),i},t.dimensions=Md,t}();function Vc(t,e){return t.getCoordSysModel()===e}function Y0(t,e,r,i){r.getAxesOnZeroOf=function(){return a?[a]:[]};var n=t[e],a,o=r.model,s=o.get(["axisLine","onZero"]),l=o.get(["axisLine","onZeroAxisIndex"]);if(!s)return;if(l!=null)$0(n[l])&&(a=n[l]);else for(var u in n)if(n.hasOwnProperty(u)&&$0(n[u])&&!i[f(n[u])]){a=n[u];break}a&&(i[f(a)]=!0);function f(h){return h.dim+"_"+h.index}}function $0(t){return t&&t.type!=="category"&&t.type!=="time"&&QI(t)}function UO(t,e){var r=t.getExtent(),i=r[0]+r[1];t.toGlobalCoord=t.dim==="x"?function(n){return n+e}:function(n){return i-n+e},t.toLocalCoord=t.dim==="x"?function(n){return n-e}:function(n){return i-n+e}}const HO=zO;var ji=Math.PI,ia=function(){function t(e,r){this.group=new ue,this.opt=r,this.axisModel=e,Lt(r,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var i=new ue({x:r.position[0],y:r.position[1],rotation:r.rotation});i.updateTransform(),this._transformGroup=i}return t.prototype.hasBuilder=function(e){return!!Z0[e]},t.prototype.add=function(e){Z0[e](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(e,r,i){var n=Zx(r-e),a,o;return Ju(n)?(o=i>0?"top":"bottom",a="center"):Ju(n-ji)?(o=i>0?"bottom":"top",a="center"):(o="middle",n>0&&n<ji?a=i>0?"right":"left":a=i>0?"left":"right"),{rotation:n,textAlign:a,textVerticalAlign:o}},t.makeAxisEventDataBase=function(e){var r={componentType:e.mainType,componentIndex:e.componentIndex};return r[e.mainType+"Index"]=e.componentIndex,r},t.isLabelSilent=function(e){var r=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||r&&r.show)},t}(),Z0={axisLine:function(t,e,r,i){var n=e.get(["axisLine","show"]);if(n==="auto"&&t.handleAutoShown&&(n=t.handleAutoShown("axisLine")),!!n){var a=e.axis.getExtent(),o=i.transform,s=[a[0],0],l=[a[1],0],u=s[0]>l[0];o&&(Lr(s,s,o),Lr(l,l,o));var f=U({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),h=new la({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:f,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});Bs(h.shape,h.style.lineWidth),h.anid="line",r.add(h);var v=e.get(["axisLine","symbol"]);if(v!=null){var c=e.get(["axisLine","symbolSize"]);Z(v)&&(v=[v,v]),(Z(c)||Qt(c))&&(c=[c,c]);var d=tw(e.get(["axisLine","symbolOffset"])||0,c),p=c[0],g=c[1];M([{rotate:t.rotation+Math.PI/2,offset:d[0],r:0},{rotate:t.rotation-Math.PI/2,offset:d[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(m,_){if(v[_]!=="none"&&v[_]!=null){var y=$r(v[_],-p/2,-g/2,p,g,f.stroke,!0),x=m.r+m.offset,S=u?l:s;y.attr({rotation:m.rotate,x:S[0]+x*Math.cos(t.rotation),y:S[1]-x*Math.sin(t.rotation),silent:!0,z2:11}),r.add(y)}})}}},axisTickLabel:function(t,e,r,i){var n=WO(r,i,e,t),a=YO(r,i,e,t);if(GO(e,a,n),XO(r,i,e,t.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=e2(K(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));i2(o)}},axisName:function(t,e,r,i){var n=fo(t.axisName,e.get("name"));if(n){var a=e.get("nameLocation"),o=t.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,u=e.axis.getExtent(),f=u[0]>u[1]?-1:1,h=[a==="start"?u[0]-f*l:a==="end"?u[1]+f*l:(u[0]+u[1])/2,K0(a)?t.labelOffset+o*l:0],v,c=e.get("nameRotate");c!=null&&(c=c*ji/180);var d;K0(a)?v=ia.innerTextLayout(t.rotation,c??t.rotation,o):(v=VO(t.rotation,a,c||0,u),d=t.axisNameAvailableWidth,d!=null&&(d=Math.abs(d/Math.sin(v.rotation)),!isFinite(d)&&(d=null)));var p=s.getFont(),g=e.get("nameTruncate",!0)||{},m=g.ellipsis,_=fo(t.nameTruncateMaxWidth,g.maxWidth,d),y=new Jt({x:h[0],y:h[1],rotation:v.rotation,silent:ia.isLabelSilent(e),style:tr(s,{text:n,font:p,overflow:"truncate",width:_,ellipsis:m,fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:s.get("align")||v.textAlign,verticalAlign:s.get("verticalAlign")||v.textVerticalAlign}),z2:1});if(Jf({el:y,componentModel:e,itemName:n}),y.__fullText=n,y.anid="name",e.get("triggerEvent")){var x=ia.makeAxisEventDataBase(e);x.targetType="axisName",x.name=n,kt(y).eventData=x}i.add(y),y.updateTransform(),r.add(y),y.decomposeTransform()}}};function VO(t,e,r,i){var n=Zx(r-t),a,o,s=i[0]>i[1],l=e==="start"&&!s||e!=="start"&&s;return Ju(n-ji/2)?(o=l?"bottom":"top",a="center"):Ju(n-ji*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",n<ji*1.5&&n>ji/2?a=l?"left":"right":a=l?"right":"left"),{rotation:n,textAlign:a,textVerticalAlign:o}}function GO(t,e,r){if(!Xw(t.axis)){var i=t.get(["axisLabel","showMinLabel"]),n=t.get(["axisLabel","showMaxLabel"]);e=e||[],r=r||[];var a=e[0],o=e[1],s=e[e.length-1],l=e[e.length-2],u=r[0],f=r[1],h=r[r.length-1],v=r[r.length-2];i===!1?(mr(a),mr(u)):q0(a,o)&&(i?(mr(o),mr(f)):(mr(a),mr(u))),n===!1?(mr(s),mr(h)):q0(l,s)&&(n?(mr(l),mr(v)):(mr(s),mr(h)))}}function mr(t){t&&(t.ignore=!0)}function q0(t,e){var r=t&&t.getBoundingRect().clone(),i=e&&e.getBoundingRect().clone();if(!(!r||!i)){var n=fp([]);return hp(n,n,-t.rotation),r.applyTransform(io([],n,t.getLocalTransform())),i.applyTransform(io([],n,e.getLocalTransform())),r.intersect(i)}}function K0(t){return t==="middle"||t==="center"}function h2(t,e,r,i,n){for(var a=[],o=[],s=[],l=0;l<t.length;l++){var u=t[l].coord;o[0]=u,o[1]=0,s[0]=u,s[1]=r,e&&(Lr(o,o,e),Lr(s,s,e));var f=new la({shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:i,z2:2,autoBatch:!0,silent:!0});Bs(f.shape,f.style.lineWidth),f.anid=n+"_"+t[l].tickValue,a.push(f)}return a}function WO(t,e,r,i){var n=r.axis,a=r.getModel("axisTick"),o=a.get("show");if(o==="auto"&&i.handleAutoShown&&(o=i.handleAutoShown("axisTick")),!(!o||n.scale.isBlank())){for(var s=a.getModel("lineStyle"),l=i.tickDirection*a.get("length"),u=n.getTicksCoords(),f=h2(u,e.transform,l,Lt(s.getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])}),"ticks"),h=0;h<f.length;h++)t.add(f[h]);return f}}function XO(t,e,r,i){var n=r.axis,a=r.getModel("minorTick");if(!(!a.get("show")||n.scale.isBlank())){var o=n.getMinorTicksCoords();if(o.length)for(var s=a.getModel("lineStyle"),l=i*a.get("length"),u=Lt(s.getLineStyle(),Lt(r.getModel("axisTick").getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])})),f=0;f<o.length;f++)for(var h=h2(o[f],e.transform,l,u,"minorticks_"+f),v=0;v<h.length;v++)t.add(h[v])}}function YO(t,e,r,i){var n=r.axis,a=fo(i.axisLabelShow,r.get(["axisLabel","show"]));if(!(!a||n.scale.isBlank())){var o=r.getModel("axisLabel"),s=o.get("margin"),l=n.getViewLabels(),u=(fo(i.labelRotate,o.get("rotate"))||0)*ji/180,f=ia.innerTextLayout(i.rotation,u,i.labelDirection),h=r.getCategories&&r.getCategories(!0),v=[],c=ia.isLabelSilent(r),d=r.get("triggerEvent");return M(l,function(p,g){var m=n.scale.type==="ordinal"?n.scale.getRawOrdinalNumber(p.tickValue):p.tickValue,_=p.formattedLabel,y=p.rawLabel,x=o;if(h&&h[m]){var S=h[m];j(S)&&S.textStyle&&(x=new Te(S.textStyle,o,r.ecModel))}var T=x.getTextColor()||r.get(["axisLine","lineStyle","color"]),b=n.dataToCoord(m),w=new Jt({x:b,y:i.labelOffset+i.labelDirection*s,rotation:f.rotation,silent:c,z2:10+(p.level||0),style:tr(x,{text:_,align:x.getShallow("align",!0)||f.textAlign,verticalAlign:x.getShallow("verticalAlign",!0)||x.getShallow("baseline",!0)||f.textVerticalAlign,fill:ct(T)?T(n.type==="category"?y:n.type==="value"?m+"":m,g):T})});if(w.anid="label_"+m,d){var A=ia.makeAxisEventDataBase(r);A.targetType="axisLabel",A.value=y,A.tickIndex=g,n.type==="category"&&(A.dataIndex=m),kt(w).eventData=A}e.add(w),w.updateTransform(),v.push(w),t.add(w),w.decomposeTransform()}),v}}const c2=ia;function $O(t,e){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return ZO(r,t,e),r.seriesInvolved&&KO(r,t),r}function ZO(t,e,r){var i=e.getComponent("tooltip"),n=e.getComponent("axisPointer"),a=n.get("link",!0)||[],o=[];M(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=Xs(s.model),u=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=s;var f=s.model,h=f.getModel("tooltip",i);if(M(s.getAxes(),de(p,!1,null)),s.getTooltipAxes&&i&&h.get("show")){var v=h.get("trigger")==="axis",c=h.get(["axisPointer","type"])==="cross",d=s.getTooltipAxes(h.get(["axisPointer","axis"]));(v||c)&&M(d.baseAxes,de(p,c?"cross":!0,v)),c&&M(d.otherAxes,de(p,"cross",!1))}function p(g,m,_){var y=_.model.getModel("axisPointer",n),x=y.get("show");if(!(!x||x==="auto"&&!g&&!Ld(y))){m==null&&(m=y.get("triggerTooltip")),y=g?qO(_,h,n,e,g,m):y;var S=y.get("snap"),T=y.get("triggerEmphasis"),b=Xs(_.model),w=m||S||_.type==="category",A=t.axesInfo[b]={key:b,axis:_,coordSys:s,axisPointerModel:y,triggerTooltip:m,triggerEmphasis:T,involveSeries:w,snap:S,useHandle:Ld(y),seriesModels:[],linkGroup:null};u[b]=A,t.seriesInvolved=t.seriesInvolved||w;var C=jO(a,_);if(C!=null){var E=o[C]||(o[C]={axesInfo:{}});E.axesInfo[b]=A,E.mapper=a[C].mapper,A.linkGroup=E}}}})}function qO(t,e,r,i,n,a){var o=e.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};M(s,function(v){l[v]=ft(o.get(v))}),l.snap=t.type!=="category"&&!!a,o.get("type")==="cross"&&(l.type="line");var u=l.label||(l.label={});if(u.show==null&&(u.show=!1),n==="cross"){var f=o.get(["label","show"]);if(u.show=f??!0,!a){var h=l.lineStyle=o.get("crossStyle");h&&Lt(u,h.textStyle)}}return t.model.getModel("axisPointer",new Te(l,r,i))}function KO(t,e){e.eachSeries(function(r){var i=r.coordinateSystem,n=r.get(["tooltip","trigger"],!0),a=r.get(["tooltip","show"],!0);!i||n==="none"||n===!1||n==="item"||a===!1||r.get(["axisPointer","show"],!0)===!1||M(t.coordSysAxesInfo[Xs(i.model)],function(o){var s=o.axis;i.getAxis(s.dim)===s&&(o.seriesModels.push(r),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=r.getData().count())})})}function jO(t,e){for(var r=e.model,i=e.dim,n=0;n<t.length;n++){var a=t[n]||{};if(Gc(a[i+"AxisId"],r.id)||Gc(a[i+"AxisIndex"],r.componentIndex)||Gc(a[i+"AxisName"],r.name))return n}}function Gc(t,e){return t==="all"||X(t)&&Dt(t,e)>=0||t===e}function QO(t){var e=gg(t);if(e){var r=e.axisPointerModel,i=e.axis.scale,n=r.option,a=r.get("status"),o=r.get("value");o!=null&&(o=i.parse(o));var s=Ld(r);a==null&&(n.status=s?"show":"hide");var l=i.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o<l[0]&&(o=l[0]),n.value=o,s&&(n.status=e.axis.scale.isBlank()?"hide":"show")}}function gg(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[Xs(t)]}function JO(t){var e=gg(t);return e&&e.axisPointerModel}function Ld(t){return!!t.get(["handle","show"])}function Xs(t){return t.type+"||"+t.id}var j0={},t3=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,i,n,a){this.axisPointerClass&&QO(r),t.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(r,n,!0)},e.prototype.updateAxisPointer=function(r,i,n,a){this._doUpdateAxisPointerClass(r,n,!1)},e.prototype.remove=function(r,i){var n=this._axisPointer;n&&n.remove(i)},e.prototype.dispose=function(r,i){this._disposeAxisPointer(i),t.prototype.dispose.apply(this,arguments)},e.prototype._doUpdateAxisPointerClass=function(r,i,n){var a=e.getAxisPointerClass(this.axisPointerClass);if(a){var o=JO(r);o?(this._axisPointer||(this._axisPointer=new a)).render(r,o,i,n):this._disposeAxisPointer(i)}},e.prototype._disposeAxisPointer=function(r){this._axisPointer&&this._axisPointer.dispose(r),this._axisPointer=null},e.registerAxisPointerClass=function(r,i){j0[r]=i},e.getAxisPointerClass=function(r){return r&&j0[r]},e.type="axis",e}(vr);const v2=t3;var Rd=Kt();function e3(t,e,r,i){var n=r.axis;if(!n.scale.isBlank()){var a=r.getModel("splitArea"),o=a.getModel("areaStyle"),s=o.get("color"),l=i.coordinateSystem.getRect(),u=n.getTicksCoords({tickModel:a,clamp:!0});if(u.length){var f=s.length,h=Rd(t).splitAreaColors,v=ht(),c=0;if(h)for(var d=0;d<u.length;d++){var p=h.get(u[d].tickValue);if(p!=null){c=(p+(f-1)*d)%f;break}}var g=n.toGlobalCoord(u[0].coord),m=o.getAreaStyle();s=X(s)?s:[s];for(var d=1;d<u.length;d++){var _=n.toGlobalCoord(u[d].coord),y=void 0,x=void 0,S=void 0,T=void 0;n.isHorizontal()?(y=g,x=l.y,S=_-y,T=l.height,g=y+S):(y=l.x,x=g,S=l.width,T=_-x,g=x+T);var b=u[d-1].tickValue;b!=null&&v.set(b,c),e.add(new ie({anid:b!=null?"area_"+b:null,shape:{x:y,y:x,width:S,height:T},style:Lt({fill:s[c]},m),autoBatch:!0,silent:!0})),c=(c+1)%f}Rd(t).splitAreaColors=v}}}function r3(t){Rd(t).splitAreaColors=null}var i3=["axisLine","axisTickLabel","axisName"],n3=["splitArea","splitLine","minorSplitLine"],d2=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.axisPointerClass="CartesianAxisPointer",r}return e.prototype.render=function(r,i,n,a){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new ue,this.group.add(this._axisGroup),!!r.get("show")){var s=r.getCoordSysModel(),l=Dd(s,r),u=new c2(r,U({handleAutoShown:function(h){for(var v=s.coordinateSystem.getCartesians(),c=0;c<v.length;c++)if(Td(v[c].getOtherAxis(r.axis).scale))return!0;return!1}},l));M(i3,u.add,u),this._axisGroup.add(u.getGroup()),M(n3,function(h){r.get([h,"show"])&&a3[h](this,this._axisGroup,r,s)},this);var f=a&&a.type==="changeAxisOrder"&&a.isInitSort;f||qT(o,this._axisGroup,r),t.prototype.render.call(this,r,i,n,a)}},e.prototype.remove=function(){r3(this)},e.type="cartesianAxis",e}(v2),a3={splitLine:function(t,e,r,i){var n=r.axis;if(!n.scale.isBlank()){var a=r.getModel("splitLine"),o=a.getModel("lineStyle"),s=o.get("color");s=X(s)?s:[s];for(var l=i.coordinateSystem.getRect(),u=n.isHorizontal(),f=0,h=n.getTicksCoords({tickModel:a}),v=[],c=[],d=o.getLineStyle(),p=0;p<h.length;p++){var g=n.toGlobalCoord(h[p].coord);u?(v[0]=g,v[1]=l.y,c[0]=g,c[1]=l.y+l.height):(v[0]=l.x,v[1]=g,c[0]=l.x+l.width,c[1]=g);var m=f++%s.length,_=h[p].tickValue,y=new la({anid:_!=null?"line_"+h[p].tickValue:null,autoBatch:!0,shape:{x1:v[0],y1:v[1],x2:c[0],y2:c[1]},style:Lt({stroke:s[m]},d),silent:!0});Bs(y.shape,d.lineWidth),e.add(y)}}},minorSplitLine:function(t,e,r,i){var n=r.axis,a=r.getModel("minorSplitLine"),o=a.getModel("lineStyle"),s=i.coordinateSystem.getRect(),l=n.isHorizontal(),u=n.getMinorTicksCoords();if(u.length)for(var f=[],h=[],v=o.getLineStyle(),c=0;c<u.length;c++)for(var d=0;d<u[c].length;d++){var p=n.toGlobalCoord(u[c][d].coord);l?(f[0]=p,f[1]=s.y,h[0]=p,h[1]=s.y+s.height):(f[0]=s.x,f[1]=p,h[0]=s.x+s.width,h[1]=p);var g=new la({anid:"minor_line_"+u[c][d].tickValue,autoBatch:!0,shape:{x1:f[0],y1:f[1],x2:h[0],y2:h[1]},style:v,silent:!0});Bs(g.shape,v.lineWidth),e.add(g)}},splitArea:function(t,e,r,i){e3(t,e,r,i)}},p2=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="xAxis",e}(d2),o3=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=p2.type,r}return e.type="yAxis",e}(d2),s3=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="grid",r}return e.prototype.render=function(r,i){this.group.removeAll(),r.get("show")&&this.group.add(new ie({shape:r.coordinateSystem.getRect(),style:Lt({fill:r.get("backgroundColor")},r.getItemStyle()),silent:!0,z2:-1}))},e.type="grid",e}(vr),Q0={offset:0};function l3(t){t.registerComponentView(s3),t.registerComponentModel(MO),t.registerCoordinateSystem("cartesian2d",HO),H0(t,"x",Cd,Q0),H0(t,"y",Cd,Q0),t.registerComponentView(p2),t.registerComponentView(o3),t.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}var J0="\0_ec_interaction_mutex";function ty(t,e){return!!u3(t)[e]}function u3(t){return t[J0]||(t[J0]={})}da({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},De);var f3=function(t){G(e,t);function e(r){var i=t.call(this)||this;i._zr=r;var n=et(i._mousedownHandler,i),a=et(i._mousemoveHandler,i),o=et(i._mouseupHandler,i),s=et(i._mousewheelHandler,i),l=et(i._pinchHandler,i);return i.enable=function(u,f){this.disable(),this._opt=Lt(ft(f)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),u==null&&(u=!0),(u===!0||u==="move"||u==="pan")&&(r.on("mousedown",n),r.on("mousemove",a),r.on("mouseup",o)),(u===!0||u==="scale"||u==="zoom")&&(r.on("mousewheel",s),r.on("pinch",l))},i.disable=function(){r.off("mousedown",n),r.off("mousemove",a),r.off("mouseup",o),r.off("mousewheel",s),r.off("pinch",l)},i}return e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(r){this.pointerChecker=r},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(r){if(!Kg(r)){for(var i=r.target;i;){if(i.draggable)return;i=i.__hostTarget||i.parent}var n=r.offsetX,a=r.offsetY;this.pointerChecker&&this.pointerChecker(r,n,a)&&(this._x=n,this._y=a,this._dragging=!0)}},e.prototype._mousemoveHandler=function(r){if(!(!this._dragging||!Ru("moveOnMouseMove",r,this._opt)||r.gestureEvent==="pinch"||ty(this._zr,"globalPan"))){var i=r.offsetX,n=r.offsetY,a=this._x,o=this._y,s=i-a,l=n-o;this._x=i,this._y=n,this._opt.preventDefaultMouseMove&&Ei(r.event),g2(this,"pan","moveOnMouseMove",r,{dx:s,dy:l,oldX:a,oldY:o,newX:i,newY:n,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(r){Kg(r)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(r){var i=Ru("zoomOnMouseWheel",r,this._opt),n=Ru("moveOnMouseWheel",r,this._opt),a=r.wheelDelta,o=Math.abs(a),s=r.offsetX,l=r.offsetY;if(!(a===0||!i&&!n)){if(i){var u=o>3?1.4:o>1?1.2:1.1,f=a>0?u:1/u;Wc(this,"zoom","zoomOnMouseWheel",r,{scale:f,originX:s,originY:l,isAvailableBehavior:null})}if(n){var h=Math.abs(a),v=(a>0?1:-1)*(h>3?.4:h>1?.15:.05);Wc(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:v,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(r){if(!ty(this._zr,"globalPan")){var i=r.pinchScale>1?1.1:1/1.1;Wc(this,"zoom",null,r,{scale:i,originX:r.pinchX,originY:r.pinchY,isAvailableBehavior:null})}},e}(Kr);function Wc(t,e,r,i,n){t.pointerChecker&&t.pointerChecker(i,n.originX,n.originY)&&(Ei(i.event),g2(t,e,r,i,n))}function g2(t,e,r,i,n){n.isAvailableBehavior=et(Ru,null,r,i),t.trigger(e,n)}function Ru(t,e,r){var i=r[t];return!t||i&&(!Z(i)||e.event[i+"Key"])}const h3=f3;var Ys=M,c3=j,bf=-1,mg=function(){function t(e){var r=e.mappingMethod,i=e.type,n=this.option=ft(e);this.type=i,this.mappingMethod=r,this._normalizeData=p3[r];var a=t.visualHandlers[i];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[r],r==="piecewise"?(Xc(n),v3(n)):r==="category"?n.categories?d3(n):Xc(n,!0):(Rr(r!=="linear"||n.dataExtent),Xc(n))}return t.prototype.mapValueToVisual=function(e){var r=this._normalizeData(e);return this._normalizedToVisual(r,e)},t.prototype.getNormalizer=function(){return et(this._normalizeData,this)},t.listVisualTypes=function(){return yt(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(e,r,i){j(e)?M(e,r,i):r.call(i,e)},t.mapVisual=function(e,r,i){var n,a=X(e)?[]:j(e)?{}:(n=!0,null);return t.eachVisual(e,function(o,s){var l=r.call(i,o,s);n?a=l:a[s]=l}),a},t.retrieveVisuals=function(e){var r={},i;return e&&Ys(t.visualHandlers,function(n,a){e.hasOwnProperty(a)&&(r[a]=e[a],i=!0)}),i?r:null},t.prepareVisualTypes=function(e){if(X(e))e=e.slice();else if(c3(e)){var r=[];Ys(e,function(i,n){r.push(n)}),e=r}else return[];return e.sort(function(i,n){return n==="color"&&i!=="color"&&i.indexOf("color")===0?1:-1}),e},t.dependsOn=function(e,r){return r==="color"?!!(e&&e.indexOf(r)===0):e===r},t.findPieceIndex=function(e,r,i){for(var n,a=1/0,o=0,s=r.length;o<s;o++){var l=r[o].value;if(l!=null){if(l===e||Z(l)&&l===e+"")return o;i&&v(l,o)}}for(var o=0,s=r.length;o<s;o++){var u=r[o],f=u.interval,h=u.close;if(f){if(f[0]===-1/0){if(eu(h[1],e,f[1]))return o}else if(f[1]===1/0){if(eu(h[0],f[0],e))return o}else if(eu(h[0],f[0],e)&&eu(h[1],e,f[1]))return o;i&&v(f[0],o),i&&v(f[1],o)}}if(i)return e===1/0?r.length-1:e===-1/0?0:n;function v(c,d){var p=Math.abs(c-e);p<a&&(a=p,n=d)}},t.visualHandlers={color:{applyVisual:qo("color"),getColorMapper:function(){var e=this.option;return et(e.mappingMethod==="category"?function(r,i){return!i&&(r=this._normalizeData(r)),cs.call(this,r)}:function(r,i,n){var a=!!n;return!i&&(r=this._normalizeData(r)),n=Fh(r,e.parsedVisual,n),a?n:bi(n,"rgba")},this)},_normalizedToVisual:{linear:function(e){return bi(Fh(e,this.option.parsedVisual),"rgba")},category:cs,piecewise:function(e,r){var i=Id.call(this,r);return i==null&&(i=bi(Fh(e,this.option.parsedVisual),"rgba")),i},fixed:Vn}},colorHue:tu(function(e,r){return kh(e,r)}),colorSaturation:tu(function(e,r){return kh(e,null,r)}),colorLightness:tu(function(e,r){return kh(e,null,null,r)}),colorAlpha:tu(function(e,r){return gE(e,r)}),decal:{applyVisual:qo("decal"),_normalizedToVisual:{linear:null,category:cs,piecewise:null,fixed:null}},opacity:{applyVisual:qo("opacity"),_normalizedToVisual:Pd([0,1])},liftZ:{applyVisual:qo("liftZ"),_normalizedToVisual:{linear:Vn,category:Vn,piecewise:Vn,fixed:Vn}},symbol:{applyVisual:function(e,r,i){var n=this.mapValueToVisual(e);i("symbol",n)},_normalizedToVisual:{linear:ey,category:cs,piecewise:function(e,r){var i=Id.call(this,r);return i==null&&(i=ey.call(this,e)),i},fixed:Vn}},symbolSize:{applyVisual:qo("symbolSize"),_normalizedToVisual:Pd([0,1])}},t}();function v3(t){var e=t.pieceList;t.hasSpecialVisual=!1,M(e,function(r,i){r.originIndex=i,r.visual!=null&&(t.hasSpecialVisual=!0)})}function d3(t){var e=t.categories,r=t.categoryMap={},i=t.visual;if(Ys(e,function(o,s){r[o]=s}),!X(i)){var n=[];j(i)?Ys(i,function(o,s){var l=r[s];n[l??bf]=o}):n[bf]=i,i=m2(t,n)}for(var a=e.length-1;a>=0;a--)i[a]==null&&(delete r[e[a]],e.pop())}function Xc(t,e){var r=t.visual,i=[];j(r)?Ys(r,function(a){i.push(a)}):r!=null&&i.push(r);var n={color:1,symbol:1};!e&&i.length===1&&!n.hasOwnProperty(t.type)&&(i[1]=i[0]),m2(t,i)}function tu(t){return{applyVisual:function(e,r,i){var n=this.mapValueToVisual(e);i("color",t(r("color"),n))},_normalizedToVisual:Pd([0,1])}}function ey(t){var e=this.option.visual;return e[Math.round(ae(t,[0,1],[0,e.length-1],!0))]||{}}function qo(t){return function(e,r,i){i(t,this.mapValueToVisual(e))}}function cs(t){var e=this.option.visual;return e[this.option.loop&&t!==bf?t%e.length:t]}function Vn(){return this.option.visual[0]}function Pd(t){return{linear:function(e){return ae(e,t,this.option.visual,!0)},category:cs,piecewise:function(e,r){var i=Id.call(this,r);return i==null&&(i=ae(e,t,this.option.visual,!0)),i},fixed:Vn}}function Id(t){var e=this.option,r=e.pieceList;if(e.hasSpecialVisual){var i=mg.findPieceIndex(t,r),n=r[i];if(n&&n.visual)return n.visual[this.type]}}function m2(t,e){return t.visual=e,t.type==="color"&&(t.parsedVisual=K(e,function(r){var i=Xe(r);return i||[0,0,0,1]})),e}var p3={linear:function(t){return ae(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,r=mg.findPieceIndex(t,e,!0);if(r!=null)return ae(r,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return e??bf},fixed:De};function eu(t,e,r){return t?e<=r:e<r}const er=mg;function ul(t,e,r,i,n,a){t=t||0;var o=r[1]-r[0];if(n!=null&&(n=Pa(n,[0,o])),a!=null&&(a=Math.max(a,n??0)),i==="all"){var s=Math.abs(e[1]-e[0]);s=Pa(s,[0,o]),n=a=Pa(s,[n,a]),i=0}e[0]=Pa(e[0],r),e[1]=Pa(e[1],r);var l=Yc(e,i);e[i]+=t;var u=n||0,f=r.slice();l.sign<0?f[0]+=u:f[1]-=u,e[i]=Pa(e[i],f);var h;return h=Yc(e,i),n!=null&&(h.sign!==l.sign||h.span<n)&&(e[1-i]=e[i]+l.sign*n),h=Yc(e,i),a!=null&&h.span>a&&(e[1-i]=e[i]+h.sign*a),e}function Yc(t,e){var r=t[e]-t[1-e];return{span:Math.abs(r),sign:r>0?-1:r<0?1:e?-1:1}}function Pa(t,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,t))}function g3(t,e,r,i){return t&&(t.legacy||t.legacy!==!1&&!r&&!i&&e!=="tspan"&&(e==="text"||_t(t,"text")))}function m3(t,e,r){var i=t,n,a,o;if(e==="text")o=i;else{o={},_t(i,"text")&&(o.text=i.text),_t(i,"rich")&&(o.rich=i.rich),_t(i,"textFill")&&(o.fill=i.textFill),_t(i,"textStroke")&&(o.stroke=i.textStroke),_t(i,"fontFamily")&&(o.fontFamily=i.fontFamily),_t(i,"fontSize")&&(o.fontSize=i.fontSize),_t(i,"fontStyle")&&(o.fontStyle=i.fontStyle),_t(i,"fontWeight")&&(o.fontWeight=i.fontWeight),a={type:"text",style:o,silent:!0},n={};var s=_t(i,"textPosition");r?n.position=s?i.textPosition:"inside":s&&(n.position=i.textPosition),_t(i,"textPosition")&&(n.position=i.textPosition),_t(i,"textOffset")&&(n.offset=i.textOffset),_t(i,"textRotation")&&(n.rotation=i.textRotation),_t(i,"textDistance")&&(n.distance=i.textDistance)}return ry(o,t),M(o.rich,function(l){ry(l,l)}),{textConfig:n,textContent:a}}function ry(t,e){e&&(e.font=e.textFont||e.font,_t(e,"textStrokeWidth")&&(t.lineWidth=e.textStrokeWidth),_t(e,"textAlign")&&(t.align=e.textAlign),_t(e,"textVerticalAlign")&&(t.verticalAlign=e.textVerticalAlign),_t(e,"textLineHeight")&&(t.lineHeight=e.textLineHeight),_t(e,"textWidth")&&(t.width=e.textWidth),_t(e,"textHeight")&&(t.height=e.textHeight),_t(e,"textBackgroundColor")&&(t.backgroundColor=e.textBackgroundColor),_t(e,"textPadding")&&(t.padding=e.textPadding),_t(e,"textBorderColor")&&(t.borderColor=e.textBorderColor),_t(e,"textBorderWidth")&&(t.borderWidth=e.textBorderWidth),_t(e,"textBorderRadius")&&(t.borderRadius=e.textBorderRadius),_t(e,"textBoxShadowColor")&&(t.shadowColor=e.textBoxShadowColor),_t(e,"textBoxShadowBlur")&&(t.shadowBlur=e.textBoxShadowBlur),_t(e,"textBoxShadowOffsetX")&&(t.shadowOffsetX=e.textBoxShadowOffsetX),_t(e,"textBoxShadowOffsetY")&&(t.shadowOffsetY=e.textBoxShadowOffsetY))}var _2={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},iy=yt(_2);ha(ci,function(t,e){return t[e]=1,t},{});ci.join(", ");var Af=["","style","shape","extra"],po=Kt();function _g(t,e,r,i,n){var a=t+"Animation",o=Rp(t,i,n)||{},s=po(e).userDuring;return o.duration>0&&(o.during=s?et(w3,{el:e,userDuring:s}):null,o.setToFinal=!0,o.scope=t),U(o,r[a]),o}function $c(t,e,r,i){i=i||{};var n=i.dataIndex,a=i.isInit,o=i.clearStyle,s=r.isAnimationEnabled(),l=po(t),u=e.style;l.userDuring=e.during;var f={},h={};if(A3(t,e,h),ay("shape",e,h),ay("extra",e,h),!a&&s&&(b3(t,e,f),ny("shape",t,e,f),ny("extra",t,e,f),E3(t,e,u,f)),h.style=u,y3(t,h,o),T3(t,e),s)if(a){var v={};M(Af,function(d){var p=d?e[d]:e;p&&p.enterFrom&&(d&&(v[d]=v[d]||{}),U(d?v[d]:v,p.enterFrom))});var c=_g("enter",t,e,r,n);c.duration>0&&t.animateFrom(v,c)}else x3(t,e,n||0,r,f);y2(t,e),u?t.dirty():t.markRedraw()}function y2(t,e){for(var r=po(t).leaveToProps,i=0;i<Af.length;i++){var n=Af[i],a=n?e[n]:e;a&&a.leaveTo&&(r||(r=po(t).leaveToProps={}),n&&(r[n]=r[n]||{}),U(n?r[n]:r,a.leaveTo))}}function _3(t,e,r,i){if(t){var n=t.parent,a=po(t).leaveToProps;if(a){var o=_g("update",t,e,r,0);o.done=function(){n.remove(t),i&&i()},t.animateTo(a,o)}else n.remove(t),i&&i()}}function na(t){return t==="all"}function y3(t,e,r){var i=e.style;if(!t.isGroup&&i){if(r){t.useStyle({});for(var n=t.animators,a=0;a<n.length;a++){var o=n[a];o.targetName==="style"&&o.changeTarget(t.style)}}t.setStyle(i)}e&&(e.style=null,e&&t.attr(e),e.style=i)}function x3(t,e,r,i,n){if(n){var a=_g("update",t,e,i,r);a.duration>0&&t.animateFrom(n,a)}}function T3(t,e){_t(e,"silent")&&(t.silent=e.silent),_t(e,"ignore")&&(t.ignore=e.ignore),t instanceof ca&&_t(e,"invisible")&&(t.invisible=e.invisible),t instanceof Ht&&_t(e,"autoBatch")&&(t.autoBatch=e.autoBatch)}var ri={},S3={setTransform:function(t,e){return ri.el[t]=e,this},getTransform:function(t){return ri.el[t]},setShape:function(t,e){var r=ri.el,i=r.shape||(r.shape={});return i[t]=e,r.dirtyShape&&r.dirtyShape(),this},getShape:function(t){var e=ri.el.shape;if(e)return e[t]},setStyle:function(t,e){var r=ri.el,i=r.style;return i&&(i[t]=e,r.dirtyStyle&&r.dirtyStyle()),this},getStyle:function(t){var e=ri.el.style;if(e)return e[t]},setExtra:function(t,e){var r=ri.el.extra||(ri.el.extra={});return r[t]=e,this},getExtra:function(t){var e=ri.el.extra;if(e)return e[t]}};function w3(){var t=this,e=t.el;if(e){var r=po(e).userDuring,i=t.userDuring;if(r!==i){t.el=t.userDuring=null;return}ri.el=e,i(S3)}}function ny(t,e,r,i){var n=r[t];if(n){var a=e[t],o;if(a){var s=r.transition,l=n.transition;if(l)if(!o&&(o=i[t]={}),na(l))U(o,a);else for(var u=ge(l),f=0;f<u.length;f++){var h=u[f],v=a[h];o[h]=v}else if(na(s)||Dt(s,t)>=0){!o&&(o=i[t]={});for(var c=yt(a),f=0;f<c.length;f++){var h=c[f],v=a[h];C3(n[h],v)&&(o[h]=v)}}}}}function ay(t,e,r){var i=e[t];if(i)for(var n=r[t]={},a=yt(i),o=0;o<a.length;o++){var s=a[o];n[s]=_s(i[s])}}function b3(t,e,r){for(var i=e.transition,n=na(i)?ci:ge(i||[]),a=0;a<n.length;a++){var o=n[a];if(!(o==="style"||o==="shape"||o==="extra")){var s=t[o];r[o]=s}}}function A3(t,e,r){for(var i=0;i<iy.length;i++){var n=iy[i],a=_2[n],o=e[n];o&&(r[a[0]]=o[0],r[a[1]]=o[1])}for(var i=0;i<ci.length;i++){var s=ci[i];e[s]!=null&&(r[s]=e[s])}}function E3(t,e,r,i){if(r){var n=t.style,a;if(n){var o=r.transition,s=e.transition;if(o&&!na(o)){var l=ge(o);!a&&(a=i.style={});for(var u=0;u<l.length;u++){var f=l[u],h=n[f];a[f]=h}}else if(t.getAnimationStyleProps&&(na(s)||na(o)||Dt(s,"style")>=0)){var v=t.getAnimationStyleProps(),c=v?v.style:null;if(c){!a&&(a=i.style={});for(var d=yt(r),u=0;u<d.length;u++){var f=d[u];if(c[f]){var h=n[f];a[f]=h}}}}}}}function C3(t,e){return $e(t)?t!==e:t!=null&&isFinite(t)}var x2=Kt(),M3=["percent","easing","shape","style","extra"];function D3(t){t.stopAnimation("keyframe"),t.attr(x2(t))}function Nd(t,e,r){if(!(!r.isAnimationEnabled()||!e)){if(X(e)){M(e,function(s){Nd(t,s,r)});return}var i=e.keyframes,n=e.duration;if(r&&n==null){var a=Rp("enter",r,0);n=a&&a.duration}if(!(!i||!n)){var o=x2(t);M(Af,function(s){if(!(s&&!t[s])){var l;i.sort(function(u,f){return u.percent-f.percent}),M(i,function(u){var f=t.animators,h=s?u[s]:u;if(h){var v=yt(h);if(s||(v=ce(v,function(p){return Dt(M3,p)<0})),!!v.length){l||(l=t.animate(s,e.loop,!0),l.scope="keyframe");for(var c=0;c<f.length;c++)f[c]!==l&&f[c].targetName===l.targetName&&f[c].stopTracks(v);s&&(o[s]=o[s]||{});var d=s?o[s]:o;M(v,function(p){d[p]=((s?t[s]:t)||{})[p]}),l.whenWithKeys(n*u.percent,h,v,u.easing)}}}),l&&l.delay(e.delay||0).duration(n).start(e.easing)}})}}}function oy(t,e,r){var i=xo.createCanvas(),n=e.getWidth(),a=e.getHeight(),o=i.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=n+"px",o.height=a+"px",i.setAttribute("data-zr-dom-id",t)),i.width=n*r,i.height=a*r,i}var L3=function(t){G(e,t);function e(r,i,n){var a=t.call(this)||this;a.motionBlur=!1,a.lastFrameAlpha=.7,a.dpr=1,a.virtual=!1,a.config={},a.incremental=!1,a.zlevel=0,a.maxRepaintRectCount=5,a.__dirty=!0,a.__firstTimePaint=!0,a.__used=!1,a.__drawIndex=0,a.__startIndex=0,a.__endIndex=0,a.__prevStartIndex=null,a.__prevEndIndex=null;var o;n=n||Qu,typeof r=="string"?o=oy(r,i,n):j(r)&&(o=r,r=o.id),a.id=r,a.dom=o;var s=o.style;return s&&(dx(o),o.onselectstart=function(){return!1},s.padding="0",s.margin="0",s.borderWidth="0"),a.painter=i,a.dpr=n,a}return e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var r=this.dpr;this.domBack=oy("back-"+this.id,this.painter,r),this.ctxBack=this.domBack.getContext("2d"),r!==1&&this.ctxBack.scale(r,r)},e.prototype.createRepaintRects=function(r,i,n,a){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var o=[],s=this.maxRepaintRectCount,l=!1,u=new Nt(0,0,0,0);function f(_){if(!(!_.isFinite()||_.isZero()))if(o.length===0){var y=new Nt(0,0,0,0);y.copy(_),o.push(y)}else{for(var x=!1,S=1/0,T=0,b=0;b<o.length;++b){var w=o[b];if(w.intersect(_)){var A=new Nt(0,0,0,0);A.copy(w),A.union(_),o[b]=A,x=!0;break}else if(l){u.copy(_),u.union(w);var C=_.width*_.height,E=w.width*w.height,D=u.width*u.height,L=D-C-E;L<S&&(S=L,T=b)}}if(l&&(o[T].union(_),x=!0),!x){var y=new Nt(0,0,0,0);y.copy(_),o.push(y)}l||(l=o.length>=s)}}for(var h=this.__startIndex;h<this.__endIndex;++h){var v=r[h];if(v){var c=v.shouldBePainted(n,a,!0,!0),d=v.__isRendered&&(v.__dirty&fr||!c)?v.getPrevPaintRect():null;d&&f(d);var p=c&&(v.__dirty&fr||!v.__isRendered)?v.getPaintRect():null;p&&f(p)}}for(var h=this.__prevStartIndex;h<this.__prevEndIndex;++h){var v=i[h],c=v.shouldBePainted(n,a,!0,!0);if(v&&(!c||!v.__zr)&&v.__isRendered){var d=v.getPrevPaintRect();d&&f(d)}}var g;do{g=!1;for(var h=0;h<o.length;){if(o[h].isZero()){o.splice(h,1);continue}for(var m=h+1;m<o.length;)o[h].intersect(o[m])?(g=!0,o[h].union(o[m]),o.splice(m,1)):m++;h++}}while(g);return this._paintRects=o,o},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(r,i){var n=this.dpr,a=this.dom,o=a.style,s=this.domBack;o&&(o.width=r+"px",o.height=i+"px"),a.width=r*n,a.height=i*n,s&&(s.width=r*n,s.height=i*n,n!==1&&this.ctxBack.scale(n,n))},e.prototype.clear=function(r,i,n){var a=this.dom,o=this.ctx,s=a.width,l=a.height;i=i||this.clearColor;var u=this.motionBlur&&!r,f=this.lastFrameAlpha,h=this.dpr,v=this;u&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(a,0,0,s/h,l/h));var c=this.domBack;function d(p,g,m,_){if(o.clearRect(p,g,m,_),i&&i!=="transparent"){var y=void 0;if(kf(i)){var x=i.global||i.__width===m&&i.__height===_;y=x&&i.__canvasGradient||pd(o,i,{x:0,y:0,width:m,height:_}),i.__canvasGradient=y,i.__width=m,i.__height=_}else mA(i)&&(i.scaleX=i.scaleX||h,i.scaleY=i.scaleY||h,y=gd(o,i,{dirty:function(){v.setUnpainted(),v.__painter.refresh()}}));o.save(),o.fillStyle=y||i,o.fillRect(p,g,m,_),o.restore()}u&&(o.save(),o.globalAlpha=f,o.drawImage(c,p,g,m,_),o.restore())}!n||u?d(0,0,s,l):n.length&&M(n,function(p){d(p.x*h,p.y*h,p.width*h,p.height*h)})},e}(Kr);const Zc=L3;var sy=1e5,Pn=314159,ru=.01,R3=.001;function P3(t){return t?t.__builtin__?!0:!(typeof t.resize!="function"||typeof t.refresh!="function"):!1}function I3(t,e){var r=document.createElement("div");return r.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",r}var N3=function(){function t(e,r,i,n){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var a=!e.nodeName||e.nodeName.toUpperCase()==="CANVAS";this._opts=i=U({},i||{}),this.dpr=i.devicePixelRatio||Qu,this._singleCanvas=a,this.root=e;var o=e.style;o&&(dx(e),e.innerHTML=""),this.storage=r;var s=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(a){var f=e,h=f.width,v=f.height;i.width!=null&&(h=i.width),i.height!=null&&(v=i.height),this.dpr=i.devicePixelRatio||1,f.width=h*this.dpr,f.height=v*this.dpr,this._width=h,this._height=v;var c=new Zc(f,this,this.dpr);c.__builtin__=!0,c.initContext(),l[Pn]=c,c.zlevel=Pn,s.push(Pn),this._domRoot=e}else{this._width=Qa(e,0,i),this._height=Qa(e,1,i);var u=this._domRoot=I3(this._width,this._height);e.appendChild(u)}}return t.prototype.getType=function(){return"canvas"},t.prototype.isSingleCanvas=function(){return this._singleCanvas},t.prototype.getViewportRoot=function(){return this._domRoot},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.refresh=function(e){var r=this.storage.getDisplayList(!0),i=this._prevDisplayList,n=this._zlevelList;this._redrawId=Math.random(),this._paintList(r,i,e,this._redrawId);for(var a=0;a<n.length;a++){var o=n[a],s=this._layers[o];if(!s.__builtin__&&s.refresh){var l=a===0?this._backgroundColor:null;s.refresh(l)}}return this._opts.useDirtyRect&&(this._prevDisplayList=r.slice()),this},t.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},t.prototype._paintHoverList=function(e){var r=e.length,i=this._hoverlayer;if(i&&i.clear(),!!r){for(var n={inHover:!0,viewWidth:this._width,viewHeight:this._height},a,o=0;o<r;o++){var s=e[o];s.__inHover&&(i||(i=this._hoverlayer=this.getLayer(sy)),a||(a=i.ctx,a.save()),qn(a,s,n,o===r-1))}a&&a.restore()}},t.prototype.getHoverLayer=function(){return this.getLayer(sy)},t.prototype.paintOne=function(e,r){tg(e,r)},t.prototype._paintList=function(e,r,i,n){if(this._redrawId===n){i=i||!1,this._updateLayerStatus(e);var a=this._doPaintList(e,r,i),o=a.finished,s=a.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),s&&this._paintHoverList(e),o)this.eachLayer(function(u){u.afterBrush&&u.afterBrush()});else{var l=this;Xu(function(){l._paintList(e,r,i,n)})}}},t.prototype._compositeManually=function(){var e=this.getLayer(Pn).ctx,r=this._domRoot.width,i=this._domRoot.height;e.clearRect(0,0,r,i),this.eachBuiltinLayer(function(n){n.virtual&&e.drawImage(n.dom,0,0,r,i)})},t.prototype._doPaintList=function(e,r,i){for(var n=this,a=[],o=this._opts.useDirtyRect,s=0;s<this._zlevelList.length;s++){var l=this._zlevelList[s],u=this._layers[l];u.__builtin__&&u!==this._hoverlayer&&(u.__dirty||i)&&a.push(u)}for(var f=!0,h=!1,v=function(p){var g=a[p],m=g.ctx,_=o&&g.createRepaintRects(e,r,c._width,c._height),y=i?g.__startIndex:g.__drawIndex,x=!i&&g.incremental&&Date.now,S=x&&Date.now(),T=g.zlevel===c._zlevelList[0]?c._backgroundColor:null;if(g.__startIndex===g.__endIndex)g.clear(!1,T,_);else if(y===g.__startIndex){var b=e[y];(!b.incremental||!b.notClear||i)&&g.clear(!1,T,_)}y===-1&&(console.error("For some unknown reason. drawIndex is -1"),y=g.__startIndex);var w,A=function(L){var R={inHover:!1,allClipped:!1,prevEl:null,viewWidth:n._width,viewHeight:n._height};for(w=y;w<g.__endIndex;w++){var N=e[w];if(N.__inHover&&(h=!0),n._doPaintEl(N,g,o,L,R,w===g.__endIndex-1),x){var I=Date.now()-S;if(I>15)break}}R.prevElClipPaths&&m.restore()};if(_)if(_.length===0)w=g.__endIndex;else for(var C=c.dpr,E=0;E<_.length;++E){var D=_[E];m.save(),m.beginPath(),m.rect(D.x*C,D.y*C,D.width*C,D.height*C),m.clip(),A(D),m.restore()}else m.save(),A(),m.restore();g.__drawIndex=w,g.__drawIndex<g.__endIndex&&(f=!1)},c=this,d=0;d<a.length;d++)v(d);return At.wxa&&M(this._layers,function(p){p&&p.ctx&&p.ctx.draw&&p.ctx.draw()}),{finished:f,needsRefreshHover:h}},t.prototype._doPaintEl=function(e,r,i,n,a,o){var s=r.ctx;if(i){var l=e.getPaintRect();(!n||l&&l.intersect(n))&&(qn(s,e,a,o),e.setPrevPaintRect(l))}else qn(s,e,a,o)},t.prototype.getLayer=function(e,r){this._singleCanvas&&!this._needsManuallyCompositing&&(e=Pn);var i=this._layers[e];return i||(i=new Zc("zr_"+e,this,this.dpr),i.zlevel=e,i.__builtin__=!0,this._layerConfig[e]?dt(i,this._layerConfig[e],!0):this._layerConfig[e-ru]&&dt(i,this._layerConfig[e-ru],!0),r&&(i.virtual=r),this.insertLayer(e,i),i.initContext()),i},t.prototype.insertLayer=function(e,r){var i=this._layers,n=this._zlevelList,a=n.length,o=this._domRoot,s=null,l=-1;if(!i[e]&&P3(r)){if(a>0&&e>n[0]){for(l=0;l<a-1&&!(n[l]<e&&n[l+1]>e);l++);s=i[n[l]]}if(n.splice(l+1,0,e),i[e]=r,!r.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(r.dom,u.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.__painter=this}},t.prototype.eachLayer=function(e,r){for(var i=this._zlevelList,n=0;n<i.length;n++){var a=i[n];e.call(r,this._layers[a],a)}},t.prototype.eachBuiltinLayer=function(e,r){for(var i=this._zlevelList,n=0;n<i.length;n++){var a=i[n],o=this._layers[a];o.__builtin__&&e.call(r,o,a)}},t.prototype.eachOtherLayer=function(e,r){for(var i=this._zlevelList,n=0;n<i.length;n++){var a=i[n],o=this._layers[a];o.__builtin__||e.call(r,o,a)}},t.prototype.getLayers=function(){return this._layers},t.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(h,v){h.__dirty=h.__used=!1});function r(h){a&&(a.__endIndex!==h&&(a.__dirty=!0),a.__endIndex=h)}if(this._singleCanvas)for(var i=1;i<e.length;i++){var n=e[i];if(n.zlevel!==e[i-1].zlevel||n.incremental){this._needsManuallyCompositing=!0;break}}var a=null,o=0,s,l;for(l=0;l<e.length;l++){var n=e[l],u=n.zlevel,f=void 0;s!==u&&(s=u,o=0),n.incremental?(f=this.getLayer(u+R3,this._needsManuallyCompositing),f.incremental=!0,o=1):f=this.getLayer(u+(o>0?ru:0),this._needsManuallyCompositing),f.__builtin__||op("ZLevel "+u+" has been used by unkown layer "+f.id),f!==a&&(f.__used=!0,f.__startIndex!==l&&(f.__dirty=!0),f.__startIndex=l,f.incremental?f.__drawIndex=-1:f.__drawIndex=l,r(l),a=f),n.__dirty&fr&&!n.__inHover&&(f.__dirty=!0,f.incremental&&f.__drawIndex<0&&(f.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(h,v){!h.__used&&h.getElementCount()>0&&(h.__dirty=!0,h.__startIndex=h.__endIndex=h.__drawIndex=0),h.__dirty&&h.__drawIndex<0&&(h.__drawIndex=h.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(e){e.clear()},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e,M(this._layers,function(r){r.setUnpainted()})},t.prototype.configLayer=function(e,r){if(r){var i=this._layerConfig;i[e]?dt(i[e],r,!0):i[e]=r;for(var n=0;n<this._zlevelList.length;n++){var a=this._zlevelList[n];if(a===e||a===e+ru){var o=this._layers[a];dt(o,i[e],!0)}}}},t.prototype.delLayer=function(e){var r=this._layers,i=this._zlevelList,n=r[e];n&&(n.dom.parentNode.removeChild(n.dom),delete r[e],i.splice(Dt(i,e),1))},t.prototype.resize=function(e,r){if(this._domRoot.style){var i=this._domRoot;i.style.display="none";var n=this._opts,a=this.root;if(e!=null&&(n.width=e),r!=null&&(n.height=r),e=Qa(a,0,n),r=Qa(a,1,n),i.style.display="",this._width!==e||r!==this._height){i.style.width=e+"px",i.style.height=r+"px";for(var o in this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,r);this.refresh(!0)}this._width=e,this._height=r}else{if(e==null||r==null)return;this._width=e,this._height=r,this.getLayer(Pn).resize(e,r)}return this},t.prototype.clearLayer=function(e){var r=this._layers[e];r&&r.clear()},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},t.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[Pn].dom;var r=new Zc("image",this,e.pixelRatio||this.dpr);r.initContext(),r.clear(!1,e.backgroundColor||this._backgroundColor);var i=r.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var n=r.dom.width,a=r.dom.height;this.eachLayer(function(h){h.__builtin__?i.drawImage(h.dom,0,0,n,a):h.renderToCanvas&&(i.save(),h.renderToCanvas(i),i.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),l=0,u=s.length;l<u;l++){var f=s[l];qn(i,f,o,l===u-1)}return r.dom},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t}();const O3=N3;function T2(t){t.registerPainter("canvas",O3)}var B3=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.prototype.init=function(r,i,n){t.prototype.init.call(this,r,i,n),this._sourceManager=new BS(this),k_(this)},e.prototype.mergeOption=function(r,i){t.prototype.mergeOption.call(this,r,i),k_(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:fi},e}(Vt),F3=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.type="dataset",e}(vr);function S2(t){t.registerComponentModel(B3),t.registerComponentView(F3)}nr([T2,S2]);nr(PN);function ly(t,e,r){typeof e=="object"&&(r=e,e=null);var i=this,n;if(!(t instanceof Function)){n=[];for(var a in t)t.hasOwnProperty(a)&&n.push(a)}var o=function(l){if(i.apply(this,arguments),t instanceof Function?uy(this,t.call(this,l)):k3(this,t,n),this.constructor===o)for(var u=o.__initializers__,f=0;f<u.length;f++)u[f].apply(this,arguments)};o.__super__=i,i.__initializers__?o.__initializers__=i.__initializers__.slice():o.__initializers__=[],e&&o.__initializers__.push(e);var s=function(){};return s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o,uy(o.prototype,r),o.extend=i.extend,o.derive=i.extend,o}function uy(t,e){if(e)for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])}function k3(t,e,r){for(var i=0;i<r.length;i++){var n=r[i];t[n]=e[n]}}const z3={extend:ly,derive:ly};function U3(t,e){this.action=t,this.context=e}var H3={trigger:function(t){if(this.hasOwnProperty("__handlers__")&&this.__handlers__.hasOwnProperty(t)){var e=this.__handlers__[t],r=e.length,i=-1,n=arguments;switch(n.length){case 1:for(;++i<r;)e[i].action.call(e[i].context);return;case 2:for(;++i<r;)e[i].action.call(e[i].context,n[1]);return;case 3:for(;++i<r;)e[i].action.call(e[i].context,n[1],n[2]);return;case 4:for(;++i<r;)e[i].action.call(e[i].context,n[1],n[2],n[3]);return;case 5:for(;++i<r;)e[i].action.call(e[i].context,n[1],n[2],n[3],n[4]);return;default:for(;++i<r;)e[i].action.apply(e[i].context,Array.prototype.slice.call(n,1));return}}},on:function(t,e,r){if(!(!t||!e)){var i=this.__handlers__||(this.__handlers__={});if(!i[t])i[t]=[];else if(this.has(t,e))return;var n=new U3(e,r||this);return i[t].push(n),this}},once:function(t,e,r){if(!t||!e)return;var i=this;function n(){i.off(t,n),e.apply(this,arguments)}return this.on(t,n,r)},before:function(t,e,r){if(!(!t||!e))return t="before"+t,this.on(t,e,r)},after:function(t,e,r){if(!(!t||!e))return t="after"+t,this.on(t,e,r)},success:function(t,e){return this.once("success",t,e)},error:function(t,e){return this.once("error",t,e)},off:function(t,e){var r=this.__handlers__||(this.__handlers__={});if(!e){r[t]=[];return}if(r[t]){for(var i=r[t],n=[],a=0;a<i.length;a++)e&&i[a].action!==e&&n.push(i[a]);r[t]=n}return this},has:function(t,e){var r=this.__handlers__;if(!r||!r[t])return!1;for(var i=r[t],n=0;n<i.length;n++)if(i[n].action===e)return!0}};const yg=H3;var V3=0,G3=Array.prototype,W3=G3.forEach,vs={genGUID:function(){return++V3},relative2absolute:function(t,e){if(!e||t.match(/^\//))return t;for(var r=t.split("/"),i=e.split("/"),n=r[0];n==="."||n==="..";)n===".."&&i.pop(),r.shift(),n=r[0];return i.join("/")+"/"+r.join("/")},extend:function(t,e){if(e)for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t},defaults:function(t,e){if(e)for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t},extendWithPropList:function(t,e,r){if(e)for(var i=0;i<r.length;i++){var n=r[i];t[n]=e[n]}return t},defaultsWithPropList:function(t,e,r){if(e)for(var i=0;i<r.length;i++){var n=r[i];t[n]==null&&(t[n]=e[n])}return t},each:function(t,e,r){if(t&&e)if(t.forEach&&t.forEach===W3)t.forEach(e,r);else if(t.length===+t.length)for(var i=0,n=t.length;i<n;i++)e.call(r,t[i],i,t);else for(var a in t)t.hasOwnProperty(a)&&e.call(r,t[a],a,t)},isObject:function(t){return t===Object(t)},isArray:function(t){return Array.isArray(t)},isArrayLike:function(t){return t?t.length===+t.length:!1},clone:function(t){if(vs.isObject(t)){if(vs.isArray(t))return t.slice();if(vs.isArrayLike(t)){for(var e=new t.constructor(t.length),r=0;r<t.length;r++)e[r]=t[r];return e}else return vs.extend({},t)}else return t}};const Ee=vs;var mh=function(){this.__uid__=Ee.genGUID()};mh.__initializers__=[function(t){Ee.extend(this,t)}];Ee.extend(mh,z3);Ee.extend(mh.prototype,yg);const or=mh;var fy=["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear","OES_standard_derivatives","OES_vertex_array_object","OES_element_index_uint","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","EXT_texture_filter_anisotropic","EXT_shader_texture_lod","WEBGL_draw_buffers","EXT_frag_depth","EXT_sRGB","ANGLE_instanced_arrays"],hy=["MAX_TEXTURE_SIZE","MAX_CUBE_MAP_TEXTURE_SIZE"];function X3(t){for(var e={},r={},i=0;i<fy.length;i++){var n=fy[i];o(n)}for(var i=0;i<hy.length;i++){var a=hy[i];r[a]=t.getParameter(t[a])}this.getExtension=function(s){return s in e||o(s),e[s]},this.getParameter=function(s){return r[s]};function o(s){if(t.getExtension){var l=t.getExtension(s);l||(l=t.getExtension("MOZ_"+s)),l||(l=t.getExtension("WEBKIT_"+s)),e[s]=l}}}const B={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444};function Y3(t){var e=new XMLHttpRequest;e.open("get",t.url),e.responseType=t.responseType||"text",t.onprogress&&(e.onprogress=function(r){if(r.lengthComputable){var i=r.loaded/r.total;t.onprogress(i,r.loaded,r.total)}else t.onprogress(null)}),e.onload=function(r){e.status>=400?t.onerror&&t.onerror():t.onload&&t.onload(e.response)},t.onerror&&(e.onerror=t.onerror),e.send(null)}const $3={get:Y3};var qc,Ze={};Ze.supportWebGL=function(){if(qc==null)try{var t=document.createElement("canvas"),e=t.getContext("webgl")||t.getContext("experimental-webgl");if(!e)throw new Error}catch{qc=!1}return qc};Ze.Int8Array=typeof Int8Array>"u"?Array:Int8Array;Ze.Uint8Array=typeof Uint8Array>"u"?Array:Uint8Array;Ze.Uint16Array=typeof Uint16Array>"u"?Array:Uint16Array;Ze.Uint32Array=typeof Uint32Array>"u"?Array:Uint32Array;Ze.Int16Array=typeof Int16Array>"u"?Array:Int16Array;Ze.Float32Array=typeof Float32Array>"u"?Array:Float32Array;Ze.Float64Array=typeof Float64Array>"u"?Array:Float64Array;var jn={};typeof window<"u"?jn=window:typeof global<"u"&&(jn=global);Ze.requestAnimationFrame=jn.requestAnimationFrame||jn.msRequestAnimationFrame||jn.mozRequestAnimationFrame||jn.webkitRequestAnimationFrame||function(t){setTimeout(t,16)};Ze.createCanvas=function(){return document.createElement("canvas")};Ze.createImage=function(){return new jn.Image};Ze.request={get:$3.get};Ze.addEventListener=function(t,e,r,i){t.addEventListener(e,r,i)};Ze.removeEventListener=function(t,e,r){t.removeEventListener(e,r)};const pe=Ze;var we=function(){this.head=null,this.tail=null,this._length=0};we.prototype.insert=function(t){var e=new we.Entry(t);return this.insertEntry(e),e};we.prototype.insertAt=function(t,e){if(!(t<0)){for(var r=this.head,i=0;r&&i!=t;)r=r.next,i++;if(r){var n=new we.Entry(e),a=r.prev;a?(a.next=n,n.prev=a):this.head=n,n.next=r,r.prev=n}else this.insert(e)}};we.prototype.insertBeforeEntry=function(t,e){var r=new we.Entry(t),i=e.prev;i?(i.next=r,r.prev=i):this.head=r,r.next=e,e.prev=r,this._length++};we.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,this.tail=t):this.head=this.tail=t,this._length++};we.prototype.remove=function(t){var e=t.prev,r=t.next;e?e.next=r:this.head=r,r?r.prev=e:this.tail=e,t.next=t.prev=null,this._length--};we.prototype.removeAt=function(t){if(!(t<0)){for(var e=this.head,r=0;e&&r!=t;)e=e.next,r++;if(e)return this.remove(e),e.value}};we.prototype.getHead=function(){if(this.head)return this.head.value};we.prototype.getTail=function(){if(this.tail)return this.tail.value};we.prototype.getAt=function(t){if(!(t<0)){for(var e=this.head,r=0;e&&r!=t;)e=e.next,r++;return e.value}};we.prototype.indexOf=function(t){for(var e=this.head,r=0;e;){if(e.value===t)return r;e=e.next,r++}};we.prototype.length=function(){return this._length};we.prototype.isEmpty=function(){return this._length===0};we.prototype.forEach=function(t,e){for(var r=this.head,i=0,n=typeof e<"u";r;)n?t.call(e,r.value,i):t(r.value,i),r=r.next,i++};we.prototype.clear=function(){this.tail=this.head=null,this._length=0};we.Entry=function(t){this.value=t,this.next=null,this.prev=null};const Z3=we;var Ao=function(t){this._list=new Z3,this._map={},this._maxSize=t||10};Ao.prototype.setMaxSize=function(t){this._maxSize=t};Ao.prototype.put=function(t,e){if(!this._map.hasOwnProperty(t)){var r=this._list.length();if(r>=this._maxSize&&r>0){var i=this._list.head;this._list.remove(i),delete this._map[i.key]}var n=this._list.insert(e);n.key=t,this._map[t]=n}};Ao.prototype.get=function(t){var e=this._map[t];if(this._map.hasOwnProperty(t))return e!==this._list.tail&&(this._list.remove(e),this._list.insertEntry(e)),e.value};Ao.prototype.remove=function(t){var e=this._map[t];typeof e<"u"&&(delete this._map[t],this._list.remove(e))};Ao.prototype.clear=function(){this._list.clear(),this._map={}};const w2=Ao;var jt={},cy={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Yr(t){return t=Math.round(t),t<0?0:t>255?255:t}function q3(t){return t=Math.round(t),t<0?0:t>360?360:t}function $s(t){return t<0?0:t>1?1:t}function Kc(t){return t.length&&t.charAt(t.length-1)==="%"?Yr(parseFloat(t)/100*255):Yr(parseInt(t,10))}function go(t){return t.length&&t.charAt(t.length-1)==="%"?$s(parseFloat(t)/100):$s(parseFloat(t))}function jc(t,e,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?t+(e-t)*r*6:r*2<1?e:r*3<2?t+(e-t)*(2/3-r)*6:t}function Qi(t,e,r){return t+(e-t)*r}function Hr(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}function Od(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var b2=new w2(20),iu=null;function Ia(t,e){iu&&Od(iu,e),iu=b2.put(t,iu||e.slice())}jt.parse=function(t,e){if(t){e=e||[];var r=b2.get(t);if(r)return Od(e,r);t=t+"";var i=t.replace(/ /g,"").toLowerCase();if(i in cy)return Od(e,cy[i]),Ia(t,e),e;if(i.charAt(0)==="#"){if(i.length===4){var n=parseInt(i.substr(1),16);if(!(n>=0&&n<=4095)){Hr(e,0,0,0,1);return}return Hr(e,(n&3840)>>4|(n&3840)>>8,n&240|(n&240)>>4,n&15|(n&15)<<4,1),Ia(t,e),e}else if(i.length===7){var n=parseInt(i.substr(1),16);if(!(n>=0&&n<=16777215)){Hr(e,0,0,0,1);return}return Hr(e,(n&16711680)>>16,(n&65280)>>8,n&255,1),Ia(t,e),e}return}var a=i.indexOf("("),o=i.indexOf(")");if(a!==-1&&o+1===i.length){var s=i.substr(0,a),l=i.substr(a+1,o-(a+1)).split(","),u=1;switch(s){case"rgba":if(l.length!==4){Hr(e,0,0,0,1);return}u=go(l.pop());case"rgb":if(l.length!==3){Hr(e,0,0,0,1);return}return Hr(e,Kc(l[0]),Kc(l[1]),Kc(l[2]),u),Ia(t,e),e;case"hsla":if(l.length!==4){Hr(e,0,0,0,1);return}return l[3]=go(l[3]),Bd(l,e),Ia(t,e),e;case"hsl":if(l.length!==3){Hr(e,0,0,0,1);return}return Bd(l,e),Ia(t,e),e;default:return}}Hr(e,0,0,0,1)}};jt.parseToFloat=function(t,e){if(e=jt.parse(t,e),!!e)return e[0]/=255,e[1]/=255,e[2]/=255,e};function Bd(t,e){var r=(parseFloat(t[0])%360+360)%360/360,i=go(t[1]),n=go(t[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return e=e||[],Hr(e,Yr(jc(o,a,r+1/3)*255),Yr(jc(o,a,r)*255),Yr(jc(o,a,r-1/3)*255),1),t.length===4&&(e[3]=t[3]),e}function K3(t){if(t){var e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.min(e,r,i),a=Math.max(e,r,i),o=a-n,s=(a+n)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+n):u=o/(2-a-n);var f=((a-e)/6+o/2)/o,h=((a-r)/6+o/2)/o,v=((a-i)/6+o/2)/o;e===a?l=v-h:r===a?l=1/3+f-v:i===a&&(l=2/3+h-f),l<0&&(l+=1),l>1&&(l-=1)}var c=[l*360,u,s];return t[3]!=null&&c.push(t[3]),c}}jt.lift=function(t,e){var r=jt.parse(t);if(r){for(var i=0;i<3;i++)e<0?r[i]=r[i]*(1-e)|0:r[i]=(255-r[i])*e+r[i]|0;return jt.stringify(r,r.length===4?"rgba":"rgb")}};jt.toHex=function(t){var e=jt.parse(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)};jt.fastLerp=function(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){r=r||[];var i=t*(e.length-1),n=Math.floor(i),a=Math.ceil(i),o=e[n],s=e[a],l=i-n;return r[0]=Yr(Qi(o[0],s[0],l)),r[1]=Yr(Qi(o[1],s[1],l)),r[2]=Yr(Qi(o[2],s[2],l)),r[3]=$s(Qi(o[3],s[3],l)),r}};jt.fastMapToColor=jt.fastLerp;jt.lerp=function(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){var i=t*(e.length-1),n=Math.floor(i),a=Math.ceil(i),o=jt.parse(e[n]),s=jt.parse(e[a]),l=i-n,u=jt.stringify([Yr(Qi(o[0],s[0],l)),Yr(Qi(o[1],s[1],l)),Yr(Qi(o[2],s[2],l)),$s(Qi(o[3],s[3],l))],"rgba");return r?{color:u,leftIndex:n,rightIndex:a,value:i}:u}};jt.mapToColor=jt.lerp;jt.modifyHSL=function(t,e,r,i){if(t=jt.parse(t),t)return t=K3(t),e!=null&&(t[0]=q3(e)),r!=null&&(t[1]=go(r)),i!=null&&(t[2]=go(i)),jt.stringify(Bd(t),"rgba")};jt.modifyAlpha=function(t,e){if(t=jt.parse(t),t&&e!=null)return t[3]=$s(e),jt.stringify(t,"rgba")};jt.stringify=function(t,e){if(!(!t||!t.length)){var r=t[0]+","+t[1]+","+t[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(r+=","+t[3]),e+"("+r+")"}};const j3=jt;var Q3=j3.parseToFloat,Qc={};function vy(t){var e=Object.keys(t);e.sort();for(var r=[],i=0;i<e.length;i++){var n=e[i],a=t[n];a===null?r.push(n):r.push(n+" "+a.toString())}return r.join(`
`)}function J3(t,e,r){r.sort();for(var i=[],n=0;n<r.length;n++){var a=r[n];i.push(a)}var o=vy(t)+`
`+vy(e)+`
`+i.join(`
`);if(Qc[o])return Qc[o];var s=Ee.genGUID();return Qc[o]=s,s}var tB=or.extend(function(){return{name:"",depthTest:!0,depthMask:!0,transparent:!1,blend:null,autoUpdateTextureStatus:!0,uniforms:{},vertexDefines:{},fragmentDefines:{},_textureStatus:{},_enabledUniforms:null}},function(){this.name||(this.name="MATERIAL_"+this.__uid__),this.shader&&this.attachShader(this.shader,!0)},{precision:"highp",setUniform:function(t,e){e===void 0&&console.warn('Uniform value "'+t+'" is undefined');var r=this.uniforms[t];r&&(typeof e=="string"&&(e=Q3(e)||e),r.value=e,this.autoUpdateTextureStatus&&r.type==="t"&&(e?this.enableTexture(t):this.disableTexture(t)))},setUniforms:function(t){for(var e in t){var r=t[e];this.setUniform(e,r)}},isUniformEnabled:function(t){return this._enabledUniforms.indexOf(t)>=0},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(t,e){if(typeof t=="object")for(var r in t){var i=t[r];this.setUniform(r,i)}else this.setUniform(t,e)},get:function(t){var e=this.uniforms[t];if(e)return e.value},attachShader:function(t,e){var r=this.uniforms;this.uniforms=t.createUniforms(),this.shader=t;var i=this.uniforms;this._enabledUniforms=Object.keys(i),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter(function(u){var f=this.uniforms[u].type;return f==="t"||f==="tv"},this);var n=this.vertexDefines,a=this.fragmentDefines;if(this.vertexDefines=Ee.clone(t.vertexDefines),this.fragmentDefines=Ee.clone(t.fragmentDefines),e){for(var o in r)i[o]&&(i[o].value=r[o].value);Ee.defaults(this.vertexDefines,n),Ee.defaults(this.fragmentDefines,a)}var s={};for(var l in t.textures)s[l]={shaderType:t.textures[l].shaderType,type:t.textures[l].type,enabled:e&&this._textureStatus[l]?this._textureStatus[l].enabled:!1};this._textureStatus=s,this._programKey=""},clone:function(){var t=new this.constructor({name:this.name,shader:this.shader});for(var e in this.uniforms)t.uniforms[e].value=this.uniforms[e].value;return t.depthTest=this.depthTest,t.depthMask=this.depthMask,t.transparent=this.transparent,t.blend=this.blend,t.vertexDefines=Ee.clone(this.vertexDefines),t.fragmentDefines=Ee.clone(this.fragmentDefines),t.enableTexture(this.getEnabledTextures()),t.precision=this.precision,t},define:function(t,e,r){var i=this.vertexDefines,n=this.fragmentDefines;t!=="vertex"&&t!=="fragment"&&t!=="both"&&arguments.length<3&&(r=e,e=t,t="both"),r=r??null,(t==="vertex"||t==="both")&&i[e]!==r&&(i[e]=r,this._programKey=""),(t==="fragment"||t==="both")&&n[e]!==r&&(n[e]=r,t!=="both"&&(this._programKey=""))},undefine:function(t,e){t!=="vertex"&&t!=="fragment"&&t!=="both"&&arguments.length<2&&(e=t,t="both"),(t==="vertex"||t==="both")&&this.isDefined("vertex",e)&&(delete this.vertexDefines[e],this._programKey=""),(t==="fragment"||t==="both")&&this.isDefined("fragment",e)&&(delete this.fragmentDefines[e],t!=="both"&&(this._programKey=""))},isDefined:function(t,e){switch(t){case"vertex":return this.vertexDefines[e]!==void 0;case"fragment":return this.fragmentDefines[e]!==void 0}},getDefine:function(t,e){switch(t){case"vertex":return this.vertexDefines[e];case"fragment":return this.fragmentDefines[e]}},enableTexture:function(t){if(Array.isArray(t)){for(var e=0;e<t.length;e++)this.enableTexture(t[e]);return}var r=this._textureStatus[t];if(r){var i=r.enabled;i||(r.enabled=!0,this._programKey="")}},enableTexturesAll:function(){var t=this._textureStatus;for(var e in t)t[e].enabled=!0;this._programKey=""},disableTexture:function(t){if(Array.isArray(t)){for(var e=0;e<t.length;e++)this.disableTexture(t[e]);return}var r=this._textureStatus[t];if(r){var i=!r.enabled;i||(r.enabled=!1,this._programKey="")}},disableTexturesAll:function(){var t=this._textureStatus;for(var e in t)t[e].enabled=!1;this._programKey=""},isTextureEnabled:function(t){var e=this._textureStatus;return!!e[t]&&e[t].enabled},getEnabledTextures:function(){var t=[],e=this._textureStatus;for(var r in e)e[r].enabled&&t.push(r);return t},dirtyDefines:function(){this._programKey=""},getProgramKey:function(){return this._programKey||(this._programKey=J3(this.vertexDefines,this.fragmentDefines,this.getEnabledTextures())),this._programKey}});const Ii=tB;var Pu=1e-6,Ce=Array,eo=Math.random,vt={};vt.create=function(){var t=new Ce(2);return t[0]=0,t[1]=0,t};vt.clone=function(t){var e=new Ce(2);return e[0]=t[0],e[1]=t[1],e};vt.fromValues=function(t,e){var r=new Ce(2);return r[0]=t,r[1]=e,r};vt.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t};vt.set=function(t,e,r){return t[0]=e,t[1]=r,t};vt.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t};vt.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t};vt.sub=vt.subtract;vt.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t};vt.mul=vt.multiply;vt.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t};vt.div=vt.divide;vt.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t};vt.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t};vt.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t};vt.scaleAndAdd=function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t};vt.distance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(r*r+i*i)};vt.dist=vt.distance;vt.squaredDistance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1];return r*r+i*i};vt.sqrDist=vt.squaredDistance;vt.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)};vt.len=vt.length;vt.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r};vt.sqrLen=vt.squaredLength;vt.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t};vt.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t};vt.normalize=function(t,e){var r=e[0],i=e[1],n=r*r+i*i;return n>0&&(n=1/Math.sqrt(n),t[0]=e[0]*n,t[1]=e[1]*n),t};vt.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]};vt.cross=function(t,e,r){var i=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=i,t};vt.lerp=function(t,e,r,i){var n=e[0],a=e[1];return t[0]=n+i*(r[0]-n),t[1]=a+i*(r[1]-a),t};vt.random=function(t,e){e=e||1;var r=GLMAT_RANDOM()*2*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t};vt.transformMat2=function(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n,t[1]=r[1]*i+r[3]*n,t};vt.transformMat2d=function(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};vt.transformMat3=function(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[3]*n+r[6],t[1]=r[1]*i+r[4]*n+r[7],t};vt.transformMat4=function(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[4]*n+r[12],t[1]=r[1]*i+r[5]*n+r[13],t};vt.forEach=function(){var t=vt.create();return function(e,r,i,n,a,o){var s,l;for(r||(r=2),i||(i=0),n?l=Math.min(n*r+i,e.length):l=e.length,s=i;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],a(t,t,o),e[s]=t[0],e[s+1]=t[1];return e}}();const Q=vt;var xt=function(t,e){t=t||0,e=e||0,this.array=Q.fromValues(t,e),this._dirty=!0};xt.prototype={constructor:xt,add:function(t){return Q.add(this.array,this.array,t.array),this._dirty=!0,this},set:function(t,e){return this.array[0]=t,this.array[1]=e,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this._dirty=!0,this},clone:function(){return new xt(this.x,this.y)},copy:function(t){return Q.copy(this.array,t.array),this._dirty=!0,this},cross:function(t,e){return Q.cross(t.array,this.array,e.array),t._dirty=!0,this},dist:function(t){return Q.dist(this.array,t.array)},distance:function(t){return Q.distance(this.array,t.array)},div:function(t){return Q.div(this.array,this.array,t.array),this._dirty=!0,this},divide:function(t){return Q.divide(this.array,this.array,t.array),this._dirty=!0,this},dot:function(t){return Q.dot(this.array,t.array)},len:function(){return Q.len(this.array)},length:function(){return Q.length(this.array)},lerp:function(t,e,r){return Q.lerp(this.array,t.array,e.array,r),this._dirty=!0,this},min:function(t){return Q.min(this.array,this.array,t.array),this._dirty=!0,this},max:function(t){return Q.max(this.array,this.array,t.array),this._dirty=!0,this},mul:function(t){return Q.mul(this.array,this.array,t.array),this._dirty=!0,this},multiply:function(t){return Q.multiply(this.array,this.array,t.array),this._dirty=!0,this},negate:function(){return Q.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return Q.normalize(this.array,this.array),this._dirty=!0,this},random:function(t){return Q.random(this.array,t),this._dirty=!0,this},scale:function(t){return Q.scale(this.array,this.array,t),this._dirty=!0,this},scaleAndAdd:function(t,e){return Q.scaleAndAdd(this.array,this.array,t.array,e),this._dirty=!0,this},sqrDist:function(t){return Q.sqrDist(this.array,t.array)},squaredDistance:function(t){return Q.squaredDistance(this.array,t.array)},sqrLen:function(){return Q.sqrLen(this.array)},squaredLength:function(){return Q.squaredLength(this.array)},sub:function(t){return Q.sub(this.array,this.array,t.array),this._dirty=!0,this},subtract:function(t){return Q.subtract(this.array,this.array,t.array),this._dirty=!0,this},transformMat2:function(t){return Q.transformMat2(this.array,this.array,t.array),this._dirty=!0,this},transformMat2d:function(t){return Q.transformMat2d(this.array,this.array,t.array),this._dirty=!0,this},transformMat3:function(t){return Q.transformMat3(this.array,this.array,t.array),this._dirty=!0,this},transformMat4:function(t){return Q.transformMat4(this.array,this.array,t.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};if(Object.defineProperty){var dy=xt.prototype;Object.defineProperty(dy,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),Object.defineProperty(dy,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}})}xt.add=function(t,e,r){return Q.add(t.array,e.array,r.array),t._dirty=!0,t};xt.set=function(t,e,r){return Q.set(t.array,e,r),t._dirty=!0,t};xt.copy=function(t,e){return Q.copy(t.array,e.array),t._dirty=!0,t};xt.cross=function(t,e,r){return Q.cross(t.array,e.array,r.array),t._dirty=!0,t};xt.dist=function(t,e){return Q.distance(t.array,e.array)};xt.distance=xt.dist;xt.div=function(t,e,r){return Q.divide(t.array,e.array,r.array),t._dirty=!0,t};xt.divide=xt.div;xt.dot=function(t,e){return Q.dot(t.array,e.array)};xt.len=function(t){return Q.length(t.array)};xt.lerp=function(t,e,r,i){return Q.lerp(t.array,e.array,r.array,i),t._dirty=!0,t};xt.min=function(t,e,r){return Q.min(t.array,e.array,r.array),t._dirty=!0,t};xt.max=function(t,e,r){return Q.max(t.array,e.array,r.array),t._dirty=!0,t};xt.mul=function(t,e,r){return Q.multiply(t.array,e.array,r.array),t._dirty=!0,t};xt.multiply=xt.mul;xt.negate=function(t,e){return Q.negate(t.array,e.array),t._dirty=!0,t};xt.normalize=function(t,e){return Q.normalize(t.array,e.array),t._dirty=!0,t};xt.random=function(t,e){return Q.random(t.array,e),t._dirty=!0,t};xt.scale=function(t,e,r){return Q.scale(t.array,e.array,r),t._dirty=!0,t};xt.scaleAndAdd=function(t,e,r,i){return Q.scaleAndAdd(t.array,e.array,r.array,i),t._dirty=!0,t};xt.sqrDist=function(t,e){return Q.sqrDist(t.array,e.array)};xt.squaredDistance=xt.sqrDist;xt.sqrLen=function(t){return Q.sqrLen(t.array)};xt.squaredLength=xt.sqrLen;xt.sub=function(t,e,r){return Q.subtract(t.array,e.array,r.array),t._dirty=!0,t};xt.subtract=xt.sub;xt.transformMat2=function(t,e,r){return Q.transformMat2(t.array,e.array,r.array),t._dirty=!0,t};xt.transformMat2d=function(t,e,r){return Q.transformMat2d(t.array,e.array,r.array),t._dirty=!0,t};xt.transformMat3=function(t,e,r){return Q.transformMat3(t.array,e.array,r.array),t._dirty=!0,t};xt.transformMat4=function(t,e,r){return Q.transformMat4(t.array,e.array,r.array),t._dirty=!0,t};const ur=xt;var py=1,gy=2,Jc=3,my={};function eB(t){for(var e=t.split(`
`),r=0,i=e.length;r<i;r++)e[r]=r+1+": "+e[r];return e.join(`
`)}function _y(t,e,r){if(!t.getShaderParameter(e,t.COMPILE_STATUS))return[t.getShaderInfoLog(e),eB(r)].join(`
`)}var yy=new pe.Float32Array(16),rB=or.extend({uniformSemantics:{},attributes:{}},function(){this._locations={},this._textureSlot=0,this._program=null},{bind:function(t){this._textureSlot=0,t.gl.useProgram(this._program)},hasUniform:function(t){var e=this._locations[t];return e!=null},useTextureSlot:function(t,e,r){e&&(t.gl.activeTexture(t.gl.TEXTURE0+r),e.isRenderable()?e.bind(t):e.unbind(t))},currentTextureSlot:function(){return this._textureSlot},resetTextureSlot:function(t){this._textureSlot=t||0},takeCurrentTextureSlot:function(t,e){var r=this._textureSlot;return this.useTextureSlot(t,e,r),this._textureSlot++,r},setUniform:function(t,e,r,i){var n=this._locations,a=n[r];if(a==null)return!1;switch(e){case"m4":if(!(i instanceof Float32Array)){for(var o=0;o<i.length;o++)yy[o]=i[o];i=yy}t.uniformMatrix4fv(a,!1,i);break;case"2i":t.uniform2i(a,i[0],i[1]);break;case"2f":t.uniform2f(a,i[0],i[1]);break;case"3i":t.uniform3i(a,i[0],i[1],i[2]);break;case"3f":t.uniform3f(a,i[0],i[1],i[2]);break;case"4i":t.uniform4i(a,i[0],i[1],i[2],i[3]);break;case"4f":t.uniform4f(a,i[0],i[1],i[2],i[3]);break;case"1i":t.uniform1i(a,i);break;case"1f":t.uniform1f(a,i);break;case"1fv":t.uniform1fv(a,i);break;case"1iv":t.uniform1iv(a,i);break;case"2iv":t.uniform2iv(a,i);break;case"2fv":t.uniform2fv(a,i);break;case"3iv":t.uniform3iv(a,i);break;case"3fv":t.uniform3fv(a,i);break;case"4iv":t.uniform4iv(a,i);break;case"4fv":t.uniform4fv(a,i);break;case"m2":case"m2v":t.uniformMatrix2fv(a,!1,i);break;case"m3":case"m3v":t.uniformMatrix3fv(a,!1,i);break;case"m4v":if(Array.isArray(i)&&Array.isArray(i[0])){for(var s=new pe.Float32Array(i.length*16),l=0,o=0;o<i.length;o++)for(var u=i[o],f=0;f<16;f++)s[l++]=u[f];t.uniformMatrix4fv(a,!1,s)}else t.uniformMatrix4fv(a,!1,i);break}return!0},setUniformOfSemantic:function(t,e,r){var i=this.uniformSemantics[e];return i?this.setUniform(t,i.type,i.symbol,r):!1},enableAttributes:function(t,e,r){var i=t.gl,n=this._program,a=this._locations,o;r?o=r.__enabledAttributeList:o=my[t.__uid__],o||(r?o=r.__enabledAttributeList=[]:o=my[t.__uid__]=[]);for(var s=[],l=0;l<e.length;l++){var u=e[l];if(!this.attributes[u]){s[l]=-1;continue}var f=a[u];if(f==null){if(f=i.getAttribLocation(n,u),f===-1){s[l]=-1;continue}a[u]=f}s[l]=f,o[f]?o[f]=gy:o[f]=py}for(var l=0;l<o.length;l++)switch(o[l]){case py:i.enableVertexAttribArray(l),o[l]=Jc;break;case gy:o[l]=Jc;break;case Jc:i.disableVertexAttribArray(l),o[l]=0;break}return s},getAttribLocation:function(t,e){var r=this._locations,i=r[e];return i==null&&(i=t.getAttribLocation(this._program,e),r[e]=i),i},buildProgram:function(t,e,r,i){var n=t.createShader(t.VERTEX_SHADER),a=t.createProgram();t.shaderSource(n,r),t.compileShader(n);var o=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(o,i),t.compileShader(o);var s=_y(t,n,r);if(s||(s=_y(t,o,i),s))return s;if(t.attachShader(a,n),t.attachShader(a,o),e.attributeSemantics.POSITION)t.bindAttribLocation(a,0,e.attributeSemantics.POSITION.symbol);else{var l=Object.keys(this.attributes);t.bindAttribLocation(a,0,l[0])}if(t.linkProgram(a),t.deleteShader(n),t.deleteShader(o),this._program=a,this.vertexCode=r,this.fragmentCode=i,!t.getProgramParameter(a,t.LINK_STATUS))return`Could not link program
`+t.getProgramInfoLog(a);for(var u=0;u<e.uniforms.length;u++){var f=e.uniforms[u];this._locations[f]=t.getUniformLocation(a,f)}}});const iB=rB;var nB=/for\s*?\(int\s*?_idx_\s*\=\s*([\w-]+)\;\s*_idx_\s*<\s*([\w-]+);\s*_idx_\s*\+\+\s*\)\s*\{\{([\s\S]+?)(?=\}\})\}\}/g;function xy(t,e,r){function i(o,s,l,u){var f="";isNaN(s)&&(s in e?s=e[s]:s=n[s]),isNaN(l)&&(l in e?l=e[l]:l=n[l]);for(var h=parseInt(s);h<parseInt(l);h++)f+="{"+u.replace(/float\s*\(\s*_idx_\s*\)/g,h.toFixed(1)).replace(/_idx_/g,h)+"}";return f}var n={};for(var a in r)n[a+"_COUNT"]=r[a];return t.replace(nB,i)}function tv(t,e,r){var i=[];if(e)for(var n in e){var a=e[n];a>0&&i.push("#define "+n.toUpperCase()+"_COUNT "+a)}if(r)for(var o=0;o<r.length;o++){var s=r[o];i.push("#define "+s.toUpperCase()+"_ENABLED")}for(var s in t){var l=t[s];l===null?i.push("#define "+s):i.push("#define "+s+" "+l.toString())}return i.join(`
`)}function aB(t){for(var e=[],r=0;r<t.length;r++)e.push("#extension GL_"+t[r]+" : enable");return e.join(`
`)}function oB(t){return["precision",t,"float"].join(" ")+`;
`+["precision",t,"int"].join(" ")+`;
`+["precision",t,"sampler2D"].join(" ")+`;
`}function A2(t){this._renderer=t,this._cache={}}A2.prototype.getProgram=function(t,e,r){var i=this._cache,n=t.isSkinnedMesh&&t.isSkinnedMesh(),a=t.isInstancedMesh&&t.isInstancedMesh(),o="s"+e.shader.shaderID+"m"+e.getProgramKey();r&&(o+="se"+r.getProgramKey(t.lightGroup)),n&&(o+=",sk"+t.joints.length),a&&(o+=",is");var x=i[o];if(x)return x;var s=r?r.getLightsNumbers(t.lightGroup):{},l=this._renderer,u=l.gl,f=e.getEnabledTextures(),h="";if(n){var v={SKINNING:null,JOINT_COUNT:t.joints.length};t.joints.length>l.getMaxJointNumber()&&(v.USE_SKIN_MATRICES_TEXTURE=null),h+=`
`+tv(v)+`
`}a&&(h+=`
#define INSTANCING
`);var c=h+tv(e.vertexDefines,s,f),d=h+tv(e.fragmentDefines,s,f),p=c+`
`+e.shader.vertex,g=["OES_standard_derivatives","EXT_shader_texture_lod"].filter(function(T){return l.getGLExtension(T)!=null});g.indexOf("EXT_shader_texture_lod")>=0&&(d+=`
#define SUPPORT_TEXTURE_LOD`),g.indexOf("OES_standard_derivatives")>=0&&(d+=`
#define SUPPORT_STANDARD_DERIVATIVES`);var m=aB(g)+`
`+oB(e.precision)+`
`+d+`
`+e.shader.fragment,_=xy(p,e.vertexDefines,s),y=xy(m,e.fragmentDefines,s),x=new iB;x.uniformSemantics=e.shader.uniformSemantics,x.attributes=e.shader.attributes;var S=x.buildProgram(u,e.shader,_,y);return x.__error=S,i[o]=x,x};var Ty=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g,sB=/attribute\s+(float|int|vec2|vec3|vec4)\s+([\s\S]*?);/g,Sy=/#define\s+(\w+)?(\s+[\d-.]+)?\s*;?\s*\n/g,lB={bool:"1i",int:"1i",sampler2D:"t",samplerCube:"t",float:"1f",vec2:"2f",vec3:"3f",vec4:"4f",ivec2:"2i",ivec3:"3i",ivec4:"4i",mat2:"m2",mat3:"m3",mat4:"m4"};function mi(t){for(var e=[],r=0;r<t;r++)e[r]=0;return e}var wy={bool:function(){return!0},int:function(){return 0},float:function(){return 0},sampler2D:function(){return null},samplerCube:function(){return null},vec2:function(){return mi(2)},vec3:function(){return mi(3)},vec4:function(){return mi(4)},ivec2:function(){return mi(2)},ivec3:function(){return mi(3)},ivec4:function(){return mi(4)},mat2:function(){return mi(4)},mat3:function(){return mi(9)},mat4:function(){return mi(16)},array:function(){return[]}},Fd=["POSITION","NORMAL","BINORMAL","TANGENT","TEXCOORD","TEXCOORD_0","TEXCOORD_1","COLOR","JOINT","WEIGHT"],E2=["SKIN_MATRIX","VIEWPORT_SIZE","VIEWPORT","DEVICEPIXELRATIO","WINDOW_SIZE","NEAR","FAR","TIME"],C2=["WORLD","VIEW","PROJECTION","WORLDVIEW","VIEWPROJECTION","WORLDVIEWPROJECTION","WORLDINVERSE","VIEWINVERSE","PROJECTIONINVERSE","WORLDVIEWINVERSE","VIEWPROJECTIONINVERSE","WORLDVIEWPROJECTIONINVERSE","WORLDTRANSPOSE","VIEWTRANSPOSE","PROJECTIONTRANSPOSE","WORLDVIEWTRANSPOSE","VIEWPROJECTIONTRANSPOSE","WORLDVIEWPROJECTIONTRANSPOSE","WORLDINVERSETRANSPOSE","VIEWINVERSETRANSPOSE","PROJECTIONINVERSETRANSPOSE","WORLDVIEWINVERSETRANSPOSE","VIEWPROJECTIONINVERSETRANSPOSE","WORLDVIEWPROJECTIONINVERSETRANSPOSE"],uB={vec4:4,vec3:3,vec2:2,float:1},ev={},M2={};function fB(t,e){var r="vertex:"+t+"fragment:"+e;if(ev[r])return ev[r];var i=Ee.genGUID();return ev[r]=i,M2[i]={vertex:t,fragment:e},i}function by(t){return t.replace(/[ \t]*\/\/.*\n/g,"").replace(/[ \t]*\/\*[\s\S]*?\*\//g,"")}function Na(){console.error("Wrong uniform/attributes syntax")}function Ay(t,e){for(var r=/[,=\(\):]/,i=e.replace(/:\s*\[\s*(.*)\s*\]/g,"="+t+"($1)").replace(/\s+/g,"").split(/(?=[,=\(\):])/g),n=[],a=0;a<i.length;a++)i[a].match(r)?n.push(i[a].charAt(0),i[a].slice(1)):n.push(i[a]);i=n;var o=0,s=1,l=2,u=3,f=4,h=5,v=o,c={},d=null,p;g(i[0]);function g(y){y||Na();var x=y.match(/\[(.*?)\]/);p=y.replace(/\[(.*?)\]/,""),c[p]={},x&&(c[p].isArray=!0,c[p].arraySize=x[1])}for(var a=1;a<i.length;a++){var m=i[a];if(m){if(m==="="){if(v!==o&&v!==u){Na();break}v=s;continue}else if(m===":"){v=f;continue}else if(m===","){if(v===l){if(!(d instanceof Array)){Na();break}d.push(+i[++a])}else v=h;continue}else if(m===")"){c[p].value=new pe.Float32Array(d),d=null,v=h;continue}else if(m==="("){if(v!==l){Na();break}if(!(d instanceof Array)){Na();break}d.push(+i[++a]);continue}else if(m.indexOf("vec")>=0){if(v!==s&&v!==f){Na();break}v=l,d=[];continue}else if(v===s){t==="bool"?c[p].value=m==="true":c[p].value=parseFloat(m),d=null;continue}else if(v===f){var _=m;Fd.indexOf(_)>=0||E2.indexOf(_)>=0||C2.indexOf(_)>=0?c[p].semantic=_:_==="ignore"||_==="unconfigurable"?c[p].ignore=!0:t==="bool"?c[p].value=_==="true":c[p].value=parseFloat(_);continue}g(m),v=o}}return c}function V(t,e){typeof t=="object"&&(e=t.fragment,t=t.vertex),t=by(t),e=by(e),this._shaderID=fB(t,e),this._vertexCode=V.parseImport(t),this._fragmentCode=V.parseImport(e),this.attributeSemantics={},this.matrixSemantics={},this.uniformSemantics={},this.matrixSemanticKeys=[],this.uniformTemplates={},this.attributes={},this.textures={},this.vertexDefines={},this.fragmentDefines={},this._parseAttributes(),this._parseUniforms(),this._parseDefines()}V.prototype={constructor:V,createUniforms:function(){var t={};for(var e in this.uniformTemplates){var r=this.uniformTemplates[e];t[e]={type:r.type,value:r.value()}}return t},_parseImport:function(){this._vertexCode=V.parseImport(this.vertex),this._fragmentCode=V.parseImport(this.fragment)},_addSemanticUniform:function(t,e,r){if(Fd.indexOf(r)>=0)this.attributeSemantics[r]={symbol:t,type:e};else if(C2.indexOf(r)>=0){var i=!1,n=r;r.match(/TRANSPOSE$/)&&(i=!0,n=r.slice(0,-9)),this.matrixSemantics[r]={symbol:t,type:e,isTranspose:i,semanticNoTranspose:n}}else E2.indexOf(r)>=0&&(this.uniformSemantics[r]={symbol:t,type:e})},_addMaterialUniform:function(t,e,r,i,n,a){a[t]={type:r,value:n?wy.array:i||wy[e],semantic:null}},_parseUniforms:function(){var t={},e=this,r="vertex";this._uniformList=[],this._vertexCode=this._vertexCode.replace(Ty,n),r="fragment",this._fragmentCode=this._fragmentCode.replace(Ty,n),e.matrixSemanticKeys=Object.keys(this.matrixSemantics);function i(a){return a!=null?function(){return a}:null}function n(a,o,s){var l=Ay(o,s),u=[];for(var f in l){var h=l[f],v=h.semantic,c=f,d=lB[o],p=i(l[f].value);l[f].isArray&&(c+="["+l[f].arraySize+"]",d+="v"),u.push(c),e._uniformList.push(f),h.ignore||((o==="sampler2D"||o==="samplerCube")&&(e.textures[f]={shaderType:r,type:o}),v?e._addSemanticUniform(f,d,v):e._addMaterialUniform(f,o,d,p,l[f].isArray,t))}return u.length>0?"uniform "+o+" "+u.join(",")+`;
`:""}this.uniformTemplates=t},_parseAttributes:function(){var t={},e=this;this._vertexCode=this._vertexCode.replace(sB,r);function r(i,n,a){var o=Ay(n,a),s=uB[n]||1,l=[];for(var u in o){var f=o[u].semantic;if(t[u]={type:"float",size:s,semantic:f||null},f){if(Fd.indexOf(f)<0)throw new Error('Unkown semantic "'+f+'"');e.attributeSemantics[f]={symbol:u,type:n}}l.push(u)}return"attribute "+n+" "+l.join(",")+`;
`}this.attributes=t},_parseDefines:function(){var t=this,e="vertex";this._vertexCode=this._vertexCode.replace(Sy,r),e="fragment",this._fragmentCode=this._fragmentCode.replace(Sy,r);function r(i,n,a){var o=e==="vertex"?t.vertexDefines:t.fragmentDefines;return o[n]||(a==="false"?o[n]=!1:a==="true"?o[n]=!0:o[n]=a?isNaN(parseFloat(a))?a.trim():parseFloat(a):null),""}},clone:function(){var t=M2[this._shaderID],e=new V(t.vertex,t.fragment);return e}};Object.defineProperty&&(Object.defineProperty(V.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(V.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(V.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(V.prototype,"uniforms",{get:function(){return this._uniformList}}));var hB=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;V.parseImport=function(t){return t=t.replace(hB,function(n,r,i){var n=V.source(i);return n?V.parseImport(n):(console.error('Shader chunk "'+i+'" not existed in library'),"")}),t};var cB=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;V.import=function(t){t.replace(cB,function(e,r,i,a){var a=a.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"");if(a){for(var o=i.split("."),s=V.codes,l=0,u;l<o.length-1;)u=o[l++],s[u]||(s[u]={}),s=s[u];u=o[l],s[u]=a}return a})};V.codes={};V.source=function(t){for(var e=t.split("."),r=V.codes,i=0;r&&i<e.length;){var n=e[i++];r=r[n]}return typeof r!="string"?(console.error('Shader "'+t+'" not existed in library'),""):r};const D2=`@export clay.prez.vertex
uniform mat4 WVP : WORLDVIEWPROJECTION;
attribute vec3 pos : POSITION;
attribute vec2 uv : TEXCOORD_0;
uniform vec2 uvRepeat : [1.0, 1.0];
uniform vec2 uvOffset : [0.0, 0.0];
@import clay.chunk.skinning_header
@import clay.chunk.instancing_header
varying vec2 v_Texcoord;
void main()
{
 vec4 P = vec4(pos, 1.0);
#ifdef SKINNING
 @import clay.chunk.skin_matrix
 P = skinMatrixWS * P;
#endif
#ifdef INSTANCING
 @import clay.chunk.instancing_matrix
 P = instanceMat * P;
#endif
 gl_Position = WVP * P;
 v_Texcoord = uv * uvRepeat + uvOffset;
}
@end
@export clay.prez.fragment
uniform sampler2D alphaMap;
uniform float alphaCutoff: 0.0;
varying vec2 v_Texcoord;
void main()
{
 if (alphaCutoff > 0.0) {
 if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {
 discard;
 }
 }
 gl_FragColor = vec4(0.0,0.0,0.0,1.0);
}
@end`;var Gt={};Gt.create=function(){var t=new Ce(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};Gt.clone=function(t){var e=new Ce(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};Gt.copy=function(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[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};Gt.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};Gt.transpose=function(t,e){if(t===e){var r=e[1],i=e[2],n=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=a,t[11]=e[14],t[12]=n,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t};Gt.invert=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],h=e[9],v=e[10],c=e[11],d=e[12],p=e[13],g=e[14],m=e[15],_=r*s-i*o,y=r*l-n*o,x=r*u-a*o,S=i*l-n*s,T=i*u-a*s,b=n*u-a*l,w=f*p-h*d,A=f*g-v*d,C=f*m-c*d,E=h*g-v*p,D=h*m-c*p,L=v*m-c*g,R=_*L-y*D+x*E+S*C-T*A+b*w;return R?(R=1/R,t[0]=(s*L-l*D+u*E)*R,t[1]=(n*D-i*L-a*E)*R,t[2]=(p*b-g*T+m*S)*R,t[3]=(v*T-h*b-c*S)*R,t[4]=(l*C-o*L-u*A)*R,t[5]=(r*L-n*C+a*A)*R,t[6]=(g*x-d*b-m*y)*R,t[7]=(f*b-v*x+c*y)*R,t[8]=(o*D-s*C+u*w)*R,t[9]=(i*C-r*D-a*w)*R,t[10]=(d*T-p*x+m*_)*R,t[11]=(h*x-f*T-c*_)*R,t[12]=(s*A-o*E-l*w)*R,t[13]=(r*E-i*A+n*w)*R,t[14]=(p*y-d*S-g*_)*R,t[15]=(f*S-h*y+v*_)*R,t):null};Gt.adjoint=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],h=e[9],v=e[10],c=e[11],d=e[12],p=e[13],g=e[14],m=e[15];return t[0]=s*(v*m-c*g)-h*(l*m-u*g)+p*(l*c-u*v),t[1]=-(i*(v*m-c*g)-h*(n*m-a*g)+p*(n*c-a*v)),t[2]=i*(l*m-u*g)-s*(n*m-a*g)+p*(n*u-a*l),t[3]=-(i*(l*c-u*v)-s*(n*c-a*v)+h*(n*u-a*l)),t[4]=-(o*(v*m-c*g)-f*(l*m-u*g)+d*(l*c-u*v)),t[5]=r*(v*m-c*g)-f*(n*m-a*g)+d*(n*c-a*v),t[6]=-(r*(l*m-u*g)-o*(n*m-a*g)+d*(n*u-a*l)),t[7]=r*(l*c-u*v)-o*(n*c-a*v)+f*(n*u-a*l),t[8]=o*(h*m-c*p)-f*(s*m-u*p)+d*(s*c-u*h),t[9]=-(r*(h*m-c*p)-f*(i*m-a*p)+d*(i*c-a*h)),t[10]=r*(s*m-u*p)-o*(i*m-a*p)+d*(i*u-a*s),t[11]=-(r*(s*c-u*h)-o*(i*c-a*h)+f*(i*u-a*s)),t[12]=-(o*(h*g-v*p)-f*(s*g-l*p)+d*(s*v-l*h)),t[13]=r*(h*g-v*p)-f*(i*g-n*p)+d*(i*v-n*h),t[14]=-(r*(s*g-l*p)-o*(i*g-n*p)+d*(i*l-n*s)),t[15]=r*(s*v-l*h)-o*(i*v-n*h)+f*(i*l-n*s),t};Gt.determinant=function(t){var e=t[0],r=t[1],i=t[2],n=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],f=t[9],h=t[10],v=t[11],c=t[12],d=t[13],p=t[14],g=t[15],m=e*o-r*a,_=e*s-i*a,y=e*l-n*a,x=r*s-i*o,S=r*l-n*o,T=i*l-n*s,b=u*d-f*c,w=u*p-h*c,A=u*g-v*c,C=f*p-h*d,E=f*g-v*d,D=h*g-v*p;return m*D-_*E+y*C+x*A-S*w+T*b};Gt.multiply=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],h=e[8],v=e[9],c=e[10],d=e[11],p=e[12],g=e[13],m=e[14],_=e[15],y=r[0],x=r[1],S=r[2],T=r[3];return t[0]=y*i+x*s+S*h+T*p,t[1]=y*n+x*l+S*v+T*g,t[2]=y*a+x*u+S*c+T*m,t[3]=y*o+x*f+S*d+T*_,y=r[4],x=r[5],S=r[6],T=r[7],t[4]=y*i+x*s+S*h+T*p,t[5]=y*n+x*l+S*v+T*g,t[6]=y*a+x*u+S*c+T*m,t[7]=y*o+x*f+S*d+T*_,y=r[8],x=r[9],S=r[10],T=r[11],t[8]=y*i+x*s+S*h+T*p,t[9]=y*n+x*l+S*v+T*g,t[10]=y*a+x*u+S*c+T*m,t[11]=y*o+x*f+S*d+T*_,y=r[12],x=r[13],S=r[14],T=r[15],t[12]=y*i+x*s+S*h+T*p,t[13]=y*n+x*l+S*v+T*g,t[14]=y*a+x*u+S*c+T*m,t[15]=y*o+x*f+S*d+T*_,t};Gt.multiplyAffine=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[4],s=e[5],l=e[6],u=e[8],f=e[9],h=e[10],v=e[12],c=e[13],d=e[14],p=r[0],g=r[1],m=r[2];return t[0]=p*i+g*o+m*u,t[1]=p*n+g*s+m*f,t[2]=p*a+g*l+m*h,p=r[4],g=r[5],m=r[6],t[4]=p*i+g*o+m*u,t[5]=p*n+g*s+m*f,t[6]=p*a+g*l+m*h,p=r[8],g=r[9],m=r[10],t[8]=p*i+g*o+m*u,t[9]=p*n+g*s+m*f,t[10]=p*a+g*l+m*h,p=r[12],g=r[13],m=r[14],t[12]=p*i+g*o+m*u+v,t[13]=p*n+g*s+m*f+c,t[14]=p*a+g*l+m*h+d,t};Gt.mul=Gt.multiply;Gt.mulAffine=Gt.multiplyAffine;Gt.translate=function(t,e,r){var i=r[0],n=r[1],a=r[2],o,s,l,u,f,h,v,c,d,p,g,m;return e===t?(t[12]=e[0]*i+e[4]*n+e[8]*a+e[12],t[13]=e[1]*i+e[5]*n+e[9]*a+e[13],t[14]=e[2]*i+e[6]*n+e[10]*a+e[14],t[15]=e[3]*i+e[7]*n+e[11]*a+e[15]):(o=e[0],s=e[1],l=e[2],u=e[3],f=e[4],h=e[5],v=e[6],c=e[7],d=e[8],p=e[9],g=e[10],m=e[11],t[0]=o,t[1]=s,t[2]=l,t[3]=u,t[4]=f,t[5]=h,t[6]=v,t[7]=c,t[8]=d,t[9]=p,t[10]=g,t[11]=m,t[12]=o*i+f*n+d*a+e[12],t[13]=s*i+h*n+p*a+e[13],t[14]=l*i+v*n+g*a+e[14],t[15]=u*i+c*n+m*a+e[15]),t};Gt.scale=function(t,e,r){var i=r[0],n=r[1],a=r[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t};Gt.rotate=function(t,e,r,i){var n=i[0],a=i[1],o=i[2],s=Math.sqrt(n*n+a*a+o*o),l,u,f,h,v,c,d,p,g,m,_,y,x,S,T,b,w,A,C,E,D,L,R,N;return Math.abs(s)<Pu?null:(s=1/s,n*=s,a*=s,o*=s,l=Math.sin(r),u=Math.cos(r),f=1-u,h=e[0],v=e[1],c=e[2],d=e[3],p=e[4],g=e[5],m=e[6],_=e[7],y=e[8],x=e[9],S=e[10],T=e[11],b=n*n*f+u,w=a*n*f+o*l,A=o*n*f-a*l,C=n*a*f-o*l,E=a*a*f+u,D=o*a*f+n*l,L=n*o*f+a*l,R=a*o*f-n*l,N=o*o*f+u,t[0]=h*b+p*w+y*A,t[1]=v*b+g*w+x*A,t[2]=c*b+m*w+S*A,t[3]=d*b+_*w+T*A,t[4]=h*C+p*E+y*D,t[5]=v*C+g*E+x*D,t[6]=c*C+m*E+S*D,t[7]=d*C+_*E+T*D,t[8]=h*L+p*R+y*N,t[9]=v*L+g*R+x*N,t[10]=c*L+m*R+S*N,t[11]=d*L+_*R+T*N,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)};Gt.rotateX=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),a=e[4],o=e[5],s=e[6],l=e[7],u=e[8],f=e[9],h=e[10],v=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*n+u*i,t[5]=o*n+f*i,t[6]=s*n+h*i,t[7]=l*n+v*i,t[8]=u*n-a*i,t[9]=f*n-o*i,t[10]=h*n-s*i,t[11]=v*n-l*i,t};Gt.rotateY=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[8],f=e[9],h=e[10],v=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*n-u*i,t[1]=o*n-f*i,t[2]=s*n-h*i,t[3]=l*n-v*i,t[8]=a*i+u*n,t[9]=o*i+f*n,t[10]=s*i+h*n,t[11]=l*i+v*n,t};Gt.rotateZ=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),a=e[0],o=e[1],s=e[2],l=e[3],u=e[4],f=e[5],h=e[6],v=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*n+u*i,t[1]=o*n+f*i,t[2]=s*n+h*i,t[3]=l*n+v*i,t[4]=u*n-a*i,t[5]=f*n-o*i,t[6]=h*n-s*i,t[7]=v*n-l*i,t};Gt.fromRotationTranslation=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=i+i,l=n+n,u=a+a,f=i*s,h=i*l,v=i*u,c=n*l,d=n*u,p=a*u,g=o*s,m=o*l,_=o*u;return t[0]=1-(c+p),t[1]=h+_,t[2]=v-m,t[3]=0,t[4]=h-_,t[5]=1-(f+p),t[6]=d+g,t[7]=0,t[8]=v+m,t[9]=d-g,t[10]=1-(f+c),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t};Gt.fromQuat=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=r+r,s=i+i,l=n+n,u=r*o,f=i*o,h=i*s,v=n*o,c=n*s,d=n*l,p=a*o,g=a*s,m=a*l;return t[0]=1-h-d,t[1]=f+m,t[2]=v-g,t[3]=0,t[4]=f-m,t[5]=1-u-d,t[6]=c+p,t[7]=0,t[8]=v+g,t[9]=c-p,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};Gt.frustum=function(t,e,r,i,n,a,o){var s=1/(r-e),l=1/(n-i),u=1/(a-o);return t[0]=a*2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a*2*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(n+i)*l,t[10]=(o+a)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*u,t[15]=0,t};Gt.perspective=function(t,e,r,i,n){var a=1/Math.tan(e/2),o=1/(i-n);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(n+i)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*n*i*o,t[15]=0,t};Gt.ortho=function(t,e,r,i,n,a,o){var s=1/(e-r),l=1/(i-n),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+r)*s,t[13]=(n+i)*l,t[14]=(o+a)*u,t[15]=1,t};Gt.lookAt=function(t,e,r,i){var n,a,o,s,l,u,f,h,v,c,d=e[0],p=e[1],g=e[2],m=i[0],_=i[1],y=i[2],x=r[0],S=r[1],T=r[2];return Math.abs(d-x)<Pu&&Math.abs(p-S)<Pu&&Math.abs(g-T)<Pu?Gt.identity(t):(f=d-x,h=p-S,v=g-T,c=1/Math.sqrt(f*f+h*h+v*v),f*=c,h*=c,v*=c,n=_*v-y*h,a=y*f-m*v,o=m*h-_*f,c=Math.sqrt(n*n+a*a+o*o),c?(c=1/c,n*=c,a*=c,o*=c):(n=0,a=0,o=0),s=h*o-v*a,l=v*n-f*o,u=f*a-h*n,c=Math.sqrt(s*s+l*l+u*u),c?(c=1/c,s*=c,l*=c,u*=c):(s=0,l=0,u=0),t[0]=n,t[1]=s,t[2]=f,t[3]=0,t[4]=a,t[5]=l,t[6]=h,t[7]=0,t[8]=o,t[9]=u,t[10]=v,t[11]=0,t[12]=-(n*d+a*p+o*g),t[13]=-(s*d+l*p+u*g),t[14]=-(f*d+h*p+v*g),t[15]=1,t)};Gt.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))};const H=Gt;var ot={};ot.create=function(){var t=new Ce(3);return t[0]=0,t[1]=0,t[2]=0,t};ot.clone=function(t){var e=new Ce(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e};ot.fromValues=function(t,e,r){var i=new Ce(3);return i[0]=t,i[1]=e,i[2]=r,i};ot.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t};ot.set=function(t,e,r,i){return t[0]=e,t[1]=r,t[2]=i,t};ot.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t};ot.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t};ot.sub=ot.subtract;ot.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t};ot.mul=ot.multiply;ot.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t};ot.div=ot.divide;ot.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t};ot.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t};ot.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t};ot.scaleAndAdd=function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t};ot.distance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2];return Math.sqrt(r*r+i*i+n*n)};ot.dist=ot.distance;ot.squaredDistance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2];return r*r+i*i+n*n};ot.sqrDist=ot.squaredDistance;ot.length=function(t){var e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)};ot.len=ot.length;ot.squaredLength=function(t){var e=t[0],r=t[1],i=t[2];return e*e+r*r+i*i};ot.sqrLen=ot.squaredLength;ot.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t};ot.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t};ot.normalize=function(t,e){var r=e[0],i=e[1],n=e[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t};ot.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]};ot.cross=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=n*l-a*s,t[1]=a*o-i*l,t[2]=i*s-n*o,t};ot.lerp=function(t,e,r,i){var n=e[0],a=e[1],o=e[2];return t[0]=n+i*(r[0]-n),t[1]=a+i*(r[1]-a),t[2]=o+i*(r[2]-o),t};ot.random=function(t,e){e=e||1;var r=eo()*2*Math.PI,i=eo()*2-1,n=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*n,t[1]=Math.sin(r)*n,t[2]=i*e,t};ot.transformMat4=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=r[3]*i+r[7]*n+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*i+r[4]*n+r[8]*a+r[12])/o,t[1]=(r[1]*i+r[5]*n+r[9]*a+r[13])/o,t[2]=(r[2]*i+r[6]*n+r[10]*a+r[14])/o,t};ot.transformMat3=function(t,e,r){var i=e[0],n=e[1],a=e[2];return t[0]=i*r[0]+n*r[3]+a*r[6],t[1]=i*r[1]+n*r[4]+a*r[7],t[2]=i*r[2]+n*r[5]+a*r[8],t};ot.transformQuat=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],f=u*i+s*a-l*n,h=u*n+l*i-o*a,v=u*a+o*n-s*i,c=-o*i-s*n-l*a;return t[0]=f*u+c*-o+h*-l-v*-s,t[1]=h*u+c*-s+v*-o-f*-l,t[2]=v*u+c*-l+f*-s-h*-o,t};ot.rotateX=function(t,e,r,i){var n=[],a=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],a[0]=n[0],a[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),a[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t};ot.rotateY=function(t,e,r,i){var n=[],a=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],a[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),a[1]=n[1],a[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t};ot.rotateZ=function(t,e,r,i){var n=[],a=[];return n[0]=e[0]-r[0],n[1]=e[1]-r[1],n[2]=e[2]-r[2],a[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),a[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),a[2]=n[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t};ot.forEach=function(){var t=ot.create();return function(e,r,i,n,a,o){var s,l;for(r||(r=3),i||(i=0),n?l=Math.min(n*r+i,e.length):l=e.length,s=i;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2];return e}}();ot.angle=function(t,e){var r=ot.fromValues(t[0],t[1],t[2]),i=ot.fromValues(e[0],e[1],e[2]);ot.normalize(r,r),ot.normalize(i,i);var n=ot.dot(r,i);return n>1?0:Math.acos(n)};const P=ot;V.import(D2);var qt=H.create,Ey={};function Cy(t){return t.material}function vB(t,e,r){return e.uniforms[r].value}function dB(t,e,r,i){return r!==i}function pB(t){return!0}function My(){}var Dy={float:B.FLOAT,byte:B.BYTE,ubyte:B.UNSIGNED_BYTE,short:B.SHORT,ushort:B.UNSIGNED_SHORT};function gB(t,e,r){this.availableAttributes=t,this.availableAttributeSymbols=e,this.indicesBuffer=r,this.vao=null}function mB(t){var e,r;this.bind=function(i){e||(e=pe.createCanvas(),e.width=e.height=1,e.getContext("2d"));var n=i.gl,a=!r;a&&(r=n.createTexture()),n.bindTexture(n.TEXTURE_2D,r),a&&n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e)},this.unbind=function(i){i.gl.bindTexture(i.gl.TEXTURE_2D,null)},this.isRenderable=function(){return!0}}var sn=or.extend(function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:typeof window<"u"&&window.devicePixelRatio||1,clearColor:[0,0,0,0],clearBit:17664,alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,throwError:!0,gl:null,viewport:{},maxJointNumber:20,__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}},function(){this.canvas||(this.canvas=pe.createCanvas());var t=this.canvas;try{var e={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer};if(this.gl=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!this.gl)throw new Error;this._glinfo=new X3(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),this.gl.targetRenderer=this,this.resize()}catch(r){throw"Error creating WebGL Context "+r}this._programMgr=new A2(this),this._placeholderTexture=new mB},{resize:function(t,e){var r=this.canvas,i=this.devicePixelRatio;t!=null?(r.style&&(r.style.width=t+"px",r.style.height=e+"px"),r.width=t*i,r.height=e*i,this._width=t,this._height=e):(this._width=r.width/i,this._height=r.height/i),this.setViewport(0,0,this._width,this._height)},getWidth:function(){return this._width},getHeight:function(){return this._height},getViewportAspect:function(){var t=this.viewport;return t.width/t.height},setDevicePixelRatio:function(t){this.devicePixelRatio=t,this.resize(this._width,this._height)},getDevicePixelRatio:function(){return this.devicePixelRatio},getGLExtension:function(t){return this._glinfo.getExtension(t)},getGLParameter:function(t){return this._glinfo.getParameter(t)},setViewport:function(t,e,r,i,n){if(typeof t=="object"){var a=t;t=a.x,e=a.y,r=a.width,i=a.height,n=a.devicePixelRatio}n=n||this.devicePixelRatio,this.gl.viewport(t*n,e*n,r*n,i*n),this.viewport={x:t,y:e,width:r,height:i,devicePixelRatio:n}},saveViewport:function(){this._viewportStack.push(this.viewport)},restoreViewport:function(){this._viewportStack.length>0&&this.setViewport(this._viewportStack.pop())},saveClear:function(){this._clearStack.push({clearBit:this.clearBit,clearColor:this.clearColor})},restoreClear:function(){if(this._clearStack.length>0){var t=this._clearStack.pop();this.clearColor=t.clearColor,this.clearBit=t.clearBit}},bindSceneRendering:function(t){this._sceneRendering=t},render:function(t,e,r,i){var n=this.gl,a=this.clearColor;if(this.clearBit){n.colorMask(!0,!0,!0,!0),n.depthMask(!0);var o=this.viewport,s=!1,l=o.devicePixelRatio;(o.width!==this._width||o.height!==this._height||l&&l!==this.devicePixelRatio||o.x||o.y)&&(s=!0,n.enable(n.SCISSOR_TEST),n.scissor(o.x*l,o.y*l,o.width*l,o.height*l)),n.clearColor(a[0],a[1],a[2],a[3]),n.clear(this.clearBit),s&&n.disable(n.SCISSOR_TEST)}if(r||t.update(!1),t.updateLights(),e=e||t.getMainCamera(),!e){console.error("Can't find camera in the scene.");return}e.update();var u=t.updateRenderList(e,!0);this._sceneRendering=t;var f=u.opaque,h=u.transparent,v=t.material;t.trigger("beforerender",this,t,e,u),i?(this.renderPreZ(f,t,e),n.depthFunc(n.LEQUAL)):n.depthFunc(n.LESS);for(var c=qt(),d=P.create(),p=0;p<h.length;p++){var g=h[p];H.multiplyAffine(c,e.viewMatrix.array,g.worldTransform.array),P.transformMat4(d,g.position.array,c),g.__depth=d[2]}this.renderPass(f,e,{getMaterial:function(m){return v||m.material},sortCompare:this.opaqueSortCompare}),this.renderPass(h,e,{getMaterial:function(m){return v||m.material},sortCompare:this.transparentSortCompare}),t.trigger("afterrender",this,t,e,u),this._sceneRendering=null},getProgram:function(t,e,r){return e=e||t.material,this._programMgr.getProgram(t,e,r)},validateProgram:function(t){if(t.__error){var e=t.__error;if(Ey[t.__uid__])return;if(Ey[t.__uid__]=!0,this.throwError)throw new Error(e);this.trigger("error",e)}},updatePrograms:function(t,e,r){var i=r&&r.getMaterial||Cy;e=e||null;for(var n=0;n<t.length;n++){var a=t[n],o=i.call(this,a);if(n>0){var s=t[n-1],l=s.joints?s.joints.length:0,u=a.joints?a.joints.length:0;if(u===l&&a.material===s.material&&a.lightGroup===s.lightGroup){a.__program=s.__program;continue}}var f=this._programMgr.getProgram(a,o,e);this.validateProgram(f),a.__program=f}},renderPass:function(t,e,r){this.trigger("beforerenderpass",this,t,e,r),r=r||{},r.getMaterial=r.getMaterial||Cy,r.getUniform=r.getUniform||vB,r.isMaterialChanged=r.isMaterialChanged||dB,r.beforeRender=r.beforeRender||My,r.afterRender=r.afterRender||My;var i=r.ifRender||pB;this.updatePrograms(t,this._sceneRendering,r),r.sortCompare&&t.sort(r.sortCompare);var n=this.viewport,a=n.devicePixelRatio,o=[n.x*a,n.y*a,n.width*a,n.height*a],s=this.devicePixelRatio,l=this.__currentFrameBuffer?[this.__currentFrameBuffer.getTextureWidth(),this.__currentFrameBuffer.getTextureHeight()]:[this._width*s,this._height*s],u=[o[2],o[3]],f=Date.now();e?(H.copy(Zt.VIEW,e.viewMatrix.array),H.copy(Zt.PROJECTION,e.projectionMatrix.array),H.copy(Zt.VIEWINVERSE,e.worldTransform.array)):(H.identity(Zt.VIEW),H.identity(Zt.PROJECTION),H.identity(Zt.VIEWINVERSE)),H.multiply(Zt.VIEWPROJECTION,Zt.PROJECTION,Zt.VIEW),H.invert(Zt.PROJECTIONINVERSE,Zt.PROJECTION),H.invert(Zt.VIEWPROJECTIONINVERSE,Zt.VIEWPROJECTION);for(var h=this.gl,v=this._sceneRendering,c,d,p,g,m,_,y,x,S,T,b,w,A=null,C=0;C<t.length;C++){var E=t[C],D=E.worldTransform!=null,L;if(i(E)){D&&(L=E.isSkinnedMesh&&E.isSkinnedMesh()?E.offsetMatrix?E.offsetMatrix.array:Zt.IDENTITY:E.worldTransform.array);var R=E.geometry,N=r.getMaterial.call(this,E),I=E.__program,F=N.shader,O=R.__uid__+"-"+I.__uid__,z=O!==T;T=O,z&&A&&A.bindVertexArrayOES(null),D&&(H.copy(Zt.WORLD,L),H.multiply(Zt.WORLDVIEWPROJECTION,Zt.VIEWPROJECTION,L),H.multiplyAffine(Zt.WORLDVIEW,Zt.VIEW,L),(F.matrixSemantics.WORLDINVERSE||F.matrixSemantics.WORLDINVERSETRANSPOSE)&&H.invert(Zt.WORLDINVERSE,L),(F.matrixSemantics.WORLDVIEWINVERSE||F.matrixSemantics.WORLDVIEWINVERSETRANSPOSE)&&H.invert(Zt.WORLDVIEWINVERSE,Zt.WORLDVIEW),(F.matrixSemantics.WORLDVIEWPROJECTIONINVERSE||F.matrixSemantics.WORLDVIEWPROJECTIONINVERSETRANSPOSE)&&H.invert(Zt.WORLDVIEWPROJECTIONINVERSE,Zt.WORLDVIEWPROJECTION)),E.beforeRender&&E.beforeRender(this),r.beforeRender.call(this,E,N,c);var k=I!==d;k?(I.bind(this),I.setUniformOfSemantic(h,"VIEWPORT",o),I.setUniformOfSemantic(h,"WINDOW_SIZE",l),e&&(I.setUniformOfSemantic(h,"NEAR",e.near),I.setUniformOfSemantic(h,"FAR",e.far)),I.setUniformOfSemantic(h,"DEVICEPIXELRATIO",a),I.setUniformOfSemantic(h,"TIME",f),I.setUniformOfSemantic(h,"VIEWPORT_SIZE",u),v&&v.setLightUniforms(I,E.lightGroup,this)):I=d,(k||r.isMaterialChanged(E,p,N,c))&&(N.depthTest!==g&&(N.depthTest?h.enable(h.DEPTH_TEST):h.disable(h.DEPTH_TEST),g=N.depthTest),N.depthMask!==m&&(h.depthMask(N.depthMask),m=N.depthMask),N.transparent!==S&&(N.transparent?h.enable(h.BLEND):h.disable(h.BLEND),S=N.transparent),N.transparent&&(N.blend?N.blend(h):(h.blendEquationSeparate(h.FUNC_ADD,h.FUNC_ADD),h.blendFuncSeparate(h.SRC_ALPHA,h.ONE_MINUS_SRC_ALPHA,h.ONE,h.ONE_MINUS_SRC_ALPHA))),w=this._bindMaterial(E,N,I,p||null,c||null,d||null,r.getUniform),c=N);var it=F.matrixSemanticKeys;if(D)for(var $=0;$<it.length;$++){var nt=it[$],rt=F.matrixSemantics[nt],It=Zt[nt];if(rt.isTranspose){var gt=Zt[rt.semanticNoTranspose];H.transpose(It,gt)}I.setUniform(h,rt.type,rt.symbol,It)}E.cullFace!==y&&(y=E.cullFace,h.cullFace(y)),E.frontFace!==x&&(x=E.frontFace,h.frontFace(x)),E.culling!==_&&(_=E.culling,_?h.enable(h.CULL_FACE):h.disable(h.CULL_FACE)),this._updateSkeleton(E,I,w),z&&(b=this._bindVAO(A,F,R,I)),this._renderObject(E,b,I),r.afterRender(this,E),E.afterRender&&E.afterRender(this),d=I,p=E}}this.trigger("afterrenderpass",this,t,e,r)},getMaxJointNumber:function(){return this.maxJointNumber},_updateSkeleton:function(t,e,r){var i=this.gl,n=t.skeleton;if(n)if(n.update(),t.joints.length>this.getMaxJointNumber()){var a=n.getSubSkinMatricesTexture(t.__uid__,t.joints);e.useTextureSlot(this,a,r),e.setUniform(i,"1i","skinMatricesTexture",r),e.setUniform(i,"1f","skinMatricesTextureSize",a.width)}else{var o=n.getSubSkinMatrices(t.__uid__,t.joints);e.setUniformOfSemantic(i,"SKIN_MATRIX",o)}},_renderObject:function(t,e,r){var i=this.gl,n=t.geometry,a=t.mode;a==null&&(a=4);var o=null,s=t.isInstancedMesh&&t.isInstancedMesh();if(s&&(o=this.getGLExtension("ANGLE_instanced_arrays"),!o)){console.warn("Device not support ANGLE_instanced_arrays extension");return}var l;if(s&&(l=this._bindInstancedAttributes(t,r,o)),e.indicesBuffer){var u=this.getGLExtension("OES_element_index_uint"),f=u&&n.indices instanceof Uint32Array,h=f?i.UNSIGNED_INT:i.UNSIGNED_SHORT;s?o.drawElementsInstancedANGLE(a,e.indicesBuffer.count,h,0,t.getInstanceCount()):i.drawElements(a,e.indicesBuffer.count,h,0)}else s?o.drawArraysInstancedANGLE(a,0,n.vertexCount,t.getInstanceCount()):i.drawArrays(a,0,n.vertexCount);if(s)for(var v=0;v<l.length;v++)i.disableVertexAttribArray(l[v])},_bindInstancedAttributes:function(t,e,r){for(var i=this.gl,n=t.getInstancedAttributesBuffers(this),a=[],o=0;o<n.length;o++){var s=n[o],l=e.getAttribLocation(i,s.symbol);if(!(l<0)){var u=Dy[s.type]||i.FLOAT;i.enableVertexAttribArray(l),i.bindBuffer(i.ARRAY_BUFFER,s.buffer),i.vertexAttribPointer(l,s.size,u,!1,0,0),r.vertexAttribDivisorANGLE(l,s.divisor),a.push(l)}}return a},_bindMaterial:function(t,e,r,i,n,a,o){for(var s=this.gl,l=a===r,u=r.currentTextureSlot(),f=e.getEnabledUniforms(),h=e.getTextureUniforms(),v=this._placeholderTexture,c=0;c<h.length;c++){var d=h[c],p=o(t,e,d),g=e.uniforms[d].type;if(g==="t"&&p)p.__slot=-1;else if(g==="tv")for(var m=0;m<p.length;m++)p[m]&&(p[m].__slot=-1)}v.__slot=-1;for(var c=0;c<f.length;c++){var d=f[c],_=e.uniforms[d],p=o(t,e,d),g=_.type,y=g==="t";if(y&&(!p||!p.isRenderable())&&(p=v),n&&l){var x=o(i,n,d);if(y&&(!x||!x.isRenderable())&&(x=v),x===p){if(y)r.takeCurrentTextureSlot(this,null);else if(g==="tv"&&p)for(var m=0;m<p.length;m++)r.takeCurrentTextureSlot(this,null);continue}}if(p!=null)if(y)if(p.__slot<0){var S=r.currentTextureSlot(),T=r.setUniform(s,"1i",d,S);T&&(r.takeCurrentTextureSlot(this,p),p.__slot=S)}else r.setUniform(s,"1i",d,p.__slot);else if(Array.isArray(p)){if(p.length===0)continue;if(g==="tv"){if(!r.hasUniform(d))continue;for(var b=[],m=0;m<p.length;m++){var w=p[m];if(w.__slot<0){var S=r.currentTextureSlot();b.push(S),r.takeCurrentTextureSlot(this,w),w.__slot=S}else b.push(w.__slot)}r.setUniform(s,"1iv",d,b)}else r.setUniform(s,_.type,d,p)}else r.setUniform(s,_.type,d,p)}var A=r.currentTextureSlot();return r.resetTextureSlot(u),A},_bindVAO:function(t,e,r,i){var n=!r.dynamic,a=this.gl,o=this.__uid__+"-"+i.__uid__,s=r.__vaoCache[o];if(!s){var l=r.getBufferChunks(this);if(!l||!l.length)return;for(var u=l[0],f=u.attributeBuffers,x=u.indicesBuffer,y=[],h=[],v=0;v<f.length;v++){var c=f[v],d=c.name,p=c.semantic,g;if(p){var m=e.attributeSemantics[p];g=m&&m.symbol}else g=d;g&&i.attributes[g]&&(y.push(c),h.push(g))}s=new gB(y,h,x),n&&(r.__vaoCache[o]=s)}var _=!0;t&&n&&(s.vao==null?s.vao=t.createVertexArrayOES():_=!1,t.bindVertexArrayOES(s.vao));var y=s.availableAttributes,x=s.indicesBuffer;if(_){for(var S=i.enableAttributes(this,s.availableAttributeSymbols,t&&n&&s),v=0;v<y.length;v++){var T=S[v];if(T!==-1){var c=y[v],b=c.buffer,w=c.size,A=Dy[c.type]||a.FLOAT;a.bindBuffer(a.ARRAY_BUFFER,b),a.vertexAttribPointer(T,w,A,!1,0,0)}}r.isUseIndices()&&a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,x.buffer)}return s},renderPreZ:function(t,e,r){var i=this.gl,n=this._prezMaterial||new Ii({shader:new V(V.source("clay.prez.vertex"),V.source("clay.prez.fragment"))});this._prezMaterial=n,i.colorMask(!1,!1,!1,!1),i.depthMask(!0),this.renderPass(t,r,{ifRender:function(a){return!a.ignorePreZ},isMaterialChanged:function(a,o){var s=a.material,l=o.material;return s.get("diffuseMap")!==l.get("diffuseMap")||(s.get("alphaCutoff")||0)!==(l.get("alphaCutoff")||0)},getUniform:function(a,o,s){if(s==="alphaMap")return a.material.get("diffuseMap");if(s==="alphaCutoff"){if(a.material.isDefined("fragment","ALPHA_TEST")&&a.material.get("diffuseMap")){var l=a.material.get("alphaCutoff");return l||0}return 0}else return s==="uvRepeat"?a.material.get("uvRepeat"):s==="uvOffset"?a.material.get("uvOffset"):o.get(s)},getMaterial:function(){return n},sort:this.opaqueSortCompare}),i.colorMask(!0,!0,!0,!0),i.depthMask(!0)},disposeScene:function(t){this.disposeNode(t,!0,!0),t.dispose()},disposeNode:function(t,e,r){t.getParent()&&t.getParent().remove(t);var i={};t.traverse(function(n){var a=n.material;if(n.geometry&&e&&n.geometry.dispose(this),r&&a&&!i[a.__uid__]){for(var o=a.getTextureUniforms(),s=0;s<o.length;s++){var l=o[s],u=a.uniforms[l].value,f=a.uniforms[l].type;if(u){if(f==="t")u.dispose&&u.dispose(this);else if(f==="tv")for(var h=0;h<u.length;h++)u[h]&&u[h].dispose&&u[h].dispose(this)}}i[a.__uid__]=!0}n.dispose&&n.dispose(this)},this)},disposeGeometry:function(t){t.dispose(this)},disposeTexture:function(t){t.dispose(this)},disposeFrameBuffer:function(t){t.dispose(this)},dispose:function(){},screenToNDC:function(t,e,r){r||(r=new ur),e=this._height-e;var i=this.viewport,n=r.array;return n[0]=(t-i.x)/i.width,n[0]=n[0]*2-1,n[1]=(e-i.y)/i.height,n[1]=n[1]*2-1,r}});sn.opaqueSortCompare=sn.prototype.opaqueSortCompare=function(t,e){return t.renderOrder===e.renderOrder?t.__program===e.__program?t.material===e.material?t.geometry.__uid__-e.geometry.__uid__:t.material.__uid__-e.material.__uid__:t.__program&&e.__program?t.__program.__uid__-e.__program.__uid__:0:t.renderOrder-e.renderOrder};sn.transparentSortCompare=sn.prototype.transparentSortCompare=function(t,e){return t.renderOrder===e.renderOrder?t.__depth===e.__depth?t.__program===e.__program?t.material===e.material?t.geometry.__uid__-e.geometry.__uid__:t.material.__uid__-e.material.__uid__:t.__program&&e.__program?t.__program.__uid__-e.__program.__uid__:0:t.__depth-e.__depth:t.renderOrder-e.renderOrder};var Zt={IDENTITY:qt(),WORLD:qt(),VIEW:qt(),PROJECTION:qt(),WORLDVIEW:qt(),VIEWPROJECTION:qt(),WORLDVIEWPROJECTION:qt(),WORLDINVERSE:qt(),VIEWINVERSE:qt(),PROJECTIONINVERSE:qt(),WORLDVIEWINVERSE:qt(),VIEWPROJECTIONINVERSE:qt(),WORLDVIEWPROJECTIONINVERSE:qt(),WORLDTRANSPOSE:qt(),VIEWTRANSPOSE:qt(),PROJECTIONTRANSPOSE:qt(),WORLDVIEWTRANSPOSE:qt(),VIEWPROJECTIONTRANSPOSE:qt(),WORLDVIEWPROJECTIONTRANSPOSE:qt(),WORLDINVERSETRANSPOSE:qt(),VIEWINVERSETRANSPOSE:qt(),PROJECTIONINVERSETRANSPOSE:qt(),WORLDVIEWINVERSETRANSPOSE:qt(),VIEWPROJECTIONINVERSETRANSPOSE:qt(),WORLDVIEWPROJECTIONINVERSETRANSPOSE:qt()};sn.COLOR_BUFFER_BIT=B.COLOR_BUFFER_BIT;sn.DEPTH_BUFFER_BIT=B.DEPTH_BUFFER_BIT;sn.STENCIL_BUFFER_BIT=B.STENCIL_BUFFER_BIT;const Ds=sn;var at=function(t,e,r){t=t||0,e=e||0,r=r||0,this.array=P.fromValues(t,e,r),this._dirty=!0};at.prototype={constructor:at,add:function(t){return P.add(this.array,this.array,t.array),this._dirty=!0,this},set:function(t,e,r){return this.array[0]=t,this.array[1]=e,this.array[2]=r,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this.array[2]=t[2],this._dirty=!0,this},clone:function(){return new at(this.x,this.y,this.z)},copy:function(t){return P.copy(this.array,t.array),this._dirty=!0,this},cross:function(t,e){return P.cross(this.array,t.array,e.array),this._dirty=!0,this},dist:function(t){return P.dist(this.array,t.array)},distance:function(t){return P.distance(this.array,t.array)},div:function(t){return P.div(this.array,this.array,t.array),this._dirty=!0,this},divide:function(t){return P.divide(this.array,this.array,t.array),this._dirty=!0,this},dot:function(t){return P.dot(this.array,t.array)},len:function(){return P.len(this.array)},length:function(){return P.length(this.array)},lerp:function(t,e,r){return P.lerp(this.array,t.array,e.array,r),this._dirty=!0,this},min:function(t){return P.min(this.array,this.array,t.array),this._dirty=!0,this},max:function(t){return P.max(this.array,this.array,t.array),this._dirty=!0,this},mul:function(t){return P.mul(this.array,this.array,t.array),this._dirty=!0,this},multiply:function(t){return P.multiply(this.array,this.array,t.array),this._dirty=!0,this},negate:function(){return P.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return P.normalize(this.array,this.array),this._dirty=!0,this},random:function(t){return P.random(this.array,t),this._dirty=!0,this},scale:function(t){return P.scale(this.array,this.array,t),this._dirty=!0,this},scaleAndAdd:function(t,e){return P.scaleAndAdd(this.array,this.array,t.array,e),this._dirty=!0,this},sqrDist:function(t){return P.sqrDist(this.array,t.array)},squaredDistance:function(t){return P.squaredDistance(this.array,t.array)},sqrLen:function(){return P.sqrLen(this.array)},squaredLength:function(){return P.squaredLength(this.array)},sub:function(t){return P.sub(this.array,this.array,t.array),this._dirty=!0,this},subtract:function(t){return P.subtract(this.array,this.array,t.array),this._dirty=!0,this},transformMat3:function(t){return P.transformMat3(this.array,this.array,t.array),this._dirty=!0,this},transformMat4:function(t){return P.transformMat4(this.array,this.array,t.array),this._dirty=!0,this},transformQuat:function(t){return P.transformQuat(this.array,this.array,t.array),this._dirty=!0,this},applyProjection:function(t){var e=this.array;if(t=t.array,t[15]===0){var r=-1/e[2];e[0]=t[0]*e[0]*r,e[1]=t[5]*e[1]*r,e[2]=(t[10]*e[2]+t[14])*r}else e[0]=t[0]*e[0]+t[12],e[1]=t[5]*e[1]+t[13],e[2]=t[10]*e[2]+t[14];return this._dirty=!0,this},eulerFromQuat:function(t,e){at.eulerFromQuat(this,t,e)},eulerFromMat3:function(t,e){at.eulerFromMat3(this,t,e)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var nu=Object.defineProperty;if(nu){var rv=at.prototype;nu(rv,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),nu(rv,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}}),nu(rv,"z",{get:function(){return this.array[2]},set:function(t){this.array[2]=t,this._dirty=!0}})}at.add=function(t,e,r){return P.add(t.array,e.array,r.array),t._dirty=!0,t};at.set=function(t,e,r,i){P.set(t.array,e,r,i),t._dirty=!0};at.copy=function(t,e){return P.copy(t.array,e.array),t._dirty=!0,t};at.cross=function(t,e,r){return P.cross(t.array,e.array,r.array),t._dirty=!0,t};at.dist=function(t,e){return P.distance(t.array,e.array)};at.distance=at.dist;at.div=function(t,e,r){return P.divide(t.array,e.array,r.array),t._dirty=!0,t};at.divide=at.div;at.dot=function(t,e){return P.dot(t.array,e.array)};at.len=function(t){return P.length(t.array)};at.lerp=function(t,e,r,i){return P.lerp(t.array,e.array,r.array,i),t._dirty=!0,t};at.min=function(t,e,r){return P.min(t.array,e.array,r.array),t._dirty=!0,t};at.max=function(t,e,r){return P.max(t.array,e.array,r.array),t._dirty=!0,t};at.mul=function(t,e,r){return P.multiply(t.array,e.array,r.array),t._dirty=!0,t};at.multiply=at.mul;at.negate=function(t,e){return P.negate(t.array,e.array),t._dirty=!0,t};at.normalize=function(t,e){return P.normalize(t.array,e.array),t._dirty=!0,t};at.random=function(t,e){return P.random(t.array,e),t._dirty=!0,t};at.scale=function(t,e,r){return P.scale(t.array,e.array,r),t._dirty=!0,t};at.scaleAndAdd=function(t,e,r,i){return P.scaleAndAdd(t.array,e.array,r.array,i),t._dirty=!0,t};at.sqrDist=function(t,e){return P.sqrDist(t.array,e.array)};at.squaredDistance=at.sqrDist;at.sqrLen=function(t){return P.sqrLen(t.array)};at.squaredLength=at.sqrLen;at.sub=function(t,e,r){return P.subtract(t.array,e.array,r.array),t._dirty=!0,t};at.subtract=at.sub;at.transformMat3=function(t,e,r){return P.transformMat3(t.array,e.array,r.array),t._dirty=!0,t};at.transformMat4=function(t,e,r){return P.transformMat4(t.array,e.array,r.array),t._dirty=!0,t};at.transformQuat=function(t,e,r){return P.transformQuat(t.array,e.array,r.array),t._dirty=!0,t};function Er(t,e,r){return t<e?e:t>r?r:t}var Ut=Math.atan2,Cr=Math.asin,Oa=Math.abs;at.eulerFromQuat=function(t,e,v){t._dirty=!0,e=e.array;var i=t.array,n=e[0],a=e[1],o=e[2],s=e[3],l=n*n,u=a*a,f=o*o,h=s*s,v=(v||"XYZ").toUpperCase();switch(v){case"XYZ":i[0]=Ut(2*(n*s-a*o),h-l-u+f),i[1]=Cr(Er(2*(n*o+a*s),-1,1)),i[2]=Ut(2*(o*s-n*a),h+l-u-f);break;case"YXZ":i[0]=Cr(Er(2*(n*s-a*o),-1,1)),i[1]=Ut(2*(n*o+a*s),h-l-u+f),i[2]=Ut(2*(n*a+o*s),h-l+u-f);break;case"ZXY":i[0]=Cr(Er(2*(n*s+a*o),-1,1)),i[1]=Ut(2*(a*s-o*n),h-l-u+f),i[2]=Ut(2*(o*s-n*a),h-l+u-f);break;case"ZYX":i[0]=Ut(2*(n*s+o*a),h-l-u+f),i[1]=Cr(Er(2*(a*s-n*o),-1,1)),i[2]=Ut(2*(n*a+o*s),h+l-u-f);break;case"YZX":i[0]=Ut(2*(n*s-o*a),h-l+u-f),i[1]=Ut(2*(a*s-n*o),h+l-u-f),i[2]=Cr(Er(2*(n*a+o*s),-1,1));break;case"XZY":i[0]=Ut(2*(n*s+a*o),h-l+u-f),i[1]=Ut(2*(n*o+a*s),h+l-u-f),i[2]=Cr(Er(2*(o*s-n*a),-1,1));break;default:console.warn("Unkown order: "+v)}return t};at.eulerFromMat3=function(t,e,d){var i=e.array,n=i[0],a=i[3],o=i[6],s=i[1],l=i[4],u=i[7],f=i[2],h=i[5],v=i[8],c=t.array,d=(d||"XYZ").toUpperCase();switch(d){case"XYZ":c[1]=Cr(Er(o,-1,1)),Oa(o)<.99999?(c[0]=Ut(-u,v),c[2]=Ut(-a,n)):(c[0]=Ut(h,l),c[2]=0);break;case"YXZ":c[0]=Cr(-Er(u,-1,1)),Oa(u)<.99999?(c[1]=Ut(o,v),c[2]=Ut(s,l)):(c[1]=Ut(-f,n),c[2]=0);break;case"ZXY":c[0]=Cr(Er(h,-1,1)),Oa(h)<.99999?(c[1]=Ut(-f,v),c[2]=Ut(-a,l)):(c[1]=0,c[2]=Ut(s,n));break;case"ZYX":c[1]=Cr(-Er(f,-1,1)),Oa(f)<.99999?(c[0]=Ut(h,v),c[2]=Ut(s,n)):(c[0]=0,c[2]=Ut(-a,l));break;case"YZX":c[2]=Cr(Er(s,-1,1)),Oa(s)<.99999?(c[0]=Ut(-u,l),c[1]=Ut(-f,n)):(c[0]=0,c[1]=Ut(o,v));break;case"XZY":c[2]=Cr(-Er(a,-1,1)),Oa(a)<.99999?(c[0]=Ut(h,l),c[1]=Ut(o,n)):(c[0]=Ut(-u,v),c[1]=0);break;default:console.warn("Unkown order: "+d)}return t._dirty=!0,t};Object.defineProperties(at,{POSITIVE_X:{get:function(){return new at(1,0,0)}},NEGATIVE_X:{get:function(){return new at(-1,0,0)}},POSITIVE_Y:{get:function(){return new at(0,1,0)}},NEGATIVE_Y:{get:function(){return new at(0,-1,0)}},POSITIVE_Z:{get:function(){return new at(0,0,1)}},NEGATIVE_Z:{get:function(){return new at(0,0,-1)}},UP:{get:function(){return new at(0,1,0)}},ZERO:{get:function(){return new at}}});const W=at;var iv=1e-5,Iu=function(t,e){this.origin=t||new W,this.direction=e||new W};Iu.prototype={constructor:Iu,intersectPlane:function(t,e){var r=t.normal.array,i=t.distance,n=this.origin.array,a=this.direction.array,o=P.dot(r,a);if(o===0)return null;e||(e=new W);var s=(P.dot(r,n)-i)/o;return P.scaleAndAdd(e.array,n,a,-s),e._dirty=!0,e},mirrorAgainstPlane:function(t){var e=P.dot(t.normal.array,this.direction.array);P.scaleAndAdd(this.direction.array,this.direction.array,t.normal.array,-e*2),this.direction._dirty=!0},distanceToPoint:function(){var t=P.create();return function(e){P.sub(t,e,this.origin.array);var r=P.dot(t,this.direction.array);if(r<0)return P.distance(this.origin.array,e);var i=P.lenSquared(t);return Math.sqrt(i-r*r)}}(),intersectSphere:function(){var t=P.create();return function(e,r,i){var n=this.origin.array,a=this.direction.array;e=e.array,P.sub(t,e,n);var o=P.dot(t,a),s=P.squaredLength(t),l=s-o*o,u=r*r;if(!(l>u)){var f=Math.sqrt(u-l),h=o-f,v=o+f;return i||(i=new W),h<0?v<0?null:(P.scaleAndAdd(i.array,n,a,v),i):(P.scaleAndAdd(i.array,n,a,h),i)}}}(),intersectBoundingBox:function(t,e){var r=this.direction.array,i=this.origin.array,n=t.min.array,a=t.max.array,o=1/r[0],s=1/r[1],l=1/r[2],u,f,h,v,c,d;if(o>=0?(u=(n[0]-i[0])*o,f=(a[0]-i[0])*o):(f=(n[0]-i[0])*o,u=(a[0]-i[0])*o),s>=0?(h=(n[1]-i[1])*s,v=(a[1]-i[1])*s):(v=(n[1]-i[1])*s,h=(a[1]-i[1])*s),u>v||h>f||((h>u||u!==u)&&(u=h),(v<f||f!==f)&&(f=v),l>=0?(c=(n[2]-i[2])*l,d=(a[2]-i[2])*l):(d=(n[2]-i[2])*l,c=(a[2]-i[2])*l),u>d||c>f)||((c>u||u!==u)&&(u=c),(d<f||f!==f)&&(f=d),f<0))return null;var p=u>=0?u:f;return e||(e=new W),P.scaleAndAdd(e.array,i,r,p),e},intersectTriangle:function(){var t=P.create(),e=P.create(),r=P.create(),i=P.create();return function(n,a,o,s,l,u){var f=this.direction.array,h=this.origin.array;n=n.array,a=a.array,o=o.array,P.sub(t,a,n),P.sub(e,o,n),P.cross(i,e,f);var v=P.dot(t,i);if(s){if(v>-iv)return null}else if(v>-iv&&v<iv)return null;P.sub(r,h,n);var c=P.dot(i,r)/v;if(c<0||c>1)return null;P.cross(i,t,r);var d=P.dot(f,i)/v;if(d<0||d>1||c+d>1)return null;P.cross(i,t,e);var p=-P.dot(r,i)/v;return p<0?null:(l||(l=new W),u&&W.set(u,1-c-d,c,d),P.scaleAndAdd(l.array,h,f,p),l)}}(),applyTransform:function(t){W.add(this.direction,this.direction,this.origin),W.transformMat4(this.origin,this.origin,t),W.transformMat4(this.direction,this.direction,t),W.sub(this.direction,this.direction,this.origin),W.normalize(this.direction,this.direction)},copy:function(t){W.copy(this.origin,t.origin),W.copy(this.direction,t.direction)},clone:function(){var t=new Iu;return t.copy(this),t}};const Ef=Iu;var pt={};pt.create=function(){var t=new Ce(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t};pt.clone=function(t){var e=new Ce(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e};pt.fromValues=function(t,e,r,i){var n=new Ce(4);return n[0]=t,n[1]=e,n[2]=r,n[3]=i,n};pt.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t};pt.set=function(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t};pt.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t};pt.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t};pt.sub=pt.subtract;pt.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t};pt.mul=pt.multiply;pt.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t};pt.div=pt.divide;pt.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t};pt.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t};pt.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t};pt.scaleAndAdd=function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t[2]=e[2]+r[2]*i,t[3]=e[3]+r[3]*i,t};pt.distance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+i*i+n*n+a*a)};pt.dist=pt.distance;pt.squaredDistance=function(t,e){var r=e[0]-t[0],i=e[1]-t[1],n=e[2]-t[2],a=e[3]-t[3];return r*r+i*i+n*n+a*a};pt.sqrDist=pt.squaredDistance;pt.length=function(t){var e=t[0],r=t[1],i=t[2],n=t[3];return Math.sqrt(e*e+r*r+i*i+n*n)};pt.len=pt.length;pt.squaredLength=function(t){var e=t[0],r=t[1],i=t[2],n=t[3];return e*e+r*r+i*i+n*n};pt.sqrLen=pt.squaredLength;pt.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};pt.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t};pt.normalize=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=r*r+i*i+n*n+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t[3]=e[3]*o),t};pt.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]};pt.lerp=function(t,e,r,i){var n=e[0],a=e[1],o=e[2],s=e[3];return t[0]=n+i*(r[0]-n),t[1]=a+i*(r[1]-a),t[2]=o+i*(r[2]-o),t[3]=s+i*(r[3]-s),t};pt.random=function(t,e){return e=e||1,t[0]=eo(),t[1]=eo(),t[2]=eo(),t[3]=eo(),pt.normalize(t,t),pt.scale(t,t,e),t};pt.transformMat4=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*o,t[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*o,t[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*o,t[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*o,t};pt.transformQuat=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=r[0],s=r[1],l=r[2],u=r[3],f=u*i+s*a-l*n,h=u*n+l*i-o*a,v=u*a+o*n-s*i,c=-o*i-s*n-l*a;return t[0]=f*u+c*-o+h*-l-v*-s,t[1]=h*u+c*-s+v*-o-f*-l,t[2]=v*u+c*-l+f*-s-h*-o,t};pt.forEach=function(){var t=pt.create();return function(e,r,i,n,a,o){var s,l;for(r||(r=4),i||(i=0),n?l=Math.min(n*r+i,e.length):l=e.length,s=i;s<l;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}();const Y=pt;var _e={};_e.create=function(){var t=new Ce(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t};_e.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};_e.clone=function(t){var e=new Ce(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e};_e.copy=function(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[6]=e[6],t[7]=e[7],t[8]=e[8],t};_e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t};_e.transpose=function(t,e){if(t===e){var r=e[1],i=e[2],n=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=i,t[7]=n}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t};_e.invert=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],h=f*o-s*u,v=-f*a+s*l,c=u*a-o*l,d=r*h+i*v+n*c;return d?(d=1/d,t[0]=h*d,t[1]=(-f*i+n*u)*d,t[2]=(s*i-n*o)*d,t[3]=v*d,t[4]=(f*r-n*l)*d,t[5]=(-s*r+n*a)*d,t[6]=c*d,t[7]=(-u*r+i*l)*d,t[8]=(o*r-i*a)*d,t):null};_e.adjoint=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8];return t[0]=o*f-s*u,t[1]=n*u-i*f,t[2]=i*s-n*o,t[3]=s*l-a*f,t[4]=r*f-n*l,t[5]=n*a-r*s,t[6]=a*u-o*l,t[7]=i*l-r*u,t[8]=r*o-i*a,t};_e.determinant=function(t){var e=t[0],r=t[1],i=t[2],n=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8];return e*(u*a-o*l)+r*(-u*n+o*s)+i*(l*n-a*s)};_e.multiply=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],h=e[8],v=r[0],c=r[1],d=r[2],p=r[3],g=r[4],m=r[5],_=r[6],y=r[7],x=r[8];return t[0]=v*i+c*o+d*u,t[1]=v*n+c*s+d*f,t[2]=v*a+c*l+d*h,t[3]=p*i+g*o+m*u,t[4]=p*n+g*s+m*f,t[5]=p*a+g*l+m*h,t[6]=_*i+y*o+x*u,t[7]=_*n+y*s+x*f,t[8]=_*a+y*l+x*h,t};_e.mul=_e.multiply;_e.translate=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],h=e[8],v=r[0],c=r[1];return t[0]=i,t[1]=n,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=v*i+c*o+u,t[7]=v*n+c*s+f,t[8]=v*a+c*l+h,t};_e.rotate=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],f=e[7],h=e[8],v=Math.sin(r),c=Math.cos(r);return t[0]=c*i+v*o,t[1]=c*n+v*s,t[2]=c*a+v*l,t[3]=c*o-v*i,t[4]=c*s-v*n,t[5]=c*l-v*a,t[6]=u,t[7]=f,t[8]=h,t};_e.scale=function(t,e,r){var i=r[0],n=r[1];return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t};_e.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t};_e.fromQuat=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=r+r,s=i+i,l=n+n,u=r*o,f=i*o,h=i*s,v=n*o,c=n*s,d=n*l,p=a*o,g=a*s,m=a*l;return t[0]=1-h-d,t[3]=f-m,t[6]=v+g,t[1]=f+m,t[4]=1-u-d,t[7]=c-p,t[2]=v-g,t[5]=c+p,t[8]=1-u-h,t};_e.normalFromMat4=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],f=e[8],h=e[9],v=e[10],c=e[11],d=e[12],p=e[13],g=e[14],m=e[15],_=r*s-i*o,y=r*l-n*o,x=r*u-a*o,S=i*l-n*s,T=i*u-a*s,b=n*u-a*l,w=f*p-h*d,A=f*g-v*d,C=f*m-c*d,E=h*g-v*p,D=h*m-c*p,L=v*m-c*g,R=_*L-y*D+x*E+S*C-T*A+b*w;return R?(R=1/R,t[0]=(s*L-l*D+u*E)*R,t[1]=(l*C-o*L-u*A)*R,t[2]=(o*D-s*C+u*w)*R,t[3]=(n*D-i*L-a*E)*R,t[4]=(r*L-n*C+a*A)*R,t[5]=(i*C-r*D-a*w)*R,t[6]=(p*b-g*T+m*S)*R,t[7]=(g*x-d*b-m*y)*R,t[8]=(d*T-p*x+m*_)*R,t):null};_e.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))};const St=_e;var Rt={};Rt.create=function(){var t=new Ce(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t};Rt.rotationTo=function(){var t=P.create(),e=P.fromValues(1,0,0),r=P.fromValues(0,1,0);return function(i,n,a){var o=P.dot(n,a);return o<-.999999?(P.cross(t,e,n),P.length(t)<1e-6&&P.cross(t,r,n),P.normalize(t,t),Rt.setAxisAngle(i,t,Math.PI),i):o>.999999?(i[0]=0,i[1]=0,i[2]=0,i[3]=1,i):(P.cross(t,n,a),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=1+o,Rt.normalize(i,i))}}();Rt.setAxes=function(){var t=St.create();return function(e,r,i,n){return t[0]=i[0],t[3]=i[1],t[6]=i[2],t[1]=n[0],t[4]=n[1],t[7]=n[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],Rt.normalize(e,Rt.fromMat3(e,t))}}();Rt.clone=Y.clone;Rt.fromValues=Y.fromValues;Rt.copy=Y.copy;Rt.set=Y.set;Rt.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t};Rt.setAxisAngle=function(t,e,r){r=r*.5;var i=Math.sin(r);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(r),t};Rt.add=Y.add;Rt.multiply=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=r[0],l=r[1],u=r[2],f=r[3];return t[0]=i*f+o*s+n*u-a*l,t[1]=n*f+o*l+a*s-i*u,t[2]=a*f+o*u+i*l-n*s,t[3]=o*f-i*s-n*l-a*u,t};Rt.mul=Rt.multiply;Rt.scale=Y.scale;Rt.rotateX=function(t,e,r){r*=.5;var i=e[0],n=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=i*l+o*s,t[1]=n*l+a*s,t[2]=a*l-n*s,t[3]=o*l-i*s,t};Rt.rotateY=function(t,e,r){r*=.5;var i=e[0],n=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=i*l-a*s,t[1]=n*l+o*s,t[2]=a*l+i*s,t[3]=o*l-n*s,t};Rt.rotateZ=function(t,e,r){r*=.5;var i=e[0],n=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=i*l+n*s,t[1]=n*l-i*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t};Rt.calculateW=function(t,e){var r=e[0],i=e[1],n=e[2];return t[0]=r,t[1]=i,t[2]=n,t[3]=Math.sqrt(Math.abs(1-r*r-i*i-n*n)),t};Rt.dot=Y.dot;Rt.lerp=Y.lerp;Rt.slerp=function(t,e,r,i){var n=e[0],a=e[1],o=e[2],s=e[3],l=r[0],u=r[1],f=r[2],h=r[3],v,c,d,p,g;return c=n*l+a*u+o*f+s*h,c<0&&(c=-c,l=-l,u=-u,f=-f,h=-h),1-c>1e-6?(v=Math.acos(c),d=Math.sin(v),p=Math.sin((1-i)*v)/d,g=Math.sin(i*v)/d):(p=1-i,g=i),t[0]=p*n+g*l,t[1]=p*a+g*u,t[2]=p*o+g*f,t[3]=p*s+g*h,t};Rt.invert=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=r*r+i*i+n*n+a*a,s=o?1/o:0;return t[0]=-r*s,t[1]=-i*s,t[2]=-n*s,t[3]=a*s,t};Rt.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t};Rt.length=Y.length;Rt.len=Rt.length;Rt.squaredLength=Y.squaredLength;Rt.sqrLen=Rt.squaredLength;Rt.normalize=Y.normalize;Rt.fromMat3=function(t,e){var r=e[0]+e[4]+e[8],i;if(r>0)i=Math.sqrt(r+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var n=0;e[4]>e[0]&&(n=1),e[8]>e[n*3+n]&&(n=2);var a=(n+1)%3,o=(n+2)%3;i=Math.sqrt(e[n*3+n]-e[a*3+a]-e[o*3+o]+1),t[n]=.5*i,i=.5/i,t[3]=(e[a*3+o]-e[o*3+a])*i,t[a]=(e[a*3+n]+e[n*3+a])*i,t[o]=(e[o*3+n]+e[n*3+o])*i}return t};const lt=Rt;var Yt=function(){this._axisX=new W,this._axisY=new W,this._axisZ=new W,this.array=H.create(),this._dirty=!0};Yt.prototype={constructor:Yt,setArray:function(t){for(var e=0;e<this.array.length;e++)this.array[e]=t[e];return this._dirty=!0,this},adjoint:function(){return H.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return new Yt().copy(this)},copy:function(t){return H.copy(this.array,t.array),this._dirty=!0,this},determinant:function(){return H.determinant(this.array)},fromQuat:function(t){return H.fromQuat(this.array,t.array),this._dirty=!0,this},fromRotationTranslation:function(t,e){return H.fromRotationTranslation(this.array,t.array,e.array),this._dirty=!0,this},fromMat2d:function(t){return Yt.fromMat2d(this,t),this},frustum:function(t,e,r,i,n,a){return H.frustum(this.array,t,e,r,i,n,a),this._dirty=!0,this},identity:function(){return H.identity(this.array),this._dirty=!0,this},invert:function(){return H.invert(this.array,this.array),this._dirty=!0,this},lookAt:function(t,e,r){return H.lookAt(this.array,t.array,e.array,r.array),this._dirty=!0,this},mul:function(t){return H.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return H.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return H.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return H.multiply(this.array,t.array,this.array),this._dirty=!0,this},ortho:function(t,e,r,i,n,a){return H.ortho(this.array,t,e,r,i,n,a),this._dirty=!0,this},perspective:function(t,e,r,i){return H.perspective(this.array,t,e,r,i),this._dirty=!0,this},rotate:function(t,e){return H.rotate(this.array,this.array,t,e.array),this._dirty=!0,this},rotateX:function(t){return H.rotateX(this.array,this.array,t),this._dirty=!0,this},rotateY:function(t){return H.rotateY(this.array,this.array,t),this._dirty=!0,this},rotateZ:function(t){return H.rotateZ(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return H.scale(this.array,this.array,t.array),this._dirty=!0,this},translate:function(t){return H.translate(this.array,this.array,t.array),this._dirty=!0,this},transpose:function(){return H.transpose(this.array,this.array),this._dirty=!0,this},decomposeMatrix:function(){var t=P.create(),e=P.create(),r=P.create(),i=St.create();return function(n,a,o){var s=this.array;P.set(t,s[0],s[1],s[2]),P.set(e,s[4],s[5],s[6]),P.set(r,s[8],s[9],s[10]);var l=P.length(t),u=P.length(e),f=P.length(r),h=this.determinant();h<0&&(l=-l),n&&n.set(l,u,f),o.set(s[12],s[13],s[14]),St.fromMat4(i,s),i[0]/=l,i[1]/=l,i[2]/=l,i[3]/=u,i[4]/=u,i[5]/=u,i[6]/=f,i[7]/=f,i[8]/=f,lt.fromMat3(a.array,i),lt.normalize(a.array,a.array),a._dirty=!0,o._dirty=!0}}(),toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var au=Object.defineProperty;if(au){var nv=Yt.prototype;au(nv,"z",{get:function(){var t=this.array;return this._axisZ.set(t[8],t[9],t[10]),this._axisZ},set:function(t){var e=this.array;t=t.array,e[8]=t[0],e[9]=t[1],e[10]=t[2],this._dirty=!0}}),au(nv,"y",{get:function(){var t=this.array;return this._axisY.set(t[4],t[5],t[6]),this._axisY},set:function(t){var e=this.array;t=t.array,e[4]=t[0],e[5]=t[1],e[6]=t[2],this._dirty=!0}}),au(nv,"x",{get:function(){var t=this.array;return this._axisX.set(t[0],t[1],t[2]),this._axisX},set:function(t){var e=this.array;t=t.array,e[0]=t[0],e[1]=t[1],e[2]=t[2],this._dirty=!0}})}Yt.adjoint=function(t,e){return H.adjoint(t.array,e.array),t._dirty=!0,t};Yt.copy=function(t,e){return H.copy(t.array,e.array),t._dirty=!0,t};Yt.determinant=function(t){return H.determinant(t.array)};Yt.identity=function(t){return H.identity(t.array),t._dirty=!0,t};Yt.ortho=function(t,e,r,i,n,a,o){return H.ortho(t.array,e,r,i,n,a,o),t._dirty=!0,t};Yt.perspective=function(t,e,r,i,n){return H.perspective(t.array,e,r,i,n),t._dirty=!0,t};Yt.lookAt=function(t,e,r,i){return H.lookAt(t.array,e.array,r.array,i.array),t._dirty=!0,t};Yt.invert=function(t,e){return H.invert(t.array,e.array),t._dirty=!0,t};Yt.mul=function(t,e,r){return H.mul(t.array,e.array,r.array),t._dirty=!0,t};Yt.multiply=Yt.mul;Yt.fromQuat=function(t,e){return H.fromQuat(t.array,e.array),t._dirty=!0,t};Yt.fromRotationTranslation=function(t,e,r){return H.fromRotationTranslation(t.array,e.array,r.array),t._dirty=!0,t};Yt.fromMat2d=function(i,r){i._dirty=!0;var r=r.array,i=i.array;return i[0]=r[0],i[4]=r[2],i[12]=r[4],i[1]=r[1],i[5]=r[3],i[13]=r[5],i};Yt.rotate=function(t,e,r,i){return H.rotate(t.array,e.array,r,i.array),t._dirty=!0,t};Yt.rotateX=function(t,e,r){return H.rotateX(t.array,e.array,r),t._dirty=!0,t};Yt.rotateY=function(t,e,r){return H.rotateY(t.array,e.array,r),t._dirty=!0,t};Yt.rotateZ=function(t,e,r){return H.rotateZ(t.array,e.array,r),t._dirty=!0,t};Yt.scale=function(t,e,r){return H.scale(t.array,e.array,r.array),t._dirty=!0,t};Yt.transpose=function(t,e){return H.transpose(t.array,e.array),t._dirty=!0,t};Yt.translate=function(t,e,r){return H.translate(t.array,e.array,r.array),t._dirty=!0,t};const J=Yt;var Bt=function(t,e,r,i){t=t||0,e=e||0,r=r||0,i=i===void 0?1:i,this.array=lt.fromValues(t,e,r,i),this._dirty=!0};Bt.prototype={constructor:Bt,add:function(t){return lt.add(this.array,this.array,t.array),this._dirty=!0,this},calculateW:function(){return lt.calculateW(this.array,this.array),this._dirty=!0,this},set:function(t,e,r,i){return this.array[0]=t,this.array[1]=e,this.array[2]=r,this.array[3]=i,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this.array[2]=t[2],this.array[3]=t[3],this._dirty=!0,this},clone:function(){return new Bt(this.x,this.y,this.z,this.w)},conjugate:function(){return lt.conjugate(this.array,this.array),this._dirty=!0,this},copy:function(t){return lt.copy(this.array,t.array),this._dirty=!0,this},dot:function(t){return lt.dot(this.array,t.array)},fromMat3:function(t){return lt.fromMat3(this.array,t.array),this._dirty=!0,this},fromMat4:function(){var t=St.create();return function(e){return St.fromMat4(t,e.array),St.transpose(t,t),lt.fromMat3(this.array,t),this._dirty=!0,this}}(),identity:function(){return lt.identity(this.array),this._dirty=!0,this},invert:function(){return lt.invert(this.array,this.array),this._dirty=!0,this},len:function(){return lt.len(this.array)},length:function(){return lt.length(this.array)},lerp:function(t,e,r){return lt.lerp(this.array,t.array,e.array,r),this._dirty=!0,this},mul:function(t){return lt.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return lt.multiply(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return lt.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return lt.multiply(this.array,t.array,this.array),this._dirty=!0,this},normalize:function(){return lt.normalize(this.array,this.array),this._dirty=!0,this},rotateX:function(t){return lt.rotateX(this.array,this.array,t),this._dirty=!0,this},rotateY:function(t){return lt.rotateY(this.array,this.array,t),this._dirty=!0,this},rotateZ:function(t){return lt.rotateZ(this.array,this.array,t),this._dirty=!0,this},rotationTo:function(t,e){return lt.rotationTo(this.array,t.array,e.array),this._dirty=!0,this},setAxes:function(t,e,r){return lt.setAxes(this.array,t.array,e.array,r.array),this._dirty=!0,this},setAxisAngle:function(t,e){return lt.setAxisAngle(this.array,t.array,e),this._dirty=!0,this},slerp:function(t,e,r){return lt.slerp(this.array,t.array,e.array,r),this._dirty=!0,this},sqrLen:function(){return lt.sqrLen(this.array)},squaredLength:function(){return lt.squaredLength(this.array)},fromEuler:function(t,e){return Bt.fromEuler(this,t,e)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var Ko=Object.defineProperty;if(Ko){var ou=Bt.prototype;Ko(ou,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),Ko(ou,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}}),Ko(ou,"z",{get:function(){return this.array[2]},set:function(t){this.array[2]=t,this._dirty=!0}}),Ko(ou,"w",{get:function(){return this.array[3]},set:function(t){this.array[3]=t,this._dirty=!0}})}Bt.add=function(t,e,r){return lt.add(t.array,e.array,r.array),t._dirty=!0,t};Bt.set=function(t,e,r,i,n){lt.set(t.array,e,r,i,n),t._dirty=!0};Bt.copy=function(t,e){return lt.copy(t.array,e.array),t._dirty=!0,t};Bt.calculateW=function(t,e){return lt.calculateW(t.array,e.array),t._dirty=!0,t};Bt.conjugate=function(t,e){return lt.conjugate(t.array,e.array),t._dirty=!0,t};Bt.identity=function(t){return lt.identity(t.array),t._dirty=!0,t};Bt.invert=function(t,e){return lt.invert(t.array,e.array),t._dirty=!0,t};Bt.dot=function(t,e){return lt.dot(t.array,e.array)};Bt.len=function(t){return lt.length(t.array)};Bt.lerp=function(t,e,r,i){return lt.lerp(t.array,e.array,r.array,i),t._dirty=!0,t};Bt.slerp=function(t,e,r,i){return lt.slerp(t.array,e.array,r.array,i),t._dirty=!0,t};Bt.mul=function(t,e,r){return lt.multiply(t.array,e.array,r.array),t._dirty=!0,t};Bt.multiply=Bt.mul;Bt.rotateX=function(t,e,r){return lt.rotateX(t.array,e.array,r),t._dirty=!0,t};Bt.rotateY=function(t,e,r){return lt.rotateY(t.array,e.array,r),t._dirty=!0,t};Bt.rotateZ=function(t,e,r){return lt.rotateZ(t.array,e.array,r),t._dirty=!0,t};Bt.setAxisAngle=function(t,e,r){return lt.setAxisAngle(t.array,e.array,r),t._dirty=!0,t};Bt.normalize=function(t,e){return lt.normalize(t.array,e.array),t._dirty=!0,t};Bt.sqrLen=function(t){return lt.sqrLen(t.array)};Bt.squaredLength=Bt.sqrLen;Bt.fromMat3=function(t,e){return lt.fromMat3(t.array,e.array),t._dirty=!0,t};Bt.setAxes=function(t,e,r,i){return lt.setAxes(t.array,e.array,r.array,i.array),t._dirty=!0,t};Bt.rotationTo=function(t,e,r){return lt.rotationTo(t.array,e.array,r.array),t._dirty=!0,t};Bt.fromEuler=function(t,e,f){t._dirty=!0,e=e.array;var i=t.array,n=Math.cos(e[0]/2),a=Math.cos(e[1]/2),o=Math.cos(e[2]/2),s=Math.sin(e[0]/2),l=Math.sin(e[1]/2),u=Math.sin(e[2]/2),f=(f||"XYZ").toUpperCase();switch(f){case"XYZ":i[0]=s*a*o+n*l*u,i[1]=n*l*o-s*a*u,i[2]=n*a*u+s*l*o,i[3]=n*a*o-s*l*u;break;case"YXZ":i[0]=s*a*o+n*l*u,i[1]=n*l*o-s*a*u,i[2]=n*a*u-s*l*o,i[3]=n*a*o+s*l*u;break;case"ZXY":i[0]=s*a*o-n*l*u,i[1]=n*l*o+s*a*u,i[2]=n*a*u+s*l*o,i[3]=n*a*o-s*l*u;break;case"ZYX":i[0]=s*a*o-n*l*u,i[1]=n*l*o+s*a*u,i[2]=n*a*u-s*l*o,i[3]=n*a*o+s*l*u;break;case"YZX":i[0]=s*a*o+n*l*u,i[1]=n*l*o+s*a*u,i[2]=n*a*u-s*l*o,i[3]=n*a*o-s*l*u;break;case"XZY":i[0]=s*a*o-n*l*u,i[1]=n*l*o-s*a*u,i[2]=n*a*u+s*l*o,i[3]=n*a*o+s*l*u;break}};const L2=Bt;var Wi=P.set,su=P.copy,Nu=function(t,e){this.min=t||new W(1/0,1/0,1/0),this.max=e||new W(-1/0,-1/0,-1/0),this.vertices=null};Nu.prototype={constructor:Nu,updateFromVertices:function(t){if(t.length>0){var e=this.min,r=this.max,i=e.array,n=r.array;su(i,t[0]),su(n,t[0]);for(var a=1;a<t.length;a++){var o=t[a];o[0]<i[0]&&(i[0]=o[0]),o[1]<i[1]&&(i[1]=o[1]),o[2]<i[2]&&(i[2]=o[2]),o[0]>n[0]&&(n[0]=o[0]),o[1]>n[1]&&(n[1]=o[1]),o[2]>n[2]&&(n[2]=o[2])}e._dirty=!0,r._dirty=!0}},union:function(t){var e=this.min,r=this.max;return P.min(e.array,e.array,t.min.array),P.max(r.array,r.array,t.max.array),e._dirty=!0,r._dirty=!0,this},intersection:function(t){var e=this.min,r=this.max;return P.max(e.array,e.array,t.min.array),P.min(r.array,r.array,t.max.array),e._dirty=!0,r._dirty=!0,this},intersectBoundingBox:function(t){var e=this.min.array,r=this.max.array,i=t.min.array,n=t.max.array;return!(e[0]>n[0]||e[1]>n[1]||e[2]>n[2]||r[0]<i[0]||r[1]<i[1]||r[2]<i[2])},containBoundingBox:function(t){var e=this.min.array,r=this.max.array,i=t.min.array,n=t.max.array;return e[0]<=i[0]&&e[1]<=i[1]&&e[2]<=i[2]&&r[0]>=n[0]&&r[1]>=n[1]&&r[2]>=n[2]},containPoint:function(t){var e=this.min.array,r=this.max.array,i=t.array;return e[0]<=i[0]&&e[1]<=i[1]&&e[2]<=i[2]&&r[0]>=i[0]&&r[1]>=i[1]&&r[2]>=i[2]},isFinite:function(){var t=this.min.array,e=this.max.array;return isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])&&isFinite(e[0])&&isFinite(e[1])&&isFinite(e[2])},applyTransform:function(t){this.transformFrom(this,t)},transformFrom:function(){var t=P.create(),e=P.create(),r=P.create(),i=P.create(),n=P.create(),a=P.create();return function(o,s){var l=o.min.array,u=o.max.array,f=s.array;return t[0]=f[0]*l[0],t[1]=f[1]*l[0],t[2]=f[2]*l[0],e[0]=f[0]*u[0],e[1]=f[1]*u[0],e[2]=f[2]*u[0],r[0]=f[4]*l[1],r[1]=f[5]*l[1],r[2]=f[6]*l[1],i[0]=f[4]*u[1],i[1]=f[5]*u[1],i[2]=f[6]*u[1],n[0]=f[8]*l[2],n[1]=f[9]*l[2],n[2]=f[10]*l[2],a[0]=f[8]*u[2],a[1]=f[9]*u[2],a[2]=f[10]*u[2],l=this.min.array,u=this.max.array,l[0]=Math.min(t[0],e[0])+Math.min(r[0],i[0])+Math.min(n[0],a[0])+f[12],l[1]=Math.min(t[1],e[1])+Math.min(r[1],i[1])+Math.min(n[1],a[1])+f[13],l[2]=Math.min(t[2],e[2])+Math.min(r[2],i[2])+Math.min(n[2],a[2])+f[14],u[0]=Math.max(t[0],e[0])+Math.max(r[0],i[0])+Math.max(n[0],a[0])+f[12],u[1]=Math.max(t[1],e[1])+Math.max(r[1],i[1])+Math.max(n[1],a[1])+f[13],u[2]=Math.max(t[2],e[2])+Math.max(r[2],i[2])+Math.max(n[2],a[2])+f[14],this.min._dirty=!0,this.max._dirty=!0,this}}(),applyProjection:function(t){var e=this.min.array,r=this.max.array,i=t.array,n=e[0],a=e[1],o=e[2],s=r[0],l=r[1],u=e[2],f=r[0],h=r[1],v=r[2];if(i[15]===1)e[0]=i[0]*n+i[12],e[1]=i[5]*a+i[13],r[2]=i[10]*o+i[14],r[0]=i[0]*f+i[12],r[1]=i[5]*h+i[13],e[2]=i[10]*v+i[14];else{var c=-1/o;e[0]=i[0]*n*c,e[1]=i[5]*a*c,r[2]=(i[10]*o+i[14])*c,c=-1/u,r[0]=i[0]*s*c,r[1]=i[5]*l*c,c=-1/v,e[2]=(i[10]*v+i[14])*c}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){var t=this.vertices;if(!t){t=[];for(var e=0;e<8;e++)t[e]=P.fromValues(0,0,0);this.vertices=t}var r=this.min.array,i=this.max.array;return Wi(t[0],r[0],r[1],r[2]),Wi(t[1],r[0],i[1],r[2]),Wi(t[2],i[0],r[1],r[2]),Wi(t[3],i[0],i[1],r[2]),Wi(t[4],r[0],r[1],i[2]),Wi(t[5],r[0],i[1],i[2]),Wi(t[6],i[0],r[1],i[2]),Wi(t[7],i[0],i[1],i[2]),this},copy:function(t){var e=this.min,r=this.max;return su(e.array,t.min.array),su(r.array,t.max.array),e._dirty=!0,r._dirty=!0,this},clone:function(){var t=new Nu;return t.copy(this),t}};const Ve=Nu;var _B=0,yB=or.extend({name:"",position:null,rotation:null,scale:null,worldTransform:null,localTransform:null,autoUpdateLocalTransform:!0,_parent:null,_scene:null,_needsUpdateWorldTransform:!0,_inIterating:!1,__depth:0},function(){this.name||(this.name=(this.type||"NODE")+"_"+_B++),this.position||(this.position=new W),this.rotation||(this.rotation=new L2),this.scale||(this.scale=new W(1,1,1)),this.worldTransform=new J,this.localTransform=new J,this._children=[]},{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(t){var e=this._scene;if(e){var r=e._nodeRepository;delete r[this.name],r[t]=this}this.name=t},add:function(t){var e=t._parent;if(e!==this){e&&e.remove(t),t._parent=this,this._children.push(t);var r=this._scene;r&&r!==t.scene&&t.traverse(this._addSelfToScene,this),t._needsUpdateWorldTransform=!0}},remove:function(t){var e=this._children,r=e.indexOf(t);r<0||(e.splice(r,1),t._parent=null,this._scene&&t.traverse(this._removeSelfFromScene,this))},removeAll:function(){for(var t=this._children,e=0;e<t.length;e++)t[e]._parent=null,this._scene&&t[e].traverse(this._removeSelfFromScene,this);this._children=[]},getScene:function(){return this._scene},getParent:function(){return this._parent},_removeSelfFromScene:function(t){t._scene.removeFromScene(t),t._scene=null},_addSelfToScene:function(t){this._scene.addToScene(t),t._scene=this._scene},isAncestor:function(t){for(var e=t._parent;e;){if(e===this)return!0;e=e._parent}return!1},children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},getChildByName:function(t){for(var e=this._children,r=0;r<e.length;r++)if(e[r].name===t)return e[r]},getDescendantByName:function(t){for(var e=this._children,r=0;r<e.length;r++){var i=e[r];if(i.name===t)return i;var n=i.getDescendantByName(t);if(n)return n}},queryNode:function(t){if(t){for(var e=t.split("/"),r=this,i=0;i<e.length;i++){var n=e[i];if(n){for(var a=!1,o=r._children,s=0;s<o.length;s++){var l=o[s];if(l.name===n){r=l,a=!0;break}}if(!a)return}}return r}},getPath:function(t){if(!this._parent)return"/";for(var e=this._parent,r=this.name;e._parent&&(r=e.name+"/"+r,e._parent!=t);)e=e._parent;return!e._parent&&t?null:r},traverse:function(t,e){t.call(e,this);for(var r=this._children,i=0,n=r.length;i<n;i++)r[i].traverse(t,e)},eachChild:function(t,e){for(var r=this._children,i=0,n=r.length;i<n;i++){var a=r[i];t.call(e,a,i)}},setLocalTransform:function(t){H.copy(this.localTransform.array,t.array),this.decomposeLocalTransform()},decomposeLocalTransform:function(t){var e=t?null:this.scale;this.localTransform.decomposeMatrix(e,this.rotation,this.position)},setWorldTransform:function(t){H.copy(this.worldTransform.array,t.array),this.decomposeWorldTransform()},decomposeWorldTransform:function(){var t=H.create();return function(e){var r=this.localTransform,i=this.worldTransform;this._parent?(H.invert(t,this._parent.worldTransform.array),H.multiply(r.array,t,i.array)):H.copy(r.array,i.array);var n=e?null:this.scale;r.decomposeMatrix(n,this.rotation,this.position)}}(),transformNeedsUpdate:function(){return this.position._dirty||this.rotation._dirty||this.scale._dirty},updateLocalTransform:function(){var t=this.position,e=this.rotation,r=this.scale;if(this.transformNeedsUpdate()){var i=this.localTransform.array;H.fromRotationTranslation(i,e.array,t.array),H.scale(i,i,r.array),e._dirty=!1,r._dirty=!1,t._dirty=!1,this._needsUpdateWorldTransform=!0}},_updateWorldTransformTopDown:function(){var t=this.localTransform.array,e=this.worldTransform.array;this._parent?H.multiplyAffine(e,this._parent.worldTransform.array,t):H.copy(e,t)},updateWorldTransform:function(){for(var t=this;t&&t.getParent()&&t.getParent().transformNeedsUpdate();)t=t.getParent();t.update()},update:function(t){this.autoUpdateLocalTransform?this.updateLocalTransform():t=!0,(t||this._needsUpdateWorldTransform)&&(this._updateWorldTransformTopDown(),t=!0,this._needsUpdateWorldTransform=!1);for(var e=this._children,r=0,i=e.length;r<i;r++)e[r].update(t)},getBoundingBox:function(){function t(n){return!n.invisible&&n.geometry}var e=new Ve,r=new J,i=new J;return function(n,a){return a=a||new Ve,this._parent?J.invert(i,this._parent.worldTransform):J.identity(i),this.traverse(function(o){o.geometry&&o.geometry.boundingBox&&(e.copy(o.geometry.boundingBox),J.multiply(r,i,o.worldTransform),e.applyTransform(r),a.union(e))},this,t),a}}(),getWorldPosition:function(t){this.transformNeedsUpdate()&&this.updateWorldTransform();var e=this.worldTransform.array;if(t){var r=t.array;return r[0]=e[12],r[1]=e[13],r[2]=e[14],t}else return new W(e[12],e[13],e[14])},clone:function(){var t=new this.constructor,e=this._children;t.setName(this.name),t.position.copy(this.position),t.rotation.copy(this.rotation),t.scale.copy(this.scale);for(var r=0;r<e.length;r++)t.add(e[r].clone());return t},rotateAround:function(){var t=new W,e=new J;return function(r,i,n){t.copy(this.position).subtract(r);var a=this.localTransform;a.identity(),a.translate(r),a.rotate(n,i),e.fromRotationTranslation(this.rotation,t),a.multiply(e),a.scale(this.scale),this.decomposeLocalTransform(),this._needsUpdateWorldTransform=!0}}(),lookAt:function(){var t=new J;return function(e,r){t.lookAt(this.position,e,r||this.localTransform.y).invert(),this.setLocalTransform(t),this.target=e}}()});const hi=yB;var dr=hi.extend({material:null,geometry:null,mode:B.TRIANGLES,_renderInfo:null},{__program:null,lightGroup:0,renderOrder:0,culling:!0,cullFace:B.BACK,frontFace:B.CCW,frustumCulling:!0,receiveShadow:!0,castShadow:!0,ignorePicking:!1,ignorePreZ:!1,ignoreGBuffer:!1,isRenderable:function(){return this.geometry&&this.material&&this.material.shader&&!this.invisible&&this.geometry.vertexCount>0},beforeRender:function(t){},afterRender:function(t,e){},getBoundingBox:function(t,e){return e=hi.prototype.getBoundingBox.call(this,t,e),this.geometry&&this.geometry.boundingBox&&e.union(this.geometry.boundingBox),e},clone:function(){var t=["castShadow","receiveShadow","mode","culling","cullFace","frontFace","frustumCulling","renderOrder","lineWidth","ignorePicking","ignorePreZ","ignoreGBuffer"];return function(){var e=hi.prototype.clone.call(this);e.geometry=this.geometry,e.material=this.material;for(var r=0;r<t.length;r++){var i=t[r];e[i]!==this[i]&&(e[i]=this[i])}return e}}()});dr.POINTS=B.POINTS;dr.LINES=B.LINES;dr.LINE_LOOP=B.LINE_LOOP;dr.LINE_STRIP=B.LINE_STRIP;dr.TRIANGLES=B.TRIANGLES;dr.TRIANGLE_STRIP=B.TRIANGLE_STRIP;dr.TRIANGLE_FAN=B.TRIANGLE_FAN;dr.BACK=B.BACK;dr.FRONT=B.FRONT;dr.FRONT_AND_BACK=B.FRONT_AND_BACK;dr.CW=B.CW;dr.CCW=B.CCW;const kd=dr;var xg=or.extend({scene:null,camera:null,renderer:null},function(){this._ray=new Ef,this._ndc=new ur},{pick:function(t,e,r){var i=this.pickAll(t,e,[],r);return i[0]||null},pickAll:function(t,e,r,i){return this.renderer.screenToNDC(t,e,this._ndc),this.camera.castRay(this._ndc,this._ray),r=r||[],this._intersectNode(this.scene,r,i||!1),r.sort(this._intersectionCompareFunc),r},_intersectNode:function(t,e,r){t instanceof kd&&t.isRenderable()&&(!t.ignorePicking||r)&&(t.mode===B.TRIANGLES&&t.geometry.isUseIndices()||t.geometry.pickByRay||t.geometry.pick)&&this._intersectRenderable(t,e);for(var i=0;i<t._children.length;i++)this._intersectNode(t._children[i],e,r)},_intersectRenderable:function(){var t=new W,e=new W,r=new W,i=new Ef,n=new J;return function(a,o){var s=a.isSkinnedMesh();i.copy(this._ray),J.invert(n,a.worldTransform),s||i.applyTransform(n);var l=a.geometry,u=s?a.skeleton.boundingBox:l.boundingBox;if(!(u&&!i.intersectBoundingBox(u))){if(l.pick){l.pick(this._ndc.x,this._ndc.y,this.renderer,this.camera,a,o);return}else if(l.pickByRay){l.pickByRay(i,a,o);return}var f=a.cullFace===B.BACK&&a.frontFace===B.CCW||a.cullFace===B.FRONT&&a.frontFace===B.CW,h,v=l.indices,c=l.attributes.position,d=l.attributes.weight,p=l.attributes.joint,g,m=[];if(!(!c||!c.value||!v)){if(s){g=a.skeleton.getSubSkinMatrices(a.__uid__,a.joints);for(var _=0;_<a.joints.length;_++){m[_]=m[_]||[];for(var y=0;y<16;y++)m[_][y]=g[_*16+y]}var x=[],S=[],T=[],b=[],w=[],A=l.attributes.skinnedPosition;(!A||!A.value)&&(l.createAttribute("skinnedPosition","f",3),A=l.attributes.skinnedPosition,A.init(l.vertexCount));for(var _=0;_<l.vertexCount;_++){c.get(_,x),d.get(_,S),p.get(_,T),S[3]=1-S[0]-S[1]-S[2],P.set(b,0,0,0);for(var y=0;y<4;y++)T[y]>=0&&S[y]>1e-4&&(P.transformMat4(w,x,m[T[y]]),P.scaleAndAdd(b,b,w,S[y]));A.set(_,b)}}for(var _=0;_<v.length;_+=3){var C=v[_],E=v[_+1],D=v[_+2],L=s?l.attributes.skinnedPosition:c;if(L.get(C,t.array),L.get(E,e.array),L.get(D,r.array),f?h=i.intersectTriangle(t,e,r,a.culling):h=i.intersectTriangle(t,r,e,a.culling),h){var R=new W;s?W.copy(R,h):W.transformMat4(R,h,a.worldTransform),o.push(new xg.Intersection(h,R,a,[C,E,D],_/3,W.dist(R,this._ray.origin)))}}}}}}(),_intersectionCompareFunc:function(t,e){return t.distance-e.distance}});xg.Intersection=function(t,e,r,i,n,a){this.point=t,this.pointWorld=e,this.target=r,this.triangle=i,this.triangleIndex=n,this.distance=a};const xB=xg;var jo="__dt__",Cf=function(){this._contextId=0,this._caches=[],this._context={}};Cf.prototype={use:function(t,e){var r=this._caches;r[t]||(r[t]={},e&&(r[t]=e())),this._contextId=t,this._context=r[t]},put:function(t,e){this._context[t]=e},get:function(t){return this._context[t]},dirty:function(t){t=t||"";var e=jo+t;this.put(e,!0)},dirtyAll:function(t){t=t||"";for(var e=jo+t,r=this._caches,i=0;i<r.length;i++)r[i]&&(r[i][e]=!0)},fresh:function(t){t=t||"";var e=jo+t;this.put(e,!1)},freshAll:function(t){t=t||"";for(var e=jo+t,r=this._caches,i=0;i<r.length;i++)r[i]&&(r[i][e]=!1)},isDirty:function(t){t=t||"";var e=jo+t,r=this._context;return!r.hasOwnProperty(e)||r[e]===!0},deleteContext:function(t){delete this._caches[t],this._context={}},delete:function(t){delete this._context[t]},clearAll:function(){this._caches={}},getContext:function(){return this._context},eachContext:function(t,e){var r=Object.keys(this._caches);r.forEach(function(i){t&&t.call(e,i)})},miss:function(t){return!this._context.hasOwnProperty(t)}};Cf.prototype.constructor=Cf;const Tg=Cf;var Et=or.extend({width:512,height:512,type:B.UNSIGNED_BYTE,format:B.RGBA,wrapS:B.REPEAT,wrapT:B.REPEAT,minFilter:B.LINEAR_MIPMAP_LINEAR,magFilter:B.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,sRGB:!0,unpackAlignment:4,premultiplyAlpha:!1,dynamic:!1,NPOT:!1,__used:0},function(){this._cache=new Tg},{getWebGLTexture:function(t){var e=t.gl,r=this._cache;return r.use(t.__uid__),r.miss("webgl_texture")&&r.put("webgl_texture",e.createTexture()),this.dynamic?this.update(t):r.isDirty()&&(this.update(t),r.fresh()),r.get("webgl_texture")},bind:function(){},unbind:function(){},dirty:function(){this._cache&&this._cache.dirtyAll()},update:function(t){},updateCommon:function(t){var e=t.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,this.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,this.unpackAlignment),this.format===B.DEPTH_COMPONENT&&(this.useMipmap=!1);var r=t.getGLExtension("EXT_sRGB");this.format===Et.SRGB&&!r&&(this.format=Et.RGB),this.format===Et.SRGB_ALPHA&&!r&&(this.format=Et.RGBA),this.NPOT=!this.isPowerOfTwo()},getAvailableWrapS:function(){return this.NPOT?B.CLAMP_TO_EDGE:this.wrapS},getAvailableWrapT:function(){return this.NPOT?B.CLAMP_TO_EDGE:this.wrapT},getAvailableMinFilter:function(){var t=this.minFilter;return this.NPOT||!this.useMipmap?t===B.NEAREST_MIPMAP_NEAREST||t===B.NEAREST_MIPMAP_LINEAR?B.NEAREST:t===B.LINEAR_MIPMAP_LINEAR||t===B.LINEAR_MIPMAP_NEAREST?B.LINEAR:t:t},getAvailableMagFilter:function(){return this.magFilter},nextHighestPowerOfTwo:function(t){--t;for(var e=1;e<32;e<<=1)t=t|t>>e;return t+1},dispose:function(t){var e=this._cache;e.use(t.__uid__);var r=e.get("webgl_texture");r&&t.gl.deleteTexture(r),e.deleteContext(t.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(Et.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t}});Object.defineProperty(Et.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t}});Et.BYTE=B.BYTE;Et.UNSIGNED_BYTE=B.UNSIGNED_BYTE;Et.SHORT=B.SHORT;Et.UNSIGNED_SHORT=B.UNSIGNED_SHORT;Et.INT=B.INT;Et.UNSIGNED_INT=B.UNSIGNED_INT;Et.FLOAT=B.FLOAT;Et.HALF_FLOAT=36193;Et.UNSIGNED_INT_24_8_WEBGL=34042;Et.DEPTH_COMPONENT=B.DEPTH_COMPONENT;Et.DEPTH_STENCIL=B.DEPTH_STENCIL;Et.ALPHA=B.ALPHA;Et.RGB=B.RGB;Et.RGBA=B.RGBA;Et.LUMINANCE=B.LUMINANCE;Et.LUMINANCE_ALPHA=B.LUMINANCE_ALPHA;Et.SRGB=35904;Et.SRGB_ALPHA=35906;Et.COMPRESSED_RGB_S3TC_DXT1_EXT=33776;Et.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777;Et.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778;Et.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779;Et.NEAREST=B.NEAREST;Et.LINEAR=B.LINEAR;Et.NEAREST_MIPMAP_NEAREST=B.NEAREST_MIPMAP_NEAREST;Et.LINEAR_MIPMAP_NEAREST=B.LINEAR_MIPMAP_NEAREST;Et.NEAREST_MIPMAP_LINEAR=B.NEAREST_MIPMAP_LINEAR;Et.LINEAR_MIPMAP_LINEAR=B.LINEAR_MIPMAP_LINEAR;Et.REPEAT=B.REPEAT;Et.CLAMP_TO_EDGE=B.CLAMP_TO_EDGE;Et.MIRRORED_REPEAT=B.MIRRORED_REPEAT;const ut=Et;var pr=kd.extend({skeleton:null,joints:null},function(){this.joints||(this.joints=[])},{offsetMatrix:null,isInstancedMesh:function(){return!1},isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&this.joints.length>0)},clone:function(){var t=kd.prototype.clone.call(this);return t.skeleton=this.skeleton,this.joints&&(t.joints=this.joints.slice()),t}});pr.POINTS=B.POINTS;pr.LINES=B.LINES;pr.LINE_LOOP=B.LINE_LOOP;pr.LINE_STRIP=B.LINE_STRIP;pr.TRIANGLES=B.TRIANGLES;pr.TRIANGLE_STRIP=B.TRIANGLE_STRIP;pr.TRIANGLE_FAN=B.TRIANGLE_FAN;pr.BACK=B.BACK;pr.FRONT=B.FRONT;pr.FRONT_AND_BACK=B.FRONT_AND_BACK;pr.CW=B.CW;pr.CCW=B.CCW;const Sg=pr;var _h={};_h.isPowerOfTwo=function(t){return(t&t-1)===0};_h.nextPowerOfTwo=function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t++,t};_h.nearestPowerOfTwo=function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))};const R2=_h;var Ly=R2.isPowerOfTwo;function Ry(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}function TB(t,e){var r=Ry(t.width),i=Ry(t.height);e=e||document.createElement("canvas"),e.width=r,e.height=i;var n=e.getContext("2d");return n.drawImage(t.image,0,0,r,i),e}var wg=ut.extend(function(){return{image:null,pixels:null,mipmaps:[],convertToPOT:!1}},{textureType:"texture2D",update:function(t){var e=t.gl;e.bindTexture(e.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(t);var r=this.format,i=this.type,n=!!(this.convertToPOT&&!this.mipmaps.length&&this.image&&(this.wrapS===ut.REPEAT||this.wrapT===ut.REPEAT)&&this.NPOT);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,n?this.wrapS:this.getAvailableWrapS()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,n?this.wrapT:this.getAvailableWrapT()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n?this.magFilter:this.getAvailableMagFilter()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n?this.minFilter:this.getAvailableMinFilter());var a=t.getGLExtension("EXT_texture_filter_anisotropic");if(a&&this.anisotropic>1&&e.texParameterf(e.TEXTURE_2D,a.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),i===36193){var o=t.getGLExtension("OES_texture_half_float");o||(i=B.FLOAT)}if(this.mipmaps.length)for(var s=this.width,l=this.height,u=0;u<this.mipmaps.length;u++){var f=this.mipmaps[u];this._updateTextureData(e,f,u,s,l,r,i,!1),s/=2,l/=2}else this._updateTextureData(e,this,0,this.width,this.height,r,i,n),this.useMipmap&&(!this.NPOT||n)&&e.generateMipmap(e.TEXTURE_2D);e.bindTexture(e.TEXTURE_2D,null)},_updateTextureData:function(t,e,r,i,n,a,o,s){if(e.image){var l=e.image;s&&(this._potCanvas=TB(this,this._potCanvas),l=this._potCanvas),t.texImage2D(t.TEXTURE_2D,r,a,a,o,l)}else a<=ut.COMPRESSED_RGBA_S3TC_DXT5_EXT&&a>=ut.COMPRESSED_RGB_S3TC_DXT1_EXT?t.compressedTexImage2D(t.TEXTURE_2D,r,a,i,n,0,e.pixels):t.texImage2D(t.TEXTURE_2D,r,a,i,n,0,a,o,e.pixels)},generateMipmap:function(t){var e=t.gl;this.useMipmap&&!this.NPOT&&(e.bindTexture(e.TEXTURE_2D,this._cache.get("webgl_texture")),e.generateMipmap(e.TEXTURE_2D))},isPowerOfTwo:function(){return Ly(this.width)&&Ly(this.height)},isRenderable:function(){return this.image?this.image.width>0&&this.image.height>0:!!(this.width&&this.height)},bind:function(t){t.gl.bindTexture(t.gl.TEXTURE_2D,this.getWebGLTexture(t))},unbind:function(t){t.gl.bindTexture(t.gl.TEXTURE_2D,null)},load:function(t,e){var r=pe.createImage();e&&(r.crossOrigin=e);var i=this;return r.onload=function(){i.dirty(),i.trigger("success",i)},r.onerror=function(){i.trigger("error",i)},r.src=t,this.image=r,this}});Object.defineProperty(wg.prototype,"width",{get:function(){return this.image?this.image.width:this._width},set:function(t){this.image?console.warn("Texture from image can't set width"):(this._width!==t&&this.dirty(),this._width=t)}});Object.defineProperty(wg.prototype,"height",{get:function(){return this.image?this.image.height:this._height},set:function(t){this.image?console.warn("Texture from image can't set height"):(this._height!==t&&this.dirty(),this._height=t)}});const Pt=wg;function P2(t){return{byte:pe.Int8Array,ubyte:pe.Uint8Array,short:pe.Int16Array,ushort:pe.Uint16Array}[t]||pe.Float32Array}function av(t){return"attr_"+t}function mo(t,e,r,i){switch(this.name=t,this.type=e,this.size=r,this.semantic=i||"",this.value=null,r){case 1:this.get=function(n){return this.value[n]},this.set=function(n,a){this.value[n]=a},this.copy=function(n,a){this.value[n]=this.value[n]};break;case 2:this.get=function(n,a){var o=this.value;return a[0]=o[n*2],a[1]=o[n*2+1],a},this.set=function(n,a){var o=this.value;o[n*2]=a[0],o[n*2+1]=a[1]},this.copy=function(n,a){var o=this.value;a*=2,n*=2,o[n]=o[a],o[n+1]=o[a+1]};break;case 3:this.get=function(n,a){var o=n*3,s=this.value;return a[0]=s[o],a[1]=s[o+1],a[2]=s[o+2],a},this.set=function(n,a){var o=n*3,s=this.value;s[o]=a[0],s[o+1]=a[1],s[o+2]=a[2]},this.copy=function(n,a){var o=this.value;a*=3,n*=3,o[n]=o[a],o[n+1]=o[a+1],o[n+2]=o[a+2]};break;case 4:this.get=function(n,a){var o=this.value,s=n*4;return a[0]=o[s],a[1]=o[s+1],a[2]=o[s+2],a[3]=o[s+3],a},this.set=function(n,a){var o=this.value,s=n*4;o[s]=a[0],o[s+1]=a[1],o[s+2]=a[2],o[s+3]=a[3]},this.copy=function(n,a){var o=this.value;a*=4,n*=4,o[n]=o[a],o[n+1]=o[a+1],o[n+2]=o[a+2],o[n+3]=o[a+3]}}}mo.prototype.init=function(t){if(!this.value||this.value.length!==t*this.size){var e=P2(this.type);this.value=new e(t*this.size)}};mo.prototype.fromArray=function(t){var e=P2(this.type),r;if(t[0]&&t[0].length){var i=0,n=this.size;r=new e(t.length*n);for(var a=0;a<t.length;a++)for(var o=0;o<n;o++)r[i++]=t[a][o]}else r=new e(t);this.value=r};mo.prototype.clone=function(t){var e=new mo(this.name,this.type,this.size,this.semantic);return t&&console.warn("todo"),e};function I2(t,e,r,i,n){this.name=t,this.type=e,this.buffer=r,this.size=i,this.semantic=n,this.symbol="",this.needsRemove=!1}function N2(t){this.buffer=t,this.count=0}var Di=or.extend(function(){return{attributes:{},indices:null,dynamic:!0,_enabledAttributes:null,__used:0}},function(){this._cache=new Tg,this._attributeList=Object.keys(this.attributes),this.__vaoCache={}},{mainAttribute:"",pick:null,pickByRay:null,dirty:function(){for(var t=this.getEnabledAttributes(),e=0;e<t.length;e++)this.dirtyAttribute(t[e]);this.dirtyIndices(),this._enabledAttributes=null,this._cache.dirty("any")},dirtyIndices:function(){this._cache.dirtyAll("indices")},dirtyAttribute:function(t){this._cache.dirtyAll(av(t)),this._cache.dirtyAll("attributes")},getTriangleIndices:function(t,e){if(t<this.triangleCount&&t>=0){e||(e=[]);var r=this.indices;return e[0]=r[t*3],e[1]=r[t*3+1],e[2]=r[t*3+2],e}},setTriangleIndices:function(t,e){var r=this.indices;r[t*3]=e[0],r[t*3+1]=e[1],r[t*3+2]=e[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(t){var e,r=this.vertexCount>65535?pe.Uint32Array:pe.Uint16Array;if(t[0]&&t[0].length){var i=0,n=3;e=new r(t.length*n);for(var a=0;a<t.length;a++)for(var o=0;o<n;o++)e[i++]=t[a][o]}else e=new r(t);this.indices=e},createAttribute:function(t,e,r,i){var n=new mo(t,e,r,i);return this.attributes[t]&&this.removeAttribute(t),this.attributes[t]=n,this._attributeList.push(t),n},removeAttribute:function(t){var e=this._attributeList,r=e.indexOf(t);return r>=0?(e.splice(r,1),delete this.attributes[t],!0):!1},getAttribute:function(t){return this.attributes[t]},getEnabledAttributes:function(){var t=this._enabledAttributes,e=this._attributeList;if(t)return t;for(var r=[],i=this.vertexCount,n=0;n<e.length;n++){var a=e[n],o=this.attributes[a];o.value&&o.value.length===i*o.size&&r.push(a)}return this._enabledAttributes=r,r},getBufferChunks:function(t){var e=this._cache;e.use(t.__uid__);var r=e.isDirty("attributes"),i=e.isDirty("indices");if(r||i){this._updateBuffer(t.gl,r,i);for(var n=this.getEnabledAttributes(),a=0;a<n.length;a++)e.fresh(av(n[a]));e.fresh("attributes"),e.fresh("indices")}return e.fresh("any"),e.get("chunks")},_updateBuffer:function(t,e,r){var i=this._cache,n=i.get("chunks"),a=!1;n||(n=[],n[0]={attributeBuffers:[],indicesBuffer:null},i.put("chunks",n),a=!0);var o=n[0],s=o.attributeBuffers,l=o.indicesBuffer;if(e||a){var u=this.getEnabledAttributes(),f={};if(!a)for(var h=0;h<s.length;h++)f[s[h].name]=s[h];for(var v=0;v<u.length;v++){var c=u[v],d=this.attributes[c],p;a||(p=f[c]);var g;p?g=p.buffer:g=t.createBuffer(),i.isDirty(av(c))&&(t.bindBuffer(t.ARRAY_BUFFER,g),t.bufferData(t.ARRAY_BUFFER,d.value,this.dynamic?t.DYNAMIC_DRAW:t.STATIC_DRAW)),s[v]=new I2(c,d.type,g,d.size,d.semantic)}for(var h=v;h<s.length;h++)t.deleteBuffer(s[h].buffer);s.length=v}this.isUseIndices()&&(r||a)&&(l||(l=new N2(t.createBuffer()),o.indicesBuffer=l),l.count=this.indices.length,t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,l.buffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,this.dynamic?t.DYNAMIC_DRAW:t.STATIC_DRAW))},dispose:function(t){var e=this._cache;e.use(t.__uid__);var r=e.get("chunks");if(r)for(var i=0;i<r.length;i++){for(var n=r[i],a=0;a<n.attributeBuffers.length;a++){var o=n.attributeBuffers[a];t.gl.deleteBuffer(o.buffer)}n.indicesBuffer&&t.gl.deleteBuffer(n.indicesBuffer.buffer)}if(this.__vaoCache){var s=t.getGLExtension("OES_vertex_array_object");for(var l in this.__vaoCache){var u=this.__vaoCache[l].vao;u&&s.deleteVertexArrayOES(u)}}this.__vaoCache={},e.deleteContext(t.__uid__)}});Object.defineProperty&&(Object.defineProperty(Di.prototype,"vertexCount",{enumerable:!1,get:function(){var t=this.attributes[this.mainAttribute];return t||(t=this.attributes[this._attributeList[0]]),!t||!t.value?0:t.value.length/t.size}}),Object.defineProperty(Di.prototype,"triangleCount",{enumerable:!1,get:function(){var t=this.indices;return t?t.length/3:0}}));Di.STATIC_DRAW=B.STATIC_DRAW;Di.DYNAMIC_DRAW=B.DYNAMIC_DRAW;Di.STREAM_DRAW=B.STREAM_DRAW;Di.AttributeBuffer=I2;Di.IndicesBuffer=N2;Di.Attribute=mo;const ga=Di;var ke=P.create,Ba=P.add,In=P.set,ii=ga.Attribute,ma=ga.extend(function(){return{attributes:{position:new ii("position","float",3,"POSITION"),texcoord0:new ii("texcoord0","float",2,"TEXCOORD_0"),texcoord1:new ii("texcoord1","float",2,"TEXCOORD_1"),normal:new ii("normal","float",3,"NORMAL"),tangent:new ii("tangent","float",4,"TANGENT"),color:new ii("color","float",4,"COLOR"),weight:new ii("weight","float",3,"WEIGHT"),joint:new ii("joint","float",4,"JOINT"),barycentric:new ii("barycentric","float",3,null)},boundingBox:null}},{mainAttribute:"position",updateBoundingBox:function(){var t=this.boundingBox;t||(t=this.boundingBox=new Ve);var e=this.attributes.position.value;if(e&&e.length){var r=t.min,i=t.max,n=r.array,a=i.array;P.set(n,e[0],e[1],e[2]),P.set(a,e[0],e[1],e[2]);for(var o=3;o<e.length;){var s=e[o++],l=e[o++],u=e[o++];s<n[0]&&(n[0]=s),l<n[1]&&(n[1]=l),u<n[2]&&(n[2]=u),s>a[0]&&(a[0]=s),l>a[1]&&(a[1]=l),u>a[2]&&(a[2]=u)}r._dirty=!0,i._dirty=!0}},generateVertexNormals:function(){if(this.vertexCount){var t=this.indices,e=this.attributes,r=e.position.value,i=e.normal.value;if(!i||i.length!==r.length)i=e.normal.value=new pe.Float32Array(r.length);else for(var n=0;n<i.length;n++)i[n]=0;for(var a=ke(),o=ke(),s=ke(),l=ke(),u=ke(),f=ke(),h=t?t.length:this.vertexCount,v,c,d,p=0;p<h;){t?(v=t[p++],c=t[p++],d=t[p++]):(v=p++,c=p++,d=p++),In(a,r[v*3],r[v*3+1],r[v*3+2]),In(o,r[c*3],r[c*3+1],r[c*3+2]),In(s,r[d*3],r[d*3+1],r[d*3+2]),P.sub(l,a,o),P.sub(u,o,s),P.cross(f,l,u);for(var n=0;n<3;n++)i[v*3+n]=i[v*3+n]+f[n],i[c*3+n]=i[c*3+n]+f[n],i[d*3+n]=i[d*3+n]+f[n]}for(var n=0;n<i.length;)In(f,i[n],i[n+1],i[n+2]),P.normalize(f,f),i[n++]=f[0],i[n++]=f[1],i[n++]=f[2];this.dirty()}},generateFaceNormals:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var t=this.indices,e=this.attributes,r=e.position.value,i=e.normal.value,n=ke(),a=ke(),o=ke(),s=ke(),l=ke(),u=ke();i||(i=e.normal.value=new Float32Array(r.length));for(var f=t?t.length:this.vertexCount,h,v,c,d=0;d<f;){t?(h=t[d++],v=t[d++],c=t[d++]):(h=d++,v=d++,c=d++),In(n,r[h*3],r[h*3+1],r[h*3+2]),In(a,r[v*3],r[v*3+1],r[v*3+2]),In(o,r[c*3],r[c*3+1],r[c*3+2]),P.sub(s,n,a),P.sub(l,a,o),P.cross(u,s,l),P.normalize(u,u);for(var p=0;p<3;p++)i[h*3+p]=u[p],i[v*3+p]=u[p],i[c*3+p]=u[p]}this.dirty()}},generateTangents:function(){if(this.vertexCount){var t=this.vertexCount,e=this.attributes;e.tangent.value||(e.tangent.value=new Float32Array(t*4));var r=e.texcoord0.value,i=e.position.value,n=e.tangent.value,a=e.normal.value;if(!r){console.warn("Geometry without texcoords can't generate tangents.");return}for(var o=[],s=[],l=0;l<t;l++)o[l]=[0,0,0],s[l]=[0,0,0];for(var u=[0,0,0],f=[0,0,0],h=this.indices,v=h?h.length:this.vertexCount,c,d,p,l=0;l<v;){h?(c=h[l++],d=h[l++],p=h[l++]):(c=l++,d=l++,p=l++);var g=r[c*2],m=r[d*2],_=r[p*2],y=r[c*2+1],x=r[d*2+1],S=r[p*2+1],T=i[c*3],b=i[d*3],w=i[p*3],A=i[c*3+1],C=i[d*3+1],E=i[p*3+1],D=i[c*3+2],L=i[d*3+2],R=i[p*3+2],N=b-T,I=w-T,F=C-A,O=E-A,z=L-D,k=R-D,it=m-g,$=_-g,nt=x-y,rt=S-y,It=1/(it*rt-nt*$);u[0]=(rt*N-nt*I)*It,u[1]=(rt*F-nt*O)*It,u[2]=(rt*z-nt*k)*It,f[0]=(it*I-$*N)*It,f[1]=(it*O-$*F)*It,f[2]=(it*k-$*z)*It,Ba(o[c],o[c],u),Ba(o[d],o[d],u),Ba(o[p],o[p],u),Ba(s[c],s[c],f),Ba(s[d],s[d],f),Ba(s[p],s[p],f)}for(var gt=ke(),Ft=ke(),Xt=ke(),l=0;l<t;l++){Xt[0]=a[l*3],Xt[1]=a[l*3+1],Xt[2]=a[l*3+2];var Ot=o[l];P.scale(gt,Xt,P.dot(Xt,Ot)),P.sub(gt,Ot,gt),P.normalize(gt,gt),P.cross(Ft,Xt,Ot),n[l*4]=gt[0],n[l*4+1]=gt[1],n[l*4+2]=gt[2],n[l*4+3]=P.dot(Ft,s[l])<0?-1:1}this.dirty()}},isUniqueVertex:function(){return this.isUseIndices()?this.vertexCount===this.indices.length:!0},generateUniqueVertex:function(){if(!(!this.vertexCount||!this.indices)){this.indices.length>65535&&(this.indices=new pe.Uint32Array(this.indices));for(var t=this.attributes,e=this.indices,r=this.getEnabledAttributes(),i={},n=0;n<r.length;n++){var a=r[n];i[a]=t[a].value,t[a].init(this.indices.length)}for(var o=0,s=0;s<e.length;s++){for(var l=e[s],n=0;n<r.length;n++)for(var a=r[n],u=t[a].value,f=t[a].size,h=0;h<f;h++)u[o*f+h]=i[a][l*f+h];e[s]=o,o++}this.dirty()}},generateBarycentric:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var t=this.attributes,e=t.barycentric.value,r=this.indices;if(!(e&&e.length===r.length*3)){e=t.barycentric.value=new Float32Array(r.length*3);for(var i=0;i<(r?r.length:this.vertexCount/3);)for(var n=0;n<3;n++){var a=r?r[i++]:i*3+n;e[a*3+n]=1}this.dirty()}}},applyTransform:function(t){var e=this.attributes,r=e.position.value,i=e.normal.value,n=e.tangent.value;t=t.array;var a=H.create();H.invert(a,t),H.transpose(a,a);var o=P.transformMat4,s=P.forEach;s(r,3,0,null,o,t),i&&s(i,3,0,null,o,a),n&&s(n,4,0,null,o,a),this.boundingBox&&this.updateBoundingBox()},dispose:function(t){var e=this._cache;e.use(t.__uid__);var r=e.get("chunks");if(r)for(var i=0;i<r.length;i++){for(var n=r[i],a=0;a<n.attributeBuffers.length;a++){var o=n.attributeBuffers[a];t.gl.deleteBuffer(o.buffer)}n.indicesBuffer&&t.gl.deleteBuffer(n.indicesBuffer.buffer)}if(this.__vaoCache){var s=t.getGLExtension("OES_vertex_array_object");for(var l in this.__vaoCache){var u=this.__vaoCache[l].vao;u&&s.deleteVertexArrayOES(u)}}this.__vaoCache={},e.deleteContext(t.__uid__)}});ma.STATIC_DRAW=ga.STATIC_DRAW;ma.DYNAMIC_DRAW=ga.DYNAMIC_DRAW;ma.STREAM_DRAW=ga.STREAM_DRAW;ma.AttributeBuffer=ga.AttributeBuffer;ma.IndicesBuffer=ga.IndicesBuffer;ma.Attribute=ii;const le=ma,SB=`vec3 calcAmbientSHLight(int idx, vec3 N) {
 int offset = 9 * idx;
 return ambientSHLightCoefficients[0]
 + ambientSHLightCoefficients[1] * N.x
 + ambientSHLightCoefficients[2] * N.y
 + ambientSHLightCoefficients[3] * N.z
 + ambientSHLightCoefficients[4] * N.x * N.z
 + ambientSHLightCoefficients[5] * N.z * N.y
 + ambientSHLightCoefficients[6] * N.y * N.x
 + ambientSHLightCoefficients[7] * (3.0 * N.z * N.z - 1.0)
 + ambientSHLightCoefficients[8] * (N.x * N.x - N.y * N.y);
}`;var zr="uniform vec3 ",Qo="uniform float ",Fa="@export clay.header.",ka="@end",be=":unconfigurable;";const wB=[Fa+"directional_light",zr+"directionalLightDirection[DIRECTIONAL_LIGHT_COUNT]"+be,zr+"directionalLightColor[DIRECTIONAL_LIGHT_COUNT]"+be,ka,Fa+"ambient_light",zr+"ambientLightColor[AMBIENT_LIGHT_COUNT]"+be,ka,Fa+"ambient_sh_light",zr+"ambientSHLightColor[AMBIENT_SH_LIGHT_COUNT]"+be,zr+"ambientSHLightCoefficients[AMBIENT_SH_LIGHT_COUNT * 9]"+be,SB,ka,Fa+"ambient_cubemap_light",zr+"ambientCubemapLightColor[AMBIENT_CUBEMAP_LIGHT_COUNT]"+be,"uniform samplerCube ambientCubemapLightCubemap[AMBIENT_CUBEMAP_LIGHT_COUNT]"+be,"uniform sampler2D ambientCubemapLightBRDFLookup[AMBIENT_CUBEMAP_LIGHT_COUNT]"+be,ka,Fa+"point_light",zr+"pointLightPosition[POINT_LIGHT_COUNT]"+be,Qo+"pointLightRange[POINT_LIGHT_COUNT]"+be,zr+"pointLightColor[POINT_LIGHT_COUNT]"+be,ka,Fa+"spot_light",zr+"spotLightPosition[SPOT_LIGHT_COUNT]"+be,zr+"spotLightDirection[SPOT_LIGHT_COUNT]"+be,Qo+"spotLightRange[SPOT_LIGHT_COUNT]"+be,Qo+"spotLightUmbraAngleCosine[SPOT_LIGHT_COUNT]"+be,Qo+"spotLightPenumbraAngleCosine[SPOT_LIGHT_COUNT]"+be,Qo+"spotLightFalloffFactor[SPOT_LIGHT_COUNT]"+be,zr+"spotLightColor[SPOT_LIGHT_COUNT]"+be,ka].join(`
`);V.import(wB);var bB=hi.extend(function(){return{color:[1,1,1],intensity:1,castShadow:!0,shadowResolution:512,group:0}},{type:"",clone:function(){var t=hi.prototype.clone.call(this);return t.color=Array.prototype.slice.call(this.color),t.intensity=this.intensity,t.castShadow=this.castShadow,t.shadowResolution=this.shadowResolution,t}});const Zr=bB;var Ou=function(t,e){this.normal=t||new W(0,1,0),this.distance=e||0};Ou.prototype={constructor:Ou,distanceToPoint:function(t){return P.dot(t.array,this.normal.array)-this.distance},projectPoint:function(t,e){e||(e=new W);var r=this.distanceToPoint(t);return P.scaleAndAdd(e.array,t.array,this.normal.array,-r),e._dirty=!0,e},normalize:function(){var t=1/P.len(this.normal.array);P.scale(this.normal.array,t),this.distance*=t},intersectFrustum:function(t){for(var e=t.vertices,r=this.normal.array,i=P.dot(e[0].array,r)>this.distance,n=1;n<8;n++)if(P.dot(e[n].array,r)>this.distance!=i)return!0},intersectLine:function(){var t=P.create();return function(e,r,i){var n=this.distanceToPoint(e),a=this.distanceToPoint(r);if(n>0&&a>0||n<0&&a<0)return null;var o=this.normal.array,s=this.distance,l=e.array;P.sub(t,r.array,e.array),P.normalize(t,t);var u=P.dot(o,t);if(u===0)return null;i||(i=new W);var f=(P.dot(o,l)-s)/u;return P.scaleAndAdd(i.array,l,t,-f),i._dirty=!0,i}}(),applyTransform:function(){var t=H.create(),e=Y.create(),r=Y.create();return r[3]=1,function(i){i=i.array,P.scale(r,this.normal.array,this.distance),Y.transformMat4(r,r,i),this.distance=P.dot(r,this.normal.array),H.invert(t,i),H.transpose(t,t),e[3]=0,P.copy(e,this.normal.array),Y.transformMat4(e,e,t),P.copy(this.normal.array,e)}}(),copy:function(t){P.copy(this.normal.array,t.normal.array),this.normal._dirty=!0,this.distance=t.distance},clone:function(){var t=new Ou;return t.copy(this),t}};const O2=Ou;var se=P.set,Py=P.copy,Iy=P.transformMat4,ov=Math.min,sv=Math.max,B2=function(){this.planes=[];for(var t=0;t<6;t++)this.planes.push(new O2);this.boundingBox=new Ve,this.vertices=[];for(var t=0;t<8;t++)this.vertices[t]=P.fromValues(0,0,0)};B2.prototype={setFromProjection:function(t){var e=this.planes,r=t.array,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],l=r[5],u=r[6],f=r[7],h=r[8],v=r[9],c=r[10],d=r[11],p=r[12],g=r[13],m=r[14],_=r[15];se(e[0].normal.array,o-i,f-s,d-h),e[0].distance=-(_-p),e[0].normalize(),se(e[1].normal.array,o+i,f+s,d+h),e[1].distance=-(_+p),e[1].normalize(),se(e[2].normal.array,o+n,f+l,d+v),e[2].distance=-(_+g),e[2].normalize(),se(e[3].normal.array,o-n,f-l,d-v),e[3].distance=-(_-g),e[3].normalize(),se(e[4].normal.array,o-a,f-u,d-c),e[4].distance=-(_-m),e[4].normalize(),se(e[5].normal.array,o+a,f+u,d+c),e[5].distance=-(_+m),e[5].normalize();var y=this.boundingBox,x=this.vertices;if(_===0){var S=l/i,T=-m/(c-1),b=-m/(c+1),w=-b/l,A=-T/l;y.min.set(-w*S,-w,b),y.max.set(w*S,w,T),se(x[0],-w*S,-w,b),se(x[1],-w*S,w,b),se(x[2],w*S,-w,b),se(x[3],w*S,w,b),se(x[4],-A*S,-A,T),se(x[5],-A*S,A,T),se(x[6],A*S,-A,T),se(x[7],A*S,A,T)}else{var C=(-1-p)/i,E=(1-p)/i,D=(1-g)/l,L=(-1-g)/l,R=(-1-m)/c,N=(1-m)/c;y.min.set(Math.min(C,E),Math.min(L,D),Math.min(N,R)),y.max.set(Math.max(E,C),Math.max(D,L),Math.max(R,N));var I=y.min.array,F=y.max.array;se(x[0],I[0],I[1],I[2]),se(x[1],I[0],F[1],I[2]),se(x[2],F[0],I[1],I[2]),se(x[3],F[0],F[1],I[2]),se(x[4],I[0],I[1],F[2]),se(x[5],I[0],F[1],F[2]),se(x[6],F[0],I[1],F[2]),se(x[7],F[0],F[1],F[2])}},getTransformedBoundingBox:function(){var t=P.create();return function(e,r){var i=this.vertices,n=r.array,a=e.min,o=e.max,s=a.array,l=o.array,u=i[0];Iy(t,u,n),Py(s,t),Py(l,t);for(var f=1;f<8;f++)u=i[f],Iy(t,u,n),s[0]=ov(t[0],s[0]),s[1]=ov(t[1],s[1]),s[2]=ov(t[2],s[2]),l[0]=sv(t[0],l[0]),l[1]=sv(t[1],l[1]),l[2]=sv(t[2],l[2]);return a._dirty=!0,o._dirty=!0,e}}()};const bg=B2;var AB=hi.extend(function(){return{projectionMatrix:new J,invProjectionMatrix:new J,viewMatrix:new J,frustum:new bg}},function(){this.update(!0)},{update:function(t){hi.prototype.update.call(this,t),J.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),J.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(t){J.copy(this.viewMatrix,t),J.invert(this.worldTransform,t),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(t){J.copy(this.projectionMatrix,t),J.invert(this.invProjectionMatrix,t),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:function(){var t=Y.create();return function(e,r){var i=r!==void 0?r:new Ef,n=e.array[0],a=e.array[1];return Y.set(t,n,a,-1,1),Y.transformMat4(t,t,this.invProjectionMatrix.array),Y.transformMat4(t,t,this.worldTransform.array),P.scale(i.origin.array,t,1/t[3]),Y.set(t,n,a,1,1),Y.transformMat4(t,t,this.invProjectionMatrix.array),Y.transformMat4(t,t,this.worldTransform.array),P.scale(t,t,1/t[3]),P.sub(i.direction.array,t,i.origin.array),P.normalize(i.direction.array,i.direction.array),i.direction._dirty=!0,i.origin._dirty=!0,i}}()});const _o=AB;var EB=H.create(),Ny=H.create(),lv={};function CB(t){var e=[],r=Object.keys(t);r.sort();for(var i=0;i<r.length;i++){var n=r[i];e.push(n+" "+t[n])}var a=e.join(`
`);if(lv[a])return lv[a];var o=Ee.genGUID();return lv[a]=o,o}function yh(){this.opaque=[],this.transparent=[],this._opaqueCount=0,this._transparentCount=0}yh.prototype.startCount=function(){this._opaqueCount=0,this._transparentCount=0};yh.prototype.add=function(t,e){e?this.transparent[this._transparentCount++]=t:this.opaque[this._opaqueCount++]=t};yh.prototype.endCount=function(){this.transparent.length=this._transparentCount,this.opaque.length=this._opaqueCount};var MB=hi.extend(function(){return{material:null,lights:[],viewBoundingBoxLastFrame:new Ve,shadowUniforms:{},_cameraList:[],_lightUniforms:{},_previousLightNumber:{},_lightNumber:{},_lightProgramKeys:{},_nodeRepository:{},_renderLists:new w2(20)}},function(){this._scene=this},{addToScene:function(t){t instanceof _o?(this._cameraList.length>0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(t)):t instanceof Zr&&this.lights.push(t),t.name&&(this._nodeRepository[t.name]=t)},removeFromScene:function(t){var e;t instanceof _o?(e=this._cameraList.indexOf(t),e>=0&&this._cameraList.splice(e,1)):t instanceof Zr&&(e=this.lights.indexOf(t),e>=0&&this.lights.splice(e,1)),t.name&&delete this._nodeRepository[t.name]},getNode:function(t){return this._nodeRepository[t]},setMainCamera:function(t){var e=this._cameraList.indexOf(t);e>=0&&this._cameraList.splice(e,1),this._cameraList.unshift(t)},getMainCamera:function(){return this._cameraList[0]},getLights:function(){return this.lights},updateLights:function(){var t=this.lights;this._previousLightNumber=this._lightNumber;for(var e={},r=0;r<t.length;r++){var i=t[r];if(!i.invisible){var n=i.group;e[n]||(e[n]={}),e[n][i.type]=e[n][i.type]||0,e[n][i.type]++}}this._lightNumber=e;for(var a in e)this._lightProgramKeys[a]=CB(e[a]);this._updateLightUniforms()},cloneNode:function(t){var e=t.clone(),r={};function i(n,a){r[n.__uid__]=a;for(var o=0;o<n._children.length;o++){var s=n._children[o],l=a._children[o];i(s,l)}}return i(t,e),e.traverse(function(n){n.skeleton&&(n.skeleton=n.skeleton.clone(r)),n.material&&(n.material=n.material.clone())}),e},updateRenderList:function(t,e){var r=t.__uid__,i=this._renderLists.get(r);i||(i=new yh,this._renderLists.put(r,i)),i.startCount(),e&&(this.viewBoundingBoxLastFrame.min.set(1/0,1/0,1/0),this.viewBoundingBoxLastFrame.max.set(-1/0,-1/0,-1/0));var n=this.material&&this.material.transparent||!1;return this._doUpdateRenderList(this,t,n,i,e),i.endCount(),i},getRenderList:function(t){return this._renderLists.get(t.__uid__)},_doUpdateRenderList:function(t,e,r,i,n){if(!t.invisible)for(var a=0;a<t._children.length;a++){var o=t._children[a];if(o.isRenderable()){var s=o.isSkinnedMesh()?EB:o.worldTransform.array,l=o.geometry;H.multiplyAffine(Ny,e.viewMatrix.array,s),(n&&!l.boundingBox||!this.isFrustumCulled(o,e,Ny))&&i.add(o,o.material.transparent||r)}o._children.length>0&&this._doUpdateRenderList(o,e,r,i,n)}},isFrustumCulled:function(){var t=new Ve,e=new J;return function(r,i,n){var a=r.boundingBox;if(a||(r.skeleton&&r.skeleton.boundingBox?a=r.skeleton.boundingBox:a=r.geometry.boundingBox),!a)return!1;if(e.array=n,t.transformFrom(a,e),r.castShadow&&this.viewBoundingBoxLastFrame.union(t),r.frustumCulling){if(!t.intersectBoundingBox(i.frustum.boundingBox))return!0;e.array=i.projectionMatrix.array,t.max.array[2]>0&&t.min.array[2]<0&&(t.max.array[2]=-1e-20),t.applyProjection(e);var o=t.min.array,s=t.max.array;if(s[0]<-1||o[0]>1||s[1]<-1||o[1]>1||s[2]<-1||o[2]>1)return!0}return!1}}(),_updateLightUniforms:function(){var t=this.lights;t.sort(DB);var e=this._lightUniforms;for(var r in e)for(var i in e[r])e[r][i].value.length=0;for(var n=0;n<t.length;n++){var a=t[n];if(!a.invisible){var r=a.group;for(var i in a.uniformTemplates){var o=a.uniformTemplates[i],s=o.value(a);if(s!=null){e[r]||(e[r]={}),e[r][i]||(e[r][i]={type:"",value:[]});var l=e[r][i];switch(l.type=o.type+"v",o.type){case"1i":case"1f":case"t":l.value.push(s);break;case"2f":case"3f":case"4f":for(var u=0;u<s.length;u++)l.value.push(s[u]);break;default:console.error("Unkown light uniform type "+o.type)}}}}}},getLightGroups:function(){var t=[];for(var e in this._lightNumber)t.push(e);return t},getNumberChangedLightGroups:function(){var t=[];for(var e in this._lightNumber)this.isLightNumberChanged(e)&&t.push(e);return t},isLightNumberChanged:function(t){var e=this._previousLightNumber,r=this._lightNumber;for(var i in r[t])if(!e[t]||r[t][i]!==e[t][i])return!0;for(var i in e[t])if(!r[t]||r[t][i]!==e[t][i])return!0;return!1},getLightsNumbers:function(t){return this._lightNumber[t]},getProgramKey:function(t){return this._lightProgramKeys[t]},setLightUniforms:function(){function t(e,r,i){for(var n in e){var a=e[n];if(a.type==="tv"){if(!r.hasUniform(n))continue;for(var o=[],s=0;s<a.value.length;s++){var l=a.value[s],u=r.takeCurrentTextureSlot(i,l);o.push(u)}r.setUniform(i.gl,"1iv",n,o)}else r.setUniform(i.gl,a.type,n,a.value)}}return function(e,r,i){t(this._lightUniforms[r],e,i),t(this.shadowUniforms,e,i)}}(),dispose:function(){this.material=null,this._opaqueList=[],this._transparentList=[],this.lights=[],this._lightUniforms={},this._lightNumber={},this._nodeRepository={}}});function DB(t,e){if(e.castShadow&&!t.castShadow)return!0}const ln=MB;var lu=R2.isPowerOfTwo,LB=["px","nx","py","ny","pz","nz"],Ag=ut.extend(function(){return{image:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},pixels:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},mipmaps:[]}},{textureType:"textureCube",update:function(t){var e=t.gl;e.bindTexture(e.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),this.updateCommon(t);var r=this.format,i=this.type;e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_WRAP_S,this.getAvailableWrapS()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_WRAP_T,this.getAvailableWrapT()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var n=t.getGLExtension("EXT_texture_filter_anisotropic");if(n&&this.anisotropic>1&&e.texParameterf(e.TEXTURE_CUBE_MAP,n.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),i===36193){var a=t.getGLExtension("OES_texture_half_float");a||(i=B.FLOAT)}if(this.mipmaps.length)for(var o=this.width,s=this.height,l=0;l<this.mipmaps.length;l++){var u=this.mipmaps[l];this._updateTextureData(e,u,l,o,s,r,i),o/=2,s/=2}else this._updateTextureData(e,this,0,this.width,this.height,r,i),!this.NPOT&&this.useMipmap&&e.generateMipmap(e.TEXTURE_CUBE_MAP);e.bindTexture(e.TEXTURE_CUBE_MAP,null)},_updateTextureData:function(t,e,r,i,n,a,o){for(var s=0;s<6;s++){var l=LB[s],u=e.image&&e.image[l];u?t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+s,r,a,a,o,u):t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+s,r,a,i,n,0,a,o,e.pixels&&e.pixels[l])}},generateMipmap:function(t){var e=t.gl;this.useMipmap&&!this.NPOT&&(e.bindTexture(e.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),e.generateMipmap(e.TEXTURE_CUBE_MAP))},bind:function(t){t.gl.bindTexture(t.gl.TEXTURE_CUBE_MAP,this.getWebGLTexture(t))},unbind:function(t){t.gl.bindTexture(t.gl.TEXTURE_CUBE_MAP,null)},isPowerOfTwo:function(){return this.image.px?lu(this.image.px.width)&&lu(this.image.px.height):lu(this.width)&&lu(this.height)},isRenderable:function(){return this.image.px?za(this.image.px)&&za(this.image.nx)&&za(this.image.py)&&za(this.image.ny)&&za(this.image.pz)&&za(this.image.nz):!!(this.width&&this.height)},load:function(t,e){var r=0,i=this;return Ee.each(t,function(n,a){var o=pe.createImage();e&&(o.crossOrigin=e),o.onload=function(){r--,r===0&&(i.dirty(),i.trigger("success",i))},o.onerror=function(){r--},r++,o.src=n,i.image[a]=o}),this}});Object.defineProperty(Ag.prototype,"width",{get:function(){return this.image&&this.image.px?this.image.px.width:this._width},set:function(t){this.image&&this.image.px?console.warn("Texture from image can't set width"):(this._width!==t&&this.dirty(),this._width=t)}});Object.defineProperty(Ag.prototype,"height",{get:function(){return this.image&&this.image.px?this.image.px.height:this._height},set:function(t){this.image&&this.image.px?console.warn("Texture from image can't set height"):(this._height!==t&&this.dirty(),this._height=t)}});function za(t){return t.width>0&&t.height>0}const Zs=Ag;var RB=_o.extend({fov:50,aspect:1,near:.1,far:2e3},{updateProjectionMatrix:function(){var t=this.fov/180*Math.PI;this.projectionMatrix.perspective(t,this.aspect,this.near,this.far)},decomposeProjectionMatrix:function(){var t=this.projectionMatrix.array,e=Math.atan(1/t[5])*2;this.fov=e/Math.PI*180,this.aspect=t[5]/t[0],this.near=t[14]/(t[10]-1),this.far=t[14]/(t[10]+1)},clone:function(){var t=_o.prototype.clone.call(this);return t.fov=this.fov,t.aspect=this.aspect,t.near=this.near,t.far=this.far,t}});const xe=RB;var uu="framebuffer",xi="renderbuffer",Oy=xi+"_width",By=xi+"_height",uv=xi+"_attached",fv="depthtexture_attached",Nn=B.FRAMEBUFFER,Jo=B.RENDERBUFFER,ds=B.DEPTH_ATTACHMENT,F2=B.COLOR_ATTACHMENT0,fl=or.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},function(){this._cache=new Tg,this._textures={}},{getTextureWidth:function(){return this._width},getTextureHeight:function(){return this._height},bind:function(t){if(t.__currentFrameBuffer){if(t.__currentFrameBuffer===this)return;console.warn("Renderer already bound with another framebuffer. Unbind it first")}t.__currentFrameBuffer=this;var e=t.gl;e.bindFramebuffer(Nn,this._getFrameBufferGL(t)),this._boundRenderer=t;var r=this._cache;r.put("viewport",t.viewport);var i=!1,n,a;for(var o in this._textures){i=!0;var s=this._textures[o];s&&(n=s.texture.width,a=s.texture.height,this._doAttach(t,s.texture,o,s.target))}this._width=n,this._height=a,!i&&this.depthBuffer&&console.error("Must attach texture before bind, or renderbuffer may have incorrect width and height."),this.viewport?t.setViewport(this.viewport):t.setViewport(0,0,n,a,1);var l=r.get("attached_textures");if(l){for(var o in l)if(!this._textures[o]){var u=l[o];this._doDetach(e,o,u)}}if(!r.get(fv)&&this.depthBuffer){r.miss(xi)&&r.put(xi,e.createRenderbuffer());var f=r.get(xi);(n!==r.get(Oy)||a!==r.get(By))&&(e.bindRenderbuffer(Jo,f),e.renderbufferStorage(Jo,e.DEPTH_COMPONENT16,n,a),r.put(Oy,n),r.put(By,a),e.bindRenderbuffer(Jo,null)),r.get(uv)||(e.framebufferRenderbuffer(Nn,ds,Jo,f),r.put(uv,!0))}},unbind:function(t){t.__currentFrameBuffer=null;var e=t.gl;e.bindFramebuffer(Nn,null),this._boundRenderer=null,this._cache.use(t.__uid__);var r=this._cache.get("viewport");r&&t.setViewport(r),this.updateMipmap(t)},updateMipmap:function(t){var e=t.gl;for(var r in this._textures){var i=this._textures[r];if(i){var n=i.texture;if(!n.NPOT&&n.useMipmap&&n.minFilter===ut.LINEAR_MIPMAP_LINEAR){var a=n.textureType==="textureCube"?B.TEXTURE_CUBE_MAP:B.TEXTURE_2D;e.bindTexture(a,n.getWebGLTexture(t)),e.generateMipmap(a),e.bindTexture(a,null)}}}},checkStatus:function(t){return t.checkFramebufferStatus(Nn)},_getFrameBufferGL:function(t){var e=this._cache;return e.use(t.__uid__),e.miss(uu)&&e.put(uu,t.gl.createFramebuffer()),e.get(uu)},attach:function(t,e,r){if(!t.width)throw new Error("The texture attached to color buffer is not a valid.");e=e||F2,r=r||B.TEXTURE_2D;var i=this._boundRenderer,n=i&&i.gl,a;if(n){var o=this._cache;o.use(i.__uid__),a=o.get("attached_textures")}var s=this._textures[e];if(!(s&&s.target===r&&s.texture===t&&a&&a[e]!=null)){var l=!0;i&&(l=this._doAttach(i,t,e,r),this.viewport||i.setViewport(0,0,t.width,t.height,1)),l&&(this._textures[e]=this._textures[e]||{},this._textures[e].texture=t,this._textures[e].target=r)}},_doAttach:function(t,e,r,i){var n=t.gl,a=e.getWebGLTexture(t),o=this._cache.get("attached_textures");if(o&&o[r]){var s=o[r];if(s.texture===e&&s.target===i)return}r=+r;var l=!0;if(r===ds||r===B.DEPTH_STENCIL_ATTACHMENT){var u=t.getGLExtension("WEBGL_depth_texture");if(u||(console.error("Depth texture is not supported by the browser"),l=!1),e.format!==B.DEPTH_COMPONENT&&e.format!==B.DEPTH_STENCIL&&(console.error("The texture attached to depth buffer is not a valid."),l=!1),l){var f=this._cache.get(xi);f&&(n.framebufferRenderbuffer(Nn,ds,Jo,null),n.deleteRenderbuffer(f),this._cache.put(xi,!1)),this._cache.put(uv,!1),this._cache.put(fv,!0)}}return n.framebufferTexture2D(Nn,r,i,a,0),o||(o={},this._cache.put("attached_textures",o)),o[r]=o[r]||{},o[r].texture=e,o[r].target=i,l},_doDetach:function(t,e,r){t.framebufferTexture2D(Nn,e,r,null,0);var i=this._cache.get("attached_textures");i&&i[e]&&(i[e]=null),(e===ds||e===B.DEPTH_STENCIL_ATTACHMENT)&&this._cache.put(fv,!1)},detach:function(t,e){if(this._textures[t]=null,this._boundRenderer){var r=this._cache;r.use(this._boundRenderer.__uid__),this._doDetach(this._boundRenderer.gl,t,e)}},dispose:function(t){var e=t.gl,r=this._cache;r.use(t.__uid__);var i=r.get(xi);i&&e.deleteRenderbuffer(i);var n=r.get(uu);n&&e.deleteFramebuffer(n),r.deleteContext(t.__uid__),this._textures={}}});fl.DEPTH_ATTACHMENT=ds;fl.COLOR_ATTACHMENT0=F2;fl.STENCIL_ATTACHMENT=B.STENCIL_ATTACHMENT;fl.DEPTH_STENCIL_ATTACHMENT=B.DEPTH_STENCIL_ATTACHMENT;const Ne=fl;var PB=["px","nx","py","ny","pz","nz"],IB=or.extend(function(){var t={position:new W,far:1e3,near:.1,texture:null,shadowMapPass:null},e=t._cameras={px:new xe({fov:90}),nx:new xe({fov:90}),py:new xe({fov:90}),ny:new xe({fov:90}),pz:new xe({fov:90}),nz:new xe({fov:90})};return e.px.lookAt(W.POSITIVE_X,W.NEGATIVE_Y),e.nx.lookAt(W.NEGATIVE_X,W.NEGATIVE_Y),e.py.lookAt(W.POSITIVE_Y,W.POSITIVE_Z),e.ny.lookAt(W.NEGATIVE_Y,W.NEGATIVE_Z),e.pz.lookAt(W.POSITIVE_Z,W.NEGATIVE_Y),e.nz.lookAt(W.NEGATIVE_Z,W.NEGATIVE_Y),t._frameBuffer=new Ne,t},{getCamera:function(t){return this._cameras[t]},render:function(t,e,r){var i=t.gl;r||e.update();for(var n=this.texture.width,a=2*Math.atan(n/(n-.5))/Math.PI*180,o=0;o<6;o++){var s=PB[o],l=this._cameras[s];if(W.copy(l.position,this.position),l.far=this.far,l.near=this.near,l.fov=a,this.shadowMapPass){l.update();var u=e.getBoundingBox();u.applyTransform(l.viewMatrix),e.viewBoundingBoxLastFrame.copy(u),this.shadowMapPass.render(t,e,l,!0)}this._frameBuffer.attach(this.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+o),this._frameBuffer.bind(t),t.render(e,l,!0),this._frameBuffer.unbind(t)}},dispose:function(t){this._frameBuffer.dispose(t)}});const Eg=IB;var NB=le.extend({dynamic:!1,widthSegments:1,heightSegments:1},function(){this.build()},{build:function(){for(var t=this.heightSegments,e=this.widthSegments,r=this.attributes,i=[],n=[],a=[],o=[],s=0;s<=t;s++)for(var l=s/t,u=0;u<=e;u++){var f=u/e;if(i.push([2*f-1,2*l-1,0]),n&&n.push([f,l]),a&&a.push([0,0,1]),u<e&&s<t){var h=u+s*(e+1);o.push([h,h+1,h+e+1]),o.push([h+e+1,h+1,h+e+2])}}r.position.fromArray(i),r.texcoord0.fromArray(n),r.normal.fromArray(a),this.initIndicesFromArray(o),this.boundingBox=new Ve,this.boundingBox.min.set(-1,-1,0),this.boundingBox.max.set(1,1,0)}});const Cg=NB;var ee=new J,OB=le.extend({dynamic:!1,widthSegments:1,heightSegments:1,depthSegments:1,inside:!1},function(){this.build()},{build:function(){var t={px:Ua("px",this.depthSegments,this.heightSegments),nx:Ua("nx",this.depthSegments,this.heightSegments),py:Ua("py",this.widthSegments,this.depthSegments),ny:Ua("ny",this.widthSegments,this.depthSegments),pz:Ua("pz",this.widthSegments,this.heightSegments),nz:Ua("nz",this.widthSegments,this.heightSegments)},e=["position","texcoord0","normal"],r=0,i=0;for(var n in t)r+=t[n].vertexCount,i+=t[n].indices.length;for(var a=0;a<e.length;a++)this.attributes[e[a]].init(r);this.indices=new pe.Uint16Array(i);var o=0,s=0;for(var n in t){for(var l=t[n],a=0;a<e.length;a++)for(var u=e[a],f=l.attributes[u].value,h=l.attributes[u].size,v=u==="normal",c=0;c<f.length;c++){var d=f[c];this.inside&&v&&(d=-d),this.attributes[u].value[c+h*s]=d}for(var p=l.indices.length,c=0;c<l.indices.length;c++)this.indices[c+o]=s+l.indices[this.inside?p-c-1:c];o+=l.indices.length,s+=l.vertexCount}this.boundingBox=new Ve,this.boundingBox.max.set(1,1,1),this.boundingBox.min.set(-1,-1,-1)}});function Ua(t,e,r){ee.identity();var i=new Cg({widthSegments:e,heightSegments:r});switch(t){case"px":J.translate(ee,ee,W.POSITIVE_X),J.rotateY(ee,ee,Math.PI/2);break;case"nx":J.translate(ee,ee,W.NEGATIVE_X),J.rotateY(ee,ee,-Math.PI/2);break;case"py":J.translate(ee,ee,W.POSITIVE_Y),J.rotateX(ee,ee,-Math.PI/2);break;case"ny":J.translate(ee,ee,W.NEGATIVE_Y),J.rotateX(ee,ee,Math.PI/2);break;case"pz":J.translate(ee,ee,W.POSITIVE_Z);break;case"nz":J.translate(ee,ee,W.NEGATIVE_Z),J.rotateY(ee,ee,Math.PI);break}return i.applyTransform(ee),i}const k2=OB,BB=`@export clay.skybox.vertex
#define SHADER_NAME skybox
uniform mat4 world : WORLD;
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
attribute vec3 position : POSITION;
varying vec3 v_WorldPosition;
void main()
{
 v_WorldPosition = (world * vec4(position, 1.0)).xyz;
 gl_Position = worldViewProjection * vec4(position, 1.0);
}
@end
@export clay.skybox.fragment
#define PI 3.1415926
uniform mat4 viewInverse : VIEWINVERSE;
#ifdef EQUIRECTANGULAR
uniform sampler2D environmentMap;
#else
uniform samplerCube environmentMap;
#endif
uniform float lod: 0.0;
varying vec3 v_WorldPosition;
@import clay.util.rgbm
@import clay.util.srgb
@import clay.util.ACES
void main()
{
 vec3 eyePos = viewInverse[3].xyz;
 vec3 V = normalize(v_WorldPosition - eyePos);
#ifdef EQUIRECTANGULAR
 float phi = acos(V.y);
 float theta = atan(-V.x, V.z) + PI * 0.5;
 vec2 uv = vec2(theta / 2.0 / PI, phi / PI);
 vec4 texel = decodeHDR(texture2D(environmentMap, fract(uv)));
#else
 #if defined(LOD) || defined(SUPPORT_TEXTURE_LOD)
 vec4 texel = decodeHDR(textureCubeLodEXT(environmentMap, V, lod));
 #else
 vec4 texel = decodeHDR(textureCube(environmentMap, V));
 #endif
#endif
#ifdef SRGB_DECODE
 texel = sRGBToLinear(texel);
#endif
#ifdef TONEMAPPING
 texel.rgb = ACESToneMapping(texel.rgb);
#endif
#ifdef SRGB_ENCODE
 texel = linearTosRGB(texel);
#endif
 gl_FragColor = encodeHDR(vec4(texel.rgb, 1.0));
}
@end`;V.import(BB);var FB=Sg.extend(function(){var t=new V({vertex:V.source("clay.skybox.vertex"),fragment:V.source("clay.skybox.fragment")}),e=new Ii({shader:t,depthMask:!1});return{scene:null,geometry:new k2,material:e,environmentMap:null,culling:!1,_dummyCamera:new xe}},function(){var t=this.scene;t&&this.attachScene(t),this.environmentMap&&this.setEnvironmentMap(this.environmentMap)},{attachScene:function(t){this.scene&&this.detachScene(),t.skybox=this,this.scene=t,t.on("beforerender",this._beforeRenderScene,this)},detachScene:function(){this.scene&&(this.scene.off("beforerender",this._beforeRenderScene),this.scene.skybox=null),this.scene=null},dispose:function(t){this.detachScene(),this.geometry.dispose(t)},setEnvironmentMap:function(t){t.textureType==="texture2D"?(this.material.define("EQUIRECTANGULAR"),t.minFilter=ut.LINEAR):this.material.undefine("EQUIRECTANGULAR"),this.material.set("environmentMap",t)},getEnvironmentMap:function(){return this.material.get("environmentMap")},_beforeRenderScene:function(t,e,r){this.renderSkybox(t,r)},renderSkybox:function(t,e){var r=this._dummyCamera;r.aspect=t.getViewportAspect(),r.fov=e.fov||50,r.updateProjectionMatrix(),J.invert(r.invProjectionMatrix,r.projectionMatrix),r.worldTransform.copy(e.worldTransform),r.viewMatrix.copy(e.viewMatrix),this.position.copy(e.getWorldPosition()),this.update(),t.gl.disable(t.gl.BLEND),this.material.get("lod")>0?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),t.renderPass([this],r)}});const qs=FB;var kB=542327876,zB=131072,UB=512,HB=4;function Mg(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}var VB=31,GB=Mg("DXT1"),WB=Mg("DXT3"),XB=Mg("DXT5"),YB=0,$B=1,ZB=2,qB=3,KB=4,jB=7,QB=20,JB=21,tF=28,eF={parse:function(t,e){var r=new Int32Array(t,0,VB);if(r[YB]!==kB||!r(QB)&HB)return null;var i=r(JB),n=r[KB],a=r[qB],o=r[tF]&UB,s=r[ZB]&zB,l,u;switch(i){case GB:l=8,u=ut.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case WB:l=16,u=ut.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case XB:l=16,u=ut.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var f=r[$B]+4,h=o?6:1,v=1;s&&(v=Math.max(1,r[jB]));for(var c=[],d=0;d<h;d++){var p=n,g=a;c[d]=new Pt({width:p,height:g,format:u});for(var m=[],_=0;_<v;_++){var y=Math.max(4,p)/4*Math.max(4,g)/4*l,x=new Uint8Array(t,f,y);f+=y,p*=.5,g*=.5,m[_]=x}c[d].pixels=m[0],s&&(c[d].mipmaps=m)}if(e)e.width=c[0].width,e.height=c[0].height,e.format=c[0].format,e.pixels=c[0].pixels,e.mipmaps=c[0].mipmaps;else return c[0]}};const rF=eF;var Bu=String.fromCharCode,iF=8,nF=32767;function aF(t,e,r,i){if(t[3]>0){var n=Math.pow(2,t[3]-128-8+i);e[r+0]=t[0]*n,e[r+1]=t[1]*n,e[r+2]=t[2]*n}else e[r+0]=0,e[r+1]=0,e[r+2]=0;return e[r+3]=1,e}function oF(t,e,r){for(var i="",n=e;n<r;n++)i+=Bu(t[n]);return i}function sF(t,e){e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]}function Fy(t,e,r,i){for(var n=0,a=0,o=i;o>0;)if(t[a][0]=e[r++],t[a][1]=e[r++],t[a][2]=e[r++],t[a][3]=e[r++],t[a][0]===1&&t[a][1]===1&&t[a][2]===1){for(var s=t[a][3]<<n>>>0;s>0;s--)sF(t[a-1],t[a]),a++,o--;n+=8}else a++,o--,n=0;return r}function lF(t,e,r,i){if(i<iF|i>nF)return Fy(t,e,r,i);var n=e[r++];if(n!=2)return Fy(t,e,r-1,i);if(t[0][1]=e[r++],t[0][2]=e[r++],n=e[r++],(t[0][2]<<8>>>0|n)>>>0!==i)return null;for(var n=0;n<4;n++)for(var a=0;a<i;){var o=e[r++];if(o>128){o=(o&127)>>>0;for(var s=e[r++];o--;)t[a++][n]=s}else for(;o--;)t[a++][n]=e[r++]}return r}var uF={parseRGBE:function(t,e,r){r==null&&(r=0);var i=new Uint8Array(t),n=i.length;if(oF(i,0,2)==="#?"){for(var a=2;a<n&&!(Bu(i[a])===`
`&&Bu(i[a+1])===`
`);a++);if(!(a>=n)){a+=2;for(var o="";a<n;a++){var s=Bu(i[a]);if(s===`
`)break;o+=s}var l=o.split(" "),u=parseInt(l[1]),f=parseInt(l[3]);if(!(!f||!u)){for(var h=a+1,v=[],c=0;c<f;c++){v[c]=[];for(var d=0;d<4;d++)v[c][d]=0}for(var p=new Float32Array(f*u*4),g=0,m=0;m<u;m++){var h=lF(v,i,h,f);if(!h)return null;for(var c=0;c<f;c++)aF(v[c],p,g,r),g+=4}return e||(e=new Pt),e.width=f,e.height=u,e.pixels=p,e.type=ut.FLOAT,e}}}},parseRGBEFromPNG:function(t){}};const fF=uF;var Fu={loadTexture:function(t,e,r,i){var n;if(typeof e=="function"?(r=e,i=r,e={}):e=e||{},typeof t=="string"){if(t.match(/.hdr$/)||e.fileType==="hdr")return n=new Pt({width:0,height:0,sRGB:!1}),Fu._fetchTexture(t,function(a){fF.parseRGBE(a,n,e.exposure),n.dirty(),r&&r(n)},i),n;t.match(/.dds$/)||e.fileType==="dds"?(n=new Pt({width:0,height:0}),Fu._fetchTexture(t,function(a){rF.parse(a,n),n.dirty(),r&&r(n)},i)):(n=new Pt,n.load(t),n.success(r),n.error(i))}else typeof t=="object"&&typeof t.px<"u"&&(n=new Zs,n.load(t),n.success(r),n.error(i));return n},loadPanorama:function(t,e,r,i,n,a){var o=this;typeof i=="function"?(n=i,a=n,i={}):i=i||{},Fu.loadTexture(e,i,function(s){s.flipY=i.flipY||!1,o.panoramaToCubeMap(t,s,r,i),s.dispose(t),n&&n(r)},a)},panoramaToCubeMap:function(t,e,r,i){var n=new Eg,a=new qs({scene:new ln});return a.setEnvironmentMap(e),i=i||{},i.encodeRGBM&&a.material.define("fragment","RGBM_ENCODE"),r.sRGB=e.sRGB,n.texture=r,n.render(t,a.scene),n.texture=null,n.dispose(t),r},heightToNormal:function(t,e){var r=document.createElement("canvas"),i=r.width=t.width,n=r.height=t.height,a=r.getContext("2d");a.drawImage(t,0,0,i,n),e=e||!1;for(var o=a.getImageData(0,0,i,n),s=a.createImageData(i,n),l=0;l<o.data.length;l+=4){if(e){var u=o.data[l],f=o.data[l+1],h=o.data[l+2],v=Math.abs(u-f)+Math.abs(f-h);if(v>20)return console.warn("Given image is not a height map"),t}var c,d,p,g;l%(i*4)===0?(c=o.data[l],p=o.data[l+4]):l%(i*4)===(i-1)*4?(c=o.data[l-4],p=o.data[l]):(c=o.data[l-4],p=o.data[l+4]),l<i*4?(d=o.data[l],g=o.data[l+i*4]):l>i*(n-1)*4?(d=o.data[l-i*4],g=o.data[l]):(d=o.data[l-i*4],g=o.data[l+i*4]),s.data[l]=c-p+127,s.data[l+1]=d-g+127,s.data[l+2]=255,s.data[l+3]=255}return a.putImageData(s,0,0),r},isHeightImage:function(t,e,r){if(!t||!t.width||!t.height)return!1;var i=document.createElement("canvas"),n=i.getContext("2d"),a=e||32;r=r||20,i.width=i.height=a,n.drawImage(t,0,0,a,a);for(var o=n.getImageData(0,0,a,a),s=0;s<o.data.length;s+=4){var l=o.data[s],u=o.data[s+1],f=o.data[s+2],h=Math.abs(l-u)+Math.abs(u-f);if(h>r)return!1}return!0},_fetchTexture:function(t,e,r){pe.request.get({url:t,responseType:"arraybuffer",onload:e,onerror:r})},createChessboard:function(t,e,r,i){t=t||512,e=e||64,r=r||"black",i=i||"white";var n=Math.ceil(t/e),a=document.createElement("canvas");a.width=t,a.height=t;var o=a.getContext("2d");o.fillStyle=i,o.fillRect(0,0,t,t),o.fillStyle=r;for(var s=0;s<n;s++)for(var l=0;l<n;l++){var u=l%2?s%2:s%2-1;u&&o.fillRect(s*e,l*e,e,e)}var f=new Pt({image:a,anisotropic:8});return f},createBlank:function(t){var e=document.createElement("canvas");e.width=1,e.height=1;var r=e.getContext("2d");r.fillStyle=t,r.fillRect(0,0,1,1);var i=new Pt({image:e});return i}};const aa=Fu;var zd=["mousedown","mouseup","mousemove","mouseover","mouseout","click","dblclick","contextmenu"];function Ud(t){return"_on"+t}var Hd=function(t){var e=this;this._texture=new Pt({anisotropic:32,flipY:!1,surface:this,dispose:function(r){e.dispose(),Pt.prototype.dispose.call(this,r)}}),zd.forEach(function(r){this[Ud(r)]=function(i){i.triangle&&this._meshes.forEach(function(n){this.dispatchEvent(r,n,i.triangle,i.point)},this)}},this),this._meshes=[],t&&this.setECharts(t),this.onupdate=null};Hd.prototype={constructor:Hd,getTexture:function(){return this._texture},setECharts:function(t){this._chart=t;var e=t.getDom();if(!(e instanceof HTMLCanvasElement))console.error("ECharts must init on canvas if it is used as texture."),e=document.createElement("canvas");else{var r=this,i=t.getZr(),n=i.__oldRefreshImmediately||i.refreshImmediately;i.refreshImmediately=function(){n.call(this),r._texture.dirty(),r.onupdate&&r.onupdate()},i.__oldRefreshImmediately=n}this._texture.image=e,this._texture.dirty(),this.onupdate&&this.onupdate()},dispatchEvent:function(){var t=new W,e=new W,r=new W,i=new ur,n=new ur,a=new ur,o=new ur,s=new W;return function(l,u,f,h){var v=u.geometry,c=v.attributes.position,d=v.attributes.texcoord0,p=W.dot,g=W.cross;c.get(f[0],t.array),c.get(f[1],e.array),c.get(f[2],r.array),d.get(f[0],i.array),d.get(f[1],n.array),d.get(f[2],a.array),g(s,e,r);var m=p(t,s),_=p(h,s)/m;g(s,r,t);var y=p(h,s)/m;g(s,t,e);var x=p(h,s)/m;ur.scale(o,i,_),ur.scaleAndAdd(o,o,n,y),ur.scaleAndAdd(o,o,a,x);var S=o.x*this._chart.getWidth(),T=o.y*this._chart.getHeight();this._chart.getZr().handler.dispatch(l,{zrX:S,zrY:T})}}(),attachToMesh:function(t){this._meshes.indexOf(t)>=0||(zd.forEach(function(e){t.on(e,this[Ud(e)],this)},this),this._meshes.push(t))},detachFromMesh:function(t){var e=this._meshes.indexOf(t);e>=0&&this._meshes.splice(e,1),zd.forEach(function(r){t.off(r,this[Ud(r)])},this)},dispose:function(){this._meshes.forEach(function(t){this.detachFromMesh(t)},this)}};const hF=Hd;var cF=_o.extend({left:-1,right:1,near:-1,far:1,top:1,bottom:-1},{updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},decomposeProjectionMatrix:function(){var t=this.projectionMatrix.array;this.left=(-1-t[12])/t[0],this.right=(1-t[12])/t[0],this.top=(1-t[13])/t[5],this.bottom=(-1-t[13])/t[5],this.near=-(-1-t[14])/t[10],this.far=-(1-t[14])/t[10]},clone:function(){var t=_o.prototype.clone.call(this);return t.left=this.left,t.right=this.right,t.near=this.near,t.far=this.far,t.top=this.top,t.bottom=this.bottom,t}});const Ks=cF,vF=`
@export clay.compositor.vertex
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
attribute vec3 position : POSITION;
attribute vec2 texcoord : TEXCOORD_0;
varying vec2 v_Texcoord;
void main()
{
 v_Texcoord = texcoord;
 gl_Position = worldViewProjection * vec4(position, 1.0);
}
@end`;V.import(vF);var dF=new Cg,ky=new Sg({geometry:dF,frustumCulling:!1}),pF=new Ks,gF=or.extend(function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}},function(){var t=new V(V.source("clay.compositor.vertex"),this.fragment),e=new Ii({shader:t});e.enableTexturesAll(),this.material=e},{setUniform:function(t,e){this.material.setUniform(t,e)},getUniform:function(t){var e=this.material.uniforms[t];if(e)return e.value},attachOutput:function(t,e){this.outputs||(this.outputs={}),e=e||B.COLOR_ATTACHMENT0,this.outputs[e]=t},detachOutput:function(t){for(var e in this.outputs)this.outputs[e]===t&&(this.outputs[e]=null)},bind:function(t,e){if(this.outputs)for(var r in this.outputs){var i=this.outputs[r];i&&e.attach(i,r)}e&&e.bind(t)},unbind:function(t,e){e.unbind(t)},render:function(t,e){var r=t.gl;if(e){this.bind(t,e);var i=t.getGLExtension("EXT_draw_buffers");if(i&&this.outputs){var n=[];for(var a in this.outputs)a=+a,a>=r.COLOR_ATTACHMENT0&&a<=r.COLOR_ATTACHMENT0+8&&n.push(a);i.drawBuffersEXT(n)}}this.trigger("beforerender",this,t);var o=this.clearDepth?r.DEPTH_BUFFER_BIT:0;if(r.depthMask(!0),this.clearColor){o=o|r.COLOR_BUFFER_BIT,r.colorMask(!0,!0,!0,!0);var s=this.clearColor;Array.isArray(s)&&r.clearColor(s[0],s[1],s[2],s[3])}r.clear(o),this.blendWithPrevious?(r.enable(r.BLEND),this.material.transparent=!0):(r.disable(r.BLEND),this.material.transparent=!1),this.renderQuad(t),this.trigger("afterrender",this,t),e&&this.unbind(t,e)},renderQuad:function(t){ky.material=this.material,t.renderPass([ky],pF)},dispose:function(t){}});const We=gF,mF=`#define SAMPLE_NUMBER 1024
#define PI 3.14159265358979
uniform sampler2D normalDistribution;
uniform vec2 viewportSize : [512, 256];
const vec3 N = vec3(0.0, 0.0, 1.0);
const float fSampleNumber = float(SAMPLE_NUMBER);
vec3 importanceSampleNormal(float i, float roughness, vec3 N) {
 vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;
 vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);
 vec3 tangentX = normalize(cross(N, upVector));
 vec3 tangentZ = cross(N, tangentX);
 return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);
}
float G_Smith(float roughness, float NoV, float NoL) {
 float k = roughness * roughness / 2.0;
 float G1V = NoV / (NoV * (1.0 - k) + k);
 float G1L = NoL / (NoL * (1.0 - k) + k);
 return G1L * G1V;
}
void main() {
 vec2 uv = gl_FragCoord.xy / viewportSize;
 float NoV = uv.x;
 float roughness = uv.y;
 vec3 V;
 V.x = sqrt(1.0 - NoV * NoV);
 V.y = 0.0;
 V.z = NoV;
 float A = 0.0;
 float B = 0.0;
 for (int i = 0; i < SAMPLE_NUMBER; i++) {
 vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);
 vec3 L = reflect(-V, H);
 float NoL = clamp(L.z, 0.0, 1.0);
 float NoH = clamp(H.z, 0.0, 1.0);
 float VoH = clamp(dot(V, H), 0.0, 1.0);
 if (NoL > 0.0) {
 float G = G_Smith(roughness, NoV, NoL);
 float G_Vis = G * VoH / (NoH * NoV);
 float Fc = pow(1.0 - VoH, 5.0);
 A += (1.0 - Fc) * G_Vis;
 B += Fc * G_Vis;
 }
 }
 gl_FragColor = vec4(vec2(A, B) / fSampleNumber, 0.0, 1.0);
}
`,_F=`#define SHADER_NAME prefilter
#define SAMPLE_NUMBER 1024
#define PI 3.14159265358979
uniform mat4 viewInverse : VIEWINVERSE;
uniform samplerCube environmentMap;
uniform sampler2D normalDistribution;
uniform float roughness : 0.5;
varying vec2 v_Texcoord;
varying vec3 v_WorldPosition;
@import clay.util.rgbm
vec3 importanceSampleNormal(float i, float roughness, vec3 N) {
 vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;
 vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);
 vec3 tangentX = normalize(cross(N, upVector));
 vec3 tangentZ = cross(N, tangentX);
 return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);
}
void main() {
 vec3 eyePos = viewInverse[3].xyz;
 vec3 V = normalize(v_WorldPosition - eyePos);
 vec3 N = V;
 vec3 prefilteredColor = vec3(0.0);
 float totalWeight = 0.0;
 float fMaxSampleNumber = float(SAMPLE_NUMBER);
 for (int i = 0; i < SAMPLE_NUMBER; i++) {
 vec3 H = importanceSampleNormal(float(i) / fMaxSampleNumber, roughness, N);
 vec3 L = reflect(-V, H);
 float NoL = clamp(dot(N, L), 0.0, 1.0);
 if (NoL > 0.0) {
 prefilteredColor += decodeHDR(textureCube(environmentMap, L)).rgb * NoL;
 totalWeight += NoL;
 }
 }
 gl_FragColor = encodeHDR(vec4(prefilteredColor / totalWeight, 1.0));
}
`;var oa={},hv=["px","nx","py","ny","pz","nz"];oa.prefilterEnvironmentMap=function(t,e,r,i,n){(!n||!i)&&(i=oa.generateNormalDistribution(),n=oa.integrateBRDF(t,i)),r=r||{};var a=r.width||64,o=r.height||64,s=r.type||e.type,l=new Zs({width:a,height:o,type:s,flipY:!1,mipmaps:[]});l.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var u=Math.min(a,o),f=Math.log(u)/Math.log(2)+1,h=new Ii({shader:new V({vertex:V.source("clay.skybox.vertex"),fragment:_F})});h.set("normalDistribution",i),r.encodeRGBM&&h.define("fragment","RGBM_ENCODE"),r.decodeRGBM&&h.define("fragment","RGBM_DECODE");var v=new ln,c;if(e.textureType==="texture2D"){var d=new Zs({width:a,height:o,type:s===ut.FLOAT?ut.HALF_FLOAT:s});aa.panoramaToCubeMap(t,e,d,{encodeRGBM:r.decodeRGBM}),e=d}c=new qs({scene:v,material:h}),c.material.set("environmentMap",e);var p=new Eg({texture:l});r.encodeRGBM&&(s=l.type=ut.UNSIGNED_BYTE);for(var g=new Pt({width:a,height:o,type:s}),m=new Ne({depthBuffer:!1}),_=pe[s===ut.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],y=0;y<f;y++){l.mipmaps[y]={pixels:{}},c.material.set("roughness",y/(f-1));for(var x=g.width,S=2*Math.atan(x/(x-.5))/Math.PI*180,T=0;T<hv.length;T++){var b=new _(g.width*g.height*4);m.attach(g),m.bind(t);var w=p.getCamera(hv[T]);w.fov=S,t.render(v,w),t.gl.readPixels(0,0,g.width,g.height,ut.RGBA,s,b),m.unbind(t),l.mipmaps[y].pixels[hv[T]]=b}g.width/=2,g.height/=2,g.dirty()}return m.dispose(t),g.dispose(t),c.dispose(t),i.dispose(t),{environmentMap:l,brdfLookup:n,normalDistribution:i,maxMipmapLevel:f}};oa.integrateBRDF=function(t,e){e=e||oa.generateNormalDistribution();var r=new Ne({depthBuffer:!1}),i=new We({fragment:mF}),n=new Pt({width:512,height:256,type:ut.HALF_FLOAT,wrapS:ut.CLAMP_TO_EDGE,wrapT:ut.CLAMP_TO_EDGE,minFilter:ut.NEAREST,magFilter:ut.NEAREST,useMipmap:!1});return i.setUniform("normalDistribution",e),i.setUniform("viewportSize",[512,256]),i.attachOutput(n),i.render(t,r),r.dispose(t),n};oa.generateNormalDistribution=function(r,i){for(var r=r||256,i=i||1024,n=new Pt({width:r,height:i,type:ut.FLOAT,minFilter:ut.NEAREST,magFilter:ut.NEAREST,wrapS:ut.CLAMP_TO_EDGE,wrapT:ut.CLAMP_TO_EDGE,useMipmap:!1}),a=new Float32Array(i*r*4),o=[],s=0;s<r;s++){for(var l=s/r,u=l*l,f=0;f<i;f++){var h=(f<<16|f>>>16)>>>0;h=((h&1431655765)<<1|(h&2863311530)>>>1)>>>0,h=((h&858993459)<<2|(h&3435973836)>>>2)>>>0,h=((h&252645135)<<4|(h&4042322160)>>>4)>>>0,h=(((h&16711935)<<8|(h&4278255360)>>>8)>>>0)/4294967296;var v=Math.sqrt((1-h)/(1+(u*u-1)*h));o[f]=v}for(var f=0;f<i;f++){var c=(f*r+s)*4,v=o[f],d=Math.sqrt(1-v*v),p=f/i,g=2*Math.PI*p;a[c]=d*Math.cos(g),a[c+1]=v,a[c+2]=d*Math.sin(g),a[c+3]=1}}return n.pixels=a,n};const ku=oa;var yF=Zr.extend({cubemap:null,castShadow:!1,_normalDistribution:null,_brdfLookup:null},{type:"AMBIENT_CUBEMAP_LIGHT",prefilter:function(t,e){if(!t.getGLExtension("EXT_shader_texture_lod")){console.warn("Device not support textureCubeLodEXT");return}this._brdfLookup||(this._normalDistribution=ku.generateNormalDistribution(),this._brdfLookup=ku.integrateBRDF(t,this._normalDistribution));var r=this.cubemap;if(!r.__prefiltered){var i=ku.prefilterEnvironmentMap(t,r,{encodeRGBM:!0,width:e,height:e},this._normalDistribution,this._brdfLookup);this.cubemap=i.environmentMap,this.cubemap.__prefiltered=!0,r.dispose(t)}},getBRDFLookup:function(){return this._brdfLookup},uniformTemplates:{ambientCubemapLightColor:{type:"3f",value:function(t){var e=t.color,r=t.intensity;return[e[0]*r,e[1]*r,e[2]*r]}},ambientCubemapLightCubemap:{type:"t",value:function(t){return t.cubemap}},ambientCubemapLightBRDFLookup:{type:"t",value:function(t){return t._brdfLookup}}}});const xF=yF;var TF=Zr.extend({castShadow:!1,coefficients:[]},function(){this._coefficientsTmpArr=new pe.Float32Array(9*3)},{type:"AMBIENT_SH_LIGHT",uniformTemplates:{ambientSHLightColor:{type:"3f",value:function(t){var e=t.color,r=t.intensity;return[e[0]*r,e[1]*r,e[2]*r]}},ambientSHLightCoefficients:{type:"3f",value:function(t){for(var e=t._coefficientsTmpArr,r=0;r<t.coefficients.length;r++)e[r]=t.coefficients[r];return e}}}});const SF=TF;var z2={},Qn=["px","nx","py","ny","pz","nz"];function wF(t,e){var r=t[0],i=t[1],n=t[2];return e===0?1:e===1?r:e===2?i:e===3?n:e===4?r*n:e===5?i*n:e===6?r*i:e===7?3*n*n-1:r*r-i*i}var bF={px:[2,1,0,-1,-1,1],nx:[2,1,0,1,-1,-1],py:[0,2,1,1,-1,-1],ny:[0,2,1,1,1,1],pz:[0,1,2,-1,-1,-1],nz:[0,1,2,1,-1,1]};function AF(t,e,r,i){for(var n=new pe.Float32Array(27),a=P.create(),o=P.create(),s=P.create(),l=0;l<9;l++){for(var u=P.create(),f=0;f<Qn.length;f++){for(var h=e[Qn[f]],v=P.create(),c=0,d=0,p=bF[Qn[f]],g=0;g<i;g++)for(var m=0;m<r;m++){a[0]=m/(r-1)*2-1,a[1]=g/(i-1)*2-1,a[2]=-1,P.normalize(a,a),s[0]=a[p[0]]*p[3],s[1]=a[p[1]]*p[4],s[2]=a[p[2]]*p[5],o[0]=h[d++]/255,o[1]=h[d++]/255,o[2]=h[d++]/255;var _=h[d++]/255*8.12;o[0]*=_,o[1]*=_,o[2]*=_,P.scaleAndAdd(v,v,o,wF(s,l)*-a[2]),c+=-a[2]}P.scaleAndAdd(u,u,v,1/c)}n[l*3]=u[0]/6,n[l*3+1]=u[1]/6,n[l*3+2]=u[2]/6}return n}z2.projectEnvironmentMap=function(t,e,r){r=r||{},r.lod=r.lod||0;var i,n=new ln,a=64;e.textureType==="texture2D"?i=new qs({scene:n,environmentMap:e}):(a=e.image&&e.image.px?e.image.px.width:e.width,i=new qs({scene:n,environmentMap:e}));var o=Math.ceil(a/Math.pow(2,r.lod)),s=Math.ceil(a/Math.pow(2,r.lod)),l=new Pt({width:o,height:s}),u=new Ne;i.material.define("fragment","RGBM_ENCODE"),r.decodeRGBM&&i.material.define("fragment","RGBM_DECODE"),i.material.set("lod",r.lod);for(var f=new Eg({texture:l}),h={},v=0;v<Qn.length;v++){h[Qn[v]]=new Uint8Array(o*s*4);var c=f.getCamera(Qn[v]);c.fov=90,u.attach(l),u.bind(t),t.render(n,c),t.gl.readPixels(0,0,o,s,ut.RGBA,ut.UNSIGNED_BYTE,h[Qn[v]]),u.unbind(t)}return i.dispose(t),u.dispose(t),l.dispose(t),AF(t,h,o,s)};const EF=z2;var CF={firstNotNull:function(){for(var t=0,e=arguments.length;t<e;t++)if(arguments[t]!=null)return arguments[t]},queryDataIndex:function(t,e){if(e.dataIndexInside!=null)return e.dataIndexInside;if(e.dataIndex!=null)return X(e.dataIndex)?K(e.dataIndex,function(r){return t.indexOfRawIndex(r)}):t.indexOfRawIndex(e.dataIndex);if(e.name!=null)return X(e.name)?K(e.name,function(r){return t.indexOfName(r)}):t.indexOfName(e.name)}};const Dr=CF;var MF=le.extend({dynamic:!1,widthSegments:40,heightSegments:20,phiStart:0,phiLength:Math.PI*2,thetaStart:0,thetaLength:Math.PI,radius:1},function(){this.build()},{build:function(){var t=this.heightSegments,e=this.widthSegments,r=this.attributes.position,i=this.attributes.texcoord0,n=this.attributes.normal,a=(e+1)*(t+1);r.init(a),i.init(a),n.init(a);var o=a>65535?Uint32Array:Uint16Array,s=this.indices=new o(e*t*6),l,u,f,h,v,c,d,y=this.radius,p=this.phiStart,g=this.phiLength,m=this.thetaStart,_=this.thetaLength,y=this.radius,x=[],S=[],T=0,b=1/y;for(d=0;d<=t;d++)for(c=0;c<=e;c++)h=c/e,v=d/t,l=-y*Math.cos(p+h*g)*Math.sin(m+v*_),u=y*Math.cos(m+v*_),f=y*Math.sin(p+h*g)*Math.sin(m+v*_),x[0]=l,x[1]=u,x[2]=f,S[0]=h,S[1]=v,r.set(T,x),i.set(T,S),x[0]*=b,x[1]*=b,x[2]*=b,n.set(T,x),T++;var w,A,C,E,D=e+1,L=0;for(d=0;d<t;d++)for(c=0;c<e;c++)A=d*D+c,w=d*D+c+1,E=(d+1)*D+c+1,C=(d+1)*D+c,s[L++]=w,s[L++]=A,s[L++]=E,s[L++]=A,s[L++]=C,s[L++]=E;this.boundingBox=new Ve,this.boundingBox.max.set(y,y,y),this.boundingBox.min.set(-y,-y,-y)}});const DF=MF;var LF=Zr.extend({castShadow:!1},{type:"AMBIENT_LIGHT",uniformTemplates:{ambientLightColor:{type:"3f",value:function(t){var e=t.color,r=t.intensity;return[e[0]*r,e[1]*r,e[2]*r]}}}});const RF=LF;var PF=Zr.extend({shadowBias:.001,shadowSlopeScale:2,shadowCascade:1,cascadeSplitLogFactor:.2},{type:"DIRECTIONAL_LIGHT",uniformTemplates:{directionalLightDirection:{type:"3f",value:function(t){return t.__dir=t.__dir||new W,t.__dir.copy(t.worldTransform.z).normalize().negate().array}},directionalLightColor:{type:"3f",value:function(t){var e=t.color,r=t.intensity;return[e[0]*r,e[1]*r,e[2]*r]}}},clone:function(){var t=Zr.prototype.clone.call(this);return t.shadowBias=this.shadowBias,t.shadowSlopeScale=this.shadowSlopeScale,t}});const IF=PF;var NF=Zr.extend({range:100,castShadow:!1},{type:"POINT_LIGHT",uniformTemplates:{pointLightPosition:{type:"3f",value:function(t){return t.getWorldPosition().array}},pointLightRange:{type:"1f",value:function(t){return t.range}},pointLightColor:{type:"3f",value:function(t){var e=t.color,r=t.intensity;return[e[0]*r,e[1]*r,e[2]*r]}}},clone:function(){var t=Zr.prototype.clone.call(this);return t.range=this.range,t}});const OF=NF;var BF=Zr.extend({range:20,umbraAngle:30,penumbraAngle:45,falloffFactor:2,shadowBias:.001,shadowSlopeScale:2},{type:"SPOT_LIGHT",uniformTemplates:{spotLightPosition:{type:"3f",value:function(t){return t.getWorldPosition().array}},spotLightRange:{type:"1f",value:function(t){return t.range}},spotLightUmbraAngleCosine:{type:"1f",value:function(t){return Math.cos(t.umbraAngle*Math.PI/180)}},spotLightPenumbraAngleCosine:{type:"1f",value:function(t){return Math.cos(t.penumbraAngle*Math.PI/180)}},spotLightFalloffFactor:{type:"1f",value:function(t){return t.falloffFactor}},spotLightDirection:{type:"3f",value:function(t){return t.__dir=t.__dir||new W,t.__dir.copy(t.worldTransform.z).negate().array}},spotLightColor:{type:"3f",value:function(t){var e=t.color,r=t.intensity;return[e[0]*r,e[1]*r,e[2]*r]}}},clone:function(){var t=Zr.prototype.clone.call(this);return t.range=this.range,t.umbraAngle=this.umbraAngle,t.penumbraAngle=this.penumbraAngle,t.falloffFactor=this.falloffFactor,t.shadowBias=this.shadowBias,t.shadowSlopeScale=this.shadowSlopeScale,t}});const FF=BF;var Ct=function(t,e,r,i){t=t||0,e=e||0,r=r||0,i=i||0,this.array=Y.fromValues(t,e,r,i),this._dirty=!0};Ct.prototype={constructor:Ct,add:function(t){return Y.add(this.array,this.array,t.array),this._dirty=!0,this},set:function(t,e,r,i){return this.array[0]=t,this.array[1]=e,this.array[2]=r,this.array[3]=i,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this.array[2]=t[2],this.array[3]=t[3],this._dirty=!0,this},clone:function(){return new Ct(this.x,this.y,this.z,this.w)},copy:function(t){return Y.copy(this.array,t.array),this._dirty=!0,this},dist:function(t){return Y.dist(this.array,t.array)},distance:function(t){return Y.distance(this.array,t.array)},div:function(t){return Y.div(this.array,this.array,t.array),this._dirty=!0,this},divide:function(t){return Y.divide(this.array,this.array,t.array),this._dirty=!0,this},dot:function(t){return Y.dot(this.array,t.array)},len:function(){return Y.len(this.array)},length:function(){return Y.length(this.array)},lerp:function(t,e,r){return Y.lerp(this.array,t.array,e.array,r),this._dirty=!0,this},min:function(t){return Y.min(this.array,this.array,t.array),this._dirty=!0,this},max:function(t){return Y.max(this.array,this.array,t.array),this._dirty=!0,this},mul:function(t){return Y.mul(this.array,this.array,t.array),this._dirty=!0,this},multiply:function(t){return Y.multiply(this.array,this.array,t.array),this._dirty=!0,this},negate:function(){return Y.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return Y.normalize(this.array,this.array),this._dirty=!0,this},random:function(t){return Y.random(this.array,t),this._dirty=!0,this},scale:function(t){return Y.scale(this.array,this.array,t),this._dirty=!0,this},scaleAndAdd:function(t,e){return Y.scaleAndAdd(this.array,this.array,t.array,e),this._dirty=!0,this},sqrDist:function(t){return Y.sqrDist(this.array,t.array)},squaredDistance:function(t){return Y.squaredDistance(this.array,t.array)},sqrLen:function(){return Y.sqrLen(this.array)},squaredLength:function(){return Y.squaredLength(this.array)},sub:function(t){return Y.sub(this.array,this.array,t.array),this._dirty=!0,this},subtract:function(t){return Y.subtract(this.array,this.array,t.array),this._dirty=!0,this},transformMat4:function(t){return Y.transformMat4(this.array,this.array,t.array),this._dirty=!0,this},transformQuat:function(t){return Y.transformQuat(this.array,this.array,t.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var ts=Object.defineProperty;if(ts){var fu=Ct.prototype;ts(fu,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),ts(fu,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}}),ts(fu,"z",{get:function(){return this.array[2]},set:function(t){this.array[2]=t,this._dirty=!0}}),ts(fu,"w",{get:function(){return this.array[3]},set:function(t){this.array[3]=t,this._dirty=!0}})}Ct.add=function(t,e,r){return Y.add(t.array,e.array,r.array),t._dirty=!0,t};Ct.set=function(t,e,r,i,n){Y.set(t.array,e,r,i,n),t._dirty=!0};Ct.copy=function(t,e){return Y.copy(t.array,e.array),t._dirty=!0,t};Ct.dist=function(t,e){return Y.distance(t.array,e.array)};Ct.distance=Ct.dist;Ct.div=function(t,e,r){return Y.divide(t.array,e.array,r.array),t._dirty=!0,t};Ct.divide=Ct.div;Ct.dot=function(t,e){return Y.dot(t.array,e.array)};Ct.len=function(t){return Y.length(t.array)};Ct.lerp=function(t,e,r,i){return Y.lerp(t.array,e.array,r.array,i),t._dirty=!0,t};Ct.min=function(t,e,r){return Y.min(t.array,e.array,r.array),t._dirty=!0,t};Ct.max=function(t,e,r){return Y.max(t.array,e.array,r.array),t._dirty=!0,t};Ct.mul=function(t,e,r){return Y.multiply(t.array,e.array,r.array),t._dirty=!0,t};Ct.multiply=Ct.mul;Ct.negate=function(t,e){return Y.negate(t.array,e.array),t._dirty=!0,t};Ct.normalize=function(t,e){return Y.normalize(t.array,e.array),t._dirty=!0,t};Ct.random=function(t,e){return Y.random(t.array,e),t._dirty=!0,t};Ct.scale=function(t,e,r){return Y.scale(t.array,e.array,r),t._dirty=!0,t};Ct.scaleAndAdd=function(t,e,r,i){return Y.scaleAndAdd(t.array,e.array,r.array,i),t._dirty=!0,t};Ct.sqrDist=function(t,e){return Y.sqrDist(t.array,e.array)};Ct.squaredDistance=Ct.sqrDist;Ct.sqrLen=function(t){return Y.sqrLen(t.array)};Ct.squaredLength=Ct.sqrLen;Ct.sub=function(t,e,r){return Y.subtract(t.array,e.array,r.array),t._dirty=!0,t};Ct.subtract=Ct.sub;Ct.transformMat4=function(t,e,r){return Y.transformMat4(t.array,e.array,r.array),t._dirty=!0,t};Ct.transformQuat=function(t,e,r){return Y.transformQuat(t.array,e.array,r.array),t._dirty=!0,t};const kF=Ct;var Oe={};Oe.create=function(){var t=new Ce(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t};Oe.clone=function(t){var e=new Ce(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e};Oe.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t};Oe.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t};Oe.transpose=function(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t};Oe.invert=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=r*a-n*i;return o?(o=1/o,t[0]=a*o,t[1]=-i*o,t[2]=-n*o,t[3]=r*o,t):null};Oe.adjoint=function(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t};Oe.determinant=function(t){return t[0]*t[3]-t[2]*t[1]};Oe.multiply=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=r[0],l=r[1],u=r[2],f=r[3];return t[0]=i*s+a*l,t[1]=n*s+o*l,t[2]=i*u+a*f,t[3]=n*u+o*f,t};Oe.mul=Oe.multiply;Oe.rotate=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=i*l+a*s,t[1]=n*l+o*s,t[2]=i*-s+a*l,t[3]=n*-s+o*l,t};Oe.scale=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=r[0],l=r[1];return t[0]=i*s,t[1]=n*s,t[2]=a*l,t[3]=o*l,t};Oe.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))};Oe.LDU=function(t,e,r,i){return t[2]=i[2]/i[0],r[0]=i[0],r[1]=i[1],r[3]=i[3]-t[2]*r[1],[t,e,r]};const ne=Oe;var Ye=function(){this.array=ne.create(),this._dirty=!0};Ye.prototype={constructor:Ye,setArray:function(t){for(var e=0;e<this.array.length;e++)this.array[e]=t[e];return this._dirty=!0,this},clone:function(){return new Ye().copy(this)},copy:function(t){return ne.copy(this.array,t.array),this._dirty=!0,this},adjoint:function(){return ne.adjoint(this.array,this.array),this._dirty=!0,this},determinant:function(){return ne.determinant(this.array)},identity:function(){return ne.identity(this.array),this._dirty=!0,this},invert:function(){return ne.invert(this.array,this.array),this._dirty=!0,this},mul:function(t){return ne.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return ne.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return ne.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return ne.multiply(this.array,t.array,this.array),this._dirty=!0,this},rotate:function(t){return ne.rotate(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return ne.scale(this.array,this.array,t.array),this._dirty=!0,this},transpose:function(){return ne.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};Ye.adjoint=function(t,e){return ne.adjoint(t.array,e.array),t._dirty=!0,t};Ye.copy=function(t,e){return ne.copy(t.array,e.array),t._dirty=!0,t};Ye.determinant=function(t){return ne.determinant(t.array)};Ye.identity=function(t){return ne.identity(t.array),t._dirty=!0,t};Ye.invert=function(t,e){return ne.invert(t.array,e.array),t._dirty=!0,t};Ye.mul=function(t,e,r){return ne.mul(t.array,e.array,r.array),t._dirty=!0,t};Ye.multiply=Ye.mul;Ye.rotate=function(t,e,r){return ne.rotate(t.array,e.array,r),t._dirty=!0,t};Ye.scale=function(t,e,r){return ne.scale(t.array,e.array,r.array),t._dirty=!0,t};Ye.transpose=function(t,e){return ne.transpose(t.array,e.array),t._dirty=!0,t};const zF=Ye;var ar={};ar.create=function(){var t=new Ce(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t};ar.clone=function(t){var e=new Ce(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e};ar.copy=function(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};ar.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t};ar.invert=function(t,e){var r=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=r*a-i*n;return l?(l=1/l,t[0]=a*l,t[1]=-i*l,t[2]=-n*l,t[3]=r*l,t[4]=(n*s-a*o)*l,t[5]=(i*o-r*s)*l,t):null};ar.determinant=function(t){return t[0]*t[3]-t[1]*t[2]};ar.multiply=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],f=r[1],h=r[2],v=r[3],c=r[4],d=r[5];return t[0]=i*u+a*f,t[1]=n*u+o*f,t[2]=i*h+a*v,t[3]=n*h+o*v,t[4]=i*c+a*d+s,t[5]=n*c+o*d+l,t};ar.mul=ar.multiply;ar.rotate=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=Math.sin(r),f=Math.cos(r);return t[0]=i*f+a*u,t[1]=n*f+o*u,t[2]=i*-u+a*f,t[3]=n*-u+o*f,t[4]=s,t[5]=l,t};ar.scale=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],f=r[1];return t[0]=i*u,t[1]=n*u,t[2]=a*f,t[3]=o*f,t[4]=s,t[5]=l,t};ar.translate=function(t,e,r){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=r[0],f=r[1];return t[0]=i,t[1]=n,t[2]=a,t[3]=o,t[4]=i*u+a*f+s,t[5]=n*u+o*f+l,t};ar.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)};const fe=ar;var rr=function(){this.array=fe.create(),this._dirty=!0};rr.prototype={constructor:rr,setArray:function(t){for(var e=0;e<this.array.length;e++)this.array[e]=t[e];return this._dirty=!0,this},clone:function(){return new rr().copy(this)},copy:function(t){return fe.copy(this.array,t.array),this._dirty=!0,this},determinant:function(){return fe.determinant(this.array)},identity:function(){return fe.identity(this.array),this._dirty=!0,this},invert:function(){return fe.invert(this.array,this.array),this._dirty=!0,this},mul:function(t){return fe.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return fe.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return fe.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return fe.multiply(this.array,t.array,this.array),this._dirty=!0,this},rotate:function(t){return fe.rotate(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return fe.scale(this.array,this.array,t.array),this._dirty=!0,this},translate:function(t){return fe.translate(this.array,this.array,t.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};rr.copy=function(t,e){return fe.copy(t.array,e.array),t._dirty=!0,t};rr.determinant=function(t){return fe.determinant(t.array)};rr.identity=function(t){return fe.identity(t.array),t._dirty=!0,t};rr.invert=function(t,e){return fe.invert(t.array,e.array),t._dirty=!0,t};rr.mul=function(t,e,r){return fe.mul(t.array,e.array,r.array),t._dirty=!0,t};rr.multiply=rr.mul;rr.rotate=function(t,e,r){return fe.rotate(t.array,e.array,r),t._dirty=!0,t};rr.scale=function(t,e,r){return fe.scale(t.array,e.array,r.array),t._dirty=!0,t};rr.translate=function(t,e,r){return fe.translate(t.array,e.array,r.array),t._dirty=!0,t};const UF=rr;var me=function(){this.array=St.create(),this._dirty=!0};me.prototype={constructor:me,setArray:function(t){for(var e=0;e<this.array.length;e++)this.array[e]=t[e];return this._dirty=!0,this},adjoint:function(){return St.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return new me().copy(this)},copy:function(t){return St.copy(this.array,t.array),this._dirty=!0,this},determinant:function(){return St.determinant(this.array)},fromMat2d:function(t){return St.fromMat2d(this.array,t.array),this._dirty=!0,this},fromMat4:function(t){return St.fromMat4(this.array,t.array),this._dirty=!0,this},fromQuat:function(t){return St.fromQuat(this.array,t.array),this._dirty=!0,this},identity:function(){return St.identity(this.array),this._dirty=!0,this},invert:function(){return St.invert(this.array,this.array),this._dirty=!0,this},mul:function(t){return St.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return St.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return St.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return St.multiply(this.array,t.array,this.array),this._dirty=!0,this},rotate:function(t){return St.rotate(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return St.scale(this.array,this.array,t.array),this._dirty=!0,this},translate:function(t){return St.translate(this.array,this.array,t.array),this._dirty=!0,this},normalFromMat4:function(t){return St.normalFromMat4(this.array,t.array),this._dirty=!0,this},transpose:function(){return St.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};me.adjoint=function(t,e){return St.adjoint(t.array,e.array),t._dirty=!0,t};me.copy=function(t,e){return St.copy(t.array,e.array),t._dirty=!0,t};me.determinant=function(t){return St.determinant(t.array)};me.identity=function(t){return St.identity(t.array),t._dirty=!0,t};me.invert=function(t,e){return St.invert(t.array,e.array),t};me.mul=function(t,e,r){return St.mul(t.array,e.array,r.array),t._dirty=!0,t};me.multiply=me.mul;me.fromMat2d=function(t,e){return St.fromMat2d(t.array,e.array),t._dirty=!0,t};me.fromMat4=function(t,e){return St.fromMat4(t.array,e.array),t._dirty=!0,t};me.fromQuat=function(t,e){return St.fromQuat(t.array,e.array),t._dirty=!0,t};me.normalFromMat4=function(t,e){return St.normalFromMat4(t.array,e.array),t._dirty=!0,t};me.rotate=function(t,e,r){return St.rotate(t.array,e.array,r),t._dirty=!0,t};me.scale=function(t,e,r){return St.scale(t.array,e.array,r.array),t._dirty=!0,t};me.transpose=function(t,e){return St.transpose(t.array,e.array),t._dirty=!0,t};me.translate=function(t,e,r){return St.translate(t.array,e.array,r.array),t._dirty=!0,t};const HF=me;var VF={_animators:null,getAnimators:function(){return this._animators=this._animators||[],this._animators},animate:function(t,e){this._animators=this._animators||[];var r=this,i;if(t){for(var n=t.split("."),a=r,o=0,s=n.length;o<s;o++)a&&(a=a[n[o]]);a&&(i=a)}else i=r;if(i==null)throw new Error("Target "+t+" not exists");var l=this._animators,u=new Vf(i,e),f=this;return u.during(function(){f.__zr&&f.__zr.refresh()}).done(function(){var h=l.indexOf(u);h>=0&&l.splice(h,1)}),l.push(u),this.__zr&&this.__zr.animation.addAnimator(u),u},stopAnimation:function(t){this._animators=this._animators||[];for(var e=this._animators,r=e.length,i=0;i<r;i++)e[i].stop(t);return e.length=0,this},addAnimatorsToZr:function(t){if(this._animators)for(var e=0;e<this._animators.length;e++)t.animation.addAnimator(this._animators[e])},removeAnimatorsFromZr:function(t){if(this._animators)for(var e=0;e<this._animators.length;e++)t.animation.removeAnimator(this._animators[e])}};const GF=VF,WF=`
@export clay.util.rand
highp float rand(vec2 uv) {
 const highp float a = 12.9898, b = 78.233, c = 43758.5453;
 highp float dt = dot(uv.xy, vec2(a,b)), sn = mod(dt, 3.141592653589793);
 return fract(sin(sn) * c);
}
@end
@export clay.util.calculate_attenuation
uniform float attenuationFactor : 5.0;
float lightAttenuation(float dist, float range)
{
 float attenuation = 1.0;
 attenuation = dist*dist/(range*range+1.0);
 float att_s = attenuationFactor;
 attenuation = 1.0/(attenuation*att_s+1.0);
 att_s = 1.0/(att_s+1.0);
 attenuation = attenuation - att_s;
 attenuation /= 1.0 - att_s;
 return clamp(attenuation, 0.0, 1.0);
}
@end
@export clay.util.edge_factor
#ifdef SUPPORT_STANDARD_DERIVATIVES
float edgeFactor(float width)
{
 vec3 d = fwidth(v_Barycentric);
 vec3 a3 = smoothstep(vec3(0.0), d * width, v_Barycentric);
 return min(min(a3.x, a3.y), a3.z);
}
#else
float edgeFactor(float width)
{
 return 1.0;
}
#endif
@end
@export clay.util.encode_float
vec4 encodeFloat(const in float depth)
{
 const vec4 bitShifts = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);
 const vec4 bit_mask = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);
 vec4 res = fract(depth * bitShifts);
 res -= res.xxyz * bit_mask;
 return res;
}
@end
@export clay.util.decode_float
float decodeFloat(const in vec4 color)
{
 const vec4 bitShifts = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);
 return dot(color, bitShifts);
}
@end
@export clay.util.float
@import clay.util.encode_float
@import clay.util.decode_float
@end
@export clay.util.rgbm_decode
vec3 RGBMDecode(vec4 rgbm, float range) {
 return range * rgbm.rgb * rgbm.a;
}
@end
@export clay.util.rgbm_encode
vec4 RGBMEncode(vec3 color, float range) {
 if (dot(color, color) == 0.0) {
 return vec4(0.0);
 }
 vec4 rgbm;
 color /= range;
 rgbm.a = clamp(max(max(color.r, color.g), max(color.b, 1e-6)), 0.0, 1.0);
 rgbm.a = ceil(rgbm.a * 255.0) / 255.0;
 rgbm.rgb = color / rgbm.a;
 return rgbm;
}
@end
@export clay.util.rgbm
@import clay.util.rgbm_decode
@import clay.util.rgbm_encode
vec4 decodeHDR(vec4 color)
{
#if defined(RGBM_DECODE) || defined(RGBM)
 return vec4(RGBMDecode(color, 8.12), 1.0);
#else
 return color;
#endif
}
vec4 encodeHDR(vec4 color)
{
#if defined(RGBM_ENCODE) || defined(RGBM)
 return RGBMEncode(color.xyz, 8.12);
#else
 return color;
#endif
}
@end
@export clay.util.srgb
vec4 sRGBToLinear(in vec4 value) {
 return vec4(mix(pow(value.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), value.rgb * 0.0773993808, vec3(lessThanEqual(value.rgb, vec3(0.04045)))), value.w);
}
vec4 linearTosRGB(in vec4 value) {
 return vec4(mix(pow(value.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), value.rgb * 12.92, vec3(lessThanEqual(value.rgb, vec3(0.0031308)))), value.w);
}
@end
@export clay.chunk.skinning_header
#ifdef SKINNING
attribute vec3 weight : WEIGHT;
attribute vec4 joint : JOINT;
#ifdef USE_SKIN_MATRICES_TEXTURE
uniform sampler2D skinMatricesTexture : ignore;
uniform float skinMatricesTextureSize: ignore;
mat4 getSkinMatrix(sampler2D tex, float idx) {
 float j = idx * 4.0;
 float x = mod(j, skinMatricesTextureSize);
 float y = floor(j / skinMatricesTextureSize) + 0.5;
 vec2 scale = vec2(skinMatricesTextureSize);
 return mat4(
 texture2D(tex, vec2(x + 0.5, y) / scale),
 texture2D(tex, vec2(x + 1.5, y) / scale),
 texture2D(tex, vec2(x + 2.5, y) / scale),
 texture2D(tex, vec2(x + 3.5, y) / scale)
 );
}
mat4 getSkinMatrix(float idx) {
 return getSkinMatrix(skinMatricesTexture, idx);
}
#else
uniform mat4 skinMatrix[JOINT_COUNT] : SKIN_MATRIX;
mat4 getSkinMatrix(float idx) {
 return skinMatrix[int(idx)];
}
#endif
#endif
@end
@export clay.chunk.skin_matrix
mat4 skinMatrixWS = getSkinMatrix(joint.x) * weight.x;
if (weight.y > 1e-4)
{
 skinMatrixWS += getSkinMatrix(joint.y) * weight.y;
}
if (weight.z > 1e-4)
{
 skinMatrixWS += getSkinMatrix(joint.z) * weight.z;
}
float weightW = 1.0-weight.x-weight.y-weight.z;
if (weightW > 1e-4)
{
 skinMatrixWS += getSkinMatrix(joint.w) * weightW;
}
@end
@export clay.chunk.instancing_header
#ifdef INSTANCING
attribute vec4 instanceMat1;
attribute vec4 instanceMat2;
attribute vec4 instanceMat3;
#endif
@end
@export clay.chunk.instancing_matrix
mat4 instanceMat = mat4(
 vec4(instanceMat1.xyz, 0.0),
 vec4(instanceMat2.xyz, 0.0),
 vec4(instanceMat3.xyz, 0.0),
 vec4(instanceMat1.w, instanceMat2.w, instanceMat3.w, 1.0)
);
@end
@export clay.util.parallax_correct
vec3 parallaxCorrect(in vec3 dir, in vec3 pos, in vec3 boxMin, in vec3 boxMax) {
 vec3 first = (boxMax - pos) / dir;
 vec3 second = (boxMin - pos) / dir;
 vec3 further = max(first, second);
 float dist = min(further.x, min(further.y, further.z));
 vec3 fixedPos = pos + dir * dist;
 vec3 boxCenter = (boxMax + boxMin) * 0.5;
 return normalize(fixedPos - boxCenter);
}
@end
@export clay.util.clamp_sample
vec4 clampSample(const in sampler2D texture, const in vec2 coord)
{
#ifdef STEREO
 float eye = step(0.5, coord.x) * 0.5;
 vec2 coordClamped = clamp(coord, vec2(eye, 0.0), vec2(0.5 + eye, 1.0));
#else
 vec2 coordClamped = clamp(coord, vec2(0.0), vec2(1.0));
#endif
 return texture2D(texture, coordClamped);
}
@end
@export clay.util.ACES
vec3 ACESToneMapping(vec3 color)
{
 const float A = 2.51;
 const float B = 0.03;
 const float C = 2.43;
 const float D = 0.59;
 const float E = 0.14;
 return (color * (A * color + B)) / (color * (C * color + D) + E);
}
@end`,XF=`
@export ecgl.common.transformUniforms
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
uniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;
uniform mat4 world : WORLD;
@end

@export ecgl.common.attributes
attribute vec3 position : POSITION;
attribute vec2 texcoord : TEXCOORD_0;
attribute vec3 normal : NORMAL;
@end

@export ecgl.common.uv.header
uniform vec2 uvRepeat : [1.0, 1.0];
uniform vec2 uvOffset : [0.0, 0.0];
uniform vec2 detailUvRepeat : [1.0, 1.0];
uniform vec2 detailUvOffset : [0.0, 0.0];

varying vec2 v_Texcoord;
varying vec2 v_DetailTexcoord;
@end

@export ecgl.common.uv.main
v_Texcoord = texcoord * uvRepeat + uvOffset;
v_DetailTexcoord = texcoord * detailUvRepeat + detailUvOffset;
@end

@export ecgl.common.uv.fragmentHeader
varying vec2 v_Texcoord;
varying vec2 v_DetailTexcoord;
@end


@export ecgl.common.albedo.main

 vec4 albedoTexel = vec4(1.0);
#ifdef DIFFUSEMAP_ENABLED
 albedoTexel = texture2D(diffuseMap, v_Texcoord);
 #ifdef SRGB_DECODE
 albedoTexel = sRGBToLinear(albedoTexel);
 #endif
#endif

#ifdef DETAILMAP_ENABLED
 vec4 detailTexel = texture2D(detailMap, v_DetailTexcoord);
 #ifdef SRGB_DECODE
 detailTexel = sRGBToLinear(detailTexel);
 #endif
 albedoTexel.rgb = mix(albedoTexel.rgb, detailTexel.rgb, detailTexel.a);
 albedoTexel.a = detailTexel.a + (1.0 - detailTexel.a) * albedoTexel.a;
#endif

@end

@export ecgl.common.wireframe.vertexHeader

#ifdef WIREFRAME_QUAD
attribute vec4 barycentric;
varying vec4 v_Barycentric;
#elif defined(WIREFRAME_TRIANGLE)
attribute vec3 barycentric;
varying vec3 v_Barycentric;
#endif

@end

@export ecgl.common.wireframe.vertexMain

#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)
 v_Barycentric = barycentric;
#endif

@end


@export ecgl.common.wireframe.fragmentHeader

uniform float wireframeLineWidth : 1;
uniform vec4 wireframeLineColor: [0, 0, 0, 0.5];

#ifdef WIREFRAME_QUAD
varying vec4 v_Barycentric;
float edgeFactor () {
 vec4 d = fwidth(v_Barycentric);
 vec4 a4 = smoothstep(vec4(0.0), d * wireframeLineWidth, v_Barycentric);
 return min(min(min(a4.x, a4.y), a4.z), a4.w);
}
#elif defined(WIREFRAME_TRIANGLE)
varying vec3 v_Barycentric;
float edgeFactor () {
 vec3 d = fwidth(v_Barycentric);
 vec3 a3 = smoothstep(vec3(0.0), d * wireframeLineWidth, v_Barycentric);
 return min(min(a3.x, a3.y), a3.z);
}
#endif

@end


@export ecgl.common.wireframe.fragmentMain

#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)
 if (wireframeLineWidth > 0.) {
 vec4 lineColor = wireframeLineColor;
#ifdef SRGB_DECODE
 lineColor = sRGBToLinear(lineColor);
#endif

 gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor()) * lineColor.a);
 }
#endif
@end




@export ecgl.common.bumpMap.header

#ifdef BUMPMAP_ENABLED
uniform sampler2D bumpMap;
uniform float bumpScale : 1.0;


vec3 bumpNormal(vec3 surfPos, vec3 surfNormal, vec3 baseNormal)
{
 vec2 dSTdx = dFdx(v_Texcoord);
 vec2 dSTdy = dFdy(v_Texcoord);

 float Hll = bumpScale * texture2D(bumpMap, v_Texcoord).x;
 float dHx = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdx).x - Hll;
 float dHy = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdy).x - Hll;

 vec3 vSigmaX = dFdx(surfPos);
 vec3 vSigmaY = dFdy(surfPos);
 vec3 vN = surfNormal;

 vec3 R1 = cross(vSigmaY, vN);
 vec3 R2 = cross(vN, vSigmaX);

 float fDet = dot(vSigmaX, R1);

 vec3 vGrad = sign(fDet) * (dHx * R1 + dHy * R2);
 return normalize(abs(fDet) * baseNormal - vGrad);

}
#endif

@end

@export ecgl.common.normalMap.vertexHeader

#ifdef NORMALMAP_ENABLED
attribute vec4 tangent : TANGENT;
varying vec3 v_Tangent;
varying vec3 v_Bitangent;
#endif

@end

@export ecgl.common.normalMap.vertexMain

#ifdef NORMALMAP_ENABLED
 if (dot(tangent, tangent) > 0.0) {
 v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);
 v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);
 }
#endif

@end


@export ecgl.common.normalMap.fragmentHeader

#ifdef NORMALMAP_ENABLED
uniform sampler2D normalMap;
varying vec3 v_Tangent;
varying vec3 v_Bitangent;
#endif

@end

@export ecgl.common.normalMap.fragmentMain
#ifdef NORMALMAP_ENABLED
 if (dot(v_Tangent, v_Tangent) > 0.0) {
 vec3 normalTexel = texture2D(normalMap, v_DetailTexcoord).xyz;
 if (dot(normalTexel, normalTexel) > 0.0) { N = normalTexel * 2.0 - 1.0;
 mat3 tbn = mat3(v_Tangent, v_Bitangent, v_Normal);
 N = normalize(tbn * N);
 }
 }
#endif
@end



@export ecgl.common.vertexAnimation.header

#ifdef VERTEX_ANIMATION
attribute vec3 prevPosition;
attribute vec3 prevNormal;
uniform float percent;
#endif

@end

@export ecgl.common.vertexAnimation.main

#ifdef VERTEX_ANIMATION
 vec3 pos = mix(prevPosition, position, percent);
 vec3 norm = mix(prevNormal, normal, percent);
#else
 vec3 pos = position;
 vec3 norm = normal;
#endif

@end


@export ecgl.common.ssaoMap.header
#ifdef SSAOMAP_ENABLED
uniform sampler2D ssaoMap;
uniform vec4 viewport : VIEWPORT;
#endif
@end

@export ecgl.common.ssaoMap.main
 float ao = 1.0;
#ifdef SSAOMAP_ENABLED
 ao = texture2D(ssaoMap, (gl_FragCoord.xy - viewport.xy) / viewport.zw).r;
#endif
@end




@export ecgl.common.diffuseLayer.header

#if (LAYER_DIFFUSEMAP_COUNT > 0)
uniform float layerDiffuseIntensity[LAYER_DIFFUSEMAP_COUNT];
uniform sampler2D layerDiffuseMap[LAYER_DIFFUSEMAP_COUNT];
#endif

@end

@export ecgl.common.emissiveLayer.header

#if (LAYER_EMISSIVEMAP_COUNT > 0)
uniform float layerEmissionIntensity[LAYER_EMISSIVEMAP_COUNT];
uniform sampler2D layerEmissiveMap[LAYER_EMISSIVEMAP_COUNT];
#endif

@end

@export ecgl.common.layers.header
@import ecgl.common.diffuseLayer.header
@import ecgl.common.emissiveLayer.header
@end

@export ecgl.common.diffuseLayer.main

#if (LAYER_DIFFUSEMAP_COUNT > 0)
 for (int _idx_ = 0; _idx_ < LAYER_DIFFUSEMAP_COUNT; _idx_++) {{
 float intensity = layerDiffuseIntensity[_idx_];
 vec4 texel2 = texture2D(layerDiffuseMap[_idx_], v_Texcoord);
 #ifdef SRGB_DECODE
 texel2 = sRGBToLinear(texel2);
 #endif
 albedoTexel.rgb = mix(albedoTexel.rgb, texel2.rgb * intensity, texel2.a);
 albedoTexel.a = texel2.a + (1.0 - texel2.a) * albedoTexel.a;
 }}
#endif

@end

@export ecgl.common.emissiveLayer.main

#if (LAYER_EMISSIVEMAP_COUNT > 0)
 for (int _idx_ = 0; _idx_ < LAYER_EMISSIVEMAP_COUNT; _idx_++)
 {{
 vec4 texel2 = texture2D(layerEmissiveMap[_idx_], v_Texcoord) * layerEmissionIntensity[_idx_];
 #ifdef SRGB_DECODE
 texel2 = sRGBToLinear(texel2);
 #endif
 float intensity = layerEmissionIntensity[_idx_];
 gl_FragColor.rgb += texel2.rgb * texel2.a * intensity;
 }}
#endif

@end
`,YF=`@export ecgl.color.vertex

uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;

@import ecgl.common.uv.header

attribute vec2 texcoord : TEXCOORD_0;
attribute vec3 position: POSITION;

@import ecgl.common.wireframe.vertexHeader

#ifdef VERTEX_COLOR
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;
#endif

#ifdef VERTEX_ANIMATION
attribute vec3 prevPosition;
uniform float percent : 1.0;
#endif

#ifdef ATMOSPHERE_ENABLED
attribute vec3 normal: NORMAL;
uniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;
varying vec3 v_Normal;
#endif

void main()
{
#ifdef VERTEX_ANIMATION
 vec3 pos = mix(prevPosition, position, percent);
#else
 vec3 pos = position;
#endif

 gl_Position = worldViewProjection * vec4(pos, 1.0);

 @import ecgl.common.uv.main

#ifdef VERTEX_COLOR
 v_Color = a_Color;
#endif

#ifdef ATMOSPHERE_ENABLED
 v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);
#endif

 @import ecgl.common.wireframe.vertexMain

}

@end

@export ecgl.color.fragment

#define LAYER_DIFFUSEMAP_COUNT 0
#define LAYER_EMISSIVEMAP_COUNT 0

uniform sampler2D diffuseMap;
uniform sampler2D detailMap;

uniform vec4 color : [1.0, 1.0, 1.0, 1.0];

#ifdef ATMOSPHERE_ENABLED
uniform mat4 viewTranspose: VIEWTRANSPOSE;
uniform vec3 glowColor;
uniform float glowPower;
varying vec3 v_Normal;
#endif

#ifdef VERTEX_COLOR
varying vec4 v_Color;
#endif

@import ecgl.common.layers.header

@import ecgl.common.uv.fragmentHeader

@import ecgl.common.wireframe.fragmentHeader

@import clay.util.srgb

void main()
{
#ifdef SRGB_DECODE
 gl_FragColor = sRGBToLinear(color);
#else
 gl_FragColor = color;
#endif

#ifdef VERTEX_COLOR
 gl_FragColor *= v_Color;
#endif

 @import ecgl.common.albedo.main

 @import ecgl.common.diffuseLayer.main

 gl_FragColor *= albedoTexel;

#ifdef ATMOSPHERE_ENABLED
 float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);
 gl_FragColor.rgb += glowColor * atmoIntensity;
#endif

 @import ecgl.common.emissiveLayer.main

 @import ecgl.common.wireframe.fragmentMain

}
@end`,$F=`/**
 * http: */

@export ecgl.lambert.vertex

@import ecgl.common.transformUniforms

@import ecgl.common.uv.header


@import ecgl.common.attributes

@import ecgl.common.wireframe.vertexHeader

#ifdef VERTEX_COLOR
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;
#endif


@import ecgl.common.vertexAnimation.header


varying vec3 v_Normal;
varying vec3 v_WorldPosition;

void main()
{
 @import ecgl.common.uv.main

 @import ecgl.common.vertexAnimation.main


 gl_Position = worldViewProjection * vec4(pos, 1.0);

 v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);
 v_WorldPosition = (world * vec4(pos, 1.0)).xyz;

#ifdef VERTEX_COLOR
 v_Color = a_Color;
#endif

 @import ecgl.common.wireframe.vertexMain
}

@end


@export ecgl.lambert.fragment

#define LAYER_DIFFUSEMAP_COUNT 0
#define LAYER_EMISSIVEMAP_COUNT 0

#define NORMAL_UP_AXIS 1
#define NORMAL_FRONT_AXIS 2

@import ecgl.common.uv.fragmentHeader

varying vec3 v_Normal;
varying vec3 v_WorldPosition;

uniform sampler2D diffuseMap;
uniform sampler2D detailMap;

@import ecgl.common.layers.header

uniform float emissionIntensity: 1.0;

uniform vec4 color : [1.0, 1.0, 1.0, 1.0];

uniform mat4 viewInverse : VIEWINVERSE;

#ifdef ATMOSPHERE_ENABLED
uniform mat4 viewTranspose: VIEWTRANSPOSE;
uniform vec3 glowColor;
uniform float glowPower;
#endif

#ifdef AMBIENT_LIGHT_COUNT
@import clay.header.ambient_light
#endif
#ifdef AMBIENT_SH_LIGHT_COUNT
@import clay.header.ambient_sh_light
#endif

#ifdef DIRECTIONAL_LIGHT_COUNT
@import clay.header.directional_light
#endif

#ifdef VERTEX_COLOR
varying vec4 v_Color;
#endif


@import ecgl.common.ssaoMap.header

@import ecgl.common.bumpMap.header

@import clay.util.srgb

@import ecgl.common.wireframe.fragmentHeader

@import clay.plugin.compute_shadow_map

void main()
{
#ifdef SRGB_DECODE
 gl_FragColor = sRGBToLinear(color);
#else
 gl_FragColor = color;
#endif

#ifdef VERTEX_COLOR
 #ifdef SRGB_DECODE
 gl_FragColor *= sRGBToLinear(v_Color);
 #else
 gl_FragColor *= v_Color;
 #endif
#endif

 @import ecgl.common.albedo.main

 @import ecgl.common.diffuseLayer.main

 gl_FragColor *= albedoTexel;

 vec3 N = v_Normal;
#ifdef DOUBLE_SIDED
 vec3 eyePos = viewInverse[3].xyz;
 vec3 V = normalize(eyePos - v_WorldPosition);

 if (dot(N, V) < 0.0) {
 N = -N;
 }
#endif

 float ambientFactor = 1.0;

#ifdef BUMPMAP_ENABLED
 N = bumpNormal(v_WorldPosition, v_Normal, N);
 ambientFactor = dot(v_Normal, N);
#endif

 vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);

 vec3 diffuseColor = vec3(0.0, 0.0, 0.0);

 @import ecgl.common.ssaoMap.main

#ifdef AMBIENT_LIGHT_COUNT
 for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)
 {
 diffuseColor += ambientLightColor[i] * ambientFactor * ao;
 }
#endif
#ifdef AMBIENT_SH_LIGHT_COUNT
 for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)
 {{
 diffuseColor += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;
 }}
#endif
#ifdef DIRECTIONAL_LIGHT_COUNT
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
 float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];
 if(shadowEnabled)
 {
 computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);
 }
#endif
 for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)
 {
 vec3 lightDirection = -directionalLightDirection[i];
 vec3 lightColor = directionalLightColor[i];

 float shadowContrib = 1.0;
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
 if (shadowEnabled)
 {
 shadowContrib = shadowContribsDir[i];
 }
#endif

 float ndl = dot(N, normalize(lightDirection)) * shadowContrib;

 diffuseColor += lightColor * clamp(ndl, 0.0, 1.0);
 }
#endif

 gl_FragColor.rgb *= diffuseColor;

#ifdef ATMOSPHERE_ENABLED
 float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);
 gl_FragColor.rgb += glowColor * atmoIntensity;
#endif

 @import ecgl.common.emissiveLayer.main

 @import ecgl.common.wireframe.fragmentMain
}

@end`,ZF=`@export ecgl.realistic.vertex

@import ecgl.common.transformUniforms

@import ecgl.common.uv.header

@import ecgl.common.attributes


@import ecgl.common.wireframe.vertexHeader

#ifdef VERTEX_COLOR
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;
#endif

#ifdef NORMALMAP_ENABLED
attribute vec4 tangent : TANGENT;
varying vec3 v_Tangent;
varying vec3 v_Bitangent;
#endif

@import ecgl.common.vertexAnimation.header

varying vec3 v_Normal;
varying vec3 v_WorldPosition;

void main()
{

 @import ecgl.common.uv.main

 @import ecgl.common.vertexAnimation.main

 gl_Position = worldViewProjection * vec4(pos, 1.0);

 v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);
 v_WorldPosition = (world * vec4(pos, 1.0)).xyz;

#ifdef VERTEX_COLOR
 v_Color = a_Color;
#endif

#ifdef NORMALMAP_ENABLED
 v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);
 v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);
#endif

 @import ecgl.common.wireframe.vertexMain

}

@end



@export ecgl.realistic.fragment

#define LAYER_DIFFUSEMAP_COUNT 0
#define LAYER_EMISSIVEMAP_COUNT 0
#define PI 3.14159265358979
#define ROUGHNESS_CHANEL 0
#define METALNESS_CHANEL 1

#define NORMAL_UP_AXIS 1
#define NORMAL_FRONT_AXIS 2

#ifdef VERTEX_COLOR
varying vec4 v_Color;
#endif

@import ecgl.common.uv.fragmentHeader

varying vec3 v_Normal;
varying vec3 v_WorldPosition;

uniform sampler2D diffuseMap;

uniform sampler2D detailMap;
uniform sampler2D metalnessMap;
uniform sampler2D roughnessMap;

@import ecgl.common.layers.header

uniform float emissionIntensity: 1.0;

uniform vec4 color : [1.0, 1.0, 1.0, 1.0];

uniform float metalness : 0.0;
uniform float roughness : 0.5;

uniform mat4 viewInverse : VIEWINVERSE;

#ifdef ATMOSPHERE_ENABLED
uniform mat4 viewTranspose: VIEWTRANSPOSE;
uniform vec3 glowColor;
uniform float glowPower;
#endif

#ifdef AMBIENT_LIGHT_COUNT
@import clay.header.ambient_light
#endif

#ifdef AMBIENT_SH_LIGHT_COUNT
@import clay.header.ambient_sh_light
#endif

#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT
@import clay.header.ambient_cubemap_light
#endif

#ifdef DIRECTIONAL_LIGHT_COUNT
@import clay.header.directional_light
#endif

@import ecgl.common.normalMap.fragmentHeader

@import ecgl.common.ssaoMap.header

@import ecgl.common.bumpMap.header

@import clay.util.srgb

@import clay.util.rgbm

@import ecgl.common.wireframe.fragmentHeader

@import clay.plugin.compute_shadow_map

vec3 F_Schlick(float ndv, vec3 spec) {
 return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);
}

float D_Phong(float g, float ndh) {
 float a = pow(8192.0, g);
 return (a + 2.0) / 8.0 * pow(ndh, a);
}

void main()
{
 vec4 albedoColor = color;

 vec3 eyePos = viewInverse[3].xyz;
 vec3 V = normalize(eyePos - v_WorldPosition);
#ifdef VERTEX_COLOR
 #ifdef SRGB_DECODE
 albedoColor *= sRGBToLinear(v_Color);
 #else
 albedoColor *= v_Color;
 #endif
#endif

 @import ecgl.common.albedo.main

 @import ecgl.common.diffuseLayer.main

 albedoColor *= albedoTexel;

 float m = metalness;

#ifdef METALNESSMAP_ENABLED
 float m2 = texture2D(metalnessMap, v_DetailTexcoord)[METALNESS_CHANEL];
 m = clamp(m2 + (m - 0.5) * 2.0, 0.0, 1.0);
#endif

 vec3 baseColor = albedoColor.rgb;
 albedoColor.rgb = baseColor * (1.0 - m);
 vec3 specFactor = mix(vec3(0.04), baseColor, m);

 float g = 1.0 - roughness;

#ifdef ROUGHNESSMAP_ENABLED
 float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];
 g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);
#endif

 vec3 N = v_Normal;

#ifdef DOUBLE_SIDED
 if (dot(N, V) < 0.0) {
 N = -N;
 }
#endif

 float ambientFactor = 1.0;

#ifdef BUMPMAP_ENABLED
 N = bumpNormal(v_WorldPosition, v_Normal, N);
 ambientFactor = dot(v_Normal, N);
#endif

@import ecgl.common.normalMap.fragmentMain

 vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);

 vec3 diffuseTerm = vec3(0.0);
 vec3 specularTerm = vec3(0.0);

 float ndv = clamp(dot(N, V), 0.0, 1.0);
 vec3 fresnelTerm = F_Schlick(ndv, specFactor);

 @import ecgl.common.ssaoMap.main

#ifdef AMBIENT_LIGHT_COUNT
 for(int _idx_ = 0; _idx_ < AMBIENT_LIGHT_COUNT; _idx_++)
 {{
 diffuseTerm += ambientLightColor[_idx_] * ambientFactor * ao;
 }}
#endif

#ifdef AMBIENT_SH_LIGHT_COUNT
 for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)
 {{
 diffuseTerm += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;
 }}
#endif

#ifdef DIRECTIONAL_LIGHT_COUNT
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
 float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];
 if(shadowEnabled)
 {
 computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);
 }
#endif
 for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++)
 {{
 vec3 L = -directionalLightDirection[_idx_];
 vec3 lc = directionalLightColor[_idx_];

 vec3 H = normalize(L + V);
 float ndl = clamp(dot(N, normalize(L)), 0.0, 1.0);
 float ndh = clamp(dot(N, H), 0.0, 1.0);

 float shadowContrib = 1.0;
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
 if (shadowEnabled)
 {
 shadowContrib = shadowContribsDir[_idx_];
 }
#endif

 vec3 li = lc * ndl * shadowContrib;

 diffuseTerm += li;
 specularTerm += li * fresnelTerm * D_Phong(g, ndh);
 }}
#endif


#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT
 vec3 L = reflect(-V, N);
 L = vec3(L.x, L[NORMAL_UP_AXIS], L[NORMAL_FRONT_AXIS]);
 float rough2 = clamp(1.0 - g, 0.0, 1.0);
 float bias2 = rough2 * 5.0;
 vec2 brdfParam2 = texture2D(ambientCubemapLightBRDFLookup[0], vec2(rough2, ndv)).xy;
 vec3 envWeight2 = specFactor * brdfParam2.x + brdfParam2.y;
 vec3 envTexel2;
 for(int _idx_ = 0; _idx_ < AMBIENT_CUBEMAP_LIGHT_COUNT; _idx_++)
 {{
 envTexel2 = RGBMDecode(textureCubeLodEXT(ambientCubemapLightCubemap[_idx_], L, bias2), 8.12);
 specularTerm += ambientCubemapLightColor[_idx_] * envTexel2 * envWeight2 * ao;
 }}
#endif

 gl_FragColor.rgb = albedoColor.rgb * diffuseTerm + specularTerm;
 gl_FragColor.a = albedoColor.a;

#ifdef ATMOSPHERE_ENABLED
 float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);
 gl_FragColor.rgb += glowColor * atmoIntensity;
#endif

#ifdef SRGB_ENCODE
 gl_FragColor = linearTosRGB(gl_FragColor);
#endif

 @import ecgl.common.emissiveLayer.main

 @import ecgl.common.wireframe.fragmentMain
}

@end`,qF=`@export ecgl.hatching.vertex

@import ecgl.realistic.vertex

@end


@export ecgl.hatching.fragment

#define NORMAL_UP_AXIS 1
#define NORMAL_FRONT_AXIS 2

@import ecgl.common.uv.fragmentHeader

varying vec3 v_Normal;
varying vec3 v_WorldPosition;

uniform vec4 color : [0.0, 0.0, 0.0, 1.0];
uniform vec4 paperColor : [1.0, 1.0, 1.0, 1.0];

uniform mat4 viewInverse : VIEWINVERSE;

#ifdef AMBIENT_LIGHT_COUNT
@import clay.header.ambient_light
#endif
#ifdef AMBIENT_SH_LIGHT_COUNT
@import clay.header.ambient_sh_light
#endif

#ifdef DIRECTIONAL_LIGHT_COUNT
@import clay.header.directional_light
#endif

#ifdef VERTEX_COLOR
varying vec4 v_Color;
#endif


@import ecgl.common.ssaoMap.header

@import ecgl.common.bumpMap.header

@import clay.util.srgb

@import ecgl.common.wireframe.fragmentHeader

@import clay.plugin.compute_shadow_map

uniform sampler2D hatch1;
uniform sampler2D hatch2;
uniform sampler2D hatch3;
uniform sampler2D hatch4;
uniform sampler2D hatch5;
uniform sampler2D hatch6;

float shade(in float tone) {
 vec4 c = vec4(1. ,1., 1., 1.);
 float step = 1. / 6.;
 vec2 uv = v_DetailTexcoord;
 if (tone <= step / 2.0) {
 c = mix(vec4(0.), texture2D(hatch6, uv), 12. * tone);
 }
 else if (tone <= step) {
 c = mix(texture2D(hatch6, uv), texture2D(hatch5, uv), 6. * tone);
 }
 if(tone > step && tone <= 2. * step){
 c = mix(texture2D(hatch5, uv), texture2D(hatch4, uv) , 6. * (tone - step));
 }
 if(tone > 2. * step && tone <= 3. * step){
 c = mix(texture2D(hatch4, uv), texture2D(hatch3, uv), 6. * (tone - 2. * step));
 }
 if(tone > 3. * step && tone <= 4. * step){
 c = mix(texture2D(hatch3, uv), texture2D(hatch2, uv), 6. * (tone - 3. * step));
 }
 if(tone > 4. * step && tone <= 5. * step){
 c = mix(texture2D(hatch2, uv), texture2D(hatch1, uv), 6. * (tone - 4. * step));
 }
 if(tone > 5. * step){
 c = mix(texture2D(hatch1, uv), vec4(1.), 6. * (tone - 5. * step));
 }

 return c.r;
}

const vec3 w = vec3(0.2125, 0.7154, 0.0721);

void main()
{
#ifdef SRGB_DECODE
 vec4 inkColor = sRGBToLinear(color);
#else
 vec4 inkColor = color;
#endif

#ifdef VERTEX_COLOR
 #ifdef SRGB_DECODE
 inkColor *= sRGBToLinear(v_Color);
 #else
 inkColor *= v_Color;
 #endif
#endif

 vec3 N = v_Normal;
#ifdef DOUBLE_SIDED
 vec3 eyePos = viewInverse[3].xyz;
 vec3 V = normalize(eyePos - v_WorldPosition);

 if (dot(N, V) < 0.0) {
 N = -N;
 }
#endif

 float tone = 0.0;

 float ambientFactor = 1.0;

#ifdef BUMPMAP_ENABLED
 N = bumpNormal(v_WorldPosition, v_Normal, N);
 ambientFactor = dot(v_Normal, N);
#endif

 vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);

 @import ecgl.common.ssaoMap.main

#ifdef AMBIENT_LIGHT_COUNT
 for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)
 {
 tone += dot(ambientLightColor[i], w) * ambientFactor * ao;
 }
#endif
#ifdef AMBIENT_SH_LIGHT_COUNT
 for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)
 {{
 tone += dot(calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_], w) * ao;
 }}
#endif
#ifdef DIRECTIONAL_LIGHT_COUNT
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
 float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];
 if(shadowEnabled)
 {
 computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);
 }
#endif
 for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)
 {
 vec3 lightDirection = -directionalLightDirection[i];
 float lightTone = dot(directionalLightColor[i], w);

 float shadowContrib = 1.0;
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
 if (shadowEnabled)
 {
 shadowContrib = shadowContribsDir[i];
 }
#endif

 float ndl = dot(N, normalize(lightDirection)) * shadowContrib;

 tone += lightTone * clamp(ndl, 0.0, 1.0);
 }
#endif

 gl_FragColor = mix(inkColor, paperColor, shade(clamp(tone, 0.0, 1.0)));
 }
@end
`,KF=`@export ecgl.sm.depth.vertex

uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;

attribute vec3 position : POSITION;
attribute vec2 texcoord : TEXCOORD_0;

#ifdef VERTEX_ANIMATION
attribute vec3 prevPosition;
uniform float percent : 1.0;
#endif

varying vec4 v_ViewPosition;
varying vec2 v_Texcoord;

void main(){

#ifdef VERTEX_ANIMATION
 vec3 pos = mix(prevPosition, position, percent);
#else
 vec3 pos = position;
#endif

 v_ViewPosition = worldViewProjection * vec4(pos, 1.0);
 gl_Position = v_ViewPosition;

 v_Texcoord = texcoord;

}
@end



@export ecgl.sm.depth.fragment

@import clay.sm.depth.fragment

@end`;Object.assign(hi.prototype,GF);V.import(WF);V.import(D2);V.import(XF);V.import(YF);V.import($F);V.import(ZF);V.import(qF);V.import(KF);function jF(t){return!t||t==="none"}function U2(t){return t instanceof HTMLCanvasElement||t instanceof HTMLImageElement||t instanceof Image}function QF(t){return t.getZr&&t.setOption}var JF=ln.prototype.addToScene,t5=ln.prototype.removeFromScene;ln.prototype.addToScene=function(t){if(JF.call(this,t),this.__zr){var e=this.__zr;t.traverse(function(r){r.__zr=e,r.addAnimatorsToZr&&r.addAnimatorsToZr(e)})}};ln.prototype.removeFromScene=function(t){t5.call(this,t),t.traverse(function(e){var r=e.__zr;e.__zr=null,r&&e.removeAnimatorsFromZr&&e.removeAnimatorsFromZr(r)})};Ii.prototype.setTextureImage=function(t,e,r,i){if(this.shader){var n=r.getZr(),a=this,o;return a.autoUpdateTextureStatus=!1,a.disableTexture(t),jF(e)||(o=st.loadTexture(e,r,i,function(s){a.enableTexture(t),n&&n.refresh()}),a.set(t,o)),o}};var st={};st.Renderer=Ds;st.Node=hi;st.Mesh=Sg;st.Shader=V;st.Material=Ii;st.Texture=ut;st.Texture2D=Pt;st.Geometry=le;st.SphereGeometry=DF;st.PlaneGeometry=Cg;st.CubeGeometry=k2;st.AmbientLight=RF;st.DirectionalLight=IF;st.PointLight=OF;st.SpotLight=FF;st.PerspectiveCamera=xe;st.OrthographicCamera=Ks;st.Vector2=ur;st.Vector3=W;st.Vector4=kF;st.Quaternion=L2;st.Matrix2=zF;st.Matrix2d=UF;st.Matrix3=HF;st.Matrix4=J;st.Plane=O2;st.Ray=Ef;st.BoundingBox=Ve;st.Frustum=bg;var hu=null;function e5(){return hu!==null||(hu=aa.createBlank("rgba(255,255,255,0)").image),hu}function zy(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}function Uy(t){if((t.wrapS===ut.REPEAT||t.wrapT===ut.REPEAT)&&t.image){var e=zy(t.width),r=zy(t.height);if(e!==t.width||r!==t.height){var i=document.createElement("canvas");i.width=e,i.height=r;var n=i.getContext("2d");n.drawImage(t.image,0,0,e,r),t.image=i}}}st.loadTexture=function(t,e,r,i){typeof r=="function"&&(i=r,r={}),r=r||{};for(var n=Object.keys(r).sort(),a="",o=0;o<n.length;o++)a+=n[o]+"_"+r[n[o]]+"_";var s=e.__textureCache=e.__textureCache||new So(20);if(QF(t)){var l=t.__textureid__,u=s.get(a+l);if(u)u.texture.surface.setECharts(t),i&&i(u.texture);else{var f=new hF(t);f.onupdate=function(){e.getZr().refresh()},u={texture:f.getTexture()};for(var o=0;o<n.length;o++)u.texture[n[o]]=r[n[o]];l=t.__textureid__||"__ecgl_ec__"+u.texture.__uid__,t.__textureid__=l,s.put(a+l,u),i&&i(u.texture)}return u.texture}else if(U2(t)){var l=t.__textureid__,u=s.get(a+l);if(!u){u={texture:new st.Texture2D({image:t})};for(var o=0;o<n.length;o++)u.texture[n[o]]=r[n[o]];l=t.__textureid__||"__ecgl_image__"+u.texture.__uid__,t.__textureid__=l,s.put(a+l,u),Uy(u.texture),i&&i(u.texture)}return u.texture}else{var u=s.get(a+t);if(u)u.callbacks?u.callbacks.push(i):i&&i(u.texture);else if(t.match(/.hdr$|^data:application\/octet-stream/)){u={callbacks:[i]};var h=aa.loadTexture(t,{exposure:r.exposure,fileType:"hdr"},function(){h.dirty(),u.callbacks.forEach(function(d){d&&d(h)}),u.callbacks=null});u.texture=h,s.put(a+t,u)}else{for(var h=new st.Texture2D({image:new Image}),o=0;o<n.length;o++)h[n[o]]=r[n[o]];u={texture:h,callbacks:[i]};var v=h.image;v.onload=function(){h.image=v,Uy(h),h.dirty(),u.callbacks.forEach(function(p){p&&p(h)}),u.callbacks=null},v.crossOrigin="Anonymous",v.src=t,h.image=e5(),s.put(a+t,u)}return u.texture}};st.createAmbientCubemap=function(t,e,r,i){t=t||{};var n=t.texture,a=Dr.firstNotNull(t.exposure,1),o=new xF({intensity:Dr.firstNotNull(t.specularIntensity,1)}),s=new SF({intensity:Dr.firstNotNull(t.diffuseIntensity,1),coefficients:[.844,.712,.691,-.037,.083,.167,.343,.288,.299,-.041,-.021,-.009,-.003,-.041,-.064,-.011,-.007,-.004,-.031,.034,.081,-.06,-.049,-.06,.046,.056,.05]});return o.cubemap=st.loadTexture(n,r,{exposure:a},function(){o.cubemap.flipY=!1,o.prefilter(e,32),s.coefficients=EF.projectEnvironmentMap(e,o.cubemap,{lod:1}),i&&i()}),{specular:o,diffuse:s}};st.createBlankTexture=aa.createBlank;st.isImage=U2;st.additiveBlend=function(t){t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE)};st.parseColor=function(t,e){return t instanceof Array?(e||(e=[]),e[0]=t[0],e[1]=t[1],e[2]=t[2],t.length>3?e[3]=t[3]:e[3]=1,e):(e=Xe(t||"#000",e)||[0,0,0,0],e[0]/=255,e[1]/=255,e[2]/=255,e)};st.directionFromAlphaBeta=function(t,e){var r=t/180*Math.PI+Math.PI/2,i=-e/180*Math.PI+Math.PI/2,n=[],a=Math.sin(r);return n[0]=a*Math.cos(i),n[1]=-Math.cos(r),n[2]=a*Math.sin(i),n};st.getShadowResolution=function(t){var e=1024;switch(t){case"low":e=512;break;case"medium":break;case"high":e=2048;break;case"ultra":e=4096;break}return e};st.COMMON_SHADERS=["lambert","color","realistic","hatching","shadow"];st.createShader=function(t){t==="ecgl.shadow"&&(t="ecgl.displayShadow");var e=V.source(t+".vertex"),r=V.source(t+".fragment");e||console.error("Vertex shader of '%s' not exits",t),r||console.error("Fragment shader of '%s' not exits",t);var i=new V(e,r);return i.name=t,i};st.createMaterial=function(t,e){e instanceof Array||(e=[e]);var r=st.createShader(t),i=new Ii({shader:r});return e.forEach(function(n){typeof n=="string"&&i.define(n)}),i};st.setMaterialFromModel=function(t,e,r,i){e.autoUpdateTextureStatus=!1;var n=r.getModel(t+"Material"),a=n.get("detailTexture"),o=Dr.firstNotNull(n.get("textureTiling"),1),s=Dr.firstNotNull(n.get("textureOffset"),0);typeof o=="number"&&(o=[o,o]),typeof s=="number"&&(s=[s,s]);var l=o[0]>1||o[1]>1?st.Texture.REPEAT:st.Texture.CLAMP_TO_EDGE,u={anisotropic:8,wrapS:l,wrapT:l};if(t==="realistic"){var f=n.get("roughness"),h=n.get("metalness");h!=null?isNaN(h)&&(e.setTextureImage("metalnessMap",h,i,u),h=Dr.firstNotNull(n.get("metalnessAdjust"),.5)):h=0,f!=null?isNaN(f)&&(e.setTextureImage("roughnessMap",f,i,u),f=Dr.firstNotNull(n.get("roughnessAdjust"),.5)):f=.5;var v=n.get("normalTexture");e.setTextureImage("detailMap",a,i,u),e.setTextureImage("normalMap",v,i,u),e.set({roughness:f,metalness:h,detailUvRepeat:o,detailUvOffset:s})}else if(t==="lambert")e.setTextureImage("detailMap",a,i,u),e.set({detailUvRepeat:o,detailUvOffset:s});else if(t==="color")e.setTextureImage("detailMap",a,i,u),e.set({detailUvRepeat:o,detailUvOffset:s});else if(t==="hatching"){var c=n.get("hatchingTextures")||[];c.length<6;for(var d=0;d<6;d++)e.setTextureImage("hatch"+(d+1),c[d],i,{anisotropic:8,wrapS:st.Texture.REPEAT,wrapT:st.Texture.REPEAT});e.set({detailUvRepeat:o,detailUvOffset:s})}};st.updateVertexAnimation=function(t,e,r,i){var n=i.get("animation"),a=i.get("animationDurationUpdate"),o=i.get("animationEasingUpdate"),s=r.shadowDepthMaterial;if(n&&e&&a>0&&e.geometry.vertexCount===r.geometry.vertexCount){r.material.define("vertex","VERTEX_ANIMATION"),r.ignorePreZ=!0,s&&s.define("vertex","VERTEX_ANIMATION");for(var l=0;l<t.length;l++)r.geometry.attributes[t[l][0]].value=e.geometry.attributes[t[l][1]].value;r.geometry.dirty(),r.__percent=0,r.material.set("percent",0),r.stopAnimation(),r.animate().when(a,{__percent:1}).during(function(){r.material.set("percent",r.__percent),s&&s.set("percent",r.__percent)}).done(function(){r.ignorePreZ=!1,r.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")}).start(o)}else r.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")};const tt=st;var Wt=function(t,e){this.id=t,this.zr=e;try{this.renderer=new Ds({clearBit:0,devicePixelRatio:e.painter.dpr,preserveDrawingBuffer:!0,premultipliedAlpha:!0}),this.renderer.resize(e.painter.getWidth(),e.painter.getHeight())}catch(i){this.renderer=null,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute; left: 0; top: 0; right: 0; bottom: 0;",this.dom.className="ecgl-nowebgl",this.dom.innerHTML="Sorry, your browser does not support WebGL",console.error(i);return}this.onglobalout=this.onglobalout.bind(this),e.on("globalout",this.onglobalout),this.dom=this.renderer.canvas;var r=this.dom.style;r.position="absolute",r.left="0",r.top="0",this.views=[],this._picking=new xB({renderer:this.renderer}),this._viewsToDispose=[],this._accumulatingId=0,this._zrEventProxy=new ie({shape:{x:-1,y:-1,width:2,height:2},__isGLToZRProxy:!0}),this._backgroundColor=null,this._disposed=!1};Wt.prototype.setUnpainted=function(){};Wt.prototype.addView=function(t){if(t.layer!==this){var e=this._viewsToDispose.indexOf(t);e>=0&&this._viewsToDispose.splice(e,1),this.views.push(t),t.layer=this;var r=this.zr;t.scene.traverse(function(i){i.__zr=r,i.addAnimatorsToZr&&i.addAnimatorsToZr(r)})}};function H2(t){var e=t.__zr;t.__zr=null,e&&t.removeAnimatorsFromZr&&t.removeAnimatorsFromZr(e)}Wt.prototype.removeView=function(t){if(t.layer===this){var e=this.views.indexOf(t);e>=0&&(this.views.splice(e,1),t.scene.traverse(H2,this),t.layer=null,this._viewsToDispose.push(t))}};Wt.prototype.removeViewsAll=function(){this.views.forEach(function(t){t.scene.traverse(H2,this),t.layer=null,this._viewsToDispose.push(t)},this),this.views.length=0};Wt.prototype.resize=function(t,e){var r=this.renderer;r.resize(t,e)};Wt.prototype.clear=function(){var t=this.renderer.gl,e=this._backgroundColor||[0,0,0,0];t.clearColor(e[0],e[1],e[2],e[3]),t.depthMask(!0),t.colorMask(!0,!0,!0,!0),t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT)};Wt.prototype.clearDepth=function(){var t=this.renderer.gl;t.clear(t.DEPTH_BUFFER_BIT)};Wt.prototype.clearColor=function(){var t=this.renderer.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)};Wt.prototype.needsRefresh=function(){this.zr.refresh()};Wt.prototype.refresh=function(t){this._backgroundColor=t?tt.parseColor(t):[0,0,0,0],this.renderer.clearColor=this._backgroundColor;for(var e=0;e<this.views.length;e++)this.views[e].prepareRender(this.renderer);this._doRender(!1),this._trackAndClean();for(var e=0;e<this._viewsToDispose.length;e++)this._viewsToDispose[e].dispose(this.renderer);this._viewsToDispose.length=0,this._startAccumulating()};Wt.prototype.renderToCanvas=function(t){this._startAccumulating(!0),t.drawImage(this.dom,0,0,t.canvas.width,t.canvas.height)};Wt.prototype._doRender=function(t){this.clear(),this.renderer.saveViewport();for(var e=0;e<this.views.length;e++)this.views[e].render(this.renderer,t);this.renderer.restoreViewport()};Wt.prototype._stopAccumulating=function(){this._accumulatingId=0,clearTimeout(this._accumulatingTimeout)};var r5=1;Wt.prototype._startAccumulating=function(t){var e=this;this._stopAccumulating();for(var r=!1,i=0;i<this.views.length;i++)r=this.views[i].needsAccumulate()||r;if(!r)return;function n(a){if(!(!e._accumulatingId||a!==e._accumulatingId)){for(var o=!0,s=0;s<e.views.length;s++)o=e.views[s].isAccumulateFinished()&&r;o||(e._doRender(!0),t?n(a):Xu(function(){n(a)}))}}this._accumulatingId=r5++,t?n(e._accumulatingId):this._accumulatingTimeout=setTimeout(function(){n(e._accumulatingId)},50)};Wt.prototype._trackAndClean=function(){var t=[],e=[];this._textureList&&(Mf(this._textureList),Mf(this._geometriesList));for(var r=0;r<this.views.length;r++)i5(this.views[r].scene,t,e);this._textureList&&(Df(this.renderer,this._textureList),Df(this.renderer,this._geometriesList)),this._textureList=t,this._geometriesList=e};function Mf(t){for(var e=0;e<t.length;e++)t[e].__used__=0}function Df(t,e){for(var r=0;r<e.length;r++)e[r].__used__||e[r].dispose(t)}function cu(t,e){t.__used__=t.__used__||0,t.__used__++,t.__used__===1&&e.push(t)}function i5(t,e,r){var i,n;t.traverse(function(o){if(o.isRenderable()){var s=o.geometry,l=o.material;if(l!==i)for(var u=l.getTextureUniforms(),f=0;f<u.length;f++){var h=u[f],v=l.uniforms[h].value;if(v){if(v instanceof ut)cu(v,e);else if(v instanceof Array)for(var c=0;c<v.length;c++)v[c]instanceof ut&&cu(v[c],e)}}s!==n&&cu(s,r),i=l,n=s}});for(var a=0;a<t.lights.length;a++)t.lights[a].cubemap&&cu(t.lights[a].cubemap,e)}Wt.prototype.dispose=function(){this._disposed||(this._stopAccumulating(),this._textureList&&(Mf(this._textureList),Mf(this._geometriesList),Df(this.renderer,this._textureList),Df(this.renderer,this._geometriesList)),this.zr.off("globalout",this.onglobalout),this._disposed=!0)};Wt.prototype.onmousedown=function(t){if(!(t.target&&t.target.__isGLToZRProxy)){t=t.event;var e=this.pickObject(t.offsetX,t.offsetY);e&&(this._dispatchEvent("mousedown",t,e),this._dispatchDataEvent("mousedown",t,e)),this._downX=t.offsetX,this._downY=t.offsetY}};Wt.prototype.onmousemove=function(t){if(!(t.target&&t.target.__isGLToZRProxy)){t=t.event;var e=this.pickObject(t.offsetX,t.offsetY),r=e&&e.target,i=this._hovered;this._hovered=e,i&&r!==i.target&&(i.relatedTarget=r,this._dispatchEvent("mouseout",t,i),this.zr.setCursorStyle("default")),this._dispatchEvent("mousemove",t,e),e&&(this.zr.setCursorStyle("pointer"),(!i||r!==i.target)&&this._dispatchEvent("mouseover",t,e)),this._dispatchDataEvent("mousemove",t,e)}};Wt.prototype.onmouseup=function(t){if(!(t.target&&t.target.__isGLToZRProxy)){t=t.event;var e=this.pickObject(t.offsetX,t.offsetY);e&&(this._dispatchEvent("mouseup",t,e),this._dispatchDataEvent("mouseup",t,e)),this._upX=t.offsetX,this._upY=t.offsetY}};Wt.prototype.onclick=Wt.prototype.dblclick=function(t){if(!(t.target&&t.target.__isGLToZRProxy)){var e=this._upX-this._downX,r=this._upY-this._downY;if(!(Math.sqrt(e*e+r*r)>20)){t=t.event;var i=this.pickObject(t.offsetX,t.offsetY);i&&(this._dispatchEvent(t.type,t,i),this._dispatchDataEvent(t.type,t,i));var n=this._clickToSetFocusPoint(t);if(n){var a=n.view.setDOFFocusOnPoint(n.distance);a&&this.zr.refresh()}}}};Wt.prototype._clickToSetFocusPoint=function(t){for(var e=this.renderer,r=e.viewport,i=this.views.length-1;i>=0;i--){var n=this.views[i];if(n.hasDOF()&&n.containPoint(t.offsetX,t.offsetY)){this._picking.scene=n.scene,this._picking.camera=n.camera,e.viewport=n.viewport;var a=this._picking.pick(t.offsetX,t.offsetY,!0);if(a)return a.view=n,a}}e.viewport=r};Wt.prototype.onglobalout=function(t){var e=this._hovered;e&&this._dispatchEvent("mouseout",t,{target:e.target})};Wt.prototype.pickObject=function(t,e){for(var r=[],i=this.renderer,n=i.viewport,a=0;a<this.views.length;a++){var o=this.views[a];o.containPoint(t,e)&&(this._picking.scene=o.scene,this._picking.camera=o.camera,i.viewport=o.viewport,this._picking.pickAll(t,e,r))}return i.viewport=n,r.sort(function(s,l){return s.distance-l.distance}),r[0]};Wt.prototype._dispatchEvent=function(t,e,r){r||(r={});var i=r.target;for(r.cancelBubble=!1,r.event=e,r.type=t,r.offsetX=e.offsetX,r.offsetY=e.offsetY;i&&(i.trigger(t,r),i=i.getParent(),!r.cancelBubble););this._dispatchToView(t,r)};Wt.prototype._dispatchDataEvent=function(t,e,r){var i=r&&r.target,n=i&&i.dataIndex,a=i&&i.seriesIndex,o=i&&i.eventData,s=!1,l=this._zrEventProxy;l.x=e.offsetX,l.y=e.offsetY,l.update();var u={target:l};const f=kt(l);t==="mousemove"&&(n!=null?n!==this._lastDataIndex&&(parseInt(this._lastDataIndex,10)>=0&&(f.dataIndex=this._lastDataIndex,f.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(u,"mouseout",e)),s=!0):o!=null&&o!==this._lastEventData&&(this._lastEventData!=null&&(f.eventData=this._lastEventData,this.zr.handler.dispatchToElement(u,"mouseout",e)),s=!0),this._lastEventData=o,this._lastDataIndex=n,this._lastSeriesIndex=a),f.eventData=o,f.dataIndex=n,f.seriesIndex=a,(o!=null||parseInt(n,10)>=0&&parseInt(a,10)>=0)&&(this.zr.handler.dispatchToElement(u,t,e),s&&this.zr.handler.dispatchToElement(u,"mouseover",e))};Wt.prototype._dispatchToView=function(t,e){for(var r=0;r<this.views.length;r++)this.views[r].containPoint(e.offsetX,e.offsetY)&&this.views[r].trigger(t,e)};Object.assign(Wt.prototype,yg);const V2=Wt;var n5=["bar3D","line3D","map3D","scatter3D","surface","lines3D","scatterGL","scatter3D"];function ps(t,e){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var r=t[e].normal,i=t[e].emphasis;r&&(t[e]=r),i&&(t.emphasis=t.emphasis||{},t.emphasis[e]=i)}}function a5(t){ps(t,"itemStyle"),ps(t,"lineStyle"),ps(t,"areaStyle"),ps(t,"label")}function vu(t){t&&(t instanceof Array||(t=[t]),M(t,function(e){if(e.axisLabel){var r=e.axisLabel;Object.assign(r,r.textStyle),r.textStyle=null}}))}function o5(t){M(t.series,function(e){Dt(n5,e.type)>=0&&(a5(e),e.coordinateSystem==="mapbox"&&(e.coordinateSystem="mapbox3D",t.mapbox3D=t.mapbox))}),vu(t.xAxis3D),vu(t.yAxis3D),vu(t.zAxis3D),vu(t.grid3D),ps(t.geo3D)}function G2(t){this._layers={},this._zr=t}G2.prototype.update=function(t,e){var r=this,i=e.getZr();if(!i.getWidth()||!i.getHeight()){console.warn("Dom has no width or height");return}function n(s){i.setSleepAfterStill(0);var l;s.coordinateSystem&&s.coordinateSystem.model,l=s.get("zlevel");var u=r._layers,f=u[l];if(!f){if(f=u[l]=new V2("gl-"+l,i),i.painter.isSingleCanvas()){f.virtual=!0;var h=new Nr({z:1e4,style:{image:f.renderer.canvas},silent:!0});f.__hostImage=h,i.add(h)}i.painter.insertLayer(l,f)}return f.__hostImage&&f.__hostImage.setStyle({width:f.renderer.getWidth(),height:f.renderer.getHeight()}),f}function a(s,l){s&&s.traverse(function(u){u.isRenderable&&u.isRenderable()&&(u.ignorePicking=u.$ignorePicking!=null?u.$ignorePicking:l)})}for(var o in this._layers)this._layers[o].removeViewsAll();t.eachComponent(function(s,l){if(s!=="series"){var u=e.getViewOfComponentModel(l),f=l.coordinateSystem;if(u.__ecgl__){var h;if(f){if(!f.viewGL){console.error("Can't find viewGL in coordinateSystem of component "+l.id);return}h=f.viewGL}else{if(!l.viewGL){console.error("Can't find viewGL of component "+l.id);return}h=f.viewGL}var h=f.viewGL,v=n(l);v.addView(h),u.afterRender&&u.afterRender(l,t,e,v),a(u.groupGL,l.get("silent"))}}}),t.eachSeries(function(s){var l=e.getViewOfSeriesModel(s),u=s.coordinateSystem;if(l.__ecgl__){if(u&&!u.viewGL&&!l.viewGL){console.error("Can't find viewGL of series "+l.id);return}var f=u&&u.viewGL||l.viewGL,h=n(s);h.addView(f),l.afterRender&&l.afterRender(s,t,e,h),a(l.groupGL,s.get("silent"))}})};xw(function(t){var e=t.getZr(),r=e.painter.dispose;e.painter.dispose=function(){typeof this.eachOtherLayer=="function"&&this.eachOtherLayer(function(i){i instanceof V2&&i.dispose()}),r.call(this)},e.painter.getRenderedCanvas=function(i){if(i=i||{},this._singleCanvas)return this._layers[0].dom;var n=document.createElement("canvas"),a=i.pixelRatio||this.dpr;n.width=this.getWidth()*a,n.height=this.getHeight()*a;var o=n.getContext("2d");o.dpr=a,o.clearRect(0,0,n.width,n.height),i.backgroundColor&&(o.fillStyle=i.backgroundColor,o.fillRect(0,0,n.width,n.height));var s=this.storage.getDisplayList(!0),l={},u,f=this;function h(p,g){var m=f._zlevelList;p==null&&(p=-1/0);for(var _,y=0;y<m.length;y++){var x=m[y],S=f._layers[x];if(!S.__builtin__&&x>p&&x<g){_=S;break}}_&&_.renderToCanvas&&(o.save(),_.renderToCanvas(o),o.restore())}for(var v={ctx:o},c=0;c<s.length;c++){var d=s[c];d.zlevel!==u&&(h(u,d.zlevel),u=d.zlevel),this._doPaintEl(d,v,!0,null,l)}return h(u,1/0),n}});Tw(function(t,e){var r=e.getZr(),i=r.__egl=r.__egl||new G2(r);i.update(t,e)});ng(o5);const s5={defaultOption:{viewControl:{projection:"perspective",autoRotate:!1,autoRotateDirection:"cw",autoRotateSpeed:10,autoRotateAfterStill:3,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",distance:150,minDistance:40,maxDistance:400,orthographicSize:150,maxOrthographicSize:400,minOrthographicSize:20,center:[0,0,0],alpha:0,beta:0,minAlpha:-90,maxAlpha:90}},setView:function(t){t=t||{},this.option.viewControl=this.option.viewControl||{},t.alpha!=null&&(this.option.viewControl.alpha=t.alpha),t.beta!=null&&(this.option.viewControl.beta=t.beta),t.distance!=null&&(this.option.viewControl.distance=t.distance),t.center!=null&&(this.option.viewControl.center=t.center)}},l5={defaultOption:{postEffect:{enable:!1,bloom:{enable:!0,intensity:.1},depthOfField:{enable:!1,focalRange:20,focalDistance:50,blurRadius:10,fstop:2.8,quality:"medium"},screenSpaceAmbientOcclusion:{enable:!1,radius:2,quality:"medium",intensity:1},screenSpaceReflection:{enable:!1,quality:"medium",maxRoughness:.8},colorCorrection:{enable:!0,exposure:0,brightness:0,contrast:1,saturation:1,lookupTexture:""},edge:{enable:!1},FXAA:{enable:!1}},temporalSuperSampling:{enable:"auto"}}},u5={defaultOption:{light:{main:{shadow:!1,shadowQuality:"high",color:"#fff",intensity:1,alpha:0,beta:0},ambient:{color:"#fff",intensity:.2},ambientCubemap:{texture:null,exposure:1,diffuseIntensity:.5,specularIntensity:.5}}}};var xh=Vt.extend({type:"grid3D",dependencies:["xAxis3D","yAxis3D","zAxis3D"],defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",boxWidth:100,boxHeight:100,boxDepth:100,axisPointer:{show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.8)",width:1},label:{show:!0,formatter:null,margin:8,textStyle:{fontSize:14,color:"#fff",backgroundColor:"rgba(0,0,0,0.5)",padding:3,borderRadius:3}}},axisLine:{show:!0,lineStyle:{color:"#333",width:2,type:"solid"}},axisTick:{show:!0,inside:!1,length:3,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,margin:8,textStyle:{fontSize:12}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},light:{main:{alpha:30,beta:40},ambient:{intensity:.4}},viewControl:{alpha:20,beta:40,autoRotate:!1,distance:200,minDistance:40,maxDistance:400}}});dt(xh.prototype,s5);dt(xh.prototype,l5);dt(xh.prototype,u5);const f5=xh;var es=Dr.firstNotNull,Hy={left:0,middle:1,right:2};function Vy(t){return t instanceof Array||(t=[t,t]),t}var W2=or.extend(function(){return{zr:null,viewGL:null,_center:new W,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 ur,_panVelocity:new ur,_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){e=e||{};var r=e.baseDistance||0,i=e.baseOrthoSize||1,n=t.get("projection");n!=="perspective"&&n!=="orthographic"&&n!=="isometric"&&(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(v){this[v[0]]=es(t.get(v[0]),v[1])},this),this.minDistance+=r,this.maxDistance+=r,this.minOrthographicSize+=i,this.maxOrthographicSize+=i;var s=t.ecModel,l={};["animation","animationDurationUpdate","animationEasingUpdate"].forEach(function(v){l[v]=es(t.get(v),s&&s.get(v))});var u=es(e.alpha,t.get("alpha"))||0,f=es(e.beta,t.get("beta"))||0,h=es(e.center,t.get("center"))||[0,0,0];l.animation&&l.animationDurationUpdate>0&&this._notFirst?this.animateTo({alpha:u,beta:f,center:h,distance:a,orthographicSize:o,easing:l.animationEasingUpdate,duration:l.animationDurationUpdate}):(this.setDistance(a),this.setAlpha(u),this.setBeta(f),this.setCenter(h),this.setOrthographicSize(o)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){},animateTo:function(t){var e=this.zr,r=this,i={},n={};return t.distance!=null&&(i.distance=this.getDistance(),n.distance=t.distance),t.orthographicSize!=null&&(i.orthographicSize=this.getOrthographicSize(),n.orthographicSize=t.orthographicSize),t.alpha!=null&&(i.alpha=this.getAlpha(),n.alpha=t.alpha),t.beta!=null&&(i.beta=this.getBeta(),n.beta=t.beta),t.center!=null&&(i.center=this.getCenter(),n.center=t.center),this._addAnimator(e.animation.animate(i).when(t.duration||1e3,n).during(function(){i.alpha!=null&&r.setAlpha(i.alpha),i.beta!=null&&r.setBeta(i.beta),i.distance!=null&&r.setDistance(i.distance),i.center!=null&&r.setCenter(i.center),i.orthographicSize!=null&&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=(this.autoRotateDirection==="cw"?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){this._projection==="perspective"?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 W,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},t*1e3))},_vectorDamping:function(t,e){var r=t.len();r=r*e,r<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?t.event.targetTouches.length===1&&(this._mode="rotate"):t.event.button===Hy[this.rotateMouseButton]?this._mode="rotate":t.event.button===Hy[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=Vy(this.panSensitivity),r=Vy(this.rotateSensitivity);this._mode==="rotate"?(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]):this._mode==="pan"&&(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(e!==0){var r=t.offsetX,i=t.offsetY;if(!(this.viewGL&&!this.viewGL.containPoint(r,i))){var n;this._projection==="perspective"?n=Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):n=Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(e>0?-1:1)*n*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&this._mode==="rotate"&&this._startCountingStill(),t.event.preventDefault()}}},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return this.rotateMouseButton==="right"||this.panMouseButton==="right"},_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(W2.prototype,"autoRotate",{get:function(t){return this._autoRotate},set:function(t){this._autoRotate=t,this._rotating=t}});const h5=W2,Dg={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()}},Th={vec2:Q,vec3:P,vec4:Y,mat2:ne,mat2d:fe,mat3:St,mat4:H,quat:lt};var cv=Th.vec3,Gy=[[0,0],[1,1]],X2=le.extend(function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new le.Attribute("position","float",3,"POSITION"),positionPrev:new le.Attribute("positionPrev","float",3),positionNext:new le.Attribute("positionNext","float",3),prevPositionPrev:new le.Attribute("prevPositionPrev","float",3),prevPosition:new le.Attribute("prevPosition","float",3),prevPositionNext:new le.Attribute("prevPositionNext","float",3),offset:new le.Attribute("offset","float",1),color:new le.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&&(t===0?this.indices=null:this.indices=this.vertexCount>65535?new Uint32Array(t*3):new Uint16Array(t*3))},_getCubicCurveApproxStep:function(t,e,r,i){var n=cv.dist(t,e)+cv.dist(r,e)+cv.dist(i,r),a=1/(n+1)*this.segmentScale;return a},getCubicCurveVertexCount:function(t,e,r,i){var n=this._getCubicCurveApproxStep(t,e,r,i),a=Math.ceil(1/n);return this.useNativeLine?a*2:a*2+2},getCubicCurveTriangleCount:function(t,e,r,i){var n=this._getCubicCurveApproxStep(t,e,r,i),a=Math.ceil(1/n);return this.useNativeLine?0:a*2},getLineVertexCount:function(){return this.getPolylineVertexCount(Gy)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(Gy)},getPolylineVertexCount:function(t){var e;if(typeof t=="number")e=t;else{var r=typeof t[0]!="number";e=r?t.length:t.length/3}return this.useNativeLine?(e-1)*2:(e-1)*2+2},getPolylineTriangleCount:function(t){var e;if(typeof t=="number")e=t;else{var r=typeof t[0]!="number";e=r?t.length:t.length/3}return this.useNativeLine?0:Math.max(e-1,0)*2},addCubicCurve:function(t,e,r,i,n,a){a==null&&(a=1);for(var o=t[0],s=t[1],l=t[2],u=e[0],f=e[1],h=e[2],v=r[0],c=r[1],d=r[2],p=i[0],g=i[1],m=i[2],_=this._getCubicCurveApproxStep(t,e,r,i),y=_*_,x=y*_,S=3*_,T=3*y,b=6*y,w=6*x,A=o-u*2+v,C=s-f*2+c,E=l-h*2+d,D=(u-v)*3-o+p,L=(f-c)*3-s+g,R=(h-d)*3-l+m,N=o,I=s,F=l,O=(u-o)*S+A*T+D*x,z=(f-s)*S+C*T+L*x,k=(h-l)*S+E*T+R*x,it=A*b+D*w,$=C*b+L*w,nt=E*b+R*w,rt=D*w,It=L*w,gt=R*w,Ft=0,Xt=0,Ot=Math.ceil(1/_),Mt=new Float32Array((Ot+1)*3),Mt=[],q=0,Xt=0;Xt<Ot+1;Xt++)Mt[q++]=N,Mt[q++]=I,Mt[q++]=F,N+=O,I+=z,F+=k,O+=it,z+=$,k+=nt,it+=rt,$+=It,nt+=gt,Ft+=_,Ft>1&&(N=O>0?Math.min(N,p):Math.max(N,p),I=z>0?Math.min(I,g):Math.max(I,g),F=k>0?Math.min(F,m):Math.max(F,m));return this.addPolyline(Mt,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=typeof t[0]!="number";if(n==null&&(n=a?t.length:t.length/3),!(n<2)){i==null&&(i=0),r==null&&(r=1),this._itemVertexOffsets.push(this._vertexOffset);var a=typeof t[0]!="number",o=a?typeof e[0]!="number":e.length/4===n,s=this.attributes.position,l=this.attributes.positionPrev,u=this.attributes.positionNext,f=this.attributes.color,h=this.attributes.offset,v=this.indices,c=this._vertexOffset,d,p;r=Math.max(r,.01);for(var g=i;g<n;g++){if(a)d=t[g],o?p=e[g]:p=e;else{var m=g*3;if(d=d||[],d[0]=t[m],d[1]=t[m+1],d[2]=t[m+2],o){var _=g*4;p=p||[],p[0]=e[_],p[1]=e[_+1],p[2]=e[_+2],p[3]=e[_+3]}else p=e}if(this.useNativeLine?g>1&&(s.copy(c,c-1),f.copy(c,c-1),c++):(g<n-1&&(l.set(c+2,d),l.set(c+3,d)),g>0&&(u.set(c-2,d),u.set(c-1,d)),s.set(c,d),s.set(c+1,d),f.set(c,p),f.set(c+1,p),h.set(c,r/2),h.set(c+1,-r/2),c+=2),this.useNativeLine)f.set(c,p),s.set(c,d),c++;else if(g>0){var y=this._triangleOffset*3,v=this.indices;v[y]=c-4,v[y+1]=c-3,v[y+2]=c-2,v[y+3]=c-3,v[y+4]=c-1,v[y+5]=c-2,this._triangleOffset+=2}}if(!this.useNativeLine){var x=this._vertexOffset,S=this._vertexOffset+n*2;l.copy(x,x+2),l.copy(x+1,x+3),u.copy(S-1,S-3),u.copy(S-2,S-4)}return this._vertexOffset=c,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}});Lt(X2.prototype,Dg);const Lg=X2;function Lf(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}Lf.prototype={constructor:Lf,clear:function(){this._x=0,this._y=0,this._rowHeight=0},add:function(t,e,r){var i=t.getBoundingRect();e==null&&(e=i.width),r==null&&(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 u=[this.offsetX/this.width,this.offsetY/this.height],f=[[n/o+u[0],a/s+u[1]],[(n+e)/o+u[0],(a+r)/s+u[1]]];return f},_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()}};function Vd(t){t=t||{},t.width=t.width||512,t.height=t.height||512,t.devicePixelRatio=t.devicePixelRatio||1,t.gap=t.gap==null?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 Pt({image:e,flipY:!1});var r=this;this._zr=Kv(e);var i=this._zr.refreshImmediately;this._zr.refreshImmediately=function(){i.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 Lf(this._zr,0,0,t.width,t.height,this._gap,this._dpr)],this._nodeWidth=t.width,this._nodeHeight=t.height,this._currentNodeIdx=0}Vd.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,r=e.length,i=r*this._nodeWidth%t,n=Math.floor(r*this._nodeWidth/t)*this._nodeHeight;if(!(n>=t)){var a=(i+this._nodeWidth)*this._dpr,o=(n+this._nodeHeight)*this._dpr;try{this._zr.resize({width:a,height:o})}catch{this._canvas.width=a,this._canvas.height=o}var s=new Lf(this._zr,i,n,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(s),s}},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]},dispose:function(){this._zr.dispose()}};function Gd(){}Gd.prototype={constructor:Gd,setScene:function(t){this._scene=t,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(t){this._lightRoot=t,this.mainLight=new tt.DirectionalLight({shadowBias:.005}),this.ambientLight=new tt.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=tt.parseColor(n.get("color")).slice(0,3),r.color=tt.parseColor(a.get("color")).slice(0,3);var o=n.get("alpha")||0,s=n.get("beta")||0;e.position.setArray(tt.directionFromAlphaBeta(o,s)),e.lookAt(tt.Vector3.ZERO),e.castShadow=n.get("shadow"),e.shadowResolution=tt.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]=tt.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 i=e.get("environment"),n=this;function a(){return n._skybox=n._skybox||new qs,n._skybox}var o=a();if(i&&i!=="none")if(i==="auto")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(typeof i=="object"&&i.colorStops||typeof i=="string"&&Xe(i)){this._isSkyboxFromAmbientCubemap=!1;var l=new tt.Texture2D({anisotropic:8,flipY:!1});o.setEnvironmentMap(l);var u=l.image=document.createElement("canvas");u.width=u.height=16;var f=u.getContext("2d"),h=new ie({shape:{x:0,y:0,width:16,height:16},style:{fill:i}});tg(f,h),o.attachScene(this._scene)}else{this._isSkyboxFromAmbientCubemap=!1;var l=tt.loadTexture(i,r,{anisotropic:8,flipY:!1});o.setEnvironmentMap(l),o.attachScene(this._scene)}else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var v=e.coordinateSystem;if(this._skybox)if(v&&v.viewGL&&i!=="auto"&&!(i.match&&i.match(/.hdr$/))){var c=v.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[c]("fragment","SRGB_DECODE")}else this._skybox.material.undefine("fragment","SRGB_DECODE")}};var On=Th.vec3,Y2=le.extend(function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new le.Attribute("position","float",3,"POSITION"),normal:new le.Attribute("normal","float",3,"NORMAL"),color:new le.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(i*3):new Uint16Array(i*3))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:function(){var t=On.create(),e=On.create(),r=On.create(),i=[0,3,1,3,2,1];return function(n,a){var o=this.attributes.position,s=this.attributes.normal,l=this.attributes.color;On.sub(t,n[1],n[0]),On.sub(e,n[2],n[1]),On.cross(r,t,e),On.normalize(r,r);for(var u=0;u<4;u++)o.set(this._vertexOffset+u,n[u]),l.set(this._vertexOffset+u,a),s.set(this._vertexOffset+u,r);for(var f=this._faceOffset*3,u=0;u<6;u++)this.indices[f+u]=i[u]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2}}()});Lt(Y2.prototype,Dg);const c5=Y2;var Wd=Dr.firstNotNull,v5={x:0,y:2,z:1};function d5(t,e,r,i){var n=[0,0,0],a=i<0?r.getExtentMin():r.getExtentMax();n[v5[r.dim]]=a,t.position.setArray(n),t.rotation.identity(),e.distance=-Math.abs(a),e.normal.set(0,0,0),r.dim==="x"?(t.rotation.rotateY(i*Math.PI/2),e.normal.x=-i):r.dim==="z"?(t.rotation.rotateX(-i*Math.PI/2),e.normal.y=-i):(i>0&&t.rotation.rotateY(Math.PI),e.normal.z=-i)}function Sh(t,e,r){this.rootNode=new tt.Node;var i=new tt.Mesh({geometry:new Lg({useNativeLine:!1}),material:e,castShadow:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:1}),n=new tt.Mesh({geometry:new c5,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 tt.Plane,this.linesMesh=i,this.quadsMesh=n}Sh.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]);d5(this.rootNode,this.plane,s,this.faceInfo[3])};Sh.prototype._updateSplitLines=function(t,e,r,i){var n=i.getDevicePixelRatio();e.forEach(function(a,o){var s=a.model,l=e[1-o].getExtent();if(!a.scale.isBlank()){var u=s.getModel("splitLine",r.getModel("splitLine"));if(u.get("show")){var f=u.getModel("lineStyle"),h=f.get("color"),v=Wd(f.get("opacity"),1),c=Wd(f.get("width"),1);h=X(h)?h:[h];for(var d=a.getTicksCoords({tickModel:u}),p=0,g=0;g<d.length;g++){var m=d[g].coord,_=tt.parseColor(h[p%h.length]);_[3]*=v;var y=[0,0,0],x=[0,0,0];y[o]=x[o]=m,y[1-o]=l[0],x[1-o]=l[1],t.addLine(y,x,_,c*n),p++}}}})};Sh.prototype._udpateSplitAreas=function(t,e,r,i){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 u=l.getModel("areaStyle"),f=u.get("color"),h=Wd(u.get("opacity"),1);f=X(f)?f:[f];for(var v=n.getTicksCoords({tickModel:l,clamp:!0}),c=0,d=[0,0,0],p=[0,0,0],g=0;g<v.length;g++){var m=v[g].coord,_=[0,0,0],y=[0,0,0];if(_[a]=y[a]=m,_[1-a]=s[0],y[1-a]=s[1],g===0){d=_,p=y;continue}var x=tt.parseColor(f[c%f.length]);x[3]*=h,t.addQuad([d,_,y,p],x),d=_,p=y,c++}}}})};var Wy=[0,1,2,0,2,3],$2=le.extend(function(){return{attributes:{position:new le.Attribute("position","float",3,"POSITION"),texcoord:new le.Attribute("texcoord","float",2,"TEXCOORD_0"),offset:new le.Attribute("offset","float",2),color:new le.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setSpriteCount:function(t){this._spriteCount=t;var e=t*4,r=t*2;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(r*3):new Uint16Array(r*3))},setSpriteAlign:function(t,e,r,i,n){r==null&&(r="left"),i==null&&(i="top");var a,o,s,l;switch(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;break}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;break}var u=t*4,f=this.attributes.offset;f.set(u,[a,l]),f.set(u+1,[s,l]),f.set(u+2,[s,o]),f.set(u+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<Wy.length;s++)this.indices[this._faceOffset*3+s]=Wy[s]+o;return this._faceOffset+=2,this._vertexOffset+=4,o/4},setSprite:function(t,e,r,i,n,a,o){for(var s=t*4,l=this.attributes,u=0;u<4;u++)l.position.set(s+u,e);var f=l.texcoord;f.set(s,[i[0][0],i[0][1]]),f.set(s+1,[i[1][0],i[0][1]]),f.set(s+2,[i[1][0],i[1][1]]),f.set(s+3,[i[0][0],i[1][1]]),this.setSpriteAlign(t,r,n,a,o)}});Lt($2.prototype,Dg);const p5=$2,g5=`@export ecgl.labels.vertex

attribute vec3 position: POSITION;
attribute vec2 texcoord: TEXCOORD_0;
attribute vec2 offset;
#ifdef VERTEX_COLOR
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;
#endif

uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
uniform vec4 viewport : VIEWPORT;

varying vec2 v_Texcoord;

void main()
{
 vec4 proj = worldViewProjection * vec4(position, 1.0);

 vec2 screen = (proj.xy / abs(proj.w) + 1.0) * 0.5 * viewport.zw;

 screen += offset;

 proj.xy = (screen / viewport.zw - 0.5) * 2.0 * abs(proj.w);
 gl_Position = proj;
#ifdef VERTEX_COLOR
 v_Color = a_Color;
#endif
 v_Texcoord = texcoord;
}
@end


@export ecgl.labels.fragment

uniform vec3 color : [1.0, 1.0, 1.0];
uniform float alpha : 1.0;
uniform sampler2D textureAtlas;
uniform vec2 uvScale: [1.0, 1.0];

#ifdef VERTEX_COLOR
varying vec4 v_Color;
#endif
varying float v_Miter;

varying vec2 v_Texcoord;

void main()
{
 gl_FragColor = vec4(color, alpha) * texture2D(textureAtlas, v_Texcoord * uvScale);
#ifdef VERTEX_COLOR
 gl_FragColor *= v_Color;
#endif
}

@end`;tt.Shader.import(g5);const Z2=tt.Mesh.extend(function(){var t=new p5({dynamic:!0}),e=new tt.Material({shader:tt.createShader("ecgl.labels"),transparent:!0,depthMask:!1});return{geometry:t,material:e,culling:!1,castShadow:!1,ignorePicking:!0}});var Bn=Dr.firstNotNull,Fn={x:0,y:2,z:1};function Rg(t,e){var r=new tt.Mesh({geometry:new Lg({useNativeLine:!1}),material:e,castShadow:!1,ignorePicking:!0,renderOrder:2}),i=new Z2;i.material.depthMask=!1;var n=new tt.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 vv={x:"y",y:"x",z:"y"};Rg.prototype.update=function(t,e,r){var i=t.coordinateSystem,n=i.getAxis(this.dim),a=this.linesMesh.geometry,o=this.labelsMesh.geometry;a.convertToDynamicArray(!0),o.convertToDynamicArray(!0);var s=n.model,l=n.getExtent(),E=r.getDevicePixelRatio(),u=s.getModel("axisLine",t.getModel("axisLine")),f=s.getModel("axisTick",t.getModel("axisTick")),h=s.getModel("axisLabel",t.getModel("axisLabel")),v=u.get("lineStyle.color");if(u.get("show")){var c=u.getModel("lineStyle"),d=[0,0,0],p=[0,0,0],g=Fn[n.dim];d[g]=l[0],p[g]=l[1],this.axisLineCoords=[d,p];var m=tt.parseColor(v),_=Bn(c.get("width"),1),y=Bn(c.get("opacity"),1);m[3]*=y,a.addLine(d,p,m,_*E)}if(f.get("show")){var x=f.getModel("lineStyle"),S=tt.parseColor(Bn(x.get("color"),v)),_=Bn(x.get("width"),1);S[3]*=Bn(x.get("opacity"),1);for(var T=n.getTicksCoords(),b=f.get("length"),w=0;w<T.length;w++){var A=T[w].coord,d=[0,0,0],p=[0,0,0],g=Fn[n.dim],C=Fn[vv[n.dim]];d[g]=p[g]=A,p[C]=b,a.addLine(d,p,S,_*E)}}this.labelElements=[];var E=r.getDevicePixelRatio();if(h.get("show"))for(var T=n.getTicksCoords(),D=s.get("data"),L=h.get("margin"),R=n.getViewLabels(),w=0;w<R.length;w++){var N=R[w].tickValue,I=R[w].formattedLabel,F=R[w].rawLabel,A=n.dataToCoord(N),O=[0,0,0],g=Fn[n.dim],C=Fn[vv[n.dim]];O[g]=O[g]=A,O[C]=L;var z=h;D&&D[N]&&D[N].textStyle&&(z=new Te(D[N].textStyle,h,s.ecModel));var k=Bn(z.get("color"),v),it=new Jt({style:tr(z,{text:I,fill:typeof k=="function"?k(n.type==="category"?F:n.type==="value"?N+"":N,w):k,verticalAlign:"top",align:"left"})}),$=e.add(it),nt=it.getBoundingRect();o.addSprite(O,[nt.width*E,nt.height*E],$),this.labelElements.push(it)}if(s.get("name")){var rt=s.getModel("nameTextStyle"),O=[0,0,0],g=Fn[n.dim],C=Fn[vv[n.dim]],It=Bn(rt.get("color"),v),gt=rt.get("borderColor"),_=rt.get("borderWidth");O[g]=O[g]=(l[0]+l[1])/2,O[C]=s.get("nameGap");var it=new Jt({style:tr(rt,{text:s.get("name"),fill:It,stroke:gt,lineWidth:_})}),$=e.add(it),nt=it.getBoundingRect();o.addSprite(O,[nt.width*E,nt.height*E],$),it.__idx=this.labelElements.length,this.nameLabelElement=it}this.labelsMesh.material.set("textureAtlas",e.getTexture()),this.labelsMesh.material.set("uvScale",e.getCoordsScale()),a.convertToTypedArray(),o.convertToTypedArray()};Rg.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],s=o.getBoundingRect();n.setSpriteAlign(a,[s.width*i,s.height*i],t,e)}var l=this.nameLabelElement;if(l){var s=l.getBoundingRect();n.setSpriteAlign(l.__idx,[s.width*i,s.height*i],t,e),n.dirty()}this.textAlign=t,this.textVerticalAlign=e};const m5=`@export ecgl.lines3D.vertex

uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;

attribute vec3 position: POSITION;
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;

void main()
{
 gl_Position = worldViewProjection * vec4(position, 1.0);
 v_Color = a_Color;
}

@end

@export ecgl.lines3D.fragment

uniform vec4 color : [1.0, 1.0, 1.0, 1.0];

varying vec4 v_Color;

@import clay.util.srgb

void main()
{
#ifdef SRGB_DECODE
 gl_FragColor = sRGBToLinear(color * v_Color);
#else
 gl_FragColor = color * v_Color;
#endif
}
@end



@export ecgl.lines3D.clipNear

vec4 clipNear(vec4 p1, vec4 p2) {
 float n = (p1.w - near) / (p1.w - p2.w);
 return vec4(mix(p1.xy, p2.xy, n), -near, near);
}

@end

@export ecgl.lines3D.expandLine
#ifdef VERTEX_ANIMATION
 vec4 prevProj = worldViewProjection * vec4(mix(prevPositionPrev, positionPrev, percent), 1.0);
 vec4 currProj = worldViewProjection * vec4(mix(prevPosition, position, percent), 1.0);
 vec4 nextProj = worldViewProjection * vec4(mix(prevPositionNext, positionNext, percent), 1.0);
#else
 vec4 prevProj = worldViewProjection * vec4(positionPrev, 1.0);
 vec4 currProj = worldViewProjection * vec4(position, 1.0);
 vec4 nextProj = worldViewProjection * vec4(positionNext, 1.0);
#endif

 if (currProj.w < 0.0) {
 if (nextProj.w > 0.0) {
 currProj = clipNear(currProj, nextProj);
 }
 else if (prevProj.w > 0.0) {
 currProj = clipNear(currProj, prevProj);
 }
 }

 vec2 prevScreen = (prevProj.xy / abs(prevProj.w) + 1.0) * 0.5 * viewport.zw;
 vec2 currScreen = (currProj.xy / abs(currProj.w) + 1.0) * 0.5 * viewport.zw;
 vec2 nextScreen = (nextProj.xy / abs(nextProj.w) + 1.0) * 0.5 * viewport.zw;

 vec2 dir;
 float len = offset;
 if (position == positionPrev) {
 dir = normalize(nextScreen - currScreen);
 }
 else if (position == positionNext) {
 dir = normalize(currScreen - prevScreen);
 }
 else {
 vec2 dirA = normalize(currScreen - prevScreen);
 vec2 dirB = normalize(nextScreen - currScreen);

 vec2 tanget = normalize(dirA + dirB);

 float miter = 1.0 / max(dot(tanget, dirA), 0.5);
 len *= miter;
 dir = tanget;
 }

 dir = vec2(-dir.y, dir.x) * len;
 currScreen += dir;

 currProj.xy = (currScreen / viewport.zw - 0.5) * 2.0 * abs(currProj.w);
@end


@export ecgl.meshLines3D.vertex

attribute vec3 position: POSITION;
attribute vec3 positionPrev;
attribute vec3 positionNext;
attribute float offset;
attribute vec4 a_Color : COLOR;

#ifdef VERTEX_ANIMATION
attribute vec3 prevPosition;
attribute vec3 prevPositionPrev;
attribute vec3 prevPositionNext;
uniform float percent : 1.0;
#endif

uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
uniform vec4 viewport : VIEWPORT;
uniform float near : NEAR;

varying vec4 v_Color;

@import ecgl.common.wireframe.vertexHeader

@import ecgl.lines3D.clipNear

void main()
{
 @import ecgl.lines3D.expandLine

 gl_Position = currProj;

 v_Color = a_Color;

 @import ecgl.common.wireframe.vertexMain
}
@end


@export ecgl.meshLines3D.fragment

uniform vec4 color : [1.0, 1.0, 1.0, 1.0];

varying vec4 v_Color;

@import ecgl.common.wireframe.fragmentHeader

@import clay.util.srgb

void main()
{
#ifdef SRGB_DECODE
 gl_FragColor = sRGBToLinear(color * v_Color);
#else
 gl_FragColor = color * v_Color;
#endif

 @import ecgl.common.wireframe.fragmentMain
}

@end`;var Xy=Dr.firstNotNull;tt.Shader.import(m5);var kn={x:0,y:2,z:1};const _5=vr.extend({type:"grid3D",__ecgl__:!0,init:function(t,e){var r=[["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"]],i=["x","y","z"],n=new tt.Material({shader:tt.createShader("ecgl.color"),depthMask:!1,transparent:!0}),a=new tt.Material({shader:tt.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});n.define("fragment","DOUBLE_SIDED"),n.define("both","VERTEX_COLOR"),this.groupGL=new tt.Node,this._control=new h5({zr:e.getZr()}),this._control.init(),this._faces=r.map(function(s){var l=new Sh(s,a,n);return this.groupGL.add(l.rootNode),l},this),this._axes=i.map(function(s){var l=new Rg(s,a);return this.groupGL.add(l.rootNode),l},this);var o=e.getDevicePixelRatio();this._axisLabelSurface=new Vd({width:256,height:256,devicePixelRatio:o}),this._axisLabelSurface.onupdate=function(){e.getZr().refresh()},this._axisPointerLineMesh=new tt.Mesh({geometry:new Lg({useNativeLine:!1}),material:a,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new Vd({width:128,height:128,devicePixelRatio:o}),this._axisPointerLabelsMesh=new Z2({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new tt.Node,this._sceneHelper=new Gd,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(o){o.update(t,e,r)},this),this._axes.forEach(function(o){o.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,r=e.viewGL;t.get("show")&&t.get("axisPointer.show")?r.on("mousemove",this._updateAxisPointerOnMousePosition,this):r.off("mousemove",this._updateAxisPointerOnMousePosition)},_updateAxisPointerOnMousePosition:function(t){if(!t.target){for(var e=this._model,r=e.coordinateSystem,i=r.viewGL,n=i.castRay(t.offsetX,t.offsetY,new tt.Ray),a,o=0;o<this._faces.length;o++){var s=this._faces[o];if(!s.rootNode.invisible){s.plane.normal.dot(i.camera.worldTransform.z)<0&&s.plane.normal.negate();var l=n.intersectPlane(s.plane);if(l){var u=r.getAxis(s.faceInfo[0]),f=r.getAxis(s.faceInfo[1]),h=kn[s.faceInfo[0]],v=kn[s.faceInfo[1]];u.contain(l.array[h])&&f.contain(l.array[v])&&(a=l)}}}if(a){var c=r.pointToData(a.array,[],!0);this._updateAxisPointer(c),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 tt.Vector3;t.update();for(var r=0;r<this._faces.length/2;r++){for(var i=[],n=0;n<2;n++){var a=this._faces[r*2+n];a.rootNode.getWorldPosition(e),e.transformMat4(t.viewMatrix),i[n]=e.z}var o=i[0]>i[1]?0:1,s=this._faces[r*2+o],l=this._faces[r*2+1-o];s.rootNode.invisible=!0,l.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(),u=r.getExtentMin(),f=this._axes[0].rootNode,h=this._axes[1].rootNode,v=this._axes[2].rootNode,c=this._faces,d=c[4].rootNode.invisible?u:l,p=c[2].rootNode.invisible?n:a,g=c[0].rootNode.invisible?o:s,m=c[2].rootNode.invisible?n:a,_=c[0].rootNode.invisible?s:o,y=c[4].rootNode.invisible?u:l;f.rotation.identity(),h.rotation.identity(),v.rotation.identity(),c[4].rootNode.invisible&&(this._axes[0].flipped=!0,f.rotation.rotateX(Math.PI)),c[0].rootNode.invisible&&(this._axes[1].flipped=!0,h.rotation.rotateZ(Math.PI)),c[4].rootNode.invisible&&(this._axes[2].flipped=!0,v.rotation.rotateY(Math.PI)),f.position.set(0,p,d),h.position.set(g,m,0),v.position.set(_,0,y),f.update(),h.update(),v.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var t=this._control.getCamera(),e=[new tt.Vector4,new tt.Vector4],r=new tt.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){var n=i.axisLineCoords;i.labelsMesh.geometry;for(var a=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=e[1].x-e[0].x,s=e[1].y-e[0].y,l=(e[1].x+e[0].x)/2,u=(e[1].y+e[0].y)/2,f,h;Math.abs(s/o)<.5?(f="center",h=u>r.y?"bottom":"top"):(h="middle",f=l>r.x?"left":"right"),i.setSpriteAlign(f,h,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,n=i.geometry,a=this._model.getModel("axisPointer"),o=this._api.getDevicePixelRatio();n.convertToDynamicArray(!0);function s(w){return Dr.firstNotNull(w.model.get("axisPointer.show"),a.get("show"))}function l(w){var A=w.model.getModel("axisPointer",a),C=A.getModel("lineStyle"),E=tt.parseColor(C.get("color")),D=Xy(C.get("width"),1),L=Xy(C.get("opacity"),1);return E[3]*=L,{color:E,lineWidth:D}}for(var u=0;u<this._faces.length;u++){var f=this._faces[u];if(!f.rootNode.invisible){for(var h=f.faceInfo,v=h[3]<0?e.getAxis(h[2]).getExtentMin():e.getAxis(h[2]).getExtentMax(),c=kn[h[2]],d=0;d<2;d++){var p=h[d],g=h[1-d],m=e.getAxis(p),_=e.getAxis(g);if(s(m)){var y=[0,0,0],x=[0,0,0],S=kn[p],T=kn[g];y[S]=x[S]=r[S],y[c]=x[c]=v,y[T]=_.getExtentMin(),x[T]=_.getExtentMax();var b=l(m);n.addLine(y,x,b.color,b.lineWidth*o)}}if(s(e.getAxis(h[2]))){var y=r.slice(),x=r.slice();x[c]=v;var b=l(e.getAxis(h[2]));n.addLine(y,x,b.color,b.lineWidth*o)}}}n.convertToTypedArray(),this._updateAxisPointerLabelsMesh(t),this._api.getZr().refresh()},_updateAxisPointerLabelsMesh:function(t){var e=this._model,r=this._axisPointerLabelsMesh,i=this._axisPointerLabelsSurface,n=e.coordinateSystem,a=e.getModel("axisPointer");r.geometry.convertToDynamicArray(!0),i.clear();var o={x:"y",y:"x",z:"y"};this._axes.forEach(function(s,l){var u=n.getAxis(s.dim),f=u.model,h=f.getModel("axisPointer",a),v=h.getModel("label"),c=h.get("lineStyle.color");if(!(!v.get("show")||!h.get("show"))){var d=t[l],p=v.get("formatter"),g=u.scale.getLabel({value:d});if(p!=null)g=p(g,t);else if(u.scale.type==="interval"||u.scale.type==="log"){var m=gp(u.scale.getTicks()[0]);g=d.toFixed(m+2)}var _=v.get("color"),y=new Jt({style:tr(v,{text:g,fill:_||c,align:"left",verticalAlign:"top"})}),x=i.add(y),S=y.getBoundingRect(),T=this._api.getDevicePixelRatio(),b=s.rootNode.position.toArray(),w=kn[o[s.dim]];b[w]+=(s.flipped?-1:1)*v.get("margin"),b[kn[s.dim]]=u.dataToCoord(t[l]),r.geometry.addSprite(b,[S.width*T,S.height*T],x,s.textAlign,s.textVerticalAlign)}},this),i.getZr().refreshImmediately(),r.material.set("uvScale",i.getCoordsScale()),r.geometry.convertToTypedArray()},dispose:function(){this.groupGL.removeAll(),this._control.dispose(),this._axisLabelSurface.dispose(),this._axisPointerLabelsSurface.dispose()}});function js(t){pg.call(this,t),this.type="cartesian3D",this.dimensions=["x","y","z"],this.size=[0,0,0]}js.prototype={constructor:js,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||[],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||[],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}};sp(js,pg);function Rf(t,e,r){fg.call(this,t,e,r)}Rf.prototype={constructor:Rf,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)}};sp(Rf,fg);var Xd=function(){this._pool={},this._allocatedTextures=[]};Xd.prototype={constructor:Xd,get:function(t){var e=Yy(t);this._pool.hasOwnProperty(e)||(this._pool[e]=[]);var r=this._pool[e];if(!r.length){var i=new Pt(t);return this._allocatedTextures.push(i),i}return r.pop()},put:function(t){var e=Yy(t);this._pool.hasOwnProperty(e)||(this._pool[e]=[]);var r=this._pool[e];r.push(t)},clear:function(t){for(var e=0;e<this._allocatedTextures.length;e++)this._allocatedTextures[e].dispose(t);this._pool={},this._allocatedTextures=[]}};var q2={width:512,height:512,type:B.UNSIGNED_BYTE,format:B.RGBA,wrapS:B.CLAMP_TO_EDGE,wrapT:B.CLAMP_TO_EDGE,minFilter:B.LINEAR_MIPMAP_LINEAR,magFilter:B.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,unpackAlignment:4,premultiplyAlpha:!1},dv=Object.keys(q2);function Yy(t){Ee.defaultsWithPropList(t,q2,dv),y5(t);for(var e="",r=0;r<dv.length;r++){var i=dv[r],n=t[i].toString();e+=n}return e}function y5(t){var e=x5(t.width,t.height);t.format===B.DEPTH_COMPONENT&&(t.useMipmap=!1),(!e||!t.useMipmap)&&(t.minFilter==B.NEAREST_MIPMAP_NEAREST||t.minFilter==B.NEAREST_MIPMAP_LINEAR?t.minFilter=B.NEAREST:(t.minFilter==B.LINEAR_MIPMAP_LINEAR||t.minFilter==B.LINEAR_MIPMAP_NEAREST)&&(t.minFilter=B.LINEAR)),e||(t.wrapS=B.CLAMP_TO_EDGE,t.wrapT=B.CLAMP_TO_EDGE)}function x5(t,e){return(t&t-1)===0&&(e&e-1)===0}const K2=Xd,T5=`@export clay.sm.depth.vertex
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
attribute vec3 position : POSITION;
attribute vec2 texcoord : TEXCOORD_0;
uniform vec2 uvRepeat = vec2(1.0, 1.0);
uniform vec2 uvOffset = vec2(0.0, 0.0);
@import clay.chunk.skinning_header
@import clay.chunk.instancing_header
varying vec4 v_ViewPosition;
varying vec2 v_Texcoord;
void main(){
 vec4 P = vec4(position, 1.0);
#ifdef SKINNING
 @import clay.chunk.skin_matrix
 P = skinMatrixWS * P;
#endif
#ifdef INSTANCING
 @import clay.chunk.instancing_matrix
 P = instanceMat * P;
#endif
 v_ViewPosition = worldViewProjection * P;
 gl_Position = v_ViewPosition;
 v_Texcoord = texcoord * uvRepeat + uvOffset;
}
@end
@export clay.sm.depth.fragment
varying vec4 v_ViewPosition;
varying vec2 v_Texcoord;
uniform float bias : 0.001;
uniform float slopeScale : 1.0;
uniform sampler2D alphaMap;
uniform float alphaCutoff: 0.0;
@import clay.util.encode_float
void main(){
 float depth = v_ViewPosition.z / v_ViewPosition.w;
 if (alphaCutoff > 0.0) {
 if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {
 discard;
 }
 }
#ifdef USE_VSM
 depth = depth * 0.5 + 0.5;
 float moment1 = depth;
 float moment2 = depth * depth;
 #ifdef SUPPORT_STANDARD_DERIVATIVES
 float dx = dFdx(depth);
 float dy = dFdy(depth);
 moment2 += 0.25*(dx*dx+dy*dy);
 #endif
 gl_FragColor = vec4(moment1, moment2, 0.0, 1.0);
#else
 #ifdef SUPPORT_STANDARD_DERIVATIVES
 float dx = dFdx(depth);
 float dy = dFdy(depth);
 depth += sqrt(dx*dx + dy*dy) * slopeScale + bias;
 #else
 depth += bias;
 #endif
 gl_FragColor = encodeFloat(depth * 0.5 + 0.5);
#endif
}
@end
@export clay.sm.debug_depth
uniform sampler2D depthMap;
varying vec2 v_Texcoord;
@import clay.util.decode_float
void main() {
 vec4 tex = texture2D(depthMap, v_Texcoord);
#ifdef USE_VSM
 gl_FragColor = vec4(tex.rgb, 1.0);
#else
 float depth = decodeFloat(tex);
 gl_FragColor = vec4(depth, depth, depth, 1.0);
#endif
}
@end
@export clay.sm.distance.vertex
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
uniform mat4 world : WORLD;
attribute vec3 position : POSITION;
@import clay.chunk.skinning_header
varying vec3 v_WorldPosition;
void main (){
 vec4 P = vec4(position, 1.0);
#ifdef SKINNING
 @import clay.chunk.skin_matrix
 P = skinMatrixWS * P;
#endif
#ifdef INSTANCING
 @import clay.chunk.instancing_matrix
 P = instanceMat * P;
#endif
 gl_Position = worldViewProjection * P;
 v_WorldPosition = (world * P).xyz;
}
@end
@export clay.sm.distance.fragment
uniform vec3 lightPosition;
uniform float range : 100;
varying vec3 v_WorldPosition;
@import clay.util.encode_float
void main(){
 float dist = distance(lightPosition, v_WorldPosition);
#ifdef USE_VSM
 gl_FragColor = vec4(dist, dist * dist, 0.0, 0.0);
#else
 dist = dist / range;
 gl_FragColor = encodeFloat(dist);
#endif
}
@end
@export clay.plugin.shadow_map_common
@import clay.util.decode_float
float tapShadowMap(sampler2D map, vec2 uv, float z){
 vec4 tex = texture2D(map, uv);
 return step(z, decodeFloat(tex) * 2.0 - 1.0);
}
float pcf(sampler2D map, vec2 uv, float z, float textureSize, vec2 scale) {
 float shadowContrib = tapShadowMap(map, uv, z);
 vec2 offset = vec2(1.0 / textureSize) * scale;
#ifdef PCF_KERNEL_SIZE
 for (int _idx_ = 0; _idx_ < PCF_KERNEL_SIZE; _idx_++) {{
 shadowContrib += tapShadowMap(map, uv + offset * pcfKernel[_idx_], z);
 }}
 return shadowContrib / float(PCF_KERNEL_SIZE + 1);
#else
 shadowContrib += tapShadowMap(map, uv+vec2(offset.x, 0.0), z);
 shadowContrib += tapShadowMap(map, uv+vec2(offset.x, offset.y), z);
 shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, offset.y), z);
 shadowContrib += tapShadowMap(map, uv+vec2(0.0, offset.y), z);
 shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, 0.0), z);
 shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, -offset.y), z);
 shadowContrib += tapShadowMap(map, uv+vec2(offset.x, -offset.y), z);
 shadowContrib += tapShadowMap(map, uv+vec2(0.0, -offset.y), z);
 return shadowContrib / 9.0;
#endif
}
float pcf(sampler2D map, vec2 uv, float z, float textureSize) {
 return pcf(map, uv, z, textureSize, vec2(1.0));
}
float chebyshevUpperBound(vec2 moments, float z){
 float p = 0.0;
 z = z * 0.5 + 0.5;
 if (z <= moments.x) {
 p = 1.0;
 }
 float variance = moments.y - moments.x * moments.x;
 variance = max(variance, 0.0000001);
 float mD = moments.x - z;
 float pMax = variance / (variance + mD * mD);
 pMax = clamp((pMax-0.4)/(1.0-0.4), 0.0, 1.0);
 return max(p, pMax);
}
float computeShadowContrib(
 sampler2D map, mat4 lightVPM, vec3 position, float textureSize, vec2 scale, vec2 offset
) {
 vec4 posInLightSpace = lightVPM * vec4(position, 1.0);
 posInLightSpace.xyz /= posInLightSpace.w;
 float z = posInLightSpace.z;
 if(all(greaterThan(posInLightSpace.xyz, vec3(-0.99, -0.99, -1.0))) &&
 all(lessThan(posInLightSpace.xyz, vec3(0.99, 0.99, 1.0)))){
 vec2 uv = (posInLightSpace.xy+1.0) / 2.0;
 #ifdef USE_VSM
 vec2 moments = texture2D(map, uv * scale + offset).xy;
 return chebyshevUpperBound(moments, z);
 #else
 return pcf(map, uv * scale + offset, z, textureSize, scale);
 #endif
 }
 return 1.0;
}
float computeShadowContrib(sampler2D map, mat4 lightVPM, vec3 position, float textureSize) {
 return computeShadowContrib(map, lightVPM, position, textureSize, vec2(1.0), vec2(0.0));
}
float computeShadowContribOmni(samplerCube map, vec3 direction, float range)
{
 float dist = length(direction);
 vec4 shadowTex = textureCube(map, direction);
#ifdef USE_VSM
 vec2 moments = shadowTex.xy;
 float variance = moments.y - moments.x * moments.x;
 float mD = moments.x - dist;
 float p = variance / (variance + mD * mD);
 if(moments.x + 0.001 < dist){
 return clamp(p, 0.0, 1.0);
 }else{
 return 1.0;
 }
#else
 return step(dist, (decodeFloat(shadowTex) + 0.0002) * range);
#endif
}
@end
@export clay.plugin.compute_shadow_map
#if defined(SPOT_LIGHT_SHADOWMAP_COUNT) || defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT) || defined(POINT_LIGHT_SHADOWMAP_COUNT)
#ifdef SPOT_LIGHT_SHADOWMAP_COUNT
uniform sampler2D spotLightShadowMaps[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
uniform mat4 spotLightMatrices[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
uniform float spotLightShadowMapSizes[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
#endif
#ifdef DIRECTIONAL_LIGHT_SHADOWMAP_COUNT
#if defined(SHADOW_CASCADE)
uniform sampler2D directionalLightShadowMaps[1]:unconfigurable;
uniform mat4 directionalLightMatrices[SHADOW_CASCADE]:unconfigurable;
uniform float directionalLightShadowMapSizes[1]:unconfigurable;
uniform float shadowCascadeClipsNear[SHADOW_CASCADE]:unconfigurable;
uniform float shadowCascadeClipsFar[SHADOW_CASCADE]:unconfigurable;
#else
uniform sampler2D directionalLightShadowMaps[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
uniform mat4 directionalLightMatrices[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
uniform float directionalLightShadowMapSizes[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
#endif
#endif
#ifdef POINT_LIGHT_SHADOWMAP_COUNT
uniform samplerCube pointLightShadowMaps[POINT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
#endif
uniform bool shadowEnabled : true;
#ifdef PCF_KERNEL_SIZE
uniform vec2 pcfKernel[PCF_KERNEL_SIZE];
#endif
@import clay.plugin.shadow_map_common
#if defined(SPOT_LIGHT_SHADOWMAP_COUNT)
void computeShadowOfSpotLights(vec3 position, inout float shadowContribs[SPOT_LIGHT_COUNT] ) {
 float shadowContrib;
 for(int _idx_ = 0; _idx_ < SPOT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{
 shadowContrib = computeShadowContrib(
 spotLightShadowMaps[_idx_], spotLightMatrices[_idx_], position,
 spotLightShadowMapSizes[_idx_]
 );
 shadowContribs[_idx_] = shadowContrib;
 }}
 for(int _idx_ = SPOT_LIGHT_SHADOWMAP_COUNT; _idx_ < SPOT_LIGHT_COUNT; _idx_++){{
 shadowContribs[_idx_] = 1.0;
 }}
}
#endif
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
#ifdef SHADOW_CASCADE
void computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){
 float depth = (2.0 * gl_FragCoord.z - gl_DepthRange.near - gl_DepthRange.far)
 / (gl_DepthRange.far - gl_DepthRange.near);
 float shadowContrib;
 shadowContribs[0] = 1.0;
 for (int _idx_ = 0; _idx_ < SHADOW_CASCADE; _idx_++) {{
 if (
 depth >= shadowCascadeClipsNear[_idx_] &&
 depth <= shadowCascadeClipsFar[_idx_]
 ) {
 shadowContrib = computeShadowContrib(
 directionalLightShadowMaps[0], directionalLightMatrices[_idx_], position,
 directionalLightShadowMapSizes[0],
 vec2(1.0 / float(SHADOW_CASCADE), 1.0),
 vec2(float(_idx_) / float(SHADOW_CASCADE), 0.0)
 );
 shadowContribs[0] = shadowContrib;
 }
 }}
 for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{
 shadowContribs[_idx_] = 1.0;
 }}
}
#else
void computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){
 float shadowContrib;
 for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_++) {{
 shadowContrib = computeShadowContrib(
 directionalLightShadowMaps[_idx_], directionalLightMatrices[_idx_], position,
 directionalLightShadowMapSizes[_idx_]
 );
 shadowContribs[_idx_] = shadowContrib;
 }}
 for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{
 shadowContribs[_idx_] = 1.0;
 }}
}
#endif
#endif
#if defined(POINT_LIGHT_SHADOWMAP_COUNT)
void computeShadowOfPointLights(vec3 position, inout float shadowContribs[POINT_LIGHT_COUNT] ){
 vec3 lightPosition;
 vec3 direction;
 for(int _idx_ = 0; _idx_ < POINT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{
 lightPosition = pointLightPosition[_idx_];
 direction = position - lightPosition;
 shadowContribs[_idx_] = computeShadowContribOmni(pointLightShadowMaps[_idx_], direction, pointLightRange[_idx_]);
 }}
 for(int _idx_ = POINT_LIGHT_SHADOWMAP_COUNT; _idx_ < POINT_LIGHT_COUNT; _idx_++) {{
 shadowContribs[_idx_] = 1.0;
 }}
}
#endif
#endif
@end`;var Xi=["px","nx","py","ny","pz","nz"];V.import(T5);function pv(t,e,r){if(r==="alphaMap")return t.material.get("diffuseMap");if(r==="alphaCutoff"){if(t.material.isDefined("fragment","ALPHA_TEST")&&t.material.get("diffuseMap")){var i=t.material.get("alphaCutoff");return i||0}return 0}else return r==="uvRepeat"?t.material.get("uvRepeat"):r==="uvOffset"?t.material.get("uvOffset"):e.get(r)}function $y(t,e){var r=t.material,i=e.material;return r.get("diffuseMap")!==i.get("diffuseMap")||(r.get("alphaCutoff")||0)!==(i.get("alphaCutoff")||0)}var ai=or.extend(function(){return{softShadow:ai.PCF,shadowBlur:1,lightFrustumBias:"auto",kernelPCF:new Float32Array([1,0,1,1,-1,1,0,1,-1,0,-1,-1,1,-1,0,-1]),precision:"highp",_lastRenderNotCastShadow:!1,_frameBuffer:new Ne,_textures:{},_shadowMapNumber:{POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},_depthMaterials:{},_distanceMaterials:{},_receivers:[],_lightsCastShadow:[],_lightCameras:{},_lightMaterials:{},_texturePool:new K2}},function(){this._gaussianPassH=new We({fragment:V.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new We({fragment:V.source("clay.compositor.gaussian_blur")}),this._gaussianPassH.setUniform("blurSize",this.shadowBlur),this._gaussianPassH.setUniform("blurDir",0),this._gaussianPassV.setUniform("blurSize",this.shadowBlur),this._gaussianPassV.setUniform("blurDir",1),this._outputDepthPass=new We({fragment:V.source("clay.sm.debug_depth")})},{render:function(t,e,r,i){r||(r=e.getMainCamera()),this.trigger("beforerender",this,t,e,r),this._renderShadowPass(t,e,r,i),this.trigger("afterrender",this,t,e,r)},renderDebug:function(t,e){t.saveClear();var r=t.viewport,i=0,n=0,a=e||r.width/4,o=a;this.softShadow===ai.VSM?this._outputDepthPass.material.define("fragment","USE_VSM"):this._outputDepthPass.material.undefine("fragment","USE_VSM");for(var s in this._textures){var l=this._textures[s];t.setViewport(i,n,a*l.width/l.height,o),this._outputDepthPass.setUniform("depthMap",l),this._outputDepthPass.render(t),i+=a*l.width/l.height}t.setViewport(r),t.restoreClear()},_updateReceivers:function(t,e){if(e.receiveShadow?(this._receivers.push(e),e.material.set("shadowEnabled",1),e.material.set("pcfKernel",this.kernelPCF)):e.material.set("shadowEnabled",0),this.softShadow===ai.VSM)e.material.define("fragment","USE_VSM"),e.material.undefine("fragment","PCF_KERNEL_SIZE");else{e.material.undefine("fragment","USE_VSM");var r=this.kernelPCF;r&&r.length?e.material.define("fragment","PCF_KERNEL_SIZE",r.length/2):e.material.undefine("fragment","PCF_KERNEL_SIZE")}},_update:function(t,e){var r=this;e.traverse(function(a){a.isRenderable()&&r._updateReceivers(t,a)});for(var i=0;i<e.lights.length;i++){var n=e.lights[i];n.castShadow&&!n.invisible&&this._lightsCastShadow.push(n)}},_renderShadowPass:function(t,e,r,i){for(var n in this._shadowMapNumber)this._shadowMapNumber[n]=0;this._lightsCastShadow.length=0,this._receivers.length=0;var a=t.gl;if(i||e.update(),r&&r.update(),e.updateLights(),this._update(t,e),!this._lightsCastShadow.length&&this._lastRenderNotCastShadow)return;this._lastRenderNotCastShadow=this._lightsCastShadow===0,a.enable(a.DEPTH_TEST),a.depthMask(!0),a.disable(a.BLEND),a.clearColor(1,1,1,1);for(var o=[],s=[],l=[],u=[],f=[],h=[],v,c=0;c<this._lightsCastShadow.length;c++){var d=this._lightsCastShadow[c];if(d.type==="DIRECTIONAL_LIGHT"){if(v){console.warn("Only one direectional light supported with shadow cascade");continue}if(d.shadowCascade>4){console.warn("Support at most 4 cascade");continue}d.shadowCascade>1&&(v=d),this.renderDirectionalLightShadow(t,e,r,d,f,u,l)}else d.type==="SPOT_LIGHT"?this.renderSpotLightShadow(t,e,d,s,o):d.type==="POINT_LIGHT"&&this.renderPointLightShadow(t,e,d,h);this._shadowMapNumber[d.type]++}for(var p in this._shadowMapNumber)for(var g=this._shadowMapNumber[p],m=p+"_SHADOWMAP_COUNT",c=0;c<this._receivers.length;c++){var _=this._receivers[c],y=_.material;y.fragmentDefines[m]!==g&&(g>0?y.define("fragment",m,g):y.isDefined("fragment",m)&&y.undefine("fragment",m))}for(var c=0;c<this._receivers.length;c++){var _=this._receivers[c],y=_.material;v?y.define("fragment","SHADOW_CASCADE",v.shadowCascade):y.undefine("fragment","SHADOW_CASCADE")}var x=e.shadowUniforms;function S(C){return C.height}if(l.length>0){var T=l.map(S);if(x.directionalLightShadowMaps={value:l,type:"tv"},x.directionalLightMatrices={value:u,type:"m4v"},x.directionalLightShadowMapSizes={value:T,type:"1fv"},v){var b=f.slice(),w=f.slice();b.pop(),w.shift(),b.reverse(),w.reverse(),u.reverse(),x.shadowCascadeClipsNear={value:b,type:"1fv"},x.shadowCascadeClipsFar={value:w,type:"1fv"}}}if(o.length>0){var A=o.map(S),x=e.shadowUniforms;x.spotLightShadowMaps={value:o,type:"tv"},x.spotLightMatrices={value:s,type:"m4v"},x.spotLightShadowMapSizes={value:A,type:"1fv"}}h.length>0&&(x.pointLightShadowMaps={value:h,type:"tv"})},renderDirectionalLightShadow:function(){var t=new bg,e=new J,r=new Ve,i=new J,n=new J,a=new J,o=new J;return function(s,l,u,f,h,v,c){var d=this._getDepthMaterial(f),p={getMaterial:function(nt){return nt.shadowDepthMaterial||d},isMaterialChanged:$y,getUniform:pv,ifRender:function(nt){return nt.castShadow},sortCompare:Ds.opaqueSortCompare};if(!l.viewBoundingBoxLastFrame.isFinite()){var g=l.getBoundingBox();l.viewBoundingBoxLastFrame.copy(g).applyTransform(u.viewMatrix)}var m=Math.min(-l.viewBoundingBoxLastFrame.min.z,u.far),_=Math.max(-l.viewBoundingBoxLastFrame.max.z,u.near),y=this._getDirectionalLightCamera(f,l,u),x=a.array;o.copy(y.projectionMatrix),H.invert(n.array,y.worldTransform.array),H.multiply(n.array,n.array,u.worldTransform.array),H.multiply(x,o.array,n.array);for(var S=[],T=u instanceof xe,b=(u.near+u.far)/(u.near-u.far),w=2*u.near*u.far/(u.near-u.far),A=0;A<=f.shadowCascade;A++){var C=_*Math.pow(m/_,A/f.shadowCascade),E=_+(m-_)*A/f.shadowCascade,D=C*f.cascadeSplitLogFactor+E*(1-f.cascadeSplitLogFactor);S.push(D),h.push(-(-D*b+w)/-D)}var L=this._getTexture(f,f.shadowCascade);c.push(L);var R=s.viewport,N=s.gl;this._frameBuffer.attach(L),this._frameBuffer.bind(s),N.clear(N.COLOR_BUFFER_BIT|N.DEPTH_BUFFER_BIT);for(var A=0;A<f.shadowCascade;A++){var I=S[A],F=S[A+1];T?H.perspective(e.array,u.fov/180*Math.PI,u.aspect,I,F):H.ortho(e.array,u.left,u.right,u.bottom,u.top,I,F),t.setFromProjection(e),t.getTransformedBoundingBox(r,n),r.applyProjection(o);var O=r.min.array,z=r.max.array;O[0]=Math.max(O[0],-1),O[1]=Math.max(O[1],-1),z[0]=Math.min(z[0],1),z[1]=Math.min(z[1],1),i.ortho(O[0],z[0],O[1],z[1],1,-1),y.projectionMatrix.multiplyLeft(i);var k=f.shadowResolution||512;s.setViewport((f.shadowCascade-A-1)*k,0,k,k,1);var it=l.updateRenderList(y);s.renderPass(it.opaque,y,p),this.softShadow===ai.VSM&&this._gaussianFilter(s,L,L.width);var $=new J;$.copy(y.viewMatrix).multiplyLeft(y.projectionMatrix),v.push($.array),y.projectionMatrix.copy(o)}this._frameBuffer.unbind(s),s.setViewport(R)}}(),renderSpotLightShadow:function(t,e,r,i,n){var a=this._getTexture(r),o=this._getSpotLightCamera(r),s=t.gl;this._frameBuffer.attach(a),this._frameBuffer.bind(t),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT);var l=this._getDepthMaterial(r),u={getMaterial:function(v){return v.shadowDepthMaterial||l},isMaterialChanged:$y,getUniform:pv,ifRender:function(v){return v.castShadow},sortCompare:Ds.opaqueSortCompare},f=e.updateRenderList(o);t.renderPass(f.opaque,o,u),this._frameBuffer.unbind(t),this.softShadow===ai.VSM&&this._gaussianFilter(t,a,a.width);var h=new J;h.copy(o.worldTransform).invert().multiplyLeft(o.projectionMatrix),n.push(a),i.push(h.array)},renderPointLightShadow:function(t,e,r,i){var n=this._getTexture(r),a=t.gl;i.push(n);var o=this._getDepthMaterial(r),s={getMaterial:function(_){return _.shadowDepthMaterial||o},getUniform:pv,sortCompare:Ds.opaqueSortCompare},l={px:[],py:[],pz:[],nx:[],ny:[],nz:[]},u=new Ve,f=r.getWorldPosition().array,h=new Ve,v=r.range;h.min.setArray(f),h.max.setArray(f);var c=new W(v,v,v);h.max.add(c),h.min.sub(c);var d={px:!1,py:!1,pz:!1,nx:!1,ny:!1,nz:!1};e.traverse(function(_){if(_.isRenderable()&&_.castShadow){var y=_.geometry;if(!y.boundingBox){for(var x=0;x<Xi.length;x++)l[Xi[x]].push(_);return}if(u.transformFrom(y.boundingBox,_.worldTransform),!u.intersectBoundingBox(h))return;u.updateVertices();for(var x=0;x<Xi.length;x++)d[Xi[x]]=!1;for(var x=0;x<8;x++){var S=u.vertices[x],T=S[0]-f[0],b=S[1]-f[1],w=S[2]-f[2],A=Math.abs(T),C=Math.abs(b),E=Math.abs(w);A>C?A>E?d[T>0?"px":"nx"]=!0:d[w>0?"pz":"nz"]=!0:C>E?d[b>0?"py":"ny"]=!0:d[w>0?"pz":"nz"]=!0}for(var x=0;x<Xi.length;x++)d[Xi[x]]&&l[Xi[x]].push(_)}});for(var p=0;p<6;p++){var g=Xi[p],m=this._getPointLightCamera(r,g);this._frameBuffer.attach(n,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+p),this._frameBuffer.bind(t),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT),t.renderPass(l[g],m,s)}this._frameBuffer.unbind(t)},_getDepthMaterial:function(t){var e=this._lightMaterials[t.__uid__],r=t.type==="POINT_LIGHT";if(!e){var i=r?"clay.sm.distance.":"clay.sm.depth.";e=new Ii({precision:this.precision,shader:new V(V.source(i+"vertex"),V.source(i+"fragment"))}),this._lightMaterials[t.__uid__]=e}return t.shadowSlopeScale!=null&&e.setUniform("slopeScale",t.shadowSlopeScale),t.shadowBias!=null&&e.setUniform("bias",t.shadowBias),this.softShadow===ai.VSM?e.define("fragment","USE_VSM"):e.undefine("fragment","USE_VSM"),r&&(e.set("lightPosition",t.getWorldPosition().array),e.set("range",t.range)),e},_gaussianFilter:function(t,e,r){var i={width:r,height:r,type:ut.FLOAT},n=this._texturePool.get(i);this._frameBuffer.attach(n),this._frameBuffer.bind(t),this._gaussianPassH.setUniform("texture",e),this._gaussianPassH.setUniform("textureWidth",r),this._gaussianPassH.render(t),this._frameBuffer.attach(e),this._gaussianPassV.setUniform("texture",n),this._gaussianPassV.setUniform("textureHeight",r),this._gaussianPassV.render(t),this._frameBuffer.unbind(t),this._texturePool.put(n)},_getTexture:function(t,e){var r=t.__uid__,i=this._textures[r],n=t.shadowResolution||512;return e=e||1,i||(t.type==="POINT_LIGHT"?i=new Zs:i=new Pt,i.width=n*e,i.height=n,this.softShadow===ai.VSM?(i.type=ut.FLOAT,i.anisotropic=4):(i.minFilter=B.NEAREST,i.magFilter=B.NEAREST,i.useMipmap=!1),this._textures[r]=i),i},_getPointLightCamera:function(t,e){this._lightCameras.point||(this._lightCameras.point={px:new xe,nx:new xe,py:new xe,ny:new xe,pz:new xe,nz:new xe});var r=this._lightCameras.point[e];switch(r.far=t.range,r.fov=90,r.position.set(0,0,0),e){case"px":r.lookAt(W.POSITIVE_X,W.NEGATIVE_Y);break;case"nx":r.lookAt(W.NEGATIVE_X,W.NEGATIVE_Y);break;case"py":r.lookAt(W.POSITIVE_Y,W.POSITIVE_Z);break;case"ny":r.lookAt(W.NEGATIVE_Y,W.NEGATIVE_Z);break;case"pz":r.lookAt(W.POSITIVE_Z,W.NEGATIVE_Y);break;case"nz":r.lookAt(W.NEGATIVE_Z,W.NEGATIVE_Y);break}return t.getWorldPosition(r.position),r.update(),r},_getDirectionalLightCamera:function(){var t=new J,e=new Ve,r=new Ve;return function(i,n,a){this._lightCameras.directional||(this._lightCameras.directional=new Ks);var o=this._lightCameras.directional;e.copy(n.viewBoundingBoxLastFrame),e.intersection(a.frustum.boundingBox),o.position.copy(e.min).add(e.max).scale(.5).transformMat4(a.worldTransform),o.rotation.copy(i.rotation),o.scale.copy(i.scale),o.updateWorldTransform(),J.invert(t,o.worldTransform),J.multiply(t,t,a.worldTransform),r.copy(e).applyTransform(t);var s=r.min.array,l=r.max.array;return o.position.set((s[0]+l[0])/2,(s[1]+l[1])/2,l[2]).transformMat4(o.worldTransform),o.near=0,o.far=-s[2]+l[2],isNaN(this.lightFrustumBias)?o.far*=4:o.far+=this.lightFrustumBias,o.left=s[0],o.right=l[0],o.top=l[1],o.bottom=s[1],o.update(!0),o}}(),_getSpotLightCamera:function(t){this._lightCameras.spot||(this._lightCameras.spot=new xe);var e=this._lightCameras.spot;return e.fov=t.penumbraAngle*2,e.far=t.range,e.worldTransform.copy(t.worldTransform),e.updateProjectionMatrix(),H.invert(e.viewMatrix.array,e.worldTransform.array),e},dispose:function(t){var e=t.gl||t;this._frameBuffer&&this._frameBuffer.dispose(e);for(var r in this._textures)this._textures[r].dispose(e);this._texturePool.clear(t.gl),this._depthMaterials={},this._distanceMaterials={},this._textures={},this._lightCameras={},this._shadowMapNumber={POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},this._meshMaterials={};for(var i=0;i<this._receivers.length;i++){var n=this._receivers[i];if(n.material){var a=n.material;a.undefine("fragment","POINT_LIGHT_SHADOW_COUNT"),a.undefine("fragment","DIRECTIONAL_LIGHT_SHADOW_COUNT"),a.undefine("fragment","AMBIENT_LIGHT_SHADOW_COUNT"),a.set("shadowEnabled",0)}}this._receivers=[],this._lightsCastShadow=[]}});ai.VSM=1;ai.PCF=2;const S5=ai;var w5=or.extend(function(){return{name:"",inputLinks:{},outputLinks:{},_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}},{updateParameter:function(t,e){var r=this.outputs[t],i=r.parameters,n=r._parametersCopy;if(n||(n=r._parametersCopy={}),i)for(var a in i)a!=="width"&&a!=="height"&&(n[a]=i[a]);var o,s;return i.width instanceof Function?o=i.width.call(this,e):o=i.width,i.height instanceof Function?s=i.height.call(this,e):s=i.height,(n.width!==o||n.height!==s)&&this._outputTextures[t]&&this._outputTextures[t].dispose(e.gl),n.width=o,n.height=s,n},setParameter:function(t,e){},getParameter:function(t){},setParameters:function(t){for(var e in t)this.setParameter(e,t[e])},render:function(){},getOutput:function(t,e){if(e==null)return e=t,this._outputTextures[e];var r=this.outputs[e];if(r)return this._rendered?r.outputLastFrame?this._prevOutputTextures[e]:this._outputTextures[e]:this._rendering?(this._prevOutputTextures[e]||(this._prevOutputTextures[e]=this._compositor.allocateTexture(r.parameters||{})),this._prevOutputTextures[e]):(this.render(t),this._outputTextures[e])},removeReference:function(t){if(this._outputReferences[t]--,this._outputReferences[t]===0){var e=this.outputs[t];e.keepLastFrame?(this._prevOutputTextures[t]&&this._compositor.releaseTexture(this._prevOutputTextures[t]),this._prevOutputTextures[t]=this._outputTextures[t]):this._compositor.releaseTexture(this._outputTextures[t])}},link:function(t,e,r){this.inputLinks[t]={node:e,pin:r},e.outputLinks[r]||(e.outputLinks[r]=[]),e.outputLinks[r].push({node:this,pin:t}),this.pass.material.enableTexture(t)},clear:function(){this.inputLinks={},this.outputLinks={}},updateReference:function(t){if(!this._rendering){this._rendering=!0;for(var e in this.inputLinks){var r=this.inputLinks[e];r.node.updateReference(r.pin)}this._rendering=!1}t&&this._outputReferences[t]++},beforeFrame:function(){this._rendered=!1;for(var t in this.outputLinks)this._outputReferences[t]=0},afterFrame:function(){for(var t in this.outputLinks)if(this._outputReferences[t]>0){var e=this.outputs[t];e.keepLastFrame?(this._prevOutputTextures[t]&&this._compositor.releaseTexture(this._prevOutputTextures[t]),this._prevOutputTextures[t]=this._outputTextures[t]):this._compositor.releaseTexture(this._outputTextures[t])}}});const Qs=w5;var b5=or.extend(function(){return{nodes:[]}},{dirty:function(){this._dirty=!0},addNode:function(t){this.nodes.indexOf(t)>=0||(this.nodes.push(t),this._dirty=!0)},removeNode:function(t){typeof t=="string"&&(t=this.getNodeByName(t));var e=this.nodes.indexOf(t);e>=0&&(this.nodes.splice(e,1),this._dirty=!0)},getNodeByName:function(t){for(var e=0;e<this.nodes.length;e++)if(this.nodes[e].name===t)return this.nodes[e]},update:function(){for(var t=0;t<this.nodes.length;t++)this.nodes[t].clear();for(var t=0;t<this.nodes.length;t++){var e=this.nodes[t];if(e.inputs){for(var r in e.inputs)if(e.inputs[r]){if(e.pass&&!e.pass.material.isUniformEnabled(r)){console.warn("Pin "+e.name+"."+r+" not used.");continue}var i=e.inputs[r],n=this.findPin(i);n?e.link(r,n.node,n.pin):console.warn(typeof i=="string"?"Node "+i+" not exist":"Pin of "+i.node+"."+i.pin+" not exist")}}}},findPin:function(t){var e;if((typeof t=="string"||t instanceof Qs)&&(t={node:t}),typeof t.node=="string")for(var r=0;r<this.nodes.length;r++){var i=this.nodes[r];i.name===t.node&&(e=i)}else e=t.node;if(e){var n=t.pin;if(n||e.outputs&&(n=Object.keys(e.outputs)[0]),e.outputs[n])return{node:e,pin:n}}}});const Zy=b5;var A5=Zy.extend(function(){return{_outputs:[],_texturePool:new K2,_frameBuffer:new Ne({depthBuffer:!1})}},{addNode:function(t){Zy.prototype.addNode.call(this,t),t._compositor=this},render:function(t,e){if(this._dirty){this.update(),this._dirty=!1,this._outputs.length=0;for(var r=0;r<this.nodes.length;r++)this.nodes[r].outputs||this._outputs.push(this.nodes[r])}for(var r=0;r<this.nodes.length;r++)this.nodes[r].beforeFrame();for(var r=0;r<this._outputs.length;r++)this._outputs[r].updateReference();for(var r=0;r<this._outputs.length;r++)this._outputs[r].render(t,e);for(var r=0;r<this.nodes.length;r++)this.nodes[r].afterFrame()},allocateTexture:function(t){return this._texturePool.get(t)},releaseTexture:function(t){this._texturePool.put(t)},getFrameBuffer:function(){return this._frameBuffer},dispose:function(t){this._texturePool.clear(t)}});const E5=A5;var C5=Qs.extend({name:"scene",scene:null,camera:null,autoUpdateScene:!0,preZ:!1},function(){this.frameBuffer=new Ne},{render:function(t){this._rendering=!0;var e=t.gl;this.trigger("beforerender");var r;if(!this.outputs)r=t.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ);else{var i=this.frameBuffer;for(var n in this.outputs){var a=this.updateParameter(n,t),o=this.outputs[n],s=this._compositor.allocateTexture(a);this._outputTextures[n]=s;var l=o.attachment||e.COLOR_ATTACHMENT0;typeof l=="string"&&(l=e[l]),i.attach(s,l)}i.bind(t);var u=t.getGLExtension("EXT_draw_buffers");if(u){var f=[];for(var l in this.outputs)l=parseInt(l),l>=e.COLOR_ATTACHMENT0&&l<=e.COLOR_ATTACHMENT0+8&&f.push(l);u.drawBuffersEXT(f)}t.saveClear(),t.clearBit=B.DEPTH_BUFFER_BIT|B.COLOR_BUFFER_BIT,r=t.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),t.restoreClear(),i.unbind(t)}this.trigger("afterrender",r),this._rendering=!1,this._rendered=!0}});const M5=C5;var D5=Qs.extend(function(){return{texture:null,outputs:{color:{}}}},function(){},{getOutput:function(t,e){return this.texture},beforeFrame:function(){},afterFrame:function(){}});const L5=D5;var R5=Qs.extend(function(){return{name:"",inputs:{},outputs:null,shader:"",inputLinks:{},outputLinks:{},pass:null,_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}},function(){var t=new We({fragment:this.shader});this.pass=t},{render:function(t,e){this.trigger("beforerender",t),this._rendering=!0;var r=t.gl;for(var i in this.inputLinks){var n=this.inputLinks[i],a=n.node.getOutput(t,n.pin);this.pass.setUniform(i,a)}if(!this.outputs)this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(t),this.pass.render(t,e);else{this.pass.outputs={};var o={};for(var s in this.outputs){var l=this.updateParameter(s,t);isNaN(l.width)&&this.updateParameter(s,t);var u=this.outputs[s],f=this._compositor.allocateTexture(l);this._outputTextures[s]=f;var h=u.attachment||r.COLOR_ATTACHMENT0;typeof h=="string"&&(h=r[h]),o[h]=f}this._compositor.getFrameBuffer().bind(t);for(var h in o)this._compositor.getFrameBuffer().attach(o[h],h);this.pass.render(t),this._compositor.getFrameBuffer().updateMipmap(t)}for(var i in this.inputLinks){var n=this.inputLinks[i];n.node.removeReference(n.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",t)},updateParameter:function(t,e){var r=this.outputs[t],i=r.parameters,n=r._parametersCopy;if(n||(n=r._parametersCopy={}),i)for(var a in i)a!=="width"&&a!=="height"&&(n[a]=i[a]);var o,s;return typeof i.width=="function"?o=i.width.call(this,e):o=i.width,typeof i.height=="function"?s=i.height.call(this,e):s=i.height,o=Math.ceil(o),s=Math.ceil(s),(n.width!==o||n.height!==s)&&this._outputTextures[t]&&this._outputTextures[t].dispose(e),n.width=o,n.height=s,n},setParameter:function(t,e){this.pass.setUniform(t,e)},getParameter:function(t){return this.pass.getUniform(t)},setParameters:function(t){for(var e in t)this.setParameter(e,t[e])},define:function(t,e){this.pass.material.define("fragment",t,e)},undefine:function(t){this.pass.material.undefine("fragment",t)},removeReference:function(t){if(this._outputReferences[t]--,this._outputReferences[t]===0){var e=this.outputs[t];e.keepLastFrame?(this._prevOutputTextures[t]&&this._compositor.releaseTexture(this._prevOutputTextures[t]),this._prevOutputTextures[t]=this._outputTextures[t]):this._compositor.releaseTexture(this._outputTextures[t])}},clear:function(){Qs.prototype.clear.call(this),this.pass.material.disableTexturesAll()}});const P5=R5,I5=`@export clay.compositor.coloradjust
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float brightness : 0.0;
uniform float contrast : 1.0;
uniform float exposure : 0.0;
uniform float gamma : 1.0;
uniform float saturation : 1.0;
const vec3 w = vec3(0.2125, 0.7154, 0.0721);
void main()
{
 vec4 tex = texture2D( texture, v_Texcoord);
 vec3 color = clamp(tex.rgb + vec3(brightness), 0.0, 1.0);
 color = clamp( (color-vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);
 color = clamp( color * pow(2.0, exposure), 0.0, 1.0);
 color = clamp( pow(color, vec3(gamma)), 0.0, 1.0);
 float luminance = dot( color, w );
 color = mix(vec3(luminance), color, saturation);
 gl_FragColor = vec4(color, tex.a);
}
@end
@export clay.compositor.brightness
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float brightness : 0.0;
void main()
{
 vec4 tex = texture2D( texture, v_Texcoord);
 vec3 color = tex.rgb + vec3(brightness);
 gl_FragColor = vec4(color, tex.a);
}
@end
@export clay.compositor.contrast
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float contrast : 1.0;
void main()
{
 vec4 tex = texture2D( texture, v_Texcoord);
 vec3 color = (tex.rgb-vec3(0.5))*contrast+vec3(0.5);
 gl_FragColor = vec4(color, tex.a);
}
@end
@export clay.compositor.exposure
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float exposure : 0.0;
void main()
{
 vec4 tex = texture2D(texture, v_Texcoord);
 vec3 color = tex.rgb * pow(2.0, exposure);
 gl_FragColor = vec4(color, tex.a);
}
@end
@export clay.compositor.gamma
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float gamma : 1.0;
void main()
{
 vec4 tex = texture2D(texture, v_Texcoord);
 vec3 color = pow(tex.rgb, vec3(gamma));
 gl_FragColor = vec4(color, tex.a);
}
@end
@export clay.compositor.saturation
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float saturation : 1.0;
const vec3 w = vec3(0.2125, 0.7154, 0.0721);
void main()
{
 vec4 tex = texture2D(texture, v_Texcoord);
 vec3 color = tex.rgb;
 float luminance = dot(color, w);
 color = mix(vec3(luminance), color, saturation);
 gl_FragColor = vec4(color, tex.a);
}
@end`,j2=`@export clay.compositor.kernel.gaussian_9
float gaussianKernel[9];
gaussianKernel[0] = 0.07;
gaussianKernel[1] = 0.09;
gaussianKernel[2] = 0.12;
gaussianKernel[3] = 0.14;
gaussianKernel[4] = 0.16;
gaussianKernel[5] = 0.14;
gaussianKernel[6] = 0.12;
gaussianKernel[7] = 0.09;
gaussianKernel[8] = 0.07;
@end
@export clay.compositor.kernel.gaussian_13
float gaussianKernel[13];
gaussianKernel[0] = 0.02;
gaussianKernel[1] = 0.03;
gaussianKernel[2] = 0.06;
gaussianKernel[3] = 0.08;
gaussianKernel[4] = 0.11;
gaussianKernel[5] = 0.13;
gaussianKernel[6] = 0.14;
gaussianKernel[7] = 0.13;
gaussianKernel[8] = 0.11;
gaussianKernel[9] = 0.08;
gaussianKernel[10] = 0.06;
gaussianKernel[11] = 0.03;
gaussianKernel[12] = 0.02;
@end
@export clay.compositor.gaussian_blur
#define SHADER_NAME gaussian_blur
uniform sampler2D texture;varying vec2 v_Texcoord;
uniform float blurSize : 2.0;
uniform vec2 textureSize : [512.0, 512.0];
uniform float blurDir : 0.0;
@import clay.util.rgbm
@import clay.util.clamp_sample
void main (void)
{
 @import clay.compositor.kernel.gaussian_9
 vec2 off = blurSize / textureSize;
 off *= vec2(1.0 - blurDir, blurDir);
 vec4 sum = vec4(0.0);
 float weightAll = 0.0;
 for (int i = 0; i < 9; i++) {
 float w = gaussianKernel[i];
 vec4 texel = decodeHDR(clampSample(texture, v_Texcoord + float(i - 4) * off));
 sum += texel * w;
 weightAll += w;
 }
 gl_FragColor = encodeHDR(sum / max(weightAll, 0.01));
}
@end
`,N5=`@export clay.compositor.hdr.log_lum
varying vec2 v_Texcoord;
uniform sampler2D texture;
const vec3 w = vec3(0.2125, 0.7154, 0.0721);
@import clay.util.rgbm
void main()
{
 vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));
 float luminance = dot(tex.rgb, w);
 luminance = log(luminance + 0.001);
 gl_FragColor = encodeHDR(vec4(vec3(luminance), 1.0));
}
@end
@export clay.compositor.hdr.lum_adaption
varying vec2 v_Texcoord;
uniform sampler2D adaptedLum;
uniform sampler2D currentLum;
uniform float frameTime : 0.02;
@import clay.util.rgbm
void main()
{
 float fAdaptedLum = decodeHDR(texture2D(adaptedLum, vec2(0.5, 0.5))).r;
 float fCurrentLum = exp(encodeHDR(texture2D(currentLum, vec2(0.5, 0.5))).r);
 fAdaptedLum += (fCurrentLum - fAdaptedLum) * (1.0 - pow(0.98, 30.0 * frameTime));
 gl_FragColor = encodeHDR(vec4(vec3(fAdaptedLum), 1.0));
}
@end
@export clay.compositor.lum
varying vec2 v_Texcoord;
uniform sampler2D texture;
const vec3 w = vec3(0.2125, 0.7154, 0.0721);
void main()
{
 vec4 tex = texture2D( texture, v_Texcoord );
 float luminance = dot(tex.rgb, w);
 gl_FragColor = vec4(vec3(luminance), 1.0);
}
@end`,Q2=`
@export clay.compositor.lut
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform sampler2D lookup;
void main()
{
 vec4 tex = texture2D(texture, v_Texcoord);
 float blueColor = tex.b * 63.0;
 vec2 quad1;
 quad1.y = floor(floor(blueColor) / 8.0);
 quad1.x = floor(blueColor) - (quad1.y * 8.0);
 vec2 quad2;
 quad2.y = floor(ceil(blueColor) / 8.0);
 quad2.x = ceil(blueColor) - (quad2.y * 8.0);
 vec2 texPos1;
 texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);
 texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);
 vec2 texPos2;
 texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);
 texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);
 vec4 newColor1 = texture2D(lookup, texPos1);
 vec4 newColor2 = texture2D(lookup, texPos2);
 vec4 newColor = mix(newColor1, newColor2, fract(blueColor));
 gl_FragColor = vec4(newColor.rgb, tex.w);
}
@end`,O5=`@export clay.compositor.vignette
#define OUTPUT_ALPHA
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float darkness: 1;
uniform float offset: 1;
@import clay.util.rgbm
void main()
{
 vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));
 gl_FragColor.rgb = texel.rgb;
 vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(offset);
 gl_FragColor = encodeHDR(vec4(mix(texel.rgb, vec3(1.0 - darkness), dot(uv, uv)), texel.a));
}
@end`,J2=`@export clay.compositor.output
#define OUTPUT_ALPHA
varying vec2 v_Texcoord;
uniform sampler2D texture;
@import clay.util.rgbm
void main()
{
 vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));
 gl_FragColor.rgb = tex.rgb;
#ifdef OUTPUT_ALPHA
 gl_FragColor.a = tex.a;
#else
 gl_FragColor.a = 1.0;
#endif
 gl_FragColor = encodeHDR(gl_FragColor);
#ifdef PREMULTIPLY_ALPHA
 gl_FragColor.rgb *= gl_FragColor.a;
#endif
}
@end`,tb=`@export clay.compositor.bright
uniform sampler2D texture;
uniform float threshold : 1;
uniform float scale : 1.0;
uniform vec2 textureSize: [512, 512];
varying vec2 v_Texcoord;
const vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);
@import clay.util.rgbm
vec4 median(vec4 a, vec4 b, vec4 c)
{
 return a + b + c - min(min(a, b), c) - max(max(a, b), c);
}
void main()
{
 vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));
#ifdef ANTI_FLICKER
 vec3 d = 1.0 / textureSize.xyx * vec3(1.0, 1.0, 0.0);
 vec4 s1 = decodeHDR(texture2D(texture, v_Texcoord - d.xz));
 vec4 s2 = decodeHDR(texture2D(texture, v_Texcoord + d.xz));
 vec4 s3 = decodeHDR(texture2D(texture, v_Texcoord - d.zy));
 vec4 s4 = decodeHDR(texture2D(texture, v_Texcoord + d.zy));
 texel = median(median(texel, s1, s2), s3, s4);
#endif
 float lum = dot(texel.rgb , lumWeight);
 vec4 color;
 if (lum > threshold && texel.a > 0.0)
 {
 color = vec4(texel.rgb * scale, texel.a * scale);
 }
 else
 {
 color = vec4(0.0);
 }
 gl_FragColor = encodeHDR(color);
}
@end
`,eb=`@export clay.compositor.downsample
uniform sampler2D texture;
uniform vec2 textureSize : [512, 512];
varying vec2 v_Texcoord;
@import clay.util.rgbm
float brightness(vec3 c)
{
 return max(max(c.r, c.g), c.b);
}
@import clay.util.clamp_sample
void main()
{
 vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;
#ifdef ANTI_FLICKER
 vec3 s1 = decodeHDR(clampSample(texture, v_Texcoord + d.xy)).rgb;
 vec3 s2 = decodeHDR(clampSample(texture, v_Texcoord + d.zy)).rgb;
 vec3 s3 = decodeHDR(clampSample(texture, v_Texcoord + d.xw)).rgb;
 vec3 s4 = decodeHDR(clampSample(texture, v_Texcoord + d.zw)).rgb;
 float s1w = 1.0 / (brightness(s1) + 1.0);
 float s2w = 1.0 / (brightness(s2) + 1.0);
 float s3w = 1.0 / (brightness(s3) + 1.0);
 float s4w = 1.0 / (brightness(s4) + 1.0);
 float oneDivideSum = 1.0 / (s1w + s2w + s3w + s4w);
 vec4 color = vec4(
 (s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * oneDivideSum,
 1.0
 );
#else
 vec4 color = decodeHDR(clampSample(texture, v_Texcoord + d.xy));
 color += decodeHDR(clampSample(texture, v_Texcoord + d.zy));
 color += decodeHDR(clampSample(texture, v_Texcoord + d.xw));
 color += decodeHDR(clampSample(texture, v_Texcoord + d.zw));
 color *= 0.25;
#endif
 gl_FragColor = encodeHDR(color);
}
@end`,rb=`
@export clay.compositor.upsample
#define HIGH_QUALITY
uniform sampler2D texture;
uniform vec2 textureSize : [512, 512];
uniform float sampleScale: 0.5;
varying vec2 v_Texcoord;
@import clay.util.rgbm
@import clay.util.clamp_sample
void main()
{
#ifdef HIGH_QUALITY
 vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;
 vec4 s;
 s = decodeHDR(clampSample(texture, v_Texcoord - d.xy));
 s += decodeHDR(clampSample(texture, v_Texcoord - d.wy)) * 2.0;
 s += decodeHDR(clampSample(texture, v_Texcoord - d.zy));
 s += decodeHDR(clampSample(texture, v_Texcoord + d.zw)) * 2.0;
 s += decodeHDR(clampSample(texture, v_Texcoord )) * 4.0;
 s += decodeHDR(clampSample(texture, v_Texcoord + d.xw)) * 2.0;
 s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));
 s += decodeHDR(clampSample(texture, v_Texcoord + d.wy)) * 2.0;
 s += decodeHDR(clampSample(texture, v_Texcoord + d.xy));
 gl_FragColor = encodeHDR(s / 16.0);
#else
 vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;
 vec4 s;
 s = decodeHDR(clampSample(texture, v_Texcoord + d.xy));
 s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));
 s += decodeHDR(clampSample(texture, v_Texcoord + d.xw));
 s += decodeHDR(clampSample(texture, v_Texcoord + d.zw));
 gl_FragColor = encodeHDR(s / 4.0);
#endif
}
@end`,ib=`@export clay.compositor.hdr.composite
#define TONEMAPPING
uniform sampler2D texture;
#ifdef BLOOM_ENABLED
uniform sampler2D bloom;
#endif
#ifdef LENSFLARE_ENABLED
uniform sampler2D lensflare;
uniform sampler2D lensdirt;
#endif
#ifdef LUM_ENABLED
uniform sampler2D lum;
#endif
#ifdef LUT_ENABLED
uniform sampler2D lut;
#endif
#ifdef COLOR_CORRECTION
uniform float brightness : 0.0;
uniform float contrast : 1.0;
uniform float saturation : 1.0;
#endif
#ifdef VIGNETTE
uniform float vignetteDarkness: 1.0;
uniform float vignetteOffset: 1.0;
#endif
uniform float exposure : 1.0;
uniform float bloomIntensity : 0.25;
uniform float lensflareIntensity : 1;
varying vec2 v_Texcoord;
@import clay.util.srgb
vec3 ACESToneMapping(vec3 color)
{
 const float A = 2.51;
 const float B = 0.03;
 const float C = 2.43;
 const float D = 0.59;
 const float E = 0.14;
 return (color * (A * color + B)) / (color * (C * color + D) + E);
}
float eyeAdaption(float fLum)
{
 return mix(0.2, fLum, 0.5);
}
#ifdef LUT_ENABLED
vec3 lutTransform(vec3 color) {
 float blueColor = color.b * 63.0;
 vec2 quad1;
 quad1.y = floor(floor(blueColor) / 8.0);
 quad1.x = floor(blueColor) - (quad1.y * 8.0);
 vec2 quad2;
 quad2.y = floor(ceil(blueColor) / 8.0);
 quad2.x = ceil(blueColor) - (quad2.y * 8.0);
 vec2 texPos1;
 texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);
 texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);
 vec2 texPos2;
 texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);
 texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);
 vec4 newColor1 = texture2D(lut, texPos1);
 vec4 newColor2 = texture2D(lut, texPos2);
 vec4 newColor = mix(newColor1, newColor2, fract(blueColor));
 return newColor.rgb;
}
#endif
@import clay.util.rgbm
void main()
{
 vec4 texel = vec4(0.0);
 vec4 originalTexel = vec4(0.0);
#ifdef TEXTURE_ENABLED
 texel = decodeHDR(texture2D(texture, v_Texcoord));
 originalTexel = texel;
#endif
#ifdef BLOOM_ENABLED
 vec4 bloomTexel = decodeHDR(texture2D(bloom, v_Texcoord));
 texel.rgb += bloomTexel.rgb * bloomIntensity;
 texel.a += bloomTexel.a * bloomIntensity;
#endif
#ifdef LENSFLARE_ENABLED
 texel += decodeHDR(texture2D(lensflare, v_Texcoord)) * texture2D(lensdirt, v_Texcoord) * lensflareIntensity;
#endif
 texel.a = min(texel.a, 1.0);
#ifdef LUM_ENABLED
 float fLum = texture2D(lum, vec2(0.5, 0.5)).r;
 float adaptedLumDest = 3.0 / (max(0.1, 1.0 + 10.0*eyeAdaption(fLum)));
 float exposureBias = adaptedLumDest * exposure;
#else
 float exposureBias = exposure;
#endif
#ifdef TONEMAPPING
 texel.rgb *= exposureBias;
 texel.rgb = ACESToneMapping(texel.rgb);
#endif
 texel = linearTosRGB(texel);
#ifdef LUT_ENABLED
 texel.rgb = lutTransform(clamp(texel.rgb,vec3(0.0),vec3(1.0)));
#endif
#ifdef COLOR_CORRECTION
 texel.rgb = clamp(texel.rgb + vec3(brightness), 0.0, 1.0);
 texel.rgb = clamp((texel.rgb - vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);
 float lum = dot(texel.rgb, vec3(0.2125, 0.7154, 0.0721));
 texel.rgb = mix(vec3(lum), texel.rgb, saturation);
#endif
#ifdef VIGNETTE
 vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(vignetteOffset);
 texel.rgb = mix(texel.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));
#endif
 gl_FragColor = encodeHDR(texel);
#ifdef DEBUG
 #if DEBUG == 1
 gl_FragColor = encodeHDR(decodeHDR(texture2D(texture, v_Texcoord)));
 #elif DEBUG == 2
 gl_FragColor = encodeHDR(decodeHDR(texture2D(bloom, v_Texcoord)) * bloomIntensity);
 #elif DEBUG == 3
 gl_FragColor = encodeHDR(decodeHDR(texture2D(lensflare, v_Texcoord) * lensflareIntensity));
 #endif
#endif
 if (originalTexel.a <= 0.01 && gl_FragColor.a > 1e-5) {
 gl_FragColor.a = dot(gl_FragColor.rgb, vec3(0.2125, 0.7154, 0.0721));
 }
#ifdef PREMULTIPLY_ALPHA
 gl_FragColor.rgb *= gl_FragColor.a;
#endif
}
@end`,B5=`@export clay.compositor.lensflare
#define SAMPLE_NUMBER 8
uniform sampler2D texture;
uniform sampler2D lenscolor;
uniform vec2 textureSize : [512, 512];
uniform float dispersal : 0.3;
uniform float haloWidth : 0.4;
uniform float distortion : 1.0;
varying vec2 v_Texcoord;
@import clay.util.rgbm
vec4 textureDistorted(
 in vec2 texcoord,
 in vec2 direction,
 in vec3 distortion
) {
 return vec4(
 decodeHDR(texture2D(texture, texcoord + direction * distortion.r)).r,
 decodeHDR(texture2D(texture, texcoord + direction * distortion.g)).g,
 decodeHDR(texture2D(texture, texcoord + direction * distortion.b)).b,
 1.0
 );
}
void main()
{
 vec2 texcoord = -v_Texcoord + vec2(1.0); vec2 textureOffset = 1.0 / textureSize;
 vec2 ghostVec = (vec2(0.5) - texcoord) * dispersal;
 vec2 haloVec = normalize(ghostVec) * haloWidth;
 vec3 distortion = vec3(-textureOffset.x * distortion, 0.0, textureOffset.x * distortion);
 vec4 result = vec4(0.0);
 for (int i = 0; i < SAMPLE_NUMBER; i++)
 {
 vec2 offset = fract(texcoord + ghostVec * float(i));
 float weight = length(vec2(0.5) - offset) / length(vec2(0.5));
 weight = pow(1.0 - weight, 10.0);
 result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;
 }
 result *= texture2D(lenscolor, vec2(length(vec2(0.5) - texcoord)) / length(vec2(0.5)));
 float weight = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));
 weight = pow(1.0 - weight, 10.0);
 vec2 offset = fract(texcoord + haloVec);
 result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;
 gl_FragColor = result;
}
@end`,nb=`@export clay.compositor.blend
#define SHADER_NAME blend
#ifdef TEXTURE1_ENABLED
uniform sampler2D texture1;
uniform float weight1 : 1.0;
#endif
#ifdef TEXTURE2_ENABLED
uniform sampler2D texture2;
uniform float weight2 : 1.0;
#endif
#ifdef TEXTURE3_ENABLED
uniform sampler2D texture3;
uniform float weight3 : 1.0;
#endif
#ifdef TEXTURE4_ENABLED
uniform sampler2D texture4;
uniform float weight4 : 1.0;
#endif
#ifdef TEXTURE5_ENABLED
uniform sampler2D texture5;
uniform float weight5 : 1.0;
#endif
#ifdef TEXTURE6_ENABLED
uniform sampler2D texture6;
uniform float weight6 : 1.0;
#endif
varying vec2 v_Texcoord;
@import clay.util.rgbm
void main()
{
 vec4 tex = vec4(0.0);
#ifdef TEXTURE1_ENABLED
 tex += decodeHDR(texture2D(texture1, v_Texcoord)) * weight1;
#endif
#ifdef TEXTURE2_ENABLED
 tex += decodeHDR(texture2D(texture2, v_Texcoord)) * weight2;
#endif
#ifdef TEXTURE3_ENABLED
 tex += decodeHDR(texture2D(texture3, v_Texcoord)) * weight3;
#endif
#ifdef TEXTURE4_ENABLED
 tex += decodeHDR(texture2D(texture4, v_Texcoord)) * weight4;
#endif
#ifdef TEXTURE5_ENABLED
 tex += decodeHDR(texture2D(texture5, v_Texcoord)) * weight5;
#endif
#ifdef TEXTURE6_ENABLED
 tex += decodeHDR(texture2D(texture6, v_Texcoord)) * weight6;
#endif
 gl_FragColor = encodeHDR(tex);
}
@end`,ab=`@export clay.compositor.fxaa
uniform sampler2D texture;
uniform vec4 viewport : VIEWPORT;
varying vec2 v_Texcoord;
#define FXAA_REDUCE_MIN (1.0/128.0)
#define FXAA_REDUCE_MUL (1.0/8.0)
#define FXAA_SPAN_MAX 8.0
@import clay.util.rgbm
void main()
{
 vec2 resolution = 1.0 / viewport.zw;
 vec3 rgbNW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ) ).xyz;
 vec3 rgbNE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ) ).xyz;
 vec3 rgbSW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ) ).xyz;
 vec3 rgbSE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ) ).xyz;
 vec4 rgbaM = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution ) );
 vec3 rgbM = rgbaM.xyz;
 float opacity = rgbaM.w;
 vec3 luma = vec3( 0.299, 0.587, 0.114 );
 float lumaNW = dot( rgbNW, luma );
 float lumaNE = dot( rgbNE, luma );
 float lumaSW = dot( rgbSW, luma );
 float lumaSE = dot( rgbSE, luma );
 float lumaM = dot( rgbM, luma );
 float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );
 float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );
 vec2 dir;
 dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
 dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
 float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );
 float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );
 dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),
 max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
 dir * rcpDirMin)) * resolution;
 vec3 rgbA = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ) ).xyz;
 rgbA += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ) ).xyz;
 rgbA *= 0.5;
 vec3 rgbB = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * -0.5 ) ).xyz;
 rgbB += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * 0.5 ) ).xyz;
 rgbB *= 0.25;
 rgbB += rgbA * 0.5;
 float lumaB = dot( rgbB, luma );
 if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) )
 {
 gl_FragColor = vec4( rgbA, opacity );
 }
 else {
 gl_FragColor = vec4( rgbB, opacity );
 }
}
@end`;function F5(t){t.import(I5),t.import(j2),t.import(N5),t.import(Q2),t.import(O5),t.import(J2),t.import(tb),t.import(eb),t.import(rb),t.import(ib),t.import(B5),t.import(nb),t.import(ab)}F5(V);var k5=/^#source\((.*?)\)/;function z5(t,e){var r=new E5;e=e||{};var i={textures:{},parameters:{}},n=function(s,l){for(var u=0;u<t.nodes.length;u++){var f=t.nodes[u],h=U5(f,i,e);h&&r.addNode(h)}};for(var a in t.parameters){var o=t.parameters[a];i.parameters[a]=Pg(o)}return G5(t,i,e,function(s){i.textures=s,n()}),r}function U5(t,e,r){var i=t.type||"filter",n,a,o;if(i==="filter"){var s=t.shader.trim(),l=k5.exec(s);if(l?n=V.source(l[1].trim()):s.charAt(0)==="#"&&(n=e.shaders[s.substr(1)]),n||(n=s),!n)return}if(t.inputs){a={};for(var u in t.inputs)typeof t.inputs[u]=="string"?a[u]=t.inputs[u]:a[u]={node:t.inputs[u].node,pin:t.inputs[u].pin}}if(t.outputs){o={};for(var u in t.outputs){var f=t.outputs[u];o[u]={},f.attachment!=null&&(o[u].attachment=f.attachment),f.keepLastFrame!=null&&(o[u].keepLastFrame=f.keepLastFrame),f.outputLastFrame!=null&&(o[u].outputLastFrame=f.outputLastFrame),f.parameters&&(o[u].parameters=Pg(f.parameters))}}var h;if(i==="scene"?h=new M5({name:t.name,scene:r.scene,camera:r.camera,outputs:o}):i==="texture"?h=new L5({name:t.name,outputs:o}):h=new P5({name:t.name,shader:n,inputs:a,outputs:o}),h){if(t.parameters)for(var u in t.parameters){var v=t.parameters[u];typeof v=="string"?(v=v.trim(),v.charAt(0)==="#"?v=e.textures[v.substr(1)]:h.on("beforerender",W5(u,ob(v)))):typeof v=="function"&&h.on("beforerender",v),h.setParameter(u,v)}if(t.defines&&h.pass)for(var u in t.defines){var v=t.defines[u];h.pass.material.define("fragment",u,v)}}return h}function H5(t,e){return t}function V5(t,e){return e}function Pg(t){var e={};if(!t)return e;["type","minFilter","magFilter","wrapS","wrapT","flipY","useMipmap"].forEach(function(i){var n=t[i];n!=null&&(typeof n=="string"&&(n=ut[n]),e[i]=n)});var r=t.scale||1;return["width","height"].forEach(function(i){if(t[i]!=null){var n=t[i];typeof n=="string"?(n=n.trim(),e[i]=X5(i,ob(n),r)):e[i]=n}}),e.width||(e.width=H5),e.height||(e.height=V5),t.useMipmap!=null&&(e.useMipmap=t.useMipmap),e}function G5(t,e,r,i){if(!t.textures){i({});return}var n={},a=0,o=!1,s=r.textureRootPath;Ee.each(t.textures,function(l,u){var f,h=l.path,v=Pg(l.parameters);if(Array.isArray(h)&&h.length===6)s&&(h=h.map(function(c){return Ee.relative2absolute(c,s)})),f=new Zs(v);else if(typeof h=="string")s&&(h=Ee.relative2absolute(h,s)),f=new Pt(v);else return;f.load(h),a++,f.once("success",function(){n[u]=f,a--,a===0&&(i(n),o=!0)})}),a===0&&!o&&i(n)}function W5(t,e){return function(r){var i=r.getDevicePixelRatio(),n=r.getWidth(),a=r.getHeight(),o=e(n,a,i);this.setParameter(t,o)}}function X5(t,e,r){return r=r||1,function(i){var n=i.getDevicePixelRatio(),a=i.getWidth()*r,o=i.getHeight()*r;return e(a,o,n)}}function ob(t){var e=/^expr\((.*)\)$/.exec(t);if(e)try{var r=new Function("width","height","dpr","return "+e[1]);return r(1,1),r}catch{throw new Error("Invalid expression.")}}function yo(t,e){for(var r=0,i=1/e,n=t;n>0;)r=r+i*(n%e),n=Math.floor(n/e),i=i/e;return r}const Y5=`@export ecgl.ssao.estimate

uniform sampler2D depthTex;

uniform sampler2D normalTex;

uniform sampler2D noiseTex;

uniform vec2 depthTexSize;

uniform vec2 noiseTexSize;

uniform mat4 projection;

uniform mat4 projectionInv;

uniform mat4 viewInverseTranspose;

uniform vec3 kernel[KERNEL_SIZE];

uniform float radius : 1;

uniform float power : 1;

uniform float bias: 1e-2;

uniform float intensity: 1.0;

varying vec2 v_Texcoord;

float ssaoEstimator(in vec3 originPos, in mat3 kernelBasis) {
 float occlusion = 0.0;

 for (int i = 0; i < KERNEL_SIZE; i++) {
 vec3 samplePos = kernel[i];
#ifdef NORMALTEX_ENABLED
 samplePos = kernelBasis * samplePos;
#endif
 samplePos = samplePos * radius + originPos;

 vec4 texCoord = projection * vec4(samplePos, 1.0);
 texCoord.xy /= texCoord.w;

 vec4 depthTexel = texture2D(depthTex, texCoord.xy * 0.5 + 0.5);

 float sampleDepth = depthTexel.r * 2.0 - 1.0;
 if (projection[3][3] == 0.0) {
 sampleDepth = projection[3][2] / (sampleDepth * projection[2][3] - projection[2][2]);
 }
 else {
 sampleDepth = (sampleDepth - projection[3][2]) / projection[2][2];
 }
 
 float rangeCheck = smoothstep(0.0, 1.0, radius / abs(originPos.z - sampleDepth));
 occlusion += rangeCheck * step(samplePos.z, sampleDepth - bias);
 }
#ifdef NORMALTEX_ENABLED
 occlusion = 1.0 - occlusion / float(KERNEL_SIZE);
#else
 occlusion = 1.0 - clamp((occlusion / float(KERNEL_SIZE) - 0.6) * 2.5, 0.0, 1.0);
#endif
 return pow(occlusion, power);
}

void main()
{

 vec4 depthTexel = texture2D(depthTex, v_Texcoord);

#ifdef NORMALTEX_ENABLED
 vec4 tex = texture2D(normalTex, v_Texcoord);
 if (dot(tex.rgb, tex.rgb) == 0.0) {
 gl_FragColor = vec4(1.0);
 return;
 }
 vec3 N = tex.rgb * 2.0 - 1.0;
 N = (viewInverseTranspose * vec4(N, 0.0)).xyz;

 vec2 noiseTexCoord = depthTexSize / vec2(noiseTexSize) * v_Texcoord;
 vec3 rvec = texture2D(noiseTex, noiseTexCoord).rgb * 2.0 - 1.0;
 vec3 T = normalize(rvec - N * dot(rvec, N));
 vec3 BT = normalize(cross(N, T));
 mat3 kernelBasis = mat3(T, BT, N);
#else
 if (depthTexel.r > 0.99999) {
 gl_FragColor = vec4(1.0);
 return;
 }
 mat3 kernelBasis;
#endif

 float z = depthTexel.r * 2.0 - 1.0;

 vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);
 vec4 p4 = projectionInv * projectedPos;

 vec3 position = p4.xyz / p4.w;

 float ao = ssaoEstimator(position, kernelBasis);
 ao = clamp(1.0 - (1.0 - ao) * intensity, 0.0, 1.0);
 gl_FragColor = vec4(vec3(ao), 1.0);
}

@end


@export ecgl.ssao.blur
#define SHADER_NAME SSAO_BLUR

uniform sampler2D ssaoTexture;

#ifdef NORMALTEX_ENABLED
uniform sampler2D normalTex;
#endif

varying vec2 v_Texcoord;

uniform vec2 textureSize;
uniform float blurSize : 1.0;

uniform int direction: 0.0;

#ifdef DEPTHTEX_ENABLED
uniform sampler2D depthTex;
uniform mat4 projection;
uniform float depthRange : 0.5;

float getLinearDepth(vec2 coord)
{
 float depth = texture2D(depthTex, coord).r * 2.0 - 1.0;
 return projection[3][2] / (depth * projection[2][3] - projection[2][2]);
}
#endif

void main()
{
 float kernel[5];
 kernel[0] = 0.122581;
 kernel[1] = 0.233062;
 kernel[2] = 0.288713;
 kernel[3] = 0.233062;
 kernel[4] = 0.122581;

 vec2 off = vec2(0.0);
 if (direction == 0) {
 off[0] = blurSize / textureSize.x;
 }
 else {
 off[1] = blurSize / textureSize.y;
 }

 vec2 coord = v_Texcoord;

 float sum = 0.0;
 float weightAll = 0.0;

#ifdef NORMALTEX_ENABLED
 vec3 centerNormal = texture2D(normalTex, v_Texcoord).rgb * 2.0 - 1.0;
#endif
#if defined(DEPTHTEX_ENABLED)
 float centerDepth = getLinearDepth(v_Texcoord);
#endif

 for (int i = 0; i < 5; i++) {
 vec2 coord = clamp(v_Texcoord + vec2(float(i) - 2.0) * off, vec2(0.0), vec2(1.0));

 float w = kernel[i];
#ifdef NORMALTEX_ENABLED
 vec3 normal = texture2D(normalTex, coord).rgb * 2.0 - 1.0;
 w *= clamp(dot(normal, centerNormal), 0.0, 1.0);
#endif
#ifdef DEPTHTEX_ENABLED
 float d = getLinearDepth(coord);
 w *= (1.0 - smoothstep(abs(centerDepth - d) / depthRange, 0.0, 1.0));
#endif

 weightAll += w;
 sum += texture2D(ssaoTexture, coord).r * w;
 }

 gl_FragColor = vec4(vec3(sum / weightAll), 1.0);
}

@end
`;V.import(Y5);function sb(t){for(var e=new Uint8Array(t*t*4),r=0,i=new W,n=0;n<t;n++)for(var a=0;a<t;a++)i.set(Math.random()*2-1,Math.random()*2-1,0).normalize(),e[r++]=(i.x*.5+.5)*255,e[r++]=(i.y*.5+.5)*255,e[r++]=0,e[r++]=255;return e}function qy(t){return new Pt({pixels:sb(t),wrapS:ut.REPEAT,wrapT:ut.REPEAT,width:t,height:t})}function $5(t,e,r){var i=new Float32Array(t*3);e=e||0;for(var n=0;n<t;n++){var a=yo(n+e,2)*(r?1:2)*Math.PI,o=yo(n+e,3)*Math.PI,s=Math.random(),l=Math.cos(a)*Math.sin(o)*s,u=Math.cos(o)*s,f=Math.sin(a)*Math.sin(o)*s;i[n*3]=l,i[n*3+1]=u,i[n*3+2]=f}return i}function Ni(t){t=t||{},this._ssaoPass=new We({fragment:V.source("ecgl.ssao.estimate")}),this._blurPass=new We({fragment:V.source("ecgl.ssao.blur")}),this._framebuffer=new Ne({depthBuffer:!1}),this._ssaoTexture=new Pt,this._blurTexture=new Pt,this._blurTexture2=new Pt,this._depthTex=t.depthTexture,this._normalTex=t.normalTexture,this.setNoiseSize(4),this.setKernelSize(t.kernelSize||12),t.radius!=null&&this.setParameter("radius",t.radius),t.power!=null&&this.setParameter("power",t.power),this._normalTex||(this._ssaoPass.material.disableTexture("normalTex"),this._blurPass.material.disableTexture("normalTex")),this._depthTex||this._blurPass.material.disableTexture("depthTex"),this._blurPass.material.setUniform("normalTex",this._normalTex),this._blurPass.material.setUniform("depthTex",this._depthTex)}Ni.prototype.setDepthTexture=function(t){this._depthTex=t};Ni.prototype.setNormalTexture=function(t){this._normalTex=t,this._ssaoPass.material[t?"enableTexture":"disableTexture"]("normalTex"),this.setKernelSize(this._kernelSize)};Ni.prototype.update=function(t,e,r){var i=t.getWidth(),n=t.getHeight(),a=this._ssaoPass,o=this._blurPass;a.setUniform("kernel",this._kernels[r%this._kernels.length]),a.setUniform("depthTex",this._depthTex),this._normalTex!=null&&a.setUniform("normalTex",this._normalTex),a.setUniform("depthTexSize",[this._depthTex.width,this._depthTex.height]);var s=new J;J.transpose(s,e.worldTransform),a.setUniform("projection",e.projectionMatrix.array),a.setUniform("projectionInv",e.invProjectionMatrix.array),a.setUniform("viewInverseTranspose",s.array);var l=this._ssaoTexture,u=this._blurTexture,f=this._blurTexture2;l.width=i/2,l.height=n/2,u.width=i,u.height=n,f.width=i,f.height=n,this._framebuffer.attach(l),this._framebuffer.bind(t),t.gl.clearColor(1,1,1,1),t.gl.clear(t.gl.COLOR_BUFFER_BIT),a.render(t),o.setUniform("textureSize",[i/2,n/2]),o.setUniform("projection",e.projectionMatrix.array),this._framebuffer.attach(u),o.setUniform("direction",0),o.setUniform("ssaoTexture",l),o.render(t),this._framebuffer.attach(f),o.setUniform("textureSize",[i,n]),o.setUniform("direction",1),o.setUniform("ssaoTexture",u),o.render(t),this._framebuffer.unbind(t);var h=t.clearColor;t.gl.clearColor(h[0],h[1],h[2],h[3])};Ni.prototype.getTargetTexture=function(){return this._blurTexture2};Ni.prototype.setParameter=function(t,e){t==="noiseTexSize"?this.setNoiseSize(e):t==="kernelSize"?this.setKernelSize(e):t==="intensity"?this._ssaoPass.material.set("intensity",e):this._ssaoPass.setUniform(t,e)};Ni.prototype.setKernelSize=function(t){this._kernelSize=t,this._ssaoPass.material.define("fragment","KERNEL_SIZE",t),this._kernels=this._kernels||[];for(var e=0;e<30;e++)this._kernels[e]=$5(t,e*t,!!this._normalTex)};Ni.prototype.setNoiseSize=function(t){var e=this._ssaoPass.getUniform("noiseTex");e?(e.data=sb(t),e.width=e.height=t,e.dirty()):(e=qy(t),this._ssaoPass.setUniform("noiseTex",qy(t))),this._ssaoPass.setUniform("noiseTexSize",[t,t])};Ni.prototype.dispose=function(t){this._blurTexture.dispose(t),this._ssaoTexture.dispose(t),this._blurTexture2.dispose(t)};const Z5=`@export ecgl.ssr.main

#define SHADER_NAME SSR
#define MAX_ITERATION 20;
#define SAMPLE_PER_FRAME 5;
#define TOTAL_SAMPLES 128;

uniform sampler2D sourceTexture;
uniform sampler2D gBufferTexture1;
uniform sampler2D gBufferTexture2;
uniform sampler2D gBufferTexture3;
uniform samplerCube specularCubemap;
uniform float specularIntensity: 1;

uniform mat4 projection;
uniform mat4 projectionInv;
uniform mat4 toViewSpace;
uniform mat4 toWorldSpace;

uniform float maxRayDistance: 200;

uniform float pixelStride: 16;
uniform float pixelStrideZCutoff: 50; 
uniform float screenEdgeFadeStart: 0.9; 
uniform float eyeFadeStart : 0.2; uniform float eyeFadeEnd: 0.8; 
uniform float minGlossiness: 0.2; uniform float zThicknessThreshold: 1;

uniform float nearZ;
uniform vec2 viewportSize : VIEWPORT_SIZE;

uniform float jitterOffset: 0;

varying vec2 v_Texcoord;

#ifdef DEPTH_DECODE
@import clay.util.decode_float
#endif

#ifdef PHYSICALLY_CORRECT
uniform sampler2D normalDistribution;
uniform float sampleOffset: 0;
uniform vec2 normalDistributionSize;

vec3 transformNormal(vec3 H, vec3 N) {
 vec3 upVector = N.y > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);
 vec3 tangentX = normalize(cross(N, upVector));
 vec3 tangentZ = cross(N, tangentX);
 return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);
}
vec3 importanceSampleNormalGGX(float i, float roughness, vec3 N) {
 float p = fract((i + sampleOffset) / float(TOTAL_SAMPLES));
 vec3 H = texture2D(normalDistribution,vec2(roughness, p)).rgb;
 return transformNormal(H, N);
}
float G_Smith(float g, float ndv, float ndl) {
 float roughness = 1.0 - g;
 float k = roughness * roughness / 2.0;
 float G1V = ndv / (ndv * (1.0 - k) + k);
 float G1L = ndl / (ndl * (1.0 - k) + k);
 return G1L * G1V;
}
vec3 F_Schlick(float ndv, vec3 spec) {
 return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);
}
#endif

float fetchDepth(sampler2D depthTexture, vec2 uv)
{
 vec4 depthTexel = texture2D(depthTexture, uv);
 return depthTexel.r * 2.0 - 1.0;
}

float linearDepth(float depth)
{
 if (projection[3][3] == 0.0) {
 return projection[3][2] / (depth * projection[2][3] - projection[2][2]);
 }
 else {
 return (depth - projection[3][2]) / projection[2][2];
 }
}

bool rayIntersectDepth(float rayZNear, float rayZFar, vec2 hitPixel)
{
 if (rayZFar > rayZNear)
 {
 float t = rayZFar; rayZFar = rayZNear; rayZNear = t;
 }
 float cameraZ = linearDepth(fetchDepth(gBufferTexture2, hitPixel));
 return rayZFar <= cameraZ && rayZNear >= cameraZ - zThicknessThreshold;
}


bool traceScreenSpaceRay(
 vec3 rayOrigin, vec3 rayDir, float jitter,
 out vec2 hitPixel, out vec3 hitPoint, out float iterationCount
)
{
 float rayLength = ((rayOrigin.z + rayDir.z * maxRayDistance) > -nearZ)
 ? (-nearZ - rayOrigin.z) / rayDir.z : maxRayDistance;

 vec3 rayEnd = rayOrigin + rayDir * rayLength;

 vec4 H0 = projection * vec4(rayOrigin, 1.0);
 vec4 H1 = projection * vec4(rayEnd, 1.0);

 float k0 = 1.0 / H0.w, k1 = 1.0 / H1.w;

 vec3 Q0 = rayOrigin * k0, Q1 = rayEnd * k1;

 vec2 P0 = (H0.xy * k0 * 0.5 + 0.5) * viewportSize;
 vec2 P1 = (H1.xy * k1 * 0.5 + 0.5) * viewportSize;

 P1 += dot(P1 - P0, P1 - P0) < 0.0001 ? 0.01 : 0.0;
 vec2 delta = P1 - P0;

 bool permute = false;
 if (abs(delta.x) < abs(delta.y)) {
 permute = true;
 delta = delta.yx;
 P0 = P0.yx;
 P1 = P1.yx;
 }
 float stepDir = sign(delta.x);
 float invdx = stepDir / delta.x;

 vec3 dQ = (Q1 - Q0) * invdx;
 float dk = (k1 - k0) * invdx;

 vec2 dP = vec2(stepDir, delta.y * invdx);

 float strideScaler = 1.0 - min(1.0, -rayOrigin.z / pixelStrideZCutoff);
 float pixStride = 1.0 + strideScaler * pixelStride;

 dP *= pixStride; dQ *= pixStride; dk *= pixStride;

 vec4 pqk = vec4(P0, Q0.z, k0);
 vec4 dPQK = vec4(dP, dQ.z, dk);

 pqk += dPQK * jitter;
 float rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);
 float rayZNear;

 bool intersect = false;

 vec2 texelSize = 1.0 / viewportSize;

 iterationCount = 0.0;

 for (int i = 0; i < MAX_ITERATION; i++)
 {
 pqk += dPQK;

 rayZNear = rayZFar;
 rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);

 hitPixel = permute ? pqk.yx : pqk.xy;
 hitPixel *= texelSize;

 intersect = rayIntersectDepth(rayZNear, rayZFar, hitPixel);

 iterationCount += 1.0;

 dPQK *= 1.2;

 if (intersect) {
 break;
 }
 }

 Q0.xy += dQ.xy * iterationCount;
 Q0.z = pqk.z;
 hitPoint = Q0 / pqk.w;

 return intersect;
}

float calculateAlpha(
 float iterationCount, float reflectivity,
 vec2 hitPixel, vec3 hitPoint, float dist, vec3 rayDir
)
{
 float alpha = clamp(reflectivity, 0.0, 1.0);
 alpha *= 1.0 - (iterationCount / float(MAX_ITERATION));
 vec2 hitPixelNDC = hitPixel * 2.0 - 1.0;
 float maxDimension = min(1.0, max(abs(hitPixelNDC.x), abs(hitPixelNDC.y)));
 alpha *= 1.0 - max(0.0, maxDimension - screenEdgeFadeStart) / (1.0 - screenEdgeFadeStart);

 float _eyeFadeStart = eyeFadeStart;
 float _eyeFadeEnd = eyeFadeEnd;
 if (_eyeFadeStart > _eyeFadeEnd) {
 float tmp = _eyeFadeEnd;
 _eyeFadeEnd = _eyeFadeStart;
 _eyeFadeStart = tmp;
 }

 float eyeDir = clamp(rayDir.z, _eyeFadeStart, _eyeFadeEnd);
 alpha *= 1.0 - (eyeDir - _eyeFadeStart) / (_eyeFadeEnd - _eyeFadeStart);

 alpha *= 1.0 - clamp(dist / maxRayDistance, 0.0, 1.0);

 return alpha;
}

@import clay.util.rand

@import clay.util.rgbm

void main()
{
 vec4 normalAndGloss = texture2D(gBufferTexture1, v_Texcoord);

 if (dot(normalAndGloss.rgb, vec3(1.0)) == 0.0) {
 discard;
 }

 float g = normalAndGloss.a;
#if !defined(PHYSICALLY_CORRECT)
 if (g <= minGlossiness) {
 discard;
 }
#endif

 float reflectivity = (g - minGlossiness) / (1.0 - minGlossiness);

 vec3 N = normalize(normalAndGloss.rgb * 2.0 - 1.0);
 N = normalize((toViewSpace * vec4(N, 0.0)).xyz);

 vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, fetchDepth(gBufferTexture2, v_Texcoord), 1.0);
 vec4 pos = projectionInv * projectedPos;
 vec3 rayOrigin = pos.xyz / pos.w;
 vec3 V = -normalize(rayOrigin);

 float ndv = clamp(dot(N, V), 0.0, 1.0);
 float iterationCount;
 float jitter = rand(fract(v_Texcoord + jitterOffset));

#ifdef PHYSICALLY_CORRECT
 vec4 color = vec4(vec3(0.0), 1.0);
 vec4 albedoMetalness = texture2D(gBufferTexture3, v_Texcoord);
 vec3 albedo = albedoMetalness.rgb;
 float m = albedoMetalness.a;
 vec3 diffuseColor = albedo * (1.0 - m);
 vec3 spec = mix(vec3(0.04), albedo, m);

 float jitter2 = rand(fract(v_Texcoord)) * float(TOTAL_SAMPLES);

 for (int i = 0; i < SAMPLE_PER_FRAME; i++) {
 vec3 H = importanceSampleNormalGGX(float(i) + jitter2, 1.0 - g, N);
 vec3 rayDir = normalize(reflect(-V, H));
#else
 vec3 rayDir = normalize(reflect(-V, N));
#endif
 vec2 hitPixel;
 vec3 hitPoint;

 bool intersect = traceScreenSpaceRay(rayOrigin, rayDir, jitter, hitPixel, hitPoint, iterationCount);

 float dist = distance(rayOrigin, hitPoint);

 vec3 hitNormal = texture2D(gBufferTexture1, hitPixel).rgb * 2.0 - 1.0;
 hitNormal = normalize((toViewSpace * vec4(hitNormal, 0.0)).xyz);
#ifdef PHYSICALLY_CORRECT
 float ndl = clamp(dot(N, rayDir), 0.0, 1.0);
 float vdh = clamp(dot(V, H), 0.0, 1.0);
 float ndh = clamp(dot(N, H), 0.0, 1.0);
 vec3 litTexel = vec3(0.0);
 if (dot(hitNormal, rayDir) < 0.0 && intersect) {
 litTexel = texture2D(sourceTexture, hitPixel).rgb;
 litTexel *= pow(clamp(1.0 - dist / 200.0, 0.0, 1.0), 3.0);

 }
 else {
 #ifdef SPECULARCUBEMAP_ENABLED
 vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;
 litTexel = RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, 0.0), 8.12).rgb * specularIntensity;
#endif
 }
 color.rgb += ndl * litTexel * (
 F_Schlick(ndl, spec) * G_Smith(g, ndv, ndl) * vdh / (ndh * ndv + 0.001)
 );
 }
 color.rgb /= float(SAMPLE_PER_FRAME);
#else
 #if !defined(SPECULARCUBEMAP_ENABLED)
 if (dot(hitNormal, rayDir) >= 0.0) {
 discard;
 }
 if (!intersect) {
 discard;
 }
#endif
 float alpha = clamp(calculateAlpha(iterationCount, reflectivity, hitPixel, hitPoint, dist, rayDir), 0.0, 1.0);
 vec4 color = texture2D(sourceTexture, hitPixel);
 color.rgb *= alpha;

#ifdef SPECULARCUBEMAP_ENABLED
 vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;
 alpha = alpha * (intersect ? 1.0 : 0.0);
 float bias = (1.0 -g) * 5.0;
 color.rgb += (1.0 - alpha)
 * RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, bias), 8.12).rgb
 * specularIntensity;
#endif

#endif

 gl_FragColor = encodeHDR(color);
}
@end

@export ecgl.ssr.blur

uniform sampler2D texture;
uniform sampler2D gBufferTexture1;
uniform sampler2D gBufferTexture2;
uniform mat4 projection;
uniform float depthRange : 0.05;

varying vec2 v_Texcoord;

uniform vec2 textureSize;
uniform float blurSize : 1.0;

#ifdef BLEND
 #ifdef SSAOTEX_ENABLED
uniform sampler2D ssaoTex;
 #endif
uniform sampler2D sourceTexture;
#endif

float getLinearDepth(vec2 coord)
{
 float depth = texture2D(gBufferTexture2, coord).r * 2.0 - 1.0;
 return projection[3][2] / (depth * projection[2][3] - projection[2][2]);
}

@import clay.util.rgbm


void main()
{
 @import clay.compositor.kernel.gaussian_9

 vec4 centerNTexel = texture2D(gBufferTexture1, v_Texcoord);
 float g = centerNTexel.a;
 float maxBlurSize = clamp(1.0 - g, 0.0, 1.0) * blurSize;
#ifdef VERTICAL
 vec2 off = vec2(0.0, maxBlurSize / textureSize.y);
#else
 vec2 off = vec2(maxBlurSize / textureSize.x, 0.0);
#endif

 vec2 coord = v_Texcoord;

 vec4 sum = vec4(0.0);
 float weightAll = 0.0;

 vec3 cN = centerNTexel.rgb * 2.0 - 1.0;
 float cD = getLinearDepth(v_Texcoord);
 for (int i = 0; i < 9; i++) {
 vec2 coord = clamp((float(i) - 4.0) * off + v_Texcoord, vec2(0.0), vec2(1.0));
 float w = gaussianKernel[i]
 * clamp(dot(cN, texture2D(gBufferTexture1, coord).rgb * 2.0 - 1.0), 0.0, 1.0);
 float d = getLinearDepth(coord);
 w *= (1.0 - smoothstep(abs(cD - d) / depthRange, 0.0, 1.0));

 weightAll += w;
 sum += decodeHDR(texture2D(texture, coord)) * w;
 }

#ifdef BLEND
 float aoFactor = 1.0;
 #ifdef SSAOTEX_ENABLED
 aoFactor = texture2D(ssaoTex, v_Texcoord).r;
 #endif
 gl_FragColor = encodeHDR(
 sum / weightAll * aoFactor + decodeHDR(texture2D(sourceTexture, v_Texcoord))
 );
#else
 gl_FragColor = encodeHDR(sum / weightAll);
#endif
}

@end`;V.import(Z5);function Oi(t){t=t||{},this._ssrPass=new We({fragment:V.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new We({fragment:V.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new We({fragment:V.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blendPass=new We({fragment:V.source("clay.compositor.blend")}),this._blendPass.material.disableTexturesAll(),this._blendPass.material.enableTexture(["texture1","texture2"]),this._ssrPass.setUniform("gBufferTexture1",t.normalTexture),this._ssrPass.setUniform("gBufferTexture2",t.depthTexture),this._blurPass1.setUniform("gBufferTexture1",t.normalTexture),this._blurPass1.setUniform("gBufferTexture2",t.depthTexture),this._blurPass2.setUniform("gBufferTexture1",t.normalTexture),this._blurPass2.setUniform("gBufferTexture2",t.depthTexture),this._blurPass2.material.define("fragment","VERTICAL"),this._blurPass2.material.define("fragment","BLEND"),this._ssrTexture=new Pt({type:ut.HALF_FLOAT}),this._texture2=new Pt({type:ut.HALF_FLOAT}),this._texture3=new Pt({type:ut.HALF_FLOAT}),this._prevTexture=new Pt({type:ut.HALF_FLOAT}),this._currentTexture=new Pt({type:ut.HALF_FLOAT}),this._frameBuffer=new Ne({depthBuffer:!1}),this._normalDistribution=null,this._totalSamples=256,this._samplePerFrame=4,this._ssrPass.material.define("fragment","SAMPLE_PER_FRAME",this._samplePerFrame),this._ssrPass.material.define("fragment","TOTAL_SAMPLES",this._totalSamples),this._downScale=1}Oi.prototype.setAmbientCubemap=function(t,e){this._ssrPass.material.set("specularCubemap",t),this._ssrPass.material.set("specularIntensity",e);var r=t&&e;this._ssrPass.material[r?"enableTexture":"disableTexture"]("specularCubemap")};Oi.prototype.update=function(t,e,r,i){var n=t.getWidth(),a=t.getHeight(),o=this._ssrTexture,s=this._texture2,l=this._texture3;o.width=this._prevTexture.width=this._currentTexture.width=n/this._downScale,o.height=this._prevTexture.height=this._currentTexture.height=a/this._downScale,s.width=l.width=n,s.height=l.height=a;var u=this._frameBuffer,f=this._ssrPass,h=this._blurPass1,v=this._blurPass2,c=this._blendPass,d=new J,p=new J;J.transpose(d,e.worldTransform),J.transpose(p,e.viewMatrix),f.setUniform("sourceTexture",r),f.setUniform("projection",e.projectionMatrix.array),f.setUniform("projectionInv",e.invProjectionMatrix.array),f.setUniform("toViewSpace",d.array),f.setUniform("toWorldSpace",p.array),f.setUniform("nearZ",e.near);var g=i/this._totalSamples*this._samplePerFrame;if(f.setUniform("jitterOffset",g),f.setUniform("sampleOffset",i*this._samplePerFrame),h.setUniform("textureSize",[o.width,o.height]),v.setUniform("textureSize",[n,a]),v.setUniform("sourceTexture",r),h.setUniform("projection",e.projectionMatrix.array),v.setUniform("projection",e.projectionMatrix.array),u.attach(o),u.bind(t),f.render(t),this._physicallyCorrect&&(u.attach(this._currentTexture),c.setUniform("texture1",this._prevTexture),c.setUniform("texture2",o),c.material.set({weight1:i>=1?.95:0,weight2:i>=1?.05:1}),c.render(t)),u.attach(s),h.setUniform("texture",this._physicallyCorrect?this._currentTexture:o),h.render(t),u.attach(l),v.setUniform("texture",s),v.render(t),u.unbind(t),this._physicallyCorrect){var m=this._prevTexture;this._prevTexture=this._currentTexture,this._currentTexture=m}};Oi.prototype.getTargetTexture=function(){return this._texture3};Oi.prototype.setParameter=function(t,e){t==="maxIteration"?this._ssrPass.material.define("fragment","MAX_ITERATION",e):this._ssrPass.setUniform(t,e)};Oi.prototype.setPhysicallyCorrect=function(t){t?(this._normalDistribution||(this._normalDistribution=ku.generateNormalDistribution(64,this._totalSamples)),this._ssrPass.material.define("fragment","PHYSICALLY_CORRECT"),this._ssrPass.material.set("normalDistribution",this._normalDistribution),this._ssrPass.material.set("normalDistributionSize",[64,this._totalSamples])):this._ssrPass.material.undefine("fragment","PHYSICALLY_CORRECT"),this._physicallyCorrect=t};Oi.prototype.setSSAOTexture=function(t){var e=this._blurPass2;t?(e.material.enableTexture("ssaoTex"),e.material.set("ssaoTex",t)):e.material.disableTexture("ssaoTex")};Oi.prototype.isFinished=function(t){return this._physicallyCorrect?t>this._totalSamples/this._samplePerFrame:!0};Oi.prototype.dispose=function(t){this._ssrTexture.dispose(t),this._texture2.dispose(t),this._texture3.dispose(t),this._prevTexture.dispose(t),this._currentTexture.dispose(t),this._frameBuffer.dispose(t)};const Ky=[0,0,-.321585265978,-.154972575841,.458126042375,.188473391593,.842080129861,.527766490688,.147304551086,-.659453822776,-.331943915203,-.940619700594,.0479226680259,.54812163202,.701581552186,-.709825561388,-.295436780218,.940589268233,-.901489676764,.237713156085,.973570876096,-.109899459384,-.866792314779,-.451805525005,.330975007087,.800048655954,-.344275183665,.381779221166,-.386139432542,-.437418421534,-.576478634965,-.0148463392551,.385798197415,-.262426961053,-.666302061145,.682427250835,-.628010632582,-.732836215494,.10163141741,-.987658134403,.711995289051,-.320024291314,.0296005138058,.950296523438,.0130612307608,-.351024443122,-.879596633704,-.10478487883,.435712737232,.504254490347,.779203817497,.206477676721,.388264289969,-.896736162545,-.153106280781,-.629203242522,-.245517550697,.657969239148,.126830499058,.26862328493,-.634888119007,-.302301223431,.617074219636,.779817204925],q5=`@export ecgl.normal.vertex

@import ecgl.common.transformUniforms

@import ecgl.common.uv.header

@import ecgl.common.attributes

varying vec3 v_Normal;
varying vec3 v_WorldPosition;

@import ecgl.common.normalMap.vertexHeader

@import ecgl.common.vertexAnimation.header

void main()
{

 @import ecgl.common.vertexAnimation.main

 @import ecgl.common.uv.main

 v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);
 v_WorldPosition = (world * vec4(pos, 1.0)).xyz;

 @import ecgl.common.normalMap.vertexMain

 gl_Position = worldViewProjection * vec4(pos, 1.0);

}


@end


@export ecgl.normal.fragment

#define ROUGHNESS_CHANEL 0

uniform bool useBumpMap;
uniform bool useRoughnessMap;
uniform bool doubleSide;
uniform float roughness;

@import ecgl.common.uv.fragmentHeader

varying vec3 v_Normal;
varying vec3 v_WorldPosition;

uniform mat4 viewInverse : VIEWINVERSE;

@import ecgl.common.normalMap.fragmentHeader
@import ecgl.common.bumpMap.header

uniform sampler2D roughnessMap;

void main()
{
 vec3 N = v_Normal;
 
 bool flipNormal = false;
 if (doubleSide) {
 vec3 eyePos = viewInverse[3].xyz;
 vec3 V = normalize(eyePos - v_WorldPosition);

 if (dot(N, V) < 0.0) {
 flipNormal = true;
 }
 }

 @import ecgl.common.normalMap.fragmentMain

 if (useBumpMap) {
 N = bumpNormal(v_WorldPosition, v_Normal, N);
 }

 float g = 1.0 - roughness;

 if (useRoughnessMap) {
 float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];
 g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);
 }

 if (flipNormal) {
 N = -N;
 }

 gl_FragColor.rgb = (N.xyz + 1.0) * 0.5;
 gl_FragColor.a = g;
}
@end`;V.import(q5);function gv(t,e,r,i,n){var a=t.gl;e.setUniform(a,"1i",r,n),a.activeTexture(a.TEXTURE0+n),i.isRenderable()?i.bind(t):i.unbind(t)}function K5(t,e,r,i,n){var a,o,s,l,u=t.gl;return function(f,h,v){if(!(l&&l.material===f.material)){var c=f.material,d=f.__program,p=c.get("roughness");p==null&&(p=1);var g=c.get("normalMap")||e,m=c.get("roughnessMap"),_=c.get("bumpMap"),y=c.get("uvRepeat"),x=c.get("uvOffset"),S=c.get("detailUvRepeat"),T=c.get("detailUvOffset"),b=!!_&&c.isTextureEnabled("bumpMap"),w=!!m&&c.isTextureEnabled("roughnessMap"),A=c.isDefined("fragment","DOUBLE_SIDED");_=_||r,m=m||i,v!==h?(h.set("normalMap",g),h.set("bumpMap",_),h.set("roughnessMap",m),h.set("useBumpMap",b),h.set("useRoughnessMap",w),h.set("doubleSide",A),y!=null&&h.set("uvRepeat",y),x!=null&&h.set("uvOffset",x),S!=null&&h.set("detailUvRepeat",S),T!=null&&h.set("detailUvOffset",T),h.set("roughness",p)):(d.setUniform(u,"1f","roughness",p),a!==g&&gv(t,d,"normalMap",g,0),o!==_&&_&&gv(t,d,"bumpMap",_,1),s!==m&&m&&gv(t,d,"roughnessMap",m,2),y!=null&&d.setUniform(u,"2f","uvRepeat",y),x!=null&&d.setUniform(u,"2f","uvOffset",x),S!=null&&d.setUniform(u,"2f","detailUvRepeat",S),T!=null&&d.setUniform(u,"2f","detailUvOffset",T),d.setUniform(u,"1i","useBumpMap",+b),d.setUniform(u,"1i","useRoughnessMap",+w),d.setUniform(u,"1i","doubleSide",+A)),a=g,o=_,s=m,l=f}}}function Eo(t){this._depthTex=new Pt({format:ut.DEPTH_COMPONENT,type:ut.UNSIGNED_INT}),this._normalTex=new Pt({type:ut.HALF_FLOAT}),this._framebuffer=new Ne,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,Ne.DEPTH_ATTACHMENT),this._normalMaterial=new Ii({shader:new V(V.source("ecgl.normal.vertex"),V.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=aa.createBlank("#000"),this._defaultBumpMap=aa.createBlank("#000"),this._defaultRoughessMap=aa.createBlank("#000"),this._debugPass=new We({fragment:V.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}Eo.prototype.getDepthTexture=function(){return this._depthTex};Eo.prototype.getNormalTexture=function(){return this._normalTex};Eo.prototype.update=function(t,e,r){var i=t.getWidth(),n=t.getHeight(),a=this._depthTex,o=this._normalTex,s=this._normalMaterial;a.width=i,a.height=n,o.width=i,o.height=n;var l=e.getRenderList(r).opaque;this._framebuffer.bind(t),t.gl.clearColor(0,0,0,0),t.gl.clear(t.gl.COLOR_BUFFER_BIT|t.gl.DEPTH_BUFFER_BIT),t.gl.disable(t.gl.BLEND),t.renderPass(l,r,{getMaterial:function(){return s},ifRender:function(u){return u.renderNormal},beforeRender:K5(t,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:t.opaqueSortCompare}),this._framebuffer.unbind(t)};Eo.prototype.renderDebug=function(t){this._debugPass.render(t)};Eo.prototype.dispose=function(t){this._depthTex.dispose(t),this._normalTex.dispose(t)};function hl(t){t=t||{},this._edgePass=new We({fragment:V.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",t.normalTexture),this._edgePass.setUniform("depthTexture",t.depthTexture),this._targetTexture=new Pt({type:ut.HALF_FLOAT}),this._frameBuffer=new Ne,this._frameBuffer.attach(this._targetTexture)}hl.prototype.update=function(t,e,r,i){var n=t.getWidth(),a=t.getHeight(),o=this._targetTexture;o.width=n,o.height=a;var s=this._frameBuffer;s.bind(t),this._edgePass.setUniform("projectionInv",e.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[n,a]),this._edgePass.setUniform("texture",r),this._edgePass.render(t),s.unbind(t)};hl.prototype.getTargetTexture=function(){return this._targetTexture};hl.prototype.setParameter=function(t,e){this._edgePass.setUniform(t,e)};hl.prototype.dispose=function(t){this._targetTexture.dispose(t),this._frameBuffer.dispose(t)};const j5={type:"compositor",nodes:[{name:"source",type:"texture",outputs:{color:{}}},{name:"source_half",shader:"#source(clay.compositor.downsample)",inputs:{texture:"source"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bright",shader:"#source(clay.compositor.bright)",inputs:{texture:"source_half"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{threshold:2,scale:4,textureSize:"expr([width * 1.0 / 2, height / 2])"}},{name:"bright_downsample_4",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 2, height / 2] )"}},{name:"bright_downsample_8",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 4, height / 4] )"}},{name:"bright_downsample_16",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 8, height / 8] )"}},{name:"bright_downsample_32",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 32)",height:"expr(height * 1.0 / 32)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 16, height / 16] )"}},{name:"bright_upsample_16_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_32"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 32, height / 32] )"}},{name:"bright_upsample_16_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_16_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_8_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_8_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_8_blur_v",texture2:"bright_upsample_16_blur_v"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_4_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_4_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_4_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_4_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_4_blur_v",texture2:"bright_upsample_8_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_2_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_2_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_2_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_2_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_2_blur_v",texture2:"bright_upsample_4_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_full_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_full_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_full_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bloom_composite",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_full_blur_v",texture2:"bright_upsample_2_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"coc",shader:"#source(ecgl.dof.coc)",outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{focalDist:50,focalRange:30}},{name:"dof_far_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"dof_near_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_NEARFIELD:null}},{name:"dof_coc_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"coc"},outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_COC:null}},{name:"dof_composite",shader:"#source(ecgl.dof.composite)",inputs:{original:"source",blurred:"dof_far_blur",nearfield:"dof_near_blur",coc:"coc",nearcoc:"dof_coc_blur"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}}},{name:"composite",shader:"#source(clay.compositor.hdr.composite)",inputs:{texture:"source",bloom:"bloom_composite"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},defines:{}},{name:"FXAA",shader:"#source(clay.compositor.fxaa)",inputs:{texture:"composite"}}]},Q5=`@export ecgl.dof.coc

uniform sampler2D depth;

uniform float zNear: 0.1;
uniform float zFar: 2000;

uniform float focalDistance: 3;
uniform float focalRange: 1;
uniform float focalLength: 30;
uniform float fstop: 2.8;

varying vec2 v_Texcoord;

@import clay.util.encode_float

void main()
{
 float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;

 float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));

 float aperture = focalLength / fstop;

 float coc;

 float uppper = focalDistance + focalRange;
 float lower = focalDistance - focalRange;
 if (dist <= uppper && dist >= lower) {
 coc = 0.5;
 }
 else {
 float focalAdjusted = dist > uppper ? uppper : lower;

 coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));
 coc = clamp(coc, 0.0, 2.0) / 2.00001;

 if (dist < lower) {
 coc = -coc;
 }
 coc = coc * 0.5 + 0.5;
 }

 gl_FragColor = encodeFloat(coc);
}
@end


@export ecgl.dof.composite

#define DEBUG 0

uniform sampler2D original;
uniform sampler2D blurred;
uniform sampler2D nearfield;
uniform sampler2D coc;
uniform sampler2D nearcoc;
varying vec2 v_Texcoord;

@import clay.util.rgbm
@import clay.util.float

void main()
{
 vec4 blurredColor = texture2D(blurred, v_Texcoord);
 vec4 originalColor = texture2D(original, v_Texcoord);

 float fCoc = decodeFloat(texture2D(coc, v_Texcoord));

 fCoc = abs(fCoc * 2.0 - 1.0);

 float weight = smoothstep(0.0, 1.0, fCoc);
 
#ifdef NEARFIELD_ENABLED
 vec4 nearfieldColor = texture2D(nearfield, v_Texcoord);
 float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));
 fNearCoc = abs(fNearCoc * 2.0 - 1.0);

 gl_FragColor = encodeHDR(
 mix(
 nearfieldColor, mix(originalColor, blurredColor, weight),
 pow(1.0 - fNearCoc, 4.0)
 )
 );
#else
 gl_FragColor = encodeHDR(mix(originalColor, blurredColor, weight));
#endif

}

@end



@export ecgl.dof.diskBlur

#define POISSON_KERNEL_SIZE 16;

uniform sampler2D texture;
uniform sampler2D coc;
varying vec2 v_Texcoord;

uniform float blurRadius : 10.0;
uniform vec2 textureSize : [512.0, 512.0];

uniform vec2 poissonKernel[POISSON_KERNEL_SIZE];

uniform float percent;

float nrand(const in vec2 n) {
 return fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);
}

@import clay.util.rgbm
@import clay.util.float


void main()
{
 vec2 offset = blurRadius / textureSize;

 float rnd = 6.28318 * nrand(v_Texcoord + 0.07 * percent );
 float cosa = cos(rnd);
 float sina = sin(rnd);
 vec4 basis = vec4(cosa, -sina, sina, cosa);

#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)
 offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);
#endif

#ifdef BLUR_COC
 float cocSum = 0.0;
#else
 vec4 color = vec4(0.0);
#endif


 float weightSum = 0.0;

 for (int i = 0; i < POISSON_KERNEL_SIZE; i++) {
 vec2 ofs = poissonKernel[i];

 ofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));

 vec2 uv = v_Texcoord + ofs * offset;
 vec4 texel = texture2D(texture, uv);

 float w = 1.0;
#ifdef BLUR_COC
 float fCoc = decodeFloat(texel) * 2.0 - 1.0;
 cocSum += clamp(fCoc, -1.0, 0.0) * w;
#else
 texel = texel;
 #if !defined(BLUR_NEARFIELD)
 float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;
 w *= abs(fCoc);
 #endif
 texel.rgb *= texel.a;
 color += texel * w;
#endif

 weightSum += w;
 }

#ifdef BLUR_COC
 gl_FragColor = encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);
#else
 color /= weightSum;
 color.rgb /= (color.a + 0.0001);
 gl_FragColor = color;
#endif
}

@end`,J5=`@export ecgl.edge

uniform sampler2D texture;

uniform sampler2D normalTexture;
uniform sampler2D depthTexture;

uniform mat4 projectionInv;

uniform vec2 textureSize;

uniform vec4 edgeColor: [0,0,0,0.8];

varying vec2 v_Texcoord;

vec3 packColor(vec2 coord) {
 float z = texture2D(depthTexture, coord).r * 2.0 - 1.0;
 vec4 p = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);
 vec4 p4 = projectionInv * p;

 return vec3(
 texture2D(normalTexture, coord).rg,
 -p4.z / p4.w / 5.0
 );
}

void main() {
 vec2 cc = v_Texcoord;
 vec3 center = packColor(cc);

 float size = clamp(1.0 - (center.z - 10.0) / 100.0, 0.0, 1.0) * 0.5;
 float dx = size / textureSize.x;
 float dy = size / textureSize.y;

 vec2 coord;
 vec3 topLeft = packColor(cc+vec2(-dx, -dy));
 vec3 top = packColor(cc+vec2(0.0, -dy));
 vec3 topRight = packColor(cc+vec2(dx, -dy));
 vec3 left = packColor(cc+vec2(-dx, 0.0));
 vec3 right = packColor(cc+vec2(dx, 0.0));
 vec3 bottomLeft = packColor(cc+vec2(-dx, dy));
 vec3 bottom = packColor(cc+vec2(0.0, dy));
 vec3 bottomRight = packColor(cc+vec2(dx, dy));

 vec3 v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;
 vec3 h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;

 float edge = sqrt(dot(h, h) + dot(v, v));

 edge = smoothstep(0.8, 1.0, edge);

 gl_FragColor = mix(texture2D(texture, v_Texcoord), vec4(edgeColor.rgb, 1.0), edgeColor.a * edge);
}
@end`;V.import(j2);V.import(Q2);V.import(J2);V.import(tb);V.import(eb);V.import(rb);V.import(ib);V.import(nb);V.import(ab);V.import(Q5);V.import(J5);function lb(t,e){return{color:{parameters:{width:t,height:e}}}}var Ig=["composite","FXAA"];function Tt(){this._width,this._height,this._dpr,this._sourceTexture=new Pt({type:ut.HALF_FLOAT}),this._depthTexture=new Pt({format:ut.DEPTH_COMPONENT,type:ut.UNSIGNED_INT}),this._framebuffer=new Ne,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,Ne.DEPTH_ATTACHMENT),this._normalPass=new Eo,this._compositor=z5(j5);var t=this._compositor.getNodeByName("source");t.texture=this._sourceTexture;var e=this._compositor.getNodeByName("coc");this._sourceNode=t,this._cocNode=e,this._compositeNode=this._compositor.getNodeByName("composite"),this._fxaaNode=this._compositor.getNodeByName("FXAA"),this._dofBlurNodes=["dof_far_blur","dof_near_blur","dof_coc_blur"].map(function(i){return this._compositor.getNodeByName(i)},this),this._dofBlurKernel=0,this._dofBlurKernelSize=new Float32Array(0),this._finalNodesChain=Ig.map(function(i){return this._compositor.getNodeByName(i)},this);var r={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new Ni(r),this._ssrPass=new Oi(r),this._edgePass=new hl(r)}Tt.prototype.resize=function(i,n,r){r=r||1;var i=i*r,n=n*r,a=this._sourceTexture,o=this._depthTexture;a.width=i,a.height=n,o.width=i,o.height=n;var s={getWidth:function(){return i},getHeight:function(){return n},getDevicePixelRatio:function(){return r}};function l(u,f){if(typeof u[f]=="function"){var h=u[f].__original||u[f];u[f]=function(v){return h.call(this,s)},u[f].__original=h}}this._compositor.nodes.forEach(function(u){for(var f in u.outputs){var h=u.outputs[f].parameters;h&&(l(h,"width"),l(h,"height"))}for(var v in u.parameters)l(u.parameters,v)}),this._width=i,this._height=n,this._dpr=r};Tt.prototype.getWidth=function(){return this._width};Tt.prototype.getHeight=function(){return this._height};Tt.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR};Tt.prototype._getPrevNode=function(t){for(var e=Ig.indexOf(t.name)-1,r=this._finalNodesChain[e];r&&!this._compositor.getNodeByName(r.name);)e-=1,r=this._finalNodesChain[e];return r};Tt.prototype._getNextNode=function(t){for(var e=Ig.indexOf(t.name)+1,r=this._finalNodesChain[e];r&&!this._compositor.getNodeByName(r.name);)e+=1,r=this._finalNodesChain[e];return r};Tt.prototype._addChainNode=function(t){var e=this._getPrevNode(t),r=this._getNextNode(t);e&&(t.inputs.texture=e.name,r?(t.outputs=lb(this.getWidth.bind(this),this.getHeight.bind(this)),r.inputs.texture=t.name):t.outputs=null,this._compositor.addNode(t))};Tt.prototype._removeChainNode=function(t){var e=this._getPrevNode(t),r=this._getNextNode(t);e&&(r?(e.outputs=lb(this.getWidth.bind(this),this.getHeight.bind(this)),r.inputs.texture=e.name):e.outputs=null,this._compositor.removeNode(t))};Tt.prototype.updateNormal=function(t,e,r,i){this._ifRenderNormalPass()&&this._normalPass.update(t,e,r)};Tt.prototype.updateSSAO=function(t,e,r,i){this._ssaoPass.update(t,r,i)};Tt.prototype.enableSSAO=function(){this._enableSSAO=!0};Tt.prototype.disableSSAO=function(){this._enableSSAO=!1};Tt.prototype.enableSSR=function(){this._enableSSR=!0};Tt.prototype.disableSSR=function(){this._enableSSR=!1};Tt.prototype.getSSAOTexture=function(){return this._ssaoPass.getTargetTexture()};Tt.prototype.getSourceFrameBuffer=function(){return this._framebuffer};Tt.prototype.getSourceTexture=function(){return this._sourceTexture};Tt.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)};Tt.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)};Tt.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()};Tt.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()};Tt.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()};Tt.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()};Tt.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0};Tt.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1};Tt.prototype.enableEdge=function(){this._enableEdge=!0};Tt.prototype.disableEdge=function(){this._enableEdge=!1};Tt.prototype.setBloomIntensity=function(t){this._compositeNode.setParameter("bloomIntensity",t)};Tt.prototype.setSSAOParameter=function(t,e){switch(t){case"quality":var r={low:6,medium:12,high:32,ultra:62}[e]||12;this._ssaoPass.setParameter("kernelSize",r);break;case"radius":this._ssaoPass.setParameter(t,e),this._ssaoPass.setParameter("bias",e/200);break;case"intensity":this._ssaoPass.setParameter(t,e);break}};Tt.prototype.setDOFParameter=function(t,e){switch(t){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(t,e);break;case"blurRadius":for(var r=0;r<this._dofBlurNodes.length;r++)this._dofBlurNodes[r].setParameter("blurRadius",e);break;case"quality":var i={low:4,medium:8,high:16,ultra:32}[e]||8;this._dofBlurKernelSize=i;for(var r=0;r<this._dofBlurNodes.length;r++)this._dofBlurNodes[r].pass.material.define("POISSON_KERNEL_SIZE",i);this._dofBlurKernel=new Float32Array(i*2);break}};Tt.prototype.setSSRParameter=function(t,e){if(e!=null)switch(t){case"quality":var r={low:10,medium:15,high:30,ultra:80}[e]||20,i={low:32,medium:16,high:8,ultra:4}[e]||16;this._ssrPass.setParameter("maxIteration",r),this._ssrPass.setParameter("pixelStride",i);break;case"maxRoughness":this._ssrPass.setParameter("minGlossiness",Math.max(Math.min(1-e,1),0));break;case"physical":this.setPhysicallyCorrectSSR(e);break;default:console.warn("Unkown SSR parameter "+t)}};Tt.prototype.setPhysicallyCorrectSSR=function(t){this._ssrPass.setPhysicallyCorrect(t)};Tt.prototype.setEdgeColor=function(t){var e=tt.parseColor(t);this._edgePass.setParameter("edgeColor",e)};Tt.prototype.setExposure=function(t){this._compositeNode.setParameter("exposure",Math.pow(2,t))};Tt.prototype.setColorLookupTexture=function(t,e){this._compositeNode.pass.material.setTextureImage("lut",this._enableColorCorrection?t:"none",e,{minFilter:tt.Texture.NEAREST,magFilter:tt.Texture.NEAREST,flipY:!1})};Tt.prototype.setColorCorrection=function(t,e){this._compositeNode.setParameter(t,e)};Tt.prototype.isSSREnabled=function(){return this._enableSSR};Tt.prototype.composite=function(t,e,r,i,n){var a=this._sourceTexture,o=a;this._enableEdge&&(this._edgePass.update(t,r,a,n),a=o=this._edgePass.getTargetTexture()),this._enableSSR&&(this._ssrPass.update(t,r,a,n),o=this._ssrPass.getTargetTexture(),this._ssrPass.setSSAOTexture(this._enableSSAO?this._ssaoPass.getTargetTexture():null)),this._sourceNode.texture=o,this._cocNode.setParameter("depth",this._depthTexture);for(var s=this._dofBlurKernel,l=this._dofBlurKernelSize,u=Math.floor(Ky.length/2/l),f=n%u,h=0;h<l*2;h++)s[h]=Ky[h+f*l*2];for(var h=0;h<this._dofBlurNodes.length;h++)this._dofBlurNodes[h].setParameter("percent",n/30),this._dofBlurNodes[h].setParameter("poissonKernel",s);this._cocNode.setParameter("zNear",r.near),this._cocNode.setParameter("zFar",r.far),this._compositor.render(t,i)};Tt.prototype.dispose=function(t){this._sourceTexture.dispose(t),this._depthTexture.dispose(t),this._framebuffer.dispose(t),this._compositor.dispose(t),this._normalPass.dispose(t),this._ssaoPass.dispose(t)};function Yd(t){for(var e=[],r=0;r<30;r++)e.push([yo(r,2),yo(r,3)]);this._haltonSequence=e,this._frame=0,this._sourceTex=new Pt,this._sourceFb=new Ne,this._sourceFb.attach(this._sourceTex),this._prevFrameTex=new Pt,this._outputTex=new Pt;var i=this._blendPass=new We({fragment:V.source("clay.compositor.blend")});i.material.disableTexturesAll(),i.material.enableTexture(["texture1","texture2"]),this._blendFb=new Ne({depthBuffer:!1}),this._outputPass=new We({fragment:V.source("clay.compositor.output"),blendWithPrevious:!0}),this._outputPass.material.define("fragment","OUTPUT_ALPHA"),this._outputPass.material.blend=function(n){n.blendEquationSeparate(n.FUNC_ADD,n.FUNC_ADD),n.blendFuncSeparate(n.ONE,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA)}}Yd.prototype={constructor:Yd,jitterProjection:function(t,e){var r=t.viewport,i=r.devicePixelRatio||t.getDevicePixelRatio(),n=r.width*i,a=r.height*i,o=this._haltonSequence[this._frame%this._haltonSequence.length],s=new J;s.array[12]=(o[0]*2-1)/n,s.array[13]=(o[1]*2-1)/a,J.mul(e.projectionMatrix,s,e.projectionMatrix),J.invert(e.invProjectionMatrix,e.projectionMatrix)},resetFrame:function(){this._frame=0},getFrame:function(){return this._frame},getSourceFrameBuffer:function(){return this._sourceFb},getOutputTexture:function(){return this._outputTex},resize:function(t,e){this._prevFrameTex.width=t,this._prevFrameTex.height=e,this._outputTex.width=t,this._outputTex.height=e,this._sourceTex.width=t,this._sourceTex.height=e,this._prevFrameTex.dirty(),this._outputTex.dirty(),this._sourceTex.dirty()},isFinished:function(){return this._frame>=this._haltonSequence.length},render:function(t,e,r){var i=this._blendPass;this._frame===0?(i.setUniform("weight1",0),i.setUniform("weight2",1)):(i.setUniform("weight1",.9),i.setUniform("weight2",.1)),i.setUniform("texture1",this._prevFrameTex),i.setUniform("texture2",e||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(t),i.render(t),this._blendFb.unbind(t),r||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(t));var n=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=n,this._frame++},dispose:function(t){this._sourceFb.dispose(t),this._blendFb.dispose(t),this._prevFrameTex.dispose(t),this._outputTex.dispose(t),this._sourceTex.dispose(t),this._outputPass.dispose(t),this._blendPass.dispose(t)}};function te(t){t=t||"perspective",this.layer=null,this.scene=new ln,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(t),this._compositor=new Tt,this._temporalSS=new Yd,this._shadowMapPass=new S5;for(var e=[],r=0,i=0;i<30;i++){for(var n=[],a=0;a<6;a++)n.push(yo(r,2)*4-2),n.push(yo(r,3)*4-2),r++;e.push(n)}this._pcfKernels=e,this.scene.on("beforerender",function(o,s,l){this.needsTemporalSS()&&this._temporalSS.jitterProjection(o,l)},this)}te.prototype.setProjection=function(t){var e=this.camera;e&&e.update(),t==="perspective"?this.camera instanceof xe||(this.camera=new xe,e&&this.camera.setLocalTransform(e.localTransform)):this.camera instanceof Ks||(this.camera=new Ks,e&&this.camera.setLocalTransform(e.localTransform)),this.camera.near=.1,this.camera.far=2e3};te.prototype.setViewport=function(t,e,r,i,n){this.camera instanceof xe&&(this.camera.aspect=r/i),n=n||1,this.viewport.x=t,this.viewport.y=e,this.viewport.width=r,this.viewport.height=i,this.viewport.devicePixelRatio=n,this._compositor.resize(r*n,i*n),this._temporalSS.resize(r*n,i*n)};te.prototype.containPoint=function(t,e){var r=this.viewport,i=this.layer.renderer.getHeight();return e=i-e,t>=r.x&&e>=r.y&&t<=r.x+r.width&&e<=r.y+r.height};var jy=new ur;te.prototype.castRay=function(t,e,r){var i=this.layer.renderer,n=i.viewport;return i.viewport=this.viewport,i.screenToNDC(t,e,jy),this.camera.castRay(jy,r),i.viewport=n,r};te.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this.scene.updateLights();var t=this.scene.updateRenderList(this.camera);this._needsSortProgressively=!1;for(var e=0;e<t.transparent.length;e++){var r=t.transparent[e],i=r.geometry;i.needsSortVerticesProgressively&&i.needsSortVerticesProgressively()&&(this._needsSortProgressively=!0),i.needsSortTrianglesProgressively&&i.needsSortTrianglesProgressively()&&(this._needsSortProgressively=!0)}this._frame=0,this._temporalSS.resetFrame()};te.prototype.render=function(t,e){this._doRender(t,e,this._frame),this._frame++};te.prototype.needsAccumulate=function(){return this.needsTemporalSS()||this._needsSortProgressively};te.prototype.needsTemporalSS=function(){var t=this._enableTemporalSS;return t==="auto"&&(t=this._enablePostEffect),t};te.prototype.hasDOF=function(){return this._enableDOF};te.prototype.isAccumulateFinished=function(){return this.needsTemporalSS()?this._temporalSS.isFinished():this._frame>30};te.prototype._doRender=function(t,e,r){var i=this.scene,n=this.camera;r=r||0,this._updateTransparent(t,i,n,r),e||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(t,i,n,!0)),this._updateShadowPCFKernel(r);var a=t.clearColor;if(t.gl.clearColor(a[0],a[1],a[2],a[3]),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(t,n),this._compositor.updateNormal(t,i,n,this._temporalSS.getFrame())),this._updateSSAO(t,i,n,this._temporalSS.getFrame()),this._enablePostEffect){var o=this._compositor.getSourceFrameBuffer();o.bind(t),t.gl.clear(t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT),t.render(i,n,!0,!0),o.unbind(t),this.needsTemporalSS()&&e?(this._compositor.composite(t,i,n,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),t.setViewport(this.viewport),this._temporalSS.render(t)):(t.setViewport(this.viewport),this._compositor.composite(t,i,n,null,0))}else if(this.needsTemporalSS()&&e){var o=this._temporalSS.getSourceFrameBuffer();o.bind(t),t.saveClear(),t.clearBit=t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT,t.render(i,n,!0,!0),t.restoreClear(),o.unbind(t),t.setViewport(this.viewport),this._temporalSS.render(t)}else t.setViewport(this.viewport),t.render(i,n,!0,!0)};te.prototype._updateTransparent=function(t,e,r,i){for(var n=new W,a=new J,o=r.getWorldPosition(),s=e.getRenderList(r).transparent,l=0;l<s.length;l++){var u=s[l],f=u.geometry;J.invert(a,u.worldTransform),W.transformMat4(n,o,a),f.needsSortTriangles&&f.needsSortTriangles()&&f.doSortTriangles(n,i),f.needsSortVertices&&f.needsSortVertices()&&f.doSortVertices(n,i)}};te.prototype._updateSSAO=function(t,e,r){var i=this._enableSSAO&&this._enablePostEffect;i&&this._compositor.updateSSAO(t,e,r,this._temporalSS.getFrame());for(var n=e.getRenderList(r),a=0;a<n.opaque.length;a++){var o=n.opaque[a];o.renderNormal&&o.material[i?"enableTexture":"disableTexture"]("ssaoMap"),i&&o.material.set("ssaoMap",this._compositor.getSSAOTexture())}};te.prototype._updateShadowPCFKernel=function(t){for(var e=this._pcfKernels[t%this._pcfKernels.length],r=this.scene.getRenderList(this.camera),i=r.opaque,n=0;n<i.length;n++)i[n].receiveShadow&&(i[n].material.set("pcfKernel",e),i[n].material.define("fragment","PCF_KERNEL_SIZE",e.length/2))};te.prototype.dispose=function(t){this._compositor.dispose(t.gl),this._temporalSS.dispose(t.gl),this._shadowMapPass.dispose(t)};te.prototype.setPostEffect=function(t,e){var r=this._compositor;this._enablePostEffect=t.get("enable");var i=t.getModel("bloom"),n=t.getModel("edge"),a=t.getModel("DOF",t.getModel("depthOfField")),o=t.getModel("SSAO",t.getModel("screenSpaceAmbientOcclusion")),s=t.getModel("SSR",t.getModel("screenSpaceReflection")),l=t.getModel("FXAA"),u=t.getModel("colorCorrection");i.get("enable")?r.enableBloom():r.disableBloom(),a.get("enable")?r.enableDOF():r.disableDOF(),s.get("enable")?r.enableSSR():r.disableSSR(),u.get("enable")?r.enableColorCorrection():r.disableColorCorrection(),n.get("enable")?r.enableEdge():r.disableEdge(),l.get("enable")?r.enableFXAA():r.disableFXAA(),this._enableDOF=a.get("enable"),this._enableSSAO=o.get("enable"),this._enableSSAO?r.enableSSAO():r.disableSSAO(),r.setBloomIntensity(i.get("intensity")),r.setEdgeColor(n.get("color")),r.setColorLookupTexture(u.get("lookupTexture"),e),r.setExposure(u.get("exposure")),["radius","quality","intensity"].forEach(function(f){r.setSSAOParameter(f,o.get(f))}),["quality","maxRoughness","physical"].forEach(function(f){r.setSSRParameter(f,s.get(f))}),["quality","focalDistance","focalRange","blurRadius","fstop"].forEach(function(f){r.setDOFParameter(f,a.get(f))}),["brightness","contrast","saturation"].forEach(function(f){r.setColorCorrection(f,u.get(f))})};te.prototype.setDOFFocusOnPoint=function(t){if(this._enablePostEffect)return t>this.camera.far||t<this.camera.near?void 0:(this._compositor.setDOFParameter("focalDistance",t),!0)};te.prototype.setTemporalSuperSampling=function(t){this._enableTemporalSS=t.get("enable")};te.prototype.isLinearSpace=function(){return this._enablePostEffect};te.prototype.setRootNode=function(t){if(this.rootNode!==t){for(var e=this.rootNode.children(),r=0;r<e.length;r++)t.add(e[r]);t!==this.scene&&this.scene.add(t),this.rootNode=t}};te.prototype.add=function(t){this.rootNode.add(t)};te.prototype.remove=function(t){this.rootNode.remove(t)};te.prototype.removeAll=function(t){this.rootNode.removeAll(t)};Object.assign(te.prototype,yg);function t4(t,e){var r=t.getBoxLayoutParams(),i=on(r,{width:e.getWidth(),height:e.getHeight()});i.y=e.getHeight()-i.y-i.height,this.viewGL.setViewport(i.x,i.y,i.width,i.height,e.getDevicePixelRatio());var n=t.get("boxWidth"),a=t.get("boxHeight"),o=t.get("boxDepth");this.getAxis("x").setExtent(-n/2,n/2),this.getAxis("y").setExtent(o/2,-o/2),this.getAxis("z").setExtent(-a/2,a/2),this.size=[n,a,o]}function e4(t,e){var r={};function i(n,a){r[n]=r[n]||[1/0,-1/0],r[n][0]=Math.min(a[0],r[n][0]),r[n][1]=Math.max(a[1],r[n][1])}t.eachSeries(function(n){if(n.coordinateSystem===this){var a=n.getData();["x","y","z"].forEach(function(o){a.mapDimensionsAll(o,!0).forEach(function(s){i(o,a.getDataExtent(s,!0))})})}},this),["xAxis3D","yAxis3D","zAxis3D"].forEach(function(n){t.eachComponent(n,function(a){var o=n.charAt(0),s=a.getReferringComponents("grid3D").models[0],l=s.coordinateSystem;if(l===this){var u=l.getAxis(o);if(!u){var f=iN(r[o]||[1/0,-1/0],a);u=new Rf(o,f),u.type=a.get("type");var h=u.type==="category";u.onBand=h&&a.get("boundaryGap"),u.inverse=a.get("inverse"),a.axis=u,u.model=a,u.getLabelModel=function(){return a.getModel("axisLabel",s.getModel("axisLabel"))},u.getTickModel=function(){return a.getModel("axisTick",s.getModel("axisTick"))},l.addAxis(u)}}},this)},this),this.resize(this.model,e)}var r4={dimensions:js.prototype.dimensions,create:function(t,e){var r=[];t.eachComponent("grid3D",function(a){a.__viewGL=a.__viewGL||new te;var o=new js;o.model=a,o.viewGL=a.__viewGL,a.coordinateSystem=o,r.push(o),o.resize=t4,o.update=e4});var i=["xAxis3D","yAxis3D","zAxis3D"];function n(a,o){return i.map(function(s){var l=a.getReferringComponents(s).models[0];return l==null&&(l=o.getComponent(s)),l})}return t.eachSeries(function(a){if(a.get("coordinateSystem")==="cartesian3D"){var o=a.getReferringComponents("grid3D").models[0];if(o==null){var s=n(a,t),o=s[0].getCoordSysModel();s.forEach(function(f){f.getCoordSysModel()})}var l=o.coordinateSystem;a.coordinateSystem=l}}),r}};const i4=r4;var ub=Vt.extend({type:"cartesian3DAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid3D",index:this.option.gridIndex,id:this.option.gridId})[0]}});nN(ub);const n4=ub;var fb={show:!0,grid3DIndex:0,inverse:!1,name:"",nameLocation:"middle",nameTextStyle:{fontSize:16},nameGap:20,axisPointer:{},axisLine:{},axisTick:{},axisLabel:{},splitArea:{}},a4=dt({boundaryGap:!0,axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"},axisPointer:{label:{show:!1}}},fb),Ng=dt({boundaryGap:[0,0],splitNumber:5,axisPointer:{label:{}}},fb),o4=Lt({scale:!0,min:"dataMin",max:"dataMax"},Ng),hb=Lt({logBase:10},Ng);hb.scale=!0;const s4={categoryAxis3D:a4,valueAxis3D:Ng,timeAxis3D:o4,logAxis3D:hb};var l4=["value","category","time","log"];function u4(t,e,r,i,n){l4.forEach(function(a){var o=r.extend({type:e+"Axis3D."+a,__ordinalMeta:null,mergeDefaultAndTheme:function(s,l){var u=l.getTheme();dt(s,u.get(a+"Axis3D")),dt(s,this.getDefaultOption()),s.type=i(e,s)},optionUpdated:function(){var s=this.option;s.type==="category"&&(this.__ordinalMeta=Sf.createByAxisModel(this))},getCategories:function(){if(this.option.type==="category")return this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:dt(ft(s4[a+"Axis3D"]),n||{},!0)});t.registerComponentModel(o)}),t.registerSubTypeDefaulter(e+"Axis3D",de(i,e))}function f4(t,e){return e.type||(e.data?"category":"value")}function h4(t){t.registerComponentModel(f5),t.registerComponentView(_5),t.registerCoordinateSystem("grid3D",i4),["x","y","z"].forEach(function(e){u4(t,e,n4,f4,{name:e.toUpperCase()});const r=t.ComponentView.extend({type:e+"Axis3D"});t.registerComponentView(r)}),t.registerAction({type:"grid3DChangeCamera",event:"grid3dcamerachanged",update:"series:updateCamera"},function(e,r){r.eachComponent({mainType:"grid3D",query:e},function(i){i.setView(e)})}),t.registerAction({type:"grid3DShowAxisPointer",event:"grid3dshowaxispointer",update:"grid3D:showAxisPointer"},function(e,r){}),t.registerAction({type:"grid3DHideAxisPointer",event:"grid3dhideaxispointer",update:"grid3D:hideAxisPointer"},function(e,r){})}const c4={defaultOption:{shading:null,realisticMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},lambertMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},colorMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},hatchingMaterial:{textureTiling:1,textureOffset:0,paperColor:"#fff"}}};function mv(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function cb(t,e,r,i,n){var a=r,o=t[e];mv(t,e,i);for(var s=r;s<i;s++)n(t[s],o)<0&&(mv(t,s,a),a++);return mv(t,i,a),a}function Pf(t,e,r,i){if(r<i){var n=Math.floor((r+i)/2),a=cb(t,n,r,i,e);Pf(t,e,r,a-1),Pf(t,e,a+1,i)}}function If(){this._parts=[]}If.prototype.step=function(t,e,r){var i=t.length;if(r===0){this._parts=[],this._sorted=!1;var n=Math.floor(i/2);this._parts.push({pivot:n,left:0,right:i-1}),this._currentSortPartIdx=0}if(!this._sorted){var a=this._parts;if(a.length===0)return this._sorted=!0,!0;if(a.length<512){for(var o=0;o<a.length;o++)a[o].pivot=cb(t,a[o].pivot,a[o].left,a[o].right,e);for(var s=[],o=0;o<a.length;o++){var l=a[o].left,u=a[o].pivot-1;u>l&&s.push({pivot:Math.floor((u+l)/2),left:l,right:u});var l=a[o].pivot+1,u=a[o].right;u>l&&s.push({pivot:Math.floor((u+l)/2),left:l,right:u})}a=this._parts=s}else for(var o=0;o<Math.floor(a.length/10);o++){var f=a.length-1-this._currentSortPartIdx;if(Pf(t,e,a[f].left,a[f].right),this._currentSortPartIdx++,this._currentSortPartIdx===a.length)return this._sorted=!0,!0}return!1}};If.sort=Pf;var uo=Th.vec3,Qy=uo.create(),Jy=uo.create(),t1=uo.create();const v4={needsSortTriangles:function(){return this.indices&&this.sortTriangles},needsSortTrianglesProgressively:function(){return this.needsSortTriangles()&&this.triangleCount>=2e4},doSortTriangles:function(t,e){var r=this.indices;if(e===0){var i=this.attributes.position,t=t.array;(!this._triangleZList||this._triangleZList.length!==this.triangleCount)&&(this._triangleZList=new Float32Array(this.triangleCount),this._sortedTriangleIndices=new Uint32Array(this.triangleCount),this._indicesTmp=new r.constructor(r.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var n=0,a,o=0;o<r.length;){i.get(r[o++],Qy),i.get(r[o++],Jy),i.get(r[o++],t1);var s=uo.sqrDist(Qy,t),l=uo.sqrDist(Jy,t),u=uo.sqrDist(t1,t),f=Math.min(s,l);f=Math.min(f,u),o===3?(a=f,f=0):f=f-a,this._triangleZList[n++]=f}}for(var h=this._sortedTriangleIndices,o=0;o<h.length;o++)h[o]=o;if(this.triangleCount<2e4)e===0&&this._simpleSort(!0);else for(var o=0;o<3;o++)this._progressiveQuickSort(e*3+o);for(var v=this._indicesTmp,c=this._triangleZListTmp,d=this._triangleZList,o=0;o<this.triangleCount;o++){var p=h[o]*3,g=o*3;v[g++]=r[p++],v[g++]=r[p++],v[g]=r[p],c[o]=d[h[o]]}var m=this._indicesTmp;this._indicesTmp=this.indices,this.indices=m;var m=this._triangleZListTmp;this._triangleZListTmp=this._triangleZList,this._triangleZList=m,this.dirtyIndices()},_simpleSort:function(t){var e=this._triangleZList,r=this._sortedTriangleIndices;function i(n,a){return e[a]-e[n]}t?Array.prototype.sort.call(r,i):If.sort(r,i,0,r.length-1)},_progressiveQuickSort:function(t){var e=this._triangleZList,r=this._sortedTriangleIndices;this._quickSort=this._quickSort||new If,this._quickSort.step(r,function(i,n){return e[n]-e[i]},t)}};function $d(t,e){const r=t.getItemVisual(e,"style");if(r){const i=t.getVisual("drawType");return r[i]}}function e1(t,e){const r=t.getItemVisual(e,"style");return r&&r.opacity}function d4(t,e){var r=[];return M(t.dimensions,function(i){var n=t.getDimensionInfo(i),a=n.otherDims,o=a[e];o!=null&&o!==!1&&(r[o]=n.name)}),r}function p4(t,e,r){function i(h){var v=[],c=d4(n,"tooltip");c.length?M(c,function(p){d(n.get(p,e),p)}):M(h,d);function d(p,g){var m=n.getDimensionInfo(g);if(!(!m||m.otherDims.tooltip===!1)){var _=m.type,y="- "+(m.tooltipName||m.name)+": "+(_==="ordinal"?p+"":_==="time"?r?"":eL("yyyy/MM/dd hh:mm:ss",p):vf(p));y&&v.push(Me(y))}}return"<br/>"+v.join("<br/>")}var n=t.getData(),a=t.getRawValue(e),o=X(a)?i(a):Me(vf(a)),s=n.getName(e),l=$d(n,e);j(l)&&l.colorStops&&(l=(l.colorStops[0]||{}).color),l=l||"transparent";var u=cS(l),f=t.name;return f==="\0-"&&(f=""),f=f?Me(f)+(r?": ":"<br/>"):"",r?u+f+o:f+u+(s?Me(s)+": "+o:o)}function g4(t,e,r){r=r||t.getSource();var i=e||WP(t.get("coordinateSystem"))||["x","y","z"],n=lI(r,{dimensionsDefine:r.dimensionsDefine||t.get("dimensions"),encodeDefine:r.encodeDefine||t.get("encode"),coordDimensions:i.map(function(s){var l=t.getReferringComponents(s+"Axis3D").models[0];return{type:l&&l.get("type")==="category"?"ordinal":"float",name:s}})});t.get("coordinateSystem")==="cartesian3D"&&n.forEach(function(s){if(i.indexOf(s.coordDim)>=0){var l=t.getReferringComponents(s.coordDim+"Axis3D").models[0];l&&l.get("type")==="category"&&(s.ordinalMeta=l.getOrdinalMeta())}});var a=rN.enableDataStack(t,n,{byIndex:!0,stackedCoordDimension:"z"}),o=new Mw(n,t);return o.setCalculationInfo(a),o.initData(r),o}var vb=co.extend({type:"series.surface",dependencies:["globe","grid3D","geo3D"],visualStyleAccessPath:"itemStyle",formatTooltip:function(t){return p4(this,t)},getInitialData:function(t,e){var r=t.data;function i(F){return!(isNaN(F.min)||isNaN(F.max)||isNaN(F.step))}function n(F){var O=gp;return Math.max(O(F.min),O(F.max),O(F.step))+1}if(!r)if(t.parametric){var x=t.parametricEquation||{},S=x.u||{},T=x.v||{};["u","v"].forEach(function(O){i(x[O])}),["x","y","z"].forEach(function(O){x[O]});var b=Math.floor((S.max+S.step-S.min)/S.step),w=Math.floor((T.max+T.step-T.min)/T.step);r=new Float32Array(b*w*5);for(var A=n(S),C=n(T),v=0,c=0;c<w;c++)for(var d=0;d<b;d++){var E=d*S.step+S.min,D=c*T.step+T.min,L=re(Math.min(E,S.max),A),R=re(Math.min(D,T.max),C),p=x.x(L,R),g=x.y(L,R),y=x.z(L,R);r[v++]=p,r[v++]=g,r[v++]=y,r[v++]=L,r[v++]=R}}else{var a=t.equation||{},o=a.x||{},s=a.y||{};if(["x","y"].forEach(function(F){i(a[F])}),typeof a.z!="function")return;var l=Math.floor((o.max+o.step-o.min)/o.step),u=Math.floor((s.max+s.step-s.min)/s.step);r=new Float32Array(l*u*3);for(var f=n(o),h=n(s),v=0,c=0;c<u;c++)for(var d=0;d<l;d++){var p=d*o.step+o.min,g=c*s.step+s.min,m=re(Math.min(p,o.max),f),_=re(Math.min(g,s.max),h),y=a.z(m,_);r[v++]=m,r[v++]=_,r[v++]=y}}var N=["x","y","z"];t.parametric&&N.push("u","v");var I=g4(this,N,r);return I},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,shading:"lambert",parametric:!1,wireframe:{show:!0,lineStyle:{color:"rgba(0,0,0,0.5)",width:1}},equation:{x:{min:-1,max:1,step:.1},y:{min:-1,max:1,step:.1},z:null},parametricEquation:{u:{min:-1,max:1,step:.1},v:{min:-1,max:1,step:.1},x:null,y:null,z:null},dataShape:null,itemStyle:{},animationDurationUpdate:500}});dt(vb.prototype,c4);const m4=vb;var zn=Th.vec3;function _4(t){return isNaN(t[0])||isNaN(t[1])||isNaN(t[2])}const y4=Ai.extend({type:"surface",__ecgl__:!0,init:function(t,e){this.groupGL=new tt.Node},render:function(t,e,r){var i=this._prevSurfaceMesh;this._prevSurfaceMesh=this._surfaceMesh,this._surfaceMesh=i,this._surfaceMesh||(this._surfaceMesh=this._createSurfaceMesh()),this.groupGL.remove(this._prevSurfaceMesh),this.groupGL.add(this._surfaceMesh);var n=t.coordinateSystem,a=t.get("shading"),o=t.getData(),s="ecgl."+a;if((!this._surfaceMesh.material||this._surfaceMesh.material.shader.name!==s)&&(this._surfaceMesh.material=tt.createMaterial(s,["VERTEX_COLOR","DOUBLE_SIDED"])),tt.setMaterialFromModel(a,this._surfaceMesh.material,t,r),n&&n.viewGL){n.viewGL.add(this.groupGL);var l=n.viewGL.isLinearSpace()?"define":"undefine";this._surfaceMesh.material[l]("fragment","SRGB_DECODE")}var u=t.get("parametric"),f=t.get("dataShape");f||(f=this._getDataShape(o,u));var h=t.getModel("wireframe"),v=h.get("lineStyle.width"),c=h.get("show")&&v>0;this._updateSurfaceMesh(this._surfaceMesh,t,f,c);var d=this._surfaceMesh.material;c?(d.define("WIREFRAME_QUAD"),d.set("wireframeLineWidth",v),d.set("wireframeLineColor",tt.parseColor(h.get("lineStyle.color")))):d.undefine("WIREFRAME_QUAD"),this._initHandler(t,r),this._updateAnimation(t)},_updateAnimation:function(t){tt.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,t)},_createSurfaceMesh:function(){var t=new tt.Mesh({geometry:new tt.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new tt.Material({shader:new tt.Shader(tt.Shader.source("ecgl.sm.depth.vertex"),tt.Shader.source("ecgl.sm.depth.fragment"))}),culling:!1,renderOrder:10,renderNormal:!0});return t.geometry.createAttribute("barycentric","float",4),t.geometry.createAttribute("prevPosition","float",3),t.geometry.createAttribute("prevNormal","float",3),Object.assign(t.geometry,v4),t},_initHandler:function(t,e){var r=t.getData(),i=this._surfaceMesh,n=t.coordinateSystem;function a(s,l){for(var u=1/0,f=-1,h=[],v=0;v<s.length;v++){i.geometry.attributes.position.get(s[v],h);var c=zn.dist(l.array,h);c<u&&(u=c,f=s[v])}return f}i.seriesIndex=t.seriesIndex;var o=-1;i.off("mousemove"),i.off("mouseout"),i.on("mousemove",function(s){var l=a(s.triangle,s.point);if(l>=0){var u=[];i.geometry.attributes.position.get(l,u);for(var f=n.pointToData(u),h=1/0,v=-1,c=[],d=0;d<r.count();d++){c[0]=r.get("x",d),c[1]=r.get("y",d),c[2]=r.get("z",d);var p=zn.squaredDistance(c,f);p<h&&(v=d,h=p)}v!==o&&e.dispatchAction({type:"grid3DShowAxisPointer",value:f}),o=v,i.dataIndex=v}else i.dataIndex=-1},this),i.on("mouseout",function(s){o=-1,i.dataIndex=-1,e.dispatchAction({type:"grid3DHideAxisPointer"})},this)},_updateSurfaceMesh:function(t,e,r,i){var n=t.geometry,a=e.getData(),o=a.getLayout("points"),s=0;a.each(function(oe){a.hasValue(oe)||s++});var l=s||i,u=n.attributes.position,f=n.attributes.normal,h=n.attributes.texcoord0,v=n.attributes.barycentric,c=n.attributes.color,d=r[0],p=r[1],g=e.get("shading"),m=g!=="color";if(l){var _=(d-1)*(p-1)*4;u.init(_),i&&v.init(_)}else u.value=new Float32Array(o);c.init(n.vertexCount),h.init(n.vertexCount);var y=[0,3,1,1,3,2],x=[[1,1,0,0],[0,1,0,1],[1,0,0,1],[1,0,1,0]],S=n.indices=new(n.vertexCount>65535?Uint32Array:Uint16Array)((d-1)*(p-1)*6),T=function(oe,$t,Be){Be[1]=oe*p+$t,Be[0]=oe*p+$t+1,Be[3]=(oe+1)*p+$t+1,Be[2]=(oe+1)*p+$t},b=!1;if(l){var w=[],A=[],C=0;m?f.init(n.vertexCount):f.value=null;for(var E=[[],[],[]],D=[],L=[],R=zn.create(),N=function(oe,$t,Be){var Br=$t*3;return Be[0]=oe[Br],Be[1]=oe[Br+1],Be[2]=oe[Br+2],Be},I=new Float32Array(o.length),F=new Float32Array(o.length/3*4),O=0;O<a.count();O++)if(a.hasValue(O)){var Mt=tt.parseColor($d(a,O)),z=e1(a,O);z!=null&&(Mt[3]*=z),Mt[3]<.99&&(b=!0);for(var k=0;k<4;k++)F[O*4+k]=Mt[k]}for(var it=[1e7,1e7,1e7],O=0;O<d-1;O++)for(var $=0;$<p-1;$++){var nt=O*(p-1)+$,rt=nt*4;T(O,$,w);for(var It=!1,k=0;k<4;k++)N(o,w[k],A),_4(A)&&(It=!0);for(var k=0;k<4;k++)It?u.set(rt+k,it):(N(o,w[k],A),u.set(rt+k,A)),i&&v.set(rt+k,x[k]);for(var k=0;k<6;k++)S[C++]=y[k]+rt;if(m&&!It)for(var k=0;k<2;k++){for(var gt=k*3,Ft=0;Ft<3;Ft++){var Xt=w[y[gt]+Ft];N(o,Xt,E[Ft])}zn.sub(D,E[0],E[1]),zn.sub(L,E[1],E[2]),zn.cross(R,D,L);for(var Ft=0;Ft<3;Ft++){var Ot=w[y[gt]+Ft]*3;I[Ot]=I[Ot]+R[0],I[Ot+1]=I[Ot+1]+R[1],I[Ot+2]=I[Ot+2]+R[2]}}}if(m)for(var O=0;O<I.length/3;O++)N(I,O,R),zn.normalize(R,R),I[O*3]=R[0],I[O*3+1]=R[1],I[O*3+2]=R[2];for(var Mt=[],q=[],O=0;O<d-1;O++)for(var $=0;$<p-1;$++){var nt=O*(p-1)+$,rt=nt*4;T(O,$,w);for(var k=0;k<4;k++){for(var Ft=0;Ft<4;Ft++)Mt[Ft]=F[w[k]*4+Ft];c.set(rt+k,Mt),m&&(N(I,w[k],R),f.set(rt+k,R));var Xt=w[k];q[0]=Xt%p/(p-1),q[1]=Math.floor(Xt/p)/(d-1),h.set(rt+k,q)}nt++}}else{for(var q=[],O=0;O<a.count();O++){q[0]=O%p/(p-1),q[1]=Math.floor(O/p)/(d-1);var Mt=tt.parseColor($d(a,O)),z=e1(a,O);z!=null&&(Mt[3]*=z),Mt[3]<.99&&(b=!0),c.set(O,Mt),h.set(O,q)}for(var w=[],bt=0,O=0;O<d-1;O++)for(var $=0;$<p-1;$++){T(O,$,w);for(var k=0;k<6;k++)S[bt++]=w[y[k]]}m?n.generateVertexNormals():f.value=null}t.material.get("normalMap")&&n.generateTangents(),n.updateBoundingBox(),n.dirty(),t.material.transparent=b,t.material.depthMask=!b},_getDataShape:function(t,e){for(var r=-1/0,i=0,n=0,a=!1,o=e?"u":"x",s=t.count(),l=0;l<s;l++){var u=t.get(o,l);u<r&&(n=0,i++),r=u,n++}if((!i||n===1)&&(a=!0),!a)return[i+1,n];for(var f=Math.floor(Math.sqrt(s));f>0;){if(Math.floor(s/f)===s/f)return[f,s/f];f--}return f=Math.floor(Math.sqrt(s)),[f,f]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});function x4(t){t.registerChartView(y4),t.registerSeriesModel(m4),t.registerLayout(function(e,r){e.eachSeriesByType("surface",function(i){var n=i.coordinateSystem;!n||n.type;var a=i.getData(),o=new Float32Array(3*a.count()),s=[NaN,NaN,NaN];if(n&&n.type==="cartesian3D"){var l=n.dimensions,u=l.map(function(f){return i.coordDimToDataDim(f)[0]});a.each(u,function(f,h,v,c){var d;a.hasValue(c)?d=n.dataToPoint([f,h,v]):d=s,o[c*3]=d[0],o[c*3+1]=d[1],o[c*3+2]=d[2]})}a.setLayout("points",o)})})}var Wn=Kt(),r1=ft,_v=et,T4=function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(e,r,i,n){var a=r.get("value"),o=r.get("status");if(this._axisModel=e,this._axisPointerModel=r,this._api=i,!(!n&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,e,r,i);var f=u.graphicKey;f!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=f;var h=this._moveAnimation=this.determineAnimation(e,r);if(!s)s=this._group=new ue,this.createPointerEl(s,u,e,r),this.createLabelEl(s,u,e,r),i.getZr().add(s);else{var v=de(i1,r,h);this.updatePointerEl(s,u,v),this.updateLabelEl(s,u,v,r)}a1(s,r,!0),this._renderHandle(a)}},t.prototype.remove=function(e){this.clear(e)},t.prototype.dispose=function(e){this.clear(e)},t.prototype.determineAnimation=function(e,r){var i=r.get("animation"),n=e.axis,a=n.type==="category",o=r.get("snap");if(!o&&!a)return!1;if(i==="auto"||i==null){var s=this.animationThreshold;if(a&&n.getBandWidth()>s)return!0;if(o){var l=gg(e).seriesDataCount,u=n.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return i===!0},t.prototype.makeElOption=function(e,r,i,n,a){},t.prototype.createPointerEl=function(e,r,i,n){var a=r.pointer;if(a){var o=Wn(e).pointerEl=new RD[a.type](r1(r.pointer));e.add(o)}},t.prototype.createLabelEl=function(e,r,i,n){if(r.label){var a=Wn(e).labelEl=new Jt(r1(r.label));e.add(a),n1(a,n)}},t.prototype.updatePointerEl=function(e,r,i){var n=Wn(e).pointerEl;n&&r.pointer&&(n.setStyle(r.pointer.style),i(n,{shape:r.pointer.shape}))},t.prototype.updateLabelEl=function(e,r,i,n){var a=Wn(e).labelEl;a&&(a.setStyle(r.label.style),i(a,{x:r.label.x,y:r.label.y}),n1(a,n))},t.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var r=this._axisPointerModel,i=this._api.getZr(),n=this._handle,a=r.getModel("handle"),o=r.get("status");if(!a.get("show")||!o||o==="hide"){n&&i.remove(n),this._handle=null;return}var s;this._handle||(s=!0,n=this._handle=Op(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Ei(u.event)},onmousedown:_v(this._onHandleDragMove,this,0,0),drift:_v(this._onHandleDragMove,this),ondragend:_v(this._onHandleDragEnd,this)}),i.add(n)),a1(n,r,!1),n.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");X(l)||(l=[l,l]),n.scaleX=l[0]/2,n.scaleY=l[1]/2,ch(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},t.prototype._moveHandleToValue=function(e,r){i1(this._axisPointerModel,!r&&this._moveAnimation,this._handle,yv(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(e,r){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(yv(i),[e,r],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(yv(n)),Wn(i).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var r=this._payloadInfo,i=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:r.cursorPoint[0],y:r.cursorPoint[1],tooltipOption:r.tooltipOption,axesInfo:[{axisDim:i.axis.dim,axisIndex:i.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var r=this._axisPointerModel.get("value");this._moveHandleToValue(r),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var r=e.getZr(),i=this._group,n=this._handle;r&&i&&(this._lastGraphicKey=null,i&&r.remove(i),n&&r.remove(n),this._group=null,this._handle=null,this._payloadInfo=null),pf(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(e,r,i){return i=i||0,{x:e[i],y:e[1-i],width:r[i],height:r[1-i]}},t}();function i1(t,e,r,i){db(Wn(r).lastProp,i)||(Wn(r).lastProp=i,e?Ir(r,i,t):(r.stopAnimation(),r.attr(i)))}function db(t,e){if(j(t)&&j(e)){var r=!0;return M(e,function(i,n){r=r&&db(t[n],i)}),!!r}else return t===e}function n1(t,e){t[e.get(["label","show"])?"show":"hide"]()}function yv(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function a1(t,e,r){var i=e.get("z"),n=e.get("zlevel");t&&t.traverse(function(a){a.type!=="group"&&(i!=null&&(a.z=i),n!=null&&(a.zlevel=n),a.silent=r)})}const S4=T4;function w4(t){var e=t.get("type"),r=t.getModel(e+"Style"),i;return e==="line"?(i=r.getLineStyle(),i.fill=null):e==="shadow"&&(i=r.getAreaStyle(),i.stroke=null),i}function b4(t,e,r,i,n){var a=r.get("value"),o=pb(a,e.axis,e.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=al(s.get("padding")||0),u=s.getFont(),f=dp(o,u),h=n.position,v=f.width+l[1]+l[3],c=f.height+l[0]+l[2],d=n.align;d==="right"&&(h[0]-=v),d==="center"&&(h[0]-=v/2);var p=n.verticalAlign;p==="bottom"&&(h[1]-=c),p==="middle"&&(h[1]-=c/2),A4(h,v,c,i);var g=s.get("backgroundColor");(!g||g==="auto")&&(g=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:tr(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:g}),z2:10}}function A4(t,e,r,i){var n=i.getWidth(),a=i.getHeight();t[0]=Math.min(t[0]+e,n)-e,t[1]=Math.min(t[1]+r,a)-r,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function pb(t,e,r,i,n){t=e.scale.parse(t);var a=e.scale.getLabel({value:t},{precision:n.precision}),o=n.formatter;if(o){var s={value:lg(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};M(i,function(l){var u=r.getSeriesByIndex(l.seriesIndex),f=l.dataIndexInside,h=u&&u.getDataParams(f);h&&s.seriesData.push(h)}),Z(o)?a=o.replace("{value}",a):ct(o)&&(a=o(s))}return a}function gb(t,e,r){var i=Rs();return hp(i,i,r.rotation),kv(i,i,r.position),en([t.dataToCoord(e),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],i)}function E4(t,e,r,i,n,a){var o=c2.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=n.get(["label","margin"]),b4(e,i,n,a,{position:gb(i.axis,t,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function C4(t,e,r){return r=r||0,{x1:t[r],y1:t[1-r],x2:e[r],y2:e[1-r]}}function M4(t,e,r){return r=r||0,{x:t[r],y:t[1-r],width:e[r],height:e[1-r]}}var D4=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,i,n,a,o){var s=n.axis,l=s.grid,u=a.get("type"),f=o1(l,s).getOtherAxis(s).getGlobalExtent(),h=s.toGlobalCoord(s.dataToCoord(i,!0));if(u&&u!=="none"){var v=w4(a),c=L4[u](s,h,f);c.style=v,r.graphicKey=c.type,r.pointer=c}var d=Dd(l.model,n);E4(i,r,d,n,a,o)},e.prototype.getHandleTransform=function(r,i,n){var a=Dd(i.axis.grid.model,i,{labelInside:!1});a.labelMargin=n.get(["handle","margin"]);var o=gb(i.axis,r,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,i,n,a){var o=n.axis,s=o.grid,l=o.getGlobalExtent(!0),u=o1(s,o).getOtherAxis(o).getGlobalExtent(),f=o.dim==="x"?0:1,h=[r.x,r.y];h[f]+=i[f],h[f]=Math.min(l[1],h[f]),h[f]=Math.max(l[0],h[f]);var v=(u[1]+u[0])/2,c=[v,v];c[f]=h[f];var d=[{verticalAlign:"middle"},{align:"center"}];return{x:h[0],y:h[1],rotation:r.rotation,cursorPoint:c,tooltipOption:d[f]}},e}(S4);function o1(t,e){var r={};return r[e.dim+"AxisIndex"]=e.index,t.getCartesian(r)}var L4={line:function(t,e,r){var i=C4([e,r[0]],[e,r[1]],s1(t));return{type:"Line",subPixelOptimize:!0,shape:i}},shadow:function(t,e,r){var i=Math.max(1,t.getBandWidth()),n=r[1]-r[0];return{type:"Rect",shape:M4([e-i/2,r[0]],[i,n],s1(t))}}};function s1(t){return t.dim==="x"?0:1}const R4=D4;var P4=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(Vt);const I4=P4;var wi=Kt(),N4=M;function mb(t,e,r){if(!At.node){var i=e.getZr();wi(i).records||(wi(i).records={}),O4(i,e);var n=wi(i).records[t]||(wi(i).records[t]={});n.handler=r}}function O4(t,e){if(wi(t).initialized)return;wi(t).initialized=!0,r("click",de(l1,"click")),r("mousemove",de(l1,"mousemove")),r("globalout",F4);function r(i,n){t.on(i,function(a){var o=k4(e);N4(wi(t).records,function(s){s&&n(s,a,o.dispatchAction)}),B4(o.pendings,e)})}}function B4(t,e){var r=t.showTip.length,i=t.hideTip.length,n;r?n=t.showTip[r-1]:i&&(n=t.hideTip[i-1]),n&&(n.dispatchAction=null,e.dispatchAction(n))}function F4(t,e,r){t.handler("leave",null,r)}function l1(t,e,r,i){e.handler(t,r,i)}function k4(t){var e={showTip:[],hideTip:[]},r=function(i){var n=e[i.type];n?n.push(i):(i.dispatchAction=r,t.dispatchAction(i))};return{dispatchAction:r,pendings:e}}function Zd(t,e){if(!At.node){var r=e.getZr(),i=(wi(r).records||{})[t];i&&(wi(r).records[t]=null)}}var z4=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,i,n){var a=i.getComponent("tooltip"),o=r.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";mb("axisPointer",n,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(r,i){Zd("axisPointer",i)},e.prototype.dispose=function(r,i){Zd("axisPointer",i)},e.type="axisPointer",e}(vr);const U4=z4;function _b(t,e){var r=[],i=t.seriesIndex,n;if(i==null||!(n=e.getSeriesByIndex(i)))return{point:[]};var a=n.getData(),o=sa(a,t);if(o==null||o<0||X(o))return{point:[]};var s=a.getItemGraphicEl(o),l=n.coordinateSystem;if(n.getTooltipPosition)r=n.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),f=l.getOtherAxis(u),h=f.dim,v=u.dim,c=h==="x"||h==="radius"?1:0,d=a.mapDimension(v),p=[];p[c]=a.get(d,o),p[1-c]=a.get(a.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(p)||[]}else r=l.dataToPoint(a.getValues(K(l.dimensions,function(m){return a.mapDimension(m)}),o))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),r=[g.x+g.width/2,g.y+g.height/2]}return{point:r,el:s}}var u1=Kt();function H4(t,e,r){var i=t.currTrigger,n=[t.x,t.y],a=t,o=t.dispatchAction||et(r.dispatchAction,r),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){zu(n)&&(n=_b({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=zu(n),u=a.axesInfo,f=s.axesInfo,h=i==="leave"||zu(n),v={},c={},d={list:[],map:{}},p={showPointer:de(G4,c),showTooltip:de(W4,d)};M(s.coordSysMap,function(m,_){var y=l||m.containPoint(n);M(s.coordSysAxesInfo[_],function(x,S){var T=x.axis,b=Z4(u,x);if(!h&&y&&(!u||b)){var w=b&&b.value;w==null&&!l&&(w=T.pointToData(n)),w!=null&&f1(x,w,p,!1,v)}})});var g={};return M(f,function(m,_){var y=m.linkGroup;y&&!c[_]&&M(y.axesInfo,function(x,S){var T=c[S];if(x!==m&&T){var b=T.value;y.mapper&&(b=m.axis.scale.parse(y.mapper(b,h1(x),h1(m)))),g[m.key]=b}})}),M(g,function(m,_){f1(f[_],m,p,!0,v)}),X4(c,f,v),Y4(d,n,t,o),$4(f,o,r),v}}function f1(t,e,r,i,n){var a=t.axis;if(!(a.scale.isBlank()||!a.containData(e))){if(!t.involveSeries){r.showPointer(t,e);return}var o=V4(e,t),s=o.payloadBatch,l=o.snapToValue;s[0]&&n.seriesIndex==null&&U(n,s[0]),!i&&t.snap&&a.containData(l)&&l!=null&&(e=l),r.showPointer(t,e,s),r.showTooltip(t,o,l)}}function V4(t,e){var r=e.axis,i=r.dim,n=t,a=[],o=Number.MAX_VALUE,s=-1;return M(e.seriesModels,function(l,u){var f=l.getData().mapDimensionsAll(i),h,v;if(l.getAxisTooltipData){var c=l.getAxisTooltipData(f,t,r);v=c.dataIndices,h=c.nestestValue}else{if(v=l.getData().indicesOfNearest(f[0],t,r.type==="category"?.5:null),!v.length)return;h=l.getData().get(f[0],v[0])}if(!(h==null||!isFinite(h))){var d=t-h,p=Math.abs(d);p<=o&&((p<o||d>=0&&s<0)&&(o=p,s=d,n=h,a.length=0),M(v,function(g){a.push({seriesIndex:l.seriesIndex,dataIndexInside:g,dataIndex:l.getData().getRawIndex(g)})}))}}),{payloadBatch:a,snapToValue:n}}function G4(t,e,r,i){t[e.key]={value:r,payloadBatch:i}}function W4(t,e,r,i){var n=r.payloadBatch,a=e.axis,o=a.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!n.length)){var l=e.coordSys.model,u=Xs(l),f=t.map[u];f||(f=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(f)),f.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:i,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:n.slice()})}}function X4(t,e,r){var i=r.axesInfo=[];M(e,function(n,a){var o=n.axisPointerModel.option,s=t[a];s?(!n.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!n.useHandle&&(o.status="hide"),o.status==="show"&&i.push({axisDim:n.axis.dim,axisIndex:n.axis.model.componentIndex,value:o.value})})}function Y4(t,e,r,i){if(zu(e)||!t.list.length){i({type:"hideTip"});return}var n=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};i({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:r.tooltipOption,position:r.position,dataIndexInside:n.dataIndexInside,dataIndex:n.dataIndex,seriesIndex:n.seriesIndex,dataByCoordSys:t.list})}function $4(t,e,r){var i=r.getZr(),n="axisPointerLastHighlights",a=u1(i)[n]||{},o=u1(i)[n]={};M(t,function(u,f){var h=u.axisPointerModel.option;h.status==="show"&&u.triggerEmphasis&&M(h.seriesDataIndices,function(v){var c=v.seriesIndex+" | "+v.dataIndex;o[c]=v})});var s=[],l=[];M(a,function(u,f){!o[f]&&l.push(u)}),M(o,function(u,f){!a[f]&&s.push(u)}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function Z4(t,e){for(var r=0;r<(t||[]).length;r++){var i=t[r];if(e.axis.dim===i.axisDim&&e.axis.model.componentIndex===i.axisIndex)return i}}function h1(t){var e=t.axis.model,r={},i=r.axisDim=t.axis.dim;return r.axisIndex=r[i+"AxisIndex"]=e.componentIndex,r.axisName=r[i+"AxisName"]=e.name,r.axisId=r[i+"AxisId"]=e.id,r}function zu(t){return!t||t[0]==null||isNaN(t[0])||t[1]==null||isNaN(t[1])}function yb(t){v2.registerAxisPointerClass("CartesianAxisPointer",R4),t.registerComponentModel(I4),t.registerComponentView(U4),t.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var r=e.axisPointer.link;r&&!X(r)&&(e.axisPointer.link=[r])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,function(e,r){e.getComponent("axisPointer").coordSysAxesInfo=$O(e,r)}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},H4)}function q4(t){nr(l3),nr(yb)}function K4(t,e){var r=t.existing;if(e.id=t.keyInfo.id,!e.type&&r&&(e.type=r.type),e.parentId==null){var i=e.parentOption;i?e.parentId=i.id:r&&(e.parentId=r.parentId)}e.parentOption=null}function c1(t,e){var r;return M(e,function(i){t[i]!=null&&t[i]!=="auto"&&(r=!0)}),r}function j4(t,e,r){var i=U({},r),n=t[e],a=r.$action||"merge";a==="merge"?n?(dt(n,i,!0),fa(n,i,{ignoreSize:!0}),pS(r,n),du(r,n),du(r,n,"shape"),du(r,n,"style"),du(r,n,"extra"),r.clipPath=n.clipPath):t[e]=i:a==="replace"?t[e]=i:a==="remove"&&n&&(t[e]=null)}var xb=["transition","enterFrom","leaveTo"],Q4=xb.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function du(t,e,r){if(r&&(!t[r]&&e[r]&&(t[r]={}),t=t[r],e=e[r]),!(!t||!e))for(var i=r?xb:Q4,n=0;n<i.length;n++){var a=i[n];t[a]==null&&e[a]!=null&&(t[a]=e[a])}}function J4(t,e){if(t&&(t.hv=e.hv=[c1(e,["left","right"]),c1(e,["top","bottom"])],t.type==="group")){var r=t,i=e;r.width==null&&(r.width=i.width=0),r.height==null&&(r.height=i.height=0)}}var tk=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.preventAutoZ=!0,r}return e.prototype.mergeOption=function(r,i){var n=this.option.elements;this.option.elements=null,t.prototype.mergeOption.call(this,r,i),this.option.elements=n},e.prototype.optionUpdated=function(r,i){var n=this.option,a=(i?n:r).elements,o=n.elements=i?[]:n.elements,s=[];this._flatten(a,s,null);var l=Jx(o,s,"normalMerge"),u=this._elOptionsToUpdate=[];M(l,function(f,h){var v=f.newOption;v&&(u.push(v),K4(f,v),j4(o,h,v),J4(o[h],v))},this),n.elements=ce(o,function(f){return f&&delete f.$action,f!=null})},e.prototype._flatten=function(r,i,n){M(r,function(a){if(a){n&&(a.parentOption=n),i.push(a);var o=a.children;o&&o.length&&this._flatten(o,i,a),delete a.children}},this)},e.prototype.useElOptionsToUpdate=function(){var r=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,r},e.type="graphic",e.defaultOption={elements:[]},e}(Vt),v1={path:null,compoundPath:null,group:ue,image:Nr,text:Jt},Sr=Kt(),ek=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(){this._elMap=ht()},e.prototype.render=function(r,i,n){r!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=r,this._updateElements(r),this._relocate(r,n)},e.prototype._updateElements=function(r){var i=r.useElOptionsToUpdate();if(i){var n=this._elMap,a=this.group,o=r.get("z"),s=r.get("zlevel");M(i,function(l){var u=Ge(l.id,null),f=u!=null?n.get(u):null,h=Ge(l.parentId,null),v=h!=null?n.get(h):a,c=l.type,d=l.style;c==="text"&&d&&l.hv&&l.hv[1]&&(d.textVerticalAlign=d.textBaseline=d.verticalAlign=d.align=null);var p=l.textContent,g=l.textConfig;if(d&&g3(d,c,!!g,!!p)){var m=m3(d,c,!0);!g&&m.textConfig&&(g=l.textConfig=m.textConfig),!p&&m.textContent&&(p=m.textContent)}var _=rk(l),y=l.$action||"merge",x=y==="merge",S=y==="replace";if(x){var T=!f,b=f;T?b=d1(u,v,l.type,n):(b&&(Sr(b).isNew=!1),D3(b)),b&&($c(b,_,r,{isInit:T}),p1(b,l,o,s))}else if(S){Uu(f,l,n,r);var w=d1(u,v,l.type,n);w&&($c(w,_,r,{isInit:!0}),p1(w,l,o,s))}else y==="remove"&&(y2(f,l),Uu(f,l,n,r));var A=n.get(u);if(A&&p)if(x){var C=A.getTextContent();C?C.attr(p):A.setTextContent(new Jt(p))}else S&&A.setTextContent(new Jt(p));if(A){var E=l.clipPath;if(E){var D=E.type,L=void 0,T=!1;if(x){var R=A.getClipPath();T=!R||Sr(R).type!==D,L=T?qd(D):R}else S&&(T=!0,L=qd(D));A.setClipPath(L),$c(L,E,r,{isInit:T}),Nd(L,E.keyframeAnimation,r)}var N=Sr(A);A.setTextConfig(g),N.option=l,ik(A,r,l),Jf({el:A,componentModel:r,itemName:A.name,itemTooltipOption:l.tooltip}),Nd(A,l.keyframeAnimation,r)}})}},e.prototype._relocate=function(r,i){for(var n=r.option.elements,a=this.group,o=this._elMap,s=i.getWidth(),l=i.getHeight(),u=["x","y"],f=0;f<n.length;f++){var h=n[f],v=Ge(h.id,null),c=v!=null?o.get(v):null;if(!(!c||!c.isGroup)){var d=c.parent,p=d===a,g=Sr(c),m=Sr(d);g.width=ve(g.option.width,p?s:m.width)||0,g.height=ve(g.option.height,p?l:m.height)||0}}for(var f=n.length-1;f>=0;f--){var h=n[f],v=Ge(h.id,null),c=v!=null?o.get(v):null;if(c){var d=c.parent,m=Sr(d),_=d===a?{width:s,height:l}:{width:m.width,height:m.height},y={},x=dS(c,h,_,null,{hv:h.hv,boundingMode:h.bounding},y);if(!Sr(c).isNew&&x){for(var S=h.transition,T={},b=0;b<u.length;b++){var w=u[b],A=y[w];S&&(na(S)||Dt(S,w)>=0)?T[w]=A:c[w]=A}Ir(c,T,r,0)}else c.attr(y)}}},e.prototype._clear=function(){var r=this,i=this._elMap;i.each(function(n){Uu(n,Sr(n).option,i,r._lastGraphicModel)}),this._elMap=ht()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(vr);function qd(t){var e=_t(v1,t)?v1[t]:XT(t),r=new e({});return Sr(r).type=t,r}function d1(t,e,r,i){var n=qd(r);return e.add(n),i.set(t,n),Sr(n).id=t,Sr(n).isNew=!0,n}function Uu(t,e,r,i){var n=t&&t.parent;n&&(t.type==="group"&&t.traverse(function(a){Uu(a,e,r,i)}),_3(t,e,i),r.removeKey(Sr(t).id))}function p1(t,e,r,i){t.isGroup||M([["cursor",ca.prototype.cursor],["zlevel",i||0],["z",r||0],["z2",0]],function(n){var a=n[0];_t(e,a)?t[a]=mt(e[a],n[1]):t[a]==null&&(t[a]=n[1])}),M(yt(e),function(n){if(n.indexOf("on")===0){var a=e[n];t[n]=ct(a)?a:null}}),_t(e,"draggable")&&(t.draggable=e.draggable),e.name!=null&&(t.name=e.name),e.id!=null&&(t.id=e.id)}function rk(t){return t=U({},t),M(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(vS),function(e){delete t[e]}),t}function ik(t,e,r){var i=kt(t).eventData;!t.silent&&!t.ignore&&!i&&(i=kt(t).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:t.name}),i&&(i.info=r.info)}function nk(t){t.registerComponentModel(tk),t.registerComponentView(ek),t.registerPreprocessor(function(e){var r=e.graphic;X(r)?!r[0]||!r[0].elements?e.graphic=[{elements:r}]:e.graphic=[e.graphic[0]]:r&&!r.elements&&(e.graphic=[{elements:[r]}])})}var g1=["x","y","radius","angle","single"],ak=["cartesian2d","polar","singleAxis"];function ok(t){var e=t.get("coordinateSystem");return Dt(ak,e)>=0}function Ji(t){return t+"Axis"}function sk(t,e){var r=ht(),i=[],n=ht();t.eachComponent({mainType:"dataZoom",query:e},function(f){n.get(f.uid)||s(f)});var a;do a=!1,t.eachComponent("dataZoom",o);while(a);function o(f){!n.get(f.uid)&&l(f)&&(s(f),a=!0)}function s(f){n.set(f.uid,!0),i.push(f),u(f)}function l(f){var h=!1;return f.eachTargetAxis(function(v,c){var d=r.get(v);d&&d[c]&&(h=!0)}),h}function u(f){f.eachTargetAxis(function(h,v){(r.get(h)||r.set(h,[]))[v]=!0})}return i}function Tb(t){var e=t.ecModel,r={infoList:[],infoMap:ht()};return t.eachTargetAxis(function(i,n){var a=e.getComponent(Ji(i),n);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=r.infoMap.get(s);l||(l={model:o,axisModels:[]},r.infoList.push(l),r.infoMap.set(s,l)),l.axisModels.push(a)}}}),r}var xv=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},t}(),lk=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._autoThrottle=!0,r._noTarget=!0,r._rangePropMode=["percent","percent"],r}return e.prototype.init=function(r,i,n){var a=m1(r);this.settledOption=a,this.mergeDefaultAndTheme(r,n),this._doInit(a)},e.prototype.mergeOption=function(r){var i=m1(r);dt(this.option,r,!0),dt(this.settledOption,i,!0),this._doInit(i)},e.prototype._doInit=function(r){var i=this.option;this._setDefaultThrottle(r),this._updateRangeUse(r);var n=this.settledOption;M([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(i[a[0]]=n[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var r=this.get("orient",!0),i=this._targetAxisInfoMap=ht(),n=this._fillSpecifiedTargetAxis(i);n?this._orient=r||this._makeAutoOrientByTargetAxis():(this._orient=r||"horizontal",this._fillAutoTargetAxisByOrient(i,this._orient)),this._noTarget=!0,i.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(r){var i=!1;return M(g1,function(n){var a=this.getReferringComponents(Ji(n),pC);if(a.specified){i=!0;var o=new xv;M(a.models,function(s){o.add(s.componentIndex)}),r.set(n,o)}},this),i},e.prototype._fillAutoTargetAxisByOrient=function(r,i){var n=this.ecModel,a=!0;if(a){var o=i==="vertical"?"y":"x",s=n.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=n.findComponents({mainType:"singleAxis",filter:function(f){return f.get("orient",!0)===i}});l(s,"single")}function l(u,f){var h=u[0];if(h){var v=new xv;if(v.add(h.componentIndex),r.set(f,v),a=!1,f==="x"||f==="y"){var c=h.getReferringComponents("grid",Je).models[0];c&&M(u,function(d){h.componentIndex!==d.componentIndex&&c===d.getReferringComponents("grid",Je).models[0]&&v.add(d.componentIndex)})}}}a&&M(g1,function(u){if(a){var f=n.findComponents({mainType:Ji(u),filter:function(v){return v.get("type",!0)==="category"}});if(f[0]){var h=new xv;h.add(f[0].componentIndex),r.set(u,h),a=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var r;return this.eachTargetAxis(function(i){!r&&(r=i)},this),r==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(r){if(r.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var i=this.ecModel.option;this.option.throttle=i.animation&&i.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(r){var i=this._rangePropMode,n=this.get("rangeMode");M([["start","startValue"],["end","endValue"]],function(a,o){var s=r[a[0]]!=null,l=r[a[1]]!=null;s&&!l?i[o]="percent":!s&&l?i[o]="value":n?i[o]=n[o]:s&&(i[o]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var r;return this.eachTargetAxis(function(i,n){r==null&&(r=this.ecModel.getComponent(Ji(i),n))},this),r},e.prototype.eachTargetAxis=function(r,i){this._targetAxisInfoMap.each(function(n,a){M(n.indexList,function(o){r.call(i,a,o)})})},e.prototype.getAxisProxy=function(r,i){var n=this.getAxisModel(r,i);if(n)return n.__dzAxisProxy},e.prototype.getAxisModel=function(r,i){var n=this._targetAxisInfoMap.get(r);if(n&&n.indexMap[i])return this.ecModel.getComponent(Ji(r),i)},e.prototype.setRawRange=function(r){var i=this.option,n=this.settledOption;M([["start","startValue"],["end","endValue"]],function(a){(r[a[0]]!=null||r[a[1]]!=null)&&(i[a[0]]=n[a[0]]=r[a[0]],i[a[1]]=n[a[1]]=r[a[1]])},this),this._updateRangeUse(r)},e.prototype.setCalculatedRange=function(r){var i=this.option;M(["start","startValue","end","endValue"],function(n){i[n]=r[n]})},e.prototype.getPercentRange=function(){var r=this.findRepresentativeAxisProxy();if(r)return r.getDataPercentWindow()},e.prototype.getValueRange=function(r,i){if(r==null&&i==null){var n=this.findRepresentativeAxisProxy();if(n)return n.getDataValueWindow()}else return this.getAxisProxy(r,i).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(r){if(r)return r.__dzAxisProxy;for(var i,n=this._targetAxisInfoMap.keys(),a=0;a<n.length;a++)for(var o=n[a],s=this._targetAxisInfoMap.get(o),l=0;l<s.indexList.length;l++){var u=this.getAxisProxy(o,s.indexList[l]);if(u.hostedBy(this))return u;i||(i=u)}return i},e.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},e.prototype.getOrient=function(){return this._orient},e.type="dataZoom",e.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],e.defaultOption={z:4,filterMode:"filter",start:0,end:100},e}(Vt);function m1(t){var e={};return M(["start","end","startValue","endValue","throttle"],function(r){t.hasOwnProperty(r)&&(e[r]=t[r])}),e}const Nf=lk;var uk=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,i,n,a){this.dataZoomModel=r,this.ecModel=i,this.api=n},e.type="dataZoom",e}(vr);const Sb=uk;var Xa=M,_1=Yn,fk=function(){function t(e,r,i,n){this._dimName=e,this._axisIndex=r,this.ecModel=n,this._dataZoomModel=i}return t.prototype.hostedBy=function(e){return this._dataZoomModel===e},t.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},t.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},t.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries(function(r){if(ok(r)){var i=Ji(this._dimName),n=r.getReferringComponents(i,Je).models[0];n&&this._axisIndex===n.componentIndex&&e.push(r)}},this),e},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return ft(this._minMaxSpan)},t.prototype.calculateDataWindow=function(e){var r=this._dataExtent,i=this.getAxisModel(),n=i.axis.scale,a=this._dataZoomModel.getRangePropMode(),o=[0,100],s=[],l=[],u;Xa(["start","end"],function(v,c){var d=e[v],p=e[v+"Value"];a[c]==="percent"?(d==null&&(d=o[c]),p=n.parse(ae(d,o,r))):(u=!0,p=p==null?r[c]:n.parse(p),d=ae(p,r,o)),l[c]=p==null||isNaN(p)?r[c]:p,s[c]=d==null||isNaN(d)?o[c]:d}),_1(l),_1(s);var f=this._minMaxSpan;u?h(l,s,r,o,!1):h(s,l,o,r,!0);function h(v,c,d,p,g){var m=g?"Span":"ValueSpan";ul(0,v,d,"all",f["min"+m],f["max"+m]);for(var _=0;_<2;_++)c[_]=ae(v[_],d,p,!0),g&&(c[_]=n.parse(c[_]))}return{valueWindow:l,percentWindow:s}},t.prototype.reset=function(e){if(e===this._dataZoomModel){var r=this.getTargetSeriesModels();this._dataExtent=hk(this,this._dimName,r),this._updateMinMaxSpan();var i=this.calculateDataWindow(e.settledOption);this._valueWindow=i.valueWindow,this._percentWindow=i.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(e,r){if(e!==this._dataZoomModel)return;var i=this._dimName,n=this.getTargetSeriesModels(),a=e.get("filterMode"),o=this._valueWindow;if(a==="none")return;Xa(n,function(l){var u=l.getData(),f=u.mapDimensionsAll(i);if(f.length){if(a==="weakFilter"){var h=u.getStore(),v=K(f,function(c){return u.getDimensionIndex(c)},u);u.filterSelf(function(c){for(var d,p,g,m=0;m<f.length;m++){var _=h.get(v[m],c),y=!isNaN(_),x=_<o[0],S=_>o[1];if(y&&!x&&!S)return!0;y&&(g=!0),x&&(d=!0),S&&(p=!0)}return g&&d&&p})}else Xa(f,function(c){if(a==="empty")l.setData(u=u.map(c,function(p){return s(p)?p:NaN}));else{var d={};d[c]=o,u.selectRange(d)}});Xa(f,function(c){u.setApproximateExtent(o,c)})}});function s(l){return l>=o[0]&&l<=o[1]}},t.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},r=this._dataZoomModel,i=this._dataExtent;Xa(["min","max"],function(n){var a=r.get(n+"Span"),o=r.get(n+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=ae(i[0]+o,i,[0,100],!0):a!=null&&(o=ae(a,[0,100],i,!0)-i[0]),e[n+"Span"]=a,e[n+"ValueSpan"]=o},this)},t.prototype._setAxisModel=function(){var e=this.getAxisModel(),r=this._percentWindow,i=this._valueWindow;if(r){var n=$x(i,[0,500]);n=Math.min(n,20);var a=e.axis.scale.rawExtentInfo;r[0]!==0&&a.setDeterminedMinMax("min",+i[0].toFixed(n)),r[1]!==100&&a.setDeterminedMinMax("max",+i[1].toFixed(n)),a.freeze()}},t}();function hk(t,e,r){var i=[1/0,-1/0];Xa(r,function(o){eN(i,o.getData(),e)});var n=t.getAxisModel(),a=Vw(n.axis.scale,n,i).calculate();return[a.min,a.max]}const ck=fk;var vk={getTargetSeries:function(t){function e(n){t.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=t.getComponent(Ji(o),s);n(o,s,l,a)})})}e(function(n,a,o,s){o.__dzAxisProxy=null});var r=[];e(function(n,a,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new ck(n,a,s,t),r.push(o.__dzAxisProxy))});var i=ht();return M(r,function(n){M(n.getTargetSeriesModels(),function(a){i.set(a.uid,a)})}),i},overallReset:function(t,e){t.eachComponent("dataZoom",function(r){r.eachTargetAxis(function(i,n){r.getAxisProxy(i,n).reset(r)}),r.eachTargetAxis(function(i,n){r.getAxisProxy(i,n).filterData(r,e)})}),t.eachComponent("dataZoom",function(r){var i=r.findRepresentativeAxisProxy();if(i){var n=i.getDataPercentWindow(),a=i.getDataValueWindow();r.setCalculatedRange({start:n[0],end:n[1],startValue:a[0],endValue:a[1]})}})}};const dk=vk;function pk(t){t.registerAction("dataZoom",function(e,r){var i=sk(r,e);M(i,function(n){n.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var y1=!1;function wb(t){y1||(y1=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,dk),pk(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function gk(t,e){var r=al(e.get("padding")),i=e.getItemStyle(["color","opacity"]);return i.fill=e.get("backgroundColor"),t=new ie({shape:{x:t.x-r[3],y:t.y-r[0],width:t.width+r[1]+r[3],height:t.height+r[0]+r[2],r:e.get("borderRadius")},style:i,silent:!0,z2:-1}),t}var mk=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(Vt);const _k=mk;function bb(t){var e=t.get("confine");return e!=null?!!e:t.get("renderMode")==="richText"}function Ab(t){if(At.domSupported){for(var e=document.documentElement.style,r=0,i=t.length;r<i;r++)if(t[r]in e)return t[r]}}var Eb=Ab(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),yk=Ab(["webkitTransition","transition","OTransition","MozTransition","msTransition"]);function Cb(t,e){if(!t)return e;e=fS(e,!0);var r=t.indexOf(e);return t=r===-1?e:"-"+t.slice(0,r)+"-"+e,t.toLowerCase()}function xk(t,e){var r=t.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(t);return r?e?r[e]:r:null}var Tk=Cb(yk,"transition"),Og=Cb(Eb,"transform"),Sk="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(At.transform3dSupported?"will-change:transform;":"");function wk(t){return t=t==="left"?"right":t==="right"?"left":t==="top"?"bottom":"top",t}function bk(t,e,r){if(!Z(r)||r==="inside")return"";var i=t.get("backgroundColor"),n=t.get("borderWidth");e=ua(e);var a=wk(r),o=Math.max(Math.round(n)*1.5,6),s="",l=Og+":",u;Dt(["left","right"],a)>-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var f=u*Math.PI/180,h=o+n,v=h*Math.abs(Math.cos(f))+h*Math.abs(Math.sin(f)),c=Math.round(((v-Math.SQRT2*n)/2+Math.SQRT2*n-(v-h)/2)*100)/100;s+=";"+a+":-"+c+"px";var d=e+" solid "+n+"px;",p=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+d,"border-right:"+d,"background-color:"+i+";"];return'<div style="'+p.join("")+'"></div>'}function Ak(t,e){var r="cubic-bezier(0.23,1,0.32,1)",i=" "+t/2+"s "+r,n="opacity"+i+",visibility"+i;return e||(i=" "+t+"s "+r,n+=At.transformSupported?","+Og+i:",left"+i+",top"+i),Tk+":"+n}function x1(t,e,r){var i=t.toFixed(0)+"px",n=e.toFixed(0)+"px";if(!At.transformSupported)return r?"top:"+n+";left:"+i+";":[["top",n],["left",i]];var a=At.transform3dSupported,o="translate"+(a?"3d":"")+"("+i+","+n+(a?",0":"")+")";return r?"top:0;left:0;"+Og+":"+o+";":[["top",0],["left",0],[Eb,o]]}function Ek(t){var e=[],r=t.get("fontSize"),i=t.getTextColor();i&&e.push("color:"+i),e.push("font:"+t.getFont()),r&&e.push("line-height:"+Math.round(r*3/2)+"px");var n=t.get("textShadowColor"),a=t.get("textShadowBlur")||0,o=t.get("textShadowOffsetX")||0,s=t.get("textShadowOffsetY")||0;return n&&a&&e.push("text-shadow:"+o+"px "+s+"px "+a+"px "+n),M(["decoration","align"],function(l){var u=t.get(l);u&&e.push("text-"+l+":"+u)}),e.join(";")}function Ck(t,e,r){var i=[],n=t.get("transitionDuration"),a=t.get("backgroundColor"),o=t.get("shadowBlur"),s=t.get("shadowColor"),l=t.get("shadowOffsetX"),u=t.get("shadowOffsetY"),f=t.getModel("textStyle"),h=VS(t,"html"),v=l+"px "+u+"px "+o+"px "+s;return i.push("box-shadow:"+v),e&&n&&i.push(Ak(n,r)),a&&i.push("background-color:"+a),M(["width","color","radius"],function(c){var d="border-"+c,p=fS(d),g=t.get(p);g!=null&&i.push(d+":"+g+(c==="color"?"":"px"))}),i.push(Ek(f)),h!=null&&i.push("padding:"+al(h).join("px ")+"px"),i.join(";")+";"}function T1(t,e,r,i,n){var a=e&&e.painter;if(r){var o=a&&a.getViewportRoot();o&&PA(t,o,document.body,i,n)}else{t[0]=i,t[1]=n;var s=a&&a.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var Mk=function(){function t(e,r,i){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,At.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var a=this._zr=r.getZr(),o=this._appendToBody=i&&i.appendToBody;T1(this._styleCoord,a,o,r.getWidth()/2,r.getHeight()/2),o?document.body.appendChild(n):e.appendChild(n),this._container=e;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=a.handler,f=a.painter.getViewportRoot();yr(f,l,!0),u.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return t.prototype.update=function(e){var r=this._container,i=xk(r,"position"),n=r.style;n.position!=="absolute"&&i!=="absolute"&&(n.position="relative");var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=e.get("className")||""},t.prototype.show=function(e,r){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var i=this.el,n=i.style,a=this._styleCoord;i.innerHTML?n.cssText=Sk+Ck(e,!this._firstShow,this._longHide)+x1(a[0],a[1],!0)+("border-color:"+ua(r)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):n.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(e,r,i,n,a){var o=this.el;if(e==null){o.innerHTML="";return}var s="";if(Z(a)&&i.get("trigger")==="item"&&!bb(i)&&(s=bk(i,n,a)),Z(e))o.innerHTML=e+s;else if(e){o.innerHTML="",X(e)||(e=[e]);for(var l=0;l<e.length;l++)Vu(e[l])&&e[l].parentNode!==o&&o.appendChild(e[l]);if(s&&o.childNodes.length){var u=document.createElement("div");u.innerHTML=s,o.appendChild(u)}}},t.prototype.setEnterable=function(e){this._enterable=e},t.prototype.getSize=function(){var e=this.el;return[e.offsetWidth,e.offsetHeight]},t.prototype.moveTo=function(e,r){var i=this._styleCoord;if(T1(i,this._zr,this._appendToBody,e,r),i[0]!=null&&i[1]!=null){var n=this.el.style,a=x1(i[0],i[1]);M(a,function(o){n[o[0]]=o[1]})}},t.prototype._moveIfResized=function(){var e=this._styleCoord[2],r=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),r*this._zr.getHeight())},t.prototype.hide=function(){var e=this,r=this.el.style;r.visibility="hidden",r.opacity="0",At.transform3dSupported&&(r.willChange=""),this._show=!1,this._longHideTimeout=setTimeout(function(){return e._longHide=!0},500)},t.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(et(this.hide,this),e)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this.el.parentNode.removeChild(this.el)},t}();const Dk=Mk;var Lk=function(){function t(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),w1(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return t.prototype.update=function(e){var r=e.get("alwaysShowContent");r&&this._moveIfResized(),this._alwaysShowContent=r},t.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},t.prototype.setContent=function(e,r,i,n,a){var o=this;j(e)&&je(""),this.el&&this._zr.remove(this.el);var s=i.getModel("textStyle");this.el=new Jt({style:{rich:r.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:n,textShadowColor:s.get("textShadowColor"),fill:i.get(["textStyle","color"]),padding:VS(i,"richText"),verticalAlign:"top",align:"left"},z:i.get("z")}),M(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(u){o.el.style[u]=i.get(u)}),M(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],function(u){o.el.style[u]=s.get(u)||0}),this._zr.add(this.el);var l=this;this.el.on("mouseover",function(){l._enterable&&(clearTimeout(l._hideTimeout),l._show=!0),l._inContent=!0}),this.el.on("mouseout",function(){l._enterable&&l._show&&l.hideLater(l._hideDelay),l._inContent=!1})},t.prototype.setEnterable=function(e){this._enterable=e},t.prototype.getSize=function(){var e=this.el,r=this.el.getBoundingRect(),i=S1(e.style);return[r.width+i.left+i.right,r.height+i.top+i.bottom]},t.prototype.moveTo=function(e,r){var i=this.el;if(i){var n=this._styleCoord;w1(n,this._zr,e,r),e=n[0],r=n[1];var a=i.style,o=$i(a.borderWidth||0),s=S1(a);i.x=e+o+s.left,i.y=r+o+s.top,i.markRedraw()}},t.prototype._moveIfResized=function(){var e=this._styleCoord[2],r=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),r*this._zr.getHeight())},t.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},t.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(et(this.hide,this),e)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this._zr.remove(this.el)},t}();function $i(t){return Math.max(0,t)}function S1(t){var e=$i(t.shadowBlur||0),r=$i(t.shadowOffsetX||0),i=$i(t.shadowOffsetY||0);return{left:$i(e-r),right:$i(e+r),top:$i(e-i),bottom:$i(e+i)}}function w1(t,e,r,i){t[0]=r,t[1]=i,t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}const Rk=Lk;var Pk=new ie({shape:{x:-1,y:-1,width:2,height:2}}),Ik=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,i){if(!(At.node||!i.getDom())){var n=r.getComponent("tooltip"),a=this._renderMode=mC(n.get("renderMode"));this._tooltipContent=a==="richText"?new Rk(i):new Dk(i.getDom(),i,{appendToBody:n.get("appendToBody",!0)})}},e.prototype.render=function(r,i,n){if(!(At.node||!n.getDom())){this.group.removeAll(),this._tooltipModel=r,this._ecModel=i,this._api=n;var a=this._tooltipContent;a.update(r),a.setEnterable(r.get("enterable")),this._initGlobalListener(),this._keepShow(),this._renderMode!=="richText"&&r.get("transitionDuration")?ch(this,"_updatePosition",50,"fixRate"):pf(this,"_updatePosition")}},e.prototype._initGlobalListener=function(){var r=this._tooltipModel,i=r.get("triggerOn");mb("itemTooltip",this._api,et(function(n,a,o){i!=="none"&&(i.indexOf(n)>=0?this._tryShow(a,o):n==="leave"&&this._hide(o))},this))},e.prototype._keepShow=function(){var r=this._tooltipModel,i=this._ecModel,n=this._api,a=r.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&o.manuallyShowTip(r,i,n,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(r,i,n,a){if(!(a.from===this.uid||At.node||!n.getDom())){var o=b1(a,n);this._ticket="";var s=a.dataByCoordSys,l=Fk(a,i,n);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var f=Pk;f.x=a.x,f.y=a.y,f.update(),kt(f).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:f},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(r,i,n,a))return;var h=_b(a,i),v=h.point[0],c=h.point[1];v!=null&&c!=null&&this._tryShow({offsetX:v,offsetY:c,target:h.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(n.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:n.getZr().findHover(a.x,a.y).target},o))}},e.prototype.manuallyHideTip=function(r,i,n,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(b1(a,n))},e.prototype._manuallyAxisShowTip=function(r,i,n,a){var o=a.seriesIndex,s=a.dataIndex,l=i.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=i.getSeriesByIndex(o);if(u){var f=u.getData(),h=rs([f.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(h.get("trigger")==="axis")return n.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},e.prototype._tryShow=function(r,i){var n=r.target,a=this._tooltipModel;if(a){this._lastX=r.offsetX,this._lastY=r.offsetY;var o=r.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,r);else if(n){this._lastDataByCoordSys=null;var s,l;ja(n,function(u){if(kt(u).dataIndex!=null)return s=u,!0;if(kt(u).tooltipConfig!=null)return l=u,!0},!0),s?this._showSeriesItemTooltip(r,s,i):l?this._showComponentItemTooltip(r,l,i):this._hide(i)}else this._lastDataByCoordSys=null,this._hide(i)}},e.prototype._showOrMove=function(r,i){var n=r.get("showDelay");i=et(i,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(i,n):i()},e.prototype._showAxisTooltip=function(r,i){var n=this._ecModel,a=this._tooltipModel,o=[i.offsetX,i.offsetY],s=rs([i.tooltipOption],a),l=this._renderMode,u=[],f=Hs("section",{blocks:[],noHeader:!0}),h=[],v=new Sc;M(r,function(_){M(_.dataByAxis,function(y){var x=n.getComponent(y.axisDim+"Axis",y.axisIndex),S=y.value;if(!(!x||S==null)){var T=pb(S,x.axis,n,y.seriesDataIndices,y.valueLabelOpt),b=Hs("section",{header:T,noHeader:!li(T),sortBlocks:!0,blocks:[]});f.blocks.push(b),M(y.seriesDataIndices,function(w){var A=n.getSeriesByIndex(w.seriesIndex),C=w.dataIndexInside,E=A.getDataParams(C);if(!(E.dataIndex<0)){E.axisDim=y.axisDim,E.axisIndex=y.axisIndex,E.axisType=y.axisType,E.axisId=y.axisId,E.axisValue=lg(x.axis,{value:S}),E.axisValueLabel=T,E.marker=v.makeTooltipMarker("item",ua(E.color),l);var D=N_(A.formatTooltip(C,!0,null)),L=D.frag;if(L){var R=rs([A],a).get("valueFormatter");b.blocks.push(R?U({valueFormatter:R},L):L)}D.text&&h.push(D.text),u.push(E)}})}})}),f.blocks.reverse(),h.reverse();var c=i.position,d=s.get("order"),p=U_(f,v,l,d,n.get("useUTC"),s.get("textStyle"));p&&h.unshift(p);var g=l==="richText"?`

`:"<br/>",m=h.join(g);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,u)?this._updatePosition(s,c,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,m,u,Math.random()+"",o[0],o[1],c,null,v)})},e.prototype._showSeriesItemTooltip=function(r,i,n){var a=this._ecModel,o=kt(i),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,f=o.dataIndex,h=o.dataType,v=u.getData(h),c=this._renderMode,d=r.positionDefault,p=rs([v.getItemModel(f),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),g=p.get("trigger");if(!(g!=null&&g!=="item")){var m=u.getDataParams(f,h),_=new Sc;m.marker=_.makeTooltipMarker("item",ua(m.color),c);var y=N_(u.formatTooltip(f,!1,h)),x=p.get("order"),S=p.get("valueFormatter"),T=y.frag,b=T?U_(S?U({valueFormatter:S},T):T,_,c,x,a.get("useUTC"),p.get("textStyle")):y.text,w="item_"+u.name+"_"+f;this._showOrMove(p,function(){this._showTooltipContent(p,b,m,w,r.offsetX,r.offsetY,r.position,r.target,_)}),n({type:"showTip",dataIndexInside:f,dataIndex:v.getRawIndex(f),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(r,i,n){var a=kt(i),o=a.tooltipConfig,s=o.option||{};if(Z(s)){var l=s;s={content:l,formatter:l}}var u=[s],f=this._ecModel.getComponent(a.componentMainType,a.componentIndex);f&&u.push(f),u.push({formatter:s.content});var h=r.positionDefault,v=rs(u,this._tooltipModel,h?{position:h}:null),c=v.get("content"),d=Math.random()+"",p=new Sc;this._showOrMove(v,function(){var g=ft(v.get("formatterParams")||{});this._showTooltipContent(v,c,g,d,r.offsetX,r.offsetY,r.position,i,p)}),n({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(r,i,n,a,o,s,l,u,f){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var h=this._tooltipContent;h.setEnterable(r.get("enterable"));var v=r.get("formatter");l=l||r.get("position");var c=i,d=this._getNearestPoint([o,s],n,r.get("trigger"),r.get("borderColor")),p=d.color;if(v)if(Z(v)){var g=r.ecModel.get("useUTC"),m=X(n)?n[0]:n,_=m&&m.axisType&&m.axisType.indexOf("time")>=0;c=v,_&&(c=ih(m.axisValue,c,g)),c=hS(c,n,!0)}else if(ct(v)){var y=et(function(x,S){x===this._ticket&&(h.setContent(S,f,r,p,l),this._updatePosition(r,l,o,s,h,n,u))},this);this._ticket=a,c=v(n,a,y)}else c=v;h.setContent(c,f,r,p,l),h.show(r,p),this._updatePosition(r,l,o,s,h,n,u)}},e.prototype._getNearestPoint=function(r,i,n,a){if(n==="axis"||X(i))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!X(i))return{color:a||i.color||i.borderColor}},e.prototype._updatePosition=function(r,i,n,a,o,s,l){var u=this._api.getWidth(),f=this._api.getHeight();i=i||r.get("position");var h=o.getSize(),v=r.get("align"),c=r.get("verticalAlign"),d=l&&l.getBoundingRect().clone();if(l&&d.applyTransform(l.transform),ct(i)&&(i=i([n,a],s,o.el,d,{viewSize:[u,f],contentSize:h.slice()})),X(i))n=ve(i[0],u),a=ve(i[1],f);else if(j(i)){var p=i;p.width=h[0],p.height=h[1];var g=on(p,{width:u,height:f});n=g.x,a=g.y,v=null,c=null}else if(Z(i)&&l){var m=Bk(i,d,h,r.get("borderWidth"));n=m[0],a=m[1]}else{var m=Nk(n,a,o,u,f,v?null:20,c?null:20);n=m[0],a=m[1]}if(v&&(n-=A1(v)?h[0]/2:v==="right"?h[0]:0),c&&(a-=A1(c)?h[1]/2:c==="bottom"?h[1]:0),bb(r)){var m=Ok(n,a,o,u,f);n=m[0],a=m[1]}o.moveTo(n,a)},e.prototype._updateContentNotChangedOnAxis=function(r,i){var n=this._lastDataByCoordSys,a=this._cbParamsList,o=!!n&&n.length===r.length;return o&&M(n,function(s,l){var u=s.dataByAxis||[],f=r[l]||{},h=f.dataByAxis||[];o=o&&u.length===h.length,o&&M(u,function(v,c){var d=h[c]||{},p=v.seriesDataIndices||[],g=d.seriesDataIndices||[];o=o&&v.value===d.value&&v.axisType===d.axisType&&v.axisId===d.axisId&&p.length===g.length,o&&M(p,function(m,_){var y=g[_];o=o&&m.seriesIndex===y.seriesIndex&&m.dataIndex===y.dataIndex}),a&&M(v.seriesDataIndices,function(m){var _=m.seriesIndex,y=i[_],x=a[_];y&&x&&x.data!==y.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=i,!!o},e.prototype._hide=function(r){this._lastDataByCoordSys=null,r({type:"hideTip",from:this.uid})},e.prototype.dispose=function(r,i){At.node||!i.getDom()||(pf(this,"_updatePosition"),this._tooltipContent.dispose(),Zd("itemTooltip",i))},e.type="tooltip",e}(vr);function rs(t,e,r){var i=e.ecModel,n;r?(n=new Te(r,i,i),n=new Te(e.option,n,i)):n=e;for(var a=t.length-1;a>=0;a--){var o=t[a];o&&(o instanceof Te&&(o=o.get("tooltip",!0)),Z(o)&&(o={formatter:o}),o&&(n=new Te(o,n,i)))}return n}function b1(t,e){return t.dispatchAction||et(e.dispatchAction,e)}function Nk(t,e,r,i,n,a,o){var s=r.getSize(),l=s[0],u=s[1];return a!=null&&(t+l+a+2>i?t-=l+a:t+=a),o!=null&&(e+u+o>n?e-=u+o:e+=o),[t,e]}function Ok(t,e,r,i,n){var a=r.getSize(),o=a[0],s=a[1];return t=Math.min(t+o,i)-o,e=Math.min(e+s,n)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function Bk(t,e,r,i){var n=r[0],a=r[1],o=Math.ceil(Math.SQRT2*i)+8,s=0,l=0,u=e.width,f=e.height;switch(t){case"inside":s=e.x+u/2-n/2,l=e.y+f/2-a/2;break;case"top":s=e.x+u/2-n/2,l=e.y-a-o;break;case"bottom":s=e.x+u/2-n/2,l=e.y+f+o;break;case"left":s=e.x-n-o,l=e.y+f/2-a/2;break;case"right":s=e.x+u+o,l=e.y+f/2-a/2}return[s,l]}function A1(t){return t==="center"||t==="middle"}function Fk(t,e,r){var i=yp(t).queryOptionMap,n=i.keys()[0];if(!(!n||n==="series")){var a=il(e,n,i.get(n),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var f=kt(u).tooltipConfig;if(f&&f.name===t.name)return l=u,!0}),l)return{componentMainType:n,componentIndex:o.componentIndex,el:l}}}}const kk=Ik;function zk(t){nr(yb),t.registerComponentModel(_k),t.registerComponentView(kk),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},De),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},De)}var E1=M;function C1(t){if(t){for(var e in t)if(t.hasOwnProperty(e))return!0}}function M1(t,e,r){var i={};return E1(e,function(a){var o=i[a]=n();E1(t[a],function(s,l){if(er.isValidType(l)){var u={type:l,visual:s};r&&r(u,a),o[l]=new er(u),l==="opacity"&&(u=ft(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new er(u))}})}),i;function n(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function Uk(t,e,r){var i;M(r,function(n){e.hasOwnProperty(n)&&C1(e[n])&&(i=!0)}),i&&M(r,function(n){e.hasOwnProperty(n)&&C1(e[n])?t[n]=ft(e[n]):delete t[n]})}function Hk(t,e,r,i){var n={};return M(t,function(a){var o=er.prepareVisualTypes(e[a]);n[a]=o}),{progress:function(o,s){var l;i!=null&&(l=s.getDimensionIndex(i));function u(S){return QS(s,h,S)}function f(S,T){XR(s,h,S,T)}for(var h,v=s.getStore();(h=o.next())!=null;){var c=s.getRawDataItem(h);if(!(c&&c.visualMap===!1))for(var d=i!=null?v.get(l,h):h,p=r(d),g=e[p],m=n[p],_=0,y=m.length;_<y;_++){var x=m[_];g[x]&&g[x].applyVisual(d,u,f)}}}}}var Vk=function(t,e){if(e==="all")return{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])};if(e==="inverse")return{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}},Gk=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.layoutMode={type:"box",ignoreSize:!0},r}return e.prototype.init=function(r,i,n){this.mergeDefaultAndTheme(r,n),r.selected=r.selected||{},this._updateSelector(r)},e.prototype.mergeOption=function(r,i){t.prototype.mergeOption.call(this,r,i),this._updateSelector(r)},e.prototype._updateSelector=function(r){var i=r.selector,n=this.ecModel;i===!0&&(i=r.selector=["all","inverse"]),X(i)&&M(i,function(a,o){Z(a)&&(a={type:a}),i[o]=dt(a,Vk(n,a.type))})},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var r=this._data;if(r[0]&&this.get("selectedMode")==="single"){for(var i=!1,n=0;n<r.length;n++){var a=r[n].get("name");if(this.isSelected(a)){this.select(a),i=!0;break}}!i&&this.select(r[0].get("name"))}},e.prototype._updateData=function(r){var i=[],n=[];r.eachRawSeries(function(l){var u=l.name;n.push(u);var f;if(l.legendVisualProvider){var h=l.legendVisualProvider,v=h.getAllNames();r.isSeriesFiltered(l)||(n=n.concat(v)),v.length?i=i.concat(v):f=!0}else f=!0;f&&_p(l)&&i.push(l.name)}),this._availableNames=n;var a=this.get("data")||i,o=ht(),s=K(a,function(l){return(Z(l)||Qt(l))&&(l={name:l}),o.get(l.name)?null:(o.set(l.name,!0),new Te(l,this,this.ecModel))},this);this._data=ce(s,function(l){return!!l})},e.prototype.getData=function(){return this._data},e.prototype.select=function(r){var i=this.option.selected,n=this.get("selectedMode");if(n==="single"){var a=this._data;M(a,function(o){i[o.get("name")]=!1})}i[r]=!0},e.prototype.unSelect=function(r){this.get("selectedMode")!=="single"&&(this.option.selected[r]=!1)},e.prototype.toggleSelected=function(r){var i=this.option.selected;i.hasOwnProperty(r)||(i[r]=!0),this[i[r]?"unSelect":"select"](r)},e.prototype.allSelect=function(){var r=this._data,i=this.option.selected;M(r,function(n){i[n.get("name",!0)]=!0})},e.prototype.inverseSelect=function(){var r=this._data,i=this.option.selected;M(r,function(n){var a=n.get("name",!0);i.hasOwnProperty(a)||(i[a]=!0),i[a]=!i[a]})},e.prototype.isSelected=function(r){var i=this.option.selected;return!(i.hasOwnProperty(r)&&!i[r])&&Dt(this._availableNames,r)>=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(Vt);const Kd=Gk;var Ha=de,jd=M,pu=ue,Wk=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.newlineDisabled=!1,r}return e.prototype.init=function(){this.group.add(this._contentGroup=new pu),this.group.add(this._selectorGroup=new pu),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(r,i,n){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),u=r.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,r,i,n,l,s,u);var f=r.getBoxLayoutParams(),h={width:n.getWidth(),height:n.getHeight()},v=r.get("padding"),c=on(f,h,v),d=this.layoutInner(r,o,c,a,l,u),p=on(Lt({width:d.width,height:d.height},f),h,v);this.group.x=p.x-d.x,this.group.y=p.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=gk(d,r))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(r,i,n,a,o,s,l){var u=this.getContentGroup(),f=ht(),h=i.get("selectedMode"),v=[];n.eachRawSeries(function(c){!c.get("legendHoverLink")&&v.push(c.id)}),jd(i.getData(),function(c,d){var p=c.get("name");if(!this.newlineDisabled&&(p===""||p===`
`)){var g=new pu;g.newline=!0,u.add(g);return}var m=n.getSeriesByName(p)[0];if(!f.get(p))if(m){var _=m.getData(),y=_.getVisual("legendLineStyle")||{},x=_.getVisual("legendIcon"),S=_.getVisual("style"),T=this._createItem(m,p,d,c,i,r,y,S,x,h,a);T.on("click",Ha(D1,p,null,a,v)).on("mouseover",Ha(Qd,m.name,null,a,v)).on("mouseout",Ha(Jd,m.name,null,a,v)),f.set(p,!0)}else n.eachRawSeries(function(b){if(!f.get(p)&&b.legendVisualProvider){var w=b.legendVisualProvider;if(!w.containName(p))return;var A=w.indexOfName(p),C=w.getItemVisual(A,"style"),E=w.getItemVisual(A,"legendIcon"),D=Xe(C.fill);D&&D[3]===0&&(D[3]=.2,C=U(U({},C),{fill:bi(D,"rgba")}));var L=this._createItem(b,p,d,c,i,r,{},C,E,h,a);L.on("click",Ha(D1,null,p,a,v)).on("mouseover",Ha(Qd,null,p,a,v)).on("mouseout",Ha(Jd,null,p,a,v)),f.set(p,!0)}},this)},this),o&&this._createSelector(o,i,a,s,l)},e.prototype._createSelector=function(r,i,n,a,o){var s=this.getSelectorGroup();jd(r,function(u){var f=u.type,h=new Jt({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:f==="all"?"legendAllSelect":"legendInverseSelect"})}});s.add(h);var v=i.getModel("selectorLabel"),c=i.getModel(["emphasis","selectorLabel"]);Fp(h,{normal:v,emphasis:c},{defaultText:u.title}),sf(h)})},e.prototype._createItem=function(r,i,n,a,o,s,l,u,f,h,v){var c=r.visualDrawType,d=o.get("itemWidth"),p=o.get("itemHeight"),g=o.isSelected(i),m=a.get("symbolRotate"),_=a.get("symbolKeepAspect"),y=a.get("icon");f=y||f||"roundRect";var x=Xk(f,a,l,u,c,g,v),S=new pu,T=a.getModel("textStyle");if(ct(r.getLegendIcon)&&(!y||y==="inherit"))S.add(r.getLegendIcon({itemWidth:d,itemHeight:p,icon:f,iconRotate:m,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:_}));else{var b=y==="inherit"&&r.getData().getVisual("symbol")?m==="inherit"?r.getData().getVisual("symbolRotate"):m:0;S.add(Yk({itemWidth:d,itemHeight:p,icon:f,iconRotate:b,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:_}))}var w=s==="left"?d+5:-5,A=s,C=o.get("formatter"),E=i;Z(C)&&C?E=C.replace("{name}",i??""):ct(C)&&(E=C(i));var D=g?T.getTextColor():a.get("inactiveColor");S.add(new Jt({style:tr(T,{text:E,x:w,y:p/2,fill:D,align:A,verticalAlign:"middle"},{inheritColor:D})}));var L=new ie({shape:S.getBoundingRect(),invisible:!0}),R=a.getModel("tooltip");return R.get("show")&&Jf({el:L,componentModel:o,itemName:i,itemTooltipOption:R.option}),S.add(L),S.eachChild(function(N){N.silent=!0}),L.silent=!h,this.getContentGroup().add(S),sf(S),S.__legendDataIndex=n,S},e.prototype.layoutInner=function(r,i,n,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();lo(r.get("orient"),l,r.get("itemGap"),n.width,n.height);var f=l.getBoundingRect(),h=[-f.x,-f.y];if(u.markRedraw(),l.markRedraw(),o){lo("horizontal",u,r.get("selectorItemGap",!0));var v=u.getBoundingRect(),c=[-v.x,-v.y],d=r.get("selectorButtonGap",!0),p=r.getOrient().index,g=p===0?"width":"height",m=p===0?"height":"width",_=p===0?"y":"x";s==="end"?c[p]+=f[g]+d:h[p]+=v[g]+d,c[1-p]+=f[m]/2-v[m]/2,u.x=c[0],u.y=c[1],l.x=h[0],l.y=h[1];var y={x:0,y:0};return y[g]=f[g]+d+v[g],y[m]=Math.max(f[m],v[m]),y[_]=Math.min(0,v[_]+c[1-p]),y}else return l.x=h[0],l.y=h[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(vr);function Xk(t,e,r,i,n,a,o){function s(g,m){g.lineWidth==="auto"&&(g.lineWidth=m.lineWidth>0?2:0),jd(g,function(_,y){g[y]==="inherit"&&(g[y]=m[y])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),f=t.lastIndexOf("empty",0)===0?"fill":"stroke",h=l.getShallow("decal");u.decal=!h||h==="inherit"?i.decal:md(h,o),u.fill==="inherit"&&(u.fill=i[n]),u.stroke==="inherit"&&(u.stroke=i[f]),u.opacity==="inherit"&&(u.opacity=(n==="fill"?i:r).opacity),s(u,i);var v=e.getModel("lineStyle"),c=v.getLineStyle();if(s(c,r),u.fill==="auto"&&(u.fill=i.fill),u.stroke==="auto"&&(u.stroke=i.fill),c.stroke==="auto"&&(c.stroke=i.fill),!a){var d=e.get("inactiveBorderWidth"),p=u[f];u.lineWidth=d==="auto"?i.lineWidth>0&&p?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),c.stroke=v.get("inactiveColor"),c.lineWidth=v.get("inactiveWidth")}return{itemStyle:u,lineStyle:c}}function Yk(t){var e=t.icon||"roundRect",r=$r(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);return r.setStyle(t.itemStyle),r.rotation=(t.iconRotate||0)*Math.PI/180,r.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(r.style.stroke=r.style.fill,r.style.fill="#fff",r.style.lineWidth=2),r}function D1(t,e,r,i){Jd(t,e,r,i),r.dispatchAction({type:"legendToggleSelect",name:t??e}),Qd(t,e,r,i)}function Mb(t){for(var e=t.getZr().storage.getDisplayList(),r,i=0,n=e.length;i<n&&!(r=e[i].states.emphasis);)i++;return r&&r.hoverLayer}function Qd(t,e,r,i){Mb(r)||r.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:i})}function Jd(t,e,r,i){Mb(r)||r.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:i})}const Db=Wk;function $k(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(r){for(var i=0;i<e.length;i++)if(!e[i].isSelected(r.name))return!1;return!0})}function is(t,e,r){var i={},n=t==="toggleSelected",a;return r.eachComponent("legend",function(o){n&&a!=null?o[a?"select":"unSelect"](e.name):t==="allSelect"||t==="inverseSelect"?o[t]():(o[t](e.name),a=o.isSelected(e.name));var s=o.getData();M(s,function(l){var u=l.get("name");if(!(u===`
`||u==="")){var f=o.isSelected(u);i.hasOwnProperty(u)?i[u]=i[u]&&f:i[u]=f}})}),t==="allSelect"||t==="inverseSelect"?{selected:i}:{name:e.name,selected:i}}function Zk(t){t.registerAction("legendToggleSelect","legendselectchanged",de(is,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",de(is,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",de(is,"inverseSelect")),t.registerAction("legendSelect","legendselected",de(is,"select")),t.registerAction("legendUnSelect","legendunselected",de(is,"unSelect"))}function Lb(t){t.registerComponentModel(Kd),t.registerComponentView(Db),t.registerProcessor(t.PRIORITY.PROCESSOR.SERIES_FILTER,$k),t.registerSubTypeDefaulter("legend",function(){return"plain"}),Zk(t)}var qk=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.setScrollDataIndex=function(r){this.option.scrollDataIndex=r},e.prototype.init=function(r,i,n){var a=ol(r);t.prototype.init.call(this,r,i,n),L1(this,r,a)},e.prototype.mergeOption=function(r,i){t.prototype.mergeOption.call(this,r,i),L1(this,this.option,r)},e.type="legend.scroll",e.defaultOption=nl(Kd.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),e}(Kd);function L1(t,e,r){var i=t.getOrient(),n=[1,1];n[i.index]=0,fa(e,r,{type:"box",ignoreSize:!!n})}const Kk=qk;var R1=ue,Tv=["width","height"],Sv=["x","y"],jk=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.newlineDisabled=!0,r._currentIndex=0,r}return e.prototype.init=function(){t.prototype.init.call(this),this.group.add(this._containerGroup=new R1),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new R1)},e.prototype.resetInner=function(){t.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},e.prototype.renderInner=function(r,i,n,a,o,s,l){var u=this;t.prototype.renderInner.call(this,r,i,n,a,o,s,l);var f=this._controllerGroup,h=i.get("pageIconSize",!0),v=X(h)?h:[h,h];d("pagePrev",0);var c=i.getModel("pageTextStyle");f.add(new Jt({name:"pageText",style:{text:"xx/xx",fill:c.getTextColor(),font:c.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),d("pageNext",1);function d(p,g){var m=p+"DataIndex",_=Op(i.get("pageIcons",!0)[i.getOrient().name][g],{onclick:et(u._pageGo,u,m,i,a)},{x:-v[0]/2,y:-v[1]/2,width:v[0],height:v[1]});_.name=p,f.add(_)}},e.prototype.layoutInner=function(r,i,n,a,o,s){var l=this.getSelectorGroup(),u=r.getOrient().index,f=Tv[u],h=Sv[u],v=Tv[1-u],c=Sv[1-u];o&&lo("horizontal",l,r.get("selectorItemGap",!0));var d=r.get("selectorButtonGap",!0),p=l.getBoundingRect(),g=[-p.x,-p.y],m=ft(n);o&&(m[f]=n[f]-p[f]-d);var _=this._layoutContentAndController(r,a,m,u,f,v,c,h);if(o){if(s==="end")g[u]+=_[f]+d;else{var y=p[f]+d;g[u]-=y,_[h]-=y}_[f]+=p[f]+d,g[1-u]+=_[c]+_[v]/2-p[v]/2,_[v]=Math.max(_[v],p[v]),_[c]=Math.min(_[c],p[c]+g[1-u]),l.x=g[0],l.y=g[1],l.markRedraw()}return _},e.prototype._layoutContentAndController=function(r,i,n,a,o,s,l,u){var f=this.getContentGroup(),h=this._containerGroup,v=this._controllerGroup;lo(r.get("orient"),f,r.get("itemGap"),a?n.width:null,a?null:n.height),lo("horizontal",v,r.get("pageButtonItemGap",!0));var c=f.getBoundingRect(),d=v.getBoundingRect(),p=this._showController=c[o]>n[o],g=[-c.x,-c.y];i||(g[a]=f[u]);var m=[0,0],_=[-d.x,-d.y],y=mt(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(p){var x=r.get("pageButtonPosition",!0);x==="end"?_[a]+=n[o]-d[o]:m[a]+=d[o]+y}_[1-a]+=c[s]/2-d[s]/2,f.setPosition(g),h.setPosition(m),v.setPosition(_);var S={x:0,y:0};if(S[o]=p?n[o]:c[o],S[s]=Math.max(c[s],d[s]),S[l]=Math.min(0,d[l]+_[1-a]),h.__rectSize=n[o],p){var T={x:0,y:0};T[o]=Math.max(n[o]-d[o]-y,0),T[s]=S[s],h.setClipPath(new ie({shape:T})),h.__rectSize=T[o]}else v.eachChild(function(w){w.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(r);return b.pageIndex!=null&&Ir(f,{x:b.contentPosition[0],y:b.contentPosition[1]},p?r:null),this._updatePageInfoView(r,b),S},e.prototype._pageGo=function(r,i,n){var a=this._getPageInfo(i)[r];a!=null&&n.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:i.id})},e.prototype._updatePageInfoView=function(r,i){var n=this._controllerGroup;M(["pagePrev","pageNext"],function(f){var h=f+"DataIndex",v=i[h]!=null,c=n.childOfName(f);c&&(c.setStyle("fill",v?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),c.cursor=v?"pointer":"default")});var a=n.childOfName("pageText"),o=r.get("pageFormatter"),s=i.pageIndex,l=s!=null?s+1:0,u=i.pageCount;a&&o&&a.setStyle("text",Z(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},e.prototype._getPageInfo=function(r){var i=r.get("scrollDataIndex",!0),n=this.getContentGroup(),a=this._containerGroup.__rectSize,o=r.getOrient().index,s=Tv[o],l=Sv[o],u=this._findTargetItemIndex(i),f=n.children(),h=f[u],v=f.length,c=v?1:0,d={contentPosition:[n.x,n.y],pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!h)return d;var p=x(h);d.contentPosition[o]=-p.s;for(var g=u+1,m=p,_=p,y=null;g<=v;++g)y=x(f[g]),(!y&&_.e>m.s+a||y&&!S(y,m.s))&&(_.i>m.i?m=_:m=y,m&&(d.pageNextDataIndex==null&&(d.pageNextDataIndex=m.i),++d.pageCount)),_=y;for(var g=u-1,m=p,_=p,y=null;g>=-1;--g)y=x(f[g]),(!y||!S(_,y.s))&&m.i<_.i&&(_=m,d.pagePrevDataIndex==null&&(d.pagePrevDataIndex=m.i),++d.pageCount,++d.pageIndex),m=y;return d;function x(T){if(T){var b=T.getBoundingRect(),w=b[l]+T[l];return{s:w,e:w+b[s],i:T.__legendDataIndex}}}function S(T,b){return T.e>=b&&T.s<=b+a}},e.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var i,n=this.getContentGroup(),a;return n.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===r&&(i=s)}),i??a},e.type="legend.scroll",e}(Db);const Qk=jk;function Jk(t){t.registerAction("legendScroll","legendscroll",function(e,r){var i=e.scrollDataIndex;i!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:e},function(n){n.setScrollDataIndex(i)})})}function tz(t){nr(Lb),t.registerComponentModel(Kk),t.registerComponentView(Qk),Jk(t)}function ez(t){nr(Lb),nr(tz)}var rz=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="dataZoom.inside",e.defaultOption=nl(Nf.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(Nf);const iz=rz;var Bg=Kt();function nz(t,e,r){Bg(t).coordSysRecordMap.each(function(i){var n=i.dataZoomInfoMap.get(e.uid);n&&(n.getRange=r)})}function az(t,e){for(var r=Bg(t).coordSysRecordMap,i=r.keys(),n=0;n<i.length;n++){var a=i[n],o=r.get(a),s=o.dataZoomInfoMap;if(s){var l=e.uid,u=s.get(l);u&&(s.removeKey(l),s.keys().length||Rb(r,o))}}}function Rb(t,e){if(e){t.removeKey(e.model.uid);var r=e.controller;r&&r.dispose()}}function oz(t,e){var r={model:e,containsPoint:de(lz,e),dispatchAction:de(sz,t),dataZoomInfoMap:null,controller:null},i=r.controller=new h3(t.getZr());return M(["pan","zoom","scrollMove"],function(n){i.on(n,function(a){var o=[];r.dataZoomInfoMap.each(function(s){if(a.isAvailableBehavior(s.model.option)){var l=(s.getRange||{})[n],u=l&&l(s.dzReferCoordSysInfo,r.model.mainType,r.controller,a);!s.model.get("disabled",!0)&&u&&o.push({dataZoomId:s.model.id,start:u[0],end:u[1]})}}),o.length&&r.dispatchAction(o)})}),r}function sz(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function lz(t,e,r,i){return t.coordinateSystem.containPoint([r,i])}function uz(t){var e,r="type_",i={type_true:2,type_move:1,type_false:0,type_undefined:-1},n=!0;return t.each(function(a){var o=a.model,s=o.get("disabled",!0)?!1:o.get("zoomLock",!0)?"move":!0;i[r+s]>i[r+e]&&(e=s),n=n&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!n}}}function fz(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,function(e,r){var i=Bg(r),n=i.coordSysRecordMap||(i.coordSysRecordMap=ht());n.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=Tb(a);M(o.infoList,function(s){var l=s.model.uid,u=n.get(l)||n.set(l,oz(r,s.model)),f=u.dataZoomInfoMap||(u.dataZoomInfoMap=ht());f.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),n.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){Rb(n,a);return}var f=uz(l);o.enable(f.controlType,f.opt),o.setPointerChecker(a.containsPoint),ch(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var hz=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataZoom.inside",r}return e.prototype.render=function(r,i,n){if(t.prototype.render.apply(this,arguments),r.noTarget()){this._clear();return}this.range=r.getPercentRange(),nz(n,r,{pan:et(wv.pan,this),zoom:et(wv.zoom,this),scrollMove:et(wv.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){az(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(Sb),wv={zoom:function(t,e,r,i){var n=this.range,a=n.slice(),o=t.axisModels[0];if(o){var s=bv[e](null,[i.originX,i.originY],o,r,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/i.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var f=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(ul(0,a,[0,100],0,f.minSpan,f.maxSpan),this.range=a,n[0]!==a[0]||n[1]!==a[1])return a}},pan:P1(function(t,e,r,i,n,a){var o=bv[i]([a.oldX,a.oldY],[a.newX,a.newY],e,n,r);return o.signal*(t[1]-t[0])*o.pixel/o.pixelLength}),scrollMove:P1(function(t,e,r,i,n,a){var o=bv[i]([0,0],[a.scrollDelta,a.scrollDelta],e,n,r);return o.signal*(t[1]-t[0])*a.scrollDelta})};function P1(t){return function(e,r,i,n){var a=this.range,o=a.slice(),s=e.axisModels[0];if(s){var l=t(o,s,e,r,i,n);if(ul(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var bv={grid:function(t,e,r,i,n){var a=r.axis,o={},s=n.model.coordinateSystem.getRect();return t=t||[0,0],a.dim==="x"?(o.pixel=e[0]-t[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(t,e,r,i,n){var a=r.axis,o={},s=n.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),r.mainType==="radiusAxis"?(o.pixel=e[0]-t[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(t,e,r,i,n){var a=r.axis,o=n.model.coordinateSystem.getRect(),s={};return t=t||[0,0],a.orient==="horizontal"?(s.pixel=e[0]-t[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};const cz=hz;function vz(t){wb(t),t.registerComponentModel(iz),t.registerComponentView(cz),fz(t)}var dz=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=nl(Nf.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(Nf);const pz=dz;var ns=ie,I1=7,gz=1,Av=30,mz=7,as="horizontal",N1="vertical",_z=5,yz=["line","bar","candlestick","scatter"],xz={easing:"cubicOut",duration:100,delay:0},Tz=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._displayables={},r}return e.prototype.init=function(r,i){this.api=i,this._onBrush=et(this._onBrush,this),this._onBrushEnd=et(this._onBrushEnd,this)},e.prototype.render=function(r,i,n,a){if(t.prototype.render.apply(this,arguments),ch(this,"_dispatchZoomAction",r.get("throttle"),"fixRate"),this._orient=r.getOrient(),r.get("show")===!1){this.group.removeAll();return}if(r.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){pf(this,"_dispatchZoomAction");var r=this.api.getZr();r.off("mousemove",this._onBrush),r.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var r=this.group;r.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var i=this._displayables.sliderGroup=new ue;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),r.add(i),this._positionGroup()},e.prototype._resetLocation=function(){var r=this.dataZoomModel,i=this.api,n=r.get("brushSelect"),a=n?mz:0,o=this._findCoordRect(),s={width:i.getWidth(),height:i.getHeight()},l=this._orient===as?{right:s.width-o.x-o.width,top:s.height-Av-I1-a,width:o.width,height:Av}:{right:I1,top:o.y,width:Av,height:o.height},u=ol(r.option);M(["right","top","width","height"],function(h){u[h]==="ph"&&(u[h]=l[h])});var f=on(u,s);this._location={x:f.x,y:f.y},this._size=[f.width,f.height],this._orient===N1&&this._size.reverse()},e.prototype._positionGroup=function(){var r=this.group,i=this._location,n=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(n===as&&!o?{scaleY:l?1:-1,scaleX:1}:n===as&&o?{scaleY:l?1:-1,scaleX:-1}:n===N1&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=r.getBoundingRect([s]);r.x=i.x-u.x,r.y=i.y-u.y,r.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var r=this.dataZoomModel,i=this._size,n=this._displayables.sliderGroup,a=r.get("brushSelect");n.add(new ns({silent:!0,shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:r.get("backgroundColor")},z2:-40}));var o=new ns({shape:{x:0,y:0,width:i[0],height:i[1]},style:{fill:"transparent"},z2:0,onclick:et(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),n.add(o)},e.prototype._renderDataShadow=function(){var r=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!r)return;var i=this._size,n=this._shadowSize||[],a=r.series,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():r.otherDim;if(l==null)return;var u=this._shadowPolygonPts,f=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||i[0]!==n[0]||i[1]!==n[1]){var h=o.getDataExtent(l),v=(h[1]-h[0])*.3;h=[h[0]-v,h[1]+v];var c=[0,i[1]],d=[0,i[0]],p=[[i[0],0],[0,0]],g=[],m=d[1]/(o.count()-1),_=0,y=Math.round(o.count()/i[0]),x;o.each([l],function(A,C){if(y>0&&C%y){_+=m;return}var E=A==null||isNaN(A)||A==="",D=E?0:ae(A,h,c,!0);E&&!x&&C?(p.push([p[p.length-1][0],0]),g.push([g[g.length-1][0],0])):!E&&x&&(p.push([_,0]),g.push([_,0])),p.push([_,D]),g.push([_,D]),_+=m,x=E}),u=this._shadowPolygonPts=p,f=this._shadowPolylinePts=g}this._shadowData=o,this._shadowDim=l,this._shadowSize=[i[0],i[1]];var S=this.dataZoomModel;function T(A){var C=S.getModel(A?"selectedDataBackground":"dataBackground"),E=new ue,D=new jf({shape:{points:u},segmentIgnoreThreshold:1,style:C.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),L=new Qf({shape:{points:f},segmentIgnoreThreshold:1,style:C.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return E.add(D),E.add(L),E}for(var b=0;b<3;b++){var w=T(b===1);this._displayables.sliderGroup.add(w),this._displayables.dataShadowSegs.push(w)}},e.prototype._prepareDataShadowInfo=function(){var r=this.dataZoomModel,i=r.get("showDataShadow");if(i!==!1){var n,a=this.ecModel;return r.eachTargetAxis(function(o,s){var l=r.getAxisProxy(o,s).getTargetSeriesModels();M(l,function(u){if(!n&&!(i!==!0&&Dt(yz,u.get("type"))<0)){var f=a.getComponent(Ji(o),s).axis,h=Sz(o),v,c=u.coordinateSystem;h!=null&&c.getOtherAxis&&(v=c.getOtherAxis(f).inverse),h=u.getData().mapDimension(h),n={thisAxis:f,series:u,thisDim:o,otherDim:h,otherAxisInverse:v}}},this)},this),n}},e.prototype._renderHandle=function(){var r=this.group,i=this._displayables,n=i.handles=[null,null],a=i.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,f=l.get("borderRadius")||0,h=l.get("brushSelect"),v=i.filler=new ns({silent:h,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(v),o.add(new ns({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:f},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:gz,fill:"rgba(0,0,0,0)"}})),M([0,1],function(y){var x=l.get("handleIcon");!mf[x]&&x.indexOf("path://")<0&&x.indexOf("image://")<0&&(x="path://"+x);var S=$r(x,-1,0,2,2,null,!0);S.attr({cursor:O1(this._orient),draggable:!0,drift:et(this._onDragMove,this,y),ondragend:et(this._onDragEnd,this),onmouseover:et(this._showDataInfo,this,!0),onmouseout:et(this._showDataInfo,this,!1),z2:5});var T=S.getBoundingRect(),b=l.get("handleSize");this._handleHeight=ve(b,this._size[1]),this._handleWidth=T.width/T.height*this._handleHeight,S.setStyle(l.getModel("handleStyle").getItemStyle()),S.style.strokeNoScale=!0,S.rectHover=!0,S.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),sf(S);var w=l.get("handleColor");w!=null&&(S.style.fill=w),o.add(n[y]=S);var A=l.getModel("textStyle");r.add(a[y]=new Jt({silent:!0,invisible:!0,style:tr(A,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:A.getTextColor(),font:A.getFont()}),z2:10}))},this);var c=v;if(h){var d=ve(l.get("moveHandleSize"),s[1]),p=i.moveHandle=new ie({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:d}}),g=d*.8,m=i.moveHandleIcon=$r(l.get("moveHandleIcon"),-g/2,-g/2,g,g,"#fff",!0);m.silent=!0,m.y=s[1]+d/2-.5,p.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var _=Math.min(s[1]/2,Math.max(d,10));c=i.moveZone=new ie({invisible:!0,shape:{y:s[1]-_,height:d+_}}),c.on("mouseover",function(){u.enterEmphasis(p)}).on("mouseout",function(){u.leaveEmphasis(p)}),o.add(p),o.add(m),o.add(c)}c.attr({draggable:!0,cursor:O1(this._orient),drift:et(this._onDragMove,this,"all"),ondragstart:et(this._showDataInfo,this,!0),ondragend:et(this._onDragEnd,this),onmouseover:et(this._showDataInfo,this,!0),onmouseout:et(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var r=this._range=this.dataZoomModel.getPercentRange(),i=this._getViewExtent();this._handleEnds=[ae(r[0],[0,100],i,!0),ae(r[1],[0,100],i,!0)]},e.prototype._updateInterval=function(r,i){var n=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=n.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];ul(i,a,o,n.get("zoomLock")?"all":r,s.minSpan!=null?ae(s.minSpan,l,o,!0):null,s.maxSpan!=null?ae(s.maxSpan,l,o,!0):null);var u=this._range,f=this._range=Yn([ae(a[0],o,l,!0),ae(a[1],o,l,!0)]);return!u||u[0]!==f[0]||u[1]!==f[1]},e.prototype._updateView=function(r){var i=this._displayables,n=this._handleEnds,a=Yn(n.slice()),o=this._size;M([0,1],function(c){var d=i.handles[c],p=this._handleHeight;d.attr({scaleX:p/2,scaleY:p/2,x:n[c]+(c?-1:1),y:o[1]/2-p/2})},this),i.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};i.moveHandle&&(i.moveHandle.setShape(s),i.moveZone.setShape(s),i.moveZone.getBoundingRect(),i.moveHandleIcon&&i.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=i.dataShadowSegs,u=[0,a[0],a[1],o[0]],f=0;f<l.length;f++){var h=l[f],v=h.getClipPath();v||(v=new ie,h.setClipPath(v)),v.setShape({x:u[f],y:0,width:u[f+1]-u[f],height:o[1]})}this._updateDataInfo(r)},e.prototype._updateDataInfo=function(r){var i=this.dataZoomModel,n=this._displayables,a=n.handleLabels,o=this._orient,s=["",""];if(i.get("showDetail")){var l=i.findRepresentativeAxisProxy();if(l){var u=l.getAxisModel().axis,f=this._range,h=r?l.calculateDataWindow({start:f[0],end:f[1]}).valueWindow:l.getDataValueWindow();s=[this._formatLabel(h[0],u),this._formatLabel(h[1],u)]}}var v=Yn(this._handleEnds.slice());c.call(this,0),c.call(this,1);function c(d){var p=ws(n.handles[d].parent,this.group),g=Np(d===0?"right":"left",p),m=this._handleWidth/2+_z,_=en([v[d]+(d===0?-m:m),this._size[1]/2],p);a[d].setStyle({x:_[0],y:_[1],verticalAlign:o===as?"middle":g,align:o===as?g:"center",text:s[d]})}},e.prototype._formatLabel=function(r,i){var n=this.dataZoomModel,a=n.get("labelFormatter"),o=n.get("labelPrecision");(o==null||o==="auto")&&(o=i.getPixelPrecision());var s=r==null||isNaN(r)?"":i.type==="category"||i.type==="time"?i.scale.getLabel({value:Math.round(r)}):r.toFixed(Math.min(o,20));return ct(a)?a(r,s):Z(a)?a.replace("{value}",s):s},e.prototype._showDataInfo=function(r){r=this._dragging||r;var i=this._displayables,n=i.handleLabels;n[0].attr("invisible",!r),n[1].attr("invisible",!r),i.moveHandle&&this.api[r?"enterEmphasis":"leaveEmphasis"](i.moveHandle,1)},e.prototype._onDragMove=function(r,i,n,a){this._dragging=!0,Ei(a.event);var o=this._displayables.sliderGroup.getLocalTransform(),s=en([i,n],o,!0),l=this._updateInterval(r,s[0]),u=this.dataZoomModel.get("realtime");this._updateView(!u),l&&u&&this._dispatchZoomAction(!0)},e.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1);var r=this.dataZoomModel.get("realtime");!r&&this._dispatchZoomAction(!1)},e.prototype._onClickPanel=function(r){var i=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(r.offsetX,r.offsetY);if(!(n[0]<0||n[0]>i[0]||n[1]<0||n[1]>i[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",n[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(r){var i=r.offsetX,n=r.offsetY;this._brushStart=new wt(i,n),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(r){if(this._brushing){var i=this._displayables.brushRect;if(this._brushing=!1,!!i){i.attr("ignore",!0);var n=i.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(n.width)<5)){var o=this._getViewExtent(),s=[0,100];this._range=Yn([ae(n.x,o,s,!0),ae(n.x+n.width,o,s,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(r){this._brushing&&(Ei(r.event),this._updateBrushRect(r.offsetX,r.offsetY))},e.prototype._updateBrushRect=function(r,i){var n=this._displayables,a=this.dataZoomModel,o=n.brushRect;o||(o=n.brushRect=new ns({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(r,i),f=l.transformCoordToLocal(s.x,s.y),h=this._size;u[0]=Math.max(Math.min(h[0],u[0]),0),o.setShape({x:f[0],y:0,width:u[0]-f[0],height:h[1]})},e.prototype._dispatchZoomAction=function(r){var i=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:r?xz:null,start:i[0],end:i[1]})},e.prototype._findCoordRect=function(){var r,i=Tb(this.dataZoomModel).infoList;if(!r&&i.length){var n=i[0].model.coordinateSystem;r=n.getRect&&n.getRect()}if(!r){var a=this.api.getWidth(),o=this.api.getHeight();r={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return r},e.type="dataZoom.slider",e}(Sb);function Sz(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}function O1(t){return t==="vertical"?"ns-resize":"ew-resize"}const wz=Tz;function bz(t){t.registerComponentModel(pz),t.registerComponentView(wz),wb(t)}function Az(t){nr(vz),nr(bz)}var Ez={get:function(t,e,r){var i=ft((Cz[t]||{})[e]);return r&&X(i)?i[i.length-1]:i}},Cz={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}};const Pb=Ez;var B1=er.mapVisual,Mz=er.eachVisual,Dz=X,F1=M,Lz=Yn,Rz=ae,Pz=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.stateList=["inRange","outOfRange"],r.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],r.layoutMode={type:"box",ignoreSize:!0},r.dataBound=[-1/0,1/0],r.targetVisuals={},r.controllerVisuals={},r}return e.prototype.init=function(r,i,n){this.mergeDefaultAndTheme(r,n)},e.prototype.optionUpdated=function(r,i){var n=this.option;!i&&Uk(n,r,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(r){var i=this.stateList;r=et(r,this),this.controllerVisuals=M1(this.option.controller,i,r),this.targetVisuals=M1(this.option.target,i,r)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var r=this.option.seriesIndex,i=[];return r==null||r==="all"?this.ecModel.eachSeries(function(n,a){i.push(a)}):i=ge(r),i},e.prototype.eachTargetSeries=function(r,i){M(this.getTargetSeriesIndices(),function(n){var a=this.ecModel.getSeriesByIndex(n);a&&r.call(i,a)},this)},e.prototype.isTargetSeries=function(r){var i=!1;return this.eachTargetSeries(function(n){n===r&&(i=!0)}),i},e.prototype.formatValueText=function(r,i,n){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;n=n||["<",">"],X(r)&&(r=r.slice(),u=!0);var f=i?r:u?[h(r[0]),h(r[1])]:h(r);if(Z(l))return l.replace("{value}",u?f[0]:f).replace("{value2}",u?f[1]:f);if(ct(l))return u?l(r[0],r[1]):l(r);if(u)return r[0]===s[0]?n[0]+" "+f[1]:r[1]===s[1]?n[1]+" "+f[0]:f[0]+" - "+f[1];return f;function h(v){return v===s[0]?"min":v===s[1]?"max":(+v).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var r=this.option,i=Lz([r.min,r.max]);this._dataExtent=i},e.prototype.getDataDimensionIndex=function(r){var i=this.option.dimension;if(i!=null)return r.getDimensionIndex(i);for(var n=r.dimensions,a=n.length-1;a>=0;a--){var o=n[a],s=r.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var r=this.ecModel,i=this.option,n={inRange:i.inRange,outOfRange:i.outOfRange},a=i.target||(i.target={}),o=i.controller||(i.controller={});dt(a,n),dt(o,n);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),f.call(this,o);function l(h){Dz(i.color)&&!h.inRange&&(h.inRange={color:i.color.slice().reverse()}),h.inRange=h.inRange||{color:r.get("gradientColor")}}function u(h,v,c){var d=h[v],p=h[c];d&&!p&&(p=h[c]={},F1(d,function(g,m){if(er.isValidType(m)){var _=Pb.get(m,"inactive",s);_!=null&&(p[m]=_,m==="color"&&!p.hasOwnProperty("opacity")&&!p.hasOwnProperty("colorAlpha")&&(p.opacity=[0,0]))}}))}function f(h){var v=(h.inRange||{}).symbol||(h.outOfRange||{}).symbol,c=(h.inRange||{}).symbolSize||(h.outOfRange||{}).symbolSize,d=this.get("inactiveColor"),p=this.getItemSymbol(),g=p||"roundRect";F1(this.stateList,function(m){var _=this.itemSize,y=h[m];y||(y=h[m]={color:s?d:[d]}),y.symbol==null&&(y.symbol=v&&ft(v)||(s?g:[g])),y.symbolSize==null&&(y.symbolSize=c&&ft(c)||(s?_[0]:[_[0],_[0]])),y.symbol=B1(y.symbol,function(T){return T==="none"?g:T});var x=y.symbolSize;if(x!=null){var S=-1/0;Mz(x,function(T){T>S&&(S=T)}),y.symbolSize=B1(x,function(T){return Rz(T,[0,S],[0,_[0]],!0)})}},this)}},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(r){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(r){return null},e.prototype.getVisualMeta=function(r){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(Vt);const Of=Pz;var k1=[20,140],Iz=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.optionUpdated=function(r,i){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(n){n.mappingMethod="linear",n.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){t.prototype.resetItemSize.apply(this,arguments);var r=this.itemSize;(r[0]==null||isNaN(r[0]))&&(r[0]=k1[0]),(r[1]==null||isNaN(r[1]))&&(r[1]=k1[1])},e.prototype._resetRange=function(){var r=this.getExtent(),i=this.option.range;!i||i.auto?(r.auto=1,this.option.range=r):X(i)&&(i[0]>i[1]&&i.reverse(),i[0]=Math.max(i[0],r[0]),i[1]=Math.min(i[1],r[1]))},e.prototype.completeVisualOption=function(){t.prototype.completeVisualOption.apply(this,arguments),M(this.stateList,function(r){var i=this.option.controller[r].symbolSize;i&&i[0]!==i[1]&&(i[0]=i[1]/3)},this)},e.prototype.setSelected=function(r){this.option.range=r.slice(),this._resetRange()},e.prototype.getSelected=function(){var r=this.getExtent(),i=Yn((this.get("range")||[]).slice());return i[0]>r[1]&&(i[0]=r[1]),i[1]>r[1]&&(i[1]=r[1]),i[0]<r[0]&&(i[0]=r[0]),i[1]<r[0]&&(i[1]=r[0]),i},e.prototype.getValueState=function(r){var i=this.option.range,n=this.getExtent();return(i[0]<=n[0]||i[0]<=r)&&(i[1]>=n[1]||r<=i[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(r){var i=[];return this.eachTargetSeries(function(n){var a=[],o=n.getData();o.each(this.getDataDimensionIndex(o),function(s,l){r[0]<=s&&s<=r[1]&&a.push(l)},this),i.push({seriesId:n.id,dataIndex:a})},this),i},e.prototype.getVisualMeta=function(r){var i=z1(this,"outOfRange",this.getExtent()),n=z1(this,"inRange",this.option.range.slice()),a=[];function o(c,d){a.push({value:c,color:r(c,d)})}for(var s=0,l=0,u=n.length,f=i.length;l<f&&(!n.length||i[l]<=n[0]);l++)i[l]<n[s]&&o(i[l],"outOfRange");for(var h=1;s<u;s++,h=0)h&&a.length&&o(n[s],"outOfRange"),o(n[s],"inRange");for(var h=1;l<f;l++)(!n.length||n[n.length-1]<i[l])&&(h&&(a.length&&o(a[a.length-1].value,"outOfRange"),h=0),o(i[l],"outOfRange"));var v=a.length;return{stops:a,outerColors:[v?a[0].color:"transparent",v?a[v-1].color:"transparent"]}},e.type="visualMap.continuous",e.defaultOption=nl(Of.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:"#fff",borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}}),e}(Of);function z1(t,e,r){if(r[0]===r[1])return r.slice();for(var i=200,n=(r[1]-r[0])/i,a=r[0],o=[],s=0;s<=i&&a<r[1];s++)o.push(a),a+=n;return o.push(r[1]),o}const Nz=Iz;var Oz=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.autoPositionValues={left:1,right:1,top:1,bottom:1},r}return e.prototype.init=function(r,i){this.ecModel=r,this.api=i},e.prototype.render=function(r,i,n,a){if(this.visualMapModel=r,r.get("show")===!1){this.group.removeAll();return}this.doRender(r,i,n,a)},e.prototype.renderBackground=function(r){var i=this.visualMapModel,n=al(i.get("padding")||0),a=r.getBoundingRect();r.add(new ie({z2:-1,silent:!0,shape:{x:a.x-n[3],y:a.y-n[0],width:a.width+n[3]+n[1],height:a.height+n[0]+n[2]},style:{fill:i.get("backgroundColor"),stroke:i.get("borderColor"),lineWidth:i.get("borderWidth")}}))},e.prototype.getControllerVisual=function(r,i,n){n=n||{};var a=n.forceState,o=this.visualMapModel,s={};if(i==="color"){var l=o.get("contentColor");s.color=l}function u(c){return s[c]}function f(c,d){s[c]=d}var h=o.controllerVisuals[a||o.getValueState(r)],v=er.prepareVisualTypes(h);return M(v,function(c){var d=h[c];n.convertOpacityToAlpha&&c==="opacity"&&(c="colorAlpha",d=h.__alphaForOpacity),er.dependsOn(c,i)&&d&&d.applyVisual(r,u,f)}),s[i]},e.prototype.positionGroup=function(r){var i=this.visualMapModel,n=this.api;dS(r,i.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()})},e.prototype.doRender=function(r,i,n,a){},e.type="visualMap",e}(vr);const Ib=Oz;var U1=[["left","right","width"],["top","bottom","height"]];function Nb(t,e,r){var i=t.option,n=i.align;if(n!=null&&n!=="auto")return n;for(var a={width:e.getWidth(),height:e.getHeight()},o=i.orient==="horizontal"?1:0,s=U1[o],l=[0,null,10],u={},f=0;f<3;f++)u[U1[1-o][f]]=l[f],u[s[f]]=f===2?r[0]:i[s[f]];var h=[["x","width",3],["y","height",0]][o],v=on(u,a,i.padding);return s[(v.margin[h[2]]||0)+v[h[0]]+v[h[1]]*.5<a[h[1]]*.5?0:1]}function Hu(t,e){return M(t||[],function(r){r.dataIndex!=null&&(r.dataIndexInside=r.dataIndex,r.dataIndex=null),r.highlightKey="visualMap"+(e?e.componentIndex:"")}),t}var ni=ae,Bz=M,H1=Math.min,Ev=Math.max,Fz=12,kz=6,zz=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._shapes={},r._dataInterval=[],r._handleEnds=[],r._hoverLinkDataIndices=[],r}return e.prototype.doRender=function(r,i,n,a){this._api=n,(!a||a.type!=="selectDataRange"||a.from!==this.uid)&&this._buildView()},e.prototype._buildView=function(){this.group.removeAll();var r=this.visualMapModel,i=this.group;this._orient=r.get("orient"),this._useHandle=r.get("calculable"),this._resetInterval(),this._renderBar(i);var n=r.get("text");this._renderEndsText(i,n,0),this._renderEndsText(i,n,1),this._updateView(!0),this.renderBackground(i),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(i)},e.prototype._renderEndsText=function(r,i,n){if(i){var a=i[1-n];a=a!=null?a+"":"";var o=this.visualMapModel,s=o.get("textGap"),l=o.itemSize,u=this._shapes.mainGroup,f=this._applyTransform([l[0]/2,n===0?-s:l[1]+s],u),h=this._applyTransform(n===0?"bottom":"top",u),v=this._orient,c=this.visualMapModel.textStyleModel;this.group.add(new Jt({style:tr(c,{x:f[0],y:f[1],verticalAlign:v==="horizontal"?"middle":h,align:v==="horizontal"?h:"center",text:a})}))}},e.prototype._renderBar=function(r){var i=this.visualMapModel,n=this._shapes,a=i.itemSize,o=this._orient,s=this._useHandle,l=Nb(i,this.api,a),u=n.mainGroup=this._createBarGroup(l),f=new ue;u.add(f),f.add(n.outOfRange=V1()),f.add(n.inRange=V1(null,s?W1(this._orient):null,et(this._dragHandle,this,"all",!1),et(this._dragHandle,this,"all",!0))),f.setClipPath(new ie({shape:{x:0,y:0,width:a[0],height:a[1],r:3}}));var h=i.textStyleModel.getTextRect("国"),v=Ev(h.width,h.height);s&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(i,u,0,a,v,o),this._createHandle(i,u,1,a,v,o)),this._createIndicator(i,u,a,v,o),r.add(u)},e.prototype._createHandle=function(r,i,n,a,o,s){var l=et(this._dragHandle,this,n,!1),u=et(this._dragHandle,this,n,!0),f=Ci(r.get("handleSize"),a[0]),h=$r(r.get("handleIcon"),-f/2,-f/2,f,f,null,!0),v=W1(this._orient);h.attr({cursor:v,draggable:!0,drift:l,ondragend:u,onmousemove:function(m){Ei(m.event)}}),h.x=a[0]/2,h.useStyle(r.getModel("handleStyle").getItemStyle()),h.setStyle({strokeNoScale:!0,strokeFirst:!0}),h.style.lineWidth*=2,h.ensureState("emphasis").style=r.getModel(["emphasis","handleStyle"]).getItemStyle(),Ep(h,!0),i.add(h);var c=this.visualMapModel.textStyleModel,d=new Jt({cursor:v,draggable:!0,drift:l,onmousemove:function(m){Ei(m.event)},ondragend:u,style:tr(c,{x:0,y:0,text:""})});d.ensureState("blur").style={opacity:.1},d.stateTransition={duration:200},this.group.add(d);var p=[f,0],g=this._shapes;g.handleThumbs[n]=h,g.handleLabelPoints[n]=p,g.handleLabels[n]=d},e.prototype._createIndicator=function(r,i,n,a,o){var s=Ci(r.get("indicatorSize"),n[0]),l=$r(r.get("indicatorIcon"),-s/2,-s/2,s,s,null,!0);l.attr({cursor:"move",invisible:!0,silent:!0,x:n[0]/2});var u=r.getModel("indicatorStyle").getItemStyle();if(l instanceof Nr){var f=l.style;l.useStyle(U({image:f.image,x:f.x,y:f.y,width:f.width,height:f.height},u))}else l.useStyle(u);i.add(l);var h=this.visualMapModel.textStyleModel,v=new Jt({silent:!0,invisible:!0,style:tr(h,{x:0,y:0,text:""})});this.group.add(v);var c=[(o==="horizontal"?a/2:kz)+n[0]/2,0],d=this._shapes;d.indicator=l,d.indicatorLabel=v,d.indicatorLabelPoint=c,this._firstShowIndicator=!0},e.prototype._dragHandle=function(r,i,n,a){if(this._useHandle){if(this._dragging=!i,!i){var o=this._applyTransform([n,a],this._shapes.mainGroup,!0);this._updateInterval(r,o[1]),this._hideIndicator(),this._updateView()}i===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),i?!this._hovering&&this._clearHoverLinkToSeries():G1(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[r],!1)}},e.prototype._resetInterval=function(){var r=this.visualMapModel,i=this._dataInterval=r.getSelected(),n=r.getExtent(),a=[0,r.itemSize[1]];this._handleEnds=[ni(i[0],n,a,!0),ni(i[1],n,a,!0)]},e.prototype._updateInterval=function(r,i){i=i||0;var n=this.visualMapModel,a=this._handleEnds,o=[0,n.itemSize[1]];ul(i,a,o,r,0);var s=n.getExtent();this._dataInterval=[ni(a[0],o,s,!0),ni(a[1],o,s,!0)]},e.prototype._updateView=function(r){var i=this.visualMapModel,n=i.getExtent(),a=this._shapes,o=[0,i.itemSize[1]],s=r?o:this._handleEnds,l=this._createBarVisual(this._dataInterval,n,s,"inRange"),u=this._createBarVisual(n,n,o,"outOfRange");a.inRange.setStyle({fill:l.barColor}).setShape("points",l.barPoints),a.outOfRange.setStyle({fill:u.barColor}).setShape("points",u.barPoints),this._updateHandle(s,l)},e.prototype._createBarVisual=function(r,i,n,a){var o={forceState:a,convertOpacityToAlpha:!0},s=this._makeColorGradient(r,o),l=[this.getControllerVisual(r[0],"symbolSize",o),this.getControllerVisual(r[1],"symbolSize",o)],u=this._createBarPoints(n,l);return{barColor:new Lp(0,0,0,1,s),barPoints:u,handlesColor:[s[0].color,s[s.length-1].color]}},e.prototype._makeColorGradient=function(r,i){var n=100,a=[],o=(r[1]-r[0])/n;a.push({color:this.getControllerVisual(r[0],"color",i),offset:0});for(var s=1;s<n;s++){var l=r[0]+o*s;if(l>r[1])break;a.push({color:this.getControllerVisual(l,"color",i),offset:s/n})}return a.push({color:this.getControllerVisual(r[1],"color",i),offset:1}),a},e.prototype._createBarPoints=function(r,i){var n=this.visualMapModel.itemSize;return[[n[0]-i[0],r[0]],[n[0],r[0]],[n[0],r[1]],[n[0]-i[1],r[1]]]},e.prototype._createBarGroup=function(r){var i=this._orient,n=this.visualMapModel.get("inverse");return new ue(i==="horizontal"&&!n?{scaleX:r==="bottom"?1:-1,rotation:Math.PI/2}:i==="horizontal"&&n?{scaleX:r==="bottom"?-1:1,rotation:-Math.PI/2}:i==="vertical"&&!n?{scaleX:r==="left"?1:-1,scaleY:-1}:{scaleX:r==="left"?1:-1})},e.prototype._updateHandle=function(r,i){if(this._useHandle){var n=this._shapes,a=this.visualMapModel,o=n.handleThumbs,s=n.handleLabels,l=a.itemSize,u=a.getExtent();Bz([0,1],function(f){var h=o[f];h.setStyle("fill",i.handlesColor[f]),h.y=r[f];var v=ni(r[f],[0,l[1]],u,!0),c=this.getControllerVisual(v,"symbolSize");h.scaleX=h.scaleY=c/l[0],h.x=l[0]-c/2;var d=en(n.handleLabelPoints[f],ws(h,this.group));s[f].setStyle({x:d[0],y:d[1],text:a.formatValueText(this._dataInterval[f]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",n.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(r,i,n,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],f=this._shapes,h=f.indicator;if(h){h.attr("invisible",!1);var v={convertOpacityToAlpha:!0},c=this.getControllerVisual(r,"color",v),d=this.getControllerVisual(r,"symbolSize"),p=ni(r,s,u,!0),g=l[0]-d/2,m={x:h.x,y:h.y};h.y=p,h.x=g;var _=en(f.indicatorLabelPoint,ws(h,this.group)),y=f.indicatorLabel;y.attr("invisible",!1);var x=this._applyTransform("left",f.mainGroup),S=this._orient,T=S==="horizontal";y.setStyle({text:(n||"")+o.formatValueText(i),verticalAlign:T?x:"middle",align:T?"center":x});var b={x:g,y:p,style:{fill:c}},w={style:{x:_[0],y:_[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var A={duration:100,easing:"cubicInOut",additive:!0};h.x=m.x,h.y=m.y,h.animateTo(b,A),y.animateTo(w,A)}else h.attr(b),y.attr(w);this._firstShowIndicator=!1;var C=this._shapes.handleLabels;if(C)for(var E=0;E<C.length;E++)this._api.enterBlur(C[E])}},e.prototype._enableHoverLinkToSeries=function(){var r=this;this._shapes.mainGroup.on("mousemove",function(i){if(r._hovering=!0,!r._dragging){var n=r.visualMapModel.itemSize,a=r._applyTransform([i.offsetX,i.offsetY],r._shapes.mainGroup,!0,!0);a[1]=H1(Ev(0,a[1]),n[1]),r._doHoverLinkToSeries(a[1],0<=a[0]&&a[0]<=n[0])}}).on("mouseout",function(){r._hovering=!1,!r._dragging&&r._clearHoverLinkToSeries()})},e.prototype._enableHoverLinkFromSeries=function(){var r=this.api.getZr();this.visualMapModel.option.hoverLink?(r.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),r.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},e.prototype._doHoverLinkToSeries=function(r,i){var n=this.visualMapModel,a=n.itemSize;if(n.option.hoverLink){var o=[0,a[1]],s=n.getExtent();r=H1(Ev(o[0],r),o[1]);var l=Uz(n,s,o),u=[r-l,r+l],f=ni(r,o,s,!0),h=[ni(u[0],o,s,!0),ni(u[1],o,s,!0)];u[0]<o[0]&&(h[0]=-1/0),u[1]>o[1]&&(h[1]=1/0),i&&(h[0]===-1/0?this._showIndicator(f,h[1],"< ",l):h[1]===1/0?this._showIndicator(f,h[0],"> ",l):this._showIndicator(f,f,"≈ ",l));var v=this._hoverLinkDataIndices,c=[];(i||G1(n))&&(c=this._hoverLinkDataIndices=n.findTargetDataIndices(h));var d=vC(v,c);this._dispatchHighDown("downplay",Hu(d[0],n)),this._dispatchHighDown("highlight",Hu(d[1],n))}},e.prototype._hoverLinkFromSeriesMouseOver=function(r){var i;if(ja(r.target,function(l){var u=kt(l);if(u.dataIndex!=null)return i=u,!0},!0),!!i){var n=this.ecModel.getSeriesByIndex(i.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(n)){var o=n.getData(i.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),i.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},e.prototype._hideIndicator=function(){var r=this._shapes;r.indicator&&r.indicator.attr("invisible",!0),r.indicatorLabel&&r.indicatorLabel.attr("invisible",!0);var i=this._shapes.handleLabels;if(i)for(var n=0;n<i.length;n++)this._api.leaveBlur(i[n])},e.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var r=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",Hu(r,this.visualMapModel)),r.length=0},e.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var r=this.api.getZr();r.off("mouseover",this._hoverLinkFromSeriesMouseOver),r.off("mouseout",this._hideIndicator)},e.prototype._applyTransform=function(r,i,n,a){var o=ws(i,a?null:this.group);return X(r)?en(r,o,n):Np(r,o,n)},e.prototype._dispatchHighDown=function(r,i){i&&i.length&&this.api.dispatchAction({type:r,batch:i})},e.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},e.prototype.remove=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},e.type="visualMap.continuous",e}(Ib);function V1(t,e,r,i){return new jf({shape:{points:t},draggable:!!r,cursor:e,drift:r,onmousemove:function(n){Ei(n.event)},ondragend:i})}function Uz(t,e,r){var i=Fz/2,n=t.get("hoverLinkDataSize");return n&&(i=ni(n,e,r,!0)/2),i}function G1(t){var e=t.get("hoverLinkOnHandle");return!!(e??t.get("realtime"))}function W1(t){return t==="vertical"?"ns-resize":"ew-resize"}const Hz=zz;var Vz={type:"selectDataRange",event:"dataRangeSelected",update:"update"},Gz=function(t,e){e.eachComponent({mainType:"visualMap",query:t},function(r){r.setSelected(t.selected)})},Wz=[{createOnAllSeries:!0,reset:function(t,e){var r=[];return e.eachComponent("visualMap",function(i){var n=t.pipelineContext;!i.isTargetSeries(t)||n&&n.large||r.push(Hk(i.stateList,i.targetVisuals,et(i.getValueState,i),i.getDataDimensionIndex(t.getData())))}),r}},{createOnAllSeries:!0,reset:function(t,e){var r=t.getData(),i=[];e.eachComponent("visualMap",function(n){if(n.isTargetSeries(t)){var a=n.getVisualMeta(et(Xz,null,t,n))||{stops:[],outerColors:[]},o=n.getDataDimensionIndex(r);o>=0&&(a.dimension=o,i.push(a))}}),t.getData().setVisual("visualMeta",i)}}];function Xz(t,e,r,i){for(var n=e.targetVisuals[i],a=er.prepareVisualTypes(n),o={color:JS(t.getData(),"color")},s=0,l=a.length;s<l;s++){var u=a[s],f=n[u==="opacity"?"__alphaForOpacity":u];f&&f.applyVisual(r,h,v)}return o.color;function h(c){return o[c]}function v(c,d){o[c]=d}}var X1=M;function Yz(t){var e=t&&t.visualMap;X(e)||(e=e?[e]:[]),X1(e,function(r){if(r){Va(r,"splitList")&&!Va(r,"pieces")&&(r.pieces=r.splitList,delete r.splitList);var i=r.pieces;i&&X(i)&&X1(i,function(n){j(n)&&(Va(n,"start")&&!Va(n,"min")&&(n.min=n.start),Va(n,"end")&&!Va(n,"max")&&(n.max=n.end))})}})}function Va(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}var Y1=!1;function Ob(t){Y1||(Y1=!0,t.registerSubTypeDefaulter("visualMap",function(e){return!e.categories&&(!(e.pieces?e.pieces.length>0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),t.registerAction(Vz,Gz),M(Wz,function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)}),t.registerPreprocessor(Yz))}function $z(t){t.registerComponentModel(Nz),t.registerComponentView(Hz),Ob(t)}var Zz=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._pieceList=[],r}return e.prototype.optionUpdated=function(r,i){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var n=this._mode=this._determineMode();this._pieceList=[],qz[this._mode].call(this,this._pieceList),this._resetSelected(r,i);var a=this.option.categories;this.resetVisual(function(o,s){n==="categories"?(o.mappingMethod="category",o.categories=ft(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=K(this._pieceList,function(l){return l=ft(l),s!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var r=this.option,i={},n=er.listVisualTypes(),a=this.isCategory();M(r.pieces,function(s){M(n,function(l){s.hasOwnProperty(l)&&(i[l]=1)})}),M(i,function(s,l){var u=!1;M(this.stateList,function(f){u=u||o(r,f,l)||o(r.target,f,l)},this),!u&&M(this.stateList,function(f){(r[f]||(r[f]={}))[l]=Pb.get(l,f==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}t.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(r,i){var n=this.option,a=this._pieceList,o=(i?n:r).selected||{};if(n.selected=o,M(a,function(l,u){var f=this.getSelectedMapKey(l);o.hasOwnProperty(f)||(o[f]=!0)},this),n.selectedMode==="single"){var s=!1;M(a,function(l,u){var f=this.getSelectedMapKey(l);o[f]&&(s?o[f]=!1:s=!0)},this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(r){return this._mode==="categories"?r.value+"":r.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var r=this.option;return r.pieces&&r.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(r){this.option.selected=ft(r)},e.prototype.getValueState=function(r){var i=er.findPieceIndex(r,this._pieceList);return i!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[i])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(r){var i=[],n=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var f=er.findPieceIndex(l,n);f===r&&o.push(u)},this),i.push({seriesId:a.id,dataIndex:o})},this),i},e.prototype.getRepresentValue=function(r){var i;if(this.isCategory())i=r.value;else if(r.value!=null)i=r.value;else{var n=r.interval||[];i=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return i},e.prototype.getVisualMeta=function(r){if(this.isCategory())return;var i=[],n=["",""],a=this;function o(f,h){var v=a.getRepresentValue({interval:f});h||(h=a.getValueState(v));var c=r(v,h);f[0]===-1/0?n[0]=c:f[1]===1/0?n[1]=c:i.push({value:f[0],color:c},{value:f[1],color:c})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return M(s,function(f){var h=f.interval;h&&(h[0]>u&&o([u,h[0]],"outOfRange"),o(h.slice()),u=h[1])},this),{stops:i,outerColors:n}},e.type="visualMap.piecewise",e.defaultOption=nl(Of.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(Of),qz={splitNumber:function(t){var e=this.option,r=Math.min(e.precision,20),i=this.getExtent(),n=e.splitNumber;n=Math.max(parseInt(n,10),1),e.splitNumber=n;for(var a=(i[1]-i[0])/n;+a.toFixed(r)!==a&&r<5;)r++;e.precision=r,a=+a.toFixed(r),e.minOpen&&t.push({interval:[-1/0,i[0]],close:[0,0]});for(var o=0,s=i[0];o<n;s+=a,o++){var l=o===n-1?i[1]:s+a;t.push({interval:[s,l],close:[1,1]})}e.maxOpen&&t.push({interval:[i[1],1/0],close:[0,0]}),xm(t),M(t,function(u,f){u.index=f,u.text=this.formatValueText(u.interval)},this)},categories:function(t){var e=this.option;M(e.categories,function(r){t.push({text:this.formatValueText(r,!0),value:r})},this),$1(e,t)},pieces:function(t){var e=this.option;M(e.pieces,function(r,i){j(r)||(r={value:r});var n={text:"",index:i};if(r.label!=null&&(n.text=r.label),r.hasOwnProperty("value")){var a=n.value=r.value;n.interval=[a,a],n.close=[1,1]}else{for(var o=n.interval=[],s=n.close=[0,0],l=[1,0,1],u=[-1/0,1/0],f=[],h=0;h<2;h++){for(var v=[["gte","gt","min"],["lte","lt","max"]][h],c=0;c<3&&o[h]==null;c++)o[h]=r[v[c]],s[h]=l[c],f[h]=c===2;o[h]==null&&(o[h]=u[h])}f[0]&&o[1]===1/0&&(s[0]=0),f[1]&&o[0]===-1/0&&(s[1]=0),o[0]===o[1]&&s[0]&&s[1]&&(n.value=o[0])}n.visual=er.retrieveVisuals(r),t.push(n)},this),$1(e,t),xm(t),M(t,function(r){var i=r.close,n=[["<","≤"][i[1]],[">","≥"][i[0]]];r.text=r.text||this.formatValueText(r.value!=null?r.value:r.interval,!1,n)},this)}};function $1(t,e){var r=t.inverse;(t.orient==="vertical"?!r:r)&&e.reverse()}const Kz=Zz;var jz=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.doRender=function(){var r=this.group;r.removeAll();var i=this.visualMapModel,n=i.get("textGap"),a=i.textStyleModel,o=a.getFont(),s=a.getTextColor(),l=this._getItemAlign(),u=i.itemSize,f=this._getViewData(),h=f.endsText,v=fo(i.get("showLabel",!0),!h);h&&this._renderEndsText(r,h[0],u,v,l),M(f.viewPieceList,function(c){var d=c.piece,p=new ue;p.onclick=et(this._onItemClick,this,d),this._enableHoverLink(p,c.indexInModelPieceList);var g=i.getRepresentValue(d);if(this._createItemSymbol(p,g,[0,0,u[0],u[1]]),v){var m=this.visualMapModel.getValueState(g);p.add(new Jt({style:{x:l==="right"?-n:u[0]+n,y:u[1]/2,text:d.text,verticalAlign:"middle",align:l,font:o,fill:s,opacity:m==="outOfRange"?.5:1}}))}r.add(p)},this),h&&this._renderEndsText(r,h[1],u,v,l),lo(i.get("orient"),r,i.get("itemGap")),this.renderBackground(r),this.positionGroup(r)},e.prototype._enableHoverLink=function(r,i){var n=this;r.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=n.visualMapModel;s.option.hoverLink&&n.api.dispatchAction({type:o,batch:Hu(s.findTargetDataIndices(i),s)})}},e.prototype._getItemAlign=function(){var r=this.visualMapModel,i=r.option;if(i.orient==="vertical")return Nb(r,this.api,r.itemSize);var n=i.align;return(!n||n==="auto")&&(n="left"),n},e.prototype._renderEndsText=function(r,i,n,a,o){if(i){var s=new ue,l=this.visualMapModel.textStyleModel;s.add(new Jt({style:tr(l,{x:a?o==="right"?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:a?o:"center",text:i})})),r.add(s)}},e.prototype._getViewData=function(){var r=this.visualMapModel,i=K(r.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),n=r.get("text"),a=r.get("orient"),o=r.get("inverse");return(a==="horizontal"?o:!o)?i.reverse():n&&(n=n.slice().reverse()),{viewPieceList:i,endsText:n}},e.prototype._createItemSymbol=function(r,i,n){r.add($r(this.getControllerVisual(i,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(i,"color")))},e.prototype._onItemClick=function(r){var i=this.visualMapModel,n=i.option,a=n.selectedMode;if(a){var o=ft(n.selected),s=i.getSelectedMapKey(r);a==="single"||a===!0?(o[s]=!0,M(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},e.type="visualMap.piecewise",e}(Ib);const Qz=jz;function Jz(t){t.registerComponentModel(Kz),t.registerComponentView(Qz),Ob(t)}function tU(t){nr($z),nr(Jz)}var Cv=Math.sin,Mv=Math.cos,Bb=Math.PI,Un=Math.PI*2,eU=180/Bb,rU=function(){function t(){}return t.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},t.prototype.moveTo=function(e,r){this._add("M",e,r)},t.prototype.lineTo=function(e,r){this._add("L",e,r)},t.prototype.bezierCurveTo=function(e,r,i,n,a,o){this._add("C",e,r,i,n,a,o)},t.prototype.quadraticCurveTo=function(e,r,i,n){this._add("Q",e,r,i,n)},t.prototype.arc=function(e,r,i,n,a,o){this.ellipse(e,r,i,i,0,n,a,o)},t.prototype.ellipse=function(e,r,i,n,a,o,s,l){var u=s-o,f=!l,h=Math.abs(u),v=Ki(h-Un)||(f?u>=Un:-u>=Un),c=u>0?u%Un:u%Un+Un,d=!1;v?d=!0:Ki(h)?d=!1:d=c>=Bb==!!f;var p=e+i*Mv(o),g=r+n*Cv(o);this._start&&this._add("M",p,g);var m=Math.round(a*eU);if(v){var _=1/this._p,y=(f?1:-1)*(Un-_);this._add("A",i,n,m,1,+f,e+i*Mv(o+y),r+n*Cv(o+y)),_>.01&&this._add("A",i,n,m,0,+f,p,g)}else{var x=e+i*Mv(s),S=r+n*Cv(s);this._add("A",i,n,m,+d,+f,x,S)}},t.prototype.rect=function(e,r,i,n){this._add("M",e,r),this._add("l",i,0),this._add("l",0,n),this._add("l",-i,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(e,r,i,n,a,o,s,l,u){for(var f=[],h=this._p,v=1;v<arguments.length;v++){var c=arguments[v];if(isNaN(c)){this._invalid=!0;return}f.push(Math.round(c*h)/h)}this._d.push(e+f.join(" ")),this._start=e==="Z"},t.prototype.generateStr=function(){this._str=this._invalid?"":this._d.join(""),this._d=[]},t.prototype.getStr=function(){return this._str},t}();const Fb=rU;var Ls="none",iU=Math.round;function nU(t){var e=t.fill;return e!=null&&e!==Ls}function aU(t){var e=t.stroke;return e!=null&&e!==Ls}var tp=["lineCap","miterLimit","lineJoin"],oU=K(tp,function(t){return"stroke-"+t.toLowerCase()});function sU(t,e,r,i){var n=e.opacity==null?1:e.opacity;if(r instanceof Nr){t("opacity",n);return}if(nU(e)){var a=Is(e.fill);t("fill",a.color);var o=e.fillOpacity!=null?e.fillOpacity*a.opacity*n:a.opacity*n;(i||o<1)&&t("fill-opacity",o)}else t("fill",Ls);if(aU(e)){var s=Is(e.stroke);t("stroke",s.color);var l=e.strokeNoScale?r.getLineScale():1,u=l?(e.lineWidth||0)/l:0,f=e.strokeOpacity!=null?e.strokeOpacity*s.opacity*n:s.opacity*n,h=e.strokeFirst;if((i||u!==1)&&t("stroke-width",u),(i||h)&&t("paint-order",h?"stroke":"fill"),(i||f<1)&&t("stroke-opacity",f),e.lineDash){var v=Jp(r),c=v[0],d=v[1];c&&(d=iU(d||0),t("stroke-dasharray",c.join(",")),(d||i)&&t("stroke-dashoffset",d))}else i&&t("stroke-dasharray",Ls);for(var p=0;p<tp.length;p++){var g=tp[p];if(i||e[g]!==ef[g]){var m=e[g]||ef[g];m&&t(oU[p],m)}}}else i&&t("stroke",Ls)}var kb="http://www.w3.org/2000/svg",zb="http://www.w3.org/1999/xlink",lU="http://www.w3.org/2000/xmlns/",uU="http://www.w3.org/XML/1998/namespace";function Ub(t){return document.createElementNS(kb,t)}function Se(t,e,r,i,n){return{tag:t,attrs:r||{},children:i,text:n,key:e}}function fU(t,e){var r=[];if(e)for(var i in e){var n=e[i],a=i;n!==!1&&(n!==!0&&n!=null&&(a+='="'+n+'"'),r.push(a))}return"<"+t+" "+r.join(" ")+">"}function hU(t){return"</"+t+">"}function Fg(t,e){e=e||{};var r=e.newline?`
`:"";function i(n){var a=n.children,o=n.tag,s=n.attrs,l=n.text;return fU(o,s)+(o!=="style"?Me(l):l||"")+(a?""+r+K(a,function(u){return i(u)}).join(r)+r:"")+hU(o)}return i(t)}function cU(t,e,r){r=r||{};var i=r.newline?`
`:"",n=" {"+i,a=i+"}",o=K(yt(t),function(l){return l+n+K(yt(t[l]),function(u){return u+":"+t[l][u]+";"}).join(i)+a}).join(i),s=K(yt(e),function(l){return"@keyframes "+l+n+K(yt(e[l]),function(u){return u+n+K(yt(e[l][u]),function(f){var h=e[l][u][f];return f==="d"&&(h='path("'+h+'")'),f+":"+h+";"}).join(i)+a}).join(i)+a}).join(i);return!o&&!s?"":["<![CDATA[",o,s,"]]>"].join(i)}function ep(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssClassIdx:0,cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function Z1(t,e,r,i){return Se("svg","root",{width:t,height:e,xmlns:kb,"xmlns:xlink":zb,version:"1.1",baseProfile:"full",viewBox:i?"0 0 "+t+" "+e:!1},r)}var q1={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},Gn="transform-origin";function vU(t,e,r){var i=U({},t.shape);U(i,e),t.buildPath(r,i);var n=new Fb;return n.reset(Ox(t)),r.rebuildPath(n,1),n.generateStr(),n.getStr()}function dU(t,e){var r=e.originX,i=e.originY;(r||i)&&(t[Gn]=r+"px "+i+"px")}var pU={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function Hb(t,e){var r=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[r]=t,r}function gU(t,e,r){var i=t.shape.paths,n={},a,o;if(M(i,function(l){var u=ep(r.zrId);u.animation=!0,wh(l,{},u,!0);var f=u.cssAnims,h=u.cssNodes,v=yt(f),c=v.length;if(c){o=v[c-1];var d=f[o];for(var p in d){var g=d[p];n[p]=n[p]||{d:""},n[p].d+=g.d||""}for(var m in h){var _=h[m].animation;_.indexOf(o)>=0&&(a=_)}}}),!!a){e.d=!1;var s=Hb(n,r);return a.replace(o,s)}}function K1(t){return Z(t)?q1[t]?"cubic-bezier("+q1[t]+")":cp(t)?t:"":""}function wh(t,e,r,i){var n=t.animators,a=n.length,o=[];if(t instanceof GT){var s=gU(t,e,r);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u<a;u++){var f=n[u],h=[f.getMaxTime()/1e3+"s"],v=K1(f.getClip().easing),c=f.getDelay();v?h.push(v):h.push("linear"),c&&h.push(c/1e3+"s"),f.getLoop()&&h.push("infinite");var d=h.join(" ");l[d]=l[d]||[d,[]],l[d][1].push(f)}function p(_){var y=_[1],x=y.length,S={},T={},b={},w="animation-timing-function";function A(Xt,Ot,Mt){for(var q=Xt.getTracks(),bt=Xt.getMaxTime(),oe=0;oe<q.length;oe++){var $t=q[oe];if($t.needsAnimate()){var Be=$t.keyframes,Br=$t.propName;if(Mt&&(Br=Mt(Br)),Br)for(var bh=0;bh<Be.length;bh++){var cl=Be[bh],vl=Math.round(cl.time/bt*100)+"%",Hg=K1(cl.easing),Vg=cl.rawValue;(Z(Vg)||Qt(Vg))&&(Ot[vl]=Ot[vl]||{},Ot[vl][Br]=cl.rawValue,Hg&&(Ot[vl][w]=Hg))}}}}for(var C=0;C<x;C++){var E=y[C],D=E.targetName;D?D==="shape"&&A(E,T):!i&&A(E,S)}for(var L in S){var R={};Ux(R,t),U(R,S[L]);var N=Bx(R),I=S[L][w];b[L]=N?{transform:N}:{},dU(b[L],R),I&&(b[L][w]=I)}var F,O=!0;for(var L in T){b[L]=b[L]||{};var z=!F,I=T[L][w];z&&(F=new Mi);var k=F.len();F.reset(),b[L].d=vU(t,T[L],F);var it=F.len();if(!z&&k!==it){O=!1;break}I&&(b[L][w]=I)}if(!O)for(var L in b)delete b[L].d;if(!i)for(var C=0;C<x;C++){var E=y[C],D=E.targetName;D==="style"&&A(E,b,function(q){return pU[q]})}for(var $=yt(b),nt=!0,rt,C=1;C<$.length;C++){var It=$[C-1],gt=$[C];if(b[It][Gn]!==b[gt][Gn]){nt=!1;break}rt=b[It][Gn]}if(nt&&rt){for(var L in b)b[L][Gn]&&delete b[L][Gn];e[Gn]=rt}if(ce($,function(Xt){return yt(b[Xt]).length>0}).length){var Ft=Hb(b,r);return Ft+" "+_[0]+" both"}}for(var g in l){var s=p(l[g]);s&&o.push(s)}if(o.length){var m=r.zrId+"-cls-"+r.cssClassIdx++;r.cssNodes["."+m]={animation:o.join(",")},e.class=m}}var Js=Math.round;function Vb(t){return t&&Z(t.src)}function Gb(t){return t&&ct(t.toDataURL)}function kg(t,e,r,i){sU(function(n,a){var o=n==="fill"||n==="stroke";o&&Nx(a)?Xb(e,t,n,i):o&&vp(a)?Yb(r,t,n,i):t[n]=a},e,r,!1),wU(r,t,i)}function j1(t){return Ki(t[0]-1)&&Ki(t[1])&&Ki(t[2])&&Ki(t[3]-1)}function mU(t){return Ki(t[4])&&Ki(t[5])}function zg(t,e,r){if(e&&!(mU(e)&&j1(e))){var i=r?10:1e4;t.transform=j1(e)?"translate("+Js(e[4]*i)/i+" "+Js(e[5]*i)/i+")":mE(e)}}function Q1(t,e,r){for(var i=t.points,n=[],a=0;a<i.length;a++)n.push(Js(i[a][0]*r)/r),n.push(Js(i[a][1]*r)/r);e.points=n.join(" ")}function J1(t){return!t.smooth}function _U(t){var e=K(t,function(r){return typeof r=="string"?[r,r]:r});return function(r,i,n){for(var a=0;a<e.length;a++){var o=e[a],s=r[o[0]];s!=null&&(i[o[1]]=Js(s*n)/n)}}}var yU={circle:[_U(["cx","cy","r"])],polyline:[Q1,J1],polygon:[Q1,J1]};function xU(t){for(var e=t.animators,r=0;r<e.length;r++)if(e[r].targetName==="shape")return!0;return!1}function Wb(t,e){var r=t.style,i=t.shape,n=yU[t.type],a={},o=e.animation,s="path",l=t.style.strokePercent,u=e.compress&&Ox(t)||4;if(n&&!e.willUpdate&&!(n[1]&&!n[1](i))&&!(o&&xU(t))&&!(l<1)){s=t.type;var f=Math.pow(10,u);n[0](i,a,f)}else{var h=!t.path||t.shapeChanged();t.path||t.createPathProxy();var v=t.path;h&&(v.beginPath(),t.buildPath(v,t.shape),t.pathUpdated());var c=v.getVersion(),d=t,p=d.__svgPathBuilder;(d.__svgPathVersion!==c||!p||l!==d.__svgPathStrokePercent)&&(p||(p=d.__svgPathBuilder=new Fb),p.reset(u),v.rebuildPath(p,l),p.generateStr(),d.__svgPathVersion=c,d.__svgPathStrokePercent=l),a.d=p.getStr()}return zg(a,t.transform),kg(a,r,t,e),e.animation&&wh(t,a,e),Se(s,t.id+"",a)}function TU(t,e){var r=t.style,i=r.image;if(i&&!Z(i)&&(Vb(i)?i=i.src:Gb(i)&&(i=i.toDataURL())),!!i){var n=r.x||0,a=r.y||0,o=r.width,s=r.height,l={href:i,width:o,height:s};return n&&(l.x=n),a&&(l.y=a),zg(l,t.transform),kg(l,r,t,e),e.animation&&wh(t,l,e),Se("image",t.id+"",l)}}function SU(t,e){var r=t.style,i=r.text;if(i!=null&&(i+=""),!(!i||isNaN(r.x)||isNaN(r.y))){var n=r.font||nn,a=r.x||0,o=yE(r.y||0,Wf(n),r.textBaseline),s=_E[r.textAlign]||r.textAlign,l={"dominant-baseline":"central","text-anchor":s};if(gT(r)){var u="",f=r.fontStyle,h=pT(r.fontSize);if(!parseFloat(h))return;var v=r.fontFamily||sx,c=r.fontWeight;u+="font-size:"+h+";font-family:"+v+";",f&&f!=="normal"&&(u+="font-style:"+f+";"),c&&c!=="normal"&&(u+="font-weight:"+c+";"),l.style=u}else l.style="font: "+n;return i.match(/\s/)&&(l["xml:space"]="preserve"),a&&(l.x=a),o&&(l.y=o),zg(l,t.transform),kg(l,r,t,e),e.animation&&wh(t,l,e),Se("text",t.id+"",l,void 0,i)}}function tx(t,e){if(t instanceof Ht)return Wb(t,e);if(t instanceof Nr)return TU(t,e);if(t instanceof rf)return SU(t,e)}function wU(t,e,r){var i=t.style;if(xE(i)){var n=TE(t),a=r.shadowCache,o=a[n];if(!o){var s=t.getGlobalScale(),l=s[0],u=s[1];if(!l||!u)return;var f=i.shadowOffsetX||0,h=i.shadowOffsetY||0,v=i.shadowBlur,c=Is(i.shadowColor),d=c.opacity,p=c.color,g=v/2/l,m=v/2/u,_=g+" "+m;o=r.zrId+"-s"+r.shadowIdx++,r.defs[o]=Se("filter",o,{id:o,x:"-100%",y:"-100%",width:"300%",height:"300%"},[Se("feDropShadow","",{dx:f/l,dy:h/u,stdDeviation:_,"flood-color":p,"flood-opacity":d})]),a[n]=o}e.filter=Hf(o)}}function Xb(t,e,r,i){var n=t[r],a,o={gradientUnits:n.global?"userSpaceOnUse":"objectBoundingBox"};if(Px(n))a="linearGradient",o.x1=n.x,o.y1=n.y,o.x2=n.x2,o.y2=n.y2;else if(Ix(n))a="radialGradient",o.cx=mt(n.x,.5),o.cy=mt(n.y,.5),o.r=mt(n.r,.5);else return;for(var s=n.colorStops,l=[],u=0,f=s.length;u<f;++u){var h=Hv(s[u].offset)*100+"%",v=s[u].color,c=Is(v),d=c.color,p=c.opacity,g={offset:h};g["stop-color"]=d,p<1&&(g["stop-opacity"]=p),l.push(Se("stop",u+"",g))}var m=Se(a,"",o,l),_=Fg(m),y=i.gradientCache,x=y[_];x||(x=i.zrId+"-g"+i.gradientIdx++,y[_]=x,o.id=x,i.defs[x]=Se(a,x,o,l)),e[r]=Hf(x)}function Yb(t,e,r,i){var n=t.style[r],a=t.getBoundingRect(),o={},s=n.repeat,l=s==="no-repeat",u=s==="repeat-x",f=s==="repeat-y",h;if(Rx(n)){var v=n.imageWidth,c=n.imageHeight,d=void 0,p=n.image;if(Z(p)?d=p:Vb(p)?d=p.src:Gb(p)&&(d=p.toDataURL()),typeof Image>"u"){var g="Image width/height must been given explictly in svg-ssr renderer.";Rr(v,g),Rr(c,g)}else if(v==null||c==null){var m=function(C,E){if(C){var D=C.elm,L=v||E.width,R=c||E.height;C.tag==="pattern"&&(u?(R=1,L/=a.width):f&&(L=1,R/=a.height)),C.attrs.width=L,C.attrs.height=R,D&&(D.setAttribute("width",L),D.setAttribute("height",R))}},_=Tp(d,null,t,function(C){l||m(T,C),m(h,C)});_&&_.width&&_.height&&(v=v||_.width,c=c||_.height)}h=Se("image","img",{href:d,width:v,height:c}),o.width=v,o.height=c}else n.svgElement&&(h=ft(n.svgElement),o.width=n.svgWidth,o.height=n.svgHeight);if(h){var y,x;l?y=x=1:u?(x=1,y=o.width/a.width):f?(y=1,x=o.height/a.height):o.patternUnits="userSpaceOnUse",y!=null&&!isNaN(y)&&(o.width=y),x!=null&&!isNaN(x)&&(o.height=x);var S=Bx(n);S&&(o.patternTransform=S);var T=Se("pattern","",o,[h]),b=Fg(T),w=i.patternCache,A=w[b];A||(A=i.zrId+"-p"+i.patternIdx++,w[b]=A,o.id=A,T=i.defs[A]=Se("pattern",A,o,[h])),e[r]=Hf(A)}}function bU(t,e,r){var i=r.clipPathCache,n=r.defs,a=i[t.id];if(!a){a=r.zrId+"-c"+r.clipPathIdx++;var o={id:a};i[t.id]=a,n[a]=Se("clipPath",a,o,[Wb(t,r)])}e["clip-path"]=Hf(a)}function ex(t){return document.createTextNode(t)}function Xn(t,e,r){t.insertBefore(e,r)}function rx(t,e){t.removeChild(e)}function ix(t,e){t.appendChild(e)}function $b(t){return t.parentNode}function Zb(t){return t.nextSibling}function Dv(t,e){t.textContent=e}var nx=58,AU=120,EU=Se("","");function rp(t){return t===void 0}function oi(t){return t!==void 0}function CU(t,e,r){for(var i={},n=e;n<=r;++n){var a=t[n].key;a!==void 0&&(i[a]=n)}return i}function gs(t,e){var r=t.key===e.key,i=t.tag===e.tag;return i&&r}function tl(t){var e,r=t.children,i=t.tag;if(oi(i)){var n=t.elm=Ub(i);if(Ug(EU,t),X(r))for(e=0;e<r.length;++e){var a=r[e];a!=null&&ix(n,tl(a))}else oi(t.text)&&!j(t.text)&&ix(n,ex(t.text))}else t.elm=ex(t.text);return t.elm}function qb(t,e,r,i,n){for(;i<=n;++i){var a=r[i];a!=null&&Xn(t,tl(a),e)}}function Bf(t,e,r,i){for(;r<=i;++r){var n=e[r];if(n!=null)if(oi(n.tag)){var a=$b(n.elm);rx(a,n.elm)}else rx(t,n.elm)}}function Ug(t,e){var r,i=e.elm,n=t&&t.attrs||{},a=e.attrs||{};if(n!==a){for(r in a){var o=a[r],s=n[r];s!==o&&(o===!0?i.setAttribute(r,""):o===!1?i.removeAttribute(r):r.charCodeAt(0)!==AU?i.setAttribute(r,o):r==="xmlns:xlink"||r==="xmlns"?i.setAttributeNS(lU,r,o):r.charCodeAt(3)===nx?i.setAttributeNS(uU,r,o):r.charCodeAt(5)===nx?i.setAttributeNS(zb,r,o):i.setAttribute(r,o))}for(r in n)r in a||i.removeAttribute(r)}}function MU(t,e,r){for(var i=0,n=0,a=e.length-1,o=e[0],s=e[a],l=r.length-1,u=r[0],f=r[l],h,v,c,d;i<=a&&n<=l;)o==null?o=e[++i]:s==null?s=e[--a]:u==null?u=r[++n]:f==null?f=r[--l]:gs(o,u)?(Ya(o,u),o=e[++i],u=r[++n]):gs(s,f)?(Ya(s,f),s=e[--a],f=r[--l]):gs(o,f)?(Ya(o,f),Xn(t,o.elm,Zb(s.elm)),o=e[++i],f=r[--l]):gs(s,u)?(Ya(s,u),Xn(t,s.elm,o.elm),s=e[--a],u=r[++n]):(rp(h)&&(h=CU(e,i,a)),v=h[u.key],rp(v)?Xn(t,tl(u),o.elm):(c=e[v],c.tag!==u.tag?Xn(t,tl(u),o.elm):(Ya(c,u),e[v]=void 0,Xn(t,c.elm,o.elm))),u=r[++n]);(i<=a||n<=l)&&(i>a?(d=r[l+1]==null?null:r[l+1].elm,qb(t,d,r,n,l)):Bf(t,e,i,a))}function Ya(t,e){var r=e.elm=t.elm,i=t.children,n=e.children;t!==e&&(Ug(t,e),rp(e.text)?oi(i)&&oi(n)?i!==n&&MU(r,i,n):oi(n)?(oi(t.text)&&Dv(r,""),qb(r,null,n,0,n.length-1)):oi(i)?Bf(r,i,0,i.length-1):oi(t.text)&&Dv(r,""):t.text!==e.text&&(oi(i)&&Bf(r,i,0,i.length-1),Dv(r,e.text)))}function DU(t,e){if(gs(t,e))Ya(t,e);else{var r=t.elm,i=$b(r);tl(e),i!==null&&(Xn(i,e.elm,Zb(r)),Bf(i,[t],0,0))}return e}var LU=0,RU=function(){function t(e,r,i){if(this.type="svg",this.refreshHover=ax(),this.configLayer=ax(),this.storage=r,this._opts=i=U({},i),this.root=e,this._id="zr"+LU++,this._oldVNode=Z1(i.width,i.height),e&&!i.ssr){var n=this._viewport=document.createElement("div");n.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=Ub("svg");Ug(null,this._oldVNode),n.appendChild(a),e.appendChild(n)}this.resize(i.width,i.height)}return t.prototype.getType=function(){return this.type},t.prototype.getViewportRoot=function(){return this._viewport},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.getSvgDom=function(){return this._svgDom},t.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",DU(this._oldVNode,e),this._oldVNode=e}},t.prototype.renderOneToVNode=function(e){return tx(e,ep(this._id))},t.prototype.renderToVNode=function(e){e=e||{};var r=this.storage.getDisplayList(!0),i=this._width,n=this._height,a=ep(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress;var o=[],s=this._bgVNode=PU(i,n,this._backgroundColor,a);s&&o.push(s);var l=e.compress?null:this._mainVNode=Se("g","main",{},[]);this._paintList(r,a,l?l.children:o),l&&o.push(l);var u=K(yt(a.defs),function(v){return a.defs[v]});if(u.length&&o.push(Se("defs","defs",{},u)),e.animation){var f=cU(a.cssNodes,a.cssAnims,{newline:!0});if(f){var h=Se("style","stl",{},[],f);o.push(h)}}return Z1(i,n,o,e.useViewBox)},t.prototype.renderToString=function(e){return e=e||{},Fg(this.renderToVNode({animation:mt(e.cssAnimation,!0),willUpdate:!1,compress:!0,useViewBox:mt(e.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(e,r,i){for(var n=e.length,a=[],o=0,s,l,u=0,f=0;f<n;f++){var h=e[f];if(!h.invisible){var v=h.__clipPaths,c=v&&v.length||0,d=l&&l.length||0,p=void 0;for(p=Math.max(c-1,d-1);p>=0&&!(v&&l&&v[p]===l[p]);p--);for(var g=d-1;g>p;g--)o--,s=a[o-1];for(var m=p+1;m<c;m++){var _={};bU(v[m],_,r);var y=Se("g","clip-g-"+u++,_,[]);(s?s.children:i).push(y),a[o++]=y,s=y}l=v;var x=tx(h,r);x&&(s?s.children:i).push(x)}}},t.prototype.resize=function(e,r){var i=this._opts,n=this.root,a=this._viewport;if(e!=null&&(i.width=e),r!=null&&(i.height=r),n&&a&&(a.style.display="none",e=Qa(n,0,i),r=Qa(n,1,i),a.style.display=""),this._width!==e||this._height!==r){if(this._width=e,this._height=r,a){var o=a.style;o.width=e+"px",o.height=r+"px"}if(vp(this._backgroundColor))this.refresh();else{var s=this._svgDom;s&&(s.setAttribute("width",e),s.setAttribute("height",r));var l=this._bgVNode&&this._bgVNode.elm;l&&(l.setAttribute("width",e),l.setAttribute("height",r))}}},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t.prototype.dispose=function(){this.root&&(this.root.innerHTML=""),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},t.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},t.prototype.toDataURL=function(e){var r=this.renderToString(),i="data:image/svg+xml;";return e?(r=wE(r),r&&i+"base64,"+r):i+"charset=UTF-8,"+encodeURIComponent(r)},t}();function ax(t){return function(){}}function PU(t,e,r,i){var n;if(r&&r!=="none")if(n=Se("rect","bg",{width:t,height:e,x:"0",y:"0",id:"0"}),Nx(r))Xb({fill:r},n.attrs,"fill",i);else if(vp(r))Yb({style:{fill:r},dirty:De,getBoundingRect:function(){return{width:t,height:e}}},n.attrs,"fill",i);else{var a=Is(r),o=a.color,s=a.opacity;n.attrs.fill=o,s<1&&(n.attrs["fill-opacity"]=s)}return n}const IU=RU;function NU(t){t.registerPainter("svg",IU)}nr([S2,zk,q4,Az,ez,EO,tU,nk,x4,h4,NU,T2]);export{BU as default};
