gf-components 0.1.49 → 0.1.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -439,7 +439,7 @@ html body {
439
439
  font: var(--gf-label-lg-default);
440
440
  color: var(--gf-color-text-secondary);
441
441
  margin-bottom: 1em;
442
- `,xL=({id:e,text:t,columns:n,textalign:r="left",style:i,className:a,editable:o})=>k.jsxs(k.Fragment,{children:[k.jsx(On,{}),k.jsx(bL,{id:e,columns:n,textalign:r,style:i||{},className:a||"",contentEditable:o,suppressContentEditableWarning:o,children:t==null?void 0:t.map(s=>k.jsx(yL,{dangerouslySetInnerHTML:{__html:s}}))})]}),SL=({metricsData:e})=>k.jsx(Lo,{gap:10,wrap:!0,children:e==null?void 0:e.map(t=>k.jsx(b$,{percent:t.percent,description:t.description,cost:t.cost,editable:t.editable}))});var CL=typeof Kl=="object"&&Kl&&Kl.Object===Object&&Kl,C$=CL,wL=C$,$L=typeof self=="object"&&self&&self.Object===Object&&self,_L=wL||$L||Function("return this")(),ei=_L,EL=ei,OL=EL.Symbol,Do=OL,ky=Do,w$=Object.prototype,ML=w$.hasOwnProperty,TL=w$.toString,ss=ky?ky.toStringTag:void 0;function RL(e){var t=ML.call(e,ss),n=e[ss];try{e[ss]=void 0;var r=!0}catch{}var i=TL.call(e);return r&&(t?e[ss]=n:delete e[ss]),i}var PL=RL,IL=Object.prototype,AL=IL.toString;function NL(e){return AL.call(e)}var jL=NL,Dy=Do,LL=PL,kL=jL,DL="[object Null]",FL="[object Undefined]",Fy=Dy?Dy.toStringTag:void 0;function zL(e){return e==null?e===void 0?FL:DL:Fy&&Fy in Object(e)?LL(e):kL(e)}var yi=zL;function BL(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ti=BL,VL=yi,WL=ti,HL="[object AsyncFunction]",UL="[object Function]",GL="[object GeneratorFunction]",qL="[object Proxy]";function KL(e){if(!WL(e))return!1;var t=VL(e);return t==UL||t==GL||t==HL||t==qL}var id=KL;const Um=rn(id);var YL=ei,XL=YL["__core-js_shared__"],ZL=XL,nh=ZL,zy=function(){var e=/[^.]+$/.exec(nh&&nh.keys&&nh.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function QL(e){return!!zy&&zy in e}var JL=QL,ek=Function.prototype,tk=ek.toString;function nk(e){if(e!=null){try{return tk.call(e)}catch{}try{return e+""}catch{}}return""}var $$=nk,rk=id,ik=JL,ak=ti,ok=$$,sk=/[\\^$.*+?()[\]{}|]/g,lk=/^\[object .+?Constructor\]$/,ck=Function.prototype,uk=Object.prototype,dk=ck.toString,fk=uk.hasOwnProperty,hk=RegExp("^"+dk.call(fk).replace(sk,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function vk(e){if(!ak(e)||ik(e))return!1;var t=rk(e)?hk:lk;return t.test(ok(e))}var gk=vk;function mk(e,t){return e==null?void 0:e[t]}var pk=mk,bk=gk,yk=pk;function xk(e,t){var n=yk(e,t);return bk(n)?n:void 0}var wa=xk,Sk=wa,Ck=Sk(Object,"create"),ad=Ck,By=ad;function wk(){this.__data__=By?By(null):{},this.size=0}var $k=wk;function _k(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ek=_k,Ok=ad,Mk="__lodash_hash_undefined__",Tk=Object.prototype,Rk=Tk.hasOwnProperty;function Pk(e){var t=this.__data__;if(Ok){var n=t[e];return n===Mk?void 0:n}return Rk.call(t,e)?t[e]:void 0}var Ik=Pk,Ak=ad,Nk=Object.prototype,jk=Nk.hasOwnProperty;function Lk(e){var t=this.__data__;return Ak?t[e]!==void 0:jk.call(t,e)}var kk=Lk,Dk=ad,Fk="__lodash_hash_undefined__";function zk(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Dk&&t===void 0?Fk:t,this}var Bk=zk,Vk=$k,Wk=Ek,Hk=Ik,Uk=kk,Gk=Bk;function Fo(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Fo.prototype.clear=Vk;Fo.prototype.delete=Wk;Fo.prototype.get=Hk;Fo.prototype.has=Uk;Fo.prototype.set=Gk;var qk=Fo;function Kk(){this.__data__=[],this.size=0}var Yk=Kk;function Xk(e,t){return e===t||e!==e&&t!==t}var Il=Xk,Zk=Il;function Qk(e,t){for(var n=e.length;n--;)if(Zk(e[n][0],t))return n;return-1}var od=Qk,Jk=od,eD=Array.prototype,tD=eD.splice;function nD(e){var t=this.__data__,n=Jk(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():tD.call(t,n,1),--this.size,!0}var rD=nD,iD=od;function aD(e){var t=this.__data__,n=iD(t,e);return n<0?void 0:t[n][1]}var oD=aD,sD=od;function lD(e){return sD(this.__data__,e)>-1}var cD=lD,uD=od;function dD(e,t){var n=this.__data__,r=uD(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var fD=dD,hD=Yk,vD=rD,gD=oD,mD=cD,pD=fD;function zo(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}zo.prototype.clear=hD;zo.prototype.delete=vD;zo.prototype.get=gD;zo.prototype.has=mD;zo.prototype.set=pD;var sd=zo,bD=wa,yD=ei,xD=bD(yD,"Map"),Gm=xD,Vy=qk,SD=sd,CD=Gm;function wD(){this.size=0,this.__data__={hash:new Vy,map:new(CD||SD),string:new Vy}}var $D=wD;function _D(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var ED=_D,OD=ED;function MD(e,t){var n=e.__data__;return OD(t)?n[typeof t=="string"?"string":"hash"]:n.map}var ld=MD,TD=ld;function RD(e){var t=TD(this,e).delete(e);return this.size-=t?1:0,t}var PD=RD,ID=ld;function AD(e){return ID(this,e).get(e)}var ND=AD,jD=ld;function LD(e){return jD(this,e).has(e)}var kD=LD,DD=ld;function FD(e,t){var n=DD(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var zD=FD,BD=$D,VD=PD,WD=ND,HD=kD,UD=zD;function Bo(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Bo.prototype.clear=BD;Bo.prototype.delete=VD;Bo.prototype.get=WD;Bo.prototype.has=HD;Bo.prototype.set=UD;var qm=Bo,GD="__lodash_hash_undefined__";function qD(e){return this.__data__.set(e,GD),this}var KD=qD;function YD(e){return this.__data__.has(e)}var XD=YD,ZD=qm,QD=KD,JD=XD;function ou(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ZD;++t<n;)this.add(e[t])}ou.prototype.add=ou.prototype.push=QD;ou.prototype.has=JD;var Km=ou;function eF(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var tF=eF;function nF(e){return e!==e}var rF=nF;function iF(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var aF=iF,oF=tF,sF=rF,lF=aF;function cF(e,t,n){return t===t?lF(e,t,n):oF(e,sF,n)}var uF=cF,dF=uF;function fF(e,t){var n=e==null?0:e.length;return!!n&&dF(e,t,0)>-1}var _$=fF;function hF(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var E$=hF;function vF(e,t){return e.has(t)}var Ym=vF,gF=wa,mF=ei,pF=gF(mF,"Set"),O$=pF;function bF(){}var yF=bF;function xF(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Xm=xF,rh=O$,SF=yF,CF=Xm,wF=1/0,$F=rh&&1/CF(new rh([,-0]))[1]==wF?function(e){return new rh(e)}:SF,_F=$F,EF=Km,OF=_$,MF=E$,TF=Ym,RF=_F,PF=Xm,IF=200;function AF(e,t,n){var r=-1,i=OF,a=e.length,o=!0,s=[],l=s;if(n)o=!1,i=MF;else if(a>=IF){var c=t?null:RF(e);if(c)return PF(c);o=!1,i=TF,l=new EF}else l=t?[]:s;e:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,o&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),s.push(u)}else i(l,d,n)||(l!==s&&l.push(d),s.push(u))}return s}var M$=AF,NF=M$;function jF(e){return e&&e.length?NF(e):[]}var LF=jF;const tg=rn(LF);var ng={exports:{}},fc={exports:{}},Bt={};/** @license React v16.13.1
442
+ `,xL=({id:e,text:t,columns:n,textalign:r="left",style:i,className:a,editable:o})=>k.jsxs(k.Fragment,{children:[k.jsx(On,{}),k.jsx(bL,{id:e,columns:n,textalign:r,style:i||{},className:a||"",contentEditable:o,suppressContentEditableWarning:o,children:t==null?void 0:t.map((s,l)=>k.jsx(yL,{dangerouslySetInnerHTML:{__html:s}},`${e}-${l}`))})]}),SL=({metricsData:e,className:t=null,gap:n=null,justify:r=null,wrap:i=!1,style:a={}})=>k.jsx(Lo,{className:t,gap:n||10,justify:r,wrap:i,style:a,children:e==null?void 0:e.map((o,s)=>k.jsx(b$,{percent:o.percent,description:o.description,cost:o.cost,editable:o.editable,style:{width:"100%"}},`metrics-${s}`))});var CL=typeof Kl=="object"&&Kl&&Kl.Object===Object&&Kl,C$=CL,wL=C$,$L=typeof self=="object"&&self&&self.Object===Object&&self,_L=wL||$L||Function("return this")(),ei=_L,EL=ei,OL=EL.Symbol,Do=OL,ky=Do,w$=Object.prototype,ML=w$.hasOwnProperty,TL=w$.toString,ss=ky?ky.toStringTag:void 0;function RL(e){var t=ML.call(e,ss),n=e[ss];try{e[ss]=void 0;var r=!0}catch{}var i=TL.call(e);return r&&(t?e[ss]=n:delete e[ss]),i}var PL=RL,IL=Object.prototype,AL=IL.toString;function NL(e){return AL.call(e)}var jL=NL,Dy=Do,LL=PL,kL=jL,DL="[object Null]",FL="[object Undefined]",Fy=Dy?Dy.toStringTag:void 0;function zL(e){return e==null?e===void 0?FL:DL:Fy&&Fy in Object(e)?LL(e):kL(e)}var yi=zL;function BL(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ti=BL,VL=yi,WL=ti,HL="[object AsyncFunction]",UL="[object Function]",GL="[object GeneratorFunction]",qL="[object Proxy]";function KL(e){if(!WL(e))return!1;var t=VL(e);return t==UL||t==GL||t==HL||t==qL}var id=KL;const Um=rn(id);var YL=ei,XL=YL["__core-js_shared__"],ZL=XL,nh=ZL,zy=function(){var e=/[^.]+$/.exec(nh&&nh.keys&&nh.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function QL(e){return!!zy&&zy in e}var JL=QL,ek=Function.prototype,tk=ek.toString;function nk(e){if(e!=null){try{return tk.call(e)}catch{}try{return e+""}catch{}}return""}var $$=nk,rk=id,ik=JL,ak=ti,ok=$$,sk=/[\\^$.*+?()[\]{}|]/g,lk=/^\[object .+?Constructor\]$/,ck=Function.prototype,uk=Object.prototype,dk=ck.toString,fk=uk.hasOwnProperty,hk=RegExp("^"+dk.call(fk).replace(sk,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function vk(e){if(!ak(e)||ik(e))return!1;var t=rk(e)?hk:lk;return t.test(ok(e))}var gk=vk;function mk(e,t){return e==null?void 0:e[t]}var pk=mk,bk=gk,yk=pk;function xk(e,t){var n=yk(e,t);return bk(n)?n:void 0}var wa=xk,Sk=wa,Ck=Sk(Object,"create"),ad=Ck,By=ad;function wk(){this.__data__=By?By(null):{},this.size=0}var $k=wk;function _k(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ek=_k,Ok=ad,Mk="__lodash_hash_undefined__",Tk=Object.prototype,Rk=Tk.hasOwnProperty;function Pk(e){var t=this.__data__;if(Ok){var n=t[e];return n===Mk?void 0:n}return Rk.call(t,e)?t[e]:void 0}var Ik=Pk,Ak=ad,Nk=Object.prototype,jk=Nk.hasOwnProperty;function Lk(e){var t=this.__data__;return Ak?t[e]!==void 0:jk.call(t,e)}var kk=Lk,Dk=ad,Fk="__lodash_hash_undefined__";function zk(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Dk&&t===void 0?Fk:t,this}var Bk=zk,Vk=$k,Wk=Ek,Hk=Ik,Uk=kk,Gk=Bk;function Fo(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Fo.prototype.clear=Vk;Fo.prototype.delete=Wk;Fo.prototype.get=Hk;Fo.prototype.has=Uk;Fo.prototype.set=Gk;var qk=Fo;function Kk(){this.__data__=[],this.size=0}var Yk=Kk;function Xk(e,t){return e===t||e!==e&&t!==t}var Il=Xk,Zk=Il;function Qk(e,t){for(var n=e.length;n--;)if(Zk(e[n][0],t))return n;return-1}var od=Qk,Jk=od,eD=Array.prototype,tD=eD.splice;function nD(e){var t=this.__data__,n=Jk(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():tD.call(t,n,1),--this.size,!0}var rD=nD,iD=od;function aD(e){var t=this.__data__,n=iD(t,e);return n<0?void 0:t[n][1]}var oD=aD,sD=od;function lD(e){return sD(this.__data__,e)>-1}var cD=lD,uD=od;function dD(e,t){var n=this.__data__,r=uD(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var fD=dD,hD=Yk,vD=rD,gD=oD,mD=cD,pD=fD;function zo(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}zo.prototype.clear=hD;zo.prototype.delete=vD;zo.prototype.get=gD;zo.prototype.has=mD;zo.prototype.set=pD;var sd=zo,bD=wa,yD=ei,xD=bD(yD,"Map"),Gm=xD,Vy=qk,SD=sd,CD=Gm;function wD(){this.size=0,this.__data__={hash:new Vy,map:new(CD||SD),string:new Vy}}var $D=wD;function _D(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var ED=_D,OD=ED;function MD(e,t){var n=e.__data__;return OD(t)?n[typeof t=="string"?"string":"hash"]:n.map}var ld=MD,TD=ld;function RD(e){var t=TD(this,e).delete(e);return this.size-=t?1:0,t}var PD=RD,ID=ld;function AD(e){return ID(this,e).get(e)}var ND=AD,jD=ld;function LD(e){return jD(this,e).has(e)}var kD=LD,DD=ld;function FD(e,t){var n=DD(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var zD=FD,BD=$D,VD=PD,WD=ND,HD=kD,UD=zD;function Bo(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Bo.prototype.clear=BD;Bo.prototype.delete=VD;Bo.prototype.get=WD;Bo.prototype.has=HD;Bo.prototype.set=UD;var qm=Bo,GD="__lodash_hash_undefined__";function qD(e){return this.__data__.set(e,GD),this}var KD=qD;function YD(e){return this.__data__.has(e)}var XD=YD,ZD=qm,QD=KD,JD=XD;function ou(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new ZD;++t<n;)this.add(e[t])}ou.prototype.add=ou.prototype.push=QD;ou.prototype.has=JD;var Km=ou;function eF(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}var tF=eF;function nF(e){return e!==e}var rF=nF;function iF(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var aF=iF,oF=tF,sF=rF,lF=aF;function cF(e,t,n){return t===t?lF(e,t,n):oF(e,sF,n)}var uF=cF,dF=uF;function fF(e,t){var n=e==null?0:e.length;return!!n&&dF(e,t,0)>-1}var _$=fF;function hF(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var E$=hF;function vF(e,t){return e.has(t)}var Ym=vF,gF=wa,mF=ei,pF=gF(mF,"Set"),O$=pF;function bF(){}var yF=bF;function xF(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Xm=xF,rh=O$,SF=yF,CF=Xm,wF=1/0,$F=rh&&1/CF(new rh([,-0]))[1]==wF?function(e){return new rh(e)}:SF,_F=$F,EF=Km,OF=_$,MF=E$,TF=Ym,RF=_F,PF=Xm,IF=200;function AF(e,t,n){var r=-1,i=OF,a=e.length,o=!0,s=[],l=s;if(n)o=!1,i=MF;else if(a>=IF){var c=t?null:RF(e);if(c)return PF(c);o=!1,i=TF,l=new EF}else l=t?[]:s;e:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,o&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),s.push(u)}else i(l,d,n)||(l!==s&&l.push(d),s.push(u))}return s}var M$=AF,NF=M$;function jF(e){return e&&e.length?NF(e):[]}var LF=jF;const tg=rn(LF);var ng={exports:{}},fc={exports:{}},Bt={};/** @license React v16.13.1
443
443
  * react-is.production.min.js
444
444
  *
445
445
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -494,10 +494,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
494
494
  margin-left: 100px;
495
495
  margin-bottom: 50px;
496
496
  padding: 50px;
497
- `,Hie=({pieChartData:e,title:t,isEmpty:n})=>{const r=({dataWithArc:i,centerX:a,centerY:o})=>{let s=0;return i.forEach(l=>{s+=l.value}),k.jsx("text",{x:a,y:o,textAnchor:"middle",dominantBaseline:"central",style:{fontSize:"16px",fontWeight:400},children:n?"Data niet openbaar beschikbaar":""})};return k.jsxs(k.Fragment,{children:[k.jsx(On,{}),k.jsxs("div",{style:{width:"100%",height:600,position:"relative"},children:[k.jsx(Wie,{children:t}),k.jsx(Vie,{colors:{scheme:n?"greys":"nivo"},tooltip:({datum:{id:i,label:a,value:o,color:s,unit:l}})=>k.jsx(pi,{label:a,amount:o,unit:l}),data:e,enableArcLabels:!n,enableArcLinkLabels:!n,margin:{top:40,right:80,bottom:80,left:80},innerRadius:.5,padAngle:.7,cornerRadius:3,activeOuterRadiusOffset:8,borderWidth:1,borderColor:{from:"color",modifiers:[["darker",.2]]},arcLinkLabelsSkipAngle:10,arcLinkLabelsTextColor:"#333333",arcLinkLabelsThickness:2,arcLinkLabelsColor:{from:"color"},arcLabelsSkipAngle:10,arcLabelsTextColor:{from:"color",modifiers:[["darker",2]]},isInteractive:!n,layers:["arcs","arcLabels","arcLinkLabels","legends",r],defs:[{id:"dots",type:"patternDots",background:"inherit",color:"rgba(255, 255, 255, 0.3)",size:4,padding:1,stagger:!0},{id:"lines",type:"patternLines",background:"inherit",color:"rgba(255, 255, 255, 0.3)",rotation:-45,lineWidth:6,spacing:10}]})]})]})};var Uie=pd,Gie=o0,qie=1,Kie=2;function Yie(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var l=s[0],c=e[l],u=s[1];if(o&&s[2]){if(c===void 0&&!(l in e))return!1}else{var d=new Uie;if(r)var f=r(c,u,l,e,t,d);if(!(f===void 0?Gie(u,c,qie|Kie,r,d):f))return!1}}return!0}var Xie=Yie,Zie=ti;function Qie(e){return e===e&&!Zie(e)}var BO=Qie,Jie=BO,eae=Bl;function tae(e){for(var t=eae(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Jie(i)]}return t}var nae=tae;function rae(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var VO=rae,iae=Xie,aae=nae,oae=VO;function sae(e){var t=aae(e);return t.length==1&&t[0][2]?oae(t[0][0],t[0][1]):function(n){return n===e||iae(n,e,t)}}var lae=sae,cae=o0,uae=L_,dae=GE,fae=wp,hae=BO,vae=VO,gae=Ko,mae=1,pae=2;function bae(e,t){return fae(e)&&hae(t)?vae(gae(e),t):function(n){var r=uae(n,e);return r===void 0&&r===t?dae(n,e):cae(t,r,mae|pae)}}var yae=bae;function xae(e){return function(t){return t==null?void 0:t[e]}}var Sae=xae,Cae=Fl;function wae(e){return function(t){return Cae(t,e)}}var $ae=wae,_ae=Sae,Eae=$ae,Oae=wp,Mae=Ko;function Tae(e){return Oae(e)?_ae(Mae(e)):Eae(e)}var Rae=Tae,Pae=lae,Iae=yae,Aae=wd,Nae=tr,jae=Rae;function Lae(e){return typeof e=="function"?e:e==null?Aae:typeof e=="object"?Nae(e)?Iae(e[0],e[1]):Pae(e):jae(e)}var f0=Lae,kae=f0,Dae=M$;function Fae(e,t){return e&&e.length?Dae(e,kae(t)):[]}var zae=Fae;const Bae=rn(zae);var Vae=b_,Wae=Bl;function Hae(e,t){return e&&Vae(e,t,Wae)}var Uae=Hae,Gae=Ho;function qae(e,t){return function(n,r){if(n==null)return n;if(!Gae(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var Kae=qae,Yae=Uae,Xae=Kae,Zae=Xae(Yae),WO=Zae,Qae=WO,Jae=Ho;function eoe(e,t){var n=-1,r=Jae(e)?Array(e.length):[];return Qae(e,function(i,a,o){r[++n]=t(i,a,o)}),r}var toe=eoe;function noe(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var roe=noe,wS=$d;function ioe(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=wS(e),o=t!==void 0,s=t===null,l=t===t,c=wS(t);if(!s&&!c&&!a&&e>t||a&&o&&l&&!s&&!c||r&&o&&l||!n&&l||!i)return 1;if(!r&&!a&&!c&&e<t||c&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!l)return-1}return 0}var aoe=ioe,ooe=aoe;function soe(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var l=ooe(i[r],a[r]);if(l){if(r>=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return e.index-t.index}var loe=soe,Lh=_d,coe=Fl,uoe=f0,doe=toe,foe=roe,hoe=Uo,voe=loe,goe=wd,moe=tr;function poe(e,t,n){t.length?t=Lh(t,function(a){return moe(a)?function(o){return coe(o,a.length===1?a[0]:a)}:a}):t=[goe];var r=-1;t=Lh(t,hoe(uoe));var i=doe(e,function(a,o,s){var l=Lh(t,function(c){return c(a)});return{criteria:l,index:++r,value:a}});return foe(i,function(a,o){return voe(a,o,n)})}var boe=poe,yoe=KE,xoe=boe,Soe=Cp,$S=A_,Coe=Soe(function(e,t){if(e==null)return[];var n=t.length;return n>1&&$S(e,t[0],t[1])?t=[]:n>2&&$S(t[0],t[1],t[2])&&(t=[t[0]]),xoe(e,yoe(t,1),[])}),woe=Coe;const $oe=rn(woe);var _oe=yi,Eoe=Tr,Ooe="[object Date]";function Moe(e){return Eoe(e)&&_oe(e)==Ooe}var Toe=Moe,Roe=Toe,Poe=Uo,_S=Sd,ES=_S&&_S.isDate,Ioe=ES?Poe(ES):Roe,Aoe=Ioe;const Noe=rn(Aoe);var kh=new Date,Dh=new Date;function En(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=function(a){return e(a=new Date(+a)),a},i.ceil=function(a){return e(a=new Date(a-1)),t(a,1),e(a),a},i.round=function(a){var o=i(a),s=i.ceil(a);return a-o<s-a?o:s},i.offset=function(a,o){return t(a=new Date(+a),o==null?1:Math.floor(o)),a},i.range=function(a,o,s){var l=[],c;if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a<o)||!(s>0))return l;do l.push(c=new Date(+a)),t(a,s),e(a);while(c<a&&a<o);return l},i.filter=function(a){return En(function(o){if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},function(o,s){if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););})},n&&(i.count=function(a,o){return kh.setTime(+a),Dh.setTime(+o),e(kh),e(Dh),Math.floor(n(kh,Dh))},i.every=function(a){return a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?function(o){return r(o)%a===0}:function(o){return i.count(0,o)%a===0}):i}),i}var pl=En(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});pl.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?En(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):pl};pl.range;var Iu=1e3,To=6e4,Au=36e5,HO=6048e5,kg=En(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*Iu)},function(e,t){return(t-e)/Iu},function(e){return e.getUTCSeconds()});kg.range;var UO=En(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Iu)},function(e,t){e.setTime(+e+t*To)},function(e,t){return(t-e)/To},function(e){return e.getMinutes()});UO.range;var GO=En(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Iu-e.getMinutes()*To)},function(e,t){e.setTime(+e+t*Au)},function(e,t){return(t-e)/Au},function(e){return e.getHours()});GO.range;function Ia(e){return En(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n*7)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*To)/HO})}var Dg=Ia(0),qO=Ia(1),KO=Ia(2),YO=Ia(3),XO=Ia(4),ZO=Ia(5),QO=Ia(6);Dg.range;qO.range;KO.range;YO.range;XO.range;ZO.range;QO.range;var JO=En(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12},function(e){return e.getMonth()});JO.range;var h0=En(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});h0.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:En(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)})};h0.range;var eM=En(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*To)},function(e,t){return(t-e)/To},function(e){return e.getUTCMinutes()});eM.range;var tM=En(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*Au)},function(e,t){return(t-e)/Au},function(e){return e.getUTCHours()});tM.range;function Aa(e){return En(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n*7)},function(t,n){return(n-t)/HO})}var Fg=Aa(0),nM=Aa(1),rM=Aa(2),iM=Aa(3),aM=Aa(4),oM=Aa(5),sM=Aa(6);Fg.range;nM.range;rM.range;iM.range;aM.range;oM.range;sM.range;var lM=En(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12},function(e){return e.getUTCMonth()});lM.range;var v0=En(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});v0.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:En(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})};v0.range;function Zi(){return Zi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zi.apply(this,arguments)}var Ka=[function(e){return e.setMilliseconds(0)},function(e){return e.setSeconds(0)},function(e){return e.setMinutes(0)},function(e){return e.setHours(0)},function(e){return e.setDate(1)},function(e){return e.setMonth(0)}],joe={millisecond:[],second:Ka.slice(0,1),minute:Ka.slice(0,2),hour:Ka.slice(0,3),day:Ka.slice(0,4),month:Ka.slice(0,5),year:Ka.slice(0,6)},Loe=function(e){return function(t){return joe[e].forEach(function(n){n(t)}),t}},cM=function(e){var t=e.format,n=t===void 0?"native":t,r=e.precision,i=r===void 0?"millisecond":r,a=e.useUTC,o=a===void 0||a,s=Loe(i);return function(l){if(l===void 0)return l;if(n==="native"||l instanceof Date)return s(l);var c=o?UE(n):HE(n);return s(c(l))}},koe=function(e,t,n,r){var i,a,o,s,l=e.min,c=l===void 0?0:l,u=e.max,d=u===void 0?"auto":u,f=e.stacked,h=f!==void 0&&f,p=e.reverse,m=p!==void 0&&p,v=e.clamp,b=v!==void 0&&v,y=e.nice,x=y!==void 0&&y;c==="auto"?i=h===!0?(a=t.minStacked)!=null?a:0:t.min:i=c,d==="auto"?o=h===!0?(s=t.maxStacked)!=null?s:0:t.max:o=d;var C=Np().rangeRound(r==="x"?[0,n]:[n,0]).domain(m?[o,i]:[i,o]).clamp(b);return x===!0?C.nice():typeof x=="number"&&C.nice(x),Doe(C,h)},Doe=function(e,t){t===void 0&&(t=!1);var n=e;return n.type="linear",n.stacked=t,n},Foe=function(e,t,n){var r=JG().range([0,n]).domain(t.all);return r.type="point",r},zoe=function(e,t,n,r){var i=e.round,a=i===void 0||i,o=Rp().range(r==="x"?[0,n]:[n,0]).domain(t.all).round(a);return Boe(o)},Boe=function(e){var t=e;return t.type="band",t},Voe=function(e,t,n){var r,i,a=e.format,o=a===void 0?"native":a,s=e.precision,l=s===void 0?"millisecond":s,c=e.min,u=c===void 0?"auto":c,d=e.max,f=d===void 0?"auto":d,h=e.useUTC,p=h===void 0||h,m=e.nice,v=m!==void 0&&m,b=cM({format:o,precision:l,useUTC:p});r=u==="auto"?b(t.min):o!=="native"?b(u):u,i=f==="auto"?b(t.max):o!=="native"?b(f):f;var y=p?GK():UK();y.range([0,n]),r&&i&&y.domain([r,i]),v===!0?y.nice():typeof v!="object"&&typeof v!="number"||y.nice(v);var x=y;return x.type="time",x.useUTC=p,x},Woe=function(e,t,n,r){var i,a=e.base,o=a===void 0?10:a,s=e.min,l=s===void 0?"auto":s,c=e.max,u=c===void 0?"auto":c;if(t.all.some(function(m){return m===0}))throw new Error("a log scale domain must not include or cross zero");var d,f,h=!1;if(t.all.filter(function(m){return m!=null}).forEach(function(m){h||(i===void 0?i=Math.sign(m):Math.sign(m)!==i&&(h=!0))}),h)throw new Error("a log scale domain must be strictly-positive or strictly-negative");d=l==="auto"?t.min:l,f=u==="auto"?t.max:u;var p=J_().domain([d,f]).rangeRound(r==="x"?[0,n]:[n,0]).base(o).nice();return p.type="log",p},Hoe=function(e,t,n,r){var i,a,o=e.constant,s=o===void 0?1:o,l=e.min,c=l===void 0?"auto":l,u=e.max,d=u===void 0?"auto":u,f=e.reverse,h=f!==void 0&&f;i=c==="auto"?t.min:c,a=d==="auto"?t.max:d;var p=eE().constant(s).rangeRound(r==="x"?[0,n]:[n,0]).nice();h===!0?p.domain([a,i]):p.domain([i,a]);var m=p;return m.type="symlog",m},Uoe=function(e){return e==="x"?"y":"x"},Goe=function(e,t){return e===t},qoe=function(e,t){return e.getTime()===t.getTime()};function OS(e,t,n,r){switch(e.type){case"linear":return koe(e,t,n,r);case"point":return Foe(e,t,n);case"band":return zoe(e,t,n,r);case"time":return Voe(e,t,n);case"log":return Woe(e,t,n,r);case"symlog":return Hoe(e,t,n,r);default:throw new Error("invalid scale spec")}}var MS=function(e,t,n){var r;if("stacked"in n&&n.stacked){var i=e.data[t==="x"?"xStacked":"yStacked"];return i==null?null:n(i)}return(r=n(e.data[t]))!=null?r:null},uM=function(e,t,n,r,i){var a=e.map(function(u){return function(d){return Zi({},d,{data:d.data.map(function(f){return{data:Zi({},f)}})})}(u)}),o=Koe(a,t,n);"stacked"in t&&t.stacked===!0&&Yoe(o,a),"stacked"in n&&n.stacked===!0&&Xoe(o,a);var s=OS(t,o.x,r,"x"),l=OS(n,o.y,i,"y"),c=a.map(function(u){return Zi({},u,{data:u.data.map(function(d){return Zi({},d,{position:{x:MS(d,"x",s),y:MS(d,"y",l)}})})})});return Zi({},o,{series:c,xScale:s,yScale:l})},Koe=function(e,t,n){return{x:TS(e,"x",t),y:TS(e,"y",n)}},TS=function(e,t,n,r){var i={},a=i.getValue,o=a===void 0?function(p){return p.data[t]}:a,s=i.setValue,l=s===void 0?function(p,m){p.data[t]=m}:s;if(n.type==="linear")e.forEach(function(p){p.data.forEach(function(m){var v=o(m);v&&l(m,parseFloat(String(v)))})});else if(n.type==="time"&&n.format!=="native"){var c=cM(n);e.forEach(function(p){p.data.forEach(function(m){var v=o(m);v&&l(m,c(v))})})}var u=[];switch(e.forEach(function(p){p.data.forEach(function(m){u.push(o(m))})}),n.type){case"linear":var d=$oe(tg(u).filter(function(p){return p!==null}),function(p){return p});return{all:d,min:Math.min.apply(Math,d),max:Math.max.apply(Math,d)};case"time":var f=Bae(u,function(p){return p.getTime()}).slice(0).sort(function(p,m){return m.getTime()-p.getTime()}).reverse();return{all:f,min:f[0],max:dt(f)};default:var h=tg(u);return{all:h,min:h[0],max:dt(h)}}},dM=function(e,t,n){var r=Uoe(e),i=[];t[r].all.forEach(function(a){var o=Noe(a)?qoe:Goe,s=[];n.forEach(function(l){var c=l.data.find(function(h){return o(h.data[r],a)}),u=null,d=null;if(c!==void 0){if((u=c.data[e])!==null){var f=dt(s);f===void 0?d=u:f!==null&&(d=f+u)}c.data[e==="x"?"xStacked":"yStacked"]=d}s.push(d),d!==null&&i.push(d)})}),t[e].minStacked=Math.min.apply(Math,i),t[e].maxStacked=Math.max.apply(Math,i)},Yoe=function(e,t){return dM("x",e,t)},Xoe=function(e,t){return dM("y",e,t)},fM=function(e){var t=e.bandwidth();if(t===0)return e;var n=t/2;return e.round()&&(n=Math.round(n)),function(r){var i;return((i=e(r))!=null?i:0)+n}},hM={millisecond:[pl,pl],second:[kg,kg],minute:[UO,eM],hour:[GO,tM],day:[En(function(e){return e.setHours(0,0,0,0)},function(e,t){return e.setDate(e.getDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)}),En(function(e){return e.setUTCHours(0,0,0,0)},function(e,t){return e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)})],week:[Dg,Fg],sunday:[Dg,Fg],monday:[qO,nM],tuesday:[KO,rM],wednesday:[YO,iM],thursday:[XO,aM],friday:[ZO,oM],saturday:[QO,sM],month:[JO,lM],year:[h0,v0]},Zoe=Object.keys(hM),Qoe=new RegExp("^every\\s*(\\d+)?\\s*("+Zoe.join("|")+")s?$","i"),vM=function(e,t){if(Array.isArray(t))return t;if(typeof t=="string"&&"useUTC"in e){var n=t.match(Qoe);if(n){var r=n[1],i=n[2],a=hM[i][e.useUTC?1:0];if(i==="day"){var o,s,l=e.domain(),c=l[0],u=l[1],d=new Date(u);return d.setDate(d.getDate()+1),(o=(s=a.every(Number(r??1)))==null?void 0:s.range(c,d))!=null?o:[]}if(r===void 0)return e.ticks(a);var f=a.every(Number(r));if(f)return e.ticks(f)}throw new Error("Invalid tickValues: "+t)}if("ticks"in e){if(t===void 0)return e.ticks();if(typeof(h=t)=="number"&&isFinite(h)&&Math.floor(h)===h)return e.ticks(t)}var h;return e.domain()};function wr(){return wr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wr.apply(this,arguments)}var gM=function(e){var t,n=e.axis,r=e.scale,i=e.ticksPosition,a=e.tickValues,o=e.tickSize,s=e.tickPadding,l=e.tickRotation,c=e.truncateTickAt,u=e.engine,d=u===void 0?"svg":u,f=vM(r,a),h=Pee[d],p="bandwidth"in r?fM(r):r,m={lineX:0,lineY:0},v={textX:0,textY:0},b=typeof document=="object"&&document.dir==="rtl",y=h.align.center,x=h.baseline.center;return n==="x"?(t=function(C){var S;return{x:(S=p(C))!=null?S:0,y:0}},m.lineY=o*(i==="after"?1:-1),v.textY=(o+s)*(i==="after"?1:-1),x=i==="after"?h.baseline.top:h.baseline.bottom,l===0?y=h.align.center:i==="after"&&l<0||i==="before"&&l>0?(y=h.align[b?"left":"right"],x=h.baseline.center):(i==="after"&&l>0||i==="before"&&l<0)&&(y=h.align[b?"right":"left"],x=h.baseline.center)):(t=function(C){var S;return{x:0,y:(S=p(C))!=null?S:0}},m.lineX=o*(i==="after"?1:-1),v.textX=(o+s)*(i==="after"?1:-1),y=i==="after"?h.align.left:h.align.right),{ticks:f.map(function(C){var S=typeof C=="string"?function(w){var O=String(w).length;return c&&c>0&&O>c?""+String(w).slice(0,c).concat("..."):""+w}(C):C;return wr({key:C instanceof Date?""+C.valueOf():""+C,value:S},t(C),m,v)}),textAlign:y,textBaseline:x}},mM=function(e,t){if(e===void 0||typeof e=="function")return e;if(t.type==="time"){var n=r0(e);return function(r){return n(r instanceof Date?r:new Date(r))}}return Qp(e)},zg=function(e){var t,n=e.width,r=e.height,i=e.scale,a=e.axis,o=e.values,s=(t=o,(Array.isArray(t)?o:void 0)||vM(i,o)),l="bandwidth"in i?fM(i):i,c=a==="x"?s.map(function(u){var d,f;return{key:u instanceof Date?""+u.valueOf():""+u,x1:(d=l(u))!=null?d:0,x2:(f=l(u))!=null?f:0,y1:0,y2:r}}):s.map(function(u){var d,f;return{key:u instanceof Date?""+u.valueOf():""+u,x1:0,x2:n,y1:(d=l(u))!=null?d:0,y2:(f=l(u))!=null?f:0}});return c},Joe=$.memo(function(e){var t,n=e.value,r=e.format,i=e.lineX,a=e.lineY,o=e.onClick,s=e.textBaseline,l=e.textAnchor,c=e.animatedProps,u=kt(),d=u.axis.ticks.line,f=u.axis.ticks.text,h=(t=r==null?void 0:r(n))!=null?t:n,p=$.useMemo(function(){var m={opacity:c.opacity};return o?{style:wr({},m,{cursor:"pointer"}),onClick:function(v){return o(v,h)}}:{style:m}},[c.opacity,o,h]);return k.jsxs(Tt.g,wr({transform:c.transform},p,{children:[k.jsx("line",{x1:0,x2:i,y1:0,y2:a,style:d}),f.outlineWidth>0&&k.jsx(Tt.text,{dominantBaseline:s,textAnchor:l,transform:c.textTransform,style:f,strokeWidth:2*f.outlineWidth,stroke:f.outlineColor,strokeLinejoin:"round",children:""+h}),k.jsx(Tt.text,{dominantBaseline:s,textAnchor:l,transform:c.textTransform,style:l0(f),children:""+h})]}))}),ese=function(e){var t=e.axis,n=e.scale,r=e.x,i=r===void 0?0:r,a=e.y,o=a===void 0?0:a,s=e.length,l=e.ticksPosition,c=e.tickValues,u=e.tickSize,d=u===void 0?5:u,f=e.tickPadding,h=f===void 0?5:f,p=e.tickRotation,m=p===void 0?0:p,v=e.format,b=e.renderTick,y=b===void 0?Joe:b,x=e.truncateTickAt,C=e.legend,S=e.legendPosition,w=S===void 0?"end":S,O=e.legendOffset,E=O===void 0?0:O,_=e.onClick,T=e.ariaHidden,R=kt(),F=R.axis.legend.text,I=$.useMemo(function(){return mM(v,n)},[v,n]),P=gM({axis:t,scale:n,ticksPosition:l,tickValues:c,tickSize:d,tickPadding:h,tickRotation:m,truncateTickAt:x}),j=P.ticks,A=P.textAlign,M=P.textBaseline,N=null;if(C!==void 0){var L,D=0,V=0,X=0;t==="y"?(X=-90,D=E,w==="start"?(L="start",V=s):w==="middle"?(L="middle",V=s/2):w==="end"&&(L="end")):(V=E,w==="start"?L="start":w==="middle"?(L="middle",D=s/2):w==="end"&&(L="end",D=s)),N=k.jsxs(k.Fragment,{children:[F.outlineWidth>0&&k.jsx("text",{transform:"translate("+D+", "+V+") rotate("+X+")",textAnchor:L,style:wr({dominantBaseline:"central"},F),strokeWidth:2*F.outlineWidth,stroke:F.outlineColor,strokeLinejoin:"round",children:C}),k.jsx("text",{transform:"translate("+D+", "+V+") rotate("+X+")",textAnchor:L,style:wr({dominantBaseline:"central"},F),children:C})]})}var q=Sn(),Z=q.animate,J=q.config,Q=Mr({transform:"translate("+i+","+o+")",lineX2:t==="x"?s:0,lineY2:t==="x"?0:s,config:J,immediate:!Z}),K=$.useCallback(function(H){return{opacity:1,transform:"translate("+H.x+","+H.y+")",textTransform:"translate("+H.textX+","+H.textY+") rotate("+m+")"}},[m]),Y=$.useCallback(function(H){return{opacity:0,transform:"translate("+H.x+","+H.y+")",textTransform:"translate("+H.textX+","+H.textY+") rotate("+m+")"}},[m]),W=$a(j,{keys:function(H){return H.key},initial:K,from:Y,enter:K,update:K,leave:{opacity:0},config:J,immediate:!Z});return k.jsxs(Tt.g,{transform:Q.transform,"aria-hidden":T,children:[W(function(H,U,z,ne){return g.createElement(y,wr({tickIndex:ne,format:I,rotate:m,textBaseline:M,textAnchor:A,truncateTickAt:x,animatedProps:H},U,_?{onClick:_}:{}))}),k.jsx(Tt.line,{style:R.axis.domain.line,x1:0,x2:Q.lineX2,y1:0,y2:Q.lineY2}),N]})},tse=$.memo(ese),pM=["top","right","bottom","left"],bM=$.memo(function(e){var t=e.xScale,n=e.yScale,r=e.width,i=e.height,a={top:e.top,right:e.right,bottom:e.bottom,left:e.left};return k.jsx(k.Fragment,{children:pM.map(function(o){var s=a[o];if(!s)return null;var l=o==="top"||o==="bottom";return k.jsx(tse,wr({},s,{axis:l?"x":"y",x:o==="right"?r:0,y:o==="bottom"?i:0,scale:l?t:n,length:l?r:i,ticksPosition:o==="top"||o==="left"?"before":"after",truncateTickAt:s.truncateTickAt}),o)})})}),nse=$.memo(function(e){var t=e.animatedProps,n=kt();return k.jsx(Tt.line,wr({},t,n.grid.line))}),RS=$.memo(function(e){var t=e.lines,n=Sn(),r=n.animate,i=n.config,a=$a(t,{keys:function(o){return o.key},initial:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},from:function(o){return{opacity:0,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},enter:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},update:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},leave:{opacity:0},config:i,immediate:!r});return k.jsx("g",{children:a(function(o,s){return $.createElement(nse,wr({},s,{key:s.key,animatedProps:o}))})})}),yM=$.memo(function(e){var t=e.width,n=e.height,r=e.xScale,i=e.yScale,a=e.xValues,o=e.yValues,s=$.useMemo(function(){return!!r&&zg({width:t,height:n,scale:r,axis:"x",values:a})},[r,a,t,n]),l=$.useMemo(function(){return!!i&&zg({width:t,height:n,scale:i,axis:"y",values:o})},[n,t,i,o]);return k.jsxs(k.Fragment,{children:[s&&k.jsx(RS,{lines:s}),l&&k.jsx(RS,{lines:l})]})}),rse=function(e,t){var n,r=t.axis,i=t.scale,a=t.x,o=a===void 0?0:a,s=t.y,l=s===void 0?0:s,c=t.length,u=t.ticksPosition,d=t.tickValues,f=t.tickSize,h=f===void 0?5:f,p=t.tickPadding,m=p===void 0?5:p,v=t.tickRotation,b=v===void 0?0:v,y=t.format,x=t.legend,C=t.legendPosition,S=C===void 0?"end":C,w=t.legendOffset,O=w===void 0?0:w,E=t.theme,_=gM({axis:r,scale:i,ticksPosition:u,tickValues:d,tickSize:h,tickPadding:m,tickRotation:b,engine:"canvas"}),T=_.ticks,R=_.textAlign,F=_.textBaseline;e.save(),e.translate(o,l),e.textAlign=R,e.textBaseline=F;var I=E.axis.ticks.text;e.font=(I.fontWeight?I.fontWeight+" ":"")+I.fontSize+"px "+I.fontFamily,((n=E.axis.domain.line.strokeWidth)!=null?n:0)>0&&(e.lineWidth=Number(E.axis.domain.line.strokeWidth),e.lineCap="square",E.axis.domain.line.stroke&&(e.strokeStyle=E.axis.domain.line.stroke),e.beginPath(),e.moveTo(0,0),e.lineTo(r==="x"?c:0,r==="x"?0:c),e.stroke());var P=typeof y=="function"?y:function(L){return""+L};if(T.forEach(function(L){var D;((D=E.axis.ticks.line.strokeWidth)!=null?D:0)>0&&(e.lineWidth=Number(E.axis.ticks.line.strokeWidth),e.lineCap="square",E.axis.ticks.line.stroke&&(e.strokeStyle=E.axis.ticks.line.stroke),e.beginPath(),e.moveTo(L.x,L.y),e.lineTo(L.x+L.lineX,L.y+L.lineY),e.stroke());var V=P(L.value);e.save(),e.translate(L.x+L.textX,L.y+L.textY),e.rotate(Cr(b)),I.outlineWidth>0&&(e.strokeStyle=I.outlineColor,e.lineWidth=2*I.outlineWidth,e.lineJoin="round",e.strokeText(""+V,0,0)),E.axis.ticks.text.fill&&(e.fillStyle=I.fill),e.fillText(""+V,0,0),e.restore()}),x!==void 0){var j=0,A=0,M=0,N="center";r==="y"?(M=-90,j=O,S==="start"?(N="start",A=c):S==="middle"?(N="center",A=c/2):S==="end"&&(N="end")):(A=O,S==="start"?N="start":S==="middle"?(N="center",j=c/2):S==="end"&&(N="end",j=c)),e.translate(j,A),e.rotate(Cr(M)),e.font=(E.axis.legend.text.fontWeight?E.axis.legend.text.fontWeight+" ":"")+E.axis.legend.text.fontSize+"px "+E.axis.legend.text.fontFamily,E.axis.legend.text.fill&&(e.fillStyle=E.axis.legend.text.fill),e.textAlign=N,e.textBaseline="middle",e.fillText(x,0,0)}e.restore()},xM=function(e,t){var n=t.xScale,r=t.yScale,i=t.width,a=t.height,o=t.top,s=t.right,l=t.bottom,c=t.left,u=t.theme,d={top:o,right:s,bottom:l,left:c};pM.forEach(function(f){var h=d[f];if(!h)return null;var p=f==="top"||f==="bottom",m=f==="top"||f==="left"?"before":"after",v=p?n:r,b=mM(h.format,v);rse(e,wr({},h,{axis:p?"x":"y",x:f==="right"?i:0,y:f==="bottom"?a:0,scale:v,format:b,length:p?i:a,ticksPosition:m,theme:u}))})},Nu=function(e,t){var n=t.width,r=t.height,i=t.scale,a=t.axis,o=t.values;zg({width:n,height:r,scale:i,axis:a,values:o}).forEach(function(s){e.beginPath(),e.moveTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.stroke()})},ise=WO;function ase(e,t){var n=[];return ise(e,function(r,i,a){t(r,i,a)&&n.push(r)}),n}var ose=ase,sse=QE,lse=ose,cse=f0,use=tr;function dse(e,t){var n=use(e)?sse:lse;return n(e,cse(t))}var fse=dse;const hse=rn(fse);var vse=yi,gse=Tr,mse="[object Number]";function pse(e){return typeof e=="number"||gse(e)&&vse(e)==mse}var bse=pse;const Bg=rn(bse);function yse(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}var SM=yse,xse=Fl,Sse=SM;function Cse(e,t){return t.length<2?e:xse(e,Sse(t,0,-1))}var wse=Cse,$se=qo,_se=U_,Ese=wse,Ose=Ko;function Mse(e,t){return t=$se(t,e),e=Ese(e,t),e==null||delete e[Ose(_se(t))]}var Tse=Mse,Rse=yp;function Pse(e){return Rse(e)?void 0:e}var Ise=Pse,Ase=_d,Nse=NO,jse=Tse,Lse=qo,kse=Go,Dse=Ise,Fse=YE,zse=RO,Bse=1,Vse=2,Wse=4,Hse=Fse(function(e,t){var n={};if(e==null)return n;var r=!1;t=Ase(t,function(a){return a=Lse(a,e),r||(r=a.length>1),a}),kse(e,zse(e),n),r&&(n=Nse(n,Bse|Vse|Wse,Dse));for(var i=t.length;i--;)jse(n,t[i]);return n}),Use=Hse;const g0=rn(Use);function Di(){return Di=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Di.apply(this,arguments)}var Vg={dotSize:4,noteWidth:120,noteTextOffset:8,animate:!0},Gse=function(e){var t=typeof e;return $.isValidElement(e)||t==="string"||t==="function"||t==="object"},qse=function(e){var t=typeof e;return t==="string"||t==="function"},bl=function(e){return e.type==="circle"},Wg=function(e){return e.type==="dot"},yl=function(e){return e.type==="rect"},Kse=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return n.reduce(function(a,o){var s=o.offset||0;return[].concat(a,hse(t,o.match).map(function(l){var c=r(l),u=i(l);return(bl(o)||yl(o))&&(u.size=u.size+2*s,u.width=u.width+2*s,u.height=u.height+2*s),Di({},g0(o,["match","offset"]),c,u,{size:o.size||u.size,datum:l})}))},[])},Yse=function(e,t,n,r){var i=Math.atan2(r-t,n-e);return Ree(hf(i))},Xse=function(e){var t,n,r=e.x,i=e.y,a=e.noteX,o=e.noteY,s=e.noteWidth,l=s===void 0?Vg.noteWidth:s,c=e.noteTextOffset,u=c===void 0?Vg.noteTextOffset:c;if(Bg(a))t=r+a;else{if(a.abs===void 0)throw new Error("noteX should be either a number or an object containing an 'abs' property");t=a.abs}if(Bg(o))n=i+o;else{if(o.abs===void 0)throw new Error("noteY should be either a number or an object containing an 'abs' property");n=o.abs}var d=r,f=i,h=Yse(r,i,t,n);if(bl(e)){var p=ca(Cr(h),e.size/2);d+=p.x,f+=p.y}if(yl(e)){var m=Math.round((h+90)/45)%8;m===0&&(f-=e.height/2),m===1&&(d+=e.width/2,f-=e.height/2),m===2&&(d+=e.width/2),m===3&&(d+=e.width/2,f+=e.height/2),m===4&&(f+=e.height/2),m===5&&(d-=e.width/2,f+=e.height/2),m===6&&(d-=e.width/2),m===7&&(d-=e.width/2,f-=e.height/2)}var v=t,b=t;return(h+90)%360>180?(v-=l,b-=l):b+=l,{points:[[d,f],[t,n],[b,n]],text:[v,n-u],angle:h+90}},Zse=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return $.useMemo(function(){return Kse({data:t,annotations:n,getPosition:r,getDimensions:i})},[t,n,r,i])},Qse=function(e){return $.useMemo(function(){return Xse(e)},[e])},Jse=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,a=kt(),o=Sn(),s=o.animate,l=o.config,c=Mr({x:n,y:r,config:l,immediate:!s});return typeof i=="function"?$.createElement(i,{x:n,y:r,datum:t}):k.jsxs(k.Fragment,{children:[a.annotations.text.outlineWidth>0&&k.jsx(Tt.text,{x:c.x,y:c.y,style:Di({},a.annotations.text,{strokeLinejoin:"round",strokeWidth:2*a.annotations.text.outlineWidth,stroke:a.annotations.text.outlineColor}),children:i}),k.jsx(Tt.text,{x:c.x,y:c.y,style:g0(a.annotations.text,["outlineWidth","outlineColor"]),children:i})]})},PS=function(e){var t=e.points,n=e.isOutline,r=n!==void 0&&n,i=kt(),a=$.useMemo(function(){var l=t[0];return t.slice(1).reduce(function(c,u){return c+" L"+u[0]+","+u[1]},"M"+l[0]+","+l[1])},[t]),o=ff(a);if(r&&i.annotations.link.outlineWidth<=0)return null;var s=Di({},i.annotations.link);return r&&(s.strokeLinecap="square",s.strokeWidth=i.annotations.link.strokeWidth+2*i.annotations.link.outlineWidth,s.stroke=i.annotations.link.outlineColor,s.opacity=i.annotations.link.outlineOpacity),k.jsx(Tt.path,{fill:"none",d:o,style:s})},ele=function(e){var t=e.x,n=e.y,r=e.size,i=kt(),a=Sn(),o=a.animate,s=a.config,l=Mr({x:t,y:n,radius:r/2,config:s,immediate:!o});return k.jsxs(k.Fragment,{children:[i.annotations.outline.outlineWidth>0&&k.jsx(Tt.circle,{cx:l.x,cy:l.y,r:l.radius,style:Di({},i.annotations.outline,{fill:"none",strokeWidth:i.annotations.outline.strokeWidth+2*i.annotations.outline.outlineWidth,stroke:i.annotations.outline.outlineColor,opacity:i.annotations.outline.outlineOpacity})}),k.jsx(Tt.circle,{cx:l.x,cy:l.y,r:l.radius,style:i.annotations.outline})]})},tle=function(e){var t=e.x,n=e.y,r=e.size,i=r===void 0?Vg.dotSize:r,a=kt(),o=Sn(),s=o.animate,l=o.config,c=Mr({x:t,y:n,radius:i/2,config:l,immediate:!s});return k.jsxs(k.Fragment,{children:[a.annotations.outline.outlineWidth>0&&k.jsx(Tt.circle,{cx:c.x,cy:c.y,r:c.radius,style:Di({},a.annotations.outline,{fill:"none",strokeWidth:2*a.annotations.outline.outlineWidth,stroke:a.annotations.outline.outlineColor,opacity:a.annotations.outline.outlineOpacity})}),k.jsx(Tt.circle,{cx:c.x,cy:c.y,r:c.radius,style:a.annotations.symbol})]})},nle=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.borderRadius,o=a===void 0?6:a,s=kt(),l=Sn(),c=l.animate,u=l.config,d=Mr({x:t-r/2,y:n-i/2,width:r,height:i,config:u,immediate:!c});return k.jsxs(k.Fragment,{children:[s.annotations.outline.outlineWidth>0&&k.jsx(Tt.rect,{x:d.x,y:d.y,rx:o,ry:o,width:d.width,height:d.height,style:Di({},s.annotations.outline,{fill:"none",strokeWidth:s.annotations.outline.strokeWidth+2*s.annotations.outline.outlineWidth,stroke:s.annotations.outline.outlineColor,opacity:s.annotations.outline.outlineOpacity})}),k.jsx(Tt.rect,{x:d.x,y:d.y,rx:o,ry:o,width:d.width,height:d.height,style:s.annotations.outline})]})},rle=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,a=Qse(e);if(!Gse(i))throw new Error("note should be a valid react element");return k.jsxs(k.Fragment,{children:[k.jsx(PS,{points:a.points,isOutline:!0}),bl(e)&&k.jsx(ele,{x:n,y:r,size:e.size}),Wg(e)&&k.jsx(tle,{x:n,y:r,size:e.size}),yl(e)&&k.jsx(nle,{x:n,y:r,width:e.width,height:e.height,borderRadius:e.borderRadius}),k.jsx(PS,{points:a.points}),k.jsx(Jse,{datum:t,x:a.text[0],y:a.text[1],note:i})]})},IS=function(e,t){t.forEach(function(n,r){var i=n[0],a=n[1];r===0?e.moveTo(i,a):e.lineTo(i,a)})},ile=function(e,t){var n=t.annotations,r=t.theme;n.length!==0&&(e.save(),n.forEach(function(i){if(!qse(i.note))throw new Error("note is invalid for canvas implementation");r.annotations.link.outlineWidth>0&&(e.lineCap="square",e.strokeStyle=r.annotations.link.outlineColor,e.lineWidth=r.annotations.link.strokeWidth+2*r.annotations.link.outlineWidth,e.beginPath(),IS(e,i.computed.points),e.stroke(),e.lineCap="butt"),bl(i)&&r.annotations.outline.outlineWidth>0&&(e.strokeStyle=r.annotations.outline.outlineColor,e.lineWidth=r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),Wg(i)&&r.annotations.symbol.outlineWidth>0&&(e.strokeStyle=r.annotations.symbol.outlineColor,e.lineWidth=2*r.annotations.symbol.outlineWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),yl(i)&&r.annotations.outline.outlineWidth>0&&(e.strokeStyle=r.annotations.outline.outlineColor,e.lineWidth=r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,e.beginPath(),e.rect(i.x-i.width/2,i.y-i.height/2,i.width,i.height),e.stroke()),e.strokeStyle=r.annotations.link.stroke,e.lineWidth=r.annotations.link.strokeWidth,e.beginPath(),IS(e,i.computed.points),e.stroke(),bl(i)&&(e.strokeStyle=r.annotations.outline.stroke,e.lineWidth=r.annotations.outline.strokeWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),Wg(i)&&(e.fillStyle=r.annotations.symbol.fill,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.fill()),yl(i)&&(e.strokeStyle=r.annotations.outline.stroke,e.lineWidth=r.annotations.outline.strokeWidth,e.beginPath(),e.rect(i.x-i.width/2,i.y-i.height/2,i.width,i.height),e.stroke()),typeof i.note=="function"?i.note(e,{datum:i.datum,x:i.computed.text[0],y:i.computed.text[1],theme:r}):(e.font=r.annotations.text.fontSize+"px "+r.annotations.text.fontFamily,e.textAlign="left",e.textBaseline="alphabetic",e.fillStyle=r.annotations.text.fill,e.strokeStyle=r.annotations.text.outlineColor,e.lineWidth=2*r.annotations.text.outlineWidth,r.annotations.text.outlineWidth>0&&(e.lineJoin="round",e.strokeText(i.note,i.computed.text[0],i.computed.text[1]),e.lineJoin="miter"),e.fillText(i.note,i.computed.text[0],i.computed.text[1]))}),e.restore())};const di=11102230246251565e-32,Fn=134217729,ale=(3+8*di)*di;function Fh(e,t,n,r,i){let a,o,s,l,c=t[0],u=r[0],d=0,f=0;u>c==u>-c?(a=c,c=t[++d]):(a=u,u=r[++f]);let h=0;if(d<e&&f<n)for(u>c==u>-c?(o=c+a,s=a-(o-c),c=t[++d]):(o=u+a,s=a-(o-u),u=r[++f]),a=o,s!==0&&(i[h++]=s);d<e&&f<n;)u>c==u>-c?(o=a+c,l=o-a,s=a-(o-l)+(c-l),c=t[++d]):(o=a+u,l=o-a,s=a-(o-l)+(u-l),u=r[++f]),a=o,s!==0&&(i[h++]=s);for(;d<e;)o=a+c,l=o-a,s=a-(o-l)+(c-l),c=t[++d],a=o,s!==0&&(i[h++]=s);for(;f<n;)o=a+u,l=o-a,s=a-(o-l)+(u-l),u=r[++f],a=o,s!==0&&(i[h++]=s);return(a!==0||h===0)&&(i[h++]=a),h}function ole(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function Wl(e){return new Float64Array(e)}const sle=(3+16*di)*di,lle=(2+12*di)*di,cle=(9+64*di)*di*di,Ya=Wl(4),AS=Wl(8),NS=Wl(12),jS=Wl(16),Kn=Wl(4);function ule(e,t,n,r,i,a,o){let s,l,c,u,d,f,h,p,m,v,b,y,x,C,S,w,O,E;const _=e-i,T=n-i,R=t-a,F=r-a;C=_*F,f=Fn*_,h=f-(f-_),p=_-h,f=Fn*F,m=f-(f-F),v=F-m,S=p*v-(C-h*m-p*m-h*v),w=R*T,f=Fn*R,h=f-(f-R),p=R-h,f=Fn*T,m=f-(f-T),v=T-m,O=p*v-(w-h*m-p*m-h*v),b=S-O,d=S-b,Ya[0]=S-(b+d)+(d-O),y=C+b,d=y-C,x=C-(y-d)+(b-d),b=x-w,d=x-b,Ya[1]=x-(b+d)+(d-w),E=y+b,d=E-y,Ya[2]=y-(E-d)+(b-d),Ya[3]=E;let I=ole(4,Ya),P=lle*o;if(I>=P||-I>=P||(d=e-_,s=e-(_+d)+(d-i),d=n-T,c=n-(T+d)+(d-i),d=t-R,l=t-(R+d)+(d-a),d=r-F,u=r-(F+d)+(d-a),s===0&&l===0&&c===0&&u===0)||(P=cle*o+ale*Math.abs(I),I+=_*u+F*s-(R*c+T*l),I>=P||-I>=P))return I;C=s*F,f=Fn*s,h=f-(f-s),p=s-h,f=Fn*F,m=f-(f-F),v=F-m,S=p*v-(C-h*m-p*m-h*v),w=l*T,f=Fn*l,h=f-(f-l),p=l-h,f=Fn*T,m=f-(f-T),v=T-m,O=p*v-(w-h*m-p*m-h*v),b=S-O,d=S-b,Kn[0]=S-(b+d)+(d-O),y=C+b,d=y-C,x=C-(y-d)+(b-d),b=x-w,d=x-b,Kn[1]=x-(b+d)+(d-w),E=y+b,d=E-y,Kn[2]=y-(E-d)+(b-d),Kn[3]=E;const j=Fh(4,Ya,4,Kn,AS);C=_*u,f=Fn*_,h=f-(f-_),p=_-h,f=Fn*u,m=f-(f-u),v=u-m,S=p*v-(C-h*m-p*m-h*v),w=R*c,f=Fn*R,h=f-(f-R),p=R-h,f=Fn*c,m=f-(f-c),v=c-m,O=p*v-(w-h*m-p*m-h*v),b=S-O,d=S-b,Kn[0]=S-(b+d)+(d-O),y=C+b,d=y-C,x=C-(y-d)+(b-d),b=x-w,d=x-b,Kn[1]=x-(b+d)+(d-w),E=y+b,d=E-y,Kn[2]=y-(E-d)+(b-d),Kn[3]=E;const A=Fh(j,AS,4,Kn,NS);C=s*u,f=Fn*s,h=f-(f-s),p=s-h,f=Fn*u,m=f-(f-u),v=u-m,S=p*v-(C-h*m-p*m-h*v),w=l*c,f=Fn*l,h=f-(f-l),p=l-h,f=Fn*c,m=f-(f-c),v=c-m,O=p*v-(w-h*m-p*m-h*v),b=S-O,d=S-b,Kn[0]=S-(b+d)+(d-O),y=C+b,d=y-C,x=C-(y-d)+(b-d),b=x-w,d=x-b,Kn[1]=x-(b+d)+(d-w),E=y+b,d=E-y,Kn[2]=y-(E-d)+(b-d),Kn[3]=E;const M=Fh(A,NS,4,Kn,jS);return jS[M-1]}function _c(e,t,n,r,i,a){const o=(t-a)*(n-i),s=(e-i)*(r-a),l=o-s,c=Math.abs(o+s);return Math.abs(l)>=sle*c?l:-ule(e,t,n,r,i,a,c)}const LS=Math.pow(2,-52),Ec=new Uint32Array(512);class ju{static from(t,n=gle,r=mle){const i=t.length,a=new Float64Array(i*2);for(let o=0;o<i;o++){const s=t[o];a[2*o]=n(s),a[2*o+1]=r(s)}return new ju(a)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:a}=this,o=t.length>>1;let s=1/0,l=1/0,c=-1/0,u=-1/0;for(let _=0;_<o;_++){const T=t[2*_],R=t[2*_+1];T<s&&(s=T),R<l&&(l=R),T>c&&(c=T),R>u&&(u=R),this._ids[_]=_}const d=(s+c)/2,f=(l+u)/2;let h,p,m;for(let _=0,T=1/0;_<o;_++){const R=zh(d,f,t[2*_],t[2*_+1]);R<T&&(h=_,T=R)}const v=t[2*h],b=t[2*h+1];for(let _=0,T=1/0;_<o;_++){if(_===h)continue;const R=zh(v,b,t[2*_],t[2*_+1]);R<T&&R>0&&(p=_,T=R)}let y=t[2*p],x=t[2*p+1],C=1/0;for(let _=0;_<o;_++){if(_===h||_===p)continue;const T=hle(v,b,y,x,t[2*_],t[2*_+1]);T<C&&(m=_,C=T)}let S=t[2*m],w=t[2*m+1];if(C===1/0){for(let R=0;R<o;R++)this._dists[R]=t[2*R]-t[0]||t[2*R+1]-t[1];io(this._ids,this._dists,0,o-1);const _=new Uint32Array(o);let T=0;for(let R=0,F=-1/0;R<o;R++){const I=this._ids[R],P=this._dists[I];P>F&&(_[T++]=I,F=P)}this.hull=_.subarray(0,T),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(_c(v,b,y,x,S,w)<0){const _=p,T=y,R=x;p=m,y=S,x=w,m=_,S=T,w=R}const O=vle(v,b,y,x,S,w);this._cx=O.x,this._cy=O.y;for(let _=0;_<o;_++)this._dists[_]=zh(t[2*_],t[2*_+1],O.x,O.y);io(this._ids,this._dists,0,o-1),this._hullStart=h;let E=3;r[h]=n[m]=p,r[p]=n[h]=m,r[m]=n[p]=h,i[h]=0,i[p]=1,i[m]=2,a.fill(-1),a[this._hashKey(v,b)]=h,a[this._hashKey(y,x)]=p,a[this._hashKey(S,w)]=m,this.trianglesLen=0,this._addTriangle(h,p,m,-1,-1,-1);for(let _=0,T,R;_<this._ids.length;_++){const F=this._ids[_],I=t[2*F],P=t[2*F+1];if(_>0&&Math.abs(I-T)<=LS&&Math.abs(P-R)<=LS||(T=I,R=P,F===h||F===p||F===m))continue;let j=0;for(let D=0,V=this._hashKey(I,P);D<this._hashSize&&(j=a[(V+D)%this._hashSize],!(j!==-1&&j!==r[j]));D++);j=n[j];let A=j,M;for(;M=r[A],_c(I,P,t[2*A],t[2*A+1],t[2*M],t[2*M+1])>=0;)if(A=M,A===j){A=-1;break}if(A===-1)continue;let N=this._addTriangle(A,F,r[A],-1,-1,i[A]);i[F]=this._legalize(N+2),i[A]=N,E++;let L=r[A];for(;M=r[L],_c(I,P,t[2*L],t[2*L+1],t[2*M],t[2*M+1])<0;)N=this._addTriangle(L,F,M,i[F],-1,i[L]),i[F]=this._legalize(N+2),r[L]=L,E--,L=M;if(A===j)for(;M=n[A],_c(I,P,t[2*M],t[2*M+1],t[2*A],t[2*A+1])<0;)N=this._addTriangle(M,F,A,-1,i[A],i[M]),this._legalize(N+2),i[M]=N,r[A]=A,E--,A=M;this._hullStart=n[F]=A,r[A]=n[L]=F,r[F]=L,a[this._hashKey(I,P)]=F,a[this._hashKey(t[2*A],t[2*A+1])]=A}this.hull=new Uint32Array(E);for(let _=0,T=this._hullStart;_<E;_++)this.hull[_]=T,T=r[T];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(dle(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:r,coords:i}=this;let a=0,o=0;for(;;){const s=r[t],l=t-t%3;if(o=l+(t+2)%3,s===-1){if(a===0)break;t=Ec[--a];continue}const c=s-s%3,u=l+(t+1)%3,d=c+(s+2)%3,f=n[o],h=n[t],p=n[u],m=n[d];if(fle(i[2*f],i[2*f+1],i[2*h],i[2*h+1],i[2*p],i[2*p+1],i[2*m],i[2*m+1])){n[t]=m,n[s]=f;const b=r[d];if(b===-1){let x=this._hullStart;do{if(this._hullTri[x]===d){this._hullTri[x]=t;break}x=this._hullPrev[x]}while(x!==this._hullStart)}this._link(t,b),this._link(s,r[o]),this._link(o,d);const y=c+(s+1)%3;a<Ec.length&&(Ec[a++]=y)}else{if(a===0)break;t=Ec[--a]}}return o}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,r,i,a,o){const s=this.trianglesLen;return this._triangles[s]=t,this._triangles[s+1]=n,this._triangles[s+2]=r,this._link(s,i),this._link(s+1,a),this._link(s+2,o),this.trianglesLen+=3,s}}function dle(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function zh(e,t,n,r){const i=e-n,a=t-r;return i*i+a*a}function fle(e,t,n,r,i,a,o,s){const l=e-o,c=t-s,u=n-o,d=r-s,f=i-o,h=a-s,p=l*l+c*c,m=u*u+d*d,v=f*f+h*h;return l*(d*v-m*h)-c*(u*v-m*f)+p*(u*h-d*f)<0}function hle(e,t,n,r,i,a){const o=n-e,s=r-t,l=i-e,c=a-t,u=o*o+s*s,d=l*l+c*c,f=.5/(o*c-s*l),h=(c*u-s*d)*f,p=(o*d-l*u)*f;return h*h+p*p}function vle(e,t,n,r,i,a){const o=n-e,s=r-t,l=i-e,c=a-t,u=o*o+s*s,d=l*l+c*c,f=.5/(o*c-s*l),h=e+(c*u-s*d)*f,p=t+(o*d-l*u)*f;return{x:h,y:p}}function io(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const a=e[i],o=t[a];let s=i-1;for(;s>=n&&t[e[s]]>o;)e[s+1]=e[s--];e[s+1]=a}else{const i=n+r>>1;let a=n+1,o=r;xs(e,i,a),t[e[n]]>t[e[r]]&&xs(e,n,r),t[e[a]]>t[e[r]]&&xs(e,a,r),t[e[n]]>t[e[a]]&&xs(e,n,a);const s=e[a],l=t[s];for(;;){do a++;while(t[e[a]]<l);do o--;while(t[e[o]]>l);if(o<a)break;xs(e,a,o)}e[n+1]=e[o],e[o]=s,r-a+1>=o-n?(io(e,t,a,r),io(e,t,n,o-1)):(io(e,t,n,o-1),io(e,t,a,r))}}function xs(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function gle(e){return e[0]}function mle(e){return e[1]}const kS=1e-6;class aa{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,r){t=+t,n=+n,r=+r;const i=t+r,a=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${a}`:(Math.abs(this._x1-i)>kS||Math.abs(this._y1-a)>kS)&&(this._+="L"+i+","+a),r&&(this._+=`A${r},${r},0,1,1,${t-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=a}`)}rect(t,n,r,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class Hg{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}class ple{constructor(t,[n,r,i,a]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((a=+a)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=n,this.ymax=a,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:r},vectors:i}=this;let a,o;const s=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let m=0,v=0,b=r.length,y,x;m<b;m+=3,v+=2){const C=r[m]*2,S=r[m+1]*2,w=r[m+2]*2,O=t[C],E=t[C+1],_=t[S],T=t[S+1],R=t[w],F=t[w+1],I=_-O,P=T-E,j=R-O,A=F-E,M=(I*A-P*j)*2;if(Math.abs(M)<1e-9){if(a===void 0){a=o=0;for(const L of n)a+=t[L*2],o+=t[L*2+1];a/=n.length,o/=n.length}const N=1e9*Math.sign((a-O)*A-(o-E)*j);y=(O+R)/2-N*A,x=(E+F)/2+N*j}else{const N=1/M,L=I*I+P*P,D=j*j+A*A;y=O+(A*L-P*D)*N,x=E+(I*D-j*L)*N}s[v]=y,s[v+1]=x}let l=n[n.length-1],c,u=l*4,d,f=t[2*l],h,p=t[2*l+1];i.fill(0);for(let m=0;m<n.length;++m)l=n[m],c=u,d=f,h=p,u=l*4,f=t[2*l],p=t[2*l+1],i[c+2]=i[u]=h-p,i[c+3]=i[u+1]=f-d}render(t){const n=t==null?t=new aa:void 0,{delaunay:{halfedges:r,inedges:i,hull:a},circumcenters:o,vectors:s}=this;if(a.length<=1)return null;for(let u=0,d=r.length;u<d;++u){const f=r[u];if(f<u)continue;const h=Math.floor(u/3)*2,p=Math.floor(f/3)*2,m=o[h],v=o[h+1],b=o[p],y=o[p+1];this._renderSegment(m,v,b,y,t)}let l,c=a[a.length-1];for(let u=0;u<a.length;++u){l=c,c=a[u];const d=Math.floor(i[c]/3)*2,f=o[d],h=o[d+1],p=l*4,m=this._project(f,h,s[p+2],s[p+3]);m&&this._renderSegment(f,h,m[0],m[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new aa:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const r=n==null?n=new aa:void 0,i=this._clip(t);if(i===null||!i.length)return;n.moveTo(i[0],i[1]);let a=i.length;for(;i[0]===i[a-2]&&i[1]===i[a-1]&&a>1;)a-=2;for(let o=2;o<a;o+=2)(i[o]!==i[o-2]||i[o+1]!==i[o-1])&&n.lineTo(i[o],i[o+1]);return n.closePath(),r&&r.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,r=t.length/2;n<r;++n){const i=this.cellPolygon(n);i&&(i.index=n,yield i)}}cellPolygon(t){const n=new Hg;return this.renderCell(t,n),n.value()}_renderSegment(t,n,r,i,a){let o;const s=this._regioncode(t,n),l=this._regioncode(r,i);s===0&&l===0?(a.moveTo(t,n),a.lineTo(r,i)):(o=this._clipSegment(t,n,r,i,s,l))&&(a.moveTo(o[0],o[1]),a.lineTo(o[2],o[3]))}contains(t,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(t,n,r)===t}*neighbors(t){const n=this._clip(t);if(n)for(const r of this.delaunay.neighbors(t)){const i=this._clip(r);if(i){e:for(let a=0,o=n.length;a<o;a+=2)for(let s=0,l=i.length;s<l;s+=2)if(n[a]===i[s]&&n[a+1]===i[s+1]&&n[(a+2)%o]===i[(s+l-2)%l]&&n[(a+3)%o]===i[(s+l-1)%l]){yield r;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:a}}=this,o=r[t];if(o===-1)return null;const s=[];let l=o;do{const c=Math.floor(l/3);if(s.push(n[c*2],n[c*2+1]),l=l%3===2?l-2:l+1,a[l]!==t)break;l=i[l]}while(l!==o&&l!==-1);return s}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:r}=this,i=t*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(t,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(t,n))}_clipFinite(t,n){const r=n.length;let i=null,a,o,s=n[r-2],l=n[r-1],c,u=this._regioncode(s,l),d,f=0;for(let h=0;h<r;h+=2)if(a=s,o=l,s=n[h],l=n[h+1],c=u,u=this._regioncode(s,l),c===0&&u===0)d=f,f=0,i?i.push(s,l):i=[s,l];else{let p,m,v,b,y;if(c===0){if((p=this._clipSegment(a,o,s,l,c,u))===null)continue;[m,v,b,y]=p}else{if((p=this._clipSegment(s,l,a,o,u,c))===null)continue;[b,y,m,v]=p,d=f,f=this._edgecode(m,v),d&&f&&this._edge(t,d,f,i,i.length),i?i.push(m,v):i=[m,v]}d=f,f=this._edgecode(b,y),d&&f&&this._edge(t,d,f,i,i.length),i?i.push(b,y):i=[b,y]}if(i)d=f,f=this._edgecode(i[0],i[1]),d&&f&&this._edge(t,d,f,i,i.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(t,n,r,i,a,o){const s=a<o;for(s&&([t,n,r,i,a,o]=[r,i,t,n,o,a]);;){if(a===0&&o===0)return s?[r,i,t,n]:[t,n,r,i];if(a&o)return null;let l,c,u=a||o;u&8?(l=t+(r-t)*(this.ymax-n)/(i-n),c=this.ymax):u&4?(l=t+(r-t)*(this.ymin-n)/(i-n),c=this.ymin):u&2?(c=n+(i-n)*(this.xmax-t)/(r-t),l=this.xmax):(c=n+(i-n)*(this.xmin-t)/(r-t),l=this.xmin),a?(t=l,n=c,a=this._regioncode(t,n)):(r=l,i=c,o=this._regioncode(r,i))}}_clipInfinite(t,n,r,i,a,o){let s=Array.from(n),l;if((l=this._project(s[0],s[1],r,i))&&s.unshift(l[0],l[1]),(l=this._project(s[s.length-2],s[s.length-1],a,o))&&s.push(l[0],l[1]),s=this._clipFinite(t,s))for(let c=0,u=s.length,d,f=this._edgecode(s[u-2],s[u-1]);c<u;c+=2)d=f,f=this._edgecode(s[c],s[c+1]),d&&f&&(c=this._edge(t,d,f,s,c),u=s.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(t,n,r,i,a){for(;n!==r;){let o,s;switch(n){case 5:n=4;continue;case 4:n=6,o=this.xmax,s=this.ymin;break;case 6:n=2;continue;case 2:n=10,o=this.xmax,s=this.ymax;break;case 10:n=8;continue;case 8:n=9,o=this.xmin,s=this.ymax;break;case 9:n=1;continue;case 1:n=5,o=this.xmin,s=this.ymin;break}(i[a]!==o||i[a+1]!==s)&&this.contains(t,o,s)&&(i.splice(a,0,o,s),a+=2)}return a}_project(t,n,r,i){let a=1/0,o,s,l;if(i<0){if(n<=this.ymin)return null;(o=(this.ymin-n)/i)<a&&(l=this.ymin,s=t+(a=o)*r)}else if(i>0){if(n>=this.ymax)return null;(o=(this.ymax-n)/i)<a&&(l=this.ymax,s=t+(a=o)*r)}if(r>0){if(t>=this.xmax)return null;(o=(this.xmax-t)/r)<a&&(s=this.xmax,l=n+(a=o)*i)}else if(r<0){if(t<=this.xmin)return null;(o=(this.xmin-t)/r)<a&&(s=this.xmin,l=n+(a=o)*i)}return[s,l]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const r=(n+2)%t.length,i=(n+4)%t.length;(t[n]===t[r]&&t[r]===t[i]||t[n+1]===t[r+1]&&t[r+1]===t[i+1])&&(t.splice(r,2),n-=2)}t.length||(t=null)}return t}}const ble=2*Math.PI,Xa=Math.pow;function yle(e){return e[0]}function xle(e){return e[1]}function Sle(e){const{triangles:t,coords:n}=e;for(let r=0;r<t.length;r+=3){const i=2*t[r],a=2*t[r+1],o=2*t[r+2];if((n[o]-n[i])*(n[a+1]-n[i+1])-(n[a]-n[i])*(n[o+1]-n[i+1])>1e-10)return!1}return!0}function Cle(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class m0{static from(t,n=yle,r=xle,i){return new m0("length"in t?wle(t,n,r,i):Float64Array.from($le(t,n,r,i)))}constructor(t){this._delaunator=new ju(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&Sle(t)){this.collinear=Int32Array.from({length:n.length/2},(f,h)=>h).sort((f,h)=>n[2*f]-n[2*h]||n[2*f+1]-n[2*h+1]);const l=this.collinear[0],c=this.collinear[this.collinear.length-1],u=[n[2*l],n[2*l+1],n[2*c],n[2*c+1]],d=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let f=0,h=n.length/2;f<h;++f){const p=Cle(n[2*f],n[2*f+1],d);n[2*f]=p[0],n[2*f+1]=p[1]}this._delaunator=new ju(n)}else delete this.collinear;const r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,a=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),s=this._hullIndex.fill(-1);for(let l=0,c=r.length;l<c;++l){const u=a[l%3===2?l-2:l+1];(r[l]===-1||o[u]===-1)&&(o[u]=l)}for(let l=0,c=i.length;l<c;++l)s[i[l]]=l;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],o[i[0]]=1,i.length===2&&(o[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new ple(this,t)}*neighbors(t){const{inedges:n,hull:r,_hullIndex:i,halfedges:a,triangles:o,collinear:s}=this;if(s){const d=s.indexOf(t);d>0&&(yield s[d-1]),d<s.length-1&&(yield s[d+1]);return}const l=n[t];if(l===-1)return;let c=l,u=-1;do{if(yield u=o[c],c=c%3===2?c-2:c+1,o[c]!==t)return;if(c=a[c],c===-1){const d=r[(i[t]+1)%r.length];d!==u&&(yield d);return}}while(c!==l)}find(t,n,r=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const i=r;let a;for(;(a=this._step(r,t,n))>=0&&a!==r&&a!==i;)r=a;return a}_step(t,n,r){const{inedges:i,hull:a,_hullIndex:o,halfedges:s,triangles:l,points:c}=this;if(i[t]===-1||!c.length)return(t+1)%(c.length>>1);let u=t,d=Xa(n-c[t*2],2)+Xa(r-c[t*2+1],2);const f=i[t];let h=f;do{let p=l[h];const m=Xa(n-c[p*2],2)+Xa(r-c[p*2+1],2);if(m<d&&(d=m,u=p),h=h%3===2?h-2:h+1,l[h]!==t)break;if(h=s[h],h===-1){if(h=a[(o[t]+1)%a.length],h!==p&&Xa(n-c[h*2],2)+Xa(r-c[h*2+1],2)<d)return h;break}}while(h!==f);return u}render(t){const n=t==null?t=new aa:void 0,{points:r,halfedges:i,triangles:a}=this;for(let o=0,s=i.length;o<s;++o){const l=i[o];if(l<o)continue;const c=a[o]*2,u=a[l]*2;t.moveTo(r[c],r[c+1]),t.lineTo(r[u],r[u+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const r=t==null?t=new aa:void 0,{points:i}=this;for(let a=0,o=i.length;a<o;a+=2){const s=i[a],l=i[a+1];t.moveTo(s+n,l),t.arc(s,l,n,0,ble)}return r&&r.value()}renderHull(t){const n=t==null?t=new aa:void 0,{hull:r,points:i}=this,a=r[0]*2,o=r.length;t.moveTo(i[a],i[a+1]);for(let s=1;s<o;++s){const l=2*r[s];t.lineTo(i[l],i[l+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new Hg;return this.renderHull(t),t.value()}renderTriangle(t,n){const r=n==null?n=new aa:void 0,{points:i,triangles:a}=this,o=a[t*=3]*2,s=a[t+1]*2,l=a[t+2]*2;return n.moveTo(i[o],i[o+1]),n.lineTo(i[s],i[s+1]),n.lineTo(i[l],i[l+1]),n.closePath(),r&&r.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,r=t.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new Hg;return this.renderTriangle(t,n),n.value()}}function wle(e,t,n,r){const i=e.length,a=new Float64Array(i*2);for(let o=0;o<i;++o){const s=e[o];a[o*2]=t.call(r,s,o,e),a[o*2+1]=n.call(r,s,o,e)}return a}function*$le(e,t,n,r){let i=0;for(const a of e)yield t.call(r,a,i,e),yield n.call(r,a,i,e),++i}var p0=function(e){return[e.x,e.y]},Hl=oO,CM="cursor",wM="top",_le=function(e){var t=e.points,n=e.getNodePosition,r=n===void 0?p0:n,i=e.margin,a=i===void 0?Hl:i;return t.map(function(o){var s=r(o),l=s[0],c=s[1];return[l+a.left,c+a.top]})},Ele=function(e){var t=e.points,n=e.width,r=e.height,i=e.margin,a=i===void 0?Hl:i,o=e.debug,s=m0.from(t),l=o?s.voronoi([0,0,a.left+n+a.right,a.top+r+a.bottom]):void 0;return{points:t,delaunay:s,voronoi:l}},b0=function(e){var t=e.points,n=e.getNodePosition,r=n===void 0?p0:n,i=e.width,a=e.height,o=e.margin,s=o===void 0?Hl:o,l=e.debug;return $.useMemo(function(){return Ele({points:_le({points:t,margin:s,getNodePosition:r}),width:i,height:a,margin:s,debug:l})},[t,i,a,s,l])},Ole=function(e){var t=e.elementRef,n=e.nodes,r=e.getNodePosition,i=r===void 0?p0:r,a=e.delaunay,o=e.setCurrent,s=e.margin,l=s===void 0?Hl:s,c=e.detectionRadius,u=c===void 0?1/0:c,d=e.isInteractive,f=d===void 0||d,h=e.onMouseEnter,p=e.onMouseMove,m=e.onMouseLeave,v=e.onClick,b=e.onTouchStart,y=e.onTouchMove,x=e.onTouchEnd,C=e.enableTouchCrosshair,S=C!==void 0&&C,w=e.tooltip,O=e.tooltipPosition,E=O===void 0?CM:O,_=e.tooltipAnchor,T=_===void 0?wM:_,R=$.useState(null),F=R[0],I=R[1],P=$.useRef(null);$.useEffect(function(){P.current=F},[P,F]);var j=$.useCallback(function(Y){if(!t.current)return null;var W=c0(t.current,Y),H=W[0],U=W[1],z=a.find(H,U),ne=z!==void 0?n[z]:null;if(ne&&u!==1/0){var B=i(ne),re=B[0],ie=B[1];zee(H,U,re+l.left,ie+l.top)>u&&(z=null,ne=null)}return z===null||ne===null?null:[z,ne]},[t,a,n,i,l,u]),A=Wr(),M=A.showTooltipAt,N=A.showTooltipFromEvent,L=A.hideTooltip,D=$.useMemo(function(){if(w)return E==="cursor"?function(Y,W){N(w(Y),W,T)}:function(Y){var W=i(Y),H=W[0],U=W[1];M(w(Y),[H+l.left,U+l.top],T)}},[M,N,w,E,T,i,l]),V=$.useCallback(function(Y){var W=j(Y);if(I(W),o==null||o(W?W[1]:null),W){var H=W[1];D==null||D(H,Y),h==null||h(W[1],Y)}},[j,I,o,D,h]),X=$.useCallback(function(Y){var W=j(Y);if(I(W),W){var H=W[0],U=W[1];if(o==null||o(U),D==null||D(U,Y),P.current){var z=P.current,ne=z[0],B=z[1];H!==ne?m==null||m(B,Y):p==null||p(U,Y)}else h==null||h(U,Y)}else o==null||o(null),L==null||L(),P.current&&(m==null||m(P.current[1],Y))},[j,I,P,h,p,m,D,L]),q=$.useCallback(function(Y){I(null),o==null||o(null),L(),m&&P.current&&m(P.current[1],Y)},[I,o,P,L,m]),Z=$.useCallback(function(Y){var W=j(Y);I(W),W&&(v==null||v(W[1],Y))},[j,I,v]),J=$.useCallback(function(Y){var W=j(Y);S&&(I(W),o==null||o(W?W[1]:null)),W&&(b==null||b(W[1],Y))},[j,I,o,S,b]),Q=$.useCallback(function(Y){var W=j(Y);S&&(I(W),o==null||o(W?W[1]:null)),W&&(y==null||y(W[1],Y))},[j,I,o,S,y]),K=$.useCallback(function(Y){S&&(I(null),o==null||o(null)),x&&P.current&&x(P.current[1],Y)},[S,I,o,x,P]);return{current:F,handleMouseEnter:f?V:void 0,handleMouseMove:f?X:void 0,handleMouseLeave:f?q:void 0,handleClick:f?Z:void 0,handleTouchStart:f?J:void 0,handleTouchMove:f?Q:void 0,handleTouchEnd:f?K:void 0}},$M=function(e){var t=e.nodes,n=e.width,r=e.height,i=e.margin,a=i===void 0?Hl:i,o=e.getNodePosition,s=e.setCurrent,l=e.onMouseEnter,c=e.onMouseMove,u=e.onMouseLeave,d=e.onClick,f=e.onTouchStart,h=e.onTouchMove,p=e.onTouchEnd,m=e.enableTouchCrosshair,v=m!==void 0&&m,b=e.detectionRadius,y=b===void 0?1/0:b,x=e.tooltip,C=e.tooltipPosition,S=C===void 0?CM:C,w=e.tooltipAnchor,O=w===void 0?wM:w,E=e.debug,_=$.useRef(null),T=b0({points:t,getNodePosition:o,width:n,height:r,margin:a,debug:E}),R=T.delaunay,F=T.voronoi,I=Ole({elementRef:_,nodes:t,delaunay:R,margin:a,detectionRadius:y,setCurrent:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onTouchStart:f,onTouchMove:h,onTouchEnd:p,enableTouchCrosshair:v,tooltip:x,tooltipPosition:S,tooltipAnchor:O}),P=I.current,j=I.handleMouseEnter,A=I.handleMouseMove,M=I.handleMouseLeave,N=I.handleClick,L=I.handleTouchStart,D=I.handleTouchMove,V=I.handleTouchEnd,X=$.useMemo(function(){if(E&&F)return F.render()},[E,F]);return k.jsxs("g",{ref:_,transform:"translate("+-a.left+","+-a.top+")",children:[E&&F&&k.jsxs(k.Fragment,{children:[k.jsx("path",{d:X,stroke:"red",strokeWidth:1,opacity:.75}),y<1/0&&k.jsx("path",{stroke:"red",strokeWidth:.35,fill:"none",d:R.renderPoints(void 0,y)}),P&&k.jsx("path",{fill:"pink",opacity:.35,d:F.renderCell(P[0])})]}),k.jsx("rect",{"data-ref":"mesh-interceptor",width:a.left+n+a.right,height:a.top+r+a.bottom,fill:"red",opacity:0,style:{cursor:"auto"},onMouseEnter:j,onMouseMove:A,onMouseLeave:M,onTouchStart:L,onTouchMove:D,onTouchEnd:V,onClick:N})]})},_M=function(e,t){e.save(),e.globalAlpha=.75,e.beginPath(),t.render(e),e.strokeStyle="red",e.lineWidth=1,e.stroke(),e.restore()},EM=function(e,t,n){e.save(),e.globalAlpha=.35,e.beginPath(),t.renderCell(n,e),e.fillStyle="pink",e.fill(),e.restore()};function dr(){return dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dr.apply(this,arguments)}function OM(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var Mle=function(e){if(typeof e=="function")return e;if(Bg(e))return function(){return e};if(function(n){return xd(n)}(e)){if(!H_(e.key))throw new Error("symbolSize is invalid, key should be a string pointing to the property to use to determine node size");if(!Array.isArray(e.values)||e.values.length!==2)throw new Error("symbolSize is invalid, values spec should be an array containing two values, min and max");if(!Array.isArray(e.sizes)||e.sizes.length!==2)throw new Error("symbolSize is invalid, sizes spec should be an array containing two values, min and max");var t=Np().domain([e.values[0],e.values[1]]).range([e.sizes[0],e.sizes[1]]);return function(n){return t(Vr(n,e.key))}}throw new Error("nodeSize is invalid, it should be either a function, a number or an object")},MM=function(e){var t,n=e.data,r=e.xScaleSpec,i=e.xFormat,a=e.yScaleSpec,o=e.yFormat,s=e.width,l=e.height,c=e.nodeId,u=e.nodeSize,d=e.colors,f=$.useMemo(function(){return uM(n,r,a,s,l)},[n,r,a,s,l]),h=f.series,p=f.xScale,m=f.yScale,v=Li(i),b=Li(o),y=Yr(c),x=$.useMemo(function(){return function(w){var O=w.series,E=w.formatX,_=w.formatY,T=w.getNodeId,R=[];return O.forEach(function(F){F.data.forEach(function(I,P){var j={index:R.length,serieIndex:P,serieId:F.id,x:I.position.x,xValue:I.data.x,formattedX:E(I.data.x),y:I.position.y,yValue:I.data.y,formattedY:_(I.data.y),data:I.data};R.push(dr({},j,{id:T(j)}))})}),R}({series:h,formatX:v,formatY:b,getNodeId:y})},[h,v,b,y]),C=$.useMemo(function(){return Mle(t)},[t=u]),S=Vl(d,"serieId");return{xScale:p,yScale:m,nodes:$.useMemo(function(){return x.map(function(w){return dr({},w,{size:C(w),color:S({serieId:w.serieId})})})},[x,C,S]),legendData:$.useMemo(function(){return h.map(function(w){return{id:w.id,label:w.id,color:S({serieId:w.id})}})},[h,S])}},TM=function(e,t){return Zse({data:e,annotations:t,getPosition:function(n){return{x:n.x,y:n.y}},getDimensions:function(n){return{size:n.size,width:n.size,height:n.size}}})},Tle=function(e){return e/2},RM={xScale:{type:"linear",min:0,max:"auto"},yScale:{type:"linear",min:0,max:"auto"},enableGridX:!0,enableGridY:!0,axisBottom:{},axisLeft:{},nodeId:function(e){return e.serieId+"."+e.index},nodeSize:9,nodeComponent:function(e){var t=e.node,n=e.style,r=e.blendMode,i=e.isInteractive,a=e.onMouseEnter,o=e.onMouseMove,s=e.onMouseLeave,l=e.onClick,c=$.useCallback(function(h){return a==null?void 0:a(t,h)},[t,a]),u=$.useCallback(function(h){return o==null?void 0:o(t,h)},[t,o]),d=$.useCallback(function(h){return s==null?void 0:s(t,h)},[t,s]),f=$.useCallback(function(h){return l==null?void 0:l(t,h)},[t,l]);return k.jsx(Tt.circle,{cx:n.x,cy:n.y,r:n.size.to(Tle),fill:n.color,style:{mixBlendMode:r},onMouseEnter:i?c:void 0,onMouseMove:i?u:void 0,onMouseLeave:i?d:void 0,onClick:i?f:void 0})},colors:{scheme:"nivo"},isInteractive:!0,debugMesh:!1,tooltip:function(e){var t=e.node;return k.jsx(So,{id:t.serieId,value:"x: "+t.formattedX+", y: "+t.formattedY,enableChip:!0,color:t.color})},markers:[],legends:[],annotations:[]},tn=dr({},RM,{blendMode:"normal",layers:["grid","axes","nodes","markers","mesh","legends","annotations"],role:"img",useMesh:!0,animate:!0,motionConfig:"default"}),zn=dr({},RM,{layers:["grid","axes","nodes","mesh","legends","annotations"],pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,renderNode:function(e,t){e.beginPath(),e.arc(t.x,t.y,t.size/2,0,2*Math.PI),e.fillStyle=t.color,e.fill()}}),Rle=function(e){var t=e.nodes,n=e.annotations,r=TM(t,n);return k.jsx(k.Fragment,{children:r.map(function(i,a){return k.jsx(rle,dr({},i),a)})})},Ple=function(e){return e.id},Bh=function(e){return{x:e.x,y:e.y,size:e.size,color:e.color}},Ile=function(e){return{x:e.x,y:e.y,size:0,color:e.color}},Ale=function(e){var t=e.nodes,n=e.nodeComponent,r=e.isInteractive,i=e.onMouseEnter,a=e.onMouseMove,o=e.onMouseLeave,s=e.onClick,l=e.tooltip,c=e.blendMode,u=Sn(),d=u.animate,f=u.config,h=$a(t,{keys:Ple,from:Bh,enter:Bh,update:Bh,leave:Ile,config:f,immediate:!d}),p=Wr(),m=p.showTooltipFromEvent,v=p.hideTooltip,b=$.useCallback(function(S,w){m($.createElement(l,{node:S}),w),i==null||i(S,w)},[l,m,i]),y=$.useCallback(function(S,w){m($.createElement(l,{node:S}),w),a==null||a(S,w)},[l,m,a]),x=$.useCallback(function(S,w){v(),o==null||o(S,w)},[v,o]),C=$.useCallback(function(S,w){return s==null?void 0:s(S,w)},[s]);return k.jsx(k.Fragment,{children:h(function(S,w){return $.createElement(n,{node:w,style:S,blendMode:c,isInteractive:r,onMouseEnter:r?b:void 0,onMouseMove:r?y:void 0,onMouseLeave:r?x:void 0,onClick:r?C:void 0})})})},Nle=function(e){var t=e.nodes,n=e.width,r=e.height,i=e.onMouseEnter,a=e.onMouseMove,o=e.onMouseLeave,s=e.onClick,l=e.tooltip,c=e.debug,u=Wr(),d=u.showTooltipFromEvent,f=u.hideTooltip,h=$.useCallback(function(b,y){d($.createElement(l,{node:b}),y),i&&i(b,y)},[d,l,i]),p=$.useCallback(function(b,y){d($.createElement(l,{node:b}),y),a&&a(b,y)},[d,l,a]),m=$.useCallback(function(b,y){f(),o&&o(b,y)},[f,o]),v=$.useCallback(function(b,y){s&&s(b,y)},[s]);return k.jsx($M,{nodes:t,width:n,height:r,onMouseEnter:h,onMouseMove:p,onMouseLeave:m,onClick:v,debug:c})},jle=["isInteractive","animate","motionConfig","theme","renderWrapper"],Lle=function(e){var t=e.data,n=e.xScale,r=n===void 0?tn.xScale:n,i=e.xFormat,a=e.yScale,o=a===void 0?tn.yScale:a,s=e.yFormat,l=e.width,c=e.height,u=e.margin,d=e.layers,f=d===void 0?tn.layers:d,h=e.colors,p=h===void 0?tn.colors:h,m=e.blendMode,v=m===void 0?tn.blendMode:m,b=e.nodeId,y=b===void 0?tn.nodeId:b,x=e.nodeSize,C=x===void 0?tn.nodeSize:x,S=e.nodeComponent,w=S===void 0?tn.nodeComponent:S,O=e.enableGridX,E=O===void 0?tn.enableGridX:O,_=e.enableGridY,T=_===void 0?tn.enableGridY:_,R=e.gridXValues,F=e.gridYValues,I=e.axisTop,P=e.axisRight,j=e.axisBottom,A=j===void 0?tn.axisBottom:j,M=e.axisLeft,N=M===void 0?tn.axisLeft:M,L=e.annotations,D=L===void 0?tn.annotations:L,V=e.isInteractive,X=V===void 0?tn.isInteractive:V,q=e.useMesh,Z=q===void 0?tn.useMesh:q,J=e.debugMesh,Q=J===void 0?tn.debugMesh:J,K=e.onMouseEnter,Y=e.onMouseMove,W=e.onMouseLeave,H=e.onClick,U=e.tooltip,z=U===void 0?tn.tooltip:U,ne=e.markers,B=ne===void 0?tn.markers:ne,re=e.legends,ie=re===void 0?tn.legends:re,ue=e.role,me=ue===void 0?tn.role:ue,ve=e.ariaLabel,be=e.ariaLabelledBy,Ce=e.ariaDescribedBy,ge=Ra(l,c,u),fe=ge.margin,se=ge.innerWidth,xe=ge.innerHeight,ce=ge.outerWidth,Ne=ge.outerHeight,Me=MM({data:t,xScaleSpec:r,xFormat:i,yScaleSpec:o,yFormat:s,width:se,height:xe,nodeId:y,nodeSize:C,colors:p}),Ie=Me.xScale,Le=Me.yScale,He=Me.nodes,Xe=Me.legendData,je=$.useMemo(function(){return{xScale:Ie,yScale:Le,nodes:He,margin:fe,innerWidth:se,innerHeight:xe,outerWidth:ce,outerHeight:Ne}},[Ie,Le,He,fe,se,xe,ce,Ne]),Oe={grid:null,axes:null,nodes:null,markers:null,mesh:null,annotations:null,legends:null};return f.includes("grid")&&(Oe.grid=k.jsx(yM,{width:se,height:xe,xScale:E?Ie:null,yScale:T?Le:null,xValues:R,yValues:F},"grid")),f.includes("axes")&&(Oe.axes=k.jsx(bM,{xScale:Ie,yScale:Le,width:se,height:xe,top:I,right:P,bottom:A,left:N},"axes")),f.includes("nodes")&&(Oe.nodes=k.jsx(Ale,{nodes:He,nodeComponent:w,isInteractive:X,tooltip:z,blendMode:v,onMouseEnter:K,onMouseMove:Y,onMouseLeave:W,onClick:H},"nodes")),f.includes("markers")&&(Oe.markers=k.jsx(yO,{markers:B,width:se,height:xe,xScale:Ie,yScale:Le},"markers")),f.includes("mesh")&&X&&Z&&(Oe.mesh=k.jsx(Nle,{nodes:He,width:se,height:xe,onMouseEnter:K,onMouseMove:Y,onMouseLeave:W,onClick:H,tooltip:z,debug:Q},"mesh")),f.includes("annotations")&&(Oe.annotations=k.jsx(Rle,{nodes:He,annotations:D},"annotations")),f.includes("legends")&&(Oe.legends=ie.map(function(nt,We){return k.jsx(vf,dr({},nt,{containerWidth:se,containerHeight:xe,data:Xe}),We)})),k.jsx(Zo,{width:ce,height:Ne,margin:fe,role:me,ariaLabel:ve,ariaLabelledBy:be,ariaDescribedBy:Ce,children:f.map(function(nt,We){if(typeof nt=="string"&&Oe[nt]!==void 0)return Oe[nt];if(typeof nt=="function")return k.jsx($.Fragment,{children:$.createElement(nt,je)},We);throw new Error("Unknown layer ("+nt+")")})})},kle=function(e){var t=e.isInteractive,n=t===void 0?tn.isInteractive:t,r=e.animate,i=r===void 0?tn.animate:r,a=e.motionConfig,o=a===void 0?tn.motionConfig:a,s=e.theme,l=e.renderWrapper,c=OM(e,jle);return k.jsx(Pa,{animate:i,isInteractive:n,motionConfig:o,renderWrapper:l,theme:s,children:k.jsx(Lle,dr({isInteractive:n},c))})},Dle=function(e){return k.jsx(Wi,{children:function(t){var n=t.width,r=t.height;return k.jsx(kle,dr({width:n,height:r},e))}})},Fle=["isInteractive","renderWrapper","theme"],zle=function(e){var t=e.data,n=e.xScale,r=n===void 0?zn.xScale:n,i=e.xFormat,a=e.yScale,o=a===void 0?zn.yScale:a,s=e.yFormat,l=e.width,c=e.height,u=e.margin,d=e.pixelRatio,f=d===void 0?zn.pixelRatio:d,h=e.layers,p=h===void 0?zn.layers:h,m=e.colors,v=m===void 0?zn.colors:m,b=e.nodeId,y=b===void 0?tn.nodeId:b,x=e.nodeSize,C=x===void 0?zn.nodeSize:x,S=e.renderNode,w=S===void 0?zn.renderNode:S,O=e.enableGridX,E=O===void 0?zn.enableGridX:O,_=e.gridXValues,T=e.enableGridY,R=T===void 0?zn.enableGridY:T,F=e.gridYValues,I=e.axisTop,P=e.axisRight,j=e.axisBottom,A=j===void 0?zn.axisBottom:j,M=e.axisLeft,N=M===void 0?zn.axisLeft:M,L=e.annotations,D=L===void 0?zn.annotations:L,V=e.isInteractive,X=V===void 0?zn.isInteractive:V,q=e.debugMesh,Z=q===void 0?zn.debugMesh:q,J=e.onMouseEnter,Q=e.onMouseMove,K=e.onMouseLeave,Y=e.onClick,W=e.tooltip,H=W===void 0?zn.tooltip:W,U=e.legends,z=U===void 0?zn.legends:U,ne=e.canvasRef,B=$.useRef(null),re=kt(),ie=$.useState(null),ue=ie[0],me=ie[1],ve=Ra(l,c,u),be=ve.margin,Ce=ve.innerWidth,ge=ve.innerHeight,fe=ve.outerWidth,se=ve.outerHeight,xe=MM({data:t,xScaleSpec:r,xFormat:i,yScaleSpec:o,yFormat:s,width:Ce,height:ge,nodeId:y,nodeSize:C,colors:v}),ce=xe.xScale,Ne=xe.yScale,Me=xe.nodes,Ie=xe.legendData,Le=TM(Me,D),He=b0({points:Me,width:Ce,height:ge,debug:Z}),Xe=He.delaunay,je=He.voronoi,Oe=$.useMemo(function(){return{xScale:ce,yScale:Ne,nodes:Me,margin:be,innerWidth:Ce,innerHeight:ge,outerWidth:fe,outerHeight:se}},[ce,Ne,Me,be,Ce,ge,fe,se]);$.useEffect(function(){if(B.current){B.current.width=fe*f,B.current.height=se*f;var De=B.current.getContext("2d");De.scale(f,f),De.fillStyle=re.background,De.fillRect(0,0,fe,se),De.translate(be.left,be.top),p.forEach(function(qe){if(qe==="grid")De.lineWidth=re.grid.line.strokeWidth,De.strokeStyle=re.grid.line.stroke,E&&Nu(De,{width:Ce,height:ge,scale:ce,axis:"x",values:_}),R&&Nu(De,{width:Ce,height:ge,scale:Ne,axis:"y",values:F});else if(qe==="annotations")ile(De,{annotations:Le,theme:re});else if(qe==="axes")xM(De,{xScale:ce,yScale:Ne,width:Ce,height:ge,top:I,right:P,bottom:A,left:N,theme:re});else if(qe==="nodes")Me.forEach(function(Qe){w(De,Qe)});else if(qe==="mesh")Z&&(_M(De,je),ue&&EM(De,je,ue.index));else if(qe==="legends")z.forEach(function(Qe){OO(De,dr({},Qe,{data:Ie,containerWidth:Ce,containerHeight:ge,theme:re}))});else{if(typeof qe!="function")throw new Error("Invalid layer: "+qe);qe(De,Oe)}})}},[B,Ce,ge,fe,se,be.top,be.left,f,w,p,Oe,re,ce,Ne,Me,E,R,I,P,A,N,z,Ie,Z,je,ue,Le]);var nt=Wr(),We=nt.showTooltipFromEvent,Be=nt.hideTooltip,Se=$.useCallback(function(De){var qe=c0(B.current,De),Qe=qe[0],Je=qe[1];if(!SO(be.left,be.top,Ce,ge,Qe,Je))return null;var rt=Xe.find(Qe-be.left,Je-be.top);return Me[rt]},[B,be,Ce,ge,Xe]),Fe=$.useCallback(function(De){var qe=Se(De);me(qe),qe?(We($.createElement(H,{node:qe}),De),ue&&ue.id!==qe.id&&(K&&K(ue,De),J&&J(qe,De)),ue||J&&J(qe,De),Q&&Q(qe,De)):(Be(),ue&&K&&K(ue,De))},[Se,ue,me,We,Be,H,J,Q,K]),ot=$.useCallback(function(De){Be(),me(null),ue&&K&&K(ue,De)},[Be,ue,me,K]),ct=$.useCallback(function(De){if(Y){var qe=Se(De);qe&&Y(qe,De)}},[Se,Y]);return k.jsx("canvas",{ref:function(De){B.current=De,ne&&"current"in ne&&(ne.current=De)},width:fe*f,height:se*f,style:{width:fe,height:se,cursor:X?"auto":"normal"},onMouseEnter:X?Fe:void 0,onMouseMove:X?Fe:void 0,onMouseLeave:X?ot:void 0,onClick:X?ct:void 0})},Ble=$.forwardRef(function(e,t){var n=e.isInteractive,r=e.renderWrapper,i=e.theme,a=OM(e,Fle);return k.jsx(Pa,{isInteractive:n,renderWrapper:r,theme:i,animate:!1,children:k.jsx(zle,dr({},a,{canvasRef:t}))})});$.forwardRef(function(e,t){return k.jsx(Wi,{children:function(n){var r=n.width,i=n.height;return k.jsx(Ble,dr({width:r,height:i},e,{ref:t}))}})});const Vle=({x1:e,x2:t,y1:n,y2:r})=>k.jsx("g",{children:k.jsx("line",{x1:e,y1:n,x2:t,y2:r,stroke:"red","stroke-width":"3"})}),Wle=({scatterPlotData:e,style:t={},margin:n={},axisBottom:r={},axisLeft:i={},tooltip:a=null})=>{const o=e==null?void 0:e.line,s=o==null?void 0:o.x1,l=o==null?void 0:o.y1,c=o==null?void 0:o.x2,u=o==null?void 0:o.y2;return k.jsxs(k.Fragment,{children:[k.jsx(On,{}),k.jsx("div",{style:{width:"100%",height:600,...t},children:k.jsx(Dle,{data:[e==null?void 0:e.points],margin:{top:20,right:120,bottom:100,left:120,...n},xScale:{type:"point"},axisBottom:{orient:"bottom",tickSize:5,tickPadding:5,tickRotation:0,legendPosition:"middle",legendOffset:46,truncateTickAt:0,legend:"axisBottom",...r},axisLeft:{orient:"left",tickSize:5,tickPadding:5,tickRotation:0,legendPosition:"middle",legendOffset:-60,truncateTickAt:0,legend:"axisLeft",...i},layers:["grid","markers","axes","nodes","legends",d=>k.jsx(Vle,{x1:d.xScale(s),y1:d.yScale(l),x2:d.xScale(c),y2:d.yScale(u)})],tooltip:({node:d})=>k.jsx(pi,{body:(a==null?void 0:a({node:d}))||k.jsx("span",{children:"Scatterplot tooltip"})})})})]})};function Hle(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}var Ule=Hle;function Gle(e){return function(t){return e==null?void 0:e[t]}}var qle=Gle,Kle=qle,Yle={À:"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"},Xle=Kle(Yle),Zle=Xle,Qle=Zle,Jle=Dl,ece=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,tce="\\u0300-\\u036f",nce="\\ufe20-\\ufe2f",rce="\\u20d0-\\u20ff",ice=tce+nce+rce,ace="["+ice+"]",oce=RegExp(ace,"g");function sce(e){return e=Jle(e),e&&e.replace(ece,Qle).replace(oce,"")}var lce=sce,cce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function uce(e){return e.match(cce)||[]}var dce=uce,fce=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function hce(e){return fce.test(e)}var vce=hce,PM="\\ud800-\\udfff",gce="\\u0300-\\u036f",mce="\\ufe20-\\ufe2f",pce="\\u20d0-\\u20ff",bce=gce+mce+pce,IM="\\u2700-\\u27bf",AM="a-z\\xdf-\\xf6\\xf8-\\xff",yce="\\xac\\xb1\\xd7\\xf7",xce="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Sce="\\u2000-\\u206f",Cce=" \\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",NM="A-Z\\xc0-\\xd6\\xd8-\\xde",wce="\\ufe0e\\ufe0f",jM=yce+xce+Sce+Cce,LM="['’]",DS="["+jM+"]",$ce="["+bce+"]",kM="\\d+",_ce="["+IM+"]",DM="["+AM+"]",FM="[^"+PM+jM+kM+IM+AM+NM+"]",Ece="\\ud83c[\\udffb-\\udfff]",Oce="(?:"+$ce+"|"+Ece+")",Mce="[^"+PM+"]",zM="(?:\\ud83c[\\udde6-\\uddff]){2}",BM="[\\ud800-\\udbff][\\udc00-\\udfff]",Qa="["+NM+"]",Tce="\\u200d",FS="(?:"+DM+"|"+FM+")",Rce="(?:"+Qa+"|"+FM+")",zS="(?:"+LM+"(?:d|ll|m|re|s|t|ve))?",BS="(?:"+LM+"(?:D|LL|M|RE|S|T|VE))?",VM=Oce+"?",WM="["+wce+"]?",Pce="(?:"+Tce+"(?:"+[Mce,zM,BM].join("|")+")"+WM+VM+")*",Ice="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ace="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Nce=WM+VM+Pce,jce="(?:"+[_ce,zM,BM].join("|")+")"+Nce,Lce=RegExp([Qa+"?"+DM+"+"+zS+"(?="+[DS,Qa,"$"].join("|")+")",Rce+"+"+BS+"(?="+[DS,Qa+FS,"$"].join("|")+")",Qa+"?"+FS+"+"+zS,Qa+"+"+BS,Ace,Ice,kM,jce].join("|"),"g");function kce(e){return e.match(Lce)||[]}var Dce=kce,Fce=dce,zce=vce,Bce=Dl,Vce=Dce;function Wce(e,t,n){return e=Bce(e),t=n?void 0:t,t===void 0?zce(e)?Vce(e):Fce(e):e.match(t)||[]}var Hce=Wce,Uce=Ule,Gce=lce,qce=Hce,Kce="['’]",Yce=RegExp(Kce,"g");function Xce(e){return function(t){return Uce(qce(Gce(t).replace(Yce,"")),e,"")}}var Zce=Xce,Qce=SM;function Jce(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Qce(e,t,n)}var eue=Jce,tue="\\ud800-\\udfff",nue="\\u0300-\\u036f",rue="\\ufe20-\\ufe2f",iue="\\u20d0-\\u20ff",aue=nue+rue+iue,oue="\\ufe0e\\ufe0f",sue="\\u200d",lue=RegExp("["+sue+tue+aue+oue+"]");function cue(e){return lue.test(e)}var HM=cue;function uue(e){return e.split("")}var due=uue,UM="\\ud800-\\udfff",fue="\\u0300-\\u036f",hue="\\ufe20-\\ufe2f",vue="\\u20d0-\\u20ff",gue=fue+hue+vue,mue="\\ufe0e\\ufe0f",pue="["+UM+"]",Ug="["+gue+"]",Gg="\\ud83c[\\udffb-\\udfff]",bue="(?:"+Ug+"|"+Gg+")",GM="[^"+UM+"]",qM="(?:\\ud83c[\\udde6-\\uddff]){2}",KM="[\\ud800-\\udbff][\\udc00-\\udfff]",yue="\\u200d",YM=bue+"?",XM="["+mue+"]?",xue="(?:"+yue+"(?:"+[GM,qM,KM].join("|")+")"+XM+YM+")*",Sue=XM+YM+xue,Cue="(?:"+[GM+Ug+"?",Ug,qM,KM,pue].join("|")+")",wue=RegExp(Gg+"(?="+Gg+")|"+Cue+Sue,"g");function $ue(e){return e.match(wue)||[]}var _ue=$ue,Eue=due,Oue=HM,Mue=_ue;function Tue(e){return Oue(e)?Mue(e):Eue(e)}var Rue=Tue,Pue=eue,Iue=HM,Aue=Rue,Nue=Dl;function jue(e){return function(t){t=Nue(t);var n=Iue(t)?Aue(t):void 0,r=n?n[0]:t.charAt(0),i=n?Pue(n,1).join(""):t.slice(1);return r[e]()+i}}var Lue=jue,kue=Lue,Due=kue("toUpperCase"),Fue=Due,zue=Zce,Bue=Fue,Vue=zue(function(e,t,n){return e+(n?" ":"")+Bue(t)}),Wue=Vue;const Hue=rn(Wue);function Uue(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function Gue(){return this.eachAfter(Uue)}function que(e){var t=this,n,r=[t],i,a,o;do for(n=r.reverse(),r=[];t=n.pop();)if(e(t),i=t.children,i)for(a=0,o=i.length;a<o;++a)r.push(i[a]);while(r.length);return this}function Kue(e){for(var t=this,n=[t],r,i;t=n.pop();)if(e(t),r=t.children,r)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}function Yue(e){for(var t=this,n=[t],r=[],i,a,o;t=n.pop();)if(r.push(t),i=t.children,i)for(a=0,o=i.length;a<o;++a)n.push(i[a]);for(;t=r.pop();)e(t);return this}function Xue(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function Zue(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Que(e){for(var t=this,n=Jue(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function Jue(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function ede(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function tde(){var e=[];return this.each(function(t){e.push(t)}),e}function nde(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function rde(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function y0(e,t){var n=new Lu(e),r=+e.value&&(n.value=e.value),i,a=[n],o,s,l,c;for(t==null&&(t=ade);i=a.pop();)if(r&&(i.value=+i.data.value),(s=t(i.data))&&(c=s.length))for(i.children=new Array(c),l=c-1;l>=0;--l)a.push(o=i.children[l]=new Lu(s[l])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(sde)}function ide(){return y0(this).eachBefore(ode)}function ade(e){return e.children}function ode(e){e.data=e.data.data}function sde(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Lu(e){this.data=e,this.depth=this.height=0,this.parent=null}Lu.prototype=y0.prototype={constructor:Lu,count:Gue,each:que,eachAfter:Yue,eachBefore:Kue,sum:Xue,sort:Zue,path:Que,ancestors:ede,descendants:tde,leaves:nde,links:rde,copy:ide};function lde(e){if(typeof e!="function")throw new Error;return e}function Ss(){return 0}function Cs(e){return function(){return e}}function cde(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function x0(e,t,n,r,i){for(var a=e.children,o,s=-1,l=a.length,c=e.value&&(r-t)/e.value;++s<l;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*c}function S0(e,t,n,r,i){for(var a=e.children,o,s=-1,l=a.length,c=e.value&&(i-n)/e.value;++s<l;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*c}var ude=(1+Math.sqrt(5))/2;function dde(e,t,n,r,i,a){for(var o=[],s=t.children,l,c,u=0,d=0,f=s.length,h,p,m=t.value,v,b,y,x,C,S,w;u<f;){h=i-n,p=a-r;do v=s[d++].value;while(!v&&d<f);for(b=y=v,S=Math.max(p/h,h/p)/(m*e),w=v*v*S,C=Math.max(y/w,w/b);d<f;++d){if(v+=c=s[d].value,c<b&&(b=c),c>y&&(y=c),w=v*v*S,x=Math.max(y/w,w/b),x>C){v-=c;break}C=x}o.push(l={value:v,dice:h<p,children:s.slice(u,d)}),l.dice?x0(l,n,r,i,m?r+=p*v/m:a):S0(l,n,r,m?n+=h*v/m:i,a),m-=v,u=d}return o}const ZM=function e(t){function n(r,i,a,o,s){dde(t,r,i,a,o,s)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(ude);function fde(){var e=ZM,t=!1,n=1,r=1,i=[0],a=Ss,o=Ss,s=Ss,l=Ss,c=Ss;function u(f){return f.x0=f.y0=0,f.x1=n,f.y1=r,f.eachBefore(d),i=[0],t&&f.eachBefore(cde),f}function d(f){var h=i[f.depth],p=f.x0+h,m=f.y0+h,v=f.x1-h,b=f.y1-h;v<p&&(p=v=(p+v)/2),b<m&&(m=b=(m+b)/2),f.x0=p,f.y0=m,f.x1=v,f.y1=b,f.children&&(h=i[f.depth+1]=a(f)/2,p+=c(f)-h,m+=o(f)-h,v-=s(f)-h,b-=l(f)-h,v<p&&(p=v=(p+v)/2),b<m&&(m=b=(m+b)/2),e(f,p,m,v,b))}return u.round=function(f){return arguments.length?(t=!!f,u):t},u.size=function(f){return arguments.length?(n=+f[0],r=+f[1],u):[n,r]},u.tile=function(f){return arguments.length?(e=lde(f),u):e},u.padding=function(f){return arguments.length?u.paddingInner(f).paddingOuter(f):u.paddingInner()},u.paddingInner=function(f){return arguments.length?(a=typeof f=="function"?f:Cs(+f),u):a},u.paddingOuter=function(f){return arguments.length?u.paddingTop(f).paddingRight(f).paddingBottom(f).paddingLeft(f):u.paddingTop()},u.paddingTop=function(f){return arguments.length?(o=typeof f=="function"?f:Cs(+f),u):o},u.paddingRight=function(f){return arguments.length?(s=typeof f=="function"?f:Cs(+f),u):s},u.paddingBottom=function(f){return arguments.length?(l=typeof f=="function"?f:Cs(+f),u):l},u.paddingLeft=function(f){return arguments.length?(c=typeof f=="function"?f:Cs(+f),u):c},u}function hde(e,t,n,r,i){var a=e.children,o,s=a.length,l,c=new Array(s+1);for(c[0]=l=o=0;o<s;++o)c[o+1]=l+=a[o].value;u(0,s,e.value,t,n,r,i);function u(d,f,h,p,m,v,b){if(d>=f-1){var y=a[d];y.x0=p,y.y0=m,y.x1=v,y.y1=b;return}for(var x=c[d],C=h/2+x,S=d+1,w=f-1;S<w;){var O=S+w>>>1;c[O]<C?S=O+1:w=O}C-c[S-1]<c[S]-C&&d+1<S&&--S;var E=c[S]-x,_=h-E;if(v-p>b-m){var T=(p*_+v*E)/h;u(d,S,E,p,m,T,b),u(S,f,_,T,m,v,b)}else{var R=(m*_+b*E)/h;u(d,S,E,p,m,v,R),u(S,f,_,p,R,v,b)}}}function vde(e,t,n,r,i){(e.depth&1?S0:x0)(e,t,n,r,i)}function fr(){return fr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fr.apply(this,arguments)}function gde(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var mde=function(e,t){return ur([e,t],function(n,r){return"translate("+n+","+r+")"})},pde=function(e,t){return ur([e,t],function(n,r){return"translate("+n+"px, "+r+"px)"})},VS=function(e,t,n){return ur([e,t,n],function(r,i,a){return"translate("+r+","+i+") rotate("+a+")"})},bde=function(e,t,n){return ur([e,t,n],function(r,i,a){return"translate("+r+"px,"+i+"px) rotate("+a+"deg)"})},yde=function(e,t,n){return ur([e,t,n],function(r,i,a){return"translate("+(r-(a===0?0:5))+"px,"+(i-(a===0?5:0))+"px) rotate("+a+"deg)"})},xde=$.memo(function(e){var t=e.node,n=e.animatedProps,r=e.borderWidth,i=e.enableLabel,a=e.enableParentLabel,o=e.labelSkipSize,s=kt(),l=i&&t.isLeaf&&(o===0||Math.min(t.width,t.height)>o),c=a&&t.isParent;return k.jsxs(Tt.g,{transform:mde(n.x,n.y),children:[k.jsx(Tt.rect,{"data-testid":"node."+t.id,width:ur(n.width,function(u){return Math.max(u,0)}),height:ur(n.height,function(u){return Math.max(u,0)}),fill:t.fill?t.fill:n.color,strokeWidth:r,stroke:t.borderColor,fillOpacity:t.opacity,onMouseEnter:t.onMouseEnter,onMouseMove:t.onMouseMove,onMouseLeave:t.onMouseLeave,onClick:t.onClick}),l&&k.jsx(Tt.text,{"data-testid":"label."+t.id,textAnchor:"middle",dominantBaseline:"central",style:fr({},s.labels.text,{fill:t.labelTextColor,pointerEvents:"none"}),fillOpacity:n.labelOpacity,transform:VS(n.labelX,n.labelY,n.labelRotation),children:t.label}),c&&k.jsx(Tt.text,{"data-testid":"parentLabel."+t.id,dominantBaseline:"central",style:fr({},s.labels.text,{fill:t.parentLabelTextColor,pointerEvents:"none"}),fillOpacity:n.parentLabelOpacity,transform:VS(n.parentLabelX,n.parentLabelY,n.parentLabelRotation),children:t.parentLabel})]})}),Sde=$.memo(function(e){var t=e.node;return k.jsx(So,{id:t.id,value:t.formattedValue,enableChip:!0,color:t.color})}),Cde=$.memo(function(e){var t=e.node,n=e.animatedProps,r=e.borderWidth,i=e.enableLabel,a=e.enableParentLabel,o=e.labelSkipSize,s=kt(),l=i&&t.isLeaf&&(o===0||Math.min(t.width,t.height)>o),c=a&&t.isParent;return k.jsxs(Tt.div,{"data-testid":"node."+t.id,id:t.path.replace(/[^\w]/gi,"-"),style:{boxSizing:"border-box",position:"absolute",top:0,left:0,transform:pde(n.x,n.y),width:n.width,height:n.height,borderWidth:r,borderStyle:"solid",borderColor:t.borderColor,overflow:"hidden"},children:[k.jsx(Tt.div,{style:{boxSizing:"border-box",position:"absolute",top:0,left:0,opacity:t.opacity,width:n.width,height:n.height,background:n.color},onMouseEnter:t.onMouseEnter,onMouseMove:t.onMouseMove,onMouseLeave:t.onMouseLeave,onClick:t.onClick}),l&&k.jsx(Tt.span,{"data-testid":"label."+t.id,style:fr({},s.labels.text,{position:"absolute",display:"flex",top:-5,left:-5,width:10,height:10,justifyContent:"center",alignItems:"center",whiteSpace:"nowrap",color:t.labelTextColor,transformOrigin:"center center",transform:bde(n.labelX,n.labelY,n.labelRotation),opacity:n.labelOpacity,pointerEvents:"none"}),children:t.label}),c&&k.jsx(Tt.span,{"data-testid":"parentLabel."+t.id,style:fr({},s.labels.text,{position:"absolute",display:"flex",justifyContent:"flex-start",alignItems:"center",whiteSpace:"nowrap",width:10,height:10,color:t.parentLabelTextColor,transformOrigin:"top left",transform:yde(n.parentLabelX,n.parentLabelY,n.parentLabelRotation),opacity:n.parentLabelOpacity,pointerEvents:"none"}),children:t.parentLabel})]})}),sn={layers:["nodes"],identity:"id",value:"value",tile:"squarify",leavesOnly:!1,innerPadding:0,outerPadding:0,colors:{scheme:"nivo"},colorBy:"pathComponents.1",nodeOpacity:.33,enableLabel:!0,label:"formattedValue",labelSkipSize:0,labelTextColor:{from:"color",modifiers:[["darker",1]]},orientLabel:!0,enableParentLabel:!0,parentLabel:"id",parentLabelSize:20,parentLabelPosition:"top",parentLabelPadding:6,parentLabelTextColor:{from:"color",modifiers:[["darker",1]]},borderWidth:1,borderColor:{from:"color",modifiers:[["darker",1]]},isInteractive:!0,tooltip:Sde,role:"img",animate:!0,motionConfig:"gentle"},Dt=fr({},sn,{nodeComponent:xde,defs:[],fill:[]});fr({},sn,{nodeComponent:Cde});fr({},sn,{pixelRatio:typeof window<"u"&&window.devicePixelRatio||1});var wde={binary:hde,dice:x0,slice:S0,sliceDice:vde,squarify:ZM},$de=function(e){var t=e.root,n=e.getValue;return $.useMemo(function(){return y0(t).sum(n)},[t,n])},_de=function(e){var t=e.data,n=e.width,r=e.height,i=e.identity,a=i===void 0?sn.identity:i,o=e.value,s=o===void 0?sn.value:o,l=e.valueFormat,c=e.leavesOnly,u=c===void 0?sn.leavesOnly:c,d=e.tile,f=d===void 0?sn.tile:d,h=e.innerPadding,p=h===void 0?sn.innerPadding:h,m=e.outerPadding,v=m===void 0?sn.outerPadding:m,b=e.label,y=b===void 0?sn.label:b,x=e.orientLabel,C=x===void 0?sn.orientLabel:x,S=e.enableParentLabel,w=S===void 0?sn.enableParentLabel:S,O=e.parentLabel,E=O===void 0?sn.parentLabel:O,_=e.parentLabelSize,T=_===void 0?sn.parentLabelSize:_,R=e.parentLabelPosition,F=R===void 0?sn.parentLabelPosition:R,I=e.parentLabelPadding,P=I===void 0?sn.parentLabelPadding:I,j=e.colors,A=j===void 0?sn.colors:j,M=e.colorBy,N=M===void 0?sn.colorBy:M,L=e.nodeOpacity,D=L===void 0?sn.nodeOpacity:L,V=e.borderColor,X=V===void 0?sn.borderColor:V,q=e.labelTextColor,Z=q===void 0?sn.labelTextColor:q,J=e.parentLabelTextColor,Q=J===void 0?sn.parentLabelTextColor:J,K=Yr(a),Y=Yr(s),W=Li(l),H=Yr(y),U=Yr(E),z=function(ge){var fe=ge.width,se=ge.height,xe=ge.tile,ce=ge.innerPadding,Ne=ge.outerPadding,Me=ge.enableParentLabel,Ie=ge.parentLabelSize,Le=ge.parentLabelPosition,He=ge.leavesOnly;return $.useMemo(function(){var Xe=fde().size([fe,se]).tile(wde[xe]).round(!0).paddingInner(ce).paddingOuter(Ne);if(Me&&!He){var je=Ie+2*Ne;Xe["padding"+Hue(Le)](je)}return Xe},[fe,se,xe,ce,Ne,Me,Ie,Le,He])}({width:n,height:r,tile:f,innerPadding:p,outerPadding:v,enableParentLabel:w,parentLabelSize:T,parentLabelPosition:F,leavesOnly:u}),ne=$de({root:t,getValue:Y}),B=$.useMemo(function(){var ge=jO(ne);return z(ge),u?ge.leaves():ge.descendants()},[ne,z,u]),re=$.useMemo(function(){return B.map(function(ge){var fe=function(Ne,Me){var Ie=Ne.ancestors().map(function(Le){return Me(Le.data)}).reverse();return{path:Ie.join("."),pathComponents:Ie}}(ge,K),se=fe.path,xe=fe.pathComponents,ce={id:K(ge.data),path:se,pathComponents:xe,data:g0(ge.data,"children"),x:ge.x0,y:ge.y0,width:ge.x1-ge.x0,height:ge.y1-ge.y0,value:ge.value,formattedValue:W(ge.value),treeDepth:ge.depth,treeHeight:ge.height,isParent:ge.height>0,isLeaf:ge.height===0,parentLabelX:0,parentLabelY:0,parentLabelRotation:0};return ce.labelRotation=C&&ce.height>ce.width?-90:0,F==="top"&&(ce.parentLabelX=v+P,ce.parentLabelY=v+T/2),F==="right"&&(ce.parentLabelX=ce.width-v-T/2,ce.parentLabelY=ce.height-v-P,ce.parentLabelRotation=-90),F==="bottom"&&(ce.parentLabelX=v+P,ce.parentLabelY=ce.height-v-T/2),F==="left"&&(ce.parentLabelX=v+T/2,ce.parentLabelY=ce.height-v-P,ce.parentLabelRotation=-90),ce.label=H(ce),ce.parentLabel=U(ce),ce})},[B,K,W,H,C,U,T,F,P,v]),ie=kt(),ue=Vl(A,N),me=lr(X,ie),ve=lr(Z,ie),be=lr(Q,ie),Ce=$.useMemo(function(){return re.map(function(ge){var fe=fr({},ge,{color:ue(ge),opacity:D});return fe.borderColor=me(fe),fe.labelTextColor=ve(fe),fe.parentLabelTextColor=be(fe),fe})},[re,ue,D,me,ve,be]);return{hierarchy:ne,nodes:Ce,layout:z}},Ede=function(e){var t=e.nodes;return $.useMemo(function(){return{nodes:t}},[t])},Vh=function(e){return{x:e.x,y:e.y,width:e.width,height:e.height,color:e.color,labelX:e.width/2,labelY:e.height/2,labelRotation:e.labelRotation,labelOpacity:1,parentLabelX:e.parentLabelX,parentLabelY:e.parentLabelY,parentLabelRotation:e.parentLabelRotation,parentLabelOpacity:1}},WS=function(e){return{x:e.x+e.width/2,y:e.y+e.height/2,width:0,height:0,color:e.color,labelX:0,labelY:0,labelRotation:e.labelRotation,labelOpacity:0,parentLabelX:0,parentLabelY:0,parentLabelRotation:e.parentLabelRotation,parentLabelOpacity:0}},Ode=$.memo(function(e){var t=e.nodes,n=e.nodeComponent,r=e.borderWidth,i=e.enableLabel,a=e.labelSkipSize,o=e.enableParentLabel,s=function(f,h){var p=h.isInteractive,m=h.onMouseEnter,v=h.onMouseMove,b=h.onMouseLeave,y=h.onClick,x=h.tooltip,C=Wr(),S=C.showTooltipFromEvent,w=C.hideTooltip,O=$.useCallback(function(F,I){S($.createElement(x,{node:F}),I,"left")},[S,x]),E=$.useCallback(function(F,I){O(F,I),m==null||m(F,I)},[m,O]),_=$.useCallback(function(F,I){O(F,I),v==null||v(F,I)},[v,O]),T=$.useCallback(function(F,I){w(),b==null||b(F,I)},[b,w]),R=$.useCallback(function(F,I){y==null||y(F,I)},[y]);return $.useMemo(function(){return f.map(function(F){return p?fr({},F,{onMouseEnter:function(I){return E(F,I)},onMouseMove:function(I){return _(F,I)},onMouseLeave:function(I){return T(F,I)},onClick:function(I){return R(F,I)}}):F})},[p,f,E,_,T,R])}(t,{isInteractive:e.isInteractive,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseLeave:e.onMouseLeave,onClick:e.onClick,tooltip:e.tooltip}),l=Sn(),c=l.animate,u=l.config,d=$a(s,{keys:function(f){return f.path},initial:Vh,from:WS,enter:Vh,update:Vh,leave:WS,config:u,immediate:!c});return k.jsx(k.Fragment,{children:d(function(f,h){return $.createElement(n,{key:h.path,node:h,animatedProps:f,borderWidth:r,enableLabel:i,labelSkipSize:a,enableParentLabel:o})})})}),Mde=["isInteractive","animate","motionConfig","theme","renderWrapper"],Tde=function(e){var t=e.data,n=e.identity,r=n===void 0?Dt.identity:n,i=e.value,a=i===void 0?Dt.value:i,o=e.valueFormat,s=e.tile,l=s===void 0?Dt.tile:s,c=e.nodeComponent,u=c===void 0?Dt.nodeComponent:c,d=e.innerPadding,f=d===void 0?Dt.innerPadding:d,h=e.outerPadding,p=h===void 0?Dt.outerPadding:h,m=e.leavesOnly,v=m===void 0?Dt.leavesOnly:m,b=e.width,y=e.height,x=e.margin,C=e.layers,S=C===void 0?Dt.layers:C,w=e.colors,O=w===void 0?Dt.colors:w,E=e.colorBy,_=E===void 0?Dt.colorBy:E,T=e.nodeOpacity,R=T===void 0?Dt.nodeOpacity:T,F=e.borderWidth,I=F===void 0?Dt.borderWidth:F,P=e.borderColor,j=P===void 0?Dt.borderColor:P,A=e.defs,M=A===void 0?Dt.defs:A,N=e.fill,L=N===void 0?Dt.fill:N,D=e.enableLabel,V=D===void 0?Dt.enableLabel:D,X=e.label,q=X===void 0?Dt.label:X,Z=e.labelTextColor,J=Z===void 0?Dt.labelTextColor:Z,Q=e.orientLabel,K=Q===void 0?Dt.orientLabel:Q,Y=e.labelSkipSize,W=Y===void 0?Dt.labelSkipSize:Y,H=e.enableParentLabel,U=H===void 0?Dt.enableParentLabel:H,z=e.parentLabel,ne=z===void 0?Dt.parentLabel:z,B=e.parentLabelSize,re=B===void 0?Dt.parentLabelSize:B,ie=e.parentLabelPosition,ue=ie===void 0?Dt.parentLabelPosition:ie,me=e.parentLabelPadding,ve=me===void 0?Dt.parentLabelPadding:me,be=e.parentLabelTextColor,Ce=be===void 0?Dt.parentLabelTextColor:be,ge=e.isInteractive,fe=ge===void 0?Dt.isInteractive:ge,se=e.onMouseEnter,xe=e.onMouseMove,ce=e.onMouseLeave,Ne=e.onClick,Me=e.tooltip,Ie=Me===void 0?Dt.tooltip:Me,Le=e.role,He=e.ariaLabel,Xe=e.ariaLabelledBy,je=e.ariaDescribedBy,Oe=Ra(b,y,x),nt=Oe.margin,We=Oe.innerWidth,Be=Oe.innerHeight,Se=Oe.outerWidth,Fe=Oe.outerHeight,ot=_de({data:t,identity:r,value:a,valueFormat:o,leavesOnly:v,width:We,height:Be,tile:l,innerPadding:f,outerPadding:p,colors:O,colorBy:_,nodeOpacity:R,borderColor:j,label:q,labelTextColor:J,orientLabel:K,enableParentLabel:U,parentLabel:ne,parentLabelSize:re,parentLabelPosition:ue,parentLabelPadding:ve,parentLabelTextColor:Ce}).nodes,ct={nodes:null};S.includes("nodes")&&(ct.nodes=k.jsx(Ode,{nodes:ot,nodeComponent:u,borderWidth:I,enableLabel:V,labelSkipSize:W,enableParentLabel:U,isInteractive:fe,onMouseEnter:se,onMouseMove:xe,onMouseLeave:ce,onClick:Ne,tooltip:Ie},"nodes"));var De=Ede({nodes:ot}),qe=u0(M,ot,L);return k.jsx(Zo,{width:Se,height:Fe,margin:nt,defs:qe,role:Le,ariaLabel:He,ariaLabelledBy:Xe,ariaDescribedBy:je,children:S.map(function(Qe,Je){var rt;return typeof Qe=="function"?k.jsx($.Fragment,{children:$.createElement(Qe,De)},Je):(rt=ct==null?void 0:ct[Qe])!=null?rt:null})})},Rde=function(e){var t=e.isInteractive,n=t===void 0?Dt.isInteractive:t,r=e.animate,i=r===void 0?Dt.animate:r,a=e.motionConfig,o=a===void 0?Dt.motionConfig:a,s=e.theme,l=e.renderWrapper,c=gde(e,Mde);return k.jsx(Pa,{animate:i,isInteractive:n,motionConfig:o,renderWrapper:l,theme:s,children:k.jsx(Tde,fr({isInteractive:n},c))})},Pde=function(e){return k.jsx(Wi,{children:function(t){var n=t.width,r=t.height;return k.jsx(Rde,fr({width:n,height:r},e))}})};const Ide=({treeMapData:e,style:t={},colors:n={datum:"data.color"},identity:r=null,value:i=null,margin:a={},label:o=null,orientLabel:s=!1,labelSkipSize:l=12,labelTextColor:c=null,borderColor:u=null,tooltip:d=null})=>k.jsxs(k.Fragment,{children:[k.jsx(On,{}),k.jsx("div",{style:{width:"100%",height:600,...t},children:k.jsx(Pde,{data:e,colors:n||{scheme:"nivo"},identity:r||"name",value:i||"loc",margin:{top:10,right:10,bottom:10,left:10,...a},enableParentLabel:!1,label:f=>(o==null?void 0:o(f))||`${f==null?void 0:f.id}`,orientLabel:s,labelSkipSize:l,labelTextColor:c||"black",borderColor:u||{from:"color",modifiers:[["darker",.1]]},tooltip:({node:f})=>k.jsx(pi,{body:(d==null?void 0:d({node:f}))||k.jsx("span",{children:"Treemap tooltip"})})})})]});var Ade=Dl,Nde=0;function jde(e){var t=++Nde;return Ade(e)+t}var Lde=jde;const kde=rn(Lde);function Xn(){return Xn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xn.apply(this,arguments)}var C0=$.memo(function(e){var t=e.point;return k.jsx(So,{id:k.jsxs("span",{children:["x: ",k.jsx("strong",{children:t.data.xFormatted}),", y:"," ",k.jsx("strong",{children:t.data.yFormatted})]}),enableChip:!0,color:t.serieColor})}),QM=$.memo(function(e){var t=e.slice,n=e.axis,r=kt(),i=n==="x"?"y":"x";return k.jsx(h_,{rows:t.points.map(function(a){return[k.jsx(fu,{color:a.serieColor,style:r.tooltip.chip},"chip"),a.serieId,k.jsx("span",{style:r.tooltip.tableCellValue,children:a.data[i+"Formatted"]},"value")]})})}),JM={curve:"linear",xScale:{type:"point"},yScale:{type:"linear",min:0,max:"auto"},layers:["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"],axisBottom:{},axisLeft:{},enableGridX:!0,enableGridY:!0,enablePoints:!0,pointSize:6,pointColor:{from:"color"},pointBorderWidth:0,pointBorderColor:{theme:"background"},enablePointLabel:!1,pointLabel:"yFormatted",colors:{scheme:"nivo"},enableArea:!1,areaBaselineValue:0,areaOpacity:.2,areaBlendMode:"normal",lineWidth:2,legends:[],isInteractive:!0,tooltip:C0,enableSlices:!1,debugSlices:!1,sliceTooltip:QM,debugMesh:!1,enableCrosshair:!0,crosshairType:"bottom-left"},$i=Xn({},JM,{enablePointLabel:!1,useMesh:!1,enableTouchCrosshair:!1,animate:!0,motionConfig:"gentle",defs:[],fill:[],role:"img"});Xn({},JM,{pixelRatio:typeof window<"u"&&window.devicePixelRatio||1});var Dde=function(e){var t=e.curve;return $.useMemo(function(){return ml().defined(function(n){return n.x!==null&&n.y!==null}).x(function(n){return n.x}).y(function(n){return n.y}).curve(aO(t))},[t])},Fde=function(e){var t=e.curve,n=e.yScale,r=e.areaBaselineValue;return $.useMemo(function(){return oX().defined(function(i){return i.x!==null&&i.y!==null}).x(function(i){return i.x}).y1(function(i){return i.y}).curve(aO(t)).y0(n(r))},[t,n,r])},zde=function(e){var t=e.componentId,n=e.enableSlices,r=e.points,i=e.width,a=e.height;return $.useMemo(function(){if(n===!1)return[];if(n==="x"){var o=new Map;return r.forEach(function(l){l.data.x!==null&&l.data.y!==null&&(o.has(l.x)?o.get(l.x).push(l):o.set(l.x,[l]))}),Array.from(o.entries()).sort(function(l,c){return l[0]-c[0]}).map(function(l,c,u){var d,f,h=l[0],p=l[1],m=u[c-1],v=u[c+1];return d=m?h-(h-m[0])/2:h,f=v?h-d+(v[0]-h)/2:i-d,{id:"slice:"+t+":"+h,x0:d,x:h,y0:0,y:0,width:f,height:a,points:p.reverse()}})}if(n==="y"){var s=new Map;return r.forEach(function(l){l.data.x!==null&&l.data.y!==null&&(s.has(l.y)?s.get(l.y).push(l):s.set(l.y,[l]))}),Array.from(s.entries()).sort(function(l,c){return l[0]-c[0]}).map(function(l,c,u){var d,f,h=l[0],p=l[1],m=u[c-1],v=u[c+1];return d=m?h-(h-m[0])/2:h,f=v?h-d+(v[0]-h)/2:a-d,{id:h,x0:0,x:0,y0:d,y:h,width:i,height:f,points:p.reverse()}})}},[t,n,a,r,i])},Bde="line",eT=function(e){var t=e.data,n=e.xScale,r=n===void 0?$i.xScale:n,i=e.xFormat,a=e.yScale,o=a===void 0?$i.yScale:a,s=e.yFormat,l=e.width,c=e.height,u=e.colors,d=u===void 0?$i.colors:u,f=e.curve,h=f===void 0?$i.curve:f,p=e.areaBaselineValue,m=p===void 0?$i.areaBaselineValue:p,v=e.pointColor,b=v===void 0?$i.pointColor:v,y=e.pointBorderColor,x=y===void 0?$i.pointBorderColor:y,C=e.enableSlices,S=C===void 0?$i.enableSlicesTooltip:C,w=$.useState(kde(Bde))[0],O=Li(i),E=Li(s),_=Vl(d,"id"),T=kt(),R=lr(b,T),F=lr(x,T),I=$.useState([]),P=I[0],j=I[1],A=$.useMemo(function(){return uM(t.filter(function(Q){return P.indexOf(Q.id)===-1}),r,o,l,c)},[t,P,r,o,l,c]),M=A.xScale,N=A.yScale,L=A.series,D=$.useMemo(function(){var Q=t.map(function(Y){return{id:Y.id,label:Y.id,color:_(Y)}}),K=Q.map(function(Y){return Xn({},L.find(function(W){return W.id===Y.id}),{color:Y.color})}).filter(function(Y){return!!Y.id});return{legendData:Q.map(function(Y){return Xn({},Y,{hidden:!K.find(function(W){return W.id===Y.id})})}).reverse(),series:K}},[t,L,_]),V=D.legendData,X=D.series,q=$.useCallback(function(Q){j(function(K){return K.indexOf(Q)>-1?K.filter(function(Y){return Y!==Q}):[].concat(K,[Q])})},[]),Z=function(Q){var K=Q.series,Y=Q.getPointColor,W=Q.getPointBorderColor,H=Q.formatX,U=Q.formatY;return $.useMemo(function(){return K.reduce(function(z,ne){return[].concat(z,ne.data.filter(function(B){return B.position.x!==null&&B.position.y!==null}).map(function(B,re){var ie={id:ne.id+"."+re,index:z.length+re,serieId:ne.id,serieColor:ne.color,x:B.position.x,y:B.position.y};return ie.color=Y(ne),ie.borderColor=W(ie),ie.data=Xn({},B.data,{xFormatted:H(B.data.x),yFormatted:U(B.data.y)}),ie}))},[])},[K,Y,W,H,U])}({series:X,getPointColor:R,getPointBorderColor:F,formatX:O,formatY:E}),J=zde({componentId:w,enableSlices:S,points:Z,width:l,height:c});return{legendData:V,toggleSerie:q,lineGenerator:Dde({curve:h}),areaGenerator:Fde({curve:h,yScale:N,areaBaselineValue:m}),getColor:_,series:X,xScale:M,yScale:N,slices:J,points:Z}},Vde=function(e){var t=e.areaBlendMode,n=e.areaOpacity,r=e.color,i=e.fill,a=e.path,o=Sn(),s=o.animate,l=o.config,c=ff(a),u=Mr({color:r,config:l,immediate:!s});return k.jsx(Tt.path,{d:c,fill:i||u.color,fillOpacity:n,strokeWidth:0,style:{mixBlendMode:t}})},Wde=$.memo(function(e){var t=e.areaGenerator,n=e.areaOpacity,r=e.areaBlendMode,i=e.lines.slice(0).reverse();return k.jsx("g",{children:i.map(function(a){return k.jsx(Vde,Xn({path:t(a.data.map(function(o){return o.position}))},Xn({areaOpacity:n,areaBlendMode:r},a)),a.id)})})}),Hde=$.memo(function(e){var t=e.lineGenerator,n=e.points,r=e.color,i=e.thickness,a=$.useMemo(function(){return t(n)},[t,n]),o=ff(a);return k.jsx(Tt.path,{d:o,fill:"none",strokeWidth:i,stroke:r})}),Ude=$.memo(function(e){var t=e.lines,n=e.lineGenerator,r=e.lineWidth;return t.slice(0).reverse().map(function(i){var a=i.id,o=i.data,s=i.color;return k.jsx(Hde,{id:a,points:o.map(function(l){return l.position}),lineGenerator:n,color:s,thickness:r},a)})}),Gde=$.memo(function(e){var t=e.slice,n=e.slices,r=e.axis,i=e.debug,a=e.tooltip,o=e.isCurrent,s=e.setCurrent,l=e.onMouseEnter,c=e.onMouseMove,u=e.onMouseLeave,d=e.onClick,f=e.onTouchStart,h=e.onTouchMove,p=e.onTouchEnd,m=Wr(),v=m.showTooltipFromEvent,b=m.hideTooltip,y=$.useCallback(function(_){v($.createElement(a,{slice:t,axis:r}),_,"right"),s(t),l&&l(t,_)},[v,a,t,r,s,l]),x=$.useCallback(function(_){v($.createElement(a,{slice:t,axis:r}),_,"right"),c&&c(t,_)},[v,a,t,r,c]),C=$.useCallback(function(_){b(),s(null),u&&u(t,_)},[b,s,u,t]),S=$.useCallback(function(_){d&&d(t,_)},[t,d]),w=$.useCallback(function(_){v($.createElement(a,{slice:t,axis:r}),_,"right"),s(t),f&&f(t,_)},[r,f,s,v,t,a]),O=$.useCallback(function(_){var T=_.touches[0],R=document.elementFromPoint(T.clientX,T.clientY),F=R==null?void 0:R.getAttribute("data-ref");if(F){var I=n.find(function(P){return P.id===F});I&&(v($.createElement(a,{slice:I,axis:r}),_,"right"),s(I))}h&&h(t,_)},[r,h,s,v,t,n,a]),E=$.useCallback(function(_){b(),s(null),p&&p(t,_)},[b,s,p,t]);return k.jsx("rect",{x:t.x0,y:t.y0,width:t.width,height:t.height,stroke:"red",strokeWidth:i?1:0,strokeOpacity:.75,fill:"red",fillOpacity:o&&i?.35:0,onMouseEnter:y,onMouseMove:x,onMouseLeave:C,onClick:S,onTouchStart:w,onTouchMove:O,onTouchEnd:E,"data-ref":t.id})}),qde=$.memo(function(e){var t=e.slices,n=e.axis,r=e.debug,i=e.height,a=e.tooltip,o=e.current,s=e.setCurrent,l=e.onMouseEnter,c=e.onMouseMove,u=e.onMouseLeave,d=e.onClick,f=e.onTouchStart,h=e.onTouchMove,p=e.onTouchEnd;return t.map(function(m){return k.jsx(Gde,{slice:m,slices:t,axis:n,debug:r,height:i,tooltip:a,setCurrent:s,isCurrent:o!==null&&o.id===m.id,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onTouchStart:f,onTouchMove:h,onTouchEnd:p},m.id)})}),Kde=$.memo(function(e){var t=e.points,n=e.symbol,r=e.size,i=e.borderWidth,a=e.enableLabel,o=e.label,s=e.labelYOffset,l=kt(),c=Dee(o),u=t.slice(0).reverse().map(function(d){return{id:d.id,x:d.x,y:d.y,datum:d.data,fill:d.color,stroke:d.borderColor,label:a?c(d):null}});return k.jsx("g",{children:u.map(function(d){return k.jsx(jee,{x:d.x,y:d.y,datum:d.datum,symbol:n,size:r,color:d.fill,borderWidth:i,borderColor:d.stroke,label:d.label,labelYOffset:s,theme:l},d.id)})})}),Yde=$.memo(function(e){var t=e.points,n=e.width,r=e.height,i=e.margin,a=e.setCurrent,o=e.onMouseEnter,s=e.onMouseMove,l=e.onMouseLeave,c=e.onClick,u=e.onTouchStart,d=e.onTouchMove,f=e.onTouchEnd,h=e.tooltip,p=e.debug,m=e.enableTouchCrosshair,v=Wr(),b=v.showTooltipAt,y=v.hideTooltip,x=$.useCallback(function(T,R){b($.createElement(h,{point:T}),[T.x+i.left,T.y+i.top],"top"),o&&o(T,R)},[b,h,o,i]),C=$.useCallback(function(T,R){b($.createElement(h,{point:T}),[T.x+i.left,T.y+i.top],"top"),s&&s(T,R)},[b,h,i.left,i.top,s]),S=$.useCallback(function(T,R){y(),l&&l(T,R)},[y,l]),w=$.useCallback(function(T,R){c&&c(T,R)},[c]),O=$.useCallback(function(T,R){b($.createElement(h,{point:T}),[T.x+i.left,T.y+i.top],"top"),u&&u(T,R)},[i.left,i.top,u,b,h]),E=$.useCallback(function(T,R){b($.createElement(h,{point:T}),[T.x+i.left,T.y+i.top],"top"),d&&d(T,R)},[i.left,i.top,d,b,h]),_=$.useCallback(function(T,R){y(),f&&f(T,R)},[f,y]);return k.jsx($M,{nodes:t,width:n,height:r,setCurrent:a,onMouseEnter:x,onMouseMove:C,onMouseLeave:S,onClick:w,onTouchStart:O,onTouchMove:E,onTouchEnd:_,enableTouchCrosshair:m,debug:p})}),Xde=xO(function(e){var t=e.data,n=e.xScale,r=n===void 0?{type:"point"}:n,i=e.xFormat,a=e.yScale,o=a===void 0?{type:"linear",min:0,max:"auto"}:a,s=e.yFormat,l=e.layers,c=l===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:l,u=e.curve,d=u===void 0?"linear":u,f=e.areaBaselineValue,h=f===void 0?0:f,p=e.colors,m=p===void 0?{scheme:"nivo"}:p,v=e.margin,b=e.width,y=e.height,x=e.axisTop,C=e.axisRight,S=e.axisBottom,w=S===void 0?{}:S,O=e.axisLeft,E=O===void 0?{}:O,_=e.enableGridX,T=_===void 0||_,R=e.enableGridY,F=R===void 0||R,I=e.gridXValues,P=e.gridYValues,j=e.lineWidth,A=j===void 0?2:j,M=e.enableArea,N=M!==void 0&&M,L=e.areaOpacity,D=L===void 0?.2:L,V=e.areaBlendMode,X=V===void 0?"normal":V,q=e.enablePoints,Z=q===void 0||q,J=e.pointSymbol,Q=e.pointSize,K=Q===void 0?6:Q,Y=e.pointColor,W=Y===void 0?{from:"color"}:Y,H=e.pointBorderWidth,U=H===void 0?0:H,z=e.pointBorderColor,ne=z===void 0?{theme:"background"}:z,B=e.enablePointLabel,re=B!==void 0&&B,ie=e.pointLabel,ue=ie===void 0?"data.yFormatted":ie,me=e.pointLabelYOffset,ve=e.defs,be=ve===void 0?[]:ve,Ce=e.fill,ge=Ce===void 0?[]:Ce,fe=e.markers,se=e.legends,xe=se===void 0?[]:se,ce=e.isInteractive,Ne=ce===void 0||ce,Me=e.useMesh,Ie=Me!==void 0&&Me,Le=e.debugMesh,He=Le!==void 0&&Le,Xe=e.onMouseEnter,je=e.onMouseMove,Oe=e.onMouseLeave,nt=e.onClick,We=e.onTouchStart,Be=e.onTouchMove,Se=e.onTouchEnd,Fe=e.tooltip,ot=Fe===void 0?C0:Fe,ct=e.enableSlices,De=ct!==void 0&&ct,qe=e.debugSlices,Qe=qe!==void 0&&qe,Je=e.sliceTooltip,rt=Je===void 0?QM:Je,Ve=e.enableCrosshair,Te=Ve===void 0||Ve,st=e.crosshairType,mt=st===void 0?"bottom-left":st,Ee=e.enableTouchCrosshair,he=Ee!==void 0&&Ee,we=e.role,ke=we===void 0?"img":we,tt=Ra(b,y,v),Ue=tt.margin,at=tt.innerWidth,G=tt.innerHeight,oe=tt.outerWidth,le=tt.outerHeight,_e=eT({data:t,xScale:r,xFormat:i,yScale:o,yFormat:s,width:at,height:G,colors:m,curve:d,areaBaselineValue:h,pointColor:W,pointBorderColor:ne,enableSlices:De}),Ke=_e.legendData,et=_e.toggleSerie,Ze=_e.lineGenerator,it=_e.areaGenerator,Re=_e.series,Pe=_e.xScale,ze=_e.yScale,ft=_e.slices,Nt=_e.points,Wt=kt(),St=lr(W,Wt),Cn=lr(ne,Wt),fn=$.useState(null),Ht=fn[0],An=fn[1],Rr=$.useState(null),ln=Rr[0],kn=Rr[1],pn={grid:k.jsx(yM,{theme:Wt,width:at,height:G,xScale:T?Pe:null,yScale:F?ze:null,xValues:I,yValues:P},"grid"),markers:k.jsx(yO,{markers:fe,width:at,height:G,xScale:Pe,yScale:ze,theme:Wt},"markers"),axes:k.jsx(bM,{xScale:Pe,yScale:ze,width:at,height:G,theme:Wt,top:x,right:C,bottom:w,left:E},"axes"),areas:null,lines:k.jsx(Ude,{lines:Re,lineGenerator:Ze,lineWidth:A},"lines"),slices:null,points:null,crosshair:null,mesh:null,legends:xe.map(function(hn,Un){return k.jsx(vf,Xn({},hn,{containerWidth:at,containerHeight:G,data:hn.data||Ke,theme:Wt,toggleSerie:hn.toggleSerie?et:void 0}),"legend."+Un)})},nr=u0(be,Re,ge);return N&&(pn.areas=k.jsx(Wde,{areaGenerator:it,areaOpacity:D,areaBlendMode:X,lines:Re},"areas")),Ne&&De!==!1&&(pn.slices=k.jsx(qde,{slices:ft,axis:De,debug:Qe,height:G,tooltip:rt,current:ln,setCurrent:kn,onMouseEnter:Xe,onMouseMove:je,onMouseLeave:Oe,onClick:nt,onTouchStart:We,onTouchMove:Be,onTouchEnd:Se},"slices")),Z&&(pn.points=k.jsx(Kde,{points:Nt,symbol:J,size:K,color:St,borderWidth:U,borderColor:Cn,enableLabel:re,label:ue,labelYOffset:me},"points")),Ne&&Te&&(Ht!==null&&(pn.crosshair=k.jsx(pg,{width:at,height:G,x:Ht.x,y:Ht.y,type:mt},"crosshair")),ln!==null&&(pn.crosshair=k.jsx(pg,{width:at,height:G,x:ln.x,y:ln.y,type:De},"crosshair"))),Ne&&Ie&&De===!1&&(pn.mesh=k.jsx(Yde,{points:Nt,width:at,height:G,margin:Ue,current:Ht,setCurrent:An,onMouseEnter:Xe,onMouseMove:je,onMouseLeave:Oe,onClick:nt,onTouchStart:We,onTouchMove:Be,onTouchEnd:Se,tooltip:ot,enableTouchCrosshair:he,debug:He},"mesh")),k.jsx(Zo,{defs:nr,width:oe,height:le,margin:Ue,role:ke,children:c.map(function(hn,Un){return typeof hn=="function"?k.jsx($.Fragment,{children:hn(Xn({},e,{innerWidth:at,innerHeight:G,series:Re,slices:ft,points:Nt,xScale:Pe,yScale:ze,lineGenerator:Ze,areaGenerator:it,currentPoint:Ht,setCurrentPoint:An,currentSlice:ln,setCurrentSlice:kn}))},Un):pn[hn]})})}),Zde=function(e){return k.jsx(Wi,{children:function(t){var n=t.width,r=t.height;return k.jsx(Xde,Xn({width:n,height:r},e))}})},Qde=xO(function(e){var t=$.useRef(null),n=e.width,r=e.height,i=e.margin,a=e.pixelRatio,o=a===void 0?typeof window<"u"&&window.devicePixelRatio||1:a,s=e.data,l=e.xScale,c=l===void 0?{type:"point"}:l,u=e.xFormat,d=e.yScale,f=d===void 0?{type:"linear",min:0,max:"auto"}:d,h=e.yFormat,p=e.curve,m=p===void 0?"linear":p,v=e.layers,b=v===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:v,y=e.colors,x=y===void 0?{scheme:"nivo"}:y,C=e.lineWidth,S=C===void 0?2:C,w=e.enableArea,O=w!==void 0&&w,E=e.areaBaselineValue,_=E===void 0?0:E,T=e.areaOpacity,R=T===void 0?.2:T,F=e.enablePoints,I=F===void 0||F,P=e.pointSize,j=P===void 0?6:P,A=e.pointColor,M=A===void 0?{from:"color"}:A,N=e.pointBorderWidth,L=N===void 0?0:N,D=e.pointBorderColor,V=D===void 0?{theme:"background"}:D,X=e.enableGridX,q=X===void 0||X,Z=e.gridXValues,J=e.enableGridY,Q=J===void 0||J,K=e.gridYValues,Y=e.axisTop,W=e.axisRight,H=e.axisBottom,U=H===void 0?{}:H,z=e.axisLeft,ne=z===void 0?{}:z,B=e.legends,re=B===void 0?[]:B,ie=e.isInteractive,ue=ie===void 0||ie,me=e.debugMesh,ve=me!==void 0&&me,be=e.onMouseLeave,Ce=e.onClick,ge=e.tooltip,fe=ge===void 0?C0:ge,se=e.canvasRef,xe=Ra(n,r,i),ce=xe.margin,Ne=xe.innerWidth,Me=xe.innerHeight,Ie=xe.outerWidth,Le=xe.outerHeight,He=kt(),Xe=$.useState(null),je=Xe[0],Oe=Xe[1],nt=eT({data:s,xScale:c,xFormat:u,yScale:f,yFormat:h,width:Ne,height:Me,colors:x,curve:m,areaBaselineValue:_,pointColor:M,pointBorderColor:V}),We=nt.lineGenerator,Be=nt.areaGenerator,Se=nt.series,Fe=nt.xScale,ot=nt.yScale,ct=nt.points,De=b0({points:ct,width:Ne,height:Me,debug:ve}),qe=De.delaunay,Qe=De.voronoi;$.useEffect(function(){se&&(se.current=t.current),t.current.width=Ie*o,t.current.height=Le*o;var he=t.current.getContext("2d");he.scale(o,o),he.fillStyle=He.background,he.fillRect(0,0,Ie,Le),he.translate(ce.left,ce.top),b.forEach(function(we){if(typeof we=="function"&&we({ctx:he,innerWidth:Ne,innerHeight:Me,series:Se,points:ct,xScale:Fe,yScale:ot,lineWidth:S,lineGenerator:We,areaGenerator:Be,currentPoint:je,setCurrentPoint:Oe}),we==="grid"&&He.grid.line.strokeWidth>0&&(he.lineWidth=He.grid.line.strokeWidth,he.strokeStyle=He.grid.line.stroke,q&&Nu(he,{width:Ne,height:Me,scale:Fe,axis:"x",values:Z}),Q&&Nu(he,{width:Ne,height:Me,scale:ot,axis:"y",values:K})),we==="axes"&&xM(he,{xScale:Fe,yScale:ot,width:Ne,height:Me,top:Y,right:W,bottom:U,left:ne,theme:He}),we==="areas"&&O===!0){he.save(),he.globalAlpha=R,Be.context(he);for(var ke=Se.length-1;ke>=0;ke--)he.fillStyle=Se[ke].color,he.beginPath(),Be(Se[ke].data.map(function(Ue){return Ue.position})),he.fill();he.restore()}if(we==="lines"&&(We.context(he),Se.forEach(function(Ue){he.strokeStyle=Ue.color,he.lineWidth=S,he.beginPath(),We(Ue.data.map(function(at){return at.position})),he.stroke()})),we==="points"&&I===!0&&j>0&&ct.forEach(function(Ue){he.fillStyle=Ue.color,he.beginPath(),he.arc(Ue.x,Ue.y,j/2,0,2*Math.PI),he.fill(),L>0&&(he.strokeStyle=Ue.borderColor,he.lineWidth=L,he.stroke())}),we==="mesh"&&ve===!0&&(_M(he,Qe),je&&EM(he,Qe,je.index)),we==="legends"){var tt=Se.map(function(Ue){return{id:Ue.id,label:Ue.id,color:Ue.color}}).reverse();re.forEach(function(Ue){OO(he,Xn({},Ue,{data:Ue.data||tt,containerWidth:Ne,containerHeight:Me,theme:He}))})}})},[t,Ie,Le,b,He,We,Se,Fe,ot,q,Z,Q,K,Y,W,U,ne,re,ct,I,j,je]);var Je=$.useCallback(function(he){var we=c0(t.current,he),ke=we[0],tt=we[1];if(!SO(ce.left,ce.top,Ne,Me,ke,tt))return null;var Ue=qe.find(ke-ce.left,tt-ce.top);return ct[Ue]},[t,ce,Ne,Me,qe]),rt=Wr(),Ve=rt.showTooltipFromEvent,Te=rt.hideTooltip,st=$.useCallback(function(he){var we=Je(he);Oe(we),we?Ve($.createElement(fe,{point:we}),he):Te()},[Je,Oe,Ve,Te,fe]),mt=$.useCallback(function(he){Te(),Oe(null),je&&be&&be(je,he)},[Te,Oe,be]),Ee=$.useCallback(function(he){if(Ce){var we=Je(he);we&&Ce(we,he)}},[Je,Ce]);return k.jsx("canvas",{ref:t,width:Ie*o,height:Le*o,style:{width:Ie,height:Le,cursor:ue?"auto":"normal"},onMouseEnter:ue?st:void 0,onMouseMove:ue?st:void 0,onMouseLeave:ue?mt:void 0,onClick:ue?Ee:void 0})}),Jde=$.forwardRef(function(e,t){return k.jsx(Qde,Xn({},e,{canvasRef:t}))});$.forwardRef(function(e,t){return k.jsx(Wi,{children:function(n){var r=n.width,i=n.height;return k.jsx(Jde,Xn({width:r,height:i},e,{ref:t}))}})});const efe=({trendsData:e,height:t=null,margin:n={},colors:r={datum:"color"},xLeg:i,yLeg:a,tooltip:o=null})=>k.jsxs(k.Fragment,{children:[k.jsx(On,{}),k.jsx("div",{style:{width:"100%",height:t||600},children:k.jsx(Zde,{data:e,margin:{top:50,right:90,bottom:50,left:90,...n},colors:r,xScale:{type:"point"},yScale:{type:"linear",min:"auto",max:"auto",reverse:!1},axisTop:null,axisRight:null,axisBottom:{tickSize:5,tickPadding:5,tickRotation:0,legend:i,legendOffset:36,legendPosition:"middle"},axisLeft:{tickSize:5,tickPadding:5,tickRotation:0,legend:a,legendOffset:-70,legendPosition:"middle"},pointSize:10,pointColor:{theme:"background"},pointBorderWidth:2,pointBorderColor:{from:"serieColor"},pointLabelYOffset:-12,useMesh:!0,legends:[{anchor:"top-right",direction:"column",justify:!1,translateX:210,translateY:-40,itemsSpacing:0,itemDirection:"left-to-right",itemWidth:200,itemHeight:20,itemOpacity:.9,symbolSize:8,symbolShape:"circle",symbolBorderColor:"rgba(0, 0, 0, .5)",effects:[{on:"hover",style:{itemBackground:"rgba(0, 0, 0, .03)",itemOpacity:1}}]}],tooltip:s=>k.jsx(pi,{body:(o==null?void 0:o(s))||k.jsx("span",{children:"Line tooltip"})})})})]}),tfe=Mt.h3`
497
+ `,Hie=({pieChartData:e,title:t,isEmpty:n})=>{const r=({dataWithArc:i,centerX:a,centerY:o})=>{let s=0;return i.forEach(l=>{s+=l.value}),k.jsx("text",{x:a,y:o,textAnchor:"middle",dominantBaseline:"central",style:{fontSize:"16px",fontWeight:400},children:n?"Data niet openbaar beschikbaar":""})};return k.jsxs(k.Fragment,{children:[k.jsx(On,{}),k.jsxs("div",{style:{width:"100%",height:600,position:"relative"},children:[k.jsx(Wie,{children:t}),k.jsx(Vie,{colors:{scheme:n?"greys":"nivo"},tooltip:({datum:{id:i,label:a,value:o,color:s,unit:l}})=>k.jsx(pi,{label:a,amount:o,unit:l}),data:e,enableArcLabels:!n,enableArcLinkLabels:!n,margin:{top:40,right:80,bottom:80,left:80},innerRadius:.5,padAngle:.7,cornerRadius:3,activeOuterRadiusOffset:8,borderWidth:1,borderColor:{from:"color",modifiers:[["darker",.2]]},arcLinkLabelsSkipAngle:10,arcLinkLabelsTextColor:"#333333",arcLinkLabelsThickness:2,arcLinkLabelsColor:{from:"color"},arcLabelsSkipAngle:10,arcLabelsTextColor:{from:"color",modifiers:[["darker",2]]},isInteractive:!n,layers:["arcs","arcLabels","arcLinkLabels","legends",r],defs:[{id:"dots",type:"patternDots",background:"inherit",color:"rgba(255, 255, 255, 0.3)",size:4,padding:1,stagger:!0},{id:"lines",type:"patternLines",background:"inherit",color:"rgba(255, 255, 255, 0.3)",rotation:-45,lineWidth:6,spacing:10}]})]})]})};var Uie=pd,Gie=o0,qie=1,Kie=2;function Yie(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var l=s[0],c=e[l],u=s[1];if(o&&s[2]){if(c===void 0&&!(l in e))return!1}else{var d=new Uie;if(r)var f=r(c,u,l,e,t,d);if(!(f===void 0?Gie(u,c,qie|Kie,r,d):f))return!1}}return!0}var Xie=Yie,Zie=ti;function Qie(e){return e===e&&!Zie(e)}var BO=Qie,Jie=BO,eae=Bl;function tae(e){for(var t=eae(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Jie(i)]}return t}var nae=tae;function rae(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var VO=rae,iae=Xie,aae=nae,oae=VO;function sae(e){var t=aae(e);return t.length==1&&t[0][2]?oae(t[0][0],t[0][1]):function(n){return n===e||iae(n,e,t)}}var lae=sae,cae=o0,uae=L_,dae=GE,fae=wp,hae=BO,vae=VO,gae=Ko,mae=1,pae=2;function bae(e,t){return fae(e)&&hae(t)?vae(gae(e),t):function(n){var r=uae(n,e);return r===void 0&&r===t?dae(n,e):cae(t,r,mae|pae)}}var yae=bae;function xae(e){return function(t){return t==null?void 0:t[e]}}var Sae=xae,Cae=Fl;function wae(e){return function(t){return Cae(t,e)}}var $ae=wae,_ae=Sae,Eae=$ae,Oae=wp,Mae=Ko;function Tae(e){return Oae(e)?_ae(Mae(e)):Eae(e)}var Rae=Tae,Pae=lae,Iae=yae,Aae=wd,Nae=tr,jae=Rae;function Lae(e){return typeof e=="function"?e:e==null?Aae:typeof e=="object"?Nae(e)?Iae(e[0],e[1]):Pae(e):jae(e)}var f0=Lae,kae=f0,Dae=M$;function Fae(e,t){return e&&e.length?Dae(e,kae(t)):[]}var zae=Fae;const Bae=rn(zae);var Vae=b_,Wae=Bl;function Hae(e,t){return e&&Vae(e,t,Wae)}var Uae=Hae,Gae=Ho;function qae(e,t){return function(n,r){if(n==null)return n;if(!Gae(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var Kae=qae,Yae=Uae,Xae=Kae,Zae=Xae(Yae),WO=Zae,Qae=WO,Jae=Ho;function eoe(e,t){var n=-1,r=Jae(e)?Array(e.length):[];return Qae(e,function(i,a,o){r[++n]=t(i,a,o)}),r}var toe=eoe;function noe(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var roe=noe,wS=$d;function ioe(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=wS(e),o=t!==void 0,s=t===null,l=t===t,c=wS(t);if(!s&&!c&&!a&&e>t||a&&o&&l&&!s&&!c||r&&o&&l||!n&&l||!i)return 1;if(!r&&!a&&!c&&e<t||c&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!l)return-1}return 0}var aoe=ioe,ooe=aoe;function soe(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var l=ooe(i[r],a[r]);if(l){if(r>=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return e.index-t.index}var loe=soe,Lh=_d,coe=Fl,uoe=f0,doe=toe,foe=roe,hoe=Uo,voe=loe,goe=wd,moe=tr;function poe(e,t,n){t.length?t=Lh(t,function(a){return moe(a)?function(o){return coe(o,a.length===1?a[0]:a)}:a}):t=[goe];var r=-1;t=Lh(t,hoe(uoe));var i=doe(e,function(a,o,s){var l=Lh(t,function(c){return c(a)});return{criteria:l,index:++r,value:a}});return foe(i,function(a,o){return voe(a,o,n)})}var boe=poe,yoe=KE,xoe=boe,Soe=Cp,$S=A_,Coe=Soe(function(e,t){if(e==null)return[];var n=t.length;return n>1&&$S(e,t[0],t[1])?t=[]:n>2&&$S(t[0],t[1],t[2])&&(t=[t[0]]),xoe(e,yoe(t,1),[])}),woe=Coe;const $oe=rn(woe);var _oe=yi,Eoe=Tr,Ooe="[object Date]";function Moe(e){return Eoe(e)&&_oe(e)==Ooe}var Toe=Moe,Roe=Toe,Poe=Uo,_S=Sd,ES=_S&&_S.isDate,Ioe=ES?Poe(ES):Roe,Aoe=Ioe;const Noe=rn(Aoe);var kh=new Date,Dh=new Date;function En(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=function(a){return e(a=new Date(+a)),a},i.ceil=function(a){return e(a=new Date(a-1)),t(a,1),e(a),a},i.round=function(a){var o=i(a),s=i.ceil(a);return a-o<s-a?o:s},i.offset=function(a,o){return t(a=new Date(+a),o==null?1:Math.floor(o)),a},i.range=function(a,o,s){var l=[],c;if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a<o)||!(s>0))return l;do l.push(c=new Date(+a)),t(a,s),e(a);while(c<a&&a<o);return l},i.filter=function(a){return En(function(o){if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},function(o,s){if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););})},n&&(i.count=function(a,o){return kh.setTime(+a),Dh.setTime(+o),e(kh),e(Dh),Math.floor(n(kh,Dh))},i.every=function(a){return a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?function(o){return r(o)%a===0}:function(o){return i.count(0,o)%a===0}):i}),i}var pl=En(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});pl.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?En(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):pl};pl.range;var Iu=1e3,To=6e4,Au=36e5,HO=6048e5,kg=En(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*Iu)},function(e,t){return(t-e)/Iu},function(e){return e.getUTCSeconds()});kg.range;var UO=En(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Iu)},function(e,t){e.setTime(+e+t*To)},function(e,t){return(t-e)/To},function(e){return e.getMinutes()});UO.range;var GO=En(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*Iu-e.getMinutes()*To)},function(e,t){e.setTime(+e+t*Au)},function(e,t){return(t-e)/Au},function(e){return e.getHours()});GO.range;function Ia(e){return En(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n*7)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*To)/HO})}var Dg=Ia(0),qO=Ia(1),KO=Ia(2),YO=Ia(3),XO=Ia(4),ZO=Ia(5),QO=Ia(6);Dg.range;qO.range;KO.range;YO.range;XO.range;ZO.range;QO.range;var JO=En(function(e){e.setDate(1),e.setHours(0,0,0,0)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12},function(e){return e.getMonth()});JO.range;var h0=En(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});h0.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:En(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)})};h0.range;var eM=En(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*To)},function(e,t){return(t-e)/To},function(e){return e.getUTCMinutes()});eM.range;var tM=En(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*Au)},function(e,t){return(t-e)/Au},function(e){return e.getUTCHours()});tM.range;function Aa(e){return En(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n*7)},function(t,n){return(n-t)/HO})}var Fg=Aa(0),nM=Aa(1),rM=Aa(2),iM=Aa(3),aM=Aa(4),oM=Aa(5),sM=Aa(6);Fg.range;nM.range;rM.range;iM.range;aM.range;oM.range;sM.range;var lM=En(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12},function(e){return e.getUTCMonth()});lM.range;var v0=En(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});v0.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:En(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)})};v0.range;function Zi(){return Zi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zi.apply(this,arguments)}var Ka=[function(e){return e.setMilliseconds(0)},function(e){return e.setSeconds(0)},function(e){return e.setMinutes(0)},function(e){return e.setHours(0)},function(e){return e.setDate(1)},function(e){return e.setMonth(0)}],joe={millisecond:[],second:Ka.slice(0,1),minute:Ka.slice(0,2),hour:Ka.slice(0,3),day:Ka.slice(0,4),month:Ka.slice(0,5),year:Ka.slice(0,6)},Loe=function(e){return function(t){return joe[e].forEach(function(n){n(t)}),t}},cM=function(e){var t=e.format,n=t===void 0?"native":t,r=e.precision,i=r===void 0?"millisecond":r,a=e.useUTC,o=a===void 0||a,s=Loe(i);return function(l){if(l===void 0)return l;if(n==="native"||l instanceof Date)return s(l);var c=o?UE(n):HE(n);return s(c(l))}},koe=function(e,t,n,r){var i,a,o,s,l=e.min,c=l===void 0?0:l,u=e.max,d=u===void 0?"auto":u,f=e.stacked,h=f!==void 0&&f,p=e.reverse,m=p!==void 0&&p,v=e.clamp,b=v!==void 0&&v,y=e.nice,x=y!==void 0&&y;c==="auto"?i=h===!0?(a=t.minStacked)!=null?a:0:t.min:i=c,d==="auto"?o=h===!0?(s=t.maxStacked)!=null?s:0:t.max:o=d;var C=Np().rangeRound(r==="x"?[0,n]:[n,0]).domain(m?[o,i]:[i,o]).clamp(b);return x===!0?C.nice():typeof x=="number"&&C.nice(x),Doe(C,h)},Doe=function(e,t){t===void 0&&(t=!1);var n=e;return n.type="linear",n.stacked=t,n},Foe=function(e,t,n){var r=JG().range([0,n]).domain(t.all);return r.type="point",r},zoe=function(e,t,n,r){var i=e.round,a=i===void 0||i,o=Rp().range(r==="x"?[0,n]:[n,0]).domain(t.all).round(a);return Boe(o)},Boe=function(e){var t=e;return t.type="band",t},Voe=function(e,t,n){var r,i,a=e.format,o=a===void 0?"native":a,s=e.precision,l=s===void 0?"millisecond":s,c=e.min,u=c===void 0?"auto":c,d=e.max,f=d===void 0?"auto":d,h=e.useUTC,p=h===void 0||h,m=e.nice,v=m!==void 0&&m,b=cM({format:o,precision:l,useUTC:p});r=u==="auto"?b(t.min):o!=="native"?b(u):u,i=f==="auto"?b(t.max):o!=="native"?b(f):f;var y=p?GK():UK();y.range([0,n]),r&&i&&y.domain([r,i]),v===!0?y.nice():typeof v!="object"&&typeof v!="number"||y.nice(v);var x=y;return x.type="time",x.useUTC=p,x},Woe=function(e,t,n,r){var i,a=e.base,o=a===void 0?10:a,s=e.min,l=s===void 0?"auto":s,c=e.max,u=c===void 0?"auto":c;if(t.all.some(function(m){return m===0}))throw new Error("a log scale domain must not include or cross zero");var d,f,h=!1;if(t.all.filter(function(m){return m!=null}).forEach(function(m){h||(i===void 0?i=Math.sign(m):Math.sign(m)!==i&&(h=!0))}),h)throw new Error("a log scale domain must be strictly-positive or strictly-negative");d=l==="auto"?t.min:l,f=u==="auto"?t.max:u;var p=J_().domain([d,f]).rangeRound(r==="x"?[0,n]:[n,0]).base(o).nice();return p.type="log",p},Hoe=function(e,t,n,r){var i,a,o=e.constant,s=o===void 0?1:o,l=e.min,c=l===void 0?"auto":l,u=e.max,d=u===void 0?"auto":u,f=e.reverse,h=f!==void 0&&f;i=c==="auto"?t.min:c,a=d==="auto"?t.max:d;var p=eE().constant(s).rangeRound(r==="x"?[0,n]:[n,0]).nice();h===!0?p.domain([a,i]):p.domain([i,a]);var m=p;return m.type="symlog",m},Uoe=function(e){return e==="x"?"y":"x"},Goe=function(e,t){return e===t},qoe=function(e,t){return e.getTime()===t.getTime()};function OS(e,t,n,r){switch(e.type){case"linear":return koe(e,t,n,r);case"point":return Foe(e,t,n);case"band":return zoe(e,t,n,r);case"time":return Voe(e,t,n);case"log":return Woe(e,t,n,r);case"symlog":return Hoe(e,t,n,r);default:throw new Error("invalid scale spec")}}var MS=function(e,t,n){var r;if("stacked"in n&&n.stacked){var i=e.data[t==="x"?"xStacked":"yStacked"];return i==null?null:n(i)}return(r=n(e.data[t]))!=null?r:null},uM=function(e,t,n,r,i){var a=e.map(function(u){return function(d){return Zi({},d,{data:d.data.map(function(f){return{data:Zi({},f)}})})}(u)}),o=Koe(a,t,n);"stacked"in t&&t.stacked===!0&&Yoe(o,a),"stacked"in n&&n.stacked===!0&&Xoe(o,a);var s=OS(t,o.x,r,"x"),l=OS(n,o.y,i,"y"),c=a.map(function(u){return Zi({},u,{data:u.data.map(function(d){return Zi({},d,{position:{x:MS(d,"x",s),y:MS(d,"y",l)}})})})});return Zi({},o,{series:c,xScale:s,yScale:l})},Koe=function(e,t,n){return{x:TS(e,"x",t),y:TS(e,"y",n)}},TS=function(e,t,n,r){var i={},a=i.getValue,o=a===void 0?function(p){return p.data[t]}:a,s=i.setValue,l=s===void 0?function(p,m){p.data[t]=m}:s;if(n.type==="linear")e.forEach(function(p){p.data.forEach(function(m){var v=o(m);v&&l(m,parseFloat(String(v)))})});else if(n.type==="time"&&n.format!=="native"){var c=cM(n);e.forEach(function(p){p.data.forEach(function(m){var v=o(m);v&&l(m,c(v))})})}var u=[];switch(e.forEach(function(p){p.data.forEach(function(m){u.push(o(m))})}),n.type){case"linear":var d=$oe(tg(u).filter(function(p){return p!==null}),function(p){return p});return{all:d,min:Math.min.apply(Math,d),max:Math.max.apply(Math,d)};case"time":var f=Bae(u,function(p){return p.getTime()}).slice(0).sort(function(p,m){return m.getTime()-p.getTime()}).reverse();return{all:f,min:f[0],max:dt(f)};default:var h=tg(u);return{all:h,min:h[0],max:dt(h)}}},dM=function(e,t,n){var r=Uoe(e),i=[];t[r].all.forEach(function(a){var o=Noe(a)?qoe:Goe,s=[];n.forEach(function(l){var c=l.data.find(function(h){return o(h.data[r],a)}),u=null,d=null;if(c!==void 0){if((u=c.data[e])!==null){var f=dt(s);f===void 0?d=u:f!==null&&(d=f+u)}c.data[e==="x"?"xStacked":"yStacked"]=d}s.push(d),d!==null&&i.push(d)})}),t[e].minStacked=Math.min.apply(Math,i),t[e].maxStacked=Math.max.apply(Math,i)},Yoe=function(e,t){return dM("x",e,t)},Xoe=function(e,t){return dM("y",e,t)},fM=function(e){var t=e.bandwidth();if(t===0)return e;var n=t/2;return e.round()&&(n=Math.round(n)),function(r){var i;return((i=e(r))!=null?i:0)+n}},hM={millisecond:[pl,pl],second:[kg,kg],minute:[UO,eM],hour:[GO,tM],day:[En(function(e){return e.setHours(0,0,0,0)},function(e,t){return e.setDate(e.getDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)}),En(function(e){return e.setUTCHours(0,0,0,0)},function(e,t){return e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t.getTime()-e.getTime())/864e5},function(e){return Math.floor(e.getTime()/864e5)})],week:[Dg,Fg],sunday:[Dg,Fg],monday:[qO,nM],tuesday:[KO,rM],wednesday:[YO,iM],thursday:[XO,aM],friday:[ZO,oM],saturday:[QO,sM],month:[JO,lM],year:[h0,v0]},Zoe=Object.keys(hM),Qoe=new RegExp("^every\\s*(\\d+)?\\s*("+Zoe.join("|")+")s?$","i"),vM=function(e,t){if(Array.isArray(t))return t;if(typeof t=="string"&&"useUTC"in e){var n=t.match(Qoe);if(n){var r=n[1],i=n[2],a=hM[i][e.useUTC?1:0];if(i==="day"){var o,s,l=e.domain(),c=l[0],u=l[1],d=new Date(u);return d.setDate(d.getDate()+1),(o=(s=a.every(Number(r??1)))==null?void 0:s.range(c,d))!=null?o:[]}if(r===void 0)return e.ticks(a);var f=a.every(Number(r));if(f)return e.ticks(f)}throw new Error("Invalid tickValues: "+t)}if("ticks"in e){if(t===void 0)return e.ticks();if(typeof(h=t)=="number"&&isFinite(h)&&Math.floor(h)===h)return e.ticks(t)}var h;return e.domain()};function wr(){return wr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wr.apply(this,arguments)}var gM=function(e){var t,n=e.axis,r=e.scale,i=e.ticksPosition,a=e.tickValues,o=e.tickSize,s=e.tickPadding,l=e.tickRotation,c=e.truncateTickAt,u=e.engine,d=u===void 0?"svg":u,f=vM(r,a),h=Pee[d],p="bandwidth"in r?fM(r):r,m={lineX:0,lineY:0},v={textX:0,textY:0},b=typeof document=="object"&&document.dir==="rtl",y=h.align.center,x=h.baseline.center;return n==="x"?(t=function(C){var S;return{x:(S=p(C))!=null?S:0,y:0}},m.lineY=o*(i==="after"?1:-1),v.textY=(o+s)*(i==="after"?1:-1),x=i==="after"?h.baseline.top:h.baseline.bottom,l===0?y=h.align.center:i==="after"&&l<0||i==="before"&&l>0?(y=h.align[b?"left":"right"],x=h.baseline.center):(i==="after"&&l>0||i==="before"&&l<0)&&(y=h.align[b?"right":"left"],x=h.baseline.center)):(t=function(C){var S;return{x:0,y:(S=p(C))!=null?S:0}},m.lineX=o*(i==="after"?1:-1),v.textX=(o+s)*(i==="after"?1:-1),y=i==="after"?h.align.left:h.align.right),{ticks:f.map(function(C){var S=typeof C=="string"?function(w){var O=String(w).length;return c&&c>0&&O>c?""+String(w).slice(0,c).concat("..."):""+w}(C):C;return wr({key:C instanceof Date?""+C.valueOf():""+C,value:S},t(C),m,v)}),textAlign:y,textBaseline:x}},mM=function(e,t){if(e===void 0||typeof e=="function")return e;if(t.type==="time"){var n=r0(e);return function(r){return n(r instanceof Date?r:new Date(r))}}return Qp(e)},zg=function(e){var t,n=e.width,r=e.height,i=e.scale,a=e.axis,o=e.values,s=(t=o,(Array.isArray(t)?o:void 0)||vM(i,o)),l="bandwidth"in i?fM(i):i,c=a==="x"?s.map(function(u){var d,f;return{key:u instanceof Date?""+u.valueOf():""+u,x1:(d=l(u))!=null?d:0,x2:(f=l(u))!=null?f:0,y1:0,y2:r}}):s.map(function(u){var d,f;return{key:u instanceof Date?""+u.valueOf():""+u,x1:0,x2:n,y1:(d=l(u))!=null?d:0,y2:(f=l(u))!=null?f:0}});return c},Joe=$.memo(function(e){var t,n=e.value,r=e.format,i=e.lineX,a=e.lineY,o=e.onClick,s=e.textBaseline,l=e.textAnchor,c=e.animatedProps,u=kt(),d=u.axis.ticks.line,f=u.axis.ticks.text,h=(t=r==null?void 0:r(n))!=null?t:n,p=$.useMemo(function(){var m={opacity:c.opacity};return o?{style:wr({},m,{cursor:"pointer"}),onClick:function(v){return o(v,h)}}:{style:m}},[c.opacity,o,h]);return k.jsxs(Tt.g,wr({transform:c.transform},p,{children:[k.jsx("line",{x1:0,x2:i,y1:0,y2:a,style:d}),f.outlineWidth>0&&k.jsx(Tt.text,{dominantBaseline:s,textAnchor:l,transform:c.textTransform,style:f,strokeWidth:2*f.outlineWidth,stroke:f.outlineColor,strokeLinejoin:"round",children:""+h}),k.jsx(Tt.text,{dominantBaseline:s,textAnchor:l,transform:c.textTransform,style:l0(f),children:""+h})]}))}),ese=function(e){var t=e.axis,n=e.scale,r=e.x,i=r===void 0?0:r,a=e.y,o=a===void 0?0:a,s=e.length,l=e.ticksPosition,c=e.tickValues,u=e.tickSize,d=u===void 0?5:u,f=e.tickPadding,h=f===void 0?5:f,p=e.tickRotation,m=p===void 0?0:p,v=e.format,b=e.renderTick,y=b===void 0?Joe:b,x=e.truncateTickAt,C=e.legend,S=e.legendPosition,w=S===void 0?"end":S,O=e.legendOffset,E=O===void 0?0:O,_=e.onClick,T=e.ariaHidden,R=kt(),F=R.axis.legend.text,I=$.useMemo(function(){return mM(v,n)},[v,n]),P=gM({axis:t,scale:n,ticksPosition:l,tickValues:c,tickSize:d,tickPadding:h,tickRotation:m,truncateTickAt:x}),j=P.ticks,A=P.textAlign,M=P.textBaseline,N=null;if(C!==void 0){var L,D=0,V=0,X=0;t==="y"?(X=-90,D=E,w==="start"?(L="start",V=s):w==="middle"?(L="middle",V=s/2):w==="end"&&(L="end")):(V=E,w==="start"?L="start":w==="middle"?(L="middle",D=s/2):w==="end"&&(L="end",D=s)),N=k.jsxs(k.Fragment,{children:[F.outlineWidth>0&&k.jsx("text",{transform:"translate("+D+", "+V+") rotate("+X+")",textAnchor:L,style:wr({dominantBaseline:"central"},F),strokeWidth:2*F.outlineWidth,stroke:F.outlineColor,strokeLinejoin:"round",children:C}),k.jsx("text",{transform:"translate("+D+", "+V+") rotate("+X+")",textAnchor:L,style:wr({dominantBaseline:"central"},F),children:C})]})}var q=Sn(),Z=q.animate,J=q.config,Q=Mr({transform:"translate("+i+","+o+")",lineX2:t==="x"?s:0,lineY2:t==="x"?0:s,config:J,immediate:!Z}),K=$.useCallback(function(H){return{opacity:1,transform:"translate("+H.x+","+H.y+")",textTransform:"translate("+H.textX+","+H.textY+") rotate("+m+")"}},[m]),Y=$.useCallback(function(H){return{opacity:0,transform:"translate("+H.x+","+H.y+")",textTransform:"translate("+H.textX+","+H.textY+") rotate("+m+")"}},[m]),W=$a(j,{keys:function(H){return H.key},initial:K,from:Y,enter:K,update:K,leave:{opacity:0},config:J,immediate:!Z});return k.jsxs(Tt.g,{transform:Q.transform,"aria-hidden":T,children:[W(function(H,U,z,ne){return g.createElement(y,wr({tickIndex:ne,format:I,rotate:m,textBaseline:M,textAnchor:A,truncateTickAt:x,animatedProps:H},U,_?{onClick:_}:{}))}),k.jsx(Tt.line,{style:R.axis.domain.line,x1:0,x2:Q.lineX2,y1:0,y2:Q.lineY2}),N]})},tse=$.memo(ese),pM=["top","right","bottom","left"],bM=$.memo(function(e){var t=e.xScale,n=e.yScale,r=e.width,i=e.height,a={top:e.top,right:e.right,bottom:e.bottom,left:e.left};return k.jsx(k.Fragment,{children:pM.map(function(o){var s=a[o];if(!s)return null;var l=o==="top"||o==="bottom";return k.jsx(tse,wr({},s,{axis:l?"x":"y",x:o==="right"?r:0,y:o==="bottom"?i:0,scale:l?t:n,length:l?r:i,ticksPosition:o==="top"||o==="left"?"before":"after",truncateTickAt:s.truncateTickAt}),o)})})}),nse=$.memo(function(e){var t=e.animatedProps,n=kt();return k.jsx(Tt.line,wr({},t,n.grid.line))}),RS=$.memo(function(e){var t=e.lines,n=Sn(),r=n.animate,i=n.config,a=$a(t,{keys:function(o){return o.key},initial:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},from:function(o){return{opacity:0,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},enter:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},update:function(o){return{opacity:1,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2}},leave:{opacity:0},config:i,immediate:!r});return k.jsx("g",{children:a(function(o,s){return $.createElement(nse,wr({},s,{key:s.key,animatedProps:o}))})})}),yM=$.memo(function(e){var t=e.width,n=e.height,r=e.xScale,i=e.yScale,a=e.xValues,o=e.yValues,s=$.useMemo(function(){return!!r&&zg({width:t,height:n,scale:r,axis:"x",values:a})},[r,a,t,n]),l=$.useMemo(function(){return!!i&&zg({width:t,height:n,scale:i,axis:"y",values:o})},[n,t,i,o]);return k.jsxs(k.Fragment,{children:[s&&k.jsx(RS,{lines:s}),l&&k.jsx(RS,{lines:l})]})}),rse=function(e,t){var n,r=t.axis,i=t.scale,a=t.x,o=a===void 0?0:a,s=t.y,l=s===void 0?0:s,c=t.length,u=t.ticksPosition,d=t.tickValues,f=t.tickSize,h=f===void 0?5:f,p=t.tickPadding,m=p===void 0?5:p,v=t.tickRotation,b=v===void 0?0:v,y=t.format,x=t.legend,C=t.legendPosition,S=C===void 0?"end":C,w=t.legendOffset,O=w===void 0?0:w,E=t.theme,_=gM({axis:r,scale:i,ticksPosition:u,tickValues:d,tickSize:h,tickPadding:m,tickRotation:b,engine:"canvas"}),T=_.ticks,R=_.textAlign,F=_.textBaseline;e.save(),e.translate(o,l),e.textAlign=R,e.textBaseline=F;var I=E.axis.ticks.text;e.font=(I.fontWeight?I.fontWeight+" ":"")+I.fontSize+"px "+I.fontFamily,((n=E.axis.domain.line.strokeWidth)!=null?n:0)>0&&(e.lineWidth=Number(E.axis.domain.line.strokeWidth),e.lineCap="square",E.axis.domain.line.stroke&&(e.strokeStyle=E.axis.domain.line.stroke),e.beginPath(),e.moveTo(0,0),e.lineTo(r==="x"?c:0,r==="x"?0:c),e.stroke());var P=typeof y=="function"?y:function(L){return""+L};if(T.forEach(function(L){var D;((D=E.axis.ticks.line.strokeWidth)!=null?D:0)>0&&(e.lineWidth=Number(E.axis.ticks.line.strokeWidth),e.lineCap="square",E.axis.ticks.line.stroke&&(e.strokeStyle=E.axis.ticks.line.stroke),e.beginPath(),e.moveTo(L.x,L.y),e.lineTo(L.x+L.lineX,L.y+L.lineY),e.stroke());var V=P(L.value);e.save(),e.translate(L.x+L.textX,L.y+L.textY),e.rotate(Cr(b)),I.outlineWidth>0&&(e.strokeStyle=I.outlineColor,e.lineWidth=2*I.outlineWidth,e.lineJoin="round",e.strokeText(""+V,0,0)),E.axis.ticks.text.fill&&(e.fillStyle=I.fill),e.fillText(""+V,0,0),e.restore()}),x!==void 0){var j=0,A=0,M=0,N="center";r==="y"?(M=-90,j=O,S==="start"?(N="start",A=c):S==="middle"?(N="center",A=c/2):S==="end"&&(N="end")):(A=O,S==="start"?N="start":S==="middle"?(N="center",j=c/2):S==="end"&&(N="end",j=c)),e.translate(j,A),e.rotate(Cr(M)),e.font=(E.axis.legend.text.fontWeight?E.axis.legend.text.fontWeight+" ":"")+E.axis.legend.text.fontSize+"px "+E.axis.legend.text.fontFamily,E.axis.legend.text.fill&&(e.fillStyle=E.axis.legend.text.fill),e.textAlign=N,e.textBaseline="middle",e.fillText(x,0,0)}e.restore()},xM=function(e,t){var n=t.xScale,r=t.yScale,i=t.width,a=t.height,o=t.top,s=t.right,l=t.bottom,c=t.left,u=t.theme,d={top:o,right:s,bottom:l,left:c};pM.forEach(function(f){var h=d[f];if(!h)return null;var p=f==="top"||f==="bottom",m=f==="top"||f==="left"?"before":"after",v=p?n:r,b=mM(h.format,v);rse(e,wr({},h,{axis:p?"x":"y",x:f==="right"?i:0,y:f==="bottom"?a:0,scale:v,format:b,length:p?i:a,ticksPosition:m,theme:u}))})},Nu=function(e,t){var n=t.width,r=t.height,i=t.scale,a=t.axis,o=t.values;zg({width:n,height:r,scale:i,axis:a,values:o}).forEach(function(s){e.beginPath(),e.moveTo(s.x1,s.y1),e.lineTo(s.x2,s.y2),e.stroke()})},ise=WO;function ase(e,t){var n=[];return ise(e,function(r,i,a){t(r,i,a)&&n.push(r)}),n}var ose=ase,sse=QE,lse=ose,cse=f0,use=tr;function dse(e,t){var n=use(e)?sse:lse;return n(e,cse(t))}var fse=dse;const hse=rn(fse);var vse=yi,gse=Tr,mse="[object Number]";function pse(e){return typeof e=="number"||gse(e)&&vse(e)==mse}var bse=pse;const Bg=rn(bse);function yse(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}var SM=yse,xse=Fl,Sse=SM;function Cse(e,t){return t.length<2?e:xse(e,Sse(t,0,-1))}var wse=Cse,$se=qo,_se=U_,Ese=wse,Ose=Ko;function Mse(e,t){return t=$se(t,e),e=Ese(e,t),e==null||delete e[Ose(_se(t))]}var Tse=Mse,Rse=yp;function Pse(e){return Rse(e)?void 0:e}var Ise=Pse,Ase=_d,Nse=NO,jse=Tse,Lse=qo,kse=Go,Dse=Ise,Fse=YE,zse=RO,Bse=1,Vse=2,Wse=4,Hse=Fse(function(e,t){var n={};if(e==null)return n;var r=!1;t=Ase(t,function(a){return a=Lse(a,e),r||(r=a.length>1),a}),kse(e,zse(e),n),r&&(n=Nse(n,Bse|Vse|Wse,Dse));for(var i=t.length;i--;)jse(n,t[i]);return n}),Use=Hse;const g0=rn(Use);function Di(){return Di=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Di.apply(this,arguments)}var Vg={dotSize:4,noteWidth:120,noteTextOffset:8,animate:!0},Gse=function(e){var t=typeof e;return $.isValidElement(e)||t==="string"||t==="function"||t==="object"},qse=function(e){var t=typeof e;return t==="string"||t==="function"},bl=function(e){return e.type==="circle"},Wg=function(e){return e.type==="dot"},yl=function(e){return e.type==="rect"},Kse=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return n.reduce(function(a,o){var s=o.offset||0;return[].concat(a,hse(t,o.match).map(function(l){var c=r(l),u=i(l);return(bl(o)||yl(o))&&(u.size=u.size+2*s,u.width=u.width+2*s,u.height=u.height+2*s),Di({},g0(o,["match","offset"]),c,u,{size:o.size||u.size,datum:l})}))},[])},Yse=function(e,t,n,r){var i=Math.atan2(r-t,n-e);return Ree(hf(i))},Xse=function(e){var t,n,r=e.x,i=e.y,a=e.noteX,o=e.noteY,s=e.noteWidth,l=s===void 0?Vg.noteWidth:s,c=e.noteTextOffset,u=c===void 0?Vg.noteTextOffset:c;if(Bg(a))t=r+a;else{if(a.abs===void 0)throw new Error("noteX should be either a number or an object containing an 'abs' property");t=a.abs}if(Bg(o))n=i+o;else{if(o.abs===void 0)throw new Error("noteY should be either a number or an object containing an 'abs' property");n=o.abs}var d=r,f=i,h=Yse(r,i,t,n);if(bl(e)){var p=ca(Cr(h),e.size/2);d+=p.x,f+=p.y}if(yl(e)){var m=Math.round((h+90)/45)%8;m===0&&(f-=e.height/2),m===1&&(d+=e.width/2,f-=e.height/2),m===2&&(d+=e.width/2),m===3&&(d+=e.width/2,f+=e.height/2),m===4&&(f+=e.height/2),m===5&&(d-=e.width/2,f+=e.height/2),m===6&&(d-=e.width/2),m===7&&(d-=e.width/2,f-=e.height/2)}var v=t,b=t;return(h+90)%360>180?(v-=l,b-=l):b+=l,{points:[[d,f],[t,n],[b,n]],text:[v,n-u],angle:h+90}},Zse=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return $.useMemo(function(){return Kse({data:t,annotations:n,getPosition:r,getDimensions:i})},[t,n,r,i])},Qse=function(e){return $.useMemo(function(){return Xse(e)},[e])},Jse=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,a=kt(),o=Sn(),s=o.animate,l=o.config,c=Mr({x:n,y:r,config:l,immediate:!s});return typeof i=="function"?$.createElement(i,{x:n,y:r,datum:t}):k.jsxs(k.Fragment,{children:[a.annotations.text.outlineWidth>0&&k.jsx(Tt.text,{x:c.x,y:c.y,style:Di({},a.annotations.text,{strokeLinejoin:"round",strokeWidth:2*a.annotations.text.outlineWidth,stroke:a.annotations.text.outlineColor}),children:i}),k.jsx(Tt.text,{x:c.x,y:c.y,style:g0(a.annotations.text,["outlineWidth","outlineColor"]),children:i})]})},PS=function(e){var t=e.points,n=e.isOutline,r=n!==void 0&&n,i=kt(),a=$.useMemo(function(){var l=t[0];return t.slice(1).reduce(function(c,u){return c+" L"+u[0]+","+u[1]},"M"+l[0]+","+l[1])},[t]),o=ff(a);if(r&&i.annotations.link.outlineWidth<=0)return null;var s=Di({},i.annotations.link);return r&&(s.strokeLinecap="square",s.strokeWidth=i.annotations.link.strokeWidth+2*i.annotations.link.outlineWidth,s.stroke=i.annotations.link.outlineColor,s.opacity=i.annotations.link.outlineOpacity),k.jsx(Tt.path,{fill:"none",d:o,style:s})},ele=function(e){var t=e.x,n=e.y,r=e.size,i=kt(),a=Sn(),o=a.animate,s=a.config,l=Mr({x:t,y:n,radius:r/2,config:s,immediate:!o});return k.jsxs(k.Fragment,{children:[i.annotations.outline.outlineWidth>0&&k.jsx(Tt.circle,{cx:l.x,cy:l.y,r:l.radius,style:Di({},i.annotations.outline,{fill:"none",strokeWidth:i.annotations.outline.strokeWidth+2*i.annotations.outline.outlineWidth,stroke:i.annotations.outline.outlineColor,opacity:i.annotations.outline.outlineOpacity})}),k.jsx(Tt.circle,{cx:l.x,cy:l.y,r:l.radius,style:i.annotations.outline})]})},tle=function(e){var t=e.x,n=e.y,r=e.size,i=r===void 0?Vg.dotSize:r,a=kt(),o=Sn(),s=o.animate,l=o.config,c=Mr({x:t,y:n,radius:i/2,config:l,immediate:!s});return k.jsxs(k.Fragment,{children:[a.annotations.outline.outlineWidth>0&&k.jsx(Tt.circle,{cx:c.x,cy:c.y,r:c.radius,style:Di({},a.annotations.outline,{fill:"none",strokeWidth:2*a.annotations.outline.outlineWidth,stroke:a.annotations.outline.outlineColor,opacity:a.annotations.outline.outlineOpacity})}),k.jsx(Tt.circle,{cx:c.x,cy:c.y,r:c.radius,style:a.annotations.symbol})]})},nle=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.borderRadius,o=a===void 0?6:a,s=kt(),l=Sn(),c=l.animate,u=l.config,d=Mr({x:t-r/2,y:n-i/2,width:r,height:i,config:u,immediate:!c});return k.jsxs(k.Fragment,{children:[s.annotations.outline.outlineWidth>0&&k.jsx(Tt.rect,{x:d.x,y:d.y,rx:o,ry:o,width:d.width,height:d.height,style:Di({},s.annotations.outline,{fill:"none",strokeWidth:s.annotations.outline.strokeWidth+2*s.annotations.outline.outlineWidth,stroke:s.annotations.outline.outlineColor,opacity:s.annotations.outline.outlineOpacity})}),k.jsx(Tt.rect,{x:d.x,y:d.y,rx:o,ry:o,width:d.width,height:d.height,style:s.annotations.outline})]})},rle=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,a=Qse(e);if(!Gse(i))throw new Error("note should be a valid react element");return k.jsxs(k.Fragment,{children:[k.jsx(PS,{points:a.points,isOutline:!0}),bl(e)&&k.jsx(ele,{x:n,y:r,size:e.size}),Wg(e)&&k.jsx(tle,{x:n,y:r,size:e.size}),yl(e)&&k.jsx(nle,{x:n,y:r,width:e.width,height:e.height,borderRadius:e.borderRadius}),k.jsx(PS,{points:a.points}),k.jsx(Jse,{datum:t,x:a.text[0],y:a.text[1],note:i})]})},IS=function(e,t){t.forEach(function(n,r){var i=n[0],a=n[1];r===0?e.moveTo(i,a):e.lineTo(i,a)})},ile=function(e,t){var n=t.annotations,r=t.theme;n.length!==0&&(e.save(),n.forEach(function(i){if(!qse(i.note))throw new Error("note is invalid for canvas implementation");r.annotations.link.outlineWidth>0&&(e.lineCap="square",e.strokeStyle=r.annotations.link.outlineColor,e.lineWidth=r.annotations.link.strokeWidth+2*r.annotations.link.outlineWidth,e.beginPath(),IS(e,i.computed.points),e.stroke(),e.lineCap="butt"),bl(i)&&r.annotations.outline.outlineWidth>0&&(e.strokeStyle=r.annotations.outline.outlineColor,e.lineWidth=r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),Wg(i)&&r.annotations.symbol.outlineWidth>0&&(e.strokeStyle=r.annotations.symbol.outlineColor,e.lineWidth=2*r.annotations.symbol.outlineWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),yl(i)&&r.annotations.outline.outlineWidth>0&&(e.strokeStyle=r.annotations.outline.outlineColor,e.lineWidth=r.annotations.outline.strokeWidth+2*r.annotations.outline.outlineWidth,e.beginPath(),e.rect(i.x-i.width/2,i.y-i.height/2,i.width,i.height),e.stroke()),e.strokeStyle=r.annotations.link.stroke,e.lineWidth=r.annotations.link.strokeWidth,e.beginPath(),IS(e,i.computed.points),e.stroke(),bl(i)&&(e.strokeStyle=r.annotations.outline.stroke,e.lineWidth=r.annotations.outline.strokeWidth,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.stroke()),Wg(i)&&(e.fillStyle=r.annotations.symbol.fill,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.fill()),yl(i)&&(e.strokeStyle=r.annotations.outline.stroke,e.lineWidth=r.annotations.outline.strokeWidth,e.beginPath(),e.rect(i.x-i.width/2,i.y-i.height/2,i.width,i.height),e.stroke()),typeof i.note=="function"?i.note(e,{datum:i.datum,x:i.computed.text[0],y:i.computed.text[1],theme:r}):(e.font=r.annotations.text.fontSize+"px "+r.annotations.text.fontFamily,e.textAlign="left",e.textBaseline="alphabetic",e.fillStyle=r.annotations.text.fill,e.strokeStyle=r.annotations.text.outlineColor,e.lineWidth=2*r.annotations.text.outlineWidth,r.annotations.text.outlineWidth>0&&(e.lineJoin="round",e.strokeText(i.note,i.computed.text[0],i.computed.text[1]),e.lineJoin="miter"),e.fillText(i.note,i.computed.text[0],i.computed.text[1]))}),e.restore())};const di=11102230246251565e-32,Fn=134217729,ale=(3+8*di)*di;function Fh(e,t,n,r,i){let a,o,s,l,c=t[0],u=r[0],d=0,f=0;u>c==u>-c?(a=c,c=t[++d]):(a=u,u=r[++f]);let h=0;if(d<e&&f<n)for(u>c==u>-c?(o=c+a,s=a-(o-c),c=t[++d]):(o=u+a,s=a-(o-u),u=r[++f]),a=o,s!==0&&(i[h++]=s);d<e&&f<n;)u>c==u>-c?(o=a+c,l=o-a,s=a-(o-l)+(c-l),c=t[++d]):(o=a+u,l=o-a,s=a-(o-l)+(u-l),u=r[++f]),a=o,s!==0&&(i[h++]=s);for(;d<e;)o=a+c,l=o-a,s=a-(o-l)+(c-l),c=t[++d],a=o,s!==0&&(i[h++]=s);for(;f<n;)o=a+u,l=o-a,s=a-(o-l)+(u-l),u=r[++f],a=o,s!==0&&(i[h++]=s);return(a!==0||h===0)&&(i[h++]=a),h}function ole(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function Wl(e){return new Float64Array(e)}const sle=(3+16*di)*di,lle=(2+12*di)*di,cle=(9+64*di)*di*di,Ya=Wl(4),AS=Wl(8),NS=Wl(12),jS=Wl(16),Kn=Wl(4);function ule(e,t,n,r,i,a,o){let s,l,c,u,d,f,h,p,m,v,b,y,x,C,S,w,O,E;const _=e-i,T=n-i,R=t-a,F=r-a;C=_*F,f=Fn*_,h=f-(f-_),p=_-h,f=Fn*F,m=f-(f-F),v=F-m,S=p*v-(C-h*m-p*m-h*v),w=R*T,f=Fn*R,h=f-(f-R),p=R-h,f=Fn*T,m=f-(f-T),v=T-m,O=p*v-(w-h*m-p*m-h*v),b=S-O,d=S-b,Ya[0]=S-(b+d)+(d-O),y=C+b,d=y-C,x=C-(y-d)+(b-d),b=x-w,d=x-b,Ya[1]=x-(b+d)+(d-w),E=y+b,d=E-y,Ya[2]=y-(E-d)+(b-d),Ya[3]=E;let I=ole(4,Ya),P=lle*o;if(I>=P||-I>=P||(d=e-_,s=e-(_+d)+(d-i),d=n-T,c=n-(T+d)+(d-i),d=t-R,l=t-(R+d)+(d-a),d=r-F,u=r-(F+d)+(d-a),s===0&&l===0&&c===0&&u===0)||(P=cle*o+ale*Math.abs(I),I+=_*u+F*s-(R*c+T*l),I>=P||-I>=P))return I;C=s*F,f=Fn*s,h=f-(f-s),p=s-h,f=Fn*F,m=f-(f-F),v=F-m,S=p*v-(C-h*m-p*m-h*v),w=l*T,f=Fn*l,h=f-(f-l),p=l-h,f=Fn*T,m=f-(f-T),v=T-m,O=p*v-(w-h*m-p*m-h*v),b=S-O,d=S-b,Kn[0]=S-(b+d)+(d-O),y=C+b,d=y-C,x=C-(y-d)+(b-d),b=x-w,d=x-b,Kn[1]=x-(b+d)+(d-w),E=y+b,d=E-y,Kn[2]=y-(E-d)+(b-d),Kn[3]=E;const j=Fh(4,Ya,4,Kn,AS);C=_*u,f=Fn*_,h=f-(f-_),p=_-h,f=Fn*u,m=f-(f-u),v=u-m,S=p*v-(C-h*m-p*m-h*v),w=R*c,f=Fn*R,h=f-(f-R),p=R-h,f=Fn*c,m=f-(f-c),v=c-m,O=p*v-(w-h*m-p*m-h*v),b=S-O,d=S-b,Kn[0]=S-(b+d)+(d-O),y=C+b,d=y-C,x=C-(y-d)+(b-d),b=x-w,d=x-b,Kn[1]=x-(b+d)+(d-w),E=y+b,d=E-y,Kn[2]=y-(E-d)+(b-d),Kn[3]=E;const A=Fh(j,AS,4,Kn,NS);C=s*u,f=Fn*s,h=f-(f-s),p=s-h,f=Fn*u,m=f-(f-u),v=u-m,S=p*v-(C-h*m-p*m-h*v),w=l*c,f=Fn*l,h=f-(f-l),p=l-h,f=Fn*c,m=f-(f-c),v=c-m,O=p*v-(w-h*m-p*m-h*v),b=S-O,d=S-b,Kn[0]=S-(b+d)+(d-O),y=C+b,d=y-C,x=C-(y-d)+(b-d),b=x-w,d=x-b,Kn[1]=x-(b+d)+(d-w),E=y+b,d=E-y,Kn[2]=y-(E-d)+(b-d),Kn[3]=E;const M=Fh(A,NS,4,Kn,jS);return jS[M-1]}function _c(e,t,n,r,i,a){const o=(t-a)*(n-i),s=(e-i)*(r-a),l=o-s,c=Math.abs(o+s);return Math.abs(l)>=sle*c?l:-ule(e,t,n,r,i,a,c)}const LS=Math.pow(2,-52),Ec=new Uint32Array(512);class ju{static from(t,n=gle,r=mle){const i=t.length,a=new Float64Array(i*2);for(let o=0;o<i;o++){const s=t[o];a[2*o]=n(s),a[2*o+1]=r(s)}return new ju(a)}constructor(t){const n=t.length>>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const r=Math.max(2*n-5,0);this._triangles=new Uint32Array(r*3),this._halfedges=new Int32Array(r*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:r,_hullTri:i,_hullHash:a}=this,o=t.length>>1;let s=1/0,l=1/0,c=-1/0,u=-1/0;for(let _=0;_<o;_++){const T=t[2*_],R=t[2*_+1];T<s&&(s=T),R<l&&(l=R),T>c&&(c=T),R>u&&(u=R),this._ids[_]=_}const d=(s+c)/2,f=(l+u)/2;let h,p,m;for(let _=0,T=1/0;_<o;_++){const R=zh(d,f,t[2*_],t[2*_+1]);R<T&&(h=_,T=R)}const v=t[2*h],b=t[2*h+1];for(let _=0,T=1/0;_<o;_++){if(_===h)continue;const R=zh(v,b,t[2*_],t[2*_+1]);R<T&&R>0&&(p=_,T=R)}let y=t[2*p],x=t[2*p+1],C=1/0;for(let _=0;_<o;_++){if(_===h||_===p)continue;const T=hle(v,b,y,x,t[2*_],t[2*_+1]);T<C&&(m=_,C=T)}let S=t[2*m],w=t[2*m+1];if(C===1/0){for(let R=0;R<o;R++)this._dists[R]=t[2*R]-t[0]||t[2*R+1]-t[1];io(this._ids,this._dists,0,o-1);const _=new Uint32Array(o);let T=0;for(let R=0,F=-1/0;R<o;R++){const I=this._ids[R],P=this._dists[I];P>F&&(_[T++]=I,F=P)}this.hull=_.subarray(0,T),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(_c(v,b,y,x,S,w)<0){const _=p,T=y,R=x;p=m,y=S,x=w,m=_,S=T,w=R}const O=vle(v,b,y,x,S,w);this._cx=O.x,this._cy=O.y;for(let _=0;_<o;_++)this._dists[_]=zh(t[2*_],t[2*_+1],O.x,O.y);io(this._ids,this._dists,0,o-1),this._hullStart=h;let E=3;r[h]=n[m]=p,r[p]=n[h]=m,r[m]=n[p]=h,i[h]=0,i[p]=1,i[m]=2,a.fill(-1),a[this._hashKey(v,b)]=h,a[this._hashKey(y,x)]=p,a[this._hashKey(S,w)]=m,this.trianglesLen=0,this._addTriangle(h,p,m,-1,-1,-1);for(let _=0,T,R;_<this._ids.length;_++){const F=this._ids[_],I=t[2*F],P=t[2*F+1];if(_>0&&Math.abs(I-T)<=LS&&Math.abs(P-R)<=LS||(T=I,R=P,F===h||F===p||F===m))continue;let j=0;for(let D=0,V=this._hashKey(I,P);D<this._hashSize&&(j=a[(V+D)%this._hashSize],!(j!==-1&&j!==r[j]));D++);j=n[j];let A=j,M;for(;M=r[A],_c(I,P,t[2*A],t[2*A+1],t[2*M],t[2*M+1])>=0;)if(A=M,A===j){A=-1;break}if(A===-1)continue;let N=this._addTriangle(A,F,r[A],-1,-1,i[A]);i[F]=this._legalize(N+2),i[A]=N,E++;let L=r[A];for(;M=r[L],_c(I,P,t[2*L],t[2*L+1],t[2*M],t[2*M+1])<0;)N=this._addTriangle(L,F,M,i[F],-1,i[L]),i[F]=this._legalize(N+2),r[L]=L,E--,L=M;if(A===j)for(;M=n[A],_c(I,P,t[2*M],t[2*M+1],t[2*A],t[2*A+1])<0;)N=this._addTriangle(M,F,A,-1,i[A],i[M]),this._legalize(N+2),i[M]=N,r[A]=A,E--,A=M;this._hullStart=n[F]=A,r[A]=n[L]=F,r[F]=L,a[this._hashKey(I,P)]=F,a[this._hashKey(t[2*A],t[2*A+1])]=A}this.hull=new Uint32Array(E);for(let _=0,T=this._hullStart;_<E;_++)this.hull[_]=T,T=r[T];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(dle(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:r,coords:i}=this;let a=0,o=0;for(;;){const s=r[t],l=t-t%3;if(o=l+(t+2)%3,s===-1){if(a===0)break;t=Ec[--a];continue}const c=s-s%3,u=l+(t+1)%3,d=c+(s+2)%3,f=n[o],h=n[t],p=n[u],m=n[d];if(fle(i[2*f],i[2*f+1],i[2*h],i[2*h+1],i[2*p],i[2*p+1],i[2*m],i[2*m+1])){n[t]=m,n[s]=f;const b=r[d];if(b===-1){let x=this._hullStart;do{if(this._hullTri[x]===d){this._hullTri[x]=t;break}x=this._hullPrev[x]}while(x!==this._hullStart)}this._link(t,b),this._link(s,r[o]),this._link(o,d);const y=c+(s+1)%3;a<Ec.length&&(Ec[a++]=y)}else{if(a===0)break;t=Ec[--a]}}return o}_link(t,n){this._halfedges[t]=n,n!==-1&&(this._halfedges[n]=t)}_addTriangle(t,n,r,i,a,o){const s=this.trianglesLen;return this._triangles[s]=t,this._triangles[s+1]=n,this._triangles[s+2]=r,this._link(s,i),this._link(s+1,a),this._link(s+2,o),this.trianglesLen+=3,s}}function dle(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function zh(e,t,n,r){const i=e-n,a=t-r;return i*i+a*a}function fle(e,t,n,r,i,a,o,s){const l=e-o,c=t-s,u=n-o,d=r-s,f=i-o,h=a-s,p=l*l+c*c,m=u*u+d*d,v=f*f+h*h;return l*(d*v-m*h)-c*(u*v-m*f)+p*(u*h-d*f)<0}function hle(e,t,n,r,i,a){const o=n-e,s=r-t,l=i-e,c=a-t,u=o*o+s*s,d=l*l+c*c,f=.5/(o*c-s*l),h=(c*u-s*d)*f,p=(o*d-l*u)*f;return h*h+p*p}function vle(e,t,n,r,i,a){const o=n-e,s=r-t,l=i-e,c=a-t,u=o*o+s*s,d=l*l+c*c,f=.5/(o*c-s*l),h=e+(c*u-s*d)*f,p=t+(o*d-l*u)*f;return{x:h,y:p}}function io(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const a=e[i],o=t[a];let s=i-1;for(;s>=n&&t[e[s]]>o;)e[s+1]=e[s--];e[s+1]=a}else{const i=n+r>>1;let a=n+1,o=r;xs(e,i,a),t[e[n]]>t[e[r]]&&xs(e,n,r),t[e[a]]>t[e[r]]&&xs(e,a,r),t[e[n]]>t[e[a]]&&xs(e,n,a);const s=e[a],l=t[s];for(;;){do a++;while(t[e[a]]<l);do o--;while(t[e[o]]>l);if(o<a)break;xs(e,a,o)}e[n+1]=e[o],e[o]=s,r-a+1>=o-n?(io(e,t,a,r),io(e,t,n,o-1)):(io(e,t,n,o-1),io(e,t,a,r))}}function xs(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function gle(e){return e[0]}function mle(e){return e[1]}const kS=1e-6;class aa{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,r){t=+t,n=+n,r=+r;const i=t+r,a=n;if(r<0)throw new Error("negative radius");this._x1===null?this._+=`M${i},${a}`:(Math.abs(this._x1-i)>kS||Math.abs(this._y1-a)>kS)&&(this._+="L"+i+","+a),r&&(this._+=`A${r},${r},0,1,1,${t-r},${n}A${r},${r},0,1,1,${this._x1=i},${this._y1=a}`)}rect(t,n,r,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+r}v${+i}h${-r}Z`}value(){return this._||null}}class Hg{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}class ple{constructor(t,[n,r,i,a]=[0,0,960,500]){if(!((i=+i)>=(n=+n))||!((a=+a)>=(r=+r)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=i,this.xmin=n,this.ymax=a,this.ymin=r,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:r},vectors:i}=this;let a,o;const s=this.circumcenters=this._circumcenters.subarray(0,r.length/3*2);for(let m=0,v=0,b=r.length,y,x;m<b;m+=3,v+=2){const C=r[m]*2,S=r[m+1]*2,w=r[m+2]*2,O=t[C],E=t[C+1],_=t[S],T=t[S+1],R=t[w],F=t[w+1],I=_-O,P=T-E,j=R-O,A=F-E,M=(I*A-P*j)*2;if(Math.abs(M)<1e-9){if(a===void 0){a=o=0;for(const L of n)a+=t[L*2],o+=t[L*2+1];a/=n.length,o/=n.length}const N=1e9*Math.sign((a-O)*A-(o-E)*j);y=(O+R)/2-N*A,x=(E+F)/2+N*j}else{const N=1/M,L=I*I+P*P,D=j*j+A*A;y=O+(A*L-P*D)*N,x=E+(I*D-j*L)*N}s[v]=y,s[v+1]=x}let l=n[n.length-1],c,u=l*4,d,f=t[2*l],h,p=t[2*l+1];i.fill(0);for(let m=0;m<n.length;++m)l=n[m],c=u,d=f,h=p,u=l*4,f=t[2*l],p=t[2*l+1],i[c+2]=i[u]=h-p,i[c+3]=i[u+1]=f-d}render(t){const n=t==null?t=new aa:void 0,{delaunay:{halfedges:r,inedges:i,hull:a},circumcenters:o,vectors:s}=this;if(a.length<=1)return null;for(let u=0,d=r.length;u<d;++u){const f=r[u];if(f<u)continue;const h=Math.floor(u/3)*2,p=Math.floor(f/3)*2,m=o[h],v=o[h+1],b=o[p],y=o[p+1];this._renderSegment(m,v,b,y,t)}let l,c=a[a.length-1];for(let u=0;u<a.length;++u){l=c,c=a[u];const d=Math.floor(i[c]/3)*2,f=o[d],h=o[d+1],p=l*4,m=this._project(f,h,s[p+2],s[p+3]);m&&this._renderSegment(f,h,m[0],m[1],t)}return n&&n.value()}renderBounds(t){const n=t==null?t=new aa:void 0;return t.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),n&&n.value()}renderCell(t,n){const r=n==null?n=new aa:void 0,i=this._clip(t);if(i===null||!i.length)return;n.moveTo(i[0],i[1]);let a=i.length;for(;i[0]===i[a-2]&&i[1]===i[a-1]&&a>1;)a-=2;for(let o=2;o<a;o+=2)(i[o]!==i[o-2]||i[o+1]!==i[o-1])&&n.lineTo(i[o],i[o+1]);return n.closePath(),r&&r.value()}*cellPolygons(){const{delaunay:{points:t}}=this;for(let n=0,r=t.length/2;n<r;++n){const i=this.cellPolygon(n);i&&(i.index=n,yield i)}}cellPolygon(t){const n=new Hg;return this.renderCell(t,n),n.value()}_renderSegment(t,n,r,i,a){let o;const s=this._regioncode(t,n),l=this._regioncode(r,i);s===0&&l===0?(a.moveTo(t,n),a.lineTo(r,i)):(o=this._clipSegment(t,n,r,i,s,l))&&(a.moveTo(o[0],o[1]),a.lineTo(o[2],o[3]))}contains(t,n,r){return n=+n,n!==n||(r=+r,r!==r)?!1:this.delaunay._step(t,n,r)===t}*neighbors(t){const n=this._clip(t);if(n)for(const r of this.delaunay.neighbors(t)){const i=this._clip(r);if(i){e:for(let a=0,o=n.length;a<o;a+=2)for(let s=0,l=i.length;s<l;s+=2)if(n[a]===i[s]&&n[a+1]===i[s+1]&&n[(a+2)%o]===i[(s+l-2)%l]&&n[(a+3)%o]===i[(s+l-1)%l]){yield r;break e}}}}_cell(t){const{circumcenters:n,delaunay:{inedges:r,halfedges:i,triangles:a}}=this,o=r[t];if(o===-1)return null;const s=[];let l=o;do{const c=Math.floor(l/3);if(s.push(n[c*2],n[c*2+1]),l=l%3===2?l-2:l+1,a[l]!==t)break;l=i[l]}while(l!==o&&l!==-1);return s}_clip(t){if(t===0&&this.delaunay.hull.length===1)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const n=this._cell(t);if(n===null)return null;const{vectors:r}=this,i=t*4;return this._simplify(r[i]||r[i+1]?this._clipInfinite(t,n,r[i],r[i+1],r[i+2],r[i+3]):this._clipFinite(t,n))}_clipFinite(t,n){const r=n.length;let i=null,a,o,s=n[r-2],l=n[r-1],c,u=this._regioncode(s,l),d,f=0;for(let h=0;h<r;h+=2)if(a=s,o=l,s=n[h],l=n[h+1],c=u,u=this._regioncode(s,l),c===0&&u===0)d=f,f=0,i?i.push(s,l):i=[s,l];else{let p,m,v,b,y;if(c===0){if((p=this._clipSegment(a,o,s,l,c,u))===null)continue;[m,v,b,y]=p}else{if((p=this._clipSegment(s,l,a,o,u,c))===null)continue;[b,y,m,v]=p,d=f,f=this._edgecode(m,v),d&&f&&this._edge(t,d,f,i,i.length),i?i.push(m,v):i=[m,v]}d=f,f=this._edgecode(b,y),d&&f&&this._edge(t,d,f,i,i.length),i?i.push(b,y):i=[b,y]}if(i)d=f,f=this._edgecode(i[0],i[1]),d&&f&&this._edge(t,d,f,i,i.length);else if(this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return i}_clipSegment(t,n,r,i,a,o){const s=a<o;for(s&&([t,n,r,i,a,o]=[r,i,t,n,o,a]);;){if(a===0&&o===0)return s?[r,i,t,n]:[t,n,r,i];if(a&o)return null;let l,c,u=a||o;u&8?(l=t+(r-t)*(this.ymax-n)/(i-n),c=this.ymax):u&4?(l=t+(r-t)*(this.ymin-n)/(i-n),c=this.ymin):u&2?(c=n+(i-n)*(this.xmax-t)/(r-t),l=this.xmax):(c=n+(i-n)*(this.xmin-t)/(r-t),l=this.xmin),a?(t=l,n=c,a=this._regioncode(t,n)):(r=l,i=c,o=this._regioncode(r,i))}}_clipInfinite(t,n,r,i,a,o){let s=Array.from(n),l;if((l=this._project(s[0],s[1],r,i))&&s.unshift(l[0],l[1]),(l=this._project(s[s.length-2],s[s.length-1],a,o))&&s.push(l[0],l[1]),s=this._clipFinite(t,s))for(let c=0,u=s.length,d,f=this._edgecode(s[u-2],s[u-1]);c<u;c+=2)d=f,f=this._edgecode(s[c],s[c+1]),d&&f&&(c=this._edge(t,d,f,s,c),u=s.length);else this.contains(t,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(t,n,r,i,a){for(;n!==r;){let o,s;switch(n){case 5:n=4;continue;case 4:n=6,o=this.xmax,s=this.ymin;break;case 6:n=2;continue;case 2:n=10,o=this.xmax,s=this.ymax;break;case 10:n=8;continue;case 8:n=9,o=this.xmin,s=this.ymax;break;case 9:n=1;continue;case 1:n=5,o=this.xmin,s=this.ymin;break}(i[a]!==o||i[a+1]!==s)&&this.contains(t,o,s)&&(i.splice(a,0,o,s),a+=2)}return a}_project(t,n,r,i){let a=1/0,o,s,l;if(i<0){if(n<=this.ymin)return null;(o=(this.ymin-n)/i)<a&&(l=this.ymin,s=t+(a=o)*r)}else if(i>0){if(n>=this.ymax)return null;(o=(this.ymax-n)/i)<a&&(l=this.ymax,s=t+(a=o)*r)}if(r>0){if(t>=this.xmax)return null;(o=(this.xmax-t)/r)<a&&(s=this.xmax,l=n+(a=o)*i)}else if(r<0){if(t<=this.xmin)return null;(o=(this.xmin-t)/r)<a&&(s=this.xmin,l=n+(a=o)*i)}return[s,l]}_edgecode(t,n){return(t===this.xmin?1:t===this.xmax?2:0)|(n===this.ymin?4:n===this.ymax?8:0)}_regioncode(t,n){return(t<this.xmin?1:t>this.xmax?2:0)|(n<this.ymin?4:n>this.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n<t.length;n+=2){const r=(n+2)%t.length,i=(n+4)%t.length;(t[n]===t[r]&&t[r]===t[i]||t[n+1]===t[r+1]&&t[r+1]===t[i+1])&&(t.splice(r,2),n-=2)}t.length||(t=null)}return t}}const ble=2*Math.PI,Xa=Math.pow;function yle(e){return e[0]}function xle(e){return e[1]}function Sle(e){const{triangles:t,coords:n}=e;for(let r=0;r<t.length;r+=3){const i=2*t[r],a=2*t[r+1],o=2*t[r+2];if((n[o]-n[i])*(n[a+1]-n[i+1])-(n[a]-n[i])*(n[o+1]-n[i+1])>1e-10)return!1}return!0}function Cle(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class m0{static from(t,n=yle,r=xle,i){return new m0("length"in t?wle(t,n,r,i):Float64Array.from($le(t,n,r,i)))}constructor(t){this._delaunator=new ju(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&Sle(t)){this.collinear=Int32Array.from({length:n.length/2},(f,h)=>h).sort((f,h)=>n[2*f]-n[2*h]||n[2*f+1]-n[2*h+1]);const l=this.collinear[0],c=this.collinear[this.collinear.length-1],u=[n[2*l],n[2*l+1],n[2*c],n[2*c+1]],d=1e-8*Math.hypot(u[3]-u[1],u[2]-u[0]);for(let f=0,h=n.length/2;f<h;++f){const p=Cle(n[2*f],n[2*f+1],d);n[2*f]=p[0],n[2*f+1]=p[1]}this._delaunator=new ju(n)}else delete this.collinear;const r=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,a=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),s=this._hullIndex.fill(-1);for(let l=0,c=r.length;l<c;++l){const u=a[l%3===2?l-2:l+1];(r[l]===-1||o[u]===-1)&&(o[u]=l)}for(let l=0,c=i.length;l<c;++l)s[i[l]]=l;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],o[i[0]]=1,i.length===2&&(o[i[1]]=0,this.triangles[1]=i[1],this.triangles[2]=i[1]))}voronoi(t){return new ple(this,t)}*neighbors(t){const{inedges:n,hull:r,_hullIndex:i,halfedges:a,triangles:o,collinear:s}=this;if(s){const d=s.indexOf(t);d>0&&(yield s[d-1]),d<s.length-1&&(yield s[d+1]);return}const l=n[t];if(l===-1)return;let c=l,u=-1;do{if(yield u=o[c],c=c%3===2?c-2:c+1,o[c]!==t)return;if(c=a[c],c===-1){const d=r[(i[t]+1)%r.length];d!==u&&(yield d);return}}while(c!==l)}find(t,n,r=0){if(t=+t,t!==t||(n=+n,n!==n))return-1;const i=r;let a;for(;(a=this._step(r,t,n))>=0&&a!==r&&a!==i;)r=a;return a}_step(t,n,r){const{inedges:i,hull:a,_hullIndex:o,halfedges:s,triangles:l,points:c}=this;if(i[t]===-1||!c.length)return(t+1)%(c.length>>1);let u=t,d=Xa(n-c[t*2],2)+Xa(r-c[t*2+1],2);const f=i[t];let h=f;do{let p=l[h];const m=Xa(n-c[p*2],2)+Xa(r-c[p*2+1],2);if(m<d&&(d=m,u=p),h=h%3===2?h-2:h+1,l[h]!==t)break;if(h=s[h],h===-1){if(h=a[(o[t]+1)%a.length],h!==p&&Xa(n-c[h*2],2)+Xa(r-c[h*2+1],2)<d)return h;break}}while(h!==f);return u}render(t){const n=t==null?t=new aa:void 0,{points:r,halfedges:i,triangles:a}=this;for(let o=0,s=i.length;o<s;++o){const l=i[o];if(l<o)continue;const c=a[o]*2,u=a[l]*2;t.moveTo(r[c],r[c+1]),t.lineTo(r[u],r[u+1])}return this.renderHull(t),n&&n.value()}renderPoints(t,n){n===void 0&&(!t||typeof t.moveTo!="function")&&(n=t,t=null),n=n==null?2:+n;const r=t==null?t=new aa:void 0,{points:i}=this;for(let a=0,o=i.length;a<o;a+=2){const s=i[a],l=i[a+1];t.moveTo(s+n,l),t.arc(s,l,n,0,ble)}return r&&r.value()}renderHull(t){const n=t==null?t=new aa:void 0,{hull:r,points:i}=this,a=r[0]*2,o=r.length;t.moveTo(i[a],i[a+1]);for(let s=1;s<o;++s){const l=2*r[s];t.lineTo(i[l],i[l+1])}return t.closePath(),n&&n.value()}hullPolygon(){const t=new Hg;return this.renderHull(t),t.value()}renderTriangle(t,n){const r=n==null?n=new aa:void 0,{points:i,triangles:a}=this,o=a[t*=3]*2,s=a[t+1]*2,l=a[t+2]*2;return n.moveTo(i[o],i[o+1]),n.lineTo(i[s],i[s+1]),n.lineTo(i[l],i[l+1]),n.closePath(),r&&r.value()}*trianglePolygons(){const{triangles:t}=this;for(let n=0,r=t.length/3;n<r;++n)yield this.trianglePolygon(n)}trianglePolygon(t){const n=new Hg;return this.renderTriangle(t,n),n.value()}}function wle(e,t,n,r){const i=e.length,a=new Float64Array(i*2);for(let o=0;o<i;++o){const s=e[o];a[o*2]=t.call(r,s,o,e),a[o*2+1]=n.call(r,s,o,e)}return a}function*$le(e,t,n,r){let i=0;for(const a of e)yield t.call(r,a,i,e),yield n.call(r,a,i,e),++i}var p0=function(e){return[e.x,e.y]},Hl=oO,CM="cursor",wM="top",_le=function(e){var t=e.points,n=e.getNodePosition,r=n===void 0?p0:n,i=e.margin,a=i===void 0?Hl:i;return t.map(function(o){var s=r(o),l=s[0],c=s[1];return[l+a.left,c+a.top]})},Ele=function(e){var t=e.points,n=e.width,r=e.height,i=e.margin,a=i===void 0?Hl:i,o=e.debug,s=m0.from(t),l=o?s.voronoi([0,0,a.left+n+a.right,a.top+r+a.bottom]):void 0;return{points:t,delaunay:s,voronoi:l}},b0=function(e){var t=e.points,n=e.getNodePosition,r=n===void 0?p0:n,i=e.width,a=e.height,o=e.margin,s=o===void 0?Hl:o,l=e.debug;return $.useMemo(function(){return Ele({points:_le({points:t,margin:s,getNodePosition:r}),width:i,height:a,margin:s,debug:l})},[t,i,a,s,l])},Ole=function(e){var t=e.elementRef,n=e.nodes,r=e.getNodePosition,i=r===void 0?p0:r,a=e.delaunay,o=e.setCurrent,s=e.margin,l=s===void 0?Hl:s,c=e.detectionRadius,u=c===void 0?1/0:c,d=e.isInteractive,f=d===void 0||d,h=e.onMouseEnter,p=e.onMouseMove,m=e.onMouseLeave,v=e.onClick,b=e.onTouchStart,y=e.onTouchMove,x=e.onTouchEnd,C=e.enableTouchCrosshair,S=C!==void 0&&C,w=e.tooltip,O=e.tooltipPosition,E=O===void 0?CM:O,_=e.tooltipAnchor,T=_===void 0?wM:_,R=$.useState(null),F=R[0],I=R[1],P=$.useRef(null);$.useEffect(function(){P.current=F},[P,F]);var j=$.useCallback(function(Y){if(!t.current)return null;var W=c0(t.current,Y),H=W[0],U=W[1],z=a.find(H,U),ne=z!==void 0?n[z]:null;if(ne&&u!==1/0){var B=i(ne),re=B[0],ie=B[1];zee(H,U,re+l.left,ie+l.top)>u&&(z=null,ne=null)}return z===null||ne===null?null:[z,ne]},[t,a,n,i,l,u]),A=Wr(),M=A.showTooltipAt,N=A.showTooltipFromEvent,L=A.hideTooltip,D=$.useMemo(function(){if(w)return E==="cursor"?function(Y,W){N(w(Y),W,T)}:function(Y){var W=i(Y),H=W[0],U=W[1];M(w(Y),[H+l.left,U+l.top],T)}},[M,N,w,E,T,i,l]),V=$.useCallback(function(Y){var W=j(Y);if(I(W),o==null||o(W?W[1]:null),W){var H=W[1];D==null||D(H,Y),h==null||h(W[1],Y)}},[j,I,o,D,h]),X=$.useCallback(function(Y){var W=j(Y);if(I(W),W){var H=W[0],U=W[1];if(o==null||o(U),D==null||D(U,Y),P.current){var z=P.current,ne=z[0],B=z[1];H!==ne?m==null||m(B,Y):p==null||p(U,Y)}else h==null||h(U,Y)}else o==null||o(null),L==null||L(),P.current&&(m==null||m(P.current[1],Y))},[j,I,P,h,p,m,D,L]),q=$.useCallback(function(Y){I(null),o==null||o(null),L(),m&&P.current&&m(P.current[1],Y)},[I,o,P,L,m]),Z=$.useCallback(function(Y){var W=j(Y);I(W),W&&(v==null||v(W[1],Y))},[j,I,v]),J=$.useCallback(function(Y){var W=j(Y);S&&(I(W),o==null||o(W?W[1]:null)),W&&(b==null||b(W[1],Y))},[j,I,o,S,b]),Q=$.useCallback(function(Y){var W=j(Y);S&&(I(W),o==null||o(W?W[1]:null)),W&&(y==null||y(W[1],Y))},[j,I,o,S,y]),K=$.useCallback(function(Y){S&&(I(null),o==null||o(null)),x&&P.current&&x(P.current[1],Y)},[S,I,o,x,P]);return{current:F,handleMouseEnter:f?V:void 0,handleMouseMove:f?X:void 0,handleMouseLeave:f?q:void 0,handleClick:f?Z:void 0,handleTouchStart:f?J:void 0,handleTouchMove:f?Q:void 0,handleTouchEnd:f?K:void 0}},$M=function(e){var t=e.nodes,n=e.width,r=e.height,i=e.margin,a=i===void 0?Hl:i,o=e.getNodePosition,s=e.setCurrent,l=e.onMouseEnter,c=e.onMouseMove,u=e.onMouseLeave,d=e.onClick,f=e.onTouchStart,h=e.onTouchMove,p=e.onTouchEnd,m=e.enableTouchCrosshair,v=m!==void 0&&m,b=e.detectionRadius,y=b===void 0?1/0:b,x=e.tooltip,C=e.tooltipPosition,S=C===void 0?CM:C,w=e.tooltipAnchor,O=w===void 0?wM:w,E=e.debug,_=$.useRef(null),T=b0({points:t,getNodePosition:o,width:n,height:r,margin:a,debug:E}),R=T.delaunay,F=T.voronoi,I=Ole({elementRef:_,nodes:t,delaunay:R,margin:a,detectionRadius:y,setCurrent:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onTouchStart:f,onTouchMove:h,onTouchEnd:p,enableTouchCrosshair:v,tooltip:x,tooltipPosition:S,tooltipAnchor:O}),P=I.current,j=I.handleMouseEnter,A=I.handleMouseMove,M=I.handleMouseLeave,N=I.handleClick,L=I.handleTouchStart,D=I.handleTouchMove,V=I.handleTouchEnd,X=$.useMemo(function(){if(E&&F)return F.render()},[E,F]);return k.jsxs("g",{ref:_,transform:"translate("+-a.left+","+-a.top+")",children:[E&&F&&k.jsxs(k.Fragment,{children:[k.jsx("path",{d:X,stroke:"red",strokeWidth:1,opacity:.75}),y<1/0&&k.jsx("path",{stroke:"red",strokeWidth:.35,fill:"none",d:R.renderPoints(void 0,y)}),P&&k.jsx("path",{fill:"pink",opacity:.35,d:F.renderCell(P[0])})]}),k.jsx("rect",{"data-ref":"mesh-interceptor",width:a.left+n+a.right,height:a.top+r+a.bottom,fill:"red",opacity:0,style:{cursor:"auto"},onMouseEnter:j,onMouseMove:A,onMouseLeave:M,onTouchStart:L,onTouchMove:D,onTouchEnd:V,onClick:N})]})},_M=function(e,t){e.save(),e.globalAlpha=.75,e.beginPath(),t.render(e),e.strokeStyle="red",e.lineWidth=1,e.stroke(),e.restore()},EM=function(e,t,n){e.save(),e.globalAlpha=.35,e.beginPath(),t.renderCell(n,e),e.fillStyle="pink",e.fill(),e.restore()};function dr(){return dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dr.apply(this,arguments)}function OM(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var Mle=function(e){if(typeof e=="function")return e;if(Bg(e))return function(){return e};if(function(n){return xd(n)}(e)){if(!H_(e.key))throw new Error("symbolSize is invalid, key should be a string pointing to the property to use to determine node size");if(!Array.isArray(e.values)||e.values.length!==2)throw new Error("symbolSize is invalid, values spec should be an array containing two values, min and max");if(!Array.isArray(e.sizes)||e.sizes.length!==2)throw new Error("symbolSize is invalid, sizes spec should be an array containing two values, min and max");var t=Np().domain([e.values[0],e.values[1]]).range([e.sizes[0],e.sizes[1]]);return function(n){return t(Vr(n,e.key))}}throw new Error("nodeSize is invalid, it should be either a function, a number or an object")},MM=function(e){var t,n=e.data,r=e.xScaleSpec,i=e.xFormat,a=e.yScaleSpec,o=e.yFormat,s=e.width,l=e.height,c=e.nodeId,u=e.nodeSize,d=e.colors,f=$.useMemo(function(){return uM(n,r,a,s,l)},[n,r,a,s,l]),h=f.series,p=f.xScale,m=f.yScale,v=Li(i),b=Li(o),y=Yr(c),x=$.useMemo(function(){return function(w){var O=w.series,E=w.formatX,_=w.formatY,T=w.getNodeId,R=[];return O.forEach(function(F){F.data.forEach(function(I,P){var j={index:R.length,serieIndex:P,serieId:F.id,x:I.position.x,xValue:I.data.x,formattedX:E(I.data.x),y:I.position.y,yValue:I.data.y,formattedY:_(I.data.y),data:I.data};R.push(dr({},j,{id:T(j)}))})}),R}({series:h,formatX:v,formatY:b,getNodeId:y})},[h,v,b,y]),C=$.useMemo(function(){return Mle(t)},[t=u]),S=Vl(d,"serieId");return{xScale:p,yScale:m,nodes:$.useMemo(function(){return x.map(function(w){return dr({},w,{size:C(w),color:S({serieId:w.serieId})})})},[x,C,S]),legendData:$.useMemo(function(){return h.map(function(w){return{id:w.id,label:w.id,color:S({serieId:w.id})}})},[h,S])}},TM=function(e,t){return Zse({data:e,annotations:t,getPosition:function(n){return{x:n.x,y:n.y}},getDimensions:function(n){return{size:n.size,width:n.size,height:n.size}}})},Tle=function(e){return e/2},RM={xScale:{type:"linear",min:0,max:"auto"},yScale:{type:"linear",min:0,max:"auto"},enableGridX:!0,enableGridY:!0,axisBottom:{},axisLeft:{},nodeId:function(e){return e.serieId+"."+e.index},nodeSize:9,nodeComponent:function(e){var t=e.node,n=e.style,r=e.blendMode,i=e.isInteractive,a=e.onMouseEnter,o=e.onMouseMove,s=e.onMouseLeave,l=e.onClick,c=$.useCallback(function(h){return a==null?void 0:a(t,h)},[t,a]),u=$.useCallback(function(h){return o==null?void 0:o(t,h)},[t,o]),d=$.useCallback(function(h){return s==null?void 0:s(t,h)},[t,s]),f=$.useCallback(function(h){return l==null?void 0:l(t,h)},[t,l]);return k.jsx(Tt.circle,{cx:n.x,cy:n.y,r:n.size.to(Tle),fill:n.color,style:{mixBlendMode:r},onMouseEnter:i?c:void 0,onMouseMove:i?u:void 0,onMouseLeave:i?d:void 0,onClick:i?f:void 0})},colors:{scheme:"nivo"},isInteractive:!0,debugMesh:!1,tooltip:function(e){var t=e.node;return k.jsx(So,{id:t.serieId,value:"x: "+t.formattedX+", y: "+t.formattedY,enableChip:!0,color:t.color})},markers:[],legends:[],annotations:[]},tn=dr({},RM,{blendMode:"normal",layers:["grid","axes","nodes","markers","mesh","legends","annotations"],role:"img",useMesh:!0,animate:!0,motionConfig:"default"}),zn=dr({},RM,{layers:["grid","axes","nodes","mesh","legends","annotations"],pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,renderNode:function(e,t){e.beginPath(),e.arc(t.x,t.y,t.size/2,0,2*Math.PI),e.fillStyle=t.color,e.fill()}}),Rle=function(e){var t=e.nodes,n=e.annotations,r=TM(t,n);return k.jsx(k.Fragment,{children:r.map(function(i,a){return k.jsx(rle,dr({},i),a)})})},Ple=function(e){return e.id},Bh=function(e){return{x:e.x,y:e.y,size:e.size,color:e.color}},Ile=function(e){return{x:e.x,y:e.y,size:0,color:e.color}},Ale=function(e){var t=e.nodes,n=e.nodeComponent,r=e.isInteractive,i=e.onMouseEnter,a=e.onMouseMove,o=e.onMouseLeave,s=e.onClick,l=e.tooltip,c=e.blendMode,u=Sn(),d=u.animate,f=u.config,h=$a(t,{keys:Ple,from:Bh,enter:Bh,update:Bh,leave:Ile,config:f,immediate:!d}),p=Wr(),m=p.showTooltipFromEvent,v=p.hideTooltip,b=$.useCallback(function(S,w){m($.createElement(l,{node:S}),w),i==null||i(S,w)},[l,m,i]),y=$.useCallback(function(S,w){m($.createElement(l,{node:S}),w),a==null||a(S,w)},[l,m,a]),x=$.useCallback(function(S,w){v(),o==null||o(S,w)},[v,o]),C=$.useCallback(function(S,w){return s==null?void 0:s(S,w)},[s]);return k.jsx(k.Fragment,{children:h(function(S,w){return $.createElement(n,{node:w,style:S,blendMode:c,isInteractive:r,onMouseEnter:r?b:void 0,onMouseMove:r?y:void 0,onMouseLeave:r?x:void 0,onClick:r?C:void 0})})})},Nle=function(e){var t=e.nodes,n=e.width,r=e.height,i=e.onMouseEnter,a=e.onMouseMove,o=e.onMouseLeave,s=e.onClick,l=e.tooltip,c=e.debug,u=Wr(),d=u.showTooltipFromEvent,f=u.hideTooltip,h=$.useCallback(function(b,y){d($.createElement(l,{node:b}),y),i&&i(b,y)},[d,l,i]),p=$.useCallback(function(b,y){d($.createElement(l,{node:b}),y),a&&a(b,y)},[d,l,a]),m=$.useCallback(function(b,y){f(),o&&o(b,y)},[f,o]),v=$.useCallback(function(b,y){s&&s(b,y)},[s]);return k.jsx($M,{nodes:t,width:n,height:r,onMouseEnter:h,onMouseMove:p,onMouseLeave:m,onClick:v,debug:c})},jle=["isInteractive","animate","motionConfig","theme","renderWrapper"],Lle=function(e){var t=e.data,n=e.xScale,r=n===void 0?tn.xScale:n,i=e.xFormat,a=e.yScale,o=a===void 0?tn.yScale:a,s=e.yFormat,l=e.width,c=e.height,u=e.margin,d=e.layers,f=d===void 0?tn.layers:d,h=e.colors,p=h===void 0?tn.colors:h,m=e.blendMode,v=m===void 0?tn.blendMode:m,b=e.nodeId,y=b===void 0?tn.nodeId:b,x=e.nodeSize,C=x===void 0?tn.nodeSize:x,S=e.nodeComponent,w=S===void 0?tn.nodeComponent:S,O=e.enableGridX,E=O===void 0?tn.enableGridX:O,_=e.enableGridY,T=_===void 0?tn.enableGridY:_,R=e.gridXValues,F=e.gridYValues,I=e.axisTop,P=e.axisRight,j=e.axisBottom,A=j===void 0?tn.axisBottom:j,M=e.axisLeft,N=M===void 0?tn.axisLeft:M,L=e.annotations,D=L===void 0?tn.annotations:L,V=e.isInteractive,X=V===void 0?tn.isInteractive:V,q=e.useMesh,Z=q===void 0?tn.useMesh:q,J=e.debugMesh,Q=J===void 0?tn.debugMesh:J,K=e.onMouseEnter,Y=e.onMouseMove,W=e.onMouseLeave,H=e.onClick,U=e.tooltip,z=U===void 0?tn.tooltip:U,ne=e.markers,B=ne===void 0?tn.markers:ne,re=e.legends,ie=re===void 0?tn.legends:re,ue=e.role,me=ue===void 0?tn.role:ue,ve=e.ariaLabel,be=e.ariaLabelledBy,Ce=e.ariaDescribedBy,ge=Ra(l,c,u),fe=ge.margin,se=ge.innerWidth,xe=ge.innerHeight,ce=ge.outerWidth,Ne=ge.outerHeight,Me=MM({data:t,xScaleSpec:r,xFormat:i,yScaleSpec:o,yFormat:s,width:se,height:xe,nodeId:y,nodeSize:C,colors:p}),Ie=Me.xScale,Le=Me.yScale,He=Me.nodes,Xe=Me.legendData,je=$.useMemo(function(){return{xScale:Ie,yScale:Le,nodes:He,margin:fe,innerWidth:se,innerHeight:xe,outerWidth:ce,outerHeight:Ne}},[Ie,Le,He,fe,se,xe,ce,Ne]),Oe={grid:null,axes:null,nodes:null,markers:null,mesh:null,annotations:null,legends:null};return f.includes("grid")&&(Oe.grid=k.jsx(yM,{width:se,height:xe,xScale:E?Ie:null,yScale:T?Le:null,xValues:R,yValues:F},"grid")),f.includes("axes")&&(Oe.axes=k.jsx(bM,{xScale:Ie,yScale:Le,width:se,height:xe,top:I,right:P,bottom:A,left:N},"axes")),f.includes("nodes")&&(Oe.nodes=k.jsx(Ale,{nodes:He,nodeComponent:w,isInteractive:X,tooltip:z,blendMode:v,onMouseEnter:K,onMouseMove:Y,onMouseLeave:W,onClick:H},"nodes")),f.includes("markers")&&(Oe.markers=k.jsx(yO,{markers:B,width:se,height:xe,xScale:Ie,yScale:Le},"markers")),f.includes("mesh")&&X&&Z&&(Oe.mesh=k.jsx(Nle,{nodes:He,width:se,height:xe,onMouseEnter:K,onMouseMove:Y,onMouseLeave:W,onClick:H,tooltip:z,debug:Q},"mesh")),f.includes("annotations")&&(Oe.annotations=k.jsx(Rle,{nodes:He,annotations:D},"annotations")),f.includes("legends")&&(Oe.legends=ie.map(function(nt,We){return k.jsx(vf,dr({},nt,{containerWidth:se,containerHeight:xe,data:Xe}),We)})),k.jsx(Zo,{width:ce,height:Ne,margin:fe,role:me,ariaLabel:ve,ariaLabelledBy:be,ariaDescribedBy:Ce,children:f.map(function(nt,We){if(typeof nt=="string"&&Oe[nt]!==void 0)return Oe[nt];if(typeof nt=="function")return k.jsx($.Fragment,{children:$.createElement(nt,je)},We);throw new Error("Unknown layer ("+nt+")")})})},kle=function(e){var t=e.isInteractive,n=t===void 0?tn.isInteractive:t,r=e.animate,i=r===void 0?tn.animate:r,a=e.motionConfig,o=a===void 0?tn.motionConfig:a,s=e.theme,l=e.renderWrapper,c=OM(e,jle);return k.jsx(Pa,{animate:i,isInteractive:n,motionConfig:o,renderWrapper:l,theme:s,children:k.jsx(Lle,dr({isInteractive:n},c))})},Dle=function(e){return k.jsx(Wi,{children:function(t){var n=t.width,r=t.height;return k.jsx(kle,dr({width:n,height:r},e))}})},Fle=["isInteractive","renderWrapper","theme"],zle=function(e){var t=e.data,n=e.xScale,r=n===void 0?zn.xScale:n,i=e.xFormat,a=e.yScale,o=a===void 0?zn.yScale:a,s=e.yFormat,l=e.width,c=e.height,u=e.margin,d=e.pixelRatio,f=d===void 0?zn.pixelRatio:d,h=e.layers,p=h===void 0?zn.layers:h,m=e.colors,v=m===void 0?zn.colors:m,b=e.nodeId,y=b===void 0?tn.nodeId:b,x=e.nodeSize,C=x===void 0?zn.nodeSize:x,S=e.renderNode,w=S===void 0?zn.renderNode:S,O=e.enableGridX,E=O===void 0?zn.enableGridX:O,_=e.gridXValues,T=e.enableGridY,R=T===void 0?zn.enableGridY:T,F=e.gridYValues,I=e.axisTop,P=e.axisRight,j=e.axisBottom,A=j===void 0?zn.axisBottom:j,M=e.axisLeft,N=M===void 0?zn.axisLeft:M,L=e.annotations,D=L===void 0?zn.annotations:L,V=e.isInteractive,X=V===void 0?zn.isInteractive:V,q=e.debugMesh,Z=q===void 0?zn.debugMesh:q,J=e.onMouseEnter,Q=e.onMouseMove,K=e.onMouseLeave,Y=e.onClick,W=e.tooltip,H=W===void 0?zn.tooltip:W,U=e.legends,z=U===void 0?zn.legends:U,ne=e.canvasRef,B=$.useRef(null),re=kt(),ie=$.useState(null),ue=ie[0],me=ie[1],ve=Ra(l,c,u),be=ve.margin,Ce=ve.innerWidth,ge=ve.innerHeight,fe=ve.outerWidth,se=ve.outerHeight,xe=MM({data:t,xScaleSpec:r,xFormat:i,yScaleSpec:o,yFormat:s,width:Ce,height:ge,nodeId:y,nodeSize:C,colors:v}),ce=xe.xScale,Ne=xe.yScale,Me=xe.nodes,Ie=xe.legendData,Le=TM(Me,D),He=b0({points:Me,width:Ce,height:ge,debug:Z}),Xe=He.delaunay,je=He.voronoi,Oe=$.useMemo(function(){return{xScale:ce,yScale:Ne,nodes:Me,margin:be,innerWidth:Ce,innerHeight:ge,outerWidth:fe,outerHeight:se}},[ce,Ne,Me,be,Ce,ge,fe,se]);$.useEffect(function(){if(B.current){B.current.width=fe*f,B.current.height=se*f;var De=B.current.getContext("2d");De.scale(f,f),De.fillStyle=re.background,De.fillRect(0,0,fe,se),De.translate(be.left,be.top),p.forEach(function(qe){if(qe==="grid")De.lineWidth=re.grid.line.strokeWidth,De.strokeStyle=re.grid.line.stroke,E&&Nu(De,{width:Ce,height:ge,scale:ce,axis:"x",values:_}),R&&Nu(De,{width:Ce,height:ge,scale:Ne,axis:"y",values:F});else if(qe==="annotations")ile(De,{annotations:Le,theme:re});else if(qe==="axes")xM(De,{xScale:ce,yScale:Ne,width:Ce,height:ge,top:I,right:P,bottom:A,left:N,theme:re});else if(qe==="nodes")Me.forEach(function(Qe){w(De,Qe)});else if(qe==="mesh")Z&&(_M(De,je),ue&&EM(De,je,ue.index));else if(qe==="legends")z.forEach(function(Qe){OO(De,dr({},Qe,{data:Ie,containerWidth:Ce,containerHeight:ge,theme:re}))});else{if(typeof qe!="function")throw new Error("Invalid layer: "+qe);qe(De,Oe)}})}},[B,Ce,ge,fe,se,be.top,be.left,f,w,p,Oe,re,ce,Ne,Me,E,R,I,P,A,N,z,Ie,Z,je,ue,Le]);var nt=Wr(),We=nt.showTooltipFromEvent,Be=nt.hideTooltip,Se=$.useCallback(function(De){var qe=c0(B.current,De),Qe=qe[0],Je=qe[1];if(!SO(be.left,be.top,Ce,ge,Qe,Je))return null;var rt=Xe.find(Qe-be.left,Je-be.top);return Me[rt]},[B,be,Ce,ge,Xe]),Fe=$.useCallback(function(De){var qe=Se(De);me(qe),qe?(We($.createElement(H,{node:qe}),De),ue&&ue.id!==qe.id&&(K&&K(ue,De),J&&J(qe,De)),ue||J&&J(qe,De),Q&&Q(qe,De)):(Be(),ue&&K&&K(ue,De))},[Se,ue,me,We,Be,H,J,Q,K]),ot=$.useCallback(function(De){Be(),me(null),ue&&K&&K(ue,De)},[Be,ue,me,K]),ct=$.useCallback(function(De){if(Y){var qe=Se(De);qe&&Y(qe,De)}},[Se,Y]);return k.jsx("canvas",{ref:function(De){B.current=De,ne&&"current"in ne&&(ne.current=De)},width:fe*f,height:se*f,style:{width:fe,height:se,cursor:X?"auto":"normal"},onMouseEnter:X?Fe:void 0,onMouseMove:X?Fe:void 0,onMouseLeave:X?ot:void 0,onClick:X?ct:void 0})},Ble=$.forwardRef(function(e,t){var n=e.isInteractive,r=e.renderWrapper,i=e.theme,a=OM(e,Fle);return k.jsx(Pa,{isInteractive:n,renderWrapper:r,theme:i,animate:!1,children:k.jsx(zle,dr({},a,{canvasRef:t}))})});$.forwardRef(function(e,t){return k.jsx(Wi,{children:function(n){var r=n.width,i=n.height;return k.jsx(Ble,dr({width:r,height:i},e,{ref:t}))}})});const Vle=({x1:e,x2:t,y1:n,y2:r})=>k.jsx("g",{children:k.jsx("line",{x1:e,y1:n,x2:t,y2:r,stroke:"red",strokeWidth:"3"})}),Wle=({scatterPlotData:e,style:t={},margin:n={},axisBottom:r={},axisLeft:i={},tooltip:a=null})=>{const o=e==null?void 0:e.line,s=o==null?void 0:o.x1,l=o==null?void 0:o.y1,c=o==null?void 0:o.x2,u=o==null?void 0:o.y2;return k.jsxs(k.Fragment,{children:[k.jsx(On,{}),k.jsx("div",{style:{width:"100%",height:600,...t},children:k.jsx(Dle,{data:[e==null?void 0:e.points],margin:{top:20,right:120,bottom:100,left:120,...n},xScale:{type:"point"},axisBottom:{orient:"bottom",tickSize:5,tickPadding:5,tickRotation:0,legendPosition:"middle",legendOffset:46,truncateTickAt:0,legend:"axisBottom",...r},axisLeft:{orient:"left",tickSize:5,tickPadding:5,tickRotation:0,legendPosition:"middle",legendOffset:-60,truncateTickAt:0,legend:"axisLeft",...i},layers:["grid","markers","axes","nodes","legends",d=>k.jsx(Vle,{x1:d.xScale(s),y1:d.yScale(l),x2:d.xScale(c),y2:d.yScale(u)})],tooltip:({node:d})=>k.jsx(pi,{body:(a==null?void 0:a({node:d}))||k.jsx("span",{children:"Scatterplot tooltip"})})})})]})};function Hle(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}var Ule=Hle;function Gle(e){return function(t){return e==null?void 0:e[t]}}var qle=Gle,Kle=qle,Yle={À:"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"},Xle=Kle(Yle),Zle=Xle,Qle=Zle,Jle=Dl,ece=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,tce="\\u0300-\\u036f",nce="\\ufe20-\\ufe2f",rce="\\u20d0-\\u20ff",ice=tce+nce+rce,ace="["+ice+"]",oce=RegExp(ace,"g");function sce(e){return e=Jle(e),e&&e.replace(ece,Qle).replace(oce,"")}var lce=sce,cce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function uce(e){return e.match(cce)||[]}var dce=uce,fce=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function hce(e){return fce.test(e)}var vce=hce,PM="\\ud800-\\udfff",gce="\\u0300-\\u036f",mce="\\ufe20-\\ufe2f",pce="\\u20d0-\\u20ff",bce=gce+mce+pce,IM="\\u2700-\\u27bf",AM="a-z\\xdf-\\xf6\\xf8-\\xff",yce="\\xac\\xb1\\xd7\\xf7",xce="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Sce="\\u2000-\\u206f",Cce=" \\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",NM="A-Z\\xc0-\\xd6\\xd8-\\xde",wce="\\ufe0e\\ufe0f",jM=yce+xce+Sce+Cce,LM="['’]",DS="["+jM+"]",$ce="["+bce+"]",kM="\\d+",_ce="["+IM+"]",DM="["+AM+"]",FM="[^"+PM+jM+kM+IM+AM+NM+"]",Ece="\\ud83c[\\udffb-\\udfff]",Oce="(?:"+$ce+"|"+Ece+")",Mce="[^"+PM+"]",zM="(?:\\ud83c[\\udde6-\\uddff]){2}",BM="[\\ud800-\\udbff][\\udc00-\\udfff]",Qa="["+NM+"]",Tce="\\u200d",FS="(?:"+DM+"|"+FM+")",Rce="(?:"+Qa+"|"+FM+")",zS="(?:"+LM+"(?:d|ll|m|re|s|t|ve))?",BS="(?:"+LM+"(?:D|LL|M|RE|S|T|VE))?",VM=Oce+"?",WM="["+wce+"]?",Pce="(?:"+Tce+"(?:"+[Mce,zM,BM].join("|")+")"+WM+VM+")*",Ice="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ace="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Nce=WM+VM+Pce,jce="(?:"+[_ce,zM,BM].join("|")+")"+Nce,Lce=RegExp([Qa+"?"+DM+"+"+zS+"(?="+[DS,Qa,"$"].join("|")+")",Rce+"+"+BS+"(?="+[DS,Qa+FS,"$"].join("|")+")",Qa+"?"+FS+"+"+zS,Qa+"+"+BS,Ace,Ice,kM,jce].join("|"),"g");function kce(e){return e.match(Lce)||[]}var Dce=kce,Fce=dce,zce=vce,Bce=Dl,Vce=Dce;function Wce(e,t,n){return e=Bce(e),t=n?void 0:t,t===void 0?zce(e)?Vce(e):Fce(e):e.match(t)||[]}var Hce=Wce,Uce=Ule,Gce=lce,qce=Hce,Kce="['’]",Yce=RegExp(Kce,"g");function Xce(e){return function(t){return Uce(qce(Gce(t).replace(Yce,"")),e,"")}}var Zce=Xce,Qce=SM;function Jce(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Qce(e,t,n)}var eue=Jce,tue="\\ud800-\\udfff",nue="\\u0300-\\u036f",rue="\\ufe20-\\ufe2f",iue="\\u20d0-\\u20ff",aue=nue+rue+iue,oue="\\ufe0e\\ufe0f",sue="\\u200d",lue=RegExp("["+sue+tue+aue+oue+"]");function cue(e){return lue.test(e)}var HM=cue;function uue(e){return e.split("")}var due=uue,UM="\\ud800-\\udfff",fue="\\u0300-\\u036f",hue="\\ufe20-\\ufe2f",vue="\\u20d0-\\u20ff",gue=fue+hue+vue,mue="\\ufe0e\\ufe0f",pue="["+UM+"]",Ug="["+gue+"]",Gg="\\ud83c[\\udffb-\\udfff]",bue="(?:"+Ug+"|"+Gg+")",GM="[^"+UM+"]",qM="(?:\\ud83c[\\udde6-\\uddff]){2}",KM="[\\ud800-\\udbff][\\udc00-\\udfff]",yue="\\u200d",YM=bue+"?",XM="["+mue+"]?",xue="(?:"+yue+"(?:"+[GM,qM,KM].join("|")+")"+XM+YM+")*",Sue=XM+YM+xue,Cue="(?:"+[GM+Ug+"?",Ug,qM,KM,pue].join("|")+")",wue=RegExp(Gg+"(?="+Gg+")|"+Cue+Sue,"g");function $ue(e){return e.match(wue)||[]}var _ue=$ue,Eue=due,Oue=HM,Mue=_ue;function Tue(e){return Oue(e)?Mue(e):Eue(e)}var Rue=Tue,Pue=eue,Iue=HM,Aue=Rue,Nue=Dl;function jue(e){return function(t){t=Nue(t);var n=Iue(t)?Aue(t):void 0,r=n?n[0]:t.charAt(0),i=n?Pue(n,1).join(""):t.slice(1);return r[e]()+i}}var Lue=jue,kue=Lue,Due=kue("toUpperCase"),Fue=Due,zue=Zce,Bue=Fue,Vue=zue(function(e,t,n){return e+(n?" ":"")+Bue(t)}),Wue=Vue;const Hue=rn(Wue);function Uue(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function Gue(){return this.eachAfter(Uue)}function que(e){var t=this,n,r=[t],i,a,o;do for(n=r.reverse(),r=[];t=n.pop();)if(e(t),i=t.children,i)for(a=0,o=i.length;a<o;++a)r.push(i[a]);while(r.length);return this}function Kue(e){for(var t=this,n=[t],r,i;t=n.pop();)if(e(t),r=t.children,r)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}function Yue(e){for(var t=this,n=[t],r=[],i,a,o;t=n.pop();)if(r.push(t),i=t.children,i)for(a=0,o=i.length;a<o;++a)n.push(i[a]);for(;t=r.pop();)e(t);return this}function Xue(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function Zue(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function Que(e){for(var t=this,n=Jue(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function Jue(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function ede(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function tde(){var e=[];return this.each(function(t){e.push(t)}),e}function nde(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function rde(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function y0(e,t){var n=new Lu(e),r=+e.value&&(n.value=e.value),i,a=[n],o,s,l,c;for(t==null&&(t=ade);i=a.pop();)if(r&&(i.value=+i.data.value),(s=t(i.data))&&(c=s.length))for(i.children=new Array(c),l=c-1;l>=0;--l)a.push(o=i.children[l]=new Lu(s[l])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(sde)}function ide(){return y0(this).eachBefore(ode)}function ade(e){return e.children}function ode(e){e.data=e.data.data}function sde(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Lu(e){this.data=e,this.depth=this.height=0,this.parent=null}Lu.prototype=y0.prototype={constructor:Lu,count:Gue,each:que,eachAfter:Yue,eachBefore:Kue,sum:Xue,sort:Zue,path:Que,ancestors:ede,descendants:tde,leaves:nde,links:rde,copy:ide};function lde(e){if(typeof e!="function")throw new Error;return e}function Ss(){return 0}function Cs(e){return function(){return e}}function cde(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function x0(e,t,n,r,i){for(var a=e.children,o,s=-1,l=a.length,c=e.value&&(r-t)/e.value;++s<l;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*c}function S0(e,t,n,r,i){for(var a=e.children,o,s=-1,l=a.length,c=e.value&&(i-n)/e.value;++s<l;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*c}var ude=(1+Math.sqrt(5))/2;function dde(e,t,n,r,i,a){for(var o=[],s=t.children,l,c,u=0,d=0,f=s.length,h,p,m=t.value,v,b,y,x,C,S,w;u<f;){h=i-n,p=a-r;do v=s[d++].value;while(!v&&d<f);for(b=y=v,S=Math.max(p/h,h/p)/(m*e),w=v*v*S,C=Math.max(y/w,w/b);d<f;++d){if(v+=c=s[d].value,c<b&&(b=c),c>y&&(y=c),w=v*v*S,x=Math.max(y/w,w/b),x>C){v-=c;break}C=x}o.push(l={value:v,dice:h<p,children:s.slice(u,d)}),l.dice?x0(l,n,r,i,m?r+=p*v/m:a):S0(l,n,r,m?n+=h*v/m:i,a),m-=v,u=d}return o}const ZM=function e(t){function n(r,i,a,o,s){dde(t,r,i,a,o,s)}return n.ratio=function(r){return e((r=+r)>1?r:1)},n}(ude);function fde(){var e=ZM,t=!1,n=1,r=1,i=[0],a=Ss,o=Ss,s=Ss,l=Ss,c=Ss;function u(f){return f.x0=f.y0=0,f.x1=n,f.y1=r,f.eachBefore(d),i=[0],t&&f.eachBefore(cde),f}function d(f){var h=i[f.depth],p=f.x0+h,m=f.y0+h,v=f.x1-h,b=f.y1-h;v<p&&(p=v=(p+v)/2),b<m&&(m=b=(m+b)/2),f.x0=p,f.y0=m,f.x1=v,f.y1=b,f.children&&(h=i[f.depth+1]=a(f)/2,p+=c(f)-h,m+=o(f)-h,v-=s(f)-h,b-=l(f)-h,v<p&&(p=v=(p+v)/2),b<m&&(m=b=(m+b)/2),e(f,p,m,v,b))}return u.round=function(f){return arguments.length?(t=!!f,u):t},u.size=function(f){return arguments.length?(n=+f[0],r=+f[1],u):[n,r]},u.tile=function(f){return arguments.length?(e=lde(f),u):e},u.padding=function(f){return arguments.length?u.paddingInner(f).paddingOuter(f):u.paddingInner()},u.paddingInner=function(f){return arguments.length?(a=typeof f=="function"?f:Cs(+f),u):a},u.paddingOuter=function(f){return arguments.length?u.paddingTop(f).paddingRight(f).paddingBottom(f).paddingLeft(f):u.paddingTop()},u.paddingTop=function(f){return arguments.length?(o=typeof f=="function"?f:Cs(+f),u):o},u.paddingRight=function(f){return arguments.length?(s=typeof f=="function"?f:Cs(+f),u):s},u.paddingBottom=function(f){return arguments.length?(l=typeof f=="function"?f:Cs(+f),u):l},u.paddingLeft=function(f){return arguments.length?(c=typeof f=="function"?f:Cs(+f),u):c},u}function hde(e,t,n,r,i){var a=e.children,o,s=a.length,l,c=new Array(s+1);for(c[0]=l=o=0;o<s;++o)c[o+1]=l+=a[o].value;u(0,s,e.value,t,n,r,i);function u(d,f,h,p,m,v,b){if(d>=f-1){var y=a[d];y.x0=p,y.y0=m,y.x1=v,y.y1=b;return}for(var x=c[d],C=h/2+x,S=d+1,w=f-1;S<w;){var O=S+w>>>1;c[O]<C?S=O+1:w=O}C-c[S-1]<c[S]-C&&d+1<S&&--S;var E=c[S]-x,_=h-E;if(v-p>b-m){var T=(p*_+v*E)/h;u(d,S,E,p,m,T,b),u(S,f,_,T,m,v,b)}else{var R=(m*_+b*E)/h;u(d,S,E,p,m,v,R),u(S,f,_,p,R,v,b)}}}function vde(e,t,n,r,i){(e.depth&1?S0:x0)(e,t,n,r,i)}function fr(){return fr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fr.apply(this,arguments)}function gde(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var mde=function(e,t){return ur([e,t],function(n,r){return"translate("+n+","+r+")"})},pde=function(e,t){return ur([e,t],function(n,r){return"translate("+n+"px, "+r+"px)"})},VS=function(e,t,n){return ur([e,t,n],function(r,i,a){return"translate("+r+","+i+") rotate("+a+")"})},bde=function(e,t,n){return ur([e,t,n],function(r,i,a){return"translate("+r+"px,"+i+"px) rotate("+a+"deg)"})},yde=function(e,t,n){return ur([e,t,n],function(r,i,a){return"translate("+(r-(a===0?0:5))+"px,"+(i-(a===0?5:0))+"px) rotate("+a+"deg)"})},xde=$.memo(function(e){var t=e.node,n=e.animatedProps,r=e.borderWidth,i=e.enableLabel,a=e.enableParentLabel,o=e.labelSkipSize,s=kt(),l=i&&t.isLeaf&&(o===0||Math.min(t.width,t.height)>o),c=a&&t.isParent;return k.jsxs(Tt.g,{transform:mde(n.x,n.y),children:[k.jsx(Tt.rect,{"data-testid":"node."+t.id,width:ur(n.width,function(u){return Math.max(u,0)}),height:ur(n.height,function(u){return Math.max(u,0)}),fill:t.fill?t.fill:n.color,strokeWidth:r,stroke:t.borderColor,fillOpacity:t.opacity,onMouseEnter:t.onMouseEnter,onMouseMove:t.onMouseMove,onMouseLeave:t.onMouseLeave,onClick:t.onClick}),l&&k.jsx(Tt.text,{"data-testid":"label."+t.id,textAnchor:"middle",dominantBaseline:"central",style:fr({},s.labels.text,{fill:t.labelTextColor,pointerEvents:"none"}),fillOpacity:n.labelOpacity,transform:VS(n.labelX,n.labelY,n.labelRotation),children:t.label}),c&&k.jsx(Tt.text,{"data-testid":"parentLabel."+t.id,dominantBaseline:"central",style:fr({},s.labels.text,{fill:t.parentLabelTextColor,pointerEvents:"none"}),fillOpacity:n.parentLabelOpacity,transform:VS(n.parentLabelX,n.parentLabelY,n.parentLabelRotation),children:t.parentLabel})]})}),Sde=$.memo(function(e){var t=e.node;return k.jsx(So,{id:t.id,value:t.formattedValue,enableChip:!0,color:t.color})}),Cde=$.memo(function(e){var t=e.node,n=e.animatedProps,r=e.borderWidth,i=e.enableLabel,a=e.enableParentLabel,o=e.labelSkipSize,s=kt(),l=i&&t.isLeaf&&(o===0||Math.min(t.width,t.height)>o),c=a&&t.isParent;return k.jsxs(Tt.div,{"data-testid":"node."+t.id,id:t.path.replace(/[^\w]/gi,"-"),style:{boxSizing:"border-box",position:"absolute",top:0,left:0,transform:pde(n.x,n.y),width:n.width,height:n.height,borderWidth:r,borderStyle:"solid",borderColor:t.borderColor,overflow:"hidden"},children:[k.jsx(Tt.div,{style:{boxSizing:"border-box",position:"absolute",top:0,left:0,opacity:t.opacity,width:n.width,height:n.height,background:n.color},onMouseEnter:t.onMouseEnter,onMouseMove:t.onMouseMove,onMouseLeave:t.onMouseLeave,onClick:t.onClick}),l&&k.jsx(Tt.span,{"data-testid":"label."+t.id,style:fr({},s.labels.text,{position:"absolute",display:"flex",top:-5,left:-5,width:10,height:10,justifyContent:"center",alignItems:"center",whiteSpace:"nowrap",color:t.labelTextColor,transformOrigin:"center center",transform:bde(n.labelX,n.labelY,n.labelRotation),opacity:n.labelOpacity,pointerEvents:"none"}),children:t.label}),c&&k.jsx(Tt.span,{"data-testid":"parentLabel."+t.id,style:fr({},s.labels.text,{position:"absolute",display:"flex",justifyContent:"flex-start",alignItems:"center",whiteSpace:"nowrap",width:10,height:10,color:t.parentLabelTextColor,transformOrigin:"top left",transform:yde(n.parentLabelX,n.parentLabelY,n.parentLabelRotation),opacity:n.parentLabelOpacity,pointerEvents:"none"}),children:t.parentLabel})]})}),sn={layers:["nodes"],identity:"id",value:"value",tile:"squarify",leavesOnly:!1,innerPadding:0,outerPadding:0,colors:{scheme:"nivo"},colorBy:"pathComponents.1",nodeOpacity:.33,enableLabel:!0,label:"formattedValue",labelSkipSize:0,labelTextColor:{from:"color",modifiers:[["darker",1]]},orientLabel:!0,enableParentLabel:!0,parentLabel:"id",parentLabelSize:20,parentLabelPosition:"top",parentLabelPadding:6,parentLabelTextColor:{from:"color",modifiers:[["darker",1]]},borderWidth:1,borderColor:{from:"color",modifiers:[["darker",1]]},isInteractive:!0,tooltip:Sde,role:"img",animate:!0,motionConfig:"gentle"},Dt=fr({},sn,{nodeComponent:xde,defs:[],fill:[]});fr({},sn,{nodeComponent:Cde});fr({},sn,{pixelRatio:typeof window<"u"&&window.devicePixelRatio||1});var wde={binary:hde,dice:x0,slice:S0,sliceDice:vde,squarify:ZM},$de=function(e){var t=e.root,n=e.getValue;return $.useMemo(function(){return y0(t).sum(n)},[t,n])},_de=function(e){var t=e.data,n=e.width,r=e.height,i=e.identity,a=i===void 0?sn.identity:i,o=e.value,s=o===void 0?sn.value:o,l=e.valueFormat,c=e.leavesOnly,u=c===void 0?sn.leavesOnly:c,d=e.tile,f=d===void 0?sn.tile:d,h=e.innerPadding,p=h===void 0?sn.innerPadding:h,m=e.outerPadding,v=m===void 0?sn.outerPadding:m,b=e.label,y=b===void 0?sn.label:b,x=e.orientLabel,C=x===void 0?sn.orientLabel:x,S=e.enableParentLabel,w=S===void 0?sn.enableParentLabel:S,O=e.parentLabel,E=O===void 0?sn.parentLabel:O,_=e.parentLabelSize,T=_===void 0?sn.parentLabelSize:_,R=e.parentLabelPosition,F=R===void 0?sn.parentLabelPosition:R,I=e.parentLabelPadding,P=I===void 0?sn.parentLabelPadding:I,j=e.colors,A=j===void 0?sn.colors:j,M=e.colorBy,N=M===void 0?sn.colorBy:M,L=e.nodeOpacity,D=L===void 0?sn.nodeOpacity:L,V=e.borderColor,X=V===void 0?sn.borderColor:V,q=e.labelTextColor,Z=q===void 0?sn.labelTextColor:q,J=e.parentLabelTextColor,Q=J===void 0?sn.parentLabelTextColor:J,K=Yr(a),Y=Yr(s),W=Li(l),H=Yr(y),U=Yr(E),z=function(ge){var fe=ge.width,se=ge.height,xe=ge.tile,ce=ge.innerPadding,Ne=ge.outerPadding,Me=ge.enableParentLabel,Ie=ge.parentLabelSize,Le=ge.parentLabelPosition,He=ge.leavesOnly;return $.useMemo(function(){var Xe=fde().size([fe,se]).tile(wde[xe]).round(!0).paddingInner(ce).paddingOuter(Ne);if(Me&&!He){var je=Ie+2*Ne;Xe["padding"+Hue(Le)](je)}return Xe},[fe,se,xe,ce,Ne,Me,Ie,Le,He])}({width:n,height:r,tile:f,innerPadding:p,outerPadding:v,enableParentLabel:w,parentLabelSize:T,parentLabelPosition:F,leavesOnly:u}),ne=$de({root:t,getValue:Y}),B=$.useMemo(function(){var ge=jO(ne);return z(ge),u?ge.leaves():ge.descendants()},[ne,z,u]),re=$.useMemo(function(){return B.map(function(ge){var fe=function(Ne,Me){var Ie=Ne.ancestors().map(function(Le){return Me(Le.data)}).reverse();return{path:Ie.join("."),pathComponents:Ie}}(ge,K),se=fe.path,xe=fe.pathComponents,ce={id:K(ge.data),path:se,pathComponents:xe,data:g0(ge.data,"children"),x:ge.x0,y:ge.y0,width:ge.x1-ge.x0,height:ge.y1-ge.y0,value:ge.value,formattedValue:W(ge.value),treeDepth:ge.depth,treeHeight:ge.height,isParent:ge.height>0,isLeaf:ge.height===0,parentLabelX:0,parentLabelY:0,parentLabelRotation:0};return ce.labelRotation=C&&ce.height>ce.width?-90:0,F==="top"&&(ce.parentLabelX=v+P,ce.parentLabelY=v+T/2),F==="right"&&(ce.parentLabelX=ce.width-v-T/2,ce.parentLabelY=ce.height-v-P,ce.parentLabelRotation=-90),F==="bottom"&&(ce.parentLabelX=v+P,ce.parentLabelY=ce.height-v-T/2),F==="left"&&(ce.parentLabelX=v+T/2,ce.parentLabelY=ce.height-v-P,ce.parentLabelRotation=-90),ce.label=H(ce),ce.parentLabel=U(ce),ce})},[B,K,W,H,C,U,T,F,P,v]),ie=kt(),ue=Vl(A,N),me=lr(X,ie),ve=lr(Z,ie),be=lr(Q,ie),Ce=$.useMemo(function(){return re.map(function(ge){var fe=fr({},ge,{color:ue(ge),opacity:D});return fe.borderColor=me(fe),fe.labelTextColor=ve(fe),fe.parentLabelTextColor=be(fe),fe})},[re,ue,D,me,ve,be]);return{hierarchy:ne,nodes:Ce,layout:z}},Ede=function(e){var t=e.nodes;return $.useMemo(function(){return{nodes:t}},[t])},Vh=function(e){return{x:e.x,y:e.y,width:e.width,height:e.height,color:e.color,labelX:e.width/2,labelY:e.height/2,labelRotation:e.labelRotation,labelOpacity:1,parentLabelX:e.parentLabelX,parentLabelY:e.parentLabelY,parentLabelRotation:e.parentLabelRotation,parentLabelOpacity:1}},WS=function(e){return{x:e.x+e.width/2,y:e.y+e.height/2,width:0,height:0,color:e.color,labelX:0,labelY:0,labelRotation:e.labelRotation,labelOpacity:0,parentLabelX:0,parentLabelY:0,parentLabelRotation:e.parentLabelRotation,parentLabelOpacity:0}},Ode=$.memo(function(e){var t=e.nodes,n=e.nodeComponent,r=e.borderWidth,i=e.enableLabel,a=e.labelSkipSize,o=e.enableParentLabel,s=function(f,h){var p=h.isInteractive,m=h.onMouseEnter,v=h.onMouseMove,b=h.onMouseLeave,y=h.onClick,x=h.tooltip,C=Wr(),S=C.showTooltipFromEvent,w=C.hideTooltip,O=$.useCallback(function(F,I){S($.createElement(x,{node:F}),I,"left")},[S,x]),E=$.useCallback(function(F,I){O(F,I),m==null||m(F,I)},[m,O]),_=$.useCallback(function(F,I){O(F,I),v==null||v(F,I)},[v,O]),T=$.useCallback(function(F,I){w(),b==null||b(F,I)},[b,w]),R=$.useCallback(function(F,I){y==null||y(F,I)},[y]);return $.useMemo(function(){return f.map(function(F){return p?fr({},F,{onMouseEnter:function(I){return E(F,I)},onMouseMove:function(I){return _(F,I)},onMouseLeave:function(I){return T(F,I)},onClick:function(I){return R(F,I)}}):F})},[p,f,E,_,T,R])}(t,{isInteractive:e.isInteractive,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseLeave:e.onMouseLeave,onClick:e.onClick,tooltip:e.tooltip}),l=Sn(),c=l.animate,u=l.config,d=$a(s,{keys:function(f){return f.path},initial:Vh,from:WS,enter:Vh,update:Vh,leave:WS,config:u,immediate:!c});return k.jsx(k.Fragment,{children:d(function(f,h){return $.createElement(n,{key:h.path,node:h,animatedProps:f,borderWidth:r,enableLabel:i,labelSkipSize:a,enableParentLabel:o})})})}),Mde=["isInteractive","animate","motionConfig","theme","renderWrapper"],Tde=function(e){var t=e.data,n=e.identity,r=n===void 0?Dt.identity:n,i=e.value,a=i===void 0?Dt.value:i,o=e.valueFormat,s=e.tile,l=s===void 0?Dt.tile:s,c=e.nodeComponent,u=c===void 0?Dt.nodeComponent:c,d=e.innerPadding,f=d===void 0?Dt.innerPadding:d,h=e.outerPadding,p=h===void 0?Dt.outerPadding:h,m=e.leavesOnly,v=m===void 0?Dt.leavesOnly:m,b=e.width,y=e.height,x=e.margin,C=e.layers,S=C===void 0?Dt.layers:C,w=e.colors,O=w===void 0?Dt.colors:w,E=e.colorBy,_=E===void 0?Dt.colorBy:E,T=e.nodeOpacity,R=T===void 0?Dt.nodeOpacity:T,F=e.borderWidth,I=F===void 0?Dt.borderWidth:F,P=e.borderColor,j=P===void 0?Dt.borderColor:P,A=e.defs,M=A===void 0?Dt.defs:A,N=e.fill,L=N===void 0?Dt.fill:N,D=e.enableLabel,V=D===void 0?Dt.enableLabel:D,X=e.label,q=X===void 0?Dt.label:X,Z=e.labelTextColor,J=Z===void 0?Dt.labelTextColor:Z,Q=e.orientLabel,K=Q===void 0?Dt.orientLabel:Q,Y=e.labelSkipSize,W=Y===void 0?Dt.labelSkipSize:Y,H=e.enableParentLabel,U=H===void 0?Dt.enableParentLabel:H,z=e.parentLabel,ne=z===void 0?Dt.parentLabel:z,B=e.parentLabelSize,re=B===void 0?Dt.parentLabelSize:B,ie=e.parentLabelPosition,ue=ie===void 0?Dt.parentLabelPosition:ie,me=e.parentLabelPadding,ve=me===void 0?Dt.parentLabelPadding:me,be=e.parentLabelTextColor,Ce=be===void 0?Dt.parentLabelTextColor:be,ge=e.isInteractive,fe=ge===void 0?Dt.isInteractive:ge,se=e.onMouseEnter,xe=e.onMouseMove,ce=e.onMouseLeave,Ne=e.onClick,Me=e.tooltip,Ie=Me===void 0?Dt.tooltip:Me,Le=e.role,He=e.ariaLabel,Xe=e.ariaLabelledBy,je=e.ariaDescribedBy,Oe=Ra(b,y,x),nt=Oe.margin,We=Oe.innerWidth,Be=Oe.innerHeight,Se=Oe.outerWidth,Fe=Oe.outerHeight,ot=_de({data:t,identity:r,value:a,valueFormat:o,leavesOnly:v,width:We,height:Be,tile:l,innerPadding:f,outerPadding:p,colors:O,colorBy:_,nodeOpacity:R,borderColor:j,label:q,labelTextColor:J,orientLabel:K,enableParentLabel:U,parentLabel:ne,parentLabelSize:re,parentLabelPosition:ue,parentLabelPadding:ve,parentLabelTextColor:Ce}).nodes,ct={nodes:null};S.includes("nodes")&&(ct.nodes=k.jsx(Ode,{nodes:ot,nodeComponent:u,borderWidth:I,enableLabel:V,labelSkipSize:W,enableParentLabel:U,isInteractive:fe,onMouseEnter:se,onMouseMove:xe,onMouseLeave:ce,onClick:Ne,tooltip:Ie},"nodes"));var De=Ede({nodes:ot}),qe=u0(M,ot,L);return k.jsx(Zo,{width:Se,height:Fe,margin:nt,defs:qe,role:Le,ariaLabel:He,ariaLabelledBy:Xe,ariaDescribedBy:je,children:S.map(function(Qe,Je){var rt;return typeof Qe=="function"?k.jsx($.Fragment,{children:$.createElement(Qe,De)},Je):(rt=ct==null?void 0:ct[Qe])!=null?rt:null})})},Rde=function(e){var t=e.isInteractive,n=t===void 0?Dt.isInteractive:t,r=e.animate,i=r===void 0?Dt.animate:r,a=e.motionConfig,o=a===void 0?Dt.motionConfig:a,s=e.theme,l=e.renderWrapper,c=gde(e,Mde);return k.jsx(Pa,{animate:i,isInteractive:n,motionConfig:o,renderWrapper:l,theme:s,children:k.jsx(Tde,fr({isInteractive:n},c))})},Pde=function(e){return k.jsx(Wi,{children:function(t){var n=t.width,r=t.height;return k.jsx(Rde,fr({width:n,height:r},e))}})};const Ide=({treeMapData:e,style:t={},colors:n=null,identity:r=null,value:i=null,margin:a={},label:o=null,orientLabel:s=!1,labelSkipSize:l=12,labelTextColor:c=null,borderColor:u=null,tooltip:d=null})=>k.jsxs(k.Fragment,{children:[k.jsx(On,{}),k.jsx("div",{style:{width:"100%",height:600,...t},children:k.jsx(Pde,{data:e,colors:n||{scheme:"nivo"},identity:r||"name",value:i||"loc",margin:{top:10,right:10,bottom:10,left:10,...a},enableParentLabel:!1,label:f=>(o==null?void 0:o(f))||`${f==null?void 0:f.id}`,orientLabel:s,labelSkipSize:l,labelTextColor:c||"black",borderColor:u||{from:"color",modifiers:[["darker",.1]]},tooltip:({node:f})=>k.jsx(pi,{body:(d==null?void 0:d({node:f}))||k.jsx("span",{children:"Treemap tooltip"})})})})]});var Ade=Dl,Nde=0;function jde(e){var t=++Nde;return Ade(e)+t}var Lde=jde;const kde=rn(Lde);function Xn(){return Xn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xn.apply(this,arguments)}var C0=$.memo(function(e){var t=e.point;return k.jsx(So,{id:k.jsxs("span",{children:["x: ",k.jsx("strong",{children:t.data.xFormatted}),", y:"," ",k.jsx("strong",{children:t.data.yFormatted})]}),enableChip:!0,color:t.serieColor})}),QM=$.memo(function(e){var t=e.slice,n=e.axis,r=kt(),i=n==="x"?"y":"x";return k.jsx(h_,{rows:t.points.map(function(a){return[k.jsx(fu,{color:a.serieColor,style:r.tooltip.chip},"chip"),a.serieId,k.jsx("span",{style:r.tooltip.tableCellValue,children:a.data[i+"Formatted"]},"value")]})})}),JM={curve:"linear",xScale:{type:"point"},yScale:{type:"linear",min:0,max:"auto"},layers:["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"],axisBottom:{},axisLeft:{},enableGridX:!0,enableGridY:!0,enablePoints:!0,pointSize:6,pointColor:{from:"color"},pointBorderWidth:0,pointBorderColor:{theme:"background"},enablePointLabel:!1,pointLabel:"yFormatted",colors:{scheme:"nivo"},enableArea:!1,areaBaselineValue:0,areaOpacity:.2,areaBlendMode:"normal",lineWidth:2,legends:[],isInteractive:!0,tooltip:C0,enableSlices:!1,debugSlices:!1,sliceTooltip:QM,debugMesh:!1,enableCrosshair:!0,crosshairType:"bottom-left"},$i=Xn({},JM,{enablePointLabel:!1,useMesh:!1,enableTouchCrosshair:!1,animate:!0,motionConfig:"gentle",defs:[],fill:[],role:"img"});Xn({},JM,{pixelRatio:typeof window<"u"&&window.devicePixelRatio||1});var Dde=function(e){var t=e.curve;return $.useMemo(function(){return ml().defined(function(n){return n.x!==null&&n.y!==null}).x(function(n){return n.x}).y(function(n){return n.y}).curve(aO(t))},[t])},Fde=function(e){var t=e.curve,n=e.yScale,r=e.areaBaselineValue;return $.useMemo(function(){return oX().defined(function(i){return i.x!==null&&i.y!==null}).x(function(i){return i.x}).y1(function(i){return i.y}).curve(aO(t)).y0(n(r))},[t,n,r])},zde=function(e){var t=e.componentId,n=e.enableSlices,r=e.points,i=e.width,a=e.height;return $.useMemo(function(){if(n===!1)return[];if(n==="x"){var o=new Map;return r.forEach(function(l){l.data.x!==null&&l.data.y!==null&&(o.has(l.x)?o.get(l.x).push(l):o.set(l.x,[l]))}),Array.from(o.entries()).sort(function(l,c){return l[0]-c[0]}).map(function(l,c,u){var d,f,h=l[0],p=l[1],m=u[c-1],v=u[c+1];return d=m?h-(h-m[0])/2:h,f=v?h-d+(v[0]-h)/2:i-d,{id:"slice:"+t+":"+h,x0:d,x:h,y0:0,y:0,width:f,height:a,points:p.reverse()}})}if(n==="y"){var s=new Map;return r.forEach(function(l){l.data.x!==null&&l.data.y!==null&&(s.has(l.y)?s.get(l.y).push(l):s.set(l.y,[l]))}),Array.from(s.entries()).sort(function(l,c){return l[0]-c[0]}).map(function(l,c,u){var d,f,h=l[0],p=l[1],m=u[c-1],v=u[c+1];return d=m?h-(h-m[0])/2:h,f=v?h-d+(v[0]-h)/2:a-d,{id:h,x0:0,x:0,y0:d,y:h,width:i,height:f,points:p.reverse()}})}},[t,n,a,r,i])},Bde="line",eT=function(e){var t=e.data,n=e.xScale,r=n===void 0?$i.xScale:n,i=e.xFormat,a=e.yScale,o=a===void 0?$i.yScale:a,s=e.yFormat,l=e.width,c=e.height,u=e.colors,d=u===void 0?$i.colors:u,f=e.curve,h=f===void 0?$i.curve:f,p=e.areaBaselineValue,m=p===void 0?$i.areaBaselineValue:p,v=e.pointColor,b=v===void 0?$i.pointColor:v,y=e.pointBorderColor,x=y===void 0?$i.pointBorderColor:y,C=e.enableSlices,S=C===void 0?$i.enableSlicesTooltip:C,w=$.useState(kde(Bde))[0],O=Li(i),E=Li(s),_=Vl(d,"id"),T=kt(),R=lr(b,T),F=lr(x,T),I=$.useState([]),P=I[0],j=I[1],A=$.useMemo(function(){return uM(t.filter(function(Q){return P.indexOf(Q.id)===-1}),r,o,l,c)},[t,P,r,o,l,c]),M=A.xScale,N=A.yScale,L=A.series,D=$.useMemo(function(){var Q=t.map(function(Y){return{id:Y.id,label:Y.id,color:_(Y)}}),K=Q.map(function(Y){return Xn({},L.find(function(W){return W.id===Y.id}),{color:Y.color})}).filter(function(Y){return!!Y.id});return{legendData:Q.map(function(Y){return Xn({},Y,{hidden:!K.find(function(W){return W.id===Y.id})})}).reverse(),series:K}},[t,L,_]),V=D.legendData,X=D.series,q=$.useCallback(function(Q){j(function(K){return K.indexOf(Q)>-1?K.filter(function(Y){return Y!==Q}):[].concat(K,[Q])})},[]),Z=function(Q){var K=Q.series,Y=Q.getPointColor,W=Q.getPointBorderColor,H=Q.formatX,U=Q.formatY;return $.useMemo(function(){return K.reduce(function(z,ne){return[].concat(z,ne.data.filter(function(B){return B.position.x!==null&&B.position.y!==null}).map(function(B,re){var ie={id:ne.id+"."+re,index:z.length+re,serieId:ne.id,serieColor:ne.color,x:B.position.x,y:B.position.y};return ie.color=Y(ne),ie.borderColor=W(ie),ie.data=Xn({},B.data,{xFormatted:H(B.data.x),yFormatted:U(B.data.y)}),ie}))},[])},[K,Y,W,H,U])}({series:X,getPointColor:R,getPointBorderColor:F,formatX:O,formatY:E}),J=zde({componentId:w,enableSlices:S,points:Z,width:l,height:c});return{legendData:V,toggleSerie:q,lineGenerator:Dde({curve:h}),areaGenerator:Fde({curve:h,yScale:N,areaBaselineValue:m}),getColor:_,series:X,xScale:M,yScale:N,slices:J,points:Z}},Vde=function(e){var t=e.areaBlendMode,n=e.areaOpacity,r=e.color,i=e.fill,a=e.path,o=Sn(),s=o.animate,l=o.config,c=ff(a),u=Mr({color:r,config:l,immediate:!s});return k.jsx(Tt.path,{d:c,fill:i||u.color,fillOpacity:n,strokeWidth:0,style:{mixBlendMode:t}})},Wde=$.memo(function(e){var t=e.areaGenerator,n=e.areaOpacity,r=e.areaBlendMode,i=e.lines.slice(0).reverse();return k.jsx("g",{children:i.map(function(a){return k.jsx(Vde,Xn({path:t(a.data.map(function(o){return o.position}))},Xn({areaOpacity:n,areaBlendMode:r},a)),a.id)})})}),Hde=$.memo(function(e){var t=e.lineGenerator,n=e.points,r=e.color,i=e.thickness,a=$.useMemo(function(){return t(n)},[t,n]),o=ff(a);return k.jsx(Tt.path,{d:o,fill:"none",strokeWidth:i,stroke:r})}),Ude=$.memo(function(e){var t=e.lines,n=e.lineGenerator,r=e.lineWidth;return t.slice(0).reverse().map(function(i){var a=i.id,o=i.data,s=i.color;return k.jsx(Hde,{id:a,points:o.map(function(l){return l.position}),lineGenerator:n,color:s,thickness:r},a)})}),Gde=$.memo(function(e){var t=e.slice,n=e.slices,r=e.axis,i=e.debug,a=e.tooltip,o=e.isCurrent,s=e.setCurrent,l=e.onMouseEnter,c=e.onMouseMove,u=e.onMouseLeave,d=e.onClick,f=e.onTouchStart,h=e.onTouchMove,p=e.onTouchEnd,m=Wr(),v=m.showTooltipFromEvent,b=m.hideTooltip,y=$.useCallback(function(_){v($.createElement(a,{slice:t,axis:r}),_,"right"),s(t),l&&l(t,_)},[v,a,t,r,s,l]),x=$.useCallback(function(_){v($.createElement(a,{slice:t,axis:r}),_,"right"),c&&c(t,_)},[v,a,t,r,c]),C=$.useCallback(function(_){b(),s(null),u&&u(t,_)},[b,s,u,t]),S=$.useCallback(function(_){d&&d(t,_)},[t,d]),w=$.useCallback(function(_){v($.createElement(a,{slice:t,axis:r}),_,"right"),s(t),f&&f(t,_)},[r,f,s,v,t,a]),O=$.useCallback(function(_){var T=_.touches[0],R=document.elementFromPoint(T.clientX,T.clientY),F=R==null?void 0:R.getAttribute("data-ref");if(F){var I=n.find(function(P){return P.id===F});I&&(v($.createElement(a,{slice:I,axis:r}),_,"right"),s(I))}h&&h(t,_)},[r,h,s,v,t,n,a]),E=$.useCallback(function(_){b(),s(null),p&&p(t,_)},[b,s,p,t]);return k.jsx("rect",{x:t.x0,y:t.y0,width:t.width,height:t.height,stroke:"red",strokeWidth:i?1:0,strokeOpacity:.75,fill:"red",fillOpacity:o&&i?.35:0,onMouseEnter:y,onMouseMove:x,onMouseLeave:C,onClick:S,onTouchStart:w,onTouchMove:O,onTouchEnd:E,"data-ref":t.id})}),qde=$.memo(function(e){var t=e.slices,n=e.axis,r=e.debug,i=e.height,a=e.tooltip,o=e.current,s=e.setCurrent,l=e.onMouseEnter,c=e.onMouseMove,u=e.onMouseLeave,d=e.onClick,f=e.onTouchStart,h=e.onTouchMove,p=e.onTouchEnd;return t.map(function(m){return k.jsx(Gde,{slice:m,slices:t,axis:n,debug:r,height:i,tooltip:a,setCurrent:s,isCurrent:o!==null&&o.id===m.id,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onTouchStart:f,onTouchMove:h,onTouchEnd:p},m.id)})}),Kde=$.memo(function(e){var t=e.points,n=e.symbol,r=e.size,i=e.borderWidth,a=e.enableLabel,o=e.label,s=e.labelYOffset,l=kt(),c=Dee(o),u=t.slice(0).reverse().map(function(d){return{id:d.id,x:d.x,y:d.y,datum:d.data,fill:d.color,stroke:d.borderColor,label:a?c(d):null}});return k.jsx("g",{children:u.map(function(d){return k.jsx(jee,{x:d.x,y:d.y,datum:d.datum,symbol:n,size:r,color:d.fill,borderWidth:i,borderColor:d.stroke,label:d.label,labelYOffset:s,theme:l},d.id)})})}),Yde=$.memo(function(e){var t=e.points,n=e.width,r=e.height,i=e.margin,a=e.setCurrent,o=e.onMouseEnter,s=e.onMouseMove,l=e.onMouseLeave,c=e.onClick,u=e.onTouchStart,d=e.onTouchMove,f=e.onTouchEnd,h=e.tooltip,p=e.debug,m=e.enableTouchCrosshair,v=Wr(),b=v.showTooltipAt,y=v.hideTooltip,x=$.useCallback(function(T,R){b($.createElement(h,{point:T}),[T.x+i.left,T.y+i.top],"top"),o&&o(T,R)},[b,h,o,i]),C=$.useCallback(function(T,R){b($.createElement(h,{point:T}),[T.x+i.left,T.y+i.top],"top"),s&&s(T,R)},[b,h,i.left,i.top,s]),S=$.useCallback(function(T,R){y(),l&&l(T,R)},[y,l]),w=$.useCallback(function(T,R){c&&c(T,R)},[c]),O=$.useCallback(function(T,R){b($.createElement(h,{point:T}),[T.x+i.left,T.y+i.top],"top"),u&&u(T,R)},[i.left,i.top,u,b,h]),E=$.useCallback(function(T,R){b($.createElement(h,{point:T}),[T.x+i.left,T.y+i.top],"top"),d&&d(T,R)},[i.left,i.top,d,b,h]),_=$.useCallback(function(T,R){y(),f&&f(T,R)},[f,y]);return k.jsx($M,{nodes:t,width:n,height:r,setCurrent:a,onMouseEnter:x,onMouseMove:C,onMouseLeave:S,onClick:w,onTouchStart:O,onTouchMove:E,onTouchEnd:_,enableTouchCrosshair:m,debug:p})}),Xde=xO(function(e){var t=e.data,n=e.xScale,r=n===void 0?{type:"point"}:n,i=e.xFormat,a=e.yScale,o=a===void 0?{type:"linear",min:0,max:"auto"}:a,s=e.yFormat,l=e.layers,c=l===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:l,u=e.curve,d=u===void 0?"linear":u,f=e.areaBaselineValue,h=f===void 0?0:f,p=e.colors,m=p===void 0?{scheme:"nivo"}:p,v=e.margin,b=e.width,y=e.height,x=e.axisTop,C=e.axisRight,S=e.axisBottom,w=S===void 0?{}:S,O=e.axisLeft,E=O===void 0?{}:O,_=e.enableGridX,T=_===void 0||_,R=e.enableGridY,F=R===void 0||R,I=e.gridXValues,P=e.gridYValues,j=e.lineWidth,A=j===void 0?2:j,M=e.enableArea,N=M!==void 0&&M,L=e.areaOpacity,D=L===void 0?.2:L,V=e.areaBlendMode,X=V===void 0?"normal":V,q=e.enablePoints,Z=q===void 0||q,J=e.pointSymbol,Q=e.pointSize,K=Q===void 0?6:Q,Y=e.pointColor,W=Y===void 0?{from:"color"}:Y,H=e.pointBorderWidth,U=H===void 0?0:H,z=e.pointBorderColor,ne=z===void 0?{theme:"background"}:z,B=e.enablePointLabel,re=B!==void 0&&B,ie=e.pointLabel,ue=ie===void 0?"data.yFormatted":ie,me=e.pointLabelYOffset,ve=e.defs,be=ve===void 0?[]:ve,Ce=e.fill,ge=Ce===void 0?[]:Ce,fe=e.markers,se=e.legends,xe=se===void 0?[]:se,ce=e.isInteractive,Ne=ce===void 0||ce,Me=e.useMesh,Ie=Me!==void 0&&Me,Le=e.debugMesh,He=Le!==void 0&&Le,Xe=e.onMouseEnter,je=e.onMouseMove,Oe=e.onMouseLeave,nt=e.onClick,We=e.onTouchStart,Be=e.onTouchMove,Se=e.onTouchEnd,Fe=e.tooltip,ot=Fe===void 0?C0:Fe,ct=e.enableSlices,De=ct!==void 0&&ct,qe=e.debugSlices,Qe=qe!==void 0&&qe,Je=e.sliceTooltip,rt=Je===void 0?QM:Je,Ve=e.enableCrosshair,Te=Ve===void 0||Ve,st=e.crosshairType,mt=st===void 0?"bottom-left":st,Ee=e.enableTouchCrosshair,he=Ee!==void 0&&Ee,we=e.role,ke=we===void 0?"img":we,tt=Ra(b,y,v),Ue=tt.margin,at=tt.innerWidth,G=tt.innerHeight,oe=tt.outerWidth,le=tt.outerHeight,_e=eT({data:t,xScale:r,xFormat:i,yScale:o,yFormat:s,width:at,height:G,colors:m,curve:d,areaBaselineValue:h,pointColor:W,pointBorderColor:ne,enableSlices:De}),Ke=_e.legendData,et=_e.toggleSerie,Ze=_e.lineGenerator,it=_e.areaGenerator,Re=_e.series,Pe=_e.xScale,ze=_e.yScale,ft=_e.slices,Nt=_e.points,Wt=kt(),St=lr(W,Wt),Cn=lr(ne,Wt),fn=$.useState(null),Ht=fn[0],An=fn[1],Rr=$.useState(null),ln=Rr[0],kn=Rr[1],pn={grid:k.jsx(yM,{theme:Wt,width:at,height:G,xScale:T?Pe:null,yScale:F?ze:null,xValues:I,yValues:P},"grid"),markers:k.jsx(yO,{markers:fe,width:at,height:G,xScale:Pe,yScale:ze,theme:Wt},"markers"),axes:k.jsx(bM,{xScale:Pe,yScale:ze,width:at,height:G,theme:Wt,top:x,right:C,bottom:w,left:E},"axes"),areas:null,lines:k.jsx(Ude,{lines:Re,lineGenerator:Ze,lineWidth:A},"lines"),slices:null,points:null,crosshair:null,mesh:null,legends:xe.map(function(hn,Un){return k.jsx(vf,Xn({},hn,{containerWidth:at,containerHeight:G,data:hn.data||Ke,theme:Wt,toggleSerie:hn.toggleSerie?et:void 0}),"legend."+Un)})},nr=u0(be,Re,ge);return N&&(pn.areas=k.jsx(Wde,{areaGenerator:it,areaOpacity:D,areaBlendMode:X,lines:Re},"areas")),Ne&&De!==!1&&(pn.slices=k.jsx(qde,{slices:ft,axis:De,debug:Qe,height:G,tooltip:rt,current:ln,setCurrent:kn,onMouseEnter:Xe,onMouseMove:je,onMouseLeave:Oe,onClick:nt,onTouchStart:We,onTouchMove:Be,onTouchEnd:Se},"slices")),Z&&(pn.points=k.jsx(Kde,{points:Nt,symbol:J,size:K,color:St,borderWidth:U,borderColor:Cn,enableLabel:re,label:ue,labelYOffset:me},"points")),Ne&&Te&&(Ht!==null&&(pn.crosshair=k.jsx(pg,{width:at,height:G,x:Ht.x,y:Ht.y,type:mt},"crosshair")),ln!==null&&(pn.crosshair=k.jsx(pg,{width:at,height:G,x:ln.x,y:ln.y,type:De},"crosshair"))),Ne&&Ie&&De===!1&&(pn.mesh=k.jsx(Yde,{points:Nt,width:at,height:G,margin:Ue,current:Ht,setCurrent:An,onMouseEnter:Xe,onMouseMove:je,onMouseLeave:Oe,onClick:nt,onTouchStart:We,onTouchMove:Be,onTouchEnd:Se,tooltip:ot,enableTouchCrosshair:he,debug:He},"mesh")),k.jsx(Zo,{defs:nr,width:oe,height:le,margin:Ue,role:ke,children:c.map(function(hn,Un){return typeof hn=="function"?k.jsx($.Fragment,{children:hn(Xn({},e,{innerWidth:at,innerHeight:G,series:Re,slices:ft,points:Nt,xScale:Pe,yScale:ze,lineGenerator:Ze,areaGenerator:it,currentPoint:Ht,setCurrentPoint:An,currentSlice:ln,setCurrentSlice:kn}))},Un):pn[hn]})})}),Zde=function(e){return k.jsx(Wi,{children:function(t){var n=t.width,r=t.height;return k.jsx(Xde,Xn({width:n,height:r},e))}})},Qde=xO(function(e){var t=$.useRef(null),n=e.width,r=e.height,i=e.margin,a=e.pixelRatio,o=a===void 0?typeof window<"u"&&window.devicePixelRatio||1:a,s=e.data,l=e.xScale,c=l===void 0?{type:"point"}:l,u=e.xFormat,d=e.yScale,f=d===void 0?{type:"linear",min:0,max:"auto"}:d,h=e.yFormat,p=e.curve,m=p===void 0?"linear":p,v=e.layers,b=v===void 0?["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"]:v,y=e.colors,x=y===void 0?{scheme:"nivo"}:y,C=e.lineWidth,S=C===void 0?2:C,w=e.enableArea,O=w!==void 0&&w,E=e.areaBaselineValue,_=E===void 0?0:E,T=e.areaOpacity,R=T===void 0?.2:T,F=e.enablePoints,I=F===void 0||F,P=e.pointSize,j=P===void 0?6:P,A=e.pointColor,M=A===void 0?{from:"color"}:A,N=e.pointBorderWidth,L=N===void 0?0:N,D=e.pointBorderColor,V=D===void 0?{theme:"background"}:D,X=e.enableGridX,q=X===void 0||X,Z=e.gridXValues,J=e.enableGridY,Q=J===void 0||J,K=e.gridYValues,Y=e.axisTop,W=e.axisRight,H=e.axisBottom,U=H===void 0?{}:H,z=e.axisLeft,ne=z===void 0?{}:z,B=e.legends,re=B===void 0?[]:B,ie=e.isInteractive,ue=ie===void 0||ie,me=e.debugMesh,ve=me!==void 0&&me,be=e.onMouseLeave,Ce=e.onClick,ge=e.tooltip,fe=ge===void 0?C0:ge,se=e.canvasRef,xe=Ra(n,r,i),ce=xe.margin,Ne=xe.innerWidth,Me=xe.innerHeight,Ie=xe.outerWidth,Le=xe.outerHeight,He=kt(),Xe=$.useState(null),je=Xe[0],Oe=Xe[1],nt=eT({data:s,xScale:c,xFormat:u,yScale:f,yFormat:h,width:Ne,height:Me,colors:x,curve:m,areaBaselineValue:_,pointColor:M,pointBorderColor:V}),We=nt.lineGenerator,Be=nt.areaGenerator,Se=nt.series,Fe=nt.xScale,ot=nt.yScale,ct=nt.points,De=b0({points:ct,width:Ne,height:Me,debug:ve}),qe=De.delaunay,Qe=De.voronoi;$.useEffect(function(){se&&(se.current=t.current),t.current.width=Ie*o,t.current.height=Le*o;var he=t.current.getContext("2d");he.scale(o,o),he.fillStyle=He.background,he.fillRect(0,0,Ie,Le),he.translate(ce.left,ce.top),b.forEach(function(we){if(typeof we=="function"&&we({ctx:he,innerWidth:Ne,innerHeight:Me,series:Se,points:ct,xScale:Fe,yScale:ot,lineWidth:S,lineGenerator:We,areaGenerator:Be,currentPoint:je,setCurrentPoint:Oe}),we==="grid"&&He.grid.line.strokeWidth>0&&(he.lineWidth=He.grid.line.strokeWidth,he.strokeStyle=He.grid.line.stroke,q&&Nu(he,{width:Ne,height:Me,scale:Fe,axis:"x",values:Z}),Q&&Nu(he,{width:Ne,height:Me,scale:ot,axis:"y",values:K})),we==="axes"&&xM(he,{xScale:Fe,yScale:ot,width:Ne,height:Me,top:Y,right:W,bottom:U,left:ne,theme:He}),we==="areas"&&O===!0){he.save(),he.globalAlpha=R,Be.context(he);for(var ke=Se.length-1;ke>=0;ke--)he.fillStyle=Se[ke].color,he.beginPath(),Be(Se[ke].data.map(function(Ue){return Ue.position})),he.fill();he.restore()}if(we==="lines"&&(We.context(he),Se.forEach(function(Ue){he.strokeStyle=Ue.color,he.lineWidth=S,he.beginPath(),We(Ue.data.map(function(at){return at.position})),he.stroke()})),we==="points"&&I===!0&&j>0&&ct.forEach(function(Ue){he.fillStyle=Ue.color,he.beginPath(),he.arc(Ue.x,Ue.y,j/2,0,2*Math.PI),he.fill(),L>0&&(he.strokeStyle=Ue.borderColor,he.lineWidth=L,he.stroke())}),we==="mesh"&&ve===!0&&(_M(he,Qe),je&&EM(he,Qe,je.index)),we==="legends"){var tt=Se.map(function(Ue){return{id:Ue.id,label:Ue.id,color:Ue.color}}).reverse();re.forEach(function(Ue){OO(he,Xn({},Ue,{data:Ue.data||tt,containerWidth:Ne,containerHeight:Me,theme:He}))})}})},[t,Ie,Le,b,He,We,Se,Fe,ot,q,Z,Q,K,Y,W,U,ne,re,ct,I,j,je]);var Je=$.useCallback(function(he){var we=c0(t.current,he),ke=we[0],tt=we[1];if(!SO(ce.left,ce.top,Ne,Me,ke,tt))return null;var Ue=qe.find(ke-ce.left,tt-ce.top);return ct[Ue]},[t,ce,Ne,Me,qe]),rt=Wr(),Ve=rt.showTooltipFromEvent,Te=rt.hideTooltip,st=$.useCallback(function(he){var we=Je(he);Oe(we),we?Ve($.createElement(fe,{point:we}),he):Te()},[Je,Oe,Ve,Te,fe]),mt=$.useCallback(function(he){Te(),Oe(null),je&&be&&be(je,he)},[Te,Oe,be]),Ee=$.useCallback(function(he){if(Ce){var we=Je(he);we&&Ce(we,he)}},[Je,Ce]);return k.jsx("canvas",{ref:t,width:Ie*o,height:Le*o,style:{width:Ie,height:Le,cursor:ue?"auto":"normal"},onMouseEnter:ue?st:void 0,onMouseMove:ue?st:void 0,onMouseLeave:ue?mt:void 0,onClick:ue?Ee:void 0})}),Jde=$.forwardRef(function(e,t){return k.jsx(Qde,Xn({},e,{canvasRef:t}))});$.forwardRef(function(e,t){return k.jsx(Wi,{children:function(n){var r=n.width,i=n.height;return k.jsx(Jde,Xn({width:r,height:i},e,{ref:t}))}})});const efe=({trendsData:e,height:t=null,margin:n={},colors:r=null,xLeg:i,yLeg:a,tooltip:o=null})=>k.jsxs(k.Fragment,{children:[k.jsx(On,{}),k.jsx("div",{style:{width:"100%",height:t||600},children:k.jsx(Zde,{data:e,margin:{top:50,right:90,bottom:50,left:90,...n},colors:r||{scheme:"nivo"},xScale:{type:"point"},yScale:{type:"linear",min:"auto",max:"auto",reverse:!1},axisTop:null,axisRight:null,axisBottom:{tickSize:5,tickPadding:5,tickRotation:0,legend:i,legendOffset:36,legendPosition:"middle"},axisLeft:{tickSize:5,tickPadding:5,tickRotation:0,legend:a,legendOffset:-70,legendPosition:"middle"},pointSize:10,pointColor:{theme:"background"},pointBorderWidth:2,pointBorderColor:{from:"serieColor"},pointLabelYOffset:-12,useMesh:!0,legends:[{anchor:"top-right",direction:"column",justify:!1,translateX:210,translateY:-40,itemsSpacing:0,itemDirection:"left-to-right",itemWidth:200,itemHeight:20,itemOpacity:.9,symbolSize:8,symbolShape:"circle",symbolBorderColor:"rgba(0, 0, 0, .5)",effects:[{on:"hover",style:{itemBackground:"rgba(0, 0, 0, .03)",itemOpacity:1}}]}],tooltip:s=>k.jsx(pi,{body:(o==null?void 0:o(s))||k.jsx("span",{children:"Line tooltip"})})})})]}),tfe=Mt.h3`
498
498
  color: var(--gf-color-button-primary);
499
- `,nfe=({selectors:e,setter:t})=>{const n=24/e.length;return k.jsxs(k.Fragment,{children:[k.jsx(On,{}),k.jsx(ko,{cardtype:"default",style:{width:"100%"},children:k.jsx(tl,{gutter:20,children:e.map(r=>k.jsxs(Ri,{span:n,children:[k.jsx(tfe,{children:r.title}),k.jsx(Ca,{defaultValue:r.defaultValue,style:{width:"100%"},onChange:i=>{t(r.key,i)},options:r.options})]}))})})]})},Wh=Mt.span`
499
+ `,nfe=({selectors:e,setter:t})=>{const n=24/e.length;return k.jsxs(k.Fragment,{children:[k.jsx(On,{}),k.jsx(ko,{cardtype:"default",style:{width:"100%"},children:k.jsx(tl,{gutter:20,children:e.map((r,i)=>k.jsxs(Ri,{span:n,children:[k.jsx(tfe,{children:r.title}),k.jsx(Ca,{defaultValue:r.defaultValue,style:{width:"100%"},onChange:a=>{t(r.key,a)},options:r.options})]},`col-${i}`))})})]})},Wh=Mt.span`
500
500
  font: var(--gf-label-md-default);
501
501
  color: var(--gf-color-text-secondary);
502
- `,ws={A:"#39b54a",B:"#8cc63f",C:"#d9e021",D:"#fcee21",E:"#fbb03b",F:"#f7931e",G:"#f15a24",H:"#cc3333",I:"#4d4d4d"},rfe={A:"Direct hoogwardig inzetten",B:"Indirect hoogwardig inzetten",C:"Voorbereiding voor recycling",D:"Microbiologische verwerking",E:"Grondreiniging",F:"Verbranding met opbrengst",G:"Verbranden",H:"Storten",I:"Opslag"},ife=({data:e,margin:t={},height:n=null,nodeTooltip:r=null,linkTooltip:i=null})=>{e.nodes=e.nodes.map(b=>({...b,nodeColor:ws[b.rank]})),e.links=e.links.map(b=>({...b,startColor:ws[b.target_rank],endColor:ws[b.target_rank]}));const h=b=>`${b.pct>1?b.pct.toFixed(0):b.pct>.1?b.pct.toFixed(1):"<0.1"}%`,p=({node:b})=>{const y=b.sourceLinks.length?-70:30,x=b.height/2-32/2;return k.jsx("g",{transform:`translate(${b.x0+y}, ${b.y0+x})`,children:k.jsx("foreignObject",{width:60,height:32,children:k.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",color:"black",textAlign:"center",padding:"2px",border:`2px solid ${b.color}`,whiteSpace:"nowrap"},children:[k.jsx(Wh,{children:k.jsx("b",{children:b.rank})}),k.jsx(Wh,{children:h(b)})]})})})},m=({nodes:b})=>b.map(y=>k.jsx(p,{node:y},y.id)),v=()=>k.jsx("div",{style:{marginTop:10,marginLeft:10,whiteSpace:"nowrap"},children:Object.keys(ws).map(b=>k.jsxs(Lo,{gap:8,align:"center",children:[k.jsx("div",{style:{backgroundColor:ws[b],minWidth:22,minHeight:22,border:"1px solid gray"}}),k.jsx(Wh,{children:`${b} ${rfe[b]}`})]}))});return k.jsxs(k.Fragment,{children:[k.jsx(On,{}),k.jsxs(tl,{style:{width:"100%"},children:[k.jsx(Ri,{span:8,children:k.jsx(v,{})}),k.jsx(Ri,{span:16,children:k.jsx("div",{style:{height:n||600,display:"flex",justifyContent:"space-between"},children:k.jsx(LO,{data:e,margin:{top:20,right:100,bottom:20,left:100,...t},sort:"input",labelPosition:"outside",colors:b=>b.nodeColor,enableLinkGradient:!0,linkOpacity:.5,nodeOpacity:1,nodeBorderWidth:0,nodeThickness:20,nodeSpacing:32,nodeTooltip:({node:b})=>k.jsx(pi,{body:(r==null?void 0:r({node:b}))||k.jsx("span",{children:"Node tooltip"})}),linkTooltip:({link:b})=>k.jsx(pi,{body:(i==null?void 0:i({link:b}))||k.jsx("span",{children:"Link tooltip"})}),layers:["links","nodes",m]})})})]})]})};exports.AddressLink=mL;exports.BenchmarkSankey=ife;exports.ButtonControls=Kj;exports.CustomToolTip=pi;exports.Description=xL;exports.DownloadButton=d$;exports.EmailLink=gL;exports.ExpandButton=f$;exports.GFButton=Hm;exports.GFCard=ko;exports.GFMetricsGrid=SL;exports.Link=rd;exports.LocationIcon=S$;exports.MailIcon=x$;exports.Metrics=b$;exports.NavCard=Qj;exports.PhoneIcon=y$;exports.PhoneLink=pL;exports.PieChart=Hie;exports.QuickNavCard=aL;exports.Sankey=lie;exports.ScatterPlot=Wle;exports.TabCard=oL;exports.Title=m$;exports.TreeMap=Ide;exports.Trends=efe;exports.VisSelectors=nfe;
502
+ `,ws={A:"#39b54a",B:"#8cc63f",C:"#d9e021",D:"#fcee21",E:"#fbb03b",F:"#f7931e",G:"#f15a24",H:"#cc3333",I:"#4d4d4d"},rfe={A:"Direct hoogwardig inzetten",B:"Indirect hoogwardig inzetten",C:"Voorbereiding voor recycling",D:"Microbiologische verwerking",E:"Grondreiniging",F:"Verbranding met opbrengst",G:"Verbranden",H:"Storten",I:"Opslag"},ife=({data:e,margin:t={},height:n=null,nodeTooltip:r=null,linkTooltip:i=null})=>{e.nodes=e.nodes.map(b=>({...b,nodeColor:ws[b.rank]})),e.links=e.links.map(b=>({...b,startColor:ws[b.target_rank],endColor:ws[b.target_rank]}));const h=b=>`${b.pct>1?b.pct.toFixed(0):b.pct>.1?b.pct.toFixed(1):"<0.1"}%`,p=({node:b})=>{const y=b.sourceLinks.length?-70:30,x=b.height/2-32/2;return k.jsx("g",{transform:`translate(${b.x0+y}, ${b.y0+x})`,children:k.jsx("foreignObject",{width:60,height:32,children:k.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",color:"black",textAlign:"center",padding:"2px",border:`2px solid ${b.color}`,whiteSpace:"nowrap"},children:[k.jsx(Wh,{children:k.jsx("b",{children:b.rank})}),k.jsx(Wh,{children:h(b)})]})})})},m=({nodes:b})=>b.map(y=>k.jsx(p,{node:y},y.id)),v=()=>k.jsx("div",{style:{marginTop:10,marginLeft:10,whiteSpace:"nowrap"},children:Object.keys(ws).map((b,y)=>k.jsxs(Lo,{gap:8,align:"center",children:[k.jsx("div",{style:{backgroundColor:ws[b],minWidth:22,minHeight:22,border:"1px solid gray"}}),k.jsx(Wh,{children:`${b} ${rfe[b]}`})]},`legend-${y}`))});return k.jsxs(k.Fragment,{children:[k.jsx(On,{}),k.jsxs(tl,{style:{width:"100%"},children:[k.jsx(Ri,{span:8,children:k.jsx(v,{})}),k.jsx(Ri,{span:16,children:k.jsx("div",{style:{height:n||600,display:"flex",justifyContent:"space-between"},children:k.jsx(LO,{data:e,margin:{top:20,right:100,bottom:20,left:100,...t},sort:"input",labelPosition:"outside",colors:b=>b.nodeColor,enableLinkGradient:!0,linkOpacity:.5,nodeOpacity:1,nodeBorderWidth:0,nodeThickness:20,nodeSpacing:32,nodeTooltip:({node:b})=>k.jsx(pi,{body:(r==null?void 0:r({node:b}))||k.jsx("span",{children:"Node tooltip"})}),linkTooltip:({link:b})=>k.jsx(pi,{body:(i==null?void 0:i({link:b}))||k.jsx("span",{children:"Link tooltip"})}),layers:["links","nodes",m]})})})]})]})};exports.AddressLink=mL;exports.BenchmarkSankey=ife;exports.ButtonControls=Kj;exports.CustomToolTip=pi;exports.Description=xL;exports.DownloadButton=d$;exports.EmailLink=gL;exports.ExpandButton=f$;exports.GFButton=Hm;exports.GFCard=ko;exports.GFMetricsGrid=SL;exports.Link=rd;exports.LocationIcon=S$;exports.MailIcon=x$;exports.Metrics=b$;exports.NavCard=Qj;exports.PhoneIcon=y$;exports.PhoneLink=pL;exports.PieChart=Hie;exports.QuickNavCard=aL;exports.Sankey=lie;exports.ScatterPlot=Wle;exports.TabCard=oL;exports.Title=m$;exports.TreeMap=Ide;exports.Trends=efe;exports.VisSelectors=nfe;
503
503
  //# sourceMappingURL=index.cjs.js.map