(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[6274],{61107:function(t,e,n){"use strict";n.d(e,{Z:function(){return c}});var r=n(11757),i=n(44194),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},a=n(54183),s=function(t,e){return i.createElement(a.Z,(0,r.Z)({},t,{ref:e,icon:o}))};var c=i.forwardRef(s)},51113:function(t,e,n){"use strict";n.d(e,{P:function(){return DX}});var r={};n.r(r),n.d(r,{add:function(){return ce},adjoint:function(){return St},clone:function(){return xt},copy:function(){return wt},create:function(){return bt},determinant:function(){return At},equals:function(){return de},exactEquals:function(){return he},frob:function(){return se},fromQuat:function(){return Ut},fromQuat2:function(){return $t},fromRotation:function(){return Bt},fromRotationTranslation:function(){return Wt},fromRotationTranslationScale:function(){return Yt},fromRotationTranslationScaleOrigin:function(){return Vt},fromScaling:function(){return Dt},fromTranslation:function(){return It},fromValues:function(){return Ot},fromXRotation:function(){return Ft},fromYRotation:function(){return zt},fromZRotation:function(){return Zt},frustum:function(){return Xt},getRotation:function(){return qt},getScaling:function(){return Ht},getTranslation:function(){return Gt},identity:function(){return _t},invert:function(){return Et},lookAt:function(){return ie},mul:function(){return pe},multiply:function(){return jt},multiplyScalar:function(){return ue},multiplyScalarAndAdd:function(){return fe},ortho:function(){return ne},orthoNO:function(){return ee},orthoZO:function(){return re},perspective:function(){return Qt},perspectiveFromFieldOfView:function(){return te},perspectiveNO:function(){return Kt},perspectiveZO:function(){return Jt},rotate:function(){return Ct},rotateX:function(){return Rt},rotateY:function(){return Lt},rotateZ:function(){return Nt},scale:function(){return Tt},set:function(){return kt},str:function(){return ae},sub:function(){return ye},subtract:function(){return le},targetTo:function(){return oe},translate:function(){return Pt},transpose:function(){return Mt}});var i={};n.r(i),n.d(i,{area:function(){return Zb},bottom:function(){return Ub},bottomLeft:function(){return Ub},bottomRight:function(){return Ub},inside:function(){return Ub},left:function(){return Ub},outside:function(){return Jb},right:function(){return Ub},spider:function(){return cx},surround:function(){return ux},top:function(){return Ub},topLeft:function(){return Ub},topRight:function(){return Ub}});var o={};n.r(o),n.d(o,{interpolateBlues:function(){return Ck},interpolateBrBG:function(){return GO},interpolateBuGn:function(){return ck},interpolateBuPu:function(){return uk},interpolateCividis:function(){return $k},interpolateCool:function(){return s_},interpolateCubehelixDefault:function(){return o_},interpolateGnBu:function(){return hk},interpolateGreens:function(){return Lk},interpolateGreys:function(){return Ik},interpolateInferno:function(){return m_},interpolateMagma:function(){return v_},interpolateOrRd:function(){return pk},interpolateOranges:function(){return Wk},interpolatePRGn:function(){return qO},interpolatePiYG:function(){return VO},interpolatePlasma:function(){return b_},interpolatePuBu:function(){return mk},interpolatePuBuGn:function(){return gk},interpolatePuOr:function(){return XO},interpolatePuRd:function(){return xk},interpolatePurples:function(){return Bk},interpolateRainbow:function(){return l_},interpolateRdBu:function(){return QO},interpolateRdGy:function(){return tk},interpolateRdPu:function(){return Ok},interpolateRdYlBu:function(){return nk},interpolateRdYlGn:function(){return ik},interpolateReds:function(){return zk},interpolateSinebow:function(){return d_},interpolateSpectral:function(){return ak},interpolateTurbo:function(){return p_},interpolateViridis:function(){return g_},interpolateWarm:function(){return a_},interpolateYlGn:function(){return Ek},interpolateYlGnBu:function(){return _k},interpolateYlOrBr:function(){return Ak},interpolateYlOrRd:function(){return Pk},schemeAccent:function(){return Gw},schemeBlues:function(){return Tk},schemeBrBG:function(){return $O},schemeBuGn:function(){return sk},schemeBuPu:function(){return lk},schemeCategory10:function(){return $w},schemeDark2:function(){return Hw},schemeGnBu:function(){return fk},schemeGreens:function(){return Rk},schemeGreys:function(){return Nk},schemeObservable10:function(){return qw},schemeOrRd:function(){return dk},schemeOranges:function(){return Zk},schemePRGn:function(){return HO},schemePaired:function(){return Yw},schemePastel1:function(){return Vw},schemePastel2:function(){return Uw},schemePiYG:function(){return YO},schemePuBu:function(){return vk},schemePuBuGn:function(){return yk},schemePuOr:function(){return UO},schemePuRd:function(){return bk},schemePurples:function(){return Dk},schemeRdBu:function(){return KO},schemeRdGy:function(){return JO},schemeRdPu:function(){return wk},schemeRdYlBu:function(){return ek},schemeRdYlGn:function(){return rk},schemeReds:function(){return Fk},schemeSet1:function(){return Xw},schemeSet2:function(){return Kw},schemeSet3:function(){return Qw},schemeSpectral:function(){return ok},schemeTableau10:function(){return Jw},schemeYlGn:function(){return Mk},schemeYlGnBu:function(){return kk},schemeYlOrBr:function(){return Sk},schemeYlOrRd:function(){return jk}});var a={};n.r(a),n.d(a,{geoAlbers:function(){return R$},geoAlbersUsa:function(){return L$},geoAzimuthalEqualArea:function(){return B$},geoAzimuthalEqualAreaRaw:function(){return D$},geoAzimuthalEquidistant:function(){return z$},geoAzimuthalEquidistantRaw:function(){return F$},geoConicConformal:function(){return q$},geoConicConformalRaw:function(){return H$},geoConicEqualArea:function(){return C$},geoConicEqualAreaRaw:function(){return T$},geoConicEquidistant:function(){return X$},geoConicEquidistantRaw:function(){return U$},geoEqualEarth:function(){return rG},geoEqualEarthRaw:function(){return nG},geoEquirectangular:function(){return V$},geoEquirectangularRaw:function(){return Y$},geoGnomonic:function(){return oG},geoGnomonicRaw:function(){return iG},geoIdentity:function(){return aG},geoMercator:function(){return W$},geoMercatorRaw:function(){return Z$},geoNaturalEarth1:function(){return cG},geoNaturalEarth1Raw:function(){return sG},geoOrthographic:function(){return uG},geoOrthographicRaw:function(){return lG},geoProjection:function(){return A$},geoProjectionMutator:function(){return j$},geoStereographic:function(){return hG},geoStereographicRaw:function(){return fG},geoTransverseMercator:function(){return pG},geoTransverseMercatorRaw:function(){return dG}});var s={};n.r(s),n.d(s,{frequency:function(){return Aq},id:function(){return jq},name:function(){return Pq},weight:function(){return Sq}});var c,l=n(44194),u=n(56321),f=function(){return f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=18&&(c=h.createRoot)}catch(t){}function y(t){var e=h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;e&&"object"==typeof e&&(e.usingClientEntryPoint=t)}var g="__rc_react_root__";function v(t,e){c?function(t,e){y(!0);var n=e[g]||c(e);y(!1),n.render(t),e[g]=n}(t,e):function(t,e){p(t,e)}(t,e)}var m=new Map;"undefined"!=typeof document&&m.set("tooltip",document.createElement("div"));var b,x,w=function(t,e){void 0===e&&(e=!1);var n=null;if(e)n=m.get("tooltip");else if(n=document.createElement("div"),null==t?void 0:t.key){var r=m.get(t.key);r?n=r:m.set(t.key,n)}return v(t,n),n},O=function(t){var e=t.loadingTemplate,n=t.theme,r=void 0===n?"light":n,i=l.useRef(null);l.useEffect((function(){!e&&i.current&&function(t){if("undefined"==typeof document)return"loading";var e=t.attachShadow({mode:"open"}),n=document.createElement("div"),r=document.createElement("style");r.innerHTML=".loading {\n display: inline-block;\n position: relative;\n width: 80px;\n height: 80px;\n }\n .loading div {\n position: absolute;\n top: 33px;\n width: 13px;\n height: 13px;\n border-radius: 50%;\n background: #ccc;\n animation-timing-function: cubic-bezier(0, 1, 1, 0);\n }\n .loading div:nth-child(1) {\n left: 8px;\n animation: loading1 0.6s infinite;\n }\n .loading div:nth-child(2) {\n left: 8px;\n animation: loading2 0.6s infinite;\n }\n .loading div:nth-child(3) {\n left: 32px;\n animation: loading2 0.6s infinite;\n }\n .loading div:nth-child(4) {\n left: 56px;\n animation: loading3 0.6s infinite;\n }\n @keyframes loading1 {\n 0% {\n transform: scale(0);\n }\n 100% {\n transform: scale(1);\n }\n }\n @keyframes loading3 {\n 0% {\n transform: scale(1);\n }\n 100% {\n transform: scale(0);\n }\n }\n @keyframes loading2 {\n 0% {\n transform: translate(0, 0);\n }\n 100% {\n transform: translate(24px, 0);\n }\n }\n ",n.classList.add("loading"),n.innerHTML="
",e.appendChild(r),e.appendChild(n)}(i.current)}),[]);return l.createElement("div",{className:"charts-loading-container",style:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",left:0,top:0,zIndex:99,backgroundColor:"dark"===r?"rgb(20, 20, 20)":"rgb(255, 255, 255)"}},e||l.createElement("div",{ref:i}))},k=(b=function(t,e){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},b(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}b(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),_=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state={hasError:!1},e.renderError=function(t){var n=e.props.errorTemplate;return"function"==typeof n?n(t):n||l.createElement("h5",null,"组件出错了,请核查后重试: ",t.message)},e}return k(e,t),e.getDerivedStateFromError=function(t){return{hasError:!0,error:t}},e.getDerivedStateFromProps=function(t,e){return e.children!==t.children?{children:t.children,hasError:!1,error:void 0}:null},e.prototype.render=function(){return this.state.hasError?this.renderError(this.state.error):l.createElement(l.Fragment,null,this.props.children)},e}(l.Component),M=n(39378),E=function(){return x||(x=document.createElement("canvas").getContext("2d")),x},S=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function at(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function st(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],c=n[2];return t[0]=i*c-o*s,t[1]=o*a-r*c,t[2]=r*s-i*a,t}function ct(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function lt(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function ut(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],c=e[1],l=e[2],u=i*l-o*c,f=o*s-r*l,h=r*c-i*s,d=i*h-o*f,p=o*u-r*h,y=r*f-i*u,g=2*a;return u*=g,f*=g,h*=g,d*=2,p*=2,y*=2,t[0]=s+u+d,t[1]=c+f+p,t[2]=l+h+y,t}function ft(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=Y*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=Y*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=Y*Math.max(1,Math.abs(i),Math.abs(s))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var ht,dt=nt,pt=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)},yt=K;ht=U();function gt(){var t=new V(4);return V!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function vt(t,e,n,r){var i=new V(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function mt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}!function(){var t=gt()}();function bt(){var t=new V(16);return V!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function xt(t){var e=new V(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function wt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ot(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,y){var g=new V(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=r,g[4]=i,g[5]=o,g[6]=a,g[7]=s,g[8]=c,g[9]=l,g[10]=u,g[11]=f,g[12]=h,g[13]=d,g[14]=p,g[15]=y,g}function kt(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,y,g){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=y,t[15]=g,t}function _t(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Mt(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function Et(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],y=e[13],g=e[14],v=e[15],m=n*s-r*a,b=n*c-i*a,x=n*l-o*a,w=r*c-i*s,O=r*l-o*s,k=i*l-o*c,_=u*y-f*p,M=u*g-h*p,E=u*v-d*p,S=f*g-h*y,A=f*v-d*y,j=h*v-d*g,P=m*j-b*A+x*S+w*E-O*M+k*_;return P?(P=1/P,t[0]=(s*j-c*A+l*S)*P,t[1]=(i*A-r*j-o*S)*P,t[2]=(y*k-g*O+v*w)*P,t[3]=(h*O-f*k-d*w)*P,t[4]=(c*E-a*j-l*M)*P,t[5]=(n*j-i*E+o*M)*P,t[6]=(g*x-p*k-v*b)*P,t[7]=(u*k-h*x+d*b)*P,t[8]=(a*A-s*E+l*_)*P,t[9]=(r*E-n*A-o*_)*P,t[10]=(p*O-y*x+v*m)*P,t[11]=(f*x-u*O-d*m)*P,t[12]=(s*M-a*S-c*_)*P,t[13]=(n*S-r*M+i*_)*P,t[14]=(y*b-p*w-g*m)*P,t[15]=(u*w-f*b+h*m)*P,t):null}function St(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],y=e[13],g=e[14],v=e[15];return t[0]=s*(h*v-d*g)-f*(c*v-l*g)+y*(c*d-l*h),t[1]=-(r*(h*v-d*g)-f*(i*v-o*g)+y*(i*d-o*h)),t[2]=r*(c*v-l*g)-s*(i*v-o*g)+y*(i*l-o*c),t[3]=-(r*(c*d-l*h)-s*(i*d-o*h)+f*(i*l-o*c)),t[4]=-(a*(h*v-d*g)-u*(c*v-l*g)+p*(c*d-l*h)),t[5]=n*(h*v-d*g)-u*(i*v-o*g)+p*(i*d-o*h),t[6]=-(n*(c*v-l*g)-a*(i*v-o*g)+p*(i*l-o*c)),t[7]=n*(c*d-l*h)-a*(i*d-o*h)+u*(i*l-o*c),t[8]=a*(f*v-d*y)-u*(s*v-l*y)+p*(s*d-l*f),t[9]=-(n*(f*v-d*y)-u*(r*v-o*y)+p*(r*d-o*f)),t[10]=n*(s*v-l*y)-a*(r*v-o*y)+p*(r*l-o*s),t[11]=-(n*(s*d-l*f)-a*(r*d-o*f)+u*(r*l-o*s)),t[12]=-(a*(f*g-h*y)-u*(s*g-c*y)+p*(s*h-c*f)),t[13]=n*(f*g-h*y)-u*(r*g-i*y)+p*(r*h-i*f),t[14]=-(n*(s*g-c*y)-a*(r*g-i*y)+p*(r*c-i*s)),t[15]=n*(s*h-c*f)-a*(r*h-i*f)+u*(r*c-i*s),t}function At(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],y=t[14],g=t[15];return(e*a-n*o)*(f*g-h*y)-(e*s-r*o)*(u*g-h*p)+(e*c-i*o)*(u*y-f*p)+(n*s-r*a)*(l*g-h*d)-(n*c-i*a)*(l*y-f*d)+(r*c-i*s)*(l*p-u*d)}function jt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],y=e[12],g=e[13],v=e[14],m=e[15],b=n[0],x=n[1],w=n[2],O=n[3];return t[0]=b*r+x*s+w*f+O*y,t[1]=b*i+x*c+w*h+O*g,t[2]=b*o+x*l+w*d+O*v,t[3]=b*a+x*u+w*p+O*m,b=n[4],x=n[5],w=n[6],O=n[7],t[4]=b*r+x*s+w*f+O*y,t[5]=b*i+x*c+w*h+O*g,t[6]=b*o+x*l+w*d+O*v,t[7]=b*a+x*u+w*p+O*m,b=n[8],x=n[9],w=n[10],O=n[11],t[8]=b*r+x*s+w*f+O*y,t[9]=b*i+x*c+w*h+O*g,t[10]=b*o+x*l+w*d+O*v,t[11]=b*a+x*u+w*p+O*m,b=n[12],x=n[13],w=n[14],O=n[15],t[12]=b*r+x*s+w*f+O*y,t[13]=b*i+x*c+w*h+O*g,t[14]=b*o+x*l+w*d+O*v,t[15]=b*a+x*u+w*p+O*m,t}function Pt(t,e,n){var r,i,o,a,s,c,l,u,f,h,d,p,y=n[0],g=n[1],v=n[2];return e===t?(t[12]=e[0]*y+e[4]*g+e[8]*v+e[12],t[13]=e[1]*y+e[5]*g+e[9]*v+e[13],t[14]=e[2]*y+e[6]*g+e[10]*v+e[14],t[15]=e[3]*y+e[7]*g+e[11]*v+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=r*y+s*g+f*v+e[12],t[13]=i*y+c*g+h*v+e[13],t[14]=o*y+l*g+d*v+e[14],t[15]=a*y+u*g+p*v+e[15]),t}function Tt(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ct(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p,y,g,v,m,b,x,w,O,k,_,M,E,S,A=r[0],j=r[1],P=r[2],T=Math.hypot(A,j,P);return T0?(n[0]=2*(s*a+u*r+c*o-l*i)/f,n[1]=2*(c*a+u*i+l*r-s*o)/f,n[2]=2*(l*a+u*o+s*i-c*r)/f):(n[0]=2*(s*a+u*r+c*o-l*i),n[1]=2*(c*a+u*i+l*r-s*o),n[2]=2*(l*a+u*o+s*i-c*r)),Wt(t,e,n),t}function Gt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Ht(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(c,l,u),t}function qt(t,e){var n=new V(3);Ht(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,c=e[2]*o,l=e[4]*r,u=e[5]*i,f=e[6]*o,h=e[8]*r,d=e[9]*i,p=e[10]*o,y=a+u+p,g=0;return y>0?(g=2*Math.sqrt(y+1),t[3]=.25*g,t[0]=(f-d)/g,t[1]=(h-c)/g,t[2]=(s-l)/g):a>u&&a>p?(g=2*Math.sqrt(1+a-u-p),t[3]=(f-d)/g,t[0]=.25*g,t[1]=(s+l)/g,t[2]=(h+c)/g):u>p?(g=2*Math.sqrt(1+u-a-p),t[3]=(h-c)/g,t[0]=(s+l)/g,t[1]=.25*g,t[2]=(f+d)/g):(g=2*Math.sqrt(1+p-a-u),t[3]=(s-l)/g,t[0]=(h+c)/g,t[1]=(f+d)/g,t[2]=.25*g),t}function Yt(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],c=i+i,l=o+o,u=a+a,f=i*c,h=i*l,d=i*u,p=o*l,y=o*u,g=a*u,v=s*c,m=s*l,b=s*u,x=r[0],w=r[1],O=r[2];return t[0]=(1-(p+g))*x,t[1]=(h+b)*x,t[2]=(d-m)*x,t[3]=0,t[4]=(h-b)*w,t[5]=(1-(f+g))*w,t[6]=(y+v)*w,t[7]=0,t[8]=(d+m)*O,t[9]=(y-v)*O,t[10]=(1-(f+p))*O,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Vt(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],c=e[3],l=o+o,u=a+a,f=s+s,h=o*l,d=o*u,p=o*f,y=a*u,g=a*f,v=s*f,m=c*l,b=c*u,x=c*f,w=r[0],O=r[1],k=r[2],_=i[0],M=i[1],E=i[2],S=(1-(y+v))*w,A=(d+x)*w,j=(p-b)*w,P=(d-x)*O,T=(1-(h+v))*O,C=(g+m)*O,R=(p+b)*k,L=(g-m)*k,N=(1-(h+y))*k;return t[0]=S,t[1]=A,t[2]=j,t[3]=0,t[4]=P,t[5]=T,t[6]=C,t[7]=0,t[8]=R,t[9]=L,t[10]=N,t[11]=0,t[12]=n[0]+_-(S*_+P*M+R*E),t[13]=n[1]+M-(A*_+T*M+L*E),t[14]=n[2]+E-(j*_+C*M+N*E),t[15]=1,t}function Ut(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,c=i+i,l=n*a,u=r*a,f=r*s,h=i*a,d=i*s,p=i*c,y=o*a,g=o*s,v=o*c;return t[0]=1-f-p,t[1]=u+v,t[2]=h-g,t[3]=0,t[4]=u-v,t[5]=1-l-p,t[6]=d+y,t[7]=0,t[8]=h+g,t[9]=d-y,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Xt(t,e,n,r,i,o,a){var s=1/(n-e),c=1/(i-r),l=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*c,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*c,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t}function Kt(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}var Qt=Kt;function Jt(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=i*o,t[14]=i*r*o):(t[10]=-1,t[14]=-r),t}function te(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(a+s),l=2/(i+o);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-s)*c*.5,t[9]=(i-o)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t}function ee(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=(a+o)*l,t[15]=1,t}var ne=ee;function re(t,e,n,r,i,o,a){var s=1/(e-n),c=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*c,t[14]=o*l,t[15]=1,t}function ie(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p=e[0],y=e[1],g=e[2],v=r[0],m=r[1],b=r[2],x=n[0],w=n[1],O=n[2];return Math.abs(p-x)0&&(u*=d=1/Math.sqrt(d),f*=d,h*=d);var p=c*h-l*f,y=l*u-s*h,g=s*f-c*u;return(d=p*p+y*y+g*g)>0&&(p*=d=1/Math.sqrt(d),y*=d,g*=d),t[0]=p,t[1]=y,t[2]=g,t[3]=0,t[4]=f*g-h*y,t[5]=h*p-u*g,t[6]=u*y-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function ae(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function se(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function ce(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function le(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function ue(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t}function fe(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t}function he(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function de(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],y=t[13],g=t[14],v=t[15],m=e[0],b=e[1],x=e[2],w=e[3],O=e[4],k=e[5],_=e[6],M=e[7],E=e[8],S=e[9],A=e[10],j=e[11],P=e[12],T=e[13],C=e[14],R=e[15];return Math.abs(n-m)<=Y*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(r-b)<=Y*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=Y*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-w)<=Y*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-O)<=Y*Math.max(1,Math.abs(a),Math.abs(O))&&Math.abs(s-k)<=Y*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(c-_)<=Y*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(l-M)<=Y*Math.max(1,Math.abs(l),Math.abs(M))&&Math.abs(u-E)<=Y*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(f-S)<=Y*Math.max(1,Math.abs(f),Math.abs(S))&&Math.abs(h-A)<=Y*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(d-j)<=Y*Math.max(1,Math.abs(d),Math.abs(j))&&Math.abs(p-P)<=Y*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(y-T)<=Y*Math.max(1,Math.abs(y),Math.abs(T))&&Math.abs(g-C)<=Y*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(v-R)<=Y*Math.max(1,Math.abs(v),Math.abs(R))}var pe=jt,ye=le;function ge(){var t=new V(9);return V!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function ve(){var t=new V(4);return V!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function me(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function be(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],c=n[1],l=n[2],u=n[3];return t[0]=r*u+a*s+i*l-o*c,t[1]=i*u+a*c+o*s-r*l,t[2]=o*u+a*l+r*c-i*s,t[3]=a*u-r*s-i*c-o*l,t}function xe(t,e,n,r){var i,o,a,s,c,l=e[0],u=e[1],f=e[2],h=e[3],d=n[0],p=n[1],y=n[2],g=n[3];return(o=l*d+u*p+f*y+h*g)<0&&(o=-o,d=-d,p=-p,y=-y,g=-g),1-o>Y?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,c=Math.sin(r*i)/a):(s=1-r,c=r),t[0]=s*l+c*d,t[1]=s*u+c*p,t[2]=s*f+c*y,t[3]=s*h+c*g,t}function we(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function Oe(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),c=Math.cos(n),l=Math.sin(r),u=Math.cos(r);return t[0]=o*c*u-a*s*l,t[1]=a*s*u+o*c*l,t[2]=a*c*l-o*s*u,t[3]=a*c*u+o*s*l,t}var ke,_e,Me,Ee,Se,Ae,je=vt,Pe=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Te=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},Ce=be,Re=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};ke=U(),_e=Q(1,0,0),Me=Q(0,1,0),Ee=ve(),Se=ve(),Ae=ge();function Le(){var t=new V(2);return V!=Float32Array&&(t[0]=0,t[1]=0),t}function Ne(t,e){return t[0]=e[0],t[1]=e[1],t}function Ie(t,e,n){return t[0]=e,t[1]=n,t}!function(){var t=Le()}();function De(t){return"number"==typeof t}function Be(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Fe(t){return null==t}function ze(t){return"string"==typeof t}var Ze=function(t,e,n){return tn?n:t},We=n(92336),$e={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ge(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return $e[e]===t.length-1&&"achlmqstvz".includes(e)}))}function He(t){return Ge(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function qe(t){return He(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}var Ye={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Ve(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=$e[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,$e[n]))),$e[n]););}function Ue(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'.concat(n[e],'", expecting 0 or 1 at index ').concat(e))}function Xe(t){return t>=48&&t<=57||43===t||45===t||46===t}function Ke(t){return t>=48&&t<=57}function Qe(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,c=!1,l=!1;if(o>=n)t.err="[path-util]: Invalid path value at index ".concat(o,', "pathValue" is missing param');else if(43!==(e=r.charCodeAt(o))&&45!==e||(o+=1,e=r.charCodeAt(o)),Ke(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function tn(t){for(var e=t.pathValue,n=t.max;t.index0;a-=1){if(97!=(32|i)||3!==a&&4!==a?Qe(t):Ue(t),t.err.length)return;t.data.push(t.param),tn(t),t.index=t.max)break;if(!Xe(n.charCodeAt(t.index)))break}Ve(t)}else Ve(t);else t.err='[path-util]: Invalid path value "'.concat(n[r],'" is not a path command')}var nn=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function rn(t){if(He(t))return[].concat(t);var e=function(t){if(Ge(t))return[].concat(t);var e=new nn(t);for(tn(e);e.index=o)a={x:n,y:r};else{var s=sn([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function ln(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(n*o-r*i<0?-1:1)*Math.acos(a/s)}function un(t,e,n,r,i,o,a,s,c,l){var u=Math.abs,f=Math.sin,h=Math.cos,d=Math.sqrt,p=Math.PI,y=u(n),g=u(r),v=(i%360+360)%360*(p/180);if(t===s&&e===c)return{x:t,y:e};if(0===y||0===g)return cn(t,e,s,c,l).point;var m=(t-s)/2,b=(e-c)/2,x={x:h(v)*m+f(v)*b,y:-f(v)*m+h(v)*b},w=Math.pow(x.x,2)/Math.pow(y,2)+Math.pow(x.y,2)/Math.pow(g,2);w>1&&(y*=d(w),g*=d(w));var O=(Math.pow(y,2)*Math.pow(g,2)-Math.pow(y,2)*Math.pow(x.y,2)-Math.pow(g,2)*Math.pow(x.x,2))/(Math.pow(y,2)*Math.pow(x.y,2)+Math.pow(g,2)*Math.pow(x.x,2)),k=(o!==a?1:-1)*d(O=O<0?0:O),_=k*(y*x.y/g),M=k*(-g*x.x/y),E=h(v)*_-f(v)*M+(t+s)/2,S=f(v)*_+h(v)*M+(e+c)/2,A={x:(x.x-_)/y,y:(x.y-M)/g},j=ln({x:1,y:0},A),P=ln(A,{x:(-x.x-_)/y,y:(-x.y-M)/g});!a&&P>0?P-=2*p:a&&P<0&&(P+=2*p);var T=j+(P%=2*p)*l,C=y*h(T),R=g*f(T);return{x:h(v)*C-f(v)*R+E,y:f(v)*C+h(v)*R+S}}function fn(t,e,n,r,i,o,a,s,c,l,u){var f,h=u.bbox,d=void 0===h||h,p=u.length,y=void 0===p||p,g=u.sampleSize,v=void 0===g?30:g,m="number"==typeof l,b=t,x=e,w=0,O=[b,x,w],k=[b,x],_={x:0,y:0},M=[{x:b,y:x}];m&&l<=0&&(_={x:b,y:x});for(var E=0;E<=v;E+=1){if(b=(f=un(t,e,n,r,i,o,a,s,c,E/v)).x,x=f.y,d&&M.push({x:b,y:x}),y&&(w+=Be(k,[b,x])),k=[b,x],m&&w>=l&&l>O[2]){var S=(w-l)/(w-O[2]);_={x:k[0]*(1-S)+O[0]*S,y:k[1]*(1-S)+O[1]*S}}O=[b,x,w]}return m&&l>=w&&(_={x:s,y:c}),{length:w,point:_,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function hn(t,e,n,r,i,o,a,s,c){var l=1-c;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*c*n+3*l*Math.pow(c,2)*i+Math.pow(c,3)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*c*r+3*l*Math.pow(c,2)*o+Math.pow(c,3)*s}}function dn(t,e,n,r,i,o,a,s,c,l){var u,f=l.bbox,h=void 0===f||f,d=l.length,p=void 0===d||d,y=l.sampleSize,g=void 0===y?10:y,v="number"==typeof c,m=t,b=e,x=0,w=[m,b,x],O=[m,b],k={x:0,y:0},_=[{x:m,y:b}];v&&c<=0&&(k={x:m,y:b});for(var M=0;M<=g;M+=1){if(m=(u=hn(t,e,n,r,i,o,a,s,M/g)).x,b=u.y,h&&_.push({x:m,y:b}),p&&(x+=Be(O,[m,b])),O=[m,b],v&&x>=c&&c>w[2]){var E=(x-c)/(x-w[2]);k={x:O[0]*(1-E)+w[0]*E,y:O[1]*(1-E)+w[1]*E}}w=[m,b,x]}return v&&c>=x&&(k={x:a,y:s}),{length:x,point:k,min:{x:Math.min.apply(null,_.map((function(t){return t.x}))),y:Math.min.apply(null,_.map((function(t){return t.y})))},max:{x:Math.max.apply(null,_.map((function(t){return t.x}))),y:Math.max.apply(null,_.map((function(t){return t.y})))}}}function pn(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function yn(t,e,n,r,i,o,a,s){var c,l=s.bbox,u=void 0===l||l,f=s.length,h=void 0===f||f,d=s.sampleSize,p=void 0===d?10:d,y="number"==typeof a,g=t,v=e,m=0,b=[g,v,m],x=[g,v],w={x:0,y:0},O=[{x:g,y:v}];y&&a<=0&&(w={x:g,y:v});for(var k=0;k<=p;k+=1){if(g=(c=pn(t,e,n,r,i,o,k/p)).x,v=c.y,u&&O.push({x:g,y:v}),h&&(m+=Be(x,[g,v])),x=[g,v],y&&m>=a&&a>b[2]){var _=(m-a)/(m-b[2]);w={x:x[0]*(1-_)+b[0]*_,y:x[1]*(1-_)+b[1]*_}}b=[g,v,m]}return y&&a>=m&&(w={x:i,y:o}),{length:m,point:w,min:{x:Math.min.apply(null,O.map((function(t){return t.x}))),y:Math.min.apply(null,O.map((function(t){return t.y})))},max:{x:Math.max.apply(null,O.map((function(t){return t.x}))),y:Math.max.apply(null,O.map((function(t){return t.y})))}}}function gn(t,e,n){for(var r,i,o,a,s,c,l,u,f,h=an(t),d="number"==typeof e,p=[],y=0,g=0,v=0,m=0,b=[],x=[],w=0,O={x:0,y:0},k=O,_=O,M=O,E=0,S=0,A=h.length;S=e&&(M=_),x.push(k),b.push(O),E+=w,y=(c="Z"!==u?f.slice(-2):[v,m])[0],g=c[1];return d&&e>=E&&(M={x:y,y:g}),{length:E,point:M,min:{x:Math.min.apply(null,b.map((function(t){return t.x}))),y:Math.min.apply(null,b.map((function(t){return t.y})))},max:{x:Math.max.apply(null,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function vn(t){return Array.isArray(t)}var mn=function(t){if(vn(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])};function bn(t){if(!Array.isArray(t))return-1/0;var e=t.length;if(!e)return-1/0;for(var n=t[0],r=1;r7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}function kn(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function _n(t,e,n,r,i,o,a,s,c,l){var u,f,h,d,p,y=t,g=e,v=n,m=r,b=s,x=c,w=120*Math.PI/180,O=Math.PI/180*(+i||0),k=[];if(l)f=l[0],h=l[1],d=l[2],p=l[3];else{y=(u=kn(y,g,-O)).x,g=u.y;var _=(y-(b=(u=kn(b,x,-O)).x))/2,M=(g-(x=u.y))/2,E=_*_/(v*v)+M*M/(m*m);E>1&&(v*=E=Math.sqrt(E),m*=E);var S=v*v,A=m*m,j=(o===a?-1:1)*Math.sqrt(Math.abs((S*A-S*M*M-A*_*_)/(S*M*M+A*_*_)));d=j*v*M/m+(y+b)/2,p=j*-m*_/v+(g+x)/2,f=Math.asin(((g-p)/m*Math.pow(10,9)>>0)/Math.pow(10,9)),h=Math.asin(((x-p)/m*Math.pow(10,9)>>0)/Math.pow(10,9)),f=yh&&(f-=2*Math.PI),!a&&h>f&&(h-=2*Math.PI)}var P=h-f;if(Math.abs(P)>w){var T=h,C=b,R=x;h=f+w*(a&&h>f?1:-1),k=_n(b=d+v*Math.cos(h),x=p+m*Math.sin(h),v,m,i,0,a,C,R,[h,T,d,p])}P=h-f;var L=Math.cos(f),N=Math.sin(f),I=Math.cos(h),D=Math.sin(h),B=Math.tan(P/4),F=4/3*v*B,z=4/3*m*B,Z=[y,g],W=[y+F*N,g-z*L],$=[b+F*D,x-z*I],G=[b,x];if(W[0]=2*Z[0]-W[0],W[1]=2*Z[1]-W[1],l)return W.concat($,G,k);for(var H=[],q=0,Y=(k=W.concat($,G,k)).length;q=h[e],d[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return y[0].length===y[1].length?y:jn(y[0],y[1],f)}function Pn(t){return function(t){var e=0,n=0,r=0;return Sn(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o=t.slice(1),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=o[5];return r=function(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,n,a,s,c,l,u,f),i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function Tn(t,e){var n=t.length-1,r=[],i=0,o=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}(t);return o.forEach((function(o,a){t.slice(1).forEach((function(r,o){i+=Be(t[(a+o)%n].slice(-2),e[o%n].slice(-2))})),r[a]=i,i=0})),o[r.indexOf(Math.min.apply(null,r))]}var Cn=function(t){return void 0===t},Rn={}.toString,Ln=function(t,e){return Rn.call(t)==="[object "+e+"]"},Nn=function(t){return Ln(t,"Boolean")};function In(t){return"function"==typeof t}var Dn=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};function Bn(t,e,n){return gn(t,e,(0,We.pi)((0,We.pi)({},n),{bbox:!1,length:!0})).point}var Fn=n(20173),zn=n(42885);function Zn(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=(0,zn.Z)(t)););return t}function Wn(){return Wn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=Zn(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Wn.apply(null,arguments)}function $n(t,e,n,r){var i=Wn((0,zn.Z)(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function Gn(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Hn(t,e){var n=Math.min.apply(Math,(0,We.ev)([],(0,We.CR)(t),!1)),r=Math.min.apply(Math,(0,We.ev)([],(0,We.CR)(e),!1));return{x:n,y:r,width:Math.max.apply(Math,(0,We.ev)([],(0,We.CR)(t),!1))-n,height:Math.max.apply(Math,(0,We.ev)([],(0,We.CR)(e),!1))-r}}function qn(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function Yn(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function Vn(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),c=1/0,l=-1/0,u=[o,a],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var h=s+f;ol&&(l=d)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),y=1/0,g=-1/0,v=[o,a];for(f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var m=p+f;og&&(g=b)}return{x:c,y:y,width:l-c,height:g-y}}function Un(t,e,n,r,i,o){var a=-1,s=1/0,c=[n,r],l=20;o&&o>200&&(l=o/10);for(var u=1/l,f=u/10,h=0;h<=l;h++){var d=h*u,p=[i.apply(void 0,(0,We.ev)([],(0,We.CR)(t.concat([d])),!1)),i.apply(void 0,(0,We.ev)([],(0,We.CR)(e.concat([d])),!1))];(m=Gn(c[0],c[1],p[0],p[1]))=0&&m0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s);var c=[i-t,o-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(c,s))}function Jn(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function tr(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,c=6*t-12*e+6*n,l=3*e-3*t,u=[];if(xn(s,0))xn(c,0)||(i=-l/c)>=0&&i<=1&&u.push(i);else{var f=c*c-4*s*l;xn(f,0)?u.push(-c/(2*s)):f>0&&(o=(-c-(a=Math.sqrt(f)))/(2*s),(i=(-c+a)/(2*s))>=0&&i<=1&&u.push(i),o>=0&&o<=1&&u.push(o))}return u}function er(t,e,n,r,i,o,a,s){for(var c=[t,a],l=[e,s],u=tr(t,n,i,a),f=tr(e,r,o,s),h=0;h=0?[i]:[]}function ar(t,e,n,r,i,o){var a=or(t,n,i)[0],s=or(e,r,o)[0],c=[t,i],l=[e,o];return void 0!==a&&c.push(ir(t,n,i,a)),void 0!==s&&l.push(ir(e,r,o,s)),Hn(c,l)}function sr(t,e,n,r,i,o,a,s){var c=function(t,e,n,r,i,o,a,s){return Un([t,n,i],[e,r,o],a,s,ir)}(t,e,n,r,i,o,a,s);return Gn(c.x,c.y,a,s)}var cr=n(72298),lr=n(48921),ur=n(23065),fr=n(73457),hr=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self&&self,{exports:{}});hr.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,c=r-i+1,l=Math.log(s),u=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*u*(s-u)/s)*(c-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-c*u/s+f)),Math.min(o,Math.floor(r+(s-c)*u/s+f)),a)}var h=t[r],d=i,p=o;for(n(t,i,r),a(t[o],h)>0&&n(t,i,o);d0;)p--}0===a(t[i],h)?n(t,i,p):n(t,++p,o),p<=r&&(i=p+1),r<=p&&(o=p-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return te?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(e,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!g(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=v(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,o=1/0,a=e;a<=n-e;a++){var c=s(t,0,a,this.toBBox),l=s(t,a,n,this.toBBox),u=p(c,l),h=f(c)+f(l);u=e;d--){var p=t.children[d];c(a,t.leaf?i(p):p),l+=h(a)}return l},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)c(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():a(t[e],this.toBBox)},i}();var dr=hr.exports,pr=function(t){return t.GROUP="g",t.FRAGMENT="fragment",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh",t}({}),yr=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),gr=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t),this.plugins=[]}),[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);n>=0&&t.context.renderingPlugins.splice(n,1)}))}}])}(),vr=function(){return(0,Z.Z)((function t(e){(0,z.Z)(this,t),this.clipSpaceNearZ=yr.NEGATIVE_ONE,this.plugins=[],this.config=(0,F.Z)({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)}),[{key:"registerPlugin",value:function(t){var e=this.plugins.findIndex((function(e){return e===t}));-1===e&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find((function(e){return e.name===t}))}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}(),mr=et,br=J,xr=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},wr=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},Or=it,kr=dt,_r=function(){function t(){(0,z.Z)(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return(0,Z.Z)(t,[{key:"update",value:function(t,e){br(this.center,t),br(this.halfExtents,e),kr(this.min,this.center,this.halfExtents),mr(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){mr(this.center,e,t),Or(this.center,this.center,.5),kr(this.halfExtents,e,t),Or(this.halfExtents,this.halfExtents,.5),br(this.min,t),br(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],c=a[1],l=a[2],u=r-s,f=r+s,h=i-c,d=i+c,p=o-l,y=o+l,g=e.center,v=g[0],m=g[1],b=g[2],x=e.halfExtents,w=x[0],O=x[1],k=x[2],_=v-w,M=v+w,E=m-O,S=m+O,A=b-k,j=b+k;_f&&(f=M),Ed&&(d=S),Ay&&(y=j),n[0]=.5*(u+f),n[1]=.5*(h+d),n[2]=.5*(p+y),a[0]=.5*(f-u),a[1]=.5*(d-h),a[2]=.5*(y-p),this.min[0]=u,this.min[1]=h,this.min[2]=p,this.max[0]=f,this.max[1]=d,this.max[2]=y}}},{key:"setFromTransformedAABB",value:function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],c=e[8],l=e[1],u=e[5],f=e[9],h=e[2],d=e[6],p=e[10],y=Math.abs(a),g=Math.abs(s),v=Math.abs(c),m=Math.abs(l),b=Math.abs(u),x=Math.abs(f),w=Math.abs(h),O=Math.abs(d),k=Math.abs(p);n[0]=e[12]+a*i[0]+s*i[1]+c*i[2],n[1]=e[13]+l*i[0]+u*i[1]+f*i[2],n[2]=e[14]+h*i[0]+d*i[1]+p*i[2],r[0]=y*o[0]+g*o[1]+v*o[2],r[1]=m*o[0]+b*o[1]+x*o[2],r[2]=w*o[0]+O*o[1]+k*o[2],kr(this.min,n,r),mr(this.max,n,r)}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,r=xr([0,0,0],this.getMin(),e.getMin()),i=wr([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?br([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?br([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}])}(),Mr=function(){return(0,Z.Z)((function t(e,n){(0,z.Z)(this,t),this.distance=e||0,this.normal=n||Q(0,1,0),this.updatePNVertexFlag()}),[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return at(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/yt(this.normal);it(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&ct(n,t,e,i),o}}])}(),Er=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({}),Sr=function(){return(0,Z.Z)((function t(e){if((0,z.Z)(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new Mr)}),[{key:"extractFromVPMatrix",value:function(t){var e=(0,H.Z)(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],y=e[13],g=e[14],v=e[15];tt(this.planes[0].normal,o-n,l-a,d-u),this.planes[0].distance=v-p,tt(this.planes[1].normal,o+n,l+a,d+u),this.planes[1].distance=v+p,tt(this.planes[2].normal,o+r,l+s,d+f),this.planes[2].distance=v+y,tt(this.planes[3].normal,o-r,l-s,d-f),this.planes[3].distance=v-y,tt(this.planes[4].normal,o-i,l-c,d-h),this.planes[4].distance=v-g,tt(this.planes[5].normal,o+i,l+c,d+h),this.planes[5].distance=v+g,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}])}(),Ar=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,z.Z)(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return(0,Z.Z)(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),jr=function(){function t(e,n,r,i){(0,z.Z)(this,t),this.x=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}return(0,Z.Z)(t,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new t(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var r=vt(e.x,e.y,0,1),i=vt(e.x+e.width,e.y,0,1),o=vt(e.x,e.y+e.height,0,1),a=vt(e.x+e.width,e.y+e.height,0,1),s=gt(),c=gt(),l=gt(),u=gt();mt(s,r,n),mt(c,i,n),mt(l,o,n),mt(u,a,n);var f=Math.min(s[0],c[0],l[0],u[0]),h=Math.min(s[1],c[1],l[1],u[1]),d=Math.max(s[0],c[0],l[0],u[0]),p=Math.max(s[1],c[1],l[1],u[1]);return t.fromRect({x:f,y:h,width:d-f,height:p-h})}}])}(),Pr="Method not implemented.",Tr="Use document.documentElement instead.";function Cr(t){return void 0===t?0:t>360||t<-360?t%360:t}var Rr=U();function Lr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return Array.isArray(t)&&3===t.length?r?X(t):J(Rr,t):De(t)?r?Q(t,e,n):tt(Rr,t,e,n):r?Q(t[0],t[1]||e,t[2]||n):tt(Rr,t[0],t[1]||e,t[2]||n)}var Nr=Math.PI/180;function Ir(t){return t*Nr}var Dr=180/Math.PI;function Br(t){return t*Dr}var Fr=Math.PI/2;function zr(t,e){return 16===e.length?function(t,e){var n,r,i=Ht(U(),e),o=(0,H.Z)(i,3),a=o[0],s=o[1],c=o[2],l=Math.asin(-e[2]/a);return l-Fr?(n=Math.atan2(e[6]/s,e[10]/c),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=l,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,c=o*o,l=n*n+a+s+c,u=n*o-r*i;return u>.499995*l?(t[0]=Fr,t[1]=2*Math.atan2(r,n),t[2]=0):u<-.499995*l?(t[0]=-Fr,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+c)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function Zr(t,e,n,r,i){var o,a,s,c,l,u,f,h,d,p,y=Math.cos(t),g=Math.sin(t);return o=r*y,a=i*g,s=0,c=-r*g,l=i*y,u=0,f=e,h=n,d=1,(p=new V(9))[0]=o,p[1]=a,p[2]=s,p[3]=c,p[4]=l,p[5]=u,p[6]=f,p[7]=h,p[8]=d,p}function Wr(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);if(e*i-n*r<0&&(e7&&void 0!==arguments[7]&&arguments[7],u=2*o,f=n-e,h=r-i,d=u/f,p=u/h,y=(n+e)/f,g=(r+i)/h,v=a-o,m=a*o;l?(s=-a/v,c=-m/v):(s=-(a+o)/v,c=-2*m/v),t[0]=d,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=p,t[6]=0,t[7]=0,t[8]=y,t[9]=g,t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=c,t[15]=0}(this.projectionMatrix,c,c+s,o-a,o,t,this.far,this.clipSpaceNearZ===yr.ZERO),Et(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,n,r,i,o){var a;this.projectionMode=Kr.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var s=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,u=(this.top+this.bottom)/2,f=l-s,h=l+s,d=u+c,p=u-c;if(null!==(a=this.view)&&void 0!==a&&a.enabled){var y=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h=(f+=y*this.view.offsetX)+y*this.view.width,p=(d-=g*this.view.offsetY)-g*this.view.height}return this.clipSpaceNearZ===yr.NEGATIVE_ONE?ne(this.projectionMatrix,f,h,d,p,i,o):re(this.projectionMatrix,f,h,d,p,i,o),Et(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2],r=Lr(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],r=Q(0,1,0);if(this.focalPoint=Lr(t,e,n),this.trackingMode===Xr.CINEMATIC){var i=nt(U(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=K(i),a=Br(Math.asin(e/o)),s=90+Br(Math.atan2(n,t)),c=bt();Lt(c,c,Ir(s)),Rt(c,c,Ir(a)),r=lt(U(),[0,1,0],c)}return Et(this.matrix,ie(bt(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Mi(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Mi(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=pi.exec(t))?new Si(e[1],e[2],e[3],1):(e=yi.exec(t))?new Si(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=gi.exec(t))?Mi(e[1],e[2],e[3],e[4]):(e=vi.exec(t))?Mi(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=mi.exec(t))?Ri(e[1],e[2]/100,e[3]/100,1):(e=bi.exec(t))?Ri(e[1],e[2]/100,e[3]/100,e[4]):xi.hasOwnProperty(t)?_i(xi[t]):"transparent"===t?new Si(NaN,NaN,NaN,0):null}function _i(t){return new Si(t>>16&255,t>>8&255,255&t,1)}function Mi(t,e,n,r){return r<=0&&(t=e=n=NaN),new Si(t,e,n,r)}function Ei(t){return t instanceof si||(t=ki(t)),t?new Si((t=t.rgb()).r,t.g,t.b,t.opacity):new Si}function Si(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Ai(){return`#${Ci(this.r)}${Ci(this.g)}${Ci(this.b)}`}function ji(){const t=Pi(this.opacity);return`${1===t?"rgb(":"rgba("}${Ti(this.r)}, ${Ti(this.g)}, ${Ti(this.b)}${1===t?")":`, ${t})`}`}function Pi(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ti(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ci(t){return((t=Ti(t))<16?"0":"")+t.toString(16)}function Ri(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ni(t,e,n,r)}function Li(t){if(t instanceof Ni)return new Ni(t.h,t.s,t.l,t.opacity);if(t instanceof si||(t=ki(t)),!t)return new Ni;if(t instanceof Ni)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,c=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n0&&c<1?0:a,new Ni(a,s,c,t.opacity)}function Ni(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ii(t){return(t=(t||0)%360)<0?t+360:t}function Di(t){return Math.max(0,Math.min(1,t||0))}function Bi(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Fi(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=arguments.length,i=new Array(r),o=0;o=240?t-240:t+120,i,r),Bi(t,i,r),Bi(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Ni(Ii(this.h),Di(this.s),Di(this.l),Pi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Pi(this.opacity);return`${1===t?"hsl(":"hsla("}${Ii(this.h)}, ${100*Di(this.s)}%, ${100*Di(this.l)}%${1===t?")":`, ${t})`}`}})),Fi.Cache=Map,Fi.cacheList=[],Fi.clearCache=function(){Fi.cacheList.forEach((function(t){return t.clear()}))};var zi=function(t){return t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger",t}({}),Zi=function(t){return t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther",t}({}),Wi=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),$i=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Gi=[{name:"em",unit_type:zi.kEms},{name:"px",unit_type:zi.kPixels},{name:"deg",unit_type:zi.kDegrees},{name:"rad",unit_type:zi.kRadians},{name:"grad",unit_type:zi.kGradians},{name:"ms",unit_type:zi.kMilliseconds},{name:"s",unit_type:zi.kSeconds},{name:"rem",unit_type:zi.kRems},{name:"turn",unit_type:zi.kTurns}],Hi=function(t){return t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType",t}({}),qi=function(t){return t?"number"===t?zi.kNumber:"percent"===t||"%"===t?zi.kPercentage:function(t){return Gi.find((function(e){return e.name===t})).unit_type}(t):zi.kUnknown},Yi=function(t){var e=1;switch(t){case zi.kPixels:case zi.kDegrees:case zi.kSeconds:break;case zi.kMilliseconds:e=.001;break;case zi.kRadians:e=180/Math.PI;break;case zi.kGradians:e=.9;break;case zi.kTurns:e=360}return e},Vi=function(t){switch(t){case zi.kNumber:case zi.kInteger:return"";case zi.kPercentage:return"%";case zi.kEms:return"em";case zi.kRems:return"rem";case zi.kPixels:return"px";case zi.kDegrees:return"deg";case zi.kRadians:return"rad";case zi.kGradians:return"grad";case zi.kMilliseconds:return"ms";case zi.kSeconds:return"s";case zi.kTurns:return"turn"}return""},Ui=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t)}),[{key:"toString",value:function(){return this.buildCSSText(Wi.kNo,$i.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=Hi.kUnitType&&this.getType()<=Hi.kClampType}}],[{key:"isAngle",value:function(t){return t===zi.kDegrees||t===zi.kRadians||t===zi.kGradians||t===zi.kTurns}},{key:"isLength",value:function(t){return t>=zi.kEms&&t1&&void 0!==arguments[1]?arguments[1]:zi.kNumber;return(0,z.Z)(this,e),n=(0,$.Z)(this,e),r="string"==typeof i?qi(i):i,n.unit=r,n.value=t,n}return(0,G.Z)(e,t),(0,Z.Z)(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(t){var e=t;return this.value===e.value&&this.unit===e.unit}},{key:"getType",value:function(){return Hi.kUnitType}},{key:"convertTo",value:function(t){if(this.unit===t)return new e(this.value,this.unit);var n=to(this.unit);if(n!==to(t)||n===zi.kUnknown)return null;var r=Yi(this.unit)/Yi(t);return new e(this.value*r,t)}},{key:"buildCSSText",value:function(t,e,n){var r;switch(this.unit){case zi.kUnknown:break;case zi.kInteger:r=Number(this.value).toFixed(0);break;case zi.kNumber:case zi.kPercentage:case zi.kEms:case zi.kRems:case zi.kPixels:case zi.kDegrees:case zi.kRadians:case zi.kGradians:case zi.kMilliseconds:case zi.kSeconds:case zi.kTurns:var i=this.value,o=Vi(this.unit);if(i<-999999||i>999999){var a=Vi(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+=r}}])}(Ui),no=new eo(0,"px");new eo(1,"px");var ro=new eo(0,"deg"),io=function(t){function e(t,n,r){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return(0,z.Z)(this,e),(i=(0,$.Z)(this,e,["rgb"])).r=t,i.g=n,i.b=r,i.alpha=o,i.isNone=a,i}return(0,G.Z)(e,t),(0,Z.Z)(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return"".concat(n,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(Xi),oo=new Ji("unset"),ao={"":oo,unset:oo,initial:new Ji("initial"),inherit:new Ji("inherit")},so=new io(0,0,0,0,!0),co=new io(0,0,0,0),lo=Fi((function(t,e,n,r){return new io(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),uo=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zi.kNumber;return new eo(t,e)};function fo(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}new eo(50,"%");var ho=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,o=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,a=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,f=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,h=/^\(/,d=/^\)/,p=/^,/,y=/^\#([0-9a-fA-F]+)/,g=/^([a-zA-Z]+)/,v=/^rgb/i,m=/^rgba/i,b=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,x="";function w(t){throw new Error("".concat(x,": ").concat(t))}function O(){var t=C(k);return x.length>0&&w("Invalid input not EOF"),t}function k(){return _("linear-gradient",t,E)||_("repeating-linear-gradient",e,E)||_("radial-gradient",n,S)||_("repeating-radial-gradient",r,S)||_("conic-gradient",i,S)}function _(t,e,n){return M(e,(function(e){var r=n();return r&&(B(p)||w("Missing comma before color stops")),{type:t,orientation:r,colorStops:C(R)}}))}function M(t,e){var n=B(t);if(n){B(h)||w("Missing (");var r=e(n);return B(d)||w("Missing )"),r}}function E(){return D("directional",o,1)||D("angular",f,1)}function S(){var t,e,n=A();return n&&((t=[]).push(n),e=x,B(p)&&((n=A())?t.push(n):x=e)),t}function A(){var t=function(){var t=D("shape",/^(circle)/i,0);t&&(t.style=I()||j());return t}()||function(){var t=D("shape",/^(ellipse)/i,0);t&&(t.style=N()||j());return t}();if(t)t.at=P();else{var e=j();if(e){t=e;var n=P();n&&(t.at=n)}else{var r=T();r&&(t={type:"default-radial",at:r})}}return t}function j(){return D("extent-keyword",a,1)}function P(){if(D("position",/^at/,0)){var t=T();return t||w("Missing positioning value"),t}}function T(){var t={x:N(),y:N()};if(t.x||t.y)return{type:"position",value:t}}function C(t){var e=t(),n=[];if(e)for(n.push(e);B(p);)(e=t())?n.push(e):w("One extra comma");return n}function R(){var t=D("hex",y,1)||M(m,(function(){return{type:"rgba",value:C(L)}}))||M(v,(function(){return{type:"rgb",value:C(L)}}))||D("literal",g,0);return t||w("Expected color definition"),t.length=N(),t}function L(){return B(b)[1]}function N(){return D("%",l,1)||D("position-keyword",s,1)||I()}function I(){return D("px",c,1)||D("em",u,1)}function D(t,e,n){var r=B(e);if(r)return{type:t,value:r[n]}}function B(t){var e=/^[\n\r\t\s]+/.exec(x);e&&F(e[0].length);var n=t.exec(x);return n&&F(n[0].length),n}function F(t){x=x.substring(t)}return function(t){return x=t,O()}}();var po=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,yo=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,go=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,vo=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var mo={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},bo=Fi((function(t){var e;return e="angular"===t.type?Number(t.value):mo[t.value]||0,uo(e,"deg")})),xo=Fi((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:uo(e,r),cy:uo(n,i)}})),wo=Fi((function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return ho(t).map((function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,o=Number(t[0].length.value),a=1;a=0)return uo(Number(e),"px");if("deg".search(t)>=0)return uo(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U".concat(t)}));var r="U(".concat(t.source,")");return n.map((function(t){return uo(Number(e.replace(new RegExp("U".concat(t),"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var So=function(t){return Eo(new RegExp("px","g"),t)},Ao=Fi(So);Fi((function(t){return Eo(new RegExp("%","g"),t)}));var jo=function(t){return De(t)||isFinite(Number(t))?uo(Number(t)||0,"px"):Eo(new RegExp("px|%|em|rem","g"),t)},Po=Fi(jo),To=function(t){return Eo(new RegExp("deg|rad|grad|turn","g"),t)},Co=Fi(To);function Ro(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o="",a=t.value||0,s=e.value||0,c=to(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(a=l.value,s=u.value,o=Vi(t.unit)):(eo.isLength(t.unit)||eo.isLength(e.unit))&&(a=Io(t,i,n),s=Io(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Lo(t){var e=0;return t.unit===zi.kDegrees?e=t.value:t.unit===zi.kRadians?e=Br(Number(t.value)):t.unit===zi.kTurns?e=360*Number(t.value):t.value&&(e=t.value),e}function No(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):ze(t)?n=t.split(" ").map((function(t){return Number(t)})):De(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:4===e?1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]:"even"===e&&n.length%2==1?[].concat((0,W.Z)(n),(0,W.Z)(n)):n}function Io(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===zi.kPixels)return Number(t.value);if(t.unit===zi.kPercentage&&n){var i=n.nodeName===pr.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var Do=function(t){return Eo(/deg|rad|grad|turn|px|%/g,t)},Bo=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Fo(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,Bo.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Do(t)||_o(t)}))}),n.lastIndex===t.length)return r}return[]}function zo(t){return t.toString()}var Zo=function(t){return"number"==typeof t?uo(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?uo(Number(t)):uo(0)},Wo=Fi(Zo);function $o(t,e){return[t,e,zo]}function Go(t,e){return function(n,r){return[n,r,function(n){return zo(Ze(n,t,e))}]}}function Ho(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function qo(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=gn(t.parsedStyle.d.absolutePath,void 0,(0,We.pi)((0,We.pi)({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function Yo(t){return 0===t.parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=rr(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength}function Vo(t,e){return t[0]===e[0]&&t[1]===e[1]}function Uo(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),c=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!c||0===Math.sin(c)||xn(c,0))return{xExtra:0,yExtra:0};var l=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),u=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return l=l>Math.PI/2?Math.PI-l:l,u=u>Math.PI/2?Math.PI-u:u,{xExtra:Math.cos(c/2-l)*(e/2*(1/Math.sin(c/2)))-e/2||0,yExtra:Math.cos(u-c/2)*(e/2*(1/Math.sin(c/2)))-e/2||0}}function Xo(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Fi((function(t){return ze(t)?t.split(" ").map(Wo):t.map(Wo)}));var Ko=function(t,e){var n=t.x*e.x+t.y*e.y,r=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)));return(t.x*e.y-t.y*e.x<0?-1:1)*Math.acos(n/r)},Qo=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var c=Ir(r=wn(r,360));if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-a.x)/2,u=(t.y-a.y)/2,f={x:Math.cos(c)*l+Math.sin(c)*u,y:-Math.sin(c)*l+Math.cos(c)*u},h=Math.pow(f.x,2)/Math.pow(e,2)+Math.pow(f.y,2)/Math.pow(n,2);h>1&&(e*=Math.sqrt(h),n*=Math.sqrt(h));var d=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2))/(Math.pow(e,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2));d=d<0?0:d;var p=(i!==o?1:-1)*Math.sqrt(d),y=p*(e*f.y/n),g=p*(-n*f.x/e),v={x:Math.cos(c)*y-Math.sin(c)*g+(t.x+a.x)/2,y:Math.sin(c)*y+Math.cos(c)*g+(t.y+a.y)/2},m={x:(f.x-y)/e,y:(f.y-g)/n},b=Ko({x:1,y:0},m),x=Ko(m,{x:(-f.x-y)/e,y:(-f.y-g)/n});!o&&x>0?x-=2*Math.PI:o&&x<0&&(x+=2*Math.PI);var w=b+(x%=2*Math.PI)*s,O=e*Math.cos(w),k=n*Math.sin(w);return{x:Math.cos(c)*O-Math.sin(c)*k+v.x,y:Math.sin(c)*O+Math.cos(c)*k+v.y,ellipticalArcStartAngle:b,ellipticalArcEndAngle:b+x,ellipticalArcAngle:w,ellipticalArcCenter:v,resultantRx:e,resultantRy:n}};function Jo(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.arcParams,i=r.rx,o=void 0===i?0:i,a=r.ry,s=void 0===a?0:a,c=r.xRotation,l=r.arcFlag,u=r.sweepFlag,f=Qo({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),h=Qo({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),d=h.x-f.x,p=h.y-f.y,y=Math.sqrt(d*d+p*p);return{x:-d/y,y:-p/y}}function ta(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ea(t,e){return ta(t)*ta(e)?(t[0]*e[0]+t[1]*e[1])/(ta(t)*ta(e)):1}function na(t,e){return(t[0]*e[1]1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(h*h)+r*r*(f*f),y=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(y*=-1),isNaN(y)&&(y=0);var g=r?y*n*h/r:0,v=n?y*-r*f/n:0,m=(s+l)/2+Math.cos(i)*g-Math.sin(i)*v,b=(c+u)/2+Math.sin(i)*g+Math.cos(i)*v,x=[(f-g)/n,(h-v)/r],w=[(-1*f-g)/n,(-1*h-v)/r],O=na([1,0],x),k=na(x,w);return ea(x,w)<=-1&&(k=Math.PI),ea(x,w)>=1&&(k=0),0===a&&k>0&&(k-=2*Math.PI),1===a&&k<0&&(k+=2*Math.PI),{cx:m,cy:b,rx:Vo(t,[l,u])?0:n,ry:Vo(t,[l,u])?0:r,startAngle:O,endAngle:O+k,xRotation:i,arcFlag:o,sweepFlag:a}}function ia(t,e,n){return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=Q(e[1],e[2],0);n&<(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var o=Q(e[1],e[2],0),a=Q(e[3],e[4],0),s=Q(e[5],e[6],0);n&&(lt(o,o,n),lt(a,a,n),lt(s,s,n)),r="".concat(e[0]).concat(o[0],",").concat(o[1],",").concat(a[0],",").concat(a[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var c=Q(e[6],e[7],0);n&<(c,c,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(c[0],",").concat(c[1])}else if("Q"===e[0]){var l=Q(e[1],e[2],0),u=Q(e[3],e[4],0);n&&(lt(l,l,n),lt(u,u,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+r}),"")}function oa(t,e,n,r){return[["M",t,e],["L",n,r]]}function aa(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,o=t*i,a=e*i,s=n-t,c=n+t,l=r-e,u=r+e;return[["M",s,r],["C",s,r-a,n-o,l,n,l],["C",n+o,l,c,r-a,c,r],["C",c,r+a,n+o,u,n,u],["C",n-o,u,s,r+a,s,r],["Z"]]}function sa(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}function ca(t,e,n,r,i){if(i){var o=(0,H.Z)(i,4),a=o[0],s=o[1],c=o[2],l=o[3],u=t>0?1:-1,f=e>0?1:-1,h=u+f!==0?1:0;return[["M",u*a+n,r],["L",t-u*s+n,r],s?["A",s,s,0,0,h,t+n,f*s+r]:null,["L",t+n,e-f*c+r],c?["A",c,c,0,0,h,t+n-u*c,e+r]:null,["L",n+u*l,e+r],l?["A",l,l,0,0,h,n,e+r-f*l]:null,["L",n,f*a+r],a?["A",a,a,0,0,h,u*a+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}function la(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.getLocalTransform(),n=[];switch(t.nodeName){case pr.LINE:var r=t.parsedStyle,i=r.x1,o=void 0===i?0:i,a=r.y1,s=void 0===a?0:a,c=r.x2,l=void 0===c?0:c,u=r.y2,f=void 0===u?0:u;n=oa(o,s,l,f);break;case pr.CIRCLE:var h=t.parsedStyle,d=h.r,p=void 0===d?0:d,y=h.cx,g=void 0===y?0:y,v=h.cy,m=void 0===v?0:v;n=aa(p,p,g,m);break;case pr.ELLIPSE:var b=t.parsedStyle,x=b.rx,w=void 0===x?0:x,O=b.ry,k=void 0===O?0:O,_=b.cx,M=void 0===_?0:_,E=b.cy,S=void 0===E?0:E;n=aa(w,k,M,S);break;case pr.POLYLINE:case pr.POLYGON:var A=t.parsedStyle.points;n=sa(A.points,t.nodeName===pr.POLYGON);break;case pr.RECT:var j=t.parsedStyle,P=j.width,T=void 0===P?0:P,C=j.height,R=void 0===C?0:C,L=j.x,N=void 0===L?0:L,I=j.y,D=void 0===I?0:I,B=j.radius,F=B&&B.some((function(t){return 0!==t}));n=ca(T,R,N,D,F&&B.map((function(t){return Ze(t,0,Math.min(Math.abs(T)/2,Math.abs(R)/2))})));break;case pr.PATH:var z=t.parsedStyle.d.absolutePath;n=(0,W.Z)(z)}if(n.length)return ia(n,0,e)}var ua=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=an(t)}catch(n){e=an(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;e0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;sqr[1][2]&&(o[0]=-o[0]),qr[0][2]>qr[2][0]&&(o[1]=-o[1]),qr[1][0]>qr[0][1]&&(o[2]=-o[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(_a).reduce(Ma)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var Sa=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;r<4;r++)for(var i=0;i<4;i++)for(var o=0;o<4;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;s<4;s++)a[s][3]=o[s];for(var c=0;c<3;c++)for(var l=0;l<3;l++)a[3][c]+=e[l]*a[l][c];var u=i[0],f=i[1],h=i[2],d=i[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(f*f+h*h),p[0][1]=2*(u*f-h*d),p[0][2]=2*(u*h+f*d),p[1][0]=2*(u*f+h*d),p[1][1]=1-2*(u*u+h*h),p[1][2]=2*(f*h-u*d),p[2][0]=2*(u*h-f*d),p[2][1]=2*(f*h+u*d),p[2][2]=1-2*(u*u+f*f),a=t(a,p);var y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(y[2][1]=r[2],a=t(a,y)),r[1]&&(y[2][1]=0,y[2][0]=r[0],a=t(a,y)),r[0]&&(y[2][0]=0,y[1][0]=r[0],a=t(a,y));for(var g=0;g<3;g++)for(var v=0;v<3;v++)a[g][v]*=n[g];return function(t){return 0===t[0][2]&&0===t[0][3]&&0===t[1][2]&&0===t[1][3]&&0===t[2][0]&&0===t[2][1]&&1===t[2][2]&&0===t[2][3]&&0===t[3][2]&&1===t[3][3]}(a)?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function Aa(t){return t.toFixed(6).replace(".000000","")}function ja(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Ea(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Ea(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;r2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var r=t.parsedStyle.clipPath,i=t.parsedStyle.offsetPath;Fa(t,e);var o=!!n.forceUpdateGeometry;if(!o)for(var a in e)if(Ia.has(a)){o=!0;break}var s=za(t);s.has("fill")&&e.fill&&(t.parsedStyle.fill=_o(e.fill)),s.has("stroke")&&e.stroke&&(t.parsedStyle.stroke=_o(e.stroke)),s.has("shadowColor")&&e.shadowColor&&(t.parsedStyle.shadowColor=_o(e.shadowColor)),s.has("filter")&&e.filter&&(t.parsedStyle.filter=Fo(e.filter)),s.has("radius")&&!Fe(e.radius)&&(t.parsedStyle.radius=No(e.radius,4)),s.has("lineDash")&&!Fe(e.lineDash)&&(t.parsedStyle.lineDash=No(e.lineDash,"even")),s.has("points")&&e.points&&(t.parsedStyle.points=pa(e.points)),s.has("d")&&""===e.d&&(t.parsedStyle.d=(0,F.Z)({},ri)),s.has("d")&&e.d&&(t.parsedStyle.d=ha(e.d)),s.has("textTransform")&&e.textTransform&&this.runtime.CSSPropertySyntaxFactory[ii.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),s.has("clipPath")&&!Cn(e.clipPath)&&this.runtime.CSSPropertySyntaxFactory[ii.DEFINED_PATH].calculator("clipPath",r,e.clipPath,t,this.runtime),s.has("offsetPath")&&e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[ii.DEFINED_PATH].calculator("offsetPath",i,e.offsetPath,t,this.runtime),s.has("transform")&&e.transform&&(t.parsedStyle.transform=Oa(e.transform)),s.has("transformOrigin")&&e.transformOrigin&&(t.parsedStyle.transformOrigin=Ra(e.transformOrigin)),s.has("markerStart")&&e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[ii.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),s.has("markerEnd")&&e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[ii.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),s.has("markerMid")&&e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[ii.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),s.has("zIndex")&&!Fe(e.zIndex)&&this.runtime.CSSPropertySyntaxFactory[ii.Z_INDEX].postProcessor(t),s.has("offsetDistance")&&!Fe(e.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[ii.OFFSET_DISTANCE].postProcessor(t),s.has("transform")&&e.transform&&this.runtime.CSSPropertySyntaxFactory[ii.TRANSFORM].postProcessor(t),s.has("transformOrigin")&&e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[ii.TRANSFORM_ORIGIN].postProcessor(t),o&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new _r),r.renderBounds||(r.renderBounds=new _r);var i=t.parsedStyle,o=n.update(i,t),a=o.cx,s=void 0===a?0:a,c=o.cy,l=void 0===c?0:c,u=o.cz,f=void 0===u?0:u,h=o.hwidth,d=void 0===h?0:h,p=o.hheight,y=void 0===p?0:p,g=o.hdepth,v=void 0===g?0:g,m=[Math.abs(d),Math.abs(y),v],b=i.stroke,x=i.lineWidth,w=void 0===x?1:x,O=i.increasedLineWidthForHitTesting,k=void 0===O?0:O,_=i.shadowType,M=void 0===_?"outer":_,E=i.shadowColor,S=i.filter,A=void 0===S?[]:S,j=i.transformOrigin,P=[s,l,f];r.contentBounds.update(P,m);var T=e===pr.POLYLINE||e===pr.POLYGON||e===pr.PATH?Math.SQRT2:.5;if(b&&!b.isNone){var C=((w||0)+(k||0))*T;m[0]+=C,m[1]+=C}if(r.renderBounds.update(P,m),E&&M&&"inner"!==M){var R=r.renderBounds,L=R.min,N=R.max,I=i.shadowBlur||0,D=i.shadowOffsetX||0,B=i.shadowOffsetY||0,F=L[0]-I+D,z=N[0]+I+D,Z=L[1]-I+B,W=N[1]+I+B;L[0]=Math.min(L[0],F),N[0]=Math.max(N[0],z),L[1]=Math.min(L[1],Z),N[1]=Math.max(N[1],W),r.renderBounds.setMinMax(L,N)}A.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,et(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,c=r.renderBounds,l=c.min,u=c.max,f=l[0]-s+o,h=u[0]+s+o,d=l[1]-s+a,p=u[1]+s+a;l[0]=Math.min(l[0],f),u[0]=Math.max(u[0],h),l[1]=Math.min(l[1],d),u[1]=Math.max(u[1],p),r.renderBounds.setMinMax(l,u)}})),t.geometry.dirty=!1;var $=y<0,G=(d<0?-1:1)*(j?Io(j[0],0,t,!0):0),H=($?-1:1)*(j?Io(j[1],1,t,!0):0);(G||H)&&t.setOrigin(G,H)}}},{key:"updateSizeAttenuation",value:function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===pr.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===pr.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();function Fa(t,e){var n=za(t);for(var r in e)n.has(r)&&(t.parsedStyle[r]=e[r])}function za(t){return t.constructor.PARSED_STYLE_LIST}var Za=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t),this.mixer=$o}),[{key:"calculator",value:function(t,e,n,r){return Lo(n)}}])}(),Wa=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t)}),[{key:"calculator",value:function(t,e,n,r,i){return n instanceof Ji&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n}}])}(),$a=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t),this.parser=_o,this.mixer=Mo}),[{key:"calculator",value:function(t,e,n,r){return n instanceof Ji?"none"===n.value?so:co:n}}])}(),Ga=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t)}),[{key:"calculator",value:function(t,e,n){return n instanceof Ji?[]:n}}])}();function Ha(t){var e=t.parsedStyle.fontSize;return Fe(e)?null:e}var qa=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t),this.mixer=$o}),[{key:"calculator",value:function(t,e,n,r,i){if(De(n))return n;if(!eo.isRelativeUnit(n.unit))return n.value;if(n.unit===zi.kPercentage)return 0;if(n.unit===zi.kEms){if(r.parentNode){var o=Ha(r.parentNode);if(o)return o*=n.value}return 0}if(n.unit===zi.kRems){var a;if(null!=r&&null!==(a=r.ownerDocument)&&void 0!==a&&a.documentElement){var s=Ha(r.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),Ya=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t),this.mixer=Ho}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),Va=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t),this.mixer=Ho}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),Ua=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i;n instanceof Ji&&(n=null);var o=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return o&&(o.style.isMarker=!0),o}}])}(),Xa=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t),this.mixer=$o}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Ka=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t),this.mixer=Go(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,n=e.offsetPath,r=e.offsetDistance;if(n){var i=n.nodeName;if(i===pr.LINE||i===pr.PATH||i===pr.POLYLINE){var o=n.getPoint(r);o&&t.setLocalPosition(o.x,o.y)}}}}])}(),Qa=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t),this.mixer=Go(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Ja=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t),this.parser=ha,this.mixer=da}),[{key:"calculator",value:function(t,e,n){return n instanceof Ji&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new jr(0,0,0,0)}:n}}])}(),ts=(0,Z.Z)((function t(){(0,z.Z)(this,t),this.mixer=ya})),es=function(t){function e(){var t;(0,z.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=!1,i=!1,o=!!e&&!e.isNone,a=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=o,i=a):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]}var ps=1,ys="object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:{},gs=Date.now(),vs={},ms=Date.now(),bs=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-ms,r=n>16?0:16-n,i=ps++;return vs[i]=t,Object.keys(vs).length>1||setTimeout((function(){ms=e;var t=vs;vs={},Object.keys(t).forEach((function(e){return t[e](ys.performance&&"function"==typeof ys.performance.now?ys.performance.now():Date.now()-gs)}))}),r),i},xs=function(t){delete vs[t]},ws=function(t){return"string"!=typeof t?bs:""===t?ys.requestAnimationFrame:ys["".concat(t,"RequestAnimationFrame")]},Os=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!ws(t)})),ks=ws(Os),_s=function(t){return"string"!=typeof t?xs:""===t?ys.cancelAnimationFrame:ys["".concat(t,"CancelAnimationFrame")]||ys["".concat(t,"CancelRequestAnimationFrame")]}(Os);ys.requestAnimationFrame=ks,ys.cancelAnimationFrame=_s;var Ms=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t),this.callbacks=[]}),[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]&&arguments[1],r=nc.get(this);r||(r=this.document?this:this.defaultView?this.defaultView:null===(e=this.ownerDocument)||void 0===e?void 0:e.defaultView)&&nc.set(this,r);if(r){if(t.manager=r.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.emitter.emit(t.type,t);return!t.defaultPrevented}}])}(),ic=function(t){function e(){var t;(0,z.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw new Error(Pr)}},{key:"lookupNamespaceURI",value:function(t){throw new Error(Pr)}},{key:"lookupPrefix",value:function(t){throw new Error(Pr)}},{key:"normalize",value:function(){throw new Error(Pr)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(t){if(t===this)return 0;for(var n=t,r=this,i=[n],o=[r];null!==(a=n.parentNode)&&void 0!==a?a:r.parentNode;){var a;n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(o.push(r.parentNode),r.parentNode):r}if(n!==r)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=i.length>o.length?i:o,c=s===i?o:i;if(s[s.length-c.length]===c[0])return s===i?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-c.length,u=c.length-1;u>=0;u--){var f=c[u],h=s[l+u];if(h!==f){var d=f.parentNode.childNodes;return d.indexOf(f)0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var r=n.childNodes.length-1;r>=0;r--)e.push(n.childNodes[r])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(rc);ic.DOCUMENT_POSITION_DISCONNECTED=1,ic.DOCUMENT_POSITION_PRECEDING=2,ic.DOCUMENT_POSITION_FOLLOWING=4,ic.DOCUMENT_POSITION_CONTAINS=8,ic.DOCUMENT_POSITION_CONTAINED_BY=16,ic.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var oc=function(){return(0,Z.Z)((function t(e,n){var r=this;(0,z.Z)(this,t),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=bt(),this.tmpVec3=U(),this.onPointerDown=function(t){var e=r.createPointerEvent(t);if(r.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)r.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){var n=2===e.button;r.dispatchEvent(e,n?"rightdown":"mousedown")}r.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),r.freeEvent(e)},this.onPointerUp=function(t){var e=fs.now(),n=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)r.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){var i=2===n.button;r.dispatchEvent(n,i?"rightup":"mouseup")}var o=r.trackingData(t.pointerId),a=r.findMountedTarget(o.pressTargetsByButton[t.button]),s=a;if(a&&!n.composedPath().includes(a)){for(var c=a;c&&!n.composedPath().includes(c);){if(n.currentTarget=c,r.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)r.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){var l=2===n.button;r.notifyTarget(n,l?"rightupoutside":"mouseupoutside")}ic.isNode(c)&&(c=c.parentNode)}delete o.pressTargetsByButton[t.button],s=c}if(s){var u,f=r.clonePointerEvent(n,"click");f.target=s,f.path=[],o.clicksByButton[t.button]||(o.clicksByButton[t.button]={clickCount:0,target:f.target,timeStamp:e});var h=r.context.renderingContext.root.ownerDocument.defaultView,d=o.clicksByButton[t.button];d.target===f.target&&e-d.timeStamp=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var o=i+1;oi||n>o?null:!a&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,r=null==e?void 0:e.target;if(null!==(n=r)&&void 0!==n&&n.shadowRoot&&(r=e.composedPath()[0]),r){if(r===t)return!0;if(t&&t.contains)return t.contains(r)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();e=0;n--){var r=t[n];if(!(r===this.rootTarget||ic.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=as(e)&&e.getAttribute("cursor");if(n)return n;e=ic.isNode(e)&&e.parentNode}}}])}(),ac=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t)}),[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||Wc.offscreenCanvas)this.canvas=t||Wc.offscreenCanvas,this.context=this.canvas.getContext("2d",(0,F.Z)({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",(0,F.Z)({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",(0,F.Z)({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),sc=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),cc=function(){return(0,Z.Z)((function t(e,n){(0,z.Z)(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Ss,initAsync:new Ms,dirtycheck:new As,cull:new As,beginFrame:new Ss,beforeRender:new Ss,render:new Ss,afterRender:new Ss,endFrame:new Ss,destroy:new Ss,pick:new Es,pickSync:new As,pointerDown:new Ss,pointerUp:new Ss,pointerMove:new Ss,pointerOut:new Ss,pointerOver:new Ss,pointerWheel:new Ss,pointerCancel:new Ss,click:new Ss},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(t){var e=this,n=(0,F.Z)((0,F.Z)({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()})).catch((function(t){}))}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(sc.CAMERA_CHANGED)}},{key:"render",value:function(t,e,n){var r=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var o=1===i.renderReasons.size&&i.renderReasons.has(sc.CAMERA_CHANGED),a=!t.disableRenderHooks||!(t.disableRenderHooks&&o);a&&this.renderDisplayObject(i.root,t,i),this.hooks.beginFrame.call(e),a&&i.renderListCurrentFrame.forEach((function(t){r.hooks.beforeRender.call(t),r.hooks.render.call(t),r.hooks.afterRender.call(t)})),this.hooks.endFrame.call(e),i.renderListCurrentFrame=[],i.renderReasons.clear(),n()}}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;function s(t){var e=t.renderable,i=t.sortable,s=o?e.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(s){var c=a?r.hooks.cull.call(s,r.context.camera):s;c&&(r.stats.rendered+=1,n.renderListCurrentFrame.push(c))}e.dirty=!1,i.renderOrder=r.zIndexCounter,r.zIndexCounter+=1,r.stats.total+=1,i.dirty&&(r.sort(t,i),i.dirty=!1,i.dirtyChildren=[],i.dirtyReason=void 0)}for(var c=[t];c.length>0;){var l=c.pop();s(l);for(var u=l.sortable.sorted||l.childNodes,f=u.length-1;f>=0;f--)c.push(u[f])}}},{key:"sort",value:function(t,e){e.sorted&&e.dirtyReason!==ni.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){if(-1===t.childNodes.indexOf(n)){var r=e.sorted.indexOf(n);r>=0&&e.sorted.splice(r,1)}else if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;n>>1;ss(t[i],e)<0?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}})):e.sorted=t.childNodes.slice().sort(ss)}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(sc.DISPLAY_OBJECT_CHANGED)}}])}(),lc=/\[\s*(.*)=(.*)\s*\]/,uc=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t)}),[{key:"selectOne",value:function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))}},{key:"selectAll",value:function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))}},{key:"is",value:function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(lc),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return Fe(n)?"":n.toString?n.toString():""}}])}(),fc=function(t){return t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.MOUNTED="DOMNodeInsertedIntoDocument",t.REMOVED="removed",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.REPARENT="reparent",t.DESTROY="destroy",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),hc=function(t){function e(t,n,r,i,o,a,s,c){var l;return(0,z.Z)(this,e),(l=(0,$.Z)(this,e,[null])).relatedNode=n,l.prevValue=r,l.newValue=i,l.attrName=o,l.attrChange=a,l.prevParsedValue=s,l.newParsedValue=c,l.type=t,l}return(0,G.Z)(e,t),(0,Z.Z)(e)}(Ks);function dc(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}hc.ADDITION=2,hc.MODIFICATION=1,hc.REMOVAL=3;var pc,yc,gc,vc=new hc(fc.REPARENT,null,"","","",0,"",""),mc=Le(),bc=U(),xc=Q(1,1,1),wc=bt(),Oc=Le(),kc=U(),_c=bt(),Mc=ve(),Ec=U(),Sc=ve(),Ac=U(),jc=U(),Pc=U(),Tc=bt(),Cc=ve(),Rc=ve(),Lc=ve(),Nc={affectChildren:!0},Ic=function(){return(0,Z.Z)((function t(e){(0,z.Z)(this,t),this.pendingEvents=new Map,this.boundsChangedEvent=new ec(fc.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e}),[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t));var o=t.nodeName===pr.FRAGMENT,a=hs(e);t.parentNode=e;var s=o?t.childNodes:[t];De(n)?s.forEach((function(t){e.childNodes.splice(n,0,t),t.parentNode=e})):s.forEach((function(t){e.childNodes.push(t),t.parentNode=e}));var c=e.sortable;if((null!=c&&null!==(r=c.sorted)&&void 0!==r&&r.length||t.parsedStyle.zIndex)&&(-1===c.dirtyChildren.indexOf(t)&&c.dirtyChildren.push(t),c.dirty=!0,c.dirtyReason=ni.ADDED),!a){if(o)this.dirtifyFragment(t);else{var l=t.transformable;l&&this.dirtifyWorld(t,l)}i&&t.dispatchEvent(vc)}}},{key:"detach",value:function(t){if(t.parentNode){var e,n,r=t.transformable,i=t.parentNode.sortable;(null!=i&&null!==(e=i.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=ni.REMOVED);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"setOrigin",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=[e,n,r]);var i=t.transformable;if(e[0]!==i.origin[0]||e[1]!==i.origin[1]||e[2]!==i.origin[2]){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}}},{key:"rotate",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=Q(e,n,r));var i=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var o=Mc;Oe(o,e[0],e[1],e[2]);var a=this.getRotation(t),s=this.getRotation(t.parentNode);Pe(Lc,s),we(Lc,Lc),be(o,Lc,o),be(i.localRotation,o,a),Re(i.localRotation,i.localRotation),this.dirtifyLocal(t,i)}else this.rotateLocal(t,e)}},{key:"rotateLocal",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=Q(e,n,r));var i=t.transformable;Oe(Rc,e[0],e[1],e[2]),Ce(i.localRotation,i.localRotation,Rc),this.dirtifyLocal(t,i)}},{key:"setEulerAngles",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=Q(e,n,r));var i=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Oe(i.localRotation,e[0],e[1],e[2]);var o=this.getRotation(t.parentNode);Pe(Cc,we(Mc,o)),Ce(i.localRotation,i.localRotation,Cc),this.dirtifyLocal(t,i)}else this.setLocalEulerAngles(t,e)}},{key:"setLocalEulerAngles",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];"number"==typeof e&&(e=Q(e,n,r));var o=t.transformable;Oe(o.localRotation,e[0],e[1],e[2]),i&&this.dirtifyLocal(t,o)}},{key:"translateLocal",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=Q(e,n,r));var i=t.transformable;ft(e,bc)||(ut(e,e,i.localRotation),et(i.localPosition,i.localPosition,e),this.dirtifyLocal(t,i))}},{key:"setPosition",value:function(t,e){var n,r=t.transformable;if(Pc[0]=e[0],Pc[1]=e[1],Pc[2]=null!==(n=e[2])&&void 0!==n?n:0,!ft(this.getPosition(t),Pc)){if(J(r.position,Pc),null!==t.parentNode&&t.parentNode.transformable){var i=t.parentNode.transformable;wt(Tc,i.worldTransform),Et(Tc,Tc),lt(r.localPosition,Pc,Tc)}else J(r.localPosition,Pc);this.dirtifyLocal(t,r)}}},{key:"setLocalPosition",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.transformable;jc[0]=e[0],jc[1]=e[1],jc[2]=null!==(n=e[2])&&void 0!==n?n:0,ft(i.localPosition,jc)||(J(i.localPosition,jc),r&&this.dirtifyLocal(t,i))}},{key:"scaleLocal",value:function(t,e){var n,r=t.transformable;rt(r.localScale,r.localScale,tt(kc,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1)),this.dirtifyLocal(t,r)}},{key:"setLocalScale",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.transformable;tt(kc,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:i.localScale[2]),ft(kc,i.localScale)||(J(i.localScale,kc),r&&this.dirtifyLocal(t,i))}},{key:"translate",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=tt(kc,e,n,r)),ft(e,bc)||(et(kc,this.getPosition(t),e),this.setPosition(t,kc))}},{key:"setRotation",value:function(t,e,n,r,i){var o=t.transformable;if("number"==typeof e&&(e=je(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var a=this.getRotation(t.parentNode);Pe(Mc,a),we(Mc,Mc),be(o.localRotation,Mc,e),Re(o.localRotation,o.localRotation),this.dirtifyLocal(t,o)}else this.setLocalRotation(t,e)}},{key:"setLocalRotation",value:function(t,e,n,r,i){var o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];"number"==typeof e&&(e=Te(Mc,e,n,r,i));var a=t.transformable;Pe(a.localRotation,e),o&&this.dirtifyLocal(t,a)}},{key:"setLocalSkew",value:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];"number"==typeof e&&(e=Ie(Oc,e,n));var i=t.transformable;Ne(i.localSkew,e),r&&this.dirtifyLocal(t,i)}},{key:"dirtifyLocal",value:function(t,e){hs(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))}},{key:"dirtifyWorld",value:function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)}},{key:"dirtifyFragment",value:function(t){var e=t.transformable;e&&(e.frozen=!1,e.dirtyFlag=!0,e.localDirtyFlag=!0);var n=t.renderable;n&&(n.renderBoundsDirty=!0,n.boundsDirty=!0,n.dirty=!0);for(var r=t.childNodes.length,i=0;i1&&void 0!==arguments[1]&&arguments[1],n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)dc(n),n=n.parentNode;e&&t.forEach((function(t){dc(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,e)}},{key:"updateDisplayObjectDependency",value:function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}}},{key:"informDependentDisplayObjects",value:function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new hc(fc.ATTR_MODIFIED,n,e,e,t,hc.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))}},{key:"getPosition",value:function(t){var e=t.transformable;return Gt(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return qt(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return Ht(e.scaling,this.getWorldTransform(t,e))}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"calcLocalTransform",value:function(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){Vt(t.localTransform,t.localRotation,t.localPosition,Q(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(_t(_c),_c[4]=Math.tan(t.localSkew[0]),_c[1]=Math.tan(t.localSkew[1]),jt(t.localTransform,t.localTransform,_c));var e=Vt(_c,Te(Mc,0,0,0,1),tt(kc,1,1,1),t.localScale,t.origin);jt(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,o=t.localScale,a=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2],c=1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2],l=1!==o[0]||1!==o[1]||1!==o[2],u=0!==a[0]||0!==a[1]||0!==a[2];c||l||u?Vt(n,i,r,o,a):s?It(n,r):_t(n)}}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform}},{key:"setLocalTransform",value:function(t,e){var n=Gt(Ec,e),r=qt(Sc,e),i=Ht(Ac,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,xc,!1),this.setLocalPosition(t,bc,!1),this.setLocalEulerAngles(t,bc,void 0,void 0,!1),this.setLocalSkew(t,mc,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this.getGeometryBounds(t,e);if(!_r.isEmpty(r)){var i=n||new _r;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t,r=n.geometry;r.dirty&&Wc.styleValueRegistry.updateGeometry(t);var i=e?r.renderBounds:r.contentBounds||null;return i||new _r}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t,i=r.renderable;if(!i.boundsDirty&&!n&&i.bounds)return i.bounds;if(!i.renderBoundsDirty&&n&&i.renderBounds)return i.renderBounds;var o=n?i.renderBounds:i.bounds,a=this.getTransformedGeometryBounds(t,n,o),s=t.childNodes;if(s.forEach((function(t){var r=e.getBounds(t,n);r&&(a?a.add(r):(a=o||new _r).update(r.center,r.halfExtents))})),a||(a=new _r),n){var c=cs(t);if(c){var l=c.parsedStyle.clipPath.getBounds(n);a?l&&(a=l.intersection(a)):a.update(l.center,l.halfExtents)}}return n?(i.renderBounds=a,i.renderBoundsDirty=!1):(i.bounds=a,i.boundsDirty=!1),a}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=wc;t.parentNode.transformable&&(e=Et(_c,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!_r.isEmpty(n)){var r=new _r;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r=this.getGeometryBounds(t);_r.isEmpty(r)||(n=new _r).setFromTransformedAABB(r,this.getWorldTransform(t));var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var o=n.getMin(),a=(0,H.Z)(o,2),s=a[0],c=a[1],l=n.getMax(),u=(0,H.Z)(l,2),f=u[0],h=u[1];return new jr(s+((null==i?void 0:i.left)||0),c+((null==i?void 0:i.top)||0),f-s,h-c)}return new jr((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)}},{key:"dirtifyWorldInternal",value:function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}}},{key:"syncHierarchy",value:function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;rs;--h){for(var g=0;g=0;d--){var p=h[d].trim();!Ps.test(p)&&js.indexOf(p)<0&&(p='"'.concat(p,'"')),h[d]=p}return"".concat(a," ").concat(c," ").concat(u," ").concat(f," ").concat(h.join(","))}(e),x=this.measureFont(b,n);0===x.fontSize&&(x.fontSize=i,x.ascent=i);var w=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);w.font=b,e.isOverflowing=!1;var O=(a?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),k=new Array(O.length),_=0;if(!g){for(var M=0;Mr&&e>n;)e-=1,t=t.slice(0,-1);return{lineTxt:t,txtLastCharIndex:e}}function _(t,e){if(!(O<=0||O>d))if(g[t]){var n=k(g[t],e,b+1,d-O);g[t]=n.lineTxt+p}else g[t]=p}for(var M=0;M=u){e.isOverflowing=!0,M0&&m+j>d){var P=k(g[v],M-1,b+1,d);if(P.txtLastCharIndex!==M-1){if(g[v]=P.lineTxt,P.txtLastCharIndex===y.length-1)break;M=P.txtLastCharIndex+1,E=y[M],S=y[M-1],A=y[M+1],j=w(E)}if(v+1>=u){e.isOverflowing=!0,_(v,M-1);break}if(b=M-1,m=0,g[v+=1]="",this.isBreakingSpace(E))continue;this.canBreakInLastChar(E)||(g=this.trimToBreakable(g),m=this.sumTextWidthByCache(g[v]||"",w)),this.shouldBreakByKinsokuShorui(E,A)&&(g=this.trimByKinsokuShorui(g),m+=w(S||""))}m+=j,g[v]=(g[v]||"")+E}}return g.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&Dc.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&Dc.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=(0,W.Z)(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+1,a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(o,n.length),e[e.length-2]=n.slice(0,a),e}},{key:"canBreakInLastChar",value:function(t){return!t||!Bc.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce((function(t,n){return t+e(n)}),0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!Bc.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i}}])}(),Wc={},$c=(yc=new Ys,gc=new qs,pc={},(0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)(pc,pr.FRAGMENT,null),pr.CIRCLE,new Ws),pr.ELLIPSE,new $s),pr.RECT,yc),pr.IMAGE,yc),pr.GROUP,new Us),pr.LINE,new Gs),pr.TEXT,new Vs(Wc)),pr.POLYLINE,gc),pr.POLYGON,gc),(0,Fn.Z)((0,Fn.Z)((0,Fn.Z)(pc,pr.PATH,new Hs),pr.HTML,new Xs),pr.MESH,null)),Gc=function(t){var e=new $a,n=new qa;return t={},(0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)(t,ii.PERCENTAGE,null),ii.NUMBER,new Xa),ii.ANGLE,new Za),ii.DEFINED_PATH,new Wa),ii.PAINT,e),ii.COLOR,e),ii.FILTER,new Ga),ii.LENGTH,n),ii.LENGTH_PERCENTAGE,n),ii.LENGTH_PERCENTAGE_12,new Ya),(0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)(t,ii.LENGTH_PERCENTAGE_14,new Va),ii.COORDINATE,new qa),ii.OFFSET_DISTANCE,new Ka),ii.OPACITY_VALUE,new Qa),ii.PATH,new Ja),ii.LIST_OF_POINTS,new ts),ii.SHADOW_BLUR,new es),ii.TEXT,new ns),ii.TEXT_TRANSFORM,new rs),ii.TRANSFORM,new Fs),(0,Fn.Z)((0,Fn.Z)((0,Fn.Z)(t,ii.TRANSFORM_ORIGIN,new zs),ii.Z_INDEX,new Zs),ii.MARKER,new Ua)}();Wc.CameraContribution=ti,Wc.AnimationTimeline=null,Wc.EasingFunction=null,Wc.offscreenCanvasCreator=new ac,Wc.sceneGraphSelector=new uc,Wc.sceneGraphService=new Ic(Wc),Wc.textService=new Zc(Wc),Wc.geometryUpdaterFactory=$c,Wc.CSSPropertySyntaxFactory=Gc,Wc.styleValueRegistry=new Ba(Wc),Wc.layoutRegistry=null,Wc.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},Wc.enableStyleSyntax=!0,Wc.enableSizeAttenuation=!1;var Hc=0;var qc=new hc(fc.INSERTED,null,"","","",0,"",""),Yc=new hc(fc.REMOVED,null,"","","",0,"",""),Vc=new ec(fc.DESTROY),Uc=function(t){function e(){var t;(0,z.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i=0;t--){var e=this.childNodes[t];this.removeChild(e)}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return Wc.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return Wc.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return Wc.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return Wc.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return Wc.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return Wc.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return Wc.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(Wc.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach((function(r){return r===e||!t(r)||(n=r,!1)})),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;i0&&void 0!==arguments[0]?arguments[0]:{},e={forceUpdateGeometry:!0};Wc.styleValueRegistry.processProperties(this,t,e),this.renderable.dirty=!0}},{key:"setAttribute",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];Cn(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),$n(e,"setAttribute",this,3)([t,n]))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.renderable,i=this.attributes[t],o=this.parsedStyle[t];Wc.styleValueRegistry.processProperties(this,(0,Fn.Z)({},t,e),n),r.dirty=!0;var a,s,c=this.parsedStyle[t];(this.isConnected&&(Qc.relatedNode=this,Qc.prevValue=i,Qc.newValue=e,Qc.attrName=t,Qc.prevParsedValue=o,Qc.newParsedValue=c,this.isMutationObserved?this.dispatchEvent(Qc):(Qc.target=this,this.ownerDocument.defaultView.dispatchEvent(Qc,!0))),this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(a=(s=this).attributeChangedCallback)||void 0===a||a.call(s,t,i,e,o,c))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=t.getMin(),n=(0,H.Z)(e,2),r=n[0],i=n[1],o=t.getMax(),a=(0,H.Z)(o,2),s=a[0],c=a[1];return new jr(r,i,s-r,c-i)}},{key:"setOrigin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Wc.sceneGraphService.setOrigin(this,Lr(t,e,n,!1)),this}},{key:"getOrigin",value:function(){return Wc.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Wc.sceneGraphService.setPosition(this,Lr(t,e,n,!1)),this}},{key:"setLocalPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Wc.sceneGraphService.setLocalPosition(this,Lr(t,e,n,!1)),this}},{key:"translate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Wc.sceneGraphService.translate(this,Lr(t,e,n,!1)),this}},{key:"translateLocal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Wc.sceneGraphService.translateLocal(this,Lr(t,e,n,!1)),this}},{key:"getPosition",value:function(){return Wc.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return Wc.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=Lr(t,e=e||t,n=n||t,!1)),Wc.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=Lr(t,e=e||t,n=n||t,!1)),Wc.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return Wc.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return Wc.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){var t=zr(Jc,Wc.sceneGraphService.getWorldTransform(this));return Br((0,H.Z)(t,3)[2])}},{key:"getLocalEulerAngles",value:function(){var t=zr(Jc,Wc.sceneGraphService.getLocalRotation(this));return Br((0,H.Z)(t,3)[2])}},{key:"setEulerAngles",value:function(t){return Wc.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return Wc.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return Fe(e)&&Fe(n)?Wc.sceneGraphService.rotateLocal(this,0,0,t):Wc.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return Fe(e)&&Fe(n)?Wc.sceneGraphService.rotate(this,0,0,t):Wc.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return Wc.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return Wc.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return Wc.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return Wc.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return Wc.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return Wc.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return Wc.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return Wc.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return Wc.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){Wc.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,(0,W.Z)(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,(0,W.Z)(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"move",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}])}(Uc);el.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var nl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,z.Z)(this,e),(0,$.Z)(this,e,[(0,F.Z)({type:pr.CIRCLE},t)])}return(0,G.Z)(e,t),(0,Z.Z)(e)}(el);nl.PARSED_STYLE_LIST=new Set([].concat((0,W.Z)(el.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var rl=["style"],il=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=(0,fr.Z)(n,rl);return(0,z.Z)(this,e),(t=(0,$.Z)(this,e,[(0,F.Z)({style:r},i)])).isCustomElement=!0,t}return(0,G.Z)(e,t),(0,Z.Z)(e)}(el);il.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var ol=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,z.Z)(this,e),(0,$.Z)(this,e,[(0,F.Z)({type:pr.ELLIPSE},t)])}return(0,G.Z)(e,t),(0,Z.Z)(e)}(el);ol.PARSED_STYLE_LIST=new Set([].concat((0,W.Z)(el.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"])),(function(t){function e(){return(0,z.Z)(this,e),(0,$.Z)(this,e,[{type:pr.FRAGMENT}])}return(0,G.Z)(e,t),(0,Z.Z)(e)}(el)).PARSED_STYLE_LIST=new Set(["class","className"]);var al=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,z.Z)(this,e),(0,$.Z)(this,e,[(0,F.Z)({type:pr.GROUP},t)])}return(0,G.Z)(e,t),(0,Z.Z)(e)}(el);al.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var sl=["style"],cl=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=(0,fr.Z)(n,sl);return(0,z.Z)(this,e),(t=(0,$.Z)(this,e,[(0,F.Z)({type:pr.HTML,style:r},i)])).cullable.enable=!1,t}return(0,G.Z)(e,t),(0,Z.Z)(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=Et(bt(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!_r.isEmpty(e)){var n=new _r;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(el);cl.PARSED_STYLE_LIST=new Set([].concat((0,W.Z)(el.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var ll=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,z.Z)(this,e),(0,$.Z)(this,e,[(0,F.Z)({type:pr.IMAGE},t)])}return(0,G.Z)(e,t),(0,Z.Z)(e)}(el);ll.PARSED_STYLE_LIST=new Set([].concat((0,W.Z)(el.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var ul=["style"],fl=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=(0,fr.Z)(n,ul);(0,z.Z)(this,e),(t=(0,$.Z)(this,e,[(0,F.Z)({type:pr.LINE,style:(0,F.Z)({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i)])).markerStartAngle=0,t.markerEndAngle=0;var o=t.parsedStyle,a=o.markerStart,s=o.markerEnd;return a&&Xc(a)&&(t.markerStartAngle=a.getLocalEulerAngles(),t.appendChild(a)),s&&Xc(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return(0,G.Z)(e,t),(0,Z.Z)(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Xc(r)&&(this.markerStartAngle=0,r.remove()),i&&Xc(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Xc(r)&&(this.markerEndAngle=0,r.remove()),i&&Xc(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.x1,s=e.x2,c=e.y1,l=e.y2,u=t?n:r;if(u&&Xc(u)){var f,h,d,p,y,g,v;t?(p=a,y=c,h=s-a,d=l-c,g=i||0,v=this.markerStartAngle):(p=s,y=l,h=a-s,d=c-l,g=o||0,v=this.markerEndAngle),f=Math.atan2(d,h),u.setLocalEulerAngles(180*f/Math.PI+v),u.setLocalPosition(p+Math.cos(f)*g,y+Math.sin(f)*g)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=n.x1,i=n.y1,o=n.x2,a=n.y2,s=Kn(r,i,o,a,t),c=s.x,l=s.y,u=lt(U(),Q(c,l,0),e?this.getWorldTransform():this.getLocalTransform());return new Ar(u[0],u[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return Xn(t.x1,t.y1,t.x2,t.y2)}}])}(el);fl.PARSED_STYLE_LIST=new Set([].concat((0,W.Z)(el.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var hl=["style"],dl=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=(0,fr.Z)(n,hl);(0,z.Z)(this,e),(t=(0,$.Z)(this,e,[(0,F.Z)({type:pr.PATH,style:r,initialParsedStyle:{miterLimit:4,d:(0,F.Z)({},ri)}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var o=t.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&Xc(a)&&(t.markerStartAngle=a.getLocalEulerAngles(),t.appendChild(a)),c&&Xc(c)&&t.placeMarkerMid(c),s&&Xc(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return(0,G.Z)(e,t),(0,Z.Z)(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Xc(r)&&(this.markerStartAngle=0,r.remove()),i&&Xc(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Xc(r)&&(this.markerEndAngle=0,r.remove()),i&&Xc(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=t?n:r;if(a&&Xc(a)){var s,c,l,u,f,h,d;if(t){var p=this.getStartTangent(),y=(0,H.Z)(p,2),g=y[0],v=y[1];u=v[0],f=v[1],c=g[0]-v[0],l=g[1]-v[1],h=i||0,d=this.markerStartAngle}else{var m=this.getEndTangent(),b=(0,H.Z)(m,2),x=b[0],w=b[1];u=w[0],f=w[1],c=x[0]-w[0],l=x[1]-w[1],h=o||0,d=this.markerEndAngle}s=Math.atan2(l,c),a.setLocalEulerAngles(180*s/Math.PI+d),a.setLocalPosition(u+Math.cos(s)*h,f+Math.sin(s)*h)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&Xc(t))for(var n=1;n1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.d.absolutePath,r=Bn(n,t),i=r.x,o=r.y,a=lt(U(),Q(i,o,0),e?this.getWorldTransform():this.getLocalTransform());return new Ar(a[0],a[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*qo(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n}}])}(el);dl.PARSED_STYLE_LIST=new Set([].concat((0,W.Z)(el.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var pl=["style"],yl=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=(0,fr.Z)(n,pl);(0,z.Z)(this,e),(t=(0,$.Z)(this,e,[(0,F.Z)({type:pr.POLYGON,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var o=t.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&Xc(a)&&(t.markerStartAngle=a.getLocalEulerAngles(),t.appendChild(a)),c&&Xc(c)&&t.placeMarkerMid(c),s&&Xc(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return(0,G.Z)(e,t),(0,Z.Z)(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Xc(r)&&(this.markerStartAngle=0,r.remove()),i&&Xc(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Xc(r)&&(this.markerEndAngle=0,r.remove()),i&&Xc(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=(e.points||{}).points,s=t?n:r;if(s&&Xc(s)&&a){var c,l,u,f,h,d,p;if(f=a[0][0],h=a[0][1],t)l=a[1][0]-a[0][0],u=a[1][1]-a[0][1],d=i||0,p=this.markerStartAngle;else{var y=a.length;this.parsedStyle.isClosed?(l=a[y-1][0]-a[0][0],u=a[y-1][1]-a[0][1]):(f=a[y-1][0],h=a[y-1][1],l=a[y-2][0]-a[y-1][0],u=a[y-2][1]-a[y-1][1]),d=o||0,p=this.markerEndAngle}c=Math.atan2(u,l),s.setLocalEulerAngles(180*c/Math.PI+p),s.setLocalPosition(f+Math.cos(c)*d,h+Math.sin(c)*d)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&Xc(t)&&e)for(var n=1;n<(this.parsedStyle.isClosed?e.length:e.length-1);n++){var r=e[n][0],i=e[n][1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(r,i)}}}])}(el);yl.PARSED_STYLE_LIST=new Set([].concat((0,W.Z)(el.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var gl=["style"],vl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=(0,fr.Z)(t,gl);return(0,z.Z)(this,e),(0,$.Z)(this,e,[(0,F.Z)({type:pr.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r)])}return(0,G.Z)(e,t),(0,Z.Z)(e,[{key:"getTotalLength",value:function(){return Yo(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,o=[],a=0,s=this.getTotalLength();n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=Xn(t[0],t[1],n[e+1][0],n[e+1][1]),a+=i,r[1]=a/s,o.push(r))})),this.parsedStyle.points.segments=o}var c=0,l=0;this.parsedStyle.points.segments.forEach((function(e,n){t>=e[0]&&t<=e[1]&&(c=(t-e[0])/(e[1]-e[0]),l=n)}));var u=Kn(n[l][0],n[l][1],n[l+1][0],n[l+1][1],c),f=u.x,h=u.y,d=lt(U(),Q(f,h,0),e?this.getWorldTransform():this.getLocalTransform());return new Ar(d[0],d[1])}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n}}])}(yl);vl.PARSED_STYLE_LIST=new Set([].concat((0,W.Z)(yl.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var ml=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,z.Z)(this,e),(0,$.Z)(this,e,[(0,F.Z)({type:pr.RECT},t)])}return(0,G.Z)(e,t),(0,Z.Z)(e)}(el);ml.PARSED_STYLE_LIST=new Set([].concat((0,W.Z)(el.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var bl=["style"],xl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=(0,fr.Z)(t,bl);return(0,z.Z)(this,e),(0,$.Z)(this,e,[(0,F.Z)({type:pr.TEXT,style:(0,F.Z)({fill:"black"},n)},r)])}return(0,G.Z)(e,t),(0,Z.Z)(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(el);xl.PARSED_STYLE_LIST=new Set([].concat((0,W.Z)(el.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textPathSide","textPathStartOffset","metrics","dx","dy"]));var wl=function(){return(0,Z.Z)((function t(){(0,z.Z)(this,t),this.registry={},this.define(pr.CIRCLE,nl),this.define(pr.ELLIPSE,ol),this.define(pr.RECT,ml),this.define(pr.IMAGE,ll),this.define(pr.LINE,fl),this.define(pr.GROUP,al),this.define(pr.PATH,dl),this.define(pr.POLYGON,yl),this.define(pr.POLYLINE,vl),this.define(pr.TEXT,xl),this.define(pr.HTML,cl)}),[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),Ol=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;Wc.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},kl=function(t){function e(){var t;(0,z.Z)(this,e),(t=(0,$.Z)(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new Wc.AnimationTimeline(t)}catch(t){}var n={};return Na.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=In(i)?i(pr.GROUP):i)})),t.documentElement=new al({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return(0,G.Z)(e,t),(0,Z.Z)(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?xl:al);var r=new n(e);return r.ownerDocument=this,r}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw new Error(Pr)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value:function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o}},{key:"elementFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return null;var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f&&f[0]||this.documentElement}},{key:"elementFromPoint",value:(r=(0,lr.Z)((0,cr.Z)().mark((function t(e,n){var r,i,o,a,s,c,l,u,f,h,d;return(0,cr.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,c=a.height,!(i<0||o<0||i>s||o>c)){t.next=4;break}return t.abrupt("return",null);case 4:return l=this.defaultView.viewport2Client({x:i,y:o}),u=l.x,f=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:u,clientY:f},picked:[]});case 7:return h=t.sent,d=h.picked,t.abrupt("return",d&&d[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return[];var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f[f.length-1]!==this.documentElement&&f.push(this.documentElement),f}},{key:"elementsFromPoint",value:(n=(0,lr.Z)((0,cr.Z)().mark((function t(e,n){var r,i,o,a,s,c,l,u,f,h,d;return(0,cr.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,c=a.height,!(i<0||o<0||i>s||o>c)){t.next=4;break}return t.abrupt("return",[]);case 4:return l=this.defaultView.viewport2Client({x:i,y:o}),u=l.x,f=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:u,clientY:f},picked:[]});case 7:return h=t.sent,(d=h.picked)[d.length-1]!==this.documentElement&&d.push(this.documentElement),t.abrupt("return",d);case 11:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw new Error(Tr)}},{key:"insertBefore",value:function(t,e){throw new Error(Tr)}},{key:"removeChild",value:function(t,e){throw new Error(Tr)}},{key:"replaceChild",value:function(t,e,n){throw new Error(Tr)}},{key:"append",value:function(){throw new Error(Tr)}},{key:"prepend",value:function(){throw new Error(Tr)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,r}(ic),_l=function(){function t(e){(0,z.Z)(this,t),this.strategies=e}return(0,Z.Z)(t,[{key:"apply",value:function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,o=this.strategies;r.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return 0===o.length?e.visible=i.unculledEntities.indexOf(t.entity)>-1:e.visible=o.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new ec(fc.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))}}])}();_l.tag="Culling";var Ml=function(){function t(){var e=this;(0,z.Z)(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new Js(null),this.rootWheelEvent=new tc(null),this.onPointerMove=function(t){var n,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i,o=e.normalizeToPointerEvent(t,r),a=(0,ur.Z)(o);try{for(a.s();!(i=a.n()).done;){var s=i.value,c=e.bootstrapEvent(e.rootPointerEvent,s,r,t);e.context.eventService.mapEvent(c)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,o=e.normalizeToPointerEvent(t,i),a=(0,ur.Z)(o);try{for(a.s();!(r=a.n()).done;){var s=r.value,c=e.bootstrapEvent(e.rootPointerEvent,s,i,t);e.context.eventService.mapEvent(c)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}return(0,Z.Z)(t,[{key:"apply",value:function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var r,o=(0,ur.Z)(e);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=n.bootstrapEvent(n.rootPointerEvent,a,i,t);n.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e,r=n.context.contextService.getDomElement(),o=n.context.eventService.isNativeEventFromCanvas(r,t)?"":"outside",a=n.normalizeToPointerEvent(t,i),s=(0,ur.Z)(a);try{for(s.s();!(e=s.n()).done;){var c=e.value,l=n.bootstrapEvent(n.rootPointerEvent,c,i,t);l.type+=o,n.context.eventService.mapEvent(l)}}catch(t){s.e(t)}finally{s.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r=n.normalizeToPointerEvent(t,i),o=(0,ur.Z)(r);try{for(o.s();!(e=o.n()).done;){var a=e.value,s=n.bootstrapEvent(n.rootPointerEvent,a,i,t);n.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}))}},{key:"bootstrapEvent",value:function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),o=i.x,a=i.y;t.viewport.x=o,t.viewport.y=a;var s=this.context.eventService.viewport2Canvas(t.viewport),c=s.x,l=s.y;return t.canvas.x=c,t.canvas.y=l,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=us[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.x,i=n.y;e.viewport.x=r,e.viewport.y=i;var o=this.context.eventService.viewport2Canvas(e.viewport),a=o.x,s=o.y;return e.canvas.x=a,e.canvas.y=s,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=fs.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r-1,a=0,s=r.length;a1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var r=t.getRenderBounds();if(r){var i=t.renderable;e&&(i.dirtyRenderBounds||(i.dirtyRenderBounds=new _r),i.dirtyRenderBounds.update(r.center,r.halfExtents));var o=r.getMin(),a=(0,H.Z)(o,2),s=a[0],c=a[1],l=r.getMax(),u=(0,H.Z)(l,2),f=u[0],h=u[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=s,n.aabb.minY=c,n.aabb.maxX=f,n.aabb.maxY=h}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}}},{key:"syncRTree",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],r=new Set,i=function(i){if(!r.has(i)&&i.renderable){var o=t.syncNode(i,e);o&&(n.push(o),r.add(i))}};this.syncTasks.forEach((function(t,e){t&&e.forEach(i);for(var n=e;n;)i(n),n=n.parentElement})),this.rBush.load(n),n.length=0,this.syncing=!1}}}])}();Al.tag="Prepare";var jl=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),Pl=new ec(fc.MOUNTED),Tl=new ec(fc.UNMOUNTED),Cl=new ec(jl.BEFORE_RENDER),Rl=new ec(jl.RERENDER),Ll=new ec(jl.AFTER_RENDER),Nl=function(t){function e(t){var n;(0,z.Z)(this,e),(n=(0,$.Z)(this,e)).Element=el,n.inited=!1,n.context={};var r=t.container,i=t.canvas,o=t.renderer,a=t.width,s=t.height,c=t.background,l=t.cursor,u=t.supportsMutipleCanvasesInOneContainer,f=t.cleanUpOnDestroy,h=void 0===f||f,d=t.offscreenCanvas,p=t.devicePixelRatio,y=t.requestAnimationFrame,g=t.cancelAnimationFrame,v=t.createImage,m=t.supportsTouchEvents,b=t.supportsPointerEvents,x=t.isTouchEvent,w=t.isMouseEvent,O=t.dblClickSpeed,k=a,_=s,M=p||os&&window.devicePixelRatio||1;return M=M>=1?Math.ceil(M):1,i&&(k=a||function(t){var e=ls(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/M,_=s||function(t){var e=ls(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/M),n.customElements=new wl,n.devicePixelRatio=M,n.requestAnimationFrame=null!=y?y:ks.bind(Wc.globalThis),n.cancelAnimationFrame=null!=g?g:_s.bind(Wc.globalThis),n.supportsTouchEvents=null!=m?m:"ontouchstart"in Wc.globalThis,n.supportsPointerEvents=null!=b?b:!!Wc.globalThis.PointerEvent,n.isTouchEvent=null!=x?x:function(t){return n.supportsTouchEvents&&t instanceof Wc.globalThis.TouchEvent},n.isMouseEvent=null!=w?w:function(t){return!Wc.globalThis.MouseEvent||t instanceof Wc.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof Wc.globalThis.PointerEvent))},d&&(Wc.offscreenCanvas=d),n.document=new kl,n.document.defaultView=n,u||function(t,e,n){if(t){var r="string"==typeof t?document.getElementById(t):t;is.has(r)&&is.get(r).destroy(n),is.set(r,e)}}(r,n,h),n.initRenderingContext((0,F.Z)((0,F.Z)({},t),{},{width:k,height:_,background:null!=c?c:"transparent",cursor:null!=l?l:"default",cleanUpOnDestroy:h,devicePixelRatio:M,requestAnimationFrame:n.requestAnimationFrame,cancelAnimationFrame:n.cancelAnimationFrame,supportsTouchEvents:n.supportsTouchEvents,supportsPointerEvents:n.supportsPointerEvents,isTouchEvent:n.isTouchEvent,isMouseEvent:n.isMouseEvent,dblClickSpeed:null!=O?O:200,createImage:null!=v?v:function(){return new window.Image}})),n.initDefaultCamera(k,_,o.clipSpaceNearZ),n.initRenderer(o,!0),n}return(0,G.Z)(e,t),(0,Z.Z)(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var r=this,i=new Wc.CameraContribution;i.clipSpaceNearZ=n,i.setType(Ur.EXPLORING,Xr.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(Qr,(function(){r.context.renderingContext.renderReasons.add(sc.CAMERA_CHANGED),Wc.enableSizeAttenuation&&r.getConfig().renderer.getConfig().enableSizeAttenuation&&r.updateSizeAttenuation()})),this.context.camera=i}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){Wc.styleValueRegistry.updateSizeAttenuation(e,t)}))}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;Fi.clearCache(),e||this.dispatchEvent(new ec(jl.BEFORE_DESTROY)),this.frameId&&this.cancelAnimationFrame(this.frameId);var n=this.getRoot();t&&(this.unmountChildren(n),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),this.context.rBushRoot&&this.context.rBushRoot.clear(),e||this.dispatchEvent(new ec(jl.AFTER_DESTROY));var r=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};r(Pl),r(Tl),r(Cl),r(Rl),r(Ll),r(Qc),r(qc),r(Yc),r(Vc)}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===Kr.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new ec(jl.RESIZE,{width:t,height:e}))}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e=this;t&&(Cl.detail=t,Ll.detail=t),this.dispatchEvent(Cl),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(Rl)})),this.dispatchEvent(Ll)}},{key:"run",value:function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new dr,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Ml,new Al,new _l([new Sl])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService((0,F.Z)((0,F.Z)({},Wc),this.context)),this.context.renderingService=new cc(Wc,this.context),this.context.eventService=new oc(Wc,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,n,!0)):this.context.contextService.initAsync().then((function(){e.initRenderingService(t,n)})).catch((function(t){console.error(t)}))}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init((function(){e.inited=!0,n?r?e.requestAnimationFrame((function(){e.dispatchEvent(new ec(jl.READY))})):e.dispatchEvent(new ec(jl.READY)):e.dispatchEvent(new ec(jl.RENDERER_CHANGED)),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()}))}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(Wc)}))}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),(0,W.Z)((null==n?void 0:n.getPlugins())||[]).reverse().forEach((function(t){t.destroy(Wc)})),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(Tl):(Tl.target=t,this.dispatchEvent(Tl,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hs(t);this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,n||(t.isMutationObserved?t.dispatchEvent(Pl):(Pl.target=t,this.dispatchEvent(Pl,!0)))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t,n)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}(rc),Il=function(t){function e(){var t;(0,z.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i90)return this;this.computeMatrix()}return this._getAxes(),this.type===Ur.ORBITING||this.type===Ur.EXPLORING?this._getPosition():this.type===Ur.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=Lr(t,e,0),r=X(this.position);return et(r,r,it(U(),this.right,n[0])),et(r,r,it(U(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this}},{key:"dolly",value:function(t){var e=this.forward,n=X(this.position),r=this.dollyingStep,i=this.distance+t*this.dollyingStep;return r=Math.max(Math.min(i,this.maxDistance),this.minDistance)-this.distance,n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===Ur.ORBITING||this.type===Ur.EXPLORING?this._getDistance():this.type===Ur.TRACKING&&et(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(t){var e,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=o.position,s=void 0===a?this.position:a,c=o.focalPoint,l=void 0===c?this.focalPoint:c,u=o.roll,f=o.zoom,h=new Wc.CameraContribution;h.setType(this.type,void 0),h.setPosition(s[0],null!==(e=s[1])&&void 0!==e?e:this.position[1],null!==(n=s[2])&&void 0!==n?n:this.position[2]),h.setFocalPoint(l[0],null!==(r=l[1])&&void 0!==r?r:this.focalPoint[1],null!==(i=l[2])&&void 0!==i?i:this.focalPoint[2]),h.setRoll(null!=u?u:this.roll),h.setZoom(null!=f?f:this.zoom);var d={name:t,matrix:xt(h.getWorldTransform()),right:X(h.right),up:X(h.up),forward:X(h.forward),position:X(h.getPosition()),focalPoint:X(h.getFocalPoint()),distanceVector:X(h.getDistanceVector()),distance:h.getDistance(),dollyingStep:h.getDollyingStep(),azimuth:h.getAzimuth(),elevation:h.getElevation(),roll:h.getRoll(),relAzimuth:h.relAzimuth,relElevation:h.relElevation,relRoll:h.relRoll,zoom:h.getZoom()};return this.landmarks.push(d),d}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=ze(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=De(n)?{duration:n}:n,o=i.easing,a=void 0===o?"linear":o,s=i.duration,c=void 0===s?100:s,l=i.easingFunction,u=void 0===l?void 0:l,f=i.onfinish,h=void 0===f?void 0:f,d=i.onframe,p=void 0===d?void 0:d,y=.01;this.cancelLandmarkAnimation();var g,v=r.position,m=r.focalPoint,b=r.zoom,x=r.roll,w=u||Wc.EasingFunction(a),O=function(){e.setFocalPoint(m),e.setPosition(v),e.setRoll(x),e.setZoom(b),e.computeMatrix(),e.triggerUpdate(),null==h||h()};if(0===c)return O();var k=function(t){void 0===g&&(g=t);var n=t-g;if(n>=c)O();else{var r,i,o=w(n/c),a=U(),s=U();if(ct(a,e.focalPoint,m,o),ct(s,e.position,v,o),i=e.roll*(1-o)+x*o,r=e.zoom*(1-o)+b*o,e.setFocalPoint(a),e.setPosition(s),e.setRoll(i),e.setZoom(r),pt(a,m)+pt(s,v)<=y&&void 0===b&&void 0===x)return O();e.computeMatrix(),e.triggerUpdate(),n0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}},{key:"updatePromises",value:function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new Dl(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}},{key:"tick",value:function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))}},{key:"rewind",value:function(){if(this.playbackRate>=0)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}}},{key:"persist",value:function(){throw new Error(Pr)}},{key:"addEventListener",value:function(t,e,n){throw new Error(Pr)}},{key:"removeEventListener",value:function(t,e,n){throw new Error(Pr)}},{key:"dispatchEvent",value:function(t){throw new Error(Pr)}},{key:"commitStyles",value:function(){throw new Error(Pr)}},{key:"ensureAlive",value:function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(-1)):this._inEffect=!(null===(e=this.effect)||void 0===e||!e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new Dl(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new Dl(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}}}])}(),zl=.1,Zl="function"==typeof Float32Array,Wl=function(t,e){return 1-3*e+3*t},$l=function(t,e){return 3*e-6*t},Gl=function(t){return 3*t},Hl=function(t,e,n){return((Wl(e,n)*t+$l(e,n))*t+Gl(e))*t},ql=function(t,e,n){return 3*Wl(e,n)*t*t+2*$l(e,n)*t+Gl(e)},Yl=function(t,e,n,r){if(!(t>=0&&t<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=Zl?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=Hl(o*zl,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=zl;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*zl,s=ql(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=ql(e,n,r);if(0===o)return e;e-=(Hl(e,n,r)-t)/o}return e}(e,a,t,n):0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=Hl(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&++s<10);return a}(e,r,r+zl,t,n)};return function(t){return 0===t||1===t?t:Hl(a(t),e,r)}},Vl=function(t){return Math.pow(t,2)},Ul=function(t){return Math.pow(t,3)},Xl=function(t){return Math.pow(t,4)},Kl=function(t){return Math.pow(t,5)},Ql=function(t){return Math.pow(t,6)},Jl=function(t){return 1-Math.cos(t*Math.PI/2)},tu=function(t){return 1-Math.sqrt(1-t*t)},eu=function(t){return t*t*(3*t-2)},nu=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},ru=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,H.Z)(e,2),r=n[0],i=void 0===r?1:r,o=n[1],a=void 0===o?.5:o,s=Ze(Number(i),1,10),c=Ze(Number(a),.1,2);return 0===t||1===t?t:-s*Math.pow(2,10*(t-1))*Math.sin((t-1-c/(2*Math.PI)*Math.asin(1/s))*(2*Math.PI)/c)},iu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=(0,H.Z)(e,4),i=r[0],o=void 0===i?1:i,a=r[1],s=void 0===a?100:a,c=r[2],l=void 0===c?10:c,u=r[3],f=void 0===u?0:u;o=Ze(o,.1,1e3),s=Ze(s,.1,1e3),l=Ze(l,.1,1e3),f=Ze(f,.1,1e3);var h=Math.sqrt(s/o),d=l/(2*Math.sqrt(s*o)),p=d<1?h*Math.sqrt(1-d*d):0,y=1,g=d<1?(d*h-f)/p:-f+h,v=n?n*t/1e3:t;return v=d<1?Math.exp(-v*d*h)*(y*Math.cos(p*v)+g*Math.sin(p*v)):(y+g*v)*Math.exp(-v*h),0===t||1===t?t:1-v},ou=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e,r=(0,H.Z)(n,2),i=r[0],o=void 0===i?10:i,a=r[1],s="start"===a?Math.ceil:Math.floor;return s(Ze(t,0,1)*o)/o},au=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,H.Z)(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return Yl(r,i,o,a)(t)},su=Yl(.42,0,1,1),cu=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return 1-t(1-e,n,r)}},lu=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},uu=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},fu={steps:ou,"step-start":function(t){return ou(t,[1,"start"])},"step-end":function(t){return ou(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":au,ease:function(t){return au(t,[.25,.1,.25,1])},in:su,out:cu(su),"in-out":lu(su),"out-in":uu(su),"in-quad":Vl,"out-quad":cu(Vl),"in-out-quad":lu(Vl),"out-in-quad":uu(Vl),"in-cubic":Ul,"out-cubic":cu(Ul),"in-out-cubic":lu(Ul),"out-in-cubic":uu(Ul),"in-quart":Xl,"out-quart":cu(Xl),"in-out-quart":lu(Xl),"out-in-quart":uu(Xl),"in-quint":Kl,"out-quint":cu(Kl),"in-out-quint":lu(Kl),"out-in-quint":uu(Kl),"in-expo":Ql,"out-expo":cu(Ql),"in-out-expo":lu(Ql),"out-in-expo":uu(Ql),"in-sine":Jl,"out-sine":cu(Jl),"in-out-sine":lu(Jl),"out-in-sine":uu(Jl),"in-circ":tu,"out-circ":cu(tu),"in-out-circ":lu(tu),"out-in-circ":uu(tu),"in-back":eu,"out-back":cu(eu),"in-out-back":lu(eu),"out-in-back":uu(eu),"in-bounce":nu,"out-bounce":cu(nu),"in-out-bounce":lu(nu),"out-in-bounce":uu(nu),"in-elastic":ru,"out-elastic":cu(ru),"in-out-elastic":lu(ru),"out-in-elastic":uu(ru),spring:iu,"spring-in":iu,"spring-out":cu(iu),"spring-in-out":lu(iu),"spring-out-in":uu(iu)},hu=function(t){return t};function du(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var pu="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",yu=new RegExp("cubic-bezier\\(".concat(pu,",").concat(pu,",").concat(pu,",").concat(pu,"\\)")),gu=/steps\(\s*(\d+)\s*\)/,vu=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function mu(t){var e=yu.exec(t);if(e)return Yl.apply(void 0,(0,W.Z)(e.slice(1).map(Number)));var n=gu.exec(t);if(n)return du(Number(n[1]),0);var r=vu.exec(t);return r?du(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):fu[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||fu.linear}function bu(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function xu(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return e=Math.min(n.delay+t+n.endDelay,r)?2:3}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?1!==e&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||2!==n||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),c=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),l=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,c,s);return n.currentIteration=c,n.progress=l,n.easingFunction(l)}function wu(t,e,n){var r=function(t,e){for(var n={},r=0;r=t.applyFrom&&e1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;o=0&&Number(t.offset)<=1})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;a[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]];Nu.style=["fill"];const Iu=Nu.bind(void 0);Iu.style=["stroke","lineWidth"];const Du=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];Du.style=["fill"];const Bu=Du.bind(void 0);Bu.style=["fill"];const Fu=Du.bind(void 0);Fu.style=["stroke","lineWidth"];const zu=(t,e,n)=>{const r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]};zu.style=["fill"];const Zu=zu.bind(void 0);Zu.style=["stroke","lineWidth"];const Wu=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]};Wu.style=["fill"];const $u=Wu.bind(void 0);$u.style=["stroke","lineWidth"];const Gu=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]};Gu.style=["fill"];const Hu=Gu.bind(void 0);Hu.style=["stroke","lineWidth"];const qu=(t,e,n)=>{const r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]};qu.style=["fill"];const Yu=qu.bind(void 0);Yu.style=["stroke","lineWidth"];const Vu=(t,e,n)=>{const r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]};Vu.style=["fill"];const Uu=Vu.bind(void 0);Uu.style=["stroke","lineWidth"];const Xu=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];Xu.style=["stroke","lineWidth"];const Ku=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];Ku.style=["stroke","lineWidth"];const Qu=(t,e,n)=>[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]];Qu.style=["stroke","lineWidth"];const Ju=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];Ju.style=["stroke","lineWidth"];const tf=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];tf.style=["stroke","lineWidth"];const ef=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];ef.style=["stroke","lineWidth"];const nf=ef.bind(void 0);nf.style=["stroke","lineWidth"];const rf=(t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]];rf.style=["stroke","lineWidth"];const of=(t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]];of.style=["stroke","lineWidth"];const af=(t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]];af.style=["stroke","lineWidth"];const sf=(t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]];sf.style=["stroke","lineWidth"];const cf=(t,e,n)=>[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]];cf.style=["stroke","lineWidth"];const lf=new Map([["bowtie",Vu],["cross",Ku],["dash",nf],["diamond",zu],["dot",ef],["hexagon",qu],["hollowBowtie",Uu],["hollowDiamond",Zu],["hollowHexagon",Yu],["hollowPoint",Iu],["hollowSquare",Fu],["hollowTriangle",$u],["hollowTriangleDown",Hu],["hv",of],["hvh",sf],["hyphen",tf],["line",Xu],["plus",Ju],["point",Nu],["rect",Bu],["smooth",rf],["square",Du],["tick",Qu],["triangleDown",Gu],["triangle",Wu],["vh",af],["vhv",cf]]);const uf={};function ff(t,e){var n,r;t.startsWith("symbol.")?(n=t.split(".").pop(),r=e,lf.set(n,r)):Object.assign(uf,{[t]:e})}function hf(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.r;t.arc(r,o,a,0,2*Math.PI,!1)}function df(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.rx,s=e.ry;if(t.ellipse)t.ellipse(r,o,a,s,0,0,2*Math.PI,!1);else{var c=a>s?a:s,l=a>s?1:a/s,u=a>s?s/a:1;t.save(),t.scale(l,u),t.arc(r,o,c,0,2*Math.PI)}}function pf(t,e){var n,r,i=e.x1,o=e.y1,a=e.x2,s=e.y2,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,h=0,d=0,p=0,y=0,g=0;c&&Xc(c)&&u&&(n=a-i,r=s-o,g=Math.atan2(r,n),h=Math.cos(g)*(u||0),d=Math.sin(g)*(u||0)),l&&Xc(l)&&f&&(n=i-a,r=o-s,g=Math.atan2(r,n),p=Math.cos(g)*(f||0),y=Math.sin(g)*(f||0)),t.moveTo(i+h,o+d),t.lineTo(a+p,s+y)}function yf(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,c=e.d,l=c.absolutePath,u=c.segments,f=0,h=0,d=0,p=0,y=0;if(i&&Xc(i)&&a){var g=i.parentNode.getStartTangent(),v=(0,H.Z)(g,2),m=v[0],b=v[1];n=m[0]-b[0],r=m[1]-b[1],y=Math.atan2(r,n),f=Math.cos(y)*(a||0),h=Math.sin(y)*(a||0)}if(o&&Xc(o)&&s){var x=o.parentNode.getEndTangent(),w=(0,H.Z)(x,2),O=w[0],k=w[1];n=O[0]-k[0],r=O[1]-k[1],y=Math.atan2(r,n),d=Math.cos(y)*(s||0),p=Math.sin(y)*(s||0)}for(var _=0;_W?Z:W,U=Z>W?1:Z/W,X=Z>W?W/Z:1;t.translate(F,z),t.rotate(q),t.scale(U,X),t.arc(0,0,V,$,G,!!(1-Y)),t.scale(1/U,1/X),t.rotate(-q),t.translate(-F,-z)}j&&t.lineTo(M[6]+d,M[7]+p);break;case"Z":t.closePath()}}}function gf(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,c=e.points.points,l=c.length,u=c[0][0],f=c[0][1],h=c[l-1][0],d=c[l-1][1],p=0,y=0,g=0,v=0,m=0;i&&Xc(i)&&a&&(n=c[1][0]-c[0][0],r=c[1][1]-c[0][1],m=Math.atan2(r,n),p=Math.cos(m)*(a||0),y=Math.sin(m)*(a||0)),o&&Xc(o)&&s&&(n=c[l-1][0]-c[0][0],r=c[l-1][1]-c[0][1],m=Math.atan2(r,n),g=Math.cos(m)*(s||0),v=Math.sin(m)*(s||0)),t.moveTo(u+(p||g),f+(y||v));for(var b=1;b0?1:-1,h=c>0?1:-1,d=f+h===0,p=a.map((function(t){return Ze(t,0,Math.min(Math.abs(l)/2,Math.abs(u)/2))})),y=(0,H.Z)(p,4),g=y[0],v=y[1],m=y[2],b=y[3];t.moveTo(f*g+r,o),t.lineTo(l-f*v+r,o),0!==v&&t.arc(l-f*v+r,h*v+o,v,-h*Math.PI/2,f>0?0:Math.PI,d),t.lineTo(l+r,u-h*m+o),0!==m&&t.arc(l-f*m+r,u-h*m+o,m,f>0?0:Math.PI,h>0?Math.PI/2:1.5*Math.PI,d),t.lineTo(f*b+r,u+o),0!==b&&t.arc(f*b+r,u-h*b+o,b,h>0?Math.PI/2:-Math.PI/2,f>0?Math.PI:0,d),t.lineTo(r,h*g+o),0!==g&&t.arc(f*g+r,h*g+o,g,f>0?Math.PI:0,h>0?1.5*Math.PI:Math.PI/2,d)}else t.rect(r,o,l,u)}var bf=function(t){function e(){var t;(0,z.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i=c-v&&m<=c+v)}function Ef(t,e,n,r){return t/(n*n)+e/(r*r)}function Sf(t,e,n){var r=t.parsedStyle,i=r.cx,o=void 0===i?0:i,a=r.cy,s=void 0===a?0:a,c=r.rx,l=r.ry,u=r.fill,f=r.stroke,h=r.lineWidth,d=void 0===h?1:h,p=r.increasedLineWidthForHitTesting,y=void 0===p?0:p,g=r.pointerEvents,v=void 0===g?"auto":g,m=e.x,b=e.y,x=ds(v,u,f),w=(0,H.Z)(x,2),O=w[0],k=w[1],_=(d+y)/2,M=(m-o)*(m-o),E=(b-s)*(b-s);return O&&k||n?Ef(M,E,c+_,l+_)<=1:O?Ef(M,E,c,l)<=1:!!k&&(Ef(M,E,c-_,l-_)>=1&&Ef(M,E,c+_,l+_)<=1)}function Af(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function jf(t,e,n,r,i,o,a,s){var c=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI),l={x:t+n*Math.cos(c),y:e+n*Math.sin(c)};return Gn(l.x,l.y,a,s)<=o/2}function Pf(t,e,n,r,i,o,a){var s=Math.min(t,n),c=Math.max(t,n),l=Math.min(e,r),u=Math.max(e,r),f=i/2;return o>=s-f&&o<=c+f&&a>=l-f&&a<=u+f&&Qn(t,e,n,r,o,a)<=i/2}function Tf(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a0!=Cf(s[1]-n)>0&&Cf(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function Nf(t,e,n){for(var r=!1,i=0;i=i.min[0]&&e.y>=i.min[1]&&e.x<=i.max[0]&&e.y<=i.max[1]}var $f=function(t){function e(){var t;(0,z.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i0&&void 0!==arguments[0]?arguments[0]:t.api;t.rafId&&(e.cancelAnimationFrame(t.rafId),t.rafId=null)}},{key:"executeTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;Vf.length<=0&&Uf.length<=0||(Uf.forEach((function(t){return t()})),Uf=Vf.splice(0,t.TASK_NUM_PER_FRAME),t.rafId=e.requestAnimationFrame((function(){t.executeTask(e)})))}},{key:"sliceImage",value:function(e,n,r,i){for(var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t.api,s=e.naturalWidth||e.width,c=e.naturalHeight||e.height,l=n-o,u=r-o,f=Math.ceil(s/l),h=Math.ceil(c/u),d={tileSize:[n,r],gridSize:[h,f],tiles:Array(h).fill(null).map((function(){return Array(f).fill(null)}))},p=function(t){for(var o=function(o){Vf.push((function(){var f=o*l,h=t*u,p=[Math.min(n,s-f),Math.min(r,c-h)],y=p[0],g=p[1],v=a.createCanvas();v.width=n,v.height=r,v.getContext("2d").drawImage(e,f,h,y,g,0,0,y,g),d.tiles[t][o]={x:f,y:h,tileX:o,tileY:t,data:v},i()}))},h=0;hl&&g>u,e&&("function"==typeof e.resetTransform?e.resetTransform():e.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(e,0,0,i*n,a*n,o.background))}));var g=function(t,e){for(var i=[t];i.length>0;){var o=i.pop();o.isVisible()&&!o.isCulled()&&(f?r.renderDisplayObjectOptimized(o,e,r.context,Gf(r,nh)[nh],n):r.renderDisplayObject(o,e,r.context,Gf(r,nh)[nh],n));for(var a=o.sortable.sorted||o.childNodes,s=a.length-1;s>=0;s--)i.push(a[s])}};s.hooks.endFrame.tap(t.tag,(function(){if(0!==c.root.childNodes.length){f=o.renderer.getConfig().enableRenderingOptimization,Gf(r,nh)[nh]={restoreStack:[],prevObject:null,currentContext:Gf(r,nh)[nh].currentContext},Gf(r,nh)[nh].currentContext.clear(),r.clearFullScreenLastFrame=!1;var t=h.getContext(),e=h.getDPR();if(Dt(r.dprMatrix,[e,e,1]),jt(r.vpMatrix,r.dprMatrix,a.getOrthoMatrix()),r.clearFullScreen)f?(t.save(),g(c.root,t),t.restore()):g(c.root,t),r.removedRBushNodeAABBs=[];else{var i=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat((0,W.Z)(r.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,o=new _r;return o.setMinMax([e,n,0],[r,i,0]),o})))));if(r.removedRBushNodeAABBs=[],_r.isEmpty(i))return void(r.renderQueue=[]);var s=r.convertAABB2Rect(i),l=s.x,u=s.y,p=s.width,y=s.height,v=lt(r.vec3a,[l,u,0],r.vpMatrix),m=lt(r.vec3b,[l+p,u,0],r.vpMatrix),b=lt(r.vec3c,[l,u+y,0],r.vpMatrix),x=lt(r.vec3d,[l+p,u+y,0],r.vpMatrix),w=Math.min(v[0],m[0],x[0],b[0]),O=Math.min(v[1],m[1],x[1],b[1]),k=Math.max(v[0],m[0],x[0],b[0]),_=Math.max(v[1],m[1],x[1],b[1]),M=Math.floor(w),E=Math.floor(O),S=Math.ceil(k-w),A=Math.ceil(_-O);t.save(),r.clearRect(t,M,E,S,A,o.background),t.beginPath(),t.rect(M,E,S,A),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),o.renderer.getConfig().enableDirtyRectangleRenderingDebug&&d.dispatchEvent(new ec(jl.DIRTY_RECTANGLE,{dirtyRect:{x:M,y:E,width:S,height:A}})),r.searchDirtyObjects(i).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,Gf(r,nh)[nh],n)})),t.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}Gf(r,nh)[nh].restoreStack.forEach((function(){t.restore()})),Gf(r,nh)[nh].restoreStack=[]}else r.clearFullScreenLastFrame=!0})),s.hooks.render.tap(t.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))}},{key:"clearRect",value:function(t,e,n,r,i,o){t.clearRect(e,n,r,i),o&&(t.fillStyle=o,t.fillRect(e,n,r,i))}},{key:"renderDisplayObjectOptimized",value:function(t,e,n,r,i){var o=t.nodeName,a=!1,s=this.context.styleRendererFactory[o],c=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;if(l){(!r.prevObject||!he(l.getWorldTransform(),r.prevObject.getWorldTransform()))&&(this.applyWorldTransform(e,l),r.prevObject=null);var u=this.pathGeneratorFactory[l.nodeName];u&&(e.save(),a=!0,e.beginPath(),u(e,l.parsedStyle),e.closePath(),e.clip())}if(s){(!r.prevObject||!he(t.getWorldTransform(),r.prevObject.getWorldTransform()))&&this.applyWorldTransform(e,t);var f=!r.prevObject;if(!f){var h=r.prevObject.nodeName;f=o===pr.TEXT?h!==pr.TEXT:o===pr.IMAGE?h!==pr.IMAGE:h===pr.TEXT||h===pr.IMAGE}s.applyStyleToContext(e,t,f,r),r.prevObject=t}c&&(e.beginPath(),c(e,t.parsedStyle),o!==pr.LINE&&o!==pr.PATH&&o!==pr.POLYLINE&&e.closePath()),s&&s.drawToContext(e,t,Gf(this,nh)[nh],this,i),a&&e.restore(),t.renderable.dirty=!1}},{key:"renderDisplayObject",value:function(t,e,n,r,i){var o=t.nodeName,a=r.restoreStack[r.restoreStack.length-1];!a||t.compareDocumentPosition(a)&ic.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.restoreStack.pop());var s=this.context.styleRendererFactory[o],c=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;if(l){this.applyWorldTransform(e,l);var u=this.pathGeneratorFactory[l.nodeName];u&&(e.save(),r.restoreStack.push(t),e.beginPath(),u(e,l.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),c&&(e.beginPath(),c(e,t.parsedStyle),o!==pr.LINE&&o!==pr.PATH&&o!==pr.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1}},{key:"applyAttributesToContext",value:function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,o=n.opacity,a=n.lineDash,s=n.lineDashOffset;a&&t.setLineDash(a),Fe(s)||(t.lineDashOffset=s),Fe(o)||(t.globalAlpha*=o),Fe(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),Fe(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)}},{key:"convertAABB2Rect",value:function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}}},{key:"mergeDirtyAABBs",value:function(t){var e=new _r;return t.forEach((function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)})),e}},{key:"searchDirtyObjects",value:function(t){var e=t.getMin(),n=(0,H.Z)(e,2),r=n[0],i=n[1],o=t.getMax(),a=(0,H.Z)(o,2),s=a[0],c=a[1];return this.rBush.search({minX:r,minY:i,maxX:s,maxY:c}).map((function(t){return t.displayObject}))}},{key:"saveDirtyAABB",value:function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new _r);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)}},{key:"applyWorldTransform",value:function(t,e,n){n?(wt(this.tmpMat4,e.getLocalTransform()),jt(this.tmpMat4,n,this.tmpMat4),jt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(wt(this.tmpMat4,e.getWorldTransform()),jt(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])}},{key:"safeMergeAABB",value:function(){for(var t=new _r,e=arguments.length,n=new Array(e),r=0;r0){if(n||e.attributes.stroke!==r.prevObject.attributes.stroke)uh(t,"strokeStyle",Fe(o.stroke)||Array.isArray(o.stroke)||o.stroke.isNone?ch.strokeStyle:e.attributes.stroke,r.currentContext);(n||o.lineWidth!==i.lineWidth)&&uh(t,"lineWidth",Fe(o.lineWidth)?ch.lineWidth:o.lineWidth,r.currentContext),(n||o.lineDash!==i.lineDash)&&uh(t,"lineDash",o.lineDash||ch.lineDash,r.currentContext),(n||o.lineDashOffset!==i.lineDashOffset)&&uh(t,"lineDashOffset",Fe(o.lineDashOffset)?ch.lineDashOffset:o.lineDashOffset,r.currentContext);for(var l=0;l4&&void 0!==arguments[4]&&arguments[4];if(e){uh(t,"shadowColor",ch.shadowColor,r.currentContext);for(var o=0;o-1&&uh(t,"filter",s.replace(/drop-shadow\([^)]*\)/,"").trim()||ch.filter,r.currentContext)}else uh(t,"filter",ch.filter,r.currentContext)}},{key:"fillToContext",value:function(t,e,n,r,i){var o=this,a=e.parsedStyle,s=a.fill,c=a.fillRule,l=null;if(Array.isArray(s)&&s.length>0)s.forEach((function(r){var i=uh(t,"fillStyle",oh(r,e,t,o.imagePool),n.currentContext);l=null!=l?l:i,c?t.fill(c):t.fill()}));else{if(Oo(s)){var u=ih(s,e,t,e.ownerDocument.defaultView.context,r,i,this.imagePool);u&&(t.fillStyle=u,l=!0)}c?t.fill(c):t.fill()}null!==l&&uh(t,"fillStyle",l,n.currentContext)}},{key:"strokeToContext",value:function(t,e,n,r,i){var o=this,a=e.parsedStyle.stroke,s=null;if(Array.isArray(a)&&a.length>0)a.forEach((function(r){var i=uh(t,"strokeStyle",oh(r,e,t,o.imagePool),n.currentContext);s=null!=s?s:i,t.stroke()}));else{if(Oo(a)){var c=ih(a,e,t,e.ownerDocument.defaultView.context,r,i,this.imagePool);if(c){var l=uh(t,"strokeStyle",c,n.currentContext);s=null!=s?s:l}}t.stroke()}null!==s&&uh(t,"strokeStyle",s,n.currentContext)}},{key:"drawToContext",value:function(t,e,n,r,i){var o,a=e.nodeName,s=e.parsedStyle,c=s.opacity,l=void 0===c?ch.globalAlpha:c,u=s.fillOpacity,f=void 0===u?ch.fillOpacity:u,h=s.strokeOpacity,d=void 0===h?ch.strokeOpacity:h,p=s.lineWidth,y=void 0===p?ch.lineWidth:p,g=s.fill&&!s.fill.isNone,v=s.stroke&&!s.stroke.isNone&&y>0;if(g||v){var m=!Fe(s.shadowColor)&&s.shadowBlur>0,b="inner"===s.shadowType,x=0===(null===(o=s.fill)||void 0===o?void 0:o.alpha),w=!(!s.filter||!s.filter.length),O=m&&v&&(a===pr.PATH||a===pr.LINE||a===pr.POLYLINE||x||b),k=null;if(g)O||this.applyShadowAndFilterStyleToContext(t,e,m,n),k=uh(t,"globalAlpha",l*f,n.currentContext),this.fillToContext(t,e,n,r,i),O||this.clearShadowAndFilterStyleForContext(t,m,w,n);if(v){var _=!1,M=uh(t,"globalAlpha",l*d,n.currentContext);if(k=g?k:M,O&&(this.applyShadowAndFilterStyleToContext(t,e,m,n),_=!0,b)){var E=t.globalCompositeOperation;t.globalCompositeOperation="source-atop",this.strokeToContext(t,e,n,r,i),t.globalCompositeOperation=E,this.clearShadowAndFilterStyleForContext(t,m,w,n,!0)}this.strokeToContext(t,e,n,r,i),_&&this.clearShadowAndFilterStyleForContext(t,m,w,n)}null!==k&&uh(t,"globalAlpha",k,n.currentContext)}}}])}(),hh=function(t){function e(){return(0,z.Z)(this,e),(0,$.Z)(this,e,arguments)}return(0,G.Z)(e,t),(0,Z.Z)(e,[{key:"render",value:function(t,e,n,r,i,o){var a=e.fill,s=e.fillRule,c=e.opacity,l=void 0===c?1:c,u=e.fillOpacity,f=void 0===u?1:u,h=e.stroke,d=e.strokeOpacity,p=void 0===d?1:d,y=e.lineWidth,g=void 0===y?1:y,v=e.lineCap,m=e.lineJoin,b=e.shadowType,x=e.shadowColor,w=e.shadowBlur,O=e.filter,k=e.miterLimit,_=a&&!a.isNone,M=h&&!h.isNone&&g>0,E=0===(null==a?void 0:a.alpha),S=!(!O||!O.length),A=!Fe(x)&&w>0,j=n.nodeName,P="inner"===b,T=M&&A&&(j===pr.PATH||j===pr.LINE||j===pr.POLYLINE||E||P);_&&(t.globalAlpha=l*f,T||dh(n,t,A),ph(t,n,a,s,r,i,o,this.imagePool),T||this.clearShadowAndFilter(t,S,A)),M&&(t.globalAlpha=l*p,t.lineWidth=g,Fe(k)||(t.miterLimit=k),Fe(v)||(t.lineCap=v),Fe(m)||(t.lineJoin=m),T&&(P&&(t.globalCompositeOperation="source-atop"),dh(n,t,!0),P&&(yh(t,n,h,r,i,o,this.imagePool),t.globalCompositeOperation=ch.globalCompositeOperation,this.clearShadowAndFilter(t,S,!0))),yh(t,n,h,r,i,o,this.imagePool))}},{key:"clearShadowAndFilter",value:function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!Fe(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])}(fh);function dh(t,e,n){var r=t.parsedStyle,i=r.filter,o=r.shadowColor,a=r.shadowBlur,s=r.shadowOffsetX,c=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=o.toString(),e.shadowBlur=a||0,e.shadowOffsetX=s||0,e.shadowOffsetY=c||0)}function ph(t,e,n,r,i,o,a,s){var c=arguments.length>8&&void 0!==arguments[8]&&arguments[8];Array.isArray(n)?n.forEach((function(n){t.fillStyle=oh(n,e,t,s),c||(r?t.fill(r):t.fill())})):(Oo(n)&&(t.fillStyle=ih(n,e,t,i,o,a,s)),c||(r?t.fill(r):t.fill()))}function yh(t,e,n,r,i,o,a){var s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];Array.isArray(n)?n.forEach((function(n){t.strokeStyle=oh(n,e,t,a),s||t.stroke()})):(Oo(n)&&(t.strokeStyle=ih(n,e,t,r,i,o,a)),s||t.stroke())}var gh=function(t){function e(){return(0,z.Z)(this,e),(0,$.Z)(this,e,arguments)}return(0,G.Z)(e,t),(0,Z.Z)(e,[{key:"renderDownSampled",value:function(t,e,n,r){var i=r.src,o=r.imageCache;o.downSampled?t.drawImage(o.downSampled,Math.floor(r.drawRect[0]),Math.floor(r.drawRect[1]),Math.ceil(r.drawRect[2]),Math.ceil(r.drawRect[3])):this.imagePool.createDownSampledImage(i,n).then((function(t){n.renderable.dirty=!0,n.ownerDocument.defaultView.context.renderingService.dirtify()})).catch((function(){}))}},{key:"renderTile",value:function(t,e,n,r){var i=r.src,o=r.imageCache,a=r.imageRect,s=r.drawRect,c=o.size,l=t.getTransform(),u=l.a,f=l.b,h=l.c,d=l.d,p=l.e,y=l.f;if(t.resetTransform(),null!=o&&o.gridSize){for(var g=[c[0]/a[2],c[1]/a[3]],v=[o.tileSize[0]/g[0],o.tileSize[1]/g[1]],m=[Math.floor((s[0]-a[0])/v[0]),Math.ceil((s[0]+s[2]-a[0])/v[0])],b=m[0],x=m[1],w=[Math.floor((s[1]-a[1])/v[1]),Math.ceil((s[1]+s[3]-a[1])/v[1])],O=w[1],k=w[0];k<=O;k++)for(var _=b;_<=x;_++){var M=o.tiles[k][_];if(M){var E=[Math.floor(a[0]+M.tileX*v[0]),Math.floor(a[1]+M.tileY*v[1]),Math.ceil(v[0]),Math.ceil(v[1])];t.drawImage(M.data,E[0],E[1],E[2],E[3])}}t.setTransform(u,f,h,d,p,y)}else this.imagePool.createImageTiles(i,[],(function(){n.renderable.dirty=!0,n.ownerDocument.defaultView.context.renderingService.dirtify()}),n).catch((function(){}))}},{key:"render",value:function(t,n,r){var i=n.x,o=void 0===i?0:i,a=n.y,s=void 0===a?0:a,c=n.width,l=n.height,u=n.src,f=n.shadowColor,h=n.shadowBlur,d=this.imagePool.getImageSync(u,r),p=null==d?void 0:d.img,y=c,g=l;if(p){y||(y=p.width),g||(g=p.height),dh(r,t,!Fe(f)&&h>0);try{var v=r.ownerDocument.defaultView.getContextService().getDomElement(),m=v.width,b=v.height,x=t.getTransform(),w=x.a,O=x.b,k=function(t,e){var n=lt(U(),[t[0],t[1],0],e),r=lt(U(),[t[0]+t[2],t[1],0],e),i=lt(U(),[t[0],t[1]+t[3],0],e),o=lt(U(),[t[0]+t[2],t[1]+t[3],0],e);return[Math.min(n[0],r[0],i[0],o[0]),Math.min(n[1],r[1],i[1],o[1]),Math.max(n[0],r[0],i[0],o[0])-Math.min(n[0],r[0],i[0],o[0]),Math.max(n[1],r[1],i[1],o[1])-Math.min(n[1],r[1],i[1],o[1])]}([o,s,y,g],Ot(w,x.c,0,0,O,x.d,0,0,0,0,1,0,x.e,x.f,0,1)),_=function(t,e){var n=(0,H.Z)(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=(0,H.Z)(e,4),c=s[0],l=s[1],u=s[2],f=s[3],h=Math.max(r,c),d=Math.max(i,l),p=Math.min(r+o,c+u),y=Math.min(i+a,l+f);return p<=h||y<=d?null:[h,d,p-h,y-d]}([0,0,m,b],k);if(!_)return;if(!r.ownerDocument.defaultView.getConfig().enableLargeImageOptimization)return void e.renderFull(t,n,r,{image:p,drawRect:[o,s,y,g]});if(k[2]/d.size[0]<(d.downSamplingRate||.5))return void this.renderDownSampled(t,n,r,{src:u,imageCache:d,drawRect:[o,s,y,g]});if(!Qf.isSupportTile)return void e.renderFull(t,n,r,{image:p,drawRect:[o,s,y,g]});this.renderTile(t,n,r,{src:u,imageCache:d,imageRect:k,drawRect:_})}catch(t){}}}},{key:"drawToContext",value:function(t,e,n,r,i){this.render(t,e.parsedStyle,e)}}],[{key:"renderFull",value:function(t,e,n,r){t.drawImage(r.image,Math.floor(r.drawRect[0]),Math.floor(r.drawRect[1]),Math.ceil(r.drawRect[2]),Math.ceil(r.drawRect[3]))}}])}(hh),vh=function(t){function e(){return(0,z.Z)(this,e),(0,$.Z)(this,e,arguments)}return(0,G.Z)(e,t),(0,Z.Z)(e,[{key:"render",value:function(t,e,n,r,i,o){n.getBounds();var a=e.lineWidth,s=void 0===a?1:a,c=e.textAlign,l=void 0===c?"start":c,u=e.textBaseline,f=void 0===u?"alphabetic":u,h=e.lineJoin,d=void 0===h?"miter":h,p=e.miterLimit,y=void 0===p?10:p,g=e.letterSpacing,v=void 0===g?0:g,m=e.stroke,b=e.fill,x=e.fillRule,w=e.fillOpacity,O=void 0===w?1:w,k=e.strokeOpacity,_=void 0===k?1:k,M=e.opacity,E=void 0===M?1:M,S=e.metrics,A=e.x,j=void 0===A?0:A,P=e.y,T=void 0===P?0:P,C=e.dx,R=e.dy,L=e.shadowColor,N=e.shadowBlur,I=S.font,D=S.lines,B=S.height,F=S.lineHeight,z=S.lineMetrics;t.font=I,t.lineWidth=s,t.textAlign="middle"===l?"center":l;var Z=f;"alphabetic"===Z&&(Z="bottom"),t.lineJoin=d,Fe(y)||(t.miterLimit=y);var W=T;"middle"===f?W+=-B/2-F/2:"bottom"===f||"alphabetic"===f||"ideographic"===f?W+=-B:"top"!==f&&"hanging"!==f||(W+=-F);var $=j+(C||0);W+=R||0,1===D.length&&("bottom"===Z?(Z="middle",W-=.5*B):"top"===Z&&(Z="middle",W+=.5*B)),t.textBaseline=Z,dh(n,t,!Fe(L)&&N>0);for(var G=0;G0&&void 0!==arguments[0]?arguments[0]:{};return(0,z.Z)(this,e),(t=(0,$.Z)(this,e)).name="canvas-renderer",t.options=n,t}return(0,G.Z)(e,t),(0,Z.Z)(e,[{key:"init",value:function(){var t,e=(0,F.Z)({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new hh(n),i=(t={},(0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)((0,Fn.Z)(t,pr.CIRCLE,r),pr.ELLIPSE,r),pr.RECT,r),pr.IMAGE,new gh(n)),pr.TEXT,new vh(n)),pr.LINE,r),pr.POLYLINE,r),pr.POLYGON,r),pr.PATH,r),pr.GROUP,void 0),(0,Fn.Z)((0,Fn.Z)((0,Fn.Z)(t,pr.HTML,void 0),pr.MESH,void 0),pr.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new rh(e))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])}(gr),bh=function(){function t(){(0,z.Z)(this,t)}return(0,Z.Z)(t,[{key:"apply",value:function(e,n){var r=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var s=o.root.ownerDocument.defaultView,c=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},u=function(t){i.hooks.pointerDown.call(t)},f=function(t){i.hooks.pointerOver.call(t)},h=function(t){i.hooks.pointerOut.call(t)},d=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},y=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",h,!0),t.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",h,!0),t.addEventListener("mouseover",f,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",c,!0),t.addEventListener("touchcancel",d,!0)}(t),a.useNativeClickEvent&&t.addEventListener("click",y,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})})),i.hooks.destroy.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",h,!0),t.removeEventListener("pointerover",f,!0),n.globalThis.removeEventListener("pointerup",l,!0),n.globalThis.removeEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",h,!0),t.removeEventListener("mouseover",f,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",c,!0),t.removeEventListener("touchcancel",d,!0)}(t),a.useNativeClickEvent&&t.removeEventListener("click",y,!0),t.removeEventListener("wheel",p,!0)}))}}])}();bh.tag="DOMInteraction";var xh=function(t){function e(){var t;(0,z.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return"matrix(".concat([t[0],t[1],t[4],t[5],t[12]+e[0],t[13]+e[1]].join(","),")")}},{key:"apply",value:function(e,n){var r=this,i=e.camera,o=e.renderingContext,a=e.renderingService;this.context=e;var s=o.root.ownerDocument.defaultView,c=s.context.eventService.nativeHTMLMap,l=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())},u=function(t){var e=t.target;if(e.nodeName===pr.HTML){r.$camera||(r.$camera=r.createCamera(i));var n=r.getOrCreateEl(e);r.$camera.appendChild(n),Object.keys(e.attributes).forEach((function(t){r.updateAttribute(t,e)})),l(e,n),c.set(n,e)}},f=function(t){var e=t.target;if(e.nodeName===pr.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),c.delete(n))}},h=function(t){var e=t.target;if(e.nodeName===pr.HTML){var n=t.attrName;r.updateAttribute(n,e)}},d=function(t){var e=t.target;(e.nodeName===pr.FRAGMENT?e.childNodes:[e]).forEach((function(t){if(t.nodeName===pr.HTML){var e=r.getOrCreateEl(t);l(t,e)}}))},p=function(){if(r.$camera){var t=r.context.config,e=t.width,n=t.height;r.$camera.parentElement.style.width="".concat(e||0,"px"),r.$camera.parentElement.style.height="".concat(n||0,"px")}};a.hooks.init.tap(t.tag,(function(){s.addEventListener(jl.RESIZE,p),s.addEventListener(fc.MOUNTED,u),s.addEventListener(fc.UNMOUNTED,f),s.addEventListener(fc.ATTR_MODIFIED,h),s.addEventListener(fc.BOUNDS_CHANGED,d)})),a.hooks.endFrame.tap(t.tag,(function(){r.$camera&&o.renderReasons.has(sc.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))})),a.hooks.destroy.tap(t.tag,(function(){r.$camera&&r.$camera.remove(),s.removeEventListener(jl.RESIZE,p),s.removeEventListener(fc.MOUNTED,u),s.removeEventListener(fc.UNMOUNTED,f),s.removeEventListener(fc.ATTR_MODIFIED,h),s.removeEventListener(fc.BOUNDS_CHANGED,d)}))}},{key:"createCamera",value:function(t){var e=this.context.config,n=e.document,r=e.width,i=e.height,o=this.context.contextService.getDomElement(),a=o.parentNode;if(a){var s="g-canvas-camera",c=a.querySelector("#".concat(s));if(!c){var l=(n||document).createElement("div");l.style.overflow="hidden",l.style.pointerEvents="none",l.style.position="absolute",l.style.left="0px",l.style.top="0px",l.style.width="".concat(r||0,"px"),l.style.height="".concat(i||0,"px");var u=(n||document).createElement("div");c=u,u.id=s,u.style.position="absolute",u.style.left="".concat(o.offsetLeft||0,"px"),u.style.top="".concat(o.offsetTop||0,"px"),u.style.transformOrigin="left top",u.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),u.style.pointerEvents="none",u.style.width="100%",u.style.height="100%",l.appendChild(u),a.appendChild(l)}return c}return null}},{key:"getOrCreateEl",value:function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())),n}},{key:"updateAttribute",value:function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;ze(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"x":n.style.left="".concat(e.parsedStyle.x,"px");break;case"y":n.style.top="".concat(e.parsedStyle.y,"px");break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].buildCSSText(null,null,"")," ").concat(i[1].buildCSSText(null,null,""));break;case"width":var o=e.parsedStyle.width;n.style.width=De(o)?"".concat(o,"px"):o.toString();break;case"height":var a=e.parsedStyle.height;n.style.height=De(a)?"".concat(a,"px"):a.toString();break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var c=e.parsedStyle.visibility;n.style.visibility=c;break;case"pointerEvents":var l=e.parsedStyle.pointerEvents,u=void 0===l?"auto":l;n.style.pointerEvents=u;break;case"opacity":var f=e.parsedStyle.opacity;n.style.opacity="".concat(f);break;case"fill":var h=e.parsedStyle.fill,d="";ko(h)?d=h.isNone?"transparent":e.getAttribute("fill"):Array.isArray(h)?d=e.getAttribute("fill"):Oo(h),n.style.background=d;break;case"stroke":var p=e.parsedStyle.stroke,y="";ko(p)?y=p.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(p)?y=e.getAttribute("stroke"):Oo(p),n.style["border-color"]=y,n.style["border-style"]="solid";break;case"lineWidth":var g=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(g||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var v=e.style.filter;n.style.filter=v;break;default:Fe(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}}}])}();wh.tag="HTMLRendering";var Oh=function(t){function e(){var t;(0,z.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i0&&void 0!==i[0]?i[0]:{},n=e.type,r=e.encoderOptions,t.abrupt("return",this.context.canvas.toDataURL(n,r));case 3:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]);var t}(),_h=function(t){function e(){var t;(0,z.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i0&&void 0!==arguments[0]?arguments[0]:{};return(0,z.Z)(this,e),(t=(0,$.Z)(this,e)).name="dragndrop",t.options=n,t}return(0,G.Z)(e,t),(0,Z.Z)(e,[{key:"init",value:function(){this.addRenderingPlugin(new Eh((0,F.Z)({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)}}])}(gr);var Ah=function(t,e,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||t.apply(i,o)},s=n&&!r;clearTimeout(r),r=setTimeout(a,e),s&&t.apply(i,o)}},jh=function(t){return"object"==typeof t&&null!==t},Ph=function(t){if(!jh(t)||!Ln(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function Th(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function Ch(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(Th(e,i)){var o=e[i];null!==o&&Ph(o)?(Ph(t[i])||(t[i]={}),n=r.length)return n(i);const a=new Lh,s=r[o++];let c=-1;for(const t of i){const e=s(t,++c,i),n=a.get(e);n?n.push(t):a.set(e,[t])}for(const[e,n]of a)a.set(e,t(n,o));return e(a)}(t,0)}var Hh=function(t){return Fe(t)?"":t.toString()},qh=function(t){var e=Hh(t);return e.charAt(0).toLowerCase()+e.substring(1)},Yh=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))};function Vh(t){return t}function Uh(t){return t.reduce(((t,e)=>(n,...r)=>e(t(n,...r),...r)),Vh)}function Xh(t){return t.replace(/( |^)[a-z]/g,(t=>t.toUpperCase()))}function Kh(t=""){throw new Error(t)}function Qh(t,e){const{attributes:n}=e,r=new Set(["id","className"]);for(const[e,i]of Object.entries(n))r.has(e)||t.attr(e,i)}function Jh(t){return null!=t&&!Number.isNaN(t)}function td(t){const e=new Map;return n=>{if(e.has(n))return e.get(n);const r=t(n);return e.set(n,r),r}}function ed(t,e){return nd(t,e)||{}}function nd(t,e){const n=Object.entries(t||{}).filter((([t])=>t.startsWith(e))).map((([t,n])=>[qh(t.replace(e,"").trim()),n])).filter((([t])=>!!t));return 0===n.length?null:Object.fromEntries(n)}function rd(t,...e){return Object.fromEntries(Object.entries(t).filter((([t])=>e.every((e=>!t.startsWith(e))))))}function id(t,e){if(void 0===t)return null;if("number"==typeof t)return t;const n=+t.replace("%","");return Number.isNaN(n)?null:n/100*e}function od(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function ad(t){return null===t||!1===t}function sd(t,e,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(e)){const o=e[i];Ph(o)&&Ph(t[i])?sd(t[i],o,n,r+1):t[i]=o}return t}}function cd(t){return new ld([t],null,t,t.ownerDocument)}class ld{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],o=[],a=[]){this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=o,this._facetElements=a}selectAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new ld(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new ld(this._elements,null,this._parent,this._document,void 0,void 0,e)}select(t){const e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new ld([e],null,e,this._document)}append(t){const e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;tt),n=(()=>null)){const r=[],i=[],o=new Set(this._elements),a=[],s=new Set,c=new Map(this._elements.map(((t,n)=>[e(t.__data__,n),t]))),l=new Map(this._facetElements.map(((t,n)=>[e(t.__data__,n),t]))),u=zh(this._elements,(t=>n(t.__data__)));for(let f=0;ft),e=(t=>t),n=(t=>t.remove()),r=(t=>t),i=(t=>t.remove())){const o=t(this._enter),a=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return a.merge(o).merge(s).merge(c).merge(l)}remove(){for(let t=0;tt.finished))).then((()=>{this._elements[t].remove()}))}else{this._elements[t].remove()}}return new ld([],null,this._parent,this._document,void 0,this._transitions)}each(t){for(let e=0;ee:e;return this.each((function(r,i,o){void 0!==e&&(o[t]=n(r,i,o))}))}style(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(r,i,o){void 0!==e&&(o.style[t]=n(r,i,o))}))}transition(t){const e="function"!=typeof t?()=>t:t,{_transitions:n}=this;return this.each((function(t,r,i){n[r]=e(t,r,i)}))}on(t,e){return this.each((function(n,r,i){i.addEventListener(t,e)})),this}call(t,...e){return t(this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}ld.registry={g:al,rect:ml,circle:nl,path:dl,text:xl,ellipse:ol,image:ll,line:fl,polygon:yl,polyline:vl,html:cl};const ud="beforerender",fd="afterrender",hd="beforepaint",dd="afterpaint",pd="beforeclear",yd="afterclear",gd="beforedestroy",vd="afterdestroy",md="beforechangesize",bd="afterchangesize",xd="pointertap",wd="pointerdown",Od="pointerup",kd="pointerover",_d="pointerout",Md="pointermove",Ed="pointerenter",Sd="pointerleave",Ad="pointerupoutside",jd="dragstart",Pd="drag",Td="dragend",Cd="dragenter",Rd="dragleave",Ld="dragover",Nd="DROP",Id="click",Dd="dblclick";var Bd=function(t){var e=Hh(t);return e.charAt(0).toUpperCase()+e.substring(1)};function Fd(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}var zd,Zd=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Wd(t){if(!(e=Zd.exec(t)))throw new Error("invalid format: "+t);var e;return new $d({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function $d(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Gd(t,e){var n=Fd(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Wd.prototype=$d.prototype,$d.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Hd={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Gd(100*t,e),r:Gd,s:function(t,e){var n=Fd(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(zd=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Fd(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function qd(t){return t}var Yd,Vd,Ud=Array.prototype.map,Xd=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Kd(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?qd:(e=Ud.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),o.push(t.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?qd:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Ud.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=Wd(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,y=t.comma,g=t.precision,v=t.trim,m=t.type;"n"===m?(y=!0,m="g"):Hd[m]||(void 0===g&&(g=12),v=!0,m="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",x="$"===h?o:/[%p]/.test(m)?c:"",w=Hd[m],O=/[defgprs%]/.test(m);function k(t){var i,o,c,h=b,k=x;if("c"===m)k=w(t)+k,t="";else{var _=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:w(Math.abs(t),g),v&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),_&&0==+t&&"+"!==f&&(_=!1),h=(_?"("===f?f:l:"-"===f||"("===f?"":f)+h,k=("s"===m?Xd[8+zd/3]:"")+k+(_&&"("===f?")":""),O)for(i=-1,o=t.length;++i(c=t.charCodeAt(i))||c>57){k=(46===c?a+t.slice(i+1):t.slice(i))+k,t=t.slice(0,i);break}}y&&!d&&(t=r(t,1/0));var M=h.length+t.length+k.length,E=M>1)+h+t+k+E.slice(M);break;default:t=E+h+t+k}return s(t)}return g=void 0===g?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),k.toString=function(){return t+""},k}return{format:f,formatPrefix:function(t,e){var n=f(((t=Wd(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=Fd(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),o=Xd[8+r/3];return function(t){return n(i*t)+o}}}}function Qd(t,e){return Object.entries(t).reduce(((n,[r,i])=>(n[r]=e(i,r,t),n)),{})}function Jd(t){return t.map(((t,e)=>e))}function tp(t){return t[0]}function ep(t){return t[t.length-1]}function np(t,e){const n=[[],[]];return t.forEach((t=>{n[e(t)?0:1].push(t)})),n}function rp(t,e=t.length){if(1===e)return t.map((t=>[t]));const n=[];for(let r=0;r{n.push([t[r],...e])}))}return n}Yd=Kd({thousands:",",grouping:[3],currency:["$",""]}),Vd=Yd.format,Yd.formatPrefix;var ip=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},op=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(ze(t)||ze(e))return!1;if(ip(t)||ip(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n=i)&&(n=i)}return n}const lp=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1},n=Object.assign(Object.assign({},e),t);return Object.assign(Object.assign({},n),(r=n.startAngle,i=n.endAngle,r%=2*Math.PI,i%=2*Math.PI,r<0&&(r=2*Math.PI+r),i<0&&(i=2*Math.PI+i),r>=i&&(i+=2*Math.PI),{startAngle:r,endAngle:i}));var r,i},up=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=lp(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,n,r,i]]};up.props={};const fp=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},hp=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=fp(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...up({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};function dp(t,e,n){return Math.max(e,Math.min(t,n))}function pp(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}hp.props={};const yp=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];var gp=n(78830);function vp(t){const{transformations:e}=t.getOptions();return e.map((([t])=>t)).filter((t=>"transpose"===t)).length%2!=0}function mp(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"polar"===t))}function bp(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"reflect"===t))&&e.some((([t])=>t.startsWith("transpose")))}function xp(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"helix"===t))}function wp(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"parallel"===t))}function Op(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"fisheye"===t))}function kp(t){return xp(t)||mp(t)}function _p(t){return mp(t)&&vp(t)}function Mp(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find((t=>"polar"===t[0]));return[+n,+r]}function Ep(t,e=!0){const{transformations:n}=t.getOptions(),[,r,i]=n.find((t=>"polar"===t[0]));return e?[180*+r/Math.PI,180*+i/Math.PI]:[r,i]}function Sp(t,e){e(t),t.children&&t.children.forEach((function(t){t&&Sp(t,e)}))}function Ap(t){Pp(t,!0)}function jp(t){Pp(t,!1)}function Pp(t,e){var n=e?"visible":"hidden";Sp(t,(function(t){t.attr("visibility",n)}))}function Tp(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter((function(t){var n=(0,We.CR)(t,1)[0];return!e.includes(n)})));return Object.fromEntries(e.map((function(e){return function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,(0,We.pi)((0,We.pi)({},t[e]),n)]:[e,n]})))}function Cp(t,e){t?t.finished.then(e):e()}function Rp(t,e){"update"in t?t.update(e):t.attr(e)}function Lp(t,e,n){return 0===e.length?null:n?t.animate(e,n):(Rp(t,{style:e.slice(-1)[0]}),null)}function Np(t,e,n){var r={},i={};return Object.entries(e).forEach((function(e){var n=(0,We.CR)(e,2),o=n[0],a=n[1];if(!Fe(a)){var s=t.style[o]||t.parsedStyle[o]||0;s!==a&&(r[o]=s,i[o]=a)}})),n?Lp(t,[r,i],(0,We.pi)({fill:"both"},n)):(Rp(t,i),null)}var Ip=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach((function(i){var o=(0,We.CR)(i,2),a=o[0],s=o[1],c=t;Object.prototype.hasOwnProperty.call(e,a)&&(s?Ph(s)?(Ph(t[a])||(c[a]={}),n="A"&&n<="Z"};function sy(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach((function(t){var i=(0,We.CR)(t,2),o=i[0],a=i[1];if("className"===o||"class"===o);else if(ay(o,"show")&&ay(oy(o,"show"),e)!==n)o===function(t,e){return"".concat(e).concat(iy(t))}(e,"show")?r[o]=a:r[o.replace(new RegExp(iy(e)),"")]=a;else if(!ay(o,"show")&&ay(o,e)!==n){var s=oy(o,e);"filter"===s&&"function"==typeof a||(r[s]=a)}})),r}function cy(t,e){return Object.entries(t).reduce((function(t,n){var r=(0,We.CR)(n,2),i=r[0],o=r[1];return i.startsWith("show")?t["show".concat(e).concat(i.slice(4))]=o:t["".concat(e).concat(iy(i))]=o,t}),{})}function ly(t,e){void 0===e&&(e=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(t).forEach((function(t){var o=(0,We.CR)(t,2),a=o[0],s=o[1];e.includes(a)||(-1!==n.indexOf(a)?i[a]=s:r[a]=s)})),[r,i]}function uy(t,e){return In(t)?t.apply(void 0,(0,We.ev)([],(0,We.CR)(e),!1)):t}function fy(t,e){return t.style.opacity||(t.style.opacity=1),Np(t,{opacity:0},e)}var hy=["$el","cx","cy","d","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function dy(t){return hy.includes(t)}function py(t){var e={};for(var n in t)dy(n)&&(e[n]=t[n]);return e}var yy=qp({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function gy(t){return t.reduce((function(t,e,n){return t.push((0,We.ev)([0===n?"M":"L"],(0,We.CR)(e),!1)),t}),[])}function vy(t,e,n){return"surround"===e.type?function(t,e,n){var r=e.connect,i=void 0===r?"line":r,o=e.center;if("line"===i)return gy(t);if(!o)return[];var a=ty(t[0],o),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push((0,We.ev)(["M"],(0,We.CR)(e),!1)):t.push((0,We.ev)(["A",a,a,0,0,s],(0,We.CR)(e),!1)),t}),[])}(t,e,n):gy(t)}function my(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=(0,We.CR)([vy(t,n),vy(e.slice().reverse(),n,!0)],2),c=s[0],l=s[1],u=(0,We.CR)([t[0],e.slice(-1)[0]],2),f=u[0],h=u[1],d=function(t,e){return[c,t,l,e,a].flat()};if("line"===i||"surround"===r)return d([(0,We.ev)(["L"],(0,We.CR)(h),!1)],[(0,We.ev)(["L"],(0,We.CR)(f),!1)]);if(!o)throw new Error("Arc grid need to specified center");var p=(0,We.CR)([ty(h,o),ty(f,o)],2),y=p[0],g=p[1];return d([(0,We.ev)(["A",y,y,0,0,1],(0,We.CR)(h),!1),(0,We.ev)(["L"],(0,We.CR)(h),!1)],[(0,We.ev)(["A",g,g,0,0,0],(0,We.CR)(f),!1),(0,We.ev)(["L"],(0,We.CR)(f),!1)])}var by=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,We.ZT)(e,t),e.prototype.render=function(t,e){t.type,t.center,t.areaFill,t.closed;var n=(0,We._T)(t,["type","center","areaFill","closed"]),r=function(t){var e=t.data,n=void 0===e?[]:e;return t.closed?n.map((function(t){var e=t.points,n=(0,We.CR)(e,1)[0];return(0,We.pi)((0,We.pi)({},t),{points:(0,We.ev)((0,We.ev)([],(0,We.CR)(e),!1),[n],!1)})})):n}(t),i=Hp(e).maybeAppendByClassName(yy.lineGroup,"g"),o=Hp(e).maybeAppendByClassName(yy.regionGroup,"g"),a=function(t,e,n,r){var i=n.animate,o=n.isBillboard,a=e.map((function(t,e){return{id:t.id||"grid-line-".concat(e),d:vy(t.points,n)}}));return t.selectAll(yy.line.class).data(a,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=uy(py((0,We.pi)({d:t.d},r)),[t,e,a]);this.attr((0,We.pi)({class:yy.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},n))}))}),(function(t){return t.transition((function(t,e){return Np(this,uy(py((0,We.pi)({d:t.d},r)),[t,e,a]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=fy(this,i.exit);return Cp(e,(function(){return t.remove()})),e}))})).transitions()}(i,r,t,n),s=function(t,e,n){var r=n.animate,i=n.connect,o=n.areaFill;if(e.length<2||!o||!i)return[];for(var a=Array.isArray(o)?o:[o,"transparent"],s=function(t){return a[t%a.length]},c=[],l=0;l180?1:0,O=t>e?0:1;return"M".concat(p,",").concat(y,",A").concat(s,",").concat(c,",0,").concat(w,",").concat(O,",").concat(v,",").concat(m)}function Iy(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll(Vp.line.class).data([{d:Ny.apply(void 0,(0,We.ev)((0,We.ev)([i,o],(0,We.CR)(a),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",Vp.line.name).styles(e).styles({d:function(t){return t.d}})}),(function(t){return t.transition((function(){var t=this,e=function(t,e,n,r){if(!r)return t.attr("__keyframe_data__",n),null;var i=r.duration,o=void 0===i?0:i,a=wy(e,n),s=Math.ceil(+o/16),c=new Array(s).fill(0).map((function(t,e,n){return{__keyframe_data__:a(e/(n.length-1))}}));return t.animate(c,(0,We.pi)({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return(0,We.ev)((0,We.ev)([n,r],(0,We.CR)(i),!1),[o],!1)}(this),(0,We.ev)((0,We.ev)([i,o],(0,We.CR)(a),!1),[s],!1),r.update);if(e){var n=function(){var e=xy(t.attributes,"__keyframe_data__");t.style.d=Ny.apply(void 0,(0,We.ev)([],(0,We.CR)(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function Dy(t){var e=(0,We.CR)(t,2),n=(0,We.CR)(e[0],2),r=n[0],i=n[1],o=(0,We.CR)(e[1],2);return{x1:r,y1:i,x2:o[0],y2:o[1]}}function By(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,c=e.lineExtension,l=(0,We.CR)([o,a],2),u=(0,We.CR)(l[0],2),f=u[0],h=u[1],d=(0,We.CR)(l[1],2),p=d[0],y=d[1],g=(0,We.CR)(c?function(t,e,n){void 0===n&&(n=[0,0]);var r=(0,We.CR)([t,e,n],3),i=(0,We.CR)(r[0],2),o=i[0],a=i[1],s=(0,We.CR)(r[1],2),c=s[0],l=s[1],u=(0,We.CR)(r[2],2),f=u[0],h=u[1],d=(0,We.CR)([c-o,l-a],2),p=d[0],y=d[1],g=Math.sqrt(Math.pow(p,2)+Math.pow(y,2)),v=(0,We.CR)([-f/g,h/g],2),m=v[0],b=v[1];return[m*p,m*y,b*p,b*y]}(o,a,c):new Array(4).fill(0),4),v=g[0],m=g[1],b=g[2],x=g[3],w=function(e){return t.selectAll(Vp.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(Vp.line.name," ").concat(t.className)})).styles(n).transition((function(t){return Np(this,Dy(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return Np(this,Dy(t.line),r.update)}))}),(function(t){return t.remove()})).transitions()};if(!i||!s)return w([{line:[[f+v,h+m],[p+b,y+x]],className:Vp.line.name}]);var O=(0,We.CR)(s,2),k=O[0],_=O[1],M=p-f,E=y-h,S=(0,We.CR)([f+M*k,h+E*k],2),A=S[0],j=S[1],P=(0,We.CR)([f+M*_,h+E*_],2),T=P[0],C=P[1],R=w([{line:[[f+v,h+m],[A,j]],className:Vp.lineFirst.name},{line:[[T,C],[p+b,y+x]],className:Vp.lineSecond.name}]);return function(t,e){e.truncRange,e.truncShape,e.lineExtension}(0,e),R}function Fy(t,e,n){var r,i=e.type,o=sy(e,"line");return r="linear"===i?By(t,e,_y(o,"arrow"),n):Iy(t,e,_y(o,"arrow"),n),function(t,e,n,r){var i,o=n.showArrow,a=n.showTrunc,s=n.lineArrow,c=n.lineArrowOffset,l=n.lineArrowSize;if(i="arc"===e?t.select(Vp.line.class):a?t.select(Vp.lineSecond.class):t.select(Vp.line.class),!o||!s||"arc"===n.type&&Ly(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=Oy(s);f.attr(r),ky(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,o),r}function zy(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Zy(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,o=(0,We.CR)(Ty(i,e),2),a=o[0],s=o[1],c=(0,We.CR)(Up(function(t,e){return jy(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+c[0],s+c[1]]]}}))}function Wy(t,e,n,r){var i=sy(n,"grid"),o=i.type,a=i.areaFill,s=zy(n),c=Ey(e,n.gridFilter),l="segment"===o?Zy(c,n):function(t,e){var n=e.gridControlAngles,r=zy(e);if(!r)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");var i=(0,We.CR)(r,2),o=i[0],a=i[1];return t.map((function(t,r){var i=t.value,s=(0,We.CR)(Ty(i,e),2),c=s[0],l=s[1],u=(0,We.CR)([c-o,l-a],2),f=u[0],h=u[1],d=[];return n.forEach((function(t){var e=ny(t),n=(0,We.CR)([Math.cos(e),Math.sin(e)],2),r=n[0],i=n[1],s=f*r-h*i+o,c=f*i+h*r+a;d.push([s,c])})),{points:d,id:r}}))}(c,n),u=(0,We.pi)((0,We.pi)({},i),{center:s,areaFill:In(a)?c.map((function(t,e){return uy(a,[t,e,c])})):a,animate:r,data:l});return t.selectAll(Vp.grid.class).data([1]).join((function(t){return t.append((function(){return new by({style:u})})).attr("className",Vp.grid.name)}),(function(t){return t.transition((function(){return this.update(u)}))}),(function(t){return t.remove()})).transitions()}function $y(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=!1),!!(r&&t===e||i&&t===n)||t>e&&ti&&(r=n,a(1),++e),n[t]=o}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:o(t,e)}}}var Hy,qy,Yy=new Map;var Vy,Uy,Xy,Ky=(Vy=function(t,e){var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return qy?qy(t,n):(Hy||(Hy=Wc.offscreenCanvasCreator.getOrCreateContext(void 0)),Hy.font=[o,a,i,"".concat(n,"px"),r].join(" "),Hy.measureText(t).width)},Uy=function(t,e){return[t,Object.values(e||Qy(t)).join()].join("")},void 0===(Xy=4096)&&(Xy=128),function(){for(var t=[],e=0;e0,g=r-c,v=i-l,m=u*v-f*g;if(m<0===y)return!1;var b=h*v-d*g;return b<0!==y&&(m>p!==y&&b>p!==y)}function fg(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some((function(t){return ug(e,t)}))}function hg(t,e,n){var r,i,o=e.crossPadding,a=new Set,s=null,c=function(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if("arc"===n){var o=t.center,a=t.radius,s=(0,We.CR)(o,2),c=s[0],l=s[1],u="negative"===r?0:i,f=-a-u,h=a+u,d=(0,We.CR)(ig(e),4),p=d[0],y=d[1],g=d[2],v=d[3];return new og(c+f-v,l+f-p,c+h+y,l+h+g)}var m=(0,We.CR)(t.startPos,2),b=m[0],x=m[1],w=(0,We.CR)(t.endPos,2),O=w[0],k=w[1],_=(0,We.CR)(Ry(t)?[-e,0,e,0]:[0,e,0,-e],4),M=_[0],E=_[1],S=_[2],A=_[3],j=Up(Py(0,t),i),P=new og(b,x,O,k);return P.x1+=A,P.y1+=M,P.x2+=E+j[0],P.y2+=S+j[1],P}(e,o),l=function(t){return!c||function(t,e,n){var r=t.x1,i=t.x2,o=t.y1,a=t.y2;return lg([[r,o],[i,o],[i,a],[r,a]],ag(e,n))}(c,t)},u=function(t,e){return!t||!t.firstChild||!function(t,e,n){var r,i,o=ag(t,n).flat(1),a=ag(e,n).flat(1),s=[[o[0],o[1],o[2],o[3]],[o[0],o[1],o[4],o[5]],[o[4],o[5],o[6],o[7]],[o[2],o[3],o[6],o[7]]];try{for(var c=(0,We.XA)(s),l=c.next();!l.done;l=c.next())if(fg(a,l.value))return!0}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return!1}(t.firstChild,e.firstChild,ig(n))};try{for(var f=(0,We.XA)(t),h=f.next();!h.done;h=f.next()){var d=h.value;l(d)?!s||u(s,d)?s=d:(a.add(s),a.add(d)):a.add(d)}}catch(t){r={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return Array.from(a)}function dg(t,e){return void 0===e&&(e={}),Fe(t)?0:"number"==typeof t?t:Math.floor(Ky(t,e))}function pg(t){var e=t.getLocalBounds(),n=e.min,r=e.max,i=(0,We.CR)([n,r],2),o=(0,We.CR)(i[0],2),a=o[0],s=o[1],c=(0,We.CR)(i[1],2),l=c[0],u=c[1];return{x:a,y:s,width:l-a,height:u-s,left:a,bottom:u,top:s,right:l}}function yg(t,e){var n=(0,We.CR)(t,2),r=n[0],i=n[1],o=(0,We.CR)(e,2),a=o[0],s=o[1];return r!==a&&i===s}var gg=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r)||(jp(t),!1)}))};var vg=new Map([["hide",function(t,e,n,r){var i=t.length,o=e.keepHeader,a=e.keepTail;if(!(i<=1||2===i&&o&&a)){var s,c,l,u=gg,f=function(t){return t.forEach(r.show),t},h=2,d=t.slice(),p=t.slice(),y=Math.min.apply(Math,(0,We.ev)([1],(0,We.CR)(t.map((function(t){return t.getBBox().width}))),!1));if("linear"===n.type&&(Cy(n)||Ry(n))){var g=pg(t[0]).left,v=pg(t[i-1]).right,m=Math.abs(v-g)||1;h=Math.max(Math.floor(i*y/m),h)}for(o&&(s=d.splice(0,1)[0]),a&&(c=d.splice(-1,1)[0],d.reverse()),f(d);hy+p;x-=p){var w=b(x);if("object"==typeof w)return w.value}}}],["wrap",function(t,e,n,r){var i=e.wordWrapWidth,o=void 0===i?50:i,a=e.maxLines,s=void 0===a?3:a,c=e.recoverWhenFailed,l=void 0===c||c,u=e.margin,f=void 0===u?[0,0,0,0]:u,h=t.map((function(t){return t.attr("maxLines")||1})),d=Math.min.apply(Math,(0,We.ev)([],(0,We.CR)(h),!1)),p=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&Cy(t)?"negative"===n?"bottom":"top":"middle"}(n),y=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,o,i,p)}))};if(!(d>s)){for(var g=d;g<=s;g++)if(y(g),hg(t,n,f).length<1)return;l&&y(h)}}]]);function mg(){for(var t=[],e=0;e1)})(t,e,i)&&(null==o||o(t,r,e,n))}))}(this.node().childNodes,t,{hide:jp,show:Ap,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=Og(e.__data__.value,t,n),i=e.querySelector(Vp.labelItem.class);i&&_g(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&eg(t,e||1/0,n)},wrap:function(t,e,n){var r,i;t&&(void 0===(r=n)&&(r=2),void 0===i&&(i="top"),tg(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function Eg(t,e,n,r,i){var o=n.indexOf(e),a=Hp(t).append(function(t,e,n,r){var i=r.labelFormatter;return In(i)?function(){return Oy(uy(i,[t,e,n,Py(t.value,r)]))}:function(){return Oy(t.label||"")}}(e,o,n,i)).attr("className",Vp.labelItem.name).node(),s=(0,We.CR)(ly(My(r,[e,o,n])),2),c=s[0],l=s[1],u=l.transform,f=(0,We._T)(l,["transform"]);ng(a,u);var h=wg(e,a,i);return a.getLocalEulerAngles()||a.setLocalEulerAngles(h),_g(a,(0,We.pi)((0,We.pi)({},Og(e.value,h,i)),c)),t.attr(f),a}function Sg(t,e,n,r){var i=Ey(e,n.labelFilter),o=sy(n,"label");return t.selectAll(Vp.label.class).data(i,(function(t,e){return e})).join((function(r){return r.append("g").attr("className",Vp.label.name).transition((function(t){Eg(this,t,e,o,n);var r=kg(t,e,n),i=r.x,a=r.y;return this.style.transform="translate(".concat(i,", ").concat(a,")"),null})).call((function(){Mg.call(t,n)}))}),(function(i){return i.transition((function(t){var i=function(t,e,n,r){if(void 0===r&&(r="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var i=function(){"destroy"===r?t.destroy():"hide"===r&&jp(t),e.isVisible()&&Ap(e)};if(!n)return i(),[null];var o=n.duration,a=void 0===o?0:o,s=n.delay,c=void 0===s?0:s,l=Math.ceil(+a/2),u=+a/4,f=(0,We.CR)(t.getGeometryBounds().center,2),h=f[0],d=f[1],p=(0,We.CR)(e.getGeometryBounds().center,2),y=p[0],g=p[1],v=(0,We.CR)([(h+y)/2-h,(d+g)/2-d],2),m=v[0],b=v[1],x=t.style.opacity,w=void 0===x?1:x,O=e.style.opacity,k=void 0===O?1:O,_=t.style.transform||"",M=e.style.transform||"",E=t.animate([{opacity:w,transform:"translate(0, 0) ".concat(_)},{opacity:0,transform:"translate(".concat(m,", ").concat(b,") ").concat(_)}],(0,We.pi)((0,We.pi)({fill:"both"},n),{duration:c+l+u})),S=e.animate([{opacity:0,transform:"translate(".concat(-m,", ").concat(-b,") ").concat(M),offset:.01},{opacity:k,transform:"translate(0, 0) ".concat(M)}],(0,We.pi)((0,We.pi)({fill:"both"},n),{duration:l+u,delay:c+l-u}));return Cp(S,i),[E,S]}(this.querySelector(Vp.labelItem.class),Eg(this,t,e,o,n),r.update),a=kg(t,e,n),s=a.x,c=a.y,l=Np(this,{transform:"translate(".concat(s,", ").concat(c,")")},r.update);return(0,We.ev)((0,We.ev)([],(0,We.CR)(i),!1),[l],!1)})).call((function(e){var r,i,o=xy(e,"_transitions").flat().filter(rg);i=function(){Mg.call(t,n)},0===(r=o).length?i():Promise.all(r.map((function(t){return null==t?void 0:t.finished}))).then(i)}))}),(function(t){return t.transition((function(){var t=this,e=fy(this.childNodes[0],r.exit);return Cp(e,(function(){return Hp(t).remove()})),e}))})).transitions()}function Ag(t,e){return jy(t,e.tickDirection,e)}function jg(t,e,n,r,i){var o=i.tickLength,a=(0,We.CR)(function(t,e){var n=(0,We.CR)(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,uy(o,[t,e,n])),2),s=(0,We.CR)(a[0],2),c=s[0],l=s[1],u=(0,We.CR)(a[1],2);return{x1:c,x2:u[0],y1:l,y2:u[1]}}function Pg(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=Ag(e.value,i),s="line";return In(o)&&(s=function(){return uy(o,[e,n,r,a])}),t.append(s).attr("className",Vp.tickItem.name)}(Hp(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=Ag(t.value,o),c=jg(t,e,n,s,o),l=c.x1,u=c.x2,f=c.y1,h=c.y2,d=(0,We.CR)(ly(My(a,[t,e,n,s])),2),p=d[0],y=d[1];"line"===r.node().nodeName&&r.styles((0,We.pi)({x1:l,x2:u,y1:f,y2:h},p)),i.attr(y),r.styles(p)}(t,e,n,a,this,r,i);var s=(0,We.CR)(Ty(t.value,r),2),c=s[0],l=s[1];return Np(this,{transform:"translate(".concat(c,", ").concat(l,")")},o)}var Tg=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},t.prototype.isPointIn=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},t}();var Cg=qp({text:"text"},"title");function Rg(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function Lg(t,e){var n=Object.entries(e).reduce((function(e,n){var r=(0,We.CR)(n,2),i=r[0],o=r[1];return t.node().attr(i)||(e[i]=o),e}),{});t.styles(n)}var Ng=function(t){function e(e){return t.call(this,e,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return(0,We.ZT)(e,t),e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=t.position,i=t.spacing,o=t.inset,a=this.querySelector(Cg.text.class);if(!a)return new Tg(0,0,+e,+n);var s=a.getBBox(),c=s.width,l=s.height,u=(0,We.CR)(ig(i),4),f=u[0],h=u[1],d=u[2],p=u[3],y=(0,We.CR)([0,0,+e,+n],4),g=y[0],v=y[1],m=y[2],b=y[3],x=Rg(r);if(x.includes("i"))return new Tg(g,v,m,b);x.forEach((function(t,r){var i,o,a,s;"t"===t&&(i=(0,We.CR)(0===r?[l+d,+n-l-d]:[0,+n],2),v=i[0],b=i[1]),"r"===t&&(o=(0,We.CR)([+e-c-p],1),m=o[0]),"b"===t&&(a=(0,We.CR)([+n-l-f],1),b=a[0]),"l"===t&&(s=(0,We.CR)(0===r?[c+h,+e-c-h]:[0,+e],2),g=s[0],m=s[1])}));var w=(0,We.CR)(ig(o),4),O=w[0],k=w[1],_=w[2],M=w[3],E=(0,We.CR)([M+k,O+_],2),S=E[0],A=E[1];return new Tg(g+M,v+O,m-S,b-A)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new Tg(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=(t.width,t.height,t.position,t.spacing,(0,We._T)(t,["width","height","position","spacing"])),i=(0,We.CR)(ly(r),1)[0],o=function(t){var e,n,r,i,o=t,a=o.width,s=o.height,c=o.position,l=(0,We.CR)([+a/2,+s/2],2),u=l[0],f=l[1],h=(0,We.CR)([+u,+f,"center","middle"],4),d=h[0],p=h[1],y=h[2],g=h[3],v=Rg(c);return v.includes("l")&&(d=(e=(0,We.CR)([0,"start"],2))[0],y=e[1]),v.includes("r")&&(d=(n=(0,We.CR)([+a,"end"],2))[0],y=n[1]),v.includes("t")&&(p=(r=(0,We.CR)([0,"top"],2))[0],g=r[1]),v.includes("b")&&(p=(i=(0,We.CR)([+s,"bottom"],2))[0],g=i[1]),{x:d,y:p,textAlign:y,textBaseline:g}}(t),a=o.x,s=o.y,c=o.textAlign,l=o.textBaseline;Wp(!!r.text,Hp(e),(function(t){n.title=t.maybeAppendByClassName(Cg.text,"text").styles(i).call(Lg,{x:a,y:s,textAlign:c,textBaseline:l}).node()}))},e}(Zp);function Ig(t,e,n,r,i){var o=sy(r,"title"),a=(0,We.CR)(ly(o),2),s=a[0],c=a[1],l=c.transform,u=c.transformOrigin,f=(0,We._T)(c,["transform","transformOrigin"]);e.styles(f);var h=l||function(t,e,n){var r=2*t.getGeometryBounds().halfExtents[1];if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(r/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(r/2,")")}return""}(t.node(),s.direction,s.position);t.styles((0,We.pi)((0,We.pi)({},s),{transformOrigin:u})),ng(t.node(),h);var d=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=Rg(i),s=t.node().getLocalBounds(),c=(0,We.CR)(s.min,2),l=c[0],u=c[1],f=(0,We.CR)(s.halfExtents,2),h=f[0],d=f[1],p=(0,We.CR)(e.node().getLocalBounds().halfExtents,2),y=p[0],g=p[1],v=(0,We.CR)([l+h,u+d],2),m=v[0],b=v[1],x=(0,We.CR)(ig(o),4),w=x[0],O=x[1],k=x[2],_=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var M=n.startPos,E=n.endPos,S=(0,We.CR)("start"===i?[M,E]:[E,M],2),A=S[0],j=S[1],P=ey([-j[0]+A[0],-j[1]+A[1]]),T=(0,We.CR)(Up(P,w),2),C=T[0],R=T[1];return{x:A[0]+C,y:A[1]+R}}return a.includes("t")&&(b-=d+g+w),a.includes("r")&&(m+=h+y+O),a.includes("l")&&(m-=h+y+_),a.includes("b")&&(b+=d+g+k),{x:m,y:b}}(Hp(n._offscreen||n.querySelector(Vp.mainGroup.class)),e,r),p=d.x,y=d.y;return Np(e.node(),{transform:"translate(".concat(p,", ").concat(y,")")},i)}function Dg(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=Wp(i,e.maybeAppendByClassName(Vp.lineGroup,"g"),(function(e){return Fy(e,t,r)}))||[],c=Wp(o,e.maybeAppendByClassName(Vp.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=Ey(e,n.tickFilter),o=sy(n,"tick");return t.selectAll(Vp.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",Vp.tick.name).transition((function(t,e){return Pg.call(this,t,e,i,n,o,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),Pg.call(this,t,e,i,n,o,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=fy(this.childNodes[0],r.exit);return Cp(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=Wp(a,e.maybeAppendByClassName(Vp.labelGroup,"g"),(function(e){return Sg(e,n,t,r)}))||[];return(0,We.ev)((0,We.ev)((0,We.ev)([],(0,We.CR)(s),!1),(0,We.CR)(c),!1),(0,We.CR)(l),!1).filter((function(t){return!!t}))}var Bg=function(t){function e(e){return t.call(this,e,Yp)||this}return(0,We.ZT)(e,t),e.prototype.render=function(t,e,n){var r=this,i=t.titleText,o=t.data,a=t.animate,s=t.showTitle,c=t.showGrid,l=t.dataThreshold,u=t.truncRange,f=function(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),r=[],i=0;iu[0]&&e(n-t)/(e-t):t=>.5}function Wg(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function $g(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(t=>t);for(;oe?a=n:o=n+1}return o}var Gg=n(7945),Hg=n.n(Gg);function qg(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Yg(t){const e=Hg().get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o;return[255*qg(a,o,e+1/3),255*qg(a,o,e),255*qg(a,o,e-1/3),i]}(r):null}const Vg=(t,e)=>n=>t*(1-n)+e*n,Ug=(t,e)=>"number"==typeof t&&"number"==typeof e?Vg(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=Yg(t),r=Yg(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const o=n[i],a=r[i];e[i]=o*(1-t)+a*t}const[i,o,a,s]=e;return`rgba(${Math.round(i)}, ${Math.round(o)}, ${Math.round(a)}, ${s})`}})(t,e):()=>t,Xg=(t,e)=>{const n=Vg(t,e);return t=>Math.round(n(t))};function Kg(t){return!Cn(t)&&!function(t){return null===t}(t)&&!Number.isNaN(t)}const Qg=Math.sqrt(50),Jg=Math.sqrt(10),tv=Math.sqrt(2);function ev(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/10**i;return i>=0?(o>=Qg?10:o>=Jg?5:o>=tv?2:1)*10**i:-(10**-i)/(o>=Qg?10:o>=Jg?5:o>=tv?2:1)}function nv(t,e,n){const r=Math.abs(e-t)/Math.max(0,n);let i=10**Math.floor(Math.log(r)/Math.LN10);const o=r/i;return o>=Qg?i*=10:o>=Jg?i*=5:o>=tv&&(i*=2),e{const r=[t,e];let i,o=0,a=r.length-1,s=r[o],c=r[a];return c0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=ev(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=ev(s,c,n)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(c/i)*i):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(c*i)/i),r};const iv=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,c=a?[...e].reverse():e;for(let t=0;t{const n=$g(t,e,1,r)-1,a=i[n];return Wg(o[n],a)(e)}},av=(t,e,n,r)=>(Math.min(t.length,e.length)>2?ov:iv)(t,e,r?Xg:n);class sv extends zg{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Vg,tickCount:5}}map(t){return Kg(t)?this.output(t):this.options.unknown}invert(t){return Kg(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return rv}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=ee?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):Fg}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=av(n.map(t),r,o,i);this.output=Wg(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=av(i,r.map(t),Vg);this.input=Wg(e,n,o)}}const cv=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=ev(o,a,n);if(0===s||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t=e&&(n=r=e):(n>e&&(n=e),r=o&&(n=r=o):(n>o&&(n=o),rr&&(r=h),d>i&&(i=d)}return new Tg(e,n,r-e,i-n)}var yv=function(t,e,n){var r=t.width,i=t.height,o=n.flexDirection,a=void 0===o?"row":o,s=(n.flexWrap,n.justifyContent),c=void 0===s?"flex-start":s,l=(n.alignContent,n.alignItems),u=void 0===l?"flex-start":l,f="row"===a,h="row"===a||"column"===a,d=f?h?[1,0]:[-1,0]:h?[0,1]:[0,-1],p=(0,We.CR)([0,0],2),y=p[0],g=p[1],v=e.map((function(t){var e,n=t.width,r=t.height,i=(0,We.CR)([y,g],2),o=i[0],a=i[1];return e=(0,We.CR)([y+n*d[0],g+r*d[1]],2),y=e[0],g=e[1],new Tg(o,a,n,r)})),m=pv(v),b={"flex-start":0,"flex-end":f?r-m.width:i-m.height,center:f?(r-m.width)/2:(i-m.height)/2},x=v.map((function(t){var e=t.x,n=t.y,r=Tg.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r})),w=(pv(x),function(t){var e=(0,We.CR)(f?["height",i]:["width",r],2),n=e[0],o=e[1];switch(u){case"flex-start":default:return 0;case"flex-end":return o-t[n];case"center":return o/2-t[n]/2}}),O=x.map((function(t){var e=t.x,n=t.y,r=Tg.fromRect(t);return r.x=f?e:e+w(r),r.y=f?n+w(r):n,r})),k=O.map((function(e){var n,r,i=Tg.fromRect(e);return i.x+=null!==(n=t.x)&&void 0!==n?n:0,i.y+=null!==(r=t.y)&&void 0!==r?r:0,i}));return k},gv=function(t,e,n){return[]},vv=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[fc.BOUNDS_CHANGED,fc.INSERTED,fc.REMOVED],n.$margin=ig(0),n.$padding=ig(0);var r=e.style||{},i=r.margin,o=void 0===i?0:i,a=r.padding,s=void 0===a?0:a;return n.margin=o,n.padding=s,n.isMutationObserved=!0,n.bindEvents(),n}return(0,We.ZT)(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=ig(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=ig(t)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.width,a=t.height,s=(0,We.CR)(this.$margin,4),c=s[0],l=s[1],u=s[2],f=s[3];return new Tg(n-f,i-c,o+f+l,a+c+u)},e.prototype.appendChild=function(e,n){return e.isMutationObserved=!0,t.prototype.appendChild.call(this,e,n),e},e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=(0,We.CR)(this.$padding,4),i=r[0],o=r[1],a=r[2],s=r[3],c=(0,We.CR)(this.$margin,4),l=c[0],u=c[3];return new Tg(s+u,i+l,e-s-o,n-i-a)},e.prototype.layout=function(){if(this.attributes.display&&this.isConnected&&!this.children.some((function(t){return!t.isConnected})))try{var t=this.attributes,e=t.x,n=t.y;this.style.transform="translate(".concat(e,", ").concat(n,")");var r=function(t,e,n){if(0===e.length)return[];var r={flex:yv,grid:gv},i=n.display in r?r[n.display]:null;return(null==i?void 0:i.call(null,t,e,n))||[]}(this.getAvailableSpace(),this.children.map((function(t){return t.getBBox()})),this.attributes);this.children.forEach((function(t,e){var n=r[e],i=n.x,o=n.y;t.style.transform="translate(".concat(i,", ").concat(o,")")}))}catch(t){}},e.prototype.bindEvents=function(){var t=this;this.layoutEvents.forEach((function(e){t.addEventListener(e,(function(e){e.target&&(e.target.isMutationObserved=!0,t.layout())}))}))},e.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()},e}(al),mv=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);it.getOptions().name===e)))||void 0===n?void 0:n[0]}function Mv(t){return"vertical"===t||t===-Math.PI/2}function Ev(t,e,n){const{bbox:r}=t,{position:i="top",size:o,length:a}=e,s=["top","bottom","center"].includes(i),[c,l]=s?[r.height,r.width]:[r.width,r.height],{defaultSize:u,defaultLength:f}=n.props,h=o||u||c,d=a||f||l,p=s?"horizontal":"vertical",[y,g]=s?[d,h]:[h,d];return{orientation:p,width:y,height:g,size:h,length:d}}function Sv(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=mv(t,["style"]),i={};return Object.entries(r).forEach((([t,n])=>{e.includes(t)?i[`show${Bd(t)}`]=n:i[t]=n})),Object.assign(Object.assign({},i),n)}var Av=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i+t)),{tickCount:o}=t.getOptions();return n(r,i,o)}(t,e,o),u=i?l.filter(i):l,f=t=>t instanceof Date?String(t):"object"==typeof t&&t?t:String(t),h=r||(null===(c=t.getFormatter)||void 0===c?void 0:c.call(t))||f,d=function(t,e){if(mp(e))return t=>t;const n=e.getOptions(),{innerWidth:r,innerHeight:i,insetTop:o,insetBottom:a,insetLeft:s,insetRight:c}=n,[l,u,f]="left"===t||"right"===t?[o,a,i]:[s,c,r],h=new lv({domain:[0,1],range:[l/f,1-u/f]});return t=>h.map(t)}(a,s),p=function(t,e){const{width:n,height:r}=e.getOptions();return i=>{if(!Op(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new lv({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new lv({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s),y=t=>["left","right"].includes(t);return mp(s)||vp(s)?u.map(((e,n,r)=>{var i,o;const c=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,l=d(t.map(e)+c);return{value:bp(s)&&"center"===a||vp(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a)||vp(s)&&y(a)?1-l:l,label:f(h(pp(e),n,r)),id:String(n)}})):u.map(((e,n,r)=>{var i;const o=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,s=p(d(t.map(e)+o));return{value:y(a)?1-s:s,label:f(h(pp(e),n,r)),id:String(n)}}))}function Cv(t=[],e){if(t.length>0)return t;const{labelAutoRotate:n,labelAutoHide:r,labelAutoEllipsis:i,labelAutoWrap:o}=e,a=[],s=(t,e)=>{e&&a.push(Object.assign(Object.assign({},t),e))};return s({type:"rotate",optionalAngles:[0,15,30,45,60,90]},n),s({type:"ellipsis",minLength:20},i),s({type:"hide"},r),s({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},o),a}function Rv(t,e,n){return!_p(e)&&!wp(e)&&(void 0===t?!!n.getTicks:t)}function Lv(t,e,n,r,i,o){const a=function(t,e,n,r,i,o){const a=n.axis,s=["top","right","bottom","left"].includes(i)?n[`axis${Xh(i)}`]:n.axisLinear,c=t.getOptions().name,l=n[`axis${Bd(c)}`]||{};return Object.assign({},a,s,l)}(t,0,n,0,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},a),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:Mv(o)?10:0,tick:"center"!==r&&void 0}):a}const Nv=t=>e=>{const{labelFormatter:n,labelFilter:r=(()=>!0)}=e;return i=>{var o;const{scales:[a]}=i,s=(null===(o=a.getTicks)||void 0===o?void 0:o.call(a))||a.getOptions().domain,c="string"==typeof n?Vd(n):n,l=Object.assign(Object.assign({},e),{labelFormatter:c,labelFilter:(t,e,n)=>r(s[e],e,s),scale:a});return t(l)(i)}},Iv=Nv((t=>{const{direction:e="left",important:n={},labelFormatter:r,order:i,orientation:o,actualPosition:a,position:s,size:c,style:l={},title:u,tickCount:f,tickFilter:h,tickMethod:d,transform:p,indexBBox:y}=t,g=Av(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:i,value:v,coordinate:m,theme:b})=>{const{bbox:x}=v,[w]=i,{domain:O,xScale:k}=w.getOptions(),_=Lv(w,0,b,e,s,o),M=Object.assign(Object.assign(Object.assign({},_),l),g),E=function(t,e,n="xy"){const[r,i,o]=Pv(e);return"xy"===n?t.includes("bottom")||t.includes("top")?i:r:"xz"===n?t.includes("bottom")||t.includes("top")?o:r:t.includes("bottom")||t.includes("top")?i:o}(a||s,m,t.plane),S=function(t,e,n,r,i){const{x:o,y:a,width:s,height:c}=n;if("bottom"===t)return{startPos:[o,a],endPos:[o+s,a]};if("left"===t)return{startPos:[o+s,a+c],endPos:[o+s,a]};if("right"===t)return{startPos:[o,a+c],endPos:[o,a]};if("top"===t)return{startPos:[o,a+c],endPos:[o+s,a+c]};if("center"===t){if("vertical"===e)return{startPos:[o,a],endPos:[o,a+c]};if("horizontal"===e)return{startPos:[o,a],endPos:[o+s,a]};if("number"==typeof e){const[t,n]=r.getCenter(),[l,u]=Mp(r),[f,h]=Ep(r),d=Math.min(s,c)/2,{insetLeft:p,insetTop:y}=r.getOptions(),g=l*d,v=u*d,[m,b]=[t+o-p,n+a-y],[x,w]=[Math.cos(e),Math.sin(e)],O=[m+v*x,b+v*w],k=[m+g*x,b+g*w],_=()=>{const{domain:t}=i.getOptions();return t.length},M=mp(r)&&i?_():3;return{startPos:O,endPos:k,gridClosed:Math.abs(h-f-360)<1e-6,gridCenter:[m,b],gridControlAngles:new Array(M).fill(0).map(((t,e,n)=>(h-f)/M*e))}}}return{}}(s,o,x,m,k),A=function(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}(m),j=Tv(w,O,f,r,h,d,s,m),P=y?j.map(((t,e)=>{const n=y.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):j,T=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},M),{type:"linear",data:P,crossSize:c,titleText:xv(u),labelOverlap:Cv(p,M),grid:Rv(M.grid,m,w),gridLength:E,line:!0,indexBBox:y}),M.line?null:{lineOpacity:0}),S),A),n),C=T.labelOverlap.find((t=>"hide"===t.type));return C&&(T.crossSize=!1),new Bg({className:"axis",style:Sv(T)})}})),Dv=Nv((t=>{const{order:e,size:n,position:r,orientation:i,labelFormatter:o,tickFilter:a,tickCount:s,tickMethod:c,important:l={},style:u={},indexBBox:f,title:h,grid:d=!1}=t,p=Av(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:i})=>{const{bbox:u}=e,{domain:y}=t.getOptions(),g=Tv(t,y,s,o,a,c,r,n),v=f?g.map(((t,e)=>{const n=f.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):g,[m,b]=Mp(n),x=function(t,e,n,r,i){const{x:o,y:a,width:s,height:c}=e,l=[o+s/2,a+c/2],u=Math.min(s,c)/2,[f,h]=Ep(i),[d,p]=Pv(i),y={center:l,radius:u,startAngle:f,endAngle:h,gridLength:(r-n)*(Math.min(d,p)/2)};if("inner"===t){const{insetLeft:t,insetTop:e}=i.getOptions();return Object.assign(Object.assign({},y),{center:[l[0]-t,l[1]-e],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})}return Object.assign(Object.assign({},y),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(r,u,m,b,n),{axis:w,axisArc:O={}}=i,k=Sv(Rh({},w,O,x,Object.assign(Object.assign({type:"arc",data:v,titleText:xv(h),grid:d},p),l)));return new Bg({style:hv(k,["transform"])})}}));Iv.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},Dv.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};var Bv=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i(c-s)/i.count*e))})}const zv=t=>{const{important:e={}}=t,n=Bv(t,["important"]);return r=>{const{theme:i,coordinate:o,scales:a}=r;return Iv(Object.assign(Object.assign(Object.assign({},n),function(t){const e=t%(2*Math.PI);return e===Math.PI/2?{titleTransform:"translate(0, 50%)"}:e>-Math.PI/2&&eMath.PI/2&&e<3*Math.PI/2?{titleTransform:"translate(-50%, 0)"}:{}}(t.orientation)),{important:Object.assign(Object.assign({},Fv(t,i,o,a)),e)}))(r)}};function Zv(t,e){return+t.toPrecision(e)}zv.props=Object.assign(Object.assign({},Iv.props),{defaultPosition:"center"});function Wv(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e)return[e.x,e.y];if(n){var o=n[0];return[o.clientX,o.clientY]}return r&&i?[r,i]:[0,0]}var $v={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(t){return t.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},Gv=qp({background:"background",labelGroup:"label-group",label:"label"},"indicator"),Hv=function(t){function e(e){var n=t.call(this,e,$v)||this;return n.point=[0,0],n.group=n.appendChild(new al({})),n.isMutationObserved=!0,n}return(0,We.ZT)(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=t.padding,r=(0,We.CR)(ig(n),4),i=r[0],o=r[1],a=r[2],s=r[3],c=this.label.node().getLocalBounds(),l=c.min,u=c.max,f=new Tg(l[0]-s,l[1]-i,u[0]+o-l[0]+s,u[1]+a-l[1]+i),h=this.getPath(e,f),d=sy(this.attributes,"background");this.background=Hp(this.group).maybeAppendByClassName(Gv.background,"path").styles((0,We.pi)((0,We.pi)({},d),{d:h})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=sy(this.attributes,"label"),i=(0,We.CR)(ly(r),2),o=i[0],a=i[1],s=(o.text,(0,We._T)(o,["text"]));(this.label=Hp(this.group).maybeAppendByClassName(Gv.labelGroup,"g").styles(a),n)&&this.label.maybeAppendByClassName(Gv.label,(function(){return Oy(e(n))})).style("text",e(n).toString()).selectAll("text").styles(s)},e.prototype.adjustLayout=function(){var t=(0,We.CR)(this.point,2),e=t[0],n=t[1],r=this.attributes,i=r.x,o=r.y;this.group.attr("transform","translate(".concat(i-e,", ").concat(o-n,")"))},e.prototype.getPath=function(t,e){var n=this.attributes.radius,r=e.x,i=e.y,o=e.width,a=e.height,s=[["M",r+n,i],["L",r+o-n,i],["A",n,n,0,0,1,r+o,i+n],["L",r+o,i+a-n],["A",n,n,0,0,1,r+o-n,i+a],["L",r+n,i+a],["A",n,n,0,0,1,r,i+a-n],["L",r,i+n],["A",n,n,0,0,1,r+n,i],["Z"]],c={top:4,right:6,bottom:0,left:2}[t],l=this.createCorner([s[c].slice(-2),s[c+1].slice(-2)]);return s.splice.apply(s,(0,We.ev)([c+1,1],(0,We.CR)(l),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=yg.apply(void 0,(0,We.ev)([],(0,We.CR)(t),!1)),r=(0,We.CR)(t,2),i=(0,We.CR)(r[0],2),o=i[0],a=i[1],s=(0,We.CR)(r[1],2),c=s[0],l=s[1],u=(0,We.CR)(n?[c-o,[o,c]]:[l-a,[a,l]],2),f=u[0],h=(0,We.CR)(u[1],2),d=h[0],p=h[1],y=f/2,g=e*(f/Math.abs(f)),v=g/2,m=g*Math.sqrt(3)/2*.8,b=(0,We.CR)([d,d+y-v,d+y,d+y+v,p],5),x=b[0],w=b[1],O=b[2],k=b[3],_=b[4];return n?(this.point=[O,a-m],[["L",x,a],["L",w,a],["L",O,a-m],["L",k,a],["L",_,a]]):(this.point=[o+m,O],[["L",o,x],["L",o,w],["L",o+m,O],["L",o,k],["L",o,_]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?jp(this):Ap(this)},e.prototype.bindEvents=function(){this.label.on(fc.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(Zp),qv={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},Yv={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Vv={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},Uv=qp({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),Xv=qp({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),Kv=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,We.ZT)(e,t),e.prototype.render=function(t,e){var n=t.x,r=t.y,i=t.size,o=void 0===i?10:i,a=t.radius,s=void 0===a?o/4:a,c=t.orientation,l=(0,We._T)(t,["x","y","size","radius","orientation"]),u=o,f=2.4*u,h=Hp(e).maybeAppendByClassName(Xv.iconRect,"rect").styles((0,We.pi)((0,We.pi)({},l),{width:u,height:f,radius:s,x:n-u/2,y:r-f/2,transformOrigin:"center"})),d=n+1/3*u-u/2,p=n+2/3*u-u/2,y=r+1/4*f-f/2,g=r+3/4*f-f/2;h.maybeAppendByClassName("".concat(Xv.iconLine,"-1"),"line").styles((0,We.pi)({x1:d,x2:d,y1:y,y2:g},l)),h.maybeAppendByClassName("".concat(Xv.iconLine,"-2"),"line").styles((0,We.pi)({x1:p,x2:p,y1:y,y2:g},l)),"vertical"===c&&(h.node().style.transform="rotate(90)")},e}(Zp),Qv=function(t){function e(e){return t.call(this,e,Vv)||this}return(0,We.ZT)(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.x,i=n.y,o=n.showLabel,a=sy(this.attributes,"label"),s=a.x,c=void 0===s?0:s,l=a.y,u=void 0===l?0:l,f=a.transform,h=a.transformOrigin,d=(0,We._T)(a,["x","y","transform","transformOrigin"]),p=(0,We.CR)(ly(d,[]),2),y=p[0],g=p[1],v=Hp(t).maybeAppendByClassName(Xv.labelGroup,"g").styles(g),m=(0,We.pi)((0,We.pi)({},Yv),y),b=m.text,x=(0,We._T)(m,["text"]);Wp(!!o,v,(function(t){e.label=t.maybeAppendByClassName(Xv.label,"text").styles((0,We.pi)((0,We.pi)({},x),{x:r+c,y:i+u,transform:f,transformOrigin:h,text:"".concat(b)})),e.label.on("mousedown",(function(t){t.stopPropagation()})),e.label.on("touchstart",(function(t){t.stopPropagation()}))}))},e.prototype.renderIcon=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,o=e.type,a=(0,We.pi)((0,We.pi)({x:n,y:r,orientation:i},qv),sy(this.attributes,"icon")),s=this.attributes.iconShape,c=void 0===s?function(){return new Kv({style:a})}:s;Hp(t).maybeAppendByClassName(Xv.iconGroup,"g").selectAll(Xv.icon.class).data([c]).join((function(t){return t.append("string"==typeof c?c:function(){return c(o)}).attr("className",Xv.icon.name)}),(function(t){return t.update(a)}),(function(t){return t.remove()}))},e.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},e}(Zp),Jv=function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]},tm=Jv,em=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},nm=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},rm=nm;var im=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function om(t){var e=function(t){var e="default";if(Dn(t)&&t instanceof Image)e="image";else if(In(t))e="symbol";else if(ze(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}var am=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,We.ZT)(e,t),e.prototype.render=function(t,n){var r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o,s=this.getSubShapeStyle(t),c=s.symbol,l=s.size,u=void 0===l?16:l,f=(0,We._T)(s,["symbol","size"]),h=om(c);Wp(!!h,Hp(n),(function(t){t.maybeAppendByClassName("marker",h).attr("className","marker ".concat(h,"-marker")).call((function(t){if("image"===h){var n=2*u;t.styles({img:c,width:n,height:n,x:i-u,y:a-u})}else{n=u/2;var r=In(c)?c:e.getSymbol(c);t.styles((0,We.pi)({d:null==r?void 0:r(i,a,n)},f))}}))}))},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(Zp);am.registerSymbol("cross",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]})),am.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),am.registerSymbol("line",em),am.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),am.registerSymbol("tick",(function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]})),am.registerSymbol("circle",Jv),am.registerSymbol("point",tm),am.registerSymbol("bowtie",(function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]})),am.registerSymbol("hexagon",(function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]})),am.registerSymbol("square",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]})),am.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),am.registerSymbol("triangle",(function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]})),am.registerSymbol("triangle-down",(function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]})),am.registerSymbol("line",em),am.registerSymbol("dot",nm),am.registerSymbol("dash",rm),am.registerSymbol("smooth",(function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]})),am.registerSymbol("hv",(function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]})),am.registerSymbol("vh",(function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]})),am.registerSymbol("hvh",(function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]})),am.registerSymbol("vhv",(function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}));am.registerSymbol("hiddenHandle",(function(t,e,n){var r=1.4*n;return[["M",t-n,e-r],["L",t+n,e-r],["L",t+n,e+r],["L",t-n,e+r],["Z"]]})),am.registerSymbol("verticalHandle",(function(t,e,n){var r=1.4*n,i=n/2,o=n/6,a=t+.4*r;return[["M",t,e],["L",a,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",a,e-i],["Z"],["M",a,e+o],["L",t+r-2,e+o],["M",a,e-o],["L",t+r-2,e-o]]})),am.registerSymbol("horizontalHandle",(function(t,e,n){var r=1.4*n,i=n/2,o=n/6,a=e+.4*r;return[["M",t,e],["L",t-i,a],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,a],["Z"],["M",t-o,a],["L",t-o,e+r-2],["M",t+o,a],["L",t+o,e+r-2]]}));function sm(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}var cm=qp({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),lm={showLabel:!0,formatter:function(t){return t.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},um=function(t){function e(e){return t.call(this,e,lm)||this}return(0,We.ZT)(e,t),e.prototype.render=function(t,e){var n=Hp(e).maybeAppendByClassName(cm.markerGroup,"g");this.renderMarker(n);var r=Hp(e).maybeAppendByClassName(cm.labelGroup,"g");this.renderLabel(r)},e.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.orientation,i=n.markerSymbol,o=void 0===i?sm(r,"horizontalHandle","verticalHandle"):i;Wp(!!o,t,(function(t){var n=sy(e.attributes,"marker"),r=(0,We.pi)({symbol:o},n);e.marker=t.maybeAppendByClassName(cm.marker,(function(){return new am({style:r})})).update(r)}))},e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.showLabel,i=n.orientation,o=n.spacing,a=void 0===o?0:o,s=n.formatter;Wp(r,t,(function(t){var n,r=sy(e.attributes,"label"),o=r.text,c=(0,We._T)(r,["text"]),l=(null===(n=t.select(cm.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,h=l.height,d=void 0===h?0:h,p=(0,We.CR)(sm(i,[0,d+a,"center","top"],[f+a,0,"start","middle"]),4),y=p[0],g=p[1],v=p[2],m=p[3];t.maybeAppendByClassName(cm.label,"text").styles((0,We.pi)((0,We.pi)({},c),{x:y,y:g,text:s(o).toString(),textAlign:v,textBaseline:m}))}))},e}(Zp),fm={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},hm=Dp({},fm,{}),dm=Dp({},fm,cy(lm,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),pm=qp({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend");function ym(t,e){var n=(0,We.CR)(function(t,e){for(var n=1;n=r&&e<=i)return[r,i]}return[e,e]}(t,e),2),r=n[0],i=n[1];return{tick:e>(r+i)/2?i:r,range:[r,i]}}var gm=qp({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function vm(t){var e=t.orientation,n=t.size,r=t.length;return sm(e,[r,n],[n,r])}function mm(t){var e=t.type,n=(0,We.CR)(vm(t),2),r=n[0],i=n[1];return"size"===e?[["M",0,i],["L",0+r,0],["L",0+r,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+r,0],["L",0+r,i],["Z"]]}function bm(t){return mm(t)}function xm(t){var e,n=t.orientation,r=t.color,i=t.block,o=t.partition;if(In(r)){e=new Array(20).fill(0).map((function(t,e,n){return r(e/(n.length-1))}))}else e=r;var a=e.length,s=e.map((function(t){return _o(t).toString()}));return a?1===a?s[0]:i?function(t,e,n){var r=Array.from(e),i=t.length;return new Array(i).fill(0).reduce((function(e,n,o){var a=r[o%r.length];return e+" ".concat(t[o],":").concat(a).concat(od?Math.max(u-s,0):Math.max((u-s-d)/y,0));var m=Math.max(p,c),b=f-m,x=(0,We.CR)(this.ifHorizontal([b,g],[g,b]),2),w=x[0],O=x[1],k=["top","left"].includes(v)?s:0,_=(0,We.CR)(this.ifHorizontal([m/2,k],[k,m/2]),2),M=_[0],E=_[1];return new Tg(M,E,w,O)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,n=t.height;return this.ifHorizontal({size:n,length:e},{size:e,length:n})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,o=e.color,a=e.block,s=sy(this.attributes,"ribbon"),c=this.range,l=c.min,u=c.max,f=this.ribbonBBox,h=f.x,d=f.y,p=this.ribbonShape,y=p.length,g=p.size,v=Dp({transform:"translate(".concat(h,", ").concat(d,")"),length:y,size:g,type:r,orientation:i,color:o,block:a,partition:n.map((function(t){return(t.value-l)/(u-l)})),range:this.ribbonRange},s);this.ribbon=t.maybeAppendByClassName(pm.ribbon,(function(){return new Om({style:v})})).update(v)},e.prototype.getHandleClassName=function(t){return"".concat(pm.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=sy(this.attributes,"handle"),i=(0,We.CR)(this.selection,2),o=i[0],a=i[1],s=(0,We.pi)((0,We.pi)({},r),{orientation:n}),c=r.shape,l="basic"===(void 0===c?"slider":c)?um:Qv,u=this;this.handlesGroup.selectAll(pm.handle.class).data(e?[{value:o,type:"start"},{value:a,type:"end"}]:[],(function(t){return t.type})).join((function(t){return t.append((function(){return new l({style:s})})).attr("className",(function(t){var e=t.type;return"".concat(pm.handle," ").concat(u.getHandleClassName(e))})).each((function(t){var e=t.type,n=t.value;this.update({labelText:n});var r="".concat(e,"Handle");u[r]=this,this.addEventListener("pointerdown",u.onDragStart(e))}))}),(function(t){return t.update(s).each((function(t){var e=t.value;this.update({labelText:e})}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");u[n]=void 0})).remove()}))},e.prototype.adjustHandles=function(){var t=(0,We.CR)(this.selection,2),e=t[0],n=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",n)},Object.defineProperty(e.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new Tg(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,n=t.height,r=this.endHandle.getBBox(),i=r.width,o=r.height,a=(0,We.CR)([Math.max(e,i),Math.max(n,o)],2),s=a[0],c=a[1];return this.cacheHandleBBox=new Tg(0,0,s,c),this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,n=t.height,r=(0,We.CR)(this.ifHorizontal([n,e],[e,n]),2);return{width:e,height:n,size:r[0],length:r[1]}},enumerable:!1,configurable:!0}),e.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,o=r.y,a=this.ribbonShape.size,s=this.getOffset(e),c=(0,We.CR)(this.ifHorizontal([i+s,o+a*this.handleOffsetRatio],[i+a*this.handleOffsetRatio,o+s]),2),l=c[0],u=c[1],f=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null==f||f.update({transform:"translate(".concat(l,", ").concat(u,")"),formatter:n})},e.prototype.renderIndicator=function(t){var e=sy(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(pm.indicator,(function(){return new Hv({})})).update(e)},Object.defineProperty(e.prototype,"labelData",{get:function(){var t=this;return this.attributes.data.reduce((function(e,n,r,i){var o,a,s=null!==(o=null==n?void 0:n.id)&&void 0!==o?o:r.toString();if(e.push((0,We.pi)((0,We.pi)({},n),{id:s,index:r,type:"value",label:null!==(a=null==n?void 0:n.label)&&void 0!==a?a:n.value.toString(),value:t.ribbonScale.map(n.value)})),rg&&(y=(i=(0,We.CR)([g,y],2))[0],g=i[1]),v>s-a?[a,s]:ys?d===s&&h===y?[y,s]:[s-v,s]:[y,g]}([f,h],[c,l],this.selection),2),c=r[0],l=r[1],this.update({defaultValue:[c,l]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var t=this.attributes.step,e=void 0===t?1:t,n=this.range,r=n.min,i=n.max;return Cn(e)?Zv(.01*(i-r),0):e},enumerable:!1,configurable:!0}),e.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,r=e.block,i=this.range.min;return r?ym(n.map((function(t){return t.value})),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)},e.prototype.getValueByCanvasPoint=function(t){var e=this.range,n=e.min,r=e.max,i=(0,We.CR)(this.ribbon.node().getPosition(),2),o=i[0],a=i[1],s=this.ifHorizontal(o,a),c=this.ifHorizontal.apply(this,(0,We.ev)([],(0,We.CR)(Wv(t)),!1))-s;return Ze(this.getOffset(c,!0),n,r)},e.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,o=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,i],range:[0,o]}),e?a.invert(t):a.map(t)},e.prototype.getRealSelection=function(t){var e=this.range.max,n=(0,We.CR)(t,2),r=n[0],i=n[1];return this.ifHorizontal([r,i],[e-i,e-r])},e.prototype.getRealValue=function(t){var e=this.range.max;return this.ifHorizontal(t,e-t)},e.prototype.dispatchSelection=function(){var t=this.getRealSelection(this.selection),e=new ec("valuechange",{detail:{value:t}});this.dispatchEvent(e)},e.prototype.dispatchIndicated=function(t,e){var n=this,r=this.range.max,i=this.ifHorizontal((function(){return{value:t,range:e}}),(function(){return{value:r-t,range:e?n.getRealSelection(e):void 0}})),o=new ec("indicate",{detail:i});this.dispatchEvent(o)},e}(Zp);class _m extends zg{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:cv}}map(t){const[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){const[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){const{tickMethod:t,domain:e,tickCount:n}=this.options,[r,i]=e;return De(r)&&De(i)?t(r,i,n):[]}clone(){return new _m(this.options)}}class Mm extends zg{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!Kg(t))return this.options.unknown;const e=$g(this.thresholds,t,0,this.n);return this.options.range[e]}invert(t){const{range:e}=this.options,n=e.indexOf(t),r=this.thresholds;return[r[n-1],r[n]]}clone(){return new Mm(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}function Em(t){return Fe(t)?0:ip(t)?t.length:Object.keys(t).length}var Sm=function(t,e){if(!ip(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i=0&&(c=1),1-s/(a-1)-n+c}function Cm(t,e,n){const r=Em(e);return 1-Sm(e,t)/(r-1)-n+1}function Rm(t,e,n,r,i,o){const a=(t-1)/(o-i),s=(e-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function Lm(t,e){return t>=e?2-(t-1)/(e-1):1}function Nm(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function Im(t,e,n){const r=e-t;if(n>r){return 1-((n-r)/2)**2/(.1*r)**2}return 1}const Dm=(t,e,n=5,r=!0,i=jm,o=[.25,.2,.5,.05])=>{const a=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return[];if(e-t<1e-15||1===a)return[t];const s={score:-2,lmin:0,lmax:0,lstep:0};let c=1;for(;c<1/0;){for(let n=0;ns.score&&(!r||n<=t&&d>=e)&&(s.lmin=n,s.lmax=d,s.lstep=p,s.score=x)}}d+=1}f+=1}}c+=1}const l=Am(s.lmax),u=Am(s.lmin),f=Am(s.lstep),h=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-u)/f))+1,d=new Array(h);d[0]=Am(u);for(let t=1;tt-e));const i=[];for(let t=1;t({value:e/t,label:String(e)})}(r);return Object.assign(Object.assign({},t),{color:i,data:[n,...o,r].map(a)})}function $m(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],ep(e)];return[n,r]}function Gm(t,e,n,r,i,o){const{length:a}=t,s=n||r,c=i.color?o.legendContinuous.ribbonFill||"black":o.color,l=e||function(t,e){const n=t.getOptions(),r=t.clone();return r.update(Object.assign(Object.assign({},n),{range:[_o(e).toString()]})),r}(s,c),[u,f]=$m(l),[h,d]=$m([e,n,r].filter((t=>void 0!==t)).find((t=>!(t instanceof _m))));return Object.assign(Object.assign({},t),{domain:[h,d],data:l.getTicks().map((t=>({value:t}))),color:new Array(Math.floor(a)).fill(0).map(((t,e)=>{const n=(f-u)/(a-1)*e+u,i=l.map(n)||c,o=r?r.map(n):1;return i.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,((t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${o})`))}))})}function Hm(t,e,n,r,i,o){const a=_v(t,"color"),s=function(t,e,n){const{size:r}=e,i=Ev(t,e,n);return function(t,e,n){return t.size=e,function(t){return"horizontal"===t||0===t}(n)?t.height=e:t.width=e,t}(i,r,i.orientation)}(n,r,i);if(a instanceof Mm){const{range:t}=a.getOptions(),[e,n]=$m(a);return a instanceof Bm||a instanceof zm?Wm(s,a,e,n,t):function(t,e,n){const r=[-1/0,...e.thresholds,1/0].map(((t,e)=>({value:e,label:t})));return Object.assign(Object.assign({},t),{data:r,color:n,labelFilter:(t,e)=>e>0&&e{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,style:c,crossPadding:l,padding:u}=t,f=Zm(t,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:r,value:i,theme:a,scale:l})=>{const{bbox:u}=i,{x:h,y:d,width:p,height:y}=u,g=wv(o,n),{legendContinuous:v={}}=a,m=Sv(Object.assign({},v,Object.assign(Object.assign({titleText:xv(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>Vd(e)(t.label):e},Hm(r,l,i,t,qm,a)),c),f)),b=new Ov({style:Object.assign(Object.assign({x:h,y:d,width:p,height:y},g),{subOptions:m})});return b.appendChild(new km({className:"legend-continuous",style:m})),b}};qm.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const Ym=t=>(...e)=>qm(Object.assign({},{block:!0},t))(...e);Ym.props=Object.assign(Object.assign({},qm.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const Vm=t=>e=>{const{scales:n}=e,r=_v(n,"size");return qm(Object.assign({},{type:"size",data:r.getTicks().map(((t,e)=>({value:t,label:String(t)})))},t))(e)};Vm.props=Object.assign(Object.assign({},qm.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const Um=t=>Vm(Object.assign({},{block:!0},t));Um.props=Object.assign(Object.assign({},qm.props),{defaultPosition:"top",defaultOrientation:"horizontal"});var Xm=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);ie=>{const{width:n,height:r,depth:i,paddingLeft:o,paddingRight:a,paddingTop:s,paddingBottom:c,padding:l,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,margin:y,marginLeft:g,marginBottom:v,marginTop:m,marginRight:b,data:x,coordinate:w,theme:O,component:k,interaction:_,x:M,y:E,z:S,key:A,frame:j,labelTransform:P,parentKey:T,clip:C,viewStyle:R,title:L}=e,N=Xm(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:M,y:E,z:S,key:A,width:n,height:r,depth:i,padding:l,paddingLeft:o,paddingRight:a,paddingTop:s,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,paddingBottom:c,theme:O,coordinate:w,component:k,interaction:_,frame:j,labelTransform:P,margin:y,marginLeft:g,marginBottom:v,marginTop:m,marginRight:b,parentKey:T,clip:C,style:R},!t&&{title:L}),{marks:[Object.assign(Object.assign(Object.assign({},N),{key:`${A}-0`,data:x}),t&&{title:L})]})]};Km.props={};var Qm=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);iRh({},t(e,...n),e)}function tb(t){return(e,...n)=>Rh({},e,t(e,...n))}function eb(t,e){if(!t)return e;if(Array.isArray(t))return t;if(function(t){return!(t instanceof Date)&&"object"==typeof t}(t)){const{value:n=e}=t,r=Qm(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}return t}var nb=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);it=>{const{children:e}=t,n=nb(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:o={},legend:a={},encode:s={},transform:c=[]}=n,l=nb(n,["data","scale","axis","legend","encode","transform"]),u=e.map((t=>{var{data:e,scale:n={},axis:l={},legend:u={},encode:f={},transform:h=[]}=t,d=nb(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:eb(e,r),scale:Rh({},i,n),encode:Rh({},s,f),transform:[...c,...h],axis:!(!l||!o)&&Rh({},o,l),legend:!(!u||!a)&&Rh({},a,u)},d)}));return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};function ib([t,e],[n,r]){return[t-n,e-r]}function ob([t,e],[n,r]){return[t+n,e+r]}function ab([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function sb([t,e]){return Math.atan2(e,t)}function cb([t,e]){return sb([t,e])+Math.PI/2}function lb(t,e){const n=sb(t),r=sb(e);return n"y"===t||!0===t?e?180:90:e?90:0)(r,o),c=Jd(a),[l,u]=dv(c,(t=>a[t])),f=new lv({domain:[l,u],range:[0,100]}),h=t=>De(a[t])&&!Number.isNaN(a[t])?f.map(a[t]):0,d={between:e=>`${t[e]} ${h(e)}%`,start:e=>0===e?`${t[e]} ${h(e)}%`:`${t[e-1]} ${h(e)}%, ${t[e]} ${h(e)}%`,end:e=>e===t.length-1?`${t[e]} ${h(e)}%`:`${t[e]} ${h(e)}%, ${t[e+1]} ${h(e)}%`},p=c.sort(((t,e)=>h(t)-h(e))).map(d[i]||d.between).join(",");return`linear-gradient(${s}deg, ${p})`}function yb(t){const[e,n,r,i]=t;return[i,e,n,r]}function gb(t,e,n){const[r,i,,o]=vp(t)?yb(e):e,[a,s]=n,c=t.getCenter(),l=cb(ib(r,c)),u=cb(ib(i,c)),f=u===l&&a!==s?u+2*Math.PI:u;return{startAngle:l,endAngle:f-l>=0?f:2*Math.PI+f,innerRadius:ab(o,c),outerRadius:ab(r,c)}}function vb(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function mb(t,e){if(!mp(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function bb(t){if(1===t.length)return t[0];const[[e,n,r=0],[i,o,a=0]]=t;return[(e+i)/2,(n+o)/2,(r+a)/2]}function xb(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}rb.props={};Array.prototype.slice;function wb(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Ob(t){return function(){return t}}function kb(t){this._context=t}function _b(t){return new kb(t)}kb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};const Mb=Math.PI,Eb=2*Mb,Sb=1e-6,Ab=Eb-Sb;function jb(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return jb;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;eSb)if(Math.abs(u*s-c*l)>Sb&&i){let h=n-o,d=r-a,p=s*s+c*c,y=h*h+d*d,g=Math.sqrt(p),v=Math.sqrt(f),m=i*Math.tan((Mb-Math.acos((p+f-y)/(2*g*v)))/2),b=m/v,x=m/g;Math.abs(b-1)>Sb&&this._append`L${t+b*l},${e+b*u}`,this._append`A${i},${i},0,0,${+(u*h>l*d)},${this._x1=t+x*s},${this._y1=e+x*c}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),c=t+a,l=e+s,u=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Sb||Math.abs(this._y1-l)>Sb)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%Eb+Eb),f>Ab?this._append`A${n},${n},0,1,${u},${t-a},${e-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:f>Sb&&this._append`A${n},${n},0,${+(f>=Mb)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function Tb(){return new Pb}function Cb(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new Pb(e)}function Rb(t){return t[0]}function Lb(t){return t[1]}function Nb(t,e){var n=Ob(!0),r=null,i=_b,o=null,a=Cb(s);function s(s){var c,l,u,f=(s=wb(s)).length,h=!1;for(null==r&&(o=i(u=a())),c=0;c<=f;++c)!(c0&&(o=e),r<0&&(o=r),n>0&&(a=n),i<0&&(a=i),[o,a]}const Fb=Ib((t=>{const e=t.attributes,{className:n,class:r,transform:i,rotate:o,labelTransform:a,labelTransformOrigin:s,x:c,y:l,x0:u=c,y0:f=l,text:h,background:d,connector:p,startMarker:y,endMarker:g,coordCenter:v,innerHTML:m}=e,b=Db(e,["className","class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","text","background","connector","startMarker","endMarker","coordCenter","innerHTML"]);if(t.style.transform=`translate(${c}, ${l})`,[c,l,u,f].some((t=>!De(t))))return void t.children.forEach((t=>t.remove()));const x=ed(b,"background"),{padding:w}=x,O=Db(x,["padding"]),k=ed(b,"connector"),{points:_=[]}=k,M=Db(k,["points"]);let E;E=m?cd(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",m).call(hb,Object.assign({transform:a,transformOrigin:s},b)).node():cd(t).maybeAppend("text","text").style("zIndex",0).style("text",h).call(hb,Object.assign({textBaseline:"middle",transform:a,transformOrigin:s},b)).node();const S=cd(t).maybeAppend("background","rect").style("zIndex",-1).call(hb,function(t,e=[]){const[n=0,r=0,i=n,o=r]=e,a=t.parentNode,s=a.getEulerAngles();a.setEulerAngles(0);const{min:c,halfExtents:l}=t.getLocalBounds(),[u,f]=c,[h,d]=l;return a.setEulerAngles(s),{x:u-o,y:f-n,width:2*h+o+r,height:2*d+n+i}}(E,w)).call(hb,d?O:{}).node(),A=function(t,e,n,r,i=!0,o=!0){const a=t=>Nb()(t);if(!e[0]&&!e[1])return a([Bb(t),e]);if(!n.length)return a([[0,0],e]);const[s,c]=n,l=[...c],u=[...s];if(c[0]!==s[0]){const t=i?-4:4;l[1]=c[1],o&&!i&&(l[0]=Math.max(s[0],c[0]-t),c[1]s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.max(u[0],l[0]-t))),!o&&i&&(l[0]=Math.min(s[0],c[0]-t),c[1]>s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.min(u[0],l[0]-t))),o&&i&&(l[0]=Math.min(s[0],c[0]-t),c[1]=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n=o)&&(n=o,r=i);return r}function Zb(t,e,n,r){const i=e.length/2,o=e.slice(0,i),a=e.slice(i);let s=zb(o,((t,e)=>Math.abs(t[1]-a[e][1])));s=Math.max(Math.min(s,i-2),1);const c=t=>[o[t][0],(o[t][1]+a[t][1])/2],l=c(s),u=c(s-1),f=sb(ib(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}}function Wb(t,e,n,r){const{bounds:i}=n,[[o,a],[s,c]]=i,l=s-o,u=c-a,f=t=>{const{x:e,y:r}=t,i=id(n.x,l),s=id(n.y,u);return Object.assign(Object.assign({},t),{x:(i||e)+o,y:(s||r)+a})};return f("left"===t?{x:0,y:u/2,textAlign:"start",textBaseline:"middle"}:"right"===t?{x:l,y:u/2,textAlign:"end",textBaseline:"middle"}:"top"===t?{x:l/2,y:0,textAlign:"center",textBaseline:"top"}:"bottom"===t?{x:l/2,y:u,textAlign:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAlign:"start",textBaseline:"top"}:"top-right"===t?{x:l,y:0,textAlign:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAlign:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:l,y:u,textAlign:"end",textBaseline:"bottom"}:{x:l/2,y:u/2,textAlign:"center",textBaseline:"middle"})}function $b(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,c=r.getCenter(),l=gb(r,e,[i,o]),{innerRadius:u,outerRadius:f,startAngle:h,endAngle:d}=l,p="inside"===t?(h+d)/2:d,y=Hb(p,a,s),g=(()=>{const[n,r]=e,i=u+.5*(f-u),[o,a]="inside"===t?Gb(c,p,i):fb(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},g),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:y})}function Gb(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function Hb(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function qb(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=gb(r,e,[i,o]),{startAngle:f,endAngle:h}=u,d=r.getCenter(),p=(f+h)/2,y={textAlign:"center",textBaseline:"middle",rotate:Hb(p,a,s)},{innerRadius:g,outerRadius:v}=u,m=g+(v-g)*c+l,[b,x]=Gb(d,p,m);return Object.assign({x:b,y:x},y)}function Yb(t){return void 0===t?null:t}function Vb(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:Yb(o[0]),y:Yb(o[1])}}function Ub(t,e,n,r){const{bounds:i}=n;if(1===i.length)return Vb(0,0,n);return(bp(r)?$b:kp(r)?qb:Wb)(t,e,n,r)}function Xb(t,e,n){const r=gb(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function Kb(t,e,n){const r=gb(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function Qb(t,e,n,r){const{autoRotate:i,rotateToAlignArc:o,offset:a=0,connector:s=!0,connectorLength:c=a,connectorLength2:l=0,connectorDistance:u=0}=n,f=r.getCenter(),h=Kb(e,n,r),d=Math.sin(h)>0?1:-1,p=Hb(h,i,o),y={textAlign:d>0||bp(r)?"start":"end",textBaseline:"middle",rotate:p},g=Xb(e,n,r),v=g+(s?c:a),[[m,b],[x,w],[O,k]]=function(t,e,n,r,i){const[o,a]=Gb(t,e,n),[s,c]=Gb(t,e,r);return[[o,a],[s,c],[s+(Math.sin(e)>0?1:-1)*i,c]]}(f,h,g,v,s?l:0),_=s?+u*d:0,M=O+_,E={connector:s,connectorPoints:[[x-M,w-k],[O-M,k-k]]};return Object.assign(Object.assign({x0:m,y0:b,x:O+_,y:k},y),E)}function Jb(t,e,n,r){const{bounds:i}=n;if(1===i.length)return Vb(0,0,n);return(bp(r)?$b:kp(r)?Qb:Wb)(t,e,n,r)}function tx(t,e){return null==t||null==e?NaN:te?1:t>=e?0:NaN}function ex(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const r=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),r.sort(((t,n)=>{for(const r of e){const e=rx(r[t],r[n]);if(e)return e}}))):(n=t.map(n),r.sort(((t,e)=>rx(n[t],n[e])))),function(t,e){return Array.from(e,(e=>t[e]))}(t,r)}return t.sort(nx(n))}function nx(t=tx){if(t===tx)return rx;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function rx(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te?1:0)}function ix(t,e={}){const{labelHeight:n=14,height:r}=e,i=ex(t,(t=>t.y)),o=i.length,a=new Array(o);for(let t=0;t0;t--){const e=a[t],n=a[t-1];if(n.y1>e.y){s=!0,n.labels.push(...e.labels),a.splice(t,1),n.y1+=e.y1-e.y;const i=n.y1-n.y;n.y1=Math.max(Math.min(n.y1,r),i),n.y=n.y1-i}}}let c=0;for(const t of a){const{y:e,labels:r}=t;let o=e-n;for(const t of r){const e=i[c++],r=o+n-t;e.connectorPoints[0][1]-=r,e.y=o+n,o+=n}}}function ox(t,e){const n=ex(t,(t=>t.y)),{height:r,labelHeight:i=14}=e,o=Math.ceil(r/i);if(n.length<=o)return ix(n,e);const a=[];for(let t=0;tfunction(t,e,n){const{connectorLength:r,connectorLength2:i,connectorDistance:o}=e,a=ax(Qb(0,t,e,n),[]),s=n.getCenter(),c=Xb(t,e,n),l=Kb(t,e,n),u=c+r+i,f=Math.sin(l)>0?1:-1,h=s[0]+(u+ +o)*f,{x:d}=a,p=h-d;return a.x+=p,a.connectorPoints[0][0]-=p,a}(t,n,r))),{width:s,height:c}=r.getOptions(),l=a.filter((t=>t.xt.x>=s/2)),f=Object.assign(Object.assign({},i),{height:c});return ox(l,f),ox(u,f),a.forEach(((t,e)=>sx.set(o[e],t))),sx.get(e)}var lx=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i"polar"===t[0]));if(r)return Math.max(e,n)/2*r[4]}return 0}(r),h=f+i,d=cb([c-u[0],l-u[1]]),p=Math.sin(d)>0?1:-1,[y,g]=Gb(u,d,h);return s.x=y+(o+a)*p,s.y=g,s}var fx=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{coordinate:n,theme:r}=e,{render:i}=t;return(e,o,a,s)=>{const{text:c,x:l,y:u,transform:f="",transformOrigin:h,className:d=""}=o,p=fx(o,["text","x","y","transform","transformOrigin","className"]),y=hx(e,o,n,r,t,s),{rotate:g=0,transform:v=""}=y,m=fx(y,["rotate","transform"]);return cd(new Fb).call(hb,m).style("text",`${c}`).style("className",`${d} g2-label`).style("innerHTML",i?i(c,o.datum,o.index):void 0).style("labelTransform",`${v} rotate(${+g}) ${f}`.trim()).style("labelTransformOrigin",h).style("coordCenter",n.getCenter()).call(hb,p).node()}};dx.props={defaultMarker:"point"};var px=function(t,e){if(!ip(t))return t;for(var n=[],r=0;rt?1:e>=t?0:NaN}function gx(t){let e,n,r;function i(t,r,i=0,o=t.length){if(i>>1;n(t[e],r)<0?i=e+1:o=e}while(itx(t(e),n),r=(e,n)=>t(e)-n):(e=t===tx||t===yx?t:vx,n=t,r=t),{left:i,center:function(t,e,n=0,o=t.length){const a=i(t,e,n,o-1);return a>n&&r(t[a-1],e)>-r(t[a],e)?a-1:a},right:function(t,r,i=0,o=t.length){if(i>>1;n(t[e],r)<=0?i=e+1:o=e}while(it+a)),c=function(t,e,n){return Math.min(n,Math.max(e,t))}(wx(s,e)+o,0,i.length-1);return i[c]}function Ex(t,e,n){if(!e)return t.getOptions().domain;if(!_x(t)){const r=ex(e);if(!n)return r;const[i]=r,{range:o}=t.getOptions(),[a,s]=o,c=a>s?-1:1;return[i,t.invert(t.map(i)+c*n)]}const{domain:r}=t.getOptions(),i=e[0],o=r.indexOf(i);if(n){const t=o+Math.round(r.length*n);return r.slice(o,t)}const a=e[e.length-1],s=r.indexOf(a);return r.slice(o,s+1)}function Sx(t,e,n,r,i,o){const{x:a,y:s}=i,c=(t,e)=>{const[n,r]=o.invert(t);return[Mx(a,n,e),Mx(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[Ex(a,[l[0],u[0]]),Ex(s,[l[1],u[1]])]}function Ax(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}const jx=Math.abs,Px=Math.atan2,Tx=Math.cos,Cx=Math.max,Rx=Math.min,Lx=Math.sin,Nx=Math.sqrt,Ix=1e-12,Dx=Math.PI,Bx=Dx/2,Fx=2*Dx;function zx(t){return t>1?0:t<-1?Dx:Math.acos(t)}function Zx(t){return t>=1?Bx:t<=-1?-Bx:Math.asin(t)}function Wx(t){return t.innerRadius}function $x(t){return t.outerRadius}function Gx(t){return t.startAngle}function Hx(t){return t.endAngle}function qx(t){return t&&t.padAngle}function Yx(t,e,n,r,i,o,a,s){var c=n-t,l=r-e,u=a-i,f=s-o,h=f*c-u*l;if(!(h*hP*P+T*T&&(_=E,M=S),{cx:_,cy:M,x01:-u,y01:-f,x11:_*(i/w-1),y11:M*(i/w-1)}}function Ux(){var t=Wx,e=$x,n=Ob(0),r=null,i=Gx,o=Hx,a=qx,s=null,c=Cb(l);function l(){var l,u,f=+t.apply(this,arguments),h=+e.apply(this,arguments),d=i.apply(this,arguments)-Bx,p=o.apply(this,arguments)-Bx,y=jx(p-d),g=p>d;if(s||(s=l=c()),hIx)if(y>Fx-Ix)s.moveTo(h*Tx(d),h*Lx(d)),s.arc(0,0,h,d,p,!g),f>Ix&&(s.moveTo(f*Tx(p),f*Lx(p)),s.arc(0,0,f,p,d,g));else{var v,m,b=d,x=p,w=d,O=p,k=y,_=y,M=a.apply(this,arguments)/2,E=M>Ix&&(r?+r.apply(this,arguments):Nx(f*f+h*h)),S=Rx(jx(h-f)/2,+n.apply(this,arguments)),A=S,j=S;if(E>Ix){var P=Zx(E/f*Lx(M)),T=Zx(E/h*Lx(M));(k-=2*P)>Ix?(w+=P*=g?1:-1,O-=P):(k=0,w=O=(d+p)/2),(_-=2*T)>Ix?(b+=T*=g?1:-1,x-=T):(_=0,b=x=(d+p)/2)}var C=h*Tx(b),R=h*Lx(b),L=f*Tx(O),N=f*Lx(O);if(S>Ix){var I,D=h*Tx(x),B=h*Lx(x),F=f*Tx(w),z=f*Lx(w);if(yIx?j>Ix?(v=Vx(F,z,C,R,h,j,g),m=Vx(D,B,L,N,h,j,g),s.moveTo(v.cx+v.x01,v.cy+v.y01),jIx&&k>Ix?A>Ix?(v=Vx(L,N,D,B,f,-A,g),m=Vx(C,R,F,z,f,-A,g),s.lineTo(v.cx+v.x01,v.cy+v.y01),A0?a:a+x)+s,k=(w>0?b:b+w)+c,_=Math.abs(x)-(s+l),M=Math.abs(w)-(c+u),E=n?dp(_,v,1/0):dp(_,y,g),S=n?dp(M,y,g):dp(M,v,1/0),A=n?O:O-(E-_)/2,j=n?k-(S-M)/2:k-(S-M);return cd(t.createElement("rect",{})).style("x",A).style("y",j).style("width",E).style("height",S).style("radius",[d,p,h,f]).call(hb,m).node()}const{y:b,y1:x}=n,w=r.getCenter(),O=gb(r,e,[b,x]),k=Ux().cornerRadius(a).padAngle(o*Math.PI/180);return cd(t.createElement("path",{})).style("d",k(O)).style("transform",`translate(${w[0]}, ${w[1]})`).style("radius",a).style("inset",o).call(hb,m).node()}const Qx=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:o=!0}=t,a=Xx(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(e,r,l)=>{const{color:u,radius:f=0}=l,h=Xx(l,["color","radius"]),d=h.lineWidth||1,{stroke:p,radius:y=f,radiusTopLeft:g=y,radiusTopRight:v=y,radiusBottomRight:m=y,radiusBottomLeft:b=y,innerRadius:x=0,innerRadiusTopLeft:w=x,innerRadiusTopRight:O=x,innerRadiusBottomRight:k=x,innerRadiusBottomLeft:_=x,lineWidth:M=("stroke"===n||p?d:0),inset:E=0,insetLeft:S=E,insetRight:A=E,insetBottom:j=E,insetTop:P=E,minWidth:T,maxWidth:C,minHeight:R}=a,L=Xx(a,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth","minHeight"]),{color:N=u,opacity:I}=r,D=[i?g:w,i?v:O,o?m:k,o?b:_],B=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];vp(s)&&B.push(B.shift());const F=Object.assign(Object.assign({radius:y},Object.fromEntries(B.map(((t,e)=>[t,D[e]])))),{inset:E,insetLeft:S,insetRight:A,insetBottom:j,insetTop:P,minWidth:T,maxWidth:C,minHeight:R});return cd(Kx(c,e,r,s,F)).call(hb,h).style("fill","transparent").style(n,N).style(vb(t),I).style("lineWidth",M).style("stroke",void 0===p?N:p).call(hb,L).node()}};Qx.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Jx={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function tw(t,e){var n;return null!==(n=t.style[e])&&void 0!==n?n:Jx[e]}function ew(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>ew(t,e,n,r)))}function nw(t){ew(t,"visibility","hidden",!0)}function rw(t){ew(t,"visibility","visible",!0)}var iw=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i!t.__removed__))}function aw(t,e){return sw(t,e).flatMap((({container:t})=>ow(t)))}function sw(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function cw(t){return cd(t).select(`.${N}`).node()}function lw(t){if("g"===t.tagName)return t.getRenderBounds();const e=t.getGeometryBounds(),n=new _r;return n.setFromTransformedAABB(e,t.getWorldTransform()),n}function uw(t,e){const{offsetX:n,offsetY:r}=e,i=lw(t),{min:[o,a],max:[s,c]}=i;return ns||(rc)?null:[n-o,r-a]}function fw(t,e){const{offsetX:n,offsetY:r}=e,[i,o,a,s]=function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return[n,r,i,o]}(t);return[Math.min(a,Math.max(i,n))-i,Math.min(s,Math.max(o,r))-o]}function hw(t){return t=>t.__data__.color}function dw(t){return t=>t.__data__.x}function pw(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[gw(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(gw(i,r))[e]}}function yw(t,e=((t,e)=>t),n=((t,e,n)=>t.setAttribute(e,n))){const r="__states__",i="__ordinal__",o=o=>{const{[r]:a=[],[i]:s={}}=o,c=a.reduce(((e,n)=>Object.assign(Object.assign({},e),t[n])),s);if(0!==Object.keys(c).length){for(const[t,r]of Object.entries(c)){const i=tw(o,t),a=e(r,o);n(o,t,a),t in s||(s[t]=i)}o[i]=s}},a=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{a(t),t[r]=[...e],o(t)},removeState:(t,...e)=>{a(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}o(t)},hasState:(t,e)=>(a(t),-1!==t[r].indexOf(e))}}function gw(t,e){return`${t},${e}`}function vw(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[gw(t.key,e.key),e.state])))),r={};for(const t of e){const[e,i]=Array.isArray(t)?t:[t,{}];r[e]=n.reduce(((t,n)=>{const[r,o={}]=n,a=void 0===(s=o[e])||"object"==typeof s&&0===Object.keys(s).length?i:o[e];var s;for(const[e,n]of Object.entries(a)){const i=t[e],o=(t,e,o,a)=>{const s=gw(a.__data__.viewKey,a.__data__.markKey);return r!==s?null==i?void 0:i(t,e,o,a):"function"!=typeof n?n:n(t,e,o,a)};t[e]=o}return t}),{})}return r}function mw(t,e){const n=new Map(t.map(((t,e)=>[t,e]))),r=e?t.map(e):t;return(t,i)=>{if("function"!=typeof t)return t;const o=n.get(i);return t(e?e(i):i,o,r,i)}}function bw(t){var{link:e=!1,valueof:n=((t,e)=>t),coordinate:r}=t,i=iw(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const o=t=>t.__data__.points,a=(t,e)=>{const[,n,r]=t,[i,,,o]=e;return[n,i,o,r]};return[t=>{var e;if(t.length<=1)return;const r=ex(t,((t,e)=>{const{x:n}=t.__data__,{x:r}=e.__data__;return n-r}));for(let t=1;tn(t,c))),{fill:y=c.getAttribute("fill")}=p,g=iw(p,["fill"]),v=new dl({className:"element-link",style:Object.assign({d:s.toString(),fill:y,zIndex:-2},g)});null===(e=c.link)||void 0===e||e.remove(),c.parentNode.appendChild(v),c.link=v}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function xw(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(mp(n)){const{points:i}=t.__data__,[o,a]=vp(n)?yb(i):i,s=n.getCenter(),c=ib(o,s),l=ib(a,s),u=sb(c)+lb(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return vp(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function ww(t){var{document:e,background:n,scale:r,coordinate:i,valueof:o}=t,a=iw(t,["document","background","scale","coordinate","valueof"]);const s="element-background";if(!n)return[()=>{},()=>{}];const c=(t,e,n)=>{const r=t.invert(e),i=e+t.getBandWidth(r)/2,o=t.getStep(r)/2,a=o*n;return[i-o+a,i+o-a]},l=(t,n)=>{const{padding:o}=n,[a,s]=((t,e)=>{const{x:n}=r;if(!_x(n))return[0,1];const{__data__:i}=t,{x:o}=i,[a,s]=c(n,o,e);return[a,s]})(t,o),[l,u]=((t,e)=>{const{y:n}=r;if(!_x(n))return[0,1];const{__data__:i}=t,{y:o}=i,[a,s]=c(n,o,e);return[a,s]})(t,o),f=[[a,l],[s,l],[s,u],[a,u]].map((t=>i.map(t))),{__data__:h}=t,{y:d,y1:p}=h;return Kx(e,f,{y:d,y1:p},i,n)},u=(t,e)=>{const{transform:n="scale(1.2, 1.2)",transformOrigin:r="center center",stroke:i=""}=e,o=iw(e,["transform","transformOrigin","stroke"]),a=Object.assign({transform:n,transformOrigin:r,stroke:i},o),s=t.cloneNode(!0);for(const[t,e]of Object.entries(a))s.style[t]=e;return s};return[t=>{t.background&&t.background.remove();const e=Qd(a,(e=>o(e,t))),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,lineWidth:h=0}=e,d=iw(e,["fill","fillOpacity","zIndex","padding","lineWidth"]),p=Object.assign(Object.assign({},d),{fill:n,fillOpacity:i,zIndex:c,padding:f,lineWidth:h}),y=(()=>{const{x:t,y:e}=r;return[t,e].some(_x)})()?l:u,g=y(t,p);g.className=s,t.parentNode.parentNode.appendChild(g),t.background=g},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function Ow(t,e){const n=t.getRootNode().defaultView.getContextService().getDomElement();(null==n?void 0:n.style)&&(t.cursor=n.style.cursor,n.style.cursor=e)}function kw(t){Ow(t,t.cursor)}function _w(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function Mw(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Ew(t,e=!1){const n=px(t,(t=>!!t)).map(((t,e)=>[0===e?"M":"L",...t]));return e&&n.push(["Z"]),n}function Sw(t){return t.querySelectorAll(".element")}function Aw(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function jw(t,e){const{__data__:n}=t,{markKey:r,index:i,seriesIndex:o}=n,{markState:a}=e,s=Array.from(a.keys()).find((t=>t.key===r));if(s)return o?o.map((t=>s.data[t])):s.data[i]}function Pw(t,e,n,r=(t=>!0)){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:o}=i;if(!o)return;const{className:a}=o;if("plot"===a)return;const s=Aw(o,(t=>"element"===t.className));const c=function(t){return Aw(t,(t=>"component"===t.className))}(o),l=function(t){return Aw(t,(t=>"label"===t.className))}(o),u=s||c||l;if(!u)return;const{className:f,markType:h}=u,d=Object.assign(Object.assign({},i),{nativeEvent:!0});"element"===f?(d.data={data:jw(u,e)},n.emit(`element:${t}`,d),n.emit(`${h}:${t}`,d)):"label"===f?(d.data={data:u.attributes.datum},n.emit(`label:${t}`,d),n.emit(`${a}:${t}`,d)):(n.emit(`component:${t}`,d),n.emit(`${a}:${t}`,d))}}function Tw(){return(t,e,n)=>{const{container:r,view:i}=t,o=Pw(Id,i,n,(t=>1===t.detail)),a=Pw(Dd,i,n,(t=>2===t.detail)),s=Pw(xd,i,n),c=Pw(wd,i,n),l=Pw(Od,i,n),u=Pw(kd,i,n),f=Pw(_d,i,n),h=Pw(Md,i,n),d=Pw(Ed,i,n),p=Pw(Sd,i,n),y=Pw(Ad,i,n),g=Pw(jd,i,n),v=Pw(Pd,i,n),m=Pw(Td,i,n),b=Pw(Cd,i,n),x=Pw(Rd,i,n),w=Pw(Ld,i,n),O=Pw(Nd,i,n);return r.addEventListener("click",o),r.addEventListener("click",a),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",c),r.addEventListener("pointerup",l),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",h),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",y),r.addEventListener("dragstart",g),r.addEventListener("drag",v),r.addEventListener("dragend",m),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",O),()=>{r.removeEventListener("click",o),r.removeEventListener("click",a),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",c),r.removeEventListener("pointerup",l),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",h),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",y),r.removeEventListener("dragstart",g),r.removeEventListener("drag",v),r.removeEventListener("dragend",m),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",O)}}}Tw.props={reapplyWhenUpdate:!0};var Cw=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||Kh(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=Cw(t,["type"]);n||Kh("Plot type is required!");const o=r(n);return null==o?void 0:o(i,e)},r]}function Lw(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||Kh("Cannot find library document")}var Nw=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);it.type===e))}function Bw(t){return Dw(t,"polar").length>0}function Fw(t){return Dw(t,"transpose").length%2==1}function zw(t){return Dw(t,"theta").length>0}function Zw(t){return Dw(t,"radial").length>0}function Ww(t){for(var e=t.length/6|0,n=new Array(e),r=0;r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?xO(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?xO(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=lO.exec(t))?new kO(e[1],e[2],e[3],1):(e=uO.exec(t))?new kO(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=fO.exec(t))?xO(e[1],e[2],e[3],e[4]):(e=hO.exec(t))?xO(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=dO.exec(t))?jO(e[1],e[2]/100,e[3]/100,1):(e=pO.exec(t))?jO(e[1],e[2]/100,e[3]/100,e[4]):yO.hasOwnProperty(t)?bO(yO[t]):"transparent"===t?new kO(NaN,NaN,NaN,0):null}function bO(t){return new kO(t>>16&255,t>>8&255,255&t,1)}function xO(t,e,n,r){return r<=0&&(t=e=n=NaN),new kO(t,e,n,r)}function wO(t){return t instanceof nO||(t=mO(t)),t?new kO((t=t.rgb()).r,t.g,t.b,t.opacity):new kO}function OO(t,e,n,r){return 1===arguments.length?wO(t):new kO(t,e,n,null==r?1:r)}function kO(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function _O(){return"#".concat(AO(this.r)).concat(AO(this.g)).concat(AO(this.b))}function MO(){var t=EO(this.opacity);return"".concat(1===t?"rgb(":"rgba(").concat(SO(this.r),", ").concat(SO(this.g),", ").concat(SO(this.b)).concat(1===t?")":", ".concat(t,")"))}function EO(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function SO(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function AO(t){return((t=SO(t))<16?"0":"")+t.toString(16)}function jO(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new TO(t,e,n,r)}function PO(t){if(t instanceof TO)return new TO(t.h,t.s,t.l,t.opacity);if(t instanceof nO||(t=mO(t)),!t)return new TO;if(t instanceof TO)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,c=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n0&&c<1?0:a,new TO(a,s,c,t.opacity)}function TO(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function CO(t){return(t=(t||0)%360)<0?t+360:t}function RO(t){return Math.max(0,Math.min(1,t||0))}function LO(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function NO(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}tO(nO,mO,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:gO,formatHex:gO,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return PO(this).formatHsl()},formatRgb:vO,toString:vO}),tO(kO,OO,eO(nO,{brighter:function(t){return t=null==t?iO:Math.pow(iO,t),new kO(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?rO:Math.pow(rO,t),new kO(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},clamp:function(){return new kO(SO(this.r),SO(this.g),SO(this.b),EO(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:_O,formatHex:_O,formatHex8:function(){return"#".concat(AO(this.r)).concat(AO(this.g)).concat(AO(this.b)).concat(AO(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:MO,toString:MO})),tO(TO,(function(t,e,n,r){return 1===arguments.length?PO(t):new TO(t,e,n,null==r?1:r)}),eO(nO,{brighter:function(t){return t=null==t?iO:Math.pow(iO,t),new TO(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?rO:Math.pow(rO,t),new TO(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new kO(LO(t>=240?t-240:t+120,i,r),LO(t,i,r),LO(t<120?t+240:t-120,i,r),this.opacity)},clamp:function(){return new TO(CO(this.h),RO(this.s),RO(this.l),EO(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=EO(this.opacity);return"".concat(1===t?"hsl(":"hsla(").concat(CO(this.h),", ").concat(100*RO(this.s),"%, ").concat(100*RO(this.l),"%").concat(1===t?")":", ".concat(t,")"))}}));var IO=function(t){return function(){return t}};function DO(t,e){return function(n){return t+n*e}}function BO(t){return 1==(t=+t)?FO:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):IO(isNaN(e)?n:e)}}function FO(t,e){var n=e-t;return n?DO(t,n):IO(isNaN(t)?e:t)}(function t(e){var n=BO(e);function r(t,e){var r=n((t=OO(t)).r,(e=OO(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=FO(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r})(1);function zO(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=rZO(t[t.length-1])),$O=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Ww),GO=WO($O),HO=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Ww),qO=WO(HO),YO=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Ww),VO=WO(YO),UO=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Ww),XO=WO(UO),KO=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Ww),QO=WO(KO),JO=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Ww),tk=WO(JO),ek=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Ww),nk=WO(ek),rk=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Ww),ik=WO(rk),ok=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Ww),ak=WO(ok),sk=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Ww),ck=WO(sk),lk=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Ww),uk=WO(lk),fk=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Ww),hk=WO(fk),dk=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Ww),pk=WO(dk),yk=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Ww),gk=WO(yk),vk=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Ww),mk=WO(vk),bk=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Ww),xk=WO(bk),wk=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Ww),Ok=WO(wk),kk=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Ww),_k=WO(kk),Mk=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Ww),Ek=WO(Mk),Sk=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Ww),Ak=WO(Sk),jk=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Ww),Pk=WO(jk),Tk=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Ww),Ck=WO(Tk),Rk=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Ww),Lk=WO(Rk),Nk=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Ww),Ik=WO(Nk),Dk=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Ww),Bk=WO(Dk),Fk=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Ww),zk=WO(Fk),Zk=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Ww),Wk=WO(Zk);function $k(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"}var Gk=Math.PI/180,Hk=180/Math.PI,qk=-.14861,Yk=1.78277,Vk=-.29227,Uk=-.90649,Xk=1.97294,Kk=Xk*Uk,Qk=3.5172982438,Jk=-.6557636667999999;function t_(t){if(t instanceof n_)return new n_(t.h,t.s,t.l,t.opacity);t instanceof kO||(t=wO(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(Jk*r+Kk*e-Qk*n)/(Jk+Kk-Qk),o=r-i,a=(Xk*(n-i)-Vk*o)/Uk,s=Math.sqrt(a*a+o*o)/(Xk*i*(1-i)),c=s?Math.atan2(a,o)*Hk-120:NaN;return new n_(c<0?c+360:c,s,i,t.opacity)}function e_(t,e,n,r){return 1===arguments.length?t_(t):new n_(t,e,n,null==r?1:r)}function n_(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function r_(t){return function e(n){function r(e,r){var i=t((e=e_(e)).h,(r=e_(r)).h),o=FO(e.s,r.s),a=FO(e.l,r.l),s=FO(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}tO(n_,e_,eO(nO,{brighter:function(t){return t=null==t?iO:Math.pow(iO,t),new n_(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?rO:Math.pow(rO,t),new n_(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*Gk,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new kO(255*(e+n*(qk*r+Yk*i)),255*(e+n*(Vk*r+Uk*i)),255*(e+n*(Xk*r)),this.opacity)}}));r_((function(t,e){var n=e-t;return n?DO(t,n>180||n<-180?n-360*Math.round(n/360):n):IO(isNaN(t)?e:t)}));var i_=r_(FO),o_=i_(e_(300,.5,0),e_(-240,.5,1)),a_=i_(e_(-100,.75,.35),e_(80,1.5,.8)),s_=i_(e_(260,.75,.35),e_(80,1.5,.8)),c_=e_();function l_(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return c_.h=360*t-100,c_.s=1.5-1.5*e,c_.l=.8-.9*e,c_+""}var u_=OO(),f_=Math.PI/3,h_=2*Math.PI/3;function d_(t){var e;return t=(.5-t)*Math.PI,u_.r=255*(e=Math.sin(t))*e,u_.g=255*(e=Math.sin(t+f_))*e,u_.b=255*(e=Math.sin(t+h_))*e,u_+""}function p_(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"}function y_(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var g_=y_(Ww("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),v_=y_(Ww("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),m_=y_(Ww("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),b_=y_(Ww("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function x_(t,e,n,r,i,a){const{guide:s={}}=n,c=function(t,e,n){const{type:r,domain:i,range:o,quantitative:a,ordinal:s}=n;if(void 0!==r)return r;if(function(t){return I_(t,od)}(e))return"identity";if("string"==typeof o)return"linear";if((i||o||[]).length>2)return T_(t,s);if(void 0!==i)return L_([i])?T_(t,s):N_(e)?"time":C_(t,o,a);return L_(e)?T_(t,s):N_(e)?"time":C_(t,o,a)}(t,e,n);if("string"!=typeof c)return n;const l=function(t,e,n,r){const{domain:i}=r;if(void 0!==i)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return R_(function(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const e of t)for(const t of e)Jh(t)&&(r=Math.min(r,+t),i=Math.max(i,+t));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}(n,r),r);case"band":case"ordinal":case"point":return function(t){return Array.from(new Set(t.flat()))}(n);case"quantile":return function(t){return t.flat().sort()}(n);case"sequential":return R_(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)Jh(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(c,0,e,n),u=function(t,e,n){const{ratio:r}=n;if(null==r)return e;if(S_({type:t}))return function(t,e,n){const r=t.map(Number),i=new lv({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return"time"===n?t.map((t=>new Date(i.map(t)))):t.map((t=>i.map(t)))}(e,r,t);return A_({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(c,l,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=Ug,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}(0,r);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});const i=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?zw(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:o=i,paddingOuter:a=i}=r;return Object.assign(Object.assign({},r),{paddingInner:o,paddingOuter:a,padding:i,unknown:NaN})}(t,e,i,r);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=Bd(e),i=o[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?t=>i(n(t)):i}}(r);default:return r}}(c,t,0,n,r)),{domain:u,range:j_(c,t,e,n,u,i,a),expectedDomain:l,guide:s,name:t,type:c})}function w_(t,e){const n={};for(const r of t){const{values:t,name:i}=r,o=e[i];for(const e of t){const{name:t,value:r}=e;n[t]=r.map((t=>o.map(t)))}}return n}function O_(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:e}=r.getOptions();if(e in t){const i=n.filter((t=>t.startsWith(e))).map((t=>+(t.replace(e,"")||0))),o=cp(i)+1,a=`${e}${o}`;t[a]=r,r.getOptions().key=a}else t[e]=r}return t}function k_(t,e){const[n]=Rw("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[Vh,Vh];let e,n;return[r=>{var i;e=r.map.bind(r),n=null===(i=r.invert)||void 0===i?void 0:i.bind(r);const o=t.filter((([t])=>"function"==typeof t)),a=t.filter((([t])=>"function"!=typeof t)),s=new Map(a);if(r.map=t=>{for(const[e,n]of o)if(e(t))return n;return s.has(t)?s.get(t):e(t)},!n)return r;const c=new Map(a.map((([t,e])=>[e,t]))),l=new Map(o.map((([t,e])=>[e,t])));return r.invert=t=>l.has(t)?t:c.has(t)?c.get(t):n(t),r},t=>(null!==e&&(t.map=e),null!==n&&(t.invert=n),t)]}(r);return i(n(t))}function __(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));E_(e,"x"),E_(e,"y")}function M_(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return 0!==e.length?e:"axisX"===n?["x"]:"axisY"===n?["y"]:"legends"===n?Object.keys(r).filter((t=>i.includes(t))):[]}function E_(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(S_)?dv(r):n.every(A_)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function S_(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function A_(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function j_(t,e,n,r,i,o,a){const{range:s}=r;if("string"==typeof s)return function(t){return t.split("-")}(s);if(void 0!==s)return s;const{rangeMin:c,rangeMax:l}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const t=P_(n,r,i,o,a),[s,u]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[tp(e),ep(e)]:"opacity"===t?[0,1]:"size"===t?[1,10]:[0,1]}(e,t);return[null!=c?c:s,null!=l?l:u]}case"band":case"point":return[null!=c?c:"size"===e?5:0,null!=l?l:"size"===e?10:1];case"ordinal":return P_(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function P_(t,e,n,r,i){const[a]=Rw("palette",i),{category10:s,category20:c}=r,l=function(t){return Array.from(new Set(t))}(n).length<=s.length?s:c,{palette:u=l,offset:f}=e;if(Array.isArray(u))return u;try{return a({type:u})}catch(t){const e=function(t,e,n=(t=>t)){if(!t)return null;const r=Bd(t),i=o[`scheme${r}`],a=o[`interpolate${r}`];if(!i&&!a)return null;if(i){if(!i.some(Array.isArray))return i;const t=i[e.length];if(t)return t}return e.map(((t,r)=>a(n(r/e.length))))}(u,n,f);if(e)return e;throw new Error(`Unknown Component: ${u} `)}}function T_(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function C_(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function R_(t,e){if(0===t.length)return t;const{domainMin:n,domainMax:r}=e,[i,o]=t;return[null!=n?n:i,null!=r?r:o]}function L_(t){return I_(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function N_(t){return I_(t,(t=>t instanceof Date))}function I_(t,e){for(const n of t)if(n.some(e))return!0;return!1}const D_={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},B_={threshold:"threshold",quantize:"quantize",quantile:"quantile"},F_={ordinal:"ordinal",band:"band",point:"point"},z_={constant:"constant"};var Z_=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);inull!==t)),s=[],c=function(t,e,n){const[,r]=Rw("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?Fw(n)?`${e}Y`:`${e}X`:"y"===t?Fw(n)?`${e}X`:`${e}Y`:null}(e,t,i);if(!o||!a)return;const{props:s}=r(a),{defaultPosition:c,defaultSize:l,defaultOrder:u,defaultCrossPadding:[f]}=s;return Object.assign(Object.assign({position:c,defaultSize:l,order:u,type:a,crossPadding:f},o),{scales:[n]})}return e.filter((t=>t.slider||t.scrollbar)).flatMap((t=>{const{slider:e,scrollbar:n,name:r}=t;return[o("slider",r,t,e),o("scrollbar",r,t,n)]})).filter((t=>!!t))}(e,t,n);if(s.push(...c),i){const{props:t}=o("title"),{defaultPosition:e,defaultOrientation:n,defaultOrder:r,defaultSize:a,defaultCrossPadding:c}=t,l="string"==typeof i?{title:i}:i;s.push(Object.assign({type:"title",position:e,orientation:n,order:r,crossPadding:c[0],defaultSize:a},l))}const l=function(t,e){const n=t.filter((t=>function(t){if(!t||!t.type)return!1;if("function"==typeof t.type)return!0;const{type:e,domain:n,range:r,interpolator:i}=t,o=n&&n.length>0,a=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&o&&a)||!(!["sequential"].includes(e)||!o||!a&&!i)||!(!["constant","identity"].includes(e)||!a)}(t)));return[...H_(n,e),...Y_(n,e)]}(a,r);return l.forEach((([t,e])=>{const{props:n}=o(t),{defaultPosition:i,defaultPlane:c="xy",defaultOrientation:l,defaultSize:u,defaultOrder:f,defaultLength:h,defaultPadding:d=[0,0],defaultCrossPadding:p=[0,0]}=n,y=Rh({},...e),{guide:g,field:v}=y,m=Array.isArray(g)?g:[g];for(const n of m){const[o,y]=X_(t,i,l,n,e,a,r);if(!o&&!y)continue;const g="left"===o||"right"===o,m=g?d[1]:d[0],b=g?p[1]:p[0],{size:x,order:w=f,length:O=h,padding:k=m,crossPadding:_=b}=n;s.push(Object.assign(Object.assign({title:v},n),{defaultSize:u,length:O,position:o,plane:c,orientation:y,padding:k,order:w,crossPadding:_,size:x,type:t,scales:e}))}})),s}function $_(t,e,n,r,i){const[o]=Rw("component",r),{scaleInstances:a,scale:s,bbox:c}=t,l={bbox:c,library:r};return o(Z_(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:a,theme:n,value:l,scale:s})}function G_(t,e){const n=["left","right","bottom","top"],r=Zh(t,(({type:t,position:e,group:r})=>n.includes(e)?void 0===r?t.startsWith("legend")?`legend-${e}`:Symbol("independent"):"independent"===r?Symbol("independent"):r:Symbol("independent")));return r.flatMap((([,t])=>{if(1===t.length)return t[0];if(void 0!==e){const n=t.filter((t=>void 0!==t.length)).map((t=>t.length)),r=sp(n);if(r>e)return t.forEach((t=>t.group=Symbol("independent"))),t;const i=(e-r)/(t.length-n.length);t.forEach((t=>{void 0===t.length&&(t.length=i)}))}const n=cp(t,(t=>t.size)),r=cp(t,(t=>t.order)),i=cp(t,(t=>t.crossPadding));return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}}))}function H_(t,e){const n=["shape","size","color","opacity"],r=t.filter((({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!((t,e)=>"constant"===t&&"size"===e)(t,e))),i=r.filter((({type:t})=>"constant"===t)),o=Zh(r.filter((({type:t})=>"constant"!==t)),(t=>t.field?t.field:Symbol("independent"))).map((([t,e])=>[t,[...e,...i]])).filter((([,t])=>t.some((t=>"constant"!==t.type)))),a=new Map(o);if(0===a.size)return[];const s=t=>t.sort((([t],[e])=>t.localeCompare(e))),c=Array.from(a).map((([,t])=>{const e=function(t){if(1===t.length)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...rp(t,n));return e}(t).sort(((t,e)=>e.length-t.length)),n=e.map((t=>({combination:t,option:t.map((t=>[t.name,q_(t)]))})));for(const{option:t,combination:e}of n)if(!t.every((t=>"constant"===t[1]))&&t.every((t=>"discrete"===t[1]||"constant"===t[1])))return["legendCategory",e];for(const[t,e]of yp)for(const{option:r,combination:i}of n)if(e.some((t=>ap(s(t),s(r)))))return[t,i];return null})).filter(Jh);return c}function q_(t){const{type:e}=t;return"string"!=typeof e?null:e in D_?"continuous":e in F_?"discrete":e in B_?"distribution":e in z_?"constant":null}function Y_(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return Dw(t,"helix").length>0}(e)||zw(e))return null;if(Fw(e)&&(Bw(e)||Zw(e)))return null;if(n.startsWith("x"))return Bw(e)?["axisArc",[t]]:Zw(e)?["axisLinear",[t]]:[Fw(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return Bw(e)?["axisLinear",[t]]:Zw(e)?["axisArc",[t]]:[Fw(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(function(t){return Dw(t,"radar").length>0}(e))return["axisRadar",[t]];if(!Bw(e))return["axisY",[t]]}return null})).filter(Jh)}function V_(t){const e=Dw(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:n,endAngle:r}=lp(t);return[n,r]}const n=Dw(t,"radial");if(n.length){const t=n[n.length-1],{startAngle:e,endAngle:r}=fp(t);return[e,r]}return[-Math.PI/2,Math.PI/2*3]}function U_(t,e,n,r,i){const{name:o}=n[0];if("axisRadar"===t){const t=r.filter((t=>t.name.startsWith("position"))),e=function(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}(o);if(o===t.slice(-1)[0].name||null===e)return[null,null];const[n,a]=V_(i);return["center",(a-n)/(t.length-1)*e+n]}if("axisY"===t&&function(t){return Dw(t,"parallel").length>0}(i))return Fw(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=V_(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:Bw(i)||Zw(i)?["center",null]:"axisX"===t&&function(t){return Dw(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return Dw(t,"reflectY").length>0}(i)?["top",null]:e}function X_(t,e,n,r,i,o,a){const[s]=V_(a),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?U_(t,c,i,o,a):"string"==typeof t&&t.startsWith("legend")&&Bw(a)&&"center"===r.position?["center","vertical"]:c}function K_(t,e,n,r,i,o){const{type:a}=t;if(!["left","right","bottom","top"].includes(r))return;if("string"!=typeof a)return;const s=a;return(s.startsWith("axis")?nM:s.startsWith("group")?Q_:s.startsWith("legendContinuous")?rM:"legendCategory"===s?iM:s.startsWith("slider")?eM:"title"===s?tM:s.startsWith("scrollbar")?J_:()=>{})(t,e,n,r,i,o)}function Q_(t,e,n,r,i,o){const{children:a}=t,s=cp(a,(t=>t.crossPadding));a.forEach((t=>t.crossPadding=s)),a.forEach((t=>K_(t,e,n,r,i,o)));const c=cp(a,(t=>t.size));t.size=c,a.forEach((t=>t.size=c))}function J_(t,e,n,r,i,o){const{trackSize:a=6}=Rh({},i.scrollbar,t);t.size=a}function tM(t,e,n,r,i,o){const a=Rh({},i.title,t),{title:s,subtitle:c,spacing:l=0}=a,u=Z_(a,["title","subtitle","spacing"]);if(s){const e=uM(s,ed(u,"title"));t.size=e.height}if(c){const e=uM(c,ed(u,"subtitle"));t.size+=l+e.height}}function eM(t,e,n,r,i,o){const{trackSize:a,handleIconSize:s}=(()=>{const{slider:e}=i;return Rh({},e,t)})(),c=Math.max(a,2.4*s);t.size=c}function nM(t,e,n,r,i,o){var a;t.transform=t.transform||[{type:"hide"}];const s="left"===r||"right"===r,c=cM(t,r,i),{tickLength:l=0,labelSpacing:u=0,titleSpacing:f=0,labelAutoRotate:h}=c,d=Z_(c,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),p=oM(t,o),y=aM(d,p),g=l+u;if(y&&y.length){const r=cp(y,(t=>t.width)),i=cp(y,(t=>t.height));if(s)t.size=r+g;else{const{tickFilter:o,labelTransform:s}=t;!function(t,e,n,r,i){const o=sp(e,(t=>t.width));if(o>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=lM(t,i),c=s.map((t=>a.map(t)+function(t,e){if(!t.getBandWidth)return 0;const n=t.getBandWidth(e)/2;return n}(a,t))),l=s.map(((t,e)=>e)),u=-r[0],f=n+r[1],h=(t,e)=>{const{width:n}=e;return[t-n/2,t+n/2]};for(let t=0;tf)return!0;const o=c[t+1];if(o){const[n]=h(o,e[t+1]);if(i>n)return!0}}return!1}(p,y,e,n,o)||s||!1===h||null===h?(t.labelTransform=null!==(a=t.labelTransform)&&void 0!==a?a:"rotate(0)",t.size=i+g):(t.labelTransform="rotate(90)",t.size=r+g)}}else t.size=l;const v=sM(d);v&&(t.size+=s?f+v.width:f+v.height)}function rM(t,e,n,r,i,o){const a=(()=>{const{legendContinuous:e}=i;return Rh({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=a,l=Z_(a,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=ed(l,"ribbon"),{size:h}=f,d=ed(l,"handleIcon"),{size:p}=d,y=Math.max(h,2.4*p);t.size=y;const g=aM(l,oM(t,o));if(g){const e=u?"width":"height",n=cp(g,(t=>t[e]));t.size+=n+s}const v=sM(l);v&&(u?t.size=Math.max(t.size,v.width):t.size+=c+v.height)}function iM(t,e,n,r,i,o){const a=(()=>{const{legendCategory:e}=i,{title:n}=t,[r,o]=Array.isArray(n)?[n,void 0]:[void 0,n];return Rh({title:r},e,Object.assign(Object.assign({},t),{title:o}))})(),{itemSpacing:s,itemMarkerSize:c,titleSpacing:l,rowPadding:u,colPadding:f,maxCols:h=1/0,maxRows:d=1/0}=a,p=Z_(a,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:y,length:g}=t,v=t=>Math.min(t,d),m=t=>Math.min(t,h),b="left"===r||"right"===r,x=void 0===g?e+(b?0:n[0]+n[1]):g,w=sM(p),O=aM(p,oM(t,o),"itemLabel"),k=Math.max(O[0].height,c)+u,_=(t,e=0)=>c+t+s[0]+e;b?(()=>{let e=-1/0,n=0,r=1,i=0,o=-1/0,a=-1/0;const s=w?w.height:0,c=x-s;for(const{width:t}of O){const s=_(t,f);e=Math.max(e,s),n+k>c?(r++,o=Math.max(o,i),a=Math.max(a,n),i=1,n=k):(n+=k,i++)}r<=1&&(o=i,a=n),t.size=e*m(r),t.length=a+s,Rh(t,{cols:m(r),gridRow:o})})():"number"==typeof y?(()=>{const e=Math.ceil(O.length/y),n=cp(O,(t=>_(t.width)))*y;t.size=k*v(e)-u,t.length=Math.min(n,x)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of O){const i=_(t,f);n+i>x?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=k*v(e)-u,t.length=r})(),w&&(b?t.size=Math.max(t.size,w.width):t.size+=l+w.height)}function oM(t,e){const[n]=Rw("scale",e),{scales:r,tickCount:i,tickMethod:o}=t,a=r.find((t=>"constant"!==t.type&&"identity"!==t.type));return void 0!==i&&(a.tickCount=i),void 0!==o&&(a.tickMethod=o),n(a)}function aM(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:o=!0}=t,a=Z_(t,["labelFormatter","tickFilter","label"]);if(!o)return null;const s=function(t,e,n){const r=lM(t,n),i=r.map((t=>"number"==typeof t?pp(t):t)),o=e?"string"==typeof e?Vd(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(o)}(e,r,i),c=ed(a,n),l=s.map(((t,e)=>Object.fromEntries(Object.entries(c).map((([n,r])=>[n,"function"==typeof r?r(t,e):r]))))),u=s.map(((t,e)=>uM(t,l[e]))),f=l.some((t=>t.transform));if(!f){const e=s.map(((t,e)=>e));t.indexBBox=new Map(e.map((t=>[t,[s[t],u[t]]])))}return u}function sM(t){const{title:e}=t,n=Z_(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=ed(n,"title"),{direction:i,transform:o}=r,a=Array.isArray(e)?e.join(","):e;if("string"!=typeof a)return null;return uM(a,Object.assign(Object.assign({},r),{transform:o||("vertical"===i?"rotate(-90)":"")}))}function cM(t,e,n){const{title:r}=t,[i,o]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:a,[`axis${Xh(e)}`]:s}=n;return Rh({title:i},a,s,Object.assign(Object.assign({},t),{title:o}))}function lM(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function uM(t,e){const n=function(t){return t instanceof el?t:new xl({style:{text:`${t}`}})}(t),{filter:r}=e,i=Z_(e,["filter"]);n.attr(Object.assign(Object.assign({},i),{visibility:"none"}));return n.getBBox()}function fM(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function hM(t,e,n,r){var i,o;const{width:a,height:s,depth:c,x:l=0,y:u=0,z:f=0,inset:h=(null!==(i=n.inset)&&void 0!==i?i:0),insetLeft:d=h,insetTop:p=h,insetBottom:y=h,insetRight:g=h,margin:v=(null!==(o=n.margin)&&void 0!==o?o:0),marginLeft:m=v,marginBottom:b=v,marginTop:x=v,marginRight:w=v,padding:O=n.padding,paddingBottom:k=O,paddingLeft:_=O,paddingRight:M=O,paddingTop:E=O}=function(t,e,n,r){const{coordinates:i}=e;if(!Bw(i)&&!Zw(i))return e;const o=t.filter((t=>"string"==typeof t.type&&t.type.startsWith("axis")));if(0===o.length)return e;const a=o.map((t=>cM(t,"axisArc"===t.type?"arc":"linear",n))),s=cp(a,(t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0})),c=o.flatMap(((t,e)=>aM(a[e],oM(t,r)))).filter(Jh),l=cp(c,(t=>t.height))+s,u=o.flatMap(((t,e)=>sM(a[e]))).filter((t=>null!==t)),f=0===u.length?0:cp(u,(t=>t.height)),{inset:h=l,insetLeft:d=h,insetBottom:p=h,insetTop:y=h+f,insetRight:g=h}=e;return Object.assign(Object.assign({},e),{insetLeft:d,insetBottom:p,insetTop:y,insetRight:g})}(t,e,n,r),S=(t,n,r,i,o)=>{const{marks:a}=e;if(0===a.length)return[i,o];if(t-i-o-.25*t>0)return[i,o];const s=.75*t;return["auto"===n?s*i/(i+o):i,"auto"===r?s*o/(i+o):o]},A=t=>"auto"===t?20:null!=t?t:20,j=A(E),P=A(k),T=dM(t,s-j-P,[j+x,P+b],["left","right"],e,n,r),{paddingLeft:C,paddingRight:R}=T,L=a-m-w,[N,I]=S(L,_,M,C,R),D=L-N-I,B=dM(t,D,[N+m,I+w],["bottom","top"],e,n,r),{paddingTop:F,paddingBottom:z}=B,Z=s-b-x,[W,$]=S(Z,k,E,z,F);return{width:a,height:s,depth:c,insetLeft:d,insetTop:p,insetBottom:y,insetRight:g,innerWidth:D,innerHeight:Z-W-$,paddingLeft:N,paddingRight:I,paddingTop:$,paddingBottom:W,marginLeft:m,marginBottom:b,marginTop:x,marginRight:w,x:l,y:u,z:f}}function dM(t,e,n,r,i,o,a){const s=zh(t,(t=>t.position)),{padding:c=o.padding,paddingLeft:l=c,paddingRight:u=c,paddingBottom:f=c,paddingTop:h=c}=i,d={paddingBottom:f,paddingLeft:l,paddingTop:h,paddingRight:u};for(const t of r){const r=`padding${Xh(xb(t))}`,i=s.get(t)||[],c=d[r],l=t=>{void 0===t.size&&(t.size=t.defaultSize)},u=t=>{"group"===t.type?(t.children.forEach(l),t.size=cp(t.children,(t=>t.size))):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(K_(r,e,n,t,o,a),l(r)))},h=t=>{t.type.startsWith("axis")&&void 0===t.labelAutoHide&&(t.labelAutoHide=!0)},p="bottom"===t||"top"===t,y=fM(i,(t=>t.order)),g=i.filter((t=>t.type.startsWith("axis")&&t.order==y));if(g.length&&(g[0].crossPadding=0),"number"==typeof c)i.forEach(l),i.forEach(h);else if(0===i.length)d[r]=0;else{const t=G_(i,p?e+n[0]+n[1]:e);t.forEach(f);const o=t.reduce(((t,{size:e,crossPadding:n=12})=>t+e+n),0);d[r]=o}}return d}function pM({width:t,height:e,paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:o,marginLeft:a,marginTop:s,marginBottom:c,marginRight:l,innerHeight:u,innerWidth:f,insetBottom:h,insetLeft:d,insetRight:p,insetTop:y}){const g=n+a,v=i+s,m=r+l,b=o+c,x=t-a-l,w=[g+d,v+y,f-d-p,u-y-h,"center",null,null];return{top:[g,0,f,v,"vertical",!0,tx,a,x],right:[t-m,v,m,u,"horizontal",!1,tx],bottom:[g,e-b,f,b,"vertical",!1,tx,a,x],left:[0,v,g,u,"horizontal",!0,tx],"top-left":[g,0,f,v,"vertical",!0,tx],"top-right":[g,0,f,v,"vertical",!0,tx],"bottom-left":[g,e-b,f,b,"vertical",!1,tx],"bottom-right":[g,e-b,f,b,"vertical",!1,tx],center:w,inner:w,outer:w}}function yM(t,e,n,r){const[i,o]=np(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return wp(t)&&mp(t)}(e)?function(t,e,n,r){const[i,o,a,s]=n;for(const e of t)e.bbox={x:i,y:o,width:a,height:s},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):mp(e)?function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n):wp(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter(((t,e)=>e%2==1)).map((t=>t+i));for(let e=0;ee%2==0)).map((t=>t+r));for(let e=0;enull==l?void 0:l(t.order,e.order)));const x=t=>"title"===t||"group"===t||t.startsWith("legend"),w=(t,e,n)=>void 0===n?e:x(t)?n:e,O=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=c?d+v:d;e"group"===t.type));for(const t of k){const{bbox:e,children:n}=t,r=e[m],i=r/n.length,o=n.reduce(((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t}),"flex-start"),a=n.map(((t,e)=>{const{length:r=i,padding:o=0}=t;return r+(e===n.length-1?0:o)})),s=r-sp(a),c="flex-start"===o?0:"center"===o?s/2:s;for(let t=0,r=e[p]+c;ti(t,n))),c=yield function(t){return t.reduce(((t,e)=>n=>Yh(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),Vh)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?Jd(c):[],Object.assign(Object.assign({},e),{data:l})]}))}function MM(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i={};for(const[t,e]of Object.entries(r))if(Array.isArray(e))for(let n=0;n{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return Jh(e)}(t))return t;const e=function(t,e){return"function"==typeof e?"transform":"string"==typeof e&&function(t,e){return!!Array.isArray(t)&&t.some((t=>void 0!==t[e]))}(t,e)?"field":"constant"}(i,t);return{type:e,value:t}}));return[t,Object.assign(Object.assign({},e),{encode:o})]}function SM(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=Qd(r,((t,e)=>{const{type:n}=t;return"constant"!==n||function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||"enterDelay"===t||"enterDuration"===t||"updateDelay"===t||"updateDuration"===t||"exitDelay"===t||"exitDuration"===t}(e)?t:Object.assign(Object.assign({},t),{constant:!0})}));return[t,Object.assign(Object.assign({},e),{encode:i})]}function AM(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=function(t){const[e]=Rw("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:DM(n)})}(o),s=Qd(r,(t=>a(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function jM(t,e,n){const{tooltip:r={}}=e;return ad(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:od(r)&&bM(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function PM(t,e,n){const{data:r,encode:i,tooltip:o={}}=e;if(ad(o))return[t,e];const a=e=>{if(!e)return e;if("string"==typeof e)return t.map((t=>({name:e,value:r[t][e]})));if(od(e)){const{field:n,channel:o,color:a,name:s=n,valueFormatter:c=(t=>t)}=e,l="string"==typeof c?Vd(c):c,u=o&&i[o],f=u&&i[o].field,h=s||f||o,d=[];for(const e of t){const t=n?r[e][n]:u?i[o].value[e]:null;d[e]={name:h,color:a,value:l(t)}}return d}if("function"==typeof e){const n=[];for(const o of t){const t=e(r[o],o,r,i);od(t)?n[o]=t:n[o]={value:t}}return n}return e},{title:s,items:c=[]}=o,l=OM(o,["title","items"]),u=Object.assign({title:a(s),items:Array.isArray(c)?c.map(a):[]},l);return[t,Object.assign(Object.assign({},e),{tooltip:u})]}function TM(t,e,n){const{encode:r}=e,i=OM(e,["encode"]);if(!r)return[t,e];const o=Object.entries(r),a=o.filter((([,t])=>{const{value:e}=t;return Array.isArray(e[0])})).flatMap((([e,n])=>{const r=[[e,new Array(t.length).fill(void 0)]],{value:i}=n,o=OM(n,["value"]);for(let n=0;n[t,Object.assign({type:"column",value:e},o)]))})),s=Object.fromEntries([...o,...a]);return[t,Object.assign(Object.assign({},i),{encode:s})]}function CM(t,e,n){const{axis:r={},legend:i={},slider:o={},scrollbar:a={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},c="object"==typeof r?Array.from(new Set(["x","y","z",...Object.keys(r)])):["x","y","z"];return Rh(e,{scale:Object.assign(Object.assign({},Object.fromEntries(c.map((t=>{const e=s(a,t);return[t,Object.assign({guide:s(r,t),slider:s(o,t),scrollbar:e},e&&{ratio:void 0===e.ratio?.5:e.ratio})]})))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function RM(t,e,n){const{animate:r}=e;return r||void 0===r||Rh(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}var LM=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))},NM=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);iJh(t))),(t=>t.map((([t,e])=>Object.assign({name:t},e)))),(([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=l.find((t=>t.name===n));return(null==r?void 0:r.independent)?t:n})),f=l.filter((t=>{const{name:e,required:n}=t;if(u.find((([t])=>t===e)))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1})).flatMap((t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:o,ordinal:s}=t;return u.filter((([t])=>t.startsWith(e))).map((([t,e],c)=>{const l=e.some((t=>t.visual)),u=e.some((t=>t.constant)),f=a[t]||{},{independent:h=!1,key:d=r||t,type:p=(u?"constant":l?"identity":n)}=f,y=NM(f,["independent","key","type"]),g="constant"===p,v=g?void 0:i;return{name:t,values:e,scaleKey:h||g?Symbol("independent"):d,scale:Object.assign(Object.assign({type:p,range:v},y),{quantitative:o,ordinal:s})}}))}));return[i,Object.assign(Object.assign({},e),{index:r,channels:f,tooltip:c})]}))}function DM(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}var BM=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))},FM=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Jh)),c=new Set(Object.keys(i).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Jh)),l=t=>{const{type:e}=t;if("function"==typeof e){const{props:t={}}=e,{composite:n=!0}=t;if(n)return"mark"}return"string"!=typeof e?e:s.has(e)||c.has(e)?"mark":e},u=t=>"mark"===l(t),f=t=>"standardView"===l(t),h=t=>{const{type:e}=t;return"string"==typeof e&&!!c.has(e)},d=t=>{if(f(t))return[t];const e=l(t);return o({type:e,static:h(t)})(t)},p=[],y=new Map,g=new Map,v=[t],m=[];for(;v.length;){const t=v.shift();if(f(t)){const e=g.get(t),[r,o]=e?qM(e,t,i):yield $M(t,n);y.set(r,t),p.push(r);const a=o.flatMap(d).map((t=>Iw(t,i)));if(v.push(...a),a.every(f)){const t=yield Promise.all(a.map((t=>GM(t,n))));__(t);for(let e=0;et.key)).join((t=>t.append("g").attr("className",L).attr("id",(t=>t.key)).call(ZM).each((function(t,e,r){YM(t,cd(r),w,n),b.set(t,r)}))),(t=>t.call(ZM).each((function(t,e,r){YM(t,cd(r),w,n),x.set(t,r)}))),(t=>t.each((function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()})).remove()));const O=(t,e,r)=>Array.from(t.entries()).map((([i,o])=>{const a=r||new Map,s=y.get(i),c=function(t,e,n){const{library:r}=n,i=function(t){const[,e]=Rw("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(r),o=t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate,a=aE(e),s=a.map(i).filter(o).map((t=>t[0]));return(e,r,i)=>BM(this,void 0,void 0,(function*(){const o=[],[a,c]=yield $M(e,n);YM(a,t,o,n);for(const i of s.filter((t=>t!==r)))WM(i,t,e,a,n);for(const e of c)zM(e,t,n);return i(),{options:e,view:a}}))}(cd(o),s,n);return{view:i,container:o,options:s,setState:(t,e=(t=>t))=>a.set(t,e),update:(n,r)=>BM(this,void 0,void 0,(function*(){const i=Uh(Array.from(a.values()))(s);return yield c(i,n,(()=>{vn(r)&&e(t,r,a)}))}))}})),k=(t=x,e,r)=>{var i;const o=O(t,k,r);for(const t of o){const{options:r,container:s}=t,c=s.nameInteraction;let l=aE(r);e&&(l=l.filter((t=>e.includes(t[0]))));for(const e of l){const[r,s]=e,l=c.get(r);if(l&&(null===(i=l.destroy)||void 0===i||i.call(l)),s){const e=HM(t.view,r,s,a)(t,o,n.emitter);c.set(r,{destroy:e})}}}},_=O(b,k);for(const t of _){const{options:e}=t,r=new Map;t.container.nameInteraction=r;for(const i of aE(e)){const[e,o]=i;if(o){const i=HM(t.view,e,o,a)(t,_,n.emitter);r.set(e,{destroy:i})}}}k();const{width:M,height:E}=t,S=[];for(const t of m){const r=new Promise((r=>BM(this,void 0,void 0,(function*(){for(const r of t){const t=Object.assign({width:M,height:E},r);yield zM(t,e,n)}r()}))));S.push(r)}n.views=p,null===(r=n.animations)||void 0===r||r.forEach((t=>null==t?void 0:t.cancel())),n.animations=w,n.emitter.emit(dd);const A=w.filter(Jh).map(nE).map((t=>t.finished));return Promise.all([...A,...S])}))}function ZM(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function WM(t,e,n,r,i){var o;const{library:a}=i,[s]=Rw("interaction",a),c=e.node().nameInteraction,l=aE(n).find((([e])=>e===t)),u=c.get(t);if(!u)return;if(null===(o=u.destroy)||void 0===o||o.call(u),!l[1])return;const f=HM(r,t,l[1],s),h={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},d=f(h,[],i.emitter);c.set(t,{destroy:d})}function $M(t,e){return BM(this,void 0,void 0,(function*(){const{library:n}=e,r=yield function(t,e){return BM(this,void 0,void 0,(function*(){const{library:n}=e,[r,i]=Rw("mark",n),o=new Set(Object.keys(n).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Jh)),{marks:a}=t,s=[],c=[],l=[...a],{width:u,height:f}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:o=r,paddingTop:a=r,paddingBottom:s=r,margin:c=16,marginLeft:l=c,marginRight:u=c,marginTop:f=c,marginBottom:h=c,inset:d=0,insetLeft:p=d,insetRight:y=d,insetTop:g=d,insetBottom:v=d}=t,m=t=>"auto"===t?20:t;return{width:n-m(i)-m(o)-l-u-p-y,height:e-m(a)-m(s)-f-h-g-v}}(t),h={options:t,width:u,height:f};for(;l.length;){const[t]=l.splice(0,1),n=yield sE(t,e),{type:a=Kh("G2Mark type is required."),key:u}=n;if(o.has(a))c.push(n);else{const{props:t={}}=i(a),{composite:e=!0}=t;if(e){const{data:t}=n,e=Object.assign(Object.assign({},n),{data:t?Array.isArray(t)?t:t.value:t}),i=yield r(e,h),o=Array.isArray(i)?i:[i];l.unshift(...o.map(((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`}))))}else s.push(n)}}return Object.assign(Object.assign({},t),{marks:s,components:c})}))}(t,e),i=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,o=FM(t,["coordinate","interaction","style","marks"]),a=i.map((t=>t.coordinate||{})),s=i.map((t=>t.interaction||{})),c=i.map((t=>t.viewStyle||{})),l=[...a,e].reduceRight(((t,e)=>Rh(t,e)),{}),u=[n,...s].reduce(((t,e)=>Rh(t,e)),{}),f=[...c,r].reduce(((t,e)=>Rh(t,e)),{});return Object.assign(Object.assign({},o),{marks:i,coordinate:l,interaction:u,style:f})}(r);t.interaction=i.interaction,t.coordinate=i.coordinate,t.marks=[...i.marks,...i.components];const o=Iw(i,n);return qM(yield GM(o,e),o,n)}))}function GM(t,e){return BM(this,void 0,void 0,(function*(){const{library:n}=e,[r]=Rw("theme",n),[,i]=Rw("mark",n),{theme:o,marks:a,coordinates:s=[]}=t,c=r(oE(o)),l=new Map;for(const t of a){const{type:n}=t,{props:r={}}=i(n),o=yield IM(t,r,e);if(o){const[t,e]=o;l.set(t,e)}}const u=zh(Array.from(l.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of u.values()){const e=t.reduce(((t,{scale:e})=>Rh(t,e)),{}),{scaleKey:r}=t[0],{values:i}=t[0],o=Array.from(new Set(i.map((t=>t.field)).filter(Jh))),a=Rh({guide:{title:0===o.length?void 0:o},field:o[0]},e),{name:l}=t[0],u=t.flatMap((({values:t})=>t.map((t=>t.value)))),f=Object.assign(Object.assign({},x_(l,u,a,s,c,n)),{uid:Symbol("scale"),key:r});t.forEach((t=>t.scale=f))}return l}))}function HM(t,e,n,r){const i=t.theme,o="string"==typeof e&&i[e]||{};return r(Rh(o,Object.assign({type:e},n)))}function qM(t,e,n){var r;const[i]=Rw("mark",n),[o]=Rw("theme",n),[a]=Rw("labelTransform",n),{key:s,frame:c=!1,theme:l,clip:u,style:f={},labelTransform:h=[]}=e,d=o(oE(l)),p=Array.from(t.values()),y=function(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],o=Array.from(new Set(t.flatMap((t=>t.channels.map((t=>t.scale)))))),a=new Map(o.map((t=>[t.name,t])));for(const t of r){const e=M_(t);for(const r of e){const e=a.get(r),s=(null===(n=t.scale)||void 0===n?void 0:n[r])||{},{independent:c=!1}=s;if(e&&!c){const{guide:n}=e,r="boolean"==typeof n?{}:n;e.guide=Rh({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:hv(t,i)});o.push(e)}}}return o}(p,e),g=function(t){return t.map((t=>{const e=Rh(t,t.style);return delete e.style,e}))}(W_(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter((t=>"shape"!==t.name));if(1!==e.length||t.some((t=>"shape"===t.name)))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const o={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},a=(null===(r=t.find((t=>"color"===t.name)))||void 0===r?void 0:r.field)||null,s={field:a,name:"shape",type:"constant",domain:[],range:[o[i]]};return[...t,s]}(Array.from(y),p,t),e,n)),v=hM(g,e,d,n),m=function(t,e,n){const[r]=Rw("coordinate",n),{innerHeight:i,innerWidth:o,insetLeft:a,insetTop:s,insetRight:c,insetBottom:l}=t,{coordinates:u=[]}=e,f=(h=u).find((t=>"cartesian"===t.type||"cartesian3D"===t.type))?h:[...h,{type:"cartesian"}];var h;const d="cartesian3D"===f[0].type,p=Object.assign(Object.assign({},t),{x:a,y:s,width:o-a-c,height:i-l-s,transformations:f.flatMap(r)});return d?new gp.Coordinate3D(p):new gp.Coordinate(p)}(v,e,n),b=c?Rh({mainLineWidth:1,mainStroke:"#000"},f):f;!function(t,e,n){const r=zh(t,(t=>`${t.plane||"xy"}-${t.position}`)),{paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:y,insetRight:g,insetTop:v,height:m,width:b,depth:x}=n,w={xy:pM({width:b,height:m,paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:y,insetRight:g,insetTop:v}),yz:pM({width:x,height:m,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:m,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:pM({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[t,n]of r.entries()){const[r,i]=t.split("-"),o=w[r][i],[a,s]=np(n,(t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i)))));a.length&&yM(a,e,o,i),s.length&&gM(n,0,o)}}(G_(g),m,v),function(t){const e=t.find((({type:t})=>"axisX"===t)),n=t.find((({type:t})=>"axisY"===t)),r=t.find((({type:t})=>"axisZ"===t));e&&n&&r&&(e.plane="xy",n.plane="xy",r.plane="yz",r.origin=[e.bbox.x,e.bbox.y,0],r.eulerAngles=[0,-90,0],r.bbox.x=e.bbox.x,r.bbox.y=e.bbox.y,t.push(Object.assign(Object.assign({},e),{plane:"xz",showLabel:!1,showTitle:!1,origin:[e.bbox.x,e.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},n),{plane:"yz",showLabel:!1,showTitle:!1,origin:[n.bbox.x+n.bbox.width,n.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},r),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]})))}(g);const x=new Map(Array.from(t.values()).flatMap((t=>{const{channels:e}=t;return e.map((({scale:t})=>[t.uid,k_(t,n)]))})));!function(t,e){const n=Array.from(t.values()).flatMap((t=>t.channels)),r=$h(n,(t=>t.map((t=>e.get(t.scale.uid)))),(t=>t.name)).filter((([,t])=>t.some((t=>"function"==typeof t.getOptions().groupTransform))&&t.every((t=>t.getTicks)))).map((t=>t[1]));r.forEach((t=>{const e=t.map((t=>t.getOptions().groupTransform))[0];e(t)}))}(t,x);const w={};for(const t of g){const{scales:e=[]}=t,i=[];for(const t of e){const{name:e,uid:o}=t,a=null!==(r=x.get(o))&&void 0!==r?r:k_(t,n);i.push(a),"y"===e&&a.update(Object.assign(Object.assign({},a.getOptions()),{xScale:w.x})),O_(w,{[e]:a})}t.scaleInstances=i}const O=[];for(const[e,n]of t.entries()){const{children:t,dataDomain:r,modifier:o,key:a}=e,{index:c,channels:l,tooltip:u}=n,f=Qd(Object.fromEntries(l.map((({name:t,scale:e})=>[t,e]))),(({uid:t})=>x.get(t)));O_(w,f);const h=w_(l,f),d=i(e),[p,y,g]=VM(d(c,f,h,m)),b=r||p.length,k=o?o(y,b,v):[],_=t=>{var e,n;return null===(n=null===(e=u.title)||void 0===e?void 0:e[t])||void 0===n?void 0:n.value},M=t=>u.items.map((e=>e[t])),E=p.map(((t,e)=>{const n=Object.assign({points:y[e],transform:k[e],index:t,markKey:a,viewKey:s},u&&{title:_(t),items:M(t)});for(const[r,i]of Object.entries(h))n[r]=i[t],g&&(n[`series${Bd(r)}`]=g[e].map((t=>i[t])));return g&&(n.seriesIndex=g[e]),g&&u&&(n.seriesItems=g[e].map((t=>M(t))),n.seriesTitle=g[e].map((t=>_(t)))),n}));n.data=E,n.index=p;const S=null==t?void 0:t(E,f,v);O.push(...S||[])}return[{layout:v,theme:d,coordinate:m,markState:t,key:s,clip:u,scale:w,style:b,components:g,labelTransform:Uh(h.map(a))},O]}function YM(t,e,n,r){return BM(this,void 0,void 0,(function*(){const{library:i}=r,{components:o,theme:a,layout:s,markState:c,coordinate:l,key:u,style:f,clip:h,scale:d}=t,{x:p,y:y,width:g,height:v}=s,m=FM(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map(((t,e)=>e)),w=b.map((t=>nd(Object.assign({},a.view,f),t))),O=["a","margin","padding","inset"].map((t=>ed(m,t))),k=t=>t.style("x",(t=>A[t].x)).style("y",(t=>A[t].y)).style("width",(t=>A[t].width)).style("height",(t=>A[t].height)).each((function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(cd(n),w[t])}));let _=0,M=0,E=g,S=v;const A=x.map((t=>{const e=O[t],{left:n=0,top:r=0,bottom:i=0,right:o=0}=e;return _+=n,M+=r,E-=n+o,S-=r+i,{x:_,y:M,width:E,height:S}}));e.selectAll(fE(B)).data(x.filter((t=>Jh(w[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",B).style("zIndex",-2).call(k)),(t=>t.call(k)),(t=>t.remove()));const j=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:o}=i,{enter:a={},update:s={},exit:c={}}=t,{type:l,duration:u=300,delay:f=0}=s,{type:h,duration:d=300,delay:p=0}=a,{type:y,duration:g=300,delay:v=0}=c;for(const t of o){const{updateType:r=l,updateDuration:i=u,updateDelay:o=f,enterType:a=h,enterDuration:s=d,enterDelay:c=p,exitDuration:m=g,exitDelay:b=v,exitType:x=y}=t;(void 0===r||r)&&(e=Math.max(e,i+o),n=Math.min(n,o)),(void 0===x||x)&&(e=Math.max(e,m+b),n=Math.min(n,b)),(void 0===a||a)&&(e=Math.max(e,s+c),n=Math.min(n,c))}}return e===-1/0?null:[n,e-n]}(c),P=!!j&&{duration:j[1]};for(const[,t]of Zh(o,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const T=e.selectAll(fE(I)).data(o,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",I).append((t=>$_(Rh({animate:P,scale:d},t),l,a,i,c)))),(t=>t.transition((function(t,e,n){const{preserve:r=!1}=t;if(r)return;const o=$_(Rh({animate:P,scale:d},t),l,a,i,c),{attributes:s}=o,[u]=n.childNodes;return u.update(s,!1)})))).transitions();n.push(...T.flat().filter(Jh));const L=e.selectAll(fE(N)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",N).call(cE).call(uE,Array.from(c.keys())).call(hE,h)),(t=>t.call(uE,Array.from(c.keys())).call((t=>j?function(t,e){const[n,r]=e;t.transition((function(t,e,i){const{transform:o,width:a,height:s}=i.style,{paddingLeft:c,paddingTop:l,innerWidth:u,innerHeight:f,marginLeft:h,marginTop:d}=t,p=[{transform:o,width:a,height:s},{transform:`translate(${c+h}, ${l+d})`,width:u,height:f}];return i.animate(p,{delay:n,duration:r,fill:"both"})}))}(t,j):cE(t))).call(hE,h))).transitions();n.push(...L.flat());for(const[o,a]of c.entries()){const{data:s}=a,{key:c,class:l,type:u}=o,f=e.select(`#${c}`),h=QM(o,a,t,r),d=eE(o,a,t,i),p=rE(o,a,t,i),y=iE(o,a,t,i),g=XM(e,f,l,"element"),v=f.selectAll(fE(R)).selectFacetAll(g).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(h).attr("className",R).attr("markType",u).transition((function(t,e,n){return d(t,[n])}))),(t=>t.call((t=>{const e=t.parent(),n=td((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,r,i){KM(i,e,n);const o=h(t,r),a=p(t,[i],[o]);return null!==a||(i.nodeName===o.nodeName&&"g"!==o.nodeName?Qh(i,o):(i.parentNode.replaceChild(o,i),o.className=R,o.markType=u,o.__data__=i.__data__)),a})).attr("markType",u).attr("className",R)}))),(t=>t.each((function(t,e,n){n.__removed__=!0})).transition((function(t,e,n){return y(t,[n])})).remove()),(t=>t.append(h).attr("className",R).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new ld(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new ld([],n.__toData__,n.parentNode).append(h).attr("className",R).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...v.flat())}!function(t,e,n,r,i){const[o]=Rw("labelTransform",r),{markState:a,labelTransform:s}=t,c=e.select(fE(C)).node(),l=new Map,u=new Map,f=Array.from(a.entries()).flatMap((([n,o])=>{const{labels:a=[],key:s}=n,c=function(t,e,n,r,i){const[o]=Rw("shape",r),{data:a,encode:s}=t,{data:c,defaultLabelShape:l}=e,u=c.map((t=>t.points)),f=Qd(s,(t=>t.value)),{theme:h,coordinate:d}=n,p=Object.assign(Object.assign({},i),{document:Lw(i),theme:h,coordinate:d});return t=>{const{index:e,points:n}=t,r=a[e],{formatter:i=(t=>`${t}`),transform:s,style:c,render:d,selector:y,element:g}=t,v=FM(t,["formatter","transform","style","render","selector","element"]),m=Qd(Object.assign(Object.assign({},v),c),(t=>UM(t,r,e,a,{channel:f,element:g}))),{shape:b=l,text:x}=m,w=FM(m,["shape","text"]),O="string"==typeof i?Vd(i):i,k=Object.assign(Object.assign({},w),{text:O(x,r,e,a),datum:r}),_=Object.assign({type:`label.${b}`,render:d},w);return o(_,p)(n,k,JM(h,"label",b,"label"),u)}}(n,o,t,r,i),f=e.select(`#${s}`).selectAll(fE(R)).nodes().filter((t=>!t.__removed__));return a.flatMap(((t,e)=>{const{transform:n=[]}=t,r=FM(t,["transform"]);return f.flatMap((n=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:o,key:a,index:s}=n.__data__,c=function(t){const e=t.cloneNode(),n=t.getAnimations();e.style.visibility="hidden",n.forEach((t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])})),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:o}=r;return[i,o]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${a}-${e}`,bounds:c,index:s,points:o,dependentElement:n})];const l=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map(((r,a)=>Object.assign(Object.assign({},t),{key:`${i[a]}-${e}`,bounds:[o[a]],index:r,points:o,dependentElement:n})));return l?l(u):u}(r,e,n);return i.forEach((e=>{l.set(e,(t=>c(Object.assign(Object.assign({},t),{element:n})))),u.set(e,t)})),i}))}))})),h=cd(c).selectAll(fE(D)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",D)),(t=>t.each((function(t,e,n){Qh(n,l.get(t)(t))}))),(t=>t.remove())).nodes(),d=zh(h,(t=>u.get(t.__data__))),{coordinate:p,layout:y}=t,g={canvas:i.canvas,coordinate:p,layout:y};for(const[t,e]of d){const{transform:n=[]}=t;Uh(n.map(o))(e,g)}s&&s(h,g)}(t,e,0,i,r)}))}function VM([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let n=0;nJh(t)&&Jh(e)))&&(r.push(o),i.push(a))}return[r,i]}function UM(t,e,n,r,i){return"function"==typeof t?t(e,n,r,i):"string"!=typeof t?t:od(e)&&void 0!==e[t]?e[t]:t}function XM(t,e,n,r){return t.node().parentElement.findAll((t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node())).flatMap((t=>t.getElementsByClassName(r)))}function KM(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[o,a]=n(r),[s,c]=n(i);!function(t,e){const{transform:n}=t.style,r=(t=>"none"===t||void 0===t)(n)?"":n;t.style.transform=`${r} ${e}`.trimStart()}(t,`translate(${o-s}, ${a-c})`),e.append(t)}function QM(t,e,n,r){const{library:i}=r,[o]=Rw("shape",i),{data:a,encode:s}=t,{defaultShape:c,data:l,shape:u}=e,f=Qd(s,(t=>t.value)),h=l.map((t=>t.points)),{theme:d,coordinate:p}=n,{type:y,style:g={}}=t,v=Object.assign(Object.assign({},r),{document:Lw(r),coordinate:p,theme:d});return e=>{const{shape:n=c}=g,{shape:r=n,points:i,seriesIndex:s,index:l}=e,p=FM(e,["shape","points","seriesIndex","index"]),m=Object.assign(Object.assign({},p),{index:l}),b=s?s.map((t=>a[t])):a[l],x=s||l,w=Qd(g,(t=>UM(t,b,x,a,{channel:f})));return(u[r]?u[r](w,v):o(Object.assign(Object.assign({},w),{type:lE(t,r)}),v))(i,m,JM(d,y,r,c),h)}}function JM(t,e,n,r){if("string"!=typeof e)return;const{color:i}=t,o=t[e]||{},a=o[n]||o[r];return Object.assign({color:i},a)}function tE(t,e,n,r,i){var o,a;const[,s]=Rw("shape",i),[c]=Rw("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:h}=r,d=`default${Bd(t)}Animation`,{[d]:p}=(null===(o=u[l])||void 0===o?void 0:o.props)||s(lE(e,l)).props,{[t]:y={}}=f,g=(null===(a=e.animate)||void 0===a?void 0:a[t])||{},v={coordinate:h};return(e,n,r)=>{const{[`${t}Type`]:i,[`${t}Delay`]:o,[`${t}Duration`]:a,[`${t}Easing`]:s}=e,l=Object.assign({type:i||p},g);if(!l.type)return null;const u=c(l,v)(n,r,Rh(y,{delay:o,duration:a,easing:s}));return Array.isArray(u)?u:[u]}}function eE(t,e,n,r){return tE("enter",t,e,n,r)}function nE(t){return t.finished.then((()=>{t.cancel()})),t}function rE(t,e,n,r){return tE("update",t,e,n,r)}function iE(t,e,n,r){return tE("exit",t,e,n,r)}function oE(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=FM(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function aE(t){const{interaction:e={}}=t;return Object.entries(Rh({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function sE(t,e){return BM(this,void 0,void 0,(function*(){const{data:n}=t,r=FM(t,["data"]);if(null==n)return t;const[,{data:i}]=yield _M(0,{data:n},e);return Object.assign({data:i},r)}))}function cE(t){t.style("transform",(t=>`translate(${t.paddingLeft+t.marginLeft}, ${t.paddingTop+t.marginTop})`)).style("width",(t=>t.innerWidth)).style("height",(t=>t.innerHeight))}function lE(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function uE(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(fE(T)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",T).attr("id",(t=>t.key)).style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.remove()));t.select(fE(C)).node()||t.append("g").attr("className",C).style("zIndex",0)}function fE(...t){return t.map((t=>`.${t}`)).join("")}function hE(t,e){t.node()&&t.style("clipPath",(t=>{if(!e)return null;const{paddingTop:n,paddingLeft:r,marginLeft:i,marginTop:o,innerWidth:a,innerHeight:s}=t;return new ml({style:{x:r+i,y:n+o,width:a,height:s}})}))}function dE(t){const{style:e,scale:n,type:r}=t,i={},o=xy(e,"columnWidthRatio");return o&&"interval"===r&&(i.x=Object.assign(Object.assign({},null==n?void 0:n.x),{padding:1-o})),Object.assign(Object.assign({},t),{scale:Object.assign(Object.assign({},n),i)})}function pE(t){const e=function(t){return function(...t){return e=>t.reduce(((t,e)=>e(t)),e)}(dE)(t)}(t);return e.children&&Array.isArray(e.children)&&(e.children=e.children.map((t=>pE(t)))),e}function yE(t){const e=Rh({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const t=i.shift();if(void 0===t.key){const e=n.get(t),i=r.get(t),o=null===e?"0":`${e.key}-${i}`;t.key=o}const{children:e=[]}=t;if(Array.isArray(e))for(let o=0;o{}),r=(t=>{throw t})){const{width:i=640,height:o=480,depth:a=0}=t,s=yE(pE(t)),{canvas:c=gE(i,o),emitter:l=new P,library:u}=e;e.canvas=c,e.emitter=l;const{width:f,height:h}=c.getConfig();f===i&&h===o||c.resize(i,o),l.emit(ud);const d=cd(c.document.documentElement);return c.ready.then((()=>zM(Object.assign(Object.assign({},s),{width:i,height:o,depth:a}),d,e))).then((()=>{if(a){const[t,e]=c.document.documentElement.getPosition();c.document.documentElement.setPosition(t,e,-a/2)}c.requestAnimationFrame((()=>{c.requestAnimationFrame((()=>{l.emit(fd),null==n||n()}))}))})).catch((t=>{null==r||r(t)})),"string"==typeof(p=c.getConfig().container)?document.getElementById(p):p;var p}function mE(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(!function(t){const e=t.getRoot().querySelectorAll(`.${L}`);null==e||e.forEach((t=>{const{nameInteraction:e=new Map}=t;(null==e?void 0:e.size)>0&&Array.from(null==e?void 0:e.values()).forEach((t=>{null==t||t.destroy()}))}))}(r),n?r.destroy():r.destroyChildren()),i.off()}const bE=t=>t?parseInt(t):0;function xE(t,e){const n=[t];for(;n.length;){const t=n.shift();e&&e(t);const r=t.children||[];for(const t of r)n.push(t)}}class wE{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=(t=>t)){const e=t(this.value);return this.value=e,this}attr(t,e){return 1===arguments.length?this.value[t]:this.map((n=>(n[t]=e,n)))}append(t){const e=new t({});return e.children=[],this.push(e),e}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){const t=this.parentNode;if(t){const{children:e}=t,n=e.findIndex((t=>t===this));e.splice(n,1)}return this}getNodeByKey(t){let e=null;return xE(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return xE(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return xE(this,(n=>{e||t===n.type&&(e=n)})),e}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}var OE=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?RE(e,n,r):"array"===t?LE(e,n,r):"object"===t?NE(e,n,r):"node"===t?DE(e,n,r):"container"===t?BE(e,n,r):"mix"===t&&IE(e,n)}return e}}function zE(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const ZE={encode:{type:"object"},scale:{type:"object"},data:{type:"value"},transform:{type:"array"},style:{type:"object"},animate:{type:"object"},coordinate:{type:"object"},interaction:{type:"object"},label:{type:"array",key:"labels"},axis:{type:"object"},legend:{type:"object"},slider:{type:"object"},scrollbar:{type:"object"},state:{type:"object"},layout:{type:"object"},theme:{type:"object"},title:{type:"value"}},WE=Object.assign(Object.assign({},ZE),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),$E=Object.assign(Object.assign({},ZE),{labelTransform:{type:"array"}});var GE=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};let HE=class extends wE{changeData(t){var e;const n=this.getRoot();if(n)return this.attr("data",t),(null===(e=this.children)||void 0===e?void 0:e.length)&&this.children.forEach((e=>{e.attr("data",t)})),null==n?void 0:n.render()}getView(){const t=this.getRoot(),{views:e}=t.getContext();if(null==e?void 0:e.length)return e.find((t=>t.key===this._key))}getScale(){var t;return null===(t=this.getView())||void 0===t?void 0:t.scale}getScaleByChannel(t){const e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null===(t=this.getView())||void 0===t?void 0:t.coordinate}getTheme(){var t;return null===(t=this.getView())||void 0===t?void 0:t.theme}getGroup(){const t=this._key;if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&rw(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&nw(t)}};HE=GE([FE($E)],HE);var qE=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};let YE=class extends wE{changeData(t){const e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(!e)return;const{markState:n}=e,r=Array.from(n.keys()).find((t=>t.key===this.attr("key")));return n.get(r)}getScale(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(e)return null==e?void 0:e.scale}getScaleByChannel(t){var e,n;const r=null===(e=this.getRoot())||void 0===e?void 0:e.getView();if(r)return null===(n=null==r?void 0:r.scale)||void 0===n?void 0:n[t]}getGroup(){const t=this.attr("key");if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}};YE=qE([FE(WE)],YE);var VE=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a},UE=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i=0;)e+=n[r].value;else e=1;t.value=e}var iS=n(86222);var oS=n(90819),aS=oS().mark(sS);function sS(){var t,e,n,r,i,o;return oS().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n=[t=this];case 1:e=n.reverse(),n=[];case 2:if(!(t=e.pop())){a.next=8;break}return a.next=5,t;case 5:if(r=t.children)for(i=0,o=r.length;i=0;--o)c.push(r=i[o]=new dS(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(hS)}function lS(t){return t.children}function uS(t){return Array.isArray(t)?t[1]:null}function fS(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function hS(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function dS(t){this.data=t,this.depth=this.height=0,this.parent=null}function pS(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}dS.prototype=cS.prototype=nS({constructor:dS,count:function(){return this.eachAfter(rS)},each:function(t,e){var n,r=-1,i=iS(this);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.call(e,o,++r,this)}}catch(t){i.e(t)}finally{i.f()}return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],s=[],c=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r=0;--r)o.push(n[r]);return this},find:function(t,e){var n,r=-1,i=iS(this);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(t.call(e,o,++r,this))return o}}catch(t){i.e(t)}finally{i.f()}},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return cS(this).eachBefore(fS)}},Symbol.iterator,sS);const yS={field:"value",size:[1,1],round:!1,padding:0,sort:(t,e)=>e.value-t.value,as:["x","y"],ignoreParentValue:!0},gS="childNodeCount",vS="Invalid field: it must be a string!";function mS(t,e){const n=(e=function(t,e,n,r){return e&&pS(t,e),n&&pS(t,n),r&&pS(t,r),t}({},yS,e)).as;if(!vn(n)||2!==n.length)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');let r;try{r=function(t,e){const{field:n,fields:r}=t;if(ze(n))return n;if(vn(n))return console.warn(vS),n[0];if(console.warn(`${vS} will try to get fields instead.`),ze(r))return r;if(vn(r)&&r.length)return r[0];if(e)return e;throw new TypeError(vS)}(e)}catch(t){console.warn(t)}const i=(t=>eS().size(e.size).round(e.round).padding(e.padding)(cS(t).sum((t=>Em(t.children)?e.ignoreParentValue?0:t[r]-fv(t.children,((t,e)=>t+e[r]),0):t[r])).sort(e.sort)))(t),o=n[0],a=n[1];return i.each((t=>{var e,r;t[o]=[t.x0,t.x1,t.x1,t.x0],t[a]=[t.y1,t.y1,t.y0,t.y0],t.name=t.name||(null===(e=t.data)||void 0===e?void 0:e.name)||(null===(r=t.data)||void 0===r?void 0:r.label),t.data.name=t.name,["x0","x1","y0","y1"].forEach((e=>{-1===n.indexOf(e)&&delete t[e]}))})),function(t){const e=[];if(t&&t.each){let n,r;t.each((t=>{var i,o;t.parent!==n?(n=t.parent,r=0):r+=1;const a=px(((null===(i=t.ancestors)||void 0===i?void 0:i.call(t))||[]).map((t=>e.find((e=>e.name===t.name))||t)),(({depth:e})=>e>0&&e{e.push(t)}));return e}(i)}var bS=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{encode:e,data:n=[],legend:r}=t,i=bS(t,["encode","data","legend"]),o=Object.assign(Object.assign({},i.coordinate),{innerRadius:Math.max(xy(i,["coordinate","innerRadius"],.2),1e-5)}),a=Object.assign(Object.assign({},_S.encode),e),{value:s}=a,c=function(t){const{data:e,encode:n}=t,{color:r,value:i}=n,o=mS(e,{field:i,type:"hierarchy.partition",as:["x","y"]}),a=[];return o.forEach((t=>{var e,n,o,s;if(0===t.depth)return null;let c=t.data.name;const l=[c];let u=Object.assign({},t);for(;u.depth>1;)c=`${null===(e=u.parent.data)||void 0===e?void 0:e.name} / ${c}`,l.unshift(null===(n=u.parent.data)||void 0===n?void 0:n.name),u=u.parent;const f=Object.assign(Object.assign(Object.assign({},QE(t.data,[i])),{[OS]:c,[kS]:u.data.name}),t);r&&r!==kS&&(f[r]=t.data[r]||(null===(s=null===(o=t.parent)||void 0===o?void 0:o.data)||void 0===s?void 0:s[r])),a.push(f)})),a.map((t=>{const e=t.x.slice(0,2),n=[t.y[2],t.y[0]];return e[0]===e[1]&&(n[0]=n[1]=(t.y[2]+t.y[0])/2),Object.assign(Object.assign({},t),{x:e,y:n,fillOpacity:Math.pow(.85,t.depth)})}))}({encode:a,data:n});return console.log(c,"rectData"),[Rh({},_S,Object.assign(Object.assign({type:"rect",data:c,encode:a,tooltip:{title:"path",items:[t=>({name:s,value:t[s]})]}},i),{coordinate:o}))]};MS.props={};var ES=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return uv(t,(function(n,r){In(t)&&"prototype"===r||e.push(r)})),e},SS=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))};const AS={rootText:"root",style:{fill:"rgba(0, 0, 0, 0.85)",fontSize:12,y:1},active:{fill:"rgba(0, 0, 0, 0.5)"}};function jS(t={}){const{breadCrumb:e={},isFixedColor:n=!1}=t,r=Rh({},AS,e);return t=>{const{update:e,setState:i,container:o,view:a,options:s}=t,c=o.ownerDocument,l=function(t){return cd(t).select(`.${N}`).node()}(o),u=s.marks.find((({id:t})=>t===xS)),{state:f}=u,h=c.createElement("g");l.appendChild(h);const d=(t,o)=>SS(this,void 0,void 0,(function*(){if(h.removeChildren(),t){const e=c.createElement("text",{style:Object.assign({x:0,text:r.rootText,depth:0},r.style)});h.appendChild(e);let n="";const i=null==t?void 0:t.split(" / ");let o=r.style.y,a=h.getBBox().width;const s=l.getBBox().width,u=i.map(((t,e)=>{const i=c.createElement("text",{style:Object.assign(Object.assign({x:a,text:" / "},r.style),{y:o})});h.appendChild(i),a+=i.getBBox().width,n=`${n}${t} / `;const l=c.createElement("text",{name:n.replace(/\s\/\s$/,""),style:Object.assign(Object.assign({text:t,x:a,depth:e+1},r.style),{y:o})});return h.appendChild(l),a+=l.getBBox().width,a>s&&(o=h.getBBox().height,a=0,i.attr({x:a,y:o}),a+=i.getBBox().width,l.attr({x:a,y:o}),a+=l.getBBox().width),l}));[e,...u].forEach(((t,e)=>{if(e===u.length)return;const n=Object.assign({},t.attributes);t.attr("cursor","pointer"),t.addEventListener("mouseenter",(()=>{t.attr(r.active)})),t.addEventListener("mouseleave",(()=>{t.attr(n)})),t.addEventListener("click",(()=>{d(t.name,xy(t,["style","depth"]))}))}))}i("drillDown",(e=>{const{marks:r}=e,i=r.map((e=>{if(e.id!==xS&&"rect"!==e.type)return e;const{data:r}=e,i=Object.fromEntries(["color"].map((t=>[t,{domain:a.scale[t].getOptions().domain}]))),s=r.filter((e=>{const r=e.path;if(n||(e[kS]=r.split(" / ")[o]),!t)return!0;return new RegExp(`^${t}.+`).test(r)}));return Rh({},e,n?{data:s,scale:i}:{data:s})}));return Object.assign(Object.assign({},e),{marks:i})})),yield e()})),p=t=>{const e=t.target;if(xy(e,["style",wS])!==xS||"rect"!==xy(e,["markType"])||!xy(e,["style",gS]))return;const n=xy(e,["__data__","key"]),r=xy(e,["style","depth"]);e.style.cursor="pointer",d(n,r)};l.addEventListener("click",p);const y=ES(Object.assign(Object.assign({},f.active),f.inactive)),g=()=>{(t=>t.querySelectorAll(".element").filter((t=>xy(t,["style",wS])===xS)))(l).forEach((t=>{const e=xy(t,["style",gS]);if("pointer"!==xy(t,["style","cursor"])&&e){t.style.cursor="pointer";const e=QE(t.attributes,y);t.addEventListener("mouseenter",(()=>{t.attr(f.active)})),t.addEventListener("mouseleave",(()=>{t.attr(Rh(e,f.inactive))}))}}))};return l.addEventListener("mousemove",g),()=>{h.remove(),l.removeEventListener("click",p),l.removeEventListener("mousemove",g)}}}const PS=()=>[["cartesian"]];PS.props={};const TS=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];TS.props={transform:!0};const CS=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=((t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)})(t);return[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5],...up({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};CS.props={};const RS=()=>[["parallel",0,1,0,1]];RS.props={};const LS=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];LS.props={transform:!0};const NS=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=3*Math.PI/2,innerRadius:r=0,outerRadius:i=1}=t;return[["parallel",0,1,0,1],...up({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};NS.props={};const IS=({startAngle:t=0,endAngle:e=6*Math.PI,innerRadius:n=0,outerRadius:r=1})=>[["translate",.5,.5],["reflect.y"],["translate",-.5,-.5],["helix",t,e,n,r]];IS.props={};const DS=({value:t})=>e=>e.map((()=>t));DS.props={};const BS=({value:t})=>e=>e.map((e=>e[t]));BS.props={};const FS=({value:t})=>e=>e.map(t);FS.props={};const zS=({value:t})=>()=>t;function ZS(t,e){if(null!==t)return{type:"column",value:t,field:e}}function WS(t,e){const n=ZS(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function $S(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function GS(t,e){const n=ZS(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function HS(t,e){const n=[];for(const r of t)n[r]=e;return n}function qS(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function YS(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=qS(t,n);if(null!==e)return[e,r]}}return[null,null]}function VS(t){return!(t instanceof Date)&&"object"==typeof t}zS.props={};const US=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,Rh({},e,{encode:{y1:WS(HS(t,0))}})]};US.props={};const XS=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return void 0!==r?[t,e]:[t,Rh({},e,{encode:{x:WS(HS(t,0))},scale:{x:{guide:null}}})]};XS.props={};const KS=(t,e)=>Qx(Object.assign({colorAttribute:"fill"},t),e);KS.props=Object.assign(Object.assign({},Qx.props),{defaultMarker:"square"});const QS=(t,e)=>Qx(Object.assign({colorAttribute:"stroke"},t),e);function JS(){}function tA(t){this._context=t}function eA(t){return new tA(t)}QS.props=Object.assign(Object.assign({},Qx.props),{defaultMarker:"hollowSquare"}),tA.prototype={areaStart:JS,areaEnd:JS,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};var nA=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{adjustPoints:n=rA}=t,r=nA(t,["adjustPoints"]),{coordinate:i,document:o}=e;return(t,e,a,s)=>{const{index:c}=e,{color:l}=a,u=nA(a,["color"]),f=s[c+1],h=n(t,f,i),d=!!vp(i),[p,y,g,v]=d?yb(h):h,{color:m=l,opacity:b}=e,x=Nb().curve(eA)([p,y,g,v]);return cd(o.createElement("path",{})).call(hb,u).style("d",x).style("fill",m).style("fillOpacity",b).call(hb,r).node()}};function oA(t,e,n){const[r,i,o,a]=t;if(vp(n)){return[r,[e?e[0][0]:(i[0]+o[0])/2,i[1]],[e?e[3][0]:(i[0]+o[0])/2,o[1]],a]}return[r,[i[0],e?e[0][1]:(i[1]+o[1])/2],[o[0],e?e[3][1]:(i[1]+o[1])/2],a]}iA.props={defaultMarker:"square"};const aA=(t,e)=>iA(Object.assign({adjustPoints:oA},t),e);function sA(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function cA(t){const e=`${t.getFullYear()}-${sA(t.getMonth()+1)}-${sA(t.getDate())}`,n=t.getHours(),r=t.getMinutes(),i=t.getSeconds();return n||r||i?`${e} ${sA(n)}:${sA(r)}:${sA(i)}`:e}aA.props={defaultMarker:"square"};const lA=(t={})=>{const{channel:e="x"}=t;return(t,n)=>{const{encode:r}=n,{tooltip:i}=n;if(ad(i))return[t,n];const{title:o}=i;if(void 0!==o)return[t,n];const a=Object.keys(r).filter((t=>t.startsWith(e))).filter((t=>!r[t].inferred)).map((t=>qS(r,t))).filter((([t])=>t)).map((t=>t[0]));if(0===a.length)return[t,n];const s=[];for(const e of t)s[e]={value:a.map((t=>t[e]instanceof Date?cA(t[e]):t[e])).join(", ")};return[t,Rh({},n,{tooltip:{title:s}})]}};lA.props={};const uA=t=>{const{channel:e}=t;return(t,n)=>{const{encode:r,tooltip:i}=n;if(ad(i))return[t,n];const{items:o=[]}=i;if(!o||o.length>0)return[t,n];const a=(Array.isArray(e)?e:[e]).flatMap((t=>Object.keys(r).filter((e=>e.startsWith(t))).map((t=>{const{field:e,value:n,inferred:i=!1,aggregate:o}=r[t];return i?null:o&&n?{channel:t}:e?{field:e}:n?{channel:t}:null})).filter((t=>null!==t))));return[t,Rh({},n,{tooltip:{items:a}})]}};uA.props={};var fA=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i(t,e)=>{const{encode:n}=e,{key:r}=n,i=fA(n,["key"]);if(void 0!==r)return[t,e];const o=Object.values(i).map((({value:t})=>t)),a=t.map((t=>o.filter(Array.isArray).map((e=>e[t])).join("-")));return[t,Rh({},e,{encode:{key:ZS(a)}})]};function dA(t={}){const{shapes:e}=t;return[{name:"color"},{name:"opacity"},{name:"shape",range:e},{name:"enterType"},{name:"enterDelay",scaleKey:"enter"},{name:"enterDuration",scaleKey:"enter"},{name:"enterEasing"},{name:"key",scale:"identity"},{name:"groupKey",scale:"identity"},{name:"label",scale:"identity"}]}function pA(t={}){return[...dA(t),{name:"title",scale:"identity"}]}function yA(){return[{type:lA,channel:"color"},{type:uA,channel:["x","y"]}]}function gA(){return[{type:lA,channel:"x"},{type:uA,channel:["y"]}]}function vA(t={}){return dA(t)}function mA(){return[{type:hA}]}function bA(t,e){return t.getBandWidth(t.invert(e))}function xA(t,e,n={}){const{x:r,y:i,series:o}=e,{x:a,y:s,series:c}=t,{style:{bandOffset:l=(c?0:.5),bandOffsetX:u=l,bandOffsetY:f=l}={}}=n,h=!!(null==a?void 0:a.getBandWidth),d=!!(null==s?void 0:s.getBandWidth),p=!!(null==c?void 0:c.getBandWidth);return h||d?(t,e)=>{const n=h?bA(a,r[e]):0,l=d?bA(s,i[e]):0,y=p&&o?(bA(c,o[e])/2+ +o[e])*n:0,[g,v]=t;return[g+u*n+y,v+f*l]}:t=>t}function wA(t){return parseFloat(t)/100}function OA(t,e,n,r){const{x:i,y:o}=n,{innerWidth:a,innerHeight:s}=r.getOptions(),c=Array.from(t,(t=>{const e=i[t],n=o[t];return[["string"==typeof e?wA(e)*a:+e,"string"==typeof n?wA(n)*s:+n]]}));return[t,c]}function kA(t){return"function"==typeof t?t:e=>e[t]}function _A(t,e){return Array.from(t,kA(e))}function MA(t,e){const{source:n=(t=>t.source),target:r=(t=>t.target),value:i=(t=>t.value)}=e,{links:o,nodes:a}=t,s=_A(o,n),c=_A(o,r),l=_A(o,i);return{links:o.map(((t,e)=>({target:c[e],source:s[e],value:l[e]}))),nodes:a||Array.from(new Set([...s,...c]),(t=>({key:t})))}}function EA(t,e){return t.getBandWidth(t.invert(e))}hA.props={};const SA={rect:KS,hollow:QS,funnel:iA,pyramid:aA},AA=()=>(t,e,n,r)=>{const{x:i,y:o,y1:a,series:s,size:c}=n,l=e.x,u=e.series,[f]=r.getSize(),h=c?c.map((t=>+t/f)):null,d=c?(t,e,n)=>{const r=t+e/2,i=h[n];return[r-i/2,r+i/2]}:(t,e,n)=>[t,t+e],p=Array.from(t,(t=>{const e=EA(l,i[t]),n=e*(u?EA(u,null==s?void 0:s[t]):1),c=(+(null==s?void 0:s[t])||0)*e,f=+i[t]+c,[h,p]=d(f,n,t),y=+o[t],g=+a[t];return[[h,y],[p,y],[p,g],[h,g]].map((t=>r.map(t)))}));return[t,p]};AA.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:SA,channels:[...pA({shapes:Object.keys(SA)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...mA(),{type:US},{type:XS}],postInference:[...gA()],interaction:{shareTooltip:!0}};const jA={rect:KS,hollow:QS},PA=()=>(t,e,n,r)=>{const{x:i,x1:o,y:a,y1:s}=n,c=Array.from(t,(t=>[[+i[t],+a[t]],[+o[t],+a[t]],[+o[t],+s[t]],[+i[t],+s[t]]].map((t=>r.map(t)))));return[t,c]};PA.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:jA,channels:[...pA({shapes:Object.keys(jA)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...mA(),{type:US}],postInference:[...gA()],interaction:{shareTooltip:!0}};var TA=RA(_b);function CA(t){this._curve=t}function RA(t){function e(e){return new CA(t(e))}return e._curve=t,e}function LA(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(RA(t)):e()._curve},t}CA.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var NA=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;cd(t).maybeAppend("line",(()=>o.createElement("path",{}))).style("d",e).call(hb,r),cd(t).maybeAppend("line1",(()=>o.createElement("path",{}))).style("d",n).call(hb,i)}));const DA=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:o=(t=>!Number.isNaN(t)&&null!=t),connect:a=!1}=t,s=NA(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(t,e,u)=>{const{color:f,lineWidth:h}=u,d=NA(u,["color","lineWidth"]),{color:p=f,size:y=h,seriesColor:g,seriesX:v,seriesY:m}=e,b=mb(c,e),x=vp(c),w=r&&g?pb(g,v,m,r,i,x):p,O=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},d),w&&{stroke:w}),y&&{lineWidth:y}),b&&{transform:b}),s);let k;if(mp(c)){const t=c.getCenter();k=e=>LA(Nb().curve(TA)).angle(((n,r)=>cb(ib(e[r],t)))).radius(((n,r)=>ab(e[r],t))).defined((([t,e])=>o(t)&&o(e))).curve(n)(e)}else k=Nb().x((t=>t[0])).y((t=>t[1])).defined((([t,e])=>o(t)&&o(e))).curve(n);const[_,M]=function(t,e){const n=[],r=[];let i=!1,o=null;for(const a of t)e(a[0])&&e(a[1])?(n.push(a),i&&(i=!1,r.push([o,a])),o=a):i=!0;return[n,r]}(t,o),E=ed(O,"connect"),S=!!M.length;if(!S||a&&!Object.keys(E).length)return cd(l.createElement("path",{})).style("d",k(_)||[]).call(hb,O).node();if(S&&!a)return cd(l.createElement("path",{})).style("d",k(t)).call(hb,O).node();return cd(new IA).style("style1",Object.assign(Object.assign({},O),E)).style("style2",O).style("d1",(A=M,A.map(k).join(","))).style("d2",k(t)).node();var A}};DA.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const BA=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=mp(n)?eA:_b;return DA(Object.assign({curve:i},t),e)(...r)}};function FA(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function zA(t,e){this._context=t,this._k=(1-e)/6}BA.props=Object.assign(Object.assign({},DA.props),{defaultMarker:"line"}),zA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:FA(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:FA(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new zA(t,e)}return n.tension=function(e){return t(+e)},n})(0);function ZA(t,e){this._context=t,this._k=(1-e)/6}ZA.prototype={areaStart:JS,areaEnd:JS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:FA(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return new ZA(t,e)}return n.tension=function(e){return t(+e)},n})(0);function WA(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Ix){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>Ix){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function $A(t,e){this._context=t,this._alpha=e}$A.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:WA(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};(function t(e){function n(t){return e?new $A(t,e):new zA(t,0)}return n.alpha=function(e){return t(+e)},n})(.5);function GA(t,e){this._context=t,this._alpha=e}GA.prototype={areaStart:JS,areaEnd:JS,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:WA(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var HA=function t(e){function n(t){return e?new GA(t,e):new ZA(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function qA(t){return t<0?-1:1}function YA(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(qA(o)+qA(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function VA(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function UA(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function XA(t){this._context=t}function KA(t){this._context=new QA(t)}function QA(t){this._context=t}function JA(t){return new XA(t)}function tj(t){return new KA(t)}XA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:UA(this,this._t0,VA(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,UA(this,VA(this,n=YA(this,t,e)),n);break;default:UA(this,this._t0,n=YA(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(KA.prototype=Object.create(XA.prototype)).point=function(t,e){XA.prototype.point.call(this,e,t)},QA.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}};var ej=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const n=ej(t,[]),{coordinate:r}=e;return(...t)=>{const i=mp(r)?HA:vp(r)?tj:JA;return DA(Object.assign({curve:i},n),e)(...t)}};function rj(t,e){this._context=t,this._t=e}function ij(t){return new rj(t,.5)}function oj(t){return new rj(t,0)}function aj(t){return new rj(t,1)}nj.props=Object.assign(Object.assign({},DA.props),{defaultMarker:"smooth"}),rj.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};const sj=(t,e)=>DA(Object.assign({curve:aj},t),e);sj.props=Object.assign(Object.assign({},DA.props),{defaultMarker:"hv"});const cj=(t,e)=>DA(Object.assign({curve:oj},t),e);cj.props=Object.assign(Object.assign({},DA.props),{defaultMarker:"vh"});const lj=(t,e)=>DA(Object.assign({curve:ij},t),e);lj.props=Object.assign(Object.assign({},DA.props),{defaultMarker:"hvh"});var uj=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{document:n}=e;return(e,r,i)=>{const{seriesSize:o,color:a}=r,{color:s}=i,c=uj(i,["color"]),l=Tb();for(let t=0;t(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:o}=n;return!o||i?[t,e]:[t,Rh({},e,{encode:{series:$S(HS(t,void 0))}})]};dj.props={};const pj=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(void 0!==r||void 0===i)return[t,e];const[o,a]=qS(n,"color");return[t,Rh({},e,{encode:{series:ZS(o,a)}})]};pj.props={};const yj={line:BA,smooth:nj,hv:sj,vh:cj,hvh:lj,trail:hj},gj=(t,e,n,r)=>{var i,o;const{series:a,x:s,y:c}=n,{x:l,y:u}=e;if(void 0===s||void 0===c)throw new Error("Missing encode for x or y channel.");const f=a?Array.from(zh(t,(t=>a[t])).values()):[t],h=f.map((t=>t[0])).filter((t=>void 0!==t)),d=((null===(i=null==l?void 0:l.getBandWidth)||void 0===i?void 0:i.call(l))||0)/2,p=((null===(o=null==u?void 0:u.getBandWidth)||void 0===o?void 0:o.call(u))||0)/2,y=Array.from(f,(t=>t.map((t=>r.map([+s[t]+d,+c[t]+p])))));return[h,y,f]},vj=(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("position"))).map((([,t])=>t));if(0===i.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,(t=>{const e=i.map((e=>+e[t])),n=r.map(e),o=[];for(let t=0;t(t,e,n,r)=>(wp(r)?vj:gj)(t,e,n,r);mj.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:yj,channels:[...pA({shapes:Object.keys(yj)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...mA(),{type:dj},{type:pj}],postInference:[...gA(),{type:lA,channel:"color"},{type:uA,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};var bj=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,o=bj(t,["colorAttribute","symbol","mode"]),a=lf.get(r)||lf.get("point"),{coordinate:s,document:c}=e;return(e,r,l)=>{const{lineWidth:u,color:f}=l,h=o.stroke?u||1:u,{color:d=f,transform:p,opacity:y}=r,[g,v]=bb(e),m=xj(i,e,r,s)||o.r||l.r;return cd(c.createElement("path",{})).call(hb,l).style("fill","transparent").style("d",a(g,v,m)).style("lineWidth",h).style("transform",p).style("transformOrigin",`${g-m} ${v-m}`).style("stroke",d).style(vb(t),y).style(n,d).call(hb,o).node()}};wj.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Oj=(t,e)=>wj(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);Oj.props=Object.assign({defaultMarker:"hollowPoint"},wj.props);const kj=(t,e)=>wj(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);kj.props=Object.assign({defaultMarker:"hollowDiamond"},wj.props);const _j=(t,e)=>wj(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);_j.props=Object.assign({defaultMarker:"hollowHexagon"},wj.props);const Mj=(t,e)=>wj(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);Mj.props=Object.assign({defaultMarker:"hollowSquare"},wj.props);const Ej=(t,e)=>wj(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);Ej.props=Object.assign({defaultMarker:"hollowTriangleDown"},wj.props);const Sj=(t,e)=>wj(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);Sj.props=Object.assign({defaultMarker:"hollowTriangle"},wj.props);const Aj=(t,e)=>wj(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);Aj.props=Object.assign({defaultMarker:"hollowBowtie"},wj.props);var jj=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{colorAttribute:n,mode:r="auto"}=t,i=jj(t,["colorAttribute","mode"]),{coordinate:o,document:a}=e;return(e,s,c)=>{const{lineWidth:l,color:u}=c,f=i.stroke?l||1:l,{color:h=u,transform:d,opacity:p}=s,[y,g]=bb(e),v=xj(r,e,s,o)||i.r||c.r;return cd(a.createElement("circle",{})).call(hb,c).style("fill","transparent").style("cx",y).style("cy",g).style("r",v).style("lineWidth",f).style("transform",d).style("transformOrigin",`${y} ${g}`).style("stroke",h).style(vb(t),p).style(n,h).call(hb,i).node()}},Tj=(t,e)=>Pj(Object.assign({colorAttribute:"fill"},t),e);Tj.props={defaultMarker:"circle",defaultEnterAnimation:"fadeIn",defaultExitAnimation:"fadeOut"};const Cj=(t,e)=>Pj(Object.assign({colorAttribute:"stroke"},t),e);Cj.props=Object.assign({defaultMarker:"hollowPoint"},Tj.props);const Rj=(t,e)=>wj(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);Rj.props=Object.assign({defaultMarker:"point"},wj.props);const Lj=(t,e)=>wj(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);Lj.props=Object.assign({defaultMarker:"plus"},wj.props);const Nj=(t,e)=>wj(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);Nj.props=Object.assign({defaultMarker:"diamond"},wj.props);const Ij=(t,e)=>wj(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);Ij.props=Object.assign({defaultMarker:"square"},wj.props);const Dj=(t,e)=>wj(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);Dj.props=Object.assign({defaultMarker:"triangle"},wj.props);const Bj=(t,e)=>wj(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);Bj.props=Object.assign({defaultMarker:"hexagon"},wj.props);const Fj=(t,e)=>wj(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);Fj.props=Object.assign({defaultMarker:"cross"},wj.props);const zj=(t,e)=>wj(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);zj.props=Object.assign({defaultMarker:"bowtie"},wj.props);const Zj=(t,e)=>wj(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);Zj.props=Object.assign({defaultMarker:"hyphen"},wj.props);const Wj=(t,e)=>wj(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);Wj.props=Object.assign({defaultMarker:"line"},wj.props);const $j=(t,e)=>wj(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);$j.props=Object.assign({defaultMarker:"tick"},wj.props);const Gj=(t,e)=>wj(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);Gj.props=Object.assign({defaultMarker:"triangleDown"},wj.props);const Hj=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return void 0!==r?[t,e]:[t,Rh({},e,{encode:{y:WS(HS(t,0))},scale:{y:{guide:null}}})]};Hj.props={};const qj=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,Rh({},e,{encode:{size:$S(HS(t,3))}})]};qj.props={};const Yj={hollow:Oj,hollowDiamond:kj,hollowHexagon:_j,hollowSquare:Mj,hollowTriangleDown:Ej,hollowTriangle:Sj,hollowBowtie:Aj,hollowCircle:Cj,point:Rj,plus:Lj,diamond:Nj,square:Ij,triangle:Dj,hexagon:Bj,cross:Fj,bowtie:zj,hyphen:Zj,line:Wj,tick:$j,triangleDown:Gj,circle:Tj},Vj=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s,y1:c,size:l,dx:u,dy:f}=r,[h,d]=i.getSize(),p=xA(n,r,t),y=t=>{const e=+((null==u?void 0:u[t])||0),n=+((null==f?void 0:f[t])||0);return[(s?(+o[t]+ +s[t])/2:+o[t])+e,(c?(+a[t]+ +c[t])/2:+a[t])+n]},g=l?Array.from(e,(t=>{const[e,n]=y(t),r=+l[t],o=r/h,a=r/d,s=[e-o,n-a],c=[e+o,n+a];return[i.map(p(s,t)),i.map(p(c,t))]})):Array.from(e,(t=>[i.map(p(y(t),t))]));return[e,g]};Vj.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:Yj,channels:[...pA({shapes:Object.keys(Yj)}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",quantitative:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[...mA(),{type:XS},{type:Hj}],postInference:[{type:qj},...yA()]};const Uj=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:o,text:a="",fontSize:s,rotate:c=0,transform:l=""}=r,u={text:String(a),stroke:o,fill:o,fontSize:s},[[f,h]]=e;return cd(new Fb).style("x",f).style("y",h).call(hb,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(hb,u).call(hb,t).node()}};Uj.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var Xj=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const e=t.attributes,{class:n,x:r,y:i,transform:o}=e,a=Xj(e,["class","x","y","transform"]),s=ed(a,"marker"),{size:c=24}=s,l=()=>function(t){const e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[o,a]=[0,0],[s,c]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,s,c],["L",o,a],["Z"]]}(c/2),u=cd(t).maybeAppend("marker",(()=>new am({}))).call((t=>t.node().update(Object.assign({symbol:l},s)))).node(),[f,h]=function(t){const{min:e,max:n}=t.getLocalBounds();return[.5*(e[0]+n[0]),.5*(e[1]+n[1])]}(u);cd(t).maybeAppend("text","text").style("x",f).style("y",h).call(hb,a)})),Qj=(t,e)=>{const n=Xj(t,[]);return(t,e,r)=>{const{color:i}=r,o=Xj(r,["color"]),{color:a=i,text:s=""}=e,c={text:String(s),stroke:a,fill:a},[[l,u]]=t;return cd(new Kj).call(hb,o).style("transform",`translate(${l},${u})`).call(hb,c).call(hb,n).node()}};Qj.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Jj=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:o,text:a="",fontSize:s,rotate:c=0,transform:l=""}=r,u={text:String(a),stroke:o,fill:o,fontSize:s,textAlign:"center",textBaseline:"middle"},[[f,h]]=e;return cd(new xl).style("x",f).style("y",h).call(hb,i).style("transformOrigin","center center").style("transform",`${l}rotate(${c}deg)`).style("coordCenter",n.getCenter()).call(hb,u).call(hb,t).node()}};Jj.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const tP=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(VS))return[t,e];const r=Array.isArray(n[0])?n:[n],i=r.map((t=>t[0])),o=r.map((t=>t[1]));return[t,Rh({},e,{encode:{x:ZS(i),y:ZS(o)}})]};tP.props={};var eP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i(t,e)=>{const{data:n,style:r={}}=e,i=eP(e,["data","style"]),{x:o,y:a}=r,s=eP(r,["x","y"]);if(null==o||null==a)return[t,e];const c=a||0;return[[0],Rh({},i,{data:[0],cartesian:!0,encode:{x:ZS([o||0]),y:ZS([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};nP.props={};const rP={text:Uj,badge:Qj,tag:Jj},iP=t=>{const{cartesian:e=!1}=t;return e?OA:(e,n,r,i)=>{const{x:o,y:a}=r,s=xA(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};iP.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:rP,channels:[...pA({shapes:Object.keys(rP)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize",scale:"identity"},{name:"rotate",scale:"identity"}],preInference:[...mA(),{type:tP},{type:nP}],postInference:[...yA()]};const oP=()=>(t,e)=>[t,Rh({scale:{x:{padding:0},y:{padding:0}}},e)];oP.props={};const aP={cell:KS,hollow:QS},sP=()=>(t,e,n,r)=>{const{x:i,y:o}=n,a=e.x,s=e.y,c=Array.from(t,(t=>{const e=a.getBandWidth(a.invert(+i[t])),n=s.getBandWidth(s.invert(+o[t])),c=+i[t],l=+o[t];return[[c,l],[c+e,l],[c+e,l+n],[c,l+n]].map((t=>r.map(t)))}));return[t,c]};function cP(t,e,n){var r=null,i=Ob(!0),o=null,a=_b,s=null,c=Cb(l);function l(l){var u,f,h,d,p,y=(l=wb(l)).length,g=!1,v=new Array(y),m=new Array(y);for(null==o&&(s=a(p=c())),u=0;u<=y;++u){if(!(u=f;--h)s.point(v[h],m[h]);s.lineEnd(),s.areaEnd()}g&&(v[u]=+t(d,u,l),m[u]=+e(d,u,l),s.point(r?+r(d,u,l):v[u],n?+n(d,u,l):m[u]))}if(p)return s=null,p+""||null}function u(){return Nb().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?Rb:Ob(+t),e="function"==typeof e?e:Ob(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?Lb:Ob(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:Ob(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Ob(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Ob(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Ob(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:Ob(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Ob(+t),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(r).y(e)},l.defined=function(t){return arguments.length?(i="function"==typeof t?t:Ob(!!t),l):i},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}sP.props={defaultShape:"cell",defaultLabelShape:"label",shape:aP,composite:!1,channels:[...pA({shapes:Object.keys(aP)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...mA(),{type:XS},{type:Hj},{type:oP}],postInference:[...yA()]};var lP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,o=t.ownerDocument;cd(t).maybeAppend("connect-path",(()=>o.createElement("path",{}))).style("d",n).call(hb,i),cd(t).maybeAppend("area-path",(()=>o.createElement("path",{}))).style("d",e).call(hb,r)})),fP=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=(t=>!Number.isNaN(t)&&null!=t),connect:o=!1}=t,a=lP(t,["curve","gradient","defined","connect"]),{coordinate:s,document:c}=e;return(t,e,l)=>{const{color:u}=l,{color:f=u,seriesColor:h,seriesX:d,seriesY:p}=e,y=vp(s),g=mb(s,e),v=r&&h?pb(h,d,p,r,void 0,y):f,m=Object.assign(Object.assign(Object.assign(Object.assign({},l),{stroke:v,fill:v}),g&&{transform:g}),a),[b,x]=function(t,e){const n=[],r=[],i=[];let o=!1,a=null;const s=t.length/2;for(let c=0;c!e(t))))o=!0;else{if(n.push(l),r.push(u),o&&a){o=!1;const[t,e]=a;i.push([t,l,e,u])}a=[l,u]}}return[n.concat(r),i]}(t,i),w=ed(m,"connect"),O=!!x.length,k=t=>cd(c.createElement("path",{})).style("d",t||"").call(hb,m).node();if(mp(s)){const e=t=>{const e=s.getCenter(),r=t.slice(0,t.length/2),o=t.slice(t.length/2);return function(){var t=cP().curve(TA),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return LA(n())},delete t.lineX0,t.lineEndAngle=function(){return LA(r())},delete t.lineX1,t.lineInnerRadius=function(){return LA(i())},delete t.lineY0,t.lineOuterRadius=function(){return LA(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(RA(t)):e()._curve},t}().angle(((t,n)=>cb(ib(r[n],e)))).outerRadius(((t,n)=>ab(r[n],e))).innerRadius(((t,n)=>ab(o[n],e))).defined(((t,e)=>[...r[e],...o[e]].every(i))).curve(n)(o)};return!O||o&&!Object.keys(w).length?k(e(b)):O&&!o?k(e(t)):cd(new uP).style("areaStyle",m).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}{const e=t=>{const e=t.slice(0,t.length/2),r=t.slice(t.length/2);return y?cP().y(((t,n)=>e[n][1])).x1(((t,n)=>e[n][0])).x0(((t,e)=>r[e][0])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e):cP().x(((t,n)=>e[n][0])).y1(((t,n)=>e[n][1])).y0(((t,e)=>r[e][1])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e)};return!O||o&&!Object.keys(w).length?k(e(b)):O&&!o?k(e(t)):cd(new uP).style("areaStyle",m).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}}};fP.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const hP=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=mp(n)?eA:_b;return fP(Object.assign({curve:i},t),e)(...r)}};hP.props=Object.assign(Object.assign({},fP.props),{defaultMarker:"square"});var dP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const n=dP(t,[]),{coordinate:r}=e;return(...t)=>{const i=mp(r)?HA:vp(r)?tj:JA;return fP(Object.assign({curve:i},n),e)(...t)}};pP.props=Object.assign(Object.assign({},fP.props),{defaultMarker:"smooth"});const yP=(t,e)=>(...n)=>fP(Object.assign({curve:ij},t),e)(...n);yP.props=Object.assign(Object.assign({},fP.props),{defaultMarker:"hvh"});const gP=(t,e)=>(...n)=>fP(Object.assign({curve:oj},t),e)(...n);gP.props=Object.assign(Object.assign({},fP.props),{defaultMarker:"vh"});const vP=(t,e)=>(...n)=>fP(Object.assign({curve:aj},t),e)(...n);vP.props=Object.assign(Object.assign({},fP.props),{defaultMarker:"hv"});const mP={area:hP,smooth:pP,hvh:yP,vh:gP,hv:vP},bP=()=>(t,e,n,r)=>{var i,o;const{x:a,y:s,y1:c,series:l}=n,{x:u,y:f}=e,h=l?Array.from(zh(t,(t=>l[t])).values()):[t],d=h.map((t=>t[0])).filter((t=>void 0!==t)),p=((null===(i=null==u?void 0:u.getBandWidth)||void 0===i?void 0:i.call(u))||0)/2,y=((null===(o=null==f?void 0:f.getBandWidth)||void 0===o?void 0:o.call(f))||0)/2;return[d,Array.from(h,(t=>{const e=t.length,n=new Array(2*e);for(let i=0;i(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=qS(n,"y");return[t,Rh({},e,{encode:{y1:ZS([...i])}})]};xP.props={};const wP=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=qS(n,"x");return[t,Rh({},e,{encode:{x1:ZS([...i])}})]};wP.props={};var OP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{arrow:n=!0,arrowSize:r="40%"}=t,i=OP(t,["arrow","arrowSize"]),{document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=OP(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=Tb();if(d.moveTo(...f),d.lineTo(...h),n){const[t,e]=function(t,e,n){const{arrowSize:r}=n,i="string"==typeof r?+parseFloat(r)/100*ab(t,e):r,o=Math.PI/6,a=Math.atan2(e[1]-t[1],e[0]-t[0]),s=Math.PI/2-a-o,c=a-o;return[[e[0]-i*Math.sin(s),e[1]-i*Math.cos(s)],[e[0]-i*Math.cos(c),e[1]-i*Math.sin(c)]]}(f,h,{arrowSize:r});d.moveTo(...t),d.lineTo(...h),d.lineTo(...e)}return cd(o.createElement("path",{})).call(hb,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(hb,i).node()}};kP.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const _P=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>kP(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};_P.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var MP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const n=MP(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=MP(o,["color"]),{color:c=a,transform:l}=e,[u,f]=t,h=Tb();if(h.moveTo(u[0],u[1]),mp(r)){const t=r.getCenter();h.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{db(h,u,f,fb(u,f),ab(u,f)/2)}return cd(i.createElement("path",{})).call(hb,s).style("d",h.toString()).style("stroke",c).style("transform",l).call(hb,n).node()}};EP.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var SP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const n=SP(t,[]),{document:r}=e;return(t,e,i)=>{const{color:o}=i,a=SP(i,["color"]),{color:s=o,transform:c}=e,[l,u]=t,f=Tb();return f.moveTo(l[0],l[1]),f.bezierCurveTo(l[0]/2+u[0]/2,l[1],l[0]/2+u[0]/2,u[1],u[0],u[1]),cd(r.createElement("path",{})).call(hb,a).style("d",f.toString()).style("stroke",s).style("transform",c).call(hb,n).node()}};AP.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var jP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{cornerRatio:n=1/3}=t,r=jP(t,["cornerRatio"]),{coordinate:i,document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=jP(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=function(t,e,n,r){const i=Tb();if(mp(n)){const o=n.getCenter(),a=ab(t,o),s=(ab(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),db(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return vp(n)?(i.moveTo(t[0],t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,e[1]),i.lineTo(e[0],e[1]),i):(i.moveTo(t[0],t[1]),i.lineTo(t[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],e[1]),i)}(f,h,i,n);return cd(o.createElement("path",{})).call(hb,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(hb,r).node()}};PP.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const TP={link:_P,arc:EP,smooth:AP,vhv:PP},CP=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:c=a}=r,l=xA(n,r,t),u=e.map((t=>[i.map(l([+o[t],+a[t]],t)),i.map(l([+s[t],+c[t]],t))]));return[e,u]};CP.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:TP,channels:[...pA({shapes:Object.keys(TP)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...mA(),{type:xP},{type:wP}],postInference:[...yA()]};var RP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=RP(o,["color"]),{color:c=a,src:l="",size:u=32,transform:f=""}=i;let{width:h=u,height:d=u}=t;const[[p,y]]=e,[g,v]=n.getSize();h="string"==typeof h?wA(h)*g:h,d="string"==typeof d?wA(d)*v:d;const m=p-Number(h)/2,b=y-Number(d)/2;return cd(r.createElement("image",{})).call(hb,s).style("x",m).style("y",b).style("src",l).style("stroke",c).style("transform",f).call(hb,t).style("width",h).style("height",d).node()}};LP.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const NP={image:LP},IP=t=>{const{cartesian:e}=t;return e?OA:(e,n,r,i)=>{const{x:o,y:a}=r,s=xA(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};IP.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:NP,channels:[...pA({shapes:Object.keys(NP)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...mA(),{type:tP},{type:nP}],postInference:[...yA()]};var DP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=DP(o,["color"]),{color:c=a,transform:l}=i,u=function(t,e){const n=Tb();if(mp(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map((t=>ab(t,r)));return i.forEach(((e,i)=>{if(0===i)return void n.moveTo(e[0],e[1]);const a=o[i],s=t[i-1],c=o[i-1];void 0!==c&&Math.abs(a-c)<1e-10?db(n,s,e,r,a):n.lineTo(e[0],e[1])})),n.closePath(),n}return function(t,e){return e.forEach(((e,n)=>0===n?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1]))),t.closePath(),t}(n,t)}(e,n);return cd(r.createElement("path",{})).call(hb,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(hb,t).node()}};BP.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var FP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const n=FP(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=FP(o,["color"]),{color:c=a,transform:l}=e,u=function(t,e){const[n,r,i,o]=t,a=Tb();if(mp(e)){const t=e.getCenter(),s=ab(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),db(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),db(a,r,n,t,s),a.closePath(),a}return a.moveTo(n[0],n[1]),a.bezierCurveTo(n[0]/2+i[0]/2,n[1],n[0]/2+i[0]/2,i[1],i[0],i[1]),a.lineTo(o[0],o[1]),a.bezierCurveTo(o[0]/2+r[0]/2,o[1],o[0]/2+r[0]/2,r[1],r[0],r[1]),a.lineTo(n[0],n[1]),a.closePath(),a}(t,r);return cd(i.createElement("path",{})).call(hb,s).style("d",u.toString()).style("fill",c||a).style("stroke",c||a).style("transform",l).call(hb,n).node()}};zP.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ZP={polygon:BP,ribbon:zP},WP=()=>(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("x"))).map((([,t])=>t)),o=Object.entries(n).filter((([t])=>t.startsWith("y"))).map((([,t])=>t)),a=t.map((t=>{const e=[];for(let n=0;n{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=o,f=$P(o,["color","fill","stroke"]),h=function(t,e){const n=Tb();if(mp(e)){const r=e.getCenter(),[i,o]=r,a=sb(ib(t[0],r)),s=sb(ib(t[1],r)),c=ab(r,t[2]),l=ab(r,t[3]),u=ab(r,t[8]),f=ab(r,t[10]),h=ab(r,t[11]);n.moveTo(...t[0]),n.arc(i,o,c,a,s),n.arc(i,o,c,s,a,!0),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.arc(i,o,l,a,s),n.lineTo(...t[6]),n.arc(i,o,f,s,a,!0),n.closePath(),n.moveTo(...t[8]),n.arc(i,o,u,a,s),n.arc(i,o,u,s,a,!0),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.arc(i,o,h,a,s),n.arc(i,o,h,s,a,!0)}else n.moveTo(...t[0]),n.lineTo(...t[1]),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.lineTo(...t[5]),n.lineTo(...t[6]),n.lineTo(...t[7]),n.closePath(),n.moveTo(...t[8]),n.lineTo(...t[9]),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.lineTo(...t[13]);return n}(e,n);return cd(r.createElement("path",{})).call(hb,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(hb,t).node()}};GP.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var HP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=o,f=HP(o,["color","fill","stroke"]),h=function(t,e,n=4){const r=Tb();if(!mp(e))return r.moveTo(...t[2]),r.lineTo(...t[3]),r.lineTo(t[3][0]-n,t[3][1]),r.lineTo(t[10][0]-n,t[10][1]),r.lineTo(t[10][0]+n,t[10][1]),r.lineTo(t[3][0]+n,t[3][1]),r.lineTo(...t[3]),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]),r.moveTo(t[3][0]+n/2,t[8][1]),r.arc(t[3][0],t[8][1],n/2,0,2*Math.PI),r.closePath(),r;const i=e.getCenter(),[o,a]=i,s=ab(i,t[3]),c=ab(i,t[8]),l=ab(i,t[10]),u=sb(ib(t[2],i)),f=Math.asin(n/c),h=u-f,d=u+f;r.moveTo(...t[2]),r.lineTo(...t[3]),r.moveTo(Math.cos(h)*s+o,Math.sin(h)*s+a),r.arc(o,a,s,h,d),r.lineTo(Math.cos(d)*l+o,Math.sin(d)*l+a),r.arc(o,a,l,d,h,!0),r.lineTo(Math.cos(h)*s+o,Math.sin(h)*s+a),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]);const p=(h+d)/2;return r.moveTo(Math.cos(p)*(c+n/2)+o,Math.sin(p)*(c+n/2)+a),r.arc(Math.cos(p)*c+o,Math.sin(p)*c+a,n/2,p,2*Math.PI+p),r.closePath(),r}(e,n,4);return cd(r.createElement("path",{})).call(hb,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(hb,t).node()}};qP.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const YP={box:GP,violin:qP},VP=()=>(t,e,n,r)=>{const{x:i,y:o,y1:a,y2:s,y3:c,y4:l,series:u}=n,f=e.x,h=e.series,d=Array.from(t,(t=>{const e=f.getBandWidth(f.invert(+i[t])),n=e*(h?h.getBandWidth(h.invert(+(null==u?void 0:u[t]))):1),d=(+(null==u?void 0:u[t])||0)*e,p=+i[t]+d+n/2,[y,g,v,m,b]=[+o[t],+a[t],+s[t],+c[t],+l[t]];return[[p-n/2,b],[p+n/2,b],[p,b],[p,m],[p-n/2,m],[p+n/2,m],[p+n/2,g],[p-n/2,g],[p-n/2,v],[p+n/2,v],[p,g],[p,y],[p-n/2,y],[p+n/2,y]].map((t=>r.map(t)))}));return[t,d]};VP.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:YP,channels:[...pA({shapes:Object.keys(YP)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...mA(),{type:XS}],postInference:[...gA()],interaction:{shareTooltip:!0}};const UP={vector:kP},XP=()=>(t,e,n,r)=>{const{x:i,y:o,size:a,rotate:s}=n,[c,l]=r.getSize(),u=t.map((t=>{const e=+s[t]/180*Math.PI,n=+a[t],u=n/l,f=n/c*Math.cos(e),h=-u*Math.sin(e);return[r.map([+i[t]-f/2,+o[t]-h/2]),r.map([+i[t]+f/2,+o[t]+h/2])]}));return[t,u]};XP.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:UP,channels:[...pA({shapes:Object.keys(UP)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...mA()],postInference:[...yA()]};var KP=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{arrow:n,arrowSize:r=4}=t,i=KP(t,["arrow","arrowSize"]),{coordinate:o,document:a}=e;return(t,e,s)=>{const{color:c,lineWidth:l}=s,u=KP(s,["color","lineWidth"]),{color:f=c,size:h=l}=e,d=n?function(t,e,n){return t.createElement("path",{style:Object.assign({d:`M ${e},${e} L -${e},0 L ${e},-${e} L 0,0 Z`,transformOrigin:"center"},n)})}(a,r,Object.assign({fill:i.stroke||f,stroke:i.stroke||f},ed(i,"arrow"))):null,p=function(t,e){if(!mp(e))return Nb().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return Ux()({startAngle:0,endAngle:2*Math.PI,outerRadius:ab(t[0],n),innerRadius:ab(t[1],n)})}(t,o),y=function(t,e){if(!mp(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(o,e.transform);return cd(a.createElement("path",{})).call(hb,u).style("d",p).style("stroke",f).style("lineWidth",h).style("transform",y).style("markerEnd",d).call(hb,i).node()}};QP.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const JP=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(VS)?[t,e]:[t,Rh({},e,{encode:{x:ZS(n)}})]};JP.props={};const tT={line:QP},eT=t=>(e,n,r,i)=>{const{x:o}=r,a=xA(n,r,Rh({style:{bandOffset:0}},t)),s=Array.from(e,(t=>[[o[t],1],[o[t],0]].map((e=>i.map(a(e,t))))));return[e,s]};eT.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:tT,channels:[...vA({shapes:Object.keys(tT)}),{name:"x",required:!0}],preInference:[...mA(),{type:JP}],postInference:[]};const nT=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(VS)?[t,e]:[t,Rh({},e,{encode:{y:ZS(n)}})]};nT.props={};const rT={line:QP},iT=t=>(e,n,r,i)=>{const{y:o}=r,a=xA(n,r,Rh({style:{bandOffset:0}},t)),s=Array.from(e,(t=>[[0,o[t]],[1,o[t]]].map((e=>i.map(a(e,t))))));return[e,s]};iT.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:rT,channels:[...vA({shapes:Object.keys(rT)}),{name:"y",required:!0}],preInference:[...mA(),{type:nT}],postInference:[]};var oT=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{offset:n=0,offset1:r=n,offset2:i=n,connectLength1:o,endMarker:a=!0}=t,s=oT(t,["offset","offset1","offset2","connectLength1","endMarker"]),{coordinate:c}=e;return(t,e,n)=>{const{color:l,connectLength1:u}=n,f=oT(n,["color","connectLength1"]),{color:h,transform:d}=e,p=function(t,e,n,r,i=0){const[[o,a],[s,c]]=e;if(vp(t)){const t=o+n,e=t+i;return[[t,a],[e,a],[e,c],[s+r,c]]}const l=a-n,u=l-i;return[[o,l],[o,u],[s,u],[s,c-r]]}(c,t,r,i,null!=o?o:u),y=ed(Object.assign(Object.assign({},s),n),"endMarker");return cd(new dl).call(hb,f).style("d",function(t){return Nb().x((t=>t[0])).y((t=>t[1]))(t)}(p)).style("stroke",h||l).style("transform",d).style("markerEnd",a?new am({className:"marker",style:Object.assign(Object.assign({},y),{symbol:aT})}):null).call(hb,s).node()}};sT.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const cT={connector:sT},lT=(...t)=>CP(...t);function uT(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[`${t}1`]:o}=n;return t=>{var e;const n=(null===(e=r.getBandWidth)||void 0===e?void 0:e.call(r,r.invert(+o[t])))||0;return[i[t],o[t]+n]}}function fT(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=uT("x",e,i,r.x),s=uT("y",n,i,r.y),c=Array.from(t,(t=>{const[e,n]=a(t),[r,i]=s(t);return[[e,r],[n,r],[n,i],[e,i]].map((t=>o.map(t)))}));return[t,c]}}lT.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:cT,channels:[...vA({shapes:Object.keys(cT)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...mA()],postInference:[]};const hT={range:KS},dT=()=>fT();dT.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:hT,channels:[...vA({shapes:Object.keys(hT)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...mA()],postInference:[]};const pT=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(VS))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,Rh({},e,{encode:{x:ZS(r(n,0)),x1:ZS(r(n,1))}})]}return[t,e]};pT.props={};const yT={range:KS},gT=()=>fT({extendY:!0});gT.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:yT,channels:[...vA({shapes:Object.keys(yT)}),{name:"x",required:!0}],preInference:[...mA(),{type:pT}],postInference:[]};const vT=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(VS))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,Rh({},e,{encode:{y:ZS(r(n,0)),y1:ZS(r(n,1))}})]}return[t,e]};vT.props={};const mT={range:KS},bT=()=>fT({extendX:!0});bT.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:mT,channels:[...vA({shapes:Object.keys(mT)}),{name:"y",required:!0}],preInference:[...mA(),{type:vT}],postInference:[]};var xT=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{arrow:n,colorAttribute:r}=t,i=xT(t,["arrow","colorAttribute"]),{coordinate:o,document:a}=e;return(t,e,n)=>{const{color:s,stroke:c}=n,l=xT(n,["color","stroke"]),{d:u,color:f=s}=e,[h,d]=o.getSize();return cd(a.createElement("path",{})).call(hb,l).style("d","function"==typeof u?u({width:h,height:d}):u).style(r,f).call(hb,i).node()}};wT.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const OT=(t,e)=>wT(Object.assign({colorAttribute:"fill"},t),e);OT.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const kT=(t,e)=>wT(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);kT.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const _T={path:OT,hollow:kT},MT=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];MT.props={defaultShape:"path",defaultLabelShape:"label",shape:_T,composite:!1,channels:[...pA({shapes:Object.keys(_T)}),{name:"d",scale:"identity"}],preInference:[...mA()],postInference:[]};var ET=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{render:n}=t,r=ET(t,["render"]);return t=>{const[[i,o]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:o}),e)}};ST.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const AT=()=>(t,e)=>{const{style:n={}}=e;return[t,Rh({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter((([,t])=>"function"==typeof t)).map((([t,e])=>[t,()=>e]))))})]};AT.props={};const jT=t=>{const{cartesian:e}=t;return e?OA:(e,n,r,i)=>{const{x:o,y:a}=r,s=xA(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};jT.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:ST},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...mA(),{type:tP},{type:nP},{type:AT}]};var PT=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{document:n}=e;return(e,r,i)=>{const{transform:o}=r,{color:a}=i,s=PT(i,["color"]),{color:c=a}=r,[l,...u]=e,f=Tb();return f.moveTo(...l),u.forEach((([t,e])=>{f.lineTo(t,e)})),f.closePath(),cd(n.createElement("path",{})).call(hb,s).style("d",f.toString()).style("stroke",c||a).style("fill",c||a).style("fillOpacity",.4).style("transform",o).call(hb,t).node()}};TT.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const CT={density:TT},RT=()=>(t,e,n,r)=>{const{x:i,series:o}=n,a=Object.entries(n).filter((([t])=>t.startsWith("y"))).map((([,t])=>t)),s=Object.entries(n).filter((([t])=>t.startsWith("size"))).map((([,t])=>t));if(void 0===i||void 0===a||void 0===s)throw new Error("Missing encode for x or y or size channel.");const c=e.x,l=e.series,u=Array.from(t,(e=>{const n=c.getBandWidth(c.invert(+i[e])),u=n*(l?l.getBandWidth(l.invert(+(null==o?void 0:o[e]))):1),f=(+(null==o?void 0:o[e])||0)*n,h=+i[e]+f+u/2;return[...a.map(((n,r)=>[h+ +s[r][e]/t.length,+a[r][e]])),...a.map(((n,r)=>[h-+s[r][e]/t.length,+a[r][e]])).reverse()].map((t=>r.map(t)))}));return[t,u]};function LT(t){var e,n,r,i=t||1;function o(t,o){++e>i&&(r=n,a(1),++e),n[t]=o}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:o(t,e)}}}RT.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:CT,channels:[...pA({shapes:Object.keys(CT)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"size",required:!0},{name:"series",scale:"band"},{name:"size",required:!0,scale:"identity"}],preInference:[...mA(),{type:US},{type:XS}],postInference:[...gA()],interaction:{shareTooltip:!0}};LT(3);function NT(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}const IT=function(t,e=((...t)=>`${t[0]}`),n=16){const r=LT(n);return(...n)=>{const i=e(...n);let o=r.get(i);return r.has(i)?r.get(i):(o=t(...n),r.set(i,o),o)}}(((t,e,n)=>{const r=NT(n,2*t,2*t),i=r.getContext("2d"),o=t,a=t;if(1===e)i.beginPath(),i.arc(o,a,t,0,2*Math.PI,!1),i.fillStyle="rgba(0,0,0,1)",i.fill();else{const n=i.createRadialGradient(o,a,t*e,o,a,t);n.addColorStop(0,"rgba(0,0,0,1)"),n.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=n,i.fillRect(0,0,2*t,2*t)}return r}),(t=>`${t}`));function DT(t,e,n,r,i,o,a){const s=Object.assign({blur:.85,minOpacity:0,opacity:.6,maxOpacity:1,gradient:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]},o);s.minOpacity*=255,s.opacity*=255,s.maxOpacity*=255;const c=NT(a,t,e).getContext("2d"),l=function(t,e){const n=NT(e,256,1).getContext("2d"),r=n.createLinearGradient(0,0,256,1);return function(t){return"string"==typeof t?t.split(" ").map((t=>{const[e,n]=t.split(":");return[+e,n]})):t}(t).forEach((([t,e])=>{r.addColorStop(t,e)})),n.fillStyle=r,n.fillRect(0,0,256,1),n.getImageData(0,0,256,1).data}(s.gradient,a);c.clearRect(0,0,t,e),function(t,e,n,r,i,o){const{blur:a}=i;let s=r.length;for(;s--;){const{x:i,y:c,value:l,radius:u}=r[s],f=Math.min(l,n),h=i-u,d=c-u,p=IT(u,1-a,o),y=(f-e)/(n-e);t.globalAlpha=Math.max(y,.001),t.drawImage(p,h,d)}}(c,n,r,i,s,a);const u=function(t,e,n,r,i){const{minOpacity:o,opacity:a,maxOpacity:s,useGradientOpacity:c}=i,l=e,u=n,f=t.getImageData(0,0,l,u),h=f.data,d=h.length;for(let t=3;t{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:o,blur:a,useGradientOpacity:s}=t,c=BT(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:l,createCanvas:u,document:f}=e;return(t,e,h)=>{const{transform:d}=e,[p,y]=l.getSize(),g=t.map((t=>({x:t[0],y:t[1],value:t[2],radius:t[3]}))),v=fM(t,(t=>t[2])),m=cp(t,(t=>t[2])),b=p&&y?DT(p,y,v,m,g,function(t,e){return Object.keys(t).reduce(((n,r)=>{const i=t[r];return e(i,r)||(n[r]=i),n}),{})}({gradient:n,opacity:r,minOpacity:o,maxOpacity:i,blur:a,useGradientOpacity:s},(t=>void 0===t)),u):{canvas:null};return cd(f.createElement("image",{})).call(hb,h).style("x",0).style("y",0).style("width",p).style("height",y).style("src",b.canvas.toDataURL()).style("transform",d).call(hb,c).node()}};FT.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const zT={heatmap:FT},ZT=t=>(t,e,n,r)=>{const{x:i,y:o,size:a,color:s}=n;return[[0],[Array.from(t,(t=>{const e=a?+a[t]:40;return[...r.map([+i[t],+o[t]]),s[t],e]}))]]};ZT.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:zT,channels:[...pA({shapes:Object.keys(zT)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...mA(),{type:XS},{type:Hj}],postInference:[...yA()]};var WT=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))},$T=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);iWT(void 0,void 0,void 0,(function*(){const{width:n,height:r}=e,{data:i,encode:o={},scale:a,style:s={},layout:c={}}=t,l=$T(t,["data","encode","scale","style","layout"]),u=function(t,e){const{text:n="text",value:r="value"}=e;return t.map((t=>Object.assign(Object.assign({},t),{text:t[n],value:t[r]})))}(i,o);return Rh({},{axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size",shape:"tag"},scale:{x:{range:[0,1]},y:{range:[0,1]}},style:{fontFamily:t=>t.fontFamily}},Object.assign(Object.assign({data:{value:u,transform:[Object.assign({type:"wordCloud",size:[n,r]},c)]},encode:o,scale:a,style:s},l),{axis:!1}))}));GT.props={};const HT=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];HT.props={};const qT=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];qT.props={};const YT=t=>new lv(t);YT.props={};const VT=Symbol("defaultUnknown");function UT(t,e,n){for(let r=0;r`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class QT extends zg{getDefaultOptions(){return{domain:[],range:[],unknown:VT}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&UT(this.domainIndexMap,this.getDomain(),this.domainKey),XT({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&UT(this.rangeIndexMap,this.getRange(),this.rangeKey),XT({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=KT(e),this.rangeKey=KT(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new QT(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}const JT=t=>new QT(t);function tC({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function eC(t){return"object"==typeof t?t.valueOf():t}JT.props={};class nC extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=eC,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(tC({map:this.map,initKey:this.initKey},t))}has(t){return super.has(tC({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}function rC(t){return Math.round(1e12*t)/1e12}function iC(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,c=e.length,l=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(o,c),[u,f]=n,h=f-u,d=h/(2/c*r+1-1/c*i),p=d*i/c,y=d-c*p,g=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(l),v=g.reduce(((t,e)=>t+e)),m=y/v,b=new nC(e.map(((t,e)=>{const n=g[e]*m;return[t,a?Math.floor(n):n]}))),x=new nC(e.map(((t,e)=>{const n=g[e]*m+p;return[t,a?Math.floor(n):n]}))),w=Array.from(x.values()).reduce(((t,e)=>t+e)),O=u+(h-(w-w/c*i))*s;let k=a?Math.round(O):O;const _=new Array(c);for(let t=0;t0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:o,valueBandWidth:a,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return iC(t);const{range:i,paddingOuter:o,paddingInner:a,round:s,align:c}=t;let l,u,f=i[0];const h=i[1]-f,d=2*o,p=r-a;l=h/Math.max(1,d+p),s&&(l=Math.floor(l)),f+=(h-l*(r-a))*c,u=l*(1-a),s&&(f=Math.round(f),u=Math.round(u));const y=new Array(r).fill(0).map(((t,e)=>f+e*l));return{valueStep:l,valueBandWidth:u,adjustedRange:y}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=a,this.adjustedRange=o}}const aC=t=>new oC(t);aC.props={};class sC extends zg{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Dm}}map(t){return Kg(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new sC(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return De(r)&&De(i)?n(r,i,e):[]}}const cC=t=>new sC(t);cC.props={};class lC extends oC{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:VT,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new lC(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const uC=t=>new lC(t);uC.props={};var fC=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,hC="\\d\\d?",dC="\\d\\d",pC="[^\\s]+",yC=/\[([^]*?)\]/gm;function gC(t,e){for(var n=[],r=0,i=t.length;r-1?i:null}};function mC(t){for(var e=[],n=1;n3?0:(t-t%10!=10?1:0)*t%10]}},kC=mC({},OC),_C=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length0?"-":"+")+_C(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+_C(Math.floor(Math.abs(e)/60),2)+":"+_C(Math.abs(e)%60,2)}},EC=function(t){return+t-1},SC=[null,hC],AC=[null,pC],jC=["isPm",pC,function(t,e){var n=t.toLowerCase();return n===e.amPm[0]?0:n===e.amPm[1]?1:null}],PC=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var n=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?n:-n}return 0}],TC=(vC("monthNamesShort"),vC("monthNames"),{default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"}),CC=function(t,e,n){if(void 0===e&&(e=TC.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var r=[];e=(e=TC[e]||e).replace(yC,(function(t,e){return r.push(e),"@@@"}));var i=mC(mC({},kC),n);return(e=e.replace(fC,(function(e){return MC[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))};const RC=1e3,LC=6e4,NC=36e5,IC=864e5,DC=6048e5,BC=2592e6,FC=31536e6;function zC(t,e,n,r){const i=(t,i)=>{i&&((t,e)=>{const i=t=>r(t)%e==0;let o=e;for(;o&&!i(t);)n(t,-1),o-=1})(t,i),e(t)},o=(t,e)=>{const r=new Date(+t-1);return i(r,e),n(r,e),i(r),r};return{ceil:o,floor:(t,e)=>{const n=new Date(+t);return i(n,e),n},range:(t,e,r,a)=>{const s=[],c=Math.floor(r);for(let l=a?o(t,r):o(t);lt),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),WC=zC(RC,(t=>{t.setMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+RC*e)}),(t=>t.getSeconds())),$C=zC(LC,(t=>{t.setSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+LC*e)}),(t=>t.getMinutes())),GC=zC(NC,(t=>{t.setMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+NC*e)}),(t=>t.getHours())),HC=zC(IC,(t=>{t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+IC*e)}),(t=>t.getDate()-1)),qC=zC(BC,(t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)}),(t=>t.getMonth())),YC=zC(DC,(t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)}),((t,e=1)=>{t.setDate(t.getDate()+7*e)}),(t=>{const e=qC.floor(t),n=new Date(+t);return Math.floor((+n-+e)/DC)})),VC=zC(FC,(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getFullYear();t.setFullYear(n+e)}),(t=>t.getFullYear())),UC={millisecond:ZC,second:WC,minute:$C,hour:GC,day:HC,week:YC,month:qC,year:VC},XC=zC(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),KC=zC(RC,(t=>{t.setUTCMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+RC*e)}),(t=>t.getUTCSeconds())),QC=zC(LC,(t=>{t.setUTCSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+LC*e)}),(t=>t.getUTCMinutes())),JC=zC(NC,(t=>{t.setUTCMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+NC*e)}),(t=>t.getUTCHours())),tR=zC(IC,(t=>{t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+IC*e)}),(t=>t.getUTCDate()-1)),eR=zC(BC,(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)}),(t=>t.getUTCMonth())),nR=zC(DC,(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+DC*e)}),(t=>{const e=eR.floor(t),n=new Date(+t);return Math.floor((+n-+e)/DC)})),rR=zC(FC,(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCFullYear();t.setUTCFullYear(n+e)}),(t=>t.getUTCFullYear())),iR={millisecond:XC,second:KC,minute:QC,hour:JC,day:tR,week:nR,month:eR,year:rR};function oR(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:c,millisecond:l}=function(t){const e=t?iR:UC,{year:n,month:r,week:i,day:o,hour:a,minute:s,second:c,millisecond:l}=e;return{tickIntervals:[[c,1],[c,5],[c,15],[c,30],[s,1],[s,5],[s,15],[s,30],[a,1],[a,3],[a,6],[a,12],[o,1],[o,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:l}}(i),u=([t,e])=>t.duration*e,f=r?(a-o)/r:n||5,h=r||(a-o)/f,d=s.length,p=$g(s,h,0,d,u);let y;if(p===d){y=[c,nv(o/c.duration,a/c.duration,f)]}else if(p){const t=h/u(s[p-1]){const o=t>e,a=o?e:t,s=o?t:e,[c,l]=oR(a,s,n,r,i),u=c.range(a,new Date(+s+1),l,!0);return o?u.reverse():u},sR=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=oR(a,s,n,r,i),u=[c.floor(a,l),c.ceil(s,l)];return o?u.reverse():u};function cR(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class lR extends sv{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:aR,interpolate:Vg,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return sR}getTickMethodOptions(){const{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:t,utc:e}=this.options,n=e?iR:UC,r=e?cR:Fg;return e=>CC(r(e),t||function(t,e){const{second:n,minute:r,hour:i,day:o,week:a,month:s,year:c}=e;return n.floor(t)new lR(t);uR.props={};const fR=t=>e=>-t(-e),hR=(t,e)=>{const n=Math.log(t),r=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?fR(r):r},dR=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?fR(n):n},pR=(t,e,n,r=10)=>{const i=t<0,o=dR(r,i),a=hR(r,i),s=e=1;e-=1){const n=t*e;if(n>l)break;n>=c&&h.push(n)}}else for(;u<=f;u+=1){const t=o(u);for(let e=1;el)break;n>=c&&h.push(n)}}2*h.length{const i=t<0,o=hR(r,i),a=dR(r,i),s=t>e,c=s?e:t,l=s?t:e,u=[a(Math.floor(o(c))),a(Math.ceil(o(l)))];return s?u.reverse():u};class gR extends sv{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:Ug,tickMethod:pR,tickCount:5}}chooseNice(){return yR}getTickMethodOptions(){const{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){const{base:t,domain:e}=this.options,n=e[0]<0;return[hR(t,n),dR(t,n)]}clone(){return new gR(this.options)}}const vR=t=>new gR(t);vR.props={};const mR=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class bR extends sv{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:Ug,tickMethod:cv,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[Fg,Fg];const e=.5===t?mR:(t=>e=>e<0?-((-e)**t):e**t)(t),n=(t=>e=>e<0?-((-e)**(1/t)):e**(1/t))(t);return[e,n]}clone(){return new bR(this.options)}}const xR=t=>new bR(t);xR.props={};class wR extends bR{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Ug,tickMethod:cv,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new wR(this.options)}}const OR=t=>new wR(t);OR.props={};const kR=t=>new Mm(t);kR.props={};const _R=t=>new zm(t);_R.props={};const MR=t=>new Bm(t);MR.props={};var ER,SR=function(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a};let AR=ER=class extends lv{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:Fg,tickMethod:cv,tickCount:5}}constructor(t){super(t)}clone(){return new ER(this.options)}};AR=ER=SR([function(t,e){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},n.prototype.initRange=function(){const{interpolator:e}=this.options;this.options.range=t(e)},n.prototype.composeOutput=function(t,n){const{domain:r,interpolator:i,round:o}=this.getOptions(),a=e(r.map(t)),s=o?(t=>e=>{const n=t(e);return De(n)?Math.round(n):n})(i):i;this.output=Wg(s,a,n,t)},n.prototype.invert=void 0}}((function(t){return[t(0),t(1)]}),(t=>{const[e,n]=t;return Wg(Vg(0,1),Zg(e,n))}))],AR);const jR=t=>new AR(t);jR.props={};const PR=t=>new _m(t);function TR({colorDefault:t,colorBlack:e,colorWhite:n,colorStroke:r,colorBackground:i,padding1:o,padding2:a,padding3:s,alpha90:c,alpha65:l,alpha45:u,alpha25:f,alpha10:h,category10:d,category20:p,sizeDefault:y=1,padding:g="auto",margin:v=16}){return{padding:g,margin:v,size:y,color:t,category10:d,category20:p,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:i,plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1,lineCap:"round"}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:e,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,lineWidth:0,connectorStroke:r,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:r,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,lineWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:r,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:r,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:r,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:r,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:r,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[3,4],gridLineWidth:.5,gridStroke:e,gridStrokeOpacity:h,labelAlign:"horizontal",labelFill:e,labelOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:o,line:!1,lineLineWidth:.5,lineStroke:e,lineStrokeOpacity:u,tickLength:4,tickLineWidth:1,tickStroke:e,tickOpacity:u,titleFill:e,titleOpacity:c,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center",lineArrowOffset:6,lineArrowSize:6},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",titleSpacing:12,labelSpacing:4,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",tickDirection:"positive",titlePosition:"bottom",titleSpacing:12,labelSpacing:4,titleTextBaseline:"bottom",titleTransform:"translate(0, 8)"},axisLeft:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:12,titleTextBaseline:"middle",titleDirection:"vertical",titleTransform:"rotate(-90) translate(0, -8)",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:12,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:c,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[o,o],itemValueFill:e,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:e,navButtonFillOpacity:.65,navPageNumFill:e,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:e,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:e,tickStrokeOpacity:.25,rowPadding:o,colPadding:a,maxRows:3,maxCols:3},legendContinuous:{handleHeight:12,handleLabelFill:e,handleLabelFillOpacity:u,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:e,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:e,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:e,labelFillOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:c,tickStroke:e,tickStrokeOpacity:u},label:{fill:e,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:e,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:n,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:e,fontWeight:"normal"},slider:{trackSize:16,trackFill:r,trackFillOpacity:1,selectionFill:t,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:e,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:e,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[0,0,0,0],trackSize:6,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:e,titleFillOpacity:c,titleFontSize:16,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:e,subtitleFillOpacity:l,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"},tooltip:{css:{".g2-tooltip":{"font-family":"sans-serif"}}}}}PR.props={};const CR=TR({colorBlack:"#1D2129",colorWhite:"#ffffff",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),RR=t=>Rh({},CR,t);RR.props={};const LR=t=>Rh({},RR(),{category10:"category10",category20:"category20"},t);LR.props={};const NR=TR({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.25}),IR=t=>Rh({},NR,{tooltip:{crosshairsStroke:"#fff",crosshairsLineWidth:1,crosshairsStrokeOpacity:.25,css:{".g2-tooltip":{background:"#1f1f1f",opacity:.95},".g2-tooltip-title":{color:"#A6A6A6"},".g2-tooltip-list-item-name-label":{color:"#A6A6A6"},".g2-tooltip-list-item-value":{color:"#A6A6A6"}}}},t),DR=t=>Object.assign({},IR(),{category10:"category10",category20:"category20"},t);DR.props={};const BR=TR({colorBlack:"#000",colorWhite:"#fff",colorStroke:"#888",colorDefault:"#4e79a7",colorBackground:"transparent",category10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],category20:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),FR=t=>Rh({},BR,{text:{text:{fontSize:10}},axis:{gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelOpacity:1,labelStrokeOpacity:1,labelFontSize:10,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickStrokeOpacity:1,titleOpacity:1,titleStrokeOpacity:1,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},axisLeft:{gridFilter:(t,e)=>0!==e},axisRight:{gridFilter:(t,e)=>0!==e},legendCategory:{itemLabelFillOpacity:1,itemLabelFontSize:10,itemValueFillOpacity:1,itemValueFontSize:10,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},legendContinuous:{handleLabelFontSize:10,labelFillOpacity:.45,labelFontSize:10},label:{fontSize:10},innerLabel:{fontSize:10},htmlLabel:{fontSize:10},slider:{handleLabelFontSize:10,trackFillOpacity:.05}},t);FR.props={};const zR=t=>(...e)=>{const n=Iv(Object.assign({},{crossPadding:50},t))(...e);return jv(n,t),n};zR.props=Object.assign(Object.assign({},Iv.props),{defaultPosition:"bottom"});const ZR=t=>(...e)=>{const n=Iv(Object.assign({},{crossPadding:10},t))(...e);return jv(n,t),n};ZR.props=Object.assign(Object.assign({},Iv.props),{defaultPosition:"left"});var WR=function(){};var $R=qp({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),GR=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:im(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new al({class:$R.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new al({class:$R.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return(0,We.ZT)(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return Ze(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=this.pageViews,e=(0,We.CR)(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map((function(e,n){return t.map((function(t){return t[n]}))})))||[]}(t.map((function(t){var e=t.getBBox();return[e.width,e.height]}))).map((function(t){return Math.max.apply(Math,(0,We.ev)([],(0,We.CR)(t),!1))})),2),n=e[0],r=e[1],i=this.attributes,o=i.pageWidth,a=void 0===o?n:o,s=i.pageHeight;return{pageWidth:a,pageHeight:void 0===s?r:s}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,r=e.y,i=this.controllerShape,o=this.pageShape,a=o.pageWidth,s=o.pageHeight;return new Tg(n,r,a+i.width,s)},e.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this,i=r.currPage,o=r.playState,a=r.playWindow,s=r.pageViews;if("idle"!==o||t<0||s.length<=0||t>=s.length)return null;s[i].setLocalPosition(0,0),this.prepareFollowingPage(t);var c=(0,We.CR)(this.getFollowingPageDiff(t),2),l=c[0],u=c[1];this.playState="running";var f=Lp(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-u,")")}],n);return Cp(f,(function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()})),f},e.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;var r=t?(n-1+e)%e:Ze(n-1,0,e);return this.goTo(r)},e.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;var r=t?(n+1)%e:Ze(n+1,0,e);return this.goTo(r)},e.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,r=e.pageHeight;n&&r?(this.clipPath=t.maybeAppendByClassName($R.clipPath,"rect").styles({width:n,height:r}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach((function(e,n){t.includes(n)?Ap(e):jp(e)}))},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,r=t.pageInfoGroup,i=this.attributes,o=i.orientation,a=i.controllerPadding,s=r.getBBox(),c=s.width,l=(s.height,(0,We.CR)("horizontal"===o?[-180,0]:[-90,90],2)),u=l[0],f=l[1];e.setLocalEulerAngles(u),n.setLocalEulerAngles(f);var h=e.getBBox(),d=h.width,p=h.height,y=n.getBBox(),g=y.width,v=y.height,m=Math.max(d,c,g),b="horizontal"===o?{offset:[[0,0],[d/2+a,0],[d+c+2*a,0]],textAlign:"start"}:{offset:[[m/2,-p-a],[m/2,0],[m/2,v+a]],textAlign:"center"},x=(0,We.CR)(b.offset,3),w=(0,We.CR)(x[0],2),O=w[0],k=w[1],_=(0,We.CR)(x[1],2),M=_[0],E=_[1],S=(0,We.CR)(x[2],2),A=S[0],j=S[1],P=b.textAlign,T=r.querySelector("text");T&&(T.style.textAlign=P),e.setLocalPosition(O,k),r.setLocalPosition(M,E),n.setLocalPosition(A,j)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,r=e.pageViews,i=e.attributes.formatter;r.length<2||(null===(t=this.pageInfoGroup.querySelector($R.pageInfo.class))||void 0===t||t.attr("text",i(n+1,r.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var e=this.currPage;if(e===t)return[0,0];var n=this.attributes.orientation,r=this.pageShape,i=r.pageWidth,o=r.pageHeight,a=t=2,s=t.maybeAppendByClassName($R.controller,"g");if(Pp(s.node(),a),a){var c=sy(this.attributes,"button"),l=sy(this.attributes,"pageNum"),u=(0,We.CR)(ly(c),2),f=u[0],h=u[1],d=f.size,p=(0,We._T)(f,["size"]),y=!s.select($R.prevBtnGroup.class).node(),g=s.maybeAppendByClassName($R.prevBtnGroup,"g").styles(h);this.prevBtnGroup=g.node();var v=g.maybeAppendByClassName($R.prevBtn,"path"),m=s.maybeAppendByClassName($R.nextBtnGroup,"g").styles(h);this.nextBtnGroup=m.node(),[v,m.maybeAppendByClassName($R.nextBtn,"path")].forEach((function(t){t.styles((0,We.pi)((0,We.pi)({},p),{transformOrigin:"center"})),ky(t.node(),d,!0)}));var b=s.maybeAppendByClassName($R.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName($R.pageInfo,"text").styles(l),this.updatePageInfo(),s.node().setLocalPosition(i+n,o/2),y&&(this.prevBtnGroup.addEventListener("click",(function(){e.prev()})),this.nextBtnGroup.addEventListener("click",(function(){e.next()})))}},e.prototype.render=function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i;this.attr("transform","translate(".concat(r,", ").concat(o,")"));var a=Hp(e);this.renderClipPath(a),this.renderController(a),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=Ah((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener(fc.INSERTED,e),this.playWindow.addEventListener(fc.REMOVED,e)},e}(Zp),HR=qp({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");var qR=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new nl({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return(0,We.ZT)(e,t),Object.defineProperty(e.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,r=t.node().getBBox(),i=r.width,o=r.height,a=e.node().getBBox(),s=a.width,c=a.height;return{markerWidth:n,labelWidth:i,valueWidth:s,height:Math.max(n,o,c)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var e=(0,We.CR)(ig(t),2),n=e[0],r=e[1],i=this.showValue?r:0,o=n+i;return[n/o,i/o]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t,e=this.attributes,n=e.markerSize,r=e.width,i=this.actualSpace,o=i.markerWidth,a=i.height,s=this.actualSpace,c=s.labelWidth,l=s.valueWidth,u=(0,We.CR)(this.spacing,2),f=u[0],h=u[1];if(r){var d=r-n-f-h,p=(0,We.CR)(this.span,2),y=p[0],g=p[1];c=(t=(0,We.CR)([y*d,g*d],2))[0],l=t[1]}return{width:o+c+l+f+h,height:a,markerWidth:o,labelWidth:c,valueWidth:l}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes.spacing;if(!t)return[0,0];var e=(0,We.CR)(ig(t),2),n=e[0],r=e[1];return this.showValue?[n,r]:[n,0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,o=t.height,a=(0,We.CR)(this.spacing,2),s=a[0];return{height:o,width:i,markerWidth:e,labelWidth:n,valueWidth:r,position:[e/2,e+s,e+n+s+a[1]]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=function(t){var e=t.querySelector(HR.marker.class);return e?e.style:{}}(this.markerGroup.node()),e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,i=void 0===r?t.strokeWidth:r,o=e.markerLineWidth,a=void 0===o?t.lineWidth:o,s=e.markerStroke,c=void 0===s?t.stroke:s,l=+(i||a||(c?1:0))*Math.sqrt(2),u=this.markerGroup.node().getBBox(),f=u.width,h=u.height;return(1-l/Math.max(f,h))*n},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,r=sy(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(HR.markerGroup,"g").style("zIndex",0),Wp(!!n,this.markerGroup,(function(){var t,i=e.markerGroup.node(),o=null===(t=i.childNodes)||void 0===t?void 0:t[0],a="string"==typeof n?new am({style:{symbol:n},className:HR.marker.name}):n();o?a.nodeName===o.nodeName?o instanceof am?o.update((0,We.pi)((0,We.pi)({},r),{symbol:n})):(!function(t,e){var n,r,i=e.attributes;try{for(var o=(0,We.XA)(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=(0,We.CR)(a.value,2),c=s[0],l=s[1];"id"!==c&&"className"!==c&&t.attr(c,l)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(o,a),Hp(o).styles(r)):(o.remove(),Hp(a).attr("className",HR.marker.name).styles(r),i.appendChild(a)):(a instanceof am||Hp(a).attr("className",HR.marker.name).styles(r),i.appendChild(a)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var s=ky(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(s,")")}))},e.prototype.renderLabel=function(t){var e=sy(this.attributes,"label"),n=e.text,r=(0,We._T)(e,["text"]);this.labelGroup=t.maybeAppendByClassName(HR.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(HR.label,(function(){return Oy(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=sy(this.attributes,"value"),r=n.text,i=(0,We._T)(n,["text"]);this.valueGroup=t.maybeAppendByClassName(HR.valueGroup,"g").style("zIndex",0),Wp(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(HR.value,(function(){return Oy(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=sy(this.attributes,"background");this.background=t.maybeAppendByClassName(HR.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(HR.background,"rect").styles((0,We.pi)({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=(0,We.CR)(t.position,3),o=i[0],a=i[1],s=i[2],c=r/2;this.markerGroup.styles({transform:"translate(".concat(o,", ").concat(c,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(a,", ").concat(c,")")}),eg(this.labelGroup.select(HR.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(c,")")}),eg(this.valueGroup.select(HR.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=Hp(e),r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o;n.styles({transform:"translate(".concat(i,", ").concat(a,")")}),this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.adjustLayout()},e}(Zp),YR=qp({page:"item-page",navigator:"navigator",item:"item"},"items"),VR=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},UR=function(t){function e(e){var n=t.call(this,e,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:WR,mouseenter:WR,mouseleave:WR})||this;return n.navigatorShape=[0,0],n}return(0,We.ZT)(e,t),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,r=t.data;if(!e&&!n)throw new Error("gridRow and gridCol can not be set null at the same time");return e&&n?[e,n]:e?[e,r.length]:[r.length,n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,e=t.data,n=t.layout,r=sy(this.attributes,"item"),i=e.map((function(t,i){var o=t.id,a=void 0===o?i:o,s=t.label,c=t.value;return{id:"".concat(a),index:i,style:(0,We.pi)({layout:n,labelText:s,valueText:c},Object.fromEntries(Object.entries(r).map((function(n){var r=(0,We.CR)(n,2);return[r[0],uy(r[1],[t,i,e])]}))))}}));return i},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,e=this.attributes,n=e.orientation,r=e.width,i=e.rowPadding,o=e.colPadding,a=(0,We.CR)(this.navigatorShape,1)[0],s=(0,We.CR)(this.grid,2),c=s[0],l=s[1],u=l*c,f=0;return this.pageViews.children.map((function(e,s){var h,d,p=Math.floor(s/u),y=s%u,g=t.ifHorizontal(l,c),v=[Math.floor(y/g),y%g];"vertical"===n&&v.reverse();var m=(0,We.CR)(v,2),b=m[0],x=m[1],w=(r-a-(l-1)*o)/l,O=e.getBBox().height,k=(0,We.CR)([0,0],2),_=k[0],M=k[1];return"horizontal"===n?(_=(h=(0,We.CR)([f,b*(O+i)],2))[0],M=h[1],f=x===l-1?0:f+w+o):(_=(d=(0,We.CR)([x*(w+o),f],2))[0],M=d[1],f=b===c-1?0:f+O+i),{page:p,index:s,row:b,col:x,pageIndex:y,width:w,height:O,x:_,y:M}}))},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,o=(0,We.CR)(this.navigatorShape,1)[0],a=(0,We.CR)(this.grid,2),s=a[0],c=a[1],l=(0,We.CR)([e-o,n],2),u=l[0],f=l[1],h=(0,We.CR)([0,0,0,0,0,0,0,0],8),d=h[0],p=h[1],y=h[2],g=h[3],v=h[4],m=h[5],b=h[6],x=h[7];return this.pageViews.children.map((function(t,e){var n,o,a,l,h=t.getBBox(),w=h.width,O=h.height,k=0===b?0:i,_=b+k+w;return _<=u&&VR(v,(function(t){return t0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return sm(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(YR.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(YR.page.class).forEach((function(e){t.removeChild(e).destroy()}))},e.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave;this.flattenPage(t);var o=this.dispatchCustomEvent.bind(this);Hp(t).selectAll(YR.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new qR({style:e})})).attr("className",YR.item.name).on("click",(function(){null==n||n(this),o("itemClick",{item:this})})).on("pointerenter",(function(){null==r||r(this),o("itemMouseenter",{item:this})})).on("pointerleave",(function(){null==i||i(this),o("itemMouseleave",{item:this})}))}),(function(t){return t.each((function(t){var e=t.style;this.update(e)}))}),(function(t){return t.remove()}))},e.prototype.relayoutNavigator=function(){var t,e=this.attributes,n=e.layout,r=e.width,i=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,o=(0,We.CR)(this.navigatorShape,2),a=o[0],s=o[1];this.navigator.update("grid"===n?{pageWidth:r-a,pageHeight:i-s}:{})},e.prototype.adjustLayout=function(){var t,e,n=this,r=Object.entries((t=this.itemsLayout,e="page",t.reduce((function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t}),{}))).map((function(t){var e=(0,We.CR)(t,2);return{page:e[0],layouts:e[1]}})),i=(0,We.ev)([],(0,We.CR)(this.navigator.getContainer().children),!1);r.forEach((function(t){var e=t.layouts,r=n.pageViews.appendChild(new al({className:YR.page.name}));e.forEach((function(t){var e=t.x,n=t.y,o=t.index,a=t.width,s=t.height,c=i[o];r.appendChild(c),function(t,e,n){var r=t,i=ze(e)?e.split("."):e;i.forEach((function(t,e){e0?null==r?void 0:r.getOptions().domain:n.data).map(((e,r)=>{var o;return i?i.map(e||"point"):(null===(o=null==t?void 0:t.style)||void 0===o?void 0:o.shape)||n.defaultShape||"point"}));"string"==typeof e&&o.push([e,a])}if(0===o.length)return["point",["point"]];if(1===o.length)return o[0];if(!n)return o[0];const{range:a}=n.getOptions();return o.map((([t,e])=>{let n=0;for(let t=0;te[0]-t[0]))[0][1]}(n,i),{itemMarker:s,itemMarkerSize:c}=t,l=(t,e)=>{var n,i,a;const s=(null===(a=null===(i=null===(n=r[`mark.${o}`])||void 0===n?void 0:n.props)||void 0===i?void 0:i.shape[t])||void 0===a?void 0:a.props.defaultMarker)||KR(t.split(".")),l="function"==typeof c?c(e):c;return()=>function(t,e){var{d:n,fill:r,lineWidth:i,path:o,stroke:a,color:s}=e,c=Lu(e,["d","fill","lineWidth","path","stroke","color"]);const l=lf.get(t)||lf.get("point");return(...t)=>new dl({style:Object.assign(Object.assign({},c),{d:l(...t),stroke:l.style.includes("stroke")?s||a:"",fill:l.style.includes("fill")?s||r:"",lineWidth:l.style.includes("lineWidth")?i||i||2:0})})}(s,{color:e.color})(0,0,l)},u=t=>`${a[t]}`;return _v(n,"shape")&&!s?(t,e)=>l(u(e),t):"function"==typeof s?(t,e)=>{const n=s(t.id,e);return"string"==typeof n?l(n,t):n}:(t,e)=>l(s||u(e),t)}function tL(t){const e=_v(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function eL(t,e){const{labelFormatter:n=(t=>`${t}`)}=t,{scales:r,theme:i}=e,o=function(t,e){const n=_v(t,"size");return n instanceof sC?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),a={itemMarker:JR(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:tL(r)},s="string"==typeof n?Vd(n):n,c=_v(r,"color"),l=function(t){return t.find((t=>t.getOptions().domain.length>0)).getOptions().domain}(r),u=c?t=>c.map(t):()=>e.theme.color;return Object.assign(Object.assign({},a),{data:l.map((t=>({id:t,label:s(t),color:u(t)})))})}const nL=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,cols:c,itemMarker:l}=t,u=QR(t,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker"]),{gridRow:f}=u;return e=>{const{value:r,theme:i}=e,{bbox:a}=r,{width:l,height:h}=function(t,e,n){const{position:r}=e;if("center"===r){const{bbox:e}=t,{width:n,height:r}=e;return{width:n,height:r}}const{width:i,height:o}=Ev(t,e,n);return{width:i,height:o}}(r,t,nL),d=wv(o,n),p=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(o)?"vertical":"horizontal",width:l,height:h,layout:void 0!==c?"grid":"flex"},void 0!==c&&{gridCol:c}),void 0!==f&&{gridRow:f}),{titleText:xv(s)}),eL(t,e)),{legendCategory:y={}}=i,g=Sv(Object.assign({},y,p,u)),v=new kv({style:Object.assign(Object.assign({x:a.x,y:a.y,width:a.width,height:a.height},d),{subOptions:g})});return v.appendChild(new XR({className:"legend-category",style:g})),v}};nL.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const rL=t=>()=>new al;rL.props={};var iL=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{if(!i)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},oL(0,h.max[1]+o,n,a)),{fontSize:12,textBaseline:"top",text:i}),f))}))}},class extends il{constructor(t){super(t),this.descriptor=sL}connectedCallback(){var t,e;null===(e=(t=this.descriptor).render)||void 0===e||e.call(t,this.attributes,this)}update(t={}){var e,n;this.attr(Rh({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var sL;const cL=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new aL({style:Rh({},n.title,Object.assign({x:r,y:i,width:o,height:a},t))})};cL.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};var lL=function(t){if("object"!=typeof t||null===t)return t;var e;if(vn(t)){e=[];for(var n=0,r=t.length;nr&&(n=o,r=a)}return n}};function bL(t){return 0===t.length?[0,0]:[mn(vL(t,(function(t){return mn(t)||0}))),bn(mL(t,(function(t){return bn(t)||0})))]}function xL(t){for(var e=uL(t),n=e[0].length,r=(0,We.CR)([Array(n).fill(0),Array(n).fill(0)],2),i=r[0],o=r[1],a=0;a=0?(s[c]+=i[c],i[c]=s[c]):(s[c]+=o[c],o[c]=s[c]);return e}var wL=function(t){function e(e){return t.call(this,e,{type:"line",x:0,y:0,width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return(0,We.ZT)(e,t),Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||0===(null==t?void 0:t.length))return[[]];var e=uL(t);return De(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?xL(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,e=(0,We.CR)(t.getOptions().domain||[0,0],2),n=e[0],r=e[1];return r<0?t.map(r):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,e=this.attributes,n=e.type,r=e.isStack,i=e.smooth;if("line"!==n)throw new Error("linesStyle can only be used in line type");var o=sy(this.attributes,"area"),a=sy(this.attributes,"line"),s=this.containerShape.width,c=this.data;if(0===c[0].length)return{lines:[],areas:[]};var l=this.scales,u=function(t,e){var n,r=e.x,i=e.y,o=(0,We.CR)(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=(0,We.CR)([a,s],2),s=n[0],a=n[1]),t.map((function(t){return t.map((function(t,e){return[r.map(e),Ze(i.map(t),s,a)]}))}))}(c,{type:"line",x:l.x,y:l.y}),f=[];if(o){var h=this.baseline;f=r?i?function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=t[i],a=yL(o),s=void 0;if(0===i)s=gL(a,e,n);else{var c=yL(t[i-1],!0),l=o[0];c[0][0]="L",s=(0,We.ev)((0,We.ev)((0,We.ev)([],(0,We.CR)(a),!1),(0,We.CR)(c),!1),[(0,We.ev)(["M"],(0,We.CR)(l),!1),["Z"]],!1)}r.push(s)}return r}(u,s,h):function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=pL(t[i]),a=void 0;if(0===i)a=gL(o,e,n);else{var s=pL(t[i-1],!0);s[0][0]="L",a=(0,We.ev)((0,We.ev)((0,We.ev)([],(0,We.CR)(o),!1),(0,We.CR)(s),!1),[["Z"]],!1)}r.push(a)}return r}(u,s,h):function(t,e,n,r){return t.map((function(t){return gL(e?yL(t):pL(t),n,r)}))}(u,i,s,h)}return{lines:u.map((function(e,n){return(0,We.pi)({stroke:t.getColor(n),d:i?yL(e):pL(e)},a)})),areas:f.map((function(e,n){return(0,We.pi)({d:e,fill:t.getColor(n)},o)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=sy(this.attributes,"column"),n=this.attributes,r=n.isStack,i=n.type,o=n.scale;if("column"!==i)throw new Error("columnsStyle can only be used in column type");var a=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};r&&(s=xL(s));var c=this.createScales(s),l=c.x,u=c.y,f=(0,We.CR)(bL(s),2),h=f[0],d=f[1],p=new lv({domain:[0,d-(h>0?0:h)],range:[0,a*o]}),y=l.getBandWidth(),g=this.rawData;return{columns:s.map((function(n,i){return n.map((function(n,o){var a=y/s.length;return(0,We.pi)((0,We.pi)({fill:t.getColor(i)},e),r?{x:l.map(o),y:u.map(n),width:y,height:p.map(g[i][o])}:{x:l.map(o)+a*i,y:n>=0?u.map(n):u.map(0),width:a,height:p.map(Math.abs(n))})}))}))}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,r,i;(n=e,r=".container",i="rect",n.querySelector(r)?Hp(n).select(r):Hp(n).append(i)).attr("className","container").node();var o=t.type,a=t.x,s=t.y,c="spark".concat(o),l=(0,We.pi)({x:a,y:s},"line"===o?this.linesStyle:this.columnsStyle);Hp(e).selectAll(".spark").data([o]).join((function(t){return t.append((function(t){return"line"===t?new hL({className:c,style:l}):new fL({className:c,style:l})})).attr("className","spark ".concat(c))}),(function(t){return t.update(l)}),(function(t){return t.remove()}))},e.prototype.getColor=function(t){var e=this.attributes.color;return vn(e)?e[t%e.length]:In(e)?e.call(null,t):e},e.prototype.createScales=function(t){var e,n,r=this.attributes,i=r.type,o=r.scale,a=r.range,s=void 0===a?[]:a,c=r.spacing,l=this.containerShape,u=l.width,f=l.height,h=(0,We.CR)(bL(t),2),d=h[0],p=h[1],y=new lv({domain:[null!==(e=s[0])&&void 0!==e?e:d,null!==(n=s[1])&&void 0!==n?n:p],range:[f,f*(1-o)]});return"line"===i?{type:i,x:new lv({domain:[0,t[0].length-1],range:[0,u]}),y:y}:{type:i,x:new oC({domain:t[0].map((function(t,e){return e})),range:[0,u],paddingInner:c,paddingOuter:c/2,align:.5}),y:y}},e.tag="sparkline",e}(Zp),OL=function(t){function e(e){var n=t.call(this,e,(0,We.pi)((0,We.pi)((0,We.pi)({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},cy(Vv,"handle")),cy(qv,"handleIcon")),cy(Yv,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(Wv(e));var r=n.availableSpace,i=r.x,o=r.y,a=n.getBBox(),s=a.x,c=a.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([i,o])-n.getOrientVal([+s,+c])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(t){var e=n.attributes,r=e.slidable,i=e.brushable,o=e.type;t.stopPropagation();var a=n.getOrientVal(Wv(t)),s=a-n.prevPos;if(s){var c=n.getRatio(s);switch(n.target){case"start":r&&n.setValuesOffset(c);break;case"end":r&&n.setValuesOffset(0,c);break;case"selection":r&&n.setValuesOffset(c,c);break;case"track":if(!i)return;n.selectionWidth+=c,"range"===o?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0)}n.prevPos=a}},n.onDragEnd=function(){document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointerup",n.onDragEnd),n.target="",n.updateHandlesPosition(!1)},n.onValueChange=function(t){var e=n.attributes,r=e.onChange,i=e.type,o="range"===i?t:t[1],a="range"===i?n.getValues():n.getValues()[1],s=new ec("valuechange",{detail:{oldValue:o,value:a}});n.dispatchEvent(s),null==r||r(a)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return(0,We.ZT)(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){if("horizontal"!==this.attributes.orientation)return null;var t=sy(this.attributes,"sparkline");return(0,We.pi)((0,We.pi)({zIndex:0},this.availableSpace),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,n=t.trackSize,r=(0,We.CR)(this.getOrientVal([[e,n],[n,e]]),2);return{width:r[0],height:r[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=(t.x,t.y,t.padding),n=(0,We.CR)(ig(e),4),r=n[0],i=n[1],o=n[2],a=n[3],s=this.shape;return{x:a,y:r,width:s.width-(a+i),height:s.height-(r+o)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)},e.prototype.updateSelectionArea=function(t){var e=this.calcSelectionArea();this.foregroundGroup.selectAll(Uv.selection.class).each((function(n,r){Np(this,e[r],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&Np(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&Np(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1);var n=this.values,r=this.clampValues(t);this.attributes.values=r,this.setValues(r),e&&this.onValueChange(n)},e.prototype.renderTrack=function(t){var e=this.attributes,n=e.x,r=e.y,i=sy(this.attributes,"track");this.trackShape=Hp(t).maybeAppendByClassName(Uv.track,"rect").styles((0,We.pi)((0,We.pi)({x:n,y:r},this.shape),i))},e.prototype.renderBrushArea=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.brushable;this.brushArea=Hp(t).maybeAppendByClassName(Uv.brushArea,"rect").styles((0,We.pi)({x:n,y:r,fill:"transparent",cursor:i?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var e=this,n=this.attributes,r=n.x,i=n.y;Wp("horizontal"===n.orientation,Hp(t).maybeAppendByClassName(Uv.sparklineGroup,"g"),(function(t){var n=(0,We.pi)((0,We.pi)({},e.sparklineStyle),{x:r,y:i});t.maybeAppendByClassName(Uv.sparkline,(function(){return new wL({style:n})})).update(n)}))},e.prototype.renderHandles=function(){var t,e=this,n=this.attributes,r=n.showHandle,i=n.type,o=r?"range"===i?["start","end"]:["end"]:[],a=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll(Uv.handle.class).data(o.map((function(t){return{type:t}})),(function(t){return t.type})).join((function(t){return t.append((function(t){var n=t.type;return new Qv({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(Uv.handle.name," ").concat(e,"-handle"));var n="".concat(e,"Handle");a[n]=this,this.addEventListener("pointerdown",a.onDragStart(e))}))}),(function(t){return t.each((function(t){var e=t.type;this.update(a.getHandleStyle(e))}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");a[n]=void 0})).remove()}))},e.prototype.renderSelection=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.type,o=e.selectionType;this.foregroundGroup=Hp(t).maybeAppendByClassName(Uv.foreground,"g");var a=sy(this.attributes,"selection"),s=function(t){return t.style("visibility",(function(t){return t.show?"visible":"hidden"})).style("cursor",(function(t){return"select"===o?"grab":"invert"===o?"crosshair":"default"})).styles((0,We.pi)((0,We.pi)({},a),{transform:"translate(".concat(n,", ").concat(r,")")}))},c=this;this.foregroundGroup.selectAll(Uv.selection.class).data("value"===i?[]:this.calcSelectionArea().map((function(t,e){return{style:(0,We.pi)({},t),index:e,show:"select"===o?1===e:1!==e}})),(function(t){return t.index})).join((function(t){return t.append("rect").attr("className",Uv.selection.name).call(s).each((function(t,e){var n=this;1===e?(c.selectionShape=Hp(this),this.on("pointerdown",(function(t){n.attr("cursor","grabbing"),c.onDragStart("selection")(t)})),c.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),c.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),c.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",(function(){n.attr("cursor","grabbing")})),this.addEventListener("pointerup",(function(){n.attr("cursor","pointer")})),this.addEventListener("pointerover",(function(){n.attr("cursor","pointer")}))):this.on("pointerdown",c.onDragStart("track"))}))}),(function(t){return t.call(s)}),(function(t){return t.remove()})),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderBrushArea(e),this.renderSelection(e)},e.prototype.clampValues=function(t,e){var n;void 0===e&&(e=4);var r=(0,We.CR)(this.range,2),i=r[0],o=r[1],a=(0,We.CR)(this.getValues().map((function(t){return Zv(t,e)})),2),s=a[0],c=a[1],l=Array.isArray(t)?t:[s,null!=t?t:c],u=(0,We.CR)((l||[s,c]).map((function(t){return Zv(t,e)})),2),f=u[0],h=u[1];if("value"===this.attributes.type)return[0,Ze(h,i,o)];f>h&&(f=(n=(0,We.CR)([h,f],2))[0],h=n[1]);var d=h-f;return d>o-i?[i,o]:fo?c===o&&s===f?[f,o]:[o-d,o]:[f,h]},e.prototype.calcSelectionArea=function(t){var e=(0,We.CR)(this.clampValues(t),2),n=e[0],r=e[1],i=this.availableSpace,o=i.x,a=i.y,s=i.width,c=i.height;return this.getOrientVal([[{y:a,height:c,x:o,width:n*s},{y:a,height:c,x:n*s+o,width:(r-n)*s},{y:a,height:c,x:r*s,width:(1-r)*s}],[{x:o,width:s,y:a,height:n*c},{x:o,width:s,y:n*c+a,height:(r-n)*c},{x:o,width:s,y:r*c,height:(1-r)*c}]])},e.prototype.calcHandlePosition=function(t){var e=this.attributes.handleIconOffset,n=this.availableSpace,r=n.x,i=n.y,o=n.width,a=n.height,s=(0,We.CR)(this.clampValues(),2),c=s[0],l=s[1],u="start"===t?-e:e,f=("start"===t?c:l)*this.getOrientVal([o,a])+u;return{x:r+this.getOrientVal([f,o/2]),y:i+this.getOrientVal([a/2,f])}},e.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:"end"===t?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var e,n=this.attributes,r=n.type,i=n.orientation,o=n.formatter,a=n.autoFitLabel,s=sy(this.attributes,"handle"),c=sy(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),h=o("start"===t?f[0]:f[1]),d=new $p({style:(0,We.pi)((0,We.pi)((0,We.pi)({},c),this.inferTextStyle(t)),{text:h})}),p=d.getBBox(),y=p.width,g=p.height;if(d.destroy(),!a){if("value"===r)return{text:h,x:0,y:-g-l};var v=l+u+("horizontal"===i?y/2:0);return(e={text:h})["horizontal"===i?"x":"y"]="start"===t?-v:v,e}var m=0,b=0,x=this.availableSpace,w=x.width,O=x.height,k=this.calcSelectionArea()[1],_=k.x,M=k.y,E=k.width,S=k.height,A=l+u;if("horizontal"===i){var j=A+y/2;if("start"===t)m=_-A-y>0?-j:j;else m=w-_-E-A>y?j:-j}else{var P=g+A;b="start"===t?M-u>g?-P:A:O-(M+S)-u>g?P:-A}return{x:m,y:b,text:h}},e.prototype.getHandleLabelStyle=function(t){var e=sy(this.attributes,"handleLabel");return(0,We.pi)((0,We.pi)((0,We.pi)({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=sy(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return(0,We.pi)({cursor:n,shape:t,size:r},e)},e.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.showLabel,o=e.showLabelOnInteraction,a=e.orientation,s=this.calcHandlePosition(t),c=s.x,l=s.y,u=this.calcHandleText(t),f=i;return!i&&o&&(f=!!this.target),(0,We.pi)((0,We.pi)((0,We.pi)({},cy(this.getHandleIconStyle(),"icon")),cy((0,We.pi)((0,We.pi)({},this.getHandleLabelStyle(t)),u),"label")),{transform:"translate(".concat(c+n,", ").concat(l+r,")"),orientation:a,showLabel:f,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,r=t.height;return e||Math.floor((this.getOrientVal([+r,+n])+4)/2.4)},e.prototype.getOrientVal=function(t){var e=(0,We.CR)(t,2),n=e[0],r=e[1];return"horizontal"===this.attributes.orientation?n:r},e.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=this.attributes.type,i=(0,We.CR)(this.getValues(),2),o=[i[0]+("range"===r?t:0),i[1]+e].sort();n?this.setValues(o):this.innerSetValues(o,!0)},e.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,r=e.height;return t/this.getOrientVal([n,r])},e.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,(function(t){t.stopPropagation(),r.dispatchEvent(new ec(n,{detail:t}))}))},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(t){if(this.attributes.scrollable){var e=t.deltaX,n=t.deltaY||e,r=this.getRatio(n);this.setValuesOffset(r,r,!0)}},e.tag="slider",e}(Zp),kL=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{orientation:e,labelFormatter:n,size:r,style:i={},position:o}=t,a=kL(t,["orientation","labelFormatter","size","style","position"]);return r=>{var s;const{scales:[c],value:l,theme:u,coordinate:f}=r,{bbox:h}=l,{width:d,height:p}=h,{slider:y={}}=u,g=(null===(s=c.getFormatter)||void 0===s?void 0:s.call(c))||(t=>t+""),v="string"==typeof n?Vd(n):n,m="horizontal"===e,b=vp(f)&&m,{trackSize:x=y.trackSize}=i,[w,O]=function(t,e,n){const{x:r,y:i,width:o,height:a}=t;return"left"===e?[r+o-n,i]:"right"===e||"bottom"===e?[r,i]:"top"===e?[r,i+a-n]:void 0}(h,o,x);return new OL({className:"slider",style:Object.assign({},y,Object.assign(Object.assign({x:w,y:O,trackLength:m?d:p,orientation:e,formatter:t=>(v||g)(Mx(c,b?1-t:t,!0)),sparklineData:ML(t,r)},i),a))})}};function ML(t,e){const{markState:n}=e;return vn(t.sparklineData)?t.sparklineData:function(t,e){const[n]=Array.from(t.entries()).filter((([t])=>"line"===t.type||"area"===t.type)).filter((([t])=>t.slider)).map((([t])=>{const{encode:n,slider:r}=t;if(null==r?void 0:r.x){const t=t=>{const e=n[t];return[t,e?e.value:void 0]};return Object.fromEntries(e.map(t))}}));if(!(null==n?void 0:n.series))return null==n?void 0:n.y;const r=n.series.reduce(((t,e,r)=>(t[e]=t[e]||[],t[e].push(n.y[r]),t)),{});return Object.values(r)}(n,["y","series"])}_L.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const EL=t=>_L(Object.assign(Object.assign({},t),{orientation:"horizontal"}));EL.props=Object.assign(Object.assign({},_L.props),{defaultPosition:"bottom"});const SL=t=>_L(Object.assign(Object.assign({},t),{orientation:"vertical"}));SL.props=Object.assign(Object.assign({},_L.props),{defaultPosition:"left"});var AL=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return n.range=[0,1],n.onValueChange=function(t){var e=n.attributes.value;if(t!==e){var r={detail:{oldValue:t,value:e}};n.dispatchEvent(new ec("scroll",r)),n.dispatchEvent(new ec("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=(0,We.CR)(n.getLocalPosition(),2),r=e[0],i=e[1],o=(0,We.CR)(n.padding,4),a=o[0],s=o[3],c=n.getOrientVal([r+s,i+a]),l=(n.getOrientVal(Wv(t))-c)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new ec("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new ec("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new ec("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new ec("trackMouseleave",{detail:t.detail}))},n}return(0,We.ZT)(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return ig(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=(0,We.CR)(this.range,2),n=e[0],r=e[1];return Ze(t,n,r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,n=t.trackLength;return void 0===n?e:n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=(0,We.CR)(this.padding,4),r=n[0],i=n[1],o=n[2],a=n[3],s=(0,We.CR)(this.getOrientVal([[e,t],[t,e]]),2);return{x:a,y:r,width:+s[0]-(a+i),height:+s[1]-(r+o)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.trackSize;return e?n/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.thumbRadius;if(!e)return 0;var r=this.availableSpace,i=r.width,o=r.height;return n||this.getOrientVal([o,i])/2},enumerable:!1,configurable:!0}),e.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,n=e.viewportLength/e.contentLength,r=(0,We.CR)(this.range,2),i=r[0],o=t*(r[1]-i-n);return[o,o+n]},e.prototype.getValue=function(){return this.value},e.prototype.renderSlider=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,o=e.trackSize,a=e.padding,s=e.slidable,c=sy(this.attributes,"track"),l=sy(this.attributes,"thumb"),u=(0,We.pi)((0,We.pi)({x:n,y:r,brushable:!1,orientation:i,padding:a,selectionRadius:this.thumbRadius,showHandle:!1,slidable:s,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:o,values:this.getValues()},cy(c,"track")),cy(l,"selection"));this.slider=Hp(t).maybeAppendByClassName("scrollbar",(function(){return new OL({style:u})})).update(u).node()},e.prototype.render=function(t,e){this.renderSlider(e)},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=(0,We.CR)(this.range,2),i=r[0],o=r[1];this.slider.setValues(this.getValues(Ze(t,i,o)),e),this.onValueChange(n)},e.prototype.bindEvents=function(){var t=this;this.slider.addEventListener("trackClick",(function(e){e.stopPropagation(),t.onTrackClick(e.detail)})),this.onHover()},e.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},e.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},e.tag="scrollbar",e}(Zp),jL=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{orientation:e,labelFormatter:n,style:r}=t,i=jL(t,["orientation","labelFormatter","style"]);return({scales:[t],value:n,theme:o})=>{const{bbox:a}=n,{x:s,y:c,width:l,height:u}=a,{scrollbar:f={}}=o,{ratio:h,range:d}=t.getOptions(),p="horizontal"===e?l:u,y=p/h,[g,v]=d,m=v>g?0:1;return new AL({className:"g2-scrollbar",style:Object.assign({},f,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:s,y:c,trackLength:p,value:m}),i),{orientation:e,contentLength:y,viewportLength:p}))})}};PL.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const TL=t=>PL(Object.assign(Object.assign({},t),{orientation:"horizontal"}));TL.props=Object.assign(Object.assign({},PL.props),{defaultPosition:"bottom"});const CL=t=>PL(Object.assign(Object.assign({},t),{orientation:"vertical"}));CL.props=Object.assign(Object.assign({},PL.props),{defaultPosition:"left"});const RL=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=vp(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],h=[{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.01},{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l}];return o.animate(h,Object.assign(Object.assign({},i),t))}},LL=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=vp(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],h=[{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return o.animate(h,Object.assign(Object.assign({},i),t))}},NL=(t,e)=>{const n=1e-4,{coordinate:r}=e;return Ol({name:"scaleInYRadius",inherits:!1,initialValue:"",interpolable:!0,syntax:ii.NUMBER}),(e,i,o)=>{const[a]=e;return mp(r)?(e=>{const{__data__:i,style:a}=e,{radius:s=0,inset:c=0,fillOpacity:l=1,strokeOpacity:u=1,opacity:f=1}=a,{points:h,y:d,y1:p}=i,y=gb(r,h,[d,p]),{innerRadius:g,outerRadius:v}=y,m=Ux().cornerRadius(s).padAngle(c*Math.PI/180),b=new dl({}),x=t=>(b.attr({d:m(t)}),la(b)),w=[{scaleInYRadius:g+n,fillOpacity:0,strokeOpacity:0,opacity:0},{scaleInYRadius:g+n,fillOpacity:l,strokeOpacity:u,opacity:f,offset:.01},{scaleInYRadius:v,fillOpacity:l,strokeOpacity:u,opacity:f}],O=e.animate(w,Object.assign(Object.assign({},o),t));return O.onframe=function(){e.style.d=x(Object.assign(Object.assign({},y),{outerRadius:Number(e.style.scaleInYRadius)}))},O.onfinish=function(){e.style.d=x(Object.assign(Object.assign({},y),{outerRadius:v}))},O})(a):(e=>{const{style:n}=e,{transform:i="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=n,[l,u]=vp(r)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],f=[{transform:`${i} ${u}`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${i} ${u}`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.01},{transform:`${i} scale(1, 1)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c}];return e.animate(f,Object.assign(Object.assign({},o),t))})(a)}},IL=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=vp(n)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],h=[{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return o.animate(h,Object.assign(Object.assign({},i),t))}},DL=(t,e)=>{const n=1e-4;Ol({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:ii.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!mp(r))return RL(t,e)(i,o,a);const{__data__:c,style:l}=s,{radius:u=0,inset:f=0,fillOpacity:h=1,strokeOpacity:d=1,opacity:p=1}=l,{points:y,y:g,y1:v}=c,m=Ux().cornerRadius(u).padAngle(f*Math.PI/180),b=gb(r,y,[g,v]),{startAngle:x,endAngle:w}=b,O=[{waveInArcAngle:x+n,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:x+n,fillOpacity:h,strokeOpacity:d,opacity:p,offset:.01},{waveInArcAngle:w,fillOpacity:h,strokeOpacity:d,opacity:p}],k=s.animate(O,Object.assign(Object.assign({},a),t));return k.onframe=function(){s.style.d=m(Object.assign(Object.assign({},b),{endAngle:Number(s.style.waveInArcAngle)}))},k.onfinish=function(){s.style.d=m(Object.assign(Object.assign({},b),{endAngle:w}))},k}};DL.props={};const BL=t=>(e,n,r)=>{const[i]=e,{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=i.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:o,strokeOpacity:a,opacity:s}];return i.animate(c,Object.assign(Object.assign({},r),t))};BL.props={};const FL=t=>(e,n,r)=>{const[i]=e,{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=i.style,c=[{fillOpacity:o,strokeOpacity:a,opacity:s},{fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(c,Object.assign(Object.assign({},r),t))};FL.props={};const zL=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l="center center",u=[{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.01},{transform:`${o} scale(1)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c}];return i.animate(u,Object.assign(Object.assign({},r),t))},ZL=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l="center center",u=[{transform:`${o} scale(1)`.trimStart(),transformOrigin:l},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.99},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(u,Object.assign(Object.assign({},r),t))},WL=t=>(e,n,r)=>{var i,o;const[a]=e,s=(null===(o=(i=a).getTotalLength)||void 0===o?void 0:o.call(i))||0,c=[{lineDash:[0,s]},{lineDash:[s,0]}];return a.animate(c,Object.assign(Object.assign({},r),t))};WL.props={};const $L={opacity:1,strokeOpacity:1,fillOpacity:1,lineWidth:0,x:0,y:0,cx:0,cy:0,r:0,rx:0,ry:0,width:0,height:0},GL={[pr.CIRCLE]:["cx","cy","r"],[pr.ELLIPSE]:["cx","cy","rx","ry"],[pr.RECT]:["x","y","width","height"],[pr.IMAGE]:["x","y","width","height"],[pr.LINE]:["x1","y1","x2","y2"],[pr.POLYLINE]:["points"],[pr.POLYGON]:["points"]};function HL(t,e,n=!1){const r={};for(const i of e){const e=t.style[i];e?r[i]=e:n&&(r[i]=$L[i])}return r}const qL=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function YL(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function VL(t){const[e,n,r,i]=t;return`\n M ${e} ${n}\n L ${e+r} ${n}\n L ${e+r} ${n+i}\n L ${e} ${n+i}\n Z\n `}function UL(t,e){const[n,r,i,o]=YL(t),a=o/i,s=Math.ceil(Math.sqrt(e/a)),c=[],l=o/Math.ceil(e/s);let u=0,f=e;for(;f>0;){const t=Math.min(f,s),e=i/t;for(let i=0;i{const t=f.style.d;Qh(f,n),f.style.d=t,f.style.transform="none"},f.style.transform="none",t}return null}const eN=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:UL}(t.split),o=Object.assign(Object.assign({},r),t),{length:a}=e,{length:s}=n;if(1===a&&1===s||a>1&&s>1){const[t]=e,[r]=n;return tN(t,t,r,o)}if(1===a&&s>1){const[t]=e;return function(t,e,n,r){t.style.visibility="hidden";const i=r(t,e.length);return e.map(((e,r)=>tN(e,new dl({style:Object.assign({d:i[r]},HL(t,qL))}),e,n)))}(t,n,o,i)}if(a>1&&1===s){const[t]=n;return function(t,e,n,r){const i=r(e,t.length),{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=e.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:o,strokeOpacity:a,opacity:s}],l=e.animate(c,n),u=t.map(((t,r)=>tN(t,t,new dl({style:{d:i[r],fill:e.style.fill}}),n)));return[...u,l]}(e,t,o,i)}return null};eN.props={};const nN=(t,e)=>(n,r,i)=>{const[o]=n,{min:[a,s],halfExtents:c}=o.getLocalBounds(),l=2*c[0],u=2*c[1],f=new dl({style:{d:`M${a},${s}L${a+l},${s}L${a+l},${s+u}L${a},${s+u}Z`}});o.appendChild(f),o.style.clipPath=f;return RL(t,e)([f],r,i)};nN.props={};const rN=(t,e)=>(n,r,i)=>{const[o]=n,{min:[a,s],halfExtents:c}=o.getLocalBounds(),l=2*c[0],u=2*c[1],f=new dl({style:{d:`M${a},${s}L${a+l},${s}L${a+l},${s+u}L${a},${s+u}Z`}});o.appendChild(f),o.style.clipPath=f;return NL(t,e)([f],r,i)};rN.props={};var iN=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);it),link:i=!1,background:o=!1,delay:a=60,scale:s,coordinate:c,emitter:l,state:u={}}){var f;const h=e(t),d=new Set(h),p=zh(h,r),y=mw(h,n),[g,v]=bw(Object.assign({elements:h,valueof:y,link:i,coordinate:c},ed(u.active,"link"))),[m,b,x]=ww(Object.assign({document:t.ownerDocument,scale:s,coordinate:c,background:o,valueof:y},ed(u.active,"background"))),w=Rh(u,{active:Object.assign({},(null===(f=u.active)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.active.offset(...t),[,n]=t;return xw(h[n],e,c)}})}),{setState:O,removeState:k,hasState:_}=yw(w,y);let M;const E=t=>{const{target:e,nativeEvent:i=!0}=t;if(!d.has(e))return;M&&clearTimeout(M);const o=r(e),a=p.get(o),s=new Set(a);for(const t of h)s.has(t)?_(t,"active")||O(t,"active"):(O(t,"inactive"),v(t)),t!==e&&b(t);m(e),g(a),i&&l.emit("element:highlight",{nativeEvent:i,data:{data:n(e),group:a.map(n)}})},S=(t=!0)=>{for(const t of h)k(t,"active","inactive"),b(t),v(t);t&&l.emit("element:unhighlight",{nativeEvent:t})},A=t=>{const{target:e}=t;o&&!x(e)||(o||d.has(e))&&(a>0?(M&&clearTimeout(M),M=setTimeout((()=>{S(),M=null}),a)):S())},j=()=>{S()};t.addEventListener("pointerover",E),t.addEventListener("pointerout",A),t.addEventListener("pointerleave",j);const P=t=>{const{nativeEvent:e}=t;e||S(!1)},T=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=_w(h,r,n);i&&E({target:i,nativeEvent:!1})};return l.on("element:highlight",T),l.on("element:unhighlight",P),()=>{t.removeEventListener("pointerover",E),t.removeEventListener("pointerout",A),t.removeEventListener("pointerleave",j),l.off("element:highlight",T),l.off("element:unhighlight",P);for(const t of h)b(t),v(t)}}function aN(t){var{delay:e,createGroup:n,background:r=!1,link:i=!1}=t,o=iN(t,["delay","createGroup","background","link"]);return(t,a,s)=>{const{container:c,view:l,options:u}=t,{scale:f,coordinate:h}=l;return oN(cw(c),Object.assign({elements:ow,datum:pw(l),groupKey:n?n(l):void 0,coordinate:h,scale:f,state:vw(u,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:s},o))}}function sN(t){return aN(Object.assign(Object.assign({},t),{createGroup:dw}))}function cN(t){return aN(Object.assign(Object.assign({},t),{createGroup:hw}))}aN.props={reapplyWhenUpdate:!0},sN.props={reapplyWhenUpdate:!0},cN.props={reapplyWhenUpdate:!0};var lN=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);it),link:i=!1,single:o=!1,coordinate:a,background:s=!1,scale:c,emitter:l,state:u={}}){var f;const h=e(t),d=new Set(h),p=zh(h,r),y=mw(h,n),[g,v]=bw(Object.assign({link:i,elements:h,valueof:y,coordinate:a},ed(u.selected,"link"))),[m,b]=ww(Object.assign({document:t.ownerDocument,background:s,coordinate:a,scale:c,valueof:y},ed(u.selected,"background"))),x=Rh(u,{selected:Object.assign({},(null===(f=u.selected)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.selected.offset(...t),[,n]=t;return xw(h[n],e,a)}})}),{setState:w,removeState:O,hasState:k}=yw(x,y),_=(t=!0)=>{for(const t of h)O(t,"selected","unselected"),v(t),b(t);t&&l.emit("element:unselect",{nativeEvent:!0})},M=t=>{const{target:e,nativeEvent:a=!0}=t;return d.has(e)?o?((t,e,i=!0)=>{if(k(e,"selected"))_();else{const o=r(e),a=p.get(o),s=new Set(a);for(const t of h)s.has(t)?w(t,"selected"):(w(t,"unselected"),v(t)),t!==e&&b(t);if(g(a),m(e),!i)return;l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...a.map(n)]}}))}})(t,e,a):((t,e,o=!0)=>{const a=r(e),s=p.get(a),c=new Set(s);if(k(e,"selected")){if(!h.some((t=>!c.has(t)&&k(t,"selected"))))return _();for(const t of s)w(t,"unselected"),v(t),b(t)}else{const t=s.some((t=>k(t,"selected")));for(const t of h)c.has(t)?w(t,"selected"):k(t,"selected")||w(t,"unselected");!t&&i&&g(s),m(e)}o&&l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:o,data:{data:h.filter((t=>k(t,"selected"))).map(n)}}))})(t,e,a):_()};t.addEventListener("click",M);const E=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=o?r.data.slice(0,1):r.data;for(const t of i){const e=_w(h,t,n);M({target:e,nativeEvent:!1})}},S=()=>{_(!1)};return l.on("element:select",E),l.on("element:unselect",S),()=>{for(const t of h)v(t);t.removeEventListener("click",M),l.off("element:select",E),l.off("element:unselect",S)}}function fN(t){var{createGroup:e,background:n=!1,link:r=!1}=t,i=lN(t,["createGroup","background","link"]);return(t,o,a)=>{const{container:s,view:c,options:l}=t,{coordinate:u,scale:f}=c;return uN(cw(s),Object.assign({elements:ow,datum:pw(c),groupKey:e?e(c):void 0,coordinate:u,scale:f,state:vw(l,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:a},i))}}function hN(t){return fN(Object.assign(Object.assign({},t),{createGroup:dw}))}function dN(t){return fN(Object.assign(Object.assign({},t),{createGroup:hw}))}fN.props={reapplyWhenUpdate:!0},hN.props={reapplyWhenUpdate:!0},dN.props={reapplyWhenUpdate:!0};var pN=function(t,e,n){var r,i,o,a,s=0;n||(n={});var c=function(){s=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},l=function(){var l=Date.now();s||!1!==n.leading||(s=l);var u=e-(l-s);return i=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=l,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(c,u)),a};return l.cancel=function(){clearTimeout(r),s=0,r=i=o=null},l};function yN({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,c=cw(s),l=pN((t=>{const e=uw(c,t);if(!e)return a("fisheye"),void o();a("fisheye",(t=>{const n=Rh({},t,{interaction:{tooltip:{preserve:!0}}});for(const t of n.marks)t.animate=!1;const[r,i]=e,o=function(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find((t=>"fisheye"===t.type));if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}(n);return o.focusX=r,o.focusY=i,o.visual=!0,n})),o()}),t,{leading:e,trailing:n});return c.addEventListener("pointerenter",l),c.addEventListener("pointermove",l),c.addEventListener("pointerleave",l),()=>{c.removeEventListener("pointerenter",l),c.removeEventListener("pointermove",l),c.removeEventListener("pointerleave",l)}}}var gN=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))},vN=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i`${t}`)}=t,o=vN(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{view:a,container:s,update:c,setState:l}=t,{markState:u,scale:f,coordinate:h}=a,d=function(t,e,n){const[r]=Array.from(t.entries()).filter((([t])=>t.type===e)).map((([t])=>{const{encode:e}=t;return Object.fromEntries(n.map((t=>{const n=e[t];return[t,n?n.value:void 0]})))}));return r}(u,"line",["x","y","series"]);if(!d)return;const{y:p,x:y,series:g=[]}=d,v=p.map(((t,e)=>e)),m=ex(v.map((t=>y[t]))),b=cw(s),x=s.getElementsByClassName(R),w=zh(s.getElementsByClassName(D),(t=>t.__data__.key.split("-")[0])),O=new fl({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},ed(o,"rule"))}),k=new xl({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},ed(o,"label"))});O.append(k),b.appendChild(O);const _=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return m[Ox(m,i)]},M=(t,e)=>{O.setAttribute("x1",t[0]),O.setAttribute("x2",t[0]),k.setAttribute("text",i(e))};let E;const S=pN((t=>{const e=uw(b,t);e&&(t=>{const{scale:e,coordinate:n}=E,{x:r,y:i}=e,o=_(n,r,t);M(t,o);for(const t of x){const{seriesIndex:e,key:r}=t.__data__,a=e[gx((t=>y[+t])).center(e,o)],s=[0,i.map(1)],c=[0,i.map(p[a]/p[e[0]])],[,l]=n.map(s),[,u]=n.map(c),f=l-u;t.setAttribute("transform",`translate(0, ${f})`);const h=w.get(r)||[];for(const t of h)t.setAttribute("dy",f)}})(e)}),e,{leading:n,trailing:r});return(t=>{gN(this,void 0,void 0,(function*(){const{x:e}=f,n=_(h,e,t);M(t,n),l("chartIndex",(t=>{const e=Rh({},t),r=e.marks.find((t=>"line"===t.type)),i=cp(Wh(v,(t=>cp(t,(t=>+p[t]))/fM(t,(t=>+p[t]))),(t=>g[t])).values());Rh(r,{scale:{y:{domain:[1/i,i]}}});const o=function(t){const{transform:e=[]}=t,n=e.find((t=>"normalizeY"===t.type));if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}(r);o.groupBy="color",o.basis=(t,e)=>e[t[gx((t=>y[+t])).center(t,n)]];for(const t of e.marks)t.animate=!1;return e}));const r=yield c("chartIndex");E=r.view}))})([0,0]),b.addEventListener("pointerenter",S),b.addEventListener("pointermove",S),b.addEventListener("pointerleave",S),()=>{O.remove(),b.removeEventListener("pointerenter",S),b.removeEventListener("pointermove",S),b.removeEventListener("pointerleave",S)}}}function bN(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n>e||void 0===n&&e>=e)&&(n=e,r=i);else for(let o of t)null!=(o=e(o,++i,t))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function xN(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function wN(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}mN.props={reapplyWhenUpdate:!0};var ON=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t},kN=function(t,e){null!=e?t.replaceChildren?Array.isArray(e)?t.replaceChildren.apply(t,(0,We.ev)([],(0,We.CR)(e),!1)):t.replaceChildren(e):(t.innerHTML="",Array.isArray(e)?e.forEach((function(e){return t.appendChild(e)})):t.appendChild(e)):t.innerHTML=""};function _N(t){return void 0===t&&(t=""),{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var MN={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function EN(t){var e;void 0===t&&(t="");var n=_N(t);return(e={})[".".concat(n.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},e[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(n.NAME_LABEL)]=(0,We.pi)({flex:1},MN),e[".".concat(n.VALUE)]=(0,We.pi)({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},MN),e[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var SN=function(t){function e(e){var n,r,i=this,o=null===(r=null===(n=e.style)||void 0===n?void 0:n.template)||void 0===r?void 0:r.prefixCls,a=_N(o);return(i=t.call(this,e,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'
'),title:'
'),item:'
  • \n \n \n {name}\n \n {value}\n
  • ')},style:EN(o)})||this).timestamp=-1,i.prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}return(0,We.ZT)(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map((function(t,e){var r=t.name,i=void 0===r?"":r,o=t.color,a=void 0===o?"black":o,s=t.index,c=(0,We._T)(t,["name","color","index"]),l=(0,We.pi)({name:i,color:a,index:null!=s?s:e},c);return wN(ON(n.item,l))}))},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var r=function(){n.attributes.x=null!=t?t:n.attributes.x,n.attributes.y=null!=e?e:n.attributes.y,n.updatePosition()};"hidden"===this.element.style.visibility?this.closeTransition(r):r()}this.element.style.visibility="visible"},e.prototype.hide=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.attributes.enterable&&this.isCursorEntered(t,e)||(this.element.style.visibility="hidden")},e.prototype.initShape=function(){var t=this.attributes.template;this.element=wN(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:kN(this.element,t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,r=n.template,i=n.title,o=n.enterable,a=n.style,s=n.content,c=_N(r.prefixCls),l=this.element;if(this.element.style.pointerEvents=o?"auto":"none",s)this.renderCustomContent();else{i?(l.innerHTML=r.title,l.getElementsByClassName(c.TITLE)[0].innerHTML=i):null===(e=null===(t=l.getElementsByClassName(c.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var u=this.HTMLTooltipItemsElements,f=document.createElement("ul");f.className=c.LIST,kN(f,u);var h=this.element.querySelector(".".concat(c.LIST));h?h.replaceWith(f):l.appendChild(f)}!function(t,e){Object.entries(e).forEach((function(e){var n=(0,We.CR)(e,2),r=n[0],i=n[1];(0,We.ev)([t],(0,We.CR)(t.querySelectorAll(r)),!1).filter((function(t){return t.matches(r)})).forEach((function(t){t&&(t.style.cssText+=Object.entries(i).reduce((function(t,e){return"".concat(t).concat(e.join(":"),";")}),""))}))}))}(l,a)},e.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,r=e.offset,i=(t||n).split("-"),o={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},a=this.elementSize,s=a.width,c=a.height,l=[-s/2,-c/2];return i.forEach((function(t){var e=(0,We.CR)(l,2),n=e[0],i=e[1],a=(0,We.CR)(o[t],2),u=a[0],f=a[1];l=[n+(s/2+r[0])*u,i+(c/2+r[1])*f]})),l},e.prototype.setOffsetPosition=function(t){var e=(0,We.CR)(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=void 0===o?0:o,s=i.y,c=void 0===s?0:s,l=i.container,u=l.x,f=l.y;this.element.style.left="".concat(+a+u+n,"px"),this.element.style.top="".concat(+c+f+r,"px")},e.prototype.updatePosition=function(){var t=this.attributes.showDelay,e=void 0===t?60:t,n=Date.now();this.timestamp>0&&n-this.timestampg+s.width,top:pv+s.height},b=[];c.split("-").forEach((function(t){m[t]?b.push(y[t]):b.push(t)}));var x=b.join("-");return this.getRelativeOffsetFromCursor(x)},e.prototype.isCursorEntered=function(t,e){if(this.element){var n=this.element.getBoundingClientRect(),r=n.x,i=n.y,o=n.width,a=n.height;return new Tg(r,i,o,a).isPointIn(t,e)}return!1},e.prototype.closeTransition=function(t){var e=this,n=this.element.style.transition;this.element.style.transition="none",t(),setTimeout((function(){e.element.style.transition=n}),10)},e.tag="tooltip",e}(Zp),AN=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);it)){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function DN(t,e,n,r=t.map((t=>t.__data__)),i={}){const o=t=>t instanceof Date?+t:t,a=IN(r.map((t=>t.title)),o).filter(Jh),s=r.flatMap(((r,o)=>{const a=t[o],{items:s=[],title:c}=r,l=s.filter(Jh),u=void 0!==n?n:s.length<=1;return l.map((t=>{var{color:n=NN(a)||i.color,name:o}=t,s=AN(t,["color","name"]);const l=function(t,e){const{color:n,series:r,facet:i=!1}=t,{color:o,series:a}=e,s=t=>t&&t.invert&&!(t instanceof oC)&&!(t instanceof _m);if(s(r))return r.clone().invert(a);if(a&&r instanceof oC&&r.invert(a)!==o&&!i)return r.invert(a);if(s(n)){const t=n.invert(o);return Array.isArray(t)?null:t}return null}(e,r),f=u?l||o:o||l;return Object.assign(Object.assign({},s),{color:n,name:f||c})}))})).map(LN);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:IN(s,(t=>`(${o(t.name)}, ${o(t.value)}, ${o(t.color)})`))})}function BN(t,e,n,r){var{plotWidth:i,plotHeight:o,mainWidth:a,mainHeight:s,startX:c,startY:l,transposed:u,polar:f,insetLeft:h,insetTop:d}=r,p=AN(r,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const y=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},p),g=((t,e)=>{if(1===e.length)return e[0];const n=e.map((e=>ab(e,t))),r=bN(n,(t=>t));return e[r]})(n,e);if(f){const[e,n,r]=(()=>{const t=c+h+a/2,e=l+d+s/2;return[t,e,ab([t,e],g)]})(),i=t.ruleX||((e,n,r)=>{const i=new nl({style:Object.assign({cx:e,cy:n,r:r},y)});return t.appendChild(i),i})(e,n,r);i.style.cx=e,i.style.cy=n,i.style.r=r,t.ruleX=i}else{const[e,n,r,a]=u?[c+g[0],c+g[0],l,l+o]:[c,c+i,g[1]+l,g[1]+l],s=t.ruleX||((e,n,r,i)=>{const o=new fl({style:Object.assign({x1:e,x2:n,y1:r,y2:i},y)});return t.appendChild(o),o})(e,n,r,a);s.style.x1=e,s.style.x2=n,s.style.y1=r,s.style.y2=a,t.ruleX=s}}function FN(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:o,mainHeight:a,startX:s,startY:c,transposed:l,polar:u,insetLeft:f,insetTop:h}=n,d=AN(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const p=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},d),y=e.map((t=>t[1])),g=e.map((t=>t[0])),v=xN(y),m=xN(g),[b,x,w,O]=(()=>{if(u){const t=Math.min(o,a)/2,e=s+f+o/2,n=c+h+a/2,r=sb(ib([m,v],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return l?[s,s+r,v+c,v+c]:[m+s,m+s,c,c+i]})();if(g.length>0){const e=t.ruleY||(()=>{const e=new fl({style:Object.assign({x1:b,x2:x,y1:w,y2:O},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=w,e.style.y2=O,t.ruleY=e}}function zN(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function ZN(t){t.ruleX&&(t.ruleX.remove(),t.ruleX=void 0)}function WN(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function $N(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function GN(t,e){return void 0===t?e:t}function HN(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function qN(t,e){var{elements:n,sort:r,filter:i,scale:o,coordinate:a,crosshairs:s,crosshairsX:c,crosshairsY:l,render:u,groupName:f,emitter:h,wait:d=50,leading:p=!0,trailing:y=!1,startX:g=0,startY:v=0,body:m=!0,single:b=!0,position:x,enterable:w,mount:O,bounding:k,theme:_,offset:M,disableNative:E=!1,marker:S=!0,preserve:A=!1,style:j={},css:P={}}=e,T=AN(e,["elements","sort","filter","scale","coordinate","crosshairs","crosshairsX","crosshairsY","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","offset","disableNative","marker","preserve","style","css"]);const C=n(t),R=vp(a),L=mp(a),N=Rh(j,T),{innerWidth:I,innerHeight:D,width:B,height:F,insetLeft:z,insetTop:Z}=a.getOptions(),W=[],$=[];for(const t of C){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?W.push(t):(r||i)&&$.push(t)}const G=$.length&&$.every((t=>"interval"===t.markType))&&!mp(a),H=t=>t.__data__.x,q=!!o.x.getBandWidth&&$.length>0;W.sort(((t,e)=>{const n=R?0:1,r=t=>t.getBounds().min[n];return R?r(e)-r(t):r(t)-r(e)}));const Y=t=>{const e=R?1:0,{min:n,max:r}=t.getLocalBounds();return ex([n[e],r[e]])};G?C.sort(((t,e)=>H(t)-H(e))):$.sort(((t,e)=>{const[n,r]=Y(t),[i,o]=Y(e),a=(n+r)/2,s=(i+o)/2;return R?s-a:a-s}));const V=new Map(W.map((t=>{const{__data__:e}=t,{seriesX:n}=e;return[t,[ex(n.map(((t,e)=>e)),(t=>n[+t])),n]]}))),{x:U}=o,X=(null==U?void 0:U.getBandWidth)?U.getBandWidth()/2:0,K=t=>{const[e]=a.invert(t);return e-X},Q=(t,e,n,r)=>{const{_x:i}=t,o=void 0!==i?U.map(i):K(e),a=r.filter(Jh),[s,c]=ex([a[0],a[a.length-1]]);if(!q&&(oc)&&!(s===c))return null;const l=gx((t=>r[+t])).center;return n[l(n,o)]},J=G?(t,e)=>{const n=e[(0,gx(H).center)(e,K(t))];return zh(e,H).get(H(n))}:(t,e)=>{const n=t[R?1:0],r=e.filter((t=>{const[e,r]=Y(t);return n>=e&&n<=r}));if(!q||r.length>0)return r;const i=gx((t=>{const[e,n]=Y(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(Jh)},tt=(t,e)=>{const{__data__:n}=t;return Object.fromEntries(Object.entries(n).filter((([t])=>t.startsWith("series")&&"series"!==t)).map((([t,n])=>{const r=n[e];return[qh(t.replace("series","")),r]})))},et=pN((e=>{var n;const d=uw(t,e);if(!d)return;const p=lw(t),y=p.min[0],E=p.min[1],A=[d[0]-g,d[1]-v];if(!A)return;const j=J(A,$),T=[],C=[];for(const t of W){const[n,r]=V.get(t),i=Q(e,A,n,r);if(null!==i){T.push(t);const e=tt(t,i),{x:n,y:r}=e,o=a.map([(n||0)+X,r||0]);C.push([Object.assign(Object.assign({},e),{element:t}),o])}}const G=Array.from(new Set(C.map((t=>t[0].x)))),H=G[bN(G,(t=>Math.abs(t-K(A))))],q=C.filter((t=>t[0].x===H)),Y=[...q.map((t=>t[0])),...j.map((t=>t.__data__))],U=[...T,...j],et=DN(U,o,f,Y,_);if(r&&et.items.sort(((t,e)=>r(t)-r(e))),i&&(et.items=et.items.filter(i)),0===U.length||HN(et))return void nt(e);if(m&&TN({root:t,data:et,x:d[0]+y,y:d[1]+E,render:u,event:e,single:b,position:x,enterable:w,mount:O,bounding:k,css:P,offset:M}),s||c||l){const e=ed(N,"crosshairs"),n=Object.assign(Object.assign({},e),ed(N,"crosshairsX")),r=Object.assign(Object.assign({},e),ed(N,"crosshairsY")),i=q.map((t=>t[1]));c&&BN(t,i,d,Object.assign(Object.assign({},n),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:z,insetTop:Z,startX:g,startY:v,transposed:R,polar:L})),l&&FN(t,i,Object.assign(Object.assign({},r),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:z,insetTop:Z,startX:g,startY:v,transposed:R,polar:L}))}if(S){const e=ed(N,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach((t=>t.remove()));const{type:i=""}=n,o=e.filter((t=>{const[{x:e,y:n}]=t;return Jh(e)&&Jh(n)})).map((t=>{const[{color:e,element:o},a]=t,s=e||o.style.fill||o.style.stroke||r.color,c="hollow"===i?"transparent":s,l="hollow"===i?s:"#fff";return new nl({className:"g2-tooltip-marker",style:Object.assign({cx:a[0],cy:a[1],fill:c,r:4,stroke:l,lineWidth:2},n)})}));for(const e of o)t.appendChild(e);t.markers=o}(t,{data:q,style:e,theme:_})}const rt=null===(n=q[0])||void 0===n?void 0:n[0].x,it=null!=rt?rt:K(A);h.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},et),{data:{x:Mx(o.x,it,!0)}})}))}),d,{leading:p,trailing:y}),nt=e=>{CN({root:t,single:b,emitter:h,event:e})},rt=()=>{RN({root:t,single:b})},it=e=>{var n,{nativeEvent:r,data:i,offsetX:s,offsetY:c}=e,l=AN(e,["nativeEvent","data","offsetX","offsetY"]);if(r)return;const u=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.x,f=o.x.map(u),[h,d]=a.map([f,.5]),p=t.getRenderBounds(),y=p.min[0],g=p.min[1];et(Object.assign(Object.assign({},l),{offsetX:void 0!==s?s:y+h,offsetY:void 0!==c?c:g+d,_x:u}))},ot=()=>{CN({root:t,single:b,emitter:h,nativeEvent:!1})},at=()=>{lt(),rt()},st=()=>{ct()},ct=()=>{E||(t.addEventListener("pointerenter",et),t.addEventListener("pointermove",et),t.addEventListener("pointerleave",(e=>{uw(t,e)||nt(e)})))},lt=()=>{E||(t.removeEventListener("pointerenter",et),t.removeEventListener("pointermove",et),t.removeEventListener("pointerleave",nt))};return ct(),h.on("tooltip:show",it),h.on("tooltip:hide",ot),h.on("tooltip:disable",at),h.on("tooltip:enable",st),()=>{lt(),h.off("tooltip:show",it),h.off("tooltip:hide",ot),h.off("tooltip:disable",at),h.off("tooltip:enable",st),A?CN({root:t,single:b,emitter:h,nativeEvent:!1}):rt()}}function YN(t,{elements:e,coordinate:n,scale:r,render:i,groupName:o,sort:a,filter:s,emitter:c,wait:l=50,leading:u=!0,trailing:f=!1,groupKey:h=(t=>t),single:d=!0,position:p,enterable:y,datum:g,view:v,mount:m,bounding:b,theme:x,offset:w,shared:O=!1,body:k=!0,disableNative:_=!1,preserve:M=!1,css:E={}}){var S,A;const j=e(t),P=zh(j,h),T=j.every((t=>"interval"===t.markType))&&!mp(n),C=r.x,R=r.series,L=null!==(A=null===(S=null==C?void 0:C.getBandWidth)||void 0===S?void 0:S.call(C))&&void 0!==A?A:0,N=R?t=>{const e=Math.round(1/R.valueBandWidth);return t.__data__.x+t.__data__.series*L+L/(2*e)}:t=>t.__data__.x+L/2;T&&j.sort(((t,e)=>N(t)-N(e)));const I=t=>{const{target:e}=t;return Aw(e,(t=>!!t.classList&&t.classList.includes("element")))},D=T?e=>{const r=uw(t,e);if(!r)return;const[i]=n.invert(r),o=(0,gx(N).center)(j,i),a=j[o];if(!O){const t=j.find((t=>t!==a&&N(t)===N(a)));if(t)return I(e)}return a}:I,B=pN((e=>{const n=D(e);if(!n)return void CN({root:t,single:d,emitter:c,event:e});const l=h(n),u=P.get(l);if(!u)return;const f=1!==u.length||O?DN(u,r,o,void 0,x):function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(Jh).map((e=>{var{color:n=NN(t)}=e,r=AN(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(LN);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(u[0]);if(a&&f.items.sort(((t,e)=>a(t)-a(e))),s&&(f.items=f.items.filter(s)),HN(f))return void CN({root:t,single:d,emitter:c,event:e});const{offsetX:g,offsetY:_}=e;k&&TN({root:t,data:f,x:g,y:_,render:i,event:e,single:d,position:p,enterable:y,mount:m,bounding:b,css:E,offset:w}),c.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},f),{data:jw(n,v)})}))}),l,{leading:u,trailing:f}),F=e=>{CN({root:t,single:d,emitter:c,event:e})},z=()=>{_||(t.addEventListener("pointermove",B),t.addEventListener("pointerleave",F))},Z=()=>{_||(t.removeEventListener("pointermove",B),t.removeEventListener("pointerleave",F))},W=({nativeEvent:e,offsetX:n,offsetY:r,data:i})=>{if(e)return;const{data:o}=i,a=_w(j,o,g);if(!a)return;const s=a.getBBox(),{x:c,y:l,width:u,height:f}=s,h=t.getBBox();B({target:a,offsetX:void 0!==n?n+h.x:c+u/2,offsetY:void 0!==r?r+h.y:l+f/2})},$=({nativeEvent:e}={})=>{e||CN({root:t,single:d,emitter:c,nativeEvent:!1})};return c.on("tooltip:show",W),c.on("tooltip:hide",$),c.on("tooltip:enable",(()=>{z()})),c.on("tooltip:disable",(()=>{Z(),RN({root:t,single:d})})),z(),()=>{Z(),c.off("tooltip:show",W),c.off("tooltip:hide",$),M?CN({root:t,single:d,emitter:c,nativeEvent:!1}):RN({root:t,single:d})}}function VN(t){const{shared:e,crosshairs:n,crosshairsX:r,crosshairsY:i,series:o,name:a,item:s=(()=>({})),facet:c=!1}=t,l=AN(t,["shared","crosshairs","crosshairsX","crosshairsY","series","name","item","facet"]);return(t,a,u)=>{const{container:f,view:h}=t,{scale:d,markState:p,coordinate:y,theme:g}=h,v=$N(p,"seriesTooltip"),m=$N(p,"crosshairs"),b=cw(f),x=GN(o,v),w=GN(n,m);if(x&&function(t){return Array.from(t.values()).some((t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip}))}(p)&&!c)return qN(b,Object.assign(Object.assign({},l),{theme:g,elements:ow,scale:d,coordinate:y,crosshairs:w,crosshairsX:GN(GN(r,n),!1),crosshairsY:GN(i,w),item:s,emitter:u}));if(x&&c){const e=a.filter((e=>e!==t&&e.options.parentKey===t.options.key)),o=aw(t,a),c=e[0].view.scale,f=b.getBounds(),h=f.min[0],d=f.min[1];return Object.assign(c,{facet:!0}),qN(b.parentNode.parentNode,Object.assign(Object.assign({},l),{theme:g,elements:()=>o,scale:c,coordinate:y,crosshairs:GN(n,m),crosshairsX:GN(GN(r,n),!1),crosshairsY:GN(i,w),item:s,startX:h,startY:d,emitter:u}))}return YN(b,Object.assign(Object.assign({},l),{datum:pw(h),elements:ow,scale:d,coordinate:y,groupKey:e?t=>t.__data__.x:void 0,item:s,emitter:u,view:h,theme:g,shared:e}))}}VN.props={reapplyWhenUpdate:!0};var UN=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))};const XN="legend-category";function KN(t){return t.getElementsByClassName("legend-category-item-marker")[0]}function QN(t){return t.getElementsByClassName("legend-category-item-label")[0]}function JN(t){return t.getElementsByClassName("items-item")}function tI(t){return t.getElementsByClassName(XN)}function eI(t){return t.getElementsByClassName("legend-continuous")}function nI(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function rI(t,{legend:e,channel:n,value:r,ordinal:i,channels:o,allChannels:a,facet:s=!1}){return UN(this,void 0,void 0,(function*(){const{view:c,update:l,setState:u}=t;u(e,(t=>{const{marks:e}=t,l=e.map((t=>{if("legends"===t.type)return t;const{transform:e=[],data:l=[]}=t,u=e.findIndex((({type:t})=>t.startsWith("group")||t.startsWith("bin"))),f=[...e];l.length&&f.splice(u+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const h=Object.fromEntries(o.map((t=>[t,{domain:c.scale[t].getOptions().domain}])));return Rh({},t,Object.assign(Object.assign({transform:f,scale:h},!i&&{animate:!1}),{legend:!s&&Object.fromEntries(a.map((t=>[t,{preserve:!0}])))}))}));return Object.assign(Object.assign({},t),{marks:l})})),yield l()}))}function iI(t,e){for(const n of t)rI(n,Object.assign(Object.assign({},e),{facet:!0}))}function oI(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),o=i.length>0,a=t=>nI(t).scales.map((t=>t.name)),s=[...tI(r),...eI(r)],c=s.flatMap(a),l=pN(o?iI:rI,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=nI(e).scales[0],f={legend:e,channel:s,channels:a(e),allChannels:c};return e.className===XN?function(t,{legends:e,marker:n,label:r,datum:i,filter:o,emitter:a,channel:s,state:c={}}){const l=new Map,u=new Map,f=new Map,{unselected:h={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=c,d={unselected:ed(h,"marker")},p={unselected:ed(h,"label")},{setState:y,removeState:g}=yw(d,void 0),{setState:v,removeState:m}=yw(p,void 0),b=Array.from(e(t));let x=b.map(i);const w=()=>{for(const t of b){const e=i(t),o=n(t),a=r(t);x.includes(e)?(g(o,"unselected"),m(a,"unselected")):(y(o,"unselected"),v(a,"unselected"))}};for(const e of b){const n=()=>{Ow(t,"pointer")},r=()=>{kw(t)},c=t=>UN(this,void 0,void 0,(function*(){const n=i(e),r=x.indexOf(n);-1===r?x.push(n):x.splice(r,1),yield o(x),w();const{nativeEvent:c=!0}=t;c&&(x.length===b.length?a.emit("legend:reset",{nativeEvent:c}):a.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:c,data:{channel:s,values:x}})))}));e.addEventListener("click",c),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),l.set(e,c),u.set(e,n),f.set(e,r)}const O=t=>UN(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===s&&(x=i,yield o(x),w())})),k=t=>UN(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;e||(x=b.map(i),yield o(x),w())}));return a.on("legend:filter",O),a.on("legend:reset",k),()=>{for(const t of b)t.removeEventListener("click",l.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",f.get(t)),a.off("legend:filter",O),a.off("legend:reset",k)}}(r,{legends:JN,marker:KN,label:QN,datum:t=>{const{__data__:e}=t,{index:n}=e;return u[n]},filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!0});l(o?i:t,n)},state:e.attributes.state,channel:s,emitter:n}):function(t,{legend:e,filter:n,emitter:r,channel:i}){const o=({detail:{value:t}})=>{n(t),r.emit({nativeEvent:!0,data:{channel:i,values:t}})};return e.addEventListener("valuechange",o),()=>{e.removeEventListener("valuechange",o)}}(0,{legend:e,filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!1});l(o?i:t,n)},emitter:n,channel:s})}));return()=>{u.forEach((t=>t()))}}}function aI(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=tI(r),s=ow(r),c=t=>nI(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=vw(o,["active","inactive"]),f=mw(s,pw(i)),h=[];for(const t of a){const e=e=>{const{data:n}=t.attributes,{__data__:r}=e,{index:i}=r;return n[i].label},r=c(t),i=JN(t),o=l(r),a=zh(s,(t=>o.invert(t.__data__[r]))),{state:d={}}=t.attributes,{inactive:p={}}=d,{setState:y,removeState:g}=yw(u,f),v={inactive:ed(p,"marker")},m={inactive:ed(p,"label")},{setState:b,removeState:x}=yw(v),{setState:w,removeState:O}=yw(m),k=t=>{for(const e of i){const n=KN(e),r=QN(e);e===t||null===t?(x(n,"inactive"),O(r,"inactive")):(b(n,"inactive"),w(r,"inactive"))}},_=(t,i)=>{const o=e(i),c=new Set(a.get(o));for(const t of s)c.has(t)?y(t,"active"):y(t,"inactive");k(i);const{nativeEvent:l=!0}=t;l&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:l,data:{channel:r,value:o}}))},M=new Map;for(const t of i){const e=e=>{_(e,t)};t.addEventListener("pointerover",e),M.set(t,e)}const E=t=>{for(const t of s)g(t,"inactive","active");k(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},S=t=>{const{nativeEvent:n,data:o}=t;if(n)return;const{channel:a,value:s}=o;if(a!==r)return;const c=i.find((t=>e(t)===s));c&&_({nativeEvent:!1},c)},A=t=>{const{nativeEvent:e}=t;e||E({nativeEvent:!1})};t.addEventListener("pointerleave",E),n.on("legend:highlight",S),n.on("legend:unhighlight",A);const j=()=>{t.removeEventListener(E),n.off("legend:highlight",S),n.off("legend:unhighlight",A);for(const[t,e]of M)t.removeEventListener(e)};h.push(j)}return()=>h.forEach((t=>t()))}}var sI=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);ii||co||l{const e=t.attributes,{x:n,y:r,width:i,height:o,class:a,renders:s={},handleSize:c=10,document:l}=e,u=sI(e,["x","y","width","height","class","renders","handleSize","document"]);if(!l||void 0===i||void 0===o||void 0===n||void 0===r)return;const f=c/2,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));const{handle:r}=t;return r.attr(e),r},d=ed(rd(u,"handleNW","handleNE"),"handleN"),{render:p=h}=d,y=sI(d,["render"]),g=ed(u,"handleE"),{render:v=h}=g,m=sI(g,["render"]),b=ed(rd(u,"handleSE","handleSW"),"handleS"),{render:x=h}=b,w=sI(b,["render"]),O=ed(u,"handleW"),{render:k=h}=O,_=sI(O,["render"]),M=ed(u,"handleNW"),{render:E=h}=M,S=sI(M,["render"]),A=ed(u,"handleNE"),{render:j=h}=A,P=sI(A,["render"]),T=ed(u,"handleSE"),{render:C=h}=T,R=sI(T,["render"]),L=ed(u,"handleSW"),{render:N=h}=L,I=sI(L,["render"]),D=t=>()=>{const e=Ib((e=>((t,e)=>{const{id:n}=t,r=e(t,t.attributes,l);r.id=n,r.style.draggable=!0})(e,t)));return new e({})},B=cd(t).attr("className",a).style("transform",`translate(${n}, ${r})`).style("draggable",!0);B.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(uI,Object.assign(Object.assign({width:i,height:o},rd(u,"handle")),{transform:void 0})),B.maybeAppend("handle-n",D(p)).style("x",f).style("y",-f).style("width",i-c).style("height",c).style("fill","transparent").call(uI,y),B.maybeAppend("handle-e",D(v)).style("x",i-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(uI,m),B.maybeAppend("handle-s",D(x)).style("x",f).style("y",o-f).style("width",i-c).style("height",c).style("fill","transparent").call(uI,w),B.maybeAppend("handle-w",D(k)).style("x",-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(uI,_),B.maybeAppend("handle-nw",D(E)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(uI,S),B.maybeAppend("handle-ne",D(j)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(uI,P),B.maybeAppend("handle-se",D(C)).style("x",i-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(uI,R),B.maybeAppend("handle-sw",D(N)).style("x",-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(uI,I)}));function hI(t,e){var{brushed:n=(()=>{}),brushended:r=(()=>{}),brushcreated:i=(()=>{}),brushstarted:o=(()=>{}),brushupdated:a=(()=>{}),extent:s=lI(t),brushRegion:c=((t,e,n,r,i)=>[t,e,n,r]),reverse:l=!1,fill:u="#777",fillOpacity:f="0.3",stroke:h="#fff",selectedHandles:d=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=sI(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let y=null,g=null,v=null,m=null,b=null,x=!1;const[w,O,k,_]=s;Ow(t,"crosshair"),t.style.draggable=!0;const M=(t,e,n)=>{if(o(n),m&&m.remove(),b&&b.remove(),y=[t,e],l)return E();S()},E=()=>{b=new dl({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:h,pointerEvents:"none"})}),m=new fI({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(m)},S=()=>{m=new fI({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:h,draggable:!0}),className:"mask"}),t.appendChild(m)},A=(t=!0)=>{m&&m.remove(),b&&b.remove(),y=null,g=null,v=null,x=!1,m=null,b=null,r(t)},j=(t,e,r=!0)=>{const[i,o,a,u]=function(t,e,n,r,i){const[o,a,s,c]=i;return[Math.max(o,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(c,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[f,h,d,p]=c(i,o,a,u,s);return l?T(f,h,d,p):P(f,h,d,p),n(f,h,d,p,r),[f,h,d,p]},P=(t,e,n,r)=>{m.style.x=t,m.style.y=e,m.style.width=n-t,m.style.height=r-e},T=(t,e,n,r)=>{b.style.d=`\n M${w},${O}L${k},${O}L${k},${_}L${w},${_}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,m.style.x=t,m.style.y=e,m.style.width=n-t,m.style.height=r-e},C={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},R=t=>N(t)||L(t),L=t=>{const{id:e}=t;return-1!==d.indexOf(e)&&new Set(Object.keys(C)).has(e)},N=t=>t===m.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=fw(t,e);if(!m||!R(n))return M(r,i,e),void(x=!0);R(n)&&(v=[r,i])},D=e=>{const{target:n}=e,r=fw(t,e);if(!y)return;if(!v)return j(y,r);if(N(n))return(t=>{const e=(t,e,n,r,i)=>t+ei?i-n:t,n=t[0]-v[0],r=t[1]-v[1],i=e(n,y[0],g[0],w,k),o=e(r,y[1],g[1],O,_),a=[y[0]+i,y[1]+o],s=[g[0]+i,g[1]+o];j(a,s)})(r);const[i,o]=[r[0]-v[0],r[1]-v[1]],{id:a}=n;if(C[a]){const[t,e,n,r]=C[a].vector;return j([y[0]+i*t,y[1]+o*e],[g[0]+i*n,g[1]+o*r])}},B=e=>{if(v){v=null;const{x:t,y:n,width:r,height:i}=m.style;return y=[t,n],g=[t+r,n+i],void a(t,n,t+r,n+i,e)}g=fw(t,e);const[n,r,o,s]=j(y,g);x=!1,i(n,r,o,s,e)},F=t=>{const{target:e}=t;m&&!R(e)&&A()},z=e=>{const{target:n}=e;m&&R(n)&&!x?N(n)?Ow(t,"move"):L(n)&&Ow(t,C[n.id].cursor):Ow(t,"crosshair")},Z=()=>{Ow(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",D),t.addEventListener("dragend",B),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",Z),{mask:m,move(t,e,n,r,i=!0){m||M(t,e,{}),y=[t,e],g=[n,r],j([t,e],[n,r],i)},remove(t=!0){m&&A(t)},destroy(){m&&A(!1),Ow(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",D),t.removeEventListener("dragend",B),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",Z)}}}function dI(t,e,n){return e.filter((e=>{if(e===t)return!1;const{interaction:r={}}=e.options;return Object.values(r).find((t=>t.brushKey===n))}))}function pI(t,e,n){return dI(t,e,n).map((t=>t.options))}function yI(t,e){var{elements:n,selectedHandles:r,siblings:i=(t=>[]),datum:o,brushRegion:a,extent:s,reverse:c,scale:l,coordinate:u,series:f=!1,key:h=(t=>t),bboxOf:d=(t=>{const{x:e,y:n,width:r,height:i}=t.style;return{x:e,y:n,width:r,height:i}}),state:p={},emitter:y}=e,g=sI(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const v=n(t),m=i(t),b=m.flatMap(n),x=mw(v,o),w=ed(g,"mask"),{setState:O,removeState:k}=yw(p,x),_=new Map,{width:M,height:E,x:S=0,y:A=0}=d(t),j=s||[0,0,M,E],P=()=>{for(const t of[...v,...b])k(t,"active","inactive")},T=(t,e,n,r)=>{var i;for(const t of m)null===(i=t.brush)||void 0===i||i.remove();const o=new Set;for(const i of v){const{min:a,max:s}=i.getLocalBounds(),[c,l]=a,[u,f]=s;cI([c,l,u,f],[t,e,n,r])?(O(i,"active"),o.add(h(i))):O(i,"inactive")}for(const t of b)o.has(h(t))?O(t,"active"):O(t,"inactive")},C=()=>{for(const t of v)k(t,"inactive");for(const t of _.values())t.remove();_.clear()},R=(e,n,r,i)=>{const o=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),_.set(t,e),e},a=new ml({style:{x:e+S,y:n+A,width:r-e,height:i-n}});t.appendChild(a);for(const t of v){const e=_.get(t)||o(t);e.style.clipPath=a,O(t,"inactive"),O(e,"active")}},L=hI(t,Object.assign(Object.assign({},w),{extent:j,brushRegion:a,reverse:c,selectedHandles:r,brushended:t=>{const e=f?C:P;t&&y.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const o=Sx(t,e,n,r,l,u);i&&y.emit("brush:highlight",{nativeEvent:!0,data:{selection:o}});(f?R:T)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const o=Sx(t,e,n,r,l,u);y.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:o}}))},brushupdated:(t,e,n,r,i)=>{const o=Sx(t,e,n,r,l,u);y.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:o}}))},brushstarted:t=>{y.emit("brush:start",t)}})),N=({nativeEvent:t,data:e})=>{if(t)return;const{selection:n}=e,[r,i,o,a]=function(t,e,n){const{x:r,y:i}=e,[o,a]=t,s=Ax(o,r),c=Ax(a,i),l=[s[0],c[0]],u=[s[1],c[1]],[f,h]=n.map(l),[d,p]=n.map(u);return[f,h,d,p]}(n,l,u);L.move(r,i,o,a,!1)};y.on("brush:highlight",N);const I=({nativeEvent:t}={})=>{t||L.remove(!1)};y.on("brush:remove",I);const D=L.destroy.bind(L);return L.destroy=()=>{y.off("brush:highlight",N),y.off("brush:remove",I),D()},L}function gI(t){var{facet:e,brushKey:n}=t,r=sI(t,["facet","brushKey"]);return(t,i,o)=>{const{container:a,view:s,options:c}=t,l=cw(a),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},f=["active",["inactive",{opacity:.5}]],{scale:h,coordinate:d}=s;if(e){const e=l.getBounds(),n=e.min[0],a=e.min[1],s=e.max[0],c=e.max[1];return yI(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>aw(t,i),datum:pw(sw(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,c],state:vw(sw(t,i).map((t=>t.options)),f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r))}const p=yI(l,Object.assign(Object.assign({elements:ow,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return dI(t,e,n).map((t=>cw(t.container)))}(t,i,n),datum:pw([s,...dI(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:vw([c,...pI(t,i,n)],f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function vI(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function mI(t){return gI(Object.assign(Object.assign({},t),{brushRegion:vI,selectedHandles:["handle-e","handle-w"]}))}function bI(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function xI(t){return gI(Object.assign(Object.assign({},t),{brushRegion:bI,selectedHandles:["handle-n","handle-s"]}))}var wI=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i[-1/0,e,1/0,r]:(t,e,n,i)=>[Math.floor(l-r),e,Math.ceil(f-r),i]}}function SI(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=wI(e,["offsetY","offsetX","cross"]);const a=MI(t),s=_I(t),[,c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=h-u;return{brushRegion:vI,hotZone:new ml({className:OI,style:Object.assign({width:f-l,height:i?d:2*d,transform:`translate(${l}, ${i?u:c-d})`},o)}),extent:i?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,r,i)=>[t,Math.floor(u-n),r,Math.ceil(h-n)]}}function AI(t){return(e,n,r)=>{const{container:i,view:o,options:a}=e,s=cw(i),{x:c,y:l}=s.getBBox(),{coordinate:u}=o;return function(t,e){var{axes:n,elements:r,points:i,horizontal:o,datum:a,offsetY:s,offsetX:c,reverse:l=!1,state:u={},emitter:f,coordinate:h}=e,d=wI(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),y=n(t),g=mw(p,a),{setState:v,removeState:m}=yw(u,g),b=new Map,x=ed(d,"mask"),w=t=>Array.from(b.values()).every((([e,n,r,i])=>t.some((([t,o])=>t>=e&&t<=r&&o>=n&&o<=i)))),O=y.map((t=>t.attributes.scale)),k=t=>t.length>2?[t[0],t[t.length-1]]:t,_=new Map,M=()=>{_.clear();for(let t=0;t{const n=[];for(const t of p){const e=i(t);w(e)?(v(t,"active"),n.push(t)):v(t,"inactive")}_.set(t,A(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!j)return Array.from(_.values());const t=[];for(const[e,n]of _){const r=O[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},S=t=>{for(const t of p)m(t,"active","inactive");M(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},A=(t,e)=>{const n=O[e],{name:r}=n.getOptions(),i=t.map((t=>{const e=t.__data__;return n.invert(e[r])}));return k(Ex(n,i))},j=y.some(o)&&y.some((t=>!o(t))),P=[];for(let t=0;t{const{nativeEvent:e}=t;e||P.forEach((t=>t.remove(!1)))},C=(t,e,n)=>{const[r,i]=t,a=R(r,e,n),s=R(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return o(n)?[a,-1/0,s,1/0]:[-1/0,a,1/0,s]},R=(t,e,n)=>{const{height:r,width:i}=h.getOptions(),a=e.clone();return o(n)?a.update({range:[0,i]}):a.update({range:[r,0]}),a.map(t)},L=t=>{const{nativeEvent:e}=t;if(e)return;const{selection:n}=t.data;for(let t=0;t{P.forEach((t=>t.destroy())),f.off("brushAxis:remove",T),f.off("brushAxis:highlight",L)}}(i,Object.assign({elements:ow,axes:kI,offsetY:l,offsetX:c,points:t=>t.__data__.points,horizontal:t=>{const{startPos:[e,n],endPos:[r,i]}=t.attributes;return e!==r&&n===i},datum:pw(o),state:vw(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}var jI=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))},PI=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{container:a,view:s,options:c,update:l,setState:u}=t,f=cw(a);let h=!1,d=!1,p=s;const{scale:y,coordinate:g}=s;return function(t,e){var{filter:n,reset:r,brushRegion:i,extent:o,reverse:a,emitter:s,scale:c,coordinate:l,selection:u,series:f=!1}=e;const h=ed(PI(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:d,height:p}=t.getBBox(),y=o||[0,0,d,p],g=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",b),()=>{v.destroy(),s.off("brush:filter",b),t.removeEventListener("click",m)}}(f,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{const{scale:i,coordinate:o}=p;return Sx(t,e,n,r,i,o)},filter:(t,r)=>jI(this,void 0,void 0,(function*(){if(d)return;d=!0;const[i,a]=t;u("brushFilter",(t=>{const{marks:r}=t,o=r.map((t=>Rh({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:i,nice:!1},y:{domain:a,nice:!1}}})));return Object.assign(Object.assign({},c),{marks:o,clip:!0})})),o.emit("brush:filter",Object.assign(Object.assign({},r),{data:{selection:[i,a]}}));const s=yield l();p=s.view,d=!1,h=!0})),reset:t=>{if(d||!h)return;const{scale:e}=s,{x:n,y:r}=e,i=n.getOptions().domain,a=r.getOptions().domain;o.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[i,a]}})),h=!1,p=s,u("brushFilter"),l()},extent:void 0,emitter:o,scale:y,coordinate:g},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function CI(t){return TI(Object.assign(Object.assign({hideX:!0},t),{brushRegion:vI}))}function RI(t){return TI(Object.assign(Object.assign({hideY:!0},t),{brushRegion:bI}))}var LI=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))};function NI(t,e,n,r=!1,i="x",o="y"){const{marks:a}=t,s=a.map((t=>{var a,s;return Rh({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:e,[n]:Object.assign(Object.assign({},(null===(a=t[n])||void 0===a?void 0:a[i])&&{[i]:Object.assign({preserve:!0},r&&{ratio:null})}),(null===(s=t[n])||void 0===s?void 0:s[o])&&{[o]:{preserve:!0}}),animate:!1})}));return Object.assign(Object.assign({},t),{marks:s,clip:!0,animate:!1})}function II(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return Ex(e,[Mx(e,o(r),!0),Mx(e,o(i),!1)])}function DI(t){return[t[0],t[t.length-1]]}function BI({initDomain:t={},className:e="slider",prefix:n="slider",setValue:r=((t,e)=>t.setValues(e)),hasState:i=!1,wait:o=50,leading:a=!0,trailing:s=!1,getInitValues:c=(t=>{var e;const n=null===(e=null==t?void 0:t.attributes)||void 0===e?void 0:e.values;if(0!==n[0]||1!==n[1])return n})}){return(l,u,f)=>{const{container:h,view:d,update:p,setState:y}=l,g=h.getElementsByClassName(e);if(!g.length)return()=>{};let v=!1;const{scale:m,coordinate:b,layout:x}=d,{paddingLeft:w,paddingTop:O,paddingBottom:k,paddingRight:_}=x,{x:M,y:E}=m,S=vp(b),A=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return S?[n,e]:[e,n]},j=new Map,P=new Set,T={x:t.x||M.getOptions().domain,y:t.y||E.getOptions().domain};for(const t of g){const{orientation:e}=t.attributes,[l,u]=A(e),h=`${n}${Bd(l)}:filter`,d="x"===l,{ratio:g}=M.getOptions(),{ratio:b}=E.getOptions(),x=t=>{if(t.data){const{selection:e}=t.data,[n=DI(T.x),r=DI(T.y)]=e;return d?[Ex(M,n,g),Ex(E,r,b)]:[Ex(E,r,b),Ex(M,n,g)]}const{value:n}=t.detail;return[II(n,m[l],S&&"horizontal"===e),T[u]]},C=pN((e=>LI(this,void 0,void 0,(function*(){const{initValue:r=!1}=e;if(v&&!r)return;v=!0;const{nativeEvent:o=!0}=e,[a,s]=x(e);if(T[l]=a,T[u]=s,o){const t=d?a:s,n=d?s:a;f.emit(h,Object.assign(Object.assign({},e),{nativeEvent:o,data:{selection:[DI(t),DI(n)]}}))}y(t,(t=>Object.assign(Object.assign({},NI(t,{[l]:{domain:a,nice:!1}},n,i,l,u)),{paddingLeft:w,paddingTop:O,paddingBottom:k,paddingRight:_}))),yield p(),v=!1}))),o,{leading:a,trailing:s}),R=e=>{const{nativeEvent:n}=e;if(n)return;const{data:i}=e,{selection:o}=i,[a,s]=o;t.dispatchEvent(new ec("valuechange",{data:i,nativeEvent:!1}));const c=d?Ax(a,M):Ax(s,E);r(t,c)};f.on(h,R),t.addEventListener("valuechange",C),j.set(t,C),P.add([h,R]);const L=c(t);L&&t.dispatchEvent(new ec("valuechange",{detail:{value:L},nativeEvent:!1,initValue:!0}))}return()=>{for(const[t,e]of j)t.removeEventListener("valuechange",e);for(const[t,e]of P)f.off(t,e)}}}const FI="g2-scrollbar";function zI(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName(FI).length)return()=>{};const{scale:a}=i,{x:s,y:c}=a,l={x:[...s.getOptions().domain],y:[...c.getOptions().domain]};s.update({domain:s.getOptions().expectedDomain}),c.update({domain:c.getOptions().expectedDomain});return BI(Object.assign(Object.assign({},t),{initDomain:l,className:FI,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0]),getInitValues:t=>{const e=t.slider.attributes.values;if(0!==e[0])return e}}))(e,n,r)}}var ZI=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i${e}`}const $I={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function GI(t){return"text"===t.nodeName&&!!t.isOverflowing()}function HI(t){var{offsetX:e=8,offsetY:n=8}=t,r=ZI(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[o,a]=i.getBounds().min,s=ed(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!GI(r))return void t.stopPropagation();const{offsetX:l,offsetY:u}=t,f=l+e-o,h=u+n-a;if(r.tip)return r.tip.style.x=f,void(r.tip.style.y=h);const{text:d}=r.style,p=new cl({className:"poptip",style:{innerHTML:WI("div",d,Object.assign(Object.assign({},$I),s)),x:f,y:h}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;GI(e)?e.tip&&(e.tip.remove(),e.tip=null,c.delete(e.tip)):t.stopPropagation()};return i.addEventListener("pointerover",l),i.addEventListener("pointerout",u),()=>{i.removeEventListener("pointerover",l),i.removeEventListener("pointerout",u),c.forEach((t=>t.remove()))}}}HI.props={reapplyWhenUpdate:!0};var qI=function(t,e){var n=ES(e),r=n.length;if(Fe(t))return!r;for(var i=0;i=0&&(l=h[O]).data===QI;--O)l.data=null}if(s.parent=XI,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(hS),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=VI(t),r):e},r.parentId=function(t){return arguments.length?(n=VI(t),r):n},r.path=function(e){return arguments.length?(t=VI(e),r):t},r}function nD(t){var e=t.length;if(e<2)return"";for(;--e>1&&!rD(t,e););return t.slice(0,e)}function rD(t,e){if("/"===t[e]){for(var n=0;e>0&&"\\"===t[--e];)++n;if(0==(1&n))return!0}return!1}function iD(t,e,n,r,i){var o,a,s=t.children,c=s.length,l=new Array(c+1);for(l[0]=a=o=0;o=n-1){var u=s[e];return u.x0=i,u.y0=o,u.x1=a,void(u.y1=c)}var f=l[e],h=r/2+f,d=e+1,p=n-1;for(;d>>1;l[y]c-o){var m=r?(i*v+a*g)/r:a;t(e,d,g,i,o,m,c),t(d,n,v,m,o,a,c)}else{var b=r?(o*v+c*g)/r:c;t(e,d,g,i,o,a,b),t(d,n,v,i,b,a,c)}}(0,c,t.value,e,n,r,i)}function oD(t,e,n,r,i){for(var o,a=t.children,s=-1,c=a.length,l=t.value&&(i-n)/t.value;++sh&&(h=s),g=u*u*y,(d=Math.max(h/g,g/f))>p){u-=s;break}p=d}v.push(a={value:u,dice:c1?e:1)},n}(sD),uD=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,c,l,u,f=-1,h=a.length,d=t.value;++f1?e:1)},n}(sD);function fD(){return 0}function hD(t){return function(){return t}}function dD(t,e=[t.data.name]){t.id=t.id||t.data.name,t.path=e,t.children&&t.children.forEach((n=>{n.id=`${t.id}/${n.data.name}`,n.path=[...e,n.data.name],dD(n,n.path)}))}function pD(t){const e=xy(t,["data","name"]);e.replaceAll&&(t.path=e.replaceAll(".","/").split("/")),t.children&&t.children.forEach((t=>{pD(t)}))}function yD(t,e,n){const{value:r}=n,i=function(t,e){const n={treemapBinary:iD,treemapDice:tS,treemapSlice:oD,treemapSliceDice:aD,treemapSquarify:lD,treemapResquarify:uD},r="treemapSquarify"===t?n[t].ratio(e):n[t];if(!r)throw new TypeError("Invalid tile method!");return r}(e.tile,e.ratio),o=function(t,e){return Array.isArray(t)?"function"==typeof e?eD().path(e)(t):eD()(t):cS(t)}(t,e.path);vn(t)?pD(o):dD(o),r?o.sum((t=>e.ignoreParentValue&&t.children?0:kA(r)(t))).sort(e.sort):o.count(),function(){var t=lD,e=!1,n=1,r=1,i=[0],o=fD,a=fD,s=fD,c=fD,l=fD;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(JE),t}function f(e){var n=i[e.depth],r=e.x0+n,u=e.y0+n,f=e.x1-n,h=e.y1-n;fObject.assign(t,{id:t.id.replace(/^\//,""),x:[t.x0,t.x1],y:[t.y0,t.y1]}))),s=a.filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer);return[s,a]}var gD=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))},vD=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{update:r,setState:i,container:s,options:c}=t,l=function(t){return cd(t).select(`.${N}`).node()}(s),u=c.marks[0],{state:f}=u,h=new al;l.appendChild(h);const d=(t,c)=>gD(this,void 0,void 0,(function*(){if(h.removeChildren(),c){let e="",n=o.y,r=0;const i=[],s=l.getBBox().width,c=t.map(((a,c)=>{e=`${e}${a}/`,i.push(a);const l=new xl({name:e.replace(/\/$/,""),style:Object.assign(Object.assign({text:a,x:r,path:[...i],depth:c},o),{y:n})});h.appendChild(l),r+=l.getBBox().width;const u=new xl({style:Object.assign(Object.assign({x:r,text:" / "},o),{y:n})});return h.appendChild(u),r+=u.getBBox().width,r>s&&(n=h.getBBox().height+o.y,r=0,l.attr({x:r,y:n}),r+=l.getBBox().width,u.attr({x:r,y:n}),r+=u.getBBox().width),c===Em(t)-1&&u.remove(),l}));c.forEach(((t,e)=>{if(e===Em(c)-1)return;const n=Object.assign({},t.attributes);t.attr("cursor","pointer"),t.addEventListener("mouseenter",(()=>{t.attr(a)})),t.addEventListener("mouseleave",(()=>{t.attr(n)})),t.addEventListener("click",(()=>{d(xy(t,["style","path"]),xy(t,["style","depth"]))}))}))}!function(t,e){[...tI(t),...eI(t)].forEach((t=>{e(t,(t=>t))}))}(s,i),i("treemapDrillDown",(r=>{const{marks:i}=r,o=t.join("/"),a=i.map((t=>{if("rect"!==t.type)return t;let r=e;if(c){const t=e.filter((t=>{const e=xy(t,["id"]);return e&&(e.match(`${o}/`)||o.match(e))})).map((t=>({value:0===t.height?xy(t,["value"]):void 0,name:xy(t,["id"])}))),{paddingLeft:i,paddingBottom:a,paddingRight:s}=n,l=Object.assign(Object.assign({},n),{paddingTop:(n.paddingTop||h.getBBox().height+10)/(c+1),paddingLeft:i/(c+1),paddingBottom:a/(c+1),paddingRight:s/(c+1),path:t=>t.name,layer:t=>t.depth===c+1});r=yD(t,l,{value:"value"})[0]}else r=e.filter((t=>1===t.depth));const i=[];return r.forEach((({path:t})=>{i.push(KR(t))})),Rh({},t,{data:r,scale:{color:{domain:i}}})}));return Object.assign(Object.assign({},r),{marks:a})})),yield r(void 0,["legendFilter"])})),p=t=>{const n=t.target;if("rect"!==xy(n,["markType"]))return;const r=xy(n,["__data__","key"]),i=YI(e,(t=>t.id===r));xy(i,"height")&&d(xy(i,"path"),xy(i,"depth"))};l.addEventListener("click",p);const y=ES(Object.assign(Object.assign({},f.active),f.inactive)),g=()=>{Sw(l).forEach((t=>{const n=xy(t,["style","cursor"]),r=YI(e,(e=>e.id===xy(t,["__data__","key"])));if("pointer"!==n&&(null==r?void 0:r.height)){t.style.cursor="pointer";const e=QE(t.attributes,y);t.addEventListener("mouseenter",(()=>{t.attr(f.active)})),t.addEventListener("mouseleave",(()=>{t.attr(Rh(e,f.inactive))}))}}))};return g(),l.addEventListener("mousemove",g),()=>{h.remove(),l.removeEventListener("click",p),l.removeEventListener("mousemove",g)}}}var xD=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))},wD=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const e=t.target,{markType:n}=e;"line"===n&&(e.attr("_lineWidth",e.attr("lineWidth")||1),e.attr("lineWidth",e.attr("_lineWidth")+3)),"interval"===n&&(e.attr("_opacity",e.attr("opacity")||1),e.attr("opacity",.7*e.attr("_opacity")))},MD=t=>{const e=t.target,{markType:n}=e;"line"===n&&e.attr("lineWidth",e.attr("_lineWidth")),"interval"===n&&e.attr("opacity",e.attr("_opacity"))},ED=(t,e,n)=>{t.forEach(((t,r)=>{t.attr("stroke",e[1]===r?n.activeStroke:n.stroke)}))},SD=(t,e,n,r)=>{const i=new dl({style:n}),o=new xl({style:r});return e.appendChild(o),t.appendChild(i),[i,o]},AD=(t,e)=>{if(!xy(t,["options","range","indexOf"]))return;const n=t.options.range.indexOf(e);return t.sortedDomain[n]},jD=(t,e,n)=>{const r=Mw(t,e),i=Mw(t,n)/r;return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]};function PD(t={}){const{selection:e=[],precision:n=2}=t,r=wD(t,["selection","precision"]),i=Object.assign(Object.assign({},OD),r||{}),o=ed(i,"path"),a=ed(i,"label"),s=ed(i,"point");return(t,r,i)=>{const{update:c,setState:l,container:u,view:f,options:{marks:h,coordinate:d}}=t,p=cw(u);let y,g=Sw(p),v=e;const{transform:m=[],type:b}=d,x=!!YI(m,(({type:t})=>"transpose"===t)),w="polar"===b,O="theta"===b,k=!!YI(g,(({markType:t})=>"area"===t));k&&(g=g.filter((({markType:t})=>"area"===t)));const _=new al({style:{zIndex:2}});p.appendChild(_);const M=()=>{i.emit("element-point:select",{nativeEvent:!0,data:{selection:v}})},E=t=>{const e=t.target;v=[e.parentNode.childNodes.indexOf(e)],M(),A(e)},S=t=>{const{data:{selection:e},nativeEvent:n}=t;if(n)return;v=e;const r=xy(g,[null==v?void 0:v[0]]);r&&A(r)},A=t=>{const{attributes:e,markType:r,__data__:d}=t,{stroke:p}=e,{points:g,seriesTitle:m,color:b,title:E,seriesX:S,y1:j}=d;if(x&&"interval"!==r)return;const{scale:P,coordinate:T}=(null==y?void 0:y.view)||f,{color:C,y:R,x:L}=P,N=T.getCenter();let I;_.removeChildren();const D=(t,e,n,r)=>xD(this,void 0,void 0,(function*(){return l("elementPointMove",(o=>{var a;const s=((null===(a=null==y?void 0:y.options)||void 0===a?void 0:a.marks)||h).map((o=>{if(!r.includes(o.type))return o;const{data:a,encode:s}=o,c=Object.keys(s).reduce(((r,i)=>{const o=s[i];return"x"===i&&(r[o]=t),"y"===i&&(r[o]=e),"color"===i&&(r[o]=n),r}),{}),l=((t,e,n)=>e.map((e=>{const r=["x","color"].reduce(((r,i)=>{const o=n[i];return o?e[o]===t[o]&&r:r}),!0);return r?Object.assign(Object.assign({},e),t):e})))(c,a,s);return((t,e)=>{i.emit("element-point:moved",{nativeEvent:!0,data:{changeData:t,data:e}})})(c,l),Rh({},o,{data:l,animate:!1})}));return Object.assign(Object.assign({},o),{marks:s})})),yield c("elementPointMove")}));if(["line","area"].includes(r))g.forEach(((e,r)=>{const i=L.invert(S[r]);if(!i)return;const c=new nl({name:kD,style:Object.assign({cx:e[0],cy:e[1],fill:p},s)}),l=((t,e)=>{const n=xy(t,["__data__","seriesItems",e,"0","value"]),r=xy(t,["__data__","seriesIndex",e]),{__data__:{data:i,encode:o,transform:a}}=t.parentNode,s=YI(a,(({type:t})=>"normalizeY"===t)),c=xy(o,["y","field"]),l=i[r][c];return t=>s?1===n?t:t/(1-t)/(n/(1-n))*l:t})(t,r);c.addEventListener("mousedown",(f=>{const h=T.output([S[r],0]),d=null==m?void 0:m.length;u.attr("cursor","move"),v[1]!==r&&(v[1]=r,M()),ED(_.childNodes,v,s);const[p,x]=SD(_,c,o,a),O=t=>{const i=e[1]+t.clientY-I[1];if(k)if(w){const o=e[0]+t.clientX-I[0],[a,s]=jD(N,h,[o,i]),[,u]=T.output([1,R.output(0)]),[,f]=T.invert([a,u-(g[r+d][1]-s)]),y=(r+1)%d,v=Ew([g[(r-1+d)%d],[a,s],m[y]&&g[y]]);x.attr("text",l(R.invert(f)).toFixed(n)),p.attr("d",v),c.attr("cx",a),c.attr("cy",s)}else{const[,t]=T.output([1,R.output(0)]),[,o]=T.invert([e[0],t-(g[r+d][1]-i)]),a=Ew([g[r-1],[e[0],i],m[r+1]&&g[r+1]]);x.attr("text",l(R.invert(o)).toFixed(n)),p.attr("d",a),c.attr("cy",i)}else{const[,t]=T.invert([e[0],i]),o=Ew([g[r-1],[e[0],i],g[r+1]]);x.attr("text",R.invert(t).toFixed(n)),p.attr("d",o),c.attr("cy",i)}};I=[f.clientX,f.clientY],window.addEventListener("mousemove",O);const E=()=>xD(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),window.removeEventListener("mousemove",O),u.removeEventListener("mouseup",E),Cn(x.attr("text")))return;const e=Number(x.attr("text")),n=AD(C,b);y=yield D(i,e,n,["line","area"]),x.remove(),p.remove(),A(t)}));u.addEventListener("mouseup",E)})),_.appendChild(c)})),ED(_.childNodes,v,s);else if("interval"===r){let e=[(g[0][0]+g[1][0])/2,g[0][1]];x?e=[g[0][0],(g[0][1]+g[1][1])/2]:O&&(e=g[0]);const i=(t=>{const e=xy(t,["__data__","y"]),n=xy(t,["__data__","y1"])-e,{__data__:{data:r,encode:i,transform:o},childNodes:a}=t.parentNode,s=YI(o,(({type:t})=>"normalizeY"===t)),c=xy(i,["y","field"]),l=r[a.indexOf(t)][c];return(t,e=!1)=>s||e?t/(1-t)/(n/(1-n))*l:t})(t),c=new nl({name:kD,style:Object.assign(Object.assign({cx:e[0],cy:e[1],fill:p},s),{stroke:s.activeStroke})});c.addEventListener("mousedown",(s=>{u.attr("cursor","move");const l=AD(C,b),[f,h]=SD(_,c,o,a),d=t=>{if(x){const r=e[0]+t.clientX-I[0],[o]=T.output([R.output(0),R.output(0)]),[,a]=T.invert([o+(r-g[2][0]),e[1]]),s=Ew([[r,g[0][1]],[r,g[1][1]],g[2],g[3]],!0);h.attr("text",i(R.invert(a)).toFixed(n)),f.attr("d",s),c.attr("cx",r)}else if(O){const r=e[1]+t.clientY-I[1],o=e[0]+t.clientX-I[0],[a,s]=jD(N,[o,r],e),[l,u]=jD(N,[o,r],g[1]),d=T.invert([a,s])[1],p=j-d;if(p<0)return;const y=function(t,e,n=0){const r=[["M",...e[1]]],i=Mw(t,e[1]),o=Mw(t,e[0]);return 0===i?r.push(["L",...e[3]],["A",o,o,0,n,1,...e[0]],["Z"]):r.push(["A",i,i,0,n,0,...e[2]],["L",...e[3]],["A",o,o,0,n,1,...e[0]],["Z"]),r}(N,[[a,s],[l,u],g[2],g[3]],p>.5?1:0);h.attr("text",i(p,!0).toFixed(n)),f.attr("d",y),c.attr("cx",a),c.attr("cy",s)}else{const r=e[1]+t.clientY-I[1],[,o]=T.output([1,R.output(0)]),[,a]=T.invert([e[0],o-(g[2][1]-r)]),s=Ew([[g[0][0],r],[g[1][0],r],g[2],g[3]],!0);h.attr("text",i(R.invert(a)).toFixed(n)),f.attr("d",s),c.attr("cy",r)}};I=[s.clientX,s.clientY],window.addEventListener("mousemove",d);const p=()=>xD(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),u.removeEventListener("mouseup",p),window.removeEventListener("mousemove",d),Cn(h.attr("text")))return;const e=Number(h.attr("text"));y=yield D(E,e,l,[r]),h.remove(),f.remove(),A(t)}));u.addEventListener("mouseup",p)})),_.appendChild(c)}};g.forEach(((t,e)=>{v[0]===e&&A(t),t.addEventListener("click",E),t.addEventListener("mouseenter",_D),t.addEventListener("mouseleave",MD)}));const j=t=>{const e=null==t?void 0:t.target;e&&(e.name===kD||g.includes(e))||(v=[],M(),_.removeChildren())};return i.on("element-point:select",S),i.on("element-point:unselect",j),u.addEventListener("mousedown",j),()=>{_.remove(),i.off("element-point:select",S),i.off("element-point:unselect",j),u.removeEventListener("mousedown",j),g.forEach((t=>{t.removeEventListener("click",E),t.removeEventListener("mouseenter",_D),t.removeEventListener("mouseleave",MD)}))}}}var TD=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);it=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:o,data:a}=t;return e.map((t=>{var{data:e,x:s,y:c,width:l,height:u}=t,f=TD(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:eb(e,a),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:o})}))};CD.props={};var RD=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);it=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map((()=>1)),padding:i=0,data:o}=t,[a,s,c,l]="col"===n?["y","height","width","x"]:["x","width","height","y"],u=r.reduce(((t,e)=>t+e)),f=t[s]-i*(e.length-1),h=r.map((t=>f*(t/u))),d=[];let p=t[a]||0;for(let n=0;n{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:o,y:a}=e,s=(t,e)=>{var o;if(void 0===t||!i)return{};const a=zh(n,(e=>e[t])),s=(null===(o=null==r?void 0:r[e])||void 0===o?void 0:o.domain)||Array.from(a.keys()),c=s.map((t=>a.has(t)?a.get(t).length:1));return{domain:s,flex:c}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===o?null:{position:"top"}},void 0===o&&{paddingInner:0}),s(o,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===a?null:{position:"right"}},void 0===a&&{paddingInner:0}),s(a,"y"))}}})),BD=tb((t=>{const{data:e,scale:n,legend:r}=t,i=[t];let o,a,s;for(;i.length;){const t=i.shift(),{children:e,encode:n={},scale:r={},legend:c={}}=t,{color:l}=n,{color:u}=r,{color:f}=c;void 0!==l&&(o=l),void 0!==u&&(a=u),void 0!==f&&(s=f),Array.isArray(e)&&i.push(...e)}const c="string"==typeof o?o:"",[l,u]=(()=>{var t;const r=null===(t=null==n?void 0:n.color)||void 0===t?void 0:t.domain;if(void 0!==r)return[r];if(void 0===o)return[void 0];const i="function"==typeof o?o:t=>t[o],a=e.map(i);return a.some((t=>"number"==typeof t))?[dv(a)]:[Array.from(new Set(a)),"ordinal"]})();return Object.assign({encode:{color:{type:"column",value:null!=l?l:[]}},scale:{color:Rh({},a,{domain:l,type:u})}},void 0===r&&{legend:{color:Rh({title:c},s)}})})),FD=Jm((()=>({animate:{enterType:"fadeIn"}}))),zD=tb((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),ZD=tb((()=>({type:"cell"}))),WD=tb((t=>{const{data:e}=t,n={type:"custom",callback:()=>{const{data:e,encode:n}=t,{x:r,y:i}=n,o=r?Array.from(new Set(e.map((t=>t[r])))):[],a=i?Array.from(new Set(e.map((t=>t[i])))):[];return(()=>{if(o.length&&a.length){const t=[];for(const e of o)for(const n of a)t.push({[r]:e,[i]:n});return t}return o.length?o.map((t=>({[r]:t}))):a.length?a.map((t=>({[i]:t}))):void 0})()}};return{data:{type:"inline",value:e,transform:[n]}}})),$D=tb(((t,e=GD,n=qD,r=YD,i={})=>{const{data:o,encode:a,children:s,scale:c,x:l=0,y:u=0,shareData:f=!1,key:h}=t,{value:d}=o,{x:p,y:y}=a,{color:g}=c,{domain:v}=g;return{children:(t,o,a)=>{const{x:c,y:g}=o,{paddingLeft:m,paddingTop:b,marginLeft:x,marginTop:w}=a,{domain:O}=c.getOptions(),{domain:k}=g.getOptions(),_=Jd(t),M=t.map(e),E=t.map((({x:t,y:e})=>[c.invert(t),g.invert(e)])),S=E.map((([t,e])=>n=>{const{[p]:r,[y]:i}=n;return(void 0===p||r===t)&&(void 0===y||i===e)})),A=S.map((t=>d.filter(t))),j=f?cp(A,(t=>t.length)):void 0,P=E.map((([t,e])=>({columnField:p,columnIndex:O.indexOf(t),columnValue:t,columnValuesLength:O.length,rowField:y,rowIndex:k.indexOf(e),rowValue:e,rowValuesLength:k.length}))),T=P.map((t=>Array.isArray(s)?s:[s(t)].flat(1)));return _.flatMap((t=>{const[e,o,a,s]=M[t],c=P[t],f=A[t];return T[t].map((g=>{var O,k,{scale:_,key:M,facet:E=!0,axis:S={},legend:A={}}=g,P=ID(g,["scale","key","facet","axis","legend"]);const T=(null===(O=null==_?void 0:_.y)||void 0===O?void 0:O.guide)||S.y,C=(null===(k=null==_?void 0:_.x)||void 0===k?void 0:k.guide)||S.x,R={x:{tickCount:p?5:void 0},y:{tickCount:y?5:void 0}},L=E?f:0===f.length?[]:d,N={color:{domain:v}},I={x:VD(C,n)(c,L),y:VD(T,r)(c,L)};return Object.assign(Object.assign({key:`${M}-${t}`,data:L,margin:0,x:e+m+l+x,y:o+b+u+w,parentKey:h,width:a,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!L.length,dataDomain:j,scale:Rh(R,_,N),axis:Rh({},S,I),legend:!1},P),i)}))}))}}}));function GD(t){const{points:e}=t;return ub(e)}function HD(t,e){return e.length?Rh({title:!1,tick:null,label:null},t):Rh({title:!1,tick:null,label:null,grid:null},t)}function qD(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return HD(t,n);const s=o===a-1&&void 0,c=n.length?void 0:null;return Rh({title:s,grid:c},t)}}function YD(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return HD(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return Rh({title:o,grid:a},t)}}function VD(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const UD=()=>t=>[ND.of(t).call(ZD).call(BD).call(FD).call(DD).call(zD).call(WD).call($D).value()];UD.props={};var XD=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),QD=tb((t=>{const{data:e,children:n,x:r=0,y:i=0,key:o}=t;return{children:(t,a,s)=>{const{x:c,y:l}=a,{paddingLeft:u,paddingTop:f,marginLeft:h,marginTop:d}=s,{domain:p}=c.getOptions(),{domain:y}=l.getOptions(),g=Jd(t),v=t.map((({points:t})=>ub(t))),m=t.map((({x:t,y:e})=>[c.invert(t),l.invert(e)])),b=m.map((([t,e])=>({columnField:t,columnIndex:p.indexOf(t),columnValue:t,columnValuesLength:p.length,rowField:e,rowIndex:y.indexOf(e),rowValue:e,rowValuesLength:y.length}))),x=b.map((t=>Array.isArray(n)?n:[n(t)].flat(1)));return g.flatMap((t=>{const[n,a,s,c]=v[t],[l,p]=m[t],y=b[t];return x[t].map((g=>{var v,m;const{scale:b,key:x,encode:w,axis:O,interaction:k}=g,_=XD(g,["scale","key","encode","axis","interaction"]),M=null===(v=null==b?void 0:b.y)||void 0===v?void 0:v.guide,E={x:tB(null===(m=null==b?void 0:b.x)||void 0===m?void 0:m.guide)(y,e),y:eB(M)(y,e)};return Object.assign({data:e,parentKey:o,key:`${x}-${t}`,x:n+u+r+h,y:a+f+i+d,width:s,height:c,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:Rh({x:{facet:!1},y:{facet:!1}},b),axis:Rh({x:{tickCount:5},y:{tickCount:5}},O,E),legend:!1,encode:Rh({},w,{x:l,y:p}),interaction:Rh({},k,{legendFilter:!1})},_)}))}))}}})),JD=tb((t=>{const{encode:e}=t,n=XD(t,["encode"]),{position:r=[],x:i=r,y:o=[...r].reverse()}=e,a=XD(e,["position","x","y"]),s=[];for(const t of[i].flat(1))for(const e of[o].flat(1))s.push({$x:t,$y:e});return Object.assign(Object.assign({},n),{data:s,encode:Object.assign(Object.assign({},a),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[i].flat(1).length&&{x:{paddingInner:0}}),1===[o].flat(1).length&&{y:{paddingInner:0}})})}));function tB(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return HD(t,n)}}function eB(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return HD(t,n)}}const nB=()=>t=>[ND.of(t).call(ZD).call(BD).call(QD).call(JD).call(FD).call(zD).call(KD).value()];var rB=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),oB=Jm((t=>({coordinate:{type:"polar"}}))),aB=t=>{const{encode:e}=t,n=rB(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function sB(t){return t=>null}function cB(t){const{points:e}=t,[n,r,i,o]=e,a=ab(n,o),s=ib(n,o),c=lb(s,ib(r,i)),l=1/Math.sin(c/2),u=a/(1+l),f=u*Math.sqrt(2),[h,d]=i,p=cb(s)+c/2,y=u*l;return[h+y*Math.sin(p)-f/2,d-y*Math.cos(p)-f/2,f,f]}const lB=()=>t=>[ND.of(t).call(ZD).call(aB).call(BD).call(oB).call(WD).call($D,cB,sB,sB,{frame:!1}).call(FD).call(zD).call(iB).value()];function uB(t,e,n){const r=[0,n],i=[1-n,1];return"normal"===t?r:"reverse"===t?i:"alternate"===t?e%2==0?r:i:"reverse-alternate"===t?e%2==0?i:r:void 0}const fB=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:o="ease-in-out-sine"}=t,a=e.length;if(!Array.isArray(e)||0===a)return[];const{key:s}=e[0],c=e.map((t=>Object.assign(Object.assign({},t),{key:s}))).map((t=>function(t,e,n){const r=[t];for(;r.length;){const t=r.pop();t.animate=Rh({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},t.animate||{});const{children:i}=t;Array.isArray(i)&&r.push(...i)}return t}(t,n,o)));return function*(){let t,e=0;for(;"infinite"===r||e{var e;return[t,null===(e=qS(r,t))||void 0===e?void 0:e[0]]})).filter((([,t])=>Jh(t)));return Array.from(zh(e,(t=>i.map((([,e])=>e[t])).join("-"))).values())}function dB(t){return Array.isArray(t)?function(t){return(e,n,r)=>(n,r)=>t.reduce(((t,i)=>0!==t?t:tx(e[n][i],e[r][i])),0)}(t):"function"==typeof t?function(t){return(e,n,r)=>xB((n=>t(e[n])))}(t):"series"===t?gB:"value"===t?vB:"sum"===t?mB:"maxIndex"===t?bB:null}function pB(t,e){for(const n of t)n.sort(e)}function yB(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function gB(t,e,n){return xB((t=>n[t]))}function vB(t,e,n){return xB((t=>e[t]))}function mB(t,e,n){const r=Jd(t),i=Array.from(zh(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,n.reduce(((t,n)=>t+ +e[n]))])));return xB((t=>o.get(n[t])))}function bB(t,e,n){const r=Jd(t),i=Array.from(zh(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,zb(n,(t=>e[t]))])));return xB((t=>o.get(n[t])))}function xB(t){return(e,n)=>tx(t(e),t(n))}fB.props={};const wB=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:o="y1",series:a=!0}=t;return(t,s)=>{var c;const{data:l,encode:u,style:f={}}=s,[h,d]=qS(u,"y"),[p,y]=qS(u,"y1"),[g]=a?YS(u,"series","color"):qS(u,"color"),v=hB(e,t,s),m=(null!==(c=dB(n))&&void 0!==c?c:()=>null)(l,h,g);m&&pB(v,m);const b=new Array(t.length),x=new Array(t.length),w=new Array(t.length),O=[],k=[];for(const t of v){r&&t.reverse();const e=p?+p[t[0]]:0,n=[],i=[];for(const r of t){const t=w[r]=+h[r]-e;t<0?i.push(r):t>=0&&n.push(r)}const o=n.length>0?n:i,a=i.length>0?i:n;let s=n.length-1,c=0;for(;s>0&&0===h[o[s]];)s--;for(;c0?u=b[t]=(x[t]=u)+e:b[t]=x[t]=u}}const _=new Set(O),M=new Set(k),E="y"===i?b:x,S="y"===o?b:x;let A;return A="point"===s.type?{y0:WS(h,d),y:ZS(E,d)}:{y0:WS(h,d),y:ZS(E,d),y1:ZS(S,y)},[t,Rh({},s,{encode:Object.assign({},A),style:Object.assign({first:(t,e)=>_.has(e),last:(t,e)=>M.has(e)},f)})]}};function OB(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function kB(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let s of t)null!=(s=e(s,++a,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,o+=n*(s-i))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}wB.props={};var _B=Array.prototype,MB=_B.slice;_B.map;function EB(t){return()=>t}const SB=Math.sqrt(50),AB=Math.sqrt(10),jB=Math.sqrt(2);function PB(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=SB?10:o>=AB?5:o>=jB?2:1;let s,c,l;return i<0?(l=Math.pow(10,-i)/a,s=Math.round(t*l),c=Math.round(e*l),s/le&&--c,l=-l):(l=Math.pow(10,i)*a,s=Math.round(t/l),c=Math.round(e/l),s*le&&--c),c0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(u,f,n)),h=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e=i))return[];const s=o-i+1,c=new Array(s);if(r)if(a<0)for(let t=0;t=f)if(t>=f&&e===dv){const t=TB(u,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var d=h.length,p=0,y=d;h[p]<=u;)++p;for(;h[y-1]>f;)--y;(p||y0?h[i-1]:u,g.x1=i0)for(i=0;in;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(o-c)/o)*(a-o/2<0?-1:1);LB(t,e,Math.max(n,Math.floor(e-a*c/o+l)),Math.min(r,Math.floor(e+(o-a)*c/o+l)),i)}const o=t[e];let a=n,s=r;for(NB(t,n,e),i(t[r],o)>0&&NB(t,n,r);a0;)--s}0===i(t[n],o)?NB(t,n,s):(++s,NB(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function NB(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function IB(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return fM(t);if(e>=1)return cp(t);var r,i=(r-1)*e,o=Math.floor(i),a=cp(LB(t,o).subarray(0,o+1));return a+(fM(t.subarray(o+1))-a)*(i-o)}}function DB(t,e,n=mx){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>mx(n(t[r],r,t)))),e<=0)return bN(r);if(e>=1)return zb(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return LB(i,a,0,o,((t,e)=>rx(r[t],r[e]))),a=function(t,e=tx){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?tx(t,i)>0:0===tx(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}(i.subarray(0,a+1),(t=>r[t])),a>=0?a:-1}}function BB(t,e){return IB(t,.5,e)}function FB(t,e){return DB(t,.5,e)}var zB=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);inull===e?t:`${t} of ${e}`}function WB(){return[(t,e)=>xN(t,(t=>+e[t])),ZB("mean")]}function $B(){return[(t,e)=>BB(t,(t=>+e[t])),ZB("median")]}function GB(){return[(t,e)=>cp(t,(t=>+e[t])),ZB("max")]}function HB(){return[(t,e)=>fM(t,(t=>+e[t])),ZB("min")]}function qB(){return[(t,e)=>t.length,ZB("count")]}function YB(){return[(t,e)=>sp(t,(t=>+e[t])),ZB("sum")]}function VB(){return[(t,e)=>e[t[0]],ZB("first")]}function UB(){return[(t,e)=>e[t[t.length-1]],ZB("last")]}const XB=(t={})=>{const{groupBy:e}=t,n=zB(t,["groupBy"]);return(t,r)=>{const{data:i,encode:o}=r,a=e(t,r);if(!a)return[t,r];const s=Object.entries(n).map((([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];const e={mean:WB,max:GB,count:qB,first:VB,last:UB,sum:YB,min:HB,median:$B}[t];if(!e)throw new Error(`Unknown reducer: ${t}.`);return e()}(e),[s,c]=qS(o,t),l=((t,e)=>{if(t)return t;const{from:n}=e;if(!n)return t;const[,r]=qS(o,n);return r})(c,e),u=a.map((t=>n(t,null!=s?s:i)));return[t,Object.assign(Object.assign({},GS(u,(null==r?void 0:r(l))||l)),{aggregate:!0})]})),c=Object.keys(o).map((t=>{const[e,n]=qS(o,t),r=a.map((t=>e[t[0]]));return[t,ZS(r,n)]})),l=a.map((t=>i[t[0]]));return[Jd(a),Rh({},r,{data:l,encode:Object.fromEntries([...c,...s])})]}};XB.props={};var KB=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=KB(t,["groupChannels","binChannels"]),i={};return XB(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter((([t])=>!t.startsWith(QB))))),Object.fromEntries(n.flatMap((t=>{const e=([e])=>+i[t].get(e).split(",")[1];return e.from=t,[[t,([e])=>+i[t].get(e).split(",")[0]],[`${t}1`,e]]})))),{groupBy:(t,o)=>{const{encode:a}=o,s=n.map((t=>{const[e]=qS(a,t);return e})),c=ed(r,QB),l=t.filter((t=>s.every((e=>Jh(e[t]))))),u=[...e.map((t=>{const[e]=qS(a,t);return e})).filter(Jh).map((t=>e=>t[e])),...n.map(((t,e)=>{const n=s[e],r=c[t]||JB(n),o=RB().thresholds(r).value((t=>+n[t]))(l),a=new Map(o.flatMap((t=>{const{x0:e,x1:n}=t,r=`${e},${n}`;return t.map((t=>[t,r]))})));return i[t]=a,t=>a.get(t)}))];return Array.from(zh(l,(t=>u.map((e=>e(t))).join("-"))).values())}}))};tF.props={};const eF=(t={})=>{const{thresholds:e}=t;return tF(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};eF.props={};var nF=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;nF(t,["groupBy","reverse","orderBy","padding"]);return(t,o)=>{const{data:a,encode:s,scale:c}=o,{series:l}=c,[u]=qS(s,"y"),[f]=YS(s,"series","color"),h=yB(f,l),d=Rh({},o,{scale:{series:{domain:h,paddingInner:i}}}),p=hB(e,t,o),y=dB(r);if(!y)return[t,Rh(d,{encode:{series:ZS(f)}})];const g=y(a,u,f);g&&pB(p,g);const v=new Array(t.length);for(const t of p){n&&t.reverse();for(let e=0;e{const{padding:e=0,paddingX:n=e,paddingY:r=e,random:i=Math.random}=t;return(t,e)=>{const{encode:o,scale:a}=e,{x:s,y:c}=a,[l]=qS(o,"x"),[u]=qS(o,"y"),f=iF(l,s,n),h=iF(u,c,r),d=t.map((()=>oF(i(),...h))),p=t.map((()=>oF(i(),...f)));return[t,Rh({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:ZS(d),dx:ZS(p)}})]}};aF.props={};const sF=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{x:a}=o,[s]=qS(i,"x"),c=iF(s,a,e),l=t.map((()=>oF(n(),...c)));return[t,Rh({scale:{x:{padding:.5}}},r,{encode:{dx:ZS(l)}})]}};sF.props={};const cF=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{y:a}=o,[s]=qS(i,"y"),c=iF(s,a,e),l=t.map((()=>oF(n(),...c)));return[t,Rh({scale:{y:{padding:.5}}},r,{encode:{dy:ZS(l)}})]}};cF.props={};var lF=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,{x:i}=r,o=lF(r,["x"]),a=Object.entries(o).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,qS(r,t)[0]])),s=a.map((([e])=>[e,new Array(t.length)])),c=hB(e,t,n),l=new Array(c.length);for(let t=0;ta.map((([,e])=>+e[t])))),[n,r]=dv(e);l[t]=(n+r)/2}const u=Math.max(...l);for(let t=0;t[t,ZS(e,qS(r,t)[1])])))})]}};uF.props={};const fF=(t={})=>{const{groupBy:e="x",series:n=!0}=t;return(t,r)=>{const{encode:i}=r,[o]=qS(i,"y"),[a,s]=qS(i,"y1"),[c]=n?YS(i,"series","color"):qS(i,"color"),l=hB(e,t,r),u=new Array(t.length);for(const t of l){const e=t.map((t=>+o[t]));for(let n=0;ne!==n)));u[r]=+o[r]>i?i:o[r]}}return[t,Rh({},r,{encode:{y1:ZS(u,s)}})]}};fF.props={};const hF=t=>{const{groupBy:e=["x"],reducer:n=((t,e)=>e[t[0]]),orderBy:r=null,reverse:i=!1,duration:o}=t;return(t,a)=>{const{encode:s}=a,c=(Array.isArray(e)?e:[e]).map((t=>[t,qS(s,t)[0]]));if(0===c.length)return[t,a];let l=[t];for(const[,t]of c){const e=[];for(const n of l){const r=Array.from(zh(n,(e=>t[e])).values());e.push(...r)}l=e}if(r){const[t]=qS(s,r);t&&l.sort(((e,r)=>n(e,t)-n(r,t))),i&&l.reverse()}const u=(o||3e3)/l.length,[f]=o?[HS(t,u)]:YS(s,"enterDuration",HS(t,u)),[h]=YS(s,"enterDelay",HS(t,0)),d=new Array(t.length);for(let t=0,e=0;t+f[t]));for(const t of n)d[t]=+h[t]+e;e+=r}return[t,Rh({},a,{encode:{enterDuration:$S(f),enterDelay:$S(d)}})]}};hF.props={};var dF=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{groupBy:e="x",basis:n="max"}=t;return(t,r)=>{const{encode:i,tooltip:o}=r,{x:a}=i,s=dF(i,["x"]),c=Object.entries(s).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,qS(i,t)[0]])),[,l]=c.find((([t])=>"y"===t)),u=c.map((([e])=>[e,new Array(t.length)])),f=hB(e,t,r),h=function(t){return"function"==typeof t?t:{min:(t,e)=>fM(t,(t=>e[+t])),max:(t,e)=>cp(t,(t=>e[+t])),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>xN(t,(t=>e[+t])),median:(t,e)=>BB(t,(t=>e[+t])),sum:(t,e)=>sp(t,(t=>e[+t])),deviation:(t,e)=>kB(t,(t=>e[+t]))}[t]||cp}(n);for(const t of f){const e=h(t,l);for(const n of t)for(let t=0;t[t,ZS(e,qS(i,t)[1])])))},!d&&i.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function yF(t,e){return[t[0]]}function gF(t,e){return[t[t.length-1]]}function vF(t,e){return[t[zb(t,(t=>e[t]))]]}function mF(t,e){return[t[bN(t,(t=>e[t]))]]}pF.props={};const bF=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(t,i)=>{const{encode:o}=i,a=hB(e,t,i),[s]=qS(o,n),c=function(t){return"function"==typeof t?t:{first:yF,last:gF,max:vF,min:mF}[t]||yF}(r);return[a.flatMap((t=>c(t,s))),i]}};bF.props={};var xF=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{selector:e}=t,n=xF(t,["selector"]);return bF(Object.assign({channel:"x",selector:e},n))};wF.props={};var OF=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{selector:e}=t,n=OF(t,["selector"]);return bF(Object.assign({channel:"y",selector:e},n))};kF.props={};var _F=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{channels:e=["x","y"]}=t,n=_F(t,["channels"]);return XB(Object.assign(Object.assign({},n),{groupBy:(t,n)=>hB(e,t,n)}))};MF.props={};const EF=(t={})=>MF(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));EF.props={};const SF=(t={})=>MF(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));SF.props={};const AF=(t={})=>MF(Object.assign(Object.assign({},t),{channels:["color"]}));AF.props={};var jF=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);ii(t,o);if("max"===i)return t=>cp(t,(t=>+o[t]));if("min"===i)return t=>fM(t,(t=>+o[t]));if("sum"===i)return t=>sp(t,(t=>+o[t]));if("median"===i)return t=>BB(t,(t=>+o[t]));if("mean"===i)return t=>xN(t,(t=>+o[t]));if("first"===i)return t=>o[t[0]];if("last"===i)return t=>o[t[t.length-1]];throw new Error(`Unknown reducer: ${i}`)}(a,s,c),d=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter((t=>r.has(e[t])))}(t,f,u),p=function(t,e,n){return(2!==e.length?ex(Wh(t,e,n),(([t,e],[n,r])=>tx(e,r)||tx(t,n))):ex(zh(t,n),(([t,n],[r,i])=>e(n,i)||tx(t,r)))).map((([t])=>t))}(d,h,(t=>f[t]));i&&p.reverse();const y="number"==typeof o?[0,o]:o,g=o?p.slice(...y):p;return[t,Rh(e,{scale:{[a]:{domain:g}}})]}const TF=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,o=jF(t,["reverse","slice","channel","ordinal"]);return(t,a)=>i?PF(t,a,Object.assign({reverse:e,slice:n,channel:r},o)):function(t,e,n){const{reverse:r,channel:i}=n,{encode:o}=e,[a]=qS(o,i),s=ex(t,(t=>a[t]));return r&&s.reverse(),[s,e]}(t,a,Object.assign({reverse:e,slice:n,channel:r},o))};TF.props={};const CF=(t={})=>TF(Object.assign(Object.assign({},t),{channel:"x"}));CF.props={};const RF=(t={})=>TF(Object.assign(Object.assign({},t),{channel:"y"}));RF.props={};const LF=(t={})=>TF(Object.assign(Object.assign({},t),{channel:"color"}));LF.props={};const NF=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(t,i)=>{const{data:o,encode:a}=i,[s]=qS(a,"x"),c=e?function(t,e){return"string"==typeof e?t.map((t=>t[e])):t.map(e)}(o,e):qS(a,n)[0],l=function(t,e){if("function"==typeof t)return n=>t(n,e);if("sum"===t)return t=>sp(t,(t=>+e[t]));throw new Error(`Unknown reducer: ${t}`)}(r,c),u=$h(t,l,(t=>s[t])).map((t=>t[1]));return[t,Rh({},i,{scale:{x:{flex:u}}})]}};function IF(t){const{padding:e=0,direction:n="col"}=t;return(t,r,i)=>{const o=t.length;if(0===o)return[];const{innerWidth:a,innerHeight:s}=i,c=s/a;let l=Math.ceil(Math.sqrt(r/c)),u=a/l,f=Math.ceil(r/l),h=f*u;for(;h>s;)l+=1,u=a/l,f=Math.ceil(r/l),h=f*u;const d=s-f*u,p=f<=1?0:d/(f-1),[y,g]=f<=1?[(a-o*u)/(o-1),(s-u)/2]:[0,0];return t.map(((t,r)=>{const[i,o,a,s]=ub(t),c="col"===n?r%l:Math.floor(r/f),h="col"===n?Math.floor(r/l):r%f;return`translate(${c*u-i+y*c+.5*e}, ${(f-h-1)*u+d-o-p*h-g+.5*e}) scale(${(u-e)/a}, ${(u-e)/s})`}))}}NF.props={};const DF=t=>(e,n)=>[e,Rh({},n,{modifier:IF(t),axis:!1})];function BF(t,e,n,r){const i=t.length;if(r>=i||0===r)return t;const o=n=>1*e[t[n]],a=e=>1*n[t[e]],s=[],c=(i-2)/(r-2);let l,u,f,h=0;s.push(h);for(let t=0;tl&&(l=u,f=y);s.push(f),h=f}return s.push(i-1),s.map((e=>t[e]))}DF.props={};const FF=(t={})=>{const{strategy:e="median",thresholds:n=2e3,groupBy:r=["series","color"]}=t,i=function(t){if("function"==typeof t)return t;if("lttb"===t)return BF;const e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[bN(t,(t=>n[t]))]],max:(t,e,n)=>[t[zb(t,(t=>n[t]))]],median:(t,e,n)=>[t[FB(t,(t=>n[t]))]]},n=e[t]||e.median;return(t,e,r,i)=>{const o=function(t,e){const n=t.length,r=[];let i=0;for(;in(t,e,r)))}}(e);return(t,e)=>{const{encode:o}=e,a=hB(r,t,e),[s]=qS(o,"x"),[c]=qS(o,"y");return[a.flatMap((t=>i(t,s,c,n))),e]}};FF.props={};const zF=(t={})=>(e,n)=>{const{encode:r,data:i}=n,o=Object.entries(t).map((([t,e])=>{const[n]=qS(r,t);if(!n)return null;const[i,o=!0]=function(t){return"object"==typeof t?[t.value,t.ordinal]:[t,!0]}(e);if("function"==typeof i)return t=>i(n[t]);if(o){const t=Array.isArray(i)?i:[i];return 0===t.length?null:e=>t.includes(n[e])}{const[t,e]=i;return r=>n[r]>=t&&n[r]<=e}})).filter(Jh),a=e.filter((t=>o.every((e=>e(t))))),s=a.map(((t,e)=>e));if(0===o.length){const t=function(t){var e;const{encode:n}=t,r=Object.assign(Object.assign({},t),{encode:Object.assign(Object.assign({},t.encode),{y:Object.assign(Object.assign({},t.encode.y),{value:[]})})}),i=null===(e=null==n?void 0:n.color)||void 0===e?void 0:e.field;if(!n||!i)return r;let o;for(const[t,e]of Object.entries(n))"x"!==t&&"y"!==t||e.field!==i||(o=Object.assign(Object.assign({},o),{[t]:Object.assign(Object.assign({},e),{value:[]})}));return o?Object.assign(Object.assign({},t),{encode:Object.assign(Object.assign({},t.encode),o)}):r}(n);return[e,t]}const c=Object.entries(r).map((([t,e])=>[t,Object.assign(Object.assign({},e),{value:s.map((t=>e.value[a[t]])).filter((t=>void 0!==t))})]));return[s,Rh({},n,{encode:Object.fromEntries(c),data:a.map((t=>i[t]))})]};zF.props={};var ZF={},WF={};function $F(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function GF(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function HF(t,e){var n=t+"",r=n.length;return r9999?"+"+HF(t,6):HF(t,4)}(t.getUTCFullYear())+"-"+HF(t.getUTCMonth()+1,2)+"-"+HF(t.getUTCDate(),2)+(i?"T"+HF(e,2)+":"+HF(n,2)+":"+HF(r,2)+"."+HF(i,3)+"Z":r?"T"+HF(e,2)+":"+HF(n,2)+":"+HF(r,2)+"Z":n||e?"T"+HF(e,2)+":"+HF(n,2)+"Z":"")}function YF(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,s=0,c=o<=0,l=!1;function u(){if(c)return WF;if(l)return l=!1,ZF;var e,r,i=a;if(34===t.charCodeAt(i)){for(;a++=o?c=!0:10===(r=t.charCodeAt(a++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(a)&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>XF(void 0,void 0,void 0,(function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return YF(r).parse(e,i?VF:Vh)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};KF.props={};const QF=t=>{const{value:e}=t;return()=>e};QF.props={};const JF=t=>{const{fields:e=[]}=t,n=(r=!0,e.map((t=>{if(Array.isArray(t)){const[e,n=r]=t;return[e,n]}return[t,r]})));var r;return t=>[...t].sort(((t,e)=>n.reduce(((n,[r,i=!0])=>0!==n?n:i?t[r]e[r]?-1:+(t[r]!==e[r])),0)))};JF.props={};const tz=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};function ez(t){return null!=t&&!Number.isNaN(t)}tz.props={};const nz=t=>{const{callback:e=ez}=t;return t=>t.filter(e)};nz.props={};const rz=t=>{const{fields:e}=t;return t=>t.map((t=>function(t,e=[]){return e.reduce(((e,n)=>(n in t&&(e[n]=t[n]),e)),{})}(t,e)))};rz.props={};const iz=t=>e=>{if(!t||(n=t,0===Object.keys(n).length))return e;var n;return e.map((e=>Object.entries(e).reduce(((e,[n,r])=>(e[t[n]||n]=r,e)),{})))};iz.props={};const oz=t=>{const{fields:e,key:n="key",value:r="value"}=t;return t=>{return(i=e)&&0!==Object.keys(i).length?t.flatMap((t=>e.map((e=>Object.assign(Object.assign({},t),{[n]:e,[r]:t[e]}))))):t;var i}};oz.props={};const az=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};az.props={};const sz=t=>{const{callback:e=Vh}=t;return t=>e(t)};sz.props={};const cz=t=>{const{callback:e=Vh}=t;return t=>Array.isArray(t)?t.map(e):t};function lz(t){return"string"==typeof t?e=>e[t]:t}cz.props={};const uz=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,c=lz(s),l=lz(a),u=Wh(e,(([t])=>t),(t=>c(t)));return t=>t.map((t=>{const e=u.get(l(t));return Object.assign(Object.assign({},t),r.reduce(((t,n,r)=>(t[i[r]]=e?e[n]:o,t)),{}))}))};uz.props={};var fz=n(86311),hz=n.n(fz);const dz=t=>{const{field:e,groupBy:n,as:r=["y","size"],min:i,max:o,size:a=10,width:s}=t,[c,l]=r;return t=>{const r=Array.from(zh(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=hz().create(t.map((t=>t[e])),{min:i,max:o,size:a,width:s}),r=n.map((t=>t.x)),u=n.map((t=>t.y));return Object.assign(Object.assign({},t[0]),{[c]:r,[l]:u})}))}};dz.props={};const pz=()=>t=>(console.log("G2 data section:",t),t);pz.props={};var yz=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))};const gz=Math.PI/180,vz=2048;function mz(t){return t.text}function bz(){return"serif"}function xz(){return"normal"}function wz(t){return t.value}function Oz(){return 90*~~(2*Math.random())}function kz(){return 1}function _z(){}function Mz(t,e,n,r){if(e.sprite)return;const i=t.context,o=t.ratio;i.clearRect(0,0,2048/o,vz/o);let a=0,s=0,c=0;const l=n.length;for(--r;++r>5<<5,l=~~Math.max(Math.abs(o+a),Math.abs(o-a))}else t=t+31>>5<<5;if(l>c&&(c=l),a+t>=2048&&(a=0,s+=c,c=0),s+l>=vz)break;i.translate((a+(t>>1))/o,(s+(l>>1))/o),e.rotate&&i.rotate(e.rotate*gz),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=t,e.height=l,e.xoff=a,e.yoff=s,e.x1=t>>1,e.y1=l>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,a+=t}const u=i.getImageData(0,0,2048/o,vz/o).data,f=[];for(;--r>=0;){if(!(e=n[r]).hasText)continue;const t=e.width,i=t>>5;let o=e.y1-e.y0;for(let t=0;t>5),r=u[2048*(s+n)+(a+e)<<2]?1<<31-e%32:0;f[t]|=r,c|=r}c?l=n:(e.y0++,o--,n--,s++)}e.y1=e.y0+l,e.sprite=f.slice(0,(e.y1-e.y0)*i)}}function Ez(t,e,n){n>>=5;const r=t.sprite,i=t.width>>5,o=t.x-(i<<4),a=127&o,s=32-a,c=t.y1-t.y0;let l,u=(t.y+t.y0)*n+(o>>5);for(let t=0;t>>a:0))&e[u+n])return!0;u+=n}return!1}function Sz(t,e){const n=t[0],r=t[1];e.x+e.x0r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function Az(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0e[0].y&&t.y+t.y0=a));)if(n.x=i+h,n.y=o+d,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>t[0]||n.y+n.y1>t[1])&&(!r||!Ez(n,e,t[0]))&&(!r||Az(n,r))){const r=n.sprite,i=n.width>>5,o=t[0]>>5,a=n.x-(i<<4),s=127&a,c=32-s,l=n.y1-n.y0;let u,f=(n.y+n.y0)*o+(a>>5);for(let t=0;t>>s:0);f+=o}return delete n.sprite,!0}return!1}return y.start=function(){const[s,v]=t,m=function(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=vz/e;const n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",n.textBaseline="middle",{context:n,ratio:e}}(d()),b=y.board?y.board:Pz((t[0]>>5)*t[1]),x=u.length,w=[],O=u.map((function(t,s,c){return t.text=e.call(this,t,s,c),t.font=n.call(this,t,s,c),t.style=p.call(this,t,s,c),t.weight=i.call(this,t,s,c),t.rotate=o.call(this,t,s,c),t.size=~~r.call(this,t,s,c),t.padding=a.call(this,t,s,c),t})).sort((function(t,e){return e.size-t.size}));let k=-1,_=y.board?[{x:0,y:0},{x:s,y:v}]:void 0;function M(){const e=Date.now();for(;Date.now()-e>1,e.y=v*(c()+.5)>>1,Mz(m,e,O,k),e.hasText&&g(b,e,_)&&(l.call(null,"word",{cloud:y,word:e}),w.push(e),_?y.hasImage||Sz(_,e):_=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=t[0]>>1,e.y-=t[1]>>1)}y._tags=w,y._bounds=_,k>=x&&(y.stop(),l.call(null,"end",{cloud:y,words:w,bounds:_}))}return f&&clearInterval(f),f=setInterval(M,0),M(),y},y.stop=function(){return f&&(clearInterval(f),f=null),y},y.createMask=e=>{const n=document.createElement("canvas"),[r,i]=t;if(!r||!i)return;const o=r>>5,a=Pz((r>>5)*i);n.width=r,n.height=i;const s=n.getContext("2d");s.drawImage(e,0,0,e.width,e.height,0,0,r,i);const c=s.getImageData(0,0,r,i).data;for(let t=0;t>5),i=t*r+e<<2,s=c[i]>=250&&c[i+1]>=250&&c[i+2]>=250?1<<31-e%32:0;a[n]|=s}y.board=a,y.hasImage=!0},y.timeInterval=function(t){h=null==t?1/0:t},y.words=function(t){u=t},y.size=function(e=[]){t=[+e[0],+e[1]]},y.text=function(t){e=Cz(t)},y.font=function(t){n=Cz(t)},y.fontWeight=function(t){i=Cz(t)},y.rotate=function(t){o=Cz(t)},y.canvas=function(t){d=Cz(t)},y.spiral=function(t){s=Rz[t]||t},y.fontSize=function(t){r=Cz(t)},y.padding=function(t){a=Cz(t)},y.random=function(t){c=Cz(t)},y.on=function(t){l=Cz(t)},y}var Nz=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))},Iz=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{if(t instanceof HTMLImageElement)e(t);else{if("string"==typeof t){const r=new Image;return r.crossOrigin="anonymous",r.src=t,r.onload=()=>e(r),void(r.onerror=()=>{console.error(`'image ${t} load failed !!!'`),n()})}n()}}))}const Fz=(t,e)=>n=>Nz(void 0,void 0,void 0,(function*(){const r=Object.assign({},Dz,t,{canvas:e.createCanvas}),i=Lz();var o,a;yield(o=i,a=r,{set(t,e,n){if(void 0===a[t])return this;const r=e?e.call(null,a[t]):a[t];return n?n.call(null,r):"function"==typeof o[t]?o[t](r):o[t]=r,this},setAsync(t,e,n){return yz(this,void 0,void 0,(function*(){if(void 0===a[t])return this;const r=e?yield e.call(null,a[t]):a[t];return n?n.call(null,r):"function"==typeof o[t]?o[t](r):o[t]=r,this}))}}).set("fontSize",(t=>{const e=n.map((t=>t.value));return function(t,e){if("function"==typeof t)return t;if(Array.isArray(t)){const[n,r]=t;if(!e)return()=>(r+n)/2;const[i,o]=e;return o===i?()=>(r+n)/2:({value:t})=>(r-n)/(o-i)*(t-i)+n}return()=>t}(t,[fM(e),cp(e)])})).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").set("canvas").setAsync("imageMask",Bz,i.createMask),i.words([...n]);const s=i.start(),[c,l]=r.size,u=[{x:0,y:0},{x:c,y:l}],{_bounds:f=u,_tags:h,hasImage:d}=s,p=h.map((t=>{var{x:e,y:n,font:r}=t,i=Iz(t,["x","y","font"]);return Object.assign(Object.assign({},i),{x:e+c/2,y:n+l/2,fontFamily:r})})),[{x:y,y:g},{x:v,y:m}]=f,b={text:"",value:0,opacity:0,fontSize:0};return p.push(Object.assign(Object.assign({},b),{x:d?0:y,y:d?0:g}),Object.assign(Object.assign({},b),{x:d?c:v,y:d?l:m})),p}));Fz.props={};const zz=t=>{const{field:e="y",alpha:n=.6,as:r=e}=t;return t=>{const i=t.map((t=>t[e])),o=function(t,e){if(e<0||e>1)throw new Error("alpha must be between 0 and 1.");if(0===t.length)return[];let n=t[0];const r=[];for(const i of t){if(null==i){r.push(i),console.warn("EMA:The value is null or undefined",t);continue}null==n&&(n=i);const o=n*e+(1-e)*i;r.push(o),n=o}return r}(i,n);return t.map(((t,e)=>Object.assign(Object.assign({},t),{[r]:o[e]})))}};zz.props={};function Zz(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function Wz(t,e,n=.01){const[r,i]=t,[o,a]=e;return r>=o[0]-n&&r<=a[0]+n&&i>=o[1]-n&&i<=a[1]+n}const $z=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{rw(t);const e=t.getLocalBounds(),r=n.some((t=>function(t,e){const[n,r]=t,[i,o]=e;return n[0]i[0]&&n[1]i[1]}(Zz(e),Zz(t.getLocalBounds()))));r?nw(t):n.push(t)})),t}};function Gz([t,e],[n,r]){return r>t&&e>n}function Hz(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function qz(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const Yz=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return t=>{const i=t.length;if(i<=1)return t;const[o,a]=Hz(),[s,c]=Hz(),[l,u]=Hz(),[f,h]=Hz();for(const e of t){const{min:t,max:n}=qz(e),[r,i]=t,[o,s]=n;a(e,i),c(e,i),u(e,s-i),h(e,[r,o])}for(let o=0;otx(s(t),s(e))));let e=0;for(let n=0;nt=>(t.forEach((t=>{rw(t);const e=t.attr("bounds"),n=function(t,e,n=.01){const[r,i]=t;return!(Wz(r,e,n)&&Wz(i,e,n))}(Zz(t.getLocalBounds()),e);n&&nw(t)})),t);function Uz(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function Xz(t,e,n){return.2126*Uz(t)+.7152*Uz(e)+.0722*Uz(n)}function Kz(t,e){if(!t||!e||t===e)return 1;const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,c=Xz(n,r,i),l=Xz(o,a,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function Qz(t,e){const n=zb(e,(e=>Kz(t,function(t){return"object"==typeof t?t:_o(t)}(e))));return e[n]}const Jz=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;Kz(t.parsedStyle.fill,r)(t,{canvas:e,layout:n})=>(t.forEach((t=>{rw(t);const{max:e,min:r}=t.getRenderBounds(),[i,o]=e,[a,s]=r,c=((t,e)=>{const[[n,r],[i,o]]=e,[[a,s],[c,l]]=t;let u=0,f=0;return ai&&(u=i-c),so&&(f=o-l),[u,f]})([[a,s],[i,o]],[[n.x,n.y],[n.x+n.width,n.y+n.height]]);t.style.connector&&t.style.connectorPoints&&(t.style.connectorPoints[0][0]-=c[0],t.style.connectorPoints[0][1]-=c[1]),t.style.x+=c[0],t.style.y+=c[1]})),t);var eZ=t=>t;function nZ(t,e){t&&iZ.hasOwnProperty(t.type)&&iZ[t.type](t,e)}var rZ={Feature:function(t,e){nZ(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}var lZ=1e-6,uZ=Math.PI,fZ=uZ/2,hZ=uZ/4,dZ=2*uZ,pZ=180/uZ,yZ=uZ/180,gZ=Math.abs,vZ=Math.atan,mZ=Math.atan2,bZ=Math.cos,xZ=Math.ceil,wZ=Math.exp,OZ=(Math.floor,Math.hypot,Math.log),kZ=Math.pow,_Z=Math.sin,MZ=Math.sign||function(t){return t>0?1:t<0?-1:0},EZ=Math.sqrt,SZ=Math.tan;function AZ(t){return t>1?0:t<-1?uZ:Math.acos(t)}function jZ(t){return t>1?fZ:t<-1?-fZ:Math.asin(t)}function PZ(){}var TZ,CZ,RZ,LZ,NZ=new cZ,IZ=new cZ,DZ={point:PZ,lineStart:PZ,lineEnd:PZ,polygonStart:function(){DZ.lineStart=BZ,DZ.lineEnd=ZZ},polygonEnd:function(){DZ.lineStart=DZ.lineEnd=DZ.point=PZ,NZ.add(gZ(IZ)),IZ=new cZ},result:function(){var t=NZ/2;return NZ=new cZ,t}};function BZ(){DZ.point=FZ}function FZ(t,e){DZ.point=zZ,TZ=RZ=t,CZ=LZ=e}function zZ(t,e){IZ.add(LZ*t-RZ*e),RZ=t,LZ=e}function ZZ(){zZ(TZ,CZ)}var WZ=DZ,$Z=1/0,GZ=$Z,HZ=-$Z,qZ=HZ,YZ={point:function(t,e){t<$Z&&($Z=t);t>HZ&&(HZ=t);eqZ&&(qZ=e)},lineStart:PZ,lineEnd:PZ,polygonStart:PZ,polygonEnd:PZ,result:function(){var t=[[$Z,GZ],[HZ,qZ]];return HZ=qZ=-(GZ=$Z=1/0),t}};var VZ,UZ,XZ,KZ,QZ=YZ,JZ=0,tW=0,eW=0,nW=0,rW=0,iW=0,oW=0,aW=0,sW=0,cW={point:lW,lineStart:uW,lineEnd:dW,polygonStart:function(){cW.lineStart=pW,cW.lineEnd=yW},polygonEnd:function(){cW.point=lW,cW.lineStart=uW,cW.lineEnd=dW},result:function(){var t=sW?[oW/sW,aW/sW]:iW?[nW/iW,rW/iW]:eW?[JZ/eW,tW/eW]:[NaN,NaN];return JZ=tW=eW=nW=rW=iW=oW=aW=sW=0,t}};function lW(t,e){JZ+=t,tW+=e,++eW}function uW(){cW.point=fW}function fW(t,e){cW.point=hW,lW(XZ=t,KZ=e)}function hW(t,e){var n=t-XZ,r=e-KZ,i=EZ(n*n+r*r);nW+=i*(XZ+t)/2,rW+=i*(KZ+e)/2,iW+=i,lW(XZ=t,KZ=e)}function dW(){cW.point=lW}function pW(){cW.point=gW}function yW(){vW(VZ,UZ)}function gW(t,e){cW.point=vW,lW(VZ=XZ=t,UZ=KZ=e)}function vW(t,e){var n=t-XZ,r=e-KZ,i=EZ(n*n+r*r);nW+=i*(XZ+t)/2,rW+=i*(KZ+e)/2,iW+=i,oW+=(i=KZ*t-XZ*e)*(XZ+t),aW+=i*(KZ+e),sW+=3*i,lW(XZ=t,KZ=e)}var mW=cW;function bW(t){this._context=t}bW.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,dZ)}},result:PZ};var xW,wW,OW,kW,_W,MW=new cZ,EW={point:PZ,lineStart:function(){EW.point=SW},lineEnd:function(){xW&&AW(wW,OW),EW.point=PZ},polygonStart:function(){xW=!0},polygonEnd:function(){xW=null},result:function(){var t=+MW;return MW=new cZ,t}};function SW(t,e){EW.point=AW,wW=kW=t,OW=_W=e}function AW(t,e){kW-=t,_W-=e,MW.add(EZ(kW*kW+_W*_W)),kW=t,_W=e}var jW=EW;let PW,TW,CW,RW;class LW{constructor(t){this._append=null==t?NW:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return NW;if(e!==PW){const t=10**e;PW=e,TW=function(e){let n=1;this._+=e[0];for(const r=e.length;n=0))throw new RangeError(`invalid digits: ${t}`);i=e}return null===e&&(r=new LW(i)),a},a.projection(t).digits(i).context(e)}function DW(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++rlZ})).map(c)).concat(DW(xZ(o/d)*d,i,d).filter((function(t){return gZ(t%y)>lZ})).map(l))}return v.lines=function(){return m().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[u(r).concat(f(a).slice(1),u(n).reverse().slice(1),f(s).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),v.precision(g)):[[r,s],[n,a]]},v.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),v.precision(g)):[[e,o],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],y=+t[1],v):[p,y]},v.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],v):[h,d]},v.precision=function(h){return arguments.length?(g=+h,c=BW(o,i,90),l=FW(e,t,g),u=BW(s,a,90),f=FW(r,n,g),v):g},v.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}()()}function ZW(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:PZ,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function WW(t,e){return gZ(t[0]-e[0])=0;--o)i.point((u=l[o])[0],u[1]);else r(h.x,h.p.x,-1,i);h=h.p}l=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function HW(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,E=M*_,S=E>uZ,A=g*O;if(c.add(mZ(A*M*_Z(E),v*k+A*bZ(E))),a+=S?_+M*dZ:_,S^p>=n^x>=n){var j=UW(YW(d),YW(b));QW(j);var P=UW(o,j);QW(P);var T=(S^_>=0?-1:1)*jZ(P[2]);(r>T||r===T&&(j[0]||j[1]))&&(s+=S^_>=0?1:-1)}}return(a<-1e-6||a0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t1&&2&c&&h.push(h.pop().concat(h.shift())),a.push(h.filter(n$))}return h}}function n$(t){return t.length>1}function r$(t,e){return((t=t.x)[0]<0?t[1]-fZ-lZ:fZ-t[1])-((e=e.x)[0]<0?e[1]-fZ-lZ:fZ-e[1])}var i$=e$((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?uZ:-uZ,c=gZ(o-n);gZ(c-uZ)0?fZ:-fZ),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&c>=uZ&&(gZ(n-i)lZ?vZ((_Z(e)*(o=bZ(r))*_Z(n)-_Z(r)*(i=bZ(e))*_Z(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*fZ,r.point(-uZ,i),r.point(0,i),r.point(uZ,i),r.point(uZ,0),r.point(uZ,-i),r.point(0,-i),r.point(-uZ,-i),r.point(-uZ,0),r.point(-uZ,i);else if(gZ(t[0]-e[0])>lZ){var o=t[0]0?io)&&(i+=r*dZ));for(var l,u=i;r>0?u>o:u0,i=gZ(e)>lZ;function o(t,n){return bZ(t)*bZ(n)>e}function a(t,n,r){var i=[1,0,0],o=UW(YW(t),YW(n)),a=VW(o,o),s=o[0],c=a-s*s;if(!c)return!r&&t;var l=e*a/c,u=-e*s/c,f=UW(i,o),h=KW(i,l);XW(h,KW(o,u));var d=f,p=VW(h,d),y=VW(d,d),g=p*p-y*(VW(h,h)-1);if(!(g<0)){var v=EZ(g),m=KW(d,(-p-v)/y);if(XW(m,h),m=qW(m),!r)return m;var b,x=t[0],w=n[0],O=t[1],k=n[1];w0^m[1]<(gZ(m[0]-x)uZ^(x<=m[0]&&m[0]<=w)){var E=KW(d,(-p+v)/y);return XW(E,h),[m,qW(E)]}}}function s(e,n){var i=r?t:uZ-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return e$(o,(function(t){var e,n,c,l,u;return{lineStart:function(){l=c=!1,u=1},point:function(f,h){var d,p=[f,h],y=o(f,h),g=r?y?0:s(f,h):y?s(f+(f<0?uZ:-uZ),h):0;if(!e&&(l=c=y)&&t.lineStart(),y!==c&&(!(d=a(e,p))||WW(e,d)||WW(p,d))&&(p[2]=1),y!==c)u=0,y?(t.lineStart(),d=a(p,e),t.point(d[0],d[1])):(d=a(e,p),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&r^y){var v;g&n||!(v=a(p,e,!0))||(u=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!y||e&&WW(e,p)||t.point(p[0],p[1]),e=p,c=y,n=g},lineEnd:function(){c&&t.lineEnd(),e=null},clean:function(){return u|(l&&c)<<1}}}),(function(e,r,i,o){o$(o,t,n,i,e,r)}),r?[0,-t]:[-uZ,t-uZ])}var c$=1e9,l$=-c$;function u$(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,l){var u=0,f=0;if(null==i||(u=a(i,s))!==(f=a(o,s))||c(i,o)<0^s>0)do{l.point(0===u||3===u?t:n,u>1?r:e)}while((u=(u+s+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return gZ(r[0]-t)0?0:3:gZ(r[0]-n)0?2:1:gZ(r[1]-e)0?1:0:i>0?3:2}function s(t,e){return c(t.x,e.x)}function c(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var c,l,u,f,h,d,p,y,g,v,m,b=a,x=ZW(),w={point:O,lineStart:function(){w.point=k,l&&l.push(u=[]);v=!0,g=!1,p=y=NaN},lineEnd:function(){c&&(k(f,h),d&&g&&x.rejoin(),c.push(x.result()));w.point=O,g&&b.lineEnd()},polygonStart:function(){b=x,c=[],l=[],m=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;nr&&(h-o)*(r-a)>(d-a)*(t-o)&&++e:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--e;return e}(),n=m&&e,i=(c=t$(c)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&GW(c,s,e,o,a),a.polygonEnd());b=a,c=l=u=null}};function O(t,e){i(t,e)&&b.point(t,e)}function k(o,a){var s=i(o,a);if(l&&u.push([o,a]),v)f=o,h=a,d=s,v=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&g)b.point(o,a);else{var c=[p=Math.max(l$,Math.min(c$,p)),y=Math.max(l$,Math.min(c$,y))],x=[o=Math.max(l$,Math.min(c$,o)),a=Math.max(l$,Math.min(c$,a))];!function(t,e,n,r,i,o){var a,s=t[0],c=t[1],l=0,u=1,f=e[0]-s,h=e[1]-c;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>u)return;a>l&&(l=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>u)return;a>l&&(l=a)}else if(f>0){if(a0)){if(a/=h,h<0){if(a0){if(a>u)return;a>l&&(l=a)}if(a=o-c,h||!(a<0)){if(a/=h,h<0){if(a>u)return;a>l&&(l=a)}else if(h>0){if(a0&&(t[0]=s+l*f,t[1]=c+l*h),u<1&&(e[0]=s+u*f,e[1]=c+u*h),!0}}}}}(c,x,t,e,n,r)?s&&(b.lineStart(),b.point(o,a),m=!1):(g||(b.lineStart(),b.point(c[0],c[1])),b.point(x[0],x[1]),s||b.lineEnd(),m=!1)}p=o,y=a,g=s}return w}}function f$(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function h$(t,e){return gZ(t)>uZ&&(t-=Math.round(t/dZ)*dZ),[t,e]}function d$(t,e,n){return(t%=dZ)?e||n?f$(y$(t),g$(e,n)):y$(t):e||n?g$(e,n):h$}function p$(t){return function(e,n){return gZ(e+=t)>uZ&&(e-=Math.round(e/dZ)*dZ),[e,n]}}function y$(t){var e=p$(t);return e.invert=p$(-t),e}function g$(t,e){var n=bZ(t),r=_Z(t),i=bZ(e),o=_Z(e);function a(t,e){var a=bZ(e),s=bZ(t)*a,c=_Z(t)*a,l=_Z(e),u=l*n+s*r;return[mZ(c*i-u*o,s*n-l*r),jZ(u*i+c*o)]}return a.invert=function(t,e){var a=bZ(e),s=bZ(t)*a,c=_Z(t)*a,l=_Z(e),u=l*i-c*o;return[mZ(c*i+l*o,s*n+u*r),jZ(u*n-s*r)]},a}function v$(t){return function(e){var n=new m$;for(var r in t)n[r]=t[r];return n.stream=e,n}}function m$(){}function b$(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),sZ(n,t.stream(QZ)),e(QZ.result()),null!=r&&t.clipExtent(r),t}function x$(t,e,n){return b$(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])}),n)}function w$(t,e,n){return x$(t,[[0,0],e],n)}function O$(t,e,n){return b$(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function k$(t,e,n){return b$(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}h$.invert=h$,m$.prototype={constructor:m$,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var _$=bZ(30*yZ);function M$(t,e){return+e?function(t,e){function n(r,i,o,a,s,c,l,u,f,h,d,p,y,g){var v=l-r,m=u-i,b=v*v+m*m;if(b>4*e&&y--){var x=a+h,w=s+d,O=c+p,k=EZ(x*x+w*w+O*O),_=jZ(O/=k),M=gZ(gZ(O)-1)e||gZ((v*j+m*P)/b-.5)>.3||a*h+s*d+c*p<_$)&&(n(r,i,o,a,s,c,S,A,M,x/=k,w/=k,O,y,g),g.point(S,A),n(S,A,M,x,w,O,l,u,f,h,d,p,y,g))}}return function(e){var r,i,o,a,s,c,l,u,f,h,d,p,y={point:g,lineStart:v,lineEnd:b,polygonStart:function(){e.polygonStart(),y.lineStart=x},polygonEnd:function(){e.polygonEnd(),y.lineStart=v}};function g(n,r){n=t(n,r),e.point(n[0],n[1])}function v(){u=NaN,y.point=m,e.lineStart()}function m(r,i){var o=YW([r,i]),a=t(r,i);n(u,f,l,h,d,p,u=a[0],f=a[1],l=r,h=o[0],d=o[1],p=o[2],16,e),e.point(u,f)}function b(){y.point=g,e.lineEnd()}function x(){v(),y.point=w,y.lineEnd=O}function w(t,e){m(r=t,e),i=u,o=f,a=h,s=d,c=p,y.point=m}function O(){n(u,f,l,h,d,p,i,o,r,a,s,c,16,e),y.lineEnd=b,b()}return y}}(t,e):function(t){return v$({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var E$=v$({point:function(t,e){this.stream.point(t*yZ,e*yZ)}});function S$(t,e,n,r,i,o){if(!o)return function(t,e,n,r,i){function o(o,a){return[e+t*(o*=r),n-t*(a*=i)]}return o.invert=function(o,a){return[(o-e)/t*r,(n-a)/t*i]},o}(t,e,n,r,i);var a=bZ(o),s=_Z(o),c=a*t,l=s*t,u=a/t,f=s/t,h=(s*n-a*e)/t,d=(s*e+a*n)/t;function p(t,o){return[c*(t*=r)-l*(o*=i)+e,n-l*t-c*o]}return p.invert=function(t,e){return[r*(u*t-f*e+h),i*(d-f*t-u*e)]},p}function A$(t){return j$((function(){return t}))()}function j$(t){var e,n,r,i,o,a,s,c,l,u,f=150,h=480,d=250,p=0,y=0,g=0,v=0,m=0,b=0,x=1,w=1,O=null,k=i$,_=null,M=eZ,E=.5;function S(t){return c(t[0]*yZ,t[1]*yZ)}function A(t){return(t=c.invert(t[0],t[1]))&&[t[0]*pZ,t[1]*pZ]}function j(){var t=S$(f,0,0,x,w,b).apply(null,e(p,y)),r=S$(f,h-t[0],d-t[1],x,w,b);return n=d$(g,v,m),s=f$(e,r),c=f$(n,s),a=M$(s,E),P()}function P(){return l=u=null,S}return S.stream=function(t){return l&&u===t?l:l=E$(function(t){return v$({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(k(a(M(u=t)))))},S.preclip=function(t){return arguments.length?(k=t,O=void 0,P()):k},S.postclip=function(t){return arguments.length?(M=t,_=r=i=o=null,P()):M},S.clipAngle=function(t){return arguments.length?(k=+t?s$(O=t*yZ):(O=null,i$),P()):O*pZ},S.clipExtent=function(t){return arguments.length?(M=null==t?(_=r=i=o=null,eZ):u$(_=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),P()):null==_?null:[[_,r],[i,o]]},S.scale=function(t){return arguments.length?(f=+t,j()):f},S.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],j()):[h,d]},S.center=function(t){return arguments.length?(p=t[0]%360*yZ,y=t[1]%360*yZ,j()):[p*pZ,y*pZ]},S.rotate=function(t){return arguments.length?(g=t[0]%360*yZ,v=t[1]%360*yZ,m=t.length>2?t[2]%360*yZ:0,j()):[g*pZ,v*pZ,m*pZ]},S.angle=function(t){return arguments.length?(b=t%360*yZ,j()):b*pZ},S.reflectX=function(t){return arguments.length?(x=t?-1:1,j()):x<0},S.reflectY=function(t){return arguments.length?(w=t?-1:1,j()):w<0},S.precision=function(t){return arguments.length?(a=M$(s,E=t*t),P()):EZ(E)},S.fitExtent=function(t,e){return x$(S,t,e)},S.fitSize=function(t,e){return w$(S,t,e)},S.fitWidth=function(t,e){return O$(S,t,e)},S.fitHeight=function(t,e){return k$(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&A,j()}}function P$(t){var e=0,n=uZ/3,r=j$(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*yZ,n=t[1]*yZ):[e*pZ,n*pZ]},i}function T$(t,e){var n=_Z(t),r=(n+_Z(e))/2;if(gZ(r)=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:a).invert(t)},u.stream=function(n){return t&&e===n?t:(r=[a.stream(e=n),s.stream(n),c.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n2?t[2]*yZ:0),e.invert=function(e){return(e=t.invert(e[0]*yZ,e[1]*yZ))[0]*=pZ,e[1]*=pZ,e},e}(i.rotate()).invert([0,0]));return c(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===Z$?[[Math.max(s[0]-o,l),e],[Math.min(s[0]+o,n),r]]:[[l,Math.max(s[1]-o,e)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(t){return arguments.length?(a(t),u()):a()},i.translate=function(t){return arguments.length?(s(t),u()):s()},i.center=function(t){return arguments.length?(o(t),u()):o()},i.clipExtent=function(t){return arguments.length?(null==t?l=e=n=r=null:(l=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),u()):null==l?null:[[l,e],[n,r]]},u()}function G$(t){return SZ((fZ+t)/2)}function H$(t,e){var n=bZ(t),r=t===e?_Z(t):OZ(n/bZ(e))/OZ(G$(e)/G$(t)),i=n*kZ(G$(t),r)/r;if(!r)return Z$;function o(t,e){i>0?e<-fZ+lZ&&(e=-fZ+lZ):e>fZ-lZ&&(e=fZ-lZ);var n=i/kZ(G$(e),r);return[n*_Z(r*t),i-n*bZ(r*t)]}return o.invert=function(t,e){var n=i-e,o=MZ(r)*EZ(t*t+n*n),a=mZ(t,gZ(n))*MZ(n);return n*r<0&&(a-=uZ*MZ(t)*MZ(n)),[a/r,2*vZ(kZ(i/o,1/r))-fZ]},o}function q$(){return P$(H$).scale(109.5).parallels([30,30])}function Y$(t,e){return[t,e]}function V$(){return A$(Y$).scale(152.63)}function U$(t,e){var n=bZ(t),r=t===e?_Z(t):(n-bZ(e))/(e-t),i=n/r+t;if(gZ(r)2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}nG.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(K$+Q$*i+o*(J$+tG*i))-e)/(K$+3*Q$*i+o*(7*J$+9*tG*i)))*r)*i*i,!(gZ(n)<1e-12));++a);return[eG*t*(K$+3*Q$*i+o*(7*J$+9*tG*i))/bZ(r),jZ(_Z(r)/eG)]},iG.invert=I$(vZ),sG.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(gZ(n)>lZ&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},lG.invert=I$(jZ),fG.invert=I$((function(t){return 2*vZ(t)})),dG.invert=function(t,e){return[-e,2*vZ(wZ(t))-fZ]};var yG=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const t=e.filter(mG),n=t.find((t=>t.sphere));return n?{type:"Sphere"}:(r=t.filter((t=>!t.sphere)).flatMap((t=>t.data.value)),{type:"FeatureCollection",features:r.flatMap((t=>function(t){const e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"};if(!t||!t.type)return null;const n=e[t.type];return n?"geometry"===n?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===n?{type:"FeatureCollection",features:[t]}:"featureCollection"===n?t:void 0:null}(t).features))});var r},{outline:o=i()}=r,{size:a="fitExtent"}=r;return"fitExtent"===a?function(t,e,n){const{x:r,y:i,width:o,height:a}=n;t.fitExtent([[r,i],[o,a]],e)}(t,o,n):"fitWidth"===a?function(t,e,n){const{width:r,height:i}=n,[[o,a],[s,c]]=IW(t.fitWidth(r,e)).bounds(e),l=Math.ceil(c-a),u=Math.min(Math.ceil(s-o),l),f=t.scale()*(u-1)/u,[h,d]=t.translate(),p=d+(i-l)/2;t.scale(f).translate([h,p]).precision(.2)}(t,o,n):void 0}function vG(t){const{data:e}=t;if(Array.isArray(e))return Object.assign(Object.assign({},t),{data:{value:e}});const{type:n}=e;return"graticule10"===n?Object.assign(Object.assign({},t),{data:{value:[zW()]}}):"sphere"===n?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t}function mG(t){return"geoPath"===t.type}const bG=()=>t=>{const{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,i=yG(n,["type"]),o=function(t){if("function"==typeof t)return t;const e=`geo${Bd(t)}`,n=a[e];if(!n)throw new Error(`Unknown coordinate: ${t}`);return n}(r),s=e.map(vG);let c;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinate:{type:function(){return[["custom",(t,e,n,r)=>{const a=o();gG(a,s,{x:t,y:e,width:n,height:r},i),function(t,e){var n;for(const[r,i]of Object.entries(e))null===(n=t[r])||void 0===n||n.call(t,i)}(a,i),c=IW(a);const l=new lv({domain:[t,t+n]}),u=new lv({domain:[e,e+r]});return{transform:t=>(t=>{const e=a(t);if(!e)return[null,null];const[n,r]=e;return[l.map(n),u.map(r)]})(t),untransform:t=>(t=>{if(!t)return null;const[e,n]=t,r=[l.invert(e),u.invert(n)];return a.invert(r)})(t)}}]]}},children:s.flatMap((t=>mG(t)?function(t){const{style:e,tooltip:n={}}=t;return Object.assign(Object.assign({},t),{type:"path",tooltip:mM(n,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},e),{d:t=>c(t)||[]})})}(t):t))})]};bG.props={};var xG=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);it=>{const{type:e,data:n,scale:r,encode:i,style:o,animate:a,key:s,state:c}=t,l=xG(t,["type","data","scale","encode","style","animate","key","state"]);return[Object.assign(Object.assign({type:"geoView"},l),{children:[{type:"geoPath",key:`${s}-0`,data:{value:n},scale:r,encode:i,style:o,animate:a,state:c}]})]};function OG(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,c,l,u,f,h,d=t._root,p={data:r},y=t._x0,g=t._y0,v=t._x1,m=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=e>=(o=(y+v)/2))?y=o:v=o,(u=n>=(a=(g+m)/2))?g=a:m=a,i=d,!(d=d[f=u<<1|l]))return i[f]=p,t;if(s=+t._x.call(null,d.data),c=+t._y.call(null,d.data),e===s&&n===c)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(y+v)/2))?y=o:v=o,(u=n>=(a=(g+m)/2))?g=a:m=a}while((f=u<<1|l)==(h=(c>=a)<<1|s>=o));return i[h]=d,i[f]=p,t}function kG(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function _G(t){return t[0]}function MG(t){return t[1]}function EG(t,e,n){var r=new SG(null==e?_G:e,null==n?MG:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function SG(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function AG(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}wG.props={};var jG=EG.prototype=SG.prototype;function PG(t){return function(){return t}}function TG(t){return 1e-6*(t()-.5)}jG.copy=function(){var t,e,n=new SG(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=AG(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=AG(e));return n},jG.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return OG(this.cover(e,n),e,n,t)},jG.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),c=1/0,l=1/0,u=-1/0,f=-1/0;for(n=0;nu&&(u=r),if&&(f=i));if(c>u||l>f)return this;for(this.cover(c,l).cover(u,f),n=0;nt||t>=i||r>e||e>=o;)switch(s=(eh||(o=c.y0)>d||(a=c.x1)=v)<<1|t>=g)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=c)}else{var m=t-+this._x.call(null,y.data),b=e-+this._y.call(null,y.data),x=m*m+b*b;if(x=(s=(p+g)/2))?p=s:g=s,(u=a>=(c=(y+v)/2))?y=c:v=c,e=d,!(d=d[f=u<<1|l]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},jG.removeAll=function(t){for(var e=0,n=t.length;e=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function IG(t,e){for(var n,r=0,i=t.length;r0)for(var n,r,i=new Array(n),o=0;o=0&&e._call.call(void 0,t),e=e._next;--ZG}()}finally{ZG=0,function(){var t,e,n=BG,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:BG=e);FG=t,eH(r)}(),HG=0}}function tH(){var t=YG.now(),e=t-GG;e>1e3&&(qG-=e,GG=t)}function eH(t){ZG||(WG&&(WG=clearTimeout(WG)),t-HG>24?(t<1/0&&(WG=setTimeout(JG,t-YG.now()-qG)),$G&&($G=clearInterval($G))):($G||(GG=YG.now(),$G=setInterval(tH,1e3)),ZG=1,VG(JG)))}KG.prototype=QG.prototype={constructor:KG,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?UG():+n)+(null==e?0:+e),this._next||FG===this||(FG?FG._next=this:BG=this,FG=this),this._call=t,this._time=n,eH()},stop:function(){this._call&&(this._call=null,this._time=1/0,eH())}};const nH=4294967296;function rH(t){return t.x}function iH(t){return t.y}var oH=Math.PI*(3-Math.sqrt(5));function aH(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,c=QG(f),l=zG("tick","end"),u=function(){let t=1;return()=>(t=(1664525*t+1013904223)%nH)/nH}();function f(){h(),l.call("tick",e),n1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,c,l=0,u=t.length;for(null==r?r=1/0:r*=r,l=0;l1?(l.on(t,n),e):l.on(t)}}}function sH(t){return t.index}function cH(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}var lH=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);it.source.x,t=>t.target.x],y:[t=>t.source.y,t=>t.target.y]},style:{stroke:"#999",strokeOpacity:.6}},hH={type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},style:{stroke:"#fff"}},dH={text:""};function pH(t,e,n){const{nodes:r,links:i}=t,{joint:o,nodeStrength:a,linkStrength:s}=e,{nodeKey:c=(t=>t.id),linkKey:l=(t=>t.id)}=n,u=function(){var t,e,n,r,i,o=PG(-30),a=1,s=1/0,c=.81;function l(n){var i,o=t.length,a=EG(t,rH,iH).visitAfter(f);for(r=n,i=0;i=s)){(t.data!==e||t.next)&&(0===f&&(p+=(f=TG(n))*f),0===h&&(p+=(h=TG(n))*h),p[s(t,e,r),t])));for(a=0,i=new Array(l);a{const{data:e,encode:n={},scale:r,style:i={},layout:o={},nodeLabels:a=[],linkLabels:s=[],animate:c={},tooltip:l={}}=t,{nodeKey:u=(t=>t.id),linkKey:f=(t=>t.id)}=n,h=lH(n,["nodeKey","linkKey"]),d=Object.assign({nodeKey:u,linkKey:f},h),p=ed(d,"node"),y=ed(d,"link"),{links:g,nodes:v}=MA(e,d),{nodesData:m,linksData:b}=pH({links:g,nodes:v},Rh({},uH,o),d),x=vM(l,"link",{items:[t=>({name:"source",value:kA(f)(t.source)}),t=>({name:"target",value:kA(f)(t.target)})]}),w=vM(l,"node",{items:[t=>({name:"key",value:kA(u)(t)})]},!0);return[Rh({},fH,{data:b,encode:y,labels:s,style:ed(i,"link"),tooltip:x,animate:xM(c,"link")}),Rh({},hH,{data:m,encode:Object.assign({},p),scale:r,style:ed(i,"node"),tooltip:w,labels:[Object.assign(Object.assign({},dH),ed(i,"label")),...a],animate:xM(c,"link")})]};function gH(t,e){return t.parent===e.parent?1:2}function vH(t){var e=t.children;return e?e[0]:t.t}function mH(t){var e=t.children;return e?e[e.length-1]:t.t}function bH(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function xH(t,e,n){return t.a.parent===e.parent?t.a:n}function wH(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function OH(){var t=gH,e=1,n=1,r=null;function i(i){var c=function(t){for(var e,n,r,i,o,a=new wH(t,0),s=[a];e=s.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)s.push(n=e.children[i]=new wH(r[i],i)),n.parent=e;return(a.parent=new wH(null,0)).children=[a],a}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)i.eachBefore(s);else{var l=i,u=i,f=i;i.eachBefore((function(t){t.xu.x&&(u=t),t.depth>f.depth&&(f=t)}));var h=l===u?1:t(l,u)/2,d=h-l.x,p=e/(u.x+h+d),y=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*y}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,s=n,c=o.parent.children[0],l=o.m,u=a.m,f=s.m,h=c.m;s=mH(s),o=vH(o),s&&o;)c=vH(c),(a=mH(a)).a=e,(i=s.z+f-o.z-l+t(s._,o._))>0&&(bH(xH(s,e,r),e,i),l+=i,u+=i),f+=s.m,l+=o.m,h+=c.m,u+=a.m;s&&!mH(a)&&(a.t=s,a.m+=f-u),o&&!vH(c)&&(c.t=o,c.m+=l-h,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function kH(t,e){return t.parent===e.parent?1:2}function _H(t,e){return t+e.x}function MH(t,e){return Math.max(t,e.y)}function EH(){var t=kH,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(_H,0)/t.length}(n),e.y=function(t){return 1+t.reduce(MH,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),l=s.x-t(s,c)/2,u=c.x+t(c,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-l)/(u-l)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}yH.props={},wH.prototype=Object.create(dS.prototype);const SH=t=>e=>n=>{const{field:r="value",nodeSize:i,separation:o,sortBy:a,as:s=["x","y"]}=e,[c,l]=s,u=cS(n,(t=>t.children)).sum((t=>t[r])).sort(a),f=t();f.size([1,1]),i&&f.nodeSize(i),o&&f.separation(o),f(u);const h=[];u.each((t=>{t[c]=t.x,t[l]=t.y,t.name=t.data.name,h.push(t)}));const d=u.links();return d.forEach((t=>{t[c]=[t.source[c],t.target[c]],t[l]=[t.source[l],t.target[l]]})),{nodes:h,edges:d}},AH=t=>SH(EH)(t);AH.props={};const jH=t=>SH(OH)(t);jH.props={};const PH={sortBy:(t,e)=>e.value-t.value},TH={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},CH={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},RH={text:"",fontSize:10},LH=t=>{const{data:e,encode:n={},scale:r={},style:i={},layout:o={},nodeLabels:a=[],linkLabels:s=[],animate:c={},tooltip:l={}}=t,u=null==n?void 0:n.value,{nodes:f,edges:h}=jH(Object.assign(Object.assign(Object.assign({},PH),o),{field:u}))(e),d=vM(l,"node",{title:"name",items:["value"]},!0),p=vM(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[Rh({},CH,{data:h,encode:ed(n,"link"),scale:ed(r,"link"),labels:s,style:Object.assign({stroke:"#999"},ed(i,"link")),tooltip:p,animate:xM(c,"link")}),Rh({},TH,{data:f,scale:ed(r,"node"),encode:ed(n,"node"),labels:[Object.assign(Object.assign({},RH),ed(i,"label")),...a],style:Object.assign({},ed(i,"node")),tooltip:d,animate:xM(c,"node")})]};LH.props={};var NH=4294967296;var IH=n(89957);function DH(t,e){for(var n,r,i=0,o=(t=function(t,e){for(var n,r,i=t.length;i;)r=e()*i--|0,n=t[i],t[i]=t[r],t[r]=n;return t}(Array.from(t),e)).length,a=[];i0&&n*n>r*r+i*i}function ZH(t,e){for(var n=0;n1e-6?(S+Math.sqrt(S*S-4*E*A))/(2*E):A/S);return{x:r+O+k*j,y:i+_+M*j,r:j}}function HH(t,e,n){var r,i,o,a,s=t.x-e.x,c=t.y-e.y,l=s*s+c*c;l?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),n.x=t.x-r*s-o*c,n.y=t.y-r*c+o*s):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=e.x+r*s-o*c,n.y=e.y+r*c+o*s)):(n.x=e.x+n.r,n.y=e.y)}function qH(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function YH(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function VH(t){this._=t,this.next=null,this.previous=null}function UH(t,e){if(!(o=(t=function(t){return"object"===IH(t)&&"length"in t?t:Array.from(t)}(t)).length))return 0;var n,r,i,o,a,s,c,l,u,f,h;if((n=t[0]).x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;HH(r,n,i=t[2]),n=new VH(n),r=new VH(r),i=new VH(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(c=3;c2*t.r},rq={title:t=>t.data.name,items:[{field:"value"}]},iq=(t,e)=>{const{width:n,height:r}=e,{data:i,encode:o={},scale:a={},style:s={},layout:c={},labels:l=[],tooltip:u={}}=t,f=eq(t,["data","encode","scale","style","layout","labels","tooltip"]),h=((t,e,n)=>({type:"point",axis:!1,legend:!1,scale:{x:{domain:[0,t]},y:{domain:[0,e]},size:{type:"identity"}},encode:{x:"x",y:"y",size:"r",shape:"point"},style:{fill:n.color?void 0:t=>0===t.height?"#ddd":"#fff",stroke:n.color?void 0:t=>0===t.height?"":"#000"}}))(n,r,o),d=((t,e,n)=>{const{value:r}=n,i=vn(t)?eD().path(e.path)(t):cS(t);return r?i.sum((t=>kA(r)(t))).sort(e.sort):i.count(),KH().size(e.size).padding(e.padding)(i),i.descendants()})(i,Rh({},((t,e)=>({size:[t,e],padding:0,sort:(t,e)=>e.value-t.value}))(n,r),c),Rh({},h.encode,o)),p=ed(s,"label");return Rh({},h,Object.assign(Object.assign({data:d,encode:o,scale:a,style:s,labels:[Object.assign(Object.assign({},nq),p),...l]},f),{tooltip:mM(u,rq),axis:!1}))};function oq(t){return t.target.depth}function aq(t,e){return t.sourceLinks.length?t.depth:e-1}function sq(t){return function(){return t}}function cq(t,e){return uq(t.source,e.source)||t.index-e.index}function lq(t,e){return uq(t.target,e.target)||t.index-e.index}function uq(t,e){return t.y0-e.y0}function fq(t){return t.value}function hq(t){return t.index}function dq(t){return t.nodes}function pq(t){return t.links}function yq(t,e){const n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function gq({nodes:t}){for(const e of t){let t=e.y0,n=t;for(const n of e.sourceLinks)n.y0=t+n.width/2,t+=n.width;for(const t of e.targetLinks)t.y1=n+t.width/2,n+=t.width}}function vq(){let t,e,n,r,i=0,o=0,a=1,s=1,c=24,l=8,u=hq,f=aq,h=dq,d=pq,p=6;function y(y){const m={nodes:h(y),links:d(y)};return function({nodes:t,links:e}){t.forEach(((t,e)=>{t.index=e,t.sourceLinks=[],t.targetLinks=[]}));const n=new Map(t.map((t=>[u(t),t])));if(e.forEach(((t,e)=>{t.index=e;let{source:r,target:i}=t;"object"!=typeof r&&(r=t.source=yq(n,r)),"object"!=typeof i&&(i=t.target=yq(n,i)),r.sourceLinks.push(t),i.targetLinks.push(t)})),null!=r)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(r),n.sort(r)}(m),function({nodes:t}){for(const e of t)e.value=void 0===e.fixedValue?Math.max(sp(e.sourceLinks,fq),sp(e.targetLinks,fq)):e.fixedValue}(m),function({nodes:t}){const n=t.length;let r=new Set(t),i=new Set,o=0;for(;r.size;){if(r.forEach((t=>{t.depth=o;for(const{target:e}of t.sourceLinks)i.add(e)})),++o>n)throw new Error("circular link");r=i,i=new Set}if(e){const n=Math.max(cp(t,(t=>t.depth))+1,0);let r;for(let i=0;i{t.height=i;for(const{source:e}of t.targetLinks)r.add(e)})),++i>e)throw new Error("circular link");n=r,r=new Set}}(m),function(e){const r=function({nodes:t}){const e=Math.max(cp(t,(t=>t.depth))+1,0),r=(a-i-c)/(e-1),o=new Array(e).fill(0).map((()=>[]));for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(f.call(null,n,e))));n.layer=t,n.x0=i+t*r,n.x1=n.x0+c,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const t of o)t.sort(n);return o}(e);t=Math.min(l,(s-o)/(cp(r,(t=>t.length))-1)),function(e){const n=fM(e,(e=>(s-o-(e.length-1)*t)/sp(e,fq)));for(const r of e){let e=o;for(const i of r){i.y0=e,i.y1=e+i.value*n,e=i.y1+t;for(const t of i.sourceLinks)t.width=t.value*n}e=(s-e+t)/(r.length+1);for(let t=0;t0))continue;const i=(n/r-t.y0)*e;t.y0+=i,t.y1+=i,w(t)}void 0===n&&o.sort(uq),o.length&&m(o,r)}}function v(t,e,r){for(let i=t.length-2;i>=0;--i){const o=t[i];for(const t of o){let n=0,r=0;for(const{target:e,value:i}of t.sourceLinks){const o=i*(e.layer-t.layer);n+=_(t,e)*o,r+=o}if(!(r>0))continue;const i=(n/r-t.y0)*e;t.y0+=i,t.y1+=i,w(t)}void 0===n&&o.sort(uq),o.length&&m(o,r)}}function m(e,n){const r=e.length>>1,i=e[r];x(e,i.y0-t,r-1,n),b(e,i.y1+t,r+1,n),x(e,s,e.length-1,n),b(e,o,0,n)}function b(e,n,r,i){for(;r1e-6&&(o.y0+=a,o.y1+=a),n=o.y1+t}}function x(e,n,r,i){for(;r>=0;--r){const o=e[r],a=(o.y1-n)*i;a>1e-6&&(o.y0-=a,o.y1-=a),n=o.y0-t}}function w({sourceLinks:t,targetLinks:e}){if(void 0===r){for(const{source:{sourceLinks:t}}of e)t.sort(lq);for(const{target:{targetLinks:e}}of t)e.sort(cq)}}function O(t){if(void 0===r)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(lq),n.sort(cq)}function k(e,n){let r=e.y0-(e.sourceLinks.length-1)*t/2;for(const{target:i,width:o}of e.sourceLinks){if(i===n)break;r+=o+t}for(const{source:t,width:i}of n.targetLinks){if(t===e)break;r-=i}return r}function _(e,n){let r=n.y0-(n.targetLinks.length-1)*t/2;for(const{source:i,width:o}of n.targetLinks){if(i===e)break;r+=o+t}for(const{target:t,width:i}of e.sourceLinks){if(t===n)break;r-=i}return r}return y.update=function(t){return gq(t),t},y.nodeId=function(t){return arguments.length?(u="function"==typeof t?t:sq(t),y):u},y.nodeAlign=function(t){return arguments.length?(f="function"==typeof t?t:sq(t),y):f},y.nodeDepth=function(t){return arguments.length?(e=t,y):e},y.nodeSort=function(t){return arguments.length?(n=t,y):n},y.nodeWidth=function(t){return arguments.length?(c=+t,y):c},y.nodePadding=function(e){return arguments.length?(l=t=+e,y):l},y.nodes=function(t){return arguments.length?(h="function"==typeof t?t:sq(t),y):h},y.links=function(t){return arguments.length?(d="function"==typeof t?t:sq(t),y):d},y.linkSort=function(t){return arguments.length?(r=t,y):r},y.size=function(t){return arguments.length?(i=o=0,a=+t[0],s=+t[1],y):[a-i,s-o]},y.extent=function(t){return arguments.length?(i=+t[0][0],a=+t[1][0],o=+t[0][1],s=+t[1][1],y):[[i,o],[a,s]]},y.iterations=function(t){return arguments.length?(p=+t,y):p},y}iq.props={};const mq={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},bq={left:function(t){return t.depth},right:function(t,e){return e-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?fM(t.sourceLinks,oq)-1:0},justify:aq};const xq=t=>e=>{const{nodeId:n,nodeSort:r,nodeAlign:i,nodeWidth:o,nodePadding:a,nodeDepth:s,nodes:c,links:l,linkSort:u,iterations:f}=Object.assign({},mq,t),h=vq().nodeSort(r).linkSort(u).links(l).nodes(c).nodeWidth(o).nodePadding(a).nodeDepth(s).nodeAlign(function(t){const e=typeof t;return"string"===e?bq[t]||aq:"function"===e?t:aq}(i)).iterations(f).extent([[0,0],[1,1]]);"function"==typeof n&&h.nodeId(n);const d=h(e),{nodes:p,links:y}=d,g=p.map((t=>{const{x0:e,x1:n,y0:r,y1:i}=t;return Object.assign(Object.assign({},t),{x:[e,n,n,e],y:[r,r,i,i]})})),v=y.map((t=>{const{source:e,target:n}=t,r=e.x1,i=n.x0,o=t.width/2;return Object.assign(Object.assign({},t),{x:[r,r,i,i],y:[t.y0+o,t.y0-o,t.y1+o,t.y1-o]})}));return{nodes:g,links:v}};xq.props={};var wq=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);it.key,nodeWidth:.02,nodePadding:.02},kq={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},_q={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},Mq={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10},Eq=t=>{const{data:e,encode:n={},scale:r,style:i={},layout:o={},nodeLabels:a=[],linkLabels:s=[],animate:c={},tooltip:l={},interaction:u}=t,{links:f,nodes:h}=MA(e,n),d=ed(n,"node"),p=ed(n,"link"),{key:y=(t=>t.key),color:g=y}=d,{links:v,nodes:m}=xq(Object.assign(Object.assign(Object.assign({},Oq),{nodeId:kA(y)}),o))({links:f,nodes:h}),b=ed(i,"label"),{text:x=y,spacing:w=5}=b,O=wq(b,["text","spacing"]),k=kA(y),_=vM(l,"node",{title:k,items:[{field:"value"}]},!0),M=vM(l,"link",{title:"",items:[t=>({name:"source",value:k(t.source)}),t=>({name:"target",value:k(t.target)})]});return[Rh({},kq,{data:m,encode:Object.assign(Object.assign({},d),{color:g}),scale:r,style:ed(i,"node"),labels:[Object.assign(Object.assign(Object.assign({},Mq),{text:x,dx:t=>t.x[0]<.5?w:-w}),O),...a],tooltip:_,animate:xM(c,"node"),axis:!1,interaction:u}),Rh({},_q,{data:v,encode:p,labels:s,style:Object.assign({fill:p.color?void 0:"#aaa",lineWidth:0},ed(i,"link")),tooltip:M,animate:xM(c,"link"),interaction:u})]};function Sq(t,e){return e.value-t.value}function Aq(t,e){return e.frequency-t.frequency}function jq(t,e){return`${t.id}`.localeCompare(`${e.id}`)}function Pq(t,e){return`${t.name}`.localeCompare(`${e.name}`)}Eq.props={};const Tq={y:0,thickness:.05,weight:!1,marginRatio:.1,id:t=>t.id,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null};function Cq(t){const{y:e,thickness:n,weight:r,marginRatio:i,id:o,source:a,target:c,sourceWeight:l,targetWeight:u,sortBy:f}=Object.assign(Object.assign({},Tq),t);return function(t){const h=t.nodes.map((t=>Object.assign({},t))),d=t.edges.map((t=>Object.assign({},t)));return function(t,e){e.forEach((t=>{t.source=a(t),t.target=c(t),t.sourceWeight=l(t),t.targetWeight=u(t)}));const n=zh(e,(t=>t.source)),r=zh(e,(t=>t.target));t.forEach((t=>{t.id=o(t);const e=n.has(t.id)?n.get(t.id):[],i=r.has(t.id)?r.get(t.id):[];t.frequency=e.length+i.length,t.value=sp(e,(t=>t.sourceWeight))+sp(i,(t=>t.targetWeight))}))}(h,d),function(t,e){const n="function"==typeof f?f:s[f];n&&t.sort(n)}(h),function(t,o){const a=t.length;if(!a)throw Kh("Invalid nodes: it's empty!");if(!r){const n=1/a;return t.forEach(((t,r)=>{t.x=(r+.5)*n,t.y=e})),{nodes:t,edges:o}}const s=i/(2*a),c=t.reduce(((t,e)=>t+e.value),0);t.reduce(((t,r)=>{r.weight=r.value/c,r.width=r.weight*(1-i),r.height=n;const o=s+t,a=o+r.width,l=e-n/2,u=l+n;return r.x=[o,a,a,o],r.y=[l,l,u,u],t+r.width+2*s}),0)}(h,d),function(t,n){const i=new Map(t.map((t=>[t.id,t])));if(!r)return n.forEach((t=>{const e=a(t),n=c(t),r=i.get(e),o=i.get(n);r&&o&&(t.x=[r.x,o.x],t.y=[r.y,o.y])})),{nodes:t,edges:n};n.forEach((t=>{t.x=[0,0,0,0],t.y=[e,e,e,e]}));const o=zh(n,(t=>t.source)),s=zh(n,(t=>t.target));t.forEach((t=>{const{edges:e,width:n,x:r,y:i,value:a,id:c}=t,l=o.get(c)||[],u=s.get(c)||[];let f=0;l.map((t=>{const e=t.sourceWeight/a*n;t.x[0]=r[0]+f,t.x[1]=r[0]+f+e,f+=e})),u.forEach((t=>{const e=t.targetWeight/a*n;t.x[3]=r[0]+f,t.x[2]=r[0]+f+e,f+=e}))}))}(h,d),{nodes:h,edges:d}}}const Rq=t=>e=>Cq(t)(e);Rq.props={};var Lq=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);it.key,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null},Iq={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{opacity:1,fillOpacity:1,lineWidth:1}},Dq={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{opacity:.5,lineWidth:1}},Bq={position:"outside",fontSize:10},Fq=(t,e)=>{const{data:n,encode:r={},scale:i,style:o={},layout:a={},nodeLabels:s=[],linkLabels:c=[],animate:l={},tooltip:u={}}=t,{nodes:f,links:h}=MA(n,r),d=ed(r,"node"),p=ed(r,"link"),{key:y=(t=>t.key),color:g=y}=d,{linkEncodeColor:v=(t=>t.source)}=p,{nodeWidthRatio:m=Nq.thickness,nodePaddingRatio:b=Nq.marginRatio}=a,x=Lq(a,["nodeWidthRatio","nodePaddingRatio"]),{nodes:w,edges:O}=Rq(Object.assign(Object.assign(Object.assign(Object.assign({},Nq),{id:kA(y),thickness:m,marginRatio:b}),x),{weight:!0}))({nodes:f,edges:h}),k=ed(o,"label"),{text:_=y}=k,M=Lq(k,["text"]),E=vM(u,"node",{title:"",items:[t=>({name:t.key,value:t.value})]},!0),S=vM(u,"link",{title:"",items:[t=>({name:`${t.source} -> ${t.target}`,value:t.value})]}),{height:A,width:j}=e,P=Math.min(A,j);return[Rh({},Dq,{data:O,encode:Object.assign(Object.assign({},p),{color:v}),labels:c,style:Object.assign({fill:v?void 0:"#aaa"},ed(o,"link")),tooltip:S,animate:xM(l,"link")}),Rh({},Iq,{data:w,encode:Object.assign(Object.assign({},d),{color:g}),scale:i,style:ed(o,"node"),coordinate:{type:"polar",outerRadius:(P-20)/P,startAngle:2*-Math.PI,endAngle:0},labels:[Object.assign(Object.assign(Object.assign({},Bq),{text:_}),M),...s],tooltip:E,animate:xM(l,"node"),axis:!1})]};Fq.props={};var zq=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);iKR(t.path),position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0},Wq={title:t=>{var e,n;return null===(n=null===(e=t.path)||void 0===e?void 0:e.join)||void 0===n?void 0:n.call(e,".")},items:[{field:"value"}]},$q={title:t=>KR(t.path),items:[{field:"value"}]},Gq=(t,e)=>{const{width:n,height:r,options:i}=e,{data:o,encode:a={},scale:s,style:c={},layout:l={},labels:u=[],tooltip:f={}}=t,h=zq(t,["data","encode","scale","style","layout","labels","tooltip"]),d=xy(i,["interaction","treemapDrillDown"]),p=Rh({},((t,e)=>({tile:"treemapSquarify",ratio:.5*(1+Math.sqrt(5)),size:[t,e],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,sort:(t,e)=>e.value-t.value,layer:0}))(n,r),l,{layer:d?t=>1===t.depth:l.layer}),[y,g]=yD(o,p,a),v=ed(c,"label");return Rh({},((t,e)=>({type:"rect",axis:!1,encode:{x:"x",y:"y",key:"id",color:t=>t.path[1]},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]}},style:{stroke:"#fff"},state:{active:{opacity:.6},inactive:{opacity:1}}}))(n,r),Object.assign(Object.assign({data:y,scale:s,style:c,labels:[Object.assign(Object.assign({},Zq),v),...u]},h),{encode:a,tooltip:mM(f,Wq),axis:!1}),d?{interaction:Object.assign(Object.assign({},h.interaction),{treemapDrillDown:d?Object.assign(Object.assign({},d),{originData:g,layout:p}):void 0}),encode:Object.assign({color:t=>KR(t.path)},a),tooltip:mM(f,$q)}:{})};Gq.props={};var Hq=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);ie[t]))}function Yq(t,e){return cp(t,(t=>e[t]))}function Vq(t,e){const n=2.5*Uq(t,e)-1.5*Kq(t,e);return fM(t,(t=>e[t]>=n?e[t]:NaN))}function Uq(t,e){return IB(t,.25,(t=>e[t]))}function Xq(t,e){return IB(t,.5,(t=>e[t]))}function Kq(t,e){return IB(t,.75,(t=>e[t]))}function Qq(t,e){const n=2.5*Kq(t,e)-1.5*Uq(t,e);return cp(t,(t=>e[t]<=n?e[t]:NaN))}function Jq(){return(t,e)=>{const{encode:n}=e,{y:r,x:i}=n,{value:o}=r,{value:a}=i,s=Array.from(zh(t,(t=>a[+t])).values()).flatMap((t=>{const e=Vq(t,o),n=Qq(t,o);return t.filter((t=>o[t]n))}));return[s,e]}}const tY=t=>{const{data:e,encode:n,style:r={},tooltip:i={},transform:o,animate:a}=t,s=Hq(t,["data","encode","style","tooltip","transform","animate"]),{point:c=!0}=r,l=Hq(r,["point"]),{y:u}=n,f={y:u,y1:u,y2:u,y3:u,y4:u},h={y1:Uq,y2:Xq,y3:Kq},d=vM(i,"box",{items:[{channel:"y",name:"min"},{channel:"y1",name:"q1"},{channel:"y2",name:"q2"},{channel:"y3",name:"q3"},{channel:"y4",name:"max"}]},!0),p=vM(i,"point",{title:{channel:"x"},items:[{name:"outlier",channel:"y"}]});if(!c)return Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:qq},h),{y4:Yq})],encode:Object.assign(Object.assign({},n),f),style:l,tooltip:d},s);const y=ed(l,"box"),g=ed(l,"point");return[Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:Vq},h),{y4:Qq})],encode:Object.assign(Object.assign({},n),f),style:y,tooltip:d,animate:xM(a,"box")},s),{type:"point",data:e,transform:[{type:Jq}],encode:n,style:Object.assign({},g),tooltip:p,animate:xM(a,"point")}]};tY.props={};const eY=(t,e)=>Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))/2,nY=(t,e)=>{if(!e)return;const{coordinate:n}=e;if(!(null==n?void 0:n.getCenter))return;const r=n.getCenter();return(n,i,o)=>{const{document:a}=e.canvas,{color:s,index:c}=i,l=a.createElement("g",{}),u=eY(n[0],n[1]),f=2*eY(n[0],r),h=a.createElement("path",{style:Object.assign(Object.assign(Object.assign({d:[["M",...n[0]],["A",u,u,0,1,0,...n[1]],["A",f+2*u,f+2*u,0,0,0,...n[2]],["A",u,u,0,1,0===c?0:1,...n[3]],["A",f,f,0,0,1,...n[0]],["Z"]]},o),hv(t,["shape","last","first"])),{fill:s||o.color})});return l.appendChild(h),l}};var rY=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i{const{shape:n,radius:r}=t,i=rY(t,["shape","radius"]),o=ed(i,"pointer"),a=ed(i,"pin"),{shape:s}=o,c=rY(o,["shape"]),{shape:l}=a,u=rY(a,["shape"]),{coordinate:f,theme:h}=e;return(t,e)=>{const n=t.map((t=>f.invert(t))),[o,a,d]=function(t,e){const{transformations:n}=t.getOptions(),[,...r]=n.find((t=>t[0]===e));return r}(f,"polar"),p=f.clone(),{color:y}=e,g=hp({startAngle:o,endAngle:a,innerRadius:d,outerRadius:r});g.push(["cartesian"]),p.update({transformations:g});const v=n.map((t=>p.map(t))),[m,b]=bb(v),[x,w]=f.getCenter(),O=Object.assign(Object.assign({x1:m,y1:b,x2:x,y2:w,stroke:y},c),i),k=Object.assign(Object.assign({cx:x,cy:w,stroke:y},u),i),_=cd(new al);return ad(s)||("function"==typeof s?_.append((()=>s(v,e,p,h))):_.append("line").call(hb,O).node()),ad(l)||("function"==typeof l?_.append((()=>l(v,e,p,h))):_.append("circle").call(hb,k).node()),_.node()}},lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},aY={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"},tooltip:!1};function sY(t,e){const{name:n="score",target:r,total:i,percent:o,thresholds:a=[]}=function(t){if(De(t)){const e=Math.max(0,Math.min(t,1));return{percent:e,target:e,total:1}}return t}(t),s=o||r,c=o?1:i,l=Object.assign({y:{domain:[0,c]}},e);return a.length?{targetData:[{x:n,y:s,color:"target"}],totalData:a.map(((t,e)=>({x:n,y:e>=1?t-a[e-1]:t,color:e}))),target:s,total:c,scale:l}:{targetData:[{x:n,y:s,color:"target"}],totalData:[{x:n,y:s,color:"target"},{x:n,y:c-s,color:"total"}],target:s,total:c,scale:l}}function cY(t,{target:e,total:n}){const{content:r}=t;return r?r(e,n):e.toString()}const lY=t=>{const{data:e={},scale:n={},style:r={},animate:i={},transform:o=[]}=t,a=rY(t,["data","scale","style","animate","transform"]),{targetData:s,totalData:c,target:l,total:u,scale:f}=sY(e,n),h=ed(r,"text"),{tooltip:d}=h,p=rY(h,["tooltip"]),y=(g=r,v=["pointer","pin"],Object.fromEntries(Object.entries(g).filter((([t])=>v.find((e=>t.startsWith(e)))))));var g,v;const m=ed(r,"arc"),b=m.shape;return[Rh({},iY,Object.assign({type:"interval",transform:[{type:"stackY"}],data:c,scale:f,style:"round"===b?Object.assign(Object.assign({},m),{shape:nY}):m,animate:"object"==typeof i?ed(i,"arc"):i},a)),Rh({},iY,oY,Object.assign({type:"point",data:s,scale:f,style:y,animate:"object"==typeof i?ed(i,"indicator"):i},a)),Rh({},aY,{style:Object.assign({text:cY(p,{target:l,total:u})},p),tooltip:d,animate:"object"==typeof i?ed(i,"text"):i})]};lY.props={};function uY(t,e,n){return t+(e-t)*n}function fY(t,e,n,r){return 0===e?[[t+.5*n/Math.PI/2,r/2],[t+.5*n/Math.PI,r],[t+n/4,r]]:1===e?[[t+.5*n/Math.PI/2*(Math.PI-2),r],[t+.5*n/Math.PI/2*(Math.PI-1),r/2],[t+n/4,0]]:2===e?[[t+.5*n/Math.PI/2,-r/2],[t+.5*n/Math.PI,-r],[t+n/4,-r]]:[[t+.5*n/Math.PI/2*(Math.PI-2),-r],[t+.5*n/Math.PI/2*(Math.PI-1),-r/2],[t+n/4,0]]}function hY(t,e,n,r,i,o,a){const s=4*Math.ceil(2*t/n*4),c=[];let l=r;for(;l<2*-Math.PI;)l+=2*Math.PI;for(;l>0;)l-=2*Math.PI;l=l/Math.PI/2*n;const u=o-t+l-2*t;c.push(["M",u,e]);let f=0;for(let t=0;t{if(!e)return;const{coordinate:n}=e,{liquidOptions:r,styleOptions:i}=t,{liquidShape:o,percent:a}=r,{background:s,outline:c={},wave:l={}}=i,u=pY(i,["background","outline","wave"]),{border:f=2,distance:h=0}=c,d=pY(c,["border","distance"]),{length:p=192,count:y=3}=l;return(t,r,i)=>{const{document:c}=e.canvas,{color:l,fillOpacity:g}=i,v=Object.assign(Object.assign({fill:l},i),u),m=c.createElement("g",{}),[b,x]=n.getCenter(),w=n.getSize(),O=Math.min(...w)/2,k=In(o)?o:((t="circle")=>dY[t]||dY.circle)(o),_=k(b,x,O,...w);if(Object.keys(s).length){const t=c.createElement("path",{style:Object.assign({d:_,fill:"#fff"},s)});m.appendChild(t)}if(a>0){const t=c.createElement("path",{style:{d:_}});m.appendChild(t),m.style.clipPath=t,function(t,e,n,r,i,o,a,s,c,l,u){const{fill:f,fillOpacity:h,opacity:d}=i;for(let i=0;i{const{data:e={},style:n={},animate:r}=t,i=gY(t,["data","style","animate"]),o=Math.max(0,De(e)?e:null==e?void 0:e.percent),a=[{percent:o,type:"liquid"}],s=Object.assign(Object.assign({},ed(n,"text")),ed(n,"content")),c=ed(n,"outline"),l=ed(n,"wave"),u=ed(n,"background");return[Rh({},vY,Object.assign({type:"interval",data:a,style:{liquidOptions:{percent:o,liquidShape:null==n?void 0:n.shape},styleOptions:Object.assign(Object.assign({},n),{outline:c,wave:l,background:u})},animate:r},i)),Rh({},mY,{style:Object.assign({text:`${pp(100*o)} %`},s),animate:r})]};bY.props={};var xY=n(39900);const wY=1e-10;function OY(t,e){const n=function(t){const e=[];for(let n=0;ne[n].radius+wY)return!1;return!0}(e,t)}));let i,o=0,a=0;const s=[];if(r.length>1){const e=function(t){const e={x:0,y:0};for(let n=0;n-1){const i=t[e.parentIndex[r]],o=Math.atan2(e.x-i.x,e.y-i.y),a=Math.atan2(n.x-i.x,n.y-i.y);let s=a-o;s<0&&(s+=2*Math.PI);const u=a-s/2;let f=_Y(c,{x:i.x+i.radius*Math.sin(u),y:i.y+i.radius*Math.cos(u)});f>2*i.radius&&(f=2*i.radius),(null===l||l.width>f)&&(l={circle:i,width:f,p1:e,p2:n})}null!==l&&(s.push(l),o+=kY(l.circle.radius,l.width),n=e)}}else{let e=t[0];for(i=1;iMath.abs(e.radius-t[i].radius)){n=!0;break}n?o=a=0:(o=e.radius*e.radius*Math.PI,s.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-wY,y:e.y+e.radius},width:2*e.radius}))}return a/=2,e&&(e.area=o+a,e.arcArea=o,e.polygonArea=a,e.arcs=s,e.innerPoints=r,e.intersectionPoints=n),o+a}function kY(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function _Y(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function MY(t,e,n){if(n>=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const r=e-(n*n-t*t+e*e)/(2*n);return kY(t,t-(n*n-e*e+t*t)/(2*n))+kY(e,r)}function EY(t,e){const n=_Y(t,e),r=t.radius,i=e.radius;if(n>=r+i||n<=Math.abs(r-i))return[];const o=(r*r-i*i+n*n)/(2*n),a=Math.sqrt(r*r-o*o),s=t.x+o*(e.x-t.x)/n,c=t.y+o*(e.y-t.y)/n,l=-(e.y-t.y)*(a/n),u=-(e.x-t.x)*(a/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}const SY=1e-10;function AY(t,e,n){return Math.min(t,e)*Math.min(t,e)*Math.PI<=n+1e-10?Math.abs(t-e):(0,xY.bisect)((function(r){return MY(t,e,r)-n}),0,t+e)}function jY(t,e){let n=function(t,e){const n=e&&e.lossFunction?e.lossFunction:PY,r={},i={};let o;for(let e=0;e=Math.min(r[a].size,r[s].size)&&(o=0),i[a].push({set:s,size:n.size,weight:o}),i[s].push({set:a,size:n.size,weight:o})}const a=[];for(o in i)if(i.hasOwnProperty(o)){let t=0;for(let e=0;e=8){const i=function(t,e){e=e||{};const n=e.restarts||10,r=[],i={};let o;for(o=0;o=Math.min(e[o].size,e[a].size)?c=1:t.size<=1e-10&&(c=-1),i[o][a]=i[a][o]=c})),{distances:r,constraints:i}}(t,r,i);let s=a.distances;const c=a.constraints,l=(0,xY.norm2)(s.map(xY.norm2))/s.length;s=s.map((function(t){return t.map((function(t){return t/l}))}));const u=function(t,e){return function(t,e,n,r){let i,o=0;for(i=0;i0&&p<=f||h<0&&p>=f||(o+=2*y*y,e[2*i]+=4*y*(a-l),e[2*i+1]+=4*y*(s-u),e[2*c]+=4*y*(l-a),e[2*c+1]+=4*y*(u-s))}}return o}(t,e,s,c)};let f,h;for(o=0;o{const{sets:e="sets",size:n="size",as:r=["key","path"],padding:i=0}=t,[o,a]=r;return t=>{const r=t.map((t=>Object.assign(Object.assign({},t),{sets:t[e],size:t[n],[o]:t.sets.join("&")})));r.sort(((t,e)=>t.sets.length-e.sets.length));const s=function(t,e){(e=e||{}).maxIterations=e.maxIterations||500;const n=e.initialLayout||jY,r=e.lossFunction||PY;t=function(t){t=t.slice();const e=[],n={};let r,i,o,a;for(r=0;rt>e?1:-1)),r=0;r{const n=t[e];return Object.assign(Object.assign({},t),{[a]:({width:t,height:e})=>{c=c||function(t,e,n,r){const i=[],o=[];for(const e in t)t.hasOwnProperty(e)&&(o.push(e),i.push(t[e]));e-=2*r,n-=2*r;const a=TY(i),s=a.xRange,c=a.yRange;if(s.max==s.min||c.max==c.min)return console.log("not scaling solution: zero size detected"),t;const l=e/(s.max-s.min),u=n/(c.max-c.min),f=Math.min(u,l),h=(e-(s.max-s.min)*f)/2,d=(n-(c.max-c.min)*f)/2,p={};for(let t=0;tc[t]));let o=function(t){const e={};OY(t,e);const n=e.arcs;if(0===n.length)return"M 0 0";if(1==n.length){const t=n[0].circle;return function(t,e,n){const r=[],i=t-n,o=e;return r.push("M",i,o),r.push("A",n,n,0,1,0,i+2*n,o),r.push("A",n,n,0,1,0,i,o),r.join(" ")}(t.x,t.y,t.radius)}{const t=["\nM",n[0].p2.x,n[0].p2.y];for(let e=0;ei;t.push("\nA",i,i,0,o?1:0,1,r.p1.x,r.p1.y)}return t.join(" ")}}(r);return/[zZ]$/.test(o)||(o+=" Z"),o}})}))}};CY.props={};var RY=function(){return RY=Object.assign||function(t){for(var e,n=1,r=arguments.length;n{this.forceFit()}),300),this._renderer=r||new Mh,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[_E]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new P,this._context={library:Object.assign(Object.assign({},o),uf),emitter:this._emitter,canvas:n,createCanvas:a},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;const t=new Promise(((t,e)=>vE(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e)))),[e,n,r]=function(){let t,e;return[new Promise(((n,r)=>{e=n,t=r})),e,t]}();return t.then(n).catch(r).then((()=>this._renderTrailing())),e}options(t){if(0===arguments.length)return AE(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const o=[[null,t,jE(t,e,n,r,i)]];for(;o.length;){const[t,e,n]=o.shift();if(e)if(n){TE(e,n);const{children:t}=n,{children:r}=e;if(Array.isArray(t)&&Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i{this.emit(bd)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(md),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(bd)})),n}_create(){const{library:t}=this._context,e=["mark.mark",...Object.keys(t).filter((t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t))];this._marks={};for(const t of e){const e=t.split(".").pop();class n extends YE{constructor(){super({},e)}}this._marks[e]=n,this[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}const n=["composition.view",...Object.keys(t).filter((t=>t.startsWith("composition.")&&"composition.mark"!==t))];this._compositions=Object.fromEntries(n.map((t=>{const e=t.split(".").pop();let n=class extends HE{constructor(){super({},e)}};return n=VE([FE(zE(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))FE(zE(this._compositions))(t);for(const t of n){const e=t.split(".").pop();this[e]=function(){const t=this._compositions[e];return this.type=null,this.append(t)}}}_reset(){const t=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter((([e])=>e.startsWith("margin")||e.startsWith("padding")||e.startsWith("inset")||t.includes(e)))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then((()=>{const t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)})).catch((t=>{const e=this._trailingReject.bind(this);this._trailingReject=null,e(t)})))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(t){return e=>{this._rendering=!1,t(e)}}_computedOptions(){const t=this.options(),{key:e=XE}=t,{width:n,height:r,depth:i}=SE(t,this._container);return this._width=n,this._height=r,this._key=e,Object.assign(Object.assign({key:this._key},t),{width:n,height:r,depth:i})}_createCanvas(){const{width:t,height:e}=SE(this.options(),this._container);this._plugins.push(new Sh),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new Nl({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){var t;null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0;return new Promise(((t,e)=>{this._trailingResolve=t,this._trailingReject=e}))}_bindAutoFit(){const t=this.options(),{autoFit:e}=t;this._hasBindAutoFit?e||this._unbindAutoFit():e&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}},RY(RY({},Object.assign(Object.assign(Object.assign(Object.assign({},{"composition.geoView":bG,"composition.geoPath":wG}),{"data.arc":Rq,"data.cluster":AH,"mark.forceGraph":yH,"mark.tree":LH,"mark.pack":iq,"mark.sankey":Eq,"mark.chord":Fq,"mark.treemap":Gq}),{"data.venn":CY,"mark.boxplot":tY,"mark.gauge":lY,"mark.wordCloud":GT,"mark.liquid":bY}),{"data.fetch":KF,"data.inline":QF,"data.sortBy":JF,"data.sort":tz,"data.filter":nz,"data.pick":rz,"data.rename":iz,"data.fold":oz,"data.slice":az,"data.custom":sz,"data.map":cz,"data.join":uz,"data.kde":dz,"data.log":pz,"data.wordCloud":Fz,"data.ema":zz,"transform.stackY":wB,"transform.binX":eF,"transform.bin":tF,"transform.dodgeX":rF,"transform.jitter":aF,"transform.jitterX":sF,"transform.jitterY":cF,"transform.symmetryY":uF,"transform.diffY":fF,"transform.stackEnter":hF,"transform.normalizeY":pF,"transform.select":bF,"transform.selectX":wF,"transform.selectY":kF,"transform.groupX":EF,"transform.groupY":SF,"transform.groupColor":AF,"transform.group":MF,"transform.sortX":CF,"transform.sortY":RF,"transform.sortColor":LF,"transform.flexX":NF,"transform.pack":DF,"transform.sample":FF,"transform.filter":zF,"coordinate.cartesian":PS,"coordinate.polar":up,"coordinate.transpose":TS,"coordinate.theta":CS,"coordinate.parallel":RS,"coordinate.fisheye":LS,"coordinate.radial":hp,"coordinate.radar":NS,"coordinate.helix":IS,"encode.constant":DS,"encode.field":BS,"encode.transform":FS,"encode.column":zS,"mark.interval":AA,"mark.rect":PA,"mark.line":mj,"mark.point":Vj,"mark.text":iP,"mark.cell":sP,"mark.area":bP,"mark.link":CP,"mark.image":IP,"mark.polygon":WP,"mark.box":VP,"mark.vector":XP,"mark.lineX":eT,"mark.lineY":iT,"mark.connector":lT,"mark.range":dT,"mark.rangeX":gT,"mark.rangeY":bT,"mark.path":MT,"mark.shape":jT,"mark.density":RT,"mark.heatmap":ZT,"mark.wordCloud":GT,"palette.category10":HT,"palette.category20":qT,"scale.linear":YT,"scale.ordinal":JT,"scale.band":aC,"scale.identity":cC,"scale.point":uC,"scale.time":uR,"scale.log":vR,"scale.pow":xR,"scale.sqrt":OR,"scale.threshold":kR,"scale.quantile":_R,"scale.quantize":MR,"scale.sequential":jR,"scale.constant":PR,"theme.classic":LR,"theme.classicDark":DR,"theme.academy":FR,"theme.light":RR,"theme.dark":IR,"component.axisX":zR,"component.axisY":ZR,"component.legendCategory":nL,"component.legendContinuous":qm,"component.legends":rL,"component.title":cL,"component.sliderX":EL,"component.sliderY":SL,"component.scrollbarX":TL,"component.scrollbarY":CL,"animation.scaleInX":RL,"animation.scaleOutX":LL,"animation.scaleInY":NL,"animation.scaleOutY":IL,"animation.waveIn":DL,"animation.fadeIn":BL,"animation.fadeOut":FL,"animation.zoomIn":zL,"animation.zoomOut":ZL,"animation.pathIn":WL,"animation.morphing":eN,"animation.growInX":nN,"animation.growInY":rN,"interaction.elementHighlight":aN,"interaction.elementHighlightByX":sN,"interaction.elementHighlightByColor":cN,"interaction.elementSelect":fN,"interaction.elementSelectByX":hN,"interaction.elementSelectByColor":dN,"interaction.fisheye":yN,"interaction.chartIndex":mN,"interaction.tooltip":VN,"interaction.legendFilter":oI,"interaction.legendHighlight":aI,"interaction.brushHighlight":gI,"interaction.brushXHighlight":mI,"interaction.brushYHighlight":xI,"interaction.brushAxisHighlight":AI,"interaction.brushFilter":TI,"interaction.brushXFilter":CI,"interaction.brushYFilter":RI,"interaction.sliderFilter":BI,"interaction.scrollbarFilter":zI,"interaction.poptip":HI,"interaction.treemapDrillDown":bD,"interaction.elementPointMove":PD,"composition.spaceLayer":CD,"composition.spaceFlex":LD,"composition.facetRect":UD,"composition.repeatMatrix":nB,"composition.facetCircle":lB,"composition.timingKeyframe":fB,"labelTransform.overlapHide":$z,"labelTransform.overlapDodgeY":Yz,"labelTransform.overflowHide":Vz,"labelTransform.contrastReverse":Jz,"labelTransform.exceedAdjust":tZ})),{"interaction.drillDown":jS,"mark.sunburst":MS})),NY=function(){return NY=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0){var r=e.x,i=e.y,o=e.height,a=e.width,s=e.data,h=e.key,d=(0,M.get)(s,c),y=p/2;if(t){var v=r+a/2,b=i;f.push({points:[[v+y,b-u+m],[v+y,b-g-m],[v,b-m],[v-y,b-g-m],[v-y,b-u+m]],center:[v,b-u/2-m],width:u,value:[l,d],key:h})}else{v=r,b=i+o/2;f.push({points:[[r-u+m,b-y],[r-g-m,b-y],[v-m,b],[r-g-m,b+y],[r-u+m,b+y]],center:[v-u/2-m,b],width:u,value:[l,d],key:h})}l=d}})),f},e.prototype.render=function(){this.setDirection(),this.drawConversionTag()},e.prototype.setDirection=function(){var t=this.chart.getCoordinate(),e=(0,M.get)(t,"options.transformations"),n="horizontal";e.forEach((function(t){t.includes("transpose")&&(n="vertical")})),this.direction=n},e.prototype.drawConversionTag=function(){var t=this,e=this.getConversionTagLayout(),n=this.attributes,r=n.style,i=n.text,o=i.style,a=i.formatter;e.forEach((function(e){var n=e.points,i=e.center,s=e.value,c=e.key,l=s[0],u=s[1],f=i[0],h=i[1],d=new UY({style:aV({points:n,fill:"#eee"},r),id:"polygon-".concat(c)}),p=new JY({style:aV({x:f,y:h,text:(0,M.isFunction)(a)?a(l,u):(u/l*100).toFixed(2)+"%"},o),id:"text-".concat(c)});t.appendChild(d),t.appendChild(p)}))},e.prototype.update=function(){var t=this;this.getConversionTagLayout().forEach((function(e){var n=e.points,r=e.center,i=e.key,o=r[0],a=r[1],s=t.getElementById("polygon-".concat(i)),c=t.getElementById("text-".concat(i));s.setAttribute("points",n),c.setAttribute("x",o),c.setAttribute("y",a)}))},e.tag="ConversionTag",e}(iV),cV=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),lV=function(){return lV=Object.assign||function(t){for(var e,n=1,r=arguments.length;n1&&(0,M.set)(e,"children",[{type:"interval"}]);var n=e.scale,r=e.markBackground,i=e.data,o=e.children,a=e.yField,s=(0,M.get)(n,"y.domain",[]);if(r&&s.length&&(0,M.isArray)(i)){var c="domainMax",l=i.map((function(t){var e;return AV(AV({originData:AV({},t)},(0,M.omit)(t,a)),((e={})[c]=s[s.length-1],e))}));o.unshift(AV({type:"interval",data:l,yField:c,tooltip:!1,style:{fill:"#eee"},label:!1},r))}return t}),_V,wV)(t)}var PV=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();ff("shape.interval.bar25D",(function(t,e){return function(n){var r=t.fill,i=void 0===r?"#2888FF":r,o=t.stroke,a=t.fillOpacity,s=void 0===a?1:a,c=t.strokeOpacity,l=void 0===c?.2:c,u=t.pitch,f=void 0===u?8:u,h=n[0],d=n[1],p=n[2],y=n[3],g=(d[1]-h[1])/2,v=e.document,m=v.createElement("g",{}),b=v.createElement("polygon",{style:{points:[h,[h[0]-f,h[1]+g],[p[0]-f,h[1]+g],y],fill:i,fillOpacity:s,stroke:o,strokeOpacity:l,inset:30}}),x=v.createElement("polygon",{style:{points:[[h[0]-f,h[1]+g],d,p,[p[0]-f,h[1]+g]],fill:i,fillOpacity:s,stroke:o,strokeOpacity:l}}),w=v.createElement("polygon",{style:{points:[h,[h[0]-f,h[1]+g],d,[h[0]+f,h[1]+g]],fill:i,fillOpacity:s-.2}});return m.appendChild(b),m.appendChild(x),m.appendChild(w),m}}));var TV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="Bar",e}return PV(e,t),e.getDefaultOptions=function(){return{type:"view",coordinate:{transform:[{type:"transpose"}]},children:[{type:"interval"}],scale:{y:{nice:!0}},axis:{y:{title:!1},x:{title:!1}},interaction:{tooltip:{shared:!0},elementHighlight:{background:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return jV},e}(vV),CV=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();ff("shape.interval.column25D",(function(t,e){return function(n){var r=t.fill,i=void 0===r?"#2888FF":r,o=t.stroke,a=t.fillOpacity,s=void 0===a?1:a,c=t.strokeOpacity,l=void 0===c?.2:c,u=t.pitch,f=void 0===u?8:u,h=(n[1][0]-n[0][0])/2+n[0][0],d=e.document,p=d.createElement("g",{}),y=d.createElement("polygon",{style:{points:[[n[0][0],n[0][1]],[h,n[1][1]+f],[h,n[3][1]+f],[n[3][0],n[3][1]]],fill:i,fillOpacity:s,stroke:o,strokeOpacity:l,inset:30}}),g=d.createElement("polygon",{style:{points:[[h,n[1][1]+f],[n[1][0],n[1][1]],[n[2][0],n[2][1]],[h,n[2][1]+f]],fill:i,fillOpacity:s,stroke:o,strokeOpacity:l}}),v=d.createElement("polygon",{style:{points:[[n[0][0],n[0][1]],[h,n[1][1]-f],[n[1][0],n[1][1]],[h,n[1][1]+f]],fill:i,fillOpacity:s-.2}});return p.appendChild(g),p.appendChild(y),p.appendChild(v),p}}));var RV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="column",e}return CV(e,t),e.getDefaultOptions=function(){return{type:"view",scale:{y:{nice:!0}},interaction:{tooltip:{shared:!0},elementHighlight:{background:!0}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"interval"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return jV},e}(vV);function LV(t){return(0,M.flow)((function(t){var e=t.options,n=e.children,r=void 0===n?[]:n;return e.legend?(r.forEach((function(t){if(!(0,M.get)(t,"colorField")){var e=(0,M.get)(t,"yField");(0,M.set)(t,"colorField",(function(){return e}))}})),t):t}),(function(t){var e=t.options,n=e.annotations,r=void 0===n?[]:n,i=e.children,o=void 0===i?[]:i,a=e.scale,s=!1;return(0,M.get)(a,"y.key")||o.forEach((function(t,e){if(!(0,M.get)(t,"scale.y.key")){var n="child".concat(e,"Scale");(0,M.set)(t,"scale.y.key",n);var i=t.annotations,o=void 0===i?[]:i;o.length>0&&((0,M.set)(t,"scale.y.independent",!1),o.forEach((function(t){(0,M.set)(t,"scale.y.key",n)}))),!s&&r.length>0&&void 0===(0,M.get)(t,"scale.y.independent")&&(s=!0,(0,M.set)(t,"scale.y.independent",!1),r.forEach((function(t){(0,M.set)(t,"scale.y.key",n)})))}})),t}),_V,wV)(t)}var NV=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),IV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="DualAxes",e}return NV(e,t),e.getDefaultOptions=function(){return{type:"view",axis:{y:{title:!1,tick:!1},x:{title:!1}},scale:{y:{independent:!0,nice:!0}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return LV},e}(vV);function DV(t){return(0,M.flow)((function(t){var e=t.options,n=e.xField;return e.colorField||(0,M.set)(e,"colorField",n),t}),(function(t){var e=t.options,n=e.compareField,r=e.transform,i=e.isTransposed,o=void 0===i||i,a=e.coordinate;return r||(n?(0,M.set)(e,"transform",[]):(0,M.set)(e,"transform",[{type:"symmetryY"}])),!a&&o&&(0,M.set)(e,"coordinate",{transform:[{type:"transpose"}]}),t}),(function(t){var e=t.options,n=e.compareField,r=e.seriesField,i=e.data,o=e.children,a=e.yField,s=e.isTransposed,c=void 0===s||s;if(n||r){var l=Object.values((0,M.groupBy)(i,(function(t){return t[n||r]})));o[0].data=l[0],o.push({type:"interval",data:l[1],yField:function(t){return-t[a]}}),delete e.compareField,delete e.data}return r&&((0,M.set)(e,"type","spaceFlex"),(0,M.set)(e,"ratio",[1,1]),(0,M.set)(e,"direction",c?"row":"col"),delete e.seriesField),t}),(function(t){var e=t.options,n=e.tooltip,r=e.xField,i=e.yField;return n||(0,M.set)(e,"tooltip",{title:!1,items:[function(t){return{name:t[r],value:t[i]}}]}),t}),_V,wV)(t)}var BV=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),FV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="column",e}return BV(e,t),e.getDefaultOptions=function(){return{type:"view",scale:{x:{padding:0}},animate:{enter:{type:"fadeIn"}},axis:!1,shapeField:"funnel",label:{position:"inside",transform:[{type:"contrastReverse"}]},children:[{type:"interval"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return DV},e}(vV);function zV(t){return(0,M.flow)(_V,wV)(t)}var ZV=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),WV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="line",e}return ZV(e,t),e.getDefaultOptions=function(){return{type:"view",scale:{y:{nice:!0}},interaction:{tooltip:{shared:!0}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"line"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return zV},e}(vV);function $V(t){switch(typeof t){case"function":return t;case"string":return function(e){return(0,M.get)(e,[t])};default:return function(){return t}}}var GV=function(){return GV=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0){var s=r.reduce((function(t,e){return t+e[n]}),0);if(0===s){var c=r.map((function(t){var e;return GV(GV({},t),((e={})[n]=1,e))}));(0,M.set)(e,"data",c),i&&(0,M.set)(e,"label",GV(GV({},i),{formatter:function(){return 0}})),!1!==o&&((0,M.isFunction)(o)?(0,M.set)(e,"tooltip",(function(t,e,r){var i;return o(GV(GV({},t),((i={})[n]=0,i)),e,r.map((function(t){var e;return GV(GV({},t),((e={})[n]=0,e))})))})):(0,M.set)(e,"tooltip",GV(GV({},o),{items:[function(t,e,n){return{name:a(t,e,n),value:0}}]})))}}return t}),wV)(t)}var qV=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),YV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="pie",e}return qV(e,t),e.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"theta"},transform:[{type:"stackY",reverse:!0}],animate:{enter:{type:"waveIn"}}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return HV},e}(vV);function VV(t){return(0,M.flow)(_V,wV)(t)}var UV=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),XV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="scatter",e}return UV(e,t),e.getDefaultOptions=function(){return{axis:{y:{title:!1},x:{title:!1}},legend:{size:!1},children:[{type:"point"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return VV},e}(vV);function KV(t){return(0,M.flow)((function(t){return(0,M.set)(t,"options.coordinate",{type:(0,M.get)(t,"options.coordinateType","polar")}),t}),wV)(t)}var QV=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),JV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="radar",e}return QV(e,t),e.getDefaultOptions=function(){return{axis:{x:{grid:!0,line:!0},y:{zIndex:1,title:!1,line:!0,nice:!0}},meta:{x:{padding:.5,align:0}},interaction:{tooltip:{style:{crosshairsLineDash:[4,4]}}},children:[{type:"line"}],coordinateType:"polar"}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return KV},e}(vV),tU=function(){return tU=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&(e.x1=t[i],e.x2=e[i],e.y1=t[EU]),e}),[]),s.shift(),o.push({type:"link",xField:["x1","x2"],yField:"y1",zIndex:-1,data:s,style:AU({stroke:"#697474"},a),label:!1,tooltip:!1}),t}),_V,wV)(t)}var TU=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),CU=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="waterfall",e}return TU(e,t),e.getDefaultOptions=function(){return{type:"view",legend:null,tooltip:{field:SU,valueFormatter:"~s",name:"value"},axis:{y:{title:null,labelFormatter:"~s"},x:{title:null}},children:[{type:"interval",interaction:{elementHighlight:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return PU},e}(vV);function RU(t){return(0,M.flow)((function(t){var e=t.options,n=e.data,r=e.binNumber,i=e.binWidth,o=e.children,a=e.channel,s=void 0===a?"count":a,c=(0,M.get)(o,"[0].transform[0]",{});return(0,M.isNumber)(i)?((0,M.assign)(c,{thresholds:(0,M.ceil)((0,M.divide)(n.length,i)),y:s}),t):(0,M.isNumber)(r)?((0,M.assign)(c,{thresholds:r,y:s}),t):t}),_V,wV)(t)}var LU=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),NU=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="Histogram",e}return LU(e,t),e.getDefaultOptions=function(){return{type:"view",autoFit:!0,axis:{y:{title:!1},x:{title:!1}},children:[{type:"rect",transform:[{type:"binX",y:"count"}],interaction:{elementHighlight:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return RU},e}(vV);function IU(t){return(0,M.flow)((function(t){var e=t.options,n=e.tooltip,r=void 0===n?{}:n,i=e.colorField,o=e.sizeField;return r&&!r.field&&(r.field=i||o),t}),(function(t){var e=t.options,n=e.mark,r=e.children;return n&&(r[0].type=n),t}),_V,wV)(t)}var DU=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),BU=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="heatmap",e}return DU(e,t),e.getDefaultOptions=function(){return{type:"view",legend:null,tooltip:{valueFormatter:"~s"},axis:{y:{title:null,grid:!0},x:{title:null,grid:!0}},children:[{type:"point",interaction:{elementHighlight:{background:!0}}}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return IU},e}(vV);function FU(t){return(0,M.flow)((function(t){var e=t.options.boxType,n=void 0===e?"box":e;return t.options.children[0].type=n,t}),_V,wV)(t)}var zU=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ZU=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="box",e}return zU(e,t),e.getDefaultOptions=function(){return{type:"view",children:[{type:"box"}],axis:{y:{title:!1},x:{title:!1}},tooltip:{items:[{name:"min",channel:"y"},{name:"q1",channel:"y1"},{name:"q2",channel:"y2"},{name:"q3",channel:"y3"},{name:"max",channel:"y4"}]}}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return FU},e}(vV);function WU(t){return(0,M.flow)((function(t){var e=t.options,n=e.data,r=[{type:"custom",callback:function(t){return{links:t}}}];if((0,M.isArray)(n))n.length>0?(0,M.set)(e,"data",{value:n,transform:r}):delete e.children;else if("fetch"===(0,M.get)(n,"type")&&(0,M.get)(n,"value")){var i=(0,M.get)(n,"transform");(0,M.isArray)(i)?(0,M.set)(n,"transform",i.concat(r)):(0,M.set)(n,"transform",r)}return t}),_V,wV)(t)}var $U=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),GU=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="sankey",e}return $U(e,t),e.getDefaultOptions=function(){return{type:"view",children:[{type:"sankey"}]}},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return WU},e}(vV);function HU(t){!function(t){var e=t.options.layout,n=void 0===e?"horizontal":e;t.options.coordinate.transform="horizontal"!==n?void 0:[{type:"transpose"}]}(t);var e=t.options.layout,n=void 0===e?"horizontal":e;return t.options.children.forEach((function(t){var e;(null===(e=null==t?void 0:t.coordinate)||void 0===e?void 0:e.transform)&&(t.coordinate.transform="horizontal"!==n?void 0:[{type:"transpose"}])})),t}var qU=function(){return qU=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=t.length?void 0:t)&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||0n=>t(e(n))),t)}function M(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}L=new y(3),y!=Float32Array&&(L[0]=0,L[1]=0,L[2]=0),L=new y(4),y!=Float32Array&&(L[0]=0,L[1]=0,L[2]=0,L[3]=0);const E=Math.sqrt(50),S=Math.sqrt(10),A=Math.sqrt(2);function j(t,e,n){return n=(e=(e-t)/Math.max(0,n))/10**(t=Math.floor(Math.log(e)/Math.LN10)),0<=t?(n>=E?10:n>=S?5:n>=A?2:1)*10**t:-(10**-t)/(n>=E?10:n>=S?5:n>=A?2:1)}const P=(t,e,n=5)=>{let r,i=0,o=(t=[t,e]).length-1,a=t[i],s=t[o];return s{n.prototype.rescale=function(){this.initRange(),this.nice();var[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},n.prototype.initRange=function(){var e=this.options.interpolator;this.options.range=t(e)},n.prototype.composeOutput=function(t,n){var r,{domain:i,interpolator:o,round:a}=this.getOptions(),i=e(i.map(t)),a=a?(r=o,t=>(t=r(t),l(t)?Math.round(t):t)):o;this.output=_(a,i,n,t)},n.prototype.invert=void 0}}var R,L={exports:{}},N={exports:{}},I=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||0<=t.length&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},D=Array.prototype.concat,B=Array.prototype.slice,F=N.exports=function(t){for(var e=[],n=0,r=t.length;nn=>t*(1-n)+e*n,K=(t,e)=>{if("number"==typeof t&&"number"==typeof e)return X(t,e);if("string"!=typeof t||"string"!=typeof e)return()=>t;{var n=t,r=e;const i=U(n),o=U(r);return null===i||null===o?i?()=>n:()=>r:t=>{var e=new Array(4);for(let a=0;a<4;a+=1){var n=i[a],r=o[a];e[a]=n*(1-t)+r*t}var[a,s,c,l]=e;return`rgba(${Math.round(a)}, ${Math.round(s)}, ${Math.round(c)}, ${l})`}}},Q=(t,e)=>{const n=X(t,e);return t=>Math.round(n(t))};function J({map:t,initKey:e},n){return e=e(n),t.has(e)?t.get(e):n}function tt(t){return"object"==typeof t?t.valueOf():t}class et extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=tt,null!==t)for(var[e,n]of t)this.set(e,n)}get(t){return super.get(J({map:this.map,initKey:this.initKey},t))}has(t){return super.has(J({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(([{map:t,initKey:n},r]=[{map:this.map,initKey:this.initKey},t],n=n(r),t.has(n)?t.get(n):(t.set(n,r),r)),e);var n,r}delete(t){return super.delete(([{map:t,initKey:e},n]=[{map:this.map,initKey:this.initKey},t],e=e(n),t.has(e)&&(n=t.get(e),t.delete(e)),n));var e,n}}class nt{constructor(t){this.options=h({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=h({},this.options,t),this.rescale(t)}rescale(t){}}const rt=Symbol("defaultUnknown");function it(t,e,n){for(let r=0;r""+t:"object"==typeof t?t=>JSON.stringify(t):t=>t}class st extends nt{getDefaultOptions(){return{domain:[],range:[],unknown:rt}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&it(this.domainIndexMap,this.getDomain(),this.domainKey),ot({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&it(this.rangeIndexMap,this.getRange(),this.rangeKey),ot({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){var[e]=this.options.domain,[n]=this.options.range;this.domainKey=at(e),this.rangeKey=at(n),this.rangeIndexMap?(t&&!t.range||this.rangeIndexMap.clear(),t&&!t.domain&&!t.compare||(this.domainIndexMap.clear(),this.sortedDomain=void 0)):(this.rangeIndexMap=new Map,this.domainIndexMap=new Map)}clone(){return new st(this.options)}getRange(){return this.options.range}getDomain(){var t,e;return this.sortedDomain||(({domain:t,compare:e}=this.options),this.sortedDomain=e?[...t].sort(e):t),this.sortedDomain}}function ct(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t;var c,l=e.length,u=0<(u=(t=l)-(c=o).length)?[...c,...new Array(u).fill(1)]:u<0?c.slice(0,t):c,[t,c]=n;const f=(y=(c-=t)/(2/l*r+1-1/l*i))*i/l;y-=l*f;const h=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(u),d=y/h.reduce(((t,e)=>t+e));u=new et(e.map(((t,e)=>(e=h[e]*d,[t,a?Math.floor(e):e]))));var p=new et(e.map(((t,e)=>(e=h[e]*d+f,[t,a?Math.floor(e):e])))),y=Array.from(p.values()).reduce(((t,e)=>t+e));t+=(c-(y-y/l*i))*s;let g=a?Math.round(t):t;var v=new Array(l);for(let t=0;tc+e*a)),{valueStep:a,valueBandWidth:s,adjustedRange:t}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=r,this.valueBandWidth=n,this.adjustedRange=t}}const ut=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&0{var[t,r]=t,[e,i]=e;let o,a;return _(a=t{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r);var a=t[0]>t[r],s=a?[...t].reverse():t,c=a?[...e].reverse():e;for(let t=0;t{var n=function(t,e,n,r,i){let o=1,a=r||t.length;for(var s=i||(t=>t);oe?a=c:o=c+1}return o}(t,e,0,r)-1,a=i[n];return _(o[n],a)(e)}},dt=(t,e,n,r)=>(2Math.min(Math.max(r,t),i)}return d}composeOutput(t,e){var{domain:n,range:r,round:i,interpolate:o}=this.options,n=dt(n.map(t),r,o,i);this.output=_(n,e,t)}composeInput(t,e,n){var{domain:r,range:i}=this.options,i=dt(i,r.map(t),X);this.input=_(e,n,i)}}class yt extends pt{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:K,tickMethod:ut,tickCount:5}}chooseTransforms(){return[d,d]}clone(){return new yt(this.options)}}class gt extends lt{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:rt,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new gt(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}function vt(t,e){for(var n=[],r=0,i=t.length;r{var[t,e]=t;return _(X(0,1),M(t,e))}))],wt);let Ot=bt=class extends yt{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:d,tickMethod:ut,tickCount:5}}constructor(t){super(t)}clone(){return new bt(this.options)}};function kt(t,e,r,i,o){var a=new yt({range:[e,e+i]}),s=new yt({range:[r,r+o]});return{transform:function(t){var e=(t=n(t,2))[0];return t=t[1],[a.map(e),s.map(t)]},untransform:function(t){var e=(t=n(t,2))[0];return t=t[1],[a.invert(e),s.invert(t)]}}}function _t(t,e,r,i,o){return(0,n(t,1)[0])(e,r,i,o)}function Mt(t,e,r,i,o){return n(t,1)[0]}function Et(t,e,r,i,o){var a=(t=n(t,4))[0],s=t[1],c=t[2],l=(t=t[3],new yt({range:[c,t]})),u=new yt({range:[a,s]}),f=1<(c=o/i)?1:c,h=1{const[e,n,r]=t,i=_(X(0,.5),M(e,n)),o=_(X(.5,1),M(n,r));return t=>(e>r?t=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},c.to.keyword=function(t){return a[t.slice(0,3)]}},60413:function(t){"use strict";var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),c=n?n+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],s]:t._events[c].push(s):(t._events[c]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i0)throw"Initial bisect points must have opposite signs";if(0===a)return e;if(0===s)return n;for(var l=0;l=0&&(e=u),Math.abs(c)=y[p-1].fx){var A=!1;if(w.fx>S.fx?(s(O,1+h,x,-h,S),O.fx=t(O),O.fx=1)break;for(g=1;gl+a*o*u||f>=y)p=o;else{if(Math.abs(d)<=-c*u)return o;d*(p-h)>=0&&(p=h),h=o,y=f}return 0}o=o||1,a=a||1e-6,c=c||.1;for(var g=0;g<10;++g){if(s(r.x,1,n.x,o,e),f=r.fx=t(r.x,r.fxprime),d=i(r.fxprime,e),f>l+a*o*u||g&&f>=h)return y(p,o,h);if(Math.abs(d)<=-c*u)return o;if(d>=0)return y(o,p,f);h=f,p=o,o*=2}return o}function u(t,e,n){var r,c,u,f={x:e.slice(),fx:0,fxprime:e.slice()},h={x:e.slice(),fx:0,fxprime:e.slice()},d=e.slice(),p=1;u=(n=n||{}).maxIterations||20*e.length,f.fx=t(f.x,f.fxprime),a(r=f.fxprime.slice(),f.fxprime,-1);for(var y=0;y=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},39378:function(t,e,n){var r;t=n.nmd(t),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",c=16,l=32,u=64,f=128,h=256,d=1/0,p=9007199254740991,y=NaN,g=4294967295,v=[["ary",f],["bind",1],["bindKey",2],["curry",8],["curryRight",c],["flip",512],["partial",l],["partialRight",u],["rearg",h]],m="[object Arguments]",b="[object Array]",x="[object Boolean]",w="[object Date]",O="[object Error]",k="[object Function]",_="[object GeneratorFunction]",M="[object Map]",E="[object Number]",S="[object Object]",A="[object Promise]",j="[object RegExp]",P="[object Set]",T="[object String]",C="[object Symbol]",R="[object WeakMap]",L="[object ArrayBuffer]",N="[object DataView]",I="[object Float32Array]",D="[object Float64Array]",B="[object Int8Array]",F="[object Int16Array]",z="[object Int32Array]",Z="[object Uint8Array]",W="[object Uint8ClampedArray]",$="[object Uint16Array]",G="[object Uint32Array]",H=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,Y=/(__e\(.*?\)|\b__t\)) \+\n'';/g,V=/&(?:amp|lt|gt|quot|#39);/g,U=/[&<>"']/g,X=RegExp(V.source),K=RegExp(U.source),Q=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,tt=/<%=([\s\S]+?)%>/g,et=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nt=/^\w*$/,rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,it=/[\\^$.*+?()[\]{}|]/g,ot=RegExp(it.source),at=/^\s+/,st=/\s/,ct=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,lt=/\{\n\/\* \[wrapped with (.+)\] \*/,ut=/,? & /,ft=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ht=/[()=,{}\[\]\/\s]/,dt=/\\(\\)?/g,pt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yt=/\w*$/,gt=/^[-+]0x[0-9a-f]+$/i,vt=/^0b[01]+$/i,mt=/^\[object .+?Constructor\]$/,bt=/^0o[0-7]+$/i,xt=/^(?:0|[1-9]\d*)$/,wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ot=/($^)/,kt=/['\n\r\u2028\u2029\\]/g,_t="\\ud800-\\udfff",Mt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Et="\\u2700-\\u27bf",St="a-z\\xdf-\\xf6\\xf8-\\xff",At="A-Z\\xc0-\\xd6\\xd8-\\xde",jt="\\ufe0e\\ufe0f",Pt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Tt="['’]",Ct="["+_t+"]",Rt="["+Pt+"]",Lt="["+Mt+"]",Nt="\\d+",It="["+Et+"]",Dt="["+St+"]",Bt="[^"+_t+Pt+Nt+Et+St+At+"]",Ft="\\ud83c[\\udffb-\\udfff]",zt="[^"+_t+"]",Zt="(?:\\ud83c[\\udde6-\\uddff]){2}",Wt="[\\ud800-\\udbff][\\udc00-\\udfff]",$t="["+At+"]",Gt="\\u200d",Ht="(?:"+Dt+"|"+Bt+")",qt="(?:"+$t+"|"+Bt+")",Yt="(?:['’](?:d|ll|m|re|s|t|ve))?",Vt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ut="(?:"+Lt+"|"+Ft+")"+"?",Xt="["+jt+"]?",Kt=Xt+Ut+("(?:"+Gt+"(?:"+[zt,Zt,Wt].join("|")+")"+Xt+Ut+")*"),Qt="(?:"+[It,Zt,Wt].join("|")+")"+Kt,Jt="(?:"+[zt+Lt+"?",Lt,Zt,Wt,Ct].join("|")+")",te=RegExp(Tt,"g"),ee=RegExp(Lt,"g"),ne=RegExp(Ft+"(?="+Ft+")|"+Jt+Kt,"g"),re=RegExp([$t+"?"+Dt+"+"+Yt+"(?="+[Rt,$t,"$"].join("|")+")",qt+"+"+Vt+"(?="+[Rt,$t+Ht,"$"].join("|")+")",$t+"?"+Ht+"+"+Yt,$t+"+"+Vt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Nt,Qt].join("|"),"g"),ie=RegExp("["+Gt+_t+Mt+jt+"]"),oe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ae=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],se=-1,ce={};ce[I]=ce[D]=ce[B]=ce[F]=ce[z]=ce[Z]=ce[W]=ce[$]=ce[G]=!0,ce[m]=ce[b]=ce[L]=ce[x]=ce[N]=ce[w]=ce[O]=ce[k]=ce[M]=ce[E]=ce[S]=ce[j]=ce[P]=ce[T]=ce[R]=!1;var le={};le[m]=le[b]=le[L]=le[N]=le[x]=le[w]=le[I]=le[D]=le[B]=le[F]=le[z]=le[M]=le[E]=le[S]=le[j]=le[P]=le[T]=le[C]=le[Z]=le[W]=le[$]=le[G]=!0,le[O]=le[k]=le[R]=!1;var ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},fe=parseFloat,he=parseInt,de="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,pe="object"==typeof self&&self&&self.Object===Object&&self,ye=de||pe||Function("return this")(),ge=e&&!e.nodeType&&e,ve=ge&&t&&!t.nodeType&&t,me=ve&&ve.exports===ge,be=me&&de.process,xe=function(){try{var t=ve&&ve.require&&ve.require("util").types;return t||be&&be.binding&&be.binding("util")}catch(t){}}(),we=xe&&xe.isArrayBuffer,Oe=xe&&xe.isDate,ke=xe&&xe.isMap,_e=xe&&xe.isRegExp,Me=xe&&xe.isSet,Ee=xe&&xe.isTypedArray;function Se(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ae(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i-1}function Le(t,e,n){for(var r=-1,i=null==t?0:t.length;++r-1;);return n}function rn(t,e){for(var n=t.length;n--&&$e(e,t[n],0)>-1;);return n}function on(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var an=Ve({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),sn=Ve({"&":"&","<":"<",">":">",'"':""","'":"'"});function cn(t){return"\\"+ue[t]}function ln(t){return ie.test(t)}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function fn(t,e){return function(n){return t(e(n))}}function hn(t,e){for(var n=-1,r=t.length,i=0,o=[];++n",""":'"',"'":"'"});var bn=function t(e){var n,r=(e=null==e?ye:bn.defaults(ye.Object(),e,bn.pick(ye,ae))).Array,st=e.Date,_t=e.Error,Mt=e.Function,Et=e.Math,St=e.Object,At=e.RegExp,jt=e.String,Pt=e.TypeError,Tt=r.prototype,Ct=Mt.prototype,Rt=St.prototype,Lt=e["__core-js_shared__"],Nt=Ct.toString,It=Rt.hasOwnProperty,Dt=0,Bt=(n=/[^.]+$/.exec(Lt&&Lt.keys&&Lt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ft=Rt.toString,zt=Nt.call(St),Zt=ye._,Wt=At("^"+Nt.call(It).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$t=me?e.Buffer:i,Gt=e.Symbol,Ht=e.Uint8Array,qt=$t?$t.allocUnsafe:i,Yt=fn(St.getPrototypeOf,St),Vt=St.create,Ut=Rt.propertyIsEnumerable,Xt=Tt.splice,Kt=Gt?Gt.isConcatSpreadable:i,Qt=Gt?Gt.iterator:i,Jt=Gt?Gt.toStringTag:i,ne=function(){try{var t=po(St,"defineProperty");return t({},"",{}),t}catch(t){}}(),ie=e.clearTimeout!==ye.clearTimeout&&e.clearTimeout,ue=st&&st.now!==ye.Date.now&&st.now,de=e.setTimeout!==ye.setTimeout&&e.setTimeout,pe=Et.ceil,ge=Et.floor,ve=St.getOwnPropertySymbols,be=$t?$t.isBuffer:i,xe=e.isFinite,ze=Tt.join,Ve=fn(St.keys,St),xn=Et.max,wn=Et.min,On=st.now,kn=e.parseInt,_n=Et.random,Mn=Tt.reverse,En=po(e,"DataView"),Sn=po(e,"Map"),An=po(e,"Promise"),jn=po(e,"Set"),Pn=po(e,"WeakMap"),Tn=po(St,"create"),Cn=Pn&&new Pn,Rn={},Ln=Zo(En),Nn=Zo(Sn),In=Zo(An),Dn=Zo(jn),Bn=Zo(Pn),Fn=Gt?Gt.prototype:i,zn=Fn?Fn.valueOf:i,Zn=Fn?Fn.toString:i;function Wn(t){if(is(t)&&!Ya(t)&&!(t instanceof qn)){if(t instanceof Hn)return t;if(It.call(t,"__wrapped__"))return Wo(t)}return new Hn(t)}var $n=function(){function t(){}return function(e){if(!rs(e))return{};if(Vt)return Vt(e);t.prototype=e;var n=new t;return t.prototype=i,n}}();function Gn(){}function Hn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=i}function qn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Yn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function ur(t,e,n,r,o,a){var s,c=1&e,l=2&e,u=4&e;if(n&&(s=o?n(t,r,o,a):n(t)),s!==i)return s;if(!rs(t))return t;var f=Ya(t);if(f){if(s=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&It.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!c)return Ti(t,s)}else{var h=vo(t),d=h==k||h==_;if(Ka(t))return Mi(t,c);if(h==S||h==m||d&&!o){if(s=l||d?{}:bo(t),!c)return l?function(t,e){return Ci(t,go(t),e)}(t,function(t,e){return t&&Ci(e,Ns(e),t)}(s,t)):function(t,e){return Ci(t,yo(t),e)}(t,ar(s,t))}else{if(!le[h])return o?t:{};s=function(t,e,n){var r=t.constructor;switch(e){case L:return Ei(t);case x:case w:return new r(+t);case N:return function(t,e){var n=e?Ei(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case I:case D:case B:case F:case z:case Z:case W:case $:case G:return Si(t,n);case M:return new r;case E:case T:return new r(t);case j:return function(t){var e=new t.constructor(t.source,yt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case P:return new r;case C:return i=t,zn?St(zn.call(i)):{}}var i}(t,h,c)}}a||(a=new Kn);var p=a.get(t);if(p)return p;a.set(t,s),ls(t)?t.forEach((function(r){s.add(ur(r,e,n,r,t,a))})):os(t)&&t.forEach((function(r,i){s.set(i,ur(r,e,n,i,t,a))}));var y=f?i:(u?l?ao:oo:l?Ns:Ls)(t);return je(y||t,(function(r,i){y&&(r=t[i=r]),rr(s,i,ur(r,e,n,i,t,a))})),s}function fr(t,e,n){var r=n.length;if(null==t)return!r;for(t=St(t);r--;){var o=n[r],a=e[o],s=t[o];if(s===i&&!(o in t)||!a(s))return!1}return!0}function hr(t,e,n){if("function"!=typeof t)throw new Pt(o);return Lo((function(){t.apply(i,n)}),e)}function dr(t,e,n,r){var i=-1,o=Re,a=!0,s=t.length,c=[],l=e.length;if(!s)return c;n&&(e=Ne(e,Je(n))),r?(o=Le,a=!1):e.length>=200&&(o=en,a=!1,e=new Xn(e));t:for(;++i-1},Vn.prototype.set=function(t,e){var n=this.__data__,r=ir(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Un.prototype.clear=function(){this.size=0,this.__data__={hash:new Yn,map:new(Sn||Vn),string:new Yn}},Un.prototype.delete=function(t){var e=fo(this,t).delete(t);return this.size-=e?1:0,e},Un.prototype.get=function(t){return fo(this,t).get(t)},Un.prototype.has=function(t){return fo(this,t).has(t)},Un.prototype.set=function(t,e){var n=fo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Xn.prototype.add=Xn.prototype.push=function(t){return this.__data__.set(t,a),this},Xn.prototype.has=function(t){return this.__data__.has(t)},Kn.prototype.clear=function(){this.__data__=new Vn,this.size=0},Kn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Kn.prototype.get=function(t){return this.__data__.get(t)},Kn.prototype.has=function(t){return this.__data__.has(t)},Kn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Vn){var r=n.__data__;if(!Sn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Un(r)}return n.set(t,e),this.size=n.size,this};var pr=Ni(Or),yr=Ni(kr,!0);function gr(t,e){var n=!0;return pr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function vr(t,e,n){for(var r=-1,o=t.length;++r0&&n(s)?e>1?br(s,e-1,n,r,i):Ie(i,s):r||(i[i.length]=s)}return i}var xr=Ii(),wr=Ii(!0);function Or(t,e){return t&&xr(t,e,Ls)}function kr(t,e){return t&&wr(t,e,Ls)}function _r(t,e){return Ce(e,(function(e){return ts(t[e])}))}function Mr(t,e){for(var n=0,r=(e=wi(e,t)).length;null!=t&&ne}function jr(t,e){return null!=t&&It.call(t,e)}function Pr(t,e){return null!=t&&e in St(t)}function Tr(t,e,n){for(var o=n?Le:Re,a=t[0].length,s=t.length,c=s,l=r(s),u=1/0,f=[];c--;){var h=t[c];c&&e&&(h=Ne(h,Je(e))),u=wn(h.length,u),l[c]=!n&&(e||a>=120&&h.length>=120)?new Xn(c&&h):i}h=t[0];var d=-1,p=l[0];t:for(;++d=s?c:c*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function Yr(t,e,n){for(var r=-1,i=e.length,o={};++r-1;)s!==t&&Xt.call(s,c,1),Xt.call(t,c,1);return t}function Ur(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;wo(i)?Xt.call(t,i,1):di(t,i)}}return t}function Xr(t,e){return t+ge(_n()*(e-t+1))}function Kr(t,e){var n="";if(!t||e<1||e>p)return n;do{e%2&&(n+=t),(e=ge(e/2))&&(t+=t)}while(e);return n}function Qr(t,e){return No(jo(t,e,ac),t+"")}function Jr(t){return Jn($s(t))}function ti(t,e){var n=$s(t);return Bo(n,lr(e,0,n.length))}function ei(t,e,n,r){if(!rs(t))return t;for(var o=-1,a=(e=wi(e,t)).length,s=a-1,c=t;null!=c&&++oo?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=r(o);++i>>1,a=t[o];null!==a&&!fs(a)&&(n?a<=e:a=200){var l=e?null:Ki(t);if(l)return dn(l);a=!1,i=en,c=new Xn}else c=e?[]:s;t:for(;++r=r?t:oi(t,e,n)}var _i=ie||function(t){return ye.clearTimeout(t)};function Mi(t,e){if(e)return t.slice();var n=t.length,r=qt?qt(n):new t.constructor(n);return t.copy(r),r}function Ei(t){var e=new t.constructor(t.byteLength);return new Ht(e).set(new Ht(t)),e}function Si(t,e){var n=e?Ei(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ai(t,e){if(t!==e){var n=t!==i,r=null===t,o=t==t,a=fs(t),s=e!==i,c=null===e,l=e==e,u=fs(e);if(!c&&!u&&!a&&t>e||a&&s&&l&&!c&&!u||r&&s&&l||!n&&l||!o)return 1;if(!r&&!a&&!u&&t1?n[o-1]:i,s=o>2?n[2]:i;for(a=t.length>3&&"function"==typeof a?(o--,a):i,s&&Oo(n[0],n[1],s)&&(a=o<3?i:a,o=1),e=St(e);++r-1?o[a?e[s]:s]:i}}function Zi(t){return io((function(e){var n=e.length,r=n,a=Hn.prototype.thru;for(t&&e.reverse();r--;){var s=e[r];if("function"!=typeof s)throw new Pt(o);if(a&&!c&&"wrapper"==co(s))var c=new Hn([],!0)}for(r=c?r:n;++r1&&b.reverse(),d&&uc))return!1;var u=a.get(t),f=a.get(e);if(u&&f)return u==e&&f==t;var h=-1,d=!0,p=2&n?new Xn:i;for(a.set(t,e),a.set(e,t);++h-1&&t%1==0&&t1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ct,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return je(v,(function(n){var r="_."+n[0];e&n[1]&&!Re(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(lt);return e?e[1].split(ut):[]}(r),n)))}function Do(t){var e=0,n=0;return function(){var r=On(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(i,arguments)}}function Bo(t,e){var n=-1,r=t.length,o=r-1;for(e=e===i?r:e;++n1?t[e-1]:i;return n="function"==typeof n?(t.pop(),n):i,ca(t,n)}));function ya(t){var e=Wn(t);return e.__chain__=!0,e}function ga(t,e){return e(t)}var va=io((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return cr(e,t)};return!(e>1||this.__actions__.length)&&r instanceof qn&&wo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:ga,args:[o],thisArg:i}),new Hn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(i),t}))):this.thru(o)}));var ma=Ri((function(t,e,n){It.call(t,n)?++t[n]:sr(t,n,1)}));var ba=zi(qo),xa=zi(Yo);function wa(t,e){return(Ya(t)?je:pr)(t,uo(e,3))}function Oa(t,e){return(Ya(t)?Pe:yr)(t,uo(e,3))}var ka=Ri((function(t,e,n){It.call(t,n)?t[n].push(e):sr(t,n,[e])}));var _a=Qr((function(t,e,n){var i=-1,o="function"==typeof e,a=Ua(t)?r(t.length):[];return pr(t,(function(t){a[++i]=o?Se(e,t,n):Cr(t,e,n)})),a})),Ma=Ri((function(t,e,n){sr(t,n,e)}));function Ea(t,e){return(Ya(t)?Ne:Zr)(t,uo(e,3))}var Sa=Ri((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var Aa=Qr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Oo(t,e[0],e[1])?e=[]:n>2&&Oo(e[0],e[1],e[2])&&(e=[e[0]]),qr(t,br(e,1),[])})),ja=ue||function(){return ye.Date.now()};function Pa(t,e,n){return e=n?i:e,e=t&&null==e?t.length:e,Ji(t,f,i,i,i,i,e)}function Ta(t,e){var n;if("function"!=typeof e)throw new Pt(o);return t=vs(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=i),n}}var Ca=Qr((function(t,e,n){var r=1;if(n.length){var i=hn(n,lo(Ca));r|=l}return Ji(t,r,e,n,i)})),Ra=Qr((function(t,e,n){var r=3;if(n.length){var i=hn(n,lo(Ra));r|=l}return Ji(e,r,t,n,i)}));function La(t,e,n){var r,a,s,c,l,u,f=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new Pt(o);function y(e){var n=r,o=a;return r=a=i,f=e,c=t.apply(o,n)}function g(t){return f=t,l=Lo(m,e),h?y(t):c}function v(t){var n=t-u;return u===i||n>=e||n<0||d&&t-f>=s}function m(){var t=ja();if(v(t))return b(t);l=Lo(m,function(t){var n=e-(t-u);return d?wn(n,s-(t-f)):n}(t))}function b(t){return l=i,p&&r?y(t):(r=a=i,c)}function x(){var t=ja(),n=v(t);if(r=arguments,a=this,u=t,n){if(l===i)return g(u);if(d)return _i(l),l=Lo(m,e),y(u)}return l===i&&(l=Lo(m,e)),c}return e=bs(e)||0,rs(n)&&(h=!!n.leading,s=(d="maxWait"in n)?xn(bs(n.maxWait)||0,e):s,p="trailing"in n?!!n.trailing:p),x.cancel=function(){l!==i&&_i(l),f=0,r=u=a=l=i},x.flush=function(){return l===i?c:b(ja())},x}var Na=Qr((function(t,e){return hr(t,1,e)})),Ia=Qr((function(t,e,n){return hr(t,bs(e)||0,n)}));function Da(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new Pt(o);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Da.Cache||Un),n}function Ba(t){if("function"!=typeof t)throw new Pt(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Da.Cache=Un;var Fa=Oi((function(t,e){var n=(e=1==e.length&&Ya(e[0])?Ne(e[0],Je(uo())):Ne(br(e,1),Je(uo()))).length;return Qr((function(r){for(var i=-1,o=wn(r.length,n);++i=e})),qa=Rr(function(){return arguments}())?Rr:function(t){return is(t)&&It.call(t,"callee")&&!Ut.call(t,"callee")},Ya=r.isArray,Va=we?Je(we):function(t){return is(t)&&Sr(t)==L};function Ua(t){return null!=t&&ns(t.length)&&!ts(t)}function Xa(t){return is(t)&&Ua(t)}var Ka=be||bc,Qa=Oe?Je(Oe):function(t){return is(t)&&Sr(t)==w};function Ja(t){if(!is(t))return!1;var e=Sr(t);return e==O||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ss(t)}function ts(t){if(!rs(t))return!1;var e=Sr(t);return e==k||e==_||"[object AsyncFunction]"==e||"[object Proxy]"==e}function es(t){return"number"==typeof t&&t==vs(t)}function ns(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=p}function rs(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function is(t){return null!=t&&"object"==typeof t}var os=ke?Je(ke):function(t){return is(t)&&vo(t)==M};function as(t){return"number"==typeof t||is(t)&&Sr(t)==E}function ss(t){if(!is(t)||Sr(t)!=S)return!1;var e=Yt(t);if(null===e)return!0;var n=It.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Nt.call(n)==zt}var cs=_e?Je(_e):function(t){return is(t)&&Sr(t)==j};var ls=Me?Je(Me):function(t){return is(t)&&vo(t)==P};function us(t){return"string"==typeof t||!Ya(t)&&is(t)&&Sr(t)==T}function fs(t){return"symbol"==typeof t||is(t)&&Sr(t)==C}var hs=Ee?Je(Ee):function(t){return is(t)&&ns(t.length)&&!!ce[Sr(t)]};var ds=Vi(zr),ps=Vi((function(t,e){return t<=e}));function ys(t){if(!t)return[];if(Ua(t))return us(t)?gn(t):Ti(t);if(Qt&&t[Qt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Qt]());var e=vo(t);return(e==M?un:e==P?dn:$s)(t)}function gs(t){return t?(t=bs(t))===d||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function vs(t){var e=gs(t),n=e%1;return e==e?n?e-n:e:0}function ms(t){return t?lr(vs(t),0,g):0}function bs(t){if("number"==typeof t)return t;if(fs(t))return y;if(rs(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=rs(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Qe(t);var n=vt.test(t);return n||bt.test(t)?he(t.slice(2),n?2:8):gt.test(t)?y:+t}function xs(t){return Ci(t,Ns(t))}function ws(t){return null==t?"":fi(t)}var Os=Li((function(t,e){if(Eo(e)||Ua(e))Ci(e,Ls(e),t);else for(var n in e)It.call(e,n)&&rr(t,n,e[n])})),ks=Li((function(t,e){Ci(e,Ns(e),t)})),_s=Li((function(t,e,n,r){Ci(e,Ns(e),t,r)})),Ms=Li((function(t,e,n,r){Ci(e,Ls(e),t,r)})),Es=io(cr);var Ss=Qr((function(t,e){t=St(t);var n=-1,r=e.length,o=r>2?e[2]:i;for(o&&Oo(e[0],e[1],o)&&(r=1);++n1),e})),Ci(t,ao(t),n),r&&(n=ur(n,7,no));for(var i=e.length;i--;)di(n,e[i]);return n}));var Fs=io((function(t,e){return null==t?{}:function(t,e){return Yr(t,e,(function(e,n){return Ps(t,n)}))}(t,e)}));function zs(t,e){if(null==t)return{};var n=Ne(ao(t),(function(t){return[t]}));return e=uo(e),Yr(t,n,(function(t,n){return e(t,n[0])}))}var Zs=Qi(Ls),Ws=Qi(Ns);function $s(t){return null==t?[]:tn(t,Ls(t))}var Gs=Bi((function(t,e,n){return e=e.toLowerCase(),t+(n?Hs(e):e)}));function Hs(t){return Js(ws(t).toLowerCase())}function qs(t){return(t=ws(t))&&t.replace(wt,an).replace(ee,"")}var Ys=Bi((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Vs=Bi((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Us=Di("toLowerCase");var Xs=Bi((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Ks=Bi((function(t,e,n){return t+(n?" ":"")+Js(e)}));var Qs=Bi((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Js=Di("toUpperCase");function tc(t,e,n){return t=ws(t),(e=n?i:e)===i?function(t){return oe.test(t)}(t)?function(t){return t.match(re)||[]}(t):function(t){return t.match(ft)||[]}(t):t.match(e)||[]}var ec=Qr((function(t,e){try{return Se(t,i,e)}catch(t){return Ja(t)?t:new _t(t)}})),nc=io((function(t,e){return je(e,(function(e){e=zo(e),sr(t,e,Ca(t[e],t))})),t}));function rc(t){return function(){return t}}var ic=Zi(),oc=Zi(!0);function ac(t){return t}function sc(t){return Dr("function"==typeof t?t:ur(t,1))}var cc=Qr((function(t,e){return function(n){return Cr(n,t,e)}})),lc=Qr((function(t,e){return function(n){return Cr(t,n,e)}}));function uc(t,e,n){var r=Ls(e),i=_r(e,r);null!=n||rs(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=_r(e,Ls(e)));var o=!(rs(n)&&"chain"in n&&!n.chain),a=ts(t);return je(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=Ti(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Ie([this.value()],arguments))})})),t}function fc(){}var hc=Hi(Ne),dc=Hi(Te),pc=Hi(Fe);function yc(t){return ko(t)?Ye(zo(t)):function(t){return function(e){return Mr(e,t)}}(t)}var gc=Yi(),vc=Yi(!0);function mc(){return[]}function bc(){return!1}var xc=Gi((function(t,e){return t+e}),0),wc=Xi("ceil"),Oc=Gi((function(t,e){return t/e}),1),kc=Xi("floor");var _c,Mc=Gi((function(t,e){return t*e}),1),Ec=Xi("round"),Sc=Gi((function(t,e){return t-e}),0);return Wn.after=function(t,e){if("function"!=typeof e)throw new Pt(o);return t=vs(t),function(){if(--t<1)return e.apply(this,arguments)}},Wn.ary=Pa,Wn.assign=Os,Wn.assignIn=ks,Wn.assignInWith=_s,Wn.assignWith=Ms,Wn.at=Es,Wn.before=Ta,Wn.bind=Ca,Wn.bindAll=nc,Wn.bindKey=Ra,Wn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ya(t)?t:[t]},Wn.chain=ya,Wn.chunk=function(t,e,n){e=(n?Oo(t,e,n):e===i)?1:xn(vs(e),0);var o=null==t?0:t.length;if(!o||e<1)return[];for(var a=0,s=0,c=r(pe(o/e));ao?0:o+n),(r=r===i||r>o?o:vs(r))<0&&(r+=o),r=n>r?0:ms(r);n>>0)?(t=ws(t))&&("string"==typeof e||null!=e&&!cs(e))&&!(e=fi(e))&&ln(t)?ki(gn(t),0,n):t.split(e,n):[]},Wn.spread=function(t,e){if("function"!=typeof t)throw new Pt(o);return e=null==e?0:xn(vs(e),0),Qr((function(n){var r=n[e],i=ki(n,0,e);return r&&Ie(i,r),Se(t,this,i)}))},Wn.tail=function(t){var e=null==t?0:t.length;return e?oi(t,1,e):[]},Wn.take=function(t,e,n){return t&&t.length?oi(t,0,(e=n||e===i?1:vs(e))<0?0:e):[]},Wn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?oi(t,(e=r-(e=n||e===i?1:vs(e)))<0?0:e,r):[]},Wn.takeRightWhile=function(t,e){return t&&t.length?yi(t,uo(e,3),!1,!0):[]},Wn.takeWhile=function(t,e){return t&&t.length?yi(t,uo(e,3)):[]},Wn.tap=function(t,e){return e(t),t},Wn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new Pt(o);return rs(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),La(t,e,{leading:r,maxWait:e,trailing:i})},Wn.thru=ga,Wn.toArray=ys,Wn.toPairs=Zs,Wn.toPairsIn=Ws,Wn.toPath=function(t){return Ya(t)?Ne(t,zo):fs(t)?[t]:Ti(Fo(ws(t)))},Wn.toPlainObject=xs,Wn.transform=function(t,e,n){var r=Ya(t),i=r||Ka(t)||hs(t);if(e=uo(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:rs(t)&&ts(o)?$n(Yt(t)):{}}return(i?je:Or)(t,(function(t,r,i){return e(n,t,r,i)})),n},Wn.unary=function(t){return Pa(t,1)},Wn.union=ia,Wn.unionBy=oa,Wn.unionWith=aa,Wn.uniq=function(t){return t&&t.length?hi(t):[]},Wn.uniqBy=function(t,e){return t&&t.length?hi(t,uo(e,2)):[]},Wn.uniqWith=function(t,e){return e="function"==typeof e?e:i,t&&t.length?hi(t,i,e):[]},Wn.unset=function(t,e){return null==t||di(t,e)},Wn.unzip=sa,Wn.unzipWith=ca,Wn.update=function(t,e,n){return null==t?t:pi(t,e,xi(n))},Wn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:i,null==t?t:pi(t,e,xi(n),r)},Wn.values=$s,Wn.valuesIn=function(t){return null==t?[]:tn(t,Ns(t))},Wn.without=la,Wn.words=tc,Wn.wrap=function(t,e){return za(xi(e),t)},Wn.xor=ua,Wn.xorBy=fa,Wn.xorWith=ha,Wn.zip=da,Wn.zipObject=function(t,e){return mi(t||[],e||[],rr)},Wn.zipObjectDeep=function(t,e){return mi(t||[],e||[],ei)},Wn.zipWith=pa,Wn.entries=Zs,Wn.entriesIn=Ws,Wn.extend=ks,Wn.extendWith=_s,uc(Wn,Wn),Wn.add=xc,Wn.attempt=ec,Wn.camelCase=Gs,Wn.capitalize=Hs,Wn.ceil=wc,Wn.clamp=function(t,e,n){return n===i&&(n=e,e=i),n!==i&&(n=(n=bs(n))==n?n:0),e!==i&&(e=(e=bs(e))==e?e:0),lr(bs(t),e,n)},Wn.clone=function(t){return ur(t,4)},Wn.cloneDeep=function(t){return ur(t,5)},Wn.cloneDeepWith=function(t,e){return ur(t,5,e="function"==typeof e?e:i)},Wn.cloneWith=function(t,e){return ur(t,4,e="function"==typeof e?e:i)},Wn.conformsTo=function(t,e){return null==e||fr(t,e,Ls(e))},Wn.deburr=qs,Wn.defaultTo=function(t,e){return null==t||t!=t?e:t},Wn.divide=Oc,Wn.endsWith=function(t,e,n){t=ws(t),e=fi(e);var r=t.length,o=n=n===i?r:lr(vs(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},Wn.eq=$a,Wn.escape=function(t){return(t=ws(t))&&K.test(t)?t.replace(U,sn):t},Wn.escapeRegExp=function(t){return(t=ws(t))&&ot.test(t)?t.replace(it,"\\$&"):t},Wn.every=function(t,e,n){var r=Ya(t)?Te:gr;return n&&Oo(t,e,n)&&(e=i),r(t,uo(e,3))},Wn.find=ba,Wn.findIndex=qo,Wn.findKey=function(t,e){return Ze(t,uo(e,3),Or)},Wn.findLast=xa,Wn.findLastIndex=Yo,Wn.findLastKey=function(t,e){return Ze(t,uo(e,3),kr)},Wn.floor=kc,Wn.forEach=wa,Wn.forEachRight=Oa,Wn.forIn=function(t,e){return null==t?t:xr(t,uo(e,3),Ns)},Wn.forInRight=function(t,e){return null==t?t:wr(t,uo(e,3),Ns)},Wn.forOwn=function(t,e){return t&&Or(t,uo(e,3))},Wn.forOwnRight=function(t,e){return t&&kr(t,uo(e,3))},Wn.get=js,Wn.gt=Ga,Wn.gte=Ha,Wn.has=function(t,e){return null!=t&&mo(t,e,jr)},Wn.hasIn=Ps,Wn.head=Uo,Wn.identity=ac,Wn.includes=function(t,e,n,r){t=Ua(t)?t:$s(t),n=n&&!r?vs(n):0;var i=t.length;return n<0&&(n=xn(i+n,0)),us(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&$e(t,e,n)>-1},Wn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:vs(n);return i<0&&(i=xn(r+i,0)),$e(t,e,i)},Wn.inRange=function(t,e,n){return e=gs(e),n===i?(n=e,e=0):n=gs(n),function(t,e,n){return t>=wn(e,n)&&t=-9007199254740991&&t<=p},Wn.isSet=ls,Wn.isString=us,Wn.isSymbol=fs,Wn.isTypedArray=hs,Wn.isUndefined=function(t){return t===i},Wn.isWeakMap=function(t){return is(t)&&vo(t)==R},Wn.isWeakSet=function(t){return is(t)&&"[object WeakSet]"==Sr(t)},Wn.join=function(t,e){return null==t?"":ze.call(t,e)},Wn.kebabCase=Ys,Wn.last=Jo,Wn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=vs(n))<0?xn(r+o,0):wn(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):We(t,He,o,!0)},Wn.lowerCase=Vs,Wn.lowerFirst=Us,Wn.lt=ds,Wn.lte=ps,Wn.max=function(t){return t&&t.length?vr(t,ac,Ar):i},Wn.maxBy=function(t,e){return t&&t.length?vr(t,uo(e,2),Ar):i},Wn.mean=function(t){return qe(t,ac)},Wn.meanBy=function(t,e){return qe(t,uo(e,2))},Wn.min=function(t){return t&&t.length?vr(t,ac,zr):i},Wn.minBy=function(t,e){return t&&t.length?vr(t,uo(e,2),zr):i},Wn.stubArray=mc,Wn.stubFalse=bc,Wn.stubObject=function(){return{}},Wn.stubString=function(){return""},Wn.stubTrue=function(){return!0},Wn.multiply=Mc,Wn.nth=function(t,e){return t&&t.length?Hr(t,vs(e)):i},Wn.noConflict=function(){return ye._===this&&(ye._=Zt),this},Wn.noop=fc,Wn.now=ja,Wn.pad=function(t,e,n){t=ws(t);var r=(e=vs(e))?yn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return qi(ge(i),n)+t+qi(pe(i),n)},Wn.padEnd=function(t,e,n){t=ws(t);var r=(e=vs(e))?yn(t):0;return e&&re){var r=t;t=e,e=r}if(n||t%1||e%1){var o=_n();return wn(t+o*(e-t+fe("1e-"+((o+"").length-1))),e)}return Xr(t,e)},Wn.reduce=function(t,e,n){var r=Ya(t)?De:Ue,i=arguments.length<3;return r(t,uo(e,4),n,i,pr)},Wn.reduceRight=function(t,e,n){var r=Ya(t)?Be:Ue,i=arguments.length<3;return r(t,uo(e,4),n,i,yr)},Wn.repeat=function(t,e,n){return e=(n?Oo(t,e,n):e===i)?1:vs(e),Kr(ws(t),e)},Wn.replace=function(){var t=arguments,e=ws(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Wn.result=function(t,e,n){var r=-1,o=(e=wi(e,t)).length;for(o||(o=1,t=i);++rp)return[];var n=g,r=wn(t,g);e=uo(e),t-=g;for(var i=Ke(r,e);++n=a)return t;var c=n-yn(r);if(c<1)return r;var l=s?ki(s,0,c).join(""):t.slice(0,c);if(o===i)return l+r;if(s&&(c+=l.length-c),cs(o)){if(t.slice(c).search(o)){var u,f=l;for(o.global||(o=At(o.source,ws(yt.exec(o))+"g")),o.lastIndex=0;u=o.exec(f);)var h=u.index;l=l.slice(0,h===i?c:h)}}else if(t.indexOf(fi(o),c)!=c){var d=l.lastIndexOf(o);d>-1&&(l=l.slice(0,d))}return l+r},Wn.unescape=function(t){return(t=ws(t))&&X.test(t)?t.replace(V,mn):t},Wn.uniqueId=function(t){var e=++Dt;return ws(t)+e},Wn.upperCase=Qs,Wn.upperFirst=Js,Wn.each=wa,Wn.eachRight=Oa,Wn.first=Uo,uc(Wn,(_c={},Or(Wn,(function(t,e){It.call(Wn.prototype,e)||(_c[e]=t)})),_c),{chain:!1}),Wn.VERSION="4.17.21",je(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Wn[t].placeholder=Wn})),je(["drop","take"],(function(t,e){qn.prototype[t]=function(n){n=n===i?1:xn(vs(n),0);var r=this.__filtered__&&!e?new qn(this):this.clone();return r.__filtered__?r.__takeCount__=wn(n,r.__takeCount__):r.__views__.push({size:wn(n,g),type:t+(r.__dir__<0?"Right":"")}),r},qn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),je(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;qn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:uo(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),je(["head","last"],(function(t,e){var n="take"+(e?"Right":"");qn.prototype[t]=function(){return this[n](1).value()[0]}})),je(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");qn.prototype[t]=function(){return this.__filtered__?new qn(this):this[n](1)}})),qn.prototype.compact=function(){return this.filter(ac)},qn.prototype.find=function(t){return this.filter(t).head()},qn.prototype.findLast=function(t){return this.reverse().find(t)},qn.prototype.invokeMap=Qr((function(t,e){return"function"==typeof t?new qn(this):this.map((function(n){return Cr(n,t,e)}))})),qn.prototype.reject=function(t){return this.filter(Ba(uo(t)))},qn.prototype.slice=function(t,e){t=vs(t);var n=this;return n.__filtered__&&(t>0||e<0)?new qn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==i&&(n=(e=vs(e))<0?n.dropRight(-e):n.take(e-t)),n)},qn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},qn.prototype.toArray=function(){return this.take(g)},Or(qn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Wn[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);o&&(Wn.prototype[e]=function(){var e=this.__wrapped__,s=r?[1]:arguments,c=e instanceof qn,l=s[0],u=c||Ya(e),f=function(t){var e=o.apply(Wn,Ie([t],s));return r&&h?e[0]:e};u&&n&&"function"==typeof l&&1!=l.length&&(c=u=!1);var h=this.__chain__,d=!!this.__actions__.length,p=a&&!h,y=c&&!d;if(!a&&u){e=y?e:new qn(this);var g=t.apply(e,s);return g.__actions__.push({func:ga,args:[f],thisArg:i}),new Hn(g,h)}return p&&y?t.apply(this,s):(g=this.thru(f),p?r?g.value()[0]:g.value():g)})})),je(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Tt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Wn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Ya(i)?i:[],t)}return this[n]((function(n){return e.apply(Ya(n)?n:[],t)}))}})),Or(qn.prototype,(function(t,e){var n=Wn[e];if(n){var r=n.name+"";It.call(Rn,r)||(Rn[r]=[]),Rn[r].push({name:e,func:n})}})),Rn[Wi(i,2).name]=[{name:"wrapper",func:i}],qn.prototype.clone=function(){var t=new qn(this.__wrapped__);return t.__actions__=Ti(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ti(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ti(this.__views__),t},qn.prototype.reverse=function(){if(this.__filtered__){var t=new qn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},qn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Ya(t),r=e<0,i=n?t.length:0,o=function(t,e,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Wn.prototype.plant=function(t){for(var e,n=this;n instanceof Gn;){var r=Wo(n);r.__index__=0,r.__values__=i,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},Wn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof qn){var e=t;return this.__actions__.length&&(e=new qn(this)),(e=e.reverse()).__actions__.push({func:ga,args:[ra],thisArg:i}),new Hn(e,this.__chain__)}return this.thru(ra)},Wn.prototype.toJSON=Wn.prototype.valueOf=Wn.prototype.value=function(){return gi(this.__wrapped__,this.__actions__)},Wn.prototype.first=Wn.prototype.head,Qt&&(Wn.prototype[Qt]=function(){return this}),Wn}();ye._=bn,(r=function(){return bn}.call(e,n,e,t))===i||(t.exports=r)}.call(this)},60635:function(t){"use strict";var e=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n=f.length)){var n=Math.max(e-r,0),i=e,a=Math.min(e+r,f.length-1),s=n-(e-r),l=e+r-a,h=d[-r-1+s]||0,v=d[-r-1+l]||0,m=p/(p-h-v);s>0&&(g+=m*(s-1)*y);var b=Math.max(0,e-r+1);o.inside(0,f.length-1,b)&&(f[b].y+=1*m*y),o.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*m*y),o.inside(0,f.length-1,a+1)&&(f[a+1].y+=1*m*y)}}));var v=g,m=0,b=0;return f.forEach((function(t){m+=t.y,v+=m,t.y=v,b+=v})),b>0&&f.forEach((function(t){t.y/=b})),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){e+=t.x*t.y})),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){var n=Math.log(t.y);isFinite(n)&&(e+=t.y*n)})),e=-e/r,Math.pow(2,e)}}},29187:function(t,e,n){"use strict";var r=n(32086),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n