@webority/chat-elements 0.147.4 → 0.147.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,8 +28,8 @@
28
28
  `)c&&(s+=c,u+=l),a.push(s),o.push(u),s=``,c=``,l=0,u=0;else{var m=es(d,p.charCodeAt(0)),h=!r&&!_s(p);(a.length?u+m>n:i+u+m>n)?u?(s||c)&&(h?(s||(s=c,c=``,l=0,u=l),a.push(s),o.push(u-l),c+=p,l+=m,s=``,u=l):(c&&(s+=c,c=``,l=0),a.push(s),o.push(u),s=p,u=m)):h?(a.push(c),o.push(l),c=p,l=m):(a.push(p),o.push(m)):(u+=m,h?(c+=p,l+=m):(c&&(s+=c,c=``,l=0),s+=p))}}return c&&(s+=c),s&&(a.push(s),o.push(u)),a.length===1&&(u+=i),{accumWidth:u,lines:a,linesWidths:o}}function ys(e,t,n,r,i,a){if(e.baseX=n,e.baseY=r,e.outerWidth=e.outerHeight=null,t){var o=t.width*2,s=t.height*2;J.set(tI,is(n,o,i),as(r,s,a),o,s),J.intersect(t,tI,null,nI);var c=nI.outIntersectRect;e.outerWidth=c.width,e.outerHeight=c.height,e.baseX=is(c.x,c.width,i,!0),e.baseY=as(c.y,c.height,a,!0)}}function bs(e){return e==null?e=``:e+=``}function xs(e){var t=bs(e.text),n=e.font;return Ss(e,ts(Qo(n),t),os(n),null)}function Ss(e,t,n,r){var i=new J(is(e.x||0,t,e.textAlign),as(e.y||0,n,e.textBaseline),t,n),a=r??(Cs(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function Cs(e){var t=e.stroke;return t!=null&&t!==`none`&&e.lineWidth>0}function ws(e){return e>iI||e<-iI}function Ts(){return new lI}function Es(e,t){return ja(e,t,dI)}function Ds(e){return e>-hI&&e<hI}function Os(e){return e>hI||e<-hI}function ks(e,t,n,r,i){var a=1-i;return a*a*(a*e+3*i*t)+i*i*(i*r+3*a*n)}function As(e,t,n,r,i){var a=1-i;return 3*(((t-e)*a+2*(n-t)*i)*a+(r-n)*i*i)}function js(e,t,n,r,i,a){var o=r+3*(t-n)-e,s=3*(n-t*2+e),c=3*(t-e),l=e-i,u=s*s-3*o*c,d=s*c-9*o*l,f=c*c-3*s*l,p=0;if(Ds(u)&&Ds(d)){if(Ds(s))a[0]=0;else{var m=-c/s;m>=0&&m<=1&&(a[p++]=m)}}else{var h=d*d-4*u*f;if(Ds(h)){var g=d/u,m=-s/o+g,_=-g/2;m>=0&&m<=1&&(a[p++]=m),_>=0&&_<=1&&(a[p++]=_)}else if(h>0){var v=mI(h),y=u*s+1.5*o*(-d+v),b=u*s+1.5*o*(-d-v);y=y<0?-pI(-y,vI):pI(y,vI),b=b<0?-pI(-b,vI):pI(b,vI);var m=(-s-(y+b))/(3*o);m>=0&&m<=1&&(a[p++]=m)}else{var x=(2*u*s-3*o*d)/(2*mI(u*u*u)),S=Math.acos(x)/3,C=mI(u),w=Math.cos(S),m=(-s-2*C*w)/(3*o),_=(-s+C*(w+_I*Math.sin(S)))/(3*o),T=(-s+C*(w-_I*Math.sin(S)))/(3*o);m>=0&&m<=1&&(a[p++]=m),_>=0&&_<=1&&(a[p++]=_),T>=0&&T<=1&&(a[p++]=T)}}return p}function Ms(e,t,n,r,i){var a=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,s=3*t-3*e,c=0;if(Ds(o)){if(Os(a)){var l=-s/a;l>=0&&l<=1&&(i[c++]=l)}}else{var u=a*a-4*o*s;if(Ds(u))i[0]=-a/(2*o);else if(u>0){var d=mI(u),l=(-a+d)/(2*o),f=(-a-d)/(2*o);l>=0&&l<=1&&(i[c++]=l),f>=0&&f<=1&&(i[c++]=f)}}return c}function Ns(e,t,n,r,i,a){var o=(t-e)*i+e,s=(n-t)*i+t,c=(r-n)*i+n,l=(s-o)*i+o,u=(c-s)*i+s,d=(u-l)*i+l;a[0]=e,a[1]=o,a[2]=l,a[3]=d,a[4]=d,a[5]=u,a[6]=c,a[7]=r}function Ps(e,t,n,r,i,a,o,s,c,l,u){var d,f=.005,p=1/0,m,h,g,_;yI[0]=c,yI[1]=l;for(var v=0;v<1;v+=.05)bI[0]=ks(e,n,i,o,v),bI[1]=ks(t,r,a,s,v),g=CF(yI,bI),g<p&&(d=v,p=g);p=1/0;for(var y=0;y<32&&!(f<gI);y++)m=d-f,h=d+f,bI[0]=ks(e,n,i,o,m),bI[1]=ks(t,r,a,s,m),g=CF(bI,yI),m>=0&&g<p?(d=m,p=g):(xI[0]=ks(e,n,i,o,h),xI[1]=ks(t,r,a,s,h),_=CF(xI,yI),h<=1&&_<p?(d=h,p=_):f*=.5);return u&&(u[0]=ks(e,n,i,o,d),u[1]=ks(t,r,a,s,d)),mI(p)}function Fs(e,t,n,r,i,a,o,s,c){for(var l=e,u=t,d=0,f=1/c,p=1;p<=c;p++){var m=p*f,h=ks(e,n,i,o,m),g=ks(t,r,a,s,m),_=h-l,v=g-u;d+=Math.sqrt(_*_+v*v),l=h,u=g}return d}function Is(e,t,n,r){var i=1-r;return i*(i*e+2*r*t)+r*r*n}function Ls(e,t,n,r){return 2*((1-r)*(t-e)+r*(n-t))}function Rs(e,t,n,r,i){var a=e-2*t+n,o=2*(t-e),s=e-r,c=0;if(Ds(a)){if(Os(o)){var l=-s/o;l>=0&&l<=1&&(i[c++]=l)}}else{var u=o*o-4*a*s;if(Ds(u)){var l=-o/(2*a);l>=0&&l<=1&&(i[c++]=l)}else if(u>0){var d=mI(u),l=(-o+d)/(2*a),f=(-o-d)/(2*a);l>=0&&l<=1&&(i[c++]=l),f>=0&&f<=1&&(i[c++]=f)}}return c}function zs(e,t,n){var r=e+n-2*t;return r===0?.5:(e-t)/r}function Bs(e,t,n,r,i){var a=(t-e)*r+e,o=(n-t)*r+t,s=(o-a)*r+a;i[0]=e,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=n}function Vs(e,t,n,r,i,a,o,s,c){var l,u=.005,d=1/0;yI[0]=o,yI[1]=s;for(var f=0;f<1;f+=.05){bI[0]=Is(e,n,i,f),bI[1]=Is(t,r,a,f);var p=CF(yI,bI);p<d&&(l=f,d=p)}d=1/0;for(var m=0;m<32&&!(u<gI);m++){var h=l-u,g=l+u;bI[0]=Is(e,n,i,h),bI[1]=Is(t,r,a,h);var p=CF(bI,yI);if(h>=0&&p<d)l=h,d=p;else{xI[0]=Is(e,n,i,g),xI[1]=Is(t,r,a,g);var _=CF(xI,yI);g<=1&&_<d?(l=g,d=_):u*=.5}}return c&&(c[0]=Is(e,n,i,l),c[1]=Is(t,r,a,l)),mI(d)}function Hs(e,t,n,r,i,a,o){for(var s=e,c=t,l=0,u=1/o,d=1;d<=o;d++){var f=d*u,p=Is(e,n,i,f),m=Is(t,r,a,f),h=p-s,g=m-c;l+=Math.sqrt(h*h+g*g),s=p,c=m}return l}function Us(e){var t=e&&SI.exec(e);if(t){var n=t[1].split(`,`),r=+no(n[0]),i=+no(n[1]),a=+no(n[2]),o=+no(n[3]);if(isNaN(r+i+a+o))return;var s=[];return function(e){return e<=0?0:e>=1?1:js(0,r,a,1,e,s)&&ks(0,i,o,1,s[0])}}}function Ws(e){return e=Math.round(e),e<0?0:e>255?255:e}function Gs(e){return e=Math.round(e),e<0?0:e>360?360:e}function Ks(e){return e<0?0:e>1?1:e}function qs(e){var t=e;return t.length&&t.charAt(t.length-1)===`%`?Ws(parseFloat(t)/100*255):Ws(parseInt(t,10))}function Js(e){var t=e;return t.length&&t.charAt(t.length-1)===`%`?Ks(parseFloat(t)/100):Ks(parseFloat(t))}function Ys(e,t,n){return n<0?n+=1:n>1&&--n,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function Xs(e,t,n){return e+(t-e)*n}function Zs(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function Qs(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function $s(e,t){EI&&Qs(EI,t),EI=TI.put(e,EI||t.slice())}function ec(e,t){if(e){t||=[];var n=TI.get(e);if(n)return Qs(t,n);e+=``;var r=e.replace(/ /g,``).toLowerCase();if(r in wI)return Qs(t,wI[r]),$s(e,t),t;var i=r.length;if(r.charAt(0)===`#`){if(i===4||i===5){var a=parseInt(r.slice(1,4),16);if(!(a>=0&&a<=4095)){Zs(t,0,0,0,1);return}return Zs(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(r.slice(4),16)/15:1),$s(e,t),t}if(i===7||i===9){var a=parseInt(r.slice(1,7),16);if(!(a>=0&&a<=16777215)){Zs(t,0,0,0,1);return}return Zs(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(r.slice(7),16)/255:1),$s(e,t),t}}else{var o=r.indexOf(`(`),s=r.indexOf(`)`);if(o!==-1&&s+1===i){var c=r.substr(0,o),l=r.substr(o+1,s-(o+1)).split(`,`),u=1;switch(c){case`rgba`:if(l.length!==4)return l.length===3?Zs(t,+l[0],+l[1],+l[2],1):Zs(t,0,0,0,1);u=Js(l.pop());case`rgb`:if(l.length>=3)return Zs(t,qs(l[0]),qs(l[1]),qs(l[2]),l.length===3?u:Js(l[3])),$s(e,t),t;Zs(t,0,0,0,1);return;case`hsla`:if(l.length!==4){Zs(t,0,0,0,1);return}return l[3]=Js(l[3]),tc(l,t),$s(e,t),t;case`hsl`:if(l.length!==3){Zs(t,0,0,0,1);return}return tc(l,t),$s(e,t),t;default:return}}Zs(t,0,0,0,1)}}}function tc(e,t){var n=(parseFloat(e[0])%360+360)%360/360,r=Js(e[1]),i=Js(e[2]),a=i<=.5?i*(r+1):i+r-i*r,o=i*2-a;return t||=[],Zs(t,Ws(Ys(o,a,n+1/3)*255),Ws(Ys(o,a,n)*255),Ws(Ys(o,a,n-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function nc(e){if(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s=(a+i)/2,c,l;if(o===0)c=0,l=0;else{l=s<.5?o/(a+i):o/(2-a-i);var u=((a-t)/6+o/2)/o,d=((a-n)/6+o/2)/o,f=((a-r)/6+o/2)/o;t===a?c=f-d:n===a?c=1/3+u-f:r===a&&(c=2/3+d-u),c<0&&(c+=1),c>1&&--c}var p=[c*360,l,s];return e[3]!=null&&p.push(e[3]),p}}function rc(e,t){var n=ec(e);if(n){for(var r=0;r<3;r++)t<0?n[r]=n[r]*(1-t)|0:n[r]=(255-n[r])*t+n[r]|0,n[r]>255?n[r]=255:n[r]<0&&(n[r]=0);return cc(n,n.length===4?`rgba`:`rgb`)}}function ic(e,t,n){if(t&&t.length&&e>=0&&e<=1){n||=[];var r=e*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=t[i],s=t[a],c=r-i;return n[0]=Ws(Xs(o[0],s[0],c)),n[1]=Ws(Xs(o[1],s[1],c)),n[2]=Ws(Xs(o[2],s[2],c)),n[3]=Ks(Xs(o[3],s[3],c)),n}}function ac(e,t,n){if(t&&t.length&&e>=0&&e<=1){var r=e*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=ec(t[i]),s=ec(t[a]),c=r-i,l=cc([Ws(Xs(o[0],s[0],c)),Ws(Xs(o[1],s[1],c)),Ws(Xs(o[2],s[2],c)),Ks(Xs(o[3],s[3],c))],`rgba`);return n?{color:l,leftIndex:i,rightIndex:a,value:r}:l}}function oc(e,t,n,r){var i=ec(e);if(e)return i=nc(i),t!=null&&(i[0]=Gs(B(t)?t(i[0]):t)),n!=null&&(i[1]=Js(B(n)?n(i[1]):n)),r!=null&&(i[2]=Js(B(r)?r(i[2]):r)),cc(tc(i),`rgba`)}function sc(e,t){var n=ec(e);if(n&&t!=null)return n[3]=Ks(t),cc(n,`rgba`)}function cc(e,t){if(e&&e.length){var n=e[0]+`,`+e[1]+`,`+e[2];return(t===`rgba`||t===`hsva`||t===`hsla`)&&(n+=`,`+e[3]),t+`(`+n+`)`}}function lc(e,t){var n=ec(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}function uc(e){if(V(e)){var t=DI.get(e);return t||(t=rc(e,-.1),DI.put(e,t)),t}if(Ja(e)){var n=I({},e);return n.colorStops=R(e.colorStops,function(e){return{offset:e.offset,color:rc(e.color,-.1)}}),n}return e}function dc(e){var t;if(!e||e===`transparent`)e=`none`;else if(typeof e==`string`&&e.indexOf(`rgba`)>-1){var n=ec(e);n&&(e=`rgb(`+n[0]+`,`+n[1]+`,`+n[2]+`)`,t=n[3])}return{color:e,opacity:t??1}}function fc(e){return e<kI&&e>-kI}function pc(e){return OI(e*1e3)/1e3}function mc(e){return OI(e*1e4)/1e4}function hc(e){return`matrix(`+pc(e[0])+`,`+pc(e[1])+`,`+pc(e[2])+`,`+pc(e[3])+`,`+mc(e[4])+`,`+mc(e[5])+`)`}function gc(e,t,n){return n===`top`?e+=t/2:n===`bottom`&&(e-=t/2),e}function _c(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function vc(e){var t=e.style,n=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(`,`)}function yc(e){return e&&!!e.image}function bc(e){return e&&!!e.svgElement}function xc(e){return yc(e)||bc(e)}function Sc(e){return e.type===`linear`}function Cc(e){return e.type===`radial`}function wc(e){return e&&(e.type===`linear`||e.type===`radial`)}function Tc(e){return`url(#`+e+`)`}function Ec(e){var t=e.getGlobalScale(),n=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function Dc(e){var t=e.x||0,n=e.y||0,r=(e.rotation||0)*lF,i=U(e.scaleX,1),a=U(e.scaleY,1),o=e.skewX||0,s=e.skewY||0,c=[];return(t||n)&&c.push(`translate(`+t+`px,`+n+`px)`),r&&c.push(`rotate(`+r+`)`),(i!==1||a!==1)&&c.push(`scale(`+i+`,`+a+`)`),(o||s)&&c.push(`skew(`+OI(o*lF)+`deg, `+OI(s*lF)+`deg)`),c.join(` `)}function Oc(e,t,n){return(t-e)*n+e}function kc(e,t,n,r){for(var i=t.length,a=0;a<i;a++)e[a]=Oc(t[a],n[a],r);return e}function Ac(e,t,n,r){for(var i=t.length,a=i&&t[0].length,o=0;o<i;o++){e[o]||(e[o]=[]);for(var s=0;s<a;s++)e[o][s]=Oc(t[o][s],n[o][s],r)}return e}function jc(e,t,n,r){for(var i=t.length,a=0;a<i;a++)e[a]=t[a]+n[a]*r;return e}function Mc(e,t,n,r){for(var i=t.length,a=i&&t[0].length,o=0;o<i;o++){e[o]||(e[o]=[]);for(var s=0;s<a;s++)e[o][s]=t[o][s]+n[o][s]*r}return e}function Nc(e,t){for(var n=e.length,r=t.length,i=n>r?t:e,a=Math.min(n,r),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;s<Math.max(n,r);s++)i.push({offset:o.offset,color:o.color.slice()})}function Pc(e,t,n){var r=e,i=t;if(r.push&&i.push){var a=r.length,o=i.length;if(a!==o){if(a>o)r.length=o;else for(var s=a;s<o;s++)r.push(n===1?i[s]:MI.call(i[s]))}for(var c=r[0]&&r[0].length,s=0;s<r.length;s++)if(n===1)isNaN(r[s])&&(r[s]=i[s]);else for(var l=0;l<c;l++)isNaN(r[s][l])&&(r[s][l]=i[s][l])}}function Fc(e){if(Ia(e)){var t=e.length;if(Ia(e[0])){for(var n=[],r=0;r<t;r++)n.push(MI.call(e[r]));return n}return MI.call(e)}return e}function Ic(e){return e[0]=Math.floor(e[0])||0,e[1]=Math.floor(e[1])||0,e[2]=Math.floor(e[2])||0,e[3]=e[3]==null?1:e[3],`rgba(`+e.join(`,`)+`)`}function Lc(e){return Ia(e&&e[0])?2:1}function Rc(e){return e===LI||e===RI}function zc(e){return e===PI||e===FI}function Bc(e,t,n,r,i){n||={};var a=[];Kc(e,``,e,t,n,r,a,i);var o=a.length,s=!1,c=n.done,l=n.aborted,u=function(){s=!0,o--,o<=0&&(s?c&&c():l&&l())},d=function(){o--,o<=0&&(s?c&&c():l&&l())};o||c&&c(),a.length>0&&n.during&&a[0].during(function(e,t){n.during(t)});for(var f=0;f<a.length;f++){var p=a[f];u&&p.done(u),d&&p.aborted(d),n.force&&p.duration(n.duration),p.start(n.easing)}return a}function Vc(e,t,n){for(var r=0;r<n;r++)e[r]=t[r]}function Hc(e){return Ia(e[0])}function Uc(e,t,n){if(Ia(t[n])){if(Ia(e[n])||(e[n]=[]),Ka(t[n])){var r=t[n].length;e[n].length!==r&&(e[n]=new t[n].constructor(r),Vc(e[n],t[n],r))}else{var i=t[n],a=e[n],o=i.length;if(Hc(i))for(var s=i[0].length,c=0;c<o;c++)a[c]?Vc(a[c],i[c],s):a[c]=Array.prototype.slice.call(i[c]);else Vc(a,i,o);a.length=i.length}}else e[n]=t[n]}function Wc(e,t){return e===t||Ia(e)&&Ia(t)&&Gc(e,t)}function Gc(e,t){var n=e.length;if(n!==t.length)return!1;for(var r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Kc(e,t,n,r,i,a,o,s){for(var c=Ba(r),l=i.duration,u=i.delay,d=i.additive,f=i.setToFinal,p=!H(a),m=e.animators,h=[],g=0;g<c.length;g++){var _=c[g],v=r[_];if(v!=null&&n[_]!=null&&(p||a[_])){if(H(v)&&!Ia(v)&&!Ja(v)){if(t){s||(n[_]=v,e.updateDuringAnimation(t));continue}Kc(e,_,n[_],v,i,a&&a[_],o,s)}else h.push(_)}else s||(n[_]=v,e.updateDuringAnimation(t),h.push(_))}var y=h.length;if(!d&&y)for(var b=0;b<m.length;b++){var x=m[b];if(x.targetName===t&&x.stopTracks(h)){var S=Na(m,x);m.splice(S,1)}}if(i.force||(h=Ra(h,function(e){return!Wc(r[e],n[e])}),y=h.length),y>0||i.force&&!o.length){var C=void 0,w=void 0,T=void 0;if(s){w={},f&&(C={});for(var b=0;b<y;b++){var _=h[b];w[_]=n[_],f?C[_]=r[_]:n[_]=r[_]}}else if(f){T={};for(var b=0;b<y;b++){var _=h[b];T[_]=Fc(n[_]),Uc(n,r,_)}}var x=new HI(n,!1,!1,d?Ra(m,function(e){return e.targetName===t}):null);x.targetName=t,i.scope&&(x.scope=i.scope),f&&C&&x.whenWithKeys(0,C,h),T&&x.whenWithKeys(0,T,h),x.whenWithKeys(l??500,s?w:r,h).delay(u||0),e.addAnimator(x,t),o.push(x)}}function qc(e,t,n,r){return!(n&&n.hoverLayer||r)||Jc(e)||t&&Jc(t)?0:1}function Jc(e){return e.type===`text`||e.type===`tspan`}function Yc(e,t,n){return!t&&!e.__inHover&&n&&n.duration>0}function Xc(e,t,n){return lL.copy(e.getBoundingRect()),e.transform&&lL.applyTransform(e.transform),uL.width=t,uL.height=n,!lL.intersect(uL)}function Zc(e,t,n,r,i,a){i[0]=dL(e,n),i[1]=dL(t,r),a[0]=fL(e,n),a[1]=fL(t,r)}function Qc(e,t,n,r,i,a,o,s,c,l){var u=Ms,d=ks,f=u(e,n,i,o,yL);c[0]=1/0,c[1]=1/0,l[0]=-1/0,l[1]=-1/0;for(var p=0;p<f;p++){var m=d(e,n,i,o,yL[p]);c[0]=dL(m,c[0]),l[0]=fL(m,l[0])}f=u(t,r,a,s,bL);for(var p=0;p<f;p++){var h=d(t,r,a,s,bL[p]);c[1]=dL(h,c[1]),l[1]=fL(h,l[1])}c[0]=dL(e,c[0]),l[0]=fL(e,l[0]),c[0]=dL(o,c[0]),l[0]=fL(o,l[0]),c[1]=dL(t,c[1]),l[1]=fL(t,l[1]),c[1]=dL(s,c[1]),l[1]=fL(s,l[1])}function $c(e,t,n,r,i,a,o,s){var c=zs,l=Is,u=fL(dL(c(e,n,i),1),0),d=fL(dL(c(t,r,a),1),0),f=l(e,n,i,u),p=l(t,r,a,d);o[0]=dL(e,i,f),o[1]=dL(t,a,p),s[0]=fL(e,i,f),s[1]=fL(t,a,p)}function el(e,t,n,r,i,a,o,s,c){var l=Jo,u=Yo,d=Math.abs(i-a);if(d%hL<1e-4&&d>1e-4)s[0]=e-n,s[1]=t-r,c[0]=e+n,c[1]=t+r;else{if(gL[0]=mL(i)*n+e,gL[1]=pL(i)*r+t,_L[0]=mL(a)*n+e,_L[1]=pL(a)*r+t,l(s,gL,_L),u(c,gL,_L),i%=hL,i<0&&(i+=hL),a%=hL,a<0&&(a+=hL),i>a&&!o?a+=hL:i<a&&o&&(i+=hL),o){var f=a;a=i,i=f}for(var p=0;p<a;p+=Math.PI/2)p>i&&(vL[0]=mL(p)*n+e,vL[1]=pL(p)*r+t,l(s,vL,s),u(c,vL,c))}}function tl(e){return Math.round(e/NL*1e8)/1e8%2*NL}function nl(e,t){var n=tl(e[0]);n<0&&(n+=PL);var r=n-e[0],i=e[1];i+=r,!t&&i-n>=PL?i=n+PL:t&&n-i>=PL?i=n-PL:!t&&n>i?i=n+(PL-tl(n-i)):t&&n<i&&(i=n-(PL-tl(i-n))),e[0]=n,e[1]=i}function rl(e,t,n,r,i,a,o){if(i===0)return!1;var s=i,c=0,l=e;if(o>t+s&&o>r+s||o<t-s&&o<r-s||a>e+s&&a>n+s||a<e-s&&a<n-s)return!1;if(e!==n)c=(t-r)/(e-n),l=(e*r-n*t)/(e-n);else return Math.abs(a-e)<=s/2;var u=c*a-o+l;return u*u/(c*c+1)<=s/2*s/2}function il(e,t,n,r,i,a,o,s,c,l,u){if(c===0)return!1;var d=c;return u>t+d&&u>r+d&&u>a+d&&u>s+d||u<t-d&&u<r-d&&u<a-d&&u<s-d||l>e+d&&l>n+d&&l>i+d&&l>o+d||l<e-d&&l<n-d&&l<i-d&&l<o-d?!1:Ps(e,t,n,r,i,a,o,s,l,u,null)<=d/2}function al(e,t,n,r,i,a,o,s,c){if(o===0)return!1;var l=o;return c>t+l&&c>r+l&&c>a+l||c<t-l&&c<r-l&&c<a-l||s>e+l&&s>n+l&&s>i+l||s<e-l&&s<n-l&&s<i-l?!1:Vs(e,t,n,r,i,a,s,c,null)<=l/2}function ol(e){return e%=RL,e<0&&(e+=RL),e}function sl(e,t,n,r,i,a,o,s,c){if(o===0)return!1;var l=o;s-=e,c-=t;var u=Math.sqrt(s*s+c*c);if(u-l>n||u+l<n)return!1;if(Math.abs(r-i)%zL<1e-4)return!0;if(a){var d=r;r=ol(i),i=ol(d)}else r=ol(r),i=ol(i);r>i&&(i+=zL);var f=Math.atan2(c,s);return f<0&&(f+=zL),f>=r&&f<=i||f+zL>=r&&f+zL<=i}function cl(e,t,n,r,i,a){if(a>t&&a>r||a<t&&a<r||r===t)return 0;var o=(a-t)/(r-t),s=r<t?1:-1;(o===1||o===0)&&(s=r<t?.5:-.5);var c=o*(n-e)+e;return c===i?1/0:c>i?s:0}function ll(e,t){return Math.abs(e-t)<HL}function ul(){var e=WL[0];WL[0]=WL[1],WL[1]=e}function dl(e,t,n,r,i,a,o,s,c,l){if(l>t&&l>r&&l>a&&l>s||l<t&&l<r&&l<a&&l<s)return 0;var u=js(t,r,a,s,l,UL);if(u===0)return 0;for(var d=0,f=-1,p=void 0,m=void 0,h=0;h<u;h++){var g=UL[h],_=g===0||g===1?.5:1;ks(e,n,i,o,g)<c||(f<0&&(f=Ms(t,r,a,s,WL),WL[1]<WL[0]&&f>1&&ul(),p=ks(t,r,a,s,WL[0]),f>1&&(m=ks(t,r,a,s,WL[1]))),f===2?g<WL[0]?d+=p<t?_:-_:g<WL[1]?d+=m<p?_:-_:d+=s<m?_:-_:g<WL[0]?d+=p<t?_:-_:d+=s<p?_:-_)}return d}function fl(e,t,n,r,i,a,o,s){if(s>t&&s>r&&s>a||s<t&&s<r&&s<a)return 0;var c=Rs(t,r,a,s,UL);if(c===0)return 0;var l=zs(t,r,a);if(l>=0&&l<=1){for(var u=0,d=Is(t,r,a,l),f=0;f<c;f++){var p=UL[f]===0||UL[f]===1?.5:1,m=Is(e,n,i,UL[f]);m<o||(UL[f]<l?u+=d<t?p:-p:u+=a<d?p:-p)}return u}var p=UL[0]===0||UL[0]===1?.5:1,m=Is(e,n,i,UL[0]);return m<o?0:a<t?p:-p}function pl(e,t,n,r,i,a,o,s){if(s-=t,s>n||s<-n)return 0;var c=Math.sqrt(n*n-s*s);UL[0]=-c,UL[1]=c;var l=Math.abs(r-i);if(l<1e-4)return 0;if(l>=VL-1e-4){r=0,i=VL;var u=a?1:-1;return o>=UL[0]+e&&o<=UL[1]+e?u:0}if(r>i){var d=r;r=i,i=d}r<0&&(r+=VL,i+=VL);for(var f=0,p=0;p<2;p++){var m=UL[p];if(m+e>o){var h=Math.atan2(s,m),u=a?1:-1;h<0&&(h=VL+h),(h>=r&&h<=i||h+VL>=r&&h+VL<=i)&&(h>Math.PI/2&&h<Math.PI*1.5&&(u=-u),f+=u)}}return f}function ml(e,t,n,r,i){for(var a=e.data,o=e.len(),s=0,c=0,l=0,u=0,d=0,f,p,m=0;m<o;){var h=a[m++],g=m===1;switch(h===BL.M&&m>1&&(n||(s+=cl(c,l,u,d,r,i))),g&&(c=a[m],l=a[m+1],u=c,d=l),h){case BL.M:u=a[m++],d=a[m++],c=u,l=d;break;case BL.L:if(n){if(rl(c,l,a[m],a[m+1],t,r,i))return!0}else s+=cl(c,l,a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case BL.C:if(n){if(il(c,l,a[m++],a[m++],a[m++],a[m++],a[m],a[m+1],t,r,i))return!0}else s+=dl(c,l,a[m++],a[m++],a[m++],a[m++],a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case BL.Q:if(n){if(al(c,l,a[m++],a[m++],a[m],a[m+1],t,r,i))return!0}else s+=fl(c,l,a[m++],a[m++],a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case BL.A:var _=a[m++],v=a[m++],y=a[m++],b=a[m++],x=a[m++],S=a[m++];m+=1;var C=!!(1-a[m++]);f=Math.cos(x)*y+_,p=Math.sin(x)*b+v,g?(u=f,d=p):s+=cl(c,l,f,p,r,i);var w=(r-_)*b/y+_;if(n){if(sl(_,v,b,x,x+S,C,t,w,i))return!0}else s+=pl(_,v,b,x,x+S,C,w,i);c=Math.cos(x+S)*y+_,l=Math.sin(x+S)*b+v;break;case BL.R:u=c=a[m++],d=l=a[m++];var T=a[m++],E=a[m++];if(f=u+T,p=d+E,n){if(rl(u,d,f,d,t,r,i)||rl(f,d,f,p,t,r,i)||rl(f,p,u,p,t,r,i)||rl(u,p,u,d,t,r,i))return!0}else s+=cl(f,d,f,p,r,i),s+=cl(u,p,u,d,r,i);break;case BL.Z:if(n){if(rl(c,l,u,d,t,r,i))return!0}else s+=cl(c,l,u,d,r,i);c=u,l=d}}return!n&&!ll(l,d)&&(s+=cl(c,l,u,d,r,i)||0),s!==0}function hl(e,t,n){return ml(e,0,!1,t,n)}function gl(e,t,n,r){return ml(e,t,!0,n,r)}function _l(e){return!!(e&&typeof e!=`string`&&e.width&&e.height)}function vl(e,t){var n=t.x,r=t.y,i=t.width,a=t.height,o=t.r,s,c,l,u;i<0&&(n+=i,i=-i),a<0&&(r+=a,a=-a),typeof o==`number`?s=c=l=u=o:o instanceof Array?o.length===1?s=c=l=u=o[0]:o.length===2?(s=l=o[0],c=u=o[1]):o.length===3?(s=o[0],c=u=o[1],l=o[2]):(s=o[0],c=o[1],l=o[2],u=o[3]):s=c=l=u=0;var d;s+c>i&&(d=s+c,s*=i/d,c*=i/d),l+u>i&&(d=l+u,l*=i/d,u*=i/d),c+l>a&&(d=c+l,c*=a/d,l*=a/d),s+u>a&&(d=s+u,s*=a/d,u*=a/d),e.moveTo(n+s,r),e.lineTo(n+i-c,r),c!==0&&e.arc(n+i-c,r+c,c,-Math.PI/2,0),e.lineTo(n+i,r+a-l),l!==0&&e.arc(n+i-l,r+a-l,l,0,Math.PI/2),e.lineTo(n+u,r+a),u!==0&&e.arc(n+u,r+a-u,u,Math.PI/2,Math.PI),e.lineTo(n,r+s),s!==0&&e.arc(n+s,r+s,s,Math.PI,Math.PI*1.5),e.closePath()}function yl(e,t,n){if(t){var r=t.x1,i=t.x2,a=t.y1,o=t.y2;e.x1=r,e.x2=i,e.y1=a,e.y2=o;var s=n&&n.lineWidth;return s&&(eR(r*2)===eR(i*2)&&(e.x1=e.x2=xl(r,s,!0)),eR(a*2)===eR(o*2)&&(e.y1=e.y2=xl(a,s,!0))),e}}function bl(e,t,n){if(t){var r=t.x,i=t.y,a=t.width,o=t.height;e.x=r,e.y=i,e.width=a,e.height=o;var s=n&&n.lineWidth;return s&&(e.x=xl(r,s,!0),e.y=xl(i,s,!0),e.width=Math.max(xl(r+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(xl(i+o,s,!1)-e.y,o===0?0:1)),e}}function xl(e,t,n){if(!t)return e;var r=eR(e*2);return(r+eR(t))%2==0?r/2:(r+(n?1:-1))/2}function Sl(e){return typeof e==`string`&&(e.indexOf(`px`)!==-1||e.indexOf(`rem`)!==-1||e.indexOf(`em`)!==-1)?e:isNaN(+e)?`12px`:e+`px`}function Cl(e,t){for(var n=0;n<dR.length;n++){var r=dR[n],i=t[r];i!=null&&(e[r]=i)}}function wl(e){return e.fontSize!=null||e.fontFamily||e.fontWeight}function Tl(e){return El(e),L(e.rich,El),e}function El(e){if(e){e.font=cR.makeFont(e);var t=e.align;t===`middle`&&(t=`center`),e.align=t==null||lR[t]?t:`left`;var n=e.verticalAlign;n===`center`&&(n=`middle`),e.verticalAlign=n==null||uR[n]?n:`top`,e.padding&&=eo(e.padding)}}function Dl(e,t){return e==null||t<=0||e===`transparent`||e===`none`?null:e.image||e.colorStops?`#000`:e}function Ol(e){return e==null||e===`none`?null:e.image||e.colorStops?`#000`:e}function kl(e,t,n){return t===`right`?e-n[1]:t===`center`?e+n[3]/2-n[1]/2:e+n[3]}function Al(e){var t=e.text;return t!=null&&(t+=``),t}function jl(e){return!!(e.backgroundColor||e.lineHeight||e.borderWidth&&e.borderColor)}function Ml(e){return e.replace(/^\s+|\s+$/g,``)}function Nl(e,t,n,r){var i=t[0],a=t[1],o=n[0],s=n[1],c=a-i,l=s-o;if(c===0)return l===0?o:(o+s)/2;if(r){if(c>0){if(e<=i)return o;if(e>=a)return s}else if(e>=i)return o;else if(e<=a)return s}else{if(e===i)return o;if(e===a)return s}return(e-i)/c*l+o}function Pl(e,t,n){switch(e){case`center`:case`middle`:e=`50%`;break;case`left`:case`top`:e=`0%`;break;case`right`:case`bottom`:e=`100%`}return Fl(e,t,n)}function Fl(e,t,n){return V(e)?Ll(e)?parseFloat(e)/100*t+(n||0):parseFloat(e):e==null?NaN:+e}function Il(e){return V(e)&&Ll(e)}function Ll(e){return!!Ml(e).match(/%$/)}function Rl(e,t,n){return isNaN(t)?n?``+e:+e:(t=mR(hR(0,t),pR),e=(+e).toFixed(t),n?e:+e)}function zl(e){return e.sort(function(e,t){return e-t}),e}function Bl(e){if(e=+e,isNaN(e))return 0;if(e>1e-14){for(var t=1,n=0;n<15;n++,t*=10)if(_R(e*t)/t===e)return n}return Vl(e)}function Vl(e){var t=e.toString().toLowerCase(),n=t.indexOf(`e`),r=n>0?+t.slice(n+1):0,i=n>0?n:t.length,a=t.indexOf(`.`);return hR(0,(a<0?0:i-1-a)-r)}function Hl(e,t,n){var r=gR(e[1]-e[0]);if(!isFinite(r)||r===0)return NaN;var i=xR(2*gR(n||1)*gR(r))/SR,a=xR(gR(t))/SR,o=hR(0,yR(-i+a));return isFinite(o)||(o=NaN),o}function Ul(e,t){var n=La(e,function(e,t){return e+(isNaN(t)?0:t)},0);if(n===0)return[];for(var r=bR(10,t),i=R(e,function(e){return(isNaN(e)?0:e)/n*r*100}),a=r*100,o=R(i,function(e){return vR(e)}),s=La(o,function(e,t){return e+t},0),c=R(i,function(e,t){return e-o[t]});s<a;){for(var l=-1/0,u=null,d=0,f=c.length;d<f;++d)c[d]>l&&(l=c[d],u=d);++o[u],c[u]=0,++s}return R(o,function(e){return e/r})}function Wl(e,t){var n=hR(Bl(e),Bl(t)),r=e+t;return n>pR?r:Rl(r,n)}function Gl(e){var t=CR*2;return(e%t+t)%t}function Kl(e){return e>-fR&&e<fR}function ql(e){if(e instanceof Date)return e;if(V(e)){var t=ER.exec(e);if(!t)return new Date(NaN);if(t[8]){var n=+t[4]||0;return t[8].toUpperCase()!==`Z`&&(n-=+t[8].slice(0,3)),new Date(Date.UTC(+t[1],(t[2]||1)-1,+t[3]||1,n,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0))}return new Date(+t[1],(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,t[7]?+t[7].substring(0,3):0)}return e==null?new Date(NaN):new Date(_R(e))}function Jl(e){return bR(10,Yl(e))}function Yl(e){if(e===0)return 0;var t=vR(xR(e)/SR);return e/bR(10,t)>=10&&t++,t}function Xl(e,t){var n=Yl(e),r=bR(10,n),i=e/r;return e=(t===2?1:t?i<1.5?1:i<2.5?2:i<4?3:i<7?5:10:i<1?1:i<2?2:i<3?3:i<5?5:10)*r,Rl(e,-n)}function Zl(e){e.sort(function(e,t){return s(e,t,0)?-1:1});for(var t=-1/0,n=1,r=0;r<e.length;){for(var i=e[r].interval,a=e[r].close,o=0;o<2;o++)i[o]<=t&&(i[o]=t,a[o]=o?1:1-n),t=i[o],n=a[o];i[0]===i[1]&&a[0]*a[1]!==1?e.splice(r,1):r++}return e;function s(e,t,n){return e.interval[n]<t.interval[n]||e.interval[n]===t.interval[n]&&(e.close[n]-t.close[n]===(n?-1:1)||!n&&s(e,t,1))}}function Ql(e){var t=parseFloat(e);return t==e&&(t!==0||!V(e)||e.indexOf(`x`)<=0)?t:NaN}function $l(e){return!isNaN(Ql(e))}function eu(){return _R(wR()*9)}function tu(e,t){return t===0?e:tu(t,e%t)}function nu(e,t){return e==null?t:t==null?e:e*t/tu(e,t)}function ru(e){return e!=null&&isFinite(e)}function iu(e,t,n){if(kR){if(n){if(OR[t])return;OR[t]=!0}console[e](DR+t)}}function au(e,t){iu(`error`,e,t)}function ou(e){throw Error(e)}function su(e,t,n){return(t-e)*n+e}function cu(e){return e instanceof Array?e:e==null?[]:[e]}function lu(e,t,n){if(e){e[t]=e[t]||{},e.emphasis=e.emphasis||{},e.emphasis[t]=e.emphasis[t]||{};for(var r=0,i=n.length;r<i;r++){var a=n[r];!e.emphasis[t].hasOwnProperty(a)&&e[t].hasOwnProperty(a)&&(e.emphasis[t][a]=e[t][a])}}}function uu(e){return H(e)&&!z(e)&&!(e instanceof Date)?e.value:e}function du(e){return H(e)&&!(e instanceof Array)}function fu(e,t,n){var r=n===`normalMerge`,i=n===`replaceMerge`,a=n===`replaceAll`;e||=[],t=(t||[]).slice();var o=W();L(t,function(e,n){H(e)||(t[n]=null)});var s=pu(e,o,n);return(r||i)&&mu(s,e,o,t),r&&hu(s,t),r||i?gu(s,t,i):a&&_u(s,t),vu(s),s}function pu(e,t,n){var r=[];if(n===`replaceAll`)return r;for(var i=0;i<e.length;i++){var a=e[i];a&&a.id!=null&&t.set(a.id,i),r.push({existing:n===`replaceMerge`||Cu(a)?null:a,newOption:null,keyInfo:null,brandNew:null})}return r}function mu(e,t,n,r){L(r,function(i,a){if(i&&i.id!=null){var o=bu(i.id),s=n.get(o);if(s!=null){var c=e[s];to(!c.newOption,`Duplicated option on id "`+o+`".`),c.newOption=i,c.existing=t[s],r[a]=null}}})}function hu(e,t){L(t,function(n,r){if(n&&n.name!=null)for(var i=0;i<e.length;i++){var a=e[i].existing;if(!e[i].newOption&&a&&(a.id==null||n.id==null)&&!Cu(n)&&!Cu(a)&&yu(`name`,a,n)){e[i].newOption=n,t[r]=null;return}}})}function gu(e,t,n){L(t,function(t){if(t){for(var r,i=0;(r=e[i])&&(r.newOption||Cu(r.existing)||r.existing&&t.id!=null&&!yu(`id`,t,r.existing));)i++;r?(r.newOption=t,r.brandNew=n):e.push({newOption:t,brandNew:n,existing:null,keyInfo:null}),i++}})}function _u(e,t){L(t,function(t){e.push({newOption:t,brandNew:!0,existing:null,keyInfo:null})})}function vu(e){var t=W();L(e,function(e){var n=e.existing;n&&t.set(n.id,e)}),L(e,function(e){var n=e.newOption;to(!n||n.id==null||!t.get(n.id)||t.get(n.id)===e,`id duplicates: `+(n&&n.id)),n&&n.id!=null&&t.set(n.id,e),!e.keyInfo&&(e.keyInfo={})}),L(e,function(e,n){var r=e.existing,i=e.newOption,a=e.keyInfo;if(H(i)){if(a.name=i.name==null?r?r.name:AR+n:bu(i.name),r)a.id=bu(r.id);else if(i.id!=null)a.id=bu(i.id);else{var o=0;do a.id=`\0`+a.name+`\0`+o++;while(t.get(a.id))}t.set(a.id,e)}})}function yu(e,t,n){var r=xu(t[e],null),i=xu(n[e],null);return r!=null&&i!=null&&r===i}function bu(e){return xu(e,``)}function xu(e,t){return e==null?t:V(e)?e:Wa(e)||Ua(e)?e+``:t}function Su(e){var t=e.name;return!!(t&&t.indexOf(AR))}function Cu(e){return e&&e.id!=null&&bu(e.id).indexOf(jR)===0}function wu(e,t,n){L(e,function(e){var r=e.newOption;H(r)&&(e.keyInfo.mainType=t,e.keyInfo.subType=Tu(t,r,e.existing,n))})}function Tu(e,t,n,r){return t.type?t.type:n?n.subType:r.determineSubType(e,t)}function Eu(e,t){if(t.dataIndexInside!=null)return t.dataIndexInside;if(t.dataIndex!=null)return z(t.dataIndex)?R(t.dataIndex,function(t){return e.indexOfRawIndex(t)}):e.indexOfRawIndex(t.dataIndex);if(t.name!=null)return z(t.name)?R(t.name,function(t){return e.indexOfName(t)}):e.indexOfName(t.name)}function Du(){var e=`__ec_inner_`+NR++;return function(t){return t[e]||(t[e]={})}}function Ou(e,t,n){var r=ku(t,n),i=r.mainTypeSpecified,a=r.queryOptionMap,o=r.others,s=n?n.defaultMainType:null;return!i&&s&&a.set(s,{}),a.each(function(t,r){var i=Au(e,r,t,{useDefault:s===r,enableAll:n&&n.enableAll!=null?n.enableAll:!0,enableNone:n&&n.enableNone!=null?n.enableNone:!0});o[r+`Models`]=i.models,o[r+`Model`]=i.models[0]}),o}function ku(e,t){var n;if(V(e)){var r={};r[e+`Index`]=0,n=r}else n=e;var i=W(),a={},o=!1;return L(n,function(e,n){if(n===`dataIndex`||n===`dataIndexInside`)a[n]=e;else{var r=n.match(/^(\w+)(Index|Id|Name)$/)||[],s=r[1],c=(r[2]||``).toLowerCase();if(!(!s||!c||t&&t.includeMainTypes&&Na(t.includeMainTypes,s)<0)){o||=!!s;var l=i.get(s)||i.set(s,{});l[c]=e}}}),{mainTypeSpecified:o,queryOptionMap:i,others:a}}function Au(e,t,n,r){r||=PR;var i=n.index,a=n.id,o=n.name,s={models:null,specified:i!=null||a!=null||o!=null};if(!s.specified){var c=void 0;return s.models=r.useDefault&&(c=e.getComponent(t))?[c]:[],s}if(i===`none`||i===!1){if(r.enableNone)return s.models=[],s;i=-1}return i===`all`&&(i=r.enableAll?a=o=null:-1),s.models=e.queryComponents({mainType:t,index:i,id:a,name:o}),s}function ju(e,t,n){var r={};r[t+`Id`]=e[t+`Id`],r[t+`Index`]=e[t+`Index`],r[t+`Name`]=e[t+`Name`];var i={mainType:t,query:r};return n&&(i.subType=n),i}function Mu(e,t,n){e.setAttribute?e.setAttribute(t,n):e[t]=n}function Nu(e,t){return e.getAttribute?e.getAttribute(t):e[t]}function Pu(e){return e===`auto`?dF.domSupported?`html`:`richText`:e||`html`}function Fu(e,t){var n=W(),r=[];return L(e,function(e){var i=t(e);(n.get(i)||(r.push(i),n.set(i,[]))).push(e)}),{keys:r,buckets:n}}function Iu(e,t,n,r,i){var a=t==null||t===`auto`;if(r==null)return r;if(Wa(r)){var o=su(n||0,r,i);return Rl(o,a?Math.max(Bl(n||0),Bl(r)):t)}if(V(r))return i<1?n:r;for(var s=[],c=n,l=r,u=Math.max(c?c.length:0,l.length),d=0;d<u;++d){var f=e.getDimensionInfo(d);if(f&&f.type===`ordinal`)s[d]=(i<1&&c?c:l)[d];else{var p=c&&c[d]?c[d]:0,m=l[d],o=su(p,m,i);s[d]=Rl(o,a?Math.max(Bl(p),Bl(m)):t)}}return s}function Lu(){return[1/0,-1/0]}function Ru(e,t){Hu(t)&&(t<e[0]&&(e[0]=t),t>e[1]&&(e[1]=t))}function zu(e,t){Hu(t)&&t<e[0]&&(e[0]=t)}function Bu(e,t){Hu(t)&&t>e[1]&&(e[1]=t)}function Vu(e,t){Uu(t[0],t[1])&&(t[0]<e[0]&&(e[0]=t[0]),t[1]>e[1]&&(e[1]=t[1]))}function Hu(e){return e!=null&&isFinite(e)}function Uu(e,t){return Hu(e)&&Hu(t)&&e<=t}function Wu(e){var t=e[1]-e[0];return isFinite(t)&&t>=0}function Gu(e){Uu(e[0],e[1])&&e[0]>e[1]&&(e[0]=e[1])}function Ku(){var e=`__ec_once_`+IR++;return function(t,n){so(t,e)||(t[e]=1,n())}}function qu(e,t,n){var r=W(),i=0;L(e,function(a){var o=t(a),s=r.get(o)||0;n&&n(a,s),!s&&!n&&(e[i++]=a),r.set(o,s+1)}),n||(e.length=i)}function Ju(e){return e.value+``}function Yu(e){return e+``}function Xu(e,t){return U(t,!0)?e.seriesIndex+2:0}function Zu(e,t,n){var r=e.getData().count();return{progressiveRender:n.progressiveEnabled&&t.incrementalPrepareRender&&r>=n.threshold,large:e.get(`large`)&&r>=e.get(`largeThreshold`),modDataCount:e.get(`progressiveChunkMode`)===`mod`?e.getData().count():null}}function Qu(e,t){return{seriesType:e,overallReset:t}}function $u(e){return{overallReset:e}}function ed(e,t){return t.mainType===`series`?e.getViewOfSeriesModel(t):e.getViewOfComponentModel(t)}function td(e){return e!=null&&e!==`none`}function nd(e,t,n){e.onHoverStateChange&&(e.hoverState||0)!==n&&e.onHoverStateChange(t),e.hoverState=n}function rd(e){nd(e,`emphasis`,2)}function id(e){e.hoverState===2&&nd(e,`normal`,0)}function ad(e){nd(e,`blur`,1)}function od(e){e.hoverState===1&&nd(e,`normal`,0)}function sd(e){e.selected=!0}function cd(e){e.selected=!1}function ld(e,t,n){t(e,n)}function ud(e,t,n){ld(e,t,n),e.isGroup&&e.traverse(function(e){ld(e,t,n)})}function dd(e,t){switch(t){case`emphasis`:e.hoverState=2;break;case`normal`:e.hoverState=0;break;case`blur`:e.hoverState=1;break;case`select`:e.selected=!0}}function fd(e,t,n,r){for(var i=e.style,a={},o=0;o<t.length;o++){var s=t[o];a[s]=i[s]??(r&&r[s])}for(var o=0;o<e.animators.length;o++){var c=e.animators[o];c.__fromStateTransition&&c.__fromStateTransition.indexOf(n)<0&&c.targetName===`style`&&c.saveTo(a,t)}return a}function pd(e,t,n,r){var i=n&&Na(n,`select`)>=0,a=!1;if(e instanceof JL){var o=$R(e),s=i&&o.selectFill||o.normalFill,c=i&&o.selectStroke||o.normalStroke;if(td(s)||td(c)){r||={};var l=r.style||{};l.fill===`inherit`?(a=!0,r=I({},r),l=I({},l),l.fill=s):!td(l.fill)&&td(s)?(a=!0,r=I({},r),l=I({},l),l.fill=uc(s)):!td(l.stroke)&&td(c)&&(a||(r=I({},r),l=I({},l)),l.stroke=uc(c)),r.style=l}}if(r&&r.z2==null){a||(r=I({},r));var u=e.z2EmphasisLift;r.z2=e.z2+(u??10)}return r}function md(e,t,n){if(n&&n.z2==null){n=I({},n);var r=e.z2SelectLift;n.z2=e.z2+(r??9)}return n}function hd(e,t,n){var r=Na(e.currentStates,t)>=0,i=e.style.opacity,a=r?null:fd(e,[`opacity`],t,{opacity:1});n||={};var o=n.style||{};return o.opacity??(n=I({},n),o=I({opacity:r?i:a.opacity*.1},o),n.style=o),n}function gd(e,t){var n=this.states[e];if(this.style){if(e===`emphasis`)return pd(this,e,t,n);if(e===`blur`)return hd(this,e,n);if(e===`select`)return md(this,e,n)}return n}function _d(e){e.stateProxy=gd;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=gd),n&&(n.stateProxy=gd)}function vd(e,t){!Ed(e,t)&&!e.__highByOuter&&ud(e,rd)}function yd(e,t){!Ed(e,t)&&!e.__highByOuter&&ud(e,id)}function bd(e,t){e.__highByOuter|=1<<(t||0),ud(e,rd)}function xd(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&ud(e,id)}function Sd(e){ud(e,ad)}function Cd(e){ud(e,od)}function wd(e){ud(e,sd)}function Td(e){ud(e,cd)}function Ed(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function Dd(e){var t=e.getModel(),n=[],r=[];t.eachComponent(function(t,i){var a=ez(i),o=ed(e,i),s=t===`series`;!s&&r.push(o),a.isBlured&&(o.group.traverse(function(e){od(e)}),s&&n.push(i)),a.isBlured=!1}),L(r,function(e){e&&e.toggleBlurSeries&&e.toggleBlurSeries(n,!1,t)})}function Od(e,t,n,r){var i=r.getModel();n||=`coordinateSystem`;function a(e,t){for(var n=0;n<t.length;n++){var r=e.getItemGraphicEl(t[n]);r&&Cd(r)}}if(e!=null&&t&&t!==`none`){var o=i.getSeriesByIndex(e),s=o.coordinateSystem;s&&s.master&&(s=s.master);var c=[];i.eachSeries(function(e){var i=o===e,l=e.coordinateSystem;if(l&&l.master&&(l=l.master),!(n===`series`&&!i||n===`coordinateSystem`&&!(l&&s?l===s:i)||t===`series`&&i)){if(r.getViewOfSeriesModel(e).group.traverse(function(e){e.__highByOuter&&i&&t===`self`||ad(e)}),Ia(t))a(e.getData(),t);else if(H(t))for(var u=Ba(t),d=0;d<u.length;d++)a(e.getData(u[d]),t[u[d]]);c.push(e),ez(e).isBlured=!0}}),i.eachComponent(function(e,t){if(e!==`series`){var n=r.getViewOfComponentModel(t);n&&n.toggleBlurSeries&&n.toggleBlurSeries(c,!0,i)}})}}function kd(e,t,n){if(e!=null&&t!=null){var r=n.getModel().getComponent(e,t);if(r){ez(r).isBlured=!0;var i=n.getViewOfComponentModel(r);i&&i.focusBlurEnabled&&i.group.traverse(function(e){ad(e)})}}}function Ad(e,t,n){var r=e.seriesIndex,i=e.getData(t.dataType);if(i){var a=Eu(i,t);a=(z(a)?a[0]:a)||0;var o=i.getItemGraphicEl(a);if(!o)for(var s=i.count(),c=0;!o&&c<s;)o=i.getItemGraphicEl(c++);if(o){var l=LR(o);Od(r,l.focus,l.blurScope,n)}else{var u=e.get([`emphasis`,`focus`]),d=e.get([`emphasis`,`blurScope`]);u!=null&&Od(r,u,d,n)}}}function jd(e,t,n,r){var i={focusSelf:!1,dispatchers:null};if(e==null||e===`series`||t==null||n==null)return i;var a=r.getModel().getComponent(e,t);if(!a)return i;var o=r.getViewOfComponentModel(a);if(!o||!o.findHighDownDispatchers)return i;for(var s=o.findHighDownDispatchers(n),c,l=0;l<s.length;l++)if(LR(s[l]).focus===`self`){c=!0;break}return{focusSelf:c,dispatchers:s}}function aee(e,t,n){var r=LR(e),i=jd(r.componentMainType,r.componentIndex,r.componentHighDownName,n),a=i.dispatchers,o=i.focusSelf;a?(o&&kd(r.componentMainType,r.componentIndex,n),L(a,function(e){return vd(e,t)})):(Od(r.seriesIndex,r.focus,r.blurScope,n),r.focus===`self`&&kd(r.componentMainType,r.componentIndex,n),vd(e,t))}function oee(e,t,n){Dd(n);var r=LR(e),i=jd(r.componentMainType,r.componentIndex,r.componentHighDownName,n).dispatchers;i?L(i,function(e){return yd(e,t)}):yd(e,t)}function see(e,t,n){if(Vd(t)){var r=t.dataType,i=Eu(e.getData(r),t);z(i)||(i=[i]),e[t.type===`toggleSelect`?`toggleSelect`:t.type===`select`?`select`:`unselect`](i,r)}}function Md(e){L(e.getAllData(),function(t){var n=t.data,r=t.type;n.eachItemGraphicEl(function(t,n){e.isSelected(n,r)?wd(t):Td(t)})})}function cee(e){var t=[];return e.eachSeries(function(e){L(e.getAllData(),function(n){n.data;var r=n.type,i=e.getSelectedDataIndices();if(i.length>0){var a={dataIndex:i,seriesIndex:e.seriesIndex};r!=null&&(a.dataType=r),t.push(a)}})}),t}function Nd(e,t,n){Rd(e,!0),ud(e,_d),Id(e,t,n)}function Pd(e){Rd(e,!1)}function Fd(e,t,n,r){r?Pd(e):Nd(e,t,n)}function Id(e,t,n){var r=LR(e);t==null?r.focus&&=null:(r.focus=t,r.blurScope=n)}function Ld(e,t,n,r){n||=`itemStyle`;for(var i=0;i<lz.length;i++){var a=lz[i],o=t.getModel([a,n]),s=e.ensureState(a);s.style=r?r(o):o[uz[n]]()}}function Rd(e,t){var n=t===!1,r=e;e.highDownSilentOnTouch&&(r.__highDownSilentOnTouch=e.highDownSilentOnTouch),(!n||r.__highDownDispatcher)&&(r.__highByOuter=r.__highByOuter||0,r.__highDownDispatcher=!n)}function zd(e){return!!(e&&e.__highDownDispatcher)}function Bd(e){var t=QR[e];return t==null&&ZR<=32&&(t=QR[e]=ZR++),t}function Vd(e){var t=e.type;return t===`select`||t===`unselect`||t===`toggleSelect`}function Hd(e){var t=e.type;return t===`highlight`||t===`downplay`}function Ud(e){var t=$R(e);t.normalFill=e.style.fill,t.normalStroke=e.style.stroke;var n=e.states.select||{};t.selectFill=n.style&&n.style.fill||null,t.selectStroke=n.style&&n.style.stroke||null}function Wd(e,t){if(t){var n=e.data,r=e.len(),i,a,o,s,c,l,u=dz.M,d=dz.C,f=dz.L,p=dz.R,m=dz.A,h=dz.Q;for(o=0,s=0;o<r;){switch(i=n[o++],s=o,a=0,i){case u:a=1;break;case f:a=1;break;case d:a=3;break;case h:a=2;break;case m:var g=t[4],_=t[5],v=pz(t[0]*t[0]+t[1]*t[1]),y=pz(t[2]*t[2]+t[3]*t[3]),b=mz(-t[1]/y,t[0]/v);n[o]*=v,n[o++]+=g,n[o]*=y,n[o++]+=_,n[o++]*=v,n[o++]*=y,n[o++]+=b,n[o++]+=b,o+=2,s=o;break;case p:l[0]=n[o++],l[1]=n[o++],qo(l,l,t),n[s++]=l[0],n[s++]=l[1],l[0]+=n[o++],l[1]+=n[o++],qo(l,l,t),n[s++]=l[0],n[s++]=l[1]}for(c=0;c<a;c++){var x=fz[c];x[0]=n[o++],x[1]=n[o++],qo(x,x,t),n[s++]=x[0],n[s++]=x[1]}}e.increaseVersion()}}function Gd(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Kd(e,t){return(e[0]*t[0]+e[1]*t[1])/(Gd(e)*Gd(t))}function qd(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(Kd(e,t))}function Jd(e,t,n,r,i,a,o,s,c,l,u){var d=vz/180*c,f=_z(d)*(e-n)/2+gz(d)*(t-r)/2,p=-1*gz(d)*(e-n)/2+_z(d)*(t-r)/2,m=f*f/(o*o)+p*p/(s*s);m>1&&(o*=hz(m),s*=hz(m));var h=(i===a?-1:1)*hz((o*o*(s*s)-o*o*(p*p)-s*s*(f*f))/(o*o*(p*p)+s*s*(f*f)))||0,g=h*o*p/s,_=h*-s*f/o,v=(e+n)/2+_z(d)*g-gz(d)*_,y=(t+r)/2+gz(d)*g+_z(d)*_,b=qd([1,0],[(f-g)/o,(p-_)/s]),x=[(f-g)/o,(p-_)/s],S=[(-1*f-g)/o,(-1*p-_)/s],C=qd(x,S);if(Kd(x,S)<=-1&&(C=vz),Kd(x,S)>=1&&(C=0),C<0){var w=Math.round(C/vz*1e6)/1e6;C=vz*2+w%2*vz}u.addData(l,v,y,o,s,b,C,d,a)}function Yd(e){var t=new LL;if(!e)return t;var n=0,r=0,i=n,a=r,o,s=LL.CMD,c=e.match(yz);if(!c)return t;for(var l=0;l<c.length;l++){for(var u=c[l],d=u.charAt(0),f=void 0,p=u.match(bz)||[],m=p.length,h=0;h<m;h++)p[h]=parseFloat(p[h]);for(var g=0;g<m;){var _=void 0,v=void 0,y=void 0,b=void 0,x=void 0,S=void 0,C=void 0,w=n,T=r,E=void 0,D=void 0;switch(d){case`l`:n+=p[g++],r+=p[g++],f=s.L,t.addData(f,n,r);break;case`L`:n=p[g++],r=p[g++],f=s.L,t.addData(f,n,r);break;case`m`:n+=p[g++],r+=p[g++],f=s.M,t.addData(f,n,r),i=n,a=r,d=`l`;break;case`M`:n=p[g++],r=p[g++],f=s.M,t.addData(f,n,r),i=n,a=r,d=`L`;break;case`h`:n+=p[g++],f=s.L,t.addData(f,n,r);break;case`H`:n=p[g++],f=s.L,t.addData(f,n,r);break;case`v`:r+=p[g++],f=s.L,t.addData(f,n,r);break;case`V`:r=p[g++],f=s.L,t.addData(f,n,r);break;case`C`:f=s.C,t.addData(f,p[g++],p[g++],p[g++],p[g++],p[g++],p[g++]),n=p[g-2],r=p[g-1];break;case`c`:f=s.C,t.addData(f,p[g++]+n,p[g++]+r,p[g++]+n,p[g++]+r,p[g++]+n,p[g++]+r),n+=p[g-2],r+=p[g-1];break;case`S`:_=n,v=r,E=t.len(),D=t.data,o===s.C&&(_+=n-D[E-4],v+=r-D[E-3]),f=s.C,w=p[g++],T=p[g++],n=p[g++],r=p[g++],t.addData(f,_,v,w,T,n,r);break;case`s`:_=n,v=r,E=t.len(),D=t.data,o===s.C&&(_+=n-D[E-4],v+=r-D[E-3]),f=s.C,w=n+p[g++],T=r+p[g++],n+=p[g++],r+=p[g++],t.addData(f,_,v,w,T,n,r);break;case`Q`:w=p[g++],T=p[g++],n=p[g++],r=p[g++],f=s.Q,t.addData(f,w,T,n,r);break;case`q`:w=p[g++]+n,T=p[g++]+r,n+=p[g++],r+=p[g++],f=s.Q,t.addData(f,w,T,n,r);break;case`T`:_=n,v=r,E=t.len(),D=t.data,o===s.Q&&(_+=n-D[E-4],v+=r-D[E-3]),n=p[g++],r=p[g++],f=s.Q,t.addData(f,_,v,n,r);break;case`t`:_=n,v=r,E=t.len(),D=t.data,o===s.Q&&(_+=n-D[E-4],v+=r-D[E-3]),n+=p[g++],r+=p[g++],f=s.Q,t.addData(f,_,v,n,r);break;case`A`:y=p[g++],b=p[g++],x=p[g++],S=p[g++],C=p[g++],w=n,T=r,n=p[g++],r=p[g++],f=s.A,Jd(w,T,n,r,S,C,y,b,x,f,t);break;case`a`:y=p[g++],b=p[g++],x=p[g++],S=p[g++],C=p[g++],w=n,T=r,n+=p[g++],r+=p[g++],f=s.A,Jd(w,T,n,r,S,C,y,b,x,f,t)}}(d===`z`||d===`Z`)&&(f=s.Z,t.addData(f),n=i,r=a),o=f}return t.toStatic(),t}function Xd(e){return e.setData!=null}function Zd(e,t){var n=Yd(e),r=I({},t);return r.buildPath=function(e){var t=Xd(e);if(t&&e.canSave()){e.appendPath(n);var r=e.getContext();r&&e.rebuildPath(r,1)}else{var r=t?e.getContext():e;r&&n.rebuildPath(r,1)}},r.applyTransform=function(e){Wd(n,e),this.dirtyShape()},r}function Qd(e,t){return new xz(Zd(e,t))}function $d(e,t){var n=Zd(e,t);return function(e){F(t,e);function t(t){var r=e.call(this,t)||this;return r.applyTransform=n.applyTransform,r.buildPath=n.buildPath,r}return t}(xz)}function ef(e,t){for(var n=[],r=e.length,i=0;i<r;i++){var a=e[i];n.push(a.getUpdatedPathProxy(!0))}var o=new JL(t);return o.createPathProxy(),o.buildPath=function(e){if(Xd(e)){e.appendPath(n);var t=e.getContext();t&&e.rebuildPath(t,1)}},o}function tf(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<Lz))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function nf(e,t,n,r,i,a,o){var s=e-n,c=t-r,l=(o?a:-a)/Pz(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,y=h-p,b=v*v+y*y,x=i-a,S=f*h-m*p,C=(y<0?-1:1)*Pz(Fz(0,x*x*b-S*S)),w=(S*y-v*C)/b,T=(-S*v-y*C)/b,E=(S*y+v*C)/b,D=(-S*v+y*C)/b,O=w-g,k=T-_,A=E-g,j=D-_;return O*O+k*k>A*A+j*j&&(w=E,T=D),{cx:w,cy:T,x0:-u,y0:-d,x1:w*(i/x-1),y1:T*(i/x-1)}}function rf(e){var t;if(z(e)){var n=e.length;if(!n)return e;t=n===1?[e[0],e[0],0,0]:n===2?[e[0],e[0],e[1],e[1]]:n===3?e.concat(e[2]):e}else t=[e,e,e,e];return t}function af(e,t){var n,r=Fz(t.r,0),i=Fz(t.r0||0,0),a=r>0;if(a||i>0){if(a||(r=i,i=0),i>r){var o=r;r=i,i=o}var s=t.startAngle,c=t.endAngle;if(!(isNaN(s)||isNaN(c))){var l=t.cx,u=t.cy,d=!!t.clockwise,f=Nz(c-s),p=f>Oz&&f%Oz;if(p>Lz&&(f=p),!(r>Lz))e.moveTo(l,u);else if(f>Oz-Lz)e.moveTo(l+r*Az(s),u+r*kz(s)),e.arc(l,u,r,s,c,!d),i>Lz&&(e.moveTo(l+i*Az(c),u+i*kz(c)),e.arc(l,u,i,c,s,d));else{var m=void 0,h=void 0,g=void 0,_=void 0,v=void 0,y=void 0,b=void 0,x=void 0,S=void 0,C=void 0,w=void 0,T=void 0,E=void 0,D=void 0,O=void 0,k=void 0,A=r*Az(s),j=r*kz(s),M=i*Az(c),ee=i*kz(c),te=f>Lz;if(te){var ne=t.cornerRadius;ne&&(n=rf(ne),m=n[0],h=n[1],g=n[2],_=n[3]);var re=Nz(r-i)/2;if(v=Iz(re,g),y=Iz(re,_),b=Iz(re,m),x=Iz(re,h),w=S=Fz(v,y),T=C=Fz(b,x),(S>Lz||C>Lz)&&(E=r*Az(c),D=r*kz(c),O=i*Az(s),k=i*kz(s),f<Dz)){var ie=tf(A,j,O,k,E,D,M,ee);if(ie){var ae=A-ie[0],oe=j-ie[1],se=E-ie[0],ce=D-ie[1],le=1/kz(jz((ae*se+oe*ce)/(Pz(ae*ae+oe*oe)*Pz(se*se+ce*ce)))/2),ue=Pz(ie[0]*ie[0]+ie[1]*ie[1]);w=Iz(S,(r-ue)/(le+1)),T=Iz(C,(i-ue)/(le-1))}}}if(!te)e.moveTo(l+A,u+j);else if(w>Lz){var de=Iz(g,w),fe=Iz(_,w),pe=nf(O,k,A,j,r,de,d),me=nf(E,D,M,ee,r,fe,d);e.moveTo(l+pe.cx+pe.x0,u+pe.cy+pe.y0),w<S&&de===fe?e.arc(l+pe.cx,u+pe.cy,w,Mz(pe.y0,pe.x0),Mz(me.y0,me.x0),!d):(de>0&&e.arc(l+pe.cx,u+pe.cy,de,Mz(pe.y0,pe.x0),Mz(pe.y1,pe.x1),!d),e.arc(l,u,r,Mz(pe.cy+pe.y1,pe.cx+pe.x1),Mz(me.cy+me.y1,me.cx+me.x1),!d),fe>0&&e.arc(l+me.cx,u+me.cy,fe,Mz(me.y1,me.x1),Mz(me.y0,me.x0),!d))}else e.moveTo(l+A,u+j),e.arc(l,u,r,s,c,!d);if(!(i>Lz)||!te)e.lineTo(l+M,u+ee);else if(T>Lz){var de=Iz(m,T),fe=Iz(h,T),pe=nf(M,ee,E,D,i,-fe,d),me=nf(A,j,O,k,i,-de,d);e.lineTo(l+pe.cx+pe.x0,u+pe.cy+pe.y0),T<C&&de===fe?e.arc(l+pe.cx,u+pe.cy,T,Mz(pe.y0,pe.x0),Mz(me.y0,me.x0),!d):(fe>0&&e.arc(l+pe.cx,u+pe.cy,fe,Mz(pe.y0,pe.x0),Mz(pe.y1,pe.x1),!d),e.arc(l,u,i,Mz(pe.cy+pe.y1,pe.cx+pe.x1),Mz(me.cy+me.y1,me.cx+me.x1),d),de>0&&e.arc(l+me.cx,u+me.cy,de,Mz(me.y1,me.x1),Mz(me.y0,me.x0),!d))}else e.lineTo(l+M,u+ee),e.arc(l,u,i,c,s,d)}e.closePath()}}}function of(e,t,n,r){var i=[],a=[],o=[],s=[],c,l,u,d;if(r){u=[1/0,1/0],d=[-1/0,-1/0];for(var f=0,p=e.length;f<p;f++)Jo(u,u,e[f]),Yo(d,d,e[f]);Jo(u,u,r[0]),Yo(d,d,r[1])}for(var f=0,p=e.length;f<p;f++){var m=e[f];if(n)c=e[f?f-1:p-1],l=e[(f+1)%p];else if(f===0||f===p-1){i.push(Io(e[f]));continue}else c=e[f-1],l=e[f+1];zo(a,l,c),Ho(a,a,t);var h=Wo(m,c),g=Wo(m,l),_=h+g;_!==0&&(h/=_,g/=_),Ho(o,a,-h),Ho(s,a,g);var v=Ro([],m,o),y=Ro([],m,s);r&&(Yo(v,v,u),Jo(v,v,d),Yo(y,y,u),Jo(y,y,d)),i.push(v),i.push(y)}return n&&i.push(i.shift()),i}function sf(e,t,n){var r=t.smooth,i=t.points;if(i&&i.length>=2){if(r){var a=of(i,r,n,t.smoothConstraint);e.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(n?o:o-1);s++){var c=a[s*2],l=a[s*2+1],u=i[(s+1)%o];e.bezierCurveTo(c[0],c[1],l[0],l[1],u[0],u[1])}}else{e.moveTo(i[0][0],i[0][1]);for(var s=1,d=i.length;s<d;s++)e.lineTo(i[s][0],i[s][1])}n&&e.closePath()}}function cf(e,t,n){var r=e.cpx2,i=e.cpy2;return r!=null||i!=null?[(n?As:ks)(e.x1,e.cpx1,e.cpx2,e.x2,t),(n?As:ks)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(n?Ls:Is)(e.x1,e.cpx1,e.x2,t),(n?Ls:Is)(e.y1,e.cpy1,e.y2,t)]}function lf(e,t,n,r,i){var a;if(t&&t.ecModel){var o=t.ecModel.getUpdatePayload();a=o&&o.animation}var s=t&&t.isAnimationEnabled(),c=e===`update`;if(s){var l=void 0,u=void 0,d=void 0;return r?(l=U(r.duration,200),u=U(r.easing,`cubicOut`),d=0):(l=t.getShallow(c?`animationDurationUpdate`:`animationDuration`),u=t.getShallow(c?`animationEasingUpdate`:`animationEasing`),d=t.getShallow(c?`animationDelayUpdate`:`animationDelay`)),a&&(a.duration!=null&&(l=a.duration),a.easing!=null&&(u=a.easing),a.delay!=null&&(d=a.delay)),B(d)&&(d=d(n,i)),B(l)&&(l=l(n)),{duration:l||0,delay:d,easing:u}}return null}function uf(e,t,n,r,i,a,o){var s=!1,c;B(i)?(o=a,a=i,i=null):H(i)&&(a=i.cb,o=i.during,s=i.isFrom,c=i.removeOpt,i=i.dataIndex);var l=e===`leave`;l||t.stopAnimation(`leave`);var u=lf(e,r,i,l?c||{}:null,r&&r.getAnimationDelayParams?r.getAnimationDelayParams(t,i):null);if(u&&u.duration>0){var d=u.duration,f=u.delay,p=u.easing,m={duration:d,delay:f||0,easing:p,done:a,force:!!a||!!o,setToFinal:!l,scope:e,during:o};s?t.animateFrom(n,m):t.animateTo(n,m)}else t.stopAnimation(),!s&&t.attr(n),o&&o(1),a&&a()}function df(e,t,n,r,i,a){uf(`update`,e,t,n,r,i,a)}function ff(e,t,n,r,i,a){uf(`enter`,e,t,n,r,i,a)}function pf(e){if(!e.__zr)return!0;for(var t=0;t<e.animators.length;t++)if(e.animators[t].scope===`leave`)return!0;return!1}function mf(e,t,n,r,i,a){pf(e)||uf(`leave`,e,t,n,r,i,a)}function hf(e,t,n,r){e.removeTextContent(),e.removeTextGuideLine(),mf(e,{style:{opacity:0}},t,n,r)}function gf(e,t,n){function r(){e.parent&&e.parent.remove(e)}e.isGroup?e.traverse(function(e){e.isGroup||hf(e,t,n,r)}):hf(e,t,n,r)}function _f(e){hB(e).oldStyle=e.style}function vf(e){return JL.extend(e)}function yf(e,t){return bB(e,t)}function bf(e,t){_B[e]=t}function xf(e){if(_B.hasOwnProperty(e))return _B[e]}function Sf(e,t,n,r){var i=Qd(e,t);return n&&(r===`center`&&(n=wf(n,i.getBoundingRect())),Tf(i,n)),i}function Cf(e,t,n){var r=new $L({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if(n===`center`){var i={width:e.width,height:e.height};r.setStyle(wf(t,i))}}});return r}function wf(e,t){var n=t.width/t.height,r=e.height*n,i;r<=e.width?i=e.height:(r=e.width,i=r/n);var a=e.x+e.width/2,o=e.y+e.height/2;return{x:a-r/2,y:o-i/2,width:r,height:i}}function Tf(e,t){if(e.applyTransform){var n=e.getBoundingRect().calculateTransform(t);e.applyTransform(n)}}function Ef(e,t){return yl(e,e,{lineWidth:t}),e}function Df(e,t){return bl(e,e,t),e}function Of(e,t){for(var n=Do([]);e&&e!==t;)ko(n,e.getLocalTransform(),n),e=e.parent;return n}function kf(e,t,n){return t&&!Ia(t)&&(t=lI.getLocalTransform(t)),n&&(t=No([],t)),qo([],e,t)}function Af(e,t,n){var r=t[4]===0||t[5]===0||t[0]===0?1:gR(2*t[4]/t[0]),i=t[4]===0||t[5]===0||t[2]===0?1:gR(2*t[4]/t[2]),a=[e===`left`?-r:e===`right`?r:0,e===`top`?-i:e===`bottom`?i:0];return a=kf(a,t,n),gR(a[0])>gR(a[1])?a[0]>0?`right`:`left`:a[1]>0?`bottom`:`top`}function jf(e){return!e.isGroup}function Mf(e){return e.shape!=null}function Nf(e,t,n){if(!e||!t)return;function r(e){var t={};return e.traverse(function(e){jf(e)&&e.anid&&(t[e.anid]=e)}),t}function i(e){var t={x:e.x,y:e.y,rotation:e.rotation};return Mf(e)&&(t.shape=ka(e.shape)),t}var a=r(e);t.traverse(function(e){if(jf(e)&&e.anid){var t=a[e.anid];if(t){var r=i(e);e.attr(i(t)),df(e,r,n,LR(e).dataIndex)}}})}function Pf(e,t){return R(e,function(e){var n=e[0];n=hR(n,t.x),n=mR(n,t.x+t.width);var r=e[1];return r=hR(r,t.y),r=mR(r,t.y+t.height),[n,r]})}function Ff(e,t){var n=hR(e.x,t.x),r=mR(e.x+e.width,t.x+t.width),i=hR(e.y,t.y),a=mR(e.y+e.height,t.y+t.height);if(r>=n&&a>=i)return{x:n,y:i,width:r-n,height:a-i}}function If(e,t,n){var r=I({rectHover:!0},t),i=r.style={strokeNoScale:!0};if(n||={x:-1,y:-1,width:2,height:2},e)return e.indexOf(`image://`)===0?(i.image=e.slice(8),Ma(i,n),new $L(r)):Sf(e.replace(`path://`,``),r,n,`center`)}function Lf(e,t,n,r,i){for(var a=0,o=i[i.length-1];a<i.length;a++){var s=i[a];if(Rf(e,t,n,r,s[0],s[1],o[0],o[1]))return!0;o=s}}function Rf(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=zf(u,d,c,l);if(Bf(f))return!1;var p=e-i,m=t-a,h=zf(p,m,c,l)/f;if(h<0||h>1)return!1;var g=zf(p,m,u,d)/f;return!(g<0||g>1)}function zf(e,t,n,r){return e*r-n*t}function Bf(e){return e<=1e-6&&e>=-1e-6}function Vf(e,t,n,r,i){return t==null||(Wa(t)?CB[0]=CB[1]=CB[2]=CB[3]=t:(CB[0]=t[0],CB[1]=t[1],CB[2]=t[2],CB[3]=t[3]),r&&(CB[0]=hR(0,CB[0]),CB[1]=hR(0,CB[1]),CB[2]=hR(0,CB[2]),CB[3]=hR(0,CB[3])),n&&(CB[0]=-CB[0],CB[1]=-CB[1],CB[2]=-CB[2],CB[3]=-CB[3]),Hf(e,CB,`x`,`width`,3,1,i&&i[0]||0),Hf(e,CB,`y`,`height`,0,2,i&&i[1]||0)),e}function Hf(e,t,n,r,i,a,o){var s=t[a]+t[i],c=e[r];e[r]+=s,o=hR(0,mR(o,c)),e[r]<o?(e[r]=o,e[n]+=t[i]>=0?-t[i]:t[a]>=0?c+t[a]:gR(s)>1e-8?(c-o)*t[i]/s:0):e[n]-=t[i]}function Uf(e){var t=e.itemTooltipOption,n=e.componentModel,r=e.itemName,i=V(t)?{formatter:t}:t,a=n.mainType,o=n.componentIndex,s={componentType:a,name:r,$vars:[`name`]};s[a+`Index`]=o;var c=e.formatterParamsExtra;c&&L(Ba(c),function(e){so(s,e)||(s[e]=c[e],s.$vars.push(e))});var l=LR(e.el);l.componentMainType=a,l.componentIndex=o,l.tooltipConfig={name:r,option:Ma({content:r,encodeHTMLContent:!0,formatterParams:s},i)}}function Wf(e,t){var n;e.isGroup&&(n=t(e)),n||e.traverse(t)}function Gf(e,t){if(e){if(z(e))for(var n=0;n<e.length;n++)Wf(e[n],t);else Wf(e,t)}}function Kf(e){return!e||gR(e[1])<wB&&gR(e[2])<wB||gR(e[0])<wB&&gR(e[3])<wB}function qf(e,t){return e?J.copy(e,t):t.clone()}function Jf(e,t){return t?Oo(e||Eo(),t):void 0}function Yf(e){return{z:e.get(`z`)||0,zlevel:e.get(`zlevel`)||0}}function Xf(e){var t=-1/0,n=1/0;Wf(e,function(e){r(e),r(e.getTextContent()),r(e.getTextGuideLine())});function r(e){if(e&&!e.isGroup){var t=e.currentStates;if(t.length)for(var n=0;n<t.length;n++)i(e.states[t[n]]);i(e)}}function i(e){if(e){var r=e.z2;r>t&&(t=r),r<n&&(n=r)}}return n>t&&(n=t=0),{min:n,max:t}}function Zf(e,t,n){Qf(e,t,n,-1/0)}function Qf(e,t,n,r){if(e.ignoreModelZ)return r;var i=e.getTextContent(),a=e.getTextGuideLine();if(e.isGroup)for(var o=e.childrenRef(),s=0;s<o.length;s++)r=hR(Qf(o[s],t,n,r),r);else e.z=t,e.zlevel=n,r=hR(e.z2||0,r);if(i&&(i.z=t,i.zlevel=n,isFinite(r)&&(i.z2=r+2)),a){var c=e.textGuideLineConfig;a.z=t,a.zlevel=n,isFinite(r)&&(a.z2=r+(c&&c.showAbove?1:-1))}return r}function $f(e){return e.animation={duration:0},e}function ep(e,t){return t?Oo(TB.transform,t):Do(TB.transform),TB.decomposeTransform(),Es(e,TB),e}function tp(e){var t=e.getZr().painter;return t.getType()===`canvas`?t:null}function np(e,t){for(var n=0;n<tz.length;n++){var r=tz[n],i=t[r],a=e.ensureState(r);a.style=a.style||{},a.style.text=i}var o=e.currentStates.slice();e.clearStates(!0),e.setStyle({text:t.normal}),e.useStates(o,!0)}function rp(e,t,n){var r=e.labelFetcher,i=e.labelDataIndex,a=e.labelDimIndex,o=t.normal,s;r&&(s=r.getFormattedLabel(i,`normal`,null,a,o&&o.get(`formatter`),n==null?null:{interpolatedValue:n})),s??=B(e.defaultText)?e.defaultText(i,e,n):e.defaultText;for(var c={normal:s},l=0;l<tz.length;l++){var u=tz[l],d=t[u];c[u]=U(r?r.getFormattedLabel(i,u,null,a,d&&d.get(`formatter`)):null,s)}return c}function ip(e,t,n,r){n||=EB;for(var i=e instanceof cR,a=!1,o=0;o<nz.length;o++){var s=t[nz[o]];if(s&&s.getShallow(`show`)){a=!0;break}}var c=i?e:e.getTextContent();if(a){i||(c||(c=new cR,e.setTextContent(c)),e.stateProxy&&(c.stateProxy=e.stateProxy));var l=rp(n,t),u=t.normal,d=!!u.getShallow(`show`),f=op(u,r&&r.normal,n,!1,!i);f.text=l.normal,i||e.setTextConfig(sp(u,n,!1));for(var o=0;o<tz.length;o++){var p=tz[o],s=t[p];if(s){var m=c.ensureState(p),h=!!U(s.getShallow(`show`),d);if(h!==d&&(m.ignore=!h),m.style=op(s,r&&r[p],n,!0,!i),m.style.text=l[p],!i){var g=e.ensureState(p);g.textConfig=sp(s,n,!0)}}}c.silent=!!u.getShallow(`silent`),c.style.x!=null&&(f.x=c.style.x),c.style.y!=null&&(f.y=c.style.y),c.ignore=!d,c.useStyle(f),c.dirty(),n.enableTextSetter&&(AB(c).setLabelText=function(e){var r=rp(n,t,e);np(c,r)})}else c&&(c.ignore=!0);e.dirty()}function ap(e,t){t||=`label`;for(var n={normal:e.getModel(t)},r=0;r<tz.length;r++){var i=tz[r];n[i]=e.getModel([i,t])}return n}function op(e,t,n,r,i){var a={};return cp(a,e,n,r,i),t&&I(a,t),a}function sp(e,t,n){t||={};var r={},i,a=e.getShallow(`rotate`),o=U(e.getShallow(`distance`),n?null:5),s=e.getShallow(`offset`);return i=e.getShallow(`position`)||(n?null:`inside`),i===`outside`&&(i=t.defaultOutsidePosition||`top`),i!=null&&(r.position=i),s!=null&&(r.offset=s),a!=null&&(a*=Math.PI/180,r.rotation=a),o!=null&&(r.distance=o),r.outsideFill=e.get(`color`)===`inherit`?t.inheritColor||null:`auto`,t.autoOverflowArea!=null&&(r.autoOverflowArea=t.autoOverflowArea),t.layoutRect!=null&&(r.layoutRect=t.layoutRect),r}function cp(e,t,n,r,i){n||=EB;var a=t.ecModel,o=a&&a.option.textStyle,s=lp(t),c;if(s){c={};var l=`richInheritPlainLabel`,u=U(t.get(l),a?a.get(l):void 0);for(var d in s)if(s.hasOwnProperty(d)){var f=t.getModel([`rich`,d]);up(c[d]={},f,o,t,u,n,r,i,!1,!0)}}c&&(e.rich=c);var p=t.get(`overflow`);p&&(e.overflow=p);var m=t.get(`lineOverflow`);m&&(e.lineOverflow=m);var h=e,g=t.get(`minMargin`);if(g!=null)g=Wa(g)?g/2:0,h.margin=[g,g,g,g],h.__marginType=jB.minMargin;else{var _=t.get(`textMargin`);_!=null&&(h.margin=eo(_),h.__marginType=jB.textMargin)}up(e,t,o,null,null,n,r,i,!0,!1)}function lp(e){for(var t;e&&e!==e.ecModel;){var n=(e.option||EB).rich;if(n){t||={};for(var r=Ba(n),i=0;i<r.length;i++){var a=r[i];t[a]=1}}e=e.parentModel}return t}function up(e,t,n,r,i,a,o,s,c,l){n=!o&&n||EB;var u=a&&a.inheritColor,d=t.getShallow(`color`),f=t.getShallow(`textBorderColor`),p=U(t.getShallow(`opacity`),n.opacity);(d===`inherit`||d===`auto`)&&(d=u||null),(f===`inherit`||f===`auto`)&&(f=u||null),s||(d||=n.color,f||=n.textBorderColor),d!=null&&(e.fill=d),f!=null&&(e.stroke=f);var m=U(t.getShallow(`textBorderWidth`),n.textBorderWidth);m!=null&&(e.lineWidth=m);var h=U(t.getShallow(`textBorderType`),n.textBorderType);h!=null&&(e.lineDash=h);var g=U(t.getShallow(`textBorderDashOffset`),n.textBorderDashOffset);g!=null&&(e.lineDashOffset=g),!o&&p==null&&!l&&(p=a&&a.defaultOpacity),p!=null&&(e.opacity=p),!o&&!s&&e.fill==null&&a.inheritColor&&(e.fill=a.inheritColor);for(var _=0;_<DB.length;_++){var v=DB[_],y=i!==!1&&r?Qa(t.getShallow(v),r.getShallow(v),n[v]):U(t.getShallow(v),n[v]);y!=null&&(e[v]=y)}for(var _=0;_<OB.length;_++){var v=OB[_],y=t.getShallow(v);y!=null&&(e[v]=y)}if(e.verticalAlign==null){var b=t.getShallow(`baseline`);b!=null&&(e.verticalAlign=b)}if(!c||!a.disableBox){for(var _=0;_<kB.length;_++){var v=kB[_],y=t.getShallow(v);y!=null&&(e[v]=y)}var x=t.getShallow(`borderType`);x!=null&&(e.borderDash=x),(e.backgroundColor===`auto`||e.backgroundColor===`inherit`)&&u&&(e.backgroundColor=u),(e.borderColor===`auto`||e.borderColor===`inherit`)&&u&&(e.borderColor=u)}}function dp(e,t){var n=t&&t.getModel(`textStyle`);return no([e.fontStyle||n&&n.getShallow(`fontStyle`)||``,e.fontWeight||n&&n.getShallow(`fontWeight`)||``,(e.fontSize||n&&n.getShallow(`fontSize`)||12)+`px`,e.fontFamily||n&&n.getShallow(`fontFamily`)||`sans-serif`].join(` `))}function fp(e,t,n,r){if(e){var i=AB(e);i.prevValue=i.value,i.value=n;var a=t.normal;i.valueAnimation=a.get(`valueAnimation`),i.valueAnimation&&(i.precision=a.get(`precision`),i.defaultInterpolatedText=r,i.statesModels=t)}}function pp(e,t,n,r,i){var a=AB(e);if(!a.valueAnimation||a.prevValue===a.value)return;var o=a.defaultInterpolatedText,s=U(a.interpolatedValue,a.prevValue),c=a.value;function l(r){var l=Iu(n,a.precision,s,c,r);a.interpolatedValue=r===1?null:l,np(e,rp({labelDataIndex:t,labelFetcher:i,defaultText:o?o(l):l+``},a.statesModels,l))}e.percent=0,(a.prevValue==null?ff:df)(e,{percent:1},r,t,null,l)}function mp(e){return e==null?0:e.length||1}function hp(e){return e}function gp(e){GB(e).datasetMap=W()}function _p(e,t,n){var r={},i=yp(t);if(!i||!e)return r;var a=[],o=[],s=t.ecModel,c=GB(s).datasetMap,l=i.uid+`_`+n.seriesLayoutBy,u,d;e=e.slice(),L(e,function(t,n){var i=H(t)?t:e[n]={name:t};i.type===`ordinal`&&u==null&&(u=n,d=m(i)),r[i.name]=[]});var f=c.get(l)||c.set(l,{categoryWayDim:d,valueWayDim:0});L(e,function(e,t){var n=e.name,i=m(e);if(u==null){var s=f.valueWayDim;p(r[n],s,i),p(o,s,i),f.valueWayDim+=i}else if(u===t)p(r[n],0,i),p(a,0,i);else{var s=f.categoryWayDim;p(r[n],s,i),p(o,s,i),f.categoryWayDim+=i}});function p(e,t,n){for(var r=0;r<n;r++)e.push(t+r)}function m(e){var t=e.dimsDef;return t?t.length:1}return a.length&&(r.itemName=a),o.length&&(r.seriesName=o),r}function vp(e,t,n){var r={};if(!yp(e))return r;var i=t.sourceFormat,a=t.dimensionsDefine,o;(i===`objectRows`||i===`keyedColumns`)&&L(a,function(e,t){(H(e)?e.name:e)===`name`&&(o=t)});var s=function(){for(var e={},r={},s=[],c=0,l=Math.min(5,n);c<l;c++){var u=Sp(t.data,i,t.seriesLayoutBy,a,t.startIndex,c);s.push(u);var d=u===WB.Not;if(d&&e.v==null&&c!==o&&(e.v=c),(e.n==null||e.n===e.v||!d&&s[e.n]===WB.Not)&&(e.n=c),f(e)&&s[e.n]!==WB.Not)return e;d||(u===WB.Might&&r.v==null&&c!==o&&(r.v=c),(r.n==null||r.n===r.v)&&(r.n=c))}function f(e){return e.v!=null&&e.n!=null}return f(e)?e:f(r)?r:null}();if(s){r.value=[s.v];var c=o??s.n;r.itemName=[c],r.seriesName=[c]}return r}function yp(e){if(!e.get(`data`,!0))return Au(e.ecModel,`dataset`,{index:e.get(`datasetIndex`,!0),id:e.get(`datasetId`,!0)},PR).models[0]}function bp(e){return!e.get(`transform`,!0)&&!e.get(`fromTransformResult`,!0)?[]:Au(e.ecModel,`dataset`,{index:e.get(`fromDatasetIndex`,!0),id:e.get(`fromDatasetId`,!0)},PR).models}function xp(e,t){return Sp(e.data,e.sourceFormat,e.seriesLayoutBy,e.dimensionsDefine,e.startIndex,t)}function Sp(e,t,n,r,i,a){var o,s=5;if(Ka(e))return WB.Not;var c,l;if(r){var u=r[a];H(u)?(c=u.name,l=u.type):V(u)&&(c=u)}if(l!=null)return l===`ordinal`?WB.Must:WB.Not;if(t===`arrayRows`){var d=e;if(n===`row`){for(var f=d[a],p=0;p<(f||[]).length&&p<s;p++)if((o=b(f[i+p]))!=null)return o}else for(var p=0;p<d.length&&p<s;p++){var m=d[i+p];if(m&&(o=b(m[a]))!=null)return o}}else if(t===`objectRows`){var h=e;if(!c)return WB.Not;for(var p=0;p<h.length&&p<s;p++){var g=h[p];if(g&&(o=b(g[c]))!=null)return o}}else if(t===`keyedColumns`){var _=e;if(!c)return WB.Not;var f=_[c];if(!f||Ka(f))return WB.Not;for(var p=0;p<f.length&&p<s;p++)if((o=b(f[p]))!=null)return o}else if(t===`original`)for(var v=e,p=0;p<v.length&&p<s;p++){var g=v[p],y=uu(g);if(!z(y))return WB.Not;if((o=b(y[a]))!=null)return o}function b(e){var t=V(e);if(e!=null&&isFinite(Number(e))&&e!==``)return t?WB.Might:WB.Not;if(t&&e!==`-`)return WB.Must}return WB.Not}function Cp(e){return e instanceof KB}function wp(e,t,n){n||=Dp(e);var r=t.seriesLayoutBy,i=Op(e,n,r,t.sourceHeader,t.dimensions);return new KB({data:e,sourceFormat:n,seriesLayoutBy:r,dimensionsDefine:i.dimensionsDefine,startIndex:i.startIndex,dimensionsDetectedCount:i.dimensionsDetectedCount,metaRawOption:ka(t)})}function Tp(e){return new KB({data:e,sourceFormat:Ka(e)?GR:VR})}function Ep(e){return new KB({data:e.data,sourceFormat:e.sourceFormat,seriesLayoutBy:e.seriesLayoutBy,dimensionsDefine:ka(e.dimensionsDefine),startIndex:e.startIndex,dimensionsDetectedCount:e.dimensionsDetectedCount})}function Dp(e){var t=KR;if(Ka(e))t=GR;else if(z(e)){e.length===0&&(t=HR);for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i!=null){if(z(i)||Ka(i)){t=HR;break}if(H(i)){t=UR;break}}}}else if(H(e)){for(var a in e)if(so(e,a)&&Ia(e[a])){t=WR;break}}return t}function Op(e,t,n,r,i){var a,o;if(!e)return{dimensionsDefine:Ap(i),startIndex:o,dimensionsDetectedCount:a};if(t===`arrayRows`){var s=e;r===`auto`||r==null?jp(function(e){e!=null&&e!==`-`&&(V(e)?o??=1:o=0)},n,s,10):o=Wa(r)?r:+!!r,!i&&o===1&&(i=[],jp(function(e,t){i[t]=e==null?``:e+``},n,s,1/0)),a=i?i.length:n===`row`?s.length:s[0]?s[0].length:null}else if(t===`objectRows`)i||=kp(e);else if(t===`keyedColumns`)i||(i=[],L(e,function(e,t){i.push(t)}));else if(t===`original`){var c=uu(e[0]);a=z(c)&&c.length||1}return{startIndex:o,dimensionsDefine:Ap(i),dimensionsDetectedCount:a}}function kp(e){for(var t=0,n;t<e.length&&!(n=e[t++]););if(n)return Ba(n)}function Ap(e){if(e){var t=W();return R(e,function(e,n){e=H(e)?e:{name:e};var r={name:e.name,displayName:e.displayName,type:e.type};if(r.name==null)return r;r.name+=``,r.displayName??=r.name;var i=t.get(r.name);return i?r.name+=`-`+i.count++:t.set(r.name,{count:1}),r})}}function jp(e,t,n,r){if(t===`row`)for(var i=0;i<n.length&&i<r;i++)e(n[i]?n[i][0]:null,i);else for(var a=n[0]||[],i=0;i<a.length&&i<r;i++)e(a[i],i)}function Mp(e){var t=e.sourceFormat;return t===`objectRows`||t===`keyedColumns`}function Np(e,t){return nV[Ip(e,t)]}function Pp(e,t){return iV[Ip(e,t)]}function Fp(e){return oV[e]}function Ip(e,t){return e===`arrayRows`?e+`_`+t:e}function Lp(e,t,n){if(e){var r=e.getRawDataItem(t);if(r!=null){var i=e.getStore(),a=i.getSource().sourceFormat;if(n!=null){var o=e.getDimensionIndex(n),s=i.getDimensionProperty(o);return Fp(a)(r,o,s)}var c=r;return a===`original`&&(c=uu(r)),c}}}function Rp(e,t){var n={},r=n.encode={},i=W(),a=[],o=[],s={};L(e.dimensions,function(t){var n=e.getDimensionInfo(t),c=n.coordDim;if(c){var l=n.coordDimIndex;zp(r,c)[l]=t,n.isExtraCoord||(i.set(c,1),Vp(n.type)&&(a[0]=t),zp(s,c)[l]=e.getDimensionIndex(n.name)),n.defaultTooltip&&o.push(t)}BR.each(function(e,t){var i=zp(r,t),a=n.otherDims[t];a!=null&&a!==!1&&(i[a]=n.name)})});var c=[],l={};i.each(function(e,t){var n=r[t];l[t]=n[0],c=c.concat(n)}),n.dataDimsOnCoord=c,n.dataDimIndicesOnCoord=R(c,function(t){return e.getDimensionInfo(t).storeDimIndex}),n.encodeFirstDimNotExtra=l;var u=r.label;u&&u.length&&(a=u.slice());var d=r.tooltip;return d&&d.length?o=d.slice():o.length||(o=a.slice()),r.defaultedLabel=a,r.defaultedTooltip=o,n.userOutput=new sV(s,t),n}function zp(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}function Bp(e){return e===`category`?`ordinal`:e===`time`?`time`:`float`}function Vp(e){return e!==`ordinal`&&e!==`time`}function Hp(e,t){var n=t&&t.type;return n===`ordinal`?e:(n===`time`&&!Wa(e)&&e!=null&&e!==`-`&&(e=+ql(e)),e==null||e===``?NaN:Number(e))}function Up(e){var t=``,n=-1/0,r=-1/0,i=1/0,a=1/0;return e&&(e.g!=null&&(t+=`G`+e.g,n=e.g),e.ge!=null&&(t+=`GE`+e.ge,r=e.ge),e.l!=null&&(t+=`L`+e.l,i=e.l),e.le!=null&&(t+=`LE`+e.le,a=e.le)),{key:t,g:n,ge:r,l:i,le:a}}function Wp(e,t){return t>e.g&&t>=e.ge&&t<e.l&&t<=e.le}function Gp(e){return e>65535?dV:fV}function Kp(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function qp(e,t,n,r,i){var a=hV[n||`float`];if(i){var o=e[t],s=o&&o.length;if(s!==r){for(var c=new a(r),l=0;l<s;l++)c[l]=o[l];e[t]=c}}else e[t]=new a(r)}function Jp(e){return e instanceof bV}function Yp(e){for(var t=W(),n=0;n<(e||[]).length;n++){var r=e[n],i=H(r)?r.name:r;i!=null&&t.get(i)==null&&t.set(i,n)}return t}function Xp(e){var t=vV(e);return t.dimNameMap||=Yp(e.dimensionsDefine)}function Zp(e){return e>30}function Qp(e,t){Cp(e)||(e=Tp(e)),t||={};var n=t.coordDimensions||[],r=t.dimensionsDefine||e.dimensionsDefine||[],i=W(),a=[],o=$p(e,n,r,t.dimensionsCount),s=t.canOmitUnusedDimensions&&Zp(o),c=r===e.dimensionsDefine,l=c?Xp(e):Yp(r),u=t.encodeDefine;!u&&t.encodeDefaulter&&(u=t.encodeDefaulter(e,o));for(var d=W(u),f=new pV(o),p=0;p<f.length;p++)f[p]=-1;function m(e){var t=f[e];if(t<0){var n=r[e],i=H(n)?n:{name:n},o=new cV,s=i.name;return s!=null&&l.get(s)!=null&&(o.name=o.displayName=s),i.type!=null&&(o.type=i.type),i.displayName!=null&&(o.displayName=i.displayName),f[e]=a.length,o.storeDimIndex=e,a.push(o),o}return a[t]}if(!s)for(var p=0;p<o;p++)m(p);d.each(function(e,t){var n=cu(e).slice();if(n.length===1&&!V(n[0])&&n[0]<0)d.set(t,!1);else{var r=d.set(t,[]);L(n,function(e,n){var i=V(e)?l.get(e):e;i!=null&&i<o&&(r[n]=i,g(m(i),t,n))})}});var h=0;L(n,function(e){var t,n,r,i;if(V(e))t=e,i={};else{i=e,t=i.name;var a=i.ordinalMeta;i.ordinalMeta=null,i=I({},i),i.ordinalMeta=a,n=i.dimsDef,r=i.otherDims,i.name=i.coordDim=i.coordDimIndex=i.dimsDef=i.otherDims=null}var s=d.get(t);if(s!==!1){if(s=cu(s),!s.length)for(var l=0;l<(n&&n.length||1);l++){for(;h<o&&m(h).coordDim!=null;)h++;h<o&&s.push(h++)}L(s,function(e,a){var o=m(e);if(c&&i.type!=null&&(o.type=i.type),g(Ma(o,i),t,a),o.name==null&&n){var s=n[a];!H(s)&&(s={name:s}),o.name=o.displayName=s.name,o.defaultTooltip=s.defaultTooltip}r&&Ma(o.otherDims,r)})}});function g(e,t,n){BR.get(t)==null?(e.coordDim=t,e.coordDimIndex=n,i.set(t,!0)):e.otherDims[t]=n}var _=t.generateCoord,v=t.generateCoordCount,y=v!=null;v=_?v||1:0;var b=_||`value`;function x(e){e.name??=e.coordDim}if(s)L(a,function(e){x(e)}),a.sort(function(e,t){return e.storeDimIndex-t.storeDimIndex});else for(var S=0;S<o;S++){var C=m(S);C.coordDim??(C.coordDim=em(b,i,y),C.coordDimIndex=0,(!_||v<=0)&&(C.isExtraCoord=!0),v--),x(C),C.type==null&&(xp(e,S)===WB.Must||C.isExtraCoord&&(C.otherDims.itemName!=null||C.otherDims.seriesName!=null))&&(C.type=`ordinal`)}return qu(a,function(e){return e.name},function(e,t){t>0&&(e.name+=t-1)}),new bV({source:e,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function $p(e,t,n,r){var i=Math.max(e.dimensionsDetectedCount||1,t.length,n.length,r||0);return L(t,function(e){var t;H(e)&&(t=e.dimsDef)&&(i=Math.max(i,t.length))}),i}function em(e,t,n){if(n||t.hasKey(e)){for(var r=0;t.hasKey(e+r);)r++;e+=r}return t.set(e,!0),e}function tm(e){return!!IV[e]}function nm(e){zV.set(e.fullType,{getCoord2:void 0}).getCoord2=e.getCoord2}function rm(e){var t=e.getShallow(`coord`,!0),n=1;if(t==null){var r=zV.get(e.type);r&&r.getCoord2&&(n=2,t=r.getCoord2(e))}return{coord:t,from:n}}function im(e,t){var n=e.getShallow(`coordinateSystem`),r=e.getShallow(`coordinateSystemUsage`,!0),i=0;if(n){var a=e.mainType===`series`;r??=a?`data`:`box`,r===`data`?(i=1,a||(i=0)):r===`box`&&(i=2,!a&&!tm(n)&&(i=0))}return{coordSysType:n,kind:i}}function am(e){var t=e.targetModel,n=e.coordSysType,r=e.coordSysProvider,i=e.isDefaultDataCoordSys;e.allowNotFound;var a=im(t,!0),o=a.kind,s=a.coordSysType;if(i&&o!==1&&(o=1,s=n),o===0||s!==n)return 0;var c=r(n,t);return c?(o===1?t.coordinateSystem=c:t.boxCoordinateSystem=c,o):0}function om(e){var t=e.get(`coordinateSystem`),n=new VV(t),r=HV[t];if(r)return r(e,n,n.axisMap,n.categoryAxisMap),n}function sm(e){return e.get(`type`)===`category`}function cm(e,t,n){n||={};var r=n.byIndex,i=n.stackedCoordDimension,a,o,s;lm(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var c=!!(e&&e.get(`stack`)),l,u,d,f,p=!0;function m(e){return e.type!==`ordinal`&&e.type!==`time`}if(L(a,function(e,t){V(e)&&(a[t]=e={name:e}),m(e)||(p=!1)}),L(a,function(e,t){c&&!e.isExtraCoord&&(!r&&!l&&e.ordinalMeta&&(l=e),u||!m(e)||p&&(e.coordDim===`x`||e.coordDim===`angle`)||i&&i!==e.coordDim||(u=e))}),u&&!r&&!l&&(r=!0),u){d=`__\0ecstackresult_`+e.id,f=`__\0ecstackedover_`+e.id,l&&(l.createInvertedIndices=!0);var h=u.coordDim,g=u.type,_=0;L(a,function(e){e.coordDim===h&&_++});var v={name:d,coordDim:h,coordDimIndex:_,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},y={name:f,coordDim:f,coordDimIndex:_+1,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(v.storeDimIndex=s.ensureCalculationDimension(f,g),y.storeDimIndex=s.ensureCalculationDimension(d,g)),o.appendCalculationDimension(v),o.appendCalculationDimension(y)):(a.push(v),a.push(y))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:r,stackedOverDimension:f,stackResultDimension:d}}function lm(e){return!Jp(e.schema)}function um(e,t){return!!t&&t===e.getCalculationInfo(`stackedDimension`)}function dm(e,t){return um(e,t)?e.getCalculationInfo(`stackResultDimension`):t}function fm(e,t){var n=e.get(`coordinateSystem`),r=RV.get(n),i;return t&&t.coordSysDims&&(i=R(t.coordSysDims,function(e){var n={name:e},r=t.axisMap.get(e);return r&&(n.type=Bp(r.get(`type`))),n})),i||=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||[`x`,`y`],i}function pm(e,t,n){var r,i;return n&&L(e,function(e,a){var o=e.coordDim,s=n.categoryAxisMap.get(o);s&&(r??=a,e.ordinalMeta=s.getOrdinalMeta(),t&&(e.createInvertedIndices=!0)),e.otherDims.itemName!=null&&(i=!0)}),!i&&r!=null&&(e[r].otherDims.itemName=0),r}function mm(e,t,n){n||={};var r=t.getSourceManager(),i,a=!1;e?(a=!0,i=Tp(e)):(i=r.getSource(),a=i.sourceFormat===VR);var o=om(t),s=fm(t,o),c=n.useEncodeDefaulter,l=B(c)?c:c?Ha(_p,s,t):null,u={coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:l,canOmitUnusedDimensions:!a},d=Qp(i,u),f=pm(d.dimensions,n.createInvertedIndices,o),p=a?null:r.getSharedDataStore(d),m=cm(t,{schema:d,store:p}),h=new FV(d,t);h.setCalculationInfo(m);var g=f!=null&&hm(i)?function(e,t,n,r){return r===f?n:this.defaultDimValueGetter(e,t,n,r)}:null;return h.hasItemOption=!1,h.initData(a?i:p,null,g),h}function hm(e){if(e.sourceFormat===`original`)return!z(uu(gm(e.data||[])))}function gm(e){for(var t=0;t<e.length&&e[t]==null;)t++;return e[t]}function _m(e){return[e||``,UV++].join(`_`)}function vm(e){var t={};e.registerSubTypeDefaulter=function(e,n){var r=uo(e);t[r.main]=n},e.determineSubType=function(n,r){var i=r.type;if(!i){var a=uo(n).main;e.hasSubTypes(n)&&t[a]&&(i=t[a](r))}return i}}function ym(e,t){e.topologicalTravel=function(e,t,r,i){if(!e.length)return;var a=n(t),o=a.graph,s=a.noEntryList,c={};for(L(e,function(e){c[e]=!0});s.length;){var l=s.pop(),u=o[l],d=!!c[l];d&&(r.call(i,l,u.originalDeps.slice()),delete c[l]),L(u.successor,d?p:f)}L(c,function(){throw Error(``)});function f(e){o[e].entryCount--,o[e].entryCount===0&&s.push(e)}function p(e){c[e]=!0,f(e)}};function n(e){var n={},a=[];return L(e,function(o){var s=r(n,o),c=i(s.originalDeps=t(o),e);s.entryCount=c.length,s.entryCount===0&&a.push(o),L(c,function(e){Na(s.predecessor,e)<0&&s.predecessor.push(e);var t=r(n,e);Na(t.successor,e)<0&&t.successor.push(o)})}),{graph:n,noEntryList:a}}function r(e,t){return e[t]||(e[t]={predecessor:[],successor:[]}),e[t]}function i(e,t){var n=[];return L(e,function(e){Na(t,e)>=0&&n.push(e)}),n}}function bm(e,t){return Aa(Aa({},e,!0),t,!0)}function xm(e,t,n,r,i,a){var o=r+`-`+i,s=e.length;if(a.hasOwnProperty(o))return a[o];if(t===1){var c=Math.round(Math.log((1<<s)-1&~i)/WV);return e[n][c]}for(var l=r|1<<n,u=n+1;r&1<<u;)u++;for(var d=0,f=0,p=0;f<s;f++){var m=1<<f;m&i||(d+=(p%2?-1:1)*e[n][f]*xm(e,t-1,u,l,i|m,a),p++)}return a[o]=d,d}function Sm(e,t){var n=[[e[0],e[1],1,0,0,0,-t[0]*e[0],-t[0]*e[1]],[0,0,0,e[0],e[1],1,-t[1]*e[0],-t[1]*e[1]],[e[2],e[3],1,0,0,0,-t[2]*e[2],-t[2]*e[3]],[0,0,0,e[2],e[3],1,-t[3]*e[2],-t[3]*e[3]],[e[4],e[5],1,0,0,0,-t[4]*e[4],-t[4]*e[5]],[0,0,0,e[4],e[5],1,-t[5]*e[4],-t[5]*e[5]],[e[6],e[7],1,0,0,0,-t[6]*e[6],-t[6]*e[7]],[0,0,0,e[6],e[7],1,-t[7]*e[6],-t[7]*e[7]]],r={},i=xm(n,8,0,0,0,r);if(i!==0){for(var a=[],o=0;o<8;o++)for(var s=0;s<8;s++)a[s]??(a[s]=0),a[s]+=((o+s)%2?-1:1)*xm(n,7,+(o===0),1<<o,1<<s,r)/i*t[o];return function(e,t,n){var r=t*a[6]+n*a[7]+1;e[0]=(t*a[0]+n*a[1]+a[2])/r,e[1]=(t*a[3]+n*a[4]+a[5])/r}}}function Cm(e,t,n,r,i){return Tm(KV,t,r,i,!0)&&Tm(e,n,KV[0],KV[1])}function wm(e,t){e&&n(e),t&&n(t);function n(e){var t=e[GV];t&&(t.clearMarkers&&t.clearMarkers(),delete e[GV])}}function Tm(e,t,n,r,i){if(t.getBoundingClientRect&&dF.domSupported&&!Om(t)){var a=t[GV]||(t[GV]={}),o=Dm(Em(t,a),a,i);if(o)return o(e,n,r),!0}return!1}function Em(e,t){var n=t.markers;if(n)return n;n=t.markers=[];for(var r=[`left`,`right`],i=[`top`,`bottom`],a=0;a<4;a++){var o=document.createElement(`div`),s=o.style,c=a%2,l=(a>>1)%2;s.cssText=[`position: absolute`,`visibility: hidden`,`padding: 0`,`margin: 0`,`border-width: 0`,`user-select: none`,`width:0`,`height:0`,r[c]+`:0`,i[l]+`:0`,r[1-c]+`:auto`,i[1-l]+`:auto`,``].join(`!important;`),e.appendChild(o),n.push(o)}return t.clearMarkers=function(){L(n,function(e){e.parentNode&&e.parentNode.removeChild(e)})},n}function Dm(e,t,n){for(var r=n?`invTrans`:`trans`,i=t[r],a=t.srcCoords,o=[],s=[],c=!0,l=0;l<4;l++){var u=e[l].getBoundingClientRect(),d=2*l,f=u.left,p=u.top;o.push(f,p),c=c&&a&&f===a[d]&&p===a[d+1],s.push(e[l].offsetLeft,e[l].offsetTop)}return c&&i?i:(t.srcCoords=o,t[r]=n?Sm(s,o):Sm(o,s))}function Om(e){return e.nodeName.toUpperCase()===`CANVAS`}function km(e){return e==null?``:(e+``).replace(qV,function(e,t){return JV[t]})}function Am(e,t){e=e.toUpperCase(),tH[e]=new HB(t),eH[e]=t}function jm(e){if(V(e)){var t=eH[e.toUpperCase()]||{};return e===ZV||e===QV?ka(t):Aa(ka(t),ka(eH[$V]),!1)}return Aa(ka(e),ka(eH[$V]),!1)}function Mm(e){return tH[e]}function Nm(){return tH[$V]}function Pm(e){rH||=e}function Fm(){return rH}function Im(e,t){var n=Fm(),r=t.breakOption,i=t.breakParsed;return!i&&n&&(i=n.parseAxisBreakOption(r,e)),i}function Lm(e){var t=e.brk;return t?t.breaks:[]}function Rm(e){var t=e.brk;return t?t.hasBreaks():!1}function zm(e){return!V(e)&&!B(e)?Bm(e):e}function Bm(e){e||={};var t={},n=!0;return L(mH,function(t){n&&=e[t]==null}),L(mH,function(r,i){var a=e[r];t[r]={};for(var o=null,s=i;s>=0;s--){var c=mH[s],l=H(a)&&!z(a)?a[c]:a,u=void 0;z(l)?(u=l.slice(),o=u[0]||``):V(l)?(o=l,u=[o]):(o==null?o=uH[r]:lH[c].test(o)||(o=t[c][c][0]+` `+o),u=[o],n&&(u[1]=`{primary|`+o+`}`)),t[r][c]=u}}),t}function Vm(e,t){return e+=``,`0000`.substr(0,t-e.length)+e}function Hm(e){switch(e){case`half-year`:case`quarter`:return`month`;case`week`:case`half-week`:return`day`;case`half-day`:case`quarter-day`:return`hour`;default:return e}}function Um(e){return e===Hm(e)}function Wm(e){switch(e){case`year`:case`month`:return`day`;case`millisecond`:return`millisecond`;default:return`second`}}function Gm(e,t,n,r){var i=ql(e),a=i[Ym(n)](),o=i[Xm(n)]()+1,s=Math.floor((o-1)/3)+1,c=i[Zm(n)](),l=i[`get`+(n?`UTC`:``)+`Day`](),u=i[Qm(n)](),d=(u-1)%12+1,f=i[$m(n)](),p=i[eh(n)](),m=i[th(n)](),h=u>=12?`pm`:`am`,g=h.toUpperCase(),_=(r instanceof HB?r:Mm(r||nH)||Nm()).getModel(`time`),v=_.get(`month`),y=_.get(`monthAbbr`),b=_.get(`dayOfWeek`),x=_.get(`dayOfWeekAbbr`);return(t||``).replace(/{a}/g,h+``).replace(/{A}/g,g+``).replace(/{yyyy}/g,a+``).replace(/{yy}/g,Vm(a%100+``,2)).replace(/{Q}/g,s+``).replace(/{MMMM}/g,v[o-1]).replace(/{MMM}/g,y[o-1]).replace(/{MM}/g,Vm(o,2)).replace(/{M}/g,o+``).replace(/{dd}/g,Vm(c,2)).replace(/{d}/g,c+``).replace(/{eeee}/g,b[l]).replace(/{ee}/g,x[l]).replace(/{e}/g,l+``).replace(/{HH}/g,Vm(u,2)).replace(/{H}/g,u+``).replace(/{hh}/g,Vm(d+``,2)).replace(/{h}/g,d+``).replace(/{mm}/g,Vm(f,2)).replace(/{m}/g,f+``).replace(/{ss}/g,Vm(p,2)).replace(/{s}/g,p+``).replace(/{SSS}/g,Vm(m,3)).replace(/{S}/g,m+``)}function Km(e,t,n,r,i){var a=null;if(V(n))a=n;else if(B(n)){var o={time:e.time,level:e.time?e.time.level:0},s=Fm();s&&s.makeAxisLabelFormatterParamBreak(o,e.break),a=n(e.value,t,o)}else{var c=e.time;if(c){var l=n[c.lowerTimeUnit][c.upperTimeUnit];a=l[Math.min(c.level,l.length-1)]||``}else{var u=qm(e.value,i);a=n[u][u][0]}}return Gm(new Date(e.value),a,i,r)}function qm(e,t){var n=ql(e),r=n[Xm(t)]()+1,i=n[Zm(t)](),a=n[Qm(t)](),o=n[$m(t)](),s=n[eh(t)](),c=n[th(t)]()===0,l=c&&s===0,u=l&&o===0,d=u&&a===0,f=d&&i===1;return f&&r===1?`year`:f?`month`:d?`day`:u?`hour`:l?`minute`:c?`second`:`millisecond`}function Jm(e,t,n){switch(t){case`year`:e[rh(n)](0);case`month`:e[ih(n)](1);case`day`:e[ah(n)](0);case`hour`:e[oh(n)](0);case`minute`:e[sh(n)](0);case`second`:e[ch(n)](0)}return e}function Ym(e){return e?`getUTCFullYear`:`getFullYear`}function Xm(e){return e?`getUTCMonth`:`getMonth`}function Zm(e){return e?`getUTCDate`:`getDate`}function Qm(e){return e?`getUTCHours`:`getHours`}function $m(e){return e?`getUTCMinutes`:`getMinutes`}function eh(e){return e?`getUTCSeconds`:`getSeconds`}function th(e){return e?`getUTCMilliseconds`:`getMilliseconds`}function nh(e){return e?`setUTCFullYear`:`setFullYear`}function rh(e){return e?`setUTCMonth`:`setMonth`}function ih(e){return e?`setUTCDate`:`setDate`}function ah(e){return e?`setUTCHours`:`setHours`}function oh(e){return e?`setUTCMinutes`:`setMinutes`}function sh(e){return e?`setUTCSeconds`:`setSeconds`}function ch(e){return e?`setUTCMilliseconds`:`setMilliseconds`}function lh(e){if(!$l(e))return V(e)?e:`-`;var t=(e+``).split(`.`);return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,`$1,`)+(t.length>1?`.`+t[1]:``)}function uh(e,t){return e=(e||``).toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()}),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}function dh(e,t,n){var r=`{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}`;function i(e){return e&&no(e)?e:`-`}function a(e){return ru(e)}var o=t===`time`,s=e instanceof Date;if(o||s){var c=o?ql(e):e;if(!isNaN(+c))return Gm(c,r,n);if(s)return`-`}if(t===`ordinal`)return Ua(e)?i(e):Wa(e)&&a(e)?e+``:`-`;var l=Ql(e);return a(l)?lh(l):Ua(e)?i(e):typeof e==`boolean`?e+``:`-`}function fh(e,t,n){z(t)||(t=[t]);var r=t.length;if(!r)return``;for(var i=t[0].$vars||[],a=0;a<i.length;a++){var o=_H[a];e=e.replace(vH(o),vH(o,0))}for(var s=0;s<r;s++)for(var c=0;c<i.length;c++){var l=t[s][i[c]];e=e.replace(vH(_H[c],s),n?km(l):l)}return e}function ph(e,t,n){return L(t,function(t,r){e=e.replace(`{`+r+`}`,n?km(t):t)}),e}function mh(e,t){var n=V(e)?{color:e,extraCssText:t}:e||{},r=n.color,i=n.type;t=n.extraCssText;var a=n.renderMode||`html`;return r?a===`html`?i===`subItem`?`<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:`+km(r)+`;`+(t||``)+`"></span>`:`<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:`+km(r)+`;`+(t||``)+`"></span>`:{renderMode:a,content:`{`+(n.markerId||`markerX`)+`|} `,style:i===`subItem`?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}:``}function hh(e,t){return t||=`transparent`,V(e)?e:H(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function gh(e,t){if(t===`_blank`||t===`blank`){var n=window.open();n.opener=null,n.location.href=e}else window.open(e,t)}function _h(e,t,n,r,i){var a=0,o=0;r??=1/0,i??=1/0;var s=0;t.eachChild(function(c,l){var u=c.getBoundingRect(),d=t.childAt(l+1),f=d&&d.getBoundingRect(),p,m;if(e===`horizontal`){var h=u.width+(f?-f.x+u.x:0);p=a+h,p>r||c.newline?(a=0,p=h,o+=s+n,s=u.height):s=Math.max(s,u.height)}else{var g=u.height+(f?-f.y+u.y:0);m=o+g,m>i||c.newline?(a+=s+n,o=0,m=g,s=u.width):s=Math.max(s,u.width)}c.newline||(c.x=a,c.y=o,c.markRedraw(),e===`horizontal`?a=p+n:o=m+n)})}function vh(e,t){return{left:e.getShallow(`left`,t),top:e.getShallow(`top`,t),right:e.getShallow(`right`,t),bottom:e.getShallow(`bottom`,t),width:e.getShallow(`width`,t),height:e.getShallow(`height`,t)}}function yh(e,t){var n=Sh(e,t,{enableLayoutOnlyByCenter:!0}),r=e.getBoxLayoutParams(),i,a;if(n.type===CH.point)a=n.refPoint,i=xh(r,{width:t.getWidth(),height:t.getHeight()});else{var o=e.get(`center`),s=z(o)?o:[o,o];i=xh(r,n.refContainer),a=n.boxCoordFrom===2?n.refPoint:[Y(s[0],i.width)+i.x,Y(s[1],i.height)+i.y]}return{viewRect:i,center:a}}function bh(e,t){var n=yh(e,t),r=n.viewRect,i=n.center,a=e.get(`radius`);z(a)||(a=[0,a]);var o=Y(r.width,t.getWidth()),s=Y(r.height,t.getHeight()),c=Math.min(o,s),l=Y(a[0],c/2),u=Y(a[1],c/2);return{cx:i[0],cy:i[1],r0:l,r:u,viewRect:r}}function xh(e,t,n){n=gH(n||0);var r=t.width,i=t.height,a=Y(e.left,r),o=Y(e.top,i),s=Y(e.right,r),c=Y(e.bottom,i),l=Y(e.width,r),u=Y(e.height,i),d=n[2]+n[0],f=n[1]+n[3],p=e.aspect;switch(isNaN(l)&&(l=r-s-f-a),isNaN(u)&&(u=i-c-d-o),p!=null&&(isNaN(l)&&isNaN(u)&&(p>r/i?l=r*.8:u=i*.8),isNaN(l)&&(l=p*u),isNaN(u)&&(u=l/p)),isNaN(a)&&(a=r-s-l-f),isNaN(o)&&(o=i-c-u-d),e.left||e.right){case`center`:a=r/2-l/2-n[3];break;case`right`:a=r-l-f}switch(e.top||e.bottom){case`middle`:case`center`:o=i/2-u/2-n[0];break;case`bottom`:o=i-u-d}a||=0,o||=0,isNaN(l)&&(l=r-f-a-(s||0)),isNaN(u)&&(u=i-d-o-(c||0));var m=new J((t.x||0)+a+n[3],(t.y||0)+o+n[0],l,u);return m.margin=n,m}function Sh(e,t,n){var r,i,a,o=e.boxCoordinateSystem,s;if(o){var c=rm(e),l=c.coord,u=c.from;if(o.dataToLayout){a=CH.rect,s=u;var d=o.dataToLayout(l);r=d.contentRect||d.rect}else n&&n.enableLayoutOnlyByCenter&&o.dataToPoint&&(a=CH.point,s=u,i=o.dataToPoint(l))}return a??=CH.rect,a===CH.rect&&(r||={x:0,y:0,width:t.getWidth(),height:t.getHeight()},i=[r.x+r.width/2,r.y+r.height/2]),{type:a,refContainer:r,refPoint:i,boxCoordFrom:s}}function Ch(e,t,n,r,i,a){var o=!i||!i.hv||i.hv[0],s=!i||!i.hv||i.hv[1],c=i&&i.boundingMode||`all`;if(a||=e,a.x=e.x,a.y=e.y,!o&&!s)return!1;var l;if(c===`raw`)l=e.type===`group`?new J(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(l=e.getBoundingRect(),e.needLocalTransform()){var u=e.getLocalTransform();l=l.clone(),l.applyTransform(u)}var d=xh(Ma({width:l.width,height:l.height},t),n,r),f=o?d.x-l.x:0,p=s?d.y-l.y:0;return c===`raw`?(a.x=f,a.y=p):(a.x+=f,a.y+=p),a===e&&e.markRedraw(),!0}function wh(e,t){return e[xH[t][0]]!=null||e[xH[t][1]]!=null&&e[xH[t][2]]!=null}function Th(e){var t=e.layoutMode||e.constructor.layoutMode;return H(t)?t:t?{type:t}:null}function Eh(e,t,n){var r=n&&n.ignoreSize;!z(r)&&(r=[r,r]);var i=o(xH[0],0),a=o(xH[1],1);c(xH[0],e,i),c(xH[1],e,a);function o(n,i){var a={},o=0,c={},l=0,u=2;if(yH(n,function(t){c[t]=e[t]}),yH(n,function(e){so(t,e)&&(a[e]=c[e]=t[e]),s(a,e)&&o++,s(c,e)&&l++}),r[i])return s(t,n[1])?c[n[2]]=null:s(t,n[2])&&(c[n[1]]=null),c;if(l===u||!o)return c;if(o>=u)return a;for(var d=0;d<n.length;d++){var f=n[d];if(!so(a,f)&&so(e,f)){a[f]=e[f];break}}return a}function s(e,t){return e[t]!=null&&e[t]!==`auto`}function c(e,t,n){yH(e,function(e){t[e]=n[e]})}}function Dh(e){return Oh({},e)}function Oh(e,t){return t&&e&&yH(bH,function(n){so(t,n)&&(e[n]=t[n])}),e}function kh(e){var t=[];return L(TH.getClassesByMainType(e),function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])}),t=R(t,function(e){return uo(e).main}),e!==`dataset`&&Na(t,`dataset`)<=0&&t.unshift(`dataset`),t}function Ah(e,t,n,r){return Mh(e,DH,cu(e.get([`aria`,`decal`,`decals`])),null,t,n,r)}function jh(e,t){for(var n=e.length,r=0;r<n;r++)if(e[r].length>t)return e[r];return e[n-1]}function Mh(e,t,n,r,i,a,o){a||=e;var s=t(a),c=s.paletteIdx||0,l=s.paletteNameMap=s.paletteNameMap||{};if(l.hasOwnProperty(i))return l[i];var u=o==null||!r?n:jh(r,o);if(u||=n,u&&u.length){var d=u[c];return i&&(l[i]=d),s.paletteIdx=(c+1)%u.length,d}}function Nh(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}function Ph(e){var t,n;return H(e)?e.type&&(n=e):t=e,{text:t,frag:n}}function Fh(e){return new jH(e)}function Ih(e,t){var n=new NH,r=e.data,i=n.sourceFormat=e.sourceFormat,a=e.startIndex;e.seriesLayoutBy!==`column`&&ou(``);var o=[],s={},c=e.dimensionsDefine;if(c)L(c,function(e,t){var n=e.name,r={index:t,name:n,displayName:e.displayName};o.push(r),n!=null&&(so(s,n)&&ou(``),s[n]=r)});else for(var l=0;l<e.dimensionsDetectedCount;l++)o.push({index:l});var u=Np(i,qR);t.__isBuiltIn&&(n.getRawDataItem=function(e){return u(r,a,o,e)},n.getRawData=q(Lh,null,e)),n.cloneRawData=q(Rh,null,e),n.count=q(Pp(i,qR),null,r,a,o);var d=Fp(i);n.retrieveValue=function(e,t){return f(u(r,a,o,e),t)};var f=n.retrieveValueFromItem=function(e,t){if(e!=null){var n=o[t];if(n)return d(e,t,n.name)}};return n.getDimensionInfo=q(zh,null,o,s),n.cloneAllDimensionInfo=q(Bh,null,o),n}function Lh(e){var t=e.sourceFormat;return Wh(t)||ou(``),e.data}function Rh(e){var t=e.sourceFormat,n=e.data;if(Wh(t)||ou(``),t===`arrayRows`){for(var r=[],i=0,a=n.length;i<a;i++)r.push(n[i].slice());return r}if(t===`objectRows`){for(var r=[],i=0,a=n.length;i<a;i++)r.push(I({},n[i]));return r}}function zh(e,t,n){if(n!=null){if(Wa(n)||!isNaN(n)&&!so(t,n))return e[n];if(so(t,n))return t[n]}}function Bh(e){return ka(e)}function Vh(e){e=ka(e);var t=e.type,n=``;t||ou(n);var r=t.split(`:`);r.length!==2&&ou(n);var i=!1;r[0]===`echarts`&&(t=r[1],i=!0),e.__isBuiltIn=i,PH.set(t,e)}function Hh(e,t,n){var r=cu(e),i=r.length;i||ou(``);for(var a=0,o=i;a<o;a++){var s=r[a];t=Uh(s,t,n,i===1?null:a),a!==o-1&&(t.length=Math.max(t.length,1))}return t}function Uh(e,t,n,r){var i=``;t.length||ou(i),H(e)||ou(i);var a=e.type,o=PH.get(a);o||ou(i);var s=R(t,function(e){return Ih(e,o)});return R(cu(o.transform({upstream:s[0],upstreamList:s,config:ka(e.config)})),function(e,n){var r=``;H(e)||ou(r),e.data||ou(r),Wh(Dp(e.data))||ou(r);var i,a=t[0];if(a&&n===0&&!e.dimensions){var o=a.startIndex;o&&(e.data=a.data.slice(0,o).concat(e.data)),i={seriesLayoutBy:qR,sourceHeader:o,dimensions:a.metaRawOption.dimensions}}else i={seriesLayoutBy:qR,sourceHeader:0,dimensions:e.dimensions};return wp(e.data,i,null)})}function Wh(e){return e===`arrayRows`||e===`objectRows`}function Gh(e){return e.mainType===`series`}function Kh(e){throw Error(e)}function qh(e){var t=e.lineHeight;return t==null?RH:`line-height:`+km(t+``)+`px`}function Jh(e,t){var n=e.color||X.color.tertiary,r=e.fontSize||12,i=e.fontWeight||`400`,a=e.color||X.color.secondary,o=e.fontSize||14,s=e.fontWeight||`900`;return t===`html`?{nameStyle:`font-size:`+km(r+``)+`px;color:`+km(n)+`;font-weight:`+km(i+``),valueStyle:`font-size:`+km(o+``)+`px;color:`+km(a)+`;font-weight:`+km(s+``)}:{nameStyle:{fontSize:r,fill:n,fontWeight:i},valueStyle:{fontSize:o,fill:a,fontWeight:s}}}function Yh(e,t){return t.type=e,t}function Xh(e){return e.type===`section`}function Zh(e){return Xh(e)?$h:lee}function Qh(e){if(Xh(e)){var t=0,n=e.blocks.length,r=n>1||n>0&&!e.noHeader;return L(e.blocks,function(e){var n=Qh(e);n>=t&&(t=n+ +(r&&(!n||Xh(e)&&!e.noHeader)))}),t}return 0}function $h(e,t,n,r){var i=t.noHeader,a=tg(Qh(t)),o=[],s=t.blocks||[];to(!s||z(s)),s||=[];var c=e.orderMode;if(t.sortBlocks&&c){s=s.slice();var l={valueAsc:`asc`,valueDesc:`desc`};if(so(l,c)){var u=new uV(l[c],null);s.sort(function(e,t){return u.evaluate(e.sortParam,t.sortParam)})}else c===`seriesDesc`&&s.reverse()}L(s,function(n,i){var s=t.valueFormatter,c=Zh(n)(s?I(I({},e),{valueFormatter:s}):e,n,i>0?a.html:0,r);c!=null&&o.push(c)});var d=e.renderMode===`richText`?o.join(a.richText):ng(r,o.join(``),i?n:a.html);if(i)return d;var f=dh(t.header,`ordinal`,e.useUTC),p=Jh(r,e.renderMode).nameStyle,m=qh(r);return e.renderMode===`richText`?ag(e,f,p)+a.richText+d:ng(r,`<div style="`+p+`;`+m+`;">`+km(f)+`</div>`+d,n)}function lee(e,t,n,r){var i=e.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,c=t.name,l=e.useUTC,u=t.valueFormatter||e.valueFormatter||function(e){return e=z(e)?e:[e],R(e,function(e,t){return dh(e,z(p)?p[t]:p,l)})};if(!(a&&o)){var d=s?``:e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||X.color.secondary,i),f=a?``:dh(c,`ordinal`,l),p=t.valueType,m=o?[]:u(t.value,t.rawDataIndex),h=!s||!a,g=!s&&a,_=Jh(r,i),v=_.nameStyle,y=_.valueStyle;return i===`richText`?(s?``:d)+(a?``:ag(e,f,v))+(o?``:og(e,m,h,g,y)):ng(r,(s?``:d)+(a?``:rg(f,!s,v))+(o?``:ig(m,h,g,y)),n)}}function eg(e,t,n,r,i,a){if(e)return Zh(e)({useUTC:i,renderMode:n,orderMode:r,markupStyleCreator:t,valueFormatter:e.valueFormatter},e,0,a)}function tg(e){return{html:zH[e],richText:BH[e]}}function ng(e,t,n){var r=`<div style="clear:both"></div>`,i=`margin: `+n+`px 0 0`,a=qh(e);return`<div style="`+i+`;`+a+`;">`+t+r+`</div>`}function rg(e,t,n){var r=t?`margin-left:2px`:``;return`<span style="`+n+`;`+r+`">`+km(e)+`</span>`}function ig(e,t,n,r){var i=t?`float:right;margin-left:`+(n?`10px`:`20px`):``;return e=z(e)?e:[e],`<span style="`+i+`;`+r+`">`+R(e,function(e){return km(e)}).join(`&nbsp;&nbsp;`)+`</span>`}function ag(e,t,n){return e.markupStyleCreator.wrapRichTextStyle(t,n)}function og(e,t,n,r,i){var a=[i],o=r?10:20;return n&&a.push({padding:[0,0,0,o],align:`right`}),e.markupStyleCreator.wrapRichTextStyle(z(t)?t.join(` `):t,a)}function sg(e,t){var n=e.getData().getItemVisual(t,`style`)[e.visualDrawType];return hh(n)}function cg(e,t){return e.get(`padding`)??(t===`richText`?[8,10]:10)}function lg(e){var t=e.series,n=e.dataIndex,r=e.multipleSeries,i=t.getData(),a=i.mapDimensionsAll(`defaultedTooltip`),o=a.length,s=t.getRawValue(n),c=z(s),l=sg(t,n),u,d,f,p;if(o>1||c&&!o){var m=ug(s,t,n,a,l);u=m.inlineValues,d=m.inlineValueTypes,f=m.blocks,p=m.inlineValues[0]}else if(o){var h=i.getDimensionInfo(a[0]);p=u=Lp(i,n,a[0]),d=h.type}else p=u=c?s[0]:s;var g=Su(t),_=g&&t.name||``,v=i.getName(n),y=r?_:v;return Yh(`section`,{header:_,noHeader:r||!g,sortParam:p,blocks:[Yh(`nameValue`,{markerType:`item`,markerColor:l,name:y,noName:!no(y),value:u,valueType:d,rawDataIndex:i.getRawIndex(n)})].concat(f||[])})}function ug(e,t,n,r,i){var a=t.getData(),o=La(e,function(e,t,n){var r=a.getDimensionInfo(n);return e||=r&&r.tooltip!==!1&&r.displayName!=null},!1),s=[],c=[],l=[];r.length?L(r,function(e){u(Lp(a,n,e),e)}):L(e,u);function u(e,t){var n=a.getDimensionInfo(t);n&&n.otherDims.tooltip!==!1&&(o?l.push(Yh(`nameValue`,{markerType:`subItem`,markerColor:i,name:n.displayName,value:e,valueType:n.type})):(s.push(e),c.push(n.type)))}return{inlineValues:s,inlineValueTypes:c,blocks:l}}function dg(e,t){return e.getName(t)||e.getId(t)}function fg(e){var t=e.name;Su(e)||(e.name=pg(e)||t)}function pg(e){var t=e.getRawData(),n=t.mapDimensionsAll(`seriesName`),r=[];return L(n,function(e){var n=t.getDimensionInfo(e);n.displayName&&r.push(n.displayName)}),r.join(` `)}function mg(e){return e.model.getRawData().count()}function hg(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),gg}function gg(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function _g(e,t){L(iee(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(n){e.wrapMethod(n,Ha(vg,t))})}function vg(e,t){var n=yg(e);return n&&n.setOutputEnd((t||this).count()),t}function yg(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var r=n.currentTask;if(r){var i=r.agentStubMap;i&&(r=i.get(e.uid))}return r}}function bg(e,t){if(this.type!==`image`){var n=this.style;this.__isEmptyBrush?(n.stroke=e,n.fill=t||X.color.neutral00,n.lineWidth=2):this.shape.symbolType===`line`?n.stroke=e:n.fill=e,this.markRedraw()}}function xg(e,t,n,r,i,a,o){var s=e.indexOf(`empty`)===0;s&&(e=e.substr(5,1).toLowerCase()+e.substr(6));var c=e.indexOf(`image://`)===0?Cf(e.slice(8),new J(t,n,r,i),o?`center`:`cover`):e.indexOf(`path://`)===0?Sf(e.slice(7),{},new J(t,n,r,i),o?`center`:`cover`):new JH({shape:{symbolType:e,x:t,y:n,width:r,height:i}});return c.__isEmptyBrush=s,c.setColor=bg,a&&c.setColor(a),c}function Sg(e){return z(e)||(e=[+e,+e]),[e[0]||0,e[1]||0]}function Cg(e,t){if(e!=null)return z(e)||(e=[e,e]),[Y(e[0],t[0])||0,Y(U(e[1],e[0]),t[1])||0]}function wg(e,t){var n=e.mapDimensionsAll(`defaultedLabel`),r=n.length;if(r===1){var i=Lp(e,t,n[0]);return i==null?null:i+``}if(r){for(var a=[],o=0;o<n.length;o++)a.push(Lp(e,t,n[o]));return a.join(` `)}}function Tg(e,t){var n=e.mapDimensionsAll(`defaultedLabel`);if(!z(t))return t+``;for(var r=[],i=0;i<n.length;i++){var a=e.getDimensionIndex(n[i]);a>=0&&r.push(t[a])}return r.join(` `)}function Eg(e,t){this.parent.drift(e,t)}function Dg(e,t,n,r){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(r&&r.isIgnore&&r.isIgnore(n))&&!(r&&r.clipShape&&!r.clipShape.contain(t[0],t[1]))&&e.getItemVisual(n,`symbol`)!==`none`}function Og(e){return e!=null&&!H(e)&&(e={isIgnore:e}),e||{}}function kg(e){var t=e.hostModel,n=t.getModel(`emphasis`);return{emphasisItemStyle:n.getModel(`itemStyle`).getItemStyle(),blurItemStyle:t.getModel([`blur`,`itemStyle`]).getItemStyle(),selectItemStyle:t.getModel([`select`,`itemStyle`]).getItemStyle(),focus:n.get(`focus`),blurScope:n.get(`blurScope`),emphasisDisabled:n.get(`disabled`),hoverScale:n.get(`scale`),labelStatesModels:ap(t),cursorStyle:t.get(`cursor`)}}function Ag(e,t,n,r,i,a,o){var s=new e(t,n,r,i);return s.setPosition(a),t.setItemGraphicEl(n,s),o.add(s),s}function jg(e,t,n){var r=e.getBaseAxis(),i=e.getOtherAxis(r),a=Mg(i,n),o=r.dim,s=i.dim,c=t.mapDimension(s),l=t.mapDimension(o),u=+(s===`x`||s===`radius`),d=R(e.dimensions,function(e){return t.mapDimension(e)}),f=!1,p=t.getCalculationInfo(`stackResultDimension`);return um(t,d[0])&&(f=!0,d[0]=p),um(t,d[1])&&(f=!0,d[1]=p),{dataDimsForPoint:d,valueStart:a,valueAxisDim:s,baseAxisDim:o,stacked:!!f,valueDim:c,baseDim:l,baseDataOffset:u,stackedOverDimension:t.getCalculationInfo(`stackedOverDimension`)}}function Mg(e,t){var n=0,r=e.scale.getExtent();return t===`start`?n=r[0]:t===`end`?n=r[1]:Wa(t)&&!isNaN(t)?n=t:r[0]>0?n=r[0]:r[1]<0&&(n=r[1]),n}function Ng(e,t,n,r){var i=NaN;e.stacked&&(i=n.get(n.getCalculationInfo(`stackedOverDimension`),r)),isNaN(i)&&(i=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=n.get(e.baseDim,r),o[1-a]=i,t.dataToPoint(o)}function Pg(e,t){return!isFinite(e)||!isFinite(t)}function Fg(e){return Ig({ctor:QH},e).arr}function Ig(e,t){var n=e.arr,r=e.ctor;if(t>TR&&(t=TR),!n||e.typed&&n.length<t){var i=void 0;if(r)try{i=new r(t),e.typed=!0,n&&i.set(n)}catch{}if(!i&&(i=[],e.typed=!1,n))for(var a=0,o=n.length;a<o;a++)i[a]=n[a];e.arr=i}return e}function Lg(e,t){var n=[];return t.diff(e).add(function(e){n.push({cmd:`+`,idx:e})}).update(function(e,t){n.push({cmd:`=`,idx:t,idx1:e})}).remove(function(e){n.push({cmd:`-`,idx:e})}).execute(),n}function Rg(e,t,n,r,i,a,o,s){for(var c=Lg(e,t),l=[],u=[],d=[],f=[],p=[],m=[],h=[],g=jg(i,t,o),_=e.getLayout(`points`)||[],v=t.getLayout(`points`)||[],y=0;y<c.length;y++){var b=c[y],x=!0,S=void 0,C=void 0;switch(b.cmd){case`=`:S=b.idx*2,C=b.idx1*2;var w=_[S],T=_[S+1],E=v[C],D=v[C+1];(isNaN(w)||isNaN(T))&&(w=E,T=D),l.push(w,T),u.push(E,D),d.push(n[S],n[S+1]),f.push(r[C],r[C+1]),h.push(t.getRawIndex(b.idx1));break;case`+`:var O=b.idx,k=g.dataDimsForPoint,A=i.dataToPoint([t.get(k[0],O),t.get(k[1],O)]);C=O*2,l.push(A[0],A[1]),u.push(v[C],v[C+1]);var j=Ng(g,i,t,O);d.push(j[0],j[1]),f.push(r[C],r[C+1]),h.push(t.getRawIndex(O));break;case`-`:x=!1}x&&(p.push(b),m.push(m.length))}m.sort(function(e,t){return h[e]-h[t]});for(var M=l.length,ee=Fg(M),te=Fg(M),ne=Fg(M),re=Fg(M),ie=[],y=0;y<m.length;y++){var ae=m[y],oe=y*2,se=ae*2;ee[oe]=l[se],ee[oe+1]=l[se+1],te[oe]=u[se],te[oe+1]=u[se+1],ne[oe]=d[se],ne[oe+1]=d[se+1],re[oe]=f[se],re[oe+1]=f[se+1],ie[y]=p[ae]}return{current:ee,next:te,stackedOnCurrent:ne,stackedOnNext:re,status:ie}}function zg(e,t,n,r,i,a,o,s,c){for(var l,u,d,f,p,m,h=n,g=0;g<r;g++){var _=t[h*2],v=t[h*2+1];if(h>=i||h<0)break;if(Pg(_,v)){if(c){h+=a;continue}break}if(h===n)e[a>0?`moveTo`:`lineTo`](_,v),d=_,f=v;else{var y=_-l,b=v-u;if(y*y+b*b<.5){h+=a;continue}if(o>0){for(var x=h+a,S=t[x*2],C=t[x*2+1];S===_&&C===v&&g<r;)g++,x+=a,h+=a,S=t[x*2],C=t[x*2+1],_=t[h*2],v=t[h*2+1],y=_-l,b=v-u;var w=g+1;if(c)for(;Pg(S,C)&&w<r;)w++,x+=a,S=t[x*2],C=t[x*2+1];var T=.5,E=0,D=0,O=void 0,k=void 0;if(w>=r||Pg(S,C))p=_,m=v;else{E=S-l,D=C-u;var A=_-l,j=S-_,M=v-u,ee=C-v,te=void 0,ne=void 0;if(s===`x`){te=Math.abs(A),ne=Math.abs(j);var re=E>0?1:-1;p=_-re*te*o,m=v,O=_+re*ne*o,k=v}else if(s===`y`){te=Math.abs(M),ne=Math.abs(ee);var ie=D>0?1:-1;p=_,m=v-ie*te*o,O=_,k=v+ie*ne*o}else te=Math.sqrt(A*A+M*M),ne=Math.sqrt(j*j+ee*ee),T=ne/(ne+te),p=_-E*o*(1-T),m=v-D*o*(1-T),O=_+E*o*T,k=v+D*o*T,O=eU(O,tU(S,_)),k=eU(k,tU(C,v)),O=tU(O,eU(S,_)),k=tU(k,eU(C,v)),E=O-_,D=k-v,p=_-E*te/ne,m=v-D*te/ne,p=eU(p,tU(l,_)),m=eU(m,tU(u,v)),p=tU(p,eU(l,_)),m=tU(m,eU(u,v)),E=_-p,D=v-m,O=_+E*ne/te,k=v+D*ne/te}e.bezierCurveTo(d,f,p,m,_,v),d=O,f=k}else e.lineTo(_,v)}l=_,u=v,h+=a}return g}function Bg(){var e=Du();return function(t){var n=e(t),r=t.pipelineContext,i=!!n.large,a=!!n.progressiveRender,o=n.large=!!(r&&r.large),s=n.progressiveRender=!!(r&&r.progressiveRender);return(i!==o||a!==s)&&`reset`}}function Vg(e,t,n){e&&zd(e)&&(t===`emphasis`?bd:xd)(e,n)}function Hg(e,t,n){var r=Eu(e,t),i=t&&t.highlightKey!=null?Bd(t.highlightKey):null;r==null?e.eachItemGraphicEl(function(e){Vg(e,n,i)}):L(cu(r),function(t){Vg(e.getItemGraphicEl(t),n,i)})}function Ug(e){return sU(e.model)}function Wg(e){var t=e.model,n=e.ecModel,r=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&oU(i).updateMethod,c=a?`incrementalPrepareRender`:s&&o[s]?s:`render`;return c!==`render`&&o[c](t,n,r,i),lU[c]}function Gg(e,t,n,r,i){var a=e.getArea(),o=a.x,s=a.y,c=a.width,l=a.height,u=n.get([`lineStyle`,`width`])||0;o-=u/2,s-=u/2,c+=u,l+=u,c=Math.ceil(c),o!==Math.floor(o)&&(o=Math.floor(o),c++);var d=new rR({shape:{x:o,y:s,width:c,height:l}});if(t){var f=e.getBaseAxis(),p=f.isHorizontal(),m=f.inverse;p?(m&&(d.shape.x+=c),d.shape.width=0):(m||(d.shape.y+=l),d.shape.height=0);var h=B(i)?function(e){i(e,d)}:null;ff(d,{shape:{width:c,height:l,x:o,y:s}},n,null,r,h)}return d}function Kg(e,t,n){var r=e.getArea(),i=Rl(r.r0,1),a=Rl(r.r,1),o=new zz({shape:{cx:Rl(e.cx,1),cy:Rl(e.cy,1),r0:i,r:a,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}});return t&&(e.getBaseAxis().dim===`angle`?o.shape.endAngle=r.startAngle:o.shape.r=i,ff(o,{shape:{endAngle:r.endAngle,r:a}},n)),o}function qg(e,t,n,r,i){return e?e.type===`polar`?Kg(e,t,n):e.type===`cartesian2d`?Gg(e,t,n,r,i):null:null}function Jg(e){var t=e.coordinateSystem;if(e.get(`clip`,!0)&&t&&(!t.shouldClip||t.shouldClip()))return t.getArea&&t.getArea(.1)}function Yg(e,t){return e.type===t}function Xg(e){var t=e.dimensions;return t[0]===`lng`&&t[1]===`lat`&&!!e.getViewRect}function Zg(e,t,n,r){return e&&(e.legacy||e.legacy!==!1&&!n&&!r&&t!==`tspan`&&(t===`text`||so(e,`text`)))}function Qg(e,t,n){var r=e,i,a,o;if(t===`text`)o=r;else{o={},so(r,`text`)&&(o.text=r.text),so(r,`rich`)&&(o.rich=r.rich),so(r,`textFill`)&&(o.fill=r.textFill),so(r,`textStroke`)&&(o.stroke=r.textStroke),so(r,`fontFamily`)&&(o.fontFamily=r.fontFamily),so(r,`fontSize`)&&(o.fontSize=r.fontSize),so(r,`fontStyle`)&&(o.fontStyle=r.fontStyle),so(r,`fontWeight`)&&(o.fontWeight=r.fontWeight),a={type:`text`,style:o,silent:!0},i={};var s=so(r,`textPosition`);n?i.position=s?r.textPosition:`inside`:s&&(i.position=r.textPosition),so(r,`textPosition`)&&(i.position=r.textPosition),so(r,`textOffset`)&&(i.offset=r.textOffset),so(r,`textRotation`)&&(i.rotation=r.textRotation),so(r,`textDistance`)&&(i.distance=r.textDistance)}return $g(o,e),L(o.rich,function(e){$g(e,e)}),{textConfig:i,textContent:a}}function $g(e,t){t&&(t.font=t.textFont||t.font,so(t,`textStrokeWidth`)&&(e.lineWidth=t.textStrokeWidth),so(t,`textAlign`)&&(e.align=t.textAlign),so(t,`textVerticalAlign`)&&(e.verticalAlign=t.textVerticalAlign),so(t,`textLineHeight`)&&(e.lineHeight=t.textLineHeight),so(t,`textWidth`)&&(e.width=t.textWidth),so(t,`textHeight`)&&(e.height=t.textHeight),so(t,`textBackgroundColor`)&&(e.backgroundColor=t.textBackgroundColor),so(t,`textPadding`)&&(e.padding=t.textPadding),so(t,`textBorderColor`)&&(e.borderColor=t.textBorderColor),so(t,`textBorderWidth`)&&(e.borderWidth=t.textBorderWidth),so(t,`textBorderRadius`)&&(e.borderRadius=t.textBorderRadius),so(t,`textBoxShadowColor`)&&(e.shadowColor=t.textBoxShadowColor),so(t,`textBoxShadowBlur`)&&(e.shadowBlur=t.textBoxShadowBlur),so(t,`textBoxShadowOffsetX`)&&(e.shadowOffsetX=t.textBoxShadowOffsetX),so(t,`textBoxShadowOffsetY`)&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function e_(e){return H(e)&&e.value!=null?e.value:e+``}function t_(e,t,n){var r;e||={};var i=Fm();if(i){var a=i.createBreakScaleMapper(t,n);a.hasBreaks()&&(L(pU,function(t){a[t]&&(e[t]=q(a[t],a))}),r=a)}return r??c_(e,n),{brk:r,mapper:e}}function n_(e,t){L(pU,function(n){e[n]=t[n]})}function r_(e,t){e.freeze=co}function i_(e){return e.getExtentUnsafe(0,2)}function a_(e,t){return e.getExtentUnsafe(1,t)||e.getExtentUnsafe(0,t)}function o_(e){var t=a_(e,3);return t[1]-t[0]}function s_(e){var t=e.getExtentUnsafe(0,3);return t[1]-t[0]}function c_(e,t){var n=e||{},r=[];return n._extents=r,r[0]=t?t.slice():Lu(),I(n,mU),n}function l_(e,t,n,r){Uu(n,r)&&(e[t][0]=n,e[t][1]=r)}function u_(e){return d_(e)||p_(e)}function d_(e){return e.type===`interval`}function f_(e){return e.type===`time`}function p_(e){return e.type===`log`}function m_(e){return e.type===`ordinal`}function h_(e){var t=Yl(e),n=bR(10,t),r=_R(e/n);return r?r===2?r=3:r===3?r=5:r*=2:r=1,Rl(r*n,-t)}function g_(e){return Bl(e)+2}function __(e,t){return xR(e)/xR(t)}function v_(e,t,n){var r=n&&n.lookup;if(r){for(var i=0;i<r.from.length;i++)if(e===r.from[i])return r.to[i]}return bR(t,e)}function y_(e,t,n){var r=e.slice();if(r[0]===r[1]){var i=n&&n.ctnShp;if(r[0]!==0){var a=gR(r[0]);t[1]||(r[1]+=a/2),r[0]-=a/2}else i&&(r[0]=-1),r[1]=1}return Hu(r[0])&&Hu(r[1])||(r[0]=0,r[1]=1),r[1]<r[0]&&r.reverse(),r}function b_(e,t){return[e[0]!==t[0],e[1]!==t[1]]}function x_(e,t){return e||=t,_R(hR(e,1))}function S_(e,t,n){var r=i_(e),i=r[0],a=e.count(),o=Math.max((t||0)+1,1);i!==0&&o>1&&a/o>2&&(i=Math.round(Math.ceil(i/o)*o)),i!==r[0]&&c(r[0],!0,!0);for(var s=i;s<=r[1];s+=o)c(s,!1,s===r[0]||s===r[1]);s-o!==r[1]&&c(r[1],!0,!0);function c(e,t,r){n({value:e,offInterval:t},r)}}function C_(e,t,n,r){for(var i=e.getTicks({expandToNicedExtent:!0}),a=[],o=e.getExtent(),s=1;s<i.length;s++){var c=i[s],l=i[s-1];if(!(l.break||c.break)){for(var u=0,d=[],f=(c.value-l.value)/t,p=g_(f);u<t-1;){var m=Rl(l.value+(u+1)*f,p);m>o[0]&&m<o[1]&&d.push(m),u++}var h=Fm();h&&h.pruneTicksByBreak(`auto`,d,n,function(e){return e},r,o),a.push(d)}}return a}function w_(e,t,n,r){return Jm(new Date(t),e,r).getTime()===Jm(new Date(n),e,r).getTime()}function T_(e,t){return e/=sH,e>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function E_(e){var t=30*sH;return e/=t,e>6?6:e>3?3:e>2?2:1}function D_(e){return e/=oH,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function O_(e,t){return e/=t?aH:iH,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function k_(e){return hR(Xl(e,!0),1)}function A_(e,t,n){var r=Math.max(0,Na(mH,t)-1);return Jm(new Date(e),mH[r],n).getTime()}function j_(e,t){var n=new Date(0);n[e](1);var r=n.getTime();n[e](1+t);var i=n.getTime()-r;return function(e,t){return Math.max(0,Math.round((t-e)/i))}}function uee(e,t,n,r,i,a){var o=hH,s=0;function c(e,t,n,i,o,c,l){for(var u=j_(o,e),d=t,f=new Date(d);d<n&&d<=r[1]&&(l.push({value:d}),!(s++>3e3));)if(f[o](f[i]()+e),d=f.getTime(),a){var p=a.calcNiceTickMultiple(d,u);p>0&&(f[o](f[i]()+p*e),d=f.getTime())}l.push({value:d,notAdd:d>r[1]})}function l(e,i,a){var o=[],s=!i.length;if(!w_(Hm(e),r[0],r[1],n)){s&&(i=[{value:A_(r[0],e,n)},{value:r[1]}]);for(var l=0;l<i.length-1;l++){var u=i[l].value,d=i[l+1].value;if(u!==d){var f=void 0,p=void 0,m=void 0,h=!1;switch(e){case`year`:f=Math.max(1,Math.round(t/sH/365)),p=Ym(n),m=nh(n);break;case`half-year`:case`quarter`:case`month`:f=E_(t),p=Xm(n),m=rh(n);break;case`week`:case`half-week`:case`day`:f=T_(t,31),p=Zm(n),m=ih(n),h=!0;break;case`half-day`:case`quarter-day`:case`hour`:f=D_(t),p=Qm(n),m=ah(n);break;case`minute`:f=O_(t,!0),p=$m(n),m=oh(n);break;case`second`:f=O_(t,!1),p=eh(n),m=sh(n);break;case`millisecond`:f=k_(t),p=th(n),m=ch(n)}d>=r[0]&&u<=r[1]&&c(f,u,d,p,m,h,o),e===`year`&&a.length>1&&l===0&&a.unshift({value:a[0].value-f})}}for(var l=0;l<o.length;l++)a.push(o[l])}}for(var u=[],d=[],f=0,p=0,m=0;m<o.length;++m){var h=Hm(o[m]);if(Um(o[m])&&(l(o[m],u[u.length-1]||[],d),h!==(o[m+1]?Hm(o[m+1]):null))){if(d.length){p=f,d.sort(function(e,t){return e.value-t.value});for(var g=[],_=0;_<d.length;++_){var v=d[_].value;(_===0||d[_-1].value!==v)&&(g.push(d[_]),v>=r[0]&&v<=r[1]&&f++)}var y=i/t;if(f>y*1.5&&p>y/1.5||(u.push(g),f>y||e===o[m]))break}d=[]}}for(var b=Ra(R(u,function(e){return Ra(e,function(e){return e.value>=r[0]&&e.value<=r[1]&&!e.notAdd})}),function(e){return e.length>0}),x=b.length-1,S=[],m=0;m<b.length;++m)for(var C=b[m],w=0;w<C.length;++w){var T=qm(C[w].value,n);S.push({value:C[w].value,time:{level:x-m,upperTimeUnit:T,lowerTimeUnit:T}})}qu(S,Ju,null),S.sort(function(e,t){return e.value-t.value});var E=S[0],D=S[S.length-1],O=qm(r[0],n),k=qm(r[1],n);return(!E||E.value>r[0])&&S.unshift({value:r[0],time:{level:0,upperTimeUnit:O,lowerTimeUnit:O},notNice:!0}),(!D||D.value<r[1])&&S.push({value:r[1],time:{level:0,upperTimeUnit:k,lowerTimeUnit:k},notNice:!0}),S}function dee(e){var t=e.get(`type`);return(t==null||!so(OU,t)&&!uU.getClass(t))&&(t=`value`),t}function M_(e,t,n){var r=Fm(),i;switch(r&&(i=U_(e,t,n)),t){case`category`:return new hU({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:Lu()});case`time`:return new vU({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get(`useUTC`),breakOption:i});case`log`:return new wU({logBase:e.get(`logBase`),breakOption:i});case`value`:return new gU({breakOption:i});default:return new((uU.getClass(t))||gU)({})}}function N_(e,t,n){var r=n?a_(e,null):e.getExtentUnsafe(0,null),i=r[0],a=r[1];return Uu(i,a)?i===t||a===t?2:i<t&&a>t?1:3:3}function P_(e){kU(e).noOnMyZero=!0}function F_(e){return kU(e).noOnMyZero}function I_(e){var t=e.getLabelModel().get(`formatter`);if(e.type===`time`){var n=zm(t);return function(t,r){return e.scale.getFormattedLabel(t,r,n)}}if(V(t))return function(n){var r=e.scale.getLabel(n);return t.replace(`{value}`,r??``)};if(B(t)){if(e.type===`category`)return function(n,r){return t(L_(e,n),n.value-e.scale.getExtent()[0],null)};var r=Fm();return function(n,i){var a=null;return r&&(a=r.makeAxisLabelFormatterParamBreak(a,n.break)),t(L_(e,n),i,a)}}return function(t){return e.scale.getLabel(t)}}function L_(e,t){var n=e.scale;return m_(n)?n.getLabel(t):t.value}function R_(e){return e.get(`interval`)??`auto`}function z_(e){return e.type===`category`&&R_(e.getLabelModel())===0}function B_(e,t){var n={};return L(e.mapDimensionsAll(t),function(t){n[dm(e,t)]=!0}),Ba(n)}function V_(e){return e===`middle`||e===`center`}function H_(e){return e.getShallow(`show`)}function U_(e,t,n){var r=e.get(`breaks`,!0);if(r!=null)return!Fm()||!n||!W_(t)?void 0:r}function W_(e){return e!==`category`}function G_(e,t,n,r,i,a){var o=p_(e),s=o?e.intervalStub:e;if(s.setExtent(r[0],r[1]),o){var c=e.powStub,l={depth:2},u=e.transformOut(r[0],l),d=e.transformOut(r[1],l),f=b_(n,r);t[0]&&!f[0]&&(u=i[0]),t[1]&&!f[1]&&(d=i[1]),c.setExtent(u,d)}s.setConfig(a)}function K_(e,t){return m_(e)?e.getRawOrdinalNumber(t.value):t.value}function q_(e,t){return m_(e)&&!!t.get(`boundaryGap`)}function J_(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return;return!0}}function Y_(e){for(var t=Lu(),n=Lu(),r=0;r<e.length;){var i=e[r++],a=e[r++];Pg(i,a)||(Ru(t,i),Ru(n,a))}return[t,n]}function X_(e,t){var n=Y_(e),r=n[0],i=n[1],a=Y_(t),o=a[0],s=a[1];return Math.max(Math.abs(r[0]-o[0]),Math.abs(i[0]-s[0]),Math.abs(r[1]-o[1]),Math.abs(i[1]-s[1]))}function Z_(e){return Wa(e)?e:e?.5:0}function Q_(e,t,n){if(n.valueDim==null)return[];for(var r=t.count(),i=Fg(r*2),a=0;a<r;a++){var o=Ng(n,e,t,a);i[a*2]=o[0],i[a*2+1]=o[1]}return i}function $_(e,t,n,r,i){var a=n.getBaseAxis(),o=a.dim===`x`||a.dim===`radius`?0:1,s=[],c=0,l=[],u=[],d=[],f=[];if(i){for(c=0;c<e.length;c+=2){var p=t||e;Pg(p[c],p[c+1])||f.push(e[c],e[c+1])}e=f}for(c=0;c<e.length-2;c+=2)switch(d[0]=e[c+2],d[1]=e[c+3],u[0]=e[c],u[1]=e[c+1],s.push(u[0],u[1]),r){case`end`:l[o]=d[o],l[1-o]=u[1-o],s.push(l[0],l[1]);break;case`middle`:var m=(u[o]+d[o])/2,h=[];l[o]=h[o]=m,l[1-o]=u[1-o],h[1-o]=d[1-o],s.push(l[0],l[1]),s.push(h[0],h[1]);break;default:l[o]=u[o],l[1-o]=d[1-o],s.push(l[0],l[1])}return s.push(e[c++],e[c++]),s}function ev(e,t){var n=[],r=e.length,i,a;function o(e,t,n){var r=e.coord;return{coord:n,color:ac((n-r)/(t.coord-r),[e.color,t.color])}}for(var s=0;s<r;s++){var c=e[s],l=c.coord;if(l<0)i=c;else if(l>t){a?n.push(o(a,c,t)):i&&n.push(o(i,c,0),o(i,c,t));break}else i&&=(n.push(o(i,c,0)),null),n.push(c),a=c}return n}function tv(e,t,n){var r=e.getVisual(`visualMeta`);if(r&&r.length&&e.count()&&t.type===`cartesian2d`){for(var i,a,o=r.length-1;o>=0;o--){var s=e.getDimensionInfo(r[o].dimension);if(i=s&&s.coordDim,i===`x`||i===`y`){a=r[o];break}}if(a){var c=t.getAxis(i),l=R(a.stops,function(e){return{coord:c.toGlobalCoord(c.dataToCoord(e.value)),color:e.color}}),u=l.length,d=a.outerColors.slice();u&&l[0].coord>l[u-1].coord&&(l.reverse(),d.reverse());var f=ev(l,i===`x`?n.getWidth():n.getHeight()),p=f.length;if(!p&&u)return l[0].coord<0?d[1]?d[1]:l[u-1].color:d[0]?d[0]:l[0].color;var m=10,h=f[0].coord-m,g=f[p-1].coord+m,_=g-h;if(_<.001)return`transparent`;L(f,function(e){e.offset=(e.coord-h)/_}),f.push({offset:p?f[p-1].offset:.5,color:d[1]||`transparent`}),f.unshift({offset:p?f[0].offset:.5,color:d[0]||`transparent`});var v=new nB(0,0,0,0,f,!0);return v[i]=h,v[i+`2`]=g,v}}}function nv(e,t,n){var r=e.get(`showAllSymbol`),i=r===`auto`;if(!r||i){var a=n.getAxesByScale(`ordinal`)[0];if(a&&!(i&&rv(a,t))){var o=t.mapDimension(a.dim),s={};return L(a.getViewLabels(),function(e){e.tick.offInterval||(s[K_(a.scale,e.tick)]=1)}),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function rv(e,t){var n=e.getExtent(),r=Math.abs(n[1]-n[0])/e.scale.count();isNaN(r)&&(r=0);for(var i=t.count(),a=Math.max(1,Math.round(i/5)),o=0;o<i;o+=a)if(XH.getSymbolSize(t,o)[+!!e.isHorizontal()]*1.5>r)return!1;return!0}function iv(e){for(var t=e.length/2;t>0&&Pg(e[t*2-2],e[t*2-1]);t--);return t-1}function av(e,t){return[e[t*2],e[t*2+1]]}function ov(e,t,n){for(var r=e.length/2,i=n===`x`?0:1,a,o,s=0,c=-1,l=0;l<r;l++)if(o=e[l*2+i],!Pg(o,e[l*2+1-i])){if(l===0)a=o;else{if(a<=t&&o>=t||a>=t&&o<=t){c=l;break}s=l,a=o}}return{range:[s,c],t:(t-a)/(o-a)}}function sv(e){if(e.get([`endLabel`,`show`]))return!0;for(var t=0;t<tz.length;t++)if(e.get([tz[t],`endLabel`,`show`]))return!0;return!1}function cv(e,t,n,r){if(Yg(t,`cartesian2d`)){var i=r.getModel(`endLabel`),a=i.get(`valueAnimation`),o=r.getData(),s={lastFrameIndex:0},c=sv(r)?function(n,r){e._endLabelOnDuring(n,r,o,s,a,i,t)}:null,l=t.getBaseAxis().isHorizontal(),u=Gg(t,n,r,function(){var t=e._endLabel;t&&n&&s.originalX!=null&&t.attr({x:s.originalX,y:s.originalY})},c);if(!r.get(`clip`,!0)){var d=u.shape,f=Math.max(d.width,d.height);l?(d.y-=f,d.height+=f*2):(d.x-=f,d.width+=f*2)}return c&&c(1,u),u}return Kg(t,n,r)}function lv(e,t){var n=t.getBaseAxis(),r=n.isHorizontal(),i=n.inverse,a=r?i?`right`:`left`:`center`,o=r?`middle`:i?`top`:`bottom`;return{normal:{align:e.get(`align`)||a,verticalAlign:e.get(`verticalAlign`)||o}}}function uv(e,t){return{seriesType:e,plan:Bg(),reset:function(e){var n=e.getData(),r=e.coordinateSystem,i=e.pipelineContext,a=t||i.large;if(r){var o=R(r.dimensions,function(e){return n.mapDimension(e)}).slice(0,2),s=o.length,c=n.getCalculationInfo(`stackResultDimension`);um(n,o[0])&&(o[0]=c),um(n,o[1])&&(o[1]=c);var l=n.getStore(),u=n.getDimensionIndex(o[0]),d=n.getDimensionIndex(o[1]);return s&&{progress:function(e,t){for(var n=e.end-e.start,i=a&&Fg(n*s),o=[],c=[],f=e.start,p=0;f<e.end;f++){var m=void 0;if(s===1){var h=l.get(u,f);m=r.dataToPoint(h,null,c)}else o[0]=l.get(u,f),o[1]=l.get(d,f),m=r.dataToPoint(o,null,c);a?(i[p++]=m[0],i[p++]=m[1]):t.setItemLayout(f,m.slice())}a&&(t.setLayout(`points`,i),t.setLayout(`pointsRange`,{start:e.start,end:e.end}))}}}}}}function dv(e){return{seriesType:e,reset:function(e,t,n){var r=e.getData(),i=e.get(`sampling`),a=e.coordinateSystem,o=r.count();if(o>10&&a.type===`cartesian2d`&&i){var s=a.getBaseAxis(),c=a.getOtherAxis(s),l=s.getExtent(),u=n.getDevicePixelRatio(),d=Math.abs(l[1]-l[0])*(u||1),f=Math.round(o/d);if(isFinite(f)&&f>1){i===`lttb`?e.setData(r.lttbDownSample(r.mapDimension(c.dim),1/f)):i===`minmax`&&e.setData(r.minmaxDownSample(r.mapDimension(c.dim),1/f));var p=void 0;V(i)?p=jU[i]:B(i)&&(p=i),p&&e.setData(r.downSample(r.mapDimension(c.dim),1/f,p,MU))}}}}}function fv(e){e.registerChartView(AU),e.registerSeriesModel(YH),e.registerLayout(uv(`line`,!0)),e.registerVisual({seriesType:`line`,reset:function(e){var t=e.getData(),n=e.getModel(`lineStyle`).getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual(`style`).fill),t.setVisual(`legendLineStyle`,n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,dv(`line`))}function pv(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function mv(e,t){var n=e.getLabelModel().get(`customValues`);if(n){var r=e.scale;return{labels:R(gv(n,r),function(t,n){return{formattedLabel:I_(e)(t,n),rawLabel:r.getLabel(t),tick:t}})}}return e.type===`category`?_v(e,t):bv(e)}function hv(e,t,n){var r=e.scale,i=e.getTickModel().get(`customValues`);return i?{ticks:gv(i,r)}:e.type===`category`?yv(e,t):{ticks:r.getTicks(n)}}function gv(e,t){var n=t.getExtent(),r=[];return L(e,function(e){e=t.parse(e),e>=n[0]&&e<=n[1]&&r.push(e)}),qu(r,Yu,null),zl(r),R(r,function(e){return{value:e}})}function _v(e,t){var n=e.getLabelModel(),r=vv(e,n,t);return!n.get(`show`)||e.scale.isBlank()?{labels:[]}:r}function vv(e,t,n){var r=LU(e),i=R_(t),a=n.kind===FU.estimate;if(!a){var o=Sv(r,i);if(o)return o}var s,c;B(i)?s=kv(e,i,!1):(c=i===`auto`?wv(e,n):i,s=kv(e,c,!1));var l={labels:s,labelCategoryInterval:c};return a?n.out.noPxChangeTryDetermine.push(function(){return Cv(r,i,l),!0}):Cv(r,i,l),l}function yv(e,t){var n=IU(e),r=R_(t),i=Sv(n,r);if(i)return i;var a,o;if((!t.get(`show`)||e.scale.isBlank())&&(a=[]),B(r))a=kv(e,r,!0);else if(r===`auto`){var s=vv(e,e.getLabelModel(),pv(FU.determine));o=s.labelCategoryInterval,a=R(s.labels,function(e){return e.tick})}else o=r,a=kv(e,o,!0);return Cv(n,r,{ticks:a,tickCategoryInterval:o})}function bv(e){var t=e.scale.getTicks(),n=I_(e);return{labels:R(t,function(t,r){return{formattedLabel:n(t,r),rawLabel:e.scale.getLabel(t),tick:t}})}}function xv(e){return function(t){return PU(t)[e]||(PU(t)[e]={list:[]})}}function Sv(e,t){for(var n=0;n<e.list.length;n++)if(e.list[n].key===t)return e.list[n].value}function Cv(e,t,n){return e.list.push({key:t,value:n}),n}function wv(e,t){if(t.kind===FU.estimate){var n=e.calculateCategoryInterval(t);return t.out.noPxChangeTryDetermine.push(function(){return PU(e).autoInterval=n,!0}),n}return PU(e).autoInterval??(PU(e).autoInterval=e.calculateCategoryInterval(t))}function Tv(e,t){var n=t.kind,r=Ov(e),i=I_(e),a=(r.axisRotate-r.labelRotate)/180*Math.PI,o=e.scale,s=o.getExtent(),c=o.count();if(s[1]-s[0]<1)return 0;var l=1,u=40;c>u&&(l=Math.max(1,Math.floor(c/u)));for(var d=s[0],f=e.dataToCoord(d+1)-e.dataToCoord(d),p=Math.abs(f*Math.cos(a)),m=Math.abs(f*Math.sin(a)),h=0,g=0;d<=s[1];d+=l){var _=0,v=0,y=rs(i({value:d}),r.font,`center`,`top`);_=y.width*1.3,v=y.height*1.3,h=Math.max(h,_,7),g=Math.max(g,v,7)}var b=h/p,x=g/m;isNaN(b)&&(b=1/0),isNaN(x)&&(x=1/0);var S=Math.max(0,Math.floor(Math.min(b,x)));return n===FU.estimate?(t.out.noPxChangeTryDetermine.push(q(Ev,null,e,S,c)),S):Dv(e,S,c)??S}function Ev(e,t,n){return Dv(e,t,n)==null}function Dv(e,t,n){var r=NU(e.model),i=e.getExtent(),a=r.lastAutoInterval,o=r.lastTickCount;if(a!=null&&o!=null&&Math.abs(a-t)<=1&&Math.abs(o-n)<=1&&a>t&&r.axisExtent0===i[0]&&r.axisExtent1===i[1])return a;r.lastTickCount=n,r.lastAutoInterval=t,r.axisExtent0=i[0],r.axisExtent1=i[1]}function Ov(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get(`rotate`)||0,font:t.getFont()}}function kv(e,t,n){var r=I_(e),i=e.scale,a=[],o=B(t);return S_(i,o?0:t,function(e,s){var c=i.getLabel(e);if(o){var l=!!t(e.value,c);if(e.offInterval=!l,!l&&!s)return}a.push(n?e:{formattedLabel:r(e),rawLabel:c,tick:e})}),a}function Av(e){RU(e).prepare={}}function jv(e){RU(e).fullUpdate={}}function Mv(e){return RU(e).prepare}function Nv(e){return RU(e).fullUpdate}function Pv(e,t){var n=e.model,r=BU(Nv(n.ecModel)).keyed,i=r&&r.get(t);return i&&i.get(n.uid)}function Fv(e,t){return Rv(Pv(e,t))}function Iv(e,t){var n=[];return Lv(e.model.ecModel,function(e){for(var r=0;r<t.length;r++)t[r]&&e.serByIdx[t[r].seriesIndex]&&n.push(Rv(e))}),n}function Lv(e,t){var n=BU(Nv(e)).keyed;n&&n.each(function(e,n){e.each(function(e,r){t(e,n,r)})})}function Rv(e){return{liPosMinGap:e?e.liPosMinGap:void 0}}function zv(e,t){var n=e.model.ecModel,r=BU(Nv(n)).axSer;r&&Vv(n,r.get(e.model.uid),t)}function Bv(e,t,n){var r=Pv(e,t);r&&Vv(e.model.ecModel,r.sers,n)}function Vv(e,t,n){if(t)for(var r=0;r<t.length;r++){var i=t[r];e.isSeriesFiltered(i)||n(i)}}function Hv(e,t,n){var r=BU(Nv(e)).keyed,i=r&&r.get(t);i&&i.each(function(e){n(e.axis)})}function Uv(e,t){var n=e.model,r=BU(Nv(n.ecModel)).keys;r&&L(r.get(n.uid),function(e){t(e)})}function Wv(e){var t=VU(Mv(e)),n=t.keyed||=W();Lv(e,function(t,r,i){var a=n.get(r)||n.set(r,W()),o=a.get(i)||a.set(i,{});t.metrics.liPosMinGap&&HU.liPosMinGap(e,t,o)})}function Gv(e,t){HU[e]=t}function Kv(e,t,n){if(e){var r=t.ecModel,i=BU(Nv(r)),a=e.model.uid,o=i.axSer||=W();(o.get(a)||o.set(a,[])).push(t);var s=t.subType,c=t.getBaseAxis()===e,l=UU.get(qv(s,c,n))||UU.get(qv(s,c,null));if(l){var u=i.keyed||=W(),d=i.keys||=W(),f=l.key,p=u.get(f)||u.set(f,W()),m=p.get(a);m||(m=p.set(a,{axis:e,sers:[],serByIdx:[]}),m.metrics=l.getMetrics(e),(d.get(a)||d.set(a,[])).push(f)),m.sers.push(t),m.serByIdx[t.seriesIndex]=t}}}function qv(e,t,n){return e+`|&`+U(t,!0)+`|&`+(n||``)}function Jv(e,t){var n=qv(t.seriesType,t.baseAxis,t.coordSysType);UU.set(n,t),zU(e,function(){e.registerProcessor(e.PRIORITY.PROCESSOR.AXIS_STATISTICS,{overallReset:Wv})})}function Yv(e,t){t||={};var n={w:NaN,w2:NaN},r=e.scale,i=t.fromStat,a=t.min,o=o_(r);ru(o)||(o=NaN);var s=e.getExtent(),c=gR(s[1]-s[0]);return m_(r)?Xv(n,e,o,c):i&&Zv(n,e,o,c,i),a!=null&&(n.w=ru(n.w)?hR(a,n.w):a),n}function Xv(e,t,n,r){var i=t.onBand,a=n+ +!!i;a===0&&(a=1),e.w=r/a,!i&&n&&r&&(e.w2=e.w*n/r)}function Zv(e,t,n,r,i){var a=!1,o=-1/0;L(i.key?[Fv(t,i.key)]:Iv(t,i.sers||[]),function(e){var t=e.liPosMinGap;t!=null&&(t>0?(t>o&&(o=t),a=!1):t===-2&&(a=!0))}),ru(n)&&n>0&&ru(o)?(e.w=r/n*o,e.w2=o):a&&(e.w=r*WU,e.w2=e.w*n/r)}function Qv(e){var t=e.getExtent();if(e.onBand){var n=(t[1]-t[0])/e.scale.count()/2;t[0]+=n,t[1]-=n}return t}function $v(e,t,n){var r=t.length;if(!e.onBand||n||!r)return!1;var i=Yv(e).w;if(!i)return!1;L(t,function(e){e.coord-=i/2});var a=e.scale.getExtent(),o=t[r-1];return o.tick.offInterval&&t.pop(),t.push({coord:o.coord+i,tick:{value:a[1]+1}}),!0}function ey(e,t,n){n||=ZU,t?e.dirty|=n:e.dirty&=~n}function ty(e,t){return t||=ZU,e.dirty==null||!!(e.dirty&t)}function ny(e){if(e)return ty(e)&&ry(e,e.label,e),e}function ry(e,t,n){var r=t.getComputedTransform();e.transform=Jf(e.transform,r);var i=e.localRect=qf(e.localRect,t.getBoundingRect()),a=t.style,o=a.margin,s=n&&n.marginForce,c=n&&n.minMarginForce,l=n&&n.marginDefault,u=a.__marginType;u==null&&l&&(o=l,u=jB.textMargin);for(var d=0;d<4;d++)QU[d]=u===jB.minMargin&&c&&c[d]!=null?c[d]:s&&s[d]!=null?s[d]:o?o[d]:0;u===jB.textMargin&&Vf(i,QU,!1,!1);var f=e.rect=qf(e.rect,i);return r&&f.applyTransform(r),u===jB.minMargin&&Vf(f,QU,!1,!1),e.axisAligned=Kf(r),(e.label=e.label||{}).ignore=t.ignore,ey(e,!1),ey(e,!0,XU),e}function iy(e,t,n){return e.transform=Jf(e.transform,n),e.localRect=qf(e.localRect,t),e.rect=qf(e.rect,t),n&&e.rect.applyTransform(n),e.axisAligned=Kf(n),e.obb=void 0,(e.label=e.label||{}).ignore=!1,e}function ay(e,t){if(e){e.label.x+=t.x,e.label.y+=t.y,e.label.markRedraw();var n=e.transform;n&&(n[4]+=t.x,n[5]+=t.y);var r=e.rect;r&&(r.x+=t.x,r.y+=t.y);var i=e.obb;i&&i.fromBoundingRect(e.localRect,n)}}function oy(e,t){for(var n=0;n<JU.length;n++){var r=JU[n];e[r]??(e[r]=t[r])}return ny(e)}function sy(e){var t=e.obb;return(!t||ty(e,XU))&&(e.obb=t||=new fB,t.fromBoundingRect(e.localRect,e.transform),ey(e,!1,XU)),t}function cy(e,t,n,r,i){var a=e.length,o=vB[t],s=yB[t];if(a<2)return!1;e.sort(function(e,t){return e.rect[o]-t.rect[o]});for(var c=0,l,u=!1,d=0,f=0;f<a;f++){var p=e[f],m=p.rect;l=m[o]-c,l<0&&(m[o]-=l,p.label[o]-=l,u=!0);var h=Math.max(-l,0);d+=h,c=m[o]+m[s]}d>0&&i&&S(-d/a,0,a);var g=e[0],_=e[a-1],v,y;b(),v<0&&C(-v,.8),y<0&&C(y,.8),b(),x(v,y,1),x(y,v,-1),b(),v<0&&w(-v),y<0&&w(y);function b(){v=g.rect[o]-n,y=r-_.rect[o]-_.rect[s]}function x(e,t,n){if(e<0){var r=Math.min(t,-e);if(r>0){S(r*n,0,a);var i=r+e;i<0&&C(-i*n,1)}else C(-e*n,1)}}function S(t,n,r){t!==0&&(u=!0);for(var i=n;i<r;i++){var a=e[i],s=a.rect;s[o]+=t,a.label[o]+=t}}function C(t,n){for(var r=[],i=0,c=1;c<a;c++){var l=e[c-1].rect,u=Math.max(e[c].rect[o]-l[o]-l[s],0);r.push(u),i+=u}if(i){var d=Math.min(Math.abs(t)/i,n);if(t>0)for(var c=0;c<a-1;c++){var f=r[c]*d;S(f,0,c+1)}else for(var c=a-1;c>0;c--){var f=r[c-1]*d;S(-f,c,a)}}}function w(e){var t=e<0?-1:1;e=Math.abs(e);for(var n=Math.ceil(e/(a-1)),r=0;r<a-1;r++)if(t>0?S(n,0,r+1):S(-n,a-r-1,a),e-=n,e<=0)return}return u}function fee(e){for(var t=0;t<e.length;t++){var n=e[t],r=n.defaultAttr,i=n.labelLine;n.label.attr(`ignore`,r.ignore),i&&i.attr(`ignore`,r.labelGuideIgnore)}}function ly(e){var t=[];e.sort(function(e,t){return+!!t.suggestIgnore-!!e.suggestIgnore||t.priority-e.priority});function n(e){if(!e.ignore){var t=e.ensureState(`emphasis`);t.ignore??=!1}e.ignore=!0}for(var r=0;r<e.length;r++){var i=ny(e[r]);if(!i.label.ignore){for(var a=i.label,o=i.labelLine,s=!1,c=0;c<t.length;c++)if(uy(i,t[c],null,{touchThreshold:.05})){s=!0;break}s?(n(a),o&&n(o)):t.push(i)}}}function uy(e,t,n,r){return!e||!t||e.label&&e.label.ignore||t.label&&t.label.ignore||!e.rect.intersect(t.rect,n,r)?!1:e.axisAligned&&t.axisAligned?!0:sy(e).intersect(sy(t),n,r)}function dy(e){$U||=e}function fy(){return $U}function py(e,t,n,r){var i=[];return L(e,function(e){i=i.concat(e.eventBreaks)}),{eventContent:{breaks:i}}}function my(e){e.registerAction(iW,t),e.registerAction(aW,t),e.registerAction(oW,t);function t(e,t){var n=[],r=Ou(t,e);function i(t,i){L(r[t],function(t){L(t.updateAxisBreaks(e).breaks,function(e){var r;n.push(Ma((r={},r[i]=t.componentIndex,r),e))})})}return i(`xAxisModels`,`xAxisIndex`),i(`yAxisModels`,`yAxisIndex`),i(`singleAxisModels`,`singleAxisIndex`),{eventBreaks:n}}}function hy(e,t,n,r){var i=n.axis,a=t.ensureRecord(n),o=[],s,c=jy(e.axisName)&&V_(e.nameLocation);L(r,function(e){var t=ny(e);if(t&&!t.label.ignore){o.push(t);var n=a.transGroup;c&&(n.transform?No(pW,n.transform):Do(pW),t.transform&&ko(pW,pW,t.transform),J.copy(mW,t.localRect),mW.applyTransform(pW),s?s.union(mW):J.copy(s=new J(0,0,0,0),mW))}});var l=Math.abs(a.dirVec.x)>.1?`x`:`y`,u=a.transGroup[l];if(o.sort(function(e,t){return Math.abs(e.label[l]-u)-Math.abs(t.label[l]-u)}),c&&s){var d=i.getExtent(),f=Math.min(d[0],d[1]),p=Math.max(d[0],d[1])-f;s.union(new J(f,0,p,1))}a.stOccupiedRect=s,a.labelInfoList=o}function gy(e,t,n){var r=new wF;uy(e,t,r,{direction:Math.atan2(n.y,n.x),bidirectional:!1,touchThreshold:.05})&&ay(t,r)}function _y(e,t,n,r){for(var i=wF.dot(r,t)>=0,a=0,o=e.length;a<o;a++){var s=e[i?a:o-1-a];s.label.ignore||gy(s,n,r)}}function vy(e,t,n,r,i,a,o,s){Oy(t)||Dy(e,t,i,s,r,o);var c=t.labelLayoutList;Ay(e,r,c,a),Ny(r,e.rotation,c);var l=e.optionHideOverlap;by(r,c,l),l&&ly(Ra(c,function(e){return e&&!e.label.ignore})),hy(e,n,r,c)}function yy(e,t,n,r){var i=Gl(n-e),a,o,s=r[0]>r[1],c=t===`start`&&!s||t!==`start`&&s;return Kl(i-sW/2)?(o=c?`bottom`:`top`,a=`center`):Kl(i-sW*1.5)?(o=c?`top`:`bottom`,a=`center`):(o=`middle`,a=i<sW*1.5&&i>sW/2?c?`left`:`right`:c?`right`:`left`),{rotation:i,textAlign:a,textVerticalAlign:o}}function by(e,t,n){var r=e.axis,i=e.get([`axisLabel`,`customValues`]);if(z_(r))return;function a(e,a,o){var s=ny(t[a]),c=ny(t[o]),l=r.scale;if(s&&c){if(e==null){if(!n&&i)return;var u=uW(s.label).labelInfo.tick;if(f_(l)&&u.notNice||m_(l)&&u.offInterval){Sy(s.label);return}}if(e===!1||s.suggestIgnore)Sy(s.label);else if(c.suggestIgnore)Sy(c.label);else{var d=.1;if(!n){var f=[0,0,0,0];s=oy({marginForce:f},s),c=oy({marginForce:f},c)}uy(s,c,null,{touchThreshold:d})&&Sy(e?c.label:s.label)}}}var o=e.get([`axisLabel`,`showMinLabel`]),s=e.get([`axisLabel`,`showMaxLabel`]),c=t.length;a(o,0,1),a(s,c-1,c-2)}function xy(e,t,n){e.showMinorTicks||L(t,function(e){if(e&&e.label.ignore)for(var t=0;t<n.length;t++){var r=n[t],i=dW(r),a=uW(e.label);if(i.tickValue!=null&&!i.onBand&&i.tickValue===a.labelInfo.tick.value){Sy(r);return}}})}function Sy(e){e&&(e.ignore=!0)}function Cy(e,t,n,r,i){for(var a=[],o=[],s=[],c=0;c<e.length;c++){var l=e[c].coord;o[0]=l,o[1]=0,s[0]=l,s[1]=n,t&&(qo(o,o,t),qo(s,s,t));var u=new Jz({shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:r,z2:2,autoBatch:!0,silent:!0});Ef(u.shape,u.style.lineWidth),u.anid=i+`_`+e[c].tickValue,a.push(u);var d=dW(u);d.onBand=!!e[c].onBand,d.tickValue=e[c].tickValue}return a}function wy(e,t,n,r){var i=r.axis,a=r.getModel(`axisTick`),o=a.get(`show`);if(o===`auto`&&(o=!0,e.raw.axisTickAutoShow!=null&&(o=!!e.raw.axisTickAutoShow)),!o||i.scale.isBlank())return[];for(var s=a.getModel(`lineStyle`),c=e.tickDirection*a.get(`length`),l=Cy(i.getTicksCoords(),n.transform,c,Ma(s.getLineStyle(),{stroke:r.get([`axisLine`,`lineStyle`,`color`])}),`ticks`),u=0;u<l.length;u++)t.add(l[u]);return l}function Ty(e,t,n,r,i){var a=r.axis,o=r.getModel(`minorTick`);if(e.showMinorTicks&&!a.scale.isBlank()){var s=a.getMinorTicksCoords();if(s.length)for(var c=o.getModel(`lineStyle`),l=i*o.get(`length`),u=Ma(c.getLineStyle(),Ma(r.getModel(`axisTick`).getLineStyle(),{stroke:r.get([`axisLine`,`lineStyle`,`color`])})),d=0;d<s.length;d++)for(var f=Cy(s[d],n.transform,l,u,`minorticks_`+d),p=0;p<f.length;p++)t.add(f[p])}}function Ey(e,t,n){if(Oy(e)){var r=e.axisLabelsCreationContext.out.noPxChangeTryDetermine;if(n.noPxChange){for(var i=!0,a=0;a<r.length;a++)i&&=r[a]();if(i)return!1}r.length&&(t.remove(e.labelGroup),ky(e,null,null,null))}return!0}function Dy(e,t,n,r,i,a){var o=i.axis,s=Za(e.raw.axisLabelShow,i.get([`axisLabel`,`show`])),c=new Sz;n.add(c);var l=pv(r);if(!s||o.scale.isBlank())ky(t,[],c,l);else{var u=i.getModel(`axisLabel`),d=o.getViewLabels(l),f=(Za(e.raw.labelRotate,u.get(`rotate`))||0)*sW/180,p=gW.innerTextLayout(e.rotation,f,e.labelDirection),m=i.getCategories&&i.getCategories(!0),h=[],g=i.get(`triggerEvent`),_=1/0,v=-1/0;L(d,function(e,t){var n=e.tick,r=e.formattedLabel,s=e.rawLabel,l=u,f=K_(o.scale,n);if(m&&m[f]){var y=m[f];H(y)&&y.textStyle&&(l=new HB(y.textStyle,u,i.ecModel))}var b=l.getTextColor()||i.get([`axisLine`,`lineStyle`,`color`]),x=l.getShallow(`align`,!0)||p.textAlign,S=U(l.getShallow(`alignMinLabel`,!0),x),C=U(l.getShallow(`alignMaxLabel`,!0),x),w=l.getShallow(`verticalAlign`,!0)||l.getShallow(`baseline`,!0)||p.textVerticalAlign,T=U(l.getShallow(`verticalAlignMinLabel`,!0),w),E=U(l.getShallow(`verticalAlignMaxLabel`,!0),w),D=10+(n.time?.level||0);_=Math.min(_,D),v=Math.max(v,D);var O=new cR({x:0,y:0,rotation:0,silent:gW.isLabelSilent(i),z2:D,style:op(l,{text:r,align:t===0?S:t===d.length-1?C:x,verticalAlign:t===0?T:t===d.length-1?E:w,fill:B(b)?b(o.type===`category`?s:o.type===`value`?f+``:f,t):b})});O.anid=`label_`+f;var k=uW(O);if(k.labelInfo=e,k.layoutRotation=p.rotation,Uf({el:O,componentModel:i,itemName:r,formatterParamsExtra:{isTruncated:function(){return O.isTruncated},value:s,tickIndex:t}}),g){var A=gW.makeAxisEventDataBase(i);A.targetType=`axisLabel`,A.value=s,A.tickIndex=t;var j=e.tick.break;if(j){var M=j.parsedBreak;A.break={start:M.vmin,end:M.vmax}}o.type===`category`&&(A.dataIndex=f),LR(O).eventData=A,j&&My(i,a,O,j)}h.push(O),c.add(O)}),ky(t,R(h,function(e){return{label:e,priority:uW(e).labelInfo.tick.break?e.z2+(v-_+1):e.z2,defaultAttr:{ignore:e.ignore}}}),c,l)}}function Oy(e){return!!e.labelLayoutList}function ky(e,t,n,r){e.labelLayoutList=t,e.labelGroup=n,e.axisLabelsCreationContext=r}function Ay(e,t,n,r){var i=t.get([`axisLabel`,`margin`]);L(n,function(n,a){var o=ny(n);if(o){var s=o.label,c=uW(s);o.suggestIgnore=s.ignore,s.ignore=!1,Es(yW,bW);var l=t.axis;yW.x=l.dataToCoord(K_(l.scale,c.labelInfo.tick)),yW.y=e.labelOffset+e.labelDirection*i,yW.rotation=c.layoutRotation,r.add(yW),yW.updateTransform(),r.remove(yW),yW.decomposeTransform(),Es(s,yW),s.markRedraw(),ey(o,!0),ny(o)}})}function jy(e){return!!e}function My(e,t,n,r){n.on(`click`,function(n){var i={type:eW,breaks:[{start:r.parsedBreak.breakOption.start,end:r.parsedBreak.breakOption.end}]};i[e.axis.dim+`AxisIndex`]=e.componentIndex,t.dispatchAction(i)})}function Ny(e,t,n){var r=Fm();if(r){var i=r.retrieveAxisBreakPairs(n,function(e){return e&&uW(e.label).labelInfo.tick.break},!0),a=e.get([`breakLabelLayout`,`moveOverlap`],!0);(a===!0||a===`auto`)&&L(i,function(r){fy().adjustBreakLabelPair(e.axis.inverse,t,[ny(n[r[0]]),ny(n[r[1]])])})}}function Py(e,t,n){n||={};var r=t.axis,i={},a=r.getAxesOnZeroOf()[0],o=r.position,s=a?`onZero`:o,c=r.dim,l=[e.x,e.x+e.width,e.y,e.y+e.height],u={left:0,right:1,top:0,bottom:1,onZero:2},d=t.get(`offset`)||0,f=c===`x`?[l[2]-d,l[3]+d]:[l[0]-d,l[1]+d];if(a){var p=a.toGlobalCoord(a.dataToCoord(0));f[u.onZero]=Math.max(Math.min(p,f[1]),f[0])}i.position=[c===`y`?f[u[s]]:l[0],c===`x`?f[u[s]]:l[3]],i.rotation=Math.PI/2*(c===`x`?0:1),i.labelDirection=i.tickDirection=i.nameDirection={top:-1,bottom:1,left:-1,right:1}[o],i.labelOffset=a?f[u[o]]-f[u.onZero]:0,t.get([`axisTick`,`inside`])&&(i.tickDirection=-i.tickDirection),Za(n.labelInside,t.get([`axisLabel`,`inside`]))&&(i.labelDirection=-i.labelDirection);var m=t.get([`axisLabel`,`rotate`]);return i.labelRotate=s===`top`?-m:m,i.z2=1,i}function Fy(e){return e.coordinateSystem&&e.coordinateSystem.type===`cartesian2d`}function Iy(e){var t={xAxisModel:null,yAxisModel:null};return L(t,function(n,r){var i=r.replace(/Model$/,``);t[r]=e.getReferringComponents(i,PR).models[0]}),t}function Ly(e,t,n,r,i,a){for(var o=Py(e,n),s=!1,c=!1,l=0;l<t.length;l++)u_(t[l].getOtherAxis(n.axis).scale)&&(s=c=!0,n.axis.type===`category`&&n.axis.onBand&&(c=!1));return o.axisLineAutoShow=s,o.axisTickAutoShow=c,o.defaultNameMoveOverlap=a,new gW(n,r,o,i)}function Ry(e,t,n){var r=Py(t,n);e.updateCfg(r)}function zy(e,t){var n=e.scale,r=e.dataMM;n.sanitize&&(t[0]=n.sanitize(t[0],r),t[1]=n.sanitize(t[1],r),Gu(t))}function By(e,t){return t==null?null:Xa(t)?NaN:e.parse(t)}function Vy(e,t){var n;if(m_(e))n=[0,0];else{var r=t.get(`boundaryGap`);typeof r==`boolean`&&(r=null),n=z(r)?r:[r,r]}return[Hy(n[0]),Hy(n[1])]}function Hy(e){return ss(typeof e==`boolean`?0:e,1)||0}function Uy(e){var t=xW(e.scale);return t.extent||=Lu(),t}function Wy(e,t){Uy(e).dimIdxInCoord=t.get(e.dim)}function Gy(e,t){var n=e.scale,r=e.model,i=e.dim;n.rawExtentInfo||Ky(n,e,i,r,t)}function Ky(e,t,n,r,i){var a=Uy(t),o=a.extent,s=!1;zv(t,function(r){if(r.boxCoordinateSystem){var i=rm(r).coord,c=a.dimIdxInCoord;if(c>=0&&z(i)){var l=i[c];l!=null&&!z(l)&&Ru(o,e.parse(l))}}else if(r.coordinateSystem){var u=r.getData();if(u){var d=e.getFilter?e.getFilter():null;L(B_(u,n),function(e){Vu(o,u.getApproximateExtent(e,d))})}r.__requireStartValue&&r.__requireStartValue(t)&&(s=!0)}});var c=Zy(e,t,r);Jy(e,new CW(e,r,o,s,c),i),a.extent=null}function qy(e,t){var n=e.scale;Jy(n,new CW(n,e.model,t,!1,!1),SW)}function Jy(e,t,n){e.rawExtentInfo=t,t.from=n}function Yy(e,t){wW.set(e,t)}function Xy(e,t,n,r,i){e.rawExtentInfo||qy({scale:e,model:t},i||Lu());var a=e.rawExtentInfo.makeFinal(),o=a.effMM;return e.setExtent(o[0],o[1]),e.setBlank(a.isBlank),r&&a.tggAxInv&&n&&!n.get(`legacyMinMaxDontInverseAxis`)&&(r.inverse=!r.inverse),a}function Zy(e,t,n){var r=q_(e,n),i=n.get(`containShape`,!0);if(i==null&&!r&&(i=!0),!i)return!1;var a=!1;return Uv(t,function(e){a=!!wW.get(e)||a}),a}function Qy(e,t,n,r){if(n.ctnShp){var i;if(Uv(e,function(t){var n=wW.get(t);if(n){var a=n(e,r);a&&(i||=[0,0],zu(i,a[0]),Bu(i,a[1]),P_(e))}}),i){var a=t.getExtent();if(m_(t))e.onBand||t.setExtent2(1,mR(a[0],a[0]+i[0]),hR(a[1],a[1]+i[1]));else{var o=a.slice();n.zoomFixMM[0]||(o[0]=mR(o[0],t.transformOut(t.transformIn(o[0],null)+i[0],null))),n.zoomFixMM[1]||(o[1]=hR(o[1],t.transformOut(t.transformIn(o[1],null)+i[1],null))),(o[0]<a[0]||o[1]>a[1])&&t.setExtent2(1,o[0],o[1])}}}}function $y(){Gv(`liPosMinGap`,eb)}function eb(e,t,n){var r=W(),i=n.serUids,a=n.liPosMinGap,o,s=t.axis,c=s.scale,l=c.needTransform(),u=c.getFilter?c.getFilter():null,d=Up(u);function f(n){Vv(e,t.sers,function(e){var t=e.getRawData(),r=t.getDimensionIndex(t.mapDimension(s.dim));r>=0&&n(r,e,t.getStore())})}var p=0;if(f(function(e,t,n){r.set(t.uid,1),i&&i.hasKey(t.uid)||(o=!0),p+=n.count()}),i&&i.keys().length===r.keys().length||(o=!0),!o&&a!=null)t.liPosMinGap=a;else{Ig(TW,p);var m=0;f(function(e,t,n){for(var r=0,i=n.count();r<i;++r){var a=n.get(e,r);isFinite(a)&&(!u||Wp(d,a))&&(l&&(a=c.transformIn(a,null)),TW.arr[m++]=a)}});var h=TW.typed?TW.arr.subarray(0,m):(TW.arr.length=m,TW.arr);TW.typed?h.sort():zl(h);for(var g=1/0,_=1;_<m;++_){var v=h[_]-h[_-1];v>0&&v<g&&(g=v)}n.liPosMinGap=t.liPosMinGap=ru(g)?g:m>0?-2:-1,n.serUids=r}}function tb(e){return function(t,n){var r=Yv(t,{fromStat:{key:e}});if(ru(r.w2))return[-r.w2/2,r.w2/2]}}function nb(e,t){return e+`|&`+t}function rb(e){return $y(),{liPosMinGap:!m_(e.scale)}}function ib(e,t,n,r){Jv(e,{key:t,seriesType:n,coordSysType:r,getMetrics:rb})}function ab(e){return e.scale.rawExtentInfo.makeRenderInfo().startValue}function ob(e){return e.get(`stack`)||jW+e.seriesIndex}function sb(e,t){var n=cb(e,t);return n.columnMap=lb(n),n}function cb(e,t){var n=nb(t,OW),r=[],i=Yv(e,{fromStat:{key:n},min:1});return Bv(e,n,function(e){r.push({barWidth:Y(e.get(`barWidth`),i.w),barMaxWidth:Y(e.get(`barMaxWidth`),i.w),barMinWidth:Y(e.get(`barMinWidth`)||(fb(e)?.5:1),i.w),barGap:e.get(`barGap`),barCategoryGap:e.get(`barCategoryGap`),defaultBarGap:e.get(`defaultBarGap`),stackId:ob(e)})}),{bandWidthResult:i,seriesInfo:r}}function lb(e){var t=e.bandWidthResult.w,n=t,r=0,i,a,o=[],s={};L(e.seriesInfo,function(e,t){t||(a=e.defaultBarGap||0);var c=e.stackId;so(s,c)||r++;var l=s[c];l||(l=s[c]={width:0,maxWidth:0},o.push(c));var u=e.barWidth;u&&!l.width&&(l.width=u,u=mR(n,u),n-=u);var d=e.barMaxWidth;d&&(l.maxWidth=d);var f=e.barMinWidth;f&&(l.minWidth=f);var p=e.barGap;p!=null&&(a=p);var m=e.barCategoryGap;m!=null&&(i=m)}),i??=hR(35-o.length*4,15)+`%`;var c=Y(i,t),l=Y(a,1),u=(n-c)/(r+(r-1)*l);u=hR(u,0),L(o,function(e){var t=s[e],i=t.maxWidth,a=t.minWidth;if(t.width){var o=t.width;i&&(o=mR(o,i)),a&&(o=hR(o,a)),t.width=o,n-=o+l*o,r--}else{var o=u;i&&i<o&&(o=mR(i,n)),a&&a>o&&(o=a),o!==u&&(t.width=o,n-=o+l*o,r--)}}),u=(n-c)/(r+(r-1)*l),u=hR(u,0);var d=0,f;L(o,function(e){var t=s[e];t.width||=u,f=t,d+=t.width*(1+l)}),f&&(d-=f.width*l);var p={},m=-d/2;return L(o,function(e){var n=s[e];p[e]=p[e]||{bandWidth:t,offset:m,width:n.width},m+=n.width*(1+l)}),p}function ub(e){return{seriesType:e,overallReset:function(t){var n=nb(e,OW);Hv(t,n,function(t){var r=sb(t,e);Bv(t,n,function(e){var t=r.columnMap[ob(e)];e.getData().setLayout({bandWidth:t.bandWidth,offset:t.offset,size:t.width})})})}}}function db(e){return{seriesType:e,plan:Bg(),reset:function(e){if(Fy(e)){var t=e.getData(),n=e.coordinateSystem,r=n.getBaseAxis(),i=n.getOtherAxis(r),a=t.getDimensionIndex(t.mapDimension(i.dim)),o=t.getDimensionIndex(t.mapDimension(r.dim)),s=e.get(`showBackground`,!0),c=t.mapDimension(i.dim),l=t.getCalculationInfo(`stackResultDimension`),u=um(t,c)&&!!t.getCalculationInfo(`stackedOnSeries`),d=i.isHorizontal(),f=i.toGlobalCoord(i.dataToCoord(ab(i))),p=fb(e),m=e.get(`barMinHeight`)||0,h=l&&t.getDimensionIndex(l),g=t.getLayout(`size`),_=t.getLayout(`offset`);return{progress:function(e,t){for(var r=e.count,i=p&&Fg(r*3),c=p&&s&&Fg(r*3),l=p&&Fg(r),v=n.master.getRect(),y=d?v.width:v.height,b,x=t.getStore(),S=0;(b=e.next())!=null;){var C=x.get(u?h:a,b),w=x.get(o,b),T=f,E=void 0;u&&(E=+C-x.get(a,b));var D=void 0,O=void 0,k=void 0,A=void 0;if(d){var j=n.dataToPoint([C,w]);u&&(T=n.dataToPoint([E,w])[0]),D=T,O=j[1]+_,k=j[0]-T,A=g,gR(k)<m&&(k=(k<0?-1:1)*m)}else{var j=n.dataToPoint([w,C]);u&&(T=n.dataToPoint([w,E])[1]),D=j[0]+_,O=T,k=g,A=j[1]-T,gR(A)<m&&(A=(A<=0?-1:1)*m)}p?(i[S]=D,i[S+1]=O,i[S+2]=d?k:A,c&&(c[S]=d?v.x:D,c[S+1]=d?O:v.y,c[S+2]=y),l[b]=b):t.setItemLayout(b,{x:D,y:O,width:k,height:A}),S+=3}p&&t.setLayout({largePoints:i,largeDataIndices:l,largeBackgroundPoints:c,valueAxisHorizontal:d})}}}}}}function fb(e){return e.pipelineContext&&e.pipelineContext.large}function pb(e){return tb(nb(e,OW))}function mb(e){AW(e,function(){function t(t){var n=nb(t,OW);ib(e,n,t,OW),Yy(n,pb(t))}t(`bar`),t(`pictorialBar`)})}function hb(e,t,n){var r,i=0,a=0,o=null,s,c,l,u;t||=0;function d(){a=new Date().getTime(),o=null,e.apply(c,l||[])}var f=function(){var e=[...arguments];r=new Date().getTime(),c=this,l=e;var f=u||t,p=u||n;u=null,s=r-(p?i:a)-f,clearTimeout(o),p?o=setTimeout(d,f):s>=0?d():o=setTimeout(d,-s),i=r};return f.clear=function(){o&&=(clearTimeout(o),null)},f.debounceNextCall=function(e){u=e},f}function gb(e,t,n,r){var i=e[t];if(i){var a=i[PW]||i,o=i[IW];if(i[FW]!==n||o!==r){if(n==null||!r)return e[t]=a;i=e[t]=hb(a,n,r===`debounce`),i[PW]=a,i[IW]=r,i[FW]=n}return i}}function _b(e,t){var n=e[t];n&&n[PW]&&(n.clear&&n.clear(),e[t]=n[PW])}function vb(e,t){t||={};var n=t.isRoundCap;return function(t,r,i){var a=r.position;if(!a||a instanceof Array)return cs(t,r,i);var o=e(a),s=r.distance==null?5:r.distance,c=this.shape,l=c.cx,u=c.cy,d=c.r,f=c.r0,p=(d+f)/2,m=c.startAngle,h=c.endAngle,g=(m+h)/2,_=n?Math.abs(d-f)/2:0,v=Math.cos,y=Math.sin,b=l+d*v(m),x=u+d*y(m),S=`left`,C=`top`;switch(o){case`startArc`:b=l+(f-s)*v(g),x=u+(f-s)*y(g),S=`center`,C=`top`;break;case`insideStartArc`:b=l+(f+s)*v(g),x=u+(f+s)*y(g),S=`center`,C=`bottom`;break;case`startAngle`:b=l+p*v(m)+bb(m,s+_,!1),x=u+p*y(m)+xb(m,s+_,!1),S=`right`,C=`middle`;break;case`insideStartAngle`:b=l+p*v(m)+bb(m,-s+_,!1),x=u+p*y(m)+xb(m,-s+_,!1),S=`left`,C=`middle`;break;case`middle`:b=l+p*v(g),x=u+p*y(g),S=`center`,C=`middle`;break;case`endArc`:b=l+(d+s)*v(g),x=u+(d+s)*y(g),S=`center`,C=`bottom`;break;case`insideEndArc`:b=l+(d-s)*v(g),x=u+(d-s)*y(g),S=`center`,C=`top`;break;case`endAngle`:b=l+p*v(h)+bb(h,s+_,!0),x=u+p*y(h)+xb(h,s+_,!0),S=`left`,C=`middle`;break;case`insideEndAngle`:b=l+p*v(h)+bb(h,-s+_,!0),x=u+p*y(h)+xb(h,-s+_,!0),S=`right`,C=`middle`;break;default:return cs(t,r,i)}return t||={},t.x=b,t.y=x,t.align=S,t.verticalAlign=C,t}}function yb(e,t,n,r){if(Wa(r))e.setTextConfig({rotation:r});else if(z(t))e.setTextConfig({rotation:0});else{var i=e.shape,a=i.clockwise?i.startAngle:i.endAngle,o=i.clockwise?i.endAngle:i.startAngle,s=(a+o)/2,c,l=n(t);switch(l){case`startArc`:case`insideStartArc`:case`middle`:case`insideEndArc`:case`endArc`:c=s;break;case`startAngle`:case`insideStartAngle`:c=a;break;case`endAngle`:case`insideEndAngle`:c=o;break;default:e.setTextConfig({rotation:0});return}var u=Math.PI*1.5-c;l===`middle`&&u>Math.PI/2&&u<Math.PI*1.5&&(u-=Math.PI),e.setTextConfig({rotation:u})}}function bb(e,t,n){return t*Math.sin(e)*(n?-1:1)}function xb(e,t,n){return t*Math.cos(e)*(n?1:-1)}function Sb(e,t,n){var r=e.get(`borderRadius`);if(r==null)return n?{cornerRadius:0}:null;z(r)||(r=[r,r,r,r]);var i=Math.abs(t.r||0-t.r0||0);return{cornerRadius:R(r,function(e){return ss(e,i)})}}function Cb(e,t){var n=e.get(`realtimeSort`,!0),r=t.getBaseAxis();if(n&&r.type===`category`&&t.type===`cartesian2d`)return{baseAxis:r,otherAxis:t.getOtherAxis(r)}}function wb(e,t,n,r,i,a,o,s){var c,l;a?(l={x:r.x,width:r.width},c={y:r.y,height:r.height}):(l={y:r.y,height:r.height},c={x:r.x,width:r.width}),s||(o?df:ff)(n,{shape:c},t,i,null);var u=t?e.baseAxis.model:null;(o?df:ff)(n,{shape:l},u,i)}function Tb(e,t){for(var n=0;n<t.length;n++)if(!isFinite(e[t[n]]))return!0;return!1}function Eb(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function Db(e){return function(e){var t=e?`Arc`:`Angle`;return function(e){switch(e){case`start`:case`insideStart`:case`end`:case`insideEnd`:return e+t;default:return e}}}(e)}function Ob(e,t,n,r,i,a,o,s){var c=t.getItemVisual(n,`style`);if(!s){var l=r.get([`itemStyle`,`borderRadius`])||0;e.setShape(`r`,l)}else if(!a.get(`roundCap`)){var u=e.shape;I(u,Sb(r.getModel(`itemStyle`),u,!0)),e.setShape(u)}e.useStyle(c);var d=r.getShallow(`cursor`);d&&e.attr(`cursor`,d);var f=s?o?i.r>=i.r0?`endArc`:`startArc`:i.endAngle>=i.startAngle?`endAngle`:`startAngle`:o?Pb(i,a.coordinateSystem):Fb(i,a.coordinateSystem),p=ap(r);ip(e,p,{labelFetcher:a,labelDataIndex:n,defaultText:wg(a.getData(),n),inheritColor:c.fill,defaultOpacity:c.opacity,defaultOutsidePosition:f});var m=e.getTextContent();if(s&&m){var h=r.get([`label`,`position`]);e.textConfig.inside=h===`middle`||null,yb(e,h===`outside`?f:h,Db(o),r.get([`label`,`rotate`]))}fp(m,p,a.getRawValue(n),function(e){return Tg(t,e)});var g=r.getModel([`emphasis`]);Fd(e,g.get(`focus`),g.get(`blurScope`),g.get(`disabled`)),Ld(e,r),Eb(i)&&(e.style.fill=`none`,e.style.stroke=`none`,L(e.states,function(e){e.style&&(e.style.fill=e.style.stroke=`none`)}))}function kb(e,t){var n=e.get([`itemStyle`,`borderColor`]);if(!n||n===`none`)return 0;var r=e.get([`itemStyle`,`borderWidth`])||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(r,i,a)}function Ab(e,t,n,r){var i=e.getData(),a=+!!i.getLayout(`valueAxisHorizontal`),o=i.getLayout(`largeDataIndices`),s=i.getLayout(`size`),c=e.getModel(`backgroundStyle`),l=i.getLayout(`largeBackgroundPoints`),u=r?Xu(e):0;if(l){var d=new YW({shape:{points:l},incremental:u,silent:!0,z2:0});d.baseDimIdx=a,d.largeDataIndices=o,d.barWidth=s,d.useStyle(c.getItemStyle()),t.add(d),n&&n.push(d)}var f=new YW({shape:{points:i.getLayout(`largePoints`)},incremental:u,ignoreCoarsePointer:!0,z2:1});f.baseDimIdx=a,f.largeDataIndices=o,f.barWidth=s,t.add(f),f.useStyle(i.getVisual(`style`)),f.style.stroke=null,LR(f).seriesIndex=e.seriesIndex,e.get(`silent`)||(f.on(`mousedown`,XW),f.on(`mousemove`,XW)),n&&n.push(f)}function jb(e,t,n){for(var r=e.baseDimIdx,i=1-r,a=e.shape.points,o=e.largeDataIndices,s=[],c=[],l=e.barWidth,u=0,d=a.length/3;u<d;u++){var f=u*3;if(c[r]=l,c[i]=a[f+2],s[r]=a[f+r],s[i]=a[f+i],c[i]<0&&(s[i]+=c[i],c[i]=-c[i]),t>=s[0]&&t<=s[0]+c[0]&&n>=s[1]&&n<=s[1]+c[1])return o[u]}return-1}function Mb(e,t,n){if(Yg(n,`cartesian2d`)){var r=t,i=n.getArea();return{x:e?r.x:i.x,y:e?i.y:r.y,width:e?r.width:i.width,height:e?i.height:r.height}}var i=n.getArea(),a=t;return{cx:i.cx,cy:i.cy,r0:e?i.r0:a.r0,r:e?i.r:a.r,startAngle:e?a.startAngle:0,endAngle:e?a.endAngle:Math.PI*2}}function Nb(e,t,n){return new(e.type===`polar`?zz:rR)({shape:Mb(t,n,e),silent:!0,z2:0})}function Pb(e,t){return e.height===0?t.getOtherAxis(t.getBaseAxis()).inverse?`bottom`:`top`:e.height>0?`bottom`:`top`}function Fb(e,t){return e.width===0?t.getOtherAxis(t.getBaseAxis()).inverse?`left`:`right`:e.width>=0?`right`:`left`}function Ib(e){e.registerChartView(VW),e.registerSeriesModel(NW),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,ub(`bar`)),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,db(`bar`)),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,dv(`bar`)),e.registerAction({type:`changeAxisOrder`,event:`changeAxisOrder`,update:`update`},function(e,t){var n=e.componentType||`series`;t.eachComponent({mainType:n,query:e},function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)})}),mb(e)}function Lb(e,t){function n(t,n){var r=[];return t.eachComponent({mainType:`series`,subType:e,query:n},function(e){r.push(e.seriesIndex)}),r}L([[e+`ToggleSelect`,`toggleSelect`],[e+`Select`,`select`],[e+`UnSelect`,`unselect`]],function(e){t(e[0],function(t,r,i){t=I({},t),i.dispatchAction(I(t,{type:e[1],seriesIndex:n(r,t)}))})})}function Rb(e,t,n,r,i){var a=e+t;n.isSilent(a)||r.eachComponent({mainType:`series`,subType:`pie`},function(e){for(var t=e.seriesIndex,r=e.option.selectedMap,o=i.selected,s=0;s<o.length;s++)if(o[s].seriesIndex===t){var c=e.getData(),l=Eu(c,i.fromActionPayload);n.trigger(a,{type:a,seriesId:e.id,name:z(l)?c.getName(l[0]):c.getName(l),selected:V(r)?r:I({},r)})}})}function zb(e,t,n){e.on(`selectchanged`,function(e){var r=n.getModel();e.isFromClick?(Rb(`map`,`selectchanged`,t,r,e),Rb(`pie`,`selectchanged`,t,r,e)):e.fromAction===`select`?(Rb(`map`,`selected`,t,r,e),Rb(`pie`,`selected`,t,r,e)):e.fromAction===`unselect`&&(Rb(`map`,`unselected`,t,r,e),Rb(`pie`,`unselected`,t,r,e))})}function Bb(e){return{seriesType:e,reset:function(e,t){var n=t.findComponents({mainType:`legend`});if(n&&n.length){var r=e.getData();r.filterSelf(function(e){for(var t=r.getName(e),i=0;i<n.length;i++)if(!n[i].isSelected(t))return!1;return!0})}}}}function Vb(e,t,n){t=z(t)&&{coordDimensions:t}||I({encodeDefine:e.getEncode()},t);var r=e.getSource(),i=Qp(r,t).dimensions,a=new FV(i,e);return a.initData(r,n),a}function Hb(e,t,n,r,i){var a=n.width,o=n.height;switch(e){case`top`:r.set(n.x+a/2,n.y-t),i.set(0,-1);break;case`bottom`:r.set(n.x+a/2,n.y+o+t),i.set(0,1);break;case`left`:r.set(n.x-t,n.y+o/2),i.set(-1,0);break;case`right`:r.set(n.x+a+t,n.y+o/2),i.set(1,0)}}function Ub(e,t,n,r,i,a,o,s,c){o-=e,s-=t;var l=Math.sqrt(o*o+s*s);o/=l,s/=l;var u=o*n+e,d=s*n+t;if(Math.abs(r-i)%eG<1e-4)return c[0]=u,c[1]=d,l-n;if(a){var f=r;r=ol(i),i=ol(f)}else r=ol(r),i=ol(i);r>i&&(i+=eG);var p=Math.atan2(s,o);if(p<0&&(p+=eG),p>=r&&p<=i||p+eG>=r&&p+eG<=i)return c[0]=u,c[1]=d,l-n;var m=n*Math.cos(r)+e,h=n*Math.sin(r)+t,g=n*Math.cos(i)+e,_=n*Math.sin(i)+t,v=(m-o)*(m-o)+(h-s)*(h-s),y=(g-o)*(g-o)+(_-s)*(_-s);return v<y?(c[0]=m,c[1]=h,Math.sqrt(v)):(c[0]=g,c[1]=_,Math.sqrt(y))}function Wb(e,t,n,r,i,a,o,s){var c=i-e,l=a-t,u=n-e,d=r-t,f=Math.sqrt(u*u+d*d);u/=f,d/=f;var p=(c*u+l*d)/f;s&&(p=Math.min(Math.max(p,0),1)),p*=f;var m=o[0]=e+p*u,h=o[1]=t+p*d;return Math.sqrt((m-i)*(m-i)+(h-a)*(h-a))}function Gb(e,t,n,r,i,a,o){n<0&&(e+=n,n=-n),r<0&&(t+=r,r=-r);var s=e+n,c=t+r,l=o[0]=Math.min(Math.max(i,e),s),u=o[1]=Math.min(Math.max(a,t),c);return Math.sqrt((l-i)*(l-i)+(u-a)*(u-a))}function Kb(e,t,n){var r=Gb(t.x,t.y,t.width,t.height,e.x,e.y,rG);return n.set(rG[0],rG[1]),r}function qb(e,t,n){for(var r=0,i=0,a=0,o=0,s,c,l=1/0,u=t.data,d=e.x,f=e.y,p=0;p<u.length;){var m=u[p++];p===1&&(r=u[p],i=u[p+1],a=r,o=i);var h=l;switch(m){case tG.M:a=u[p++],o=u[p++],r=a,i=o;break;case tG.L:h=Wb(r,i,u[p],u[p+1],d,f,rG,!0),r=u[p++],i=u[p++];break;case tG.C:h=Ps(r,i,u[p++],u[p++],u[p++],u[p++],u[p],u[p+1],d,f,rG),r=u[p++],i=u[p++];break;case tG.Q:h=Vs(r,i,u[p++],u[p++],u[p],u[p+1],d,f,rG),r=u[p++],i=u[p++];break;case tG.A:var g=u[p++],_=u[p++],v=u[p++],y=u[p++],b=u[p++],x=u[p++];p+=1;var S=!!(1-u[p++]);s=Math.cos(b)*v+g,c=Math.sin(b)*y+_,p<=1&&(a=s,o=c);var C=(d-g)*y/v+g;h=Ub(g,_,y,b,b+x,S,C,f,rG),r=Math.cos(b+x)*v+g,i=Math.sin(b+x)*y+_;break;case tG.R:a=r=u[p++],o=i=u[p++];var w=u[p++],T=u[p++];h=Gb(a,o,w,T,d,f,rG);break;case tG.Z:h=Wb(r,i,a,o,d,f,rG,!0),r=a,i=o}h<l&&(l=h,n.set(rG[0],rG[1]))}return l}function Jb(e,t){if(e){var n=e.getTextGuideLine(),r=e.getTextContent();if(r&&n){var i=e.textGuideLineConfig||{},a=[[0,0],[0,0],[0,0]],o=i.candidates||nG,s=r.getBoundingRect().clone();s.applyTransform(r.getComputedTransform());var c=1/0,l=i.anchor,u=e.getComputedTransform(),d=u&&No([],u),f=t.get(`length2`)||0;l&&oG.copy(l);for(var p=0;p<o.length;p++){var m=o[p];Hb(m,0,s,iG,sG),wF.scaleAndAdd(aG,iG,sG,f),aG.transform(d);var h=e.getBoundingRect(),g=l?l.distance(aG):e instanceof JL?qb(aG,e.path,oG):Kb(aG,h,oG);g<c&&(c=g,aG.transform(u),oG.transform(u),oG.toArray(a[0]),aG.toArray(a[1]),iG.toArray(a[2]))}Yb(a,t.get(`minTurnAngle`)),n.setShape({points:a})}}}function Yb(e,t){if(t<=180&&t>0){t=t/180*Math.PI,iG.fromArray(e[0]),aG.fromArray(e[1]),oG.fromArray(e[2]),wF.sub(sG,iG,aG),wF.sub(cG,oG,aG);var n=sG.len(),r=cG.len();if(!(n<.001||r<.001)){sG.scale(1/n),cG.scale(1/r);var i=sG.dot(cG);if(Math.cos(t)<i){var a=Wb(aG.x,aG.y,oG.x,oG.y,iG.x,iG.y,lG,!1);uG.fromArray(lG),uG.scaleAndAdd(cG,a/Math.tan(Math.PI-t));var o=oG.x===aG.x?(uG.y-aG.y)/(oG.y-aG.y):(uG.x-aG.x)/(oG.x-aG.x);if(isNaN(o))return;o<0?wF.copy(uG,aG):o>1&&wF.copy(uG,oG),uG.toArray(e[1])}}}}function Xb(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,iG.fromArray(e[0]),aG.fromArray(e[1]),oG.fromArray(e[2]),wF.sub(sG,aG,iG),wF.sub(cG,oG,aG);var r=sG.len(),i=cG.len();if(!(r<.001||i<.001)&&(sG.scale(1/r),cG.scale(1/i),sG.dot(t)<Math.cos(n))){var a=Wb(aG.x,aG.y,oG.x,oG.y,iG.x,iG.y,lG,!1);uG.fromArray(lG);var o=Math.PI/2,s=o+Math.acos(cG.dot(t))-n;if(s>=o)wF.copy(uG,oG);else{uG.scaleAndAdd(cG,a/Math.tan(Math.PI/2-s));var c=oG.x===aG.x?(uG.y-aG.y)/(oG.y-aG.y):(uG.x-aG.x)/(oG.x-aG.x);if(isNaN(c))return;c<0?wF.copy(uG,aG):c>1&&wF.copy(uG,oG)}uG.toArray(e[1])}}}function Zb(e,t,n,r){var i=n===`normal`,a=i?e:e.ensureState(n);a.ignore=t;var o=r.get(`smooth`);o=o===!0?.3:Math.max(+o,0)||0,a.shape=a.shape||{},a.shape.smooth=o;var s=r.getModel(`lineStyle`).getLineStyle();i?e.useStyle(s):a.style=s}function Qb(e,t){var n=t.smooth,r=t.points;if(r){if(e.moveTo(r[0][0],r[0][1]),n>0&&r.length>=3){var i=SF(r[0],r[1]),a=SF(r[1],r[2]);if(!i||!a){e.lineTo(r[1][0],r[1][1]),e.lineTo(r[2][0],r[2][1]);return}var o=Math.min(i,a)*n,s=Ko([],r[1],r[0],o/i),c=Ko([],r[1],r[2],o/a),l=Ko([],s,c,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],l[0],l[1]),e.bezierCurveTo(c[0],c[1],c[0],c[1],r[2][0],r[2][1])}else for(var u=1;u<r.length;u++)e.lineTo(r[u][0],r[u][1])}}function $b(e,t,n){var r=e.getTextGuideLine(),i=e.getTextContent();if(!i)r&&e.removeTextGuideLine();else{for(var a=t.normal,o=a.get(`show`),s=i.ignore,c=0;c<nz.length;c++){var l=nz[c],u=t[l],d=l===`normal`;if(u){var f=u.get(`show`);if((d?s:U(i.states[l]&&i.states[l].ignore,s))||!U(f,o)){var p=d?r:r&&r.states[l];p&&(p.ignore=!0),r&&Zb(r,!0,l,u);continue}r||(r=new Gz,e.setTextGuideLine(r),d||!s&&o||Zb(r,!0,`normal`,t.normal),e.stateProxy&&(r.stateProxy=e.stateProxy)),Zb(r,!1,l,u)}}if(r){Ma(r.style,n),r.style.fill=null;var m=a.get(`showAbove`),h=e.textGuideLineConfig=e.textGuideLineConfig||{};h.showAbove=m||!1,r.buildPath=Qb}}}function ex(e,t){t||=`labelLine`;for(var n={normal:e.getModel(t)},r=0;r<tz.length;r++){var i=tz[r];n[i]=e.getModel([i,t])}return n}function tx(e,t,n,r,i,a,o,s,c,l){if(e.length<2)return;function u(e){for(var a=e.rB,o=a*a,s=0;s<e.list.length;s++){var c=e.list[s],l=Math.abs(c.label.y-n),u=r+c.len,d=u*u,f=t+(Math.sqrt(Math.abs((1-l*l/o)*d))+c.len2)*i,p=f-c.label.x;rx(c,c.targetTextWidth-p*i,!0),c.label.x=f}}function d(e){for(var a={list:[],maxY:0},o={list:[],maxY:0},s=0;s<e.length;s++)if(e[s].labelAlignTo===`none`){var c=e[s],l=c.label.y>n?o:a,d=Math.abs(c.label.y-n);if(d>=l.maxY){var f=c.label.x-t-c.len2*i,p=r+c.len;l.rB=Math.abs(f)<p?Math.sqrt(d*d/(1-f*f/p/p)):p,l.maxY=d}l.list.push(c)}u(a),u(o)}for(var f=e.length,p=0;p<f;p++)if(e[p].position===`outer`&&e[p].labelAlignTo===`labelLine`){var m=e[p].label.x-l;e[p].linePoints[1][0]+=m,e[p].label.x=l}cy(e,1,c,c+o)&&d(e)}function nx(e,t,n,r,i,a,o,s){for(var c=[],l=[],u=Number.MAX_VALUE,d=-Number.MAX_VALUE,f=0;f<e.length;f++){var p=e[f].label;ax(e[f])||(p.x<t?(u=Math.min(u,p.x),c.push(e[f])):(d=Math.max(d,p.x),l.push(e[f])))}for(var f=0;f<e.length;f++){var m=e[f];if(!ax(m)&&m.linePoints){if(m.labelStyleWidth!=null)continue;var p=m.label,h=m.linePoints,g=void 0;g=m.labelAlignTo===`edge`?p.x<t?h[2][0]-m.labelDistance-o-m.edgeDistance:o+i-m.edgeDistance-h[2][0]-m.labelDistance:m.labelAlignTo===`labelLine`?p.x<t?u-o-m.bleedMargin:o+i-d-m.bleedMargin:p.x<t?p.x-o-m.bleedMargin:o+i-p.x-m.bleedMargin,m.targetTextWidth=g,rx(m,g,!1)}}tx(l,t,n,r,1,i,a,o,s,d),tx(c,t,n,r,-1,i,a,o,s,u);for(var f=0;f<e.length;f++){var m=e[f];if(!ax(m)&&m.linePoints){var p=m.label,h=m.linePoints,_=m.labelAlignTo===`edge`,v=p.style.padding,y=v?v[1]+v[3]:0,b=p.style.backgroundColor?0:y,x=m.rect.width+b,S=h[1][0]-h[2][0];_?p.x<t?h[2][0]=o+m.edgeDistance+x+m.labelDistance:h[2][0]=o+i-m.edgeDistance-x-m.labelDistance:(p.x<t?h[2][0]=p.x+m.labelDistance:h[2][0]=p.x-m.labelDistance,h[1][0]=h[2][0]+S),h[1][1]=h[2][1]=p.y}}}function rx(e,t,n){if(e.labelStyleWidth==null){var r=e.label,i=r.style,a=e.rect,o=i.backgroundColor,s=i.padding,c=s?s[1]+s[3]:0,l=i.overflow,u=a.width+(o?0:c);if(t<u||n){if(l&&l.match(`break`)){r.setStyle(`backgroundColor`,null),r.setStyle(`width`,t-c);var d=r.getBoundingRect();r.setStyle(`width`,Math.ceil(d.width)),r.setStyle(`backgroundColor`,o)}else{var f=t-c,p=t<u?f:n?f>e.unconstrainedWidth?null:f:null;r.setStyle(`width`,p)}ix(a,r)}}}function ix(e,t){pG.rect=e,ry(pG,t,fG)}function ax(e){return e.position===`center`}function ox(e){var t=e.getData(),n=[],r,i,a=!1,o=(e.get(`minShowLabelAngle`)||0)*dG,s=t.getLayout(`viewRect`),c=t.getLayout(`r`),l=s.width,u=s.x,d=s.y,f=s.height;function p(e){e.ignore=!0}function m(e){if(!e.ignore)return!0;for(var t in e.states)if(e.states[t].ignore===!1)return!0;return!1}t.each(function(e){var s=t.getItemGraphicEl(e),d=s.shape,h=s.getTextContent(),g=s.getTextGuideLine(),_=t.getItemModel(e),v=_.getModel(`label`),y=v.get(`position`)||_.get([`emphasis`,`label`,`position`]),b=v.get(`distanceToLabelLine`),x=v.get(`alignTo`),S=Y(v.get(`edgeDistance`),l),C=v.get(`bleedMargin`);C??=Math.min(l,f)>200?10:2;var w=_.getModel(`labelLine`),T=w.get(`length`);T=Y(T,l);var E=w.get(`length2`);if(E=Y(E,l),Math.abs(d.endAngle-d.startAngle)<o)L(h.states,p),h.ignore=!0,g&&(L(g.states,p),g.ignore=!0);else if(m(h)){var D=(d.startAngle+d.endAngle)/2,O=Math.cos(D),k=Math.sin(D),A,j,M,ee;r=d.cx,i=d.cy;var te=y===`inside`||y===`inner`;if(y===`center`)A=d.cx,j=d.cy,ee=`center`;else{var ne=(te?(d.r+d.r0)/2*O:d.r*O)+r,re=(te?(d.r+d.r0)/2*k:d.r*k)+i;if(A=ne+O*3,j=re+k*3,!te){var ie=ne+O*(T+c-d.r),ae=re+k*(T+c-d.r),oe=ie+(O<0?-1:1)*E,se=ae;A=x===`edge`?O<0?u+S:u+l-S:oe+(O<0?-b:b),j=se,M=[[ne,re],[ie,ae],[oe,se]]}ee=te?`center`:x===`edge`?O>0?`right`:`left`:O>0?`left`:`right`}var ce=Math.PI,le=0,ue=v.get(`rotate`);if(Wa(ue))le=ce/180*ue;else if(y===`center`)le=0;else if(ue===`radial`||ue===!0)le=O<0?-D+ce:-D;else if(ue===`tangential`||ue===`tangential-noflip`&&y!==`outside`&&y!==`outer`){var de=Math.atan2(O,k);de<0&&(de=ce*2+de),k>0&&ue!==`tangential-noflip`&&(de=ce+de),le=de-ce}if(a=!!le,h.x=A,h.y=j,h.rotation=le,h.setStyle({verticalAlign:`middle`}),te){h.setStyle({align:ee});var fe=h.states.select;fe&&(fe.x+=h.x,fe.y+=h.y)}else{var pe=new J(0,0,0,0);ix(pe,h),n.push({label:h,labelLine:g,position:y,len:T,len2:E,minTurnAngle:w.get(`minTurnAngle`),maxSurfaceAngle:w.get(`maxSurfaceAngle`),surfaceNormal:new wF(O,k),linePoints:M,textAlign:ee,labelDistance:b,labelAlignTo:x,edgeDistance:S,bleedMargin:C,rect:pe,unconstrainedWidth:pe.width,labelStyleWidth:h.style.width})}s.setTextConfig({inside:te})}}),!a&&e.get(`avoidLabelOverlap`)&&nx(n,r,i,c,l,f,u,d);for(var h=0;h<n.length;h++){var g=n[h],_=g.label,v=g.labelLine,y=isNaN(_.x)||isNaN(_.y);if(_){_.setStyle({align:g.textAlign}),y&&(L(_.states,p),_.ignore=!0);var b=_.states.select;b&&(b.x+=_.x,b.y+=_.y)}if(v){var x=g.linePoints;y||!x?(L(v.states,p),v.ignore=!0):(Yb(x,g.minTurnAngle),Xb(x,g.surfaceNormal,g.maxSurfaceAngle),v.setShape({points:x}),_.__hostTarget.textGuideLineConfig={anchor:new wF(x[0][0],x[0][1])})}}}function sx(e,t){e.eachSeriesByType(`pie`,function(e){var n=e.getData(),r=n.mapDimension(`value`),i=bh(e,t),a=i.cx,o=i.cy,s=i.r,c=i.r0,l=i.viewRect,u=-e.get(`startAngle`)*hG,d=e.get(`endAngle`),f=e.get(`padAngle`)*hG;d=d===`auto`?u-mG:-d*hG;var p=e.get(`minAngle`)*hG+f,m=0;n.each(r,function(e){!isNaN(e)&&m++});var h=n.getSum(r),g=Math.PI/(h||m)*2,_=e.get(`clockwise`),v=e.get(`roseType`),y=e.get(`stillShowZeroSum`),b=n.getDataExtent(r);b[0]=0;var x=_?1:-1,S=[u,d],C=x*f/2;nl(S,!_),u=S[0],d=S[1];var w=_G(e);w.startAngle=u,w.endAngle=d,w.clockwise=_,w.cx=a,w.cy=o,w.r=s,w.r0=c;var T=Math.abs(d-u),E=T,D=0,O=u;if(n.setLayout({viewRect:l,r:s}),n.each(r,function(e,t){var r;if(isNaN(e))n.setItemLayout(t,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:_,cx:a,cy:o,r0:c,r:v?NaN:s});else{r=v===`area`?T/m:h===0&&y?g:e*g,r<p?(r=p,E-=p):D+=e;var i=O+x*r,l=0,u=0;f>r?(l=O+x*r/2,u=l):(l=O+C,u=i-C),n.setItemLayout(t,{angle:r,startAngle:l,endAngle:u,clockwise:_,cx:a,cy:o,r0:c,r:v?Nl(e,b,[c,s]):s}),O=i}}),E<mG&&m){if(E<=.001){var k=T/m;n.each(r,function(e,t){if(!isNaN(e)){var r=n.getItemLayout(t);r.angle=k;var i=0,a=0;k<f?(i=u+x*(t+1/2)*k,a=i):(i=u+x*t*k+C,a=u+x*(t+1)*k-C),r.startAngle=i,r.endAngle=a}})}else g=E/D,O=u,n.each(r,function(e,t){if(!isNaN(e)){var r=n.getItemLayout(t),i=r.angle===p?p:e*g,a=0,o=0;i<f?(a=O+x*i/2,o=a):(a=O+C,o=O+x*i-C),r.startAngle=a,r.endAngle=o,O+=x*i}})}})}function cx(e){return{seriesType:e,reset:function(e,t){var n=e.getData();n.filterSelf(function(e){var t=n.mapDimension(`value`),r=n.get(t,e);return!(Wa(r)&&!isNaN(r)&&r<0)})}}}function lx(e){e.registerChartView(yG),e.registerSeriesModel($W),Lb(`pie`,e.registerAction),e.registerLayout(gG),e.registerProcessor(Bb(`pie`)),e.registerProcessor(cx(`pie`))}function ux(e,t,n,r){return n||={},r?dx(e,t,n):wG&&t.layerX!=null&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):t.offsetX==null?dx(e,t,n):(n.zrX=t.offsetX,n.zrY=t.offsetY),n}function dx(e,t,n){if(dF.domSupported&&e.getBoundingClientRect){var r=t.clientX,i=t.clientY;if(Om(e)){var a=e.getBoundingClientRect();n.zrX=r-a.left,n.zrY=i-a.top;return}if(Tm(CG,e,r,i)){n.zrX=CG[0],n.zrY=CG[1];return}}n.zrX=n.zrY=0}function fx(e){return e||window.event}function px(e,t,n){if(t=fx(t),t.zrX!=null)return t;var r=t.type;if(r&&r.indexOf(`touch`)>=0){var i=r===`touchend`?t.changedTouches[0]:t.targetTouches[0];i&&ux(e,i,t,n)}else{ux(e,t,t,n);var a=mx(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var o=t.button;return t.which==null&&o!==void 0&&SG.test(t.type)&&(t.which=o&1?1:o&2?3:o&4?2:0),t}function mx(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,r=e.deltaY;if(n==null||r==null)return t;var i=Math.abs(r===0?n:r),a=r>0?-1:r<0?1:n>0?-1:1;return 3*i*a}function hx(e,t,n,r){e.addEventListener(t,n,r)}function gx(e,t,n,r){e.removeEventListener(t,n,r)}function _x(e){return e.which===2||e.which===3}function vx(e){var t=e[1][0]-e[0][0],n=e[1][1]-e[0][1];return Math.sqrt(t*t+n*n)}function yx(e){return[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]}function bx(e,t,n){return{type:e,event:n,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:xx}}function xx(){TG(this.event)}function Sx(e,t,n){if(e[e.rectHover?`rectContain`:`contain`](t,n)){for(var r=e,i=void 0,a=!1;r;){if(r.ignoreClip&&(a=!0),!a){var o=r.getClipPath();if(o&&!o.contain(t,n))return!1}r.silent&&(i=!0);var s=r.__hostTarget;r=s?r.ignoreHostSilent?null:s:r.parent}return!i||OG}return!1}function Cx(e,t,n,r,i){for(var a=e.length-1;a>=0;a--){var o=e[a],s=void 0;if(o!==i&&!o.ignore&&(s=Sx(o,n,r))&&(!t.topTarget&&(t.topTarget=o),s!==OG)){t.target=o;break}}}function Tx(e,t,n){var r=e.painter;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}function Ex(e){for(var t=0;e>=PG;)t|=e&1,e>>=1;return e+t}function Dx(e,t,n,r){var i=t+1;if(i===n)return 1;if(r(e[i++],e[t])<0){for(;i<n&&r(e[i],e[i-1])<0;)i++;Ox(e,t,i)}else for(;i<n&&r(e[i],e[i-1])>=0;)i++;return i-t}function Ox(e,t,n){for(n--;t<n;){var r=e[t];e[t++]=e[n],e[n--]=r}}function kx(e,t,n,r,i){for(r===t&&r++;r<n;r++){for(var a=e[r],o=t,s=r,c;o<s;)c=o+s>>>1,i(a,e[c])<0?s=c:o=c+1;var l=r-o;switch(l){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;l>0;)e[o+l]=e[o+l-1],l--}e[o]=a}}function Ax(e,t,n,r,i,a){var o=0,s=0,c=1;if(a(e,t[n+i])>0){for(s=r-i;c<s&&a(e,t[n+i+c])>0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s),o+=i,c+=i}else{for(s=i+1;c<s&&a(e,t[n+i-c])<=0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s);var l=o;o=i-c,c=i-l}for(o++;o<c;){var u=o+(c-o>>>1);a(e,t[n+u])>0?o=u+1:c=u}return c}function jx(e,t,n,r,i,a){var o=0,s=0,c=1;if(a(e,t[n+i])<0){for(s=i+1;c<s&&a(e,t[n+i-c])<0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s);var l=o;o=i-c,c=i-l}else{for(s=r-i;c<s&&a(e,t[n+i+c])>=0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s),o+=i,c+=i}for(o++;o<c;){var u=o+(c-o>>>1);a(e,t[n+u])<0?c=u:o=u+1}return c}function Mx(e,t){var n=FG,r,i,a=0,o=[];r=[],i=[];function s(e,t){r[a]=e,i[a]=t,a+=1}function c(){for(;a>1;){var e=a-2;if(e>=1&&i[e-1]<=i[e]+i[e+1]||e>=2&&i[e-2]<=i[e]+i[e-1])i[e-1]<i[e+1]&&e--;else if(i[e]>i[e+1])break;u(e)}}function l(){for(;a>1;){var e=a-2;e>0&&i[e-1]<i[e+1]&&e--,u(e)}}function u(n){var o=r[n],s=i[n],c=r[n+1],l=i[n+1];i[n]=s+l,n===a-3&&(r[n+1]=r[n+2],i[n+1]=i[n+2]),a--;var u=jx(e[c],e,o,s,0,t);o+=u,s-=u,s!==0&&(l=Ax(e[o+s-1],e,c,l,l-1,t),l!==0&&(s<=l?d(o,s,c,l):f(o,s,c,l)))}function d(r,i,a,s){var c=0;for(c=0;c<i;c++)o[c]=e[r+c];var l=0,u=a,d=r;if(e[d++]=e[u++],--s===0)for(c=0;c<i;c++)e[d+c]=o[l+c];else if(i===1){for(c=0;c<s;c++)e[d+c]=e[u+c];e[d+s]=o[l]}else{for(var f=n,p,m,h;;){p=0,m=0,h=!1;do if(t(e[u],o[l])<0){if(e[d++]=e[u++],m++,p=0,--s===0){h=!0;break}}else if(e[d++]=o[l++],p++,m=0,--i===1){h=!0;break}while((p|m)<f);if(h)break;do{if(p=jx(e[u],o,l,i,0,t),p!==0){for(c=0;c<p;c++)e[d+c]=o[l+c];if(d+=p,l+=p,i-=p,i<=1){h=!0;break}}if(e[d++]=e[u++],--s===0){h=!0;break}if(m=Ax(o[l],e,u,s,0,t),m!==0){for(c=0;c<m;c++)e[d+c]=e[u+c];if(d+=m,u+=m,s-=m,s===0){h=!0;break}}if(e[d++]=o[l++],--i===1){h=!0;break}f--}while(p>=FG||m>=FG);if(h)break;f<0&&(f=0),f+=2}if(n=f,n<1&&(n=1),i===1){for(c=0;c<s;c++)e[d+c]=e[u+c];e[d+s]=o[l]}else if(i===0)throw Error();else for(c=0;c<i;c++)e[d+c]=o[l+c]}}function f(r,i,a,s){var c=0;for(c=0;c<s;c++)o[c]=e[a+c];var l=r+i-1,u=s-1,d=a+s-1,f=0,p=0;if(e[d--]=e[l--],--i===0)for(f=d-(s-1),c=0;c<s;c++)e[f+c]=o[c];else if(s===1){for(d-=i,l-=i,p=d+1,f=l+1,c=i-1;c>=0;c--)e[p+c]=e[f+c];e[d]=o[u]}else{for(var m=n;;){var h=0,g=0,_=!1;do if(t(o[u],e[l])<0){if(e[d--]=e[l--],h++,g=0,--i===0){_=!0;break}}else if(e[d--]=o[u--],g++,h=0,--s===1){_=!0;break}while((h|g)<m);if(_)break;do{if(h=i-jx(o[u],e,r,i,i-1,t),h!==0){for(d-=h,l-=h,i-=h,p=d+1,f=l+1,c=h-1;c>=0;c--)e[p+c]=e[f+c];if(i===0){_=!0;break}}if(e[d--]=o[u--],--s===1){_=!0;break}if(g=s-Ax(e[l],o,0,s,s-1,t),g!==0){for(d-=g,u-=g,s-=g,p=d+1,f=u+1,c=0;c<g;c++)e[p+c]=o[f+c];if(s<=1){_=!0;break}}if(e[d--]=e[l--],--i===0){_=!0;break}m--}while(h>=FG||g>=FG);if(_)break;m<0&&(m=0),m+=2}if(n=m,n<1&&(n=1),s===1){for(d-=i,l-=i,p=d+1,f=l+1,c=i-1;c>=0;c--)e[p+c]=e[f+c];e[d]=o[u]}else if(s===0)throw Error();else for(f=d-(s-1),c=0;c<s;c++)e[f+c]=o[c]}}return{mergeRuns:c,forceMergeRuns:l,pushRun:s}}function Nx(e,t,n,r){n||=0,r||=e.length;var i=r-n;if(!(i<2)){var a=0;if(i<PG)a=Dx(e,n,r,t),kx(e,n,r,n+a,t);else{var o=Mx(e,t),s=Ex(i);do{if(a=Dx(e,n,r,t),a<s){var c=i;c>s&&(c=s),kx(e,n,n+c,n+a,t),a=c}o.pushRun(n,a),o.mergeRuns(),i-=a,n+=a}while(i!==0);o.forceMergeRuns()}}}function Px(){IG||(IG=!0,console.warn(`z / z2 / zlevel of displayable is invalid, which may cause unexpected errors`))}function Fx(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}function Ix(){return new Date().getTime()}function Lx(e){var t=e.pointerType;return t===`pen`||t===`touch`}function Rx(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function zx(e){e&&(e.zrByTouch=!0)}function Bx(e,t){return px(e.dom,new GG(e,t),!0)}function Vx(e,t){for(var n=t,r=!1;n&&n.nodeType!==9&&!(r=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return r}function Hx(e,t){var n=t.domHandlers;dF.pointerEventsSupported?L(HG.pointer,function(r){Wx(t,r,function(t){n[r].call(e,t)})}):(dF.touchEventsSupported&&L(HG.touch,function(r){Wx(t,r,function(i){n[r].call(e,i),Rx(t)})}),L(HG.mouse,function(r){Wx(t,r,function(i){i=fx(i),t.touching||n[r].call(e,i)})}))}function Ux(e,t){dF.pointerEventsSupported?L(UG.pointer,n):dF.touchEventsSupported||L(UG.mouse,n);function n(n){function r(r){r=fx(r),Vx(e,r.target)||(r=Bx(e,r),t.domHandlers[n].call(e,r))}Wx(t,n,r,{capture:!0})}}function Wx(e,t,n,r){e.mounted[t]=n,e.listenerOpts[t]=r,hx(e.domTarget,t,n,r)}function Gx(e){var t=e.mounted;for(var n in t)t.hasOwnProperty(n)&&gx(e.domTarget,n,t[n],e.listenerOpts[n]);e.mounted={}}function Kx(e){delete ZG[e]}function qx(e){if(!e)return!1;if(typeof e==`string`)return lc(e,1)<KI;if(e.colorStops){for(var t=e.colorStops,n=0,r=t.length,i=0;i<r;i++)n+=lc(t[i].color,1);return n/=r,n<KI}return!1}function Jx(e,t){var n=new QG(Da(),e,t);return ZG[n.id]=n,n}function Yx(e,t){XG[e]=t}function Xx(e){if(typeof $G==`function`)return $G(e)}function Zx(e){$G=e}function Qx(e,t,n){var r=aK.get(t);if(!r)return n;var i=r(e);return i?n.concat(i):n}function $x(e,t){if(t){var n=t.seriesIndex,r=t.seriesId,i=t.seriesName;return n!=null&&e.componentIndex!==n||r!=null&&e.id!==r||i!=null&&e.name!==i}}function eS(e,t){var n=e.color&&!e.colorLayer;L(t,function(t,r){r===`colorLayer`&&n||r===`color`&&e.color||TH.hasClass(r)||(typeof t==`object`?e[r]=e[r]?Aa(e[r],t,!1):ka(t):e[r]??(e[r]=t))})}function tS(e,t,n){if(z(t)){var r=W();return L(t,function(e){e!=null&&xu(e,null)!=null&&r.set(e,!0)}),Ra(n,function(t){return t&&r.get(t[e])})}var i=xu(t,null);return Ra(n,function(t){return t&&i!=null&&t[e]===i})}function nS(e,t){return t.hasOwnProperty(`subType`)?Ra(e,function(e){return e&&e.subType===t.subType}):e}function rS(e){var t=W();return e&&L(cu(e.replaceMerge),function(e){t.set(e,!0)}),{replaceMergeMainTypeMap:t}}function iS(e,t,n){var r=[],i,a,o=e.baseOption,s=e.timeline,c=e.options,l=e.media,u=!!e.media,d=!!(c||s||o&&o.timeline);o?(a=o,a.timeline||(a.timeline=s)):((d||u)&&(e.options=e.media=null),a=e),u&&z(l)&&L(l,function(e){e&&e.option&&(e.query?r.push(e):i||=e)}),f(a),L(c,function(e){return f(e)}),L(r,function(e){return f(e.option)});function f(e){L(t,function(t){t(e,n)})}return{baseOption:a,timelineOptions:c||[],mediaDefault:i,mediaList:r}}function aS(e,t,n){var r={width:t,height:n,aspectratio:t/n},i=!0;return L(e,function(e,t){var n=t.match(fK);if(n&&n[1]&&n[2]){var a=n[1];oS(r[n[2].toLowerCase()],e,a)||(i=!1)}}),i}function oS(e,t,n){return n===`min`?e>=t:n===`max`?e<=t:e===t}function sS(e,t){return e.join(`,`)===t.join(`,`)}function cS(e){var t=e&&e.itemStyle;if(t)for(var n=0,r=gK.length;n<r;n++){var i=gK[n],a=t.normal,o=t.emphasis;a&&a[i]&&(e[i]=e[i]||{},e[i].normal?Aa(e[i].normal,a[i]):e[i].normal=a[i],a[i]=null),o&&o[i]&&(e[i]=e[i]||{},e[i].emphasis?Aa(e[i].emphasis,o[i]):e[i].emphasis=o[i],o[i]=null)}}function lS(e,t,n){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var r=e[t].normal,i=e[t].emphasis;r&&(n?(e[t].normal=e[t].emphasis=null,Ma(e[t],r)):e[t]=r),i&&(e.emphasis=e.emphasis||{},e.emphasis[t]=i,i.focus&&(e.emphasis.focus=i.focus),i.blurScope&&(e.emphasis.blurScope=i.blurScope))}}function uS(e){lS(e,`itemStyle`),lS(e,`lineStyle`),lS(e,`areaStyle`),lS(e,`label`),lS(e,`labelLine`),lS(e,`upperLabel`),lS(e,`edgeLabel`)}function dS(e,t){var n=hK(e)&&e[t],r=hK(n)&&n.textStyle;if(r)for(var i=0,a=MR.length;i<a;i++){var o=MR[i];r.hasOwnProperty(o)&&(n[o]=r[o])}}function fS(e){e&&(uS(e),dS(e,`label`),e.emphasis&&dS(e.emphasis,`label`))}function pS(e){if(hK(e)){cS(e),uS(e),dS(e,`label`),dS(e,`upperLabel`),dS(e,`edgeLabel`),e.emphasis&&(dS(e.emphasis,`label`),dS(e.emphasis,`upperLabel`),dS(e.emphasis,`edgeLabel`));var t=e.markPoint;t&&(cS(t),fS(t));var n=e.markLine;n&&(cS(n),fS(n));var r=e.markArea;r&&fS(r);var i=e.data;if(e.type===`graph`){i||=e.nodes;var a=e.links||e.edges;if(a&&!Ka(a))for(var o=0;o<a.length;o++)fS(a[o]);L(e.categories,function(e){uS(e)})}if(i&&!Ka(i))for(var o=0;o<i.length;o++)fS(i[o]);if(t=e.markPoint,t&&t.data)for(var s=t.data,o=0;o<s.length;o++)fS(s[o]);if(n=e.markLine,n&&n.data)for(var c=n.data,o=0;o<c.length;o++)z(c[o])?(fS(c[o][0]),fS(c[o][1])):fS(c[o]);e.type===`gauge`?(dS(e,`axisLabel`),dS(e,`title`),dS(e,`detail`)):e.type===`treemap`?(lS(e.breadcrumb,`itemStyle`),L(e.levels,function(e){uS(e)})):e.type===`tree`&&uS(e.leaves)}}function mS(e){return z(e)?e:e?[e]:[]}function hS(e){return(z(e)?e[0]:e)||{}}function gS(e,t){mK(mS(e.series),function(e){hK(e)&&pS(e)});var n=[`xAxis`,`yAxis`,`radiusAxis`,`angleAxis`,`singleAxis`,`parallelAxis`,`radar`];t&&n.push(`valueAxis`,`categoryAxis`,`logAxis`,`timeAxis`),mK(n,function(t){mK(mS(e[t]),function(e){e&&(dS(e,`axisLabel`),dS(e.axisPointer,`label`))})}),mK(mS(e.parallel),function(e){var t=e&&e.parallelAxisDefault;dS(t,`axisLabel`),dS(t&&t.axisPointer,`label`)}),mK(mS(e.calendar),function(e){lS(e,`itemStyle`),dS(e,`dayLabel`),dS(e,`monthLabel`),dS(e,`yearLabel`)}),mK(mS(e.radar),function(e){dS(e,`name`),e.name&&e.axisName==null&&(e.axisName=e.name,delete e.name),e.nameGap!=null&&e.axisNameGap==null&&(e.axisNameGap=e.nameGap,delete e.nameGap)}),mK(mS(e.geo),function(e){hK(e)&&(fS(e),mK(mS(e.regions),function(e){fS(e)}))}),mK(mS(e.timeline),function(e){fS(e),lS(e,`label`),lS(e,`itemStyle`),lS(e,`controlStyle`,!0);var t=e.data;z(t)&&L(t,function(e){H(e)&&(lS(e,`label`),lS(e,`itemStyle`))})}),mK(mS(e.toolbox),function(e){lS(e,`iconStyle`),mK(e.feature,function(e){lS(e,`iconStyle`)})}),dS(hS(e.axisPointer),`label`),dS(hS(e.tooltip).axisPointer,`label`)}function _S(e,t){for(var n=t.split(`,`),r=e,i=0;i<n.length&&(r&&=r[n[i]],r!=null);i++);return r}function vS(e,t,n,r){for(var i=t.split(`,`),a=e,o,s=0;s<i.length-1;s++)o=i[s],a[o]??(a[o]={}),a=a[o];(r||a[i[s]]==null)&&(a[i[s]]=n)}function yS(e){e&&L(_K,function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])})}function bS(e){var t=e&&e.itemStyle;if(t)for(var n=0;n<yK.length;n++){var r=yK[n][1],i=yK[n][0];t[r]!=null&&(t[i]=t[r])}}function xS(e){e&&e.alignTo===`edge`&&e.margin!=null&&e.edgeDistance==null&&(e.edgeDistance=e.margin)}function SS(e){e&&e.downplay&&!e.blur&&(e.blur=e.downplay)}function CS(e){e&&e.focusNodeAdjacency!=null&&(e.emphasis=e.emphasis||{},e.emphasis.focus??(e.emphasis.focus=`adjacency`))}function wS(e,t){if(e)for(var n=0;n<e.length;n++)t(e[n]),e[n]&&wS(e[n].children,t)}function TS(e,t){gS(e,t),e.series=cu(e.series),L(e.series,function(e){if(H(e)){var t=e.type;if(t===`line`)e.clipOverflow!=null&&(e.clip=e.clipOverflow);else if(t===`pie`||t===`gauge`){e.clockWise!=null&&(e.clockwise=e.clockWise),xS(e.label);var n=e.data;if(n&&!Ka(n))for(var r=0;r<n.length;r++)xS(n[r]);e.hoverOffset!=null&&(e.emphasis=e.emphasis||{},(e.emphasis.scaleSize=null)&&(e.emphasis.scaleSize=e.hoverOffset))}else if(t===`gauge`){var i=_S(e,`pointer.color`);i!=null&&vS(e,`itemStyle.color`,i)}else if(t===`bar`){bS(e),bS(e.backgroundStyle),bS(e.emphasis);var n=e.data;if(n&&!Ka(n))for(var r=0;r<n.length;r++)typeof n[r]==`object`&&(bS(n[r]),bS(n[r]&&n[r].emphasis))}else if(t===`sunburst`){var a=e.highlightPolicy;a&&(e.emphasis=e.emphasis||{},e.emphasis.focus||(e.emphasis.focus=a)),SS(e),wS(e.data,SS)}else t===`graph`||t===`sankey`?CS(e):t===`map`&&(e.mapType&&!e.map&&(e.map=e.mapType),e.mapLocation&&Ma(e,e.mapLocation));e.hoverAnimation!=null&&(e.emphasis=e.emphasis||{},e.emphasis&&e.emphasis.scale==null&&(e.emphasis.scale=e.hoverAnimation)),yS(e)}}),e.dataRange&&(e.visualMap=e.dataRange),L(vK,function(t){var n=e[t];n&&(z(n)||(n=[n]),L(n,function(e){yS(e)}))})}function ES(e){var t=W();e.eachSeries(function(e){var n=e.get(`stack`);if(n){var r=t.get(n)||t.set(n,[]),i=e.getData(),a={stackResultDimension:i.getCalculationInfo(`stackResultDimension`),stackedOverDimension:i.getCalculationInfo(`stackedOverDimension`),stackedDimension:i.getCalculationInfo(`stackedDimension`),stackedByDimension:i.getCalculationInfo(`stackedByDimension`),isStackedByIndex:i.getCalculationInfo(`isStackedByIndex`),data:i,seriesModel:e};if(!a.stackedDimension||!(a.isStackedByIndex||a.stackedByDimension))return;r.push(a)}}),t.each(function(e){e.length!==0&&((e[0].seriesModel.get(`stackOrder`)||`seriesAsc`)===`seriesDesc`&&e.reverse(),L(e,function(t,n){t.data.setCalculationInfo(`stackedOnSeries`,n>0?e[n-1].seriesModel:null)}),DS(e))})}function DS(e){L(e,function(t,n){var r=[],i=[NaN,NaN],a=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,c=t.seriesModel.get(`stackStrategy`)||`samesign`;o.modify(a,function(a,l,u){var d=o.get(t.stackedDimension,u);if(isNaN(d))return i;var f,p;s?p=o.getRawIndex(u):f=o.get(t.stackedByDimension,u);for(var m=NaN,h=n-1;h>=0;h--){var g=e[h];if(s||(p=g.data.rawIndexOf(g.stackedByDimension,f)),p>=0){var _=g.data.getByRawIndex(g.stackResultDimension,p);if(c===`all`||c===`positive`&&_>0||c===`negative`&&_<0||c===`samesign`&&d>=0&&_>0||c===`samesign`&&d<=0&&_<0){d=Wl(d,_),m=_;break}}}return r[0]=d,r[1]=m,r})})}function OS(e,t){return e.visualStyleMapper||CK[t]||(console.warn(`Unknown style type '`+t+`'.`),CK.itemStyle)}function kS(e,t){return e.visualDrawType||wK[t]||(console.warn(`Unknown style type '`+t+`'.`),`fill`)}function AS(e,t){t||={},Ma(t,{text:`loading`,textColor:X.color.primary,fontSize:12,fontWeight:`normal`,fontStyle:`normal`,fontFamily:`sans-serif`,maskColor:`rgba(255,255,255,0.8)`,showSpinner:!0,color:X.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Sz,r=new rR({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});n.add(r);var i=new cR({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new rR({style:{fill:`none`},textContent:i,textConfig:{position:`right`,distance:10},zlevel:t.zlevel,z:10001});n.add(a);var o;return t.showSpinner&&(o=new $z({shape:{startAngle:-kK/2,endAngle:-kK/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:`round`,lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:kK*3/2}).start(`circularInOut`),o.animateShape(!0).when(1e3,{startAngle:kK*3/2}).delay(300).start(`circularInOut`),n.add(o)),n.resize=function(){var n=i.getBoundingRect().width,s=t.showSpinner?t.spinnerRadius:0,c=(e.getWidth()-s*2-(t.showSpinner&&n?10:0)-n)/2-(t.showSpinner&&n?0:5+n/2)+(t.showSpinner?0:n/2)+(n?0:s),l=e.getHeight()/2;t.showSpinner&&o.setShape({cx:c,cy:l}),a.setShape({x:c-s,y:l-s,width:s*2,height:s*2}),r.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},n.resize(),n}function jS(e){e.overallReset(e.ecModel,e.api,e.payload)}function MS(e){return e.dirtyOnOverallProgress&&NS}function NS(){this.agent.dirty(),this.getDownstream().dirty()}function PS(){this.agent&&this.agent.dirty()}function FS(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function IS(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=cu(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?R(t,function(e,t){return LS(t)}):jK}function LS(e){return function(t,n){var r=n.data,i=n.resetDefines[e];if(i&&i.dataEach)for(var a=t.start;a<t.end;a++)i.dataEach(r,a);else i&&i.progress&&i.progress(t,r)}}function RS(e){return e.data.count()}function zS(e){PK=null;try{e(MK,NK)}catch{}return PK}function BS(e,t){for(var n in t.prototype)e[n]=co}function VS(e,t,n){switch(n){case`color`:return e.getItemVisual(t,`style`)[e.getVisual(`drawType`)];case`opacity`:return e.getItemVisual(t,`style`).opacity;case`symbol`:case`symbolSize`:case`liftZ`:return e.getItemVisual(t,n)}}function HS(e,t){switch(t){case`color`:return e.getVisual(`style`)[e.getVisual(`drawType`)];case`opacity`:return e.getVisual(`style`).opacity;case`symbol`:case`symbolSize`:case`liftZ`:return e.getVisual(t)}}function US(e,t,n,r){switch(n){case`color`:var i=e.ensureUniqueItemVisual(t,`style`);i[e.getVisual(`drawType`)]=r,e.setItemVisual(t,`colorFromPalette`,!1);break;case`opacity`:e.ensureUniqueItemVisual(t,`style`).opacity=r;break;case`symbol`:case`symbolSize`:case`liftZ`:e.setItemVisual(t,n,r)}}function WS(e,t,n){for(var r;e&&!(t(e)&&(r=e,n));)e=e.__hostTarget||e.parent;return r}function GS(e,t){GK[e]=t}function KS(e){return GK[e]}function qS(e,t){KK[e]=t}function JS(e){return isFinite(e)}function YS(e,t,n){var r=t.x==null?0:t.x,i=t.x2==null?1:t.x2,a=t.y==null?0:t.y,o=t.y2==null?0:t.y2;return t.global||(r=r*n.width+n.x,i=i*n.width+n.x,a=a*n.height+n.y,o=o*n.height+n.y),r=JS(r)?r:0,i=JS(i)?i:1,a=JS(a)?a:0,o=JS(o)?o:0,e.createLinearGradient(r,a,i,o)}function XS(e,t,n){var r=n.width,i=n.height,a=Math.min(r,i),o=t.x==null?.5:t.x,s=t.y==null?.5:t.y,c=t.r==null?.5:t.r;return t.global||(o=o*r+n.x,s=s*i+n.y,c*=a),o=JS(o)?o:.5,s=JS(s)?s:.5,c=c>=0&&JS(c)?c:.5,e.createRadialGradient(o,s,0,o,s,c)}function ZS(e,t,n){for(var r=t.type===`radial`?XS(e,t,n):YS(e,t,n),i=t.colorStops,a=0;a<i.length;a++)r.addColorStop(i[a].offset,i[a].color);return r}function QS(e,t){if(e===t||!e&&!t)return!1;if(!e||!t||e.length!==t.length)return!0;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!0;return!1}function $S(e){return parseInt(e,10)}function eC(e,t,n){var r=[`width`,`height`][t],i=[`clientWidth`,`clientHeight`][t],a=[`paddingLeft`,`paddingTop`][t],o=[`paddingRight`,`paddingBottom`][t];if(n[r]!=null&&n[r]!==`auto`)return parseFloat(n[r]);var s=document.defaultView.getComputedStyle(e);return(e[i]||$S(s[r])||$S(e.style[r]))-($S(s[a])||0)-($S(s[o])||0)||0}function tC(e,t){return!e||e===`solid`||!(t>0)?null:e===`dashed`?[4*t,2*t]:e===`dotted`?[t]:Wa(e)?[e]:z(e)?e:null}function nC(e){var t=e.style,n=t.lineDash&&t.lineWidth>0&&tC(t.lineDash,t.lineWidth),r=t.lineDashOffset;if(n){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(n=R(n,function(e){return e/i}),r/=i)}return[n,r]}function rC(e){var t=e.stroke;return!(t==null||t===`none`||!(e.lineWidth>0))}function iC(e){return typeof e==`string`&&e!==`none`}function aC(e){var t=e.fill;return t!=null&&t!==`none`}function oC(e,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function sC(e,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function cC(e,t,n){var r=Co(t.image,t.__image,n);if(To(r)){var i=e.createPattern(r,t.repeat||`repeat`);if(typeof DOMMatrix==`function`&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*lF),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function lC(e,t,n,r,i){var a,o=rC(n),s=aC(n),c=n.strokePercent,l=c<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var d=t.path||XK,f=t.__dirty;if(!r){var p=n.fill,m=n.stroke,h=s&&!!p.colorStops,g=o&&!!m.colorStops,_=s&&!!p.image,v=o&&!!m.image,y=void 0,b=void 0,x=void 0,S=void 0,C=void 0;(h||g)&&(C=t.getBoundingRect()),h&&(y=f?ZS(e,p,C):t.__canvasFillGradient,t.__canvasFillGradient=y),g&&(b=f?ZS(e,m,C):t.__canvasStrokeGradient,t.__canvasStrokeGradient=b),_&&(x=f||!t.__canvasFillPattern?cC(e,p,t):t.__canvasFillPattern,t.__canvasFillPattern=x),v&&(S=f||!t.__canvasStrokePattern?cC(e,m,t):t.__canvasStrokePattern,t.__canvasStrokePattern=S),h?e.fillStyle=y:_&&(x?e.fillStyle=x:s=!1),g?e.strokeStyle=b:v&&(S?e.strokeStyle=S:o=!1)}var w=t.getGlobalScale();d.setScale(w[0],w[1],t.segmentIgnoreThreshold);var T,E;e.setLineDash&&n.lineDash&&(a=nC(t),T=a[0],E=a[1]);var D=!0;(u||f&4)&&(d.setDPR(e.dpr),l?d.setContext(null):(d.setContext(e),D=!1),d.reset(),t.buildPath(d,t.shape,r),d.toStatic(),t.pathUpdated()),D&&d.rebuildPath(e,l?c:1),T&&(e.setLineDash(T),e.lineDashOffset=E),r?(i.batchFill=s,i.batchStroke=o):n.strokeFirst?(o&&sC(e,n),s&&oC(e,n)):(s&&oC(e,n),o&&sC(e,n)),T&&e.setLineDash([])}function uC(e,t,n){var r=t.__image=Co(n.image,t.__image,t,t.onload);if(r&&To(r)){var i=n.x||0,a=n.y||0,o=t.getWidth(),s=t.getHeight(),c=r.width/r.height;if(o==null&&s!=null?o=s*c:s==null&&o!=null?s=o/c:o==null&&s==null&&(o=r.width,s=r.height),n.sWidth&&n.sHeight){var l=n.sx||0,u=n.sy||0;e.drawImage(r,l,u,n.sWidth,n.sHeight,i,a,o,s)}else if(n.sx&&n.sy){var l=n.sx,u=n.sy,d=o-l,f=s-u;e.drawImage(r,l,u,d,f,i,a,o,s)}else e.drawImage(r,i,a,o,s)}}function dC(e,t,n){var r,i=n.text;if(i!=null&&(i+=``),i){e.font=n.font||`12px sans-serif`,e.textAlign=n.textAlign,e.textBaseline=n.textBaseline;var a=void 0,o=void 0;e.setLineDash&&n.lineDash&&(r=nC(t),a=r[0],o=r[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),n.strokeFirst?(rC(n)&&e.strokeText(i,n.x,n.y),aC(n)&&e.fillText(i,n.x,n.y)):(aC(n)&&e.fillText(i,n.x,n.y),rC(n)&&e.strokeText(i,n.x,n.y)),a&&e.setLineDash([])}}function fC(e,t,n,r,i){var a=!1;if(!r&&(n||={},t===n))return!1;if(r||t.opacity!==n.opacity){yC(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?iL.opacity:o}(r||t.blend!==n.blend)&&(a||=(yC(e,i),!0),e.globalCompositeOperation=t.blend||iL.blend);for(var s=0;s<ZK.length;s++){var c=ZK[s];(r||t[c]!==n[c])&&(a||=(yC(e,i),!0),e[c]=e.dpr*(t[c]||0))}return(r||t.shadowColor!==n.shadowColor)&&(a||=(yC(e,i),!0),e.shadowColor=t.shadowColor||iL.shadowColor),a}function pC(e,t,n,r,i){var a=t.style,o=r?null:n&&n.style||{};if(a===o)return!1;var s=fC(e,a,o,r,i);if((r||a.fill!==o.fill)&&(s||=(yC(e,i),!0),iC(a.fill)&&(e.fillStyle=a.fill)),(r||a.stroke!==o.stroke)&&(s||=(yC(e,i),!0),iC(a.stroke)&&(e.strokeStyle=a.stroke)),(r||a.opacity!==o.opacity)&&(s||=(yC(e,i),!0),e.globalAlpha=a.opacity==null?1:a.opacity),t.hasStroke()){var c=a.lineWidth/(a.strokeNoScale&&t.getLineScale?t.getLineScale():1);e.lineWidth!==c&&(s||=(yC(e,i),!0),e.lineWidth=c)}for(var l=0;l<QK.length;l++){var u=QK[l],d=u[0];(r||a[d]!==o[d])&&(s||=(yC(e,i),!0),e[d]=a[d]||u[1])}return s}function mC(e,t,n,r,i){return fC(e,t.style,n&&n.style,r,i)}function hC(e,t){var n=t.transform,r=e.dpr||1;n?e.setTransform(r*n[0],r*n[1],r*n[2],r*n[3],r*n[4],r*n[5]):e.setTransform(r,0,0,r,0,0)}function gC(e,t,n){for(var r=!1,i=0;i<e.length;i++){var a=e[i];r||=a.isZeroArea(),hC(t,a),t.beginPath(),a.buildPath(t,a.shape),t.clip()}n.allClipped=r}function _C(e,t){return e&&t?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&&!t)}function vC(e){var t=aC(e),n=rC(e);return!(e.lineDash||!(+t^n)||t&&typeof e.fill!=`string`||n&&typeof e.stroke!=`string`||e.strokePercent<1||e.strokeOpacity<1||e.fillOpacity<1)}function yC(e,t){t.batchFill&&(t.batchFill=!1,e.fill()),t.batchStroke&&(t.batchStroke=!1,e.stroke())}function bC(e,t){var n={inHover:!1,viewWidth:0,viewHeight:0,beforeBrushParam:{}};xC(e,t,n),SC(e,n)}function xC(e,t,n){var r=t.transform;if(!t.shouldBePainted(n.viewWidth,n.viewHeight,!1,!1))t.__dirty&=-2,t.__isRendered=!1;else{var i=t.__clipPaths,a=n.prevElClipPaths,o=t.style,s=!1,c=!1;if((!a||QS(i,a))&&(a&&(yC(e,n),e.restore(),c=s=!0,n.prevElClipPaths=null,n.allClipped=!1,n.prevEl=null),i&&i.length&&(yC(e,n),e.save(),gC(i,e,n),s=!0,n.prevElClipPaths=i)),n.allClipped)t.__dirty&=-2,t.__isRendered=!1;else{t.beforeBrush&&t.beforeBrush(n.beforeBrushParam),t.innerBeforeBrush();var l=n.prevEl;l||(c=s=!0);var u=t instanceof JL&&t.autoBatch&&vC(o);s||_C(r,l.transform)?(yC(e,n),hC(e,t)):u||yC(e,n),t instanceof JL?(n.lastDrawType!==$K&&(c=!0,n.lastDrawType=$K),pC(e,t,l,c,n),u&&(n.batchFill||n.batchStroke)||e.beginPath(),lC(e,t,o,u,n)):t instanceof XL?(n.lastDrawType!==tq&&(c=!0,n.lastDrawType=tq),pC(e,t,l,c,n),dC(e,t,o)):t instanceof $L?(n.lastDrawType!==eq&&(c=!0,n.lastDrawType=eq),mC(e,t,l,c,n),uC(e,t,o)):t.getTemporalDisplayables&&(n.lastDrawType!==nq&&(c=!0,n.lastDrawType=nq),CC(e,t,n)),t.innerAfterBrush(),t.afterBrush&&(u&&yC(e,n),t.afterBrush()),n.prevEl=t,t.__dirty=0,t.__isRendered=!0}}}function SC(e,t){yC(e,t),t.prevElClipPaths&&e.restore()}function CC(e,t,n){var r=t.getDisplayables(),i=t.getTemporalDisplayables();e.save();for(var a={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:n.viewWidth,viewHeight:n.viewHeight,inHover:n.inHover,beforeBrushParam:{}},o=t.getCursor(),s=r.length;o<s;o++){var c=r[o];c.beforeBrush&&c.beforeBrush(n.beforeBrushParam),c.innerBeforeBrush(),xC(e,c,a),c.innerAfterBrush(),c.afterBrush&&c.afterBrush(),a.prevEl=c}SC(e,a);for(var l=0,u=i.length;l<u;l++){var c=i[l];c.beforeBrush&&c.beforeBrush(n.beforeBrushParam),c.innerBeforeBrush(),xC(e,c,a),c.innerAfterBrush(),c.afterBrush&&c.afterBrush(),a.prevEl=c}SC(e,a),t.clearTemporalDisplayables(),t.notClear=!0,e.restore()}function wC(e,t){if(e===`none`)return null;var n=t.getDevicePixelRatio(),r=t.getZr(),i=r.painter.type===`svg`;e.dirty&&rq.delete(e);var a=rq.get(e);if(a)return a;var o=Ma(e,{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 c(s),s.rotation=o.rotation,s.scaleX=s.scaleY=i?1:1/n,rq.set(e,s),e.dirty=!1,s;function c(e){for(var t=[n],a=!0,s=0;s<aq.length;++s){var c=o[aq[s]];if(c!=null&&!z(c)&&!V(c)&&!Wa(c)&&typeof c!=`boolean`){a=!1;break}t.push(c)}var l;if(a){l=t.join(`,`)+(i?`-svg`:``);var u=iq.get(l);u&&(i?e.svgElement=u:e.image=u)}var d=EC(o.dashArrayX),f=DC(o.dashArrayY),p=TC(o.symbol),m=OC(d),h=kC(f),g=!i&&GP.createCanvas(),_=i&&{tag:`g`,attrs:{},key:`dcl`,children:[]},v=b(),y;g&&(g.width=v.width*n,g.height=v.height*n,y=g.getContext(`2d`)),x(),a&&iq.put(l,g||_),e.image=g,e.svgElement=_,e.svgWidth=v.width,e.svgHeight=v.height;function b(){for(var e=1,t=0,n=m.length;t<n;++t)e=nu(e,m[t]);for(var r=1,t=0,n=p.length;t<n;++t)r=nu(r,p[t].length);e*=r;var i=h*m.length*p.length;return{width:Math.max(1,Math.min(e,o.maxTileWidth)),height:Math.max(1,Math.min(i,o.maxTileHeight))}}function x(){y&&(y.clearRect(0,0,g.width,g.height),o.backgroundColor&&(y.fillStyle=o.backgroundColor,y.fillRect(0,0,g.width,g.height)));for(var e=0,t=0;t<f.length;++t)e+=f[t];if(e<=0)return;for(var a=-h,s=0,c=0,l=0;a<v.height;){if(s%2==0){for(var u=c/2%p.length,m=0,b=0,x=0;m<v.width*2;){for(var S=0,t=0;t<d[l].length;++t)S+=d[l][t];if(S<=0)break;if(b%2==0){var C=(1-o.symbolSize)*.5,w=m+d[l][b]*C,T=a+f[s]*C,E=d[l][b]*o.symbolSize,D=f[s]*o.symbolSize,O=x/2%p[u].length;k(w,T,E,D,p[u][O])}m+=d[l][b],++x,++b,b===d[l].length&&(b=0)}++l,l===d.length&&(l=0)}a+=f[s],++c,++s,s===f.length&&(s=0)}function k(e,t,a,s,c){var l=i?1:n,u=xg(c,e*l,t*l,a*l,s*l,o.color,o.symbolKeepAspect);if(i){var d=r.painter.renderOneToVNode(u);d&&_.children.push(d)}else bC(y,u)}}}}function TC(e){if(!e||e.length===0)return[[`rect`]];if(V(e))return[[e]];for(var t=!0,n=0;n<e.length;++n)if(!V(e[n])){t=!1;break}if(t)return TC([e]);for(var r=[],n=0;n<e.length;++n)V(e[n])?r.push([e[n]]):r.push(e[n]);return r}function EC(e){if(!e||e.length===0)return[[0,0]];if(Wa(e)){var t=Math.ceil(e);return[[t,t]]}for(var n=!0,r=0;r<e.length;++r)if(!Wa(e[r])){n=!1;break}if(n)return EC([e]);for(var i=[],r=0;r<e.length;++r)if(Wa(e[r])){var t=Math.ceil(e[r]);i.push([t,t])}else{var t=R(e[r],function(e){return Math.ceil(e)});t.length%2==1?i.push(t.concat(t)):i.push(t)}return i}function DC(e){if(!e||typeof e==`object`&&e.length===0)return[0,0];if(Wa(e)){var t=Math.ceil(e);return[t,t]}var n=R(e,function(e){return Math.ceil(e)});return e.length%2?n.concat(n):n}function OC(e){return R(e,function(e){return kC(e)})}function kC(e){for(var t=0,n=0;n<e.length;++n)t+=e[n];return e.length%2==1?t*2:t}function AC(e,t){e.eachRawSeries(function(n){if(!e.isSeriesFiltered(n)){var r=n.getData();r.hasItemVisual()&&r.each(function(e){var n=r.getItemVisual(e,`decal`);if(n){var i=r.ensureUniqueItemVisual(e,`style`);i.decal=wC(n,t)}});var i=r.getVisual(`decal`);if(i){var a=r.getVisual(`style`);a.decal=wC(i,t)}}})}function jC(e){return function(){var t=[...arguments];if(this.isDisposed())this.id;else return NC(this,e,t)}}function MC(e){return function(){var t=[...arguments];return NC(this,e,t)}}function NC(e,t,n){return n[0]=n[0]&&n[0].toLowerCase(),UI.prototype[t].apply(e,n)}function PC(e,t,n){var r=!(n&&n.ssr);if(r){var i=FC(e);if(i)return i}var a=new tJ(e,t,n);return a.id=`ec_`+mJ++,fJ[a.id]=a,r&&Mu(e,hJ,a.id),Zq(a),WK.trigger(`afterinit`,a),a}function FC(e){return fJ[Nu(e,hJ)]}function IC(e,t){uJ[e]=t}function LC(e){Na(cJ,e)<0&&cJ.push(e)}function RC(e,t){KC(sJ,e,t,fq)}function zC(e){VC(`afterinit`,e)}function BC(e){VC(`afterupdate`,e)}function VC(e,t){WK.on(e,t)}function HC(e,t,n){var r,i,a,o,s;B(t)&&(n=t,t=``),H(e)?(r=e.type,i=e.event,o=e.update,s=e.publishNonRefinedEvent,n||=e.action,a=e.refineEvent):(r=e,i=t);function c(e){return e.toLowerCase()}i=c(i||r);var l=a?c(r):i;iJ[r]||(to(kq.test(r)&&kq.test(i)),a&&to(i!==r),iJ[r]={actionType:r,refinedEventType:i,nonRefinedEventType:l,update:o,action:n,refineEvent:a},oJ[i]=1,a&&s&&(oJ[l]=1),aJ[l]=r)}function UC(e,t){RV.register(e,t)}function WC(e,t){KC(lJ,e,t,mq,`layout`,!0)}function GC(e,t){KC(lJ,e,t,_q,`visual`,!0)}function KC(e,t,n,r,i,a){if((B(t)||H(t))&&(n=t,t=r),!(Na(gJ,n)>=0)){gJ.push(n);var o=AK.wrapStageHandler(n,i);o.__prio=t,o.__raw=n,e.push(o)}}function qC(e,t){dJ[e]=t}function JC(e,t,n){var r=KS(`registerMap`);r&&r(e,t,n)}function YC(e,t,n,r){return{eventContent:{selected:cee(n),isFromClick:t.isFromClick||!1}}}function XC(e){z(e)?L(e,function(e){XC(e)}):Na(vJ,e)>=0||(vJ.push(e),B(e)&&(e={install:e}),e.install(yJ))}function ZC(e){return{clipShape:Jg(e)}}function QC(e,t,n,r){L(OU,function(i,a){var o=Aa(Aa({},jJ[a],!0),r,!0),s=function(e){F(n,e);function n(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t+`Axis.`+a,n}return n.prototype.mergeDefaultAndTheme=function(e,t){var n=Th(this),r=n?Dh(e):{};Aa(e,t.getTheme().get(a+`Axis`)),Aa(e,this.getDefaultOption()),e.type=$C(e),n&&Eh(e,r,n)},n.prototype.optionUpdated=function(){this.option.type===`category`&&(this.__ordinalMeta=fU.createByAxisModel(this))},n.prototype.getCategories=function(e){var t=this.option;if(t.type===`category`)return e?t.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.prototype.updateAxisBreaks=function(e){var t=fy();return t?t.updateModelAxisBreak(this,e):{breaks:[]}},n.type=t+`Axis.`+a,n.defaultOption=o,n}(n);e.registerComponentModel(s)}),e.registerSubTypeDefaulter(t+`Axis`,$C)}function $C(e){return e.type||(e.data?`category`:`value`)}function ew(e){return(e.type===`interval`||e.type===`time`)&&!Rm(e)}function tw(e,t){var n=e.scale,r=e.model,i=Xy(n,r,r.ecModel,e,null),a=p_(n),o=p_(t)?t.intervalStub:t,s=a?n.intervalStub:n,c=n.base,l=o.getTicks(),u=o.getTicks({expandToNicedExtent:!0}),d=l.length-1,f,p,m;if(d===1)f=p=0,m=1;else if(d===2){var h=gR(l[0].value-l[1].value),g=gR(l[1].value-l[2].value);f=p=0,h===g?m=2:(m=1,h<g?f=h/g:p=g/h)}else{var _=o.getConfig().interval;f=(1-(l[0].value-u[0].value)/_)%1,p=(1-(u[d].value-l[d].value)/_)%1,m=d-+!!f-!!p}var v=i.zoomFixMM,y=v[0]||v[1],b=[i.fixMM[0]||y,i.fixMM[1]||y],x=n.getExtent(),S=s.getExtent(),C=y_(S,b),w,T,E,D,O,k;function A(e){for(var t=50,n=0;n<t&&!e();n++)E=a?E*hR(c,2):h_(E),D=g_(E)}function j(){w=Rl(k-E*f,D)}function M(){T=Rl(O+E*p,D)}function ee(){k=f?Rl(w+E*f,D):w}function te(){O=p?Rl(T-E*p,D):T}if(b[0]&&b[1]){w=C[0],T=C[1],E=(T-w)/(m+f+p);var ne=e.getExtent(),re=gR(ne[1]-ne[0]);D=Hl([T,w],re,.5/m),ee(),te(),ru(D)&&(E=Rl(E,D))}else{var ie=C[1]-C[0];E=a?hR(Jl(ie),1):Xl(ie/m,2),D=g_(E),b[0]?(w=C[0],A(function(){if(ee(),O=Rl(k+E*m,D),M(),T>=C[1])return!0})):b[1]?(T=C[1],A(function(){if(te(),k=Rl(O-E*m,D),j(),w<=C[0])return!0})):A(function(){k=Rl(yR(C[0]/E)*E,D),O=Rl(vR(C[1]/E)*E,D);var e=_R((O-k)/E);if(e<=m){var t=m-e,n=void 0,r=i.incl0||a;if(r&&C[0]===0)n=[0,t];else if(r&&C[1]===0)n=[t,0];else{var o=vR(t/2);n=t%2==0?[o,o]:w+T<C[0]+C[1]?[o,o+1]:[o+1,o]}if(k=Rl(k-E*n[0],D),O=Rl(O+E*n[1],D),j(),M(),w<=C[0]&&T>=C[1])return!0}})}G_(n,b,S,[w,T],x,{interval:E,intervalCount:m,intervalPrecision:D,niceExtent:[k,O]})}function nw(e,t){var n=p_(e),r=n?e.intervalStub:e,i=t.fixMinMax||[],a=n?e.getExtent():null,o=r.getExtent(),s=y_(o,i,t.rawExtentResult);r.setExtent(s[0],s[1]),s=r.getExtent();var c=n?iw(r,t):rw(r,t),l=c.intervalPrecision,u=c.interval,d=t.userInterval;d!=null&&(c.interval=d,c.intervalPrecision=g_(d)),i[0]||(s[0]=Rl(vR(s[0]/u)*u,l)),i[1]||(s[1]=Rl(yR(s[1]/u)*u,l)),d!=null&&(c.niceExtent=s.slice()),G_(e,i,o,s,a,c)}function rw(e,t){var n=x_(t.splitNumber,5),r=s_(e),i=t.minInterval,a=t.maxInterval,o=Xl(r/n,!0);i!=null&&o<i&&(o=i),a!=null&&o>a&&(o=a);var s=g_(o),c=e.getExtent(),l=[Rl(yR(c[0]/o)*o,s),Rl(vR(c[1]/o)*o,s)];return{interval:o,intervalPrecision:s,niceExtent:l}}function iw(e,t){var n=x_(t.splitNumber,10),r=e.getExtent(),i=s_(e),a=hR(Jl(i),1);n/i*a<=.5&&(a*=10);var o=g_(a),s=[Rl(yR(r[0]/a)*a,o),Rl(vR(r[1]/a)*a,o)];return{intervalPrecision:o,interval:a,niceExtent:s}}function aw(e){var t=e.scale,n=e.model,r=n.axis,i=n.ecModel;ow(t,n,r,i,null)}function ow(e,t,n,r,i){var a=Xy(e,t,r,n,i),o=d_(e)||f_(e);sw(e,{splitNumber:t.get(`splitNumber`),fixMinMax:a.fixMM,userInterval:t.get(`interval`),minInterval:o?t.get(`minInterval`):null,maxInterval:o?t.get(`maxInterval`):null,rawExtentResult:a}),n&&r&&Qy(n,e,a,r)}function sw(e,t){FJ[e.type](e,t)}function cw(e,t){return e.getCoordSysModel()===t}function lw(e,t,n,r){n.getAxesOnZeroOf=function(){return a?[a]:[]};var i=e[t],a,o=n.model,s=o.get([`axisLine`,`onZero`]),c=o.get([`axisLine`,`onZeroAxisIndex`]);if(!s)return;if(c!=null)uw(s,i[c])&&(a=i[c]);else for(var l in i)if(so(i,l)&&uw(s,i[l])&&!r[u(i[l])]){a=i[l];break}a&&(r[u(a)]=!0);function u(e){return e.dim+`_`+e.index}}function uw(e,t){if(!t)return!1;var n=t.scale,r=N_(n,0,!1),i=t&&t.type!==`category`&&t.type!==`time`&&r!==3;return i&&e===`auto`&&F_(t)&&(i=!1),i}function dw(e){for(var t=Ba(e),n,r=[],i=t.length-1;i>=0;i--){var a=e[+t[i]];u_(a.scale)&&U_(a.model,a.type,!0)==null&&(a.model.get(`alignTicks`)&&a.model.get(`interval`)==null?r.push(a):n=a)}n||=r.pop(),n&&L(r,function(e){e.__alignTo=n})}function fw(e,t){return Rm(e.scale)||Rm(t.scale)||t.scale.getTicks().length<2}function pw(e,t){var n=e.getExtent(),r=n[0]+n[1];e.toGlobalCoord=e.dim===`x`?function(e){return e+t}:function(e){return r-e+t},e.toLocalCoord=e.dim===`x`?function(e){return e-t}:function(e){return r-e+t}}function mw(e,t){L(e.x,function(e){return hw(e,t.x,t.width)}),L(e.y,function(e){return hw(e,t.y,t.height)})}function hw(e,t,n){var r=[0,n],i=+!!e.inverse;e.setExtent(r[i],r[1-i]),pw(e,t)}function gw(e,t,n,r,i,a,o){vw(r,i,FU.estimate,t,!1,o);var s=[0,0,0,0];l(0),l(1),u(r,0,NaN),u(r,1,NaN);var c=za(s,function(e){return e>0})==null;return Vf(r,s,!0,!0,n),mw(i,r),c;function l(e){L(i[vB[e]],function(t){if(H_(t.model)){var n=a.ensureRecord(t.model),r=n.labelInfoList;if(r)for(var i=0;i<r.length;i++){var o=r[i],s=t.scale.normalize(K_(t.scale,uW(o.label).labelInfo.tick));s=e===1?1-s:s,u(o.rect,e,s),u(o.rect,1-e,NaN)}var c=n.nameLayout;if(c){var s=V_(n.nameLocation)?.5:NaN;u(c.rect,e,s),u(c.rect,1-e,NaN)}}})}function u(t,n,r){var i=e[vB[n]]-t[vB[n]],a=t[yB[n]]+t[vB[n]]-(e[yB[n]]+e[vB[n]]);i=d(i,1-r),a=d(a,r);var o=IJ[n][0],c=IJ[n][1];s[o]=hR(s[o],i),s[c]=hR(s[c],a)}function d(e,t){return e>0&&!Xa(t)&&t>1e-4&&(e/=t),e}}function _w(e,t,n,r,i){var a=new fW(zJ);return L(n,function(n){return L(n,function(n){if(H_(n.model)){var o=!r;n.axisBuilder=Ly(e,t,n.model,i,a,o)}})}),a}function vw(e,t,n,r,i,a){var o=n===FU.determine;L(t,function(t){return L(t,function(t){H_(t.model)&&(Ry(t.axisBuilder,e,t.model),t.axisBuilder.build(o?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var s={x:0,y:0};c(0),c(1);function c(t){s[vB[1-t]]=e[yB[t]]<=a.refContainer[yB[t]]*.5?0:1-t==1?2:1}L(t,function(e,t){return L(e,function(e){H_(e.model)&&((r===`all`||o)&&e.axisBuilder.build({axisName:!0},{nameMarginLevel:s[t]}),o&&e.axisBuilder.build({axisLine:!0}))})})}function yw(e,t,n){var r,i=e.get(`outerBoundsMode`,!0);i===`same`?r=t.clone():(i==null||i===`auto`)&&(r=xh(e.get(`outerBounds`,!0)||EW,n.refContainer));var a=e.get(`outerBoundsContain`,!0),o=a==null||a===`auto`||Na([`all`,`axisLabel`],a)<0?`all`:a,s=[Fl(U(e.get(`outerBoundsClampWidth`,!0),DW[0]),t.width),Fl(U(e.get(`outerBoundsClampHeight`,!0),DW[1]),t.height)];return{outerBoundsRect:r,parsedOuterBoundsContain:o,outerBoundsClamp:s}}function bw(e,t){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return xw(n,e,t),n.seriesInvolved&&Cw(n,e),n}function xw(e,t,n){var r=t.getComponent(`tooltip`),i=t.getComponent(`axisPointer`),a=i.get(`link`,!0)||[],o=[];L(n.getCoordinateSystems(),function(n){if(!n.axisPointerEnabled)return;var s=Aw(n.model),c=e.coordSysAxesInfo[s]={};e.coordSysMap[s]=n;var l=n.model.getModel(`tooltip`,r);if(L(n.getAxes(),Ha(p,!1,null)),n.getTooltipAxes&&r&&l.get(`show`)){var u=l.get(`trigger`)===`axis`,d=l.get([`axisPointer`,`type`])===`cross`,f=n.getTooltipAxes(l.get([`axisPointer`,`axis`]));(u||d)&&L(f.baseAxes,Ha(p,!d||`cross`,u)),d&&L(f.otherAxes,Ha(p,`cross`,!1))}function p(r,s,u){var d=u.model.getModel(`axisPointer`,i),f=d.get(`show`);if(f&&(f!==`auto`||r||kw(d))){s??=d.get(`triggerTooltip`),d=r?Sw(u,l,i,t,r,s):d;var p=d.get(`snap`),m=d.get(`triggerEmphasis`),h=Aw(u.model),g=s||p||u.type===`category`,_=e.axesInfo[h]={key:h,axis:u,coordSys:n,axisPointerModel:d,triggerTooltip:s,triggerEmphasis:m,involveSeries:g,snap:p,useHandle:kw(d),seriesModels:[],linkGroup:null};c[h]=_,e.seriesInvolved=e.seriesInvolved||g;var v=ww(a,u);if(v!=null){var y=o[v]||(o[v]={axesInfo:{}});y.axesInfo[h]=_,y.mapper=a[v].mapper,_.linkGroup=y}}}})}function Sw(e,t,n,r,i,a){var o=t.getModel(`axisPointer`),s=[`type`,`snap`,`lineStyle`,`shadowStyle`,`label`,`animation`,`animationDurationUpdate`,`animationEasingUpdate`,`z`],c={};L(s,function(e){c[e]=ka(o.get(e))}),c.snap=e.type!==`category`&&!!a,o.get(`type`)===`cross`&&(c.type=`line`);var l=c.label||={};if(l.show??=!1,i===`cross`&&(l.show=o.get([`label`,`show`])??!0,!a)){var u=c.lineStyle=o.get(`crossStyle`);u&&Ma(l,u.textStyle)}return e.model.getModel(`axisPointer`,new HB(c,n,r))}function Cw(e,t){t.eachSeries(function(t){var n=t.coordinateSystem,r=t.get([`tooltip`,`trigger`],!0),i=t.get([`tooltip`,`show`],!0);n&&n.model&&r!==`none`&&r!==!1&&r!==`item`&&i!==!1&&t.get([`axisPointer`,`show`],!0)!==!1&&L(e.coordSysAxesInfo[Aw(n.model)],function(e){var r=e.axis;n.getAxis(r.dim)===r&&(e.seriesModels.push(t),e.seriesDataCount??=0,e.seriesDataCount+=t.getData().count())})})}function ww(e,t){for(var n=t.model,r=t.dim,i=0;i<e.length;i++){var a=e[i]||{};if(Tw(a[r+`AxisId`],n.id)||Tw(a[r+`AxisIndex`],n.componentIndex)||Tw(a[r+`AxisName`],n.name))return i}}function Tw(e,t){return e===`all`||z(e)&&Na(e,t)>=0||e===t}function Ew(e){var t=Dw(e);if(t){var n=t.axisPointerModel,r=t.axis.scale,i=n.option,a=n.get(`status`),o=n.get(`value`);o!=null&&(o=r.parse(o));var s=kw(n);a??(i.status=s?`show`:`hide`);var c=r.getExtent();(o==null||o>c[1])&&(o=c[1]),o<c[0]&&(o=c[0]),i.value=o,s&&(i.status=t.axis.scale.isBlank()?`hide`:`show`)}}function Dw(e){var t=(e.ecModel.getComponent(`axisPointer`)||{}).coordSysAxesInfo;return t&&t.axesInfo[Aw(e)]}function Ow(e){var t=Dw(e);return t&&t.axisPointerModel}function kw(e){return!!e.get([`handle`,`show`])}function Aw(e){return e.type+`||`+e.id}function jw(e,t,n,r){var i=n.axis;if(!i.scale.isBlank()){var a=n.getModel(`splitArea`),o=a.getModel(`areaStyle`),s=o.get(`color`),c=r.coordinateSystem.getRect(),l=i.getTicksCoords({tickModel:a,breakTicks:`none`,pruneByBreak:`preserve_extent_bound`});if(l.length){var u=s.length,d=HJ(e).splitAreaColors,f=W(),p=0;if(d)for(var m=0;m<l.length;m++){var h=d.get(l[m].tickValue);if(h!=null){p=(h+(u-1)*m)%u;break}}var g=i.toGlobalCoord(l[0].coord),_=o.getAreaStyle();s=z(s)?s:[s];for(var m=1;m<l.length;m++){var v=i.toGlobalCoord(l[m].coord),y=void 0,b=void 0,x=void 0,S=void 0;i.isHorizontal()?(y=g,b=c.y,x=v-y,S=c.height,g=y+x):(y=c.x,b=g,x=c.width,S=v-b,g=b+S);var C=l[m-1].tickValue;C!=null&&f.set(C,p),t.add(new rR({anid:C==null?null:`area_`+C,shape:{x:y,y:b,width:x,height:S},style:Ma({fill:s[p]},_),autoBatch:!0,silent:!0})),p=(p+1)%u}HJ(e).splitAreaColors=f}}}function Mw(e){HJ(e).splitAreaColors=null}function Nw(e){e.registerComponentView(JJ),e.registerComponentModel(kW),e.registerCoordinateSystem(`cartesian2d`,LJ),QC(e,`x`,DJ,YJ),QC(e,`y`,DJ,YJ),e.registerComponentView(KJ),e.registerComponentView(qJ),e.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}function Pw(e){XC(Nw),e.registerSeriesModel(bJ),e.registerChartView(TJ),e.registerLayout(uv(`scatter`))}function Fw(e,t){return!!XJ(e)[t]}function Iw(e,t,n){var r=t.getComponentByElement(e.topTarget);if(!r||r===n||ZJ.hasOwnProperty(r.mainType))return!1;var i=r.coordinateSystem;if(!i||i.model===n)return!1;var a=Yf(r),o=Yf(n);return!((a.zlevel-o.zlevel||a.z-o.z)<=0)}function Lw(e){return e.__ecRoamConsumed}function Rw(e){var t=$J(e);return t.roam=t.roam||{},t.uniform=t.uniform||{},t}function zw(e,t,n,r){for(var i=Rw(e).roam,a=i[t]=i[t]||[],o=0;o<a.length;o++){var s=a[o].zInfoParsed;if((s.zlevel-r.zlevel||s.z-r.z||s.z2-r.z2)<=0)break}a.splice(o,0,{listener:n,zInfoParsed:r}),Vw(e,t)}function Bw(e,t,n){for(var r=Rw(e).roam[t]||[],i=0;i<r.length;i++)if(r[i].listener===n){r.splice(i,1),r.length||Hw(e,t);return}}function Vw(e,t){var n=Rw(e);n.uniform[t]||e.on(t,n.uniform[t]=function(e){var r=n.roam[t];if(r)for(var i=0;i<r.length;i++)r[i].listener(e)})}function Hw(e,t){var n=Rw(e).uniform;n[t]&&(e.off(t,n[t]),n[t]=null)}function Uw(e,t,n,r,i){i.isAvailableBehavior=q(Ww,null,n,r),e.trigger(t,i)}function Ww(e,t,n){var r=n[e];return!e||r&&(!V(r)||t.event[r+`Key`])}function Gw(e){return e}function Kw(e,t){return BF(e||RF(),Gw(t).dataRect)}function qw(e,t){return BF(e||RF(),Gw(t).viewRect)}function Jw(e,t,n){return Es(e||Ts(),Gw(t).trans[n])}function Yw(e){return!!(e.dataRect&&e.viewRect)}function Xw(e,t,n,r){r===1?oT(e,t.trans[0],n):Es(e,n)}function Zw(e,t,n){uI(n,rY),ko(rY,rY,t.mtRawInv),ep(e,rY)}function Qw(e,t){var n=Gw(e);n.centerOption=t.getShallow(`center`);var r=n.zoomLimit=t.getShallow(`scaleLimit`);n.zoom=ST(t.getShallow(`zoom`)||1,r)||1,Yw(n)&&tT(n)}function $w(e,t,n,r,i){var a=Gw(e);a.dataRect=new J(t,n,r,i),Yw(a)&&tT(a)}function eT(e,t,n,r,i){var a=Gw(e);a.viewRect=new J(t,n,r,i),Yw(a)&&tT(a)}function tT(e){nT(e),rT(e),iT(e)}function nT(e){var t=e.dataRect,n=e.viewRect,r=e.trans[0],i=e.invertY;i&&(t=BF(aY,t),t.y=-t.y-t.height),VF(iY,t,n),ep(r,iY),i&&(r.scaleY=-r.scaleY);var a=uI(r,e.mtRaw);No(e.mtRawInv,a)}function rT(e){var t=cT(e),n=gT(oY,e,e.centerOption)?qo(oY,oY,e.mtRaw):t,r=e.zoom,i=e.trans[1];i.x=t[0]-r*n[0],i.y=t[1]-r*n[1],i.scaleX=i.scaleY=r}function iT(e){var t=e.trans,n=t[1],r=t[0],i=t[2];oT(i,r,n);var a=uI(i,e.mtOverall),o=No(e.mtOverallInv,a);aT(e,i,a,o),aT(e.lgGeo,i,a,o)}function aT(e,t,n,r){e&&(Es(e,t),Oo(e.transform||=[],n),Oo(e.invTransform||=[],r))}function oT(e,t,n){uI(t,sY),uI(n,cY),ko(cY,cY,sY),ep(e,cY)}function sT(e){var t=e.seriesModel;return t?t.coordinateSystem:null}function cT(e){var t=e.viewRect;return lY[0]=t.x+t.width/2,lY[1]=t.y+t.height/2,lY}function lT(e,t,n,r){var i=Gw(n);i.syncBackEl=e,i.syncBackType=t,r?df(e,Jw(null,n,t),r):(Jw(e,n,t),e.dirty())}function uT(e,t,n,r){var i=Gw(e),a=i.syncBackEl;a?(a.stopAnimation(),Xw(uY,i,a,i.syncBackType)):Es(uY,i.trans[2]),Zw(dY,i,uY),r?mT(uY,dY,i,r):Es(uY,dY),Zw(uY,i,uY),bT(i,t,n,uY)}function dT(e,t,n){var r=fT(t);r&&(uT(r,t,n,e),Qw(r,t))}function fT(e){return e.__ownRoamView?e.__ownRoamView():null}function pT(e,t,n,r){n.setUpdatePayload($f(e));var i=ed(r,t);i&&i.__updateOnOwnRoam&&i.__updateOnOwnRoam(e,t,r)}function mT(e,t,n,r){r.dx!=null&&r.dy!=null&&(e.x+=r.dx,e.y+=r.dy);var i=r.zoom;if(i!=null){var a=hT(t),o=ST(a*i,n.zoomLimit)/a;e.x-=(r.originX-e.x)*(o-1),e.y-=(r.originY-e.y)*(o-1),e.scaleX*=o,e.scaleY*=o}}function hT(e){return e.scaleX}function gT(e,t,n){var r=t.dataRect;if(!n)return!1;var i=t.lgCt;return i?Lo(e,Y(n[0],i.w),Y(n[1],i.h)):r&&Lo(e,Y(n[0],r.width,r.x),Y(n[1],r.height,r.y)),!0}function _T(e,t){var n=e.centerOption,r=e.dataRect;return!n||e.lgCt?t.slice():[vT(0,t,n,r),vT(1,t,n,r)]}function vT(e,t,n,r){return n&&r&&r[yB[e]]&&Il(n[e])?(t[e]-r[vB[e]])/r[yB[e]]*100+`%`:t[e]}function yT(e,t){return t&&e&&e.getShallow(`legacyViewCoordSysCenterBase`)?{w:t.getWidth(),h:t.getHeight()}:null}function bT(e,t,n,r){var i=cT(e),a=hT(r),o=gR(a)>1e-6;fY[0]=o?(i[0]-r.x)/a:i[0],fY[1]=o?(i[1]-r.y)/a:i[1],qo(fY,fY,e.mtRawInv);var s=_T(e,fY);xT(t,s,a),L(n,function(e){e!==t&&xT(e,s.slice(),a)})}function xT(e,t,n){var r=e.option;r.center=t,r.zoom=n}function ST(e,t){if(t){var n=t.min||0,r=t.max||1/0;e=Math.max(Math.min(r,e),n)}return e}function CT(e,t,n,r,i,a,o,s){if(!fT(e)){n.disable();return}n.enable(U(e.get(`roam`),o),{api:t,zInfo:{component:e},triggerInfo:{roamTrigger:e.get(`roamTrigger`),isInSelf:r,isInClip:function(e,t,n){return!i||i.contain(t,n)}}});function c(n){var r=e.mainType,i=$f(Ma({type:ET(r,e.subType,JR)},n));s&&(i.componentType=r),i[r+`Id`]=e.id,t.dispatchAction(i)}n.off(`pan`).off(`zoom`).on(`pan`,function(e){a&&a(`pan`),c({dx:e.dx,dy:e.dy})}).on(`zoom`,function(e){a&&a(`zoom`),c({zoom:e.scale,originX:e.originX,originY:e.originY})})}function wT(e){return function(t,n,r){return pY.copy(e.getBoundingRect()),pY.applyTransform(e.getComputedTransform()),pY.contain(n,r)}}function TT(e,t,n){var r=ET(t,n,JR);e.registerAction({type:r,event:r,update:`none`},function(e,r,i){r.eachComponent(ju(e,t,n),function(t){dT(e,t),pT(e,t,r,i)})})}function ET(e,t,n){return(e===`series`?t===`map`?`geo`:t:e)+n}function DT(e,t,n,r,i,a,o){var s=new tY(null,yT(e.ecModel,t));return $w(s,n,r,i,a),o?eT(s,o.x,o.y,o.width,o.height):eT(s,n,r,i,a),Qw(s,e),s}function OT(e){var t=e.mainData,n=e.datas;n||(n={main:t},e.datasAttr={main:`data`}),e.datas=e.mainData=null,FT(t,n,e),L(n,function(n){L(t.TRANSFERABLE_METHODS,function(t){n.wrapMethod(t,Ha(kT,e))})}),t.wrapMethod(`cloneShallow`,Ha(jT,e)),L(t.CHANGABLE_METHODS,function(n){t.wrapMethod(n,Ha(AT,e))}),to(n[t.dataType]===t)}function kT(e,t){if(PT(this)){var n=I({},mY(this).datas);n[this.dataType]=t,FT(t,n,e)}else IT(t,this.dataType,mY(this).mainData,e);return t}function AT(e,t){return e.struct&&e.struct.update(),t}function jT(e,t){return L(mY(t).datas,function(n,r){n!==t&&IT(n.cloneShallow(),r,t,e)}),t}function MT(e){var t=mY(this).mainData;return e==null||t==null?t:mY(t).datas[e]}function NT(){var e=mY(this).mainData;return e==null?[{data:e}]:R(Ba(mY(e).datas),function(t){return{type:t,data:mY(e).datas[t]}})}function PT(e){return mY(e).mainData===e}function FT(e,t,n){mY(e).datas={},L(t,function(t,r){IT(t,r,e,n)})}function IT(e,t,n,r){mY(n).datas[t]=e,mY(e).mainData=n,e.dataType=t,r.struct&&(e[r.structAttr]=r.struct,r.struct[r.datasAttr[t]]=e),e.getLinkedData=MT,e.getLinkedDataAll=NT}function LT(e,t){var n=t.children;e.parentNode!==t&&(n.push(e),e.parentNode=t)}function RT(e,t,n){if(e&&Na(t,e.type)>=0){var r=n.getData().tree.root,i=e.targetNode;if(V(i)&&(i=r.getNodeById(i)),i&&r.contains(i))return{node:i};var a=e.targetNodeId;if(a!=null&&(i=r.getNodeById(a)))return{node:i}}}function zT(e){for(var t=[];e;)e=e.parentNode,e&&t.push(e);return t.reverse()}function BT(e,t){return Na(zT(e),t)>=0}function VT(e,t){for(var n=[];e;){var r=e.dataIndex;n.push({name:e.name,dataIndex:r,value:t.getRawValue(r)}),e=e.parentNode}return n.reverse(),n}function HT(e){for(var t=0;t<_Y.length;t++)e.registerAction({type:_Y[t],update:`updateView`},co);e.registerAction({type:`treemapRootToNode`,update:`updateView`},function(e,t){t.eachComponent({mainType:`series`,subType:`treemap`,query:e},n);function n(t,n){var r=RT(e,[`treemapZoomToNode`,`treemapRootToNode`],t);if(r){var i=t.getViewRoot();i&&(e.direction=BT(i,r.node)?`rollUp`:`drillDown`),t.resetViewRoot(r.node)}}})}function UT(e){var t=e.getData().tree,n={};t.eachNode(function(t){for(var r=t;r&&r.depth>1;)r=r.parentNode;var i=Ah(e.ecModel,r.name||r.dataIndex+``,n);t.setVisual(`decal`,i)})}function WT(e){var t=0;L(e.children,function(e){WT(e);var n=e.value;z(n)&&(n=n[0]),t+=n});var n=e.value;z(n)&&(n=n[0]),(n==null||isNaN(n))&&(n=t),n<0&&(n=0),z(e.value)?e.value[0]=n:e.value=n}function GT(e,t){var n=cu(t.get(`color`)),r=cu(t.get([`aria`,`decal`,`decals`]));if(n){e||=[];var i,a;L(e,function(e){var t=new HB(e),n=t.get(`color`),r=t.get(`decal`);(t.get([`itemStyle`,`color`])||n&&n!==`none`)&&(i=!0),(t.get([`itemStyle`,`decal`])||r&&r!==`none`)&&(a=!0)});var o=e[0]||(e[0]={});return i||(o.color=n.slice()),!a&&r&&(o.decal=r.slice()),e}}function KT(e,t,n,r,i,a){var o=[[i?e:e-xY,t],[e+n,t],[e+n,t+r],[i?e:e-xY,t+r]];return!a&&o.splice(2,0,[e+n+xY,t+r/2]),!i&&o.push([e,t+r/2]),o}function qT(e,t,n){LR(e).eventData={componentType:`series`,componentSubType:`treemap`,componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:`treemap`,selfType:`breadcrumb`,nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&VT(n,t)}}function JT(){return new CY}function YT(e,t,n,r){var i,a;if(!e.isRemoved()){var o=e.getLayout();i=o.width,a=o.height;var s=e.getModel(),c=s.get(DY),l=s.get(OY)/2,u=aE(s),d=Math.max(c,u),f=c-l,p=d-l;e.setLayout({borderWidth:c,upperHeight:d,upperLabelHeight:u},!0),i=wY(i-2*f,0),a=wY(a-f-p,0);var m=i*a,h=XT(e,s,m,t,n,r);if(h.length){var g={x:f,y:p,width:i,height:a},_=TY(i,a),v=1/0,y=[];y.area=0;for(var b=0,x=h.length;b<x;){var S=h[b];y.push(S),y.area+=S.getLayout().area;var C=eE(y,_,t.squareRatio);C<=v?(b++,v=C):(y.area-=y.pop().getLayout().area,tE(y,_,g,l,!1),_=TY(g.width,g.height),y.length=y.area=0,v=1/0)}if(y.length&&tE(y,_,g,l,!0),!n){var w=s.get(`childrenVisibleMin`);w!=null&&m<w&&(n=!0)}for(var b=0,x=h.length;b<x;b++)YT(h[b],t,n,r+1)}}}function XT(e,t,n,r,i,a){var o=e.children||[],s=r.sort;s!==`asc`&&s!==`desc`&&(s=null);var c=r.leafDepth!=null&&r.leafDepth<=a;if(i&&!c)return e.viewChildren=[];o=Ra(o,function(e){return!e.isRemoved()}),QT(o,s);var l=$T(t,o,s);if(l.sum===0||(l.sum=ZT(t,n,l.sum,s,o),l.sum===0))return e.viewChildren=[];for(var u=0,d=o.length;u<d;u++){var f=o[u].getValue()/l.sum*n;o[u].setLayout({area:f})}return c&&(o.length&&e.setLayout({isLeafRoot:!0},!0),o.length=0),e.viewChildren=o,e.setLayout({dataExtent:l.dataExtent},!0),o}function ZT(e,t,n,r,i){if(!r)return n;for(var a=e.get(`visibleMin`),o=i.length,s=o,c=o-1;c>=0;c--){var l=i[r===`asc`?o-c-1:c].getValue();l/n*t<a&&(s=c,n-=l)}return r===`asc`?i.splice(0,o-s):i.splice(s,o-s),n}function QT(e,t){return t&&e.sort(function(e,n){var r=t===`asc`?e.getValue()-n.getValue():n.getValue()-e.getValue();return r===0?t===`asc`?e.dataIndex-n.dataIndex:n.dataIndex-e.dataIndex:r}),e}function $T(e,t,n){for(var r=0,i=0,a=t.length;i<a;i++)r+=t[i].getValue();var o=e.get(`visualDimension`),s;return!t||!t.length?s=[NaN,NaN]:o===`value`&&n?(s=[t[t.length-1].getValue(),t[0].getValue()],n===`asc`&&s.reverse()):(s=Lu(),EY(t,function(e){var t=e.getValue(o);t<s[0]&&(s[0]=t),t>s[1]&&(s[1]=t)})),{sum:r,dataExtent:s}}function eE(e,t,n){for(var r=0,i=1/0,a=0,o=void 0,s=e.length;a<s;a++)o=e[a].getLayout().area,o&&(o<i&&(i=o),o>r&&(r=o));var c=e.area*e.area,l=t*t*n;return c?wY(l*r/c,c/(l*i)):1/0}function tE(e,t,n,r,i){var a=t===n.width?0:1,o=1-a,s=[`x`,`y`],c=[`width`,`height`],l=n[s[a]],u=t?e.area/t:0;(i||u>n[c[o]])&&(u=n[c[o]]);for(var d=0,f=e.length;d<f;d++){var p=e[d],m={},h=u?p.getLayout().area/u:0,g=m[c[o]]=wY(u-2*r,0),_=n[s[a]]+n[c[a]]-l,v=d===f-1||_<h?_:h,y=m[c[a]]=wY(v-2*r,0);m[s[o]]=n[s[o]]+TY(r,g/2),m[s[a]]=l+TY(r,y/2),l+=v,p.setLayout(m,!0)}n[s[o]]+=u,n[c[o]]-=u}function nE(e,t,n,r){var i=(t||{}).node,a=r.width,o=r.height,s=I({},r);if(!i||i===n)return s;for(var c,l=a*o,u=l*e.option.zoomToNodeRatio;c=i.parentNode;){for(var d=0,f=c.children,p=0,m=f.length;p<m;p++)d+=f[p].getValue();var h=i.getValue();if(h===0)return s;u*=d/h;var g=c.getModel(),_=g.get(DY),v=Math.max(_,aE(g));u+=4*_*_+(3*_+v)*u**.5,u>TR&&(u=TR),i=c}u<l&&(u=l);var y=(u/l)**.5;return{width:a*y,height:o*y}}function rE(e,t,n){if(t)return{x:t.x,y:t.y};var r={x:0,y:0};if(!n)return r;var i=n.node,a=i.getLayout();if(!a)return r;for(var o=[a.width/2,a.height/2],s=i;s;){var c=s.getLayout();o[0]+=c.x,o[1]+=c.y,s=s.parentNode}return{x:e.width/2-o[0],y:e.height/2-o[1]}}function iE(e,t,n,r,i){var a=e.getLayout(),o=n[i],s=o&&o===e;if(!(o&&!s||i===n.length&&e!==r)){e.setLayout({isInView:!0,invisible:!s&&!t.intersect(a),isAboveViewRoot:s},!0);var c=new J(t.x-a.x,t.y-a.y,t.width,t.height);EY(e.viewChildren||[],function(e){iE(e,c,n,r,i+1)})}}function aE(e){return e.get(kY)?e.get(AY):0}function oE(e,t){return t.width/e.width||t.height/e.height||1}function sE(e,t){return ST(e,t.get(`scaleLimit`,!0))}function cE(){return{nodeGroup:[],background:[],content:[]}}function lE(e,t,n,r,i,a,o,s,c,l){if(!o)return;var u=o.getLayout(),d=e.getData(),f=o.getModel();if(d.setItemGraphicEl(o.dataIndex,null),!u||!u.isInView)return;var p=u.width,m=u.height,h=u.borderWidth,g=u.invisible,_=o.getRawIndex(),v=s&&s.getRawIndex(),y=o.viewChildren,b=u.upperHeight,x=y&&y.length,S=f.getModel(`itemStyle`),C=f.getModel([`emphasis`,`itemStyle`]),w=f.getModel([`blur`,`itemStyle`]),T=f.getModel([`select`,`itemStyle`]),E=S.get(`borderRadius`)||0,D=ce(`nodeGroup`,MY);if(!D)return;if(c.add(D),D.x=u.x||0,D.y=u.y||0,D.markRedraw(),HY(D).nodeWidth=p,HY(D).nodeHeight=m,u.isAboveViewRoot)return D;var O=ce(`background`,NY,l,RY);O&&re(D,O,x&&u.upperLabelHeight);var k=f.getModel(`emphasis`),A=k.get(`focus`),j=k.get(`blurScope`),M=k.get(`disabled`),ee=A===`ancestor`?o.getAncestorsIndices():A===`descendant`?o.getDescendantIndices():A;if(x)zd(D)&&Rd(D,!1),O&&(Rd(O,!M),d.setItemGraphicEl(o.dataIndex,O),Id(O,ee,j));else{var te=ce(`content`,NY,l,zY);te&&ie(D,te),O.disableMorphing=!0,O&&zd(O)&&Rd(O,!1),Rd(D,!M),d.setItemGraphicEl(o.dataIndex,D);var ne=f.getShallow(`cursor`);ne&&te.attr(`cursor`,ne),Id(D,ee,j)}return D;function re(t,n,r){var i=LR(n);if(i.dataIndex=o.dataIndex,i.seriesIndex=e.seriesIndex,n.setShape({x:0,y:0,width:p,height:m,r:E}),g)ae(n);else{n.invisible=!1;var a=o.getVisual(`style`),s=a.stroke,c=VY(S);c.fill=s;var l=BY(C);l.fill=C.get(`borderColor`);var u=BY(w);u.fill=w.get(`borderColor`);var d=BY(T);if(d.fill=T.get(`borderColor`),r){var f=p-2*h;oe(n,s,a.opacity,{x:h,y:0,width:f,height:b})}else n.removeTextContent();n.setStyle(c),n.ensureState(`emphasis`).style=l,n.ensureState(`blur`).style=u,n.ensureState(`select`).style=d,_d(n)}t.add(n)}function ie(t,n){var r=LR(n);r.dataIndex=o.dataIndex,r.seriesIndex=e.seriesIndex;var i=Math.max(p-2*h,0),a=Math.max(m-2*h,0);if(n.culling=!0,n.setShape({x:h,y:h,width:i,height:a,r:E}),g)ae(n);else{n.invisible=!1;var s=o.getVisual(`style`),c=s.fill,l=VY(S);l.fill=c,l.decal=s.decal;var u=BY(C),d=BY(w),f=BY(T);oe(n,c,s.opacity,null),n.setStyle(l),n.ensureState(`emphasis`).style=u,n.ensureState(`blur`).style=d,n.ensureState(`select`).style=f,_d(n)}t.add(n)}function ae(e){!e.invisible&&a.push(e)}function oe(t,n,r,i){var a=f.getModel(i?IY:FY),s=xu(f.get(`name`),null),c=a.getShallow(`show`);ip(t,ap(f,i?IY:FY),{defaultText:c?s:null,inheritColor:n,defaultOpacity:r,labelFetcher:e,labelDataIndex:o.dataIndex});var l=t.getTextContent();if(l){var d=l.style,p=eo(d.padding||0);i&&(t.setTextConfig({layoutRect:i}),l.disableLabelLayout=!0),l.beforeUpdate=function(){var e=Math.max((i?i.width:t.shape.width)-p[1]-p[3],0),n=Math.max((i?i.height:t.shape.height)-p[0]-p[2],0);(d.width!==e||d.height!==n)&&l.setStyle({width:e,height:n})},d.truncateMinChar=2,d.lineOverflow=`truncate`,se(d,i,u);var m=l.getState(`emphasis`);se(m?m.style:null,i,u)}}function se(t,n,r){var i=t?t.text:null;if(!n&&r.isLeafRoot&&i!=null){var a=e.get(`drillDownIcon`,!0);t.text=a?a+` `+i:i}}function ce(e,r,a,o){var s=v!=null&&n[e][v],c=i[e];return s?(n[e][v]=null,le(c,s)):g||(s=new r,s instanceof cL&&(s.z2=uE(a,o)),ue(c,s)),t[e][_]=s}function le(e,t){var n=e[_]={};t instanceof MY?(n.oldX=t.x,n.oldY=t.y):n.oldShape=I({},t.shape)}function ue(e,t){var n=e[_]={},a=o.parentNode,s=t instanceof Sz;if(a&&(!r||r.direction===`drillDown`)){var c=0,l=0,u=i.background[a.getRawIndex()];!r&&u&&u.oldShape&&(c=u.oldShape.width,l=u.oldShape.height),s?(n.oldX=0,n.oldY=l):n.oldShape={x:c,y:l,width:0,height:0}}n.fadein=!s}}function uE(e,t){return e*LY+t}function dE(e){var t=e.pieceList;e.hasSpecialVisual=!1,L(t,function(t,n){t.originIndex=n,t.visual!=null&&(e.hasSpecialVisual=!0)})}function fE(e){var t=e.categories,n=e.categoryMap={},r=e.visual;if(WY(t,function(e,t){n[e]=t}),!z(r)){var i=[];H(r)?WY(r,function(e,t){var r=n[t];i[r??KY]=e}):i[KY]=r,r=xE(e,i)}for(var a=t.length-1;a>=0;a--)r[a]??(delete n[t[a]],t.pop())}function pE(e,t){var n=e.visual,r=[];H(n)?WY(n,function(e){r.push(e)}):n!=null&&r.push(n),!t&&r.length===1&&!{color:1,symbol:1}.hasOwnProperty(e.type)&&(r[1]=r[0]),xE(e,r)}function mE(e){return{applyVisual:function(t,n,r){var i=this.mapValueToVisual(t);r(`color`,e(n(`color`),i))},_normalizedToVisual:yE([0,1])}}function hE(e){var t=this.option.visual;return t[Math.round(Nl(e,[0,1],[0,t.length-1],!0))]||{}}function gE(e){return function(t,n,r){r(e,this.mapValueToVisual(t))}}function _E(e){var t=this.option.visual;return t[this.option.loop&&e!==KY?e%t.length:e]}function vE(){return this.option.visual[0]}function yE(e){return{linear:function(t){return Nl(t,e,this.option.visual,!0)},category:_E,piecewise:function(t,n){var r=bE.call(this,n);return r??=Nl(t,e,this.option.visual,!0),r},fixed:vE}}function bE(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var r=n[qY.findPieceIndex(e,n)];if(r&&r.visual)return r.visual[this.type]}}function xE(e,t){return e.visual=t,e.type===`color`&&(e.parsedVisual=R(t,function(e){return ec(e)||[0,0,0,1]})),t}function SE(e,t,n){return e?t<=n:t<n}function CE(e,t,n,r){var i=e.getModel(),a=e.getLayout(),o=e.hostTree.data;if(a&&!a.invisible&&a.isInView){var s=i.getModel(YY),c=wE(s,t,r),l=o.ensureUniqueItemVisual(e.dataIndex,`style`),u=s.get(`borderColor`),d=s.get(`borderColorSaturation`),f;d!=null&&(f=TE(c),u=EE(d,f)),l.stroke=u;var p=e.viewChildren;if(!p||!p.length)f=TE(c),l.fill=f;else{var m=OE(e,i,a,s,c,p);L(p,function(e,t){(e.depth>=n.length||e===n[e.depth])&&CE(e,AE(i,c,e,t,m,r),n,r)})}}}function wE(e,t,n){var r=I({},t),i=n.designatedVisualItemStyle;return L([`color`,`colorAlpha`,`colorSaturation`],function(n){i[n]=t[n];var a=e.get(n);i[n]=null,a!=null&&(r[n]=a)}),r}function TE(e){var t=DE(e,`color`);if(t){var n=DE(e,`colorAlpha`),r=DE(e,`colorSaturation`);return r&&(t=oc(t,null,null,r)),n&&(t=sc(t,n)),t}}function EE(e,t){return t==null?null:oc(t,null,null,e)}function DE(e,t){var n=e[t];if(n!=null&&n!==`none`)return n}function OE(e,t,n,r,i,a){if(a&&a.length){var o=kE(t,`color`)||i.color!=null&&i.color!==`none`&&(kE(t,`colorAlpha`)||kE(t,`colorSaturation`));if(o){var s=t.get(`visualMin`),c=t.get(`visualMax`),l=n.dataExtent.slice();s!=null&&s<l[0]&&(l[0]=s),c!=null&&c>l[1]&&(l[1]=c);var u=t.get(`colorMappingBy`),d={type:o.name,dataExtent:l,visual:o.range};d.type===`color`&&(u===`index`||u===`id`)?(d.mappingMethod=`category`,d.loop=!0):d.mappingMethod=`linear`;var f=new qY(d);return XY(f).drColorMappingBy=u,f}}}function kE(e,t){var n=e.get(t);return z(n)&&n.length?{name:t,range:n}:null}function AE(e,t,n,r,i,a){var o=I({},t);if(i){var s=i.type,c=s===`color`&&XY(i).drColorMappingBy,l=c===`index`?r:c===`id`?a.mapIdToIndex(n.getId()):n.getValue(e.get(`visualDimension`));o[s]=i.mapValueToVisual(l)}return o}function jE(e){e.registerSeriesModel(vY),e.registerChartView(UY),e.registerVisual(ZY),e.registerLayout(jY),HT(e)}function ME(e){return`_EC_`+e}function NE(e,t){return{getValue:function(n){var r=this[e][t];return r.getStore().get(r.getDimensionIndex(n||`value`),this.dataIndex)},setVisual:function(n,r){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,n,r)},getVisual:function(n){return this[e][t].getItemVisual(this.dataIndex,n)},setLayout:function(n,r){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,n,r)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}function PE(e,t,n,r,i){for(var a=new QY(r),o=0;o<e.length;o++)a.addNode(Za(e[o].id,e[o].name,o),o);for(var s=[],c=[],l=0,o=0;o<t.length;o++){var u=t[o],d=u.source,f=u.target;a.addEdge(d,f,l)&&(c.push(u),s.push(Za(xu(u.id,null),d+` > `+f)),l++)}var p=n.get(`coordinateSystem`),m;if(p===`cartesian2d`||p===`polar`||p===`matrix`)m=mm(e,n);else{var h=RV.get(p),g=h&&h.dimensions||[];Na(g,`value`)<0&&g.concat([`value`]);var _=Qp(e,{coordDimensions:g,encodeDefine:n.getEncode()}).dimensions;m=new FV(_,n),m.initData(e)}var v=new FV([`value`],n);return v.initData(c,s),i&&i(m,v),OT({mainData:m,struct:a,structAttr:`graph`,datas:{node:m,edge:v},datasAttr:{node:`data`,edge:`edgeData`}}),a.update(),a}function FE(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}function IE(e){return`_`+e+`Type`}function LE(e,t,n){var r=t.getItemVisual(n,e);if(!r||r===`none`)return r;var i=t.getItemVisual(n,e+`Size`),a=t.getItemVisual(n,e+`Rotate`),o=t.getItemVisual(n,e+`Offset`),s=t.getItemVisual(n,e+`KeepAspect`),c=Sg(i),l=Cg(o||0,c);return r+c+l+(a||``)+(s||``)}function RE(e,t,n){var r=t.getItemVisual(n,e);if(r&&r!==`none`){var i=t.getItemVisual(n,e+`Size`),a=t.getItemVisual(n,e+`Rotate`),o=t.getItemVisual(n,e+`Offset`),s=t.getItemVisual(n,e+`KeepAspect`),c=Sg(i),l=Cg(o||0,c),u=xg(r,-c[0]/2+l[0],-c[1]/2+l[1],c[0],c[1],null,s);return u.__specifiedRotation=a==null||isNaN(a)?void 0:a*Math.PI/180||0,u.name=e,u}}function zE(e){var t=new iX({name:`line`,subPixelOptimize:!0});return BE(t.shape,e),t}function BE(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var n=t[2];n?(e.cpx1=n[0],e.cpy1=n[1]):(e.cpx1=NaN,e.cpy1=NaN)}function VE(e){return e.animators&&e.animators.length>0}function HE(e){var t=e.hostModel,n=t.getModel(`emphasis`);return{lineStyle:t.getModel(`lineStyle`).getLineStyle(),emphasisLineStyle:n.getModel([`lineStyle`]).getLineStyle(),blurLineStyle:t.getModel([`blur`,`lineStyle`]).getLineStyle(),selectLineStyle:t.getModel([`select`,`lineStyle`]).getLineStyle(),emphasisDisabled:n.get(`disabled`),blurScope:n.get(`blurScope`),focus:n.get(`focus`),labelStatesModels:ap(t)}}function UE(e){return isNaN(e[0])||isNaN(e[1])}function WE(e){return e&&!UE(e[0])&&!UE(e[1])}function GE(e,t){var n=e.get(`center`),r=t.getWidth(),i=t.getHeight(),a=Math.min(r,i);return{cx:Y(n[0],t.getWidth()),cy:Y(n[1],t.getHeight()),r:Y(e.get(`radius`),a/2)}}function KE(e,t){var n=e==null?``:e+``;return t&&(V(t)?n=t.replace(`{value}`,n):B(t)&&(n=t(e))),n}function qE(e){e.registerChartView(uX),e.registerSeriesModel(dX)}function JE(e,t){for(var n=e.mapDimension(`value`),r=e.mapArray(n,function(e){return e}),i=[],a=t===`ascending`,o=0,s=e.count();o<s;o++)i[o]=o;return B(t)?i.sort(t):t!==`none`&&i.sort(function(e,t){return a?r[e]-r[t]:r[t]-r[e]}),i}function YE(e){var t=e.hostModel,n=ZE(t);e.each(function(t){var r=e.getItemModel(t),i=r.getModel(`label`).get(`position`),a=r.getModel(`labelLine`),o=e.getItemLayout(t),s=o.points,c=i===`inner`||i===`inside`||i===`center`||i===`insideLeft`||i===`insideRight`,l,u,d,f;if(c)i===`insideLeft`?(u=(s[0][0]+s[3][0])/2+5,d=(s[0][1]+s[3][1])/2,l=`left`):i===`insideRight`?(u=(s[1][0]+s[2][0])/2-5,d=(s[1][1]+s[2][1])/2,l=`right`):(u=(s[0][0]+s[1][0]+s[2][0]+s[3][0])/4,d=(s[0][1]+s[1][1]+s[2][1]+s[3][1])/4,l=`center`),f=[[u,d],[u,d]];else{var p=void 0,m=void 0,h=void 0,g=void 0,_=a.get(`length`);V(i)&&(!n&&Na([`top`,`bottom`],i)>-1&&(i=`left`),n&&Na([`left`,`right`],i)>-1&&(i=`bottom`)),i===`left`?(p=(s[3][0]+s[0][0])/2,m=(s[3][1]+s[0][1])/2,h=p-_,u=h-5,l=`right`):i===`right`?(p=(s[1][0]+s[2][0])/2,m=(s[1][1]+s[2][1])/2,h=p+_,u=h+5,l=`left`):i===`top`?(p=(s[3][0]+s[0][0])/2,m=(s[3][1]+s[0][1])/2,g=m-_,d=g-5,l=`center`):i===`bottom`?(p=(s[1][0]+s[2][0])/2,m=(s[1][1]+s[2][1])/2,g=m+_,d=g+5,l=`center`):i===`rightTop`?(p=n?s[3][0]:s[1][0],m=n?s[3][1]:s[1][1],n?(g=m-_,d=g-5,l=`center`):(h=p+_,u=h+5,l=`top`)):i===`rightBottom`?(p=s[2][0],m=s[2][1],n?(g=m+_,d=g+5,l=`center`):(h=p+_,u=h+5,l=`bottom`)):i===`leftTop`?(p=s[0][0],m=n?s[0][1]:s[1][1],n?(g=m-_,d=g-5,l=`center`):(h=p-_,u=h-5,l=`right`)):i===`leftBottom`?(p=n?s[1][0]:s[3][0],m=n?s[1][1]:s[2][1],n?(g=m+_,d=g+5,l=`center`):(h=p-_,u=h-5,l=`right`)):(p=(s[1][0]+s[2][0])/2,m=(s[1][1]+s[2][1])/2,n?(g=m+_,d=g+5,l=`center`):(h=p+_,u=h+5,l=`left`)),n?(h=p,u=h):(g=m,d=g),f=[[p,m],[h,g]]}o.label={linePoints:f,x:u,y:d,verticalAlign:`middle`,textAlign:l,inside:c}})}function XE(e,t){e.eachSeriesByType(fX,function(e){var n=e.getData(),r=n.mapDimension(`value`),i=e.get(`sort`),a=Sh(e,t),o=xh(e.getBoxLayoutParams(),a.refContainer),s=ZE(e),c=o.width,l=o.height,u=JE(n,i),d=o.x,f=o.y,p=s?[Y(e.get(`minSize`),l),Y(e.get(`maxSize`),l)]:[Y(e.get(`minSize`),c),Y(e.get(`maxSize`),c)],m=n.getDataExtent(r),h=e.get(`min`),g=e.get(`max`);h??=Math.min(m[0],0),g??=m[1];var _=e.get(`funnelAlign`),v=e.get(`gap`),y=((s?c:l)-v*(n.count()-1))/n.count(),b=function(e,t){if(s){var i=Nl(n.get(r,e)||0,[h,g],p,!0),a=void 0;switch(_){case`top`:a=f;break;case`center`:a=f+(l-i)/2;break;case`bottom`:a=f+(l-i)}return[[t,a],[t,a+i]]}var o=Nl(n.get(r,e)||0,[h,g],p,!0),u;switch(_){case`left`:u=d;break;case`center`:u=d+(c-o)/2;break;case`right`:u=d+c-o}return[[u,t],[u+o,t]]};i===`ascending`&&(y=-y,v=-v,s?d+=c:f+=l,u=u.reverse());for(var x=0;x<u.length;x++){var S=u[x],C=u[x+1],w=n.getItemModel(S);if(s){var T=w.get([`itemStyle`,`width`]);T==null?T=y:(T=Y(T,c),i===`ascending`&&(T=-T));var E=b(S,d),D=b(C,d+T);d+=T+v,n.setItemLayout(S,{points:E.concat(D.slice().reverse())})}else{var O=w.get([`itemStyle`,`height`]);O==null?O=y:(O=Y(O,l),i===`ascending`&&(O=-O));var E=b(S,f),D=b(C,f+O);f+=O+v,n.setItemLayout(S,{points:E.concat(D.slice().reverse())})}}YE(n)})}function ZE(e){return e.get(`orient`)===`horizontal`}function QE(e){e.registerChartView(gX),e.registerSeriesModel(pX),e.registerLayout(_X),e.registerProcessor(Bb(fX))}function $E(e,t,n,r,i,a){e||=0;var o=Wl(n[1],-n[0]);if(i!=null&&(i=tD(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),r===`all`){var s=Math.abs(Wl(t[1],-t[0]));s=tD(s,[0,o]),i=a=tD(s,[i,a]),r=0}t[0]=tD(t[0],n),t[1]=tD(t[1],n);var c=eD(t,r);t[r]+=e;var l=i||0,u=n.slice();c.sign<0?u[0]=Wl(u[0],l):u[1]=Wl(u[1],-l),t[r]=tD(t[r],u);var d=eD(t,r);return i!=null&&(d.sign!==c.sign||d.span<i)&&(t[1-r]=Wl(t[r],c.sign*i)),d=eD(t,r),a!=null&&d.span>a&&(t[1-r]=Wl(t[r],d.sign*a)),t}function eD(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function tD(e,t){return Math.min(t[1]==null?1/0:t[1],Math.max(t[0]==null?-1/0:t[0],e))}function nD(e,t,n){switch(e.fill){case`source`:e.fill=n.node1.getVisual(`color`),e.decal=n.node1.getVisual(`style`).decal;break;case`target`:e.fill=n.node2.getVisual(`color`),e.decal=n.node2.getVisual(`style`).decal;break;case`gradient`:var r=n.node1.getVisual(`color`),i=n.node2.getVisual(`color`);V(r)&&V(i)&&(e.fill=new nB(0,0,+(t===`horizontal`),+(t===`vertical`),[{color:r,offset:0},{color:i,offset:1}]))}}function rD(e,t,n){var r=new rR({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return ff(r,{shape:{width:e.width+20}},t,n),r}function iD(e,t){e.eachSeriesByType(vX,function(e){var n=e.get(`nodeWidth`),r=e.get(`nodeGap`),i=Sh(e,t).refContainer,a=xh(e.getBoxLayoutParams(),i);e.layoutInfo=a;var o=a.width,s=a.height,c=e.getGraph(),l=c.nodes,u=c.edges;oD(l),aD(l,u,n,r,o,s,Ra(l,function(e){return e.getLayout().value===0}).length===0?e.get(`layoutIterations`):0,e.get(`orient`),e.get(`nodeAlign`))})}function aD(e,t,n,r,i,a,o,s,c){sD(e,t,n,i,a,s,c),fD(e,t,a,i,r,o,s),TD(e,s)}function oD(e){L(e,function(e){var t=CD(e.outEdges,SD),n=CD(e.inEdges,SD),r=e.getValue()||0,i=Math.max(t,n,r);e.setLayout({value:i},!0)})}function sD(e,t,n,r,i,a,o){for(var s=[],c=[],l=[],u=[],d=0,f=0;f<t.length;f++)s[f]=1;for(var f=0;f<e.length;f++)c[f]=e[f].inEdges.length,c[f]===0&&l.push(e[f]);for(var p=-1;l.length;){for(var m=0;m<l.length;m++){var h=l[m],g=h.hostGraph.data.getRawDataItem(h.dataIndex),_=g.depth!=null&&g.depth>=0;_&&g.depth>p&&(p=g.depth),h.setLayout({depth:_?g.depth:d},!0),a===`vertical`?h.setLayout({dy:n},!0):h.setLayout({dx:n},!0);for(var v=0;v<h.outEdges.length;v++){var y=h.outEdges[v],b=Na(t,y);s[b]=0;var x=y.node2,S=Na(e,x);--c[S]===0&&Na(u,x)<0&&u.push(x)}}++d,l=u,u=[]}for(var f=0;f<s.length;f++)if(s[f]===1)throw Error(`Sankey is a DAG, the original data has cycle!`);var C=p>d-1?p:d-1;o&&o!==`left`&&lD(e,o,a,C),dD(e,a===`vertical`?(i-n)/C:(r-n)/C,a)}function cD(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return t.depth!=null&&t.depth>=0}function lD(e,t,n,r){if(t===`right`){for(var i=[],a=e,o=0;a.length;){for(var s=0;s<a.length;s++){var c=a[s];c.setLayout({skNodeHeight:o},!0);for(var l=0;l<c.inEdges.length;l++){var u=c.inEdges[l];Na(i,u.node1)<0&&i.push(u.node1)}}a=i,i=[],++o}L(e,function(e){cD(e)||e.setLayout({depth:Math.max(0,r-e.getLayout().skNodeHeight)},!0)})}else t===`justify`&&uD(e,r)}function uD(e,t){L(e,function(e){!cD(e)&&!e.outEdges.length&&e.setLayout({depth:t},!0)})}function dD(e,t,n){L(e,function(e){var r=e.getLayout().depth*t;n===`vertical`?e.setLayout({y:r},!0):e.setLayout({x:r},!0)})}function fD(e,t,n,r,i,a,o){var s=pD(e,o);mD(s,t,n,r,i,o),hD(s,i,n,r,o);for(var c=1;a>0;a--)c*=.99,gD(s,c,o),hD(s,i,n,r,o),wD(s,c,o),hD(s,i,n,r,o)}function pD(e,t){var n=[],r=t===`vertical`?`y`:`x`,i=Fu(e,function(e){return e.getLayout()[r]});return zl(i.keys),L(i.keys,function(e){n.push(i.buckets.get(e))}),n}function mD(e,t,n,r,i,a){var o=1/0;L(e,function(e){var t=e.length,s=0;L(e,function(e){s+=e.getLayout().value});var c=a===`vertical`?(r-(t-1)*i)/s:(n-(t-1)*i)/s;c<o&&(o=c)}),L(e,function(e){L(e,function(e,t){var n=e.getLayout().value*o;a===`vertical`?(e.setLayout({x:t},!0),e.setLayout({dx:n},!0)):(e.setLayout({y:t},!0),e.setLayout({dy:n},!0))})}),L(t,function(e){var t=+e.getValue()*o;e.setLayout({dy:t},!0)})}function hD(e,t,n,r,i){var a=i===`vertical`?`x`:`y`;L(e,function(e){e.sort(function(e,t){return e.getLayout()[a]-t.getLayout()[a]});for(var o,s,c,l=0,u=e.length,d=i===`vertical`?`dx`:`dy`,f=0;f<u;f++)s=e[f],c=l-s.getLayout()[a],c>0&&(o=s.getLayout()[a]+c,i===`vertical`?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),l=s.getLayout()[a]+s.getLayout()[d]+t;var p=i===`vertical`?r:n;if(c=l-t-p,c>0){o=s.getLayout()[a]-c,i===`vertical`?s.setLayout({x:o},!0):s.setLayout({y:o},!0),l=o;for(var f=u-2;f>=0;--f)s=e[f],c=s.getLayout()[a]+s.getLayout()[d]+t-l,c>0&&(o=s.getLayout()[a]-c,i===`vertical`?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),l=s.getLayout()[a]}})}function gD(e,t,n){L(e.slice().reverse(),function(e){L(e,function(e){if(e.outEdges.length){var r=CD(e.outEdges,_D,n)/CD(e.outEdges,SD);if(isNaN(r)){var i=e.outEdges.length;r=i?CD(e.outEdges,vD,n)/i:0}if(n===`vertical`){var a=e.getLayout().x+(r-xD(e,n))*t;e.setLayout({x:a},!0)}else{var o=e.getLayout().y+(r-xD(e,n))*t;e.setLayout({y:o},!0)}}})})}function _D(e,t){return xD(e.node2,t)*e.getValue()}function vD(e,t){return xD(e.node2,t)}function yD(e,t){return xD(e.node1,t)*e.getValue()}function bD(e,t){return xD(e.node1,t)}function xD(e,t){return t===`vertical`?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function SD(e){return e.getValue()}function CD(e,t,n){for(var r=0,i=e.length,a=-1;++a<i;){var o=+t(e[a],n);isNaN(o)||(r+=o)}return r}function wD(e,t,n){L(e,function(e){L(e,function(e){if(e.inEdges.length){var r=CD(e.inEdges,yD,n)/CD(e.inEdges,SD);if(isNaN(r)){var i=e.inEdges.length;r=i?CD(e.inEdges,bD,n)/i:0}if(n===`vertical`){var a=e.getLayout().x+(r-xD(e,n))*t;e.setLayout({x:a},!0)}else{var o=e.getLayout().y+(r-xD(e,n))*t;e.setLayout({y:o},!0)}}})})}function TD(e,t){var n=t===`vertical`?`x`:`y`;L(e,function(e){e.outEdges.sort(function(e,t){return e.node2.getLayout()[n]-t.node2.getLayout()[n]}),e.inEdges.sort(function(e,t){return e.node1.getLayout()[n]-t.node1.getLayout()[n]})}),L(e,function(e){var t=0,n=0;L(e.outEdges,function(e){e.setLayout({sy:t},!0),t+=e.getLayout().dy}),L(e.inEdges,function(e){e.setLayout({ty:n},!0),n+=e.getLayout().dy})})}function ED(e){e.eachSeriesByType(vX,function(e){var t=e.getGraph(),n=t.nodes,r=t.edges;if(n.length){var i=1/0,a=-1/0;L(n,function(e){var t=e.getLayout().value;t<i&&(i=t),t>a&&(a=t)}),L(n,function(t){var n=new qY({type:`color`,mappingMethod:`linear`,dataExtent:[i,a],visual:e.get(`color`)}).mapValueToVisual(t.getLayout().value),r=t.getModel().get([`itemStyle`,`color`]);r==null?(t.setVisual(`color`,n),t.setVisual(`style`,{fill:n})):(t.setVisual(`color`,r),t.setVisual(`style`,{fill:r}))})}r.length&&L(r,function(e){var t=e.getModel().get(`lineStyle`);e.setVisual(`style`,t)})})}function DD(e){e.registerChartView(SX),e.registerSeriesModel(yX),e.registerLayout(CX),e.registerVisual(wX),e.registerAction({type:`dragNode`,event:`dragnode`,update:`update`},function(e,t){t.eachComponent({mainType:zR,subType:vX,query:e},function(t){t.setNodePosition(e.dataIndex,[e.localX,e.localY])})}),TT(e,zR,vX)}function OD(e,t,n){var r=e[1]-e[0];t=R(t,function(t){return{interval:[(t.interval[0]-e[0])/r,(t.interval[1]-e[0])/r]}});var i=t.length,a=0;return function(e){for(var r=a;r<i;r++){var o=t[r].interval;if(o[0]<=e&&e<=o[1]){a=r;break}}if(r===i)for(r=a-1;r>=0;r--){var o=t[r].interval;if(o[0]<=e&&e<=o[1]){a=r;break}}return r>=0&&r<i&&n[r]}}function kD(e,t){var n=e[1]-e[0];return t=[(t[0]-e[0])/n,(t[1]-e[0])/n],function(e){return e>=t[0]&&e<=t[1]}}function AD(e){e.registerChartView(DX),e.registerSeriesModel(OX)}function jD(e,t,n,r,i){var a=e+`Animation`,o=lf(e,r,i)||{},s=MX(t).userDuring;return o.duration>0&&(o.during=s?q(zD,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),I(o,n[a]),o}function MD(e,t,n,r){r||={};var i=r.dataIndex,a=r.isInit,o=r.clearStyle,s=n.isAnimationEnabled(),c=MX(e),l=t.style;c.userDuring=t.during;var u={},d={};if(UD(e,t,d),e.type===`compound`)for(var f=e.shape.paths,p=t.shape.paths,m=0;m<p.length;m++){var h=p[m];VD(`shape`,h,f[m])}else VD(`shape`,t,d),VD(`extra`,t,d);if(!a&&s&&(HD(e,t,u),BD(`shape`,e,t,u),BD(`extra`,e,t,u),WD(e,t,l,u)),d.style=l,ID(e,d,o),RD(e,t),s){if(a){var g={};L(jX,function(e){var n=e?t[e]:t;n&&n.enterFrom&&(e&&(g[e]=g[e]||{}),I(e?g[e]:g,n.enterFrom))});var _=jD(`enter`,e,t,n,i);_.duration>0&&e.animateFrom(g,_)}else LD(e,t,i||0,n,u)}ND(e,t),l?e.dirty():e.markRedraw()}function ND(e,t){for(var n=MX(e).leaveToProps,r=0;r<jX.length;r++){var i=jX[r],a=i?t[i]:t;a&&a.leaveTo&&(n||=MX(e).leaveToProps={},i&&(n[i]=n[i]||{}),I(i?n[i]:n,a.leaveTo))}}function PD(e,t,n,r){if(e){var i=e.parent,a=MX(e).leaveToProps;if(a){var o=jD(`update`,e,t,n,0);o.done=function(){i&&i.remove(e),r&&r()},e.animateTo(a,o)}else i&&i.remove(e),r&&r()}}function FD(e){return e===`all`}function ID(e,t,n){var r=t.style;if(!e.isGroup&&r){if(n){e.useStyle({});for(var i=e.animators,a=0;a<i.length;a++){var o=i[a];o.targetName===`style`&&o.changeTarget(e.style)}}e.setStyle(r)}t&&(t.style=null,t&&e.attr(t),t.style=r)}function LD(e,t,n,r,i){if(i){var a=jD(`update`,e,t,r,n);a.duration>0&&e.animateFrom(i,a)}}function RD(e,t){so(t,`silent`)&&(e.silent=t.silent),so(t,`ignore`)&&(e.ignore=t.ignore),e instanceof cL&&so(t,`invisible`)&&(e.invisible=t.invisible),e instanceof JL&&so(t,`autoBatch`)&&(e.autoBatch=t.autoBatch)}function zD(){var e=this,t=e.el;if(t){var n=MX(t).userDuring,r=e.userDuring;n===r?(NX.el=t,r(PX)):e.el=e.userDuring=null}}function BD(e,t,n,r){var i=n[e];if(i){var a=t[e],o;if(a){var s=n.transition,c=i.transition;if(c){if(!o&&(o=r[e]={}),FD(c))I(o,a);else for(var l=cu(c),u=0;u<l.length;u++){var d=l[u],f=a[d];o[d]=f}}else if(FD(s)||Na(s,e)>=0){!o&&(o=r[e]={});for(var p=Ba(a),u=0;u<p.length;u++){var d=p[u],f=a[d];GD(i[d],f)&&(o[d]=f)}}}}}function VD(e,t,n){var r=t[e];if(r)for(var i=n[e]={},a=Ba(r),o=0;o<a.length;o++){var s=a[o];i[s]=Fc(r[s])}}function HD(e,t,n){for(var r=t.transition,i=FD(r)?dI:cu(r||[]),a=0;a<i.length;a++){var o=i[a];o!==`style`&&o!==`shape`&&o!==`extra`&&(n[o]=e[o])}}function UD(e,t,n){for(var r=0;r<AX.length;r++){var i=AX[r],a=kX[i],o=t[i];o&&(n[a[0]]=o[0],n[a[1]]=o[1])}for(var r=0;r<dI.length;r++){var s=dI[r];t[s]!=null&&(n[s]=t[s])}}function WD(e,t,n,r){if(n){var i=e.style,a;if(i){var o=n.transition,s=t.transition;if(o&&!FD(o)){var c=cu(o);!a&&(a=r.style={});for(var l=0;l<c.length;l++){var u=c[l],d=i[u];a[u]=d}}else if(e.getAnimationStyleProps&&(FD(s)||FD(o)||Na(s,`style`)>=0)){var f=e.getAnimationStyleProps(),p=f?f.style:null;if(p){!a&&(a=r.style={});for(var m=Ba(n),l=0;l<m.length;l++){var u=m[l];if(p[u]){var d=i[u];a[u]=d}}}}}}}function GD(e,t){return Ia(e)?e!==t:e!=null&&isFinite(e)}function KD(e){e.stopAnimation(`keyframe`),e.attr(FX(e))}function qD(e,t,n){if(n.isAnimationEnabled()&&t){if(z(t))L(t,function(t){qD(e,t,n)});else{var r=t.keyframes,i=t.duration;if(n&&i==null){var a=lf(`enter`,n,0);i=a&&a.duration}if(r&&i){var o=FX(e);L(jX,function(n){if(!n||e[n]){var a;r.sort(function(e,t){return e.percent-t.percent}),L(r,function(r){var s=e.animators,c=n?r[n]:r;if(c){var l=Ba(c);if(n||(l=Ra(l,function(e){return Na(IX,e)<0})),l.length){a||(a=e.animate(n,t.loop,!0),a.scope=`keyframe`);for(var u=0;u<s.length;u++)s[u]!==a&&s[u].targetName===a.targetName&&s[u].stopTracks(l);n&&(o[n]=o[n]||{});var d=n?o[n]:o;L(l,function(t){d[t]=((n?e[n]:e)||{})[t]}),a.whenWithKeys(i*r.percent,c,l,r.easing)}}}),a&&a.delay(t.delay||0).duration(i).start(t.easing)}})}}}}function JD(e,t,n,r){YD(LX(n).lastProp,r)||(LX(n).lastProp=r,t?df(n,r,e):(n.stopAnimation(),n.attr(r)))}function YD(e,t){if(H(e)&&H(t)){var n=!0;return L(t,function(t,r){n&&=YD(e[r],t)}),!!n}return e===t}function XD(e,t){e[t.get([`label`,`show`])?`show`:`hide`]()}function ZD(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function QD(e,t,n){var r=t.get(`z`),i=t.get(`zlevel`);e&&e.traverse(function(e){e.type!==`group`&&(r!=null&&(e.z=r),i!=null&&(e.zlevel=i),e.silent=n)})}function $D(e){var t=e.get(`type`),n=e.getModel(t+`Style`),r;return t===`line`?(r=n.getLineStyle(),r.fill=null):t===`shadow`&&(r=n.getAreaStyle(),r.stroke=null),r}function eO(e,t,n,r,i){var a=nO(n.get(`value`),t.axis,t.ecModel,n.get(`seriesDataIndices`),{precision:n.get([`label`,`precision`]),formatter:n.get([`label`,`formatter`])}),o=n.getModel(`label`),s=gH(o.get(`padding`)||0),c=o.getFont(),l=rs(a,c),u=i.position,d=l.width+s[1]+s[3],f=l.height+s[0]+s[2],p=i.align;p===`right`&&(u[0]-=d),p===`center`&&(u[0]-=d/2);var m=i.verticalAlign;m===`bottom`&&(u[1]-=f),m===`middle`&&(u[1]-=f/2),tO(u,d,f,r);var h=o.get(`backgroundColor`);h&&h!==`auto`||(h=t.get([`axisLine`,`lineStyle`,`color`])),e.label={x:u[0],y:u[1],style:op(o,{text:a,font:c,fill:o.getTextColor(),padding:s,backgroundColor:h}),z2:10}}function tO(e,t,n,r){var i=r.getWidth(),a=r.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+n,a)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function nO(e,t,n,r,i){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:i.precision}),o=i.formatter;if(o){var s={value:L_(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};L(r,function(e){var t=n.getSeriesByIndex(e.seriesIndex),r=e.dataIndexInside,i=t&&t.getDataParams(r);i&&s.seriesData.push(i)}),V(o)?a=o.replace(`{value}`,a):B(o)&&(a=o(s))}return a}function rO(e,t,n){var r=Eo();return jo(r,r,n.rotation),Ao(r,r,n.position),kf([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],r)}function iO(e,t,n,r,i,a){var o=gW.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=i.get([`label`,`margin`]),eO(t,r,i,a,{position:rO(r.axis,e,n),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function aO(e,t,n){return n||=0,{x1:e[n],y1:e[1-n],x2:t[n],y2:t[1-n]}}function oO(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}}function sO(e,t,n){return Yv(e,{fromStat:{sers:R(t,function(e){return n.getSeriesByIndex(e.seriesIndex)})},min:1}).w}function cO(e,t,n){return[hR(mR(t[0],t[1]),e-n/2),mR(e+n/2,hR(t[0],t[1]))]}function lO(e,t){var n={};return n[t.dim+`AxisIndex`]=t.index,e.getCartesian(n)}function uO(e){return e.dim===`x`?0:1}function dO(e,t,n){if(!dF.node){var r=t.getZr();WX(r).records||(WX(r).records={}),fO(r,t);var i=WX(r).records[e]||(WX(r).records[e]={});i.handler=n}}function fO(e,t){if(WX(e).initialized)return;WX(e).initialized=!0,n(`click`,Ha(hO,`click`)),n(`mousemove`,Ha(hO,`mousemove`)),n(`mousewheel`,Ha(hO,`mousewheel`)),n(`globalout`,mO);function n(n,r){e.on(n,function(n){var i=gO(t);GX(WX(e).records,function(e){e&&r(e,n,i.dispatchAction)}),pO(i.pendings,t)})}}function pO(e,t){var n=e.showTip.length,r=e.hideTip.length,i;n?i=e.showTip[n-1]:r&&(i=e.hideTip[r-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}function mO(e,t,n){e.handler(`leave`,null,n)}function hO(e,t,n,r){t.handler(e,n,r)}function gO(e){var t={showTip:[],hideTip:[]},n=function(r){var i=t[r.type];i?i.push(r):(r.dispatchAction=n,e.dispatchAction(r))};return{dispatchAction:n,pendings:t}}function _O(e,t){if(!dF.node){var n=t.getZr();(WX(n).records||{})[e]&&(WX(n).records[e]=null)}}function vO(e,t){var n=[],r=e.seriesIndex,i;if(r==null||!(i=t.getSeriesByIndex(r)))return{point:[]};var a=i.getData(),o=Eu(a,e);if(o==null||o<0||z(o))return{point:[]};var s=a.getItemGraphicEl(o),c=i.coordinateSystem;if(i.getTooltipPosition)n=i.getTooltipPosition(o)||[];else if(c&&c.dataToPoint){if(e.isStacked){var l=c.getBaseAxis(),u=c.getOtherAxis(l).dim,d=l.dim,f=+(u===`x`||u===`radius`),p=a.mapDimension(d),m=[];m[f]=a.get(p,o),m[1-f]=a.get(a.getCalculationInfo(`stackResultDimension`),o),n=c.dataToPoint(m)||[]}else n=c.dataToPoint(a.getValues(R(c.dimensions,function(e){return a.mapDimension(e)}),o))||[]}else if(s){var h=s.getBoundingRect().clone();h.applyTransform(s.transform),n=[h.x+h.width/2,h.y+h.height/2]}return{point:n,el:s}}function yO(e,t,n){var r=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||q(n.dispatchAction,n),s=t.getComponent(`axisPointer`).coordSysAxesInfo;if(s){kO(i)&&(i=vO({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var c=kO(i),l=a.axesInfo,u=s.axesInfo,d=r===`leave`||kO(i),f={},p={},m={list:[],map:{}},h={showPointer:Ha(SO,p),showTooltip:Ha(CO,m)};L(s.coordSysMap,function(e,t){var n=c||e.containPoint(i);L(s.coordSysAxesInfo[t],function(e,t){var r=e.axis,a=DO(l,e);if(!d&&n&&(!l||a)){var o=a&&a.value;o==null&&!c&&(o=r.pointToData(i)),o!=null&&bO(e,o,h,!1,f)}})});var g={};return L(u,function(e,t){var n=e.linkGroup;n&&!p[t]&&L(n.axesInfo,function(t,r){var i=p[r];if(t!==e&&i){var a=i.value;n.mapper&&(a=e.axis.scale.parse(n.mapper(a,OO(t),OO(e)))),g[e.key]=a}})}),L(g,function(e,t){bO(u[t],e,h,!0,f)}),wO(p,u,f),TO(m,i,e,o),EO(u,o,n),f}}function bO(e,t,n,r,i){var a=e.axis;if(!a.scale.isBlank()&&a.containData(t)){if(!e.involveSeries)n.showPointer(e,t);else{var o=xO(t,e),s=o.payloadBatch,c=o.snapToValue;s[0]&&i.seriesIndex==null&&I(i,s[0]),!r&&e.snap&&a.containData(c)&&c!=null&&(t=c),n.showPointer(e,t,s),n.showTooltip(e,o,c)}}}function xO(e,t){var n=t.axis,r=n.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return L(t.seriesModels,function(t,c){var l=t.getData().mapDimensionsAll(r),u,d;if(t.getAxisTooltipData){var f=t.getAxisTooltipData(l,e,n);d=f.dataIndices,u=f.nestestValue}else{if(d=t.indicesOfNearest(r,l[0],e,n.type===`category`?.5:null),!d.length)return;u=t.getData().get(l[0],d[0])}if(ru(u)){var p=e-u,m=Math.abs(p);m<=o&&((m<o||p>=0&&s<0)&&(o=m,s=p,i=u,a.length=0),L(d,function(e){a.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})}))}}),{payloadBatch:a,snapToValue:i}}function SO(e,t,n,r){e[t.key]={value:n,payloadBatch:r}}function CO(e,t,n,r){var i=n.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(t.triggerTooltip&&i.length){var c=t.coordSys.model,l=Aw(c),u=e.map[l];u||(u=e.map[l]={coordSysId:c.id,coordSysIndex:c.componentIndex,coordSysType:c.type,coordSysMainType:c.mainType,dataByAxis:[]},e.list.push(u)),u.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:r,valueLabelOpt:{precision:s.get([`label`,`precision`]),formatter:s.get([`label`,`formatter`])},seriesDataIndices:i.slice()})}}function wO(e,t,n){var r=n.axesInfo=[];L(t,function(t,n){var i=t.axisPointerModel.option,a=e[n];a?(!t.useHandle&&(i.status=`show`),i.value=a.value,i.seriesDataIndices=(a.payloadBatch||[]).slice()):!t.useHandle&&(i.status=`hide`),i.status===`show`&&r.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:i.value})})}function TO(e,t,n,r){if(kO(t)||!e.list.length)r({type:`hideTip`});else{var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:`showTip`,escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}}function EO(e,t,n){var r=n.getZr(),i=`axisPointerLastHighlights`,a=qX(r)[i]||{},o=qX(r)[i]={};L(e,function(e,t){var n=e.axisPointerModel.option;n.status===`show`&&e.triggerEmphasis&&L(n.seriesDataIndices,function(e){o[e.seriesIndex+`|`+e.dataIndex]=e})});var s=[],c=[];function l(e){return{seriesIndex:e.seriesIndex,dataIndex:e.dataIndex}}L(a,function(e,t){!o[t]&&c.push(l(e))}),L(o,function(e,t){!a[t]&&s.push(l(e))}),c.length&&n.dispatchAction({type:`downplay`,escapeConnect:!0,notBlur:!0,batch:c}),s.length&&n.dispatchAction({type:`highlight`,escapeConnect:!0,notBlur:!0,batch:s})}function DO(e,t){for(var n=0;n<(e||[]).length;n++){var r=e[n];if(t.axis.dim===r.axisDim&&t.axis.model.componentIndex===r.axisIndex)return r}}function OO(e){var t=e.axis.model,n={},r=n.axisDim=e.axis.dim;return n.axisIndex=n[r+`AxisIndex`]=t.componentIndex,n.axisName=n[r+`AxisName`]=t.name,n.axisId=n[r+`AxisId`]=t.id,n}function kO(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function AO(e){VJ.registerAxisPointerClass(`CartesianAxisPointer`,VX),e.registerComponentModel(UX),e.registerComponentView(KX),e.registerPreprocessor(function(e){if(e){e.axisPointer&&e.axisPointer.length!==0||(e.axisPointer={});var t=e.axisPointer.link;t&&!z(t)&&(e.axisPointer.link=[t])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,{overallReset:function(e,t){e.getComponent(`axisPointer`).coordSysAxesInfo=bw(e,t)}}),e.registerAction({type:`updateAxisPointer`,event:`updateAxisPointer`,update:`:updateAxisPointer`},yO)}function jO(e){XC(Nw),XC(AO)}function MO(e,t){var n=e.cellSize,r=z(n)?n:e.cellSize=[n,n];r.length===1&&(r[1]=r[0]),Eh(e,t,{type:`box`,ignoreSize:R([0,1],function(e){return wh(t,e)&&(r[e]=`auto`),r[e]!=null&&r[e]!==`auto`})})}function NO(e){var t=e.calendarModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem:null}function PO(e){e.registerComponentModel(JX),e.registerComponentView(YX),e.registerCoordinateSystem(`calendar`,ZX)}function FO(e,t){var n=e.existing;if(t.id=e.keyInfo.id,!t.type&&n&&(t.type=n.type),t.parentId==null){var r=t.parentOption;r?t.parentId=r.id:n&&(t.parentId=n.parentId)}t.parentOption=null}function IO(e,t){var n;return L(t,function(t){e[t]!=null&&e[t]!==`auto`&&(n=!0)}),n}function LO(e,t,n){var r=I({},n),i=e[t],a=n.$action||`merge`;a===`merge`?i?(Aa(i,r,!0),Eh(i,r,{ignoreSize:!0}),Oh(n,i),RO(n,i),RO(n,i,`shape`),RO(n,i,`style`),RO(n,i,`extra`),n.clipPath=i.clipPath):e[t]=r:a===`replace`?e[t]=r:a===`remove`&&i&&(e[t]=null)}function RO(e,t,n){if(n&&(!e[n]&&t[n]&&(e[n]={}),e=e[n],t=t[n]),e&&t)for(var r=n?QX:$X,i=0;i<r.length;i++){var a=r[i];e[a]==null&&t[a]!=null&&(e[a]=t[a])}}function zO(e,t){if(e&&(e.hv=t.hv=[IO(t,[`left`,`right`]),IO(t,[`top`,`bottom`])],e.type===`group`)){var n=e,r=t;n.width??=r.width=0,n.height??=r.height=0}}function BO(e){var t=new(so(tZ,e)?tZ[e]:xf(e))({});return nZ(t).type=e,t}function VO(e,t,n,r){var i=BO(n);return t.add(i),r.set(e,i),nZ(i).id=e,nZ(i).isNew=!0,i}function HO(e,t,n,r){e&&e.parent&&(e.type===`group`&&e.traverse(function(e){HO(e,t,n,r)}),PD(e,t,r),n.removeKey(nZ(e).id))}function UO(e,t,n,r){e.isGroup||L([[`cursor`,cL.prototype.cursor],[`zlevel`,r||0],[`z`,n||0],[`z2`,0]],function(n){var r=n[0];so(t,r)?e[r]=U(t[r],n[1]):e[r]??(e[r]=n[1])}),L(Ba(t),function(n){if(n.indexOf(`on`)===0){var r=t[n];e[n]=B(r)?r:null}}),so(t,`draggable`)&&(e.draggable=t.draggable),t.name!=null&&(e.name=t.name),t.id!=null&&(e.id=t.id)}function WO(e){return e=I({},e),L([`id`,`parentId`,`$action`,`hv`,`bounding`,`textContent`,`clipPath`].concat(bH),function(t){delete e[t]}),e}function GO(e,t,n){var r=LR(e).eventData;e.silent||e.ignore||r||(r=LR(e).eventData={componentType:`graphic`,componentIndex:t.componentIndex,name:e.name}),r&&(r.info=n.info)}function KO(e){e.registerComponentModel(eZ),e.registerComponentView(rZ),e.registerPreprocessor(function(e){var t=e.graphic;z(t)?e.graphic=!t[0]||!t[0].elements?[{elements:t}]:[e.graphic[0]]:t&&!t.elements&&(e.graphic=[{elements:[t]}])})}function qO(e){return Na(oZ,e.get(`coordinateSystem`))>=0}function JO(e){return e+`Axis`}function YO(e,t){var n=W(),r=[],i=W();e.eachComponent({mainType:`dataZoom`,query:t},function(e){i.get(e.uid)||s(e)});var a;do a=!1,e.eachComponent(`dataZoom`,o);while(a);function o(e){!i.get(e.uid)&&c(e)&&(s(e),a=!0)}function s(e){i.set(e.uid,!0),r.push(e),l(e)}function c(e){var t=!1;return e.eachTargetAxis(function(e,r){var i=n.get(e);i&&i[r]&&(t=!0)}),t}function l(e){e.eachTargetAxis(function(e,t){(n.get(e)||n.set(e,[]))[t]=!0})}return r}function XO(e){var t=e.ecModel,n={infoList:[],infoMap:W()};return e.eachTargetAxis(function(e,r){var i=t.getComponent(JO(e),r);if(i){var a=i.getCoordSysModel();if(a){var o=a.uid,s=n.infoMap.get(o);s||(s={model:a,axisModels:[]},n.infoList.push(s),n.infoMap.set(o,s)),s.axisModels.push(i)}}}),n}function ZO(e){var t=aZ(Mv(e));return t.axisProxyMap||=W()}function QO(e){if(e)return ZO(e.ecModel).get(e.uid)}function $O(e,t){ZO(e.ecModel).set(e.uid,t)}function ek(e,t){var n=t.getAxisModel().axis.__alignTo;return n&&e.getAxisProxy(n.dim,n.model.componentIndex)?QO(n.model):null}function tk(e){var t={};return L([`start`,`end`,`startValue`,`endValue`,`throttle`],function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t}function nk(e){e.registerAction(`dataZoom`,function(e,t){L(YO(t,e),function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}function rk(e){fZ(e,function(){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,dZ),nk(e),e.registerSubTypeDefaulter(`dataZoom`,function(){return`slider`})})}function ik(e,t){var n=gH(t.get(`padding`)),r=t.getItemStyle([`color`,`opacity`]);return r.fill=t.get(`backgroundColor`),new rR({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get(`borderRadius`)},style:r,silent:!0,z2:-1})}function ak(e){var t=e.get(`confine`);return t==null?e.get(`renderMode`)===`richText`:!!t}function ok(e){if(dF.domSupported){for(var t=document.documentElement.style,n=0,r=e.length;n<r;n++)if(e[n]in t)return e[n]}}function sk(e,t){if(!e)return t;t=uh(t,!0);var n=e.indexOf(t);return e=n===-1?t:`-`+e.slice(0,n)+`-`+t,e.toLowerCase()}function ck(e,t){var n=e.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(e);return n?t?n[t]:n:null}function lk(e){return e=e===`left`?`right`:e===`right`?`left`:e===`top`?`bottom`:`top`,e}function uk(e,t,n){if(!V(n)||n===`inside`)return``;var r=e.get(`backgroundColor`),i=e.get(`borderWidth`);t=hh(t);var a=lk(n),o=Math.max(Math.round(i)*1.5,6),s=``,c=_Z+`:`,l;Na([`left`,`right`],a)>-1?(s+=`top:50%`,c+=`translateY(-50%) rotate(`+(l=a===`left`?-225:-45)+`deg)`):(s+=`left:50%`,c+=`translateX(-50%) rotate(`+(l=a===`top`?225:45)+`deg)`);var u=l*Math.PI/180,d=o+i,f=d*Math.abs(Math.cos(u))+d*Math.abs(Math.sin(u)),p=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-d)/2)*100)/100;s+=`;`+a+`:-`+p+`px`;var m=t+` solid `+i+`px;`;return`<div style="`+[`position:absolute;width:`+o+`px;height:`+o+`px;z-index:-1;`,s+`;`+c+`;`,`border-bottom:`+m,`border-right:`+m,`background-color:`+r+`;`].join(``)+`"></div>`}function dk(e,t,n){var r=`cubic-bezier(0.23,1,0.32,1)`,i=``,a=``;return n&&(i=` `+e/2+`s `+r,a=`opacity`+i+`,visibility`+i),t||(i=` `+e+`s `+r,a+=(a.length?`,`:``)+(dF.transformSupported?``+_Z+i:`,left`+i+`,top`+i)),gZ+`:`+a}function fk(e,t,n){var r=e.toFixed(0)+`px`,i=t.toFixed(0)+`px`;if(!dF.transformSupported)return n?`top:`+i+`;left:`+r+`;`:[[`top`,i],[`left`,r]];var a=dF.transform3dSupported,o=`translate`+(a?`3d`:``)+`(`+r+`,`+i+(a?`,0`:``)+`)`;return n?`top:0;left:0;`+_Z+`:`+o+`;`:[[`top`,0],[`left`,0],[mZ,o]]}function pk(e){var t=[],n=e.get(`fontSize`),r=e.getTextColor();r&&t.push(`color:`+r),t.push(`font:`+e.getFont());var i=U(e.get(`lineHeight`),Math.round(n*3/2));n&&t.push(`line-height:`+i+`px`);var a=e.get(`textShadowColor`),o=e.get(`textShadowBlur`)||0,s=e.get(`textShadowOffsetX`)||0,c=e.get(`textShadowOffsetY`)||0;return a&&o&&t.push(`text-shadow:`+s+`px `+c+`px `+o+`px `+a),L([`decoration`,`align`],function(n){var r=e.get(n);r&&t.push(`text-`+n+`:`+r)}),t.join(`;`)}function mk(e,t,n,r){var i=[],a=e.get(`transitionDuration`),o=e.get(`backgroundColor`),s=e.get(`shadowBlur`),c=e.get(`shadowColor`),l=e.get(`shadowOffsetX`),u=e.get(`shadowOffsetY`),d=e.getModel(`textStyle`),f=cg(e,`html`),p=l+`px `+u+`px `+s+`px `+c;return i.push(`box-shadow:`+p),t&&a>0&&i.push(dk(a,n,r)),o&&i.push(`background-color:`+o),L([`width`,`color`,`radius`],function(t){var n=`border-`+t,r=uh(n),a=e.get(r);a!=null&&i.push(n+`:`+a+(t===`color`?``:`px`))}),i.push(pk(d)),f!=null&&i.push(`padding:`+gH(f).join(`px `)+`px`),i.join(`;`)+`;`}function hk(e,t,n,r,i){var a=t&&t.painter;if(n){var o=a&&a.getViewportRoot();o&&Cm(e,o,n,r,i)}else{e[0]=r,e[1]=i;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}function gk(e){return Math.max(0,e)}function _k(e){var t=gk(e.shadowBlur||0),n=gk(e.shadowOffsetX||0),r=gk(e.shadowOffsetY||0);return{left:gk(t-n),right:gk(t+n),top:gk(t-r),bottom:gk(t+r)}}function vk(e,t,n,r){e[0]=n,e[1]=r,e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}function yk(e,t,n){var r=t.ecModel,i;n?(i=new HB(n,r,r),i=new HB(t.option,i,r)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof HB&&(o=o.get(`tooltip`,!0)),V(o)&&(o={formatter:o}),o&&(i=new HB(o,i,r)))}return i}function bk(e,t){return e.dispatchAction||q(t.dispatchAction,t)}function xk(e,t,n,r,i,a,o){var s=n.getSize(),c=s[0],l=s[1];return a!=null&&(e+c+a+2>r?e-=c+a:e+=a),o!=null&&(t+l+o>i?t-=l+o:t+=o),[e,t]}function Sk(e,t,n,r,i){var a=n.getSize(),o=a[0],s=a[1];return e=Math.min(e+o,r)-o,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function Ck(e,t,n,r){var i=n[0],a=n[1],o=Math.ceil(Math.SQRT2*r)+8,s=0,c=0,l=t.width,u=t.height;switch(e){case`inside`:s=t.x+l/2-i/2,c=t.y+u/2-a/2;break;case`top`:s=t.x+l/2-i/2,c=t.y-a-o;break;case`bottom`:s=t.x+l/2-i/2,c=t.y+u+o;break;case`left`:s=t.x-i-o,c=t.y+u/2-a/2;break;case`right`:s=t.x+l+o,c=t.y+u/2-a/2}return[s,c]}function wk(e){return e===`center`||e===`middle`}function Tk(e,t,n){var r=ku(e).queryOptionMap,i=r.keys()[0];if(i&&i!==`series`){var a=Au(t,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a){var o=n.getViewOfComponentModel(a),s;if(o.group.traverse(function(t){var n=LR(t).tooltipConfig;if(n&&n.name===e.name)return s=t,!0}),s)return{componentMainType:i,componentIndex:a.componentIndex,el:s}}}}function Ek(e){XC(AO),e.registerComponentModel(pZ),e.registerComponentView(SZ),e.registerAction({type:`showTip`,event:`showTip`,update:`tooltip:manuallyShowTip`},co),e.registerAction({type:`hideTip`,event:`hideTip`,update:`tooltip:manuallyHideTip`},co)}function Dk(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function Ok(e,t,n){var r={};return CZ(t,function(t){var a=r[t]=i();CZ(e[t],function(e,r){if(qY.isValidType(r)){var i={type:r,visual:e};n&&n(i,t),a[r]=new qY(i),r===`opacity`&&(i=ka(i),i.type=`colorAlpha`,a.__hidden.__alphaForOpacity=new qY(i))}})}),r;function i(){var e=function(){};return e.prototype.__hidden=e.prototype,new e}}function kk(e,t,n){var r;L(n,function(e){t.hasOwnProperty(e)&&Dk(t[e])&&(r=!0)}),r&&L(n,function(n){t.hasOwnProperty(n)&&Dk(t[n])?e[n]=ka(t[n]):delete e[n]})}function Ak(e,t,n,r){var i={};return L(e,function(e){i[e]=qY.prepareVisualTypes(t[e])}),{progress:function(e,a){var o;r!=null&&(o=a.getDimensionIndex(r));function s(e){return VS(a,l,e)}function c(e,t){US(a,l,e,t)}for(var l,u=a.getStore();(l=e.next())!=null;){var d=a.getRawDataItem(l);if(!(d&&d.visualMap===!1))for(var f=r==null?l:u.get(o,l),p=n(f),m=t[p],h=i[p],g=0,_=h.length;g<_;g++){var v=h[g];m[v]&&m[v].applyVisual(f,s,c)}}}}}function jk(e){e.registerComponentModel(wZ),e.registerComponentView(TZ)}function Mk(e,t){if(!e)return!1;for(var n=z(e)?e:[e],r=0;r<n.length;r++)if(n[r]&&n[r][t])return!0;return!1}function Nk(e){lu(e,`label`,[`show`])}function Pk(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}function Fk(e){return!isNaN(parseFloat(e.x))&&!isNaN(parseFloat(e.y))}function Ik(e,t,n,r,i,a,o){var s=[],c=um(t,i)?t.getCalculationInfo(`stackResultDimension`):i,l=Hk(t,c,e),u=t.hostModel.indicesOfNearest(n,c,l)[0];s[a]=t.get(r,u),s[o]=t.get(c,u);var d=t.get(i,u),f=Bl(t.get(i,u));return f=Math.min(f,20),f>=0&&(s[o]=+s[o].toFixed(f)),[s,d]}function Lk(e,t){if(t){var n=e.getData(),r=e.coordinateSystem,i=r&&r.dimensions;if(!Fk(t)&&!z(t.coord)&&z(i)){var a=Rk(t,n,r,e);if(t=ka(t),t.type&&OZ[t.type]&&a.baseAxis&&a.valueAxis){var o=Na(i,a.baseAxis.dim),s=Na(i,a.valueAxis.dim),c=OZ[t.type](n,a.valueAxis.dim,a.baseDataDim,a.valueDataDim,o,s);t.coord=c[0],t.value=c[1]}else t.coord=[t.xAxis==null?t.radiusAxis:t.xAxis,t.yAxis==null?t.angleAxis:t.yAxis]}if(t.coord==null||!z(i)){t.coord=[];var l=e.getBaseAxis();if(l&&t.type&&OZ[t.type]){var u=r.getOtherAxis(l);u&&(t.value=Hk(n,n.mapDimension(u.dim),t.type))}}else for(var d=t.coord,f=0;f<2;f++)OZ[d[f]]&&(d[f]=Hk(n,n.mapDimension(i[f]),d[f]));return t}}function Rk(e,t,n,r){var i={};return e.valueIndex!=null||e.valueDim!=null?(i.valueDataDim=e.valueIndex==null?e.valueDim:t.getDimension(e.valueIndex),i.valueAxis=n.getAxis(zk(r,i.valueDataDim)),i.baseAxis=n.getOtherAxis(i.valueAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim)):(i.baseAxis=r.getBaseAxis(),i.valueAxis=n.getOtherAxis(i.baseAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim),i.valueDataDim=t.mapDimension(i.valueAxis.dim)),i}function zk(e,t){var n=e.getData().getDimensionInfo(t);return n&&n.coordDim}function Bk(e,t){return e&&e.containData&&t.coord&&!Pk(t)?e.containData(t.coord):!0}function Vk(e,t){return e?function(e,n,r,i){return Hp(i<2?e.coord&&e.coord[i]:e.value,t[i])}:function(e,n,r,i){return Hp(e.value,t[i])}}function Hk(e,t,n){if(n===`average`){var r=0,i=0;return e.each(t,function(e,t){isNaN(e)||(r+=e,i++)}),r/i}return n===`median`?e.getMedian(t):e.getDataExtent(t)[+(n===`max`)]}function Uk(e,t,n){e.eachSeries(function(e){var r=DZ.getMarkerModelFromSeries(e,n),i=t.get(e.id);if(r&&i&&i.group){var a=Yf(r),o=a.z,s=a.zlevel;Zf(i.group,o,s)}})}function Wk(e){return!isNaN(e)&&!isFinite(e)}function Gk(e,t,n,r){var i=1-e,a=r.dimensions[e];return Wk(t[i])&&Wk(n[i])&&t[e]===n[e]&&r.getAxis(a).containData(t[e])}function Kk(e,t){if(e.type===`cartesian2d`){var n=t[0].coord,r=t[1].coord;if(n&&r&&(Gk(1,n,r,e)||Gk(0,n,r,e)))return!0}return Bk(e,t[0])&&Bk(e,t[1])}function qk(e,t,n,r,i){var a=r.coordinateSystem,o=e.getItemModel(t),s,c=Y(o.get(`x`),i.getWidth()),l=Y(o.get(`y`),i.getHeight());if(!isNaN(c)&&!isNaN(l))s=[c,l];else{if(r.getMarkerPosition)s=r.getMarkerPosition(e.getValues(e.dimensions,t));else{var u=a.dimensions,d=e.get(u[0],t),f=e.get(u[1],t);s=a.dataToPoint([d,f])}if(Yg(a,`cartesian2d`)){var p=a.getAxis(`x`),m=a.getAxis(`y`),u=a.dimensions;Wk(e.get(u[0],t))?s[0]=p.toGlobalCoord(p.getExtent()[+!n]):Wk(e.get(u[1],t))&&(s[1]=m.toGlobalCoord(m.getExtent()[+!n]))}isNaN(c)||(s[0]=c),isNaN(l)||(s[1]=l)}e.setItemLayout(t,s)}function Jk(e,t,n){var r=e?R(e&&e.dimensions,function(e){var n=t.getData();return I(I({},n.getDimensionInfo(n.mapDimension(e))||{}),{name:e,ordinalMeta:null})}):[{name:`value`,type:`float`}],i=new FV(r,n),a=new FV(r,n),o=new FV([],n),s=R(n.get(`data`),Ha(NZ,t,e,n));e&&(s=Ra(s,Ha(Kk,e)));var c=Vk(!!e,r);return i.initData(R(s,function(e){return e[0]}),null,c),a.initData(R(s,function(e){return e[1]}),null,c),o.initData(R(s,function(e){return e[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function Yk(e){e.registerComponentModel(jZ),e.registerComponentView(PZ),e.registerPreprocessor(function(e){Mk(e.series,`markLine`)&&(e.markLine=e.markLine||{})})}function Xk(e,t,n,r,i,a,o){function s(e,t){e.lineWidth===`auto`&&(e.lineWidth=t.lineWidth>0?2:0),RZ(e,function(n,r){e[r]===`inherit`&&(e[r]=t[r])})}var c=t.getModel(`itemStyle`),l=c.getItemStyle(),u=e.lastIndexOf(`empty`,0)===0?`fill`:`stroke`,d=c.getShallow(`decal`);l.decal=!d||d===`inherit`?r.decal:wC(d,o),l.fill===`inherit`&&(l.fill=r[i]),l.stroke===`inherit`&&(l.stroke=r[u]),l.opacity===`inherit`&&(l.opacity=(i===`fill`?r:n).opacity),s(l,r);var f=t.getModel(`lineStyle`),p=f.getLineStyle();if(s(p,n),l.fill===`auto`&&(l.fill=r.fill),l.stroke===`auto`&&(l.stroke=r.fill),p.stroke===`auto`&&(p.stroke=r.fill),!a){var m=t.get(`inactiveBorderWidth`),h=l[u];l.lineWidth=m===`auto`?r.lineWidth>0&&h?2:0:l.lineWidth,l.fill=t.get(`inactiveColor`),l.stroke=t.get(`inactiveBorderColor`),p.stroke=f.get(`inactiveColor`),p.lineWidth=f.get(`inactiveWidth`)}return{itemStyle:l,lineStyle:p}}function Zk(e){var t=e.icon||`roundRect`,n=xg(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf(`empty`)>-1&&(n.style.stroke=n.style.fill,n.style.fill=X.color.neutral00,n.style.lineWidth=2),n}function Qk(e,t,n,r){eA(e,t,n,r),n.dispatchAction({type:`legendToggleSelect`,name:e??t}),$k(e,t,n,r)}function $k(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`highlight`,seriesName:e,name:t,excludeSeriesId:r})}function eA(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`downplay`,seriesName:e,name:t,excludeSeriesId:r})}function tA(e,t,n){var r=e===`allSelect`||e===`inverseSelect`,i={},a=[];n.eachComponent({mainType:`legend`,query:t},function(n){r?n[e]():n[e](t.name),nA(n,i),a.push(n.componentIndex)});var o={};return n.eachComponent(`legend`,function(e){L(i,function(t,n){e[t?`select`:`unSelect`](n)}),nA(e,o)}),r?{selected:o,legendIndex:a}:{name:t.name,selected:o}}function nA(e,t){var n=t||{};return L(e.getData(),function(t){var r=t.get(`name`);if(r!==`
29
29
  `&&r!==``){var i=e.isSelected(r);n[r]=so(n,r)?n[r]&&i:i}}),n}function rA(e){e.registerAction(`legendToggleSelect`,`legendselectchanged`,Ha(tA,`toggleSelected`)),e.registerAction(`legendAllSelect`,`legendselectall`,Ha(tA,`allSelect`)),e.registerAction(`legendInverseSelect`,`legendinverseselect`,Ha(tA,`inverseSelect`)),e.registerAction(`legendSelect`,`legendselected`,Ha(tA,`select`)),e.registerAction(`legendUnSelect`,`legendunselected`,Ha(tA,`unSelect`))}function iA(e){var t=e.findComponents({mainType:`legend`});t&&t.length&&e.filterSeries(function(e){for(var n=0;n<t.length;n++)if(!t[n].isSelected(e.name))return!1;return!0})}function aA(e){e.registerComponentModel(IZ),e.registerComponentView(BZ),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,VZ),e.registerSubTypeDefaulter(`legend`,function(){return`plain`}),rA(e)}function oA(e,t,n){var r=e.getOrient(),i=[1,1];i[r.index]=0,Eh(t,n,{type:`box`,ignoreSize:!!i})}function sA(e){e.registerAction(`legendScroll`,`legendscroll`,function(e,t){var n=e.scrollDataIndex;n!=null&&t.eachComponent({mainType:`legend`,subType:`scroll`,query:e},function(e){e.setScrollDataIndex(n)})})}function cA(e){XC(aA),e.registerComponentModel(HZ),e.registerComponentView(KZ),sA(e)}function lA(e){XC(aA),XC(cA)}function uA(e,t,n){JZ(e).coordSysRecordMap.each(function(e){var r=e.dataZoomInfoMap.get(t.uid);r&&(r.getRange=n)})}function dA(e,t){for(var n=JZ(e).coordSysRecordMap,r=n.keys(),i=0;i<r.length;i++){var a=r[i],o=n.get(a),s=o.dataZoomInfoMap;if(s){var c=t.uid;s.get(c)&&(s.removeKey(c),s.keys().length||fA(n,o))}}}function fA(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function pA(e,t){var n={model:t,containsPoint:Ha(hA,t),dispatchAction:Ha(mA,e),dataZoomInfoMap:null,controller:null},r=n.controller=new QJ(e.getZr());return L([`pan`,`zoom`,`scrollMove`],function(e){r.on(e,function(t){var r=[];n.dataZoomInfoMap.each(function(i){if(t.isAvailableBehavior(i.model.option)){var a=(i.getRange||{})[e],o=a&&a(i.dzReferCoordSysInfo,n.model.mainType,n.controller,t);!i.model.get(`disabled`,!0)&&o&&r.push({dataZoomId:i.model.id,start:o[0],end:o[1]})}}),r.length&&n.dispatchAction(r)})}),n}function mA(e,t){e.isDisposed()||e.dispatchAction({type:`dataZoom`,animation:{easing:`cubicOut`,duration:100},batch:t})}function hA(e,t,n,r){return e.coordinateSystem.containPoint([n,r])}function gA(e,t,n){var r,i=`type_`,a={type_true:2,type_move:1,type_false:0,type_undefined:-1},o=!0,s,c;return e.each(function(e){var t=e.model,n=t.get(`disabled`,!0)?!1:!t.get(`zoomLock`,!0)||`move`;a[i+n]>a[i+r]&&(r=n),o&&=t.get(`preventDefaultMouseMove`,!0),s=U(t.get(`cursorGrab`,!0),s),c=U(t.get(`cursorGrabbing`,!0),c)}),{controlType:r,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o,api:n,zInfo:{component:t.model},triggerInfo:{roamTrigger:null,isInSelf:t.containsPoint},cursorGrab:s,cursorGrabbing:c}}}function _A(e){e.registerUpdateLifecycle(`coordsys:aftercreate`,function(e,t){var n=JZ(t),r=n.coordSysRecordMap||=W();r.each(function(e){e.dataZoomInfoMap=null}),e.eachComponent({mainType:`dataZoom`,subType:`inside`},function(e){L(XO(e).infoList,function(n){var i=n.model.uid,a=r.get(i)||r.set(i,pA(t,n.model));(a.dataZoomInfoMap||=W()).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})})}),r.each(function(e){var n=e.controller,i,a=e.dataZoomInfoMap;if(a){var o=a.keys()[0];o!=null&&(i=a.get(o))}if(!i)fA(r,e);else{var s=gA(a,e,t);n.enable(s.controlType,s.opt),gb(e,`dispatchAction`,i.model.get(`throttle`,!0),`fixRate`)}})})}function vA(e){return function(t,n,r,i){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s&&($E(e(o,s,t,n,r,i),o,[0,100],`all`),this.range=o,a[0]!==o[0]||a[1]!==o[1]))return o}}function yA(e){rk(e),e.registerComponentModel(qZ),e.registerComponentView(YZ),_A(e)}function bA(e,t,n,r){var i=e.get(`labelFormatter`),a=e.get(`labelPrecision`);(a==null||a===`auto`)&&(a=n.valuePrecision);var o=n.value[t],s=o==null||isNaN(o)?``:m_(r)||f_(r)?r.getLabel({value:Math.round(o)}):isFinite(a)?Rl(o,a,!0):o+``;return B(i)?i(o,s):V(i)?i.replace(`{value}`,s):s}function xA(e){return{x:`y`,y:`x`,radius:`angle`,angle:`radius`}[e]}function SA(e){return e===`vertical`?`ns-resize`:`ew-resize`}function CA(e){e.registerComponentModel(QZ),e.registerComponentView(cQ),rk(e)}function wA(e){XC(yA),XC(CA)}function TA(e,t,n){var r=e.option,i=r.align;if(i!=null&&i!==`auto`)return i;for(var a={width:t.getWidth(),height:t.getHeight()},o=+(r.orient===`horizontal`),s=yQ[o],c=[0,null,10],l={},u=0;u<3;u++)l[yQ[1-o][u]]=c[u],l[s[u]]=u===2?n[0]:r[s[u]];var d=[[`x`,`width`,3],[`y`,`height`,0]][o],f=xh(l,a,r.padding);return s[(f.margin[d[2]]||0)+f[d[0]]+f[d[1]]*.5<a[d[1]]*.5?0:1]}function EA(e,t){return L(e||[],function(e){e.dataIndex!=null&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey=`visualMap`+(t?t.componentIndex:``)}),e}function DA(e,t,n,r){for(var i=t.targetVisuals[r],a=qY.prepareVisualTypes(i),o={color:HS(e.getData(),`color`)},s=0,c=a.length;s<c;s++){var l=a[s],u=i[l===`opacity`?`__alphaForOpacity`:l];u&&u.applyVisual(n,d,f)}return o.color;function d(e){return o[e]}function f(e,t){o[e]=t}}function OA(e){var t=e&&e.visualMap;z(t)||(t=t?[t]:[]),CQ(t,function(e){if(e){kA(e,`splitList`)&&!kA(e,`pieces`)&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&z(t)&&CQ(t,function(e){H(e)&&(kA(e,`start`)&&!kA(e,`min`)&&(e.min=e.start),kA(e,`end`)&&!kA(e,`max`)&&(e.max=e.end))})}})}function kA(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}function AA(e){wQ||(wQ=!0,e.registerSubTypeDefaulter(`visualMap`,function(e){return!e.categories&&(!(e.pieces?e.pieces.length>0:e.splitNumber>0)||e.calculable)?`continuous`:`piecewise`}),e.registerAction(bQ,xQ),L(SQ,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(OA))}function jA(e,t){var n=e.inverse;(e.orient===`vertical`?!n:n)&&t.reverse()}function MA(e){e.registerComponentModel(TQ),e.registerComponentView(DQ),AA(e)}function NA(e){if(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].slice());return t}}function PA(e,t){var n=e.label,r=t&&t.getTextGuideLine();return{dataIndex:e.dataIndex,dataType:e.dataType,seriesIndex:e.seriesModel.seriesIndex,text:e.label.style.text,rect:e.hostRect,labelRect:e.rect,align:n.style.align,verticalAlign:n.style.verticalAlign,labelLinePoints:NA(r&&r.shape.points)}}function FA(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];t[i]!=null&&(e[i]=t[i])}}function IA(e){e.registerUpdateLifecycle(`series:beforeupdate`,function(e,t,n){var r=PQ(t).labelManager;r||=PQ(t).labelManager=new NQ,r.clearLabels()}),e.registerUpdateLifecycle(`series:layoutlabels`,function(e,t,n){var r=PQ(t).labelManager;L(n.updatedSeries,function(e){r.addLabelsOfSeries(t.getViewOfSeriesModel(e))}),r.updateLayoutConfig(t),r.layout(t),r.processLabelsOverall()})}function LA(e,t){return new FQ(e,t)}function RA(e,t){var n=0,r={tpAbs:{span:0,val:0},tpPrct:{span:0,val:0}},i=function(){return{has:!1,span:NaN,inExtFrac:NaN,val:NaN}},a={S:{tpAbs:i(),tpPrct:i()},E:{tpAbs:i(),tpPrct:i()}};L(e.breaks,function(e){var i=e.gapParsed;i.type===`tpPrct`&&(n+=i.val);var o=VA(e,t);if(o){var s=o.vmin!==e.vmin,c=o.vmax!==e.vmax,l=o.vmax-o.vmin;if(!(s&&c)){if(s||c){var u=s?`S`:`E`;a[u][i.type].has=!0,a[u][i.type].span=l,a[u][i.type].inExtFrac=l/(e.vmax-e.vmin),a[u][i.type].val=i.val}else r[i.type].span+=l,r[i.type].val+=i.val}}});var o=n*(0+(t[1]-t[0])+(r.tpAbs.val-r.tpAbs.span)+(a.S.tpAbs.has?(a.S.tpAbs.val-a.S.tpAbs.span)*a.S.tpAbs.inExtFrac:0)+(a.E.tpAbs.has?(a.E.tpAbs.val-a.E.tpAbs.span)*a.E.tpAbs.inExtFrac:0)-r.tpPrct.span-(a.S.tpPrct.has?a.S.tpPrct.span*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.span*a.E.tpPrct.inExtFrac:0))/(1-r.tpPrct.val-(a.S.tpPrct.has?a.S.tpPrct.val*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.val*a.E.tpPrct.inExtFrac:0));L(e.breaks,function(e){var t=e.gapParsed;t.type===`tpPrct`&&(e.gapReal=n===0?0:hR(o,0)*t.val/n),t.type===`tpAbs`&&(e.gapReal=t.val),e.gapReal??=0})}function zA(e,t,n,r,i,a){e!==`no`&&L(n,function(n){var o=VA(n,a);if(o)for(var s=t.length-1;s>=0;s--){var c=t[s],l=r(c),u=i*3/4;l>o.vmin-u&&l<o.vmax+u&&(e!==`preserve_extent_bound`||l!==a[0]&&l!==a[1])&&t.splice(s,1)}})}function BA(e,t,n,r){L(t,function(t){var i=VA(t,n);i&&(e.push({value:i.vmin,break:{type:`vmin`,parsedBreak:i},time:r?r(i):void 0}),e.push({value:i.vmax,break:{type:`vmax`,parsedBreak:i},time:r?r(i):void 0}))}),t.length&&e.sort(function(e,t){return e.value-t.value})}function VA(e,t){var n=hR(e.vmin,t[0]),r=mR(e.vmax,t[1]);return n<r||n===r&&n>t[0]&&n<t[1]?{vmin:n,vmax:r,breakOption:e.breakOption,gapParsed:e.gapParsed,gapReal:e.gapReal}:null}function HA(e,t,n){var r=[];if(!e)return{breaks:r};function i(e,t){return e>=0&&e<.99999}L(e,function(e){if(e&&e.start!=null&&e.end!=null&&!e.isExpanded){var a={breakOption:ka(e),vmin:t.parse(e.start),vmax:t.parse(e.end),gapParsed:{type:`tpAbs`,val:0},gapReal:null};if(e.gap!=null){var o=!1;if(V(e.gap)){var s=no(e.gap);if(s.match(/%$/)){var c=parseFloat(s)/100;i(c,`Percent gap`)||(c=0),a.gapParsed.type=`tpPrct`,a.gapParsed.val=c,o=!0}}if(!o){var l=t.parse(e.gap);(!isFinite(l)||l<0)&&(l=0),a.gapParsed.type=`tpAbs`,a.gapParsed.val=l}}if(a.vmin===a.vmax&&(a.gapParsed.type=`tpAbs`,a.gapParsed.val=0),n&&n.noNegative&&L([`vmin`,`vmax`],function(e){a[e]<0&&(a[e]=0)}),a.vmin>a.vmax){var u=a.vmax;a.vmax=a.vmin,a.vmin=u}r.push(a)}}),r.sort(function(e,t){return e.vmin-t.vmin});var a=-1/0;return L(r,function(e,t){a>e.vmin&&(r[t]=null),a=e.vmax}),{breaks:Ra(r,function(e){return!!e})}}function UA(e,t){return WA(t)===WA(e)}function WA(e){return e.start+`_\0_`+e.end}function GA(e,t,n){var r=[];L(e,function(e,n){var i=t(e);i&&i.type===`vmin`&&r.push([n])}),L(e,function(n,i){var a=t(n);if(a&&a.type===`vmax`){var o=za(r,function(n){return UA(t(e[n[0]]).parsedBreak.breakOption,a.parsedBreak.breakOption)});o&&o.push(i)}});var i=[];return L(r,function(t){t.length===2&&i.push(n?t:[e[t[0]],e[t[1]]])}),i}function KA(e,t,n,r){if(t.break){var i=t.break.parsedBreak,a=za(n,function(e){return UA(e.breakOption,t.break.parsedBreak.breakOption)}),o={lookup:r,depth:2},s={vmin:e.transformOut(i.vmin,o),vmax:e.transformOut(i.vmax,o),breakOption:i.breakOption,gapParsed:ka(a.gapParsed),gapReal:i.gapReal};return{tickVal:s[t.break.type],vBreak:{type:t.break.type,parsedBreak:s}}}}function qA(e,t,n,r,i){i.original=HA(e,t,n);var a=i.transformed=HA(e,t,n),o=i.lookup;a.breaks=R(a.breaks,function(e,n){var i={depth:2},a=t.transformIn(e.vmin,i),s=t.transformIn(e.vmax,i),c={type:e.gapParsed.type,val:e.gapParsed.type===`tpAbs`?t.transformIn(e.vmin+e.gapParsed.val,i)-a:e.gapParsed.val};return o.from[r+n]=a,o.to[r+n]=e.vmin,o.from[r+n+1]=s,o.to[r+n+1]=e.vmax,{vmin:a,vmax:s,gapParsed:c,gapReal:e.gapReal,breakOption:e.breakOption}})}function JA(e,t){return t&&(e||={},e.break={type:RQ[t.type],start:t.parsedBreak.vmin,end:t.parsedBreak.vmax}),e}function YA(){Pm({createBreakScaleMapper:LA,pruneTicksByBreak:zA,addBreaksToTicks:BA,parseAxisBreakOption:HA,identifyAxisBreak:UA,serializeAxisBreakIdentifier:WA,retrieveAxisBreakPairs:GA,getTicksBreakOutwardTransform:KA,parseAxisBreakOptionInwardTransform:qA,makeAxisLabelFormatterParamBreak:JA})}function XA(e,t){var n=za(e,function(e){return Fm().identifyAxisBreak(e.parsedBreak.breakOption,t.breakOption)});return n||e.push(n={zigzagRandomList:[],parsedBreak:t,shouldRemove:!1}),n}function ZA(e){L(e,function(e){return e.shouldRemove=!0})}function QA(e){for(var t=e.length-1;t>=0;t--)e[t].shouldRemove&&e.splice(t,1)}function $A(e,t,n,r,i){var a=n.axis;if(a.scale.isBlank()||!Fm())return;var o=Fm().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:`only_break`}),function(e){return e.break},!1);if(!o.length)return;var s=n.getModel(`breakArea`),c=s.get(`zigzagAmplitude`),l=s.get(`zigzagMinSpan`),u=s.get(`zigzagMaxSpan`);l=Math.max(2,l||0),u=Math.max(l,u||0);var d=s.get(`expandOnClick`),f=s.get(`zigzagZ`),p=s.getModel(`itemStyle`).getItemStyle(),m=p.stroke,h=p.lineWidth,g=p.lineDash,_=p.fill,v=new Sz({ignoreModelZ:!0}),y=a.isHorizontal(),b=zQ(t).visualList||(zQ(t).visualList=[]);ZA(b);for(var x=function(e){var t=o[e][0].break.parsedBreak,r=[];r[0]=a.toGlobalCoord(a.dataToCoord(t.vmin,!0)),r[1]=a.toGlobalCoord(a.dataToCoord(t.vmax,!0)),r[1]<r[0]&&r.reverse();var s=XA(b,t);s.shouldRemove=!1;var c=new Sz;C(s.zigzagRandomList,c,r[0],r[1],y,t),d&&c.on(`click`,function(){var e={type:eW,breaks:[{start:t.breakOption.start,end:t.breakOption.end}]};e[a.dim+`AxisIndex`]=n.componentIndex,i.dispatchAction(e)}),c.silent=!d,v.add(c)},S=0;S<o.length;S++)x(S);e.add(v),QA(b);function C(e,t,n,i,a,o){var s={stroke:m,lineWidth:h,lineDash:g,fill:`none`},d=+!a,v=1-d,y=r[vB[v]]+r[yB[v]];function b(e){var t=[],n=[];t[d]=n[d]=e,t[v]=r[vB[v]],n[v]=y;var i={x1:t[0],y1:t[1],x2:n[0],y2:n[1]};return yl(i,i,{lineWidth:1}),t[0]=i.x1,t[1]=i.y1,t[d]}n=b(n),i=b(i);for(var x=[],S=[],C=!0,w=r[vB[v]],T=0;;T++){var E=w===r[vB[v]],D=w>=y;D&&(w=y);var O=[],k=[];O[d]=n,k[d]=i,!E&&!D&&(O[d]+=C?-c:c,k[d]-=C?c:-c),O[v]=w,k[v]=w,x.push(O),S.push(k);var A=void 0;if(T<e.length?A=e[T]:(A=Math.random(),e.push(A)),w+=A*(u-l)+l,C=!C,D)break}var j=Fm().serializeAxisBreakIdentifier(o.breakOption);if(t.add(new Gz({anid:`break_a_`+j,shape:{points:x},style:s,z:f})),o.gapReal!==0){t.add(new Gz({anid:`break_b_`+j,shape:{points:S},style:s,z:f}));var M=S.slice();M.reverse();var ee=x.concat(M);t.add(new Uz({anid:`break_c_`+j,shape:{points:ee},style:{fill:_,opacity:p.opacity},z:f}))}}}function ej(e,t,n,r){var i=e.axis,a=n.transform;to(r.style);var o=i.getExtent();i.inverse&&(o=o.slice(),o.reverse());var s=R(Fm().retrieveAxisBreakPairs(i.scale.getTicks({breakTicks:`only_break`}),function(e){return e.break},!1),function(e){var t=e[0].break.parsedBreak,n=[i.dataToCoord(t.vmin,!0),i.dataToCoord(t.vmax,!0)];return n[0]>n[1]&&n.reverse(),{coordPair:n,brkId:Fm().serializeAxisBreakIdentifier(t.breakOption)}});s.sort(function(e,t){return e.coordPair[0]-t.coordPair[0]});for(var c=o[0],l=null,u=0;u<s.length;u++){var d=s[u],f=Math.max(d.coordPair[0],o[0]),p=Math.min(d.coordPair[1],o[1]);c<=f&&m(c,f,l,d),c=p,l=d}c<=o[1]&&m(c,o[1],l,null);function m(e,n,i,o){function s(e,t){a&&(qo(e,e,a),qo(t,t,a))}function c(e,t){var n={x1:e[0],y1:e[1],x2:t[0],y2:t[1]};yl(n,n,r.style),e[0]=n.x1,e[1]=n.y1,t[0]=n.x2,t[1]=n.y2}var l=[e,0],u=[n,0],d=[e,5],f=[n,5];s(l,d),c(l,d),s(u,f),c(u,f),c(l,u);var p=new Jz(I({shape:{x1:l[0],y1:l[1],x2:u[0],y2:u[1]}},r));t.add(p),p.anid=`breakLine_`+(i?i.brkId:`\0`)+`_\0_`+(o?o.brkId:`\0`)}}function tj(e,t,n){if(za(n,function(e){return!e}))return;var r=new wF;if(!uy(n[0],n[1],r,{direction:-(e?t+Math.PI:t),touchThreshold:0,bidirectional:!1}))return;var i=Eo();jo(i,i,-t);var a=R(n,function(e){return e.transform?ko(Eo(),i,e.transform):i});function o(e){var t=n[0].localRect,r=new wF(t[yB[e]]*a[0][0],t[yB[e]]*a[0][1]);return Math.abs(r.y)<1e-5}var s=.5;if(o(0)||o(1)){var c=R(n,function(e,t){var n=e.localRect.clone();return n.applyTransform(a[t]),n}),l=new wF;l.copy(n[0].label).add(n[1].label).scale(.5),l.transform(i);var u=r.clone().transform(i),d=(c[0].x+c[1].x+(u.x>=0?c[0].width:c[1].width)+u.x)/2-l.x,f=Math.min(d,d-u.x),p=Math.max(d,d-u.x);s=(d-(p<0?p:f>0?f:0))/u.x}var m=new wF,h=new wF;wF.scale(m,r,-s),wF.scale(h,r,1-s),ay(n[0],m),ay(n[1],h)}function nj(e,t){var n={breaks:[]};return L(t.breaks,function(r){if(r){var i=za(e.get(`breaks`,!0),function(e){return Fm().identifyAxisBreak(e,r)});if(i){var a=t.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===`expandAxisBreak`?!0:a===`collapseAxisBreak`?!1:a===`toggleAxisBreak`?!i.isExpanded:i.isExpanded,n.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}}),n}function rj(){dy({adjustBreakLabelPair:tj,buildAxisBreakLine:ej,rectCoordBuildBreakAxis:$A,updateModelAxisBreak:nj})}function ij(e){my(e),YA(),rj()}function aj(e){var t=e.fill;return t!=null&&t!==KQ}function oj(e){var t=e.stroke;return t!=null&&t!==KQ}function sj(e,t,n,r){var i=t.opacity==null?1:t.opacity;if(n instanceof $L)e(`opacity`,i);else{if(aj(t)){var a=dc(t.fill);e(`fill`,a.color);var o=t.fillOpacity==null?a.opacity*i:t.fillOpacity*a.opacity*i;(r||o<1)&&e(`fill-opacity`,o)}else e(`fill`,KQ);if(oj(t)){var s=dc(t.stroke);e(`stroke`,s.color);var c=t.strokeNoScale?n.getLineScale():1,l=c?(t.lineWidth||0)/c:0,u=t.strokeOpacity==null?s.opacity*i:t.strokeOpacity*s.opacity*i,d=t.strokeFirst;if((r||l!==1)&&e(`stroke-width`,l),(r||d)&&e(`paint-order`,d?`stroke`:`fill`),(r||u<1)&&e(`stroke-opacity`,u),t.lineDash){var f=nC(n),p=f[0],m=f[1];p&&(m=qQ(m||0),e(`stroke-dasharray`,p.join(`,`)),(m||r)&&e(`stroke-dashoffset`,m))}else r&&e(`stroke-dasharray`,KQ);for(var h=0;h<JQ.length;h++){var g=JQ[h];if(r||t[g]!==GL[g]){var _=t[g]||GL[g];_&&e(YQ[h],_)}}}else r&&e(`stroke`,KQ)}}function cj(e){return document.createElementNS(XQ,e)}function lj(e,t,n,r,i){return{tag:e,attrs:n||{},children:r,text:i,key:t}}function uj(e,t){var n=[];if(t)for(var r in t){var i=t[r],a=r;i!==!1&&(i!==!0&&i!=null&&(a+=`="`+i+`"`),n.push(a))}return`<`+e+` `+n.join(` `)+`>`}function dj(e){return`</`+e+`>`}function fj(e,t){t||={};var n=t.newline?`
30
30
  `:``;function r(e){var t=e.children,i=e.tag,a=e.attrs,o=e.text;return uj(i,a)+(i===`style`?o||``:km(o))+(t?``+n+R(t,function(e){return r(e)}).join(n)+n:``)+dj(i)}return r(e)}function pj(e,t,n){n||={};var r=n.newline?`
31
- `:``,i=` {`+r,a=r+`}`,o=R(Ba(e),function(t){return t+i+R(Ba(e[t]),function(n){return n+`:`+e[t][n]+`;`}).join(r)+a}).join(r),s=R(Ba(t),function(e){return`@keyframes `+e+i+R(Ba(t[e]),function(n){return n+i+R(Ba(t[e][n]),function(r){var i=t[e][n][r];return r===`d`&&(i=`path("`+i+`")`),r+`:`+i+`;`}).join(r)+a}).join(r)+a}).join(r);return!o&&!s?``:[`<![CDATA[`,o,s,`]]>`].join(r)}function mj(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function hj(e,t,n,r){return lj(`svg`,`root`,{width:e,height:t,xmlns:XQ,"xmlns:xlink":ZQ,version:`1.1`,baseProfile:`full`,viewBox:r?`0 0 `+e+` `+t:!1},n)}function gj(){return t$++}function _j(e,t,n){var r=I({},e.shape);I(r,t),e.buildPath(n,r);var i=new GQ;return i.reset(Ec(e)),n.rebuildPath(i,1),i.generateStr(),i.getStr()}function vj(e,t){var n=t.originX,r=t.originY;(n||r)&&(e[r$]=n+`px `+r+`px`)}function yj(e,t){var n=t.zrId+`-ani-`+t.cssAnimIdx++;return t.cssAnims[n]=e,n}function bj(e,t,n){var r=e.shape.paths,i={},a,o;if(L(r,function(e){var t=mj(n.zrId);t.animation=!0,Sj(e,{},t,!0);var r=t.cssAnims,s=t.cssNodes,c=Ba(r),l=c.length;if(l){o=c[l-1];var u=r[o];for(var d in u){var f=u[d];i[d]=i[d]||{d:``},i[d].d+=f.d||``}for(var p in s){var m=s[p].animation;m.indexOf(o)>=0&&(a=m)}}}),a){t.d=!1;var s=yj(i,n);return a.replace(o,s)}}function xj(e){return V(e)?n$[e]?`cubic-bezier(`+n$[e]+`)`:Us(e)?e:``:``}function Sj(e,t,n,r){var i=e.animators,a=i.length,o=[];if(e instanceof eB){var s=bj(e,t,n);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var c={},l=0;l<a;l++){var u=i[l],d=[u.getMaxTime()/1e3+`s`],f=xj(u.getClip().easing),p=u.getDelay();f?d.push(f):d.push(`linear`),p&&d.push(p/1e3+`s`),u.getLoop()&&d.push(`infinite`);var m=d.join(` `);c[m]=c[m]||[m,[]],c[m][1].push(u)}function h(i){var a=i[1],o=a.length,s={},c={},l={},u=`animation-timing-function`;function d(e,t,n){for(var r=e.getTracks(),i=e.getMaxTime(),a=0;a<r.length;a++){var o=r[a];if(o.needsAnimate()){var s=o.keyframes,c=o.propName;if(n&&(c=n(c)),c)for(var l=0;l<s.length;l++){var d=s[l],f=Math.round(d.time/i*100)+`%`,p=xj(d.easing),m=d.rawValue;(V(m)||Wa(m))&&(t[f]=t[f]||{},t[f][c]=d.rawValue,p&&(t[f][u]=p))}}}}for(var f=0;f<o;f++){var p=a[f],m=p.targetName;m?m===`shape`&&d(p,c):!r&&d(p,s)}for(var h in s){var g={};Es(g,e),I(g,s[h]);var _=Dc(g),v=s[h][u];l[h]=_?{transform:_}:{},vj(l[h],g),v&&(l[h][u]=v)}var y,b=!0;for(var h in c){l[h]=l[h]||{};var x=!y,v=c[h][u];x&&(y=new LL);var S=y.len();y.reset(),l[h].d=_j(e,c[h],y);var C=y.len();if(!x&&S!==C){b=!1;break}v&&(l[h][u]=v)}if(!b)for(var h in l)delete l[h].d;if(!r)for(var f=0;f<o;f++){var p=a[f],m=p.targetName;m===`style`&&d(p,l,function(e){return i$[e]})}for(var w=Ba(l),T=!0,E,f=1;f<w.length;f++){var D=w[f-1],O=w[f];if(l[D][r$]!==l[O][r$]){T=!1;break}E=l[D][r$]}if(T&&E){for(var h in l)l[h][r$]&&delete l[h][r$];t[r$]=E}if(Ra(w,function(e){return Ba(l[e]).length>0}).length)return yj(l,n)+` `+i[0]+` both`}for(var g in c){var s=h(c[g]);s&&o.push(s)}if(o.length){var _=n.zrId+`-cls-`+gj();n.cssNodes[`.`+_]={animation:o.join(`,`)},t.class=_}}function Cj(e,t,n){if(!e.ignore){if(e.isSilent()){var r={"pointer-events":`none`};wj(r,t,n,!0)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,c=e.currentStates.indexOf(`select`)>=0&&s||o;c&&(a=uc(c))}var l=i.lineWidth;if(l){var u=!i.strokeNoScale&&e.transform?e.transform[0]:1;l/=u}var r={cursor:`pointer`};a&&(r.fill=a),i.stroke&&(r.stroke=i.stroke),l&&(r[`stroke-width`]=l),wj(r,t,n,!0)}}}function wj(e,t,n,r){var i=JSON.stringify(e),a=n.cssStyleCache[i];a||(a=n.zrId+`-cls-`+gj(),n.cssStyleCache[i]=a,n.cssNodes[`.`+a+(r?`:hover`:``)]=e),t.class=t.class?t.class+` `+a:a}function Tj(e){return e&&V(e.src)}function Ej(e){return e&&B(e.toDataURL)}function Dj(e,t,n,r){sj(function(i,a){var o=i===`fill`||i===`stroke`;o&&wc(a)?Vj(t,e,i,r):o&&xc(a)?Hj(n,e,i,r):e[i]=a,o&&r.ssr&&a===`none`&&(e[`pointer-events`]=`visible`)},t,n,!1),Bj(n,e,r)}function Oj(e,t){var n=Xx(t);n&&(n.each(function(t,n){t!=null&&(e[(`ecmeta_`+n).toLowerCase()]=t+``)}),t.isSilent()&&(e[e$+`silent`]=`true`))}function kj(e){return fc(e[0]-1)&&fc(e[1])&&fc(e[2])&&fc(e[3]-1)}function Aj(e){return fc(e[4])&&fc(e[5])}function jj(e,t,n){if(t&&!(Aj(t)&&kj(t))){var r=n?10:1e4;e.transform=kj(t)?`translate(`+a$(t[4]*r)/r+` `+a$(t[5]*r)/r+`)`:hc(t)}}function Mj(e,t,n){for(var r=e.points,i=[],a=0;a<r.length;a++)i.push(a$(r[a][0]*n)/n),i.push(a$(r[a][1]*n)/n);t.points=i.join(` `)}function Nj(e){return!e.smooth}function Pj(e){var t=R(e,function(e){return typeof e==`string`?[e,e]:e});return function(e,n,r){for(var i=0;i<t.length;i++){var a=t[i],o=e[a[0]];o!=null&&(n[a[1]]=a$(o*r)/r)}}}function Fj(e){for(var t=e.animators,n=0;n<t.length;n++)if(t[n].targetName===`shape`)return!0;return!1}function Ij(e,t){var n=e.style,r=e.shape,i=o$[e.type],a={},o=t.animation,s=`path`,c=e.style.strokePercent,l=t.compress&&Ec(e)||4;if(i&&!t.willUpdate&&(!i[1]||i[1](r))&&!(o&&Fj(e))&&!(c<1)){s=e.type;var u=10**l;i[0](r,a,u)}else{var d=!e.path||e.shapeChanged();e.path||e.createPathProxy();var f=e.path;d&&(f.beginPath(),e.buildPath(f,e.shape),e.pathUpdated());var p=f.getVersion(),m=e,h=m.__svgPathBuilder;m.__svgPathVersion===p&&h&&c===m.__svgPathStrokePercent||(h||=m.__svgPathBuilder=new GQ,h.reset(l),f.rebuildPath(h,c),h.generateStr(),m.__svgPathVersion=p,m.__svgPathStrokePercent=c),a.d=h.getStr()}return jj(a,e.transform),Dj(a,n,e,t),Oj(a,e),t.animation&&Sj(e,a,t),t.emphasis&&Cj(e,a,t),lj(s,e.id+``,a)}function Lj(e,t){var n=e.style,r=n.image;if(r&&!V(r)&&(Tj(r)?r=r.src:Ej(r)&&(r=r.toDataURL())),r){var i=n.x||0,a=n.y||0,o=n.width,s=n.height,c={href:r,width:o,height:s};return i&&(c.x=i),a&&(c.y=a),jj(c,e.transform),Dj(c,n,e,t),Oj(c,e),t.animation&&Sj(e,c,t),lj(`image`,e.id+``,c)}}function Rj(e,t){var n=e.style,r=n.text;if(r!=null&&(r+=``),!(!r||isNaN(n.x)||isNaN(n.y))){var i=n.font||`12px sans-serif`,a=n.x||0,o=gc(n.y||0,os(i),n.textBaseline),s={"dominant-baseline":`central`,"text-anchor":AI[n.textAlign]||n.textAlign};if(wl(n)){var c=``,l=n.fontStyle,u=Sl(n.fontSize);if(!parseFloat(u))return;var d=n.fontFamily||`sans-serif`,f=n.fontWeight;c+=`font-size:`+u+`;font-family:`+d+`;`,l&&l!==`normal`&&(c+=`font-style:`+l+`;`),f&&f!==`normal`&&(c+=`font-weight:`+f+`;`),s.style=c}else s.style=`font: `+i;return r.match(/\s/)&&(s[`xml:space`]=`preserve`),a&&(s.x=a),o&&(s.y=o),jj(s,e.transform),Dj(s,n,e,t),Oj(s,e),t.animation&&Sj(e,s,t),lj(`text`,e.id+``,s,void 0,r)}}function zj(e,t){if(e instanceof JL)return Ij(e,t);if(e instanceof $L)return Lj(e,t);if(e instanceof XL)return Rj(e,t)}function Bj(e,t,n){var r=e.style;if(_c(r)){var i=vc(e),a=n.shadowCache,o=a[i];if(!o){var s=e.getGlobalScale(),c=s[0],l=s[1];if(!c||!l)return;var u=r.shadowOffsetX||0,d=r.shadowOffsetY||0,f=r.shadowBlur,p=dc(r.shadowColor),m=p.opacity,h=p.color,g=f/2/c,_=f/2/l,v=g+` `+_;o=n.zrId+`-s`+n.shadowIdx++,n.defs[o]=lj(`filter`,o,{id:o,x:`-100%`,y:`-100%`,width:`300%`,height:`300%`},[lj(`feDropShadow`,``,{dx:u/c,dy:d/l,stdDeviation:v,"flood-color":h,"flood-opacity":m})]),a[i]=o}t.filter=Tc(o)}}function Vj(e,t,n,r){var i=e[n],a,o={gradientUnits:i.global?`userSpaceOnUse`:`objectBoundingBox`};if(Sc(i))a=`linearGradient`,o.x1=i.x,o.y1=i.y,o.x2=i.x2,o.y2=i.y2;else if(Cc(i))a=`radialGradient`,o.cx=U(i.x,.5),o.cy=U(i.y,.5),o.r=U(i.r,.5);else return;for(var s=i.colorStops,c=[],l=0,u=s.length;l<u;++l){var d=mc(s[l].offset)*100+`%`,f=s[l].color,p=dc(f),m=p.color,h=p.opacity,g={offset:d};g[`stop-color`]=m,h<1&&(g[`stop-opacity`]=h),c.push(lj(`stop`,l+``,g))}var _=fj(lj(a,``,o,c)),v=r.gradientCache,y=v[_];y||(y=r.zrId+`-g`+r.gradientIdx++,v[_]=y,o.id=y,r.defs[y]=lj(a,y,o,c)),t[n]=Tc(y)}function Hj(e,t,n,r){var i=e.style[n],a=e.getBoundingRect(),o={},s=i.repeat,c=s===`no-repeat`,l=s===`repeat-x`,u=s===`repeat-y`,d;if(yc(i)){var f=i.imageWidth,p=i.imageHeight,m=void 0,h=i.image;if(V(h)?m=h:Tj(h)?m=h.src:Ej(h)&&(m=h.toDataURL()),typeof Image>`u`){var g=`Image width/height must been given explictly in svg-ssr renderer.`;to(f,g),to(p,g)}else if(f==null||p==null){var _=function(e,t){if(e){var n=e.elm,r=f||t.width,i=p||t.height;e.tag===`pattern`&&(l?(i=1,r/=a.width):u&&(r=1,i/=a.height)),e.attrs.width=r,e.attrs.height=i,n&&(n.setAttribute(`width`,r),n.setAttribute(`height`,i))}},v=Co(m,null,e,function(e){c||_(S,e),_(d,e)});v&&v.width&&v.height&&(f||=v.width,p||=v.height)}d=lj(`image`,`img`,{href:m,width:f,height:p}),o.width=f,o.height=p}else i.svgElement&&(d=ka(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(d){var y,b;c?y=b=1:l?(b=1,y=o.width/a.width):u?(y=1,b=o.height/a.height):o.patternUnits=`userSpaceOnUse`,y!=null&&!isNaN(y)&&(o.width=y),b!=null&&!isNaN(b)&&(o.height=b);var x=Dc(i);x&&(o.patternTransform=x);var S=lj(`pattern`,``,o,[d]),C=fj(S),w=r.patternCache,T=w[C];T||(T=r.zrId+`-p`+r.patternIdx++,w[C]=T,o.id=T,S=r.defs[T]=lj(`pattern`,T,o,[d])),t[n]=Tc(T)}}function Uj(e,t,n){var r=n.clipPathCache,i=n.defs,a=r[e.id];if(!a){a=n.zrId+`-c`+n.clipPathIdx++;var o={id:a};r[e.id]=a,i[a]=lj(`clipPath`,a,o,[Ij(e,n)])}t[`clip-path`]=Tc(a)}function Wj(e){return document.createTextNode(e)}function Gj(e,t,n){e.insertBefore(t,n)}function Kj(e,t){e.removeChild(t)}function qj(e,t){e.appendChild(t)}function Jj(e){return e.parentNode}function Yj(e){return e.nextSibling}function Xj(e,t){e.textContent=t}function Zj(e){return e===void 0}function Qj(e){return e!==void 0}function pee(e,t,n){for(var r={},i=t;i<=n;++i){var a=e[i].key;a!==void 0&&(r[a]=i)}return r}function $j(e,t){var n=e.key===t.key;return e.tag===t.tag&&n}function eM(e){var t,n=e.children,r=e.tag;if(Qj(r)){var i=e.elm=cj(r);if(rM(l$,e),z(n))for(t=0;t<n.length;++t){var a=n[t];a!=null&&qj(i,eM(a))}else Qj(e.text)&&!H(e.text)&&qj(i,Wj(e.text))}else e.elm=Wj(e.text);return e.elm}function tM(e,t,n,r,i){for(;r<=i;++r){var a=n[r];a!=null&&Gj(e,eM(a),t)}}function nM(e,t,n,r){for(;n<=r;++n){var i=t[n];i!=null&&(Qj(i.tag)?Kj(Jj(i.elm),i.elm):Kj(e,i.elm))}}function rM(e,t){var n,r=t.elm,i=e&&e.attrs||{},a=t.attrs||{};if(i!==a){for(n in a){var o=a[n];i[n]!==o&&(o===!0?r.setAttribute(n,``):o===!1?r.removeAttribute(n):n===`style`?r.style.cssText=o:n.charCodeAt(0)===c$?n===`xmlns:xlink`||n===`xmlns`?r.setAttributeNS(QQ,n,o):n.charCodeAt(3)===s$?r.setAttributeNS($Q,n,o):n.charCodeAt(5)===s$?r.setAttributeNS(ZQ,n,o):r.setAttribute(n,o):r.setAttribute(n,o))}for(n in i)n in a||r.removeAttribute(n)}}function mee(e,t,n){for(var r=0,i=0,a=t.length-1,o=t[0],s=t[a],c=n.length-1,l=n[0],u=n[c],d,f,p,m;r<=a&&i<=c;)o==null?o=t[++r]:s==null?s=t[--a]:l==null?l=n[++i]:u==null?u=n[--c]:$j(o,l)?(iM(o,l),o=t[++r],l=n[++i]):$j(s,u)?(iM(s,u),s=t[--a],u=n[--c]):$j(o,u)?(iM(o,u),Gj(e,o.elm,Yj(s.elm)),o=t[++r],u=n[--c]):$j(s,l)?(iM(s,l),Gj(e,s.elm,o.elm),s=t[--a],l=n[++i]):(Zj(d)&&(d=pee(t,r,a)),f=d[l.key],Zj(f)?Gj(e,eM(l),o.elm):(p=t[f],p.tag===l.tag?(iM(p,l),t[f]=void 0,Gj(e,p.elm,o.elm)):Gj(e,eM(l),o.elm)),l=n[++i]);(r<=a||i<=c)&&(r>a?(m=n[c+1]==null?null:n[c+1].elm,tM(e,m,n,i,c)):nM(e,t,r,a))}function iM(e,t){var n=t.elm=e.elm,r=e.children,i=t.children;e!==t&&(rM(e,t),Zj(t.text)?Qj(r)&&Qj(i)?r!==i&&mee(n,r,i):Qj(i)?(Qj(e.text)&&Xj(n,``),tM(n,null,i,0,i.length-1)):Qj(r)?nM(n,r,0,r.length-1):Qj(e.text)&&Xj(n,``):e.text!==t.text&&(Qj(r)&&nM(n,r,0,r.length-1),Xj(n,t.text)))}function hee(e,t){if($j(e,t))iM(e,t);else{var n=e.elm,r=Jj(n);eM(t),r!==null&&(Gj(r,t.elm,Yj(n)),nM(r,[e],0,0))}return t}function gee(e){return function(){}}function _ee(e,t,n,r){var i;if(n&&n!==`none`){if(i=lj(`rect`,`bg`,{width:e,height:t,x:`0`,y:`0`}),wc(n))Vj({fill:n},i.attrs,`fill`,r);else if(xc(n))Hj({style:{fill:n},dirty:co,getBoundingRect:function(){return{width:e,height:t}}},i.attrs,`fill`,r);else{var a=dc(n),o=a.color,s=a.opacity;i.attrs.fill=o,s<1&&(i.attrs[`fill-opacity`]=s)}}return i}function vee(e){e.registerPainter(`svg`,d$)}function aM(e,t,n){var r=GP.createCanvas(),i=t.getWidth(),a=t.getHeight(),o=r.style;return o&&(o.position=`absolute`,o.left=`0`,o.top=`0`,o.width=i+`px`,o.height=a+`px`,r.setAttribute(`data-zr-dom-id`,e)),r.width=i*n,r.height=a*n,r}function oM(e){return!e.__cursors.get(0)}function sM(e){var t=e.__cursors.get(0);return{startIdx:t?t.startIdx:0,endIdx:t?t.endIdx:0}}function cM(e){return e?e.__builtin__?!0:typeof e.resize==`function`&&typeof e.refresh==`function`:!1}function lM(e,t){var n=document.createElement(`div`);return n.style.cssText=[`position:relative`,`width:`+e+`px`,`height:`+t+`px`,`padding:0`,`margin:0`,`border-width:0`].join(`;`)+`;`,n}function uM(e,t,n,r){var i=new f$(e,t,t.dpr);return i.zlevel=n,i.zlevel2=r,i.__builtin__=!0,dM(i),i}function dM(e){e.__cursorStack=[],e.__cursors=W()}function fM(e){return e.startIdx=e.drawIdx=e.endIdx=e.endIdxNew=0,e.used=!1,e.first=e.last=NaN,e.notClearIdx=-1,e}function pM(e,t){var n=e.__cursors,r=+t;return n.get(r)||(e.__cursorStack.push(r),n.set(r,fM({key:r})))}function mM(e,t){for(var n=e.__cursorStack,r=0;r<n.length;r++)t(e.__cursors.get(n[r]))}function hM(e,t){var n=e.layers;return n[t]||(n[t]=[,,,])}function gM(e,t,n){for(var r=e.layerStack,i=0;i<r.length;i++){var a=r[i].zl,o=r[i].zl2,s=e.layers[a][o];n&&(n&v$&&!s.__builtin__||n&y$&&s.__builtin__||n&b$&&s===e.hoverlayer)||t(s,a,o,i)}}function _M(e){e.registerPainter(`canvas`,S$)}function vM(e,...t){console.warn(e,...t)}function yM(e,...t){console.error(e,...t)}function bM(e,t){if(e==null)throw Error(t);return e}function xM(e,t){let n=O$.get(e);if(n===void 0)return t;let r=A$.get(e);if(r!==void 0&&r.version===k$&&r.english===t&&EM(r.merged,t))return r.merged;let i=TM(e,n,t);return A$.set(e,{version:k$,english:t,merged:i}),i}function SM(){return E$}function CM(e,t){return e.replace(D$,(e,n)=>Object.hasOwn(t,n)?String(t[n]):e)}function wM(e,t,n,r){let i=`${t}Other`;if(!Object.hasOwn(e,i))throw RangeError(`Plural text ${t} has no ${i} key; every plural needs its Other form.`);let a=new Intl.PluralRules(SM()).select(n),o=`${t}${a.charAt(0).toUpperCase()}${a.slice(1)}`,s=e[Object.hasOwn(e,o)?o:i];if(s===void 0)throw RangeError(`Plural text ${t} has no ${o} key.`);return CM(s,{count:n,...r})}function TM(e,t,n){let r={};for(let[i,a]of Object.entries(t)){let t=Object.hasOwn(n,i)?n[i]:void 0;if(t===void 0)throw RangeError(`Text ${e}.${i} is not a key of the English text. Allowed keys: ${Object.keys(n).join(`, `)}.`);let o=DM(t);for(let t of DM(a))if(!o.includes(t))throw RangeError(`Text ${e}.${i} uses {${t}}, which the English text does not have. Allowed placeholders: ${o.length===0?`none`:o.map(e=>`{${e}}`).join(`, `)}.`);r[i]=a}return Object.assign({},n,r)}function EM(e,t){let n=Object.keys(t);return Object.keys(e).length===n.length&&n.every(t=>Object.hasOwn(e,t))}function DM(e){return Array.from(e.matchAll(D$),e=>e[1]??``)}function OM(e){let t=P$.get(e);return t||(t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),P$.set(e,t)),t}function kM(e){if(typeof e!=`string`||e===``)return!1;try{return OM(e),!0}catch{return!1}}function AM(e,t=M$){if(t===`Asia/Kolkata`){let t=new Date(e+N$);return{year:t.getUTCFullYear(),month:t.getUTCMonth(),day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds()}}let n=Object.fromEntries(OM(t).formatToParts(e).map(e=>[e.type,Number(e.value)]));return{year:Number(n.year),month:Number(n.month)-1,day:Number(n.day),hour:Number(n.hour)%24,minute:Number(n.minute),second:Number(n.second)}}function jM(e,t=M$){if(t===`Asia/Kolkata`)return N$;let n=AM(e,t),r=new Date(0);return r.setUTCFullYear(n.year,n.month,n.day),r.setUTCHours(n.hour,n.minute,n.second,0),r.getTime()-Math.floor(e/1e3)*1e3}function MM(e,t=M$){let n=e-jM(e,t);return n=e-jM(n,t),n}function NM(e,t){return W$(U$[t],e)}function PM(e){if(!Number.isInteger(e))throw Error(`A paise amount must be a whole number, got ${e}`);let t=BigInt(Math.abs(e)).toString().padStart(3,`0`);return`${e<0?`-`:``}${t.slice(0,-2)}.${t.slice(-2)}`}function FM(e,{decimals:t}={}){if(!t1(e))return B$();let n=Q$(X$(t,2)).format(Math.abs(e));return n===`0`?`0`:n1(e)+n}function IM(e,t){if(!t?.currency)throw TypeError(`[@webority/ui-elements] formatCurrency needs options.currency, an ISO 4217 code such as "INR".`);if(!t1(e))return B$();let{unit:n=`rupees`,decimals:r,currency:i}=t,a=X$(r,0),o=Y$(i),s=n===`paise`?a1(Math.abs(e),a,o):e1(a,o).format(Math.abs(e));return(Number(s.replace(/,/g,``))===0?``:n1(e))+T$(i)+s}function LM(e,{currency:t,unit:n=`rupees`}={}){if(!t1(e))return B$();let r=t?r1(e,n):e,i=t?T$(t):``,a=t?Y$(t):`en-IN`,o=a===`en-IN`?q$:J$,s=Math.abs(r),c=o.findIndex(([e])=>s>=e);if(c===-1){let e=Q$(o1(s),a).format(s);if(e!==`1,000`)return(e===`0`?``:n1(r))+i+e;c=o.length-1}let[l,u]=K$(o,c),d=s/l,f=d>=100?0:d>=10?1:2,p=Number(d.toFixed(f));return p>=100&&c>0&&(--c,[l,u]=K$(o,c),d=s/l,f=d>=100?0:d>=10?1:2,p=Number(d.toFixed(f))),`${n1(r)}${i}${Q$(f,a).format(p)} ${u}`}function RM(e,{decimals:t}={}){return t1(e)?`${FM(e*100,{decimals:X$(t,1)})}%`:B$()}function zM(e,{unit:t=`s`}={}){if(!t1(e))return B$();let n=s1[t]??1e3,r=Math.abs(e*n),i=n1(e);if(Math.round(r)<1e3)return`${i}${Q$(0).format(r)} ms`;let a=r/1e3;if(a<10)return`${i}${Q$(1).format(a)}s`;let o=Math.round(a);if(o<60)return`${i}${o}s`;let s=e=>String(e).padStart(2,`0`),c=Math.floor(o/60);if(c<60)return`${i}${c}m ${s(o%60)}s`;let l=Math.floor(c/60);return`${i}${Q$(0).format(l)}h ${s(c%60)}m`}function BM(e,t=M$){if(e instanceof Date)return e.getTime();if(t1(e))return e;if(typeof e!=`string`)return NaN;let n=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());if(n){let[e,r,i]=[Number(n[1]),Number(n[2]),Number(n[3])],a=new Date(Date.UTC(2e3,r-1,i));return a.setUTCFullYear(e),a.getUTCFullYear()===e&&a.getUTCMonth()===r-1&&a.getUTCDate()===i?MM(a.getTime(),t):NaN}return Date.parse(e)}function VM(e,t=M$){let{year:n,month:r,day:i,hour:a,minute:o}=AM(e,t);return{year:n,month:r,day:i,hour:a,minute:o}}function HM(e,{pattern:t=`day`,timeZone:n=M$}={}){let r=BM(e,n);if(!Number.isFinite(r))return B$();let i=VM(r,n),a=e=>String(e).padStart(2,`0`),o=`${a(i.day)}-${G$(i.month)}-${i.year}`,s=`${a(i.hour)}:${a(i.minute)}`;switch(t){case`month`:return`${G$(i.month)}-${i.year}`;case`year`:return String(i.year);case`datetime`:return`${o} ${s}`;case`time`:return s;default:return o}}function UM(e,{timeZone:t=M$}={}){let n=BM(e,t);if(!Number.isFinite(n))return B$();let r=VM(n,t);return`${String(r.day).padStart(2,`0`)}-${G$(r.month)}`}function G(e,t){if(e==null||e===``)return B$();let n=t?.style;if(n===`date`)return HM(e,t);if(typeof e!=`number`)return String(e);switch(n){case`currency`:return IM(e,{...t,currency:t?.currency??``});case`percent`:return RM(e,t);case`compact`:return LM(e,t);case`duration`:return zM(e,t);default:return FM(e,t)}}function WM(e){let t=e?.style;if(t===`currency`){if(!e?.currency)throw TypeError(`[@webority/ui-elements] a currency format needs a currency, an ISO 4217 code such as "INR".`);return{style:`compact`,currency:e.currency,unit:e.unit}}return!t||t===`number`?{style:`compact`}:e??{}}function GM(e){R1.has(e)||(R1.add(e),vM(`[@webority/ui-elements] <wui-chart> ${e}`))}function KM(e,t){if(e==null)throw Error(`${t} missing`);return e}function qM(e,t,n){t==null||n.includes(t)||GM(`received ${e}="${String(t)}", which is not one of ${z1(n)}. The chart uses its default instead.`)}function JM(e,t,n){for(let r of Object.keys(t))n.includes(r)||(/^(y2|secondary)/i.test(r)?GM(`ignores ${e}.${r}: a chart has one value axis by design. Show the second measure as its own chart.`):GM(`ignores the unknown key ${e}.${r}. Known keys: ${n.join(`, `)}.`))}function YM(e,t){if(t==null)return;if(typeof t!=`object`){GM(`expects ${e} to be an object such as { style: "currency" }.`);return}JM(e,t,I1);let n=H1(t,`style`);qM(`${e}.style`,n,F$);let r=H1(t,`currency`);r!=null&&!w$(r)&&GM(`received ${e}.currency="${String(r)}", which is not an ISO 4217 code such as "INR", so the format has no currency.`);let i=H1(t,`unit`);i!=null&&qM(`${e}.unit`,i,n===`duration`?L$:I$);let a=H1(t,`pattern`);qM(`${e}.pattern`,a,R$);let o=H1(t,`decimals`);o!=null&&!(typeof o==`number`&&Number.isInteger(o)&&o>=0&&o<=20)&&GM(`received ${e}.decimals=${String(o)}, which is not a whole number from 0 to 20. The chart uses its default instead.`);let s={style:G1(F$,n)?n:`number`};return typeof r==`string`&&w$(r)&&(s.currency=r),G1(L1,i)&&(s.unit=i),typeof o==`number`&&(s.decimals=o),G1(R$,a)&&(s.pattern=a),s}function XM(e){let t=(e,t=Q().errorText)=>(yM(`[@webority/ui-elements] <wui-chart> ${e}`),{spec:null,problem:t});if(!V1(e))return t('has no spec: set the `spec` property or add a <script type="application/json"> child.');let n=e;JM(`spec`,n,D1);let r=H1(n,`type`);if(qM(`type`,r,l1),!G1(l1,r))return t(`cannot draw type "${String(r)}".`);let i=r,a=H1(n,`title`);typeof a==`string`&&a.trim()||GM("needs a `title`: it names the chart for screen readers and names exported files.");for(let[e,t]of Object.entries(S1))H1(n,e)!=null&&!t.includes(i)&&GM(`ignores spec.${e} on a ${i} chart: it applies to ${t.join(`, `)}.`);let o=H1(n,`x`),s=V1(o)?o:{};JM(`spec.x`,s,O1);let c=x1[i]??[`category`],l=H1(s,`kind`);qM(`x.kind`,l,d1),G1(d1,l)&&!c.includes(l)&&GM(`ignores x.kind="${l}" on a ${i} chart: it takes ${z1(c)}.`);let u=H1(s,`labelFit`);qM(`x.labelFit`,u,k1);let d=YM(`x.format`,H1(s,`format`)),f=H1(s,`key`);typeof f!=`string`&&i!==`gauge`&&GM("needs `x.key`, the column holding each row's x value or slice name.");let p=typeof f==`string`?f:``,m=H1(n,`y`),h=V1(m)?m:{};JM(`spec.y`,h,P1);let g=YM(`y.format`,H1(h,`format`)),_=H1(n,`series`),v=Array.isArray(_)?_.filter(V1):[],y=[];for(let[e,t]of v.entries()){JM(`spec.series[${e}]`,t,A1);let n=YM(`series[${e}].format`,H1(t,`format`)),r=H1(t,`key`);typeof r!=`string`&&GM(`needs series[${e}].key, the column holding that series' values.`);let i=H1(t,`label`);y.push({key:String(r),named:typeof r==`string`,label:typeof i==`string`&&i?i:String(r),format:n})}let b=y[0];if(!b)return t(`has no series to draw.`);let x=y.filter(e=>e.named).map(e=>e.key),S=x.find((e,t)=>x.indexOf(e)!==t);if(S!==void 0)return t(`has two series with the key "${S}": each series needs its own key.`);if(y.length>8)return t(`refuses ${y.length} series: 8 is the most that stay distinguishable. Fold the smallest into an Other series, or split the chart.`,Q().tooManySeriesText);let C=v1(i);if(C&&y.length>1){let e=i===`donut`?`Compare parts across groups with a percent-stacked column instead.`:`Show the other measures as their own charts, or use small multiples.`;GM(`draws one series as a ${i}; it got ${y.length} and shows the first. ${e}`)}let w=(e,t,n,r)=>{if(t==null)return null;if(!V1(t))return GM(`expects ${e} to be an object such as { key: "column" }.`),null;JM(e,t,n);let i=H1(t,`key`);if(typeof i!=`string`)return GM(`needs ${e}.key, the column holding ${r}.`),null;let a=YM(`${e}.format`,H1(t,`format`)),o=H1(t,`label`);return{key:i,label:typeof o==`string`?o:``,format:a}},T=S1.group.includes(i)?w(`spec.group`,H1(n,`group`),j1,`each row's group`):null,E=i===`sankey`?w(`spec.to`,H1(n,`to`),j1,`where each flow ends`):null,D=i===`bubble`?w(`spec.size`,H1(n,`size`),M1,`each bubble's size`):null;if((i===`heatmap`||i===`treemap`)&&!T)return t(`needs \`group.key\` to draw a ${i}: the column holding each ${i===`heatmap`?`row`:`parent`}.`);if(i===`sankey`&&!E)return t("needs `to.key` to draw a sankey: the column holding where each flow ends.");if(i===`bubble`&&!D)return t("needs `size.key` to draw a bubble chart: the column holding each bubble's size.");let O=y1.includes(i)?u1:[`none`],k=H1(n,`stack`);qM(`stack`,k,O);let A=H1(n,`state`);qM(`state`,A,p1);let j=H1(n,`renderer`);qM(`renderer`,j,f1);let M=H1(n,`timeZone`);M!=null&&!kM(M)&&GM(`received timeZone="${String(M)}", which is not a time zone this browser knows. The chart uses Asia/Kolkata instead.`);let ee=kM(M)?M:M$,te=H1(n,`target`),ne=V1(te)?H1(te,`value`):void 0;te!=null&&(V1(te)&&JM(`spec.target`,te,F1),V1(te)&&B1(ne)||GM("ignores a `target` without a numeric `value`."));let re=H1(n,`trend`);re!=null&&typeof re!=`boolean`&&GM("expects `trend` to be true or false.");let ie=H1(n,`zoom`);ie!=null&&typeof ie!=`boolean`&&GM("expects `zoom` to be true or false.");let ae=[],oe=H1(n,`bands`);if(i===`gauge`&&oe!=null){let e=Array.isArray(oe)?oe.filter(V1):[];for(let t of e)JM(`spec.bands[]`,t,N1);ae=e.map(e=>({upTo:H1(e,`upTo`),label:H1(e,`label`)})).filter(e=>B1(e.upTo)&&typeof e.label==`string`&&e.label!==``).sort((e,t)=>e.upTo-t.upTo),Array.isArray(oe)&&ae.length===e.length||GM("ignores a gauge band without a numeric `upTo` and a `label`.")}let se=g??b.format,ce=(C?y.slice(0,1):y).map(e=>({key:e.key,label:e.label,format:e.format??se})),le=G1(c,l)?l:c[0],ue=H1(n,`data`),de=Array.isArray(ue)?ue:[],fe=de.filter(V1).map(W1),pe=-1,me=null,he=b.key;i===`donut`&&fe.length>6&&(me=fe,{data:fe,otherIndex:pe}=$M(fe,p,he),GM(`draws at most 6 donut slices; the smallest ${de.length-5} are shown as "${Q().otherLabel}". Send fewer rows, or use a bar chart for many parts.`));let N=(e,t)=>{let n=fe.filter(e);n.length!==fe.length&&GM(`leaves out ${fe.length-n.length} row(s) ${t}.`),fe=n},ge=e=>e!=null&&e!==``,_e=e=>B1(e)&&e>0;if(le===`time`&&b1.includes(i)&&N(e=>Number.isFinite(BM(e[p],ee)),`without a readable date`),i===`gauge`&&fe.length>1)GM(`draws one value as a gauge; it got ${fe.length} rows and shows the first.`),fe=fe.slice(0,1);else if(i===`scatter`||i===`bubble`){N(e=>B1(e[p])&&B1(e[he])&&(i!==`bubble`||D!=null&&_e(e[D.key])),`without a number for x and y (and a positive size)`);let e=new Set(T?fe.map(e=>String(e[T.key]??``)):[]);if(e.size>3)return t(`refuses ${e.size} colour groups on a ${i} chart: 3 is the most that stay tellable apart. Keep the three that matter and fold the rest into one, or split the chart.`,Q().tooManyGroupsText)}else if(i===`calendar`)N(e=>Number.isFinite(BM(e[p],ee)),`without a readable date`);else if(i===`heatmap`&&T)N(e=>ge(e[p])&&ge(e[T.key]),`without a column or a row`);else if(i===`treemap`&&T){N(e=>ge(e[p])&&ge(e[T.key])&&_e(e[he]),`without a name, a parent and a positive size`);let e=new Set(fe.map(e=>String(e[T.key])));if(e.size>8)return t(`refuses ${e.size} parents in a treemap: 8 is the most that keep their own colour. Fold the smallest into one, or split the chart.`,Q().tooManyGroupsText)}else if(i===`sankey`&&E){N(e=>ge(e[p])&&ge(e[E.key])&&_e(e[he]),`without a start, an end and a positive size`);let e=ZM(fe,p,E.key);if(e)return t(e.reason,e.text)}else if(i===`waterfall`){let e=QM(fe,he);if(e?.refuse)return t(e.refuse);e?.warn&&GM(e.warn)}let ve=H1(n,`height`),ye=B1(ve)&&ve>0?ve:null;if(i===`multiples`){let e=T1*ce.length+E1;ye!=null&&ye<e&&(GM(`needs at least ${e}px of height for ${ce.length} small charts; it got ${ye}px and draws at ${e}px.`),ye=e),ye??=w1*ce.length+40}ye??=C1[i]??320;let be=G1(O,k)?k:`none`,xe=S1.valueLabels.includes(i)&&H1(n,`valueLabels`)===!0;xe&&be!==`none`&&GM(`ignores valueLabels on a stacked chart.`);let Se=xe&&be===`none`,Ce=H1(n,`description`),we=H1(s,`label`),Te=H1(h,`label`),Ee=H1(h,`min`),De=H1(h,`max`),Oe=H1(n,`centerLabel`),ke=(e,t)=>typeof e==`string`&&e?e:t;return{problem:null,spec:{type:i,title:typeof a==`string`?a.trim():``,description:typeof Ce==`string`?Ce:``,data:fe,allData:me??fe,x:{key:p,kind:le,format:d??(le===`time`?{style:`date`}:le===`value`?{style:`number`}:void 0),label:typeof we==`string`?we:``,labelFit:G1(k1,u)?u:`auto`},series:ce,group:T,to:E,size:D,trend:S1.trend.includes(i)&&re===!0,zoom:S1.zoom.includes(i)?(ie??fe.length>5e3)===!0:!1,bands:ae,stack:be,y:{label:typeof Te==`string`?Te:``,format:se,min:B1(Ee)?Ee:void 0,max:B1(De)?De:void 0,wholeNumbers:H1(h,`wholeNumbers`)===!0},target:V1(te)&&B1(ne)?{value:ne,label:String(H1(te,`label`)??``)}:null,centerLabel:i===`donut`&&typeof Oe==`string`&&Oe.trim()?Oe.trim():``,valueLabels:Se,height:ye,state:G1(p1,A)?A:`ready`,emptyText:ke(H1(n,`emptyText`),Q().emptyText),errorText:ke(H1(n,`errorText`),Q().errorText),loadingText:ke(H1(n,`loadingText`),Q().loadingText),renderer:G1(f1,j)?j:`auto`,timeZone:ee,otherIndex:pe}}}function ZM(e,t,n){let r=e.map(e=>[String(e[t]),String(e[n])]),i=new Map;for(let[e,t]of r)i.has(e)||i.set(e,0),i.set(t,(i.get(t)??0)+1);let a=[...i].filter(([,e])=>e===0).map(([e])=>e);if(a.length>8)return{reason:`refuses ${a.length} flow starts in a sankey: 8 is the most that keep their own colour. Fold the smallest into one, or split the chart.`,text:Q().tooManyGroupsText};let o=0;for(;a.length;){let e=a.pop();o+=1;for(let[t,n]of r){if(t!==e)continue;let r=(i.get(n)??0)-1;i.set(n,r),r===0&&a.push(n)}}return o<i.size?{reason:`cannot draw a sankey whose flows loop back on themselves.`,text:Q().errorText}:null}function QM(e,t){let n=e.map(e=>B1(e[t])?e[t]:0),r=n[n.length-1]??0,i=n[0]??0,a=i;for(let e of n.slice(1,-1))i+=e,a=Math.min(a,i);return a<0||n.length>1&&r<0?{refuse:`cannot draw a waterfall whose running total goes below zero.`}:n.length>2&&Math.abs(r-i)>.5?{warn:`draws the waterfall's closing total (${r}) as given, though the opening total plus the steps is ${i}.`}:null}function $M(e,t,n){let r=new Set(e.map((e,t)=>({i:t,v:B1(e[n])?e[n]:0})).sort((e,t)=>t.v-e.v).slice(0,5).map(e=>e.i)),i=e.reduce((e,t,i)=>r.has(i)||!B1(t[n])?e:e+t[n],0),a=e.filter((e,t)=>r.has(t)),o=new Set(a.map(e=>String(e[t]))),s=Q().otherLabel;for(let e=2;o.has(s);e+=1)s=`${Q().otherLabel} (${e})`;return a.push({[t]:s,[n]:i}),{data:a,otherIndex:a.length-1}}function eN(e){return KM(e.series[0],`series`)}function tN(e,t){return KM(e.data[t],`row ${t}`)}function K(e,t,n){let r=e.data[n]?.[t];return B1(r)?r:null}function nN(e){return e.type===`gauge`||e.series.some(t=>e.data.some((n,r)=>K(e,t.key,r)!=null))}function rN(e,t){let n=e.data[t]?.[e.x.key];return n==null||n===``?B$():e.x.format?G(n,{...e.x.format,timeZone:e.timeZone}):String(n)}function iN(e,t){return BM(e.data[t]?.[e.x.key],e.timeZone)}function aN(e,t){let n=e.group?e.data[t]?.[e.group.key]:null;return n==null||n===``?B$():String(n)}function oN(e,t){let n=e.to?e.data[t]?.[e.to.key]:null;return n==null||n===``?B$():String(n)}function sN(e){return e.group?K1(e.data.map((t,n)=>aN(e,n))):[]}function cN(e){return v1(e.type)?e.data.length:e.data.length*e.series.length}function lN(e){return e.renderer===`auto`?cN(e)>5e3?`canvas`:`svg`:e.renderer}function uN(e){switch(e.type){case`donut`:return e.data.map((t,n)=>rN(e,n));case`scatter`:case`bubble`:return sN(e);case`line`:case`area`:case`column`:case`bar`:return e.series.map(e=>e.key);default:return[]}}function dN(e){return[`line`,`area`,`column`,`bar`].includes(e.type)?e.series.map(e=>e.label):uN(e)}function fN(e,t,n){return e.type===`donut`?n.has(rN(e,t)):(e.type===`scatter`||e.type===`bubble`)&&e.group?n.has(aN(e,t)):!1}function pN(e,t){return e.data.map((n,r)=>{let i=e.series.filter(e=>!t.has(e.key)).reduce((t,n)=>t+Math.abs(K(e,n.key,r)??0),0);return Object.fromEntries(e.series.map(t=>{let n=K(e,t.key,r);return[t.key,i&&n!=null?n/i:null]}))})}function mN(e,t=M$){return`${NM(new Date(e+jM(e,t)).getUTCDay(),`short`)}, ${HM(e,{timeZone:t})}`}function hN(e,t){let n=e.filter(B1);if(!n.length)return[];let r=q1(n),i=J1(n),a=[t[1],t[2],t[3],t[5],t[6]];if(r===i)return[{from:r,to:i,colour:a[2]}];let o=(i-r)/a.length;return a.map((e,t)=>({from:r+o*t,to:t===a.length-1?i:r+o*(t+1),colour:e}))}function gN(e,t){if(t==null||!e.length)return;let n=e.length-1,r=e.findIndex((e,r)=>t>=e.from&&(r===n?t<=e.to:t<e.to));return e[r<0?n:r]?.colour}function _N(e,t){return Array.from({length:e},(n,r)=>t[e===1?6:Math.round(6-r*4/(e-1))])}function vN(e,t){return e.bands.find(e=>t<=e.upTo)??e.bands[e.bands.length-1]??null}function yN(e){return{min:e.y.min??0,max:e.y.max??100}}function bN(e){let t=eN(e).key,n=e.data.length-1,r=0;return e.data.map((i,a)=>{let o=K(e,t,a)??0,s=a===0||a===n,c=s?0:r,l=s?o:r+o;return a===0?r=o:s||(r=l),{index:a,total:s,value:o,from:c,to:l,level:s?o:l}})}function xN(e,t){let n=eN(e).key,r=KM(e.to,`to column`).key,i=e.data.map((t,i)=>({from:String(t[e.x.key]),to:String(t[r]),value:K(e,n,i)??0})),a=new Map;for(let e of i)a.has(e.from)||a.set(e.from,[]),a.set(e.to,[...a.get(e.to)??[],e]);let o=new Map,s=0;for(let[e,n]of a)n.length||o.set(e,t[s++%t.length]);let c=[...o.keys()],l=new Map([...a].filter(([,e])=>e.length).map(([e,t])=>[e,t.length]));for(;c.length;){let e=c.shift();for(let t of i.filter(t=>t.from===e)){let e=(l.get(t.to)??0)-1;if(l.set(t.to,e),e>0)continue;let n=KM((a.get(t.to)??[]).reduce((e,t)=>e===null||t.value>e.value?t:e,null),`sankey inflow`);o.set(t.to,o.get(n.from)),c.push(t.to)}}return o}function SN(e){let t=eN(e).key,n=new Map(sN(e).map(e=>[e,0]));return e.data.forEach((r,i)=>{n.set(aN(e,i),(n.get(aN(e,i))??0)+(K(e,t,i)??0))}),n}function CN(e,t,n){let{palette:r,neutral:i,seq:a}=n,o=eN(e).key;switch(e.type){case`donut`:return EN(e,t,n);case`funnel`:return _N(e.data.length,KM(a,`sequential colours`))[t];case`heatmap`:case`calendar`:return gN(hN(Y1(e,o),KM(a,`sequential colours`)),K(e,o,t));case`gauge`:return r[0];case`waterfall`:{let n=KM(bN(e)[t],`waterfall bar ${t}`);return n.total?r[0]:n.value>=0?r[2]:r[7]}case`treemap`:return r[[...SN(e).keys()].indexOf(aN(e,t))%r.length];case`sankey`:return xN(e,r).get(String(tN(e,t)[e.x.key]));case`scatter`:case`bubble`:return r[Math.max(0,sN(e).indexOf(aN(e,t)))];default:return r[0]??i}}function wN(e,t,n,r){let i=eN(e),a=K(e,i.key,t),o=()=>CN(e,t,r);switch(e.type){case`donut`:{let r=e.data.reduce((t,r,a)=>t+(n.has(rN(e,a))?0:K(e,i.key,a)??0),0);return{title:rN(e,t),rows:[{color:o(),label:i.label,value:G(a,i.format)},{label:Q().shareLabel,value:r&&a!=null?G(a/r,{style:`percent`}):B$()}],foot:``}}case`heatmap`:return{title:`${aN(e,t)}, ${rN(e,t)}`,rows:[{color:o(),label:i.label,value:G(a,i.format)}],foot:``};case`calendar`:return{title:mN(iN(e,t),e.timeZone),rows:[{color:o(),label:i.label,value:G(a,i.format)}],foot:``};case`funnel`:{let n=K(e,i.key,0),r=t?K(e,i.key,t-1):null,s=[{color:o(),label:i.label,value:G(a,i.format)}];return t&&s.push({label:Q().ofPreviousStepLabel,value:X1(a,r)}),s.push({label:CM(Q().ofFirstStepText,{first:rN(e,0)}),value:X1(a,n)}),{title:rN(e,t),rows:s,foot:``}}case`gauge`:{let{min:n,max:r}=yN(e),s=a==null?null:vN(e,a),c=[{color:o(),label:i.label,value:G(a,i.format)}];return c.push({label:Q().scaleLabel,value:CM(Q().scaleRangeText,{min:G(n,i.format),max:G(r,i.format)})}),s&&c.push({label:Q().bandLabel,value:s.label}),{title:e.data[t]?.[e.x.key]==null?i.label:rN(e,t),rows:c,foot:``}}case`waterfall`:{let n=bN(e),r=KM(n[t],`waterfall bar ${t}`),a=KM(n[0],`waterfall opening bar`).value,s=r.total?[{color:o(),label:i.label,value:G(r.value,i.format)}]:[{color:o(),label:Q().changeLabel,value:TN(r.value,i.format)},{label:Q().runningTotalLabel,value:G(r.level,i.format)}],c=!r.total&&a?CM(Q().openingShareText,{share:TN(r.value/a*100,{style:`number`,decimals:2},`%`)}):``;return{title:rN(e,t),rows:s,foot:c}}case`treemap`:{let n=aN(e,t),r=SN(e).get(n);return{title:`${n} / ${rN(e,t)}`,rows:[{color:o(),label:i.label,value:G(a,i.format)},{label:CM(Q().shareOfParentText,{parent:n}),value:X1(a,r)}],foot:``}}case`sankey`:{let n=String(tN(e,t)[e.x.key]),r=e.data.reduce((t,r,a)=>String(r[e.x.key])===n?t+(K(e,i.key,a)??0):t,0);return{title:CM(Q().scaleRangeText,{min:n,max:oN(e,t)}),rows:[{color:o(),label:i.label,value:G(a,i.format)},{label:CM(Q().shareOfParentText,{parent:n}),value:X1(a,r)}],foot:``}}case`scatter`:case`bubble`:{let n=[{color:o(),label:e.x.label||String(e.x.key),value:rN(e,t)},{label:i.label,value:G(a,i.format)}];return e.size&&n.push({label:e.size.label||String(e.size.key),value:G(tN(e,t)[e.size.key],e.size.format)}),{title:e.group?aN(e,t):i.label,rows:n,foot:``}}}let s=e.stack===`percent`?pN(e,n)[t]:null,c=e.series.map((e,t)=>({s:e,i:t})).filter(({s:e})=>!n.has(e.key)),l=c.map(({s:n,i})=>{let a=K(e,n.key,t),o=G(a,n.format);return{color:e.type===`multiples`?r.palette[0]:r.palette[i],line:e.type===`line`||e.type===`multiples`,label:n.label,value:s&&a!=null?`${o} (${G(s[n.key],{style:`percent`})})`:o}}),u=``,d=c[0];if(e.stack!==`none`&&d&&c.length>1){let n=c.reduce((n,{s:r})=>n+(K(e,r.key,t)??0),0);u=CM(Q().totalText,{total:G(n,d.s.format)})}if(e.target&&d&&c.length===1){let n=K(e,d.s.key,t);if(n!=null){let t=n-e.target.value,r=e.target.label||Q().targetLabel;u=CM(Q().targetGapText,{direction:t>=0?Q().aboveLabel:Q().belowLabel,label:r,gap:G(Math.abs(t),d.s.format)})}}return{title:rN(e,t),rows:l,foot:u}}function TN(e,t,n=``){let r=`${G(Math.abs(e),t)}${n}`;return e>0?`+${r}`:e<0?`−${r}`:r}function EN(e,t,n){return t===e.otherIndex?n.neutral:n.palette[t%n.palette.length]}function DN(e){let t=(e,t)=>{let n=document.createElement(`div`);return n.className=e,t!=null&&(n.textContent=t),n},n=t(`wui-chart-tooltip-body`);e.title&&n.append(t(`wui-chart-tooltip-title`,e.title));for(let r of e.rows){let e=t(`wui-chart-tooltip-row`);if(r.color){let t=document.createElement(`span`);t.className=r.line?`wui-chart-tooltip-swatch wui-chart-tooltip-swatch-line`:`wui-chart-tooltip-swatch`,t.style.background=r.color,e.append(t)}let i=document.createElement(`span`);i.className=`wui-chart-tooltip-label`,i.textContent=r.label;let a=document.createElement(`span`);a.className=`wui-chart-tooltip-value`,a.textContent=r.value,e.append(i,a),n.append(e)}return e.foot&&n.append(t(`wui-chart-tooltip-foot`,e.foot)),n}function ON(e){let t=[e.title,...e.rows.map(e=>`${e.label} ${e.value}`)];return e.foot&&t.push(e.foot),t.filter(Boolean).join(`. `)}function kN(e){return e.x.label?e.x.label:{gauge:Q().measureLabel,funnel:Q().stageLabel,waterfall:Q().stepLabel,sankey:Q().fromLabel,scatter:Q().columnXLabel,bubble:Q().columnXLabel}[e.type]??(e.x.kind===`time`?Q().dateLabel:Q().categoryLabel)}function AN(e){let t=e.allData&&e.allData!==e.data?{...e,data:e.allData}:e,n=eN(t),r=(e,r=n)=>G(K(t,r.key,e),r.format),i=(e,n,r=n.length)=>({caption:t.title,head:e,rows:n.slice(0,500),total:r,truncated:r>500}),a=t.data.map((e,t)=>t);switch(t.type){case`heatmap`:{let e=K1(a.map(e=>rN(t,e))),n=sN(t),o=new Map(a.map(e=>[`${aN(t,e)}\u0000${rN(t,e)}`,r(e)]));return i([KM(t.group,`group column`).label||Q().rowLabel,...e],n.map(t=>({head:t,cells:e.map(e=>o.get(`${t}\u0000${e}`)??B$())})))}case`funnel`:{let e=K(t,n.key,0);return i([kN(t),n.label,Q().ofPreviousStepLabel,CM(Q().ofFirstStepText,{first:rN(t,0)})],a.map(i=>({head:rN(t,i),cells:[r(i),i?X1(K(t,n.key,i),K(t,n.key,i-1)):B$(),X1(K(t,n.key,i),e)]})))}case`gauge`:return i([kN(t),n.label,...t.bands.length?[Q().bandLabel]:[]],a.map(e=>({head:tN(t,e)[t.x.key]==null?n.label:rN(t,e),cells:[r(e),...t.bands.length?[Z1(t,K(t,n.key,e))]:[]]})));case`waterfall`:return i([kN(t),Q().changeLabel,Q().runningTotalLabel],bN(t).map(e=>({head:rN(t,e.index),cells:[e.total?B$():TN(e.value,n.format),G(e.level,n.format)]})));case`treemap`:{let e=SN(t);return i([KM(t.group,`group column`).label||Q().groupLabel,t.x.label||Q().itemLabel,n.label,Q().shareOfGroupLabel],a.map(i=>({head:aN(t,i),cells:[rN(t,i),r(i),X1(K(t,n.key,i),e.get(aN(t,i)))]})))}case`sankey`:return i([kN(t),KM(t.to,`to column`).label||Q().toLabel,n.label],a.map(e=>({head:rN(t,e),cells:[oN(t,e),r(e)]})));case`scatter`:case`bubble`:return i([kN(t),n.label,...t.size?[t.size.label||t.size.key]:[],...t.group?[t.group.label||Q().groupLabel]:[]],a.map(e=>({head:rN(t,e),cells:[r(e),...t.size?[G(tN(t,e)[t.size.key],t.size.format)]:[],...t.group?[aN(t,e)]:[]]})))}let o=t.type===`donut`,s=o?t.data.reduce((e,r,i)=>e+(K(t,n.key,i)??0),0):0,c=[kN(t),...t.series.map(e=>e.label)];return o&&c.push(Q().shareLabel),i(c,a.slice(0,500).map(e=>{let i=t.series.map(t=>r(e,t));if(o){let r=K(t,n.key,e);i.push(s&&r!=null?G(r/s,{style:`percent`}):B$())}return{head:rN(t,e),cells:i}}),t.data.length)}function jN(e){switch(e?.style){case`currency`:case`compact`:return e.currency?` (${e.currency})`:``;case`percent`:return` (%)`;case`duration`:return` (${e.unit??`s`})`;default:return``}}function MN(e,t){return e==null?e:t?.unit===`paise`?Number(PM(e)):t?.style===`percent`?Number((e*100).toPrecision(12)):e}function NN(e){let t=e.allData&&e.allData!==e.data?{...e,data:e.allData}:e,n=e=>{if(e==null)return``;let t=String(e);return typeof e==`string`&&/^[=+\-@\t\r]/.test(t)&&(t=`'${t}`),/[",\r\n]/.test(t)?`"${t.replace(/"/g,`""`)}"`:t},r={head:t.x.label||t.x.key,value:e=>{let n=e[t.x.key];return t.x.kind===`time`?HM(n,{pattern:t.x.format?.pattern??`day`,timeZone:t.timeZone}):n}},i=t.series.map(e=>({head:`${e.label}${jN(e.format)}`,value:t=>{let n=t[e.key];return MN(B1(n)?n:null,e.format)}})),a=t.group,o=a?{head:a.label||a.key,value:e=>e[a.key]}:null,s;switch(t.type){case`heatmap`:s=[r,KM(o,`group column`),...i];break;case`treemap`:s=[KM(o,`group column`),r,...i];break;case`sankey`:{let e=KM(t.to,`to column`);s=[r,{head:e.label||e.key,value:t=>t[e.key]},...i];break}case`bubble`:{let e=KM(t.size,`size column`);s=[r,...i,{head:`${e.label||e.key}${jN(e.format)}`,value:t=>{let n=t[e.key];return MN(B1(n)?n:null,e.format)}},...o?[o]:[]];break}case`scatter`:s=[r,...i,...o?[o]:[]];break;case`gauge`:s=t.x.key===``?i:[r,...i];break;default:s=[r,...i]}let c=[s.map(e=>n(e.head)).join(`,`)];for(let e of t.data)c.push(s.map(t=>n(t.value(e))).join(`,`));return`${c.join(`\r
32
- `)}`}function PN(e){return(e?.title??``).toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/(^-|-$)/g,``)||`chart`}function FN(e,t=new Set){let n=[];e.description&&n.push(e.description.replace(/\.?\s*$/,`.`));let r=uN(e);if(r.length&&r.every(e=>t.has(e)))return n.push(Q().everySeriesHiddenText),n.join(` `);let i=e.data.length,a=e.data.map((e,t)=>t).filter(n=>!fN(e,n,t)),o=eN(e),s=Y1(e,o.key),c=s.reduce((e,t)=>e+t,0),l=()=>e.data.reduce((t,n,r)=>(K(e,o.key,r)??-1/0)>(K(e,o.key,t)??-1/0)?r:t,0),u=()=>e.data.reduce((t,n,r)=>(K(e,o.key,r)??1/0)<(K(e,o.key,t)??1/0)?r:t,0);switch(e.type){case`donut`:{let t=a.reduce((t,n)=>t+(K(e,o.key,n)??0),0);if(n.push(wM(Q(),`donutSummaryText`,a.length,{rows:a.length,label:o.label,total:G(t,o.format)})),a.length&&t){let r=a.reduce((t,n)=>(K(e,o.key,n)??-1/0)>(K(e,o.key,t)??-1/0)?n:t,KM(a[0],`first slice`));n.push(CM(Q().donutLargestText,{top:rN(e,r),share:G((K(e,o.key,r)??0)/t,{style:`percent`})}))}return n.join(` `)}case`heatmap`:if(n.push(CM(Q().heatmapSummaryText,{label:o.label,group:KM(e.group,`group column`).label||Q().rowFallbackLabel,x:e.x.label||Q().columnFallbackLabel,n:i})),s.length){let t=l(),r=u();n.push(CM(Q().highestAtLowestAtText,{highValue:$1(e,t),highGroup:aN(e,t),high:rN(e,t),lowValue:$1(e,r),lowGroup:aN(e,r),low:rN(e,r)}))}return n.join(` `);case`calendar`:return n.push(i===1?CM(Q().calendarSummaryTextOne,{label:o.label,n:i}):CM(Q().calendarSummaryTextOther,{label:o.label,n:i,range:i>1?CM(Q().calendarRangeText,{first:rN(e,0),last:rN(e,i-1)}):``})),s.length&&n.push(CM(Q().highestLowestText,{maxValue:$1(e,l()),max:rN(e,l()),minValue:$1(e,u()),min:rN(e,u())})),n.join(` `);case`funnel`:return n.push(CM(Q().funnelSummaryText,{label:o.label,n:i})),i>1&&n.push(CM(Q().funnelStartText,{first:rN(e,0),firstValue:$1(e,0),last:rN(e,i-1),lastValue:$1(e,i-1),share:X1(K(e,o.key,i-1),K(e,o.key,0))})),n.join(` `);case`gauge`:{let t=K(e,o.key,0),{min:r,max:i}=yN(e),a=t==null?null:vN(e,t);return n.push(CM(Q().gaugeSummaryText,{type:g1(`gauge`),label:o.label,value:G(t,o.format),min:G(r,o.format),max:G(i,o.format),band:a?CM(Q().gaugeBandText,{band:a.label}):``})),n.join(` `)}case`waterfall`:{let t=bN(e);if(n.push(CM(Q().waterfallSummaryText,{label:o.label})),i>1){let r=t.filter(e=>!e.total);n.push(CM(Q().opensAtClosesAtText,{opening:G(KM(t[0],`waterfall opening bar`).value,o.format),closing:G(KM(t[i-1],`waterfall closing bar`).value,o.format)}));let a=r.reduce((e,t)=>t.value>(e?.value??0)?t:e,null),s=r.reduce((e,t)=>t.value<(e?.value??0)?t:e,null);a&&n.push(CM(Q().largestRiseText,{xText:rN(e,a.index),signed:TN(a.value,o.format)})),s&&n.push(CM(Q().largestFallText,{xText:rN(e,s.index),signed:TN(s.value,o.format)}))}return n.join(` `)}case`treemap`:{let t=SN(e);if(!t.size)return CM(Q().treemapEmptyText,{label:o.label});let[r,a]=[...t].reduce((e,t)=>t[1]>e[1]?t:e);return n.push(CM(Q().treemapSummaryText,{label:o.label,n:i,totals:t.size,total:G(c,o.format)})),n.push(CM(Q().treemapLargestGroupText,{name:r,share:X1(a,c)})),n.join(` `)}case`sankey`:{let t=KM(e.to,`to column`).key,r=K1(e.data.flatMap(n=>[String(n[e.x.key]),String(n[t])])),a=l();return n.push(CM(Q().sankeySummaryText,{label:o.label,n:i,nodes:r.length})),n.push(CM(Q().largestFlowText,{xText:rN(e,a),toText:oN(e,a),fmtAt:$1(e,a)})),n.join(` `)}case`scatter`:case`bubble`:{let r=sN(e).filter(e=>!t.has(e));n.push(CM(Q().scatterSummaryText,{type:g1(e.type),label:o.label,xLabel:e.x.label||e.x.key,count:a.length,groups:r.length?wM(Q(),`groupsText`,r.length,{groups:r.join(`, `)}):``}));let i=a.map(t=>tN(e,t)[e.x.key]).filter(B1),s=a.map(t=>K(e,o.key,t)).filter(e=>e!=null);for(let t of[Q1(e.x.label||String(e.x.key),i,e.x.format),Q1(o.label,s,o.format)])t&&n.push(t);return n.join(` `)}}let d=e.stack===`percent`?Q().stackedPercentText:e.stack===`stacked`?Q().stackedText:``,f=e.series.filter(e=>!t.has(e.key));n.push(CM(Q().summaryText,{type:g1(e.type),series:f.map(e=>e.label).join(`, `),stacked:d,sharedAxis:e.type===`multiples`?Q().sharedAxisText:``})),i&&n.push(i===1?CM(Q().pointsSummaryTextOne,{n:i,first:rN(e,0)}):CM(Q().pointsSummaryTextOther,{n:i,first:rN(e,0),last:rN(e,i-1)}));for(let t of f){let r=Q1(t.label,Y1(e,t.key),t.format);r&&n.push(r)}return n.join(` `)}function IN(e){return e.stack===`percent`?{style:`percent`,decimals:0}:WM(e.y.format)}function LN(e,t){let n=e.data.map((e,t)=>t).filter(n=>!fN(e,n,t));if(e.type!==`scatter`&&e.type!==`bubble`)return n;let r=t=>K(e,e.x.key,t)??0;return n.sort((e,t)=>r(e)-r(t)||e-t)}function RN(e){let t=K1(e.data.map((t,n)=>rN(e,n))),n=sN(e),r=new Map(e.data.map((r,i)=>[`${t.indexOf(rN(e,i))},${n.indexOf(aN(e,i))}`,i]));return{columns:t.length,rows:n.length,at:r,position:r=>[t.indexOf(rN(e,r)),n.indexOf(aN(e,r))]}}function zN(e,t,n,r){if(n===`Escape`)return null;let i=e.data.length;if(!i)return t;if(e.type===`gauge`)return n in t0||n===`Home`||n===`End`?{index:0,series:0}:t;if(e.type===`heatmap`||e.type===`calendar`)return BN(e,t,n);let a=r0.includes(e.type),o=e.series.map((e,t)=>r.has(e.key)?-1:t).filter(e=>e>=0),s=a?LN(e,r):[];if(a?!s.length:!o.length)return t;let c=t??{index:a?KM(s[0],`first mark`):0,series:a?0:KM(o[0],`first visible series`)};if(t==null&&n in t0)return c;if(a){let e=Math.max(0,s.indexOf(c.index));return n===`Home`?{index:KM(s[0],`first mark`),series:0}:n===`End`?{index:KM(s[s.length-1],`last mark`),series:0}:n in t0?{index:KM(s[(e+n0(n)+s.length)%s.length],`next mark`),series:0}:t}if(n===`Home`)return{...c,index:0};if(n===`End`)return{...c,index:i-1};if(!(n in t0))return t;if(e.type===`bar`?n===`ArrowUp`||n===`ArrowDown`:n===`ArrowLeft`||n===`ArrowRight`)return{...c,index:Math.min(i-1,Math.max(0,c.index+n0(n)))};let l=Math.max(0,o.indexOf(c.series)),u=e.type===`bar`?n0(n):-n0(n);return{...c,series:KM(o[Math.min(o.length-1,Math.max(0,l+u))],`series`)}}function BN(e,t,n){let r=e.data.length,i=e.type===`calendar`,a=i?e.data.map((e,t)=>t).sort((t,n)=>iN(e,t)-iN(e,n)):[],o=i?null:RN(e),s=t??{index:i?KM(a[0],`first day`):0,series:0};if(t==null&&n in t0)return s;if(n===`Home`)return{index:i?KM(a[0],`first day`):0,series:0};if(n===`End`)return{index:i?KM(a[r-1],`last day`):r-1,series:0};if(!(n in t0))return t;if(i){let t=n===`ArrowDown`||n===`ArrowUp`?n0(n):n0(n)*7,r=t=>{let n=iN(e,t);return Math.floor((n+jM(n,e.timeZone))/e0)},i=r(s.index),o=a.filter(e=>t>0?r(e)>i:r(e)<i);if(!o.length)return{index:s.index,series:0};let c=i+t;return{index:o.reduce((e,t)=>Math.abs(r(t)-c)<Math.abs(r(e)-c)?t:e),series:0}}if(!o)throw Error(`heat grid missing`);let[c,l]=o.position(s.index),[u,d]=n===`ArrowLeft`||n===`ArrowRight`?[n0(n),0]:[0,n0(n)];return{index:o.at.get(`${c+u},${l+d}`)??s.index,series:0}}function VN(e){let t=e.series[0];if(!t)throw Error(`chart spec has no series`);return t}function HN(e,t){let n=e.data[t];if(!n)throw Error(`chart row ${t} missing`);return n}function UN(e){if(!e.to)throw Error("chart spec has no `to` column");return e.to.key}function WN(e){if(!e.size)throw Error("chart spec has no `size` column");return e.size.key}function GN(e,t,n){let r=e[t];if(!r)throw Error(`percent shares for row ${t} missing`);return r[n]??null}function KN(e,t,n){let r=e?.[t];if(!r)throw Error(`bar radii for row ${t} missing`);return r[n]}function qN(e){return typeof e==`object`&&e&&`row`in e?o0(e.row):null}function JN(e){if(typeof e!=`object`||!e||!(`dataZoom`in e)||!Array.isArray(e.dataZoom))return null;let t=e.dataZoom[0];if(typeof t!=`object`||!t||!(`start`in t)||!(`end`in t))return null;let{start:n,end:r}=t;return a0(n)&&Number.isFinite(n)&&a0(r)&&Number.isFinite(r)?{start:n,end:r}:null}function YN(e){if(!e)throw Error(`chart has not been drawn`);return e}function XN(e){return e.wholeNumbers===!0||e.format?.style===`currency`&&e.format.unit===`paise`}function ZN(e,t,n,r,i=!1){let a=WM(e);if(i)return a.currency?{style:`currency`,currency:a.currency,unit:a.unit,decimals:0}:{style:`number`,decimals:0};if(a.style!==`compact`||!Number.isFinite(t)||!Number.isFinite(n))return a;let o=(n-t)/r;if(!(o>0)||o>=Math.max(Math.abs(t),Math.abs(n))*.02)return a;let s=Math.min(6,Math.max(0,Math.ceil(-Math.log10(o))));return a.currency?{style:`currency`,currency:a.currency,unit:a.unit,decimals:s}:{style:`number`,decimals:s}}function QN(e){let t=String(e??``).trim(),n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t);if(n){let e=n[1]??``,t=e.length===3?[...e].map(e=>e+e).join(``):e;return[0,2,4].map(e=>Number.parseInt(t.slice(e,e+2),16))}let r=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i.exec(t);return r?r.slice(1,4).map(Number):null}function $N(e,t){let n=QN(e);return n?`rgba(${n.join(`,`)},${t})`:String(e??``).trim()}function eP(e,t,n){let r=QN(e),i=QN(t);return r&&i?`rgb(${r.map((e,t)=>Math.round(e+((i[t]??0)-e)*n)).join(`,`)})`:e}function tP(e,t){let n=QN(e),r=QN(t.text),i=QN(t.surface);return!n||!r||!i||_0(g0(n),g0(r))>=_0(g0(n),g0(i))?t.text:t.surface}function nP(e){let t=e.x.format?.pattern;return n=>{let r=MM(n,e.timeZone);if(t===`month`||t===`year`)return HM(r,{pattern:t,timeZone:e.timeZone});let i=AM(r,e.timeZone);return i.hour||i.minute?HM(r,{pattern:`time`,timeZone:e.timeZone}):UM(r,{timeZone:e.timeZone})}}function rP(e,t,n){let r=d0,i=e=>n?e?[r,0,0,r]:[0,r,r,0]:e?[0,0,r,r]:[r,r,0,0];return e.data.map((n,r)=>{let a={};if(e.stack===`none`){for(let t of e.series)a[t.key]=i((K(e,t.key,r)??0)<0);return a}let o=null,s=null;for(let n of e.series){let i=K(e,n.key,r);t.has(n.key)||i==null||i===0||(i>0?o=n.key:s=n.key)}for(let t of e.series)a[t.key]=t.key===o?i(!1):t.key===s?i(!0):0;return a})}function iP(e,t,n,r){let i=n.width<576,a=r.animation!==!1&&!t.reducedMotion&&cN(e)<=5e3,o=uN(e),s=Object.fromEntries(o.map(e=>[e,!r.hidden.has(e)])),c={palette:t.palette,neutral:t.neutral,seq:t.seq},l={backgroundColor:t.surface,borderColor:t.grid,borderWidth:1,padding:[10,12],confine:!0,className:`wui-chart-tooltip`,extraCssText:`box-shadow:${t.shadow};border-radius:10px;`,textStyle:{fontFamily:t.font,color:t.textBody,fontSize:12},transitionDuration:a?.25:0},u={backgroundColor:`transparent`,animation:a,animationDuration:1e3,animationEasing:`cubicOut`,animationDurationUpdate:650,animationEasingUpdate:`cubicInOut`,textStyle:{fontFamily:t.font,color:t.label},color:t.palette,legend:{show:!1,data:o,selected:s}},d={base:u,tooltipBase:l,colours:c,compact:i,animate:a},f=B0[e.type];if(f)return f(e,t,n,r,d);let p=e.type===`bar`,m=e.x.kind===`time`,h=e.stack===`percent`?pN(e,r.hidden):null,g=p||e.type===`column`?rP(e,r.hidden,p):null,_=e.series.length===1,v=r.renderer===`canvas`,[y,b]=l0(e.series.flatMap(t=>e.data.map((n,r)=>K(e,t.key,r))),!0),x=e.stack===`percent`?IN(e):ZN(e.y.format,e.y.min??y,e.y.max??b,i?3:4,e.y.wholeNumbers),S=h?.some(e=>Object.values(e).some(e=>e!=null&&e<0))?-1:0,C=e.series.findIndex(e=>!r.hidden.has(e.key)),w=e.series.filter(e=>!r.hidden.has(e.key)),T=m&&!e.valueLabels?[]:e.data.map((t,n)=>rN(e,n)),E=()=>{let t=e.stack===`percent`?[1,S]:[e.y.max??b,e.y.min??y];return n.width-Math.max(...t.map(e=>p0(G(e,x),12)))-20},D=!1;if(e.valueLabels){let t=p?n.width-D0(T.map(e=>p0(e,12)))-20:N0(T.length,E())/Math.max(1,w.length);D=w.flatMap(t=>e.data.map((n,r)=>K(e,t.key,r))).filter(e=>e!=null).every(e=>p0(G(e,x),12)<=t)}let O={type:m?`time`:`category`,boundaryGap:!m&&(e.type===`column`||p),inverse:p,axisLine:{show:!0,lineStyle:{color:t.axis}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{color:t.label,fontSize:12,margin:12,...m||e.type!==`column`||e.x.labelFit===`auto`?{hideOverlap:!0}:gP(e.x.labelFit,T,E()),...m?{formatter:nP(e)}:{}},...m?{}:{data:T}},k={type:`value`,splitNumber:i?3:4,min:e.stack===`percent`?S:e.y.min,max:e.stack===`percent`?1:e.y.max,minInterval:XN(e.y)?1:void 0,interval:e.stack===`percent`?.25:void 0,axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:t.grid,type:`solid`,width:1}},axisLabel:{color:t.label,fontSize:12,formatter:e=>G(e,x)},...e.y.label?{name:e.y.label,nameLocation:`end`,nameGap:12,nameTextStyle:{color:t.label,fontSize:12,align:p?`right`:`left`}}:{}},A=e.zoom,j=_&&e.type!==`column`&&!p&&!i,M=e.series.map((n,r)=>{let o=m0(t.palette,r%t.palette.length),s=e.data.some((t,r)=>K(e,n.key,r)!=null&&K(e,n.key,r-1)==null&&K(e,n.key,r+1)==null),c=t=>{let r=K(e,n.key,t),i=h?GN(h,t,n.key):r;return m?[y0(iN(e,t),e.timeZone),i]:i},l={id:n.key,name:n.key,stack:e.stack===`none`?void 0:`total`,emphasis:{focus:_?`none`:`series`,blurScope:`coordinateSystem`},blur:{itemStyle:{opacity:.22},lineStyle:{opacity:.22},areaStyle:{opacity:.08}}};if(e.type===`line`||e.type===`area`){let n=e.type===`area`?_||e.stack!==`none`?t.dark?.34:.22:.1:0;return{...l,type:`line`,data:e.data.map((e,t)=>c(t)),smooth:.35,smoothMonotone:`x`,connectNulls:!1,symbol:`circle`,showSymbol:s,symbolSize:8,sampling:v?`lttb`:void 0,lineStyle:{width:2,color:o,..._&&!v?{shadowColor:$N(o,.35),shadowBlur:10,shadowOffsetY:6}:{}},itemStyle:{color:o,borderColor:t.surface,borderWidth:2},areaStyle:n?{color:v0(o,n)}:void 0,endLabel:j?{show:!0,formatter:e=>G(Array.isArray(e.value)?e.value[1]:e.value,x),color:o,fontWeight:600,fontSize:12,distance:8,fontFamily:t.font,valueAnimation:a}:void 0,markLine:r===C?aP(e,t,!1,a):void 0}}return{...l,type:`bar`,barMaxWidth:u0,barCategoryGap:i?`28%`:`38%`,itemStyle:{color:o,borderColor:t.surface,borderWidth:e.stack===`none`?0:1},animationDelay:a?e=>e*45+r*110:0,data:e.data.map((e,t)=>({value:c(t),itemStyle:{borderRadius:KN(g,t,n.key)}})),label:e.valueLabels?{show:D,position:p?`right`:`top`,distance:6,fontFamily:t.font,fontSize:12,fontWeight:600,color:t.text,formatter:e=>e.value==null?``:G(e.value,x)}:void 0,markLine:r===C?aP(e,t,p,a):void 0}});return{...u,useUTC:m,grid:{left:4,right:j?64:i?8:16,top:e.y.label?28:D&&e.type===`column`?24:12,bottom:A?44:4,outerBoundsMode:`same`},dataZoom:A?EP(e,t,m0(t.palette,0),r.zoom):void 0,tooltip:{...l,trigger:`axis`,axisPointer:e.type===`line`||e.type===`area`?{type:`line`,lineStyle:{color:t.axis}}:{type:`shadow`,shadowStyle:{color:$N(t.neutral,t.dark?.12:.1)}},formatter:t=>DN(wN(e,(Array.isArray(t)?t:[t])[0]?.dataIndex??0,r.hidden,c))},xAxis:p?k:O,yAxis:p?O:k,series:M}}function aP(e,t,n,r){if(!e.target)return;let i=VN(e).format;return{silent:!0,symbol:`none`,animation:r,lineStyle:{color:t.label,type:[5,4],width:1},label:{position:`insideEndTop`,formatter:()=>[e.target?.label,G(e.target?.value,i)].filter(Boolean).join(` `),color:t.textMuted,fontSize:12,fontFamily:t.font,backgroundColor:t.surface,padding:[2,6],borderRadius:4},data:[n?{xAxis:e.target.value}:{yAxis:e.target.value}]}}function oP(e,t,n,r,i){let{base:a,tooltipBase:o,colours:s,compact:c}=i,l=VN(e),u=e.data.map((t,n)=>rN(e,n)),d=e.data.reduce((t,n,i)=>t+(r.hidden.has(rN(e,i))?0:K(e,l.key,i)??0),0);return{...a,tooltip:{...o,trigger:`item`,formatter:t=>DN(wN(e,t.dataIndex,r.hidden,s))},graphic:[{type:`group`,left:`center`,top:`middle`,silent:!0,children:[{type:`text`,style:{text:G(d,WM(l.format)),x:0,y:-10,align:`center`,verticalAlign:`middle`,fill:t.text,fontSize:c?18:22,fontWeight:650,fontFamily:t.font}},{type:`text`,style:{text:e.centerLabel||i0().centerLabel,x:0,y:14,align:`center`,verticalAlign:`middle`,fill:t.label,fontSize:12,fontFamily:t.font}}]}],series:[{id:l.key,name:l.key,type:`pie`,radius:c?[`50%`,`70%`]:[`54%`,`72%`],center:[`50%`,`50%`],padAngle:1.6,minAngle:3,startAngle:90,avoidLabelOverlap:!0,itemStyle:{borderRadius:6,borderColor:t.surface,borderWidth:2},animationType:`expansion`,animationDuration:1100,label:c?{show:!1}:{show:!0,position:`outside`,color:t.label,fontFamily:t.font,fontSize:12,lineHeight:16,formatter:e=>`${e.name}\n${G(e.percent/100,{style:`percent`,decimals:0})}`},labelLine:{length:10,length2:8,smooth:.2,lineStyle:{color:t.axis}},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:6,itemStyle:{shadowBlur:16,shadowColor:`rgba(0,0,0,0.18)`}},data:e.data.map((t,n)=>({name:u[n],value:K(e,l.key,n)??0,itemStyle:{color:EN(e,n,s)}}))}]}}function sP(e,t){return{...e,trigger:`item`,formatter:e=>t(e)}}function cP(e,t,n={}){return{type:`piecewise`,orient:`horizontal`,right:4,bottom:0,pieces:t.map((e,n)=>({gte:e.from,[n===t.length-1?`lte`:`lt`]:e.to,color:e.colour})),itemWidth:11,itemHeight:11,itemGap:3,itemSymbol:`roundRect`,showLabel:!1,text:[i0().moreLabel,i0().lessLabel],textGap:8,selectedMode:!1,textStyle:{color:e.label,fontSize:12,fontFamily:e.font},...n}}function lP(e,t,n,r,i){let a=VN(e),o=b0(e.data.map((t,n)=>rN(e,n))),s=sN(e),c=hN(x0(e,a.key),t.seq);return{...i.base,grid:{left:4,right:4,top:8,bottom:40,outerBoundsMode:`same`},tooltip:sP(i.tooltipBase,t=>DN(wN(e,t.dataIndex,r.hidden,i.colours))),xAxis:S0(t,o,{axisLine:{show:!1},splitArea:{show:!1}}),yAxis:S0(t,s,{inverse:!0,axisLine:{show:!1}}),visualMap:cP(t,c),series:[{type:`heatmap`,data:e.data.map((t,n)=>[o.indexOf(rN(e,n)),s.indexOf(aN(e,n)),K(e,a.key,n)??`-`]),itemStyle:{borderColor:t.surface,borderWidth:2,borderRadius:4},emphasis:{itemStyle:{borderColor:t.text,borderWidth:1.5}},progressive:0,animationDuration:800}]}}function uP(e,t){let n=e.data.map((t,n)=>iN(e,n)).filter(Number.isFinite),r=E0(n),i=D0(n),a=Math.ceil((i-r)/w0)+1,o=Math.floor((t.height-62)/7),s=Math.max(O0,Math.min(k0,o,Math.floor((t.width-44)/a))),c=Math.max(1,Math.floor((t.width-44)/s));return{cell:s,from:a>c?i-(c-1)*w0:r,to:i}}function dP(e,t,n,r,i){let a=VN(e),{cell:o,from:s,to:c}=uP(e,n),l=hN(x0(e,a.key),t.seq);return{...i.base,tooltip:sP(i.tooltipBase,t=>DN(wN(e,t.dataIndex,r.hidden,i.colours))),visualMap:cP(t,l,{right:4}),calendar:{range:[T0(s,e.timeZone),T0(c,e.timeZone)],top:24,left:34,cellSize:[o,o],splitLine:{show:!1},itemStyle:{color:t.seq[0],borderColor:t.surface,borderWidth:o<16?2:3},dayLabel:{firstDay:1,nameMap:[``,NM(1,`short`),``,NM(3,`short`),``,NM(5,`short`),``],color:t.label,fontSize:12,fontFamily:t.font,margin:8},monthLabel:{color:t.label,fontSize:12,fontFamily:t.font,margin:8},yearLabel:{show:!1}},series:[{type:`heatmap`,coordinateSystem:`calendar`,data:e.data.map((t,n)=>[T0(iN(e,n),e.timeZone),K(e,a.key,n)??`-`]),itemStyle:{borderRadius:3,borderColor:t.surface,borderWidth:2},emphasis:{itemStyle:{borderColor:t.text,borderWidth:1.5}}}]}}function fP(e,t,n,r,i){let a=VN(e),o=_N(e.data.length,t.seq),s=K(e,a.key,0);return{...i.base,tooltip:sP(i.tooltipBase,t=>DN(wN(e,t.dataIndex,r.hidden,i.colours))),series:[{type:`funnel`,sort:`none`,gap:3,left:0,right:0,top:4,bottom:4,minSize:`38%`,maxSize:`100%`,funnelAlign:`center`,animationDuration:900,itemStyle:{borderColor:t.surface,borderWidth:0,borderRadius:6},emphasis:{itemStyle:{shadowBlur:14,shadowColor:`rgba(0,0,0,0.18)`}},label:{show:!0,position:`inside`,fontFamily:t.font,lineHeight:17},data:e.data.map((n,r)=>{let i=tP(o[r],t),c=K(e,a.key,r),l=r?CM(i0().funnelPreviousStepText,{share:X1(c,K(e,a.key,r-1))}):CM(i0().shareOfStepText,{share:X1(c,s),first:c0(rN(e,0))});return{name:rN(e,r),value:c??0,itemStyle:{color:o[r]},label:{formatter:`{n|${c0(rN(e,r))}} {v|${c0(G(c,a.format))}}\n{p|${r?l:i0().firstStageLabel}}`,rich:{n:{color:i,fontSize:12.5,fontWeight:500,fontFamily:t.font},v:{color:i,fontSize:13,fontWeight:700,fontFamily:t.font},p:{color:$N(i,.78),fontSize:12,fontFamily:t.font}}}}})}]}}function pP(e,t,n,r,i){let a=VN(e),{min:o,max:s}=yN(e),c=K(e,a.key,0),l=c??o,u=c==null?null:vN(e,c),d=m0(t.palette,0),f=s-o||1,p=e.bands.length?e.bands.map((e,n)=>[Math.min(1,Math.max(0,(e.upTo-o)/f)),t.seq[1+Math.min(n,3)]]):[[1,t.grid]];return e.bands.length&&(p[p.length-1]?.[0]??1)<1&&p.push([1,t.grid]),{...i.base,tooltip:sP(i.tooltipBase,()=>DN(wN(e,0,r.hidden,i.colours))),series:[{type:`gauge`,startAngle:215,endAngle:-35,min:o,max:s,radius:`96%`,center:[`50%`,`58%`],splitNumber:10,pointer:{show:!1},anchor:{show:!1},progress:{show:c!=null,width:14,roundCap:!0,itemStyle:{color:d,shadowBlur:i.animate?12:0,shadowColor:$N(d,.35)}},axisLine:{roundCap:!0,lineStyle:{width:14,color:p}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:!1},title:{offsetCenter:[0,`30%`],color:t.label,fontSize:12.5,fontFamily:t.font},detail:{valueAnimation:i.animate,offsetCenter:[0,`-4%`],fontFamily:t.font,formatter:e=>`{v|${c0(c==null?G(null):G(e,a.format))}}{u|/${c0(G(s,a.format))}}${u?`\n{s|${c0(u.label)}}`:``}`,rich:{v:{fontSize:36,fontWeight:650,color:t.text,fontFamily:t.font,padding:[0,2,0,0]},u:{fontSize:14,color:t.label,fontFamily:t.font,padding:[12,0,0,0]},s:{fontSize:12,color:t.label,fontFamily:t.font,padding:[8,0,0,0]}}},data:[{value:l,name:e.data[0]?.[e.x.key]==null?a.label:rN(e,0)}]}]}}function mP(e){let t=D0(e.map(e=>e.level).concat(e.map(e=>e.from),e.map(e=>e.to))),n=E0(e.filter(e=>!e.total).map(e=>Math.min(e.from,e.to)).concat(e.filter(e=>e.total).map(e=>e.value))),r=D0(e.filter(e=>!e.total).map(e=>Math.abs(e.value)));if(!(t>0)||!(n>t*.4)||!(r<t*.15))return null;let i=10**Math.floor(Math.log10(t))/10,a=Math.round(t*.08/i)*i,o=Math.floor(n*.965/i)*i;return o>a?{start:a,end:o}:null}function hP(e,t){return D0(e.flatMap(e=>String(e).split(/\s+/)).map(e=>p0(e,M0)))<=t?{interval:0,width:t,overflow:`break`}:{interval:0,rotate:45,width:j0,overflow:`truncate`}}function gP(e,t,n){let r=N0(t.length,n);return e===`all`?{...hP(t,r),hideOverlap:!1}:e===`rotate`?{interval:0,rotate:45,width:j0,overflow:`truncate`,hideOverlap:!1}:e===`ellipsis`?{interval:0,rotate:0,width:Math.max(1,r),overflow:`truncate`,hideOverlap:!1}:{hideOverlap:!0}}function _P(e,t,n){let r=N0(e.length,n),i=hP(e,r);return{nameSize:M0,valueSize:12,category:`rotate`in i?{...i,hideOverlap:!0}:i,showValues:t.every(e=>p0(e,12)<=r)}}function vP(e,t,n,r,i){let a=VN(e),o=bN(e),s=IN(e),c=mP(o),l=t=>CN(e,t.index,i.colours),u=o.map(t=>rN(e,t.index)),d=o.map(e=>e.total?G(e.value,s):TN(e.value,s)),f=o.flatMap(e=>[e.from,e.to]),p=Math.max(p0(G(D0(f),s),11),p0(G(E0(f),s),11))+8,m=_P(u,d,n.width-p-12);return{...i.base,grid:{left:4,right:8,top:28,bottom:4,outerBoundsMode:`same`},tooltip:{...i.tooltipBase,trigger:`axis`,axisPointer:{type:`shadow`,shadowStyle:{color:$N(t.neutral,.1)}},formatter:t=>DN(wN(e,(Array.isArray(t)?t:[t])[0]?.dataIndex??0,r.hidden,i.colours))},xAxis:S0(t,u,{axisLabel:{color:t.label,fontSize:m.nameSize,margin:12,...m.category}}),yAxis:C0(t,e=>G(e,s),{min:0,minInterval:XN(e.y)?1:void 0,splitNumber:5,...c?{breaks:[{start:c.start,end:c.end,gap:`6%`}],breakArea:{show:!0,itemStyle:{color:t.surface,borderColor:t.axis,borderWidth:1,borderType:`solid`,opacity:1},zigzagAmplitude:3,zigzagZ:200}}:{}}),series:[{type:`line`,step:`end`,data:o.map(e=>e.level),symbol:`none`,silent:!0,z:1,lineStyle:{color:t.axis,width:1},tooltip:{show:!1},animation:!1,emphasis:{disabled:!0}},{type:`bar`,stack:`w`,data:o.map(e=>Math.min(e.from,e.to)),silent:!0,itemStyle:{color:`transparent`},emphasis:{disabled:!0},tooltip:{show:!1},barMaxWidth:48},{name:a.key,type:`bar`,stack:`w`,z:3,barMaxWidth:48,barCategoryGap:`34%`,itemStyle:{borderRadius:5},emphasis:{itemStyle:{shadowBlur:10,shadowColor:`rgba(0,0,0,0.15)`}},animationDelay:i.animate?e=>e*140:0,label:{show:m.showValues,position:`top`,distance:6,fontFamily:t.font,fontSize:m.valueSize,fontWeight:600,color:t.text,formatter:e=>d[e.dataIndex]},data:o.map(e=>({value:Math.abs(e.to-e.from),itemStyle:{color:l(e)}}))}]}}function yP(e){let t=VN(e).key;return sN(e).map(n=>({name:n,rows:e.data.map((e,t)=>t).filter(t=>aN(e,t)===n).sort((n,r)=>(K(e,t,r)??0)-(K(e,t,n)??0)||n-r)}))}function bP(e,t,n,r,i){let a=VN(e),o=SN(e),s=[...o.values()].reduce((e,t)=>e+t,0),c=(e,t)=>{let r=(e??0)/s*n.width*n.height*.82;return r>5200&&Math.max(p0(t[0],12),p0(t[1],11.5))+20<=Math.sqrt(r)},l=yP(e).map(({name:n,rows:r},i)=>{let s=o.get(n),l=m0(t.palette,i%t.palette.length),u=tP(l,t);return{name:n,value:s,itemStyle:{color:l,borderColor:l},upperLabel:{color:u,formatter:`{n|${c0(n)}} {v|${c0(G(s,a.format))}}`,rich:{n:{fontWeight:600,fontSize:12,color:u,fontFamily:t.font},v:{fontSize:12,color:$N(u,.8),fontFamily:t.font}}},children:r.map((n,r)=>{let i=eP(l,t.surface,Math.min(.55,r*.14)),o=tP(i,t),s=K(e,a.key,n);return{name:rN(e,n),value:s,row:n,itemStyle:{color:i},label:{show:c(s,[rN(e,n),G(s,a.format)]),formatter:`{n|${c0(rN(e,n))}}\n{v|${c0(G(s,a.format))}}`,rich:{n:{color:o,fontSize:12,fontWeight:500,fontFamily:t.font,lineHeight:16},v:{color:$N(o,.82),fontSize:12,fontFamily:t.font}}}}})}});return{...i.base,tooltip:sP(i.tooltipBase,t=>t.data?.row==null?DN({title:t.name,rows:[{color:t.color,label:a.label,value:G(t.value,a.format)},{label:i0().shareOfAllLabel,value:X1(o0(t.value),s)}],foot:``}):DN(wN(e,t.data.row,r.hidden,i.colours))),series:[{type:`treemap`,roam:!1,nodeClick:!1,breadcrumb:{show:!1},left:0,right:0,top:0,bottom:0,animationDurationUpdate:700,label:{show:!0,position:`insideTopLeft`,padding:[8,10],overflow:`truncate`,fontFamily:t.font},upperLabel:{show:!0,height:28,padding:[0,10],fontFamily:t.font},levels:[{itemStyle:{borderWidth:0,gapWidth:4,borderColor:t.surface}},{itemStyle:{borderWidth:3,gapWidth:2,borderRadius:8}},{itemStyle:{borderWidth:0,gapWidth:0,borderRadius:5},emphasis:{itemStyle:{borderColor:t.text,borderWidth:0}}}],data:l}]}}function xP(e){let t=UN(e),n=e.data.map(n=>[String(n[e.x.key]),String(n[t])]),r=new Map(n.flatMap(([e,t])=>[[e,0],[t,0]]));for(let e=0;e<r.size;e+=1)for(let[e,t]of n)r.set(t,Math.max(r.get(t)??0,(r.get(e)??0)+1));return r}function SP(e,t,n,r,i){let a=VN(e),o=UN(e),s=xN(e,t.palette),c=xP(e),l=D0([...c.values()]),u=new Map,d=new Map;e.data.forEach((t,n)=>{let r=K(e,a.key,n)??0;u.set(String(t[e.x.key]),(u.get(String(t[e.x.key]))??0)+r),d.set(String(t[o]),(d.get(String(t[o]))??0)+r)});let f=e=>d.get(e)??u.get(e)??0,p=e=>({position:e,color:t.text,fontFamily:t.font,fontSize:12,formatter:e=>`{n|${c0(e.name)}}\n{v|${G(f(e.name),{style:`compact`})}}`,rich:{n:{color:t.textBody,fontSize:12,fontFamily:t.font,lineHeight:15},v:{color:t.label,fontSize:12,fontFamily:t.font}}});return{...i.base,tooltip:sP(i.tooltipBase,t=>DN(t.dataType===`edge`?wN(e,t.dataIndex,r.hidden,i.colours):{title:t.name,rows:[{color:t.color,label:a.label,value:G(f(t.name),a.format)}],foot:``})),series:[{type:`sankey`,left:0,right:0,top:6,bottom:6,nodeWidth:10,nodeGap:i.compact?10:14,nodeAlign:`justify`,draggable:!1,layoutIterations:64,animationDuration:1200,emphasis:{focus:`adjacency`,lineStyle:{opacity:.55}},itemStyle:{borderWidth:0,borderRadius:3},lineStyle:{curveness:.5},levels:Array.from({length:l+1},(e,t)=>({depth:t,label:p(t===l&&l>0?`left`:`right`)})),data:[...c.keys()].map(e=>({name:e,itemStyle:{color:s.get(e)}})),links:e.data.map(n=>({source:String(n[e.x.key]),target:String(n[o]),value:n[a.key],lineStyle:{color:s.get(String(n[e.x.key])),opacity:t.dark?.32:.26}}))}]}}function CP(e){let t=e.length,n=e.reduce((e,t)=>e+t[0],0)/t,r=e.reduce((e,t)=>e+t[1],0)/t,i=e.reduce((e,t)=>e+(t[0]-n)**2,0);if(!t||!i)return null;let a=e.reduce((e,t)=>e+(t[0]-n)*(t[1]-r),0)/i,o=E0(e.map(e=>e[1])),s=D0(e.map(e=>e[1])),c=e=>{let t=r+a*(e-n);return t<o?[e+(o-t)/a,o]:t>s?[e+(s-t)/a,s]:[e,t]};return[c(E0(e.map(e=>e[0]))),c(D0(e.map(e=>e[0])))]}function wP(e,t,n,r,i){let a=VN(e),o=sN(e),s=e.type===`bubble`,c=D0(s?e.data.map(t=>t[WN(e)]).filter(a0):[]),l=e=>Math.max(I0,(i.compact?F0:P0)*Math.sqrt(e/c)),u=t=>e.data.map((e,t)=>t).filter(n=>!e.group||aN(e,n)===t),d=(e.group?o:[null]).filter(e=>e==null||!r.hidden.has(e)).flatMap(e=>u(e)),f=e.trend?CP(d.flatMap(t=>{let n=HN(e,t)[e.x.key],r=K(e,a.key,t);return a0(n)&&r!=null?[[n,r]]:[]})):null,p=e.data.map(t=>t[e.x.key]),m=e.data.map((t,n)=>K(e,a.key,n)),[h,g]=l0(p,!1),[_,v]=l0(m,!1),y=ZN(e.y.format,e.y.min??_,e.y.max??v,4),b=ZN(e.x.format,h,g,4),x=(e.group?o:[null]).map((n,r)=>({name:n??a.key,type:`scatter`,symbolSize:s?e=>l(e[2]??NaN):i.compact?8:10,itemStyle:{color:$N(t.palette[r],.85),borderColor:t.surface,borderWidth:1.5},emphasis:{focus:`series`,scale:1.5,itemStyle:{color:t.palette[r]}},blur:{itemStyle:{opacity:.15}},animationDelay:i.animate?e=>e*6+r*120:0,data:u(n).map(t=>({value:[HN(e,t)[e.x.key],K(e,a.key,t),...s?[HN(e,t)[WN(e)]]:[]],row:t}))}));return f&&x.push({name:i0().trendLabel,type:`line`,data:f,symbol:`none`,silent:!0,z:1,tooltip:{show:!1},lineStyle:{color:t.label,width:1.5,type:[6,4]},emphasis:{disabled:!0},endLabel:{show:!0,formatter:i0().trendLabel,color:t.label,fontSize:12,fontFamily:t.font,offset:[-30,-12]}}),{...i.base,grid:{left:4,right:16,top:e.y.label?28:12,bottom:e.x.label?24:4,outerBoundsMode:`same`},tooltip:sP(i.tooltipBase,t=>t.data?.row==null?``:DN(wN(e,t.data.row,r.hidden,i.colours))),xAxis:C0(t,e=>G(e,b),{scale:!0,minInterval:XN(e.x)?1:void 0,splitLine:{show:!1},axisLine:{show:!0,lineStyle:{color:t.axis}},...e.x.label?{name:e.x.label,nameLocation:`middle`,nameGap:28,nameTextStyle:{color:t.label,fontSize:12,fontFamily:t.font}}:{}}),yAxis:C0(t,e=>G(e,y),{min:e.y.min,max:e.y.max,minInterval:XN(e.y)?1:void 0,...e.y.label?{name:e.y.label,nameLocation:`end`,nameGap:12,nameTextStyle:{color:t.label,fontSize:12,fontFamily:t.font,align:`left`}}:{}}),series:x}}function TP(e,t,n,r,i){let a=e.x.kind===`time`,o=e.series.length,s=(n.height-6-z0)/o,c=s-L0-R0,l=m0(t.palette,0),u=e.data.map((t,n)=>rN(e,n)),d=e.series.flatMap((n,r)=>{let i=x0(e,n.key).filter(e=>e!=null).pop();return[{text:n.label,left:0,top:6+r*s,textStyle:{fontSize:12.5,fontWeight:600,color:t.text,fontFamily:t.font}},{text:CM(i0().latestText,{latest:G(i,n.format)}),right:8,top:7+r*s,textStyle:{fontSize:12,fontWeight:500,color:t.label,fontFamily:t.font}}]}),f=(t,n)=>{let r=K(e,t.key,n);return a?[y0(iN(e,n),e.timeZone),r]:r};return{...i.base,useUTC:a,title:d,grid:e.series.map((e,t)=>({left:52,right:8,top:6+t*s+L0,height:c})),axisPointer:{link:[{xAxisIndex:`all`}],lineStyle:{color:t.axis},label:{show:!1}},tooltip:{...i.tooltipBase,trigger:`axis`,axisPointer:{type:`line`,lineStyle:{color:t.axis}},formatter:t=>DN(wN(e,(Array.isArray(t)?t:[t])[0]?.dataIndex??0,r.hidden,i.colours))},xAxis:e.series.map((n,r)=>({...a?{type:`time`}:S0(t,u,{boundaryGap:!1}),gridIndex:r,axisLine:{lineStyle:{color:r===o-1?t.axis:t.grid}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:r===o-1,color:t.label,fontSize:12,hideOverlap:!0,margin:10,...a?{formatter:nP(e)}:{}}})),yAxis:e.series.map((n,r)=>{let[i,a]=l0(x0(e,n.key),!1),o=ZN(n.format,e.y.min??i,e.y.max??a,2);return C0(t,e=>G(e,o),{gridIndex:r,splitNumber:2,scale:e.y.min==null,min:e.y.min,max:e.y.max,minInterval:XN(n)?1:void 0,axisLabel:{color:t.label,fontSize:12,formatter:e=>G(e,o)}})}),series:e.series.map((n,r)=>({id:n.key,name:n.key,type:`line`,xAxisIndex:r,yAxisIndex:r,data:e.data.map((e,t)=>f(n,t)),smooth:.3,symbol:`circle`,showSymbol:!1,symbolSize:7,lineStyle:{width:1.75,color:l},itemStyle:{color:l,borderColor:t.surface,borderWidth:2},areaStyle:{color:v0(l,t.dark?.26:.16)},animationDelay:i.animate?r*160:0,emphasis:{disabled:!0}}))}}function EP(e,t,n,r){let i=r?.start??(e.data.length>5e3?70:0),a=r?.end??100;return[{type:`inside`,start:i,end:a},{type:`slider`,start:i,end:a,height:26,bottom:8,left:52,right:12,borderColor:`transparent`,backgroundColor:t.grid,borderRadius:6,fillerColor:$N(n,t.dark?.22:.12),handleStyle:{color:t.surface,borderColor:t.axis},moveHandleSize:0,brushSelect:!1,dataBackground:{lineStyle:{color:t.axis,width:.75},areaStyle:{color:$N(t.neutral,.15)}},selectedDataBackground:{lineStyle:{color:n,width:.75},areaStyle:{color:$N(n,.18)}},textStyle:{color:t.label,fontSize:12,fontFamily:t.font}}]}function DP(e,t,n){switch(e.type){case`scatter`:case`bubble`:{if(!e.group)return{seriesIndex:0,dataIndex:n};let t=aN(e,n),r=e.data.map((e,t)=>t).filter(n=>aN(e,n)===t);return{seriesIndex:sN(e).indexOf(t),dataIndex:r.indexOf(n)}}case`waterfall`:return{seriesIndex:2,dataIndex:n};case`sankey`:return{seriesIndex:0,dataIndex:n,dataType:`edge`,tip:!1};case`treemap`:{let t=1;for(let r of yP(e)){let e=r.rows.indexOf(n);if(e>=0)return{seriesIndex:0,dataIndex:t+1+e};t+=1+r.rows.length}return{seriesIndex:0,dataIndex:n}}case`gauge`:case`donut`:case`heatmap`:case`calendar`:case`funnel`:return{seriesIndex:0,dataIndex:n};default:return{seriesIndex:t,dataIndex:n}}}function OP(e,t){switch(e.type){case`scatter`:case`bubble`:case`treemap`:{let e=qN(t.data);return e==null?null:{series:0,row:e}}case`sankey`:return t.dataType===`edge`?{series:0,row:t.dataIndex}:null;case`waterfall`:return t.seriesIndex===2?{series:0,row:t.dataIndex}:null;case`line`:case`area`:case`column`:case`bar`:case`multiples`:return t.seriesIndex==null?null:{series:t.seriesIndex,row:t.dataIndex};default:return{series:0,row:t.dataIndex}}}function kP(e,t,n,r,{pixelRatio:i=2}={}){let a=document.createElement(`div`);a.style.cssText=`position:fixed;left:-10000px;top:0;width:${n.width}px;height:${n.height}px;`,document.body.append(a);let o=PC(a,null,{renderer:`canvas`,devicePixelRatio:i,width:n.width,height:n.height});try{return o.setOption(iP(e,t,n,{...r,renderer:`canvas`,animation:!1})),o.getDataURL({type:`png`,pixelRatio:i,backgroundColor:t.surface})}finally{o.dispose(),a.remove()}}function AP(e,{renderer:t}){let n=PC(e,null,{renderer:t}),r=!1,i=null;return{renderer:t,render(e,t,a,o,{replace:s=!1}={}){let c=r&&!s?JN(n.getOption()):null,l=iP(e,t,a,{...o,zoom:c});i=e,n.setOption(l,s||!r?{notMerge:!0}:{replaceMerge:s0}),r=!0},focusPoint(e,t){let{tip:r=!0,...a}=DP(YN(i),e,t);n.dispatchAction({type:`downplay`}),n.dispatchAction({type:`highlight`,...a}),r&&n.dispatchAction({type:`showTip`,...a})},clearFocus(){n.dispatchAction({type:`hideTip`}),n.dispatchAction({type:`downplay`})},resize(){n.resize()},flush(){n.getZr().flush()},onSelect(e){n.on(`click`,t=>{if(t.componentType!==`series`)return;let n=OP(YN(i),t);n&&e({seriesIndex:n.series,dataIndex:n.row})})},onFinished(e){n.on(`finished`,e)},dispose(){n.dispose()}}}function jP(e){return e.key===`Enter`&&e.isComposing!==!0&&e.keyCode!==229}function MP(e,t){let n=[...new Set(t)].filter(e=>e&&!t2.has(e));if(!n.length)return;let r=document.createElement(`span`);r.hidden=!0;let i=n.map(e=>{let t=document.createElement(`span`);return t.style.setProperty(`forced-color-adjust`,`none`),t.style.color=e,r.append(t),[e,t]});e.append(r);for(let[e,t]of i)t2.set(e,getComputedStyle(t).color);r.remove()}function NP(e){let t=getComputedStyle(e),n=!!$0(X0)?.matches,r=e=>t.getPropertyValue(e).trim();n&&MP(e,n2.map(r));let i=e=>n?t2.get(r(e))??r(e):r(e),a=e.closest(`[data-bs-theme], [data-theme]`)??document.documentElement,o=a.getAttribute(`data-bs-theme`)||a.getAttribute(`data-theme`),s={palette:[1,2,3,4,5,6,7,8].map(e=>i(`--color-chart-${e}`)),seq:[0,1,2,3,4,5,6].map(e=>i(`--color-chart-seq-${e}`)),neutral:i(`--color-chart-neutral`),grid:i(`--color-chart-grid`),axis:i(`--color-chart-axis`),label:i(`--color-chart-label`),surface:i(`--color-surface`),text:i(`--color-text`),textBody:i(`--color-text-body`),textMuted:i(`--color-text-muted`),shadow:r(`--wui-shadow-popover`),font:t.fontFamily,dark:o===`dark`||o===`auto`&&!!$0(J0)?.matches,reducedMotion:!!$0(Y0)?.matches};return!s.palette[0]&&!e2&&(e2=!0,vM(`[@webority/ui-elements] <wui-chart> found no --color-chart-* colours: load @webority/theme on the page.`)),s}function PP(e){if(r2.add(e),i2)return;let t=()=>{t2.clear();for(let e of r2)e._themeChanged()},n=()=>{t2.clear();for(let e of r2)e._themeChanged(!0)},r=new MutationObserver(t);r.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`,`data-bs-theme`,`class`]});let i=new MutationObserver(t);i.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:[`data-theme`,`data-bs-theme`]});let a=[[J0,t],[Y0,t],[X0,t],[Z0,t],[Q0,n]],o=[];for(let[e,t]of a){let n=$0(e);n&&o.push([n,t])}for(let[e,t]of o)e.addEventListener?.(`change`,t);window.addEventListener(`beforeprint`,n),window.addEventListener(`afterprint`,t),i2=()=>{r.disconnect(),i.disconnect();for(let[e,t]of o)e.removeEventListener?.(`change`,t);window.removeEventListener(`beforeprint`,n),window.removeEventListener(`afterprint`,t),i2=null}}function FP(e){r2.delete(e),r2.size||i2?.()}function IP(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,document.body.append(n),n.click(),n.remove()}var LP,RP,zP,BP,VP,HP,UP,WP,GP,KP,qP,JP,YP,XP,ZP,QP,$P,eF,tF,nF,rF,iF,q,aF,oF,sF,cF,lF,uF,dF,fF,pF,mF,hF,gF,_F,vF,yF,bF,xF,SF,CF,wF,TF,EF,DF,OF,kF,AF,jF,MF,NF,PF,FF,IF,LF,J,RF,zF,BF,VF,HF,UF,WF,GF,KF,qF,JF,YF,XF,ZF,QF,$F,eI,tI,nI,rI,iI,aI,oI,sI,cI,lI,uI,dI,fI,pI,mI,hI,gI,_I,vI,yI,bI,xI,SI,CI,wI,TI,EI,DI,OI,kI,AI,jI,MI,NI,PI,FI,II,LI,RI,zI,BI,VI,HI,UI,WI,GI,KI,qI,JI,YI,XI,ZI,QI,$I,eL,tL,nL,rL,iL,aL,oL,sL,cL,lL,uL,dL,fL,pL,mL,hL,gL,_L,vL,yL,bL,xL,SL,CL,wL,TL,EL,DL,OL,kL,AL,jL,ML,NL,PL,FL,IL,LL,RL,zL,BL,VL,HL,UL,WL,GL,KL,qL,JL,YL,XL,ZL,QL,$L,eR,tR,nR,rR,iR,aR,oR,sR,cR,lR,uR,dR,fR,pR,mR,hR,gR,_R,vR,yR,bR,xR,SR,CR,wR,Y,TR,ER,DR,OR,kR,AR,jR,MR,NR,PR,FR,IR,LR,RR,zR,BR,VR,HR,UR,WR,GR,KR,qR,JR,YR,XR,ZR,QR,$R,ez,tz,nz,rz,iz,az,oz,sz,cz,lz,uz,dz,fz,pz,mz,hz,gz,_z,vz,yz,bz,xz,Sz,Cz,wz,Tz,Ez,Dz,Oz,kz,Az,jz,Mz,Nz,Pz,Fz,Iz,Lz,Rz,zz,Bz,Vz,Hz,Uz,Wz,Gz,Kz,qz,Jz,Yz,Xz,Zz,Qz,$z,eB,tB,nB,rB,iB,aB,oB,sB,cB,lB,uB,dB,fB,pB,mB,hB,gB,_B,vB,yB,bB,xB,SB,CB,wB,TB,EB,DB,OB,kB,AB,jB,MB,NB,PB,FB,IB,LB,RB,zB,BB,VB,HB,UB,WB,GB,KB,qB,JB,YB,XB,ZB,QB,$B,eV,tV,nV,rV,iV,aV,oV,sV,cV,lV,uV,dV,fV,pV,mV,hV,gV,_V,vV,yV,bV,xV,SV,CV,wV,TV,EV,DV,OV,kV,AV,jV,MV,NV,PV,FV,IV,LV,RV,zV,BV,VV,HV,UV,WV,GV,KV,qV,JV,YV,XV,ZV,QV,$V,eH,tH,nH,rH,iH,aH,oH,sH,cH,lH,uH,dH,fH,pH,mH,hH,gH,_H,vH,yH,bH,xH,SH,CH,wH,TH,EH,DH,OH,kH,AH,jH,MH,NH,PH,FH,X,IH,LH,RH,zH,BH,VH,HH,UH,WH,GH,KH,qH,JH,YH,XH,ZH,QH,$H,eU,tU,nU,rU,iU,aU,oU,sU,cU,lU,uU,dU,fU,pU,mU,hU,gU,_U,vU,yU,bU,xU,SU,CU,wU,TU,EU,DU,OU,kU,AU,jU,MU,NU,PU,FU,IU,LU,RU,zU,BU,VU,HU,UU,WU,GU,KU,qU,JU,YU,XU,ZU,QU,$U,eW,tW,nW,rW,iW,aW,oW,sW,cW,lW,uW,dW,fW,pW,mW,hW,gW,_W,vW,yW,bW,xW,SW,CW,wW,TW,EW,DW,OW,kW,AW,jW,MW,NW,PW,FW,IW,LW,RW,zW,BW,VW,HW,UW,WW,GW,KW,qW,JW,YW,XW,ZW,QW,$W,eG,tG,nG,rG,iG,aG,oG,sG,cG,lG,uG,dG,fG,pG,mG,hG,gG,_G,vG,yG,bG,xG,SG,CG,wG,TG,EG,DG,OG,kG,AG,jG,MG,NG,PG,FG,IG,LG,RG,zG,BG,VG,HG,UG,WG,GG,KG,qG,JG,YG,XG,ZG,QG,$G,eK,tK,nK,rK,iK,aK,oK,sK,cK,lK,uK,dK,fK,pK,mK,hK,gK,_K,vK,yK,bK,xK,SK,CK,wK,TK,EK,DK,OK,kK,AK,jK,MK,NK,PK,Z,FK,IK,LK,RK,zK,BK,VK,HK,UK,WK,GK,KK,qK,JK,YK,XK,ZK,QK,$K,eq,tq,nq,rq,iq,aq,oq,sq,cq,lq,uq,dq,fq,pq,mq,hq,gq,_q,vq,yq,bq,xq,Sq,Cq,wq,Tq,Eq,Dq,Oq,kq,Aq,jq,Mq,Nq,Pq,Fq,Iq,Lq,Rq,zq,Bq,Vq,Hq,Uq,Wq,Gq,Kq,qq,Jq,Yq,Xq,Zq,Qq,$q,eJ,tJ,nJ,rJ,iJ,aJ,oJ,sJ,cJ,lJ,uJ,dJ,fJ,pJ,mJ,hJ,gJ,_J,vJ,yJ,bJ,xJ,SJ,CJ,wJ,TJ,EJ,DJ,OJ,kJ,AJ,jJ,MJ,NJ,PJ,FJ,IJ,LJ,RJ,zJ,BJ,VJ,HJ,UJ,WJ,GJ,KJ,qJ,JJ,YJ,XJ,ZJ,QJ,$J,eY,tY,nY,rY,iY,aY,oY,sY,cY,lY,uY,dY,fY,pY,mY,hY,gY,_Y,vY,yY,bY,xY,SY,CY,wY,TY,EY,DY,OY,kY,AY,jY,MY,NY,PY,FY,IY,LY,RY,zY,BY,VY,HY,UY,WY,GY,KY,qY,JY,YY,XY,ZY,QY,$Y,eX,tX,nX,rX,iX,aX,oX,sX,cX,lX,uX,dX,fX,pX,mX,hX,gX,_X,vX,yX,bX,xX,SX,CX,wX,TX,EX,DX,OX,kX,AX,jX,MX,NX,PX,FX,IX,LX,RX,zX,BX,VX,HX,UX,WX,GX,KX,qX,JX,YX,XX,ZX,QX,$X,eZ,tZ,nZ,rZ,iZ,aZ,oZ,sZ,cZ,lZ,uZ,dZ,fZ,pZ,mZ,hZ,gZ,_Z,vZ,yZ,bZ,xZ,SZ,CZ,wZ,TZ,EZ,DZ,OZ,kZ,AZ,jZ,MZ,NZ,PZ,FZ,IZ,LZ,RZ,zZ,BZ,VZ,HZ,UZ,WZ,GZ,KZ,qZ,JZ,YZ,XZ,ZZ,QZ,$Z,eQ,tQ,nQ,rQ,iQ,aQ,oQ,sQ,cQ,lQ,uQ,dQ,fQ,pQ,mQ,hQ,gQ,_Q,vQ,yQ,bQ,xQ,SQ,CQ,wQ,TQ,EQ,DQ,OQ,kQ,AQ,jQ,MQ,NQ,PQ,FQ,IQ,LQ,RQ,zQ,BQ,VQ,HQ,UQ,WQ,GQ,KQ,qQ,JQ,YQ,XQ,ZQ,QQ,$Q,e$,t$,n$,r$,i$,a$,o$,s$,c$,l$,u$,d$,f$,p$,m$,h$,g$,_$,v$,y$,b$,x$,S$,C$,w$,T$,E$,D$,O$,k$,A$,j$,M$,N$,P$,F$,I$,L$,R$,z$,B$,V$,H$,U$,W$,G$,K$,q$,J$,Y$,X$,Z$,Q$,$$,e1,t1,n1,r1,i1,a1,o1,s1,c1,Q,l1,u1,d1,f1,p1,m1,h1,g1,_1,v1,y1,b1,x1,S1,C1,w1,T1,E1,D1,O1,k1,A1,j1,M1,N1,P1,F1,I1,L1,R1,z1,B1,V1,H1,U1,W1,G1,K1,q1,J1,Y1,X1,Z1,Q1,$1,e0,t0,n0,r0,i0,a0,o0,s0,c0,l0,u0,d0,f0,p0,m0,h0,g0,_0,v0,y0,b0,x0,S0,C0,w0,T0,E0,D0,O0,k0,A0,j0,M0,N0,P0,F0,I0,L0,R0,z0,B0,V0,H0,U0,W0,G0,K0,q0,J0,Y0,X0,Z0,Q0,$0,e2,t2,n2,r2,i2,a2,o2,s2,c2=t((()=>{for(var e in LP=Object.defineProperty,RP=(e,t)=>{let n={};for(var r in e)LP(n,r,{get:e[r],enumerable:!0});return t||LP(n,Symbol.toStringTag,{value:`Module`}),n},zP=function(e,t){return zP=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},zP(e,t)},BP=`12px sans-serif`,VP=20,HP=100,UP=`007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N`,WP=Ea(UP),GP={createCanvas:function(){return typeof document<`u`&&document.createElement(`canvas`)},measureText:(function(){var e,t;return function(n,r){if(!e){var i=GP.createCanvas();e=i&&i.getContext(`2d`)}if(e)return t!==r&&(t=e.font=r||`12px sans-serif`),e.measureText(n);n||=``,r||=`12px sans-serif`;var a=/((?:\d+)?\.?\d*)px/.exec(r),o=a&&+a[1]||12,s=0;if(r.indexOf(`mono`)>=0)s=o*n.length;else for(var c=0;c<n.length;c++){var l=WP[n[c]];s+=l==null?o:l*o}return{width:s}}})(),loadImage:function(e,t,n){var r=new Image;return r.onload=t,r.onerror=n,r.src=e,r},getTime:function(){return Date.now?Date.now():+new Date}},KP=La([`Function`,`RegExp`,`Date`,`Error`,`CanvasGradient`,`CanvasPattern`,`Image`,`Canvas`],function(e,t){return e[`[object `+t+`]`]=!0,e},{}),qP=La([`Int8`,`Uint8`,`Uint8Clamped`,`Int16`,`Uint16`,`Int32`,`Uint32`,`Float32`,`Float64`],function(e,t){return e[`[object `+t+`Array]`]=!0,e},{}),JP=Object.prototype.toString,YP=Array.prototype,XP=YP.forEach,ZP=YP.filter,QP=YP.slice,$P=YP.map,eF=function(){}.constructor,tF=eF?eF.prototype:null,nF=`__proto__`,rF=2311,iF=2**53-1,GP.createCanvas,q=tF&&B(tF.bind)?tF.call.bind(tF.bind):Va,aF=`__ec_primitive__`,oF=function(){function e(){this.data={}}return e.prototype.delete=function(e){var t=this.has(e);return t&&delete this.data[e],t},e.prototype.has=function(e){return this.data.hasOwnProperty(e)},e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){return this.data[e]=t,this},e.prototype.keys=function(){return Ba(this.data)},e.prototype.forEach=function(e){var t=this.data;for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},e}(),sF=typeof Map==`function`,cF=function(){function e(t){var n=z(t);this.data=ree();var r=this;t instanceof e?t.each(i):t&&L(t,i);function i(e,t){n?r.set(e,t):r.set(t,e)}}return e.prototype.hasKey=function(e){return this.data.has(e)},e.prototype.get=function(e){return this.data.get(e)},e.prototype.set=function(e,t){return this.data.set(e,t),t},e.prototype.each=function(e,t){this.data.forEach(function(n,r){e.call(t,n,r)})},e.prototype.keys=function(){var e=this.data.keys();return sF?Array.from(e):e},e.prototype.removeKey=function(e){this.data.delete(e)},e}(),lF=180/Math.PI,uF=function(){function e(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return e}(),dF=new(function(){function e(){this.browser=new uF,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<`u`}return e}()),typeof wx==`object`&&typeof wx.getSystemInfoSync==`function`?(dF.wxa=!0,dF.touchEventsSupported=!0):typeof document>`u`&&typeof self<`u`?dF.worker=!0:!dF.hasGlobalWindow||`Deno`in window||typeof navigator<`u`&&typeof navigator.userAgent==`string`&&navigator.userAgent.indexOf(`Node.js`)>-1?(dF.node=!0,dF.svgSupported=!0):lo(navigator.userAgent,dF),fF=`.`,pF=`___EC__COMPONENT__CONTAINER___`,mF=`___EC__EXTENDED_CLASS___`,hF=Math.round(Math.random()*10),gF=xo([[`fill`,`color`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`opacity`],[`shadowColor`]]),_F=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return gF(this,e,t)},e}(),vF=function(){function e(e){this.value=e}return e}(),yF=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new vF(e);return this.insertEntry(t),t},e.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++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),bF=function(){function e(e){this._list=new yF,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,r=this._map,i=null;if(r[e]==null){var a=n.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=n.head;n.remove(s),delete r[s.key],i=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new vF(t),o.key=e,n.insertEntry(o),r[e]=o}return i},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(t!=null)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),xF=new bF(50),SF=Wo,CF=Go,wF=function(){function e(e,t){this.x=e||0,this.y=t||0}return e.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(e,t){return this.x=e,this.y=t,this},e.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},e.prototype.scale=function(e){this.x*=e,this.y*=e},e.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},e.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},e.prototype.dot=function(e){return this.x*e.x+this.y*e.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},e.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},e.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},e.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},e.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},e.set=function(e,t,n){e.x=t,e.y=n},e.copy=function(e,t){e.x=t.x,e.y=t.y},e.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},e.lenSquare=function(e){return e.x*e.x+e.y*e.y},e.dot=function(e,t){return e.x*t.x+e.y*t.y},e.add=function(e,t,n){e.x=t.x+n.x,e.y=t.y+n.y},e.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},e.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},e.scaleAndAdd=function(e,t,n,r){e.x=t.x+n.x*r,e.y=t.y+n.y*r},e.lerp=function(e,t,n,r){var i=1-r;e.x=i*t.x+r*n.x,e.y=i*t.y+r*n.y},e}(),TF=Math.min,EF=Math.max,DF=Math.abs,OF=[`x`,`y`],kF=[`width`,`height`],AF=new wF,jF=new wF,MF=new wF,NF=new wF,PF=Zo(),FF=PF.minTv,IF=PF.maxTv,LF=[0,0],J=function(){function e(e,t,n,r){zF(this,e,t,n,r)}return e.set=function(e,t,n,r,i){return r<0&&(t+=r,r=-r),i<0&&(n+=i,i=-i),e.x=t,e.y=n,e.width=r,e.height=i,e},e.prototype.union=function(e){var t=TF(e.x,this.x),n=TF(e.y,this.y);this.width=isFinite(this.x)&&isFinite(this.width)?EF(e.x+e.width,this.x+this.width)-t:e.width,this.height=isFinite(this.y)&&isFinite(this.height)?EF(e.y+e.height,this.y+this.height)-n:e.height,this.x=t,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(e){return VF(Eo(),this,e)},e.prototype.intersect=function(t,n,r){return e.intersect(this,t,n,r)},e.intersect=function(t,n,r,i){r&&wF.set(r,0,0);var a=i&&i.outIntersectRect||null,o=i&&i.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!t||!n)return!1;t instanceof e||(t=zF(WF,t.x,t.y,t.width,t.height)),n instanceof e||(n=zF(GF,n.x,n.y,n.width,n.height));var s=!!r;PF.reset(i,s);var c=PF.touchThreshold,l=t.x+c,u=t.x+t.width-c,d=t.y+c,f=t.y+t.height-c,p=n.x+c,m=n.x+n.width-c,h=n.y+c,g=n.y+n.height-c;if(l>u||d>f||p>m||h>g)return!1;var _=!(u<p||m<l||f<h||g<d);return(s||a)&&(LF[0]=1/0,LF[1]=0,Xo(l,u,p,m,0,s,a,o),Xo(d,f,h,g,1,s,a,o),s&&wF.copy(r,_?PF.useDir?PF.dirMinTv:FF:IF)),_},e.contain=function(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height},e.prototype.contain=function(t,n){return e.contain(this,t,n)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(e){BF(this,e)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t?t.x:0,t?t.y:0,t?t.width:0,t?t.height:0)},e.copy=function(e,t){return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e},e.applyTransform=function(e,t,n){if(!n)e!==t&&BF(e,t);else if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var r=n[0],i=n[3],a=n[4],o=n[5];e.x=t.x*r+a,e.y=t.y*i+o,e.width=t.width*r,e.height=t.height*i,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height)}else{AF.x=MF.x=t.x,AF.y=NF.y=t.y,jF.x=NF.x=t.x+t.width,jF.y=MF.y=t.y+t.height,AF.transform(n),NF.transform(n),jF.transform(n),MF.transform(n),e.x=TF(AF.x,jF.x,MF.x,NF.x),e.y=TF(AF.y,jF.y,MF.y,NF.y);var s=EF(AF.x,jF.x,MF.x,NF.x),c=EF(AF.y,jF.y,MF.y,NF.y);e.width=s-e.x,e.height=c-e.y}},e.calculateTransform=function(e,t,n){var r=n.width/t.width,i=n.height/t.height;return e=Do(e||[]),Ao(e,e,Lo(KF,-t.x,-t.y)),Mo(e,e,Lo(KF,r,i)),Ao(e,e,Lo(KF,n.x,n.y)),e},e}(),RF=J.create,zF=J.set,BF=J.copy,VF=J.calculateTransform,HF=J.applyTransform,UF=J.contain,WF=new J(0,0,0,0),GF=new J(0,0,0,0),KF=[],JF=0,YF=5,XF=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,ZF=function(){function e(){}return e}(),QF=function(){function e(e){this.tokens=[],e&&(this.tokens=e)}return e}(),$F=function(){function e(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return e}(),eI=La(`,&?/;] `.split(``),function(e,t){return e[t]=!0,e},{}),tI=new J(0,0,0,0),nI={outIntersectRect:{},clamp:!0},rI=Do,iI=5e-5,aI=[],oI=[],sI=Eo(),cI=Math.abs,lI=function(){function e(){}return e.prototype.getLocalTransform=function(e){return uI(this,e)},e.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},e.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},e.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},e.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},e.prototype.needLocalTransform=function(){return ws(this.rotation)||ws(this.x)||ws(this.y)||ws(this.scaleX-1)||ws(this.scaleY-1)||ws(this.skewX)||ws(this.skewY)},e.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;t||e?(n||=Eo(),t?this.getLocalTransform(n):rI(n),e&&(t?ko(n,e,n):Oo(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n),this.invTransform=this.invTransform||Eo(),No(this.invTransform,n)):n&&(rI(n),this.invTransform=null)},e.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(aI);var n=aI[0]<0?-1:1,r=aI[1]<0?-1:1,i=((aI[0]-n)*t+n)/aI[0]||0,a=((aI[1]-r)*t+r)/aI[1]||0;e[0]*=i,e[1]*=i,e[2]*=a,e[3]*=a}},e.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},e.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],r=Math.atan2(e[1],e[0]),i=Math.PI/2+r-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(i),t=Math.sqrt(t),this.skewX=i,this.skewY=0,this.rotation=-r,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||Eo(),ko(oI,e.invTransform,t),t=oI);var n=this.originX,r=this.originY;(n||r)&&(sI[4]=n,sI[5]=r,ko(oI,t,sI),oI[4]-=n,oI[5]-=r,t=oI),this.setLocalTransform(t)}},e.prototype.getGlobalScale=function(e){var t=this.transform;return e||=[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},e.prototype.transformCoordToLocal=function(e,t){var n=[e,t],r=this.invTransform;return r&&qo(n,n,r),n},e.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],r=this.transform;return r&&qo(n,n,r),n},e.prototype.getLineScale=function(){var e=this.transform;return e&&cI(e[0]-1)>1e-10&&cI(e[3]-1)>1e-10?Math.sqrt(cI(e[0]*e[3]-e[2]*e[1])):1},e.prototype.copyTransform=function(e){Es(this,e)},e.getLocalTransform=function(e,t){t||=[];var n=e.originX||0,r=e.originY||0,i=e.scaleX,a=e.scaleY,o=e.anchorX,s=e.anchorY,c=e.rotation||0,l=e.x,u=e.y,d=e.skewX?Math.tan(e.skewX):0,f=e.skewY?Math.tan(-e.skewY):0;if(n||r||o||s){var p=n+o,m=r+s;t[4]=-p*i-d*m*a,t[5]=-m*a-f*p*i}else t[4]=t[5]=0;return t[0]=i,t[3]=a,t[1]=f*i,t[2]=d*a,c&&jo(t,t,c),t[4]+=n+l,t[5]+=r+u,t},e.initDefaultProps=(function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0})(),e}(),uI=lI.getLocalTransform,dI=[`x`,`y`,`originX`,`originY`,`anchorX`,`anchorY`,`rotation`,`scaleX`,`scaleY`,`skewX`,`skewY`],fI={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:1024**(e-1)},exponentialOut:function(e){return e===1?1:1-2**(-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*1024**(e-1):.5*(-(2**(-10*(e-1)))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)))},elasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*2**(-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},elasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-.5*(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)):n*2**(-10*--e)*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-fI.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?fI.bounceIn(e*2)*.5:fI.bounceOut(e*2-1)*.5+.5}},pI=Math.pow,mI=Math.sqrt,hI=1e-8,gI=1e-4,_I=mI(3),vI=1/3,yI=Po(),bI=Po(),xI=Po(),SI=/cubic-bezier\(([0-9,\.e ]+)\)/,CI=function(){function e(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||co,this.ondestroy=e.ondestroy||co,this.onrestart=e.onrestart||co,e.easing&&this.setEasing(e.easing)}return e.prototype.step=function(e,t){if(this._inited||=(this._startTime=e+this._delay,!0),this._paused)this._pausedTime+=t;else{var n=this._life,r=e-this._startTime-this._pausedTime,i=r/n;i<0&&(i=0),i=Math.min(i,1);var a=this.easingFunc,o=a?a(i):i;if(this.onframe(o),i===1){if(this.loop){var s=r%n;this._startTime=e-s,this._pausedTime=0,this.onrestart()}else return!0}return!1}},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(e){this.easing=e,this.easingFunc=B(e)?e:fI[e]||Us(e)},e}(),wI={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]},TI=new bF(20),EI=null,DI=new bF(100),OI=Math.round,kI=1e-4,AI={left:`start`,right:`end`,center:`middle`,middle:`middle`},jI=(function(){return typeof Buffer<`u`&&typeof Buffer.from==`function`?function(e){return Buffer.from(e).toString(`base64`)}:typeof btoa==`function`&&typeof unescape==`function`&&typeof encodeURIComponent==`function`?function(e){return btoa(unescape(encodeURIComponent(e)))}:function(e){return null}})(),MI=Array.prototype.slice,NI=0,PI=1,FI=2,II=3,LI=4,RI=5,zI=6,BI=[0,0,0,0],VI=function(){function e(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return e.prototype.isFinished=function(){return this._finished},e.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},e.prototype.needsAnimate=function(){return this.keyframes.length>=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var r=this.keyframes,i=r.length,a=!1,o=zI,s=t;if(Ia(t)){var c=Lc(t);o=c,(c===1&&!Wa(t[0])||c===2&&!Wa(t[0][0]))&&(a=!0)}else if(Wa(t)&&!Xa(t))o=NI;else if(V(t)){if(!isNaN(+t))o=NI;else{var l=ec(t);l&&(s=l,o=II)}}else if(Ja(t)){var u=I({},s);u.colorStops=R(t.colorStops,function(e){return{offset:e.offset,color:ec(e.color)}}),Sc(t)?o=LI:Cc(t)&&(o=RI),s=u}i===0?this.valType=o:(o!==this.valType||o===zI)&&(a=!0),this.discrete=this.discrete||a;var d={time:e,value:s,rawValue:t,percent:0};return n&&(d.easing=n,d.easingFunc=B(n)?n:fI[n]||Us(n)),r.push(d),d},e.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort(function(e,t){return e.time-t.time});for(var r=this.valType,i=n.length,a=n[i-1],o=this.discrete,s=zc(r),c=Rc(r),l=0;l<i;l++){var u=n[l],d=u.value,f=a.value;u.percent=u.time/e,o||(s&&l!==i-1?Pc(d,f,r):c&&Nc(d.colorStops,f.colorStops))}if(!o&&r!==RI&&t&&this.needsAnimate()&&t.needsAnimate()&&r===t.valType&&!t._finished){this._additiveTrack=t;for(var p=n[0].value,l=0;l<i;l++)r===NI?n[l].additiveValue=n[l].value-p:r===II?n[l].additiveValue=jc([],n[l].value,p,-1):zc(r)&&(n[l].additiveValue=r===PI?jc([],n[l].value,p,-1):Mc([],n[l].value,p,-1))}},e.prototype.step=function(e,t){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var n=this._additiveTrack!=null,r=n?`additiveValue`:`value`,i=this.valType,a=this.keyframes,o=a.length,s=this.propName,c=i===II,l,u=this._lastFr,d=Math.min,f,p;if(o===1)f=p=a[0];else{if(t<0)l=0;else if(t<this._lastFrP){for(l=d(u+1,o-1);l>=0&&!(a[l].percent<=t);l--);l=d(l,o-2)}else{for(l=u;l<o&&!(a[l].percent>t);l++);l=d(l-1,o-2)}p=a[l+1],f=a[l]}if(f&&p){this._lastFr=l,this._lastFrP=t;var m=p.percent-f.percent,h=m===0?1:d((t-f.percent)/m,1);p.easingFunc&&(h=p.easingFunc(h));var g=n?this._additiveValue:c?BI:e[s];if((zc(i)||c)&&!g&&(g=this._additiveValue=[]),this.discrete)e[s]=h<1?f.rawValue:p.rawValue;else if(zc(i))i===PI?kc(g,f[r],p[r],h):Ac(g,f[r],p[r],h);else if(Rc(i)){var _=f[r],v=p[r],y=i===LI;e[s]={type:y?`linear`:`radial`,x:Oc(_.x,v.x,h),y:Oc(_.y,v.y,h),colorStops:R(_.colorStops,function(e,t){var n=v.colorStops[t];return{offset:Oc(e.offset,n.offset,h),color:Ic(kc([],e.color,n.color,h))}}),global:v.global},y?(e[s].x2=Oc(_.x2,v.x2,h),e[s].y2=Oc(_.y2,v.y2,h)):e[s].r=Oc(_.r,v.r,h)}else if(c)kc(g,f[r],p[r],h),n||(e[s]=Ic(g));else{var b=Oc(f[r],p[r],h);n?this._additiveValue=b:e[s]=b}n&&this._addToTarget(e)}}},e.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,r=this._additiveValue;t===NI?e[n]=e[n]+r:t===II?(ec(e[n],BI),jc(BI,BI,r,1),e[n]=Ic(BI)):t===PI?jc(e[n],e[n],r,1):t===FI&&Mc(e[n],e[n],r,1)},e}(),HI=function(){function e(e,t,n,r){this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&r?Oa(`Can' use additive animation on looped animation.`):(this._additiveAnimators=r,this._allowDiscrete=n)}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(e){this._target=e},e.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,Ba(t),n)},e.prototype.whenWithKeys=function(e,t,n,r){for(var i=this._tracks,a=0;a<n.length;a++){var o=n[a],s=i[o];if(!s){s=i[o]=new VI(o);var c=void 0,l=this._getAdditiveTrack(o);if(l){var u=l.keyframes,d=u[u.length-1];c=d&&d.value,l.valType===II&&c&&(c=Ic(c))}else c=this._target[o];if(c==null)continue;e>0&&s.addKeyframe(0,Fc(c),r),this._trackKeys.push(o)}s.addKeyframe(e,Fc(t[o]),r)}return this._maxTime=Math.max(this._maxTime,e),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n<t;n++)e[n].call(this)},e.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,t=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,t)for(var n=0;n<t.length;n++)t[n].call(this)},e.prototype._setTracksFinished=function(){for(var e=this._tracks,t=this._trackKeys,n=0;n<t.length;n++)e[t[n]].setFinished()},e.prototype._getAdditiveTrack=function(e){var t,n=this._additiveAnimators;if(n)for(var r=0;r<n.length;r++){var i=n[r].getTrack(e);i&&(t=i)}return t},e.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var t=this,n=[],r=this._maxTime||0,i=0;i<this._trackKeys.length;i++){var a=this._trackKeys[i],o=this._tracks[a],s=this._getAdditiveTrack(a),c=o.keyframes,l=c.length;if(o.prepare(r,s),o.needsAnimate()){if(!this._allowDiscrete&&o.discrete){var u=c[l-1];u&&(t._target[o.propName]=u.rawValue),o.setFinished()}else n.push(o)}}if(n.length||this._force){var d=new CI({life:r,loop:this._loop,delay:this._delay||0,onframe:function(e){t._started=2;var r=t._additiveAnimators;if(r){for(var i=!1,a=0;a<r.length;a++)if(r[a]._clip){i=!0;break}i||(t._additiveAnimators=null)}for(var a=0;a<n.length;a++)n[a].step(t._target,e);var o=t._onframeCbs;if(o)for(var a=0;a<o.length;a++)o[a](t._target,e)},ondestroy:function(){t._doneCallback()}});this._clip=d,this.animation&&this.animation.addClip(d),e&&d.setEasing(e)}else this._doneCallback();return this}},e.prototype.stop=function(e){if(this._clip){var t=this._clip;e&&t.onframe(1),this._abortedCallback()}},e.prototype.delay=function(e){return this._delay=e,this},e.prototype.during=function(e){return e&&(this._onframeCbs||=[],this._onframeCbs.push(e)),this},e.prototype.done=function(e){return e&&(this._doneCbs||=[],this._doneCbs.push(e)),this},e.prototype.aborted=function(e){return e&&(this._abortedCbs||=[],this._abortedCbs.push(e)),this},e.prototype.getClip=function(){return this._clip},e.prototype.getTrack=function(e){return this._tracks[e]},e.prototype.getTracks=function(){var e=this;return R(this._trackKeys,function(t){return e._tracks[t]})},e.prototype.stopTracks=function(e,t){if(!e.length||!this._clip)return!0;for(var n=this._tracks,r=this._trackKeys,i=0;i<e.length;i++){var a=n[e[i]];a&&!a.isFinished()&&(t?a.step(this._target,1):this._started===1&&a.step(this._target,0),a.setFinished())}for(var o=!0,i=0;i<r.length;i++)if(!n[r[i]].isFinished()){o=!1;break}return o&&this._abortedCallback(),o},e.prototype.saveTo=function(e,t,n){if(e){t||=this._trackKeys;for(var r=0;r<t.length;r++){var i=t[r],a=this._tracks[i];if(a&&!a.isFinished()){var o=a.keyframes,s=o[n?0:o.length-1];s&&(e[i]=Fc(s.rawValue))}}}},e.prototype.__changeFinalValue=function(e,t){t||=Ba(e);for(var n=0;n<t.length;n++){var r=t[n],i=this._tracks[r];if(i){var a=i.keyframes;if(a.length>1){var o=a.pop();i.addKeyframe(o.time,e[r]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},e}(),UI=function(){function e(e){e&&(this._$eventProcessor=e)}return e.prototype.on=function(e,t,n,r){this._$handlers||={};var i=this._$handlers;if(typeof t==`function`&&(r=n,n=t,t=null),!n||!e)return this;var a=this._$eventProcessor;t!=null&&a&&a.normalizeQuery&&(t=a.normalizeQuery(t)),i[e]||(i[e]=[]);for(var o=0;o<i[e].length;o++)if(i[e][o].h===n)return this;var s={h:n,query:t,ctx:r||this,callAtLast:n.zrEventfulCallAtLast},c=i[e].length-1,l=i[e][c];return l&&l.callAtLast?i[e].splice(c,0,s):i[e].push(s),this},e.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length},e.prototype.off=function(e,t){var n=this._$handlers;if(!n)return this;if(!e)return this._$handlers={},this;if(t){if(n[e]){for(var r=[],i=0,a=n[e].length;i<a;i++)n[e][i].h!==t&&r.push(n[e][i]);n[e]=r}n[e]&&n[e].length===0&&delete n[e]}else delete n[e];return this},e.prototype.trigger=function(e){var t=[...arguments].slice(1);if(!this._$handlers)return this;var n=this._$handlers[e],r=this._$eventProcessor;if(n)for(var i=t.length,a=n.length,o=0;o<a;o++){var s=n[o];if(!(r&&r.filter&&s.query!=null&&!r.filter(e,s.query)))switch(i){case 0:s.h.call(s.ctx);break;case 1:s.h.call(s.ctx,t[0]);break;case 2:s.h.call(s.ctx,t[0],t[1]);break;default:s.h.apply(s.ctx,t)}}return r&&r.afterTrigger&&r.afterTrigger(e),this},e.prototype.triggerWithContext=function(e){var t=[...arguments].slice(1);if(!this._$handlers)return this;var n=this._$handlers[e],r=this._$eventProcessor;if(n)for(var i=t.length,a=t[i-1],o=n.length,s=0;s<o;s++){var c=n[s];if(!(r&&r.filter&&c.query!=null&&!r.filter(e,c.query)))switch(i){case 0:c.h.call(a);break;case 1:c.h.call(a,t[0]);break;case 2:c.h.call(a,t[0],t[1]);break;default:c.h.apply(a,t.slice(1,i-1))}}return r&&r.afterTrigger&&r.afterTrigger(e),this},e}(),WI=1,dF.hasGlobalWindow&&(WI=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1)),GI=WI,KI=.4,qI=`#333`,JI=`#ccc`,YI=`#eee`,XI=`__zr_normal__`,ZI=dI.concat([`ignore`]),QI=La(dI,function(e,t){return e[t]=!0,e},{ignore:!1}),$I={},eL=new J(0,0,0,0),tL=[],nL=function(){function e(e){this.id=Da(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return e.prototype._init=function(e){this.attr(e)},e.prototype.drift=function(e,t,n){switch(this.draggable){case`horizontal`:t=0;break;case`vertical`:e=0}var r=this.transform;r||=this.transform=[1,0,0,1,0,0],r[4]+=e,r[5]+=t,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||={};var n=this.textConfig,r=n.local,i=t.innerTransformable,a=void 0,o=void 0,s=!1;i.parent=r?this:null;var c=!1;i.copyTransform(t);var l=n.position!=null,u=n.autoOverflowArea,d=void 0;if((u||l)&&(d=eL,n.layoutRect?d.copy(n.layoutRect):d.copy(this.getBoundingRect()),r||d.applyTransform(this.transform)),l){this.calculateTextPosition?this.calculateTextPosition($I,n,d):cs($I,n,d),i.x=$I.x,i.y=$I.y,a=$I.align,o=$I.verticalAlign;var f=n.origin;if(f&&n.rotation!=null){var p=void 0,m=void 0;f===`center`?(p=d.width*.5,m=d.height*.5):(p=ss(f[0],d.width),m=ss(f[1],d.height)),c=!0,i.originX=-i.x+p+(r?0:d.x),i.originY=-i.y+m+(r?0:d.y)}}n.rotation!=null&&(i.rotation=n.rotation);var h=n.offset;h&&(i.x+=h[0],i.y+=h[1],c||(i.originX=-h[0],i.originY=-h[1]));var g=this._innerTextDefaultStyle||={};if(u){var _=g.overflowRect=g.overflowRect||new J(0,0,0,0);i.getLocalTransform(tL),No(tL,tL),J.copy(_,d),_.applyTransform(tL)}else g.overflowRect=null;var v=n.inside==null?typeof n.position==`string`&&n.position.indexOf(`inside`)>=0:n.inside,y=void 0,b=void 0,x=void 0;v&&this.canBeInsideText()?(y=n.insideFill,b=n.insideStroke,(y==null||y===`auto`)&&(y=this.getInsideTextFill()),(b==null||b===`auto`)&&(b=this.getInsideTextStroke(y),x=!0)):(y=n.outsideFill,b=n.outsideStroke,(y==null||y===`auto`)&&(y=this.getOutsideFill()),(b==null||b===`auto`)&&(b=this.getOutsideStroke(y),x=!0)),y||=`#000`,(y!==g.fill||b!==g.stroke||x!==g.autoStroke||a!==g.align||o!==g.verticalAlign)&&(s=!0,g.fill=y,g.stroke=b,g.autoStroke=x,g.align=a,g.verticalAlign=o,t.setDefaultTextStyle(g)),t.__dirty|=1,s&&t.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return`#fff`},e.prototype.getInsideTextStroke=function(e){return`#000`},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?JI:qI},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n=typeof t==`string`&&ec(t);n||=[255,255,255,1];for(var r=n[3],i=this.__zr.isDarkMode(),a=0;a<3;a++)n[a]=n[a]*r+(i?0:255)*(1-r);return n[3]=1,cc(n,`rgba`)},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){e===`textConfig`?this.setTextConfig(t):e===`textContent`?this.setTextContent(t):e===`clipPath`?this.setClipPath(t):e===`extra`?(this.extra=this.extra||{},I(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if(typeof e==`string`)this.attrKV(e,t);else if(H(e))for(var n=Ba(e),r=0;r<n.length;r++){var i=n[r];this.attrKV(i,e[i])}return this.markRedraw(),this},e.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var t=this._normalState,n=0;n<this.animators.length;n++){var r=this.animators[n],i=r.__fromStateTransition;if(!(r.getLoop()||i&&i!==`__zr_normal__`)){var a=r.targetName,o=a?t[a]:t;r.saveTo(o)}}},e.prototype._innerSaveToNormal=function(e){var t=this._normalState;t||=this._normalState={},e.textConfig&&!t.textConfig&&(t.textConfig=this.textConfig),this._savePrimaryToNormal(e,t,ZI)},e.prototype._savePrimaryToNormal=function(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];e[i]!=null&&!(i in t)&&(t[i]=this[i])}},e.prototype.hasState=function(){return this.currentStates.length>0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(XI,!1,e)},e.prototype.useState=function(e,t,n,r){var i=e===XI;if(this.hasState()||!i){var a=this.currentStates,o=this.stateTransition;if(!(Na(a,e)>=0&&(t||a.length===1))){var s;if(this.stateProxy&&!i&&(s=this.stateProxy(e)),s||=this.states&&this.states[e],!s&&!i)Oa(`State `+e+` not exists.`);else{i||this.saveCurrentToNormalState(s);var c=this._textContent,l=qc(this,c,s,r);l&&!this.__inHover&&(this.__inHover=l),this._applyStateObj(e,s,this._normalState,t,Yc(this,n,o),o);var u=this._textGuide;return c&&c.useState(e,t,n,!!l),u&&u.useState(e,t,n,!!l),i?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this.__inHover=0,this.__dirty&=-2),s}}}},e.prototype.useStates=function(e,t,n){if(!e.length)this.clearStates();else{var r=[],i=this.currentStates,a=e.length,o=a===i.length;if(o){for(var s=0;s<a;s++)if(e[s]!==i[s]){o=!1;break}}if(o)return;for(var s=0;s<a;s++){var c=e[s],l=void 0;this.stateProxy&&(l=this.stateProxy(c,e)),l||=this.states[c],l&&r.push(l)}var u=r[a-1],d=this._textContent,f=qc(this,d,u,n);f&&!this.__inHover&&(this.__inHover=f);var p=this._mergeStates(r),m=this.stateTransition;this.saveCurrentToNormalState(p),this._applyStateObj(e.join(`,`),p,this._normalState,!1,Yc(this,t,m),m);var h=this._textGuide;d&&d.useStates(e,t,!!f),h&&h.useStates(e,t,!!f),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!f&&this.__inHover&&(this.__inHover=0,this.__dirty&=-2)}},e.prototype.isSilent=function(){for(var e=this;e;){if(e.silent)return!0;var t=e.__hostTarget;e=t?e.ignoreHostSilent?null:t:e.parent}return!1},e.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var t=this.animators[e];t.targetName&&t.changeTarget(this[t.targetName])}},e.prototype.removeState=function(e){var t=Na(this.currentStates,e);if(t>=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var r=this.currentStates.slice(),i=Na(r,e),a=Na(r,t)>=0;i>=0?a?r.splice(i,1):r[i]=t:n&&!a&&r.push(t),this.useStates(r)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t={},n,r=0;r<e.length;r++){var i=e[r];I(t,i),i.textConfig&&(n||={},I(n,i.textConfig))}return n&&(t.textConfig=n),t},e.prototype._applyStateObj=function(e,t,n,r,i,a){if(this.__inHover!==1){var o=!(t&&r);t&&t.textConfig?(this.textConfig=I({},r?this.textConfig:n.textConfig),I(this.textConfig,t.textConfig)):o&&n.textConfig&&(this.textConfig=n.textConfig);for(var s={},c=!1,l=0;l<ZI.length;l++){var u=ZI[l],d=i&&QI[u];t&&t[u]!=null?d?(c=!0,s[u]=t[u]):this[u]=t[u]:o&&n[u]!=null&&(d?(c=!0,s[u]=n[u]):this[u]=n[u])}if(!i)for(var l=0;l<this.animators.length;l++){var f=this.animators[l],p=f.targetName;f.getLoop()||f.__changeFinalValue(p?(t||n)[p]:t||n)}c&&this._transitionState(e,s,a)}},e.prototype._attachComponent=function(e){if((!e.__zr||e.__hostTarget)&&e!==this){var t=this.__zr;t&&e.addSelfToZr(t),e.__zr=t,e.__hostTarget=this}},e.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},e.prototype.getClipPath=function(){return this._clipPath},e.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},e.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},e.prototype.getTextContent=function(){return this._textContent},e.prototype.setTextContent=function(e){var t=this._textContent;t!==e&&(t&&t!==e&&this.removeTextContent(),e.innerTransformable=new lI,this._attachComponent(e),this._textContent=e,this.markRedraw())},e.prototype.setTextConfig=function(e){this.textConfig||={},I(this.textConfig,e),this.markRedraw()},e.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},e.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},e.prototype.getTextGuideLine=function(){return this._textGuide},e.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},e.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},e.prototype.markRedraw=function(){this.__dirty|=1;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},e.prototype.dirty=function(){this.markRedraw()},e.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.addAnimator(t[n]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},e.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.removeAnimator(t[n]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},e.prototype.animate=function(e,t,n){var r=new HI(e?this[e]:this,t,n);return e&&(r.targetName=e),this.addAnimator(r,e),r},e.prototype.addAnimator=function(e,t){var n=this.__zr,r=this;e.during(function(){r.updateDuringAnimation(t)}).done(function(){var t=r.animators,n=Na(t,e);n>=0&&t.splice(n,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,r=n.length,i=[],a=0;a<r;a++){var o=n[a];!e||e===o.scope?o.stop(t):i.push(o)}return this.animators=i,this},e.prototype.animateTo=function(e,t,n){Bc(this,e,t,n)},e.prototype.animateFrom=function(e,t,n){Bc(this,e,t,n,!0)},e.prototype._transitionState=function(e,t,n,r){for(var i=Bc(this,t,n,r),a=0;a<i.length;a++)i[a].__fromStateTransition=e},e.prototype.getBoundingRect=function(){return null},e.prototype.getPaintRect=function(){return null},e.initDefaultProps=(function(){var t=e.prototype;t.type=`element`,t.name=``,t.ignore=t.silent=t.ignoreHostSilent=t.isGroup=t.draggable=t.dragging=t.ignoreClip=!1,t.__inHover=0,t.__dirty=1;function n(e,n,r,i){Object.defineProperty(t,e,{get:function(){if(!this[n]){var e=this[n]=[];a(this,e)}return this[n]},set:function(e){this[r]=e[0],this[i]=e[1],this[n]=e,a(this,e)}});function a(e,t){Object.defineProperty(t,0,{get:function(){return e[r]},set:function(t){e[r]=t}}),Object.defineProperty(t,1,{get:function(){return e[i]},set:function(t){e[i]=t}})}}Object.defineProperty&&(n(`position`,`_legacyPos`,`x`,`y`),n(`scale`,`_legacyScale`,`scaleX`,`scaleY`),n(`origin`,`_legacyOrigin`,`originX`,`originY`))})(),e}(),Fa(nL,UI),Fa(nL,lI),rL=`__zr_style_`+Math.round(Math.random()*10),iL={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:`#000`,opacity:1,blend:`source-over`},aL={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}},iL[rL]=!0,oL=[`z`,`z2`,`invisible`],sL=[`invisible`],cL=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype._init=function(t){for(var n=Ba(t),r=0;r<n.length;r++){var i=n[r];i===`style`?this.useStyle(t[i]):e.prototype.attrKV.call(this,i,t[i])}this.style||this.useStyle({})},t.prototype.beforeBrush=function(e){},t.prototype.afterBrush=function(){},t.prototype.innerBeforeBrush=function(){},t.prototype.innerAfterBrush=function(){},t.prototype.shouldBePainted=function(e,t,n,r){var i=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&Xc(this,e,t)||i&&!i[0]&&!i[3])return!1;if(n&&this.__clipPaths&&this.__clipPaths.length){for(var a=0;a<this.__clipPaths.length;++a)if(this.__clipPaths[a].isZeroArea())return!1}if(r&&this.parent)for(var o=this.parent;o;){if(o.ignore)return!1;o=o.parent}return!0},t.prototype.contain=function(e,t){return this.rectContain(e,t)},t.prototype.traverse=function(e,t){e.call(t,this)},t.prototype.rectContain=function(e,t){var n=this.transformCoordToLocal(e,t);return this.getBoundingRect().contain(n[0],n[1])},t.prototype.getPaintRect=function(){var e=this._paintRect;if(!this._paintRect||this.__dirty){var t=this.transform,n=this.getBoundingRect(),r=this.style,i=r.shadowBlur||0,a=r.shadowOffsetX||0,o=r.shadowOffsetY||0;e=this._paintRect||=new J(0,0,0,0),t?J.applyTransform(e,n,t):e.copy(n),(i||a||o)&&(e.width+=i*2+Math.abs(a),e.height+=i*2+Math.abs(o),e.x=Math.min(e.x,e.x+a-i),e.y=Math.min(e.y,e.y+o-i));var s=this.dirtyRectTolerance;e.isZero()||(e.x=Math.floor(e.x-s),e.y=Math.floor(e.y-s),e.width=Math.ceil(e.width+1+s*2),e.height=Math.ceil(e.height+1+s*2))}return e},t.prototype.setPrevPaintRect=function(e){e?(this._prevPaintRect=this._prevPaintRect||new J(0,0,0,0),this._prevPaintRect.copy(e)):this._prevPaintRect=null},t.prototype.getPrevPaintRect=function(){return this._prevPaintRect},t.prototype.animateStyle=function(e){return this.animate(`style`,e)},t.prototype.updateDuringAnimation=function(e){e===`style`?this.dirtyStyle():this.markRedraw()},t.prototype.attrKV=function(t,n){t===`style`?this.style?this.setStyle(n):this.useStyle(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setStyle=function(e,t){return typeof e==`string`?this.style[e]=t:I(this.style,e),this.dirtyStyle(),this},t.prototype.dirtyStyle=function(e){e||this.markRedraw(),this.__dirty|=2,this._rect&&=null},t.prototype.dirty=function(){this.dirtyStyle()},t.prototype.styleChanged=function(){return!!(this.__dirty&2)},t.prototype.styleUpdated=function(){this.__dirty&=-3},t.prototype.createStyle=function(e){return ao(iL,e)},t.prototype.useStyle=function(e){e[rL]||(e=this.createStyle(e)),this.style=e,this.dirtyStyle()},t.prototype._useHoverStyle=function(e){this.__hoverStyle=e},t.prototype.isStyleObject=function(e){return e[rL]},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.style&&!n.style&&(n.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(t,n,oL)},t.prototype._applyStateObj=function(t,n,r,i,a,o){e.prototype._applyStateObj.call(this,t,n,r,i,a,o);var s=!(n&&i),c=this.__inHover===1,l;if(n&&n.style?a?i?l=n.style:(l=this._mergeStyle(this.createStyle(),r.style),this._mergeStyle(l,n.style)):(l=this._mergeStyle(this.createStyle(),i?this.style:r.style),this._mergeStyle(l,n.style)):s&&(l=r.style),l){if(a){var u=this.style;if(this.style=this.createStyle(s?{}:u),s)for(var d=Ba(u),f=0;f<d.length;f++){var p=d[f];p in l&&(l[p]=l[p],this.style[p]=u[p])}for(var m=Ba(l),f=0;f<m.length;f++){var p=m[f];this.style[p]=this.style[p]}this._transitionState(t,{style:l},o,this.getAnimationStyleProps())}else c?this._useHoverStyle(l):this.useStyle(l)}if(!c)for(var h=this.__inHover?sL:oL,f=0;f<h.length;f++){var p=h[f];n&&n[p]!=null?this[p]=n[p]:s&&r[p]!=null&&(this[p]=r[p])}},t.prototype._mergeStates=function(t){for(var n=e.prototype._mergeStates.call(this,t),r,i=0;i<t.length;i++){var a=t[i];a.style&&(r||={},this._mergeStyle(r,a.style))}return r&&(n.style=r),n},t.prototype._mergeStyle=function(e,t){return I(e,t),e},t.prototype.getAnimationStyleProps=function(){return aL},t.initDefaultProps=(function(){var e=t.prototype;e.type=`displayable`,e.invisible=!1,e.z=0,e.z2=0,e.zlevel=0,e.culling=!1,e.cursor=`pointer`,e.rectHover=!1,e.incremental=0,e._rect=null,e.dirtyRectTolerance=0,e.__dirty=3})(),t}(nL),lL=new J(0,0,0,0),uL=new J(0,0,0,0),dL=Math.min,fL=Math.max,pL=Math.sin,mL=Math.cos,hL=Math.PI*2,gL=Po(),_L=Po(),vL=Po(),yL=[],bL=[],xL={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},SL=[],CL=[],wL=[],TL=[],EL=[],DL=[],OL=Math.min,kL=Math.max,AL=Math.cos,jL=Math.sin,ML=Math.abs,NL=Math.PI,PL=NL*2,FL=typeof Float32Array<`u`,IL=[],LL=function(){function e(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 e.prototype.increaseVersion=function(){this._version++},e.prototype.getVersion=function(){return this._version},e.prototype.setScale=function(e,t,n){n||=0,n>0&&(this._ux=ML(n/GI/e)||0,this._uy=ML(n/GI/t)||0)},e.prototype.setDPR=function(e){this.dpr=e},e.prototype.setContext=function(e){this._ctx=e},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(xL.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},e.prototype.lineTo=function(e,t){var n=ML(e-this._xi),r=ML(t-this._yi),i=n>this._ux||r>this._uy;if(this.addData(xL.L,e,t),this._ctx&&i&&this._ctx.lineTo(e,t),i)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var a=n*n+r*r;a>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=a)}return this},e.prototype.bezierCurveTo=function(e,t,n,r,i,a){return this._drawPendingPt(),this.addData(xL.C,e,t,n,r,i,a),this._ctx&&this._ctx.bezierCurveTo(e,t,n,r,i,a),this._xi=i,this._yi=a,this},e.prototype.quadraticCurveTo=function(e,t,n,r){return this._drawPendingPt(),this.addData(xL.Q,e,t,n,r),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,r),this._xi=n,this._yi=r,this},e.prototype.arc=function(e,t,n,r,i,a){this._drawPendingPt(),IL[0]=r,IL[1]=i,nl(IL,a),r=IL[0],i=IL[1];var o=i-r;return this.addData(xL.A,e,t,n,n,r,o,0,+!a),this._ctx&&this._ctx.arc(e,t,n,r,i,a),this._xi=AL(i)*n+e,this._yi=jL(i)*n+t,this},e.prototype.arcTo=function(e,t,n,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,r,i),this},e.prototype.rect=function(e,t,n,r){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,r),this.addData(xL.R,e,t,n,r),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(xL.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},e.prototype.fill=function(e){e&&e.fill(),this.toStatic()},e.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(e){if(this._saveData){var t=e.length;!(this.data&&this.data.length===t)&&FL&&(this.data=new Float32Array(t));for(var n=0;n<t;n++)this.data[n]=e[n];this._len=t}},e.prototype.appendPath=function(e){if(this._saveData){e instanceof Array||(e=[e]);for(var t=e.length,n=0,r=this._len,i=0;i<t;i++)n+=e[i].len();var a=this.data;if(FL&&(a instanceof Float32Array||!a)&&(this.data=new Float32Array(r+n),r>0&&a))for(var o=0;o<r;o++)this.data[o]=a[o];for(var i=0;i<t;i++)for(var s=e[i].data,o=0;o<s.length;o++)this.data[r++]=s[o];this._len=r}},e.prototype.addData=function(e,t,n,r,i,a,o,s,c){if(this._saveData){var l=this.data;this._len+arguments.length>l.length&&(this._expandData(),l=this.data);for(var u=0;u<arguments.length;u++)l[this._len++]=arguments[u]}},e.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t<this._len;t++)e[t]=this.data[t];this.data=e}},e.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,FL&&this._len>11&&(this.data=new Float32Array(e)))}},e.prototype.getBoundingRect=function(){wL[0]=wL[1]=EL[0]=EL[1]=Number.MAX_VALUE,TL[0]=TL[1]=DL[0]=DL[1]=-Number.MAX_VALUE;for(var e=this.data,t=0,n=0,r=0,i=0,a=0;a<this._len;){var o=e[a++],s=a===1;switch(s&&(t=e[a],n=e[a+1],r=t,i=n),o){case xL.M:t=r=e[a++],n=i=e[a++],EL[0]=r,EL[1]=i,DL[0]=r,DL[1]=i;break;case xL.L:Zc(t,n,e[a],e[a+1],EL,DL),t=e[a++],n=e[a++];break;case xL.C:Qc(t,n,e[a++],e[a++],e[a++],e[a++],e[a],e[a+1],EL,DL),t=e[a++],n=e[a++];break;case xL.Q:$c(t,n,e[a++],e[a++],e[a],e[a+1],EL,DL),t=e[a++],n=e[a++];break;case xL.A:var c=e[a++],l=e[a++],u=e[a++],d=e[a++],f=e[a++],p=e[a++]+f;a+=1;var m=!e[a++];s&&(r=AL(f)*u+c,i=jL(f)*d+l),el(c,l,u,d,f,p,m,EL,DL),t=AL(p)*u+c,n=jL(p)*d+l;break;case xL.R:r=t=e[a++],i=n=e[a++];var h=e[a++],g=e[a++];Zc(r,i,r+h,i+g,EL,DL);break;case xL.Z:t=r,n=i}Jo(wL,wL,EL),Yo(TL,TL,DL)}return a===0&&(wL[0]=wL[1]=TL[0]=TL[1]=0),new J(wL[0],wL[1],TL[0]-wL[0],TL[1]-wL[1])},e.prototype._calculateLength=function(){var e=this.data,t=this._len,n=this._ux,r=this._uy,i=0,a=0,o=0,s=0;this._pathSegLen||=[];for(var c=this._pathSegLen,l=0,u=0,d=0;d<t;){var f=e[d++],p=d===1;p&&(i=e[d],a=e[d+1],o=i,s=a);var m=-1;switch(f){case xL.M:i=o=e[d++],a=s=e[d++];break;case xL.L:var h=e[d++],g=e[d++],_=h-i,v=g-a;(ML(_)>n||ML(v)>r||d===t-1)&&(m=Math.sqrt(_*_+v*v),i=h,a=g);break;case xL.C:var y=e[d++],b=e[d++],h=e[d++],g=e[d++],x=e[d++],S=e[d++];m=Fs(i,a,y,b,h,g,x,S,10),i=x,a=S;break;case xL.Q:var y=e[d++],b=e[d++],h=e[d++],g=e[d++];m=Hs(i,a,y,b,h,g,10),i=h,a=g;break;case xL.A:var C=e[d++],w=e[d++],T=e[d++],E=e[d++],D=e[d++],O=e[d++],k=O+D;d+=1,p&&(o=AL(D)*T+C,s=jL(D)*E+w),m=kL(T,E)*OL(PL,Math.abs(O)),i=AL(k)*T+C,a=jL(k)*E+w;break;case xL.R:o=i=e[d++],s=a=e[d++];var A=e[d++],j=e[d++];m=A*2+j*2;break;case xL.Z:var _=o-i,v=s-a;m=Math.sqrt(_*_+v*v),i=o,a=s}m>=0&&(c[u++]=m,l+=m)}return this._pathLen=l,l},e.prototype.rebuildPath=function(e,t){var n=this.data,r=this._ux,i=this._uy,a=this._len,o,s,c,l,u,d,f=t<1,p,m,h=0,g=0,_,v=0,y,b;if(!(f&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,m=this._pathLen,_=t*m,!_)))lo:for(var x=0;x<a;){var S=n[x++],C=x===1;switch(C&&(c=n[x],l=n[x+1],o=c,s=l),S!==xL.L&&v>0&&(e.lineTo(y,b),v=0),S){case xL.M:o=c=n[x++],s=l=n[x++],e.moveTo(c,l);break;case xL.L:u=n[x++],d=n[x++];var w=ML(u-c),T=ML(d-l);if(w>r||T>i){if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;e.lineTo(c*(1-D)+u*D,l*(1-D)+d*D);break lo}h+=E}e.lineTo(u,d),c=u,l=d,v=0}else{var O=w*w+T*T;O>v&&(y=u,b=d,v=O)}break;case xL.C:var k=n[x++],A=n[x++],j=n[x++],M=n[x++],ee=n[x++],te=n[x++];if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;Ns(c,k,j,ee,D,SL),Ns(l,A,M,te,D,CL),e.bezierCurveTo(SL[1],CL[1],SL[2],CL[2],SL[3],CL[3]);break lo}h+=E}e.bezierCurveTo(k,A,j,M,ee,te),c=ee,l=te;break;case xL.Q:var k=n[x++],A=n[x++],j=n[x++],M=n[x++];if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;Bs(c,k,j,D,SL),Bs(l,A,M,D,CL),e.quadraticCurveTo(SL[1],CL[1],SL[2],CL[2]);break lo}h+=E}e.quadraticCurveTo(k,A,j,M),c=j,l=M;break;case xL.A:var ne=n[x++],re=n[x++],ie=n[x++],ae=n[x++],oe=n[x++],se=n[x++],ce=n[x++],le=!n[x++],ue=ie>ae?ie:ae,de=ML(ie-ae)>.001,fe=oe+se,pe=!1;if(f){var E=p[g++];h+E>_&&(fe=oe+se*(_-h)/E,pe=!0),h+=E}if(de&&e.ellipse?e.ellipse(ne,re,ie,ae,ce,oe,fe,le):e.arc(ne,re,ue,oe,fe,le),pe)break lo;C&&(o=AL(oe)*ie+ne,s=jL(oe)*ae+re),c=AL(fe)*ie+ne,l=jL(fe)*ae+re;break;case xL.R:o=c=n[x],s=l=n[x+1],u=n[x++],d=n[x++];var me=n[x++],he=n[x++];if(f){var E=p[g++];if(h+E>_){var N=_-h;e.moveTo(u,d),e.lineTo(u+OL(N,me),d),N-=me,N>0&&e.lineTo(u+me,d+OL(N,he)),N-=he,N>0&&e.lineTo(u+kL(me-N,0),d+he),N-=me,N>0&&e.lineTo(u,d+kL(he-N,0));break lo}h+=E}e.rect(u,d,me,he);break;case xL.Z:if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;e.lineTo(c*(1-D)+o*D,l*(1-D)+s*D);break lo}h+=E}e.closePath(),c=o,l=s}}},e.prototype.clone=function(){var t=new e,n=this.data;return t.data=n.slice?n.slice():Array.prototype.slice.call(n),t._len=this._len,t},e.prototype.canSave=function(){return!!this._saveData},e.CMD=xL,e.initDefaultProps=(function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0})(),e}(),RL=Math.PI*2,zL=Math.PI*2,BL=LL.CMD,VL=Math.PI*2,HL=1e-4,UL=[-1,-1,-1],WL=[-1,-1],GL=Ma({fill:`#000`,stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:`butt`,miterLimit:10,strokeNoScale:!1,strokeFirst:!1},iL),KL={style:Ma({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},aL.style)},qL=dI.concat([`invisible`,`culling`,`z`,`z2`,`zlevel`,`parent`]),JL=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.update=function(){var n=this;e.prototype.update.call(this);var r=this.style;if(r.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(e){n.buildPath(e,n.shape)}),i.silent=!0;var a=i.style;for(var o in r)a[o]!==r[o]&&(a[o]=r[o]);a.fill=r.fill?r.decal:null,a.decal=null,a.shadowColor=null,r.strokeFirst&&(a.stroke=null);for(var s=0;s<qL.length;++s)i[qL[s]]=this[qL[s]];i.__dirty|=1}else this._decalEl&&=null},t.prototype.getDecalElement=function(){return this._decalEl},t.prototype._init=function(t){var n=Ba(t);this.shape=this.getDefaultShape();var r=this.getDefaultStyle();r&&this.useStyle(r);for(var i=0;i<n.length;i++){var a=n[i],o=t[a];a===`style`?this.style?I(this.style,o):this.useStyle(o):a===`shape`?I(this.shape,o):e.prototype.attrKV.call(this,a,o)}this.style||this.useStyle({})},t.prototype.getDefaultStyle=function(){return null},t.prototype.getDefaultShape=function(){return{}},t.prototype.canBeInsideText=function(){return this.hasFill()},t.prototype.getInsideTextFill=function(){var e=this.style.fill;if(e!==`none`){if(V(e)){var t=lc(e,0);return t>.5?qI:t>.2?YI:JI}if(e)return JI}return qI},t.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(V(t)){var n=this.__zr;if(!!(n&&n.isDarkMode())==lc(e,0)<.4)return t}},t.prototype.buildPath=function(e,t,n){},t.prototype.pathUpdated=function(){this.__dirty&=-5},t.prototype.getUpdatedPathProxy=function(e){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},t.prototype.createPathProxy=function(){this.path=new LL(!1)},t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return!(t==null||t===`none`||!(e.lineWidth>0))},t.prototype.hasFill=function(){var e=this.style.fill;return e!=null&&e!==`none`},t.prototype.getBoundingRect=function(){var e=this._rect,t=this.style,n=!e;if(n){var r=!1;this.path||(r=!0,this.createPathProxy());var i=this.path;(r||this.__dirty&4)&&(i.beginPath(),this.buildPath(i,this.shape,!1),this.pathUpdated()),e=i.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var a=this._rectStroke||=e.clone();if(this.__dirty||n){a.copy(e);var o=t.strokeNoScale?this.getLineScale():1,s=t.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;s=Math.max(s,c??4)}o>1e-10&&(a.width+=s/o,a.height+=s/o,a.x-=s/o/2,a.y-=s/o/2)}return a}return e},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect(),i=this.style;if(e=n[0],t=n[1],r.contain(e,t)){var a=this.path;if(this.hasStroke()){var o=i.lineWidth,s=i.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),gl(a,o/s,e,t)))return!0}if(this.hasFill())return hl(a,e,t)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&=null,this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate(`shape`,e)},t.prototype.updateDuringAnimation=function(e){e===`style`?this.dirtyStyle():e===`shape`?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(t,n){t===`shape`?this.setShape(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setShape=function(e,t){var n=this.shape;return n||=this.shape={},typeof e==`string`?n[e]=t:I(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&4)},t.prototype.createStyle=function(e){return ao(GL,e)},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=I({},this.shape))},t.prototype._applyStateObj=function(t,n,r,i,a,o){if(e.prototype._applyStateObj.call(this,t,n,r,i,a,o),this.__inHover!==1){var s=!(n&&i),c;if(n&&n.shape?a?i?c=n.shape:(c=I({},r.shape),I(c,n.shape)):(c=I({},i?this.shape:r.shape),I(c,n.shape)):s&&(c=r.shape),c){if(a){this.shape=I({},this.shape);for(var l={},u=Ba(c),d=0;d<u.length;d++){var f=u[d];typeof c[f]==`object`?this.shape[f]=c[f]:l[f]=c[f]}this._transitionState(t,{shape:l},o)}else this.shape=c,this.dirtyShape()}}},t.prototype._mergeStates=function(t){for(var n=e.prototype._mergeStates.call(this,t),r,i=0;i<t.length;i++){var a=t[i];a.shape&&(r||={},this._mergeStyle(r,a.shape))}return r&&(n.shape=r),n},t.prototype.getAnimationStyleProps=function(){return KL},t.prototype.isZeroArea=function(){return!1},t.extend=function(e){var n=function(t){F(n,t);function n(n){var r=t.call(this,n)||this;return e.init&&e.init.call(r,n),r}return n.prototype.getDefaultStyle=function(){return ka(e.style)},n.prototype.getDefaultShape=function(){return ka(e.shape)},n}(t);for(var r in e)typeof e[r]==`function`&&(n.prototype[r]=e[r]);return n},t.initDefaultProps=(function(){var e=t.prototype;e.type=`path`,e.strokeContainThreshold=5,e.segmentIgnoreThreshold=0,e.subPixelOptimize=!1,e.autoBatch=!1,e.__dirty=7})(),t}(cL),YL=Ma({strokeFirst:!0,font:BP,x:0,y:0,textAlign:`left`,textBaseline:`top`,miterLimit:2},GL),XL=function(e){F(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.hasStroke=function(){return Cs(this.style)},t.prototype.hasFill=function(){var e=this.style.fill;return e!=null&&e!==`none`},t.prototype.createStyle=function(e){return ao(YL,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){return this._rect||=xs(this.style),this._rect},t.initDefaultProps=(function(){var e=t.prototype;e.dirtyRectTolerance=10})(),t}(cL),XL.prototype.type=`tspan`,ZL=Ma({x:0,y:0},iL),QL={style:Ma({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},aL.style)},$L=function(e){F(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.createStyle=function(e){return ao(ZL,e)},t.prototype._getSize=function(e){var t=this.style,n=t[e];if(n!=null)return n;var r=_l(t.image)?t.image:this.__image;if(!r)return 0;var i=e===`width`?`height`:`width`,a=t[i];return a==null?r[e]:r[e]/r[i]*a},t.prototype.getWidth=function(){return this._getSize(`width`)},t.prototype.getHeight=function(){return this._getSize(`height`)},t.prototype.getAnimationStyleProps=function(){return QL},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||=new J(e.x||0,e.y||0,this.getWidth(),this.getHeight()),this._rect},t}(cL),$L.prototype.type=`image`,eR=Math.round,tR=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),nR={},rR=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new tR},t.prototype.buildPath=function(e,t){var n,r,i,a;if(this.subPixelOptimize){var o=bl(nR,t,this.style);n=o.x,r=o.y,i=o.width,a=o.height,o.r=t.r,t=o}else n=t.x,r=t.y,i=t.width,a=t.height;t.r?vl(e,t):e.rect(n,r,i,a)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(JL),rR.prototype.type=`rect`,iR={fill:`#000`},aR=2,oR={},sR={style:Ma({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},aL.style)},cR=function(e){F(t,e);function t(t){var n=e.call(this)||this;return n.type=`text`,n._children=[],n._defaultStyle=iR,n.attr(t),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t<this._children.length;t++){var n=this._children[t];n.zlevel=this.zlevel,n.z=this.z,n.z2=this.z2,n.culling=this.culling,n.cursor=this.cursor,n.invisible=this.invisible}},t.prototype.updateTransform=function(){var t=this.innerTransformable;t?(t.updateTransform(),t.transform&&(this.transform=t.transform)):e.prototype.updateTransform.call(this)},t.prototype.getLocalTransform=function(t){var n=this.innerTransformable;return n?n.getLocalTransform(t):e.prototype.getLocalTransform.call(this,t)},t.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),e.prototype.getComputedTransform.call(this)},t.prototype._updateSubTexts=function(){this._childCursor=0,Tl(this.style),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},t.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].__zr=t},t.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].__zr=null},t.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var e=new J(0,0,0,0),t=this._children,n=[],r=null,i=0;i<t.length;i++){var a=t[i],o=a.getBoundingRect(),s=a.getLocalTransform(n);s?(e.copy(o),e.applyTransform(s),r||=e.clone(),r.union(e)):(r||=o.clone(),r.union(o))}this._rect=r||e}return this._rect},t.prototype.setDefaultTextStyle=function(e){this._defaultStyle=e||iR},t.prototype.setTextContent=function(e){},t.prototype._mergeStyle=function(e,t){if(!t)return e;var n=t.rich,r=e.rich||n&&{};return I(e,t),n&&r?(this._mergeRich(r,n),e.rich=r):r&&(e.rich=r),e},t.prototype._mergeRich=function(e,t){for(var n=Ba(t),r=0;r<n.length;r++){var i=n[r];e[i]=e[i]||{},I(e[i],t[i])}},t.prototype.getAnimationStyleProps=function(){return sR},t.prototype._getOrCreateChild=function(e){var t=this._children[this._childCursor];return t&&t instanceof e||(t=new e),this._children[this._childCursor++]=t,t.__zr=this.__zr,t.parent=this,t},t.prototype._updatePlainTexts=function(){var e=this.style,t=e.font||`12px sans-serif`,n=e.padding,r=this._defaultStyle,i=e.x||0,a=e.y||0,o=e.align||r.align||`left`,s=e.verticalAlign||r.verticalAlign||`top`;ys(oR,r.overflowRect,i,a,o,s),i=oR.baseX,a=oR.baseY;var c=ps(Al(e),e,oR.outerWidth,oR.outerHeight),l=jl(e),u=!!e.backgroundColor,d=c.outerHeight,f=c.outerWidth,p=c.lines,m=c.lineHeight;this.isTruncated=!!c.isTruncated;var h=i,g=as(a,c.contentHeight,s);if(l||n){var _=is(i,f,o),v=as(a,d,s);l&&this._renderBackground(e,e,_,v,f,d)}g+=m/2,n&&(h=kl(i,o,n),s===`top`?g+=n[0]:s===`bottom`&&(g-=n[2]));for(var y=0,b=!1,x=!1,S=Ol(`fill`in e?e.fill:(x=!0,r.fill)),C=Dl(`stroke`in e?e.stroke:!u&&(!r.autoStroke||x)?(y=aR,b=!0,r.stroke):null),w=e.textShadowBlur>0,T=0;T<p.length;T++){var E=this._getOrCreateChild(XL),D=E.createStyle();E.useStyle(D),D.text=p[T],D.x=h,D.y=g,o&&(D.textAlign=o),D.textBaseline=`middle`,D.opacity=e.opacity,D.strokeFirst=!0,w&&(D.shadowBlur=e.textShadowBlur||0,D.shadowColor=e.textShadowColor||`transparent`,D.shadowOffsetX=e.textShadowOffsetX||0,D.shadowOffsetY=e.textShadowOffsetY||0),D.stroke=C,D.fill=S,C&&(D.lineWidth=e.lineWidth||y,D.lineDash=e.lineDash,D.lineDashOffset=e.lineDashOffset||0),D.font=t,Cl(D,e),g+=m,E.setBoundingRect(Ss(D,c.contentWidth,c.calculatedLineHeight,b?0:null))}},t.prototype._updateRichTexts=function(){var e=this.style,t=this._defaultStyle,n=e.align||t.align,r=e.verticalAlign||t.verticalAlign,i=e.x||0,a=e.y||0;ys(oR,t.overflowRect,i,a,n,r),i=oR.baseX,a=oR.baseY;var o=ms(Al(e),e,oR.outerWidth,oR.outerHeight,n),s=o.width,c=o.outerWidth,l=o.outerHeight,u=e.padding;this.isTruncated=!!o.isTruncated;var d=is(i,c,n),f=as(a,l,r),p=d,m=f;u&&(p+=u[3],m+=u[0]);var h=p+s;jl(e)&&this._renderBackground(e,e,d,f,c,l);for(var g=!!e.backgroundColor,_=0;_<o.lines.length;_++){for(var v=o.lines[_],y=v.tokens,b=y.length,x=v.lineHeight,S=v.width,C=0,w=p,T=h,E=b-1,D=void 0;C<b&&(D=y[C],!D.align||D.align===`left`);)this._placeToken(D,e,x,m,w,`left`,g),S-=D.width,w+=D.width,C++;for(;E>=0&&(D=y[E],D.align===`right`);)this._placeToken(D,e,x,m,T,`right`,g),S-=D.width,T-=D.width,E--;for(w+=(s-(w-p)-(h-T)-S)/2;C<=E;)D=y[C],this._placeToken(D,e,x,m,w+D.width/2,`center`,g),w+=D.width,C++;m+=x}},t.prototype._placeToken=function(e,t,n,r,i,a,o){var s=t.rich[e.styleName]||{};s.text=e.text;var c=e.verticalAlign,l=r+n/2;c===`top`?l=r+e.height/2:c===`bottom`&&(l=r+n-e.height/2),!e.isLineHolder&&jl(s)&&this._renderBackground(s,t,a===`right`?i-e.width:a===`center`?i-e.width/2:i,l-e.height/2,e.width,e.height);var u=!!s.backgroundColor,d=e.textPadding;d&&(i=kl(i,a,d),l-=e.height/2-d[0]-e.innerHeight/2);var f=this._getOrCreateChild(XL),p=f.createStyle();f.useStyle(p);var m=this._defaultStyle,h=!1,g=0,_=!1,v=Ol(`fill`in s?s.fill:`fill`in t?t.fill:(h=!0,m.fill)),y=Dl(`stroke`in s?s.stroke:`stroke`in t?t.stroke:!u&&!o&&(!m.autoStroke||h)?(g=aR,_=!0,m.stroke):null),b=s.textShadowBlur>0||t.textShadowBlur>0;p.text=e.text,p.x=i,p.y=l,b&&(p.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,p.shadowColor=s.textShadowColor||t.textShadowColor||`transparent`,p.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),p.textAlign=a,p.textBaseline=`middle`,p.font=e.font||`12px sans-serif`,p.opacity=Qa(s.opacity,t.opacity,1),Cl(p,s),y&&(p.lineWidth=Qa(s.lineWidth,t.lineWidth,g),p.lineDash=U(s.lineDash,t.lineDash),p.lineDashOffset=t.lineDashOffset||0,p.stroke=y),v&&(p.fill=v),f.setBoundingRect(Ss(p,e.contentWidth,e.contentHeight,_?0:null))},t.prototype._renderBackground=function(e,t,n,r,i,a){var o=e.backgroundColor,s=e.borderWidth,c=e.borderColor,l=o&&o.image,u=o&&!l,d=e.borderRadius,f=this,p,m;if(u||e.lineHeight||s&&c){p=this._getOrCreateChild(rR),p.useStyle(p.createStyle()),p.style.fill=null;var h=p.shape;h.x=n,h.y=r,h.width=i,h.height=a,h.r=d,p.dirtyShape()}if(u){var g=p.style;g.fill=o||null,g.fillOpacity=U(e.fillOpacity,1)}else if(l){m=this._getOrCreateChild($L),m.onload=function(){f.dirtyStyle()};var _=m.style;_.image=o.image,_.x=n,_.y=r,_.width=i,_.height=a}if(s&&c){var g=p.style;g.lineWidth=s,g.stroke=c,g.strokeOpacity=U(e.strokeOpacity,1),g.lineDash=e.borderDash,g.lineDashOffset=e.borderDashOffset||0,p.strokeContainThreshold=0,p.hasFill()&&p.hasStroke()&&(g.strokeFirst=!0,g.lineWidth*=2)}var v=(p||m).style;v.shadowBlur=e.shadowBlur||0,v.shadowColor=e.shadowColor||`transparent`,v.shadowOffsetX=e.shadowOffsetX||0,v.shadowOffsetY=e.shadowOffsetY||0,v.opacity=Qa(e.opacity,t.opacity,1)},t.makeFont=function(e){var t=``;return wl(e)&&(t=[e.fontStyle,e.fontWeight,Sl(e.fontSize),e.fontFamily||`sans-serif`].join(` `)),t&&no(t)||e.textFont||e.font},t}(cL),lR={left:!0,right:1,center:1},uR={top:1,bottom:1,middle:1},dR=[`fontStyle`,`fontWeight`,`fontSize`,`fontFamily`],fR=1e-4,pR=20,mR=Math.min,hR=Math.max,gR=Math.abs,_R=Math.round,vR=Math.floor,yR=Math.ceil,bR=Math.pow,xR=Math.log,SR=Math.LN10,CR=Math.PI,wR=Math.random,Y=Pl,TR=bR(2,53)-1,ER=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/,DR=`[ECharts] `,OR={},kR=typeof console<`u`&&console.warn&&console.log,AR=`series\0`,jR=`\0_ec_\0`,MR=`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`.split(`.`),NR=eu(),PR={useDefault:!0,enableAll:!1,enableNone:!1},FR={useDefault:!1,enableAll:!0,enableNone:!0},(function(){function e(){}return e.prototype.reset=function(e,t,n,r){return this._list=e,this._step=r||=1,this._idx=t,this._end=n??(r>0?e.length:0),this.item=null,this.key=NaN,this},e.prototype.next=function(){return(this._step>0?this._idx<this._end:this._idx>=this._end)&&(this.item=this._list[this._idx],this.key=this._idx+=this._step,!0)},e})(),IR=eu(),LR=Du(),RR=function(e,t,n,r){if(r){var i=LR(r);i.dataIndex=n,i.dataType=t,i.seriesIndex=e,i.ssrType=`chart`,r.type===`group`&&r.traverse(function(r){var i=LR(r);i.seriesIndex=e,i.dataIndex=n,i.dataType=t,i.ssrType=`chart`})}},zR=`series`,BR=W([`tooltip`,`label`,`itemName`,`itemId`,`itemGroupId`,`itemChildGroupId`,`seriesName`]),VR=`original`,HR=`arrayRows`,UR=`objectRows`,WR=`keyedColumns`,GR=`typedArray`,KR=`unknown`,qR=`column`,JR=`Roam`,YR=[`getDom`,`getZr`,`getWidth`,`getHeight`,`getDevicePixelRatio`,`dispatchAction`,`isSSR`,`isDisposed`,`on`,`off`,`getDataURL`,`getConnectedDataURL`,`getOption`,`getId`,`updateLabelLayout`],XR=function(){function e(e){L(YR,function(t){this[t]=q(e[t],e)},this)}return e}(),ZR=1,QR={},$R=Du(),ez=Du(),tz=[`emphasis`,`blur`,`select`],nz=[`normal`,`emphasis`,`blur`,`select`],rz=`highlight`,iz=`downplay`,az=`select`,oz=`unselect`,sz=`toggleSelect`,cz=`selectchanged`,lz=[`emphasis`,`blur`,`select`],uz={itemStyle:`getItemStyle`,lineStyle:`getLineStyle`,areaStyle:`getAreaStyle`},dz=LL.CMD,fz=[[],[],[]],pz=Math.sqrt,mz=Math.atan2,hz=Math.sqrt,gz=Math.sin,_z=Math.cos,vz=Math.PI,yz=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,bz=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g,xz=function(e){F(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.applyTransform=function(e){},t}(JL),Sz=function(e){F(t,e);function t(t){var n=e.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(t),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(e){return this._children[e]},t.prototype.childOfName=function(e){for(var t=this._children,n=0;n<t.length;n++)if(t[n].name===e)return t[n]},t.prototype.childCount=function(){return this._children.length},t.prototype.add=function(e){return e&&e!==this&&e.parent!==this&&(this._children.push(e),this._doAdd(e)),this},t.prototype.addBefore=function(e,t){if(e&&e!==this&&e.parent!==this&&t&&t.parent===this){var n=this._children,r=n.indexOf(t);r>=0&&(n.splice(r,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,t){var n=Na(this._children,e);return n>=0&&this.replaceAt(t,n),this},t.prototype.replaceAt=function(e,t){var n=this._children,r=n[t];if(e&&e!==this&&e.parent!==this&&e!==r){n[t]=e,r.parent=null;var i=this.__zr;i&&r.removeSelfFromZr(i),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,r=Na(n,e);return r<0||(n.splice(r,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh()),this},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;n<e.length;n++){var r=e[n];t&&r.removeSelfFromZr(t),r.parent=null}return e.length=0,this},t.prototype.eachChild=function(e,t){for(var n=this._children,r=0;r<n.length;r++){var i=n[r];e.call(t,i,r)}return this},t.prototype.traverse=function(e,t){for(var n=0;n<this._children.length;n++){var r=this._children[n],i=e.call(t,r);r.isGroup&&!i&&r.traverse(e,t)}return this},t.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].addSelfToZr(t)},t.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].removeSelfFromZr(t)},t.prototype.getBoundingRect=function(e){for(var t=new J(0,0,0,0),n=e||this._children,r=[],i=null,a=0;a<n.length;a++){var o=n[a];if(!(o.ignore||o.invisible)){var s=o.getBoundingRect(),c=o.getLocalTransform(r);c?(J.applyTransform(t,s,c),i||=t.clone(),i.union(t)):(i||=s.clone(),i.union(s))}}return i||t},t}(nL),Sz.prototype.type=`group`,Cz=function(){function e(){this.cx=0,this.cy=0,this.r=0}return e}(),wz=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new Cz},t.prototype.buildPath=function(e,t){e.moveTo(t.cx+t.r,t.cy),e.arc(t.cx,t.cy,t.r,0,Math.PI*2)},t}(JL),wz.prototype.type=`circle`,Tz=function(){function e(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return e}(),Ez=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new Tz},t.prototype.buildPath=function(e,t){var n=.5522848,r=t.cx,i=t.cy,a=t.rx,o=t.ry,s=a*n,c=o*n;e.moveTo(r-a,i),e.bezierCurveTo(r-a,i-c,r-s,i-o,r,i-o),e.bezierCurveTo(r+s,i-o,r+a,i-c,r+a,i),e.bezierCurveTo(r+a,i+c,r+s,i+o,r,i+o),e.bezierCurveTo(r-s,i+o,r-a,i+c,r-a,i),e.closePath()},t}(JL),Ez.prototype.type=`ellipse`,Dz=Math.PI,Oz=Dz*2,kz=Math.sin,Az=Math.cos,jz=Math.acos,Mz=Math.atan2,Nz=Math.abs,Pz=Math.sqrt,Fz=Math.max,Iz=Math.min,Lz=1e-4,Rz=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return e}(),zz=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new Rz},t.prototype.buildPath=function(e,t){af(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(JL),zz.prototype.type=`sector`,Bz=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),Vz=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new Bz},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.PI*2;e.moveTo(n+t.r,r),e.arc(n,r,t.r,0,i,!1),e.moveTo(n+t.r0,r),e.arc(n,r,t.r0,0,i,!0)},t}(JL),Vz.prototype.type=`ring`,Hz=function(){function e(){this.points=null,this.smooth=0,this.smoothConstraint=null}return e}(),Uz=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new Hz},t.prototype.buildPath=function(e,t){sf(e,t,!0)},t}(JL),Uz.prototype.type=`polygon`,Wz=function(){function e(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return e}(),Gz=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultStyle=function(){return{stroke:`#000`,fill:null}},t.prototype.getDefaultShape=function(){return new Wz},t.prototype.buildPath=function(e,t){sf(e,t,!1)},t}(JL),Gz.prototype.type=`polyline`,Kz={},qz=function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return e}(),Jz=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultStyle=function(){return{stroke:`#000`,fill:null}},t.prototype.getDefaultShape=function(){return new qz},t.prototype.buildPath=function(e,t){var n,r,i,a;if(this.subPixelOptimize){var o=yl(Kz,t,this.style);n=o.x1,r=o.y1,i=o.x2,a=o.y2}else n=t.x1,r=t.y1,i=t.x2,a=t.y2;var s=t.percent;s!==0&&(e.moveTo(n,r),s<1&&(i=n*(1-s)+i*s,a=r*(1-s)+a*s),e.lineTo(i,a))},t.prototype.pointAt=function(e){var t=this.shape;return[t.x1*(1-e)+t.x2*e,t.y1*(1-e)+t.y2*e]},t}(JL),Jz.prototype.type=`line`,Yz=[],Xz=function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1}return e}(),Zz=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultStyle=function(){return{stroke:`#000`,fill:null}},t.prototype.getDefaultShape=function(){return new Xz},t.prototype.buildPath=function(e,t){var n=t.x1,r=t.y1,i=t.x2,a=t.y2,o=t.cpx1,s=t.cpy1,c=t.cpx2,l=t.cpy2,u=t.percent;u!==0&&(e.moveTo(n,r),c==null||l==null?(u<1&&(Bs(n,o,i,u,Yz),o=Yz[1],i=Yz[2],Bs(r,s,a,u,Yz),s=Yz[1],a=Yz[2]),e.quadraticCurveTo(o,s,i,a)):(u<1&&(Ns(n,o,c,i,u,Yz),o=Yz[1],c=Yz[2],i=Yz[3],Ns(r,s,l,a,u,Yz),s=Yz[1],l=Yz[2],a=Yz[3]),e.bezierCurveTo(o,s,c,l,i,a)))},t.prototype.pointAt=function(e){return cf(this.shape,e,!1)},t.prototype.tangentAt=function(e){var t=cf(this.shape,e,!0);return Uo(t,t)},t}(JL),Zz.prototype.type=`bezier-curve`,Qz=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e}(),$z=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultStyle=function(){return{stroke:`#000`,fill:null}},t.prototype.getDefaultShape=function(){return new Qz},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r,0),a=t.startAngle,o=t.endAngle,s=t.clockwise,c=Math.cos(a),l=Math.sin(a);e.moveTo(c*i+n,l*i+r),e.arc(n,r,i,a,o,!s)},t}(JL),$z.prototype.type=`arc`,eB=function(e){F(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`compound`,t}return t.prototype._updatePathDirty=function(){for(var e=this.shape.paths,t=this.shapeChanged(),n=0;n<e.length;n++)t||=e[n].shapeChanged();t&&this.dirtyShape()},t.prototype.beforeBrush=function(){this._updatePathDirty();for(var e=this.shape.paths||[],t=this.getGlobalScale(),n=0;n<e.length;n++)e[n].path||e[n].createPathProxy(),e[n].path.setScale(t[0],t[1],e[n].segmentIgnoreThreshold)},t.prototype.buildPath=function(e,t){for(var n=t.paths||[],r=0;r<n.length;r++)n[r].buildPath(e,n[r].shape,!0)},t.prototype.afterBrush=function(){for(var e=this.shape.paths||[],t=0;t<e.length;t++)e[t].pathUpdated()},t.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),JL.prototype.getBoundingRect.call(this)},t}(JL),tB=function(){function e(e){this.colorStops=e||[]}return e.prototype.addColorStop=function(e,t){this.colorStops.push({offset:e,color:t})},e}(),nB=function(e){F(t,e);function t(t,n,r,i,a,o){var s=e.call(this,a)||this;return s.x=t??0,s.y=n??0,s.x2=r??1,s.y2=i??0,s.type=`linear`,s.global=o||!1,s}return t}(tB),rB=function(e){F(t,e);function t(t,n,r,i,a){var o=e.call(this,i)||this;return o.x=t??.5,o.y=n??.5,o.r=r??.5,o.type=`radial`,o.global=a||!1,o}return t}(tB),iB=Math.min,aB=Math.max,oB=Math.abs,sB=[0,0],cB=[0,0],lB=Zo(),uB=lB.minTv,dB=lB.maxTv,fB=function(){function e(e,t){this._corners=[],this._axes=[],this._origin=[0,0];for(var n=0;n<4;n++)this._corners[n]=new wF;for(var n=0;n<2;n++)this._axes[n]=new wF;e&&this.fromBoundingRect(e,t)}return e.prototype.fromBoundingRect=function(e,t){var n=this._corners,r=this._axes,i=e.x,a=e.y,o=i+e.width,s=a+e.height;if(n[0].set(i,a),n[1].set(o,a),n[2].set(o,s),n[3].set(i,s),t)for(var c=0;c<4;c++)n[c].transform(t);wF.sub(r[0],n[1],n[0]),wF.sub(r[1],n[3],n[0]),r[0].normalize(),r[1].normalize();for(var c=0;c<2;c++)this._origin[c]=r[c].dot(n[0])},e.prototype.intersect=function(e,t,n){var r=!0,i=!t;return t&&wF.set(t,0,0),lB.reset(n,!i),!this._intersectCheckOneSide(this,e,i,1)&&(r=!1,i)||!this._intersectCheckOneSide(e,this,i,-1)&&(r=!1,i)||!i&&!lB.negativeSize&&wF.copy(t,r?lB.useDir?lB.dirMinTv:uB:dB),r},e.prototype._intersectCheckOneSide=function(e,t,n,r){for(var i=!0,a=0;a<2;a++){var o=e._axes[a];if(e._getProjMinMaxOnAxis(a,e._corners,sB),e._getProjMinMaxOnAxis(a,t._corners,cB),lB.negativeSize||sB[1]<cB[0]||sB[0]>cB[1]){if(i=!1,lB.negativeSize||n)return i;var s=oB(cB[0]-sB[1]),c=oB(sB[0]-cB[1]);iB(s,c)>dB.len()&&(s<c?wF.scale(dB,o,-s*r):wF.scale(dB,o,c*r))}else if(!n){var s=oB(cB[0]-sB[1]),c=oB(sB[0]-cB[1]);(lB.useDir||iB(s,c)<uB.len())&&((s<c||!lB.bidirectional)&&(wF.scale(uB,o,s*r),lB.useDir&&lB.calcDirMTV()),(s>=c||!lB.bidirectional)&&(wF.scale(uB,o,-c*r),lB.useDir&&lB.calcDirMTV()))}}return i},e.prototype._getProjMinMaxOnAxis=function(e,t,n){for(var r=this._axes[e],i=this._origin,a=t[0].dot(r)+i[e],o=a,s=a,c=1;c<t.length;c++){var l=t[c].dot(r)+i[e];o=iB(l,o),s=aB(l,s)}n[0]=o+lB.touchThreshold,n[1]=s-lB.touchThreshold,lB.negativeSize=n[1]<n[0]},e}(),pB=[],mB=function(e){F(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.notClear=!0,t.incremental=1,t._displayables=[],t._temporaryDisplayables=[],t._cursor=0,t}return t.prototype.traverse=function(e,t){e.call(t,this)},t.prototype.useStyle=function(){this.style={}},t.prototype._useHoverStyle=function(){this.__hoverStyle=null},t.prototype.getCursor=function(){return this._cursor},t.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},t.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},t.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},t.prototype.addDisplayable=function(e,t){t?this._temporaryDisplayables.push(e):this._displayables.push(e),this.markRedraw()},t.prototype.addDisplayables=function(e,t){t||=!1;for(var n=0;n<e.length;n++)this.addDisplayable(e[n],t)},t.prototype.getDisplayables=function(){return this._displayables},t.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},t.prototype.eachPendingDisplayable=function(e){for(var t=this._cursor;t<this._displayables.length;t++)e&&e(this._displayables[t]);for(var t=0;t<this._temporaryDisplayables.length;t++)e&&e(this._temporaryDisplayables[t])},t.prototype.update=function(){this.updateTransform();for(var e=this._cursor;e<this._displayables.length;e++){var t=this._displayables[e];t.parent=this,t.update(),t.parent=null}for(var e=0;e<this._temporaryDisplayables.length;e++){var t=this._temporaryDisplayables[e];t.parent=this,t.update(),t.parent=null}},t.prototype.getBoundingRect=function(){if(!this._rect){for(var e=new J(1/0,1/0,-1/0,-1/0),t=0;t<this._displayables.length;t++){var n=this._displayables[t],r=n.getBoundingRect().clone();n.needLocalTransform()&&r.applyTransform(n.getLocalTransform(pB)),e.union(r)}this._rect=e}return this._rect},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t);if(this.getBoundingRect().contain(n[0],n[1])){for(var r=0;r<this._displayables.length;r++)if(this._displayables[r].contain(e,t))return!0}return!1},t}(cL),hB=Du(),gB=RP({Arc:()=>$z,BezierCurve:()=>Zz,BoundingRect:()=>J,Circle:()=>wz,CompoundPath:()=>eB,Ellipse:()=>Ez,Group:()=>Sz,HOVER_LAYER_FOR_INCREMENTAL:()=>2,HOVER_LAYER_FROM_THRESHOLD:()=>1,HOVER_LAYER_NO:()=>0,Image:()=>$L,IncrementalDisplayable:()=>mB,Line:()=>Jz,LinearGradient:()=>nB,OrientedBoundingRect:()=>fB,Path:()=>JL,Point:()=>wF,Polygon:()=>Uz,Polyline:()=>Gz,RadialGradient:()=>rB,Rect:()=>rR,Ring:()=>Vz,Sector:()=>zz,Text:()=>cR,WH:()=>yB,XY:()=>vB,applyTransform:()=>kf,calcZ2Range:()=>Xf,clipPointsByRect:()=>Pf,clipRectByRect:()=>Ff,createIcon:()=>If,decomposeTransform:()=>ep,ensureCopyRect:()=>qf,ensureCopyTransform:()=>Jf,expandOrShrinkRect:()=>Vf,extendPath:()=>yf,extendShape:()=>vf,getCurrentCanvasPainter:()=>tp,getShapeClass:()=>xf,getTransform:()=>Of,groupTransition:()=>Nf,initProps:()=>ff,isBoundingRectAxisAligned:()=>Kf,isElementRemoved:()=>pf,lineLineIntersect:()=>Rf,linePolygonIntersect:()=>Lf,makeImage:()=>Cf,makePath:()=>Sf,mergePath:()=>xB,payloadDisableAnimation:()=>$f,registerShape:()=>bf,removeElement:()=>mf,removeElementWithFadeOut:()=>gf,resizePath:()=>Tf,retrieveZInfo:()=>Yf,setTooltipConfig:()=>Uf,subPixelOptimize:()=>SB,subPixelOptimizeLine:()=>Ef,subPixelOptimizeRect:()=>Df,transformDirection:()=>Af,traverseElements:()=>Gf,traverseUpdateZ:()=>Zf,updateProps:()=>df}),_B={},vB=[`x`,`y`],yB=[`width`,`height`],bB=$d,xB=ef,SB=xl,CB=[0,0,0,0],wB=1e-5,TB=new lI,TB.transform=Eo(),bf(`circle`,wz),bf(`ellipse`,Ez),bf(`sector`,zz),bf(`ring`,Vz),bf(`polygon`,Uz),bf(`polyline`,Gz),bf(`rect`,rR),bf(`line`,Jz),bf(`bezierCurve`,Zz),bf(`arc`,$z),EB={},DB=[`fontStyle`,`fontWeight`,`fontSize`,`fontFamily`,`textShadowColor`,`textShadowBlur`,`textShadowOffsetX`,`textShadowOffsetY`],OB=[`align`,`lineHeight`,`width`,`height`,`tag`,`verticalAlign`,`ellipsis`],kB=[`padding`,`borderWidth`,`borderRadius`,`borderDashOffset`,`backgroundColor`,`borderColor`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`],AB=Du(),jB={minMargin:1,textMargin:2},MB=[`textStyle`,`color`],NB=[`fontStyle`,`fontWeight`,`fontSize`,`fontFamily`,`padding`,`lineHeight`,`rich`,`width`,`height`,`overflow`],PB=new cR,FB=function(){function e(){}return e.prototype.getTextColor=function(e){var t=this.ecModel;return this.getShallow(`color`)||(!e&&t?t.get(MB):null)},e.prototype.getFont=function(){return dp({fontStyle:this.getShallow(`fontStyle`),fontWeight:this.getShallow(`fontWeight`),fontSize:this.getShallow(`fontSize`),fontFamily:this.getShallow(`fontFamily`)},this.ecModel)},e.prototype.getTextRect=function(e){for(var t={text:e,verticalAlign:this.getShallow(`verticalAlign`)||this.getShallow(`baseline`)},n=0;n<NB.length;n++)t[NB[n]]=this.getShallow(NB[n]);return PB.useStyle(t),PB.update(),PB.getBoundingRect()},e}(),IB=[[`lineWidth`,`width`],[`stroke`,`color`],[`opacity`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`shadowColor`],[`lineDash`,`type`],[`lineDashOffset`,`dashOffset`],[`lineCap`,`cap`],[`lineJoin`,`join`],[`miterLimit`]],LB=xo(IB),RB=function(){function e(){}return e.prototype.getLineStyle=function(e){return LB(this,e)},e}(),zB=[[`fill`,`color`],[`stroke`,`borderColor`],[`lineWidth`,`borderWidth`],[`opacity`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`shadowColor`],[`lineDash`,`borderType`],[`lineDashOffset`,`borderDashOffset`],[`lineCap`,`borderCap`],[`lineJoin`,`borderJoin`],[`miterLimit`,`borderMiterLimit`]],BB=xo(zB),VB=function(){function e(){}return e.prototype.getItemStyle=function(e,t){return BB(this,e,t)},e}(),HB=function(){function e(e,t,n){this.parentModel=t,this.ecModel=n,this.option=e}return e.prototype.init=function(e,t,n){},e.prototype.mergeOption=function(e,t){Aa(this.option,e,!0)},e.prototype.get=function(e,t){return e==null?this.option:this._doGet(this.parsePath(e),!t&&this.parentModel)},e.prototype.getShallow=function(e,t){var n=this.option,r=n==null?n:n[e];if(r==null&&!t){var i=this.parentModel;i&&(r=i.getShallow(e))}return r},e.prototype.getModel=function(t,n){var r=t!=null,i=r?this.parsePath(t):null,a=r?this._doGet(i):this.option;return n||=this.parentModel&&this.parentModel.getModel(this.resolveParentPath(i)),new e(a,n,this.ecModel)},e.prototype.isEmpty=function(){return this.option==null},e.prototype.restoreData=function(){},e.prototype.clone=function(){var e=this.constructor;return new e(ka(this.option))},e.prototype.parsePath=function(e){return typeof e==`string`?e.split(`.`):e},e.prototype.resolveParentPath=function(e){return e},e.prototype.isAnimationEnabled=function(){if(!dF.node&&this.option){if(this.option.animation!=null)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},e.prototype._doGet=function(e,t){var n=this.option;if(!e)return n;for(var r=0;r<e.length&&!(e[r]&&(n=n&&typeof n==`object`?n[e[r]]:null,n==null));r++);return n==null&&t&&(n=t._doGet(this.resolveParentPath(e),t.parentModel)),n},e}(),mo(HB),_o(HB),Fa(HB,RB),Fa(HB,VB),Fa(HB,_F),Fa(HB,FB),UB=function(){function e(e,t,n,r,i,a){this._old=e,this._new=t,this._oldKeyGetter=n||hp,this._newKeyGetter=r||hp,this.context=i,this._diffModeMultiple=a===`multiple`}return e.prototype.add=function(e){return this._add=e,this},e.prototype.update=function(e){return this._update=e,this},e.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},e.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},e.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},e.prototype.remove=function(e){return this._remove=e,this},e.prototype.execute=function(){this[this._diffModeMultiple?`_executeMultiple`:`_executeOneToOne`]()},e.prototype._executeOneToOne=function(){var e=this._old,t=this._new,n={},r=Array(e.length),i=Array(t.length);this._initIndexMap(e,null,r,`_oldKeyGetter`),this._initIndexMap(t,n,i,`_newKeyGetter`);for(var a=0;a<e.length;a++){var o=r[a],s=n[o],c=mp(s);if(c>1){var l=s.shift();s.length===1&&(n[o]=s[0]),this._update&&this._update(l,a)}else c===1?(n[o]=null,this._update&&this._update(s,a)):this._remove&&this._remove(a)}this._performRestAdd(i,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},r={},i=[],a=[];this._initIndexMap(e,n,i,`_oldKeyGetter`),this._initIndexMap(t,r,a,`_newKeyGetter`);for(var o=0;o<i.length;o++){var s=i[o],c=n[s],l=r[s],u=mp(c),d=mp(l);if(u>1&&d===1)this._updateManyToOne&&this._updateManyToOne(l,c),r[s]=null;else if(u===1&&d>1)this._updateOneToMany&&this._updateOneToMany(l,c),r[s]=null;else if(u===1&&d===1)this._update&&this._update(l,c),r[s]=null;else if(u>1&&d>1)this._updateManyToMany&&this._updateManyToMany(l,c),r[s]=null;else if(u>1)for(var f=0;f<u;f++)this._remove&&this._remove(c[f]);else this._remove&&this._remove(c)}this._performRestAdd(a,r)},e.prototype._performRestAdd=function(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=t[r],a=mp(i);if(a>1)for(var o=0;o<a;o++)this._add&&this._add(i[o]);else a===1&&this._add&&this._add(i);t[r]=null}},e.prototype._initIndexMap=function(e,t,n,r){for(var i=this._diffModeMultiple,a=0;a<e.length;a++){var o=`_ec_`+this[r](e[a],a);if(i||(n[a]=o),t){var s=t[o],c=mp(s);c===0?(t[o]=a,i&&n.push(o)):c===1?t[o]=[s,a]:s.push(a)}}},e}(),WB={Must:1,Might:2,Not:3},GB=Du(),KB=function(){function e(e){this.data=e.data||(e.sourceFormat===`keyedColumns`?{}:[]),this.sourceFormat=e.sourceFormat||`unknown`,this.seriesLayoutBy=e.seriesLayoutBy||`column`,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var n=0;n<t.length;n++){var r=t[n];r.type==null&&xp(this,n)===WB.Must&&(r.type=`ordinal`)}}return e}(),$B=function(){function e(e,t){var n=Cp(e)?e:Tp(e);this._source=n;var r=this._data=n.data,i=n.sourceFormat;n.seriesLayoutBy,i===`typedArray`&&(this._offset=0,this._dimSize=t,this._data=r),QB(this,r,n)}return e.prototype.getSource=function(){return this._source},e.prototype.count=function(){return 0},e.prototype.getItem=function(e,t){},e.prototype.appendData=function(e){},e.prototype.clean=function(){},e.protoInitialize=function(){var t=e.prototype;t.pure=!1,t.persistent=!0}(),e.internalField=function(){var e;QB=function(e,i,a){var o=a.sourceFormat,s=a.seriesLayoutBy,c=a.startIndex,l=a.dimensionsDefine,u=ZB[Ip(o,s)];I(e,u),o===`typedArray`?(e.getItem=t,e.count=r,e.fillStorage=n):(e.getItem=q(Np(o,s),null,i,c,l),e.count=q(Pp(o,s),null,i,c,l))};var t=function(e,t){e-=this._offset,t||=[];for(var n=this._data,r=this._dimSize,i=r*e,a=0;a<r;a++)t[a]=n[i+a];return t},n=function(e,t,n,r){for(var i=this._data,a=this._dimSize,o=0;o<a;o++){for(var s=r[o],c=s[0]==null?1/0:s[0],l=s[1]==null?-1/0:s[1],u=t-e,d=n[o],f=0;f<u;f++){var p=i[f*a+o];d[e+f]=p,p<c&&(c=p),p>l&&(l=p)}s[0]=c,s[1]=l}},r=function(){return this._data?this._data.length/this._dimSize:0};ZB=(e={},e[HR+`_`+qR]={pure:!0,appendData:i},e[HR+`_row`]={pure:!0,appendData:function(){throw Error(`Do not support appendData when set seriesLayoutBy: "row".`)}},e[UR]={pure:!0,appendData:i},e[WR]={pure:!0,appendData:function(e){var t=this._data;L(e,function(e,n){for(var r=t[n]||(t[n]=[]),i=0;i<(e||[]).length;i++)r.push(e[i])})}},e[VR]={appendData:i},e[GR]={persistent:!1,pure:!0,appendData:function(e){this._data=e},clean:function(){this._offset+=this.count(),this._data=null}},e);function i(e){for(var t=0;t<e.length;t++)this._data.push(e[t])}}(),e}(),eV=function(e){z(e)||au(`series.data or dataset.source must be an array.`)},qB={},qB[HR+`_`+qR]=eV,qB[HR+`_row`]=eV,qB[UR]=eV,qB[WR]=function(e,t){for(var n=0;n<t.length;n++)t[n].name??au(`dimension name must not be null/undefined.`)},qB[VR]=eV,tV=function(e,t,n,r){return e[r]},nV=(JB={},JB[HR+`_`+qR]=function(e,t,n,r){return e[r+t]},JB[HR+`_row`]=function(e,t,n,r,i){r+=t;for(var a=i||[],o=e,s=0;s<o.length;s++){var c=o[s];a[s]=c?c[r]:null}return a},JB[UR]=tV,JB[WR]=function(e,t,n,r,i){for(var a=i||[],o=0;o<n.length;o++){var s=n[o].name,c=s==null?null:e[s];a[o]=c?c[r]:null}return a},JB[VR]=tV,JB),rV=function(e,t,n){return e.length},iV=(YB={},YB[HR+`_`+qR]=function(e,t,n){return Math.max(0,e.length-t)},YB[HR+`_row`]=function(e,t,n){var r=e[0];return r?Math.max(0,r.length-t):0},YB[UR]=rV,YB[WR]=function(e,t,n){var r=n[0].name,i=r==null?null:e[r];return i?i.length:0},YB[VR]=rV,YB),aV=function(e,t,n){return e[t]},oV=(XB={},XB[HR]=aV,XB[UR]=function(e,t,n){return e[n]},XB[WR]=aV,XB[VR]=function(e,t,n){var r=uu(e);return r instanceof Array?r[t]:r},XB[GR]=aV,XB),sV=function(){function e(e,t){this._encode=e,this._schema=t}return e.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},e.prototype._getFullDimensionNames=function(){return this._cachedDimNames||=this._schema?this._schema.makeOutputDimensionNames():[],this._cachedDimNames},e}(),cV=function(){function e(e){this.otherDims={},e!=null&&I(this,e)}return e}(),W({number:function(e){return parseFloat(e)},time:function(e){return+ql(e)},trim:function(e){return V(e)?no(e):e}}),lV={lt:function(e,t){return e<t},lte:function(e,t){return e<=t},gt:function(e,t){return e>t},gte:function(e,t){return e>=t}},(function(){function e(e,t){Wa(t)||ou(``),this._opFn=lV[e],this._rvalFloat=Ql(t)}return e.prototype.evaluate=function(e){return Wa(e)?this._opFn(e,this._rvalFloat):this._opFn(Ql(e),this._rvalFloat)},e})(),uV=function(){function e(e,t){var n=e===`desc`;this._resultLT=n?1:-1,t??=n?`min`:`max`,this._incomparable=t===`min`?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=Wa(e)?e:Ql(e),r=Wa(t)?t:Ql(t),i=isNaN(n),a=isNaN(r);if(i&&(n=this._incomparable),a&&(r=this._incomparable),i&&a){var o=V(e),s=V(t);o&&(n=s?e:0),s&&(r=o?t:0)}return n<r?this._resultLT:n>r?-this._resultLT:0},e}(),(function(){function e(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=Ql(t)}return e.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n!==this._rvalTypeof&&(n===`number`||this._rvalTypeof===`number`)&&(t=Ql(e)===this._rvalFloat)}return this._isEQ?t:!t},e})(),dV=typeof Uint32Array>`u`?Array:Uint32Array,fV=typeof Uint16Array>`u`?Array:Uint16Array,pV=typeof Int32Array>`u`?Array:Int32Array,mV=typeof Float64Array>`u`?Array:Float64Array,hV={float:mV,int:pV,ordinal:Array,number:Array,time:mV},_V=function(){function e(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=W()}return e.prototype.initData=function(e,t,n){this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var r=e.getSource(),i=this.defaultDimValueGetter=gV[r.sourceFormat];this._dimValueGetter=n||i,this._rawExtent=[],Mp(r),this._dimensions=R(t,function(e){return{type:e.type,property:e.property}}),this._initDataFromProvider(0,e.count())},e.prototype.getProvider=function(){return this._provider},e.prototype.getSource=function(){return this._provider.getSource()},e.prototype.ensureCalculationDimension=function(e,t){var n=this._calcDimNameToIdx,r=this._dimensions,i=n.get(e);if(i!=null){if(r[i].type===t)return i}else i=r.length;return r[i]={type:t},n.set(e,i),this._chunks[i]=new hV[t||`float`](this._rawCount),this._rawExtent[i]=Lu(),i},e.prototype.collectOrdinalMeta=function(e,t){var n=this._chunks[e],r=this._dimensions[e],i=this._rawExtent,a=r.ordinalOffset||0,o=n.length;a===0&&(i[e]=Lu());for(var s=i[e],c=a;c<o;c++){var l=n[c]=t.parseAndCollect(n[c]);isNaN(l)||(s[0]=Math.min(l,s[0]),s[1]=Math.max(l,s[1]))}r.ordinalMeta=t,r.ordinalOffset=o,r.type=`ordinal`},e.prototype.getOrdinalMeta=function(e){return this._dimensions[e].ordinalMeta},e.prototype.getDimensionProperty=function(e){var t=this._dimensions[e];return t&&t.property},e.prototype.appendData=function(e){var t=this._provider,n=this.count();t.appendData(e);var r=t.count();return t.persistent||(r+=n),n<r&&this._initDataFromProvider(n,r,!0),[n,r]},e.prototype.appendValues=function(e,t){for(var n=this._chunks,r=this._dimensions,i=r.length,a=this._rawExtent,o=this.count(),s=o+Math.max(e.length,t||0),c=0;c<i;c++){var l=r[c];qp(n,c,l.type,s,!0)}for(var u=[],d=o;d<s;d++)for(var f=d-o,p=0;p<i;p++){var l=r[p],m=gV.arrayRows.call(this,e[f]||u,l.property,f,p);n[p][d]=m;var h=a[p];m<h[0]&&(h[0]=m),m>h[1]&&(h[1]=m)}return this._rawCount=this._count=s,{start:o,end:s}},e.prototype._initDataFromProvider=function(e,t,n){for(var r=this._provider,i=this._chunks,a=this._dimensions,o=a.length,s=this._rawExtent,c=R(a,function(e){return e.property}),l=0;l<o;l++){var u=a[l];s[l]||(s[l]=Lu()),qp(i,l,u.type,t,n)}if(r.fillStorage)r.fillStorage(e,t,i,s);else for(var d=[],f=e;f<t;f++){d=r.getItem(f,d);for(var p=0;p<o;p++){var m=i[p],h=this._dimValueGetter(d,c[p],f,p);m[f]=h;var g=s[p];h<g[0]&&(g[0]=h),h>g[1]&&(g[1]=h)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=t,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var n=this._chunks[e];return n?n[this.getRawIndex(t)]:NaN},e.prototype.getValues=function(e,t){var n=[],r=[];if(t==null){t=e,e=[];for(var i=0;i<this._dimensions.length;i++)r.push(i)}else r=e;for(var i=0,a=r.length;i<a;i++)n.push(this.get(r[i],t));return n},e.prototype.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var n=this._chunks[e];return n?n[t]:NaN},e.prototype.getSum=function(e){var t=this._chunks[e],n=0;if(t)for(var r=0,i=this.count();r<i;r++){var a=this.get(e,r);isNaN(a)||(n+=a)}return n},e.prototype.getMedian=function(e){var t=[];this.each([e],function(e){isNaN(e)||t.push(e)}),zl(t);var n=this.count();return n===0?0:n%2==1?t[(n-1)/2]:(t[n/2]+t[n/2-1])/2},e.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(n!=null&&n<this._count&&n===e)return e;for(var r=0,i=this._count-1;r<=i;){var a=(r+i)/2|0;if(t[a]<e)r=a+1;else if(t[a]>e)i=a-1;else return a}return-1},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,r=this._count;if(n===Array){e=new n(r);for(var i=0;i<r;i++)e[i]=t[i]}else e=new n(t.buffer,0,r)}else{var n=Gp(this._rawCount);e=new n(this.count());for(var i=0;i<e.length;i++)e[i]=i}return e},e.prototype.filter=function(e,t){if(!this._count)return this;for(var n=this.clone(),r=n.count(),i=new(Gp(n._rawCount))(r),a=[],o=e.length,s=0,c=e[0],l=n._chunks,u=0;u<r;u++){var d=void 0,f=n.getRawIndex(u);if(o===0)d=t(u);else if(o===1){var p=l[c][f];d=t(p,u)}else{for(var m=0;m<o;m++)a[m]=l[e[m]][f];a[m]=u,d=t.apply(null,a)}d&&(i[s++]=f)}return s<r&&(n._indices=i),n._count=s,n._extent=[],n._updateGetRawIdx(),n},e.prototype.selectRange=function(e){var t=this.clone(),n=t._count;if(!n)return this;var r=Ba(e),i=r.length;if(!i)return this;var a=t.count(),o=new(Gp(t._rawCount))(a),s=0,c=r[0],l=e[c][0],u=e[c][1],d=t._chunks,f=!1;if(!t._indices){var p=0;if(i===1){for(var m=d[r[0]],h=0;h<n;h++){var g=m[h];(g>=l&&g<=u||isNaN(g))&&(o[s++]=p),p++}f=!0}else if(i===2){for(var m=d[r[0]],_=d[r[1]],v=e[r[1]][0],y=e[r[1]][1],h=0;h<n;h++){var g=m[h],b=_[h];(g>=l&&g<=u||isNaN(g))&&(b>=v&&b<=y||isNaN(b))&&(o[s++]=p),p++}f=!0}}if(!f){if(i===1)for(var h=0;h<a;h++){var x=t.getRawIndex(h),g=d[r[0]][x];(g>=l&&g<=u||isNaN(g))&&(o[s++]=x)}else for(var h=0;h<a;h++){for(var S=!0,x=t.getRawIndex(h),C=0;C<i;C++){var w=r[C],g=d[w][x];(g<e[w][0]||g>e[w][1])&&(S=!1)}S&&(o[s++]=t.getRawIndex(h))}}return s<a&&(t._indices=o),t._count=s,t._extent=[],t._updateGetRawIdx(),t},e.prototype.map=function(e,t){var n=this.clone(e);return this._updateDims(n,e,t),n},e.prototype.modify=function(e,t){this._updateDims(this,e,t)},e.prototype._updateDims=function(e,t,n){for(var r=e._chunks,i=[],a=t.length,o=e.count(),s=[],c=e._rawExtent,l=0;l<t.length;l++)c[t[l]]=Lu();for(var u=0;u<o;u++){for(var d=e.getRawIndex(u),f=0;f<a;f++)s[f]=r[t[f]][d];s[a]=u;var p=n&&n.apply(null,s);if(p!=null){typeof p!=`object`&&(i[0]=p,p=i);for(var l=0;l<p.length;l++){var m=t[l],h=p[l],g=c[m],_=r[m];_&&(_[d]=h),h<g[0]&&(g[0]=h),h>g[1]&&(g[1]=h)}}}},e.prototype.lttbDownSample=function(e,t){var n=this.clone([e],!0),r=n._chunks[e],i=this.count(),a=0,o=Math.floor(1/t),s=this.getRawIndex(0),c,l,u,d=new(Gp(this._rawCount))(Math.min((Math.ceil(i/o)+2)*2,i));d[a++]=s;for(var f=1;f<i-1;f+=o){for(var p=Math.min(f+o,i-1),m=Math.min(f+o*2,i),h=(m+p)/2,g=0,_=p;_<m;_++){var v=this.getRawIndex(_),y=r[v];isNaN(y)||(g+=y)}g/=m-p;var b=f,x=Math.min(f+o,i),S=f-1,C=r[s];c=-1,u=b;for(var w=-1,T=0,_=b;_<x;_++){var v=this.getRawIndex(_),y=r[v];isNaN(y)?(T++,w<0&&(w=v)):(l=Math.abs((S-h)*(y-C)-(S-_)*(g-C)),l>c&&(c=l,u=v))}T>0&&T<x-b&&(d[a++]=Math.min(w,u),u=Math.max(w,u)),d[a++]=u,s=u}return d[a++]=this.getRawIndex(i-1),n._count=a,n._indices=d,n.getRawIndex=this._getRawIdx,n},e.prototype.minmaxDownSample=function(e,t){for(var n=this.clone([e],!0),r=n._chunks,i=Math.floor(1/t),a=r[e],o=this.count(),s=new(Gp(this._rawCount))(Math.ceil(o/i)*2),c=0,l=0;l<o;l+=i){var u=l,d=a[this.getRawIndex(u)],f=l,p=a[this.getRawIndex(f)],m=i;l+i>o&&(m=o-l);for(var h=0;h<m;h++){var g=a[this.getRawIndex(l+h)];g<d&&(d=g,u=l+h),g>p&&(p=g,f=l+h)}var _=this.getRawIndex(u),v=this.getRawIndex(f);u<f?(s[c++]=_,s[c++]=v):(s[c++]=v,s[c++]=_)}return n._count=c,n._indices=s,n._updateGetRawIdx(),n},e.prototype.downSample=function(e,t,n,r){for(var i=this.clone([e],!0),a=i._chunks,o=[],s=Math.floor(1/t),c=a[e],l=this.count(),u=i._rawExtent[e]=Lu(),d=new(Gp(this._rawCount))(Math.ceil(l/s)),f=0,p=0;p<l;p+=s){s>l-p&&(s=l-p,o.length=s);for(var m=0;m<s;m++){var h=this.getRawIndex(p+m);o[m]=c[h]}var g=n(o),_=this.getRawIndex(Math.min(p+r(o,g)||0,l-1));c[_]=g,g<u[0]&&(u[0]=g),g>u[1]&&(u[1]=g),d[f++]=_}return i._count=f,i._indices=d,i._updateGetRawIdx(),i},e.prototype.each=function(e,t){if(this._count)for(var n=e.length,r=this._chunks,i=0,a=this.count();i<a;i++){var o=this.getRawIndex(i);switch(n){case 0:t(i);break;case 1:t(r[e[0]][o],i);break;case 2:t(r[e[0]][o],r[e[1]][o],i);break;default:for(var s=0,c=[];s<n;s++)c[s]=r[e[s]][o];c[s]=i,t.apply(null,c)}}},e.prototype.getDataExtent=function(e,t){var n=this._chunks[e],r=Lu();if(!n)return r;var i=this.count();if(!this._indices&&!t)return this._rawExtent[e].slice();var a=this._extent,o=a[e]||(a[e]={}),s=Up(t),c=s.key,l=o[c];if(l)return l.slice();for(var u=r[0],d=r[1],f=0;f<i;f++){var p=n[this.getRawIndex(f)];(!t||Wp(s,p))&&(p<u&&(u=p),p>d&&(d=p))}return o[c]=[u,d]},e.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],r=this._chunks,i=0;i<r.length;i++)n.push(r[i][t]);return n},e.prototype.clone=function(t,n){var r=new e,i=this._chunks,a=t&&La(t,function(e,t){return e[t]=!0,e},{});if(a)for(var o=0;o<i.length;o++)r._chunks[o]=a[o]?Kp(i[o]):i[o];else r._chunks=i;return this._copyCommonProps(r),n||(r._indices=this._cloneIndices()),r._updateGetRawIdx(),r},e.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=ka(this._extent),e._rawExtent=ka(this._rawExtent)},e.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,t=void 0;if(e===Array){var n=this._indices.length;t=new e(n);for(var r=0;r<n;r++)t[r]=this._indices[r]}else t=new e(this._indices);return t}return null},e.prototype._getRawIdxIdentity=function(e){return e},e.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function e(e,t,n,r){return Hp(e[r],this._dimensions[r])}gV={arrayRows:e,objectRows:function(e,t,n,r){return Hp(e[t],this._dimensions[r])},keyedColumns:e,original:function(e,t,n,r){var i=e&&(e.value==null?e:e.value);return Hp(i instanceof Array?i[r]:i,this._dimensions[r])},typedArray:function(e,t,n,r){return e[r]}}}(),e}(),vV=Du(),yV={float:`f`,int:`i`,ordinal:`o`,number:`n`,time:`t`},bV=function(){function e(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return e.prototype.isDimensionOmitted=function(){return this._dimOmitted},e.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||=Xp(this.source))},e.prototype.getSourceDimensionIndex=function(e){return U(this._dimNameMap.get(e),-1)},e.prototype.getSourceDimension=function(e){var t=this.source.dimensionsDefine;if(t)return t[e]},e.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,t=Mp(this.source),n=!Zp(e),r=``,i=[],a=0,o=0;a<e;a++){var s=void 0,c=void 0,l=void 0,u=this.dimensions[o];if(u&&u.storeDimIndex===a)s=t?u.name:null,c=u.type,l=u.ordinalMeta,o++;else{var d=this.getSourceDimension(a);d&&(s=t?d.name:null,c=d.type)}i.push({property:s,type:c,ordinalMeta:l}),!t||s==null||u&&u.isCalculationCoord||(r+=n?s.replace(/\`/g,"`1").replace(/\$/g,"`2"):s),r+=`$`,r+=yV[c]||`f`,l&&(r+=l.uid),r+=`$`}var f=this.source;return{dimensions:i,hash:[f.seriesLayoutBy,f.startIndex,r].join(`$$`)}},e.prototype.makeOutputDimensionNames=function(){for(var e=[],t=0,n=0;t<this._fullDimCount;t++){var r=void 0,i=this.dimensions[n];if(i&&i.storeDimIndex===t)i.isCalculationCoord||(r=i.name),n++;else{var a=this.getSourceDimension(t);a&&(r=a.name)}e.push(r)}return e},e.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},e}(),xV=H,SV=R,CV=typeof Int32Array>`u`?Array:Int32Array,wV=`e\0\0`,TV=-1,EV=[`hasItemOption`,`_nameList`,`_idList`,`_invertedIndicesMap`,`_dimSummary`,`userOutput`,`_rawData`,`_dimValueGetter`,`_nameDimIdx`,`_idDimIdx`,`_nameRepeatCount`],DV=[`_approximateExtent`],FV=function(){function e(e,t){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`,`minmaxDownSample`,`lttbDownSample`,`map`],this.CHANGABLE_METHODS=[`filterSelf`,`selectRange`],this.DOWNSAMPLE_METHODS=[`downSample`,`minmaxDownSample`,`lttbDownSample`];var n,r=!1;Jp(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(r=!0,n=e),n||=[`x`,`y`];for(var i={},a=[],o={},s=!1,c={},l=0;l<n.length;l++){var u=n[l],d=V(u)?new cV({name:u}):u instanceof cV?u:new cV(u),f=d.name;d.type=d.type||`float`,d.coordDim||(d.coordDim=f,d.coordDimIndex=0);var p=d.otherDims=d.otherDims||{};a.push(f),i[f]=d,c[f]!=null&&(s=!0),d.createInvertedIndices&&(o[f]=[]),r&&(d.storeDimIndex=l),p.itemName===0&&(this._nameDimIdx=d.storeDimIndex),p.itemId===0&&(this._idDimIdx=d.storeDimIndex)}if(this.dimensions=a,this._dimInfos=i,this._initGetDimensionInfo(s),this.hostModel=t,this._invertedIndicesMap=o,this._dimOmitted){var m=this._dimIdxToName=W();L(a,function(e){m.set(i[e].storeDimIndex,e)})}}return e.prototype.getDimension=function(e){var t=this._recognizeDimIndex(e);if(t==null)return e;if(t=e,!this._dimOmitted)return this.dimensions[t];var n=this._dimIdxToName.get(t);if(n!=null)return n;var r=this._schema.getSourceDimension(t);if(r)return r.name},e.prototype.getDimensionIndex=function(e){var t=this._recognizeDimIndex(e);if(t!=null)return t;if(e==null)return-1;var n=this._getDimInfo(e);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},e.prototype._recognizeDimIndex=function(e){if(Wa(e)||e!=null&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},e.prototype._getStoreDimIndex=function(e){return this.getDimensionIndex(e)},e.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},e.prototype._initGetDimensionInfo=function(e){var t=this._dimInfos;this._getDimInfo=e?function(e){return t.hasOwnProperty(e)?t[e]:void 0}:function(e){return t[e]}},e.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},e.prototype.mapDimension=function(e,t){var n=this._dimSummary;if(t==null)return n.encodeFirstDimNotExtra[e];var r=n.encode[e];return r?r[t]:null},e.prototype.mapDimensionsAll=function(e){return(this._dimSummary.encode[e]||[]).slice()},e.prototype.getStore=function(){return this._store},e.prototype.initData=function(e,t,n){var r=this,i;if(e instanceof _V&&(i=e),!i){var a=this.dimensions,o=Cp(e)||Ia(e)?new $B(e,a.length):e;i=new _V;var s=SV(a,function(e){return{type:r._dimInfos[e].type,property:e}});i.initData(o,s,n)}this._store=i,this._nameList=(t||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,i.count()),this._dimSummary=Rp(this,this._schema),this.userOutput=this._dimSummary.userOutput},e.prototype.appendData=function(e){var t=this._store.appendData(e);this._doInit(t[0],t[1])},e.prototype.appendValues=function(e,t){var n=this._store.appendValues(e,t&&t.length),r=n.start,i=n.end,a=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),t)for(var o=r;o<i;o++){var s=o-r;this._nameList[o]=t[s],a&&PV(this,o)}},e.prototype._updateOrdinalMeta=function(){for(var e=this._store,t=this.dimensions,n=0;n<t.length;n++){var r=this._dimInfos[t[n]];r.ordinalMeta&&e.collectOrdinalMeta(r.storeDimIndex,r.ordinalMeta)}},e.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return this._idDimIdx==null&&e.getSource().sourceFormat!==`typedArray`&&!e.fillStorage},e.prototype._doInit=function(e,t){if(!(e>=t)){var n=this._store.getProvider();this._updateOrdinalMeta();var r=this._nameList,i=this._idList;if(n.getSource().sourceFormat===`original`&&!n.pure)for(var a=[],o=e;o<t;o++){var s=n.getItem(o,a);if(!this.hasItemOption&&du(s)&&(this.hasItemOption=!0),s){var c=s.name;r[o]==null&&c!=null&&(r[o]=xu(c,null));var l=s.id;i[o]==null&&l!=null&&(i[o]=xu(l,null))}}if(this._shouldMakeIdFromName())for(var o=e;o<t;o++)PV(this,o);OV(this)}},e.prototype.getApproximateExtent=function(e,t){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e),t)},e.prototype.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},e.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},e.prototype.setCalculationInfo=function(e,t){xV(e)?I(this._calculationInfo,e):this._calculationInfo[e]=t},e.prototype.getName=function(e){var t=this.getRawIndex(e),n=this._nameList[t];return n==null&&this._nameDimIdx!=null&&(n=AV(this,this._nameDimIdx,t)),n??=``,n},e.prototype._getCategory=function(e,t){var n=this._store.get(e,t),r=this._store.getOrdinalMeta(e);return r?r.categories[n]:n},e.prototype.getId=function(e){return kV(this,this.getRawIndex(e))},e.prototype.count=function(){return this._store.count()},e.prototype.get=function(e,t){var n=this._store,r=this._dimInfos[e];if(r)return n.get(r.storeDimIndex,t)},e.prototype.getByRawIndex=function(e,t){var n=this._store,r=this._dimInfos[e];if(r)return n.getByRawIndex(r.storeDimIndex,t)},e.prototype.getIndices=function(){return this._store.getIndices()},e.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e),null)},e.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},e.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},e.prototype.getValues=function(e,t){var n=this,r=this._store;return z(e)?r.getValues(SV(e,function(e){return n._getStoreDimIndex(e)}),t):r.getValues(e)},e.prototype.hasValue=function(e){for(var t=this._dimSummary.dataDimIndicesOnCoord,n=0,r=t.length;n<r;n++)if(isNaN(this._store.get(t[n],e)))return!1;return!0},e.prototype.indexOfName=function(e){for(var t=0,n=this._store.count();t<n;t++)if(this.getName(t)===e)return t;return-1},e.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},e.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},e.prototype.rawIndexOf=function(e,t){var n=e&&this._invertedIndicesMap[e],r=n&&n[t];return r==null||isNaN(r)?TV:r},e.prototype.each=function(e,t,n){B(e)&&(n=t,t=e,e=[]);var r=n||this,i=SV(jV(e),this._getStoreDimIndex,this);this._store.each(i,r?q(t,r):t)},e.prototype.filterSelf=function(e,t,n){B(e)&&(n=t,t=e,e=[]);var r=n||this,i=SV(jV(e),this._getStoreDimIndex,this);return this._store=this._store.filter(i,r?q(t,r):t),this},e.prototype.selectRange=function(e){var t=this,n={},r=Ba(e),i=[];return L(r,function(r){var a=t._getStoreDimIndex(r);n[a]=e[r],i.push(a)}),this._store=this._store.selectRange(n),this},e.prototype.mapArray=function(e,t,n){B(e)&&(n=t,t=e,e=[]),n||=this;var r=[];return this.each(e,function(){r.push(t&&t.apply(this,arguments))},n),r},e.prototype.map=function(e,t,n,r){var i=n||r||this,a=SV(jV(e),this._getStoreDimIndex,this),o=NV(this);return o._store=this._store.map(a,i?q(t,i):t),o},e.prototype.modify=function(e,t,n,r){var i=n||r||this,a=SV(jV(e),this._getStoreDimIndex,this);this._store.modify(a,i?q(t,i):t)},e.prototype.downSample=function(e,t,n,r){var i=NV(this);return i._store=this._store.downSample(this._getStoreDimIndex(e),t,n,r),i},e.prototype.minmaxDownSample=function(e,t){var n=NV(this);return n._store=this._store.minmaxDownSample(this._getStoreDimIndex(e),t),n},e.prototype.lttbDownSample=function(e,t){var n=NV(this);return n._store=this._store.lttbDownSample(this._getStoreDimIndex(e),t),n},e.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},e.prototype.getItemModel=function(e){var t=this.hostModel;return new HB(this.getRawDataItem(e),t,t&&t.ecModel)},e.prototype.diff=function(e){var t=this;return new UB(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(t){return kV(e,t)},function(e){return kV(t,e)})},e.prototype.getVisual=function(e){var t=this._visual;return t&&t[e]},e.prototype.setVisual=function(e,t){this._visual=this._visual||{},xV(e)?I(this._visual,e):this._visual[e]=t},e.prototype.getItemVisual=function(e,t){var n=this._itemVisuals[e];return(n&&n[t])??this.getVisual(t)},e.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,r=n[e];r||=n[e]={};var i=r[t];return i??(i=this.getVisual(t),z(i)?i=i.slice():xV(i)&&(i=I({},i)),r[t]=i),i},e.prototype.setItemVisual=function(e,t,n){var r=this._itemVisuals[e]||{};this._itemVisuals[e]=r,xV(t)?I(r,t):r[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){xV(e)?I(this._layout,e):this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?I(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){RR(this.hostModel&&this.hostModel.seriesIndex,this.dataType,e,t),this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){L(this._graphicEls,function(n,r){n&&e&&e.call(t,n,r)})},e.prototype.cloneShallow=function(t){return t||=new e(this._schema?this._schema:SV(this.dimensions,this._getDimInfo,this),this.hostModel),MV(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(e,t){var n=this[e];B(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat($a(arguments)))})},e.internalField=function(){OV=function(e){var t=e._invertedIndicesMap;L(t,function(n,r){var i=e._dimInfos[r],a=i.ordinalMeta,o=e._store;if(a){n=t[r]=new CV(a.categories.length);for(var s=0;s<n.length;s++)n[s]=TV;for(var s=0;s<o.count();s++)n[o.get(i.storeDimIndex,s)]=s}})},AV=function(e,t,n){return xu(e._getCategory(t,n),null)},kV=function(e,t){var n=e._idList[t];return n==null&&e._idDimIdx!=null&&(n=AV(e,e._idDimIdx,t)),n??=wV+t,n},jV=function(e){return z(e)||(e=e==null?[]:[e]),e},NV=function(t){var n=new e(t._schema?t._schema:SV(t.dimensions,t._getDimInfo,t),t.hostModel);return MV(n,t),n},MV=function(e,t){L(EV.concat(t.__wrappedMethods||[]),function(n){t.hasOwnProperty(n)&&(e[n]=t[n])}),e.__wrappedMethods=t.__wrappedMethods,L(DV,function(n){e[n]=ka(t[n])}),e._calculationInfo=I({},t._calculationInfo)},PV=function(e,t){var n=e._nameList,r=e._idList,i=e._nameDimIdx,a=e._idDimIdx,o=n[t],s=r[t];if(o==null&&i!=null&&(n[t]=o=AV(e,i,t)),s==null&&a!=null&&(r[t]=s=AV(e,a,t)),s==null&&o!=null){var c=e._nameRepeatCount,l=c[o]=(c[o]||0)+1;s=o,l>1&&(s+=`__ec__`+l),r[t]=s}}}(),e}(),IV={},LV={},RV=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(e,t){this._nonSeriesBoxMasterList=n(IV,!0),this._normalMasterList=n(LV,!1);function n(n,r){var i=[];return L(n,function(n,r){var a=n.create(e,t);i=i.concat(a||[])}),i}},e.prototype.update=function(e,t){L(this._normalMasterList,function(n){n.update&&n.update(e,t)})},e.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},e.register=function(e,t){e===`matrix`||e===`calendar`?IV[e]=t:LV[e]=t},e.get=function(e){return LV[e]||IV[e]},e}(),zV=W(),BV=function(e,t){var n=t.getReferringComponents(e,PR).models[0];return n&&n.coordinateSystem},VV=function(){function e(e){this.coordSysDims=[],this.axisMap=W(),this.categoryAxisMap=W(),this.coordSysName=e}return e}(),HV={cartesian2d:function(e,t,n,r){var i=e.getReferringComponents(`xAxis`,PR).models[0],a=e.getReferringComponents(`yAxis`,PR).models[0];t.coordSysDims=[`x`,`y`],n.set(`x`,i),n.set(`y`,a),sm(i)&&(r.set(`x`,i),t.firstCategoryDimIndex=0),sm(a)&&(r.set(`y`,a),t.firstCategoryDimIndex??=1)},singleAxis:function(e,t,n,r){var i=e.getReferringComponents(`singleAxis`,PR).models[0];t.coordSysDims=[`single`],n.set(`single`,i),sm(i)&&(r.set(`single`,i),t.firstCategoryDimIndex=0)},polar:function(e,t,n,r){var i=e.getReferringComponents(`polar`,PR).models[0],a=i.findAxisModel(`radiusAxis`),o=i.findAxisModel(`angleAxis`);t.coordSysDims=[`radius`,`angle`],n.set(`radius`,a),n.set(`angle`,o),sm(a)&&(r.set(`radius`,a),t.firstCategoryDimIndex=0),sm(o)&&(r.set(`angle`,o),t.firstCategoryDimIndex??=1)},geo:function(e,t,n,r){t.coordSysDims=[`lng`,`lat`]},parallel:function(e,t,n,r){var i=e.ecModel,a=i.getComponent(`parallel`,e.get(`parallelIndex`)),o=t.coordSysDims=a.dimensions.slice();L(a.parallelAxisIndex,function(e,a){var s=i.getComponent(`parallelAxis`,e),c=o[a];n.set(c,s),sm(s)&&(r.set(c,s),t.firstCategoryDimIndex??=a)})},matrix:function(e,t,n,r){var i=e.getReferringComponents(`matrix`,PR).models[0];t.coordSysDims=[`x`,`y`];var a=i.getDimensionModel(`x`),o=i.getDimensionModel(`y`);n.set(`x`,a),n.set(`y`,o),r.set(`x`,a),r.set(`y`,o)}},UV=Math.round(Math.random()*10),WV=Math.log(2),GV=`___zrEVENTSAVED`,KV=[],qV=/([&<>"'])/g,JV={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},YV={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`,custom:`Custom chart`,chart:`Chart`}},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:`. `}}}},XV={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:`旭日图`,custom:`自定义图表`,chart:`图表`}},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:``}}}},ZV=`ZH`,QV=`EN`,$V=QV,eH={},tH={},nH=dF.domSupported?function(){return(document.documentElement.lang||navigator.language||navigator.browserLanguage||$V).toUpperCase().indexOf(ZV)>-1?ZV:$V}():$V,Am(QV,YV),Am(ZV,XV),rH=null,iH=1e3,aH=iH*60,oH=aH*60,sH=oH*24,cH=sH*365,lH={year:/({yyyy}|{yy})/,month:/({MMMM}|{MMM}|{MM}|{M})/,day:/({dd}|{d})/,hour:/({HH}|{H}|{hh}|{h})/,minute:/({mm}|{m})/,second:/({ss}|{s})/,millisecond:/({SSS}|{S})/},uH={year:`{yyyy}`,month:`{MMM}`,day:`{d}`,hour:`{HH}:{mm}`,minute:`{HH}:{mm}`,second:`{HH}:{mm}:{ss}`,millisecond:`{HH}:{mm}:{ss} {SSS}`},dH=`{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}`,fH=`{yyyy}-{MM}-{dd}`,pH={year:`{yyyy}`,month:`{yyyy}-{MM}`,day:fH,hour:fH+` `+uH.hour,minute:fH+` `+uH.minute,second:fH+` `+uH.second,millisecond:dH},mH=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`],hH=[`year`,`half-year`,`quarter`,`month`,`week`,`half-week`,`day`,`half-day`,`quarter-day`,`hour`,`minute`,`second`,`millisecond`],gH=eo,_H=[`a`,`b`,`c`,`d`,`e`,`f`,`g`],vH=function(e,t){return`{`+e+(t??``)+`}`},yH=L,bH=[`left`,`right`,`top`,`bottom`,`width`,`height`],xH=[[`width`,`left`,`right`],[`height`,`top`,`bottom`]],SH=_h,Ha(_h,`vertical`),Ha(_h,`horizontal`),CH={rect:1,point:2},wH=Du(),TH=function(e){F(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.uid=_m(`ec_cpt_model`),i}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=Th(this),r=n?Dh(e):{};Aa(e,t.getTheme().get(this.mainType)),Aa(e,this.getDefaultOption()),n&&Eh(e,r,n)},t.prototype.mergeOption=function(e,t){Aa(this.option,e,!0);var n=Th(this);n&&Eh(this.option,e,n)},t.prototype.optionUpdated=function(e,t){},t.prototype.getDefaultOption=function(){var e=this.constructor;if(!po(e))return e.defaultOption;var t=wH(this);if(!t.defaultOption){for(var n=[],r=e;r;){var i=r.prototype.defaultOption;i&&n.push(i),r=r.superClass}for(var a={},o=n.length-1;o>=0;o--)a=Aa(a,n[o],!0);t.defaultOption=a}return t.defaultOption},t.prototype.getReferringComponents=function(e,t){var n=e+`Index`,r=e+`Id`;return Au(this.ecModel,e,{index:this.get(n,!0),id:this.get(r,!0)},t)},t.prototype.getBoxLayoutParams=function(){return vh(this,!1)},t.prototype.getZLevelKey=function(){return``},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type=`component`,e.id=``,e.name=``,e.mainType=``,e.subType=``,e.componentIndex=0}(),t}(HB),go(TH,HB),bo(TH),vm(TH),ym(TH,kh),EH=Du(),DH=Du(),OH=function(){function e(){}return e.prototype.getColorFromPalette=function(e,t,n){var r=cu(this.get(`color`,!0)),i=this.get(`colorLayer`,!0);return Mh(this,EH,r,i,e,t,n)},e.prototype.clearColorPalette=function(){Nh(this,EH)},e}(),kH=/\{@(.+?)\}/g,AH=function(){function e(){}return e.prototype.getDataParams=function(e,t){var n=this.getData(t),r=this.getRawValue(e,t),i=n.getRawIndex(e),a=n.getName(e),o=n.getRawDataItem(e),s=n.getItemVisual(e,`style`),c=s&&s[n.getItemVisual(e,`drawType`)||`fill`],l=s&&s.stroke,u=this.mainType,d=u===`series`,f=n.userOutput&&n.userOutput.get();return{componentType:u,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:d?this.subType:null,seriesIndex:this.seriesIndex,seriesId:d?this.id:null,seriesName:d?this.name:null,name:a,dataIndex:i,data:o,dataType:t,value:r,color:c,borderColor:l,dimensionNames:f?f.fullDimensions:null,encode:f?f.encode:null,$vars:[`seriesName`,`name`,`value`]}},e.prototype.getFormattedLabel=function(e,t,n,r,i,a){t||=`normal`;var o=this.getData(n),s=this.getDataParams(e,n);if(a&&(s.value=a.interpolatedValue),r!=null&&z(s.value)&&(s.value=s.value[r]),i||=o.getItemModel(e).get(t===`normal`?[`label`,`formatter`]:[t,`label`,`formatter`]),B(i))return s.status=t,s.dimensionIndex=r,i(s);if(V(i))return fh(i,s).replace(kH,function(t,n){var r=n.length,i=n;i.charAt(0)===`[`&&i.charAt(r-1)===`]`&&(i=+i.slice(1,r-1));var s=Lp(o,e,i);if(a&&z(a.interpolatedValue)){var c=o.getDimensionIndex(i);c>=0&&(s=a.interpolatedValue[c])}return s==null?``:s+``})},e.prototype.getRawValue=function(e,t){return Lp(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}(),jH=function(){function e(e){e||={},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return e.prototype.perform=function(e){var t=this._upstream,n=e&&e.skip;if(this._dirty&&t){var r=this.context;r.data=r.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var i;this._plan&&!n&&(i=this._plan(this.context));var a=l(this._modBy),o=this._modDataCount||0,s=l(e&&e.modBy),c=e&&e.modDataCount||0;(a!==s||o!==c)&&(i=`reset`);function l(e){return!(e>=1)&&(e=1),e}var u;(this._dirty||i===`reset`)&&(this._dirty=!1,u=this._doReset(n)),this._modBy=s,this._modDataCount=c;var d=e&&e.step;if(this._dueEnd=t?t._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var f=this._dueIndex,p=Math.min(d==null?1/0:this._dueIndex+d,this._dueEnd);if(!n&&(u||f<p)){var m=this._progress;if(z(m))for(var h=0;h<m.length;h++)this._doProgress(m[h],f,p,s,c);else this._doProgress(m,f,p,s,c)}this._dueIndex=p;var g=this._settedOutputEnd==null?p:this._settedOutputEnd;this._outputDueEnd=g}else this._dueIndex=this._outputDueEnd=this._settedOutputEnd==null?this._dueEnd:this._settedOutputEnd;return this.unfinished()},e.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},e.prototype._doProgress=function(e,t,n,r,i){MH.reset(t,n,r,i),this._callingProgress=e,this._callingProgress({start:t,end:n,count:n-t,next:MH.next},this.context)},e.prototype._doReset=function(e){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null;var t,n;!e&&this._reset&&(t=this._reset(this.context),t&&t.progress&&(n=t.forceFirstProgress,t=t.progress),z(t)&&!t.length&&(t=null)),this._progress=t,this._modBy=this._modDataCount=null;var r=this._downstream;return r&&r.dirty(),n},e.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},e.prototype.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},e.prototype.dispose=function(){this._disposed||=(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,!0)},e.prototype.getUpstream=function(){return this._upstream},e.prototype.getDownstream=function(){return this._downstream},e.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},e}(),MH=function(){var e,t,n,r,i,a={reset:function(c,l,u,d){t=c,e=l,n=u,r=d,i=Math.ceil(r/n),a.next=n>1&&r>0?s:o}};return a;function o(){return t<e?t++:null}function s(){var a=t%i*n+Math.ceil(t/i),o=t>=e?null:a<r?a:t;return t++,o}}(),NH=function(){function e(){}return e.prototype.getRawData=function(){throw Error(`not supported`)},e.prototype.getRawDataItem=function(e){throw Error(`not supported`)},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(e){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(e,t){},e.prototype.retrieveValueFromItem=function(e,t){},e.prototype.convertValue=function(e,t){return Hp(e,t)},e}(),PH=W(),FH=function(){function e(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+`_`+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),n=!!t.length,r,i;if(Gh(e)){var a=e,o=void 0,s=void 0,c=void 0;if(n){var l=t[0];l.prepareSource(),c=l.getSource(),o=c.data,s=c.sourceFormat,i=[l._getVersionSign()]}else o=a.get(`data`,!0),s=Ka(o)?GR:VR,i=[];var u=this._getSourceMetaRawOption()||{},d=c&&c.metaRawOption||{},f=U(u.seriesLayoutBy,d.seriesLayoutBy)||null,p=U(u.sourceHeader,d.sourceHeader),m=U(u.dimensions,d.dimensions);r=f!==d.seriesLayoutBy||!!p!=!!d.sourceHeader||m?[wp(o,{seriesLayoutBy:f,sourceHeader:p,dimensions:m},s)]:[]}else{var h=e;if(n){var g=this._applyTransform(t);r=g.sourceList,i=g.upstreamSignList}else r=[wp(h.get(`source`,!0),this._getSourceMetaRawOption(),null)],i=[]}this._setLocalSource(r,i)},e.prototype._applyTransform=function(e){var t=this._sourceHost,n=t.get(`transform`,!0),r=t.get(`fromTransformResult`,!0);r!=null&&e.length!==1&&Kh(``);var i,a=[],o=[];return L(e,function(e){e.prepareSource();var t=e.getSource(r||0);r!=null&&!t&&Kh(``),a.push(t),o.push(e._getVersionSign())}),n?i=Hh(n,a,{datasetIndex:t.componentIndex}):r!=null&&(i=[Ep(a[0])]),{sourceList:i,upstreamSignList:o}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t<e.length;t++){var n=e[t];if(n._isDirty()||this._upstreamSignList[t]!==n._getVersionSign())return!0}},e.prototype.getSource=function(e){e||=0;var t=this._sourceList[e];if(!t){var n=this._getUpstreamSourceManagers();return n[0]&&n[0].getSource(e)}return t},e.prototype.getSharedDataStore=function(e){var t=e.makeStoreSchema();return this._innerGetDataStore(t.dimensions,e.source,t.hash)},e.prototype._innerGetDataStore=function(e,t,n){var r=0,i=this._storeList,a=i[r];a||=i[r]={};var o=a[n];if(!o){var s=this._getUpstreamSourceManagers()[0];Gh(this._sourceHost)&&s?o=s._innerGetDataStore(e,t,n):(o=new _V,o.initData(new $B(t,e.length),e)),a[n]=o}return o},e.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(Gh(e)){var t=yp(e);return t?[t.getSourceManager()]:[]}return R(bp(e),function(e){return e.getSourceManager()})},e.prototype._getSourceMetaRawOption=function(){var e=this._sourceHost,t,n,r;if(Gh(e))t=e.get(`seriesLayoutBy`,!0),n=e.get(`sourceHeader`,!0),r=e.get(`dimensions`,!0);else if(!this._getUpstreamSourceManagers().length){var i=e;t=i.get(`seriesLayoutBy`,!0),n=i.get(`sourceHeader`,!0),r=i.get(`dimensions`,!0)}return{seriesLayoutBy:t,sourceHeader:n,dimensions:r}},e}(),X={color:{},darkColor:{},size:{}},IH=X.color={theme:[`#5070dd`,`#b6d634`,`#505372`,`#ff994d`,`#0ca8df`,`#ffd10a`,`#fb628b`,`#785db0`,`#3fbe95`],neutral00:`#fff`,neutral05:`#f4f7fd`,neutral10:`#e8ebf0`,neutral15:`#dbdee4`,neutral20:`#cfd2d7`,neutral25:`#c3c5cb`,neutral30:`#b7b9be`,neutral35:`#aaacb2`,neutral40:`#9ea0a5`,neutral45:`#929399`,neutral50:`#86878c`,neutral55:`#797b7f`,neutral60:`#6d6e73`,neutral65:`#616266`,neutral70:`#54555a`,neutral75:`#48494d`,neutral80:`#3c3c41`,neutral85:`#303034`,neutral90:`#232328`,neutral95:`#17171b`,neutral99:`#000`,accent05:`#eff1f9`,accent10:`#e0e4f2`,accent15:`#d0d6ec`,accent20:`#c0c9e6`,accent25:`#b1bbdf`,accent30:`#a1aed9`,accent35:`#91a0d3`,accent40:`#8292cc`,accent45:`#7285c6`,accent50:`#6578ba`,accent55:`#5c6da9`,accent60:`#536298`,accent65:`#4a5787`,accent70:`#404c76`,accent75:`#374165`,accent80:`#2e3654`,accent85:`#252b43`,accent90:`#1b2032`,accent95:`#121521`,transparent:`rgba(0,0,0,0)`,highlight:`rgba(255,231,130,0.8)`},I(IH,{primary:IH.neutral80,secondary:IH.neutral70,tertiary:IH.neutral60,quaternary:IH.neutral50,disabled:IH.neutral20,border:IH.neutral30,borderTint:IH.neutral20,borderShade:IH.neutral40,background:IH.neutral05,backgroundTint:`rgba(234,237,245,0.5)`,backgroundTransparent:`rgba(255,255,255,0)`,backgroundShade:IH.neutral10,shadow:`rgba(0,0,0,0.2)`,shadowTint:`rgba(129,130,136,0.2)`,axisLine:IH.neutral70,axisLineTint:IH.neutral40,axisTick:IH.neutral70,axisTickMinor:IH.neutral60,axisLabel:IH.neutral70,axisSplitLine:IH.neutral15,axisMinorSplitLine:IH.neutral05}),IH)IH.hasOwnProperty(e)&&(LH=IH[e],e===`theme`?X.darkColor.theme=IH.theme.slice():e===`highlight`?X.darkColor.highlight=`rgba(255,231,130,0.4)`:e.indexOf(`accent`)===0?X.darkColor[e]=oc(LH,null,function(e){return e*.5},function(e){return Math.min(1,1.3-e)}):X.darkColor[e]=oc(LH,null,function(e){return e*.9},function(e){return 1-e**1.5}));if(X.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50},RH=`line-height:1`,zH=[0,10,20,30],BH=[``,`
31
+ `:``,i=` {`+r,a=r+`}`,o=R(Ba(e),function(t){return t+i+R(Ba(e[t]),function(n){return n+`:`+e[t][n]+`;`}).join(r)+a}).join(r),s=R(Ba(t),function(e){return`@keyframes `+e+i+R(Ba(t[e]),function(n){return n+i+R(Ba(t[e][n]),function(r){var i=t[e][n][r];return r===`d`&&(i=`path("`+i+`")`),r+`:`+i+`;`}).join(r)+a}).join(r)+a}).join(r);return!o&&!s?``:[`<![CDATA[`,o,s,`]]>`].join(r)}function mj(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function hj(e,t,n,r){return lj(`svg`,`root`,{width:e,height:t,xmlns:XQ,"xmlns:xlink":ZQ,version:`1.1`,baseProfile:`full`,viewBox:r?`0 0 `+e+` `+t:!1},n)}function gj(){return t$++}function _j(e,t,n){var r=I({},e.shape);I(r,t),e.buildPath(n,r);var i=new GQ;return i.reset(Ec(e)),n.rebuildPath(i,1),i.generateStr(),i.getStr()}function vj(e,t){var n=t.originX,r=t.originY;(n||r)&&(e[r$]=n+`px `+r+`px`)}function yj(e,t){var n=t.zrId+`-ani-`+t.cssAnimIdx++;return t.cssAnims[n]=e,n}function bj(e,t,n){var r=e.shape.paths,i={},a,o;if(L(r,function(e){var t=mj(n.zrId);t.animation=!0,Sj(e,{},t,!0);var r=t.cssAnims,s=t.cssNodes,c=Ba(r),l=c.length;if(l){o=c[l-1];var u=r[o];for(var d in u){var f=u[d];i[d]=i[d]||{d:``},i[d].d+=f.d||``}for(var p in s){var m=s[p].animation;m.indexOf(o)>=0&&(a=m)}}}),a){t.d=!1;var s=yj(i,n);return a.replace(o,s)}}function xj(e){return V(e)?n$[e]?`cubic-bezier(`+n$[e]+`)`:Us(e)?e:``:``}function Sj(e,t,n,r){var i=e.animators,a=i.length,o=[];if(e instanceof eB){var s=bj(e,t,n);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var c={},l=0;l<a;l++){var u=i[l],d=[u.getMaxTime()/1e3+`s`],f=xj(u.getClip().easing),p=u.getDelay();f?d.push(f):d.push(`linear`),p&&d.push(p/1e3+`s`),u.getLoop()&&d.push(`infinite`);var m=d.join(` `);c[m]=c[m]||[m,[]],c[m][1].push(u)}function h(i){var a=i[1],o=a.length,s={},c={},l={},u=`animation-timing-function`;function d(e,t,n){for(var r=e.getTracks(),i=e.getMaxTime(),a=0;a<r.length;a++){var o=r[a];if(o.needsAnimate()){var s=o.keyframes,c=o.propName;if(n&&(c=n(c)),c)for(var l=0;l<s.length;l++){var d=s[l],f=Math.round(d.time/i*100)+`%`,p=xj(d.easing),m=d.rawValue;(V(m)||Wa(m))&&(t[f]=t[f]||{},t[f][c]=d.rawValue,p&&(t[f][u]=p))}}}}for(var f=0;f<o;f++){var p=a[f],m=p.targetName;m?m===`shape`&&d(p,c):!r&&d(p,s)}for(var h in s){var g={};Es(g,e),I(g,s[h]);var _=Dc(g),v=s[h][u];l[h]=_?{transform:_}:{},vj(l[h],g),v&&(l[h][u]=v)}var y,b=!0;for(var h in c){l[h]=l[h]||{};var x=!y,v=c[h][u];x&&(y=new LL);var S=y.len();y.reset(),l[h].d=_j(e,c[h],y);var C=y.len();if(!x&&S!==C){b=!1;break}v&&(l[h][u]=v)}if(!b)for(var h in l)delete l[h].d;if(!r)for(var f=0;f<o;f++){var p=a[f],m=p.targetName;m===`style`&&d(p,l,function(e){return i$[e]})}for(var w=Ba(l),T=!0,E,f=1;f<w.length;f++){var D=w[f-1],O=w[f];if(l[D][r$]!==l[O][r$]){T=!1;break}E=l[D][r$]}if(T&&E){for(var h in l)l[h][r$]&&delete l[h][r$];t[r$]=E}if(Ra(w,function(e){return Ba(l[e]).length>0}).length)return yj(l,n)+` `+i[0]+` both`}for(var g in c){var s=h(c[g]);s&&o.push(s)}if(o.length){var _=n.zrId+`-cls-`+gj();n.cssNodes[`.`+_]={animation:o.join(`,`)},t.class=_}}function Cj(e,t,n){if(!e.ignore){if(e.isSilent()){var r={"pointer-events":`none`};wj(r,t,n,!0)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,c=e.currentStates.indexOf(`select`)>=0&&s||o;c&&(a=uc(c))}var l=i.lineWidth;if(l){var u=!i.strokeNoScale&&e.transform?e.transform[0]:1;l/=u}var r={cursor:`pointer`};a&&(r.fill=a),i.stroke&&(r.stroke=i.stroke),l&&(r[`stroke-width`]=l),wj(r,t,n,!0)}}}function wj(e,t,n,r){var i=JSON.stringify(e),a=n.cssStyleCache[i];a||(a=n.zrId+`-cls-`+gj(),n.cssStyleCache[i]=a,n.cssNodes[`.`+a+(r?`:hover`:``)]=e),t.class=t.class?t.class+` `+a:a}function Tj(e){return e&&V(e.src)}function Ej(e){return e&&B(e.toDataURL)}function Dj(e,t,n,r){sj(function(i,a){var o=i===`fill`||i===`stroke`;o&&wc(a)?Vj(t,e,i,r):o&&xc(a)?Hj(n,e,i,r):e[i]=a,o&&r.ssr&&a===`none`&&(e[`pointer-events`]=`visible`)},t,n,!1),Bj(n,e,r)}function Oj(e,t){var n=Xx(t);n&&(n.each(function(t,n){t!=null&&(e[(`ecmeta_`+n).toLowerCase()]=t+``)}),t.isSilent()&&(e[e$+`silent`]=`true`))}function kj(e){return fc(e[0]-1)&&fc(e[1])&&fc(e[2])&&fc(e[3]-1)}function Aj(e){return fc(e[4])&&fc(e[5])}function jj(e,t,n){if(t&&!(Aj(t)&&kj(t))){var r=n?10:1e4;e.transform=kj(t)?`translate(`+a$(t[4]*r)/r+` `+a$(t[5]*r)/r+`)`:hc(t)}}function Mj(e,t,n){for(var r=e.points,i=[],a=0;a<r.length;a++)i.push(a$(r[a][0]*n)/n),i.push(a$(r[a][1]*n)/n);t.points=i.join(` `)}function Nj(e){return!e.smooth}function Pj(e){var t=R(e,function(e){return typeof e==`string`?[e,e]:e});return function(e,n,r){for(var i=0;i<t.length;i++){var a=t[i],o=e[a[0]];o!=null&&(n[a[1]]=a$(o*r)/r)}}}function Fj(e){for(var t=e.animators,n=0;n<t.length;n++)if(t[n].targetName===`shape`)return!0;return!1}function Ij(e,t){var n=e.style,r=e.shape,i=o$[e.type],a={},o=t.animation,s=`path`,c=e.style.strokePercent,l=t.compress&&Ec(e)||4;if(i&&!t.willUpdate&&(!i[1]||i[1](r))&&!(o&&Fj(e))&&!(c<1)){s=e.type;var u=10**l;i[0](r,a,u)}else{var d=!e.path||e.shapeChanged();e.path||e.createPathProxy();var f=e.path;d&&(f.beginPath(),e.buildPath(f,e.shape),e.pathUpdated());var p=f.getVersion(),m=e,h=m.__svgPathBuilder;m.__svgPathVersion===p&&h&&c===m.__svgPathStrokePercent||(h||=m.__svgPathBuilder=new GQ,h.reset(l),f.rebuildPath(h,c),h.generateStr(),m.__svgPathVersion=p,m.__svgPathStrokePercent=c),a.d=h.getStr()}return jj(a,e.transform),Dj(a,n,e,t),Oj(a,e),t.animation&&Sj(e,a,t),t.emphasis&&Cj(e,a,t),lj(s,e.id+``,a)}function Lj(e,t){var n=e.style,r=n.image;if(r&&!V(r)&&(Tj(r)?r=r.src:Ej(r)&&(r=r.toDataURL())),r){var i=n.x||0,a=n.y||0,o=n.width,s=n.height,c={href:r,width:o,height:s};return i&&(c.x=i),a&&(c.y=a),jj(c,e.transform),Dj(c,n,e,t),Oj(c,e),t.animation&&Sj(e,c,t),lj(`image`,e.id+``,c)}}function Rj(e,t){var n=e.style,r=n.text;if(r!=null&&(r+=``),!(!r||isNaN(n.x)||isNaN(n.y))){var i=n.font||`12px sans-serif`,a=n.x||0,o=gc(n.y||0,os(i),n.textBaseline),s={"dominant-baseline":`central`,"text-anchor":AI[n.textAlign]||n.textAlign};if(wl(n)){var c=``,l=n.fontStyle,u=Sl(n.fontSize);if(!parseFloat(u))return;var d=n.fontFamily||`sans-serif`,f=n.fontWeight;c+=`font-size:`+u+`;font-family:`+d+`;`,l&&l!==`normal`&&(c+=`font-style:`+l+`;`),f&&f!==`normal`&&(c+=`font-weight:`+f+`;`),s.style=c}else s.style=`font: `+i;return r.match(/\s/)&&(s[`xml:space`]=`preserve`),a&&(s.x=a),o&&(s.y=o),jj(s,e.transform),Dj(s,n,e,t),Oj(s,e),t.animation&&Sj(e,s,t),lj(`text`,e.id+``,s,void 0,r)}}function zj(e,t){if(e instanceof JL)return Ij(e,t);if(e instanceof $L)return Lj(e,t);if(e instanceof XL)return Rj(e,t)}function Bj(e,t,n){var r=e.style;if(_c(r)){var i=vc(e),a=n.shadowCache,o=a[i];if(!o){var s=e.getGlobalScale(),c=s[0],l=s[1];if(!c||!l)return;var u=r.shadowOffsetX||0,d=r.shadowOffsetY||0,f=r.shadowBlur,p=dc(r.shadowColor),m=p.opacity,h=p.color,g=f/2/c,_=f/2/l,v=g+` `+_;o=n.zrId+`-s`+n.shadowIdx++,n.defs[o]=lj(`filter`,o,{id:o,x:`-100%`,y:`-100%`,width:`300%`,height:`300%`},[lj(`feDropShadow`,``,{dx:u/c,dy:d/l,stdDeviation:v,"flood-color":h,"flood-opacity":m})]),a[i]=o}t.filter=Tc(o)}}function Vj(e,t,n,r){var i=e[n],a,o={gradientUnits:i.global?`userSpaceOnUse`:`objectBoundingBox`};if(Sc(i))a=`linearGradient`,o.x1=i.x,o.y1=i.y,o.x2=i.x2,o.y2=i.y2;else if(Cc(i))a=`radialGradient`,o.cx=U(i.x,.5),o.cy=U(i.y,.5),o.r=U(i.r,.5);else return;for(var s=i.colorStops,c=[],l=0,u=s.length;l<u;++l){var d=mc(s[l].offset)*100+`%`,f=s[l].color,p=dc(f),m=p.color,h=p.opacity,g={offset:d};g[`stop-color`]=m,h<1&&(g[`stop-opacity`]=h),c.push(lj(`stop`,l+``,g))}var _=fj(lj(a,``,o,c)),v=r.gradientCache,y=v[_];y||(y=r.zrId+`-g`+r.gradientIdx++,v[_]=y,o.id=y,r.defs[y]=lj(a,y,o,c)),t[n]=Tc(y)}function Hj(e,t,n,r){var i=e.style[n],a=e.getBoundingRect(),o={},s=i.repeat,c=s===`no-repeat`,l=s===`repeat-x`,u=s===`repeat-y`,d;if(yc(i)){var f=i.imageWidth,p=i.imageHeight,m=void 0,h=i.image;if(V(h)?m=h:Tj(h)?m=h.src:Ej(h)&&(m=h.toDataURL()),typeof Image>`u`){var g=`Image width/height must been given explictly in svg-ssr renderer.`;to(f,g),to(p,g)}else if(f==null||p==null){var _=function(e,t){if(e){var n=e.elm,r=f||t.width,i=p||t.height;e.tag===`pattern`&&(l?(i=1,r/=a.width):u&&(r=1,i/=a.height)),e.attrs.width=r,e.attrs.height=i,n&&(n.setAttribute(`width`,r),n.setAttribute(`height`,i))}},v=Co(m,null,e,function(e){c||_(S,e),_(d,e)});v&&v.width&&v.height&&(f||=v.width,p||=v.height)}d=lj(`image`,`img`,{href:m,width:f,height:p}),o.width=f,o.height=p}else i.svgElement&&(d=ka(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(d){var y,b;c?y=b=1:l?(b=1,y=o.width/a.width):u?(y=1,b=o.height/a.height):o.patternUnits=`userSpaceOnUse`,y!=null&&!isNaN(y)&&(o.width=y),b!=null&&!isNaN(b)&&(o.height=b);var x=Dc(i);x&&(o.patternTransform=x);var S=lj(`pattern`,``,o,[d]),C=fj(S),w=r.patternCache,T=w[C];T||(T=r.zrId+`-p`+r.patternIdx++,w[C]=T,o.id=T,S=r.defs[T]=lj(`pattern`,T,o,[d])),t[n]=Tc(T)}}function Uj(e,t,n){var r=n.clipPathCache,i=n.defs,a=r[e.id];if(!a){a=n.zrId+`-c`+n.clipPathIdx++;var o={id:a};r[e.id]=a,i[a]=lj(`clipPath`,a,o,[Ij(e,n)])}t[`clip-path`]=Tc(a)}function Wj(e){return document.createTextNode(e)}function Gj(e,t,n){e.insertBefore(t,n)}function Kj(e,t){e.removeChild(t)}function qj(e,t){e.appendChild(t)}function Jj(e){return e.parentNode}function Yj(e){return e.nextSibling}function Xj(e,t){e.textContent=t}function Zj(e){return e===void 0}function Qj(e){return e!==void 0}function pee(e,t,n){for(var r={},i=t;i<=n;++i){var a=e[i].key;a!==void 0&&(r[a]=i)}return r}function $j(e,t){var n=e.key===t.key;return e.tag===t.tag&&n}function eM(e){var t,n=e.children,r=e.tag;if(Qj(r)){var i=e.elm=cj(r);if(rM(l$,e),z(n))for(t=0;t<n.length;++t){var a=n[t];a!=null&&qj(i,eM(a))}else Qj(e.text)&&!H(e.text)&&qj(i,Wj(e.text))}else e.elm=Wj(e.text);return e.elm}function tM(e,t,n,r,i){for(;r<=i;++r){var a=n[r];a!=null&&Gj(e,eM(a),t)}}function nM(e,t,n,r){for(;n<=r;++n){var i=t[n];i!=null&&(Qj(i.tag)?Kj(Jj(i.elm),i.elm):Kj(e,i.elm))}}function rM(e,t){var n,r=t.elm,i=e&&e.attrs||{},a=t.attrs||{};if(i!==a){for(n in a){var o=a[n];i[n]!==o&&(o===!0?r.setAttribute(n,``):o===!1?r.removeAttribute(n):n===`style`?r.style.cssText=o:n.charCodeAt(0)===c$?n===`xmlns:xlink`||n===`xmlns`?r.setAttributeNS(QQ,n,o):n.charCodeAt(3)===s$?r.setAttributeNS($Q,n,o):n.charCodeAt(5)===s$?r.setAttributeNS(ZQ,n,o):r.setAttribute(n,o):r.setAttribute(n,o))}for(n in i)n in a||r.removeAttribute(n)}}function mee(e,t,n){for(var r=0,i=0,a=t.length-1,o=t[0],s=t[a],c=n.length-1,l=n[0],u=n[c],d,f,p,m;r<=a&&i<=c;)o==null?o=t[++r]:s==null?s=t[--a]:l==null?l=n[++i]:u==null?u=n[--c]:$j(o,l)?(iM(o,l),o=t[++r],l=n[++i]):$j(s,u)?(iM(s,u),s=t[--a],u=n[--c]):$j(o,u)?(iM(o,u),Gj(e,o.elm,Yj(s.elm)),o=t[++r],u=n[--c]):$j(s,l)?(iM(s,l),Gj(e,s.elm,o.elm),s=t[--a],l=n[++i]):(Zj(d)&&(d=pee(t,r,a)),f=d[l.key],Zj(f)?Gj(e,eM(l),o.elm):(p=t[f],p.tag===l.tag?(iM(p,l),t[f]=void 0,Gj(e,p.elm,o.elm)):Gj(e,eM(l),o.elm)),l=n[++i]);(r<=a||i<=c)&&(r>a?(m=n[c+1]==null?null:n[c+1].elm,tM(e,m,n,i,c)):nM(e,t,r,a))}function iM(e,t){var n=t.elm=e.elm,r=e.children,i=t.children;e!==t&&(rM(e,t),Zj(t.text)?Qj(r)&&Qj(i)?r!==i&&mee(n,r,i):Qj(i)?(Qj(e.text)&&Xj(n,``),tM(n,null,i,0,i.length-1)):Qj(r)?nM(n,r,0,r.length-1):Qj(e.text)&&Xj(n,``):e.text!==t.text&&(Qj(r)&&nM(n,r,0,r.length-1),Xj(n,t.text)))}function hee(e,t){if($j(e,t))iM(e,t);else{var n=e.elm,r=Jj(n);eM(t),r!==null&&(Gj(r,t.elm,Yj(n)),nM(r,[e],0,0))}return t}function gee(e){return function(){}}function _ee(e,t,n,r){var i;if(n&&n!==`none`){if(i=lj(`rect`,`bg`,{width:e,height:t,x:`0`,y:`0`}),wc(n))Vj({fill:n},i.attrs,`fill`,r);else if(xc(n))Hj({style:{fill:n},dirty:co,getBoundingRect:function(){return{width:e,height:t}}},i.attrs,`fill`,r);else{var a=dc(n),o=a.color,s=a.opacity;i.attrs.fill=o,s<1&&(i.attrs[`fill-opacity`]=s)}}return i}function vee(e){e.registerPainter(`svg`,d$)}function aM(e,t,n){var r=GP.createCanvas(),i=t.getWidth(),a=t.getHeight(),o=r.style;return o&&(o.position=`absolute`,o.left=`0`,o.top=`0`,o.width=i+`px`,o.height=a+`px`,r.setAttribute(`data-zr-dom-id`,e)),r.width=i*n,r.height=a*n,r}function oM(e){return!e.__cursors.get(0)}function sM(e){var t=e.__cursors.get(0);return{startIdx:t?t.startIdx:0,endIdx:t?t.endIdx:0}}function cM(e){return e?e.__builtin__?!0:typeof e.resize==`function`&&typeof e.refresh==`function`:!1}function lM(e,t){var n=document.createElement(`div`);return n.style.cssText=[`position:relative`,`width:`+e+`px`,`height:`+t+`px`,`padding:0`,`margin:0`,`border-width:0`].join(`;`)+`;`,n}function uM(e,t,n,r){var i=new f$(e,t,t.dpr);return i.zlevel=n,i.zlevel2=r,i.__builtin__=!0,dM(i),i}function dM(e){e.__cursorStack=[],e.__cursors=W()}function fM(e){return e.startIdx=e.drawIdx=e.endIdx=e.endIdxNew=0,e.used=!1,e.first=e.last=NaN,e.notClearIdx=-1,e}function pM(e,t){var n=e.__cursors,r=+t;return n.get(r)||(e.__cursorStack.push(r),n.set(r,fM({key:r})))}function mM(e,t){for(var n=e.__cursorStack,r=0;r<n.length;r++)t(e.__cursors.get(n[r]))}function hM(e,t){var n=e.layers;return n[t]||(n[t]=[,,,])}function gM(e,t,n){for(var r=e.layerStack,i=0;i<r.length;i++){var a=r[i].zl,o=r[i].zl2,s=e.layers[a][o];n&&(n&v$&&!s.__builtin__||n&y$&&s.__builtin__||n&b$&&s===e.hoverlayer)||t(s,a,o,i)}}function _M(e){e.registerPainter(`canvas`,S$)}function vM(e,...t){console.warn(e,...t)}function yM(e,...t){console.error(e,...t)}function bM(e,t){if(e==null)throw Error(t);return e}function xM(e,t){let n=O$.get(e);if(n===void 0)return t;let r=A$.get(e);if(r!==void 0&&r.version===k$&&r.english===t&&EM(r.merged,t))return r.merged;let i=TM(e,n,t);return A$.set(e,{version:k$,english:t,merged:i}),i}function SM(){return E$}function CM(e,t){return e.replace(D$,(e,n)=>Object.hasOwn(t,n)?String(t[n]):e)}function wM(e,t,n,r){let i=`${t}Other`;if(!Object.hasOwn(e,i))throw RangeError(`Plural text ${t} has no ${i} key; every plural needs its Other form.`);let a=new Intl.PluralRules(SM()).select(n),o=`${t}${a.charAt(0).toUpperCase()}${a.slice(1)}`,s=e[Object.hasOwn(e,o)?o:i];if(s===void 0)throw RangeError(`Plural text ${t} has no ${o} key.`);return CM(s,{count:n,...r})}function TM(e,t,n){let r={};for(let[i,a]of Object.entries(t)){let t=Object.hasOwn(n,i)?n[i]:void 0;if(t===void 0)throw RangeError(`Text ${e}.${i} is not a key of the English text. Allowed keys: ${Object.keys(n).join(`, `)}.`);let o=DM(t);for(let t of DM(a))if(!o.includes(t))throw RangeError(`Text ${e}.${i} uses {${t}}, which the English text does not have. Allowed placeholders: ${o.length===0?`none`:o.map(e=>`{${e}}`).join(`, `)}.`);r[i]=a}return Object.assign({},n,r)}function EM(e,t){let n=Object.keys(t);return Object.keys(e).length===n.length&&n.every(t=>Object.hasOwn(e,t))}function DM(e){return Array.from(e.matchAll(D$),e=>e[1]??``)}function OM(e){let t=P$.get(e);return t||(t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),P$.set(e,t)),t}function kM(e){if(typeof e!=`string`||e===``)return!1;try{return OM(e),!0}catch{return!1}}function AM(e,t=M$){if(t===`Asia/Kolkata`){let t=new Date(e+N$);return{year:t.getUTCFullYear(),month:t.getUTCMonth(),day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds()}}let n=Object.fromEntries(OM(t).formatToParts(e).map(e=>[e.type,Number(e.value)]));return{year:Number(n.year),month:Number(n.month)-1,day:Number(n.day),hour:Number(n.hour)%24,minute:Number(n.minute),second:Number(n.second)}}function jM(e,t=M$){if(t===`Asia/Kolkata`)return N$;let n=AM(e,t),r=new Date(0);return r.setUTCFullYear(n.year,n.month,n.day),r.setUTCHours(n.hour,n.minute,n.second,0),r.getTime()-Math.floor(e/1e3)*1e3}function MM(e,t=M$){let n=e-jM(e,t);return n=e-jM(n,t),n}function NM(e,t){return W$(U$[t],e)}function PM(e){if(!Number.isInteger(e))throw Error(`A paise amount must be a whole number, got ${e}`);let t=BigInt(Math.abs(e)).toString().padStart(3,`0`);return`${e<0?`-`:``}${t.slice(0,-2)}.${t.slice(-2)}`}function FM(e,{decimals:t}={}){if(!t1(e))return B$();let n=Q$(X$(t,2)).format(Math.abs(e));return n===`0`?`0`:n1(e)+n}function IM(e,t){if(!t?.currency)throw TypeError(`[@webority/ui-elements] formatCurrency needs options.currency, an ISO 4217 code such as "INR".`);if(!t1(e))return B$();let{unit:n=`rupees`,decimals:r,currency:i}=t,a=X$(r,0),o=Y$(i),s=n===`paise`?a1(Math.abs(e),a,o):e1(a,o).format(Math.abs(e));return(Number(s.replace(/,/g,``))===0?``:n1(e))+T$(i)+s}function LM(e,{currency:t,unit:n=`rupees`}={}){if(!t1(e))return B$();let r=t?r1(e,n):e,i=t?T$(t):``,a=t?Y$(t):`en-IN`,o=a===`en-IN`?q$:J$,s=Math.abs(r),c=o.findIndex(([e])=>s>=e);if(c===-1){let e=Q$(o1(s),a).format(s);if(e!==`1,000`)return(e===`0`?``:n1(r))+i+e;c=o.length-1}let[l,u]=K$(o,c),d=s/l,f=d>=100?0:d>=10?1:2,p=Number(d.toFixed(f));return p>=100&&c>0&&(--c,[l,u]=K$(o,c),d=s/l,f=d>=100?0:d>=10?1:2,p=Number(d.toFixed(f))),`${n1(r)}${i}${Q$(f,a).format(p)} ${u}`}function RM(e,{decimals:t}={}){return t1(e)?`${FM(e*100,{decimals:X$(t,1)})}%`:B$()}function zM(e,{unit:t=`s`}={}){if(!t1(e))return B$();let n=s1[t]??1e3,r=Math.abs(e*n),i=n1(e);if(Math.round(r)<1e3)return`${i}${Q$(0).format(r)} ms`;let a=r/1e3;if(a<10)return`${i}${Q$(1).format(a)}s`;let o=Math.round(a);if(o<60)return`${i}${o}s`;let s=e=>String(e).padStart(2,`0`),c=Math.floor(o/60);if(c<60)return`${i}${c}m ${s(o%60)}s`;let l=Math.floor(c/60);return`${i}${Q$(0).format(l)}h ${s(c%60)}m`}function BM(e,t=M$){if(e instanceof Date)return e.getTime();if(t1(e))return e;if(typeof e!=`string`)return NaN;let n=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());if(n){let[e,r,i]=[Number(n[1]),Number(n[2]),Number(n[3])],a=new Date(Date.UTC(2e3,r-1,i));return a.setUTCFullYear(e),a.getUTCFullYear()===e&&a.getUTCMonth()===r-1&&a.getUTCDate()===i?MM(a.getTime(),t):NaN}return Date.parse(e)}function VM(e,t=M$){let{year:n,month:r,day:i,hour:a,minute:o}=AM(e,t);return{year:n,month:r,day:i,hour:a,minute:o}}function HM(e,{pattern:t=`day`,timeZone:n=M$}={}){let r=BM(e,n);if(!Number.isFinite(r))return B$();let i=VM(r,n),a=e=>String(e).padStart(2,`0`),o=`${a(i.day)}-${G$(i.month)}-${i.year}`,s=`${a(i.hour)}:${a(i.minute)}`;switch(t){case`month`:return`${G$(i.month)}-${i.year}`;case`year`:return String(i.year);case`datetime`:return`${o} ${s}`;case`time`:return s;default:return o}}function UM(e,{timeZone:t=M$}={}){let n=BM(e,t);if(!Number.isFinite(n))return B$();let r=VM(n,t);return`${String(r.day).padStart(2,`0`)}-${G$(r.month)}`}function G(e,t){if(e==null||e===``)return B$();let n=t?.style;if(n===`date`)return HM(e,t);if(typeof e!=`number`)return String(e);switch(n){case`currency`:return IM(e,{...t,currency:t?.currency??``});case`percent`:return RM(e,t);case`compact`:return LM(e,t);case`duration`:return zM(e,t);default:return FM(e,t)}}function WM(e){let t=e?.style;if(t===`currency`){if(!e?.currency)throw TypeError(`[@webority/ui-elements] a currency format needs a currency, an ISO 4217 code such as "INR".`);return{style:`compact`,currency:e.currency,unit:e.unit}}return!t||t===`number`?{style:`compact`}:e??{}}function GM(e){R1.has(e)||(R1.add(e),vM(`[@webority/ui-elements] <wui-chart> ${e}`))}function KM(e,t){if(e==null)throw Error(`${t} missing`);return e}function qM(e,t,n){t==null||n.includes(t)||GM(`received ${e}="${String(t)}", which is not one of ${z1(n)}. The chart uses its default instead.`)}function JM(e,t,n){for(let r of Object.keys(t))n.includes(r)||(/^(y2|secondary)/i.test(r)?GM(`ignores ${e}.${r}: a chart has one value axis by design. Show the second measure as its own chart.`):GM(`ignores the unknown key ${e}.${r}. Known keys: ${n.join(`, `)}.`))}function YM(e,t){if(t==null)return;if(typeof t!=`object`){GM(`expects ${e} to be an object such as { style: "currency" }.`);return}JM(e,t,I1);let n=H1(t,`style`);qM(`${e}.style`,n,F$);let r=H1(t,`currency`);r!=null&&!w$(r)&&GM(`received ${e}.currency="${String(r)}", which is not an ISO 4217 code such as "INR", so the format has no currency.`);let i=H1(t,`unit`);i!=null&&qM(`${e}.unit`,i,n===`duration`?L$:I$);let a=H1(t,`pattern`);qM(`${e}.pattern`,a,R$);let o=H1(t,`decimals`);o!=null&&!(typeof o==`number`&&Number.isInteger(o)&&o>=0&&o<=20)&&GM(`received ${e}.decimals=${String(o)}, which is not a whole number from 0 to 20. The chart uses its default instead.`);let s={style:G1(F$,n)?n:`number`};return typeof r==`string`&&w$(r)&&(s.currency=r),G1(L1,i)&&(s.unit=i),typeof o==`number`&&(s.decimals=o),G1(R$,a)&&(s.pattern=a),s}function XM(e){let t=(e,t=Q().errorText)=>(yM(`[@webority/ui-elements] <wui-chart> ${e}`),{spec:null,problem:t});if(!V1(e))return t('has no spec: set the `spec` property or add a <script type="application/json"> child.');let n=e;JM(`spec`,n,D1);let r=H1(n,`type`);if(qM(`type`,r,l1),!G1(l1,r))return t(`cannot draw type "${String(r)}".`);let i=r,a=H1(n,`title`);typeof a==`string`&&a.trim()||GM("needs a `title`: it names the chart for screen readers and names exported files.");for(let[e,t]of Object.entries(S1))H1(n,e)!=null&&!t.includes(i)&&GM(`ignores spec.${e} on a ${i} chart: it applies to ${t.join(`, `)}.`);let o=H1(n,`x`),s=V1(o)?o:{};JM(`spec.x`,s,O1);let c=x1[i]??[`category`],l=H1(s,`kind`);qM(`x.kind`,l,d1),G1(d1,l)&&!c.includes(l)&&GM(`ignores x.kind="${l}" on a ${i} chart: it takes ${z1(c)}.`);let u=H1(s,`labelFit`);qM(`x.labelFit`,u,k1);let d=YM(`x.format`,H1(s,`format`)),f=H1(s,`key`);typeof f!=`string`&&i!==`gauge`&&GM("needs `x.key`, the column holding each row's x value or slice name.");let p=typeof f==`string`?f:``,m=H1(n,`y`),h=V1(m)?m:{};JM(`spec.y`,h,P1);let g=YM(`y.format`,H1(h,`format`)),_=H1(n,`series`),v=Array.isArray(_)?_.filter(V1):[],y=[];for(let[e,t]of v.entries()){JM(`spec.series[${e}]`,t,A1);let n=YM(`series[${e}].format`,H1(t,`format`)),r=H1(t,`key`);typeof r!=`string`&&GM(`needs series[${e}].key, the column holding that series' values.`);let i=H1(t,`label`);y.push({key:String(r),named:typeof r==`string`,label:typeof i==`string`&&i?i:String(r),format:n})}let b=y[0];if(!b)return t(`has no series to draw.`);let x=y.filter(e=>e.named).map(e=>e.key),S=x.find((e,t)=>x.indexOf(e)!==t);if(S!==void 0)return t(`has two series with the key "${S}": each series needs its own key.`);if(y.length>8)return t(`refuses ${y.length} series: 8 is the most that stay distinguishable. Fold the smallest into an Other series, or split the chart.`,Q().tooManySeriesText);let C=v1(i);if(C&&y.length>1){let e=i===`donut`?`Compare parts across groups with a percent-stacked column instead.`:`Show the other measures as their own charts, or use small multiples.`;GM(`draws one series as a ${i}; it got ${y.length} and shows the first. ${e}`)}let w=(e,t,n,r)=>{if(t==null)return null;if(!V1(t))return GM(`expects ${e} to be an object such as { key: "column" }.`),null;JM(e,t,n);let i=H1(t,`key`);if(typeof i!=`string`)return GM(`needs ${e}.key, the column holding ${r}.`),null;let a=YM(`${e}.format`,H1(t,`format`)),o=H1(t,`label`);return{key:i,label:typeof o==`string`?o:``,format:a}},T=S1.group.includes(i)?w(`spec.group`,H1(n,`group`),j1,`each row's group`):null,E=i===`sankey`?w(`spec.to`,H1(n,`to`),j1,`where each flow ends`):null,D=i===`bubble`?w(`spec.size`,H1(n,`size`),M1,`each bubble's size`):null;if((i===`heatmap`||i===`treemap`)&&!T)return t(`needs \`group.key\` to draw a ${i}: the column holding each ${i===`heatmap`?`row`:`parent`}.`);if(i===`sankey`&&!E)return t("needs `to.key` to draw a sankey: the column holding where each flow ends.");if(i===`bubble`&&!D)return t("needs `size.key` to draw a bubble chart: the column holding each bubble's size.");let O=y1.includes(i)?u1:[`none`],k=H1(n,`stack`);qM(`stack`,k,O);let A=H1(n,`state`);qM(`state`,A,p1);let j=H1(n,`renderer`);qM(`renderer`,j,f1);let M=H1(n,`timeZone`);M!=null&&!kM(M)&&GM(`received timeZone="${String(M)}", which is not a time zone this browser knows. The chart uses Asia/Kolkata instead.`);let ee=kM(M)?M:M$,te=H1(n,`target`),ne=V1(te)?H1(te,`value`):void 0;te!=null&&(V1(te)&&JM(`spec.target`,te,F1),V1(te)&&B1(ne)||GM("ignores a `target` without a numeric `value`."));let re=H1(n,`trend`);re!=null&&typeof re!=`boolean`&&GM("expects `trend` to be true or false.");let ie=H1(n,`zoom`);ie!=null&&typeof ie!=`boolean`&&GM("expects `zoom` to be true or false.");let ae=[],oe=H1(n,`bands`);if(i===`gauge`&&oe!=null){let e=Array.isArray(oe)?oe.filter(V1):[];for(let t of e)JM(`spec.bands[]`,t,N1);ae=e.map(e=>({upTo:H1(e,`upTo`),label:H1(e,`label`)})).filter(e=>B1(e.upTo)&&typeof e.label==`string`&&e.label!==``).sort((e,t)=>e.upTo-t.upTo),Array.isArray(oe)&&ae.length===e.length||GM("ignores a gauge band without a numeric `upTo` and a `label`.")}let se=g??b.format,ce=(C?y.slice(0,1):y).map(e=>({key:e.key,label:e.label,format:e.format??se})),le=G1(c,l)?l:c[0],ue=H1(n,`data`),de=Array.isArray(ue)?ue:[],fe=de.filter(V1).map(W1),pe=-1,me=null,he=b.key;i===`donut`&&fe.length>6&&(me=fe,{data:fe,otherIndex:pe}=$M(fe,p,he),GM(`draws at most 6 donut slices; the smallest ${de.length-5} are shown as "${Q().otherLabel}". Send fewer rows, or use a bar chart for many parts.`));let N=(e,t)=>{let n=fe.filter(e);n.length!==fe.length&&GM(`leaves out ${fe.length-n.length} row(s) ${t}.`),fe=n},ge=e=>e!=null&&e!==``,_e=e=>B1(e)&&e>0;if(le===`time`&&b1.includes(i)&&N(e=>Number.isFinite(BM(e[p],ee)),`without a readable date`),i===`gauge`&&fe.length>1)GM(`draws one value as a gauge; it got ${fe.length} rows and shows the first.`),fe=fe.slice(0,1);else if(i===`scatter`||i===`bubble`){N(e=>B1(e[p])&&B1(e[he])&&(i!==`bubble`||D!=null&&_e(e[D.key])),`without a number for x and y (and a positive size)`);let e=new Set(T?fe.map(e=>String(e[T.key]??``)):[]);if(e.size>3)return t(`refuses ${e.size} colour groups on a ${i} chart: 3 is the most that stay tellable apart. Keep the three that matter and fold the rest into one, or split the chart.`,Q().tooManyGroupsText)}else if(i===`calendar`)N(e=>Number.isFinite(BM(e[p],ee)),`without a readable date`);else if(i===`heatmap`&&T)N(e=>ge(e[p])&&ge(e[T.key]),`without a column or a row`);else if(i===`treemap`&&T){N(e=>ge(e[p])&&ge(e[T.key])&&_e(e[he]),`without a name, a parent and a positive size`);let e=new Set(fe.map(e=>String(e[T.key])));if(e.size>8)return t(`refuses ${e.size} parents in a treemap: 8 is the most that keep their own colour. Fold the smallest into one, or split the chart.`,Q().tooManyGroupsText)}else if(i===`sankey`&&E){N(e=>ge(e[p])&&ge(e[E.key])&&_e(e[he]),`without a start, an end and a positive size`);let e=ZM(fe,p,E.key);if(e)return t(e.reason,e.text)}else if(i===`waterfall`){let e=QM(fe,he);if(e?.refuse)return t(e.refuse);e?.warn&&GM(e.warn)}let ve=H1(n,`height`),ye=B1(ve)&&ve>0?ve:null;if(i===`multiples`){let e=T1*ce.length+E1;ye!=null&&ye<e&&(GM(`needs at least ${e}px of height for ${ce.length} small charts; it got ${ye}px and draws at ${e}px.`),ye=e),ye??=w1*ce.length+40}ye??=C1[i]??320;let be=G1(O,k)?k:`none`,xe=S1.valueLabels.includes(i)&&H1(n,`valueLabels`)===!0;xe&&be!==`none`&&GM(`ignores valueLabels on a stacked chart.`);let Se=xe&&be===`none`,Ce=H1(n,`description`),we=H1(s,`label`),Te=H1(h,`label`),Ee=H1(h,`min`),De=H1(h,`max`),Oe=H1(n,`centerLabel`),ke=(e,t)=>typeof e==`string`&&e?e:t;return{problem:null,spec:{type:i,title:typeof a==`string`?a.trim():``,description:typeof Ce==`string`?Ce:``,data:fe,allData:me??fe,x:{key:p,kind:le,format:d??(le===`time`?{style:`date`}:le===`value`?{style:`number`}:void 0),label:typeof we==`string`?we:``,labelFit:G1(k1,u)?u:`auto`},series:ce,group:T,to:E,size:D,trend:S1.trend.includes(i)&&re===!0,zoom:S1.zoom.includes(i)?(ie??fe.length>5e3)===!0:!1,bands:ae,stack:be,y:{label:typeof Te==`string`?Te:``,format:se,min:B1(Ee)?Ee:void 0,max:B1(De)?De:void 0,wholeNumbers:H1(h,`wholeNumbers`)===!0},target:V1(te)&&B1(ne)?{value:ne,label:String(H1(te,`label`)??``)}:null,centerLabel:i===`donut`&&typeof Oe==`string`&&Oe.trim()?Oe.trim():``,valueLabels:Se,height:ye,state:G1(p1,A)?A:`ready`,emptyText:ke(H1(n,`emptyText`),Q().emptyText),errorText:ke(H1(n,`errorText`),Q().errorText),loadingText:ke(H1(n,`loadingText`),Q().loadingText),renderer:G1(f1,j)?j:`auto`,timeZone:ee,otherIndex:pe}}}function ZM(e,t,n){let r=e.map(e=>[String(e[t]),String(e[n])]),i=new Map;for(let[e,t]of r)i.has(e)||i.set(e,0),i.set(t,(i.get(t)??0)+1);let a=[...i].filter(([,e])=>e===0).map(([e])=>e);if(a.length>8)return{reason:`refuses ${a.length} flow starts in a sankey: 8 is the most that keep their own colour. Fold the smallest into one, or split the chart.`,text:Q().tooManyGroupsText};let o=0;for(;a.length;){let e=a.pop();o+=1;for(let[t,n]of r){if(t!==e)continue;let r=(i.get(n)??0)-1;i.set(n,r),r===0&&a.push(n)}}return o<i.size?{reason:`cannot draw a sankey whose flows loop back on themselves.`,text:Q().errorText}:null}function QM(e,t){let n=e.map(e=>B1(e[t])?e[t]:0),r=n[n.length-1]??0,i=n[0]??0,a=i;for(let e of n.slice(1,-1))i+=e,a=Math.min(a,i);return a<0||n.length>1&&r<0?{refuse:`cannot draw a waterfall whose running total goes below zero.`}:n.length>2&&Math.abs(r-i)>.5?{warn:`draws the waterfall's closing total (${r}) as given, though the opening total plus the steps is ${i}.`}:null}function $M(e,t,n){let r=new Set(e.map((e,t)=>({i:t,v:B1(e[n])?e[n]:0})).sort((e,t)=>t.v-e.v).slice(0,5).map(e=>e.i)),i=e.reduce((e,t,i)=>r.has(i)||!B1(t[n])?e:e+t[n],0),a=e.filter((e,t)=>r.has(t)),o=new Set(a.map(e=>String(e[t]))),s=Q().otherLabel;for(let e=2;o.has(s);e+=1)s=`${Q().otherLabel} (${e})`;return a.push({[t]:s,[n]:i}),{data:a,otherIndex:a.length-1}}function eN(e){return KM(e.series[0],`series`)}function tN(e,t){return KM(e.data[t],`row ${t}`)}function K(e,t,n){let r=e.data[n]?.[t];return B1(r)?r:null}function nN(e){return e.type===`gauge`||e.series.some(t=>e.data.some((n,r)=>K(e,t.key,r)!=null))}function rN(e,t){let n=e.data[t]?.[e.x.key];return n==null||n===``?B$():e.x.format?G(n,{...e.x.format,timeZone:e.timeZone}):String(n)}function iN(e,t){return BM(e.data[t]?.[e.x.key],e.timeZone)}function aN(e,t){let n=e.group?e.data[t]?.[e.group.key]:null;return n==null||n===``?B$():String(n)}function oN(e,t){let n=e.to?e.data[t]?.[e.to.key]:null;return n==null||n===``?B$():String(n)}function sN(e){return e.group?K1(e.data.map((t,n)=>aN(e,n))):[]}function cN(e){return v1(e.type)?e.data.length:e.data.length*e.series.length}function lN(e){return e.renderer===`auto`?cN(e)>5e3?`canvas`:`svg`:e.renderer}function uN(e){switch(e.type){case`donut`:return e.data.map((t,n)=>rN(e,n));case`scatter`:case`bubble`:return sN(e);case`line`:case`area`:case`column`:case`bar`:return e.series.map(e=>e.key);default:return[]}}function dN(e){return[`line`,`area`,`column`,`bar`].includes(e.type)?e.series.map(e=>e.label):uN(e)}function fN(e,t,n){return e.type===`donut`?n.has(rN(e,t)):(e.type===`scatter`||e.type===`bubble`)&&e.group?n.has(aN(e,t)):!1}function pN(e,t){return e.data.map((n,r)=>{let i=e.series.filter(e=>!t.has(e.key)).reduce((t,n)=>t+Math.abs(K(e,n.key,r)??0),0);return Object.fromEntries(e.series.map(t=>{let n=K(e,t.key,r);return[t.key,i&&n!=null?n/i:null]}))})}function mN(e,t=M$){return`${NM(new Date(e+jM(e,t)).getUTCDay(),`short`)}, ${HM(e,{timeZone:t})}`}function hN(e,t){let n=e.filter(B1);if(!n.length)return[];let r=q1(n),i=J1(n),a=[t[1],t[2],t[3],t[5],t[6]];if(r===i)return[{from:r,to:i,colour:a[2]}];let o=(i-r)/a.length;return a.map((e,t)=>({from:r+o*t,to:t===a.length-1?i:r+o*(t+1),colour:e}))}function gN(e,t){if(t==null||!e.length)return;let n=e.length-1,r=e.findIndex((e,r)=>t>=e.from&&(r===n?t<=e.to:t<e.to));return e[r<0?n:r]?.colour}function _N(e,t){return Array.from({length:e},(n,r)=>t[e===1?6:Math.round(6-r*4/(e-1))])}function vN(e,t){return e.bands.find(e=>t<=e.upTo)??e.bands[e.bands.length-1]??null}function yN(e){return{min:e.y.min??0,max:e.y.max??100}}function bN(e){let t=eN(e).key,n=e.data.length-1,r=0;return e.data.map((i,a)=>{let o=K(e,t,a)??0,s=a===0||a===n,c=s?0:r,l=s?o:r+o;return a===0?r=o:s||(r=l),{index:a,total:s,value:o,from:c,to:l,level:s?o:l}})}function xN(e,t){let n=eN(e).key,r=KM(e.to,`to column`).key,i=e.data.map((t,i)=>({from:String(t[e.x.key]),to:String(t[r]),value:K(e,n,i)??0})),a=new Map;for(let e of i)a.has(e.from)||a.set(e.from,[]),a.set(e.to,[...a.get(e.to)??[],e]);let o=new Map,s=0;for(let[e,n]of a)n.length||o.set(e,t[s++%t.length]);let c=[...o.keys()],l=new Map([...a].filter(([,e])=>e.length).map(([e,t])=>[e,t.length]));for(;c.length;){let e=c.shift();for(let t of i.filter(t=>t.from===e)){let e=(l.get(t.to)??0)-1;if(l.set(t.to,e),e>0)continue;let n=KM((a.get(t.to)??[]).reduce((e,t)=>e===null||t.value>e.value?t:e,null),`sankey inflow`);o.set(t.to,o.get(n.from)),c.push(t.to)}}return o}function SN(e){let t=eN(e).key,n=new Map(sN(e).map(e=>[e,0]));return e.data.forEach((r,i)=>{n.set(aN(e,i),(n.get(aN(e,i))??0)+(K(e,t,i)??0))}),n}function CN(e,t,n){let{palette:r,neutral:i,seq:a,rise:o,fall:s}=n,c=eN(e).key;switch(e.type){case`donut`:return EN(e,t,n);case`funnel`:return _N(e.data.length,KM(a,`sequential colours`))[t];case`heatmap`:case`calendar`:return gN(hN(Y1(e,c),KM(a,`sequential colours`)),K(e,c,t));case`gauge`:return r[0];case`waterfall`:{let n=KM(bN(e)[t],`waterfall bar ${t}`);return n.total?r[0]:n.value>=0?o:s}case`treemap`:return r[[...SN(e).keys()].indexOf(aN(e,t))%r.length];case`sankey`:return xN(e,r).get(String(tN(e,t)[e.x.key]));case`scatter`:case`bubble`:return r[Math.max(0,sN(e).indexOf(aN(e,t)))];default:return r[0]??i}}function wN(e,t,n,r){let i=eN(e),a=K(e,i.key,t),o=()=>CN(e,t,r);switch(e.type){case`donut`:{let r=e.data.reduce((t,r,a)=>t+(n.has(rN(e,a))?0:K(e,i.key,a)??0),0);return{title:rN(e,t),rows:[{color:o(),label:i.label,value:G(a,i.format)},{label:Q().shareLabel,value:r&&a!=null?G(a/r,{style:`percent`}):B$()}],foot:``}}case`heatmap`:return{title:`${aN(e,t)}, ${rN(e,t)}`,rows:[{color:o(),label:i.label,value:G(a,i.format)}],foot:``};case`calendar`:return{title:mN(iN(e,t),e.timeZone),rows:[{color:o(),label:i.label,value:G(a,i.format)}],foot:``};case`funnel`:{let n=K(e,i.key,0),r=t?K(e,i.key,t-1):null,s=[{color:o(),label:i.label,value:G(a,i.format)}];return t&&s.push({label:Q().ofPreviousStepLabel,value:X1(a,r)}),s.push({label:CM(Q().ofFirstStepText,{first:rN(e,0)}),value:X1(a,n)}),{title:rN(e,t),rows:s,foot:``}}case`gauge`:{let{min:n,max:r}=yN(e),s=a==null?null:vN(e,a),c=[{color:o(),label:i.label,value:G(a,i.format)}];return c.push({label:Q().scaleLabel,value:CM(Q().scaleRangeText,{min:G(n,i.format),max:G(r,i.format)})}),s&&c.push({label:Q().bandLabel,value:s.label}),{title:e.data[t]?.[e.x.key]==null?i.label:rN(e,t),rows:c,foot:``}}case`waterfall`:{let n=bN(e),r=KM(n[t],`waterfall bar ${t}`),a=KM(n[0],`waterfall opening bar`).value,s=r.total?[{color:o(),label:i.label,value:G(r.value,i.format)}]:[{color:o(),label:Q().changeLabel,value:TN(r.value,i.format)},{label:Q().runningTotalLabel,value:G(r.level,i.format)}],c=!r.total&&a?CM(Q().openingShareText,{share:TN(r.value/a*100,{style:`number`,decimals:2},`%`)}):``;return{title:rN(e,t),rows:s,foot:c}}case`treemap`:{let n=aN(e,t),r=SN(e).get(n);return{title:`${n} / ${rN(e,t)}`,rows:[{color:o(),label:i.label,value:G(a,i.format)},{label:CM(Q().shareOfParentText,{parent:n}),value:X1(a,r)}],foot:``}}case`sankey`:{let n=String(tN(e,t)[e.x.key]),r=e.data.reduce((t,r,a)=>String(r[e.x.key])===n?t+(K(e,i.key,a)??0):t,0);return{title:CM(Q().scaleRangeText,{min:n,max:oN(e,t)}),rows:[{color:o(),label:i.label,value:G(a,i.format)},{label:CM(Q().shareOfParentText,{parent:n}),value:X1(a,r)}],foot:``}}case`scatter`:case`bubble`:{let n=[{color:o(),label:e.x.label||String(e.x.key),value:rN(e,t)},{label:i.label,value:G(a,i.format)}];return e.size&&n.push({label:e.size.label||String(e.size.key),value:G(tN(e,t)[e.size.key],e.size.format)}),{title:e.group?aN(e,t):i.label,rows:n,foot:``}}}let s=e.stack===`percent`?pN(e,n)[t]:null,c=e.series.map((e,t)=>({s:e,i:t})).filter(({s:e})=>!n.has(e.key)),l=c.map(({s:n,i})=>{let a=K(e,n.key,t),o=G(a,n.format);return{color:e.type===`multiples`?r.palette[0]:r.palette[i],line:e.type===`line`||e.type===`multiples`,label:n.label,value:s&&a!=null?`${o} (${G(s[n.key],{style:`percent`})})`:o}}),u=``,d=c[0];if(e.stack!==`none`&&d&&c.length>1){let n=c.reduce((n,{s:r})=>n+(K(e,r.key,t)??0),0);u=CM(Q().totalText,{total:G(n,d.s.format)})}if(e.target&&d&&c.length===1){let n=K(e,d.s.key,t);if(n!=null){let t=n-e.target.value,r=e.target.label||Q().targetLabel;u=CM(Q().targetGapText,{direction:t>=0?Q().aboveLabel:Q().belowLabel,label:r,gap:G(Math.abs(t),d.s.format)})}}return{title:rN(e,t),rows:l,foot:u}}function TN(e,t,n=``){let r=`${G(Math.abs(e),t)}${n}`;return e>0?`+${r}`:e<0?`−${r}`:r}function EN(e,t,n){return t===e.otherIndex?n.neutral:n.palette[t%n.palette.length]}function DN(e){let t=(e,t)=>{let n=document.createElement(`div`);return n.className=e,t!=null&&(n.textContent=t),n},n=t(`wui-chart-tooltip-body`);e.title&&n.append(t(`wui-chart-tooltip-title`,e.title));for(let r of e.rows){let e=t(`wui-chart-tooltip-row`);if(r.color){let t=document.createElement(`span`);t.className=r.line?`wui-chart-tooltip-swatch wui-chart-tooltip-swatch-line`:`wui-chart-tooltip-swatch`,t.style.background=r.color,e.append(t)}let i=document.createElement(`span`);i.className=`wui-chart-tooltip-label`,i.textContent=r.label;let a=document.createElement(`span`);a.className=`wui-chart-tooltip-value`,a.textContent=r.value,e.append(i,a),n.append(e)}return e.foot&&n.append(t(`wui-chart-tooltip-foot`,e.foot)),n}function ON(e){let t=[e.title,...e.rows.map(e=>`${e.label} ${e.value}`)];return e.foot&&t.push(e.foot),t.filter(Boolean).join(`. `)}function kN(e){return e.x.label?e.x.label:{gauge:Q().measureLabel,funnel:Q().stageLabel,waterfall:Q().stepLabel,sankey:Q().fromLabel,scatter:Q().columnXLabel,bubble:Q().columnXLabel}[e.type]??(e.x.kind===`time`?Q().dateLabel:Q().categoryLabel)}function AN(e){let t=e.allData&&e.allData!==e.data?{...e,data:e.allData}:e,n=eN(t),r=(e,r=n)=>G(K(t,r.key,e),r.format),i=(e,n,r=n.length)=>({caption:t.title,head:e,rows:n.slice(0,500),total:r,truncated:r>500}),a=t.data.map((e,t)=>t);switch(t.type){case`heatmap`:{let e=K1(a.map(e=>rN(t,e))),n=sN(t),o=new Map(a.map(e=>[`${aN(t,e)}\u0000${rN(t,e)}`,r(e)]));return i([KM(t.group,`group column`).label||Q().rowLabel,...e],n.map(t=>({head:t,cells:e.map(e=>o.get(`${t}\u0000${e}`)??B$())})))}case`funnel`:{let e=K(t,n.key,0);return i([kN(t),n.label,Q().ofPreviousStepLabel,CM(Q().ofFirstStepText,{first:rN(t,0)})],a.map(i=>({head:rN(t,i),cells:[r(i),i?X1(K(t,n.key,i),K(t,n.key,i-1)):B$(),X1(K(t,n.key,i),e)]})))}case`gauge`:return i([kN(t),n.label,...t.bands.length?[Q().bandLabel]:[]],a.map(e=>({head:tN(t,e)[t.x.key]==null?n.label:rN(t,e),cells:[r(e),...t.bands.length?[Z1(t,K(t,n.key,e))]:[]]})));case`waterfall`:return i([kN(t),Q().changeLabel,Q().runningTotalLabel],bN(t).map(e=>({head:rN(t,e.index),cells:[e.total?B$():TN(e.value,n.format),G(e.level,n.format)]})));case`treemap`:{let e=SN(t);return i([KM(t.group,`group column`).label||Q().groupLabel,t.x.label||Q().itemLabel,n.label,Q().shareOfGroupLabel],a.map(i=>({head:aN(t,i),cells:[rN(t,i),r(i),X1(K(t,n.key,i),e.get(aN(t,i)))]})))}case`sankey`:return i([kN(t),KM(t.to,`to column`).label||Q().toLabel,n.label],a.map(e=>({head:rN(t,e),cells:[oN(t,e),r(e)]})));case`scatter`:case`bubble`:return i([kN(t),n.label,...t.size?[t.size.label||t.size.key]:[],...t.group?[t.group.label||Q().groupLabel]:[]],a.map(e=>({head:rN(t,e),cells:[r(e),...t.size?[G(tN(t,e)[t.size.key],t.size.format)]:[],...t.group?[aN(t,e)]:[]]})))}let o=t.type===`donut`,s=o?t.data.reduce((e,r,i)=>e+(K(t,n.key,i)??0),0):0,c=[kN(t),...t.series.map(e=>e.label)];return o&&c.push(Q().shareLabel),i(c,a.slice(0,500).map(e=>{let i=t.series.map(t=>r(e,t));if(o){let r=K(t,n.key,e);i.push(s&&r!=null?G(r/s,{style:`percent`}):B$())}return{head:rN(t,e),cells:i}}),t.data.length)}function jN(e){switch(e?.style){case`currency`:case`compact`:return e.currency?` (${e.currency})`:``;case`percent`:return` (%)`;case`duration`:return` (${e.unit??`s`})`;default:return``}}function MN(e,t){return e==null?e:t?.unit===`paise`?Number(PM(e)):t?.style===`percent`?Number((e*100).toPrecision(12)):e}function NN(e){let t=e.allData&&e.allData!==e.data?{...e,data:e.allData}:e,n=e=>{if(e==null)return``;let t=String(e);return typeof e==`string`&&/^[=+\-@\t\r]/.test(t)&&(t=`'${t}`),/[",\r\n]/.test(t)?`"${t.replace(/"/g,`""`)}"`:t},r={head:t.x.label||t.x.key,value:e=>{let n=e[t.x.key];return t.x.kind===`time`?HM(n,{pattern:t.x.format?.pattern??`day`,timeZone:t.timeZone}):n}},i=t.series.map(e=>({head:`${e.label}${jN(e.format)}`,value:t=>{let n=t[e.key];return MN(B1(n)?n:null,e.format)}})),a=t.group,o=a?{head:a.label||a.key,value:e=>e[a.key]}:null,s;switch(t.type){case`heatmap`:s=[r,KM(o,`group column`),...i];break;case`treemap`:s=[KM(o,`group column`),r,...i];break;case`sankey`:{let e=KM(t.to,`to column`);s=[r,{head:e.label||e.key,value:t=>t[e.key]},...i];break}case`bubble`:{let e=KM(t.size,`size column`);s=[r,...i,{head:`${e.label||e.key}${jN(e.format)}`,value:t=>{let n=t[e.key];return MN(B1(n)?n:null,e.format)}},...o?[o]:[]];break}case`scatter`:s=[r,...i,...o?[o]:[]];break;case`gauge`:s=t.x.key===``?i:[r,...i];break;default:s=[r,...i]}let c=[s.map(e=>n(e.head)).join(`,`)];for(let e of t.data)c.push(s.map(t=>n(t.value(e))).join(`,`));return`${c.join(`\r
32
+ `)}`}function PN(e){return(e?.title??``).toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/(^-|-$)/g,``)||`chart`}function FN(e,t=new Set){let n=[];e.description&&n.push(e.description.replace(/\.?\s*$/,`.`));let r=uN(e);if(r.length&&r.every(e=>t.has(e)))return n.push(Q().everySeriesHiddenText),n.join(` `);let i=e.data.length,a=e.data.map((e,t)=>t).filter(n=>!fN(e,n,t)),o=eN(e),s=Y1(e,o.key),c=s.reduce((e,t)=>e+t,0),l=()=>e.data.reduce((t,n,r)=>(K(e,o.key,r)??-1/0)>(K(e,o.key,t)??-1/0)?r:t,0),u=()=>e.data.reduce((t,n,r)=>(K(e,o.key,r)??1/0)<(K(e,o.key,t)??1/0)?r:t,0);switch(e.type){case`donut`:{let t=a.reduce((t,n)=>t+(K(e,o.key,n)??0),0);if(n.push(wM(Q(),`donutSummaryText`,a.length,{rows:a.length,label:o.label,total:G(t,o.format)})),a.length&&t){let r=a.reduce((t,n)=>(K(e,o.key,n)??-1/0)>(K(e,o.key,t)??-1/0)?n:t,KM(a[0],`first slice`));n.push(CM(Q().donutLargestText,{top:rN(e,r),share:G((K(e,o.key,r)??0)/t,{style:`percent`})}))}return n.join(` `)}case`heatmap`:if(n.push(CM(Q().heatmapSummaryText,{label:o.label,group:KM(e.group,`group column`).label||Q().rowFallbackLabel,x:e.x.label||Q().columnFallbackLabel,n:i})),s.length){let t=l(),r=u();n.push(CM(Q().highestAtLowestAtText,{highValue:$1(e,t),highGroup:aN(e,t),high:rN(e,t),lowValue:$1(e,r),lowGroup:aN(e,r),low:rN(e,r)}))}return n.join(` `);case`calendar`:return n.push(i===1?CM(Q().calendarSummaryTextOne,{label:o.label,n:i}):CM(Q().calendarSummaryTextOther,{label:o.label,n:i,range:i>1?CM(Q().calendarRangeText,{first:rN(e,0),last:rN(e,i-1)}):``})),s.length&&n.push(CM(Q().highestLowestText,{maxValue:$1(e,l()),max:rN(e,l()),minValue:$1(e,u()),min:rN(e,u())})),n.join(` `);case`funnel`:return n.push(CM(Q().funnelSummaryText,{label:o.label,n:i})),i>1&&n.push(CM(Q().funnelStartText,{first:rN(e,0),firstValue:$1(e,0),last:rN(e,i-1),lastValue:$1(e,i-1),share:X1(K(e,o.key,i-1),K(e,o.key,0))})),n.join(` `);case`gauge`:{let t=K(e,o.key,0),{min:r,max:i}=yN(e),a=t==null?null:vN(e,t);return n.push(CM(Q().gaugeSummaryText,{type:g1(`gauge`),label:o.label,value:G(t,o.format),min:G(r,o.format),max:G(i,o.format),band:a?CM(Q().gaugeBandText,{band:a.label}):``})),n.join(` `)}case`waterfall`:{let t=bN(e);if(n.push(CM(Q().waterfallSummaryText,{label:o.label})),i>1){let r=t.filter(e=>!e.total);n.push(CM(Q().opensAtClosesAtText,{opening:G(KM(t[0],`waterfall opening bar`).value,o.format),closing:G(KM(t[i-1],`waterfall closing bar`).value,o.format)}));let a=r.reduce((e,t)=>t.value>(e?.value??0)?t:e,null),s=r.reduce((e,t)=>t.value<(e?.value??0)?t:e,null);a&&n.push(CM(Q().largestRiseText,{xText:rN(e,a.index),signed:TN(a.value,o.format)})),s&&n.push(CM(Q().largestFallText,{xText:rN(e,s.index),signed:TN(s.value,o.format)}))}return n.join(` `)}case`treemap`:{let t=SN(e);if(!t.size)return CM(Q().treemapEmptyText,{label:o.label});let[r,a]=[...t].reduce((e,t)=>t[1]>e[1]?t:e);return n.push(CM(Q().treemapSummaryText,{label:o.label,n:i,totals:t.size,total:G(c,o.format)})),n.push(CM(Q().treemapLargestGroupText,{name:r,share:X1(a,c)})),n.join(` `)}case`sankey`:{let t=KM(e.to,`to column`).key,r=K1(e.data.flatMap(n=>[String(n[e.x.key]),String(n[t])])),a=l();return n.push(CM(Q().sankeySummaryText,{label:o.label,n:i,nodes:r.length})),n.push(CM(Q().largestFlowText,{xText:rN(e,a),toText:oN(e,a),fmtAt:$1(e,a)})),n.join(` `)}case`scatter`:case`bubble`:{let r=sN(e).filter(e=>!t.has(e));n.push(CM(Q().scatterSummaryText,{type:g1(e.type),label:o.label,xLabel:e.x.label||e.x.key,count:a.length,groups:r.length?wM(Q(),`groupsText`,r.length,{groups:r.join(`, `)}):``}));let i=a.map(t=>tN(e,t)[e.x.key]).filter(B1),s=a.map(t=>K(e,o.key,t)).filter(e=>e!=null);for(let t of[Q1(e.x.label||String(e.x.key),i,e.x.format),Q1(o.label,s,o.format)])t&&n.push(t);return n.join(` `)}}let d=e.stack===`percent`?Q().stackedPercentText:e.stack===`stacked`?Q().stackedText:``,f=e.series.filter(e=>!t.has(e.key));n.push(CM(Q().summaryText,{type:g1(e.type),series:f.map(e=>e.label).join(`, `),stacked:d,sharedAxis:e.type===`multiples`?Q().sharedAxisText:``})),i&&n.push(i===1?CM(Q().pointsSummaryTextOne,{n:i,first:rN(e,0)}):CM(Q().pointsSummaryTextOther,{n:i,first:rN(e,0),last:rN(e,i-1)}));for(let t of f){let r=Q1(t.label,Y1(e,t.key),t.format);r&&n.push(r)}return n.join(` `)}function IN(e){return e.stack===`percent`?{style:`percent`,decimals:0}:WM(e.y.format)}function LN(e,t){let n=e.data.map((e,t)=>t).filter(n=>!fN(e,n,t));if(e.type!==`scatter`&&e.type!==`bubble`)return n;let r=t=>K(e,e.x.key,t)??0;return n.sort((e,t)=>r(e)-r(t)||e-t)}function RN(e){let t=K1(e.data.map((t,n)=>rN(e,n))),n=sN(e),r=new Map(e.data.map((r,i)=>[`${t.indexOf(rN(e,i))},${n.indexOf(aN(e,i))}`,i]));return{columns:t.length,rows:n.length,at:r,position:r=>[t.indexOf(rN(e,r)),n.indexOf(aN(e,r))]}}function zN(e,t,n,r){if(n===`Escape`)return null;let i=e.data.length;if(!i)return t;if(e.type===`gauge`)return n in t0||n===`Home`||n===`End`?{index:0,series:0}:t;if(e.type===`heatmap`||e.type===`calendar`)return BN(e,t,n);let a=r0.includes(e.type),o=e.series.map((e,t)=>r.has(e.key)?-1:t).filter(e=>e>=0),s=a?LN(e,r):[];if(a?!s.length:!o.length)return t;let c=t??{index:a?KM(s[0],`first mark`):0,series:a?0:KM(o[0],`first visible series`)};if(t==null&&n in t0)return c;if(a){let e=Math.max(0,s.indexOf(c.index));return n===`Home`?{index:KM(s[0],`first mark`),series:0}:n===`End`?{index:KM(s[s.length-1],`last mark`),series:0}:n in t0?{index:KM(s[(e+n0(n)+s.length)%s.length],`next mark`),series:0}:t}if(n===`Home`)return{...c,index:0};if(n===`End`)return{...c,index:i-1};if(!(n in t0))return t;if(e.type===`bar`?n===`ArrowUp`||n===`ArrowDown`:n===`ArrowLeft`||n===`ArrowRight`)return{...c,index:Math.min(i-1,Math.max(0,c.index+n0(n)))};let l=Math.max(0,o.indexOf(c.series)),u=e.type===`bar`?n0(n):-n0(n);return{...c,series:KM(o[Math.min(o.length-1,Math.max(0,l+u))],`series`)}}function BN(e,t,n){let r=e.data.length,i=e.type===`calendar`,a=i?e.data.map((e,t)=>t).sort((t,n)=>iN(e,t)-iN(e,n)):[],o=i?null:RN(e),s=t??{index:i?KM(a[0],`first day`):0,series:0};if(t==null&&n in t0)return s;if(n===`Home`)return{index:i?KM(a[0],`first day`):0,series:0};if(n===`End`)return{index:i?KM(a[r-1],`last day`):r-1,series:0};if(!(n in t0))return t;if(i){let t=n===`ArrowDown`||n===`ArrowUp`?n0(n):n0(n)*7,r=t=>{let n=iN(e,t);return Math.floor((n+jM(n,e.timeZone))/e0)},i=r(s.index),o=a.filter(e=>t>0?r(e)>i:r(e)<i);if(!o.length)return{index:s.index,series:0};let c=i+t;return{index:o.reduce((e,t)=>Math.abs(r(t)-c)<Math.abs(r(e)-c)?t:e),series:0}}if(!o)throw Error(`heat grid missing`);let[c,l]=o.position(s.index),[u,d]=n===`ArrowLeft`||n===`ArrowRight`?[n0(n),0]:[0,n0(n)];return{index:o.at.get(`${c+u},${l+d}`)??s.index,series:0}}function VN(e){let t=e.series[0];if(!t)throw Error(`chart spec has no series`);return t}function HN(e,t){let n=e.data[t];if(!n)throw Error(`chart row ${t} missing`);return n}function UN(e){if(!e.to)throw Error("chart spec has no `to` column");return e.to.key}function WN(e){if(!e.size)throw Error("chart spec has no `size` column");return e.size.key}function GN(e,t,n){let r=e[t];if(!r)throw Error(`percent shares for row ${t} missing`);return r[n]??null}function KN(e,t,n){let r=e?.[t];if(!r)throw Error(`bar radii for row ${t} missing`);return r[n]}function qN(e){return typeof e==`object`&&e&&`row`in e?o0(e.row):null}function JN(e){if(typeof e!=`object`||!e||!(`dataZoom`in e)||!Array.isArray(e.dataZoom))return null;let t=e.dataZoom[0];if(typeof t!=`object`||!t||!(`start`in t)||!(`end`in t))return null;let{start:n,end:r}=t;return a0(n)&&Number.isFinite(n)&&a0(r)&&Number.isFinite(r)?{start:n,end:r}:null}function YN(e){if(!e)throw Error(`chart has not been drawn`);return e}function XN(e){return e.wholeNumbers===!0||e.format?.style===`currency`&&e.format.unit===`paise`}function ZN(e,t,n,r,i=!1){let a=WM(e);if(i)return a.currency?{style:`currency`,currency:a.currency,unit:a.unit,decimals:0}:{style:`number`,decimals:0};if(a.style!==`compact`||!Number.isFinite(t)||!Number.isFinite(n))return a;let o=(n-t)/r;if(!(o>0)||o>=Math.max(Math.abs(t),Math.abs(n))*.02)return a;let s=Math.min(6,Math.max(0,Math.ceil(-Math.log10(o))));return a.currency?{style:`currency`,currency:a.currency,unit:a.unit,decimals:s}:{style:`number`,decimals:s}}function QN(e){let t=String(e??``).trim(),n=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(t);if(n){let e=n[1]??``,t=e.length===3?[...e].map(e=>e+e).join(``):e;return[0,2,4].map(e=>Number.parseInt(t.slice(e,e+2),16))}let r=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/i.exec(t);return r?r.slice(1,4).map(Number):null}function $N(e,t){let n=QN(e);return n?`rgba(${n.join(`,`)},${t})`:String(e??``).trim()}function eP(e,t,n){let r=QN(e),i=QN(t);return r&&i?`rgb(${r.map((e,t)=>Math.round(e+((i[t]??0)-e)*n)).join(`,`)})`:e}function tP(e,t){let n=QN(e),r=QN(t.text),i=QN(t.surface);return!n||!r||!i||_0(g0(n),g0(r))>=_0(g0(n),g0(i))?t.text:t.surface}function nP(e){let t=e.x.format?.pattern;return n=>{let r=MM(n,e.timeZone);if(t===`month`||t===`year`)return HM(r,{pattern:t,timeZone:e.timeZone});let i=AM(r,e.timeZone);return i.hour||i.minute?HM(r,{pattern:`time`,timeZone:e.timeZone}):UM(r,{timeZone:e.timeZone})}}function rP(e,t,n){let r=d0,i=e=>n?e?[r,0,0,r]:[0,r,r,0]:e?[0,0,r,r]:[r,r,0,0];return e.data.map((n,r)=>{let a={};if(e.stack===`none`){for(let t of e.series)a[t.key]=i((K(e,t.key,r)??0)<0);return a}let o=null,s=null;for(let n of e.series){let i=K(e,n.key,r);t.has(n.key)||i==null||i===0||(i>0?o=n.key:s=n.key)}for(let t of e.series)a[t.key]=t.key===o?i(!1):t.key===s?i(!0):0;return a})}function iP(e,t,n,r){let i=n.width<576,a=r.animation!==!1&&!t.reducedMotion&&cN(e)<=5e3,o=uN(e),s=Object.fromEntries(o.map(e=>[e,!r.hidden.has(e)])),c={palette:t.palette,neutral:t.neutral,rise:t.rise,fall:t.fall,seq:t.seq},l={backgroundColor:t.surface,borderColor:t.grid,borderWidth:1,padding:[10,12],confine:!0,className:`wui-chart-tooltip`,extraCssText:`box-shadow:${t.shadow};border-radius:10px;`,textStyle:{fontFamily:t.font,color:t.textBody,fontSize:12},transitionDuration:a?.25:0},u={backgroundColor:`transparent`,animation:a,animationDuration:1e3,animationEasing:`cubicOut`,animationDurationUpdate:650,animationEasingUpdate:`cubicInOut`,textStyle:{fontFamily:t.font,color:t.label},color:t.palette,legend:{show:!1,data:o,selected:s}},d={base:u,tooltipBase:l,colours:c,compact:i,animate:a},f=B0[e.type];if(f)return f(e,t,n,r,d);let p=e.type===`bar`,m=e.x.kind===`time`,h=e.stack===`percent`?pN(e,r.hidden):null,g=p||e.type===`column`?rP(e,r.hidden,p):null,_=e.series.length===1,v=r.renderer===`canvas`,[y,b]=l0(e.series.flatMap(t=>e.data.map((n,r)=>K(e,t.key,r))),!0),x=e.stack===`percent`?IN(e):ZN(e.y.format,e.y.min??y,e.y.max??b,i?3:4,e.y.wholeNumbers),S=h?.some(e=>Object.values(e).some(e=>e!=null&&e<0))?-1:0,C=e.series.findIndex(e=>!r.hidden.has(e.key)),w=e.series.filter(e=>!r.hidden.has(e.key)),T=m&&!e.valueLabels?[]:e.data.map((t,n)=>rN(e,n)),E=()=>{let t=e.stack===`percent`?[1,S]:[e.y.max??b,e.y.min??y];return n.width-Math.max(...t.map(e=>p0(G(e,x),12)))-20},D=!1;if(e.valueLabels){let t=p?n.width-D0(T.map(e=>p0(e,12)))-20:N0(T.length,E())/Math.max(1,w.length);D=w.flatMap(t=>e.data.map((n,r)=>K(e,t.key,r))).filter(e=>e!=null).every(e=>p0(G(e,x),12)<=t)}let O={type:m?`time`:`category`,boundaryGap:!m&&(e.type===`column`||p),inverse:p,axisLine:{show:!0,lineStyle:{color:t.axis}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{color:t.label,fontSize:12,margin:12,...m||e.type!==`column`||e.x.labelFit===`auto`?{hideOverlap:!0}:gP(e.x.labelFit,T,E()),...m?{formatter:nP(e)}:{}},...m?{}:{data:T}},k={type:`value`,splitNumber:i?3:4,min:e.stack===`percent`?S:e.y.min,max:e.stack===`percent`?1:e.y.max,minInterval:XN(e.y)?1:void 0,interval:e.stack===`percent`?.25:void 0,axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:t.grid,type:`solid`,width:1}},axisLabel:{color:t.label,fontSize:12,formatter:e=>G(e,x)},...e.y.label?{name:e.y.label,nameLocation:`end`,nameGap:12,nameTextStyle:{color:t.label,fontSize:12,align:p?`right`:`left`}}:{}},A=e.zoom,j=_&&e.type!==`column`&&!p&&!i,M=e.series.map((n,r)=>{let o=m0(t.palette,r%t.palette.length),s=e.data.some((t,r)=>K(e,n.key,r)!=null&&K(e,n.key,r-1)==null&&K(e,n.key,r+1)==null),c=t=>{let r=K(e,n.key,t),i=h?GN(h,t,n.key):r;return m?[y0(iN(e,t),e.timeZone),i]:i},l={id:n.key,name:n.key,stack:e.stack===`none`?void 0:`total`,emphasis:{focus:_?`none`:`series`,blurScope:`coordinateSystem`},blur:{itemStyle:{opacity:.22},lineStyle:{opacity:.22},areaStyle:{opacity:.08}}};if(e.type===`line`||e.type===`area`){let n=e.type===`area`?_||e.stack!==`none`?t.dark?.34:.22:.1:0;return{...l,type:`line`,data:e.data.map((e,t)=>c(t)),smooth:.35,smoothMonotone:`x`,connectNulls:!1,symbol:`circle`,showSymbol:s,symbolSize:8,sampling:v?`lttb`:void 0,lineStyle:{width:2,color:o,..._&&!v?{shadowColor:$N(o,.35),shadowBlur:10,shadowOffsetY:6}:{}},itemStyle:{color:o,borderColor:t.surface,borderWidth:2},areaStyle:n?{color:v0(o,n)}:void 0,endLabel:j?{show:!0,formatter:e=>G(Array.isArray(e.value)?e.value[1]:e.value,x),color:o,fontWeight:600,fontSize:12,distance:8,fontFamily:t.font,valueAnimation:a}:void 0,markLine:r===C?aP(e,t,!1,a):void 0}}return{...l,type:`bar`,barMaxWidth:u0,barCategoryGap:i?`28%`:`38%`,itemStyle:{color:o,borderColor:t.surface,borderWidth:e.stack===`none`?0:1},animationDelay:a?e=>e*45+r*110:0,data:e.data.map((e,t)=>({value:c(t),itemStyle:{borderRadius:KN(g,t,n.key)}})),label:e.valueLabels?{show:D,position:p?`right`:`top`,distance:6,fontFamily:t.font,fontSize:12,fontWeight:600,color:t.text,formatter:e=>e.value==null?``:G(e.value,x)}:void 0,markLine:r===C?aP(e,t,p,a):void 0}});return{...u,useUTC:m,grid:{left:4,right:j?64:i?8:16,top:e.y.label?28:D&&e.type===`column`?24:12,bottom:A?44:4,outerBoundsMode:`same`},dataZoom:A?EP(e,t,m0(t.palette,0),r.zoom):void 0,tooltip:{...l,trigger:`axis`,axisPointer:e.type===`line`||e.type===`area`?{type:`line`,lineStyle:{color:t.axis}}:{type:`shadow`,shadowStyle:{color:$N(t.neutral,t.dark?.12:.1)}},formatter:t=>DN(wN(e,(Array.isArray(t)?t:[t])[0]?.dataIndex??0,r.hidden,c))},xAxis:p?k:O,yAxis:p?O:k,series:M}}function aP(e,t,n,r){if(!e.target)return;let i=VN(e).format;return{silent:!0,symbol:`none`,animation:r,lineStyle:{color:t.label,type:[5,4],width:1},label:{position:`insideEndTop`,formatter:()=>[e.target?.label,G(e.target?.value,i)].filter(Boolean).join(` `),color:t.textMuted,fontSize:12,fontFamily:t.font,backgroundColor:t.surface,padding:[2,6],borderRadius:4},data:[n?{xAxis:e.target.value}:{yAxis:e.target.value}]}}function oP(e,t,n,r,i){let{base:a,tooltipBase:o,colours:s,compact:c}=i,l=VN(e),u=e.data.map((t,n)=>rN(e,n)),d=e.data.reduce((t,n,i)=>t+(r.hidden.has(rN(e,i))?0:K(e,l.key,i)??0),0);return{...a,tooltip:{...o,trigger:`item`,formatter:t=>DN(wN(e,t.dataIndex,r.hidden,s))},graphic:[{type:`group`,left:`center`,top:`middle`,silent:!0,children:[{type:`text`,style:{text:G(d,WM(l.format)),x:0,y:-10,align:`center`,verticalAlign:`middle`,fill:t.text,fontSize:c?18:22,fontWeight:650,fontFamily:t.font}},{type:`text`,style:{text:e.centerLabel||i0().centerLabel,x:0,y:14,align:`center`,verticalAlign:`middle`,fill:t.label,fontSize:12,fontFamily:t.font}}]}],series:[{id:l.key,name:l.key,type:`pie`,radius:c?[`50%`,`70%`]:[`54%`,`72%`],center:[`50%`,`50%`],padAngle:1.6,minAngle:3,startAngle:90,avoidLabelOverlap:!0,itemStyle:{borderRadius:6,borderColor:t.surface,borderWidth:2},animationType:`expansion`,animationDuration:1100,label:c?{show:!1}:{show:!0,position:`outside`,color:t.label,fontFamily:t.font,fontSize:12,lineHeight:16,formatter:e=>`${e.name}\n${G(e.percent/100,{style:`percent`,decimals:0})}`},labelLine:{length:10,length2:8,smooth:.2,lineStyle:{color:t.axis}},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:6,itemStyle:{shadowBlur:16,shadowColor:`rgba(0,0,0,0.18)`}},data:e.data.map((t,n)=>({name:u[n],value:K(e,l.key,n)??0,itemStyle:{color:EN(e,n,s)}}))}]}}function sP(e,t){return{...e,trigger:`item`,formatter:e=>t(e)}}function cP(e,t,n={}){return{type:`piecewise`,orient:`horizontal`,right:4,bottom:0,pieces:t.map((e,n)=>({gte:e.from,[n===t.length-1?`lte`:`lt`]:e.to,color:e.colour})),itemWidth:11,itemHeight:11,itemGap:3,itemSymbol:`roundRect`,showLabel:!1,text:[i0().moreLabel,i0().lessLabel],textGap:8,selectedMode:!1,textStyle:{color:e.label,fontSize:12,fontFamily:e.font},...n}}function lP(e,t,n,r,i){let a=VN(e),o=b0(e.data.map((t,n)=>rN(e,n))),s=sN(e),c=hN(x0(e,a.key),t.seq);return{...i.base,grid:{left:4,right:4,top:8,bottom:40,outerBoundsMode:`same`},tooltip:sP(i.tooltipBase,t=>DN(wN(e,t.dataIndex,r.hidden,i.colours))),xAxis:S0(t,o,{axisLine:{show:!1},splitArea:{show:!1}}),yAxis:S0(t,s,{inverse:!0,axisLine:{show:!1}}),visualMap:cP(t,c),series:[{type:`heatmap`,data:e.data.map((t,n)=>[o.indexOf(rN(e,n)),s.indexOf(aN(e,n)),K(e,a.key,n)??`-`]),itemStyle:{borderColor:t.surface,borderWidth:2,borderRadius:4},emphasis:{itemStyle:{borderColor:t.text,borderWidth:1.5}},progressive:0,animationDuration:800}]}}function uP(e,t){let n=e.data.map((t,n)=>iN(e,n)).filter(Number.isFinite),r=E0(n),i=D0(n),a=Math.ceil((i-r)/w0)+1,o=Math.floor((t.height-62)/7),s=Math.max(O0,Math.min(k0,o,Math.floor((t.width-44)/a))),c=Math.max(1,Math.floor((t.width-44)/s));return{cell:s,from:a>c?i-(c-1)*w0:r,to:i}}function dP(e,t,n,r,i){let a=VN(e),{cell:o,from:s,to:c}=uP(e,n),l=hN(x0(e,a.key),t.seq);return{...i.base,tooltip:sP(i.tooltipBase,t=>DN(wN(e,t.dataIndex,r.hidden,i.colours))),visualMap:cP(t,l,{right:4}),calendar:{range:[T0(s,e.timeZone),T0(c,e.timeZone)],top:24,left:34,cellSize:[o,o],splitLine:{show:!1},itemStyle:{color:t.seq[0],borderColor:t.surface,borderWidth:o<16?2:3},dayLabel:{firstDay:1,nameMap:[``,NM(1,`short`),``,NM(3,`short`),``,NM(5,`short`),``],color:t.label,fontSize:12,fontFamily:t.font,margin:8},monthLabel:{color:t.label,fontSize:12,fontFamily:t.font,margin:8},yearLabel:{show:!1}},series:[{type:`heatmap`,coordinateSystem:`calendar`,data:e.data.map((t,n)=>[T0(iN(e,n),e.timeZone),K(e,a.key,n)??`-`]),itemStyle:{borderRadius:3,borderColor:t.surface,borderWidth:2},emphasis:{itemStyle:{borderColor:t.text,borderWidth:1.5}}}]}}function fP(e,t,n,r,i){let a=VN(e),o=_N(e.data.length,t.seq),s=K(e,a.key,0);return{...i.base,tooltip:sP(i.tooltipBase,t=>DN(wN(e,t.dataIndex,r.hidden,i.colours))),series:[{type:`funnel`,sort:`none`,gap:3,left:0,right:0,top:4,bottom:4,minSize:`38%`,maxSize:`100%`,funnelAlign:`center`,animationDuration:900,itemStyle:{borderColor:t.surface,borderWidth:0,borderRadius:6},emphasis:{itemStyle:{shadowBlur:14,shadowColor:`rgba(0,0,0,0.18)`}},label:{show:!0,position:`inside`,fontFamily:t.font,lineHeight:17},data:e.data.map((n,r)=>{let i=tP(o[r],t),c=K(e,a.key,r),l=r?CM(i0().funnelPreviousStepText,{share:X1(c,K(e,a.key,r-1))}):CM(i0().shareOfStepText,{share:X1(c,s),first:c0(rN(e,0))});return{name:rN(e,r),value:c??0,itemStyle:{color:o[r]},label:{formatter:`{n|${c0(rN(e,r))}} {v|${c0(G(c,a.format))}}\n{p|${r?l:i0().firstStageLabel}}`,rich:{n:{color:i,fontSize:12.5,fontWeight:500,fontFamily:t.font},v:{color:i,fontSize:13,fontWeight:700,fontFamily:t.font},p:{color:$N(i,.78),fontSize:12,fontFamily:t.font}}}}})}]}}function pP(e,t,n,r,i){let a=VN(e),{min:o,max:s}=yN(e),c=K(e,a.key,0),l=c??o,u=c==null?null:vN(e,c),d=m0(t.palette,0),f=s-o||1,p=e.bands.length?e.bands.map((e,n)=>[Math.min(1,Math.max(0,(e.upTo-o)/f)),t.seq[1+Math.min(n,3)]]):[[1,t.grid]];return e.bands.length&&(p[p.length-1]?.[0]??1)<1&&p.push([1,t.grid]),{...i.base,tooltip:sP(i.tooltipBase,()=>DN(wN(e,0,r.hidden,i.colours))),series:[{type:`gauge`,startAngle:215,endAngle:-35,min:o,max:s,radius:`96%`,center:[`50%`,`58%`],splitNumber:10,pointer:{show:!1},anchor:{show:!1},progress:{show:c!=null,width:14,roundCap:!0,itemStyle:{color:d,shadowBlur:i.animate?12:0,shadowColor:$N(d,.35)}},axisLine:{roundCap:!0,lineStyle:{width:14,color:p}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:!1},title:{offsetCenter:[0,`30%`],color:t.label,fontSize:12.5,fontFamily:t.font},detail:{valueAnimation:i.animate,offsetCenter:[0,`-4%`],fontFamily:t.font,formatter:e=>`{v|${c0(c==null?G(null):G(e,a.format))}}{u|/${c0(G(s,a.format))}}${u?`\n{s|${c0(u.label)}}`:``}`,rich:{v:{fontSize:36,fontWeight:650,color:t.text,fontFamily:t.font,padding:[0,2,0,0]},u:{fontSize:14,color:t.label,fontFamily:t.font,padding:[12,0,0,0]},s:{fontSize:12,color:t.label,fontFamily:t.font,padding:[8,0,0,0]}}},data:[{value:l,name:e.data[0]?.[e.x.key]==null?a.label:rN(e,0)}]}]}}function mP(e){let t=D0(e.map(e=>e.level).concat(e.map(e=>e.from),e.map(e=>e.to))),n=E0(e.filter(e=>!e.total).map(e=>Math.min(e.from,e.to)).concat(e.filter(e=>e.total).map(e=>e.value))),r=D0(e.filter(e=>!e.total).map(e=>Math.abs(e.value)));if(!(t>0)||!(n>t*.4)||!(r<t*.15))return null;let i=10**Math.floor(Math.log10(t))/10,a=Math.round(t*.08/i)*i,o=Math.floor(n*.965/i)*i;return o>a?{start:a,end:o}:null}function hP(e,t){return D0(e.flatMap(e=>String(e).split(/\s+/)).map(e=>p0(e,M0)))<=t?{interval:0,width:t,overflow:`break`}:{interval:0,rotate:45,width:j0,overflow:`truncate`}}function gP(e,t,n){let r=N0(t.length,n);return e===`all`?{...hP(t,r),hideOverlap:!1}:e===`rotate`?{interval:0,rotate:45,width:j0,overflow:`truncate`,hideOverlap:!1}:e===`ellipsis`?{interval:0,rotate:0,width:Math.max(1,r),overflow:`truncate`,hideOverlap:!1}:{hideOverlap:!0}}function _P(e,t,n){let r=N0(e.length,n),i=hP(e,r);return{nameSize:M0,valueSize:12,category:`rotate`in i?{...i,hideOverlap:!0}:i,showValues:t.every(e=>p0(e,12)<=r)}}function vP(e,t,n,r,i){let a=VN(e),o=bN(e),s=IN(e),c=mP(o),l=t=>CN(e,t.index,i.colours),u=o.map(t=>rN(e,t.index)),d=o.map(e=>e.total?G(e.value,s):TN(e.value,s)),f=o.flatMap(e=>[e.from,e.to]),p=Math.max(p0(G(D0(f),s),11),p0(G(E0(f),s),11))+8,m=_P(u,d,n.width-p-12);return{...i.base,grid:{left:4,right:8,top:28,bottom:4,outerBoundsMode:`same`},tooltip:{...i.tooltipBase,trigger:`axis`,axisPointer:{type:`shadow`,shadowStyle:{color:$N(t.neutral,.1)}},formatter:t=>DN(wN(e,(Array.isArray(t)?t:[t])[0]?.dataIndex??0,r.hidden,i.colours))},xAxis:S0(t,u,{axisLabel:{color:t.label,fontSize:m.nameSize,margin:12,...m.category}}),yAxis:C0(t,e=>G(e,s),{min:0,minInterval:XN(e.y)?1:void 0,splitNumber:5,...c?{breaks:[{start:c.start,end:c.end,gap:`6%`}],breakArea:{show:!0,itemStyle:{color:t.surface,borderColor:t.axis,borderWidth:1,borderType:`solid`,opacity:1},zigzagAmplitude:3,zigzagZ:200}}:{}}),series:[{type:`line`,step:`end`,data:o.map(e=>e.level),symbol:`none`,silent:!0,z:1,lineStyle:{color:t.axis,width:1},tooltip:{show:!1},animation:!1,emphasis:{disabled:!0}},{type:`bar`,stack:`w`,data:o.map(e=>Math.min(e.from,e.to)),silent:!0,itemStyle:{color:`transparent`},emphasis:{disabled:!0},tooltip:{show:!1},barMaxWidth:48},{name:a.key,type:`bar`,stack:`w`,z:3,barMaxWidth:48,barCategoryGap:`34%`,itemStyle:{borderRadius:5},emphasis:{itemStyle:{shadowBlur:10,shadowColor:`rgba(0,0,0,0.15)`}},animationDelay:i.animate?e=>e*140:0,label:{show:m.showValues,position:`top`,distance:6,fontFamily:t.font,fontSize:m.valueSize,fontWeight:600,color:t.text,formatter:e=>d[e.dataIndex]},data:o.map(e=>({value:Math.abs(e.to-e.from),itemStyle:{color:l(e)}}))}]}}function yP(e){let t=VN(e).key;return sN(e).map(n=>({name:n,rows:e.data.map((e,t)=>t).filter(t=>aN(e,t)===n).sort((n,r)=>(K(e,t,r)??0)-(K(e,t,n)??0)||n-r)}))}function bP(e,t,n,r,i){let a=VN(e),o=SN(e),s=[...o.values()].reduce((e,t)=>e+t,0),c=(e,t)=>{let r=(e??0)/s*n.width*n.height*.82;return r>5200&&Math.max(p0(t[0],12),p0(t[1],11.5))+20<=Math.sqrt(r)},l=yP(e).map(({name:n,rows:r},i)=>{let s=o.get(n),l=m0(t.palette,i%t.palette.length),u=tP(l,t);return{name:n,value:s,itemStyle:{color:l,borderColor:l},upperLabel:{color:u,formatter:`{n|${c0(n)}} {v|${c0(G(s,a.format))}}`,rich:{n:{fontWeight:600,fontSize:12,color:u,fontFamily:t.font},v:{fontSize:12,color:$N(u,.8),fontFamily:t.font}}},children:r.map((n,r)=>{let i=eP(l,t.surface,Math.min(.55,r*.14)),o=tP(i,t),s=K(e,a.key,n);return{name:rN(e,n),value:s,row:n,itemStyle:{color:i},label:{show:c(s,[rN(e,n),G(s,a.format)]),formatter:`{n|${c0(rN(e,n))}}\n{v|${c0(G(s,a.format))}}`,rich:{n:{color:o,fontSize:12,fontWeight:500,fontFamily:t.font,lineHeight:16},v:{color:$N(o,.82),fontSize:12,fontFamily:t.font}}}}})}});return{...i.base,tooltip:sP(i.tooltipBase,t=>t.data?.row==null?DN({title:t.name,rows:[{color:t.color,label:a.label,value:G(t.value,a.format)},{label:i0().shareOfAllLabel,value:X1(o0(t.value),s)}],foot:``}):DN(wN(e,t.data.row,r.hidden,i.colours))),series:[{type:`treemap`,roam:!1,nodeClick:!1,breadcrumb:{show:!1},left:0,right:0,top:0,bottom:0,animationDurationUpdate:700,label:{show:!0,position:`insideTopLeft`,padding:[8,10],overflow:`truncate`,fontFamily:t.font},upperLabel:{show:!0,height:28,padding:[0,10],fontFamily:t.font},levels:[{itemStyle:{borderWidth:0,gapWidth:4,borderColor:t.surface}},{itemStyle:{borderWidth:3,gapWidth:2,borderRadius:8}},{itemStyle:{borderWidth:0,gapWidth:0,borderRadius:5},emphasis:{itemStyle:{borderColor:t.text,borderWidth:0}}}],data:l}]}}function xP(e){let t=UN(e),n=e.data.map(n=>[String(n[e.x.key]),String(n[t])]),r=new Map(n.flatMap(([e,t])=>[[e,0],[t,0]]));for(let e=0;e<r.size;e+=1)for(let[e,t]of n)r.set(t,Math.max(r.get(t)??0,(r.get(e)??0)+1));return r}function SP(e,t,n,r,i){let a=VN(e),o=UN(e),s=xN(e,t.palette),c=xP(e),l=D0([...c.values()]),u=new Map,d=new Map;e.data.forEach((t,n)=>{let r=K(e,a.key,n)??0;u.set(String(t[e.x.key]),(u.get(String(t[e.x.key]))??0)+r),d.set(String(t[o]),(d.get(String(t[o]))??0)+r)});let f=e=>d.get(e)??u.get(e)??0,p=e=>({position:e,color:t.text,fontFamily:t.font,fontSize:12,formatter:e=>`{n|${c0(e.name)}}\n{v|${G(f(e.name),{style:`compact`})}}`,rich:{n:{color:t.textBody,fontSize:12,fontFamily:t.font,lineHeight:15},v:{color:t.label,fontSize:12,fontFamily:t.font}}});return{...i.base,tooltip:sP(i.tooltipBase,t=>DN(t.dataType===`edge`?wN(e,t.dataIndex,r.hidden,i.colours):{title:t.name,rows:[{color:t.color,label:a.label,value:G(f(t.name),a.format)}],foot:``})),series:[{type:`sankey`,left:0,right:0,top:6,bottom:6,nodeWidth:10,nodeGap:i.compact?10:14,nodeAlign:`justify`,draggable:!1,layoutIterations:64,animationDuration:1200,emphasis:{focus:`adjacency`,lineStyle:{opacity:.55}},itemStyle:{borderWidth:0,borderRadius:3},lineStyle:{curveness:.5},levels:Array.from({length:l+1},(e,t)=>({depth:t,label:p(t===l&&l>0?`left`:`right`)})),data:[...c.keys()].map(e=>({name:e,itemStyle:{color:s.get(e)}})),links:e.data.map(n=>({source:String(n[e.x.key]),target:String(n[o]),value:n[a.key],lineStyle:{color:s.get(String(n[e.x.key])),opacity:t.dark?.32:.26}}))}]}}function CP(e){let t=e.length,n=e.reduce((e,t)=>e+t[0],0)/t,r=e.reduce((e,t)=>e+t[1],0)/t,i=e.reduce((e,t)=>e+(t[0]-n)**2,0);if(!t||!i)return null;let a=e.reduce((e,t)=>e+(t[0]-n)*(t[1]-r),0)/i,o=E0(e.map(e=>e[1])),s=D0(e.map(e=>e[1])),c=e=>{let t=r+a*(e-n);return t<o?[e+(o-t)/a,o]:t>s?[e+(s-t)/a,s]:[e,t]};return[c(E0(e.map(e=>e[0]))),c(D0(e.map(e=>e[0])))]}function wP(e,t,n,r,i){let a=VN(e),o=sN(e),s=e.type===`bubble`,c=D0(s?e.data.map(t=>t[WN(e)]).filter(a0):[]),l=e=>Math.max(I0,(i.compact?F0:P0)*Math.sqrt(e/c)),u=t=>e.data.map((e,t)=>t).filter(n=>!e.group||aN(e,n)===t),d=(e.group?o:[null]).filter(e=>e==null||!r.hidden.has(e)).flatMap(e=>u(e)),f=e.trend?CP(d.flatMap(t=>{let n=HN(e,t)[e.x.key],r=K(e,a.key,t);return a0(n)&&r!=null?[[n,r]]:[]})):null,p=e.data.map(t=>t[e.x.key]),m=e.data.map((t,n)=>K(e,a.key,n)),[h,g]=l0(p,!1),[_,v]=l0(m,!1),y=ZN(e.y.format,e.y.min??_,e.y.max??v,4),b=ZN(e.x.format,h,g,4),x=(e.group?o:[null]).map((n,r)=>({name:n??a.key,type:`scatter`,symbolSize:s?e=>l(e[2]??NaN):i.compact?8:10,itemStyle:{color:$N(t.palette[r],.85),borderColor:t.surface,borderWidth:1.5},emphasis:{focus:`series`,scale:1.5,itemStyle:{color:t.palette[r]}},blur:{itemStyle:{opacity:.15}},animationDelay:i.animate?e=>e*6+r*120:0,data:u(n).map(t=>({value:[HN(e,t)[e.x.key],K(e,a.key,t),...s?[HN(e,t)[WN(e)]]:[]],row:t}))}));return f&&x.push({name:i0().trendLabel,type:`line`,data:f,symbol:`none`,silent:!0,z:1,tooltip:{show:!1},lineStyle:{color:t.label,width:1.5,type:[6,4]},emphasis:{disabled:!0},endLabel:{show:!0,formatter:i0().trendLabel,color:t.label,fontSize:12,fontFamily:t.font,offset:[-30,-12]}}),{...i.base,grid:{left:4,right:16,top:e.y.label?28:12,bottom:e.x.label?24:4,outerBoundsMode:`same`},tooltip:sP(i.tooltipBase,t=>t.data?.row==null?``:DN(wN(e,t.data.row,r.hidden,i.colours))),xAxis:C0(t,e=>G(e,b),{scale:!0,minInterval:XN(e.x)?1:void 0,splitLine:{show:!1},axisLine:{show:!0,lineStyle:{color:t.axis}},...e.x.label?{name:e.x.label,nameLocation:`middle`,nameGap:28,nameTextStyle:{color:t.label,fontSize:12,fontFamily:t.font}}:{}}),yAxis:C0(t,e=>G(e,y),{min:e.y.min,max:e.y.max,minInterval:XN(e.y)?1:void 0,...e.y.label?{name:e.y.label,nameLocation:`end`,nameGap:12,nameTextStyle:{color:t.label,fontSize:12,fontFamily:t.font,align:`left`}}:{}}),series:x}}function TP(e,t,n,r,i){let a=e.x.kind===`time`,o=e.series.length,s=(n.height-6-z0)/o,c=s-L0-R0,l=m0(t.palette,0),u=e.data.map((t,n)=>rN(e,n)),d=e.series.flatMap((n,r)=>{let i=x0(e,n.key).filter(e=>e!=null).pop();return[{text:n.label,left:0,top:6+r*s,textStyle:{fontSize:12.5,fontWeight:600,color:t.text,fontFamily:t.font}},{text:CM(i0().latestText,{latest:G(i,n.format)}),right:8,top:7+r*s,textStyle:{fontSize:12,fontWeight:500,color:t.label,fontFamily:t.font}}]}),f=(t,n)=>{let r=K(e,t.key,n);return a?[y0(iN(e,n),e.timeZone),r]:r};return{...i.base,useUTC:a,title:d,grid:e.series.map((e,t)=>({left:52,right:8,top:6+t*s+L0,height:c})),axisPointer:{link:[{xAxisIndex:`all`}],lineStyle:{color:t.axis},label:{show:!1}},tooltip:{...i.tooltipBase,trigger:`axis`,axisPointer:{type:`line`,lineStyle:{color:t.axis}},formatter:t=>DN(wN(e,(Array.isArray(t)?t:[t])[0]?.dataIndex??0,r.hidden,i.colours))},xAxis:e.series.map((n,r)=>({...a?{type:`time`}:S0(t,u,{boundaryGap:!1}),gridIndex:r,axisLine:{lineStyle:{color:r===o-1?t.axis:t.grid}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{show:r===o-1,color:t.label,fontSize:12,hideOverlap:!0,margin:10,...a?{formatter:nP(e)}:{}}})),yAxis:e.series.map((n,r)=>{let[i,a]=l0(x0(e,n.key),!1),o=ZN(n.format,e.y.min??i,e.y.max??a,2);return C0(t,e=>G(e,o),{gridIndex:r,splitNumber:2,scale:e.y.min==null,min:e.y.min,max:e.y.max,minInterval:XN(n)?1:void 0,axisLabel:{color:t.label,fontSize:12,formatter:e=>G(e,o)}})}),series:e.series.map((n,r)=>({id:n.key,name:n.key,type:`line`,xAxisIndex:r,yAxisIndex:r,data:e.data.map((e,t)=>f(n,t)),smooth:.3,symbol:`circle`,showSymbol:!1,symbolSize:7,lineStyle:{width:1.75,color:l},itemStyle:{color:l,borderColor:t.surface,borderWidth:2},areaStyle:{color:v0(l,t.dark?.26:.16)},animationDelay:i.animate?r*160:0,emphasis:{disabled:!0}}))}}function EP(e,t,n,r){let i=r?.start??(e.data.length>5e3?70:0),a=r?.end??100;return[{type:`inside`,start:i,end:a},{type:`slider`,start:i,end:a,height:26,bottom:8,left:52,right:12,borderColor:`transparent`,backgroundColor:t.grid,borderRadius:6,fillerColor:$N(n,t.dark?.22:.12),handleStyle:{color:t.surface,borderColor:t.axis},moveHandleSize:0,brushSelect:!1,dataBackground:{lineStyle:{color:t.axis,width:.75},areaStyle:{color:$N(t.neutral,.15)}},selectedDataBackground:{lineStyle:{color:n,width:.75},areaStyle:{color:$N(n,.18)}},textStyle:{color:t.label,fontSize:12,fontFamily:t.font}}]}function DP(e,t,n){switch(e.type){case`scatter`:case`bubble`:{if(!e.group)return{seriesIndex:0,dataIndex:n};let t=aN(e,n),r=e.data.map((e,t)=>t).filter(n=>aN(e,n)===t);return{seriesIndex:sN(e).indexOf(t),dataIndex:r.indexOf(n)}}case`waterfall`:return{seriesIndex:2,dataIndex:n};case`sankey`:return{seriesIndex:0,dataIndex:n,dataType:`edge`,tip:!1};case`treemap`:{let t=1;for(let r of yP(e)){let e=r.rows.indexOf(n);if(e>=0)return{seriesIndex:0,dataIndex:t+1+e};t+=1+r.rows.length}return{seriesIndex:0,dataIndex:n}}case`gauge`:case`donut`:case`heatmap`:case`calendar`:case`funnel`:return{seriesIndex:0,dataIndex:n};default:return{seriesIndex:t,dataIndex:n}}}function OP(e,t){switch(e.type){case`scatter`:case`bubble`:case`treemap`:{let e=qN(t.data);return e==null?null:{series:0,row:e}}case`sankey`:return t.dataType===`edge`?{series:0,row:t.dataIndex}:null;case`waterfall`:return t.seriesIndex===2?{series:0,row:t.dataIndex}:null;case`line`:case`area`:case`column`:case`bar`:case`multiples`:return t.seriesIndex==null?null:{series:t.seriesIndex,row:t.dataIndex};default:return{series:0,row:t.dataIndex}}}function kP(e,t,n,r,{pixelRatio:i=2}={}){let a=document.createElement(`div`);a.style.cssText=`position:fixed;left:-10000px;top:0;width:${n.width}px;height:${n.height}px;`,document.body.append(a);let o=PC(a,null,{renderer:`canvas`,devicePixelRatio:i,width:n.width,height:n.height});try{return o.setOption(iP(e,t,n,{...r,renderer:`canvas`,animation:!1})),o.getDataURL({type:`png`,pixelRatio:i,backgroundColor:t.surface})}finally{o.dispose(),a.remove()}}function AP(e,{renderer:t}){let n=PC(e,null,{renderer:t}),r=!1,i=null;return{renderer:t,render(e,t,a,o,{replace:s=!1}={}){let c=r&&!s?JN(n.getOption()):null,l=iP(e,t,a,{...o,zoom:c});i=e,n.setOption(l,s||!r?{notMerge:!0}:{replaceMerge:s0}),r=!0},focusPoint(e,t){let{tip:r=!0,...a}=DP(YN(i),e,t);n.dispatchAction({type:`downplay`}),n.dispatchAction({type:`highlight`,...a}),r&&n.dispatchAction({type:`showTip`,...a})},clearFocus(){n.dispatchAction({type:`hideTip`}),n.dispatchAction({type:`downplay`})},resize(){n.resize()},flush(){n.getZr().flush()},onSelect(e){n.on(`click`,t=>{if(t.componentType!==`series`)return;let n=OP(YN(i),t);n&&e({seriesIndex:n.series,dataIndex:n.row})})},onFinished(e){n.on(`finished`,e)},dispose(){n.dispose()}}}function jP(e){return e.key===`Enter`&&e.isComposing!==!0&&e.keyCode!==229}function MP(e,t){let n=[...new Set(t)].filter(e=>e&&!t2.has(e));if(!n.length)return;let r=document.createElement(`span`);r.hidden=!0;let i=n.map(e=>{let t=document.createElement(`span`);return t.style.setProperty(`forced-color-adjust`,`none`),t.style.color=e,r.append(t),[e,t]});e.append(r);for(let[e,t]of i)t2.set(e,getComputedStyle(t).color);r.remove()}function NP(e){let t=getComputedStyle(e),n=!!$0(X0)?.matches,r=e=>t.getPropertyValue(e).trim();n&&MP(e,n2.map(r));let i=e=>n?t2.get(r(e))??r(e):r(e),a=e.closest(`[data-bs-theme], [data-theme]`)??document.documentElement,o=a.getAttribute(`data-bs-theme`)||a.getAttribute(`data-theme`),s={palette:[1,2,3,4,5,6,7,8].map(e=>i(`--color-chart-${e}`)),seq:[0,1,2,3,4,5,6].map(e=>i(`--color-chart-seq-${e}`)),neutral:i(`--color-chart-neutral`),rise:i(`--wui-chart-rise`),fall:i(`--wui-chart-fall`),grid:i(`--color-chart-grid`),axis:i(`--color-chart-axis`),label:i(`--color-chart-label`),surface:i(`--color-surface`),text:i(`--color-text`),textBody:i(`--color-text-body`),textMuted:i(`--color-text-muted`),shadow:r(`--wui-shadow-popover`),font:t.fontFamily,dark:o===`dark`||o===`auto`&&!!$0(J0)?.matches,reducedMotion:!!$0(Y0)?.matches};return!s.palette[0]&&!e2&&(e2=!0,vM(`[@webority/ui-elements] <wui-chart> found no --color-chart-* colours: load @webority/theme on the page.`)),s}function PP(e){if(r2.add(e),i2)return;let t=()=>{t2.clear();for(let e of r2)e._themeChanged()},n=()=>{t2.clear();for(let e of r2)e._themeChanged(!0)},r=new MutationObserver(t);r.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`,`data-bs-theme`,`class`]});let i=new MutationObserver(t);i.observe(document.documentElement,{attributes:!0,subtree:!0,attributeFilter:[`data-theme`,`data-bs-theme`]});let a=[[J0,t],[Y0,t],[X0,t],[Z0,t],[Q0,n]],o=[];for(let[e,t]of a){let n=$0(e);n&&o.push([n,t])}for(let[e,t]of o)e.addEventListener?.(`change`,t);window.addEventListener(`beforeprint`,n),window.addEventListener(`afterprint`,t),i2=()=>{r.disconnect(),i.disconnect();for(let[e,t]of o)e.removeEventListener?.(`change`,t);window.removeEventListener(`beforeprint`,n),window.removeEventListener(`afterprint`,t),i2=null}}function FP(e){r2.delete(e),r2.size||i2?.()}function IP(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,document.body.append(n),n.click(),n.remove()}var LP,RP,zP,BP,VP,HP,UP,WP,GP,KP,qP,JP,YP,XP,ZP,QP,$P,eF,tF,nF,rF,iF,q,aF,oF,sF,cF,lF,uF,dF,fF,pF,mF,hF,gF,_F,vF,yF,bF,xF,SF,CF,wF,TF,EF,DF,OF,kF,AF,jF,MF,NF,PF,FF,IF,LF,J,RF,zF,BF,VF,HF,UF,WF,GF,KF,qF,JF,YF,XF,ZF,QF,$F,eI,tI,nI,rI,iI,aI,oI,sI,cI,lI,uI,dI,fI,pI,mI,hI,gI,_I,vI,yI,bI,xI,SI,CI,wI,TI,EI,DI,OI,kI,AI,jI,MI,NI,PI,FI,II,LI,RI,zI,BI,VI,HI,UI,WI,GI,KI,qI,JI,YI,XI,ZI,QI,$I,eL,tL,nL,rL,iL,aL,oL,sL,cL,lL,uL,dL,fL,pL,mL,hL,gL,_L,vL,yL,bL,xL,SL,CL,wL,TL,EL,DL,OL,kL,AL,jL,ML,NL,PL,FL,IL,LL,RL,zL,BL,VL,HL,UL,WL,GL,KL,qL,JL,YL,XL,ZL,QL,$L,eR,tR,nR,rR,iR,aR,oR,sR,cR,lR,uR,dR,fR,pR,mR,hR,gR,_R,vR,yR,bR,xR,SR,CR,wR,Y,TR,ER,DR,OR,kR,AR,jR,MR,NR,PR,FR,IR,LR,RR,zR,BR,VR,HR,UR,WR,GR,KR,qR,JR,YR,XR,ZR,QR,$R,ez,tz,nz,rz,iz,az,oz,sz,cz,lz,uz,dz,fz,pz,mz,hz,gz,_z,vz,yz,bz,xz,Sz,Cz,wz,Tz,Ez,Dz,Oz,kz,Az,jz,Mz,Nz,Pz,Fz,Iz,Lz,Rz,zz,Bz,Vz,Hz,Uz,Wz,Gz,Kz,qz,Jz,Yz,Xz,Zz,Qz,$z,eB,tB,nB,rB,iB,aB,oB,sB,cB,lB,uB,dB,fB,pB,mB,hB,gB,_B,vB,yB,bB,xB,SB,CB,wB,TB,EB,DB,OB,kB,AB,jB,MB,NB,PB,FB,IB,LB,RB,zB,BB,VB,HB,UB,WB,GB,KB,qB,JB,YB,XB,ZB,QB,$B,eV,tV,nV,rV,iV,aV,oV,sV,cV,lV,uV,dV,fV,pV,mV,hV,gV,_V,vV,yV,bV,xV,SV,CV,wV,TV,EV,DV,OV,kV,AV,jV,MV,NV,PV,FV,IV,LV,RV,zV,BV,VV,HV,UV,WV,GV,KV,qV,JV,YV,XV,ZV,QV,$V,eH,tH,nH,rH,iH,aH,oH,sH,cH,lH,uH,dH,fH,pH,mH,hH,gH,_H,vH,yH,bH,xH,SH,CH,wH,TH,EH,DH,OH,kH,AH,jH,MH,NH,PH,FH,X,IH,LH,RH,zH,BH,VH,HH,UH,WH,GH,KH,qH,JH,YH,XH,ZH,QH,$H,eU,tU,nU,rU,iU,aU,oU,sU,cU,lU,uU,dU,fU,pU,mU,hU,gU,_U,vU,yU,bU,xU,SU,CU,wU,TU,EU,DU,OU,kU,AU,jU,MU,NU,PU,FU,IU,LU,RU,zU,BU,VU,HU,UU,WU,GU,KU,qU,JU,YU,XU,ZU,QU,$U,eW,tW,nW,rW,iW,aW,oW,sW,cW,lW,uW,dW,fW,pW,mW,hW,gW,_W,vW,yW,bW,xW,SW,CW,wW,TW,EW,DW,OW,kW,AW,jW,MW,NW,PW,FW,IW,LW,RW,zW,BW,VW,HW,UW,WW,GW,KW,qW,JW,YW,XW,ZW,QW,$W,eG,tG,nG,rG,iG,aG,oG,sG,cG,lG,uG,dG,fG,pG,mG,hG,gG,_G,vG,yG,bG,xG,SG,CG,wG,TG,EG,DG,OG,kG,AG,jG,MG,NG,PG,FG,IG,LG,RG,zG,BG,VG,HG,UG,WG,GG,KG,qG,JG,YG,XG,ZG,QG,$G,eK,tK,nK,rK,iK,aK,oK,sK,cK,lK,uK,dK,fK,pK,mK,hK,gK,_K,vK,yK,bK,xK,SK,CK,wK,TK,EK,DK,OK,kK,AK,jK,MK,NK,PK,Z,FK,IK,LK,RK,zK,BK,VK,HK,UK,WK,GK,KK,qK,JK,YK,XK,ZK,QK,$K,eq,tq,nq,rq,iq,aq,oq,sq,cq,lq,uq,dq,fq,pq,mq,hq,gq,_q,vq,yq,bq,xq,Sq,Cq,wq,Tq,Eq,Dq,Oq,kq,Aq,jq,Mq,Nq,Pq,Fq,Iq,Lq,Rq,zq,Bq,Vq,Hq,Uq,Wq,Gq,Kq,qq,Jq,Yq,Xq,Zq,Qq,$q,eJ,tJ,nJ,rJ,iJ,aJ,oJ,sJ,cJ,lJ,uJ,dJ,fJ,pJ,mJ,hJ,gJ,_J,vJ,yJ,bJ,xJ,SJ,CJ,wJ,TJ,EJ,DJ,OJ,kJ,AJ,jJ,MJ,NJ,PJ,FJ,IJ,LJ,RJ,zJ,BJ,VJ,HJ,UJ,WJ,GJ,KJ,qJ,JJ,YJ,XJ,ZJ,QJ,$J,eY,tY,nY,rY,iY,aY,oY,sY,cY,lY,uY,dY,fY,pY,mY,hY,gY,_Y,vY,yY,bY,xY,SY,CY,wY,TY,EY,DY,OY,kY,AY,jY,MY,NY,PY,FY,IY,LY,RY,zY,BY,VY,HY,UY,WY,GY,KY,qY,JY,YY,XY,ZY,QY,$Y,eX,tX,nX,rX,iX,aX,oX,sX,cX,lX,uX,dX,fX,pX,mX,hX,gX,_X,vX,yX,bX,xX,SX,CX,wX,TX,EX,DX,OX,kX,AX,jX,MX,NX,PX,FX,IX,LX,RX,zX,BX,VX,HX,UX,WX,GX,KX,qX,JX,YX,XX,ZX,QX,$X,eZ,tZ,nZ,rZ,iZ,aZ,oZ,sZ,cZ,lZ,uZ,dZ,fZ,pZ,mZ,hZ,gZ,_Z,vZ,yZ,bZ,xZ,SZ,CZ,wZ,TZ,EZ,DZ,OZ,kZ,AZ,jZ,MZ,NZ,PZ,FZ,IZ,LZ,RZ,zZ,BZ,VZ,HZ,UZ,WZ,GZ,KZ,qZ,JZ,YZ,XZ,ZZ,QZ,$Z,eQ,tQ,nQ,rQ,iQ,aQ,oQ,sQ,cQ,lQ,uQ,dQ,fQ,pQ,mQ,hQ,gQ,_Q,vQ,yQ,bQ,xQ,SQ,CQ,wQ,TQ,EQ,DQ,OQ,kQ,AQ,jQ,MQ,NQ,PQ,FQ,IQ,LQ,RQ,zQ,BQ,VQ,HQ,UQ,WQ,GQ,KQ,qQ,JQ,YQ,XQ,ZQ,QQ,$Q,e$,t$,n$,r$,i$,a$,o$,s$,c$,l$,u$,d$,f$,p$,m$,h$,g$,_$,v$,y$,b$,x$,S$,C$,w$,T$,E$,D$,O$,k$,A$,j$,M$,N$,P$,F$,I$,L$,R$,z$,B$,V$,H$,U$,W$,G$,K$,q$,J$,Y$,X$,Z$,Q$,$$,e1,t1,n1,r1,i1,a1,o1,s1,c1,Q,l1,u1,d1,f1,p1,m1,h1,g1,_1,v1,y1,b1,x1,S1,C1,w1,T1,E1,D1,O1,k1,A1,j1,M1,N1,P1,F1,I1,L1,R1,z1,B1,V1,H1,U1,W1,G1,K1,q1,J1,Y1,X1,Z1,Q1,$1,e0,t0,n0,r0,i0,a0,o0,s0,c0,l0,u0,d0,f0,p0,m0,h0,g0,_0,v0,y0,b0,x0,S0,C0,w0,T0,E0,D0,O0,k0,A0,j0,M0,N0,P0,F0,I0,L0,R0,z0,B0,V0,H0,U0,W0,G0,K0,q0,J0,Y0,X0,Z0,Q0,$0,e2,t2,n2,r2,i2,a2,o2,s2,c2=t((()=>{for(var e in LP=Object.defineProperty,RP=(e,t)=>{let n={};for(var r in e)LP(n,r,{get:e[r],enumerable:!0});return t||LP(n,Symbol.toStringTag,{value:`Module`}),n},zP=function(e,t){return zP=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},zP(e,t)},BP=`12px sans-serif`,VP=20,HP=100,UP=`007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N`,WP=Ea(UP),GP={createCanvas:function(){return typeof document<`u`&&document.createElement(`canvas`)},measureText:(function(){var e,t;return function(n,r){if(!e){var i=GP.createCanvas();e=i&&i.getContext(`2d`)}if(e)return t!==r&&(t=e.font=r||`12px sans-serif`),e.measureText(n);n||=``,r||=`12px sans-serif`;var a=/((?:\d+)?\.?\d*)px/.exec(r),o=a&&+a[1]||12,s=0;if(r.indexOf(`mono`)>=0)s=o*n.length;else for(var c=0;c<n.length;c++){var l=WP[n[c]];s+=l==null?o:l*o}return{width:s}}})(),loadImage:function(e,t,n){var r=new Image;return r.onload=t,r.onerror=n,r.src=e,r},getTime:function(){return Date.now?Date.now():+new Date}},KP=La([`Function`,`RegExp`,`Date`,`Error`,`CanvasGradient`,`CanvasPattern`,`Image`,`Canvas`],function(e,t){return e[`[object `+t+`]`]=!0,e},{}),qP=La([`Int8`,`Uint8`,`Uint8Clamped`,`Int16`,`Uint16`,`Int32`,`Uint32`,`Float32`,`Float64`],function(e,t){return e[`[object `+t+`Array]`]=!0,e},{}),JP=Object.prototype.toString,YP=Array.prototype,XP=YP.forEach,ZP=YP.filter,QP=YP.slice,$P=YP.map,eF=function(){}.constructor,tF=eF?eF.prototype:null,nF=`__proto__`,rF=2311,iF=2**53-1,GP.createCanvas,q=tF&&B(tF.bind)?tF.call.bind(tF.bind):Va,aF=`__ec_primitive__`,oF=function(){function e(){this.data={}}return e.prototype.delete=function(e){var t=this.has(e);return t&&delete this.data[e],t},e.prototype.has=function(e){return this.data.hasOwnProperty(e)},e.prototype.get=function(e){return this.data[e]},e.prototype.set=function(e,t){return this.data[e]=t,this},e.prototype.keys=function(){return Ba(this.data)},e.prototype.forEach=function(e){var t=this.data;for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},e}(),sF=typeof Map==`function`,cF=function(){function e(t){var n=z(t);this.data=ree();var r=this;t instanceof e?t.each(i):t&&L(t,i);function i(e,t){n?r.set(e,t):r.set(t,e)}}return e.prototype.hasKey=function(e){return this.data.has(e)},e.prototype.get=function(e){return this.data.get(e)},e.prototype.set=function(e,t){return this.data.set(e,t),t},e.prototype.each=function(e,t){this.data.forEach(function(n,r){e.call(t,n,r)})},e.prototype.keys=function(){var e=this.data.keys();return sF?Array.from(e):e},e.prototype.removeKey=function(e){this.data.delete(e)},e}(),lF=180/Math.PI,uF=function(){function e(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return e}(),dF=new(function(){function e(){this.browser=new uF,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<`u`}return e}()),typeof wx==`object`&&typeof wx.getSystemInfoSync==`function`?(dF.wxa=!0,dF.touchEventsSupported=!0):typeof document>`u`&&typeof self<`u`?dF.worker=!0:!dF.hasGlobalWindow||`Deno`in window||typeof navigator<`u`&&typeof navigator.userAgent==`string`&&navigator.userAgent.indexOf(`Node.js`)>-1?(dF.node=!0,dF.svgSupported=!0):lo(navigator.userAgent,dF),fF=`.`,pF=`___EC__COMPONENT__CONTAINER___`,mF=`___EC__EXTENDED_CLASS___`,hF=Math.round(Math.random()*10),gF=xo([[`fill`,`color`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`opacity`],[`shadowColor`]]),_F=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return gF(this,e,t)},e}(),vF=function(){function e(e){this.value=e}return e}(),yF=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new vF(e);return this.insertEntry(t),t},e.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++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),bF=function(){function e(e){this._list=new yF,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,r=this._map,i=null;if(r[e]==null){var a=n.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=n.head;n.remove(s),delete r[s.key],i=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new vF(t),o.key=e,n.insertEntry(o),r[e]=o}return i},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(t!=null)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),xF=new bF(50),SF=Wo,CF=Go,wF=function(){function e(e,t){this.x=e||0,this.y=t||0}return e.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(e,t){return this.x=e,this.y=t,this},e.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},e.prototype.scale=function(e){this.x*=e,this.y*=e},e.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},e.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},e.prototype.dot=function(e){return this.x*e.x+this.y*e.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},e.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},e.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},e.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},e.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},e.set=function(e,t,n){e.x=t,e.y=n},e.copy=function(e,t){e.x=t.x,e.y=t.y},e.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},e.lenSquare=function(e){return e.x*e.x+e.y*e.y},e.dot=function(e,t){return e.x*t.x+e.y*t.y},e.add=function(e,t,n){e.x=t.x+n.x,e.y=t.y+n.y},e.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},e.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},e.scaleAndAdd=function(e,t,n,r){e.x=t.x+n.x*r,e.y=t.y+n.y*r},e.lerp=function(e,t,n,r){var i=1-r;e.x=i*t.x+r*n.x,e.y=i*t.y+r*n.y},e}(),TF=Math.min,EF=Math.max,DF=Math.abs,OF=[`x`,`y`],kF=[`width`,`height`],AF=new wF,jF=new wF,MF=new wF,NF=new wF,PF=Zo(),FF=PF.minTv,IF=PF.maxTv,LF=[0,0],J=function(){function e(e,t,n,r){zF(this,e,t,n,r)}return e.set=function(e,t,n,r,i){return r<0&&(t+=r,r=-r),i<0&&(n+=i,i=-i),e.x=t,e.y=n,e.width=r,e.height=i,e},e.prototype.union=function(e){var t=TF(e.x,this.x),n=TF(e.y,this.y);this.width=isFinite(this.x)&&isFinite(this.width)?EF(e.x+e.width,this.x+this.width)-t:e.width,this.height=isFinite(this.y)&&isFinite(this.height)?EF(e.y+e.height,this.y+this.height)-n:e.height,this.x=t,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(e){return VF(Eo(),this,e)},e.prototype.intersect=function(t,n,r){return e.intersect(this,t,n,r)},e.intersect=function(t,n,r,i){r&&wF.set(r,0,0);var a=i&&i.outIntersectRect||null,o=i&&i.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!t||!n)return!1;t instanceof e||(t=zF(WF,t.x,t.y,t.width,t.height)),n instanceof e||(n=zF(GF,n.x,n.y,n.width,n.height));var s=!!r;PF.reset(i,s);var c=PF.touchThreshold,l=t.x+c,u=t.x+t.width-c,d=t.y+c,f=t.y+t.height-c,p=n.x+c,m=n.x+n.width-c,h=n.y+c,g=n.y+n.height-c;if(l>u||d>f||p>m||h>g)return!1;var _=!(u<p||m<l||f<h||g<d);return(s||a)&&(LF[0]=1/0,LF[1]=0,Xo(l,u,p,m,0,s,a,o),Xo(d,f,h,g,1,s,a,o),s&&wF.copy(r,_?PF.useDir?PF.dirMinTv:FF:IF)),_},e.contain=function(e,t,n){return t>=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height},e.prototype.contain=function(t,n){return e.contain(this,t,n)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(e){BF(this,e)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t?t.x:0,t?t.y:0,t?t.width:0,t?t.height:0)},e.copy=function(e,t){return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e},e.applyTransform=function(e,t,n){if(!n)e!==t&&BF(e,t);else if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var r=n[0],i=n[3],a=n[4],o=n[5];e.x=t.x*r+a,e.y=t.y*i+o,e.width=t.width*r,e.height=t.height*i,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height)}else{AF.x=MF.x=t.x,AF.y=NF.y=t.y,jF.x=NF.x=t.x+t.width,jF.y=MF.y=t.y+t.height,AF.transform(n),NF.transform(n),jF.transform(n),MF.transform(n),e.x=TF(AF.x,jF.x,MF.x,NF.x),e.y=TF(AF.y,jF.y,MF.y,NF.y);var s=EF(AF.x,jF.x,MF.x,NF.x),c=EF(AF.y,jF.y,MF.y,NF.y);e.width=s-e.x,e.height=c-e.y}},e.calculateTransform=function(e,t,n){var r=n.width/t.width,i=n.height/t.height;return e=Do(e||[]),Ao(e,e,Lo(KF,-t.x,-t.y)),Mo(e,e,Lo(KF,r,i)),Ao(e,e,Lo(KF,n.x,n.y)),e},e}(),RF=J.create,zF=J.set,BF=J.copy,VF=J.calculateTransform,HF=J.applyTransform,UF=J.contain,WF=new J(0,0,0,0),GF=new J(0,0,0,0),KF=[],JF=0,YF=5,XF=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,ZF=function(){function e(){}return e}(),QF=function(){function e(e){this.tokens=[],e&&(this.tokens=e)}return e}(),$F=function(){function e(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return e}(),eI=La(`,&?/;] `.split(``),function(e,t){return e[t]=!0,e},{}),tI=new J(0,0,0,0),nI={outIntersectRect:{},clamp:!0},rI=Do,iI=5e-5,aI=[],oI=[],sI=Eo(),cI=Math.abs,lI=function(){function e(){}return e.prototype.getLocalTransform=function(e){return uI(this,e)},e.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},e.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},e.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},e.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},e.prototype.needLocalTransform=function(){return ws(this.rotation)||ws(this.x)||ws(this.y)||ws(this.scaleX-1)||ws(this.scaleY-1)||ws(this.skewX)||ws(this.skewY)},e.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;t||e?(n||=Eo(),t?this.getLocalTransform(n):rI(n),e&&(t?ko(n,e,n):Oo(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n),this.invTransform=this.invTransform||Eo(),No(this.invTransform,n)):n&&(rI(n),this.invTransform=null)},e.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(aI);var n=aI[0]<0?-1:1,r=aI[1]<0?-1:1,i=((aI[0]-n)*t+n)/aI[0]||0,a=((aI[1]-r)*t+r)/aI[1]||0;e[0]*=i,e[1]*=i,e[2]*=a,e[3]*=a}},e.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},e.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],r=Math.atan2(e[1],e[0]),i=Math.PI/2+r-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(i),t=Math.sqrt(t),this.skewX=i,this.skewY=0,this.rotation=-r,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||Eo(),ko(oI,e.invTransform,t),t=oI);var n=this.originX,r=this.originY;(n||r)&&(sI[4]=n,sI[5]=r,ko(oI,t,sI),oI[4]-=n,oI[5]-=r,t=oI),this.setLocalTransform(t)}},e.prototype.getGlobalScale=function(e){var t=this.transform;return e||=[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},e.prototype.transformCoordToLocal=function(e,t){var n=[e,t],r=this.invTransform;return r&&qo(n,n,r),n},e.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],r=this.transform;return r&&qo(n,n,r),n},e.prototype.getLineScale=function(){var e=this.transform;return e&&cI(e[0]-1)>1e-10&&cI(e[3]-1)>1e-10?Math.sqrt(cI(e[0]*e[3]-e[2]*e[1])):1},e.prototype.copyTransform=function(e){Es(this,e)},e.getLocalTransform=function(e,t){t||=[];var n=e.originX||0,r=e.originY||0,i=e.scaleX,a=e.scaleY,o=e.anchorX,s=e.anchorY,c=e.rotation||0,l=e.x,u=e.y,d=e.skewX?Math.tan(e.skewX):0,f=e.skewY?Math.tan(-e.skewY):0;if(n||r||o||s){var p=n+o,m=r+s;t[4]=-p*i-d*m*a,t[5]=-m*a-f*p*i}else t[4]=t[5]=0;return t[0]=i,t[3]=a,t[1]=f*i,t[2]=d*a,c&&jo(t,t,c),t[4]+=n+l,t[5]+=r+u,t},e.initDefaultProps=(function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0})(),e}(),uI=lI.getLocalTransform,dI=[`x`,`y`,`originX`,`originY`,`anchorX`,`anchorY`,`rotation`,`scaleX`,`scaleY`,`skewX`,`skewY`],fI={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:1024**(e-1)},exponentialOut:function(e){return e===1?1:1-2**(-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*1024**(e-1):.5*(-(2**(-10*(e-1)))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)))},elasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*2**(-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},elasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-.5*(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)):n*2**(-10*--e)*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-fI.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?fI.bounceIn(e*2)*.5:fI.bounceOut(e*2-1)*.5+.5}},pI=Math.pow,mI=Math.sqrt,hI=1e-8,gI=1e-4,_I=mI(3),vI=1/3,yI=Po(),bI=Po(),xI=Po(),SI=/cubic-bezier\(([0-9,\.e ]+)\)/,CI=function(){function e(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||co,this.ondestroy=e.ondestroy||co,this.onrestart=e.onrestart||co,e.easing&&this.setEasing(e.easing)}return e.prototype.step=function(e,t){if(this._inited||=(this._startTime=e+this._delay,!0),this._paused)this._pausedTime+=t;else{var n=this._life,r=e-this._startTime-this._pausedTime,i=r/n;i<0&&(i=0),i=Math.min(i,1);var a=this.easingFunc,o=a?a(i):i;if(this.onframe(o),i===1){if(this.loop){var s=r%n;this._startTime=e-s,this._pausedTime=0,this.onrestart()}else return!0}return!1}},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(e){this.easing=e,this.easingFunc=B(e)?e:fI[e]||Us(e)},e}(),wI={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]},TI=new bF(20),EI=null,DI=new bF(100),OI=Math.round,kI=1e-4,AI={left:`start`,right:`end`,center:`middle`,middle:`middle`},jI=(function(){return typeof Buffer<`u`&&typeof Buffer.from==`function`?function(e){return Buffer.from(e).toString(`base64`)}:typeof btoa==`function`&&typeof unescape==`function`&&typeof encodeURIComponent==`function`?function(e){return btoa(unescape(encodeURIComponent(e)))}:function(e){return null}})(),MI=Array.prototype.slice,NI=0,PI=1,FI=2,II=3,LI=4,RI=5,zI=6,BI=[0,0,0,0],VI=function(){function e(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return e.prototype.isFinished=function(){return this._finished},e.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},e.prototype.needsAnimate=function(){return this.keyframes.length>=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var r=this.keyframes,i=r.length,a=!1,o=zI,s=t;if(Ia(t)){var c=Lc(t);o=c,(c===1&&!Wa(t[0])||c===2&&!Wa(t[0][0]))&&(a=!0)}else if(Wa(t)&&!Xa(t))o=NI;else if(V(t)){if(!isNaN(+t))o=NI;else{var l=ec(t);l&&(s=l,o=II)}}else if(Ja(t)){var u=I({},s);u.colorStops=R(t.colorStops,function(e){return{offset:e.offset,color:ec(e.color)}}),Sc(t)?o=LI:Cc(t)&&(o=RI),s=u}i===0?this.valType=o:(o!==this.valType||o===zI)&&(a=!0),this.discrete=this.discrete||a;var d={time:e,value:s,rawValue:t,percent:0};return n&&(d.easing=n,d.easingFunc=B(n)?n:fI[n]||Us(n)),r.push(d),d},e.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort(function(e,t){return e.time-t.time});for(var r=this.valType,i=n.length,a=n[i-1],o=this.discrete,s=zc(r),c=Rc(r),l=0;l<i;l++){var u=n[l],d=u.value,f=a.value;u.percent=u.time/e,o||(s&&l!==i-1?Pc(d,f,r):c&&Nc(d.colorStops,f.colorStops))}if(!o&&r!==RI&&t&&this.needsAnimate()&&t.needsAnimate()&&r===t.valType&&!t._finished){this._additiveTrack=t;for(var p=n[0].value,l=0;l<i;l++)r===NI?n[l].additiveValue=n[l].value-p:r===II?n[l].additiveValue=jc([],n[l].value,p,-1):zc(r)&&(n[l].additiveValue=r===PI?jc([],n[l].value,p,-1):Mc([],n[l].value,p,-1))}},e.prototype.step=function(e,t){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var n=this._additiveTrack!=null,r=n?`additiveValue`:`value`,i=this.valType,a=this.keyframes,o=a.length,s=this.propName,c=i===II,l,u=this._lastFr,d=Math.min,f,p;if(o===1)f=p=a[0];else{if(t<0)l=0;else if(t<this._lastFrP){for(l=d(u+1,o-1);l>=0&&!(a[l].percent<=t);l--);l=d(l,o-2)}else{for(l=u;l<o&&!(a[l].percent>t);l++);l=d(l-1,o-2)}p=a[l+1],f=a[l]}if(f&&p){this._lastFr=l,this._lastFrP=t;var m=p.percent-f.percent,h=m===0?1:d((t-f.percent)/m,1);p.easingFunc&&(h=p.easingFunc(h));var g=n?this._additiveValue:c?BI:e[s];if((zc(i)||c)&&!g&&(g=this._additiveValue=[]),this.discrete)e[s]=h<1?f.rawValue:p.rawValue;else if(zc(i))i===PI?kc(g,f[r],p[r],h):Ac(g,f[r],p[r],h);else if(Rc(i)){var _=f[r],v=p[r],y=i===LI;e[s]={type:y?`linear`:`radial`,x:Oc(_.x,v.x,h),y:Oc(_.y,v.y,h),colorStops:R(_.colorStops,function(e,t){var n=v.colorStops[t];return{offset:Oc(e.offset,n.offset,h),color:Ic(kc([],e.color,n.color,h))}}),global:v.global},y?(e[s].x2=Oc(_.x2,v.x2,h),e[s].y2=Oc(_.y2,v.y2,h)):e[s].r=Oc(_.r,v.r,h)}else if(c)kc(g,f[r],p[r],h),n||(e[s]=Ic(g));else{var b=Oc(f[r],p[r],h);n?this._additiveValue=b:e[s]=b}n&&this._addToTarget(e)}}},e.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,r=this._additiveValue;t===NI?e[n]=e[n]+r:t===II?(ec(e[n],BI),jc(BI,BI,r,1),e[n]=Ic(BI)):t===PI?jc(e[n],e[n],r,1):t===FI&&Mc(e[n],e[n],r,1)},e}(),HI=function(){function e(e,t,n,r){this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&r?Oa(`Can' use additive animation on looped animation.`):(this._additiveAnimators=r,this._allowDiscrete=n)}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(e){this._target=e},e.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,Ba(t),n)},e.prototype.whenWithKeys=function(e,t,n,r){for(var i=this._tracks,a=0;a<n.length;a++){var o=n[a],s=i[o];if(!s){s=i[o]=new VI(o);var c=void 0,l=this._getAdditiveTrack(o);if(l){var u=l.keyframes,d=u[u.length-1];c=d&&d.value,l.valType===II&&c&&(c=Ic(c))}else c=this._target[o];if(c==null)continue;e>0&&s.addKeyframe(0,Fc(c),r),this._trackKeys.push(o)}s.addKeyframe(e,Fc(t[o]),r)}return this._maxTime=Math.max(this._maxTime,e),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n<t;n++)e[n].call(this)},e.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,t=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,t)for(var n=0;n<t.length;n++)t[n].call(this)},e.prototype._setTracksFinished=function(){for(var e=this._tracks,t=this._trackKeys,n=0;n<t.length;n++)e[t[n]].setFinished()},e.prototype._getAdditiveTrack=function(e){var t,n=this._additiveAnimators;if(n)for(var r=0;r<n.length;r++){var i=n[r].getTrack(e);i&&(t=i)}return t},e.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var t=this,n=[],r=this._maxTime||0,i=0;i<this._trackKeys.length;i++){var a=this._trackKeys[i],o=this._tracks[a],s=this._getAdditiveTrack(a),c=o.keyframes,l=c.length;if(o.prepare(r,s),o.needsAnimate()){if(!this._allowDiscrete&&o.discrete){var u=c[l-1];u&&(t._target[o.propName]=u.rawValue),o.setFinished()}else n.push(o)}}if(n.length||this._force){var d=new CI({life:r,loop:this._loop,delay:this._delay||0,onframe:function(e){t._started=2;var r=t._additiveAnimators;if(r){for(var i=!1,a=0;a<r.length;a++)if(r[a]._clip){i=!0;break}i||(t._additiveAnimators=null)}for(var a=0;a<n.length;a++)n[a].step(t._target,e);var o=t._onframeCbs;if(o)for(var a=0;a<o.length;a++)o[a](t._target,e)},ondestroy:function(){t._doneCallback()}});this._clip=d,this.animation&&this.animation.addClip(d),e&&d.setEasing(e)}else this._doneCallback();return this}},e.prototype.stop=function(e){if(this._clip){var t=this._clip;e&&t.onframe(1),this._abortedCallback()}},e.prototype.delay=function(e){return this._delay=e,this},e.prototype.during=function(e){return e&&(this._onframeCbs||=[],this._onframeCbs.push(e)),this},e.prototype.done=function(e){return e&&(this._doneCbs||=[],this._doneCbs.push(e)),this},e.prototype.aborted=function(e){return e&&(this._abortedCbs||=[],this._abortedCbs.push(e)),this},e.prototype.getClip=function(){return this._clip},e.prototype.getTrack=function(e){return this._tracks[e]},e.prototype.getTracks=function(){var e=this;return R(this._trackKeys,function(t){return e._tracks[t]})},e.prototype.stopTracks=function(e,t){if(!e.length||!this._clip)return!0;for(var n=this._tracks,r=this._trackKeys,i=0;i<e.length;i++){var a=n[e[i]];a&&!a.isFinished()&&(t?a.step(this._target,1):this._started===1&&a.step(this._target,0),a.setFinished())}for(var o=!0,i=0;i<r.length;i++)if(!n[r[i]].isFinished()){o=!1;break}return o&&this._abortedCallback(),o},e.prototype.saveTo=function(e,t,n){if(e){t||=this._trackKeys;for(var r=0;r<t.length;r++){var i=t[r],a=this._tracks[i];if(a&&!a.isFinished()){var o=a.keyframes,s=o[n?0:o.length-1];s&&(e[i]=Fc(s.rawValue))}}}},e.prototype.__changeFinalValue=function(e,t){t||=Ba(e);for(var n=0;n<t.length;n++){var r=t[n],i=this._tracks[r];if(i){var a=i.keyframes;if(a.length>1){var o=a.pop();i.addKeyframe(o.time,e[r]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},e}(),UI=function(){function e(e){e&&(this._$eventProcessor=e)}return e.prototype.on=function(e,t,n,r){this._$handlers||={};var i=this._$handlers;if(typeof t==`function`&&(r=n,n=t,t=null),!n||!e)return this;var a=this._$eventProcessor;t!=null&&a&&a.normalizeQuery&&(t=a.normalizeQuery(t)),i[e]||(i[e]=[]);for(var o=0;o<i[e].length;o++)if(i[e][o].h===n)return this;var s={h:n,query:t,ctx:r||this,callAtLast:n.zrEventfulCallAtLast},c=i[e].length-1,l=i[e][c];return l&&l.callAtLast?i[e].splice(c,0,s):i[e].push(s),this},e.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length},e.prototype.off=function(e,t){var n=this._$handlers;if(!n)return this;if(!e)return this._$handlers={},this;if(t){if(n[e]){for(var r=[],i=0,a=n[e].length;i<a;i++)n[e][i].h!==t&&r.push(n[e][i]);n[e]=r}n[e]&&n[e].length===0&&delete n[e]}else delete n[e];return this},e.prototype.trigger=function(e){var t=[...arguments].slice(1);if(!this._$handlers)return this;var n=this._$handlers[e],r=this._$eventProcessor;if(n)for(var i=t.length,a=n.length,o=0;o<a;o++){var s=n[o];if(!(r&&r.filter&&s.query!=null&&!r.filter(e,s.query)))switch(i){case 0:s.h.call(s.ctx);break;case 1:s.h.call(s.ctx,t[0]);break;case 2:s.h.call(s.ctx,t[0],t[1]);break;default:s.h.apply(s.ctx,t)}}return r&&r.afterTrigger&&r.afterTrigger(e),this},e.prototype.triggerWithContext=function(e){var t=[...arguments].slice(1);if(!this._$handlers)return this;var n=this._$handlers[e],r=this._$eventProcessor;if(n)for(var i=t.length,a=t[i-1],o=n.length,s=0;s<o;s++){var c=n[s];if(!(r&&r.filter&&c.query!=null&&!r.filter(e,c.query)))switch(i){case 0:c.h.call(a);break;case 1:c.h.call(a,t[0]);break;case 2:c.h.call(a,t[0],t[1]);break;default:c.h.apply(a,t.slice(1,i-1))}}return r&&r.afterTrigger&&r.afterTrigger(e),this},e}(),WI=1,dF.hasGlobalWindow&&(WI=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1)),GI=WI,KI=.4,qI=`#333`,JI=`#ccc`,YI=`#eee`,XI=`__zr_normal__`,ZI=dI.concat([`ignore`]),QI=La(dI,function(e,t){return e[t]=!0,e},{ignore:!1}),$I={},eL=new J(0,0,0,0),tL=[],nL=function(){function e(e){this.id=Da(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return e.prototype._init=function(e){this.attr(e)},e.prototype.drift=function(e,t,n){switch(this.draggable){case`horizontal`:t=0;break;case`vertical`:e=0}var r=this.transform;r||=this.transform=[1,0,0,1,0,0],r[4]+=e,r[5]+=t,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||={};var n=this.textConfig,r=n.local,i=t.innerTransformable,a=void 0,o=void 0,s=!1;i.parent=r?this:null;var c=!1;i.copyTransform(t);var l=n.position!=null,u=n.autoOverflowArea,d=void 0;if((u||l)&&(d=eL,n.layoutRect?d.copy(n.layoutRect):d.copy(this.getBoundingRect()),r||d.applyTransform(this.transform)),l){this.calculateTextPosition?this.calculateTextPosition($I,n,d):cs($I,n,d),i.x=$I.x,i.y=$I.y,a=$I.align,o=$I.verticalAlign;var f=n.origin;if(f&&n.rotation!=null){var p=void 0,m=void 0;f===`center`?(p=d.width*.5,m=d.height*.5):(p=ss(f[0],d.width),m=ss(f[1],d.height)),c=!0,i.originX=-i.x+p+(r?0:d.x),i.originY=-i.y+m+(r?0:d.y)}}n.rotation!=null&&(i.rotation=n.rotation);var h=n.offset;h&&(i.x+=h[0],i.y+=h[1],c||(i.originX=-h[0],i.originY=-h[1]));var g=this._innerTextDefaultStyle||={};if(u){var _=g.overflowRect=g.overflowRect||new J(0,0,0,0);i.getLocalTransform(tL),No(tL,tL),J.copy(_,d),_.applyTransform(tL)}else g.overflowRect=null;var v=n.inside==null?typeof n.position==`string`&&n.position.indexOf(`inside`)>=0:n.inside,y=void 0,b=void 0,x=void 0;v&&this.canBeInsideText()?(y=n.insideFill,b=n.insideStroke,(y==null||y===`auto`)&&(y=this.getInsideTextFill()),(b==null||b===`auto`)&&(b=this.getInsideTextStroke(y),x=!0)):(y=n.outsideFill,b=n.outsideStroke,(y==null||y===`auto`)&&(y=this.getOutsideFill()),(b==null||b===`auto`)&&(b=this.getOutsideStroke(y),x=!0)),y||=`#000`,(y!==g.fill||b!==g.stroke||x!==g.autoStroke||a!==g.align||o!==g.verticalAlign)&&(s=!0,g.fill=y,g.stroke=b,g.autoStroke=x,g.align=a,g.verticalAlign=o,t.setDefaultTextStyle(g)),t.__dirty|=1,s&&t.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return`#fff`},e.prototype.getInsideTextStroke=function(e){return`#000`},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?JI:qI},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n=typeof t==`string`&&ec(t);n||=[255,255,255,1];for(var r=n[3],i=this.__zr.isDarkMode(),a=0;a<3;a++)n[a]=n[a]*r+(i?0:255)*(1-r);return n[3]=1,cc(n,`rgba`)},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){e===`textConfig`?this.setTextConfig(t):e===`textContent`?this.setTextContent(t):e===`clipPath`?this.setClipPath(t):e===`extra`?(this.extra=this.extra||{},I(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if(typeof e==`string`)this.attrKV(e,t);else if(H(e))for(var n=Ba(e),r=0;r<n.length;r++){var i=n[r];this.attrKV(i,e[i])}return this.markRedraw(),this},e.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var t=this._normalState,n=0;n<this.animators.length;n++){var r=this.animators[n],i=r.__fromStateTransition;if(!(r.getLoop()||i&&i!==`__zr_normal__`)){var a=r.targetName,o=a?t[a]:t;r.saveTo(o)}}},e.prototype._innerSaveToNormal=function(e){var t=this._normalState;t||=this._normalState={},e.textConfig&&!t.textConfig&&(t.textConfig=this.textConfig),this._savePrimaryToNormal(e,t,ZI)},e.prototype._savePrimaryToNormal=function(e,t,n){for(var r=0;r<n.length;r++){var i=n[r];e[i]!=null&&!(i in t)&&(t[i]=this[i])}},e.prototype.hasState=function(){return this.currentStates.length>0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(XI,!1,e)},e.prototype.useState=function(e,t,n,r){var i=e===XI;if(this.hasState()||!i){var a=this.currentStates,o=this.stateTransition;if(!(Na(a,e)>=0&&(t||a.length===1))){var s;if(this.stateProxy&&!i&&(s=this.stateProxy(e)),s||=this.states&&this.states[e],!s&&!i)Oa(`State `+e+` not exists.`);else{i||this.saveCurrentToNormalState(s);var c=this._textContent,l=qc(this,c,s,r);l&&!this.__inHover&&(this.__inHover=l),this._applyStateObj(e,s,this._normalState,t,Yc(this,n,o),o);var u=this._textGuide;return c&&c.useState(e,t,n,!!l),u&&u.useState(e,t,n,!!l),i?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this.__inHover=0,this.__dirty&=-2),s}}}},e.prototype.useStates=function(e,t,n){if(!e.length)this.clearStates();else{var r=[],i=this.currentStates,a=e.length,o=a===i.length;if(o){for(var s=0;s<a;s++)if(e[s]!==i[s]){o=!1;break}}if(o)return;for(var s=0;s<a;s++){var c=e[s],l=void 0;this.stateProxy&&(l=this.stateProxy(c,e)),l||=this.states[c],l&&r.push(l)}var u=r[a-1],d=this._textContent,f=qc(this,d,u,n);f&&!this.__inHover&&(this.__inHover=f);var p=this._mergeStates(r),m=this.stateTransition;this.saveCurrentToNormalState(p),this._applyStateObj(e.join(`,`),p,this._normalState,!1,Yc(this,t,m),m);var h=this._textGuide;d&&d.useStates(e,t,!!f),h&&h.useStates(e,t,!!f),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!f&&this.__inHover&&(this.__inHover=0,this.__dirty&=-2)}},e.prototype.isSilent=function(){for(var e=this;e;){if(e.silent)return!0;var t=e.__hostTarget;e=t?e.ignoreHostSilent?null:t:e.parent}return!1},e.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var t=this.animators[e];t.targetName&&t.changeTarget(this[t.targetName])}},e.prototype.removeState=function(e){var t=Na(this.currentStates,e);if(t>=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var r=this.currentStates.slice(),i=Na(r,e),a=Na(r,t)>=0;i>=0?a?r.splice(i,1):r[i]=t:n&&!a&&r.push(t),this.useStates(r)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t={},n,r=0;r<e.length;r++){var i=e[r];I(t,i),i.textConfig&&(n||={},I(n,i.textConfig))}return n&&(t.textConfig=n),t},e.prototype._applyStateObj=function(e,t,n,r,i,a){if(this.__inHover!==1){var o=!(t&&r);t&&t.textConfig?(this.textConfig=I({},r?this.textConfig:n.textConfig),I(this.textConfig,t.textConfig)):o&&n.textConfig&&(this.textConfig=n.textConfig);for(var s={},c=!1,l=0;l<ZI.length;l++){var u=ZI[l],d=i&&QI[u];t&&t[u]!=null?d?(c=!0,s[u]=t[u]):this[u]=t[u]:o&&n[u]!=null&&(d?(c=!0,s[u]=n[u]):this[u]=n[u])}if(!i)for(var l=0;l<this.animators.length;l++){var f=this.animators[l],p=f.targetName;f.getLoop()||f.__changeFinalValue(p?(t||n)[p]:t||n)}c&&this._transitionState(e,s,a)}},e.prototype._attachComponent=function(e){if((!e.__zr||e.__hostTarget)&&e!==this){var t=this.__zr;t&&e.addSelfToZr(t),e.__zr=t,e.__hostTarget=this}},e.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},e.prototype.getClipPath=function(){return this._clipPath},e.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},e.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},e.prototype.getTextContent=function(){return this._textContent},e.prototype.setTextContent=function(e){var t=this._textContent;t!==e&&(t&&t!==e&&this.removeTextContent(),e.innerTransformable=new lI,this._attachComponent(e),this._textContent=e,this.markRedraw())},e.prototype.setTextConfig=function(e){this.textConfig||={},I(this.textConfig,e),this.markRedraw()},e.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},e.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},e.prototype.getTextGuideLine=function(){return this._textGuide},e.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},e.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},e.prototype.markRedraw=function(){this.__dirty|=1;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},e.prototype.dirty=function(){this.markRedraw()},e.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.addAnimator(t[n]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},e.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var t=this.animators;if(t)for(var n=0;n<t.length;n++)e.animation.removeAnimator(t[n]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},e.prototype.animate=function(e,t,n){var r=new HI(e?this[e]:this,t,n);return e&&(r.targetName=e),this.addAnimator(r,e),r},e.prototype.addAnimator=function(e,t){var n=this.__zr,r=this;e.during(function(){r.updateDuringAnimation(t)}).done(function(){var t=r.animators,n=Na(t,e);n>=0&&t.splice(n,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,r=n.length,i=[],a=0;a<r;a++){var o=n[a];!e||e===o.scope?o.stop(t):i.push(o)}return this.animators=i,this},e.prototype.animateTo=function(e,t,n){Bc(this,e,t,n)},e.prototype.animateFrom=function(e,t,n){Bc(this,e,t,n,!0)},e.prototype._transitionState=function(e,t,n,r){for(var i=Bc(this,t,n,r),a=0;a<i.length;a++)i[a].__fromStateTransition=e},e.prototype.getBoundingRect=function(){return null},e.prototype.getPaintRect=function(){return null},e.initDefaultProps=(function(){var t=e.prototype;t.type=`element`,t.name=``,t.ignore=t.silent=t.ignoreHostSilent=t.isGroup=t.draggable=t.dragging=t.ignoreClip=!1,t.__inHover=0,t.__dirty=1;function n(e,n,r,i){Object.defineProperty(t,e,{get:function(){if(!this[n]){var e=this[n]=[];a(this,e)}return this[n]},set:function(e){this[r]=e[0],this[i]=e[1],this[n]=e,a(this,e)}});function a(e,t){Object.defineProperty(t,0,{get:function(){return e[r]},set:function(t){e[r]=t}}),Object.defineProperty(t,1,{get:function(){return e[i]},set:function(t){e[i]=t}})}}Object.defineProperty&&(n(`position`,`_legacyPos`,`x`,`y`),n(`scale`,`_legacyScale`,`scaleX`,`scaleY`),n(`origin`,`_legacyOrigin`,`originX`,`originY`))})(),e}(),Fa(nL,UI),Fa(nL,lI),rL=`__zr_style_`+Math.round(Math.random()*10),iL={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:`#000`,opacity:1,blend:`source-over`},aL={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}},iL[rL]=!0,oL=[`z`,`z2`,`invisible`],sL=[`invisible`],cL=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype._init=function(t){for(var n=Ba(t),r=0;r<n.length;r++){var i=n[r];i===`style`?this.useStyle(t[i]):e.prototype.attrKV.call(this,i,t[i])}this.style||this.useStyle({})},t.prototype.beforeBrush=function(e){},t.prototype.afterBrush=function(){},t.prototype.innerBeforeBrush=function(){},t.prototype.innerAfterBrush=function(){},t.prototype.shouldBePainted=function(e,t,n,r){var i=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&Xc(this,e,t)||i&&!i[0]&&!i[3])return!1;if(n&&this.__clipPaths&&this.__clipPaths.length){for(var a=0;a<this.__clipPaths.length;++a)if(this.__clipPaths[a].isZeroArea())return!1}if(r&&this.parent)for(var o=this.parent;o;){if(o.ignore)return!1;o=o.parent}return!0},t.prototype.contain=function(e,t){return this.rectContain(e,t)},t.prototype.traverse=function(e,t){e.call(t,this)},t.prototype.rectContain=function(e,t){var n=this.transformCoordToLocal(e,t);return this.getBoundingRect().contain(n[0],n[1])},t.prototype.getPaintRect=function(){var e=this._paintRect;if(!this._paintRect||this.__dirty){var t=this.transform,n=this.getBoundingRect(),r=this.style,i=r.shadowBlur||0,a=r.shadowOffsetX||0,o=r.shadowOffsetY||0;e=this._paintRect||=new J(0,0,0,0),t?J.applyTransform(e,n,t):e.copy(n),(i||a||o)&&(e.width+=i*2+Math.abs(a),e.height+=i*2+Math.abs(o),e.x=Math.min(e.x,e.x+a-i),e.y=Math.min(e.y,e.y+o-i));var s=this.dirtyRectTolerance;e.isZero()||(e.x=Math.floor(e.x-s),e.y=Math.floor(e.y-s),e.width=Math.ceil(e.width+1+s*2),e.height=Math.ceil(e.height+1+s*2))}return e},t.prototype.setPrevPaintRect=function(e){e?(this._prevPaintRect=this._prevPaintRect||new J(0,0,0,0),this._prevPaintRect.copy(e)):this._prevPaintRect=null},t.prototype.getPrevPaintRect=function(){return this._prevPaintRect},t.prototype.animateStyle=function(e){return this.animate(`style`,e)},t.prototype.updateDuringAnimation=function(e){e===`style`?this.dirtyStyle():this.markRedraw()},t.prototype.attrKV=function(t,n){t===`style`?this.style?this.setStyle(n):this.useStyle(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setStyle=function(e,t){return typeof e==`string`?this.style[e]=t:I(this.style,e),this.dirtyStyle(),this},t.prototype.dirtyStyle=function(e){e||this.markRedraw(),this.__dirty|=2,this._rect&&=null},t.prototype.dirty=function(){this.dirtyStyle()},t.prototype.styleChanged=function(){return!!(this.__dirty&2)},t.prototype.styleUpdated=function(){this.__dirty&=-3},t.prototype.createStyle=function(e){return ao(iL,e)},t.prototype.useStyle=function(e){e[rL]||(e=this.createStyle(e)),this.style=e,this.dirtyStyle()},t.prototype._useHoverStyle=function(e){this.__hoverStyle=e},t.prototype.isStyleObject=function(e){return e[rL]},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.style&&!n.style&&(n.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(t,n,oL)},t.prototype._applyStateObj=function(t,n,r,i,a,o){e.prototype._applyStateObj.call(this,t,n,r,i,a,o);var s=!(n&&i),c=this.__inHover===1,l;if(n&&n.style?a?i?l=n.style:(l=this._mergeStyle(this.createStyle(),r.style),this._mergeStyle(l,n.style)):(l=this._mergeStyle(this.createStyle(),i?this.style:r.style),this._mergeStyle(l,n.style)):s&&(l=r.style),l){if(a){var u=this.style;if(this.style=this.createStyle(s?{}:u),s)for(var d=Ba(u),f=0;f<d.length;f++){var p=d[f];p in l&&(l[p]=l[p],this.style[p]=u[p])}for(var m=Ba(l),f=0;f<m.length;f++){var p=m[f];this.style[p]=this.style[p]}this._transitionState(t,{style:l},o,this.getAnimationStyleProps())}else c?this._useHoverStyle(l):this.useStyle(l)}if(!c)for(var h=this.__inHover?sL:oL,f=0;f<h.length;f++){var p=h[f];n&&n[p]!=null?this[p]=n[p]:s&&r[p]!=null&&(this[p]=r[p])}},t.prototype._mergeStates=function(t){for(var n=e.prototype._mergeStates.call(this,t),r,i=0;i<t.length;i++){var a=t[i];a.style&&(r||={},this._mergeStyle(r,a.style))}return r&&(n.style=r),n},t.prototype._mergeStyle=function(e,t){return I(e,t),e},t.prototype.getAnimationStyleProps=function(){return aL},t.initDefaultProps=(function(){var e=t.prototype;e.type=`displayable`,e.invisible=!1,e.z=0,e.z2=0,e.zlevel=0,e.culling=!1,e.cursor=`pointer`,e.rectHover=!1,e.incremental=0,e._rect=null,e.dirtyRectTolerance=0,e.__dirty=3})(),t}(nL),lL=new J(0,0,0,0),uL=new J(0,0,0,0),dL=Math.min,fL=Math.max,pL=Math.sin,mL=Math.cos,hL=Math.PI*2,gL=Po(),_L=Po(),vL=Po(),yL=[],bL=[],xL={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},SL=[],CL=[],wL=[],TL=[],EL=[],DL=[],OL=Math.min,kL=Math.max,AL=Math.cos,jL=Math.sin,ML=Math.abs,NL=Math.PI,PL=NL*2,FL=typeof Float32Array<`u`,IL=[],LL=function(){function e(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 e.prototype.increaseVersion=function(){this._version++},e.prototype.getVersion=function(){return this._version},e.prototype.setScale=function(e,t,n){n||=0,n>0&&(this._ux=ML(n/GI/e)||0,this._uy=ML(n/GI/t)||0)},e.prototype.setDPR=function(e){this.dpr=e},e.prototype.setContext=function(e){this._ctx=e},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(xL.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},e.prototype.lineTo=function(e,t){var n=ML(e-this._xi),r=ML(t-this._yi),i=n>this._ux||r>this._uy;if(this.addData(xL.L,e,t),this._ctx&&i&&this._ctx.lineTo(e,t),i)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var a=n*n+r*r;a>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=a)}return this},e.prototype.bezierCurveTo=function(e,t,n,r,i,a){return this._drawPendingPt(),this.addData(xL.C,e,t,n,r,i,a),this._ctx&&this._ctx.bezierCurveTo(e,t,n,r,i,a),this._xi=i,this._yi=a,this},e.prototype.quadraticCurveTo=function(e,t,n,r){return this._drawPendingPt(),this.addData(xL.Q,e,t,n,r),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,r),this._xi=n,this._yi=r,this},e.prototype.arc=function(e,t,n,r,i,a){this._drawPendingPt(),IL[0]=r,IL[1]=i,nl(IL,a),r=IL[0],i=IL[1];var o=i-r;return this.addData(xL.A,e,t,n,n,r,o,0,+!a),this._ctx&&this._ctx.arc(e,t,n,r,i,a),this._xi=AL(i)*n+e,this._yi=jL(i)*n+t,this},e.prototype.arcTo=function(e,t,n,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,r,i),this},e.prototype.rect=function(e,t,n,r){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,r),this.addData(xL.R,e,t,n,r),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(xL.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},e.prototype.fill=function(e){e&&e.fill(),this.toStatic()},e.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(e){if(this._saveData){var t=e.length;!(this.data&&this.data.length===t)&&FL&&(this.data=new Float32Array(t));for(var n=0;n<t;n++)this.data[n]=e[n];this._len=t}},e.prototype.appendPath=function(e){if(this._saveData){e instanceof Array||(e=[e]);for(var t=e.length,n=0,r=this._len,i=0;i<t;i++)n+=e[i].len();var a=this.data;if(FL&&(a instanceof Float32Array||!a)&&(this.data=new Float32Array(r+n),r>0&&a))for(var o=0;o<r;o++)this.data[o]=a[o];for(var i=0;i<t;i++)for(var s=e[i].data,o=0;o<s.length;o++)this.data[r++]=s[o];this._len=r}},e.prototype.addData=function(e,t,n,r,i,a,o,s,c){if(this._saveData){var l=this.data;this._len+arguments.length>l.length&&(this._expandData(),l=this.data);for(var u=0;u<arguments.length;u++)l[this._len++]=arguments[u]}},e.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t<this._len;t++)e[t]=this.data[t];this.data=e}},e.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,FL&&this._len>11&&(this.data=new Float32Array(e)))}},e.prototype.getBoundingRect=function(){wL[0]=wL[1]=EL[0]=EL[1]=Number.MAX_VALUE,TL[0]=TL[1]=DL[0]=DL[1]=-Number.MAX_VALUE;for(var e=this.data,t=0,n=0,r=0,i=0,a=0;a<this._len;){var o=e[a++],s=a===1;switch(s&&(t=e[a],n=e[a+1],r=t,i=n),o){case xL.M:t=r=e[a++],n=i=e[a++],EL[0]=r,EL[1]=i,DL[0]=r,DL[1]=i;break;case xL.L:Zc(t,n,e[a],e[a+1],EL,DL),t=e[a++],n=e[a++];break;case xL.C:Qc(t,n,e[a++],e[a++],e[a++],e[a++],e[a],e[a+1],EL,DL),t=e[a++],n=e[a++];break;case xL.Q:$c(t,n,e[a++],e[a++],e[a],e[a+1],EL,DL),t=e[a++],n=e[a++];break;case xL.A:var c=e[a++],l=e[a++],u=e[a++],d=e[a++],f=e[a++],p=e[a++]+f;a+=1;var m=!e[a++];s&&(r=AL(f)*u+c,i=jL(f)*d+l),el(c,l,u,d,f,p,m,EL,DL),t=AL(p)*u+c,n=jL(p)*d+l;break;case xL.R:r=t=e[a++],i=n=e[a++];var h=e[a++],g=e[a++];Zc(r,i,r+h,i+g,EL,DL);break;case xL.Z:t=r,n=i}Jo(wL,wL,EL),Yo(TL,TL,DL)}return a===0&&(wL[0]=wL[1]=TL[0]=TL[1]=0),new J(wL[0],wL[1],TL[0]-wL[0],TL[1]-wL[1])},e.prototype._calculateLength=function(){var e=this.data,t=this._len,n=this._ux,r=this._uy,i=0,a=0,o=0,s=0;this._pathSegLen||=[];for(var c=this._pathSegLen,l=0,u=0,d=0;d<t;){var f=e[d++],p=d===1;p&&(i=e[d],a=e[d+1],o=i,s=a);var m=-1;switch(f){case xL.M:i=o=e[d++],a=s=e[d++];break;case xL.L:var h=e[d++],g=e[d++],_=h-i,v=g-a;(ML(_)>n||ML(v)>r||d===t-1)&&(m=Math.sqrt(_*_+v*v),i=h,a=g);break;case xL.C:var y=e[d++],b=e[d++],h=e[d++],g=e[d++],x=e[d++],S=e[d++];m=Fs(i,a,y,b,h,g,x,S,10),i=x,a=S;break;case xL.Q:var y=e[d++],b=e[d++],h=e[d++],g=e[d++];m=Hs(i,a,y,b,h,g,10),i=h,a=g;break;case xL.A:var C=e[d++],w=e[d++],T=e[d++],E=e[d++],D=e[d++],O=e[d++],k=O+D;d+=1,p&&(o=AL(D)*T+C,s=jL(D)*E+w),m=kL(T,E)*OL(PL,Math.abs(O)),i=AL(k)*T+C,a=jL(k)*E+w;break;case xL.R:o=i=e[d++],s=a=e[d++];var A=e[d++],j=e[d++];m=A*2+j*2;break;case xL.Z:var _=o-i,v=s-a;m=Math.sqrt(_*_+v*v),i=o,a=s}m>=0&&(c[u++]=m,l+=m)}return this._pathLen=l,l},e.prototype.rebuildPath=function(e,t){var n=this.data,r=this._ux,i=this._uy,a=this._len,o,s,c,l,u,d,f=t<1,p,m,h=0,g=0,_,v=0,y,b;if(!(f&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,m=this._pathLen,_=t*m,!_)))lo:for(var x=0;x<a;){var S=n[x++],C=x===1;switch(C&&(c=n[x],l=n[x+1],o=c,s=l),S!==xL.L&&v>0&&(e.lineTo(y,b),v=0),S){case xL.M:o=c=n[x++],s=l=n[x++],e.moveTo(c,l);break;case xL.L:u=n[x++],d=n[x++];var w=ML(u-c),T=ML(d-l);if(w>r||T>i){if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;e.lineTo(c*(1-D)+u*D,l*(1-D)+d*D);break lo}h+=E}e.lineTo(u,d),c=u,l=d,v=0}else{var O=w*w+T*T;O>v&&(y=u,b=d,v=O)}break;case xL.C:var k=n[x++],A=n[x++],j=n[x++],M=n[x++],ee=n[x++],te=n[x++];if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;Ns(c,k,j,ee,D,SL),Ns(l,A,M,te,D,CL),e.bezierCurveTo(SL[1],CL[1],SL[2],CL[2],SL[3],CL[3]);break lo}h+=E}e.bezierCurveTo(k,A,j,M,ee,te),c=ee,l=te;break;case xL.Q:var k=n[x++],A=n[x++],j=n[x++],M=n[x++];if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;Bs(c,k,j,D,SL),Bs(l,A,M,D,CL),e.quadraticCurveTo(SL[1],CL[1],SL[2],CL[2]);break lo}h+=E}e.quadraticCurveTo(k,A,j,M),c=j,l=M;break;case xL.A:var ne=n[x++],re=n[x++],ie=n[x++],ae=n[x++],oe=n[x++],se=n[x++],ce=n[x++],le=!n[x++],ue=ie>ae?ie:ae,de=ML(ie-ae)>.001,fe=oe+se,pe=!1;if(f){var E=p[g++];h+E>_&&(fe=oe+se*(_-h)/E,pe=!0),h+=E}if(de&&e.ellipse?e.ellipse(ne,re,ie,ae,ce,oe,fe,le):e.arc(ne,re,ue,oe,fe,le),pe)break lo;C&&(o=AL(oe)*ie+ne,s=jL(oe)*ae+re),c=AL(fe)*ie+ne,l=jL(fe)*ae+re;break;case xL.R:o=c=n[x],s=l=n[x+1],u=n[x++],d=n[x++];var me=n[x++],he=n[x++];if(f){var E=p[g++];if(h+E>_){var N=_-h;e.moveTo(u,d),e.lineTo(u+OL(N,me),d),N-=me,N>0&&e.lineTo(u+me,d+OL(N,he)),N-=he,N>0&&e.lineTo(u+kL(me-N,0),d+he),N-=me,N>0&&e.lineTo(u,d+kL(he-N,0));break lo}h+=E}e.rect(u,d,me,he);break;case xL.Z:if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;e.lineTo(c*(1-D)+o*D,l*(1-D)+s*D);break lo}h+=E}e.closePath(),c=o,l=s}}},e.prototype.clone=function(){var t=new e,n=this.data;return t.data=n.slice?n.slice():Array.prototype.slice.call(n),t._len=this._len,t},e.prototype.canSave=function(){return!!this._saveData},e.CMD=xL,e.initDefaultProps=(function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0})(),e}(),RL=Math.PI*2,zL=Math.PI*2,BL=LL.CMD,VL=Math.PI*2,HL=1e-4,UL=[-1,-1,-1],WL=[-1,-1],GL=Ma({fill:`#000`,stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:`butt`,miterLimit:10,strokeNoScale:!1,strokeFirst:!1},iL),KL={style:Ma({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},aL.style)},qL=dI.concat([`invisible`,`culling`,`z`,`z2`,`zlevel`,`parent`]),JL=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.update=function(){var n=this;e.prototype.update.call(this);var r=this.style;if(r.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(e){n.buildPath(e,n.shape)}),i.silent=!0;var a=i.style;for(var o in r)a[o]!==r[o]&&(a[o]=r[o]);a.fill=r.fill?r.decal:null,a.decal=null,a.shadowColor=null,r.strokeFirst&&(a.stroke=null);for(var s=0;s<qL.length;++s)i[qL[s]]=this[qL[s]];i.__dirty|=1}else this._decalEl&&=null},t.prototype.getDecalElement=function(){return this._decalEl},t.prototype._init=function(t){var n=Ba(t);this.shape=this.getDefaultShape();var r=this.getDefaultStyle();r&&this.useStyle(r);for(var i=0;i<n.length;i++){var a=n[i],o=t[a];a===`style`?this.style?I(this.style,o):this.useStyle(o):a===`shape`?I(this.shape,o):e.prototype.attrKV.call(this,a,o)}this.style||this.useStyle({})},t.prototype.getDefaultStyle=function(){return null},t.prototype.getDefaultShape=function(){return{}},t.prototype.canBeInsideText=function(){return this.hasFill()},t.prototype.getInsideTextFill=function(){var e=this.style.fill;if(e!==`none`){if(V(e)){var t=lc(e,0);return t>.5?qI:t>.2?YI:JI}if(e)return JI}return qI},t.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(V(t)){var n=this.__zr;if(!!(n&&n.isDarkMode())==lc(e,0)<.4)return t}},t.prototype.buildPath=function(e,t,n){},t.prototype.pathUpdated=function(){this.__dirty&=-5},t.prototype.getUpdatedPathProxy=function(e){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},t.prototype.createPathProxy=function(){this.path=new LL(!1)},t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return!(t==null||t===`none`||!(e.lineWidth>0))},t.prototype.hasFill=function(){var e=this.style.fill;return e!=null&&e!==`none`},t.prototype.getBoundingRect=function(){var e=this._rect,t=this.style,n=!e;if(n){var r=!1;this.path||(r=!0,this.createPathProxy());var i=this.path;(r||this.__dirty&4)&&(i.beginPath(),this.buildPath(i,this.shape,!1),this.pathUpdated()),e=i.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var a=this._rectStroke||=e.clone();if(this.__dirty||n){a.copy(e);var o=t.strokeNoScale?this.getLineScale():1,s=t.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;s=Math.max(s,c??4)}o>1e-10&&(a.width+=s/o,a.height+=s/o,a.x-=s/o/2,a.y-=s/o/2)}return a}return e},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect(),i=this.style;if(e=n[0],t=n[1],r.contain(e,t)){var a=this.path;if(this.hasStroke()){var o=i.lineWidth,s=i.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),gl(a,o/s,e,t)))return!0}if(this.hasFill())return hl(a,e,t)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&=null,this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate(`shape`,e)},t.prototype.updateDuringAnimation=function(e){e===`style`?this.dirtyStyle():e===`shape`?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(t,n){t===`shape`?this.setShape(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setShape=function(e,t){var n=this.shape;return n||=this.shape={},typeof e==`string`?n[e]=t:I(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&4)},t.prototype.createStyle=function(e){return ao(GL,e)},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=I({},this.shape))},t.prototype._applyStateObj=function(t,n,r,i,a,o){if(e.prototype._applyStateObj.call(this,t,n,r,i,a,o),this.__inHover!==1){var s=!(n&&i),c;if(n&&n.shape?a?i?c=n.shape:(c=I({},r.shape),I(c,n.shape)):(c=I({},i?this.shape:r.shape),I(c,n.shape)):s&&(c=r.shape),c){if(a){this.shape=I({},this.shape);for(var l={},u=Ba(c),d=0;d<u.length;d++){var f=u[d];typeof c[f]==`object`?this.shape[f]=c[f]:l[f]=c[f]}this._transitionState(t,{shape:l},o)}else this.shape=c,this.dirtyShape()}}},t.prototype._mergeStates=function(t){for(var n=e.prototype._mergeStates.call(this,t),r,i=0;i<t.length;i++){var a=t[i];a.shape&&(r||={},this._mergeStyle(r,a.shape))}return r&&(n.shape=r),n},t.prototype.getAnimationStyleProps=function(){return KL},t.prototype.isZeroArea=function(){return!1},t.extend=function(e){var n=function(t){F(n,t);function n(n){var r=t.call(this,n)||this;return e.init&&e.init.call(r,n),r}return n.prototype.getDefaultStyle=function(){return ka(e.style)},n.prototype.getDefaultShape=function(){return ka(e.shape)},n}(t);for(var r in e)typeof e[r]==`function`&&(n.prototype[r]=e[r]);return n},t.initDefaultProps=(function(){var e=t.prototype;e.type=`path`,e.strokeContainThreshold=5,e.segmentIgnoreThreshold=0,e.subPixelOptimize=!1,e.autoBatch=!1,e.__dirty=7})(),t}(cL),YL=Ma({strokeFirst:!0,font:BP,x:0,y:0,textAlign:`left`,textBaseline:`top`,miterLimit:2},GL),XL=function(e){F(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.hasStroke=function(){return Cs(this.style)},t.prototype.hasFill=function(){var e=this.style.fill;return e!=null&&e!==`none`},t.prototype.createStyle=function(e){return ao(YL,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){return this._rect||=xs(this.style),this._rect},t.initDefaultProps=(function(){var e=t.prototype;e.dirtyRectTolerance=10})(),t}(cL),XL.prototype.type=`tspan`,ZL=Ma({x:0,y:0},iL),QL={style:Ma({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},aL.style)},$L=function(e){F(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.createStyle=function(e){return ao(ZL,e)},t.prototype._getSize=function(e){var t=this.style,n=t[e];if(n!=null)return n;var r=_l(t.image)?t.image:this.__image;if(!r)return 0;var i=e===`width`?`height`:`width`,a=t[i];return a==null?r[e]:r[e]/r[i]*a},t.prototype.getWidth=function(){return this._getSize(`width`)},t.prototype.getHeight=function(){return this._getSize(`height`)},t.prototype.getAnimationStyleProps=function(){return QL},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||=new J(e.x||0,e.y||0,this.getWidth(),this.getHeight()),this._rect},t}(cL),$L.prototype.type=`image`,eR=Math.round,tR=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),nR={},rR=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new tR},t.prototype.buildPath=function(e,t){var n,r,i,a;if(this.subPixelOptimize){var o=bl(nR,t,this.style);n=o.x,r=o.y,i=o.width,a=o.height,o.r=t.r,t=o}else n=t.x,r=t.y,i=t.width,a=t.height;t.r?vl(e,t):e.rect(n,r,i,a)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(JL),rR.prototype.type=`rect`,iR={fill:`#000`},aR=2,oR={},sR={style:Ma({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},aL.style)},cR=function(e){F(t,e);function t(t){var n=e.call(this)||this;return n.type=`text`,n._children=[],n._defaultStyle=iR,n.attr(t),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t<this._children.length;t++){var n=this._children[t];n.zlevel=this.zlevel,n.z=this.z,n.z2=this.z2,n.culling=this.culling,n.cursor=this.cursor,n.invisible=this.invisible}},t.prototype.updateTransform=function(){var t=this.innerTransformable;t?(t.updateTransform(),t.transform&&(this.transform=t.transform)):e.prototype.updateTransform.call(this)},t.prototype.getLocalTransform=function(t){var n=this.innerTransformable;return n?n.getLocalTransform(t):e.prototype.getLocalTransform.call(this,t)},t.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),e.prototype.getComputedTransform.call(this)},t.prototype._updateSubTexts=function(){this._childCursor=0,Tl(this.style),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},t.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].__zr=t},t.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].__zr=null},t.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var e=new J(0,0,0,0),t=this._children,n=[],r=null,i=0;i<t.length;i++){var a=t[i],o=a.getBoundingRect(),s=a.getLocalTransform(n);s?(e.copy(o),e.applyTransform(s),r||=e.clone(),r.union(e)):(r||=o.clone(),r.union(o))}this._rect=r||e}return this._rect},t.prototype.setDefaultTextStyle=function(e){this._defaultStyle=e||iR},t.prototype.setTextContent=function(e){},t.prototype._mergeStyle=function(e,t){if(!t)return e;var n=t.rich,r=e.rich||n&&{};return I(e,t),n&&r?(this._mergeRich(r,n),e.rich=r):r&&(e.rich=r),e},t.prototype._mergeRich=function(e,t){for(var n=Ba(t),r=0;r<n.length;r++){var i=n[r];e[i]=e[i]||{},I(e[i],t[i])}},t.prototype.getAnimationStyleProps=function(){return sR},t.prototype._getOrCreateChild=function(e){var t=this._children[this._childCursor];return t&&t instanceof e||(t=new e),this._children[this._childCursor++]=t,t.__zr=this.__zr,t.parent=this,t},t.prototype._updatePlainTexts=function(){var e=this.style,t=e.font||`12px sans-serif`,n=e.padding,r=this._defaultStyle,i=e.x||0,a=e.y||0,o=e.align||r.align||`left`,s=e.verticalAlign||r.verticalAlign||`top`;ys(oR,r.overflowRect,i,a,o,s),i=oR.baseX,a=oR.baseY;var c=ps(Al(e),e,oR.outerWidth,oR.outerHeight),l=jl(e),u=!!e.backgroundColor,d=c.outerHeight,f=c.outerWidth,p=c.lines,m=c.lineHeight;this.isTruncated=!!c.isTruncated;var h=i,g=as(a,c.contentHeight,s);if(l||n){var _=is(i,f,o),v=as(a,d,s);l&&this._renderBackground(e,e,_,v,f,d)}g+=m/2,n&&(h=kl(i,o,n),s===`top`?g+=n[0]:s===`bottom`&&(g-=n[2]));for(var y=0,b=!1,x=!1,S=Ol(`fill`in e?e.fill:(x=!0,r.fill)),C=Dl(`stroke`in e?e.stroke:!u&&(!r.autoStroke||x)?(y=aR,b=!0,r.stroke):null),w=e.textShadowBlur>0,T=0;T<p.length;T++){var E=this._getOrCreateChild(XL),D=E.createStyle();E.useStyle(D),D.text=p[T],D.x=h,D.y=g,o&&(D.textAlign=o),D.textBaseline=`middle`,D.opacity=e.opacity,D.strokeFirst=!0,w&&(D.shadowBlur=e.textShadowBlur||0,D.shadowColor=e.textShadowColor||`transparent`,D.shadowOffsetX=e.textShadowOffsetX||0,D.shadowOffsetY=e.textShadowOffsetY||0),D.stroke=C,D.fill=S,C&&(D.lineWidth=e.lineWidth||y,D.lineDash=e.lineDash,D.lineDashOffset=e.lineDashOffset||0),D.font=t,Cl(D,e),g+=m,E.setBoundingRect(Ss(D,c.contentWidth,c.calculatedLineHeight,b?0:null))}},t.prototype._updateRichTexts=function(){var e=this.style,t=this._defaultStyle,n=e.align||t.align,r=e.verticalAlign||t.verticalAlign,i=e.x||0,a=e.y||0;ys(oR,t.overflowRect,i,a,n,r),i=oR.baseX,a=oR.baseY;var o=ms(Al(e),e,oR.outerWidth,oR.outerHeight,n),s=o.width,c=o.outerWidth,l=o.outerHeight,u=e.padding;this.isTruncated=!!o.isTruncated;var d=is(i,c,n),f=as(a,l,r),p=d,m=f;u&&(p+=u[3],m+=u[0]);var h=p+s;jl(e)&&this._renderBackground(e,e,d,f,c,l);for(var g=!!e.backgroundColor,_=0;_<o.lines.length;_++){for(var v=o.lines[_],y=v.tokens,b=y.length,x=v.lineHeight,S=v.width,C=0,w=p,T=h,E=b-1,D=void 0;C<b&&(D=y[C],!D.align||D.align===`left`);)this._placeToken(D,e,x,m,w,`left`,g),S-=D.width,w+=D.width,C++;for(;E>=0&&(D=y[E],D.align===`right`);)this._placeToken(D,e,x,m,T,`right`,g),S-=D.width,T-=D.width,E--;for(w+=(s-(w-p)-(h-T)-S)/2;C<=E;)D=y[C],this._placeToken(D,e,x,m,w+D.width/2,`center`,g),w+=D.width,C++;m+=x}},t.prototype._placeToken=function(e,t,n,r,i,a,o){var s=t.rich[e.styleName]||{};s.text=e.text;var c=e.verticalAlign,l=r+n/2;c===`top`?l=r+e.height/2:c===`bottom`&&(l=r+n-e.height/2),!e.isLineHolder&&jl(s)&&this._renderBackground(s,t,a===`right`?i-e.width:a===`center`?i-e.width/2:i,l-e.height/2,e.width,e.height);var u=!!s.backgroundColor,d=e.textPadding;d&&(i=kl(i,a,d),l-=e.height/2-d[0]-e.innerHeight/2);var f=this._getOrCreateChild(XL),p=f.createStyle();f.useStyle(p);var m=this._defaultStyle,h=!1,g=0,_=!1,v=Ol(`fill`in s?s.fill:`fill`in t?t.fill:(h=!0,m.fill)),y=Dl(`stroke`in s?s.stroke:`stroke`in t?t.stroke:!u&&!o&&(!m.autoStroke||h)?(g=aR,_=!0,m.stroke):null),b=s.textShadowBlur>0||t.textShadowBlur>0;p.text=e.text,p.x=i,p.y=l,b&&(p.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,p.shadowColor=s.textShadowColor||t.textShadowColor||`transparent`,p.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),p.textAlign=a,p.textBaseline=`middle`,p.font=e.font||`12px sans-serif`,p.opacity=Qa(s.opacity,t.opacity,1),Cl(p,s),y&&(p.lineWidth=Qa(s.lineWidth,t.lineWidth,g),p.lineDash=U(s.lineDash,t.lineDash),p.lineDashOffset=t.lineDashOffset||0,p.stroke=y),v&&(p.fill=v),f.setBoundingRect(Ss(p,e.contentWidth,e.contentHeight,_?0:null))},t.prototype._renderBackground=function(e,t,n,r,i,a){var o=e.backgroundColor,s=e.borderWidth,c=e.borderColor,l=o&&o.image,u=o&&!l,d=e.borderRadius,f=this,p,m;if(u||e.lineHeight||s&&c){p=this._getOrCreateChild(rR),p.useStyle(p.createStyle()),p.style.fill=null;var h=p.shape;h.x=n,h.y=r,h.width=i,h.height=a,h.r=d,p.dirtyShape()}if(u){var g=p.style;g.fill=o||null,g.fillOpacity=U(e.fillOpacity,1)}else if(l){m=this._getOrCreateChild($L),m.onload=function(){f.dirtyStyle()};var _=m.style;_.image=o.image,_.x=n,_.y=r,_.width=i,_.height=a}if(s&&c){var g=p.style;g.lineWidth=s,g.stroke=c,g.strokeOpacity=U(e.strokeOpacity,1),g.lineDash=e.borderDash,g.lineDashOffset=e.borderDashOffset||0,p.strokeContainThreshold=0,p.hasFill()&&p.hasStroke()&&(g.strokeFirst=!0,g.lineWidth*=2)}var v=(p||m).style;v.shadowBlur=e.shadowBlur||0,v.shadowColor=e.shadowColor||`transparent`,v.shadowOffsetX=e.shadowOffsetX||0,v.shadowOffsetY=e.shadowOffsetY||0,v.opacity=Qa(e.opacity,t.opacity,1)},t.makeFont=function(e){var t=``;return wl(e)&&(t=[e.fontStyle,e.fontWeight,Sl(e.fontSize),e.fontFamily||`sans-serif`].join(` `)),t&&no(t)||e.textFont||e.font},t}(cL),lR={left:!0,right:1,center:1},uR={top:1,bottom:1,middle:1},dR=[`fontStyle`,`fontWeight`,`fontSize`,`fontFamily`],fR=1e-4,pR=20,mR=Math.min,hR=Math.max,gR=Math.abs,_R=Math.round,vR=Math.floor,yR=Math.ceil,bR=Math.pow,xR=Math.log,SR=Math.LN10,CR=Math.PI,wR=Math.random,Y=Pl,TR=bR(2,53)-1,ER=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/,DR=`[ECharts] `,OR={},kR=typeof console<`u`&&console.warn&&console.log,AR=`series\0`,jR=`\0_ec_\0`,MR=`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`.split(`.`),NR=eu(),PR={useDefault:!0,enableAll:!1,enableNone:!1},FR={useDefault:!1,enableAll:!0,enableNone:!0},(function(){function e(){}return e.prototype.reset=function(e,t,n,r){return this._list=e,this._step=r||=1,this._idx=t,this._end=n??(r>0?e.length:0),this.item=null,this.key=NaN,this},e.prototype.next=function(){return(this._step>0?this._idx<this._end:this._idx>=this._end)&&(this.item=this._list[this._idx],this.key=this._idx+=this._step,!0)},e})(),IR=eu(),LR=Du(),RR=function(e,t,n,r){if(r){var i=LR(r);i.dataIndex=n,i.dataType=t,i.seriesIndex=e,i.ssrType=`chart`,r.type===`group`&&r.traverse(function(r){var i=LR(r);i.seriesIndex=e,i.dataIndex=n,i.dataType=t,i.ssrType=`chart`})}},zR=`series`,BR=W([`tooltip`,`label`,`itemName`,`itemId`,`itemGroupId`,`itemChildGroupId`,`seriesName`]),VR=`original`,HR=`arrayRows`,UR=`objectRows`,WR=`keyedColumns`,GR=`typedArray`,KR=`unknown`,qR=`column`,JR=`Roam`,YR=[`getDom`,`getZr`,`getWidth`,`getHeight`,`getDevicePixelRatio`,`dispatchAction`,`isSSR`,`isDisposed`,`on`,`off`,`getDataURL`,`getConnectedDataURL`,`getOption`,`getId`,`updateLabelLayout`],XR=function(){function e(e){L(YR,function(t){this[t]=q(e[t],e)},this)}return e}(),ZR=1,QR={},$R=Du(),ez=Du(),tz=[`emphasis`,`blur`,`select`],nz=[`normal`,`emphasis`,`blur`,`select`],rz=`highlight`,iz=`downplay`,az=`select`,oz=`unselect`,sz=`toggleSelect`,cz=`selectchanged`,lz=[`emphasis`,`blur`,`select`],uz={itemStyle:`getItemStyle`,lineStyle:`getLineStyle`,areaStyle:`getAreaStyle`},dz=LL.CMD,fz=[[],[],[]],pz=Math.sqrt,mz=Math.atan2,hz=Math.sqrt,gz=Math.sin,_z=Math.cos,vz=Math.PI,yz=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,bz=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g,xz=function(e){F(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.applyTransform=function(e){},t}(JL),Sz=function(e){F(t,e);function t(t){var n=e.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(t),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(e){return this._children[e]},t.prototype.childOfName=function(e){for(var t=this._children,n=0;n<t.length;n++)if(t[n].name===e)return t[n]},t.prototype.childCount=function(){return this._children.length},t.prototype.add=function(e){return e&&e!==this&&e.parent!==this&&(this._children.push(e),this._doAdd(e)),this},t.prototype.addBefore=function(e,t){if(e&&e!==this&&e.parent!==this&&t&&t.parent===this){var n=this._children,r=n.indexOf(t);r>=0&&(n.splice(r,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,t){var n=Na(this._children,e);return n>=0&&this.replaceAt(t,n),this},t.prototype.replaceAt=function(e,t){var n=this._children,r=n[t];if(e&&e!==this&&e.parent!==this&&e!==r){n[t]=e,r.parent=null;var i=this.__zr;i&&r.removeSelfFromZr(i),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,r=Na(n,e);return r<0||(n.splice(r,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh()),this},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;n<e.length;n++){var r=e[n];t&&r.removeSelfFromZr(t),r.parent=null}return e.length=0,this},t.prototype.eachChild=function(e,t){for(var n=this._children,r=0;r<n.length;r++){var i=n[r];e.call(t,i,r)}return this},t.prototype.traverse=function(e,t){for(var n=0;n<this._children.length;n++){var r=this._children[n],i=e.call(t,r);r.isGroup&&!i&&r.traverse(e,t)}return this},t.prototype.addSelfToZr=function(t){e.prototype.addSelfToZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].addSelfToZr(t)},t.prototype.removeSelfFromZr=function(t){e.prototype.removeSelfFromZr.call(this,t);for(var n=0;n<this._children.length;n++)this._children[n].removeSelfFromZr(t)},t.prototype.getBoundingRect=function(e){for(var t=new J(0,0,0,0),n=e||this._children,r=[],i=null,a=0;a<n.length;a++){var o=n[a];if(!(o.ignore||o.invisible)){var s=o.getBoundingRect(),c=o.getLocalTransform(r);c?(J.applyTransform(t,s,c),i||=t.clone(),i.union(t)):(i||=s.clone(),i.union(s))}}return i||t},t}(nL),Sz.prototype.type=`group`,Cz=function(){function e(){this.cx=0,this.cy=0,this.r=0}return e}(),wz=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new Cz},t.prototype.buildPath=function(e,t){e.moveTo(t.cx+t.r,t.cy),e.arc(t.cx,t.cy,t.r,0,Math.PI*2)},t}(JL),wz.prototype.type=`circle`,Tz=function(){function e(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return e}(),Ez=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new Tz},t.prototype.buildPath=function(e,t){var n=.5522848,r=t.cx,i=t.cy,a=t.rx,o=t.ry,s=a*n,c=o*n;e.moveTo(r-a,i),e.bezierCurveTo(r-a,i-c,r-s,i-o,r,i-o),e.bezierCurveTo(r+s,i-o,r+a,i-c,r+a,i),e.bezierCurveTo(r+a,i+c,r+s,i+o,r,i+o),e.bezierCurveTo(r-s,i+o,r-a,i+c,r-a,i),e.closePath()},t}(JL),Ez.prototype.type=`ellipse`,Dz=Math.PI,Oz=Dz*2,kz=Math.sin,Az=Math.cos,jz=Math.acos,Mz=Math.atan2,Nz=Math.abs,Pz=Math.sqrt,Fz=Math.max,Iz=Math.min,Lz=1e-4,Rz=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return e}(),zz=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new Rz},t.prototype.buildPath=function(e,t){af(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(JL),zz.prototype.type=`sector`,Bz=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),Vz=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new Bz},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.PI*2;e.moveTo(n+t.r,r),e.arc(n,r,t.r,0,i,!1),e.moveTo(n+t.r0,r),e.arc(n,r,t.r0,0,i,!0)},t}(JL),Vz.prototype.type=`ring`,Hz=function(){function e(){this.points=null,this.smooth=0,this.smoothConstraint=null}return e}(),Uz=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new Hz},t.prototype.buildPath=function(e,t){sf(e,t,!0)},t}(JL),Uz.prototype.type=`polygon`,Wz=function(){function e(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return e}(),Gz=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultStyle=function(){return{stroke:`#000`,fill:null}},t.prototype.getDefaultShape=function(){return new Wz},t.prototype.buildPath=function(e,t){sf(e,t,!1)},t}(JL),Gz.prototype.type=`polyline`,Kz={},qz=function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return e}(),Jz=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultStyle=function(){return{stroke:`#000`,fill:null}},t.prototype.getDefaultShape=function(){return new qz},t.prototype.buildPath=function(e,t){var n,r,i,a;if(this.subPixelOptimize){var o=yl(Kz,t,this.style);n=o.x1,r=o.y1,i=o.x2,a=o.y2}else n=t.x1,r=t.y1,i=t.x2,a=t.y2;var s=t.percent;s!==0&&(e.moveTo(n,r),s<1&&(i=n*(1-s)+i*s,a=r*(1-s)+a*s),e.lineTo(i,a))},t.prototype.pointAt=function(e){var t=this.shape;return[t.x1*(1-e)+t.x2*e,t.y1*(1-e)+t.y2*e]},t}(JL),Jz.prototype.type=`line`,Yz=[],Xz=function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1}return e}(),Zz=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultStyle=function(){return{stroke:`#000`,fill:null}},t.prototype.getDefaultShape=function(){return new Xz},t.prototype.buildPath=function(e,t){var n=t.x1,r=t.y1,i=t.x2,a=t.y2,o=t.cpx1,s=t.cpy1,c=t.cpx2,l=t.cpy2,u=t.percent;u!==0&&(e.moveTo(n,r),c==null||l==null?(u<1&&(Bs(n,o,i,u,Yz),o=Yz[1],i=Yz[2],Bs(r,s,a,u,Yz),s=Yz[1],a=Yz[2]),e.quadraticCurveTo(o,s,i,a)):(u<1&&(Ns(n,o,c,i,u,Yz),o=Yz[1],c=Yz[2],i=Yz[3],Ns(r,s,l,a,u,Yz),s=Yz[1],l=Yz[2],a=Yz[3]),e.bezierCurveTo(o,s,c,l,i,a)))},t.prototype.pointAt=function(e){return cf(this.shape,e,!1)},t.prototype.tangentAt=function(e){var t=cf(this.shape,e,!0);return Uo(t,t)},t}(JL),Zz.prototype.type=`bezier-curve`,Qz=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e}(),$z=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultStyle=function(){return{stroke:`#000`,fill:null}},t.prototype.getDefaultShape=function(){return new Qz},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r,0),a=t.startAngle,o=t.endAngle,s=t.clockwise,c=Math.cos(a),l=Math.sin(a);e.moveTo(c*i+n,l*i+r),e.arc(n,r,i,a,o,!s)},t}(JL),$z.prototype.type=`arc`,eB=function(e){F(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`compound`,t}return t.prototype._updatePathDirty=function(){for(var e=this.shape.paths,t=this.shapeChanged(),n=0;n<e.length;n++)t||=e[n].shapeChanged();t&&this.dirtyShape()},t.prototype.beforeBrush=function(){this._updatePathDirty();for(var e=this.shape.paths||[],t=this.getGlobalScale(),n=0;n<e.length;n++)e[n].path||e[n].createPathProxy(),e[n].path.setScale(t[0],t[1],e[n].segmentIgnoreThreshold)},t.prototype.buildPath=function(e,t){for(var n=t.paths||[],r=0;r<n.length;r++)n[r].buildPath(e,n[r].shape,!0)},t.prototype.afterBrush=function(){for(var e=this.shape.paths||[],t=0;t<e.length;t++)e[t].pathUpdated()},t.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),JL.prototype.getBoundingRect.call(this)},t}(JL),tB=function(){function e(e){this.colorStops=e||[]}return e.prototype.addColorStop=function(e,t){this.colorStops.push({offset:e,color:t})},e}(),nB=function(e){F(t,e);function t(t,n,r,i,a,o){var s=e.call(this,a)||this;return s.x=t??0,s.y=n??0,s.x2=r??1,s.y2=i??0,s.type=`linear`,s.global=o||!1,s}return t}(tB),rB=function(e){F(t,e);function t(t,n,r,i,a){var o=e.call(this,i)||this;return o.x=t??.5,o.y=n??.5,o.r=r??.5,o.type=`radial`,o.global=a||!1,o}return t}(tB),iB=Math.min,aB=Math.max,oB=Math.abs,sB=[0,0],cB=[0,0],lB=Zo(),uB=lB.minTv,dB=lB.maxTv,fB=function(){function e(e,t){this._corners=[],this._axes=[],this._origin=[0,0];for(var n=0;n<4;n++)this._corners[n]=new wF;for(var n=0;n<2;n++)this._axes[n]=new wF;e&&this.fromBoundingRect(e,t)}return e.prototype.fromBoundingRect=function(e,t){var n=this._corners,r=this._axes,i=e.x,a=e.y,o=i+e.width,s=a+e.height;if(n[0].set(i,a),n[1].set(o,a),n[2].set(o,s),n[3].set(i,s),t)for(var c=0;c<4;c++)n[c].transform(t);wF.sub(r[0],n[1],n[0]),wF.sub(r[1],n[3],n[0]),r[0].normalize(),r[1].normalize();for(var c=0;c<2;c++)this._origin[c]=r[c].dot(n[0])},e.prototype.intersect=function(e,t,n){var r=!0,i=!t;return t&&wF.set(t,0,0),lB.reset(n,!i),!this._intersectCheckOneSide(this,e,i,1)&&(r=!1,i)||!this._intersectCheckOneSide(e,this,i,-1)&&(r=!1,i)||!i&&!lB.negativeSize&&wF.copy(t,r?lB.useDir?lB.dirMinTv:uB:dB),r},e.prototype._intersectCheckOneSide=function(e,t,n,r){for(var i=!0,a=0;a<2;a++){var o=e._axes[a];if(e._getProjMinMaxOnAxis(a,e._corners,sB),e._getProjMinMaxOnAxis(a,t._corners,cB),lB.negativeSize||sB[1]<cB[0]||sB[0]>cB[1]){if(i=!1,lB.negativeSize||n)return i;var s=oB(cB[0]-sB[1]),c=oB(sB[0]-cB[1]);iB(s,c)>dB.len()&&(s<c?wF.scale(dB,o,-s*r):wF.scale(dB,o,c*r))}else if(!n){var s=oB(cB[0]-sB[1]),c=oB(sB[0]-cB[1]);(lB.useDir||iB(s,c)<uB.len())&&((s<c||!lB.bidirectional)&&(wF.scale(uB,o,s*r),lB.useDir&&lB.calcDirMTV()),(s>=c||!lB.bidirectional)&&(wF.scale(uB,o,-c*r),lB.useDir&&lB.calcDirMTV()))}}return i},e.prototype._getProjMinMaxOnAxis=function(e,t,n){for(var r=this._axes[e],i=this._origin,a=t[0].dot(r)+i[e],o=a,s=a,c=1;c<t.length;c++){var l=t[c].dot(r)+i[e];o=iB(l,o),s=aB(l,s)}n[0]=o+lB.touchThreshold,n[1]=s-lB.touchThreshold,lB.negativeSize=n[1]<n[0]},e}(),pB=[],mB=function(e){F(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.notClear=!0,t.incremental=1,t._displayables=[],t._temporaryDisplayables=[],t._cursor=0,t}return t.prototype.traverse=function(e,t){e.call(t,this)},t.prototype.useStyle=function(){this.style={}},t.prototype._useHoverStyle=function(){this.__hoverStyle=null},t.prototype.getCursor=function(){return this._cursor},t.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},t.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},t.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},t.prototype.addDisplayable=function(e,t){t?this._temporaryDisplayables.push(e):this._displayables.push(e),this.markRedraw()},t.prototype.addDisplayables=function(e,t){t||=!1;for(var n=0;n<e.length;n++)this.addDisplayable(e[n],t)},t.prototype.getDisplayables=function(){return this._displayables},t.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},t.prototype.eachPendingDisplayable=function(e){for(var t=this._cursor;t<this._displayables.length;t++)e&&e(this._displayables[t]);for(var t=0;t<this._temporaryDisplayables.length;t++)e&&e(this._temporaryDisplayables[t])},t.prototype.update=function(){this.updateTransform();for(var e=this._cursor;e<this._displayables.length;e++){var t=this._displayables[e];t.parent=this,t.update(),t.parent=null}for(var e=0;e<this._temporaryDisplayables.length;e++){var t=this._temporaryDisplayables[e];t.parent=this,t.update(),t.parent=null}},t.prototype.getBoundingRect=function(){if(!this._rect){for(var e=new J(1/0,1/0,-1/0,-1/0),t=0;t<this._displayables.length;t++){var n=this._displayables[t],r=n.getBoundingRect().clone();n.needLocalTransform()&&r.applyTransform(n.getLocalTransform(pB)),e.union(r)}this._rect=e}return this._rect},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t);if(this.getBoundingRect().contain(n[0],n[1])){for(var r=0;r<this._displayables.length;r++)if(this._displayables[r].contain(e,t))return!0}return!1},t}(cL),hB=Du(),gB=RP({Arc:()=>$z,BezierCurve:()=>Zz,BoundingRect:()=>J,Circle:()=>wz,CompoundPath:()=>eB,Ellipse:()=>Ez,Group:()=>Sz,HOVER_LAYER_FOR_INCREMENTAL:()=>2,HOVER_LAYER_FROM_THRESHOLD:()=>1,HOVER_LAYER_NO:()=>0,Image:()=>$L,IncrementalDisplayable:()=>mB,Line:()=>Jz,LinearGradient:()=>nB,OrientedBoundingRect:()=>fB,Path:()=>JL,Point:()=>wF,Polygon:()=>Uz,Polyline:()=>Gz,RadialGradient:()=>rB,Rect:()=>rR,Ring:()=>Vz,Sector:()=>zz,Text:()=>cR,WH:()=>yB,XY:()=>vB,applyTransform:()=>kf,calcZ2Range:()=>Xf,clipPointsByRect:()=>Pf,clipRectByRect:()=>Ff,createIcon:()=>If,decomposeTransform:()=>ep,ensureCopyRect:()=>qf,ensureCopyTransform:()=>Jf,expandOrShrinkRect:()=>Vf,extendPath:()=>yf,extendShape:()=>vf,getCurrentCanvasPainter:()=>tp,getShapeClass:()=>xf,getTransform:()=>Of,groupTransition:()=>Nf,initProps:()=>ff,isBoundingRectAxisAligned:()=>Kf,isElementRemoved:()=>pf,lineLineIntersect:()=>Rf,linePolygonIntersect:()=>Lf,makeImage:()=>Cf,makePath:()=>Sf,mergePath:()=>xB,payloadDisableAnimation:()=>$f,registerShape:()=>bf,removeElement:()=>mf,removeElementWithFadeOut:()=>gf,resizePath:()=>Tf,retrieveZInfo:()=>Yf,setTooltipConfig:()=>Uf,subPixelOptimize:()=>SB,subPixelOptimizeLine:()=>Ef,subPixelOptimizeRect:()=>Df,transformDirection:()=>Af,traverseElements:()=>Gf,traverseUpdateZ:()=>Zf,updateProps:()=>df}),_B={},vB=[`x`,`y`],yB=[`width`,`height`],bB=$d,xB=ef,SB=xl,CB=[0,0,0,0],wB=1e-5,TB=new lI,TB.transform=Eo(),bf(`circle`,wz),bf(`ellipse`,Ez),bf(`sector`,zz),bf(`ring`,Vz),bf(`polygon`,Uz),bf(`polyline`,Gz),bf(`rect`,rR),bf(`line`,Jz),bf(`bezierCurve`,Zz),bf(`arc`,$z),EB={},DB=[`fontStyle`,`fontWeight`,`fontSize`,`fontFamily`,`textShadowColor`,`textShadowBlur`,`textShadowOffsetX`,`textShadowOffsetY`],OB=[`align`,`lineHeight`,`width`,`height`,`tag`,`verticalAlign`,`ellipsis`],kB=[`padding`,`borderWidth`,`borderRadius`,`borderDashOffset`,`backgroundColor`,`borderColor`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`],AB=Du(),jB={minMargin:1,textMargin:2},MB=[`textStyle`,`color`],NB=[`fontStyle`,`fontWeight`,`fontSize`,`fontFamily`,`padding`,`lineHeight`,`rich`,`width`,`height`,`overflow`],PB=new cR,FB=function(){function e(){}return e.prototype.getTextColor=function(e){var t=this.ecModel;return this.getShallow(`color`)||(!e&&t?t.get(MB):null)},e.prototype.getFont=function(){return dp({fontStyle:this.getShallow(`fontStyle`),fontWeight:this.getShallow(`fontWeight`),fontSize:this.getShallow(`fontSize`),fontFamily:this.getShallow(`fontFamily`)},this.ecModel)},e.prototype.getTextRect=function(e){for(var t={text:e,verticalAlign:this.getShallow(`verticalAlign`)||this.getShallow(`baseline`)},n=0;n<NB.length;n++)t[NB[n]]=this.getShallow(NB[n]);return PB.useStyle(t),PB.update(),PB.getBoundingRect()},e}(),IB=[[`lineWidth`,`width`],[`stroke`,`color`],[`opacity`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`shadowColor`],[`lineDash`,`type`],[`lineDashOffset`,`dashOffset`],[`lineCap`,`cap`],[`lineJoin`,`join`],[`miterLimit`]],LB=xo(IB),RB=function(){function e(){}return e.prototype.getLineStyle=function(e){return LB(this,e)},e}(),zB=[[`fill`,`color`],[`stroke`,`borderColor`],[`lineWidth`,`borderWidth`],[`opacity`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`shadowColor`],[`lineDash`,`borderType`],[`lineDashOffset`,`borderDashOffset`],[`lineCap`,`borderCap`],[`lineJoin`,`borderJoin`],[`miterLimit`,`borderMiterLimit`]],BB=xo(zB),VB=function(){function e(){}return e.prototype.getItemStyle=function(e,t){return BB(this,e,t)},e}(),HB=function(){function e(e,t,n){this.parentModel=t,this.ecModel=n,this.option=e}return e.prototype.init=function(e,t,n){},e.prototype.mergeOption=function(e,t){Aa(this.option,e,!0)},e.prototype.get=function(e,t){return e==null?this.option:this._doGet(this.parsePath(e),!t&&this.parentModel)},e.prototype.getShallow=function(e,t){var n=this.option,r=n==null?n:n[e];if(r==null&&!t){var i=this.parentModel;i&&(r=i.getShallow(e))}return r},e.prototype.getModel=function(t,n){var r=t!=null,i=r?this.parsePath(t):null,a=r?this._doGet(i):this.option;return n||=this.parentModel&&this.parentModel.getModel(this.resolveParentPath(i)),new e(a,n,this.ecModel)},e.prototype.isEmpty=function(){return this.option==null},e.prototype.restoreData=function(){},e.prototype.clone=function(){var e=this.constructor;return new e(ka(this.option))},e.prototype.parsePath=function(e){return typeof e==`string`?e.split(`.`):e},e.prototype.resolveParentPath=function(e){return e},e.prototype.isAnimationEnabled=function(){if(!dF.node&&this.option){if(this.option.animation!=null)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},e.prototype._doGet=function(e,t){var n=this.option;if(!e)return n;for(var r=0;r<e.length&&!(e[r]&&(n=n&&typeof n==`object`?n[e[r]]:null,n==null));r++);return n==null&&t&&(n=t._doGet(this.resolveParentPath(e),t.parentModel)),n},e}(),mo(HB),_o(HB),Fa(HB,RB),Fa(HB,VB),Fa(HB,_F),Fa(HB,FB),UB=function(){function e(e,t,n,r,i,a){this._old=e,this._new=t,this._oldKeyGetter=n||hp,this._newKeyGetter=r||hp,this.context=i,this._diffModeMultiple=a===`multiple`}return e.prototype.add=function(e){return this._add=e,this},e.prototype.update=function(e){return this._update=e,this},e.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},e.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},e.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},e.prototype.remove=function(e){return this._remove=e,this},e.prototype.execute=function(){this[this._diffModeMultiple?`_executeMultiple`:`_executeOneToOne`]()},e.prototype._executeOneToOne=function(){var e=this._old,t=this._new,n={},r=Array(e.length),i=Array(t.length);this._initIndexMap(e,null,r,`_oldKeyGetter`),this._initIndexMap(t,n,i,`_newKeyGetter`);for(var a=0;a<e.length;a++){var o=r[a],s=n[o],c=mp(s);if(c>1){var l=s.shift();s.length===1&&(n[o]=s[0]),this._update&&this._update(l,a)}else c===1?(n[o]=null,this._update&&this._update(s,a)):this._remove&&this._remove(a)}this._performRestAdd(i,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},r={},i=[],a=[];this._initIndexMap(e,n,i,`_oldKeyGetter`),this._initIndexMap(t,r,a,`_newKeyGetter`);for(var o=0;o<i.length;o++){var s=i[o],c=n[s],l=r[s],u=mp(c),d=mp(l);if(u>1&&d===1)this._updateManyToOne&&this._updateManyToOne(l,c),r[s]=null;else if(u===1&&d>1)this._updateOneToMany&&this._updateOneToMany(l,c),r[s]=null;else if(u===1&&d===1)this._update&&this._update(l,c),r[s]=null;else if(u>1&&d>1)this._updateManyToMany&&this._updateManyToMany(l,c),r[s]=null;else if(u>1)for(var f=0;f<u;f++)this._remove&&this._remove(c[f]);else this._remove&&this._remove(c)}this._performRestAdd(a,r)},e.prototype._performRestAdd=function(e,t){for(var n=0;n<e.length;n++){var r=e[n],i=t[r],a=mp(i);if(a>1)for(var o=0;o<a;o++)this._add&&this._add(i[o]);else a===1&&this._add&&this._add(i);t[r]=null}},e.prototype._initIndexMap=function(e,t,n,r){for(var i=this._diffModeMultiple,a=0;a<e.length;a++){var o=`_ec_`+this[r](e[a],a);if(i||(n[a]=o),t){var s=t[o],c=mp(s);c===0?(t[o]=a,i&&n.push(o)):c===1?t[o]=[s,a]:s.push(a)}}},e}(),WB={Must:1,Might:2,Not:3},GB=Du(),KB=function(){function e(e){this.data=e.data||(e.sourceFormat===`keyedColumns`?{}:[]),this.sourceFormat=e.sourceFormat||`unknown`,this.seriesLayoutBy=e.seriesLayoutBy||`column`,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var n=0;n<t.length;n++){var r=t[n];r.type==null&&xp(this,n)===WB.Must&&(r.type=`ordinal`)}}return e}(),$B=function(){function e(e,t){var n=Cp(e)?e:Tp(e);this._source=n;var r=this._data=n.data,i=n.sourceFormat;n.seriesLayoutBy,i===`typedArray`&&(this._offset=0,this._dimSize=t,this._data=r),QB(this,r,n)}return e.prototype.getSource=function(){return this._source},e.prototype.count=function(){return 0},e.prototype.getItem=function(e,t){},e.prototype.appendData=function(e){},e.prototype.clean=function(){},e.protoInitialize=function(){var t=e.prototype;t.pure=!1,t.persistent=!0}(),e.internalField=function(){var e;QB=function(e,i,a){var o=a.sourceFormat,s=a.seriesLayoutBy,c=a.startIndex,l=a.dimensionsDefine,u=ZB[Ip(o,s)];I(e,u),o===`typedArray`?(e.getItem=t,e.count=r,e.fillStorage=n):(e.getItem=q(Np(o,s),null,i,c,l),e.count=q(Pp(o,s),null,i,c,l))};var t=function(e,t){e-=this._offset,t||=[];for(var n=this._data,r=this._dimSize,i=r*e,a=0;a<r;a++)t[a]=n[i+a];return t},n=function(e,t,n,r){for(var i=this._data,a=this._dimSize,o=0;o<a;o++){for(var s=r[o],c=s[0]==null?1/0:s[0],l=s[1]==null?-1/0:s[1],u=t-e,d=n[o],f=0;f<u;f++){var p=i[f*a+o];d[e+f]=p,p<c&&(c=p),p>l&&(l=p)}s[0]=c,s[1]=l}},r=function(){return this._data?this._data.length/this._dimSize:0};ZB=(e={},e[HR+`_`+qR]={pure:!0,appendData:i},e[HR+`_row`]={pure:!0,appendData:function(){throw Error(`Do not support appendData when set seriesLayoutBy: "row".`)}},e[UR]={pure:!0,appendData:i},e[WR]={pure:!0,appendData:function(e){var t=this._data;L(e,function(e,n){for(var r=t[n]||(t[n]=[]),i=0;i<(e||[]).length;i++)r.push(e[i])})}},e[VR]={appendData:i},e[GR]={persistent:!1,pure:!0,appendData:function(e){this._data=e},clean:function(){this._offset+=this.count(),this._data=null}},e);function i(e){for(var t=0;t<e.length;t++)this._data.push(e[t])}}(),e}(),eV=function(e){z(e)||au(`series.data or dataset.source must be an array.`)},qB={},qB[HR+`_`+qR]=eV,qB[HR+`_row`]=eV,qB[UR]=eV,qB[WR]=function(e,t){for(var n=0;n<t.length;n++)t[n].name??au(`dimension name must not be null/undefined.`)},qB[VR]=eV,tV=function(e,t,n,r){return e[r]},nV=(JB={},JB[HR+`_`+qR]=function(e,t,n,r){return e[r+t]},JB[HR+`_row`]=function(e,t,n,r,i){r+=t;for(var a=i||[],o=e,s=0;s<o.length;s++){var c=o[s];a[s]=c?c[r]:null}return a},JB[UR]=tV,JB[WR]=function(e,t,n,r,i){for(var a=i||[],o=0;o<n.length;o++){var s=n[o].name,c=s==null?null:e[s];a[o]=c?c[r]:null}return a},JB[VR]=tV,JB),rV=function(e,t,n){return e.length},iV=(YB={},YB[HR+`_`+qR]=function(e,t,n){return Math.max(0,e.length-t)},YB[HR+`_row`]=function(e,t,n){var r=e[0];return r?Math.max(0,r.length-t):0},YB[UR]=rV,YB[WR]=function(e,t,n){var r=n[0].name,i=r==null?null:e[r];return i?i.length:0},YB[VR]=rV,YB),aV=function(e,t,n){return e[t]},oV=(XB={},XB[HR]=aV,XB[UR]=function(e,t,n){return e[n]},XB[WR]=aV,XB[VR]=function(e,t,n){var r=uu(e);return r instanceof Array?r[t]:r},XB[GR]=aV,XB),sV=function(){function e(e,t){this._encode=e,this._schema=t}return e.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},e.prototype._getFullDimensionNames=function(){return this._cachedDimNames||=this._schema?this._schema.makeOutputDimensionNames():[],this._cachedDimNames},e}(),cV=function(){function e(e){this.otherDims={},e!=null&&I(this,e)}return e}(),W({number:function(e){return parseFloat(e)},time:function(e){return+ql(e)},trim:function(e){return V(e)?no(e):e}}),lV={lt:function(e,t){return e<t},lte:function(e,t){return e<=t},gt:function(e,t){return e>t},gte:function(e,t){return e>=t}},(function(){function e(e,t){Wa(t)||ou(``),this._opFn=lV[e],this._rvalFloat=Ql(t)}return e.prototype.evaluate=function(e){return Wa(e)?this._opFn(e,this._rvalFloat):this._opFn(Ql(e),this._rvalFloat)},e})(),uV=function(){function e(e,t){var n=e===`desc`;this._resultLT=n?1:-1,t??=n?`min`:`max`,this._incomparable=t===`min`?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=Wa(e)?e:Ql(e),r=Wa(t)?t:Ql(t),i=isNaN(n),a=isNaN(r);if(i&&(n=this._incomparable),a&&(r=this._incomparable),i&&a){var o=V(e),s=V(t);o&&(n=s?e:0),s&&(r=o?t:0)}return n<r?this._resultLT:n>r?-this._resultLT:0},e}(),(function(){function e(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=Ql(t)}return e.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n!==this._rvalTypeof&&(n===`number`||this._rvalTypeof===`number`)&&(t=Ql(e)===this._rvalFloat)}return this._isEQ?t:!t},e})(),dV=typeof Uint32Array>`u`?Array:Uint32Array,fV=typeof Uint16Array>`u`?Array:Uint16Array,pV=typeof Int32Array>`u`?Array:Int32Array,mV=typeof Float64Array>`u`?Array:Float64Array,hV={float:mV,int:pV,ordinal:Array,number:Array,time:mV},_V=function(){function e(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=W()}return e.prototype.initData=function(e,t,n){this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var r=e.getSource(),i=this.defaultDimValueGetter=gV[r.sourceFormat];this._dimValueGetter=n||i,this._rawExtent=[],Mp(r),this._dimensions=R(t,function(e){return{type:e.type,property:e.property}}),this._initDataFromProvider(0,e.count())},e.prototype.getProvider=function(){return this._provider},e.prototype.getSource=function(){return this._provider.getSource()},e.prototype.ensureCalculationDimension=function(e,t){var n=this._calcDimNameToIdx,r=this._dimensions,i=n.get(e);if(i!=null){if(r[i].type===t)return i}else i=r.length;return r[i]={type:t},n.set(e,i),this._chunks[i]=new hV[t||`float`](this._rawCount),this._rawExtent[i]=Lu(),i},e.prototype.collectOrdinalMeta=function(e,t){var n=this._chunks[e],r=this._dimensions[e],i=this._rawExtent,a=r.ordinalOffset||0,o=n.length;a===0&&(i[e]=Lu());for(var s=i[e],c=a;c<o;c++){var l=n[c]=t.parseAndCollect(n[c]);isNaN(l)||(s[0]=Math.min(l,s[0]),s[1]=Math.max(l,s[1]))}r.ordinalMeta=t,r.ordinalOffset=o,r.type=`ordinal`},e.prototype.getOrdinalMeta=function(e){return this._dimensions[e].ordinalMeta},e.prototype.getDimensionProperty=function(e){var t=this._dimensions[e];return t&&t.property},e.prototype.appendData=function(e){var t=this._provider,n=this.count();t.appendData(e);var r=t.count();return t.persistent||(r+=n),n<r&&this._initDataFromProvider(n,r,!0),[n,r]},e.prototype.appendValues=function(e,t){for(var n=this._chunks,r=this._dimensions,i=r.length,a=this._rawExtent,o=this.count(),s=o+Math.max(e.length,t||0),c=0;c<i;c++){var l=r[c];qp(n,c,l.type,s,!0)}for(var u=[],d=o;d<s;d++)for(var f=d-o,p=0;p<i;p++){var l=r[p],m=gV.arrayRows.call(this,e[f]||u,l.property,f,p);n[p][d]=m;var h=a[p];m<h[0]&&(h[0]=m),m>h[1]&&(h[1]=m)}return this._rawCount=this._count=s,{start:o,end:s}},e.prototype._initDataFromProvider=function(e,t,n){for(var r=this._provider,i=this._chunks,a=this._dimensions,o=a.length,s=this._rawExtent,c=R(a,function(e){return e.property}),l=0;l<o;l++){var u=a[l];s[l]||(s[l]=Lu()),qp(i,l,u.type,t,n)}if(r.fillStorage)r.fillStorage(e,t,i,s);else for(var d=[],f=e;f<t;f++){d=r.getItem(f,d);for(var p=0;p<o;p++){var m=i[p],h=this._dimValueGetter(d,c[p],f,p);m[f]=h;var g=s[p];h<g[0]&&(g[0]=h),h>g[1]&&(g[1]=h)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=t,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var n=this._chunks[e];return n?n[this.getRawIndex(t)]:NaN},e.prototype.getValues=function(e,t){var n=[],r=[];if(t==null){t=e,e=[];for(var i=0;i<this._dimensions.length;i++)r.push(i)}else r=e;for(var i=0,a=r.length;i<a;i++)n.push(this.get(r[i],t));return n},e.prototype.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var n=this._chunks[e];return n?n[t]:NaN},e.prototype.getSum=function(e){var t=this._chunks[e],n=0;if(t)for(var r=0,i=this.count();r<i;r++){var a=this.get(e,r);isNaN(a)||(n+=a)}return n},e.prototype.getMedian=function(e){var t=[];this.each([e],function(e){isNaN(e)||t.push(e)}),zl(t);var n=this.count();return n===0?0:n%2==1?t[(n-1)/2]:(t[n/2]+t[n/2-1])/2},e.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(n!=null&&n<this._count&&n===e)return e;for(var r=0,i=this._count-1;r<=i;){var a=(r+i)/2|0;if(t[a]<e)r=a+1;else if(t[a]>e)i=a-1;else return a}return-1},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,r=this._count;if(n===Array){e=new n(r);for(var i=0;i<r;i++)e[i]=t[i]}else e=new n(t.buffer,0,r)}else{var n=Gp(this._rawCount);e=new n(this.count());for(var i=0;i<e.length;i++)e[i]=i}return e},e.prototype.filter=function(e,t){if(!this._count)return this;for(var n=this.clone(),r=n.count(),i=new(Gp(n._rawCount))(r),a=[],o=e.length,s=0,c=e[0],l=n._chunks,u=0;u<r;u++){var d=void 0,f=n.getRawIndex(u);if(o===0)d=t(u);else if(o===1){var p=l[c][f];d=t(p,u)}else{for(var m=0;m<o;m++)a[m]=l[e[m]][f];a[m]=u,d=t.apply(null,a)}d&&(i[s++]=f)}return s<r&&(n._indices=i),n._count=s,n._extent=[],n._updateGetRawIdx(),n},e.prototype.selectRange=function(e){var t=this.clone(),n=t._count;if(!n)return this;var r=Ba(e),i=r.length;if(!i)return this;var a=t.count(),o=new(Gp(t._rawCount))(a),s=0,c=r[0],l=e[c][0],u=e[c][1],d=t._chunks,f=!1;if(!t._indices){var p=0;if(i===1){for(var m=d[r[0]],h=0;h<n;h++){var g=m[h];(g>=l&&g<=u||isNaN(g))&&(o[s++]=p),p++}f=!0}else if(i===2){for(var m=d[r[0]],_=d[r[1]],v=e[r[1]][0],y=e[r[1]][1],h=0;h<n;h++){var g=m[h],b=_[h];(g>=l&&g<=u||isNaN(g))&&(b>=v&&b<=y||isNaN(b))&&(o[s++]=p),p++}f=!0}}if(!f){if(i===1)for(var h=0;h<a;h++){var x=t.getRawIndex(h),g=d[r[0]][x];(g>=l&&g<=u||isNaN(g))&&(o[s++]=x)}else for(var h=0;h<a;h++){for(var S=!0,x=t.getRawIndex(h),C=0;C<i;C++){var w=r[C],g=d[w][x];(g<e[w][0]||g>e[w][1])&&(S=!1)}S&&(o[s++]=t.getRawIndex(h))}}return s<a&&(t._indices=o),t._count=s,t._extent=[],t._updateGetRawIdx(),t},e.prototype.map=function(e,t){var n=this.clone(e);return this._updateDims(n,e,t),n},e.prototype.modify=function(e,t){this._updateDims(this,e,t)},e.prototype._updateDims=function(e,t,n){for(var r=e._chunks,i=[],a=t.length,o=e.count(),s=[],c=e._rawExtent,l=0;l<t.length;l++)c[t[l]]=Lu();for(var u=0;u<o;u++){for(var d=e.getRawIndex(u),f=0;f<a;f++)s[f]=r[t[f]][d];s[a]=u;var p=n&&n.apply(null,s);if(p!=null){typeof p!=`object`&&(i[0]=p,p=i);for(var l=0;l<p.length;l++){var m=t[l],h=p[l],g=c[m],_=r[m];_&&(_[d]=h),h<g[0]&&(g[0]=h),h>g[1]&&(g[1]=h)}}}},e.prototype.lttbDownSample=function(e,t){var n=this.clone([e],!0),r=n._chunks[e],i=this.count(),a=0,o=Math.floor(1/t),s=this.getRawIndex(0),c,l,u,d=new(Gp(this._rawCount))(Math.min((Math.ceil(i/o)+2)*2,i));d[a++]=s;for(var f=1;f<i-1;f+=o){for(var p=Math.min(f+o,i-1),m=Math.min(f+o*2,i),h=(m+p)/2,g=0,_=p;_<m;_++){var v=this.getRawIndex(_),y=r[v];isNaN(y)||(g+=y)}g/=m-p;var b=f,x=Math.min(f+o,i),S=f-1,C=r[s];c=-1,u=b;for(var w=-1,T=0,_=b;_<x;_++){var v=this.getRawIndex(_),y=r[v];isNaN(y)?(T++,w<0&&(w=v)):(l=Math.abs((S-h)*(y-C)-(S-_)*(g-C)),l>c&&(c=l,u=v))}T>0&&T<x-b&&(d[a++]=Math.min(w,u),u=Math.max(w,u)),d[a++]=u,s=u}return d[a++]=this.getRawIndex(i-1),n._count=a,n._indices=d,n.getRawIndex=this._getRawIdx,n},e.prototype.minmaxDownSample=function(e,t){for(var n=this.clone([e],!0),r=n._chunks,i=Math.floor(1/t),a=r[e],o=this.count(),s=new(Gp(this._rawCount))(Math.ceil(o/i)*2),c=0,l=0;l<o;l+=i){var u=l,d=a[this.getRawIndex(u)],f=l,p=a[this.getRawIndex(f)],m=i;l+i>o&&(m=o-l);for(var h=0;h<m;h++){var g=a[this.getRawIndex(l+h)];g<d&&(d=g,u=l+h),g>p&&(p=g,f=l+h)}var _=this.getRawIndex(u),v=this.getRawIndex(f);u<f?(s[c++]=_,s[c++]=v):(s[c++]=v,s[c++]=_)}return n._count=c,n._indices=s,n._updateGetRawIdx(),n},e.prototype.downSample=function(e,t,n,r){for(var i=this.clone([e],!0),a=i._chunks,o=[],s=Math.floor(1/t),c=a[e],l=this.count(),u=i._rawExtent[e]=Lu(),d=new(Gp(this._rawCount))(Math.ceil(l/s)),f=0,p=0;p<l;p+=s){s>l-p&&(s=l-p,o.length=s);for(var m=0;m<s;m++){var h=this.getRawIndex(p+m);o[m]=c[h]}var g=n(o),_=this.getRawIndex(Math.min(p+r(o,g)||0,l-1));c[_]=g,g<u[0]&&(u[0]=g),g>u[1]&&(u[1]=g),d[f++]=_}return i._count=f,i._indices=d,i._updateGetRawIdx(),i},e.prototype.each=function(e,t){if(this._count)for(var n=e.length,r=this._chunks,i=0,a=this.count();i<a;i++){var o=this.getRawIndex(i);switch(n){case 0:t(i);break;case 1:t(r[e[0]][o],i);break;case 2:t(r[e[0]][o],r[e[1]][o],i);break;default:for(var s=0,c=[];s<n;s++)c[s]=r[e[s]][o];c[s]=i,t.apply(null,c)}}},e.prototype.getDataExtent=function(e,t){var n=this._chunks[e],r=Lu();if(!n)return r;var i=this.count();if(!this._indices&&!t)return this._rawExtent[e].slice();var a=this._extent,o=a[e]||(a[e]={}),s=Up(t),c=s.key,l=o[c];if(l)return l.slice();for(var u=r[0],d=r[1],f=0;f<i;f++){var p=n[this.getRawIndex(f)];(!t||Wp(s,p))&&(p<u&&(u=p),p>d&&(d=p))}return o[c]=[u,d]},e.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],r=this._chunks,i=0;i<r.length;i++)n.push(r[i][t]);return n},e.prototype.clone=function(t,n){var r=new e,i=this._chunks,a=t&&La(t,function(e,t){return e[t]=!0,e},{});if(a)for(var o=0;o<i.length;o++)r._chunks[o]=a[o]?Kp(i[o]):i[o];else r._chunks=i;return this._copyCommonProps(r),n||(r._indices=this._cloneIndices()),r._updateGetRawIdx(),r},e.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=ka(this._extent),e._rawExtent=ka(this._rawExtent)},e.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,t=void 0;if(e===Array){var n=this._indices.length;t=new e(n);for(var r=0;r<n;r++)t[r]=this._indices[r]}else t=new e(this._indices);return t}return null},e.prototype._getRawIdxIdentity=function(e){return e},e.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function e(e,t,n,r){return Hp(e[r],this._dimensions[r])}gV={arrayRows:e,objectRows:function(e,t,n,r){return Hp(e[t],this._dimensions[r])},keyedColumns:e,original:function(e,t,n,r){var i=e&&(e.value==null?e:e.value);return Hp(i instanceof Array?i[r]:i,this._dimensions[r])},typedArray:function(e,t,n,r){return e[r]}}}(),e}(),vV=Du(),yV={float:`f`,int:`i`,ordinal:`o`,number:`n`,time:`t`},bV=function(){function e(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return e.prototype.isDimensionOmitted=function(){return this._dimOmitted},e.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||=Xp(this.source))},e.prototype.getSourceDimensionIndex=function(e){return U(this._dimNameMap.get(e),-1)},e.prototype.getSourceDimension=function(e){var t=this.source.dimensionsDefine;if(t)return t[e]},e.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,t=Mp(this.source),n=!Zp(e),r=``,i=[],a=0,o=0;a<e;a++){var s=void 0,c=void 0,l=void 0,u=this.dimensions[o];if(u&&u.storeDimIndex===a)s=t?u.name:null,c=u.type,l=u.ordinalMeta,o++;else{var d=this.getSourceDimension(a);d&&(s=t?d.name:null,c=d.type)}i.push({property:s,type:c,ordinalMeta:l}),!t||s==null||u&&u.isCalculationCoord||(r+=n?s.replace(/\`/g,"`1").replace(/\$/g,"`2"):s),r+=`$`,r+=yV[c]||`f`,l&&(r+=l.uid),r+=`$`}var f=this.source;return{dimensions:i,hash:[f.seriesLayoutBy,f.startIndex,r].join(`$$`)}},e.prototype.makeOutputDimensionNames=function(){for(var e=[],t=0,n=0;t<this._fullDimCount;t++){var r=void 0,i=this.dimensions[n];if(i&&i.storeDimIndex===t)i.isCalculationCoord||(r=i.name),n++;else{var a=this.getSourceDimension(t);a&&(r=a.name)}e.push(r)}return e},e.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},e}(),xV=H,SV=R,CV=typeof Int32Array>`u`?Array:Int32Array,wV=`e\0\0`,TV=-1,EV=[`hasItemOption`,`_nameList`,`_idList`,`_invertedIndicesMap`,`_dimSummary`,`userOutput`,`_rawData`,`_dimValueGetter`,`_nameDimIdx`,`_idDimIdx`,`_nameRepeatCount`],DV=[`_approximateExtent`],FV=function(){function e(e,t){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`,`minmaxDownSample`,`lttbDownSample`,`map`],this.CHANGABLE_METHODS=[`filterSelf`,`selectRange`],this.DOWNSAMPLE_METHODS=[`downSample`,`minmaxDownSample`,`lttbDownSample`];var n,r=!1;Jp(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(r=!0,n=e),n||=[`x`,`y`];for(var i={},a=[],o={},s=!1,c={},l=0;l<n.length;l++){var u=n[l],d=V(u)?new cV({name:u}):u instanceof cV?u:new cV(u),f=d.name;d.type=d.type||`float`,d.coordDim||(d.coordDim=f,d.coordDimIndex=0);var p=d.otherDims=d.otherDims||{};a.push(f),i[f]=d,c[f]!=null&&(s=!0),d.createInvertedIndices&&(o[f]=[]),r&&(d.storeDimIndex=l),p.itemName===0&&(this._nameDimIdx=d.storeDimIndex),p.itemId===0&&(this._idDimIdx=d.storeDimIndex)}if(this.dimensions=a,this._dimInfos=i,this._initGetDimensionInfo(s),this.hostModel=t,this._invertedIndicesMap=o,this._dimOmitted){var m=this._dimIdxToName=W();L(a,function(e){m.set(i[e].storeDimIndex,e)})}}return e.prototype.getDimension=function(e){var t=this._recognizeDimIndex(e);if(t==null)return e;if(t=e,!this._dimOmitted)return this.dimensions[t];var n=this._dimIdxToName.get(t);if(n!=null)return n;var r=this._schema.getSourceDimension(t);if(r)return r.name},e.prototype.getDimensionIndex=function(e){var t=this._recognizeDimIndex(e);if(t!=null)return t;if(e==null)return-1;var n=this._getDimInfo(e);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},e.prototype._recognizeDimIndex=function(e){if(Wa(e)||e!=null&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},e.prototype._getStoreDimIndex=function(e){return this.getDimensionIndex(e)},e.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},e.prototype._initGetDimensionInfo=function(e){var t=this._dimInfos;this._getDimInfo=e?function(e){return t.hasOwnProperty(e)?t[e]:void 0}:function(e){return t[e]}},e.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},e.prototype.mapDimension=function(e,t){var n=this._dimSummary;if(t==null)return n.encodeFirstDimNotExtra[e];var r=n.encode[e];return r?r[t]:null},e.prototype.mapDimensionsAll=function(e){return(this._dimSummary.encode[e]||[]).slice()},e.prototype.getStore=function(){return this._store},e.prototype.initData=function(e,t,n){var r=this,i;if(e instanceof _V&&(i=e),!i){var a=this.dimensions,o=Cp(e)||Ia(e)?new $B(e,a.length):e;i=new _V;var s=SV(a,function(e){return{type:r._dimInfos[e].type,property:e}});i.initData(o,s,n)}this._store=i,this._nameList=(t||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,i.count()),this._dimSummary=Rp(this,this._schema),this.userOutput=this._dimSummary.userOutput},e.prototype.appendData=function(e){var t=this._store.appendData(e);this._doInit(t[0],t[1])},e.prototype.appendValues=function(e,t){var n=this._store.appendValues(e,t&&t.length),r=n.start,i=n.end,a=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),t)for(var o=r;o<i;o++){var s=o-r;this._nameList[o]=t[s],a&&PV(this,o)}},e.prototype._updateOrdinalMeta=function(){for(var e=this._store,t=this.dimensions,n=0;n<t.length;n++){var r=this._dimInfos[t[n]];r.ordinalMeta&&e.collectOrdinalMeta(r.storeDimIndex,r.ordinalMeta)}},e.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return this._idDimIdx==null&&e.getSource().sourceFormat!==`typedArray`&&!e.fillStorage},e.prototype._doInit=function(e,t){if(!(e>=t)){var n=this._store.getProvider();this._updateOrdinalMeta();var r=this._nameList,i=this._idList;if(n.getSource().sourceFormat===`original`&&!n.pure)for(var a=[],o=e;o<t;o++){var s=n.getItem(o,a);if(!this.hasItemOption&&du(s)&&(this.hasItemOption=!0),s){var c=s.name;r[o]==null&&c!=null&&(r[o]=xu(c,null));var l=s.id;i[o]==null&&l!=null&&(i[o]=xu(l,null))}}if(this._shouldMakeIdFromName())for(var o=e;o<t;o++)PV(this,o);OV(this)}},e.prototype.getApproximateExtent=function(e,t){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e),t)},e.prototype.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},e.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},e.prototype.setCalculationInfo=function(e,t){xV(e)?I(this._calculationInfo,e):this._calculationInfo[e]=t},e.prototype.getName=function(e){var t=this.getRawIndex(e),n=this._nameList[t];return n==null&&this._nameDimIdx!=null&&(n=AV(this,this._nameDimIdx,t)),n??=``,n},e.prototype._getCategory=function(e,t){var n=this._store.get(e,t),r=this._store.getOrdinalMeta(e);return r?r.categories[n]:n},e.prototype.getId=function(e){return kV(this,this.getRawIndex(e))},e.prototype.count=function(){return this._store.count()},e.prototype.get=function(e,t){var n=this._store,r=this._dimInfos[e];if(r)return n.get(r.storeDimIndex,t)},e.prototype.getByRawIndex=function(e,t){var n=this._store,r=this._dimInfos[e];if(r)return n.getByRawIndex(r.storeDimIndex,t)},e.prototype.getIndices=function(){return this._store.getIndices()},e.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e),null)},e.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},e.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},e.prototype.getValues=function(e,t){var n=this,r=this._store;return z(e)?r.getValues(SV(e,function(e){return n._getStoreDimIndex(e)}),t):r.getValues(e)},e.prototype.hasValue=function(e){for(var t=this._dimSummary.dataDimIndicesOnCoord,n=0,r=t.length;n<r;n++)if(isNaN(this._store.get(t[n],e)))return!1;return!0},e.prototype.indexOfName=function(e){for(var t=0,n=this._store.count();t<n;t++)if(this.getName(t)===e)return t;return-1},e.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},e.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},e.prototype.rawIndexOf=function(e,t){var n=e&&this._invertedIndicesMap[e],r=n&&n[t];return r==null||isNaN(r)?TV:r},e.prototype.each=function(e,t,n){B(e)&&(n=t,t=e,e=[]);var r=n||this,i=SV(jV(e),this._getStoreDimIndex,this);this._store.each(i,r?q(t,r):t)},e.prototype.filterSelf=function(e,t,n){B(e)&&(n=t,t=e,e=[]);var r=n||this,i=SV(jV(e),this._getStoreDimIndex,this);return this._store=this._store.filter(i,r?q(t,r):t),this},e.prototype.selectRange=function(e){var t=this,n={},r=Ba(e),i=[];return L(r,function(r){var a=t._getStoreDimIndex(r);n[a]=e[r],i.push(a)}),this._store=this._store.selectRange(n),this},e.prototype.mapArray=function(e,t,n){B(e)&&(n=t,t=e,e=[]),n||=this;var r=[];return this.each(e,function(){r.push(t&&t.apply(this,arguments))},n),r},e.prototype.map=function(e,t,n,r){var i=n||r||this,a=SV(jV(e),this._getStoreDimIndex,this),o=NV(this);return o._store=this._store.map(a,i?q(t,i):t),o},e.prototype.modify=function(e,t,n,r){var i=n||r||this,a=SV(jV(e),this._getStoreDimIndex,this);this._store.modify(a,i?q(t,i):t)},e.prototype.downSample=function(e,t,n,r){var i=NV(this);return i._store=this._store.downSample(this._getStoreDimIndex(e),t,n,r),i},e.prototype.minmaxDownSample=function(e,t){var n=NV(this);return n._store=this._store.minmaxDownSample(this._getStoreDimIndex(e),t),n},e.prototype.lttbDownSample=function(e,t){var n=NV(this);return n._store=this._store.lttbDownSample(this._getStoreDimIndex(e),t),n},e.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},e.prototype.getItemModel=function(e){var t=this.hostModel;return new HB(this.getRawDataItem(e),t,t&&t.ecModel)},e.prototype.diff=function(e){var t=this;return new UB(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(t){return kV(e,t)},function(e){return kV(t,e)})},e.prototype.getVisual=function(e){var t=this._visual;return t&&t[e]},e.prototype.setVisual=function(e,t){this._visual=this._visual||{},xV(e)?I(this._visual,e):this._visual[e]=t},e.prototype.getItemVisual=function(e,t){var n=this._itemVisuals[e];return(n&&n[t])??this.getVisual(t)},e.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,r=n[e];r||=n[e]={};var i=r[t];return i??(i=this.getVisual(t),z(i)?i=i.slice():xV(i)&&(i=I({},i)),r[t]=i),i},e.prototype.setItemVisual=function(e,t,n){var r=this._itemVisuals[e]||{};this._itemVisuals[e]=r,xV(t)?I(r,t):r[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){xV(e)?I(this._layout,e):this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?I(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){RR(this.hostModel&&this.hostModel.seriesIndex,this.dataType,e,t),this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){L(this._graphicEls,function(n,r){n&&e&&e.call(t,n,r)})},e.prototype.cloneShallow=function(t){return t||=new e(this._schema?this._schema:SV(this.dimensions,this._getDimInfo,this),this.hostModel),MV(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(e,t){var n=this[e];B(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat($a(arguments)))})},e.internalField=function(){OV=function(e){var t=e._invertedIndicesMap;L(t,function(n,r){var i=e._dimInfos[r],a=i.ordinalMeta,o=e._store;if(a){n=t[r]=new CV(a.categories.length);for(var s=0;s<n.length;s++)n[s]=TV;for(var s=0;s<o.count();s++)n[o.get(i.storeDimIndex,s)]=s}})},AV=function(e,t,n){return xu(e._getCategory(t,n),null)},kV=function(e,t){var n=e._idList[t];return n==null&&e._idDimIdx!=null&&(n=AV(e,e._idDimIdx,t)),n??=wV+t,n},jV=function(e){return z(e)||(e=e==null?[]:[e]),e},NV=function(t){var n=new e(t._schema?t._schema:SV(t.dimensions,t._getDimInfo,t),t.hostModel);return MV(n,t),n},MV=function(e,t){L(EV.concat(t.__wrappedMethods||[]),function(n){t.hasOwnProperty(n)&&(e[n]=t[n])}),e.__wrappedMethods=t.__wrappedMethods,L(DV,function(n){e[n]=ka(t[n])}),e._calculationInfo=I({},t._calculationInfo)},PV=function(e,t){var n=e._nameList,r=e._idList,i=e._nameDimIdx,a=e._idDimIdx,o=n[t],s=r[t];if(o==null&&i!=null&&(n[t]=o=AV(e,i,t)),s==null&&a!=null&&(r[t]=s=AV(e,a,t)),s==null&&o!=null){var c=e._nameRepeatCount,l=c[o]=(c[o]||0)+1;s=o,l>1&&(s+=`__ec__`+l),r[t]=s}}}(),e}(),IV={},LV={},RV=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(e,t){this._nonSeriesBoxMasterList=n(IV,!0),this._normalMasterList=n(LV,!1);function n(n,r){var i=[];return L(n,function(n,r){var a=n.create(e,t);i=i.concat(a||[])}),i}},e.prototype.update=function(e,t){L(this._normalMasterList,function(n){n.update&&n.update(e,t)})},e.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},e.register=function(e,t){e===`matrix`||e===`calendar`?IV[e]=t:LV[e]=t},e.get=function(e){return LV[e]||IV[e]},e}(),zV=W(),BV=function(e,t){var n=t.getReferringComponents(e,PR).models[0];return n&&n.coordinateSystem},VV=function(){function e(e){this.coordSysDims=[],this.axisMap=W(),this.categoryAxisMap=W(),this.coordSysName=e}return e}(),HV={cartesian2d:function(e,t,n,r){var i=e.getReferringComponents(`xAxis`,PR).models[0],a=e.getReferringComponents(`yAxis`,PR).models[0];t.coordSysDims=[`x`,`y`],n.set(`x`,i),n.set(`y`,a),sm(i)&&(r.set(`x`,i),t.firstCategoryDimIndex=0),sm(a)&&(r.set(`y`,a),t.firstCategoryDimIndex??=1)},singleAxis:function(e,t,n,r){var i=e.getReferringComponents(`singleAxis`,PR).models[0];t.coordSysDims=[`single`],n.set(`single`,i),sm(i)&&(r.set(`single`,i),t.firstCategoryDimIndex=0)},polar:function(e,t,n,r){var i=e.getReferringComponents(`polar`,PR).models[0],a=i.findAxisModel(`radiusAxis`),o=i.findAxisModel(`angleAxis`);t.coordSysDims=[`radius`,`angle`],n.set(`radius`,a),n.set(`angle`,o),sm(a)&&(r.set(`radius`,a),t.firstCategoryDimIndex=0),sm(o)&&(r.set(`angle`,o),t.firstCategoryDimIndex??=1)},geo:function(e,t,n,r){t.coordSysDims=[`lng`,`lat`]},parallel:function(e,t,n,r){var i=e.ecModel,a=i.getComponent(`parallel`,e.get(`parallelIndex`)),o=t.coordSysDims=a.dimensions.slice();L(a.parallelAxisIndex,function(e,a){var s=i.getComponent(`parallelAxis`,e),c=o[a];n.set(c,s),sm(s)&&(r.set(c,s),t.firstCategoryDimIndex??=a)})},matrix:function(e,t,n,r){var i=e.getReferringComponents(`matrix`,PR).models[0];t.coordSysDims=[`x`,`y`];var a=i.getDimensionModel(`x`),o=i.getDimensionModel(`y`);n.set(`x`,a),n.set(`y`,o),r.set(`x`,a),r.set(`y`,o)}},UV=Math.round(Math.random()*10),WV=Math.log(2),GV=`___zrEVENTSAVED`,KV=[],qV=/([&<>"'])/g,JV={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},YV={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`,custom:`Custom chart`,chart:`Chart`}},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:`. `}}}},XV={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:`旭日图`,custom:`自定义图表`,chart:`图表`}},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:``}}}},ZV=`ZH`,QV=`EN`,$V=QV,eH={},tH={},nH=dF.domSupported?function(){return(document.documentElement.lang||navigator.language||navigator.browserLanguage||$V).toUpperCase().indexOf(ZV)>-1?ZV:$V}():$V,Am(QV,YV),Am(ZV,XV),rH=null,iH=1e3,aH=iH*60,oH=aH*60,sH=oH*24,cH=sH*365,lH={year:/({yyyy}|{yy})/,month:/({MMMM}|{MMM}|{MM}|{M})/,day:/({dd}|{d})/,hour:/({HH}|{H}|{hh}|{h})/,minute:/({mm}|{m})/,second:/({ss}|{s})/,millisecond:/({SSS}|{S})/},uH={year:`{yyyy}`,month:`{MMM}`,day:`{d}`,hour:`{HH}:{mm}`,minute:`{HH}:{mm}`,second:`{HH}:{mm}:{ss}`,millisecond:`{HH}:{mm}:{ss} {SSS}`},dH=`{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}`,fH=`{yyyy}-{MM}-{dd}`,pH={year:`{yyyy}`,month:`{yyyy}-{MM}`,day:fH,hour:fH+` `+uH.hour,minute:fH+` `+uH.minute,second:fH+` `+uH.second,millisecond:dH},mH=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`],hH=[`year`,`half-year`,`quarter`,`month`,`week`,`half-week`,`day`,`half-day`,`quarter-day`,`hour`,`minute`,`second`,`millisecond`],gH=eo,_H=[`a`,`b`,`c`,`d`,`e`,`f`,`g`],vH=function(e,t){return`{`+e+(t??``)+`}`},yH=L,bH=[`left`,`right`,`top`,`bottom`,`width`,`height`],xH=[[`width`,`left`,`right`],[`height`,`top`,`bottom`]],SH=_h,Ha(_h,`vertical`),Ha(_h,`horizontal`),CH={rect:1,point:2},wH=Du(),TH=function(e){F(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.uid=_m(`ec_cpt_model`),i}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=Th(this),r=n?Dh(e):{};Aa(e,t.getTheme().get(this.mainType)),Aa(e,this.getDefaultOption()),n&&Eh(e,r,n)},t.prototype.mergeOption=function(e,t){Aa(this.option,e,!0);var n=Th(this);n&&Eh(this.option,e,n)},t.prototype.optionUpdated=function(e,t){},t.prototype.getDefaultOption=function(){var e=this.constructor;if(!po(e))return e.defaultOption;var t=wH(this);if(!t.defaultOption){for(var n=[],r=e;r;){var i=r.prototype.defaultOption;i&&n.push(i),r=r.superClass}for(var a={},o=n.length-1;o>=0;o--)a=Aa(a,n[o],!0);t.defaultOption=a}return t.defaultOption},t.prototype.getReferringComponents=function(e,t){var n=e+`Index`,r=e+`Id`;return Au(this.ecModel,e,{index:this.get(n,!0),id:this.get(r,!0)},t)},t.prototype.getBoxLayoutParams=function(){return vh(this,!1)},t.prototype.getZLevelKey=function(){return``},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type=`component`,e.id=``,e.name=``,e.mainType=``,e.subType=``,e.componentIndex=0}(),t}(HB),go(TH,HB),bo(TH),vm(TH),ym(TH,kh),EH=Du(),DH=Du(),OH=function(){function e(){}return e.prototype.getColorFromPalette=function(e,t,n){var r=cu(this.get(`color`,!0)),i=this.get(`colorLayer`,!0);return Mh(this,EH,r,i,e,t,n)},e.prototype.clearColorPalette=function(){Nh(this,EH)},e}(),kH=/\{@(.+?)\}/g,AH=function(){function e(){}return e.prototype.getDataParams=function(e,t){var n=this.getData(t),r=this.getRawValue(e,t),i=n.getRawIndex(e),a=n.getName(e),o=n.getRawDataItem(e),s=n.getItemVisual(e,`style`),c=s&&s[n.getItemVisual(e,`drawType`)||`fill`],l=s&&s.stroke,u=this.mainType,d=u===`series`,f=n.userOutput&&n.userOutput.get();return{componentType:u,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:d?this.subType:null,seriesIndex:this.seriesIndex,seriesId:d?this.id:null,seriesName:d?this.name:null,name:a,dataIndex:i,data:o,dataType:t,value:r,color:c,borderColor:l,dimensionNames:f?f.fullDimensions:null,encode:f?f.encode:null,$vars:[`seriesName`,`name`,`value`]}},e.prototype.getFormattedLabel=function(e,t,n,r,i,a){t||=`normal`;var o=this.getData(n),s=this.getDataParams(e,n);if(a&&(s.value=a.interpolatedValue),r!=null&&z(s.value)&&(s.value=s.value[r]),i||=o.getItemModel(e).get(t===`normal`?[`label`,`formatter`]:[t,`label`,`formatter`]),B(i))return s.status=t,s.dimensionIndex=r,i(s);if(V(i))return fh(i,s).replace(kH,function(t,n){var r=n.length,i=n;i.charAt(0)===`[`&&i.charAt(r-1)===`]`&&(i=+i.slice(1,r-1));var s=Lp(o,e,i);if(a&&z(a.interpolatedValue)){var c=o.getDimensionIndex(i);c>=0&&(s=a.interpolatedValue[c])}return s==null?``:s+``})},e.prototype.getRawValue=function(e,t){return Lp(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}(),jH=function(){function e(e){e||={},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return e.prototype.perform=function(e){var t=this._upstream,n=e&&e.skip;if(this._dirty&&t){var r=this.context;r.data=r.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var i;this._plan&&!n&&(i=this._plan(this.context));var a=l(this._modBy),o=this._modDataCount||0,s=l(e&&e.modBy),c=e&&e.modDataCount||0;(a!==s||o!==c)&&(i=`reset`);function l(e){return!(e>=1)&&(e=1),e}var u;(this._dirty||i===`reset`)&&(this._dirty=!1,u=this._doReset(n)),this._modBy=s,this._modDataCount=c;var d=e&&e.step;if(this._dueEnd=t?t._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var f=this._dueIndex,p=Math.min(d==null?1/0:this._dueIndex+d,this._dueEnd);if(!n&&(u||f<p)){var m=this._progress;if(z(m))for(var h=0;h<m.length;h++)this._doProgress(m[h],f,p,s,c);else this._doProgress(m,f,p,s,c)}this._dueIndex=p;var g=this._settedOutputEnd==null?p:this._settedOutputEnd;this._outputDueEnd=g}else this._dueIndex=this._outputDueEnd=this._settedOutputEnd==null?this._dueEnd:this._settedOutputEnd;return this.unfinished()},e.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},e.prototype._doProgress=function(e,t,n,r,i){MH.reset(t,n,r,i),this._callingProgress=e,this._callingProgress({start:t,end:n,count:n-t,next:MH.next},this.context)},e.prototype._doReset=function(e){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null;var t,n;!e&&this._reset&&(t=this._reset(this.context),t&&t.progress&&(n=t.forceFirstProgress,t=t.progress),z(t)&&!t.length&&(t=null)),this._progress=t,this._modBy=this._modDataCount=null;var r=this._downstream;return r&&r.dirty(),n},e.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},e.prototype.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},e.prototype.dispose=function(){this._disposed||=(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,!0)},e.prototype.getUpstream=function(){return this._upstream},e.prototype.getDownstream=function(){return this._downstream},e.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},e}(),MH=function(){var e,t,n,r,i,a={reset:function(c,l,u,d){t=c,e=l,n=u,r=d,i=Math.ceil(r/n),a.next=n>1&&r>0?s:o}};return a;function o(){return t<e?t++:null}function s(){var a=t%i*n+Math.ceil(t/i),o=t>=e?null:a<r?a:t;return t++,o}}(),NH=function(){function e(){}return e.prototype.getRawData=function(){throw Error(`not supported`)},e.prototype.getRawDataItem=function(e){throw Error(`not supported`)},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(e){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(e,t){},e.prototype.retrieveValueFromItem=function(e,t){},e.prototype.convertValue=function(e,t){return Hp(e,t)},e}(),PH=W(),FH=function(){function e(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+`_`+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),n=!!t.length,r,i;if(Gh(e)){var a=e,o=void 0,s=void 0,c=void 0;if(n){var l=t[0];l.prepareSource(),c=l.getSource(),o=c.data,s=c.sourceFormat,i=[l._getVersionSign()]}else o=a.get(`data`,!0),s=Ka(o)?GR:VR,i=[];var u=this._getSourceMetaRawOption()||{},d=c&&c.metaRawOption||{},f=U(u.seriesLayoutBy,d.seriesLayoutBy)||null,p=U(u.sourceHeader,d.sourceHeader),m=U(u.dimensions,d.dimensions);r=f!==d.seriesLayoutBy||!!p!=!!d.sourceHeader||m?[wp(o,{seriesLayoutBy:f,sourceHeader:p,dimensions:m},s)]:[]}else{var h=e;if(n){var g=this._applyTransform(t);r=g.sourceList,i=g.upstreamSignList}else r=[wp(h.get(`source`,!0),this._getSourceMetaRawOption(),null)],i=[]}this._setLocalSource(r,i)},e.prototype._applyTransform=function(e){var t=this._sourceHost,n=t.get(`transform`,!0),r=t.get(`fromTransformResult`,!0);r!=null&&e.length!==1&&Kh(``);var i,a=[],o=[];return L(e,function(e){e.prepareSource();var t=e.getSource(r||0);r!=null&&!t&&Kh(``),a.push(t),o.push(e._getVersionSign())}),n?i=Hh(n,a,{datasetIndex:t.componentIndex}):r!=null&&(i=[Ep(a[0])]),{sourceList:i,upstreamSignList:o}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t<e.length;t++){var n=e[t];if(n._isDirty()||this._upstreamSignList[t]!==n._getVersionSign())return!0}},e.prototype.getSource=function(e){e||=0;var t=this._sourceList[e];if(!t){var n=this._getUpstreamSourceManagers();return n[0]&&n[0].getSource(e)}return t},e.prototype.getSharedDataStore=function(e){var t=e.makeStoreSchema();return this._innerGetDataStore(t.dimensions,e.source,t.hash)},e.prototype._innerGetDataStore=function(e,t,n){var r=0,i=this._storeList,a=i[r];a||=i[r]={};var o=a[n];if(!o){var s=this._getUpstreamSourceManagers()[0];Gh(this._sourceHost)&&s?o=s._innerGetDataStore(e,t,n):(o=new _V,o.initData(new $B(t,e.length),e)),a[n]=o}return o},e.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(Gh(e)){var t=yp(e);return t?[t.getSourceManager()]:[]}return R(bp(e),function(e){return e.getSourceManager()})},e.prototype._getSourceMetaRawOption=function(){var e=this._sourceHost,t,n,r;if(Gh(e))t=e.get(`seriesLayoutBy`,!0),n=e.get(`sourceHeader`,!0),r=e.get(`dimensions`,!0);else if(!this._getUpstreamSourceManagers().length){var i=e;t=i.get(`seriesLayoutBy`,!0),n=i.get(`sourceHeader`,!0),r=i.get(`dimensions`,!0)}return{seriesLayoutBy:t,sourceHeader:n,dimensions:r}},e}(),X={color:{},darkColor:{},size:{}},IH=X.color={theme:[`#5070dd`,`#b6d634`,`#505372`,`#ff994d`,`#0ca8df`,`#ffd10a`,`#fb628b`,`#785db0`,`#3fbe95`],neutral00:`#fff`,neutral05:`#f4f7fd`,neutral10:`#e8ebf0`,neutral15:`#dbdee4`,neutral20:`#cfd2d7`,neutral25:`#c3c5cb`,neutral30:`#b7b9be`,neutral35:`#aaacb2`,neutral40:`#9ea0a5`,neutral45:`#929399`,neutral50:`#86878c`,neutral55:`#797b7f`,neutral60:`#6d6e73`,neutral65:`#616266`,neutral70:`#54555a`,neutral75:`#48494d`,neutral80:`#3c3c41`,neutral85:`#303034`,neutral90:`#232328`,neutral95:`#17171b`,neutral99:`#000`,accent05:`#eff1f9`,accent10:`#e0e4f2`,accent15:`#d0d6ec`,accent20:`#c0c9e6`,accent25:`#b1bbdf`,accent30:`#a1aed9`,accent35:`#91a0d3`,accent40:`#8292cc`,accent45:`#7285c6`,accent50:`#6578ba`,accent55:`#5c6da9`,accent60:`#536298`,accent65:`#4a5787`,accent70:`#404c76`,accent75:`#374165`,accent80:`#2e3654`,accent85:`#252b43`,accent90:`#1b2032`,accent95:`#121521`,transparent:`rgba(0,0,0,0)`,highlight:`rgba(255,231,130,0.8)`},I(IH,{primary:IH.neutral80,secondary:IH.neutral70,tertiary:IH.neutral60,quaternary:IH.neutral50,disabled:IH.neutral20,border:IH.neutral30,borderTint:IH.neutral20,borderShade:IH.neutral40,background:IH.neutral05,backgroundTint:`rgba(234,237,245,0.5)`,backgroundTransparent:`rgba(255,255,255,0)`,backgroundShade:IH.neutral10,shadow:`rgba(0,0,0,0.2)`,shadowTint:`rgba(129,130,136,0.2)`,axisLine:IH.neutral70,axisLineTint:IH.neutral40,axisTick:IH.neutral70,axisTickMinor:IH.neutral60,axisLabel:IH.neutral70,axisSplitLine:IH.neutral15,axisMinorSplitLine:IH.neutral05}),IH)IH.hasOwnProperty(e)&&(LH=IH[e],e===`theme`?X.darkColor.theme=IH.theme.slice():e===`highlight`?X.darkColor.highlight=`rgba(255,231,130,0.4)`:e.indexOf(`accent`)===0?X.darkColor[e]=oc(LH,null,function(e){return e*.5},function(e){return Math.min(1,1.3-e)}):X.darkColor[e]=oc(LH,null,function(e){return e*.9},function(e){return 1-e**1.5}));if(X.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50},RH=`line-height:1`,zH=[0,10,20,30],BH=[``,`
33
33
  `,`
34
34
 
35
35
  `,`
@@ -38,7 +38,7 @@
38
38
  `],VH=function(){function e(){this.richTextStyles={},this._nextStyleNameId=eu()}return e.prototype._generateStyleName=function(){return`__EC_aUTo_`+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var r=n===`richText`?this._generateStyleName():null,i=mh({color:t,type:e,renderMode:n,markerId:r});return V(i)?i:(this.richTextStyles[r]=i.style,i.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};z(t)?L(t,function(e){return I(n,e)}):I(n,t);var r=this._generateStyleName();return this.richTextStyles[r]=n,`{`+r+`|`+e+`}`},e}(),HH=Du(),UH=function(e){F(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return t.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=Fh({count:mg,reset:hg}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(HH(this).sourceManager=new FH(this)).prepareSource();var r=this.getInitialData(e,n);_g(r,this),this.dataTask.context.data=r,HH(this).dataBeforeProcessed=r,fg(this),this._initSelectedMapFromData(r)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=Th(this),r=n?Dh(e):{},i=this.subType;TH.hasClass(i)&&(i+=`Series`),Aa(e,t.getTheme().get(this.subType)),Aa(e,this.getDefaultOption()),lu(e,`label`,[`show`]),this.fillDataTextStyle(e.data),n&&Eh(e,r,n)},t.prototype.mergeOption=function(e,t){e=Aa(this.option,e,!0),this.fillDataTextStyle(e.data);var n=Th(this);n&&Eh(this.option,e,n);var r=HH(this).sourceManager;r.dirty(),r.prepareSource();var i=this.getInitialData(e,t);_g(i,this),this.dataTask.dirty(),this.dataTask.context.data=i,HH(this).dataBeforeProcessed=i,fg(this),this._initSelectedMapFromData(i)},t.prototype.fillDataTextStyle=function(e){if(e&&!Ka(e))for(var t=[`show`],n=0;n<e.length;n++)e[n]&&e[n].label&&lu(e[n],`label`,t)},t.prototype.getInitialData=function(e,t){},t.prototype.appendData=function(e){this.getRawData().appendData(e.data)},t.prototype.getData=function(e){var t=yg(this);if(t){var n=t.context.data;return e==null||!n.getLinkedData?n:n.getLinkedData(e)}return HH(this).data},t.prototype.getAllData=function(){var e=this.getData();return e&&e.getLinkedDataAll?e.getLinkedDataAll():[{data:e}]},t.prototype.setData=function(e){var t=yg(this);if(t){var n=t.context;n.outputData=e,t!==this.dataTask&&(n.data=e)}HH(this).data=e},t.prototype.getEncode=function(){var e=this.get(`encode`,!0);if(e)return W(e)},t.prototype.getSourceManager=function(){return HH(this).sourceManager},t.prototype.getSource=function(){return this.getSourceManager().getSource()},t.prototype.getRawData=function(){return HH(this).dataBeforeProcessed},t.prototype.getColorBy=function(){return this.get(`colorBy`)||`series`},t.prototype.isColorBySeries=function(){return this.getColorBy()===`series`},t.prototype.getBaseAxis=function(){var e=this.coordinateSystem;return e&&e.getBaseAxis&&e.getBaseAxis()},t.prototype.indicesOfNearest=function(e,t,n,r){var i=this.getData(),a=this.coordinateSystem,o=a&&a.getAxis(e);if(!a||!o)return[];var s=o.dataToCoord(n);r??=1/0;for(var c=[],l=1/0,u=-1,d=0,f=i.getDimensionIndex(t),p=i.getStore(),m=0,h=p.count();m<h;m++){var g=p.get(f,m),_=s-o.dataToCoord(g),v=Math.abs(_);v<=r&&((v<l||v===l&&_>=0&&u<0)&&(l=v,u=_,d=0),_===u&&(c[d++]=m))}return c.length=d,c},t.prototype.formatTooltip=function(e,t,n){return lg({series:this,dataIndex:e,multipleSeries:t})},t.prototype.isAnimationEnabled=function(){var e=this.ecModel;if(dF.node&&!(e&&e.ssr))return!1;var t=this.getShallow(`animation`);return t&&this.getData().count()>this.getShallow(`animationThreshold`)&&(t=!1),!!t},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,t,n){var r=this.ecModel,i=OH.prototype.getColorFromPalette.call(this,e,t,n);return i||=r.getColorFromPalette(e,t,n),i},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get(`progressive`)},t.prototype.getProgressiveThreshold=function(){return this.get(`progressiveThreshold`)},t.prototype.select=function(e,t){this._innerSelect(this.getData(t),e)},t.prototype.unselect=function(e,t){var n=this.option.selectedMap;if(n){var r=this.option.selectedMode,i=this.getData(t);if(r===`series`||n===`all`)this.option.selectedMap={},this._selectedDataIndicesMap={};else for(var a=0;a<e.length;a++){var o=e[a],s=dg(i,o);n[s]=!1,this._selectedDataIndicesMap[s]=-1}}},t.prototype.toggleSelect=function(e,t){for(var n=[],r=0;r<e.length;r++)n[0]=e[r],this.isSelected(e[r],t)?this.unselect(n,t):this.select(n,t)},t.prototype.getSelectedDataIndices=function(){if(this.option.selectedMap===`all`)return[].slice.call(this.getData().getIndices());for(var e=this._selectedDataIndicesMap,t=Ba(e),n=[],r=0;r<t.length;r++){var i=e[t[r]];i>=0&&n.push(i)}return n},t.prototype.isSelected=function(e,t){var n=this.option.selectedMap;if(!n)return!1;var r=this.getData(t);return(n===`all`||n[dg(r,e)])&&!r.getItemModel(e).get([`select`,`disabled`])},t.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var e=this.option.universalTransition;return e?e===!0||e&&e.enabled:!1},t.prototype._innerSelect=function(e,t){var n,r,i=this.option,a=i.selectedMode,o=t.length;if(a&&o){if(a===`series`)i.selectedMap=`all`;else if(a===`multiple`){H(i.selectedMap)||(i.selectedMap={});for(var s=i.selectedMap,c=0;c<o;c++){var l=t[c],u=dg(e,l);s[u]=!0,this._selectedDataIndicesMap[u]=e.getRawIndex(l)}}else if(a===`single`||a===!0){var d=t[o-1],u=dg(e,d);i.selectedMap=(n={},n[u]=!0,n),this._selectedDataIndicesMap=(r={},r[u]=e.getRawIndex(d),r)}}},t.prototype._initSelectedMapFromData=function(e){if(!this.option.selectedMap){var t=[];e.hasItemOption&&e.each(function(n){var r=e.getRawDataItem(n);r&&r.selected&&t.push(n)}),t.length>0&&this._innerSelect(e,t)}},t.registerClass=function(e){return TH.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type=`series.__base__`,e.seriesIndex=0,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol=`circle`,e.visualStyleAccessPath=`itemStyle`,e.visualDrawType=`fill`}(),t}(TH),Fa(UH,AH),Fa(UH,OH),go(UH,TH),WH=JL.extend({type:`triangle`,shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,a=t.height/2;e.moveTo(n,r-a),e.lineTo(n+i,r+a),e.lineTo(n-i,r+a),e.closePath()}}),GH={line:Jz,rect:rR,roundRect:rR,square:rR,circle:wz,diamond:JL.extend({type:`diamond`,shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,a=t.height/2;e.moveTo(n,r-a),e.lineTo(n+i,r),e.lineTo(n,r+a),e.lineTo(n-i,r),e.closePath()}}),pin:JL.extend({type:`pin`,shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.x,r=t.y,i=t.width/5*3,a=Math.max(i,t.height),o=i/2,s=o*o/(a-o),c=r-a+o+s,l=Math.asin(s/o),u=Math.cos(l)*o,d=Math.sin(l),f=Math.cos(l),p=o*.6,m=o*.7;e.moveTo(n-u,c+s),e.arc(n,c,o,Math.PI-l,Math.PI*2+l),e.bezierCurveTo(n+u-d*p,c+s+f*p,n,r-m,n,r),e.bezierCurveTo(n,r-m,n-u+d*p,c+s+f*p,n-u,c+s),e.closePath()}}),arrow:JL.extend({type:`arrow`,shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.height,r=t.width,i=t.x,a=t.y,o=r/3*2;e.moveTo(i,a),e.lineTo(i+o,a+n),e.lineTo(i,a+n/4*3),e.lineTo(i-o,a+n),e.lineTo(i,a),e.closePath()}}),triangle:WH},KH={line:function(e,t,n,r,i){i.x1=e,i.y1=t+r/2,i.x2=e+n,i.y2=t+r/2},rect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r},roundRect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r,i.r=Math.min(n,r)/4},square:function(e,t,n,r,i){var a=Math.min(n,r);i.x=e,i.y=t,i.width=a,i.height=a},circle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.r=Math.min(n,r)/2},diamond:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r},pin:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},arrow:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},triangle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r}},qH={},L(GH,function(e,t){qH[t]=new e}),JH=JL.extend({type:`symbol`,shape:{symbolType:``,x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,n){var r=cs(e,t,n),i=this.shape;return i&&i.symbolType===`pin`&&t.position===`inside`&&(r.y=n.y+n.height*.4),r},buildPath:function(e,t,n){var r=t.symbolType;if(r!==`none`){var i=qH[r];i||=(r=`rect`,qH[r]),KH[r](t.x,t.y,t.width,t.height,i.shape),i.buildPath(e,i.shape,n)}}}),YH=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return t.prototype.getInitialData=function(e){return mm(null,this,{useEncodeDefaulter:!0})},t.prototype.getLegendIcon=function(e){var t=new Sz,n=xg(`line`,0,e.itemHeight/2,e.itemWidth,0,e.lineStyle.stroke,!1);t.add(n),n.setStyle(e.lineStyle);var r=this.getData().getVisual(`symbol`),i=this.getData().getVisual(`symbolRotate`),a=r===`none`?`circle`:r,o=e.itemHeight*.8,s=xg(a,(e.itemWidth-o)/2,(e.itemHeight-o)/2,o,o,e.itemStyle.fill);return t.add(s),s.setStyle(e.itemStyle),s.rotation=(e.iconRotate===`inherit`?i:e.iconRotate||0)*Math.PI/180,s.setOrigin([e.itemWidth/2,e.itemHeight/2]),a.indexOf(`empty`)>-1&&(s.style.stroke=s.style.fill,s.style.fill=X.color.neutral00,s.style.lineWidth=2),t},t.type=`series.line`,t.dependencies=[`grid`,`polar`],t.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:6,symbolRotate:null,showSymbol:!0,showAllSymbol:`auto`,connectNulls:!1,sampling:`none`,animationEasing:`linear`,progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:`clone`},triggerLineEvent:!1,triggerEvent:!1},t}(UH),XH=function(e){F(t,e);function t(t,n,r,i){var a=e.call(this)||this;return a.updateData(t,n,r,i),a}return t.prototype._createSymbol=function(e,t,n,r,i,a){this.removeAll();var o=xg(e,-1,-1,2,2,null,a);o.attr({z2:U(i,100),culling:!0,scaleX:r[0]/2,scaleY:r[1]/2}),o.drift=Eg,this._symbolType=e,this.add(o)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){bd(this.childAt(0))},t.prototype.downplay=function(){xd(this.childAt(0))},t.prototype.setZ=function(e,t){var n=this.childAt(0);n.zlevel=e,n.z=t},t.prototype.setDraggable=function(e,t){var n=this.childAt(0);n.draggable=e,n.cursor=!t&&e?`move`:n.cursor},t.prototype.updateData=function(e,n,r,i){this.silent=!1;var a=e.getItemVisual(n,`symbol`)||`circle`,o=e.hostModel,s=t.getSymbolSize(e,n),c=t.getSymbolZ2(e,n),l=a!==this._symbolType,u=i&&i.disableAnimation;if(l){var d=e.getItemVisual(n,`symbolKeepAspect`);this._createSymbol(a,e,n,s,c,d)}else{var f=this.childAt(0);f.silent=!1;var p={scaleX:s[0]/2,scaleY:s[1]/2};u?f.attr(p):df(f,p,o,n),_f(f)}if(this._updateCommon(e,n,s,r,i),l){var f=this.childAt(0);if(!u){var p={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:f.style.opacity}};f.scaleX=f.scaleY=0,f.style.opacity=0,ff(f,p,o,n)}}u&&this.childAt(0).stopAnimation(`leave`)},t.prototype._updateCommon=function(e,t,n,r,i){var a=this.childAt(0),o=e.hostModel,s,c,l,u,d,f,p,m,h;if(r&&(s=r.emphasisItemStyle,c=r.blurItemStyle,l=r.selectItemStyle,u=r.focus,d=r.blurScope,p=r.labelStatesModels,m=r.hoverScale,h=r.cursorStyle,f=r.emphasisDisabled),!r||e.hasItemOption){var g=r&&r.itemModel?r.itemModel:e.getItemModel(t),_=g.getModel(`emphasis`);s=_.getModel(`itemStyle`).getItemStyle(),l=g.getModel([`select`,`itemStyle`]).getItemStyle(),c=g.getModel([`blur`,`itemStyle`]).getItemStyle(),u=_.get(`focus`),d=_.get(`blurScope`),f=_.get(`disabled`),p=ap(g),m=_.getShallow(`scale`),h=g.getShallow(`cursor`)}var v=e.getItemVisual(t,`symbolRotate`);a.attr(`rotation`,(v||0)*Math.PI/180||0);var y=Cg(e.getItemVisual(t,`symbolOffset`),n);y&&(a.x=y[0],a.y=y[1]),h&&a.attr(`cursor`,h);var b=e.getItemVisual(t,`style`),x=b.fill;if(a instanceof $L){var S=a.style;a.useStyle(I({image:S.image,x:S.x,y:S.y,width:S.width,height:S.height},b))}else a.__isEmptyBrush?a.useStyle(I({},b)):a.useStyle(b),a.style.decal=null,a.setColor(x,i&&i.symbolInnerColor),a.style.strokeNoScale=!0;var C=e.getItemVisual(t,`liftZ`),w=this._z2;C==null?w!=null&&(a.z2=w,this._z2=null):w??(this._z2=a.z2,a.z2+=C);var T=i&&i.useNameLabel;ip(a,p,{labelFetcher:o,labelDataIndex:t,defaultText:E,inheritColor:x,defaultOpacity:b.opacity});function E(t){return T?e.getName(t):wg(e,t)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var D=a.ensureState(`emphasis`);D.style=s,a.ensureState(`select`).style=l,a.ensureState(`blur`).style=c;var O=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;D.scaleX=this._sizeX*O,D.scaleY=this._sizeY*O,this.setSymbolScale(1),Fd(this,u,d,f)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t,n){var r=this.childAt(0),i=LR(this).dataIndex,a=n&&n.animation;if(this.silent=r.silent=!0,n&&n.fadeLabel){var o=r.getTextContent();o&&mf(o,{style:{opacity:0}},t,{dataIndex:i,removeOpt:a,cb:function(){r.removeTextContent()}})}else r.removeTextContent();mf(r,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:i,cb:e,removeOpt:a})},t.getSymbolSize=function(e,t){return Sg(e.getItemVisual(t,`symbolSize`))},t.getSymbolZ2=function(e,t){return e.getItemVisual(t,`z2`)},t}(Sz),ZH=function(){function e(e){this.group=new Sz,this._SymbolCtor=e||XH}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=Og(t);var n=this.group,r=e.hostModel,i=this._data,a=this._SymbolCtor,o=t.disableAnimation,s=this._seriesScope=kg(e),c={disableAnimation:o},l=t.getSymbolPoint||function(t){return e.getItemLayout(t)};i||n.removeAll(),e.diff(i).add(function(r){var i=l(r);Dg(e,i,r,t)&&Ag(a,e,r,s,c,i,n)}).update(function(u,d){var f=i.getItemGraphicEl(d),p=l(u);if(!Dg(e,p,u,t))n.remove(f);else{var m=e.getItemVisual(u,`symbol`)||`circle`,h=f&&f.getSymbolType&&f.getSymbolType();if(!f||h&&h!==m)n.remove(f),f=new a(e,u,s,c),f.setPosition(p);else{f.updateData(e,u,s,c);var g={x:p[0],y:p[1]};o?f.attr(g):df(f,g,r)}n.add(f),e.setItemGraphicEl(u,f)}}).remove(function(e){var t=i.getItemGraphicEl(e);t&&t.fadeOut(function(){n.remove(t)},r)}).execute(),this._getSymbolPoint=l,this._data=e},e.prototype.updateLayout=function(e){var t=this._data;if(t)for(var n=this,r=t.getStore(),i=0,a=r.count();i<a;i++){var o=t.getItemGraphicEl(i),s=n._getSymbolPoint(i);Dg(t,s,i,e)?(o||=Ag(n._SymbolCtor,t,i,n._seriesScope,{disableAnimation:!0},s,n.group),o.stopAnimation(),o.setPosition(s),o.markRedraw()):o&&(n.group.remove(o),t.setItemGraphicEl(i,null))}},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=kg(e),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n,r){this._progressiveEls=[],r=Og(r);function i(e){e.isGroup||(e.incremental=n,e.ensureState(`emphasis`).hoverLayer=2)}for(var a=e.start;a<e.end;a++){var o=t.getItemLayout(a);if(Dg(t,o,a,r)){var s=new this._SymbolCtor(t,a,this._seriesScope);s.traverse(i),s.setPosition(o),this.group.add(s),t.setItemGraphicEl(a,s),this._progressiveEls.push(s)}}},e.prototype.eachRendered=function(e){Gf(this._progressiveEls||this.group,e)},e.prototype.remove=function(e){var t=this.group,n=this._data;n&&e?n.eachItemGraphicEl(function(e){e.fadeOut(function(){t.remove(e)},n.hostModel)}):t.removeAll()},e}(),QH=typeof Float32Array<`u`?Float32Array:void 0,$H=typeof Float64Array<`u`?Float64Array:void 0,eU=Math.min,tU=Math.max,nU=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),rU=function(e){F(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-polyline`,n}return t.prototype.getDefaultStyle=function(){return{stroke:X.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new nU},t.prototype.buildPath=function(e,t){var n=t.points,r=0,i=n.length/2;if(t.connectNulls){for(;i>0&&Pg(n[i*2-2],n[i*2-1]);i--);for(;r<i&&Pg(n[r*2],n[r*2+1]);r++);}for(;r<i;)r+=zg(e,n,r,i,i,1,t.smooth,t.smoothMonotone,t.connectNulls)+1},t.prototype.getPointOn=function(e,t){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var n=this.path.data,r=LL.CMD,i,a,o=t===`x`,s=[],c=0;c<n.length;){var l=n[c++],u=void 0,d=void 0,f=void 0,p=void 0,m=void 0,h=void 0,g=void 0;switch(l){case r.M:i=n[c++],a=n[c++];break;case r.L:if(u=n[c++],d=n[c++],g=o?(e-i)/(u-i):(e-a)/(d-a),g<=1&&g>=0){var _=o?(d-a)*g+a:(u-i)*g+i;return o?[e,_]:[_,e]}i=u,a=d;break;case r.C:u=n[c++],d=n[c++],f=n[c++],p=n[c++],m=n[c++],h=n[c++];var v=o?js(i,u,f,m,e,s):js(a,d,p,h,e,s);if(v>0)for(var y=0;y<v;y++){var b=s[y];if(b<=1&&b>=0){var _=o?ks(a,d,p,h,b):ks(i,u,f,m,b);return o?[e,_]:[_,e]}}i=m,a=h}}},t}(JL),iU=function(e){F(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(nU),aU=function(e){F(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-polygon`,n}return t.prototype.getDefaultShape=function(){return new iU},t.prototype.buildPath=function(e,t){var n=t.points,r=t.stackedOnPoints,i=0,a=n.length/2,o=t.smoothMonotone;if(t.connectNulls){for(;a>0&&Pg(n[a*2-2],n[a*2-1]);a--);for(;i<a&&Pg(n[i*2],n[i*2+1]);i++);}for(;i<a;){var s=zg(e,n,i,a,a,1,t.smooth,o,t.connectNulls);zg(e,r,i+s-1,s,a,-1,t.stackedOnSmooth,o,t.connectNulls),i+=s+1,e.closePath()}},t}(JL),oU=Du(),sU=Bg(),cU=function(){function e(){this.group=new Sz,this.uid=_m(`viewChart`),this.renderTask=Fh({plan:Ug,reset:Wg}),this.renderTask.context={view:this}}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){},e.prototype.highlight=function(e,t,n,r){var i=e.getData(r&&r.dataType);i&&Hg(i,r,`emphasis`)},e.prototype.downplay=function(e,t,n,r){var i=e.getData(r&&r.dataType);i&&Hg(i,r,`normal`)},e.prototype.remove=function(e,t){this.group.removeAll()},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.updateVisual=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.eachRendered=function(e){Gf(this.group,e)},e.markUpdateMethod=function(e,t){oU(e).updateMethod=t},e.protoInitialize=function(){var t=e.prototype;t.type=`chart`}(),e}(),mo(cU,[`dispose`]),bo(cU),lU={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},uU=function(){function e(){}return e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(e){this._isBlank=e},e}(),bo(uU),dU=0,fU=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++dU,this._onCollect=e.onCollect}return e.createByAxisModel=function(t){var n=t.option,r=n.data,i=r&&R(r,e_);return new e({categories:i,needCollect:!i,deduplication:n.dedplication!==!1})},e.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},e.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if(!V(e)&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,this._onCollect&&this._onCollect(e,t),t;var r=this._getOrCreateMap();return t=r.get(e),t??(n?(t=this.categories.length,this.categories[t]=e,r.set(e,t),this._onCollect&&this._onCollect(e,t)):t=NaN),t},e.prototype._getOrCreateMap=function(){return this._map||=W(this.categories)},e}(),pU=Ba({needTransform:1,normalize:1,scale:1,transformIn:1,transformOut:1,contain:1,getExtent:1,getExtentUnsafe:1,setExtent:1,setExtent2:1,getFilter:1,sanitize:1,getDefaultStartValue:1,freeze:1}),mU={needTransform:function(){return!1},normalize:function(e){var t=this._extents[1]||this._extents[0];return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])},scale:function(e){var t=this._extents[1]||this._extents[0];return e*(t[1]-t[0])+t[0]},transformIn:function(e){return e},transformOut:function(e){return e},contain:function(e){var t=a_(this,null);return e>=t[0]&&e<=t[1]},getExtent:function(){return this._extents[0].slice()},getExtentUnsafe:function(e){return this._extents[e]},setExtent:function(e,t){l_(this._extents,0,e,t)},setExtent2:function(e,t,n){var r=this._extents;r[e]||(r[e]=r[0].slice()),l_(r,e,t,n)},freeze:function(){}},hU=function(e){F(t,e);function t(n){var r=e.call(this)||this;r.type=`ordinal`,r.parse=t.parse,n_(r,t.decoratedMethods);var i=n.ordinalMeta;i||=new fU({}),z(i)&&(i=new fU({categories:R(i,function(e){return H(e)?e.value:e})})),r._ordinalMeta=i;var a=t_(null,null,n.extent||[0,i.categories.length-1]);return r._mapper=a.mapper,r_(r,a.mapper),r}return t.parse=function(e){return e==null?e=NaN:V(e)?(e=this._ordinalMeta.getOrdinal(e),e??=NaN):e=_R(e),e},t.prototype.getTicks=function(){var e=[];return S_(this,0,function(t){e.push(t)}),e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(e==null)this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;else{for(var t=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],r=this._ticksByOrdinalNumber=[],i=0,a=this._ordinalMeta.categories.length,o=mR(a,t.length);i<o;++i){var s=n[i]=t[i];r[s]=i}for(var c=0;i<a;++i){for(;r[c]!=null;)c++;n[i]=c,r[c]=i}}},t.prototype._getTickNumber=function(e){var t=this._ticksByOrdinalNumber;return t&&e>=0&&e<t.length?t[e]:e},t.prototype.getRawOrdinalNumber=function(e){var t=this._ordinalNumbersByTick;return t&&e>=0&&e<t.length?t[e]:e},t.prototype.getLabel=function(e){if(!this.isBlank()){var t=this.getRawOrdinalNumber(e.value),n=this._ordinalMeta.categories[t];return n==null?``:n+``}},t.prototype.count=function(){var e=i_(this._mapper);return e[1]-e[0]+1},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.type=`ordinal`,t.decoratedMethods={needTransform:function(){return this._mapper.needTransform()},contain:function(e){return this._mapper.contain(this._getTickNumber(e))&&e>=0&&e<this._ordinalMeta.categories.length},normalize:function(e){return this._mapper.normalize(this._getTickNumber(e))},scale:function(e){return this.getRawOrdinalNumber(_R(this._mapper.scale(e)))},transformIn:function(e,t){return this._mapper.transformIn(this._getTickNumber(e),t)},transformOut:function(e,t){return this.getRawOrdinalNumber(this._mapper.transformOut(e,t))},getExtent:function(){return this._mapper.getExtent()},getExtentUnsafe:function(e,t){return this._mapper.getExtentUnsafe(e,t)},setExtent:function(e,t){return this._mapper.setExtent(e,t)},setExtent2:function(e,t,n){return this._mapper.setExtent2(e,t,n)}},t}(uU),uU.registerClass(hU),gU=function(e){F(t,e);function t(n){var r=e.call(this)||this;return r.type=`interval`,r.parse=t.parse,n||={},r.brk=t_(r,Im(r,n),null).brk,r._cfg={interval:0,intervalPrecision:2,intervalCount:void 0,niceExtent:void 0},r}return t.parse=function(e){return e==null||e===``?NaN:Number(e)},t.prototype.getConfig=function(){return ka(this._cfg)},t.prototype.setConfig=function(e){var t=i_(this);this._cfg=e=ka(e),e.niceExtent??(e.niceExtent=t.slice()),e.intervalPrecision??(e.intervalPrecision=g_(e.interval))},t.prototype.getTicks=function(e){e||={};var t=this._cfg,n=t.interval,r=i_(this),i=t.niceExtent,a=t.intervalPrecision,o=Fm(),s=this.brk,c=o&&s,l=[];if(!n)return l;if(e.breakTicks===`only_break`&&c)return o.addBreaksToTicks(l,s.breaks,r),l;var u=3e3;r[0]<i[0]&&l.push({value:e.expandToNicedExtent?Rl(i[0]-n,a):r[0]});for(var d=function(e,t){return _R((t-e)/n)},f=t.intervalCount,p=i[0],m=0;;m++){if(f==null){if(p>i[1]||!isFinite(p)||!isFinite(i[1]))break}else{if(m>f)break;p=mR(p,i[1]),m===f&&(p=i[1])}if(l.push({value:p}),p=Rl(p+n,a),s){var h=s.calcNiceTickMultiple(p,d);h>=0&&(p=Rl(p+h*n,a))}if(l.length>0&&p===l[l.length-1].value)break;if(l.length>u)return[]}var g=l.length?l[l.length-1].value:i[1];return r[1]>g&&l.push({value:e.expandToNicedExtent?Rl(g+n,a):r[1]}),c&&o.pruneTicksByBreak(e.pruneByBreak,l,s.breaks,function(e){return e.value},t.interval,r),c&&e.breakTicks!==`none`&&o.addBreaksToTicks(l,s.breaks,r),l},t.prototype.getMinorTicks=function(e){return C_(this,e,Lm(this),this._cfg.interval)},t.prototype.getLabel=function(e,t){if(e==null)return``;var n=t&&t.precision;return n==null?n=Bl(e.value)||0:n===`auto`&&(n=this._cfg.intervalPrecision),lh(Rl(e.value,n,!0))},t.type=`interval`,t}(uU),uU.registerClass(gU),_U=function(e,t,n,r){for(;n<r;){var i=n+r>>>1;e[i][1]<t?n=i+1:r=i}return n},vU=function(e){F(t,e);function t(n){var r=e.call(this)||this;return r.type=`time`,r.parse=t.parse,r._locale=n.locale,r._useUTC=n.useUTC,r._interval=0,r.brk=t_(r,Im(r,n),null).brk,r}return t.prototype.getLabel=function(e){return Gm(e.value,pH[Wm(Hm(this._minLevelUnit))]||pH.second,this._useUTC,this._locale)},t.prototype.getFormattedLabel=function(e,t,n){return Km(e,t,n,this._locale,this._useUTC)},t.prototype.getTicks=function(e){e||={};var t=this._interval,n=i_(this),r=Fm(),i=this.brk,a=r&&i,o=[];if(!t)return o;var s=this._useUTC;if(a&&e.breakTicks===`only_break`)return Fm().addBreaksToTicks(o,i.breaks,n),o;o=uee(this._minLevelUnit,this._approxInterval,s,n,s_(this),i);var c=mH.length-1,l=0;return L(o,function(e){e.time&&(c=Math.min(c,Na(mH,e.time.upperTimeUnit)),l=Math.max(l,e.time.level))}),a&&Fm().pruneTicksByBreak(e.pruneByBreak,o,i.breaks,function(e){return e.value},this._approxInterval,n),a&&e.breakTicks!==`none`&&Fm().addBreaksToTicks(o,i.breaks,n,function(e){for(var t=Math.max(Na(mH,qm(e.vmin,s)),Na(mH,qm(e.vmax,s))),n=0,r=0;r<mH.length;r++)if(!w_(mH[r],e.vmin,e.vmax,s)){n=r;break}var i=Math.min(n,c);return{level:l,lowerTimeUnit:mH[Math.max(i,t)],upperTimeUnit:mH[i]}}),o},t.prototype.getMinorTicks=function(e){return C_(this,e,Lm(this),this._interval)},t.prototype.setTimeInterval=function(e){this._interval=e.interval,this._approxInterval=e.approxInterval,this._minLevelUnit=e.minLevelUnit},t.parse=function(e){return Wa(e)?Math.round(e):+ql(e)},t.type=`time`,t}(uU),yU=[[`second`,iH],[`minute`,aH],[`hour`,oH],[`quarter-day`,oH*6],[`half-day`,oH*12],[`day`,sH*1.2],[`half-week`,sH*3.5],[`week`,sH*7],[`month`,sH*31],[`quarter`,sH*95],[`half-year`,cH/2],[`year`,cH]],bU=function(e,t){var n=e.getExtent();if(n[0]===n[1]&&(n[0]-=sH,n[1]+=sH),n[1]===-1/0&&n[0]===1/0){var r=new Date;n[1]=+new Date(r.getFullYear(),r.getMonth(),r.getDate()),n[0]=n[1]-sH}e.setExtent(n[0],n[1]);var i=x_(t.splitNumber,10),a=s_(e)/i,o=t.minInterval,s=t.maxInterval;o!=null&&a<o&&(a=o),s!=null&&a>s&&(a=s);var c=yU.length,l=Math.min(_U(yU,a,0,c),c-1),u=yU[l][1],d=yU[Math.max(l-1,0)][0];e.setTimeInterval({approxInterval:a,interval:u,minLevelUnit:d})},uU.registerClass(vU),xU=0,SU=1,CU=2,wU=function(e){F(t,e);function t(n){var r=e.call(this)||this;r.type=`log`,r.parse=gU.parse,r.base=n.logBase||10;var i=[],a=[],o=r._lookup={from:i,to:a};i[xU]=i[SU]=a[xU]=a[SU]=NaN,n_(r,t.mapperMethods);var s=Fm(),c=n.breakOption,l={lookup:o};return s&&s.parseAxisBreakOptionInwardTransform(c,r,{noNegative:!0},CU,l),r.powStub=new gU({breakParsed:l.original}),r.intervalStub=new gU({breakParsed:l.transformed}),r_(r,r.intervalStub),r}return t.prototype.getTicks=function(e){var t=this.base,n=this.powStub,r=Fm(),i=this.intervalStub,a={lookup:{from:i.getExtent(),to:n.getExtent()}};return R(i.getTicks(e||{}),function(e){var i=e.value,o=v_(i,t,a),s;if(r){var c=r.getTicksBreakOutwardTransform(this,e,Lm(n),this._lookup);c&&(s=c.vBreak,o=c.tickVal)}return{value:o,break:s}},this)},t.prototype.getMinorTicks=function(e){return C_(this,e,Lm(this.powStub),this.intervalStub.getConfig().interval)},t.prototype.getLabel=function(e,t){return this.intervalStub.getLabel(e,t)},t.type=`log`,t.mapperMethods={needTransform:function(){return!0},normalize:function(e){return this.intervalStub.normalize(__(e,this.base))},scale:function(e){return v_(this.intervalStub.scale(e),this.base,null)},transformIn:function(e,t){return e=__(e,this.base),t&&t.depth===2?e:this.intervalStub.transformIn(e,t)},transformOut:function(e,t){var n=t?t.depth:null;return TU.depth=n,EU.lookup=this._lookup,v_(n===2?e:this.intervalStub.transformOut(e,TU),this.base,EU)},contain:function(e){return this.powStub.contain(e)},setExtent:function(e,t){this.setExtent2(0,e,t)},setExtent2:function(e,t,n){if(!(!Uu(t,n)||t<=0||n<=0)){var r=DU,i=DU;if(e===0){var a=this._lookup;r=a.to,i=a.from}this.powStub.setExtent2(e,r[xU]=t,r[SU]=n);var o=this.base;this.intervalStub.setExtent2(e,i[xU]=__(t,o),i[SU]=__(n,o))}},getFilter:function(){return{g:0}},sanitize:function(e,t){return Uu(t[0],t[1])&&ru(e)&&e<=0&&(e=t[0]),e},getDefaultStartValue:function(){return 1},getExtent:function(){return this.powStub.getExtent()},getExtentUnsafe:function(e,t){return t===null?this.powStub.getExtentUnsafe(e,null):this.intervalStub.getExtentUnsafe(e,t)}},t}(uU),uU.registerClass(wU),TU={},EU={},DU=[],OU={value:1,category:1,time:1,log:1},kU=Du(),AU=function(e){F(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(){var e=new Sz,t=new ZH;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e,this._changePolyState=q(this._changePolyState,this)},t.prototype.render=function(e,t,n){var r=e.coordinateSystem,i=this.group,a=e.getData(),o=e.getModel(`lineStyle`),s=e.getModel(`areaStyle`),c=a.getLayout(`points`)||[],l=r.type===`polar`,u=this._coordSys,d=this._symbolDraw,f=this._polyline,p=this._polygon,m=this._lineGroup,h=!t.ssr&&e.get(`animation`),g=!s.isEmpty(),_=s.get(`origin`),v=jg(r,a,_),y=g&&Q_(r,a,v),b=e.get(`showSymbol`),x=e.get(`connectNulls`),S=b&&!l&&nv(e,a,r),C=this._data;C&&C.eachItemGraphicEl(function(e,t){e.__temp&&(i.remove(e),C.setItemGraphicEl(t,null))}),b||d.remove(),i.add(m);var w=!l&&e.get(`step`),T;r&&r.getArea&&e.get(`clip`,!0)&&(T=r.getArea(),T.width==null?T.r0&&(T.r0-=.5,T.r+=.5):(T.x-=.1,T.y-=.1,T.width+=.2,T.height+=.2)),this._clipShapeForSymbol=T;var E=tv(a,r,n)||a.getVisual(`style`)[a.getVisual(`drawType`)];if(!(f&&u.type===r.type&&w===this._step))b&&d.updateData(a,{isIgnore:S,clipShape:T,disableAnimation:!0,getSymbolPoint:function(e){return[c[e*2],c[e*2+1]]}}),h&&this._initSymbolLabelAnimation(a,r,T),w&&(y&&=$_(y,c,r,w,x),c=$_(c,null,r,w,x)),f=this._newPolyline(c),g?p=this._newPolygon(c,y):p&&=(m.remove(p),this._polygon=null),l||this._initOrUpdateEndLabel(e,r,hh(E)),m.setClipPath(cv(this,r,!0,e));else{g&&!p?p=this._newPolygon(c,y):p&&!g&&(m.remove(p),p=this._polygon=null),l||this._initOrUpdateEndLabel(e,r,hh(E));var D=m.getClipPath();D?ff(D,{shape:cv(this,r,!1,e).shape},e):m.setClipPath(cv(this,r,!0,e)),b&&d.updateData(a,{isIgnore:S,clipShape:T,disableAnimation:!0,getSymbolPoint:function(e){return[c[e*2],c[e*2+1]]}}),J_(this._stackedOnPoints,y)&&J_(this._points,c)||(h?this._doUpdateAnimation(a,y,r,n,w,_,x):(w&&(y&&=$_(y,c,r,w,x),c=$_(c,null,r,w,x)),f.setShape({points:c}),p&&p.setShape({points:c,stackedOnPoints:y})))}var O=e.getModel(`emphasis`),k=O.get(`focus`),A=O.get(`blurScope`),j=O.get(`disabled`);if(f.useStyle(Ma(o.getLineStyle(),{fill:`none`,stroke:E,lineJoin:`bevel`})),Ld(f,e,`lineStyle`),f.style.lineWidth>0&&e.get([`emphasis`,`lineStyle`,`width`])===`bolder`){var M=f.getState(`emphasis`).style;M.lineWidth=+f.style.lineWidth+1}LR(f).seriesIndex=e.seriesIndex,Fd(f,k,A,j);var ee=Z_(e.get(`smooth`)),te=e.get(`smoothMonotone`);if(f.setShape({smooth:ee,smoothMonotone:te,connectNulls:x}),p){var ne=a.getCalculationInfo(`stackedOnSeries`),re=0;p.useStyle(Ma(s.getAreaStyle(),{fill:E,opacity:.7,lineJoin:`bevel`,decal:a.getVisual(`style`).decal})),ne&&(re=Z_(ne.get(`smooth`))),p.setShape({smooth:ee,stackedOnSmooth:re,smoothMonotone:te,connectNulls:x}),Ld(p,e,`areaStyle`),LR(p).seriesIndex=e.seriesIndex,Fd(p,k,A,j)}var ie=this._changePolyState;a.eachItemGraphicEl(function(e){e&&(e.onHoverStateChange=ie)}),this._polyline.onHoverStateChange=ie,this._data=a,this._coordSys=r,this._stackedOnPoints=y,this._points=c,this._step=w,this._valueOrigin=_;var ae=e.get(`triggerEvent`),oe=e.get(`triggerLineEvent`),se=oe===!0||ae===!0||ae===`line`,ce=oe===!0||ae===!0||ae===`area`;this.packEventData(e,f,se),p&&this.packEventData(e,p,ce)},t.prototype.packEventData=function(e,t,n){LR(t).eventData=n?{componentType:`series`,componentSubType:`line`,componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:`line`,selfType:t===this._polygon?`area`:`line`}:null},t.prototype.highlight=function(e,t,n,r){var i=e.getData(),a=Eu(i,r);if(this._changePolyState(`emphasis`),!(a instanceof Array)&&a!=null&&a>=0){var o=i.getLayout(`points`),s=i.getItemGraphicEl(a);if(!s){var c=o[a*2],l=o[a*2+1];if(Pg(c,l)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,l))return;var u=e.get(`zlevel`)||0,d=e.get(`z`)||0;s=new XH(i,a),s.x=c,s.y=l,s.setZ(u,d);var f=s.getSymbolPath().getTextContent();f&&(f.zlevel=u,f.z=d,f.z2=this._polyline.z2+1),s.__temp=!0,i.setItemGraphicEl(a,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else cU.prototype.highlight.call(this,e,t,n,r)},t.prototype.downplay=function(e,t,n,r){var i=e.getData(),a=Eu(i,r);if(this._changePolyState(`normal`),a!=null&&a>=0){var o=i.getItemGraphicEl(a);o&&(o.__temp?(i.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else cU.prototype.downplay.call(this,e,t,n,r)},t.prototype._changePolyState=function(e){var t=this._polygon;dd(this._polyline,e),t&&dd(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new rU({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new aU({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var r,i,a=t.getBaseAxis(),o=a.inverse;t.type===`cartesian2d`?(r=a.isHorizontal(),i=!1):t.type===`polar`&&(r=a.dim===`angle`,i=!0);var s=e.hostModel,c=s.get(`animationDuration`);B(c)&&(c=c(null));var l=s.get(`animationDelay`)||0,u=B(l)?l(null):l;e.eachItemGraphicEl(function(e,a){var s=e;if(s){var d=[e.x,e.y],f=void 0,p=void 0,m=void 0;if(n){if(i){var h=n,g=t.pointToCoord(d);r?(f=h.startAngle,p=h.endAngle,m=-g[1]/180*Math.PI):(f=h.r0,p=h.r,m=g[0])}else{var _=n;r?(f=_.x,p=_.x+_.width,m=e.x):(f=_.y+_.height,p=_.y,m=e.y)}}var v=p===f?0:(m-f)/(p-f);o&&(v=1-v);var y=B(l)?l(a):c*v+u,b=s.getSymbolPath(),x=b.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:y}),x&&x.animateFrom({style:{opacity:0}},{duration:300,delay:y}),b.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(e,t,n){var r=e.getModel(`endLabel`);if(sv(e)){var i=e.getData(),a=this._polyline,o=i.getLayout(`points`);if(!o){a.removeTextContent(),this._endLabel=null;return}var s=this._endLabel;s||(s=this._endLabel=new cR({z2:200}),s.ignoreClip=!0,a.setTextContent(this._endLabel),a.disableLabelAnimation=!0);var c=iv(o);c>=0&&(ip(a,ap(e,`endLabel`),{inheritColor:n,labelFetcher:e,labelDataIndex:c,defaultText:function(e,t,n){return n==null?wg(i,e):Tg(i,n)},enableTextSetter:!0},lv(r,t)),a.textConfig.position=null)}else this._endLabel&&=(this._polyline.removeTextContent(),null)},t.prototype._endLabelOnDuring=function(e,t,n,r,i,a,o){var s=this._endLabel,c=this._polyline;if(s){e<1&&r.originalX==null&&(r.originalX=s.x,r.originalY=s.y);var l=n.getLayout(`points`),u=n.hostModel,d=u.get(`connectNulls`),f=a.get(`precision`),p=a.get(`distance`)||0,m=o.getBaseAxis(),h=m.isHorizontal(),g=m.inverse,_=t.shape,v=g?h?_.x:_.y+_.height:h?_.x+_.width:_.y,y=(h?p:0)*(g?-1:1),b=(h?0:-p)*(g?-1:1),x=h?`x`:`y`,S=ov(l,v,x),C=S.range,w=C[1]-C[0],T=void 0;if(w>=1){if(w>1&&!d){var E=av(l,C[0]);s.attr({x:E[0]+y,y:E[1]+b}),i&&(T=u.getRawValue(C[0]))}else{var E=c.getPointOn(v,x);E&&s.attr({x:E[0]+y,y:E[1]+b});var D=u.getRawValue(C[0]),O=u.getRawValue(C[1]);i&&(T=Iu(n,f,D,O,S.t))}r.lastFrameIndex=C[0]}else{var k=e===1||r.lastFrameIndex>0?C[0]:0,E=av(l,k);i&&(T=u.getRawValue(k)),s.attr({x:E[0]+y,y:E[1]+b})}if(i){var A=AB(s);typeof A.setLabelText==`function`&&A.setLabelText(T)}}},t.prototype._doUpdateAnimation=function(e,t,n,r,i,a,o){var s=this._polyline,c=this._polygon,l=e.hostModel,u=Rg(this._data,e,this._stackedOnPoints,t,this._coordSys,n,this._valueOrigin,a),d=u.current,f=u.stackedOnCurrent,p=u.next,m=u.stackedOnNext;if(i&&(f=$_(u.stackedOnCurrent,u.current,n,i,o),d=$_(u.current,null,n,i,o),m=$_(u.stackedOnNext,u.next,n,i,o),p=$_(u.next,null,n,i,o)),X_(d,p)>3e3||c&&X_(f,m)>3e3)s.stopAnimation(),s.setShape({points:p}),c&&(c.stopAnimation(),c.setShape({points:p,stackedOnPoints:m}));else{s.shape.__points=u.current,s.shape.points=d;var h={shape:{points:p}};u.current!==d&&(h.shape.__points=u.next),s.stopAnimation(),df(s,h,l),c&&(c.setShape({points:d,stackedOnPoints:f}),c.stopAnimation(),df(c,{shape:{stackedOnPoints:m}},l),s.shape.points!==c.shape.points&&(c.shape.points=s.shape.points));for(var g=[],_=u.status,v=0;v<_.length;v++)if(_[v].cmd===`=`){var y=e.getItemGraphicEl(_[v].idx1);y&&g.push({el:y,ptIdx:v})}s.animators&&s.animators.length&&s.animators[0].during(function(){c&&c.dirtyShape();for(var e=s.shape.__points,t=0;t<g.length;t++){var n=g[t].el,r=g[t].ptIdx*2;n.x=e[r],n.y=e[r+1],n.markRedraw()}})}},t.prototype.remove=function(e){var t=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),n&&n.eachItemGraphicEl(function(e,r){e.__temp&&(t.remove(e),n.setItemGraphicEl(r,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},t.type=`line`,t}(cU),jU={average:function(e){for(var t=0,n=0,r=0;r<e.length;r++)isNaN(e[r])||(t+=e[r],n++);return n===0?NaN:t/n},sum:function(e){for(var t=0,n=0;n<e.length;n++)t+=e[n]||0;return t},max:function(e){for(var t=-1/0,n=0;n<e.length;n++)e[n]>t&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;n<e.length;n++)e[n]<t&&(t=e[n]);return isFinite(t)?t:NaN},nearest:function(e){return e[0]}},MU=function(e){return Math.round(e.length/2)},NU=Du(),PU=Du(),FU={estimate:1,determine:2},IU=xv(`axisTick`),LU=xv(`axisLabel`),RU=Du(),zU=Ku(),BU=Du(),VU=Du(),HU={},UU=W(),WU=.8,GU=[0,1],KU=function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]);return e>=n&&e<=r},e.prototype.containData=function(e){return this.scale.contain(this.scale.parse(e))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this.scale;return e=n.normalize(n.parse(e)),Nl(e,GU,Qv(this),t)},e.prototype.coordToData=function(e,t){var n=Nl(e,Qv(this),GU,t);return this.scale.scale(n)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){e||={};var t=e.tickModel||this.getTickModel(),n=R(hv(this,t,{breakTicks:e.breakTicks,pruneByBreak:e.pruneByBreak}).ticks,function(e){return{coord:this.dataToCoord(K_(this.scale,e)),tick:e}},this),r=t.get(`alignWithLabel`),i=$v(this,n,r);return R(n,function(e){return{coord:e.coord,tickValue:e.tick.value,onBand:i}})},e.prototype.getMinorTicksCoords=function(){if(m_(this.scale))return[];var e=this.model.getModel(`minorTick`).get(`splitNumber`);return e>0&&e<100||(e=5),R(this.scale.getMinorTicks(e),function(e){return R(e,function(e){return{coord:this.dataToCoord(e),tickValue:e}},this)},this)},e.prototype.getViewLabels=function(e){return e||=pv(FU.determine),mv(this,e).labels},e.prototype.getLabelModel=function(){return this.model.getModel(`axisLabel`)},e.prototype.getTickModel=function(){return this.model.getModel(`axisTick`)},e.prototype.getBandWidth=function(){return Yv(this,{min:1}).w},e.prototype.calculateCategoryInterval=function(e){return e||=pv(FU.determine),Tv(this,e)},e}(),qU=function(e){F(t,e);function t(t,n,r,i,a){var o=e.call(this,t,n,r)||this;return o.index=0,o.type=i||`value`,o.position=a||`bottom`,o}return t.prototype.isHorizontal=function(){var e=this.position;return e===`top`||e===`bottom`},t.prototype.getGlobalExtent=function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},t.prototype.pointToData=function(e,t){return this.coordToData(this.toLocalCoord(e[this.dim===`x`?0:1]),t)},t.prototype.setCategorySortInfo=function(e){if(this.type!==`category`)return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(KU),JU=[`label`,`labelLine`,`layoutOption`,`priority`,`defaultAttr`,`marginForce`,`minMarginForce`,`marginDefault`,`suggestIgnore`],YU=1,XU=2,ZU=YU|XU,QU=[0,0,0,0],$U=null,eW=`expandAxisBreak`,tW=`collapseAxisBreak`,nW=`toggleAxisBreak`,rW=`axisbreakchanged`,iW={type:eW,event:rW,update:`update`,refineEvent:py},aW={type:tW,event:rW,update:`update`,refineEvent:py},oW={type:nW,event:rW,update:`update`,refineEvent:py},sW=Math.PI,cW=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],lW=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],uW=Du(),dW=Du(),fW=function(){function e(e){this.recordMap={},this.resolveAxisNameOverlap=e}return e.prototype.ensureRecord=function(e){var t=e.axis.dim,n=e.componentIndex,r=this.recordMap,i=r[t]||(r[t]=[]);return i[n]||(i[n]={ready:{}})},e}(),pW=Eo(),mW=new J(0,0,0,0),hW=function(e,t,n,r,i,a){if(V_(e.nameLocation)){var o=a.stOccupiedRect;o&&gy(iy({},o,a.transGroup.transform),r,i)}else _y(a.labelInfoList,a.dirVec,r,i)},gW=function(){function e(e,t,n,r){this.group=new Sz,this._axisModel=e,this._api=t,this._local={},this._shared=r||new fW(hW),this._resetCfgDetermined(n)}return e.prototype.updateCfg=function(e){var t=this._cfg.raw;t.position=e.position,t.labelOffset=e.labelOffset,this._resetCfgDetermined(t)},e.prototype.__getRawCfg=function(){return this._cfg.raw},e.prototype._resetCfgDetermined=function(e){var t=this._axisModel,n=t.getDefaultOption?t.getDefaultOption():{},r=U(e.axisName,t.get(`name`)),i=t.get(`nameMoveOverlap`);(i==null||i===`auto`)&&(i=U(e.defaultNameMoveOverlap,!0));var a={raw:e,position:e.position,rotation:e.rotation,nameDirection:U(e.nameDirection,1),tickDirection:U(e.tickDirection,1),labelDirection:U(e.labelDirection,1),labelOffset:U(e.labelOffset,0),silent:U(e.silent,!0),axisName:r,nameLocation:Qa(t.get(`nameLocation`),n.nameLocation,`end`),shouldNameMoveOverlap:jy(r)&&i,optionHideOverlap:t.get([`axisLabel`,`hideOverlap`]),showMinorTicks:t.get([`minorTick`,`show`])};this._cfg=a;var o=new Sz({x:a.position[0],y:a.position[1],rotation:a.rotation});o.updateTransform(),this._transformGroup=o;var s=this._shared.ensureRecord(t);s.transGroup=this._transformGroup,s.dirVec=new wF(Math.cos(-a.rotation),Math.sin(-a.rotation))},e.prototype.build=function(e,t){var n=this;return e||={axisLine:!0,axisTickLabelEstimate:!1,axisTickLabelDetermine:!0,axisName:!0},L(_W,function(r){e[r]&&vW[r](n._cfg,n._local,n._shared,n._axisModel,n.group,n._transformGroup,n._api,t||{})}),this},e.innerTextLayout=function(e,t,n){var r=Gl(t-e),i,a;return Kl(r)?(a=n>0?`top`:`bottom`,i=`center`):Kl(r-sW)?(a=n>0?`bottom`:`top`,i=`center`):(a=`middle`,i=r>0&&r<sW?n>0?`right`:`left`:n>0?`left`:`right`),{rotation:r,textAlign:i,textVerticalAlign:a}},e.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+`Index`]=e.componentIndex,t},e.isLabelSilent=function(e){var t=e.get(`tooltip`);return e.get(`silent`)||!(e.get(`triggerEvent`)||t&&t.show)},e}(),_W=[`axisLine`,`axisTickLabelEstimate`,`axisTickLabelDetermine`,`axisName`],vW={axisLine:function(e,t,n,r,i,a,o){var s=r.get([`axisLine`,`show`]);if(s===`auto`&&(s=!0,e.raw.axisLineAutoShow!=null&&(s=!!e.raw.axisLineAutoShow)),s){var c=r.axis.getExtent(),l=a.transform,u=[c[0],0],d=[c[1],0],f=u[0]>d[0];l&&(qo(u,u,l),qo(d,d,l));var p=I({lineCap:`round`},r.getModel([`axisLine`,`lineStyle`]).getLineStyle()),m={strokeContainThreshold:e.raw.strokeContainThreshold||5,silent:!0,z2:1,style:p};if(r.get([`axisLine`,`breakLine`])&&Rm(r.axis.scale))fy().buildAxisBreakLine(r,i,a,m);else{var h=new Jz(I({shape:{x1:u[0],y1:u[1],x2:d[0],y2:d[1]}},m));Ef(h.shape,h.style.lineWidth),h.anid=`line`,i.add(h)}var g=r.get([`axisLine`,`symbol`]);if(g!=null){var _=r.get([`axisLine`,`symbolSize`]);V(g)&&(g=[g,g]),(V(_)||Wa(_))&&(_=[_,_]);var v=Cg(r.get([`axisLine`,`symbolOffset`])||0,_),y=_[0],b=_[1];L([{rotate:e.rotation+Math.PI/2,offset:v[0],r:0},{rotate:e.rotation-Math.PI/2,offset:v[1],r:Math.sqrt((u[0]-d[0])*(u[0]-d[0])+(u[1]-d[1])*(u[1]-d[1]))}],function(t,n){if(g[n]!==`none`&&g[n]!=null){var r=xg(g[n],-y/2,-b/2,y,b,p.stroke,!0),a=t.r+t.offset,o=f?d:u;r.attr({rotation:t.rotate,x:o[0]+a*Math.cos(e.rotation),y:o[1]-a*Math.sin(e.rotation),silent:!0,z2:11}),i.add(r)}})}}},axisTickLabelEstimate:function(e,t,n,r,i,a,o,s){Ey(t,i,s)&&vy(e,t,n,r,i,a,o,FU.estimate)},axisTickLabelDetermine:function(e,t,n,r,i,a,o,s){Ey(t,i,s)&&vy(e,t,n,r,i,a,o,FU.determine);var c=wy(e,i,a,r);xy(e,t.labelLayoutList,c),Ty(e,i,a,r,e.tickDirection)},axisName:function(e,t,n,r,i,a,o,s){var c=n.ensureRecord(r);t.nameEl&&=(i.remove(t.nameEl),c.nameLayout=c.nameLocation=null);var l=e.axisName;if(jy(l)){var u=e.nameLocation,d=e.nameDirection,f=r.getModel(`nameTextStyle`),p=r.get(`nameGap`)||0,m=r.axis.getExtent(),h=r.axis.inverse?-1:1,g=new wF(0,0),_=new wF(0,0);u===`start`?(g.x=m[0]-h*p,_.x=-h):u===`end`?(g.x=m[1]+h*p,_.x=h):(g.x=(m[0]+m[1])/2,g.y=e.labelOffset+d*p,_.y=d);var v=Eo();_.transform(jo(v,v,e.rotation));var y=r.get(`nameRotate`);y!=null&&(y=y*sW/180);var b,x;V_(u)?b=gW.innerTextLayout(e.rotation,y??e.rotation,d):(b=yy(e.rotation,u,y||0,m),x=e.raw.axisNameAvailableWidth,x!=null&&(x=Math.abs(x/Math.sin(b.rotation)),!isFinite(x)&&(x=null)));var S=f.getFont(),C=r.get(`nameTruncate`,!0)||{},w=C.ellipsis,T=Za(e.raw.nameTruncateMaxWidth,C.maxWidth,x),E=s.nameMarginLevel||0,D=new cR({x:g.x,y:g.y,rotation:b.rotation,silent:gW.isLabelSilent(r),style:op(f,{text:l,font:S,overflow:`truncate`,width:T,ellipsis:w,fill:f.getTextColor()||r.get([`axisLine`,`lineStyle`,`color`]),align:f.get(`align`)||b.textAlign,verticalAlign:f.get(`verticalAlign`)||b.textVerticalAlign}),z2:1});if(Uf({el:D,componentModel:r,itemName:l}),D.__fullText=l,D.anid=`name`,r.get(`triggerEvent`)){var O=gW.makeAxisEventDataBase(r);O.targetType=`axisName`,O.name=l,LR(D).eventData=O}a.add(D),D.updateTransform(),t.nameEl=D;var k=c.nameLayout=ny({label:D,priority:D.z2,defaultAttr:{ignore:D.ignore},marginDefault:V_(u)?cW[E]:lW[E]});if(c.nameLocation=u,i.add(D),D.decomposeTransform(),e.shouldNameMoveOverlap&&k){var A=n.ensureRecord(r);n.resolveAxisNameOverlap(e,n,r,k,_,A)}}}},yW=new rR,bW=new rR,xW=Du(),SW=3,CW=function(){function e(e,t,n,r,i){var a=m_(e),o=a?t.getCategories().length:null,s;if(a){var c=t.getCategories(!0);s=c&&!c.length}var l=n.slice();(d_(e)||p_(e)||f_(e))&&(zu(l,By(e,t.get(`dataMin`,!0))),Bu(l,By(e,t.get(`dataMax`,!0)))),Wu(l)||(l[0]=l[1]=NaN);var u=[],d=[!1,!1],f=t.get(`min`,!0);f===`dataMin`?(u[0]=l[0],d[0]=!0):(u[0]=By(e,B(f)?f({min:l[0],max:l[1]}):f),d[0]=u[0]!=null);var p=t.get(`max`,!0);p===`dataMax`?(u[1]=l[1],d[1]=!0):(u[1]=By(e,B(p)?p({min:l[0],max:l[1]}):p),d[1]=u[1]!=null);var m=Vy(e,t),h=a?null:l[1]-l[0]||Math.abs(l[0]);u[0]??=a?s?l[0]:o?0:NaN:l[0]-m[0]*h,u[1]??=a?s?l[1]:o?o-1:NaN:l[1]+m[1]*h,!Hu(u[0])&&(u[0]=NaN),!Hu(u[1])&&(u[1]=NaN);var g=s||Xa(u[0])||Xa(u[1])||a&&!o,_=d_(e),v=_&&t.needIncludeZero&&t.needIncludeZero();v&&(u[0]>0&&u[1]>0&&!d[0]&&(u[0]=0),u[0]<0&&u[1]<0&&!d[1]&&(u[1]=0));var y=!1;u[0]>u[1]&&(u.reverse(),y=!0);var b=By(e,t.get(`startValue`,!0)),x=b!=null;!ru(b)&&r&&(b=e.getDefaultStartValue?e.getDefaultStartValue():0),ru(b)&&(x||!_||v)&&(b<u[0]&&!d[0]?(u[0]=b,d[0]=!0):b>u[1]&&!d[1]&&(u[1]=b,d[1]=!0)),zy(this._i={scale:e,dataMM:l,noZoomEffMM:u,zoomMM:[],fixMM:d,zoomFixMM:[!1,!1],startValue:b,isBlank:g,incl0:v,tggAxInv:y,ctnShp:i},u)}return e.prototype.makeNoZoom=function(){return this._i.noZoomEffMM.slice()},e.prototype.makeFinal=function(){var e=this._i,t=e.zoomMM,n=e.noZoomEffMM,r=e.zoomFixMM,i=e.fixMM,a={fixMM:i,zoomFixMM:r,isBlank:e.isBlank,incl0:e.incl0,tggAxInv:e.tggAxInv,ctnShp:e.ctnShp,effMM:n.slice()},o=a.effMM;return t[0]!=null&&(o[0]=t[0],i[0]=r[0]=!0),t[1]!=null&&(o[1]=t[1],i[1]=r[1]=!0),zy(e,o),a},e.prototype.makeRenderInfo=function(){return{startValue:this._i.startValue}},e.prototype.setZoomMM=function(e,t){this._i.zoomMM[e]=t},e}(),wW=W(),TW=Ig({ctor:$H},50),EW={left:0,right:0,top:0,bottom:0},DW=[`25%`,`25%`],OW=`cartesian2d`,kW=function(e){F(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(t,n){var r=Dh(t.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),r&&t.outerBounds&&Eh(t.outerBounds,r)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&t.outerBounds&&Eh(this.option.outerBounds,t.outerBounds)},t.type=`grid`,t.dependencies=[`xAxis`,`yAxis`],t.layoutMode=`box`,t.defaultOption={show:!1,z:0,left:`15%`,top:65,right:`10%`,bottom:80,containLabel:!1,outerBoundsMode:`auto`,outerBounds:EW,outerBoundsContain:`all`,outerBoundsClampWidth:DW[0],outerBoundsClampHeight:DW[1],backgroundColor:X.color.transparent,borderWidth:1,borderColor:X.color.neutral30},t}(TH),AW=Ku(),jW=`__ec_stack_`,MW=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(e,t){return mm(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e,t,n){var r=this.coordinateSystem;if(r&&r.clampData){var i=r.clampData(e),a=r.dataToPoint(i);if(n)L(r.getAxes(),function(e,n){if(e.type===`category`&&t!=null){var r=e.getTicksCoords(),o=e.getTickModel().get(`alignWithLabel`),s=i[n],c=t[n]===`x1`||t[n]===`y1`;if(c&&!o&&(s+=1),r.length<2)return;if(r.length===2){a[n]=e.toGlobalCoord(e.getExtent()[+!!c]);return}for(var l=void 0,u=void 0,d=1,f=0;f<r.length;f++){var p=r[f].coord,m=f===r.length-1?r[f-1].tickValue+d:r[f].tickValue;if(m===s){u=p;break}if(m<s)l=p;else if(l!=null&&m>s){u=(p+l)/2;break}f===1&&(d=m-r[0].tickValue)}u??(l?l&&(u=r[r.length-1].coord):u=r[0].coord),a[n]=e.toGlobalCoord(u)}});else{var o=this.getData(),s=o.getLayout(`offset`),c=o.getLayout(`size`),l=+!r.getBaseAxis().isHorizontal();a[l]+=s+c/2}return a}return[NaN,NaN]},t.prototype.__requireStartValue=function(e){return this.getBaseAxis()!==e},t.type=`series.__base_bar__`,t.defaultOption={z:2,coordinateSystem:`cartesian2d`,legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:`mod`,defaultBarGap:`10%`},t}(UH),UH.registerClass(MW),NW=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(){return mm(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get(`realtimeSort`,!0)||null})},t.prototype.getProgressive=function(){return this.get(`large`)?this.get(`progressive`):!1},t.prototype.__preparePipelineContext=function(e,t){var n=Zu(this,e,t);return n.progressiveRender&&(n.large=!0),n},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type=`series.bar`,t.dependencies=[`grid`,`polar`],t.defaultOption=bm(MW.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:`rgba(180, 180, 180, 0.2)`,borderColor:null,borderWidth:0,borderType:`solid`,borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:X.color.primary,borderWidth:2}},realtimeSort:!1}),t}(MW),PW=`\0__throttleOriginMethod`,FW=`\0__throttleRate`,IW=`\0__throttleType`,LW=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e}(),RW=function(e){F(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`sausage`,n}return t.prototype.getDefaultShape=function(){return new LW},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r0||0,0),a=Math.max(t.r,0),o=(a-i)*.5,s=i+o,c=t.startAngle,l=t.endAngle,u=t.clockwise,d=Math.PI*2,f=u?l-c<d:c-l<d;f||(c=l-(u?d:-d));var p=Math.cos(c),m=Math.sin(c),h=Math.cos(l),g=Math.sin(l);f?(e.moveTo(p*i+n,m*i+r),e.arc(p*s+n,m*s+r,o,-Math.PI+c,c,!u)):e.moveTo(p*a+n,m*a+r),e.arc(n,r,a,c,l,!u),e.arc(h*s+n,g*s+r,o,l-Math.PI*2,l-Math.PI,!u),i!==0&&e.arc(n,r,i,l,c,u)},t}(JL),zW=Math.max,BW=Math.min,VW=function(e){F(t,e);function t(){var t=e.call(this)||this;return t.type=`bar`,t._isFirstFrame=!0,t}return t.prototype.render=function(e,t,n,r){this._model=e,this._removeOnRenderedListener(n),this._updateDrawMode(e);var i=e.get(`coordinateSystem`);(i===`cartesian2d`||i===`polar`)&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(e,t,n):this._renderNormal(e,t,n,r))},t.prototype.incrementalPrepareRender=function(e){this._clear(),this._updateDrawMode(e),this._updateLargeClip(e)},t.prototype.incrementalRender=function(e,t){this._progressiveEls=[],this._incrementalRenderLarge(e,t)},t.prototype.eachRendered=function(e){Gf(this._progressiveEls||this.group,e)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;(this._isLargeDraw==null||t!==this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e,t,n,r){var i=this.group,a=e.getData(),o=this._data,s=e.coordinateSystem,c=s.getBaseAxis(),l;s.type===`cartesian2d`?l=c.isHorizontal():s.type===`polar`&&(l=c.dim===`angle`);var u=e.isAnimationEnabled()?e:null,d=Cb(e,s);d&&this._enableRealtimeSort(d,a,n);var f=e.get(`clip`,!0)||d,p=s.getArea();i.removeClipPath();var m=e.get(`roundCap`,!0),h=e.get(`showBackground`,!0),g=e.getModel(`backgroundStyle`),_=g.get(`borderRadius`)||0,v=[],y=this._backgroundEls,b=r&&r.isInitSort,x=r&&r.type===`changeAxisOrder`;function S(e){var t=qW[s.type](a,e);if(!t)return null;var n=Nb(s,l,t);return n.useStyle(g.getItemStyle()),s.type===`cartesian2d`?n.setShape(`r`,_):n.setShape(`cornerRadius`,_),v[e]=n,n}a.diff(o).add(function(t){var n=a.getItemModel(t),r=qW[s.type](a,t,n);if(r&&(h&&S(t),a.hasValue(t)&&KW[s.type](r))){var o=!1;f&&(o=HW[s.type](p,r));var g=UW[s.type](e,a,t,r,l,u,c.model,!1,m);d&&(g.forceLabelAnimation=!0),Ob(g,a,t,n,r,e,l,s.type===`polar`),b?g.attr({shape:r}):d?wb(d,u,g,r,t,l,!1,!1):ff(g,{shape:r},e,t),a.setItemGraphicEl(t,g),i.add(g),g.ignore=o}}).update(function(t,n){var r=a.getItemModel(t),C=qW[s.type](a,t,r);if(C){if(h){var w=void 0;y.length===0?w=S(n):(w=y[n],w.useStyle(g.getItemStyle()),s.type===`cartesian2d`?w.setShape(`r`,_):w.setShape(`cornerRadius`,_),v[t]=w);var T=qW[s.type](a,t),E=Mb(l,T,s);df(w,{shape:E},u,t)}var D=o.getItemGraphicEl(n);if(!a.hasValue(t)||!KW[s.type](C))i.remove(D);else{var O=!1;if(f&&(O=HW[s.type](p,C),O&&i.remove(D)),D&&(D.type===`sector`&&m||D.type===`sausage`&&!m)&&(D&&gf(D,e,n),D=null),D?_f(D):D=UW[s.type](e,a,t,C,l,u,c.model,!0,m),d&&(D.forceLabelAnimation=!0),x){var k=D.getTextContent();if(k){var A=AB(k);A.prevValue!=null&&(A.prevValue=A.value)}}else Ob(D,a,t,r,C,e,l,s.type===`polar`);b?D.attr({shape:C}):d?wb(d,u,D,C,t,l,!0,x):df(D,{shape:C},e,t,null),a.setItemGraphicEl(t,D),D.ignore=O,i.add(D)}}}).remove(function(t){var n=o.getItemGraphicEl(t);n&&gf(n,e,t)}).execute();var C=this._backgroundGroup||=new Sz;C.removeAll();for(var w=0;w<v.length;++w)C.add(v[w]);i.add(C),this._backgroundEls=v,this._data=a},t.prototype._renderLarge=function(e,t,n){this._clear(),Ab(e,this.group),this._updateLargeClip(e)},t.prototype._incrementalRenderLarge=function(e,t){this._removeBackground(),Ab(t,this.group,this._progressiveEls,!0)},t.prototype._updateLargeClip=function(e){var t=e.get(`clip`,!0)&&qg(e.coordinateSystem,!1,e),n=this.group;t?n.setClipPath(t):n.removeClipPath()},t.prototype._enableRealtimeSort=function(e,t,n){var r=this;if(t.count()){var i=e.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(t,e,n),this._isFirstFrame=!1;else{var a=function(e){var n=t.getItemGraphicEl(e),r=n&&n.shape;return r&&Math.abs(i.isHorizontal()?r.height:r.width)||0};this._onRendered=function(){r._updateSortWithinSameData(t,a,i,n)},n.getZr().on(`rendered`,this._onRendered)}}},t.prototype._dataSort=function(e,t,n){var r=[];return e.each(e.mapDimension(t.dim),function(e,t){var i=n(t);i??=NaN,r.push({dataIndex:t,mappedValue:i,ordinalNumber:e})}),r.sort(function(e,t){return t.mappedValue-e.mappedValue}),{ordinalNumbers:R(r,function(e){return e.ordinalNumber})}},t.prototype._isOrderChangedWithinSameData=function(e,t,n){for(var r=n.scale,i=e.mapDimension(n.dim),a=Number.MAX_VALUE,o=0,s=r.getOrdinalMeta().categories.length;o<s;++o){var c=e.rawIndexOf(i,r.getRawOrdinalNumber(o)),l=c<0?Number.MIN_VALUE:t(e.indexOfRawIndex(c));if(l>a)return!0;a=l}return!1},t.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,r=n.getExtent(),i=Math.max(0,r[0]),a=Math.min(r[1],n.getOrdinalMeta().categories.length-1);i<=a;++i)if(e.ordinalNumbers[i]!==n.getRawOrdinalNumber(i))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,r){if(this._isOrderChangedWithinSameData(e,t,n)){var i=this._dataSort(e,n,t);this._isOrderDifferentInView(i,n)&&(this._removeOnRenderedListener(r),r.dispatchAction({type:`changeAxisOrder`,componentType:n.dim+`Axis`,axisId:n.index,sortInfo:i}))}},t.prototype._dispatchInitSort=function(e,t,n){var r=t.baseAxis,i=this._dataSort(e,r,function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)});n.dispatchAction({type:`changeAxisOrder`,componentType:r.dim+`Axis`,isInitSort:!0,axisId:r.index,sortInfo:i})},t.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},t.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&=(e.getZr().off(`rendered`,this._onRendered),null)},t.prototype._clear=function(e){var t=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(t){gf(t,e,LR(t).dataIndex)})):t.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type=`bar`,t}(cU),HW={cartesian2d:function(e,t){var n=t.width<0?-1:1,r=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,a=e.y+e.height,o=zW(t.x,e.x),s=BW(t.x+t.width,i),c=zW(t.y,e.y),l=BW(t.y+t.height,a),u=s<o,d=l<c;return t.x=u&&o>i?s:o,t.y=d&&c>a?l:c,t.width=u?0:s-o,t.height=d?0:l-c,n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height),u||d},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}var i=BW(t.r,e.r),a=zW(t.r0,e.r0);t.r=i,t.r0=a;var o=i-a<0;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}return o}},UW={cartesian2d:function(e,t,n,r,i,a,o,s,c){var l=new rR({shape:I({},r),z2:1});if(l.__dataIndex=n,l.name=`item`,a){var u=l.shape,d=i?`height`:`width`;u[d]=0}return l},polar:function(e,t,n,r,i,a,o,s,c){var l=!i&&c?RW:zz,u=new l({shape:r,z2:1});if(u.name=`item`,u.calculateTextPosition=vb(Db(i),{isRoundCap:l===RW}),a){var d=u.shape,f=i?`r`:`endAngle`,p={};d[f]=i?r.r0:r.startAngle,p[f]=r[f],(s?df:ff)(u,{shape:p},a)}return u}},WW=[`x`,`y`,`width`,`height`],GW=[`cx`,`cy`,`r`,`startAngle`,`endAngle`],KW={cartesian2d:function(e){return!Tb(e,WW)},polar:function(e){return!Tb(e,GW)}},qW={cartesian2d:function(e,t,n){var r=e.getItemLayout(t);if(!r)return null;var i=n?kb(n,r):0,a=r.width>0?1:-1,o=r.height>0?1:-1;return{x:r.x+a*i/2,y:r.y+o*i/2,width:r.width-a*i,height:r.height-o*i}},polar:function(e,t,n){var r=e.getItemLayout(t);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}},JW=function(){function e(){}return e}(),YW=function(e){F(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`largeBar`,n}return t.prototype.getDefaultShape=function(){return new JW},t.prototype.buildPath=function(e,t){for(var n=t.points,r=this.baseDimIdx,i=1-this.baseDimIdx,a=[],o=[],s=this.barWidth,c=0;c<n.length;c+=3)o[r]=s,o[i]=n[c+2],a[r]=n[c+r],a[i]=n[c+i],e.rect(a[0],a[1],o[0],o[1])},t}(JL),XW=hb(function(e){var t=this,n=jb(t,e.offsetX,e.offsetY);LR(t).dataIndex=n>=0?n:null},30,!1),ZW=function(){function e(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return e.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},e.prototype.containName=function(e){return this._getRawData().indexOfName(e)>=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}(),QW=Du(),$W=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new ZW(q(this.getData,this),q(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return Vb(this,{coordDimensions:[`value`],encodeDefaulter:Ha(vp,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),r=QW(n),i=r.seats;if(!i){var a=[];n.each(n.mapDimension(`value`),function(e){a.push(e)}),i=r.seats=Ul(a,n.hostModel.get(`percentPrecision`))}var o=e.prototype.getDataParams.call(this,t);return o.percent=i[t]||0,o.$vars.push(`percent`),o},t.prototype._defaultLabelLine=function(e){lu(e,`labelLine`,[`show`]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type=`series.pie`,t.defaultOption={z:2,legendHoverLink:!0,colorBy:`data`,center:[`50%`,`50%`],radius:[0,`50%`],clockwise:!0,startAngle:90,endAngle:`auto`,padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,coordinateSystemUsage:`box`,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:`truncate`,position:`outer`,alignTo:`none`,edgeDistance:`25%`,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:30,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:`solid`}},itemStyle:{borderWidth:1,borderJoin:`round`},showEmptyCircle:!0,emptyCircleStyle:{color:`lightgray`,opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:`expansion`,animationDuration:1e3,animationTypeUpdate:`transition`,animationEasingUpdate:`cubicInOut`,animationDurationUpdate:500,animationEasing:`cubicInOut`},t}(UH),nm({fullType:$W.type,getCoord2:function(e){return e.getShallow(`center`)}}),eG=Math.PI*2,tG=LL.CMD,nG=[`top`,`right`,`bottom`,`left`],rG=[],iG=new wF,aG=new wF,oG=new wF,sG=new wF,cG=new wF,lG=[],uG=new wF,dG=Math.PI/180,fG={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},pG={},mG=Math.PI*2,hG=Math.PI/180,gG=Qu(`pie`,sx),_G=Du(),vG=function(e){F(t,e);function t(t,n,r){var i=e.call(this)||this;i.z2=2;var a=new cR;return i.setTextContent(a),i.updateData(t,n,r,!0),i}return t.prototype.updateData=function(e,t,n,r){var i=this,a=e.hostModel,o=e.getItemModel(t),s=o.getModel(`emphasis`),c=e.getItemLayout(t),l=I(Sb(o.getModel(`itemStyle`),c,!0),c);if(isNaN(l.startAngle))i.setShape(l);else{if(r){i.setShape(l);var u=a.getShallow(`animationType`);a.ecModel.ssr?(ff(i,{scaleX:0,scaleY:0},a,{dataIndex:t,isFrom:!0}),i.originX=l.cx,i.originY=l.cy):u===`scale`?(i.shape.r=c.r0,ff(i,{shape:{r:c.r}},a,t)):n==null?(i.shape.endAngle=c.startAngle,df(i,{shape:{endAngle:c.endAngle}},a,t)):(i.setShape({startAngle:n,endAngle:n}),ff(i,{shape:{startAngle:c.startAngle,endAngle:c.endAngle}},a,t))}else _f(i),df(i,{shape:l},a,t);i.useStyle(e.getItemVisual(t,`style`)),Ld(i,o);var d=(c.startAngle+c.endAngle)/2,f=a.get(`selectedOffset`),p=Math.cos(d)*f,m=Math.sin(d)*f,h=o.getShallow(`cursor`);h&&i.attr(`cursor`,h),this._updateLabel(a,e,t),i.ensureState(`emphasis`).shape=I({r:c.r+(s.get(`scale`)&&s.get(`scaleSize`)||0)},Sb(s.getModel(`itemStyle`),c)),I(i.ensureState(`select`),{x:p,y:m,shape:Sb(o.getModel([`select`,`itemStyle`]),c)}),I(i.ensureState(`blur`),{shape:Sb(o.getModel([`blur`,`itemStyle`]),c)});var g=i.getTextGuideLine(),_=i.getTextContent();g&&I(g.ensureState(`select`),{x:p,y:m}),I(_.ensureState(`select`),{x:p,y:m}),Fd(this,s.get(`focus`),s.get(`blurScope`),s.get(`disabled`))}},t.prototype._updateLabel=function(e,t,n){var r=this,i=t.getItemModel(n),a=i.getModel(`labelLine`),o=t.getItemVisual(n,`style`),s=o&&o.fill,c=o&&o.opacity;ip(r,ap(i),{labelFetcher:t.hostModel,labelDataIndex:n,inheritColor:s,defaultOpacity:c,defaultText:e.getFormattedLabel(n,`normal`)||t.getName(n)});var l=r.getTextContent();r.setTextConfig({position:null,rotation:null}),l.attr({z2:10});var u=i.get([`label`,`position`]);if(u!==`outside`&&u!==`outer`)r.removeTextGuideLine();else{var d=this.getTextGuideLine();d||(d=new Gz,this.setTextGuideLine(d)),$b(this,ex(i),{stroke:s,opacity:Qa(a.get([`lineStyle`,`opacity`]),c,1)})}},t}(zz),yG=function(e){F(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`pie`,t.ignoreLabelLineUpdate=!0,t}return t.prototype.render=function(e,t,n,r){var i=e.getData(),a=this._data,o=this.group,s;if(!a&&i.count()>0){for(var c=i.getItemLayout(0),l=1;isNaN(c&&c.startAngle)&&l<i.count();++l)c=i.getItemLayout(l);c&&(s=c.startAngle)}if(this._emptyCircleSector&&o.remove(this._emptyCircleSector),i.count()===0&&e.get(`showEmptyCircle`)){var u=new zz({shape:ka(_G(e))});u.useStyle(e.getModel(`emptyCircleStyle`).getItemStyle()),this._emptyCircleSector=u,o.add(u)}i.diff(a).add(function(e){var t=new vG(i,e,s);i.setItemGraphicEl(e,t),o.add(t)}).update(function(e,t){var n=a.getItemGraphicEl(t);n.updateData(i,e,s),n.off(`click`),o.add(n),i.setItemGraphicEl(e,n)}).remove(function(t){gf(a.getItemGraphicEl(t),e,t)}).execute(),ox(e),e.get(`animationTypeUpdate`)!==`expansion`&&(this._data=i)},t.prototype.dispose=function(){},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var r=e[0]-n.cx,i=e[1]-n.cy,a=Math.sqrt(r*r+i*i);return a<=n.r&&a>=n.r0}},t.type=`pie`,t}(cU),bG=function(){function e(e,t){this.target=e,this.topTarget=t&&t.topTarget}return e}(),xG=function(){function e(e){this.handler=e,e.on(`mousedown`,this._dragStart,this),e.on(`mousemove`,this._drag,this),e.on(`mouseup`,this._dragEnd,this)}return e.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new bG(t,e),`dragstart`,e.event))},e.prototype._drag=function(e){var t=this._draggingTarget;if(t){var n=e.offsetX,r=e.offsetY,i=n-this._x,a=r-this._y;this._x=n,this._y=r,t.drift(i,a,e),this.handler.dispatchToElement(new bG(t,e),`drag`,e.event);var o=this.handler.findHover(n,r,t).target,s=this._dropTarget;this._dropTarget=o,t!==o&&(s&&o!==s&&this.handler.dispatchToElement(new bG(s,e),`dragleave`,e.event),o&&o!==s&&this.handler.dispatchToElement(new bG(o,e),`dragenter`,e.event))}},e.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new bG(t,e),`dragend`,e.event),this._dropTarget&&this.handler.dispatchToElement(new bG(this._dropTarget,e),`drop`,e.event),this._draggingTarget=null,this._dropTarget=null},e}(),SG=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,CG=[],wG=dF.browser.firefox&&+dF.browser.version.split(`.`)[0]<39,TG=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0},EG=function(){function e(){this._track=[]}return e.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(e,t,n){var r=e.touches;if(r){for(var i={points:[],touches:[],target:t,event:e},a=0,o=r.length;a<o;a++){var s=r[a],c=ux(n,s,{});i.points.push([c.zrX,c.zrY]),i.touches.push(s)}this._track.push(i)}},e.prototype._recognize=function(e){for(var t in DG)if(DG.hasOwnProperty(t)){var n=DG[t](this._track,e);if(n)return n}},e}(),DG={pinch:function(e,t){var n=e.length;if(n){var r=(e[n-1]||{}).points,i=(e[n-2]||{}).points||r;if(i&&i.length>1&&r&&r.length>1){var a=vx(r)/vx(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=yx(r);return t.pinchX=o[0],t.pinchY=o[1],{type:`pinch`,target:e[0].target,event:t}}}}},OG=`silent`,kG=function(e){F(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.handler=null,t}return t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(UI),AG=function(){function e(e,t){this.x=e,this.y=t}return e}(),jG=[`click`,`dblclick`,`mousewheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],MG=new J(0,0,0,0),NG=function(e){F(t,e);function t(t,n,r,i,a){var o=e.call(this)||this;return o._hovered=new AG(0,0),o.storage=t,o.painter=n,o.painterRoot=i,o._pointerSize=a,r||=new kG,o.proxy=null,o.setHandlerProxy(r),o._draggingMgr=new xG(o),o}return t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(L(jG,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var t=e.zrX,n=e.zrY,r=Tx(this,t,n),i=this._hovered,a=i.target;a&&!a.__zr&&(i=this.findHover(i.x,i.y),a=i.target);var o=this._hovered=r?new AG(t,n):this.findHover(t,n),s=o.target,c=this.proxy;c.setCursor&&c.setCursor(s?s.cursor:`default`),a&&s!==a&&this.dispatchToElement(i,`mouseout`,e),this.dispatchToElement(o,`mousemove`,e),s&&s!==a&&this.dispatchToElement(o,`mouseover`,e)},t.prototype.mouseout=function(e){var t=e.zrEventControl;t!==`only_globalout`&&this.dispatchToElement(this._hovered,`mouseout`,e),t!==`no_globalout`&&this.trigger(`globalout`,{type:`globalout`,event:e})},t.prototype.resize=function(){this._hovered=new AG(0,0)},t.prototype.dispatch=function(e,t){var n=this[e];n&&n.call(this,t)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},t.prototype.dispatchToElement=function(e,t,n){e||={};var r=e.target;if(!(r&&r.silent)){for(var i=`on`+t,a=bx(t,e,n);r&&(r[i]&&(a.cancelBubble=!!r[i].call(r,a)),r.trigger(t,a),r=r.__hostTarget?r.__hostTarget:r.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(e){typeof e[i]==`function`&&e[i].call(e,a),e.trigger&&e.trigger(t,a)}))}},t.prototype.findHover=function(e,t,n){var r=this.storage.getDisplayList(),i=new AG(e,t);if(Cx(r,i,e,t,n),this._pointerSize&&!i.target){for(var a=[],o=this._pointerSize,s=o/2,c=new J(e-s,t-s,o,o),l=r.length-1;l>=0;l--){var u=r[l];u===n||u.ignore||u.ignoreCoarsePointer||u.parent&&u.parent.ignoreCoarsePointer||(MG.copy(u.getBoundingRect()),u.transform&&MG.applyTransform(u.transform),MG.intersect(c)&&a.push(u))}if(a.length){for(var d=4,f=Math.PI/12,p=Math.PI*2,m=0;m<s;m+=d)for(var h=0;h<p;h+=f)if(Cx(a,i,e+m*Math.cos(h),t+m*Math.sin(h),n),i.target)return i}}return i},t.prototype.processGesture=function(e,t){this._gestureMgr||=new EG;var n=this._gestureMgr;t===`start`&&n.clear();var r=n.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if(t===`end`&&n.clear(),r){var i=r.type;e.gestureEvent=i;var a=new AG;a.target=r.target,this.dispatchToElement(a,i,r.event)}},t}(UI),L([`click`,`mousedown`,`mouseup`,`mousewheel`,`dblclick`,`contextmenu`],function(e){NG.prototype[e]=function(t){var n=t.zrX,r=t.zrY,i=Tx(this,n,r),a,o;if(e===`mouseup`&&i||(a=this.findHover(n,r),o=a.target),e===`mousedown`)this._downEl=o,this._downPoint=[t.zrX,t.zrY],this._upEl=o;else if(e===`mouseup`)this._upEl=o;else if(e===`click`){if(this._downEl!==this._upEl||!this._downPoint||SF(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}}),PG=32,FG=7,IG=!1,LG=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Fx}return e.prototype.traverse=function(e,t){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(e,t)},e.prototype.getDisplayList=function(e,t){t||=!1;var n=this._displayList;return(e||!n.length)&&this.updateDisplayList(t),n},e.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var t=this._roots,n=this._displayList,r=0,i=t.length;r<i;r++)this._updateAndAddDisplayable(t[r],null,e);n.length=this._displayListLen,Nx(n,Fx)},e.prototype._updateAndAddDisplayable=function(e,t,n){if(!e.ignore||n){e.beforeUpdate(),e.update(),e.afterUpdate();var r=e.getClipPath(),i=t&&t.length,a=0,o=e.__clipPaths;if(!e.ignoreClip&&(i||r)){if(o||=e.__clipPaths=[],i)for(var s=0;s<t.length;s++)o[a++]=t[s];for(var c=r,l=e;c;)c.parent=l,c.updateTransform(),o[a++]=c,l=c,c=c.getClipPath()}if(o&&(o.length=a),e.childrenRef){for(var u=e.childrenRef(),d=0;d<u.length;d++){var f=u[d];e.__dirty&&(f.__dirty|=1),this._updateAndAddDisplayable(f,o,n)}e.__dirty=0}else{var p=e;isNaN(p.z)&&(Px(),p.z=0),isNaN(p.z2)&&(Px(),p.z2=0),isNaN(p.zlevel)&&(Px(),p.zlevel=0),this._displayList[this._displayListLen++]=p}var m=e.getDecalElement&&e.getDecalElement();m&&this._updateAndAddDisplayable(m,o,n);var h=e.getTextGuideLine();h&&this._updateAndAddDisplayable(h,o,n);var g=e.getTextContent();g&&this._updateAndAddDisplayable(g,o,n)}},e.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},e.prototype.delRoot=function(e){if(e instanceof Array)for(var t=0,n=e.length;t<n;t++)this.delRoot(e[t]);else{var r=Na(this._roots,e);r>=0&&this._roots.splice(r,1)}},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}(),RG=dF.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)},zG=function(e){F(t,e);function t(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t||={},n.stage=t.stage||{},n}return t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},t.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._head=n,n?n.prev=t:this._tail=t,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},t.prototype.update=function(e){for(var t=Ix()-this._pausedTime,n=t-this._time,r=this._head;r;){var i=r.next;r.step(t,n)&&(r.ondestroy(),this.removeClip(r)),r=i}this._time=t,e||(this.trigger(`frame`,n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0;function t(){e._running&&(RG(t),!e._paused&&e.update())}RG(t)},t.prototype.start=function(){this._running||(this._time=Ix(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||=(this._pauseStart=Ix(),!0)},t.prototype.resume=function(){this._paused&&=(this._pausedTime+=Ix()-this._pauseStart,!1)},t.prototype.clear=function(){for(var e=this._head;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(e,t){t||={},this.start();var n=new HI(e,t.loop);return this.addAnimator(n),n},t}(UI),BG=300,VG=dF.domSupported,HG=(function(){var e=[`click`,`dblclick`,`mousewheel`,`wheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],t=[`touchstart`,`touchend`,`touchmove`],n={pointerdown:1,pointerup:1,pointermove:1,pointerout:1};return{mouse:e,touch:t,pointer:R(e,function(e){var t=e.replace(`mouse`,`pointer`);return n.hasOwnProperty(t)?t:e})}})(),UG={mouse:[`mousemove`,`mouseup`],pointer:[`pointermove`,`pointerup`]},WG=!1,GG=function(){function e(e,t){this.stopPropagation=co,this.stopImmediatePropagation=co,this.preventDefault=co,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return e}(),KG={mousedown:function(e){e=px(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger(`mousedown`,e)},mousemove:function(e){e=px(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger(`mousemove`,e)},mouseup:function(e){e=px(this.dom,e),this.__togglePointerCapture(!1),this.trigger(`mouseup`,e)},mouseout:function(e){e=px(this.dom,e);var t=e.toElement||e.relatedTarget;Vx(this,t)||(this.__pointerCapturing&&(e.zrEventControl=`no_globalout`),this.trigger(`mouseout`,e))},wheel:function(e){WG=!0,e=px(this.dom,e),this.trigger(`mousewheel`,e)},mousewheel:function(e){WG||(e=px(this.dom,e),this.trigger(`mousewheel`,e))},touchstart:function(e){e=px(this.dom,e),zx(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,`start`),KG.mousemove.call(this,e),KG.mousedown.call(this,e)},touchmove:function(e){e=px(this.dom,e),zx(e),this.handler.processGesture(e,`change`),KG.mousemove.call(this,e)},touchend:function(e){e=px(this.dom,e),zx(e),this.handler.processGesture(e,`end`),KG.mouseup.call(this,e),+new Date-this.__lastTouchMoment<BG&&KG.click.call(this,e)},pointerdown:function(e){KG.mousedown.call(this,e)},pointermove:function(e){Lx(e)||KG.mousemove.call(this,e)},pointerup:function(e){KG.mouseup.call(this,e)},pointerout:function(e){Lx(e)||KG.mouseout.call(this,e)}},L([`click`,`dblclick`,`contextmenu`],function(e){KG[e]=function(t){t=px(this.dom,t),this.trigger(e,t)}}),qG={pointermove:function(e){Lx(e)||qG.mousemove.call(this,e)},pointerup:function(e){qG.mouseup.call(this,e)},mousemove:function(e){this.trigger(`mousemove`,e)},mouseup:function(e){var t=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger(`mouseup`,e),t&&(e.zrEventControl=`only_globalout`,this.trigger(`mouseout`,e))}},JG=function(){function e(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t}return e}(),YG=function(e){F(t,e);function t(t,n){var r=e.call(this)||this;return r.__pointerCapturing=!1,r.dom=t,r.painterRoot=n,r._localHandlerScope=new JG(t,KG),VG&&(r._globalHandlerScope=new JG(document,qG)),Hx(r,r._localHandlerScope),r}return t.prototype.dispose=function(){Gx(this._localHandlerScope),VG&&Gx(this._globalHandlerScope)},t.prototype.setCursor=function(e){this.dom.style&&(this.dom.style.cursor=e||`default`)},t.prototype.__togglePointerCapture=function(e){if(this.__mayPointerCapture=null,VG&&+this.__pointerCapturing^e){this.__pointerCapturing=e;var t=this._globalHandlerScope;e?Ux(this,t):Gx(t)}},t}(UI),XG={},ZG={},QG=function(){function e(e,t,n){var r=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!1,this._darkMode=!1,n||={},this.dom=t,this.id=e;var i=new LG,a=n.renderer||`canvas`;XG[a]||(a=Ba(XG)[0]),n.useDirtyRect=n.useDirtyRect!=null&&n.useDirtyRect;var o=new XG[a](t,i,n,e),s=n.ssr||o.ssrOnly;this.storage=i,this.painter=o;var c=!dF.node&&!dF.worker&&!s?new YG(o.getViewportRoot(),o.root):null,l=n.useCoarsePointer,u=l==null||l===`auto`?dF.touchEventsSupported:!!l,d=44,f;u&&(f=U(n.pointerSize,d)),this.handler=new NG(i,o,c,o.root,f),this.animation=new zG({stage:{update:s?null:function(){return r._flush(!1)}}}),s||this.animation.start()}return e.prototype.add=function(e){!this._disposed&&e&&(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},e.prototype.remove=function(e){!this._disposed&&e&&(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},e.prototype.configLayer=function(e,t){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,t),this.refresh())},e.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=qx(e))},e.prototype.getBackgroundColor=function(){return this._backgroundColor},e.prototype.setDarkMode=function(e){this._darkMode=e},e.prototype.isDarkMode=function(){return this._darkMode},e.prototype.refreshImmediately=function(e){this._disposed||this._refresh({animUpdate:!e,refresh:!0,refreshHover:!1})},e.prototype._refresh=function(e){e.animUpdate&&this.animation.update(!0),this._needsRefresh=this._needsRefreshHover=!1,this.painter.refresh({refresh:e.refresh,refreshHover:e.refreshHover}),this._needsRefresh=this._needsRefreshHover=!1},e.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},e.prototype.flush=function(){this._disposed||this._flush(!0)},e.prototype._flush=function(e){var t,n=Ix(),r=this._needsRefresh,i=this._needsRefreshHover;(r||i)&&(t=!0,this._refresh({animUpdate:e,refresh:r,refreshHover:i}));var a=Ix();t?(this._stillFrameAccum=0,this.trigger(`rendered`,{elapsedTime:a-n})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||this._refresh({animUpdate:!1,refresh:!1,refreshHover:!0})},e.prototype.resize=function(e){this._disposed||(e||={},this.painter.resize(e.width,e.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},e.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},e.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t<e.length;t++)e[t]instanceof Sz&&e[t].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},e.prototype.dispose=function(){this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,Kx(this.id))},e}(),eK=``,typeof navigator<`u`&&(eK=navigator.platform||``),tK=`rgba(0, 0, 0, 0.2)`,nK=X.color.theme[0],rK=oc(nK,null,null,.9),iK={darkMode:`auto`,colorBy:`series`,color:X.color.theme,gradientColor:[rK,nK],aria:{decal:{decals:[{color:tK,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:tK,symbol:`circle`,dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:tK,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:tK,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:tK,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:tK,symbol:`triangle`,dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:eK.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},aK=W(),lK=`\0_ec_inner`,uK=1,dK=function(e){F(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(e,t,n,r,i,a){r||={},this.option=null,this._theme=new HB(r),this._locale=new HB(i),this._optionManager=a},t.prototype.setOption=function(e,t,n){var r=rS(t);this._optionManager.setOption(e,n,r),this._resetOption(null,r)},t.prototype.resetOption=function(e,t){return this._resetOption(e,rS(t))},t.prototype._resetOption=function(e,t){var n=!1,r=this._optionManager;if(!e||e===`recreate`){var i=r.mountOption(e===`recreate`);!this.option||e===`recreate`?cK(this,i):(this.restoreData(),this._mergeOption(i,t)),n=!0}if((e===`timeline`||e===`media`)&&this.restoreData(),!e||e===`recreate`||e===`timeline`){var a=r.getTimelineOption(this);a&&(n=!0,this._mergeOption(a,t))}if(!e||e===`recreate`||e===`media`){var o=r.getMediaOption(this);o.length&&L(o,function(e){n=!0,this._mergeOption(e,t)},this)}return n},t.prototype.mergeOption=function(e){this._mergeOption(e,null)},t.prototype._mergeOption=function(e,t){var n=this.option,r=this._componentsMap,i=this._componentsCount,a=[],o=W(),s=t&&t.replaceMergeMainTypeMap;gp(this),L(e,function(e,t){e!=null&&(TH.hasClass(t)?t&&(a.push(t),o.set(t,!0)):n[t]=n[t]==null?ka(e):Aa(n[t],e,!0))}),s&&s.each(function(e,t){TH.hasClass(t)&&!o.get(t)&&(a.push(t),o.set(t,!0))}),TH.topologicalTravel(a,TH.getAllClassMainTypes(),c,this);function c(t){var a=Qx(this,t,cu(e[t])),o=r.get(t),c=fu(o,a,o?s&&s.get(t)?`replaceMerge`:`normalMerge`:`replaceAll`);wu(c,t,TH),n[t]=null,r.set(t,null),i.set(t,0);var l=[],u=[],d=0,f;L(c,function(e,n){var r=e.existing,i=e.newOption;if(!i)r&&(r.mergeOption({},this),r.optionUpdated({},!1));else{var a=t===`series`,o=TH.getClass(t,e.keyInfo.subType,!a);if(!o)return;if(t===`tooltip`){if(f)return;f=!0}if(r&&r.constructor===o)r.name=e.keyInfo.name,r.mergeOption(i,this),r.optionUpdated(i,!1);else{var s=I({componentIndex:n},e.keyInfo);r=new o(i,this,this,s),I(r,s),e.brandNew&&(r.__requireNewView=!0),r.init(i,this,this),r.optionUpdated(null,!0)}}r?(l.push(r.option),u.push(r),d++):(l.push(void 0),u.push(void 0))},this),n[t]=l,r.set(t,u),i.set(t,d),t===`series`&&oK(this)}this._seriesIndices||oK(this)},t.prototype.getOption=function(){var e=ka(this.option);return L(e,function(t,n){if(TH.hasClass(n)){for(var r=cu(t),i=r.length,a=!1,o=i-1;o>=0;o--)r[o]&&!Cu(r[o])?a=!0:(r[o]=null,!a&&i--);r.length=i,e[n]=r}}),delete e[lK],e},t.prototype.setTheme=function(e){this._theme=new HB(e),this._resetOption(`recreate`,null)},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,t){var n=this._componentsMap.get(e);if(n){var r=n[t||0];if(r)return r;if(t==null){for(var i=0;i<n.length;i++)if(n[i])return n[i]}}},t.prototype.queryComponents=function(e){var t=e.mainType;if(!t)return[];var n=e.index,r=e.id,i=e.name,a=this._componentsMap.get(t);if(!a||!a.length)return[];var o;return n==null?o=r==null?i==null?Ra(a,function(e){return!!e}):tS(`name`,i,a):tS(`id`,r,a):(o=[],L(cu(n),function(e){a[e]&&o.push(a[e])})),nS(o,e)},t.prototype.findComponents=function(e){var t=e.query,n=e.mainType,r=i(t);return a(nS(r?this.queryComponents(r):Ra(this._componentsMap.get(n),function(e){return!!e}),e));function i(e){var t=n+`Index`,r=n+`Id`,i=n+`Name`;return e&&(e[t]!=null||e[r]!=null||e[i]!=null)?{mainType:n,index:e[t],id:e[r],name:e[i]}:null}function a(t){return e.filter?Ra(t,e.filter):t}},t.prototype.eachComponent=function(e,t,n){var r=this._componentsMap;if(B(e)){var i=t,a=e;r.each(function(e,t){for(var n=0;e&&n<e.length;n++){var r=e[n];r&&a.call(i,t,r,r.componentIndex)}})}else for(var o=V(e)?r.get(e):H(e)?this.findComponents(e):null,s=0;o&&s<o.length;s++){var c=o[s];c&&t.call(n,c,c.componentIndex)}},t.prototype.getSeriesByName=function(e){var t=xu(e,null);return Ra(this._componentsMap.get(`series`),function(e){return!!e&&t!=null&&e.name===t})},t.prototype.getSeriesByIndex=function(e){return this._componentsMap.get(`series`)[e]},t.prototype.getSeriesByType=function(e){return Ra(this._componentsMap.get(`series`),function(t){return!!t&&t.subType===e})},t.prototype.getSeries=function(){return Ra(this._componentsMap.get(`series`),function(e){return!!e})},t.prototype.getSeriesCount=function(){return this._componentsCount.get(`series`)},t.prototype.eachSeries=function(e,t){sK(this),L(this._seriesIndices,function(n){var r=this._componentsMap.get(`series`)[n];e.call(t,r,n)},this)},t.prototype.eachRawSeries=function(e,t){L(this._componentsMap.get(`series`),function(n){n&&e.call(t,n,n.componentIndex)})},t.prototype.eachSeriesByType=function(e,t,n){sK(this),L(this._seriesIndices,function(r){var i=this._componentsMap.get(`series`)[r];i.subType===e&&t.call(n,i,r)},this)},t.prototype.eachRawSeriesByType=function(e,t,n){return L(this.getSeriesByType(e),t,n)},t.prototype.isSeriesFiltered=function(e){return sK(this),this._seriesIndicesMap.get(e.componentIndex)==null},t.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},t.prototype.filterSeries=function(e,t){sK(this);var n=[];L(this._seriesIndices,function(r){var i=this._componentsMap.get(`series`)[r];e.call(t,i,r)&&n.push(r)},this),this._seriesIndices=n,this._seriesIndicesMap=W(n)},t.prototype.restoreData=function(e){oK(this);var t=this._componentsMap,n=[];t.each(function(e,t){TH.hasClass(t)&&n.push(t)}),TH.topologicalTravel(n,TH.getAllClassMainTypes(),function(n){L(t.get(n),function(t){t&&(n!==`series`||!$x(t,e))&&t.restoreData()})})},t.internalField=function(){oK=function(e){var t=e._seriesIndices=[];L(e._componentsMap.get(`series`),function(e){e&&t.push(e.componentIndex)}),e._seriesIndicesMap=W(t)},sK=function(e){},cK=function(e,t){e.option={},e.option[lK]=uK,e._componentsMap=W({series:[]}),e._componentsCount=W();var n=t.aria;H(n)&&n.enabled==null&&(n.enabled=!0),eS(t,e._theme.option),Aa(t,iK,!1),e._mergeOption(t,null)}}(),t}(HB),Fa(dK,OH),fK=/^(min|max)?(.+)$/,pK=function(){function e(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return e.prototype.setOption=function(e,t,n){e&&(L(cu(e.series),function(e){e&&e.data&&Ka(e.data)&&ro(e.data)}),L(cu(e.dataset),function(e){e&&e.source&&Ka(e.source)&&ro(e.source)})),e=ka(e);var r=this._optionBackup,i=iS(e,t,!r);this._newBaseOption=i.baseOption,r?(i.timelineOptions.length&&(r.timelineOptions=i.timelineOptions),i.mediaList.length&&(r.mediaList=i.mediaList),i.mediaDefault&&(r.mediaDefault=i.mediaDefault)):this._optionBackup=i},e.prototype.mountOption=function(e){var t=this._optionBackup;return this._timelineOptions=t.timelineOptions,this._mediaList=t.mediaList,this._mediaDefault=t.mediaDefault,this._currentMediaIndices=[],ka(e?t.baseOption:this._newBaseOption)},e.prototype.getTimelineOption=function(e){var t,n=this._timelineOptions;if(n.length){var r=e.getComponent(`timeline`);r&&(t=ka(n[r.getCurrentIndex()]))}return t},e.prototype.getMediaOption=function(e){var t=this._api.getWidth(),n=this._api.getHeight(),r=this._mediaList,i=this._mediaDefault,a=[],o=[];if(!r.length&&!i)return o;for(var s=0,c=r.length;s<c;s++)aS(r[s].query,t,n)&&a.push(s);return!a.length&&i&&(a=[-1]),a.length&&!sS(a,this._currentMediaIndices)&&(o=R(a,function(e){return ka(e===-1?i.option:r[e].option)})),this._currentMediaIndices=a,o},e}(),mK=L,hK=H,gK=[`areaStyle`,`lineStyle`,`nodeStyle`,`linkStyle`,`chordStyle`,`label`,`labelLine`],_K=[[`x`,`left`],[`y`,`top`],[`x2`,`right`],[`y2`,`bottom`]],vK=[`grid`,`geo`,`parallel`,`legend`,`toolbox`,`title`,`visualMap`,`dataZoom`,`timeline`],yK=[[`borderRadius`,`barBorderRadius`],[`borderColor`,`barBorderColor`],[`borderWidth`,`barBorderWidth`]],bK=$u(ES),xK=function(){function e(){this.group=new Sz,this.uid=_m(`viewComponent`)}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){},e.prototype.updateLayout=function(e,t,n,r){},e.prototype.updateVisual=function(e,t,n,r){},e.prototype.toggleBlurSeries=function(e,t,n){},e.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},e}(),mo(xK),bo(xK),SK=Du(),CK={itemStyle:xo(zB,!0),lineStyle:xo(IB,!0)},wK={lineStyle:`stroke`,itemStyle:`fill`},TK={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),r=e.visualStyleAccessPath||`itemStyle`,i=e.getModel(r),a=OS(e,r)(i),o=i.getShallow(`decal`);o&&(n.setVisual(`decal`,o),o.dirty=!0);var s=kS(e,r),c=a[s],l=B(c)?c:null,u=a.fill===`auto`||a.stroke===`auto`;if(!a[s]||l||u){var d=e.getColorFromPalette(e.name,null,t.getSeriesCount());a[s]||(a[s]=d,n.setVisual(`colorFromPalette`,!0)),a.fill=a.fill===`auto`||B(a.fill)?d:a.fill,a.stroke=a.stroke===`auto`||B(a.stroke)?d:a.stroke}if(n.setVisual(`style`,a),n.setVisual(`drawType`,s),!t.isSeriesFiltered(e)&&l)return n.setVisual(`colorFromPalette`,!1),{dataEach:function(t,n){var r=e.getDataParams(n),i=I({},a);i[s]=l(r),t.setItemVisual(n,`style`,i)}}}},EK=new HB,DK={createOnAllSeries:!0,reset:function(e,t){if(!e.ignoreStyleOnData){var n=e.getData(),r=e.visualStyleAccessPath||`itemStyle`,i=OS(e,r),a=n.getVisual(`drawType`);return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[r]){EK.option=n[r];var o=i(EK);I(e.ensureUniqueItemVisual(t,`style`),o),EK.option.decal&&(e.setItemVisual(t,`decal`,EK.option.decal),EK.option.decal.dirty=!0),a in o&&e.setItemVisual(t,`colorFromPalette`,!1)}}:null}}}},OK={performRawSeries:!0,overallReset:function(e){var t=W();e.eachSeries(function(e){if(!e.isColorBySeries()){var n=e.type+`-`+e.getColorBy();SK(e).scope=t.get(n)||t.set(n,{})}}),e.eachSeries(function(e){if(!e.isColorBySeries()){var t=e.getRawData(),n={},r=e.getData(),i=SK(e).scope,a=kS(e,e.visualStyleAccessPath||`itemStyle`);r.each(function(e){var t=r.getRawIndex(e);n[t]=e}),t.each(function(o){var s=n[o];if(r.getItemVisual(s,`colorFromPalette`)){var c=r.ensureUniqueItemVisual(s,`style`),l=t.getName(o)||o+``,u=t.count();c[a]=e.getColorFromPalette(l,i,u)}})}})}},kK=Math.PI,AK=function(){function e(e,t,n,r){this._stageTaskMap=W(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),r=this._visualHandlers=r.slice(),this._allHandlers=n.concat(r)}return e.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(e){var t=e.overallTask;t&&t.dirty()})},e.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),r=n.context,i=!t&&n.progressiveEnabled&&(!r||r.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,a=r&&r.modDataCount;return{step:i,modBy:a==null?null:Math.ceil(a/i),modDataCount:a}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid);e.pipelineContext=n.context=e.__preparePipelineContext?e.__preparePipelineContext(t,n):Zu(e,t,n)},e.prototype.restorePipelines=function(e,t){var n=this,r=n._pipelineMap=W();t.eachSeries(function(t){var i=e.painter.type===`canvas`&&t.getProgressive(),a=t.uid;r.set(a,{id:a,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),n._pipe(t,t.dataTask)})},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;L(this._allHandlers,function(r){var i=e.get(r.uid)||e.set(r.uid,{});to(!(r.reset&&r.overallReset),``),r.reset&&this._createSeriesStageTask(r,i,t,n),r.overallReset&&this._createOverallStageTask(r,i,t,n)},this)},e.prototype.prepareView=function(e,t,n,r){var i=e.renderTask,a=i.context;a.model=t,a.ecModel=n,a.api=r,i.__block=!e.incrementalPrepareRender,this._pipe(t,i)},e.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},e.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},e.prototype._performStageTasks=function(e,t,n,r){r||={};var i=!1,a=this;L(e,function(e,s){if(!(r.visualType&&r.visualType!==e.visualType)){var c=a._stageTaskMap.get(e.uid),l=c.seriesTaskMap,u=c.overallTask;if(u){var d,f=u.agentStubMap;f.each(function(e){o(r,e)&&(e.dirty(),d=!0)}),d&&u.dirty(),a.updatePayload(u,n);var p=a.getPerformArgs(u,r.block);f.each(function(e){e.perform(p)}),u.perform(p)&&(i=!0)}else l&&l.each(function(s,c){o(r,s)&&s.dirty();var l=a.getPerformArgs(s,r.block);l.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),a.updatePayload(s,n),s.perform(l)&&(i=!0)})}});function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}this.unfinished=i||this.unfinished},e.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(e){t=e.dataTask.perform()||t}),this.unfinished=t||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},e.prototype.updatePayload=function(e,t){t!==`remain`&&(e.context.payload=t)},e.prototype._createSeriesStageTask=function(e,t,n,r){var i=this,a=t.seriesTaskMap,o=t.seriesTaskMap=W(),s=e.seriesType,c=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(l):s?n.eachRawSeriesByType(s,l):c&&c(n,r).each(l);function l(t){var s=t.uid,c=o.set(s,a&&a.get(s)||Fh({plan:FS,reset:IS,count:RS}));c.context={model:t,ecModel:n,api:r,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:i},i._pipe(t,c)}},e.prototype._createOverallStageTask=function(e,t,n,r){var i=this,a=t.overallTask=t.overallTask||Fh({reset:jS});a.context={ecModel:n,api:r,overallReset:e.overallReset,scheduler:i};var o=a.agentStubMap,s=a.agentStubMap=W(),c=e.seriesType,l=e.getTargetSeries,u=e.dirtyOnOverallProgress,d=!1;to(!e.createOnAllSeries,``),c?n.eachRawSeriesByType(c,f):l?l(n,r).each(f):L(n.getSeries(),f);function f(e){var t=e.uid,n=s.set(t,o&&o.get(t)||(d=!0,Fh({reset:MS,onDirty:PS})));n.context={model:e,dirtyOnOverallProgress:u},n.agent=a,n.__block=u,i._pipe(e,n)}d&&a.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,r=this._pipelineMap.get(n);!r.head&&(r.head=t),r.tail&&r.tail.pipe(t),r.tail=t,t.__idxInPipeline=r.count++,t.__pipeline=r},e.wrapStageHandler=function(e,t){return B(e)&&(e={overallReset:e,seriesType:zS(e)}),e.uid=_m(`stageHandler`),t&&(e.visualType=t),e},e}(),jK=LS(0),MK={},NK={},BS(MK,dK),BS(NK,XR),MK.eachSeriesByType=MK.eachRawSeriesByType=function(e){PK=e},MK.eachComponent=function(e){e.mainType===`series`&&e.subType&&(PK=e.subType)},Z=X.darkColor,FK=Z.background,IK=function(){return{axisLine:{lineStyle:{color:Z.axisLine}},splitLine:{lineStyle:{color:Z.axisSplitLine}},splitArea:{areaStyle:{color:[Z.backgroundTint,Z.backgroundTransparent]}},minorSplitLine:{lineStyle:{color:Z.axisMinorSplitLine}},axisLabel:{color:Z.axisLabel},axisName:{}}},LK={label:{color:Z.secondary},itemStyle:{borderColor:Z.borderTint},dividerLineStyle:{color:Z.border}},RK={darkMode:!0,color:Z.theme,backgroundColor:FK,axisPointer:{lineStyle:{color:Z.border},crossStyle:{color:Z.borderShade},label:{color:Z.tertiary}},legend:{textStyle:{color:Z.secondary},pageTextStyle:{color:Z.tertiary}},textStyle:{color:Z.secondary},title:{textStyle:{color:Z.primary},subtextStyle:{color:Z.quaternary}},toolbox:{iconStyle:{borderColor:Z.accent50},feature:{dataView:{backgroundColor:FK,textColor:Z.primary,textareaColor:Z.background,textareaBorderColor:Z.border,buttonColor:Z.accent50,buttonTextColor:Z.neutral00}}},tooltip:{backgroundColor:Z.neutral20,defaultBorderColor:Z.border,textStyle:{color:Z.tertiary}},dataZoom:{borderColor:Z.accent10,textStyle:{color:Z.tertiary},brushStyle:{color:Z.backgroundTint},handleStyle:{color:Z.neutral00,borderColor:Z.accent20},moveHandleStyle:{color:Z.accent40},emphasis:{handleStyle:{borderColor:Z.accent50}},dataBackground:{lineStyle:{color:Z.accent30},areaStyle:{color:Z.accent20}},selectedDataBackground:{lineStyle:{color:Z.accent50},areaStyle:{color:Z.accent30}}},visualMap:{textStyle:{color:Z.secondary},handleStyle:{borderColor:Z.neutral30}},timeline:{lineStyle:{color:Z.accent10},label:{color:Z.tertiary},controlStyle:{color:Z.accent30,borderColor:Z.accent30}},calendar:{itemStyle:{color:Z.neutral00,borderColor:Z.neutral20},dayLabel:{color:Z.tertiary},monthLabel:{color:Z.secondary},yearLabel:{color:Z.secondary}},matrix:{x:LK,y:LK,backgroundColor:{borderColor:Z.axisLine},body:{itemStyle:{borderColor:Z.borderTint}}},timeAxis:IK(),logAxis:IK(),valueAxis:IK(),categoryAxis:IK(),line:{symbol:`circle`},graph:{color:Z.theme},gauge:{title:{color:Z.secondary},axisLine:{lineStyle:{color:[[1,Z.neutral05]]}},axisLabel:{color:Z.axisLabel},detail:{color:Z.primary}},candlestick:{itemStyle:{color:`#f64e56`,color0:`#54ea92`,borderColor:`#f64e56`,borderColor0:`#54ea92`}},funnel:{itemStyle:{borderColor:Z.background}},radar:function(){var e=IK();return e.axisName={color:Z.axisLabel},e.axisLine.lineStyle.color=Z.neutral20,e}(),treemap:{breadcrumb:{itemStyle:{color:Z.neutral20,textStyle:{color:Z.secondary}},emphasis:{itemStyle:{color:Z.neutral30}}}},sunburst:{itemStyle:{borderColor:Z.background}},map:{itemStyle:{borderColor:Z.border,areaColor:Z.neutral10},label:{color:Z.tertiary},emphasis:{label:{color:Z.primary},itemStyle:{areaColor:Z.highlight}},select:{label:{color:Z.primary},itemStyle:{areaColor:Z.highlight}}},geo:{itemStyle:{borderColor:Z.border,areaColor:Z.neutral10},emphasis:{label:{color:Z.primary},itemStyle:{areaColor:Z.highlight}},select:{label:{color:Z.primary},itemStyle:{color:Z.highlight}}}},RK.categoryAxis.splitLine.show=!1,zK=function(){function e(){}return e.prototype.normalizeQuery=function(e){var t={},n={},r={};if(V(e)){var i=uo(e);t.mainType=i.main||null,t.subType=i.sub||null}else{var a=[`Index`,`Name`,`Id`],o={name:1,dataIndex:1,dataType:1};L(e,function(e,i){for(var s=!1,c=0;c<a.length;c++){var l=a[c],u=i.lastIndexOf(l);if(u>0&&u===i.length-l.length){var d=i.slice(0,u);d!==`data`&&(t.mainType=d,t[l.toLowerCase()]=e,s=!0)}}o.hasOwnProperty(i)&&(n[i]=e,s=!0),s||(r[i]=e)})}return{cptQuery:t,dataQuery:n,otherQuery:r}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var r=n.targetEl,i=n.packedEvent,a=n.model,o=n.view;if(!a||!o)return!0;var s=t.cptQuery,c=t.dataQuery;return l(s,a,`mainType`)&&l(s,a,`subType`)&&l(s,a,`index`,`componentIndex`)&&l(s,a,`name`)&&l(s,a,`id`)&&l(c,i,`name`)&&l(c,i,`dataIndex`)&&l(c,i,`dataType`)&&(!o.filterForExposedEvent||o.filterForExposedEvent(e,t.otherQuery,r,i));function l(e,t,n,r){return e[n]==null||t[r||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),BK=[`symbol`,`symbolSize`,`symbolRotate`,`symbolOffset`],VK=BK.concat([`symbolKeepAspect`]),HK={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendIcon&&n.setVisual(`legendIcon`,e.legendIcon),!e.hasSymbolVisual)return;for(var r={},i={},a=!1,o=0;o<BK.length;o++){var s=BK[o],c=e.get(s);B(c)?(a=!0,i[s]=c):r[s]=c}if(r.symbol=r.symbol||e.defaultSymbol,n.setVisual(I({legendIcon:e.legendIcon||r.symbol,symbolKeepAspect:e.get(`symbolKeepAspect`)},r)),t.isSeriesFiltered(e))return;var l=Ba(i);function u(t,n){for(var r=e.getRawValue(n),a=e.getDataParams(n),o=0;o<l.length;o++){var s=l[o];t.setItemVisual(n,s,i[s](r,a))}}return{dataEach:a?u:null}}},UK={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!e.hasSymbolVisual||t.isSeriesFiltered(e))return;var n=e.getData();function r(e,t){for(var n=e.getItemModel(t),r=0;r<VK.length;r++){var i=VK[r],a=n.getShallow(i,!0);a!=null&&e.setItemVisual(t,i,a)}}return{dataEach:n.hasItemOption?r:null}}},WK=new UI,GK={},KK={},qK=Math.round(Math.random()*9),JK=typeof Object.defineProperty==`function`,YK=function(){function e(){this._id=`__ec_inner_`+qK++}return e.prototype.get=function(e){return this._guard(e)[this._id]},e.prototype.set=function(e,t){var n=this._guard(e);return JK?Object.defineProperty(n,this._id,{value:t,enumerable:!1,configurable:!0}):n[this._id]=t,this},e.prototype.delete=function(e){return this.has(e)?(delete this._guard(e)[this._id],!0):!1},e.prototype.has=function(e){return!!this._guard(e)[this._id]},e.prototype._guard=function(e){if(e!==Object(e))throw TypeError(`Value of WeakMap is not a non-null object.`);return e},e}(),XK=new LL(!0),ZK=[`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`],QK=[[`lineCap`,`butt`],[`lineJoin`,`miter`],[`miterLimit`,10]],$K=1,eq=2,tq=3,nq=4,rq=new YK,iq=new bF(100),aq=[`symbol`,`symbolSize`,`symbolKeepAspect`,`color`,`backgroundColor`,`dashArrayX`,`dashArrayY`,`maxTileWidth`,`maxTileHeight`],oq=$u(AC),sq=1,cq=800,lq=900,uq=920,dq=1e3,fq=2e3,pq=5e3,mq=1e3,hq=1100,gq=2e3,_q=3e3,vq=4e3,yq=4500,bq=4600,xq=5e3,Sq=6e3,Cq=7e3,wq={PROCESSOR:{SERIES_FILTER:cq,AXIS_STATISTICS:uq,FILTER:dq,STATISTIC:pq,STATISTICS:pq},VISUAL:{LAYOUT:mq,PROGRESSIVE_LAYOUT:hq,GLOBAL:gq,CHART:_q,POST_CHART_LAYOUT:bq,COMPONENT:vq,BRUSH:xq,CHART_ITEM:yq,ARIA:Sq,DECAL:Cq}},Tq=`__flagInMainProcess`,Eq=`__mainProcessVersion`,Dq=`__pendingUpdate`,Oq=`__needsUpdateStatus`,kq=/^[a-zA-Z0-9_]+$/,Aq=`__connectUpdateStatus`,jq=0,Mq=1,Nq=2,Pq=function(e){F(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(UI),Fq=Pq.prototype,Fq.on=MC(`on`),Fq.off=MC(`off`),tJ=function(e){F(t,e);function t(t,n,r){var i=e.call(this,new zK)||this;i._chartsViews=[],i._chartsMap={},i._componentsViews=[],i._componentsMap={},i._pendingActions=[],r||={},i.__v_skip=!0,i._dom=t;var a=`canvas`,o=`auto`,s=!1;i[Eq]=1,r.ssr&&Zx(function(e){var t=LR(e),n=t.dataIndex;if(n!=null){var r=W();return r.set(`series_index`,t.seriesIndex),r.set(`data_index`,n),t.ssrType&&r.set(`ssr_type`,t.ssrType),r}});var c=i._zr=Jx(t,{renderer:r.renderer||a,devicePixelRatio:r.devicePixelRatio,width:r.width,height:r.height,ssr:r.ssr,useDirtyRect:U(r.useDirtyRect,s),useCoarsePointer:U(r.useCoarsePointer,o),pointerSize:r.pointerSize});i._ssr=r.ssr,i._throttledZrFlush=hb(q(c.flush,c),17),i._updateTheme(n),i._locale=jm(r.locale||nH),i._coordSysMgr=new RV;var l=i._api=Xq(i);function u(e,t){return e.__prio-t.__prio}return Nx(lJ,u),Nx(sJ,u),i._scheduler=new AK(i,l,sJ,lJ),i._messageCenter=new Pq,i._initEvents(),i.resize=q(i.resize,i),c.animation.on(`frame`,i._onframe,i),Gq(c,i),Kq(c,i),ro(i),i}return t.prototype._onframe=function(){if(!this._disposed){var e=this._scheduler,t=this._model,n=this._api;if($q(this),this[Dq]){var r=this[Dq].silent;this[Tq]=!0,eJ(this);try{Iq(this),zq.update.call(this,null,this[Dq].updateParams)}catch(e){throw this[Tq]=!1,this[Dq]=null,e}this._zr.flush(),this[Tq]=!1,this[Dq]=null,Uq.call(this,r),Wq.call(this,r)}else if(e.unfinished){var i=sq;do{e.unfinished=!1;var a=GP.getTime();e.performSeriesTasks(t),e.performDataProcessorTasks(t),Vq(this,t),e.performVisualTasks(t),Yq(this,this._model,n,`remain`,{}),i-=GP.getTime()-a}while(i>0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,t,n){if(!this[Tq]){if(this._disposed)this.id;else{var r,i,a;if(H(t)&&(n=t.lazyUpdate,r=t.silent,i=t.replaceMerge,a=t.transition,t=t.notMerge),this[Tq]=!0,eJ(this),!this._model||t){var o=new pK(this._api),s=this._theme,c=this._model=new dK;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,s,this._locale,o)}this._model.setOption(e,{replaceMerge:i},cJ);var l={seriesTransition:a,optionChanged:!0};if(n)this[Dq]={silent:r,updateParams:l},this[Tq]=!1,this.getZr().wakeUp();else{try{Iq(this),zq.update.call(this,null,l)}catch(e){throw this[Dq]=null,this[Tq]=!1,e}this._ssr||this._zr.flush(),this[Dq]=null,this[Tq]=!1,Uq.call(this,r),Wq.call(this,r)}}}},t.prototype.setTheme=function(e,t){if(!this[Tq]){if(this._disposed)this.id;else{var n=this._model;if(n){var r=t&&t.silent,i=null;this[Dq]&&(r??=this[Dq].silent,i=this[Dq].updateParams,this[Dq]=null),this[Tq]=!0,eJ(this);try{this._updateTheme(e),n.setTheme(this._theme),Iq(this),zq.update.call(this,{type:`setTheme`},i)}catch(e){throw this[Tq]=!1,e}this[Tq]=!1,Uq.call(this,r),Wq.call(this,r)}}}},t.prototype._updateTheme=function(e){V(e)&&(e=uJ[e]),e&&(e=ka(e),e&&TS(e,!0),this._theme=e)},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||dF.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){return e||={},this._zr.painter.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get(`backgroundColor`),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){return e||={},this._zr.painter.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){var e=this._zr;return L(e.storage.getDisplayList(),function(e){e.stopAnimation(null,!0)}),e.painter.toDataURL()},t.prototype.getDataURL=function(e){if(this._disposed)this.id;else{e||={};var t=e.excludeComponents,n=this._model,r=[],i=this;L(t,function(e){n.eachComponent({mainType:e},function(e){var t=i._componentsMap[e.__viewId];t.group.ignore||(r.push(t),t.group.ignore=!0)})});var a=this._zr.painter.getType()===`svg`?this.getSvgDataURL():this.renderToCanvas(e).toDataURL(`image/`+(e&&e.type||`png`));return L(r,function(e){e.group.ignore=!1}),a}},t.prototype.getConnectedDataURL=function(e){if(this._disposed)this.id;else{var t=e.type===`svg`,n=this.group,r=Math.min,i=Math.max,a=1/0;if(pJ[n]){var o=a,s=a,c=-a,l=-a,u=[],d=e&&e.pixelRatio||this.getDevicePixelRatio();L(fJ,function(a,d){if(a.group===n){var f=t?a.getZr().painter.getSvgDom().innerHTML:a.renderToCanvas(ka(e)),p=a.getDom().getBoundingClientRect();o=r(p.left,o),s=r(p.top,s),c=i(p.right,c),l=i(p.bottom,l),u.push({dom:f,left:p.left,top:p.top})}}),o*=d,s*=d,c*=d,l*=d;var f=c-o,p=l-s,m=GP.createCanvas(),h=Jx(m,{renderer:t?`svg`:`canvas`});if(h.resize({width:f,height:p}),t){var g=``;return L(u,function(e){var t=e.left-o,n=e.top-s;g+=`<g transform="translate(`+t+`,`+n+`)">`+e.dom+`</g>`}),h.painter.getSvgRoot().innerHTML=g,e.connectedBackgroundColor&&h.painter.setBackgroundColor(e.connectedBackgroundColor),h.refreshImmediately(),h.painter.toDataURL()}return e.connectedBackgroundColor&&h.add(new rR({shape:{x:0,y:0,width:f,height:p},style:{fill:e.connectedBackgroundColor}})),L(u,function(e){var t=new $L({style:{x:e.left*d-o,y:e.top*d-s,image:e.dom}});h.add(t)}),h.refreshImmediately(),m.toDataURL(`image/`+(e&&e.type||`png`))}return this.getDataURL(e)}},t.prototype.convertToPixel=function(e,t,n){return Bq(this,`convertToPixel`,e,t,n)},t.prototype.convertToLayout=function(e,t,n){return Bq(this,`convertToLayout`,e,t,n)},t.prototype.convertFromPixel=function(e,t,n){return Bq(this,`convertFromPixel`,e,t,n)},t.prototype.containPixel=function(e,t){if(this._disposed)this.id;else{var n=this._model,r;return L(Ou(n,e),function(e,n){n.indexOf(`Models`)>=0&&L(e,function(e){var i=e.coordinateSystem;if(i&&i.containPoint)r||=!!i.containPoint(t);else if(n===`seriesModels`){var a=this._chartsMap[e.__viewId];a&&a.containPoint&&(r||=a.containPoint(t,e))}},this)},this),!!r}},t.prototype.getVisual=function(e,t){var n=this._model,r=Ou(n,e,{defaultMainType:`series`}),i=r.seriesModel.getData(),a=r.hasOwnProperty(`dataIndexInside`)?r.dataIndexInside:r.hasOwnProperty(`dataIndex`)?i.indexOfRawIndex(r.dataIndex):null;return a==null?HS(i,t):VS(i,a,t)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e=this;L(rJ,function(t){var n=function(n){var r=e.getModel(),i=n.target,a;if(t===`globalout`?a={}:i&&WS(i,function(e){var t=LR(e);if(t&&t.dataIndex!=null){var n=t.dataModel||r.getSeriesByIndex(t.seriesIndex);return a=n&&n.getDataParams(t.dataIndex,t.dataType,i)||{},!0}if(t.eventData)return a=I({},t.eventData),!0},!0),a){var o=a.componentType,s=a.componentIndex;(o===`markLine`||o===`markPoint`||o===`markArea`)&&(o=`series`,s=a.seriesIndex);var c=o&&s!=null&&r.getComponent(o,s),l=c&&e[c.mainType===`series`?`_chartsMap`:`_componentsMap`][c.__viewId];a.event=n,a.type=t,e._$eventProcessor.eventInfo={targetEl:i,packedEvent:a,model:c,view:l},e.trigger(t,a)}};n.zrEventfulCallAtLast=!0,e._zr.on(t,n,e)});var t=this._messageCenter;L(oJ,function(n,r){t.on(r,function(t){e.trigger(r,t)})}),zb(t,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){this._disposed?this.id:this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed)this.id;else{this._disposed=!0,this.getDom()&&Mu(this.getDom(),hJ,``);var e=this,t=e._api,n=e._model;L(e._componentsViews,function(e){e.dispose(n,t)}),L(e._chartsViews,function(e){e.dispose(n,t)}),e._zr.dispose(),e._dom=e._model=e._chartsMap=e._componentsMap=e._chartsViews=e._componentsViews=e._scheduler=e._api=e._zr=e._throttledZrFlush=e._theme=e._coordSysMgr=e._messageCenter=null,delete fJ[e.id]}},t.prototype.resize=function(e){if(!this[Tq]){if(this._disposed)this.id;else{this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption(`media`),r=e&&e.silent;this[Dq]&&(r??=this[Dq].silent,n=!0,this[Dq]=null),this[Tq]=!0,eJ(this);try{n&&Iq(this),zq.update.call(this,{type:`resize`,animation:I({duration:0},e&&e.animation)})}catch(e){throw this[Tq]=!1,e}this[Tq]=!1,Uq.call(this,r),Wq.call(this,r)}}}},t.prototype.showLoading=function(e,t){if(this._disposed)this.id;else if(H(e)&&(t=e,e=``),e||=`default`,this.hideLoading(),dJ[e]){var n=dJ[e](this._api,t),r=this._zr;this._loadingFX=n,r.add(n)}},t.prototype.hideLoading=function(){this._disposed?this.id:(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},t.prototype.makeActionFromEvent=function(e){var t=I({},e);return t.type=aJ[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed)this.id;else if(H(t)||(t={silent:!!t}),iJ[e.type]&&this._model){if(this[Tq])this._pendingActions.push(e);else{var n=t.silent;Hq.call(this,e,n);var r=t.flush;r?this._zr.flush():r!==!1&&dF.browser.weChat&&this._throttledZrFlush(),Uq.call(this,n),Wq.call(this,n)}}},t.prototype.updateLabelLayout=function(){WK.trigger(`series:layoutlabels`,this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed)this.id;else{var t=e.seriesIndex;this.getModel().getSeriesByIndex(t).appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},t.internalField=function(){Iq=function(e){Av(e._model);var t=e._scheduler;t.restorePipelines(e._zr,e._model),t.prepareStageTasks(),Lq(e,!0),Lq(e,!1),t.plan()},Lq=function(e,t){for(var n=e._model,r=e._scheduler,i=t?e._componentsViews:e._chartsViews,a=t?e._componentsMap:e._chartsMap,o=e._zr,s=e._api,c=0;c<i.length;c++)i[c].__alive=!1;t?n.eachComponent(function(e,t){e!==`series`&&l(t)}):n.eachSeries(l);function l(e){var c=e.__requireNewView;e.__requireNewView=!1;var l=`_ec_`+e.id+`_`+e.type,u=!c&&a[l];if(!u){var d=uo(e.type);u=new(t?xK.getClass(d.main,d.sub):cU.getClass(d.sub)),u.init(n,s),a[l]=u,i.push(u),o.add(u.group)}e.__viewId=u.__id=l,u.__alive=!0,u.__model=e,u.group.__ecComponentInfo={mainType:e.mainType,index:e.componentIndex},!t&&r.prepareView(u,e,n,s)}for(var c=0;c<i.length;){var u=i[c];u.__alive?c++:(!t&&u.renderTask.dispose(),o.remove(u.group),u.dispose(n,s),i.splice(c,1),a[u.__id]===u&&delete a[u.__id],u.__id=u.group.__ecComponentInfo=null)}},Rq=function(e,t,n,r,i){var a=e._model;if(a.setUpdatePayload(n),!r){L([].concat(e._componentsViews,e._chartsViews),l);return}var o=ju(n,r,i),s=n.excludeSeriesId,c;s!=null&&(c=W(),L(cu(s),function(e){var t=xu(e,null);t!=null&&c.set(t,!0)})),a&&a.eachComponent(o,function(t){if(!(c&&c.get(t.id)!=null)){if(Hd(n)){if(t instanceof UH)n.type===`highlight`&&!n.notBlur&&!t.get([`emphasis`,`disabled`])&&Ad(t,n,e._api);else{var r=jd(t.mainType,t.componentIndex,n.name,e._api),i=r.focusSelf,a=r.dispatchers;n.type===`highlight`&&i&&!n.notBlur&&kd(t.mainType,t.componentIndex,e._api),a&&L(a,function(e){n.type===`highlight`?bd(e):xd(e)})}}else Vd(n)&&t instanceof UH&&(see(t,n,e._api),Md(t),Qq(e))}},e),a&&a.eachComponent(o,function(t){c&&c.get(t.id)!=null||l(e[r===`series`?`_chartsMap`:`_componentsMap`][t.__viewId])},e);function l(r){r&&r.__alive&&r[t]&&r[t](r.__model,a,e._api,n)}},zq={prepareAndUpdate:function(e){Iq(this),zq.update.call(this,e,e&&{optionChanged:e.newOption!=null})},update:function(e,n){var r=this._model,i=this._api,a=this._zr,o=this._coordSysMgr,s=this._scheduler;if(r){jv(r),r.setUpdatePayload(e),s.restoreData(r,e),s.performSeriesTasks(r),o.create(r,i),WK.trigger(`coordsys:aftercreate`,r,i),s.performDataProcessorTasks(r,e),Vq(this,r),o.update(r,i),t(r),s.performVisualTasks(r,e);var c=r.get(`backgroundColor`)||`transparent`;a.setBackgroundColor(c);var l=r.get(`darkMode`);l!=null&&l!==`auto`&&a.setDarkMode(l),qq(this,r,i,e,n),WK.trigger(`afterupdate`,r,i)}},updateTransform:function(e){var t=this,n=t._model,r=t._api;if(n){n.setUpdatePayload(e);var i=[];n.eachComponent(function(a,o){if(a!==`series`){var s=t.getViewOfComponentModel(o);if(s&&s.__alive){if(s.updateTransform){var c=s.updateTransform(o,n,r,e);c&&c.update&&i.push(s)}else i.push(s)}}});var a=W();n.eachSeries(function(i){var o=t._chartsMap[i.__viewId],s=i.pipelineContext;if(o.updateTransform&&!s.progressiveRender){var c=o.updateTransform(i,n,r,e);c&&c.update&&a.set(i.uid,1)}else a.set(i.uid,1)}),t._scheduler.performVisualTasks(n,e,{setDirty:!0,dirtyMap:a}),Yq(t,n,r,e,{},a),WK.trigger(`afterupdate`,n,r)}},updateView:function(e){var n=this._model;n&&(n.setUpdatePayload(e),cU.markUpdateMethod(e,`updateView`),t(n),this._scheduler.performVisualTasks(n,e,{setDirty:!0}),qq(this,n,this._api,e,{}),WK.trigger(`afterupdate`,n,this._api))},updateVisual:function(e){var n=this,r=this._model;r&&(r.setUpdatePayload(e),r.eachSeries(function(e){e.getData().clearAllVisual()}),cU.markUpdateMethod(e,`updateVisual`),t(r),this._scheduler.performVisualTasks(r,e,{visualType:`visual`,setDirty:!0}),r.eachComponent(function(t,i){if(t!==`series`){var a=n.getViewOfComponentModel(i);a&&a.__alive&&a.updateVisual(i,r,n._api,e)}}),r.eachSeries(function(t){n._chartsMap[t.__viewId].updateVisual(t,r,n._api,e)}),WK.trigger(`afterupdate`,r,this._api))},updateLayout:function(e){zq.update.call(this,e)}};function e(e,t,n,r,i){if(e._disposed)e.id;else for(var a=e._model,o=e._coordSysMgr.getCoordinateSystems(),s,c=Ou(a,n),l=0;l<o.length;l++){var u=o[l];if(u[t]&&(s=u[t](a,c,r,i))!=null)return s}}Bq=e,Vq=function(e,t){var n=e._chartsMap,r=e._scheduler;t.eachSeries(function(e){r.updateStreamModes(e,n[e.__viewId])})},Hq=function(e,t){var n=this,r=this.getModel(),i=e.type,a=e.escapeConnect,o=iJ[i],s=(o.update||`update`).split(`:`),c=s.pop(),l=s[0]!=null&&uo(s[0]);this[Tq]=!0,eJ(this);var u=[e],d=!1;e.batch&&(d=!0,u=R(e.batch,function(t){return t=Ma(I({},t),e),t.batch=null,t}));var f=[],p,m=[],h=o.nonRefinedEventType,g=Vd(e),_=Hd(e);if(_&&Dd(this._api),L(u,function(t){var i=o.action(t,r,n._api);if(o.refineEvent?m.push(i):p=i,p||=I({},t),p.type=h,f.push(p),_){var a=ku(e),s=a.queryOptionMap,u=a.mainTypeSpecified?s.keys()[0]:`series`;Rq(n,c,t,u),Qq(n)}else g?(Rq(n,c,t,`series`),Qq(n)):l&&Rq(n,c,t,l.main,l.sub)}),c!==`none`&&!_&&!g&&!l)try{this[Dq]?(Iq(this),zq.update.call(this,e),this[Dq]=null):zq[c].call(this,e)}catch(e){throw this[Tq]=!1,e}if(p=d?{type:h,escapeConnect:a,batch:f}:f[0],this[Tq]=!1,!t){var v=void 0;if(o.refineEvent){var y=o.refineEvent(m,e,r,this._api).eventContent;to(H(y)),v=Ma({type:o.refinedEventType},y),v.fromAction=e.type,v.fromActionPayload=e,v.escapeConnect=!0}var b=this._messageCenter;b.trigger(p.type,p),v&&b.trigger(v.type,v)}},Uq=function(e){for(var t=this._pendingActions;t.length;){var n=t.shift();Hq.call(this,n,e)}},Wq=function(e){!e&&this.trigger(`updated`)},Gq=function(e,t){e.on(`rendered`,function(n){t.trigger(`rendered`,n),e.animation.isFinished()&&!t[Dq]&&!t._scheduler.unfinished&&!t._pendingActions.length?t.trigger(`finished`):e.refresh()})},Kq=function(e,t){e.on(`mouseover`,function(e){var n=e.target,r=WS(n,zd);r&&(aee(r,e,t._api),Qq(t))}).on(`mouseout`,function(e){var n=e.target,r=WS(n,zd);r&&(oee(r,e,t._api),Qq(t))}).on(`click`,function(e){var n=e.target,r=WS(n,function(e){return LR(e).dataIndex!=null},!0);if(r){var i=r.selected?`unselect`:`select`,a=LR(r);t._api.dispatchAction({type:i,dataType:a.dataType,dataIndexInside:a.dataIndex,seriesIndex:a.seriesIndex,isFromClick:!0})}})};function t(e){e.clearColorPalette(),e.eachSeries(function(e){e.clearColorPalette()})}function n(e){var t=[],n=[],r=!1;if(e.eachComponent(function(e,i){var a=i.get(`zlevel`)||0,o=i.get(`z`)||0,s=i.getZLevelKey();r||=!!s,(e===`series`?n:t).push({zlevel:a,z:o,idx:i.componentIndex,type:e,key:s})}),r){var i=t.concat(n),a,o;Nx(i,function(e,t){return e.zlevel===t.zlevel?e.z-t.z:e.zlevel-t.zlevel}),L(i,function(t){var n=e.getComponent(t.type,t.idx),r=t.zlevel,i=t.key;a!=null&&(r=Math.max(a,r)),i?(r===a&&i!==o&&r++,o=i):o&&=(r===a&&r++,``),a=r,n.setZLevel(r)})}}qq=function(e,t,r,i,a){n(t),Jq(e,t,r,i,a),L(e._chartsViews,function(e){e.__alive=!1}),Yq(e,t,r,i,a),L(e._chartsViews,function(e){e.__alive||e.remove(t,r)})},Jq=function(e,t,n,r,i,a){L(a||e._componentsViews,function(e){var i=e.__model;s(i,e),e.render(i,t,n,r),o(i,e),c(i,e)})},Yq=function(e,t,n,r,l,u){var d=e._scheduler;l=I(l||{},{updatedSeries:t.getSeries()}),WK.trigger(`series:beforeupdate`,t,n,l);var f=!1;t.eachSeries(function(t){var n=e._chartsMap[t.__viewId];n.__alive=!0;var i=n.renderTask;d.updatePayload(i,r),s(t,n),u&&u.get(t.uid)&&i.dirty(),i.perform(d.getPerformArgs(i))&&(f=!0),n.group.silent=!!t.get(`silent`),a(t,n),Md(t)}),d.unfinished=f||d.unfinished,WK.trigger(`series:layoutlabels`,t,n,l),WK.trigger(`series:transition`,t,n,l),t.eachSeries(function(t){var n=e._chartsMap[t.__viewId];o(t,n),c(t,n)}),i(e,t),WK.trigger(`series:afterupdate`,t,n,l)},Qq=function(e){e[Oq]=!0,e.getZr().wakeUp()},eJ=function(e){e[Eq]=(e[Eq]+1)%1e6},$q=function(e){e[Oq]&&(e.getZr().storage.traverse(function(e){pf(e)||r(e)}),e[Oq]=!1)};function r(e){for(var t=[],n=e.currentStates,r=0;r<n.length;r++){var i=n[r];i!==`emphasis`&&i!==`blur`&&i!==`select`&&t.push(i)}e.selected&&e.states.select&&t.push(`select`),e.hoverState===2&&e.states.emphasis?t.push(`emphasis`):e.hoverState===1&&e.states.blur&&t.push(`blur`),e.useStates(t)}function i(e,t){var n=e._zr;if(n.painter.type===`canvas`){var r=n.storage,i=0;r.traverse(function(e){e.isGroup||i++});var a=i>U(t.get(`hoverLayerThreshold`),iK.hoverLayerThreshold)&&!dF.node&&!dF.worker;(e._usingTHL||a)&&(t.eachSeries(function(t){if(!t.preventUsingHoverLayer){var n=e._chartsMap[t.__viewId];n.__alive&&n.eachRendered(function(e){var t=e.states.emphasis;t&&t.hoverLayer!==2&&(t.hoverLayer=+!!a)})}}),e._usingTHL=a)}}function a(e,t){var n=e.get(`blendMode`)||null;t.eachRendered(function(e){e.isGroup||(e.style.blend=n)})}function o(e,t){if(!e.preventAutoZ){var n=Yf(e);t.eachRendered(function(e){return Zf(e,n.z,n.zlevel),!0})}}function s(e,t){t.eachRendered(function(e){if(!pf(e)){var t=e.getTextContent(),n=e.getTextGuideLine();e.stateTransition&&=null,t&&t.stateTransition&&(t.stateTransition=null),n&&n.stateTransition&&(n.stateTransition=null),e.hasState()?(e.prevStates=e.currentStates,e.clearStates()):e.prevStates&&=null}})}function c(e,t){var n=e.getModel(`stateAnimation`),i=e.isAnimationEnabled(),a=n.get(`duration`),o=a>0?{duration:a,delay:n.get(`delay`),easing:n.get(`easing`)}:null;t.eachRendered(function(e){if(e.states&&e.states.emphasis){if(pf(e))return;if(e instanceof JL&&Ud(e),e.__dirty){var t=e.prevStates;t&&e.useStates(t)}if(i){e.stateTransition=o;var n=e.getTextContent(),a=e.getTextGuideLine();n&&(n.stateTransition=o),a&&(a.stateTransition=o)}e.__dirty&&r(e)}})}Xq=function(e){return new(function(t){F(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}return n.prototype.getCoordinateSystems=function(){return e._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(t){for(;t;){var n=t.__ecComponentInfo;if(n!=null)return e._model.getComponent(n.mainType,n.index);t=t.parent}},n.prototype.enterEmphasis=function(t,n){bd(t,n),Qq(e)},n.prototype.leaveEmphasis=function(t,n){xd(t,n),Qq(e)},n.prototype.enterBlur=function(t){Sd(t),Qq(e)},n.prototype.leaveBlur=function(t){Cd(t),Qq(e)},n.prototype.enterSelect=function(t){wd(t),Qq(e)},n.prototype.leaveSelect=function(t){Td(t),Qq(e)},n.prototype.getModel=function(){return e.getModel()},n.prototype.getViewOfComponentModel=function(t){return e.getViewOfComponentModel(t)},n.prototype.getViewOfSeriesModel=function(t){return e.getViewOfSeriesModel(t)},n.prototype.getECUpdateCycleVersion=function(){return e[Eq]},n.prototype.usingTHL=function(){return e._usingTHL},n}(XR))(e)},Zq=function(e){function t(e,t){for(var n=0;n<e.length;n++){var r=e[n];r[Aq]=t}}L(aJ,function(n,r){e._messageCenter.on(r,function(n){if(pJ[e.group]&&e[Aq]!==jq){if(n&&n.escapeConnect)return;var r=e.makeActionFromEvent(n),i=[];L(fJ,function(t){t!==e&&t.group===e.group&&i.push(t)}),t(i,jq),L(i,function(e){e[Aq]!==Mq&&e.dispatchAction(r)}),t(i,Nq)}})})}}(),t}(UI),nJ=tJ.prototype,nJ.on=jC(`on`),nJ.off=jC(`off`),nJ.one=function(e,t,n){var r=this;function i(){var n=[...arguments];t&&t.apply&&t.apply(this,n),r.off(e,i)}this.on.call(this,e,i,n)},rJ=[`click`,`dblclick`,`mouseover`,`mouseout`,`mousemove`,`mousedown`,`mouseup`,`globalout`,`contextmenu`],iJ={},aJ={},oJ={},sJ=[],cJ=[],lJ=[],uJ={},dJ={},fJ={},pJ={},mJ=new Date-0,new Date-0,hJ=`_echarts_instance_`,gJ=[],_J=Vh,GC(gq,TK),GC(yq,DK),GC(yq,OK),GC(gq,HK),GC(yq,UK),GC(Cq,oq),LC(TS),RC(lq,bK),qC(`default`,AS),HC({type:rz,event:rz,update:rz},co),HC({type:iz,event:iz,update:iz},co),HC({type:az,event:cz,update:az,action:co,refineEvent:YC,publishNonRefinedEvent:!0}),HC({type:oz,event:cz,update:oz,action:co,refineEvent:YC,publishNonRefinedEvent:!0}),HC({type:sz,event:cz,update:sz,action:co,refineEvent:YC,publishNonRefinedEvent:!0}),IC(`default`,{}),IC(`dark`,RK),vJ=[],yJ={registerPreprocessor:LC,registerProcessor:RC,registerPostInit:zC,registerPostUpdate:BC,registerUpdateLifecycle:VC,registerAction:HC,registerCoordinateSystem:UC,registerLayout:WC,registerVisual:GC,registerTransform:_J,registerLoading:qC,registerMap:JC,registerImpl:GS,PRIORITY:wq,ComponentModel:TH,ComponentView:xK,SeriesModel:UH,ChartView:cU,registerComponentModel:function(e){TH.registerClass(e)},registerComponentView:function(e){xK.registerClass(e)},registerSeriesModel:function(e){UH.registerClass(e)},registerChartView:function(e){cU.registerClass(e)},registerCustomSeries:function(e,t){qS(e,t)},registerSubTypeDefaulter:function(e,t){TH.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){Yx(e,t)}},bJ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return t.prototype.getInitialData=function(e,t){return mm(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){return this.option.progressive??(this.option.large?5e3:this.get(`progressive`))},t.prototype.getProgressiveThreshold=function(){return this.option.progressiveThreshold??(this.option.large?1e4:this.get(`progressiveThreshold`))},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:``},t.type=`series.scatter`,t.dependencies=[`grid`,`polar`,`geo`,`singleAxis`,`calendar`,`matrix`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:X.color.primary}},universalTransition:{divideShape:`clone`}},t}(UH),xJ=4,SJ=function(){function e(){}return e}(),CJ=function(e){F(t,e);function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return t.prototype.getDefaultShape=function(){return new SJ},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.beforeBrush=function(e){e&&!e.contentRetained&&this.reset()},t.prototype.buildPath=function(e,t){var n=t.points,r=t.size,i=this.symbolProxy,a=i.shape,o=e.getContext?e.getContext():e,s=o&&r[0]<xJ,c=this.softClipShape,l;if(s)this._ctx=o;else{for(this._ctx=null,l=this._off;l<n.length;){var u=n[l++],d=n[l++];isNaN(u)||isNaN(d)||(!c||c.contain(u,d))&&(a.x=u-r[0]/2,a.y=d-r[1]/2,a.width=r[0],a.height=r[1],i.buildPath(e,a,!0))}this.incremental&&(this._off=l,this.notClear=!0)}},t.prototype.afterBrush=function(){var e=this.shape,t=e.points,n=e.size,r=this._ctx,i=this.softClipShape,a;if(r){for(a=this._off;a<t.length;){var o=t[a++],s=t[a++];isNaN(o)||isNaN(s)||(!i||i.contain(o,s))&&r.fillRect(o-n[0]/2,s-n[1]/2,n[0],n[1])}this.incremental&&(this._off=a,this.notClear=!0)}},t.prototype.findDataIndex=function(e,t){for(var n=this.shape,r=n.points,i=n.size,a=Math.max(i[0],4),o=Math.max(i[1],4),s=r.length/2-1;s>=0;s--){var c=s*2,l=r[c]-a/2,u=r[c+1]-o/2;if(e>=l&&t>=u&&e<=l+a&&t<=u+o)return s}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect();return e=n[0],t=n[1],r.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape,n=t.points,r=t.size,i=r[0],a=r[1],o=1/0,s=1/0,c=-1/0,l=-1/0,u=0;u<n.length;){var d=n[u++],f=n[u++];o=Math.min(d,o),c=Math.max(d,c),s=Math.min(f,s),l=Math.max(f,l)}e=this._rect=new J(o-i/2,s-a/2,c-o+i,l-s+a)}return e},t}(JL),wJ=function(){function e(){this.group=new Sz}return e.prototype.updateData=function(e,t){this._clear(),this._data=e;var n=this._create();n.setShape({points:e.getLayout(`points`)}),this._setCommon(n,e,t)},e.prototype.updateLayout=function(e){var t=this._data;if(t){var n=t.getLayout(`points`);this.group.eachChild(function(e){if(e.startIndex!=null){var t=(e.endIndex-e.startIndex)*2,r=e.startIndex*4*2;n=new Float32Array(n.buffer,r,t)}e.setShape(`points`,n),e.reset(),e.stopAnimation()})}},e.prototype.incrementalPrepareUpdate=function(e){this._clear()},e.prototype.incrementalUpdate=function(e,t,n,r){var i=this._newAdded[0],a=t.getLayout(`points`),o=i&&i.shape.points;if(o&&o.length<2e4){var s=o.length,c=new Float32Array(s+a.length);c.set(o),c.set(a,s),i.endIndex=e.end,i.setShape({points:c})}else{this._newAdded=[];var l=this._create();l.startIndex=e.start,l.endIndex=e.end,l.incremental=n,l.setShape({points:a}),this._setCommon(l,t,r)}},e.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},e.prototype._create=function(){var e=new CJ({cursor:`default`});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},e.prototype._setCommon=function(e,t,n){var r=t.hostModel;n||={};var i=t.getVisual(`symbolSize`);e.setShape(`size`,i instanceof Array?i:[i,i]),e.softClipShape=n.clipShape||null,e.symbolProxy=xg(t.getVisual(`symbol`),0,0,0,0),e.setColor=e.symbolProxy.setColor;var a=e.shape.size[0]<xJ;e.useStyle(r.getModel(`itemStyle`).getItemStyle(a?[`color`,`shadowBlur`,`shadowColor`]:[`color`]));var o=t.getVisual(`style`),s=o&&o.fill;s&&e.setColor(s);var c=LR(e);c.seriesIndex=r.seriesIndex,e.on(`mousemove`,function(t){c.dataIndex=null;var n=e.hoverDataIdx;n>=0&&(c.dataIndex=n+(e.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),TJ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).updateData(r,ZC(e)),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).incrementalPrepareUpdate(r),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._symbolDraw.incrementalUpdate(e,t.getData(),Xu(t),ZC(t)),this._finished=e.end===t.getData().count()},t.prototype.updateTransform=function(e,t,n){var r=e.getData();if(this.group.dirty(),this._finished){var i=uv(``).reset(e,t,n);i.progress&&i.progress({start:0,end:r.count(),count:r.count()},r),this._symbolDraw.updateLayout(ZC(e))}else return{update:!0}},t.prototype.eachRendered=function(e){this._symbolDraw&&this._symbolDraw.eachRendered(e)},t.prototype._updateSymbolDraw=function(e,t){var n=this._symbolDraw,r=t.pipelineContext.large;return n&&r===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=r?new wJ:new ZH,this._isLargeDraw=r,this.group.removeAll()),this.group.add(n.group),n},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type=`scatter`,t}(cU),EJ=function(){function e(){}return e.prototype.needIncludeZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}(),DJ=function(e){F(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents(`grid`,PR).models[0]},t.type=`cartesian2dAxis`,t}(TH),Fa(DJ,EJ),OJ={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:`auto`,onZeroAxisIndex:null,lineStyle:{color:X.color.axisLine,width:1,type:`solid`},symbol:[`none`,`none`],symbolSize:[10,15],breakLine:!0},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,color:X.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:X.color.axisSplitLine,width:1,type:`solid`}},splitArea:{show:!1,areaStyle:{color:[X.color.backgroundTint,X.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:X.color.neutral00,borderColor:X.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:`auto`}},kJ=Aa({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:`auto`,show:`auto`},axisLabel:{interval:`auto`}},OJ),AJ=Aa({boundaryGap:[0,0],axisLine:{show:`auto`},axisTick:{show:`auto`},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:X.color.axisMinorSplitLine,width:1}}},OJ),jJ={category:kJ,value:AJ,time:Aa({splitNumber:6,axisLabel:{rich:{primary:{fontWeight:`bold`}}},splitLine:{show:!1}},AJ),log:Ma({logBase:10},AJ)},MJ=function(){function e(e){this.type=`cartesian`,this._dimList=[],this._axes={},this.name=e||``}return e.prototype.getAxis=function(e){return this._axes[e]},e.prototype.getAxes=function(){return R(this._dimList,function(e){return this._axes[e]},this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),Ra(this.getAxes(),function(t){return t.scale.type===e})},e.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},e}(),NJ=[`x`,`y`],PJ=function(e){F(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=OW,t.dimensions=NJ,t}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis(`x`).scale,t=this.getAxis(`y`).scale;if(ew(e)&&ew(t)){var n=a_(e,null),r=a_(t,null),i=this.dataToPoint([n[0],r[0]]),a=this.dataToPoint([n[1],r[1]]),o=n[1]-n[0],s=r[1]-r[0];if(o&&s){var c=(a[0]-i[0])/o,l=(a[1]-i[1])/s,u=i[0]-n[0]*c,d=i[1]-r[0]*l,f=this._transform=[c,0,0,l,u,d];this._invTransform=No([],f)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale(`ordinal`)[0]||this.getAxesByScale(`time`)[0]||this.getAxis(`x`)},t.prototype.containPoint=function(e){var t=this.getAxis(`x`),n=this.getAxis(`y`);return t.contain(t.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis(`x`).containData(e[0])&&this.getAxis(`y`).containData(e[1])},t.prototype.containZone=function(e,t){var n=this.dataToPoint(e),r=this.dataToPoint(t),i=this.getArea(),a=new J(n[0],n[1],r[0]-n[0],r[1]-n[1]);return i.intersect(a)},t.prototype.dataToPoint=function(e,t,n){n||=[];var r=e[0],i=e[1];if(this._transform&&r!=null&&isFinite(r)&&i!=null&&isFinite(i))return qo(n,e,this._transform);var a=this.getAxis(`x`),o=this.getAxis(`y`);return n[0]=a.toGlobalCoord(a.dataToCoord(r,t)),n[1]=o.toGlobalCoord(o.dataToCoord(i,t)),n},t.prototype.clampData=function(e,t){var n=this.getAxis(`x`).scale,r=this.getAxis(`y`).scale,i=n.getExtent(),a=r.getExtent(),o=n.parse(e[0]),s=r.parse(e[1]);return t||=[],t[0]=Math.min(Math.max(Math.min(i[0],i[1]),o),Math.max(i[0],i[1])),t[1]=Math.min(Math.max(Math.min(a[0],a[1]),s),Math.max(a[0],a[1])),t},t.prototype.pointToData=function(e,t,n){if(n||=[],this._invTransform)return qo(n,e,this._invTransform);var r=this.getAxis(`x`),i=this.getAxis(`y`);return n[0]=r.coordToData(r.toLocalCoord(e[0]),t),n[1]=i.coordToData(i.toLocalCoord(e[1]),t),n},t.prototype.getOtherAxis=function(e){return this.getAxis(e.dim===`x`?`y`:`x`)},t.prototype.getArea=function(e){e||=0;var t=this.getAxis(`x`).getGlobalExtent(),n=this.getAxis(`y`).getGlobalExtent(),r=Math.min(t[0],t[1])-e,i=Math.min(n[0],n[1])-e;return new J(r,i,Math.max(t[0],t[1])-r+e,Math.max(n[0],n[1])-i+e)},t}(MJ),FJ={interval:nw,log:nw,time:bU,ordinal:co},IJ=[[3,1],[0,2]],LJ=function(){function e(e,t,n){this.type=`grid`,this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=NJ,this._initCartesian(e,t,n),this.model=e}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(e,t){var n=this._axesMap;L(this._axesList,function(e){Gy(e,1);var t=e.scale;m_(t)&&t.setSortInfo(e.model.get(`categorySortInfo`))});function r(e){for(var t=Ba(e),n=[],r=t.length-1;r>=0;r--){var i=e[+t[r]];i.__alignTo?n.push(i):aw(i)}L(n,function(e){fw(e,e.__alignTo)?aw(e):tw(e,e.__alignTo.scale)})}r(n.x),r(n.y);var i={};L(n.x,function(e){lw(n,`y`,e,i)}),L(n.y,function(e){lw(n,`x`,e,i)}),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var r=Sh(e,t),i=this._rect=xh(e.getBoxLayoutParams(),r.refContainer),a=this._axesMap,o=this._coordsList,s=e.get(`containLabel`);if(mw(a,i),!n){var c=_w(i,o,a,s,t),l=void 0;if(s)RJ?(RJ(this._axesList,i),mw(a,i)):l=gw(i.clone(),`axisLabel`,null,i,a,c,r);else{var u=yw(e,i,r),d=u.outerBoundsRect,f=u.parsedOuterBoundsContain,p=u.outerBoundsClamp;d&&(l=gw(d,f,p,i,a,c,r))}vw(i,a,FU.determine,null,l,r),L(this._coordsList,function(e){e.calcAffineTransform()})}},e.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(n!=null)return n[t||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var n=`x`+e+`y`+t;return this._coordsMap[n]}H(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var r=0,i=this._coordsList;r<i.length;r++)if(i[r].getAxis(`x`).index===e||i[r].getAxis(`y`).index===t)return i[r]},e.prototype.getCartesians=function(){return this._coordsList.slice()},e.prototype.convertToPixel=function(e,t,n){var r=this._findConvertTarget(t);return r.cartesian?r.cartesian.dataToPoint(n):r.axis?r.axis.toGlobalCoord(r.axis.dataToCoord(n)):null},e.prototype.convertFromPixel=function(e,t,n){var r=this._findConvertTarget(t);return r.cartesian?r.cartesian.pointToData(n):r.axis?r.axis.coordToData(r.axis.toLocalCoord(n)):null},e.prototype._findConvertTarget=function(e){var t=e.seriesModel,n=e.xAxisModel||t&&t.getReferringComponents(`xAxis`,PR).models[0],r=e.yAxisModel||t&&t.getReferringComponents(`yAxis`,PR).models[0],i=e.gridModel,a=this._coordsList,o,s;return t?(o=t.coordinateSystem,Na(a,o)<0&&(o=null)):n&&r?o=this.getCartesian(n.componentIndex,r.componentIndex):n?s=this.getAxis(`x`,n.componentIndex):r?s=this.getAxis(`y`,r.componentIndex):i&&i.coordinateSystem===this&&(o=this._coordsList[0]),{cartesian:o,axis:s}},e.prototype.containPoint=function(e){var t=this._coordsList[0];if(t)return t.containPoint(e)},e.prototype._initCartesian=function(e,t,n){var r=this,i=this,a={left:!1,right:!1,top:!1,bottom:!1},o={x:{},y:{}},s={x:0,y:0};if(t.eachComponent(`xAxis`,c(`x`),this),t.eachComponent(`yAxis`,c(`y`),this),!s.x||!s.y){this._axesMap={},this._axesList=[];return}this._axesMap=o,L(o.x,function(t,n){L(o.y,function(i,a){var o=`x`+n+`y`+a,s=new PJ(o);s.master=r,s.model=e,r._coordsMap[o]=s,r._coordsList.push(s),s.addAxis(t),s.addAxis(i)})}),dw(o.x),dw(o.y);function c(t){return function(n,r){if(cw(n,e)){var c=n.get(`position`);t===`x`?c!==`top`&&c!==`bottom`&&(c=a.bottom?`top`:`bottom`):c!==`left`&&c!==`right`&&(c=a.left?`right`:`left`),a[c]=!0;var l=dee(n),u=new qU(t,M_(n,l,!0),[0,0],l,c);u.onBand=q_(u.scale,n),u.inverse=n.get(`inverse`),n.axis=u,u.model=n,u.grid=i,u.index=r,i._axesList.push(u),o[t][r]=u,s[t]++}}}},e.prototype.getTooltipAxes=function(e){var t=[],n=[];return L(this.getCartesians(),function(r){var i=e!=null&&e!==`auto`?r.getAxis(e):r.getBaseAxis(),a=r.getOtherAxis(i);Na(t,i)<0&&t.push(i),Na(n,a)<0&&n.push(a)}),{baseAxes:t,otherAxes:n}},e.create=function(t,n){var r=[];return t.eachComponent(`grid`,function(i,a){var o=new e(i,t,n);o.name=`grid_`+a,o.resize(i,n,!0),i.coordinateSystem=o,r.push(o),L(o._axesList,function(t){Wy(t,e.dimIdxMap)})}),t.eachSeries(function(e){var t,n;am({targetModel:e,coordSysType:OW,coordSysProvider:r});function r(){var r=Iy(e),i=r.xAxisModel,a=r.yAxisModel;return t=i.axis,n=a.axis,i.getCoordSysModel().coordinateSystem.getCartesian(i.componentIndex,a.componentIndex)}t&&n&&(Kv(t,e,OW),Kv(n,e,OW))},this),r},e.dimensions=NJ,e.dimIdxMap=Yp(NJ),e}(),zJ=function(e,t,n,r,i,a){var o=n.axis.dim===`x`?`y`:`x`;hW(e,t,n,r,i,a),V_(e.nameLocation)||L(t.recordMap[o],function(e){e&&e.labelInfoList&&e.dirVec&&_y(e.labelInfoList,e.dirVec,r,i)})},BJ={},VJ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(t,n,r,i){this.axisPointerClass&&Ew(t),e.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(t,r,!0)},t.prototype.updateAxisPointer=function(e,t,n,r){this._doUpdateAxisPointerClass(e,n,!1)},t.prototype.remove=function(e,t){var n=this._axisPointer;n&&n.remove(t)},t.prototype.dispose=function(t,n){this._disposeAxisPointer(n),e.prototype.dispose.apply(this,arguments)},t.prototype._doUpdateAxisPointerClass=function(e,n,r){var i=t.getAxisPointerClass(this.axisPointerClass);if(i){var a=Ow(e);a?(this._axisPointer||=new i).render(e,a,n,r):this._disposeAxisPointer(n)}},t.prototype._disposeAxisPointer=function(e){this._axisPointer&&this._axisPointer.dispose(e),this._axisPointer=null},t.registerAxisPointerClass=function(e,t){BJ[e]=t},t.getAxisPointerClass=function(e){return e&&BJ[e]},t.type=`axis`,t}(xK),HJ=Du(),UJ=[`splitArea`,`splitLine`,`minorSplitLine`,`breakArea`],WJ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass=`CartesianAxisPointer`,n}return t.prototype.render=function(t,n,r,i){this.group.removeAll();var a=this._axisGroup;this._axisGroup=new Sz,this.group.add(this._axisGroup),H_(t)&&(this._axisGroup.add(t.axis.axisBuilder.group),L(UJ,function(e){t.get([e,`show`])&&GJ[e](this,this._axisGroup,t,t.getCoordSysModel(),r)},this),i&&i.type===`changeAxisOrder`&&i.isInitSort||Nf(a,this._axisGroup,t),e.prototype.render.call(this,t,n,r,i))},t.prototype.remove=function(){Mw(this)},t.type=`cartesianAxis`,t}(VJ),GJ={splitLine:function(e,t,n,r,i){var a=n.axis;if(!a.scale.isBlank()){var o=n.getModel(`splitLine`),s=o.getModel(`lineStyle`),c=s.get(`color`),l=o.get(`showMinLine`)!==!1,u=o.get(`showMaxLine`)!==!1;c=z(c)?c:[c];for(var d=r.coordinateSystem.getRect(),f=a.isHorizontal(),p=0,m=a.getTicksCoords({tickModel:o,breakTicks:`none`,pruneByBreak:`preserve_extent_bound`}),h=[],g=[],_=s.getLineStyle(),v=0;v<m.length;v++){var y=a.toGlobalCoord(m[v].coord);if(!(v===0&&!l||v===m.length-1&&!u)){var b=m[v].tickValue;f?(h[0]=y,h[1]=d.y,g[0]=y,g[1]=d.y+d.height):(h[0]=d.x,h[1]=y,g[0]=d.x+d.width,g[1]=y);var x=p++%c.length,S=new Jz({anid:b==null?null:`line_`+b,autoBatch:!0,shape:{x1:h[0],y1:h[1],x2:g[0],y2:g[1]},style:Ma({stroke:c[x]},_),silent:!0});Ef(S.shape,_.lineWidth),t.add(S)}}}},minorSplitLine:function(e,t,n,r,i){var a=n.axis,o=n.getModel(`minorSplitLine`).getModel(`lineStyle`),s=r.coordinateSystem.getRect(),c=a.isHorizontal(),l=a.getMinorTicksCoords();if(l.length)for(var u=[],d=[],f=o.getLineStyle(),p=0;p<l.length;p++)for(var m=0;m<l[p].length;m++){var h=a.toGlobalCoord(l[p][m].coord);c?(u[0]=h,u[1]=s.y,d[0]=h,d[1]=s.y+s.height):(u[0]=s.x,u[1]=h,d[0]=s.x+s.width,d[1]=h);var g=new Jz({anid:`minor_line_`+l[p][m].tickValue,autoBatch:!0,shape:{x1:u[0],y1:u[1],x2:d[0],y2:d[1]},style:f,silent:!0});Ef(g.shape,f.lineWidth),t.add(g)}},splitArea:function(e,t,n,r,i){jw(e,t,n,r)},breakArea:function(e,t,n,r,i){var a=fy(),o=n.axis.scale;a&&o.type!==`ordinal`&&a.rectCoordBuildBreakAxis(t,e,n,r.coordinateSystem.getRect(),i)}},KJ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`xAxis`,t}(WJ),qJ=function(e){F(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=KJ.type,t}return t.type=`yAxis`,t}(WJ),JJ=function(e){F(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`grid`,t}return t.prototype.render=function(e,t){this.group.removeAll(),e.get(`show`)&&this.group.add(new rR({shape:e.coordinateSystem.getRect(),style:Ma({fill:e.get(`backgroundColor`)},e.getItemStyle()),silent:!0,z2:-1}))},t.type=`grid`,t}(xK),YJ={offset:0},XJ=Du(),HC({type:`takeGlobalCursor`,event:`globalCursorTaken`,update:`update`},co),ZJ={axisPointer:1,tooltip:1,brush:1},QJ=function(e){F(t,e);function t(t){var n=e.call(this)||this;n._zr=t;var r=q(n._mousedownHandler,n),i=q(n._mousemoveHandler,n),a=q(n._mouseupHandler,n),o=q(n._mousewheelHandler,n),s=q(n._pinchHandler,n);return n.enable=function(e,n){var c=n.zInfo,l=Yf(c.component),u=l.z,d=l.zlevel,f={component:c.component,z:u,zlevel:d,z2:U(c.z2,-1/0)},p=I({},n.triggerInfo);this._opt=Ma(I({},n),{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0,zInfoParsed:f,triggerInfo:p,cursorGrab:`grab`,cursorGrabbing:`grabbing`}),e??=!0,this._enabled&&this._controlType===e||(this.disable(),this._enabled=!0,(e===!0||e===`move`||e===`pan`)&&(zw(t,`mousedown`,r,f),zw(t,`mousemove`,i,f),zw(t,`mouseup`,a,f)),(e===!0||e===`scale`||e===`zoom`)&&(zw(t,`mousewheel`,o,f),zw(t,`pinch`,s,f)))},n.disable=function(){this._enabled&&(this._enabled=!1,Bw(t,`mousedown`,r),Bw(t,`mousemove`,i),Bw(t,`mouseup`,a),Bw(t,`mousewheel`,o),Bw(t,`pinch`,s))},n}return t.prototype.isDragging=function(){return this._dragging},t.prototype.isPinching=function(){return this._pinching},t.prototype._checkPointer=function(e,t,n){var r=this._opt,i=r.zInfoParsed;if(Iw(e,r.api,i.component))return!1;var a=r.triggerInfo,o=a.roamTrigger,s=!1;return o===`global`&&(s=!0),s||=a.isInSelf(e,t,n),s&&a.isInClip&&!a.isInClip(e,t,n)&&(s=!1),s},t.prototype._decideCursorStyle=function(e,t,n,r){var i=e.target;if(!i&&this._checkPointer(e,t,n))return this._opt.cursorGrab;if(r)return i&&i.cursor||`default`},t.prototype.dispose=function(){this.disable()},t.prototype._mousedownHandler=function(e){if(!(_x(e)||Lw(e))){for(var t=e.target;t;){if(t.draggable)return;t=t.__hostTarget||t.parent}var n=e.offsetX,r=e.offsetY;this._checkPointer(e,n,r)&&(this._x=n,this._y=r,this._dragging=!0)}},t.prototype._mousemoveHandler=function(e){var t=this._zr;if(!(e.gestureEvent===`pinch`||Fw(t,`globalPan`)||Lw(e))){var n=e.offsetX,r=e.offsetY;if(!this._dragging||!Ww(`moveOnMouseMove`,e,this._opt)){var i=this._decideCursorStyle(e,n,r,!1);i&&t.setCursorStyle(i)}else{t.setCursorStyle(this._opt.cursorGrabbing);var a=this._x,o=this._y,s=n-a,c=r-o;this._x=n,this._y=r,this._opt.preventDefaultMouseMove&&TG(e.event),e.__ecRoamConsumed=!0,Uw(this,`pan`,`moveOnMouseMove`,e,{dx:s,dy:c,oldX:a,oldY:o,newX:n,newY:r,isAvailableBehavior:null})}}},t.prototype._mouseupHandler=function(e){if(!Lw(e)){var t=this._zr;if(!_x(e)){this._dragging=!1;var n=this._decideCursorStyle(e,e.offsetX,e.offsetY,!0);n&&t.setCursorStyle(n)}}},t.prototype._mousewheelHandler=function(e){if(!Lw(e)){var t=Ww(`zoomOnMouseWheel`,e,this._opt),n=Ww(`moveOnMouseWheel`,e,this._opt),r=e.wheelDelta,i=Math.abs(r),a=e.offsetX,o=e.offsetY;if(r!==0&&(t||n)){if(t){var s=i>3?1.4:i>1?1.2:1.1,c=r>0?s:1/s;this._checkTriggerMoveZoom(this,`zoom`,`zoomOnMouseWheel`,e,{scale:c,originX:a,originY:o,isAvailableBehavior:null})}if(n){var l=Math.abs(r),u=(r>0?1:-1)*(l>3?.4:l>1?.15:.05);this._checkTriggerMoveZoom(this,`scrollMove`,`moveOnMouseWheel`,e,{scrollDelta:u,originX:a,originY:o,isAvailableBehavior:null})}}}},t.prototype._pinchHandler=function(e){if(!(Fw(this._zr,`globalPan`)||Lw(e))){var t=e.pinchScale>1?1.1:1/1.1;this._checkTriggerMoveZoom(this,`zoom`,null,e,{scale:t,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})}},t.prototype._checkTriggerMoveZoom=function(e,t,n,r,i){e._checkPointer(r,i.originX,i.originY)&&(TG(r.event),r.__ecRoamConsumed=!0,Uw(e,t,n,r,i))},t}(UI),$J=Du(),eY=`view`,tY=function(e){F(t,e);function t(t,n,r){var i=e.call(this)||this;i.type=eY,i.dimensions=[`x`,`y`];var a=Gw(i);a.invertY=t,a.lgCt=n,a.lgGeo=r;var o=a.trans=[];return o[0]=Ts(),o[1]=Ts(),o[2]=Ts(),a.mtRaw=Eo(),a.mtRawInv=Eo(),a.mtOverall=Eo(),a.mtOverallInv=Eo(),a.zoom=1,i}return t.prototype.getBoundingRect=function(){return Kw(null,this)},t.prototype.getViewRect=function(){return qw(null,this)},t.prototype.getRoamTransform=function(){return uI(Gw(this).trans[1])},t.prototype.dataToPoint=function(e,t,n){var r=t?Gw(this).mtRaw:Gw(this).mtOverall;return n||=[],r?qo(n,e,r):Fo(n,e)},t.prototype.pointToData=function(e,t,n){n||=[];var r=Gw(this).mtOverallInv;return r?qo(n,e,r):Fo(n,e)},t.prototype.convertToPixel=function(e,t,n){var r=sT(t);return r===this?r.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,t,n){var r=sT(t);return r===this?r.pointToData(n):null},t.prototype.containPoint=function(e){var t=Gw(this);return BF(nY,t.dataRect),HF(nY,nY,t.mtOverall),UF(nY,e[0],e[1])},t.dimensions=[`x`,`y`],t}(lI),nY=RF(),rY=Eo(),iY=Eo(),aY=RF(),oY=[],sY=Eo(),cY=Eo(),lY=[],uY=Ts(),dY=Ts(),fY=[],pY=new J(0,0,0,0),mY=Du(),hY=function(){function e(e,t){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=e||``,this.hostTree=t}return e.prototype.isRemoved=function(){return this.dataIndex<0},e.prototype.eachNode=function(e,t,n){B(e)&&(n=t,t=e,e=null),e||={},V(e)&&(e={order:e});var r=e.order||`preorder`,i=this[e.attr||`children`],a;r===`preorder`&&(a=t.call(n,this));for(var o=0;!a&&o<i.length;o++)i[o].eachNode(e,t,n);r===`postorder`&&t.call(n,this)},e.prototype.updateDepthAndHeight=function(e){var t=0;this.depth=e;for(var n=0;n<this.children.length;n++){var r=this.children[n];r.updateDepthAndHeight(e+1),r.height>t&&(t=r.height)}this.height=t+1},e.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,n=this.children,r=n.length;t<r;t++){var i=n[t].getNodeById(e);if(i)return i}},e.prototype.contains=function(e){if(e===this)return!0;for(var t=0,n=this.children,r=n.length;t<r;t++){var i=n[t].contains(e);if(i)return i}},e.prototype.getAncestors=function(e){for(var t=[],n=e?this:this.parentNode;n;)t.push(n),n=n.parentNode;return t.reverse(),t},e.prototype.getAncestorsIndices=function(){for(var e=[],t=this;t;)e.push(t.dataIndex),t=t.parentNode;return e.reverse(),e},e.prototype.getDescendantIndices=function(){var e=[];return this.eachNode(function(t){e.push(t.dataIndex)}),e},e.prototype.getValue=function(e){var t=this.hostTree.data;return t.getStore().get(t.getDimensionIndex(e||`value`),this.dataIndex)},e.prototype.setLayout=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(e)},e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},e.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},e.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t<e.length;++t)if(e[t]===this)return t;return-1}return-1},e.prototype.isAncestorOf=function(e){for(var t=e.parentNode;t;){if(t===this)return!0;t=t.parentNode}return!1},e.prototype.isDescendantOf=function(e){return e!==this&&e.isAncestorOf(this)},e}(),gY=function(){function e(e){this.type=`tree`,this._nodes=[],this.hostModel=e}return e.prototype.eachNode=function(e,t,n){this.root.eachNode(e,t,n)},e.prototype.getNodeByDataIndex=function(e){var t=this.data.getRawIndex(e);return this._nodes[t]},e.prototype.getNodeById=function(e){return this.root.getNodeById(e)},e.prototype.update=function(){for(var e=this.data,t=this._nodes,n=0,r=t.length;n<r;n++)t[n].dataIndex=-1;for(var n=0,r=e.count();n<r;n++)t[e.getRawIndex(n)].dataIndex=n},e.prototype.clearLayouts=function(){this.data.clearItemLayouts()},e.createTree=function(t,n,r){var i=new e(n),a=[],o=1;s(t);function s(e,t){var n=e.value;o=Math.max(o,z(n)?n.length:1),a.push(e);var r=new hY(xu(e.name,``),i);t?LT(r,t):i.root=r,i._nodes.push(r);var c=e.children;if(c)for(var l=0;l<c.length;l++)s(c[l],r)}i.root.updateDepthAndHeight(0);var c=Qp(a,{coordDimensions:[`value`],dimensionsCount:o}).dimensions,l=new FV(c,n);return l.initData(a),r&&r(l),OT({mainData:l,struct:i,structAttr:`tree`}),i.update(),i},e}(),_Y=[`treemapZoomToNode`,`treemapRender`,`treemapMove`],vY=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.preventUsingHoverLayer=!0,n}return t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};WT(n);var r=e.levels||[],i=new HB({itemStyle:this.designatedVisualItemStyle={}},this,t);r=e.levels=GT(r,t);var a=R(r||[],function(e){return new HB(e,i,t)},this),o=gY.createTree(n,this,s);function s(e){e.wrapMethod(`getItemModel`,function(e,t){var n=o.getNodeByDataIndex(t);return e.parentModel=(n?a[n.depth]:null)||i,e})}return o.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.getRawValue(e);return Yh(`nameValue`,{name:r.getName(e),value:i})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments);return n.treeAncestors=VT(this.getData().tree.getNodeByDataIndex(t),this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(e){this.layoutInfo=this.layoutInfo||{},I(this.layoutInfo,e)},t.prototype.mapIdToIndex=function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=W(),this._idIndexMapCount=0);var n=t.get(e);return n??t.set(e,n=this._idIndexMapCount++),n},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;(!e||e!==t&&!t.contains(e))&&(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){UT(this)},t.type=`series.treemap`,t.layoutMode=`box`,t.defaultOption={progressive:0,coordinateSystemUsage:`box`,left:X.size.l,top:X.size.xxxl,right:X.size.l,bottom:X.size.xxxl,sort:!0,clipWindow:`origin`,squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:`▶`,zoomToNodeRatio:.1024,scaleLimit:{max:5,min:.2},roam:!0,roamTrigger:`global`,nodeClick:`zoomToNode`,animation:!0,animationDurationUpdate:900,animationEasing:`quinticInOut`,breadcrumb:{show:!0,height:22,left:`center`,bottom:X.size.m,emptyItemWidth:25,itemStyle:{color:X.color.backgroundShade,textStyle:{color:X.color.secondary}},emphasis:{itemStyle:{color:X.color.background}}},label:{show:!0,distance:0,padding:5,position:`inside`,color:X.color.neutral00,overflow:`truncate`},upperLabel:{show:!1,position:[0,`50%`],height:20,overflow:`truncate`,verticalAlign:`middle`},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:X.color.neutral00,borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,`50%`],overflow:`truncate`,verticalAlign:`middle`}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:`index`,visibleMin:10,childrenVisibleMin:null,levels:[]},t}(UH),yY=8,bY=8,xY=5,SY=function(){function e(e){this.group=new Sz,e.add(this.group)}return e.prototype.render=function(e,t,n,r){var i=e.getModel(`breadcrumb`),a=this.group;if(a.removeAll(),i.get(`show`)&&n){var o=i.getModel(`itemStyle`),s=i.getModel(`emphasis`),c=o.getModel(`textStyle`),l=s.getModel([`itemStyle`,`textStyle`]),u=Sh(e,t).refContainer,d={left:i.get(`left`),right:i.get(`right`),top:i.get(`top`),bottom:i.get(`bottom`)},f={emptyItemWidth:i.get(`emptyItemWidth`),totalWidth:0,renderList:[]},p=xh(d,u);this._prepare(n,f,c),this._renderContent(e,f,p,o,s,c,l,r),Ch(a,d,u)}},e.prototype._prepare=function(e,t,n){for(var r=e;r;r=r.parentNode){var i=xu(r.getModel().get(`name`),``),a=n.getTextRect(i),o=Math.max(a.width+yY*2,t.emptyItemWidth);t.totalWidth+=o+bY,t.renderList.push({node:r,text:i,width:o})}},e.prototype._renderContent=function(e,t,n,r,i,a,o,s){for(var c=0,l=t.emptyItemWidth,u=e.get([`breadcrumb`,`height`]),d=t.totalWidth,f=t.renderList,p=i.getModel(`itemStyle`).getItemStyle(),m=f.length-1;m>=0;m--){var h=f[m],g=h.node,_=h.width,v=h.text;d>n.width&&(d-=_-l,_=l,v=null);var y=new Uz({shape:{points:KT(c,0,_,u,m===f.length-1,m===0)},style:Ma(r.getItemStyle(),{lineJoin:`bevel`}),textContent:new cR({style:op(a,{text:v})}),textConfig:{position:`inside`},z2:1e5,onclick:Ha(s,g)});y.disableLabelAnimation=!0,y.getTextContent().ensureState(`emphasis`).style=op(o,{text:v}),y.ensureState(`emphasis`).style=p,Fd(y,i.get(`focus`),i.get(`blurScope`),i.get(`disabled`)),this.group.add(y),qT(y,e,g),c+=_+bY}},e.prototype.remove=function(){this.group.removeAll()},e}(),CY=function(){function e(){this._storage=[],this._elExistsMap={}}return e.prototype.add=function(e,t,n,r,i){return!this._elExistsMap[e.id]&&(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:n,delay:r,easing:i}),!0)},e.prototype.finished=function(e){return this._finishedCallback=e,this},e.prototype.start=function(){for(var e=this,t=this._storage.length,n=function(){t--,t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},r=0,i=this._storage.length;r<i;r++){var a=this._storage[r];a.el.animateTo(a.target,{duration:a.duration,delay:a.delay,easing:a.easing,setToFinal:!0,done:n,aborted:n})}return this},e}(),wY=Math.max,TY=Math.min,EY=L,DY=[`itemStyle`,`borderWidth`],OY=[`itemStyle`,`gapWidth`],kY=[`upperLabel`,`show`],AY=[`upperLabel`,`height`],jY={seriesType:`treemap`,reset:function(e,t,n,r){var i=e.option,a=Sh(e,n).refContainer,o=xh(e.getBoxLayoutParams(),a),s=r&&r.type,c=RT(r,[`treemapZoomToNode`,`treemapRootToNode`],e),l=s===`treemapRender`||s===`treemapMove`?r.rootRect:null,u=e.getViewRoot(),d=zT(u);if(s!==`treemapMove`){var f=!1,p=s===`treemapZoomToNode`?(f=!0,nE(e,c,u,o)):l?(f=!0,I({},l)):I({},o);if(f){var m=oE(o,p);m=sE(m,e),p.width=o.width*m,p.height=o.height*m}var h=i.sort;h&&h!==`asc`&&h!==`desc`&&(h=`desc`);var g={squareRatio:i.squareRatio,sort:h,leafDepth:i.leafDepth};u.hostTree.clearLayouts();var _={x:0,y:0,width:p.width,height:p.height,area:p.width*p.height};u.setLayout(_),YT(u,g,!1,0),_=u.getLayout(),EY(d,function(e,t){var n=(d[t+1]||u).getValue();e.setLayout(I({dataExtent:[n,n],borderWidth:0,upperHeight:0},_))})}var v=e.getData().tree.root;v.setLayout(rE(o,l,c),!0),e.setLayoutInfo(o),iE(v,new J(-o.x,-o.y,n.getWidth(),n.getHeight()),d,u,0)}},MY=Sz,NY=rR,PY=3,FY=`label`,IY=`upperLabel`,LY=100,RY=20,zY=30,BY=xo([[`fill`,`color`],[`stroke`,`strokeColor`],[`lineWidth`,`strokeWidth`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`shadowColor`]]),VY=function(e){var t=BY(e);return t.stroke=t.fill=t.lineWidth=null,t},HY=Du(),UY=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._state=`ready`,n._storage=cE(),n}return t.prototype.render=function(e,t,n,r){if(!(Na(t.findComponents({mainType:`series`,subType:`treemap`,query:r}),e)<0)){this.seriesModel=e,this.api=n,this.ecModel=t;var i=RT(r,[`treemapZoomToNode`,`treemapRootToNode`],e),a=r&&r.type,o=e.layoutInfo,s=!this._oldTree,c=this._storage,l=a===`treemapRootToNode`&&i&&c?{rootNodeGroup:c.nodeGroup[i.node.getRawIndex()],direction:r.direction}:null,u=this._giveContainerGroup(o),d=e.get(`animation`),f=this._doRender(u,e,l);d&&!s&&(!a||a===`treemapZoomToNode`||a===`treemapRootToNode`)?this._doAnimation(u,f,e,l):f.renderFinally(),this._resetController(n),this._renderBreadcrumb(e,n,i)}},t.prototype._giveContainerGroup=function(e){var t=this._containerGroup;return t||(t=this._containerGroup=new MY,this._initEvents(t),this.group.add(t)),t.x=e.x,t.y=e.y,t},t.prototype._doRender=function(e,t,n){var r=t.getData().tree,i=this._oldTree,a=cE(),o=cE(),s=this._storage,c=[];function l(e,r,i,l){return lE(t,o,s,n,a,c,e,r,i,l)}d(r.root?[r.root]:[],i&&i.root?[i.root]:[],e,r===i||!i,0);var u=f(s);return this._oldTree=r,this._storage=o,{lastsForAnimation:a,willDeleteEls:u,renderFinally:p};function d(e,t,n,r,i){r?(t=e,L(e,function(e,t){!e.isRemoved()&&o(t,t)})):new UB(t,e,a,a).add(o).update(o).remove(Ha(o,null)).execute();function a(e){return e.getId()}function o(a,o){var s=a==null?null:e[a],c=o==null?null:t[o],u=l(s,c,n,i);u&&d(s&&s.viewChildren||[],c&&c.viewChildren||[],u,r,i+1)}}function f(e){var t=cE();return e&&L(e,function(e,n){var r=t[n];L(e,function(e){e&&(r.push(e),HY(e).willDelete=!0)})}),t}function p(){L(u,function(e){L(e,function(e){e.parent&&e.parent.remove(e)})}),L(c,function(e){e.invisible=!0,e.dirty()})}},t.prototype._doAnimation=function(e,t,n,r){var i=n.get(`animationDurationUpdate`),a=n.get(`animationEasing`),o=(B(i)?0:i)||0,s=(B(a)?null:a)||`cubicOut`,c=JT();L(t.willDeleteEls,function(e,t){L(e,function(e,n){if(!e.invisible){var i=e.parent,a,l=HY(i);if(r&&r.direction===`drillDown`)a=i===r.rootNodeGroup?{shape:{x:0,y:0,width:l.nodeWidth,height:l.nodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var u=0,d=0;l.willDelete||(u=l.nodeWidth/2,d=l.nodeHeight/2),a=t===`nodeGroup`?{x:u,y:d,style:{opacity:0}}:{shape:{x:u,y:d,width:0,height:0},style:{opacity:0}}}a&&c.add(e,a,o,0,s)}})}),L(this._storage,function(e,n){L(e,function(e,r){var i=t.lastsForAnimation[n][r],a={};i&&(e instanceof Sz?i.oldX!=null&&(a.x=e.x,a.y=e.y,e.x=i.oldX,e.y=i.oldY):(i.oldShape&&(a.shape=I({},e.shape),e.setShape(i.oldShape)),i.fadein?(e.setStyle(`opacity`,0),a.style={opacity:1}):e.style.opacity!==1&&(a.style={opacity:1})),c.add(e,a,o,0,s))})},this),this._state=`animating`,c.finished(q(function(){this._state=`ready`,t.renderFinally()},this)).start()},t.prototype._resetController=function(e){var t=this,n=this.seriesModel,r=this._controller;r||(r=this._controller=new QJ(e.getZr()),r.on(`pan`,q(this._onPan,this)),r.on(`zoom`,q(this._onZoom,this))),r.enable(n.get(`roam`),{api:e,zInfo:{component:n},triggerInfo:{roamTrigger:n.get(`roamTrigger`),isInSelf:function(e,n,r){var i=t._containerGroup;return i?i.getBoundingRect().contain(n-i.x,r-i.y):!1}}})},t.prototype._clearController=function(){var e=this._controller;e&&=(e.dispose(),null)},t.prototype._onPan=function(e){if(this._state!==`animating`&&(Math.abs(e.dx)>PY||Math.abs(e.dy)>PY)){var t=this.seriesModel.getData().tree.root;if(!t)return;var n=t.getLayout();if(!n)return;this.api.dispatchAction({type:`treemapMove`,from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+e.dx,y:n.y+e.dy,width:n.width,height:n.height}})}},t.prototype._onZoom=function(e){var t=e.originX,n=e.originY,r=e.scale,i=this.seriesModel;if(this._state!==`animating`){var a=i.getData().tree.root;if(!a)return;var o=a.getLayout();if(!o)return;var s=new J(o.x,o.y,o.width,o.height),c=i.layoutInfo,l=oE(c,o),u=l*r;u=sE(u,i);var d=u/l;t-=c.x,n-=c.y;var f=Eo();Ao(f,f,[-t,-n]),Mo(f,f,[d,d]),Ao(f,f,[t,n]),s.applyTransform(f),this.api.dispatchAction({type:`treemapRender`,from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:s.x,y:s.y,width:s.width,height:s.height}})}},t.prototype._initEvents=function(e){var t=this;e.on(`click`,function(e){if(t._state===`ready`){var n=t.seriesModel.get(`nodeClick`,!0);if(n){var r=t.findTarget(e.offsetX,e.offsetY);if(r){var i=r.node;if(i.getLayout().isLeafRoot)t._rootToNode(r);else if(n===`zoomToNode`)t._zoomToNode(r);else if(n===`link`){var a=i.hostTree.data.getItemModel(i.dataIndex),o=a.get(`link`,!0),s=a.get(`target`,!0)||`blank`;o&&gh(o,s)}}}}},this)},t.prototype._renderBreadcrumb=function(e,t,n){var r=this;n||(n=e.get(`leafDepth`,!0)==null?this.findTarget(t.getWidth()/2,t.getHeight()/2):{node:e.getViewRoot()},n||={node:e.getData().tree.root}),(this._breadcrumb||=new SY(this.group)).render(e,t,n.node,function(t){r._state!==`animating`&&(BT(e.getViewRoot(),t)?r._rootToNode({node:t}):r._zoomToNode({node:t}))})},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=cE(),this._state=`ready`,this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(e){this.api.dispatchAction({type:`treemapZoomToNode`,from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype._rootToNode=function(e){this.api.dispatchAction({type:`treemapRootToNode`,from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype.findTarget=function(e,t){var n;return this.seriesModel.getViewRoot().eachNode({attr:`viewChildren`,order:`preorder`},function(r){var i=this._storage.background[r.getRawIndex()];if(i){var a=i.transformCoordToLocal(e,t),o=i.shape;if(o.x<=a[0]&&a[0]<=o.x+o.width&&o.y<=a[1]&&a[1]<=o.y+o.height)n={node:r,offsetX:a[0],offsetY:a[1]};else return!1}},this),n},t.type=`treemap`,t}(cU),WY=L,GY=H,KY=-1,qY=function(){function e(t){var n=t.mappingMethod,r=t.type,i=this.option=ka(t);this.type=r,this.mappingMethod=n,this._normalizeData=JY[n];var a=e.visualHandlers[r];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[n],n===`piecewise`?(pE(i),dE(i)):n===`category`?i.categories?fE(i):pE(i,!0):(to(n!==`linear`||i.dataExtent),pE(i))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return q(this._normalizeData,this)},e.listVisualTypes=function(){return Ba(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){H(e)?L(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,r){var i,a=z(t)?[]:H(t)?{}:(i=!0,null);return e.eachVisual(t,function(e,t){var o=n.call(r,e,t);i?a=o:a[t]=o}),a},e.retrieveVisuals=function(t){var n={},r;return t&&WY(e.visualHandlers,function(e,i){t.hasOwnProperty(i)&&(n[i]=t[i],r=!0)}),r?n:null},e.prepareVisualTypes=function(e){if(z(e))e=e.slice();else if(GY(e)){var t=[];WY(e,function(e,n){t.push(n)}),e=t}else return[];return e.sort(function(e,t){return t===`color`&&e!==`color`&&e.indexOf(`color`)===0?1:-1}),e},e.dependsOn=function(e,t){return t===`color`?!!(e&&e.indexOf(t)===0):e===t},e.findPieceIndex=function(e,t,n){for(var r,i=1/0,a=0,o=t.length;a<o;a++){var s=t[a].value;if(s!=null){if(s===e||V(s)&&s===e+``)return a;n&&d(s,a)}}for(var a=0,o=t.length;a<o;a++){var c=t[a],l=c.interval,u=c.close;if(l){if(l[0]===-1/0){if(SE(u[1],e,l[1]))return a}else if(l[1]===1/0){if(SE(u[0],l[0],e))return a}else if(SE(u[0],l[0],e)&&SE(u[1],e,l[1]))return a;n&&d(l[0],a),n&&d(l[1],a)}}if(n)return e===1/0?t.length-1:e===-1/0?0:r;function d(t,n){var a=Math.abs(t-e);a<i&&(i=a,r=n)}},e.visualHandlers={color:{applyVisual:gE(`color`),getColorMapper:function(){var e=this.option;return q(e.mappingMethod===`category`?function(e,t){return!t&&(e=this._normalizeData(e)),_E.call(this,e)}:function(t,n,r){var i=!!r;return!n&&(t=this._normalizeData(t)),r=ic(t,e.parsedVisual,r),i?r:cc(r,`rgba`)},this)},_normalizedToVisual:{linear:function(e){return cc(ic(e,this.option.parsedVisual),`rgba`)},category:_E,piecewise:function(e,t){var n=bE.call(this,t);return n??=cc(ic(e,this.option.parsedVisual),`rgba`),n},fixed:vE}},colorHue:mE(function(e,t){return oc(e,t)}),colorSaturation:mE(function(e,t){return oc(e,null,t)}),colorLightness:mE(function(e,t){return oc(e,null,null,t)}),colorAlpha:mE(function(e,t){return sc(e,t)}),decal:{applyVisual:gE(`decal`),_normalizedToVisual:{linear:null,category:_E,piecewise:null,fixed:null}},opacity:{applyVisual:gE(`opacity`),_normalizedToVisual:yE([0,1])},liftZ:{applyVisual:gE(`liftZ`),_normalizedToVisual:{linear:vE,category:vE,piecewise:vE,fixed:vE}},symbol:{applyVisual:function(e,t,n){n(`symbol`,this.mapValueToVisual(e))},_normalizedToVisual:{linear:hE,category:_E,piecewise:function(e,t){var n=bE.call(this,t);return n??=hE.call(this,e),n},fixed:vE}},symbolSize:{applyVisual:gE(`symbolSize`),_normalizedToVisual:yE([0,1])}},e}(),JY={linear:function(e){return Nl(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=qY.findPieceIndex(e,t,!0);if(n!=null)return Nl(n,[0,t.length-1],[0,1],!0)},category:function(e){return(this.option.categories?this.option.categoryMap[e]:e)??KY},fixed:co},YY=`itemStyle`,XY=Du(),ZY={seriesType:`treemap`,reset:function(e){var t=e.getData().tree.root;t.isRemoved()||CE(t,{},e.getViewRoot().getAncestors(),e)}},QY=function(){function e(e){this.type=`graph`,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return e.prototype.isDirected=function(){return this._directed},e.prototype.addNode=function(e,t){e=e==null?``+t:``+e;var n=this._nodesMap;if(!n[ME(e)]){var r=new $Y(e,t);return r.hostGraph=this,this.nodes.push(r),n[ME(e)]=r,r}},e.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},e.prototype.getNodeById=function(e){return this._nodesMap[ME(e)]},e.prototype.addEdge=function(e,t,n){var r=this._nodesMap,i=this._edgesMap;if(Wa(e)&&(e=this.nodes[e]),Wa(t)&&(t=this.nodes[t]),e instanceof $Y||(e=r[ME(e)]),t instanceof $Y||(t=r[ME(t)]),e&&t){var a=e.id+`-`+t.id,o=new eX(e,t,n);return o.hostGraph=this,this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),i[a]=o,o}},e.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},e.prototype.getEdge=function(e,t){e instanceof $Y&&(e=e.id),t instanceof $Y&&(t=t.id);var n=this._edgesMap;return this._directed?n[e+`-`+t]:n[e+`-`+t]||n[t+`-`+e]},e.prototype.eachNode=function(e,t){for(var n=this.nodes,r=n.length,i=0;i<r;i++)n[i].dataIndex>=0&&e.call(t,n[i],i)},e.prototype.eachEdge=function(e,t){for(var n=this.edges,r=n.length,i=0;i<r;i++)n[i].dataIndex>=0&&n[i].node1.dataIndex>=0&&n[i].node2.dataIndex>=0&&e.call(t,n[i],i)},e.prototype.breadthFirstTraverse=function(e,t,n,r){if(t instanceof $Y||(t=this._nodesMap[ME(t)]),t){for(var i=n===`out`?`outEdges`:n===`in`?`inEdges`:`edges`,a=0;a<this.nodes.length;a++)this.nodes[a].__visited=!1;if(!e.call(r,t,null))for(var o=[t];o.length;)for(var s=o.shift(),c=s[i],a=0;a<c.length;a++){var l=c[a],u=l.node1===s?l.node2:l.node1;if(!u.__visited){if(e.call(r,u,s))return;o.push(u),u.__visited=!0}}}},e.prototype.update=function(){for(var e=this.data,t=this.edgeData,n=this.nodes,r=this.edges,i=0,a=n.length;i<a;i++)n[i].dataIndex=-1;for(var i=0,a=e.count();i<a;i++)n[e.getRawIndex(i)].dataIndex=i;t.filterSelf(function(e){var n=r[t.getRawIndex(e)];return n.node1.dataIndex>=0&&n.node2.dataIndex>=0});for(var i=0,a=r.length;i<a;i++)r[i].dataIndex=-1;for(var i=0,a=t.count();i<a;i++)r[t.getRawIndex(i)].dataIndex=i},e.prototype.clone=function(){for(var t=new e(this._directed),n=this.nodes,r=this.edges,i=0;i<n.length;i++)t.addNode(n[i].id,n[i].dataIndex);for(var i=0;i<r.length;i++){var a=r[i];t.addEdge(a.node1.id,a.node2.id,a.dataIndex)}return t},e}(),$Y=function(){function e(e,t){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=e??``,this.dataIndex=t??-1}return e.prototype.degree=function(){return this.edges.length},e.prototype.inDegree=function(){return this.inEdges.length},e.prototype.outDegree=function(){return this.outEdges.length},e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(e)},e.prototype.getAdjacentDataIndices=function(){for(var e={edge:[],node:[]},t=0;t<this.edges.length;t++){var n=this.edges[t];n.dataIndex<0||(e.edge.push(n.dataIndex),e.node.push(n.node1.dataIndex,n.node2.dataIndex))}return e},e.prototype.getTrajectoryDataIndices=function(){for(var e=W(),t=W(),n=0,r=this.edges.length;n<r;n++){var i=this.edges[n];if(!(i.dataIndex<0)){e.set(i.dataIndex,!0);for(var a=[i.node1],o=[i.node2],s=0;s<a.length;){var c=a[s];s++,t.set(c.dataIndex,!0);for(var l=c.inEdges,u=0,d=l.length,f=void 0,p=void 0;u<d;u++)f=l[u],p=f.dataIndex,p>=0&&!e.hasKey(p)&&(e.set(p,!0),a.push(f.node1))}for(s=0;s<o.length;){var m=o[s];s++,t.set(m.dataIndex,!0);for(var h=m.outEdges,u=0,g=h.length,_=void 0,v=void 0;u<g;u++)_=h[u],v=_.dataIndex,v>=0&&!e.hasKey(v)&&(e.set(v,!0),o.push(_.node2))}}}return{edge:e.keys(),node:t.keys()}},e}(),eX=function(){function e(e,t,n){this.dataIndex=-1,this.node1=e,this.node2=t,this.dataIndex=n??-1}return e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)},e.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},e.prototype.getTrajectoryDataIndices=function(){var e=W(),t=W();e.set(this.dataIndex,!0);for(var n=[this.node1],r=[this.node2],i=0;i<n.length;){var a=n[i];i++,t.set(a.dataIndex,!0);for(var o=a.inEdges,s=0,c=o.length,l=void 0,u=void 0;s<c;s++)l=a.inEdges[s],u=l.dataIndex,u>=0&&!e.hasKey(u)&&(e.set(u,!0),n.push(l.node1))}for(i=0;i<r.length;){var d=r[i];i++,t.set(d.dataIndex,!0);for(var f=d.outEdges,s=0,c=f.length,p=void 0,m=void 0;s<c;s++)p=d.outEdges[s],m=p.dataIndex,m>=0&&!e.hasKey(m)&&(e.set(m,!0),r.push(p.node2))}return{edge:e.keys(),node:t.keys()}},e}(),Fa($Y,NE(`hostGraph`,`data`)),Fa(eX,NE(`hostGraph`,`edgeData`)),tX=Jz.prototype,nX=Zz.prototype,rX=function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return e}(),(function(e){F(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t})(rX),iX=function(e){F(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-line`,n}return t.prototype.getDefaultStyle=function(){return{stroke:X.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new rX},t.prototype.buildPath=function(e,t){FE(t)?tX.buildPath.call(this,e,t):nX.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return FE(this.shape)?tX.pointAt.call(this,e):nX.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,n=FE(t)?[t.x2-t.x1,t.y2-t.y1]:nX.tangentAt.call(this,e);return Uo(n,n)},t}(JL),aX=[`fromSymbol`,`toSymbol`],oX=function(e){F(t,e);function t(t,n,r){var i=e.call(this)||this;return i._createLine(t,n,r),i}return t.prototype._createLine=function(e,t,n){var r=e.hostModel,i=e.getItemLayout(t),a=e.getItemVisual(t,`z2`),o=zE(i);o.shape.percent=0,ff(o,{z2:U(a,0),shape:{percent:1}},r,t),this.add(o),L(aX,function(n){var r=RE(n,e,t);this.add(r),this[IE(n)]=LE(n,e,t)},this),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var r=e.hostModel,i=this.childOfName(`line`),a=e.getItemLayout(t),o={shape:{}};BE(o.shape,a),df(i,o,r,t),L(aX,function(n){var r=LE(n,e,t),i=IE(n);if(this[i]!==r){this.remove(this.childOfName(n));var a=RE(n,e,t);this.add(a)}this[i]=r},this),this._updateCommonStl(e,t,n)},t.prototype.getLinePath=function(){return this.childAt(0)},t.prototype._updateCommonStl=function(e,t,n){var r=e.hostModel,i=this.childOfName(`line`),a=n&&n.emphasisLineStyle,o=n&&n.blurLineStyle,s=n&&n.selectLineStyle,c=n&&n.labelStatesModels,l=n&&n.emphasisDisabled,u=n&&n.focus,d=n&&n.blurScope;if(!n||e.hasItemOption){var f=e.getItemModel(t),p=f.getModel(`emphasis`);a=p.getModel(`lineStyle`).getLineStyle(),o=f.getModel([`blur`,`lineStyle`]).getLineStyle(),s=f.getModel([`select`,`lineStyle`]).getLineStyle(),l=p.get(`disabled`),u=p.get(`focus`),d=p.get(`blurScope`),c=ap(f)}var m=e.getItemVisual(t,`style`),h=m.stroke;i.useStyle(m),i.style.fill=null,i.style.strokeNoScale=!0,i.ensureState(`emphasis`).style=a,i.ensureState(`blur`).style=o,i.ensureState(`select`).style=s,L(aX,function(e){var t=this.childOfName(e);if(t){t.setColor(h),t.style.opacity=m.opacity;for(var n=0;n<tz.length;n++){var r=tz[n],a=i.getState(r);if(a){var o=a.style||{},s=t.ensureState(r),c=s.style||={};o.stroke!=null&&(c[t.__isEmptyBrush?`stroke`:`fill`]=o.stroke),o.opacity!=null&&(c.opacity=o.opacity)}}t.markRedraw()}},this);var g=r.getRawValue(t);ip(this,c,{labelDataIndex:t,labelFetcher:{getFormattedLabel:function(t,n){return r.getFormattedLabel(t,n,e.dataType)}},inheritColor:h||X.color.neutral99,defaultOpacity:m.opacity,defaultText:(g==null?e.getName(t):isFinite(g)?Rl(g,10):g)+``});var _=this.getTextContent();if(_){var v=c.normal;_.__align=_.style.align,_.__verticalAlign=_.style.verticalAlign,_.__position=v.get(`position`)||`middle`;var y=v.get(`distance`);z(y)||(y=[y,y]),_.__labelDistance=y}this.setTextConfig({position:null,local:!0,inside:!1}),Fd(this,u,d,l)},t.prototype.highlight=function(){bd(this)},t.prototype.downplay=function(){xd(this)},t.prototype.updateLayout=function(e,t){this.childOfName(`line`).stopAnimation(),this.setLinePoints(e.getItemLayout(t))},t.prototype.setLinePoints=function(e){var t=this.childOfName(`line`);BE(t.shape,e),t.dirty()},t.prototype.beforeUpdate=function(){var e=this,t=e.childOfName(`fromSymbol`),n=e.childOfName(`toSymbol`),r=e.getTextContent();if(!t&&!n&&(!r||r.ignore))return;for(var i=1,a=this.parent;a;)a.scaleX&&(i/=a.scaleX),a=a.parent;var o=e.childOfName(`line`);if(!this.__dirty&&!o.__dirty)return;var s=o.shape.percent,c=o.pointAt(0),l=o.pointAt(s),u=zo([],l,c);Uo(u,u);function d(e,t){var n=e.__specifiedRotation;if(n==null){var r=o.tangentAt(t);e.attr(`rotation`,(t===1?-1:1)*Math.PI/2-Math.atan2(r[1],r[0]))}else e.attr(`rotation`,n)}if(t&&(t.setPosition(c),d(t,0),t.scaleX=t.scaleY=i*s,t.markRedraw()),n&&(n.setPosition(l),d(n,1),n.scaleX=n.scaleY=i*s,n.markRedraw()),r&&!r.ignore){r.x=r.y=0,r.originX=r.originY=0;var f=void 0,p=void 0,m=r.__labelDistance,h=m[0]*i,g=m[1]*i,_=s/2,v=o.tangentAt(_),y=[v[1],-v[0]],b=o.pointAt(_);y[1]>0&&(y[0]=-y[0],y[1]=-y[1]);var x=v[0]<0?-1:1;if(r.__position!==`start`&&r.__position!==`end`){var S=-Math.atan2(v[1],v[0]);l[0]<c[0]&&(S=Math.PI+S),r.rotation=S}var C=void 0;switch(r.__position){case`insideStartTop`:case`insideMiddleTop`:case`insideEndTop`:case`middle`:C=-g,p=`bottom`;break;case`insideStartBottom`:case`insideMiddleBottom`:case`insideEndBottom`:C=g,p=`top`;break;default:C=0,p=`middle`}switch(r.__position){case`end`:r.x=u[0]*h+l[0],r.y=u[1]*g+l[1],f=u[0]>.8?`left`:u[0]<-.8?`right`:`center`,p=u[1]>.8?`top`:u[1]<-.8?`bottom`:`middle`;break;case`start`:r.x=-u[0]*h+c[0],r.y=-u[1]*g+c[1],f=u[0]>.8?`right`:u[0]<-.8?`left`:`center`,p=u[1]>.8?`bottom`:u[1]<-.8?`top`:`middle`;break;case`insideStartTop`:case`insideStart`:case`insideStartBottom`:r.x=h*x+c[0],r.y=c[1]+C,f=v[0]<0?`right`:`left`,r.originX=-h*x,r.originY=-C;break;case`insideMiddleTop`:case`insideMiddle`:case`insideMiddleBottom`:case`middle`:r.x=b[0],r.y=b[1]+C,f=`center`,r.originY=-C;break;case`insideEndTop`:case`insideEnd`:case`insideEndBottom`:r.x=-h*x+l[0],r.y=l[1]+C,f=v[0]>=0?`right`:`left`,r.originX=h*x,r.originY=-C}r.scaleX=r.scaleY=i,r.setStyle({verticalAlign:r.__verticalAlign||p,align:r.__align||f})}},t}(Sz),sX=function(){function e(e){this.group=new Sz,this._LineCtor=e||oX}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this,r=n.group,i=n._lineData;n._lineData=e,i||r.removeAll();var a=HE(e);e.diff(i).add(function(n){t._doAdd(e,n,a)}).update(function(n,r){t._doUpdate(i,e,r,n,a)}).remove(function(e){r.remove(i.getItemGraphicEl(e))}).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,n){t.updateLayout(e,n)},this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=HE(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){this._progressiveEls=[];function r(e){!e.isGroup&&!VE(e)&&(e.incremental=n,e.ensureState(`emphasis`).hoverLayer=2)}for(var i=e.start;i<e.end;i++)if(WE(t.getItemLayout(i))){var a=new this._LineCtor(t,i,this._seriesScope);a.traverse(r),this.group.add(a),t.setItemGraphicEl(i,a),this._progressiveEls.push(a)}},e.prototype.remove=function(){this.group.removeAll()},e.prototype.eachRendered=function(e){Gf(this._progressiveEls||this.group,e)},e.prototype._doAdd=function(e,t,n){if(WE(e.getItemLayout(t))){var r=new this._LineCtor(e,t,n);e.setItemGraphicEl(t,r),this.group.add(r)}},e.prototype._doUpdate=function(e,t,n,r,i){var a=e.getItemGraphicEl(n);WE(t.getItemLayout(r))?(a?a.updateData(t,r,i):a=new this._LineCtor(t,r,i),t.setItemGraphicEl(r,a),this.group.add(a)):this.group.remove(a)},e}(),cX=function(){function e(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return e}(),lX=function(e){F(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`pointer`,n}return t.prototype.getDefaultShape=function(){return new cX},t.prototype.buildPath=function(e,t){var n=Math.cos,r=Math.sin,i=t.r,a=t.width,o=t.angle,s=t.x-n(o)*a*(a>=i/3?1:2),c=t.y-r(o)*a*(a>=i/3?1:2);o=t.angle-Math.PI/2,e.moveTo(s,c),e.lineTo(t.x+n(o)*a,t.y+r(o)*a),e.lineTo(t.x+n(t.angle)*i,t.y+r(t.angle)*i),e.lineTo(t.x-n(o)*a,t.y-r(o)*a),e.lineTo(s,c)},t}(JL),uX=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){this.group.removeAll();var r=e.get([`axisLine`,`lineStyle`,`color`]),i=GE(e,n);this._renderMain(e,t,n,r,i),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,t,n,r,i){var a=this.group,o=e.get(`clockwise`),s=-e.get(`startAngle`)/180*Math.PI,c=-e.get(`endAngle`)/180*Math.PI,l=e.getModel(`axisLine`),u=l.get(`roundCap`)?RW:zz,d=l.get(`show`),f=l.getModel(`lineStyle`),p=f.get(`width`),m=[s,c];nl(m,!o),s=m[0],c=m[1];for(var h=c-s,g=s,_=[],v=0;d&&v<r.length;v++){var y=Math.min(Math.max(r[v][0],0),1);c=s+h*y;var b=new u({shape:{startAngle:g,endAngle:c,cx:i.cx,cy:i.cy,clockwise:o,r0:i.r-p,r:i.r},silent:!0});b.setStyle({fill:r[v][1]}),b.setStyle(f.getLineStyle([`color`,`width`])),_.push(b),g=c}_.reverse(),L(_,function(e){return a.add(e)});var x=function(e){if(e<=0)return r[0][1];for(var t=0;t<r.length;t++)if(r[t][0]>=e&&(t===0?0:r[t-1][0])<e)return r[t][1];return r[t-1][1]};this._renderTicks(e,t,n,x,i,s,c,o,p),this._renderTitleAndDetail(e,t,n,x,i),this._renderAnchor(e,i),this._renderPointer(e,t,n,x,i,s,c,o,p)},t.prototype._renderTicks=function(e,t,n,r,i,a,o,s,c){for(var l=this.group,u=i.cx,d=i.cy,f=i.r,p=+e.get(`min`),m=+e.get(`max`),h=e.getModel(`splitLine`),g=e.getModel(`axisTick`),_=e.getModel(`axisLabel`),v=e.get(`splitNumber`),y=g.get(`splitNumber`),b=Y(h.get(`length`),f),x=Y(g.get(`length`),f),S=a,C=(o-a)/v,w=C/y,T=h.getModel(`lineStyle`).getLineStyle(),E=g.getModel(`lineStyle`).getLineStyle(),D=h.get(`distance`),O,k,A=0;A<=v;A++){if(O=Math.cos(S),k=Math.sin(S),h.get(`show`)){var j=D?D+c:c,M=new Jz({shape:{x1:O*(f-j)+u,y1:k*(f-j)+d,x2:O*(f-b-j)+u,y2:k*(f-b-j)+d},style:T,silent:!0});T.stroke===`auto`&&M.setStyle({stroke:r(A/v)}),l.add(M)}if(_.get(`show`)){var j=_.get(`distance`)+D,ee=KE(Rl(A*(m-p)/v+p,14),_.get(`formatter`)),te=r(A/v),ne=O*(f-b-j)+u,re=k*(f-b-j)+d,ie=_.get(`rotate`),ae=0;ie===`radial`?(ae=-S+2*Math.PI,ae>Math.PI/2&&(ae+=Math.PI)):ie===`tangential`?ae=-S-Math.PI/2:Wa(ie)&&(ae=ie*Math.PI/180),ae===0?l.add(new cR({style:op(_,{text:ee,x:ne,y:re,verticalAlign:k<-.8?`top`:k>.8?`bottom`:`middle`,align:O<-.4?`left`:O>.4?`right`:`center`},{inheritColor:te}),silent:!0})):l.add(new cR({style:op(_,{text:ee,x:ne,y:re,verticalAlign:`middle`,align:`center`},{inheritColor:te}),silent:!0,originX:ne,originY:re,rotation:ae}))}if(g.get(`show`)&&A!==v){var j=g.get(`distance`);j=j?j+c:c;for(var oe=0;oe<=y;oe++){O=Math.cos(S),k=Math.sin(S);var se=new Jz({shape:{x1:O*(f-j)+u,y1:k*(f-j)+d,x2:O*(f-x-j)+u,y2:k*(f-x-j)+d},silent:!0,style:E});E.stroke===`auto`&&se.setStyle({stroke:r((A+oe/y)/v)}),l.add(se),S+=w}S-=w}else S+=C}},t.prototype._renderPointer=function(e,t,n,r,i,a,o,s,c){var l=this.group,u=this._data,d=this._progressEls,f=[],p=e.get([`pointer`,`show`]),m=e.getModel(`progress`),h=m.get(`show`),g=e.getData(),_=g.mapDimension(`value`),v=+e.get(`min`),y=+e.get(`max`),b=[v,y],x=[a,o];function S(t,n){var r=g.getItemModel(t).getModel(`pointer`),a=Y(r.get(`width`),i.r),o=Y(r.get(`length`),i.r),s=e.get([`pointer`,`icon`]),c=r.get(`offsetCenter`),l=Y(c[0],i.r),u=Y(c[1],i.r),d=r.get(`keepAspect`),f=s?xg(s,l-a/2,u-o,a,o,null,d):new lX({shape:{angle:-Math.PI/2,width:a,r:o,x:l,y:u}});return f.rotation=-(n+Math.PI/2),f.x=i.cx,f.y=i.cy,f}function C(e,t){var n=m.get(`roundCap`)?RW:zz,r=m.get(`overlap`),o=r?m.get(`width`):c/g.count(),l=r?i.r-o:i.r-(e+1)*o,u=r?i.r:i.r-e*o,d=new n({shape:{startAngle:a,endAngle:t,cx:i.cx,cy:i.cy,clockwise:s,r0:l,r:u}});return r&&(d.z2=Nl(g.get(_,e),[v,y],[100,0],!0)),d}(h||p)&&(g.diff(u).add(function(t){var n=g.get(_,t);if(p){var r=S(t,a);ff(r,{rotation:-((isNaN(+n)?x[0]:Nl(n,b,x,!0))+Math.PI/2)},e),l.add(r),g.setItemGraphicEl(t,r)}if(h){var i=C(t,a);ff(i,{shape:{endAngle:Nl(n,b,x,m.get(`clip`))}},e),l.add(i),RR(e.seriesIndex,g.dataType,t,i),f[t]=i}}).update(function(t,n){var r=g.get(_,t);if(p){var i=u.getItemGraphicEl(n),o=i?i.rotation:a,s=S(t,o);s.rotation=o,df(s,{rotation:-((isNaN(+r)?x[0]:Nl(r,b,x,!0))+Math.PI/2)},e),l.add(s),g.setItemGraphicEl(t,s)}if(h){var c=d[n],v=C(t,c?c.shape.endAngle:a);df(v,{shape:{endAngle:Nl(r,b,x,m.get(`clip`))}},e),l.add(v),RR(e.seriesIndex,g.dataType,t,v),f[t]=v}}).execute(),g.each(function(e){var t=g.getItemModel(e),n=t.getModel(`emphasis`),i=n.get(`focus`),a=n.get(`blurScope`),o=n.get(`disabled`),s=r(Nl(g.get(_,e),b,[0,1],!0));if(p){var c=g.getItemGraphicEl(e),l=g.getItemVisual(e,`style`),u=l.fill;if(c instanceof $L){var d=c.style;c.useStyle(I({image:d.image,x:d.x,y:d.y,width:d.width,height:d.height},l))}else c.useStyle(l),c.type!==`pointer`&&c.setColor(u);c.setStyle(t.getModel([`pointer`,`itemStyle`]).getItemStyle()),c.style.fill===`auto`&&c.setStyle(`fill`,s),c.z2EmphasisLift=0,Ld(c,t),Fd(c,i,a,o)}if(h){var m=f[e];m.useStyle(g.getItemVisual(e,`style`)),m.setStyle(t.getModel([`progress`,`itemStyle`]).getItemStyle()),m.style.fill===`auto`&&m.setStyle(`fill`,s),m.z2EmphasisLift=0,Ld(m,t),Fd(m,i,a,o)}}),this._progressEls=f)},t.prototype._renderAnchor=function(e,t){var n=e.getModel(`anchor`);if(n.get(`show`)){var r=n.get(`size`),i=n.get(`icon`),a=n.get(`offsetCenter`),o=n.get(`keepAspect`),s=xg(i,t.cx-r/2+Y(a[0],t.r),t.cy-r/2+Y(a[1],t.r),r,r,null,o);s.z2=+!!n.get(`showAbove`),s.setStyle(n.getModel(`itemStyle`).getItemStyle()),this.group.add(s)}},t.prototype._renderTitleAndDetail=function(e,t,n,r,i){var a=this,o=e.getData(),s=o.mapDimension(`value`),c=+e.get(`min`),l=+e.get(`max`),u=new Sz,d=[],f=[],p=e.isAnimationEnabled(),m=e.get([`pointer`,`showAbove`]);o.diff(this._data).add(function(e){d[e]=new cR({silent:!0}),f[e]=new cR({silent:!0})}).update(function(e,t){d[e]=a._titleEls[t],f[e]=a._detailEls[t]}).execute(),o.each(function(t){var n=o.getItemModel(t),a=o.get(s,t),h=new Sz,g=r(Nl(a,[c,l],[0,1],!0)),_=n.getModel(`title`);if(_.get(`show`)){var v=_.get(`offsetCenter`),y=i.cx+Y(v[0],i.r),b=i.cy+Y(v[1],i.r),x=d[t];x.attr({z2:m?0:2,style:op(_,{x:y,y:b,text:o.getName(t),align:`center`,verticalAlign:`middle`},{inheritColor:g})}),h.add(x)}var S=n.getModel(`detail`);if(S.get(`show`)){var C=S.get(`offsetCenter`),w=i.cx+Y(C[0],i.r),T=i.cy+Y(C[1],i.r),E=Y(S.get(`width`),i.r),D=Y(S.get(`height`),i.r),O=e.get([`progress`,`show`])?o.getItemVisual(t,`style`).fill:g,x=f[t],k=S.get(`formatter`);x.attr({z2:m?0:2,style:op(S,{x:w,y:T,text:KE(a,k),width:isNaN(E)?null:E,height:isNaN(D)?null:D,align:`center`,verticalAlign:`middle`},{inheritColor:O})}),fp(x,{normal:S},a,function(e){return KE(e,k)}),p&&pp(x,t,o,e,{getFormattedLabel:function(e,t,n,r,i,o){return KE(o?o.interpolatedValue:a,k)}}),h.add(x)}u.add(h)}),this.group.add(u),this._titleEls=d,this._detailEls=f},t.type=`gauge`,t}(cU),dX=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath=`itemStyle`,n}return t.prototype.getInitialData=function(e,t){return Vb(this,[`value`])},t.type=`series.gauge`,t.defaultOption={z:2,colorBy:`data`,center:[`50%`,`50%`],legendHoverLink:!0,radius:`75%`,startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,X.color.neutral10]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:X.color.axisTick,width:3,type:`solid`}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:X.color.axisTickMinor,width:1,type:`solid`}},axisLabel:{show:!0,distance:15,color:X.color.axisLabel,fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:`60%`,width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:`circle`,offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:X.color.neutral00,borderWidth:0,borderColor:X.color.theme[0]}},title:{show:!0,offsetCenter:[0,`20%`],color:X.color.secondary,fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:X.color.transparent,borderWidth:0,borderColor:X.color.neutral40,width:100,height:null,padding:[5,10],offsetCenter:[0,`40%`],color:X.color.primary,fontSize:30,fontWeight:`bold`,lineHeight:30,valueAnimation:!1}},t}(UH),fX=`funnel`,pX=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new ZW(q(this.getData,this),q(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.getInitialData=function(e,t){return Vb(this,{coordDimensions:[`value`],encodeDefaulter:Ha(vp,this)})},t.prototype._defaultLabelLine=function(e){lu(e,`labelLine`,[`show`]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.prototype.getDataParams=function(t){var n=this.getData(),r=e.prototype.getDataParams.call(this,t),i=n.mapDimension(`value`),a=n.getSum(i);return r.percent=a?+(n.get(i,t)/a*100).toFixed(2):0,r.$vars.push(`percent`),r},t.type=`series.`+fX,t.defaultOption={coordinateSystemUsage:`box`,z:2,legendHoverLink:!0,colorBy:`data`,left:80,top:60,right:80,bottom:65,minSize:`0%`,maxSize:`100%`,sort:`descending`,orient:`vertical`,gap:0,funnelAlign:`center`,label:{show:!0,position:`outer`},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:X.color.neutral00,borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:X.color.primary}}},t}(UH),mX=[`itemStyle`,`opacity`],hX=function(e){F(t,e);function t(t,n){var r=e.call(this)||this,i=r,a=new Gz,o=new cR;return i.setTextContent(o),r.setTextGuideLine(a),r.updateData(t,n,!0),r}return t.prototype.updateData=function(e,t,n){var r=this,i=e.hostModel,a=e.getItemModel(t),o=e.getItemLayout(t),s=a.getModel(`emphasis`),c=a.get(mX);c??=1,n||_f(r),r.useStyle(e.getItemVisual(t,`style`)),r.style.lineJoin=`round`,n?(r.setShape({points:o.points}),r.style.opacity=0,ff(r,{style:{opacity:c}},i,t)):df(r,{style:{opacity:c},shape:{points:o.points}},i,t),Ld(r,a),this._updateLabel(e,t),Fd(this,s.get(`focus`),s.get(`blurScope`),s.get(`disabled`))},t.prototype._updateLabel=function(e,t){var n=this,r=this.getTextGuideLine(),i=n.getTextContent(),a=e.hostModel,o=e.getItemModel(t),s=e.getItemLayout(t).label,c=e.getItemVisual(t,`style`),l=c.fill;ip(i,ap(o),{labelFetcher:e.hostModel,labelDataIndex:t,defaultOpacity:c.opacity,defaultText:e.getName(t)},{normal:{align:s.textAlign,verticalAlign:s.verticalAlign}});var u=o.getModel(`label`).get(`color`)===`inherit`?l:null;n.setTextConfig({local:!0,inside:!!s.inside,insideStroke:u,outsideFill:u});var d=s.linePoints;r.setShape({points:d}),n.textGuideLineConfig={anchor:d?new wF(d[0][0],d[0][1]):null},df(i,{style:{x:s.x,y:s.y}},a,t),i.attr({rotation:s.rotation,originX:s.x,originY:s.y,z2:10}),$b(n,ex(o),{stroke:l})},t}(Uz),gX=function(e){F(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=fX,t.ignoreLabelLineUpdate=!0,t}return t.prototype.render=function(e,t,n){var r=e.getData(),i=this._data,a=this.group;r.diff(i).add(function(e){var t=new hX(r,e);r.setItemGraphicEl(e,t),a.add(t)}).update(function(e,t){var n=i.getItemGraphicEl(t);n.updateData(r,e),a.add(n),r.setItemGraphicEl(e,n)}).remove(function(t){gf(i.getItemGraphicEl(t),e,t)}).execute(),this._data=r},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type=fX,t}(cU),_X=Qu(fX,XE),vX=`sankey`,yX=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(e,t){var n=e.edges||e.links||[],r=e.data||e.nodes||[],i=e.levels||[];this.levelModels=[];for(var a=this.levelModels,o=0;o<i.length;o++)i[o].depth!=null&&i[o].depth>=0&&(a[i[o].depth]=new HB(i[o],this,t));return PE(r,n,this,!0,s).data;function s(e,t){e.wrapMethod(`getItemModel`,function(e,t){var n=e.parentModel,r=n.getData().getItemLayout(t);if(r){var i=r.depth,a=n.levelModels[i];a&&(e.parentModel=a)}return e}),t.wrapMethod(`getItemModel`,function(e,t){var n=e.parentModel,r=n.getGraph().getEdgeByIndex(t).node1.getLayout();if(r){var i=r.depth,a=n.levelModels[i];a&&(e.parentModel=a)}return e})}},t.prototype.setNodePosition=function(e,t){var n=(this.option.data||this.option.nodes)[e];n.localX=t[0],n.localY=t[1]},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(e,t,n){function r(e){return isNaN(e)||e==null}if(n===`edge`){var i=this.getDataParams(e,n),a=i.data,o=i.value;return Yh(`nameValue`,{name:a.source+` -- `+a.target,value:o,noValue:r(o)})}var s=this.getGraph().getNodeByIndex(e).getLayout().value,c=this.getDataParams(e,n).data.name;return Yh(`nameValue`,{name:c==null?null:c+``,value:s,noValue:r(s)})},t.prototype.optionUpdated=function(){},t.prototype.getDataParams=function(t,n){var r=e.prototype.getDataParams.call(this,t,n);return r.value==null&&n===`node`&&(r.value=this.getGraph().getNodeByIndex(t).getLayout().value),r},t.prototype.__ownRoamView=function(){return this.coordinateSystem},t.type=`series.`+vX,t.layoutMode=`box`,t.defaultOption={z:2,coordinateSystemUsage:`box`,left:`5%`,top:`5%`,right:`20%`,bottom:`5%`,orient:`horizontal`,nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,roam:!1,roamTrigger:`global`,center:null,zoom:1,label:{show:!0,position:`right`,fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:`justify`,lineStyle:{color:X.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:X.color.primary}},animationEasing:`linear`,animationDuration:1e3},t}(UH),bX=function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return e}(),xX=function(e){F(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new bX},t.prototype.buildPath=function(e,t){var n=t.extent;e.moveTo(t.x1,t.y1),e.bezierCurveTo(t.cpx1,t.cpy1,t.cpx2,t.cpy2,t.x2,t.y2),t.orient===`vertical`?(e.lineTo(t.x2+n,t.y2),e.bezierCurveTo(t.cpx2+n,t.cpy2,t.cpx1+n,t.cpy1,t.x1+n,t.y1)):(e.lineTo(t.x2,t.y2+n),e.bezierCurveTo(t.cpx2,t.cpy2+n,t.cpx1,t.cpy1+n,t.x1,t.y1+n)),e.closePath()},t.prototype.highlight=function(){bd(this)},t.prototype.downplay=function(){xd(this)},t}(JL),SX=function(e){F(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=vX,t._mainGroup=new Sz,t}return t.prototype.init=function(e,t){this._controller=new QJ(t.getZr()),this.group.add(this._mainGroup),this._firstRender=!0},t.prototype.render=function(e,t,n){var r=e.getGraph(),i=this._mainGroup,a=e.layoutInfo,o=a.width,s=a.height,c=e.getData(),l=e.getData(`edge`),u=e.get(`orient`);i.removeAll(),i.x=a.x,i.y=a.y,this._updateViewCoordSys(e,n),CT(e,n,this._controller,wT(i),null),r.eachEdge(function(t){var n=new xX,r=LR(n);r.dataIndex=t.dataIndex,r.seriesIndex=e.seriesIndex,r.dataType=`edge`;var a=t.getModel(),c=a.getModel(`lineStyle`),d=c.get(`curveness`),f=t.node1.getLayout(),p=t.node1.getModel(),m=p.get(`localX`),h=p.get(`localY`),g=t.node2.getLayout(),_=t.node2.getModel(),v=_.get(`localX`),y=_.get(`localY`),b=t.getLayout(),x,S,C,w,T,E,D,O;n.shape.extent=Math.max(1,b.dy),n.shape.orient=u,u===`vertical`?(x=(m==null?f.x:m*o)+b.sy,S=(h==null?f.y:h*s)+f.dy,C=(v==null?g.x:v*o)+b.ty,w=y==null?g.y:y*s,T=x,E=S*(1-d)+w*d,D=C,O=S*d+w*(1-d)):(x=(m==null?f.x:m*o)+f.dx,S=(h==null?f.y:h*s)+b.sy,C=v==null?g.x:v*o,w=(y==null?g.y:y*s)+b.ty,T=x*(1-d)+C*d,E=S,D=x*d+C*(1-d),O=w),n.setShape({x1:x,y1:S,x2:C,y2:w,cpx1:T,cpy1:E,cpx2:D,cpy2:O}),n.useStyle(c.getItemStyle()),nD(n.style,u,t);var k=``+a.get(`value`),A=ap(a,`edgeLabel`);ip(n,A,{labelFetcher:{getFormattedLabel:function(t,n,r,i,a,o){return e.getFormattedLabel(t,n,`edge`,i,Qa(a,A.normal&&A.normal.get(`formatter`),k),o)}},labelDataIndex:t.dataIndex,defaultText:k}),n.setTextConfig({position:`inside`});var j=a.getModel(`emphasis`);Ld(n,a,`lineStyle`,function(e){var n=e.getItemStyle();return nD(n,u,t),n}),i.add(n),l.setItemGraphicEl(t.dataIndex,n);var M=j.get(`focus`);Fd(n,M===`adjacency`?t.getAdjacentDataIndices():M===`trajectory`?t.getTrajectoryDataIndices():M,j.get(`blurScope`),j.get(`disabled`))}),r.eachNode(function(t){var n=t.getLayout(),r=t.getModel(),a=r.get(`localX`),l=r.get(`localY`),u=r.getModel(`emphasis`),d=r.get([`itemStyle`,`borderRadius`])||0,f=new rR({shape:{x:a==null?n.x:a*o,y:l==null?n.y:l*s,width:n.dx,height:n.dy,r:d},style:r.getModel(`itemStyle`).getItemStyle(),z2:10});ip(f,ap(r),{labelFetcher:{getFormattedLabel:function(t,n){return e.getFormattedLabel(t,n,`node`)}},labelDataIndex:t.dataIndex,defaultText:t.id}),f.disableLabelAnimation=!0,f.setStyle(`fill`,t.getVisual(`color`)),f.setStyle(`decal`,t.getVisual(`style`).decal),Ld(f,r),i.add(f),c.setItemGraphicEl(t.dataIndex,f),LR(f).dataType=`node`;var p=u.get(`focus`);Fd(f,p===`adjacency`?t.getAdjacentDataIndices():p===`trajectory`?t.getTrajectoryDataIndices():p,u.get(`blurScope`),u.get(`disabled`))}),c.eachItemGraphicEl(function(t,r){c.getItemModel(r).get(`draggable`)&&(t.drift=function(t,i){this.shape.x+=t,this.shape.y+=i,this.dirty(),n.dispatchAction({type:`dragNode`,seriesId:e.id,dataIndex:c.getRawIndex(r),localX:this.shape.x/o,localY:this.shape.y/s})},t.draggable=!0,t.cursor=`move`)}),!this._data&&e.isAnimationEnabled()&&i.setClipPath(rD(i.getBoundingRect(),e,function(){i.removeClipPath()})),this._data=e.getData(),this._firstRender=!1},t.prototype.__updateOnOwnRoam=function(e,t,n){lT(this.group,2,t.coordinateSystem,null)},t.prototype.dispose=function(){this._controller&&this._controller.dispose()},t.prototype._updateViewCoordSys=function(e,t){var n=e.layoutInfo,r=e.coordinateSystem=DT(e,t,n.x,n.y,n.width,n.height);lT(this.group,2,r,this._firstRender?null:e)},t.type=vX,t}(cU),CX=Qu(vX,iD),wX=Qu(vX,ED),TX=256,EX=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=GP.createCanvas();this.canvas=e}return e.prototype.update=function(e,t,n,r,i,a){var o=this._getBrush(),s=this._getGradient(i,`inRange`),c=this._getGradient(i,`outOfRange`),l=this.pointSize+this.blurSize,u=this.canvas,d=u.getContext(`2d`),f=e.length;u.width=t,u.height=n;for(var p=0;p<f;++p){var m=e[p],h=m[0],g=m[1],_=m[2],v=r(_);d.globalAlpha=v,d.drawImage(o,h-l,g-l)}if(!u.width||!u.height)return u;for(var y=d.getImageData(0,0,u.width,u.height),b=y.data,x=0,S=b.length,C=this.minOpacity,w=this.maxOpacity-C;x<S;){var v=b[x+3]/256,T=Math.floor(v*(TX-1))*4;if(v>0){var E=a(v)?s:c;v>0&&(v=v*w+C),b[x++]=E[T],b[x++]=E[T+1],b[x++]=E[T+2],b[x++]=E[T+3]*v*256}else x+=4}return d.putImageData(y,0,0),u},e.prototype._getBrush=function(){var e=this._brushCanvas||=GP.createCanvas(),t=this.pointSize+this.blurSize,n=t*2;e.width=n,e.height=n;var r=e.getContext(`2d`);return r.clearRect(0,0,n,n),r.shadowOffsetX=n,r.shadowBlur=this.blurSize,r.shadowColor=X.color.neutral99,r.beginPath(),r.arc(-t,t,this.pointSize,0,Math.PI*2,!0),r.closePath(),r.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,r=n[t]||(n[t]=new Uint8ClampedArray(1024)),i=[0,0,0,0],a=0,o=0;o<256;o++)e[t](o/255,!0,i),r[a++]=i[0],r[a++]=i[1],r[a++]=i[2],r[a++]=i[3];return r},e}(),DX=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r;t.eachComponent(`visualMap`,function(t){t.eachTargetSeries(function(n){n===e&&(r=t)})}),this._progressiveEls=null,this.group.removeAll();var i=e.coordinateSystem;i.type===`cartesian2d`||i.type===`calendar`||i.type===`matrix`?this._renderOnGridLike(e,n,0,e.getData().count()):Xg(i)&&this._renderOnGeo(i,e,r,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,r){var i=t.coordinateSystem;i&&(Xg(i)?this.render(t,n,r):(this._progressiveEls=[],this._renderOnGridLike(t,r,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){Gf(this._progressiveEls||this.group,e)},t.prototype._renderOnGridLike=function(e,t,n,r,i){var a=e.coordinateSystem,o=Yg(a,`cartesian2d`),s=Yg(a,`matrix`),c,l,u,d;if(o){var f=a.getAxis(`x`),p=a.getAxis(`y`);c=Yv(f).w+.5,l=Yv(p).w+.5,u=f.scale.getExtent(),d=p.scale.getExtent()}for(var m=this.group,h=e.getData(),g=e.getModel([`emphasis`,`itemStyle`]).getItemStyle(),_=e.getModel([`blur`,`itemStyle`]).getItemStyle(),v=e.getModel([`select`,`itemStyle`]).getItemStyle(),y=e.get([`itemStyle`,`borderRadius`]),b=ap(e),x=e.getModel(`emphasis`),S=x.get(`focus`),C=x.get(`blurScope`),w=x.get(`disabled`),T=o||s?[h.mapDimension(`x`),h.mapDimension(`y`),h.mapDimension(`value`)]:[h.mapDimension(`time`),h.mapDimension(`value`)],E=n;E<r;E++){var D=void 0,O=h.getItemVisual(E,`style`);if(o){var k=h.get(T[0],E),A=h.get(T[1],E);if(isNaN(h.get(T[2],E))||isNaN(k)||isNaN(A)||k<u[0]||k>u[1]||A<d[0]||A>d[1])continue;var j=a.dataToPoint([k,A]);D=new rR({shape:{x:j[0]-c/2,y:j[1]-l/2,width:c,height:l},style:O})}else if(s){var M=a.dataToLayout([h.get(T[0],E),h.get(T[1],E)]).rect;if(Xa(M.x))continue;D=new rR({z2:1,shape:M,style:O})}else{if(isNaN(h.get(T[1],E)))continue;var ee=a.dataToLayout([h.get(T[0],E)]),M=ee.contentRect||ee.rect;if(Xa(M.x)||Xa(M.y))continue;D=new rR({z2:1,shape:M,style:O})}if(h.hasItemOption){var te=h.getItemModel(E),ne=te.getModel(`emphasis`);g=ne.getModel(`itemStyle`).getItemStyle(),_=te.getModel([`blur`,`itemStyle`]).getItemStyle(),v=te.getModel([`select`,`itemStyle`]).getItemStyle(),y=te.get([`itemStyle`,`borderRadius`]),S=ne.get(`focus`),C=ne.get(`blurScope`),w=ne.get(`disabled`),b=ap(te)}D.shape.r=y;var re=e.getRawValue(E),ie=`-`;re&&re[2]!=null&&(ie=re[2]+``),ip(D,b,{labelFetcher:e,labelDataIndex:E,defaultOpacity:O.opacity,defaultText:ie}),D.ensureState(`emphasis`).style=g,D.ensureState(`blur`).style=_,D.ensureState(`select`).style=v,Fd(D,S,C,w),D.incremental=Xu(e,i),i&&(D.states.emphasis.hoverLayer=2),m.add(D),h.setItemGraphicEl(E,D),this._progressiveEls&&this._progressiveEls.push(D)}},t.prototype._renderOnGeo=function(e,t,n,r){var i=n.targetVisuals.inRange,a=n.targetVisuals.outOfRange,o=t.getData(),s=this._hmLayer||this._hmLayer||new EX;s.blurSize=t.get(`blurSize`),s.pointSize=t.get(`pointSize`),s.minOpacity=t.get(`minOpacity`),s.maxOpacity=t.get(`maxOpacity`);var c=e.getViewRect().clone(),l=e.getRoamTransform();c.applyTransform(l);var u=Math.max(c.x,0),d=Math.max(c.y,0),f=Math.min(c.width+c.x,r.getWidth()),p=Math.min(c.height+c.y,r.getHeight()),m=f-u,h=p-d,g=[o.mapDimension(`lng`),o.mapDimension(`lat`),o.mapDimension(`value`)],_=o.mapArray(g,function(t,n,r){var i=e.dataToPoint([t,n]);return i[0]-=u,i[1]-=d,i.push(r),i}),v=n.getExtent(),y=n.type===`visualMap.continuous`?kD(v,n.option.range):OD(v,n.getPieceList(),n.option.selected);s.update(_,m,h,i.color.getNormalizer(),{inRange:i.color.getColorMapper(),outOfRange:a.color.getColorMapper()},y);var b=new $L({style:{width:m,height:h,x:u,y:d,image:s.canvas},silent:!0});this.group.add(b)},t.type=`heatmap`,t}(cU),OX=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(e,t){return mm(null,this,{generateCoord:`value`})},t.prototype.preventIncremental=function(){var e=RV.get(this.get(`coordinateSystem`));if(e&&e.dimensions)return e.dimensions[0]===`lng`&&e.dimensions[1]===`lat`},t.type=`series.heatmap`,t.dependencies=[`grid`,`geo`,`calendar`,`matrix`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:X.color.primary}}},t}(UH),kX={position:[`x`,`y`],scale:[`scaleX`,`scaleY`],origin:[`originX`,`originY`]},AX=Ba(kX),La(dI,function(e,t){return e[t]=1,e},{}),dI.join(`, `),jX=[``,`style`,`shape`,`extra`],MX=Du(),NX={},PX={setTransform:function(e,t){return NX.el[e]=t,this},getTransform:function(e){return NX.el[e]},setShape:function(e,t){var n=NX.el,r=n.shape||={};return r[e]=t,n.dirtyShape&&n.dirtyShape(),this},getShape:function(e){var t=NX.el.shape;if(t)return t[e]},setStyle:function(e,t){var n=NX.el,r=n.style;return r&&(r[e]=t,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(e){var t=NX.el.style;if(t)return t[e]},setExtra:function(e,t){var n=NX.el.extra||(NX.el.extra={});return n[e]=t,this},getExtra:function(e){var t=NX.el.extra;if(t)return t[e]}},FX=Du(),IX=[`percent`,`easing`,`shape`,`style`,`extra`],LX=Du(),RX=ka,zX=q,BX=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,r){var i=t.get(`value`),a=t.get(`status`);if(this._axisModel=e,this._axisPointerModel=t,this._api=n,r||this._lastValue!==i||this._lastStatus!==a){this._lastValue=i,this._lastStatus=a;var o=this._group,s=this._handle;if(!a||a===`hide`)o&&o.hide(),s&&s.hide();else{o&&o.show(),s&&s.show();var c={};this.makeElOption(c,i,e,t,n);var l=c.graphicKey;l!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=l;var u=this._moveAnimation=this.determineAnimation(e,t);if(!o)o=this._group=new Sz,this.createPointerEl(o,c,e,t),this.createLabelEl(o,c,e,t),n.getZr().add(o);else{var d=Ha(JD,t,u);this.updatePointerEl(o,c,d),this.updateLabelEl(o,c,d,t)}QD(o,t,!0),this._renderHandle(i)}}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get(`animation`),r=e.axis,i=r.type===`category`,a=t.get(`snap`);if(!a&&!i)return!1;if(n===`auto`||n==null){var o=this.animationThreshold;if(i&&Yv(r).w>o)return!0;if(a){var s=Dw(e).seriesDataCount,c=r.getExtent();return Math.abs(c[0]-c[1])/s>o}return!1}return n===!0},e.prototype.makeElOption=function(e,t,n,r,i){},e.prototype.createPointerEl=function(e,t,n,r){var i=t.pointer;if(i){var a=LX(e).pointerEl=new gB[i.type](RX(t.pointer));e.add(a)}},e.prototype.createLabelEl=function(e,t,n,r){if(t.label){var i=LX(e).labelEl=new cR(RX(t.label));e.add(i),XD(i,r)}},e.prototype.updatePointerEl=function(e,t,n){var r=LX(e).pointerEl;r&&t.pointer&&(r.setStyle(t.pointer.style),n(r,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,r){var i=LX(e).labelEl;i&&(i.setStyle(t.label.style),n(i,{x:t.label.x,y:t.label.y}),XD(i,r))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t=this._axisPointerModel,n=this._api.getZr(),r=this._handle,i=t.getModel(`handle`),a=t.get(`status`);if(!i.get(`show`)||!a||a===`hide`)r&&n.remove(r),this._handle=null;else{var o;this._handle||(o=!0,r=this._handle=If(i.get(`icon`),{cursor:`move`,draggable:!0,onmousemove:function(e){TG(e.event)},onmousedown:zX(this._onHandleDragMove,this,0,0),drift:zX(this._onHandleDragMove,this),ondragend:zX(this._onHandleDragEnd,this)}),n.add(r)),QD(r,t,!1),r.setStyle(i.getItemStyle(null,[`color`,`borderColor`,`borderWidth`,`opacity`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`]));var s=i.get(`size`);z(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,gb(this,`_doDispatchAxisPointer`,i.get(`throttle`)||0,`fixRate`),this._moveHandleToValue(e,o)}}},e.prototype._moveHandleToValue=function(e,t){JD(this._axisPointerModel,!t&&this._moveAnimation,this._handle,ZD(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var r=this.updateHandleTransform(ZD(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=r,n.stopAnimation(),n.attr(ZD(r)),LX(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:`updateAxisPointer`,x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get(`value`);this._moveHandleToValue(e),this._api.dispatchAction({type:`hideTip`})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,r=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),r&&t.remove(r),this._group=null,this._handle=null,this._payloadInfo=null),_b(this,`_doDispatchAxisPointer`)},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}},e}(),VX=function(e){F(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,t,n,r,i){var a=n.axis,o=a.grid,s=r.get(`type`),c=a.getGlobalExtent(),l=lO(o,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(t,!0));if(s&&s!==`none`){var d=$D(r),f=HX[s](a,u,c,l,r.get(`seriesDataIndices`),r.ecModel);f.style=d,e.graphicKey=f.type,e.pointer=f}iO(t,e,Py(o.getRect(),n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=Py(t.axis.grid.getRect(),t,{labelInside:!1});r.labelMargin=n.get([`handle`,`margin`]);var i=rO(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,a=i.grid,o=i.getGlobalExtent(!0),s=lO(a,i).getOtherAxis(i).getGlobalExtent(),c=i.dim===`x`?0:1,l=[e.x,e.y];l[c]+=t[c],l[c]=mR(o[1],l[c]),l[c]=hR(o[0],l[c]);var u=(s[1]+s[0])/2,d=[u,u];return d[c]=l[c],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:d,tooltipOption:[{verticalAlign:`middle`},{align:`center`}][c]}},t}(BX),HX={line:function(e,t,n,r){return{type:`Line`,subPixelOptimize:!0,shape:aO([t,r[0]],[t,r[1]],uO(e))}},shadow:function(e,t,n,r,i,a){var o=sO(e,i,a),s=r[1]-r[0],c=cO(t,n,o),l=c[0],u=c[1];return{type:`Rect`,shape:oO([l,r[0]],[u-l,s],uO(e))}}},UX=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`axisPointer`,t.defaultOption={show:`auto`,z:50,type:`line`,snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:X.color.border,width:1,type:`dashed`},shadowStyle:{color:X.color.shadowTint},label:{show:!0,formatter:null,precision:`auto`,margin:3,color:X.color.neutral00,padding:[5,7,5,7],backgroundColor:X.color.accent60,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:X.color.accent40,throttle:40}},t}(TH),WX=Du(),GX=L,KX=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=t.getComponent(`tooltip`),i=e.get(`triggerOn`)||r&&r.get(`triggerOn`)||`mousemove|click|mousewheel`;dO(`axisPointer`,n,function(e,t,n){i!==`none`&&(e===`leave`||i.indexOf(e)>=0)&&n({type:`updateAxisPointer`,currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})})},t.prototype.remove=function(e,t){_O(`axisPointer`,t)},t.prototype.dispose=function(e,t){_O(`axisPointer`,t)},t.type=`axisPointer`,t}(xK),qX=Du(),JX=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(t,n,r){var i=Dh(t);e.prototype.init.apply(this,arguments),MO(t,i)},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),MO(this.option,t)},t.prototype.getCellSize=function(){return this.option.cellSize},t.type=`calendar`,t.layoutMode=`box`,t.defaultOption={z:2,left:80,top:60,cellSize:20,orient:`horizontal`,splitLine:{show:!0,lineStyle:{color:X.color.axisLine,width:1,type:`solid`}},itemStyle:{color:X.color.neutral00,borderWidth:1,borderColor:X.color.neutral10},dayLabel:{show:!0,firstDay:0,position:`start`,margin:X.size.s,color:X.color.secondary},monthLabel:{show:!0,position:`start`,margin:X.size.s,align:`center`,formatter:null,color:X.color.secondary},yearLabel:{show:!0,position:null,margin:X.size.xl,formatter:null,color:X.color.quaternary,fontFamily:`sans-serif`,fontWeight:`bolder`,fontSize:20}},t}(TH),YX=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=this.group;r.removeAll();var i=e.coordinateSystem,a=i.getRangeInfo(),o=i.getOrient(),s=t.getLocaleModel();this._renderDayRect(e,a,r),this._renderLines(e,a,o,r),this._renderYearText(e,a,o,r),this._renderMonthText(e,s,o,r),this._renderWeekText(e,s,a,o,r)},t.prototype._renderDayRect=function(e,t,n){for(var r=e.coordinateSystem,i=e.getModel(`itemStyle`).getItemStyle(),a=r.getCellWidth(),o=r.getCellHeight(),s=t.start.time;s<=t.end.time;s=r.getNextNDay(s,1).time){var c=r.dataToCalendarLayout([s],!1).tl,l=new rR({shape:{x:c[0],y:c[1],width:a,height:o},cursor:`default`,style:i});n.add(l)}},t.prototype._renderLines=function(e,t,n,r){var i=this,a=e.coordinateSystem,o=e.getModel([`splitLine`,`lineStyle`]).getLineStyle(),s=e.get([`splitLine`,`show`]),c=o.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var l=t.start,u=0;l.time<=t.end.time;u++){f(l.formatedDate),u===0&&(l=a.getDateInfo(t.start.y+`-`+t.start.m));var d=l.date;d.setMonth(d.getMonth()+1),l=a.getDateInfo(d)}f(a.getNextNDay(t.end.time,1).formatedDate);function f(t){i._firstDayOfMonth.push(a.getDateInfo(t)),i._firstDayPoints.push(a.dataToCalendarLayout([t],!1).tl);var c=i._getLinePointsOfOneWeek(e,t,n);i._tlpoints.push(c[0]),i._blpoints.push(c[c.length-1]),s&&i._drawSplitline(c,o,r)}s&&this._drawSplitline(i._getEdgesPoints(i._tlpoints,c,n),o,r),s&&this._drawSplitline(i._getEdgesPoints(i._blpoints,c,n),o,r)},t.prototype._getEdgesPoints=function(e,t,n){var r=[e[0].slice(),e[e.length-1].slice()],i=n===`horizontal`?0:1;return r[0][i]=r[0][i]-t/2,r[1][i]=r[1][i]+t/2,r},t.prototype._drawSplitline=function(e,t,n){var r=new Gz({z2:20,shape:{points:e},style:t});n.add(r)},t.prototype._getLinePointsOfOneWeek=function(e,t,n){for(var r=e.coordinateSystem,i=r.getDateInfo(t),a=[],o=0;o<7;o++){var s=r.getNextNDay(i.time,o),c=r.dataToCalendarLayout([s.time],!1);a[2*s.day]=c.tl,a[2*s.day+1]=c[n===`horizontal`?`bl`:`tr`]}return a},t.prototype._formatterLabel=function(e,t){return V(e)&&e?ph(e,t):B(e)?e(t):t.nameMap},t.prototype._yearTextPositionControl=function(e,t,n,r,i){var a=t[0],o=t[1],s=[`center`,`bottom`];r===`bottom`?(o+=i,s=[`center`,`top`]):r===`left`?a-=i:r===`right`?(a+=i,s=[`center`,`top`]):o-=i;var c=0;return(r===`left`||r===`right`)&&(c=Math.PI/2),{rotation:c,x:a,y:o,style:{align:s[0],verticalAlign:s[1]}}},t.prototype._renderYearText=function(e,t,n,r){var i=e.getModel(`yearLabel`);if(i.get(`show`)){var a=i.get(`margin`),o=i.get(`position`);o||=n===`horizontal`?`left`:`top`;var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],c=(s[0][0]+s[1][0])/2,l=(s[0][1]+s[1][1])/2,u=n===`horizontal`?0:1,d={top:[c,s[u][1]],bottom:[c,s[1-u][1]],left:[s[1-u][0],l],right:[s[u][0],l]},f=t.start.y;+t.end.y>+t.start.y&&(f=f+`-`+t.end.y);var p=i.get(`formatter`),m={start:t.start.y,end:t.end.y,nameMap:f},h=new cR({z2:30,style:op(i,{text:this._formatterLabel(p,m)}),silent:i.get(`silent`)});h.attr(this._yearTextPositionControl(h,d[o],n,o,a)),r.add(h)}},t.prototype._monthTextPositionControl=function(e,t,n,r,i){var a=`left`,o=`top`,s=e[0],c=e[1];return n===`horizontal`?(c+=i,t&&(a=`center`),r===`start`&&(o=`bottom`)):(s+=i,t&&(o=`middle`),r===`start`&&(a=`right`)),{x:s,y:c,align:a,verticalAlign:o}},t.prototype._renderMonthText=function(e,t,n,r){var i=e.getModel(`monthLabel`);if(i.get(`show`)){var a=i.get(`nameMap`),o=i.get(`margin`),s=i.get(`position`),c=i.get(`align`),l=[this._tlpoints,this._blpoints];(!a||V(a))&&(a&&(t=Mm(a)||t),a=t.get([`time`,`monthAbbr`])||[]);var u=s===`start`?0:1,d=n===`horizontal`?0:1;o=s===`start`?-o:o;for(var f=c===`center`,p=i.get(`silent`),m=0;m<l[u].length-1;m++){var h=l[u][m].slice(),g=this._firstDayOfMonth[m];f&&(h[d]=(this._firstDayPoints[m][d]+l[0][m+1][d])/2);var _=i.get(`formatter`),v=a[g.m-1],y={yyyy:g.y,yy:(g.y+``).slice(2),MM:g.m,M:+g.m,nameMap:v},b=new cR({z2:30,style:I(op(i,{text:this._formatterLabel(_,y)}),this._monthTextPositionControl(h,f,n,s,o)),silent:p});r.add(b)}}},t.prototype._weekTextPositionControl=function(e,t,n,r,i){var a=`center`,o=`middle`,s=e[0],c=e[1],l=n===`start`;return t===`horizontal`?(s=s+r+(l?1:-1)*i[0]/2,a=l?`right`:`left`):(c=c+r+(l?1:-1)*i[1]/2,o=l?`bottom`:`top`),{x:s,y:c,align:a,verticalAlign:o}},t.prototype._renderWeekText=function(e,t,n,r,i){var a=e.getModel(`dayLabel`);if(a.get(`show`)){var o=e.coordinateSystem,s=a.get(`position`),c=a.get(`nameMap`),l=a.get(`margin`),u=o.getFirstDayOfWeek();(!c||V(c))&&(c&&(t=Mm(c)||t),c=t.get([`time`,`dayOfWeekShort`])||R(t.get([`time`,`dayOfWeekAbbr`]),function(e){return e[0]}));var d=o.getNextNDay(n.end.time,7-n.lweek).time,f=[o.getCellWidth(),o.getCellHeight()];l=Y(l,Math.min(f[1],f[0])),s===`start`&&(d=o.getNextNDay(n.start.time,-(7+n.fweek)).time,l=-l);for(var p=a.get(`silent`),m=0;m<7;m++){var h=o.getNextNDay(d,m),g=o.dataToCalendarLayout([h.time],!1).center,_=m;_=Math.abs((m+u)%7);var v=new cR({z2:30,style:I(op(a,{text:c[_]}),this._weekTextPositionControl(g,r,s,l,f)),silent:p});i.add(v)}}},t.type=`calendar`,t}(xK),XX=864e5,ZX=function(){function e(t,n,r){this.type=`calendar`,this.dimensions=e.dimensions,this.getDimensionsInfo=e.getDimensionsInfo,this._model=t,this._update(n,r)}return e.getDimensionsInfo=function(){return[{name:`time`,type:`time`},`value`]},e.prototype.getRangeInfo=function(){return this._rangeInfo},e.prototype.getModel=function(){return this._model},e.prototype.getRect=function(){return this._rect},e.prototype.getCellWidth=function(){return this._sw},e.prototype.getCellHeight=function(){return this._sh},e.prototype.getOrient=function(){return this._orient},e.prototype.getFirstDayOfWeek=function(){return this._firstDayOfWeek},e.prototype.getDateInfo=function(e){e=ql(e);var t=e.getFullYear(),n=e.getMonth()+1,r=n<10?`0`+n:``+n,i=e.getDate(),a=i<10?`0`+i:``+i,o=e.getDay();return o=Math.abs((o+7-this.getFirstDayOfWeek())%7),{y:t+``,m:r,d:a,day:o,time:e.getTime(),formatedDate:t+`-`+r+`-`+a,date:e}},e.prototype.getNextNDay=function(e,t){return t||=0,t===0||(e=new Date(this.getDateInfo(e).time),e.setDate(e.getDate()+t)),this.getDateInfo(e)},e.prototype._update=function(e,t){this._firstDayOfWeek=+this._model.getModel(`dayLabel`).get(`firstDay`),this._orient=this._model.get(`orient`),this._lineWidth=this._model.getModel(`itemStyle`).getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var n=this._rangeInfo.weeks||1,r=[`width`,`height`],i=this._model.getCellSize().slice(),a=this._model.getBoxLayoutParams(),o=this._orient===`horizontal`?[n,7]:[7,n];L([0,1],function(e){l(i,e)&&(a[r[e]]=i[e]*o[e])});var s={width:t.getWidth(),height:t.getHeight()},c=this._rect=xh(a,s);L([0,1],function(e){l(i,e)||(i[e]=c[r[e]]/o[e])});function l(e,t){return e[t]!=null&&e[t]!==`auto`}this._sw=i[0],this._sh=i[1]},e.prototype.dataToPoint=function(e,t,n){n||=[],z(e)&&(e=e[0]),t??=!0;var r=this.getDateInfo(e),i=this._rangeInfo,a=r.formatedDate;if(t&&!(r.time>=i.start.time&&r.time<i.end.time+XX))return n[0]=n[1]=NaN,n;var o=r.day,s=this._getRangeInfo([i.start.time,a]).nthWeek;return this._orient===`vertical`?(n[0]=this._rect.x+o*this._sw+this._sw/2,n[1]=this._rect.y+s*this._sh+this._sh/2):(n[0]=this._rect.x+s*this._sw+this._sw/2,n[1]=this._rect.y+o*this._sh+this._sh/2),n},e.prototype.pointToData=function(e){var t=this.pointToDate(e);return t&&t.time},e.prototype.dataToLayout=function(e,t,n){n||={};var r=n.rect=n.rect||{},i=n.contentRect=n.contentRect||{},a=this.dataToPoint(e,t);return r.x=a[0]-this._sw/2,r.y=a[1]-this._sh/2,r.width=this._sw,r.height=this._sh,J.copy(i,r),Vf(i,this._lineWidth/2,!0,!0),n},e.prototype.dataToCalendarLayout=function(e,t){var n=this.dataToPoint(e,t);return{center:n,tl:[n[0]-this._sw/2,n[1]-this._sh/2],tr:[n[0]+this._sw/2,n[1]-this._sh/2],br:[n[0]+this._sw/2,n[1]+this._sh/2],bl:[n[0]-this._sw/2,n[1]+this._sh/2]}},e.prototype.pointToDate=function(e){var t=Math.floor((e[0]-this._rect.x)/this._sw)+1,n=Math.floor((e[1]-this._rect.y)/this._sh)+1,r=this._rangeInfo.range;return this._orient===`vertical`?this._getDateByWeeksAndDay(n,t-1,r):this._getDateByWeeksAndDay(t,n-1,r)},e.prototype.convertToPixel=function(e,t,n){var r=NO(t);return r===this?r.dataToPoint(n):null},e.prototype.convertToLayout=function(e,t,n){var r=NO(t);return r===this?r.dataToLayout(n):null},e.prototype.convertFromPixel=function(e,t,n){var r=NO(t);return r===this?r.pointToData(n):null},e.prototype.containPoint=function(e){return console.warn(`Not implemented.`),!1},e.prototype._initRangeOption=function(){var e=this._model.get(`range`),t;if(z(e)&&e.length===1&&(e=e[0]),z(e))t=e;else{var n=e.toString();if(/^\d{4}$/.test(n)&&(t=[n+`-01-01`,n+`-12-31`]),/^\d{4}[\/|-]\d{1,2}$/.test(n)){var r=this.getDateInfo(n),i=r.date;i.setMonth(i.getMonth()+1);var a=this.getNextNDay(i,-1);t=[r.formatedDate,a.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(n)&&(t=[n,n])}if(!t)return e;var o=this._getRangeInfo(t);return o.start.time>o.end.time&&t.reverse(),t},e.prototype._getRangeInfo=function(e){var t=[this.getDateInfo(e[0]),this.getDateInfo(e[1])],n;t[0].time>t[1].time&&(n=!0,t.reverse());var r=Math.floor(t[1].time/XX)-Math.floor(t[0].time/XX)+1,i=new Date(t[0].time),a=i.getDate(),o=t[1].date.getDate();i.setDate(a+r-1);var s=i.getDate();if(s!==o)for(var c=i.getTime()-t[1].time>0?1:-1;(s=i.getDate())!==o&&(i.getTime()-t[1].time)*c>0;)r-=c,i.setDate(s-c);var l=Math.floor((r+t[0].day+6)/7),u=n?-l+1:l-1;return n&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:r,weeks:l,nthWeek:u,fweek:t[0].day,lweek:t[1].day}},e.prototype._getDateByWeeksAndDay=function(e,t,n){var r=this._getRangeInfo(n);if(e>r.weeks||e===0&&t<r.fweek||e===r.weeks&&t>r.lweek)return null;var i=(e-1)*7-r.fweek+t,a=new Date(r.start.time);return a.setDate(+r.start.d+i),this.getDateInfo(a)},e.create=function(t,n){var r=[];return t.eachComponent(`calendar`,function(i){var a=new e(i,t,n);r.push(a),i.coordinateSystem=a}),t.eachComponent(function(e,t){am({targetModel:t,coordSysType:`calendar`,coordSysProvider:BV})}),r},e.dimensions=[`time`,`value`],e}(),QX=[`transition`,`enterFrom`,`leaveTo`],$X=QX.concat([`enterAnimation`,`updateAnimation`,`leaveAnimation`]),eZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.preventAutoZ=!0,n}return t.prototype.mergeOption=function(t,n){var r=this.option.elements;this.option.elements=null,e.prototype.mergeOption.call(this,t,n),this.option.elements=r},t.prototype.optionUpdated=function(e,t){var n=this.option,r=(t?n:e).elements,i=n.elements=t?[]:n.elements,a=[];this._flatten(r,a,null);var o=fu(i,a,`normalMerge`),s=this._elOptionsToUpdate=[];L(o,function(e,t){var n=e.newOption;n&&(s.push(n),FO(e,n),LO(i,t,n),zO(i[t],n))},this),n.elements=Ra(i,function(e){return e&&delete e.$action,e!=null})},t.prototype._flatten=function(e,t,n){L(e,function(e){if(e){n&&(e.parentOption=n),t.push(e);var r=e.children;r&&r.length&&this._flatten(r,t,e),delete e.children}},this)},t.prototype.useElOptionsToUpdate=function(){var e=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,e},t.type=`graphic`,t.defaultOption={elements:[]},t}(TH),tZ={path:null,compoundPath:null,group:Sz,image:$L,text:cR},nZ=Du(),rZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(){this._elMap=W()},t.prototype.render=function(e,t,n){e!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=e,this._updateElements(e),this._relocate(e,n)},t.prototype._updateElements=function(e){var t=e.useElOptionsToUpdate();if(t){var n=this._elMap,r=this.group,i=e.get(`z`),a=e.get(`zlevel`);L(t,function(t){var o=xu(t.id,null),s=o==null?null:n.get(o),c=xu(t.parentId,null),l=c==null?r:n.get(c),u=t.type,d=t.style;u===`text`&&d&&t.hv&&t.hv[1]&&(d.textVerticalAlign=d.textBaseline=d.verticalAlign=d.align=null);var f=t.textContent,p=t.textConfig;if(d&&Zg(d,u,!!p,!!f)){var m=Qg(d,u,!0);!p&&m.textConfig&&(p=t.textConfig=m.textConfig),!f&&m.textContent&&(f=m.textContent)}var h=WO(t),g=t.$action||`merge`,_=g===`merge`,v=g===`replace`;if(_){var y=!s,b=s;y?b=VO(o,l,t.type,n):(b&&(nZ(b).isNew=!1),KD(b)),b&&(MD(b,h,e,{isInit:y}),UO(b,t,i,a))}else if(v){HO(s,t,n,e);var x=VO(o,l,t.type,n);x&&(MD(x,h,e,{isInit:!0}),UO(x,t,i,a))}else g===`remove`&&(ND(s,t),HO(s,t,n,e));var S=n.get(o);if(S&&f){if(_){var C=S.getTextContent();C?C.attr(f):S.setTextContent(new cR(f))}else v&&S.setTextContent(new cR(f))}if(S){var w=t.clipPath;if(w){var T=w.type,E=void 0,y=!1;if(_){var D=S.getClipPath();y=!D||nZ(D).type!==T,E=y?BO(T):D}else v&&(y=!0,E=BO(T));S.setClipPath(E),MD(E,w,e,{isInit:y}),qD(E,w.keyframeAnimation,e)}var O=nZ(S);S.setTextConfig(p),O.option=t,GO(S,e,t),Uf({el:S,componentModel:e,itemName:S.name,itemTooltipOption:t.tooltip}),qD(S,t.keyframeAnimation,e)}})}},t.prototype._relocate=function(e,t){for(var n=e.option.elements,r=this.group,i=this._elMap,a=t.getWidth(),o=t.getHeight(),s=[`x`,`y`],c=0;c<n.length;c++){var l=n[c],u=xu(l.id,null),d=u==null?null:i.get(u);if(d&&d.isGroup){var f=d.parent,p=f===r,m=nZ(d),h=nZ(f);m.width=Y(m.option.width,p?a:h.width)||0,m.height=Y(m.option.height,p?o:h.height)||0}}for(var c=n.length-1;c>=0;c--){var l=n[c],u=xu(l.id,null),d=u==null?null:i.get(u);if(d){var f=d.parent,h=nZ(f),g=f===r?{width:a,height:o}:{width:h.width,height:h.height},_={},v=Ch(d,l,g,null,{hv:l.hv,boundingMode:l.bounding},_);if(!nZ(d).isNew&&v){for(var y=l.transition,b={},x=0;x<s.length;x++){var S=s[x],C=_[S];y&&(FD(y)||Na(y,S)>=0)?b[S]=C:d[S]=C}df(d,b,e,0)}else d.attr(_)}}},t.prototype._clear=function(){var e=this,t=this._elMap;t.each(function(n){HO(n,nZ(n).option,t,e._lastGraphicModel)}),this._elMap=W()},t.prototype.dispose=function(){this._clear()},t.type=`graphic`,t}(xK),iZ=[`x`,`y`,`radius`,`angle`,`single`],aZ=Du(),oZ=[`cartesian2d`,`polar`,`singleAxis`],sZ=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},e}(),cZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=[`percent`,`percent`],n}return t.prototype.init=function(e,t,n){var r=tk(e);this.settledOption=r,this.mergeDefaultAndTheme(e,n),this._doInit(r)},t.prototype.mergeOption=function(e){var t=tk(e);Aa(this.option,e,!0),Aa(this.settledOption,t,!0),this._doInit(t)},t.prototype._doInit=function(e){var t=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;L([[`start`,`startValue`],[`end`,`endValue`]],function(e,r){this._rangePropMode[r]===`value`&&(t[e[0]]=n[e[0]]=null)},this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get(`orient`,!0),t=this._targetAxisInfoMap=W();this._fillSpecifiedTargetAxis(t)?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||`horizontal`,this._fillAutoTargetAxisByOrient(t,this._orient)),this._noTarget=!0,t.each(function(e){e.indexList.length&&(this._noTarget=!1)},this)},t.prototype._fillSpecifiedTargetAxis=function(e){var t=!1;return L(iZ,function(n){var r=this.getReferringComponents(JO(n),FR);if(r.specified){t=!0;var i=new sZ;L(r.models,function(e){i.add(e.componentIndex)}),e.set(n,i)}},this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,r=!0;if(r){var i=t===`vertical`?`y`:`x`,a=n.findComponents({mainType:i+`Axis`});o(a,i)}if(r){var a=n.findComponents({mainType:`singleAxis`,filter:function(e){return e.get(`orient`,!0)===t}});o(a,`single`)}function o(t,n){var i=t[0];if(i){var a=new sZ;if(a.add(i.componentIndex),e.set(n,a),r=!1,n===`x`||n===`y`){var o=i.getReferringComponents(`grid`,PR).models[0];o&&L(t,function(e){i.componentIndex!==e.componentIndex&&o===e.getReferringComponents(`grid`,PR).models[0]&&a.add(e.componentIndex)})}}}r&&L(iZ,function(t){if(r){var i=n.findComponents({mainType:JO(t),filter:function(e){return e.get(`type`,!0)===`category`}});if(i[0]){var a=new sZ;a.add(i[0].componentIndex),e.set(t,a),r=!1}}},this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis(function(t){!e&&(e=t)},this),e===`y`?`vertical`:`horizontal`},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty(`throttle`)&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var t=this._rangePropMode,n=this.get(`rangeMode`);L([[`start`,`startValue`],[`end`,`endValue`]],function(r,i){var a=e[r[0]]!=null,o=e[r[1]]!=null;a&&!o?t[i]=`percent`:!a&&o?t[i]=`value`:n?t[i]=n[i]:a&&(t[i]=`percent`)})},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis(function(t,n){e??=this.ecModel.getComponent(JO(t),n)},this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each(function(n,r){L(n.indexList,function(n){e.call(t,r,n)})})},t.prototype.getAxisProxy=function(e,t){return QO(this.getAxisModel(e,t))},t.prototype.getAxisModel=function(e,t){var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[t])return this.ecModel.getComponent(JO(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;L([[`start`,`startValue`],[`end`,`endValue`]],function(r){(e[r[0]]!=null||e[r[1]]!=null)&&(t[r[0]]=n[r[0]]=e[r[0]],t[r[1]]=n[r[1]]=e[r[1]])},this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;L([`start`,`startValue`,`end`,`endValue`],function(n){t[n]=e[n]})},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getWindow().percent},t.prototype.getValueRange=function(e,t){if(e==null&&t==null){var n=this.findRepresentativeAxisProxy();if(n)return n.getWindow().value}else return this.getAxisProxy(e,t).getWindow().value},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return QO(e);for(var t,n=this._targetAxisInfoMap.keys(),r=0;r<n.length;r++)for(var i=n[r],a=this._targetAxisInfoMap.get(i),o=0;o<a.indexList.length;o++){var s=this.getAxisProxy(i,a.indexList[o]);if(s.hostedBy(this))return s;t||=s}return t},t.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},t.prototype.getOrient=function(){return this._orient},t.type=`dataZoom`,t.dependencies=[`xAxis`,`yAxis`,`radiusAxis`,`angleAxis`,`singleAxis`,`series`,`toolbox`],t.defaultOption={z:4,filterMode:`filter`,start:0,end:100},t}(TH),lZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n,r){this.dataZoomModel=e,this.ecModel=t,this.api=n},t.type=`dataZoom`,t}(xK),uZ=function(){function e(e,t,n,r){this._dimName=e,this._axisIndex=t,this.ecModel=r,this._dataZoomModel=n}return e.prototype.hostedBy=function(e){return this._dataZoomModel===e},e.prototype.getWindow=function(){return ka(this._window)},e.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries(function(t){if(qO(t)){var n=JO(this._dimName),r=t.getReferringComponents(n,PR).models[0];r&&this._axisIndex===r.componentIndex&&e.push(t)}},this),e},e.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+`Axis`,this._axisIndex)},e.prototype.getMinMaxSpan=function(){return ka(this._minMaxSpan)},e.prototype.calculateDataWindow=function(e){var t=this._extent,n=this.getAxisModel().axis,r=n.scale,i=this._dataZoomModel.getRangePropMode(),a=[0,100],o=[],s=[],c,l=[!1,!1];L([`start`,`end`],function(n,u){var d=e[n],f=e[n+`Value`];i[u]===`percent`?(d??=a[u],f=Nl(d,a,t),l[u]=!0):(c=!0,f==null?f=t[u]:(f=r.parse(f),r.sanitize&&(f=r.sanitize(f,t))),d=Nl(f,t,a)),s[u]=f==null||isNaN(f)?t[u]:f,o[u]=d==null||isNaN(d)?a[u]:d}),zl(s),zl(o);var u=this._minMaxSpan;c?d(s,o,t,a,!1):d(o,s,a,t,!0);function d(e,t,n,r,i){var a=i?`Span`:`ValueSpan`;$E(0,e,n,`all`,u[`min`+a],u[`max`+a]);for(var o=0;o<2;o++)t[o]=Nl(e[o],n,r,!0),i&&(t[o]=t[o],l[o]=!0);Gu(t)}var f=m_(r)||f_(r),p=n.getExtent(),m=gR(p[1]-p[0]),h=f?0:Hl(s,m,.5);L([[0,yR],[1,vR]],function(e){var n=e[0],r=e[1];l[n]&&isFinite(h)&&(s[n]=Rl(s[n],h),s[n]=mR(t[1],hR(t[0],s[n])),o[n]===a[n]&&(s[n]=t[n],f&&(s[n]=r(s[n]))))}),Gu(s);var g=[Nl(s[0],t,a,!0),Nl(s[1],t,a,!0)];return Gu(g),{value:s,percent:o,percentInverted:g,valuePrecision:h}},e.prototype.reset=function(e,t){if(this.hostedBy(e)){var n=this.getAxisModel().axis;Gy(n,2);var r=n.scale.rawExtentInfo;this._extent=r.makeNoZoom(),this._updateMinMaxSpan();var i=e.settledOption;t&&(i=Ma({start:t[0],end:t[1]},i));var a=this._window=this.calculateDataWindow(i),o=a.percent,s=a.value;o[0]!==0&&r.setZoomMM(0,s[0]),o[1]!==100&&r.setZoomMM(1,s[1])}},e.prototype.filterData=function(e,t){if(!this.hostedBy(e))return;var n=this._dimName,r=this.getTargetSeriesModels(),i=e.get(`filterMode`),a=this._window.value;if(i===`none`)return;L(r,function(e){var t=e.getData(),r=t.mapDimensionsAll(n);if(r.length){if(i===`weakFilter`){var s=t.getStore(),c=R(r,function(e){return t.getDimensionIndex(e)},t);t.filterSelf(function(e){for(var t,n,i,o=0;o<r.length;o++){var l=s.get(c[o],e),u=!isNaN(l),d=l<a[0],f=l>a[1];if(u&&!d&&!f)return!0;u&&(i=!0),d&&(t=!0),f&&(n=!0)}return i&&t&&n})}else L(r,function(n){if(i===`empty`)e.setData(t=t.map(n,function(e){return o(e)?e:NaN}));else{var r={};r[n]=a,t.selectRange(r)}});L(r,function(e){t.setApproximateExtent(a,e)})}});function o(e){return e>=a[0]&&e<=a[1]}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._extent;L([`min`,`max`],function(r){var i=t.get(r+`Span`),a=t.get(r+`ValueSpan`);a!=null&&(a=this.getAxisModel().axis.scale.parse(a)),a==null?i!=null&&(a=Nl(i,[0,100],n,!0)-n[0]):i=Nl(n[0]+a,n,[0,100],!0),e[r+`Span`]=i,e[r+`ValueSpan`]=a},this)},e}(),dZ={dirtyOnOverallProgress:!0,getTargetSeries:function(e){function t(t){e.eachComponent(`dataZoom`,function(n){n.eachTargetAxis(function(r,i){t(r,i,e.getComponent(JO(r),i),n)})})}var n=[];t(function(t,r,i,a){if(!QO(i)){var o=new uZ(t,r,a,e);n.push(o),$O(i,o)}});var r=W();return L(n,function(e){L(e.getTargetSeriesModels(),function(e){r.set(e.uid,e)})}),r},overallReset:function(e,t){e.eachComponent(`dataZoom`,function(e){var n=[];e.eachTargetAxis(function(t,r){var i=e.getAxisProxy(t,r),a=ek(e,i);a?n.push([i,a]):i.reset(e,null)}),L(n,function(t){t[0].reset(e,t[1].getWindow().percentInverted)}),e.eachTargetAxis(function(n,r){e.getAxisProxy(n,r).filterData(e,t)})}),e.eachComponent(`dataZoom`,function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getWindow(),r=n.percent,i=n.value;e.setCalculatedRange({start:r[0],end:r[1],startValue:i[0],endValue:i[1]})}})}},fZ=Ku(),pZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`tooltip`,t.dependencies=[`axisPointer`],t.defaultOption={z:60,show:!0,showContent:!0,trigger:`item`,triggerOn:`mousemove|click|mousewheel`,alwaysShowContent:!1,renderMode:`auto`,confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,displayTransition:!0,enterable:!1,backgroundColor:X.color.neutral00,shadowBlur:10,shadowColor:`rgba(0, 0, 0, .2)`,shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:X.color.border,padding:null,extraCssText:``,axisPointer:{type:`line`,axis:`auto`,animation:`auto`,animationDurationUpdate:200,animationEasingUpdate:`exponentialOut`,crossStyle:{color:X.color.borderShade,width:1,type:`dashed`,textStyle:{}}},textStyle:{color:X.color.tertiary,fontSize:14}},t}(TH),mZ=ok([`transform`,`webkitTransform`,`OTransform`,`MozTransform`,`msTransform`]),hZ=ok([`webkitTransition`,`transition`,`OTransition`,`MozTransition`,`msTransition`]),gZ=sk(hZ,`transition`),_Z=sk(mZ,`transform`),vZ=`position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;`+(dF.transform3dSupported?`will-change:transform;`:``),yZ=function(){function e(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,dF.wxa)return null;var n=document.createElement(`div`);n.domBelongToZr=!0,this.el=n;var r=this._zr=e.getZr(),i=t.appendTo,a=i&&(V(i)?document.querySelector(i):qa(i)?i:B(i)&&i(e.getDom()));hk(this._styleCoord,r,a,e.getWidth()/2,e.getHeight()/2),(a||e.getDom()).appendChild(n),this._api=e,this._container=a;var o=this;n.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},n.onmousemove=function(e){if(e||=window.event,!o._enterable){var t=r.handler;px(r.painter.getViewportRoot(),e,!0),t.dispatch(`mousemove`,e)}},n.onmouseleave=function(){o._inContent=!1,o._enterable&&o._show&&o.hideLater(o._hideDelay)}}return e.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),n=ck(t,`position`),r=t.style;r.position!==`absolute`&&n!==`absolute`&&(r.position=`relative`)}var i=e.get(`alwaysShowContent`);i&&this._moveIfResized(),this._alwaysShowContent=i,this._enableDisplayTransition=e.get(`displayTransition`)&&e.get(`transitionDuration`)>0,this.el.className=e.get(`className`)||``},e.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,r=n.style,i=this._styleCoord;n.innerHTML?r.cssText=vZ+mk(e,!this._firstShow,this._longHide,this._enableDisplayTransition)+fk(i[0],i[1],!0)+(`border-color:`+hh(t)+`;`)+(e.get(`extraCssText`)||``)+(`;pointer-events:`+(this._enterable?`auto`:`none`)):r.display=`none`,this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,t,n,r,i){var a=this.el;if(e==null)a.innerHTML=``;else{var o=``;if(V(i)&&n.get(`trigger`)===`item`&&!ak(n)&&(o=uk(n,r,i)),V(e))a.innerHTML=e+o;else if(e){a.innerHTML=``,z(e)||(e=[e]);for(var s=0;s<e.length;s++)qa(e[s])&&e[s].parentNode!==a&&a.appendChild(e[s]);if(o&&a.childNodes.length){var c=document.createElement(`div`);c.innerHTML=o,a.appendChild(c)}}}},e.prototype.setEnterable=function(e){this._enterable=e},e.prototype.getSize=function(){var e=this.el;return e?[e.offsetWidth,e.offsetHeight]:[0,0]},e.prototype.moveTo=function(e,t){if(this.el){var n=this._styleCoord;if(hk(n,this._zr,this._container,e,t),n[0]!=null&&n[1]!=null){var r=this.el.style;L(fk(n[0],n[1]),function(e){r[e[0]]=e[1]})}}},e.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},e.prototype.hide=function(){var e=this,t=this.el.style;this._enableDisplayTransition?(t.visibility=`hidden`,t.opacity=`0`):t.display=`none`,dF.transform3dSupported&&(t.willChange=``),this._show=!1,this._longHideTimeout=setTimeout(function(){return e._longHide=!0},500)},e.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(q(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var e=this._zr;wm(e&&e.painter&&e.painter.getViewportRoot(),this._container);var t=this.el;if(t){t.onmouseenter=t.onmousemove=t.onmouseleave=null;var n=t.parentNode;n&&n.removeChild(t)}this.el=this._container=null},e}(),bZ=function(){function e(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),vk(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return e.prototype.update=function(e){var t=e.get(`alwaysShowContent`);t&&this._moveIfResized(),this._alwaysShowContent=t},e.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},e.prototype.setContent=function(e,t,n,r,i){var a=this;H(e)&&ou(``),this.el&&this._zr.remove(this.el);var o=n.getModel(`textStyle`);this.el=new cR({style:{rich:t.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:r,textShadowColor:o.get(`textShadowColor`),fill:n.get([`textStyle`,`color`]),padding:cg(n,`richText`),verticalAlign:`top`,align:`left`},z:n.get(`z`)}),L([`backgroundColor`,`borderRadius`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`],function(e){a.el.style[e]=n.get(e)}),L([`textShadowBlur`,`textShadowOffsetX`,`textShadowOffsetY`],function(e){a.el.style[e]=o.get(e)||0}),this._zr.add(this.el);var s=this;this.el.on(`mouseover`,function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0}),this.el.on(`mouseout`,function(){s._enterable&&s._show&&s.hideLater(s._hideDelay),s._inContent=!1})},e.prototype.setEnterable=function(e){this._enterable=e},e.prototype.getSize=function(){var e=this.el,t=this.el.getBoundingRect(),n=_k(e.style);return[t.width+n.left+n.right,t.height+n.top+n.bottom]},e.prototype.moveTo=function(e,t){var n=this.el;if(n){var r=this._styleCoord;vk(r,this._zr,e,t),e=r[0],t=r[1];var i=n.style,a=gk(i.borderWidth||0),o=_k(i);n.x=e+a+o.left,n.y=t+a+o.top,n.markRedraw()}},e.prototype._moveIfResized=function(){var e=this._styleCoord[2],t=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),t*this._zr.getHeight())},e.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},e.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(q(this.hide,this),e)):this.hide())},e.prototype.isShow=function(){return this._show},e.prototype.dispose=function(){this._zr.remove(this.el)},e}(),xZ=new rR({shape:{x:-1,y:-1,width:2,height:2}}),SZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(e,t){if(!dF.node&&t.getDom()){var n=e.getComponent(`tooltip`),r=this._renderMode=Pu(n.get(`renderMode`));this._tooltipContent=r===`richText`?new bZ(t):new yZ(t,{appendTo:n.get(`appendToBody`,!0)?`body`:n.get(`appendTo`,!0)})}},t.prototype.render=function(e,t,n){if(!dF.node&&n.getDom()){this.group.removeAll(),this._tooltipModel=e,this._ecModel=t,this._api=n;var r=this._tooltipContent;r.update(e),r.setEnterable(e.get(`enterable`)),this._initGlobalListener(),this._keepShow(),this._renderMode!==`richText`&&e.get(`transitionDuration`)?gb(this,`_updatePosition`,50,`fixRate`):_b(this,`_updatePosition`)}},t.prototype._initGlobalListener=function(){var e=this._tooltipModel.get(`triggerOn`);dO(`itemTooltip`,this._api,q(function(t,n,r){e!==`none`&&(e.indexOf(t)>=0?this._tryShow(n,r):t===`leave`&&this._hide(r))},this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api,r=e.get(`triggerOn`);if(e.get(`trigger`)!==`axis`&&(this._lastDataByCoordSys=null,this._cbParamsList=null),this._lastX!=null&&this._lastY!=null&&r!==`none`&&r!==`click`){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&i.manuallyShowTip(e,t,n,{x:i._lastX,y:i._lastY,dataByCoordSys:i._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(e,t,n,r){if(r.from!==this.uid&&!dF.node&&n.getDom()){var i=bk(r,n);this._ticket=``;var a=r.dataByCoordSys,o=Tk(r,t,n);if(o){var s=o.el.getBoundingRect().clone();s.applyTransform(o.el.transform),this._tryShow({offsetX:s.x+s.width/2,offsetY:s.y+s.height/2,target:o.el,position:r.position,positionDefault:`bottom`},i)}else if(r.tooltip&&r.x!=null&&r.y!=null){var c=xZ;c.x=r.x,c.y=r.y,c.update(),LR(c).tooltipConfig={name:null,option:r.tooltip},this._tryShow({offsetX:r.x,offsetY:r.y,target:c},i)}else if(a)this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,dataByCoordSys:a,tooltipOption:r.tooltipOption},i);else if(r.seriesIndex!=null){if(this._manuallyAxisShowTip(e,t,n,r))return;var l=vO(r,t),u=l.point[0],d=l.point[1];u!=null&&d!=null&&this._tryShow({offsetX:u,offsetY:d,target:l.el,position:r.position,positionDefault:`bottom`},i)}else r.x!=null&&r.y!=null&&(n.dispatchAction({type:`updateAxisPointer`,x:r.x,y:r.y}),this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,target:n.getZr().findHover(r.x,r.y).target},i))}},t.prototype.manuallyHideTip=function(e,t,n,r){var i=this._tooltipContent;this._tooltipModel&&i.hideLater(this._tooltipModel.get(`hideDelay`)),this._lastX=this._lastY=this._lastDataByCoordSys=null,this._cbParamsList=null,r.from!==this.uid&&this._hide(bk(r,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,r){var i=r.seriesIndex,a=r.dataIndex,o=t.getComponent(`axisPointer`).coordSysAxesInfo;if(i!=null&&a!=null&&o!=null){var s=t.getSeriesByIndex(i);if(s&&yk([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model],this._tooltipModel).get(`trigger`)===`axis`)return n.dispatchAction({type:`updateAxisPointer`,seriesIndex:i,dataIndex:a,position:r.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var r=e.dataByCoordSys;if(r&&r.length)this._showAxisTooltip(r,e);else if(n){if(LR(n).ssrType===`legend`)return;this._lastDataByCoordSys=null,this._cbParamsList=null;var i,a;WS(n,function(e){if(e.tooltipDisabled)return i=a=null,!0;i||a||(LR(e).dataIndex==null?LR(e).tooltipConfig!=null&&(a=e):i=e)},!0),i?this._showSeriesItemTooltip(e,i,t):a?this._showComponentItemTooltip(e,a,t):this._hide(t)}else this._lastDataByCoordSys=null,this._cbParamsList=null,this._hide(t)}},t.prototype._showOrMove=function(e,t){var n=e.get(`showDelay`);t=q(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,r=this._tooltipModel,i=[t.offsetX,t.offsetY],a=yk([t.tooltipOption],r),o=this._renderMode,s=[],c=Yh(`section`,{blocks:[],noHeader:!0}),l=[],u=new VH;L(e,function(e){L(e.dataByAxis,function(e){var t=n.getComponent(e.axisDim+`Axis`,e.axisIndex),i=e.value,a=t.axis,d=a.scale.parse(i);if(t&&i!=null){var f=nO(i,a,n,e.seriesDataIndices,e.valueLabelOpt),p=Yh(`section`,{header:f,noHeader:!no(f),sortBlocks:!0,blocks:[]});c.blocks.push(p),L(e.seriesDataIndices,function(i){var a=n.getSeriesByIndex(i.seriesIndex),c=i.dataIndexInside,m=a.getDataParams(c);if(!(m.dataIndex<0)){m.axisDim=e.axisDim,m.axisIndex=e.axisIndex,m.axisType=e.axisType,m.axisId=e.axisId,m.axisValue=L_(t.axis,{value:d}),m.axisValueLabel=f,m.marker=u.makeTooltipMarker(`item`,hh(m.color),o);var h=Ph(a.formatTooltip(c,!0,null)),g=h.frag;if(g){var _=yk([a],r).get(`valueFormatter`);p.blocks.push(_?I({valueFormatter:_},g):g)}h.text&&l.push(h.text),s.push(m)}})}})}),c.blocks.reverse(),l.reverse();var d=t.position,f=eg(c,u,o,a.get(`order`),n.get(`useUTC`),a.get(`textStyle`));f&&l.unshift(f);var p=o===`richText`?`
39
39
 
40
40
  `:`<br/>`,m=l.join(p);this._showOrMove(a,function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(a,d,i[0],i[1],this._tooltipContent,s):this._showTooltipContent(a,m,s,Math.random()+``,i[0],i[1],d,null,u)})},t.prototype._showSeriesItemTooltip=function(e,t,n){var r=this._ecModel,i=LR(t),a=i.seriesIndex,o=r.getSeriesByIndex(a),s=i.dataModel||o,c=i.dataIndex,l=i.dataType,u=s.getData(l),d=this._renderMode,f=e.positionDefault,p=yk([u.getItemModel(c),s,o&&(o.coordinateSystem||{}).model],this._tooltipModel,f?{position:f}:null),m=p.get(`trigger`);if(m==null||m===`item`){var h=s.getDataParams(c,l),g=new VH;h.marker=g.makeTooltipMarker(`item`,hh(h.color),d);var _=Ph(s.formatTooltip(c,!1,l)),v=p.get(`order`),y=p.get(`valueFormatter`),b=_.frag,x=b?eg(y?I({valueFormatter:y},b):b,g,d,v,r.get(`useUTC`),p.get(`textStyle`)):_.text,S=`item_`+s.name+`_`+c;this._showOrMove(p,function(){this._showTooltipContent(p,x,h,S,e.offsetX,e.offsetY,e.position,e.target,g)}),n({type:`showTip`,dataIndexInside:c,dataIndex:u.getRawIndex(c),seriesIndex:a,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var r=this._renderMode===`html`,i=LR(t),a=i.tooltipConfig.option||{},o=a.encodeHTMLContent;if(V(a)){var s=a;a={content:s,formatter:s},o=!0}o&&r&&a.content&&(a=ka(a),a.content=km(a.content));var c=[a],l=this._ecModel.getComponent(i.componentMainType,i.componentIndex);l&&c.push(l),c.push({formatter:a.content});var u=e.positionDefault,d=yk(c,this._tooltipModel,u?{position:u}:null),f=d.get(`content`),p=Math.random()+``,m=new VH;this._showOrMove(d,function(){var n=ka(d.get(`formatterParams`)||{});this._showTooltipContent(d,f,n,p,e.offsetX,e.offsetY,e.position,t,m)}),n({type:`showTip`,from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,r,i,a,o,s,c){if(this._ticket=``,e.get(`showContent`)&&e.get(`show`)){var l=this._tooltipContent;l.setEnterable(e.get(`enterable`));var u=e.get(`formatter`);o||=e.get(`position`);var d=t,f=this._getNearestPoint([i,a],n,e.get(`trigger`),e.get(`borderColor`),e.get(`defaultBorderColor`,!0)).color;if(u){if(V(u)){var p=e.ecModel.get(`useUTC`),m=z(n)?n[0]:n,h=m&&m.axisType&&m.axisType.indexOf(`time`)>=0;d=u,h&&(d=Gm(m.axisValue,d,p)),d=fh(d,n,!0)}else if(B(u)){var g=q(function(t,r){t===this._ticket&&(l.setContent(r,c,e,f,o),this._updatePosition(e,o,i,a,l,n,s))},this);this._ticket=r,d=u(n,r,g)}else d=u}l.setContent(d,c,e,f,o),l.show(e,f),this._updatePosition(e,o,i,a,l,n,s)}},t.prototype._getNearestPoint=function(e,t,n,r,i){if(n===`axis`||z(t))return{color:r||i};if(!z(t))return{color:r||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,r,i,a,o){var s=this._api.getWidth(),c=this._api.getHeight();t||=e.get(`position`);var l=i.getSize(),u=e.get(`align`),d=e.get(`verticalAlign`),f=o&&o.getBoundingRect().clone();if(o&&f.applyTransform(o.transform),B(t)&&(t=t([n,r],a,i.el,f,{viewSize:[s,c],contentSize:l.slice()})),z(t))n=Y(t[0],s),r=Y(t[1],c);else if(H(t)){var p=t;p.width=l[0],p.height=l[1];var m=xh(p,{width:s,height:c});n=m.x,r=m.y,u=null,d=null}else if(V(t)&&o){var h=Ck(t,f,l,e.get(`borderWidth`));n=h[0],r=h[1]}else{var h=xk(n,r,i,s,c,u?null:20,d?null:20);n=h[0],r=h[1]}if(u&&(n-=wk(u)?l[0]/2:u===`right`?l[0]:0),d&&(r-=wk(d)?l[1]/2:d===`bottom`?l[1]:0),ak(e)){var h=Sk(n,r,i,s,c);n=h[0],r=h[1]}i.moveTo(n,r)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,r=this._cbParamsList,i=!!n&&n.length===e.length;return i&&L(n,function(n,a){var o=n.dataByAxis||[],s=(e[a]||{}).dataByAxis||[];i&&=o.length===s.length,i&&L(o,function(e,n){var a=s[n]||{},o=e.seriesDataIndices||[],c=a.seriesDataIndices||[];i=i&&e.value===a.value&&e.axisType===a.axisType&&e.axisId===a.axisId&&o.length===c.length,i&&L(o,function(e,t){var n=c[t];i=i&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}),r&&L(e.seriesDataIndices,function(e){var n=e.seriesIndex,a=t[n],o=r[n];a&&o&&o.data!==a.data&&(i=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=t,!!i},t.prototype._hide=function(e){this._lastDataByCoordSys=null,this._cbParamsList=null,e({type:`hideTip`,from:this.uid})},t.prototype.dispose=function(e,t){!dF.node&&t.getDom()&&(_b(this,`_updatePosition`),this._tooltipContent.dispose(),_O(`itemTooltip`,t),this._tooltipContent=null,this._tooltipModel=null,this._lastDataByCoordSys=null,this._cbParamsList=null)},t.type=`tooltip`,t}(xK),CZ=L,wZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:`box`,ignoreSize:!0},n}return t.type=`title`,t.defaultOption={z:6,show:!0,text:``,target:`blank`,subtext:``,subtarget:`blank`,left:`center`,top:X.size.m,backgroundColor:X.color.transparent,borderColor:X.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:`bold`,color:X.color.primary},subtextStyle:{fontSize:12,color:X.color.quaternary}},t}(TH),TZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){if(this.group.removeAll(),e.get(`show`)){var r=this.group,i=e.getModel(`textStyle`),a=e.getModel(`subtextStyle`),o=e.get(`textAlign`),s=U(e.get(`textBaseline`),e.get(`textVerticalAlign`)),c=new cR({style:op(i,{text:e.get(`text`),fill:i.getTextColor()},{disableBox:!0}),z2:10}),l=c.getBoundingRect(),u=e.get(`subtext`),d=new cR({style:op(a,{text:u,fill:a.getTextColor(),y:l.height+e.get(`itemGap`),verticalAlign:`top`},{disableBox:!0}),z2:10}),f=e.get(`link`),p=e.get(`sublink`),m=e.get(`triggerEvent`,!0);c.silent=!f&&!m,d.silent=!p&&!m,f&&c.on(`click`,function(){gh(f,`_`+e.get(`target`))}),p&&d.on(`click`,function(){gh(p,`_`+e.get(`subtarget`))}),LR(c).eventData=LR(d).eventData=m?{componentType:`title`,componentIndex:e.componentIndex}:null,r.add(c),u&&r.add(d);var h=r.getBoundingRect(),g=e.getBoxLayoutParams();g.width=h.width,g.height=h.height;var _=xh(g,Sh(e,n).refContainer,e.get(`padding`));o||(o=e.get(`left`)||e.get(`right`),o===`middle`&&(o=`center`),o===`right`?_.x+=_.width:o===`center`&&(_.x+=_.width/2)),s||(s=e.get(`top`)||e.get(`bottom`),s===`center`&&(s=`middle`),s===`bottom`?_.y+=_.height:s===`middle`&&(_.y+=_.height/2),s||=`top`),r.x=_.x,r.y=_.y,r.markRedraw();var v={align:o,verticalAlign:s};c.setStyle(v),d.setStyle(v),h=r.getBoundingRect();var y=_.margin,b=e.getItemStyle([`color`,`opacity`]);b.fill=e.get(`backgroundColor`);var x=new rR({shape:{x:h.x-y[3],y:h.y-y[0],width:h.width+y[1]+y[3],height:h.height+y[0]+y[2],r:e.get(`borderRadius`)},style:b,subPixelOptimize:!0,silent:!0});r.add(x)}},t.type=`title`,t}(xK),EZ=Du(),DZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.createdBySelf=!1,n.preventAutoZ=!0,n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._mergeOption(e,n,!1,!0)},t.prototype.isAnimationEnabled=function(){if(dF.node)return!1;var e=this.__hostSeries;return this.getShallow(`animation`)&&e&&e.isAnimationEnabled()},t.prototype.mergeOption=function(e,t){this._mergeOption(e,t,!1,!1)},t.prototype._mergeOption=function(e,t,n,r){var i=this.mainType;n||t.eachSeries(function(e){var n=e.get(this.mainType,!0),a=EZ(e)[i];!n||!n.data?EZ(e)[i]=null:(a?a._mergeOption(n,t,!0):(r&&Nk(n),L(n.data,function(e){e instanceof Array?(Nk(e[0]),Nk(e[1])):Nk(e)}),a=this.createMarkerModelFromSeries(n,this,t),I(a,{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),a.__hostSeries=e),EZ(e)[i]=a)},this)},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.getRawValue(e),a=r.getName(e);return Yh(`section`,{header:this.name,blocks:[Yh(`nameValue`,{name:a,value:i,noName:!a,noValue:i==null})]})},t.prototype.getData=function(){return this._data},t.prototype.setData=function(e){this._data=e},t.prototype.getDataParams=function(e,t){var n=AH.prototype.getDataParams.call(this,e,t),r=this.__hostSeries;return r&&(n.seriesId=r.id,n.seriesName=r.name,n.seriesType=r.subType),n},t.getMarkerModelFromSeries=function(e,t){return EZ(e)[t]},t.type=`marker`,t.dependencies=[`series`,`grid`,`polar`,`geo`],t}(TH),Fa(DZ,AH.prototype),OZ={min:Ha(Ik,`min`),max:Ha(Ik,`max`),average:Ha(Ik,`average`),median:Ha(Ik,`median`)},kZ=Du(),AZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(){this.markerGroupMap=W()},t.prototype.render=function(e,t,n){var r=this,i=this.markerGroupMap;i.each(function(e){kZ(e).keep=!1}),t.eachSeries(function(e){var i=DZ.getMarkerModelFromSeries(e,r.type);i&&r.renderSeries(e,i,t,n)}),i.each(function(e){!kZ(e).keep&&r.group.remove(e.group)}),Uk(t,i,this.type)},t.prototype.markKeep=function(e){kZ(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;L(e,function(e){var r=DZ.getMarkerModelFromSeries(e,n.type);r&&r.getData().eachItemGraphicEl(function(e){e&&(t?Sd(e):Cd(e))})})},t.type=`marker`,t}(xK),jZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type=`markLine`,t.defaultOption={z:5,symbol:[`circle`,`arrow`],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:`item`},label:{show:!0,position:`end`,distance:5},lineStyle:{type:`dashed`},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:`linear`},t}(DZ),MZ=Du(),NZ=function(e,t,n,r){var i=e.getData(),a;if(z(r))a=r;else{var o=r.type;if(o===`min`||o===`max`||o===`average`||o===`median`||r.xAxis!=null||r.yAxis!=null){var s=void 0,c=void 0;if(r.yAxis!=null||r.xAxis!=null)s=t.getAxis(r.yAxis==null?`x`:`y`),c=Za(r.yAxis,r.xAxis);else{var l=Rk(r,i,t,e);s=l.valueAxis,c=Hk(i,dm(i,l.valueDataDim),o)}var u=s.dim===`x`?0:1,d=1-u,f=ka(r),p={coord:[]};f.type=null,f.coord=[],f.coord[d]=-1/0,p.coord[d]=1/0;var m=n.get(`precision`);m>=0&&Wa(c)&&(c=+c.toFixed(Math.min(m,20))),f.coord[u]=p.coord[u]=c,a=[f,p,{type:o,valueIndex:r.valueIndex,value:c}]}else a=[]}var h=[Lk(e,a[0]),Lk(e,a[1]),I({},a[2])];return h[2].type=h[2].type||null,Aa(h[2],h[0]),Aa(h[2],h[1]),h},PZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=DZ.getMarkerModelFromSeries(e,`markLine`);if(t){var r=t.getData(),i=MZ(t).from,a=MZ(t).to;i.each(function(t){qk(i,t,!0,e,n),qk(a,t,!1,e,n)}),r.each(function(e){r.setItemLayout(e,[i.getItemLayout(e),a.getItemLayout(e)])}),this.markerGroupMap.get(e.id).updateLayout()}},this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,c=s.get(a)||s.set(a,new sX);this.group.add(c.group);var l=Jk(i,e,t),u=l.from,d=l.to,f=l.line;MZ(t).from=u,MZ(t).to=d,t.setData(f);var p=t.get(`symbol`),m=t.get(`symbolSize`),h=t.get(`symbolRotate`),g=t.get(`symbolOffset`);z(p)||(p=[p,p]),z(m)||(m=[m,m]),z(h)||(h=[h,h]),z(g)||(g=[g,g]),l.from.each(function(e){_(u,e,!0),_(d,e,!1)}),f.each(function(e){var t=f.getItemModel(e),n=t.getModel(`lineStyle`).getLineStyle();f.setItemLayout(e,[u.getItemLayout(e),d.getItemLayout(e)]);var r=t.get(`z2`);n.stroke??=u.getItemVisual(e,`style`).fill,f.setItemVisual(e,{z2:U(r,0),fromSymbolKeepAspect:u.getItemVisual(e,`symbolKeepAspect`),fromSymbolOffset:u.getItemVisual(e,`symbolOffset`),fromSymbolRotate:u.getItemVisual(e,`symbolRotate`),fromSymbolSize:u.getItemVisual(e,`symbolSize`),fromSymbol:u.getItemVisual(e,`symbol`),toSymbolKeepAspect:d.getItemVisual(e,`symbolKeepAspect`),toSymbolOffset:d.getItemVisual(e,`symbolOffset`),toSymbolRotate:d.getItemVisual(e,`symbolRotate`),toSymbolSize:d.getItemVisual(e,`symbolSize`),toSymbol:d.getItemVisual(e,`symbol`),style:n})}),c.updateData(f),l.line.eachItemGraphicEl(function(e){LR(e).dataModel=t,e.traverse(function(e){LR(e).dataModel=t})});function _(t,n,i){var a=t.getItemModel(n);qk(t,n,i,e,r);var s=a.getModel(`itemStyle`).getItemStyle();s.fill??=HS(o,`color`),t.setItemVisual(n,{symbolKeepAspect:a.get(`symbolKeepAspect`),symbolOffset:U(a.get(`symbolOffset`,!0),g[+!i]),symbolRotate:U(a.get(`symbolRotate`,!0),h[+!i]),symbolSize:U(a.get(`symbolSize`),m[+!i]),symbol:U(a.get(`symbol`,!0),p[+!i]),style:s})}this.markKeep(c),c.group.silent=t.get(`silent`)||e.get(`silent`)},t.type=`markLine`,t}(AZ),FZ=function(e,t){if(t===`all`)return{type:`all`,title:e.getLocaleModel().get([`legend`,`selector`,`all`])};if(t===`inverse`)return{type:`inverse`,title:e.getLocaleModel().get([`legend`,`selector`,`inverse`])}},IZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:`box`,ignoreSize:!0},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),this._updateSelector(t)},t.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;t===!0&&(t=e.selector=[`all`,`inverse`]),z(t)&&L(t,function(e,r){V(e)&&(e={type:e}),t[r]=Aa(e,FZ(n,e.type))})},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&this.get(`selectedMode`)===`single`){for(var t=!1,n=0;n<e.length;n++){var r=e[n].get(`name`);if(this.isSelected(r)){this.select(r),t=!0;break}}!t&&this.select(e[0].get(`name`))}},t.prototype._updateData=function(e){var t=[],n=[];e.eachRawSeries(function(r){var i=r.name;n.push(i);var a;if(r.legendVisualProvider){var o=r.legendVisualProvider.getAllNames();e.isSeriesFiltered(r)||(n=n.concat(o)),o.length?t=t.concat(o):a=!0}else a=!0;a&&Su(r)&&t.push(r.name)}),this._availableNames=n;var r=this.get(`data`)||t,i=W(),a=R(r,function(e){return(V(e)||Wa(e))&&(e={name:e}),i.get(e.name)?null:(i.set(e.name,!0),new HB(e,this,this.ecModel))},this);this._data=Ra(a,function(e){return!!e})},t.prototype.getData=function(){return this._data},t.prototype.select=function(e){var t=this.option.selected;if(this.get(`selectedMode`)===`single`){var n=this._data;L(n,function(e){t[e.get(`name`)]=!1})}t[e]=!0},t.prototype.unSelect=function(e){this.get(`selectedMode`)!==`single`&&(this.option.selected[e]=!1)},t.prototype.toggleSelected=function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?`unSelect`:`select`](e)},t.prototype.allSelect=function(){var e=this._data,t=this.option.selected;L(e,function(e){t[e.get(`name`,!0)]=!0})},t.prototype.inverseSelect=function(){var e=this._data,t=this.option.selected;L(e,function(e){var n=e.get(`name`,!0);t.hasOwnProperty(n)||(t[n]=!0),t[n]=!t[n]})},t.prototype.isSelected=function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&&Na(this._availableNames,e)>=0},t.prototype.getOrient=function(){return this.get(`orient`)===`vertical`?{index:1,name:`vertical`}:{index:0,name:`horizontal`}},t.type=`legend.plain`,t.dependencies=[`series`],t.defaultOption={z:4,show:!0,orient:`horizontal`,left:`center`,bottom:X.size.m,align:`auto`,backgroundColor:X.color.transparent,borderColor:X.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:`inherit`,symbolKeepAspect:!0,inactiveColor:X.color.disabled,inactiveBorderColor:X.color.disabled,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:X.color.disabled,inactiveWidth:2,opacity:`inherit`,type:`inherit`,cap:`inherit`,join:`inherit`,dashOffset:`inherit`,miterLimit:`inherit`},textStyle:{color:X.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:`sans-serif`,color:X.color.tertiary,borderWidth:1,borderColor:X.color.border},emphasis:{selectorLabel:{show:!0,color:X.color.quaternary}},selectorPosition:`auto`,selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t}(TH),LZ=Ha,RZ=L,zZ=Sz,BZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return t.prototype.init=function(){this.group.add(this._contentGroup=new zZ),this.group.add(this._selectorGroup=new zZ),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get(`show`,!0)){var i=e.get(`align`),a=e.get(`orient`);i&&i!==`auto`||(i=e.get(`left`)===`right`&&a===`vertical`?`right`:`left`);var o=e.get(`selector`,!0),s=e.get(`selectorPosition`,!0);o&&(!s||s===`auto`)&&(s=a===`horizontal`?`end`:`start`),this.renderInner(i,e,t,n,o,a,s);var c=Sh(e,n).refContainer,l=e.getBoxLayoutParams(),u=e.get(`padding`),d=xh(l,c,u),f=this.layoutInner(e,i,d,r,o,s),p=xh(Ma({width:f.width,height:f.height},l),c,u);this.group.x=p.x-f.x,this.group.y=p.y-f.y,this.group.markRedraw(),this.group.add(this._backgroundEl=ik(f,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,r,i,a,o){var s=this.getContentGroup(),c=W(),l=t.get(`selectedMode`),u=t.get(`triggerEvent`),d=[];n.eachRawSeries(function(e){!e.get(`legendHoverLink`)&&d.push(e.id)}),RZ(t.getData(),function(i,a){var o=this,f=i.get(`name`);if(!this.newlineDisabled&&(f===``||f===`
41
- `)){var p=new zZ;p.newline=!0,s.add(p)}else{var m=n.getSeriesByName(f)[0];if(!c.get(f)){if(m){var h=m.getData(),g=h.getVisual(`legendLineStyle`)||{},_=h.getVisual(`legendIcon`),v=h.getVisual(`style`),y=this._createItem(m,f,a,i,t,e,g,v,_,l,r);y.on(`click`,LZ(Qk,f,null,r,d)).on(`mouseover`,LZ($k,m.name,null,r,d)).on(`mouseout`,LZ(eA,m.name,null,r,d)),n.ssr&&y.eachChild(function(e){var t=LR(e);t.seriesIndex=m.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&y.eachChild(function(e){o.packEventData(e,t,m,a,f)}),c.set(f,!0)}else n.eachRawSeries(function(o){var s=this;if(!c.get(f)&&o.legendVisualProvider){var p=o.legendVisualProvider;if(!p.containName(f))return;var m=p.indexOfName(f),h=p.getItemVisual(m,`style`),g=p.getItemVisual(m,`legendIcon`),_=ec(h.fill);_&&_[3]===0&&(_[3]=.2,h=I(I({},h),{fill:cc(_,`rgba`)}));var v=this._createItem(o,f,a,i,t,e,{},h,g,l,r);v.on(`click`,LZ(Qk,null,f,r,d)).on(`mouseover`,LZ($k,null,f,r,d)).on(`mouseout`,LZ(eA,null,f,r,d)),n.ssr&&v.eachChild(function(e){var t=LR(e);t.seriesIndex=o.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&v.eachChild(function(e){s.packEventData(e,t,o,a,f)}),c.set(f,!0)}},this)}}},this),i&&this._createSelector(i,t,r,a,o)},t.prototype.packEventData=function(e,t,n,r,i){var a={componentType:`legend`,componentIndex:t.componentIndex,dataIndex:r,value:i,seriesIndex:n.seriesIndex};LR(e).eventData=a},t.prototype._createSelector=function(e,t,n,r,i){var a=this.getSelectorGroup();RZ(e,function(e){var r=e.type,i=new cR({style:{x:0,y:0,align:`center`,verticalAlign:`middle`},onclick:function(){n.dispatchAction({type:r===`all`?`legendAllSelect`:`legendInverseSelect`,legendId:t.id})}});a.add(i),ip(i,{normal:t.getModel(`selectorLabel`),emphasis:t.getModel([`emphasis`,`selectorLabel`])},{defaultText:e.title}),Nd(i)})},t.prototype._createItem=function(e,t,n,r,i,a,o,s,c,l,u){var d=e.visualDrawType,f=i.get(`itemWidth`),p=i.get(`itemHeight`),m=i.isSelected(t),h=r.get(`symbolRotate`),g=r.get(`symbolKeepAspect`),_=r.get(`icon`);c=_||c||`roundRect`;var v=Xk(c,r,o,s,d,m,u),y=new zZ,b=r.getModel(`textStyle`);if(B(e.getLegendIcon)&&(!_||_===`inherit`))y.add(e.getLegendIcon({itemWidth:f,itemHeight:p,icon:c,iconRotate:h,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}));else{var x=_===`inherit`&&e.getData().getVisual(`symbol`)?h===`inherit`?e.getData().getVisual(`symbolRotate`):h:0;y.add(Zk({itemWidth:f,itemHeight:p,icon:c,iconRotate:x,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}))}var S=a===`left`?f+5:-5,C=a,w=i.get(`formatter`),T=t;V(w)&&w?T=w.replace(`{name}`,t??``):B(w)&&(T=w(t));var E=m?b.getTextColor():r.get(`inactiveColor`);y.add(new cR({style:op(b,{text:T,x:S,y:p/2,fill:E,align:C,verticalAlign:`middle`},{inheritColor:E})}));var D=new rR({shape:y.getBoundingRect(),style:{fill:`transparent`}}),O=r.getModel(`tooltip`);return O.get(`show`)&&Uf({el:D,componentModel:i,itemName:t,itemTooltipOption:O.option}),y.add(D),y.eachChild(function(e){e.silent=!0}),D.silent=!l,this.getContentGroup().add(y),Nd(y),y.__legendDataIndex=n,y},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getContentGroup(),s=this.getSelectorGroup();SH(e.get(`orient`),o,e.get(`itemGap`),n.width,n.height);var c=o.getBoundingRect(),l=[-c.x,-c.y];if(s.markRedraw(),o.markRedraw(),i){SH(`horizontal`,s,e.get(`selectorItemGap`,!0));var u=s.getBoundingRect(),d=[-u.x,-u.y],f=e.get(`selectorButtonGap`,!0),p=e.getOrient().index,m=p===0?`width`:`height`,h=p===0?`height`:`width`,g=p===0?`y`:`x`;a===`end`?d[p]+=c[m]+f:l[p]+=u[m]+f,d[1-p]+=c[h]/2-u[h]/2,s.x=d[0],s.y=d[1],o.x=l[0],o.y=l[1];var _={x:0,y:0};return _[m]=c[m]+f+u[m],_[h]=Math.max(c[h],u[h]),_[g]=Math.min(0,u[g]+d[1-p]),_}return o.x=l[0],o.y=l[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type=`legend.plain`,t}(xK),VZ=$u(iA),HZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(t,n,r){var i=Dh(t);e.prototype.init.call(this,t,n,r),oA(this,t,i)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),oA(this,this.option,t)},t.type=`legend.scroll`,t.defaultOption=bm(IZ.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:X.color.accent50,pageIconInactiveColor:X.color.accent10,pageIconSize:15,pageTextStyle:{color:X.color.tertiary},animationDurationUpdate:800}),t}(IZ),UZ=Sz,WZ=[`width`,`height`],GZ=[`x`,`y`],KZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!0,n._currentIndex=0,n}return t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new UZ),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new UZ)},t.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},t.prototype.renderInner=function(t,n,r,i,a,o,s){var c=this;e.prototype.renderInner.call(this,t,n,r,i,a,o,s);var l=this._controllerGroup,u=n.get(`pageIconSize`,!0),d=z(u)?u:[u,u];p(`pagePrev`,0);var f=n.getModel(`pageTextStyle`);l.add(new cR({name:`pageText`,style:{text:`xx/xx`,fill:f.getTextColor(),font:f.getFont(),verticalAlign:`middle`,align:`center`},silent:!0})),p(`pageNext`,1);function p(e,t){var r=e+`DataIndex`,a=If(n.get(`pageIcons`,!0)[n.getOrient().name][t],{onclick:q(c._pageGo,c,r,n,i)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});a.name=e,l.add(a)}},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getSelectorGroup(),s=e.getOrient().index,c=WZ[s],l=GZ[s],u=WZ[1-s],d=GZ[1-s];i&&SH(`horizontal`,o,e.get(`selectorItemGap`,!0));var f=e.get(`selectorButtonGap`,!0),p=o.getBoundingRect(),m=[-p.x,-p.y],h=ka(n);i&&(h[c]=n[c]-p[c]-f);var g=this._layoutContentAndController(e,r,h,s,c,u,d,l);if(i){if(a===`end`)m[s]+=g[c]+f;else{var _=p[c]+f;m[s]-=_,g[l]-=_}g[c]+=p[c]+f,m[1-s]+=g[d]+g[u]/2-p[u]/2,g[u]=Math.max(g[u],p[u]),g[d]=Math.min(g[d],p[d]+m[1-s]),o.x=m[0],o.y=m[1],o.markRedraw()}return g},t.prototype._layoutContentAndController=function(e,t,n,r,i,a,o,s){var c=this.getContentGroup(),l=this._containerGroup,u=this._controllerGroup;SH(e.get(`orient`),c,e.get(`itemGap`),r?n.width:null,r?null:n.height),SH(`horizontal`,u,e.get(`pageButtonItemGap`,!0));var d=c.getBoundingRect(),f=u.getBoundingRect(),p=this._showController=d[i]>n[i],m=[-d.x,-d.y];t||(m[r]=c[s]);var h=[0,0],g=[-f.x,-f.y],_=U(e.get(`pageButtonGap`,!0),e.get(`itemGap`,!0));p&&(e.get(`pageButtonPosition`,!0)===`end`?g[r]+=n[i]-f[i]:h[r]+=f[i]+_),g[1-r]+=d[a]/2-f[a]/2,c.setPosition(m),l.setPosition(h),u.setPosition(g);var v={x:0,y:0};if(v[i]=p?n[i]:d[i],v[a]=Math.max(d[a],f[a]),v[o]=Math.min(0,f[o]+g[1-r]),l.__rectSize=n[i],p){var y={x:0,y:0};y[i]=Math.max(n[i]-f[i]-_,0),y[a]=v[a],l.setClipPath(new rR({shape:y})),l.__rectSize=y[i]}else u.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return b.pageIndex!=null&&df(c,{x:b.contentPosition[0],y:b.contentPosition[1]},p?e:null),this._updatePageInfoView(e,b),v},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];r!=null&&n.dispatchAction({type:`legendScroll`,scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;L([`pagePrev`,`pageNext`],function(r){var i=t[r+`DataIndex`]!=null,a=n.childOfName(r);a&&(a.setStyle(`fill`,i?e.get(`pageIconColor`,!0):e.get(`pageIconInactiveColor`,!0)),a.cursor=i?`pointer`:`default`)});var r=n.childOfName(`pageText`),i=e.get(`pageFormatter`),a=t.pageIndex,o=a==null?0:a+1,s=t.pageCount;r&&i&&r.setStyle(`text`,V(i)?i.replace(`{current}`,o==null?``:o+``).replace(`{total}`,s==null?``:s+``):i({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get(`scrollDataIndex`,!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,a=WZ[i],o=GZ[i],s=this._findTargetItemIndex(t),c=n.children(),l=c[s],u=c.length,d=+!!u,f={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!l)return f;var p=v(l);f.contentPosition[i]=-p.s;for(var m=s+1,h=p,g=p,_=null;m<=u;++m)_=v(c[m]),(!_&&g.e>h.s+r||_&&!y(_,h.s))&&(h=g.i>h.i?g:_,h&&(f.pageNextDataIndex??=h.i,++f.pageCount)),g=_;for(var m=s-1,h=p,g=p,_=null;m>=-1;--m)_=v(c[m]),(!_||!y(g,_.s))&&h.i<g.i&&(g=h,f.pagePrevDataIndex??=h.i,++f.pageCount,++f.pageIndex),h=_;return f;function v(e){if(e){var t=e.getBoundingRect(),n=t[o]+e[o];return{s:n,e:n+t[a],i:e.__legendDataIndex}}}function y(e,t){return e.e>=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var t,n=this.getContentGroup(),r;return n.eachChild(function(n,i){var a=n.__legendDataIndex;r==null&&a!=null&&(r=i),a===e&&(t=i)}),t??r},t.type=`legend.scroll`,t}(BZ),qZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.inside`,t.defaultOption=bm(cZ.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(cZ),JZ=Du(),YZ=function(e){F(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`dataZoom.inside`,t}return t.prototype.render=function(t,n,r){e.prototype.render.apply(this,arguments),t.noTarget()?this._clear():(this.range=t.getPercentRange(),uA(r,t,{pan:q(XZ.pan,this),zoom:q(XZ.zoom,this),scrollMove:q(XZ.scrollMove,this)}))},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){dA(this.api,this.dataZoomModel),this.range=null},t.type=`dataZoom.inside`,t}(lZ),XZ={zoom:function(e,t,n,r){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=ZZ[t](null,[r.originX,r.originY],o,n,e),c=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],l=Math.max(1/r.scale,0);a[0]=(a[0]-c)*l+c,a[1]=(a[1]-c)*l+c;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if($E(0,a,[0,100],0,u.minSpan,u.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:vA(function(e,t,n,r,i,a){var o=ZZ[r]([a.oldX,a.oldY],[a.newX,a.newY],t,i,n);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:vA(function(e,t,n,r,i,a){return ZZ[r]([0,0],[a.scrollDelta,a.scrollDelta],t,i,n).signal*(e[1]-e[0])*a.scrollDelta})},ZZ={grid:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem.getRect();return e||=[0,0],a.dim===`x`?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem,c=s.getRadiusAxis().getExtent(),l=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),n.mainType===`radiusAxis`?(o.pixel=t[0]-e[0],o.pixelLength=c[1]-c[0],o.pixelStart=c[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,n,r,i){var a=n.axis,o=i.model.coordinateSystem.getRect(),s={};return e||=[0,0],a.orient===`horizontal`?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}},QZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.slider`,t.layoutMode=`box`,t.defaultOption=bm(cZ.defaultOption,{show:!0,right:`ph`,top:`ph`,width:`ph`,height:`ph`,left:null,bottom:null,borderColor:X.color.accent10,borderRadius:0,backgroundColor:X.color.transparent,dataBackground:{lineStyle:{color:X.color.accent30,width:.5},areaStyle:{color:X.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:X.color.accent40,width:.5},areaStyle:{color:X.color.accent20,opacity:.3}},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:X.color.neutral00,borderColor:X.color.accent20},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:X.color.accent40,opacity:.5},showDetail:!0,showDataShadow:`auto`,realtime:!0,zoomLock:!1,textStyle:{color:X.color.tertiary},brushSelect:!0,brushStyle:{color:X.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:X.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}(cZ),$Z=rR,eQ=1,tQ=30,nQ=7,rQ=`horizontal`,iQ=`vertical`,aQ=5,oQ=[`line`,`bar`,`candlestick`,`scatter`],sQ={easing:`cubicOut`,duration:100,delay:0},cQ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return t.prototype.init=function(e,t){this.api=t,this._onBrush=q(this._onBrush,this),this._onBrushEnd=q(this._onBrushEnd,this)},t.prototype.render=function(t,n,r,i){e.prototype.render.apply(this,arguments),gb(this,`_dispatchZoomAction`,t.get(`throttle`),`fixRate`),this._orient=t.getOrient(),t.get(`show`)===!1?this.group.removeAll():t.noTarget()?(this._clear(),this.group.removeAll()):(i&&i.type===`dataZoom`&&i.from===this.uid||this._buildView(),this._updateView())},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){_b(this,`_dispatchZoomAction`);var e=this.api.getZr();e.off(`mousemove`,this._onBrush),e.off(`mouseup`,this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new Sz;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get(`brushSelect`)?nQ:0,r=Sh(e,t).refContainer,i=this._findCoordRect(),a=e.get(`defaultLocationEdgeGap`,!0)||0,o=this._orient===rQ?{right:r.width-i.x-i.width,top:r.height-tQ-a-n,width:i.width,height:tQ}:{right:a,top:i.y,width:tQ,height:i.height},s=Dh(e.option);L([`right`,`top`,`width`,`height`],function(e){s[e]===`ph`&&(s[e]=o[e])});var c=xh(s,r);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===iQ&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get(`inverse`),a=this._displayables.sliderGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(n===rQ&&!i?{scaleY:o?1:-1,scaleX:1}:n===rQ&&i?{scaleY:o?1:-1,scaleX:-1}:n===iQ&&!i?{scaleY:o?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:o?-1:1,scaleX:-1,rotation:Math.PI/2});var s=e.getBoundingRect([a]),c=isNaN(s.x)?0:s.x,l=isNaN(s.y)?0:s.y;e.x=t.x-c,e.y=t.y-l,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,r=e.get(`brushSelect`);n.add(new $Z({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get(`backgroundColor`)},z2:-40}));var i=new $Z({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:`transparent`},z2:0,onclick:q(this._onClickPanel,this)}),a=this.api.getZr();r?(i.on(`mousedown`,this._onBrushStart,this),i.cursor=`crosshair`,a.on(`mousemove`,this._onBrush),a.on(`mouseup`,this._onBrushEnd)):(a.off(`mousemove`,this._onBrush),a.off(`mouseup`,this._onBrushEnd)),n.add(i)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!e)return;var t=this._size,n=this._shadowSize||[],r=e.series,i=r.getRawData(),a=r.getShadowDim&&r.getShadowDim(),o=a&&i.getDimensionInfo(a)?r.getShadowDim():e.otherDim;if(o==null)return;var s=this._shadowPolygonPts,c=this._shadowPolylinePts;if(i!==this._shadowData||o!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var l=i.getDataExtent(e.thisDim),u=i.getDataExtent(o),d=(u[1]-u[0])*.3;u=[u[0]-d,u[1]+d];var f=[0,t[1]],p=[0,t[0]],m=[[t[0],0],[0,0]],h=[],g=p[1]/Math.max(1,i.count()-1),_=t[0]/(l[1]-l[0]),v=e.thisAxis.type===`time`,y=-g,b=Math.round(i.count()/t[0]),x;i.each([e.thisDim,o],function(e,t,n){if(b>0&&n%b)v||(y+=g);else{y=v?(+e-l[0])*_:y+g;var r=t==null||isNaN(t)||t===``,i=r?0:Nl(t,u,f,!0);r&&!x&&n?(m.push([m[m.length-1][0],0]),h.push([h[h.length-1][0],0])):!r&&x&&(m.push([y,0]),h.push([y,0])),r||(m.push([y,i]),h.push([y,i])),x=r}}),s=this._shadowPolygonPts=m,c=this._shadowPolylinePts=h}this._shadowData=i,this._shadowDim=o,this._shadowSize=[t[0],t[1]];var S=this.dataZoomModel;function C(e){var t=S.getModel(e?`selectedDataBackground`:`dataBackground`),n=new Sz,r=new Uz({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel(`areaStyle`).getAreaStyle(),silent:!0,z2:-20}),i=new Gz({shape:{points:c},segmentIgnoreThreshold:1,style:t.getModel(`lineStyle`).getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),n}for(var w=0;w<3;w++){var T=C(w===1);this._displayables.sliderGroup.add(T),this._displayables.dataShadowSegs.push(T)}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get(`showDataShadow`);if(t!==!1){var n,r=this.ecModel;return e.eachTargetAxis(function(i,a){L(e.getAxisProxy(i,a).getTargetSeriesModels(),function(e){if(!n&&!(t!==!0&&Na(oQ,e.get(`type`))<0)){var o=r.getComponent(JO(i),a).axis,s=xA(i),c,l=e.coordinateSystem;s!=null&&l.getOtherAxis&&(c=l.getOtherAxis(o).inverse),s=e.getData().mapDimension(s),n={thisAxis:o,series:e,thisDim:e.getData().mapDimension(i),otherDim:s,otherAxisInverse:c}}},this)},this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],r=t.handleLabels=[null,null],i=this._displayables.sliderGroup,a=this._size,o=this.dataZoomModel,s=this.api,c=o.get(`borderRadius`)||0,l=o.get(`brushSelect`),u=t.filler=new $Z({silent:l,style:{fill:o.get(`fillerColor`)},textConfig:{position:`inside`}});i.add(u),i.add(new $Z({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:a[0],height:a[1],r:c},style:{stroke:o.get(`dataBackgroundColor`)||o.get(`borderColor`),lineWidth:eQ,fill:X.color.transparent}})),L([0,1],function(t){var a=o.get(`handleIcon`);!qH[a]&&a.indexOf(`path://`)<0&&a.indexOf(`image://`)<0&&(a=`path://`+a);var s=xg(a,-1,0,2,2,null,!0);s.attr({cursor:SA(this._orient),draggable:!0,drift:q(this._onDragMove,this,t),ondragend:q(this._onDragEnd,this),onmouseover:q(this._onOverDataInfoTriggerArea,this,!0),onmouseout:q(this._onOverDataInfoTriggerArea,this,!1),z2:5});var c=s.getBoundingRect(),l=o.get(`handleSize`);this._handleHeight=Y(l,this._size[1]),this._handleWidth=c.width/c.height*this._handleHeight,s.setStyle(o.getModel(`handleStyle`).getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState(`emphasis`).style=o.getModel([`emphasis`,`handleStyle`]).getItemStyle(),Nd(s);var u=o.get(`handleColor`);u!=null&&(s.style.fill=u),i.add(n[t]=s);var d=o.getModel(`textStyle`),f=(o.get(`handleLabel`)||{}).show||!1;e.add(r[t]=new cR({silent:!0,invisible:!f,style:op(d,{x:0,y:0,text:``,verticalAlign:`middle`,align:`center`,fill:d.getTextColor(),font:d.getFont()}),z2:10}))},this);var d=u;if(l){var f=Y(o.get(`moveHandleSize`),a[1]),p=t.moveHandle=new rR({style:o.getModel(`moveHandleStyle`).getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:a[1]-.5,height:f}}),m=f*.8,h=t.moveHandleIcon=xg(o.get(`moveHandleIcon`),-m/2,-m/2,m,m,X.color.neutral00,!0);h.silent=!0,h.y=a[1]+f/2-.5,p.ensureState(`emphasis`).style=o.getModel([`emphasis`,`moveHandleStyle`]).getItemStyle();var g=Math.min(a[1]/2,Math.max(f,10));d=t.moveZone=new rR({invisible:!0,shape:{y:a[1]-g,height:f+g}}),d.on(`mouseover`,function(){s.enterEmphasis(p)}).on(`mouseout`,function(){s.leaveEmphasis(p)}),i.add(p),i.add(h),i.add(d)}d.attr({draggable:!0,cursor:`grab`,drift:q(this._onActualMoveZoneDrift,this),ondragstart:q(this._onActualMoveZoneDragStart,this),ondragend:q(this._onActualMoveZoneDragEnd,this),onmouseover:q(this._onOverDataInfoTriggerArea,this,!0),onmouseout:q(this._onOverDataInfoTriggerArea,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[Nl(e[0],[0,100],t,!0),Nl(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),a=n.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];$E(t,r,i,n.get(`zoomLock`)?`all`:e,a.minSpan==null?null:Nl(a.minSpan,o,i,!0),a.maxSpan==null?null:Nl(a.maxSpan,o,i,!0));var s=this._range,c=this._range=zl([Nl(r[0],i,o,!0),Nl(r[1],i,o,!0)]);return!s||s[0]!==c[0]||s[1]!==c[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,r=zl(n.slice()),i=this._size;L([0,1],function(e){var r=t.handles[e],a=this._handleHeight;r.attr({scaleX:a/2,scaleY:a/2,x:n[e]+(e?-1:1),y:i[1]/2-a/2})},this),t.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var a={x:r[0],width:r[1]-r[0]};t.moveHandle&&(t.moveHandle.setShape(a),t.moveZone.setShape(a),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr(`x`,a.x+a.width/2));for(var o=t.dataShadowSegs,s=[0,r[0],r[1],i[0]],c=0;c<o.length;c++){var l=o[c],u=l.getClipPath();u||(u=new rR,l.setClipPath(u)),u.setShape({x:s[c],y:0,width:s[c+1]-s[c],height:i[1]})}this._updateDataInfo(e)},t.prototype._updateDataInfo=function(e){var t=this.dataZoomModel,n=this._displayables,r=n.handleLabels,i=this._orient,a=[``,``];if(t.get(`showDetail`)){var o=t.findRepresentativeAxisProxy(),s=o.getAxisModel().axis.scale;if(o){var c=this._range,l;if(e){var u={start:c[0],end:c[1]},d=ek(t,o);if(d){var f=d.calculateDataWindow(u).percentInverted;u={start:f[0],end:f[1]}}l=o.calculateDataWindow(u)}else l=o.getWindow();a=[bA(t,0,l,s),bA(t,1,l,s)]}}var p=zl(this._handleEnds.slice());m.call(this,0),m.call(this,1);function m(e){var t=Of(n.handles[e].parent,this.group),o=Af(e===0?`right`:`left`,t),s=this._handleWidth/2+aQ,c=kf([p[e]+(e===0?-s:s),this._size[1]/2],t);r[e].setStyle({x:c[0],y:c[1],verticalAlign:i===rQ?`middle`:o,align:i===rQ?o:`center`,text:a[e]})}},t.prototype._onOverDataInfoTriggerArea=function(e){this._isOverDataInfoTriggerArea=e,this._showDataInfo(e)},t.prototype._showDataInfo=function(e){var t=(this.dataZoomModel.get(`handleLabel`)||{}).show||!1,n=this.dataZoomModel.getModel([`emphasis`,`handleLabel`]).get(`show`)||!1,r=e||this._dragging?n:t,i=this._displayables,a=i.handleLabels;a[0].attr(`invisible`,!r),a[1].attr(`invisible`,!r),i.moveHandle&&this.api[r?`enterEmphasis`:`leaveEmphasis`](i.moveHandle,1)},t.prototype._onActualMoveZoneDrift=function(e,t,n){this.api.getZr().setCursorStyle(`grabbing`),this._onDragMove(`all`,e,t,n)},t.prototype._onActualMoveZoneDragStart=function(e){e.target.attr(`cursor`,`grabbing`),this._showDataInfo(!0)},t.prototype._onActualMoveZoneDragEnd=function(e){e.target.attr(`cursor`,`grab`),this._onDragEnd()},t.prototype._onDragMove=function(e,t,n,r){this._dragging=!0,TG(r.event);var i=this._displayables.sliderGroup.getLocalTransform(),a=kf([t,n],i,!0),o=this._updateInterval(e,a[0]),s=this.dataZoomModel.get(`realtime`);this._updateView(!s),o&&s&&this._dispatchZoomAction(!0)},t.prototype._onDragEnd=function(){this._dragging=!1,this._isOverDataInfoTriggerArea||this._showDataInfo(!1),!this.dataZoomModel.get(`realtime`)&&this._dispatchZoomAction(!1)},t.prototype._onClickPanel=function(e){var t=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(n[0]<0||n[0]>t[0]||n[1]<0||n[1]>t[1])){var r=this._handleEnds,i=(r[0]+r[1])/2,a=this._updateInterval(`all`,n[0]-i);this._updateView(),a&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new wF(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr(`ignore`,!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var r=this._getViewExtent(),i=[0,100],a=this._handleEnds=[n.x,n.x+n.width],o=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();$E(0,a,r,0,o.minSpan==null?null:Nl(o.minSpan,i,r,!0),o.maxSpan==null?null:Nl(o.maxSpan,i,r,!0)),this._range=zl([Nl(a[0],r,i,!0),Nl(a[1],r,i,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(TG(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new $Z({silent:!0,style:r.getModel(`brushStyle`).getItemStyle()}),n.sliderGroup.add(i)),i.attr(`ignore`,!1);var a=this._brushStart,o=this._displayables.sliderGroup,s=o.transformCoordToLocal(e,t),c=o.transformCoordToLocal(a.x,a.y),l=this._size;s[0]=Math.max(Math.min(l[0],s[0]),0),i.setShape({x:c[0],y:0,width:s[0]-c[0],height:l[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:`dataZoom`,from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?sQ:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=XO(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var r=this.api.getWidth(),i=this.api.getHeight();e={x:r*.2,y:i*.2,width:r*.6,height:i*.6}}return e},t.type=`dataZoom.slider`,t}(lZ),lQ={get:function(e,t,n){var r=ka((uQ[e]||{})[t]);return n&&z(r)?r[r.length-1]:r}},uQ={color:{active:[`#006edd`,`#e0ffff`],inactive:[X.color.transparent]},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]}},dQ=qY.mapVisual,fQ=qY.eachVisual,pQ=z,mQ=L,hQ=zl,gQ=Nl,_Q=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=[`inRange`,`outOfRange`],n.replacableOptionKeys=[`inRange`,`outOfRange`,`target`,`controller`,`color`],n.layoutMode={type:`box`,ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&kk(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel(`textStyle`),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=q(e,this),this.controllerVisuals=Ok(this.option.controller,t,e),this.targetVisuals=Ok(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this,t=this.option.seriesTargets;if(t){var n=[];return mQ(t,function(t){if(t.seriesIndex!=null)n.push(t.seriesIndex);else if(t.seriesId!=null){var r;e.ecModel.eachSeries(function(e){e.id===t.seriesId&&(r=e)}),r&&n.push(r.componentIndex)}}),n}var r=this.option.seriesId,i=this.option.seriesIndex;i==null&&r==null&&(i=`all`);var a=Au(this.ecModel,`series`,{index:i,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return R(a,function(e){return e.componentIndex})},t.prototype.eachTargetSeries=function(e,t){L(this.getTargetSeriesIndices(),function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)},this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries(function(n){n===e&&(t=!0)}),t},t.prototype.formatValueText=function(e,t,n){var r=this.option,i=r.precision,a=this.dataBound,o=r.formatter,s;n||=[`<`,`>`],z(e)&&(e=e.slice(),s=!0);var c=t?e:s?[l(e[0]),l(e[1])]:l(e);return V(o)?o.replace(`{value}`,s?c[0]:c).replace(`{value2}`,s?c[1]:c):B(o)?s?o(e[0],e[1]):o(e):s?e[0]===a[0]?n[0]+` `+c[1]:e[1]===a[1]?n[1]+` `+c[0]:c[0]+` - `+c[1]:c;function l(e){return e===a[0]?`min`:e===a[1]?`max`:(+e).toFixed(Math.min(i,20))}},t.prototype.resetExtent=function(){var e=this.option,t=hQ([e.min,e.max]);this._dataExtent=t},t.prototype.getDimension=function(e){var t=this,n=this.option.seriesTargets;if(n){var r=za(n,function(n){return n.seriesIndex!=null&&n.seriesIndex===e||n.seriesId!=null&&n.seriesId===t.ecModel.getSeriesByIndex(e).id});if(r)return r.dimension}return this.option.dimension},t.prototype.getDataDimensionIndex=function(e){var t=e.hostModel.seriesIndex,n=this.getDimension(t);if(n!=null)return e.getDimensionIndex(n);for(var r=e.dimensions,i=r.length-1;i>=0;i--){var a=r[i],o=e.getDimensionInfo(a);if(!o.isCalculationCoord)return o.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||={},i=t.controller||={};Aa(r,n),Aa(i,n);var a=this.isCategory();o.call(this,r),o.call(this,i),s.call(this,r,`inRange`,`outOfRange`),c.call(this,i);function o(n){pQ(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get(`gradientColor`)}}function s(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},mQ(r,function(e,t){if(qY.isValidType(t)){var n=lQ.get(t,`inactive`,a);n!=null&&(i[t]=n,t===`color`&&!i.hasOwnProperty(`opacity`)&&!i.hasOwnProperty(`colorAlpha`)&&(i.opacity=[0,0]))}}))}function c(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get(`inactiveColor`),i=this.getItemSymbol()||`roundRect`;mQ(this.stateList,function(o){var s=this.itemSize,c=e[o];c||=e[o]={color:a?r:[r]},c.symbol??(c.symbol=t&&ka(t)||(a?i:[i])),c.symbolSize??(c.symbolSize=n&&ka(n)||(a?s[0]:[s[0],s[0]])),c.symbol=dQ(c.symbol,function(e){return e===`none`?i:e});var l=c.symbolSize;if(l!=null){var u=-1/0;fQ(l,function(e){e>u&&(u=e)}),c.symbolSize=dQ(l,function(e){return gQ(e,[0,u],[0,s[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get(`itemWidth`)),parseFloat(this.get(`itemHeight`))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type=`visualMap`,t.dependencies=[`series`],t.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:`vertical`,backgroundColor:X.color.transparent,borderColor:X.color.borderTint,contentColor:X.color.theme[0],inactiveColor:X.color.disabled,borderWidth:0,padding:X.size.m,textGap:10,precision:0,textStyle:{color:X.color.secondary}},t}(TH),vQ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.autoPositionValues={left:1,right:1,top:1,bottom:1},n}return t.prototype.init=function(e,t){this.ecModel=e,this.api=t},t.prototype.render=function(e,t,n,r){this.visualMapModel=e,e.get(`show`)===!1?this.group.removeAll():this.doRender(e,t,n,r)},t.prototype.renderBackground=function(e){var t=this.visualMapModel,n=gH(t.get(`padding`)||0),r=e.getBoundingRect();e.add(new rR({z2:-1,silent:!0,shape:{x:r.x-n[3],y:r.y-n[0],width:r.width+n[3]+n[1],height:r.height+n[0]+n[2]},style:{fill:t.get(`backgroundColor`),stroke:t.get(`borderColor`),lineWidth:t.get(`borderWidth`)}}))},t.prototype.getControllerVisual=function(e,t,n){n||={};var r=n.forceState,i=this.visualMapModel,a={};t===`color`&&(a.color=i.get(`contentColor`));function o(e){return a[e]}function s(e,t){a[e]=t}var c=i.controllerVisuals[r||i.getValueState(e)];return L(qY.prepareVisualTypes(c),function(r){var i=c[r];n.convertOpacityToAlpha&&r===`opacity`&&(r=`colorAlpha`,i=c.__alphaForOpacity),qY.dependsOn(r,t)&&i&&i.applyVisual(e,o,s)}),a[t]},t.prototype.positionGroup=function(e){var t=this.visualMapModel,n=this.api,r=Sh(t,n).refContainer;Ch(e,t.getBoxLayoutParams(),r)},t.prototype.doRender=function(e,t,n,r){},t.type=`visualMap`,t}(xK),yQ=[[`left`,`right`,`width`],[`top`,`bottom`,`height`]],bQ={type:`selectDataRange`,event:`dataRangeSelected`,update:`update`},xQ=function(e,t){t.eachComponent({mainType:`visualMap`,query:e},function(t){t.setSelected(e.selected)})},SQ=[{createOnAllSeries:!0,reset:function(e,t){var n=[];return t.eachComponent(`visualMap`,function(t){var r=e.pipelineContext;!t.isTargetSeries(e)||r&&r.large||n.push(Ak(t.stateList,t.targetVisuals,q(t.getValueState,t),t.getDataDimensionIndex(e.getData())))}),n}},{createOnAllSeries:!0,reset:function(e,t){var n=e.getData(),r=[];t.eachComponent(`visualMap`,function(t){if(t.isTargetSeries(e)){var i=t.getVisualMeta(q(DA,null,e,t))||{stops:[],outerColors:[]},a=t.getDataDimensionIndex(n);a>=0&&(i.dimension=a,r.push(i))}}),e.getData().setVisual(`visualMeta`,r)}}],CQ=L,wQ=!1,TQ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],EQ[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual(function(e,t){r===`categories`?(e.mappingMethod=`category`,e.categories=ka(i)):(e.dataExtent=this.getExtent(),e.mappingMethod=`piecewise`,e.pieceList=R(this._pieceList,function(e){return e=ka(e),t!==`inRange`&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=qY.listVisualTypes(),i=this.isCategory();L(t.pieces,function(e){L(r,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),L(n,function(e,n){var r=!1;L(this.stateList,function(e){r=r||a(t,e,n)||a(t.target,e,n)},this),!r&&L(this.stateList,function(e){(t[e]||(t[e]={}))[n]=lQ.get(n,e===`inRange`?`active`:`inactive`,i)})},this);function a(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,L(r,function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)},this),n.selectedMode===`single`){var a=!1;L(r,function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(a?i[n]=!1:a=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get(`itemSymbol`)},t.prototype.getSelectedMapKey=function(e){return this._mode===`categories`?e.value+``:e.index+``},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?`pieces`:this.option.categories?`categories`:`splitNumber`},t.prototype.setSelected=function(e){this.option.selected=ka(e)},t.prototype.getValueState=function(e){var t=qY.findPieceIndex(e,this._pieceList);return t==null?`outOfRange`:this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries(function(r){var i=[],a=r.getData();a.each(this.getDataDimensionIndex(a),function(t,r){qY.findPieceIndex(t,n)===e&&i.push(r)},this),t.push({seriesId:r.id,dataIndex:i})},this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(e.value!=null)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(this.isCategory())return;var t=[],n=[``,``],r=this;function i(i,a){var o=r.getRepresentValue({interval:i});a||=r.getValueState(o);var s=e(o,a);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:t.push({value:i[0],color:s},{value:i[1],color:s})}var a=this._pieceList.slice();if(!a.length)a.push({interval:[-1/0,1/0]});else{var o=a[0].interval[0];o!==-1/0&&a.unshift({interval:[-1/0,o]}),o=a[a.length-1].interval[1],o!==1/0&&a.push({interval:[o,1/0]})}var s=-1/0;return L(a,function(e){var t=e.interval;t&&(t[0]>s&&i([s,t[0]],`outOfRange`),i(t.slice()),s=t[1])},this),{stops:t,outerColors:n}},t.type=`visualMap.piecewise`,t.defaultOption=bm(_Q.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}),t}(_Q),EQ={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var a=(r[1]-r[0])/i;+a.toFixed(n)!==a&&n<5;)n++;t.precision=n,a=+a.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var o=0,s=r[0];o<i;s+=a,o++){var c=o===i-1?r[1]:s+a;e.push({interval:[s,c],close:[1,1]})}t.maxOpen&&e.push({interval:[r[1],1/0],close:[0,0]}),Zl(e),L(e,function(e,t){e.index=t,e.text=this.formatValueText(e.interval)},this)},categories:function(e){var t=this.option;L(t.categories,function(t){e.push({text:this.formatValueText(t,!0),value:t})},this),jA(t,e)},pieces:function(e){var t=this.option;L(t.pieces,function(t,n){H(t)||(t={value:t});var r={text:``,index:n};if(t.label!=null&&(r.text=t.label),t.hasOwnProperty(`value`)){var i=r.value=t.value;r.interval=[i,i],r.close=[1,1]}else{for(var a=r.interval=[],o=r.close=[0,0],s=[1,0,1],c=[-1/0,1/0],l=[],u=0;u<2;u++){for(var d=[[`gte`,`gt`,`min`],[`lte`,`lt`,`max`]][u],f=0;f<3&&a[u]==null;f++)a[u]=t[d[f]],o[u]=s[f],l[u]=f===2;a[u]??(a[u]=c[u])}l[0]&&a[1]===1/0&&(o[0]=0),l[1]&&a[0]===-1/0&&(o[1]=0),a[0]===a[1]&&o[0]&&o[1]&&(r.value=a[0])}r.visual=qY.retrieveVisuals(t),e.push(r)},this),jA(t,e),Zl(e),L(e,function(e){var t=e.close,n=[[`<`,`≤`][t[1]],[`>`,`≥`][t[0]]];e.text=e.text||this.formatValueText(e.value==null?e.interval:e.value,!1,n)},this)}},DQ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get(`textGap`),r=t.textStyleModel,i=this._getItemAlign(),a=t.itemSize,o=this._getViewData(),s=o.endsText,c=Za(t.get(`showLabel`,!0),!s),l=!t.get(`selectedMode`);s&&this._renderEndsText(e,s[0],a,c,i),L(o.viewPieceList,function(o){var s=o.piece,u=new Sz;u.onclick=q(this._onItemClick,this,s),this._enableHoverLink(u,o.indexInModelPieceList);var d=t.getRepresentValue(s);if(this._createItemSymbol(u,d,[0,0,a[0],a[1]],l),c){var f=this.visualMapModel.getValueState(d),p=r.get(`align`)||i;u.add(new cR({style:op(r,{x:p===`right`?-n:a[0]+n,y:a[1]/2,text:s.text,verticalAlign:r.get(`verticalAlign`)||`middle`,align:p,opacity:U(r.get(`opacity`),f===`outOfRange`?.5:1)}),silent:l}))}e.add(u)},this),s&&this._renderEndsText(e,s[1],a,c,i),SH(t.get(`orient`),e,t.get(`itemGap`)),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on(`mouseover`,function(){return r(`highlight`)}).on(`mouseout`,function(){return r(`downplay`)});var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:EA(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if(t.orient===`vertical`)return TA(e,this.api,e.itemSize);var n=t.align;return n&&n!==`auto`||(n=`left`),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var a=new Sz,o=this.visualMapModel.textStyleModel;a.add(new cR({style:op(o,{x:r?i===`right`?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:`middle`,align:r?i:`center`,text:t})})),e.add(a)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=R(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),n=e.get(`text`),r=e.get(`orient`),i=e.get(`inverse`);return(r===`horizontal`?i:!i)?t.reverse():n&&=n.slice().reverse(),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n,r){var i=xg(this.getControllerVisual(t,`symbol`),n[0],n[1],n[2],n[3],this.getControllerVisual(t,`color`));i.silent=r,e.add(i)},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,r=n.selectedMode;if(r){var i=ka(n.selected),a=t.getSelectedMapKey(e);r===`single`||r===!0?(i[a]=!0,L(i,function(e,t){i[t]=t===a})):i[a]=!i[a],this.api.dispatchAction({type:`selectDataRange`,from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type=`visualMap.piecewise`,t}(vQ),OQ=[`align`,`verticalAlign`,`width`,`height`,`fontSize`],kQ=new lI,AQ=Du(),jQ=Du(),MQ=[`x`,`y`,`rotation`],NQ=function(){function e(){this._labelList=[],this._chartViewList=[]}return e.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},e.prototype._addLabel=function(e,t,n,r,i){var a=r.style,o=r.__hostTarget.textConfig||{},s=r.getComputedTransform(),c=r.getBoundingRect().plain();J.applyTransform(c,c,s),s?kQ.setLocalTransform(s):(kQ.x=kQ.y=kQ.rotation=kQ.originX=kQ.originY=0,kQ.scaleX=kQ.scaleY=1),kQ.rotation=ol(kQ.rotation);var l=r.__hostTarget,u;if(l){u=l.getBoundingRect().plain();var d=l.getComputedTransform();J.applyTransform(u,u,d)}var f=u&&l.getTextGuideLine();this._labelList.push({label:r,labelLine:f,seriesModel:n,dataIndex:e,dataType:t,layoutOptionOrCb:i,layoutOption:null,rect:c,hostRect:u,priority:u?u.width*u.height:0,defaultAttr:{ignore:r.ignore,labelGuideIgnore:f&&f.ignore,x:kQ.x,y:kQ.y,scaleX:kQ.scaleX,scaleY:kQ.scaleY,rotation:kQ.rotation,style:{x:a.x,y:a.y,align:a.align,verticalAlign:a.verticalAlign,width:a.width,height:a.height,fontSize:a.fontSize},cursor:r.cursor,attachedPos:o.position,attachedRot:o.rotation}})},e.prototype.addLabelsOfSeries=function(e){var t=this;this._chartViewList.push(e);var n=e.__model,r=n.get(`labelLayout`);(B(r)||Ba(r).length)&&e.group.traverse(function(e){if(e.ignore)return!0;var i=e.getTextContent(),a=LR(e);i&&!i.disableLabelLayout&&t._addLabel(a.dataIndex,a.dataType,n,i,r)})},e.prototype.updateLayoutConfig=function(e){var t=e.getWidth(),n=e.getHeight();function r(e,t){return function(){Jb(e,t)}}for(var i=0;i<this._labelList.length;i++){var a=this._labelList[i],o=a.label,s=o.__hostTarget,c=a.defaultAttr,l=void 0;l=B(a.layoutOptionOrCb)?a.layoutOptionOrCb(PA(a,s)):a.layoutOptionOrCb,l||={},a.layoutOption=l;var u=Math.PI/180;s&&s.setTextConfig({local:!1,position:l.x!=null||l.y!=null?null:c.attachedPos,rotation:l.rotate==null?c.attachedRot:l.rotate*u,offset:[l.dx||0,l.dy||0]});var d=!1;if(l.x==null?(o.x=c.x,o.setStyle(`x`,c.style.x)):(o.x=Y(l.x,t),o.setStyle(`x`,0),d=!0),l.y==null?(o.y=c.y,o.setStyle(`y`,c.style.y)):(o.y=Y(l.y,n),o.setStyle(`y`,0),d=!0),l.labelLinePoints){var f=s.getTextGuideLine();f&&(f.setShape({points:l.labelLinePoints}),d=!1)}var p=AQ(o);p.needsUpdateLabelLine=d,o.rotation=l.rotate==null?c.rotation:l.rotate*u,o.scaleX=c.scaleX,o.scaleY=c.scaleY;for(var m=0;m<OQ.length;m++){var h=OQ[m];o.setStyle(h,l[h]==null?c.style[h]:l[h])}if(l.draggable){if(o.draggable=!0,o.cursor=`move`,s){var g=a.seriesModel;a.dataIndex!=null&&(g=a.seriesModel.getData(a.dataType).getItemModel(a.dataIndex)),o.on(`drag`,r(s,g.getModel(`labelLine`)))}}else o.off(`drag`),o.cursor=c.cursor}},e.prototype.layout=function(e){var t=e.getWidth(),n=e.getHeight(),r=[];L(this._labelList,function(e){e.defaultAttr.ignore||r.push(oy({},e))});var i=Ra(r,function(e){return e.layoutOption.moveOverlap===`shiftX`}),a=Ra(r,function(e){return e.layoutOption.moveOverlap===`shiftY`});cy(i,0,0,t),cy(a,1,0,n);var o=Ra(r,function(e){return e.layoutOption.hideOverlap});fee(o),ly(o)},e.prototype.processLabelsOverall=function(){var e=this;L(this._chartViewList,function(t){var n=t.__model,r=t.ignoreLabelLineUpdate,i=n.isAnimationEnabled();t.group.traverse(function(t){if(t.ignore&&!t.forceLabelAnimation)return!0;var a=!r,o=t.getTextContent();!a&&o&&(a=AQ(o).needsUpdateLabelLine),a&&e._updateLabelLine(t,n),i&&e._animateLabels(t,n)})})},e.prototype._updateLabelLine=function(e,t){var n=e.getTextContent(),r=LR(e),i=r.dataIndex;if(n&&i!=null){var a=t.getData(r.dataType),o=a.getItemModel(i),s={},c=a.getItemVisual(i,`style`);c&&(s.stroke=c[a.getVisual(`drawType`)]);var l=o.getModel(`labelLine`);$b(e,ex(o),s),Jb(e,l)}},e.prototype._animateLabels=function(e,t){var n=e.getTextContent(),r=e.getTextGuideLine();if(n&&(e.forceLabelAnimation||!n.ignore&&!n.invisible&&!e.disableLabelAnimation&&!pf(e))){var i=AQ(n),a=i.oldLayout,o=LR(e),s=o.dataIndex,c={x:n.x,y:n.y,rotation:n.rotation},l=t.getData(o.dataType);if(a){n.attr(a);var u=e.prevStates;u&&(Na(u,`select`)>=0&&n.attr(i.oldLayoutSelect),Na(u,`emphasis`)>=0&&n.attr(i.oldLayoutEmphasis)),df(n,c,t,s)}else if(n.attr(c),!AB(n).valueAnimation){var d=U(n.style.opacity,1);n.style.opacity=0,ff(n,{style:{opacity:d}},t,s)}if(i.oldLayout=c,n.states.select){var f=i.oldLayoutSelect={};FA(f,c,MQ),FA(f,n.states.select,MQ)}if(n.states.emphasis){var p=i.oldLayoutEmphasis={};FA(p,c,MQ),FA(p,n.states.emphasis,MQ)}pp(n,s,l,t,t)}if(r&&!r.ignore&&!r.invisible){var i=jQ(r),a=i.oldLayout,m={points:r.shape.points};a?(r.attr({shape:a}),df(r,{shape:m},t)):(r.setShape(m),r.style.strokePercent=0,ff(r,{style:{strokePercent:1}},t)),i.oldLayout=m}},e}(),PQ=Du(),FQ=function(){function e(t,n){n_(this,e.decoratedMethods),this._outOfBrk=c_(null,n);var r=this._linear=c_(null,n);r_(this,r),this.breaks=t&&t.breaks||[]}return e.prototype.hasBreaks=function(){return!!this.breaks.length},e.prototype.calcNiceTickMultiple=function(e,t){for(var n=0;n<this.breaks.length;n++){var r=this.breaks[n];if(r.vmin<e&&e<r.vmax)return t(e,r.vmax)}return 0},e.decoratedMethods={needTransform:function(){return!this.breaks.length},getExtent:function(){return this._outOfBrk.getExtent()},getExtentUnsafe:function(e,t){return t==null||t===2?this._outOfBrk.getExtentUnsafe(e,null):this._linear.getExtentUnsafe(e,null)},setExtent:function(e,t){this.setExtent2(0,e,t)},setExtent2:function(e,t,n){Uu(t,n)&&(e===0&&RA(this,[t,n]),this._outOfBrk.setExtent2(e,t,n),this._linear.setExtent2(e,this.transformIn(t,null),this.transformIn(n,null)))},normalize:function(e){return this._linear.normalize(this.transformIn(e,null))},scale:function(e){return this.transformOut(this._linear.scale(e),null)},contain:function(e){return this._outOfBrk.contain(e)},transformIn:function(e,t){if(t&&t.depth===2)return e;for(var n=IQ,r=LQ,i=!0,a=0;a<this.breaks.length;a++){var o=this.breaks[a];if(e<=o.vmax){e>o.vmin?n+=o.vmin-r+(e-o.vmin)/(o.vmax-o.vmin)*o.gapReal:n+=e-r,r=o.vmax,i=!1;break}n+=o.vmin-r+o.gapReal,r=o.vmax}return i&&(n+=e-r),n},transformOut:function(e,t){if(t&&t.depth===2)return e;for(var n=IQ,r=LQ,i=!0,a=0,o=0;o<this.breaks.length;o++){var s=this.breaks[o],c=n+s.vmin-r,l=c+s.gapReal;if(e<=l){a=e>c?s.vmin+(e-c)/(l-c)*(s.vmax-s.vmin):r+e-n,r=s.vmax,i=!1;break}n=l,r=s.vmax}return i&&(a=r+e-n),a}},e}(),IQ=0,LQ=0,RQ={vmin:`start`,vmax:`end`},zQ=Du(),BQ=Math.sin,VQ=Math.cos,HQ=Math.PI,UQ=Math.PI*2,WQ=180/HQ,GQ=function(){function e(){}return e.prototype.reset=function(e){this._start=!0,this._d=[],this._str=``,this._p=10**(e||4)},e.prototype.moveTo=function(e,t){this._add(`M`,e,t)},e.prototype.lineTo=function(e,t){this._add(`L`,e,t)},e.prototype.bezierCurveTo=function(e,t,n,r,i,a){this._add(`C`,e,t,n,r,i,a)},e.prototype.quadraticCurveTo=function(e,t,n,r){this._add(`Q`,e,t,n,r)},e.prototype.arc=function(e,t,n,r,i,a){this.ellipse(e,t,n,n,0,r,i,a)},e.prototype.ellipse=function(e,t,n,r,i,a,o,s){var c=o-a,l=!s,u=Math.abs(c),d=fc(u-UQ)||(l?c>=UQ:-c>=UQ),f=c>0?c%UQ:c%UQ+UQ,p=!1;p=d?!0:!fc(u)&&f>=HQ==!!l;var m=e+n*VQ(a),h=t+r*BQ(a);this._start&&this._add(`M`,m,h);var g=Math.round(i*WQ);if(d){var _=1/this._p,v=(l?1:-1)*(UQ-_);this._add(`A`,n,r,g,1,+l,e+n*VQ(a+v),t+r*BQ(a+v)),_>.01&&this._add(`A`,n,r,g,0,+l,m,h)}else{var y=e+n*VQ(o),b=t+r*BQ(o);this._add(`A`,n,r,g,+p,+l,y,b)}},e.prototype.rect=function(e,t,n,r){this._add(`M`,e,t),this._add(`l`,n,0),this._add(`l`,0,r),this._add(`l`,-n,0),this._add(`Z`)},e.prototype.closePath=function(){this._d.length>0&&this._add(`Z`)},e.prototype._add=function(e,t,n,r,i,a,o,s,c){for(var l=[],u=this._p,d=1;d<arguments.length;d++){var f=arguments[d];if(isNaN(f)){this._invalid=!0;return}l.push(Math.round(f*u)/u)}this._d.push(e+l.join(` `)),this._start=e===`Z`},e.prototype.generateStr=function(){this._str=this._invalid?``:this._d.join(``),this._d=[]},e.prototype.getStr=function(){return this._str},e}(),KQ=`none`,qQ=Math.round,JQ=[`lineCap`,`miterLimit`,`lineJoin`],YQ=R(JQ,function(e){return`stroke-`+e.toLowerCase()}),XQ=`http://www.w3.org/2000/svg`,ZQ=`http://www.w3.org/1999/xlink`,QQ=`http://www.w3.org/2000/xmlns/`,$Q=`http://www.w3.org/XML/1998/namespace`,e$=`ecmeta_`,t$=0,n$={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`},r$=`transform-origin`,i$={fill:`fill`,opacity:`opacity`,lineWidth:`stroke-width`,lineDashOffset:`stroke-dashoffset`},a$=Math.round,o$={circle:[Pj([`cx`,`cy`,`r`])],polyline:[Mj,Nj],polygon:[Mj,Nj]},s$=58,c$=120,l$=lj(``,``),u$=0,d$=function(){function e(e,t,n){if(this.type=`svg`,this.configLayer=gee(`configLayer`),this.storage=t,this._opts=n=I({},n),this.root=e,this._id=`zr`+u$++,this._oldVNode=hj(n.width,n.height),e&&!n.ssr){var r=this._viewport=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden`;var i=this._svgDom=this._oldVNode.elm=cj(`svg`);rM(null,this._oldVNode),r.appendChild(i),e.appendChild(r)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style=`position:absolute;left:0;top:0;user-select:none`,hee(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return zj(e,mj(this._id))},e.prototype.renderToVNode=function(e){e||={};var t=this.storage.getDisplayList(!0),n=this._width,r=this._height,i=mj(this._id);i.animation=e.animation,i.willUpdate=e.willUpdate,i.compress=e.compress,i.emphasis=e.emphasis,i.ssr=this._opts.ssr;var a=[],o=this._bgVNode=_ee(n,r,this._backgroundColor,i);o&&a.push(o);var s=e.compress?null:this._mainVNode=lj(`g`,`main`,{},[]);this._paintList(t,i,s?s.children:a),s&&a.push(s);var c=R(Ba(i.defs),function(e){return i.defs[e]});if(c.length&&a.push(lj(`defs`,`defs`,{},c)),e.animation){var l=pj(i.cssNodes,i.cssAnims,{newline:!0});if(l){var u=lj(`style`,`stl`,{},[],l);a.push(u)}}return hj(n,r,a,e.useViewBox)},e.prototype.renderToString=function(e){return e||={},fj(this.renderToVNode({animation:U(e.cssAnimation,!0),emphasis:U(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:U(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var r=e.length,i=[],a=0,o,s,c=0,l=0;l<r;l++){var u=e[l];if(!u.invisible){var d=u.__clipPaths,f=d&&d.length||0,p=s&&s.length||0,m=void 0;for(m=Math.max(f-1,p-1);m>=0&&!(d&&s&&d[m]===s[m]);m--);for(var h=p-1;h>m;h--)a--,o=i[a-1];for(var g=m+1;g<f;g++){var _={};Uj(d[g],_,t);var v=lj(`g`,`clip-g-`+c++,_,[]);(o?o.children:n).push(v),i[a++]=v,o=v}s=d;var y=zj(u,t);y&&(o?o.children:n).push(y)}}},e.prototype.resize=function(e,t){var n=this._opts,r=this.root,i=this._viewport;if(e!=null&&(n.width=e),t!=null&&(n.height=t),r&&i&&(i.style.display=`none`,e=eC(r,0,n),t=eC(r,1,n),i.style.display=``),this._width!==e||this._height!==t){if(this._width=e,this._height=t,i){var a=i.style;a.width=e+`px`,a.height=t+`px`}if(xc(this._backgroundColor))this.refresh();else{var o=this._svgDom;o&&(o.setAttribute(`width`,e),o.setAttribute(`height`,t));var s=this._bgVNode&&this._bgVNode.elm;s&&(s.setAttribute(`width`,e),s.setAttribute(`height`,t))}}},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype.dispose=function(){this.root&&(this.root.innerHTML=``),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},e.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},e.prototype.toDataURL=function(e){var t=this.renderToString(),n=`data:image/svg+xml;`;return e?(t=jI(t),t&&n+`base64,`+t):n+`charset=UTF-8,`+encodeURIComponent(t)},e}(),f$=function(e){F(t,e);function t(t,n,r){var i=e.call(this)||this;i.motionBlur=!1,i.lastFrameAlpha=.7,i.dpr=1,i.virtual=!1,i.config={},i.zlevel=0,i.zlevel2=0,i.maxRepaintRectCount=5,i.__dirty=!0,i.__firstTimePaint=!0,i.__prevIdx={startIdx:0,endIdx:0};var a;r||=GI,typeof t==`string`?a=aM(t,n,r):H(t)&&(a=t,t=a.id),i.id=t,i.dom=a;var o=a.style;return o&&(oo(a),a.onselectstart=function(){return!1},o.padding=`0`,o.margin=`0`,o.borderWidth=`0`),i.painter=n,i.dpr=r,i}return t.prototype.afterBrush=function(){this.__prevIdx=sM(this)},t.prototype.initContext=function(){this.ctx=this.dom.getContext(`2d`),this.ctx.dpr=this.dpr},t.prototype.setUnpainted=function(){this.__firstTimePaint=!0},t.prototype.createBackBuffer=function(){var e=this.dpr;this.domBack=aM(`back-`+this.id,this.painter,e),this.ctxBack=this.domBack.getContext(`2d`),e!==1&&this.ctxBack.scale(e,e)},t.prototype.createRepaintRects=function(e,t,n,r){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var i=[],a=this.maxRepaintRectCount,o=!1,s=new J(0,0,0,0);function c(e){if(e.isFinite()&&!e.isZero()){if(i.length===0){var t=new J(0,0,0,0);t.copy(e),i.push(t)}else{for(var n=!1,r=1/0,c=0,l=0;l<i.length;++l){var u=i[l];if(u.intersect(e)){var d=new J(0,0,0,0);d.copy(u),d.union(e),i[l]=d,n=!0;break}if(o){s.copy(e),s.union(u);var f=e.width*e.height,p=u.width*u.height,m=s.width*s.height-f-p;m<r&&(r=m,c=l)}}if(o&&(i[c].union(e),n=!0),!n){var t=new J(0,0,0,0);t.copy(e),i.push(t)}o||=i.length>=a}}}for(var l=sM(this),u=l.startIdx;u<l.endIdx;++u){var d=e[u];if(d){var f=d.shouldBePainted(n,r,!0,!0),p=d.__isRendered&&(d.__dirty&1||!f)?d.getPrevPaintRect():null;p&&c(p);var m=f&&(d.__dirty&1||!d.__isRendered)?d.getPaintRect():null;m&&c(m)}}for(var h=this.__prevIdx,u=h.startIdx;u<h.endIdx;++u){var d=t[u],f=d&&d.shouldBePainted(n,r,!0,!0);if(d&&(!f||!d.__zr)&&d.__isRendered){var p=d.getPrevPaintRect();p&&c(p)}}var g;do{g=!1;for(var u=0;u<i.length;)if(i[u].isZero())i.splice(u,1);else{for(var _=u+1;_<i.length;)i[u].intersect(i[_])?(g=!0,i[u].union(i[_]),i.splice(_,1)):_++;u++}}while(g);return this._paintRects=i,i},t.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},t.prototype.resize=function(e,t){var n=this.dpr,r=this.dom,i=r.style,a=this.domBack;i&&(i.width=e+`px`,i.height=t+`px`),r.width=e*n,r.height=t*n,a&&(a.width=e*n,a.height=t*n,n!==1&&this.ctxBack.scale(n,n))},t.prototype.clear=function(e,t,n){var r=this.dom,i=this.ctx,a=r.width,o=r.height;t||=this.clearColor;var s=this.motionBlur&&!e,c=this.lastFrameAlpha,l=this.dpr,u=this;s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation=`copy`,this.ctxBack.drawImage(r,0,0,a/l,o/l));var d=this.domBack;function f(e,n,r,a){if(i.clearRect(e,n,r,a),t&&t!==`transparent`){var o=void 0;Ja(t)?(o=(t.global||t.__width===r&&t.__height===a)&&t.__canvasGradient||ZS(i,t,{x:0,y:0,width:r,height:a}),t.__canvasGradient=o,t.__width=r,t.__height=a):Ya(t)&&(t.scaleX=t.scaleX||l,t.scaleY=t.scaleY||l,o=cC(i,t,{dirty:function(){u.setUnpainted(),u.painter.refresh()}})),i.save(),i.fillStyle=o||t,i.fillRect(e,n,r,a),i.restore()}s&&(i.save(),i.globalAlpha=c,i.drawImage(d,e,n,r,a),i.restore())}!n||s?f(0,0,a,o):n.length&&L(n,function(e){f(e.x*l,e.y*l,e.width*l,e.height*l)})},t}(UI),p$=1e5,m$=314159,h$=void 0,g$=1,_$=2,v$=1,y$=2,b$=4,x$=v$|b$,S$=function(){function e(e,t,n,r){this.type=`canvas`,this._prevDisplayList=[],this._layerConfig={},this._needsManuallyCompositing=!1,this.type=`canvas`,this._i={layerStack:[],layers:[]};var i=!e.nodeName||e.nodeName.toUpperCase()===`CANVAS`;if(this._opts=n=I({},n||{}),this.dpr=n.devicePixelRatio||GI,this._singleCanvas=i,this.root=e,e.style&&(oo(e),e.innerHTML=``),this.storage=t,this._prevDisplayList=[],i){var a=e,o=a.width,s=a.height;n.width!=null&&(o=n.width),n.height!=null&&(s=n.height),this.dpr=n.devicePixelRatio||1,a.width=o*this.dpr,a.height=s*this.dpr,this._width=o,this._height=s;var c=uM(a,this,m$,0);c.initContext(),this._insertLayer(c,m$,0,!0),this._domRoot=e}else{this._width=eC(e,0,n),this._height=eC(e,1,n);var l=this._domRoot=lM(this._width,this._height);e.appendChild(l)}}return e.prototype.getType=function(){return`canvas`},e.prototype.isSingleCanvas=function(){return this._singleCanvas},e.prototype.getViewportRoot=function(){return this._domRoot},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.refresh=function(e){var t=e&&!H(e)?{paintAll:!!e}:e||{},n=U(t.refresh,!0),r=U(t.refreshHover,!1);if(r&&(this._hoverLayerDirty=_$),!n)return r&&this._paintHoverList(this.storage.getDisplayList(!1)),this;var i=this.storage.getDisplayList(!0);this._updateLayerStatus(i,t.paintAll),this._redrawId=Math.random();var a=this._prevDisplayList;this._paintList(i,a,this._redrawId);var o=this._backgroundColor;return gM(this._i,function(e,t,n,r){e.refresh&&e.refresh(r===0?o:null)},y$),this._opts.useDirtyRect&&(this._prevDisplayList=i.slice()),this},e.prototype._paintHoverList=function(e){var t=this._i.hoverlayer,n=this._hoverLayerDirty;if(this._hoverLayerDirty=h$,n!==h$&&(!t&&n===_$&&(t=this._i.hoverlayer=this._ensureLayer(p$)),t)){t.clear();for(var r={inHover:!0,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},i,a=0,o=e.length;a<o;a++){var s=e[a];if(s.__inHover){i||(i=t.ctx,i.save());var c=s.__hoverStyle,l=void 0;c&&(l=s.style,s.style=c),xC(i,s,r),c&&(s.style=l)}}i&&(SC(i,r),i.restore())}},e.prototype.getHoverLayer=function(){return this._ensureLayer(p$)},e.prototype.paintOne=function(e,t){bC(e,t)},e.prototype._paintList=function(e,t,n){if(this._redrawId===n){var r=this._doPaintList(e,t);if(this._needsManuallyCompositing&&this._compositeManually(),r)gM(this._i,function(e){e.afterBrush&&e.afterBrush()},x$),this._paintHoverList(e);else{var i=this;RG(function(){i._paintList(e,t,n)})}}},e.prototype._compositeManually=function(){var e=this._ensureLayer(m$).ctx,t=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,t,n),gM(this._i,function(r){r.virtual&&e.drawImage(r.dom,0,0,t,n)},v$)},e.prototype._doPaintList=function(e,t){var n=this,r=!0;return gM(this._i,function(i){var a=!1;if(mM(i,function(e){(e.drawIdx<e.endIdx||e.notClearIdx>=0)&&(a=!0)}),a||i.__dirty){var o=n._opts.useDirtyRect&&!oM(i)?i.createRepaintRects(e,t,n._width,n._height):null,s=n._i.layerStack[0],c=!0;if(i.__dirty){c=!1,i.__dirty=!1;var l=i.zlevel===s.zl&&i.zlevel2===s.zl2?n._backgroundColor:null;i.clear(!1,l,o)}mM(i,function(t){var a=n._paintPerCursor(i,t,e,o,c);r&&=a})}},x$),dF.wxa&&gM(this._i,function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()}),r},e.prototype._paintPerCursor=function(e,t,n,r,i){var a=e.ctx;if(r){if(!r.length)t.drawIdx=t.endIdx;else for(var o=this.dpr,s=0;s<r.length;++s){var c=r[s];a.save(),a.beginPath(),a.rect(c.x*o,c.y*o,c.width*o,c.height*o),a.clip(),this._paintPerCursorInRect(e,t,n,c,i),a.restore()}}else a.save(),this._paintPerCursorInRect(e,t,n,null,i),a.restore();return t.drawIdx>=t.endIdx},e.prototype._paintPerCursorInRect=function(e,t,n,r,i){for(var a={inHover:!1,allClipped:!1,prevEl:null,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{contentRetained:i}},o=e.ctx,s=oM(e),c=s&&GP.getTime(),l=t.drawIdx,u=t.notClearIdx,d=u>=0?Math.min(u,l):l;d<t.endIdx;d++){var f=n[d];if(!(d<l&&!f.notClear)){if(f.__inHover&&(this._hoverLayerDirty=_$),r!=null){var p=f.getPaintRect();p&&p.intersect(r)&&(xC(o,f,a),f.setPrevPaintRect(p))}else xC(o,f,a);if(s&&GP.getTime()-c>15){d++;break}}}SC(o,a),t.drawIdx=Math.max(d,l)},e.prototype.getLayer=function(e,t){return this._ensureLayer(e,0,t)},e.prototype._ensureLayer=function(e,t,n){t||=0;var r=this._singleCanvas;r&&!this._needsManuallyCompositing&&(e=m$,t=0);var i=hM(this._i,e)[t];return i||(i=uM(`zr_`+e+`.`+t,this,e,t),this._layerConfig[e]&&Aa(i,this._layerConfig[e],!0),(n||r&&e!==m$)&&(i.virtual=!0),this._insertLayer(i,e,t,!1),i.initContext()),i},e.prototype.insertLayer=function(e,t){this._insertLayer(t,e,0,!1)},e.prototype._insertLayer=function(e,t,n,r){var i=this._i,a=i.layers,o=i.layerStack,s=this._domRoot,c=null;if(!(a[t]&&a[t][n])&&cM(e)){for(var l=o.length,u=0;u<l&&(o[u].zl<t||o[u].zl===t&&o[u].zl2<n);)u++;if(u>0&&(c=hM(i,o[u-1].zl)[o[u-1].zl2]),o.splice(u,0,{zl:t,zl2:n}),hM(i,t)[n]=e,!r&&!e.virtual){if(c){var d=c.dom;d.nextSibling?s.insertBefore(e.dom,d.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)}e.painter||=this}},e.prototype.eachLayer=function(e,t){return gM(this._i,function(n,r){e.call(t,n,r)})},e.prototype.eachBuiltinLayer=function(e,t){return gM(this._i,function(n,r){e.call(t,n,r)},v$)},e.prototype.eachOtherLayer=function(e,t){return gM(this._i,function(n,r){e.call(t,n,r)},y$)},e.prototype.getLayers=function(){var e={};return gM(this._i,function(t,n,r){e[t.id]=t}),e},e.prototype._updateLayerStatus=function(e,t){var n=this;if(n._singleCanvas)for(var r=1;r<e.length;r++){var i=e[r];if(i.zlevel!==e[r-1].zlevel||i.incremental){n._needsManuallyCompositing=!0;break}}gM(n._i,function(e){e.__dirty=!1,mM(e,function(e){e.used=!1,e.endIdxNew=0,e.notClearIdx=-1})},x$);for(var a,o=null,s=null,c=!1,l=0,u=e.length;l<u;l++){var i=e[l],d=i.zlevel,f=i.incremental,p=void 0;if(a!==d&&(a=d,c=!1),f?(c=!0,p=1):p=c?2:0,(!o||d!==o.zlevel||p!==o.zlevel2)&&(o=n._ensureLayer(d,p),s=null,!o.__builtin__))Oa(`ZLevel `+d+` has been used by unknown layer `+o.id);else{if((!s||f!==s.key)&&(s=pM(o,f),!s.used)){if(s.used=!0,!t&&s.first===i.id){var m=l-s.startIdx;s.startIdx=l,s.drawIdx+=m,s.endIdx+=m}else o.__dirty=!0,s.first=i.id,s.startIdx=s.drawIdx=l,s.endIdx=l+1}s.endIdxNew=l+1,i.__dirty&1&&!i.__inHover&&((!f||!i.notClear&&l<s.drawIdx)&&(o.__dirty=!0),f&&i.notClear&&s.notClearIdx<0&&(s.notClearIdx=l))}}gM(n._i,function(t){for(var r=t.__cursorStack,i=t.__cursors,a=r.length-1;a>=0;a--){var o=i.get(r[a]);if(!o.used)t.__dirty=!0,i.removeKey(r[a]),r.splice(a,1);else{var s=o.endIdxNew;(oM(t)?s<o.drawIdx:s!==o.endIdx||!s||e[s-1].id!==o.last)&&(t.__dirty=!0),o.endIdx=o.endIdxNew,o.last=s?e[s-1].id:NaN}}t.__dirty&&(mM(t,function(e){e.drawIdx=e.startIdx}),n._hoverLayerDirty===h$&&(n._hoverLayerDirty=g$))},x$)},e.prototype.clear=function(){return gM(this._i,function(e){e.clear(),dM(e)},v$),this},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,gM(this._i,function(e){e.setUnpainted()})},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?Aa(n[e],t,!0):n[e]=t,gM(this._i,function(e,t){Aa(e,n[t],!0)})}},e.prototype.delLayer=function(e){for(var t=this._i.layerStack,n=this._i.layers,r=t.length-1;r>=0;r--){var i=t[r];if(i.zl===e){var a=n[e][i.zl2];if(a.__builtin__)continue;if(t.splice(r,1),n[e][i.zl2]=void 0,!a.virtual){var o=a.dom.parentNode;o&&o.removeChild(a.dom)}}}},e.prototype.resize=function(e,t){if(this._domRoot.style){var n=this._domRoot;n.style.display=`none`;var r=this._opts,i=this.root;e!=null&&(r.width=e),t!=null&&(r.height=t),e=eC(i,0,r),t=eC(i,1,r),n.style.display=``,(this._width!==e||t!==this._height)&&(n.style.width=e+`px`,n.style.height=t+`px`,gM(this._i,function(n){n.resize(e,t)}),this.refresh({paintAll:!0})),this._width=e,this._height=t}else{if(e==null||t==null)return;this._width=e,this._height=t,this._ensureLayer(m$).resize(e,t)}return this},e.prototype.clearLayer=function(e){L(this._i.layers[e],function(e){e&&!e.__builtin__&&e.clear()})},e.prototype.dispose=function(){this.root.innerHTML=``,this.root=this.storage=this._domRoot=this._i=null},e.prototype.getRenderedCanvas=function(e){if(e||={},this._singleCanvas&&!this._compositeManually)return this._i.layers[m$][0].dom;var t=new f$(`image`,this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var n=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var r=t.dom.width,i=t.dom.height;gM(this._i,function(e){e.__builtin__?n.drawImage(e.dom,0,0,r,i):e.renderToCanvas&&(n.save(),e.renderToCanvas(n),n.restore())})}else{for(var a={inHover:!1,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},o=this.storage.getDisplayList(!0),s=0,c=o.length;s<c;s++){var l=o[s];xC(n,l,a)}SC(n,a)}return t.dom},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e}(),C$=Object.freeze({INR:`₹`,USD:`$`,EUR:`€`,GBP:`£`,JPY:`¥`}),w$=e=>typeof e==`string`&&/^[A-Z]{3}$/.test(e),T$=(e=`INR`)=>C$[e]??`${e} `,E$=`en-IN`,D$=/\{([A-Za-z0-9_]+)\}/g,O$=new Map,k$=0,A$=new Map,j$={aprShortLabel:`Apr`,aprilLabel:`April`,augShortLabel:`Aug`,augustLabel:`August`,decShortLabel:`Dec`,decemberLabel:`December`,emptyValueLabel:`-`,febShortLabel:`Feb`,februaryLabel:`February`,friMinLabel:`Fr`,friShortLabel:`Fri`,fridayLabel:`Friday`,janShortLabel:`Jan`,januaryLabel:`January`,julShortLabel:`Jul`,julyLabel:`July`,junShortLabel:`Jun`,juneLabel:`June`,marShortLabel:`Mar`,marchLabel:`March`,mayLabel:`May`,mayShortLabel:`May`,monMinLabel:`Mo`,monShortLabel:`Mon`,mondayLabel:`Monday`,novShortLabel:`Nov`,novemberLabel:`November`,octShortLabel:`Oct`,octoberLabel:`October`,satMinLabel:`Sa`,satShortLabel:`Sat`,saturdayLabel:`Saturday`,sepShortLabel:`Sep`,septemberLabel:`September`,sunMinLabel:`Su`,sunShortLabel:`Sun`,sundayLabel:`Sunday`,thuMinLabel:`Th`,thuShortLabel:`Thu`,thursdayLabel:`Thursday`,tueMinLabel:`Tu`,tueShortLabel:`Tue`,tuesdayLabel:`Tuesday`,wedMinLabel:`We`,wedShortLabel:`Wed`,wednesdayLabel:`Wednesday`},M$=`Asia/Kolkata`,N$=198e5,P$=new Map,F$=[`number`,`currency`,`percent`,`compact`,`duration`,`date`],I$=[`rupees`,`paise`],L$=[`ms`,`s`,`min`,`h`],R$=[`day`,`month`,`year`,`datetime`,`time`],z$=()=>xM(`formatters`,j$),B$=()=>z$().emptyValueLabel,V$=`−`,H$=[`janShortLabel`,`febShortLabel`,`marShortLabel`,`aprShortLabel`,`mayShortLabel`,`junShortLabel`,`julShortLabel`,`augShortLabel`,`sepShortLabel`,`octShortLabel`,`novShortLabel`,`decShortLabel`],U$={short:[`sunShortLabel`,`monShortLabel`,`tueShortLabel`,`wedShortLabel`,`thuShortLabel`,`friShortLabel`,`satShortLabel`],long:[`sundayLabel`,`mondayLabel`,`tuesdayLabel`,`wednesdayLabel`,`thursdayLabel`,`fridayLabel`,`saturdayLabel`],min:[`sunMinLabel`,`monMinLabel`,`tueMinLabel`,`wedMinLabel`,`thuMinLabel`,`friMinLabel`,`satMinLabel`]},W$=(e,t)=>z$()[bM(e[t],`no date name at index ${t}`)],G$=e=>W$(H$,e),K$=(e,t)=>bM(e[t],`no compact unit at index ${t}`),q$=[[1e7,`Cr`],[1e5,`L`],[1e3,`K`]],J$=[[1e9,`B`],[1e6,`M`],[1e3,`K`]],Y$=e=>!e||e===`INR`?`en-IN`:`en-US`,X$=(e,t)=>typeof e==`number`&&Number.isInteger(e)&&e>=0&&e<=20?e:t,Z$=new Map,Q$=(e,t=`en-IN`)=>{let n=`${t}:${e}`,r=Z$.get(n);return r||(r=new Intl.NumberFormat(t,{minimumFractionDigits:0,maximumFractionDigits:e}),Z$.set(n,r)),r},$$=new Map,e1=(e,t=`en-IN`)=>{let n=`${t}:${e}`,r=$$.get(n);return r||(r=new Intl.NumberFormat(t,{minimumFractionDigits:e,maximumFractionDigits:e}),$$.set(n,r)),r},t1=e=>typeof e==`number`&&Number.isFinite(e),n1=e=>e<0&&!Object.is(Math.abs(e),0)?V$:``,r1=(e,t)=>t===`paise`?Number(PM(e)):e,i1=2,a1=(e,t,n)=>{let r=Math.min(t,i1),i=10n**BigInt(i1-r),a=(BigInt(PM(e).replace(`.`,``))+i/2n)/i,o=10n**BigInt(r),s=e1(0,n).format(a/o);return t===0?s:`${s}.${(a%o).toString().padStart(r,`0`)}${`0`.repeat(t-r)}`},o1=e=>e>0&&e<.1?Math.min(20,1-Math.floor(Math.log10(e))):2,s1={ms:1,s:1e3,min:6e4,h:36e5},c1={aboveLabel:`Above`,areaChartLabel:`Area chart`,arrowKeysText:`{title}: use the arrow keys to read the values`,bandLabel:`Band`,barChartLabel:`Bar chart`,belowLabel:`Below`,bubbleChartLabel:`Bubble chart`,calendarHeatmapLabel:`Calendar heatmap`,calendarRangeText:`, from {first} to {last}`,calendarSummaryTextOne:`Calendar heatmap of {label}, {n} day.`,calendarSummaryTextOther:`Calendar heatmap of {label}, {n} days{range}.`,categoryLabel:`Category`,centerLabel:`Total`,changeLabel:`Change`,chartLabel:`chart`,columnChartLabel:`Column chart`,columnFallbackLabel:`column`,columnXLabel:`X`,constantSpanText:`{label} is {lo}.`,dataSuffixLabel:`data`,dateLabel:`Date`,donutChartLabel:`Donut chart`,donutLargestText:`{top} is the largest, at {share}.`,donutSummaryTextOne:`Donut chart of {label} in {rows} part, {total} in all.`,donutSummaryTextOther:`Donut chart of {label} in {rows} parts, {total} in all.`,emptyText:`No data to show for this chart.`,errorText:`This chart couldn't load. Try again in a moment.`,everySeriesHiddenText:`Every series is hidden.`,firstStageLabel:`first stage`,fromLabel:`From`,funnelChartLabel:`Funnel chart`,funnelPreviousStepText:`{share} of previous step`,funnelStartText:`{first} is {firstValue} and {last} is {lastValue}, {share} of the start.`,funnelSummaryText:`Funnel chart of {label} in {n} stages.`,gaugeBandText:`, in the {band} band`,gaugeLabel:`Gauge`,gaugeSummaryText:`{type}: {label} is {value} on a scale from {min} to {max}{band}.`,groupLabel:`Group`,groupsTextOne:` in {count} group: {groups}`,groupsTextOther:` in {count} groups: {groups}`,heatmapLabel:`Heatmap`,heatmapSummaryText:`Heatmap of {label} by {group} and {x}, {n} cells.`,highestAtLowestAtText:`Highest is {highValue} at {highGroup}, {high}; lowest is {lowValue} at {lowGroup}, {low}.`,highestLowestText:`Highest is {maxValue} on {max}; lowest is {minValue} on {min}.`,itemLabel:`Item`,largestFallText:`The largest fall is {xText}, {signed}.`,largestFlowText:`The largest flow is {xText} to {toText}, {fmtAt}.`,largestRiseText:`The largest rise is {xText}, {signed}.`,latestText:`Latest {latest}`,legendLabel:`Legend`,lessLabel:`Less`,lineChartLabel:`Line chart`,loadingText:`Loading chart`,measureLabel:`Measure`,moreLabel:`More`,ofFirstStepText:`Of {first}`,ofPreviousStepLabel:`Of previous step`,openingShareText:`{share} of opening`,opensAtClosesAtText:`It opens at {opening} and closes at {closing}.`,otherLabel:`Other`,pointsSummaryTextOne:`{n} point, {first}.`,pointsSummaryTextOther:`{n} points, from {first} to {last}.`,rangeSpanText:`{label} runs from {lo} to {hi}.`,rowFallbackLabel:`row`,rowLabel:`Row`,runningTotalLabel:`Running total`,sankeyLabel:`Sankey diagram`,sankeySummaryText:`Sankey diagram of {label}: {n} flows between {nodes} places.`,scaleLabel:`Scale`,scaleRangeText:`{min} to {max}`,scatterPlotLabel:`Scatter plot`,scatterSummaryText:`{type} of {label} against {xLabel}, {count} points{groups}.`,shareLabel:`Share`,shareOfAllLabel:`Share of all`,shareOfGroupLabel:`Share of group`,shareOfParentText:`Share of {parent}`,shareOfStepText:`{share} of {first}`,sharedAxisText:`, sharing one x axis`,showingFirstRowsDownloadText:`Showing the first {rows} of {total} rows. Download the CSV for all of them.`,smallMultiplesLabel:`Small multiples`,stackedPercentText:`, stacked to 100%`,stackedText:`, stacked`,stageLabel:`Stage`,stepLabel:`Step`,summaryText:`{type} of {series}{stacked}{sharedAxis}.`,targetGapText:`{direction} {label} by {gap}`,targetLabel:`target`,toLabel:`To`,tooManyGroupsText:`This chart has more groups than it can show clearly.`,tooManySeriesText:`This chart has more series than it can show clearly.`,totalText:`Total {total}`,treemapEmptyText:`Treemap of {label}: no items.`,treemapLabel:`Treemap`,treemapLargestGroupText:`{name} is the largest group, at {share}.`,treemapSummaryText:`Treemap of {label}: {n} items in {totals} groups, {total} in all.`,trendLabel:`Trend`,untitledLabel:`Chart`,waterfallLabel:`Waterfall chart`,waterfallSummaryText:`Waterfall chart of {label}.`},Q=()=>xM(`chart`,c1),l1=[`line`,`area`,`column`,`bar`,`donut`,`heatmap`,`calendar`,`funnel`,`gauge`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`,`multiples`],u1=[`none`,`stacked`,`percent`],d1=[`category`,`time`,`value`],f1=[`auto`,`svg`,`canvas`],p1=[`ready`,`loading`,`empty`,`error`],m1=[`chart`,`table`],h1={line:`lineChartLabel`,area:`areaChartLabel`,column:`columnChartLabel`,bar:`barChartLabel`,donut:`donutChartLabel`,heatmap:`heatmapLabel`,calendar:`calendarHeatmapLabel`,funnel:`funnelChartLabel`,gauge:`gaugeLabel`,waterfall:`waterfallLabel`,treemap:`treemapLabel`,sankey:`sankeyLabel`,scatter:`scatterPlotLabel`,bubble:`bubbleChartLabel`,multiples:`smallMultiplesLabel`},g1=e=>Q()[h1[e]],_1=[`donut`,`heatmap`,`calendar`,`funnel`,`gauge`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`],v1=e=>_1.includes(e),y1=[`area`,`column`,`bar`],b1=[`line`,`area`,`column`,`bar`,`multiples`],x1={line:[`category`,`time`],area:[`category`,`time`],column:[`category`,`time`],bar:[`category`,`time`],multiples:[`category`,`time`],calendar:[`time`],scatter:[`value`],bubble:[`value`]},S1={group:[`heatmap`,`treemap`,`scatter`,`bubble`],to:[`sankey`],size:[`bubble`],trend:[`scatter`,`bubble`],zoom:[`line`,`area`],bands:[`gauge`],centerLabel:[`donut`],valueLabels:[`column`,`bar`]},C1={gauge:240,calendar:200,treemap:340,sankey:340},w1=100,T1=72,E1=32,D1=[`type`,`title`,`description`,`data`,`x`,`series`,`group`,`to`,`size`,`trend`,`zoom`,`bands`,`stack`,`y`,`target`,`centerLabel`,`valueLabels`,`height`,`state`,`emptyText`,`errorText`,`loadingText`,`renderer`,`timeZone`],O1=[`key`,`kind`,`format`,`label`,`labelFit`],k1=[`auto`,`all`,`rotate`,`ellipsis`],A1=[`key`,`label`,`format`],j1=[`key`,`label`],M1=[`key`,`label`,`format`],N1=[`upTo`,`label`],P1=[`label`,`format`,`min`,`max`,`wholeNumbers`],F1=[`value`,`label`],I1=[`style`,`currency`,`unit`,`decimals`,`pattern`],L1=[...I$,...L$],R1=new Set,z1=e=>e.map(e=>`"${e}"`).join(` | `),B1=e=>typeof e==`number`&&Number.isFinite(e),V1=e=>typeof e==`object`&&!!e&&!Array.isArray(e),H1=(e,t)=>Reflect.get(e,t),U1=e=>e===null||typeof e==`string`||typeof e==`number`,W1=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,U1(t)?t:null])),G1=(e,t)=>e.some(e=>e===t),K1=e=>[...new Set(e)],q1=e=>e.reduce((e,t)=>Number.isNaN(t)?e:Math.min(e,t),1/0),J1=e=>e.reduce((e,t)=>Number.isNaN(t)?e:Math.max(e,t),-1/0),Y1=(e,t)=>e.data.map((n,r)=>K(e,t,r)).filter(e=>e!=null),X1=(e,t)=>t?G((e??0)/t,{style:`percent`}):B$(),Z1=(e,t)=>t==null?B$():KM(vN(e,t),`gauge band`).label,Q1=(e,t,n)=>{if(!t.length)return null;let r=q1(t),i=J1(t);return r===i?CM(Q().constantSpanText,{label:e,lo:G(r,n)}):CM(Q().rangeSpanText,{label:e,lo:G(r,n),hi:G(i,n)})},$1=(e,t)=>{let n=eN(e);return G(K(e,n.key,t),n.format)},e0=864e5,t0={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1},n0=e=>t0[e]??0,r0=[`donut`,`funnel`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`],i0=()=>xM(`chart`,c1),XC([fv,Ib,lx,AD,QE,qE,jE,DD,Pw,jO,Ek,lA,Yk,KO,PO,MA,wA,jk,ij,IA,vee,_M]),a0=e=>typeof e==`number`,o0=e=>a0(e)?e:null,s0=[`series`,`graphic`,`grid`,`xAxis`,`yAxis`,`title`,`visualMap`,`calendar`,`dataZoom`],c0=e=>String(e).replace(/[{}]/g,e=>e===`{`?`{`:`}`),l0=(e,t)=>{let n=e.filter(e=>typeof e==`number`&&Number.isFinite(e));return[Math.min(...t?[0,...n]:n),Math.max(...t?[0,...n]:n)]},u0=24,d0=4,f0=.6,p0=(e,t)=>String(e).length*t*f0,m0=(e,t)=>{let n=e[t];if(n===void 0)throw Error(`chart palette has no colour at slot ${t}`);return n},h0=[.2126,.7152,.0722],g0=e=>e.map(e=>e/255).map(e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4).reduce((e,t,n)=>e+t*(h0[n]??0),0),_0=(e,t)=>(Math.max(e,t)+.05)/(Math.min(e,t)+.05),v0=(e,t)=>({type:`linear`,x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:$N(e,t)},{offset:1,color:$N(e,0)}]}),y0=(e,t)=>e+jM(e,t),b0=e=>[...new Set(e)],x0=(e,t)=>e.data.map((n,r)=>K(e,t,r)),S0=(e,t,n={})=>({type:`category`,data:t,axisLine:{lineStyle:{color:e.axis}},axisTick:{show:!1},axisLabel:{color:e.label,fontSize:12,margin:12,hideOverlap:!0},...n}),C0=(e,t,n={})=>({type:`value`,splitNumber:4,axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:e.grid,type:`solid`,width:1}},axisLabel:{color:e.label,fontSize:12,formatter:t},...n}),w0=6048e5,T0=(e,t)=>{let n=AM(e,t);return`${n.year}-${String(n.month+1).padStart(2,`0`)}-${String(n.day).padStart(2,`0`)}`},E0=e=>e.reduce((e,t)=>Number.isNaN(t)?e:Math.min(t,e),1/0),D0=e=>e.reduce((e,t)=>Number.isNaN(t)?e:Math.max(t,e),-1/0),O0=9,k0=24,A0=4,j0=72,M0=12,N0=(e,t)=>Math.floor(t/Math.max(1,e)-A0),P0=44,F0=28,I0=8,L0=32,R0=8,z0=26,B0={donut:oP,heatmap:lP,calendar:dP,funnel:fP,gauge:pP,waterfall:vP,treemap:bP,sankey:SP,scatter:wP,bubble:wP,multiples:TP},V0=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`,typeof HTMLElement>`u`)throw Error(V0);H0=HTMLElement,U0=()=>xM(`chart`,c1),W0=`wui-chart:select`,G0=`wui-chart:legend-change`,K0=`wui-chart:ready`,q0=[`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`,`Escape`],J0=`(prefers-color-scheme: dark)`,Y0=`(prefers-reduced-motion: reduce)`,X0=`(forced-colors: active)`,Z0=`(prefers-contrast: more)`,Q0=`print`,$0=e=>typeof window.matchMedia==`function`?window.matchMedia(e):null,e2=!1,t2=new Map,n2=[...[1,2,3,4,5,6,7,8].map(e=>`--color-chart-${e}`),...[0,1,2,3,4,5,6].map(e=>`--color-chart-seq-${e}`),`--color-chart-neutral`,`--color-chart-grid`,`--color-chart-axis`,`--color-chart-label`,`--color-surface`,`--color-text`,`--color-text-body`,`--color-text-muted`],r2=new Set,i2=null,a2=(e,t,n)=>{let r=document.createElement(e);return t&&(r.className=t),n!=null&&(r.textContent=n),r},o2=0,s2=class extends H0{uid;_spec;_normal;_hidden;_focus;_awaitingSpec=!1;_parts=null;_theme=null;_width=null;_visible=!1;_resizeObserver=null;_intersection=null;_engine=null;_drawn=!1;_drawnType=null;_announcedReady=!1;_legendSignature=null;_tableSpec=null;static get observedAttributes(){return[`view`]}constructor(){super(),o2+=1,this.uid=`wui-chart-${o2}`,this._spec=null,this._normal=null,this._hidden=new Set,this._focus=null}get spec(){return this._spec}set spec(e){this._spec=e??null,this._normal=null,this._clearFocus(),this._parts&&this._update()}get view(){return this.getAttribute(`view`)===`table`?`table`:`chart`}set view(e){this.setAttribute(`view`,String(e??`chart`))}connectedCallback(){if(Object.hasOwn(this,`spec`)){let e=this.spec;delete this.spec,this._spec=e??null}if(this._spec??=this._readScript(),this._spec==null&&!this.querySelector(`:scope > script[type='application/json']`)&&(this._awaitingSpec=!0,queueMicrotask(()=>{this._awaitingSpec=!1,this._parts&&this._update()})),this._build(),PP(this),this._theme=NP(this),this._width=this.clientWidth,this._resizeObserver=new ResizeObserver(()=>this._resized()),this._resizeObserver.observe(this),typeof IntersectionObserver==`function`){this._visible=!1;let e=new IntersectionObserver(t=>{t.some(e=>e.isIntersecting)&&(e.disconnect(),this._visible=!0,this._update())},{threshold:.05});this._intersection=e,e.observe(this)}else this._visible=!0;this._update()}disconnectedCallback(){FP(this),this._resizeObserver?.disconnect(),this._intersection?.disconnect(),this._engine?.dispose(),this._engine=null,this._drawn=!1,this._parts=null,this.removeAttribute(`data-ready`)}attributeChangedCallback(e,t,n){t!==n&&this._parts&&(qM(`view`,n,m1),this._update())}toCsv(){let{spec:e}=this._normalized();return e?NN(e):``}toPng(){let{spec:e}=this._normalized();return e?kP(e,this._theme??NP(this),this._size(e),{hidden:this._hidden,renderer:lN(e)}):``}exportCsv(e){let t=URL.createObjectURL(new Blob([this.toCsv()],{type:`text/csv;charset=utf-8`}));IP(t,e??`${PN(this._normalized().spec)}.csv`),setTimeout(()=>URL.revokeObjectURL(t),2e3)}exportPng(e){let t=this.toPng();t&&IP(t,e??`${PN(this._normalized().spec)}.png`)}_readScript(){let e=this.querySelector(`:scope > script[type="application/json"]`);if(!(e instanceof HTMLScriptElement))return null;try{return JSON.parse(String(e.textContent))}catch(e){return yM(`[@webority/ui-elements] <wui-chart> could not read its JSON spec:`,e instanceof Error?e.message:void 0),null}}_normalized(){return this._normal??=XM(this._spec),this._normal}_build(){let e=a2(`div`,`wui-chart-legend`);e.setAttribute(`role`,`group`),e.setAttribute(`aria-label`,U0().legendLabel),e.hidden=!0,e.addEventListener(`click`,e=>{let t=e.target instanceof Element?e.target.closest(`.wui-chart-legend-item`):null;t instanceof HTMLElement&&this._toggle(t.dataset.key)});let t=a2(`div`,`wui-chart-surface`);t.tabIndex=0,t.setAttribute(`role`,`group`),t.setAttribute(`aria-roledescription`,U0().chartLabel),t.addEventListener(`keydown`,e=>this._onKey(e)),t.addEventListener(`blur`,()=>this._clearFocus());let n=a2(`div`,`wui-chart-canvas`);n.setAttribute(`aria-hidden`,`true`),t.append(n);let r=a2(`div`,`wui-chart-state`);r.setAttribute(`role`,`status`),r.hidden=!0;let i=a2(`div`,`wui-chart-table-wrap visually-hidden`),a=a2(`p`,`visually-hidden`);a.id=`${this.uid}-summary`;let o=a2(`div`,`visually-hidden`);o.setAttribute(`aria-live`,`polite`),this.replaceChildren(e,t,r,i,a,o),this.setAttribute(`role`,`figure`),this.setAttribute(`aria-describedby`,a.id),this._parts={legend:e,surface:t,canvas:n,state:r,tableWrap:i,summary:a,live:o},this._legendSignature=null,this._tableSpec=null}_size(e){return{width:this._parts?.surface.clientWidth||this.clientWidth||800,height:e.height}}_update(){if(!this._parts||this._awaitingSpec&&this._spec==null)return;let{spec:e,problem:t}=this._normalized(),n=this._parts,r=e===null?`error`:e.state===`ready`&&(!e.data.length||!nN(e))?`empty`:e.state,i=`${e?.height??320}px`,a=this.view===`table`,o=e!==null&&(r===`ready`||r===`loading`&&this._drawn),s=r===`loading`&&o;if(this.setAttribute(`aria-label`,e?.title||U0().untitledLabel),r===`loading`?this.setAttribute(`aria-busy`,`true`):this.removeAttribute(`aria-busy`),this.setAttribute(`data-state`,r),n.surface.setAttribute(`aria-label`,CM(U0().arrowKeysText,{title:e?.title||U0().untitledLabel})),n.summary.textContent=e?FN(e,this._hidden):``,e){if(!s){let t=new Set(uN(e));for(let e of this._hidden)t.has(e)||this._hidden.delete(e)}this._renderTable(e)}else n.tableWrap.replaceChildren();s||this._renderLegend(e,o&&!a),this._renderState(r,e===null?t:r===`error`?e.errorText:r===`loading`?e.loadingText??U0().loadingText:e.emptyText,i,o);let c=r===`ready`&&!a;s||this.toggleAttribute(`data-ready`,!c);let l=n.surface.hidden&&o&&!a;n.surface.hidden=!o||a,n.surface.style.height=i,n.tableWrap.className=a&&e?`wui-chart-table-wrap`:`wui-chart-table-wrap visually-hidden`,n.tableWrap.style.height=a&&e?i:``,a&&e?(n.tableWrap.tabIndex=0,n.tableWrap.setAttribute(`role`,`region`),n.tableWrap.setAttribute(`aria-label`,`${e.title||U0().untitledLabel} ${U0().dataSuffixLabel}`)):(n.tableWrap.removeAttribute(`tabindex`),n.tableWrap.removeAttribute(`role`),n.tableWrap.removeAttribute(`aria-label`)),l&&this._engine?.resize(),r===`ready`&&!a&&this._visible&&this._draw()}_renderState(e,t,n,r){let i=this._parts?.state;if(!i)return;let a=!r&&e!==`ready`;i.hidden=!a,a?(i.style.height=n,e===`loading`?i.replaceChildren(a2(`div`,`skeleton wui-chart-skeleton`),a2(`span`,`visually-hidden`,t)):i.replaceChildren(a2(`p`,`wui-chart-state-text`,t))):i.replaceChildren()}_colour(e,t){let n=this._theme;if(n)return e.type===`donut`?CN(e,t,n):n.palette[t]}_renderLegend(e,t){let n=this._parts?.legend;if(!n)return;let r=e?uN(e):[],i=!!e&&t&&r.length>=2;if(n.hidden=!i,!e||!i)return;let a=dN(e),o=r.map((t,n)=>this._colour(e,n)),s=JSON.stringify([e.type,r,a,o]);s!==this._legendSignature&&(this._legendSignature=s,n.replaceChildren(...r.map((t,n)=>{let r=a2(`button`,`wui-chart-legend-item`);r.type=`button`,r.dataset.key=t;let i=a2(`span`,e.type===`line`?`wui-chart-legend-swatch wui-chart-legend-swatch-line`:`wui-chart-legend-swatch`),s=o[n];return s!==void 0&&(i.style.background=s),r.append(i,a2(`span`,`wui-chart-legend-label`,a[n])),r})));for(let e of n.children){if(!(e instanceof HTMLElement))throw Error(`Expected a legend item to be an HTMLElement.`);let t=e.dataset.key;e.setAttribute(`aria-pressed`,String(t===void 0||!this._hidden.has(t)))}}_renderTable(e){if(this._tableSpec===e||!this._parts)return;this._tableSpec=e;let t=AN(e),n=a2(`table`,`wui-chart-table`);n.append(a2(`caption`,`visually-hidden`,t.caption));let r=a2(`tr`);t.head.forEach((e,t)=>{let n=a2(`th`,t?`wui-chart-num`:null,e);n.scope=`col`,r.append(n)});let i=a2(`thead`);i.append(r),n.append(i);let a=a2(`tbody`);for(let e of t.rows){let t=a2(`tr`),n=a2(`th`,null,e.head);n.scope=`row`,t.append(n,...e.cells.map(e=>a2(`td`,`wui-chart-num`,e))),a.append(t)}n.append(a);let o=[n];t.truncated&&o.push(a2(`p`,`wui-chart-table-note`,CM(U0().showingFirstRowsDownloadText,{rows:t.rows.length,total:t.total}))),this._parts.tableWrap.replaceChildren(...o)}_draw(){let{spec:e}=this._normalized();if(!e||!this._parts||!this._theme)return;let t=lN(e),n=e.type!==this._drawnType;this._engine&&this._engine.renderer!==t&&(this._engine.dispose(),this._engine=null);let r=`${e.height}px`,i=this._parts.canvas.style.height!==r;this._parts.canvas.style.height=r,i&&this._engine?.resize(),this._engine||(this._engine=AP(this._parts.canvas,{renderer:t}),this._engine.onSelect(({seriesIndex:e,dataIndex:t})=>this._select(e,t)),this._engine.onFinished(()=>{this.setAttribute(`data-ready`,``),this._announcedReady||(this._announcedReady=!0,this.dispatchEvent(new CustomEvent(K0,{bubbles:!0,detail:{renderer:t}})))}),n=!0),this._engine.render(e,this._theme,this._size(e),{hidden:this._hidden,renderer:t},{replace:n}),this._drawnType=e.type,this._drawn=!0}_themeChanged(e=!1){if(!this._parts)return;let t=NP(this);JSON.stringify(t)!==JSON.stringify(this._theme)&&(this._theme=t,this._update(),e&&this._engine?.flush())}_resized(){let e=this.clientWidth;e!==this._width&&(this._width=e,this._engine&&this._drawn&&this._parts&&(this._parts.surface.hidden||this._engine.resize(),this._update()))}_toggle(e){let{spec:t}=this._normalized();if(!t||e==null)return;this._hidden.has(e)?this._hidden.delete(e):this._hidden.add(e),this._clearFocus(),this._update();let n=Object.fromEntries(uN(t).map(e=>[e,!this._hidden.has(e)]));this.dispatchEvent(new CustomEvent(G0,{bubbles:!0,detail:{visible:n}}))}_onKey(e){let{spec:t}=this._normalized();if(!t||!this._engine||!this._theme||this.view===`table`||e.altKey||e.ctrlKey||e.metaKey)return;if(jP(e)){if(!this._focus)return;e.preventDefault(),this._select(this._focus.series,this._focus.index);return}if(!q0.includes(e.key)||e.key===`Escape`&&!this._focus)return;e.preventDefault();let n=zN(t,this._focus,e.key,this._hidden);n?(this._focus=n,this._engine.focusPoint(n.series,n.index),this._announce(ON(wN(t,n.index,this._hidden,this._theme)))):this._clearFocus()}_announce(e){let t=this._parts?.live;t&&(t.textContent=e===t.textContent?`${e} `:e)}_clearFocus(){this._focus&&(this._focus=null,this._engine?.clearFocus(),this._parts&&(this._parts.live.textContent=``))}_select(e,t){let{spec:n}=this._normalized();if(!n)return;let r=n.series[v1(n.type)?0:e];if(!r)return;let i=n.data[t]??null;this.dispatchEvent(new CustomEvent(W0,{bubbles:!0,detail:{series:r.key,label:r.label,x:i?.[n.x.key]??null,value:K(n,r.key,t),row:i,index:t}}))}},Ta(`wui-chart`,s2)})),l2=null;async function u2(){await Promise.resolve().then(()=>(c2(),wa)),await customElements.whenDefined(`wui-chart`)}async function d2(){return l2??=u2().catch(e=>{throw l2=null,e}),l2}var f2={sub:`wui-chat-sub`,sup:`wui-chat-sup`};function p2(e,t){let n=e.ownerDocument??document;for(let r of t)if(r.kind===`sub`||r.kind===`sup`){let t=n.createElement(r.kind);t.className=f2[r.kind],t.textContent=r.text,e.append(t)}else e.append(n.createTextNode(r.text))}function m2(e,t){e.replaceChildren(),p2(e,fn(String(t??``)))}function h2(e){return pn(String(e??``))}function g2(e){return mn(e)}var _2=8,v2=8,y2={Bar:`column`,Line:`line`,Donut:`donut`};function b2(e,t){return e===`Bar`&&t>4?300:240}function x2(e,t){let n=e.chartType===`Donut`,r=n?e.series.slice(0,1):e.series.slice(0,_2),i=r.map((e,n)=>({key:`s${n}`,label:h2(e.name)||t.chart})),a=Object.fromEntries(i.map(e=>[e.key,null])),o=new Map;r.forEach((e,t)=>{for(let n of e.points){let e=String(n.label),r=o.get(e);r===void 0&&(r={label:h2(e),...a},o.set(e,r)),r[`s${t}`]=n.value}});let s=[...o.values()],c={type:y2[e.chartType],title:h2(e.title)||t.chart,x:{key:`label`,kind:`category`},series:i,data:s,height:b2(e.chartType,s.length)};return e.chartType===`Bar`&&s.length<=v2&&(c.x.labelFit=`all`,c.valueLabels=!0),!n&&e.unit&&(c.y={label:h2(e.unit)}),s.length===0&&(c.state=`empty`,c.emptyText=t.chartEmpty),c}pa(`wui-chat-part-chart`,class extends fa{#e=null;#t=0;#n=null;#r=null;#i=null;#a=null;renderPart(e,t,n){let r=JSON.stringify(e);if(r===this.#e)return;this.#e=r,this.#t+=1;let i=this.#t,a=this.ownerDocument??document,o=this.#o(a);if(this.#r?.remove(),this.#r=null,e.title){let t=P(a,`figcaption`,`wui-chat-chart-title`);m2(t,e.title),o.figure.prepend(t),this.#r=t}let s=this.#i;if(s!==null){let t=x2(e,n.labels);Object.assign(s,{spec:t}),this.#s(o,s,t.state!==`empty`,n.labels)}else d2().then(()=>{if(i!==this.#t||!this.isConnected)return;let t=x2(e,n.labels),r=a.createElement(`wui-chart`);Object.assign(r,{spec:t}),this.#i=r,o.body.replaceChildren(r),this.#s(o,r,t.state!==`empty`,n.labels)},()=>{i===this.#t&&this.isConnected&&this.#l(o.body,n.labels)})}disposePart(){this.#t+=1,this.#e=null}#o(e){if(this.#n===null){let t=P(e,`figure`,`wui-chat-chart`),n=P(e,`div`,`wui-chat-chart-body`);t.append(n),this.replaceChildren(t),this.#n={figure:t,body:n}}return this.#n}#s(e,t,n,r){if(!n){this.#a?.remove(),this.#a=null;return}if(!this.#a){let n=P(this.ownerDocument??document,`button`,`btn btn-link btn-sm wui-chat-chart-toggle`);n.type=`button`,n.addEventListener(`click`,()=>this.#c(e,t)),e.figure.append(n),this.#a=n}let i=t.getAttribute(`view`)===`table`;this.#a.setAttribute(`aria-pressed`,String(i)),this.#a.textContent=i?r.chartShowChart:r.chartShowTable}#c(e,t){let n=this.activeTurn,r=t.getAttribute(`view`)!==`table`;t.setAttribute(`view`,r?`table`:`chart`),this.#s(e,t,!0,n.labels)}#l(e,t){let n=P(this.ownerDocument??document,`p`,`wui-chat-chart-error`,t.chartLoadFailed);n.setAttribute(`role`,`status`),e.replaceChildren(n),this.#a?.remove(),this.#a=null}});var S2={Positive:`wui-metric-tone-success`,Caution:`wui-metric-tone-warning`,Negative:`wui-metric-tone-danger`},C2=new Set([`Positive`,`Caution`,`Negative`]),w2=.001;function T2(e,t,n){let r=S2[t.status],i=P(e,`div`,r?`wui-metric ${r}`:`wui-metric`);i.dataset.status=t.status;let a=P(e,`div`,`wui-metric-label`);m2(a,t.label);let o=P(e,`div`,`wui-metric-value`);if(p2(o,t.value!==0&&Math.abs(t.value)<w2?g2(t.value):[{kind:`text`,text:Hi(t.value)}]),t.unit){let n=P(e,`span`,`wui-chat-figure-unit`);m2(n,t.unit),n.prepend(` `),o.append(n)}return C2.has(t.status)&&o.append(P(e,`span`,`visually-hidden`,n.figureStatus(t.status))),i.append(a,o),i}pa(`wui-chat-part-figures`,class extends fa{#e=null;renderPart(e,t,n){let r=JSON.stringify(e);if(r===this.#e)return;if(this.#e=r,!e.figures||e.figures.length===0){this.replaceChildren();return}let i=this.ownerDocument??document,a=P(i,`div`,`wui-chat-figures`),o=P(i,`div`,`wui-metric-strip wui-metric-strip-sm wui-chat-figures-strip`);o.setAttribute(`role`,`group`),o.setAttribute(`aria-label`,n.labels.figures);for(let t of e.figures)o.append(T2(i,t,n.labels));a.append(o),this.replaceChildren(a)}}),pa(`wui-chat-part-file`,class extends fa{renderPart(e,t,n){let r=n.openAttachment,i=typeof r==`function`,a=document.createElement(i?`button`:`span`);a.className=`wui-chat-file-chip`,i&&(a.setAttribute(`type`,`button`),a.setAttribute(`aria-label`,n.labels.fileOpen(e.fileName)),a.addEventListener(`click`,()=>r(e)));let o=ma(document,`document-text`,16),s=document.createElement(`span`);s.className=`wui-chat-file-name`,s.textContent=e.fileName;let c=document.createElement(`span`);c.className=`wui-chat-file-size`,c.textContent=nr(e.length),a.append(...[o,s,c].filter(e=>e!==null));let l=document.createElement(`div`);l.className=`wui-chat-file`,l.append(a),this.replaceChildren(l)}});var E2=`(prefers-reduced-motion: reduce)`;function D2(e,t){let n=e.style.animation;e.style.animation=`none`;let r=e.getBoundingClientRect();e.style.animation=n,e.style.transformOrigin=`${t.left+t.width/2-r.left}px ${t.top+t.height/2-r.top}px`}function O2(e,t){let n=typeof window.matchMedia==`function`?window.matchMedia(E2):null,r=new Set,i=()=>e.motion===`Reduced`||t?.motion===!1||n?.matches===!0,a=i();function o(){let e=i();if(e!==a){a=e;for(let e of r)e(a)}}return n?.addEventListener(`change`,o),{get reduced(){return a},subscribe(e){return r.add(e),()=>{r.delete(e)}},destroy(){n?.removeEventListener(`change`,o),r.clear()}}}var k2=`AppButton`,A2={primary:`btn-primary`,secondary:`btn-soft-primary`,ghost:`btn-ghost-primary`,outline:`btn-outline-primary`,neutral:`btn-soft-neutral`,danger:`btn-danger`};function $(e,t,n){let r=document.createElement(e);if(t&&(r.className=t),n)for(let[e,t]of Object.entries(n))t!=null&&r.setAttribute(e,t);return r}function j2(e,t=16){let n=Ki(e,{size:t});if(!n)return $(`span`,`d-inline-flex`);let r=document.createElement(`template`);return r.innerHTML=n,r.content.firstElementChild??$(`span`,`d-inline-flex`)}function M2(e=`primary`,t=`md`){if(!Object.hasOwn(A2,e))throw Error(`Unknown button variant "${e}". Use one of ${Object.keys(A2).join(`, `)}.`);return`btn ${A2[e]}${t===`sm`?` btn-sm`:``}`}function N2(e,t,n,r){let i=$(`button`,`${M2(e,`sm`)} wui-chat-action-btn`,{type:`button`});return i.dataset.wui=k2,n&&i.append(j2(n,14)),i.append(document.createTextNode(t)),i.addEventListener(`click`,r),i}function P2(e,t,n){let r=$(`button`,`wui-chat-icon-btn`,{type:`button`,"aria-label":e,title:e});return r.append(j2(t,20)),r.addEventListener(`click`,n),r}function F2(e,t){let n=e.getAttribute(t);if(n!=null&&n!==``)try{return JSON.parse(n)}catch{throw Error(`<wui-chat ${t}> must be valid JSON.`)}}function I2(e){let t;return n=>{let r=e.dataset.state;if((!n||r!==`open`&&r!==`opening`)&&(n||r!==`closed`&&r!==`closing`)){if(clearTimeout(t),n)e.dataset.state=`opening`,t=setTimeout(()=>{e.dataset.state=`open`},620);else{e.dataset.state=`closing`;let n=e.classList.contains(`wui-chat--panel-motion-none`)?0:300;t=setTimeout(()=>{e.dataset.state=`closed`},n)}}}}function L2(e,t){t.position!==void 0&&(e.classList.toggle(`wui-chat--end`,t.position===`end`),e.classList.toggle(`wui-chat--start`,t.position===`start`)),t.reduced!==void 0&&e.classList.toggle(`wui-chat--reduced`,!!t.reduced),t.expressive!==void 0&&e.classList.toggle(`wui-chat--expressive`,t.expressive===!0),t.sendReveal!==void 0&&e.classList.toggle(`wui-chat--send-always`,t.sendReveal===`Always`),t.inputRing!==void 0&&e.classList.toggle(`wui-chat--input-ring-off`,t.inputRing===!1),t.panelMotion!==void 0&&(e.classList.toggle(`wui-chat--panel-motion-gentle`,t.panelMotion===`Gentle`),e.classList.toggle(`wui-chat--panel-motion-none`,t.panelMotion===`None`)),t.offsetX!==void 0&&e.style.setProperty(`--wui-chat-offset-x`,`${t.offsetX}px`),t.offsetY!==void 0&&e.style.setProperty(`--wui-chat-offset-y`,`${t.offsetY}px`),t.width!==void 0&&e.style.setProperty(`--wui-chat-width`,t.width),t.maxHeight!==void 0&&e.style.setProperty(`--wui-chat-panel-max-height`,`${t.maxHeight}px`),t.bottomGap!==void 0&&e.style.setProperty(`--wui-chat-bottom-gap`,`${t.bottomGap}px`),t.panelHeight!==void 0&&e.classList.toggle(`wui-chat--panel-height-content`,t.panelHeight===`Content`),t.avatar!==void 0&&(t.avatar?(e.style.setProperty(`--wui-chat-avatar`,`url(${JSON.stringify(t.avatar)})`),e.style.setProperty(`--wui-chat-typing-mark`,`url(${JSON.stringify(t.avatar)})`)):(e.style.removeProperty(`--wui-chat-avatar`),e.style.removeProperty(`--wui-chat-typing-mark`))),t.replyAvatars!==void 0&&e.classList.toggle(`wui-chat--reply-avatars-off`,t.replyAvatars===!1)}var R2=[`Text`,`Sources`,`QuickReplies`,`InputRequest`,`Action`,`Notice`,`Table`,`Chart`,`Figures`,`RecordCard`,`Image`,`File`,`Ticket`,`Handoff`,`VoiceClip`],z2={launcher:`wui-chat--launcher`,docked:`wui-chat--docked`,"full-page":`wui-chat--full-page`,embedded:`wui-chat--embedded`};function B2(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function V2({id:e,layout:t,position:n,role:r,launcher:i,onToggle:a}){let o=$(`div`,`wui-chat ${z2[t]} wui-chat--${n}`),s=$(`section`,`wui-chat-panel`,{id:e,role:r}),c=i?I2(o):null;o.dataset.state=i?`closed`:`open`;let l=null,u=null,d=null,f=null,p=null,m=null,h=null,g=`round`,_=!1,v=`bubble`,y=null,b=null,x=!1,S=`icon`,C=!1;function w(){if(!l)return;let e=l.dataset.launcher,t=[`wui-chat-launcher-wrap`];e===`entering`&&y&&t.push(`wui-chat-launcher--entrance-${y}`),e===`idle`&&b&&b!==`none`&&(b!==`ring`||g===`pill`)&&t.push(`wui-chat-launcher--idle-${b}`),l.className=t.join(` `)}function T(){if(!u)return;let e=[...u.classList].filter(e=>e.endsWith(`--opening`)||e.endsWith(`--closing`)),t=[`wui-chat-launcher`,`wui-chat-launcher--${g}`];g===`pill`&&_&&t.push(`wui-chat-launcher--compact`),S!==`icon`&&t.push(`wui-chat-launcher--mark-${S}`),t.push(`wui-chat-launcher--reveal-${v}`,...e),u.className=t.join(` `)}function E(){p&&m&&(p.textContent=h||m.launcher)}function D(){if(!u||!f||!m)return;let e=C?m.launcherClose:h||m.launcher;u.setAttribute(`aria-label`,e),f.textContent=e}if(i){let t=$(`div`,`wui-chat-launcher-wrap`);l=t,t.dataset.launcher=`idle`;let n=$(`button`,`wui-chat-launcher`,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":`false`,"aria-controls":e});u=n;let r=$(`span`,`wui-chat-launcher-icon`,{"aria-hidden":`true`});d=r,r.append(j2(`chat`,24));let i=$(`span`,`wui-chat-launcher-close`,{"aria-hidden":`true`});i.append(j2(`x`,24));let c=$(`span`,`wui-chat-launcher-label`);f=c,n.append(r,i,c),n.addEventListener(`click`,()=>a()),n.addEventListener(`animationend`,e=>{e.target===n&&n.classList.remove(`wui-chat-launcher--opening`,`wui-chat-launcher--closing`)});let m=$(`span`,`wui-chat-launcher-bubble`,{"aria-hidden":`true`});p=m,t.append(n,m),t.addEventListener(`animationend`,e=>{e.target===t&&t.dataset.launcher===`entering`&&(t.dataset.launcher=`idle`,w())}),T(),w(),o.append(t,s)}else o.append(s);function O(e){if(!c)return;let t=e&&!C&&u!==null&&u?u.getBoundingClientRect():null;e!==C&&u&&(u.classList.remove(`wui-chat-launcher--opening`,`wui-chat-launcher--closing`),u.classList.add(e?`wui-chat-launcher--opening`:`wui-chat-launcher--closing`)),C=e,c(e),t&&D2(s,t),u&&(u.setAttribute(`aria-expanded`,String(e)),D())}function k(e){m=e,u&&(D(),E())}function A(e){if(L2(o,e),e.theme!==void 0&&(e.theme===`light`||e.theme===`dark`?o.dataset.theme=e.theme:delete o.dataset.theme),!u||!l||!d)return;e.launcherStyle!==void 0&&(g=e.launcherStyle===`Pill`?`pill`:`round`),e.compact!==void 0&&(_=e.compact),e.labelReveal!==void 0&&(v=e.labelReveal===`Expand`?`expand`:`bubble`),e.entrance!==void 0&&(y=e.entrance===`None`?null:B2(e.entrance)),e.idle!==void 0&&(b=e.idle===`None`?`none`:B2(e.idle)),e.phone!==void 0&&(x=e.phone),e.hoverLabel!==void 0&&(h=e.hoverLabel||null),e.launcherMark!==void 0&&(S=B2(e.launcherMark)),e.icon!==void 0&&e.icon!==d.dataset.icon&&(d.dataset.icon=e.icon,d.replaceChildren(j2(e.icon,24)));let t=e.launcherState??l.dataset.launcher;x&&t===`entering`&&(t=`idle`),t===`entering`&&!y&&(t=`idle`),l.dataset.launcher=t,T(),w(),E(),D()}return{root:o,panel:s,setOpen:O,setLabels:k,setAppearance:A,nudgeHost:l,launcherButton:u,role:r}}var H2={Open:`info`,InProgress:`info`,WaitingOnCustomer:`warning`,Resolved:`success`,Closed:`neutral`,Cancelled:`neutral`},U2=/^\/[/\\]/,W2=/^https?:\/\//i,G2=/[\t\r\n]/g;function K2(e){return typeof e==`string`&&e.trim()!==``}function q2(e){return e.replace(G2,``)}function J2(e){if(typeof e!=`string`)return!1;let t=q2(e);return t.startsWith(`/`)?!U2.test(t):W2.test(t)}function Y2(e){if(typeof e!=`string`)return`?`;let t=e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>([...e][0]??``).toUpperCase()).join(``);return t===``?`?`:t}function X2(e,t){let n=e?.displayName,r=Y2(K2(n)?n:t),i=$(`span`,`wui-chat-avatar`,{"aria-hidden":`true`}),a=e?.avatarUrl,o=typeof a==`string`?q2(a):null;if(J2(o)){let e=$(`img`,null,{alt:``,src:o,loading:`lazy`});e.addEventListener(`error`,()=>{i.textContent=r}),i.append(e)}else i.textContent=r;return i}function Z2(e,t){let n=$(`div`,`wui-chat-agent-head`),r=$(`span`,`wui-chat-agent-name`),i=e?.displayName;r.textContent=K2(i)?i:t.agent;let a=$(`span`,`wui-chat-agent-role wui-chat-agent-tag`);return a.textContent=t.agent,n.append(X2(e,t.agent),r,a),n}function Q2(e,t){let n=e.displayName,r=$(`li`,`wui-chat-message wui-chat-message--agent wui-chat-message--typing`),i=$(`span`,`wui-chat-typing`);for(let e=0;e<3;e+=1)i.append($(`span`,`wui-chat-typing-dot`,{"aria-hidden":`true`}));let a=$(`span`,`visually-hidden`);return a.textContent=t.agentTyping(K2(n)?n:t.agent),r.append(Z2({kind:`Agent`,displayName:n,avatarUrl:null},t),i,a),r}function $2(e){return typeof e==`string`&&Object.hasOwn(H2,e)?H2[e]??null:null}function e4(e,t){return $2(e)===null?``:t.ticketStatus(e)}var t4=new Set([`Requested`,`Waiting`]),n4=new Set([`Requested`,`Waiting`,`Joined`]),r4=n4;function i4(e,t){let n=e?.displayName;return typeof n==`string`&&n.trim()!==``?n:t.handoffAgentFallback}function a4(){let e=$(`div`,`wui-chat-handoff-pulses`);for(let t=0;t<3;t+=1)e.append($(`span`,`wui-chat-handoff-pulse`,{"aria-hidden":`true`}));return e}function o4(e,t,n){let r=$(e,t);return r.textContent=n,r}function s4(e,t){let n=$(`div`,`wui-chat-handoff-body`);return n.append(o4(`strong`,`wui-chat-handoff-title`,e),o4(`p`,`wui-chat-handoff-text`,t)),n}function c4(e,t){if(typeof e.queuePosition!=`number`){let e=$(`span`,`wui-chat-system-line-stack`);return e.append(o4(`p`,`wui-chat-handoff-text`,t.handoffWaiting),o4(`p`,`wui-chat-handoff-text`,t.handoffQueuedText)),[a4(),e]}let n=$(`span`,`wui-chat-handoff-position`,{"aria-hidden":`true`});return n.textContent=String(e.queuePosition),[n,s4(t.handoffQueued(e.queuePosition),t.handoffQueuedText)]}function l4(e,t){let n=i4(e.agent,t),r=$(`span`,`wui-chat-handoff-agent`);return r.append(X2(e.agent,t.handoffAgentFallback),$(`span`,`wui-chat-handoff-online`,{"aria-hidden":`true`})),[r,s4(t.handoffJoined(n),t.handoffJoinedText(n))]}function u4(e,t){switch(e.state){case`Requested`:return[a4(),o4(`p`,`wui-chat-handoff-text`,t.handoffRequested)];case`Waiting`:return c4(e,t);case`Joined`:return l4(e,t);case`Left`:return[s4(t.handoffLeft(i4(e.agent,t)),t.handoffLeftText)];case`Ended`:return[s4(t.handoffEnded,t.handoffEndedText)];default:return null}}pa(`wui-chat-part-handoff`,class extends fa{_signature;constructor(){super(),this._signature=null}renderPart(e,t,n){let r=n.isLast,i=n.handoffSettled===!0&&t4.has(e.state),a=JSON.stringify([e.state,e.queuePosition,e.agent,r,n.features.HumanHandoff,n.busy,i]);if(a===this._signature)return;if(this._signature=a,i){this.replaceChildren();return}let o=u4(e,n.labels);if(o===null){this.replaceChildren();return}let s=$(`div`,`wui-chat-handoff wui-chat-handoff--${e.state.toLowerCase()}`);if(r&&t4.has(e.state)&&s.classList.add(`wui-chat-handoff--live`),r&&n4.has(e.state)&&s.setAttribute(`role`,`status`),r4.has(e.state)){s.classList.add(`wui-chat-system-line`);let e=$(`span`,`wui-chat-system-line-content`);e.append(...o),s.append(e)}else s.append(...o);this.replaceChildren(s)}});function d4(e,t){if(typeof customElements>`u`||customElements.get(e))return;let n=[];if(typeof document<`u`)for(let r of document.querySelectorAll(e))for(let i of Object.keys(r)){let a=Object.getOwnPropertyDescriptor(t.prototype,i);if(a&&(a.set||a.get)&&(n.push([r,i,Reflect.get(r,i)]),!Reflect.deleteProperty(r,i)))throw Error(`defineElement: could not clear the early "${i}" property on <${e}>.`)}customElements.define(e,t);for(let[t,r,i]of n)if(!Reflect.set(t,r,i))throw Error(`defineElement: could not restore the "${r}" property on <${e}>.`)}var f4=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`;if(typeof HTMLElement>`u`)throw Error(f4);var p4=HTMLElement,m4={closeLabel:`Close`,countText:`{position} of {total}`,downloadLabel:`Download`,imageFailedMessage:`This image can't be shown.`,label:`Image viewer`,nextImageLabel:`Next image`,previousImageLabel:`Previous image`,zoomInLabel:`Zoom in`,zoomOutLabel:`Zoom out`},h4=`a.wui-lightbox-item`,g4=1,_4=4,v4=.5,y4=2,b4=50,x4=6,S4=300,C4=300;function w4(e){return Number.isFinite(e)?Math.min(_4,Math.max(g4,e)):g4}function T4(e,t,n,r){let i=(e,n)=>Math.max(0,(e*t-n)/2),a=i(r.width,n.width),o=i(r.height,n.height);return{x:Math.min(a,Math.max(-a,e.x)),y:Math.min(o,Math.max(-o,e.y))}}function E4(e,t){return Math.abs(e)<b4||Math.abs(e)<Math.abs(t)*1.5?0:e<0?1:-1}function D4(e){let t=(String(e??``).split(/[?#]/)[0]??``).split(`/`).filter(Boolean).pop()??``;try{return decodeURIComponent(t)}catch{return t}}function O4(e,t,n={}){let r=document.createElement(e);r.className=t;for(let[e,t]of Object.entries(n))r.setAttribute(e,t);return r}var k4=()=>Ti(`lightbox`,m4);function A4(e,t,n){let r=O4(`button`,`u-action wui-lightbox-btn ${n}`,{type:`button`,"aria-label":t,title:t});return r.style.setProperty(`--wui-action-size`,`40px`),r.innerHTML=Ki(e,{size:20}),r}d4(`wui-lightbox`,class extends p4{_ui;_index;_zoom;_pan;_pointers;_gesture;_lastTap;_returnTo;_release;_onClick;static get observedAttributes(){return[`open-index`]}constructor(){super(),this._ui=null,this._index=0,this._zoom=g4,this._pan={x:0,y:0},this._pointers=new Map,this._gesture=null,this._lastTap=-1/0,this._returnTo=null,this._release=null,this._onClick=e=>{if(e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let t=e.target,n=t instanceof Element?t.closest(h4):null;if(!(n instanceof HTMLAnchorElement)||!this.contains(n))return;let r=this._links().indexOf(n);r<0||(e.preventDefault(),this.open(r))}}get _view(){if(!this._ui)throw Error(`<wui-lightbox> viewer is not open.`);return this._ui}get download(){return this.hasAttribute(`download`)}set download(e){this.toggleAttribute(`download`,e===!0||e===``||e===`true`)}get label(){return this.getAttribute(`label`)||k4().label}set label(e){this.setAttribute(`label`,String(e??``))}get layout(){return this.getAttribute(`layout`)===`single`?`single`:`gallery`}set layout(e){if(e===`single`)this.setAttribute(`layout`,`single`);else if(e===`gallery`||e===``)this.removeAttribute(`layout`);else throw Error(`<wui-lightbox> layout must be "gallery" or "single", received "${e}".`)}get isOpen(){return this._ui!==null}connectedCallback(){this.addEventListener(`click`,this._onClick),this._syncOpenIndex()}disconnectedCallback(){this.removeEventListener(`click`,this._onClick),this._teardown()}attributeChangedCallback(){this.isConnected&&this._syncOpenIndex()}_syncOpenIndex(){let e=this.getAttribute(`open-index`);e===null?this.close():this.open(Number(e))}_links(){return[...this.querySelectorAll(h4)].filter(e=>e instanceof HTMLAnchorElement)}_items(){return this._links().map(e=>{let t=e.getAttribute(`href`)??``;return{link:e,src:t,alt:e.querySelector(`img`)?.getAttribute(`alt`)??``,caption:e.dataset.caption??``,name:e.dataset.name||D4(t)}})}open(e=0){let t=this._items();if(!t.length)return!1;if(!this._ui){let t=document.activeElement;this._returnTo=t instanceof HTMLElement||t instanceof SVGElement?t:null,this._build(),this.dispatchEvent(new CustomEvent(`wui-lightbox:open`,{bubbles:!0,detail:{index:e}}))}return this._show(e,t),!0}close(){if(!this._ui)return;let e=this._index,t=this._links()[e]??this._returnTo;this._teardown(),t?.isConnected&&t.focus(),this._returnTo=null,this.dispatchEvent(new CustomEvent(`wui-lightbox:close`,{bubbles:!0,detail:{index:e}}))}_teardown(){this._ui&&(this._release?.(),this._release=null,this._ui.root.open&&this._ui.root.close(),this._ui.root.remove(),this._ui=null,this._pointers.clear(),this._gesture=null)}_build(){let e=O4(`dialog`,`wui-lightbox-overlay`,{role:`dialog`,"aria-label":this.label,tabindex:`-1`}),t=O4(`div`,`wui-lightbox-bar`),n=O4(`span`,`wui-lightbox-count`,{"aria-live":`polite`}),r=O4(`div`,`wui-lightbox-tools`),i=A4(`zoom-out`,k4().zoomOutLabel,`wui-lightbox-zoom-out`),a=A4(`zoom-in`,k4().zoomInLabel,`wui-lightbox-zoom-in`),o=O4(`a`,`u-action wui-lightbox-btn wui-lightbox-download`,{"aria-label":k4().downloadLabel,title:k4().downloadLabel});o.style.setProperty(`--wui-action-size`,`40px`),o.innerHTML=Ki(`download`,{size:20}),o.hidden=!this.download;let s=A4(`x`,k4().closeLabel,`wui-lightbox-close`);r.append(i,a,o,s),t.append(n,r);let c=O4(`div`,`wui-lightbox-stage`),l=A4(`chevron-left`,k4().previousImageLabel,`wui-lightbox-nav wui-lightbox-prev`),u=A4(`chevron-right`,k4().nextImageLabel,`wui-lightbox-nav wui-lightbox-next`),d=O4(`img`,`wui-lightbox-image`,{decoding:`async`,draggable:`false`,alt:``}),f=O4(`p`,`wui-lightbox-status`,{role:`status`});c.append(d,f,l,u);let p=O4(`p`,`wui-lightbox-caption`);e.append(t,c,p);let m={root:e,count:n,zoomOut:i,zoomIn:a,download:o,close:s,stage:c,prev:l,next:u,image:d,status:f,caption:p};this._ui=m,s.addEventListener(`click`,()=>this.close()),l.addEventListener(`click`,()=>this.step(-1)),u.addEventListener(`click`,()=>this.step(1)),i.addEventListener(`click`,()=>this._setZoom(this._zoom-v4)),a.addEventListener(`click`,()=>this._setZoom(this._zoom+v4)),e.addEventListener(`keydown`,e=>this._onKeyDown(e)),c.addEventListener(`pointerdown`,e=>this._onPointerDown(e)),c.addEventListener(`pointermove`,e=>this._onPointerMove(e)),c.addEventListener(`pointerup`,e=>this._onPointerEnd(e,!0)),c.addEventListener(`pointercancel`,e=>this._onPointerEnd(e,!1)),c.addEventListener(`wheel`,e=>this._onWheel(e),{passive:!1}),d.addEventListener(`load`,()=>{this._ui===m&&(f.textContent=``,c.removeAttribute(`aria-busy`),d.hidden=!1,this._applyTransform())}),d.addEventListener(`error`,()=>{this._ui===m&&(c.removeAttribute(`aria-busy`),d.hidden=!0,f.textContent=k4().imageFailedMessage)}),this.append(e),this._release=sa(e,{escape:!0,backdrop:!1,focus:`panel`,onRequestClose:()=>this.close()})}step(e){if(!this._ui||!e)return;let t=this._items();t.length<2||this._show((this._index+e+t.length)%t.length,t)}_show(e,t){let n=this._view,r=Math.min(t.length-1,Math.max(0,Math.trunc(Number(e))||0)),i=t[r];if(!i)throw Error(`<wui-lightbox> image missing.`);let a=r!==this._index||!n.image.getAttribute(`src`);if(this._index=r,this._zoom=g4,this._pan={x:0,y:0},n.count.textContent=Di(k4().countText,{position:Hi(r+1,{decimals:0}),total:Hi(t.length,{decimals:0})}),n.caption.textContent=i.caption,n.caption.hidden=!i.caption,n.download.href=i.src,n.download.setAttribute(`download`,i.name),n.prev.hidden=n.next.hidden=t.length<2,n.stage.setAttribute(`aria-busy`,`true`),n.status.textContent=``,n.image.hidden=!1,n.image.alt=i.alt||i.caption,n.image.src=i.src,this._applyTransform(),this._syncZoomButtons(),t.length>1){let e=t[(r+1)%t.length],n=t[(r-1+t.length)%t.length];if(!e||!n)throw Error(`<wui-lightbox> neighbour image missing.`);for(let t of[e,n])new Image().src=t.src}a&&this.dispatchEvent(new CustomEvent(`wui-lightbox:change`,{bubbles:!0,detail:{index:r}}))}_syncZoomButtons(){let e=this._view;e.zoomOut.disabled=this._zoom<=g4,e.zoomIn.disabled=this._zoom>=_4;let t=document.activeElement;(t===e.zoomOut||t===e.zoomIn)&&t instanceof HTMLButtonElement&&t.disabled&&e.close.focus()}_setZoom(e){this._ui&&(this._zoom=w4(e),this._pan=this._clampedPan(this._pan),this._applyTransform(),this._syncZoomButtons())}_clampedPan(e){let{stage:t,image:n}=this._view;return T4(e,this._zoom,{width:t.clientWidth,height:t.clientHeight},{width:n.offsetWidth,height:n.offsetHeight})}_applyTransform(){let{image:e,stage:t}=this._view;e.style.transform=`translate(${this._pan.x}px, ${this._pan.y}px) scale(${this._zoom})`,t.classList.toggle(`wui-lightbox-zoomed`,this._zoom>g4)}_onKeyDown(e){if(e.key===`ArrowLeft`||e.key===`ArrowRight`)e.preventDefault(),this.step(e.key===`ArrowRight`?1:-1);else if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=this._items();this._show(e.key===`Home`?0:t.length-1,t)}else e.key===`+`||e.key===`=`?(e.preventDefault(),this._setZoom(this._zoom+v4)):e.key===`-`?(e.preventDefault(),this._setZoom(this._zoom-v4)):e.key===`0`&&(e.preventDefault(),this._setZoom(g4))}_onWheel(e){e.preventDefault(),this._setZoom(this._zoom*(e.deltaY<0?1.15:1/1.15))}_onPointerDown(e){let t=e.target;if(t instanceof Element&&t.closest(`.wui-lightbox-nav`))return;let n=this._view;if(n.stage.setPointerCapture?.(e.pointerId),this._pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),this._pointers.size===2){let e=[...this._pointers.values()],t=e[0],n=e[1];if(!t||!n)throw Error(`<wui-lightbox> pinch needs two pointers.`);this._gesture={kind:`pinch`,distance:Math.hypot(t.x-n.x,t.y-n.y)||1,zoom:this._zoom}}else this._pointers.size===1&&(this._gesture={kind:`drag`,startX:e.clientX,startY:e.clientY,startTime:e.timeStamp,pan:{...this._pan},onImage:e.target===n.image,moved:!1})}_onPointerMove(e){let t=this._gesture;if(t&&this._pointers.has(e.pointerId)){if(this._pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),t.kind===`pinch`&&this._pointers.size===2){let e=[...this._pointers.values()],n=e[0],r=e[1];if(!n||!r)throw Error(`<wui-lightbox> pinch needs two pointers.`);this._setZoom(t.zoom*Math.hypot(n.x-r.x,n.y-r.y)/t.distance)}else if(t.kind===`drag`){let n=e.clientX-t.startX,r=e.clientY-t.startY;Math.hypot(n,r)>x4&&(t.moved=!0),this._zoom>g4&&(this._pan=this._clampedPan({x:t.pan.x+n,y:t.pan.y+r}),this._view.stage.classList.add(`is-dragging`),this._applyTransform())}}}_onPointerEnd(e,t){let n=this._gesture;if(this._pointers.delete(e.pointerId),this._ui?.stage.classList.remove(`is-dragging`),!n)return;if(n.kind===`pinch`){this._pointers.size<2&&(this._gesture=null);return}if(this._gesture=null,!t)return;let r=e.clientX-n.startX,i=e.clientY-n.startY;n.moved?this._zoom===g4&&this.step(E4(r,i)):e.timeStamp-n.startTime>S4||(n.onImage?e.timeStamp-this._lastTap<C4?(this._lastTap=-1/0,this._setZoom(this._zoom>g4?g4:y4)):this._lastTap=e.timeStamp:this.close())}}),pa(`wui-chat-part-image`,class extends fa{#e=null;#t=0;#n=null;renderPart(e,t,n){if(e.attachmentId===this.#e)return;this.#e=e.attachmentId;let r=this.ownerDocument??document,i=P(r,`figure`,`wui-chat-image`),a=P(r,`div`,`wui-chat-image-frame`);this.#n=a;let{width:o,height:s}=e;o!==null&&s!==null&&Number.isFinite(o)&&Number.isFinite(s)&&o>0&&s>0&&(a.style.aspectRatio=`${o} / ${s}`),i.append(a),this.replaceChildren(i),this.#r(e,n)}disposePart(){this.#t+=1,this.#e=null}#r(e,t){this.#t+=1;let n=this.#t,r=this.ownerDocument??document,i=this.#n;if(i===null)return;let a=P(r,`div`,`wui-chat-image-skeleton`);a.setAttribute(`aria-hidden`,`true`);let o=P(r,`span`,`visually-hidden`,t.labels.imageLoading);o.setAttribute(`role`,`status`),i.replaceChildren(a,o),typeof t.loadAttachmentUrl==`function`?t.loadAttachmentUrl(e.attachmentId).then(r=>{n===this.#t&&this.isConnected&&this.#i(r,e,t)},()=>{n===this.#t&&this.isConnected&&this.#a(e,t)}):this.#a(e,t)}#i(e,t,n){let r=this.#n;if(r===null)return;let i=this.ownerDocument??document,a=h2(t.alt),o=i.createElement(`wui-lightbox`);o.setAttribute(`label`,n.labels.imageViewer),o.setAttribute(`layout`,`single`);let s=P(i,`a`,`wui-lightbox-item`);s.setAttribute(`href`,e),s.dataset.caption=a,s.dataset.name=a;let c=i.createElement(`img`);c.src=e,c.alt=a,c.decoding=`async`,s.append(c),o.append(s),r.replaceChildren(o)}#a(e,t){let n=this.#n;if(n===null)return;let r=this.ownerDocument??document,i=P(r,`p`,`wui-chat-image-error`,t.labels.imageFailed);i.setAttribute(`role`,`status`);let a=P(r,`button`,`btn btn-soft-primary btn-sm`,t.labels.retry);a.type=`button`,a.addEventListener(`click`,()=>this.#r(e,t)),n.replaceChildren(i,a)}});var j4={Email:{type:`email`,autocomplete:`email`},Phone:{type:`tel`,autocomplete:`tel`},Name:{type:`text`,autocomplete:`name`},Company:{type:`text`,autocomplete:`organization`},Text:{type:`text`,autocomplete:null},LongText:{type:`text`,autocomplete:null}},M4=[`Open`,`Answered`,`Skipped`,`Expired`],N4=0;function P4(e){return N4+=1,`${e}-${N4}`}function F4(e,t,n){let r=document.createElement(e);return t&&(r.className=t),n!=null&&(r.textContent=n),r}function I4(){let e=F4(`p`,`wui-chat-field-error`);return e.id=P4(`wui-chat-field-error`),e.setAttribute(`role`,`alert`),e.hidden=!0,e}function L4(e,t){return e.required?[]:[F4(`span`,`wui-chat-field-hint`,t.inputOptional)]}function R4(e,t,n){let r=P4(`wui-chat-field`),i=j4[t],a=t===`LongText`&&!e.secret,o;if(a){let e=F4(`textarea`,`form-control wui-chat-input-control`);e.rows=3,o=e}else{let t=F4(`input`,`form-control wui-chat-input-control`);t.type=e.secret?`password`:i.type,e.secret?t.autocomplete=`off`:i.autocomplete&&(t.autocomplete=i.autocomplete),o=t}o.id=r,o.name=e.key,e.placeholder!=null&&(o.placeholder=e.placeholder),e.maxLength!=null&&(o.maxLength=e.maxLength),e.required&&o.setAttribute(`aria-required`,`true`);let s=F4(`label`,`form-label`,e.label);s.htmlFor=r;let c=I4();o.setAttribute(`aria-describedby`,c.id);let l=F4(`div`,`wui-chat-field`);return l.dataset.key=e.key,l.append(s,...L4(e,n),o,c),{field:e,element:l,controls:[o],focus:o,invalid:o,error:c,control:o,read:()=>e.secret?o.value:o.value.trim()}}function z4(e,t,n,r,i){let a=e.control,o=F4(`button`,`btn btn-soft-primary`,n.inputSendCode);o.type=`button`,o.dataset.wui=`AppButton`;let s=F4(`p`,`wui-chat-field-hint`);s.setAttribute(`aria-live`,`polite`);let c=P4(`wui-chat-field`),l=F4(`label`,`form-label`,n.inputEnterCode);l.htmlFor=c,l.hidden=!0;let u=F4(`input`,`form-control wui-chat-input-control`);return u.type=`text`,u.id=c,u.inputMode=`numeric`,u.autocomplete=`one-time-code`,u.hidden=!0,o.addEventListener(`click`,async()=>{o.disabled=!0;try{await r.sendOtp(i,{fieldKey:t.key,value:a.value.trim()}),s.textContent=n.inputCodeSent,l.hidden=!1,u.hidden=!1}catch{s.textContent=n.inputCodeFailed}finally{o.disabled=!1}}),e.element.insertBefore(o,e.error),e.element.insertBefore(s,e.error),e.element.insertBefore(l,e.error),e.element.insertBefore(u,e.error),{...e,controls:[...e.controls,o,u],codeRead:()=>u.value.trim()}}function B4(e,t){let n=P4(`wui-chat-field-label`),r=F4(`span`,`form-label`,e.label);r.id=n;let i=F4(`div`);i.setAttribute(`role`,`radiogroup`),i.setAttribute(`aria-labelledby`,n);let a=I4();i.setAttribute(`aria-describedby`,a.id);let o=[];for(let t of e.options??[]){let n=F4(`div`,`form-check`),r=F4(`input`,`form-check-input`);r.type=`radio`,r.name=e.key,r.value=t.id,r.id=P4(`wui-chat-option`);let a=F4(`label`,`form-check-label`,t.label);a.htmlFor=r.id,n.append(r,a),i.append(n),o.push(r)}o.length===0&&(i.tabIndex=-1);let s=F4(`div`,`wui-chat-field`);return s.dataset.key=e.key,s.append(r,...L4(e,t),i,a),{field:e,element:s,controls:o,focus:o[0]??i,invalid:i,error:a,read:()=>o.find(e=>e.checked)?.value??``}}function V4(e,t){let n=P4(`wui-chat-field-label`),r=F4(`span`,`form-label`,e.label);r.id=n;let i=F4(`div`,`wui-chat-input-choices`);i.setAttribute(`role`,`group`),i.setAttribute(`aria-labelledby`,n);let a=I4();i.setAttribute(`aria-describedby`,a.id);let o=[];for(let t of e.options??[]){let n=F4(`div`,`form-check`),r=F4(`input`,`form-check-input`);r.type=`checkbox`,r.name=e.key,r.value=t.id,r.id=P4(`wui-chat-option`);let a=F4(`label`,`form-check-label`,t.label);a.htmlFor=r.id,n.append(r,a),i.append(n),o.push(r)}o.length===0&&(i.tabIndex=-1);let s=F4(`div`,`wui-chat-field`);return s.dataset.key=e.key,s.append(r,...L4(e,t),i,a),{field:e,element:s,controls:o,focus:o[0]??i,invalid:i,error:a,read:()=>JSON.stringify(o.filter(e=>e.checked).map(e=>e.value))}}function H4(e,t){let n=P4(`wui-chat-field-label`),r=F4(`span`,`form-label`,e.label);r.id=n;let i=F4(`div`,`wui-chat-input-slots`);i.setAttribute(`role`,`radiogroup`),i.setAttribute(`aria-labelledby`,n);let a=I4();i.setAttribute(`aria-describedby`,a.id);let o=new Intl.DateTimeFormat(void 0,{weekday:`short`,day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`}),s=[];for(let t of e.slots??[]){let n=F4(`input`,`wui-chat-input-slot-radio`);n.type=`radio`,n.name=e.key,n.value=t.id,n.id=P4(`wui-chat-slot`);let r=F4(`label`,`btn btn-soft-primary wui-chat-input-slot`,o.format(new Date(t.startDateTimeUtc)));r.htmlFor=n.id,i.append(n,r),s.push(n)}s.length===0&&(i.tabIndex=-1);let c=F4(`div`,`wui-chat-field`);return c.dataset.key=e.key,c.append(r,...L4(e,t),i,a),{field:e,element:c,controls:s,focus:s[0]??i,invalid:i,error:a,read:()=>s.find(e=>e.checked)?.value??``}}function U4(e,t,n){let r=P4(`wui-chat-field-label`),i=F4(`span`,`form-label`,e.label);i.id=r;let a=I4(),o=F4(`input`);o.type=`file`,o.name=e.key,o.id=P4(`wui-chat-field`),o.hidden=!0,e.accept?.length&&(o.accept=e.accept.join(`,`));let s=F4(`button`,`btn btn-soft-primary`,t.inputChooseFile);s.type=`button`,s.dataset.wui=`AppButton`,s.setAttribute(`aria-describedby`,a.id),s.addEventListener(`click`,()=>o.click());let c=F4(`span`,`wui-chat-input-file-status`);c.setAttribute(`aria-live`,`polite`);let l=F4(`button`,`btn btn-link-primary`);l.type=`button`,l.dataset.wui=`AppButton`,l.hidden=!0;let u=F4(`div`,`wui-chat-input-file`);u.setAttribute(`role`,`group`),u.setAttribute(`aria-labelledby`,r),u.append(s,c,l,o);let d=`empty`,f=``,p=``,m=0,h=()=>{c.textContent=d===`uploading`?`${t.attachmentUploading} ${f}`:f,l.hidden=f===``,l.textContent=f===``?``:t.inputRemoveFile(f);let e=d===`failed`;a.textContent=e?t.attachmentFailed:``,a.hidden=!e,e?u.setAttribute(`aria-invalid`,`true`):u.removeAttribute(`aria-invalid`)},g=async e=>{m+=1;let t=m;d=`uploading`,f=e.name,p=``,h();try{let r=await n.uploadInputFile(e);if(t!==m)return;p=r,d=`ready`}catch{if(t!==m)return;d=`failed`}h()};o.addEventListener(`change`,()=>{let e=o.files?.[0];e&&g(e)}),l.addEventListener(`click`,()=>{m+=1,d=`empty`,f=``,p=``,o.value=``,h()}),h();let _=F4(`div`,`wui-chat-field`);return _.dataset.key=e.key,_.append(i,...L4(e,t),u,a),{field:e,element:_,controls:[s,l,o],focus:s,invalid:u,error:a,read:()=>d===`ready`?p:``,uploadProblem:()=>d===`uploading`?t.attachmentUploading:d===`failed`?t.attachmentFailed:null}}function W4(e){let t=F4(`input`,`form-check-input`);t.type=`checkbox`,t.name=e.key,t.id=P4(`wui-chat-field`);let n=F4(`label`,`form-check-label`,e.consentText||e.label);n.htmlFor=t.id;let r=I4();t.setAttribute(`aria-describedby`,r.id);let i=F4(`div`,`form-check`);i.append(t,n);let a=F4(`div`,`wui-chat-field`);return a.dataset.key=e.key,a.append(i,r),{field:e,element:a,controls:[t],focus:t,invalid:t,error:r,read:()=>t.checked?`true`:`false`}}function G4(e,t,n,r){if(e.type===`Choice`)return B4(e,t);if(e.type===`MultiChoice`)return V4(e,t);if(e.type===`TimeSlot`)return H4(e,t);if(e.type===`File`)return U4(e,t,n);if(e.type===`Consent`)return W4(e);let i=R4(e,e.type,t);return e.verify===`Otp`?z4(i,e,t,n,r):i}function K4(e,t,n){let r=e.uploadProblem?.();if(r)return r;let{field:i}=e;return i.required?i.type===`Consent`?t===`true`?null:n.inputConsentRequired:i.type===`MultiChoice`?t===`[]`?n.inputRequired:null:t===``?n.inputRequired:null:null}function q4(e,t){return e.state===`Answered`?F4(`p`,`wui-chat-input-summary`,e.answeredSummary||t.inputAnswered):F4(`p`,`wui-chat-input-summary`,e.state===`Skipped`?t.inputSkipped:t.inputExpired)}pa(`wui-chat-part-input-request`,class extends fa{_signature;_generation;constructor(){super(),this._signature=null,this._generation=0}renderPart(e,t,n){for(let t of M4)this.classList.toggle(`wui-chat-input-request--${t.toLowerCase()}`,e.state===t);let r=JSON.stringify([e.requestId,e.state,e.answeredSummary,e.fields]);r!==this._signature&&(this._signature=r,this._generation+=1,this.replaceChildren(this._content(e,n)))}_content(e,t){return e.state===`Open`?this._form(e,this._generation):q4(e,t.labels)}_form(e,t){let n=this.activeTurn,r=n.labels,i=n.features,a=F4(`form`,`wui-chat-input-form`);a.noValidate=!0,a.setAttribute(`aria-label`,e.title||e.submitLabel),e.title&&a.append(F4(`h3`,`wui-chat-input-title`,e.title));let o=e.fields.map(t=>G4(t,r,n,e.requestId));for(let e of o)a.append(e.element);let s=F4(`p`,`wui-chat-input-error`);s.setAttribute(`role`,`status`),s.hidden=!0,a.append(s);let c=F4(`button`,`btn btn-primary`,e.submitLabel);c.type=`submit`,c.dataset.wui=`AppButton`;let l=F4(`div`,`d-flex flex-wrap gap-2`);l.append(c);let u=[c];if(i.LeadShortcuts&&e.fields.length===1&&!e.fields[0]?.required){let t=F4(`button`,`btn btn-soft-primary`,r.skip);t.type=`button`,t.dataset.wui=`AppButton`,t.addEventListener(`click`,()=>this.activeTurn.skipInput(e.requestId)),l.append(t),u.push(t)}if(i.LeadShortcuts&&e.cancellable){let e=F4(`button`,`btn btn-link-primary`,r.cancel);e.type=`button`,e.dataset.wui=`AppButton`,e.addEventListener(`click`,()=>this.activeTurn.cancelLead()),l.append(e),u.push(e)}a.append(l),e.allowTyped&&a.append(F4(`p`,`wui-chat-input-typed`,r.typeAnswer));let d=!1,f=t=>{for(let e of o)for(let n of e.controls)n.disabled=t;for(let e of u)e.disabled=t;c.textContent=t?r.inputSubmitting:e.submitLabel},p=()=>{for(let e of o)e.error.hidden=!0,e.error.textContent=``,e.invalid.removeAttribute(`aria-invalid`);s.hidden=!0,s.textContent=``},m=(e,t)=>{e.error.textContent=t,e.error.hidden=!1,e.invalid.setAttribute(`aria-invalid`,`true`)};return a.addEventListener(`submit`,async n=>{if(n.preventDefault(),d)return;p();let i={},a={},l=[];for(let e of o){let t=e.read();i[e.field.key]=t,e.codeRead&&(a[e.field.key]=e.codeRead());let n=K4(e,t,r);n&&l.push([e,n])}let[u]=l;if(u){for(let[e,t]of l)m(e,t);u[0].focus.focus();return}d=!0,f(!0);let h;try{h=await this.activeTurn.answerInput(e.requestId,i,Object.keys(a).length>0?a:null)}catch{h={ok:!1,errors:{},message:r.errorGeneric}}if(t!==this._generation||h.ok)return;d=!1;let g=null;for(let e of o){let t=h.errors?.[e.field.key];t&&(m(e,t),g??=e)}h.message!=null&&(s.textContent=h.message,s.hidden=!1),f(!1),g?g.focus.focus():o[0]?o[0].focus.focus():c.focus()}),a}});var J4={ActionLimitReached:`warning`,ConversationTooLong:`warning`,AssistantUnavailable:`danger`},Y4={info:`info`,warning:`alert-triangle`,danger:`alert-circle`};pa(`wui-chat-part-notice`,class extends fa{renderPart(e){let t=this.ownerDocument??document,n=J4[e.code]??`info`,r=P(t,`div`,`wui-chat-notice wui-chat-notice--${n}`);r.setAttribute(`role`,n===`danger`?`alert`:`status`);let i=P(t,`span`,`wui-chat-notice-icon`);i.setAttribute(`aria-hidden`,`true`);let a=ma(t,Y4[n],16);a&&i.append(a);let o=P(t,`div`,`wui-chat-notice-body`);o.append(P(t,`span`,`wui-chat-notice-text`,e.text));let s=e.action;if(s){let e=P(t,`button`,`wui-chat-notice-action`,s.label);e.type=`button`,e.addEventListener(`click`,()=>s.run()),o.append(e)}r.append(i,o),this.replaceChildren(r)}});function X4(e){switch(e){case`Primary`:return`wui-chat-quick-reply--primary`;case`Cta`:return`wui-chat-quick-reply--cta`;case`Default`:case null:return``}}pa(`wui-chat-part-quick-replies`,class extends fa{#e=null;renderPart(e,t,n){let r=n.features.SuggestedReplies===!0&&n.isLast===!0&&n.busy===!1&&e.replies.length>0,i=typeof n.openTarget==`function`,a=typeof n.beginHandoff==`function`,o=n.handoffPause===!0,s=JSON.stringify([r,e.replies,e.placement,n.labels.quickReplies,n.labels.handoffMoment,i,a,o,n.handoffHosts??null,n.features.LinkHandoff===!0]);if(s===this.#e)return;this.#e=s;let c=this.querySelector(`:scope > .wui-chat-quick-replies:not(.wui-chat-quick-replies--leaving)`);if(!r&&c){this.#t(c);return}if(this.replaceChildren(),!r)return;let l=this.ownerDocument,u=e.placement===`Composer`,d=P(l,`div`,u?`wui-chat-quick-replies wui-chat-quick-replies--composer`:`wui-chat-quick-replies`);d.setAttribute(`role`,`group`),d.setAttribute(`aria-label`,n.labels.quickReplies);let f=u?null:e.replies.find(e=>e.id===`handoff.request`&&e.action===`Send`),p=0;f&&(d.classList.add(`wui-chat-quick-replies--offer`),d.append(this.#n(l,f,n)),p+=1);for(let t of e.replies){if(t===f||t.action===`Open`&&(!t.target||!i))continue;let e=null;if(t.action===`Navigate`){if(n.features.LinkHandoff!==!0)continue;if(xr(t.target,n.handoffHosts))e=t.target;else{let r=t.target===null?null:n.resolveLink?.(t.target);e=typeof r==`string`&&r!==``?r:null}if(e===null){d.append(P(l,`span`,null,t.label));continue}if(!a)continue}d.append(this.#r(l,t,p,n,f?`wui-chat-quick-reply--quiet`:``,e)),p+=1}if(o){let e=P(l,`span`,`visually-hidden`,n.labels.handoffMoment);e.setAttribute(`role`,`status`),d.append(e)}d.childElementCount>0&&this.append(d)}#t(e){e.classList.add(`wui-chat-quick-replies--leaving`);let t=this.ownerDocument.defaultView,n=Number.parseFloat(t?t.getComputedStyle(e).animationDuration:``)*1e3;t===null||!(n>0)?e.remove():t.setTimeout(()=>e.remove(),n)}#n(e,t,n){let r=P(e,`div`,`wui-chat-offer`);return r.style.setProperty(`--wui-chat-i`,`0`),r.append(P(e,`div`,`wui-chat-offer-title`,t.label)),r.append(this.#r(e,{...t,variant:`Primary`},0,n,`wui-chat-offer-action`)),r}#r(e,t,n,r,i=``,a=null){let o=e.createElement(`button`);o.type=`button`,o.className=[`wui-chat-quick-reply`,X4(t.variant),i].filter(Boolean).join(` `),o.style.setProperty(`--wui-chat-i`,String(n));let s=t.action===`Navigate`,c=s&&r.handoffPause===!0;if(o.disabled=c,t.icon){let n=ma(e,t.icon,16);if(n){let t=P(e,`span`,`wui-chat-quick-reply-icon`);t.setAttribute(`aria-hidden`,`true`),t.append(n),o.append(t)}}return o.append(P(e,`span`,`wui-chat-quick-reply-label`,c?r.labels.handoffMoment:t.label)),o.addEventListener(`click`,()=>{if(t.action===`Open`){let{openTarget:e}=this.activeTurn;if(t.target===null||e===void 0)throw Error(`${this.localName} drew an Open chip without a target or openTarget`);e.call(this.activeTurn,t.target)}else if(s){let{beginHandoff:e}=this.activeTurn;if(a===null||e===void 0)throw Error(`${this.localName} drew a Navigate chip without a destination or beginHandoff`);e.call(this.activeTurn,t,()=>this.#i(a))}else this.activeTurn.chooseQuickReply(t),this.closest(`.wui-chat`)?.querySelector(`.wui-chat-input`)?.focus()}),o}#i(e){typeof this.activeTurn.openTarget==`function`?this.activeTurn.openTarget(e):globalThis.location.assign(e)}});var Z4=new Set([`Integer`,`Decimal`,`MoneyMinor`,`Percent`]);function Q4(e){return Z4.has(e)}function $4(e,t,n,r=!0){let i=e=>r?fn(e):[{kind:`text`,text:e}];if(t==null||t===``)return[{kind:`text`,text:Fi()}];if(e===`Date`||e===`DateTimeUtc`)return[{kind:`text`,text:yr(t,e,n)}];if(Q4(e)){let r=Number(t);return i(Number.isFinite(r)?yr(r,e,n):String(t))}return i(String(t))}var e3=0;function t3(e){return e3+=1,`${e}-${e3}`}pa(`wui-chat-part-record-card`,class extends fa{#e=null;renderPart(e,t,n){let r=!!e.target&&typeof n.openRecord==`function`,i=n.features?.FigureText===!0,a=JSON.stringify([e,r,i]);if(a===this.#e)return;this.#e=a;let o=this.ownerDocument,s=P(o,`article`,`wui-chat-record`),c=t3(`wui-chat-record-title`);s.setAttribute(`aria-labelledby`,c);let l=P(o,`div`,`wui-chat-record-head`),u=P(o,`strong`,`wui-chat-record-title`);if(u.id=c,u.setAttribute(`role`,`heading`),u.setAttribute(`aria-level`,`3`),i?m2(u,e.title):u.textContent=String(e.title??``),l.append(u),e.subtitle){let t=P(o,`span`,`wui-chat-record-subtitle`);i?m2(t,e.subtitle):t.textContent=String(e.subtitle??``),l.append(t)}if(s.append(l),e.fields?.length>0){let t=P(o,`dl`,`wui-chat-record-fields`);for(let n of e.fields){let e=P(o,`div`),r=P(o,`dt`);i?m2(r,n.label):r.textContent=String(n.label??``);let a=P(o,`dd`);Q4(n.type)&&(a.className=`wui-chat-num`),p2(a,$4(n.type,n.value,null,i)),e.append(r,a),t.append(e)}s.append(t)}if(r){let t=P(o,`button`,`btn btn-soft-primary btn-sm wui-chat-record-open`,n.labels.recordOpen);t.type=`button`,t.setAttribute(`aria-label`,n.labels.recordOpenFor(h2(e.title))),t.addEventListener(`click`,()=>{let{openRecord:t}=this.activeTurn;if(t===void 0)throw Error(`${this.localName} lost openRecord after it drew the button`);t.call(this.activeTurn,e)}),s.append(t)}this.replaceChildren(s)}});var n3=/^https?:\/\//i;pa(`wui-chat-part-sources`,class extends fa{renderPart(e,t,n){if(this.replaceChildren(),!n.features.Sources||e.sources.length===0)return;let r=this.ownerDocument,i=P(r,`div`,`wui-chat-sources`);i.append(P(r,`p`,`wui-chat-sources-label`,n.labels.sources));let a=P(r,`ul`,`wui-chat-sources-list`);a.setAttribute(`aria-label`,n.labels.sources);for(let t of e.sources){let e=r.createElement(`li`);e.append(this.#e(r,t,n)),a.append(e)}i.append(a),this.append(i)}#e(e,t,n){let r;if(typeof t.url==`string`&&n3.test(t.url)){let i=P(e,`a`,`wui-chat-source`);i.setAttribute(`href`,t.url),i.setAttribute(`target`,`_blank`),i.setAttribute(`rel`,`noopener noreferrer`),i.setAttribute(`aria-label`,n.labels.openSource(t.title)),r=i}else r=P(e,`span`,`wui-chat-source`),r.tabIndex=-1;return r.dataset.marker=String(t.marker),r.append(P(e,`span`,`wui-chat-source-marker`,String(t.marker)),P(e,`span`,`wui-chat-source-title`,t.title)),r}});var r3=25,i3=0;function a3(e,t,n){let r=e.createElement(`tr`);for(let i of t.columns){let t=e.createElement(`th`);t.setAttribute(`scope`,`col`),Q4(i.type)&&(t.className=`wui-chat-num`),n?m2(t,i.label):t.textContent=String(i.label??``),r.append(t)}return r}function o3(e,t,n,r){let i=e.createElement(`tr`);return t.columns.forEach((a,o)=>{let s=o===0&&a.type===`Text`,c=e.createElement(s?`th`:`td`);s&&c.setAttribute(`scope`,`row`),Q4(a.type)&&(c.className=`wui-chat-num`);let l=n[o];l==null||l===``?c.append(P(c.ownerDocument,`span`,`wui-chat-null`,Fi())):p2(c,$4(a.type,l,t.currency,r)),i.append(c)}),i}function s3(e,t){let n=()=>{let n=t.scrollWidth-t.clientWidth;e.dataset.scroll=n<=1?`none`:t.scrollLeft>=n-1?`end`:t.scrollLeft>0?`middle`:`start`};t.addEventListener(`scroll`,n,{passive:!0}),typeof ResizeObserver<`u`&&new ResizeObserver(n).observe(t),n()}function c3(e,t,n,r,i){let a=e.ownerDocument;for(let o of t.rows.slice(n,r))e.append(o3(a,t,o,i))}pa(`wui-chat-part-table`,class extends fa{#e=null;renderPart(e,t,n){let r=n.features?.FigureText===!0,i=JSON.stringify([e,r]);if(i===this.#e)return;if(this.#e=i,!e.columns||e.columns.length===0){this.replaceChildren();return}let a=this.ownerDocument,o=P(a,`figure`,`wui-chat-table`),s=null;if(e.title){i3+=1,s=`wui-chat-table-${i3}`;let t=P(a,`figcaption`,`wui-chat-table-title`);t.id=s,r?m2(t,e.title):t.textContent=String(e.title??``),o.append(t)}let c=P(a,`div`,`table-wrap wui-chat-table-wrap`);c.tabIndex=0,c.setAttribute(`role`,`region`),s?c.setAttribute(`aria-labelledby`,s):c.setAttribute(`aria-label`,n.labels.table);let l=P(a,`table`,`table table-sm wui-chat-table-grid`),u=a.createElement(`thead`);u.append(a3(a,e,r));let d=a.createElement(`tbody`);c3(d,e,0,Math.min(e.rows.length,r3),r),l.append(u,d),c.append(l);let f=P(a,`div`,`wui-chat-table-frame`),p=P(a,`span`,`wui-chat-table-cue`);if(p.setAttribute(`aria-hidden`,`true`),f.append(c,p),o.append(f),s3(f,c),e.rows.length>r3){let t=P(a,`button`,`btn btn-soft-primary btn-sm wui-chat-table-more`,n.labels.tableShowAll(e.rows.length));t.type=`button`,t.addEventListener(`click`,()=>{c3(d,e,r3,e.rows.length,r),t.remove()}),o.append(t)}this.replaceChildren(o)}});var l3=/\[([^[\]\n]+)\](?!\()/g,u3=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`),d3=/\[([^\]\n]+)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,f3=/!\[([^\]\n]*)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,p3=new RegExp(l3.source,`y`),m3=e=>/[\p{L}\p{N}]/u.test(e);function h3(e,t){let n=0;for(let r=t-1;r>=0&&e.charAt(r)===`\\`;--r)n+=1;return n%2==1}function g3(e,t,n){let r=n.length===1;for(let i=e.indexOf(n,t);i!==-1;i=e.indexOf(n,i+1)){let a=i>t&&!/\s/.test(e.charAt(t))&&!/\s/.test(e.charAt(i-1)),o=r&&(e.charAt(i+1)===n||e.charAt(i-1)===n),s=n===`_`&&m3(e.charAt(i+n.length));if(a&&!o&&!s&&!h3(e,i))return i}return-1}function _3(e,t){let n=t?.isCitation,r=[],i=``,a=()=>{i&&=(r.push({type:`text`,text:i}),``)},o=0;for(;o<e.length;){let s=e.charAt(o),c=e.charAt(o+1);if(s===`\\`&&u3.has(c)){i+=c,o+=2;continue}if(s==="`"){let t=e.indexOf("`",o+1);if(t>o+1){a(),r.push({type:`code`,text:e.slice(o+1,t)}),o=t+1;continue}}let l=s+c;if(l===`**`||l===`__`||l===`~~`){let n=g3(e,o+2,l);if(n!==-1&&!(l===`__`&&m3(e.charAt(o-1)))){a();let i=_3(e.slice(o+2,n),t);l===`~~`?r.push({type:`strike`,children:i}):r.push({type:`strong`,children:i}),o=n+2;continue}i+=l,o+=2}else{if(s===`*`||s===`_`){let n=g3(e,o+1,s);if(n!==-1&&!(s===`_`&&m3(e.charAt(o-1)))){a(),r.push({type:`em`,children:_3(e.slice(o+1,n),t)}),o=n+1;continue}}if(s===`[`){d3.lastIndex=o;let t=d3.exec(e);if(t){let e=t[1],n=t[2];if(e===void 0||n===void 0)throw Error(`The link pattern always captures its label and href`);a(),r.push({type:`link`,href:n,children:_3(e)}),o+=t[0].length;continue}if(n){p3.lastIndex=o;let t=p3.exec(e);if(t){let e=t[1];if(e===void 0)throw Error(`The citation pattern always captures its inner text`);if(n(e)){a(),r.push({type:`citation`,text:e}),o+=t[0].length;continue}}}}if(s===`!`){f3.lastIndex=o;let t=f3.exec(e);if(t){let e=t[1];if(e===void 0)throw Error(`The image pattern always captures its alt text`);a(),r.push({type:`image`,children:_3(e)}),o+=t[0].length;continue}}i+=s,o+=1}}return a(),r.map((e,t)=>({...e,key:t}))}var v3=/^[a-z][a-z0-9+.-]*:[a-z0-9_-]+\/[a-z0-9_.~-]+$/i,y3=/^https?:/i,b3=/^(mailto|tel):/i,x3=/^(?:\/(?![/\\])|#|\?|\.{1,2}\/)/,S3=/^https:\/\/[^/?#@\\\s]+$/i,C3=/^[a-z][a-z0-9+.-]*:/i;function w3(e){if(typeof e!=`string`)return null;let t=e.endsWith(`/`)?e.slice(0,-1):e;return S3.test(t)?t:null}function T3(e,t,n,r,i){if(n&&(t===`page`||v3.test(e))){let t=n(e);if(t!=null)return{kind:`app`,target:t}}if(t===`app`)return null;let a=i==null?null:w3(i),o=a===null?e:E3(e,a);return o===null?null:x3.test(o)?{kind:`page`,href:o}:t===`page`&&!(y3.test(o)&&r&&O3(o,r))?null:y3.test(o)?{kind:r&&O3(o,r)?`page`:`web`,href:o}:b3.test(o)?{kind:`contact`,href:o}:null}function E3(e,t){if(C3.test(e))return e;if(e.startsWith(`//`))return`https:${e}`;if(e===``)return null;let n=e.indexOf(`#`),r=n<0?``:e.slice(n),i=n<0?e:e.slice(0,n),a=i.indexOf(`?`),o=a<0?i:i.slice(0,a),s=a<0?``:i.slice(a);return o===``?`${t}${s}${r}`:`${t}${D3(o.startsWith(`/`)?o:`/${o}`)}${s}${r}`}function D3(e){let t=e.split(`/`),n=[];return t.forEach((e,r)=>{let i=r===t.length-1;e===`.`?i&&n.push(``):e===`..`?(n.length>1&&n.pop(),i&&n.push(``)):n.push(e)}),n.join(`/`)}function O3(e,t){if(e.slice(0,t.length).toLowerCase()!==t.toLowerCase())return!1;let n=e[t.length];return n===void 0||n===`/`||n===`?`||n===`#`}function k3(e){return typeof e!=`string`||!e.startsWith(`/`)||e[1]===`/`||e[1]===`\\`?null:e}var A3=/^\s*```/,j3=/^\s*```\s*(\S*)/,M3=/^\s{0,3}(#{1,6})\s+(.*?)(?:\s+#+)?\s*$/,N3=/^\s*([-*_])(\s*\1){2,}\s*$/,P3=/^(\s*)[-*+]\s+(.*)$/,F3=/^(\s*)(\d{1,9})[.)]\s+(.*)$/,I3=/^\s*>\s?(.*)$/,L3=/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)*\|?\s*$/,R3=[1,2,3,4,5,6],z3=e=>e.includes(`|`);function B3(e){let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())}function V3(e,t){let n=e[t];if(n===void 0)throw Error(`startsTable was called past the last source line`);let r=e[t+1];return r!==void 0&&z3(n)&&r.includes(`|`)&&L3.test(r)}function H3(e,t){let n=e[t];if(n===void 0)throw Error(`startsBlock was called past the last source line`);return A3.test(n)||I3.test(n)||P3.test(n)||F3.test(n)||M3.test(n)||N3.test(n)||V3(e,t)}function U3(e){let t=e.replace(/\t/g,` `).length;return Math.min(Math.floor(t/2),4)}function W3(e){let t=F3.exec(e);if(t){let e=t[1],n=t[2],r=t[3];if(e===void 0||n===void 0||r===void 0)throw Error(`The ordered list pattern always captures its indent, number and text`);return{text:r,depth:U3(e),ordered:!0,number:Number(n)}}let n=P3.exec(e);if(n){let e=n[1],t=n[2];if(e===void 0||t===void 0)throw Error(`The bullet list pattern always captures its indent and text`);return{text:t,depth:U3(e),ordered:!1,number:0}}return null}function G3(e){let t=(e??``).replace(/\r\n?/g,`
41
+ `)){var p=new zZ;p.newline=!0,s.add(p)}else{var m=n.getSeriesByName(f)[0];if(!c.get(f)){if(m){var h=m.getData(),g=h.getVisual(`legendLineStyle`)||{},_=h.getVisual(`legendIcon`),v=h.getVisual(`style`),y=this._createItem(m,f,a,i,t,e,g,v,_,l,r);y.on(`click`,LZ(Qk,f,null,r,d)).on(`mouseover`,LZ($k,m.name,null,r,d)).on(`mouseout`,LZ(eA,m.name,null,r,d)),n.ssr&&y.eachChild(function(e){var t=LR(e);t.seriesIndex=m.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&y.eachChild(function(e){o.packEventData(e,t,m,a,f)}),c.set(f,!0)}else n.eachRawSeries(function(o){var s=this;if(!c.get(f)&&o.legendVisualProvider){var p=o.legendVisualProvider;if(!p.containName(f))return;var m=p.indexOfName(f),h=p.getItemVisual(m,`style`),g=p.getItemVisual(m,`legendIcon`),_=ec(h.fill);_&&_[3]===0&&(_[3]=.2,h=I(I({},h),{fill:cc(_,`rgba`)}));var v=this._createItem(o,f,a,i,t,e,{},h,g,l,r);v.on(`click`,LZ(Qk,null,f,r,d)).on(`mouseover`,LZ($k,null,f,r,d)).on(`mouseout`,LZ(eA,null,f,r,d)),n.ssr&&v.eachChild(function(e){var t=LR(e);t.seriesIndex=o.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&v.eachChild(function(e){s.packEventData(e,t,o,a,f)}),c.set(f,!0)}},this)}}},this),i&&this._createSelector(i,t,r,a,o)},t.prototype.packEventData=function(e,t,n,r,i){var a={componentType:`legend`,componentIndex:t.componentIndex,dataIndex:r,value:i,seriesIndex:n.seriesIndex};LR(e).eventData=a},t.prototype._createSelector=function(e,t,n,r,i){var a=this.getSelectorGroup();RZ(e,function(e){var r=e.type,i=new cR({style:{x:0,y:0,align:`center`,verticalAlign:`middle`},onclick:function(){n.dispatchAction({type:r===`all`?`legendAllSelect`:`legendInverseSelect`,legendId:t.id})}});a.add(i),ip(i,{normal:t.getModel(`selectorLabel`),emphasis:t.getModel([`emphasis`,`selectorLabel`])},{defaultText:e.title}),Nd(i)})},t.prototype._createItem=function(e,t,n,r,i,a,o,s,c,l,u){var d=e.visualDrawType,f=i.get(`itemWidth`),p=i.get(`itemHeight`),m=i.isSelected(t),h=r.get(`symbolRotate`),g=r.get(`symbolKeepAspect`),_=r.get(`icon`);c=_||c||`roundRect`;var v=Xk(c,r,o,s,d,m,u),y=new zZ,b=r.getModel(`textStyle`);if(B(e.getLegendIcon)&&(!_||_===`inherit`))y.add(e.getLegendIcon({itemWidth:f,itemHeight:p,icon:c,iconRotate:h,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}));else{var x=_===`inherit`&&e.getData().getVisual(`symbol`)?h===`inherit`?e.getData().getVisual(`symbolRotate`):h:0;y.add(Zk({itemWidth:f,itemHeight:p,icon:c,iconRotate:x,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}))}var S=a===`left`?f+5:-5,C=a,w=i.get(`formatter`),T=t;V(w)&&w?T=w.replace(`{name}`,t??``):B(w)&&(T=w(t));var E=m?b.getTextColor():r.get(`inactiveColor`);y.add(new cR({style:op(b,{text:T,x:S,y:p/2,fill:E,align:C,verticalAlign:`middle`},{inheritColor:E})}));var D=new rR({shape:y.getBoundingRect(),style:{fill:`transparent`}}),O=r.getModel(`tooltip`);return O.get(`show`)&&Uf({el:D,componentModel:i,itemName:t,itemTooltipOption:O.option}),y.add(D),y.eachChild(function(e){e.silent=!0}),D.silent=!l,this.getContentGroup().add(y),Nd(y),y.__legendDataIndex=n,y},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getContentGroup(),s=this.getSelectorGroup();SH(e.get(`orient`),o,e.get(`itemGap`),n.width,n.height);var c=o.getBoundingRect(),l=[-c.x,-c.y];if(s.markRedraw(),o.markRedraw(),i){SH(`horizontal`,s,e.get(`selectorItemGap`,!0));var u=s.getBoundingRect(),d=[-u.x,-u.y],f=e.get(`selectorButtonGap`,!0),p=e.getOrient().index,m=p===0?`width`:`height`,h=p===0?`height`:`width`,g=p===0?`y`:`x`;a===`end`?d[p]+=c[m]+f:l[p]+=u[m]+f,d[1-p]+=c[h]/2-u[h]/2,s.x=d[0],s.y=d[1],o.x=l[0],o.y=l[1];var _={x:0,y:0};return _[m]=c[m]+f+u[m],_[h]=Math.max(c[h],u[h]),_[g]=Math.min(0,u[g]+d[1-p]),_}return o.x=l[0],o.y=l[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type=`legend.plain`,t}(xK),VZ=$u(iA),HZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(t,n,r){var i=Dh(t);e.prototype.init.call(this,t,n,r),oA(this,t,i)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),oA(this,this.option,t)},t.type=`legend.scroll`,t.defaultOption=bm(IZ.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:X.color.accent50,pageIconInactiveColor:X.color.accent10,pageIconSize:15,pageTextStyle:{color:X.color.tertiary},animationDurationUpdate:800}),t}(IZ),UZ=Sz,WZ=[`width`,`height`],GZ=[`x`,`y`],KZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!0,n._currentIndex=0,n}return t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new UZ),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new UZ)},t.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},t.prototype.renderInner=function(t,n,r,i,a,o,s){var c=this;e.prototype.renderInner.call(this,t,n,r,i,a,o,s);var l=this._controllerGroup,u=n.get(`pageIconSize`,!0),d=z(u)?u:[u,u];p(`pagePrev`,0);var f=n.getModel(`pageTextStyle`);l.add(new cR({name:`pageText`,style:{text:`xx/xx`,fill:f.getTextColor(),font:f.getFont(),verticalAlign:`middle`,align:`center`},silent:!0})),p(`pageNext`,1);function p(e,t){var r=e+`DataIndex`,a=If(n.get(`pageIcons`,!0)[n.getOrient().name][t],{onclick:q(c._pageGo,c,r,n,i)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});a.name=e,l.add(a)}},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getSelectorGroup(),s=e.getOrient().index,c=WZ[s],l=GZ[s],u=WZ[1-s],d=GZ[1-s];i&&SH(`horizontal`,o,e.get(`selectorItemGap`,!0));var f=e.get(`selectorButtonGap`,!0),p=o.getBoundingRect(),m=[-p.x,-p.y],h=ka(n);i&&(h[c]=n[c]-p[c]-f);var g=this._layoutContentAndController(e,r,h,s,c,u,d,l);if(i){if(a===`end`)m[s]+=g[c]+f;else{var _=p[c]+f;m[s]-=_,g[l]-=_}g[c]+=p[c]+f,m[1-s]+=g[d]+g[u]/2-p[u]/2,g[u]=Math.max(g[u],p[u]),g[d]=Math.min(g[d],p[d]+m[1-s]),o.x=m[0],o.y=m[1],o.markRedraw()}return g},t.prototype._layoutContentAndController=function(e,t,n,r,i,a,o,s){var c=this.getContentGroup(),l=this._containerGroup,u=this._controllerGroup;SH(e.get(`orient`),c,e.get(`itemGap`),r?n.width:null,r?null:n.height),SH(`horizontal`,u,e.get(`pageButtonItemGap`,!0));var d=c.getBoundingRect(),f=u.getBoundingRect(),p=this._showController=d[i]>n[i],m=[-d.x,-d.y];t||(m[r]=c[s]);var h=[0,0],g=[-f.x,-f.y],_=U(e.get(`pageButtonGap`,!0),e.get(`itemGap`,!0));p&&(e.get(`pageButtonPosition`,!0)===`end`?g[r]+=n[i]-f[i]:h[r]+=f[i]+_),g[1-r]+=d[a]/2-f[a]/2,c.setPosition(m),l.setPosition(h),u.setPosition(g);var v={x:0,y:0};if(v[i]=p?n[i]:d[i],v[a]=Math.max(d[a],f[a]),v[o]=Math.min(0,f[o]+g[1-r]),l.__rectSize=n[i],p){var y={x:0,y:0};y[i]=Math.max(n[i]-f[i]-_,0),y[a]=v[a],l.setClipPath(new rR({shape:y})),l.__rectSize=y[i]}else u.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return b.pageIndex!=null&&df(c,{x:b.contentPosition[0],y:b.contentPosition[1]},p?e:null),this._updatePageInfoView(e,b),v},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];r!=null&&n.dispatchAction({type:`legendScroll`,scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;L([`pagePrev`,`pageNext`],function(r){var i=t[r+`DataIndex`]!=null,a=n.childOfName(r);a&&(a.setStyle(`fill`,i?e.get(`pageIconColor`,!0):e.get(`pageIconInactiveColor`,!0)),a.cursor=i?`pointer`:`default`)});var r=n.childOfName(`pageText`),i=e.get(`pageFormatter`),a=t.pageIndex,o=a==null?0:a+1,s=t.pageCount;r&&i&&r.setStyle(`text`,V(i)?i.replace(`{current}`,o==null?``:o+``).replace(`{total}`,s==null?``:s+``):i({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get(`scrollDataIndex`,!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,a=WZ[i],o=GZ[i],s=this._findTargetItemIndex(t),c=n.children(),l=c[s],u=c.length,d=+!!u,f={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!l)return f;var p=v(l);f.contentPosition[i]=-p.s;for(var m=s+1,h=p,g=p,_=null;m<=u;++m)_=v(c[m]),(!_&&g.e>h.s+r||_&&!y(_,h.s))&&(h=g.i>h.i?g:_,h&&(f.pageNextDataIndex??=h.i,++f.pageCount)),g=_;for(var m=s-1,h=p,g=p,_=null;m>=-1;--m)_=v(c[m]),(!_||!y(g,_.s))&&h.i<g.i&&(g=h,f.pagePrevDataIndex??=h.i,++f.pageCount,++f.pageIndex),h=_;return f;function v(e){if(e){var t=e.getBoundingRect(),n=t[o]+e[o];return{s:n,e:n+t[a],i:e.__legendDataIndex}}}function y(e,t){return e.e>=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var t,n=this.getContentGroup(),r;return n.eachChild(function(n,i){var a=n.__legendDataIndex;r==null&&a!=null&&(r=i),a===e&&(t=i)}),t??r},t.type=`legend.scroll`,t}(BZ),qZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.inside`,t.defaultOption=bm(cZ.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(cZ),JZ=Du(),YZ=function(e){F(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`dataZoom.inside`,t}return t.prototype.render=function(t,n,r){e.prototype.render.apply(this,arguments),t.noTarget()?this._clear():(this.range=t.getPercentRange(),uA(r,t,{pan:q(XZ.pan,this),zoom:q(XZ.zoom,this),scrollMove:q(XZ.scrollMove,this)}))},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){dA(this.api,this.dataZoomModel),this.range=null},t.type=`dataZoom.inside`,t}(lZ),XZ={zoom:function(e,t,n,r){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=ZZ[t](null,[r.originX,r.originY],o,n,e),c=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],l=Math.max(1/r.scale,0);a[0]=(a[0]-c)*l+c,a[1]=(a[1]-c)*l+c;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if($E(0,a,[0,100],0,u.minSpan,u.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:vA(function(e,t,n,r,i,a){var o=ZZ[r]([a.oldX,a.oldY],[a.newX,a.newY],t,i,n);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:vA(function(e,t,n,r,i,a){return ZZ[r]([0,0],[a.scrollDelta,a.scrollDelta],t,i,n).signal*(e[1]-e[0])*a.scrollDelta})},ZZ={grid:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem.getRect();return e||=[0,0],a.dim===`x`?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem,c=s.getRadiusAxis().getExtent(),l=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),n.mainType===`radiusAxis`?(o.pixel=t[0]-e[0],o.pixelLength=c[1]-c[0],o.pixelStart=c[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,n,r,i){var a=n.axis,o=i.model.coordinateSystem.getRect(),s={};return e||=[0,0],a.orient===`horizontal`?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}},QZ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.slider`,t.layoutMode=`box`,t.defaultOption=bm(cZ.defaultOption,{show:!0,right:`ph`,top:`ph`,width:`ph`,height:`ph`,left:null,bottom:null,borderColor:X.color.accent10,borderRadius:0,backgroundColor:X.color.transparent,dataBackground:{lineStyle:{color:X.color.accent30,width:.5},areaStyle:{color:X.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:X.color.accent40,width:.5},areaStyle:{color:X.color.accent20,opacity:.3}},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:X.color.neutral00,borderColor:X.color.accent20},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:X.color.accent40,opacity:.5},showDetail:!0,showDataShadow:`auto`,realtime:!0,zoomLock:!1,textStyle:{color:X.color.tertiary},brushSelect:!0,brushStyle:{color:X.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:X.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}(cZ),$Z=rR,eQ=1,tQ=30,nQ=7,rQ=`horizontal`,iQ=`vertical`,aQ=5,oQ=[`line`,`bar`,`candlestick`,`scatter`],sQ={easing:`cubicOut`,duration:100,delay:0},cQ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return t.prototype.init=function(e,t){this.api=t,this._onBrush=q(this._onBrush,this),this._onBrushEnd=q(this._onBrushEnd,this)},t.prototype.render=function(t,n,r,i){e.prototype.render.apply(this,arguments),gb(this,`_dispatchZoomAction`,t.get(`throttle`),`fixRate`),this._orient=t.getOrient(),t.get(`show`)===!1?this.group.removeAll():t.noTarget()?(this._clear(),this.group.removeAll()):(i&&i.type===`dataZoom`&&i.from===this.uid||this._buildView(),this._updateView())},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){_b(this,`_dispatchZoomAction`);var e=this.api.getZr();e.off(`mousemove`,this._onBrush),e.off(`mouseup`,this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new Sz;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get(`brushSelect`)?nQ:0,r=Sh(e,t).refContainer,i=this._findCoordRect(),a=e.get(`defaultLocationEdgeGap`,!0)||0,o=this._orient===rQ?{right:r.width-i.x-i.width,top:r.height-tQ-a-n,width:i.width,height:tQ}:{right:a,top:i.y,width:tQ,height:i.height},s=Dh(e.option);L([`right`,`top`,`width`,`height`],function(e){s[e]===`ph`&&(s[e]=o[e])});var c=xh(s,r);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===iQ&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get(`inverse`),a=this._displayables.sliderGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(n===rQ&&!i?{scaleY:o?1:-1,scaleX:1}:n===rQ&&i?{scaleY:o?1:-1,scaleX:-1}:n===iQ&&!i?{scaleY:o?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:o?-1:1,scaleX:-1,rotation:Math.PI/2});var s=e.getBoundingRect([a]),c=isNaN(s.x)?0:s.x,l=isNaN(s.y)?0:s.y;e.x=t.x-c,e.y=t.y-l,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,r=e.get(`brushSelect`);n.add(new $Z({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get(`backgroundColor`)},z2:-40}));var i=new $Z({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:`transparent`},z2:0,onclick:q(this._onClickPanel,this)}),a=this.api.getZr();r?(i.on(`mousedown`,this._onBrushStart,this),i.cursor=`crosshair`,a.on(`mousemove`,this._onBrush),a.on(`mouseup`,this._onBrushEnd)):(a.off(`mousemove`,this._onBrush),a.off(`mouseup`,this._onBrushEnd)),n.add(i)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!e)return;var t=this._size,n=this._shadowSize||[],r=e.series,i=r.getRawData(),a=r.getShadowDim&&r.getShadowDim(),o=a&&i.getDimensionInfo(a)?r.getShadowDim():e.otherDim;if(o==null)return;var s=this._shadowPolygonPts,c=this._shadowPolylinePts;if(i!==this._shadowData||o!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var l=i.getDataExtent(e.thisDim),u=i.getDataExtent(o),d=(u[1]-u[0])*.3;u=[u[0]-d,u[1]+d];var f=[0,t[1]],p=[0,t[0]],m=[[t[0],0],[0,0]],h=[],g=p[1]/Math.max(1,i.count()-1),_=t[0]/(l[1]-l[0]),v=e.thisAxis.type===`time`,y=-g,b=Math.round(i.count()/t[0]),x;i.each([e.thisDim,o],function(e,t,n){if(b>0&&n%b)v||(y+=g);else{y=v?(+e-l[0])*_:y+g;var r=t==null||isNaN(t)||t===``,i=r?0:Nl(t,u,f,!0);r&&!x&&n?(m.push([m[m.length-1][0],0]),h.push([h[h.length-1][0],0])):!r&&x&&(m.push([y,0]),h.push([y,0])),r||(m.push([y,i]),h.push([y,i])),x=r}}),s=this._shadowPolygonPts=m,c=this._shadowPolylinePts=h}this._shadowData=i,this._shadowDim=o,this._shadowSize=[t[0],t[1]];var S=this.dataZoomModel;function C(e){var t=S.getModel(e?`selectedDataBackground`:`dataBackground`),n=new Sz,r=new Uz({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel(`areaStyle`).getAreaStyle(),silent:!0,z2:-20}),i=new Gz({shape:{points:c},segmentIgnoreThreshold:1,style:t.getModel(`lineStyle`).getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),n}for(var w=0;w<3;w++){var T=C(w===1);this._displayables.sliderGroup.add(T),this._displayables.dataShadowSegs.push(T)}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get(`showDataShadow`);if(t!==!1){var n,r=this.ecModel;return e.eachTargetAxis(function(i,a){L(e.getAxisProxy(i,a).getTargetSeriesModels(),function(e){if(!n&&!(t!==!0&&Na(oQ,e.get(`type`))<0)){var o=r.getComponent(JO(i),a).axis,s=xA(i),c,l=e.coordinateSystem;s!=null&&l.getOtherAxis&&(c=l.getOtherAxis(o).inverse),s=e.getData().mapDimension(s),n={thisAxis:o,series:e,thisDim:e.getData().mapDimension(i),otherDim:s,otherAxisInverse:c}}},this)},this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],r=t.handleLabels=[null,null],i=this._displayables.sliderGroup,a=this._size,o=this.dataZoomModel,s=this.api,c=o.get(`borderRadius`)||0,l=o.get(`brushSelect`),u=t.filler=new $Z({silent:l,style:{fill:o.get(`fillerColor`)},textConfig:{position:`inside`}});i.add(u),i.add(new $Z({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:a[0],height:a[1],r:c},style:{stroke:o.get(`dataBackgroundColor`)||o.get(`borderColor`),lineWidth:eQ,fill:X.color.transparent}})),L([0,1],function(t){var a=o.get(`handleIcon`);!qH[a]&&a.indexOf(`path://`)<0&&a.indexOf(`image://`)<0&&(a=`path://`+a);var s=xg(a,-1,0,2,2,null,!0);s.attr({cursor:SA(this._orient),draggable:!0,drift:q(this._onDragMove,this,t),ondragend:q(this._onDragEnd,this),onmouseover:q(this._onOverDataInfoTriggerArea,this,!0),onmouseout:q(this._onOverDataInfoTriggerArea,this,!1),z2:5});var c=s.getBoundingRect(),l=o.get(`handleSize`);this._handleHeight=Y(l,this._size[1]),this._handleWidth=c.width/c.height*this._handleHeight,s.setStyle(o.getModel(`handleStyle`).getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState(`emphasis`).style=o.getModel([`emphasis`,`handleStyle`]).getItemStyle(),Nd(s);var u=o.get(`handleColor`);u!=null&&(s.style.fill=u),i.add(n[t]=s);var d=o.getModel(`textStyle`),f=(o.get(`handleLabel`)||{}).show||!1;e.add(r[t]=new cR({silent:!0,invisible:!f,style:op(d,{x:0,y:0,text:``,verticalAlign:`middle`,align:`center`,fill:d.getTextColor(),font:d.getFont()}),z2:10}))},this);var d=u;if(l){var f=Y(o.get(`moveHandleSize`),a[1]),p=t.moveHandle=new rR({style:o.getModel(`moveHandleStyle`).getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:a[1]-.5,height:f}}),m=f*.8,h=t.moveHandleIcon=xg(o.get(`moveHandleIcon`),-m/2,-m/2,m,m,X.color.neutral00,!0);h.silent=!0,h.y=a[1]+f/2-.5,p.ensureState(`emphasis`).style=o.getModel([`emphasis`,`moveHandleStyle`]).getItemStyle();var g=Math.min(a[1]/2,Math.max(f,10));d=t.moveZone=new rR({invisible:!0,shape:{y:a[1]-g,height:f+g}}),d.on(`mouseover`,function(){s.enterEmphasis(p)}).on(`mouseout`,function(){s.leaveEmphasis(p)}),i.add(p),i.add(h),i.add(d)}d.attr({draggable:!0,cursor:`grab`,drift:q(this._onActualMoveZoneDrift,this),ondragstart:q(this._onActualMoveZoneDragStart,this),ondragend:q(this._onActualMoveZoneDragEnd,this),onmouseover:q(this._onOverDataInfoTriggerArea,this,!0),onmouseout:q(this._onOverDataInfoTriggerArea,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[Nl(e[0],[0,100],t,!0),Nl(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),a=n.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];$E(t,r,i,n.get(`zoomLock`)?`all`:e,a.minSpan==null?null:Nl(a.minSpan,o,i,!0),a.maxSpan==null?null:Nl(a.maxSpan,o,i,!0));var s=this._range,c=this._range=zl([Nl(r[0],i,o,!0),Nl(r[1],i,o,!0)]);return!s||s[0]!==c[0]||s[1]!==c[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,r=zl(n.slice()),i=this._size;L([0,1],function(e){var r=t.handles[e],a=this._handleHeight;r.attr({scaleX:a/2,scaleY:a/2,x:n[e]+(e?-1:1),y:i[1]/2-a/2})},this),t.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var a={x:r[0],width:r[1]-r[0]};t.moveHandle&&(t.moveHandle.setShape(a),t.moveZone.setShape(a),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr(`x`,a.x+a.width/2));for(var o=t.dataShadowSegs,s=[0,r[0],r[1],i[0]],c=0;c<o.length;c++){var l=o[c],u=l.getClipPath();u||(u=new rR,l.setClipPath(u)),u.setShape({x:s[c],y:0,width:s[c+1]-s[c],height:i[1]})}this._updateDataInfo(e)},t.prototype._updateDataInfo=function(e){var t=this.dataZoomModel,n=this._displayables,r=n.handleLabels,i=this._orient,a=[``,``];if(t.get(`showDetail`)){var o=t.findRepresentativeAxisProxy(),s=o.getAxisModel().axis.scale;if(o){var c=this._range,l;if(e){var u={start:c[0],end:c[1]},d=ek(t,o);if(d){var f=d.calculateDataWindow(u).percentInverted;u={start:f[0],end:f[1]}}l=o.calculateDataWindow(u)}else l=o.getWindow();a=[bA(t,0,l,s),bA(t,1,l,s)]}}var p=zl(this._handleEnds.slice());m.call(this,0),m.call(this,1);function m(e){var t=Of(n.handles[e].parent,this.group),o=Af(e===0?`right`:`left`,t),s=this._handleWidth/2+aQ,c=kf([p[e]+(e===0?-s:s),this._size[1]/2],t);r[e].setStyle({x:c[0],y:c[1],verticalAlign:i===rQ?`middle`:o,align:i===rQ?o:`center`,text:a[e]})}},t.prototype._onOverDataInfoTriggerArea=function(e){this._isOverDataInfoTriggerArea=e,this._showDataInfo(e)},t.prototype._showDataInfo=function(e){var t=(this.dataZoomModel.get(`handleLabel`)||{}).show||!1,n=this.dataZoomModel.getModel([`emphasis`,`handleLabel`]).get(`show`)||!1,r=e||this._dragging?n:t,i=this._displayables,a=i.handleLabels;a[0].attr(`invisible`,!r),a[1].attr(`invisible`,!r),i.moveHandle&&this.api[r?`enterEmphasis`:`leaveEmphasis`](i.moveHandle,1)},t.prototype._onActualMoveZoneDrift=function(e,t,n){this.api.getZr().setCursorStyle(`grabbing`),this._onDragMove(`all`,e,t,n)},t.prototype._onActualMoveZoneDragStart=function(e){e.target.attr(`cursor`,`grabbing`),this._showDataInfo(!0)},t.prototype._onActualMoveZoneDragEnd=function(e){e.target.attr(`cursor`,`grab`),this._onDragEnd()},t.prototype._onDragMove=function(e,t,n,r){this._dragging=!0,TG(r.event);var i=this._displayables.sliderGroup.getLocalTransform(),a=kf([t,n],i,!0),o=this._updateInterval(e,a[0]),s=this.dataZoomModel.get(`realtime`);this._updateView(!s),o&&s&&this._dispatchZoomAction(!0)},t.prototype._onDragEnd=function(){this._dragging=!1,this._isOverDataInfoTriggerArea||this._showDataInfo(!1),!this.dataZoomModel.get(`realtime`)&&this._dispatchZoomAction(!1)},t.prototype._onClickPanel=function(e){var t=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(n[0]<0||n[0]>t[0]||n[1]<0||n[1]>t[1])){var r=this._handleEnds,i=(r[0]+r[1])/2,a=this._updateInterval(`all`,n[0]-i);this._updateView(),a&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new wF(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr(`ignore`,!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var r=this._getViewExtent(),i=[0,100],a=this._handleEnds=[n.x,n.x+n.width],o=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();$E(0,a,r,0,o.minSpan==null?null:Nl(o.minSpan,i,r,!0),o.maxSpan==null?null:Nl(o.maxSpan,i,r,!0)),this._range=zl([Nl(a[0],r,i,!0),Nl(a[1],r,i,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(TG(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new $Z({silent:!0,style:r.getModel(`brushStyle`).getItemStyle()}),n.sliderGroup.add(i)),i.attr(`ignore`,!1);var a=this._brushStart,o=this._displayables.sliderGroup,s=o.transformCoordToLocal(e,t),c=o.transformCoordToLocal(a.x,a.y),l=this._size;s[0]=Math.max(Math.min(l[0],s[0]),0),i.setShape({x:c[0],y:0,width:s[0]-c[0],height:l[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:`dataZoom`,from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?sQ:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=XO(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var r=this.api.getWidth(),i=this.api.getHeight();e={x:r*.2,y:i*.2,width:r*.6,height:i*.6}}return e},t.type=`dataZoom.slider`,t}(lZ),lQ={get:function(e,t,n){var r=ka((uQ[e]||{})[t]);return n&&z(r)?r[r.length-1]:r}},uQ={color:{active:[`#006edd`,`#e0ffff`],inactive:[X.color.transparent]},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]}},dQ=qY.mapVisual,fQ=qY.eachVisual,pQ=z,mQ=L,hQ=zl,gQ=Nl,_Q=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=[`inRange`,`outOfRange`],n.replacableOptionKeys=[`inRange`,`outOfRange`,`target`,`controller`,`color`],n.layoutMode={type:`box`,ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&kk(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel(`textStyle`),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=q(e,this),this.controllerVisuals=Ok(this.option.controller,t,e),this.targetVisuals=Ok(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this,t=this.option.seriesTargets;if(t){var n=[];return mQ(t,function(t){if(t.seriesIndex!=null)n.push(t.seriesIndex);else if(t.seriesId!=null){var r;e.ecModel.eachSeries(function(e){e.id===t.seriesId&&(r=e)}),r&&n.push(r.componentIndex)}}),n}var r=this.option.seriesId,i=this.option.seriesIndex;i==null&&r==null&&(i=`all`);var a=Au(this.ecModel,`series`,{index:i,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return R(a,function(e){return e.componentIndex})},t.prototype.eachTargetSeries=function(e,t){L(this.getTargetSeriesIndices(),function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)},this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries(function(n){n===e&&(t=!0)}),t},t.prototype.formatValueText=function(e,t,n){var r=this.option,i=r.precision,a=this.dataBound,o=r.formatter,s;n||=[`<`,`>`],z(e)&&(e=e.slice(),s=!0);var c=t?e:s?[l(e[0]),l(e[1])]:l(e);return V(o)?o.replace(`{value}`,s?c[0]:c).replace(`{value2}`,s?c[1]:c):B(o)?s?o(e[0],e[1]):o(e):s?e[0]===a[0]?n[0]+` `+c[1]:e[1]===a[1]?n[1]+` `+c[0]:c[0]+` - `+c[1]:c;function l(e){return e===a[0]?`min`:e===a[1]?`max`:(+e).toFixed(Math.min(i,20))}},t.prototype.resetExtent=function(){var e=this.option,t=hQ([e.min,e.max]);this._dataExtent=t},t.prototype.getDimension=function(e){var t=this,n=this.option.seriesTargets;if(n){var r=za(n,function(n){return n.seriesIndex!=null&&n.seriesIndex===e||n.seriesId!=null&&n.seriesId===t.ecModel.getSeriesByIndex(e).id});if(r)return r.dimension}return this.option.dimension},t.prototype.getDataDimensionIndex=function(e){var t=e.hostModel.seriesIndex,n=this.getDimension(t);if(n!=null)return e.getDimensionIndex(n);for(var r=e.dimensions,i=r.length-1;i>=0;i--){var a=r[i],o=e.getDimensionInfo(a);if(!o.isCalculationCoord)return o.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||={},i=t.controller||={};Aa(r,n),Aa(i,n);var a=this.isCategory();o.call(this,r),o.call(this,i),s.call(this,r,`inRange`,`outOfRange`),c.call(this,i);function o(n){pQ(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get(`gradientColor`)}}function s(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},mQ(r,function(e,t){if(qY.isValidType(t)){var n=lQ.get(t,`inactive`,a);n!=null&&(i[t]=n,t===`color`&&!i.hasOwnProperty(`opacity`)&&!i.hasOwnProperty(`colorAlpha`)&&(i.opacity=[0,0]))}}))}function c(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get(`inactiveColor`),i=this.getItemSymbol()||`roundRect`;mQ(this.stateList,function(o){var s=this.itemSize,c=e[o];c||=e[o]={color:a?r:[r]},c.symbol??(c.symbol=t&&ka(t)||(a?i:[i])),c.symbolSize??(c.symbolSize=n&&ka(n)||(a?s[0]:[s[0],s[0]])),c.symbol=dQ(c.symbol,function(e){return e===`none`?i:e});var l=c.symbolSize;if(l!=null){var u=-1/0;fQ(l,function(e){e>u&&(u=e)}),c.symbolSize=dQ(l,function(e){return gQ(e,[0,u],[0,s[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get(`itemWidth`)),parseFloat(this.get(`itemHeight`))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type=`visualMap`,t.dependencies=[`series`],t.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:`vertical`,backgroundColor:X.color.transparent,borderColor:X.color.borderTint,contentColor:X.color.theme[0],inactiveColor:X.color.disabled,borderWidth:0,padding:X.size.m,textGap:10,precision:0,textStyle:{color:X.color.secondary}},t}(TH),vQ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.autoPositionValues={left:1,right:1,top:1,bottom:1},n}return t.prototype.init=function(e,t){this.ecModel=e,this.api=t},t.prototype.render=function(e,t,n,r){this.visualMapModel=e,e.get(`show`)===!1?this.group.removeAll():this.doRender(e,t,n,r)},t.prototype.renderBackground=function(e){var t=this.visualMapModel,n=gH(t.get(`padding`)||0),r=e.getBoundingRect();e.add(new rR({z2:-1,silent:!0,shape:{x:r.x-n[3],y:r.y-n[0],width:r.width+n[3]+n[1],height:r.height+n[0]+n[2]},style:{fill:t.get(`backgroundColor`),stroke:t.get(`borderColor`),lineWidth:t.get(`borderWidth`)}}))},t.prototype.getControllerVisual=function(e,t,n){n||={};var r=n.forceState,i=this.visualMapModel,a={};t===`color`&&(a.color=i.get(`contentColor`));function o(e){return a[e]}function s(e,t){a[e]=t}var c=i.controllerVisuals[r||i.getValueState(e)];return L(qY.prepareVisualTypes(c),function(r){var i=c[r];n.convertOpacityToAlpha&&r===`opacity`&&(r=`colorAlpha`,i=c.__alphaForOpacity),qY.dependsOn(r,t)&&i&&i.applyVisual(e,o,s)}),a[t]},t.prototype.positionGroup=function(e){var t=this.visualMapModel,n=this.api,r=Sh(t,n).refContainer;Ch(e,t.getBoxLayoutParams(),r)},t.prototype.doRender=function(e,t,n,r){},t.type=`visualMap`,t}(xK),yQ=[[`left`,`right`,`width`],[`top`,`bottom`,`height`]],bQ={type:`selectDataRange`,event:`dataRangeSelected`,update:`update`},xQ=function(e,t){t.eachComponent({mainType:`visualMap`,query:e},function(t){t.setSelected(e.selected)})},SQ=[{createOnAllSeries:!0,reset:function(e,t){var n=[];return t.eachComponent(`visualMap`,function(t){var r=e.pipelineContext;!t.isTargetSeries(e)||r&&r.large||n.push(Ak(t.stateList,t.targetVisuals,q(t.getValueState,t),t.getDataDimensionIndex(e.getData())))}),n}},{createOnAllSeries:!0,reset:function(e,t){var n=e.getData(),r=[];t.eachComponent(`visualMap`,function(t){if(t.isTargetSeries(e)){var i=t.getVisualMeta(q(DA,null,e,t))||{stops:[],outerColors:[]},a=t.getDataDimensionIndex(n);a>=0&&(i.dimension=a,r.push(i))}}),e.getData().setVisual(`visualMeta`,r)}}],CQ=L,wQ=!1,TQ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],EQ[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual(function(e,t){r===`categories`?(e.mappingMethod=`category`,e.categories=ka(i)):(e.dataExtent=this.getExtent(),e.mappingMethod=`piecewise`,e.pieceList=R(this._pieceList,function(e){return e=ka(e),t!==`inRange`&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=qY.listVisualTypes(),i=this.isCategory();L(t.pieces,function(e){L(r,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),L(n,function(e,n){var r=!1;L(this.stateList,function(e){r=r||a(t,e,n)||a(t.target,e,n)},this),!r&&L(this.stateList,function(e){(t[e]||(t[e]={}))[n]=lQ.get(n,e===`inRange`?`active`:`inactive`,i)})},this);function a(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,L(r,function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)},this),n.selectedMode===`single`){var a=!1;L(r,function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(a?i[n]=!1:a=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get(`itemSymbol`)},t.prototype.getSelectedMapKey=function(e){return this._mode===`categories`?e.value+``:e.index+``},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?`pieces`:this.option.categories?`categories`:`splitNumber`},t.prototype.setSelected=function(e){this.option.selected=ka(e)},t.prototype.getValueState=function(e){var t=qY.findPieceIndex(e,this._pieceList);return t==null?`outOfRange`:this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries(function(r){var i=[],a=r.getData();a.each(this.getDataDimensionIndex(a),function(t,r){qY.findPieceIndex(t,n)===e&&i.push(r)},this),t.push({seriesId:r.id,dataIndex:i})},this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(e.value!=null)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(this.isCategory())return;var t=[],n=[``,``],r=this;function i(i,a){var o=r.getRepresentValue({interval:i});a||=r.getValueState(o);var s=e(o,a);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:t.push({value:i[0],color:s},{value:i[1],color:s})}var a=this._pieceList.slice();if(!a.length)a.push({interval:[-1/0,1/0]});else{var o=a[0].interval[0];o!==-1/0&&a.unshift({interval:[-1/0,o]}),o=a[a.length-1].interval[1],o!==1/0&&a.push({interval:[o,1/0]})}var s=-1/0;return L(a,function(e){var t=e.interval;t&&(t[0]>s&&i([s,t[0]],`outOfRange`),i(t.slice()),s=t[1])},this),{stops:t,outerColors:n}},t.type=`visualMap.piecewise`,t.defaultOption=bm(_Q.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}),t}(_Q),EQ={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var a=(r[1]-r[0])/i;+a.toFixed(n)!==a&&n<5;)n++;t.precision=n,a=+a.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var o=0,s=r[0];o<i;s+=a,o++){var c=o===i-1?r[1]:s+a;e.push({interval:[s,c],close:[1,1]})}t.maxOpen&&e.push({interval:[r[1],1/0],close:[0,0]}),Zl(e),L(e,function(e,t){e.index=t,e.text=this.formatValueText(e.interval)},this)},categories:function(e){var t=this.option;L(t.categories,function(t){e.push({text:this.formatValueText(t,!0),value:t})},this),jA(t,e)},pieces:function(e){var t=this.option;L(t.pieces,function(t,n){H(t)||(t={value:t});var r={text:``,index:n};if(t.label!=null&&(r.text=t.label),t.hasOwnProperty(`value`)){var i=r.value=t.value;r.interval=[i,i],r.close=[1,1]}else{for(var a=r.interval=[],o=r.close=[0,0],s=[1,0,1],c=[-1/0,1/0],l=[],u=0;u<2;u++){for(var d=[[`gte`,`gt`,`min`],[`lte`,`lt`,`max`]][u],f=0;f<3&&a[u]==null;f++)a[u]=t[d[f]],o[u]=s[f],l[u]=f===2;a[u]??(a[u]=c[u])}l[0]&&a[1]===1/0&&(o[0]=0),l[1]&&a[0]===-1/0&&(o[1]=0),a[0]===a[1]&&o[0]&&o[1]&&(r.value=a[0])}r.visual=qY.retrieveVisuals(t),e.push(r)},this),jA(t,e),Zl(e),L(e,function(e){var t=e.close,n=[[`<`,`≤`][t[1]],[`>`,`≥`][t[0]]];e.text=e.text||this.formatValueText(e.value==null?e.interval:e.value,!1,n)},this)}},DQ=function(e){F(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get(`textGap`),r=t.textStyleModel,i=this._getItemAlign(),a=t.itemSize,o=this._getViewData(),s=o.endsText,c=Za(t.get(`showLabel`,!0),!s),l=!t.get(`selectedMode`);s&&this._renderEndsText(e,s[0],a,c,i),L(o.viewPieceList,function(o){var s=o.piece,u=new Sz;u.onclick=q(this._onItemClick,this,s),this._enableHoverLink(u,o.indexInModelPieceList);var d=t.getRepresentValue(s);if(this._createItemSymbol(u,d,[0,0,a[0],a[1]],l),c){var f=this.visualMapModel.getValueState(d),p=r.get(`align`)||i;u.add(new cR({style:op(r,{x:p===`right`?-n:a[0]+n,y:a[1]/2,text:s.text,verticalAlign:r.get(`verticalAlign`)||`middle`,align:p,opacity:U(r.get(`opacity`),f===`outOfRange`?.5:1)}),silent:l}))}e.add(u)},this),s&&this._renderEndsText(e,s[1],a,c,i),SH(t.get(`orient`),e,t.get(`itemGap`)),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on(`mouseover`,function(){return r(`highlight`)}).on(`mouseout`,function(){return r(`downplay`)});var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:EA(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if(t.orient===`vertical`)return TA(e,this.api,e.itemSize);var n=t.align;return n&&n!==`auto`||(n=`left`),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var a=new Sz,o=this.visualMapModel.textStyleModel;a.add(new cR({style:op(o,{x:r?i===`right`?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:`middle`,align:r?i:`center`,text:t})})),e.add(a)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=R(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),n=e.get(`text`),r=e.get(`orient`),i=e.get(`inverse`);return(r===`horizontal`?i:!i)?t.reverse():n&&=n.slice().reverse(),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n,r){var i=xg(this.getControllerVisual(t,`symbol`),n[0],n[1],n[2],n[3],this.getControllerVisual(t,`color`));i.silent=r,e.add(i)},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,r=n.selectedMode;if(r){var i=ka(n.selected),a=t.getSelectedMapKey(e);r===`single`||r===!0?(i[a]=!0,L(i,function(e,t){i[t]=t===a})):i[a]=!i[a],this.api.dispatchAction({type:`selectDataRange`,from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type=`visualMap.piecewise`,t}(vQ),OQ=[`align`,`verticalAlign`,`width`,`height`,`fontSize`],kQ=new lI,AQ=Du(),jQ=Du(),MQ=[`x`,`y`,`rotation`],NQ=function(){function e(){this._labelList=[],this._chartViewList=[]}return e.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},e.prototype._addLabel=function(e,t,n,r,i){var a=r.style,o=r.__hostTarget.textConfig||{},s=r.getComputedTransform(),c=r.getBoundingRect().plain();J.applyTransform(c,c,s),s?kQ.setLocalTransform(s):(kQ.x=kQ.y=kQ.rotation=kQ.originX=kQ.originY=0,kQ.scaleX=kQ.scaleY=1),kQ.rotation=ol(kQ.rotation);var l=r.__hostTarget,u;if(l){u=l.getBoundingRect().plain();var d=l.getComputedTransform();J.applyTransform(u,u,d)}var f=u&&l.getTextGuideLine();this._labelList.push({label:r,labelLine:f,seriesModel:n,dataIndex:e,dataType:t,layoutOptionOrCb:i,layoutOption:null,rect:c,hostRect:u,priority:u?u.width*u.height:0,defaultAttr:{ignore:r.ignore,labelGuideIgnore:f&&f.ignore,x:kQ.x,y:kQ.y,scaleX:kQ.scaleX,scaleY:kQ.scaleY,rotation:kQ.rotation,style:{x:a.x,y:a.y,align:a.align,verticalAlign:a.verticalAlign,width:a.width,height:a.height,fontSize:a.fontSize},cursor:r.cursor,attachedPos:o.position,attachedRot:o.rotation}})},e.prototype.addLabelsOfSeries=function(e){var t=this;this._chartViewList.push(e);var n=e.__model,r=n.get(`labelLayout`);(B(r)||Ba(r).length)&&e.group.traverse(function(e){if(e.ignore)return!0;var i=e.getTextContent(),a=LR(e);i&&!i.disableLabelLayout&&t._addLabel(a.dataIndex,a.dataType,n,i,r)})},e.prototype.updateLayoutConfig=function(e){var t=e.getWidth(),n=e.getHeight();function r(e,t){return function(){Jb(e,t)}}for(var i=0;i<this._labelList.length;i++){var a=this._labelList[i],o=a.label,s=o.__hostTarget,c=a.defaultAttr,l=void 0;l=B(a.layoutOptionOrCb)?a.layoutOptionOrCb(PA(a,s)):a.layoutOptionOrCb,l||={},a.layoutOption=l;var u=Math.PI/180;s&&s.setTextConfig({local:!1,position:l.x!=null||l.y!=null?null:c.attachedPos,rotation:l.rotate==null?c.attachedRot:l.rotate*u,offset:[l.dx||0,l.dy||0]});var d=!1;if(l.x==null?(o.x=c.x,o.setStyle(`x`,c.style.x)):(o.x=Y(l.x,t),o.setStyle(`x`,0),d=!0),l.y==null?(o.y=c.y,o.setStyle(`y`,c.style.y)):(o.y=Y(l.y,n),o.setStyle(`y`,0),d=!0),l.labelLinePoints){var f=s.getTextGuideLine();f&&(f.setShape({points:l.labelLinePoints}),d=!1)}var p=AQ(o);p.needsUpdateLabelLine=d,o.rotation=l.rotate==null?c.rotation:l.rotate*u,o.scaleX=c.scaleX,o.scaleY=c.scaleY;for(var m=0;m<OQ.length;m++){var h=OQ[m];o.setStyle(h,l[h]==null?c.style[h]:l[h])}if(l.draggable){if(o.draggable=!0,o.cursor=`move`,s){var g=a.seriesModel;a.dataIndex!=null&&(g=a.seriesModel.getData(a.dataType).getItemModel(a.dataIndex)),o.on(`drag`,r(s,g.getModel(`labelLine`)))}}else o.off(`drag`),o.cursor=c.cursor}},e.prototype.layout=function(e){var t=e.getWidth(),n=e.getHeight(),r=[];L(this._labelList,function(e){e.defaultAttr.ignore||r.push(oy({},e))});var i=Ra(r,function(e){return e.layoutOption.moveOverlap===`shiftX`}),a=Ra(r,function(e){return e.layoutOption.moveOverlap===`shiftY`});cy(i,0,0,t),cy(a,1,0,n);var o=Ra(r,function(e){return e.layoutOption.hideOverlap});fee(o),ly(o)},e.prototype.processLabelsOverall=function(){var e=this;L(this._chartViewList,function(t){var n=t.__model,r=t.ignoreLabelLineUpdate,i=n.isAnimationEnabled();t.group.traverse(function(t){if(t.ignore&&!t.forceLabelAnimation)return!0;var a=!r,o=t.getTextContent();!a&&o&&(a=AQ(o).needsUpdateLabelLine),a&&e._updateLabelLine(t,n),i&&e._animateLabels(t,n)})})},e.prototype._updateLabelLine=function(e,t){var n=e.getTextContent(),r=LR(e),i=r.dataIndex;if(n&&i!=null){var a=t.getData(r.dataType),o=a.getItemModel(i),s={},c=a.getItemVisual(i,`style`);c&&(s.stroke=c[a.getVisual(`drawType`)]);var l=o.getModel(`labelLine`);$b(e,ex(o),s),Jb(e,l)}},e.prototype._animateLabels=function(e,t){var n=e.getTextContent(),r=e.getTextGuideLine();if(n&&(e.forceLabelAnimation||!n.ignore&&!n.invisible&&!e.disableLabelAnimation&&!pf(e))){var i=AQ(n),a=i.oldLayout,o=LR(e),s=o.dataIndex,c={x:n.x,y:n.y,rotation:n.rotation},l=t.getData(o.dataType);if(a){n.attr(a);var u=e.prevStates;u&&(Na(u,`select`)>=0&&n.attr(i.oldLayoutSelect),Na(u,`emphasis`)>=0&&n.attr(i.oldLayoutEmphasis)),df(n,c,t,s)}else if(n.attr(c),!AB(n).valueAnimation){var d=U(n.style.opacity,1);n.style.opacity=0,ff(n,{style:{opacity:d}},t,s)}if(i.oldLayout=c,n.states.select){var f=i.oldLayoutSelect={};FA(f,c,MQ),FA(f,n.states.select,MQ)}if(n.states.emphasis){var p=i.oldLayoutEmphasis={};FA(p,c,MQ),FA(p,n.states.emphasis,MQ)}pp(n,s,l,t,t)}if(r&&!r.ignore&&!r.invisible){var i=jQ(r),a=i.oldLayout,m={points:r.shape.points};a?(r.attr({shape:a}),df(r,{shape:m},t)):(r.setShape(m),r.style.strokePercent=0,ff(r,{style:{strokePercent:1}},t)),i.oldLayout=m}},e}(),PQ=Du(),FQ=function(){function e(t,n){n_(this,e.decoratedMethods),this._outOfBrk=c_(null,n);var r=this._linear=c_(null,n);r_(this,r),this.breaks=t&&t.breaks||[]}return e.prototype.hasBreaks=function(){return!!this.breaks.length},e.prototype.calcNiceTickMultiple=function(e,t){for(var n=0;n<this.breaks.length;n++){var r=this.breaks[n];if(r.vmin<e&&e<r.vmax)return t(e,r.vmax)}return 0},e.decoratedMethods={needTransform:function(){return!this.breaks.length},getExtent:function(){return this._outOfBrk.getExtent()},getExtentUnsafe:function(e,t){return t==null||t===2?this._outOfBrk.getExtentUnsafe(e,null):this._linear.getExtentUnsafe(e,null)},setExtent:function(e,t){this.setExtent2(0,e,t)},setExtent2:function(e,t,n){Uu(t,n)&&(e===0&&RA(this,[t,n]),this._outOfBrk.setExtent2(e,t,n),this._linear.setExtent2(e,this.transformIn(t,null),this.transformIn(n,null)))},normalize:function(e){return this._linear.normalize(this.transformIn(e,null))},scale:function(e){return this.transformOut(this._linear.scale(e),null)},contain:function(e){return this._outOfBrk.contain(e)},transformIn:function(e,t){if(t&&t.depth===2)return e;for(var n=IQ,r=LQ,i=!0,a=0;a<this.breaks.length;a++){var o=this.breaks[a];if(e<=o.vmax){e>o.vmin?n+=o.vmin-r+(e-o.vmin)/(o.vmax-o.vmin)*o.gapReal:n+=e-r,r=o.vmax,i=!1;break}n+=o.vmin-r+o.gapReal,r=o.vmax}return i&&(n+=e-r),n},transformOut:function(e,t){if(t&&t.depth===2)return e;for(var n=IQ,r=LQ,i=!0,a=0,o=0;o<this.breaks.length;o++){var s=this.breaks[o],c=n+s.vmin-r,l=c+s.gapReal;if(e<=l){a=e>c?s.vmin+(e-c)/(l-c)*(s.vmax-s.vmin):r+e-n,r=s.vmax,i=!1;break}n=l,r=s.vmax}return i&&(a=r+e-n),a}},e}(),IQ=0,LQ=0,RQ={vmin:`start`,vmax:`end`},zQ=Du(),BQ=Math.sin,VQ=Math.cos,HQ=Math.PI,UQ=Math.PI*2,WQ=180/HQ,GQ=function(){function e(){}return e.prototype.reset=function(e){this._start=!0,this._d=[],this._str=``,this._p=10**(e||4)},e.prototype.moveTo=function(e,t){this._add(`M`,e,t)},e.prototype.lineTo=function(e,t){this._add(`L`,e,t)},e.prototype.bezierCurveTo=function(e,t,n,r,i,a){this._add(`C`,e,t,n,r,i,a)},e.prototype.quadraticCurveTo=function(e,t,n,r){this._add(`Q`,e,t,n,r)},e.prototype.arc=function(e,t,n,r,i,a){this.ellipse(e,t,n,n,0,r,i,a)},e.prototype.ellipse=function(e,t,n,r,i,a,o,s){var c=o-a,l=!s,u=Math.abs(c),d=fc(u-UQ)||(l?c>=UQ:-c>=UQ),f=c>0?c%UQ:c%UQ+UQ,p=!1;p=d?!0:!fc(u)&&f>=HQ==!!l;var m=e+n*VQ(a),h=t+r*BQ(a);this._start&&this._add(`M`,m,h);var g=Math.round(i*WQ);if(d){var _=1/this._p,v=(l?1:-1)*(UQ-_);this._add(`A`,n,r,g,1,+l,e+n*VQ(a+v),t+r*BQ(a+v)),_>.01&&this._add(`A`,n,r,g,0,+l,m,h)}else{var y=e+n*VQ(o),b=t+r*BQ(o);this._add(`A`,n,r,g,+p,+l,y,b)}},e.prototype.rect=function(e,t,n,r){this._add(`M`,e,t),this._add(`l`,n,0),this._add(`l`,0,r),this._add(`l`,-n,0),this._add(`Z`)},e.prototype.closePath=function(){this._d.length>0&&this._add(`Z`)},e.prototype._add=function(e,t,n,r,i,a,o,s,c){for(var l=[],u=this._p,d=1;d<arguments.length;d++){var f=arguments[d];if(isNaN(f)){this._invalid=!0;return}l.push(Math.round(f*u)/u)}this._d.push(e+l.join(` `)),this._start=e===`Z`},e.prototype.generateStr=function(){this._str=this._invalid?``:this._d.join(``),this._d=[]},e.prototype.getStr=function(){return this._str},e}(),KQ=`none`,qQ=Math.round,JQ=[`lineCap`,`miterLimit`,`lineJoin`],YQ=R(JQ,function(e){return`stroke-`+e.toLowerCase()}),XQ=`http://www.w3.org/2000/svg`,ZQ=`http://www.w3.org/1999/xlink`,QQ=`http://www.w3.org/2000/xmlns/`,$Q=`http://www.w3.org/XML/1998/namespace`,e$=`ecmeta_`,t$=0,n$={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`},r$=`transform-origin`,i$={fill:`fill`,opacity:`opacity`,lineWidth:`stroke-width`,lineDashOffset:`stroke-dashoffset`},a$=Math.round,o$={circle:[Pj([`cx`,`cy`,`r`])],polyline:[Mj,Nj],polygon:[Mj,Nj]},s$=58,c$=120,l$=lj(``,``),u$=0,d$=function(){function e(e,t,n){if(this.type=`svg`,this.configLayer=gee(`configLayer`),this.storage=t,this._opts=n=I({},n),this.root=e,this._id=`zr`+u$++,this._oldVNode=hj(n.width,n.height),e&&!n.ssr){var r=this._viewport=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden`;var i=this._svgDom=this._oldVNode.elm=cj(`svg`);rM(null,this._oldVNode),r.appendChild(i),e.appendChild(r)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style=`position:absolute;left:0;top:0;user-select:none`,hee(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return zj(e,mj(this._id))},e.prototype.renderToVNode=function(e){e||={};var t=this.storage.getDisplayList(!0),n=this._width,r=this._height,i=mj(this._id);i.animation=e.animation,i.willUpdate=e.willUpdate,i.compress=e.compress,i.emphasis=e.emphasis,i.ssr=this._opts.ssr;var a=[],o=this._bgVNode=_ee(n,r,this._backgroundColor,i);o&&a.push(o);var s=e.compress?null:this._mainVNode=lj(`g`,`main`,{},[]);this._paintList(t,i,s?s.children:a),s&&a.push(s);var c=R(Ba(i.defs),function(e){return i.defs[e]});if(c.length&&a.push(lj(`defs`,`defs`,{},c)),e.animation){var l=pj(i.cssNodes,i.cssAnims,{newline:!0});if(l){var u=lj(`style`,`stl`,{},[],l);a.push(u)}}return hj(n,r,a,e.useViewBox)},e.prototype.renderToString=function(e){return e||={},fj(this.renderToVNode({animation:U(e.cssAnimation,!0),emphasis:U(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:U(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var r=e.length,i=[],a=0,o,s,c=0,l=0;l<r;l++){var u=e[l];if(!u.invisible){var d=u.__clipPaths,f=d&&d.length||0,p=s&&s.length||0,m=void 0;for(m=Math.max(f-1,p-1);m>=0&&!(d&&s&&d[m]===s[m]);m--);for(var h=p-1;h>m;h--)a--,o=i[a-1];for(var g=m+1;g<f;g++){var _={};Uj(d[g],_,t);var v=lj(`g`,`clip-g-`+c++,_,[]);(o?o.children:n).push(v),i[a++]=v,o=v}s=d;var y=zj(u,t);y&&(o?o.children:n).push(y)}}},e.prototype.resize=function(e,t){var n=this._opts,r=this.root,i=this._viewport;if(e!=null&&(n.width=e),t!=null&&(n.height=t),r&&i&&(i.style.display=`none`,e=eC(r,0,n),t=eC(r,1,n),i.style.display=``),this._width!==e||this._height!==t){if(this._width=e,this._height=t,i){var a=i.style;a.width=e+`px`,a.height=t+`px`}if(xc(this._backgroundColor))this.refresh();else{var o=this._svgDom;o&&(o.setAttribute(`width`,e),o.setAttribute(`height`,t));var s=this._bgVNode&&this._bgVNode.elm;s&&(s.setAttribute(`width`,e),s.setAttribute(`height`,t))}}},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype.dispose=function(){this.root&&(this.root.innerHTML=``),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},e.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},e.prototype.toDataURL=function(e){var t=this.renderToString(),n=`data:image/svg+xml;`;return e?(t=jI(t),t&&n+`base64,`+t):n+`charset=UTF-8,`+encodeURIComponent(t)},e}(),f$=function(e){F(t,e);function t(t,n,r){var i=e.call(this)||this;i.motionBlur=!1,i.lastFrameAlpha=.7,i.dpr=1,i.virtual=!1,i.config={},i.zlevel=0,i.zlevel2=0,i.maxRepaintRectCount=5,i.__dirty=!0,i.__firstTimePaint=!0,i.__prevIdx={startIdx:0,endIdx:0};var a;r||=GI,typeof t==`string`?a=aM(t,n,r):H(t)&&(a=t,t=a.id),i.id=t,i.dom=a;var o=a.style;return o&&(oo(a),a.onselectstart=function(){return!1},o.padding=`0`,o.margin=`0`,o.borderWidth=`0`),i.painter=n,i.dpr=r,i}return t.prototype.afterBrush=function(){this.__prevIdx=sM(this)},t.prototype.initContext=function(){this.ctx=this.dom.getContext(`2d`),this.ctx.dpr=this.dpr},t.prototype.setUnpainted=function(){this.__firstTimePaint=!0},t.prototype.createBackBuffer=function(){var e=this.dpr;this.domBack=aM(`back-`+this.id,this.painter,e),this.ctxBack=this.domBack.getContext(`2d`),e!==1&&this.ctxBack.scale(e,e)},t.prototype.createRepaintRects=function(e,t,n,r){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var i=[],a=this.maxRepaintRectCount,o=!1,s=new J(0,0,0,0);function c(e){if(e.isFinite()&&!e.isZero()){if(i.length===0){var t=new J(0,0,0,0);t.copy(e),i.push(t)}else{for(var n=!1,r=1/0,c=0,l=0;l<i.length;++l){var u=i[l];if(u.intersect(e)){var d=new J(0,0,0,0);d.copy(u),d.union(e),i[l]=d,n=!0;break}if(o){s.copy(e),s.union(u);var f=e.width*e.height,p=u.width*u.height,m=s.width*s.height-f-p;m<r&&(r=m,c=l)}}if(o&&(i[c].union(e),n=!0),!n){var t=new J(0,0,0,0);t.copy(e),i.push(t)}o||=i.length>=a}}}for(var l=sM(this),u=l.startIdx;u<l.endIdx;++u){var d=e[u];if(d){var f=d.shouldBePainted(n,r,!0,!0),p=d.__isRendered&&(d.__dirty&1||!f)?d.getPrevPaintRect():null;p&&c(p);var m=f&&(d.__dirty&1||!d.__isRendered)?d.getPaintRect():null;m&&c(m)}}for(var h=this.__prevIdx,u=h.startIdx;u<h.endIdx;++u){var d=t[u],f=d&&d.shouldBePainted(n,r,!0,!0);if(d&&(!f||!d.__zr)&&d.__isRendered){var p=d.getPrevPaintRect();p&&c(p)}}var g;do{g=!1;for(var u=0;u<i.length;)if(i[u].isZero())i.splice(u,1);else{for(var _=u+1;_<i.length;)i[u].intersect(i[_])?(g=!0,i[u].union(i[_]),i.splice(_,1)):_++;u++}}while(g);return this._paintRects=i,i},t.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},t.prototype.resize=function(e,t){var n=this.dpr,r=this.dom,i=r.style,a=this.domBack;i&&(i.width=e+`px`,i.height=t+`px`),r.width=e*n,r.height=t*n,a&&(a.width=e*n,a.height=t*n,n!==1&&this.ctxBack.scale(n,n))},t.prototype.clear=function(e,t,n){var r=this.dom,i=this.ctx,a=r.width,o=r.height;t||=this.clearColor;var s=this.motionBlur&&!e,c=this.lastFrameAlpha,l=this.dpr,u=this;s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation=`copy`,this.ctxBack.drawImage(r,0,0,a/l,o/l));var d=this.domBack;function f(e,n,r,a){if(i.clearRect(e,n,r,a),t&&t!==`transparent`){var o=void 0;Ja(t)?(o=(t.global||t.__width===r&&t.__height===a)&&t.__canvasGradient||ZS(i,t,{x:0,y:0,width:r,height:a}),t.__canvasGradient=o,t.__width=r,t.__height=a):Ya(t)&&(t.scaleX=t.scaleX||l,t.scaleY=t.scaleY||l,o=cC(i,t,{dirty:function(){u.setUnpainted(),u.painter.refresh()}})),i.save(),i.fillStyle=o||t,i.fillRect(e,n,r,a),i.restore()}s&&(i.save(),i.globalAlpha=c,i.drawImage(d,e,n,r,a),i.restore())}!n||s?f(0,0,a,o):n.length&&L(n,function(e){f(e.x*l,e.y*l,e.width*l,e.height*l)})},t}(UI),p$=1e5,m$=314159,h$=void 0,g$=1,_$=2,v$=1,y$=2,b$=4,x$=v$|b$,S$=function(){function e(e,t,n,r){this.type=`canvas`,this._prevDisplayList=[],this._layerConfig={},this._needsManuallyCompositing=!1,this.type=`canvas`,this._i={layerStack:[],layers:[]};var i=!e.nodeName||e.nodeName.toUpperCase()===`CANVAS`;if(this._opts=n=I({},n||{}),this.dpr=n.devicePixelRatio||GI,this._singleCanvas=i,this.root=e,e.style&&(oo(e),e.innerHTML=``),this.storage=t,this._prevDisplayList=[],i){var a=e,o=a.width,s=a.height;n.width!=null&&(o=n.width),n.height!=null&&(s=n.height),this.dpr=n.devicePixelRatio||1,a.width=o*this.dpr,a.height=s*this.dpr,this._width=o,this._height=s;var c=uM(a,this,m$,0);c.initContext(),this._insertLayer(c,m$,0,!0),this._domRoot=e}else{this._width=eC(e,0,n),this._height=eC(e,1,n);var l=this._domRoot=lM(this._width,this._height);e.appendChild(l)}}return e.prototype.getType=function(){return`canvas`},e.prototype.isSingleCanvas=function(){return this._singleCanvas},e.prototype.getViewportRoot=function(){return this._domRoot},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.refresh=function(e){var t=e&&!H(e)?{paintAll:!!e}:e||{},n=U(t.refresh,!0),r=U(t.refreshHover,!1);if(r&&(this._hoverLayerDirty=_$),!n)return r&&this._paintHoverList(this.storage.getDisplayList(!1)),this;var i=this.storage.getDisplayList(!0);this._updateLayerStatus(i,t.paintAll),this._redrawId=Math.random();var a=this._prevDisplayList;this._paintList(i,a,this._redrawId);var o=this._backgroundColor;return gM(this._i,function(e,t,n,r){e.refresh&&e.refresh(r===0?o:null)},y$),this._opts.useDirtyRect&&(this._prevDisplayList=i.slice()),this},e.prototype._paintHoverList=function(e){var t=this._i.hoverlayer,n=this._hoverLayerDirty;if(this._hoverLayerDirty=h$,n!==h$&&(!t&&n===_$&&(t=this._i.hoverlayer=this._ensureLayer(p$)),t)){t.clear();for(var r={inHover:!0,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},i,a=0,o=e.length;a<o;a++){var s=e[a];if(s.__inHover){i||(i=t.ctx,i.save());var c=s.__hoverStyle,l=void 0;c&&(l=s.style,s.style=c),xC(i,s,r),c&&(s.style=l)}}i&&(SC(i,r),i.restore())}},e.prototype.getHoverLayer=function(){return this._ensureLayer(p$)},e.prototype.paintOne=function(e,t){bC(e,t)},e.prototype._paintList=function(e,t,n){if(this._redrawId===n){var r=this._doPaintList(e,t);if(this._needsManuallyCompositing&&this._compositeManually(),r)gM(this._i,function(e){e.afterBrush&&e.afterBrush()},x$),this._paintHoverList(e);else{var i=this;RG(function(){i._paintList(e,t,n)})}}},e.prototype._compositeManually=function(){var e=this._ensureLayer(m$).ctx,t=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,t,n),gM(this._i,function(r){r.virtual&&e.drawImage(r.dom,0,0,t,n)},v$)},e.prototype._doPaintList=function(e,t){var n=this,r=!0;return gM(this._i,function(i){var a=!1;if(mM(i,function(e){(e.drawIdx<e.endIdx||e.notClearIdx>=0)&&(a=!0)}),a||i.__dirty){var o=n._opts.useDirtyRect&&!oM(i)?i.createRepaintRects(e,t,n._width,n._height):null,s=n._i.layerStack[0],c=!0;if(i.__dirty){c=!1,i.__dirty=!1;var l=i.zlevel===s.zl&&i.zlevel2===s.zl2?n._backgroundColor:null;i.clear(!1,l,o)}mM(i,function(t){var a=n._paintPerCursor(i,t,e,o,c);r&&=a})}},x$),dF.wxa&&gM(this._i,function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()}),r},e.prototype._paintPerCursor=function(e,t,n,r,i){var a=e.ctx;if(r){if(!r.length)t.drawIdx=t.endIdx;else for(var o=this.dpr,s=0;s<r.length;++s){var c=r[s];a.save(),a.beginPath(),a.rect(c.x*o,c.y*o,c.width*o,c.height*o),a.clip(),this._paintPerCursorInRect(e,t,n,c,i),a.restore()}}else a.save(),this._paintPerCursorInRect(e,t,n,null,i),a.restore();return t.drawIdx>=t.endIdx},e.prototype._paintPerCursorInRect=function(e,t,n,r,i){for(var a={inHover:!1,allClipped:!1,prevEl:null,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{contentRetained:i}},o=e.ctx,s=oM(e),c=s&&GP.getTime(),l=t.drawIdx,u=t.notClearIdx,d=u>=0?Math.min(u,l):l;d<t.endIdx;d++){var f=n[d];if(!(d<l&&!f.notClear)){if(f.__inHover&&(this._hoverLayerDirty=_$),r!=null){var p=f.getPaintRect();p&&p.intersect(r)&&(xC(o,f,a),f.setPrevPaintRect(p))}else xC(o,f,a);if(s&&GP.getTime()-c>15){d++;break}}}SC(o,a),t.drawIdx=Math.max(d,l)},e.prototype.getLayer=function(e,t){return this._ensureLayer(e,0,t)},e.prototype._ensureLayer=function(e,t,n){t||=0;var r=this._singleCanvas;r&&!this._needsManuallyCompositing&&(e=m$,t=0);var i=hM(this._i,e)[t];return i||(i=uM(`zr_`+e+`.`+t,this,e,t),this._layerConfig[e]&&Aa(i,this._layerConfig[e],!0),(n||r&&e!==m$)&&(i.virtual=!0),this._insertLayer(i,e,t,!1),i.initContext()),i},e.prototype.insertLayer=function(e,t){this._insertLayer(t,e,0,!1)},e.prototype._insertLayer=function(e,t,n,r){var i=this._i,a=i.layers,o=i.layerStack,s=this._domRoot,c=null;if(!(a[t]&&a[t][n])&&cM(e)){for(var l=o.length,u=0;u<l&&(o[u].zl<t||o[u].zl===t&&o[u].zl2<n);)u++;if(u>0&&(c=hM(i,o[u-1].zl)[o[u-1].zl2]),o.splice(u,0,{zl:t,zl2:n}),hM(i,t)[n]=e,!r&&!e.virtual){if(c){var d=c.dom;d.nextSibling?s.insertBefore(e.dom,d.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)}e.painter||=this}},e.prototype.eachLayer=function(e,t){return gM(this._i,function(n,r){e.call(t,n,r)})},e.prototype.eachBuiltinLayer=function(e,t){return gM(this._i,function(n,r){e.call(t,n,r)},v$)},e.prototype.eachOtherLayer=function(e,t){return gM(this._i,function(n,r){e.call(t,n,r)},y$)},e.prototype.getLayers=function(){var e={};return gM(this._i,function(t,n,r){e[t.id]=t}),e},e.prototype._updateLayerStatus=function(e,t){var n=this;if(n._singleCanvas)for(var r=1;r<e.length;r++){var i=e[r];if(i.zlevel!==e[r-1].zlevel||i.incremental){n._needsManuallyCompositing=!0;break}}gM(n._i,function(e){e.__dirty=!1,mM(e,function(e){e.used=!1,e.endIdxNew=0,e.notClearIdx=-1})},x$);for(var a,o=null,s=null,c=!1,l=0,u=e.length;l<u;l++){var i=e[l],d=i.zlevel,f=i.incremental,p=void 0;if(a!==d&&(a=d,c=!1),f?(c=!0,p=1):p=c?2:0,(!o||d!==o.zlevel||p!==o.zlevel2)&&(o=n._ensureLayer(d,p),s=null,!o.__builtin__))Oa(`ZLevel `+d+` has been used by unknown layer `+o.id);else{if((!s||f!==s.key)&&(s=pM(o,f),!s.used)){if(s.used=!0,!t&&s.first===i.id){var m=l-s.startIdx;s.startIdx=l,s.drawIdx+=m,s.endIdx+=m}else o.__dirty=!0,s.first=i.id,s.startIdx=s.drawIdx=l,s.endIdx=l+1}s.endIdxNew=l+1,i.__dirty&1&&!i.__inHover&&((!f||!i.notClear&&l<s.drawIdx)&&(o.__dirty=!0),f&&i.notClear&&s.notClearIdx<0&&(s.notClearIdx=l))}}gM(n._i,function(t){for(var r=t.__cursorStack,i=t.__cursors,a=r.length-1;a>=0;a--){var o=i.get(r[a]);if(!o.used)t.__dirty=!0,i.removeKey(r[a]),r.splice(a,1);else{var s=o.endIdxNew;(oM(t)?s<o.drawIdx:s!==o.endIdx||!s||e[s-1].id!==o.last)&&(t.__dirty=!0),o.endIdx=o.endIdxNew,o.last=s?e[s-1].id:NaN}}t.__dirty&&(mM(t,function(e){e.drawIdx=e.startIdx}),n._hoverLayerDirty===h$&&(n._hoverLayerDirty=g$))},x$)},e.prototype.clear=function(){return gM(this._i,function(e){e.clear(),dM(e)},v$),this},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,gM(this._i,function(e){e.setUnpainted()})},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?Aa(n[e],t,!0):n[e]=t,gM(this._i,function(e,t){Aa(e,n[t],!0)})}},e.prototype.delLayer=function(e){for(var t=this._i.layerStack,n=this._i.layers,r=t.length-1;r>=0;r--){var i=t[r];if(i.zl===e){var a=n[e][i.zl2];if(a.__builtin__)continue;if(t.splice(r,1),n[e][i.zl2]=void 0,!a.virtual){var o=a.dom.parentNode;o&&o.removeChild(a.dom)}}}},e.prototype.resize=function(e,t){if(this._domRoot.style){var n=this._domRoot;n.style.display=`none`;var r=this._opts,i=this.root;e!=null&&(r.width=e),t!=null&&(r.height=t),e=eC(i,0,r),t=eC(i,1,r),n.style.display=``,(this._width!==e||t!==this._height)&&(n.style.width=e+`px`,n.style.height=t+`px`,gM(this._i,function(n){n.resize(e,t)}),this.refresh({paintAll:!0})),this._width=e,this._height=t}else{if(e==null||t==null)return;this._width=e,this._height=t,this._ensureLayer(m$).resize(e,t)}return this},e.prototype.clearLayer=function(e){L(this._i.layers[e],function(e){e&&!e.__builtin__&&e.clear()})},e.prototype.dispose=function(){this.root.innerHTML=``,this.root=this.storage=this._domRoot=this._i=null},e.prototype.getRenderedCanvas=function(e){if(e||={},this._singleCanvas&&!this._compositeManually)return this._i.layers[m$][0].dom;var t=new f$(`image`,this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var n=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var r=t.dom.width,i=t.dom.height;gM(this._i,function(e){e.__builtin__?n.drawImage(e.dom,0,0,r,i):e.renderToCanvas&&(n.save(),e.renderToCanvas(n),n.restore())})}else{for(var a={inHover:!1,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},o=this.storage.getDisplayList(!0),s=0,c=o.length;s<c;s++){var l=o[s];xC(n,l,a)}SC(n,a)}return t.dom},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e}(),C$=Object.freeze({INR:`₹`,USD:`$`,EUR:`€`,GBP:`£`,JPY:`¥`}),w$=e=>typeof e==`string`&&/^[A-Z]{3}$/.test(e),T$=(e=`INR`)=>C$[e]??`${e} `,E$=`en-IN`,D$=/\{([A-Za-z0-9_]+)\}/g,O$=new Map,k$=0,A$=new Map,j$={aprShortLabel:`Apr`,aprilLabel:`April`,augShortLabel:`Aug`,augustLabel:`August`,decShortLabel:`Dec`,decemberLabel:`December`,emptyValueLabel:`-`,febShortLabel:`Feb`,februaryLabel:`February`,friMinLabel:`Fr`,friShortLabel:`Fri`,fridayLabel:`Friday`,janShortLabel:`Jan`,januaryLabel:`January`,julShortLabel:`Jul`,julyLabel:`July`,junShortLabel:`Jun`,juneLabel:`June`,marShortLabel:`Mar`,marchLabel:`March`,mayLabel:`May`,mayShortLabel:`May`,monMinLabel:`Mo`,monShortLabel:`Mon`,mondayLabel:`Monday`,novShortLabel:`Nov`,novemberLabel:`November`,octShortLabel:`Oct`,octoberLabel:`October`,satMinLabel:`Sa`,satShortLabel:`Sat`,saturdayLabel:`Saturday`,sepShortLabel:`Sep`,septemberLabel:`September`,sunMinLabel:`Su`,sunShortLabel:`Sun`,sundayLabel:`Sunday`,thuMinLabel:`Th`,thuShortLabel:`Thu`,thursdayLabel:`Thursday`,tueMinLabel:`Tu`,tueShortLabel:`Tue`,tuesdayLabel:`Tuesday`,wedMinLabel:`We`,wedShortLabel:`Wed`,wednesdayLabel:`Wednesday`},M$=`Asia/Kolkata`,N$=198e5,P$=new Map,F$=[`number`,`currency`,`percent`,`compact`,`duration`,`date`],I$=[`rupees`,`paise`],L$=[`ms`,`s`,`min`,`h`],R$=[`day`,`month`,`year`,`datetime`,`time`],z$=()=>xM(`formatters`,j$),B$=()=>z$().emptyValueLabel,V$=`−`,H$=[`janShortLabel`,`febShortLabel`,`marShortLabel`,`aprShortLabel`,`mayShortLabel`,`junShortLabel`,`julShortLabel`,`augShortLabel`,`sepShortLabel`,`octShortLabel`,`novShortLabel`,`decShortLabel`],U$={short:[`sunShortLabel`,`monShortLabel`,`tueShortLabel`,`wedShortLabel`,`thuShortLabel`,`friShortLabel`,`satShortLabel`],long:[`sundayLabel`,`mondayLabel`,`tuesdayLabel`,`wednesdayLabel`,`thursdayLabel`,`fridayLabel`,`saturdayLabel`],min:[`sunMinLabel`,`monMinLabel`,`tueMinLabel`,`wedMinLabel`,`thuMinLabel`,`friMinLabel`,`satMinLabel`]},W$=(e,t)=>z$()[bM(e[t],`no date name at index ${t}`)],G$=e=>W$(H$,e),K$=(e,t)=>bM(e[t],`no compact unit at index ${t}`),q$=[[1e7,`Cr`],[1e5,`L`],[1e3,`K`]],J$=[[1e9,`B`],[1e6,`M`],[1e3,`K`]],Y$=e=>!e||e===`INR`?`en-IN`:`en-US`,X$=(e,t)=>typeof e==`number`&&Number.isInteger(e)&&e>=0&&e<=20?e:t,Z$=new Map,Q$=(e,t=`en-IN`)=>{let n=`${t}:${e}`,r=Z$.get(n);return r||(r=new Intl.NumberFormat(t,{minimumFractionDigits:0,maximumFractionDigits:e}),Z$.set(n,r)),r},$$=new Map,e1=(e,t=`en-IN`)=>{let n=`${t}:${e}`,r=$$.get(n);return r||(r=new Intl.NumberFormat(t,{minimumFractionDigits:e,maximumFractionDigits:e}),$$.set(n,r)),r},t1=e=>typeof e==`number`&&Number.isFinite(e),n1=e=>e<0&&!Object.is(Math.abs(e),0)?V$:``,r1=(e,t)=>t===`paise`?Number(PM(e)):e,i1=2,a1=(e,t,n)=>{let r=Math.min(t,i1),i=10n**BigInt(i1-r),a=(BigInt(PM(e).replace(`.`,``))+i/2n)/i,o=10n**BigInt(r),s=e1(0,n).format(a/o);return t===0?s:`${s}.${(a%o).toString().padStart(r,`0`)}${`0`.repeat(t-r)}`},o1=e=>e>0&&e<.1?Math.min(20,1-Math.floor(Math.log10(e))):2,s1={ms:1,s:1e3,min:6e4,h:36e5},c1={aboveLabel:`Above`,areaChartLabel:`Area chart`,arrowKeysText:`{title}: use the arrow keys to read the values`,bandLabel:`Band`,barChartLabel:`Bar chart`,belowLabel:`Below`,bubbleChartLabel:`Bubble chart`,calendarHeatmapLabel:`Calendar heatmap`,calendarRangeText:`, from {first} to {last}`,calendarSummaryTextOne:`Calendar heatmap of {label}, {n} day.`,calendarSummaryTextOther:`Calendar heatmap of {label}, {n} days{range}.`,categoryLabel:`Category`,centerLabel:`Total`,changeLabel:`Change`,chartLabel:`chart`,columnChartLabel:`Column chart`,columnFallbackLabel:`column`,columnXLabel:`X`,constantSpanText:`{label} is {lo}.`,dataSuffixLabel:`data`,dateLabel:`Date`,donutChartLabel:`Donut chart`,donutLargestText:`{top} is the largest, at {share}.`,donutSummaryTextOne:`Donut chart of {label} in {rows} part, {total} in all.`,donutSummaryTextOther:`Donut chart of {label} in {rows} parts, {total} in all.`,emptyText:`No data to show for this chart.`,errorText:`This chart couldn't load. Try again in a moment.`,everySeriesHiddenText:`Every series is hidden.`,firstStageLabel:`first stage`,fromLabel:`From`,funnelChartLabel:`Funnel chart`,funnelPreviousStepText:`{share} of previous step`,funnelStartText:`{first} is {firstValue} and {last} is {lastValue}, {share} of the start.`,funnelSummaryText:`Funnel chart of {label} in {n} stages.`,gaugeBandText:`, in the {band} band`,gaugeLabel:`Gauge`,gaugeSummaryText:`{type}: {label} is {value} on a scale from {min} to {max}{band}.`,groupLabel:`Group`,groupsTextOne:` in {count} group: {groups}`,groupsTextOther:` in {count} groups: {groups}`,heatmapLabel:`Heatmap`,heatmapSummaryText:`Heatmap of {label} by {group} and {x}, {n} cells.`,highestAtLowestAtText:`Highest is {highValue} at {highGroup}, {high}; lowest is {lowValue} at {lowGroup}, {low}.`,highestLowestText:`Highest is {maxValue} on {max}; lowest is {minValue} on {min}.`,itemLabel:`Item`,largestFallText:`The largest fall is {xText}, {signed}.`,largestFlowText:`The largest flow is {xText} to {toText}, {fmtAt}.`,largestRiseText:`The largest rise is {xText}, {signed}.`,latestText:`Latest {latest}`,legendLabel:`Legend`,lessLabel:`Less`,lineChartLabel:`Line chart`,loadingText:`Loading chart`,measureLabel:`Measure`,moreLabel:`More`,ofFirstStepText:`Of {first}`,ofPreviousStepLabel:`Of previous step`,openingShareText:`{share} of opening`,opensAtClosesAtText:`It opens at {opening} and closes at {closing}.`,otherLabel:`Other`,pointsSummaryTextOne:`{n} point, {first}.`,pointsSummaryTextOther:`{n} points, from {first} to {last}.`,rangeSpanText:`{label} runs from {lo} to {hi}.`,rowFallbackLabel:`row`,rowLabel:`Row`,runningTotalLabel:`Running total`,sankeyLabel:`Sankey diagram`,sankeySummaryText:`Sankey diagram of {label}: {n} flows between {nodes} places.`,scaleLabel:`Scale`,scaleRangeText:`{min} to {max}`,scatterPlotLabel:`Scatter plot`,scatterSummaryText:`{type} of {label} against {xLabel}, {count} points{groups}.`,shareLabel:`Share`,shareOfAllLabel:`Share of all`,shareOfGroupLabel:`Share of group`,shareOfParentText:`Share of {parent}`,shareOfStepText:`{share} of {first}`,sharedAxisText:`, sharing one x axis`,showingFirstRowsDownloadText:`Showing the first {rows} of {total} rows. Download the CSV for all of them.`,smallMultiplesLabel:`Small multiples`,stackedPercentText:`, stacked to 100%`,stackedText:`, stacked`,stageLabel:`Stage`,stepLabel:`Step`,summaryText:`{type} of {series}{stacked}{sharedAxis}.`,targetGapText:`{direction} {label} by {gap}`,targetLabel:`target`,toLabel:`To`,tooManyGroupsText:`This chart has more groups than it can show clearly.`,tooManySeriesText:`This chart has more series than it can show clearly.`,totalText:`Total {total}`,treemapEmptyText:`Treemap of {label}: no items.`,treemapLabel:`Treemap`,treemapLargestGroupText:`{name} is the largest group, at {share}.`,treemapSummaryText:`Treemap of {label}: {n} items in {totals} groups, {total} in all.`,trendLabel:`Trend`,untitledLabel:`Chart`,waterfallLabel:`Waterfall chart`,waterfallSummaryText:`Waterfall chart of {label}.`},Q=()=>xM(`chart`,c1),l1=[`line`,`area`,`column`,`bar`,`donut`,`heatmap`,`calendar`,`funnel`,`gauge`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`,`multiples`],u1=[`none`,`stacked`,`percent`],d1=[`category`,`time`,`value`],f1=[`auto`,`svg`,`canvas`],p1=[`ready`,`loading`,`empty`,`error`],m1=[`chart`,`table`],h1={line:`lineChartLabel`,area:`areaChartLabel`,column:`columnChartLabel`,bar:`barChartLabel`,donut:`donutChartLabel`,heatmap:`heatmapLabel`,calendar:`calendarHeatmapLabel`,funnel:`funnelChartLabel`,gauge:`gaugeLabel`,waterfall:`waterfallLabel`,treemap:`treemapLabel`,sankey:`sankeyLabel`,scatter:`scatterPlotLabel`,bubble:`bubbleChartLabel`,multiples:`smallMultiplesLabel`},g1=e=>Q()[h1[e]],_1=[`donut`,`heatmap`,`calendar`,`funnel`,`gauge`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`],v1=e=>_1.includes(e),y1=[`area`,`column`,`bar`],b1=[`line`,`area`,`column`,`bar`,`multiples`],x1={line:[`category`,`time`],area:[`category`,`time`],column:[`category`,`time`],bar:[`category`,`time`],multiples:[`category`,`time`],calendar:[`time`],scatter:[`value`],bubble:[`value`]},S1={group:[`heatmap`,`treemap`,`scatter`,`bubble`],to:[`sankey`],size:[`bubble`],trend:[`scatter`,`bubble`],zoom:[`line`,`area`],bands:[`gauge`],centerLabel:[`donut`],valueLabels:[`column`,`bar`]},C1={gauge:240,calendar:200,treemap:340,sankey:340},w1=100,T1=72,E1=32,D1=[`type`,`title`,`description`,`data`,`x`,`series`,`group`,`to`,`size`,`trend`,`zoom`,`bands`,`stack`,`y`,`target`,`centerLabel`,`valueLabels`,`height`,`state`,`emptyText`,`errorText`,`loadingText`,`renderer`,`timeZone`],O1=[`key`,`kind`,`format`,`label`,`labelFit`],k1=[`auto`,`all`,`rotate`,`ellipsis`],A1=[`key`,`label`,`format`],j1=[`key`,`label`],M1=[`key`,`label`,`format`],N1=[`upTo`,`label`],P1=[`label`,`format`,`min`,`max`,`wholeNumbers`],F1=[`value`,`label`],I1=[`style`,`currency`,`unit`,`decimals`,`pattern`],L1=[...I$,...L$],R1=new Set,z1=e=>e.map(e=>`"${e}"`).join(` | `),B1=e=>typeof e==`number`&&Number.isFinite(e),V1=e=>typeof e==`object`&&!!e&&!Array.isArray(e),H1=(e,t)=>Reflect.get(e,t),U1=e=>e===null||typeof e==`string`||typeof e==`number`,W1=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,U1(t)?t:null])),G1=(e,t)=>e.some(e=>e===t),K1=e=>[...new Set(e)],q1=e=>e.reduce((e,t)=>Number.isNaN(t)?e:Math.min(e,t),1/0),J1=e=>e.reduce((e,t)=>Number.isNaN(t)?e:Math.max(e,t),-1/0),Y1=(e,t)=>e.data.map((n,r)=>K(e,t,r)).filter(e=>e!=null),X1=(e,t)=>t?G((e??0)/t,{style:`percent`}):B$(),Z1=(e,t)=>t==null?B$():KM(vN(e,t),`gauge band`).label,Q1=(e,t,n)=>{if(!t.length)return null;let r=q1(t),i=J1(t);return r===i?CM(Q().constantSpanText,{label:e,lo:G(r,n)}):CM(Q().rangeSpanText,{label:e,lo:G(r,n),hi:G(i,n)})},$1=(e,t)=>{let n=eN(e);return G(K(e,n.key,t),n.format)},e0=864e5,t0={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1},n0=e=>t0[e]??0,r0=[`donut`,`funnel`,`waterfall`,`treemap`,`sankey`,`scatter`,`bubble`],i0=()=>xM(`chart`,c1),XC([fv,Ib,lx,AD,QE,qE,jE,DD,Pw,jO,Ek,lA,Yk,KO,PO,MA,wA,jk,ij,IA,vee,_M]),a0=e=>typeof e==`number`,o0=e=>a0(e)?e:null,s0=[`series`,`graphic`,`grid`,`xAxis`,`yAxis`,`title`,`visualMap`,`calendar`,`dataZoom`],c0=e=>String(e).replace(/[{}]/g,e=>e===`{`?`{`:`}`),l0=(e,t)=>{let n=e.filter(e=>typeof e==`number`&&Number.isFinite(e));return[Math.min(...t?[0,...n]:n),Math.max(...t?[0,...n]:n)]},u0=24,d0=4,f0=.6,p0=(e,t)=>String(e).length*t*f0,m0=(e,t)=>{let n=e[t];if(n===void 0)throw Error(`chart palette has no colour at slot ${t}`);return n},h0=[.2126,.7152,.0722],g0=e=>e.map(e=>e/255).map(e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4).reduce((e,t,n)=>e+t*(h0[n]??0),0),_0=(e,t)=>(Math.max(e,t)+.05)/(Math.min(e,t)+.05),v0=(e,t)=>({type:`linear`,x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:$N(e,t)},{offset:1,color:$N(e,0)}]}),y0=(e,t)=>e+jM(e,t),b0=e=>[...new Set(e)],x0=(e,t)=>e.data.map((n,r)=>K(e,t,r)),S0=(e,t,n={})=>({type:`category`,data:t,axisLine:{lineStyle:{color:e.axis}},axisTick:{show:!1},axisLabel:{color:e.label,fontSize:12,margin:12,hideOverlap:!0},...n}),C0=(e,t,n={})=>({type:`value`,splitNumber:4,axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:e.grid,type:`solid`,width:1}},axisLabel:{color:e.label,fontSize:12,formatter:t},...n}),w0=6048e5,T0=(e,t)=>{let n=AM(e,t);return`${n.year}-${String(n.month+1).padStart(2,`0`)}-${String(n.day).padStart(2,`0`)}`},E0=e=>e.reduce((e,t)=>Number.isNaN(t)?e:Math.min(t,e),1/0),D0=e=>e.reduce((e,t)=>Number.isNaN(t)?e:Math.max(t,e),-1/0),O0=9,k0=24,A0=4,j0=72,M0=12,N0=(e,t)=>Math.floor(t/Math.max(1,e)-A0),P0=44,F0=28,I0=8,L0=32,R0=8,z0=26,B0={donut:oP,heatmap:lP,calendar:dP,funnel:fP,gauge:pP,waterfall:vP,treemap:bP,sankey:SP,scatter:wP,bubble:wP,multiples:TP},V0=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`,typeof HTMLElement>`u`)throw Error(V0);H0=HTMLElement,U0=()=>xM(`chart`,c1),W0=`wui-chart:select`,G0=`wui-chart:legend-change`,K0=`wui-chart:ready`,q0=[`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`,`Escape`],J0=`(prefers-color-scheme: dark)`,Y0=`(prefers-reduced-motion: reduce)`,X0=`(forced-colors: active)`,Z0=`(prefers-contrast: more)`,Q0=`print`,$0=e=>typeof window.matchMedia==`function`?window.matchMedia(e):null,e2=!1,t2=new Map,n2=[...[1,2,3,4,5,6,7,8].map(e=>`--color-chart-${e}`),...[0,1,2,3,4,5,6].map(e=>`--color-chart-seq-${e}`),`--color-chart-neutral`,`--wui-chart-rise`,`--wui-chart-fall`,`--color-chart-grid`,`--color-chart-axis`,`--color-chart-label`,`--color-surface`,`--color-text`,`--color-text-body`,`--color-text-muted`],r2=new Set,i2=null,a2=(e,t,n)=>{let r=document.createElement(e);return t&&(r.className=t),n!=null&&(r.textContent=n),r},o2=0,s2=class extends H0{uid;_spec;_normal;_hidden;_focus;_awaitingSpec=!1;_parts=null;_theme=null;_width=null;_visible=!1;_resizeObserver=null;_intersection=null;_engine=null;_drawn=!1;_drawnType=null;_announcedReady=!1;_legendSignature=null;_tableSpec=null;static get observedAttributes(){return[`view`]}constructor(){super(),o2+=1,this.uid=`wui-chart-${o2}`,this._spec=null,this._normal=null,this._hidden=new Set,this._focus=null}get spec(){return this._spec}set spec(e){this._spec=e??null,this._normal=null,this._clearFocus(),this._parts&&this._update()}get view(){return this.getAttribute(`view`)===`table`?`table`:`chart`}set view(e){this.setAttribute(`view`,String(e??`chart`))}connectedCallback(){if(Object.hasOwn(this,`spec`)){let e=this.spec;delete this.spec,this._spec=e??null}if(this._spec??=this._readScript(),this._spec==null&&!this.querySelector(`:scope > script[type='application/json']`)&&(this._awaitingSpec=!0,queueMicrotask(()=>{this._awaitingSpec=!1,this._parts&&this._update()})),this._build(),PP(this),this._theme=NP(this),this._width=this.clientWidth,this._resizeObserver=new ResizeObserver(()=>this._resized()),this._resizeObserver.observe(this),typeof IntersectionObserver==`function`){this._visible=!1;let e=new IntersectionObserver(t=>{t.some(e=>e.isIntersecting)&&(e.disconnect(),this._visible=!0,this._update())},{threshold:.05});this._intersection=e,e.observe(this)}else this._visible=!0;this._update()}disconnectedCallback(){FP(this),this._resizeObserver?.disconnect(),this._intersection?.disconnect(),this._engine?.dispose(),this._engine=null,this._drawn=!1,this._parts=null,this.removeAttribute(`data-ready`)}attributeChangedCallback(e,t,n){t!==n&&this._parts&&(qM(`view`,n,m1),this._update())}toCsv(){let{spec:e}=this._normalized();return e?NN(e):``}toPng(){let{spec:e}=this._normalized();return e?kP(e,this._theme??NP(this),this._size(e),{hidden:this._hidden,renderer:lN(e)}):``}exportCsv(e){let t=URL.createObjectURL(new Blob([this.toCsv()],{type:`text/csv;charset=utf-8`}));IP(t,e??`${PN(this._normalized().spec)}.csv`),setTimeout(()=>URL.revokeObjectURL(t),2e3)}exportPng(e){let t=this.toPng();t&&IP(t,e??`${PN(this._normalized().spec)}.png`)}_readScript(){let e=this.querySelector(`:scope > script[type="application/json"]`);if(!(e instanceof HTMLScriptElement))return null;try{return JSON.parse(String(e.textContent))}catch(e){return yM(`[@webority/ui-elements] <wui-chart> could not read its JSON spec:`,e instanceof Error?e.message:void 0),null}}_normalized(){return this._normal??=XM(this._spec),this._normal}_build(){let e=a2(`div`,`wui-chart-legend`);e.setAttribute(`role`,`group`),e.setAttribute(`aria-label`,U0().legendLabel),e.hidden=!0,e.addEventListener(`click`,e=>{let t=e.target instanceof Element?e.target.closest(`.wui-chart-legend-item`):null;t instanceof HTMLElement&&this._toggle(t.dataset.key)});let t=a2(`div`,`wui-chart-surface`);t.tabIndex=0,t.setAttribute(`role`,`group`),t.setAttribute(`aria-roledescription`,U0().chartLabel),t.addEventListener(`keydown`,e=>this._onKey(e)),t.addEventListener(`blur`,()=>this._clearFocus());let n=a2(`div`,`wui-chart-canvas`);n.setAttribute(`aria-hidden`,`true`),t.append(n);let r=a2(`div`,`wui-chart-state`);r.setAttribute(`role`,`status`),r.hidden=!0;let i=a2(`div`,`wui-chart-table-wrap visually-hidden`),a=a2(`p`,`visually-hidden`);a.id=`${this.uid}-summary`;let o=a2(`div`,`visually-hidden`);o.setAttribute(`aria-live`,`polite`),this.replaceChildren(e,t,r,i,a,o),this.setAttribute(`role`,`figure`),this.setAttribute(`aria-describedby`,a.id),this._parts={legend:e,surface:t,canvas:n,state:r,tableWrap:i,summary:a,live:o},this._legendSignature=null,this._tableSpec=null}_size(e){return{width:this._parts?.surface.clientWidth||this.clientWidth||800,height:e.height}}_update(){if(!this._parts||this._awaitingSpec&&this._spec==null)return;let{spec:e,problem:t}=this._normalized(),n=this._parts,r=e===null?`error`:e.state===`ready`&&(!e.data.length||!nN(e))?`empty`:e.state,i=`${e?.height??320}px`,a=this.view===`table`,o=e!==null&&(r===`ready`||r===`loading`&&this._drawn),s=r===`loading`&&o;if(this.setAttribute(`aria-label`,e?.title||U0().untitledLabel),r===`loading`?this.setAttribute(`aria-busy`,`true`):this.removeAttribute(`aria-busy`),this.setAttribute(`data-state`,r),n.surface.setAttribute(`aria-label`,CM(U0().arrowKeysText,{title:e?.title||U0().untitledLabel})),n.summary.textContent=e?FN(e,this._hidden):``,e){if(!s){let t=new Set(uN(e));for(let e of this._hidden)t.has(e)||this._hidden.delete(e)}this._renderTable(e)}else n.tableWrap.replaceChildren();s||this._renderLegend(e,o&&!a),this._renderState(r,e===null?t:r===`error`?e.errorText:r===`loading`?e.loadingText??U0().loadingText:e.emptyText,i,o);let c=r===`ready`&&!a;s||this.toggleAttribute(`data-ready`,!c);let l=n.surface.hidden&&o&&!a;n.surface.hidden=!o||a,n.surface.style.height=i,n.tableWrap.className=a&&e?`wui-chart-table-wrap`:`wui-chart-table-wrap visually-hidden`,n.tableWrap.style.height=a&&e?i:``,a&&e?(n.tableWrap.tabIndex=0,n.tableWrap.setAttribute(`role`,`region`),n.tableWrap.setAttribute(`aria-label`,`${e.title||U0().untitledLabel} ${U0().dataSuffixLabel}`)):(n.tableWrap.removeAttribute(`tabindex`),n.tableWrap.removeAttribute(`role`),n.tableWrap.removeAttribute(`aria-label`)),l&&this._engine?.resize(),r===`ready`&&!a&&this._visible&&this._draw()}_renderState(e,t,n,r){let i=this._parts?.state;if(!i)return;let a=!r&&e!==`ready`;i.hidden=!a,a?(i.style.height=n,e===`loading`?i.replaceChildren(a2(`div`,`skeleton wui-chart-skeleton`),a2(`span`,`visually-hidden`,t)):i.replaceChildren(a2(`p`,`wui-chart-state-text`,t))):i.replaceChildren()}_colour(e,t){let n=this._theme;if(n)return e.type===`donut`?CN(e,t,n):n.palette[t]}_renderLegend(e,t){let n=this._parts?.legend;if(!n)return;let r=e?uN(e):[],i=!!e&&t&&r.length>=2;if(n.hidden=!i,!e||!i)return;let a=dN(e),o=r.map((t,n)=>this._colour(e,n)),s=JSON.stringify([e.type,r,a,o]);s!==this._legendSignature&&(this._legendSignature=s,n.replaceChildren(...r.map((t,n)=>{let r=a2(`button`,`wui-chart-legend-item`);r.type=`button`,r.dataset.key=t;let i=a2(`span`,e.type===`line`?`wui-chart-legend-swatch wui-chart-legend-swatch-line`:`wui-chart-legend-swatch`),s=o[n];return s!==void 0&&(i.style.background=s),r.append(i,a2(`span`,`wui-chart-legend-label`,a[n])),r})));for(let e of n.children){if(!(e instanceof HTMLElement))throw Error(`Expected a legend item to be an HTMLElement.`);let t=e.dataset.key;e.setAttribute(`aria-pressed`,String(t===void 0||!this._hidden.has(t)))}}_renderTable(e){if(this._tableSpec===e||!this._parts)return;this._tableSpec=e;let t=AN(e),n=a2(`table`,`wui-chart-table`);n.append(a2(`caption`,`visually-hidden`,t.caption));let r=a2(`tr`);t.head.forEach((e,t)=>{let n=a2(`th`,t?`wui-chart-num`:null,e);n.scope=`col`,r.append(n)});let i=a2(`thead`);i.append(r),n.append(i);let a=a2(`tbody`);for(let e of t.rows){let t=a2(`tr`),n=a2(`th`,null,e.head);n.scope=`row`,t.append(n,...e.cells.map(e=>a2(`td`,`wui-chart-num`,e))),a.append(t)}n.append(a);let o=[n];t.truncated&&o.push(a2(`p`,`wui-chart-table-note`,CM(U0().showingFirstRowsDownloadText,{rows:t.rows.length,total:t.total}))),this._parts.tableWrap.replaceChildren(...o)}_draw(){let{spec:e}=this._normalized();if(!e||!this._parts||!this._theme)return;let t=lN(e),n=e.type!==this._drawnType;this._engine&&this._engine.renderer!==t&&(this._engine.dispose(),this._engine=null);let r=`${e.height}px`,i=this._parts.canvas.style.height!==r;this._parts.canvas.style.height=r,i&&this._engine?.resize(),this._engine||(this._engine=AP(this._parts.canvas,{renderer:t}),this._engine.onSelect(({seriesIndex:e,dataIndex:t})=>this._select(e,t)),this._engine.onFinished(()=>{this.setAttribute(`data-ready`,``),this._announcedReady||(this._announcedReady=!0,this.dispatchEvent(new CustomEvent(K0,{bubbles:!0,detail:{renderer:t}})))}),n=!0),this._engine.render(e,this._theme,this._size(e),{hidden:this._hidden,renderer:t},{replace:n}),this._drawnType=e.type,this._drawn=!0}_themeChanged(e=!1){if(!this._parts)return;let t=NP(this);JSON.stringify(t)!==JSON.stringify(this._theme)&&(this._theme=t,this._update(),e&&this._engine?.flush())}_resized(){let e=this.clientWidth;e!==this._width&&(this._width=e,this._engine&&this._drawn&&this._parts&&(this._parts.surface.hidden||this._engine.resize(),this._update()))}_toggle(e){let{spec:t}=this._normalized();if(!t||e==null)return;this._hidden.has(e)?this._hidden.delete(e):this._hidden.add(e),this._clearFocus(),this._update();let n=Object.fromEntries(uN(t).map(e=>[e,!this._hidden.has(e)]));this.dispatchEvent(new CustomEvent(G0,{bubbles:!0,detail:{visible:n}}))}_onKey(e){let{spec:t}=this._normalized();if(!t||!this._engine||!this._theme||this.view===`table`||e.altKey||e.ctrlKey||e.metaKey)return;if(jP(e)){if(!this._focus)return;e.preventDefault(),this._select(this._focus.series,this._focus.index);return}if(!q0.includes(e.key)||e.key===`Escape`&&!this._focus)return;e.preventDefault();let n=zN(t,this._focus,e.key,this._hidden);n?(this._focus=n,this._engine.focusPoint(n.series,n.index),this._announce(ON(wN(t,n.index,this._hidden,this._theme)))):this._clearFocus()}_announce(e){let t=this._parts?.live;t&&(t.textContent=e===t.textContent?`${e} `:e)}_clearFocus(){this._focus&&(this._focus=null,this._engine?.clearFocus(),this._parts&&(this._parts.live.textContent=``))}_select(e,t){let{spec:n}=this._normalized();if(!n)return;let r=n.series[v1(n.type)?0:e];if(!r)return;let i=n.data[t]??null;this.dispatchEvent(new CustomEvent(W0,{bubbles:!0,detail:{series:r.key,label:r.label,x:i?.[n.x.key]??null,value:K(n,r.key,t),row:i,index:t}}))}},Ta(`wui-chart`,s2)})),l2=null;async function u2(){await Promise.resolve().then(()=>(c2(),wa)),await customElements.whenDefined(`wui-chart`)}async function d2(){return l2??=u2().catch(e=>{throw l2=null,e}),l2}var f2={sub:`wui-chat-sub`,sup:`wui-chat-sup`};function p2(e,t){let n=e.ownerDocument??document;for(let r of t)if(r.kind===`sub`||r.kind===`sup`){let t=n.createElement(r.kind);t.className=f2[r.kind],t.textContent=r.text,e.append(t)}else e.append(n.createTextNode(r.text))}function m2(e,t){e.replaceChildren(),p2(e,fn(String(t??``)))}function h2(e){return pn(String(e??``))}function g2(e){return mn(e)}var _2=8,v2=8,y2={Bar:`column`,Line:`line`,Donut:`donut`};function b2(e,t){return e===`Bar`&&t>4?300:240}function x2(e,t){let n=e.chartType===`Donut`,r=n?e.series.slice(0,1):e.series.slice(0,_2),i=r.map((e,n)=>({key:`s${n}`,label:h2(e.name)||t.chart})),a=Object.fromEntries(i.map(e=>[e.key,null])),o=new Map;r.forEach((e,t)=>{for(let n of e.points){let e=String(n.label),r=o.get(e);r===void 0&&(r={label:h2(e),...a},o.set(e,r)),r[`s${t}`]=n.value}});let s=[...o.values()],c={type:y2[e.chartType],title:h2(e.title)||t.chart,x:{key:`label`,kind:`category`},series:i,data:s,height:b2(e.chartType,s.length)};return e.chartType===`Bar`&&s.length<=v2&&(c.x.labelFit=`all`,c.valueLabels=!0),!n&&e.unit&&(c.y={label:h2(e.unit)}),s.length===0&&(c.state=`empty`,c.emptyText=t.chartEmpty),c}pa(`wui-chat-part-chart`,class extends fa{#e=null;#t=0;#n=null;#r=null;#i=null;#a=null;renderPart(e,t,n){let r=JSON.stringify(e);if(r===this.#e)return;this.#e=r,this.#t+=1;let i=this.#t,a=this.ownerDocument??document,o=this.#o(a);if(this.#r?.remove(),this.#r=null,e.title){let t=P(a,`figcaption`,`wui-chat-chart-title`);m2(t,e.title),o.figure.prepend(t),this.#r=t}let s=this.#i;if(s!==null){let t=x2(e,n.labels);Object.assign(s,{spec:t}),this.#s(o,s,t.state!==`empty`,n.labels)}else d2().then(()=>{if(i!==this.#t||!this.isConnected)return;let t=x2(e,n.labels),r=a.createElement(`wui-chart`);Object.assign(r,{spec:t}),this.#i=r,o.body.replaceChildren(r),this.#s(o,r,t.state!==`empty`,n.labels)},()=>{i===this.#t&&this.isConnected&&this.#l(o.body,n.labels)})}disposePart(){this.#t+=1,this.#e=null}#o(e){if(this.#n===null){let t=P(e,`figure`,`wui-chat-chart`),n=P(e,`div`,`wui-chat-chart-body`);t.append(n),this.replaceChildren(t),this.#n={figure:t,body:n}}return this.#n}#s(e,t,n,r){if(!n){this.#a?.remove(),this.#a=null;return}if(!this.#a){let n=P(this.ownerDocument??document,`button`,`btn btn-link btn-sm wui-chat-chart-toggle`);n.type=`button`,n.addEventListener(`click`,()=>this.#c(e,t)),e.figure.append(n),this.#a=n}let i=t.getAttribute(`view`)===`table`;this.#a.setAttribute(`aria-pressed`,String(i)),this.#a.textContent=i?r.chartShowChart:r.chartShowTable}#c(e,t){let n=this.activeTurn,r=t.getAttribute(`view`)!==`table`;t.setAttribute(`view`,r?`table`:`chart`),this.#s(e,t,!0,n.labels)}#l(e,t){let n=P(this.ownerDocument??document,`p`,`wui-chat-chart-error`,t.chartLoadFailed);n.setAttribute(`role`,`status`),e.replaceChildren(n),this.#a?.remove(),this.#a=null}});var S2={Positive:`wui-metric-tone-success`,Caution:`wui-metric-tone-warning`,Negative:`wui-metric-tone-danger`},C2=new Set([`Positive`,`Caution`,`Negative`]),w2=.001;function T2(e,t,n){let r=S2[t.status],i=P(e,`div`,r?`wui-metric ${r}`:`wui-metric`);i.dataset.status=t.status;let a=P(e,`div`,`wui-metric-label`);m2(a,t.label);let o=P(e,`div`,`wui-metric-value`);if(p2(o,t.value!==0&&Math.abs(t.value)<w2?g2(t.value):[{kind:`text`,text:Hi(t.value)}]),t.unit){let n=P(e,`span`,`wui-chat-figure-unit`);m2(n,t.unit),n.prepend(` `),o.append(n)}return C2.has(t.status)&&o.append(P(e,`span`,`visually-hidden`,n.figureStatus(t.status))),i.append(a,o),i}pa(`wui-chat-part-figures`,class extends fa{#e=null;renderPart(e,t,n){let r=JSON.stringify(e);if(r===this.#e)return;if(this.#e=r,!e.figures||e.figures.length===0){this.replaceChildren();return}let i=this.ownerDocument??document,a=P(i,`div`,`wui-chat-figures`),o=P(i,`div`,`wui-metric-strip wui-metric-strip-sm wui-chat-figures-strip`);o.setAttribute(`role`,`group`),o.setAttribute(`aria-label`,n.labels.figures);for(let t of e.figures)o.append(T2(i,t,n.labels));a.append(o),this.replaceChildren(a)}}),pa(`wui-chat-part-file`,class extends fa{renderPart(e,t,n){let r=n.openAttachment,i=typeof r==`function`,a=document.createElement(i?`button`:`span`);a.className=`wui-chat-file-chip`,i&&(a.setAttribute(`type`,`button`),a.setAttribute(`aria-label`,n.labels.fileOpen(e.fileName)),a.addEventListener(`click`,()=>r(e)));let o=ma(document,`document-text`,16),s=document.createElement(`span`);s.className=`wui-chat-file-name`,s.textContent=e.fileName;let c=document.createElement(`span`);c.className=`wui-chat-file-size`,c.textContent=nr(e.length),a.append(...[o,s,c].filter(e=>e!==null));let l=document.createElement(`div`);l.className=`wui-chat-file`,l.append(a),this.replaceChildren(l)}});var E2=`(prefers-reduced-motion: reduce)`;function D2(e,t){let n=e.style.animation;e.style.animation=`none`;let r=e.getBoundingClientRect();e.style.animation=n,e.style.transformOrigin=`${t.left+t.width/2-r.left}px ${t.top+t.height/2-r.top}px`}function O2(e,t){let n=typeof window.matchMedia==`function`?window.matchMedia(E2):null,r=new Set,i=()=>e.motion===`Reduced`||t?.motion===!1||n?.matches===!0,a=i();function o(){let e=i();if(e!==a){a=e;for(let e of r)e(a)}}return n?.addEventListener(`change`,o),{get reduced(){return a},subscribe(e){return r.add(e),()=>{r.delete(e)}},destroy(){n?.removeEventListener(`change`,o),r.clear()}}}var k2=`AppButton`,A2={primary:`btn-primary`,secondary:`btn-soft-primary`,ghost:`btn-ghost-primary`,outline:`btn-outline-primary`,neutral:`btn-soft-neutral`,danger:`btn-danger`};function $(e,t,n){let r=document.createElement(e);if(t&&(r.className=t),n)for(let[e,t]of Object.entries(n))t!=null&&r.setAttribute(e,t);return r}function j2(e,t=16){let n=Ki(e,{size:t});if(!n)return $(`span`,`d-inline-flex`);let r=document.createElement(`template`);return r.innerHTML=n,r.content.firstElementChild??$(`span`,`d-inline-flex`)}function M2(e=`primary`,t=`md`){if(!Object.hasOwn(A2,e))throw Error(`Unknown button variant "${e}". Use one of ${Object.keys(A2).join(`, `)}.`);return`btn ${A2[e]}${t===`sm`?` btn-sm`:``}`}function N2(e,t,n,r){let i=$(`button`,`${M2(e,`sm`)} wui-chat-action-btn`,{type:`button`});return i.dataset.wui=k2,n&&i.append(j2(n,14)),i.append(document.createTextNode(t)),i.addEventListener(`click`,r),i}function P2(e,t,n){let r=$(`button`,`wui-chat-icon-btn`,{type:`button`,"aria-label":e,title:e});return r.append(j2(t,20)),r.addEventListener(`click`,n),r}function F2(e,t){let n=e.getAttribute(t);if(n!=null&&n!==``)try{return JSON.parse(n)}catch{throw Error(`<wui-chat ${t}> must be valid JSON.`)}}function I2(e){let t;return n=>{let r=e.dataset.state;if((!n||r!==`open`&&r!==`opening`)&&(n||r!==`closed`&&r!==`closing`)){if(clearTimeout(t),n)e.dataset.state=`opening`,t=setTimeout(()=>{e.dataset.state=`open`},620);else{e.dataset.state=`closing`;let n=e.classList.contains(`wui-chat--panel-motion-none`)?0:300;t=setTimeout(()=>{e.dataset.state=`closed`},n)}}}}function L2(e,t){t.position!==void 0&&(e.classList.toggle(`wui-chat--end`,t.position===`end`),e.classList.toggle(`wui-chat--start`,t.position===`start`)),t.reduced!==void 0&&e.classList.toggle(`wui-chat--reduced`,!!t.reduced),t.expressive!==void 0&&e.classList.toggle(`wui-chat--expressive`,t.expressive===!0),t.sendReveal!==void 0&&e.classList.toggle(`wui-chat--send-always`,t.sendReveal===`Always`),t.inputRing!==void 0&&e.classList.toggle(`wui-chat--input-ring-off`,t.inputRing===!1),t.panelMotion!==void 0&&(e.classList.toggle(`wui-chat--panel-motion-gentle`,t.panelMotion===`Gentle`),e.classList.toggle(`wui-chat--panel-motion-none`,t.panelMotion===`None`)),t.offsetX!==void 0&&e.style.setProperty(`--wui-chat-offset-x`,`${t.offsetX}px`),t.offsetY!==void 0&&e.style.setProperty(`--wui-chat-offset-y`,`${t.offsetY}px`),t.width!==void 0&&e.style.setProperty(`--wui-chat-width`,t.width),t.maxHeight!==void 0&&e.style.setProperty(`--wui-chat-panel-max-height`,`${t.maxHeight}px`),t.bottomGap!==void 0&&e.style.setProperty(`--wui-chat-bottom-gap`,`${t.bottomGap}px`),t.panelHeight!==void 0&&e.classList.toggle(`wui-chat--panel-height-content`,t.panelHeight===`Content`),t.avatar!==void 0&&(t.avatar?(e.style.setProperty(`--wui-chat-avatar`,`url(${JSON.stringify(t.avatar)})`),e.style.setProperty(`--wui-chat-typing-mark`,`url(${JSON.stringify(t.avatar)})`)):(e.style.removeProperty(`--wui-chat-avatar`),e.style.removeProperty(`--wui-chat-typing-mark`))),t.replyAvatars!==void 0&&e.classList.toggle(`wui-chat--reply-avatars-off`,t.replyAvatars===!1)}var R2=[`Text`,`Sources`,`QuickReplies`,`InputRequest`,`Action`,`Notice`,`Table`,`Chart`,`Figures`,`RecordCard`,`Image`,`File`,`Ticket`,`Handoff`,`VoiceClip`],z2={launcher:`wui-chat--launcher`,docked:`wui-chat--docked`,"full-page":`wui-chat--full-page`,embedded:`wui-chat--embedded`};function B2(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function V2({id:e,layout:t,position:n,role:r,launcher:i,onToggle:a}){let o=$(`div`,`wui-chat ${z2[t]} wui-chat--${n}`),s=$(`section`,`wui-chat-panel`,{id:e,role:r}),c=i?I2(o):null;o.dataset.state=i?`closed`:`open`;let l=null,u=null,d=null,f=null,p=null,m=null,h=null,g=`round`,_=!1,v=`bubble`,y=null,b=null,x=!1,S=`icon`,C=!1;function w(){if(!l)return;let e=l.dataset.launcher,t=[`wui-chat-launcher-wrap`];e===`entering`&&y&&t.push(`wui-chat-launcher--entrance-${y}`),e===`idle`&&b&&b!==`none`&&(b!==`ring`||g===`pill`)&&t.push(`wui-chat-launcher--idle-${b}`),l.className=t.join(` `)}function T(){if(!u)return;let e=[...u.classList].filter(e=>e.endsWith(`--opening`)||e.endsWith(`--closing`)),t=[`wui-chat-launcher`,`wui-chat-launcher--${g}`];g===`pill`&&_&&t.push(`wui-chat-launcher--compact`),S!==`icon`&&t.push(`wui-chat-launcher--mark-${S}`),t.push(`wui-chat-launcher--reveal-${v}`,...e),u.className=t.join(` `)}function E(){p&&m&&(p.textContent=h||m.launcher)}function D(){if(!u||!f||!m)return;let e=C?m.launcherClose:h||m.launcher;u.setAttribute(`aria-label`,e),f.textContent=e}if(i){let t=$(`div`,`wui-chat-launcher-wrap`);l=t,t.dataset.launcher=`idle`;let n=$(`button`,`wui-chat-launcher`,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":`false`,"aria-controls":e});u=n;let r=$(`span`,`wui-chat-launcher-icon`,{"aria-hidden":`true`});d=r,r.append(j2(`chat`,24));let i=$(`span`,`wui-chat-launcher-close`,{"aria-hidden":`true`});i.append(j2(`x`,24));let c=$(`span`,`wui-chat-launcher-label`);f=c,n.append(r,i,c),n.addEventListener(`click`,()=>a()),n.addEventListener(`animationend`,e=>{e.target===n&&n.classList.remove(`wui-chat-launcher--opening`,`wui-chat-launcher--closing`)});let m=$(`span`,`wui-chat-launcher-bubble`,{"aria-hidden":`true`});p=m,t.append(n,m),t.addEventListener(`animationend`,e=>{e.target===t&&t.dataset.launcher===`entering`&&(t.dataset.launcher=`idle`,w())}),T(),w(),o.append(t,s)}else o.append(s);function O(e){if(!c)return;let t=e&&!C&&u!==null&&u?u.getBoundingClientRect():null;e!==C&&u&&(u.classList.remove(`wui-chat-launcher--opening`,`wui-chat-launcher--closing`),u.classList.add(e?`wui-chat-launcher--opening`:`wui-chat-launcher--closing`)),C=e,c(e),t&&D2(s,t),u&&(u.setAttribute(`aria-expanded`,String(e)),D())}function k(e){m=e,u&&(D(),E())}function A(e){if(L2(o,e),e.theme!==void 0&&(e.theme===`light`||e.theme===`dark`?o.dataset.theme=e.theme:delete o.dataset.theme),!u||!l||!d)return;e.launcherStyle!==void 0&&(g=e.launcherStyle===`Pill`?`pill`:`round`),e.compact!==void 0&&(_=e.compact),e.labelReveal!==void 0&&(v=e.labelReveal===`Expand`?`expand`:`bubble`),e.entrance!==void 0&&(y=e.entrance===`None`?null:B2(e.entrance)),e.idle!==void 0&&(b=e.idle===`None`?`none`:B2(e.idle)),e.phone!==void 0&&(x=e.phone),e.hoverLabel!==void 0&&(h=e.hoverLabel||null),e.launcherMark!==void 0&&(S=B2(e.launcherMark)),e.icon!==void 0&&e.icon!==d.dataset.icon&&(d.dataset.icon=e.icon,d.replaceChildren(j2(e.icon,24)));let t=e.launcherState??l.dataset.launcher;x&&t===`entering`&&(t=`idle`),t===`entering`&&!y&&(t=`idle`),l.dataset.launcher=t,T(),w(),E(),D()}return{root:o,panel:s,setOpen:O,setLabels:k,setAppearance:A,nudgeHost:l,launcherButton:u,role:r}}var H2={Open:`info`,InProgress:`info`,WaitingOnCustomer:`warning`,Resolved:`success`,Closed:`neutral`,Cancelled:`neutral`},U2=/^\/[/\\]/,W2=/^https?:\/\//i,G2=/[\t\r\n]/g;function K2(e){return typeof e==`string`&&e.trim()!==``}function q2(e){return e.replace(G2,``)}function J2(e){if(typeof e!=`string`)return!1;let t=q2(e);return t.startsWith(`/`)?!U2.test(t):W2.test(t)}function Y2(e){if(typeof e!=`string`)return`?`;let t=e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>([...e][0]??``).toUpperCase()).join(``);return t===``?`?`:t}function X2(e,t){let n=e?.displayName,r=Y2(K2(n)?n:t),i=$(`span`,`wui-chat-avatar`,{"aria-hidden":`true`}),a=e?.avatarUrl,o=typeof a==`string`?q2(a):null;if(J2(o)){let e=$(`img`,null,{alt:``,src:o,loading:`lazy`});e.addEventListener(`error`,()=>{i.textContent=r}),i.append(e)}else i.textContent=r;return i}function Z2(e,t){let n=$(`div`,`wui-chat-agent-head`),r=$(`span`,`wui-chat-agent-name`),i=e?.displayName;r.textContent=K2(i)?i:t.agent;let a=$(`span`,`wui-chat-agent-role wui-chat-agent-tag`);return a.textContent=t.agent,n.append(X2(e,t.agent),r,a),n}function Q2(e,t){let n=e.displayName,r=$(`li`,`wui-chat-message wui-chat-message--agent wui-chat-message--typing`),i=$(`span`,`wui-chat-typing`);for(let e=0;e<3;e+=1)i.append($(`span`,`wui-chat-typing-dot`,{"aria-hidden":`true`}));let a=$(`span`,`visually-hidden`);return a.textContent=t.agentTyping(K2(n)?n:t.agent),r.append(Z2({kind:`Agent`,displayName:n,avatarUrl:null},t),i,a),r}function $2(e){return typeof e==`string`&&Object.hasOwn(H2,e)?H2[e]??null:null}function e4(e,t){return $2(e)===null?``:t.ticketStatus(e)}var t4=new Set([`Requested`,`Waiting`]),n4=new Set([`Requested`,`Waiting`,`Joined`]),r4=n4;function i4(e,t){let n=e?.displayName;return typeof n==`string`&&n.trim()!==``?n:t.handoffAgentFallback}function a4(){let e=$(`div`,`wui-chat-handoff-pulses`);for(let t=0;t<3;t+=1)e.append($(`span`,`wui-chat-handoff-pulse`,{"aria-hidden":`true`}));return e}function o4(e,t,n){let r=$(e,t);return r.textContent=n,r}function s4(e,t){let n=$(`div`,`wui-chat-handoff-body`);return n.append(o4(`strong`,`wui-chat-handoff-title`,e),o4(`p`,`wui-chat-handoff-text`,t)),n}function c4(e,t){if(typeof e.queuePosition!=`number`){let e=$(`span`,`wui-chat-system-line-stack`);return e.append(o4(`p`,`wui-chat-handoff-text`,t.handoffWaiting),o4(`p`,`wui-chat-handoff-text`,t.handoffQueuedText)),[a4(),e]}let n=$(`span`,`wui-chat-handoff-position`,{"aria-hidden":`true`});return n.textContent=String(e.queuePosition),[n,s4(t.handoffQueued(e.queuePosition),t.handoffQueuedText)]}function l4(e,t){let n=i4(e.agent,t),r=$(`span`,`wui-chat-handoff-agent`);return r.append(X2(e.agent,t.handoffAgentFallback),$(`span`,`wui-chat-handoff-online`,{"aria-hidden":`true`})),[r,s4(t.handoffJoined(n),t.handoffJoinedText(n))]}function u4(e,t){switch(e.state){case`Requested`:return[a4(),o4(`p`,`wui-chat-handoff-text`,t.handoffRequested)];case`Waiting`:return c4(e,t);case`Joined`:return l4(e,t);case`Left`:return[s4(t.handoffLeft(i4(e.agent,t)),t.handoffLeftText)];case`Ended`:return[s4(t.handoffEnded,t.handoffEndedText)];default:return null}}pa(`wui-chat-part-handoff`,class extends fa{_signature;constructor(){super(),this._signature=null}renderPart(e,t,n){let r=n.isLast,i=n.handoffSettled===!0&&t4.has(e.state),a=JSON.stringify([e.state,e.queuePosition,e.agent,r,n.features.HumanHandoff,n.busy,i]);if(a===this._signature)return;if(this._signature=a,i){this.replaceChildren();return}let o=u4(e,n.labels);if(o===null){this.replaceChildren();return}let s=$(`div`,`wui-chat-handoff wui-chat-handoff--${e.state.toLowerCase()}`);if(r&&t4.has(e.state)&&s.classList.add(`wui-chat-handoff--live`),r&&n4.has(e.state)&&s.setAttribute(`role`,`status`),r4.has(e.state)){s.classList.add(`wui-chat-system-line`);let e=$(`span`,`wui-chat-system-line-content`);e.append(...o),s.append(e)}else s.append(...o);this.replaceChildren(s)}});function d4(e,t){if(typeof customElements>`u`||customElements.get(e))return;let n=[];if(typeof document<`u`)for(let r of document.querySelectorAll(e))for(let i of Object.keys(r)){let a=Object.getOwnPropertyDescriptor(t.prototype,i);if(a&&(a.set||a.get)&&(n.push([r,i,Reflect.get(r,i)]),!Reflect.deleteProperty(r,i)))throw Error(`defineElement: could not clear the early "${i}" property on <${e}>.`)}customElements.define(e,t);for(let[t,r,i]of n)if(!Reflect.set(t,r,i))throw Error(`defineElement: could not restore the "${r}" property on <${e}>.`)}var f4=`@webority/ui-elements needs a browser DOM; import its types or helpers entry on the server`;if(typeof HTMLElement>`u`)throw Error(f4);var p4=HTMLElement,m4={closeLabel:`Close`,countText:`{position} of {total}`,downloadLabel:`Download`,imageFailedMessage:`This image can't be shown.`,label:`Image viewer`,nextImageLabel:`Next image`,previousImageLabel:`Previous image`,zoomInLabel:`Zoom in`,zoomOutLabel:`Zoom out`},h4=`a.wui-lightbox-item`,g4=1,_4=4,v4=.5,y4=2,b4=50,x4=6,S4=300,C4=300;function w4(e){return Number.isFinite(e)?Math.min(_4,Math.max(g4,e)):g4}function T4(e,t,n,r){let i=(e,n)=>Math.max(0,(e*t-n)/2),a=i(r.width,n.width),o=i(r.height,n.height);return{x:Math.min(a,Math.max(-a,e.x)),y:Math.min(o,Math.max(-o,e.y))}}function E4(e,t){return Math.abs(e)<b4||Math.abs(e)<Math.abs(t)*1.5?0:e<0?1:-1}function D4(e){let t=(String(e??``).split(/[?#]/)[0]??``).split(`/`).filter(Boolean).pop()??``;try{return decodeURIComponent(t)}catch{return t}}function O4(e,t,n={}){let r=document.createElement(e);r.className=t;for(let[e,t]of Object.entries(n))r.setAttribute(e,t);return r}var k4=()=>Ti(`lightbox`,m4);function A4(e,t,n){let r=O4(`button`,`u-action wui-lightbox-btn ${n}`,{type:`button`,"aria-label":t,title:t});return r.style.setProperty(`--wui-action-size`,`40px`),r.innerHTML=Ki(e,{size:20}),r}d4(`wui-lightbox`,class extends p4{_ui;_index;_zoom;_pan;_pointers;_gesture;_lastTap;_returnTo;_release;_onClick;static get observedAttributes(){return[`open-index`]}constructor(){super(),this._ui=null,this._index=0,this._zoom=g4,this._pan={x:0,y:0},this._pointers=new Map,this._gesture=null,this._lastTap=-1/0,this._returnTo=null,this._release=null,this._onClick=e=>{if(e.defaultPrevented||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let t=e.target,n=t instanceof Element?t.closest(h4):null;if(!(n instanceof HTMLAnchorElement)||!this.contains(n))return;let r=this._links().indexOf(n);r<0||(e.preventDefault(),this.open(r))}}get _view(){if(!this._ui)throw Error(`<wui-lightbox> viewer is not open.`);return this._ui}get download(){return this.hasAttribute(`download`)}set download(e){this.toggleAttribute(`download`,e===!0||e===``||e===`true`)}get label(){return this.getAttribute(`label`)||k4().label}set label(e){this.setAttribute(`label`,String(e??``))}get layout(){return this.getAttribute(`layout`)===`single`?`single`:`gallery`}set layout(e){if(e===`single`)this.setAttribute(`layout`,`single`);else if(e===`gallery`||e===``)this.removeAttribute(`layout`);else throw Error(`<wui-lightbox> layout must be "gallery" or "single", received "${e}".`)}get isOpen(){return this._ui!==null}connectedCallback(){this.addEventListener(`click`,this._onClick),this._syncOpenIndex()}disconnectedCallback(){this.removeEventListener(`click`,this._onClick),this._teardown()}attributeChangedCallback(){this.isConnected&&this._syncOpenIndex()}_syncOpenIndex(){let e=this.getAttribute(`open-index`);e===null?this.close():this.open(Number(e))}_links(){return[...this.querySelectorAll(h4)].filter(e=>e instanceof HTMLAnchorElement)}_items(){return this._links().map(e=>{let t=e.getAttribute(`href`)??``;return{link:e,src:t,alt:e.querySelector(`img`)?.getAttribute(`alt`)??``,caption:e.dataset.caption??``,name:e.dataset.name||D4(t)}})}open(e=0){let t=this._items();if(!t.length)return!1;if(!this._ui){let t=document.activeElement;this._returnTo=t instanceof HTMLElement||t instanceof SVGElement?t:null,this._build(),this.dispatchEvent(new CustomEvent(`wui-lightbox:open`,{bubbles:!0,detail:{index:e}}))}return this._show(e,t),!0}close(){if(!this._ui)return;let e=this._index,t=this._links()[e]??this._returnTo;this._teardown(),t?.isConnected&&t.focus(),this._returnTo=null,this.dispatchEvent(new CustomEvent(`wui-lightbox:close`,{bubbles:!0,detail:{index:e}}))}_teardown(){this._ui&&(this._release?.(),this._release=null,this._ui.root.open&&this._ui.root.close(),this._ui.root.remove(),this._ui=null,this._pointers.clear(),this._gesture=null)}_build(){let e=O4(`dialog`,`wui-lightbox-overlay`,{role:`dialog`,"aria-label":this.label,tabindex:`-1`}),t=O4(`div`,`wui-lightbox-bar`),n=O4(`span`,`wui-lightbox-count`,{"aria-live":`polite`}),r=O4(`div`,`wui-lightbox-tools`),i=A4(`zoom-out`,k4().zoomOutLabel,`wui-lightbox-zoom-out`),a=A4(`zoom-in`,k4().zoomInLabel,`wui-lightbox-zoom-in`),o=O4(`a`,`u-action wui-lightbox-btn wui-lightbox-download`,{"aria-label":k4().downloadLabel,title:k4().downloadLabel});o.style.setProperty(`--wui-action-size`,`40px`),o.innerHTML=Ki(`download`,{size:20}),o.hidden=!this.download;let s=A4(`x`,k4().closeLabel,`wui-lightbox-close`);r.append(i,a,o,s),t.append(n,r);let c=O4(`div`,`wui-lightbox-stage`),l=A4(`chevron-left`,k4().previousImageLabel,`wui-lightbox-nav wui-lightbox-prev`),u=A4(`chevron-right`,k4().nextImageLabel,`wui-lightbox-nav wui-lightbox-next`),d=O4(`img`,`wui-lightbox-image`,{decoding:`async`,draggable:`false`,alt:``}),f=O4(`p`,`wui-lightbox-status`,{role:`status`});c.append(d,f,l,u);let p=O4(`p`,`wui-lightbox-caption`);e.append(t,c,p);let m={root:e,count:n,zoomOut:i,zoomIn:a,download:o,close:s,stage:c,prev:l,next:u,image:d,status:f,caption:p};this._ui=m,s.addEventListener(`click`,()=>this.close()),l.addEventListener(`click`,()=>this.step(-1)),u.addEventListener(`click`,()=>this.step(1)),i.addEventListener(`click`,()=>this._setZoom(this._zoom-v4)),a.addEventListener(`click`,()=>this._setZoom(this._zoom+v4)),e.addEventListener(`keydown`,e=>this._onKeyDown(e)),c.addEventListener(`pointerdown`,e=>this._onPointerDown(e)),c.addEventListener(`pointermove`,e=>this._onPointerMove(e)),c.addEventListener(`pointerup`,e=>this._onPointerEnd(e,!0)),c.addEventListener(`pointercancel`,e=>this._onPointerEnd(e,!1)),c.addEventListener(`wheel`,e=>this._onWheel(e),{passive:!1}),d.addEventListener(`load`,()=>{this._ui===m&&(f.textContent=``,c.removeAttribute(`aria-busy`),d.hidden=!1,this._applyTransform())}),d.addEventListener(`error`,()=>{this._ui===m&&(c.removeAttribute(`aria-busy`),d.hidden=!0,f.textContent=k4().imageFailedMessage)}),this.append(e),this._release=sa(e,{escape:!0,backdrop:!1,focus:`panel`,onRequestClose:()=>this.close()})}step(e){if(!this._ui||!e)return;let t=this._items();t.length<2||this._show((this._index+e+t.length)%t.length,t)}_show(e,t){let n=this._view,r=Math.min(t.length-1,Math.max(0,Math.trunc(Number(e))||0)),i=t[r];if(!i)throw Error(`<wui-lightbox> image missing.`);let a=r!==this._index||!n.image.getAttribute(`src`);if(this._index=r,this._zoom=g4,this._pan={x:0,y:0},n.count.textContent=Di(k4().countText,{position:Hi(r+1,{decimals:0}),total:Hi(t.length,{decimals:0})}),n.caption.textContent=i.caption,n.caption.hidden=!i.caption,n.download.href=i.src,n.download.setAttribute(`download`,i.name),n.prev.hidden=n.next.hidden=t.length<2,n.stage.setAttribute(`aria-busy`,`true`),n.status.textContent=``,n.image.hidden=!1,n.image.alt=i.alt||i.caption,n.image.src=i.src,this._applyTransform(),this._syncZoomButtons(),t.length>1){let e=t[(r+1)%t.length],n=t[(r-1+t.length)%t.length];if(!e||!n)throw Error(`<wui-lightbox> neighbour image missing.`);for(let t of[e,n])new Image().src=t.src}a&&this.dispatchEvent(new CustomEvent(`wui-lightbox:change`,{bubbles:!0,detail:{index:r}}))}_syncZoomButtons(){let e=this._view;e.zoomOut.disabled=this._zoom<=g4,e.zoomIn.disabled=this._zoom>=_4;let t=document.activeElement;(t===e.zoomOut||t===e.zoomIn)&&t instanceof HTMLButtonElement&&t.disabled&&e.close.focus()}_setZoom(e){this._ui&&(this._zoom=w4(e),this._pan=this._clampedPan(this._pan),this._applyTransform(),this._syncZoomButtons())}_clampedPan(e){let{stage:t,image:n}=this._view;return T4(e,this._zoom,{width:t.clientWidth,height:t.clientHeight},{width:n.offsetWidth,height:n.offsetHeight})}_applyTransform(){let{image:e,stage:t}=this._view;e.style.transform=`translate(${this._pan.x}px, ${this._pan.y}px) scale(${this._zoom})`,t.classList.toggle(`wui-lightbox-zoomed`,this._zoom>g4)}_onKeyDown(e){if(e.key===`ArrowLeft`||e.key===`ArrowRight`)e.preventDefault(),this.step(e.key===`ArrowRight`?1:-1);else if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=this._items();this._show(e.key===`Home`?0:t.length-1,t)}else e.key===`+`||e.key===`=`?(e.preventDefault(),this._setZoom(this._zoom+v4)):e.key===`-`?(e.preventDefault(),this._setZoom(this._zoom-v4)):e.key===`0`&&(e.preventDefault(),this._setZoom(g4))}_onWheel(e){e.preventDefault(),this._setZoom(this._zoom*(e.deltaY<0?1.15:1/1.15))}_onPointerDown(e){let t=e.target;if(t instanceof Element&&t.closest(`.wui-lightbox-nav`))return;let n=this._view;if(n.stage.setPointerCapture?.(e.pointerId),this._pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),this._pointers.size===2){let e=[...this._pointers.values()],t=e[0],n=e[1];if(!t||!n)throw Error(`<wui-lightbox> pinch needs two pointers.`);this._gesture={kind:`pinch`,distance:Math.hypot(t.x-n.x,t.y-n.y)||1,zoom:this._zoom}}else this._pointers.size===1&&(this._gesture={kind:`drag`,startX:e.clientX,startY:e.clientY,startTime:e.timeStamp,pan:{...this._pan},onImage:e.target===n.image,moved:!1})}_onPointerMove(e){let t=this._gesture;if(t&&this._pointers.has(e.pointerId)){if(this._pointers.set(e.pointerId,{x:e.clientX,y:e.clientY}),t.kind===`pinch`&&this._pointers.size===2){let e=[...this._pointers.values()],n=e[0],r=e[1];if(!n||!r)throw Error(`<wui-lightbox> pinch needs two pointers.`);this._setZoom(t.zoom*Math.hypot(n.x-r.x,n.y-r.y)/t.distance)}else if(t.kind===`drag`){let n=e.clientX-t.startX,r=e.clientY-t.startY;Math.hypot(n,r)>x4&&(t.moved=!0),this._zoom>g4&&(this._pan=this._clampedPan({x:t.pan.x+n,y:t.pan.y+r}),this._view.stage.classList.add(`is-dragging`),this._applyTransform())}}}_onPointerEnd(e,t){let n=this._gesture;if(this._pointers.delete(e.pointerId),this._ui?.stage.classList.remove(`is-dragging`),!n)return;if(n.kind===`pinch`){this._pointers.size<2&&(this._gesture=null);return}if(this._gesture=null,!t)return;let r=e.clientX-n.startX,i=e.clientY-n.startY;n.moved?this._zoom===g4&&this.step(E4(r,i)):e.timeStamp-n.startTime>S4||(n.onImage?e.timeStamp-this._lastTap<C4?(this._lastTap=-1/0,this._setZoom(this._zoom>g4?g4:y4)):this._lastTap=e.timeStamp:this.close())}}),pa(`wui-chat-part-image`,class extends fa{#e=null;#t=0;#n=null;renderPart(e,t,n){if(e.attachmentId===this.#e)return;this.#e=e.attachmentId;let r=this.ownerDocument??document,i=P(r,`figure`,`wui-chat-image`),a=P(r,`div`,`wui-chat-image-frame`);this.#n=a;let{width:o,height:s}=e;o!==null&&s!==null&&Number.isFinite(o)&&Number.isFinite(s)&&o>0&&s>0&&(a.style.aspectRatio=`${o} / ${s}`),i.append(a),this.replaceChildren(i),this.#r(e,n)}disposePart(){this.#t+=1,this.#e=null}#r(e,t){this.#t+=1;let n=this.#t,r=this.ownerDocument??document,i=this.#n;if(i===null)return;let a=P(r,`div`,`wui-chat-image-skeleton`);a.setAttribute(`aria-hidden`,`true`);let o=P(r,`span`,`visually-hidden`,t.labels.imageLoading);o.setAttribute(`role`,`status`),i.replaceChildren(a,o),typeof t.loadAttachmentUrl==`function`?t.loadAttachmentUrl(e.attachmentId).then(r=>{n===this.#t&&this.isConnected&&this.#i(r,e,t)},()=>{n===this.#t&&this.isConnected&&this.#a(e,t)}):this.#a(e,t)}#i(e,t,n){let r=this.#n;if(r===null)return;let i=this.ownerDocument??document,a=h2(t.alt),o=i.createElement(`wui-lightbox`);o.setAttribute(`label`,n.labels.imageViewer),o.setAttribute(`layout`,`single`);let s=P(i,`a`,`wui-lightbox-item`);s.setAttribute(`href`,e),s.dataset.caption=a,s.dataset.name=a;let c=i.createElement(`img`);c.src=e,c.alt=a,c.decoding=`async`,s.append(c),o.append(s),r.replaceChildren(o)}#a(e,t){let n=this.#n;if(n===null)return;let r=this.ownerDocument??document,i=P(r,`p`,`wui-chat-image-error`,t.labels.imageFailed);i.setAttribute(`role`,`status`);let a=P(r,`button`,`btn btn-soft-primary btn-sm`,t.labels.retry);a.type=`button`,a.addEventListener(`click`,()=>this.#r(e,t)),n.replaceChildren(i,a)}});var j4={Email:{type:`email`,autocomplete:`email`},Phone:{type:`tel`,autocomplete:`tel`},Name:{type:`text`,autocomplete:`name`},Company:{type:`text`,autocomplete:`organization`},Text:{type:`text`,autocomplete:null},LongText:{type:`text`,autocomplete:null}},M4=[`Open`,`Answered`,`Skipped`,`Expired`],N4=0;function P4(e){return N4+=1,`${e}-${N4}`}function F4(e,t,n){let r=document.createElement(e);return t&&(r.className=t),n!=null&&(r.textContent=n),r}function I4(){let e=F4(`p`,`wui-chat-field-error`);return e.id=P4(`wui-chat-field-error`),e.setAttribute(`role`,`alert`),e.hidden=!0,e}function L4(e,t){return e.required?[]:[F4(`span`,`wui-chat-field-hint`,t.inputOptional)]}function R4(e,t,n){let r=P4(`wui-chat-field`),i=j4[t],a=t===`LongText`&&!e.secret,o;if(a){let e=F4(`textarea`,`form-control wui-chat-input-control`);e.rows=3,o=e}else{let t=F4(`input`,`form-control wui-chat-input-control`);t.type=e.secret?`password`:i.type,e.secret?t.autocomplete=`off`:i.autocomplete&&(t.autocomplete=i.autocomplete),o=t}o.id=r,o.name=e.key,e.placeholder!=null&&(o.placeholder=e.placeholder),e.maxLength!=null&&(o.maxLength=e.maxLength),e.required&&o.setAttribute(`aria-required`,`true`);let s=F4(`label`,`form-label`,e.label);s.htmlFor=r;let c=I4();o.setAttribute(`aria-describedby`,c.id);let l=F4(`div`,`wui-chat-field`);return l.dataset.key=e.key,l.append(s,...L4(e,n),o,c),{field:e,element:l,controls:[o],focus:o,invalid:o,error:c,control:o,read:()=>e.secret?o.value:o.value.trim()}}function z4(e,t,n,r,i){let a=e.control,o=F4(`button`,`btn btn-soft-primary`,n.inputSendCode);o.type=`button`,o.dataset.wui=`AppButton`;let s=F4(`p`,`wui-chat-field-hint`);s.setAttribute(`aria-live`,`polite`);let c=P4(`wui-chat-field`),l=F4(`label`,`form-label`,n.inputEnterCode);l.htmlFor=c,l.hidden=!0;let u=F4(`input`,`form-control wui-chat-input-control`);return u.type=`text`,u.id=c,u.inputMode=`numeric`,u.autocomplete=`one-time-code`,u.hidden=!0,o.addEventListener(`click`,async()=>{o.disabled=!0;try{await r.sendOtp(i,{fieldKey:t.key,value:a.value.trim()}),s.textContent=n.inputCodeSent,l.hidden=!1,u.hidden=!1}catch{s.textContent=n.inputCodeFailed}finally{o.disabled=!1}}),e.element.insertBefore(o,e.error),e.element.insertBefore(s,e.error),e.element.insertBefore(l,e.error),e.element.insertBefore(u,e.error),{...e,controls:[...e.controls,o,u],codeRead:()=>u.value.trim()}}function B4(e,t){let n=P4(`wui-chat-field-label`),r=F4(`span`,`form-label`,e.label);r.id=n;let i=F4(`div`);i.setAttribute(`role`,`radiogroup`),i.setAttribute(`aria-labelledby`,n);let a=I4();i.setAttribute(`aria-describedby`,a.id);let o=[];for(let t of e.options??[]){let n=F4(`div`,`form-check`),r=F4(`input`,`form-check-input`);r.type=`radio`,r.name=e.key,r.value=t.id,r.id=P4(`wui-chat-option`);let a=F4(`label`,`form-check-label`,t.label);a.htmlFor=r.id,n.append(r,a),i.append(n),o.push(r)}o.length===0&&(i.tabIndex=-1);let s=F4(`div`,`wui-chat-field`);return s.dataset.key=e.key,s.append(r,...L4(e,t),i,a),{field:e,element:s,controls:o,focus:o[0]??i,invalid:i,error:a,read:()=>o.find(e=>e.checked)?.value??``}}function V4(e,t){let n=P4(`wui-chat-field-label`),r=F4(`span`,`form-label`,e.label);r.id=n;let i=F4(`div`,`wui-chat-input-choices`);i.setAttribute(`role`,`group`),i.setAttribute(`aria-labelledby`,n);let a=I4();i.setAttribute(`aria-describedby`,a.id);let o=[];for(let t of e.options??[]){let n=F4(`div`,`form-check`),r=F4(`input`,`form-check-input`);r.type=`checkbox`,r.name=e.key,r.value=t.id,r.id=P4(`wui-chat-option`);let a=F4(`label`,`form-check-label`,t.label);a.htmlFor=r.id,n.append(r,a),i.append(n),o.push(r)}o.length===0&&(i.tabIndex=-1);let s=F4(`div`,`wui-chat-field`);return s.dataset.key=e.key,s.append(r,...L4(e,t),i,a),{field:e,element:s,controls:o,focus:o[0]??i,invalid:i,error:a,read:()=>JSON.stringify(o.filter(e=>e.checked).map(e=>e.value))}}function H4(e,t){let n=P4(`wui-chat-field-label`),r=F4(`span`,`form-label`,e.label);r.id=n;let i=F4(`div`,`wui-chat-input-slots`);i.setAttribute(`role`,`radiogroup`),i.setAttribute(`aria-labelledby`,n);let a=I4();i.setAttribute(`aria-describedby`,a.id);let o=new Intl.DateTimeFormat(void 0,{weekday:`short`,day:`numeric`,month:`short`,hour:`numeric`,minute:`2-digit`}),s=[];for(let t of e.slots??[]){let n=F4(`input`,`wui-chat-input-slot-radio`);n.type=`radio`,n.name=e.key,n.value=t.id,n.id=P4(`wui-chat-slot`);let r=F4(`label`,`btn btn-soft-primary wui-chat-input-slot`,o.format(new Date(t.startDateTimeUtc)));r.htmlFor=n.id,i.append(n,r),s.push(n)}s.length===0&&(i.tabIndex=-1);let c=F4(`div`,`wui-chat-field`);return c.dataset.key=e.key,c.append(r,...L4(e,t),i,a),{field:e,element:c,controls:s,focus:s[0]??i,invalid:i,error:a,read:()=>s.find(e=>e.checked)?.value??``}}function U4(e,t,n){let r=P4(`wui-chat-field-label`),i=F4(`span`,`form-label`,e.label);i.id=r;let a=I4(),o=F4(`input`);o.type=`file`,o.name=e.key,o.id=P4(`wui-chat-field`),o.hidden=!0,e.accept?.length&&(o.accept=e.accept.join(`,`));let s=F4(`button`,`btn btn-soft-primary`,t.inputChooseFile);s.type=`button`,s.dataset.wui=`AppButton`,s.setAttribute(`aria-describedby`,a.id),s.addEventListener(`click`,()=>o.click());let c=F4(`span`,`wui-chat-input-file-status`);c.setAttribute(`aria-live`,`polite`);let l=F4(`button`,`btn btn-link-primary`);l.type=`button`,l.dataset.wui=`AppButton`,l.hidden=!0;let u=F4(`div`,`wui-chat-input-file`);u.setAttribute(`role`,`group`),u.setAttribute(`aria-labelledby`,r),u.append(s,c,l,o);let d=`empty`,f=``,p=``,m=0,h=()=>{c.textContent=d===`uploading`?`${t.attachmentUploading} ${f}`:f,l.hidden=f===``,l.textContent=f===``?``:t.inputRemoveFile(f);let e=d===`failed`;a.textContent=e?t.attachmentFailed:``,a.hidden=!e,e?u.setAttribute(`aria-invalid`,`true`):u.removeAttribute(`aria-invalid`)},g=async e=>{m+=1;let t=m;d=`uploading`,f=e.name,p=``,h();try{let r=await n.uploadInputFile(e);if(t!==m)return;p=r,d=`ready`}catch{if(t!==m)return;d=`failed`}h()};o.addEventListener(`change`,()=>{let e=o.files?.[0];e&&g(e)}),l.addEventListener(`click`,()=>{m+=1,d=`empty`,f=``,p=``,o.value=``,h()}),h();let _=F4(`div`,`wui-chat-field`);return _.dataset.key=e.key,_.append(i,...L4(e,t),u,a),{field:e,element:_,controls:[s,l,o],focus:s,invalid:u,error:a,read:()=>d===`ready`?p:``,uploadProblem:()=>d===`uploading`?t.attachmentUploading:d===`failed`?t.attachmentFailed:null}}function W4(e){let t=F4(`input`,`form-check-input`);t.type=`checkbox`,t.name=e.key,t.id=P4(`wui-chat-field`);let n=F4(`label`,`form-check-label`,e.consentText||e.label);n.htmlFor=t.id;let r=I4();t.setAttribute(`aria-describedby`,r.id);let i=F4(`div`,`form-check`);i.append(t,n);let a=F4(`div`,`wui-chat-field`);return a.dataset.key=e.key,a.append(i,r),{field:e,element:a,controls:[t],focus:t,invalid:t,error:r,read:()=>t.checked?`true`:`false`}}function G4(e,t,n,r){if(e.type===`Choice`)return B4(e,t);if(e.type===`MultiChoice`)return V4(e,t);if(e.type===`TimeSlot`)return H4(e,t);if(e.type===`File`)return U4(e,t,n);if(e.type===`Consent`)return W4(e);let i=R4(e,e.type,t);return e.verify===`Otp`?z4(i,e,t,n,r):i}function K4(e,t,n){let r=e.uploadProblem?.();if(r)return r;let{field:i}=e;return i.required?i.type===`Consent`?t===`true`?null:n.inputConsentRequired:i.type===`MultiChoice`?t===`[]`?n.inputRequired:null:t===``?n.inputRequired:null:null}function q4(e,t){return e.state===`Answered`?F4(`p`,`wui-chat-input-summary`,e.answeredSummary||t.inputAnswered):F4(`p`,`wui-chat-input-summary`,e.state===`Skipped`?t.inputSkipped:t.inputExpired)}pa(`wui-chat-part-input-request`,class extends fa{_signature;_generation;constructor(){super(),this._signature=null,this._generation=0}renderPart(e,t,n){for(let t of M4)this.classList.toggle(`wui-chat-input-request--${t.toLowerCase()}`,e.state===t);let r=JSON.stringify([e.requestId,e.state,e.answeredSummary,e.fields]);r!==this._signature&&(this._signature=r,this._generation+=1,this.replaceChildren(this._content(e,n)))}_content(e,t){return e.state===`Open`?this._form(e,this._generation):q4(e,t.labels)}_form(e,t){let n=this.activeTurn,r=n.labels,i=n.features,a=F4(`form`,`wui-chat-input-form`);a.noValidate=!0,a.setAttribute(`aria-label`,e.title||e.submitLabel),e.title&&a.append(F4(`h3`,`wui-chat-input-title`,e.title));let o=e.fields.map(t=>G4(t,r,n,e.requestId));for(let e of o)a.append(e.element);let s=F4(`p`,`wui-chat-input-error`);s.setAttribute(`role`,`status`),s.hidden=!0,a.append(s);let c=F4(`button`,`btn btn-primary`,e.submitLabel);c.type=`submit`,c.dataset.wui=`AppButton`;let l=F4(`div`,`d-flex flex-wrap gap-2`);l.append(c);let u=[c];if(i.LeadShortcuts&&e.fields.length===1&&!e.fields[0]?.required){let t=F4(`button`,`btn btn-soft-primary`,r.skip);t.type=`button`,t.dataset.wui=`AppButton`,t.addEventListener(`click`,()=>this.activeTurn.skipInput(e.requestId)),l.append(t),u.push(t)}if(i.LeadShortcuts&&e.cancellable){let e=F4(`button`,`btn btn-link-primary`,r.cancel);e.type=`button`,e.dataset.wui=`AppButton`,e.addEventListener(`click`,()=>this.activeTurn.cancelLead()),l.append(e),u.push(e)}a.append(l),e.allowTyped&&a.append(F4(`p`,`wui-chat-input-typed`,r.typeAnswer));let d=!1,f=t=>{for(let e of o)for(let n of e.controls)n.disabled=t;for(let e of u)e.disabled=t;c.textContent=t?r.inputSubmitting:e.submitLabel},p=()=>{for(let e of o)e.error.hidden=!0,e.error.textContent=``,e.invalid.removeAttribute(`aria-invalid`);s.hidden=!0,s.textContent=``},m=(e,t)=>{e.error.textContent=t,e.error.hidden=!1,e.invalid.setAttribute(`aria-invalid`,`true`)};return a.addEventListener(`submit`,async n=>{if(n.preventDefault(),d)return;p();let i={},a={},l=[];for(let e of o){let t=e.read();i[e.field.key]=t,e.codeRead&&(a[e.field.key]=e.codeRead());let n=K4(e,t,r);n&&l.push([e,n])}let[u]=l;if(u){for(let[e,t]of l)m(e,t);u[0].focus.focus();return}d=!0,f(!0);let h;try{h=await this.activeTurn.answerInput(e.requestId,i,Object.keys(a).length>0?a:null)}catch{h={ok:!1,errors:{},message:r.errorGeneric}}if(t!==this._generation||h.ok)return;d=!1;let g=null;for(let e of o){let t=h.errors?.[e.field.key];t&&(m(e,t),g??=e)}h.message!=null&&(s.textContent=h.message,s.hidden=!1),f(!1),g?g.focus.focus():o[0]?o[0].focus.focus():c.focus()}),a}});var J4={ActionLimitReached:`warning`,ConversationTooLong:`warning`,AssistantUnavailable:`danger`},Y4={info:`info`,warning:`alert-triangle`,danger:`alert-circle`};pa(`wui-chat-part-notice`,class extends fa{renderPart(e){let t=this.ownerDocument??document,n=J4[e.code]??`info`,r=P(t,`div`,`wui-chat-notice wui-chat-notice--${n}`);r.setAttribute(`role`,n===`danger`?`alert`:`status`);let i=P(t,`span`,`wui-chat-notice-icon`);i.setAttribute(`aria-hidden`,`true`);let a=ma(t,Y4[n],16);a&&i.append(a);let o=P(t,`div`,`wui-chat-notice-body`);o.append(P(t,`span`,`wui-chat-notice-text`,e.text));let s=e.action;if(s){let e=P(t,`button`,`wui-chat-notice-action`,s.label);e.type=`button`,e.addEventListener(`click`,()=>s.run()),o.append(e)}r.append(i,o),this.replaceChildren(r)}});function X4(e){switch(e){case`Primary`:return`wui-chat-quick-reply--primary`;case`Cta`:return`wui-chat-quick-reply--cta`;case`Default`:case null:return``}}pa(`wui-chat-part-quick-replies`,class extends fa{#e=null;renderPart(e,t,n){let r=n.features.SuggestedReplies===!0&&n.isLast===!0&&n.busy===!1&&e.replies.length>0,i=typeof n.openTarget==`function`,a=typeof n.beginHandoff==`function`,o=n.handoffPause===!0,s=JSON.stringify([r,e.replies,e.placement,n.labels.quickReplies,n.labels.handoffMoment,i,a,o,n.handoffHosts??null,n.features.LinkHandoff===!0]);if(s===this.#e)return;this.#e=s;let c=this.querySelector(`:scope > .wui-chat-quick-replies:not(.wui-chat-quick-replies--leaving)`);if(!r&&c){this.#t(c);return}if(this.replaceChildren(),!r)return;let l=this.ownerDocument,u=e.placement===`Composer`,d=P(l,`div`,u?`wui-chat-quick-replies wui-chat-quick-replies--composer`:`wui-chat-quick-replies`);d.setAttribute(`role`,`group`),d.setAttribute(`aria-label`,n.labels.quickReplies);let f=u?null:e.replies.find(e=>e.id===`handoff.request`&&e.action===`Send`),p=0;f&&(d.classList.add(`wui-chat-quick-replies--offer`),d.append(this.#n(l,f,n)),p+=1);for(let t of e.replies){if(t===f||t.action===`Open`&&(!t.target||!i))continue;let e=null;if(t.action===`Navigate`){if(n.features.LinkHandoff!==!0)continue;if(xr(t.target,n.handoffHosts))e=t.target;else{let r=t.target===null?null:n.resolveLink?.(t.target);e=typeof r==`string`&&r!==``?r:null}if(e===null){d.append(P(l,`span`,null,t.label));continue}if(!a)continue}d.append(this.#r(l,t,p,n,f?`wui-chat-quick-reply--quiet`:``,e)),p+=1}if(o){let e=P(l,`span`,`visually-hidden`,n.labels.handoffMoment);e.setAttribute(`role`,`status`),d.append(e)}d.childElementCount>0&&this.append(d)}#t(e){e.classList.add(`wui-chat-quick-replies--leaving`);let t=this.ownerDocument.defaultView,n=Number.parseFloat(t?t.getComputedStyle(e).animationDuration:``)*1e3;t===null||!(n>0)?e.remove():t.setTimeout(()=>e.remove(),n)}#n(e,t,n){let r=P(e,`div`,`wui-chat-offer`);return r.style.setProperty(`--wui-chat-i`,`0`),r.append(P(e,`div`,`wui-chat-offer-title`,t.label)),r.append(this.#r(e,{...t,variant:`Primary`},0,n,`wui-chat-offer-action`)),r}#r(e,t,n,r,i=``,a=null){let o=e.createElement(`button`);o.type=`button`,o.className=[`wui-chat-quick-reply`,X4(t.variant),i].filter(Boolean).join(` `),o.style.setProperty(`--wui-chat-i`,String(n));let s=t.action===`Navigate`,c=s&&r.handoffPause===!0;if(o.disabled=c,t.icon){let n=ma(e,t.icon,16);if(n){let t=P(e,`span`,`wui-chat-quick-reply-icon`);t.setAttribute(`aria-hidden`,`true`),t.append(n),o.append(t)}}return o.append(P(e,`span`,`wui-chat-quick-reply-label`,c?r.labels.handoffMoment:t.label)),o.addEventListener(`click`,()=>{if(t.action===`Open`){let{openTarget:e}=this.activeTurn;if(t.target===null||e===void 0)throw Error(`${this.localName} drew an Open chip without a target or openTarget`);e.call(this.activeTurn,t.target)}else if(s){let{beginHandoff:e}=this.activeTurn;if(a===null||e===void 0)throw Error(`${this.localName} drew a Navigate chip without a destination or beginHandoff`);e.call(this.activeTurn,t,()=>this.#i(a))}else this.activeTurn.chooseQuickReply(t),this.closest(`.wui-chat`)?.querySelector(`.wui-chat-input`)?.focus()}),o}#i(e){typeof this.activeTurn.openTarget==`function`?this.activeTurn.openTarget(e):globalThis.location.assign(e)}});var Z4=new Set([`Integer`,`Decimal`,`MoneyMinor`,`Percent`]);function Q4(e){return Z4.has(e)}function $4(e,t,n,r=!0){let i=e=>r?fn(e):[{kind:`text`,text:e}];if(t==null||t===``)return[{kind:`text`,text:Fi()}];if(e===`Date`||e===`DateTimeUtc`)return[{kind:`text`,text:yr(t,e,n)}];if(Q4(e)){let r=Number(t);return i(Number.isFinite(r)?yr(r,e,n):String(t))}return i(String(t))}var e3=0;function t3(e){return e3+=1,`${e}-${e3}`}pa(`wui-chat-part-record-card`,class extends fa{#e=null;renderPart(e,t,n){let r=!!e.target&&typeof n.openRecord==`function`,i=n.features?.FigureText===!0,a=JSON.stringify([e,r,i]);if(a===this.#e)return;this.#e=a;let o=this.ownerDocument,s=P(o,`article`,`wui-chat-record`),c=t3(`wui-chat-record-title`);s.setAttribute(`aria-labelledby`,c);let l=P(o,`div`,`wui-chat-record-head`),u=P(o,`strong`,`wui-chat-record-title`);if(u.id=c,u.setAttribute(`role`,`heading`),u.setAttribute(`aria-level`,`3`),i?m2(u,e.title):u.textContent=String(e.title??``),l.append(u),e.subtitle){let t=P(o,`span`,`wui-chat-record-subtitle`);i?m2(t,e.subtitle):t.textContent=String(e.subtitle??``),l.append(t)}if(s.append(l),e.fields?.length>0){let t=P(o,`dl`,`wui-chat-record-fields`);for(let n of e.fields){let e=P(o,`div`),r=P(o,`dt`);i?m2(r,n.label):r.textContent=String(n.label??``);let a=P(o,`dd`);Q4(n.type)&&(a.className=`wui-chat-num`),p2(a,$4(n.type,n.value,null,i)),e.append(r,a),t.append(e)}s.append(t)}if(r){let t=P(o,`button`,`btn btn-soft-primary btn-sm wui-chat-record-open`,n.labels.recordOpen);t.type=`button`,t.setAttribute(`aria-label`,n.labels.recordOpenFor(h2(e.title))),t.addEventListener(`click`,()=>{let{openRecord:t}=this.activeTurn;if(t===void 0)throw Error(`${this.localName} lost openRecord after it drew the button`);t.call(this.activeTurn,e)}),s.append(t)}this.replaceChildren(s)}});var n3=/^https?:\/\//i;pa(`wui-chat-part-sources`,class extends fa{renderPart(e,t,n){if(this.replaceChildren(),!n.features.Sources||e.sources.length===0)return;let r=this.ownerDocument,i=P(r,`div`,`wui-chat-sources`);i.append(P(r,`p`,`wui-chat-sources-label`,n.labels.sources));let a=P(r,`ul`,`wui-chat-sources-list`);a.setAttribute(`aria-label`,n.labels.sources);for(let t of e.sources){let e=r.createElement(`li`);e.append(this.#e(r,t,n)),a.append(e)}i.append(a),this.append(i)}#e(e,t,n){let r;if(typeof t.url==`string`&&n3.test(t.url)){let i=P(e,`a`,`wui-chat-source`);i.setAttribute(`href`,t.url),i.setAttribute(`target`,`_blank`),i.setAttribute(`rel`,`noopener noreferrer`),i.setAttribute(`aria-label`,n.labels.openSource(t.title)),r=i}else r=P(e,`span`,`wui-chat-source`),r.tabIndex=-1;return r.dataset.marker=String(t.marker),r.append(P(e,`span`,`wui-chat-source-marker`,String(t.marker)),P(e,`span`,`wui-chat-source-title`,t.title)),r}});var r3=25,i3=0;function a3(e,t,n){let r=e.createElement(`tr`);for(let i of t.columns){let t=e.createElement(`th`);t.setAttribute(`scope`,`col`),Q4(i.type)&&(t.className=`wui-chat-num`),n?m2(t,i.label):t.textContent=String(i.label??``),r.append(t)}return r}function o3(e,t,n,r){let i=e.createElement(`tr`);return t.columns.forEach((a,o)=>{let s=o===0&&a.type===`Text`,c=e.createElement(s?`th`:`td`);s&&c.setAttribute(`scope`,`row`),Q4(a.type)&&(c.className=`wui-chat-num`);let l=n[o];l==null||l===``?c.append(P(c.ownerDocument,`span`,`wui-chat-null`,Fi())):p2(c,$4(a.type,l,t.currency,r)),i.append(c)}),i}function s3(e,t){let n=()=>{let n=t.scrollWidth-t.clientWidth;e.dataset.scroll=n<=1?`none`:t.scrollLeft>=n-1?`end`:t.scrollLeft>0?`middle`:`start`};t.addEventListener(`scroll`,n,{passive:!0}),typeof ResizeObserver<`u`&&new ResizeObserver(n).observe(t),n()}function c3(e,t,n,r,i){let a=e.ownerDocument;for(let o of t.rows.slice(n,r))e.append(o3(a,t,o,i))}pa(`wui-chat-part-table`,class extends fa{#e=null;renderPart(e,t,n){let r=n.features?.FigureText===!0,i=JSON.stringify([e,r]);if(i===this.#e)return;if(this.#e=i,!e.columns||e.columns.length===0){this.replaceChildren();return}let a=this.ownerDocument,o=P(a,`figure`,`wui-chat-table`),s=null;if(e.title){i3+=1,s=`wui-chat-table-${i3}`;let t=P(a,`figcaption`,`wui-chat-table-title`);t.id=s,r?m2(t,e.title):t.textContent=String(e.title??``),o.append(t)}let c=P(a,`div`,`table-wrap wui-chat-table-wrap`);c.tabIndex=0,c.setAttribute(`role`,`region`),s?c.setAttribute(`aria-labelledby`,s):c.setAttribute(`aria-label`,n.labels.table);let l=P(a,`table`,`table table-sm wui-chat-table-grid`),u=a.createElement(`thead`);u.append(a3(a,e,r));let d=a.createElement(`tbody`);c3(d,e,0,Math.min(e.rows.length,r3),r),l.append(u,d),c.append(l);let f=P(a,`div`,`wui-chat-table-frame`),p=P(a,`span`,`wui-chat-table-cue`);if(p.setAttribute(`aria-hidden`,`true`),f.append(c,p),o.append(f),s3(f,c),e.rows.length>r3){let t=P(a,`button`,`btn btn-soft-primary btn-sm wui-chat-table-more`,n.labels.tableShowAll(e.rows.length));t.type=`button`,t.addEventListener(`click`,()=>{c3(d,e,r3,e.rows.length,r),t.remove()}),o.append(t)}this.replaceChildren(o)}});var l3=/\[([^[\]\n]+)\](?!\()/g,u3=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`),d3=/\[([^\]\n]+)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,f3=/!\[([^\]\n]*)\]\(((?:[^()\s]|\([^()\s]*\))+)\)/y,p3=new RegExp(l3.source,`y`),m3=e=>/[\p{L}\p{N}]/u.test(e);function h3(e,t){let n=0;for(let r=t-1;r>=0&&e.charAt(r)===`\\`;--r)n+=1;return n%2==1}function g3(e,t,n){let r=n.length===1;for(let i=e.indexOf(n,t);i!==-1;i=e.indexOf(n,i+1)){let a=i>t&&!/\s/.test(e.charAt(t))&&!/\s/.test(e.charAt(i-1)),o=r&&(e.charAt(i+1)===n||e.charAt(i-1)===n),s=n===`_`&&m3(e.charAt(i+n.length));if(a&&!o&&!s&&!h3(e,i))return i}return-1}function _3(e,t){let n=t?.isCitation,r=[],i=``,a=()=>{i&&=(r.push({type:`text`,text:i}),``)},o=0;for(;o<e.length;){let s=e.charAt(o),c=e.charAt(o+1);if(s===`\\`&&u3.has(c)){i+=c,o+=2;continue}if(s==="`"){let t=e.indexOf("`",o+1);if(t>o+1){a(),r.push({type:`code`,text:e.slice(o+1,t)}),o=t+1;continue}}let l=s+c;if(l===`**`||l===`__`||l===`~~`){let n=g3(e,o+2,l);if(n!==-1&&!(l===`__`&&m3(e.charAt(o-1)))){a();let i=_3(e.slice(o+2,n),t);l===`~~`?r.push({type:`strike`,children:i}):r.push({type:`strong`,children:i}),o=n+2;continue}i+=l,o+=2}else{if(s===`*`||s===`_`){let n=g3(e,o+1,s);if(n!==-1&&!(s===`_`&&m3(e.charAt(o-1)))){a(),r.push({type:`em`,children:_3(e.slice(o+1,n),t)}),o=n+1;continue}}if(s===`[`){d3.lastIndex=o;let t=d3.exec(e);if(t){let e=t[1],n=t[2];if(e===void 0||n===void 0)throw Error(`The link pattern always captures its label and href`);a(),r.push({type:`link`,href:n,children:_3(e)}),o+=t[0].length;continue}if(n){p3.lastIndex=o;let t=p3.exec(e);if(t){let e=t[1];if(e===void 0)throw Error(`The citation pattern always captures its inner text`);if(n(e)){a(),r.push({type:`citation`,text:e}),o+=t[0].length;continue}}}}if(s===`!`){f3.lastIndex=o;let t=f3.exec(e);if(t){let e=t[1];if(e===void 0)throw Error(`The image pattern always captures its alt text`);a(),r.push({type:`image`,children:_3(e)}),o+=t[0].length;continue}}i+=s,o+=1}}return a(),r.map((e,t)=>({...e,key:t}))}var v3=/^[a-z][a-z0-9+.-]*:[a-z0-9_-]+\/[a-z0-9_.~-]+$/i,y3=/^https?:/i,b3=/^(mailto|tel):/i,x3=/^(?:\/(?![/\\])|#|\?|\.{1,2}\/)/,S3=/^https:\/\/[^/?#@\\\s]+$/i,C3=/^[a-z][a-z0-9+.-]*:/i;function w3(e){if(typeof e!=`string`)return null;let t=e.endsWith(`/`)?e.slice(0,-1):e;return S3.test(t)?t:null}function T3(e,t,n,r,i){if(n&&(t===`page`||v3.test(e))){let t=n(e);if(t!=null)return{kind:`app`,target:t}}if(t===`app`)return null;let a=i==null?null:w3(i),o=a===null?e:E3(e,a);return o===null?null:x3.test(o)?{kind:`page`,href:o}:t===`page`&&!(y3.test(o)&&r&&O3(o,r))?null:y3.test(o)?{kind:r&&O3(o,r)?`page`:`web`,href:o}:b3.test(o)?{kind:`contact`,href:o}:null}function E3(e,t){if(C3.test(e))return e;if(e.startsWith(`//`))return`https:${e}`;if(e===``)return null;let n=e.indexOf(`#`),r=n<0?``:e.slice(n),i=n<0?e:e.slice(0,n),a=i.indexOf(`?`),o=a<0?i:i.slice(0,a),s=a<0?``:i.slice(a);return o===``?`${t}${s}${r}`:`${t}${D3(o.startsWith(`/`)?o:`/${o}`)}${s}${r}`}function D3(e){let t=e.split(`/`),n=[];return t.forEach((e,r)=>{let i=r===t.length-1;e===`.`?i&&n.push(``):e===`..`?(n.length>1&&n.pop(),i&&n.push(``)):n.push(e)}),n.join(`/`)}function O3(e,t){if(e.slice(0,t.length).toLowerCase()!==t.toLowerCase())return!1;let n=e[t.length];return n===void 0||n===`/`||n===`?`||n===`#`}function k3(e){return typeof e!=`string`||!e.startsWith(`/`)||e[1]===`/`||e[1]===`\\`?null:e}var A3=/^\s*```/,j3=/^\s*```\s*(\S*)/,M3=/^\s{0,3}(#{1,6})\s+(.*?)(?:\s+#+)?\s*$/,N3=/^\s*([-*_])(\s*\1){2,}\s*$/,P3=/^(\s*)[-*+]\s+(.*)$/,F3=/^(\s*)(\d{1,9})[.)]\s+(.*)$/,I3=/^\s*>\s?(.*)$/,L3=/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)*\|?\s*$/,R3=[1,2,3,4,5,6],z3=e=>e.includes(`|`);function B3(e){let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())}function V3(e,t){let n=e[t];if(n===void 0)throw Error(`startsTable was called past the last source line`);let r=e[t+1];return r!==void 0&&z3(n)&&r.includes(`|`)&&L3.test(r)}function H3(e,t){let n=e[t];if(n===void 0)throw Error(`startsBlock was called past the last source line`);return A3.test(n)||I3.test(n)||P3.test(n)||F3.test(n)||M3.test(n)||N3.test(n)||V3(e,t)}function U3(e){let t=e.replace(/\t/g,` `).length;return Math.min(Math.floor(t/2),4)}function W3(e){let t=F3.exec(e);if(t){let e=t[1],n=t[2],r=t[3];if(e===void 0||n===void 0||r===void 0)throw Error(`The ordered list pattern always captures its indent, number and text`);return{text:r,depth:U3(e),ordered:!0,number:Number(n)}}let n=P3.exec(e);if(n){let e=n[1],t=n[2];if(e===void 0||t===void 0)throw Error(`The bullet list pattern always captures its indent and text`);return{text:t,depth:U3(e),ordered:!1,number:0}}return null}function G3(e){let t=(e??``).replace(/\r\n?/g,`
42
42
  `).split(`
43
43
  `),n=[],r=0;for(;r<t.length;){let e=t[r];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(!e.trim()){r+=1;continue}if(A3.test(e)){let i=j3.exec(e)?.[1]||null,a=[];for(r+=1;r<t.length;){let e=t[r];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(A3.test(e))break;a.push(e),r+=1}r+=1,n.push({type:`code`,text:a.join(`
44
44
  `),language:i});continue}if(V3(t,r)){let i=B3(e),a=[];for(r+=2;r<t.length;){let e=t[r];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(!e.trim()||!z3(e))break;a.push(B3(e)),r+=1}n.push({type:`table`,header:i,rows:a});continue}if(N3.test(e)){n.push({type:`rule`}),r+=1;continue}let i=M3.exec(e);if(i){let e=i[1],t=i[2];if(e===void 0||t===void 0)throw Error(`The heading pattern always captures its hashes and text`);let a=R3[e.length-1];if(a===void 0)throw Error(`The heading pattern always captures one to six hashes`);n.push({type:`heading`,level:a,text:t}),r+=1;continue}if(I3.test(e)){let e=[];for(;r<t.length;){let n=t[r];if(n===void 0)throw Error(`parseMarkdown read past the last source line`);let i=I3.exec(n);if(!i)break;let a=i[1];if(a===void 0)throw Error(`The quote pattern always captures its text`);e.push(a),r+=1}n.push({type:`quote`,lines:e});continue}let a=W3(e);if(a){let e=[];for(;r<t.length;){let n=t[r];if(n===void 0)throw Error(`parseMarkdown read past the last source line`);if(!n.trim())break;let i=W3(n);if(i){if(i.depth===0&&i.ordered!==a.ordered)break;e.push(i)}else if(H3(t,r))break;else{let t=e[e.length-1];if(t===void 0)throw Error(`A list continuation line follows a list with no item`);t.text+=` ${n.trim()}`}r+=1}n.push({type:`list`,ordered:a.ordered,start:a.ordered?a.number:1,items:e});continue}let o=[e];for(r+=1;r<t.length;){let e=t[r];if(e===void 0)throw Error(`parseMarkdown read past the last source line`);if(!e.trim()||H3(t,r))break;o.push(e),r+=1}n.push({type:`paragraph`,lines:o})}return n.map((e,t)=>({...e,key:t}))}var K3=[`text`,`json`,`js`,`cs`,`sql`,`bash`,`http`,`html`,`razor`,`css`],q3=[`razor`,`cshtml`],J3=[`app`,`web`,`page`],Y3=e=>e!==void 0&&J3.includes(e);function X3(e,t,n,r,i=null){let a=Z3(e.ownerDocument,n,r).map((e,n)=>{let r=t[n],i=r?.sig===e.sig?r.nodes:null;return{sig:e.sig,nodes:i??e.build()}}),o=new Set(a.flatMap(e=>e.nodes));for(let e of t)for(let t of e.nodes)o.has(t)||t.parentNode?.removeChild(t);let s=i;for(let t of a.flatMap(e=>e.nodes))(t.parentNode!==e||t.previousSibling!==s)&&e.insertBefore(t,s?s.nextSibling:e.firstChild),s=t;return a}function Z3(e,t,n){let r={doc:e,links:Y3(n.links)?n.links:`web`,headings:n.headings===`text`?`text`:`outline`,resolveLink:n.resolveLink,isCitation:n.isCitation,figureText:typeof n.figureText==`function`?n.figureText:void 0,base:typeof n.base==`string`?n.base:void 0},i=n.resolverGeneration??0;return G3(t).map(e=>({sig:`${JSON.stringify(e)}|${r.links}|${r.headings}|${r.base??``}|${i}`,build:()=>e6(r,e)}))}var Q3=class extends p4{_drawn;_blocks;_observer;_connected;_resolveLink;_isCitation;_resolverGeneration;_figureText;static get observedAttributes(){return[`links`,`headings`,`base`]}constructor(){super(),this._drawn=[],this._blocks=[],this._observer=null,this._connected=!1,this._resolveLink=void 0,this._isCitation=void 0,this._resolverGeneration=0,this._figureText=void 0}connectedCallback(){this._connected=!0,this._render(),typeof MutationObserver<`u`&&(this._observer=new MutationObserver(e=>{e.some(e=>!this._drawn.some(t=>t.contains(e.target)))&&this._render()}),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0}))}disconnectedCallback(){this._connected=!1,this._observer?.disconnect(),this._observer=null}get resolveLink(){return this._resolveLink}set resolveLink(e){this._resolveLink=typeof e==`function`?e:void 0,this._resolverGeneration+=1,this._connected&&this._render()}get base(){return this.getAttribute(`base`)??void 0}set base(e){e==null?this.removeAttribute(`base`):this.setAttribute(`base`,String(e))}get isCitation(){return this._isCitation}set isCitation(e){this._isCitation=typeof e==`function`?e:void 0,this._resolverGeneration+=1,this._connected&&this._render()}get figureText(){return this._figureText}set figureText(e){this._figureText=typeof e==`function`?e:void 0,this._resolverGeneration+=1,this._connected&&this._render()}attributeChangedCallback(e,t,n){t!==n&&this._connected&&this._render()}_source(){return Array.from(this.children).find(e=>e instanceof HTMLPreElement&&e.classList.contains(`wui-markdown-source`))}_render(){let e=this._source();e&&(this._blocks=X3(this,this._blocks,e.textContent??``,{links:this.getAttribute(`links`)??void 0,headings:this.getAttribute(`headings`)??void 0,base:this.getAttribute(`base`)??void 0,resolveLink:this._resolveLink,isCitation:this._isCitation,figureText:this._figureText,resolverGeneration:this._resolverGeneration},e),this._drawn=this._blocks.flatMap(e=>e.nodes),e.hidden=!0,this._observer?.takeRecords())}};function $3(e,t,n=[]){let r=e.createElement(t);return r.append(...n),r}function e6(e,t){switch(t.type){case`paragraph`:return[$3(e.doc,`p`,t6(e,t.lines))];case`heading`:return[n6(e,t)];case`list`:return r6(e,t.items);case`table`:return[a6(e,t)];case`code`:return[s6(e.doc,t)];case`quote`:return[$3(e.doc,`blockquote`,t6(e,t.lines))];case`rule`:return[e.doc.createElement(`hr`)];default:return[]}}function t6(e,t){let n=[];return t.forEach((t,r)=>{r>0&&n.push(e.doc.createElement(`br`)),n.push(...c6(e,t))}),n}function n6(e,t){let n=c6(e,t.text);if(e.headings===`text`){let t=$3(e.doc,`p`,n);return t.className=`fw-semibold`,t}return $3(e.doc,`h2`,n)}function r6(e,t){let n=[];for(let r=0;r<t.length;){let i=i6(e,t,r);n.push(i.list),r=i.next}return n}function i6(e,t,n){let r=t[n];if(!r)throw Error(`List run starts past its items.`);let{depth:i,ordered:a,number:o}=r,s=e.doc.createElement(a?`ol`:`ul`);a&&o!==1&&s.setAttribute(`start`,String(o));let c=null,l=n,u=t[l];for(;u&&u.depth>=i;){if(u.depth===i)c=$3(e.doc,`li`,c6(e,u.text)),s.append(c),l+=1;else{let n=i6(e,t,l);if(!c)throw Error(`Nested list has no item before it.`);c.append(n.list),l=n.next}u=t[l]}return{list:s,next:l}}function a6(e,t){let n=t.header.map(t=>{let n=$3(e.doc,`th`,c6(e,t));return n.setAttribute(`scope`,`col`),n}),r=t.rows.map(n=>$3(e.doc,`tr`,t.header.map((t,r)=>$3(e.doc,`td`,c6(e,n[r]??``))))),i=$3(e.doc,`table`,[$3(e.doc,`thead`,[$3(e.doc,`tr`,n)]),$3(e.doc,`tbody`,r)]);i.className=`table`;let a=$3(e.doc,`div`,[i]);return a.className=`table-responsive`,a}function o6(e){return e===null?`text`:q3.includes(e.toLowerCase())?`razor`:K3.includes(e)?e:`text`}function s6(e,t){let n=$3(e,`pre`,[$3(e,`code`,[e.createTextNode(t.text)])]);n.className=`wui-code-source`;let r=$3(e,`wui-code-block`,[n]);return r.className=`wui-code-block`,r.setAttribute(`language`,o6(t.language)),r}function c6(e,t){return l6(e,_3(t,{isCitation:e.isCitation}))}function l6(e,t){return t.flatMap(t=>u6(e,t))}function u6(e,t){let{doc:n}=e;switch(t.type){case`code`:return[$3(n,`code`,[n.createTextNode(t.text)])];case`strong`:return[$3(n,`strong`,l6(e,t.children))];case`em`:return[$3(n,`em`,l6(e,t.children))];case`strike`:return[$3(n,`del`,l6(e,t.children))];case`image`:return[n.createTextNode(`[`),...l6(e,t.children),n.createTextNode(`]`)];case`link`:return d6(e,t);case`citation`:return[p6(n,t.text)];case`text`:return e.figureText?f6(e,e.figureText,t.text):[n.createTextNode(t.text)];default:throw Error(`wui-markdown: unknown inline token ${JSON.stringify(t)}`)}}function d6(e,t){let n=l6(e,t.children),r=T3(t.href,e.links,e.resolveLink,globalThis.location?.origin,e.base);if(!r)return n;if(r.kind===`app`){let t=k3(r.target);return t?[m6(e.doc,t,n,!1)]:n}return[m6(e.doc,r.href,n,r.kind===`web`)]}function f6(e,t,n){return t(n).map(t=>t.kind===`sub`||t.kind===`sup`?$3(e.doc,t.kind,[e.doc.createTextNode(t.text)]):e.doc.createTextNode(t.text))}function p6(e,t){let n=e.createElement(`span`);n.className=`chip primary chip-outline chip-sm chip-clickable wui-markdown-citation`,n.setAttribute(`data-wui`,`AppChip`);let r=e.createElement(`button`);r.type=`button`,r.className=`chip-body`,r.setAttribute(`aria-label`,t),r.addEventListener(`click`,()=>{r.dispatchEvent(new CustomEvent(`wui-markdown-citation`,{bubbles:!0,detail:{citation:t}}))});let i=e.createElement(`span`);return i.className=`chip-label`,i.textContent=t,r.append(i),n.append(r),n}function m6(e,t,n,r){let i=$3(e,`span`,n);i.className=`wui-link__label`;let a=$3(e,`a`,[i]);return a.className=`wui-link wui-link--static`,a.setAttribute(`data-wui`,`AppLink`),a.setAttribute(`href`,t),r&&(a.setAttribute(`target`,`_blank`),a.setAttribute(`rel`,`noopener noreferrer`)),a}d4(`wui-markdown`,Q3);var h6=`AppButton`,g6=new Set([`primary`,`success`,`warning`,`danger`,`info`,`neutral`]),_6={solid:e=>`btn-${e}`,soft:e=>`btn-soft-${e}`,outline:e=>`btn-outline-${e}`,ghost:e=>`btn-ghost-${e}`,link:e=>`btn-link-${e}`,glass:()=>`btn-glass`};function v6(e){return Object.hasOwn(_6,e)}function y6(e=`primary`,t=`solid`,n=`md`){if(!g6.has(e))throw RangeError(`buttonClass: unknown tone "${e}"`);if(!v6(t))throw RangeError(`buttonClass: unknown variant "${t}"`);let r=_6[t](e);return n===`md`?`btn ${r}`:`btn ${r} btn-${n}`}var b6={copiedLabel:`Copied`,copyLabel:`Copy`,label:`Code`};Object.freeze([`text`,`json`,`js`,`cs`,`sql`,`bash`,`http`,`html`,`razor`,`css`]);var x6=Object.freeze({text:``,json:`JSON`,js:`JavaScript`,cs:`C#`,sql:`SQL`,bash:`Bash`,http:`HTTP`,html:`HTML`,razor:`Razor`,css:`CSS`}),S6=e=>RegExp(`\\b(?:${e.join(`|`)})\\b`),C6=`(?![\\s\\S])`,w6=RegExp(`/\\*[\\s\\S]*?(?:\\*/|${C6})`).source,T6=[[`attr`,/"(?:[^"\\\n]|\\.)*"(?=\s*:)/],[`string`,/"(?:[^"\\\n]|\\.)*"?/],[`number`,/-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b/],[`literal`,S6([`true`,`false`,`null`])],[`punct`,/[{}[\],:]/]],E6=[[`comment`,RegExp(`//[^\\n]*|${w6}`)],[`string`,/"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?|`(?:[^`\\]|\\[\s\S])*`?/],[`number`,/\b(?:0[xX][\da-fA-F_]+|\d[\d_]*\.?\d*(?:[eE][+-]?\d+)?n?)\b/],[`keyword`,S6(`async.await.break.case.catch.class.const.continue.default.delete.do.else.export.extends.finally.for.from.function.if.import.in.instanceof.let.new.of.return.static.super.switch.this.throw.try.typeof.var.void.while.yield`.split(`.`))],[`literal`,S6([`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`])],[`function`,/(?<![\w$])[A-Za-z_$][\w$]*(?=\s*\()/],[`type`,/(?<![\w$])[A-Z][\w$]*/],[`punct`,/[{}()[\];,]/]],D6=[[`comment`,RegExp(`//[^\\n]*|${w6}`)],[`string`,/@"(?:[^"]|"")*"?|\$@?"(?:[^"\\\n]|\\.)*"?|"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?/],[`number`,/\b\d[\d_]*\.?\d*(?:[eE][+-]?\d+)?[fFdDmMlLuU]{0,2}\b/],[`keyword`,S6(`abstract.as.async.await.base.bool.break.byte.case.catch.char.checked.class.const.continue.decimal.default.delegate.do.double.else.enum.event.explicit.extern.finally.fixed.float.for.foreach.get.goto.if.implicit.in.init.int.interface.internal.is.lock.long.namespace.new.object.operator.out.override.params.private.protected.public.readonly.record.ref.required.return.sbyte.sealed.set.short.sizeof.static.string.struct.switch.this.throw.try.typeof.uint.ulong.unchecked.unsafe.ushort.using.var.virtual.void.volatile.when.while.with`.split(`.`))],[`literal`,S6([`true`,`false`,`null`])],[`function`,/(?<!\w)[A-Za-z_]\w*(?=\s*\()/],[`type`,/(?<!\w)[A-Z]\w*/],[`punct`,/[{}()[\];,]/]],O6=[[`comment`,RegExp(`--[^\\n]*|${w6}`)],[`string`,/'(?:[^']|'')*'?/],[`variable`,/@@?\w+/],[`number`,/\b\d+(?:\.\d+)?\b/],[`keyword`,S6(`add.all.alter.and.as.asc.begin.between.by.case.check.column.commit.constraint.create.cross.database.declare.default.delete.desc.distinct.drop.else.end.exec.execute.exists.foreign.from.full.function.group.having.if.in.index.inner.insert.into.is.join.key.left.like.limit.not.null.offset.on.or.order.outer.over.partition.primary.procedure.references.return.returns.right.rollback.select.set.table.then.top.transaction.union.unique.update.values.view.when.where.while.with`.split(`.`))],[`literal`,S6([`true`,`false`])],[`type`,S6([`bigint`,`bit`,`char`,`date`,`datetime`,`datetime2`,`decimal`,`float`,`int`,`money`,`nchar`,`numeric`,`nvarchar`,`real`,`smallint`,`text`,`time`,`tinyint`,`uniqueidentifier`,`varchar`])],[`function`,/\b[A-Za-z_]\w*(?=\s*\()/],[`punct`,/[(),;]/]],k6=[[`comment`,/(?<![^\s;|&(])#[^\n]*/],[`string`,/"(?:[^"\\]|\\[\s\S])*"?|'[^']*'?/],[`variable`,/\$(?:\{[^}\n]*\}?|[A-Za-z_]\w*|[0-9@#?$!*-])/],[`attr`,/(?<![\w-])--?[A-Za-z][\w-]*/],[`number`,/(?<![\w.-])\d+(?:\.\d+)?\b/],[`keyword`,S6([`case`,`do`,`done`,`elif`,`else`,`esac`,`exit`,`export`,`fi`,`for`,`function`,`if`,`in`,`local`,`return`,`select`,`then`,`until`,`while`])],[`function`,S6(`awk.az.cat.cd.chmod.chown.cp.curl.docker.dotnet.echo.gcloud.git.grep.kubectl.ls.mkdir.mv.npm.npx.pnpm.rm.sed.source.sudo.wget`.split(`.`))],[`punct`,/[|&;<>(){}[\]]+/]],A6=[[`comment`,/^#[^\n]*/m],[`keyword`,/^(?:GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS|TRACE|CONNECT)(?= )/m],[`literal`,/HTTP\/\d(?:\.\d)?/],[`number`,/(?<=^HTTP\/\d(?:\.\d)? )\d{3}\b/m],[`function`,/(?<=^[A-Z]+ )\S+/m],[`attr`,/^[A-Za-z][\w-]*(?=:)/m],[`string`,/(?<=^[A-Za-z][\w-]*:[ \t]*)[^\n]+/m]],j6=[[`comment`,RegExp(`<!--[\\s\\S]*?(?:-->|${C6})`)],[`keyword`,/<![A-Za-z][^>]*>?/],[`tag`,/<\/?[A-Za-z][^<>]*>?/],[`literal`,/&#?\w+;/]],M6={json:T6,js:E6,cs:D6,sql:O6,bash:k6,http:A6,css:[[`comment`,new RegExp(w6)],[`string`,/"(?:[^"\\\n]|\\.)*"?|'(?:[^'\\\n]|\\.)*'?/],[`keyword`,/@[\w-]+|!important/],[`attr`,/[\w-]+(?=\s*:[^{};]*[;}])/],[`number`,/#[0-9a-fA-F]{3,8}\b|(?<![\w-])-?(?:\d+\.?\d*|\.\d+)(?:%|[A-Za-z]{1,4})?/],[`function`,/[\w-]+(?=\()/],[`type`,/[.#](?!\d)[A-Za-z_][\w-]*/],[`punct`,/[{}();:,]/]],html:j6,htmlTag:[[`tag`,/^<\/?[\w:.-]+/],[`string`,/"[^"]*"?|'[^']*'?/],[`attr`,/(?<=\s)[^\s=<>/"']+/],[`punct`,/\/?>|=/]]},N6=e=>Object.hasOwn(M6,e),P6=new Map;function F6(e){let t=P6.get(e);if(!t){let n=M6[e],r=e===`sql`?`gi`:`g`,i=n.map(([,e])=>`(${e.source})`).join(`|`);t={re:new RegExp(i,`${r}m`),types:n.map(([e])=>e)},P6.set(e,t)}return t}function I6(e,t,n){if(!n)return;let r=e[e.length-1];r&&r[0]===t?r[1]+=n:e.push([t,n])}function L6(e,t,n=[]){let{re:r,types:i}=F6(e),a=0;for(let o of t.matchAll(r)){let r=o[0];if(!r)continue;I6(n,`plain`,t.slice(a,o.index));let s=i.findIndex((e,t)=>o[t+1]!==void 0);e===`html`&&i[s]===`tag`?L6(`htmlTag`,r,n):I6(n,i[s]??`plain`,r),a=o.index+r.length}return I6(n,`plain`,t.slice(a)),n}function R6(e){let t=/\r?\n\r?\n/.exec(e);if(!t)return L6(`http`,e);let n=t[0]??``,r=L6(`http`,e.slice(0,t.index+n.length)),i=e.slice(t.index+n.length),a=i.trimStart()[0];return a===`{`||a===`[`?L6(`json`,i,r):a===`<`?L6(`html`,i,r):(I6(r,`plain`,i),r)}function z6(e,t){let n=String(e??``);if(!n||n.length>1e5)return n?[[`plain`,n]]:[];if(t===`http`)return R6(n);let r=t===`razor`?`html`:t;return!N6(r)||r===`htmlTag`?[[`plain`,n]]:L6(r,n)}function B6(e,t){let n=[],r=[n];for(let[i,a]of z6(e,t))a.split(/\r\n|\r|\n/).forEach((e,t)=>{t>0&&(n=[],r.push(n)),e&&n.push([i,e])});return r.length>1&&n.length===0&&r.pop(),r}var V6=()=>Ti(`codeBlock`,b6);function H6(e){return Object.hasOwn(x6,e)}var U6=class extends p4{_title;_view;_codeEl;_copyIcon;_copyText;_chrome=null;_copied=!1;_observer=null;_timer=0;_cancelFrame=null;constructor(){super();let e=this.ownerDocument;this._title=e.createElement(`span`),this._title.className=`wui-code-title`,this._view=e.createElement(`div`),this._codeEl=e.createElement(`code`),this._copyIcon=e.createElement(`span`),this._copyIcon.className=`wui-code-copy-icon`,this._copyText=e.createElement(`span`)}static get observedAttributes(){return[`language`,`line-numbers`,`wrap`,`label`,`copy-label`,`copied-label`]}connectedCallback(){this._render(),typeof MutationObserver<`u`&&(this._observer=new MutationObserver(e=>{e.some(e=>!this._chrome?.contains(e.target))&&this._schedule()}),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0}))}disconnectedCallback(){this._observer?.disconnect(),this._observer=null,this._cancelPending()}attributeChangedCallback(){this.isConnected&&this._render()}_source(){return Array.from(this.children).find(e=>e.classList.contains(`wui-code-source`))}_code(){return(this._source()?.textContent??``).replace(/\r?\n$/,``)}_schedule(){if(this._cancelFrame)return;let e=()=>{this._cancelFrame=null,this._render()};if(typeof requestAnimationFrame==`function`){let t=requestAnimationFrame(e);this._cancelFrame=()=>cancelAnimationFrame(t)}else{let t=!0;queueMicrotask(()=>{t&&e()}),this._cancelFrame=()=>{t=!1}}}_cancelPending(){this._cancelFrame?.(),this._cancelFrame=null}_render(){if(!this._source())return;this._cancelPending();let e=this.ownerDocument;this._chrome||this._build(e);let t=this.getAttribute(`language`),n=t!==null&&H6(t)?t:`text`,r=this.getAttribute(`label`)||``,i=B6(this._code(),n);this._title.textContent=r||x6[n],this._view.setAttribute(`aria-label`,r||V6().label),this._view.style.setProperty(`--wui-code-digits`,String(String(i.length).length)),this._codeEl.replaceChildren(...i.map(t=>W6(e,t))),this._copied||(this._copyText.textContent=this._copyLabel()),this.setAttribute(`data-wui-ready`,``),this._observer?.takeRecords()}_build(e){let t=e.createElement(`div`);t.className=`wui-code-chrome`,t.append(this._bar(e));let n=this._view;n.className=`wui-code-view`,n.setAttribute(`role`,`region`),n.tabIndex=0;let r=e.createElement(`pre`);r.className=`wui-code-pre`,r.append(this._codeEl),n.append(r),t.append(n),this._chrome=t,this.append(t)}_bar(e){let t=e.createElement(`div`);t.className=`wui-code-bar`;let n=e.createElement(`button`);return n.type=`button`,n.className=`${y6(`primary`,`ghost`,`sm`)} wui-code-copy`,n.dataset.wui=h6,n.setAttribute(`aria-live`,`polite`),this._setCopied(!1),n.append(this._copyIcon,this._copyText),n.addEventListener(`click`,async()=>{await Mi(this._code())&&(this._setCopied(!0),clearTimeout(this._timer),this._timer=window.setTimeout(()=>this._setCopied(!1),2e3))}),t.append(this._title,n),t}_setCopied(e){this._copied=e,this._copyIcon.innerHTML=Ki(e?`check`:`files`,{size:14}),this._copyText.textContent=this._copyLabel()}_copyLabel(){return this._copied?this.getAttribute(`copied-label`)||V6().copiedLabel:this.getAttribute(`copy-label`)||V6().copyLabel}};function W6(e,t){let n=e.createElement(`span`);n.className=`wui-code-line`;for(let[r,i]of t){if(r===`plain`){n.append(i);continue}let t=e.createElement(`span`);t.className=`wui-code-t-${r}`,t.textContent=i,n.append(t)}return n}d4(`wui-code-block`,U6);var G6=new Set([`Visitor`,`Customer`]),K6=/^\d+$/;function q6(e,t){return e?.features?.Sources===!0?typeof e?.isCitation==`function`?e.isCitation(t):K6.test(t):!1}function J6(e,t){if(xr(e,t?.handoffHosts))return e;let n=t?.resolveLink?.(e);return typeof n==`string`&&n!==``?n:null}function Y6(e,t){let n=globalThis.location?.origin;for(let r of e.querySelectorAll(`a[href]`)){let e=r.dataset.linkSource??r.getAttribute(`href`)??``;r.dataset.linkSource=e;let i=J6(e,t);i===null?r.replaceWith(r.ownerDocument.createTextNode(r.textContent??``)):(i!==r.getAttribute(`href`)&&r.setAttribute(`href`,i),jn(i,`web`,void 0,n)?.kind===`web`?(r.setAttribute(`target`,`_blank`),r.setAttribute(`rel`,`noopener noreferrer`)):(r.removeAttribute(`target`),r.removeAttribute(`rel`)))}}function X6(e,t){Y6(e,t)}pa(`wui-chat-part-text`,class extends fa{#e=null;#t=null;#n=!1;#r=null;constructor(){super(),this.addEventListener(`wui-markdown-citation`,e=>{let t=this.turn;typeof t?.openCitation==`function`&&t.openCitation(Number(e.detail.citation))}),this.addEventListener(`click`,e=>this.#a(e))}renderPart(e,t,n){let r=G6.has(t.author.kind)?`plain`:`markdown`,i=this.#e;if((i===null||i.mode!==r)&&(i=r===`plain`?{mode:r,node:this.#s()}:this.#c(e.text),this.#e=i,this.#t=null,this.replaceChildren(i.node)),i.mode===`plain`){let t=this.turn?.features?.FigureText===!0,n=JSON.stringify([e.text,t]);n!==this.#t&&(this.#t=n,i.node.replaceChildren(),t?p2(i.node,fn(e.text)):i.node.append(this.ownerDocument.createTextNode(e.text)))}else this.#o(i.node),i.source.textContent!==e.text&&(i.source.textContent=e.text);this.toggleAttribute(`data-streaming`,t.streaming===!0),this.#n||(this.#n=!0,this.closest(`[data-restored]`)||this.classList.add(`wui-chat-part-enter`)),this.#i()}disposePart(){this.#r?.disconnect(),this.#r=null}#i(){this.#r||(this.#r=new MutationObserver(()=>X6(this,this.turn)),this.#r.observe(this,{childList:!0,subtree:!0,characterData:!0}),X6(this,this.turn))}#a(e){let t=e.target instanceof Element?e.target.closest(`a[href]`):null,n=this.turn;if(!t||!this.contains(t))return;let r=t.getAttribute(`href`)??``;r.startsWith(`#`)||(r.startsWith(`/`)&&typeof n?.onNavigate==`function`?(e.preventDefault(),n.onNavigate(r)):typeof n?.openTarget==`function`&&(e.preventDefault(),n.openTarget(r)))}#o(e){let t=this.turn?.features?.FigureText===!0?fn:void 0;e.figureText!==t&&(e.figureText=t)}#s(){return P(this.ownerDocument,`div`,`wui-chat-bubble`)}#c(e){let t=this.ownerDocument,n=P(t,`wui-markdown`,`wui-markdown wui-chat-text`);n.setAttribute(`links`,`web`),n.setAttribute(`headings`,`text`),n.isCitation=e=>q6(this.turn,e);let r=P(t,`pre`,`wui-markdown-source`,e);return n.append(r),{mode:`markdown`,node:n,source:r}}}),pa(`wui-chat-part-ticket`,class extends fa{renderPart(e,t,n){let{labels:r}=n,i=$(`article`,`wui-chat-ticket`,{"aria-label":r.ticketAria(e.number)}),a=$(`div`,`wui-chat-ticket-head`),o=$(`span`,`wui-chat-ticket-number`);o.textContent=r.ticketAria(e.number),a.append(o);let s=$2(e.status);if(s!==null){let t=$(`span`,`wui-chat-ticket-badge wui-chat-ticket-badge--${s}`);t.textContent=e4(e.status,r),a.append(t)}let c=$(`strong`,`wui-chat-ticket-title`);if(c.textContent=e.subject,i.append(a,c),typeof n.openTicket==`function`){let t=$(`div`,`wui-chat-ticket-foot`),a=$(`button`,`wui-chat-ticket-link`,{type:`button`});a.textContent=r.ticketView,a.addEventListener(`click`,()=>{let{openTicket:t}=n;if(t===void 0)throw Error(`${this.localName} lost openTicket after it drew the link`);t.call(n,{ticketId:e.ticketId,number:e.number})}),t.append(a),i.append(t)}this.replaceChildren(i)}});var Z6=`http://www.w3.org/2000/svg`,Q6={mic:`M12 15a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.92V21h2v-2.08A7 7 0 0 0 19 12z`,stop:`M6 6h12v12H6z`,play:`M8 5v14l11-7z`,pause:`M6 5h4v14H6zm8 0h4v14h-4z`,speaker:`M3 9v6h4l5 5V4L7 9H3zm13.5 3a4.5 4.5 0 0 0-2.5-4v8a4.5 4.5 0 0 0 2.5-4zM14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6z`};function $6(e,t=18){if(!Object.hasOwn(Q6,e))throw Error(`Unknown voice icon "${e}".`);let n=document.createElementNS(Z6,`svg`);n.setAttribute(`viewBox`,`0 0 24 24`),n.setAttribute(`width`,String(t)),n.setAttribute(`height`,String(t)),n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`focusable`,`false`),n.setAttribute(`fill`,`currentColor`);let r=document.createElementNS(Z6,`path`);return r.setAttribute(`d`,Q6[e]),n.append(r),n}var e8=40,t8=null;function n8(e){let t=P(document,`span`,`wui-chat-clip-bar`);return t.style.setProperty(`--wui-chat-bar-height`,`${Math.round(e*100)}%`),t}function r8(e,t){e.replaceChildren(...vi(t,e8).map(n8))}pa(`wui-chat-part-voice-clip`,class extends fa{#e=null;#t=!1;#n=0;#r=0;#i=!1;#a=null;#o=null;#s=null;#c=0;#l=!1;renderPart(e,t,n){if(!n.features.VoiceClips){this.#u(e.transcript);return}let r=this.#e??this.#d(e.attachmentId);e.attachmentId!==r.attachmentId&&(this.disposePart(),r.attachmentId=e.attachmentId,this.#r=0,r8(r.wave,e.attachmentId)),this.#n=e.durationMs,this.#f(r,e)}disposePart(){this.#c+=1,this.#a?.pause(),this.#s!==null&&URL.revokeObjectURL(this.#s),t8===this&&(t8=null),this.#a=null,this.#o=null,this.#s=null,this.#i=!1}#u(e){if(this.disposePart(),this.#e=null,typeof e==`string`&&e!==``){let t=P(document,`p`,`wui-chat-clip-transcript`);t.textContent=e,this.replaceChildren(t)}else this.replaceChildren()}#d(e){let t=P(document,`div`,`wui-chat-clip`);t.setAttribute(`role`,`group`);let n=P(document,`div`,`wui-chat-clip-row`),r=P(document,`button`,`wui-chat-clip-play`);r.type=`button`;let i=P(document,`div`,`wui-chat-clip-wave`);i.setAttribute(`aria-hidden`,`true`);let a=P(document,`span`,`wui-chat-clip-time`);n.append(r,i,a);let o=P(document,`p`,`wui-chat-clip-error`);o.setAttribute(`role`,`status`),o.hidden=!0,t.append(n,o);let s={attachmentId:e,root:t,play:r,wave:i,time:a,error:o,transcript:null};return r.addEventListener(`click`,()=>this.#C(s)),r8(i,e),this.#e=s,this.replaceChildren(t),s}#f(e,t){let n=this.activeTurn.labels;e.root.setAttribute(`aria-label`,n.voiceClip),e.play.disabled=this.#l||typeof this.activeTurn.readAttachment!=`function`,this.#p(e),this.#m(e),this.#h(e,t.transcript)}#p(e){let t=this.activeTurn.labels,n=this.#i?t.voiceClipPause:t.voiceClipPlay;e.play.setAttribute(`aria-label`,n),e.play.title=n,e.play.replaceChildren($6(this.#i?`pause`:`play`,18))}#m(e){let t=this.#n/1e3,n=t>0?Math.min(1,this.#r/t):0,r=Math.floor(n*e8);[...e.wave.children].forEach((e,t)=>{e.classList.toggle(`wui-chat-clip-bar--played`,t<r)});let i=yi(Math.max(1,Math.round(t)));e.time.textContent=this.activeTurn.labels.voiceClipTime(yi(this.#r),i)}#h(e,t){if(typeof t!=`string`||t===``){e.transcript?.toggle.remove(),e.transcript?.text.remove(),e.transcript=null;return}let n=e.transcript??this.#g(e);n.text.textContent=t,this.#_(n)}#g(e){let t=P(document,`button`,`wui-chat-clip-toggle`);t.type=`button`;let n=P(document,`p`,`wui-chat-clip-transcript`);n.hidden=!this.#t;let r={toggle:t,text:n};return t.addEventListener(`click`,()=>{this.#t=!this.#t,n.hidden=!this.#t,this.#_(r)}),e.transcript=r,e.root.append(t,n),r}#_(e){let t=this.activeTurn.labels;e.toggle.setAttribute(`aria-expanded`,String(this.#t)),e.toggle.textContent=this.#t?t.voiceClipHideTranscript:t.voiceClipShowTranscript}#v(e){return this.#o??=this.#y(e).catch(e=>{throw this.#o=null,e}),this.#o}async#y(e){let t=this.#c,{readAttachment:n}=this.activeTurn;if(n===void 0)throw Error(`${this.localName} loaded a clip on a turn without readAttachment`);let i=await n.call(this.activeTurn,e.attachmentId),a=URL.createObjectURL(new Blob([i],{type:r(i)}));if(t!==this.#c)return URL.revokeObjectURL(a),null;this.#s!==null&&URL.revokeObjectURL(this.#s),this.#s=a;let o=new Audio(this.#s);return o.addEventListener(`timeupdate`,()=>{this.#r=o.currentTime,this.#m(e)}),o.addEventListener(`ended`,()=>{this.#r=0,this.#b(),this.#m(e)}),o.addEventListener(`error`,()=>{this.#b(),this.#o=null,this.#S(e)}),this.#a=o,o}#b(){this.#a?.pause(),this.#x(!1)}#x(e){this.#i=e,e?(t8&&t8!==this&&t8.#b(),t8=this):t8===this&&(t8=null);let t=this.#e;t!==null&&this.#p(t)}#S(e){e.error.textContent=this.activeTurn.labels.voiceClipFailed,e.error.hidden=!1}async#C(e){if(this.#i)this.#b();else{e.error.hidden=!0,this.#l=!0,e.play.disabled=!0,e.play.setAttribute(`aria-busy`,`true`);try{let t=await this.#v(e);if(t===null)return;this.#x(!0),await t.play()}catch{this.#b(),this.#o=null,this.#S(e)}finally{this.#l=!1,e.play.removeAttribute(`aria-busy`),e.play.disabled=typeof this.activeTurn.readAttachment!=`function`}}}});var i8={Text:`wui-chat-part-text`,Sources:`wui-chat-part-sources`,QuickReplies:`wui-chat-part-quick-replies`,InputRequest:`wui-chat-part-input-request`,Action:`wui-chat-part-action`,Notice:`wui-chat-part-notice`,Table:`wui-chat-part-table`,Chart:`wui-chat-part-chart`,Figures:`wui-chat-part-figures`,RecordCard:`wui-chat-part-record-card`,Image:`wui-chat-part-image`,File:`wui-chat-part-file`,Ticket:`wui-chat-part-ticket`,Handoff:`wui-chat-part-handoff`,VoiceClip:`wui-chat-part-voice-clip`},a8=n({SpeechConfig:()=>void 0}),o8=t((()=>{})),s8=1e4,c8=2e3,l8=3e5,u8=new Set([`NotAllowedError`,`SecurityError`,`PermissionDeniedError`]),d8=new Set([`NotFoundError`,`OverconstrainedError`,`NotReadableError`]);function f8(e){return u8.has(m8(e,`name`))?new Gt(`Blocked`,h8(e)):d8.has(m8(e,`name`))?new Gt(`NoMicrophone`,h8(e)):p8(e)}function p8(e){return e instanceof Gt?e:new Gt(`Failed`,h8(e)??String(e))}function m8(e,t){return typeof e==`object`&&e||typeof e==`function`?Reflect.get(e,t):void 0}function h8(e){let t=m8(e,`message`);return t==null?void 0:String(t)}function g8(e){return typeof e==`object`&&!!e}function _8(e){let t=m8(e,`SpeechConfig`),n=m8(e,`AudioConfig`),r=m8(e,`NoMatchDetails`);return typeof m8(t,`fromAuthorizationToken`)==`function`&&typeof m8(n,`fromDefaultMicrophoneInput`)==`function`&&typeof m8(n,`fromSpeakerOutput`)==`function`&&typeof m8(r,`fromResult`)==`function`&&typeof m8(e,`SpeechRecognizer`)==`function`&&typeof m8(e,`SpeakerAudioDestination`)==`function`&&typeof m8(e,`SpeechSynthesizer`)==`function`&&g8(m8(e,`PropertyId`))&&g8(m8(e,`ResultReason`))&&g8(m8(e,`NoMatchReason`))&&g8(m8(e,`CancellationReason`))}function v8(e){if(!_8(e))throw new Gt(`Unavailable`,`Speech is not available in this browser.`);return e}var y8=null;function b8(){let e=globalThis,t=`SpeechSDK`in e?e.SpeechSDK:void 0;return t?Promise.resolve(v8(t)):(y8===null&&(y8=Promise.resolve().then(()=>(o8(),a8)).then(e=>v8(m8(e,`SpeechConfig`)?e:m8(e,`default`))).catch(e=>{throw y8=null,e})),y8)}function x8(){return globalThis.document?.documentElement?.lang||globalThis.navigator?.language||`en-US`}function S8(e){let t=e.getToken,n=e.loadSdk??b8,r=e.getLanguage??x8,i=typeof navigator<`u`&&typeof navigator.mediaDevices?.getUserMedia==`function`,a=typeof window<`u`&&window.isSecureContext===!0,o=i&&a,s=typeof window<`u`,c=null,l=null,u=null;function d(){return c!==null&&Date.parse(c.expiresDateTimeUtc)-Date.now()>6e4?Promise.resolve(c):(l===null&&(l=Promise.resolve().then(()=>t()).then(e=>(c=e,l=null,e),e=>{throw l=null,p8(e)})),l)}function f(){return u===null&&(u=Promise.resolve().then(()=>n()).then(e=>{if(!e?.SpeechConfig)throw new Gt(`Unavailable`,`Speech is not available in this browser.`);return e}).catch(e=>{throw u=null,p8(e)})),u}function p(e={}){let{signal:t,onText:n,onEnd:i}=e;if(t?.aborted)return i?.(),Promise.resolve();let a=()=>{},s=()=>{},c=new Promise((e,t)=>{a=e,s=t}),l=!1,u=!1,p=null,m=!1,h=``,g=[],_,v,y,b=()=>{clearTimeout(_),clearTimeout(v),clearTimeout(y)},x=e=>{if(!l){l=!0,b(),t?.removeEventListener(`abort`,S);try{p?.close()}finally{try{i?.()}finally{e?s(e):a()}}}};async function S(){if(!(l||u)){u=!0,b();try{let e=p;e!==null&&await new Promise(t=>e.stopContinuousRecognitionAsync(()=>t(),()=>t()))}finally{x(null)}}}let C=()=>[...g,h].filter(e=>e!==``).join(` `).trim(),w=(e,t)=>{m||(m=!0,clearTimeout(_)),clearTimeout(v),v=setTimeout(S,c8),n?.(C(),t)};async function T(){if(t?.addEventListener(`abort`,S),!o){x(new Gt(`Unavailable`,`Dictation is not available in this browser.`));return}let n;try{n=await navigator.mediaDevices.getUserMedia({audio:!0})}catch(e){x(f8(e));return}for(let e of n.getTracks())e.stop();if(!l)try{let t=await f(),n=await d();if(l)return;let i=t.SpeechConfig.fromAuthorizationToken(n.token,n.region);i.speechRecognitionLanguage=e.language||r(),i.setProperty(t.PropertyId.SpeechServiceConnection_InitialSilenceTimeoutMs,String(s8));let a=new t.SpeechRecognizer(i,t.AudioConfig.fromDefaultMicrophoneInput());if(p=a,a.recognizing=(e,t)=>{if(l)return;let n=t.result?.text;n&&(h=n,w(n,!1))},a.recognized=(e,n)=>{if(l)return;let{reason:r,text:i}=n.result;r===t.ResultReason.RecognizedSpeech&&i?(g.push(i),h=``,w(i,!0)):r===t.ResultReason.NoMatch&&t.NoMatchDetails.fromResult(n.result).reason===t.NoMatchReason.InitialSilenceTimeout&&x(new Gt(`NoSpeech`,`No speech was heard.`))},a.canceled=(e,n)=>{l||(n.reason===t.CancellationReason.Error?x(new Gt(`Failed`,n.errorDetails)):x(null))},a.sessionStopped=()=>x(null),await new Promise((e,t)=>a.startContinuousRecognitionAsync(()=>e(),t)),l)return;e.onStarted?.(),_=setTimeout(()=>{m||x(new Gt(`NoSpeech`,`No speech was heard.`))},s8),y=setTimeout(S,l8)}catch(e){x(p8(e))}}return T(),c}async function m(e,t={}){let{signal:n}=t;if(!n?.aborted)try{let i=await f(),a=await d();if(n?.aborted)return;let o=i.SpeechConfig.fromAuthorizationToken(a.token,a.region);o.speechSynthesisLanguage=t.language||r();let s=new i.SpeakerAudioDestination,c=new i.SpeechSynthesizer(o,i.AudioConfig.fromSpeakerOutput(s));await new Promise((t,r)=>{let a=!1,o=()=>{n?.removeEventListener(`abort`,d),c.close(),s.close()},l=()=>{a||(a=!0,o(),t())},u=e=>{a||(a=!0,o(),r(p8(e)))};function d(){s.pause(),l()}n?.addEventListener(`abort`,d),s.onAudioEnd=l;try{c.speakTextAsync(e,e=>{e.reason!==i.ResultReason.SynthesizingAudioCompleted&&u(new Gt(`Failed`,`The reply could not be synthesised.`))},e=>u(e))}catch(e){u(e)}})}catch(e){throw p8(e)}}return{dictation:o,readAloud:s,streamsText:!0,startDictation:p,speak:m}}var C8=8e3,w8=6e3,T8=new Set([`Blocked`,`NoMicrophone`]);function E8(e){let t=e instanceof Gt?e.code:`Failed`;return{code:t,source:`Dictation`,sticky:T8.has(t)}}function D8(e){let t=sr(e.filter(e=>e.kind===`Text`)).replace(/ ?\[\d+\]/g,``).replace(/\s+/g,` `).trim();if(t.length<=6e3)return t;let n=t.slice(0,w8),r=n.lastIndexOf(`. `);return r===-1?n.trim():n.slice(0,r+1)}function O8(e,t){switch(e.code){case`Blocked`:return t.dictationBlocked;case`NoMicrophone`:return t.dictationNoMicrophone;case`NoSpeech`:return t.dictationNotHeard;case`Unavailable`:return t.dictationUnavailable;case`Failed`:return t.dictationFailed;case`SpeakFailed`:return t.readAloudFailed;default:throw Error(`Unknown voice note code "${e.code}".`)}}function k8(e){let t=e.getState,n=e.speech??S8({getToken:e.getToken}),r=`Idle`,i=null,a=null,o=null,s=null,c=0,l=null,u=new Set,d=()=>({mode:r,messageId:i,startedAtMs:a,note:o});function f(){let e=d();for(let t of[...u])t(e)}function p(e){r=e.mode,i=e.messageId??null,a=e.startedAtMs??null,f()}function m(){l!==null&&clearTimeout(l),l=null}function h(e){m(),o=e,e&&!e.sticky&&(l=setTimeout(()=>{l=null,o=null,f()},C8)),f()}function g(){o!==null&&(m(),o=null,f())}function _(){c+=1;let e={id:c,controller:new AbortController,stopped:!1};return s=e,e}function v(e){s===e&&(s=null,p({mode:`Idle`}))}function y(){let e=s;s=null,e&&(e.stopped=!0,e.controller.abort()),r!==`Idle`&&p({mode:`Idle`})}function b(){let e=t();return!!(e.features.Dictation&&e.profile?.speechAvailable&&n.dictation)}function x(){let e=t();return!!(e.features.ReadAloud&&e.profile?.speechAvailable&&n.readAloud)}async function S(e){if(r===`Dictating`){y();return}if(y(),h(null),!b())return;let t=e.getText(),i=t!==``&&!/\s$/.test(t)?`${t} `:t,a=_();p({mode:`Dictating`});try{await n.startDictation({signal:a.controller.signal,onText:t=>{s===a&&e.setText(i+t)},onEnd:()=>v(a)})}catch(e){if(a.stopped)return;v(a),h(E8(e))}}async function C(e,t){if(r===`Speaking`&&i===e){y();return}y(),h(null);let a=D8(t);if(a===``)return;let o=_();p({mode:`Speaking`,messageId:e});try{await n.speak(a,{signal:o.controller.signal}),v(o)}catch{if(o.stopped)return;v(o),h({code:`SpeakFailed`,source:`ReadAloud`,sticky:!1,messageId:e})}}function w(e){return u.add(e),()=>{u.delete(e)}}function T(){y(),m(),o=null,u.clear()}return{canDictate:b,canSpeak:x,getStatus:d,subscribe:w,toggleDictation:S,toggleSpeak:C,stop:y,dismissNote:g,destroy:T}}var A8=new Set([`Shift`,`Control`,`Alt`,`Meta`,`Escape`]);function j8(e,t){e.isTrusted&&!A8.has(e.key)&&t.getStatus().mode===`Dictating`&&t.stop()}function M8({voice:e,getLabels:t,textarea:n,onTextChanged:r}){let i=null,a=$(`button`,`wui-chat-tool wui-chat-mic`,{type:`button`});a.append($6(`mic`,20)),a.hidden=!0,a.addEventListener(`click`,()=>{e.toggleDictation({getText:()=>n.value,setText:e=>{n.value=n.maxLength>0?e.slice(0,n.maxLength):e,r(),n.setSelectionRange(n.value.length,n.value.length)}})});let o=$(`p`,`wui-chat-voice-note`,{role:`status`});o.hidden=!0;let s=$(`span`,`visually-hidden`,{"aria-live":`polite`});function c(e){let n=t(),r=e.note?.source===`ReadAloud`?null:e.note,i=e.mode===`Dictating`,c=i?n.dictateStop:n.dictate;a.setAttribute(`aria-pressed`,String(i)),a.setAttribute(`aria-label`,c),a.title=c;let l=r?.code===`Blocked`||r?.code===`NoMicrophone`;r===null?(o.hidden=!0,o.textContent=``):(o.hidden=!1,o.textContent=O8(r,n),o.setAttribute(`role`,r.sticky?`alert`:`status`)),o.classList.toggle(`wui-chat-voice-note--blocked`,l),s.textContent=i?n.dictateListening:``}function l(t){let{state:n}=t;a.hidden=!e.canDictate();let r=e.getStatus().mode===`Speaking`,i=n.messagesLeftToday===0;a.disabled=i||r||n.handoffPause===!0}function u(e){c(e),i!==null&&l(i)}let d=e.subscribe(u);function f(t){i=t,l(t),c(e.getStatus())}function p(){d()}return{buttons:[a],note:o,announcer:s,paint:f,destroy:p}}var N8=10,P8=.9,F8=0;function I8(e){for(let t of e.toReversed())for(let e of t.parts.toReversed())if(e.kind===`InputRequest`&&e.state===`Open`)return e.fields[0]?.label??e.title??null;return null}function L8(e){F8+=1;let t=`wui-chat-composer-hint-${F8}`,n=$(`p`,`wui-chat-allowance`,{role:`status`});n.hidden=!0;let r=$(`span`),i=$(`button`,`btn btn-ghost-primary btn-sm wui-chat-action-btn`,{type:`button`});i.addEventListener(`click`,()=>e.onCancelEdit());let a=$(`div`,`wui-chat-editing`);a.hidden=!0,a.append(r,i);let o=$(`div`,`wui-chat-attachments`);o.hidden=!0;let s=$(`button`,`wui-chat-tool`,{type:`button`});s.append(j2(`paperclip`,20)),s.hidden=!0;let c=$(`input`,null,{type:`file`,multiple:``,tabindex:`-1`});c.hidden=!0,c.addEventListener(`change`,()=>{let t=[...c.files??[]];c.value=``,t.length>0&&e.onAttach(t)}),s.addEventListener(`click`,()=>c.click());let l=$(`textarea`,`wui-chat-input`,{rows:`1`,"aria-describedby":t}),u=$(`span`,`visually-hidden`,{id:t}),d=$(`span`,`wui-chat-counter`);d.hidden=!0;let f=$(`button`,`wui-chat-send`,{type:`submit`});f.append(j2(`arrow-up`,18));let p=$(`button`,`wui-chat-send wui-chat-send--stop`,{type:`button`});p.append(j2(`stop`,16)),p.hidden=!0,p.addEventListener(`click`,()=>e.onStop());let m=$(`form`,`wui-chat-composer`);m.append(s,c,l,d,u,p,f);let h=null,g=null,_=null,v=0,y=null;function b(){l.style.height=`auto`,l.style.height=`${l.scrollHeight}px`;let e=getComputedStyle(l),t=l.scrollHeight-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom);m.classList.toggle(`wui-chat-composer--multiline`,t>(parseFloat(e.lineHeight)||22)*1.5)}function x(){return y?.attachments.some(e=>e.status===`Uploading`)??!1}function S(){return y?.attachments.some(e=>e.status===`Ready`)??!1}function C(){let e=l.value.length,t=v>0&&e>v*P8;d.hidden=!t,t&&_&&(d.textContent=_.counter(e,v))}function w(){let e=y?.messagesLeftToday??null,t=l.value.trim()===``&&!S();f.disabled=!!y?.streaming||e===0||x()||t||y?.handoffPause===!0,m.classList.toggle(`wui-chat-composer--has-text`,!t)}function T(){if(f.disabled)return;let t=l.value.trim();l.value=``,b(),C(),w(),e.voice?.stop(),e.voice?.dismissNote(),e.onSubmit(t)}l.addEventListener(`input`,()=>{b(),C(),w(),l.value!==``&&e.onTyping?.()}),l.addEventListener(`keydown`,e=>{e.key===`Enter`&&!e.shiftKey&&!e.isComposing&&(e.preventDefault(),T())}),m.addEventListener(`submit`,e=>{e.preventDefault(),T()});let E=e.voice,D=E?M8({voice:E,getLabels:()=>{if(_===null)throw Error(`composer labels are read before the first render`);return _},textarea:l,onTextChanged:()=>{b(),C(),w()}}):null;if(E&&D){let e=D.buttons[0];e&&m.insertBefore(e,f),l.addEventListener(`keydown`,e=>j8(e,E))}function O(t,n){let r=t.map(t=>{let r=$(`span`,`wui-chat-chip`),i=$(`span`,null,t.status===`Failed`?{title:t.error??``}:null);i.textContent=t.fileName;let a=$(`button`,`wui-chat-chip-remove`,{type:`button`,"aria-label":n.removeAttachment(t.fileName)});a.append(j2(`x`,14)),a.addEventListener(`click`,()=>e.onRemove(t.key));let o=[];if(t.status===`Uploading`){let e=$(`progress`,`wui-chat-chip-progress`,{max:`1`});typeof t.progress==`number`&&(e.value=t.progress);let r=$(`span`,`wui-chat-chip-status`);r.textContent=n.attachmentUploading,o.push(e,r)}if(t.status===`Failed`){let e=$(`span`,`wui-chat-chip-error`,{"aria-live":`polite`});e.textContent=t.error||n.attachmentFailed,o.push(e)}return r.append(i,...o,a),r});o.replaceChildren(...r),o.hidden=r.length===0}function k(t){y=t.state,_=t.labels,v=t.maxLength,t.sendIcon&&f.dataset.icon!==t.sendIcon&&(f.dataset.icon=t.sendIcon,f.replaceChildren(j2(t.sendIcon,18)));let o=y.messagesLeftToday;m.setAttribute(`aria-label`,_.composer),u.textContent=_.composerHint,l.setAttribute(`aria-label`,_.composer),l.maxLength=v,l.placeholder=y.handoffPause?_.handoffMoment:I8(y.messages)??_.placeholder,l.disabled=o===0||y.handoffPause===!0,n.hidden=!(o!==null&&o<=N8),!n.hidden&&o!==null&&(n.textContent=_.allowance(o));let d=y.editing?.messageId??null;if(d!==h){let t=h!==null;h=d,y.editing?(e.voice?.stop(),l.value=y.editing.text,b()):t&&(l.value=``,b())}a.hidden=!y.editing,r.textContent=_.editing,i.textContent=_.cancel;let x=t.draft??null;typeof x==`string`&&x!==``&&x!==g&&(g=x,l.value=x,l.dispatchEvent(new Event(`input`)),l.focus(),e.onDraftApplied?.()),O(y.attachments,_);let S=y.features.Attachments&&(y.profile?.limits.maxAttachments??0)>0&&y.handoffPause!==!0;s.hidden=!S,s.setAttribute(`aria-label`,_.attach),s.title=_.attachHint,c.accept=t.accept??``;let T=y.streaming&&y.features.Stop===!0;p.hidden=!T,p.setAttribute(`aria-label`,_.stop),f.hidden=T,f.setAttribute(`aria-label`,_.send),C(),w(),D?.paint({state:y})}function A(){l.focus()}function j(){D?.destroy();for(let e of M)e.remove()}let M=[n,a,o,...D?[D.note,D.announcer]:[],m];return{nodes:M,paint:k,focus:A,destroy:j,getDraft:()=>l.value}}var R8=`https://policies.google.com/privacy`,z8=`https://policies.google.com/terms`;function B8(e,t){let n=$(`a`,`wui-chat-footer-link`,{href:t,target:`_blank`,rel:`noopener noreferrer`});return n.textContent=e,n}function V8(){let e=$(`span`,`wui-chat-footer-sep`,{"aria-hidden":`true`});return e.textContent=`·`,e}function H8(){let e=$(`p`,`wui-chat-footer`);e.hidden=!0;function t(t){let{labels:n,profile:r}=t,i=[];if(r){let e=$(`span`,`wui-chat-footer-text`);e.textContent=r.footer.disclaimer||n.disclaimer,i.push(e);let t=$(`span`,`wui-chat-footer-privacy`);if(r.footer.privacyText&&t.append(document.createTextNode(r.footer.privacyText)),r.footer.privacyUrl){t.hasChildNodes()&&t.append(document.createTextNode(` `));let e=$(`a`,`wui-chat-footer-link`,{href:r.footer.privacyUrl});e.textContent=n.footerPrivacy,t.append(e)}if(t.hasChildNodes()&&i.push(t),r.footer.assuranceText){let e=$(`span`);e.textContent=r.footer.assuranceText,i.push(e)}if(Fe(r)){let e=$(`span`,`wui-chat-footer-captcha`);e.append(document.createTextNode(`${n.captchaNote} `),B8(n.captchaPrivacy,R8),document.createTextNode(` `),B8(n.captchaTerms,z8)),i.push(e)}}e.replaceChildren(...i.flatMap((e,t)=>t?[document.createTextNode(` `),V8(),e]:[e])),e.hidden=i.length===0}return{el:e,paint:t}}function U8(e,t,n){e.setAttribute(`aria-label`,t),e.title=t,e.dataset.icon!==n&&(e.dataset.icon=n,e.replaceChildren(j2(n,20)))}function W8(e){let t=$(`span`,`wui-chat-orb`,{"aria-hidden":`true`}),n=$(`strong`,`wui-chat-title`);e.titleId&&(n.id=e.titleId);let r=$(`span`,`wui-chat-tagline`),i=$(`span`,`wui-chat-status`),a=$(`div`,`wui-chat-header-text`);a.append(n,r,i);let o=$(`span`,`wui-chat-header-conversation`);o.hidden=!0;let s=P2(``,`history`,()=>e.onHistory()),c=P2(``,`volume-high`,()=>e.onMute()),l=P2(``,`plus`,()=>e.onNew()),u=P2(``,`maximize-4`,()=>e.onSwitch());u.classList.add(`wui-chat-switch-btn`,`wui-chat-switch-btn--full`);let d=P2(``,`panel-left-open`,()=>e.onSwitch());d.classList.add(`wui-chat-switch-btn`,`wui-chat-switch-btn--side`);let f=P2(``,`x`,()=>e.onClose());f.classList.add(`wui-chat-close-btn`);let p=$(`div`,`wui-chat-header-actions`);p.append(o,s,c,l,u,d,f);let m=$(`header`,`wui-chat-header`);m.append(t,a,p);function h(e){let{labels:t}=e;m.hidden=!1,n.textContent=e.title??``,r.textContent=e.tagline??``,r.hidden=!e.tagline,i.textContent=e.status??``,s.hidden=!e.showHistory,e.viewingHistory?U8(s,t.backToChat,`arrow-left`):U8(s,t.history,`history`),c.hidden=!e.showMute,U8(c,e.muted?t.unmuteSounds:t.muteSounds,e.muted?`volume-mute`:`volume-high`),l.hidden=!!e.viewingHistory||e.showNew===!1,l.disabled=!e.canNew,U8(l,t.newChat,`plus`),u.hidden=e.switchTo!==`full-page`,u.disabled=!e.canSwitch,U8(u,t.openFullScreen,`maximize-4`),d.hidden=e.switchTo!==`docked`,d.disabled=!e.canSwitch,U8(d,t.openSidePanel,`panel-left-open`),f.hidden=!e.showClose,U8(f,t.close,`x`)}return{el:m,conversation:o,paint:h}}var G8=120;function K8(e,t,n=`outline`){let r=$(`button`,`${M2(n,`sm`)} wui-chat-action-btn`,{type:`button`});return r.textContent=e,r.addEventListener(`click`,t),r}function q8(e){let t=$(`div`,`wui-chat-history`);t.hidden=!0;let n=null,r=null,i=null,a=null,o=null,s=!1;function c(){return n||(n=Wt({client:e.getClient()}),r=n.subscribe(()=>_()),n)}function l(e){i={id:e.publicId,kind:`rename`,draft:e.title??``,saving:!1},a=null,o=null,s=!0,_()}function u(e){i={id:e.publicId,kind:`delete`,saving:!1},a=null,o=null,_()}function d(){i=null,a=null,o=null,_()}async function f(){let t=i;if(t?.kind!==`rename`||t.saving)return;let n=t.draft.trim();if(n){t.saving=!0,_();try{await c().rename(t.id,n),i===t&&(i=null),a=null,o=null}catch{if(i!==t)return;t.saving=!1,o=e.getLabels().renameFailed}_()}}async function p(){let t=i;if(!(t?.kind!==`delete`||t.saving)){t.saving=!0,_();try{await c().remove(t.id),i===t&&(i=null),a=null,e.onDeleted(t.id)}catch{if(i!==t)return;t.saving=!1,a=e.getLabels().deleteFailed}_()}}function m(e,t){let n=$(`li`,`wui-chat-history-row wui-chat-history-row--editing`),r=$(`input`,`wui-chat-history-input`,{type:`text`,"aria-label":e.conversationTitle,maxlength:String(G8)});r.value=t.draft,r.addEventListener(`input`,()=>{t.draft=r.value,i.disabled=t.saving||!t.draft.trim()}),r.addEventListener(`keydown`,e=>{e.key===`Enter`&&!e.isComposing&&e.keyCode!==229?(e.preventDefault(),f()):e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),d())});let i=K8(e.renameSave,()=>f(),`primary`);if(i.disabled=t.saving||!t.draft.trim(),n.append(r,i,K8(e.cancel,()=>d(),`ghost`)),o!==null){let e=$(`p`,`wui-chat-history-error`,{role:`alert`});e.textContent=o,n.append(e)}return s&&(s=!1,queueMicrotask(()=>r.focus())),n}function h(e,t){let n=$(`li`,`wui-chat-history-row wui-chat-history-row--confirm`),r=$(`p`);r.textContent=e.deleteConfirmTitle;let i=$(`p`);i.textContent=e.deleteConfirmMessage;let a=K8(e.deleteConfirm,()=>p(),`danger`);return a.disabled=t.saving,n.append(r,i,a,K8(e.cancel,()=>d(),`ghost`)),n}function g(t,n,r){if(i?.id===t.publicId&&i.kind===`rename`)return m(n,i);if(i?.id===t.publicId&&i.kind===`delete`)return h(n,i);let a=$(`li`,`wui-chat-history-row`),o=$(`button`,`wui-chat-history-open`,{type:`button`}),s=$(`span`,`wui-chat-history-title`);s.textContent=t.title||n.untitled;let c=$(`span`,`wui-chat-history-time`);return c.textContent=ir(t.lastActivityDateTimeUtc),o.append(s,c),o.addEventListener(`click`,()=>e.onOpen(t.publicId)),a.append(o),r.Rename&&a.append(P2(n.rename,`pencil`,()=>l(t))),r.Delete&&a.append(P2(n.deleteChat,`trash`,()=>u(t))),a}function _(){let r=e.getLabels(),i=e.getFeatures(),o=n?n.getState():{items:[],totalCount:null,loading:!1,error:null,hasMore:!1},s=[];if(o.error||a){let e=$(`p`,`wui-chat-history-error`,{role:`alert`});o.error?(e.append(document.createTextNode(r.loadFailed),document.createTextNode(` `)),e.append(K8(r.retry,()=>c().load(),`outline`))):e.textContent=a,s.push(e)}if(o.loading&&o.items.length===0){let e=$(`p`,`wui-chat-history-empty`,{role:`status`});e.textContent=r.loadingConversation,s.push(e)}if(o.items.length===0&&!o.loading&&!o.error){let e=$(`p`,`wui-chat-history-empty`),t=$(`span`);t.textContent=r.historyEmptyTitle;let n=$(`span`);n.textContent=r.historyEmptyText,e.append(t,n),s.push(e)}if(o.items.length>0){let e=$(`ul`,`wui-chat-history-list`,{"aria-label":r.history});e.append(...o.items.map(e=>g(e,r,i))),s.push(e)}o.hasMore&&!o.loading&&s.push(K8(r.loadMore,()=>c().loadMore(),`outline`)),t.replaceChildren(...s)}function v(){t.hidden=!1,Promise.allSettled([c().load()]),_()}function y(){t.hidden=!0}function b(){r?.(),r=null,n?.dispose(),n=null}return{el:t,show:v,hide:y,paint:_,dispose:b}}var J8=new Set([`GET`,`HEAD`]);function Y8(){let e=document.querySelector(`meta[name="wui-csrf"]`),t=e?.getAttribute(`content`);return t?{token:t,header:e?.getAttribute(`data-header`)||`RequestVerificationToken`}:null}async function X8(e,{lenient:t=!1}={}){let n=await e.text();if(n){if((e.headers.get(`content-type`)||``).includes(`json`)){if(!t)return JSON.parse(n);try{return JSON.parse(n)}catch{return n}}return n}}async function Z8(e,t,n){let r=new TextDecoder,i=e.getReader(),a=``;for(;;){let{done:e,value:o}=await i.read();if(e)break;a+=r.decode(o,{stream:!0}),n({event:{target:{responseText:a,status:t}}})}return a+=r.decode(),a}function Q8({fetch:e=(...e)=>globalThis.fetch(...e)}={}){async function t(t,n,r,i={}){let a={...i.headers},o;if(typeof FormData<`u`&&r instanceof FormData){for(let e of Object.keys(a))e.toLowerCase()===`content-type`&&delete a[e];o=r}else r!==void 0&&(a[`Content-Type`]=`application/json`,o=JSON.stringify(r));if(!J8.has(t)){let e=Y8();e&&(a[e.header]=e.token)}let s=i.signal,c=s,l,u,d=()=>l?.abort(s?.reason);(i.timeout??0)>0&&(l=new AbortController,c=l.signal,s?.aborted?l.abort(s.reason):s?.addEventListener(`abort`,d,{once:!0}),u=setTimeout(()=>l?.abort(new DOMException(`The request timed out.`,`TimeoutError`)),i.timeout));try{let r={method:t,headers:a,credentials:`same-origin`};o!==void 0&&(r.body=o),c&&(r.signal=c);let s=await e(n,r);if(!s.ok){let e=Error(`Request failed with status ${s.status}`);throw e.response={status:s.status,data:await X8(s,{lenient:!0})},e}let l;return l=i.responseType===`arraybuffer`?await s.arrayBuffer():typeof i.onDownloadProgress==`function`&&s.body?await Z8(s.body,s.status,i.onDownloadProgress):await X8(s),{data:l,status:s.status}}finally{clearTimeout(u),s?.removeEventListener(`abort`,d)}}return{get:(e,n)=>t(`GET`,e,void 0,n),post:(e,n,r)=>t(`POST`,e,n,r),put:(e,n,r)=>t(`PUT`,e,n,r),delete:(e,n)=>t(`DELETE`,e,void 0,n)}}function $8(e){let t,n=!1,r=!1,i=$(`div`,`wui-chat-nudge`,{role:`status`});i.hidden=!0;let a=$(`button`,`wui-chat-nudge-text`,{type:`button`}),o=$(`button`,`wui-chat-nudge-close`,{type:`button`});o.append(j2(`x`,14)),i.append(a,o);function s(){clearTimeout(t),t=void 0}function c(){s(),r=!0,i.hidden=!0}a.addEventListener(`click`,()=>{i.hidden=!0,e.onActivate()}),o.addEventListener(`click`,()=>{c(),e.onDismiss()});function l(e){s(),r||n||(t=setTimeout(()=>{t=void 0,a.textContent=e.text,o.setAttribute(`aria-label`,e.label),i.hidden=!1,n=!0},e.delaySeconds*1e3))}function u(){s(),i.remove()}return{el:i,schedule:l,cancel:s,dismiss:c,isShown:()=>n,destroy:u}}var e5=6e4,t5=60*e5,n5=48*t5;function r5(e){if(typeof e!=`string`||e===``)return null;let t=Date.parse(e);return Number.isNaN(t)?null:t}function i5(e,t=Date.now(),n){let r=r5(e);if(r===null)return``;let i=t-r,a=Math.abs(i),o=i>=0,s=new Intl.RelativeTimeFormat(n,{numeric:`auto`});if(a<e5)return s.format(0,`second`);if(a<t5){let e=Math.floor(a/e5);return s.format(o?-e:e,`minute`)}if(a<n5){let e=Math.floor(a/t5);return s.format(o?-e:e,`hour`)}return new Intl.DateTimeFormat(n,{day:`numeric`,month:`short`,year:`numeric`}).format(new Date(r))}function a5(e,t){let n=r5(e);return n===null?``:new Intl.DateTimeFormat(t,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(n))}function o5(e,t){e.addEventListener(`click`,()=>t()),e.addEventListener(`keydown`,e=>{(qi(e)||e.key===` `)&&(e.preventDefault(),t())})}function s5(e){let{list:t,getLabels:n,getFeatures:r,onOpen:i}=e,a=e.now??(()=>Date.now()),o=$(`div`,`wui-chat-empty-rows wui-chat-empty-rows--past`);o.hidden=!0;let s=!1;function c(e,t){let n=$(`div`,`card card-pad-sm card-clickable wui-chat-empty-row`,{role:`button`,tabindex:`0`}),r=$(`div`,`card-body wui-chat-empty-row-body`),o=$(`span`,`wui-chat-empty-row-title`);o.textContent=e.title||t.earlierChat;let s=$(`span`,`wui-chat-empty-row-time`,{title:a5(e.lastActivityDateTimeUtc)});return s.textContent=i5(e.lastActivityDateTimeUtc,a()),r.append(o,s),n.append(r),o5(n,()=>i(e.publicId)),n}function l(){if(s)return;let e=t.getState().items;if(r().History!==!0||e.length===0){o.replaceChildren(),o.hidden=!0;return}let i=n();o.replaceChildren(...e.slice(0,20).map(e=>c(e,i))),o.hidden=!1}let u=t.subscribe(l);return{el:o,refresh(){r().History===!0&&t.load().catch(e=>globalThis.reportError?.(e))},paint:l,dispose(){s=!0,u()}}}var c5=`https://www.google.com/recaptcha/api.js?render=`;function l5(e){return e!==void 0&&typeof e.ready==`function`&&typeof e.execute==`function`}var u5=new Map;function d5(e){let t=u5.get(e);if(t)return t;let n=new Promise((t,n)=>{let r=globalThis.grecaptcha;if(l5(r)){t(r);return}let i=document.createElement(`script`);i.src=c5+encodeURIComponent(e),i.async=!0;let a=t=>{u5.delete(e),n(Object.assign(Error(t),{code:`captcha_unavailable`}))};i.addEventListener(`load`,()=>{let e=globalThis.grecaptcha;e===void 0||typeof e.ready!=`function`?a(`The reCAPTCHA script loaded without grecaptcha.`):e.ready(()=>{let e=globalThis.grecaptcha;l5(e)?t(e):a(`reCAPTCHA became ready without execute.`)})}),i.addEventListener(`error`,()=>{u5.delete(e),n(Error(`The reCAPTCHA script did not load.`))}),document.head.append(i)});return u5.set(e,n),n}async function f5(e,t){let n=await d5(e);await new Promise(e=>n.ready(()=>e()));let r=await n.execute(e,{action:t});if(!r)throw Object.assign(Error(`reCAPTCHA returned no token.`),{code:`captcha_unavailable`});return r}var p5=`data-wui-printing`,m5=`data-wui-print-hide`,h5=`data-wui-print-path`,g5=`data-wui-print-target`,_5=new Set([`script`,`style`,`link`,`template`]),v5=null;function y5(){if(v5!==null){for(let e of v5.marked)e.removeAttribute(m5),e.removeAttribute(h5),e.removeAttribute(g5);v5.heading.remove(),document.documentElement.removeAttribute(p5),window.removeEventListener(`afterprint`,v5.onAfterPrint),v5=null}}function b5(e,t,n,r,i){y5();let a=e.querySelector(`.wui-chat-panel`);if(a===null)throw Error(`print needs the wui-chat root`);let o=[],s=a;for(;s!==null&&s!==document.documentElement;){s.setAttribute(h5,``),o.push(s);let e=s.parentElement;if(e===null)throw Error(`print walk left the chat root`);for(let t of e.children)t===s||_5.has(t.localName)||(t.setAttribute(m5,``),o.push(t));s=e}for(let e of n)e.setAttribute(m5,``),o.push(e);r!==null&&(r.setAttribute(g5,``),o.push(r));let c=document.createElement(`div`);c.className=`wui-chat-print-heading`;let l=document.createElement(`h1`);l.textContent=i.title;let u=document.createElement(`p`);u.textContent=i.printedOn,c.append(l,u),a.prepend(c),document.documentElement.setAttribute(p5,t);let d=()=>y5();window.addEventListener(`afterprint`,d,{once:!0}),v5={marked:o,heading:c,onAfterPrint:d};try{window.print()}catch(e){throw y5(),e}}function x5(e,t){b5(e,`conversation`,[],null,t)}function S5(e,t,n){if(!e.contains(t))throw Error(`printReply needs a message inside the wui-chat root`);b5(e,`reply`,Array.from(e.querySelectorAll(`li.wui-chat-message`)).filter(e=>e!==t),t,n)}function C5(){return typeof navigator<`u`&&typeof navigator.share==`function`}async function w5({title:e,text:t}){if(!C5())return`failed`;try{return await navigator.share({title:e,text:t}),`shared`}catch(e){return typeof e==`object`&&e&&`name`in e&&e.name===`AbortError`?`cancelled`:`failed`}}var T5=new Set([`Assistant`,`Agent`,`Script`]),E5=new WeakMap;function D5(e,t,n){let{labels:r,features:i,title:a,busy:o,assistantName:s}=n;if(sr(t.parts)!==``){if(i.Share&&C5()){let n=N2(`ghost`,r.share,`share`,async()=>{let e=M5([t],i,r,a,!1,s);e!==``&&await w5({title:a,text:e})===`failed`&&I5(n.parentElement,r.shareFailed)});n.disabled=o===!0,e.append(n)}if(i.Print){let t=N2(`ghost`,r.print,`printer`,()=>{try{let e=t.closest(`.wui-chat`),n=t.closest(`li.wui-chat-message`);if(!(e instanceof HTMLElement)||!(n instanceof HTMLElement))throw Error(`printReply needs a message inside the wui-chat root`);S5(e,n,{title:a,printedOn:P5(r)})}catch{F5(t,r.printFailed)}});e.append(t)}}}function O5(e,t,n){if(t.streaming||t.thinking||t.loading||t.conversationId===null||t.messages.filter(e=>e.stored&&T5.has(e.author.kind)&&sr(e.parts)!==``).length===0){e.hidden=!0;return}let{labels:r,features:i}=n,a=!!i.Share&&C5(),o=!!i.Print;if(!a&&!o){e.hidden=!0;return}let s=[a,o,t.messages.length,r.shareConversation,r.printConversation].join(`|`);e.dataset.sig!==s&&(e.dataset.sig=s,e.replaceChildren(),a&&e.append(A5(e,r,i,n)),o&&e.append(j5(e,r,n))),e.hidden=!1}function k5(e,t,n,r){return e.iconOnly?P2(t,n,r):N2(`ghost`,t,n,r)}function A5(e,t,n,r){return k5(r,t.shareConversation,`share`,async()=>{let i=r.getState(),a=N5(i,r);await w5({title:a,text:M5(i.messages.filter(e=>e.stored),n,t,a,!0,i.profile?.assistant.name)})===`failed`&&I5(e,t.shareFailed)})}function j5(e,t,n){let r=k5(n,t.printConversation,`printer`,()=>{try{let r=e.closest(`.wui-chat`);if(!(r instanceof HTMLElement))throw Error(`printConversation needs the wui-chat root`);x5(r,{title:N5(n.getState(),n),printedOn:P5(t)})}catch{n.iconOnly?I5(e,t.printFailed):F5(r,t.printFailed)}});return r}function M5(e,t,n,r,i,a){return hi(pi(e,{labels:n,title:r,figureText:t.FigureText,...a===void 0?{}:{assistantName:a}}),{heading:i,speakers:i})}function N5(e,t){return typeof e.title==`string`&&e.title!==``?e.title:t.title}function P5(e){return e.printedOn(ir(new Date().toISOString()))}function F5(e,t){let n=e.lastChild;if(!(n instanceof Text))return;let r=E5.get(n);r&&clearTimeout(r.timer);let i=r??{original:n.data};n.data=t,i.timer=setTimeout(()=>{n.data=i.original,E5.delete(n)},ji),E5.set(n,i)}function I5(e,t){if(!e)return;let n=document.createElement(`span`);n.className=`wui-chat-action-notice`,n.setAttribute(`role`,`status`),n.textContent=t,e.append(n),setTimeout(()=>n.remove(),ji)}var L5=`data-wui-chat-docked`,R5=`--wui-chat-docked-width`,z5=420,B5=new Set;function V5(e,t){let n=document.documentElement;n.setAttribute(L5,e),n.style.setProperty(R5,t)}function H5(){let e=document.documentElement;e.removeAttribute(L5),e.style.removeProperty(R5)}function U5(e){let t=V2({...e,layout:`docked`,role:`dialog`,launcher:!0}),n={},r=e.position,i=!1,a=null,o=()=>`${Math.round(t.panel.getBoundingClientRect().width)||z5}px`;function s(){B5.add(n),V5(r,o()),typeof ResizeObserver==`function`&&(a=new ResizeObserver(()=>document.documentElement.style.setProperty(R5,o())),a.observe(t.panel))}function c(){a?.disconnect(),a=null,B5.delete(n),B5.size===0&&H5()}function l(e){t.setOpen(e),e&&!i?(i=!0,s()):!e&&i&&(i=!1,c())}function u(e){t.setAppearance(e),e.position!==void 0&&(r=e.position,i&&document.documentElement.setAttribute(L5,r))}function d(){l(!1)}return{...t,setOpen:l,setAppearance:u,destroy:d}}function W5(e){return V2({...e,layout:`embedded`,role:`region`,launcher:!1})}var G5=`wchat:peeked`,K5=576,q5=200;function J5(e){let t=V2({...e,layout:`launcher`,role:`dialog`,launcher:!0}),{root:n,panel:r}=t;if(!t.nudgeHost||!t.launcherButton)throw Error(`a launcher shell always has its launcher`);let i=t.nudgeHost,a=t.launcherButton,o={peek:!1,peekSeconds:3,hideWhileOpen:!1,expressive:!1};a.dataset.state=`closed`;let s=!1,c=!1,l,u,d=()=>o.hideWhileOpen||o.expressive;function f(){!o.peek||s||c||i.dataset.launcher!==`idle`||globalThis.innerWidth<K5||globalThis.sessionStorage.getItem(G5)!==null||(globalThis.sessionStorage.setItem(G5,`1`),i.dataset.launcher=`peeking`,l=setTimeout(()=>{l=void 0,i.dataset.launcher===`peeking`&&(i.dataset.launcher=`idle`)},o.peekSeconds*1e3))}i.addEventListener(`animationend`,e=>{e.target===i&&i.dataset.launcher===`idle`&&f()});function p(e){if(e!==c){if(c=e,clearTimeout(l),l=void 0,e)clearTimeout(u),u=void 0,d()?(i.dataset.launcher=`hidden`,i.toggleAttribute(`inert`,!0)):i.dataset.launcher===`peeking`&&(i.dataset.launcher=`idle`);else if(d()){let e=r.contains(document.activeElement);u=setTimeout(()=>{u=void 0,i.toggleAttribute(`inert`,!1),i.dataset.launcher=`idle`,e&&a.focus()},q5)}}a.dataset.state=e?`open`:`closed`,t.setOpen(e)}function m(e){e.reduced!==void 0&&(s=!!e.reduced),e.peek!==void 0&&(o.peek=e.peek),e.peekSeconds!==void 0&&(o.peekSeconds=e.peekSeconds),e.hideWhileOpen!==void 0&&(o.hideWhileOpen=e.hideWhileOpen),e.expressive!==void 0&&(o.expressive=e.expressive===!0),e.phoneMode!==void 0&&n.classList.toggle(`wui-chat--sheet`,e.phoneMode===`Sheet`),e.sheetHeightDvh!==void 0&&n.style.setProperty(`--wui-chat-sheet-height`,`${e.sheetHeightDvh}dvh`),e.sheetMaxHeightPx!==void 0&&n.style.setProperty(`--wui-chat-sheet-max-height`,`${e.sheetMaxHeightPx}px`),t.setAppearance(e),!d()&&i.dataset.launcher===`hidden`&&!c&&(i.dataset.launcher=`idle`),i.dataset.launcher===`idle`&&f()}return{...t,nudgeHost:i,launcherButton:a,setOpen:p,setAppearance:m}}function Y5(e){return V2({...e,layout:`full-page`,role:`region`,launcher:!1})}var X5=new Set([`Agent`,`Customer`]);function Z5(){let e=document.createElement(`div`);e.className=`wui-chat-loader-typing`,e.setAttribute(`aria-hidden`,`true`),e.hidden=!0;let t=document.createElement(`span`);t.className=`wui-chat-loader-typing-orb`;let n=document.createElement(`span`);n.className=`wui-chat-loader-typing-dots`;for(let e=0;e<3;e++){let e=document.createElement(`span`);e.className=`wui-chat-loader-typing-dot`,n.append(e)}e.append(t,n);function r({active:n,reduced:r,authorKind:i}){e.hidden=!n,e.classList.toggle(`wui-chat-loader--reduced`,r===!0),t.hidden=X5.has(i)}function i(){e.remove()}return{el:e,update:r,destroy:i}}var Q5=3,$5={Primary:`wui-chat-starter--primary`,Cta:`wui-chat-starter--cta`};function e7(e,t){e.addEventListener(`click`,()=>t()),e.addEventListener(`keydown`,e=>{(qi(e)||e.key===` `)&&(e.preventDefault(),t())})}function t7(e){let t=$(`h2`,`wui-chat-greeting`),n=$(`div`,`wui-chat-empty-hero`),r=$(`p`,`wui-chat-empty-intro`);r.hidden=!0,n.append($(`span`,`wui-chat-orb`,{"aria-hidden":`true`}),t,r);let i=$(`div`,`wui-chat-empty-extra`);i.hidden=!0;let a=$(`div`,`wui-chat-starters`,{role:`group`}),o=$(`div`,`wui-chat-empty-rows`),s=$(`div`,`wui-chat-empty-past`),c=$(`div`,`wui-chat-empty`,{role:`group`}),l=Z5();c.append(l.el,n,i,a,o,s);let u;function d(t,n){let r=$(`button`,[`wui-chat-starter`,(t.variant===null?void 0:$5[t.variant])??``].filter(Boolean).join(` `),{type:`button`});return r.style.setProperty(`--wui-chat-i`,String(n)),t.icon&&r.append(j2(t.icon,16)),r.append(document.createTextNode(t.label)),r.addEventListener(`click`,()=>e.onStarter(t)),r}function f(t,n){let r=$(`div`,`card card-pad-sm card-clickable wui-chat-empty-row`,{role:`button`,tabindex:`0`}),i=$(`div`,`card-body wui-chat-empty-row-body`),a=$(`span`,`wui-chat-empty-row-label`);a.textContent=n.resumeLast;let o=$(`span`,`wui-chat-empty-row-title`,{title:t.title||n.untitled});o.textContent=t.title||n.untitled;let s=$(`span`,`wui-chat-empty-row-time`);return s.textContent=ir(t.lastActivityDateTimeUtc),i.append(a,o,s),r.append(i),e7(r,()=>e.onResume()),r}function p(t,n,r){let i=r?$(`div`,`card card-pad-sm card-clickable wui-chat-empty-row`,{role:`button`,tabindex:`0`}):$(`div`,`card card-pad-sm wui-chat-empty-row`),a=$(`div`,`card-body wui-chat-empty-row-body`),o=$(`span`,`wui-chat-empty-row-label`);o.textContent=n.ticketAria(t.number);let s=$(`span`,`wui-chat-empty-row-title`);s.textContent=t.subject;let c=$(`span`,`wui-chat-empty-row-status`);return c.textContent=e4(t.status,n),a.append(o,s,c),i.append(a),r&&e7(i,()=>e.onTicket(t)),i}function m(e,t){if(e.features?.OpenTickets!==!0||!e.openTickets?.length)return null;let n=$(`div`,`wui-chat-open-tickets`,{role:`group`,"aria-label":t.openTickets});return n.append(...e.openTickets.slice(0,Q5).map(n=>p(n,t,e.ticketsClickable===!0))),n}function h(e){let{labels:n}=e;t.textContent=e.greeting??``;let i=e.intro??``;r.textContent=i,r.hidden=!i,c.setAttribute(`aria-label`,n.emptyTitle);let s=e.starters??[];a.setAttribute(`aria-label`,n.starters),a.hidden=!e.showStarters||s.length===0,a.replaceChildren(...s.map(d));let l=e.resume??null,u=m(e,n);o.hidden=l===null&&u===null,o.replaceChildren(...[l===null?null:f(l,n),u].filter(e=>e!==null))}function g(e){clearTimeout(u),c.classList.remove(`wui-chat-empty--revealed`),c.classList.add(`wui-chat-empty--intro`),l.update({active:!0,reduced:!1,authorKind:`Assistant`}),u=setTimeout(()=>{u=void 0,l.update({active:!1,reduced:!1,authorKind:`Assistant`}),c.classList.replace(`wui-chat-empty--intro`,`wui-chat-empty--revealed`)},e)}return{el:c,paint:h,intro:g,extraHost:i,pastHost:s}}function n7(){let e=document.createElement(`div`);e.className=`wui-chat-loader-orb`;let t=document.createElement(`span`);t.className=`wui-chat-loader-orb-mark`,t.setAttribute(`aria-hidden`,`true`);let n=document.createElement(`span`);n.className=`wui-chat-loader-orb-glow`,n.setAttribute(`aria-hidden`,`true`);let r=document.createElement(`span`);r.className=`wui-chat-loader-orb-disc`,r.setAttribute(`aria-hidden`,`true`),t.append(n,r);let i=document.createElement(`span`);return i.className=`wui-chat-loader-orb-label`,e.append(t,i),{el:e,render(e){i.textContent!==e.label&&(i.textContent=e.label)}}}var r7=150,i7=1800;function a7(){let e=document.createElement(`div`);e.className=`wui-chat-loader-phrases`;let t=document.createElement(`span`);t.className=`wui-chat-loader-phrases-orb`,t.setAttribute(`aria-hidden`,`true`);let n=document.createElement(`span`);n.className=`wui-chat-loader-phrases-stage`,e.append(t,n);let r=null,i=null;function a(){return e.closest(`.wui-chat-loader`)?.classList.contains(`wui-chat-loader--reduced`)===!0}function o(e){if(e.label===r)return;r=e.label;let t=i,o=document.createElement(`span`);o.className=`wui-chat-loader-phrases-text wui-chat-loader-phrases-text--in`,o.textContent=e.label,o.style.animationDelay=`-${Math.round(performance.now()%i7)}ms, 0s`,n.append(o),i=o,t&&(t.classList.remove(`wui-chat-loader-phrases-text--in`),t.classList.add(`wui-chat-loader-phrases-text--out`),t.style.animationDelay=`-${Math.round(performance.now()%i7)}ms, 0s`,a()?t.remove():setTimeout(()=>t.remove(),r7))}return{el:e,render:o}}var o7=[`95%`,`80%`,`60%`];function s7(){let e=document.createElement(`div`);e.className=`wui-chat-loader-skeleton`;let t=document.createElement(`div`);t.className=`wui-chat-loader-skeleton-label`;let n=document.createElement(`div`);n.className=`wui-chat-loader-skeleton-body`;let r=document.createElement(`span`);r.className=`wui-chat-loader-skeleton-avatar`,r.setAttribute(`aria-hidden`,`true`),n.append(r);for(let e of o7){let t=document.createElement(`span`);t.className=`wui-chat-loader-skeleton-line`,t.setAttribute(`aria-hidden`,`true`),t.style.width=e,n.append(t)}return e.append(t,n),{el:e,render(e){t.textContent!==e.label&&(t.textContent=e.label)}}}var c7=`http://www.w3.org/2000/svg`;function l7(e){if(e===`done`){let e=document.createElementNS(c7,`svg`);e.setAttribute(`viewBox`,`0 0 16 16`),e.setAttribute(`class`,`wui-chat-loader-steps-check`);let t=document.createElementNS(c7,`path`);return t.setAttribute(`d`,`M3 8.5 6.5 12 13 4.5`),t.setAttribute(`pathLength`,`1`),e.append(t),e}let t=document.createElement(`span`);return t.className=e===`active`?`wui-chat-loader-steps-ring`:`wui-chat-loader-steps-dot`,t}function u7(){let e=document.createElement(`div`);e.className=`wui-chat-loader-steps`;let t=document.createElement(`span`);t.className=`wui-chat-loader-steps-pill`;let n=document.createElement(`ol`);n.className=`wui-chat-loader-steps-list`,e.append(t,n);let r=[];function i(){let e=document.createElement(`li`);e.className=`wui-chat-loader-steps-item`;let t=document.createElement(`span`);t.className=`wui-chat-loader-steps-icon`,t.setAttribute(`aria-hidden`,`true`);let i=document.createElement(`span`);i.className=`wui-chat-loader-steps-text`,e.append(t,i);let a={li:e,icon:t,text:i,state:null};return r.push(a),n.append(e),a}function a(e){let a=e.steps.length===0;for(t.hidden=!a,n.hidden=a,a&&t.textContent!==e.label&&(t.textContent=e.label),e.steps.forEach((t,n)=>{let a=r[n]??i();a.text.textContent!==t&&(a.text.textContent=t);let o=n<e.activeIndex?`done`:n===e.activeIndex?`active`:`pending`;a.state!==o&&(a.state=o,a.li.dataset.state=o,a.icon.replaceChildren(l7(o)))});r.length>e.steps.length;)r.pop()?.li.remove()}return{el:e,render:a}}var d7={Steps:u7,Phrases:a7,Orb:n7,Skeleton:s7},f7=500;function p7(){let e=document.createElement(`div`);e.className=`wui-chat-loader`,e.setAttribute(`role`,`status`),e.hidden=!0;let t=document.createElement(`span`);t.className=`wui-chat-loader-avatar`,t.setAttribute(`aria-hidden`,`true`);let n=document.createElement(`div`);n.className=`wui-chat-loader-body`;let r=document.createElement(`span`);r.className=`visually-hidden`,e.append(t,n,r);let i=null,a=null,o=0,s=null,c=0,l=null,u=!1;function d(){s!==null&&clearInterval(s),s=null}function f(){e.isConnected?(o+=1,p()):d()}function p(){if(!a||!i)return;let t=Ie(i.style,i.steps,i.phrases,o);a.render(t),e.setAttribute(`aria-label`,t.label)}function m(){l!==null&&clearTimeout(l),l=null,u=!1,r.textContent=``}function h(e){!u&&l===null&&e&&(l=setTimeout(()=>{l=null,u=!0,r.textContent=e},f7))}function g(t){if(!t.active)i=null,e.hidden=!0,e.removeAttribute(`data-loading`),d(),m();else{if(!Object.hasOwn(d7,t.style))throw Error(`Unknown loader style. Use Steps, Phrases, Orb or Skeleton.`);if(!(t.intervalMs>0))throw Error(`Loader intervalMs must be a positive number.`);if(i={...t,steps:t.steps??[],phrases:t.phrases??[]},e.hidden=!1,e.setAttribute(`data-loading`,`true`),e.classList.toggle(`wui-chat-loader--reduced`,t.reduced===!0),!a||a.style!==t.style){let r=d7[t.style]();n.replaceChildren(r.el),a={style:t.style,render:r.render},e.dataset.style=t.style,o=0}h(t.announce),t.reduced===!0?(d(),o=0):(s===null||c!==t.intervalMs)&&(d(),c=t.intervalMs,s=setInterval(f,c)),p()}}function _(){d(),m(),a=null,i=null,e.remove()}return{el:e,update:g,destroy:_}}function m7({voice:e,getLabels:t,message:n}){if(n.streaming||!e.canSpeak()||D8(n.parts)===``)return null;let r=e.getStatus(),i=r.mode===`Speaking`&&r.messageId===n.id,a=t(),o=i?a.readAloudStop:a.readAloud,s=$(`button`,`wui-chat-action-btn wui-chat-speak`,{type:`button`,"aria-pressed":String(i),"aria-label":o,title:o});return s.append($6(i?`stop`:`speaker`,16)),s.addEventListener(`click`,()=>{e.toggleSpeak(n.id,n.parts)}),s}function h7({voice:e,getLabels:t,message:n}){let r=e.getStatus().note;if(r?.code!==`SpeakFailed`||r.messageId!==n.id)return null;let i=$(`span`,`wui-chat-action-notice`,{role:`status`});return i.textContent=O8(r,t()),i}var g7=new Set([`Assistant`,`Agent`]),_7=new Set([`Assistant`,`Agent`,`Script`]),v7=new Set([`Visitor`,`Customer`]),y7=48,b7=120,x7={author:{kind:`Assistant`,displayName:null,avatarUrl:null}},S7={warning:`alert-triangle`,danger:`alert-circle`};function C7(e){return e.scrollHeight-e.scrollTop-e.clientHeight<=y7}function w7(e){let{kind:t,displayName:n}=e.author;return t===`Agent`?`Agent:${n??``}`:t===`Script`?`Assistant`:t}function T7(e){for(let t=e?.parentElement;t&&t!==document.body;t=t.parentElement){let{overflowY:e}=getComputedStyle(t);if((e===`auto`||e===`scroll`)&&t.scrollHeight>t.clientHeight)return t}return null}function E7(e){let t=e.textContent?.trim();t&&!e.hasAttribute(`aria-label`)&&(e.setAttribute(`aria-label`,t),e.setAttribute(`title`,t))}function D7(e){return e.reduced===!0}function O7(e,t,n){let r=$(`button`,`${M2(`ghost`,`sm`)} wui-chat-action-btn`,{type:`button`,"aria-label":e,title:e}),i=$(`span`);return i.textContent=e,r.append(j2(t,14),i),r.addEventListener(`click`,n),{node:r,text:i}}function k7(e,t){return e.profile?.assistant.name??t.panelTitle}function A7(e,t,n){return e.author.displayName==null?e.author.kind===`Visitor`||e.author.kind===`Customer`?n.you:e.author.kind===`Agent`?n.agent:t.profile?.assistant.name??n.assistant:e.author.displayName}function j7(e){let t=$(`li`,`wui-chat-day`,{role:`presentation`}),n=$(`span`);return n.textContent=e,t.append(n),t}function M7(e){let t=$(`ol`,`wui-chat-thread`),n=$(`div`,`wui-chat-log`,{role:`log`,"aria-live":`polite`});n.append(t);let r=p7(),i=$(`li`,`wui-chat-message wui-chat-message--assistant wui-chat-message--loading`),a=$(`div`,`wui-chat-loader-slot`);a.append(r.el),i.append(a);let o=!1,s,c=$(`li`,`wui-chat-message wui-chat-message--assistant wui-chat-message--greeting`,{"data-run-start":``,"data-restored":``}),l=$(`div`,`wui-chat-message-body`),u=$(`p`,`wui-chat-text`);l.append(u),c.append(l);let d=$(`button`,`wui-chat-jump`,{type:`button`}),f=$(`div`,`wui-chat-jump-slot`);f.hidden=!0,f.append(d);let p=null,m=!0,h=null,g=null,_=new Map,v=``,y=null;function b(e,t){return{kind:e.kind,part:e,tag:t[e.kind]}}function x(t,n,r){return Object.assign(document.createElement(t),{message:r,turn:e.makeTurnApi(r.id),chatPart:n})}function S(e){return $(`div`,`wui-chat-part wui-chat-part--${e.toLowerCase()}`)}function C(e,t,n,r){e.parts=[];let i=[],a=e=>{let r=b(e,n),i=S(r.kind);return i.append(x(r.tag,r.part,t)),i};for(let e of r(t))if(Array.isArray(e)){let t=$(`div`,`wui-chat-part-group`);t.append(...e.map(a)),i.push(t)}else i.push(a(e));e.body.replaceChildren(...i)}function w(t,n,r){let i=[];n.parts.forEach((a,o)=>{let s=b(a,r),c=t.parts[o];if(c&&c.kind===s.kind&&c.tag===s.tag){c.part!==s.part&&(c.element.message=n,c.element.turn=e.makeTurnApi(n.id),c.element.chatPart=s.part,c.part=s.part),i.push(c);return}let l=S(s.kind),u=x(s.tag,s.part,n);l.append(u),i.push({kind:s.kind,tag:s.tag,part:s.part,element:u,wrapper:l})}),t.parts=i,T(t.body,i.map(e=>e.wrapper))}function T(e,t){let n=new Set(t);for(let t of[...e.children])n.has(t)||t.remove();t.forEach((t,n)=>{e.children[n]!==t&&e.insertBefore(t,e.children[n]??null)})}function E(e,t,n){let r=$(`div`,`wui-chat-rating`,{role:`group`,"aria-label":`${n.rateUp} / ${n.rateDown}`}),i=[[`Up`,n.rateUp,`thumbs-up`],[`Down`,n.rateDown,`thumbs-down`]];for(let[a,o,s]of i){let i=t.rating===a,c=$(`button`,`${M2(i?`neutral`:`ghost`,`sm`)} wui-chat-action-btn`,{type:`button`,"aria-pressed":String(i),"data-rating":a,"aria-label":o,title:o}),l=$(`span`);l.textContent=o,c.append(j2(s,14),l),c.addEventListener(`click`,()=>D(e,t,a,n)),r.append(c)}if(e.ratingNote){let t=$(`span`,null,{role:`status`});t.textContent=e.ratingNote,r.append(t)}return r}async function D(t,n,r,i){try{await e.onRate(n.id,r),t.ratingNote=i.rated}catch{t.ratingNote=i.ratingFailed}y&&ce(y.state,y.context)}function O(t,n,r,i,a){let{labels:o}=i,s=r.features,c=n.author.kind,l=sr(n.parts),u=[];if(s.Copy&&_7.has(c)&&l){let e=O7(o.copy,`copy`,async()=>{await Mi(l)&&(e.text.textContent=o.copied,e.node.dataset.done=``,e.node.setAttribute(`aria-label`,o.copied),e.node.title=o.copied,clearTimeout(t.copyTimer),t.copyTimer=setTimeout(()=>{e.text.textContent=o.copy,delete e.node.dataset.done,e.node.setAttribute(`aria-label`,o.copy),e.node.title=o.copy},ji))});u.push(e.node)}let d=e.getVoice?.();if(d&&_7.has(c)){let e=m7({voice:d,getLabels:()=>o,message:n});e&&u.push(e);let t=h7({voice:d,getLabels:()=>o,message:n});t&&u.push(t)}if(_7.has(c)){let e=$(`div`);D5(e,n,{labels:o,features:s,title:k7(r,o),assistantName:r.profile?.assistant.name,busy:r.streaming||r.thinking});for(let t of e.children)E7(t);u.push(...e.childNodes)}let f=r.messages.some(e=>e.author.kind===`Visitor`&&e.stored);a&&c===`Assistant`&&!r.streaming&&!r.thinking&&s.Regenerate&&f&&u.push(O7(o.regenerate,`refresh`,()=>e.onRegenerate()).node);let p=r.messages.findLast(e=>e.author.kind===`Visitor`&&e.stored);s.Edit&&p?.id===n.id&&!r.streaming&&!r.thinking&&u.push(O7(o.edit,`pencil`,()=>e.getSession().startEdit(n.id)).node),s.Rating&&n.stored&&g7.has(c)&&u.push(E(t,n,o)),t.actions.hidden=u.length===0,t.actions.replaceChildren(...u)}function k(e){let t=_.get(e.id);if(t)return t;let n=$(`li`,`wui-chat-message`),r=$(`span`,`wui-chat-author visually-hidden`),i=$(`div`,`wui-chat-message-body`),a=$(`div`,`wui-chat-message-actions`);n.append(r,i,a);let o={li:n,author:r,body:i,actions:a,head:null,parts:[],copyTimer:void 0,ratingNote:null};return _.set(e.id,o),o}function A(e,t,n,r){let i=n?.author.kind===`Agent`&&t.author.kind===`Agent`&&(n.author.displayName??``)===(t.author.displayName??``);e.head?.remove(),e.head=t.author.kind===`Agent`&&!i?Z2(t.author,r):null,e.head&&e.li.insertBefore(e.head,e.body)}function j(t,n,r,i,a,o){let{labels:s}=i;t.li.className=`wui-chat-message wui-chat-message--${n.author.kind.toLowerCase()}`,t.li.toggleAttribute(`data-restored`,n.restored===!0),t.li.toggleAttribute(`data-run-start`,!o||w7(o)!==w7(n)),n.streaming?t.li.setAttribute(`aria-busy`,`true`):t.li.removeAttribute(`aria-busy`),t.author.textContent=`${A7(n,r,s)}: `,A(t,n,o,s);let c=e.getRenderers(),l=e.getLayoutParts();typeof l==`function`?C(t,n,c,l):w(t,n,c),n.streaming?(t.actions.hidden=!0,t.actions.replaceChildren()):O(t,n,r,i,a)}function M(e,t){let n=$(`li`,`wui-chat-message wui-chat-message--system wui-chat-message--notice`),r=$(`div`,`wui-chat-notice wui-chat-notice--${e}`,{role:e===`danger`?`alert`:`status`}),i=$(`span`,`wui-chat-notice-icon`,{"aria-hidden":`true`});i.append(j2(S7[e],16));let a=$(`div`,`wui-chat-notice-body`),o=$(`span`,`wui-chat-notice-text`);return o.textContent=t,a.append(o),r.append(i,a),n.append(r),n}function ee(e,t){let n=e.resetsDateTimeUtc?` ${t.dailyLimitRefresh(a5(e.resetsDateTimeUtc))}`:``;return M(`warning`,`${e.message}${n}`)}function te(t,n){let{labels:r}=n,i=t.turnError,a=i?.code??``;if(i&&a===`daily_limit`)return ee(i,r);if(a.endsWith(`feature_off`))return M(`danger`,t.turnError?.message||r.stopped);let o=$(`li`,`wui-chat-message wui-chat-message--system wui-chat-message--error`),s=$(`p`,`wui-chat-error`,{role:`alert`});s.textContent=t.turnError?.message||r.stopped;let c=j2(`alert-circle`,16);if(c.setAttribute(`aria-hidden`,`true`),o.append(c,s),t.features.Retry){let t=$(`div`,`wui-chat-message-actions`);t.append(O7(r.retry,`rotate-ccw`,()=>e.onRetry()).node),o.append(t)}return o}function ne(){return t.closest(`.wui-chat`)}function re(){return t.closest(`.wui-chat-body`)??T7(t)}function ie(e){ne()?.classList.toggle(`wui-chat--scrolled`,e.scrollTop>0),C7(e)&&(f.hidden=!0)}function ae(){p!==null&&(m=C7(p),ie(p))}function oe(e){n.nextElementSibling!==f&&n.parentNode&&n.after(f),e!==p&&(p?.removeEventListener(`scroll`,ae),p=e,e.addEventListener(`scroll`,ae,{passive:!0}),!h&&typeof ResizeObserver==`function`&&(h=new ResizeObserver(()=>{m&&p&&(p.scrollTop=p.scrollHeight)}),h.observe(t)))}d.addEventListener(`click`,()=>{let e=re(),t=y?.context.reduced===!0;e?.scrollTo({top:e.scrollHeight,behavior:t?`auto`:`smooth`}),f.hidden=!0,d.blur()});function se(e,t){let n=e.messages.at(-1),r=n?`${n.id}|${n.parts.length}|${sr(n.parts).length}`:``;if(r===v)return;let i=v===``||e.conversationId!==g;v=r,g=e.conversationId;let a=re();a&&(oe(a),i||t||n!==void 0&&v7.has(n.author.kind)?(a.scrollTop=a.scrollHeight,f.hidden=!0,m=!0):(f.hidden=!1,m=!1),ie(a))}function ce(e,a){y={state:e,context:a};let{labels:l}=a;n.setAttribute(`aria-label`,l.thread),d.textContent=l.newMessages??`New messages`;let f=re();f&&oe(f);let p=f===null||f.clientHeight===0||C7(f),m=[],h=new Set,g=e.messages.filter(e=>!(e.streaming&&e.parts.length===0)),v=g[0],b=v!==void 0&&v7.has(v.author.kind)&&e.greeting?e.greeting:null,x=null,S=e=>{let t=or(e.createdDateTimeUtc,l);t!==x&&(x=t,m.push(j7(t)))};b&&v&&(S(v),u.textContent=b,m.push(c)),g.forEach((t,n)=>{let r=k(t);h.add(t.id),S(t);let i=g[n-1]??(b?x7:null);j(r,t,e,a,n===g.length-1,i),m.push(r.li)});for(let e of[..._.keys()])h.has(e)||_.delete(e);e.agentTyping&&m.push(Q2(e.agentTyping,l)),e.thinking?(clearTimeout(s),s=void 0,i.classList.remove(`wui-chat-message--leaving`),o=!0,r.update({active:!0,style:a.loaderStyle,steps:e.steps,phrases:a.phrases,intervalMs:a.intervalMs,reduced:a.reduced,announce:a.assistantName?.trim()?l.preparingAnswer(a.assistantName):void 0}),m.push(i)):o&&s===void 0&&!D7(a)?(i.classList.add(`wui-chat-message--leaving`),s=setTimeout(()=>{s=void 0,o=!1,i.classList.remove(`wui-chat-message--leaving`),r.update({active:!1}),y&&ce(y.state,y.context)},b7),m.push(i)):s===void 0?(o=!1,r.update({active:!1})):m.push(i),!e.streaming&&(e.turnError||e.stopped)&&m.push(te(e,a)),T(t,m),se(e,p)}function le(e){return _.get(e)?.li??null}function ue(){clearTimeout(s),r.destroy(),p?.removeEventListener(`scroll`,ae),h?.disconnect(),_.clear(),y=null,n.remove()}return{el:n,paint:ce,find:le,destroy:ue}}var N7=`wchat:auto-opened`,P7=`wchat:dismissed`,F7=`button, a[href], input, select, textarea`,I7=`input, textarea`;function L7(e){return!e.closest(`.wui-chat`)}function R7(e){return e instanceof Element&&e.matches(I7)&&L7(e)}function z7(){return[...document.querySelectorAll(I7)].some(e=>L7(e)&&e.value!==e.defaultValue)}function B7(e){return e.length!==0&&[...document.querySelectorAll(e.join(`,`))].some(e=>{let t=e.getBoundingClientRect();return t.width>0&&t.height>0})}function V7(e){return e?[...document.querySelectorAll(F7)].some(t=>{if(!L7(t))return!1;let n=t.getBoundingClientRect();return n.width===0||n.height===0?!1:n.left<e.right&&n.right>e.left&&n.top<e.bottom&&n.bottom>e.top}):!1}function H7(e,t,n){if(e.oncePerSession&&sessionStorage.getItem(N7)||e.rememberDismissal&&sessionStorage.getItem(P7)||window.innerWidth<e.skipBelowWidthPx)return!0;let r=window.location.pathname;if(e.skipPathPrefixes.some(e=>r.startsWith(e)))return!0;let i=t.avoid.autoOpenOptOutSelector;return i&&document.querySelector(i)||e.skipWhenFormTouched&&z7()||n.isOpen()?!0:e.skipWhenCoversControl&&V7(n.panelRect())}function U7(e){return R7(document.activeElement)||B7(e.avoid.menuSelectors)||B7(e.avoid.autoOpenBusySelectors)}function W7(e,t,n){let r;function i(){r=void 0,H7(e,t,n)||(U7(t)?r=setTimeout(i,e.busyRetrySeconds*1e3):(sessionStorage.setItem(N7,`1`),n.open()))}return r=setTimeout(i,e.delaySeconds*1e3),{cancel(){clearTimeout(r),r=void 0}}}var G7=.4,K7=20;function q7(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function J7(e){let t=e.match(/[\d.]+/g);if(!t||t.length<3)return null;let[n=0,r=0,i=0]=t.slice(0,3).map(Number);return{r:n,g:r,b:i,alpha:t.length>3?Number(t[3])/(e.includes(`%`)?100:1):1}}function Y7({r:e,g:t,b:n}){return .2126*q7(e)+.7152*q7(t)+.0722*q7(n)}function X7(e,t){let n=e.getBoundingClientRect(),r=document.elementsFromPoint?.(n.left+n.width/2,n.top+n.height/2)??[],i=t.length?t.join(`,`):null;for(let t of r){if(e.contains(t))continue;if(i&&t.closest(i))return!0;let n=J7(getComputedStyle(t).backgroundColor);if(n&&n.alpha>0)return Y7(n)<G7}return!1}function Z7(e){return e.length===0?[]:[...document.querySelectorAll(e.join(`,`))]}function Q7(e){let t=0;for(let n of e){let e=n.getBoundingClientRect();e.height!==0&&(t=Math.max(t,window.innerHeight-e.top))}return t>0?t+K7:0}function $7(e){if(e.length===0)return!1;for(let t of document.querySelectorAll(e.join(`,`))){let e=t.getBoundingClientRect();if(e.width>0&&e.height>0)return!0}return!1}function e9(e,t,n){let r=n.ownerDocument.documentElement,i=0,a=!1,o=null;function s(){i=0;let s=t.liftAboveFooter?Z7(e.liftSelectors):[];if(o)for(let e of s)o.observe(e);n.style.setProperty(`--wui-chat-lift`,`${Q7(s)}px`);let c=n.getBoundingClientRect(),l=c.height===0?0:Math.round(window.innerHeight-c.top);r.style.setProperty(`--wui-chat-launcher-block`,`${l}px`);let u=t.stepAsideForMenus&&$7(e.menuSelectors);u&&!a?(n.dataset.launcher=`hidden`,n.inert=!0,a=!0):!u&&a&&(n.dataset.launcher=`idle`,n.inert=!1,a=!1);let d=t.switchOnDark&&X7(n,e.darkSelectors);d&&n.dataset.onDark===void 0&&(n.dataset.onDark=``),!d&&n.dataset.onDark!==void 0&&delete n.dataset.onDark}function c(){i||=requestAnimationFrame(s)}typeof ResizeObserver==`function`&&(o=new ResizeObserver(c));let l=new MutationObserver(c);return l.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`class`,`open`,`data-menu-open`]}),document.addEventListener(`scroll`,c,{capture:!0,passive:!0}),window.addEventListener(`resize`,c),window.addEventListener(`load`,c),n.addEventListener(`animationend`,c),c(),{destroy(){i&&cancelAnimationFrame(i),i=0,o?.disconnect(),l.disconnect(),document.removeEventListener(`scroll`,c,{capture:!0}),window.removeEventListener(`resize`,c),window.removeEventListener(`load`,c),n.removeEventListener(`animationend`,c),a&&=(n.inert=!1,!1),delete n.dataset.onDark,n.style.removeProperty(`--wui-chat-lift`),r.style.removeProperty(`--wui-chat-launcher-block`)}}}var t9=`wchat:session-start`,n9=`wchat:pages`,r9=`wchat:services`;function i9(e){let t=sessionStorage.getItem(e);return t?JSON.parse(t):[]}function a9(e,t){sessionStorage.setItem(e,JSON.stringify(t))}function o9(e,t){let n=t.find(t=>e.startsWith(t));return n===void 0?null:e.slice(n.length).replace(/^\/+|\/+$/g,``)||null}function s9(e){sessionStorage.getItem(t9)||sessionStorage.setItem(t9,String(Date.now()));let t=0;function n(){let e=document.documentElement.scrollHeight;if(e<=0)return;let n=(window.scrollY+window.innerHeight)/e*100;n>t&&(t=n)}return window.addEventListener(`scroll`,n,{passive:!0}),function(){n();let r=window.location.pathname,i=i9(n9);i.includes(r)||(i.push(r),a9(n9,i));let a=o9(r,e),o=i9(r9);return a!==null&&(o=o.filter(e=>e!==a),o.push(a),o=o.slice(-10),a9(r9,o)),{timeOnSiteSeconds:Math.floor((Date.now()-Number(sessionStorage.getItem(t9)))/1e3),scrollPercent:Math.min(100,Math.floor(t)),pagesViewed:i.length,viewedServices:o}}}var c9=`a[href],button:not([disabled]),input:not([disabled]):not([type='hidden']),select:not([disabled]),textarea:not([disabled]),[tabindex]`;function l9(e,t){if(t.key!==`Tab`)return;let n=[...e.querySelectorAll(c9)].filter(e=>e.tabIndex>=0&&!e.hidden),r=n[0],i=n[n.length-1];if(!r||!i){t.preventDefault();return}let a=e.ownerDocument.activeElement,o=e.contains(a);t.shiftKey?o&&a!==r||(t.preventDefault(),i.focus()):o&&a!==i||(t.preventDefault(),r.focus())}function u9(e){e?.isConnected&&e.focus()}function d9(e,t){if(t||typeof navigator>`u`)return;let n=navigator;typeof n.vibrate==`function`&&n.vibrate(e)}var f9=`wui-chat-lock`,p9=`wui-chat-scroll-lock`;function m9(e){let t=e.ownerDocument,n=[t.documentElement,t.body],r=e.style.overscrollBehavior;for(let e of n)e.classList.add(f9);e.setAttribute(`data-lenis-prevent`,``),e.style.overscrollBehavior=`contain`,window.dispatchEvent(new CustomEvent(p9,{detail:{locked:!0}}));let i=!0;return function(){if(i){i=!1;for(let e of n)e.classList.remove(f9);e.removeAttribute(`data-lenis-prevent`),e.style.overscrollBehavior=r,window.dispatchEvent(new CustomEvent(p9,{detail:{locked:!1}}))}}}var h9={open:{from:420,to:920,seconds:.16,peak:.16},reply:{from:680,to:540,seconds:.11,peak:.06},sent:{from:540,to:760,seconds:.09,peak:.05}},g9=[`pointerdown`,`keydown`,`touchstart`],_9=`wchat:muted`,v9=1e-4;function y9(e,t){let n=t.get(_9)===`1`,r=null;function i(){for(let e of g9)document.removeEventListener(e,a)}function a(){let e=globalThis.AudioContext||globalThis.webkitAudioContext;!r&&e&&(r=new e),r?.state===`suspended`&&r.resume().catch(e=>globalThis.reportError?.(e)),i()}for(let e of g9)document.addEventListener(e,a);return{play(t){let i=h9[t];if(!i||n||!r||!e[t]||!(e.volume>0))return;let a=r.currentTime,o=r.createOscillator(),s=r.createGain();o.type=`sine`,o.frequency.setValueAtTime(i.from,a),o.frequency.linearRampToValueAtTime(i.to,a+i.seconds),s.gain.setValueAtTime(i.peak*e.volume,a),s.gain.exponentialRampToValueAtTime(v9,a+i.seconds),o.connect(s),s.connect(r.destination),o.start(a),o.stop(a+i.seconds)},setMuted(e){n=!!e,t.set(_9,n?`1`:`0`)},isMuted(){return n},destroy(){i(),r?.close().catch(e=>globalThis.reportError?.(e)),r=null}}}var b9=2e3,x9=500,S9=32,C9=16,w9=`data-wui-chat-switching`;function T9(e){return new Promise(t=>setTimeout(t,e))}function E9(e,t){return typeof e!=`function`||e()?Promise.resolve():new Promise(n=>{let r=0,i=()=>{e()||r>=t?n():(r+=C9,setTimeout(i,C9))};setTimeout(i,C9)})}async function D9(e,t={}){let n=t.reduced??globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0;if(typeof document.startViewTransition!=`function`||n){await e();return}let r=document.documentElement;r.setAttribute(w9,``);try{let n=()=>!t.target||document.querySelector(`.wui-chat--${t.target}`)!==null,r=()=>(typeof t.pageReady!=`function`||t.pageReady())&&n(),i=document.startViewTransition(async()=>{await e(),await E9(t.routeReady,b9),await E9(r,x9),await T9(S9)});Promise.allSettled([i.ready]);try{await i.updateCallbackDone}finally{await Promise.allSettled([i.finished])}}finally{r.removeAttribute(w9)}}var O9=100,k9=12,A9=220,j9=640;function M9(e,t){let n=t.phone.mode===`Sheet`,r=window.visualViewport,i;function a(){e.style.removeProperty(`bottom`),e.style.removeProperty(`max-height`)}function o(){if(i=void 0,window.innerWidth>t.phone.maxWidthPx){a();return}if(!r)return;let o=Math.max(0,window.innerHeight-r.height-r.offsetTop),s=r.height-k9;n&&(s=Math.min(j9,Math.max(A9,s))),e.style.bottom=`${o}px`,e.style.maxHeight=`${s}px`}function s(){clearTimeout(i),i=setTimeout(o,O9)}return r?.addEventListener(`resize`,s),r?.addEventListener(`scroll`,s),window.addEventListener(`resize`,s),window.addEventListener(`orientationchange`,s),o(),{destroy(){clearTimeout(i),r?.removeEventListener(`resize`,s),r?.removeEventListener(`scroll`,s),window.removeEventListener(`resize`,s),window.removeEventListener(`orientationchange`,s),a()}}}var N9=[`launcher`,`docked`,`full-page`,`embedded`],P9=[`end`,`start`],F9={steps:`Steps`,phrases:`Phrases`,orb:`Orb`,skeleton:`Skeleton`},yee={on:`On`,reduced:`Reduced`},bee=[`auto`,`light`,`dark`];function xee(e){return bee.find(t=>t===e)??`auto`}var See=`wchat:muted`,Cee=6e4,wee=400,Tee=[`labels`,`pageContext`,`compact`,`expressive`,`open`,`layoutParts`,`getCaptchaToken`,`attribution`,`openAttachment`,`openCitation`,`openTarget`,`openTicket`,`onNavigate`,`resolveLink`,`emptyContent`,`onPanelSwitch`,`preloadPanelSwitch`],I9={...i8};function L9(e,t){if(!R2.includes(e))throw Error(`Unknown part kind "${e}". Use one of ${R2.join(`, `)}.`);if(typeof t!=`string`||!t.includes(`-`))throw Error(`Renderer tag "${t}" must be a custom element name containing a hyphen.`)}function Eee(e,t){L9(e,t),I9[e]=t}function R9(e,t){return n=>{let r=n.toLowerCase(),i=Object.hasOwn(t,r)?t[r]:void 0;if(i===void 0)throw Error(`<wui-chat ${e}> must be one of ${Object.keys(t).join(`, `)}, got "${n}".`);return i}}function z9(e){return t=>{let n=Number(t);if(!Number.isInteger(n)||n<0)throw Error(`<wui-chat ${e}> must be a whole number of pixels, got "${t}".`);return n}}function B9(e){return t=>{if(t===``||t===`true`)return!0;if(t===`false`)return!1;throw Error(`<wui-chat ${e}> must be true or false, got "${t}".`)}}var V9=e=>e.split(`,`).map(e=>e.trim()).filter(Boolean),H9=[[`launcher-style`,`launcher`,`style`,R9(`launcher-style`,{round:`Round`,pill:`Pill`})],[`entrance`,`launcher`,`entrance`,R9(`entrance`,{"slide-up":`SlideUp`,"bounce-in":`BounceIn`,"fade-in-pulse":`FadeInPulse`,"spin-scale":`SpinScale`,"wiggle-in":`WiggleIn`,"elastic-in":`ElasticIn`,rise:`Rise`,none:`None`})],[`idle`,`launcher`,`idle`,R9(`idle`,{"float-and-pulse":`FloatAndPulse`,ring:`Ring`,none:`None`})],[`label-reveal`,`launcher`,`labelReveal`,R9(`label-reveal`,{bubble:`Bubble`,expand:`Expand`})],[`compact`,`launcher`,`compact`,B9(`compact`)],[`launcher-mark`,`launcher`,`mark`,R9(`launcher-mark`,{icon:`Icon`,avatar:`Avatar`,orb:`Orb`})],[`panel-height`,`panel`,`height`,R9(`panel-height`,{fixed:`Fixed`,content:`Content`})],[`reply-avatars`,`panel`,`replyAvatars`,B9(`reply-avatars`)],[`greeting-loader-ms`,`panel`,`greetingLoaderMs`,z9(`greeting-loader-ms`)],[`panel-motion`,`panel`,`motion`,R9(`panel-motion`,{spring:`Spring`,gentle:`Gentle`,none:`None`})],[`panel-width`,`panel`,`widthPx`,z9(`panel-width`)],[`panel-max-height`,`panel`,`maxHeightPx`,z9(`panel-max-height`)],[`panel-bottom-gap`,`panel`,`bottomGapPx`,z9(`panel-bottom-gap`)],[`phone-max-width`,`phone`,`maxWidthPx`,z9(`phone-max-width`)],[`phone-mode`,`phone`,`mode`,R9(`phone-mode`,{"full-screen":`FullScreen`,sheet:`Sheet`})],[`sheet-height-dvh`,`phone`,`sheetHeightDvh`,z9(`sheet-height-dvh`)],[`sheet-max-height`,`phone`,`sheetMaxHeightPx`,z9(`sheet-max-height`)],[`input-ring`,`input`,`ring`,B9(`input-ring`)],[`send-reveal`,`input`,`sendReveal`,R9(`send-reveal`,{"on-text":`OnText`,always:`Always`})],[`send-icon`,`input`,`sendIcon`,e=>e],[`lift-selectors`,`avoid`,`liftSelectors`,V9],[`menu-selectors`,`avoid`,`menuSelectors`,V9],[`dark-selectors`,`avoid`,`darkSelectors`,V9],[`autoopen-busy-selectors`,`avoid`,`autoOpenBusySelectors`,V9],[`autoopen-optout-selector`,`avoid`,`autoOpenOptOutSelector`,e=>e]],U9={layout:`launcher`,position:`end`,"offset-x":`24`,"offset-y":`24`,loader:`steps`,motion:`on`,icon:`chat`},W9=[`base`,`layout`,`position`,`offset-x`,`offset-y`,`loader`,`screen`,`motion`,`theme`,`icon`,`avatar`,`narrow`,...H9.map(([e])=>e).filter(e=>e!==`compact`)],Dee=e=>e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase());function G9(e){let t={launcher:{},panel:{},phone:{},input:{},avoid:{}};for(let[n,r,i,a]of H9){let o=e.getAttribute(n);o!=null&&(t[r][i]=a(o))}let n=e.getAttribute(`motion`),r=e.getAttribute(`avatar`),i=e.getAttribute(`expressive`);return Cr({...t,...n==null?{}:{motion:R9(`motion`,yee)(n)},...r?{avatar:r}:{},...i==null?{}:{expressive:B9(`expressive`)(i)}})}function Oee(e){let t=e.getAttribute(`loader`)??`steps`,n=Object.hasOwn(F9,t)?F9[t]:void 0;if(n===void 0)throw Error(`<wui-chat loader> must be one of ${Object.keys(F9).join(`, `)}, got "${t}".`);return n}function kee(e){let t=e.getAttribute(`narrow`);if(t!=null&&t!==``)return Object.fromEntries(V9(t).map(e=>[e,!1]))}function K9(e){return e===See?globalThis.localStorage:globalThis.sessionStorage}var q9={get:e=>K9(e).getItem(e),set:(e,t)=>K9(e).setItem(e,t)};function J9(e){return globalThis.innerWidth<=e.phone.maxWidthPx}function Aee(e){let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)}function jee(e){return e.features.HumanHandoff===!0&&e.conversationState===`Open`&&e.messages.some(e=>e.author.kind===`Visitor`||e.author.kind===`Customer`)&&!e.streaming&&!e.thinking}function Mee(e,t){if(e.conversationState===`WaitingForAgent`)return t.statusWaitingForAgent;if(e.conversationState===`WithAgent`){let n=e.agent?.displayName;return t.statusWithAgent(typeof n==`string`&&n.trim()!==``?n:t.handoffAgentFallback)}return t.headerStatus}function Y9(e,t,n){return t.PanelSwitch!==!0||typeof n!=`function`?null:e===`docked`?`full-page`:e===`full-page`?`docked`:null}function Nee(e){if(!N9.some(t=>t===e))throw Error(`<wui-chat layout> must be one of ${N9.join(`, `)}, got "${e}".`)}function X9(e){if(!P9.some(t=>t===e))throw Error(`<wui-chat position> must be one of ${P9.join(`, `)}, got "${e}".`)}function Pee(e,t){let n=e[t];delete e[t],e[t]=n}function Fee(e){return e==null?{}:Object(e)}var Z9=0,Q9=class extends da{static get observedAttributes(){return[...W9,`compact`,`expressive`,`open`,`labels`,`page-context`,`narrow`].filter((e,t,n)=>n.indexOf(e)===t)}constructor(){super(),Z9+=1,this._uid=`wui-chat-${Z9}`,this._built=!1,this._session=null,this._unsubscribe=null,this._voice=null,this._voiceConversationId=void 0,this._labelsProp=void 0,this._pageContextProp=void 0,this._layoutParts=null,this._renderers={...I9},this._rendererApi={define:(e,t)=>{L9(e,t),this._renderers[e]=t,this._render()},map:this._renderers},this._captchaToken=null,this._attribution=null,this._openAttachmentProp=null,this._openCitationProp=null,this._openTargetProp=null,this._resolveLinkProp=null,this._openTicketProp=void 0,this._emptyContentProp=null,this._onPanelSwitchProp=null,this._preloadPanelSwitchProp=null,this._preloaded=!1,this._pastList=null,this._past=null,this._pastRefreshed=!1,this._historyShown=!1,this._openedConversation=null,this._lastOpen=!1,this._openTrigger=`manual`,this._focusTimer=null,this._nudgeArmed=!1,this._seeded=!1,this._wasLoading=!1,this._seen=new Set,this._sound=null,this._behaviour=null,this._autoOpen=null,this._avoid=null,this._motion=null,this._phone=null,this._requesting=!1,this._onKeyDown=e=>{e.key===`Escape`&&this._session?.getState().open&&(e.stopPropagation(),this._session.close(`escape`))}}get session(){return this._session??null}get conversationId(){return this._session?.getState().conversationId??null}get labels(){return oe({...Fee(F2(this,`labels`)),...this._labelsProp})}set labels(e){this._labelsProp=e??void 0,this._render()}get pageContext(){return this._pageContextProp===void 0?F2(this,`page-context`):this._pageContextProp}set pageContext(e){this._pageContextProp=e===null?void 0:e}get compact(){let e=this.getAttribute(`compact`);return e!=null&&B9(`compact`)(e)}set compact(e){this.toggleAttribute(`compact`,e===!0||e===``||e===`true`)}get expressive(){let e=this.getAttribute(`expressive`);return e!=null&&B9(`expressive`)(e)}set expressive(e){this.toggleAttribute(`expressive`,e===!0||e===``||e===`true`)}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e===!0||e===``||e===`true`)}get renderers(){return this._rendererApi}get layoutParts(){return this._layoutParts}set layoutParts(e){this._layoutParts=typeof e==`function`?e:null,this._render()}get getCaptchaToken(){return this._captchaToken}set getCaptchaToken(e){this._captchaToken=typeof e==`function`?e:null}get attribution(){return this._attribution}set attribution(e){this._attribution=typeof e==`function`?e:null}get openAttachment(){return this._openAttachmentProp??(e=>this._defaultOpenAttachment(e))}set openAttachment(e){this._openAttachmentProp=typeof e==`function`?e:null}get openCitation(){return this._openCitationProp??((e,t)=>this._defaultOpenCitation(e,t))}set openCitation(e){this._openCitationProp=typeof e==`function`?e:null}get openTarget(){return this._openTargetProp??(e=>this._defaultOpenTarget(e))}set openTarget(e){this._openTargetProp=typeof e==`function`?e:null}get openTicket(){return this._openTicketProp}set openTicket(e){this._openTicketProp=typeof e==`function`?e:void 0}get onNavigate(){return this._onNavigateProp}set onNavigate(e){this._onNavigateProp=typeof e==`function`?e:void 0}get resolveLink(){return this._resolveLinkProp}set resolveLink(e){this._resolveLinkProp=typeof e==`function`?e:null}get emptyContent(){return this._emptyContentProp}set emptyContent(e){if(e!==null&&!(e instanceof Node))throw TypeError(`emptyContent must be a Node or null`);this._emptyContentProp=e,this._applyEmptyContent()}get onPanelSwitch(){return this._onPanelSwitchProp}set onPanelSwitch(e){this._onPanelSwitchProp=typeof e==`function`?e:null}get preloadPanelSwitch(){return this._preloadPanelSwitchProp}set preloadPanelSwitch(e){this._preloadPanelSwitchProp=typeof e==`function`?e:null}connectedCallback(){this._adoptEarlyProperties();let e=this._assertLayout();if(this._assertPosition(),this.base.trim()===``)throw TypeError(`<wui-chat> needs a base path, e.g. base="/api/assistant".`);this._built||this._build(),this._shell||this._buildShell(e),this._session||this._createSession(),this._past||this._createPast(),this._unsubscribe||=this.requireSession().subscribe(()=>this._render()),this._render()}_adoptEarlyProperties(){for(let e of Tee)Object.hasOwn(this,e)&&Pee(this,e)}disconnectedCallback(){this._voice?.stop(),this._session?.stop(),this._unsubscribe?.(),this._unsubscribe=null,this._disposePast(),this._shell?.destroy?.(),document.removeEventListener(`keydown`,this._onKeyDown),this._avoid?.destroy(),this._avoid=null,this._autoOpen?.cancel(),this._autoOpen=null,this._motion?.destroy(),this._motion=null}attributeChangedCallback(e,t,n){if(this._built&&t!==n){if(e===`layout`)this._buildShell(this._assertLayout());else if(e===`position`)this._assertPosition();else if(e===`base`||e===`screen`||e===`narrow`)this._resetSession();else if(e===`motion`)this._motion?.destroy(),this._motion=null;else if(e===`open`&&this._session){let e=this._session.getState().open;this.open!==e&&this._setOpen(this.open,`manual`)}this._render()}}toggle(){this._session&&(this._session.getState().open?this._session.close(`button`):this._setOpen(!0,`manual`))}close(){this._voice?.stop(),this._session?.close(`button`)}newConversation(){this._voice?.stop(),this._session?.newConversation(),this._past?.refresh()}reset(){this._voice?.stop(),this._session?.reset()}_setOpen(e,t){this._session&&(e?(this._openTrigger=t,this._session.open({trigger:t})):this._session.close(`button`))}_assertLayout(){let e=this.layout;return Nee(e),e}_assertPosition(){X9(this.position)}get _position(){let e=this.position;return X9(e),e}_isLauncherLike(){return this.layout===`launcher`||this.layout===`docked`}requireSession(){if(!this._session)throw TypeError(`wui-chat: _session is not ready; the element is not connected`);return this._session}requireVoice(){if(!this._voice)throw TypeError(`wui-chat: _voice is not ready; the element is not connected`);return this._voice}requireMotion(){if(!this._motion)throw TypeError(`wui-chat: _motion is not ready; the element is not connected`);return this._motion}requirePastList(){if(!this._pastList)throw TypeError(`wui-chat: _pastList is not ready; the element is not connected`);return this._pastList}requireNudgeHost(){if(!this._shell.nudgeHost)throw TypeError(`wui-chat: the launcher shell has no nudge host`);return this._shell.nudgeHost}_build(){this._built=!0,this._header=W8({onNew:()=>this.newConversation(),onHistory:()=>this._toggleHistory(),onClose:()=>this.close(),onMute:()=>{this._session&&this._session.setMuted(!this._session.getState().muted)},onSwitch:()=>this._switchPanel(),titleId:`${this._uid}-title`}),this._starters=t7({onStarter:e=>this.requireSession().submit(e.message),onResume:()=>this.requireSession().resumeLast(),onTicket:e=>{typeof this.openTicket==`function`&&this.openTicket({ticketId:e.ticketId,number:e.number})}}),this._applyEmptyContent(),this._voice=k8({getState:()=>this.requireSession().getState(),getToken:()=>this.requireSession().client.getSpeechToken()}),this._voice.subscribe(()=>this._render()),this._thread=M7({getRenderers:()=>this._renderers,getLayoutParts:()=>this._layoutParts,makeTurnApi:e=>this._makeTurnApi(e),onRetry:()=>this.requireSession().retry(),onRegenerate:()=>this.requireSession().regenerate(),onRate:(e,t)=>this.requireSession().rate(e,t),getSession:()=>this.requireSession(),getVoice:()=>this._voice}),this._composer=L8({voice:this._voice,onSubmit:e=>this.requireSession().submit(e),onStop:()=>this.requireSession().stop(),onAttach:e=>this.requireSession().attach(e),onRemove:e=>this.requireSession().removeAttachment(e),onCancelEdit:()=>this.requireSession().cancelEdit(),onTyping:()=>this.requireSession().notifyTyping(),onDraftApplied:()=>this.requireSession().consumeDraft()}),this._footer=H8(),this._history=q8({getClient:()=>this.requireSession().client,getLabels:()=>this.labels,getFeatures:()=>this.requireSession().getState().features,onOpen:e=>{Promise.allSettled([this.requireSession().openConversation(e)]),this._toggleHistory(!1)},onDeleted:e=>{e===this.conversationId&&this.requireSession().newConversation()}}),this._nudge=$8({onActivate:()=>this._setOpen(!0,`manual`),onDismiss:()=>{}}),this._status=$(`p`,null,{role:`status`}),this._status.hidden=!0,this._errorEl=$(`p`,`wui-chat-profile-error`,{role:`alert`}),this._errorEl.hidden=!0,this._liveStatus=$(`p`,`wui-chat-live-status`,{role:`status`}),this._liveStatus.hidden=!0,this._talk=$(`button`,`${M2(`outline`,`sm`)} wui-chat-handoff-request`,{type:`button`}),this._talk.addEventListener(`click`,()=>this._requestHandoff()),this._liveRetry=$(`button`,M2(`ghost`,`sm`),{type:`button`}),this._liveRetry.addEventListener(`click`,()=>this.requireSession().resumeLive()),this._liveError=$(`p`,`wui-chat-live-error`,{role:`alert`}),this._liveError.hidden=!0,this._live=$(`div`,`wui-chat-live`),this._live.append(this._liveStatus,this._talk,this._liveRetry,this._liveError),this._live.hidden=!0,this._body=$(`div`,`wui-chat-body`),this._body.append(this._starters.el,this._thread.el,this._live,this._history.el,this._status,this._errorEl),this._foot=$(`div`,`wui-chat-foot`),this._foot.append(...this._composer.nodes,this._footer.el)}_buildShell(e){let t={launcher:J5,docked:U5,"full-page":Y5,embedded:W5};this._shell?.destroy?.(),this._avoid?.destroy(),this._avoid=null,this._autoOpen?.cancel(),this._autoOpen=null,this._lastOpen=!1,this._launcherPlayed=!1;let n=t[e]({id:`${this._uid}-panel`,position:this._position,onToggle:()=>this.toggle()});n.panel.append(this._header.el,this._body,this._foot),n.panel.setAttribute(`aria-labelledby`,`${this._uid}-title`),n.panel.addEventListener(`keydown`,e=>{e.key===`Tab`&&l9(n.panel,e)}),n.nudgeHost&&n.nudgeHost.prepend(this._nudge.el),this._shell=n,this.replaceChildren(n.root)}_createSession(){let e=Vt(Q8(),{base:this.base}),t=kee(this);this._session=Qr(e,{...this.screen?{screen:this.screen}:{},...t===void 0?{}:{narrow:t},pageContext:()=>this.pageContext,attribution:()=>this._attribution?.()??null,behaviour:()=>this._session?.getState().features.BehaviourStarters?this._behaviour?.()??null:null,prefs:q9,reducedMotion:()=>this._motion?.reduced??!1,schedule:Aee,getCaptchaToken:e=>{if(this._captchaToken)return this._captchaToken(e);let t=this._session?.getState().profile?.captcha?.siteKey;return t?f5(t,e):Promise.resolve(null)},onEvent:(e,t)=>{this.dispatchEvent(new CustomEvent(`wui-chat-event`,{bubbles:!0,detail:{name:e,data:t}}))},onError:()=>{},labels:this.labels}),this._unsubscribe=null,this._lastOpen=!1,this._openApplied=!1,this._seeded=!1,this._wasLoading=!1,this._seen=new Set,this._pastRefreshed=!1}_createPast(){this._pastList=Wt({client:this.requireSession().client,pageSize:20}),this._past=s5({list:this._pastList,getLabels:()=>this.labels,getFeatures:()=>this.requireSession().getState().features,onOpen:e=>{Promise.allSettled([this.requireSession().openConversation(e)])}}),this._starters.pastHost.append(this._past.el)}_disposePast(){this._past&&(this._past.el.remove(),this._past.dispose(),this.requirePastList().dispose(),this._past=null,this._pastList=null)}_applyEmptyContent(){if(!this._starters)return;let e=this._starters.extraHost;e.replaceChildren(...this._emptyContentProp?[this._emptyContentProp]:[]),e.hidden=!this._emptyContentProp}_switchPanel(){let e=this.requireSession().getState(),t=this._onPanelSwitchProp,n=Y9(this.layout,e.features,t);if(t===null||n===null)return;n===`full-page`&&this.close();let r={from:this.layout,to:n,conversationId:e.conversationId,draft:this._composer.getDraft()};D9(()=>t.call(this,r),{target:n,reduced:this._motion?.reduced===!0}).then(()=>document.querySelector(`.wui-chat--${n} .wui-chat-input`)?.focus()).catch(e=>globalThis.reportError?.(e))}async _requestHandoff(){this._requesting=!0,this._liveError.hidden=!0,this._render();try{await this.requireSession().requestHandoff()}catch(e){let t=typeof e==`object`&&e&&`message`in e?e.message:void 0;this._liveError.textContent=typeof t==`string`&&t||this.labels.errorGeneric,this._liveError.hidden=!1}finally{this._requesting=!1,this._render()}}_paintLive(e,t,n){let r=e.live===`Lost`,i=jee(e);this._liveStatus.hidden=!r,this._liveStatus.textContent=r?t.liveLost:``,this._liveRetry.hidden=!r,this._liveRetry.textContent=t.retry,this._talk.hidden=!i,this._talk.textContent=t.talkToPerson,this._talk.disabled=this._requesting,this._live.hidden=n||!r&&!i}_resetSession(){this._voice?.stop(),this._unsubscribe?.(),this._unsubscribe=null,this._session?.dispose(),this._session=null,this._disposePast(),this._history.dispose(),this.isConnected&&(this._createSession(),this._createPast(),this._unsubscribe=this.requireSession().subscribe(()=>this._render()))}_toggleHistory(e=!this._historyShown){this._historyShown=e,e?this._history.show():this._history.hide(),this._render()}_makeTurnApi(e){let t=ei(this.requireSession(),{messageId:e,labels:this.labels,openAttachment:e=>this.openAttachment(e),openCitation:t=>this.openCitation(e,t),openTarget:e=>this.openTarget(e),openTicket:this.openTicket,onNavigate:this.onNavigate});return t.resolveLink=this.resolveLink,t}_defaultOpenAttachment(e){this.requireSession().client.getAttachment(e.attachmentId).then(t=>{let n=URL.createObjectURL(new Blob([t],{type:e.contentType}));window.open(n,`_blank`,`noopener`),setTimeout(()=>URL.revokeObjectURL(n),Cee)}).catch(e=>globalThis.reportError?.(e))}_defaultOpenCitation(e,t){let n=this._thread.find(e);if(n){for(let e of n.querySelectorAll(`[data-marker]`))if(e.dataset.marker===String(t)){e.focus();return}}}_defaultOpenTarget(e){/^https?:\/\//i.test(e)?window.open(e,`_blank`,`noopener`):window.location.assign(e)}_render(){this._built&&this._session&&this._paint(this._session.getState())}_paint(e){e.conversationId!==this._voiceConversationId&&(this._voiceConversationId=e.conversationId,this.requireVoice().stop());let t=this.labels,n=e.profile,r=this._isLauncherLike();if(!n){this.hidden=r,this._header.el.hidden=!0,this._starters.el.hidden=!0,this._thread.el.hidden=!0,this._history.el.hidden=!0,this._foot.hidden=!0,this._errorEl.hidden=e.profileError==null,e.profileError&&(this._errorEl.textContent=e.profileError.message),this._status.hidden=e.profileError!=null,this._status.textContent=t.loadingConversation,this._shell.panel.setAttribute(`aria-busy`,String(e.profileError==null));return}if(this._shell.panel.removeAttribute(`aria-busy`),!e.features.VisitorChat){this.hidden=!0,this._status.hidden=!0;return}this.hidden=!1;let i=e.features,a=G9(this);this._ensureRuntime(e,n,a,t);let o=e.loading,s=e.loadError,c=e.messages.length===0&&!o,l=this._historyShown&&i.History===!0,u=e.messages.some(e=>e.author.kind===`Visitor`||e.author.kind===`Customer`),d=Y9(this.layout,i,this._onPanelSwitchProp),f=e.streaming||e.thinking;this._header.paint({labels:t,title:n.assistant.name,tagline:n.assistant.tagline,status:Mee(e,t),canNew:!f,showNew:this.layout===`full-page`||u,showHistory:i.History,showClose:r||this.layout===`full-page`&&d!==null,switchTo:d,canSwitch:!f,viewingHistory:l,showMute:i.Sounds&&n.experience.sound.muteControl,muted:e.muted}),O5(this._header.conversation,e,{labels:t,features:i,title:n.assistant.name??t.panelTitle,getState:()=>this.requireSession().getState(),iconOnly:!0}),l&&(this._header.conversation.hidden=!0),this._starters.el.hidden=!c||l,c&&e.open&&!this._introPlayed&&a.panel.greetingLoaderMs>0&&!this.requireMotion().reduced&&(this._introPlayed=!0,this._starters.intro(a.panel.greetingLoaderMs)),c&&this._starters.paint({labels:t,greeting:e.greeting,intro:n.assistant.intro,starters:e.starters,showStarters:i.Starters&&!e.streaming,resume:!i.History&&i.ResumeLast?e.lastConversation:null,openTickets:e.openTickets,features:e.features,ticketsClickable:typeof this.openTicket==`function`}),i.History&&!this._pastRefreshed&&(this._pastRefreshed=!0,this._past?.refresh()),this._past?.paint();let p=!c&&!o&&!s&&!l;this._thread.el.hidden=!p,p&&this._thread.paint(e,{labels:t,loaderStyle:Oee(this),reduced:this._motion?.reduced??!1,phrases:n.experience.pacing.thinkingPhrases,intervalMs:n.experience.pacing.phraseIntervalMs,assistantName:n.assistant.name}),this._paintLive(e,t,l),this._status.hidden=!o||l,this._status.textContent=t.loadingConversation,this._errorEl.hidden=!s||l,s&&(this._errorEl.textContent=s.message),this._foot.hidden=l,this._composer.paint({state:e,labels:t,maxLength:n.limits.maxMessageLength,accept:n.limits.contentTypes.join(`,`),draft:e.draft??null,sendIcon:a.input.sendIcon}),this._footer.paint({labels:t,profile:n}),this._history.el.hidden=!l,this._syncOpen(e,n,i,t,r),this._syncConversation(e),this._playSounds(e)}_ensureRuntime(e,t,n,r){let i=e.features;this._motion||(this._motion=O2(n,t.experience),this._motion.subscribe(()=>this._render())),i.Sounds&&!this._sound&&(this._sound=y9(t.experience.sound,q9)),!i.Sounds&&this._sound&&(this._sound=null),i.BehaviourStarters&&!this._behaviour&&(this._behaviour=s9(t.start.behaviour?.servicePathPrefixes??[]));let a=this._isLauncherLike();a&&!this._avoid&&this.layout===`launcher`&&(this._avoid=e9(n.avoid,t.experience.launcher,this.requireNudgeHost())),this.layout===`launcher`&&i.AutoOpen&&!this._autoOpen&&(this._autoOpen=W7(t.experience.autoOpen,n,{open:()=>this._setOpen(!0,`auto`),isOpen:()=>this.requireSession().getState().open,panelRect:()=>this._shell.panel.getBoundingClientRect()}));let o=J9(n);this._shell.setLabels(r),this._shell.setAppearance({position:this._position,offsetX:this.hasAttribute(`offset-x`)?z9(`offset-x`)(this.getAttribute(`offset-x`)??``):void 0,offsetY:this.hasAttribute(`offset-y`)?z9(`offset-y`)(this.getAttribute(`offset-y`)??``):void 0,width:`${n.panel.widthPx}px`,maxHeight:n.panel.maxHeightPx,bottomGap:n.panel.bottomGapPx,reduced:this._motion.reduced,sendReveal:n.input.sendReveal,inputRing:n.input.ring,panelMotion:n.panel.motion,theme:xee(this.getAttribute(`theme`)),icon:this.icon,launcherStyle:n.launcher.style,compact:n.launcher.compact,labelReveal:n.launcher.labelReveal,entrance:n.launcher.entrance,idle:n.launcher.idle,launcherMark:n.launcher.mark,panelHeight:n.panel.height,replyAvatars:n.panel.replyAvatars,avatar:n.avatar,expressive:n.expressive,phone:o,hoverLabel:t.experience.launcher.hoverLabel,peek:t.experience.launcher.peek,peekSeconds:t.experience.launcher.peekSeconds,hideWhileOpen:t.experience.launcher.hideWhileOpen,phoneMode:n.phone.mode,sheetHeightDvh:n.phone.sheetHeightDvh,sheetMaxHeightPx:n.phone.sheetMaxHeightPx,launcherState:this._launcherPlayed?void 0:`entering`}),this._launcherPlayed=!0,this._shell.root.classList.toggle(`wui-chat--phone`,a&&J9(n))}_syncOpen(e,t,n,r,i){if(i){if(!this._openApplied&&(this._openApplied=!0,this.hasAttribute(`open`)&&!e.open))this._setOpen(!0,`manual`);else if(this._shell.setOpen(e.open),this.toggleAttribute(`open`,e.open),e.open!==this._lastOpen&&(this._lastOpen=e.open,this._onOpenChange(e.open)),e.open)this._nudge.cancel(),this._nudgeArmed=!1,this._autoOpen?.cancel();else if(n.Nudges&&this.layout===`launcher`&&!this._nudgeArmed){let e=Pe(t,n);e&&(this._nudge.schedule({text:e.text,delaySeconds:e.delaySeconds,label:r.nudgeDismiss}),this._nudgeArmed=!0)}}}_onOpenChange(e){let t=J9(G9(this));if(e){if(document.addEventListener(`keydown`,this._onKeyDown),this._sound?.play(`open`),this._past?.refresh(),this.layout===`docked`&&!this._preloaded&&typeof this._preloadPanelSwitchProp==`function`){this._preloaded=!0;let e=this._preloadPanelSwitchProp;Promise.allSettled([new Promise(t=>t(e.call(this)))]).then(e=>{for(let t of e)t.status===`rejected`&&globalThis.reportError?.(t.reason)})}if(t){let e=G9(this);this._phone={fit:M9(this._shell.panel,e),unlock:m9(this._thread.el)}}else this._openTrigger===`manual`&&(this._focusTimer=setTimeout(()=>{this._focusTimer=null,this._composer.focus()},wee))}else document.removeEventListener(`keydown`,this._onKeyDown),clearTimeout(this._focusTimer??void 0),this._focusTimer=null,this._phone?.fit.destroy(),this._phone?.unlock(),this._phone=null,this._historyShown&&(this._historyShown=!1,this._history.hide(),this._render()),u9(this._shell.launcherButton)}_syncConversation(e){let t=this.getAttribute(`conversation-id`);t&&t!==this._openedConversation&&!e.loading&&(this._openedConversation=t,e.conversationId!==t&&Promise.allSettled([this.requireSession().openConversation(t)]))}_playSounds(e){if(e.loading){this._wasLoading=!0;for(let t of e.messages)this._seen.add(t.id)}else if(this._wasLoading||!this._seeded){this._wasLoading=!1,this._seeded=!0;for(let t of e.messages)this._seen.add(t.id)}else for(let t of e.messages)this._seen.has(t.id)||(this._seen.add(t.id),this._announce(t))}_announce(e){if(!this._sound||e.restored||e.parts.some(e=>e.kind===`Notice`))return;let t=e.author.kind;if(t===`Visitor`)e.stored||this._sound.play(`sent`);else if(t===`Assistant`||t===`Script`||t===`Agent`){this._sound.play(`reply`);let e=this.requireSession().getState().profile;e?.experience.sound.vibrate&&d9(e.experience.sound.vibrateMs,this._sound.isMuted())}}};Object.defineProperty(Q9.prototype,"layout",{get(){return this.getAttribute(`layout`)??U9.layout},set(e){this.setAttribute(`layout`,String(e))}});for(let e of W9)e!==`layout`&&Object.defineProperty(Q9.prototype,Dee(e),{configurable:!0,get(){return this.getAttribute(e)??U9[e]??``},set(t){t==null?this.removeAttribute(e):this.setAttribute(e,String(t))}});function $9(){typeof customElements<`u`&&!customElements.get(`wui-chat`)&&customElements.define(`wui-chat`,Q9)}$9(),$9(),globalThis.WeborityChat=Object.assign(globalThis.WeborityChat||{},{session:e=>e.session,renderers:{define:Eee}})})();