react-luminus-components 2.0.15 → 2.0.17

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.
Files changed (51) hide show
  1. package/dist/.vite/manifest.json +34 -34
  2. package/dist/{FormDisabledProvider-D-ONCDP4.cjs → FormDisabledProvider-Cr4O-dM-.cjs} +1 -1
  3. package/dist/{FormDisabledProvider-DULB742B.js → FormDisabledProvider-CuciVC1c.js} +1 -1
  4. package/dist/components/CronEditor/CronEditor.d.ts +12 -0
  5. package/dist/components/CronEditor/comps/MultiSelect/MultiSelect.d.ts +13 -0
  6. package/dist/components/CronEditor/comps/index.d.ts +1 -0
  7. package/dist/components/CronEditor/hooks/useCronEditorConsts.d.ts +14 -0
  8. package/dist/components/CronEditor/hooks/useCronEditorUtils.d.ts +5 -0
  9. package/dist/components/CronEditor/index.d.ts +1 -0
  10. package/dist/components/common/BatchSet/Create/BatchSetCreate.d.ts +6 -0
  11. package/dist/components/common/BatchSet/Detail/BatchSetDetail.d.ts +17 -0
  12. package/dist/components/common/BatchSet/Detail/comps/DataForm/BatchSetDataForm.d.ts +10 -0
  13. package/dist/components/common/BatchSet/Detail/comps/DataForm/hooks/useBatchSetFormSchema.d.ts +36 -0
  14. package/dist/components/common/BatchSet/Detail/comps/Tasks/BatchSetTasks.d.ts +14 -0
  15. package/dist/components/common/BatchSet/Detail/comps/Tasks/comps/index.d.ts +2 -0
  16. package/dist/components/common/BatchSet/Detail/comps/Tasks/comps/modals/BatchSetEditTasksModal.d.ts +13 -0
  17. package/dist/components/common/BatchSet/Detail/comps/Tasks/comps/modals/BatchSetTaskDetailModal.d.ts +11 -0
  18. package/dist/components/common/BatchSet/Detail/comps/Tasks/comps/modals/hooks/useBatchSetTaskFormSchema.d.ts +18 -0
  19. package/dist/components/common/BatchSet/Detail/comps/index.d.ts +2 -0
  20. package/dist/components/common/BatchSet/Overview/BatchSetOverview.d.ts +13 -0
  21. package/dist/components/common/BatchSet/Overview/comps/BatchSetTable/BatchSetTable.d.ts +13 -0
  22. package/dist/components/common/BatchSet/Overview/comps/BatchSetTable/hooks/useBatchSetTableColumns.d.ts +9 -0
  23. package/dist/components/common/BatchSet/Overview/comps/index.d.ts +1 -0
  24. package/dist/components/common/index.d.ts +3 -0
  25. package/dist/contexts.cjs.js +1 -1
  26. package/dist/contexts.es.js +13 -13
  27. package/dist/hooks.cjs.js +1 -1
  28. package/dist/hooks.es.js +10 -10
  29. package/dist/layout.cjs.js +1 -1
  30. package/dist/layout.es.js +38 -38
  31. package/dist/main.cjs.js +9 -9
  32. package/dist/main.d.ts +2 -0
  33. package/dist/main.es.js +7692 -6681
  34. package/dist/models/api/batchSet/BatchSetModel.d.ts +12 -0
  35. package/dist/models/api/batchSet/BatchSetNewModel.d.ts +7 -0
  36. package/dist/models/api/batchSet/BatchSetTaskModel.d.ts +12 -0
  37. package/dist/models/api/batchSet/BatchTaskModel.d.ts +6 -0
  38. package/dist/models/texts/BatchSetTexts.d.ts +25 -0
  39. package/dist/models/texts/ComponentsContextTexts.d.ts +4 -0
  40. package/dist/models/texts/CronTexts.d.ts +14 -0
  41. package/dist/{nivo-bar-zr2I3nTw.js → nivo-bar-CZxCjOf4.js} +47 -46
  42. package/dist/{nivo-bar-BIIySZxC.cjs → nivo-bar-C_X0vU1-.cjs} +1 -1
  43. package/dist/style.css +1 -1
  44. package/dist/{useIsFormDirty-Bi8OFCrS.cjs → useIsFormDirty-DVXHyw3w.cjs} +1 -1
  45. package/dist/{useIsFormDirty-Bj1bSMzm.js → useIsFormDirty-MJrbyifK.js} +1 -1
  46. package/dist/{useLocalStorageState-DKlcenZY.cjs → useLocalStorageState-Cb-47swy.cjs} +1 -1
  47. package/dist/{useLocalStorageState-DkfHepwT.js → useLocalStorageState-n3PiEif_.js} +1 -1
  48. package/dist/utils/constants/CommonLuminusIconsArray.d.ts +1 -1
  49. package/dist/utils.cjs.js +1 -1
  50. package/dist/utils.es.js +14 -14
  51. package/package.json +1 -1
@@ -282,4 +282,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
282
282
  L`+r+" "+r+`
283
283
  L0 `+r+`
284
284
  L`+r/2+` 0
285
- `,fill:i,opacity:o,strokeWidth:l,stroke:c===void 0?"transparent":c,style:{pointerEvents:"none"}})})};function Bi(){return Bi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bi.apply(null,arguments)}var lr={translateX:0,translateY:0,padding:0,itemsSpacing:0,itemDirection:"left-to-right",justify:!1,symbolShape:"square",symbolSize:16,symbolSpacing:8},tae={top:0,right:0,bottom:0,left:0},Hv=function(e){var t,n=e.direction,r=e.itemsSpacing,i=e.padding,a=e.itemCount,o=e.itemWidth,s=e.itemHeight;if(typeof i!="number"&&(typeof(t=i)!="object"||Array.isArray(t)||t===null))throw new Error("Invalid property padding, must be one of: number, object");var l=typeof i=="number"?{top:i,right:i,bottom:i,left:i}:Bi({},tae,i),c=l.left+l.right,u=l.top+l.bottom,d=o+c,f=s+u,h=(a-1)*r;return n==="row"?d=o*a+h+c:n==="column"&&(f=s*a+h+u),{width:d,height:f,padding:l}},d5=function(e){var t=e.anchor,n=e.translateX,r=e.translateY,i=e.containerWidth,a=e.containerHeight,o=e.width,s=e.height,l=n,c=r;switch(t){case"top":l+=(i-o)/2;break;case"top-right":l+=i-o;break;case"right":l+=i-o,c+=(a-s)/2;break;case"bottom-right":l+=i-o,c+=a-s;break;case"bottom":l+=(i-o)/2,c+=a-s;break;case"bottom-left":c+=a-s;break;case"left":c+=(a-s)/2;break;case"center":l+=(i-o)/2,c+=(a-s)/2}return{x:l,y:c}},f5=function(e){var t,n,r,i,a,o,s=e.direction,l=e.justify,c=e.symbolSize,u=e.symbolSpacing,d=e.width,f=e.height;switch(s){case"left-to-right":t=0,n=(f-c)/2,i=f/2,o="central",l?(r=d,a="end"):(r=c+u,a="start");break;case"right-to-left":t=d-c,n=(f-c)/2,i=f/2,o="central",l?(r=0,a="start"):(r=d-c-u,a="end");break;case"top-to-bottom":t=(d-c)/2,n=0,r=d/2,a="middle",l?(i=f,o="alphabetic"):(i=c+u,o="text-before-edge");break;case"bottom-to-top":t=(d-c)/2,n=f-c,r=d/2,a="middle",l?(i=0,o="text-before-edge"):(i=f-c-u,o="alphabetic")}return{symbolX:t,symbolY:n,labelX:r,labelY:i,labelAnchor:a,labelAlignment:o}},nae={circle:Kie,diamond:Jie,square:Qie,triangle:eae},rae=function(e){var t,n,r,i,a,o,s,l,c,u,d,f=e.x,h=e.y,p=e.width,m=e.height,g=e.data,x=e.direction,_=x===void 0?lr.itemDirection:x,w=e.justify,C=w===void 0?lr.justify:w,b=e.textColor,S=e.background,M=S===void 0?"transparent":S,$=e.opacity,k=$===void 0?1:$,R=e.symbolShape,T=R===void 0?lr.symbolShape:R,E=e.symbolSize,A=E===void 0?lr.symbolSize:E,j=e.symbolSpacing,I=j===void 0?lr.symbolSpacing:j,D=e.symbolBorderWidth,O=D===void 0?0:D,L=e.symbolBorderColor,B=L===void 0?"transparent":L,P=e.onClick,H=e.onMouseEnter,Y=e.onMouseLeave,q=e.toggleSerie,Z=e.effects,X=v.useState({}),J=X[0],ee=X[1],W=Lt(),F=v.useCallback(function(le){if(Z){var ye=Z.filter(function(ge){return ge.on==="hover"}).reduce(function(ge,be){return Bi({},ge,be.style)},{});ee(ye)}H==null||H(g,le)},[H,g,Z]),z=v.useCallback(function(le){if(Z){var ye=Z.filter(function(ge){return ge.on!=="hover"}).reduce(function(ge,be){return Bi({},ge,be.style)},{});ee(ye)}Y==null||Y(g,le)},[Y,g,Z]),V=f5({direction:_,justify:C,symbolSize:(t=J.symbolSize)!=null?t:A,symbolSpacing:I,width:p,height:m}),N=V.symbolX,te=V.symbolY,K=V.labelX,G=V.labelY,oe=V.labelAnchor,ne=V.labelAlignment,re=[P,H,Y,q].some(function(le){return le!==void 0}),ae=typeof T=="function"?T:nae[T];return y.jsxs("g",{transform:"translate("+f+","+h+")",style:{opacity:(n=J.itemOpacity)!=null?n:k},children:[y.jsx("rect",{width:p,height:m,fill:(r=J.itemBackground)!=null?r:M,style:{cursor:re?"pointer":"auto"},onClick:function(le){P==null||P(g,le),q==null||q(g.id)},onMouseEnter:F,onMouseLeave:z}),fe.createElement(ae,Bi({id:g.id,x:N,y:te,size:(i=J.symbolSize)!=null?i:A,fill:(a=(o=g.fill)!=null?o:g.color)!=null?a:"black",borderWidth:(s=J.symbolBorderWidth)!=null?s:O,borderColor:(l=J.symbolBorderColor)!=null?l:B},g.hidden?W.legends.hidden.symbol:void 0)),y.jsx(Os,{textAnchor:oe,style:Bi({},W.legends.text,{fill:(c=(u=(d=J.itemTextColor)!=null?d:b)!=null?u:W.legends.text.fill)!=null?c:"black",dominantBaseline:ne,pointerEvents:"none",userSelect:"none"},g.hidden?W.legends.hidden.text:void 0),x:K,y:G,children:g.label})]})},iae=function(e){var t=e.data,n=e.x,r=e.y,i=e.direction,a=e.padding,o=a===void 0?lr.padding:a,s=e.justify,l=e.effects,c=e.itemWidth,u=e.itemHeight,d=e.itemDirection,f=d===void 0?lr.itemDirection:d,h=e.itemsSpacing,p=h===void 0?lr.itemsSpacing:h,m=e.itemTextColor,g=e.itemBackground,x=g===void 0?"transparent":g,_=e.itemOpacity,w=_===void 0?1:_,C=e.symbolShape,b=e.symbolSize,S=e.symbolSpacing,M=e.symbolBorderWidth,$=e.symbolBorderColor,k=e.onClick,R=e.onMouseEnter,T=e.onMouseLeave,E=e.toggleSerie,A=Hv({itemCount:t.length,itemWidth:c,itemHeight:u,itemsSpacing:p,direction:i,padding:o}).padding,j=i==="row"?c+p:0,I=i==="column"?u+p:0;return y.jsx("g",{transform:"translate("+n+","+r+")",children:t.map(function(D,O){return y.jsx(rae,{data:D,x:O*j+A.left,y:O*I+A.top,width:c,height:u,direction:f,justify:s,effects:l,textColor:m,background:x,opacity:w,symbolShape:C,symbolSize:b,symbolSpacing:S,symbolBorderWidth:M,symbolBorderColor:$,onClick:k,onMouseEnter:R,onMouseLeave:T,toggleSerie:E},O)})})},Vv=function(e){var t=e.data,n=e.containerWidth,r=e.containerHeight,i=e.translateX,a=i===void 0?lr.translateX:i,o=e.translateY,s=o===void 0?lr.translateY:o,l=e.anchor,c=e.direction,u=e.padding,d=u===void 0?lr.padding:u,f=e.justify,h=e.itemsSpacing,p=h===void 0?lr.itemsSpacing:h,m=e.itemWidth,g=e.itemHeight,x=e.itemDirection,_=e.itemTextColor,w=e.itemBackground,C=e.itemOpacity,b=e.symbolShape,S=e.symbolSize,M=e.symbolSpacing,$=e.symbolBorderWidth,k=e.symbolBorderColor,R=e.onClick,T=e.onMouseEnter,E=e.onMouseLeave,A=e.toggleSerie,j=e.effects,I=Hv({itemCount:t.length,itemsSpacing:p,itemWidth:m,itemHeight:g,direction:c,padding:d}),D=I.width,O=I.height,L=d5({anchor:l,translateX:a,translateY:s,containerWidth:n,containerHeight:r,width:D,height:O}),B=L.x,P=L.y;return y.jsx(iae,{data:t,x:B,y:P,direction:c,padding:d,justify:f,effects:j,itemsSpacing:p,itemWidth:m,itemHeight:g,itemDirection:x,itemTextColor:_,itemBackground:w,itemOpacity:C,symbolShape:b,symbolSize:S,symbolSpacing:M,symbolBorderWidth:$,symbolBorderColor:k,onClick:R,onMouseEnter:T,onMouseLeave:E,toggleSerie:typeof A=="boolean"?void 0:A})},aae={start:"left",middle:"center",end:"right"},qv=function(e,t){var n=t.data,r=t.containerWidth,i=t.containerHeight,a=t.translateX,o=a===void 0?0:a,s=t.translateY,l=s===void 0?0:s,c=t.anchor,u=t.direction,d=t.padding,f=d===void 0?0:d,h=t.justify,p=h!==void 0&&h,m=t.itemsSpacing,g=m===void 0?0:m,x=t.itemWidth,_=t.itemHeight,w=t.itemDirection,C=w===void 0?"left-to-right":w,b=t.itemTextColor,S=t.symbolSize,M=S===void 0?16:S,$=t.symbolSpacing,k=$===void 0?8:$,R=t.theme,T=Hv({itemCount:n.length,itemWidth:x,itemHeight:_,itemsSpacing:g,direction:u,padding:f}),E=T.width,A=T.height,j=T.padding,I=d5({anchor:c,translateX:o,translateY:l,containerWidth:r,containerHeight:i,width:E,height:A}),D=I.x,O=I.y,L=u==="row"?x+g:0,B=u==="column"?_+g:0;e.save(),e.translate(D,O),Ya(e,R.legends.text),n.forEach(function(P,H){var Y,q=H*L+j.left,Z=H*B+j.top,X=f5({direction:C,justify:p,symbolSize:M,symbolSpacing:k,width:x,height:_}),J=X.symbolX,ee=X.symbolY,W=X.labelX,F=X.labelY,z=X.labelAnchor,V=X.labelAlignment;e.fillStyle=(Y=P.color)!=null?Y:"black",e.fillRect(q+J,Z+ee,M,M),e.textAlign=aae[z],V==="central"&&(e.textBaseline="middle"),Ga(e,Bi({},R.legends.text,{fill:b??R.legends.text.fill}),String(P.label),q+W,Z+F)}),e.restore()};function mr(){return mr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mr.apply(null,arguments)}function Ic(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var gx,oae=function(e){var t=e.width,n=e.height,r=e.legends,i=e.data,a=e.toggleSerie;return y.jsx(y.Fragment,{children:r.map(function(o,s){var l;return y.jsx(Vv,mr({},o,{containerWidth:t,containerHeight:n,data:(l=o.data)!=null?l:i,toggleSerie:o.toggleSerie?a:void 0}),s)})})},me={id:"id",value:"value",sortByValue:!1,innerRadius:0,padAngle:0,cornerRadius:0,layers:["arcs","arcLinkLabels","arcLabels","legends"],startAngle:0,endAngle:360,fit:!0,activeInnerRadiusOffset:0,activeOuterRadiusOffset:0,borderWidth:0,borderColor:{from:"color",modifiers:[["darker",1]]},enableArcLabels:!0,arcLabel:"formattedValue",arcLabelsSkipAngle:0,arcLabelsSkipRadius:0,arcLabelsRadiusOffset:.5,arcLabelsTextColor:{theme:"labels.text.fill"},enableArcLinkLabels:!0,arcLinkLabel:"id",arcLinkLabelsSkipAngle:0,arcLinkLabelsOffset:0,arcLinkLabelsDiagonalLength:16,arcLinkLabelsStraightLength:24,arcLinkLabelsThickness:1,arcLinkLabelsTextOffset:6,arcLinkLabelsTextColor:{theme:"labels.text.fill"},arcLinkLabelsColor:{theme:"axis.ticks.line.stroke"},colors:{scheme:"nivo"},defs:[],fill:[],isInteractive:!0,animate:!0,motionConfig:"gentle",transitionMode:"innerRadius",tooltip:function(e){var t=e.datum;return y.jsx(nv,{id:t.id,value:t.formattedValue,enableChip:!0,color:t.color})},legends:[],role:"img",pixelRatio:typeof window<"u"&&(gx=window.devicePixelRatio)!=null?gx:1},sae=["points"],h5=function(e){var t=e.data,n=e.id,r=n===void 0?me.id:n,i=e.value,a=i===void 0?me.value:i,o=e.valueFormat,s=e.colors,l=s===void 0?me.colors:s,c=pi(r),u=pi(a),d=os(o),f=Wv(l,"id");return v.useMemo(function(){return t.map(function(h){var p,m=c(h),g=u(h),x={id:m,label:(p=h.label)!=null?p:m,hidden:!1,value:g,formattedValue:d(g),data:h};return mr({},x,{color:f(x)})})},[t,c,u,d,f])},lae=function(e){var t=e.data,n=e.startAngle,r=e.endAngle,i=e.innerRadius,a=e.outerRadius,o=e.padAngle,s=e.sortByValue,l=e.activeId,c=e.activeInnerRadiusOffset,u=e.activeOuterRadiusOffset,d=e.hiddenIds,f=e.forwardLegendData,h=v.useMemo(function(){var x=FK().value(function(_){return _.value}).startAngle(dr(n)).endAngle(dr(r)).padAngle(dr(o));return s||x.sortValues(null),x},[n,r,o,s]),p=v.useMemo(function(){var x=t.filter(function(_){return!d.includes(_.id)});return{dataWithArc:h(x).map(function(_){var w=Math.abs(_.endAngle-_.startAngle);return mr({},_.data,{arc:{index:_.index,startAngle:_.startAngle,endAngle:_.endAngle,innerRadius:l===_.data.id?i-c:i,outerRadius:l===_.data.id?a+u:a,thickness:a-i,padAngle:_.padAngle,angle:w,angleDeg:jc(w)}})}),legendData:t.map(function(_){return{id:_.id,label:_.label,color:_.color,hidden:d.includes(_.id),data:_}})}},[h,t,d,l,i,c,a,u]),m=p.legendData,g=v.useRef(f);return v.useEffect(function(){typeof g.current=="function"&&g.current(m)},[g,m]),p},cae=function(e){var t=e.activeId,n=e.onActiveIdChange,r=e.defaultActiveId,i=t!==void 0,a=v.useState(i||r===void 0?null:r),o=a[0],s=a[1];return{activeId:i?t:o,setActiveId:v.useCallback(function(l){n&&n(l),i||s(l)},[i,n,s])}},p5=function(e){var t=e.data,n=e.width,r=e.height,i=e.innerRadius,a=i===void 0?me.innerRadius:i,o=e.startAngle,s=o===void 0?me.startAngle:o,l=e.endAngle,c=l===void 0?me.endAngle:l,u=e.padAngle,d=u===void 0?me.padAngle:u,f=e.sortByValue,h=f===void 0?me.sortByValue:f,p=e.cornerRadius,m=p===void 0?me.cornerRadius:p,g=e.fit,x=g===void 0?me.fit:g,_=e.activeInnerRadiusOffset,w=_===void 0?me.activeInnerRadiusOffset:_,C=e.activeOuterRadiusOffset,b=C===void 0?me.activeOuterRadiusOffset:C,S=e.activeId,M=e.onActiveIdChange,$=e.defaultActiveId,k=e.forwardLegendData,R=cae({activeId:S,onActiveIdChange:M,defaultActiveId:$}),T=R.activeId,E=R.setActiveId,A=v.useState([]),j=A[0],I=A[1],D=v.useMemo(function(){var B,P=Math.min(n,r)/2,H=P*Math.min(a,1),Y=n/2,q=r/2;if(x){var Z=Yie(Y,q,P,s-90,c-90),X=Z.points,J=Ic(Z,sae),ee=Math.min(n/J.width,r/J.height),W={width:J.width*ee,height:J.height*ee};W.x=(n-W.width)/2,W.y=(r-W.height)/2,Y=(Y-J.x)/J.width*J.width*ee+W.x,q=(q-J.y)/J.height*J.height*ee+W.y,B={box:J,ratio:ee,points:X},P*=ee,H*=ee}return{centerX:Y,centerY:q,radius:P,innerRadius:H,debug:B}},[n,r,a,s,c,x]),O=lae({data:t,startAngle:s,endAngle:c,innerRadius:D.innerRadius,outerRadius:D.radius,padAngle:d,sortByValue:h,activeId:T,activeInnerRadiusOffset:w,activeOuterRadiusOffset:b,hiddenIds:j,forwardLegendData:k}),L=v.useCallback(function(B){I(function(P){return P.indexOf(B)>-1?P.filter(function(H){return H!==B}):[].concat(P,[B])})},[]);return mr({arcGenerator:Xie({cornerRadius:m,padAngle:dr(d)}),activeId:T,setActiveId:E,toggleSerie:L},O,D)},uae=function(e){var t=e.dataWithArc,n=e.arcGenerator,r=e.centerX,i=e.centerY,a=e.radius,o=e.innerRadius;return v.useMemo(function(){return{dataWithArc:t,arcGenerator:n,centerX:r,centerY:i,radius:a,innerRadius:o}},[t,n,r,i,a,o])},dae=function(e){var t=e.center,n=e.data,r=e.arcGenerator,i=e.borderWidth,a=e.borderColor,o=e.isInteractive,s=e.onClick,l=e.onMouseEnter,c=e.onMouseMove,u=e.onMouseLeave,d=e.setActiveId,f=e.tooltip,h=e.transitionMode,p=Ti(),m=p.showTooltipFromEvent,g=p.hideTooltip,x=v.useMemo(function(){if(o)return function(b,S){s==null||s(b,S)}},[o,s]),_=v.useMemo(function(){if(o)return function(b,S){m(v.createElement(f,{datum:b}),S),d(b.id),l==null||l(b,S)}},[o,m,d,l,f]),w=v.useMemo(function(){if(o)return function(b,S){m(v.createElement(f,{datum:b}),S),c==null||c(b,S)}},[o,m,c,f]),C=v.useMemo(function(){if(o)return function(b,S){g(),d(null),u==null||u(b,S)}},[o,g,d,u]);return y.jsx(qie,{center:t,data:n,arcGenerator:r,borderWidth:i,borderColor:a,transitionMode:h,onClick:x,onMouseEnter:_,onMouseMove:w,onMouseLeave:C})},fae=["isInteractive","animate","motionConfig","theme","renderWrapper"],hae=function(e){var t=e.data,n=e.id,r=n===void 0?me.id:n,i=e.value,a=i===void 0?me.value:i,o=e.valueFormat,s=e.sortByValue,l=s===void 0?me.sortByValue:s,c=e.layers,u=c===void 0?me.layers:c,d=e.startAngle,f=d===void 0?me.startAngle:d,h=e.endAngle,p=h===void 0?me.endAngle:h,m=e.padAngle,g=m===void 0?me.padAngle:m,x=e.fit,_=x===void 0?me.fit:x,w=e.innerRadius,C=w===void 0?me.innerRadius:w,b=e.cornerRadius,S=b===void 0?me.cornerRadius:b,M=e.activeInnerRadiusOffset,$=M===void 0?me.activeInnerRadiusOffset:M,k=e.activeOuterRadiusOffset,R=k===void 0?me.activeOuterRadiusOffset:k,T=e.width,E=e.height,A=e.margin,j=e.colors,I=j===void 0?me.colors:j,D=e.borderWidth,O=D===void 0?me.borderWidth:D,L=e.borderColor,B=L===void 0?me.borderColor:L,P=e.enableArcLabels,H=P===void 0?me.enableArcLabels:P,Y=e.arcLabel,q=Y===void 0?me.arcLabel:Y,Z=e.arcLabelsSkipAngle,X=Z===void 0?me.arcLabelsSkipAngle:Z,J=e.arcLabelsSkipRadius,ee=J===void 0?me.arcLabelsSkipRadius:J,W=e.arcLabelsTextColor,F=W===void 0?me.arcLabelsTextColor:W,z=e.arcLabelsRadiusOffset,V=z===void 0?me.arcLabelsRadiusOffset:z,N=e.arcLabelsComponent,te=e.enableArcLinkLabels,K=te===void 0?me.enableArcLinkLabels:te,G=e.arcLinkLabel,oe=G===void 0?me.arcLinkLabel:G,ne=e.arcLinkLabelsSkipAngle,re=ne===void 0?me.arcLinkLabelsSkipAngle:ne,ae=e.arcLinkLabelsOffset,le=ae===void 0?me.arcLinkLabelsOffset:ae,ye=e.arcLinkLabelsDiagonalLength,ge=ye===void 0?me.arcLinkLabelsDiagonalLength:ye,be=e.arcLinkLabelsStraightLength,Me=be===void 0?me.arcLinkLabelsStraightLength:be,ce=e.arcLinkLabelsThickness,de=ce===void 0?me.arcLinkLabelsThickness:ce,Ce=e.arcLinkLabelsTextOffset,Ge=Ce===void 0?me.arcLinkLabelsTextOffset:Ce,we=e.arcLinkLabelsTextColor,ve=we===void 0?me.arcLinkLabelsTextColor:we,Pe=e.arcLinkLabelsColor,Ze=Pe===void 0?me.arcLinkLabelsColor:Pe,_t=e.arcLinkLabelComponent,Te=e.defs,Re=Te===void 0?me.defs:Te,at=e.fill,Ue=at===void 0?me.fill:at,mt=e.isInteractive,ut=mt===void 0?me.isInteractive:mt,At=e.onClick,Ke=e.onMouseEnter,Le=e.onMouseMove,Ve=e.onMouseLeave,et=e.tooltip,Fe=et===void 0?me.tooltip:et,tt=e.activeId,vt=e.onActiveIdChange,ot=e.defaultActiveId,Ne=e.transitionMode,Ee=Ne===void 0?me.transitionMode:Ne,Ye=e.legends,xt=Ye===void 0?me.legends:Ye,nt=e.forwardLegendData,bt=e.role,Jt=bt===void 0?me.role:bt,Ft=e.forwardedRef,Bt=oo(T,E,A),fn=Bt.outerWidth,qt=Bt.outerHeight,$e=Bt.margin,Je=Bt.innerWidth,St=Bt.innerHeight,an=h5({data:t,id:r,value:a,valueFormat:o,colors:I}),Yt=p5({data:an,width:Je,height:St,fit:_,innerRadius:C,startAngle:f,endAngle:p,padAngle:g,sortByValue:l,cornerRadius:S,activeInnerRadiusOffset:$,activeOuterRadiusOffset:R,activeId:tt,onActiveIdChange:vt,defaultActiveId:ot,forwardLegendData:nt}),ze=Yt.dataWithArc,Be=Yt.legendData,ht=Yt.arcGenerator,Rt=Yt.centerX,Tt=Yt.centerY,Qe=Yt.radius,$t=Yt.innerRadius,vr=Yt.setActiveId,ln=Yt.toggleSerie,cn=zv(Re,ze,Ue),An={arcs:null,arcLinkLabels:null,arcLabels:null,legends:null};u.includes("arcs")&&(An.arcs=y.jsx(dae,{center:[Rt,Tt],data:ze,arcGenerator:ht,borderWidth:O,borderColor:B,isInteractive:ut,onClick:At,onMouseEnter:Ke,onMouseMove:Le,onMouseLeave:Ve,setActiveId:vr,tooltip:Fe,transitionMode:Ee},"arcs")),K&&u.includes("arcLinkLabels")&&(An.arcLinkLabels=y.jsx(Fie,{center:[Rt,Tt],data:ze,label:oe,skipAngle:re,offset:le,diagonalLength:ge,straightLength:Me,strokeWidth:de,textOffset:Ge,textColor:ve,linkColor:Ze,component:_t},"arcLinkLabels")),H&&u.includes("arcLabels")&&(An.arcLabels=y.jsx(Eie,{center:[Rt,Tt],data:ze,label:q,radiusOffset:V,skipAngle:X,skipRadius:ee,textColor:F,transitionMode:Ee,component:N},"arcLabels")),xt.length>0&&u.includes("legends")&&(An.legends=y.jsx(oae,{width:Je,height:St,data:Be,legends:xt,toggleSerie:ln},"legends"));var ia=uae({dataWithArc:ze,arcGenerator:ht,centerX:Rt,centerY:Tt,radius:Qe,innerRadius:$t});return y.jsx(xh,{width:fn,height:qt,margin:$e,defs:cn,role:Jt,ref:Ft,children:u.map(function(Ct,aa){return An[Ct]!==void 0?An[Ct]:typeof Ct=="function"?y.jsx(v.Fragment,{children:v.createElement(Ct,ia)},aa):null})})},pae=v.forwardRef(function(e,t){var n=e.isInteractive,r=n===void 0?me.isInteractive:n,i=e.animate,a=i===void 0?me.animate:i,o=e.motionConfig,s=o===void 0?me.motionConfig:o,l=e.theme,c=e.renderWrapper,u=Ic(e,fae);return y.jsx(io,{animate:a,isInteractive:r,motionConfig:s,renderWrapper:c,theme:l,children:y.jsx(hae,mr({isInteractive:r},u,{forwardedRef:t}))})}),mae=["defaultWidth","defaultHeight","onResize","debounceResize"],gae=v.forwardRef(function(e,t){var n=e.defaultWidth,r=e.defaultHeight,i=e.onResize,a=e.debounceResize,o=Ic(e,mae);return y.jsx(ao,{defaultWidth:n,defaultHeight:r,onResize:i,debounceResize:a,children:function(s){var l=s.width,c=s.height;return y.jsx(pae,mr({width:l,height:c},o,{ref:t}))}})}),vae=["isInteractive","theme","renderWrapper"],bae=function(e){var t=e.data,n=e.id,r=n===void 0?me.id:n,i=e.value,a=i===void 0?me.value:i,o=e.valueFormat,s=e.sortByValue,l=s===void 0?me.sortByValue:s,c=e.startAngle,u=c===void 0?me.startAngle:c,d=e.endAngle,f=d===void 0?me.endAngle:d,h=e.padAngle,p=h===void 0?me.padAngle:h,m=e.fit,g=m===void 0?me.fit:m,x=e.innerRadius,_=x===void 0?me.innerRadius:x,w=e.cornerRadius,C=w===void 0?me.cornerRadius:w,b=e.activeInnerRadiusOffset,S=b===void 0?me.activeInnerRadiusOffset:b,M=e.activeOuterRadiusOffset,$=M===void 0?me.activeOuterRadiusOffset:M,k=e.width,R=e.height,T=e.margin,E=e.pixelRatio,A=E===void 0?me.pixelRatio:E,j=e.colors,I=j===void 0?me.colors:j,D=e.borderWidth,O=D===void 0?me.borderWidth:D,L=e.borderColor,B=L===void 0?me.borderColor:L,P=e.enableArcLabels,H=P===void 0?me.enableArcLabels:P,Y=e.arcLabel,q=Y===void 0?me.arcLabel:Y,Z=e.arcLabelsSkipAngle,X=Z===void 0?me.arcLabelsSkipAngle:Z,J=e.arcLabelsTextColor,ee=J===void 0?me.arcLabelsTextColor:J,W=e.arcLabelsRadiusOffset,F=W===void 0?me.arcLabelsRadiusOffset:W,z=e.enableArcLinkLabels,V=z===void 0?me.enableArcLinkLabels:z,N=e.arcLinkLabel,te=N===void 0?me.arcLinkLabel:N,K=e.arcLinkLabelsSkipAngle,G=K===void 0?me.arcLinkLabelsSkipAngle:K,oe=e.arcLinkLabelsOffset,ne=oe===void 0?me.arcLinkLabelsOffset:oe,re=e.arcLinkLabelsDiagonalLength,ae=re===void 0?me.arcLinkLabelsDiagonalLength:re,le=e.arcLinkLabelsStraightLength,ye=le===void 0?me.arcLinkLabelsStraightLength:le,ge=e.arcLinkLabelsThickness,be=ge===void 0?me.arcLinkLabelsThickness:ge,Me=e.arcLinkLabelsTextOffset,ce=Me===void 0?me.arcLinkLabelsTextOffset:Me,de=e.arcLinkLabelsTextColor,Ce=de===void 0?me.arcLinkLabelsTextColor:de,Ge=e.arcLinkLabelsColor,we=Ge===void 0?me.arcLinkLabelsColor:Ge,ve=e.isInteractive,Pe=ve===void 0?me.isInteractive:ve,Ze=e.onClick,_t=e.onMouseMove,Te=e.tooltip,Re=Te===void 0?me.tooltip:Te,at=e.activeId,Ue=e.onActiveIdChange,mt=e.defaultActiveId,ut=e.legends,At=ut===void 0?me.legends:ut,Ke=e.forwardLegendData,Le=e.role,Ve=e.forwardedRef,et=v.useRef(null),Fe=Lt(),tt=oo(k,R,T),vt=tt.margin,ot=tt.innerWidth,Ne=tt.innerHeight,Ee=tt.outerWidth,Ye=tt.outerHeight,xt=h5({data:t,id:r,value:a,valueFormat:o,colors:I}),nt=p5({data:xt,width:ot,height:Ne,fit:g,innerRadius:_,startAngle:u,endAngle:f,padAngle:p,sortByValue:l,cornerRadius:C,activeInnerRadiusOffset:S,activeOuterRadiusOffset:$,activeId:at,onActiveIdChange:Ue,defaultActiveId:mt,forwardLegendData:Ke}),bt=nt.dataWithArc,Jt=nt.arcGenerator,Ft=nt.centerX,Bt=nt.centerY,fn=nt.radius,qt=nt.innerRadius,$e=nt.setActiveId,Je=pr(B,Fe),St=Aie({data:bt,label:q,skipAngle:X,offset:F,textColor:ee}),an=Wie({data:bt,skipAngle:G,offset:ne,diagonalLength:ae,straightLength:ye,label:te,linkColor:we,textOffset:ce,textColor:Ce});v.useEffect(function(){if(et.current){et.current.width=Ee*A,et.current.height=Ye*A;var Qe=et.current.getContext("2d");Qe.scale(A,A),Qe.fillStyle=Fe.background,Qe.fillRect(0,0,Ee,Ye),Qe.save(),Qe.translate(vt.left,vt.top),Jt.context(Qe),Qe.save(),Qe.translate(Ft,Bt),bt.forEach(function($t){Qe.beginPath(),Qe.fillStyle=$t.color,Qe.strokeStyle=Je($t),Qe.lineWidth=O,Jt($t.arc),Qe.fill(),O>0&&Qe.stroke()}),V===!0&&zie(Qe,an,Fe,be),H===!0&&Oie(Qe,St,Fe),Qe.restore(),At.forEach(function($t){qv(Qe,mr({},$t,{data:bt,containerWidth:ot,containerHeight:Ne,theme:Fe}))})}},[et,ot,Ne,Ee,Ye,vt.top,vt.left,A,Ft,Bt,Jt,bt,O,Je,H,St,V,an,be,At,Fe]);var Yt=v.useMemo(function(){return bt.map(function(Qe){return mr({id:Qe.id},Qe.arc)})},[bt]),ze=function(Qe){if(!et.current)return null;var $t=zo(et.current,Qe),vr=$t[0],ln=$t[1],cn=Zie(vt.left+Ft,vt.top+Bt,fn,qt,Yt,vr,ln);return cn?bt.find(function(An){return An.id===cn.id}):null},Be=Ti(),ht=Be.showTooltipFromEvent,Rt=Be.hideTooltip,Tt=function(Qe){var $t=ze(Qe);$t?(_t==null||_t($t,Qe),$e($t.id),ht(v.createElement(Re,{datum:$t}),Qe)):($e(null),Rt())};return y.jsx("canvas",{ref:Bv(et,Ve),width:Ee*A,height:Ye*A,style:{width:Ee,height:Ye,cursor:Pe?"auto":"normal"},onMouseEnter:Pe?Tt:void 0,onMouseMove:Pe?Tt:void 0,onMouseLeave:Pe?function(){Rt()}:void 0,onClick:Pe?function(Qe){if(Ze){var $t=ze(Qe);$t&&Ze($t,Qe)}}:void 0,role:Le})},yae=v.forwardRef(function(e,t){var n=e.isInteractive,r=n===void 0?me.isInteractive:n,i=e.theme,a=e.renderWrapper,o=Ic(e,vae);return y.jsx(io,{isInteractive:r,renderWrapper:a,theme:i,children:y.jsx(bae,mr({isInteractive:r},o,{forwardedRef:t}))})}),xae=["defaultWidth","defaultHeight","onResize","debounceResize"];v.forwardRef(function(e,t){var n=e.defaultWidth,r=e.defaultHeight,i=e.onResize,a=e.debounceResize,o=Ic(e,xae);return y.jsx(ao,{defaultWidth:n,defaultHeight:r,onResize:i,debounceResize:a,children:function(s){var l=s.width,c=s.height;return y.jsx(yae,mr({width:l,height:c},o,{ref:t}))}})});function wae(){}var _ae=wae,jp=HS,Cae=_ae,Sae=Iv,Tae=1/0,$ae=jp&&1/Sae(new jp([,-0]))[1]==Tae?function(e){return new jp(e)}:Cae,kae=$ae,Mae=lv,Eae=N6,Oae=P6,Aae=cv,Rae=kae,Dae=Iv,jae=200;function Iae(e,t,n){var r=-1,i=Eae,a=e.length,o=!0,s=[],l=s;if(n)o=!1,i=Oae;else if(a>=jae){var c=t?null:Rae(e);if(c)return Dae(c);o=!1,i=Aae,l=new Mae}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 m5=Iae,Nae=m5;function Pae(e){return e&&e.length?Nae(e):[]}var Lae=Pae;const vx=nn(Lae);var Fae=kf,zae=Pv,Bae=1,Wae=2;function Uae(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 Fae;if(r)var f=r(c,u,l,e,t,d);if(!(f===void 0?zae(u,c,Bae|Wae,r,d):f))return!1}}return!0}var Hae=Uae,Vae=Kr;function qae(e){return e===e&&!Vae(e)}var g5=qae,Yae=g5,Gae=Dc;function Zae(e){for(var t=Gae(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Yae(i)]}return t}var Xae=Zae;function Kae(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var v5=Kae,Jae=Hae,Qae=Xae,eoe=v5;function toe(e){var t=Qae(e);return t.length==1&&t[0][2]?eoe(t[0][0],t[0][1]):function(n){return n===e||Jae(n,e,t)}}var noe=toe,roe=Pv,ioe=x6,aoe=IS,ooe=ev,soe=g5,loe=v5,coe=ks,uoe=1,doe=2;function foe(e,t){return ooe(e)&&soe(t)?loe(coe(e),t):function(n){var r=ioe(n,e);return r===void 0&&r===t?aoe(n,e):roe(t,r,uoe|doe)}}var hoe=foe;function poe(e){return function(t){return t==null?void 0:t[e]}}var moe=poe,goe=Ac;function voe(e){return function(t){return goe(t,e)}}var boe=voe,yoe=moe,xoe=boe,woe=ev,_oe=ks;function Coe(e){return woe(e)?yoe(_oe(e)):xoe(e)}var Soe=Coe,Toe=noe,$oe=hoe,koe=Rf,Moe=Kn,Eoe=Soe;function Ooe(e){return typeof e=="function"?e:e==null?koe:typeof e=="object"?Moe(e)?$oe(e[0],e[1]):Toe(e):Eoe(e)}var Yv=Ooe,Aoe=Yv,Roe=m5;function Doe(e,t){return e&&e.length?Roe(e,Aoe(t)):[]}var joe=Doe;const ag=nn(joe);var Ioe=e6,Noe=Dc;function Poe(e,t){return e&&Ioe(e,t,Noe)}var Loe=Poe,Foe=Cs;function zoe(e,t){return function(n,r){if(n==null)return n;if(!Foe(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 Boe=zoe,Woe=Loe,Uoe=Boe,Hoe=Uoe(Woe),b5=Hoe,Voe=b5,qoe=Cs;function Yoe(e,t){var n=-1,r=qoe(e)?Array(e.length):[];return Voe(e,function(i,a,o){r[++n]=t(i,a,o)}),r}var Goe=Yoe;function Zoe(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var Xoe=Zoe,bx=Df;function Koe(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=bx(e),o=t!==void 0,s=t===null,l=t===t,c=bx(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 Joe=Koe,Qoe=Joe;function ese(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var l=Qoe(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 tse=ese,Ip=jf,nse=Ac,rse=Yv,ise=Goe,ase=Xoe,ose=Ss,sse=tse,lse=Rf,cse=Kn;function use(e,t,n){t.length?t=Ip(t,function(a){return cse(a)?function(o){return nse(o,a.length===1?a[0]:a)}:a}):t=[lse];var r=-1;t=Ip(t,ose(rse));var i=ise(e,function(a,o,s){var l=Ip(t,function(c){return c(a)});return{criteria:l,index:++r,value:a}});return ase(i,function(a,o){return sse(a,o,n)})}var dse=use,fse=PS,hse=dse,pse=Q0,yx=m6,mse=pse(function(e,t){if(e==null)return[];var n=t.length;return n>1&&yx(e,t[0],t[1])?t=[]:n>2&&yx(t[0],t[1],t[2])&&(t=[t[0]]),hse(e,fse(t,1),[])}),gse=mse;const vse=nn(gse);var bse=Si,yse=gr,xse="[object Date]";function wse(e){return yse(e)&&bse(e)==xse}var _se=wse,Cse=_se,Sse=Ss,xx=Of,wx=xx&&xx.isDate,Tse=wx?Sse(wx):Cse,$se=Tse;const kse=nn($se);function wa(){return wa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wa.apply(null,arguments)}var xo=[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)}],Mse={millisecond:[],second:xo.slice(0,1),minute:xo.slice(0,2),hour:xo.slice(0,3),day:xo.slice(0,4),month:xo.slice(0,5),year:xo.slice(0,6)},Ese=function(e){return function(t){return Mse[e].forEach(function(n){n(t)}),t}},y5=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=Ese(i);return function(l){if(l===void 0)return l;if(n==="native"||l instanceof Date)return s(l);var c=o?RS(n):OS(n);return s(c(l))}},ma={min:0,max:"auto",stacked:!1,reverse:!1,clamp:!1,nice:!0,round:!1},Ose=function(e,t,n,r){var i,a,o,s,l=e.min,c=l===void 0?ma.min:l,u=e.max,d=u===void 0?ma.max:u,f=e.stacked,h=f===void 0?ma.stacked:f,p=e.reverse,m=p===void 0?ma.reverse:p,g=e.clamp,x=g===void 0?ma.clamp:g,_=e.nice,w=_===void 0?ma.nice:_,C=e.round,b=C===void 0?ma.round:C;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 S=vd().range(r==="x"?[0,n]:[n,0]).interpolate(b?j6:Jl).domain(m?[o,i]:[i,o]).clamp(x);return w===!0?S.nice():typeof w=="number"&&S.nice(w),Ase(S,h)},Ase=function(e,t){t===void 0&&(t=!1);var n=e;return n.type="linear",n.stacked=t,n},Rse=function(e,t,n){var r=yJ().range([0,n]).domain(t.all);return r.type="point",r},Dse={round:!1},jse=function(e,t,n,r){var i=e.round,a=i===void 0?Dse.round:i,o=bv().range(r==="x"?[0,n]:[n,0]).domain(t.all).round(a);return Ise(o)},Ise=function(e){var t=e;return t.type="band",t},wo={format:"native",precision:"millisecond",min:"auto",max:"auto",useUTC:!0,nice:!1},Nse=function(e,t,n){var r,i,a=e.format,o=a===void 0?wo.format:a,s=e.precision,l=s===void 0?wo.precision:s,c=e.min,u=c===void 0?wo.min:c,d=e.max,f=d===void 0?wo.max:d,h=e.useUTC,p=h===void 0?wo.useUTC:h,m=e.nice,g=m===void 0?wo.nice:m,x=y5({format:o,precision:l,useUTC:p});r=u==="auto"?x(t.min):o!=="native"?x(u):u,i=f==="auto"?x(t.max):o!=="native"?x(f):f;var _=p?uee():cee();_.range([0,n]),r&&i&&_.domain([r,i]),g===!0?_.nice():typeof g!="object"&&typeof g!="number"||_.nice(g);var w=_;return w.type="time",w.useUTC=p,w},_o={base:10,min:"auto",max:"auto",round:!1,reverse:!1,nice:!0},Pse=function(e,t,n,r){var i,a=e.base,o=a===void 0?_o.base:a,s=e.min,l=s===void 0?_o.min:s,c=e.max,u=c===void 0?_o.max:c,d=e.round,f=d===void 0?_o.round:d,h=e.reverse,p=h===void 0?_o.reverse:h,m=e.nice,g=m===void 0?_o.nice:m;if(t.all.some(function(M){return M===0}))throw new Error("a log scale domain must not include or cross zero");var x,_,w=!1;if(t.all.filter(function(M){return M!=null}).forEach(function(M){w||(i===void 0?i=Math.sign(M):Math.sign(M)!==i&&(w=!0))}),w)throw new Error("a log scale domain must be strictly-positive or strictly-negative");x=l==="auto"?t.min:l,_=u==="auto"?t.max:u;var C=aS().base(o),b=r==="x"?[0,n]:[n,0];f===!0?C.rangeRound(b):C.range(b),p===!0?C.domain([_,x]):C.domain([x,_]),g===!0?C.nice():typeof g=="number"&&C.nice(g);var S=C;return S.type="log",S},Co={constant:1,min:"auto",max:"auto",round:!1,reverse:!1,nice:!0},Lse=function(e,t,n,r){var i,a,o=e.constant,s=o===void 0?Co.constant:o,l=e.min,c=l===void 0?Co.min:l,u=e.max,d=u===void 0?Co.max:u,f=e.round,h=f===void 0?Co.round:f,p=e.reverse,m=p===void 0?Co.reverse:p,g=e.nice,x=g===void 0?Co.nice:g;i=c==="auto"?t.min:c,a=d==="auto"?t.max:d;var _=oS().constant(s),w=r==="x"?[0,n]:[n,0];h===!0?_.rangeRound(w):_.range(w),m===!0?_.domain([a,i]):_.domain([i,a]),x===!0?_.nice():typeof x=="number"&&_.nice(x);var C=_;return C.type="symlog",C},Fse=function(e){return e==="x"?"y":"x"},zse=function(e,t){return e===t},Bse=function(e,t){return e.getTime()===t.getTime()};function ic(e,t,n,r){switch(e.type){case"linear":return Ose(e,t,n,r);case"point":return Rse(0,t,n);case"band":return jse(e,t,n,r);case"time":return Nse(e,t,n);case"log":return Pse(e,t,n,r);case"symlog":return Lse(e,t,n,r);default:throw new Error("invalid scale spec")}}var _x=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},Wse=function(e,t,n,r,i){var a=e.map(function(u){return function(d){return wa({},d,{data:d.data.map(function(f){return{data:wa({},f)}})})}(u)}),o=Use(a,t,n);"stacked"in t&&t.stacked===!0&&Hse(o,a),"stacked"in n&&n.stacked===!0&&Vse(o,a);var s=ic(t,o.x,r,"x"),l=ic(n,o.y,i,"y"),c=a.map(function(u){return wa({},u,{data:u.data.map(function(d){return wa({},d,{position:{x:_x(d,"x",s),y:_x(d,"y",l)}})})})});return wa({},o,{series:c,xScale:s,yScale:l})},Use=function(e,t,n){return{x:Cx(e,"x",t),y:Cx(e,"y",n)}},Cx=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 g=o(m);g&&l(m,parseFloat(String(g)))})});else if(n.type==="time"&&n.format!=="native"){var c=y5(n);e.forEach(function(p){p.data.forEach(function(m){var g=o(m);g&&l(m,c(g))})})}var u=[];switch(e.forEach(function(p){p.data.forEach(function(m){u.push(o(m))})}),n.type){case"linear":var d=vse(vx(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=ag(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:De(f)};default:var h=vx(u);return{all:h,min:h[0],max:De(h)}}},x5=function(e,t,n){var r=Fse(e),i=[];t[r].all.forEach(function(a){var o=kse(a)?Bse:zse,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=De(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)},Hse=function(e,t){return x5("x",e,t)},Vse=function(e,t){return x5("y",e,t)},w5=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}},_5={millisecond:[tc,tc],second:[Jm,Jm],minute:[fS,yS],hour:[hS,xS],day:[dn(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)}),dn(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:[wd,_d],sunday:[wd,_d],monday:[nc,rc],tuesday:[pS,wS],wednesday:[mS,_S],thursday:[Va,qa],friday:[gS,CS],saturday:[vS,SS],month:[bS,TS],year:[Qi,ea]},qse=Object.keys(_5),Yse=new RegExp("^every\\s*(\\d+)?\\s*("+qse.join("|")+")s?$","i"),C5=function(e,t){if(Array.isArray(t))return t;if(typeof t=="string"&&"useUTC"in e){var n=t.match(Yse);if(n){var r=n[1],i=n[2],a=_5[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 kr(){return kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kr.apply(null,arguments)}var S5=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=C5(r,a),h=XS[d],p="bandwidth"in r?w5(r):r,m={lineX:0,lineY:0},g={textX:0,textY:0},x=typeof document=="object"&&document.dir==="rtl",_=h.align.center,w=h.baseline.center;return n==="x"?(t=function(C){var b;return{x:(b=p(C))!=null?b:0,y:0}},m.lineY=o*(i==="after"?1:-1),g.textY=(o+s)*(i==="after"?1:-1),w=i==="after"?h.baseline.top:h.baseline.bottom,l===0?_=h.align.center:i==="after"&&l<0||i==="before"&&l>0?(_=h.align[x?"left":"right"],w=h.baseline.center):(i==="after"&&l>0||i==="before"&&l<0)&&(_=h.align[x?"right":"left"],w=h.baseline.center)):(t=function(C){var b;return{x:0,y:(b=p(C))!=null?b:0}},m.lineX=o*(i==="after"?1:-1),g.textX=(o+s)*(i==="after"?1:-1),_=i==="after"?h.align.left:h.align.right),{ticks:f.map(function(C){var b=typeof C=="string"?function(S){var M=String(S).length;return c&&c>0&&M>c?""+String(S).slice(0,c).concat("..."):""+S}(C):C;return kr({key:C instanceof Date?""+C.valueOf():""+C,value:b},t(C),m,g)}),textAlign:_,textBaseline:w}},T5=function(e,t){if(e===void 0||typeof e=="function")return e;if(t.type==="time"){var n=Hf(e);return function(r){return n(r instanceof Date?r:new Date(r))}}return Rc(e)},og=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)||C5(i,o)),l="bandwidth"in i?w5(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},Gse=v.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.theme,u=e.animatedProps,d=(t=r==null?void 0:r(n))!=null?t:n,f=v.useMemo(function(){var h={opacity:u.opacity};return o?{style:kr({},h,{cursor:"pointer"}),onClick:function(p){return o(p,d)}}:{style:h}},[u.opacity,o,d]);return y.jsxs(Ht.g,kr({transform:u.transform},f,{children:[y.jsx("line",{x1:0,x2:i,y1:0,y2:a,style:c.line}),y.jsx(Os,{dominantBaseline:s,textAnchor:l,transform:u.textTransform,style:c.text,children:""+d})]}))}),Wn={tickSize:5,tickPadding:5,tickRotation:0,legendPosition:"middle",legendOffset:0},Zse=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?Wn.tickSize:u,f=e.tickPadding,h=f===void 0?Wn.tickPadding:f,p=e.tickRotation,m=p===void 0?Wn.tickRotation:p,g=e.format,x=e.renderTick,_=x===void 0?Gse:x,w=e.truncateTickAt,C=e.legend,b=e.legendPosition,S=b===void 0?Wn.legendPosition:b,M=e.legendOffset,$=M===void 0?Wn.legendOffset:M,k=e.style,R=e.onClick,T=e.ariaHidden,E=Lt(),A=YZ(E.axis,k),j=v.useMemo(function(){return T5(g,n)},[g,n]),I=S5({axis:t,scale:n,ticksPosition:l,tickValues:c,tickSize:d,tickPadding:h,tickRotation:m,truncateTickAt:w}),D=I.ticks,O=I.textAlign,L=I.textBaseline,B=null;if(C!==void 0){var P,H=0,Y=0,q=0;t==="y"?(q=-90,H=$,S==="start"?(P="start",Y=s):S==="middle"?(P="middle",Y=s/2):S==="end"&&(P="end")):(Y=$,S==="start"?P="start":S==="middle"?(P="middle",H=s/2):S==="end"&&(P="end",H=s)),B=y.jsx(y.Fragment,{children:y.jsx(Os,{transform:"translate("+H+", "+Y+") rotate("+q+")",textAnchor:P,style:kr({},A.legend.text,{dominantBaseline:"central"}),children:C})})}var Z=Fn(),X=Z.animate,J=Z.config,ee=Zr({transform:"translate("+i+","+o+")",lineX2:t==="x"?s:0,lineY2:t==="x"?0:s,config:J,immediate:!X}),W=v.useCallback(function(V){return{opacity:1,transform:"translate("+V.x+","+V.y+")",textTransform:"translate("+V.textX+","+V.textY+") rotate("+m+")"}},[m]),F=v.useCallback(function(V){return{opacity:0,transform:"translate("+V.x+","+V.y+")",textTransform:"translate("+V.textX+","+V.textY+") rotate("+m+")"}},[m]),z=Ka(D,{keys:function(V){return V.key},initial:W,from:F,enter:W,update:W,leave:{opacity:0},config:J,immediate:!X});return y.jsxs(Ht.g,{transform:ee.transform,"aria-hidden":T,children:[z(function(V,N,te,K){return fe.createElement(_,kr({tickIndex:K,format:j,rotate:m,textBaseline:L,textAnchor:O,truncateTickAt:w,animatedProps:V,theme:A.ticks},N,R?{onClick:R}:{}))}),y.jsx(Ht.line,{style:A.domain.line,x1:0,x2:ee.lineX2,y1:0,y2:ee.lineY2}),B]})},Xse=v.memo(Zse),$5=["top","right","bottom","left"],k5=v.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 y.jsx(y.Fragment,{children:$5.map(function(o){var s=a[o];if(!s)return null;var l=o==="top"||o==="bottom";return y.jsx(Xse,kr({},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)})})}),Kse=v.memo(function(e){var t=e.animatedProps,n=Lt();return y.jsx(Ht.line,kr({},t,n.grid.line))}),Sx=v.memo(function(e){var t=e.lines,n=Fn(),r=n.animate,i=n.config,a=Ka(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 y.jsx("g",{children:a(function(o,s){return v.createElement(Kse,kr({},s,{key:s.key,animatedProps:o}))})})}),M5=v.memo(function(e){var t=e.width,n=e.height,r=e.xScale,i=e.yScale,a=e.xValues,o=e.yValues,s=v.useMemo(function(){return!!r&&og({width:t,height:n,scale:r,axis:"x",values:a})},[r,a,t,n]),l=v.useMemo(function(){return!!i&&og({width:t,height:n,scale:i,axis:"y",values:o})},[n,t,i,o]);return y.jsxs(y.Fragment,{children:[s&&y.jsx(Sx,{lines:s}),l&&y.jsx(Sx,{lines:l})]})}),Jse=function(e,t){var n,r,i=t.axis,a=t.scale,o=t.x,s=o===void 0?0:o,l=t.y,c=l===void 0?0:l,u=t.length,d=t.ticksPosition,f=t.tickValues,h=t.tickSize,p=h===void 0?Wn.tickSize:h,m=t.tickPadding,g=m===void 0?Wn.tickPadding:m,x=t.tickRotation,_=x===void 0?Wn.tickRotation:x,w=t.format,C=t.legend,b=t.legendPosition,S=b===void 0?Wn.legendPosition:b,M=t.legendOffset,$=M===void 0?Wn.legendOffset:M,k=t.theme,R=t.style,T=S5({axis:i,scale:a,ticksPosition:d,tickValues:f,tickSize:p,tickPadding:g,tickRotation:_,engine:"canvas"}),E=T.ticks,A=T.textAlign,j=T.textBaseline;e.save(),e.translate(s,c);var I=_6(k.axis,R);e.textAlign=A,e.textBaseline=j,Ya(e,I.ticks.text);var D=(n=I.domain.line.strokeWidth)!=null?n:0;typeof D!="string"&&D>0&&(e.lineWidth=D,e.lineCap="square",I.domain.line.stroke&&(e.strokeStyle=I.domain.line.stroke),e.beginPath(),e.moveTo(0,0),e.lineTo(i==="x"?u:0,i==="x"?0:u),e.stroke());var O=typeof w=="function"?w:function(Z){return""+Z},L=(r=I.ticks.line.strokeWidth)!=null?r:0,B=typeof L!="string"&&L>0;if(E.forEach(function(Z){B&&(e.lineWidth=L,e.lineCap="square",I.ticks.line.stroke&&(e.strokeStyle=I.ticks.line.stroke),e.beginPath(),e.moveTo(Z.x,Z.y),e.lineTo(Z.x+Z.lineX,Z.y+Z.lineY),e.stroke());var X=O(Z.value);e.save(),e.translate(Z.x+Z.textX,Z.y+Z.textY),e.rotate(dr(_)),Ga(e,I.ticks.text,""+X),e.fillText(""+X,0,0),e.restore()}),C!==void 0){var P=0,H=0,Y=0,q="center";i==="y"?(Y=-90,P=$,S==="start"?(q="start",H=u):S==="middle"?(q="center",H=u/2):S==="end"&&(q="end")):(H=$,S==="start"?q="start":S==="middle"?(q="center",P=u/2):S==="end"&&(q="end",P=u)),e.translate(P,H),e.rotate(dr(Y)),Ya(e,I.legend.text),I.legend.text.fill&&(e.fillStyle=I.legend.text.fill),e.textAlign=q,e.textBaseline="middle",Ga(e,I.legend.text,C)}e.restore()},E5=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};$5.forEach(function(f){var h=d[f];if(!h)return null;var p=f==="top"||f==="bottom",m=f==="top"||f==="left"?"before":"after",g=p?n:r,x=T5(h.format,g);Jse(e,kr({},h,{axis:p?"x":"y",x:f==="right"?i:0,y:f==="bottom"?a:0,scale:g,format:x,length:p?i:a,ticksPosition:m,theme:u}))})},Sd=function(e,t){var n=t.width,r=t.height,i=t.scale,a=t.axis,o=t.values;og({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()})},Qse=y6,ele=0;function tle(e){var t=++ele;return Qse(e)+t}var nle=tle;const rle=nn(nle),mi=11102230246251565e-32,Tn=134217729,ile=(3+8*mi)*mi;function Np(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 ale(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function Nc(e){return new Float64Array(e)}const ole=(3+16*mi)*mi,sle=(2+12*mi)*mi,lle=(9+64*mi)*mi*mi,So=Nc(4),Tx=Nc(8),$x=Nc(12),kx=Nc(16),Dn=Nc(4);function cle(e,t,n,r,i,a,o){let s,l,c,u,d,f,h,p,m,g,x,_,w,C,b,S,M,$;const k=e-i,R=n-i,T=t-a,E=r-a;C=k*E,f=Tn*k,h=f-(f-k),p=k-h,f=Tn*E,m=f-(f-E),g=E-m,b=p*g-(C-h*m-p*m-h*g),S=T*R,f=Tn*T,h=f-(f-T),p=T-h,f=Tn*R,m=f-(f-R),g=R-m,M=p*g-(S-h*m-p*m-h*g),x=b-M,d=b-x,So[0]=b-(x+d)+(d-M),_=C+x,d=_-C,w=C-(_-d)+(x-d),x=w-S,d=w-x,So[1]=w-(x+d)+(d-S),$=_+x,d=$-_,So[2]=_-($-d)+(x-d),So[3]=$;let A=ale(4,So),j=sle*o;if(A>=j||-A>=j||(d=e-k,s=e-(k+d)+(d-i),d=n-R,c=n-(R+d)+(d-i),d=t-T,l=t-(T+d)+(d-a),d=r-E,u=r-(E+d)+(d-a),s===0&&l===0&&c===0&&u===0)||(j=lle*o+ile*Math.abs(A),A+=k*u+E*s-(T*c+R*l),A>=j||-A>=j))return A;C=s*E,f=Tn*s,h=f-(f-s),p=s-h,f=Tn*E,m=f-(f-E),g=E-m,b=p*g-(C-h*m-p*m-h*g),S=l*R,f=Tn*l,h=f-(f-l),p=l-h,f=Tn*R,m=f-(f-R),g=R-m,M=p*g-(S-h*m-p*m-h*g),x=b-M,d=b-x,Dn[0]=b-(x+d)+(d-M),_=C+x,d=_-C,w=C-(_-d)+(x-d),x=w-S,d=w-x,Dn[1]=w-(x+d)+(d-S),$=_+x,d=$-_,Dn[2]=_-($-d)+(x-d),Dn[3]=$;const I=Np(4,So,4,Dn,Tx);C=k*u,f=Tn*k,h=f-(f-k),p=k-h,f=Tn*u,m=f-(f-u),g=u-m,b=p*g-(C-h*m-p*m-h*g),S=T*c,f=Tn*T,h=f-(f-T),p=T-h,f=Tn*c,m=f-(f-c),g=c-m,M=p*g-(S-h*m-p*m-h*g),x=b-M,d=b-x,Dn[0]=b-(x+d)+(d-M),_=C+x,d=_-C,w=C-(_-d)+(x-d),x=w-S,d=w-x,Dn[1]=w-(x+d)+(d-S),$=_+x,d=$-_,Dn[2]=_-($-d)+(x-d),Dn[3]=$;const D=Np(I,Tx,4,Dn,$x);C=s*u,f=Tn*s,h=f-(f-s),p=s-h,f=Tn*u,m=f-(f-u),g=u-m,b=p*g-(C-h*m-p*m-h*g),S=l*c,f=Tn*l,h=f-(f-l),p=l-h,f=Tn*c,m=f-(f-c),g=c-m,M=p*g-(S-h*m-p*m-h*g),x=b-M,d=b-x,Dn[0]=b-(x+d)+(d-M),_=C+x,d=_-C,w=C-(_-d)+(x-d),x=w-S,d=w-x,Dn[1]=w-(x+d)+(d-S),$=_+x,d=$-_,Dn[2]=_-($-d)+(x-d),Dn[3]=$;const O=Np(D,$x,4,Dn,kx);return kx[O-1]}function pu(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)>=ole*c?l:-cle(e,t,n,r,i,a,c)}const Mx=Math.pow(2,-52),mu=new Uint32Array(512);class Td{static from(t,n=ple,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 Td(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 k=0;k<o;k++){const R=t[2*k],T=t[2*k+1];R<s&&(s=R),T<l&&(l=T),R>c&&(c=R),T>u&&(u=T),this._ids[k]=k}const d=(s+c)/2,f=(l+u)/2;let h,p,m;for(let k=0,R=1/0;k<o;k++){const T=Pp(d,f,t[2*k],t[2*k+1]);T<R&&(h=k,R=T)}const g=t[2*h],x=t[2*h+1];for(let k=0,R=1/0;k<o;k++){if(k===h)continue;const T=Pp(g,x,t[2*k],t[2*k+1]);T<R&&T>0&&(p=k,R=T)}let _=t[2*p],w=t[2*p+1],C=1/0;for(let k=0;k<o;k++){if(k===h||k===p)continue;const R=fle(g,x,_,w,t[2*k],t[2*k+1]);R<C&&(m=k,C=R)}let b=t[2*m],S=t[2*m+1];if(C===1/0){for(let T=0;T<o;T++)this._dists[T]=t[2*T]-t[0]||t[2*T+1]-t[1];Ro(this._ids,this._dists,0,o-1);const k=new Uint32Array(o);let R=0;for(let T=0,E=-1/0;T<o;T++){const A=this._ids[T],j=this._dists[A];j>E&&(k[R++]=A,E=j)}this.hull=k.subarray(0,R),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(pu(g,x,_,w,b,S)<0){const k=p,R=_,T=w;p=m,_=b,w=S,m=k,b=R,S=T}const M=hle(g,x,_,w,b,S);this._cx=M.x,this._cy=M.y;for(let k=0;k<o;k++)this._dists[k]=Pp(t[2*k],t[2*k+1],M.x,M.y);Ro(this._ids,this._dists,0,o-1),this._hullStart=h;let $=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(g,x)]=h,a[this._hashKey(_,w)]=p,a[this._hashKey(b,S)]=m,this.trianglesLen=0,this._addTriangle(h,p,m,-1,-1,-1);for(let k=0,R,T;k<this._ids.length;k++){const E=this._ids[k],A=t[2*E],j=t[2*E+1];if(k>0&&Math.abs(A-R)<=Mx&&Math.abs(j-T)<=Mx||(R=A,T=j,E===h||E===p||E===m))continue;let I=0;for(let P=0,H=this._hashKey(A,j);P<this._hashSize&&(I=a[(H+P)%this._hashSize],!(I!==-1&&I!==r[I]));P++);I=n[I];let D=I,O;for(;O=r[D],pu(A,j,t[2*D],t[2*D+1],t[2*O],t[2*O+1])>=0;)if(D=O,D===I){D=-1;break}if(D===-1)continue;let L=this._addTriangle(D,E,r[D],-1,-1,i[D]);i[E]=this._legalize(L+2),i[D]=L,$++;let B=r[D];for(;O=r[B],pu(A,j,t[2*B],t[2*B+1],t[2*O],t[2*O+1])<0;)L=this._addTriangle(B,E,O,i[E],-1,i[B]),i[E]=this._legalize(L+2),r[B]=B,$--,B=O;if(D===I)for(;O=n[D],pu(A,j,t[2*O],t[2*O+1],t[2*D],t[2*D+1])<0;)L=this._addTriangle(O,E,D,-1,i[D],i[O]),this._legalize(L+2),i[O]=L,r[D]=D,$--,D=O;this._hullStart=n[E]=D,r[D]=n[B]=E,r[E]=B,a[this._hashKey(A,j)]=E,a[this._hashKey(t[2*D],t[2*D+1])]=D}this.hull=new Uint32Array($);for(let k=0,R=this._hullStart;k<$;k++)this.hull[k]=R,R=r[R];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(ule(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=mu[--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(dle(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 x=r[d];if(x===-1){let w=this._hullStart;do{if(this._hullTri[w]===d){this._hullTri[w]=t;break}w=this._hullPrev[w]}while(w!==this._hullStart)}this._link(t,x),this._link(s,r[o]),this._link(o,d);const _=c+(s+1)%3;a<mu.length&&(mu[a++]=_)}else{if(a===0)break;t=mu[--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 ule(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function Pp(e,t,n,r){const i=e-n,a=t-r;return i*i+a*a}function dle(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,g=f*f+h*h;return l*(d*g-m*h)-c*(u*g-m*f)+p*(u*h-d*f)<0}function fle(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 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=e+(c*u-s*d)*f,p=t+(o*d-l*u)*f;return{x:h,y:p}}function Ro(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;el(e,i,a),t[e[n]]>t[e[r]]&&el(e,n,r),t[e[a]]>t[e[r]]&&el(e,a,r),t[e[n]]>t[e[a]]&&el(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;el(e,a,o)}e[n+1]=e[o],e[o]=s,r-a+1>=o-n?(Ro(e,t,a,r),Ro(e,t,n,o-1)):(Ro(e,t,n,o-1),Ro(e,t,a,r))}}function el(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function ple(e){return e[0]}function mle(e){return e[1]}const Ex=1e-6;class Ma{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)>Ex||Math.abs(this._y1-a)>Ex)&&(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 sg{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 gle{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,g=0,x=r.length,_,w;m<x;m+=3,g+=2){const C=r[m]*2,b=r[m+1]*2,S=r[m+2]*2,M=t[C],$=t[C+1],k=t[b],R=t[b+1],T=t[S],E=t[S+1],A=k-M,j=R-$,I=T-M,D=E-$,O=(A*D-j*I)*2;if(Math.abs(O)<1e-9){if(a===void 0){a=o=0;for(const B of n)a+=t[B*2],o+=t[B*2+1];a/=n.length,o/=n.length}const L=1e9*Math.sign((a-M)*D-(o-$)*I);_=(M+T)/2-L*D,w=($+E)/2+L*I}else{const L=1/O,B=A*A+j*j,P=I*I+D*D;_=M+(D*B-j*P)*L,w=$+(A*P-I*B)*L}s[g]=_,s[g+1]=w}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 Ma: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],g=o[h+1],x=o[p],_=o[p+1];this._renderSegment(m,g,x,_,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 Ma: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 Ma: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 sg;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,g,x,_;if(c===0){if((p=this._clipSegment(a,o,s,l,c,u))===null)continue;[m,g,x,_]=p}else{if((p=this._clipSegment(s,l,a,o,u,c))===null)continue;[x,_,m,g]=p,d=f,f=this._edgecode(m,g),d&&f&&this._edge(t,d,f,i,i.length),i?i.push(m,g):i=[m,g]}d=f,f=this._edgecode(x,_),d&&f&&this._edge(t,d,f,i,i.length),i?i.push(x,_):i=[x,_]}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 vle=2*Math.PI,To=Math.pow;function ble(e){return e[0]}function yle(e){return e[1]}function xle(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 wle(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class wh{static from(t,n=ble,r=yle,i){return new wh("length"in t?_le(t,n,r,i):Float64Array.from(Cle(t,n,r,i)))}constructor(t){this._delaunator=new Td(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&&xle(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=wle(n[2*f],n[2*f+1],d);n[2*f]=p[0],n[2*f+1]=p[1]}this._delaunator=new Td(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 gle(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=To(n-c[t*2],2)+To(r-c[t*2+1],2);const f=i[t];let h=f;do{let p=l[h];const m=To(n-c[p*2],2)+To(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&&To(n-c[h*2],2)+To(r-c[h*2+1],2)<d)return h;break}}while(h!==f);return u}render(t){const n=t==null?t=new Ma: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 Ma: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,vle)}return r&&r.value()}renderHull(t){const n=t==null?t=new Ma: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 sg;return this.renderHull(t),t.value()}renderTriangle(t,n){const r=n==null?n=new Ma: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 sg;return this.renderTriangle(t,n),n.value()}}function _le(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*Cle(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}function $d(){return $d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$d.apply(null,arguments)}function O5(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Qn={xDomain:[0,1],yDomain:[0,1],layers:["links","cells","points","bounds"],enableLinks:!1,linkLineWidth:1,linkLineColor:"#bbbbbb",enableCells:!0,cellLineWidth:2,cellLineColor:"#000000",pointSize:4,pointColor:"#666666",role:"img"},Gv=function(e){return[e.x,e.y]},Pc=e5,A5="cursor",R5="top",Sle=function(e){var t=e.points,n=e.getNodePosition,r=n===void 0?Gv:n,i=e.margin,a=i===void 0?Pc:i;return t.map(function(o){var s=r(o),l=s[0],c=s[1];return[l+a.left,c+a.top]})},Tle=function(e){var t=e.points,n=e.width,r=e.height,i=e.margin,a=i===void 0?Pc:i,o=e.debug,s=wh.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}},D5=function(e){var t=e.points,n=e.getNodePosition,r=n===void 0?Gv:n,i=e.width,a=e.height,o=e.margin,s=o===void 0?Pc:o,l=e.debug;return v.useMemo(function(){return Tle({points:Sle({points:t,margin:s,getNodePosition:r}),width:i,height:a,margin:s,debug:l})},[r,t,i,a,s,l])},$le=function(e){var t=e.data,n=e.width,r=e.height,i=e.xDomain,a=e.yDomain,o=v.useMemo(function(){return vd().domain(i).range([0,n])},[i,n]),s=v.useMemo(function(){return vd().domain(a).range([0,r])},[a,r]),l=v.useMemo(function(){return t.map(function(c){return{x:o(c.x),y:s(c.y),data:c}})},[t,o,s]);return v.useMemo(function(){var c=wh.from(l.map(function(d){return[d.x,d.y]})),u=c.voronoi([0,0,n,r]);return{points:l,delaunay:c,voronoi:u}},[l,n,r])},kle=function(e){var t=e.points,n=e.delaunay,r=e.voronoi;return v.useMemo(function(){return{points:t,delaunay:n,voronoi:r}},[t,n,r])},Mle=function(e){var t=e.elementRef,n=e.nodes,r=e.getNodePosition,i=r===void 0?Gv:r,a=e.delaunay,o=e.setCurrent,s=e.margin,l=s===void 0?Pc: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,g=e.onMouseDown,x=e.onMouseUp,_=e.onClick,w=e.onDoubleClick,C=e.onTouchStart,b=e.onTouchMove,S=e.onTouchEnd,M=e.enableTouchCrosshair,$=M!==void 0&&M,k=e.tooltip,R=e.tooltipPosition,T=R===void 0?A5:R,E=e.tooltipAnchor,A=E===void 0?R5:E,j=v.useState(null),I=j[0],D=j[1],O=v.useRef(null);v.useEffect(function(){O.current=I},[O,I]);var L=v.useCallback(function(K){if(!t.current||n.length===0)return null;var G=zo(t.current,K),oe=G[0],ne=G[1],re=a.find(oe,ne),ae=re!==void 0?n[re]:null;if(ae&&u!==1/0){var le=i(ae),ye=le[0],ge=le[1];n5(oe,ne,ye+l.left,ge+l.top)>u&&(re=null,ae=null)}return re===null||ae===null?null:[re,ae]},[t,a,n,i,l,u]),B=Ti(),P=B.showTooltipAt,H=B.showTooltipFromEvent,Y=B.hideTooltip,q=v.useMemo(function(){if(k)return T==="cursor"?function(K,G){H(k(K),G,A)}:function(K){var G=i(K),oe=G[0],ne=G[1];P(k(K),[oe+l.left,ne+l.top],A)}},[P,H,k,T,A,i,l]),Z=v.useCallback(function(K){var G=L(K);if(D(G),o==null||o(G?G[1]:null),G){var oe=G[1];q==null||q(oe,K),h==null||h(G[1],K)}},[L,D,o,q,h]),X=v.useCallback(function(K){var G=L(K);if(D(G),G){var oe=G[0],ne=G[1];if(o==null||o(ne),q==null||q(ne,K),O.current){var re=O.current,ae=re[0],le=re[1];oe!==ae?m==null||m(le,K):p==null||p(ne,K)}else h==null||h(ne,K)}else o==null||o(null),Y==null||Y(),O.current&&(m==null||m(O.current[1],K))},[L,D,o,O,h,p,m,q,Y]),J=v.useCallback(function(K){D(null),o==null||o(null),Y(),m&&O.current&&m(O.current[1],K)},[D,o,O,Y,m]),ee=v.useCallback(function(K){var G=L(K);D(G),G&&(g==null||g(G[1],K))},[L,D,g]),W=v.useCallback(function(K){var G=L(K);D(G),G&&(x==null||x(G[1],K))},[L,D,x]),F=v.useCallback(function(K){var G=L(K);D(G),G&&(_==null||_(G[1],K))},[L,D,_]),z=v.useCallback(function(K){var G=L(K);D(G),G&&(w==null||w(G[1],K))},[L,D,w]),V=v.useCallback(function(K){var G=L(K);$&&(D(G),o==null||o(G?G[1]:null)),G&&(C==null||C(G[1],K))},[L,D,o,$,C]),N=v.useCallback(function(K){var G=L(K);$&&(D(G),o==null||o(G?G[1]:null)),G&&(b==null||b(G[1],K))},[L,D,o,$,b]),te=v.useCallback(function(K){$&&(D(null),o==null||o(null)),S&&O.current&&S(O.current[1],K)},[$,D,o,S,O]);return{current:I,handleMouseEnter:f?Z:void 0,handleMouseMove:f?X:void 0,handleMouseLeave:f?J:void 0,handleMouseDown:f?ee:void 0,handleMouseUp:f?W:void 0,handleClick:f?F:void 0,handleDoubleClick:f?z:void 0,handleTouchStart:f?V:void 0,handleTouchMove:f?N:void 0,handleTouchEnd:f?te:void 0}},Ele=["theme"],Ole=function(e){var t=e.data,n=e.width,r=e.height,i=e.margin,a=e.layers,o=a===void 0?Qn.layers:a,s=e.xDomain,l=s===void 0?Qn.xDomain:s,c=e.yDomain,u=c===void 0?Qn.yDomain:c,d=e.enableLinks,f=d===void 0?Qn.enableLinks:d,h=e.linkLineWidth,p=h===void 0?Qn.linkLineWidth:h,m=e.linkLineColor,g=m===void 0?Qn.linkLineColor:m,x=e.enableCells,_=x===void 0?Qn.enableCells:x,w=e.cellLineWidth,C=w===void 0?Qn.cellLineWidth:w,b=e.cellLineColor,S=b===void 0?Qn.cellLineColor:b,M=e.enablePoints,$=M===void 0?Qn.enableCells:M,k=e.pointSize,R=k===void 0?Qn.pointSize:k,T=e.pointColor,E=T===void 0?Qn.pointColor:T,A=e.role,j=A===void 0?Qn.role:A,I=e.forwardedRef,D=oo(n,r,i),O=D.outerWidth,L=D.outerHeight,B=D.margin,P=D.innerWidth,H=D.innerHeight,Y=$le({data:t,width:P,height:H,xDomain:l,yDomain:u}),q=Y.points,Z=Y.delaunay,X=Y.voronoi,J={links:null,cells:null,points:null,bounds:null};f&&o.includes("links")&&(J.links=y.jsx("path",{stroke:g,strokeWidth:p,fill:"none",d:Z.render()},"links")),_&&o.includes("cells")&&(J.cells=y.jsx("path",{d:X.render(),fill:"none",stroke:S,strokeWidth:C},"cells")),$&&o.includes("points")&&(J.points=y.jsx("path",{stroke:"none",fill:E,d:Z.renderPoints(void 0,R/2)},"points")),o.includes("bounds")&&(J.bounds=y.jsx("path",{fill:"none",stroke:S,strokeWidth:C,d:X.renderBounds()},"bounds"));var ee=kle({points:q,delaunay:Z,voronoi:X});return y.jsx(xh,{width:O,height:L,margin:B,role:j,ref:I,children:o.map(function(W,F){return J[W]!==void 0?J[W]:typeof W=="function"?y.jsx(v.Fragment,{children:v.createElement(W,ee)},F):null})})},Ale=v.forwardRef(function(e,t){var n=e.theme,r=O5(e,Ele);return y.jsx(io,{isInteractive:!1,animate:!1,theme:n,children:y.jsx(Ole,$d({},r,{forwardedRef:t}))})}),Rle=["defaultWidth","defaultHeight","onResize","debounceResize"];v.forwardRef(function(e,t){var n=e.defaultWidth,r=e.defaultHeight,i=e.onResize,a=e.debounceResize,o=O5(e,Rle);return y.jsx(ao,{defaultWidth:n,defaultHeight:r,onResize:i,debounceResize:a,children:function(s){var l=s.width,c=s.height;return y.jsx(Ale,$d({},o,{width:l,height:c,ref:t}))}})});var Dle=function(e){var t=e.nodes,n=e.width,r=e.height,i=e.margin,a=i===void 0?Pc:i,o=e.getNodePosition,s=e.setCurrent,l=e.onMouseEnter,c=e.onMouseMove,u=e.onMouseLeave,d=e.onMouseDown,f=e.onMouseUp,h=e.onClick,p=e.onDoubleClick,m=e.onTouchStart,g=e.onTouchMove,x=e.onTouchEnd,_=e.enableTouchCrosshair,w=_!==void 0&&_,C=e.detectionRadius,b=C===void 0?1/0:C,S=e.tooltip,M=e.tooltipPosition,$=M===void 0?A5:M,k=e.tooltipAnchor,R=k===void 0?R5:k,T=e.debug,E=v.useRef(null),A=D5({points:t,getNodePosition:o,width:n,height:r,margin:a,debug:T}),j=A.delaunay,I=A.voronoi,D=Mle({elementRef:E,nodes:t,delaunay:j,margin:a,detectionRadius:b,setCurrent:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onMouseDown:d,onMouseUp:f,onClick:h,onDoubleClick:p,onTouchStart:m,onTouchMove:g,onTouchEnd:x,enableTouchCrosshair:w,tooltip:S,tooltipPosition:$,tooltipAnchor:R}),O=D.current,L=D.handleMouseEnter,B=D.handleMouseMove,P=D.handleMouseLeave,H=D.handleMouseDown,Y=D.handleMouseUp,q=D.handleClick,Z=D.handleDoubleClick,X=D.handleTouchStart,J=D.handleTouchMove,ee=D.handleTouchEnd,W=v.useMemo(function(){if(T&&I)return I.render()},[T,I]);return y.jsxs("g",{ref:E,transform:"translate("+-a.left+","+-a.top+")",children:[T&&I&&y.jsxs(y.Fragment,{children:[y.jsx("path",{d:W,stroke:"red",strokeWidth:1,opacity:.75}),b<1/0&&y.jsx("path",{stroke:"red",strokeWidth:.35,fill:"none",d:j.renderPoints(void 0,b)}),O&&y.jsx("path",{fill:"pink",opacity:.35,d:I.renderCell(O[0])})]}),y.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:L,onMouseMove:B,onMouseLeave:P,onMouseDown:H,onMouseUp:Y,onTouchStart:X,onTouchMove:J,onTouchEnd:ee,onClick:q,onDoubleClick:Z})]})},jle=function(e,t){e.save(),e.globalAlpha=.75,e.beginPath(),t.render(e),e.strokeStyle="red",e.lineWidth=1,e.stroke(),e.restore()},Ile=function(e,t,n){e.save(),e.globalAlpha=.35,e.beginPath(),t.renderCell(n,e),e.fillStyle="pink",e.fill(),e.restore()};function En(){return En=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},En.apply(null,arguments)}function _h(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ox,oi={xScale:{type:"point"},yScale:{type:"linear",min:0,max:"auto"},curve:"linear",colors:{scheme:"nivo"},lineWidth:2,layers:["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"],enablePoints:!0,pointSize:6,pointColor:{from:"series.color"},pointBorderWidth:0,pointBorderColor:{theme:"background"},enableArea:!1,areaBaselineValue:0,areaOpacity:.2,enableGridX:!0,enableGridY:!0,legends:[],isInteractive:!0,tooltip:v.memo(function(e){var t=e.point;return y.jsx(nv,{id:y.jsxs("span",{children:["x: ",y.jsx("strong",{children:t.data.xFormatted}),", y:"," ",y.jsx("strong",{children:t.data.yFormatted})]}),enableChip:!0,color:t.seriesColor})}),sliceTooltip:v.memo(function(e){var t=e.slice,n=e.axis,r=Lt(),i=n==="x"?"y":"x";return y.jsx($6,{rows:t.points.map(function(a){return[y.jsx(T6,{color:a.seriesColor,style:r.tooltip.chip},"chip"),a.seriesId,y.jsx("span",{style:r.tooltip.tableCellValue,children:a.data[i+"Formatted"]},"value")]})})}),debugMesh:!1,renderWrapper:!0},st=En({},oi,{defs:[],fill:[],enablePointLabel:!1,pointLabel:"data.yFormatted",areaBlendMode:"normal",axisTop:null,axisRight:null,axisBottom:Wn,axisLeft:Wn,useMesh:!1,enableSlices:!1,debugSlices:!1,enableCrosshair:!0,crosshairType:"bottom-left",enableTouchCrosshair:!1,initialHiddenIds:[],animate:!0,motionConfig:"gentle",role:"img",isFocusable:!1}),en=En({},oi,{pixelRatio:typeof window<"u"&&(Ox=window.devicePixelRatio)!=null?Ox:1,axisTop:null,axisRight:null,axisBottom:Wn,axisLeft:Wn});function Nle(e){return v.useMemo(function(){return fv().defined(function(t){return t.x!==null&&t.y!==null}).x(function(t){return t.x}).y(function(t){return t.y}).curve(QS(e))},[e])}function Ple(e){var t=e.curve,n=e.yScale,r=e.areaBaselineValue;return v.useMemo(function(){return NK().defined(function(i){return i.x!==null&&i.y!==null}).x(function(i){return i.x}).y1(function(i){return i.y}).curve(QS(t)).y0(n(r))},[t,n,r])}var Lle=function(e){var t=e.componentId,n=e.enableSlices,r=e.points,i=e.width,a=e.height;return v.useMemo(function(){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],g=u[c+1];return d=m?h-(h-m[0])/2:h,f=g?h-d+(g[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],g=u[c+1];return d=m?h-(h-m[0])/2:h,f=g?h-d+(g[0]-h)/2:a-d,{id:h,x0:0,x:0,y0:d,y:h,width:i,height:f,points:p.reverse()}})}return[]},[t,n,a,r,i])},Fle="line",j5=function(e){var t=e.data,n=e.xScale,r=n===void 0?oi.xScale:n,i=e.xFormat,a=e.yScale,o=a===void 0?oi.yScale:a,s=e.yFormat,l=e.width,c=e.height,u=e.colors,d=u===void 0?oi.colors:u,f=e.curve,h=f===void 0?oi.curve:f,p=e.areaBaselineValue,m=p===void 0?oi.areaBaselineValue:p,g=e.pointColor,x=g===void 0?oi.pointColor:g,_=e.pointBorderColor,w=_===void 0?oi.pointBorderColor:_,C=e.enableSlices,b=C===void 0?st.enableSlices:C,S=e.initialHiddenIds,M=S===void 0?st.initialHiddenIds:S,$=v.useState(rle(Fle))[0],k=os(i),R=os(s),T=Wv(d,"id"),E=Lt(),A=pr(x,E),j=pr(w,E),I=v.useState(M??[]),D=I[0],O=I[1],L=v.useMemo(function(){return Wse(t.filter(function(W){return D.indexOf(W.id)===-1}),r,o,l,c)},[t,D,r,o,l,c]),B=L.xScale,P=L.yScale,H=L.series,Y=v.useMemo(function(){var W=t.map(function(z){return{id:z.id,label:""+z.id,color:T(z)}}),F=W.map(function(z){return En({},H.find(function(V){return V.id===z.id}),{color:z.color})}).filter(function(z){return!!z.id});return{legendData:W.map(function(z){return En({},z,{hidden:!F.find(function(V){return V.id===z.id})})}).reverse(),series:F}},[t,H,T]),q=Y.legendData,Z=Y.series,X=v.useCallback(function(W){O(function(F){return F.indexOf(W)>-1?F.filter(function(z){return z!==W}):[].concat(F,[W])})},[]),J=function(W){var F=W.series,z=W.getPointColor,V=W.getPointBorderColor,N=W.formatX,te=W.formatY;return v.useMemo(function(){return F.reduce(function(K,G,oe){return[].concat(K,G.data.filter(function(ne){return ne.position.x!==null&&ne.position.y!==null}).map(function(ne,re){var ae={id:G.id+"."+re,indexInSeries:re,absIndex:K.length+re,seriesIndex:oe,seriesId:G.id,seriesColor:G.color,x:ne.position.x,y:ne.position.y,data:En({},ne.data,{xFormatted:N(ne.data.x),yFormatted:te(ne.data.y)})};return ae.color=z({series:G,point:ae}),ae.borderColor=V(ae),ae}))},[])},[F,z,V,N,te])}({series:Z,getPointColor:A,getPointBorderColor:j,formatX:k,formatY:R}),ee=Lle({componentId:$,enableSlices:b,points:J,width:l,height:c});return{legendData:q,toggleSeries:X,lineGenerator:Nle(h),areaGenerator:Ple({curve:h,yScale:P,areaBaselineValue:m}),getColor:T,series:Z,xScale:B,yScale:P,slices:ee,points:J}},zle=function(e){var t=e.areaBlendMode,n=e.areaOpacity,r=e.color,i=e.fill,a=e.path,o=Fn(),s=o.animate,l=o.config,c=Lv(a),u=Zr({color:r,config:l,immediate:!s});return y.jsx(Ht.path,{d:c,fill:i||u.color,fillOpacity:n,strokeWidth:0,style:{mixBlendMode:t}})},Ble=v.memo(function(e){var t=e.areaGenerator,n=e.areaOpacity,r=e.areaBlendMode,i=e.series.slice(0).reverse();return y.jsx("g",{children:i.map(function(a){return y.jsx(zle,En({path:t(a.data.map(function(o){return o.position}))},En({areaOpacity:n,areaBlendMode:r},a)),""+a.id)})})}),Wle=v.memo(function(e){var t=e.lineGenerator,n=e.points,r=e.color,i=e.thickness,a=v.useMemo(function(){return t(n)},[t,n]),o=Lv(a);return y.jsx(Ht.path,{d:o,fill:"none",strokeWidth:i,stroke:r})}),Ule=v.memo(function(e){var t=e.series,n=e.lineGenerator,r=e.lineWidth;return y.jsx(y.Fragment,{children:t.slice(0).reverse().map(function(i){var a=i.id,o=i.data,s=i.color;return y.jsx(Wle,{points:o.map(function(l){return l.position}),lineGenerator:n,color:s,thickness:r},a)})})}),Hle=v.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.onMouseDown,f=e.onMouseUp,h=e.onClick,p=e.onDoubleClick,m=e.onTouchStart,g=e.onTouchMove,x=e.onTouchEnd,_=Ti(),w=_.showTooltipFromEvent,C=_.hideTooltip,b=v.useCallback(function(I){w(v.createElement(a,{slice:t,axis:r}),I,"right"),s(t),l==null||l(t,I)},[w,a,t,r,s,l]),S=v.useCallback(function(I){w(v.createElement(a,{slice:t,axis:r}),I,"right"),c==null||c(t,I)},[w,a,t,r,c]),M=v.useCallback(function(I){C(),s(null),u==null||u(t,I)},[C,s,u,t]),$=v.useCallback(function(I){d==null||d(t,I)},[t,d]),k=v.useCallback(function(I){f==null||f(t,I)},[t,f]),R=v.useCallback(function(I){h==null||h(t,I)},[t,h]),T=v.useCallback(function(I){p==null||p(t,I)},[t,p]),E=v.useCallback(function(I){w(v.createElement(a,{slice:t,axis:r}),I,"right"),s(t),m==null||m(t,I)},[r,m,s,w,t,a]),A=v.useCallback(function(I){var D=I.touches[0],O=document.elementFromPoint(D.clientX,D.clientY),L=O==null?void 0:O.getAttribute("data-ref");if(L){var B=n.find(function(P){return P.id===L});B&&(w(v.createElement(a,{slice:B,axis:r}),I,"right"),s(B))}g==null||g(t,I)},[r,g,s,w,t,n,a]),j=v.useCallback(function(I){C(),s(null),x==null||x(t,I)},[C,s,x,t]);return y.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:b,onMouseMove:S,onMouseLeave:M,onMouseDown:$,onMouseUp:k,onClick:R,onDoubleClick:T,onTouchStart:E,onTouchMove:A,onTouchEnd:j,"data-ref":t.id})}),Vle=v.memo(function(e){var t=e.slices,n=e.axis,r=e.debug,i=e.tooltip,a=e.current,o=e.setCurrent,s=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,u=e.onMouseDown,d=e.onMouseUp,f=e.onClick,h=e.onDoubleClick,p=e.onTouchStart,m=e.onTouchMove,g=e.onTouchEnd;return y.jsx(y.Fragment,{children:t.map(function(x){return y.jsx(Hle,{slice:x,slices:t,axis:n,debug:r,tooltip:i,setCurrent:o,isCurrent:a!==null&&a.id===x.id,onMouseEnter:s,onMouseMove:l,onMouseLeave:c,onMouseDown:u,onMouseUp:d,onClick:f,onDoubleClick:h,onTouchStart:p,onTouchMove:m,onTouchEnd:g},x.id)})})}),qle=v.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=e.isFocusable,c=e.setCurrentPoint,u=e.tooltip,d=e.margin,f=e.ariaLabel,h=e.ariaLabelledBy,p=e.ariaDescribedBy,m=e.ariaHidden,g=e.ariaDisabled,x=nie(o),_=Ti(),w=_.showTooltipAt,C=_.hideTooltip,b=t.slice(0).sort(function(S,M){return S.indexInSeries-M.indexInSeries}).sort(function(S,M){return M.seriesIndex-S.seriesIndex}).map(function(S){return{id:S.id,x:S.x,y:S.y,datum:S.data,fill:S.color,stroke:S.borderColor,label:a?x(S):null,ariaLabel:f?f(S):void 0,ariaLabelledBy:h?h(S):void 0,ariaDescribedBy:p?p(S):void 0,ariaHidden:m?m(S):void 0,ariaDisabled:g?g(S):void 0,onFocus:l?function(){c(S),w(v.createElement(u,{point:S}),[d.left+S.x,d.top+S.y],"top")}:void 0,onBlur:l?function(){c(null),C()}:void 0}});return y.jsx("g",{children:b.map(function(S){return y.jsx(Jre,{x:S.x,y:S.y,datum:S.datum,symbol:n,size:r,color:S.fill,borderWidth:i,borderColor:S.stroke,label:S.label,labelYOffset:s,ariaLabel:S.ariaLabel,ariaLabelledBy:S.ariaLabelledBy,ariaDescribedBy:S.ariaDescribedBy,ariaHidden:S.ariaHidden,ariaDisabled:S.ariaDisabled,isFocusable:l,onFocus:S.onFocus,onBlur:S.onBlur,testId:"line.point."+S.id},S.id)})})}),Yle=v.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.onMouseDown,u=e.onMouseUp,d=e.onClick,f=e.onDoubleClick,h=e.onTouchStart,p=e.onTouchMove,m=e.onTouchEnd,g=e.tooltip,x=e.debug,_=e.enableTouchCrosshair,w=Ti(),C=w.showTooltipAt,b=w.hideTooltip,S=v.useCallback(function(D,O){C(v.createElement(g,{point:D}),[D.x+i.left,D.y+i.top],"top"),o==null||o(D,O)},[C,g,o,i]),M=v.useCallback(function(D,O){C(v.createElement(g,{point:D}),[D.x+i.left,D.y+i.top],"top"),s==null||s(D,O)},[C,g,i.left,i.top,s]),$=v.useCallback(function(D,O){b(),l==null||l(D,O)},[b,l]),k=v.useCallback(function(D,O){c==null||c(D,O)},[c]),R=v.useCallback(function(D,O){u==null||u(D,O)},[u]),T=v.useCallback(function(D,O){d==null||d(D,O)},[d]),E=v.useCallback(function(D,O){f==null||f(D,O)},[f]),A=v.useCallback(function(D,O){C(v.createElement(g,{point:D}),[D.x+i.left,D.y+i.top],"top"),h==null||h(D,O)},[i.left,i.top,h,C,g]),j=v.useCallback(function(D,O){C(v.createElement(g,{point:D}),[D.x+i.left,D.y+i.top],"top"),p==null||p(D,O)},[i.left,i.top,p,C,g]),I=v.useCallback(function(D,O){b(),m==null||m(D,O)},[m,b]);return y.jsx(Dle,{nodes:t,width:n,height:r,setCurrent:a,onMouseEnter:S,onMouseMove:M,onMouseLeave:$,onMouseDown:k,onMouseUp:R,onClick:T,onDoubleClick:E,onTouchStart:A,onTouchMove:j,onTouchEnd:I,enableTouchCrosshair:_,debug:x})}),Gle=["isInteractive","animate","motionConfig","theme","renderWrapper"];function Zle(e){var t=e.data,n=e.xScale,r=n===void 0?st.xScale:n,i=e.xFormat,a=e.yScale,o=a===void 0?st.yScale:a,s=e.yFormat,l=e.curve,c=l===void 0?st.curve:l,u=e.margin,d=e.width,f=e.height,h=e.colors,p=h===void 0?st.colors:h,m=e.lineWidth,g=m===void 0?st.lineWidth:m,x=e.layers,_=x===void 0?st.layers:x,w=e.enableArea,C=w===void 0?st.enableArea:w,b=e.areaBaselineValue,S=b===void 0?st.areaBaselineValue:b,M=e.areaOpacity,$=M===void 0?st.areaOpacity:M,k=e.areaBlendMode,R=k===void 0?st.areaBlendMode:k,T=e.enablePoints,E=T===void 0?st.enablePoints:T,A=e.pointSymbol,j=e.pointSize,I=j===void 0?st.pointSize:j,D=e.pointColor,O=D===void 0?st.pointColor:D,L=e.pointBorderWidth,B=L===void 0?st.pointBorderWidth:L,P=e.pointBorderColor,H=P===void 0?st.pointBorderColor:P,Y=e.enablePointLabel,q=Y===void 0?st.enablePointLabel:Y,Z=e.pointLabel,X=Z===void 0?st.pointLabel:Z,J=e.pointLabelYOffset,ee=e.enableGridX,W=ee===void 0?st.enableGridX:ee,F=e.gridXValues,z=e.enableGridY,V=z===void 0?st.enableGridY:z,N=e.gridYValues,te=e.axisTop,K=e.axisRight,G=e.axisBottom,oe=G===void 0?st.axisBottom:G,ne=e.axisLeft,re=ne===void 0?st.axisLeft:ne,ae=e.defs,le=ae===void 0?st.defs:ae,ye=e.fill,ge=ye===void 0?st.fill:ye,be=e.markers,Me=e.legends,ce=Me===void 0?st.legends:Me,de=e.isInteractive,Ce=de===void 0?st.isInteractive:de,Ge=e.useMesh,we=Ge===void 0?st.useMesh:Ge,ve=e.debugMesh,Pe=ve===void 0?st.debugMesh:ve,Ze=e.onMouseEnter,_t=e.onMouseMove,Te=e.onMouseLeave,Re=e.onMouseDown,at=e.onMouseUp,Ue=e.onClick,mt=e.onDoubleClick,ut=e.onTouchStart,At=e.onTouchMove,Ke=e.onTouchEnd,Le=e.tooltip,Ve=Le===void 0?st.tooltip:Le,et=e.enableSlices,Fe=et===void 0?st.enableSlices:et,tt=e.debugSlices,vt=tt===void 0?st.debugSlices:tt,ot=e.sliceTooltip,Ne=ot===void 0?st.sliceTooltip:ot,Ee=e.enableCrosshair,Ye=Ee===void 0?st.enableCrosshair:Ee,xt=e.crosshairType,nt=xt===void 0?st.crosshairType:xt,bt=e.enableTouchCrosshair,Jt=bt===void 0?st.enableTouchCrosshair:bt,Ft=e.role,Bt=Ft===void 0?st.role:Ft,fn=e.ariaLabel,qt=e.ariaLabelledBy,$e=e.ariaDescribedBy,Je=e.isFocusable,St=Je===void 0?st.isFocusable:Je,an=e.pointAriaLabel,Yt=e.pointAriaLabelledBy,ze=e.pointAriaDescribedBy,Be=e.pointAriaHidden,ht=e.pointAriaDisabled,Rt=e.initialHiddenIds,Tt=Rt===void 0?st.initialHiddenIds:Rt,Qe=e.forwardedRef,$t=oo(d,f,u),vr=$t.margin,ln=$t.innerWidth,cn=$t.innerHeight,An=$t.outerWidth,ia=$t.outerHeight,Ct=j5({data:t,xScale:r,xFormat:i,yScale:o,yFormat:s,width:ln,height:cn,colors:p,curve:c,areaBaselineValue:S,pointColor:O,pointBorderColor:H,enableSlices:Fe,initialHiddenIds:Tt}),aa=Ct.legendData,Ae=Ct.toggleSeries,Er=Ct.lineGenerator,oa=Ct.areaGenerator,so=Ct.series,lo=Ct.xScale,Jr=Ct.yScale,Lc=Ct.slices,Qr=Ct.points,As=v.useState(null),sa=As[0],Rs=As[1],Fc=v.useState(null),la=Fc[0],zc=Fc[1],Rn={grid:null,markers:null,axes:null,areas:null,crosshair:null,lines:null,points:null,slices:null,mesh:null,legends:null};_.includes("grid")&&(W||V)&&(Rn.grid=y.jsx(M5,{width:ln,height:cn,xScale:W?lo:null,yScale:V?Jr:null,xValues:F,yValues:N},"grid")),_.includes("markers")&&Array.isArray(be)&&be.length>0&&(Rn.markers=y.jsx(JS,{markers:be,width:ln,height:cn,xScale:lo,yScale:Jr},"markers")),_.includes("axes")&&(Rn.axes=y.jsx(k5,{xScale:lo,yScale:Jr,width:ln,height:cn,top:te,right:K,bottom:oe,left:re},"axes")),_.includes("lines")&&(Rn.lines=y.jsx(Ule,{series:so,lineGenerator:Er,lineWidth:g},"lines")),_.includes("legends")&&ce.length>0&&(Rn.legends=y.jsx(v.Fragment,{children:ce.map(function(Or,$i){return y.jsx(Vv,En({},Or,{containerWidth:ln,containerHeight:cn,data:Or.data||aa,toggleSerie:Or.toggleSerie?Ae:void 0}),$i)})},"legends"));var Th=zv(le,so,ge);C&&(Rn.areas=y.jsx(Ble,{areaGenerator:oa,areaOpacity:$,areaBlendMode:R,series:so},"areas")),Ce&&Fe!==!1&&(Rn.slices=y.jsx(Vle,{slices:Lc,axis:Fe,debug:vt,tooltip:Ne,current:la,setCurrent:zc,onMouseEnter:Ze,onMouseMove:_t,onMouseLeave:Te,onMouseDown:Re,onMouseUp:at,onClick:Ue,onDoubleClick:mt,onTouchStart:ut,onTouchMove:At,onTouchEnd:Ke},"slices")),E&&(Rn.points=y.jsx(qle,{points:Qr,symbol:A,size:I,borderWidth:B,enableLabel:q,label:X,labelYOffset:J,isFocusable:St,setCurrentPoint:Rs,tooltip:Ve,margin:vr,ariaLabel:an,ariaLabelledBy:Yt,ariaDescribedBy:ze,ariaHidden:Be,ariaDisabled:ht},"points")),Ce&&Ye&&(sa!==null&&(Rn.crosshair=y.jsx(Bm,{width:ln,height:cn,x:sa.x,y:sa.y,type:nt},"crosshair")),la!==null&&Fe&&(Rn.crosshair=y.jsx(Bm,{width:ln,height:cn,x:la.x,y:la.y,type:Fe},"crosshair"))),Ce&&we&&Fe===!1&&(Rn.mesh=y.jsx(Yle,{points:Qr,width:ln,height:cn,margin:vr,setCurrent:Rs,onMouseEnter:Ze,onMouseMove:_t,onMouseLeave:Te,onMouseDown:Re,onMouseUp:at,onClick:Ue,onDoubleClick:mt,onTouchStart:ut,onTouchMove:At,onTouchEnd:Ke,tooltip:Ve,enableTouchCrosshair:Jt,debug:Pe},"mesh"));var $h=En({},e,{innerWidth:ln,innerHeight:cn,series:so,slices:Lc,points:Qr,xScale:lo,yScale:Jr,lineGenerator:Er,areaGenerator:oa,currentPoint:sa,setCurrentPoint:Rs,currentSlice:la,setCurrentSlice:zc});return y.jsx(xh,{defs:Th,width:An,height:ia,margin:vr,role:Bt,ariaLabel:fn,ariaLabelledBy:qt,ariaDescribedBy:$e,isFocusable:St,ref:Qe,children:_.map(function(Or,$i){return typeof Or=="function"?y.jsx(v.Fragment,{children:Or($h)},$i):Rn[Or]})})}var Xle=v.forwardRef(function(e,t){var n=e.isInteractive,r=n===void 0?st.isInteractive:n,i=e.animate,a=i===void 0?st.animate:i,o=e.motionConfig,s=o===void 0?st.motionConfig:o,l=e.theme,c=e.renderWrapper,u=_h(e,Gle);return y.jsx(io,{animate:a,isInteractive:r,motionConfig:s,renderWrapper:c,theme:l,children:y.jsx(Zle,En({isInteractive:r},u,{forwardedRef:t}))})}),Kle=["defaultWidth","defaultHeight","onResize","debounceResize"],Jle=v.forwardRef(function(e,t){var n=e.defaultWidth,r=e.defaultHeight,i=e.onResize,a=e.debounceResize,o=_h(e,Kle);return y.jsx(ao,{defaultWidth:n,defaultHeight:r,onResize:i,debounceResize:a,children:function(s){var l=s.width,c=s.height;return y.jsx(Xle,En({width:l,height:c},o,{ref:t}))}})}),Qle=["isInteractive","renderWrapper","theme"],ece=function(e){var t=e.width,n=e.height,r=e.margin,i=e.pixelRatio,a=i===void 0?en.pixelRatio:i,o=e.data,s=e.xScale,l=s===void 0?en.xScale:s,c=e.xFormat,u=e.yScale,d=u===void 0?en.yScale:u,f=e.yFormat,h=e.curve,p=h===void 0?en.curve:h,m=e.layers,g=m===void 0?en.layers:m,x=e.colors,_=x===void 0?en.colors:x,w=e.lineWidth,C=w===void 0?en.lineWidth:w,b=e.enableArea,S=b===void 0?en.enableArea:b,M=e.areaBaselineValue,$=M===void 0?en.areaBaselineValue:M,k=e.areaOpacity,R=k===void 0?en.areaOpacity:k,T=e.enablePoints,E=T===void 0?en.enablePoints:T,A=e.pointSize,j=A===void 0?en.pointSize:A,I=e.pointColor,D=I===void 0?en.pointColor:I,O=e.pointBorderWidth,L=O===void 0?en.pointBorderWidth:O,B=e.pointBorderColor,P=B===void 0?en.pointBorderColor:B,H=e.enableGridX,Y=H===void 0?en.enableGridX:H,q=e.gridXValues,Z=e.enableGridY,X=Z===void 0?en.enableGridY:Z,J=e.gridYValues,ee=e.axisTop,W=e.axisRight,F=e.axisBottom,z=F===void 0?en.axisBottom:F,V=e.axisLeft,N=V===void 0?en.axisLeft:V,te=e.legends,K=te===void 0?en.legends:te,G=e.isInteractive,oe=G===void 0?en.isInteractive:G,ne=e.debugMesh,re=ne===void 0?en.debugMesh:ne,ae=e.onMouseLeave,le=e.onMouseDown,ye=e.onMouseUp,ge=e.onClick,be=e.onDoubleClick,Me=e.tooltip,ce=Me===void 0?en.tooltip:Me,de=e.role,Ce=e.forwardedRef,Ge=v.useRef(null),we=oo(t,n,r),ve=we.margin,Pe=we.innerWidth,Ze=we.innerHeight,_t=we.outerWidth,Te=we.outerHeight,Re=Lt(),at=v.useState(null),Ue=at[0],mt=at[1],ut=j5({data:o,xScale:l,xFormat:c,yScale:d,yFormat:f,width:Pe,height:Ze,colors:_,curve:p,areaBaselineValue:$,pointColor:D,pointBorderColor:P}),At=ut.lineGenerator,Ke=ut.areaGenerator,Le=ut.series,Ve=ut.xScale,et=ut.yScale,Fe=ut.points,tt=v.useMemo(function(){return{innerWidth:Pe,innerHeight:Ze,series:Le,points:Fe,xScale:Ve,yScale:et,lineWidth:C,lineGenerator:At,areaGenerator:Ke,currentPoint:Ue,setCurrentPoint:mt}},[Pe,Ze,Le,Fe,Ve,et,C,At,Ke,Ue,mt]),vt=D5({points:Fe,width:Pe,height:Ze,debug:re}),ot=vt.delaunay,Ne=vt.voronoi;v.useEffect(function(){if(Ge.current!==null){Ge.current.width=_t*a,Ge.current.height=Te*a;var $e=Ge.current.getContext("2d");$e.scale(a,a),$e.fillStyle=Re.background,$e.fillRect(0,0,_t,Te),$e.translate(ve.left,ve.top),g.forEach(function(Je){var St;typeof Je=="function"&&Je($e,tt);var an=(St=Re.grid.line.strokeWidth)!=null?St:0;if(Je==="grid"&&typeof an!="string"&&an>0&&($e.lineWidth=an,$e.strokeStyle=Re.grid.line.stroke,Y&&Sd($e,{width:Pe,height:Ze,scale:Ve,axis:"x",values:q}),X&&Sd($e,{width:Pe,height:Ze,scale:et,axis:"y",values:J})),Je==="axes"&&E5($e,{xScale:Ve,yScale:et,width:Pe,height:Ze,top:ee,right:W,bottom:z,left:N,theme:Re}),Je==="areas"&&S===!0){$e.save(),$e.globalAlpha=R,Ke.context($e);for(var Yt=Le.length-1;Yt>=0;Yt--)$e.fillStyle=Le[Yt].color,$e.beginPath(),Ke(Le[Yt].data.map(function(Be){return Be.position})),$e.fill();$e.restore()}if(Je==="lines"&&(At.context($e),Le.forEach(function(Be){$e.strokeStyle=Be.color,$e.lineWidth=C,$e.beginPath(),At(Be.data.map(function(ht){return ht.position})),$e.stroke()})),Je==="points"&&E===!0&&j>0&&Fe.forEach(function(Be){$e.fillStyle=Be.color,$e.beginPath(),$e.arc(Be.x,Be.y,j/2,0,2*Math.PI),$e.fill(),L>0&&($e.strokeStyle=Be.borderColor,$e.lineWidth=L,$e.stroke())}),Je==="mesh"&&re===!0&&Ne!==void 0&&(jle($e,Ne),Ue&&Ile($e,Ne,Ue.absIndex)),Je==="legends"){var ze=Le.map(function(Be){return{id:Be.id,label:Be.id,color:Be.color}}).reverse();K.forEach(function(Be){qv($e,En({},Be,{data:Be.data||ze,containerWidth:Pe,containerHeight:Ze,theme:Re}))})}})}},[Ge,Pe,_t,Ze,Te,ve.left,ve.top,a,g,Re,At,Le,Ve,et,Y,q,X,J,ee,W,z,N,K,Fe,E,j,L,Ue,tt,re,S,Ke,R,C,Ne]);var Ee=v.useCallback(function($e){if(!Ge.current)return null;var Je=zo(Ge.current,$e),St=Je[0],an=Je[1];if(!r5(ve.left,ve.top,Pe,Ze,St,an))return null;var Yt=ot.find(St-ve.left,an-ve.top);return Fe[Yt]},[Ge,ve,Pe,Ze,ot,Fe]),Ye=Ti(),xt=Ye.showTooltipFromEvent,nt=Ye.hideTooltip,bt=v.useCallback(function($e){var Je=Ee($e);mt(Je),Je?xt(v.createElement(ce,{point:Je}),$e):nt()},[Ee,mt,xt,nt,ce]),Jt=v.useCallback(function($e){nt(),mt(null),Ue&&(ae==null||ae(Ue,$e))},[nt,mt,ae,Ue]),Ft=v.useCallback(function($e){if(le){var Je=Ee($e);Je&&le(Je,$e)}},[Ee,le]),Bt=v.useCallback(function($e){if(ye){var Je=Ee($e);Je&&ye(Je,$e)}},[Ee,ye]),fn=v.useCallback(function($e){if(ge){var Je=Ee($e);Je&&ge(Je,$e)}},[Ee,ge]),qt=v.useCallback(function($e){if(be){var Je=Ee($e);Je&&be(Je,$e)}},[Ee,be]);return y.jsx("canvas",{ref:Bv(Ge,Ce),width:_t*a,height:Te*a,style:{width:_t,height:Te,cursor:oe?"auto":"normal"},onMouseEnter:oe?bt:void 0,onMouseMove:oe?bt:void 0,onMouseLeave:oe?Jt:void 0,onMouseDown:oe?Ft:void 0,onMouseUp:oe?Bt:void 0,onClick:oe?fn:void 0,onDoubleClick:oe?qt:void 0,role:de})},tce=v.forwardRef(function(e,t){var n=e.isInteractive,r=e.renderWrapper,i=e.theme,a=_h(e,Qle);return y.jsx(io,{isInteractive:n,renderWrapper:r,theme:i,animate:!1,children:y.jsx(ece,En({},a,{forwardedRef:t}))})}),nce=["defaultWidth","defaultHeight","onResize","debounceResize"];v.forwardRef(function(e,t){var n=e.defaultWidth;e.defaultHeight;var r=e.onResize,i=e.debounceResize,a=_h(e,nce);return y.jsx(ao,{defaultWidth:n,defaultHeight:n,onResize:r,debounceResize:i,children:function(o){var s=o.width,l=o.height;return y.jsx(tce,En({width:s,height:l},a,{ref:t}))}})});var rce=b5;function ice(e,t){var n=[];return rce(e,function(r,i,a){t(r,i,a)&&n.push(r)}),n}var ace=ice,oce=BS,sce=ace,lce=Yv,cce=Kn;function uce(e,t){var n=cce(e)?oce:sce;return n(e,lce(t))}var dce=uce;const fce=nn(dce);var hce=Si,pce=gr,mce="[object Number]";function gce(e){return typeof e=="number"||pce(e)&&hce(e)==mce}var vce=gce;const Ax=nn(vce);function bce(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var yce=bce,xce=Ts,wce=Dc;function _ce(e,t){return e&&xce(t,wce(t),e)}var Cce=_ce,Sce=Ts,Tce=Oc;function $ce(e,t){return e&&Sce(t,Tce(t),e)}var kce=$ce,Mce=Ts,Ece=Nv;function Oce(e,t){return Mce(e,Ece(e),t)}var Ace=Oce,Rce=jv,Dce=q0,jce=Nv,Ice=WS,Nce=Object.getOwnPropertySymbols,Pce=Nce?function(e){for(var t=[];e;)Rce(t,jce(e)),e=Dce(e);return t}:Ice,I5=Pce,Lce=Ts,Fce=I5;function zce(e,t){return Lce(e,Fce(e),t)}var Bce=zce,Wce=zS,Uce=I5,Hce=Oc;function Vce(e){return Wce(e,Hce,Uce)}var N5=Vce,qce=Object.prototype,Yce=qce.hasOwnProperty;function Gce(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Yce.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Zce=Gce,Xce=V0;function Kce(e,t){var n=t?Xce(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Jce=Kce,Qce=/\w*$/;function eue(e){var t=new e.constructor(e.source,Qce.exec(e));return t.lastIndex=e.lastIndex,t}var tue=eue,Rx=ys,Dx=Rx?Rx.prototype:void 0,jx=Dx?Dx.valueOf:void 0;function nue(e){return jx?Object(jx.call(e)):{}}var rue=nue,iue=V0,aue=Jce,oue=tue,sue=rue,lue=r6,cue="[object Boolean]",uue="[object Date]",due="[object Map]",fue="[object Number]",hue="[object RegExp]",pue="[object Set]",mue="[object String]",gue="[object Symbol]",vue="[object ArrayBuffer]",bue="[object DataView]",yue="[object Float32Array]",xue="[object Float64Array]",wue="[object Int8Array]",_ue="[object Int16Array]",Cue="[object Int32Array]",Sue="[object Uint8Array]",Tue="[object Uint8ClampedArray]",$ue="[object Uint16Array]",kue="[object Uint32Array]";function Mue(e,t,n){var r=e.constructor;switch(t){case vue:return iue(e);case cue:case uue:return new r(+e);case bue:return aue(e,n);case yue:case xue:case wue:case _ue:case Cue:case Sue:case Tue:case $ue:case kue:return lue(e,n);case due:return new r;case fue:case mue:return new r(e);case hue:return oue(e);case pue:return new r;case gue:return sue(e)}}var Eue=Mue,Oue=yh,Aue=gr,Rue="[object Map]";function Due(e){return Aue(e)&&Oue(e)==Rue}var jue=Due,Iue=jue,Nue=Ss,Ix=Of,Nx=Ix&&Ix.isMap,Pue=Nx?Nue(Nx):Iue,Lue=Pue,Fue=yh,zue=gr,Bue="[object Set]";function Wue(e){return zue(e)&&Fue(e)==Bue}var Uue=Wue,Hue=Uue,Vue=Ss,Px=Of,Lx=Px&&Px.isSet,que=Lx?Vue(Lx):Hue,Yue=que,Gue=kf,Zue=yce,Xue=J0,Kue=Cce,Jue=kce,Que=t6,ede=i6,tde=Ace,nde=Bce,rde=US,ide=N5,ade=yh,ode=Zce,sde=Eue,lde=o6,cde=Kn,ude=Ef,dde=Lue,fde=Kr,hde=Yue,pde=Dc,mde=Oc,gde=1,vde=2,bde=4,P5="[object Arguments]",yde="[object Array]",xde="[object Boolean]",wde="[object Date]",_de="[object Error]",L5="[object Function]",Cde="[object GeneratorFunction]",Sde="[object Map]",Tde="[object Number]",F5="[object Object]",$de="[object RegExp]",kde="[object Set]",Mde="[object String]",Ede="[object Symbol]",Ode="[object WeakMap]",Ade="[object ArrayBuffer]",Rde="[object DataView]",Dde="[object Float32Array]",jde="[object Float64Array]",Ide="[object Int8Array]",Nde="[object Int16Array]",Pde="[object Int32Array]",Lde="[object Uint8Array]",Fde="[object Uint8ClampedArray]",zde="[object Uint16Array]",Bde="[object Uint32Array]",Gt={};Gt[P5]=Gt[yde]=Gt[Ade]=Gt[Rde]=Gt[xde]=Gt[wde]=Gt[Dde]=Gt[jde]=Gt[Ide]=Gt[Nde]=Gt[Pde]=Gt[Sde]=Gt[Tde]=Gt[F5]=Gt[$de]=Gt[kde]=Gt[Mde]=Gt[Ede]=Gt[Lde]=Gt[Fde]=Gt[zde]=Gt[Bde]=!0;Gt[_de]=Gt[L5]=Gt[Ode]=!1;function Eu(e,t,n,r,i,a){var o,s=t&gde,l=t&vde,c=t&bde;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!fde(e))return e;var u=cde(e);if(u){if(o=ode(e),!s)return ede(e,o)}else{var d=ade(e),f=d==L5||d==Cde;if(ude(e))return Que(e,s);if(d==F5||d==P5||f&&!i){if(o=l||f?{}:lde(e),!s)return l?nde(e,Jue(o,e)):tde(e,Kue(o,e))}else{if(!Gt[d])return i?e:{};o=sde(e,d,s)}}a||(a=new Gue);var h=a.get(e);if(h)return h;a.set(e,o),hde(e)?e.forEach(function(g){o.add(Eu(g,t,n,g,e,a))}):dde(e)&&e.forEach(function(g,x){o.set(x,Eu(g,t,n,x,e,a))});var p=c?l?ide:rde:l?mde:pde,m=u?void 0:p(e);return Zue(m||e,function(g,x){m&&(x=g,g=e[x]),Xue(o,x,Eu(g,t,n,x,e,a))}),o}var Wde=Eu;function Ude(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 Hde=Ude,Vde=Ac,qde=Hde;function Yde(e,t){return t.length<2?e:Vde(e,qde(t,0,-1))}var Gde=Yde,Zde=$s,Xde=jS,Kde=Gde,Jde=ks;function Qde(e,t){return t=Zde(t,e),e=Kde(e,t),e==null||delete e[Jde(Xde(t))]}var efe=Qde,tfe=Z0;function nfe(e){return tfe(e)?void 0:e}var rfe=nfe,ife=jf,afe=Wde,ofe=efe,sfe=$s,lfe=Ts,cfe=rfe,ufe=LS,dfe=N5,ffe=1,hfe=2,pfe=4,mfe=ufe(function(e,t){var n={};if(e==null)return n;var r=!1;t=ife(t,function(a){return a=sfe(a,e),r||(r=a.length>1),a}),lfe(e,dfe(e),n),r&&(n=afe(n,ffe|hfe|pfe,cfe));for(var i=t.length;i--;)ofe(n,t[i]);return n}),gfe=mfe;const z5=nn(gfe);function Yr(){return Yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yr.apply(null,arguments)}var lg={dotSize:4,noteWidth:120,noteTextOffset:8},vfe=function(e){var t=typeof e;return v.isValidElement(e)||t==="string"||t==="function"||t==="object"},bfe=function(e){var t=typeof e;return t==="string"||t==="function"},ac=function(e){return e.type==="circle"},cg=function(e){return e.type==="dot"},oc=function(e){return e.type==="rect"},yfe=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,fce(t,o.match).map(function(l){var c=r(l),u=i(l);return(ac(o)||oc(o))&&(u.size=u.size+2*s,u.width=u.width+2*s,u.height=u.height+2*s),Yr({},z5(o,["match","offset"]),c,u,{size:o.size||u.size,datum:l})}))},[])},xfe=function(e,t,n,r){var i=Math.atan2(r-t,n-e);return qre(jc(i))},B5=function(e){var t,n,r=e.x,i=e.y,a=e.noteX,o=e.noteY,s=e.noteWidth,l=s===void 0?lg.noteWidth:s,c=e.noteTextOffset,u=c===void 0?lg.noteTextOffset:c;if(Ax(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(Ax(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=xfe(r,i,t,n);if(ac(e)){var p=ja(dr(h),e.size/2);d+=p.x,f+=p.y}if(oc(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 g=t,x=t;return(h+90)%360>180?(g-=l,x-=l):x+=l,{points:[[d,f],[t,n],[x,n]],text:[g,n-u],angle:h+90}},W5=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return v.useMemo(function(){return yfe({data:t,annotations:n,getPosition:r,getDimensions:i})},[t,n,r,i])},wfe=function(e){var t=e.annotations;return v.useMemo(function(){return t.map(function(n){return Yr({},n,{computed:B5(Yr({},n))})})},[t])},_fe=function(e){return v.useMemo(function(){return B5(e)},[e])},Cfe=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,a=Lt(),o=Fn(),s=o.animate,l=o.config,c=Zr({x:n,y:r,config:l,immediate:!s});return typeof i=="function"?v.createElement(i,{x:n,y:r,datum:t}):y.jsxs(y.Fragment,{children:[a.annotations.text.outlineWidth>0&&y.jsx(Ht.text,{x:c.x,y:c.y,style:Yr({},a.annotations.text,{strokeLinejoin:"round",strokeWidth:2*a.annotations.text.outlineWidth,stroke:a.annotations.text.outlineColor}),children:i}),y.jsx(Ht.text,{x:c.x,y:c.y,style:z5(a.annotations.text,["outlineWidth","outlineColor"]),children:i})]})},Fx=function(e){var t=e.points,n=e.isOutline,r=n!==void 0&&n,i=Lt(),a=v.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=Lv(a);if(r&&i.annotations.link.outlineWidth<=0)return null;var s=Yr({},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),y.jsx(Ht.path,{fill:"none",d:o,style:s})},Sfe=function(e){var t=e.x,n=e.y,r=e.size,i=Lt(),a=Fn(),o=a.animate,s=a.config,l=Zr({x:t,y:n,radius:r/2,config:s,immediate:!o});return y.jsxs(y.Fragment,{children:[i.annotations.outline.outlineWidth>0&&y.jsx(Ht.circle,{cx:l.x,cy:l.y,r:l.radius,style:Yr({},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})}),y.jsx(Ht.circle,{cx:l.x,cy:l.y,r:l.radius,style:i.annotations.outline})]})},Tfe=function(e){var t=e.x,n=e.y,r=e.size,i=r===void 0?lg.dotSize:r,a=Lt(),o=Fn(),s=o.animate,l=o.config,c=Zr({x:t,y:n,radius:i/2,config:l,immediate:!s});return y.jsxs(y.Fragment,{children:[a.annotations.outline.outlineWidth>0&&y.jsx(Ht.circle,{cx:c.x,cy:c.y,r:c.radius,style:Yr({},a.annotations.outline,{fill:"none",strokeWidth:2*a.annotations.outline.outlineWidth,stroke:a.annotations.outline.outlineColor,opacity:a.annotations.outline.outlineOpacity})}),y.jsx(Ht.circle,{cx:c.x,cy:c.y,r:c.radius,style:a.annotations.symbol})]})},$fe=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=Lt(),l=Fn(),c=l.animate,u=l.config,d=Zr({x:t-r/2,y:n-i/2,width:r,height:i,config:u,immediate:!c});return y.jsxs(y.Fragment,{children:[s.annotations.outline.outlineWidth>0&&y.jsx(Ht.rect,{x:d.x,y:d.y,rx:o,ry:o,width:d.width,height:d.height,style:Yr({},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})}),y.jsx(Ht.rect,{x:d.x,y:d.y,rx:o,ry:o,width:d.width,height:d.height,style:s.annotations.outline})]})},kfe=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,a=_fe(e);if(!vfe(i))throw new Error("note should be a valid react element");return y.jsxs(y.Fragment,{children:[y.jsx(Fx,{points:a.points,isOutline:!0}),ac(e)&&y.jsx(Sfe,{x:n,y:r,size:e.size}),cg(e)&&y.jsx(Tfe,{x:n,y:r,size:e.size}),oc(e)&&y.jsx($fe,{x:n,y:r,width:e.width,height:e.height,borderRadius:e.borderRadius}),y.jsx(Fx,{points:a.points}),y.jsx(Cfe,{datum:t,x:a.text[0],y:a.text[1],note:i})]})},zx=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)})},Mfe=function(e,t){var n=t.annotations,r=t.theme;n.length!==0&&(e.save(),n.forEach(function(i){if(!bfe(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(),zx(e,i.computed.points),e.stroke(),e.lineCap="butt"),ac(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()),cg(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()),oc(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(),zx(e,i.computed.points),e.stroke(),ac(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()),cg(i)&&(e.fillStyle=r.annotations.symbol.fill,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.fill()),oc(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())},Efe=function(e,t,n,r,i,a){a>0?(e.moveTo(t+a,n),e.lineTo(t+r-a,n),e.quadraticCurveTo(t+r,n,t+r,n+a),e.lineTo(t+r,n+i-a),e.quadraticCurveTo(t+r,n+i,t+r-a,n+i),e.lineTo(t+a,n+i),e.quadraticCurveTo(t,n+i,t,n+i-a),e.lineTo(t,n+a),e.quadraticCurveTo(t,n,t+a,n),e.closePath()):e.rect(t,n,r,i)};function kt(){return kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kt.apply(null,arguments)}function ra(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Bx,Ofe=function(e){var t=e.bars,n=e.annotations,r=W5({data:t,annotations:n,getPosition:function(i){return{x:i.x+i.width/2,y:i.y+i.height/2}},getDimensions:function(i){var a=i.height,o=i.width;return{width:o,height:a,size:Math.max(o,a)}}});return y.jsx(y.Fragment,{children:r.map(function(i,a){return y.jsx(kfe,kt({},i),a)})})},Afe=function(e){var t=e.width,n=e.height,r=e.legends,i=e.toggleSerie;return y.jsx(y.Fragment,{children:r.map(function(a,o){var s,l=a[0],c=a[1];return y.jsx(Vv,kt({},l,{containerWidth:t,containerHeight:n,data:(s=l.data)!=null?s:c,toggleSerie:l.toggleSerie&&l.dataFrom==="keys"?i:void 0}),o)})})},Rfe=["data"],Dfe=function(e){var t,n=e.bar,r=n.data,i=ra(n,Rfe),a=e.style,o=a.borderColor,s=a.color,l=a.height,c=a.labelColor,u=a.labelOpacity,d=a.labelX,f=a.labelY,h=a.transform,p=a.width,m=a.textAnchor,g=e.borderRadius,x=e.borderWidth,_=e.label,w=e.shouldRenderLabel,C=e.isInteractive,b=e.onClick,S=e.onMouseEnter,M=e.onMouseLeave,$=e.tooltip,k=e.isFocusable,R=e.ariaLabel,T=e.ariaLabelledBy,E=e.ariaDescribedBy,A=e.ariaDisabled,j=e.ariaHidden,I=Lt(),D=Ti(),O=D.showTooltipFromEvent,L=D.showTooltipAt,B=D.hideTooltip,P=v.useMemo(function(){return function(){return v.createElement($,kt({},i,r))}},[$,i,r]),H=v.useCallback(function(ee){b==null||b(kt({color:i.color},r),ee)},[i,r,b]),Y=v.useCallback(function(ee){return O(P(),ee)},[O,P]),q=v.useCallback(function(ee){S==null||S(r,ee),O(P(),ee)},[r,S,O,P]),Z=v.useCallback(function(ee){M==null||M(r,ee),B()},[r,B,M]),X=v.useCallback(function(){L(P(),[i.absX+i.width/2,i.absY])},[L,P,i]),J=v.useCallback(function(){B()},[B]);return y.jsxs(Ht.g,{transform:h,children:[y.jsx(Ht.rect,{width:Ki(p,function(ee){return Math.max(ee,0)}),height:Ki(l,function(ee){return Math.max(ee,0)}),rx:g,ry:g,fill:(t=r.fill)!=null?t:s,strokeWidth:x,stroke:o,focusable:k,tabIndex:k?0:void 0,"aria-label":R?R(r):void 0,"aria-labelledby":T?T(r):void 0,"aria-describedby":E?E(r):void 0,"aria-disabled":A?A(r):void 0,"aria-hidden":j?j(r):void 0,onMouseEnter:C?q:void 0,onMouseMove:C?Y:void 0,onMouseLeave:C?Z:void 0,onClick:C?H:void 0,onFocus:C&&k?X:void 0,onBlur:C&&k?J:void 0,"data-testid":"bar.item."+r.id+"."+r.index}),w&&y.jsx(Os,{x:d,y:f,textAnchor:m,dominantBaseline:"central",fillOpacity:u,style:kt({},I.labels.text,{pointerEvents:"none",fill:c}),children:_})]})},jfe=["color","label"],Ife=function(e){var t=e.color,n=e.label,r=ra(e,jfe);return y.jsx(nv,{id:n,value:r.formattedValue,enableChip:!0,color:t})},Ut={indexBy:"id",keys:["value"],groupMode:"stacked",layout:"vertical",valueScale:{type:"linear",nice:!0,round:!1},indexScale:{type:"band",round:!1},padding:.1,innerPadding:0,enableGridX:!1,enableGridY:!0,enableLabel:!0,label:"formattedValue",labelPosition:"middle",labelOffset:0,labelSkipWidth:0,labelSkipHeight:0,labelTextColor:{theme:"labels.text.fill"},colorBy:"id",colors:{scheme:"nivo"},borderRadius:0,borderWidth:0,borderColor:{from:"color"},isInteractive:!0,tooltip:Ife,tooltipLabel:function(e){return e.id+" - "+e.indexValue},legends:[],initialHiddenIds:[],annotations:[],enableTotals:!1,totalsOffset:10},Wt=kt({},Ut,{layers:["grid","axes","bars","totals","markers","legends","annotations"],axisTop:null,axisRight:null,axisBottom:{},axisLeft:{},barComponent:Dfe,defs:[],fill:[],markers:[],animate:!0,animateOnMount:!1,motionConfig:"default",role:"img",isFocusable:!1}),un=kt({},Ut,{layers:["grid","axes","bars","totals","legends","annotations"],axisTop:null,axisRight:null,axisBottom:{},axisLeft:{},renderBar:function(e,t){var n=t.bar,r=n.color,i=n.height,a=n.width,o=n.x,s=n.y,l=t.borderColor,c=t.borderRadius,u=t.borderWidth,d=t.label,f=t.shouldRenderLabel,h=t.labelStyle,p=t.labelX,m=t.labelY,g=t.textAnchor;e.fillStyle=r,u>0&&(e.strokeStyle=l,e.lineWidth=u),e.beginPath(),Efe(e,o,s,a,i,Math.min(c,i)),e.fill(),u>0&&e.stroke(),f&&(e.textBaseline="middle",e.textAlign=g==="middle"?"center":g,Ga(e,h,d,o+p,s+m))},pixelRatio:typeof window<"u"&&(Bx=window.devicePixelRatio)!=null?Bx:1}),U5=function(e,t,n,r,i,a){return ic(r,{all:e.map(t),min:0,max:0},i,a).padding(n)},H5=function(e,t){return e.map(function(n){return kt({},t.reduce(function(r,i){return r[i]=null,r},{}),n)})},Ch=function(e){return Object.keys(e).reduce(function(t,n){return e[n]&&(t[n]=e[n]),t},{})},Sh=function(e){return[e,Number(e)]};function V5(e,t,n,r){return e===void 0&&(e=Ut.layout),n===void 0&&(n=Ut.labelPosition),r===void 0&&(r=Ut.labelOffset),function(i,a){var o=r*(t?-1:1);if(e==="horizontal"){var s=i/2;return n==="start"?s=t?i:0:n==="end"&&(s=t?0:i),{labelX:s+o,labelY:a/2,textAnchor:n==="middle"?"middle":t?"end":"start"}}var l=a/2;return n==="start"?l=t?0:a:n==="end"&&(l=t?a:0),{labelX:i/2,labelY:l-o,textAnchor:"middle"}}}var Nfe=["layout","width","height","padding","innerPadding","valueScale","indexScale","hiddenIds"],Zv=function(e,t){return e>t},q5=function(e,t){return e<t},Y5=function(e,t){return Array.from(" ".repeat(t-e),function(n,r){return e+r})},Pfe=function(e){return Zv(e,0)?0:e},Lfe=function(e,t,n,r){var i=e.data,a=e.formatValue,o=e.getColor,s=e.getIndex,l=e.getTooltipLabel,c=e.innerPadding,u=c===void 0?0:c,d=e.keys,f=e.xScale,h=e.yScale,p=e.margin,m=n?q5:Zv,g=i.map(Ch),x=[];return d.forEach(function(_,w){return Y5(0,f.domain().length).forEach(function(C){var b,S,M,$=Sh(i[C][_]),k=$[0],R=$[1],T=s(i[C]),E=((b=f(T))!=null?b:0)+t*w+u*w,A=m(S=R,0)?(M=h(S))!=null?M:0:r,j=function(D,O){var L;return m(D,0)?r-O:((L=h(D))!=null?L:0)-r}(R,A),I={id:_,value:k===null?k:R,formattedValue:a(R),hidden:!1,index:C,indexValue:T,data:g[C]};x.push({key:_+"."+I.indexValue,index:x.length,data:I,x:E,y:A,absX:p.left+E,absY:p.top+A,width:t,height:j,color:o(I),label:l(I)})})}),x},Ffe=function(e,t,n,r){var i=e.data,a=e.formatValue,o=e.getIndex,s=e.getColor,l=e.getTooltipLabel,c=e.keys,u=e.innerPadding,d=u===void 0?0:u,f=e.xScale,h=e.yScale,p=e.margin,m=n?q5:Zv,g=i.map(Ch),x=[];return c.forEach(function(_,w){return Y5(0,h.domain().length).forEach(function(C){var b,S,M,$=Sh(i[C][_]),k=$[0],R=$[1],T=o(i[C]),E=m(S=R,0)?r:(M=f(S))!=null?M:0,A=((b=h(T))!=null?b:0)+t*w+d*w,j=function(D,O){var L;return m(D,0)?((L=f(D))!=null?L:0)-r:r-O}(R,E),I={id:_,value:k===null?k:R,formattedValue:a(R),hidden:!1,index:C,indexValue:T,data:g[C]};x.push({key:_+"."+I.indexValue,index:x.length,data:I,x:E,y:A,absX:p.left+E,absY:p.top+A,width:j,height:t,color:s(I),label:l(I)})})}),x},zfe=function(e){var t,n,r,i=e.layout,a=e.width,o=e.height,s=e.padding,l=s===void 0?0:s,c=e.innerPadding,u=c===void 0?0:c,d=e.valueScale,f=e.indexScale,h=e.hiddenIds,p=h===void 0?[]:h,m=ra(e,Nfe),g=m.keys.filter(function(O){return!p.includes(O)}),x=H5(m.data,g),_=i==="vertical"?["y","x",a]:["x","y",o],w=_[0],C=_[1],b=_[2],S=U5(x,m.getIndex,l,f,b,C),M=d.min==="auto"?Pfe:function(O){return O},$=x.reduce(function(O,L){return[].concat(O,g.map(function(B){return L[B]}))},[]).filter(Boolean),k=M(Math.min.apply(Math,$)),R=(r=Math.max.apply(Math,$),isFinite(r)?r:0),T=ic(d,{all:$,min:k,max:R},w==="x"?a:o,w),E=i==="vertical"?[S,T]:[T,S],A=E[0],j=E[1],I=(S.bandwidth()-u*(g.length-1))/g.length,D=[kt({},m,{data:x,keys:g,innerPadding:u,xScale:A,yScale:j}),I,(t=d.reverse)!=null&&t,(n=T(0))!=null?n:0];return{xScale:A,yScale:j,bars:I>0?i==="vertical"?Lfe.apply(void 0,D):Ffe.apply(void 0,D):[]}},Bfe=["data","layout","width","height","padding","valueScale","indexScale","hiddenIds"],G5=function(e){var t;return e.some(Array.isArray)?G5((t=[]).concat.apply(t,e)):e},Wfe=function(e,t,n){var r=e.formatValue,i=e.getColor,a=e.getIndex,o=e.getTooltipLabel,s=e.innerPadding,l=e.stackedData,c=e.xScale,u=e.yScale,d=e.margin,f=[];return l.forEach(function(h){return c.domain().forEach(function(p,m){var g,x,_=h[m],w=(g=c(a(_.data)))!=null?g:0,C=((x=function(R){return u(R[n?0:1])}(_))!=null?x:0)+.5*s,b=function(R,T){var E;return((E=u(R[n?1:0]))!=null?E:0)-T}(_,C)-s,S=Sh(_.data[h.key]),M=S[0],$=S[1],k={id:h.key,value:M===null?M:$,formattedValue:r($),hidden:!1,index:m,indexValue:p,data:Ch(_.data)};f.push({key:h.key+"."+p,index:f.length,data:k,x:w,y:C,absX:d.left+w,absY:d.top+C,width:t,height:b,color:i(k),label:o(k)})})}),f},Ufe=function(e,t,n){var r=e.formatValue,i=e.getColor,a=e.getIndex,o=e.getTooltipLabel,s=e.innerPadding,l=e.stackedData,c=e.xScale,u=e.yScale,d=e.margin,f=[];return l.forEach(function(h){return u.domain().forEach(function(p,m){var g,x,_=h[m],w=(g=u(a(_.data)))!=null?g:0,C=((x=function(R){return c(R[n?1:0])}(_))!=null?x:0)+.5*s,b=function(R,T){var E;return((E=c(R[n?0:1]))!=null?E:0)-T}(_,C)-s,S=Sh(_.data[h.key]),M=S[0],$=S[1],k={id:h.key,value:M===null?M:$,formattedValue:r($),hidden:!1,index:m,indexValue:p,data:Ch(_.data)};f.push({key:h.key+"."+p,index:f.length,data:k,x:C,y:w,absX:d.left+C,absY:d.top+w,width:b,height:t,color:i(k),label:o(k)})})}),f},Hfe=function(e){var t,n,r=e.data,i=e.layout,a=e.width,o=e.height,s=e.padding,l=s===void 0?0:s,c=e.valueScale,u=e.indexScale,d=e.hiddenIds,f=d===void 0?[]:d,h=ra(e,Bfe),p=h.keys.filter(function(I){return!f.includes(I)}),m=aJ().keys(p).offset(oJ)(H5(r,p)),g=i==="vertical"?["y","x",a]:["x","y",o],x=g[0],_=g[1],w=g[2],C=U5(r,h.getIndex,l,u,w,_),b=(n=G5(m),c.type==="log"?n.filter(function(I){return I!==0}):n),S=Math.min.apply(Math,b),M=Math.max.apply(Math,b),$=ic(c,{all:b,min:S,max:M},x==="x"?a:o,x),k=i==="vertical"?[C,$]:[$,C],R=k[0],T=k[1],E=h.innerPadding>0?h.innerPadding:0,A=C.bandwidth(),j=[kt({},h,{innerPadding:E,stackedData:m,xScale:R,yScale:T}),A,(t=c.reverse)!=null&&t];return{xScale:R,yScale:T,bars:A>0?i==="vertical"?Wfe.apply(void 0,j):Ufe.apply(void 0,j):[]}},Vfe=function(e){var t=e.bars,n=e.direction,r=e.from,i=e.groupMode,a=e.layout,o=e.legendLabel,s=e.reverse,l=t5(o??(r==="indexes"?"indexValue":"id"));return r==="indexes"?function(c,u,d){var f=ag(c.map(function(h){var p,m;return{id:(p=h.data.indexValue)!=null?p:"",label:d(h.data),hidden:h.data.hidden,color:(m=h.color)!=null?m:"#000"}}),function(h){return h.id});return u==="horizontal"&&f.reverse(),f}(t,a,l):function(c,u,d,f,h,p){var m=ag(c.map(function(g){var x;return{id:g.data.id,label:p(g.data),hidden:g.data.hidden,color:(x=g.color)!=null?x:"#000"}}),function(g){return g.id});return(u==="vertical"&&f==="stacked"&&d==="column"&&h!==!0||u==="horizontal"&&f==="stacked"&&h===!0)&&m.reverse(),m}(t,a,n,i,s,l)},Wx=function(e,t,n){var r=e.get(t)||0;e.set(t,r+n)},qfe=function(e,t,n){var r=e.get(t)||0;e.set(t,r+(n>0?n:0))},Yfe=function(e,t,n){var r=e.get(t)||0;e.set(t,Math.max(r,Number(n)))},Gfe=function(e,t){var n=e.get(t)||0;e.set(t,n+1)},Z5=function(e){var t,n=e.indexBy,r=n===void 0?Ut.indexBy:n,i=e.keys,a=i===void 0?Ut.keys:i,o=e.label,s=o===void 0?Ut.label:o,l=e.tooltipLabel,c=l===void 0?Ut.tooltipLabel:l,u=e.valueFormat,d=e.colors,f=d===void 0?Ut.colors:d,h=e.colorBy,p=h===void 0?Ut.colorBy:h,m=e.borderColor,g=m===void 0?Ut.borderColor:m,x=e.labelTextColor,_=x===void 0?Ut.labelTextColor:x,w=e.groupMode,C=w===void 0?Ut.groupMode:w,b=e.layout,S=b===void 0?Ut.layout:b,M=e.data,$=e.margin,k=e.width,R=e.height,T=e.padding,E=T===void 0?Ut.padding:T,A=e.innerPadding,j=A===void 0?Ut.innerPadding:A,I=e.valueScale,D=I===void 0?Ut.valueScale:I,O=e.indexScale,L=O===void 0?Ut.indexScale:O,B=e.initialHiddenIds,P=B===void 0?Ut.initialHiddenIds:B,H=e.enableLabel,Y=H===void 0?Ut.enableLabel:H,q=e.labelSkipWidth,Z=q===void 0?Ut.labelSkipWidth:q,X=e.labelSkipHeight,J=X===void 0?Ut.labelSkipHeight:X,ee=e.legends,W=ee===void 0?Ut.legends:ee,F=e.legendLabel,z=e.totalsOffset,V=z===void 0?Ut.totalsOffset:z,N=v.useState(P??[]),te=N[0],K=N[1],G=v.useCallback(function(Te){K(function(Re){return Re.indexOf(Te)>-1?Re.filter(function(at){return at!==Te}):[].concat(Re,[Te])})},[]),oe=pi(r),ne=pi(s),re=pi(c),ae=os(u),le=Lt(),ye=Wv(f,p),ge=pr(g,le),be=pr(_,le),Me=(C==="grouped"?zfe:Hfe)({layout:S,data:M,getIndex:oe,keys:a,width:k,height:R,getColor:ye,padding:E,innerPadding:j,valueScale:D,indexScale:L,hiddenIds:te,formatValue:ae,getTooltipLabel:re,margin:$}),ce=Me.bars,de=Me.xScale,Ce=Me.yScale,Ge=v.useMemo(function(){return ce.filter(function(Te){return Te.data.value!==null}).map(function(Te,Re){return kt({},Te,{index:Re})})},[ce]),we=v.useCallback(function(Te){var Re=Te.width,at=Te.height;return!!Y&&!(Z>0&&Re<Z)&&!(J>0&&at<J)},[Y,Z,J]),ve=v.useMemo(function(){return a.map(function(Te){var Re=ce.find(function(at){return at.data.id===Te});return kt({},Re,{data:kt({id:Te},Re==null?void 0:Re.data,{hidden:te.includes(Te)})})})},[te,a,ce]),Pe=(t=D.reverse)!=null&&t,Ze=v.useMemo(function(){return W.map(function(Te){return[Te,Vfe({bars:Te.dataFrom==="keys"?ve:ce,direction:Te.direction,from:Te.dataFrom,groupMode:C,layout:S,legendLabel:F,reverse:Pe})]})},[W,ve,ce,C,S,F,Pe]),_t=v.useMemo(function(){return function(Te,Re,at,Ue,mt,ut,At){Ue===void 0&&(Ue=Ut.layout),mt===void 0&&(mt=Ut.groupMode);var Ke=[];if(Te.length===0)return Ke;var Le=new Map,Ve=Te[0].width,et=Te[0].height;if(mt==="stacked"){var Fe=new Map;Te.forEach(function(ot){var Ne=ot.data,Ee=Ne.indexValue,Ye=Ne.value;Wx(Le,Ee,Number(Ye)),qfe(Fe,Ee,Number(Ye))}),Fe.forEach(function(ot,Ne){var Ee,Ye,xt,nt=Le.get(Ne)||0;Ue==="vertical"?(Ee=Re(Ne),Ye=at(ot),xt=at(ot/2)):(Ee=Re(ot),Ye=at(Ne),xt=Re(ot/2)),Ee+=Ue==="vertical"?Ve/2:ut,Ye+=Ue==="vertical"?-ut:et/2,Ke.push({key:"total_"+Ne,x:Ee,y:Ye,value:nt,formattedValue:At(nt),animationOffset:xt})})}else if(mt==="grouped"){var tt=new Map,vt=new Map;Te.forEach(function(ot){var Ne=ot.data,Ee=Ne.indexValue,Ye=Ne.value;Wx(Le,Ee,Number(Ye)),Yfe(tt,Ee,Number(Ye)),Gfe(vt,Ee)}),tt.forEach(function(ot,Ne){var Ee,Ye,xt,nt=Le.get(Ne)||0,bt=vt.get(Ne);Ue==="vertical"?(Ee=Re(Ne),Ye=at(ot),xt=at(ot/2)):(Ee=Re(ot),Ye=at(Ne),xt=Re(ot/2)),Ee+=Ue==="vertical"?bt*Ve/2:ut,Ye+=Ue==="vertical"?-ut:bt*et/2,Ke.push({key:"total_"+Ne,x:Ee,y:Ye,value:nt,formattedValue:At(nt),animationOffset:xt})})}return Ke}(ce,de,Ce,S,C,V,ae)},[ce,de,Ce,S,C,V,ae]);return{bars:ce,barsWithValue:Ge,xScale:de,yScale:Ce,getIndex:oe,getLabel:ne,getTooltipLabel:re,formatValue:ae,getColor:ye,getBorderColor:ge,getLabelColor:be,shouldRenderBarLabel:we,hiddenIds:te,toggleSerie:G,legendsWithData:Ze,barTotals:_t}},Zfe=function(e){var t=e.data,n=e.springConfig,r=e.animate,i=e.layout,a=i===void 0?Wt.layout:i,o=Lt();return Ka(t,{keys:function(s){return s.key},from:function(s){return{x:a==="vertical"?s.x:s.animationOffset,y:a==="vertical"?s.animationOffset:s.y,labelOpacity:0}},enter:function(s){return{x:s.x,y:s.y,labelOpacity:1}},update:function(s){return{x:s.x,y:s.y,labelOpacity:1}},leave:function(s){return{x:a==="vertical"?s.x:s.animationOffset,y:a==="vertical"?s.animationOffset:s.y,labelOpacity:0}},config:n,immediate:!r,initial:r?void 0:null})(function(s,l){return y.jsx(Ht.text,{x:s.x,y:s.y,fillOpacity:s.labelOpacity,style:kt({},o.labels.text,{pointerEvents:"none"}),fontWeight:"bold",fontSize:o.labels.text.fontSize,fontFamily:o.labels.text.fontFamily,textAnchor:a==="vertical"?"middle":"start",alignmentBaseline:a==="vertical"?"alphabetic":"middle",children:l.formattedValue},l.key)})},Xfe=["isInteractive","animate","motionConfig","theme","renderWrapper"],Kfe=function(e){var t,n=e.data,r=e.indexBy,i=e.keys,a=e.margin,o=e.width,s=e.height,l=e.groupMode,c=e.layout,u=e.valueScale,d=e.indexScale,f=e.padding,h=e.innerPadding,p=e.axisTop,m=e.axisRight,g=e.axisBottom,x=g===void 0?Wt.axisBottom:g,_=e.axisLeft,w=_===void 0?Wt.axisLeft:_,C=e.enableGridX,b=C===void 0?Wt.enableGridX:C,S=e.enableGridY,M=S===void 0?Wt.enableGridY:S,$=e.gridXValues,k=e.gridYValues,R=e.layers,T=R===void 0?Wt.layers:R,E=e.barComponent,A=E===void 0?Wt.barComponent:E,j=e.enableLabel,I=j===void 0?Wt.enableLabel:j,D=e.label,O=e.labelSkipWidth,L=O===void 0?Wt.labelSkipWidth:O,B=e.labelSkipHeight,P=B===void 0?Wt.labelSkipHeight:B,H=e.labelTextColor,Y=e.labelPosition,q=Y===void 0?Wt.labelPosition:Y,Z=e.labelOffset,X=Z===void 0?Wt.labelOffset:Z,J=e.markers,ee=J===void 0?Wt.markers:J,W=e.colorBy,F=e.colors,z=e.defs,V=z===void 0?Wt.defs:z,N=e.fill,te=N===void 0?Wt.fill:N,K=e.borderRadius,G=K===void 0?Wt.borderRadius:K,oe=e.borderWidth,ne=oe===void 0?Wt.borderWidth:oe,re=e.borderColor,ae=e.annotations,le=ae===void 0?Wt.annotations:ae,ye=e.legendLabel,ge=e.tooltipLabel,be=e.valueFormat,Me=e.isInteractive,ce=Me===void 0?Wt.isInteractive:Me,de=e.tooltip,Ce=de===void 0?Wt.tooltip:de,Ge=e.onClick,we=e.onMouseEnter,ve=e.onMouseLeave,Pe=e.legends,Ze=e.role,_t=Ze===void 0?Wt.role:Ze,Te=e.ariaLabel,Re=e.ariaLabelledBy,at=e.ariaDescribedBy,Ue=e.isFocusable,mt=Ue===void 0?Wt.isFocusable:Ue,ut=e.barAriaLabel,At=e.barAriaLabelledBy,Ke=e.barAriaDescribedBy,Le=e.barAriaHidden,Ve=e.barAriaDisabled,et=e.initialHiddenIds,Fe=e.enableTotals,tt=Fe===void 0?Wt.enableTotals:Fe,vt=e.totalsOffset,ot=vt===void 0?Wt.totalsOffset:vt,Ne=e.forwardedRef,Ee=Fn(),Ye=Ee.animate,xt=Ee.config,nt=oo(o,s,a),bt=nt.outerWidth,Jt=nt.outerHeight,Ft=nt.margin,Bt=nt.innerWidth,fn=nt.innerHeight,qt=Z5({indexBy:r,label:D,tooltipLabel:ge,valueFormat:be,colors:F,colorBy:W,borderColor:re,labelTextColor:H,groupMode:l,layout:c,data:n,keys:i,margin:Ft,width:Bt,height:fn,padding:f,innerPadding:h,valueScale:u,indexScale:d,enableLabel:I,labelSkipWidth:L,labelSkipHeight:P,legends:Pe,legendLabel:ye,initialHiddenIds:et,totalsOffset:ot}),$e=qt.bars,Je=qt.barsWithValue,St=qt.xScale,an=qt.yScale,Yt=qt.getLabel,ze=qt.getTooltipLabel,Be=qt.getBorderColor,ht=qt.getLabelColor,Rt=qt.shouldRenderBarLabel,Tt=qt.toggleSerie,Qe=qt.legendsWithData,$t=qt.barTotals,vr=qt.getColor,ln=V5(c,(t=u==null?void 0:u.reverse)!=null&&t,q,X),cn=Ka(Je,{keys:function(Ae){return Ae.key},from:function(Ae){return kt({borderColor:Be(Ae),color:Ae.color,height:0,labelColor:ht(Ae),labelOpacity:0},ln(Ae.width,Ae.height),{transform:"translate("+Ae.x+", "+(Ae.y+Ae.height)+")",width:Ae.width},c==="vertical"?{}:{height:Ae.height,transform:"translate("+Ae.x+", "+Ae.y+")",width:0})},enter:function(Ae){return kt({borderColor:Be(Ae),color:Ae.color,height:Ae.height,labelColor:ht(Ae),labelOpacity:1},ln(Ae.width,Ae.height),{transform:"translate("+Ae.x+", "+Ae.y+")",width:Ae.width})},update:function(Ae){return kt({borderColor:Be(Ae),color:Ae.color,height:Ae.height,labelColor:ht(Ae),labelOpacity:1},ln(Ae.width,Ae.height),{transform:"translate("+Ae.x+", "+Ae.y+")",width:Ae.width})},leave:function(Ae){return kt({borderColor:Be(Ae),color:Ae.color,height:0,labelColor:ht(Ae),labelOpacity:0},ln(Ae.width,Ae.height),{labelY:0,transform:"translate("+Ae.x+", "+(Ae.y+Ae.height)+")",width:Ae.width},c==="vertical"?{}:kt({},ln(Ae.width,Ae.height),{labelX:0,height:Ae.height,transform:"translate("+Ae.x+", "+Ae.y+")",width:0}))},config:xt,immediate:!Ye,initial:Ye?void 0:null}),An=v.useMemo(function(){return{borderRadius:G,borderWidth:ne,enableLabel:I,isInteractive:ce,labelSkipWidth:L,labelSkipHeight:P,onClick:Ge,onMouseEnter:we,onMouseLeave:ve,getTooltipLabel:ze,tooltip:Ce,isFocusable:mt,ariaLabel:ut,ariaLabelledBy:At,ariaDescribedBy:Ke,ariaHidden:Le,ariaDisabled:Ve}},[G,ne,I,ze,ce,P,L,Ge,we,ve,Ce,mt,ut,At,Ke,Le,Ve]),ia=zv(V,$e,te,{dataKey:"data",targetKey:"data.fill"}),Ct={annotations:null,axes:null,bars:null,grid:null,legends:null,markers:null,totals:null};T.includes("annotations")&&(Ct.annotations=y.jsx(Ofe,{bars:$e,annotations:le},"annotations")),T.includes("axes")&&(Ct.axes=y.jsx(k5,{xScale:St,yScale:an,width:Bt,height:fn,top:p,right:m,bottom:x,left:w},"axes")),T.includes("bars")&&(Ct.bars=y.jsx(v.Fragment,{children:cn(function(Ae,Er){return v.createElement(A,kt({},An,{bar:Er,style:Ae,shouldRenderLabel:Rt(Er),label:Yt(Er.data)}))})},"bars")),T.includes("grid")&&(Ct.grid=y.jsx(M5,{width:Bt,height:fn,xScale:b?St:null,yScale:M?an:null,xValues:$,yValues:k},"grid")),T.includes("legends")&&(Ct.legends=y.jsx(Afe,{width:Bt,height:fn,legends:Qe,toggleSerie:Tt},"legends")),T.includes("markers")&&(Ct.markers=y.jsx(JS,{markers:ee,width:Bt,height:fn,xScale:St,yScale:an},"markers")),T.includes("totals")&&tt&&(Ct.totals=y.jsx(Zfe,{data:$t,springConfig:xt,animate:Ye,layout:c},"totals"));var aa=kt({},An,{margin:Ft,width:o,height:s,innerWidth:Bt,innerHeight:fn,bars:$e,legendData:Qe,enableLabel:I,xScale:St,yScale:an,tooltip:Ce,getTooltipLabel:ze,onClick:Ge,onMouseEnter:we,onMouseLeave:ve,getColor:vr});return y.jsx(xh,{width:bt,height:Jt,margin:Ft,defs:ia,role:_t,ariaLabel:Te,ariaLabelledBy:Re,ariaDescribedBy:at,isFocusable:mt,ref:Ne,children:T.map(function(Ae,Er){var oa;return typeof Ae=="function"?y.jsx(v.Fragment,{children:v.createElement(Ae,aa)},Er):(oa=Ct==null?void 0:Ct[Ae])!=null?oa:null})})},Jfe=v.forwardRef(function(e,t){var n=e.isInteractive,r=n===void 0?Wt.isInteractive:n,i=e.animate,a=i===void 0?Wt.animate:i,o=e.motionConfig,s=o===void 0?Wt.motionConfig:o,l=e.theme,c=e.renderWrapper,u=ra(e,Xfe);return y.jsx(io,{animate:a,isInteractive:r,motionConfig:s,renderWrapper:c,theme:l,children:y.jsx(Kfe,kt({},u,{isInteractive:r,forwardedRef:t}))})}),Qfe=["isInteractive","renderWrapper","theme"],Lp=function(e,t,n,r){return e.find(function(i){return r5(i.x+t.left,i.y+t.top,i.width,i.height,n,r)})},ehe=function(e){var t,n=e.data,r=e.indexBy,i=e.keys,a=e.margin,o=e.width,s=e.height,l=e.groupMode,c=e.layout,u=e.valueScale,d=e.indexScale,f=e.padding,h=e.innerPadding,p=e.axisTop,m=e.axisRight,g=e.axisBottom,x=g===void 0?un.axisBottom:g,_=e.axisLeft,w=_===void 0?un.axisLeft:_,C=e.enableGridX,b=C===void 0?un.enableGridX:C,S=e.enableGridY,M=S===void 0?un.enableGridY:S,$=e.gridXValues,k=e.gridYValues,R=e.labelPosition,T=R===void 0?un.labelPosition:R,E=e.labelOffset,A=E===void 0?un.labelOffset:E,j=e.layers,I=j===void 0?un.layers:j,D=e.renderBar,O=D===void 0?un.renderBar:D,L=e.enableLabel,B=L===void 0?un.enableLabel:L,P=e.label,H=e.labelSkipWidth,Y=H===void 0?un.labelSkipWidth:H,q=e.labelSkipHeight,Z=q===void 0?un.labelSkipHeight:q,X=e.labelTextColor,J=e.colorBy,ee=e.colors,W=e.borderRadius,F=W===void 0?un.borderRadius:W,z=e.borderWidth,V=z===void 0?un.borderWidth:z,N=e.borderColor,te=e.annotations,K=te===void 0?un.annotations:te,G=e.legendLabel,oe=e.tooltipLabel,ne=e.valueFormat,re=e.isInteractive,ae=re===void 0?un.isInteractive:re,le=e.tooltip,ye=le===void 0?un.tooltip:le,ge=e.onClick,be=e.onMouseEnter,Me=e.onMouseLeave,ce=e.legends,de=e.pixelRatio,Ce=de===void 0?un.pixelRatio:de,Ge=e.role,we=e.forwardedRef,ve=e.enableTotals,Pe=ve===void 0?un.enableTotals:ve,Ze=e.totalsOffset,_t=Ze===void 0?un.totalsOffset:Ze,Te=v.useRef(null),Re=Lt(),at=oo(o,s,a),Ue=at.margin,mt=at.innerWidth,ut=at.innerHeight,At=at.outerWidth,Ke=at.outerHeight,Le=Z5({indexBy:r,label:P,tooltipLabel:oe,valueFormat:ne,colors:ee,colorBy:J,borderColor:N,labelTextColor:X,groupMode:l,layout:c,data:n,keys:i,margin:Ue,width:mt,height:ut,padding:f,innerPadding:h,valueScale:u,indexScale:d,enableLabel:B,labelSkipWidth:Y,labelSkipHeight:Z,legends:ce,legendLabel:G,totalsOffset:_t}),Ve=Le.bars,et=Le.barsWithValue,Fe=Le.xScale,tt=Le.yScale,vt=Le.getLabel,ot=Le.getTooltipLabel,Ne=Le.getBorderColor,Ee=Le.getLabelColor,Ye=Le.shouldRenderBarLabel,xt=Le.legendsWithData,nt=Le.barTotals,bt=Le.getColor,Jt=Ti(),Ft=Jt.showTooltipFromEvent,Bt=Jt.hideTooltip,fn=wfe({annotations:W5({data:Ve,annotations:K,getPosition:function(ze){return{x:ze.x,y:ze.y}},getDimensions:function(ze){var Be=ze.width,ht=ze.height;return{width:Be,height:ht,size:Math.max(Be,ht)}}})}),qt=v.useMemo(function(){return{borderRadius:F,borderWidth:V,isInteractive:ae,isFocusable:!1,labelSkipWidth:Y,labelSkipHeight:Z,margin:Ue,width:o,height:s,innerWidth:mt,innerHeight:ut,bars:Ve,legendData:xt,enableLabel:B,xScale:Fe,yScale:tt,tooltip:ye,getTooltipLabel:ot,onClick:ge,onMouseEnter:be,onMouseLeave:Me,getColor:bt}},[F,V,ae,Y,Z,Ue,o,s,mt,ut,Ve,xt,B,Fe,tt,ye,ot,ge,be,Me,bt]),$e=os(ne),Je=V5(c,(t=u==null?void 0:u.reverse)!=null&&t,T,A);v.useEffect(function(){if(Te.current){Te.current.width=At*Ce,Te.current.height=Ke*Ce;var ze=Te.current.getContext("2d");ze.scale(Ce,Ce),ze.fillStyle=Re.background,ze.fillRect(0,0,At,Ke),ze.translate(Ue.left,Ue.top),I.forEach(function(Be){Be==="grid"?typeof Re.grid.line.strokeWidth=="number"&&Re.grid.line.strokeWidth>0&&(ze.lineWidth=Re.grid.line.strokeWidth,ze.strokeStyle=Re.grid.line.stroke,b&&Sd(ze,{width:mt,height:ut,scale:Fe,axis:"x",values:$}),M&&Sd(ze,{width:mt,height:ut,scale:tt,axis:"y",values:k})):Be==="axes"?E5(ze,{xScale:Fe,yScale:tt,width:mt,height:ut,top:p,right:m,bottom:x,left:w,theme:Re}):Be==="bars"?(Ya(ze,Re.text),et.forEach(function(ht){O(ze,kt({bar:ht,borderColor:Ne(ht),borderRadius:F,borderWidth:V,label:vt(ht.data),shouldRenderLabel:Ye(ht),labelStyle:kt({},Re.labels.text,{fill:Ee(ht)})},Je(ht.width,ht.height)))})):Be==="legends"?xt.forEach(function(ht){var Rt=ht[0],Tt=ht[1];qv(ze,kt({},Rt,{data:Tt,containerWidth:mt,containerHeight:ut,theme:Re}))}):Be==="annotations"?Mfe(ze,{annotations:fn,theme:Re}):Be==="totals"&&Pe?function(ht,Rt,Tt,Qe){Qe===void 0&&(Qe=un.layout),Ya(ht,Tt.labels.text),ht.textBaseline=Qe==="vertical"?"alphabetic":"middle",ht.textAlign=Qe==="vertical"?"center":"start",Rt.forEach(function($t){Ga(ht,Tt.labels.text,$t.formattedValue,$t.x,$t.y)})}(ze,nt,Re,c):typeof Be=="function"&&Be(ze,qt)}),ze.save()}},[x,w,m,p,et,F,V,fn,b,M,Ne,vt,Ee,$,k,l,s,ut,mt,qt,I,c,xt,Ue.left,Ue.top,Ke,At,Ce,O,Fe,tt,Ye,Re,o,nt,Pe,$e,Je]);var St=v.useCallback(function(ze){if(Ve&&Te.current){var Be=zo(Te.current,ze),ht=Be[0],Rt=Be[1],Tt=Lp(Ve,Ue,ht,Rt);Tt!==void 0?(Ft(v.createElement(ye,kt({},Tt.data,{color:Tt.color,label:Tt.label,value:Number(Tt.data.value)})),ze),ze.type==="mouseenter"&&(be==null||be(Tt.data,ze))):Bt()}},[Bt,Ue,be,Ve,Ft,ye]),an=v.useCallback(function(ze){if(Ve&&Te.current){Bt();var Be=zo(Te.current,ze),ht=Be[0],Rt=Be[1],Tt=Lp(Ve,Ue,ht,Rt);Tt&&(Me==null||Me(Tt.data,ze))}},[Bt,Ue,Me,Ve]),Yt=v.useCallback(function(ze){if(Ve&&Te.current){var Be=zo(Te.current,ze),ht=Be[0],Rt=Be[1],Tt=Lp(Ve,Ue,ht,Rt);Tt!==void 0&&(ge==null||ge(kt({},Tt.data,{color:Tt.color}),ze))}},[Ue,ge,Ve]);return y.jsx("canvas",{ref:Bv(Te,we),width:At*Ce,height:Ke*Ce,style:{width:At,height:Ke,cursor:ae?"auto":"normal"},onMouseEnter:ae?St:void 0,onMouseMove:ae?St:void 0,onMouseLeave:ae?an:void 0,onClick:ae?Yt:void 0,role:Ge})},the=v.forwardRef(function(e,t){var n=e.isInteractive,r=e.renderWrapper,i=e.theme,a=ra(e,Qfe);return y.jsx(io,{isInteractive:n,renderWrapper:r,theme:i,animate:!1,children:y.jsx(ehe,kt({},a,{isInteractive:n,forwardedRef:t}))})}),nhe=["defaultWidth","defaultHeight","onResize","debounceResize"],rhe=v.forwardRef(function(e,t){var n=e.defaultWidth,r=e.defaultHeight,i=e.onResize,a=e.debounceResize,o=ra(e,nhe);return y.jsx(ao,{defaultWidth:n,defaultHeight:r,onResize:i,debounceResize:a,children:function(s){var l=s.width,c=s.height;return y.jsx(Jfe,kt({},o,{width:l,height:c,ref:t}))}})}),ihe=["defaultWidth","defaultHeight","onResize","debounceResize"];v.forwardRef(function(e,t){var n=e.defaultWidth,r=e.defaultHeight,i=e.onResize,a=e.debounceResize,o=ra(e,ihe);return y.jsx(ao,{defaultWidth:n,defaultHeight:r,onResize:i,debounceResize:a,children:function(s){var l=s.width,c=s.height;return y.jsx(the,kt({},o,{width:l,height:c,ref:t}))}})});exports.AbstractModalHeader=zg;exports.Alert=T0;exports.ApprovalState=wO;exports.AuthContext=Wd;exports.Backdrop=cC;exports.BaseModal=m_;exports.BootstrapModalManager=g_;exports.Button=_g;exports.Col=Cg;exports.ConfirmContext=P_;exports.ContextButton=tf;exports.CustomSelectInput=a3;exports.DelegationContext=Z_;exports.Documents=DF;exports.Dropdown=o0;exports.Dropdown$1=Yo;exports.DropdownDivider=vm;exports.DropdownItem=Ca;exports.DropdownToggle=a0;exports.ENTERED=Ni;exports.ENTERING=si;exports.EXITED=ji;exports.EXITING=Au;exports.FaMinus=WR;exports.FaPlus=UR;exports.FaSearch=HR;exports.Fade=Vi;exports.Fe=xO;exports.FileExtensionIcon=J3;exports.FloatingLabelInput=nf;exports.Form=Gr;exports.FormCheckInput=Pd;exports.FormControl=n_;exports.FormDisabledContext=Q4;exports.FormSelect=jg;exports.HelmetContext=J4;exports.HookFormSelectInput=rf;exports.HookFormTextAreaInput=r0;exports.HookFormTextInput=es;exports.HtmlTooltip=e4;exports.IconButton=wc;exports.InputAnchorContainer=n3;exports.InvalidFeedback=df;exports.ListGroup=h_;exports.ListGroupItem=Ld;exports.LoadingContext=Bd;exports.LoginState=Y_;exports.LuminusComponentsContext=rn;exports.MdCheck=lE;exports.MdCircle=sE;exports.MdClear=hc;exports.MdOutlineAddCircleOutline=bE;exports.MdOutlineArrowOutward=cE;exports.MdOutlineCallMade=gE;exports.MdOutlineCameraAlt=SE;exports.MdOutlineChevronRight=ME;exports.MdOutlineClose=I_;exports.MdOutlineDelete=j_;exports.MdOutlineEdit=TE;exports.MdOutlineExpand=dE;exports.MdOutlineFileUpload=wE;exports.MdOutlineKeyboardArrowLeft=_E;exports.MdOutlineKeyboardArrowRight=CE;exports.MdOutlineMenu=EE;exports.MdOutlineMessage=vE;exports.MdOutlinePhotoLibrary=$E;exports.MdOutlineSource=hE;exports.MdOutlineStar=RE;exports.MdOutlineSubdirectoryArrowRight=AE;exports.MdSave=oE;exports.MdSaveAs=aE;exports.MdSearch=iE;exports.Me=Jle;exports.MiniDetailWrapper=i3;exports.Modal=Vn;exports.ModalContext=Lg;exports.NoInputContainer=t3;exports.OverlayTrigger=A_;exports.PageContainer=rz;exports.PiPushPinBold=tF;exports.PiPushPinSlashBold=nF;exports.PrimaryButton=za;exports.PromptContext=L_;exports.PropTypes=xe;exports.ResponsiveContextDropdown=sC;exports.ResponsiveContextDropdownItem=w0;exports.RowLabelInput=_c;exports.ShortcutLinksContext=Bz;exports.SideContentBar=Q3;exports.SimpleDropdownToggle=i0;exports.SimplePicker=lC;exports.SimpleTooltip=Hg;exports.Spinner=Wg;exports.TextInput=r3;exports.Tooltip=E_;exports.TransitionWrapper=vg;exports.Typography=In;exports.UserContext=G_;exports.Xe=rhe;exports.a=_0;exports.addLeadingZeros=Pt;exports.addMilliseconds=Hx;exports.arrayType=q4;exports.atobUtf8=n4;exports.axios=Zt;exports.buildEmployeeNameString=FO;exports.buildOrgUnitString=zO;exports.buildVehicleNameString=LO;exports.cancelToken=XA;exports.capitalizeFirstLetter=PO;exports.classNames=se;exports.classes=mm;exports.classes$1=o3;exports.compareDate=UO;exports.compareDateTime=HO;exports.compilerRuntimeExports=Ie;exports.constructFrom=gi;exports.context=Id;exports.differenceInCalendarDays=Xx;exports.dist=C0;exports.divWithClassName=bg;exports.extractErrorsFromBlobResponse=J_;exports.extractErrorsFromResponse=Ud;exports.extractFilename=s4;exports.extractPermissionsFromResponse=Q_;exports.fixNameIdNulls=X_;exports.format=hg;exports.formatDate=IO;exports.formatDateTime=NO;exports.formatFileSize=Go;exports.getChildRef=cs;exports.getDateString=XO;exports.getDaysDifference=VO;exports.getFirstDayOfMonth=a4;exports.getFirstDayOfOffsetMonth=qO;exports.getFirstDayOfYear=GO;exports.getLastDayOfMonth=o4;exports.getLastDayOfOffsetMonth=YO;exports.getLastDayOfYear=ZO;exports.getSharedManager=v_;exports.getTimezoneOffsetInMilliseconds=Bp;exports.hasOnlyNullValues=K_;exports.hookFormSetServerErrors=CO;exports.isExtensionOpenable=c4;exports.isFileOpenable=l4;exports.isISODate=r4;exports.isISODateInValidRange=i4;exports.isLeavingWindowInSafari=hB;exports.isPast=Qx;exports.isPrimitive=zu;exports.isSafari=S0;exports.isValidDate=WO;exports.joinStrings=Vg;exports.makeDispatch=mB;exports.millisecondsInHour=kd;exports.millisecondsInMinute=dg;exports.millisecondsInWeek=ug;exports.msToStartOfNextDay=BO;exports.objectType=di;exports.once=uC;exports.parseISO=sc;exports.replaceNullValuesOnlyObjectsWithNulls=_O;exports.saveFile=Bu;exports.saveFileFromResponse=QO;exports.secondsInDay=fg;exports.secondsInHour=Vx;exports.secondsInMinute=gT;exports.secondsInMonth=Yx;exports.secondsInQuarter=bT;exports.secondsInWeek=vT;exports.secondsInYear=qx;exports.shortenText=jO;exports.startOfDay=zp;exports.startOfWeek=Bo;exports.stringContains=om;exports.stringSearchWithin=qg;exports.stringStartsWith=u4;exports.stringType=e0;exports.style=Wi;exports.t=af;exports.te=gae;exports.toDate=Ln;exports.transitionEndListener=uw;exports.triggerBrowserReflow=dw;exports.trimIsoDate=Hd;exports.truncateText=t4;exports.u=K3;exports.urlfyArray=am;exports.useAuth=N4;exports.useAxios=Kd;exports.useBootstrapBreakpoints=rw;exports.useBootstrapMinBreakpoint=iw;exports.useBootstrapPrefix=gt;exports.useClickOutside=G4;exports.useClipboard=K4;exports.useCol=xw;exports.useConfirm=Jg;exports.useCookies=Kg;exports.useEventCallback=Hi;exports.useFormControlType=t0;exports.useFormDisabledContext=ef;exports.useIsomorphicEffect=Rg;exports.useKeyPress=X4;exports.useNotifications=Xd;exports.usePermissions=Z4;exports.usePrompt=F_;exports.useSwipeable=y0;exports.useWindowSize=xc;exports.useZodSchemaTypes=Qd;exports.z=il;
285
+ `,fill:i,opacity:o,strokeWidth:l,stroke:c===void 0?"transparent":c,style:{pointerEvents:"none"}})})};function Bi(){return Bi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bi.apply(null,arguments)}var lr={translateX:0,translateY:0,padding:0,itemsSpacing:0,itemDirection:"left-to-right",justify:!1,symbolShape:"square",symbolSize:16,symbolSpacing:8},tae={top:0,right:0,bottom:0,left:0},Hv=function(e){var t,n=e.direction,r=e.itemsSpacing,i=e.padding,a=e.itemCount,o=e.itemWidth,s=e.itemHeight;if(typeof i!="number"&&(typeof(t=i)!="object"||Array.isArray(t)||t===null))throw new Error("Invalid property padding, must be one of: number, object");var l=typeof i=="number"?{top:i,right:i,bottom:i,left:i}:Bi({},tae,i),c=l.left+l.right,u=l.top+l.bottom,d=o+c,f=s+u,h=(a-1)*r;return n==="row"?d=o*a+h+c:n==="column"&&(f=s*a+h+u),{width:d,height:f,padding:l}},d5=function(e){var t=e.anchor,n=e.translateX,r=e.translateY,i=e.containerWidth,a=e.containerHeight,o=e.width,s=e.height,l=n,c=r;switch(t){case"top":l+=(i-o)/2;break;case"top-right":l+=i-o;break;case"right":l+=i-o,c+=(a-s)/2;break;case"bottom-right":l+=i-o,c+=a-s;break;case"bottom":l+=(i-o)/2,c+=a-s;break;case"bottom-left":c+=a-s;break;case"left":c+=(a-s)/2;break;case"center":l+=(i-o)/2,c+=(a-s)/2}return{x:l,y:c}},f5=function(e){var t,n,r,i,a,o,s=e.direction,l=e.justify,c=e.symbolSize,u=e.symbolSpacing,d=e.width,f=e.height;switch(s){case"left-to-right":t=0,n=(f-c)/2,i=f/2,o="central",l?(r=d,a="end"):(r=c+u,a="start");break;case"right-to-left":t=d-c,n=(f-c)/2,i=f/2,o="central",l?(r=0,a="start"):(r=d-c-u,a="end");break;case"top-to-bottom":t=(d-c)/2,n=0,r=d/2,a="middle",l?(i=f,o="alphabetic"):(i=c+u,o="text-before-edge");break;case"bottom-to-top":t=(d-c)/2,n=f-c,r=d/2,a="middle",l?(i=0,o="text-before-edge"):(i=f-c-u,o="alphabetic")}return{symbolX:t,symbolY:n,labelX:r,labelY:i,labelAnchor:a,labelAlignment:o}},nae={circle:Kie,diamond:Jie,square:Qie,triangle:eae},rae=function(e){var t,n,r,i,a,o,s,l,c,u,d,f=e.x,h=e.y,p=e.width,m=e.height,g=e.data,x=e.direction,_=x===void 0?lr.itemDirection:x,w=e.justify,C=w===void 0?lr.justify:w,b=e.textColor,S=e.background,M=S===void 0?"transparent":S,$=e.opacity,k=$===void 0?1:$,R=e.symbolShape,T=R===void 0?lr.symbolShape:R,E=e.symbolSize,A=E===void 0?lr.symbolSize:E,j=e.symbolSpacing,I=j===void 0?lr.symbolSpacing:j,D=e.symbolBorderWidth,O=D===void 0?0:D,L=e.symbolBorderColor,B=L===void 0?"transparent":L,P=e.onClick,H=e.onMouseEnter,Y=e.onMouseLeave,q=e.toggleSerie,Z=e.effects,X=v.useState({}),J=X[0],ee=X[1],W=Lt(),F=v.useCallback(function(le){if(Z){var ye=Z.filter(function(ge){return ge.on==="hover"}).reduce(function(ge,be){return Bi({},ge,be.style)},{});ee(ye)}H==null||H(g,le)},[H,g,Z]),z=v.useCallback(function(le){if(Z){var ye=Z.filter(function(ge){return ge.on!=="hover"}).reduce(function(ge,be){return Bi({},ge,be.style)},{});ee(ye)}Y==null||Y(g,le)},[Y,g,Z]),V=f5({direction:_,justify:C,symbolSize:(t=J.symbolSize)!=null?t:A,symbolSpacing:I,width:p,height:m}),N=V.symbolX,te=V.symbolY,K=V.labelX,G=V.labelY,oe=V.labelAnchor,ne=V.labelAlignment,re=[P,H,Y,q].some(function(le){return le!==void 0}),ae=typeof T=="function"?T:nae[T];return y.jsxs("g",{transform:"translate("+f+","+h+")",style:{opacity:(n=J.itemOpacity)!=null?n:k},children:[y.jsx("rect",{width:p,height:m,fill:(r=J.itemBackground)!=null?r:M,style:{cursor:re?"pointer":"auto"},onClick:function(le){P==null||P(g,le),q==null||q(g.id)},onMouseEnter:F,onMouseLeave:z}),fe.createElement(ae,Bi({id:g.id,x:N,y:te,size:(i=J.symbolSize)!=null?i:A,fill:(a=(o=g.fill)!=null?o:g.color)!=null?a:"black",borderWidth:(s=J.symbolBorderWidth)!=null?s:O,borderColor:(l=J.symbolBorderColor)!=null?l:B},g.hidden?W.legends.hidden.symbol:void 0)),y.jsx(Os,{textAnchor:oe,style:Bi({},W.legends.text,{fill:(c=(u=(d=J.itemTextColor)!=null?d:b)!=null?u:W.legends.text.fill)!=null?c:"black",dominantBaseline:ne,pointerEvents:"none",userSelect:"none"},g.hidden?W.legends.hidden.text:void 0),x:K,y:G,children:g.label})]})},iae=function(e){var t=e.data,n=e.x,r=e.y,i=e.direction,a=e.padding,o=a===void 0?lr.padding:a,s=e.justify,l=e.effects,c=e.itemWidth,u=e.itemHeight,d=e.itemDirection,f=d===void 0?lr.itemDirection:d,h=e.itemsSpacing,p=h===void 0?lr.itemsSpacing:h,m=e.itemTextColor,g=e.itemBackground,x=g===void 0?"transparent":g,_=e.itemOpacity,w=_===void 0?1:_,C=e.symbolShape,b=e.symbolSize,S=e.symbolSpacing,M=e.symbolBorderWidth,$=e.symbolBorderColor,k=e.onClick,R=e.onMouseEnter,T=e.onMouseLeave,E=e.toggleSerie,A=Hv({itemCount:t.length,itemWidth:c,itemHeight:u,itemsSpacing:p,direction:i,padding:o}).padding,j=i==="row"?c+p:0,I=i==="column"?u+p:0;return y.jsx("g",{transform:"translate("+n+","+r+")",children:t.map(function(D,O){return y.jsx(rae,{data:D,x:O*j+A.left,y:O*I+A.top,width:c,height:u,direction:f,justify:s,effects:l,textColor:m,background:x,opacity:w,symbolShape:C,symbolSize:b,symbolSpacing:S,symbolBorderWidth:M,symbolBorderColor:$,onClick:k,onMouseEnter:R,onMouseLeave:T,toggleSerie:E},O)})})},Vv=function(e){var t=e.data,n=e.containerWidth,r=e.containerHeight,i=e.translateX,a=i===void 0?lr.translateX:i,o=e.translateY,s=o===void 0?lr.translateY:o,l=e.anchor,c=e.direction,u=e.padding,d=u===void 0?lr.padding:u,f=e.justify,h=e.itemsSpacing,p=h===void 0?lr.itemsSpacing:h,m=e.itemWidth,g=e.itemHeight,x=e.itemDirection,_=e.itemTextColor,w=e.itemBackground,C=e.itemOpacity,b=e.symbolShape,S=e.symbolSize,M=e.symbolSpacing,$=e.symbolBorderWidth,k=e.symbolBorderColor,R=e.onClick,T=e.onMouseEnter,E=e.onMouseLeave,A=e.toggleSerie,j=e.effects,I=Hv({itemCount:t.length,itemsSpacing:p,itemWidth:m,itemHeight:g,direction:c,padding:d}),D=I.width,O=I.height,L=d5({anchor:l,translateX:a,translateY:s,containerWidth:n,containerHeight:r,width:D,height:O}),B=L.x,P=L.y;return y.jsx(iae,{data:t,x:B,y:P,direction:c,padding:d,justify:f,effects:j,itemsSpacing:p,itemWidth:m,itemHeight:g,itemDirection:x,itemTextColor:_,itemBackground:w,itemOpacity:C,symbolShape:b,symbolSize:S,symbolSpacing:M,symbolBorderWidth:$,symbolBorderColor:k,onClick:R,onMouseEnter:T,onMouseLeave:E,toggleSerie:typeof A=="boolean"?void 0:A})},aae={start:"left",middle:"center",end:"right"},qv=function(e,t){var n=t.data,r=t.containerWidth,i=t.containerHeight,a=t.translateX,o=a===void 0?0:a,s=t.translateY,l=s===void 0?0:s,c=t.anchor,u=t.direction,d=t.padding,f=d===void 0?0:d,h=t.justify,p=h!==void 0&&h,m=t.itemsSpacing,g=m===void 0?0:m,x=t.itemWidth,_=t.itemHeight,w=t.itemDirection,C=w===void 0?"left-to-right":w,b=t.itemTextColor,S=t.symbolSize,M=S===void 0?16:S,$=t.symbolSpacing,k=$===void 0?8:$,R=t.theme,T=Hv({itemCount:n.length,itemWidth:x,itemHeight:_,itemsSpacing:g,direction:u,padding:f}),E=T.width,A=T.height,j=T.padding,I=d5({anchor:c,translateX:o,translateY:l,containerWidth:r,containerHeight:i,width:E,height:A}),D=I.x,O=I.y,L=u==="row"?x+g:0,B=u==="column"?_+g:0;e.save(),e.translate(D,O),Ya(e,R.legends.text),n.forEach(function(P,H){var Y,q=H*L+j.left,Z=H*B+j.top,X=f5({direction:C,justify:p,symbolSize:M,symbolSpacing:k,width:x,height:_}),J=X.symbolX,ee=X.symbolY,W=X.labelX,F=X.labelY,z=X.labelAnchor,V=X.labelAlignment;e.fillStyle=(Y=P.color)!=null?Y:"black",e.fillRect(q+J,Z+ee,M,M),e.textAlign=aae[z],V==="central"&&(e.textBaseline="middle"),Ga(e,Bi({},R.legends.text,{fill:b??R.legends.text.fill}),String(P.label),q+W,Z+F)}),e.restore()};function mr(){return mr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mr.apply(null,arguments)}function Ic(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var gx,oae=function(e){var t=e.width,n=e.height,r=e.legends,i=e.data,a=e.toggleSerie;return y.jsx(y.Fragment,{children:r.map(function(o,s){var l;return y.jsx(Vv,mr({},o,{containerWidth:t,containerHeight:n,data:(l=o.data)!=null?l:i,toggleSerie:o.toggleSerie?a:void 0}),s)})})},me={id:"id",value:"value",sortByValue:!1,innerRadius:0,padAngle:0,cornerRadius:0,layers:["arcs","arcLinkLabels","arcLabels","legends"],startAngle:0,endAngle:360,fit:!0,activeInnerRadiusOffset:0,activeOuterRadiusOffset:0,borderWidth:0,borderColor:{from:"color",modifiers:[["darker",1]]},enableArcLabels:!0,arcLabel:"formattedValue",arcLabelsSkipAngle:0,arcLabelsSkipRadius:0,arcLabelsRadiusOffset:.5,arcLabelsTextColor:{theme:"labels.text.fill"},enableArcLinkLabels:!0,arcLinkLabel:"id",arcLinkLabelsSkipAngle:0,arcLinkLabelsOffset:0,arcLinkLabelsDiagonalLength:16,arcLinkLabelsStraightLength:24,arcLinkLabelsThickness:1,arcLinkLabelsTextOffset:6,arcLinkLabelsTextColor:{theme:"labels.text.fill"},arcLinkLabelsColor:{theme:"axis.ticks.line.stroke"},colors:{scheme:"nivo"},defs:[],fill:[],isInteractive:!0,animate:!0,motionConfig:"gentle",transitionMode:"innerRadius",tooltip:function(e){var t=e.datum;return y.jsx(nv,{id:t.id,value:t.formattedValue,enableChip:!0,color:t.color})},legends:[],role:"img",pixelRatio:typeof window<"u"&&(gx=window.devicePixelRatio)!=null?gx:1},sae=["points"],h5=function(e){var t=e.data,n=e.id,r=n===void 0?me.id:n,i=e.value,a=i===void 0?me.value:i,o=e.valueFormat,s=e.colors,l=s===void 0?me.colors:s,c=pi(r),u=pi(a),d=os(o),f=Wv(l,"id");return v.useMemo(function(){return t.map(function(h){var p,m=c(h),g=u(h),x={id:m,label:(p=h.label)!=null?p:m,hidden:!1,value:g,formattedValue:d(g),data:h};return mr({},x,{color:f(x)})})},[t,c,u,d,f])},lae=function(e){var t=e.data,n=e.startAngle,r=e.endAngle,i=e.innerRadius,a=e.outerRadius,o=e.padAngle,s=e.sortByValue,l=e.activeId,c=e.activeInnerRadiusOffset,u=e.activeOuterRadiusOffset,d=e.hiddenIds,f=e.forwardLegendData,h=v.useMemo(function(){var x=FK().value(function(_){return _.value}).startAngle(dr(n)).endAngle(dr(r)).padAngle(dr(o));return s||x.sortValues(null),x},[n,r,o,s]),p=v.useMemo(function(){var x=t.filter(function(_){return!d.includes(_.id)});return{dataWithArc:h(x).map(function(_){var w=Math.abs(_.endAngle-_.startAngle);return mr({},_.data,{arc:{index:_.index,startAngle:_.startAngle,endAngle:_.endAngle,innerRadius:l===_.data.id?i-c:i,outerRadius:l===_.data.id?a+u:a,thickness:a-i,padAngle:_.padAngle,angle:w,angleDeg:jc(w)}})}),legendData:t.map(function(_){return{id:_.id,label:_.label,color:_.color,hidden:d.includes(_.id),data:_}})}},[h,t,d,l,i,c,a,u]),m=p.legendData,g=v.useRef(f);return v.useEffect(function(){typeof g.current=="function"&&g.current(m)},[g,m]),p},cae=function(e){var t=e.activeId,n=e.onActiveIdChange,r=e.defaultActiveId,i=t!==void 0,a=v.useState(i||r===void 0?null:r),o=a[0],s=a[1];return{activeId:i?t:o,setActiveId:v.useCallback(function(l){n&&n(l),i||s(l)},[i,n,s])}},p5=function(e){var t=e.data,n=e.width,r=e.height,i=e.innerRadius,a=i===void 0?me.innerRadius:i,o=e.startAngle,s=o===void 0?me.startAngle:o,l=e.endAngle,c=l===void 0?me.endAngle:l,u=e.padAngle,d=u===void 0?me.padAngle:u,f=e.sortByValue,h=f===void 0?me.sortByValue:f,p=e.cornerRadius,m=p===void 0?me.cornerRadius:p,g=e.fit,x=g===void 0?me.fit:g,_=e.activeInnerRadiusOffset,w=_===void 0?me.activeInnerRadiusOffset:_,C=e.activeOuterRadiusOffset,b=C===void 0?me.activeOuterRadiusOffset:C,S=e.activeId,M=e.onActiveIdChange,$=e.defaultActiveId,k=e.forwardLegendData,R=cae({activeId:S,onActiveIdChange:M,defaultActiveId:$}),T=R.activeId,E=R.setActiveId,A=v.useState([]),j=A[0],I=A[1],D=v.useMemo(function(){var B,P=Math.min(n,r)/2,H=P*Math.min(a,1),Y=n/2,q=r/2;if(x){var Z=Yie(Y,q,P,s-90,c-90),X=Z.points,J=Ic(Z,sae),ee=Math.min(n/J.width,r/J.height),W={width:J.width*ee,height:J.height*ee};W.x=(n-W.width)/2,W.y=(r-W.height)/2,Y=(Y-J.x)/J.width*J.width*ee+W.x,q=(q-J.y)/J.height*J.height*ee+W.y,B={box:J,ratio:ee,points:X},P*=ee,H*=ee}return{centerX:Y,centerY:q,radius:P,innerRadius:H,debug:B}},[n,r,a,s,c,x]),O=lae({data:t,startAngle:s,endAngle:c,innerRadius:D.innerRadius,outerRadius:D.radius,padAngle:d,sortByValue:h,activeId:T,activeInnerRadiusOffset:w,activeOuterRadiusOffset:b,hiddenIds:j,forwardLegendData:k}),L=v.useCallback(function(B){I(function(P){return P.indexOf(B)>-1?P.filter(function(H){return H!==B}):[].concat(P,[B])})},[]);return mr({arcGenerator:Xie({cornerRadius:m,padAngle:dr(d)}),activeId:T,setActiveId:E,toggleSerie:L},O,D)},uae=function(e){var t=e.dataWithArc,n=e.arcGenerator,r=e.centerX,i=e.centerY,a=e.radius,o=e.innerRadius;return v.useMemo(function(){return{dataWithArc:t,arcGenerator:n,centerX:r,centerY:i,radius:a,innerRadius:o}},[t,n,r,i,a,o])},dae=function(e){var t=e.center,n=e.data,r=e.arcGenerator,i=e.borderWidth,a=e.borderColor,o=e.isInteractive,s=e.onClick,l=e.onMouseEnter,c=e.onMouseMove,u=e.onMouseLeave,d=e.setActiveId,f=e.tooltip,h=e.transitionMode,p=Ti(),m=p.showTooltipFromEvent,g=p.hideTooltip,x=v.useMemo(function(){if(o)return function(b,S){s==null||s(b,S)}},[o,s]),_=v.useMemo(function(){if(o)return function(b,S){m(v.createElement(f,{datum:b}),S),d(b.id),l==null||l(b,S)}},[o,m,d,l,f]),w=v.useMemo(function(){if(o)return function(b,S){m(v.createElement(f,{datum:b}),S),c==null||c(b,S)}},[o,m,c,f]),C=v.useMemo(function(){if(o)return function(b,S){g(),d(null),u==null||u(b,S)}},[o,g,d,u]);return y.jsx(qie,{center:t,data:n,arcGenerator:r,borderWidth:i,borderColor:a,transitionMode:h,onClick:x,onMouseEnter:_,onMouseMove:w,onMouseLeave:C})},fae=["isInteractive","animate","motionConfig","theme","renderWrapper"],hae=function(e){var t=e.data,n=e.id,r=n===void 0?me.id:n,i=e.value,a=i===void 0?me.value:i,o=e.valueFormat,s=e.sortByValue,l=s===void 0?me.sortByValue:s,c=e.layers,u=c===void 0?me.layers:c,d=e.startAngle,f=d===void 0?me.startAngle:d,h=e.endAngle,p=h===void 0?me.endAngle:h,m=e.padAngle,g=m===void 0?me.padAngle:m,x=e.fit,_=x===void 0?me.fit:x,w=e.innerRadius,C=w===void 0?me.innerRadius:w,b=e.cornerRadius,S=b===void 0?me.cornerRadius:b,M=e.activeInnerRadiusOffset,$=M===void 0?me.activeInnerRadiusOffset:M,k=e.activeOuterRadiusOffset,R=k===void 0?me.activeOuterRadiusOffset:k,T=e.width,E=e.height,A=e.margin,j=e.colors,I=j===void 0?me.colors:j,D=e.borderWidth,O=D===void 0?me.borderWidth:D,L=e.borderColor,B=L===void 0?me.borderColor:L,P=e.enableArcLabels,H=P===void 0?me.enableArcLabels:P,Y=e.arcLabel,q=Y===void 0?me.arcLabel:Y,Z=e.arcLabelsSkipAngle,X=Z===void 0?me.arcLabelsSkipAngle:Z,J=e.arcLabelsSkipRadius,ee=J===void 0?me.arcLabelsSkipRadius:J,W=e.arcLabelsTextColor,F=W===void 0?me.arcLabelsTextColor:W,z=e.arcLabelsRadiusOffset,V=z===void 0?me.arcLabelsRadiusOffset:z,N=e.arcLabelsComponent,te=e.enableArcLinkLabels,K=te===void 0?me.enableArcLinkLabels:te,G=e.arcLinkLabel,oe=G===void 0?me.arcLinkLabel:G,ne=e.arcLinkLabelsSkipAngle,re=ne===void 0?me.arcLinkLabelsSkipAngle:ne,ae=e.arcLinkLabelsOffset,le=ae===void 0?me.arcLinkLabelsOffset:ae,ye=e.arcLinkLabelsDiagonalLength,ge=ye===void 0?me.arcLinkLabelsDiagonalLength:ye,be=e.arcLinkLabelsStraightLength,Me=be===void 0?me.arcLinkLabelsStraightLength:be,ce=e.arcLinkLabelsThickness,de=ce===void 0?me.arcLinkLabelsThickness:ce,Ce=e.arcLinkLabelsTextOffset,Ge=Ce===void 0?me.arcLinkLabelsTextOffset:Ce,we=e.arcLinkLabelsTextColor,ve=we===void 0?me.arcLinkLabelsTextColor:we,Pe=e.arcLinkLabelsColor,Ze=Pe===void 0?me.arcLinkLabelsColor:Pe,_t=e.arcLinkLabelComponent,Te=e.defs,Re=Te===void 0?me.defs:Te,at=e.fill,Ue=at===void 0?me.fill:at,mt=e.isInteractive,ut=mt===void 0?me.isInteractive:mt,At=e.onClick,Ke=e.onMouseEnter,Le=e.onMouseMove,Ve=e.onMouseLeave,et=e.tooltip,Fe=et===void 0?me.tooltip:et,tt=e.activeId,vt=e.onActiveIdChange,ot=e.defaultActiveId,Ne=e.transitionMode,Ee=Ne===void 0?me.transitionMode:Ne,Ye=e.legends,xt=Ye===void 0?me.legends:Ye,nt=e.forwardLegendData,bt=e.role,Jt=bt===void 0?me.role:bt,Ft=e.forwardedRef,Bt=oo(T,E,A),fn=Bt.outerWidth,qt=Bt.outerHeight,$e=Bt.margin,Je=Bt.innerWidth,St=Bt.innerHeight,an=h5({data:t,id:r,value:a,valueFormat:o,colors:I}),Yt=p5({data:an,width:Je,height:St,fit:_,innerRadius:C,startAngle:f,endAngle:p,padAngle:g,sortByValue:l,cornerRadius:S,activeInnerRadiusOffset:$,activeOuterRadiusOffset:R,activeId:tt,onActiveIdChange:vt,defaultActiveId:ot,forwardLegendData:nt}),ze=Yt.dataWithArc,Be=Yt.legendData,ht=Yt.arcGenerator,Rt=Yt.centerX,Tt=Yt.centerY,Qe=Yt.radius,$t=Yt.innerRadius,vr=Yt.setActiveId,ln=Yt.toggleSerie,cn=zv(Re,ze,Ue),An={arcs:null,arcLinkLabels:null,arcLabels:null,legends:null};u.includes("arcs")&&(An.arcs=y.jsx(dae,{center:[Rt,Tt],data:ze,arcGenerator:ht,borderWidth:O,borderColor:B,isInteractive:ut,onClick:At,onMouseEnter:Ke,onMouseMove:Le,onMouseLeave:Ve,setActiveId:vr,tooltip:Fe,transitionMode:Ee},"arcs")),K&&u.includes("arcLinkLabels")&&(An.arcLinkLabels=y.jsx(Fie,{center:[Rt,Tt],data:ze,label:oe,skipAngle:re,offset:le,diagonalLength:ge,straightLength:Me,strokeWidth:de,textOffset:Ge,textColor:ve,linkColor:Ze,component:_t},"arcLinkLabels")),H&&u.includes("arcLabels")&&(An.arcLabels=y.jsx(Eie,{center:[Rt,Tt],data:ze,label:q,radiusOffset:V,skipAngle:X,skipRadius:ee,textColor:F,transitionMode:Ee,component:N},"arcLabels")),xt.length>0&&u.includes("legends")&&(An.legends=y.jsx(oae,{width:Je,height:St,data:Be,legends:xt,toggleSerie:ln},"legends"));var ia=uae({dataWithArc:ze,arcGenerator:ht,centerX:Rt,centerY:Tt,radius:Qe,innerRadius:$t});return y.jsx(xh,{width:fn,height:qt,margin:$e,defs:cn,role:Jt,ref:Ft,children:u.map(function(Ct,aa){return An[Ct]!==void 0?An[Ct]:typeof Ct=="function"?y.jsx(v.Fragment,{children:v.createElement(Ct,ia)},aa):null})})},pae=v.forwardRef(function(e,t){var n=e.isInteractive,r=n===void 0?me.isInteractive:n,i=e.animate,a=i===void 0?me.animate:i,o=e.motionConfig,s=o===void 0?me.motionConfig:o,l=e.theme,c=e.renderWrapper,u=Ic(e,fae);return y.jsx(io,{animate:a,isInteractive:r,motionConfig:s,renderWrapper:c,theme:l,children:y.jsx(hae,mr({isInteractive:r},u,{forwardedRef:t}))})}),mae=["defaultWidth","defaultHeight","onResize","debounceResize"],gae=v.forwardRef(function(e,t){var n=e.defaultWidth,r=e.defaultHeight,i=e.onResize,a=e.debounceResize,o=Ic(e,mae);return y.jsx(ao,{defaultWidth:n,defaultHeight:r,onResize:i,debounceResize:a,children:function(s){var l=s.width,c=s.height;return y.jsx(pae,mr({width:l,height:c},o,{ref:t}))}})}),vae=["isInteractive","theme","renderWrapper"],bae=function(e){var t=e.data,n=e.id,r=n===void 0?me.id:n,i=e.value,a=i===void 0?me.value:i,o=e.valueFormat,s=e.sortByValue,l=s===void 0?me.sortByValue:s,c=e.startAngle,u=c===void 0?me.startAngle:c,d=e.endAngle,f=d===void 0?me.endAngle:d,h=e.padAngle,p=h===void 0?me.padAngle:h,m=e.fit,g=m===void 0?me.fit:m,x=e.innerRadius,_=x===void 0?me.innerRadius:x,w=e.cornerRadius,C=w===void 0?me.cornerRadius:w,b=e.activeInnerRadiusOffset,S=b===void 0?me.activeInnerRadiusOffset:b,M=e.activeOuterRadiusOffset,$=M===void 0?me.activeOuterRadiusOffset:M,k=e.width,R=e.height,T=e.margin,E=e.pixelRatio,A=E===void 0?me.pixelRatio:E,j=e.colors,I=j===void 0?me.colors:j,D=e.borderWidth,O=D===void 0?me.borderWidth:D,L=e.borderColor,B=L===void 0?me.borderColor:L,P=e.enableArcLabels,H=P===void 0?me.enableArcLabels:P,Y=e.arcLabel,q=Y===void 0?me.arcLabel:Y,Z=e.arcLabelsSkipAngle,X=Z===void 0?me.arcLabelsSkipAngle:Z,J=e.arcLabelsTextColor,ee=J===void 0?me.arcLabelsTextColor:J,W=e.arcLabelsRadiusOffset,F=W===void 0?me.arcLabelsRadiusOffset:W,z=e.enableArcLinkLabels,V=z===void 0?me.enableArcLinkLabels:z,N=e.arcLinkLabel,te=N===void 0?me.arcLinkLabel:N,K=e.arcLinkLabelsSkipAngle,G=K===void 0?me.arcLinkLabelsSkipAngle:K,oe=e.arcLinkLabelsOffset,ne=oe===void 0?me.arcLinkLabelsOffset:oe,re=e.arcLinkLabelsDiagonalLength,ae=re===void 0?me.arcLinkLabelsDiagonalLength:re,le=e.arcLinkLabelsStraightLength,ye=le===void 0?me.arcLinkLabelsStraightLength:le,ge=e.arcLinkLabelsThickness,be=ge===void 0?me.arcLinkLabelsThickness:ge,Me=e.arcLinkLabelsTextOffset,ce=Me===void 0?me.arcLinkLabelsTextOffset:Me,de=e.arcLinkLabelsTextColor,Ce=de===void 0?me.arcLinkLabelsTextColor:de,Ge=e.arcLinkLabelsColor,we=Ge===void 0?me.arcLinkLabelsColor:Ge,ve=e.isInteractive,Pe=ve===void 0?me.isInteractive:ve,Ze=e.onClick,_t=e.onMouseMove,Te=e.tooltip,Re=Te===void 0?me.tooltip:Te,at=e.activeId,Ue=e.onActiveIdChange,mt=e.defaultActiveId,ut=e.legends,At=ut===void 0?me.legends:ut,Ke=e.forwardLegendData,Le=e.role,Ve=e.forwardedRef,et=v.useRef(null),Fe=Lt(),tt=oo(k,R,T),vt=tt.margin,ot=tt.innerWidth,Ne=tt.innerHeight,Ee=tt.outerWidth,Ye=tt.outerHeight,xt=h5({data:t,id:r,value:a,valueFormat:o,colors:I}),nt=p5({data:xt,width:ot,height:Ne,fit:g,innerRadius:_,startAngle:u,endAngle:f,padAngle:p,sortByValue:l,cornerRadius:C,activeInnerRadiusOffset:S,activeOuterRadiusOffset:$,activeId:at,onActiveIdChange:Ue,defaultActiveId:mt,forwardLegendData:Ke}),bt=nt.dataWithArc,Jt=nt.arcGenerator,Ft=nt.centerX,Bt=nt.centerY,fn=nt.radius,qt=nt.innerRadius,$e=nt.setActiveId,Je=pr(B,Fe),St=Aie({data:bt,label:q,skipAngle:X,offset:F,textColor:ee}),an=Wie({data:bt,skipAngle:G,offset:ne,diagonalLength:ae,straightLength:ye,label:te,linkColor:we,textOffset:ce,textColor:Ce});v.useEffect(function(){if(et.current){et.current.width=Ee*A,et.current.height=Ye*A;var Qe=et.current.getContext("2d");Qe.scale(A,A),Qe.fillStyle=Fe.background,Qe.fillRect(0,0,Ee,Ye),Qe.save(),Qe.translate(vt.left,vt.top),Jt.context(Qe),Qe.save(),Qe.translate(Ft,Bt),bt.forEach(function($t){Qe.beginPath(),Qe.fillStyle=$t.color,Qe.strokeStyle=Je($t),Qe.lineWidth=O,Jt($t.arc),Qe.fill(),O>0&&Qe.stroke()}),V===!0&&zie(Qe,an,Fe,be),H===!0&&Oie(Qe,St,Fe),Qe.restore(),At.forEach(function($t){qv(Qe,mr({},$t,{data:bt,containerWidth:ot,containerHeight:Ne,theme:Fe}))})}},[et,ot,Ne,Ee,Ye,vt.top,vt.left,A,Ft,Bt,Jt,bt,O,Je,H,St,V,an,be,At,Fe]);var Yt=v.useMemo(function(){return bt.map(function(Qe){return mr({id:Qe.id},Qe.arc)})},[bt]),ze=function(Qe){if(!et.current)return null;var $t=zo(et.current,Qe),vr=$t[0],ln=$t[1],cn=Zie(vt.left+Ft,vt.top+Bt,fn,qt,Yt,vr,ln);return cn?bt.find(function(An){return An.id===cn.id}):null},Be=Ti(),ht=Be.showTooltipFromEvent,Rt=Be.hideTooltip,Tt=function(Qe){var $t=ze(Qe);$t?(_t==null||_t($t,Qe),$e($t.id),ht(v.createElement(Re,{datum:$t}),Qe)):($e(null),Rt())};return y.jsx("canvas",{ref:Bv(et,Ve),width:Ee*A,height:Ye*A,style:{width:Ee,height:Ye,cursor:Pe?"auto":"normal"},onMouseEnter:Pe?Tt:void 0,onMouseMove:Pe?Tt:void 0,onMouseLeave:Pe?function(){Rt()}:void 0,onClick:Pe?function(Qe){if(Ze){var $t=ze(Qe);$t&&Ze($t,Qe)}}:void 0,role:Le})},yae=v.forwardRef(function(e,t){var n=e.isInteractive,r=n===void 0?me.isInteractive:n,i=e.theme,a=e.renderWrapper,o=Ic(e,vae);return y.jsx(io,{isInteractive:r,renderWrapper:a,theme:i,children:y.jsx(bae,mr({isInteractive:r},o,{forwardedRef:t}))})}),xae=["defaultWidth","defaultHeight","onResize","debounceResize"];v.forwardRef(function(e,t){var n=e.defaultWidth,r=e.defaultHeight,i=e.onResize,a=e.debounceResize,o=Ic(e,xae);return y.jsx(ao,{defaultWidth:n,defaultHeight:r,onResize:i,debounceResize:a,children:function(s){var l=s.width,c=s.height;return y.jsx(yae,mr({width:l,height:c},o,{ref:t}))}})});function wae(){}var _ae=wae,jp=HS,Cae=_ae,Sae=Iv,Tae=1/0,$ae=jp&&1/Sae(new jp([,-0]))[1]==Tae?function(e){return new jp(e)}:Cae,kae=$ae,Mae=lv,Eae=N6,Oae=P6,Aae=cv,Rae=kae,Dae=Iv,jae=200;function Iae(e,t,n){var r=-1,i=Eae,a=e.length,o=!0,s=[],l=s;if(n)o=!1,i=Oae;else if(a>=jae){var c=t?null:Rae(e);if(c)return Dae(c);o=!1,i=Aae,l=new Mae}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 m5=Iae,Nae=m5;function Pae(e){return e&&e.length?Nae(e):[]}var Lae=Pae;const vx=nn(Lae);var Fae=kf,zae=Pv,Bae=1,Wae=2;function Uae(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 Fae;if(r)var f=r(c,u,l,e,t,d);if(!(f===void 0?zae(u,c,Bae|Wae,r,d):f))return!1}}return!0}var Hae=Uae,Vae=Kr;function qae(e){return e===e&&!Vae(e)}var g5=qae,Yae=g5,Gae=Dc;function Zae(e){for(var t=Gae(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Yae(i)]}return t}var Xae=Zae;function Kae(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var v5=Kae,Jae=Hae,Qae=Xae,eoe=v5;function toe(e){var t=Qae(e);return t.length==1&&t[0][2]?eoe(t[0][0],t[0][1]):function(n){return n===e||Jae(n,e,t)}}var noe=toe,roe=Pv,ioe=x6,aoe=IS,ooe=ev,soe=g5,loe=v5,coe=ks,uoe=1,doe=2;function foe(e,t){return ooe(e)&&soe(t)?loe(coe(e),t):function(n){var r=ioe(n,e);return r===void 0&&r===t?aoe(n,e):roe(t,r,uoe|doe)}}var hoe=foe;function poe(e){return function(t){return t==null?void 0:t[e]}}var moe=poe,goe=Ac;function voe(e){return function(t){return goe(t,e)}}var boe=voe,yoe=moe,xoe=boe,woe=ev,_oe=ks;function Coe(e){return woe(e)?yoe(_oe(e)):xoe(e)}var Soe=Coe,Toe=noe,$oe=hoe,koe=Rf,Moe=Kn,Eoe=Soe;function Ooe(e){return typeof e=="function"?e:e==null?koe:typeof e=="object"?Moe(e)?$oe(e[0],e[1]):Toe(e):Eoe(e)}var Yv=Ooe,Aoe=Yv,Roe=m5;function Doe(e,t){return e&&e.length?Roe(e,Aoe(t)):[]}var joe=Doe;const ag=nn(joe);var Ioe=e6,Noe=Dc;function Poe(e,t){return e&&Ioe(e,t,Noe)}var Loe=Poe,Foe=Cs;function zoe(e,t){return function(n,r){if(n==null)return n;if(!Foe(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 Boe=zoe,Woe=Loe,Uoe=Boe,Hoe=Uoe(Woe),b5=Hoe,Voe=b5,qoe=Cs;function Yoe(e,t){var n=-1,r=qoe(e)?Array(e.length):[];return Voe(e,function(i,a,o){r[++n]=t(i,a,o)}),r}var Goe=Yoe;function Zoe(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var Xoe=Zoe,bx=Df;function Koe(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=bx(e),o=t!==void 0,s=t===null,l=t===t,c=bx(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 Joe=Koe,Qoe=Joe;function ese(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var l=Qoe(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 tse=ese,Ip=jf,nse=Ac,rse=Yv,ise=Goe,ase=Xoe,ose=Ss,sse=tse,lse=Rf,cse=Kn;function use(e,t,n){t.length?t=Ip(t,function(a){return cse(a)?function(o){return nse(o,a.length===1?a[0]:a)}:a}):t=[lse];var r=-1;t=Ip(t,ose(rse));var i=ise(e,function(a,o,s){var l=Ip(t,function(c){return c(a)});return{criteria:l,index:++r,value:a}});return ase(i,function(a,o){return sse(a,o,n)})}var dse=use,fse=PS,hse=dse,pse=Q0,yx=m6,mse=pse(function(e,t){if(e==null)return[];var n=t.length;return n>1&&yx(e,t[0],t[1])?t=[]:n>2&&yx(t[0],t[1],t[2])&&(t=[t[0]]),hse(e,fse(t,1),[])}),gse=mse;const vse=nn(gse);var bse=Si,yse=gr,xse="[object Date]";function wse(e){return yse(e)&&bse(e)==xse}var _se=wse,Cse=_se,Sse=Ss,xx=Of,wx=xx&&xx.isDate,Tse=wx?Sse(wx):Cse,$se=Tse;const kse=nn($se);function wa(){return wa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wa.apply(null,arguments)}var xo=[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)}],Mse={millisecond:[],second:xo.slice(0,1),minute:xo.slice(0,2),hour:xo.slice(0,3),day:xo.slice(0,4),month:xo.slice(0,5),year:xo.slice(0,6)},Ese=function(e){return function(t){return Mse[e].forEach(function(n){n(t)}),t}},y5=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=Ese(i);return function(l){if(l===void 0)return l;if(n==="native"||l instanceof Date)return s(l);var c=o?RS(n):OS(n);return s(c(l))}},ma={min:0,max:"auto",stacked:!1,reverse:!1,clamp:!1,nice:!0,round:!1},Ose=function(e,t,n,r){var i,a,o,s,l=e.min,c=l===void 0?ma.min:l,u=e.max,d=u===void 0?ma.max:u,f=e.stacked,h=f===void 0?ma.stacked:f,p=e.reverse,m=p===void 0?ma.reverse:p,g=e.clamp,x=g===void 0?ma.clamp:g,_=e.nice,w=_===void 0?ma.nice:_,C=e.round,b=C===void 0?ma.round:C;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 S=vd().range(r==="x"?[0,n]:[n,0]).interpolate(b?j6:Jl).domain(m?[o,i]:[i,o]).clamp(x);return w===!0?S.nice():typeof w=="number"&&S.nice(w),Ase(S,h)},Ase=function(e,t){t===void 0&&(t=!1);var n=e;return n.type="linear",n.stacked=t,n},Rse=function(e,t,n){var r=yJ().range([0,n]).domain(t.all);return r.type="point",r},Dse={round:!1},jse=function(e,t,n,r){var i=e.round,a=i===void 0?Dse.round:i,o=bv().range(r==="x"?[0,n]:[n,0]).domain(t.all).round(a);return Ise(o)},Ise=function(e){var t=e;return t.type="band",t},wo={format:"native",precision:"millisecond",min:"auto",max:"auto",useUTC:!0,nice:!1},Nse=function(e,t,n){var r,i,a=e.format,o=a===void 0?wo.format:a,s=e.precision,l=s===void 0?wo.precision:s,c=e.min,u=c===void 0?wo.min:c,d=e.max,f=d===void 0?wo.max:d,h=e.useUTC,p=h===void 0?wo.useUTC:h,m=e.nice,g=m===void 0?wo.nice:m,x=y5({format:o,precision:l,useUTC:p});r=u==="auto"?x(t.min):o!=="native"?x(u):u,i=f==="auto"?x(t.max):o!=="native"?x(f):f;var _=p?uee():cee();_.range([0,n]),r&&i&&_.domain([r,i]),g===!0?_.nice():typeof g!="object"&&typeof g!="number"||_.nice(g);var w=_;return w.type="time",w.useUTC=p,w},_o={base:10,min:"auto",max:"auto",round:!1,reverse:!1,nice:!0},Pse=function(e,t,n,r){var i,a=e.base,o=a===void 0?_o.base:a,s=e.min,l=s===void 0?_o.min:s,c=e.max,u=c===void 0?_o.max:c,d=e.round,f=d===void 0?_o.round:d,h=e.reverse,p=h===void 0?_o.reverse:h,m=e.nice,g=m===void 0?_o.nice:m;if(t.all.some(function(M){return M===0}))throw new Error("a log scale domain must not include or cross zero");var x,_,w=!1;if(t.all.filter(function(M){return M!=null}).forEach(function(M){w||(i===void 0?i=Math.sign(M):Math.sign(M)!==i&&(w=!0))}),w)throw new Error("a log scale domain must be strictly-positive or strictly-negative");x=l==="auto"?t.min:l,_=u==="auto"?t.max:u;var C=aS().base(o),b=r==="x"?[0,n]:[n,0];f===!0?C.rangeRound(b):C.range(b),p===!0?C.domain([_,x]):C.domain([x,_]),g===!0?C.nice():typeof g=="number"&&C.nice(g);var S=C;return S.type="log",S},Co={constant:1,min:"auto",max:"auto",round:!1,reverse:!1,nice:!0},Lse=function(e,t,n,r){var i,a,o=e.constant,s=o===void 0?Co.constant:o,l=e.min,c=l===void 0?Co.min:l,u=e.max,d=u===void 0?Co.max:u,f=e.round,h=f===void 0?Co.round:f,p=e.reverse,m=p===void 0?Co.reverse:p,g=e.nice,x=g===void 0?Co.nice:g;i=c==="auto"?t.min:c,a=d==="auto"?t.max:d;var _=oS().constant(s),w=r==="x"?[0,n]:[n,0];h===!0?_.rangeRound(w):_.range(w),m===!0?_.domain([a,i]):_.domain([i,a]),x===!0?_.nice():typeof x=="number"&&_.nice(x);var C=_;return C.type="symlog",C},Fse=function(e){return e==="x"?"y":"x"},zse=function(e,t){return e===t},Bse=function(e,t){return e.getTime()===t.getTime()};function ic(e,t,n,r){switch(e.type){case"linear":return Ose(e,t,n,r);case"point":return Rse(0,t,n);case"band":return jse(e,t,n,r);case"time":return Nse(e,t,n);case"log":return Pse(e,t,n,r);case"symlog":return Lse(e,t,n,r);default:throw new Error("invalid scale spec")}}var _x=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},Wse=function(e,t,n,r,i){var a=e.map(function(u){return function(d){return wa({},d,{data:d.data.map(function(f){return{data:wa({},f)}})})}(u)}),o=Use(a,t,n);"stacked"in t&&t.stacked===!0&&Hse(o,a),"stacked"in n&&n.stacked===!0&&Vse(o,a);var s=ic(t,o.x,r,"x"),l=ic(n,o.y,i,"y"),c=a.map(function(u){return wa({},u,{data:u.data.map(function(d){return wa({},d,{position:{x:_x(d,"x",s),y:_x(d,"y",l)}})})})});return wa({},o,{series:c,xScale:s,yScale:l})},Use=function(e,t,n){return{x:Cx(e,"x",t),y:Cx(e,"y",n)}},Cx=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 g=o(m);g&&l(m,parseFloat(String(g)))})});else if(n.type==="time"&&n.format!=="native"){var c=y5(n);e.forEach(function(p){p.data.forEach(function(m){var g=o(m);g&&l(m,c(g))})})}var u=[];switch(e.forEach(function(p){p.data.forEach(function(m){u.push(o(m))})}),n.type){case"linear":var d=vse(vx(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=ag(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:De(f)};default:var h=vx(u);return{all:h,min:h[0],max:De(h)}}},x5=function(e,t,n){var r=Fse(e),i=[];t[r].all.forEach(function(a){var o=kse(a)?Bse:zse,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=De(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)},Hse=function(e,t){return x5("x",e,t)},Vse=function(e,t){return x5("y",e,t)},w5=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}},_5={millisecond:[tc,tc],second:[Jm,Jm],minute:[fS,yS],hour:[hS,xS],day:[dn(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)}),dn(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:[wd,_d],sunday:[wd,_d],monday:[nc,rc],tuesday:[pS,wS],wednesday:[mS,_S],thursday:[Va,qa],friday:[gS,CS],saturday:[vS,SS],month:[bS,TS],year:[Qi,ea]},qse=Object.keys(_5),Yse=new RegExp("^every\\s*(\\d+)?\\s*("+qse.join("|")+")s?$","i"),C5=function(e,t){if(Array.isArray(t))return t;if(typeof t=="string"&&"useUTC"in e){var n=t.match(Yse);if(n){var r=n[1],i=n[2],a=_5[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 kr(){return kr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kr.apply(null,arguments)}var S5=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=C5(r,a),h=XS[d],p="bandwidth"in r?w5(r):r,m={lineX:0,lineY:0},g={textX:0,textY:0},x=typeof document=="object"&&document.dir==="rtl",_=h.align.center,w=h.baseline.center;return n==="x"?(t=function(C){var b;return{x:(b=p(C))!=null?b:0,y:0}},m.lineY=o*(i==="after"?1:-1),g.textY=(o+s)*(i==="after"?1:-1),w=i==="after"?h.baseline.top:h.baseline.bottom,l===0?_=h.align.center:i==="after"&&l<0||i==="before"&&l>0?(_=h.align[x?"left":"right"],w=h.baseline.center):(i==="after"&&l>0||i==="before"&&l<0)&&(_=h.align[x?"right":"left"],w=h.baseline.center)):(t=function(C){var b;return{x:0,y:(b=p(C))!=null?b:0}},m.lineX=o*(i==="after"?1:-1),g.textX=(o+s)*(i==="after"?1:-1),_=i==="after"?h.align.left:h.align.right),{ticks:f.map(function(C){var b=typeof C=="string"?function(S){var M=String(S).length;return c&&c>0&&M>c?""+String(S).slice(0,c).concat("..."):""+S}(C):C;return kr({key:C instanceof Date?""+C.valueOf():""+C,value:b},t(C),m,g)}),textAlign:_,textBaseline:w}},T5=function(e,t){if(e===void 0||typeof e=="function")return e;if(t.type==="time"){var n=Hf(e);return function(r){return n(r instanceof Date?r:new Date(r))}}return Rc(e)},og=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)||C5(i,o)),l="bandwidth"in i?w5(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},Gse=v.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.theme,u=e.animatedProps,d=(t=r==null?void 0:r(n))!=null?t:n,f=v.useMemo(function(){var h={opacity:u.opacity};return o?{style:kr({},h,{cursor:"pointer"}),onClick:function(p){return o(p,d)}}:{style:h}},[u.opacity,o,d]);return y.jsxs(Ht.g,kr({transform:u.transform},f,{children:[y.jsx("line",{x1:0,x2:i,y1:0,y2:a,style:c.line}),y.jsx(Os,{dominantBaseline:s,textAnchor:l,transform:u.textTransform,style:c.text,children:""+d})]}))}),Wn={tickSize:5,tickPadding:5,tickRotation:0,legendPosition:"middle",legendOffset:0},Zse=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?Wn.tickSize:u,f=e.tickPadding,h=f===void 0?Wn.tickPadding:f,p=e.tickRotation,m=p===void 0?Wn.tickRotation:p,g=e.format,x=e.renderTick,_=x===void 0?Gse:x,w=e.truncateTickAt,C=e.legend,b=e.legendPosition,S=b===void 0?Wn.legendPosition:b,M=e.legendOffset,$=M===void 0?Wn.legendOffset:M,k=e.style,R=e.onClick,T=e.ariaHidden,E=Lt(),A=YZ(E.axis,k),j=v.useMemo(function(){return T5(g,n)},[g,n]),I=S5({axis:t,scale:n,ticksPosition:l,tickValues:c,tickSize:d,tickPadding:h,tickRotation:m,truncateTickAt:w}),D=I.ticks,O=I.textAlign,L=I.textBaseline,B=null;if(C!==void 0){var P,H=0,Y=0,q=0;t==="y"?(q=-90,H=$,S==="start"?(P="start",Y=s):S==="middle"?(P="middle",Y=s/2):S==="end"&&(P="end")):(Y=$,S==="start"?P="start":S==="middle"?(P="middle",H=s/2):S==="end"&&(P="end",H=s)),B=y.jsx(y.Fragment,{children:y.jsx(Os,{transform:"translate("+H+", "+Y+") rotate("+q+")",textAnchor:P,style:kr({},A.legend.text,{dominantBaseline:"central"}),children:C})})}var Z=Fn(),X=Z.animate,J=Z.config,ee=Zr({transform:"translate("+i+","+o+")",lineX2:t==="x"?s:0,lineY2:t==="x"?0:s,config:J,immediate:!X}),W=v.useCallback(function(V){return{opacity:1,transform:"translate("+V.x+","+V.y+")",textTransform:"translate("+V.textX+","+V.textY+") rotate("+m+")"}},[m]),F=v.useCallback(function(V){return{opacity:0,transform:"translate("+V.x+","+V.y+")",textTransform:"translate("+V.textX+","+V.textY+") rotate("+m+")"}},[m]),z=Ka(D,{keys:function(V){return V.key},initial:W,from:F,enter:W,update:W,leave:{opacity:0},config:J,immediate:!X});return y.jsxs(Ht.g,{transform:ee.transform,"aria-hidden":T,children:[z(function(V,N,te,K){return fe.createElement(_,kr({tickIndex:K,format:j,rotate:m,textBaseline:L,textAnchor:O,truncateTickAt:w,animatedProps:V,theme:A.ticks},N,R?{onClick:R}:{}))}),y.jsx(Ht.line,{style:A.domain.line,x1:0,x2:ee.lineX2,y1:0,y2:ee.lineY2}),B]})},Xse=v.memo(Zse),$5=["top","right","bottom","left"],k5=v.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 y.jsx(y.Fragment,{children:$5.map(function(o){var s=a[o];if(!s)return null;var l=o==="top"||o==="bottom";return y.jsx(Xse,kr({},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)})})}),Kse=v.memo(function(e){var t=e.animatedProps,n=Lt();return y.jsx(Ht.line,kr({},t,n.grid.line))}),Sx=v.memo(function(e){var t=e.lines,n=Fn(),r=n.animate,i=n.config,a=Ka(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 y.jsx("g",{children:a(function(o,s){return v.createElement(Kse,kr({},s,{key:s.key,animatedProps:o}))})})}),M5=v.memo(function(e){var t=e.width,n=e.height,r=e.xScale,i=e.yScale,a=e.xValues,o=e.yValues,s=v.useMemo(function(){return!!r&&og({width:t,height:n,scale:r,axis:"x",values:a})},[r,a,t,n]),l=v.useMemo(function(){return!!i&&og({width:t,height:n,scale:i,axis:"y",values:o})},[n,t,i,o]);return y.jsxs(y.Fragment,{children:[s&&y.jsx(Sx,{lines:s}),l&&y.jsx(Sx,{lines:l})]})}),Jse=function(e,t){var n,r,i=t.axis,a=t.scale,o=t.x,s=o===void 0?0:o,l=t.y,c=l===void 0?0:l,u=t.length,d=t.ticksPosition,f=t.tickValues,h=t.tickSize,p=h===void 0?Wn.tickSize:h,m=t.tickPadding,g=m===void 0?Wn.tickPadding:m,x=t.tickRotation,_=x===void 0?Wn.tickRotation:x,w=t.format,C=t.legend,b=t.legendPosition,S=b===void 0?Wn.legendPosition:b,M=t.legendOffset,$=M===void 0?Wn.legendOffset:M,k=t.theme,R=t.style,T=S5({axis:i,scale:a,ticksPosition:d,tickValues:f,tickSize:p,tickPadding:g,tickRotation:_,engine:"canvas"}),E=T.ticks,A=T.textAlign,j=T.textBaseline;e.save(),e.translate(s,c);var I=_6(k.axis,R);e.textAlign=A,e.textBaseline=j,Ya(e,I.ticks.text);var D=(n=I.domain.line.strokeWidth)!=null?n:0;typeof D!="string"&&D>0&&(e.lineWidth=D,e.lineCap="square",I.domain.line.stroke&&(e.strokeStyle=I.domain.line.stroke),e.beginPath(),e.moveTo(0,0),e.lineTo(i==="x"?u:0,i==="x"?0:u),e.stroke());var O=typeof w=="function"?w:function(Z){return""+Z},L=(r=I.ticks.line.strokeWidth)!=null?r:0,B=typeof L!="string"&&L>0;if(E.forEach(function(Z){B&&(e.lineWidth=L,e.lineCap="square",I.ticks.line.stroke&&(e.strokeStyle=I.ticks.line.stroke),e.beginPath(),e.moveTo(Z.x,Z.y),e.lineTo(Z.x+Z.lineX,Z.y+Z.lineY),e.stroke());var X=O(Z.value);e.save(),e.translate(Z.x+Z.textX,Z.y+Z.textY),e.rotate(dr(_)),Ga(e,I.ticks.text,""+X),e.fillText(""+X,0,0),e.restore()}),C!==void 0){var P=0,H=0,Y=0,q="center";i==="y"?(Y=-90,P=$,S==="start"?(q="start",H=u):S==="middle"?(q="center",H=u/2):S==="end"&&(q="end")):(H=$,S==="start"?q="start":S==="middle"?(q="center",P=u/2):S==="end"&&(q="end",P=u)),e.translate(P,H),e.rotate(dr(Y)),Ya(e,I.legend.text),I.legend.text.fill&&(e.fillStyle=I.legend.text.fill),e.textAlign=q,e.textBaseline="middle",Ga(e,I.legend.text,C)}e.restore()},E5=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};$5.forEach(function(f){var h=d[f];if(!h)return null;var p=f==="top"||f==="bottom",m=f==="top"||f==="left"?"before":"after",g=p?n:r,x=T5(h.format,g);Jse(e,kr({},h,{axis:p?"x":"y",x:f==="right"?i:0,y:f==="bottom"?a:0,scale:g,format:x,length:p?i:a,ticksPosition:m,theme:u}))})},Sd=function(e,t){var n=t.width,r=t.height,i=t.scale,a=t.axis,o=t.values;og({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()})},Qse=y6,ele=0;function tle(e){var t=++ele;return Qse(e)+t}var nle=tle;const rle=nn(nle),mi=11102230246251565e-32,Tn=134217729,ile=(3+8*mi)*mi;function Np(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 ale(e,t){let n=t[0];for(let r=1;r<e;r++)n+=t[r];return n}function Nc(e){return new Float64Array(e)}const ole=(3+16*mi)*mi,sle=(2+12*mi)*mi,lle=(9+64*mi)*mi*mi,So=Nc(4),Tx=Nc(8),$x=Nc(12),kx=Nc(16),Dn=Nc(4);function cle(e,t,n,r,i,a,o){let s,l,c,u,d,f,h,p,m,g,x,_,w,C,b,S,M,$;const k=e-i,R=n-i,T=t-a,E=r-a;C=k*E,f=Tn*k,h=f-(f-k),p=k-h,f=Tn*E,m=f-(f-E),g=E-m,b=p*g-(C-h*m-p*m-h*g),S=T*R,f=Tn*T,h=f-(f-T),p=T-h,f=Tn*R,m=f-(f-R),g=R-m,M=p*g-(S-h*m-p*m-h*g),x=b-M,d=b-x,So[0]=b-(x+d)+(d-M),_=C+x,d=_-C,w=C-(_-d)+(x-d),x=w-S,d=w-x,So[1]=w-(x+d)+(d-S),$=_+x,d=$-_,So[2]=_-($-d)+(x-d),So[3]=$;let A=ale(4,So),j=sle*o;if(A>=j||-A>=j||(d=e-k,s=e-(k+d)+(d-i),d=n-R,c=n-(R+d)+(d-i),d=t-T,l=t-(T+d)+(d-a),d=r-E,u=r-(E+d)+(d-a),s===0&&l===0&&c===0&&u===0)||(j=lle*o+ile*Math.abs(A),A+=k*u+E*s-(T*c+R*l),A>=j||-A>=j))return A;C=s*E,f=Tn*s,h=f-(f-s),p=s-h,f=Tn*E,m=f-(f-E),g=E-m,b=p*g-(C-h*m-p*m-h*g),S=l*R,f=Tn*l,h=f-(f-l),p=l-h,f=Tn*R,m=f-(f-R),g=R-m,M=p*g-(S-h*m-p*m-h*g),x=b-M,d=b-x,Dn[0]=b-(x+d)+(d-M),_=C+x,d=_-C,w=C-(_-d)+(x-d),x=w-S,d=w-x,Dn[1]=w-(x+d)+(d-S),$=_+x,d=$-_,Dn[2]=_-($-d)+(x-d),Dn[3]=$;const I=Np(4,So,4,Dn,Tx);C=k*u,f=Tn*k,h=f-(f-k),p=k-h,f=Tn*u,m=f-(f-u),g=u-m,b=p*g-(C-h*m-p*m-h*g),S=T*c,f=Tn*T,h=f-(f-T),p=T-h,f=Tn*c,m=f-(f-c),g=c-m,M=p*g-(S-h*m-p*m-h*g),x=b-M,d=b-x,Dn[0]=b-(x+d)+(d-M),_=C+x,d=_-C,w=C-(_-d)+(x-d),x=w-S,d=w-x,Dn[1]=w-(x+d)+(d-S),$=_+x,d=$-_,Dn[2]=_-($-d)+(x-d),Dn[3]=$;const D=Np(I,Tx,4,Dn,$x);C=s*u,f=Tn*s,h=f-(f-s),p=s-h,f=Tn*u,m=f-(f-u),g=u-m,b=p*g-(C-h*m-p*m-h*g),S=l*c,f=Tn*l,h=f-(f-l),p=l-h,f=Tn*c,m=f-(f-c),g=c-m,M=p*g-(S-h*m-p*m-h*g),x=b-M,d=b-x,Dn[0]=b-(x+d)+(d-M),_=C+x,d=_-C,w=C-(_-d)+(x-d),x=w-S,d=w-x,Dn[1]=w-(x+d)+(d-S),$=_+x,d=$-_,Dn[2]=_-($-d)+(x-d),Dn[3]=$;const O=Np(D,$x,4,Dn,kx);return kx[O-1]}function pu(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)>=ole*c?l:-cle(e,t,n,r,i,a,c)}const Mx=Math.pow(2,-52),mu=new Uint32Array(512);class Td{static from(t,n=ple,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 Td(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 k=0;k<o;k++){const R=t[2*k],T=t[2*k+1];R<s&&(s=R),T<l&&(l=T),R>c&&(c=R),T>u&&(u=T),this._ids[k]=k}const d=(s+c)/2,f=(l+u)/2;let h,p,m;for(let k=0,R=1/0;k<o;k++){const T=Pp(d,f,t[2*k],t[2*k+1]);T<R&&(h=k,R=T)}const g=t[2*h],x=t[2*h+1];for(let k=0,R=1/0;k<o;k++){if(k===h)continue;const T=Pp(g,x,t[2*k],t[2*k+1]);T<R&&T>0&&(p=k,R=T)}let _=t[2*p],w=t[2*p+1],C=1/0;for(let k=0;k<o;k++){if(k===h||k===p)continue;const R=fle(g,x,_,w,t[2*k],t[2*k+1]);R<C&&(m=k,C=R)}let b=t[2*m],S=t[2*m+1];if(C===1/0){for(let T=0;T<o;T++)this._dists[T]=t[2*T]-t[0]||t[2*T+1]-t[1];Ro(this._ids,this._dists,0,o-1);const k=new Uint32Array(o);let R=0;for(let T=0,E=-1/0;T<o;T++){const A=this._ids[T],j=this._dists[A];j>E&&(k[R++]=A,E=j)}this.hull=k.subarray(0,R),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(pu(g,x,_,w,b,S)<0){const k=p,R=_,T=w;p=m,_=b,w=S,m=k,b=R,S=T}const M=hle(g,x,_,w,b,S);this._cx=M.x,this._cy=M.y;for(let k=0;k<o;k++)this._dists[k]=Pp(t[2*k],t[2*k+1],M.x,M.y);Ro(this._ids,this._dists,0,o-1),this._hullStart=h;let $=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(g,x)]=h,a[this._hashKey(_,w)]=p,a[this._hashKey(b,S)]=m,this.trianglesLen=0,this._addTriangle(h,p,m,-1,-1,-1);for(let k=0,R,T;k<this._ids.length;k++){const E=this._ids[k],A=t[2*E],j=t[2*E+1];if(k>0&&Math.abs(A-R)<=Mx&&Math.abs(j-T)<=Mx||(R=A,T=j,E===h||E===p||E===m))continue;let I=0;for(let P=0,H=this._hashKey(A,j);P<this._hashSize&&(I=a[(H+P)%this._hashSize],!(I!==-1&&I!==r[I]));P++);I=n[I];let D=I,O;for(;O=r[D],pu(A,j,t[2*D],t[2*D+1],t[2*O],t[2*O+1])>=0;)if(D=O,D===I){D=-1;break}if(D===-1)continue;let L=this._addTriangle(D,E,r[D],-1,-1,i[D]);i[E]=this._legalize(L+2),i[D]=L,$++;let B=r[D];for(;O=r[B],pu(A,j,t[2*B],t[2*B+1],t[2*O],t[2*O+1])<0;)L=this._addTriangle(B,E,O,i[E],-1,i[B]),i[E]=this._legalize(L+2),r[B]=B,$--,B=O;if(D===I)for(;O=n[D],pu(A,j,t[2*O],t[2*O+1],t[2*D],t[2*D+1])<0;)L=this._addTriangle(O,E,D,-1,i[D],i[O]),this._legalize(L+2),i[O]=L,r[D]=D,$--,D=O;this._hullStart=n[E]=D,r[D]=n[B]=E,r[E]=B,a[this._hashKey(A,j)]=E,a[this._hashKey(t[2*D],t[2*D+1])]=D}this.hull=new Uint32Array($);for(let k=0,R=this._hullStart;k<$;k++)this.hull[k]=R,R=r[R];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(t,n){return Math.floor(ule(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=mu[--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(dle(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 x=r[d];if(x===-1){let w=this._hullStart;do{if(this._hullTri[w]===d){this._hullTri[w]=t;break}w=this._hullPrev[w]}while(w!==this._hullStart)}this._link(t,x),this._link(s,r[o]),this._link(o,d);const _=c+(s+1)%3;a<mu.length&&(mu[a++]=_)}else{if(a===0)break;t=mu[--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 ule(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}function Pp(e,t,n,r){const i=e-n,a=t-r;return i*i+a*a}function dle(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,g=f*f+h*h;return l*(d*g-m*h)-c*(u*g-m*f)+p*(u*h-d*f)<0}function fle(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 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=e+(c*u-s*d)*f,p=t+(o*d-l*u)*f;return{x:h,y:p}}function Ro(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;el(e,i,a),t[e[n]]>t[e[r]]&&el(e,n,r),t[e[a]]>t[e[r]]&&el(e,a,r),t[e[n]]>t[e[a]]&&el(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;el(e,a,o)}e[n+1]=e[o],e[o]=s,r-a+1>=o-n?(Ro(e,t,a,r),Ro(e,t,n,o-1)):(Ro(e,t,n,o-1),Ro(e,t,a,r))}}function el(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function ple(e){return e[0]}function mle(e){return e[1]}const Ex=1e-6;class Ma{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)>Ex||Math.abs(this._y1-a)>Ex)&&(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 sg{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 gle{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,g=0,x=r.length,_,w;m<x;m+=3,g+=2){const C=r[m]*2,b=r[m+1]*2,S=r[m+2]*2,M=t[C],$=t[C+1],k=t[b],R=t[b+1],T=t[S],E=t[S+1],A=k-M,j=R-$,I=T-M,D=E-$,O=(A*D-j*I)*2;if(Math.abs(O)<1e-9){if(a===void 0){a=o=0;for(const B of n)a+=t[B*2],o+=t[B*2+1];a/=n.length,o/=n.length}const L=1e9*Math.sign((a-M)*D-(o-$)*I);_=(M+T)/2-L*D,w=($+E)/2+L*I}else{const L=1/O,B=A*A+j*j,P=I*I+D*D;_=M+(D*B-j*P)*L,w=$+(A*P-I*B)*L}s[g]=_,s[g+1]=w}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 Ma: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],g=o[h+1],x=o[p],_=o[p+1];this._renderSegment(m,g,x,_,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 Ma: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 Ma: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 sg;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,g,x,_;if(c===0){if((p=this._clipSegment(a,o,s,l,c,u))===null)continue;[m,g,x,_]=p}else{if((p=this._clipSegment(s,l,a,o,u,c))===null)continue;[x,_,m,g]=p,d=f,f=this._edgecode(m,g),d&&f&&this._edge(t,d,f,i,i.length),i?i.push(m,g):i=[m,g]}d=f,f=this._edgecode(x,_),d&&f&&this._edge(t,d,f,i,i.length),i?i.push(x,_):i=[x,_]}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 vle=2*Math.PI,To=Math.pow;function ble(e){return e[0]}function yle(e){return e[1]}function xle(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 wle(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class wh{static from(t,n=ble,r=yle,i){return new wh("length"in t?_le(t,n,r,i):Float64Array.from(Cle(t,n,r,i)))}constructor(t){this._delaunator=new Td(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&&xle(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=wle(n[2*f],n[2*f+1],d);n[2*f]=p[0],n[2*f+1]=p[1]}this._delaunator=new Td(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 gle(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=To(n-c[t*2],2)+To(r-c[t*2+1],2);const f=i[t];let h=f;do{let p=l[h];const m=To(n-c[p*2],2)+To(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&&To(n-c[h*2],2)+To(r-c[h*2+1],2)<d)return h;break}}while(h!==f);return u}render(t){const n=t==null?t=new Ma: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 Ma: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,vle)}return r&&r.value()}renderHull(t){const n=t==null?t=new Ma: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 sg;return this.renderHull(t),t.value()}renderTriangle(t,n){const r=n==null?n=new Ma: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 sg;return this.renderTriangle(t,n),n.value()}}function _le(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*Cle(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}function $d(){return $d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$d.apply(null,arguments)}function O5(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Qn={xDomain:[0,1],yDomain:[0,1],layers:["links","cells","points","bounds"],enableLinks:!1,linkLineWidth:1,linkLineColor:"#bbbbbb",enableCells:!0,cellLineWidth:2,cellLineColor:"#000000",pointSize:4,pointColor:"#666666",role:"img"},Gv=function(e){return[e.x,e.y]},Pc=e5,A5="cursor",R5="top",Sle=function(e){var t=e.points,n=e.getNodePosition,r=n===void 0?Gv:n,i=e.margin,a=i===void 0?Pc:i;return t.map(function(o){var s=r(o),l=s[0],c=s[1];return[l+a.left,c+a.top]})},Tle=function(e){var t=e.points,n=e.width,r=e.height,i=e.margin,a=i===void 0?Pc:i,o=e.debug,s=wh.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}},D5=function(e){var t=e.points,n=e.getNodePosition,r=n===void 0?Gv:n,i=e.width,a=e.height,o=e.margin,s=o===void 0?Pc:o,l=e.debug;return v.useMemo(function(){return Tle({points:Sle({points:t,margin:s,getNodePosition:r}),width:i,height:a,margin:s,debug:l})},[r,t,i,a,s,l])},$le=function(e){var t=e.data,n=e.width,r=e.height,i=e.xDomain,a=e.yDomain,o=v.useMemo(function(){return vd().domain(i).range([0,n])},[i,n]),s=v.useMemo(function(){return vd().domain(a).range([0,r])},[a,r]),l=v.useMemo(function(){return t.map(function(c){return{x:o(c.x),y:s(c.y),data:c}})},[t,o,s]);return v.useMemo(function(){var c=wh.from(l.map(function(d){return[d.x,d.y]})),u=c.voronoi([0,0,n,r]);return{points:l,delaunay:c,voronoi:u}},[l,n,r])},kle=function(e){var t=e.points,n=e.delaunay,r=e.voronoi;return v.useMemo(function(){return{points:t,delaunay:n,voronoi:r}},[t,n,r])},Mle=function(e){var t=e.elementRef,n=e.nodes,r=e.getNodePosition,i=r===void 0?Gv:r,a=e.delaunay,o=e.setCurrent,s=e.margin,l=s===void 0?Pc: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,g=e.onMouseDown,x=e.onMouseUp,_=e.onClick,w=e.onDoubleClick,C=e.onTouchStart,b=e.onTouchMove,S=e.onTouchEnd,M=e.enableTouchCrosshair,$=M!==void 0&&M,k=e.tooltip,R=e.tooltipPosition,T=R===void 0?A5:R,E=e.tooltipAnchor,A=E===void 0?R5:E,j=v.useState(null),I=j[0],D=j[1],O=v.useRef(null);v.useEffect(function(){O.current=I},[O,I]);var L=v.useCallback(function(K){if(!t.current||n.length===0)return null;var G=zo(t.current,K),oe=G[0],ne=G[1],re=a.find(oe,ne),ae=re!==void 0?n[re]:null;if(ae&&u!==1/0){var le=i(ae),ye=le[0],ge=le[1];n5(oe,ne,ye+l.left,ge+l.top)>u&&(re=null,ae=null)}return re===null||ae===null?null:[re,ae]},[t,a,n,i,l,u]),B=Ti(),P=B.showTooltipAt,H=B.showTooltipFromEvent,Y=B.hideTooltip,q=v.useMemo(function(){if(k)return T==="cursor"?function(K,G){H(k(K),G,A)}:function(K){var G=i(K),oe=G[0],ne=G[1];P(k(K),[oe+l.left,ne+l.top],A)}},[P,H,k,T,A,i,l]),Z=v.useCallback(function(K){var G=L(K);if(D(G),o==null||o(G?G[1]:null),G){var oe=G[1];q==null||q(oe,K),h==null||h(G[1],K)}},[L,D,o,q,h]),X=v.useCallback(function(K){var G=L(K);if(D(G),G){var oe=G[0],ne=G[1];if(o==null||o(ne),q==null||q(ne,K),O.current){var re=O.current,ae=re[0],le=re[1];oe!==ae?m==null||m(le,K):p==null||p(ne,K)}else h==null||h(ne,K)}else o==null||o(null),Y==null||Y(),O.current&&(m==null||m(O.current[1],K))},[L,D,o,O,h,p,m,q,Y]),J=v.useCallback(function(K){D(null),o==null||o(null),Y(),m&&O.current&&m(O.current[1],K)},[D,o,O,Y,m]),ee=v.useCallback(function(K){var G=L(K);D(G),G&&(g==null||g(G[1],K))},[L,D,g]),W=v.useCallback(function(K){var G=L(K);D(G),G&&(x==null||x(G[1],K))},[L,D,x]),F=v.useCallback(function(K){var G=L(K);D(G),G&&(_==null||_(G[1],K))},[L,D,_]),z=v.useCallback(function(K){var G=L(K);D(G),G&&(w==null||w(G[1],K))},[L,D,w]),V=v.useCallback(function(K){var G=L(K);$&&(D(G),o==null||o(G?G[1]:null)),G&&(C==null||C(G[1],K))},[L,D,o,$,C]),N=v.useCallback(function(K){var G=L(K);$&&(D(G),o==null||o(G?G[1]:null)),G&&(b==null||b(G[1],K))},[L,D,o,$,b]),te=v.useCallback(function(K){$&&(D(null),o==null||o(null)),S&&O.current&&S(O.current[1],K)},[$,D,o,S,O]);return{current:I,handleMouseEnter:f?Z:void 0,handleMouseMove:f?X:void 0,handleMouseLeave:f?J:void 0,handleMouseDown:f?ee:void 0,handleMouseUp:f?W:void 0,handleClick:f?F:void 0,handleDoubleClick:f?z:void 0,handleTouchStart:f?V:void 0,handleTouchMove:f?N:void 0,handleTouchEnd:f?te:void 0}},Ele=["theme"],Ole=function(e){var t=e.data,n=e.width,r=e.height,i=e.margin,a=e.layers,o=a===void 0?Qn.layers:a,s=e.xDomain,l=s===void 0?Qn.xDomain:s,c=e.yDomain,u=c===void 0?Qn.yDomain:c,d=e.enableLinks,f=d===void 0?Qn.enableLinks:d,h=e.linkLineWidth,p=h===void 0?Qn.linkLineWidth:h,m=e.linkLineColor,g=m===void 0?Qn.linkLineColor:m,x=e.enableCells,_=x===void 0?Qn.enableCells:x,w=e.cellLineWidth,C=w===void 0?Qn.cellLineWidth:w,b=e.cellLineColor,S=b===void 0?Qn.cellLineColor:b,M=e.enablePoints,$=M===void 0?Qn.enableCells:M,k=e.pointSize,R=k===void 0?Qn.pointSize:k,T=e.pointColor,E=T===void 0?Qn.pointColor:T,A=e.role,j=A===void 0?Qn.role:A,I=e.forwardedRef,D=oo(n,r,i),O=D.outerWidth,L=D.outerHeight,B=D.margin,P=D.innerWidth,H=D.innerHeight,Y=$le({data:t,width:P,height:H,xDomain:l,yDomain:u}),q=Y.points,Z=Y.delaunay,X=Y.voronoi,J={links:null,cells:null,points:null,bounds:null};f&&o.includes("links")&&(J.links=y.jsx("path",{stroke:g,strokeWidth:p,fill:"none",d:Z.render()},"links")),_&&o.includes("cells")&&(J.cells=y.jsx("path",{d:X.render(),fill:"none",stroke:S,strokeWidth:C},"cells")),$&&o.includes("points")&&(J.points=y.jsx("path",{stroke:"none",fill:E,d:Z.renderPoints(void 0,R/2)},"points")),o.includes("bounds")&&(J.bounds=y.jsx("path",{fill:"none",stroke:S,strokeWidth:C,d:X.renderBounds()},"bounds"));var ee=kle({points:q,delaunay:Z,voronoi:X});return y.jsx(xh,{width:O,height:L,margin:B,role:j,ref:I,children:o.map(function(W,F){return J[W]!==void 0?J[W]:typeof W=="function"?y.jsx(v.Fragment,{children:v.createElement(W,ee)},F):null})})},Ale=v.forwardRef(function(e,t){var n=e.theme,r=O5(e,Ele);return y.jsx(io,{isInteractive:!1,animate:!1,theme:n,children:y.jsx(Ole,$d({},r,{forwardedRef:t}))})}),Rle=["defaultWidth","defaultHeight","onResize","debounceResize"];v.forwardRef(function(e,t){var n=e.defaultWidth,r=e.defaultHeight,i=e.onResize,a=e.debounceResize,o=O5(e,Rle);return y.jsx(ao,{defaultWidth:n,defaultHeight:r,onResize:i,debounceResize:a,children:function(s){var l=s.width,c=s.height;return y.jsx(Ale,$d({},o,{width:l,height:c,ref:t}))}})});var Dle=function(e){var t=e.nodes,n=e.width,r=e.height,i=e.margin,a=i===void 0?Pc:i,o=e.getNodePosition,s=e.setCurrent,l=e.onMouseEnter,c=e.onMouseMove,u=e.onMouseLeave,d=e.onMouseDown,f=e.onMouseUp,h=e.onClick,p=e.onDoubleClick,m=e.onTouchStart,g=e.onTouchMove,x=e.onTouchEnd,_=e.enableTouchCrosshair,w=_!==void 0&&_,C=e.detectionRadius,b=C===void 0?1/0:C,S=e.tooltip,M=e.tooltipPosition,$=M===void 0?A5:M,k=e.tooltipAnchor,R=k===void 0?R5:k,T=e.debug,E=v.useRef(null),A=D5({points:t,getNodePosition:o,width:n,height:r,margin:a,debug:T}),j=A.delaunay,I=A.voronoi,D=Mle({elementRef:E,nodes:t,delaunay:j,margin:a,detectionRadius:b,setCurrent:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onMouseDown:d,onMouseUp:f,onClick:h,onDoubleClick:p,onTouchStart:m,onTouchMove:g,onTouchEnd:x,enableTouchCrosshair:w,tooltip:S,tooltipPosition:$,tooltipAnchor:R}),O=D.current,L=D.handleMouseEnter,B=D.handleMouseMove,P=D.handleMouseLeave,H=D.handleMouseDown,Y=D.handleMouseUp,q=D.handleClick,Z=D.handleDoubleClick,X=D.handleTouchStart,J=D.handleTouchMove,ee=D.handleTouchEnd,W=v.useMemo(function(){if(T&&I)return I.render()},[T,I]);return y.jsxs("g",{ref:E,transform:"translate("+-a.left+","+-a.top+")",children:[T&&I&&y.jsxs(y.Fragment,{children:[y.jsx("path",{d:W,stroke:"red",strokeWidth:1,opacity:.75}),b<1/0&&y.jsx("path",{stroke:"red",strokeWidth:.35,fill:"none",d:j.renderPoints(void 0,b)}),O&&y.jsx("path",{fill:"pink",opacity:.35,d:I.renderCell(O[0])})]}),y.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:L,onMouseMove:B,onMouseLeave:P,onMouseDown:H,onMouseUp:Y,onTouchStart:X,onTouchMove:J,onTouchEnd:ee,onClick:q,onDoubleClick:Z})]})},jle=function(e,t){e.save(),e.globalAlpha=.75,e.beginPath(),t.render(e),e.strokeStyle="red",e.lineWidth=1,e.stroke(),e.restore()},Ile=function(e,t,n){e.save(),e.globalAlpha=.35,e.beginPath(),t.renderCell(n,e),e.fillStyle="pink",e.fill(),e.restore()};function En(){return En=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},En.apply(null,arguments)}function _h(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ox,oi={xScale:{type:"point"},yScale:{type:"linear",min:0,max:"auto"},curve:"linear",colors:{scheme:"nivo"},lineWidth:2,layers:["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"],enablePoints:!0,pointSize:6,pointColor:{from:"series.color"},pointBorderWidth:0,pointBorderColor:{theme:"background"},enableArea:!1,areaBaselineValue:0,areaOpacity:.2,enableGridX:!0,enableGridY:!0,legends:[],isInteractive:!0,tooltip:v.memo(function(e){var t=e.point;return y.jsx(nv,{id:y.jsxs("span",{children:["x: ",y.jsx("strong",{children:t.data.xFormatted}),", y:"," ",y.jsx("strong",{children:t.data.yFormatted})]}),enableChip:!0,color:t.seriesColor})}),sliceTooltip:v.memo(function(e){var t=e.slice,n=e.axis,r=Lt(),i=n==="x"?"y":"x";return y.jsx($6,{rows:t.points.map(function(a){return[y.jsx(T6,{color:a.seriesColor,style:r.tooltip.chip},"chip"),a.seriesId,y.jsx("span",{style:r.tooltip.tableCellValue,children:a.data[i+"Formatted"]},"value")]})})}),debugMesh:!1,renderWrapper:!0},st=En({},oi,{defs:[],fill:[],enablePointLabel:!1,pointLabel:"data.yFormatted",areaBlendMode:"normal",axisTop:null,axisRight:null,axisBottom:Wn,axisLeft:Wn,useMesh:!1,enableSlices:!1,debugSlices:!1,enableCrosshair:!0,crosshairType:"bottom-left",enableTouchCrosshair:!1,initialHiddenIds:[],animate:!0,motionConfig:"gentle",role:"img",isFocusable:!1}),en=En({},oi,{pixelRatio:typeof window<"u"&&(Ox=window.devicePixelRatio)!=null?Ox:1,axisTop:null,axisRight:null,axisBottom:Wn,axisLeft:Wn});function Nle(e){return v.useMemo(function(){return fv().defined(function(t){return t.x!==null&&t.y!==null}).x(function(t){return t.x}).y(function(t){return t.y}).curve(QS(e))},[e])}function Ple(e){var t=e.curve,n=e.yScale,r=e.areaBaselineValue;return v.useMemo(function(){return NK().defined(function(i){return i.x!==null&&i.y!==null}).x(function(i){return i.x}).y1(function(i){return i.y}).curve(QS(t)).y0(n(r))},[t,n,r])}var Lle=function(e){var t=e.componentId,n=e.enableSlices,r=e.points,i=e.width,a=e.height;return v.useMemo(function(){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],g=u[c+1];return d=m?h-(h-m[0])/2:h,f=g?h-d+(g[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],g=u[c+1];return d=m?h-(h-m[0])/2:h,f=g?h-d+(g[0]-h)/2:a-d,{id:h,x0:0,x:0,y0:d,y:h,width:i,height:f,points:p.reverse()}})}return[]},[t,n,a,r,i])},Fle="line",j5=function(e){var t=e.data,n=e.xScale,r=n===void 0?oi.xScale:n,i=e.xFormat,a=e.yScale,o=a===void 0?oi.yScale:a,s=e.yFormat,l=e.width,c=e.height,u=e.colors,d=u===void 0?oi.colors:u,f=e.curve,h=f===void 0?oi.curve:f,p=e.areaBaselineValue,m=p===void 0?oi.areaBaselineValue:p,g=e.pointColor,x=g===void 0?oi.pointColor:g,_=e.pointBorderColor,w=_===void 0?oi.pointBorderColor:_,C=e.enableSlices,b=C===void 0?st.enableSlices:C,S=e.initialHiddenIds,M=S===void 0?st.initialHiddenIds:S,$=v.useState(rle(Fle))[0],k=os(i),R=os(s),T=Wv(d,"id"),E=Lt(),A=pr(x,E),j=pr(w,E),I=v.useState(M??[]),D=I[0],O=I[1],L=v.useMemo(function(){return Wse(t.filter(function(W){return D.indexOf(W.id)===-1}),r,o,l,c)},[t,D,r,o,l,c]),B=L.xScale,P=L.yScale,H=L.series,Y=v.useMemo(function(){var W=t.map(function(z){return{id:z.id,label:""+z.id,color:T(z)}}),F=W.map(function(z){return En({},H.find(function(V){return V.id===z.id}),{color:z.color})}).filter(function(z){return!!z.id});return{legendData:W.map(function(z){return En({},z,{hidden:!F.find(function(V){return V.id===z.id})})}).reverse(),series:F}},[t,H,T]),q=Y.legendData,Z=Y.series,X=v.useCallback(function(W){O(function(F){return F.indexOf(W)>-1?F.filter(function(z){return z!==W}):[].concat(F,[W])})},[]),J=function(W){var F=W.series,z=W.getPointColor,V=W.getPointBorderColor,N=W.formatX,te=W.formatY;return v.useMemo(function(){return F.reduce(function(K,G,oe){return[].concat(K,G.data.filter(function(ne){return ne.position.x!==null&&ne.position.y!==null}).map(function(ne,re){var ae={id:G.id+"."+re,indexInSeries:re,absIndex:K.length+re,seriesIndex:oe,seriesId:G.id,seriesColor:G.color,x:ne.position.x,y:ne.position.y,data:En({},ne.data,{xFormatted:N(ne.data.x),yFormatted:te(ne.data.y)})};return ae.color=z({series:G,point:ae}),ae.borderColor=V(ae),ae}))},[])},[F,z,V,N,te])}({series:Z,getPointColor:A,getPointBorderColor:j,formatX:k,formatY:R}),ee=Lle({componentId:$,enableSlices:b,points:J,width:l,height:c});return{legendData:q,toggleSeries:X,lineGenerator:Nle(h),areaGenerator:Ple({curve:h,yScale:P,areaBaselineValue:m}),getColor:T,series:Z,xScale:B,yScale:P,slices:ee,points:J}},zle=function(e){var t=e.areaBlendMode,n=e.areaOpacity,r=e.color,i=e.fill,a=e.path,o=Fn(),s=o.animate,l=o.config,c=Lv(a),u=Zr({color:r,config:l,immediate:!s});return y.jsx(Ht.path,{d:c,fill:i||u.color,fillOpacity:n,strokeWidth:0,style:{mixBlendMode:t}})},Ble=v.memo(function(e){var t=e.areaGenerator,n=e.areaOpacity,r=e.areaBlendMode,i=e.series.slice(0).reverse();return y.jsx("g",{children:i.map(function(a){return y.jsx(zle,En({path:t(a.data.map(function(o){return o.position}))},En({areaOpacity:n,areaBlendMode:r},a)),""+a.id)})})}),Wle=v.memo(function(e){var t=e.lineGenerator,n=e.points,r=e.color,i=e.thickness,a=v.useMemo(function(){return t(n)},[t,n]),o=Lv(a);return y.jsx(Ht.path,{d:o,fill:"none",strokeWidth:i,stroke:r})}),Ule=v.memo(function(e){var t=e.series,n=e.lineGenerator,r=e.lineWidth;return y.jsx(y.Fragment,{children:t.slice(0).reverse().map(function(i){var a=i.id,o=i.data,s=i.color;return y.jsx(Wle,{points:o.map(function(l){return l.position}),lineGenerator:n,color:s,thickness:r},a)})})}),Hle=v.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.onMouseDown,f=e.onMouseUp,h=e.onClick,p=e.onDoubleClick,m=e.onTouchStart,g=e.onTouchMove,x=e.onTouchEnd,_=Ti(),w=_.showTooltipFromEvent,C=_.hideTooltip,b=v.useCallback(function(I){w(v.createElement(a,{slice:t,axis:r}),I,"right"),s(t),l==null||l(t,I)},[w,a,t,r,s,l]),S=v.useCallback(function(I){w(v.createElement(a,{slice:t,axis:r}),I,"right"),c==null||c(t,I)},[w,a,t,r,c]),M=v.useCallback(function(I){C(),s(null),u==null||u(t,I)},[C,s,u,t]),$=v.useCallback(function(I){d==null||d(t,I)},[t,d]),k=v.useCallback(function(I){f==null||f(t,I)},[t,f]),R=v.useCallback(function(I){h==null||h(t,I)},[t,h]),T=v.useCallback(function(I){p==null||p(t,I)},[t,p]),E=v.useCallback(function(I){w(v.createElement(a,{slice:t,axis:r}),I,"right"),s(t),m==null||m(t,I)},[r,m,s,w,t,a]),A=v.useCallback(function(I){var D=I.touches[0],O=document.elementFromPoint(D.clientX,D.clientY),L=O==null?void 0:O.getAttribute("data-ref");if(L){var B=n.find(function(P){return P.id===L});B&&(w(v.createElement(a,{slice:B,axis:r}),I,"right"),s(B))}g==null||g(t,I)},[r,g,s,w,t,n,a]),j=v.useCallback(function(I){C(),s(null),x==null||x(t,I)},[C,s,x,t]);return y.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:b,onMouseMove:S,onMouseLeave:M,onMouseDown:$,onMouseUp:k,onClick:R,onDoubleClick:T,onTouchStart:E,onTouchMove:A,onTouchEnd:j,"data-ref":t.id})}),Vle=v.memo(function(e){var t=e.slices,n=e.axis,r=e.debug,i=e.tooltip,a=e.current,o=e.setCurrent,s=e.onMouseEnter,l=e.onMouseMove,c=e.onMouseLeave,u=e.onMouseDown,d=e.onMouseUp,f=e.onClick,h=e.onDoubleClick,p=e.onTouchStart,m=e.onTouchMove,g=e.onTouchEnd;return y.jsx(y.Fragment,{children:t.map(function(x){return y.jsx(Hle,{slice:x,slices:t,axis:n,debug:r,tooltip:i,setCurrent:o,isCurrent:a!==null&&a.id===x.id,onMouseEnter:s,onMouseMove:l,onMouseLeave:c,onMouseDown:u,onMouseUp:d,onClick:f,onDoubleClick:h,onTouchStart:p,onTouchMove:m,onTouchEnd:g},x.id)})})}),qle=v.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=e.isFocusable,c=e.setCurrentPoint,u=e.tooltip,d=e.margin,f=e.ariaLabel,h=e.ariaLabelledBy,p=e.ariaDescribedBy,m=e.ariaHidden,g=e.ariaDisabled,x=nie(o),_=Ti(),w=_.showTooltipAt,C=_.hideTooltip,b=t.slice(0).sort(function(S,M){return S.indexInSeries-M.indexInSeries}).sort(function(S,M){return M.seriesIndex-S.seriesIndex}).map(function(S){return{id:S.id,x:S.x,y:S.y,datum:S.data,fill:S.color,stroke:S.borderColor,label:a?x(S):null,ariaLabel:f?f(S):void 0,ariaLabelledBy:h?h(S):void 0,ariaDescribedBy:p?p(S):void 0,ariaHidden:m?m(S):void 0,ariaDisabled:g?g(S):void 0,onFocus:l?function(){c(S),w(v.createElement(u,{point:S}),[d.left+S.x,d.top+S.y],"top")}:void 0,onBlur:l?function(){c(null),C()}:void 0}});return y.jsx("g",{children:b.map(function(S){return y.jsx(Jre,{x:S.x,y:S.y,datum:S.datum,symbol:n,size:r,color:S.fill,borderWidth:i,borderColor:S.stroke,label:S.label,labelYOffset:s,ariaLabel:S.ariaLabel,ariaLabelledBy:S.ariaLabelledBy,ariaDescribedBy:S.ariaDescribedBy,ariaHidden:S.ariaHidden,ariaDisabled:S.ariaDisabled,isFocusable:l,onFocus:S.onFocus,onBlur:S.onBlur,testId:"line.point."+S.id},S.id)})})}),Yle=v.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.onMouseDown,u=e.onMouseUp,d=e.onClick,f=e.onDoubleClick,h=e.onTouchStart,p=e.onTouchMove,m=e.onTouchEnd,g=e.tooltip,x=e.debug,_=e.enableTouchCrosshair,w=Ti(),C=w.showTooltipAt,b=w.hideTooltip,S=v.useCallback(function(D,O){C(v.createElement(g,{point:D}),[D.x+i.left,D.y+i.top],"top"),o==null||o(D,O)},[C,g,o,i]),M=v.useCallback(function(D,O){C(v.createElement(g,{point:D}),[D.x+i.left,D.y+i.top],"top"),s==null||s(D,O)},[C,g,i.left,i.top,s]),$=v.useCallback(function(D,O){b(),l==null||l(D,O)},[b,l]),k=v.useCallback(function(D,O){c==null||c(D,O)},[c]),R=v.useCallback(function(D,O){u==null||u(D,O)},[u]),T=v.useCallback(function(D,O){d==null||d(D,O)},[d]),E=v.useCallback(function(D,O){f==null||f(D,O)},[f]),A=v.useCallback(function(D,O){C(v.createElement(g,{point:D}),[D.x+i.left,D.y+i.top],"top"),h==null||h(D,O)},[i.left,i.top,h,C,g]),j=v.useCallback(function(D,O){C(v.createElement(g,{point:D}),[D.x+i.left,D.y+i.top],"top"),p==null||p(D,O)},[i.left,i.top,p,C,g]),I=v.useCallback(function(D,O){b(),m==null||m(D,O)},[m,b]);return y.jsx(Dle,{nodes:t,width:n,height:r,setCurrent:a,onMouseEnter:S,onMouseMove:M,onMouseLeave:$,onMouseDown:k,onMouseUp:R,onClick:T,onDoubleClick:E,onTouchStart:A,onTouchMove:j,onTouchEnd:I,enableTouchCrosshair:_,debug:x})}),Gle=["isInteractive","animate","motionConfig","theme","renderWrapper"];function Zle(e){var t=e.data,n=e.xScale,r=n===void 0?st.xScale:n,i=e.xFormat,a=e.yScale,o=a===void 0?st.yScale:a,s=e.yFormat,l=e.curve,c=l===void 0?st.curve:l,u=e.margin,d=e.width,f=e.height,h=e.colors,p=h===void 0?st.colors:h,m=e.lineWidth,g=m===void 0?st.lineWidth:m,x=e.layers,_=x===void 0?st.layers:x,w=e.enableArea,C=w===void 0?st.enableArea:w,b=e.areaBaselineValue,S=b===void 0?st.areaBaselineValue:b,M=e.areaOpacity,$=M===void 0?st.areaOpacity:M,k=e.areaBlendMode,R=k===void 0?st.areaBlendMode:k,T=e.enablePoints,E=T===void 0?st.enablePoints:T,A=e.pointSymbol,j=e.pointSize,I=j===void 0?st.pointSize:j,D=e.pointColor,O=D===void 0?st.pointColor:D,L=e.pointBorderWidth,B=L===void 0?st.pointBorderWidth:L,P=e.pointBorderColor,H=P===void 0?st.pointBorderColor:P,Y=e.enablePointLabel,q=Y===void 0?st.enablePointLabel:Y,Z=e.pointLabel,X=Z===void 0?st.pointLabel:Z,J=e.pointLabelYOffset,ee=e.enableGridX,W=ee===void 0?st.enableGridX:ee,F=e.gridXValues,z=e.enableGridY,V=z===void 0?st.enableGridY:z,N=e.gridYValues,te=e.axisTop,K=e.axisRight,G=e.axisBottom,oe=G===void 0?st.axisBottom:G,ne=e.axisLeft,re=ne===void 0?st.axisLeft:ne,ae=e.defs,le=ae===void 0?st.defs:ae,ye=e.fill,ge=ye===void 0?st.fill:ye,be=e.markers,Me=e.legends,ce=Me===void 0?st.legends:Me,de=e.isInteractive,Ce=de===void 0?st.isInteractive:de,Ge=e.useMesh,we=Ge===void 0?st.useMesh:Ge,ve=e.debugMesh,Pe=ve===void 0?st.debugMesh:ve,Ze=e.onMouseEnter,_t=e.onMouseMove,Te=e.onMouseLeave,Re=e.onMouseDown,at=e.onMouseUp,Ue=e.onClick,mt=e.onDoubleClick,ut=e.onTouchStart,At=e.onTouchMove,Ke=e.onTouchEnd,Le=e.tooltip,Ve=Le===void 0?st.tooltip:Le,et=e.enableSlices,Fe=et===void 0?st.enableSlices:et,tt=e.debugSlices,vt=tt===void 0?st.debugSlices:tt,ot=e.sliceTooltip,Ne=ot===void 0?st.sliceTooltip:ot,Ee=e.enableCrosshair,Ye=Ee===void 0?st.enableCrosshair:Ee,xt=e.crosshairType,nt=xt===void 0?st.crosshairType:xt,bt=e.enableTouchCrosshair,Jt=bt===void 0?st.enableTouchCrosshair:bt,Ft=e.role,Bt=Ft===void 0?st.role:Ft,fn=e.ariaLabel,qt=e.ariaLabelledBy,$e=e.ariaDescribedBy,Je=e.isFocusable,St=Je===void 0?st.isFocusable:Je,an=e.pointAriaLabel,Yt=e.pointAriaLabelledBy,ze=e.pointAriaDescribedBy,Be=e.pointAriaHidden,ht=e.pointAriaDisabled,Rt=e.initialHiddenIds,Tt=Rt===void 0?st.initialHiddenIds:Rt,Qe=e.forwardedRef,$t=oo(d,f,u),vr=$t.margin,ln=$t.innerWidth,cn=$t.innerHeight,An=$t.outerWidth,ia=$t.outerHeight,Ct=j5({data:t,xScale:r,xFormat:i,yScale:o,yFormat:s,width:ln,height:cn,colors:p,curve:c,areaBaselineValue:S,pointColor:O,pointBorderColor:H,enableSlices:Fe,initialHiddenIds:Tt}),aa=Ct.legendData,Ae=Ct.toggleSeries,Er=Ct.lineGenerator,oa=Ct.areaGenerator,so=Ct.series,lo=Ct.xScale,Jr=Ct.yScale,Lc=Ct.slices,Qr=Ct.points,As=v.useState(null),sa=As[0],Rs=As[1],Fc=v.useState(null),la=Fc[0],zc=Fc[1],Rn={grid:null,markers:null,axes:null,areas:null,crosshair:null,lines:null,points:null,slices:null,mesh:null,legends:null};_.includes("grid")&&(W||V)&&(Rn.grid=y.jsx(M5,{width:ln,height:cn,xScale:W?lo:null,yScale:V?Jr:null,xValues:F,yValues:N},"grid")),_.includes("markers")&&Array.isArray(be)&&be.length>0&&(Rn.markers=y.jsx(JS,{markers:be,width:ln,height:cn,xScale:lo,yScale:Jr},"markers")),_.includes("axes")&&(Rn.axes=y.jsx(k5,{xScale:lo,yScale:Jr,width:ln,height:cn,top:te,right:K,bottom:oe,left:re},"axes")),_.includes("lines")&&(Rn.lines=y.jsx(Ule,{series:so,lineGenerator:Er,lineWidth:g},"lines")),_.includes("legends")&&ce.length>0&&(Rn.legends=y.jsx(v.Fragment,{children:ce.map(function(Or,$i){return y.jsx(Vv,En({},Or,{containerWidth:ln,containerHeight:cn,data:Or.data||aa,toggleSerie:Or.toggleSerie?Ae:void 0}),$i)})},"legends"));var Th=zv(le,so,ge);C&&(Rn.areas=y.jsx(Ble,{areaGenerator:oa,areaOpacity:$,areaBlendMode:R,series:so},"areas")),Ce&&Fe!==!1&&(Rn.slices=y.jsx(Vle,{slices:Lc,axis:Fe,debug:vt,tooltip:Ne,current:la,setCurrent:zc,onMouseEnter:Ze,onMouseMove:_t,onMouseLeave:Te,onMouseDown:Re,onMouseUp:at,onClick:Ue,onDoubleClick:mt,onTouchStart:ut,onTouchMove:At,onTouchEnd:Ke},"slices")),E&&(Rn.points=y.jsx(qle,{points:Qr,symbol:A,size:I,borderWidth:B,enableLabel:q,label:X,labelYOffset:J,isFocusable:St,setCurrentPoint:Rs,tooltip:Ve,margin:vr,ariaLabel:an,ariaLabelledBy:Yt,ariaDescribedBy:ze,ariaHidden:Be,ariaDisabled:ht},"points")),Ce&&Ye&&(sa!==null&&(Rn.crosshair=y.jsx(Bm,{width:ln,height:cn,x:sa.x,y:sa.y,type:nt},"crosshair")),la!==null&&Fe&&(Rn.crosshair=y.jsx(Bm,{width:ln,height:cn,x:la.x,y:la.y,type:Fe},"crosshair"))),Ce&&we&&Fe===!1&&(Rn.mesh=y.jsx(Yle,{points:Qr,width:ln,height:cn,margin:vr,setCurrent:Rs,onMouseEnter:Ze,onMouseMove:_t,onMouseLeave:Te,onMouseDown:Re,onMouseUp:at,onClick:Ue,onDoubleClick:mt,onTouchStart:ut,onTouchMove:At,onTouchEnd:Ke,tooltip:Ve,enableTouchCrosshair:Jt,debug:Pe},"mesh"));var $h=En({},e,{innerWidth:ln,innerHeight:cn,series:so,slices:Lc,points:Qr,xScale:lo,yScale:Jr,lineGenerator:Er,areaGenerator:oa,currentPoint:sa,setCurrentPoint:Rs,currentSlice:la,setCurrentSlice:zc});return y.jsx(xh,{defs:Th,width:An,height:ia,margin:vr,role:Bt,ariaLabel:fn,ariaLabelledBy:qt,ariaDescribedBy:$e,isFocusable:St,ref:Qe,children:_.map(function(Or,$i){return typeof Or=="function"?y.jsx(v.Fragment,{children:Or($h)},$i):Rn[Or]})})}var Xle=v.forwardRef(function(e,t){var n=e.isInteractive,r=n===void 0?st.isInteractive:n,i=e.animate,a=i===void 0?st.animate:i,o=e.motionConfig,s=o===void 0?st.motionConfig:o,l=e.theme,c=e.renderWrapper,u=_h(e,Gle);return y.jsx(io,{animate:a,isInteractive:r,motionConfig:s,renderWrapper:c,theme:l,children:y.jsx(Zle,En({isInteractive:r},u,{forwardedRef:t}))})}),Kle=["defaultWidth","defaultHeight","onResize","debounceResize"],Jle=v.forwardRef(function(e,t){var n=e.defaultWidth,r=e.defaultHeight,i=e.onResize,a=e.debounceResize,o=_h(e,Kle);return y.jsx(ao,{defaultWidth:n,defaultHeight:r,onResize:i,debounceResize:a,children:function(s){var l=s.width,c=s.height;return y.jsx(Xle,En({width:l,height:c},o,{ref:t}))}})}),Qle=["isInteractive","renderWrapper","theme"],ece=function(e){var t=e.width,n=e.height,r=e.margin,i=e.pixelRatio,a=i===void 0?en.pixelRatio:i,o=e.data,s=e.xScale,l=s===void 0?en.xScale:s,c=e.xFormat,u=e.yScale,d=u===void 0?en.yScale:u,f=e.yFormat,h=e.curve,p=h===void 0?en.curve:h,m=e.layers,g=m===void 0?en.layers:m,x=e.colors,_=x===void 0?en.colors:x,w=e.lineWidth,C=w===void 0?en.lineWidth:w,b=e.enableArea,S=b===void 0?en.enableArea:b,M=e.areaBaselineValue,$=M===void 0?en.areaBaselineValue:M,k=e.areaOpacity,R=k===void 0?en.areaOpacity:k,T=e.enablePoints,E=T===void 0?en.enablePoints:T,A=e.pointSize,j=A===void 0?en.pointSize:A,I=e.pointColor,D=I===void 0?en.pointColor:I,O=e.pointBorderWidth,L=O===void 0?en.pointBorderWidth:O,B=e.pointBorderColor,P=B===void 0?en.pointBorderColor:B,H=e.enableGridX,Y=H===void 0?en.enableGridX:H,q=e.gridXValues,Z=e.enableGridY,X=Z===void 0?en.enableGridY:Z,J=e.gridYValues,ee=e.axisTop,W=e.axisRight,F=e.axisBottom,z=F===void 0?en.axisBottom:F,V=e.axisLeft,N=V===void 0?en.axisLeft:V,te=e.legends,K=te===void 0?en.legends:te,G=e.isInteractive,oe=G===void 0?en.isInteractive:G,ne=e.debugMesh,re=ne===void 0?en.debugMesh:ne,ae=e.onMouseLeave,le=e.onMouseDown,ye=e.onMouseUp,ge=e.onClick,be=e.onDoubleClick,Me=e.tooltip,ce=Me===void 0?en.tooltip:Me,de=e.role,Ce=e.forwardedRef,Ge=v.useRef(null),we=oo(t,n,r),ve=we.margin,Pe=we.innerWidth,Ze=we.innerHeight,_t=we.outerWidth,Te=we.outerHeight,Re=Lt(),at=v.useState(null),Ue=at[0],mt=at[1],ut=j5({data:o,xScale:l,xFormat:c,yScale:d,yFormat:f,width:Pe,height:Ze,colors:_,curve:p,areaBaselineValue:$,pointColor:D,pointBorderColor:P}),At=ut.lineGenerator,Ke=ut.areaGenerator,Le=ut.series,Ve=ut.xScale,et=ut.yScale,Fe=ut.points,tt=v.useMemo(function(){return{innerWidth:Pe,innerHeight:Ze,series:Le,points:Fe,xScale:Ve,yScale:et,lineWidth:C,lineGenerator:At,areaGenerator:Ke,currentPoint:Ue,setCurrentPoint:mt}},[Pe,Ze,Le,Fe,Ve,et,C,At,Ke,Ue,mt]),vt=D5({points:Fe,width:Pe,height:Ze,debug:re}),ot=vt.delaunay,Ne=vt.voronoi;v.useEffect(function(){if(Ge.current!==null){Ge.current.width=_t*a,Ge.current.height=Te*a;var $e=Ge.current.getContext("2d");$e.scale(a,a),$e.fillStyle=Re.background,$e.fillRect(0,0,_t,Te),$e.translate(ve.left,ve.top),g.forEach(function(Je){var St;typeof Je=="function"&&Je($e,tt);var an=(St=Re.grid.line.strokeWidth)!=null?St:0;if(Je==="grid"&&typeof an!="string"&&an>0&&($e.lineWidth=an,$e.strokeStyle=Re.grid.line.stroke,Y&&Sd($e,{width:Pe,height:Ze,scale:Ve,axis:"x",values:q}),X&&Sd($e,{width:Pe,height:Ze,scale:et,axis:"y",values:J})),Je==="axes"&&E5($e,{xScale:Ve,yScale:et,width:Pe,height:Ze,top:ee,right:W,bottom:z,left:N,theme:Re}),Je==="areas"&&S===!0){$e.save(),$e.globalAlpha=R,Ke.context($e);for(var Yt=Le.length-1;Yt>=0;Yt--)$e.fillStyle=Le[Yt].color,$e.beginPath(),Ke(Le[Yt].data.map(function(Be){return Be.position})),$e.fill();$e.restore()}if(Je==="lines"&&(At.context($e),Le.forEach(function(Be){$e.strokeStyle=Be.color,$e.lineWidth=C,$e.beginPath(),At(Be.data.map(function(ht){return ht.position})),$e.stroke()})),Je==="points"&&E===!0&&j>0&&Fe.forEach(function(Be){$e.fillStyle=Be.color,$e.beginPath(),$e.arc(Be.x,Be.y,j/2,0,2*Math.PI),$e.fill(),L>0&&($e.strokeStyle=Be.borderColor,$e.lineWidth=L,$e.stroke())}),Je==="mesh"&&re===!0&&Ne!==void 0&&(jle($e,Ne),Ue&&Ile($e,Ne,Ue.absIndex)),Je==="legends"){var ze=Le.map(function(Be){return{id:Be.id,label:Be.id,color:Be.color}}).reverse();K.forEach(function(Be){qv($e,En({},Be,{data:Be.data||ze,containerWidth:Pe,containerHeight:Ze,theme:Re}))})}})}},[Ge,Pe,_t,Ze,Te,ve.left,ve.top,a,g,Re,At,Le,Ve,et,Y,q,X,J,ee,W,z,N,K,Fe,E,j,L,Ue,tt,re,S,Ke,R,C,Ne]);var Ee=v.useCallback(function($e){if(!Ge.current)return null;var Je=zo(Ge.current,$e),St=Je[0],an=Je[1];if(!r5(ve.left,ve.top,Pe,Ze,St,an))return null;var Yt=ot.find(St-ve.left,an-ve.top);return Fe[Yt]},[Ge,ve,Pe,Ze,ot,Fe]),Ye=Ti(),xt=Ye.showTooltipFromEvent,nt=Ye.hideTooltip,bt=v.useCallback(function($e){var Je=Ee($e);mt(Je),Je?xt(v.createElement(ce,{point:Je}),$e):nt()},[Ee,mt,xt,nt,ce]),Jt=v.useCallback(function($e){nt(),mt(null),Ue&&(ae==null||ae(Ue,$e))},[nt,mt,ae,Ue]),Ft=v.useCallback(function($e){if(le){var Je=Ee($e);Je&&le(Je,$e)}},[Ee,le]),Bt=v.useCallback(function($e){if(ye){var Je=Ee($e);Je&&ye(Je,$e)}},[Ee,ye]),fn=v.useCallback(function($e){if(ge){var Je=Ee($e);Je&&ge(Je,$e)}},[Ee,ge]),qt=v.useCallback(function($e){if(be){var Je=Ee($e);Je&&be(Je,$e)}},[Ee,be]);return y.jsx("canvas",{ref:Bv(Ge,Ce),width:_t*a,height:Te*a,style:{width:_t,height:Te,cursor:oe?"auto":"normal"},onMouseEnter:oe?bt:void 0,onMouseMove:oe?bt:void 0,onMouseLeave:oe?Jt:void 0,onMouseDown:oe?Ft:void 0,onMouseUp:oe?Bt:void 0,onClick:oe?fn:void 0,onDoubleClick:oe?qt:void 0,role:de})},tce=v.forwardRef(function(e,t){var n=e.isInteractive,r=e.renderWrapper,i=e.theme,a=_h(e,Qle);return y.jsx(io,{isInteractive:n,renderWrapper:r,theme:i,animate:!1,children:y.jsx(ece,En({},a,{forwardedRef:t}))})}),nce=["defaultWidth","defaultHeight","onResize","debounceResize"];v.forwardRef(function(e,t){var n=e.defaultWidth;e.defaultHeight;var r=e.onResize,i=e.debounceResize,a=_h(e,nce);return y.jsx(ao,{defaultWidth:n,defaultHeight:n,onResize:r,debounceResize:i,children:function(o){var s=o.width,l=o.height;return y.jsx(tce,En({width:s,height:l},a,{ref:t}))}})});var rce=b5;function ice(e,t){var n=[];return rce(e,function(r,i,a){t(r,i,a)&&n.push(r)}),n}var ace=ice,oce=BS,sce=ace,lce=Yv,cce=Kn;function uce(e,t){var n=cce(e)?oce:sce;return n(e,lce(t))}var dce=uce;const fce=nn(dce);var hce=Si,pce=gr,mce="[object Number]";function gce(e){return typeof e=="number"||pce(e)&&hce(e)==mce}var vce=gce;const Ax=nn(vce);function bce(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var yce=bce,xce=Ts,wce=Dc;function _ce(e,t){return e&&xce(t,wce(t),e)}var Cce=_ce,Sce=Ts,Tce=Oc;function $ce(e,t){return e&&Sce(t,Tce(t),e)}var kce=$ce,Mce=Ts,Ece=Nv;function Oce(e,t){return Mce(e,Ece(e),t)}var Ace=Oce,Rce=jv,Dce=q0,jce=Nv,Ice=WS,Nce=Object.getOwnPropertySymbols,Pce=Nce?function(e){for(var t=[];e;)Rce(t,jce(e)),e=Dce(e);return t}:Ice,I5=Pce,Lce=Ts,Fce=I5;function zce(e,t){return Lce(e,Fce(e),t)}var Bce=zce,Wce=zS,Uce=I5,Hce=Oc;function Vce(e){return Wce(e,Hce,Uce)}var N5=Vce,qce=Object.prototype,Yce=qce.hasOwnProperty;function Gce(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&Yce.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var Zce=Gce,Xce=V0;function Kce(e,t){var n=t?Xce(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Jce=Kce,Qce=/\w*$/;function eue(e){var t=new e.constructor(e.source,Qce.exec(e));return t.lastIndex=e.lastIndex,t}var tue=eue,Rx=ys,Dx=Rx?Rx.prototype:void 0,jx=Dx?Dx.valueOf:void 0;function nue(e){return jx?Object(jx.call(e)):{}}var rue=nue,iue=V0,aue=Jce,oue=tue,sue=rue,lue=r6,cue="[object Boolean]",uue="[object Date]",due="[object Map]",fue="[object Number]",hue="[object RegExp]",pue="[object Set]",mue="[object String]",gue="[object Symbol]",vue="[object ArrayBuffer]",bue="[object DataView]",yue="[object Float32Array]",xue="[object Float64Array]",wue="[object Int8Array]",_ue="[object Int16Array]",Cue="[object Int32Array]",Sue="[object Uint8Array]",Tue="[object Uint8ClampedArray]",$ue="[object Uint16Array]",kue="[object Uint32Array]";function Mue(e,t,n){var r=e.constructor;switch(t){case vue:return iue(e);case cue:case uue:return new r(+e);case bue:return aue(e,n);case yue:case xue:case wue:case _ue:case Cue:case Sue:case Tue:case $ue:case kue:return lue(e,n);case due:return new r;case fue:case mue:return new r(e);case hue:return oue(e);case pue:return new r;case gue:return sue(e)}}var Eue=Mue,Oue=yh,Aue=gr,Rue="[object Map]";function Due(e){return Aue(e)&&Oue(e)==Rue}var jue=Due,Iue=jue,Nue=Ss,Ix=Of,Nx=Ix&&Ix.isMap,Pue=Nx?Nue(Nx):Iue,Lue=Pue,Fue=yh,zue=gr,Bue="[object Set]";function Wue(e){return zue(e)&&Fue(e)==Bue}var Uue=Wue,Hue=Uue,Vue=Ss,Px=Of,Lx=Px&&Px.isSet,que=Lx?Vue(Lx):Hue,Yue=que,Gue=kf,Zue=yce,Xue=J0,Kue=Cce,Jue=kce,Que=t6,ede=i6,tde=Ace,nde=Bce,rde=US,ide=N5,ade=yh,ode=Zce,sde=Eue,lde=o6,cde=Kn,ude=Ef,dde=Lue,fde=Kr,hde=Yue,pde=Dc,mde=Oc,gde=1,vde=2,bde=4,P5="[object Arguments]",yde="[object Array]",xde="[object Boolean]",wde="[object Date]",_de="[object Error]",L5="[object Function]",Cde="[object GeneratorFunction]",Sde="[object Map]",Tde="[object Number]",F5="[object Object]",$de="[object RegExp]",kde="[object Set]",Mde="[object String]",Ede="[object Symbol]",Ode="[object WeakMap]",Ade="[object ArrayBuffer]",Rde="[object DataView]",Dde="[object Float32Array]",jde="[object Float64Array]",Ide="[object Int8Array]",Nde="[object Int16Array]",Pde="[object Int32Array]",Lde="[object Uint8Array]",Fde="[object Uint8ClampedArray]",zde="[object Uint16Array]",Bde="[object Uint32Array]",Gt={};Gt[P5]=Gt[yde]=Gt[Ade]=Gt[Rde]=Gt[xde]=Gt[wde]=Gt[Dde]=Gt[jde]=Gt[Ide]=Gt[Nde]=Gt[Pde]=Gt[Sde]=Gt[Tde]=Gt[F5]=Gt[$de]=Gt[kde]=Gt[Mde]=Gt[Ede]=Gt[Lde]=Gt[Fde]=Gt[zde]=Gt[Bde]=!0;Gt[_de]=Gt[L5]=Gt[Ode]=!1;function Eu(e,t,n,r,i,a){var o,s=t&gde,l=t&vde,c=t&bde;if(n&&(o=i?n(e,r,i,a):n(e)),o!==void 0)return o;if(!fde(e))return e;var u=cde(e);if(u){if(o=ode(e),!s)return ede(e,o)}else{var d=ade(e),f=d==L5||d==Cde;if(ude(e))return Que(e,s);if(d==F5||d==P5||f&&!i){if(o=l||f?{}:lde(e),!s)return l?nde(e,Jue(o,e)):tde(e,Kue(o,e))}else{if(!Gt[d])return i?e:{};o=sde(e,d,s)}}a||(a=new Gue);var h=a.get(e);if(h)return h;a.set(e,o),hde(e)?e.forEach(function(g){o.add(Eu(g,t,n,g,e,a))}):dde(e)&&e.forEach(function(g,x){o.set(x,Eu(g,t,n,x,e,a))});var p=c?l?ide:rde:l?mde:pde,m=u?void 0:p(e);return Zue(m||e,function(g,x){m&&(x=g,g=e[x]),Xue(o,x,Eu(g,t,n,x,e,a))}),o}var Wde=Eu;function Ude(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 Hde=Ude,Vde=Ac,qde=Hde;function Yde(e,t){return t.length<2?e:Vde(e,qde(t,0,-1))}var Gde=Yde,Zde=$s,Xde=jS,Kde=Gde,Jde=ks;function Qde(e,t){return t=Zde(t,e),e=Kde(e,t),e==null||delete e[Jde(Xde(t))]}var efe=Qde,tfe=Z0;function nfe(e){return tfe(e)?void 0:e}var rfe=nfe,ife=jf,afe=Wde,ofe=efe,sfe=$s,lfe=Ts,cfe=rfe,ufe=LS,dfe=N5,ffe=1,hfe=2,pfe=4,mfe=ufe(function(e,t){var n={};if(e==null)return n;var r=!1;t=ife(t,function(a){return a=sfe(a,e),r||(r=a.length>1),a}),lfe(e,dfe(e),n),r&&(n=afe(n,ffe|hfe|pfe,cfe));for(var i=t.length;i--;)ofe(n,t[i]);return n}),gfe=mfe;const z5=nn(gfe);function Yr(){return Yr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yr.apply(null,arguments)}var lg={dotSize:4,noteWidth:120,noteTextOffset:8},vfe=function(e){var t=typeof e;return v.isValidElement(e)||t==="string"||t==="function"||t==="object"},bfe=function(e){var t=typeof e;return t==="string"||t==="function"},ac=function(e){return e.type==="circle"},cg=function(e){return e.type==="dot"},oc=function(e){return e.type==="rect"},yfe=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,fce(t,o.match).map(function(l){var c=r(l),u=i(l);return(ac(o)||oc(o))&&(u.size=u.size+2*s,u.width=u.width+2*s,u.height=u.height+2*s),Yr({},z5(o,["match","offset"]),c,u,{size:o.size||u.size,datum:l})}))},[])},xfe=function(e,t,n,r){var i=Math.atan2(r-t,n-e);return qre(jc(i))},B5=function(e){var t,n,r=e.x,i=e.y,a=e.noteX,o=e.noteY,s=e.noteWidth,l=s===void 0?lg.noteWidth:s,c=e.noteTextOffset,u=c===void 0?lg.noteTextOffset:c;if(Ax(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(Ax(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=xfe(r,i,t,n);if(ac(e)){var p=ja(dr(h),e.size/2);d+=p.x,f+=p.y}if(oc(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 g=t,x=t;return(h+90)%360>180?(g-=l,x-=l):x+=l,{points:[[d,f],[t,n],[x,n]],text:[g,n-u],angle:h+90}},W5=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return v.useMemo(function(){return yfe({data:t,annotations:n,getPosition:r,getDimensions:i})},[t,n,r,i])},wfe=function(e){var t=e.annotations;return v.useMemo(function(){return t.map(function(n){return Yr({},n,{computed:B5(Yr({},n))})})},[t])},_fe=function(e){return v.useMemo(function(){return B5(e)},[e])},Cfe=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,a=Lt(),o=Fn(),s=o.animate,l=o.config,c=Zr({x:n,y:r,config:l,immediate:!s});return typeof i=="function"?v.createElement(i,{x:n,y:r,datum:t}):y.jsxs(y.Fragment,{children:[a.annotations.text.outlineWidth>0&&y.jsx(Ht.text,{x:c.x,y:c.y,style:Yr({},a.annotations.text,{strokeLinejoin:"round",strokeWidth:2*a.annotations.text.outlineWidth,stroke:a.annotations.text.outlineColor}),children:i}),y.jsx(Ht.text,{x:c.x,y:c.y,style:z5(a.annotations.text,["outlineWidth","outlineColor"]),children:i})]})},Fx=function(e){var t=e.points,n=e.isOutline,r=n!==void 0&&n,i=Lt(),a=v.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=Lv(a);if(r&&i.annotations.link.outlineWidth<=0)return null;var s=Yr({},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),y.jsx(Ht.path,{fill:"none",d:o,style:s})},Sfe=function(e){var t=e.x,n=e.y,r=e.size,i=Lt(),a=Fn(),o=a.animate,s=a.config,l=Zr({x:t,y:n,radius:r/2,config:s,immediate:!o});return y.jsxs(y.Fragment,{children:[i.annotations.outline.outlineWidth>0&&y.jsx(Ht.circle,{cx:l.x,cy:l.y,r:l.radius,style:Yr({},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})}),y.jsx(Ht.circle,{cx:l.x,cy:l.y,r:l.radius,style:i.annotations.outline})]})},Tfe=function(e){var t=e.x,n=e.y,r=e.size,i=r===void 0?lg.dotSize:r,a=Lt(),o=Fn(),s=o.animate,l=o.config,c=Zr({x:t,y:n,radius:i/2,config:l,immediate:!s});return y.jsxs(y.Fragment,{children:[a.annotations.outline.outlineWidth>0&&y.jsx(Ht.circle,{cx:c.x,cy:c.y,r:c.radius,style:Yr({},a.annotations.outline,{fill:"none",strokeWidth:2*a.annotations.outline.outlineWidth,stroke:a.annotations.outline.outlineColor,opacity:a.annotations.outline.outlineOpacity})}),y.jsx(Ht.circle,{cx:c.x,cy:c.y,r:c.radius,style:a.annotations.symbol})]})},$fe=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=Lt(),l=Fn(),c=l.animate,u=l.config,d=Zr({x:t-r/2,y:n-i/2,width:r,height:i,config:u,immediate:!c});return y.jsxs(y.Fragment,{children:[s.annotations.outline.outlineWidth>0&&y.jsx(Ht.rect,{x:d.x,y:d.y,rx:o,ry:o,width:d.width,height:d.height,style:Yr({},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})}),y.jsx(Ht.rect,{x:d.x,y:d.y,rx:o,ry:o,width:d.width,height:d.height,style:s.annotations.outline})]})},kfe=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,a=_fe(e);if(!vfe(i))throw new Error("note should be a valid react element");return y.jsxs(y.Fragment,{children:[y.jsx(Fx,{points:a.points,isOutline:!0}),ac(e)&&y.jsx(Sfe,{x:n,y:r,size:e.size}),cg(e)&&y.jsx(Tfe,{x:n,y:r,size:e.size}),oc(e)&&y.jsx($fe,{x:n,y:r,width:e.width,height:e.height,borderRadius:e.borderRadius}),y.jsx(Fx,{points:a.points}),y.jsx(Cfe,{datum:t,x:a.text[0],y:a.text[1],note:i})]})},zx=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)})},Mfe=function(e,t){var n=t.annotations,r=t.theme;n.length!==0&&(e.save(),n.forEach(function(i){if(!bfe(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(),zx(e,i.computed.points),e.stroke(),e.lineCap="butt"),ac(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()),cg(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()),oc(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(),zx(e,i.computed.points),e.stroke(),ac(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()),cg(i)&&(e.fillStyle=r.annotations.symbol.fill,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.fill()),oc(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())},Efe=function(e,t,n,r,i,a){a>0?(e.moveTo(t+a,n),e.lineTo(t+r-a,n),e.quadraticCurveTo(t+r,n,t+r,n+a),e.lineTo(t+r,n+i-a),e.quadraticCurveTo(t+r,n+i,t+r-a,n+i),e.lineTo(t+a,n+i),e.quadraticCurveTo(t,n+i,t,n+i-a),e.lineTo(t,n+a),e.quadraticCurveTo(t,n,t+a,n),e.closePath()):e.rect(t,n,r,i)};function kt(){return kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kt.apply(null,arguments)}function ra(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Bx,Ofe=function(e){var t=e.bars,n=e.annotations,r=W5({data:t,annotations:n,getPosition:function(i){return{x:i.x+i.width/2,y:i.y+i.height/2}},getDimensions:function(i){var a=i.height,o=i.width;return{width:o,height:a,size:Math.max(o,a)}}});return y.jsx(y.Fragment,{children:r.map(function(i,a){return y.jsx(kfe,kt({},i),a)})})},Afe=function(e){var t=e.width,n=e.height,r=e.legends,i=e.toggleSerie;return y.jsx(y.Fragment,{children:r.map(function(a,o){var s,l=a[0],c=a[1];return y.jsx(Vv,kt({},l,{containerWidth:t,containerHeight:n,data:(s=l.data)!=null?s:c,toggleSerie:l.toggleSerie&&l.dataFrom==="keys"?i:void 0}),o)})})},Rfe=["data"],Dfe=function(e){var t,n=e.bar,r=n.data,i=ra(n,Rfe),a=e.style,o=a.borderColor,s=a.color,l=a.height,c=a.labelColor,u=a.labelOpacity,d=a.labelX,f=a.labelY,h=a.transform,p=a.width,m=a.textAnchor,g=e.borderRadius,x=e.borderWidth,_=e.label,w=e.shouldRenderLabel,C=e.isInteractive,b=e.onClick,S=e.onMouseEnter,M=e.onMouseLeave,$=e.tooltip,k=e.isFocusable,R=e.ariaLabel,T=e.ariaLabelledBy,E=e.ariaDescribedBy,A=e.ariaDisabled,j=e.ariaHidden,I=Lt(),D=Ti(),O=D.showTooltipFromEvent,L=D.showTooltipAt,B=D.hideTooltip,P=v.useMemo(function(){return function(){return v.createElement($,kt({},i,r))}},[$,i,r]),H=v.useCallback(function(ee){b==null||b(kt({color:i.color},r),ee)},[i,r,b]),Y=v.useCallback(function(ee){return O(P(),ee)},[O,P]),q=v.useCallback(function(ee){S==null||S(r,ee),O(P(),ee)},[r,S,O,P]),Z=v.useCallback(function(ee){M==null||M(r,ee),B()},[r,B,M]),X=v.useCallback(function(){L(P(),[i.absX+i.width/2,i.absY])},[L,P,i]),J=v.useCallback(function(){B()},[B]);return y.jsxs(Ht.g,{transform:h,children:[y.jsx(Ht.rect,{width:Ki(p,function(ee){return Math.max(ee,0)}),height:Ki(l,function(ee){return Math.max(ee,0)}),rx:g,ry:g,fill:(t=r.fill)!=null?t:s,strokeWidth:x,stroke:o,focusable:k,tabIndex:k?0:void 0,"aria-label":R?R(r):void 0,"aria-labelledby":T?T(r):void 0,"aria-describedby":E?E(r):void 0,"aria-disabled":A?A(r):void 0,"aria-hidden":j?j(r):void 0,onMouseEnter:C?q:void 0,onMouseMove:C?Y:void 0,onMouseLeave:C?Z:void 0,onClick:C?H:void 0,onFocus:C&&k?X:void 0,onBlur:C&&k?J:void 0,"data-testid":"bar.item."+r.id+"."+r.index}),w&&y.jsx(Os,{x:d,y:f,textAnchor:m,dominantBaseline:"central",fillOpacity:u,style:kt({},I.labels.text,{pointerEvents:"none",fill:c}),children:_})]})},jfe=["color","label"],Ife=function(e){var t=e.color,n=e.label,r=ra(e,jfe);return y.jsx(nv,{id:n,value:r.formattedValue,enableChip:!0,color:t})},Ut={indexBy:"id",keys:["value"],groupMode:"stacked",layout:"vertical",valueScale:{type:"linear",nice:!0,round:!1},indexScale:{type:"band",round:!1},padding:.1,innerPadding:0,enableGridX:!1,enableGridY:!0,enableLabel:!0,label:"formattedValue",labelPosition:"middle",labelOffset:0,labelSkipWidth:0,labelSkipHeight:0,labelTextColor:{theme:"labels.text.fill"},colorBy:"id",colors:{scheme:"nivo"},borderRadius:0,borderWidth:0,borderColor:{from:"color"},isInteractive:!0,tooltip:Ife,tooltipLabel:function(e){return e.id+" - "+e.indexValue},legends:[],initialHiddenIds:[],annotations:[],enableTotals:!1,totalsOffset:10},Wt=kt({},Ut,{layers:["grid","axes","bars","totals","markers","legends","annotations"],axisTop:null,axisRight:null,axisBottom:{},axisLeft:{},barComponent:Dfe,defs:[],fill:[],markers:[],animate:!0,animateOnMount:!1,motionConfig:"default",role:"img",isFocusable:!1}),un=kt({},Ut,{layers:["grid","axes","bars","totals","legends","annotations"],axisTop:null,axisRight:null,axisBottom:{},axisLeft:{},renderBar:function(e,t){var n=t.bar,r=n.color,i=n.height,a=n.width,o=n.x,s=n.y,l=t.borderColor,c=t.borderRadius,u=t.borderWidth,d=t.label,f=t.shouldRenderLabel,h=t.labelStyle,p=t.labelX,m=t.labelY,g=t.textAnchor;e.fillStyle=r,u>0&&(e.strokeStyle=l,e.lineWidth=u),e.beginPath(),Efe(e,o,s,a,i,Math.min(c,i)),e.fill(),u>0&&e.stroke(),f&&(e.textBaseline="middle",e.textAlign=g==="middle"?"center":g,Ga(e,h,d,o+p,s+m))},pixelRatio:typeof window<"u"&&(Bx=window.devicePixelRatio)!=null?Bx:1}),U5=function(e,t,n,r,i,a){return ic(r,{all:e.map(t),min:0,max:0},i,a).padding(n)},H5=function(e,t){return e.map(function(n){return kt({},t.reduce(function(r,i){return r[i]=null,r},{}),n)})},Ch=function(e){return Object.keys(e).reduce(function(t,n){return e[n]&&(t[n]=e[n]),t},{})},Sh=function(e){return[e,Number(e)]};function V5(e,t,n,r){return e===void 0&&(e=Ut.layout),n===void 0&&(n=Ut.labelPosition),r===void 0&&(r=Ut.labelOffset),function(i,a){var o=r*(t?-1:1);if(e==="horizontal"){var s=i/2;return n==="start"?s=t?i:0:n==="end"&&(s=t?0:i),{labelX:s+o,labelY:a/2,textAnchor:n==="middle"?"middle":t?"end":"start"}}var l=a/2;return n==="start"?l=t?0:a:n==="end"&&(l=t?a:0),{labelX:i/2,labelY:l-o,textAnchor:"middle"}}}var Nfe=["layout","width","height","padding","innerPadding","valueScale","indexScale","hiddenIds"],Zv=function(e,t){return e>t},q5=function(e,t){return e<t},Y5=function(e,t){return Array.from(" ".repeat(t-e),function(n,r){return e+r})},Pfe=function(e){return Zv(e,0)?0:e},Lfe=function(e,t,n,r){var i=e.data,a=e.formatValue,o=e.getColor,s=e.getIndex,l=e.getTooltipLabel,c=e.innerPadding,u=c===void 0?0:c,d=e.keys,f=e.xScale,h=e.yScale,p=e.margin,m=n?q5:Zv,g=i.map(Ch),x=[];return d.forEach(function(_,w){return Y5(0,f.domain().length).forEach(function(C){var b,S,M,$=Sh(i[C][_]),k=$[0],R=$[1],T=s(i[C]),E=((b=f(T))!=null?b:0)+t*w+u*w,A=m(S=R,0)?(M=h(S))!=null?M:0:r,j=function(D,O){var L;return m(D,0)?r-O:((L=h(D))!=null?L:0)-r}(R,A),I={id:_,value:k===null?k:R,formattedValue:a(R),hidden:!1,index:C,indexValue:T,data:g[C]};x.push({key:_+"."+I.indexValue,index:x.length,data:I,x:E,y:A,absX:p.left+E,absY:p.top+A,width:t,height:j,color:o(I),label:l(I)})})}),x},Ffe=function(e,t,n,r){var i=e.data,a=e.formatValue,o=e.getIndex,s=e.getColor,l=e.getTooltipLabel,c=e.keys,u=e.innerPadding,d=u===void 0?0:u,f=e.xScale,h=e.yScale,p=e.margin,m=n?q5:Zv,g=i.map(Ch),x=[];return c.forEach(function(_,w){return Y5(0,h.domain().length).forEach(function(C){var b,S,M,$=Sh(i[C][_]),k=$[0],R=$[1],T=o(i[C]),E=m(S=R,0)?r:(M=f(S))!=null?M:0,A=((b=h(T))!=null?b:0)+t*w+d*w,j=function(D,O){var L;return m(D,0)?((L=f(D))!=null?L:0)-r:r-O}(R,E),I={id:_,value:k===null?k:R,formattedValue:a(R),hidden:!1,index:C,indexValue:T,data:g[C]};x.push({key:_+"."+I.indexValue,index:x.length,data:I,x:E,y:A,absX:p.left+E,absY:p.top+A,width:j,height:t,color:s(I),label:l(I)})})}),x},zfe=function(e){var t,n,r,i=e.layout,a=e.width,o=e.height,s=e.padding,l=s===void 0?0:s,c=e.innerPadding,u=c===void 0?0:c,d=e.valueScale,f=e.indexScale,h=e.hiddenIds,p=h===void 0?[]:h,m=ra(e,Nfe),g=m.keys.filter(function(O){return!p.includes(O)}),x=H5(m.data,g),_=i==="vertical"?["y","x",a]:["x","y",o],w=_[0],C=_[1],b=_[2],S=U5(x,m.getIndex,l,f,b,C),M=d.min==="auto"?Pfe:function(O){return O},$=x.reduce(function(O,L){return[].concat(O,g.map(function(B){return L[B]}))},[]).filter(Boolean),k=M(Math.min.apply(Math,$)),R=(r=Math.max.apply(Math,$),isFinite(r)?r:0),T=ic(d,{all:$,min:k,max:R},w==="x"?a:o,w),E=i==="vertical"?[S,T]:[T,S],A=E[0],j=E[1],I=(S.bandwidth()-u*(g.length-1))/g.length,D=[kt({},m,{data:x,keys:g,innerPadding:u,xScale:A,yScale:j}),I,(t=d.reverse)!=null&&t,(n=T(0))!=null?n:0];return{xScale:A,yScale:j,bars:I>0?i==="vertical"?Lfe.apply(void 0,D):Ffe.apply(void 0,D):[]}},Bfe=["data","layout","width","height","padding","valueScale","indexScale","hiddenIds"],G5=function(e){var t;return e.some(Array.isArray)?G5((t=[]).concat.apply(t,e)):e},Wfe=function(e,t,n){var r=e.formatValue,i=e.getColor,a=e.getIndex,o=e.getTooltipLabel,s=e.innerPadding,l=e.stackedData,c=e.xScale,u=e.yScale,d=e.margin,f=[];return l.forEach(function(h){return c.domain().forEach(function(p,m){var g,x,_=h[m],w=(g=c(a(_.data)))!=null?g:0,C=((x=function(R){return u(R[n?0:1])}(_))!=null?x:0)+.5*s,b=function(R,T){var E;return((E=u(R[n?1:0]))!=null?E:0)-T}(_,C)-s,S=Sh(_.data[h.key]),M=S[0],$=S[1],k={id:h.key,value:M===null?M:$,formattedValue:r($),hidden:!1,index:m,indexValue:p,data:Ch(_.data)};f.push({key:h.key+"."+p,index:f.length,data:k,x:w,y:C,absX:d.left+w,absY:d.top+C,width:t,height:b,color:i(k),label:o(k)})})}),f},Ufe=function(e,t,n){var r=e.formatValue,i=e.getColor,a=e.getIndex,o=e.getTooltipLabel,s=e.innerPadding,l=e.stackedData,c=e.xScale,u=e.yScale,d=e.margin,f=[];return l.forEach(function(h){return u.domain().forEach(function(p,m){var g,x,_=h[m],w=(g=u(a(_.data)))!=null?g:0,C=((x=function(R){return c(R[n?1:0])}(_))!=null?x:0)+.5*s,b=function(R,T){var E;return((E=c(R[n?0:1]))!=null?E:0)-T}(_,C)-s,S=Sh(_.data[h.key]),M=S[0],$=S[1],k={id:h.key,value:M===null?M:$,formattedValue:r($),hidden:!1,index:m,indexValue:p,data:Ch(_.data)};f.push({key:h.key+"."+p,index:f.length,data:k,x:C,y:w,absX:d.left+C,absY:d.top+w,width:b,height:t,color:i(k),label:o(k)})})}),f},Hfe=function(e){var t,n,r=e.data,i=e.layout,a=e.width,o=e.height,s=e.padding,l=s===void 0?0:s,c=e.valueScale,u=e.indexScale,d=e.hiddenIds,f=d===void 0?[]:d,h=ra(e,Bfe),p=h.keys.filter(function(I){return!f.includes(I)}),m=aJ().keys(p).offset(oJ)(H5(r,p)),g=i==="vertical"?["y","x",a]:["x","y",o],x=g[0],_=g[1],w=g[2],C=U5(r,h.getIndex,l,u,w,_),b=(n=G5(m),c.type==="log"?n.filter(function(I){return I!==0}):n),S=Math.min.apply(Math,b),M=Math.max.apply(Math,b),$=ic(c,{all:b,min:S,max:M},x==="x"?a:o,x),k=i==="vertical"?[C,$]:[$,C],R=k[0],T=k[1],E=h.innerPadding>0?h.innerPadding:0,A=C.bandwidth(),j=[kt({},h,{innerPadding:E,stackedData:m,xScale:R,yScale:T}),A,(t=c.reverse)!=null&&t];return{xScale:R,yScale:T,bars:A>0?i==="vertical"?Wfe.apply(void 0,j):Ufe.apply(void 0,j):[]}},Vfe=function(e){var t=e.bars,n=e.direction,r=e.from,i=e.groupMode,a=e.layout,o=e.legendLabel,s=e.reverse,l=t5(o??(r==="indexes"?"indexValue":"id"));return r==="indexes"?function(c,u,d){var f=ag(c.map(function(h){var p,m;return{id:(p=h.data.indexValue)!=null?p:"",label:d(h.data),hidden:h.data.hidden,color:(m=h.color)!=null?m:"#000"}}),function(h){return h.id});return u==="horizontal"&&f.reverse(),f}(t,a,l):function(c,u,d,f,h,p){var m=ag(c.map(function(g){var x;return{id:g.data.id,label:p(g.data),hidden:g.data.hidden,color:(x=g.color)!=null?x:"#000"}}),function(g){return g.id});return(u==="vertical"&&f==="stacked"&&d==="column"&&h!==!0||u==="horizontal"&&f==="stacked"&&h===!0)&&m.reverse(),m}(t,a,n,i,s,l)},Wx=function(e,t,n){var r=e.get(t)||0;e.set(t,r+n)},qfe=function(e,t,n){var r=e.get(t)||0;e.set(t,r+(n>0?n:0))},Yfe=function(e,t,n){var r=e.get(t)||0;e.set(t,Math.max(r,Number(n)))},Gfe=function(e,t){var n=e.get(t)||0;e.set(t,n+1)},Z5=function(e){var t,n=e.indexBy,r=n===void 0?Ut.indexBy:n,i=e.keys,a=i===void 0?Ut.keys:i,o=e.label,s=o===void 0?Ut.label:o,l=e.tooltipLabel,c=l===void 0?Ut.tooltipLabel:l,u=e.valueFormat,d=e.colors,f=d===void 0?Ut.colors:d,h=e.colorBy,p=h===void 0?Ut.colorBy:h,m=e.borderColor,g=m===void 0?Ut.borderColor:m,x=e.labelTextColor,_=x===void 0?Ut.labelTextColor:x,w=e.groupMode,C=w===void 0?Ut.groupMode:w,b=e.layout,S=b===void 0?Ut.layout:b,M=e.data,$=e.margin,k=e.width,R=e.height,T=e.padding,E=T===void 0?Ut.padding:T,A=e.innerPadding,j=A===void 0?Ut.innerPadding:A,I=e.valueScale,D=I===void 0?Ut.valueScale:I,O=e.indexScale,L=O===void 0?Ut.indexScale:O,B=e.initialHiddenIds,P=B===void 0?Ut.initialHiddenIds:B,H=e.enableLabel,Y=H===void 0?Ut.enableLabel:H,q=e.labelSkipWidth,Z=q===void 0?Ut.labelSkipWidth:q,X=e.labelSkipHeight,J=X===void 0?Ut.labelSkipHeight:X,ee=e.legends,W=ee===void 0?Ut.legends:ee,F=e.legendLabel,z=e.totalsOffset,V=z===void 0?Ut.totalsOffset:z,N=v.useState(P??[]),te=N[0],K=N[1],G=v.useCallback(function(Te){K(function(Re){return Re.indexOf(Te)>-1?Re.filter(function(at){return at!==Te}):[].concat(Re,[Te])})},[]),oe=pi(r),ne=pi(s),re=pi(c),ae=os(u),le=Lt(),ye=Wv(f,p),ge=pr(g,le),be=pr(_,le),Me=(C==="grouped"?zfe:Hfe)({layout:S,data:M,getIndex:oe,keys:a,width:k,height:R,getColor:ye,padding:E,innerPadding:j,valueScale:D,indexScale:L,hiddenIds:te,formatValue:ae,getTooltipLabel:re,margin:$}),ce=Me.bars,de=Me.xScale,Ce=Me.yScale,Ge=v.useMemo(function(){return ce.filter(function(Te){return Te.data.value!==null}).map(function(Te,Re){return kt({},Te,{index:Re})})},[ce]),we=v.useCallback(function(Te){var Re=Te.width,at=Te.height;return!!Y&&!(Z>0&&Re<Z)&&!(J>0&&at<J)},[Y,Z,J]),ve=v.useMemo(function(){return a.map(function(Te){var Re=ce.find(function(at){return at.data.id===Te});return kt({},Re,{data:kt({id:Te},Re==null?void 0:Re.data,{hidden:te.includes(Te)})})})},[te,a,ce]),Pe=(t=D.reverse)!=null&&t,Ze=v.useMemo(function(){return W.map(function(Te){return[Te,Vfe({bars:Te.dataFrom==="keys"?ve:ce,direction:Te.direction,from:Te.dataFrom,groupMode:C,layout:S,legendLabel:F,reverse:Pe})]})},[W,ve,ce,C,S,F,Pe]),_t=v.useMemo(function(){return function(Te,Re,at,Ue,mt,ut,At){Ue===void 0&&(Ue=Ut.layout),mt===void 0&&(mt=Ut.groupMode);var Ke=[];if(Te.length===0)return Ke;var Le=new Map,Ve=Te[0].width,et=Te[0].height;if(mt==="stacked"){var Fe=new Map;Te.forEach(function(ot){var Ne=ot.data,Ee=Ne.indexValue,Ye=Ne.value;Wx(Le,Ee,Number(Ye)),qfe(Fe,Ee,Number(Ye))}),Fe.forEach(function(ot,Ne){var Ee,Ye,xt,nt=Le.get(Ne)||0;Ue==="vertical"?(Ee=Re(Ne),Ye=at(ot),xt=at(ot/2)):(Ee=Re(ot),Ye=at(Ne),xt=Re(ot/2)),Ee+=Ue==="vertical"?Ve/2:ut,Ye+=Ue==="vertical"?-ut:et/2,Ke.push({key:"total_"+Ne,x:Ee,y:Ye,value:nt,formattedValue:At(nt),animationOffset:xt})})}else if(mt==="grouped"){var tt=new Map,vt=new Map;Te.forEach(function(ot){var Ne=ot.data,Ee=Ne.indexValue,Ye=Ne.value;Wx(Le,Ee,Number(Ye)),Yfe(tt,Ee,Number(Ye)),Gfe(vt,Ee)}),tt.forEach(function(ot,Ne){var Ee,Ye,xt,nt=Le.get(Ne)||0,bt=vt.get(Ne);Ue==="vertical"?(Ee=Re(Ne),Ye=at(ot),xt=at(ot/2)):(Ee=Re(ot),Ye=at(Ne),xt=Re(ot/2)),Ee+=Ue==="vertical"?bt*Ve/2:ut,Ye+=Ue==="vertical"?-ut:bt*et/2,Ke.push({key:"total_"+Ne,x:Ee,y:Ye,value:nt,formattedValue:At(nt),animationOffset:xt})})}return Ke}(ce,de,Ce,S,C,V,ae)},[ce,de,Ce,S,C,V,ae]);return{bars:ce,barsWithValue:Ge,xScale:de,yScale:Ce,getIndex:oe,getLabel:ne,getTooltipLabel:re,formatValue:ae,getColor:ye,getBorderColor:ge,getLabelColor:be,shouldRenderBarLabel:we,hiddenIds:te,toggleSerie:G,legendsWithData:Ze,barTotals:_t}},Zfe=function(e){var t=e.data,n=e.springConfig,r=e.animate,i=e.layout,a=i===void 0?Wt.layout:i,o=Lt();return Ka(t,{keys:function(s){return s.key},from:function(s){return{x:a==="vertical"?s.x:s.animationOffset,y:a==="vertical"?s.animationOffset:s.y,labelOpacity:0}},enter:function(s){return{x:s.x,y:s.y,labelOpacity:1}},update:function(s){return{x:s.x,y:s.y,labelOpacity:1}},leave:function(s){return{x:a==="vertical"?s.x:s.animationOffset,y:a==="vertical"?s.animationOffset:s.y,labelOpacity:0}},config:n,immediate:!r,initial:r?void 0:null})(function(s,l){return y.jsx(Ht.text,{x:s.x,y:s.y,fillOpacity:s.labelOpacity,style:kt({},o.labels.text,{pointerEvents:"none"}),fontWeight:"bold",fontSize:o.labels.text.fontSize,fontFamily:o.labels.text.fontFamily,textAnchor:a==="vertical"?"middle":"start",alignmentBaseline:a==="vertical"?"alphabetic":"middle",children:l.formattedValue},l.key)})},Xfe=["isInteractive","animate","motionConfig","theme","renderWrapper"],Kfe=function(e){var t,n=e.data,r=e.indexBy,i=e.keys,a=e.margin,o=e.width,s=e.height,l=e.groupMode,c=e.layout,u=e.valueScale,d=e.indexScale,f=e.padding,h=e.innerPadding,p=e.axisTop,m=e.axisRight,g=e.axisBottom,x=g===void 0?Wt.axisBottom:g,_=e.axisLeft,w=_===void 0?Wt.axisLeft:_,C=e.enableGridX,b=C===void 0?Wt.enableGridX:C,S=e.enableGridY,M=S===void 0?Wt.enableGridY:S,$=e.gridXValues,k=e.gridYValues,R=e.layers,T=R===void 0?Wt.layers:R,E=e.barComponent,A=E===void 0?Wt.barComponent:E,j=e.enableLabel,I=j===void 0?Wt.enableLabel:j,D=e.label,O=e.labelSkipWidth,L=O===void 0?Wt.labelSkipWidth:O,B=e.labelSkipHeight,P=B===void 0?Wt.labelSkipHeight:B,H=e.labelTextColor,Y=e.labelPosition,q=Y===void 0?Wt.labelPosition:Y,Z=e.labelOffset,X=Z===void 0?Wt.labelOffset:Z,J=e.markers,ee=J===void 0?Wt.markers:J,W=e.colorBy,F=e.colors,z=e.defs,V=z===void 0?Wt.defs:z,N=e.fill,te=N===void 0?Wt.fill:N,K=e.borderRadius,G=K===void 0?Wt.borderRadius:K,oe=e.borderWidth,ne=oe===void 0?Wt.borderWidth:oe,re=e.borderColor,ae=e.annotations,le=ae===void 0?Wt.annotations:ae,ye=e.legendLabel,ge=e.tooltipLabel,be=e.valueFormat,Me=e.isInteractive,ce=Me===void 0?Wt.isInteractive:Me,de=e.tooltip,Ce=de===void 0?Wt.tooltip:de,Ge=e.onClick,we=e.onMouseEnter,ve=e.onMouseLeave,Pe=e.legends,Ze=e.role,_t=Ze===void 0?Wt.role:Ze,Te=e.ariaLabel,Re=e.ariaLabelledBy,at=e.ariaDescribedBy,Ue=e.isFocusable,mt=Ue===void 0?Wt.isFocusable:Ue,ut=e.barAriaLabel,At=e.barAriaLabelledBy,Ke=e.barAriaDescribedBy,Le=e.barAriaHidden,Ve=e.barAriaDisabled,et=e.initialHiddenIds,Fe=e.enableTotals,tt=Fe===void 0?Wt.enableTotals:Fe,vt=e.totalsOffset,ot=vt===void 0?Wt.totalsOffset:vt,Ne=e.forwardedRef,Ee=Fn(),Ye=Ee.animate,xt=Ee.config,nt=oo(o,s,a),bt=nt.outerWidth,Jt=nt.outerHeight,Ft=nt.margin,Bt=nt.innerWidth,fn=nt.innerHeight,qt=Z5({indexBy:r,label:D,tooltipLabel:ge,valueFormat:be,colors:F,colorBy:W,borderColor:re,labelTextColor:H,groupMode:l,layout:c,data:n,keys:i,margin:Ft,width:Bt,height:fn,padding:f,innerPadding:h,valueScale:u,indexScale:d,enableLabel:I,labelSkipWidth:L,labelSkipHeight:P,legends:Pe,legendLabel:ye,initialHiddenIds:et,totalsOffset:ot}),$e=qt.bars,Je=qt.barsWithValue,St=qt.xScale,an=qt.yScale,Yt=qt.getLabel,ze=qt.getTooltipLabel,Be=qt.getBorderColor,ht=qt.getLabelColor,Rt=qt.shouldRenderBarLabel,Tt=qt.toggleSerie,Qe=qt.legendsWithData,$t=qt.barTotals,vr=qt.getColor,ln=V5(c,(t=u==null?void 0:u.reverse)!=null&&t,q,X),cn=Ka(Je,{keys:function(Ae){return Ae.key},from:function(Ae){return kt({borderColor:Be(Ae),color:Ae.color,height:0,labelColor:ht(Ae),labelOpacity:0},ln(Ae.width,Ae.height),{transform:"translate("+Ae.x+", "+(Ae.y+Ae.height)+")",width:Ae.width},c==="vertical"?{}:{height:Ae.height,transform:"translate("+Ae.x+", "+Ae.y+")",width:0})},enter:function(Ae){return kt({borderColor:Be(Ae),color:Ae.color,height:Ae.height,labelColor:ht(Ae),labelOpacity:1},ln(Ae.width,Ae.height),{transform:"translate("+Ae.x+", "+Ae.y+")",width:Ae.width})},update:function(Ae){return kt({borderColor:Be(Ae),color:Ae.color,height:Ae.height,labelColor:ht(Ae),labelOpacity:1},ln(Ae.width,Ae.height),{transform:"translate("+Ae.x+", "+Ae.y+")",width:Ae.width})},leave:function(Ae){return kt({borderColor:Be(Ae),color:Ae.color,height:0,labelColor:ht(Ae),labelOpacity:0},ln(Ae.width,Ae.height),{labelY:0,transform:"translate("+Ae.x+", "+(Ae.y+Ae.height)+")",width:Ae.width},c==="vertical"?{}:kt({},ln(Ae.width,Ae.height),{labelX:0,height:Ae.height,transform:"translate("+Ae.x+", "+Ae.y+")",width:0}))},config:xt,immediate:!Ye,initial:Ye?void 0:null}),An=v.useMemo(function(){return{borderRadius:G,borderWidth:ne,enableLabel:I,isInteractive:ce,labelSkipWidth:L,labelSkipHeight:P,onClick:Ge,onMouseEnter:we,onMouseLeave:ve,getTooltipLabel:ze,tooltip:Ce,isFocusable:mt,ariaLabel:ut,ariaLabelledBy:At,ariaDescribedBy:Ke,ariaHidden:Le,ariaDisabled:Ve}},[G,ne,I,ze,ce,P,L,Ge,we,ve,Ce,mt,ut,At,Ke,Le,Ve]),ia=zv(V,$e,te,{dataKey:"data",targetKey:"data.fill"}),Ct={annotations:null,axes:null,bars:null,grid:null,legends:null,markers:null,totals:null};T.includes("annotations")&&(Ct.annotations=y.jsx(Ofe,{bars:$e,annotations:le},"annotations")),T.includes("axes")&&(Ct.axes=y.jsx(k5,{xScale:St,yScale:an,width:Bt,height:fn,top:p,right:m,bottom:x,left:w},"axes")),T.includes("bars")&&(Ct.bars=y.jsx(v.Fragment,{children:cn(function(Ae,Er){return v.createElement(A,kt({},An,{bar:Er,style:Ae,shouldRenderLabel:Rt(Er),label:Yt(Er.data)}))})},"bars")),T.includes("grid")&&(Ct.grid=y.jsx(M5,{width:Bt,height:fn,xScale:b?St:null,yScale:M?an:null,xValues:$,yValues:k},"grid")),T.includes("legends")&&(Ct.legends=y.jsx(Afe,{width:Bt,height:fn,legends:Qe,toggleSerie:Tt},"legends")),T.includes("markers")&&(Ct.markers=y.jsx(JS,{markers:ee,width:Bt,height:fn,xScale:St,yScale:an},"markers")),T.includes("totals")&&tt&&(Ct.totals=y.jsx(Zfe,{data:$t,springConfig:xt,animate:Ye,layout:c},"totals"));var aa=kt({},An,{margin:Ft,width:o,height:s,innerWidth:Bt,innerHeight:fn,bars:$e,legendData:Qe,enableLabel:I,xScale:St,yScale:an,tooltip:Ce,getTooltipLabel:ze,onClick:Ge,onMouseEnter:we,onMouseLeave:ve,getColor:vr});return y.jsx(xh,{width:bt,height:Jt,margin:Ft,defs:ia,role:_t,ariaLabel:Te,ariaLabelledBy:Re,ariaDescribedBy:at,isFocusable:mt,ref:Ne,children:T.map(function(Ae,Er){var oa;return typeof Ae=="function"?y.jsx(v.Fragment,{children:v.createElement(Ae,aa)},Er):(oa=Ct==null?void 0:Ct[Ae])!=null?oa:null})})},Jfe=v.forwardRef(function(e,t){var n=e.isInteractive,r=n===void 0?Wt.isInteractive:n,i=e.animate,a=i===void 0?Wt.animate:i,o=e.motionConfig,s=o===void 0?Wt.motionConfig:o,l=e.theme,c=e.renderWrapper,u=ra(e,Xfe);return y.jsx(io,{animate:a,isInteractive:r,motionConfig:s,renderWrapper:c,theme:l,children:y.jsx(Kfe,kt({},u,{isInteractive:r,forwardedRef:t}))})}),Qfe=["isInteractive","renderWrapper","theme"],Lp=function(e,t,n,r){return e.find(function(i){return r5(i.x+t.left,i.y+t.top,i.width,i.height,n,r)})},ehe=function(e){var t,n=e.data,r=e.indexBy,i=e.keys,a=e.margin,o=e.width,s=e.height,l=e.groupMode,c=e.layout,u=e.valueScale,d=e.indexScale,f=e.padding,h=e.innerPadding,p=e.axisTop,m=e.axisRight,g=e.axisBottom,x=g===void 0?un.axisBottom:g,_=e.axisLeft,w=_===void 0?un.axisLeft:_,C=e.enableGridX,b=C===void 0?un.enableGridX:C,S=e.enableGridY,M=S===void 0?un.enableGridY:S,$=e.gridXValues,k=e.gridYValues,R=e.labelPosition,T=R===void 0?un.labelPosition:R,E=e.labelOffset,A=E===void 0?un.labelOffset:E,j=e.layers,I=j===void 0?un.layers:j,D=e.renderBar,O=D===void 0?un.renderBar:D,L=e.enableLabel,B=L===void 0?un.enableLabel:L,P=e.label,H=e.labelSkipWidth,Y=H===void 0?un.labelSkipWidth:H,q=e.labelSkipHeight,Z=q===void 0?un.labelSkipHeight:q,X=e.labelTextColor,J=e.colorBy,ee=e.colors,W=e.borderRadius,F=W===void 0?un.borderRadius:W,z=e.borderWidth,V=z===void 0?un.borderWidth:z,N=e.borderColor,te=e.annotations,K=te===void 0?un.annotations:te,G=e.legendLabel,oe=e.tooltipLabel,ne=e.valueFormat,re=e.isInteractive,ae=re===void 0?un.isInteractive:re,le=e.tooltip,ye=le===void 0?un.tooltip:le,ge=e.onClick,be=e.onMouseEnter,Me=e.onMouseLeave,ce=e.legends,de=e.pixelRatio,Ce=de===void 0?un.pixelRatio:de,Ge=e.role,we=e.forwardedRef,ve=e.enableTotals,Pe=ve===void 0?un.enableTotals:ve,Ze=e.totalsOffset,_t=Ze===void 0?un.totalsOffset:Ze,Te=v.useRef(null),Re=Lt(),at=oo(o,s,a),Ue=at.margin,mt=at.innerWidth,ut=at.innerHeight,At=at.outerWidth,Ke=at.outerHeight,Le=Z5({indexBy:r,label:P,tooltipLabel:oe,valueFormat:ne,colors:ee,colorBy:J,borderColor:N,labelTextColor:X,groupMode:l,layout:c,data:n,keys:i,margin:Ue,width:mt,height:ut,padding:f,innerPadding:h,valueScale:u,indexScale:d,enableLabel:B,labelSkipWidth:Y,labelSkipHeight:Z,legends:ce,legendLabel:G,totalsOffset:_t}),Ve=Le.bars,et=Le.barsWithValue,Fe=Le.xScale,tt=Le.yScale,vt=Le.getLabel,ot=Le.getTooltipLabel,Ne=Le.getBorderColor,Ee=Le.getLabelColor,Ye=Le.shouldRenderBarLabel,xt=Le.legendsWithData,nt=Le.barTotals,bt=Le.getColor,Jt=Ti(),Ft=Jt.showTooltipFromEvent,Bt=Jt.hideTooltip,fn=wfe({annotations:W5({data:Ve,annotations:K,getPosition:function(ze){return{x:ze.x,y:ze.y}},getDimensions:function(ze){var Be=ze.width,ht=ze.height;return{width:Be,height:ht,size:Math.max(Be,ht)}}})}),qt=v.useMemo(function(){return{borderRadius:F,borderWidth:V,isInteractive:ae,isFocusable:!1,labelSkipWidth:Y,labelSkipHeight:Z,margin:Ue,width:o,height:s,innerWidth:mt,innerHeight:ut,bars:Ve,legendData:xt,enableLabel:B,xScale:Fe,yScale:tt,tooltip:ye,getTooltipLabel:ot,onClick:ge,onMouseEnter:be,onMouseLeave:Me,getColor:bt}},[F,V,ae,Y,Z,Ue,o,s,mt,ut,Ve,xt,B,Fe,tt,ye,ot,ge,be,Me,bt]),$e=os(ne),Je=V5(c,(t=u==null?void 0:u.reverse)!=null&&t,T,A);v.useEffect(function(){if(Te.current){Te.current.width=At*Ce,Te.current.height=Ke*Ce;var ze=Te.current.getContext("2d");ze.scale(Ce,Ce),ze.fillStyle=Re.background,ze.fillRect(0,0,At,Ke),ze.translate(Ue.left,Ue.top),I.forEach(function(Be){Be==="grid"?typeof Re.grid.line.strokeWidth=="number"&&Re.grid.line.strokeWidth>0&&(ze.lineWidth=Re.grid.line.strokeWidth,ze.strokeStyle=Re.grid.line.stroke,b&&Sd(ze,{width:mt,height:ut,scale:Fe,axis:"x",values:$}),M&&Sd(ze,{width:mt,height:ut,scale:tt,axis:"y",values:k})):Be==="axes"?E5(ze,{xScale:Fe,yScale:tt,width:mt,height:ut,top:p,right:m,bottom:x,left:w,theme:Re}):Be==="bars"?(Ya(ze,Re.text),et.forEach(function(ht){O(ze,kt({bar:ht,borderColor:Ne(ht),borderRadius:F,borderWidth:V,label:vt(ht.data),shouldRenderLabel:Ye(ht),labelStyle:kt({},Re.labels.text,{fill:Ee(ht)})},Je(ht.width,ht.height)))})):Be==="legends"?xt.forEach(function(ht){var Rt=ht[0],Tt=ht[1];qv(ze,kt({},Rt,{data:Tt,containerWidth:mt,containerHeight:ut,theme:Re}))}):Be==="annotations"?Mfe(ze,{annotations:fn,theme:Re}):Be==="totals"&&Pe?function(ht,Rt,Tt,Qe){Qe===void 0&&(Qe=un.layout),Ya(ht,Tt.labels.text),ht.textBaseline=Qe==="vertical"?"alphabetic":"middle",ht.textAlign=Qe==="vertical"?"center":"start",Rt.forEach(function($t){Ga(ht,Tt.labels.text,$t.formattedValue,$t.x,$t.y)})}(ze,nt,Re,c):typeof Be=="function"&&Be(ze,qt)}),ze.save()}},[x,w,m,p,et,F,V,fn,b,M,Ne,vt,Ee,$,k,l,s,ut,mt,qt,I,c,xt,Ue.left,Ue.top,Ke,At,Ce,O,Fe,tt,Ye,Re,o,nt,Pe,$e,Je]);var St=v.useCallback(function(ze){if(Ve&&Te.current){var Be=zo(Te.current,ze),ht=Be[0],Rt=Be[1],Tt=Lp(Ve,Ue,ht,Rt);Tt!==void 0?(Ft(v.createElement(ye,kt({},Tt.data,{color:Tt.color,label:Tt.label,value:Number(Tt.data.value)})),ze),ze.type==="mouseenter"&&(be==null||be(Tt.data,ze))):Bt()}},[Bt,Ue,be,Ve,Ft,ye]),an=v.useCallback(function(ze){if(Ve&&Te.current){Bt();var Be=zo(Te.current,ze),ht=Be[0],Rt=Be[1],Tt=Lp(Ve,Ue,ht,Rt);Tt&&(Me==null||Me(Tt.data,ze))}},[Bt,Ue,Me,Ve]),Yt=v.useCallback(function(ze){if(Ve&&Te.current){var Be=zo(Te.current,ze),ht=Be[0],Rt=Be[1],Tt=Lp(Ve,Ue,ht,Rt);Tt!==void 0&&(ge==null||ge(kt({},Tt.data,{color:Tt.color}),ze))}},[Ue,ge,Ve]);return y.jsx("canvas",{ref:Bv(Te,we),width:At*Ce,height:Ke*Ce,style:{width:At,height:Ke,cursor:ae?"auto":"normal"},onMouseEnter:ae?St:void 0,onMouseMove:ae?St:void 0,onMouseLeave:ae?an:void 0,onClick:ae?Yt:void 0,role:Ge})},the=v.forwardRef(function(e,t){var n=e.isInteractive,r=e.renderWrapper,i=e.theme,a=ra(e,Qfe);return y.jsx(io,{isInteractive:n,renderWrapper:r,theme:i,animate:!1,children:y.jsx(ehe,kt({},a,{isInteractive:n,forwardedRef:t}))})}),nhe=["defaultWidth","defaultHeight","onResize","debounceResize"],rhe=v.forwardRef(function(e,t){var n=e.defaultWidth,r=e.defaultHeight,i=e.onResize,a=e.debounceResize,o=ra(e,nhe);return y.jsx(ao,{defaultWidth:n,defaultHeight:r,onResize:i,debounceResize:a,children:function(s){var l=s.width,c=s.height;return y.jsx(Jfe,kt({},o,{width:l,height:c,ref:t}))}})}),ihe=["defaultWidth","defaultHeight","onResize","debounceResize"];v.forwardRef(function(e,t){var n=e.defaultWidth,r=e.defaultHeight,i=e.onResize,a=e.debounceResize,o=ra(e,ihe);return y.jsx(ao,{defaultWidth:n,defaultHeight:r,onResize:i,debounceResize:a,children:function(s){var l=s.width,c=s.height;return y.jsx(the,kt({},o,{width:l,height:c,ref:t}))}})});exports.AbstractModalHeader=zg;exports.Alert=T0;exports.ApprovalState=wO;exports.AuthContext=Wd;exports.Backdrop=cC;exports.BaseModal=m_;exports.BootstrapModalManager=g_;exports.Button=_g;exports.Col=Cg;exports.ConfirmContext=P_;exports.ContextButton=tf;exports.CustomSelectInput=a3;exports.DelegationContext=Z_;exports.Documents=DF;exports.Dropdown=o0;exports.Dropdown$1=Yo;exports.DropdownDivider=vm;exports.DropdownItem=Ca;exports.DropdownToggle=a0;exports.ENTERED=Ni;exports.ENTERING=si;exports.EXITED=ji;exports.EXITING=Au;exports.FaMinus=WR;exports.FaPlus=UR;exports.FaSearch=HR;exports.Fade=Vi;exports.Fe=xO;exports.FileExtensionIcon=J3;exports.FloatingLabelInput=nf;exports.Form=Gr;exports.FormCheckInput=Pd;exports.FormControl=n_;exports.FormDisabledContext=Q4;exports.FormSelect=jg;exports.HelmetContext=J4;exports.HookFormSelectInput=rf;exports.HookFormTextAreaInput=r0;exports.HookFormTextInput=es;exports.HtmlTooltip=e4;exports.IconButton=wc;exports.InputAnchorContainer=n3;exports.InvalidFeedback=df;exports.ListGroup=h_;exports.ListGroupItem=Ld;exports.LoadingContext=Bd;exports.LoginState=Y_;exports.LuminusComponentsContext=rn;exports.MdCheck=lE;exports.MdCircle=sE;exports.MdClear=hc;exports.MdOutlineAddCircleOutline=bE;exports.MdOutlineArrowOutward=cE;exports.MdOutlineCallMade=gE;exports.MdOutlineCameraAlt=SE;exports.MdOutlineChevronRight=ME;exports.MdOutlineClose=I_;exports.MdOutlineDelete=j_;exports.MdOutlineEdit=TE;exports.MdOutlineExpand=dE;exports.MdOutlineFileUpload=wE;exports.MdOutlineKeyboardArrowLeft=_E;exports.MdOutlineKeyboardArrowRight=CE;exports.MdOutlineMenu=EE;exports.MdOutlineMessage=vE;exports.MdOutlinePhotoLibrary=$E;exports.MdOutlineSource=hE;exports.MdOutlineStar=RE;exports.MdOutlineSubdirectoryArrowRight=AE;exports.MdSave=oE;exports.MdSaveAs=aE;exports.MdSearch=iE;exports.Me=Jle;exports.MiniDetailWrapper=i3;exports.Modal=Vn;exports.ModalContext=Lg;exports.NoInputContainer=t3;exports.OverlayTrigger=A_;exports.PageContainer=rz;exports.PiPushPinBold=tF;exports.PiPushPinSlashBold=nF;exports.PrimaryButton=za;exports.PromptContext=L_;exports.PropTypes=xe;exports.ResponsiveContextDropdown=sC;exports.ResponsiveContextDropdownItem=w0;exports.RowLabelInput=_c;exports.ShortcutLinksContext=Bz;exports.SideContentBar=Q3;exports.SimpleDropdownToggle=i0;exports.SimplePicker=lC;exports.SimpleTooltip=Hg;exports.Spinner=Wg;exports.TextInput=r3;exports.Tooltip=E_;exports.TransitionWrapper=vg;exports.Typography=In;exports.UserContext=G_;exports.Xe=rhe;exports.ZodIssueCode=he;exports.a=_0;exports.addLeadingZeros=Pt;exports.addMilliseconds=Hx;exports.arrayType=q4;exports.atobUtf8=n4;exports.axios=Zt;exports.buildEmployeeNameString=FO;exports.buildOrgUnitString=zO;exports.buildVehicleNameString=LO;exports.cancelToken=XA;exports.capitalizeFirstLetter=PO;exports.classNames=se;exports.classes=mm;exports.classes$1=o3;exports.compareDate=UO;exports.compareDateTime=HO;exports.compilerRuntimeExports=Ie;exports.constructFrom=gi;exports.context=Id;exports.differenceInCalendarDays=Xx;exports.dist=C0;exports.divWithClassName=bg;exports.extractErrorsFromBlobResponse=J_;exports.extractErrorsFromResponse=Ud;exports.extractFilename=s4;exports.extractPermissionsFromResponse=Q_;exports.fixNameIdNulls=X_;exports.format=hg;exports.formatDate=IO;exports.formatDateTime=NO;exports.formatFileSize=Go;exports.getChildRef=cs;exports.getDateString=XO;exports.getDaysDifference=VO;exports.getFirstDayOfMonth=a4;exports.getFirstDayOfOffsetMonth=qO;exports.getFirstDayOfYear=GO;exports.getLastDayOfMonth=o4;exports.getLastDayOfOffsetMonth=YO;exports.getLastDayOfYear=ZO;exports.getSharedManager=v_;exports.getTimezoneOffsetInMilliseconds=Bp;exports.hasOnlyNullValues=K_;exports.hookFormSetServerErrors=CO;exports.isExtensionOpenable=c4;exports.isFileOpenable=l4;exports.isISODate=r4;exports.isISODateInValidRange=i4;exports.isLeavingWindowInSafari=hB;exports.isPast=Qx;exports.isPrimitive=zu;exports.isSafari=S0;exports.isValidDate=WO;exports.joinStrings=Vg;exports.makeDispatch=mB;exports.millisecondsInHour=kd;exports.millisecondsInMinute=dg;exports.millisecondsInWeek=ug;exports.msToStartOfNextDay=BO;exports.objectType=di;exports.once=uC;exports.parseISO=sc;exports.replaceNullValuesOnlyObjectsWithNulls=_O;exports.saveFile=Bu;exports.saveFileFromResponse=QO;exports.secondsInDay=fg;exports.secondsInHour=Vx;exports.secondsInMinute=gT;exports.secondsInMonth=Yx;exports.secondsInQuarter=bT;exports.secondsInWeek=vT;exports.secondsInYear=qx;exports.shortenText=jO;exports.startOfDay=zp;exports.startOfWeek=Bo;exports.stringContains=om;exports.stringSearchWithin=qg;exports.stringStartsWith=u4;exports.stringType=e0;exports.style=Wi;exports.t=af;exports.te=gae;exports.toDate=Ln;exports.transitionEndListener=uw;exports.triggerBrowserReflow=dw;exports.trimIsoDate=Hd;exports.truncateText=t4;exports.u=K3;exports.urlfyArray=am;exports.useAuth=N4;exports.useAxios=Kd;exports.useBootstrapBreakpoints=rw;exports.useBootstrapMinBreakpoint=iw;exports.useBootstrapPrefix=gt;exports.useClickOutside=G4;exports.useClipboard=K4;exports.useCol=xw;exports.useConfirm=Jg;exports.useCookies=Kg;exports.useEventCallback=Hi;exports.useFormControlType=t0;exports.useFormDisabledContext=ef;exports.useIsomorphicEffect=Rg;exports.useKeyPress=X4;exports.useNotifications=Xd;exports.usePermissions=Z4;exports.usePrompt=F_;exports.useSwipeable=y0;exports.useWindowSize=xc;exports.useZodSchemaTypes=Qd;exports.z=il;