@patterninc/pattern-ui 0.0.0-main.202610192306.07efdc7fbb84 → 0.0.0-main.202610201412.a5ce0aa9aec7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/@patterninc/pattern-ui/charts/area.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/bar.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/candlestick.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/choropleth.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/composed.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/core.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/heatmap.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/line.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/live.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/primitives/Background.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/primitives/ChartTooltip.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/primitives/Grid.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/primitives/ProjectionLine.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/primitives/ReferenceArea.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/primitives/SeriesMarkers.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/primitives/XAxis.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/primitives/YAxis.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/sankey.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/scatter.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/charts/tooltip.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/locales/en.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/locales/es.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/locales/fr.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/locales/pl.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/locales/pseudo-LOCALE.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/locales/zh.js +1 -1
- package/dist/browser/@patterninc/pattern-ui/simple-provider.js +1 -1
- package/dist/browser/_chunks/{area-series-BtQz8YgT.js → area-series-fHW11oCG.js} +1 -1
- package/dist/browser/_chunks/{background-CYeyUUjW.js → background-CJA6Zjoc.js} +1 -1
- package/dist/browser/_chunks/chart-context-Bjw_NzAE.js +1 -0
- package/dist/browser/_chunks/chart-markers-BLtXtGRE.js +1 -0
- package/dist/browser/_chunks/{chart-tooltip-L0grgDEh.js → chart-tooltip-Q2xwFLCY.js} +1 -1
- package/dist/browser/_chunks/{grid-DtZfnOVN.js → grid-Bg9exNBo.js} +1 -1
- package/dist/browser/_chunks/{line-series-terminal-marker-BTEyW0j1.js → line-series-terminal-marker-CpVJxN4e.js} +1 -1
- package/dist/browser/_chunks/messages-5m2Zo88A.js +1 -0
- package/dist/browser/_chunks/{projection-line-qJfy22Rn.js → projection-line-pR-NKJB1.js} +1 -1
- package/dist/browser/_chunks/{reference-area-Bnwi9gJk.js → reference-area-CsmmBmaE.js} +1 -1
- package/dist/browser/_chunks/{series-markers-Cc2cS6gp.js → series-markers-BYXibIP2.js} +1 -1
- package/dist/browser/_chunks/{time-series-chart-shell-DdQX4Mtk.js → time-series-chart-shell-B1blo6_Q.js} +1 -1
- package/dist/browser/_chunks/{tooltip-box-DDr_WNoq.js → tooltip-box-9EA8wbsd.js} +1 -1
- package/dist/browser/_chunks/{x-axis-BPVhMFoB.js → x-axis-ByrWoBBx.js} +1 -1
- package/dist/browser/_chunks/{y-axis-BcBZf0OU.js → y-axis-OF5jnUeL.js} +1 -1
- package/dist/components/Charts/bar-chart.js +68 -63
- package/dist/components/Charts/bar-series.js +136 -132
- package/dist/components/Charts/chart-context.js +73 -71
- package/dist/components/Charts/loading-sweep.js +18 -3
- package/dist/locales/en/messages.js +1 -1
- package/dist/locales/es/messages.js +1 -1
- package/dist/locales/fr/messages.js +1 -1
- package/dist/locales/pl/messages.js +1 -1
- package/dist/locales/pseudo-LOCALE/messages.js +1 -1
- package/dist/locales/zh/messages.js +1 -1
- package/dist/play-cdn-claude.js +1 -1
- package/package.json +1 -1
- package/src/components/Charts/bar-chart.tsx +17 -4
- package/src/components/Charts/bar-series.tsx +6 -1
- package/src/components/Charts/chart-context.tsx +4 -0
- package/src/components/Charts/loading-sweep.tsx +17 -3
- package/src/locales/en/messages.po +6 -0
- package/src/locales/en/messages.ts +1 -1
- package/src/locales/es/messages.po +10 -4
- package/src/locales/es/messages.ts +1 -1
- package/src/locales/fr/messages.po +11 -5
- package/src/locales/fr/messages.ts +1 -1
- package/src/locales/pl/messages.po +10 -4
- package/src/locales/pl/messages.ts +1 -1
- package/src/locales/pseudo-LOCALE/messages.po +6 -0
- package/src/locales/pseudo-LOCALE/messages.ts +1 -1
- package/src/locales/zh/messages.po +10 -4
- package/src/locales/zh/messages.ts +1 -1
- package/dist/browser/_chunks/chart-context-BXECNDNl.js +0 -1
- package/dist/browser/_chunks/chart-markers-D2vAxxz8.js +0 -1
- package/dist/browser/_chunks/messages-BNa7iZeR.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"../../../_chunks/rolldown-runtime-B0Z9INg1.js";import{t}from"../../../_chunks/react-BcFqt3h5.js";import{t as n}from"../../../_chunks/compiler-runtime-Br_I-bNG.js";import{t as r}from"../../../_chunks/jsx-runtime-CNz6huh3.js";import{t as i}from"../../../_chunks/dist-hovC-tlK.js";import{n as a,r as o,t as s}from"../../../_chunks/animation-D8IqP_32.js";import{d as c,t as l}from"../../../_chunks/time-series-chart-shell-DdQX4Mtk.js";import{t as u}from"../../../_chunks/grid-DtZfnOVN.js";import{i as d,t as f}from"../../../_chunks/y-axis-scales-JGNJ3oYP.js";import{a as p,i as m,n as h,o as g,r as _,s as v,t as y}from"../../../_chunks/chart-context-BXECNDNl.js";import{r as b,t as x}from"../../../_chunks/projection-line-qJfy22Rn.js";import{_ as S,a as C,c as w,d as T,g as E,h as D,i as O,l as k,m as A,n as j,p as M,r as N,s as P,t as F,u as I}from"../../../_chunks/chart-markers-D2vAxxz8.js";import{i as L,n as R,r as z,t as ee}from"../../../_chunks/chart-config-context-DjCufEb2.js";import{n as B,t as V}from"../../../_chunks/chart-legend-hover-TZ_1t9hC.js";import{i as H,n as U,t as W}from"../../../_chunks/series-markers-Cc2cS6gp.js";import{a as G,i as K,n as q,o as te,r as J,t as ne}from"../../../_chunks/chart-density-Dm5sAroN.js";import{a as Y,i as re,n as ie,o as ae,r as oe,s as se,t as ce}from"../../../_chunks/chart-phase-oX99XcEO.js";import{t as le}from"../../../_chunks/chart-child-passthrough-L3xNi0fN.js";import{a as ue,c as de,d as fe,f as pe,i as me,l as he,n as ge,o as _e,p as ve,r as ye,s as be,t as xe,u as Se}from"../../../_chunks/projection-config-DO6vzrLI.js";import{a as Ce,c as we,l as Te,p as Ee,r as De,u as Oe}from"../../../_chunks/y-domain-utils-BQs45POG.js";import{a as ke,n as Ae,t as je}from"../../../_chunks/x-axis-BPVhMFoB.js";import{a as Me,c as Ne,i as Pe,l as Fe,n as Ie,o as Le,r as Re,s as ze,t as Be}from"../../../_chunks/pattern-preset-BYTG3Sn4.js";import{t as Ve}from"../../../_chunks/background-CYeyUUjW.js";import{a as He,i as Ue,o as We,r as Ge,s as Ke,t as qe}from"../../../_chunks/chart-tooltip-L0grgDEh.js";import{t as Je}from"../../../_chunks/reference-area-Bnwi9gJk.js";import{a as Ye,i as Xe,n as Ze,r as Qe,t as $e}from"../../../_chunks/y-axis-BcBZf0OU.js";import{t as et}from"../../../_chunks/tooltip-box-DDr_WNoq.js";import{t as tt}from"../../../_chunks/tooltip-content-BZh0nIAz.js";import{t as X}from"../../../_chunks/area-series-BtQz8YgT.js";import{t as nt}from"../../../_chunks/ParentSize-tno5okh0.js";var Z=n(),Q=/* @__PURE__ */ e(r(),1),$=/* @__PURE__ */ e(t(),1);function rt(e){let t=[];return $.Children.forEach(e,e=>{if(!(0,$.isValidElement)(e))return;let n=e.type,r=typeof e.type==`function`&&(n.displayName||n.name)||``,i=e.props,a=r===`PatternArea`||e.type===A;(r===`Area`||e.type===X||i&&typeof i.dataKey==`string`&&i.dataKey.length>0&&!a)&&i?.dataKey&&t.push({dataKey:i.dataKey,stroke:i.stroke||i.fill||`var(--chart-line-primary)`,strokeWidth:i.strokeWidth||2,yAxisId:i.yAxisId})}),t}function it(e){let t=(0,Z.c)(25),{width:n,height:r,data:i,xDataKey:a,margin:o,density:s,animationDuration:c,animationEasing:u,enterTransition:d,revealSignature:f,chartStatus:p,loadingLabel:m,yDomainTweenDuration:h,yDomainTween:g,xDomain:_,xDomainSlotCount:v,tweenYDomainOnXDomainChange:y,children:b,containerRef:x,onPhaseChange:S,clipPathId:C}=e,w;t[0]===b?w=t[1]:(w=rt(b),t[0]=b,t[1]=w);let T=w,E;return t[2]!==c||t[3]!==u||t[4]!==p||t[5]!==b||t[6]!==C||t[7]!==x||t[8]!==i||t[9]!==s||t[10]!==d||t[11]!==r||t[12]!==T||t[13]!==m||t[14]!==o||t[15]!==S||t[16]!==f||t[17]!==y||t[18]!==n||t[19]!==a||t[20]!==_||t[21]!==v||t[22]!==g||t[23]!==h?(E=/* @__PURE__ */ (0,Q.jsx)(l,{animationDuration:c,animationEasing:u,chartStatus:p,clipPathId:C,containerRef:x,data:i,enterTransition:d,height:r,lines:T,loadingLabel:m,density:s,margin:o,onPhaseChange:S,revealSignature:f,tweenYDomainOnXDomainChange:y,width:n,xDataKey:a,xDomain:_,xDomainSlotCount:v,yDomainTween:g,yDomainTweenDuration:h,children:b}),t[2]=c,t[3]=u,t[4]=p,t[5]=b,t[6]=C,t[7]=x,t[8]=i,t[9]=s,t[10]=d,t[11]=r,t[12]=T,t[13]=m,t[14]=o,t[15]=S,t[16]=f,t[17]=y,t[18]=n,t[19]=a,t[20]=_,t[21]=v,t[22]=g,t[23]=h,t[24]=E):E=t[24],E}function at(e){let t=(0,Z.c)(44),{data:n,xDataKey:r,density:a,margin:o,animationDuration:s,animationEasing:c,enterTransition:l,revealSignature:u,aspectRatio:d,className:f,status:p,loadingLabel:m,yDomainTweenDuration:h,yDomainTween:g,xDomain:_,xDomainSlotCount:v,tweenYDomainOnXDomainChange:y,style:b,onPhaseChange:x,children:S}=e,C=r===void 0?`date`:r,w=a===void 0?J:a,T=s===void 0?1100:s,E=d===void 0?`2 / 1`:d,D=f===void 0?``:f,O=p===void 0?ie:p,k=h===void 0?500:h,A=g===void 0||g,j=y!==void 0&&y,M=(0,$.useId)(),N;if(t[0]!==M){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=/:/g,t[2]=e):e=t[2],N=M.replace(e,``),t[0]=M,t[1]=N}else N=t[1];let P=`chart-area-grow-clip-${N}`,F=(0,$.useRef)(null),I;t[3]!==w||t[4]!==o?(I=K(w,o),t[3]=w,t[4]=o,t[5]=I):I=t[5];let L=I,R;t[6]===O?R=t[7]:(R=()=>Y(O),t[6]=O,t[7]=R);let[z,ee]=(0,$.useState)(R),B;t[8]!==z||t[9]!==m?(B=m?.trim()&&(z===`loading`||z===`exiting`||z===`gridTweenReady`||z===`revealingLoading`),t[8]=z,t[9]=m,t[10]=B):B=t[10];let V=!!B,H;t[11]===D?H=t[12]:(H=i(`relative w-full`,D),t[11]=D,t[12]=H);let U;t[13]!==E||t[14]!==b?(U={aspectRatio:E,touchAction:`none`,...b},t[13]=E,t[14]=b,t[15]=U):U=t[15];let W;t[16]!==T||t[17]!==c||t[18]!==S||t[19]!==P||t[20]!==n||t[21]!==w||t[22]!==l||t[23]!==m||t[24]!==L||t[25]!==x||t[26]!==u||t[27]!==O||t[28]!==j||t[29]!==C||t[30]!==_||t[31]!==v||t[32]!==A||t[33]!==k?(W=/* @__PURE__ */ (0,Q.jsx)(nt,{debounceTime:10,children:e=>{let{width:t,height:r}=e;return/* @__PURE__ */ (0,Q.jsx)(it,{animationDuration:T,animationEasing:c,chartStatus:O,containerRef:F,data:n,enterTransition:l,height:r,loadingLabel:m,density:w,margin:L,onPhaseChange:e=>{ee(e),x?.(e)},revealSignature:u,tweenYDomainOnXDomainChange:j,width:t,xDataKey:C,xDomain:_,xDomainSlotCount:v,yDomainTween:A,yDomainTweenDuration:k,clipPathId:P,children:S})}}),t[16]=T,t[17]=c,t[18]=S,t[19]=P,t[20]=n,t[21]=w,t[22]=l,t[23]=m,t[24]=L,t[25]=x,t[26]=u,t[27]=O,t[28]=j,t[29]=C,t[30]=_,t[31]=v,t[32]=A,t[33]=k,t[34]=W):W=t[34];let G;t[35]!==z||t[36]!==m||t[37]!==V?(G=V?/* @__PURE__ */ (0,Q.jsx)(ae,{exiting:z!==`loading`,text:m}):null,t[35]=z,t[36]=m,t[37]=V,t[38]=G):G=t[38];let q;return t[39]!==H||t[40]!==U||t[41]!==W||t[42]!==G?(q=/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:H,ref:F,style:U,children:[W,G]}),t[39]=H,t[40]=U,t[41]=W,t[42]=G,t[43]=q):q=t[43],q}const ot=I;function st(e){let t=(0,Z.c)(19),{margin:n,stroke:r,strokeOpacity:i,gridStroke:a,gridShimmerStroke:o,gridShimmer:s,gridShimmerLength:l,gridShimmerSpeed:d,gridShimmerSync:f,loadingStyle:p,label:m,aspectRatio:h,className:g}=e,_=r===void 0?`var(--chart-foreground)`:r,v=i===void 0?.5:i,y=a===void 0?`color-mix(in oklch, var(--chart-grid) 50%, transparent)`:a,b=o===void 0?`color-mix(in oklch, var(--chart-foreground) 68%, transparent)`:o,x=s===void 0||s,S=f!==void 0&&f,C=p===void 0?`pulse`:p,w=m===void 0?`Loading`:m,E=h===void 0?`2 / 1`:h,D=g===void 0?``:g,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(O=T({dataKey:I,pointCount:7}),t[0]=O):O=t[0];let k=O,A=C!==`sweep`&&x,j;t[1]!==l||t[2]!==d||t[3]!==b||t[4]!==S||t[5]!==y||t[6]!==A?(j=/* @__PURE__ */ (0,Q.jsx)(u,{horizontal:!0,shimmer:A,shimmerLength:l,shimmerSpeed:d,shimmerStroke:b,shimmerSync:S,stroke:y}),t[1]=l,t[2]=d,t[3]=b,t[4]=S,t[5]=y,t[6]=A,t[7]=j):j=t[7];let M;t[8]!==C||t[9]!==_||t[10]!==v?(M=/* @__PURE__ */ (0,Q.jsx)(X,{curve:c,dataKey:ot,fadeEdges:!1,fill:`transparent`,fillOpacity:0,loading:!0,loadingStroke:_,loadingStrokeOpacity:v,loadingStyle:C,showHighlight:!1,showLine:!0,stroke:`transparent`,strokeWidth:2}),t[8]=C,t[9]=_,t[10]=v,t[11]=M):M=t[11];let N;return t[12]!==E||t[13]!==D||t[14]!==w||t[15]!==n||t[16]!==j||t[17]!==M?(N=/* @__PURE__ */ (0,Q.jsxs)(at,{animationDuration:0,aspectRatio:E,className:D,data:k,loadingLabel:w,margin:n,status:`loading`,children:[j,M]}),t[12]=E,t[13]=D,t[14]=w,t[15]=n,t[16]=j,t[17]=M,t[18]=N):N=t[18],N}export{X as Area,at as AreaChart,st as AreaChartLoading,Ve as Background,D as BarLoadingSkeleton,le as CHART_CLIP_PASSTHROUGH,ne as CHART_DENSITY,q as CHART_DENSITY_IDS,ee as ChartConfigProvider,V as ChartLegendHoverProvider,ae as ChartLoadingLabel,F as ChartMarkers,y as ChartProvider,M as ChartRevealClip,qe as ChartTooltip,s as DEFAULT_ANIMATION_DURATION_MS,a as DEFAULT_ANIMATION_EASING,R as DEFAULT_CHART_CONFIG,J as DEFAULT_CHART_DENSITY,o as DEFAULT_CHART_ENTER_TRANSITION,ce as DEFAULT_CHART_LIFECYCLE,ie as DEFAULT_CHART_STATUS,f as DEFAULT_Y_AXIS_ID,oe as DEFAULT_Y_DOMAIN_TWEEN_MS,He as DateTicker,u as Grid,E as LineLoadingSweep,O as MarkerGroup,j as MarkerTooltipContent,Be as PATTERN_PRESET_IDS,A as PatternArea,Le as PatternCircles,ze as PatternHexagons,Ne as PatternLines,Fe as PatternWaves,x as ProjectionLine,b as ProjectionLineEndMarker,Je as ReferenceArea,W as SeriesMarkers,U as SeriesPointMarker,se as ShimmeringText,w as StaticChartPreviewProvider,et as TooltipBox,tt as TooltipContent,Ue as TooltipDot,Ge as TooltipIndicator,je as XAxis,$e as YAxis,Ze as Y_AXIS_DEFAULT_TICK_COUNT,Qe as Y_AXIS_MAX_TICK_COUNT,Xe as Y_AXIS_MIN_TICK_COUNT,he as buildHorizontalTangentBezierPath,Se as buildProjectionPath,h as chartCssVars,xe as clampHoverIndexToMaxTime,ge as clampPixelXToProjectionHoverMax,fe as computeProjectionAnchorTangentSlope,De as computeYDomainsByAxis,_ as defaultScatterColors,ye as extractProjectionLineConfigs,T as generateChartSkeletonData,d as getPrimaryYScale,H as getSeriesMarkerVisualExtent,S as getSkeletonHeights,We as indicatorFadeGradientStops,re as isChartInteractionPhase,Ie as isCirclePattern,Re as isCirclesPattern,Ce as isLoadingChromePhase,we as isYDomainTweenPhase,Ae as measureMaxLabelWidthPx,me as mergeProjectionXDomainMax,ue as mergeProjectionYDomain,Te as mergeYDomainRecords,Oe as niceYDomain,Pe as patternPresetTileSize,pe as projectionDateExtents,_e as projectionHoverMaxBySeries,be as projectionHoverMaxTime,de as projectionPinnedOverlayX,ve as projectionValueExtents,Me as renderPatternPreset,K as resolveChartMargin,G as resolveDensityMaxLabels,te as resolveDensityTickCount,Y as resolveRestingChartPhase,z as resolveTooltipBoxMotion,Ke as resolveVerticalFadeSides,ke as resolveYAxisMarginPx,Ye as resolveYAxisTickCount,Ee as shouldTweenYDomain,N as useActiveMarkers,P as useAnimatedYDomains,m as useChart,L as useChartConfig,p as useChartHover,C as useChartInteraction,B as useChartLegendHover,g as useChartStable,k as useStaticChartPreview,v as useYScale};
|
|
1
|
+
import{a as e}from"../../../_chunks/rolldown-runtime-B0Z9INg1.js";import{t}from"../../../_chunks/react-BcFqt3h5.js";import{t as n}from"../../../_chunks/compiler-runtime-Br_I-bNG.js";import{t as r}from"../../../_chunks/jsx-runtime-CNz6huh3.js";import{t as i}from"../../../_chunks/dist-hovC-tlK.js";import{n as a,r as o,t as s}from"../../../_chunks/animation-D8IqP_32.js";import{d as c,t as l}from"../../../_chunks/time-series-chart-shell-B1blo6_Q.js";import{t as u}from"../../../_chunks/grid-Bg9exNBo.js";import{i as d,t as f}from"../../../_chunks/y-axis-scales-JGNJ3oYP.js";import{a as p,i as m,n as h,o as g,r as _,s as v,t as y}from"../../../_chunks/chart-context-Bjw_NzAE.js";import{r as b,t as x}from"../../../_chunks/projection-line-pR-NKJB1.js";import{_ as S,a as C,c as w,d as T,g as E,h as D,i as O,l as k,m as A,n as j,p as M,r as N,s as P,t as F,u as I}from"../../../_chunks/chart-markers-BLtXtGRE.js";import{i as L,n as R,r as z,t as ee}from"../../../_chunks/chart-config-context-DjCufEb2.js";import{n as B,t as V}from"../../../_chunks/chart-legend-hover-TZ_1t9hC.js";import{i as H,n as U,t as W}from"../../../_chunks/series-markers-BYXibIP2.js";import{a as G,i as K,n as q,o as te,r as J,t as ne}from"../../../_chunks/chart-density-Dm5sAroN.js";import{a as Y,i as re,n as ie,o as ae,r as oe,s as se,t as ce}from"../../../_chunks/chart-phase-oX99XcEO.js";import{t as le}from"../../../_chunks/chart-child-passthrough-L3xNi0fN.js";import{a as ue,c as de,d as fe,f as pe,i as me,l as he,n as ge,o as _e,p as ve,r as ye,s as be,t as xe,u as Se}from"../../../_chunks/projection-config-DO6vzrLI.js";import{a as Ce,c as we,l as Te,p as Ee,r as De,u as Oe}from"../../../_chunks/y-domain-utils-BQs45POG.js";import{a as ke,n as Ae,t as je}from"../../../_chunks/x-axis-ByrWoBBx.js";import{a as Me,c as Ne,i as Pe,l as Fe,n as Ie,o as Le,r as Re,s as ze,t as Be}from"../../../_chunks/pattern-preset-BYTG3Sn4.js";import{t as Ve}from"../../../_chunks/background-CJA6Zjoc.js";import{a as He,i as Ue,o as We,r as Ge,s as Ke,t as qe}from"../../../_chunks/chart-tooltip-Q2xwFLCY.js";import{t as Je}from"../../../_chunks/reference-area-CsmmBmaE.js";import{a as Ye,i as Xe,n as Ze,r as Qe,t as $e}from"../../../_chunks/y-axis-OF5jnUeL.js";import{t as et}from"../../../_chunks/tooltip-box-9EA8wbsd.js";import{t as tt}from"../../../_chunks/tooltip-content-BZh0nIAz.js";import{t as X}from"../../../_chunks/area-series-fHW11oCG.js";import{t as nt}from"../../../_chunks/ParentSize-tno5okh0.js";var Z=n(),Q=/* @__PURE__ */ e(r(),1),$=/* @__PURE__ */ e(t(),1);function rt(e){let t=[];return $.Children.forEach(e,e=>{if(!(0,$.isValidElement)(e))return;let n=e.type,r=typeof e.type==`function`&&(n.displayName||n.name)||``,i=e.props,a=r===`PatternArea`||e.type===A;(r===`Area`||e.type===X||i&&typeof i.dataKey==`string`&&i.dataKey.length>0&&!a)&&i?.dataKey&&t.push({dataKey:i.dataKey,stroke:i.stroke||i.fill||`var(--chart-line-primary)`,strokeWidth:i.strokeWidth||2,yAxisId:i.yAxisId})}),t}function it(e){let t=(0,Z.c)(25),{width:n,height:r,data:i,xDataKey:a,margin:o,density:s,animationDuration:c,animationEasing:u,enterTransition:d,revealSignature:f,chartStatus:p,loadingLabel:m,yDomainTweenDuration:h,yDomainTween:g,xDomain:_,xDomainSlotCount:v,tweenYDomainOnXDomainChange:y,children:b,containerRef:x,onPhaseChange:S,clipPathId:C}=e,w;t[0]===b?w=t[1]:(w=rt(b),t[0]=b,t[1]=w);let T=w,E;return t[2]!==c||t[3]!==u||t[4]!==p||t[5]!==b||t[6]!==C||t[7]!==x||t[8]!==i||t[9]!==s||t[10]!==d||t[11]!==r||t[12]!==T||t[13]!==m||t[14]!==o||t[15]!==S||t[16]!==f||t[17]!==y||t[18]!==n||t[19]!==a||t[20]!==_||t[21]!==v||t[22]!==g||t[23]!==h?(E=/* @__PURE__ */ (0,Q.jsx)(l,{animationDuration:c,animationEasing:u,chartStatus:p,clipPathId:C,containerRef:x,data:i,enterTransition:d,height:r,lines:T,loadingLabel:m,density:s,margin:o,onPhaseChange:S,revealSignature:f,tweenYDomainOnXDomainChange:y,width:n,xDataKey:a,xDomain:_,xDomainSlotCount:v,yDomainTween:g,yDomainTweenDuration:h,children:b}),t[2]=c,t[3]=u,t[4]=p,t[5]=b,t[6]=C,t[7]=x,t[8]=i,t[9]=s,t[10]=d,t[11]=r,t[12]=T,t[13]=m,t[14]=o,t[15]=S,t[16]=f,t[17]=y,t[18]=n,t[19]=a,t[20]=_,t[21]=v,t[22]=g,t[23]=h,t[24]=E):E=t[24],E}function at(e){let t=(0,Z.c)(44),{data:n,xDataKey:r,density:a,margin:o,animationDuration:s,animationEasing:c,enterTransition:l,revealSignature:u,aspectRatio:d,className:f,status:p,loadingLabel:m,yDomainTweenDuration:h,yDomainTween:g,xDomain:_,xDomainSlotCount:v,tweenYDomainOnXDomainChange:y,style:b,onPhaseChange:x,children:S}=e,C=r===void 0?`date`:r,w=a===void 0?J:a,T=s===void 0?1100:s,E=d===void 0?`2 / 1`:d,D=f===void 0?``:f,O=p===void 0?ie:p,k=h===void 0?500:h,A=g===void 0||g,j=y!==void 0&&y,M=(0,$.useId)(),N;if(t[0]!==M){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=/:/g,t[2]=e):e=t[2],N=M.replace(e,``),t[0]=M,t[1]=N}else N=t[1];let P=`chart-area-grow-clip-${N}`,F=(0,$.useRef)(null),I;t[3]!==w||t[4]!==o?(I=K(w,o),t[3]=w,t[4]=o,t[5]=I):I=t[5];let L=I,R;t[6]===O?R=t[7]:(R=()=>Y(O),t[6]=O,t[7]=R);let[z,ee]=(0,$.useState)(R),B;t[8]!==z||t[9]!==m?(B=m?.trim()&&(z===`loading`||z===`exiting`||z===`gridTweenReady`||z===`revealingLoading`),t[8]=z,t[9]=m,t[10]=B):B=t[10];let V=!!B,H;t[11]===D?H=t[12]:(H=i(`relative w-full`,D),t[11]=D,t[12]=H);let U;t[13]!==E||t[14]!==b?(U={aspectRatio:E,touchAction:`none`,...b},t[13]=E,t[14]=b,t[15]=U):U=t[15];let W;t[16]!==T||t[17]!==c||t[18]!==S||t[19]!==P||t[20]!==n||t[21]!==w||t[22]!==l||t[23]!==m||t[24]!==L||t[25]!==x||t[26]!==u||t[27]!==O||t[28]!==j||t[29]!==C||t[30]!==_||t[31]!==v||t[32]!==A||t[33]!==k?(W=/* @__PURE__ */ (0,Q.jsx)(nt,{debounceTime:10,children:e=>{let{width:t,height:r}=e;return/* @__PURE__ */ (0,Q.jsx)(it,{animationDuration:T,animationEasing:c,chartStatus:O,containerRef:F,data:n,enterTransition:l,height:r,loadingLabel:m,density:w,margin:L,onPhaseChange:e=>{ee(e),x?.(e)},revealSignature:u,tweenYDomainOnXDomainChange:j,width:t,xDataKey:C,xDomain:_,xDomainSlotCount:v,yDomainTween:A,yDomainTweenDuration:k,clipPathId:P,children:S})}}),t[16]=T,t[17]=c,t[18]=S,t[19]=P,t[20]=n,t[21]=w,t[22]=l,t[23]=m,t[24]=L,t[25]=x,t[26]=u,t[27]=O,t[28]=j,t[29]=C,t[30]=_,t[31]=v,t[32]=A,t[33]=k,t[34]=W):W=t[34];let G;t[35]!==z||t[36]!==m||t[37]!==V?(G=V?/* @__PURE__ */ (0,Q.jsx)(ae,{exiting:z!==`loading`,text:m}):null,t[35]=z,t[36]=m,t[37]=V,t[38]=G):G=t[38];let q;return t[39]!==H||t[40]!==U||t[41]!==W||t[42]!==G?(q=/* @__PURE__ */ (0,Q.jsxs)(`div`,{className:H,ref:F,style:U,children:[W,G]}),t[39]=H,t[40]=U,t[41]=W,t[42]=G,t[43]=q):q=t[43],q}const ot=I;function st(e){let t=(0,Z.c)(19),{margin:n,stroke:r,strokeOpacity:i,gridStroke:a,gridShimmerStroke:o,gridShimmer:s,gridShimmerLength:l,gridShimmerSpeed:d,gridShimmerSync:f,loadingStyle:p,label:m,aspectRatio:h,className:g}=e,_=r===void 0?`var(--chart-foreground)`:r,v=i===void 0?.5:i,y=a===void 0?`color-mix(in oklch, var(--chart-grid) 50%, transparent)`:a,b=o===void 0?`color-mix(in oklch, var(--chart-foreground) 68%, transparent)`:o,x=s===void 0||s,S=f!==void 0&&f,C=p===void 0?`pulse`:p,w=m===void 0?`Loading`:m,E=h===void 0?`2 / 1`:h,D=g===void 0?``:g,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(O=T({dataKey:I,pointCount:7}),t[0]=O):O=t[0];let k=O,A=C!==`sweep`&&x,j;t[1]!==l||t[2]!==d||t[3]!==b||t[4]!==S||t[5]!==y||t[6]!==A?(j=/* @__PURE__ */ (0,Q.jsx)(u,{horizontal:!0,shimmer:A,shimmerLength:l,shimmerSpeed:d,shimmerStroke:b,shimmerSync:S,stroke:y}),t[1]=l,t[2]=d,t[3]=b,t[4]=S,t[5]=y,t[6]=A,t[7]=j):j=t[7];let M;t[8]!==C||t[9]!==_||t[10]!==v?(M=/* @__PURE__ */ (0,Q.jsx)(X,{curve:c,dataKey:ot,fadeEdges:!1,fill:`transparent`,fillOpacity:0,loading:!0,loadingStroke:_,loadingStrokeOpacity:v,loadingStyle:C,showHighlight:!1,showLine:!0,stroke:`transparent`,strokeWidth:2}),t[8]=C,t[9]=_,t[10]=v,t[11]=M):M=t[11];let N;return t[12]!==E||t[13]!==D||t[14]!==w||t[15]!==n||t[16]!==j||t[17]!==M?(N=/* @__PURE__ */ (0,Q.jsxs)(at,{animationDuration:0,aspectRatio:E,className:D,data:k,loadingLabel:w,margin:n,status:`loading`,children:[j,M]}),t[12]=E,t[13]=D,t[14]=w,t[15]=n,t[16]=j,t[17]=M,t[18]=N):N=t[18],N}export{X as Area,at as AreaChart,st as AreaChartLoading,Ve as Background,D as BarLoadingSkeleton,le as CHART_CLIP_PASSTHROUGH,ne as CHART_DENSITY,q as CHART_DENSITY_IDS,ee as ChartConfigProvider,V as ChartLegendHoverProvider,ae as ChartLoadingLabel,F as ChartMarkers,y as ChartProvider,M as ChartRevealClip,qe as ChartTooltip,s as DEFAULT_ANIMATION_DURATION_MS,a as DEFAULT_ANIMATION_EASING,R as DEFAULT_CHART_CONFIG,J as DEFAULT_CHART_DENSITY,o as DEFAULT_CHART_ENTER_TRANSITION,ce as DEFAULT_CHART_LIFECYCLE,ie as DEFAULT_CHART_STATUS,f as DEFAULT_Y_AXIS_ID,oe as DEFAULT_Y_DOMAIN_TWEEN_MS,He as DateTicker,u as Grid,E as LineLoadingSweep,O as MarkerGroup,j as MarkerTooltipContent,Be as PATTERN_PRESET_IDS,A as PatternArea,Le as PatternCircles,ze as PatternHexagons,Ne as PatternLines,Fe as PatternWaves,x as ProjectionLine,b as ProjectionLineEndMarker,Je as ReferenceArea,W as SeriesMarkers,U as SeriesPointMarker,se as ShimmeringText,w as StaticChartPreviewProvider,et as TooltipBox,tt as TooltipContent,Ue as TooltipDot,Ge as TooltipIndicator,je as XAxis,$e as YAxis,Ze as Y_AXIS_DEFAULT_TICK_COUNT,Qe as Y_AXIS_MAX_TICK_COUNT,Xe as Y_AXIS_MIN_TICK_COUNT,he as buildHorizontalTangentBezierPath,Se as buildProjectionPath,h as chartCssVars,xe as clampHoverIndexToMaxTime,ge as clampPixelXToProjectionHoverMax,fe as computeProjectionAnchorTangentSlope,De as computeYDomainsByAxis,_ as defaultScatterColors,ye as extractProjectionLineConfigs,T as generateChartSkeletonData,d as getPrimaryYScale,H as getSeriesMarkerVisualExtent,S as getSkeletonHeights,We as indicatorFadeGradientStops,re as isChartInteractionPhase,Ie as isCirclePattern,Re as isCirclesPattern,Ce as isLoadingChromePhase,we as isYDomainTweenPhase,Ae as measureMaxLabelWidthPx,me as mergeProjectionXDomainMax,ue as mergeProjectionYDomain,Te as mergeYDomainRecords,Oe as niceYDomain,Pe as patternPresetTileSize,pe as projectionDateExtents,_e as projectionHoverMaxBySeries,be as projectionHoverMaxTime,de as projectionPinnedOverlayX,ve as projectionValueExtents,Me as renderPatternPreset,K as resolveChartMargin,G as resolveDensityMaxLabels,te as resolveDensityTickCount,Y as resolveRestingChartPhase,z as resolveTooltipBoxMotion,Ke as resolveVerticalFadeSides,ke as resolveYAxisMarginPx,Ye as resolveYAxisTickCount,Ee as shouldTweenYDomain,N as useActiveMarkers,P as useAnimatedYDomains,m as useChart,L as useChartConfig,p as useChartHover,C as useChartInteraction,B as useChartLegendHover,g as useChartStable,k as useStaticChartPreview,v as useYScale};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"../../../_chunks/rolldown-runtime-B0Z9INg1.js";import{t}from"../../../_chunks/react-BcFqt3h5.js";import{t as n}from"../../../_chunks/compiler-runtime-Br_I-bNG.js";import{t as r}from"../../../_chunks/jsx-runtime-CNz6huh3.js";import{t as i}from"../../../_chunks/dist-hovC-tlK.js";import{n as a}from"../../../_chunks/react-pnTbDyGB.js";import{t as o}from"../../../_chunks/react-dom-Cn-Wbvts.js";import{n as s,r as c,t as l}from"../../../_chunks/animation-D8IqP_32.js";import{t as u}from"../../../_chunks/band-BdEqNwFI.js";import{n as d,t as f}from"../../../_chunks/linear-Bx9uzvr3.js";import{t as p}from"../../../_chunks/grid-DtZfnOVN.js";import{i as m,n as h,o as g,s as _,t as v}from"../../../_chunks/y-axis-scales-JGNJ3oYP.js";import{a as y,i as b,n as x,o as S,r as C,s as w,t as T}from"../../../_chunks/chart-context-BXECNDNl.js";import{r as E,t as D}from"../../../_chunks/projection-line-qJfy22Rn.js";import{_ as O,a as k,c as A,d as j,g as M,h as N,i as P,l as F,m as I,n as L,o as R,p as z,r as B,s as V,t as H}from"../../../_chunks/chart-markers-D2vAxxz8.js";import{i as U,n as W,r as G,t as ee}from"../../../_chunks/chart-config-context-DjCufEb2.js";import{n as te,t as K}from"../../../_chunks/chart-legend-hover-TZ_1t9hC.js";import{i as ne,n as q,t as J}from"../../../_chunks/series-markers-Cc2cS6gp.js";import{a as re}from"../../../_chunks/chart-formatters-C23Gt1wa.js";import{a as ie,i as ae,n as oe,o as se,r as ce,t as le}from"../../../_chunks/chart-density-Dm5sAroN.js";import{a as ue,i as de,n as Y,o as X,r as fe,s as pe,t as me}from"../../../_chunks/chart-phase-oX99XcEO.js";import{a as he,c as ge,i as _e,n as ve,o as ye,r as be,s as xe,t as Se}from"../../../_chunks/chart-child-passthrough-L3xNi0fN.js";import{a as Ce,c as we,d as Te,f as Ee,i as De,l as Oe,n as ke,o as Ae,p as je,r as Me,s as Ne,t as Pe,u as Fe}from"../../../_chunks/projection-config-DO6vzrLI.js";import{a as Ie,c as Le,f as Re,l as ze,n as Be,p as Ve,r as He,t as Ue,u as We}from"../../../_chunks/y-domain-utils-BQs45POG.js";import{t as Ge}from"../../../_chunks/localPoint-BuWgV2HG.js";import{a as Ke,i as qe,n as Je,o as Ye,t as Xe}from"../../../_chunks/x-axis-BPVhMFoB.js";import{a as Ze,c as Qe,i as $e,l as et,n as tt,o as nt,r as rt,s as it,t as at}from"../../../_chunks/pattern-preset-BYTG3Sn4.js";import{t as ot}from"../../../_chunks/background-CYeyUUjW.js";import{a as st,i as ct,n as lt,o as ut,r as dt,s as ft,t as pt}from"../../../_chunks/chart-tooltip-L0grgDEh.js";import{t as mt}from"../../../_chunks/reference-area-Bnwi9gJk.js";import{a as ht,i as gt,n as _t,r as vt,t as yt}from"../../../_chunks/y-axis-BcBZf0OU.js";import{t as bt}from"../../../_chunks/tooltip-box-DDr_WNoq.js";import{t as xt}from"../../../_chunks/tooltip-content-BZh0nIAz.js";import{n as St,t as Ct}from"../../../_chunks/chart-defs-D1AKdYnA.js";import{t as wt}from"../../../_chunks/reference-area-config-3tJB6RT1.js";import{t as Tt}from"../../../_chunks/ParentSize-tno5okh0.js";import{t as Et}from"../../../_chunks/motion-utils-FSUhZgF9.js";const Dt=d(`domain`,`range`,`reverse`,`align`,`padding`,`round`);function Ot(e){return Dt(u(),e)}function kt({barLengthPx:e,squareSize:t,gap:n,fit:r=!1}){if(e<=0||t<=0)return{count:0,positions:[],columnHeight:0,squareSize:t,gap:n};if(r){let r=Math.max(1,Math.floor((e+n)/(t+n))),i=r>1?Math.max(0,(e-r*t)/(r-1)):0,a=t+i,o=e,s=[];for(let e=0;e<r;e++)s.push(o-t-e*a);return{count:r,positions:s,columnHeight:o,squareSize:t,gap:i}}let i=t+n,a=Math.max(1,Math.round(e/i)),o=a*t+Math.max(0,a-1)*n,s=[];for(let e=0;e<a;e++){let n=e*i;s.push(o-t-n)}return{count:a,positions:s,columnHeight:o,squareSize:t,gap:n}}function At({baselineY:e,barLengthPx:t,squareSize:n,gap:r,fit:i=!1}){let{count:a,squareSize:o,columnHeight:s}=kt({barLengthPx:t,squareSize:n,gap:r,fit:i});return a===0?e:e-s+o/2}var Z=n(),Q=/* @__PURE__ */ e(r(),1),$=/* @__PURE__ */ e(t(),1);function jt(e){let t=[];return ve(e,e=>{let n=e.type;if(n.__isBarDepthLayer)return;let r=typeof e.type==`function`&&(n.displayName||n.name)||``,i=e.props;if((r===`Bar`||r===`BarSquares`||i&&typeof i.dataKey==`string`&&i.dataKey.length>0)&&i?.dataKey){let e=typeof i.fill==`string`?i.fill:void 0,n=i.stroke||e||`var(--chart-line-primary)`;t.push({dataKey:i.dataKey,stroke:n,strokeWidth:0,yAxisId:i.yAxisId,baseDataKey:i.baseDataKey})}}),t}function Mt(e){let t=(0,Z.c)(2),{width:n,height:r}=e;if(n<10||r<10)return null;let i;return t[0]===e?i=t[1]:(i=/* @__PURE__ */ (0,Q.jsx)(Nt,{...e}),t[0]=e,t[1]=i),i}const Nt=(0,$.memo)(function({width:e,height:t,data:n,xDataKey:r,margin:i,density:a,animationDuration:o,animationEasing:s,enterTransition:c,revealSignature:l=``,barGap:u,barWidthProp:d,barAlign:p,orientation:v,loadingSkeletonOrientation:y,maxValue:b,stacked:x,stackGap:S,squareSnap:C,children:w,containerRef:E,onPhaseChange:D,status:O}){let{tooltipData:k,setTooltipData:A,scheduleTooltip:j,clearTooltip:M}=R(),[P,F]=(0,$.useState)(!1),[I,L]=(0,$.useState)(0),z=k?.index??null,B=v===`horizontal`,V=(0,$.useMemo)(()=>jt(w),[w]),H=e-i.left-i.right,U=t-i.top-i.bottom,W=(0,$.useCallback)(e=>{let t=e[r];return t instanceof Date?re.format(t):String(t)},[r]),G=(0,$.useCallback)(e=>{let t=e[r];return t instanceof Date?t:/* @__PURE__ */ new Date},[r]),ee=n.map(e=>W(e)),te=Ot({range:B?[0,U]:[0,H],domain:ee,padding:u}),K=p===`center`&&d!=null?(()=>{let e=(te.bandwidth()-d)/2;return e>0?Object.assign(t=>{let n=te(t);return n===void 0?void 0:n+e},te):te})():te,ne=d??K.bandwidth(),q=(0,$.useMemo)(()=>{let e=x?Be(n,V):Ue(n,V);return Re(e,b)},[n,V,x,b]),J=(0,$.useMemo)(()=>f({range:B?[0,H]:[U,0],domain:q,nice:b===void 0}),[H,U,B,b,q]),ie=(0,$.useMemo)(()=>B?_(J):h({lines:V,data:n,innerHeight:U,resolveDomain:e=>{let t=V.filter(t=>e.includes(t.dataKey)),r=x?Be(n,t):Ue(n,t);return Re(r,b)}}),[n,U,B,V,b,x,J]),ae=m(ie,J),oe=(0,$.useMemo)(()=>{if(!x)return;let e=/* @__PURE__ */ new Map;for(let t=0;t<n.length;t++){let r=n[t];if(!r)continue;let i=/* @__PURE__ */ new Map,a=0;for(let e of V){i.set(e.dataKey,a);let t=r[e.dataKey];typeof t==`number`&&(a+=t)}e.set(t,i)}return e},[n,V,x]),se=(0,$.useMemo)(()=>n.length<1?0:B?U/n.length:H/n.length,[H,U,n.length,B]),ce=(0,$.useMemo)(()=>n.map(e=>W(e)),[n,W]),le=(0,$.useMemo)(()=>{let e=Date.now(),t=e-n.length*24*60*60*1e3,r={...K,domain:()=>[new Date(t),new Date(e)],range:()=>[0,H],invert:n=>new Date(t+n/H*(e-t)),copy:()=>r};return r},[K,H,n.length]);(0,$.useEffect)(()=>{if(L(e=>e+1),F(!1),O===`loading`)return;let e=n.length>1?o*.4:0,t=setTimeout(()=>{F(!0)},o+e);return()=>clearTimeout(t)},[o,l,O]),(0,$.useEffect)(()=>{D?.(P?`ready`:`revealing`)},[P,D]);let de=(0,$.useCallback)(e=>{let t=Ge(e);if(!t)return;let r=B?t.y-i.top:t.x-i.left,a=Math.floor(r/se),o=Math.max(0,Math.min(n.length-1,a)),s=n[o];if(!s)return;let c={},l={},u=K(W(s))??0;if(B){let e=V.length,{barWidth:t,gap:n}=lt(ne,e,4);if(x){let e=0;for(let t of V){let n=s[t.dataKey];if(typeof n==`number`){e+=n;let r=ie[g(t.yAxisId)]??J;l[t.dataKey]=r(e)??0,c[t.dataKey]=u+ne/2}}}else V.forEach((e,r)=>{let i=s[e.dataKey];if(typeof i==`number`){let a=ie[g(e.yAxisId)]??J;l[e.dataKey]=a(i)??0,c[e.dataKey]=u+r*(t+n)+t/2}})}else if(x){let e=0;V.forEach((t,n)=>{let r=s[t.dataKey];if(typeof r!=`number`)return;e+=r;let i=(ie[g(t.yAxisId)]??ae)(e)??0,a=n===V.length-1;c[t.dataKey]=!a&&S>0&&r>=0?i+S:i})}else{let e=V.length,{barWidth:t,gap:n}=lt(ne,e,4);V.forEach((e,r)=>{let i=s[e.dataKey];if(typeof i==`number`){let a=ie[g(e.yAxisId)]??ae,o=a(0)??U,s=a(i)??0,d=o-s;C&&!B&&i>0?c[e.dataKey]=At({baselineY:o,barLengthPx:d,squareSize:t,gap:C.squareGap,fit:C.fit}):c[e.dataKey]=s,l[e.dataKey]=u+r*(t+n)+t/2}})}let d;d=B?Math.max(...Object.values(l),0):u+ne/2,j({point:s,index:o,x:d,yPositions:c,xPositions:Object.keys(l).length>0?l:void 0})},[K,J,n,V,i.left,i.top,W,se,ne,B,x,S,j,ie,ae,C,U]),Y=(0,$.useCallback)(()=>{M()},[M]),X=P,fe=[],pe=[],Se=[],Ce=[],we=[];ve(w,e=>{let t=ge(e);Ct(e)?fe.push(e):St(e)?Ce.push(e):he(t)?we.push(t):_e(t)?pe.push(be(e.type)?t:e):ye(t)?Se.push(t):Ce.push(e)});let Te=(0,$.useMemo)(()=>wt(w),[w]),Ee={...me,chartPhase:ue(O),chartStatus:O,data:n,renderData:n,xScale:le,yScale:B?J:ae,yScales:ie,width:e,height:t,innerWidth:H,innerHeight:U,margin:i,density:a,columnWidth:se,tooltipData:k,setTooltipData:A,containerRef:E,lines:V,referenceAreas:Te,isLoaded:P,animationDuration:o,animationEasing:s,enterTransition:c,revealEpoch:I,xAccessor:G,dateLabels:ce,xScaleType:`time`,barScale:K,bandWidth:ne,hoveredBarIndex:z,barXAccessor:W,orientation:v,stacked:x,stackOffsets:oe,stackGap:S,squareSnap:C};return/* @__PURE__ */ (0,Q.jsx)(T,{value:Ee,children:/* @__PURE__ */ (0,Q.jsxs)(`svg`,{"aria-hidden":`true`,className:`overflow-visible`,height:t,width:e,children:[fe.length>0&&/* @__PURE__ */ (0,Q.jsx)(`defs`,{children:fe}),/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:`transparent`,height:t,width:e,x:0,y:0}),/* @__PURE__ */ (0,Q.jsxs)(`g`,{onMouseLeave:X?Y:void 0,onMouseMove:X?de:void 0,style:{cursor:X?`crosshair`:`default`},transform:`translate(${i.left},${i.top})`,children:[/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:`transparent`,height:U,width:H,x:0,y:0}),xe(pe),xe(Se),O===`loading`?/* @__PURE__ */ (0,Q.jsx)(N,{barCount:n.length||12,barFraction:y===`match`&&B&&d!=null&&n.length>0?Math.min(.9,d/(U/n.length)):void 0,innerHeight:U,innerWidth:H,orientation:y===`match`&&B?`horizontal`:`vertical`}):xe(Ce),xe(we)]})]})})});function Pt(e){let t=(0,Z.c)(33),{data:n,xDataKey:r,density:a,margin:o,animationDuration:c,animationEasing:l,enterTransition:u,revealSignature:d,aspectRatio:f,height:p,className:m,barGap:h,barWidth:g,barAlign:_,orientation:v,loadingSkeletonOrientation:y,maxValue:b,stacked:x,stackGap:S,squareSnap:C,children:w,onPhaseChange:T,status:E}=e,D=r===void 0?`name`:r,O=a===void 0?ce:a,k=c===void 0?1100:c,A=l===void 0?s:l,j=f===void 0?`2 / 1`:f,M=m===void 0?``:m,N=h===void 0?.2:h,P=_===void 0?`start`:_,F=v===void 0?`vertical`:v,I=y===void 0?`vertical`:y,L=x!==void 0&&x,R=S===void 0?0:S,z=E===void 0?`ready`:E,B=(0,$.useRef)(null),V;t[0]!==O||t[1]!==o?(V=ae(O,o),t[0]=O,t[1]=o,t[2]=V):V=t[2];let H=V,U;t[3]===M?U=t[4]:(U=i(`relative w-full overflow-visible`,M),t[3]=M,t[4]=U);let W;t[5]!==j||t[6]!==p?(W=p===void 0?{aspectRatio:j}:{height:p},t[5]=j,t[6]=p,t[7]=W):W=t[7];let G;t[8]!==k||t[9]!==A||t[10]!==P||t[11]!==N||t[12]!==g||t[13]!==w||t[14]!==n||t[15]!==O||t[16]!==u||t[17]!==I||t[18]!==H||t[19]!==b||t[20]!==T||t[21]!==F||t[22]!==d||t[23]!==C||t[24]!==R||t[25]!==L||t[26]!==z||t[27]!==D?(G=/* @__PURE__ */ (0,Q.jsx)(Tt,{debounceTime:10,children:e=>{let{width:t,height:r}=e;return/* @__PURE__ */ (0,Q.jsx)(Mt,{animationDuration:k,animationEasing:A,barGap:N,barAlign:P,barWidthProp:g,containerRef:B,data:n,enterTransition:u,height:r,density:O,margin:H,maxValue:b,onPhaseChange:T,loadingSkeletonOrientation:I,orientation:F,revealSignature:d,squareSnap:C,stacked:L,stackGap:R,status:z,width:t,xDataKey:D,children:w})}}),t[8]=k,t[9]=A,t[10]=P,t[11]=N,t[12]=g,t[13]=w,t[14]=n,t[15]=O,t[16]=u,t[17]=I,t[18]=H,t[19]=b,t[20]=T,t[21]=F,t[22]=d,t[23]=C,t[24]=R,t[25]=L,t[26]=z,t[27]=D,t[28]=G):G=t[28];let ee;return t[29]!==U||t[30]!==W||t[31]!==G?(ee=/* @__PURE__ */ (0,Q.jsx)(`div`,{className:U,ref:B,style:W,children:G}),t[29]=U,t[30]=W,t[31]=G,t[32]=ee):ee=t[32],ee}const Ft=[];function It(e){let t=(0,Z.c)(4),{margin:n,aspectRatio:r,className:i}=e,a=r===void 0?`2 / 1`:r,o=i===void 0?``:i,s;return t[0]!==a||t[1]!==o||t[2]!==n?(s=/* @__PURE__ */ (0,Q.jsx)(Pt,{aspectRatio:a,className:o,data:Ft,margin:n,status:`loading`}),t[0]=a,t[1]=o,t[2]=n,t[3]=s):s=t[3],s}function Lt(e){let t=(0,Z.c)(32),{value:n,label:r,stroke:i,strokeDasharray:a,strokeWidth:o,qaTestId:s}=e,c=i===void 0?`var(--color-depth-black-100)`:i,l=a===void 0?`4 4`:a,u=o===void 0?1.5:o,d=s===void 0?`bar-reference-line`:s,{yScale:f,innerHeight:p,innerWidth:m,orientation:h,barScale:g,data:_,barXAccessor:v}=b(),y,x;if(t[0]!==n||t[1]!==f?(y=f(n),x=y==null||!Number.isFinite(y),t[0]=n,t[1]=f,t[2]=y,t[3]=x):(y=t[2],x=t[3]),x)return null;let S=h===`horizontal`,C=_[0],w,T;if(t[4]!==g||t[5]!==v||t[6]!==_||t[7]!==C){let e=_.at(-1),n=C&&v?v(C):void 0,r=e&&v?v(e):void 0;w=n!=null&&g?g(n)??0:0,T=r!=null&&g?g(r)??w:w,t[4]=g,t[5]=v,t[6]=_,t[7]=C,t[8]=w,t[9]=T}else w=t[8],T=t[9];let E=T,D;t[10]!==g||t[11]!==p||t[12]!==m||t[13]!==S?(D=g?.bandwidth()??(S?p:m),t[10]=g,t[11]=p,t[12]=m,t[13]=S,t[14]=D):D=t[14];let O=D,k=Math.min(w,E),A=Math.max(w,E)+O,j=S?y:0,M=S?y:m,N=S?k:y,P=S?A:y,F=r?r.length*7+12:0,I=S?y-F/2:m/2-F/2,L=S?-28:y-12,R;t[15]!==c||t[16]!==l||t[17]!==u||t[18]!==j||t[19]!==M||t[20]!==N||t[21]!==P?(R=/* @__PURE__ */ (0,Q.jsx)(`line`,{stroke:c,strokeDasharray:l,strokeLinecap:`square`,strokeWidth:u,x1:j,x2:M,y1:N,y2:P}),t[15]=c,t[16]=l,t[17]=u,t[18]=j,t[19]=M,t[20]=N,t[21]=P,t[22]=R):R=t[22];let z;t[23]!==r||t[24]!==F||t[25]!==I||t[26]!==L?(z=r?/* @__PURE__ */ (0,Q.jsxs)(`g`,{transform:`translate(${I}, ${L})`,children:[/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:`var(--color-neutral-lighter)`,height:24,rx:8,ry:8,width:F}),/* @__PURE__ */ (0,Q.jsx)(`text`,{className:`pui-text-mono-small`,dominantBaseline:`central`,fill:`var(--color-neutral-base)`,textAnchor:`middle`,x:F/2,y:12,children:r})]}):null,t[23]=r,t[24]=F,t[25]=I,t[26]=L,t[27]=z):z=t[27];let B;return t[28]!==d||t[29]!==R||t[30]!==z?(B=/* @__PURE__ */ (0,Q.jsxs)(`g`,{pointerEvents:`none`,"qa-test-id":d,children:[R,z]}),t[28]=d,t[29]=R,t[30]=z,t[31]=B):B=t[31],B}Lt.displayName=`BarReferenceLine`;function Rt(e,t){let n=Math.max(0,e-t);return Math.min(t*.22,Math.max(0,n-1),7)}function zt(e,t,n){let r=Math.min(1,Math.max(0,e))*Math.min(n,Math.max(0,t));return{depth:r,perspectiveRise:r*.45}}function Bt(e,t,n,r,i,a,o){let s=r/2;if(s<=0)return 0;let c=Rt(e.step?.()??t,t),l=(e(n(i))??0)+t/2;return zt(Math.min(1,Math.abs((l-s)/s)),Math.abs(o-a),c).perspectiveRise}function Vt(e){let t=(0,Z.c)(41),{x:n,y:r,width:i,height:o,fill:s,rx:c,ry:l,index:u,isFaded:d,animationType:f,growFromY:p,fadedOpacity:m,staggerDelay:h,enterTransition:g,revealEpoch:_,isHorizontal:v}=e,y=u*h,b;t[0]!==g||t[1]!==y?(b=Et(g,y),t[0]=g,t[1]=y,t[2]=b):b=t[2];let x=b;if(f===`fade`){let e=d?m:1,f;t[3]===e?f=t[4]:(f={opacity:e,filter:`blur(0px)`},t[3]=e,t[4]=f);let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p={opacity:0,filter:`blur(2px)`},t[5]=p):p=t[5];let h=`fade-${u}-${_}`,g;return t[6]!==x||t[7]!==s||t[8]!==o||t[9]!==c||t[10]!==l||t[11]!==f||t[12]!==h||t[13]!==i||t[14]!==n||t[15]!==r?(g=/* @__PURE__ */ (0,Q.jsx)(a.rect,{animate:f,fill:s,height:o,initial:p,rx:c,ry:l,transition:x,width:i,x:n,y:r},h),t[6]=x,t[7]=s,t[8]=o,t[9]=c,t[10]=l,t[11]=f,t[12]=h,t[13]=i,t[14]=n,t[15]=r,t[16]=g):g=t[16],g}let S;t[17]!==p||t[18]!==o||t[19]!==v||t[20]!==i||t[21]!==n||t[22]!==r?(S=v?{width:0,height:o,x:n,y:r}:{width:i,height:0,x:n,y:p},t[17]=p,t[18]=o,t[19]=v,t[20]=i,t[21]=n,t[22]=r,t[23]=S):S=t[23];let C=S,w;t[24]!==o||t[25]!==i||t[26]!==n||t[27]!==r?(w={width:i,height:o,x:n,y:r},t[24]=o,t[25]=i,t[26]=n,t[27]=r,t[28]=w):w=t[28];let T=w,E=d?m:1,D;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(D={transition:`opacity 0.15s ease-in-out`},t[29]=D):D=t[29];let O=`grow-${u}-${_}`,k;t[30]!==x||t[31]!==s||t[32]!==C||t[33]!==c||t[34]!==l||t[35]!==O||t[36]!==T?(k=/* @__PURE__ */ (0,Q.jsx)(a.rect,{animate:T,fill:s,initial:C,rx:c,ry:l,transition:x},O),t[30]=x,t[31]=s,t[32]=C,t[33]=c,t[34]=l,t[35]=O,t[36]=T,t[37]=k):k=t[37];let A;return t[38]!==E||t[39]!==k?(A=/* @__PURE__ */ (0,Q.jsx)(`g`,{opacity:E,style:D,children:k}),t[38]=E,t[39]=k,t[40]=A):A=t[40],A}function Ht(e,t){if(!t)return;let n=e[t];return typeof n==`number`?n:void 0}const Ut=(0,$.memo)(function(e){let t=(0,Z.c)(92),{dataKey:n,baseDataKey:r,yAxisId:i,fill:a,lineCap:o,animate:s,animationType:c,fadedOpacity:l,staggerDelay:u,stackGap:d,groupGap:f,perspective:p,minBarHeight:m,showValueLabels:h,valueLabelFormatter:g,valueLabelFill:_,valueLabelGap:v,valueLabelClassName:y,valueLabelPlacement:S,deferValueLabels:C,barScale:T,bandWidth:E,barXAccessor:D}=e,O=a===void 0?x.linePrimary:a,k=o===void 0?`round`:o,A=s===void 0||s,j=c===void 0?`grow`:c,M=l===void 0?.3:l,N=f===void 0?4:f,P=p!==void 0&&p,F=m===void 0?0:m,I=h!==void 0&&h,L=_===void 0?x.label:_,R=v===void 0?8:v,z=S===void 0?`auto`:S,B=C!==void 0&&C,{data:V,yScale:H,innerHeight:U,innerWidth:W,isLoaded:G,hoveredBarIndex:ee,lines:K,orientation:ne,stacked:q,stackOffsets:J,stackGap:re,animationDuration:ie,enterTransition:ae,revealEpoch:oe}=b(),se=re===void 0?0:re,ce=oe===void 0?0:oe,le=(ie||1100)*.4,ue=u??(V.length>1?le/1e3/V.length:0),de=(0,$.useId)(),Y=ne===`horizontal`,X=d??se,{hoveredIndex:fe}=te(),pe;if(t[0]!==n||t[1]!==K){let e;t[3]===n?e=t[4]:(e=e=>e.dataKey===n,t[3]=n,t[4]=e),pe=K.findIndex(e),t[0]=n,t[1]=K,t[2]=pe}else pe=t[2];let me=Math.max(0,pe),he=K[me],ge=w(i??he?.yAxisId),_e=fe!==null&&fe!==me,ve=K.length,ye=me===ve-1,be;bb0:{if(!E||ve===0){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e={barWidth:0,gap:0},t[5]=e):e=t[5],be=e;break bb0}if(q){let e;t[6]===E?e=t[7]:(e={barWidth:E,gap:0},t[6]=E,t[7]=e),be=e;break bb0}let e;t[8]!==E||t[9]!==N||t[10]!==ve?(e=lt(E,ve,N),t[8]=E,t[9]=N,t[10]=ve,t[11]=e):e=t[11],be=e}let{barWidth:xe,gap:Se}=be,Ce;bb1:{if(P){Ce=0;break bb1}if(typeof k==`number`){Ce=k;break bb1}if(k===`round`&&xe){Ce=Math.min(xe/2,8);break bb1}Ce=0}let we=Ce,Te=`bar-series-${de}`,Ee;if(t[12]!==A||t[13]!==j||t[14]!==E||t[15]!==T||t[16]!==xe||t[17]!==D||t[18]!==r||t[19]!==ue||t[20]!==H||t[21]!==we||t[22]!==V||t[23]!==n||t[24]!==B||t[25]!==Se||t[26]!==ae||t[27]!==M||t[28]!==O||t[29]!==ee||t[30]!==U||t[31]!==W||t[32]!==Y||t[33]!==ye||t[34]!==_e||t[35]!==G||t[36]!==F||t[37]!==P||t[38]!==ce||t[39]!==me||t[40]!==I||t[41]!==X||t[42]!==J||t[43]!==q||t[44]!==y||t[45]!==L||t[46]!==g||t[47]!==R||t[48]!==z||t[49]!==ge){let e;t[51]!==A||t[52]!==j||t[53]!==E||t[54]!==T||t[55]!==xe||t[56]!==D||t[57]!==r||t[58]!==ue||t[59]!==H||t[60]!==we||t[61]!==n||t[62]!==B||t[63]!==Se||t[64]!==ae||t[65]!==M||t[66]!==O||t[67]!==ee||t[68]!==U||t[69]!==W||t[70]!==Y||t[71]!==ye||t[72]!==_e||t[73]!==G||t[74]!==F||t[75]!==P||t[76]!==ce||t[77]!==me||t[78]!==I||t[79]!==X||t[80]!==J||t[81]!==q||t[82]!==y||t[83]!==L||t[84]!==g||t[85]!==R||t[86]!==z||t[87]!==ge?(e=(e,t)=>{let i=e[n];if(typeof i!=`number`)return null;let a=D(e),o=T(a)??0,s,c,l,u,d=Y?H:ge,f=Ht(e,r)??0,p=r!==void 0;if(Y){if(l=xe,q&&J){let e=J.get(t)?.get(n)??0,r=d(e)??0,a=d(e+i)??r;s=Math.min(r,a),u=Math.abs(a-r),!ye&&X>0&&(u=Math.max(0,u-X))}else{let e=d(f)??0,t=d(i)??e;s=Math.min(e,t),u=Math.abs(t-e)}c=q?o:o+me*(xe+Se)}else{let r=d(f)??U,a=d(i)??r;if(u=xe,q&&J){let e=J.get(t)?.get(n)??0,r=d(e)??U,a=d(e+i)??r;c=Math.min(r,a),l=Math.abs(a-r),!ye&&X>0&&(l=Math.max(0,l-X),a<r&&(c+=X))}else c=Math.min(r,a),l=Math.abs(a-r);s=q?o:o+me*(xe+Se);let m=!1;if(!q&&!p&&F>0&&i>=0&&l<F){let e=d(0)??U;l=F,c=e-F,m=!0}if(P&&i>0&&!m&&(!q||ye)){let t=d(0)??U,n=Bt(T,E,D,W,e,c,t),r=Math.min(n,Math.max(0,l-1));c+=r,l-=r}}let m=ee!==null&&ee!==t||_e,h=`bar-${n}-${a}`,_=!q||X>0||ye,v=_?we:0,b=_?we:0,x=typeof O==`function`?O(e,t):O,S=A&&!G?/* @__PURE__ */ (0,Q.jsx)(Vt,{animationType:j,enterTransition:ae,fadedOpacity:M,fill:x,growFromY:Y?c:ge(f)??U,height:l,index:t,isFaded:m,isHorizontal:Y,revealEpoch:ce,rx:v,ry:b,staggerDelay:ue,width:u,x:s,y:c}):/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:x,height:l,opacity:m?M:1,rx:v,ry:b,style:{cursor:`default`,transition:`opacity 0.15s ease-in-out`},width:u,x:s,y:c});if(!I)return/* @__PURE__ */ (0,Q.jsx)($.Fragment,{children:S},h);let C=g?g(i,e,t):String(i),w=typeof L==`function`?L(e,t):L,k=Y?s+u+R:s+u/2,N=!Y&&z===`auto`&&i<0&&!p,V=Y?c+l/2:N?c+l+R:c-R;return/* @__PURE__ */ (0,Q.jsxs)($.Fragment,{children:[S,/* @__PURE__ */ (0,Q.jsx)(`text`,{className:y,dominantBaseline:Y?`central`:N?`hanging`:`auto`,fill:w,opacity:B?void 0:m?M:1,style:B?{opacity:G?m?M:1:0,transition:`opacity 280ms ease`}:void 0,textAnchor:Y?`start`:`middle`,x:k,y:V,children:C})]},h)},t[51]=A,t[52]=j,t[53]=E,t[54]=T,t[55]=xe,t[56]=D,t[57]=r,t[58]=ue,t[59]=H,t[60]=we,t[61]=n,t[62]=B,t[63]=Se,t[64]=ae,t[65]=M,t[66]=O,t[67]=ee,t[68]=U,t[69]=W,t[70]=Y,t[71]=ye,t[72]=_e,t[73]=G,t[74]=F,t[75]=P,t[76]=ce,t[77]=me,t[78]=I,t[79]=X,t[80]=J,t[81]=q,t[82]=y,t[83]=L,t[84]=g,t[85]=R,t[86]=z,t[87]=ge,t[88]=e):e=t[88],Ee=V.map(e),t[12]=A,t[13]=j,t[14]=E,t[15]=T,t[16]=xe,t[17]=D,t[18]=r,t[19]=ue,t[20]=H,t[21]=we,t[22]=V,t[23]=n,t[24]=B,t[25]=Se,t[26]=ae,t[27]=M,t[28]=O,t[29]=ee,t[30]=U,t[31]=W,t[32]=Y,t[33]=ye,t[34]=_e,t[35]=G,t[36]=F,t[37]=P,t[38]=ce,t[39]=me,t[40]=I,t[41]=X,t[42]=J,t[43]=q,t[44]=y,t[45]=L,t[46]=g,t[47]=R,t[48]=z,t[49]=ge,t[50]=Ee}else Ee=t[50];let De;return t[89]!==Te||t[90]!==Ee?(De=/* @__PURE__ */ (0,Q.jsx)(`g`,{className:Te,children:Ee}),t[89]=Te,t[90]=Ee,t[91]=De):De=t[91],De});function Wt(e){let t=(0,Z.c)(5),{barScale:n,bandWidth:r,barXAccessor:i}=S();if(!(n&&r&&i))return console.warn(`Bar component must be used within a BarChart`),null;let a;return t[0]!==r||t[1]!==n||t[2]!==i||t[3]!==e?(a=/* @__PURE__ */ (0,Q.jsx)(Ut,{...e,bandWidth:r,barScale:n,barXAccessor:i}),t[0]=r,t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}Wt.displayName=`Bar`;function Gt(e){return e.startsWith(`url(`)}function Kt(e,t,n){return n<=1?0:(e?.type===`tween`&&typeof e.duration==`number`?e.duration*1e3:t)*.4/1e3/(n-1)}function qt(e,t,n,r,i){let a=Kt(e,t,i),o=Et(e,n*r);if(i<=1||o.type!==`tween`)return o;let s=typeof o.duration==`number`?o.duration:t/1e3;return{...o,duration:s+a*(i-1)}}function Jt(e){let t=(0,Z.c)(39),{x:n,baselineY:r,barLengthPx:i,squareSize:o,squareGap:s,squareRadius:c,squareFit:l,fill:u,useGradient:d,gradientStops:f,patternPreset:p,index:m,isFaded:h,fadedOpacity:g,animate:_,staggerDelay:v,animationDuration:y,enterTransition:b,revealEpoch:x}=e,S,C;if(t[0]!==_||t[1]!==y||t[2]!==i||t[3]!==r||t[4]!==b||t[5]!==g||t[6]!==u||t[7]!==f||t[8]!==m||t[9]!==h||t[10]!==p||t[11]!==x||t[12]!==l||t[13]!==s||t[14]!==c||t[15]!==o||t[16]!==v||t[17]!==d||t[18]!==n){let e=kt({barLengthPx:i,squareSize:o,gap:s,fit:l}),w=o*c,T=r-e.columnHeight,E=`bar-squares-gradient-${m}-${x}`,D;t[21]===u?D=t[22]:(D=Gt(u),t[21]=u,t[22]=D);let O=D,k=`bar-squares-pattern-${m}-${x}`,A;bb0:{if(d){if(O&&p&&p!==`none`){A=`url(#${k})`;break bb0}A=`url(#${E})`;break bb0}A=u}let j=A,M=Kt(b,y,e.count),N=h?g:1,P;t[23]!==E||t[24]!==O||t[25]!==k||t[26]!==p||t[27]!==d?(P=d&&O&&p&&p!==`none`?Ze(p,k,{color:`url(#${E})`}):null,t[23]=E,t[24]=O,t[25]=k,t[26]=p,t[27]=d,t[28]=P):P=t[28];let F=P,I;t[29]!==r||t[30]!==T||t[31]!==E||t[32]!==F||t[33]!==f||t[34]!==d?(I=d?/* @__PURE__ */ (0,Q.jsxs)(`defs`,{children:[/* @__PURE__ */ (0,Q.jsx)(`linearGradient`,{gradientUnits:`userSpaceOnUse`,id:E,x1:0,x2:0,y1:r,y2:T,children:f.map(Yt)}),F]}):null,t[29]=r,t[30]=T,t[31]=E,t[32]=F,t[33]=f,t[34]=d,t[35]=I):I=t[35],S=I,C=e.positions.map((e,t)=>{let r=T+e,i=r+o,s=`sq-${m}-${t}-${x}`;return _?/* @__PURE__ */ (0,Q.jsx)(a.rect,{animate:{attrY:r,height:o,opacity:N},fill:j,height:o,initial:{attrY:i,height:0,opacity:1},rx:w,ry:w,transition:{...Et(b,m*v+t*M),opacity:{duration:.15}},width:o,x:n},s):/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:j,height:o,opacity:N,rx:w,ry:w,width:o,x:n,y:r},s)}),t[0]=_,t[1]=y,t[2]=i,t[3]=r,t[4]=b,t[5]=g,t[6]=u,t[7]=f,t[8]=m,t[9]=h,t[10]=p,t[11]=x,t[12]=l,t[13]=s,t[14]=c,t[15]=o,t[16]=v,t[17]=d,t[18]=n,t[19]=S,t[20]=C}else S=t[19],C=t[20];let w=C,T;return t[36]!==S||t[37]!==w?(T=/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[S,w]}),t[36]=S,t[37]=w,t[38]=T):T=t[38],T}function Yt(e){return/* @__PURE__ */ (0,Q.jsx)(`stop`,{offset:`${e.offset}%`,stopColor:e.color},`${e.offset}-${e.color}`)}const Xt=(0,$.memo)(function(e){let t=(0,Z.c)(69),{dataKey:n,yAxisId:r,fill:i,squareGap:a,squareRadius:o,squareFit:s,useGradient:c,gradientStops:l,patternPreset:u,animate:d,fadedOpacity:f,staggerDelay:p,groupGap:m,barScale:h,bandWidth:g,barXAccessor:_}=e,v=i===void 0?x.linePrimary:i,y=a===void 0?3:a,S=o===void 0?.25:o,C=s!==void 0&&s,T=c!==void 0&&c,E;t[0]===l?E=t[1]:(E=l===void 0?[]:l,t[0]=l,t[1]=E);let D=E,O=d===void 0||d,k=f===void 0?.3:f,A=m===void 0?4:m,{data:j,innerHeight:M,hoveredBarIndex:N,lines:P,orientation:F,stacked:I,animationDuration:L,enterTransition:R,revealEpoch:z}=b(),B=z===void 0?0:z,{hoveredIndex:V}=te(),H=(0,$.useId)(),U=F===`horizontal`||I,W;if(t[2]!==n||t[3]!==P){let e;t[5]===n?e=t[6]:(e=e=>e.dataKey===n,t[5]=n,t[6]=e),W=P.findIndex(e),t[2]=n,t[3]=P,t[4]=W}else W=t[4];let G=Math.max(0,W),ee=P[G],K=w(r??ee?.yAxisId),ne=V!==null&&V!==G,q=P.length,J;t[7]!==g||t[8]!==A||t[9]!==q?(J=lt(g,q,A),t[7]=g,t[8]=A,t[9]=q,t[10]=J):J=t[10];let{barWidth:re,gap:ie}=J,ae=(L||1100)*.4,oe=p??(j.length>1?ae/1e3/j.length:0),se;t[11]!==M||t[12]!==K?(se=K(0)??M,t[11]=M,t[12]=K,t[13]=se):se=t[13];let ce=se,le;t[14]!==v||t[15]!==D?(le=D.length>=2?D:[{offset:0,color:v},{offset:100,color:v}],t[14]=v,t[15]=D,t[16]=le):le=t[16];let ue=le;if(U)return null;let de=`bar-squares-${H}`,Y;if(t[17]!==O||t[18]!==L||t[19]!==h||t[20]!==_||t[21]!==ce||t[22]!==oe||t[23]!==j||t[24]!==n||t[25]!==ie||t[26]!==R||t[27]!==k||t[28]!==v||t[29]!==N||t[30]!==ne||t[31]!==u||t[32]!==B||t[33]!==G||t[34]!==C||t[35]!==y||t[36]!==S||t[37]!==re||t[38]!==ue||t[39]!==T||t[40]!==K){let e;t[42]!==O||t[43]!==L||t[44]!==h||t[45]!==_||t[46]!==ce||t[47]!==oe||t[48]!==n||t[49]!==ie||t[50]!==R||t[51]!==k||t[52]!==v||t[53]!==N||t[54]!==ne||t[55]!==u||t[56]!==B||t[57]!==G||t[58]!==C||t[59]!==y||t[60]!==S||t[61]!==re||t[62]!==ue||t[63]!==T||t[64]!==K?(e=(e,t)=>{let r=e[n];if(typeof r!=`number`||r<=0)return null;let i=_(e),a=(h(i)??0)+G*(re+ie),o=K(r)??0,s=ce-o;return/* @__PURE__ */ (0,Q.jsx)(Jt,{animate:O,animationDuration:L||1100,barLengthPx:s,baselineY:ce,enterTransition:R,fadedOpacity:k,fill:v,gradientStops:ue,index:t,isFaded:N!==null&&N!==t||ne,patternPreset:u,revealEpoch:B,squareFit:C,squareGap:y,squareRadius:S,squareSize:re,staggerDelay:oe,useGradient:T,x:a},`bar-squares-${n}-${i}`)},t[42]=O,t[43]=L,t[44]=h,t[45]=_,t[46]=ce,t[47]=oe,t[48]=n,t[49]=ie,t[50]=R,t[51]=k,t[52]=v,t[53]=N,t[54]=ne,t[55]=u,t[56]=B,t[57]=G,t[58]=C,t[59]=y,t[60]=S,t[61]=re,t[62]=ue,t[63]=T,t[64]=K,t[65]=e):e=t[65],Y=j.map(e),t[17]=O,t[18]=L,t[19]=h,t[20]=_,t[21]=ce,t[22]=oe,t[23]=j,t[24]=n,t[25]=ie,t[26]=R,t[27]=k,t[28]=v,t[29]=N,t[30]=ne,t[31]=u,t[32]=B,t[33]=G,t[34]=C,t[35]=y,t[36]=S,t[37]=re,t[38]=ue,t[39]=T,t[40]=K,t[41]=Y}else Y=t[41];let X;return t[66]!==de||t[67]!==Y?(X=/* @__PURE__ */ (0,Q.jsx)(`g`,{className:de,children:Y}),t[66]=de,t[67]=Y,t[68]=X):X=t[68],X});function Zt(e){let t=(0,Z.c)(5),{barScale:n,bandWidth:r,barXAccessor:i}=S();if(!(n&&r&&i))return console.warn(`BarSquares must be used within a BarChart`),null;let a;return t[0]!==r||t[1]!==n||t[2]!==i||t[3]!==e?(a=/* @__PURE__ */ (0,Q.jsx)(Xt,{...e,bandWidth:r,barScale:n,barXAccessor:i}),t[0]=r,t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}Zt.displayName=`BarSquares`;const Qt=(0,$.memo)(function(e){let t=(0,Z.c)(37),{fill:n,opacity:r,squareGap:i,squareRadius:a,squareFit:o,groupGap:s,staggerDelay:c,barScale:l,bandWidth:u,barXAccessor:d}=e,f=n===void 0?x.grid:n,p=r===void 0?.3:r,m=i===void 0?3:i,h=a===void 0?.25:a,g=o!==void 0&&o,_=s===void 0?4:s,{data:v,lines:y,orientation:S,stacked:C,hoveredBarIndex:w,animationDuration:T,enterTransition:E,revealEpoch:D}=b(),O=D===void 0?0:D,k=(0,$.useId)(),A=S===`horizontal`||C,j=y.length,M;t[0]!==u||t[1]!==_||t[2]!==j?(M=lt(u,j,_),t[0]=u,t[1]=_,t[2]=j,t[3]=M):M=t[3];let{barWidth:N,gap:P}=M,F=(T||1100)*.4,I=c??(v.length>1?F/1e3/v.length:0);if(A)return null;let L=N*h,R=w===null?p:0,z=`bar-column-track-${k}`,B;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(B={transition:`opacity 0.15s ease-in-out`},t[4]=B):B=t[4];let V;if(t[5]!==l||t[6]!==d||t[7]!==I||t[8]!==v||t[9]!==P||t[10]!==R||t[11]!==E||t[12]!==f||t[13]!==y||t[14]!==O||t[15]!==L||t[16]!==g||t[17]!==m||t[18]!==N){let e;t[20]!==l||t[21]!==d||t[22]!==I||t[23]!==P||t[24]!==R||t[25]!==E||t[26]!==f||t[27]!==y||t[28]!==O||t[29]!==L||t[30]!==g||t[31]!==m||t[32]!==N?(e=(e,t)=>{let n=d(e),r=l(n)??0;return y.map((n,i)=>/* @__PURE__ */ (0,Q.jsx)($t,{animate:!0,bandPos:r,d:e,dataKey:n.dataKey,effectiveGroupGap:P,effectiveOpacity:R,enterTransition:E,fill:f,index:t,revealEpoch:O,rx:L,seriesIndex:i,squareFit:g,squareGap:m,squareSize:N,staggerDelay:I,yAxisId:n.yAxisId},`track-${t}-${n.dataKey}`))},t[20]=l,t[21]=d,t[22]=I,t[23]=P,t[24]=R,t[25]=E,t[26]=f,t[27]=y,t[28]=O,t[29]=L,t[30]=g,t[31]=m,t[32]=N,t[33]=e):e=t[33],V=v.map(e),t[5]=l,t[6]=d,t[7]=I,t[8]=v,t[9]=P,t[10]=R,t[11]=E,t[12]=f,t[13]=y,t[14]=O,t[15]=L,t[16]=g,t[17]=m,t[18]=N,t[19]=V}else V=t[19];let H;return t[34]!==V||t[35]!==z?(H=/* @__PURE__ */ (0,Q.jsx)(`g`,{className:z,style:B,children:V}),t[34]=V,t[35]=z,t[36]=H):H=t[36],H});function $t(e){let t=(0,Z.c)(45),{d:n,dataKey:r,yAxisId:i,bandPos:o,seriesIndex:s,effectiveGroupGap:c,squareSize:l,squareGap:u,squareFit:d,fill:f,rx:p,effectiveOpacity:m,index:h,staggerDelay:g,animate:_,enterTransition:v,revealEpoch:y}=e,{innerHeight:x,animationDuration:S}=b(),C=w(i),T=n[r];if(typeof T!=`number`||T<=0)return null;let E;t[0]!==x||t[1]!==C?(E=C(0)??x,t[0]=x,t[1]=C,t[2]=E):E=t[2];let D=E,O;t[3]!==T||t[4]!==C?(O=C(T)??0,t[3]=T,t[4]=C,t[5]=O):O=t[5];let k=D-O,A,j,M,N;if(t[6]!==_||t[7]!==o||t[8]!==k||t[9]!==D||t[10]!==S||t[11]!==c||t[12]!==v||t[13]!==h||t[14]!==s||t[15]!==d||t[16]!==u||t[17]!==l||t[18]!==g){j=Symbol.for(`react.early_return_sentinel`);bb0:{let e=kt({barLengthPx:k,squareSize:l,gap:u,fit:d}),t=D-e.columnHeight;if(M=Math.max(0,t),M<=0&&!_){j=null;break bb0}N=o+s*(l+c),A=qt(v,S||1100,h,g,e.count)}t[6]=_,t[7]=o,t[8]=k,t[9]=D,t[10]=S,t[11]=c,t[12]=v,t[13]=h,t[14]=s,t[15]=d,t[16]=u,t[17]=l,t[18]=g,t[19]=A,t[20]=j,t[21]=M,t[22]=N}else A=t[19],j=t[20],M=t[21],N=t[22];if(j!==Symbol.for(`react.early_return_sentinel`))return j;let P=A,F=M>0?M:0;if(_){let e;t[23]===F?e=t[24]:(e={height:F,y:0},t[23]=F,t[24]=e);let n;t[25]===D?n=t[26]:(n={height:D,y:0},t[25]=D,t[26]=n);let r=`track-${h}-${s}-${y}`,i;return t[27]!==F||t[28]!==m||t[29]!==P||t[30]!==f||t[31]!==p||t[32]!==l||t[33]!==e||t[34]!==n||t[35]!==r||t[36]!==N?(i=/* @__PURE__ */ (0,Q.jsx)(a.rect,{animate:e,fill:f,height:F,initial:n,opacity:m,rx:p,ry:p,transition:P,width:l,x:N},r),t[27]=F,t[28]=m,t[29]=P,t[30]=f,t[31]=p,t[32]=l,t[33]=e,t[34]=n,t[35]=r,t[36]=N,t[37]=i):i=t[37],i}if(M<=0)return null;let I;return t[38]!==m||t[39]!==f||t[40]!==p||t[41]!==l||t[42]!==M||t[43]!==N?(I=/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:f,height:M,opacity:m,rx:p,ry:p,width:l,x:N,y:0}),t[38]=m,t[39]=f,t[40]=p,t[41]=l,t[42]=M,t[43]=N,t[44]=I):I=t[44],I}function en(e){let t=(0,Z.c)(5),{barScale:n,bandWidth:r,barXAccessor:i}=S();if(!(n&&r&&i))return console.warn(`BarColumnTrack must be used within a BarChart`),null;let a;return t[0]!==r||t[1]!==n||t[2]!==i||t[3]!==e?(a=/* @__PURE__ */ (0,Q.jsx)(Qt,{...e,bandWidth:r,barScale:n,barXAccessor:i}),t[0]=r,t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}en.displayName=`BarColumnTrack`;var tn=/* @__PURE__ */ e(o(),1);function nn(e){let t=(0,Z.c)(13),{label:n,x:r,crosshairX:o,isHovering:s,tickerHalfWidth:c}=e,l=c+20,u=1;if(s&&o!==null){let e=Math.abs(r-o);e<c?u=0:e<l&&(u=(e-c)/20)}let d;t[0]===r?d=t[1]:(d={left:r,bottom:12,width:0,display:`flex`,justifyContent:`center`},t[0]=r,t[1]=d);let f;t[2]===u?f=t[3]:(f={opacity:u},t[2]=u,t[3]=f);let p,m,h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=i(`pui-text-body-small-alt whitespace-nowrap text-chart-label`),m={opacity:1},h={duration:.4,ease:`easeInOut`},t[4]=p,t[5]=m,t[6]=h):(p=t[4],m=t[5],h=t[6]);let g;t[7]!==n||t[8]!==f?(g=/* @__PURE__ */ (0,Q.jsx)(a.span,{animate:f,className:p,initial:m,transition:h,children:n}),t[7]=n,t[8]=f,t[9]=g):g=t[9];let _;return t[10]!==d||t[11]!==g?(_=/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`absolute`,style:d,children:g}),t[10]=d,t[11]=g,t[12]=_):_=t[12],_}function rn(e){let{containerRef:t,barScale:n}=S(),[r,i]=(0,$.useState)(!1);(0,$.useEffect)(()=>{i(!0)},[]);let a=t.current;return!(r&&a)||!n?null:/* @__PURE__ */ (0,Q.jsx)(an,{...e,container:a})}const an=(0,$.memo)(function(e){let t=(0,Z.c)(30),{tickerHalfWidth:n,showAllLabels:r,maxLabels:i,container:a}=e,o=n===void 0?50:n,s=r!==void 0&&r,{margin:c,tooltipData:l,barScale:u,bandWidth:d,barXAccessor:f,data:p,innerWidth:m,density:h}=b(),g,_,v;if(t[0]!==d||t[1]!==u||t[2]!==f||t[3]!==p||t[4]!==h||t[5]!==m||t[6]!==c||t[7]!==i||t[8]!==s||t[9]!==o||t[10]!==l){let e=ie(h,`x`,i),n;bb0:{if(!(u&&d&&f)){n=[];break bb0}let r;t[14]!==d||t[15]!==u||t[16]!==f||t[17]!==c?(r=e=>{let t=f(e);return{label:t,x:(u(t)??0)+d/2+c.left}},t[14]=d,t[15]=u,t[16]=f,t[17]=c,t[18]=r):r=t[18];let i=p.map(r);if(s){n=i;break bb0}let a=qe(Je(i.map(on)));n=Ye({length:i.length,availablePx:m,requestedMax:e,resolveXPx:e=>{let t=i[e];return t?t.x-c.left:0},slotPx:a}).flatMap(e=>{let t=i[e];return t?[t]:[]})}let r=n,a=l!==null,y=l?l.x+c.left:null;v=tn.createPortal,g=`pointer-events-none absolute inset-0`;let b;t[19]!==y||t[20]!==a||t[21]!==o?(b=e=>/* @__PURE__ */ (0,Q.jsx)(nn,{crosshairX:y,isHovering:a,label:e.label,tickerHalfWidth:o,x:e.x},`${e.label}-${e.x}`),t[19]=y,t[20]=a,t[21]=o,t[22]=b):b=t[22],_=r.map(b),t[0]=d,t[1]=u,t[2]=f,t[3]=p,t[4]=h,t[5]=m,t[6]=c,t[7]=i,t[8]=s,t[9]=o,t[10]=l,t[11]=g,t[12]=_,t[13]=v}else g=t[11],_=t[12],v=t[13];let y;t[23]!==g||t[24]!==_?(y=/* @__PURE__ */ (0,Q.jsx)(`div`,{className:g,children:_}),t[23]=g,t[24]=_,t[25]=y):y=t[25];let x;return t[26]!==a||t[27]!==v||t[28]!==y?(x=v(y,a),t[26]=a,t[27]=v,t[28]=y,t[29]=x):x=t[29],x});rn.displayName=`BarXAxis`;function on(e){return e.label}function sn(e){let t=(0,Z.c)(29),{label:n,y:r,bandHeight:o,isHovered:s,maxWidth:c,gap:l,align:u,labelClassName:d}=e,f=u===`start`,p=f?`left-0 justify-start`:`right-0 justify-end`,m=!f&&l==null&&`pr-2`,h;t[0]!==p||t[1]!==m?(h=i(`absolute flex items-center`,p,m),t[0]=p,t[1]=m,t[2]=h):h=t[2];let g=f?c:void 0,_=f||l==null?void 0:l,v;t[3]!==o||t[4]!==g||t[5]!==_||t[6]!==r?(v={top:r,height:o,width:g,paddingRight:_},t[3]=o,t[4]=g,t[5]=_,t[6]=r,t[7]=v):v=t[7];let y;t[8]!==s||t[9]!==d?(y=d?{opacity:1}:{opacity:s?1:.7,color:s?`var(--chart-foreground)`:`var(--chart-label, var(--color-text-soft))`},t[8]=s,t[9]=d,t[10]=y):y=t[10];let b=d??`pui-text-body-small-alt`,x=f?`text-left`:`text-right`,S;t[11]!==b||t[12]!==x?(S=i(b,`truncate whitespace-nowrap`,x),t[11]=b,t[12]=x,t[13]=S):S=t[13];let C;t[14]===d?C=t[15]:(C=d?{opacity:1}:{opacity:.7,color:`var(--chart-label, var(--color-text-soft))`},t[14]=d,t[15]=C);let w;t[16]===c?w=t[17]:(w={maxWidth:c},t[16]=c,t[17]=w);let T;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(T={duration:.15},t[18]=T):T=t[18];let E;t[19]!==n||t[20]!==S||t[21]!==C||t[22]!==w||t[23]!==y?(E=/* @__PURE__ */ (0,Q.jsx)(a.span,{animate:y,className:S,initial:C,style:w,transition:T,children:n}),t[19]=n,t[20]=S,t[21]=C,t[22]=w,t[23]=y,t[24]=E):E=t[24];let D;return t[25]!==E||t[26]!==h||t[27]!==v?(D=/* @__PURE__ */ (0,Q.jsx)(`div`,{className:h,style:v,children:E}),t[25]=E,t[26]=h,t[27]=v,t[28]=D):D=t[28],D}function cn(e){let{containerRef:t,barScale:n}=S(),[r,i]=(0,$.useState)(!1);(0,$.useEffect)(()=>{i(!0)},[]);let a=t.current;return!(r&&a)||!n?null:/* @__PURE__ */ (0,Q.jsx)(ln,{...e,container:a})}const ln=(0,$.memo)(function(e){let t=(0,Z.c)(40),{showAllLabels:n,maxLabels:r,labelMaxWidth:i,labelGap:a,align:o,labelClassName:s,container:c}=e,l=i===void 0?70:i,u=o===void 0?`end`:o,{margin:d,barScale:f,bandWidth:p,barXAccessor:m,data:h,hoveredBarIndex:g,innerHeight:_,density:v}=b(),y,x,S,C;if(t[0]!==u||t[1]!==p||t[2]!==f||t[3]!==m||t[4]!==h||t[5]!==v||t[6]!==g||t[7]!==_||t[8]!==s||t[9]!==a||t[10]!==l||t[11]!==d.left||t[12]!==d.top||t[13]!==r||t[14]!==n){let e=ie(v,`y`,r),i=n??(v==null||v===`large`),o;bb0:{if(!(f&&p&&m)){o=[];break bb0}let n;t[19]!==p||t[20]!==f||t[21]!==m||t[22]!==d.top?(n=(e,t)=>{let n=m(e);return{label:n,y:(f(n)??0)+d.top,bandHeight:p,index:t}},t[19]=p,t[20]=f,t[21]=m,t[22]=d.top,t[23]=n):n=t[23];let r=h.map(n);if(i){o=r;break bb0}o=Ye({length:r.length,availablePx:_,requestedMax:e,resolveXPx:e=>{let t=r[e];return t?t.y-d.top:0},slotPx:20}).flatMap(e=>{let t=r[e];return t?[t]:[]})}let c=o;C=tn.createPortal,y=`pointer-events-none absolute top-0 bottom-0`,t[24]===d.left?x=t[25]:(x={left:0,width:d.left},t[24]=d.left,t[25]=x);let b;t[26]!==u||t[27]!==g||t[28]!==s||t[29]!==a||t[30]!==l?(b=e=>/* @__PURE__ */ (0,Q.jsx)(sn,{align:u,bandHeight:e.bandHeight,gap:a,isHovered:g===e.index,label:e.label,labelClassName:s,maxWidth:l,y:e.y},`${e.label}-${e.y}`),t[26]=u,t[27]=g,t[28]=s,t[29]=a,t[30]=l,t[31]=b):b=t[31],S=c.map(b),t[0]=u,t[1]=p,t[2]=f,t[3]=m,t[4]=h,t[5]=v,t[6]=g,t[7]=_,t[8]=s,t[9]=a,t[10]=l,t[11]=d.left,t[12]=d.top,t[13]=r,t[14]=n,t[15]=y,t[16]=x,t[17]=S,t[18]=C}else y=t[15],x=t[16],S=t[17],C=t[18];let w;t[32]!==y||t[33]!==x||t[34]!==S?(w=/* @__PURE__ */ (0,Q.jsx)(`div`,{className:y,style:x,children:S}),t[32]=y,t[33]=x,t[34]=S,t[35]=w):w=t[35];let T;return t[36]!==c||t[37]!==C||t[38]!==w?(T=C(w,c),t[36]=c,t[37]=C,t[38]=w,t[39]=T):T=t[39],T});cn.displayName=`BarYAxis`;export{ot as Background,Wt as Bar,Pt as BarChart,It as BarChartLoading,en as BarColumnTrack,N as BarLoadingSkeleton,Lt as BarReferenceLine,Zt as BarSquares,rn as BarXAxis,cn as BarYAxis,Se as CHART_CLIP_PASSTHROUGH,le as CHART_DENSITY,oe as CHART_DENSITY_IDS,ee as ChartConfigProvider,K as ChartLegendHoverProvider,X as ChartLoadingLabel,H as ChartMarkers,T as ChartProvider,z as ChartRevealClip,pt as ChartTooltip,l as DEFAULT_ANIMATION_DURATION_MS,s as DEFAULT_ANIMATION_EASING,W as DEFAULT_CHART_CONFIG,ce as DEFAULT_CHART_DENSITY,c as DEFAULT_CHART_ENTER_TRANSITION,me as DEFAULT_CHART_LIFECYCLE,Y as DEFAULT_CHART_STATUS,v as DEFAULT_Y_AXIS_ID,fe as DEFAULT_Y_DOMAIN_TWEEN_MS,st as DateTicker,p as Grid,M as LineLoadingSweep,P as MarkerGroup,L as MarkerTooltipContent,at as PATTERN_PRESET_IDS,I as PatternArea,nt as PatternCircles,it as PatternHexagons,Qe as PatternLines,et as PatternWaves,D as ProjectionLine,E as ProjectionLineEndMarker,mt as ReferenceArea,J as SeriesMarkers,q as SeriesPointMarker,pe as ShimmeringText,A as StaticChartPreviewProvider,bt as TooltipBox,xt as TooltipContent,ct as TooltipDot,dt as TooltipIndicator,Xe as XAxis,yt as YAxis,_t as Y_AXIS_DEFAULT_TICK_COUNT,vt as Y_AXIS_MAX_TICK_COUNT,gt as Y_AXIS_MIN_TICK_COUNT,Oe as buildHorizontalTangentBezierPath,Fe as buildProjectionPath,x as chartCssVars,Pe as clampHoverIndexToMaxTime,ke as clampPixelXToProjectionHoverMax,Te as computeProjectionAnchorTangentSlope,kt as computeSquareColumn,He as computeYDomainsByAxis,C as defaultScatterColors,Me as extractProjectionLineConfigs,j as generateChartSkeletonData,m as getPrimaryYScale,ne as getSeriesMarkerVisualExtent,O as getSkeletonHeights,ut as indicatorFadeGradientStops,de as isChartInteractionPhase,tt as isCirclePattern,rt as isCirclesPattern,Ie as isLoadingChromePhase,Le as isYDomainTweenPhase,Je as measureMaxLabelWidthPx,De as mergeProjectionXDomainMax,Ce as mergeProjectionYDomain,ze as mergeYDomainRecords,We as niceYDomain,$e as patternPresetTileSize,Ee as projectionDateExtents,Ae as projectionHoverMaxBySeries,Ne as projectionHoverMaxTime,we as projectionPinnedOverlayX,je as projectionValueExtents,Ze as renderPatternPreset,ae as resolveChartMargin,ie as resolveDensityMaxLabels,se as resolveDensityTickCount,ue as resolveRestingChartPhase,G as resolveTooltipBoxMotion,ft as resolveVerticalFadeSides,Ke as resolveYAxisMarginPx,ht as resolveYAxisTickCount,Ve as shouldTweenYDomain,At as topSquareCenterY,B as useActiveMarkers,V as useAnimatedYDomains,b as useChart,U as useChartConfig,y as useChartHover,k as useChartInteraction,te as useChartLegendHover,S as useChartStable,F as useStaticChartPreview,w as useYScale};
|
|
1
|
+
import{a as e}from"../../../_chunks/rolldown-runtime-B0Z9INg1.js";import{t}from"../../../_chunks/react-BcFqt3h5.js";import{t as n}from"../../../_chunks/compiler-runtime-Br_I-bNG.js";import{t as r}from"../../../_chunks/jsx-runtime-CNz6huh3.js";import{t as i}from"../../../_chunks/dist-hovC-tlK.js";import{n as a}from"../../../_chunks/react-pnTbDyGB.js";import{t as o}from"../../../_chunks/react-dom-Cn-Wbvts.js";import{n as s,r as c,t as l}from"../../../_chunks/animation-D8IqP_32.js";import{t as u}from"../../../_chunks/band-BdEqNwFI.js";import{n as d,t as f}from"../../../_chunks/linear-Bx9uzvr3.js";import{t as p}from"../../../_chunks/grid-Bg9exNBo.js";import{i as m,n as h,o as g,s as _,t as v}from"../../../_chunks/y-axis-scales-JGNJ3oYP.js";import{a as y,i as b,n as x,o as S,r as C,s as w,t as T}from"../../../_chunks/chart-context-Bjw_NzAE.js";import{r as E,t as D}from"../../../_chunks/projection-line-pR-NKJB1.js";import{_ as O,a as k,c as A,d as j,g as M,h as N,i as P,l as F,m as I,n as L,o as R,p as z,r as B,s as V,t as H}from"../../../_chunks/chart-markers-BLtXtGRE.js";import{i as U,n as W,r as G,t as K}from"../../../_chunks/chart-config-context-DjCufEb2.js";import{n as ee,t as q}from"../../../_chunks/chart-legend-hover-TZ_1t9hC.js";import{i as te,n as J,t as ne}from"../../../_chunks/series-markers-BYXibIP2.js";import{a as re}from"../../../_chunks/chart-formatters-C23Gt1wa.js";import{a as Y,i as ie,n as ae,o as oe,r as se,t as ce}from"../../../_chunks/chart-density-Dm5sAroN.js";import{a as le,i as ue,n as de,o as fe,r as X,s as pe,t as me}from"../../../_chunks/chart-phase-oX99XcEO.js";import{a as he,c as ge,i as _e,n as ve,o as ye,r as be,s as xe,t as Se}from"../../../_chunks/chart-child-passthrough-L3xNi0fN.js";import{a as Ce,c as we,d as Te,f as Ee,i as De,l as Oe,n as ke,o as Ae,p as je,r as Me,s as Ne,t as Pe,u as Fe}from"../../../_chunks/projection-config-DO6vzrLI.js";import{a as Ie,c as Le,f as Re,l as ze,n as Be,p as Ve,r as He,t as Ue,u as We}from"../../../_chunks/y-domain-utils-BQs45POG.js";import{t as Ge}from"../../../_chunks/localPoint-BuWgV2HG.js";import{a as Ke,i as qe,n as Je,o as Ye,t as Xe}from"../../../_chunks/x-axis-ByrWoBBx.js";import{a as Ze,c as Qe,i as $e,l as et,n as tt,o as nt,r as rt,s as it,t as at}from"../../../_chunks/pattern-preset-BYTG3Sn4.js";import{t as ot}from"../../../_chunks/background-CJA6Zjoc.js";import{a as st,i as ct,n as lt,o as ut,r as dt,s as ft,t as pt}from"../../../_chunks/chart-tooltip-Q2xwFLCY.js";import{t as mt}from"../../../_chunks/reference-area-CsmmBmaE.js";import{a as ht,i as gt,n as _t,r as vt,t as yt}from"../../../_chunks/y-axis-OF5jnUeL.js";import{t as bt}from"../../../_chunks/tooltip-box-9EA8wbsd.js";import{t as xt}from"../../../_chunks/tooltip-content-BZh0nIAz.js";import{n as St,t as Ct}from"../../../_chunks/chart-defs-D1AKdYnA.js";import{t as wt}from"../../../_chunks/reference-area-config-3tJB6RT1.js";import{t as Tt}from"../../../_chunks/ParentSize-tno5okh0.js";import{t as Et}from"../../../_chunks/motion-utils-FSUhZgF9.js";const Dt=d(`domain`,`range`,`reverse`,`align`,`padding`,`round`);function Ot(e){return Dt(u(),e)}function kt({barLengthPx:e,squareSize:t,gap:n,fit:r=!1}){if(e<=0||t<=0)return{count:0,positions:[],columnHeight:0,squareSize:t,gap:n};if(r){let r=Math.max(1,Math.floor((e+n)/(t+n))),i=r>1?Math.max(0,(e-r*t)/(r-1)):0,a=t+i,o=e,s=[];for(let e=0;e<r;e++)s.push(o-t-e*a);return{count:r,positions:s,columnHeight:o,squareSize:t,gap:i}}let i=t+n,a=Math.max(1,Math.round(e/i)),o=a*t+Math.max(0,a-1)*n,s=[];for(let e=0;e<a;e++){let n=e*i;s.push(o-t-n)}return{count:a,positions:s,columnHeight:o,squareSize:t,gap:n}}function At({baselineY:e,barLengthPx:t,squareSize:n,gap:r,fit:i=!1}){let{count:a,squareSize:o,columnHeight:s}=kt({barLengthPx:t,squareSize:n,gap:r,fit:i});return a===0?e:e-s+o/2}var Z=n(),Q=/* @__PURE__ */ e(r(),1),$=/* @__PURE__ */ e(t(),1);function jt(e){let t=[];return ve(e,e=>{let n=e.type;if(n.__isBarDepthLayer)return;let r=typeof e.type==`function`&&(n.displayName||n.name)||``,i=e.props;if((r===`Bar`||r===`BarSquares`||i&&typeof i.dataKey==`string`&&i.dataKey.length>0)&&i?.dataKey){let e=typeof i.fill==`string`?i.fill:void 0,n=i.stroke||e||`var(--chart-line-primary)`;t.push({dataKey:i.dataKey,stroke:n,strokeWidth:0,yAxisId:i.yAxisId,baseDataKey:i.baseDataKey})}}),t}function Mt(e){let t=(0,Z.c)(2),{width:n,height:r}=e;if(n<10||r<10)return null;let i;return t[0]===e?i=t[1]:(i=/* @__PURE__ */ (0,Q.jsx)(Nt,{...e}),t[0]=e,t[1]=i),i}const Nt=(0,$.memo)(function({width:e,height:t,data:n,xDataKey:r,margin:i,density:a,animationDuration:o,animationDelay:s,animationEasing:c,enterTransition:l,revealSignature:u=``,barGap:d,barWidthProp:p,barAlign:v,orientation:y,loadingSkeletonOrientation:b,maxValue:x,stacked:S,stackGap:C,squareSnap:w,children:E,containerRef:D,onPhaseChange:O,status:k}){let{tooltipData:A,setTooltipData:j,scheduleTooltip:M,clearTooltip:P}=R(),[F,I]=(0,$.useState)(!1),[L,z]=(0,$.useState)(0),B=A?.index??null,V=y===`horizontal`,H=(0,$.useMemo)(()=>jt(E),[E]),U=e-i.left-i.right,W=t-i.top-i.bottom,G=(0,$.useCallback)(e=>{let t=e[r];return t instanceof Date?re.format(t):String(t)},[r]),K=(0,$.useCallback)(e=>{let t=e[r];return t instanceof Date?t:/* @__PURE__ */ new Date},[r]),ee=n.map(e=>G(e)),q=Ot({range:V?[0,W]:[0,U],domain:ee,padding:d}),te=v===`center`&&p!=null?(()=>{let e=(q.bandwidth()-p)/2;return e>0?Object.assign(t=>{let n=q(t);return n===void 0?void 0:n+e},q):q})():q,J=p??te.bandwidth(),ne=(0,$.useMemo)(()=>{let e=S?Be(n,H):Ue(n,H);return Re(e,x)},[n,H,S,x]),Y=(0,$.useMemo)(()=>f({range:V?[0,U]:[W,0],domain:ne,nice:x===void 0}),[U,W,V,x,ne]),ie=(0,$.useMemo)(()=>V?_(Y):h({lines:H,data:n,innerHeight:W,resolveDomain:e=>{let t=H.filter(t=>e.includes(t.dataKey)),r=S?Be(n,t):Ue(n,t);return Re(r,x)}}),[n,W,V,H,x,S,Y]),ae=m(ie,Y),oe=(0,$.useMemo)(()=>{if(!S)return;let e=/* @__PURE__ */ new Map;for(let t=0;t<n.length;t++){let r=n[t];if(!r)continue;let i=/* @__PURE__ */ new Map,a=0;for(let e of H){i.set(e.dataKey,a);let t=r[e.dataKey];typeof t==`number`&&(a+=t)}e.set(t,i)}return e},[n,H,S]),se=(0,$.useMemo)(()=>n.length<1?0:V?W/n.length:U/n.length,[U,W,n.length,V]),ce=(0,$.useMemo)(()=>n.map(e=>G(e)),[n,G]),ue=(0,$.useMemo)(()=>{let e=Date.now(),t=e-n.length*24*60*60*1e3,r={...te,domain:()=>[new Date(t),new Date(e)],range:()=>[0,U],invert:n=>new Date(t+n/U*(e-t)),copy:()=>r};return r},[te,U,n.length]);(0,$.useEffect)(()=>{if(z(e=>e+1),I(!1),k===`loading`)return;let e=n.length>1?o*.4:0,t=setTimeout(()=>{I(!0)},s+o+e);return()=>clearTimeout(t)},[s,o,u,k]),(0,$.useEffect)(()=>{O?.(F?`ready`:`revealing`)},[F,O]);let de=(0,$.useCallback)(e=>{let t=Ge(e);if(!t)return;let r=V?t.y-i.top:t.x-i.left,a=Math.floor(r/se),o=Math.max(0,Math.min(n.length-1,a)),s=n[o];if(!s)return;let c={},l={},u=te(G(s))??0;if(V){let e=H.length,{barWidth:t,gap:n}=lt(J,e,4);if(S){let e=0;for(let t of H){let n=s[t.dataKey];if(typeof n==`number`){e+=n;let r=ie[g(t.yAxisId)]??Y;l[t.dataKey]=r(e)??0,c[t.dataKey]=u+J/2}}}else H.forEach((e,r)=>{let i=s[e.dataKey];if(typeof i==`number`){let a=ie[g(e.yAxisId)]??Y;l[e.dataKey]=a(i)??0,c[e.dataKey]=u+r*(t+n)+t/2}})}else if(S){let e=0;H.forEach((t,n)=>{let r=s[t.dataKey];if(typeof r!=`number`)return;e+=r;let i=(ie[g(t.yAxisId)]??ae)(e)??0,a=n===H.length-1;c[t.dataKey]=!a&&C>0&&r>=0?i+C:i})}else{let e=H.length,{barWidth:t,gap:n}=lt(J,e,4);H.forEach((e,r)=>{let i=s[e.dataKey];if(typeof i==`number`){let a=ie[g(e.yAxisId)]??ae,o=a(0)??W,s=a(i)??0,d=o-s;w&&!V&&i>0?c[e.dataKey]=At({baselineY:o,barLengthPx:d,squareSize:t,gap:w.squareGap,fit:w.fit}):c[e.dataKey]=s,l[e.dataKey]=u+r*(t+n)+t/2}})}let d;d=V?Math.max(...Object.values(l),0):u+J/2,M({point:s,index:o,x:d,yPositions:c,xPositions:Object.keys(l).length>0?l:void 0})},[te,Y,n,H,i.left,i.top,G,se,J,V,S,C,M,ie,ae,w,W]),fe=(0,$.useCallback)(()=>{P()},[P]),X=F,pe=[],Se=[],Ce=[],we=[],Te=[];ve(E,e=>{let t=ge(e);Ct(e)?pe.push(e):St(e)?we.push(e):he(t)?Te.push(t):_e(t)?Se.push(be(e.type)?t:e):ye(t)?Ce.push(t):we.push(e)});let Ee=(0,$.useMemo)(()=>wt(E),[E]),De={...me,chartPhase:le(k),chartStatus:k,data:n,renderData:n,xScale:ue,yScale:V?Y:ae,yScales:ie,width:e,height:t,innerWidth:U,innerHeight:W,margin:i,density:a,columnWidth:se,tooltipData:A,setTooltipData:j,containerRef:D,lines:H,referenceAreas:Ee,isLoaded:F,animationDuration:o,animationDelay:s,animationEasing:c,enterTransition:l,revealEpoch:L,xAccessor:K,dateLabels:ce,xScaleType:`time`,barScale:te,bandWidth:J,hoveredBarIndex:B,barXAccessor:G,orientation:y,stacked:S,stackOffsets:oe,stackGap:C,squareSnap:w};return/* @__PURE__ */ (0,Q.jsx)(T,{value:De,children:/* @__PURE__ */ (0,Q.jsxs)(`svg`,{"aria-hidden":`true`,className:`overflow-visible`,height:t,width:e,children:[pe.length>0&&/* @__PURE__ */ (0,Q.jsx)(`defs`,{children:pe}),/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:`transparent`,height:t,width:e,x:0,y:0}),/* @__PURE__ */ (0,Q.jsxs)(`g`,{onMouseLeave:X?fe:void 0,onMouseMove:X?de:void 0,style:{cursor:X?`crosshair`:`default`},transform:`translate(${i.left},${i.top})`,children:[/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:`transparent`,height:W,width:U,x:0,y:0}),xe(Se),xe(Ce),k===`loading`?/* @__PURE__ */ (0,Q.jsx)(N,{barCount:n.length||12,barFraction:b===`match`&&V&&p!=null&&n.length>0?Math.min(.9,p/(W/n.length)):void 0,innerHeight:W,innerWidth:U,orientation:b===`match`&&V?`horizontal`:`vertical`}):xe(we),xe(Te)]})]})})});function Pt(e){let t=(0,Z.c)(34),{data:n,xDataKey:r,density:a,margin:o,animationDuration:c,animationDelay:l,animationEasing:u,enterTransition:d,revealSignature:f,aspectRatio:p,height:m,className:h,barGap:g,barWidth:_,barAlign:v,orientation:y,loadingSkeletonOrientation:b,maxValue:x,stacked:S,stackGap:C,squareSnap:w,children:T,onPhaseChange:E,status:D}=e,O=r===void 0?`name`:r,k=a===void 0?se:a,A=c===void 0?1100:c,j=l===void 0?0:l,M=u===void 0?s:u,N=p===void 0?`2 / 1`:p,P=h===void 0?``:h,F=g===void 0?.2:g,I=v===void 0?`start`:v,L=y===void 0?`vertical`:y,R=b===void 0?`vertical`:b,z=S!==void 0&&S,B=C===void 0?0:C,V=D===void 0?`ready`:D,H=(0,$.useRef)(null),U;t[0]!==k||t[1]!==o?(U=ie(k,o),t[0]=k,t[1]=o,t[2]=U):U=t[2];let W=U,G;t[3]===P?G=t[4]:(G=i(`relative w-full overflow-visible`,P),t[3]=P,t[4]=G);let K;t[5]!==N||t[6]!==m?(K=m===void 0?{aspectRatio:N}:{height:m},t[5]=N,t[6]=m,t[7]=K):K=t[7];let ee;t[8]!==j||t[9]!==A||t[10]!==M||t[11]!==I||t[12]!==F||t[13]!==_||t[14]!==T||t[15]!==n||t[16]!==k||t[17]!==d||t[18]!==R||t[19]!==W||t[20]!==x||t[21]!==E||t[22]!==L||t[23]!==f||t[24]!==w||t[25]!==B||t[26]!==z||t[27]!==V||t[28]!==O?(ee=/* @__PURE__ */ (0,Q.jsx)(Tt,{debounceTime:10,children:e=>{let{width:t,height:r}=e;return/* @__PURE__ */ (0,Q.jsx)(Mt,{animationDelay:j,animationDuration:A,animationEasing:M,barGap:F,barAlign:I,barWidthProp:_,containerRef:H,data:n,enterTransition:d,height:r,density:k,margin:W,maxValue:x,onPhaseChange:E,loadingSkeletonOrientation:R,orientation:L,revealSignature:f,squareSnap:w,stacked:z,stackGap:B,status:V,width:t,xDataKey:O,children:T})}}),t[8]=j,t[9]=A,t[10]=M,t[11]=I,t[12]=F,t[13]=_,t[14]=T,t[15]=n,t[16]=k,t[17]=d,t[18]=R,t[19]=W,t[20]=x,t[21]=E,t[22]=L,t[23]=f,t[24]=w,t[25]=B,t[26]=z,t[27]=V,t[28]=O,t[29]=ee):ee=t[29];let q;return t[30]!==G||t[31]!==K||t[32]!==ee?(q=/* @__PURE__ */ (0,Q.jsx)(`div`,{className:G,ref:H,style:K,children:ee}),t[30]=G,t[31]=K,t[32]=ee,t[33]=q):q=t[33],q}const Ft=[];function It(e){let t=(0,Z.c)(4),{margin:n,aspectRatio:r,className:i}=e,a=r===void 0?`2 / 1`:r,o=i===void 0?``:i,s;return t[0]!==a||t[1]!==o||t[2]!==n?(s=/* @__PURE__ */ (0,Q.jsx)(Pt,{aspectRatio:a,className:o,data:Ft,margin:n,status:`loading`}),t[0]=a,t[1]=o,t[2]=n,t[3]=s):s=t[3],s}function Lt(e){let t=(0,Z.c)(32),{value:n,label:r,stroke:i,strokeDasharray:a,strokeWidth:o,qaTestId:s}=e,c=i===void 0?`var(--color-depth-black-100)`:i,l=a===void 0?`4 4`:a,u=o===void 0?1.5:o,d=s===void 0?`bar-reference-line`:s,{yScale:f,innerHeight:p,innerWidth:m,orientation:h,barScale:g,data:_,barXAccessor:v}=b(),y,x;if(t[0]!==n||t[1]!==f?(y=f(n),x=y==null||!Number.isFinite(y),t[0]=n,t[1]=f,t[2]=y,t[3]=x):(y=t[2],x=t[3]),x)return null;let S=h===`horizontal`,C=_[0],w,T;if(t[4]!==g||t[5]!==v||t[6]!==_||t[7]!==C){let e=_.at(-1),n=C&&v?v(C):void 0,r=e&&v?v(e):void 0;w=n!=null&&g?g(n)??0:0,T=r!=null&&g?g(r)??w:w,t[4]=g,t[5]=v,t[6]=_,t[7]=C,t[8]=w,t[9]=T}else w=t[8],T=t[9];let E=T,D;t[10]!==g||t[11]!==p||t[12]!==m||t[13]!==S?(D=g?.bandwidth()??(S?p:m),t[10]=g,t[11]=p,t[12]=m,t[13]=S,t[14]=D):D=t[14];let O=D,k=Math.min(w,E),A=Math.max(w,E)+O,j=S?y:0,M=S?y:m,N=S?k:y,P=S?A:y,F=r?r.length*7+12:0,I=S?y-F/2:m/2-F/2,L=S?-28:y-12,R;t[15]!==c||t[16]!==l||t[17]!==u||t[18]!==j||t[19]!==M||t[20]!==N||t[21]!==P?(R=/* @__PURE__ */ (0,Q.jsx)(`line`,{stroke:c,strokeDasharray:l,strokeLinecap:`square`,strokeWidth:u,x1:j,x2:M,y1:N,y2:P}),t[15]=c,t[16]=l,t[17]=u,t[18]=j,t[19]=M,t[20]=N,t[21]=P,t[22]=R):R=t[22];let z;t[23]!==r||t[24]!==F||t[25]!==I||t[26]!==L?(z=r?/* @__PURE__ */ (0,Q.jsxs)(`g`,{transform:`translate(${I}, ${L})`,children:[/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:`var(--color-neutral-lighter)`,height:24,rx:8,ry:8,width:F}),/* @__PURE__ */ (0,Q.jsx)(`text`,{className:`pui-text-mono-small`,dominantBaseline:`central`,fill:`var(--color-neutral-base)`,textAnchor:`middle`,x:F/2,y:12,children:r})]}):null,t[23]=r,t[24]=F,t[25]=I,t[26]=L,t[27]=z):z=t[27];let B;return t[28]!==d||t[29]!==R||t[30]!==z?(B=/* @__PURE__ */ (0,Q.jsxs)(`g`,{pointerEvents:`none`,"qa-test-id":d,children:[R,z]}),t[28]=d,t[29]=R,t[30]=z,t[31]=B):B=t[31],B}Lt.displayName=`BarReferenceLine`;function Rt(e,t){let n=Math.max(0,e-t);return Math.min(t*.22,Math.max(0,n-1),7)}function zt(e,t,n){let r=Math.min(1,Math.max(0,e))*Math.min(n,Math.max(0,t));return{depth:r,perspectiveRise:r*.45}}function Bt(e,t,n,r,i,a,o){let s=r/2;if(s<=0)return 0;let c=Rt(e.step?.()??t,t),l=(e(n(i))??0)+t/2;return zt(Math.min(1,Math.abs((l-s)/s)),Math.abs(o-a),c).perspectiveRise}function Vt(e){let t=(0,Z.c)(41),{x:n,y:r,width:i,height:o,fill:s,rx:c,ry:l,index:u,isFaded:d,animationType:f,growFromY:p,fadedOpacity:m,staggerDelay:h,startDelay:g,enterTransition:_,revealEpoch:v,isHorizontal:y}=e,b=g+u*h,x;t[0]!==_||t[1]!==b?(x=Et(_,b),t[0]=_,t[1]=b,t[2]=x):x=t[2];let S=x;if(f===`fade`){let e=d?m:1,f;t[3]===e?f=t[4]:(f={opacity:e,filter:`blur(0px)`},t[3]=e,t[4]=f);let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p={opacity:0,filter:`blur(2px)`},t[5]=p):p=t[5];let h=`fade-${u}-${v}`,g;return t[6]!==S||t[7]!==s||t[8]!==o||t[9]!==c||t[10]!==l||t[11]!==f||t[12]!==h||t[13]!==i||t[14]!==n||t[15]!==r?(g=/* @__PURE__ */ (0,Q.jsx)(a.rect,{animate:f,fill:s,height:o,initial:p,rx:c,ry:l,transition:S,width:i,x:n,y:r},h),t[6]=S,t[7]=s,t[8]=o,t[9]=c,t[10]=l,t[11]=f,t[12]=h,t[13]=i,t[14]=n,t[15]=r,t[16]=g):g=t[16],g}let C;t[17]!==p||t[18]!==o||t[19]!==y||t[20]!==i||t[21]!==n||t[22]!==r?(C=y?{width:0,height:o,x:n,y:r}:{width:i,height:0,x:n,y:p},t[17]=p,t[18]=o,t[19]=y,t[20]=i,t[21]=n,t[22]=r,t[23]=C):C=t[23];let w=C,T;t[24]!==o||t[25]!==i||t[26]!==n||t[27]!==r?(T={width:i,height:o,x:n,y:r},t[24]=o,t[25]=i,t[26]=n,t[27]=r,t[28]=T):T=t[28];let E=T,D=d?m:1,O;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(O={transition:`opacity 0.15s ease-in-out`},t[29]=O):O=t[29];let k=`grow-${u}-${v}`,A;t[30]!==S||t[31]!==s||t[32]!==w||t[33]!==c||t[34]!==l||t[35]!==k||t[36]!==E?(A=/* @__PURE__ */ (0,Q.jsx)(a.rect,{animate:E,fill:s,initial:w,rx:c,ry:l,transition:S},k),t[30]=S,t[31]=s,t[32]=w,t[33]=c,t[34]=l,t[35]=k,t[36]=E,t[37]=A):A=t[37];let j;return t[38]!==D||t[39]!==A?(j=/* @__PURE__ */ (0,Q.jsx)(`g`,{opacity:D,style:O,children:A}),t[38]=D,t[39]=A,t[40]=j):j=t[40],j}function Ht(e,t){if(!t)return;let n=e[t];return typeof n==`number`?n:void 0}const Ut=(0,$.memo)(function(e){let t=(0,Z.c)(94),{dataKey:n,baseDataKey:r,yAxisId:i,fill:a,lineCap:o,animate:s,animationType:c,fadedOpacity:l,staggerDelay:u,stackGap:d,groupGap:f,perspective:p,minBarHeight:m,showValueLabels:h,valueLabelFormatter:g,valueLabelFill:_,valueLabelGap:v,valueLabelClassName:y,valueLabelPlacement:S,deferValueLabels:C,barScale:T,bandWidth:E,barXAccessor:D}=e,O=a===void 0?x.linePrimary:a,k=o===void 0?`round`:o,A=s===void 0||s,j=c===void 0?`grow`:c,M=l===void 0?.3:l,N=f===void 0?4:f,P=p!==void 0&&p,F=m===void 0?0:m,I=h!==void 0&&h,L=_===void 0?x.label:_,R=v===void 0?8:v,z=S===void 0?`auto`:S,B=C!==void 0&&C,{data:V,yScale:H,innerHeight:U,innerWidth:W,isLoaded:G,hoveredBarIndex:K,lines:q,orientation:te,stacked:J,stackOffsets:ne,stackGap:re,animationDuration:Y,animationDelay:ie,enterTransition:ae,revealEpoch:oe}=b(),se=re===void 0?0:re,ce=ie===void 0?0:ie,le=oe===void 0?0:oe,ue=(Y||1100)*.4,de=u??(V.length>1?ue/1e3/V.length:0),fe=(0,$.useId)(),X=te===`horizontal`,pe=d??se,{hoveredIndex:me}=ee(),he;if(t[0]!==n||t[1]!==q){let e;t[3]===n?e=t[4]:(e=e=>e.dataKey===n,t[3]=n,t[4]=e),he=q.findIndex(e),t[0]=n,t[1]=q,t[2]=he}else he=t[2];let ge=Math.max(0,he),_e=q[ge],ve=w(i??_e?.yAxisId),ye=me!==null&&me!==ge,be=q.length,xe=ge===be-1,Se;bb0:{if(!E||be===0){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e={barWidth:0,gap:0},t[5]=e):e=t[5],Se=e;break bb0}if(J){let e;t[6]===E?e=t[7]:(e={barWidth:E,gap:0},t[6]=E,t[7]=e),Se=e;break bb0}let e;t[8]!==E||t[9]!==N||t[10]!==be?(e=lt(E,be,N),t[8]=E,t[9]=N,t[10]=be,t[11]=e):e=t[11],Se=e}let{barWidth:Ce,gap:we}=Se,Te;bb1:{if(P){Te=0;break bb1}if(typeof k==`number`){Te=k;break bb1}if(k===`round`&&Ce){Te=Math.min(Ce/2,8);break bb1}Te=0}let Ee=Te,De=`bar-series-${fe}`,Oe;if(t[12]!==A||t[13]!==ce||t[14]!==j||t[15]!==E||t[16]!==T||t[17]!==Ce||t[18]!==D||t[19]!==r||t[20]!==de||t[21]!==H||t[22]!==Ee||t[23]!==V||t[24]!==n||t[25]!==B||t[26]!==we||t[27]!==ae||t[28]!==M||t[29]!==O||t[30]!==K||t[31]!==U||t[32]!==W||t[33]!==X||t[34]!==xe||t[35]!==ye||t[36]!==G||t[37]!==F||t[38]!==P||t[39]!==le||t[40]!==ge||t[41]!==I||t[42]!==pe||t[43]!==ne||t[44]!==J||t[45]!==y||t[46]!==L||t[47]!==g||t[48]!==R||t[49]!==z||t[50]!==ve){let e;t[52]!==A||t[53]!==ce||t[54]!==j||t[55]!==E||t[56]!==T||t[57]!==Ce||t[58]!==D||t[59]!==r||t[60]!==de||t[61]!==H||t[62]!==Ee||t[63]!==n||t[64]!==B||t[65]!==we||t[66]!==ae||t[67]!==M||t[68]!==O||t[69]!==K||t[70]!==U||t[71]!==W||t[72]!==X||t[73]!==xe||t[74]!==ye||t[75]!==G||t[76]!==F||t[77]!==P||t[78]!==le||t[79]!==ge||t[80]!==I||t[81]!==pe||t[82]!==ne||t[83]!==J||t[84]!==y||t[85]!==L||t[86]!==g||t[87]!==R||t[88]!==z||t[89]!==ve?(e=(e,t)=>{let i=e[n];if(typeof i!=`number`)return null;let a=D(e),o=T(a)??0,s,c,l,u,d=X?H:ve,f=Ht(e,r)??0,p=r!==void 0;if(X){if(l=Ce,J&&ne){let e=ne.get(t)?.get(n)??0,r=d(e)??0,a=d(e+i)??r;s=Math.min(r,a),u=Math.abs(a-r),!xe&&pe>0&&(u=Math.max(0,u-pe))}else{let e=d(f)??0,t=d(i)??e;s=Math.min(e,t),u=Math.abs(t-e)}c=J?o:o+ge*(Ce+we)}else{let r=d(f)??U,a=d(i)??r;if(u=Ce,J&&ne){let e=ne.get(t)?.get(n)??0,r=d(e)??U,a=d(e+i)??r;c=Math.min(r,a),l=Math.abs(a-r),!xe&&pe>0&&(l=Math.max(0,l-pe),a<r&&(c+=pe))}else c=Math.min(r,a),l=Math.abs(a-r);s=J?o:o+ge*(Ce+we);let m=!1;if(!J&&!p&&F>0&&i>=0&&l<F){let e=d(0)??U;l=F,c=e-F,m=!0}if(P&&i>0&&!m&&(!J||xe)){let t=d(0)??U,n=Bt(T,E,D,W,e,c,t),r=Math.min(n,Math.max(0,l-1));c+=r,l-=r}}let m=K!==null&&K!==t||ye,h=`bar-${n}-${a}`,_=!J||pe>0||xe,v=_?Ee:0,b=_?Ee:0,x=typeof O==`function`?O(e,t):O,S=A&&!G?/* @__PURE__ */ (0,Q.jsx)(Vt,{animationType:j,enterTransition:ae,fadedOpacity:M,fill:x,growFromY:X?c:ve(f)??U,height:l,index:t,isFaded:m,isHorizontal:X,revealEpoch:le,rx:v,ry:b,staggerDelay:de,startDelay:ce/1e3,width:u,x:s,y:c}):/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:x,height:l,opacity:m?M:1,rx:v,ry:b,style:{cursor:`default`,transition:`opacity 0.15s ease-in-out`},width:u,x:s,y:c});if(!I)return/* @__PURE__ */ (0,Q.jsx)($.Fragment,{children:S},h);let C=g?g(i,e,t):String(i),w=typeof L==`function`?L(e,t):L,k=X?s+u+R:s+u/2,N=!X&&z===`auto`&&i<0&&!p,V=X?c+l/2:N?c+l+R:c-R;return/* @__PURE__ */ (0,Q.jsxs)($.Fragment,{children:[S,/* @__PURE__ */ (0,Q.jsx)(`text`,{className:y,dominantBaseline:X?`central`:N?`hanging`:`auto`,fill:w,opacity:B?void 0:m?M:1,style:B?{opacity:G?m?M:1:0,transition:`opacity 280ms ease`}:void 0,textAnchor:X?`start`:`middle`,x:k,y:V,children:C})]},h)},t[52]=A,t[53]=ce,t[54]=j,t[55]=E,t[56]=T,t[57]=Ce,t[58]=D,t[59]=r,t[60]=de,t[61]=H,t[62]=Ee,t[63]=n,t[64]=B,t[65]=we,t[66]=ae,t[67]=M,t[68]=O,t[69]=K,t[70]=U,t[71]=W,t[72]=X,t[73]=xe,t[74]=ye,t[75]=G,t[76]=F,t[77]=P,t[78]=le,t[79]=ge,t[80]=I,t[81]=pe,t[82]=ne,t[83]=J,t[84]=y,t[85]=L,t[86]=g,t[87]=R,t[88]=z,t[89]=ve,t[90]=e):e=t[90],Oe=V.map(e),t[12]=A,t[13]=ce,t[14]=j,t[15]=E,t[16]=T,t[17]=Ce,t[18]=D,t[19]=r,t[20]=de,t[21]=H,t[22]=Ee,t[23]=V,t[24]=n,t[25]=B,t[26]=we,t[27]=ae,t[28]=M,t[29]=O,t[30]=K,t[31]=U,t[32]=W,t[33]=X,t[34]=xe,t[35]=ye,t[36]=G,t[37]=F,t[38]=P,t[39]=le,t[40]=ge,t[41]=I,t[42]=pe,t[43]=ne,t[44]=J,t[45]=y,t[46]=L,t[47]=g,t[48]=R,t[49]=z,t[50]=ve,t[51]=Oe}else Oe=t[51];let ke;return t[91]!==De||t[92]!==Oe?(ke=/* @__PURE__ */ (0,Q.jsx)(`g`,{className:De,children:Oe}),t[91]=De,t[92]=Oe,t[93]=ke):ke=t[93],ke});function Wt(e){let t=(0,Z.c)(5),{barScale:n,bandWidth:r,barXAccessor:i}=S();if(!(n&&r&&i))return console.warn(`Bar component must be used within a BarChart`),null;let a;return t[0]!==r||t[1]!==n||t[2]!==i||t[3]!==e?(a=/* @__PURE__ */ (0,Q.jsx)(Ut,{...e,bandWidth:r,barScale:n,barXAccessor:i}),t[0]=r,t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}Wt.displayName=`Bar`;function Gt(e){return e.startsWith(`url(`)}function Kt(e,t,n){return n<=1?0:(e?.type===`tween`&&typeof e.duration==`number`?e.duration*1e3:t)*.4/1e3/(n-1)}function qt(e,t,n,r,i){let a=Kt(e,t,i),o=Et(e,n*r);if(i<=1||o.type!==`tween`)return o;let s=typeof o.duration==`number`?o.duration:t/1e3;return{...o,duration:s+a*(i-1)}}function Jt(e){let t=(0,Z.c)(39),{x:n,baselineY:r,barLengthPx:i,squareSize:o,squareGap:s,squareRadius:c,squareFit:l,fill:u,useGradient:d,gradientStops:f,patternPreset:p,index:m,isFaded:h,fadedOpacity:g,animate:_,staggerDelay:v,animationDuration:y,enterTransition:b,revealEpoch:x}=e,S,C;if(t[0]!==_||t[1]!==y||t[2]!==i||t[3]!==r||t[4]!==b||t[5]!==g||t[6]!==u||t[7]!==f||t[8]!==m||t[9]!==h||t[10]!==p||t[11]!==x||t[12]!==l||t[13]!==s||t[14]!==c||t[15]!==o||t[16]!==v||t[17]!==d||t[18]!==n){let e=kt({barLengthPx:i,squareSize:o,gap:s,fit:l}),w=o*c,T=r-e.columnHeight,E=`bar-squares-gradient-${m}-${x}`,D;t[21]===u?D=t[22]:(D=Gt(u),t[21]=u,t[22]=D);let O=D,k=`bar-squares-pattern-${m}-${x}`,A;bb0:{if(d){if(O&&p&&p!==`none`){A=`url(#${k})`;break bb0}A=`url(#${E})`;break bb0}A=u}let j=A,M=Kt(b,y,e.count),N=h?g:1,P;t[23]!==E||t[24]!==O||t[25]!==k||t[26]!==p||t[27]!==d?(P=d&&O&&p&&p!==`none`?Ze(p,k,{color:`url(#${E})`}):null,t[23]=E,t[24]=O,t[25]=k,t[26]=p,t[27]=d,t[28]=P):P=t[28];let F=P,I;t[29]!==r||t[30]!==T||t[31]!==E||t[32]!==F||t[33]!==f||t[34]!==d?(I=d?/* @__PURE__ */ (0,Q.jsxs)(`defs`,{children:[/* @__PURE__ */ (0,Q.jsx)(`linearGradient`,{gradientUnits:`userSpaceOnUse`,id:E,x1:0,x2:0,y1:r,y2:T,children:f.map(Yt)}),F]}):null,t[29]=r,t[30]=T,t[31]=E,t[32]=F,t[33]=f,t[34]=d,t[35]=I):I=t[35],S=I,C=e.positions.map((e,t)=>{let r=T+e,i=r+o,s=`sq-${m}-${t}-${x}`;return _?/* @__PURE__ */ (0,Q.jsx)(a.rect,{animate:{attrY:r,height:o,opacity:N},fill:j,height:o,initial:{attrY:i,height:0,opacity:1},rx:w,ry:w,transition:{...Et(b,m*v+t*M),opacity:{duration:.15}},width:o,x:n},s):/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:j,height:o,opacity:N,rx:w,ry:w,width:o,x:n,y:r},s)}),t[0]=_,t[1]=y,t[2]=i,t[3]=r,t[4]=b,t[5]=g,t[6]=u,t[7]=f,t[8]=m,t[9]=h,t[10]=p,t[11]=x,t[12]=l,t[13]=s,t[14]=c,t[15]=o,t[16]=v,t[17]=d,t[18]=n,t[19]=S,t[20]=C}else S=t[19],C=t[20];let w=C,T;return t[36]!==S||t[37]!==w?(T=/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[S,w]}),t[36]=S,t[37]=w,t[38]=T):T=t[38],T}function Yt(e){return/* @__PURE__ */ (0,Q.jsx)(`stop`,{offset:`${e.offset}%`,stopColor:e.color},`${e.offset}-${e.color}`)}const Xt=(0,$.memo)(function(e){let t=(0,Z.c)(69),{dataKey:n,yAxisId:r,fill:i,squareGap:a,squareRadius:o,squareFit:s,useGradient:c,gradientStops:l,patternPreset:u,animate:d,fadedOpacity:f,staggerDelay:p,groupGap:m,barScale:h,bandWidth:g,barXAccessor:_}=e,v=i===void 0?x.linePrimary:i,y=a===void 0?3:a,S=o===void 0?.25:o,C=s!==void 0&&s,T=c!==void 0&&c,E;t[0]===l?E=t[1]:(E=l===void 0?[]:l,t[0]=l,t[1]=E);let D=E,O=d===void 0||d,k=f===void 0?.3:f,A=m===void 0?4:m,{data:j,innerHeight:M,hoveredBarIndex:N,lines:P,orientation:F,stacked:I,animationDuration:L,enterTransition:R,revealEpoch:z}=b(),B=z===void 0?0:z,{hoveredIndex:V}=ee(),H=(0,$.useId)(),U=F===`horizontal`||I,W;if(t[2]!==n||t[3]!==P){let e;t[5]===n?e=t[6]:(e=e=>e.dataKey===n,t[5]=n,t[6]=e),W=P.findIndex(e),t[2]=n,t[3]=P,t[4]=W}else W=t[4];let G=Math.max(0,W),K=P[G],q=w(r??K?.yAxisId),te=V!==null&&V!==G,J=P.length,ne;t[7]!==g||t[8]!==A||t[9]!==J?(ne=lt(g,J,A),t[7]=g,t[8]=A,t[9]=J,t[10]=ne):ne=t[10];let{barWidth:re,gap:Y}=ne,ie=(L||1100)*.4,ae=p??(j.length>1?ie/1e3/j.length:0),oe;t[11]!==M||t[12]!==q?(oe=q(0)??M,t[11]=M,t[12]=q,t[13]=oe):oe=t[13];let se=oe,ce;t[14]!==v||t[15]!==D?(ce=D.length>=2?D:[{offset:0,color:v},{offset:100,color:v}],t[14]=v,t[15]=D,t[16]=ce):ce=t[16];let le=ce;if(U)return null;let ue=`bar-squares-${H}`,de;if(t[17]!==O||t[18]!==L||t[19]!==h||t[20]!==_||t[21]!==se||t[22]!==ae||t[23]!==j||t[24]!==n||t[25]!==Y||t[26]!==R||t[27]!==k||t[28]!==v||t[29]!==N||t[30]!==te||t[31]!==u||t[32]!==B||t[33]!==G||t[34]!==C||t[35]!==y||t[36]!==S||t[37]!==re||t[38]!==le||t[39]!==T||t[40]!==q){let e;t[42]!==O||t[43]!==L||t[44]!==h||t[45]!==_||t[46]!==se||t[47]!==ae||t[48]!==n||t[49]!==Y||t[50]!==R||t[51]!==k||t[52]!==v||t[53]!==N||t[54]!==te||t[55]!==u||t[56]!==B||t[57]!==G||t[58]!==C||t[59]!==y||t[60]!==S||t[61]!==re||t[62]!==le||t[63]!==T||t[64]!==q?(e=(e,t)=>{let r=e[n];if(typeof r!=`number`||r<=0)return null;let i=_(e),a=(h(i)??0)+G*(re+Y),o=q(r)??0,s=se-o;return/* @__PURE__ */ (0,Q.jsx)(Jt,{animate:O,animationDuration:L||1100,barLengthPx:s,baselineY:se,enterTransition:R,fadedOpacity:k,fill:v,gradientStops:le,index:t,isFaded:N!==null&&N!==t||te,patternPreset:u,revealEpoch:B,squareFit:C,squareGap:y,squareRadius:S,squareSize:re,staggerDelay:ae,useGradient:T,x:a},`bar-squares-${n}-${i}`)},t[42]=O,t[43]=L,t[44]=h,t[45]=_,t[46]=se,t[47]=ae,t[48]=n,t[49]=Y,t[50]=R,t[51]=k,t[52]=v,t[53]=N,t[54]=te,t[55]=u,t[56]=B,t[57]=G,t[58]=C,t[59]=y,t[60]=S,t[61]=re,t[62]=le,t[63]=T,t[64]=q,t[65]=e):e=t[65],de=j.map(e),t[17]=O,t[18]=L,t[19]=h,t[20]=_,t[21]=se,t[22]=ae,t[23]=j,t[24]=n,t[25]=Y,t[26]=R,t[27]=k,t[28]=v,t[29]=N,t[30]=te,t[31]=u,t[32]=B,t[33]=G,t[34]=C,t[35]=y,t[36]=S,t[37]=re,t[38]=le,t[39]=T,t[40]=q,t[41]=de}else de=t[41];let fe;return t[66]!==ue||t[67]!==de?(fe=/* @__PURE__ */ (0,Q.jsx)(`g`,{className:ue,children:de}),t[66]=ue,t[67]=de,t[68]=fe):fe=t[68],fe});function Zt(e){let t=(0,Z.c)(5),{barScale:n,bandWidth:r,barXAccessor:i}=S();if(!(n&&r&&i))return console.warn(`BarSquares must be used within a BarChart`),null;let a;return t[0]!==r||t[1]!==n||t[2]!==i||t[3]!==e?(a=/* @__PURE__ */ (0,Q.jsx)(Xt,{...e,bandWidth:r,barScale:n,barXAccessor:i}),t[0]=r,t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}Zt.displayName=`BarSquares`;const Qt=(0,$.memo)(function(e){let t=(0,Z.c)(37),{fill:n,opacity:r,squareGap:i,squareRadius:a,squareFit:o,groupGap:s,staggerDelay:c,barScale:l,bandWidth:u,barXAccessor:d}=e,f=n===void 0?x.grid:n,p=r===void 0?.3:r,m=i===void 0?3:i,h=a===void 0?.25:a,g=o!==void 0&&o,_=s===void 0?4:s,{data:v,lines:y,orientation:S,stacked:C,hoveredBarIndex:w,animationDuration:T,enterTransition:E,revealEpoch:D}=b(),O=D===void 0?0:D,k=(0,$.useId)(),A=S===`horizontal`||C,j=y.length,M;t[0]!==u||t[1]!==_||t[2]!==j?(M=lt(u,j,_),t[0]=u,t[1]=_,t[2]=j,t[3]=M):M=t[3];let{barWidth:N,gap:P}=M,F=(T||1100)*.4,I=c??(v.length>1?F/1e3/v.length:0);if(A)return null;let L=N*h,R=w===null?p:0,z=`bar-column-track-${k}`,B;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(B={transition:`opacity 0.15s ease-in-out`},t[4]=B):B=t[4];let V;if(t[5]!==l||t[6]!==d||t[7]!==I||t[8]!==v||t[9]!==P||t[10]!==R||t[11]!==E||t[12]!==f||t[13]!==y||t[14]!==O||t[15]!==L||t[16]!==g||t[17]!==m||t[18]!==N){let e;t[20]!==l||t[21]!==d||t[22]!==I||t[23]!==P||t[24]!==R||t[25]!==E||t[26]!==f||t[27]!==y||t[28]!==O||t[29]!==L||t[30]!==g||t[31]!==m||t[32]!==N?(e=(e,t)=>{let n=d(e),r=l(n)??0;return y.map((n,i)=>/* @__PURE__ */ (0,Q.jsx)($t,{animate:!0,bandPos:r,d:e,dataKey:n.dataKey,effectiveGroupGap:P,effectiveOpacity:R,enterTransition:E,fill:f,index:t,revealEpoch:O,rx:L,seriesIndex:i,squareFit:g,squareGap:m,squareSize:N,staggerDelay:I,yAxisId:n.yAxisId},`track-${t}-${n.dataKey}`))},t[20]=l,t[21]=d,t[22]=I,t[23]=P,t[24]=R,t[25]=E,t[26]=f,t[27]=y,t[28]=O,t[29]=L,t[30]=g,t[31]=m,t[32]=N,t[33]=e):e=t[33],V=v.map(e),t[5]=l,t[6]=d,t[7]=I,t[8]=v,t[9]=P,t[10]=R,t[11]=E,t[12]=f,t[13]=y,t[14]=O,t[15]=L,t[16]=g,t[17]=m,t[18]=N,t[19]=V}else V=t[19];let H;return t[34]!==V||t[35]!==z?(H=/* @__PURE__ */ (0,Q.jsx)(`g`,{className:z,style:B,children:V}),t[34]=V,t[35]=z,t[36]=H):H=t[36],H});function $t(e){let t=(0,Z.c)(45),{d:n,dataKey:r,yAxisId:i,bandPos:o,seriesIndex:s,effectiveGroupGap:c,squareSize:l,squareGap:u,squareFit:d,fill:f,rx:p,effectiveOpacity:m,index:h,staggerDelay:g,animate:_,enterTransition:v,revealEpoch:y}=e,{innerHeight:x,animationDuration:S}=b(),C=w(i),T=n[r];if(typeof T!=`number`||T<=0)return null;let E;t[0]!==x||t[1]!==C?(E=C(0)??x,t[0]=x,t[1]=C,t[2]=E):E=t[2];let D=E,O;t[3]!==T||t[4]!==C?(O=C(T)??0,t[3]=T,t[4]=C,t[5]=O):O=t[5];let k=D-O,A,j,M,N;if(t[6]!==_||t[7]!==o||t[8]!==k||t[9]!==D||t[10]!==S||t[11]!==c||t[12]!==v||t[13]!==h||t[14]!==s||t[15]!==d||t[16]!==u||t[17]!==l||t[18]!==g){j=Symbol.for(`react.early_return_sentinel`);bb0:{let e=kt({barLengthPx:k,squareSize:l,gap:u,fit:d}),t=D-e.columnHeight;if(M=Math.max(0,t),M<=0&&!_){j=null;break bb0}N=o+s*(l+c),A=qt(v,S||1100,h,g,e.count)}t[6]=_,t[7]=o,t[8]=k,t[9]=D,t[10]=S,t[11]=c,t[12]=v,t[13]=h,t[14]=s,t[15]=d,t[16]=u,t[17]=l,t[18]=g,t[19]=A,t[20]=j,t[21]=M,t[22]=N}else A=t[19],j=t[20],M=t[21],N=t[22];if(j!==Symbol.for(`react.early_return_sentinel`))return j;let P=A,F=M>0?M:0;if(_){let e;t[23]===F?e=t[24]:(e={height:F,y:0},t[23]=F,t[24]=e);let n;t[25]===D?n=t[26]:(n={height:D,y:0},t[25]=D,t[26]=n);let r=`track-${h}-${s}-${y}`,i;return t[27]!==F||t[28]!==m||t[29]!==P||t[30]!==f||t[31]!==p||t[32]!==l||t[33]!==e||t[34]!==n||t[35]!==r||t[36]!==N?(i=/* @__PURE__ */ (0,Q.jsx)(a.rect,{animate:e,fill:f,height:F,initial:n,opacity:m,rx:p,ry:p,transition:P,width:l,x:N},r),t[27]=F,t[28]=m,t[29]=P,t[30]=f,t[31]=p,t[32]=l,t[33]=e,t[34]=n,t[35]=r,t[36]=N,t[37]=i):i=t[37],i}if(M<=0)return null;let I;return t[38]!==m||t[39]!==f||t[40]!==p||t[41]!==l||t[42]!==M||t[43]!==N?(I=/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:f,height:M,opacity:m,rx:p,ry:p,width:l,x:N,y:0}),t[38]=m,t[39]=f,t[40]=p,t[41]=l,t[42]=M,t[43]=N,t[44]=I):I=t[44],I}function en(e){let t=(0,Z.c)(5),{barScale:n,bandWidth:r,barXAccessor:i}=S();if(!(n&&r&&i))return console.warn(`BarColumnTrack must be used within a BarChart`),null;let a;return t[0]!==r||t[1]!==n||t[2]!==i||t[3]!==e?(a=/* @__PURE__ */ (0,Q.jsx)(Qt,{...e,bandWidth:r,barScale:n,barXAccessor:i}),t[0]=r,t[1]=n,t[2]=i,t[3]=e,t[4]=a):a=t[4],a}en.displayName=`BarColumnTrack`;var tn=/* @__PURE__ */ e(o(),1);function nn(e){let t=(0,Z.c)(13),{label:n,x:r,crosshairX:o,isHovering:s,tickerHalfWidth:c}=e,l=c+20,u=1;if(s&&o!==null){let e=Math.abs(r-o);e<c?u=0:e<l&&(u=(e-c)/20)}let d;t[0]===r?d=t[1]:(d={left:r,bottom:12,width:0,display:`flex`,justifyContent:`center`},t[0]=r,t[1]=d);let f;t[2]===u?f=t[3]:(f={opacity:u},t[2]=u,t[3]=f);let p,m,h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=i(`pui-text-body-small-alt whitespace-nowrap text-chart-label`),m={opacity:1},h={duration:.4,ease:`easeInOut`},t[4]=p,t[5]=m,t[6]=h):(p=t[4],m=t[5],h=t[6]);let g;t[7]!==n||t[8]!==f?(g=/* @__PURE__ */ (0,Q.jsx)(a.span,{animate:f,className:p,initial:m,transition:h,children:n}),t[7]=n,t[8]=f,t[9]=g):g=t[9];let _;return t[10]!==d||t[11]!==g?(_=/* @__PURE__ */ (0,Q.jsx)(`div`,{className:`absolute`,style:d,children:g}),t[10]=d,t[11]=g,t[12]=_):_=t[12],_}function rn(e){let{containerRef:t,barScale:n}=S(),[r,i]=(0,$.useState)(!1);(0,$.useEffect)(()=>{i(!0)},[]);let a=t.current;return!(r&&a)||!n?null:/* @__PURE__ */ (0,Q.jsx)(an,{...e,container:a})}const an=(0,$.memo)(function(e){let t=(0,Z.c)(30),{tickerHalfWidth:n,showAllLabels:r,maxLabels:i,container:a}=e,o=n===void 0?50:n,s=r!==void 0&&r,{margin:c,tooltipData:l,barScale:u,bandWidth:d,barXAccessor:f,data:p,innerWidth:m,density:h}=b(),g,_,v;if(t[0]!==d||t[1]!==u||t[2]!==f||t[3]!==p||t[4]!==h||t[5]!==m||t[6]!==c||t[7]!==i||t[8]!==s||t[9]!==o||t[10]!==l){let e=Y(h,`x`,i),n;bb0:{if(!(u&&d&&f)){n=[];break bb0}let r;t[14]!==d||t[15]!==u||t[16]!==f||t[17]!==c?(r=e=>{let t=f(e);return{label:t,x:(u(t)??0)+d/2+c.left}},t[14]=d,t[15]=u,t[16]=f,t[17]=c,t[18]=r):r=t[18];let i=p.map(r);if(s){n=i;break bb0}let a=qe(Je(i.map(on)));n=Ye({length:i.length,availablePx:m,requestedMax:e,resolveXPx:e=>{let t=i[e];return t?t.x-c.left:0},slotPx:a}).flatMap(e=>{let t=i[e];return t?[t]:[]})}let r=n,a=l!==null,y=l?l.x+c.left:null;v=tn.createPortal,g=`pointer-events-none absolute inset-0`;let b;t[19]!==y||t[20]!==a||t[21]!==o?(b=e=>/* @__PURE__ */ (0,Q.jsx)(nn,{crosshairX:y,isHovering:a,label:e.label,tickerHalfWidth:o,x:e.x},`${e.label}-${e.x}`),t[19]=y,t[20]=a,t[21]=o,t[22]=b):b=t[22],_=r.map(b),t[0]=d,t[1]=u,t[2]=f,t[3]=p,t[4]=h,t[5]=m,t[6]=c,t[7]=i,t[8]=s,t[9]=o,t[10]=l,t[11]=g,t[12]=_,t[13]=v}else g=t[11],_=t[12],v=t[13];let y;t[23]!==g||t[24]!==_?(y=/* @__PURE__ */ (0,Q.jsx)(`div`,{className:g,children:_}),t[23]=g,t[24]=_,t[25]=y):y=t[25];let x;return t[26]!==a||t[27]!==v||t[28]!==y?(x=v(y,a),t[26]=a,t[27]=v,t[28]=y,t[29]=x):x=t[29],x});rn.displayName=`BarXAxis`;function on(e){return e.label}function sn(e){let t=(0,Z.c)(29),{label:n,y:r,bandHeight:o,isHovered:s,maxWidth:c,gap:l,align:u,labelClassName:d}=e,f=u===`start`,p=f?`left-0 justify-start`:`right-0 justify-end`,m=!f&&l==null&&`pr-2`,h;t[0]!==p||t[1]!==m?(h=i(`absolute flex items-center`,p,m),t[0]=p,t[1]=m,t[2]=h):h=t[2];let g=f?c:void 0,_=f||l==null?void 0:l,v;t[3]!==o||t[4]!==g||t[5]!==_||t[6]!==r?(v={top:r,height:o,width:g,paddingRight:_},t[3]=o,t[4]=g,t[5]=_,t[6]=r,t[7]=v):v=t[7];let y;t[8]!==s||t[9]!==d?(y=d?{opacity:1}:{opacity:s?1:.7,color:s?`var(--chart-foreground)`:`var(--chart-label, var(--color-text-soft))`},t[8]=s,t[9]=d,t[10]=y):y=t[10];let b=d??`pui-text-body-small-alt`,x=f?`text-left`:`text-right`,S;t[11]!==b||t[12]!==x?(S=i(b,`truncate whitespace-nowrap`,x),t[11]=b,t[12]=x,t[13]=S):S=t[13];let C;t[14]===d?C=t[15]:(C=d?{opacity:1}:{opacity:.7,color:`var(--chart-label, var(--color-text-soft))`},t[14]=d,t[15]=C);let w;t[16]===c?w=t[17]:(w={maxWidth:c},t[16]=c,t[17]=w);let T;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(T={duration:.15},t[18]=T):T=t[18];let E;t[19]!==n||t[20]!==S||t[21]!==C||t[22]!==w||t[23]!==y?(E=/* @__PURE__ */ (0,Q.jsx)(a.span,{animate:y,className:S,initial:C,style:w,transition:T,children:n}),t[19]=n,t[20]=S,t[21]=C,t[22]=w,t[23]=y,t[24]=E):E=t[24];let D;return t[25]!==E||t[26]!==h||t[27]!==v?(D=/* @__PURE__ */ (0,Q.jsx)(`div`,{className:h,style:v,children:E}),t[25]=E,t[26]=h,t[27]=v,t[28]=D):D=t[28],D}function cn(e){let{containerRef:t,barScale:n}=S(),[r,i]=(0,$.useState)(!1);(0,$.useEffect)(()=>{i(!0)},[]);let a=t.current;return!(r&&a)||!n?null:/* @__PURE__ */ (0,Q.jsx)(ln,{...e,container:a})}const ln=(0,$.memo)(function(e){let t=(0,Z.c)(40),{showAllLabels:n,maxLabels:r,labelMaxWidth:i,labelGap:a,align:o,labelClassName:s,container:c}=e,l=i===void 0?70:i,u=o===void 0?`end`:o,{margin:d,barScale:f,bandWidth:p,barXAccessor:m,data:h,hoveredBarIndex:g,innerHeight:_,density:v}=b(),y,x,S,C;if(t[0]!==u||t[1]!==p||t[2]!==f||t[3]!==m||t[4]!==h||t[5]!==v||t[6]!==g||t[7]!==_||t[8]!==s||t[9]!==a||t[10]!==l||t[11]!==d.left||t[12]!==d.top||t[13]!==r||t[14]!==n){let e=Y(v,`y`,r),i=n??(v==null||v===`large`),o;bb0:{if(!(f&&p&&m)){o=[];break bb0}let n;t[19]!==p||t[20]!==f||t[21]!==m||t[22]!==d.top?(n=(e,t)=>{let n=m(e);return{label:n,y:(f(n)??0)+d.top,bandHeight:p,index:t}},t[19]=p,t[20]=f,t[21]=m,t[22]=d.top,t[23]=n):n=t[23];let r=h.map(n);if(i){o=r;break bb0}o=Ye({length:r.length,availablePx:_,requestedMax:e,resolveXPx:e=>{let t=r[e];return t?t.y-d.top:0},slotPx:20}).flatMap(e=>{let t=r[e];return t?[t]:[]})}let c=o;C=tn.createPortal,y=`pointer-events-none absolute top-0 bottom-0`,t[24]===d.left?x=t[25]:(x={left:0,width:d.left},t[24]=d.left,t[25]=x);let b;t[26]!==u||t[27]!==g||t[28]!==s||t[29]!==a||t[30]!==l?(b=e=>/* @__PURE__ */ (0,Q.jsx)(sn,{align:u,bandHeight:e.bandHeight,gap:a,isHovered:g===e.index,label:e.label,labelClassName:s,maxWidth:l,y:e.y},`${e.label}-${e.y}`),t[26]=u,t[27]=g,t[28]=s,t[29]=a,t[30]=l,t[31]=b):b=t[31],S=c.map(b),t[0]=u,t[1]=p,t[2]=f,t[3]=m,t[4]=h,t[5]=v,t[6]=g,t[7]=_,t[8]=s,t[9]=a,t[10]=l,t[11]=d.left,t[12]=d.top,t[13]=r,t[14]=n,t[15]=y,t[16]=x,t[17]=S,t[18]=C}else y=t[15],x=t[16],S=t[17],C=t[18];let w;t[32]!==y||t[33]!==x||t[34]!==S?(w=/* @__PURE__ */ (0,Q.jsx)(`div`,{className:y,style:x,children:S}),t[32]=y,t[33]=x,t[34]=S,t[35]=w):w=t[35];let T;return t[36]!==c||t[37]!==C||t[38]!==w?(T=C(w,c),t[36]=c,t[37]=C,t[38]=w,t[39]=T):T=t[39],T});cn.displayName=`BarYAxis`;export{ot as Background,Wt as Bar,Pt as BarChart,It as BarChartLoading,en as BarColumnTrack,N as BarLoadingSkeleton,Lt as BarReferenceLine,Zt as BarSquares,rn as BarXAxis,cn as BarYAxis,Se as CHART_CLIP_PASSTHROUGH,ce as CHART_DENSITY,ae as CHART_DENSITY_IDS,K as ChartConfigProvider,q as ChartLegendHoverProvider,fe as ChartLoadingLabel,H as ChartMarkers,T as ChartProvider,z as ChartRevealClip,pt as ChartTooltip,l as DEFAULT_ANIMATION_DURATION_MS,s as DEFAULT_ANIMATION_EASING,W as DEFAULT_CHART_CONFIG,se as DEFAULT_CHART_DENSITY,c as DEFAULT_CHART_ENTER_TRANSITION,me as DEFAULT_CHART_LIFECYCLE,de as DEFAULT_CHART_STATUS,v as DEFAULT_Y_AXIS_ID,X as DEFAULT_Y_DOMAIN_TWEEN_MS,st as DateTicker,p as Grid,M as LineLoadingSweep,P as MarkerGroup,L as MarkerTooltipContent,at as PATTERN_PRESET_IDS,I as PatternArea,nt as PatternCircles,it as PatternHexagons,Qe as PatternLines,et as PatternWaves,D as ProjectionLine,E as ProjectionLineEndMarker,mt as ReferenceArea,ne as SeriesMarkers,J as SeriesPointMarker,pe as ShimmeringText,A as StaticChartPreviewProvider,bt as TooltipBox,xt as TooltipContent,ct as TooltipDot,dt as TooltipIndicator,Xe as XAxis,yt as YAxis,_t as Y_AXIS_DEFAULT_TICK_COUNT,vt as Y_AXIS_MAX_TICK_COUNT,gt as Y_AXIS_MIN_TICK_COUNT,Oe as buildHorizontalTangentBezierPath,Fe as buildProjectionPath,x as chartCssVars,Pe as clampHoverIndexToMaxTime,ke as clampPixelXToProjectionHoverMax,Te as computeProjectionAnchorTangentSlope,kt as computeSquareColumn,He as computeYDomainsByAxis,C as defaultScatterColors,Me as extractProjectionLineConfigs,j as generateChartSkeletonData,m as getPrimaryYScale,te as getSeriesMarkerVisualExtent,O as getSkeletonHeights,ut as indicatorFadeGradientStops,ue as isChartInteractionPhase,tt as isCirclePattern,rt as isCirclesPattern,Ie as isLoadingChromePhase,Le as isYDomainTweenPhase,Je as measureMaxLabelWidthPx,De as mergeProjectionXDomainMax,Ce as mergeProjectionYDomain,ze as mergeYDomainRecords,We as niceYDomain,$e as patternPresetTileSize,Ee as projectionDateExtents,Ae as projectionHoverMaxBySeries,Ne as projectionHoverMaxTime,we as projectionPinnedOverlayX,je as projectionValueExtents,Ze as renderPatternPreset,ie as resolveChartMargin,Y as resolveDensityMaxLabels,oe as resolveDensityTickCount,le as resolveRestingChartPhase,G as resolveTooltipBoxMotion,ft as resolveVerticalFadeSides,Ke as resolveYAxisMarginPx,ht as resolveYAxisTickCount,Ve as shouldTweenYDomain,At as topSquareCenterY,B as useActiveMarkers,V as useAnimatedYDomains,b as useChart,U as useChartConfig,y as useChartHover,k as useChartInteraction,ee as useChartLegendHover,S as useChartStable,F as useStaticChartPreview,w as useYScale};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"../../../_chunks/rolldown-runtime-B0Z9INg1.js";import{t}from"../../../_chunks/react-BcFqt3h5.js";import{t as n}from"../../../_chunks/compiler-runtime-Br_I-bNG.js";import{t as r}from"../../../_chunks/jsx-runtime-CNz6huh3.js";import{t as i}from"../../../_chunks/dist-hovC-tlK.js";import{n as a}from"../../../_chunks/react-pnTbDyGB.js";import{n as o,r as s,t as c}from"../../../_chunks/animation-D8IqP_32.js";import{t as l}from"../../../_chunks/linear-Bx9uzvr3.js";import{t as u}from"../../../_chunks/time-CK8DWS0P.js";import{t as d}from"../../../_chunks/grid-DtZfnOVN.js";import{i as f,s as p,t as m}from"../../../_chunks/y-axis-scales-JGNJ3oYP.js";import{a as h,i as g,n as _,o as v,r as y,s as b,t as x}from"../../../_chunks/chart-context-BXECNDNl.js";import{r as S,t as C}from"../../../_chunks/projection-line-qJfy22Rn.js";import{_ as w,a as T,c as E,d as D,g as O,h as k,i as A,l as j,m as M,n as N,p as P,r as F,s as I,t as L}from"../../../_chunks/chart-markers-D2vAxxz8.js";import{i as R,n as z,r as ee,t as te}from"../../../_chunks/chart-config-context-DjCufEb2.js";import{n as ne,t as re}from"../../../_chunks/chart-legend-hover-TZ_1t9hC.js";import{i as ie,n as ae,t as oe}from"../../../_chunks/series-markers-Cc2cS6gp.js";import{a as se}from"../../../_chunks/chart-formatters-C23Gt1wa.js";import{a as ce,i as le,n as ue,o as de,r as fe,t as pe}from"../../../_chunks/chart-density-Dm5sAroN.js";import{a as me,i as he,n as ge,o as _e,r as B,s as V,t as ve}from"../../../_chunks/chart-phase-oX99XcEO.js";import{a as ye,i as be,o as xe,t as H}from"../../../_chunks/chart-child-passthrough-L3xNi0fN.js";import{a as U,c as W,d as G,f as Se,i as Ce,l as we,n as Te,o as Ee,p as K,r as q,s as De,t as J,u as Y}from"../../../_chunks/projection-config-DO6vzrLI.js";import{a as X,c as Oe,l as ke,p as Ae,r as je,u as Me}from"../../../_chunks/y-domain-utils-BQs45POG.js";import{a as Ne,n as Pe,t as Fe}from"../../../_chunks/x-axis-BPVhMFoB.js";import{a as Ie,c as Le,i as Re,l as ze,n as Be,o as Ve,r as He,s as Ue,t as We}from"../../../_chunks/pattern-preset-BYTG3Sn4.js";import{t as Ge}from"../../../_chunks/background-CYeyUUjW.js";import{a as Ke,i as qe,o as Je,r as Ye,s as Xe,t as Ze}from"../../../_chunks/chart-tooltip-L0grgDEh.js";import{t as Qe}from"../../../_chunks/reference-area-Bnwi9gJk.js";import{a as $e,i as et,n as tt,r as nt,t as rt}from"../../../_chunks/y-axis-BcBZf0OU.js";import{t as it}from"../../../_chunks/tooltip-box-DDr_WNoq.js";import{t as at}from"../../../_chunks/tooltip-content-BZh0nIAz.js";import{r as ot,t as st}from"../../../_chunks/decimate-time-series-x2tNinEL.js";import{t as ct}from"../../../_chunks/reference-area-config-3tJB6RT1.js";import{t as lt}from"../../../_chunks/ParentSize-tno5okh0.js";import{t as ut}from"../../../_chunks/motion-utils-FSUhZgF9.js";var Z=n(),Q=/* @__PURE__ */ e(r(),1),$=/* @__PURE__ */ e(t(),1);const dt={top:40,right:40,bottom:40,left:40};function ft(e){let t=(0,Z.c)(2),{width:n,height:r}=e;if(n<10||r<10)return null;let i;return t[0]===e?i=t[1]:(i=/* @__PURE__ */ (0,Q.jsx)(pt,{...e}),t[0]=e,t[1]=i),i}const pt=(0,$.memo)(function(e){let t=(0,Z.c)(47),{width:n,height:r,data:i,xDataKey:a,margin:o,animationDuration:s,enterTransition:c,revealSignature:d,candleGap:f,candleWidthProp:m,xDomain:h,xDomainSlotCount:g,children:_,containerRef:v}=e,y=d===void 0?``:d,[b,S]=(0,$.useState)(!1),[C,w]=(0,$.useState)(0),E=n-o.left-o.right,D=r-o.top-o.bottom,O;t[0]===a?O=t[1]:(O=e=>{let t=e[a];return t instanceof Date?t:new Date(t)},t[0]=a,t[1]=O);let k=O,A=h&&g!=null?g:i.length,j=E/Math.max(A,1),M=h?h[0].getTime():Math.min(...i.map(e=>k(e).getTime())),N=h?h[1].getTime():Math.max(...i.map(e=>k(e).getTime())),P=j/2,F=u({range:[P,E-P],domain:[M,N]}),I=1/0,L=-1/0;for(let e of i){let t=e.low,n=e.high;typeof t==`number`&&t<I&&(I=t),typeof n==`number`&&n>L&&(L=n)}I===1/0&&(I=0),L===-1/0&&(L=100);let R=(L-I)*.05||1,z=l({range:[D,0],domain:[I-R,L+R],nice:!0}),ee=j,te=m??j*(1-f),ne=[{dataKey:`close`,stroke:`var(--chart-line-primary)`,strokeWidth:0}],re;t[2]!==i||t[3]!==E?(re=st(i,ot(E)),t[2]=i,t[3]=E,t[4]=re):re=t[4];let ie=re,ae;if(t[5]!==i||t[6]!==k){let e;t[8]===k?e=t[9]:(e=e=>se.format(k(e)),t[8]=k,t[9]=e),ae=i.map(e),t[5]=i,t[6]=k,t[7]=ae}else ae=t[7];let oe=ae,ce;t[10]===s?ce=t[11]:(ce=()=>{w(ht),S(!1);let e=setTimeout(()=>S(!0),s);return()=>clearTimeout(e)},t[10]=s,t[11]=ce);let le;t[12]!==s||t[13]!==y?(le=[s,y],t[12]=s,t[13]=y,t[14]=le):le=t[14],(0,$.useEffect)(ce,le);let{tooltipData:ue,setTooltipData:de,selection:fe,clearSelection:pe,interactionHandlers:me,interactionStyle:he}=T({xScale:F,yScale:z,yScales:p(z),data:i,lines:ne,margin:o,xAccessor:k,canInteract:b}),ge=ue?.index??null,_e=gt,B,V,H,U,W,G;t[15]===_?(B=t[16],V=t[17],H=t[18],U=t[19],W=t[20],G=t[21]):(V=[],B=[],G=[],U=[],H=[],$.Children.forEach(_,e=>{(0,$.isValidElement)(e)&&(_e(e)?V.push(e):ye(e)?H.push(e):be(e)?B.push(e):xe(e)?G.push(e):U.push(e))}),W=ct(_),t[15]=_,t[16]=B,t[17]=V,t[18]=H,t[19]=U,t[20]=W,t[21]=G);let Se=W,Ce=p(z),we={...ve,data:i,renderData:ie,xScale:F,yScale:z,yScales:Ce,width:n,height:r,innerWidth:E,innerHeight:D,margin:o,columnWidth:ee,tooltipData:ue,setTooltipData:de,containerRef:v,lines:ne,referenceAreas:Se,isLoaded:b,animationDuration:s,enterTransition:c,revealEpoch:C,xAccessor:k,dateLabels:oe,selection:fe??null,clearSelection:pe,bandWidth:te,hoveredCandleIndex:ge,xScaleType:`time`},Te;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(Te=/* @__PURE__ */ (0,Q.jsxs)(`linearGradient`,{id:`candlestick-positive`,x1:`0`,x2:`0`,y1:`1`,y2:`0`,children:[/* @__PURE__ */ (0,Q.jsx)(`stop`,{offset:`0%`,stopColor:`var(--chart-3)`}),/* @__PURE__ */ (0,Q.jsx)(`stop`,{offset:`100%`,stopColor:`var(--chart-3)`})]}),t[22]=Te):Te=t[22];let Ee;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=/* @__PURE__ */ (0,Q.jsxs)(`linearGradient`,{id:`candlestick-negative`,x1:`0`,x2:`0`,y1:`1`,y2:`0`,children:[/* @__PURE__ */ (0,Q.jsx)(`stop`,{offset:`0%`,stopColor:`var(--chart-2)`}),/* @__PURE__ */ (0,Q.jsx)(`stop`,{offset:`100%`,stopColor:`var(--chart-2)`})]}),t[23]=Ee):Ee=t[23];let K;t[24]===V?K=t[25]:(K=/* @__PURE__ */ (0,Q.jsxs)(`defs`,{children:[Te,Ee,V]}),t[24]=V,t[25]=K);let q;t[26]!==r||t[27]!==n?(q=/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:`transparent`,height:r,width:n,x:0,y:0}),t[26]=r,t[27]=n,t[28]=q):q=t[28];let De=`translate(${o.left},${o.top})`,J;t[29]!==D||t[30]!==E?(J=/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:`transparent`,height:D,width:E,x:0,y:0}),t[29]=D,t[30]=E,t[31]=J):J=t[31];let Y;t[32]!==B||t[33]!==me||t[34]!==he||t[35]!==H||t[36]!==U||t[37]!==De||t[38]!==J||t[39]!==G?(Y=/* @__PURE__ */ (0,Q.jsxs)(`g`,{...me,style:he,transform:De,children:[J,B,G,U,H]}),t[32]=B,t[33]=me,t[34]=he,t[35]=H,t[36]=U,t[37]=De,t[38]=J,t[39]=G,t[40]=Y):Y=t[40];let X;return t[41]!==r||t[42]!==K||t[43]!==q||t[44]!==Y||t[45]!==n?(X=/* @__PURE__ */ (0,Q.jsxs)(`svg`,{"aria-hidden":`true`,height:r,width:n,children:[K,q,Y]}),t[41]=r,t[42]=K,t[43]=q,t[44]=Y,t[45]=n,t[46]=X):X=t[46],/* @__PURE__ */ (0,Q.jsx)(x,{value:we,children:X})});function mt(e){let t=(0,Z.c)(23),{data:n,xDataKey:r,margin:a,animationDuration:o,enterTransition:s,revealSignature:c,aspectRatio:l,className:u,style:d,candleGap:f,candleWidth:p,xDomain:m,xDomainSlotCount:h,children:g}=e,_=r===void 0?`date`:r,v=o===void 0?1100:o,y=l===void 0?`2 / 1`:l,b=u===void 0?``:u,x=f===void 0?.2:f,S=(0,$.useRef)(null),C;t[0]===a?C=t[1]:(C={...dt,...a},t[0]=a,t[1]=C);let w=C,T=n,E;t[2]===b?E=t[3]:(E=i(`relative w-full`,b),t[2]=b,t[3]=E);let D;t[4]!==y||t[5]!==d?(D={aspectRatio:y,touchAction:`none`,...d},t[4]=y,t[5]=d,t[6]=D):D=t[6];let O;t[7]!==v||t[8]!==x||t[9]!==p||t[10]!==g||t[11]!==T||t[12]!==s||t[13]!==w||t[14]!==c||t[15]!==_||t[16]!==m||t[17]!==h?(O=/* @__PURE__ */ (0,Q.jsx)(lt,{debounceTime:10,children:e=>{let{width:t,height:n}=e;return/* @__PURE__ */ (0,Q.jsx)(ft,{animationDuration:v,candleGap:x,candleWidthProp:p,containerRef:S,data:T,enterTransition:s,height:n,margin:w,revealSignature:c,width:t,xDataKey:_,xDomain:m,xDomainSlotCount:h,children:g})}}),t[7]=v,t[8]=x,t[9]=p,t[10]=g,t[11]=T,t[12]=s,t[13]=w,t[14]=c,t[15]=_,t[16]=m,t[17]=h,t[18]=O):O=t[18];let k;return t[19]!==E||t[20]!==D||t[21]!==O?(k=/* @__PURE__ */ (0,Q.jsx)(`div`,{className:E,ref:S,style:D,children:O}),t[19]=E,t[20]=D,t[21]=O,t[22]=k):k=t[22],k}function ht(e){return e+1}function gt(e){let t=e.type?.displayName||e.type?.name||``;return t.includes(`Gradient`)||t.includes(`Pattern`)||t===`LinearGradient`||t===`RadialGradient`||t===`Lines`||t===`PatternLines`}const _t=1.5;function vt(e){return e?`var(--chart-3)`:`var(--chart-2)`}function yt(e,t,n,r,i,a,o,s,c,l){return e.map(e=>{let u=r(e),d=e.open,f=e.high,p=e.low,m=e.close,h=t(u)??0,g=n(f)??0,_=n(p)??0,v=n(d)??0,y=n(m)??0,b=Math.min(v,y),x=Math.abs(y-v)||1,S=h-i/2,C=Math.min(g,_),w=Math.abs(_-g)||1,T=m>=d,E=T?a:o,D=T?s:c,O=!!D,k=O?vt(T):E;return{time:u.getTime(),centerX:h,bodyTop:b,bodyHeight:x,bodyLeft:S,candleWidth:i,wickTop:C,wickHeight:w,wickLeft:h-_t/2,bodySolidFill:k,wickFill:O?k:E,bodyPattern:O?D:void 0,insideStrokeWidth:l,isPositive:T}})}function bt(e,t,n,r){return n===null?r!==null&&e.time!==r?t:1:n===0&&!e.isPositive||n===1&&e.isPositive?t:1}const xt=(0,$.memo)(function(e){let t=(0,Z.c)(29),{geometry:n}=e,{wickLeft:r,wickTop:i,wickHeight:a,wickFill:o,bodyLeft:s,bodyTop:c,bodyHeight:l,candleWidth:u,bodySolidFill:d,bodyPattern:f,insideStrokeWidth:p}=n,m;t[0]!==o||t[1]!==a||t[2]!==r||t[3]!==i?(m=/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:o,height:a,width:_t,x:r,y:i}),t[0]=o,t[1]=a,t[2]=r,t[3]=i,t[4]=m):m=t[4];let h;t[5]!==l||t[6]!==s||t[7]!==d||t[8]!==c||t[9]!==u?(h=/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:d,height:l,rx:1,ry:1,stroke:d,strokeWidth:1,width:u,x:s,y:c}),t[5]=l,t[6]=s,t[7]=d,t[8]=c,t[9]=u,t[10]=h):h=t[10];let g;t[11]!==l||t[12]!==s||t[13]!==f||t[14]!==c||t[15]!==u?(g=f?/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:f,height:l,rx:1,ry:1,width:u,x:s,y:c}):null,t[11]=l,t[12]=s,t[13]=f,t[14]=c,t[15]=u,t[16]=g):g=t[16];let _;t[17]!==l||t[18]!==s||t[19]!==d||t[20]!==c||t[21]!==u||t[22]!==p?(_=p>0?/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:`none`,height:l-p,rx:1,ry:1,stroke:d,strokeWidth:p,width:u-p,x:s+p/2,y:c+p/2}):null,t[17]=l,t[18]=s,t[19]=d,t[20]=c,t[21]=u,t[22]=p,t[23]=_):_=t[23];let v;return t[24]!==m||t[25]!==h||t[26]!==g||t[27]!==_?(v=/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[m,h,g,_]}),t[24]=m,t[25]=h,t[26]=g,t[27]=_,t[28]=v):v=t[28],v}),St=(0,$.memo)(function(e){let t=(0,Z.c)(11),{geometries:n,fadedOpacity:r,legendHoveredIndex:i,hoveredTime:a}=e,o;if(t[0]!==r||t[1]!==n||t[2]!==a||t[3]!==i){let e;t[5]!==r||t[6]!==a||t[7]!==i?(e=e=>/* @__PURE__ */ (0,Q.jsx)(`g`,{opacity:bt(e,r,i,a),style:{transition:`opacity 0.15s ease-in-out`},children:/* @__PURE__ */ (0,Q.jsx)(xt,{geometry:e})},e.time),t[5]=r,t[6]=a,t[7]=i,t[8]=e):e=t[8],o=n.map(e),t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o}else o=t[4];let s;return t[9]===o?s=t[10]:(s=/* @__PURE__ */ (0,Q.jsx)(Q.Fragment,{children:o}),t[9]=o,t[10]=s),s});function Ct(e){let t=(0,Z.c)(48),{geometry:n,delay:r,enterTransition:i,revealEpoch:o}=e,s;t[0]!==r||t[1]!==i?(s=ut(i,r),t[0]=r,t[1]=i,t[2]=s):s=t[2];let c=s,l=`${n.centerX}px ${n.bodyTop+n.bodyHeight/2}px`,u=n.wickTop+n.wickHeight/2,d,f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d={opacity:1},f={opacity:0},t[3]=d,t[4]=f):(d=t[3],f=t[4]);let p=`candle-enter-${n.time}-${o}`,m=`${n.centerX}px ${u}px`,h;t[5]===m?h=t[6]:(h={transformOrigin:m},t[5]=m,t[6]=h);let g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g={duration:.15},t[7]=g):g=t[7];let _;t[8]===c?_=t[9]:(_={...c,opacity:g},t[8]=c,t[9]=_);let v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v={scaleY:1},t[10]=v):v=t[10];let y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y={scaleY:0},t[11]=y):y=t[11];let b=`${n.centerX}px ${u}px`,x;t[12]===b?x=t[13]:(x={transformOrigin:b},t[12]=b,t[13]=x);let S;t[14]!==n.wickFill||t[15]!==n.wickHeight||t[16]!==n.wickLeft||t[17]!==n.wickTop||t[18]!==c||t[19]!==x?(S=/* @__PURE__ */ (0,Q.jsx)(a.rect,{animate:v,fill:n.wickFill,height:n.wickHeight,initial:y,style:x,transition:c,width:_t,x:n.wickLeft,y:n.wickTop}),t[14]=n.wickFill,t[15]=n.wickHeight,t[16]=n.wickLeft,t[17]=n.wickTop,t[18]=c,t[19]=x,t[20]=S):S=t[20];let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C={scaleY:1},t[21]=C):C=t[21];let w;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(w={scaleY:0},t[22]=w):w=t[22];let T;t[23]===l?T=t[24]:(T={transformOrigin:l},t[23]=l,t[24]=T);let E;t[25]!==n.bodyHeight||t[26]!==n.bodyLeft||t[27]!==n.bodySolidFill||t[28]!==n.bodyTop||t[29]!==n.candleWidth||t[30]!==c||t[31]!==T?(E=/* @__PURE__ */ (0,Q.jsx)(a.rect,{animate:C,fill:n.bodySolidFill,height:n.bodyHeight,initial:w,rx:1,ry:1,stroke:n.bodySolidFill,strokeWidth:1,style:T,transition:c,width:n.candleWidth,x:n.bodyLeft,y:n.bodyTop}),t[25]=n.bodyHeight,t[26]=n.bodyLeft,t[27]=n.bodySolidFill,t[28]=n.bodyTop,t[29]=n.candleWidth,t[30]=c,t[31]=T,t[32]=E):E=t[32];let D;t[33]!==l||t[34]!==n.bodyHeight||t[35]!==n.bodyLeft||t[36]!==n.bodyPattern||t[37]!==n.bodyTop||t[38]!==n.candleWidth||t[39]!==c?(D=n.bodyPattern?/* @__PURE__ */ (0,Q.jsx)(a.rect,{animate:{scaleY:1},fill:n.bodyPattern,height:n.bodyHeight,initial:{scaleY:0},rx:1,ry:1,style:{transformOrigin:l},transition:c,width:n.candleWidth,x:n.bodyLeft,y:n.bodyTop}):null,t[33]=l,t[34]=n.bodyHeight,t[35]=n.bodyLeft,t[36]=n.bodyPattern,t[37]=n.bodyTop,t[38]=n.candleWidth,t[39]=c,t[40]=D):D=t[40];let O;return t[41]!==S||t[42]!==E||t[43]!==D||t[44]!==p||t[45]!==h||t[46]!==_?(O=/* @__PURE__ */ (0,Q.jsxs)(a.g,{animate:d,initial:f,style:h,transition:_,children:[S,E,D]},p),t[41]=S,t[42]=E,t[43]=D,t[44]=p,t[45]=h,t[46]=_,t[47]=O):O=t[47],O}function wt(e){let t=(0,Z.c)(49),{animate:n,positiveFill:r,negativeFill:i,bodyPatternPositive:a,bodyPatternNegative:o,insideStrokeWidth:s,fadedOpacity:c,showHoverFade:l}=e,u=n===void 0||n,d=r===void 0?`url(#candlestick-positive)`:r,f=i===void 0?`url(#candlestick-negative)`:i,p=s===void 0?0:s,m=c===void 0?.3:c,h=l===void 0||l,{data:_,xScale:v,yScale:y,xAccessor:b,animationDuration:x,enterTransition:S,revealEpoch:C,isLoaded:w,bandWidth:T,columnWidth:E,hoveredCandleIndex:D}=g(),O=C===void 0?0:C,{hoveredIndex:k}=ne(),A=Math.min(T??E*.8,E),j,M,N,P;if(t[0]!==u||t[1]!==x||t[2]!==o||t[3]!==a||t[4]!==A||t[5]!==_||t[6]!==S||t[7]!==D||t[8]!==p||t[9]!==w||t[10]!==f||t[11]!==d||t[12]!==O||t[13]!==b||t[14]!==v||t[15]!==y){P=Symbol.for(`react.early_return_sentinel`);bb0:{j=yt(_,v,y,b,A,d,f,a,o,p);let e=D==null?void 0:_[D],n;t[20]!==e||t[21]!==b?(n=e?b(e).getTime():null,t[20]=e,t[21]=b,t[22]=n):n=t[22],N=n;let r;t[23]!==o||t[24]!==a||t[25]!==A||t[26]!==e||t[27]!==p||t[28]!==f||t[29]!==d||t[30]!==b||t[31]!==v||t[32]!==y?(r=e?yt([e],v,y,b,A,d,f,a,o,p)[0]??null:null,t[23]=o,t[24]=a,t[25]=A,t[26]=e,t[27]=p,t[28]=f,t[29]=d,t[30]=b,t[31]=v,t[32]=y,t[33]=r):r=t[33],M=r;let i;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(i={type:`spring`,duration:.8,bounce:.15},t[34]=i):i=t[34];let s=S??i,c=_.length>0?x*.6/_.length:0;if(u&&!w){let e;t[35]!==s||t[36]!==O||t[37]!==c?(e=(e,t)=>/* @__PURE__ */ (0,Q.jsx)(Ct,{delay:t*c/1e3,enterTransition:s,geometry:e,revealEpoch:O},e.time),t[35]=s,t[36]=O,t[37]=c,t[38]=e):e=t[38],P=/* @__PURE__ */ (0,Q.jsx)(`g`,{className:`chart-candlesticks`,children:j.map(e)});break bb0}}t[0]=u,t[1]=x,t[2]=o,t[3]=a,t[4]=A,t[5]=_,t[6]=S,t[7]=D,t[8]=p,t[9]=w,t[10]=f,t[11]=d,t[12]=O,t[13]=b,t[14]=v,t[15]=y,t[16]=j,t[17]=M,t[18]=N,t[19]=P}else j=t[16],M=t[17],N=t[18],P=t[19];if(P!==Symbol.for(`react.early_return_sentinel`))return P;let F=h?N:null,I;t[39]!==m||t[40]!==j||t[41]!==k||t[42]!==F?(I=/* @__PURE__ */ (0,Q.jsx)(St,{fadedOpacity:m,geometries:j,hoveredTime:F,legendHoveredIndex:k}),t[39]=m,t[40]=j,t[41]=k,t[42]=F,t[43]=I):I=t[43];let L;t[44]===M?L=t[45]:(L=M?/* @__PURE__ */ (0,Q.jsx)(`g`,{children:/* @__PURE__ */ (0,Q.jsx)(xt,{geometry:M})}):null,t[44]=M,t[45]=L);let R;return t[46]!==I||t[47]!==L?(R=/* @__PURE__ */ (0,Q.jsxs)(`g`,{className:`chart-candlesticks`,children:[I,L]}),t[46]=I,t[47]=L,t[48]=R):R=t[48],R}wt.displayName=`Candlestick`;export{Ge as Background,k as BarLoadingSkeleton,H as CHART_CLIP_PASSTHROUGH,pe as CHART_DENSITY,ue as CHART_DENSITY_IDS,wt as Candlestick,mt as CandlestickChart,te as ChartConfigProvider,re as ChartLegendHoverProvider,_e as ChartLoadingLabel,L as ChartMarkers,x as ChartProvider,P as ChartRevealClip,Ze as ChartTooltip,c as DEFAULT_ANIMATION_DURATION_MS,o as DEFAULT_ANIMATION_EASING,z as DEFAULT_CHART_CONFIG,fe as DEFAULT_CHART_DENSITY,s as DEFAULT_CHART_ENTER_TRANSITION,ve as DEFAULT_CHART_LIFECYCLE,ge as DEFAULT_CHART_STATUS,m as DEFAULT_Y_AXIS_ID,B as DEFAULT_Y_DOMAIN_TWEEN_MS,Ke as DateTicker,d as Grid,O as LineLoadingSweep,A as MarkerGroup,N as MarkerTooltipContent,We as PATTERN_PRESET_IDS,M as PatternArea,Ve as PatternCircles,Ue as PatternHexagons,Le as PatternLines,ze as PatternWaves,C as ProjectionLine,S as ProjectionLineEndMarker,Qe as ReferenceArea,oe as SeriesMarkers,ae as SeriesPointMarker,V as ShimmeringText,E as StaticChartPreviewProvider,it as TooltipBox,at as TooltipContent,qe as TooltipDot,Ye as TooltipIndicator,Fe as XAxis,rt as YAxis,tt as Y_AXIS_DEFAULT_TICK_COUNT,nt as Y_AXIS_MAX_TICK_COUNT,et as Y_AXIS_MIN_TICK_COUNT,we as buildHorizontalTangentBezierPath,Y as buildProjectionPath,_ as chartCssVars,J as clampHoverIndexToMaxTime,Te as clampPixelXToProjectionHoverMax,G as computeProjectionAnchorTangentSlope,je as computeYDomainsByAxis,y as defaultScatterColors,q as extractProjectionLineConfigs,D as generateChartSkeletonData,f as getPrimaryYScale,ie as getSeriesMarkerVisualExtent,w as getSkeletonHeights,Je as indicatorFadeGradientStops,he as isChartInteractionPhase,Be as isCirclePattern,He as isCirclesPattern,X as isLoadingChromePhase,Oe as isYDomainTweenPhase,Pe as measureMaxLabelWidthPx,Ce as mergeProjectionXDomainMax,U as mergeProjectionYDomain,ke as mergeYDomainRecords,Me as niceYDomain,Re as patternPresetTileSize,Se as projectionDateExtents,Ee as projectionHoverMaxBySeries,De as projectionHoverMaxTime,W as projectionPinnedOverlayX,K as projectionValueExtents,Ie as renderPatternPreset,le as resolveChartMargin,ce as resolveDensityMaxLabels,de as resolveDensityTickCount,me as resolveRestingChartPhase,ee as resolveTooltipBoxMotion,Xe as resolveVerticalFadeSides,Ne as resolveYAxisMarginPx,$e as resolveYAxisTickCount,Ae as shouldTweenYDomain,F as useActiveMarkers,I as useAnimatedYDomains,g as useChart,R as useChartConfig,h as useChartHover,T as useChartInteraction,ne as useChartLegendHover,v as useChartStable,j as useStaticChartPreview,b as useYScale};
|
|
1
|
+
import{a as e}from"../../../_chunks/rolldown-runtime-B0Z9INg1.js";import{t}from"../../../_chunks/react-BcFqt3h5.js";import{t as n}from"../../../_chunks/compiler-runtime-Br_I-bNG.js";import{t as r}from"../../../_chunks/jsx-runtime-CNz6huh3.js";import{t as i}from"../../../_chunks/dist-hovC-tlK.js";import{n as a}from"../../../_chunks/react-pnTbDyGB.js";import{n as o,r as s,t as c}from"../../../_chunks/animation-D8IqP_32.js";import{t as l}from"../../../_chunks/linear-Bx9uzvr3.js";import{t as u}from"../../../_chunks/time-CK8DWS0P.js";import{t as d}from"../../../_chunks/grid-Bg9exNBo.js";import{i as f,s as p,t as m}from"../../../_chunks/y-axis-scales-JGNJ3oYP.js";import{a as h,i as g,n as _,o as v,r as y,s as b,t as x}from"../../../_chunks/chart-context-Bjw_NzAE.js";import{r as S,t as C}from"../../../_chunks/projection-line-pR-NKJB1.js";import{_ as w,a as T,c as E,d as D,g as O,h as k,i as A,l as j,m as M,n as N,p as P,r as F,s as I,t as L}from"../../../_chunks/chart-markers-BLtXtGRE.js";import{i as R,n as z,r as ee,t as te}from"../../../_chunks/chart-config-context-DjCufEb2.js";import{n as ne,t as re}from"../../../_chunks/chart-legend-hover-TZ_1t9hC.js";import{i as ie,n as ae,t as oe}from"../../../_chunks/series-markers-BYXibIP2.js";import{a as se}from"../../../_chunks/chart-formatters-C23Gt1wa.js";import{a as ce,i as le,n as ue,o as de,r as fe,t as pe}from"../../../_chunks/chart-density-Dm5sAroN.js";import{a as me,i as he,n as ge,o as _e,r as B,s as V,t as ve}from"../../../_chunks/chart-phase-oX99XcEO.js";import{a as ye,i as be,o as xe,t as H}from"../../../_chunks/chart-child-passthrough-L3xNi0fN.js";import{a as U,c as W,d as G,f as Se,i as Ce,l as we,n as Te,o as Ee,p as K,r as q,s as De,t as J,u as Y}from"../../../_chunks/projection-config-DO6vzrLI.js";import{a as X,c as Oe,l as ke,p as Ae,r as je,u as Me}from"../../../_chunks/y-domain-utils-BQs45POG.js";import{a as Ne,n as Pe,t as Fe}from"../../../_chunks/x-axis-ByrWoBBx.js";import{a as Ie,c as Le,i as Re,l as ze,n as Be,o as Ve,r as He,s as Ue,t as We}from"../../../_chunks/pattern-preset-BYTG3Sn4.js";import{t as Ge}from"../../../_chunks/background-CJA6Zjoc.js";import{a as Ke,i as qe,o as Je,r as Ye,s as Xe,t as Ze}from"../../../_chunks/chart-tooltip-Q2xwFLCY.js";import{t as Qe}from"../../../_chunks/reference-area-CsmmBmaE.js";import{a as $e,i as et,n as tt,r as nt,t as rt}from"../../../_chunks/y-axis-OF5jnUeL.js";import{t as it}from"../../../_chunks/tooltip-box-9EA8wbsd.js";import{t as at}from"../../../_chunks/tooltip-content-BZh0nIAz.js";import{r as ot,t as st}from"../../../_chunks/decimate-time-series-x2tNinEL.js";import{t as ct}from"../../../_chunks/reference-area-config-3tJB6RT1.js";import{t as lt}from"../../../_chunks/ParentSize-tno5okh0.js";import{t as ut}from"../../../_chunks/motion-utils-FSUhZgF9.js";var Z=n(),Q=/* @__PURE__ */ e(r(),1),$=/* @__PURE__ */ e(t(),1);const dt={top:40,right:40,bottom:40,left:40};function ft(e){let t=(0,Z.c)(2),{width:n,height:r}=e;if(n<10||r<10)return null;let i;return t[0]===e?i=t[1]:(i=/* @__PURE__ */ (0,Q.jsx)(pt,{...e}),t[0]=e,t[1]=i),i}const pt=(0,$.memo)(function(e){let t=(0,Z.c)(47),{width:n,height:r,data:i,xDataKey:a,margin:o,animationDuration:s,enterTransition:c,revealSignature:d,candleGap:f,candleWidthProp:m,xDomain:h,xDomainSlotCount:g,children:_,containerRef:v}=e,y=d===void 0?``:d,[b,S]=(0,$.useState)(!1),[C,w]=(0,$.useState)(0),E=n-o.left-o.right,D=r-o.top-o.bottom,O;t[0]===a?O=t[1]:(O=e=>{let t=e[a];return t instanceof Date?t:new Date(t)},t[0]=a,t[1]=O);let k=O,A=h&&g!=null?g:i.length,j=E/Math.max(A,1),M=h?h[0].getTime():Math.min(...i.map(e=>k(e).getTime())),N=h?h[1].getTime():Math.max(...i.map(e=>k(e).getTime())),P=j/2,F=u({range:[P,E-P],domain:[M,N]}),I=1/0,L=-1/0;for(let e of i){let t=e.low,n=e.high;typeof t==`number`&&t<I&&(I=t),typeof n==`number`&&n>L&&(L=n)}I===1/0&&(I=0),L===-1/0&&(L=100);let R=(L-I)*.05||1,z=l({range:[D,0],domain:[I-R,L+R],nice:!0}),ee=j,te=m??j*(1-f),ne=[{dataKey:`close`,stroke:`var(--chart-line-primary)`,strokeWidth:0}],re;t[2]!==i||t[3]!==E?(re=st(i,ot(E)),t[2]=i,t[3]=E,t[4]=re):re=t[4];let ie=re,ae;if(t[5]!==i||t[6]!==k){let e;t[8]===k?e=t[9]:(e=e=>se.format(k(e)),t[8]=k,t[9]=e),ae=i.map(e),t[5]=i,t[6]=k,t[7]=ae}else ae=t[7];let oe=ae,ce;t[10]===s?ce=t[11]:(ce=()=>{w(ht),S(!1);let e=setTimeout(()=>S(!0),s);return()=>clearTimeout(e)},t[10]=s,t[11]=ce);let le;t[12]!==s||t[13]!==y?(le=[s,y],t[12]=s,t[13]=y,t[14]=le):le=t[14],(0,$.useEffect)(ce,le);let{tooltipData:ue,setTooltipData:de,selection:fe,clearSelection:pe,interactionHandlers:me,interactionStyle:he}=T({xScale:F,yScale:z,yScales:p(z),data:i,lines:ne,margin:o,xAccessor:k,canInteract:b}),ge=ue?.index??null,_e=gt,B,V,H,U,W,G;t[15]===_?(B=t[16],V=t[17],H=t[18],U=t[19],W=t[20],G=t[21]):(V=[],B=[],G=[],U=[],H=[],$.Children.forEach(_,e=>{(0,$.isValidElement)(e)&&(_e(e)?V.push(e):ye(e)?H.push(e):be(e)?B.push(e):xe(e)?G.push(e):U.push(e))}),W=ct(_),t[15]=_,t[16]=B,t[17]=V,t[18]=H,t[19]=U,t[20]=W,t[21]=G);let Se=W,Ce=p(z),we={...ve,data:i,renderData:ie,xScale:F,yScale:z,yScales:Ce,width:n,height:r,innerWidth:E,innerHeight:D,margin:o,columnWidth:ee,tooltipData:ue,setTooltipData:de,containerRef:v,lines:ne,referenceAreas:Se,isLoaded:b,animationDuration:s,enterTransition:c,revealEpoch:C,xAccessor:k,dateLabels:oe,selection:fe??null,clearSelection:pe,bandWidth:te,hoveredCandleIndex:ge,xScaleType:`time`},Te;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(Te=/* @__PURE__ */ (0,Q.jsxs)(`linearGradient`,{id:`candlestick-positive`,x1:`0`,x2:`0`,y1:`1`,y2:`0`,children:[/* @__PURE__ */ (0,Q.jsx)(`stop`,{offset:`0%`,stopColor:`var(--chart-3)`}),/* @__PURE__ */ (0,Q.jsx)(`stop`,{offset:`100%`,stopColor:`var(--chart-3)`})]}),t[22]=Te):Te=t[22];let Ee;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=/* @__PURE__ */ (0,Q.jsxs)(`linearGradient`,{id:`candlestick-negative`,x1:`0`,x2:`0`,y1:`1`,y2:`0`,children:[/* @__PURE__ */ (0,Q.jsx)(`stop`,{offset:`0%`,stopColor:`var(--chart-2)`}),/* @__PURE__ */ (0,Q.jsx)(`stop`,{offset:`100%`,stopColor:`var(--chart-2)`})]}),t[23]=Ee):Ee=t[23];let K;t[24]===V?K=t[25]:(K=/* @__PURE__ */ (0,Q.jsxs)(`defs`,{children:[Te,Ee,V]}),t[24]=V,t[25]=K);let q;t[26]!==r||t[27]!==n?(q=/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:`transparent`,height:r,width:n,x:0,y:0}),t[26]=r,t[27]=n,t[28]=q):q=t[28];let De=`translate(${o.left},${o.top})`,J;t[29]!==D||t[30]!==E?(J=/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:`transparent`,height:D,width:E,x:0,y:0}),t[29]=D,t[30]=E,t[31]=J):J=t[31];let Y;t[32]!==B||t[33]!==me||t[34]!==he||t[35]!==H||t[36]!==U||t[37]!==De||t[38]!==J||t[39]!==G?(Y=/* @__PURE__ */ (0,Q.jsxs)(`g`,{...me,style:he,transform:De,children:[J,B,G,U,H]}),t[32]=B,t[33]=me,t[34]=he,t[35]=H,t[36]=U,t[37]=De,t[38]=J,t[39]=G,t[40]=Y):Y=t[40];let X;return t[41]!==r||t[42]!==K||t[43]!==q||t[44]!==Y||t[45]!==n?(X=/* @__PURE__ */ (0,Q.jsxs)(`svg`,{"aria-hidden":`true`,height:r,width:n,children:[K,q,Y]}),t[41]=r,t[42]=K,t[43]=q,t[44]=Y,t[45]=n,t[46]=X):X=t[46],/* @__PURE__ */ (0,Q.jsx)(x,{value:we,children:X})});function mt(e){let t=(0,Z.c)(23),{data:n,xDataKey:r,margin:a,animationDuration:o,enterTransition:s,revealSignature:c,aspectRatio:l,className:u,style:d,candleGap:f,candleWidth:p,xDomain:m,xDomainSlotCount:h,children:g}=e,_=r===void 0?`date`:r,v=o===void 0?1100:o,y=l===void 0?`2 / 1`:l,b=u===void 0?``:u,x=f===void 0?.2:f,S=(0,$.useRef)(null),C;t[0]===a?C=t[1]:(C={...dt,...a},t[0]=a,t[1]=C);let w=C,T=n,E;t[2]===b?E=t[3]:(E=i(`relative w-full`,b),t[2]=b,t[3]=E);let D;t[4]!==y||t[5]!==d?(D={aspectRatio:y,touchAction:`none`,...d},t[4]=y,t[5]=d,t[6]=D):D=t[6];let O;t[7]!==v||t[8]!==x||t[9]!==p||t[10]!==g||t[11]!==T||t[12]!==s||t[13]!==w||t[14]!==c||t[15]!==_||t[16]!==m||t[17]!==h?(O=/* @__PURE__ */ (0,Q.jsx)(lt,{debounceTime:10,children:e=>{let{width:t,height:n}=e;return/* @__PURE__ */ (0,Q.jsx)(ft,{animationDuration:v,candleGap:x,candleWidthProp:p,containerRef:S,data:T,enterTransition:s,height:n,margin:w,revealSignature:c,width:t,xDataKey:_,xDomain:m,xDomainSlotCount:h,children:g})}}),t[7]=v,t[8]=x,t[9]=p,t[10]=g,t[11]=T,t[12]=s,t[13]=w,t[14]=c,t[15]=_,t[16]=m,t[17]=h,t[18]=O):O=t[18];let k;return t[19]!==E||t[20]!==D||t[21]!==O?(k=/* @__PURE__ */ (0,Q.jsx)(`div`,{className:E,ref:S,style:D,children:O}),t[19]=E,t[20]=D,t[21]=O,t[22]=k):k=t[22],k}function ht(e){return e+1}function gt(e){let t=e.type?.displayName||e.type?.name||``;return t.includes(`Gradient`)||t.includes(`Pattern`)||t===`LinearGradient`||t===`RadialGradient`||t===`Lines`||t===`PatternLines`}const _t=1.5;function vt(e){return e?`var(--chart-3)`:`var(--chart-2)`}function yt(e,t,n,r,i,a,o,s,c,l){return e.map(e=>{let u=r(e),d=e.open,f=e.high,p=e.low,m=e.close,h=t(u)??0,g=n(f)??0,_=n(p)??0,v=n(d)??0,y=n(m)??0,b=Math.min(v,y),x=Math.abs(y-v)||1,S=h-i/2,C=Math.min(g,_),w=Math.abs(_-g)||1,T=m>=d,E=T?a:o,D=T?s:c,O=!!D,k=O?vt(T):E;return{time:u.getTime(),centerX:h,bodyTop:b,bodyHeight:x,bodyLeft:S,candleWidth:i,wickTop:C,wickHeight:w,wickLeft:h-_t/2,bodySolidFill:k,wickFill:O?k:E,bodyPattern:O?D:void 0,insideStrokeWidth:l,isPositive:T}})}function bt(e,t,n,r){return n===null?r!==null&&e.time!==r?t:1:n===0&&!e.isPositive||n===1&&e.isPositive?t:1}const xt=(0,$.memo)(function(e){let t=(0,Z.c)(29),{geometry:n}=e,{wickLeft:r,wickTop:i,wickHeight:a,wickFill:o,bodyLeft:s,bodyTop:c,bodyHeight:l,candleWidth:u,bodySolidFill:d,bodyPattern:f,insideStrokeWidth:p}=n,m;t[0]!==o||t[1]!==a||t[2]!==r||t[3]!==i?(m=/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:o,height:a,width:_t,x:r,y:i}),t[0]=o,t[1]=a,t[2]=r,t[3]=i,t[4]=m):m=t[4];let h;t[5]!==l||t[6]!==s||t[7]!==d||t[8]!==c||t[9]!==u?(h=/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:d,height:l,rx:1,ry:1,stroke:d,strokeWidth:1,width:u,x:s,y:c}),t[5]=l,t[6]=s,t[7]=d,t[8]=c,t[9]=u,t[10]=h):h=t[10];let g;t[11]!==l||t[12]!==s||t[13]!==f||t[14]!==c||t[15]!==u?(g=f?/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:f,height:l,rx:1,ry:1,width:u,x:s,y:c}):null,t[11]=l,t[12]=s,t[13]=f,t[14]=c,t[15]=u,t[16]=g):g=t[16];let _;t[17]!==l||t[18]!==s||t[19]!==d||t[20]!==c||t[21]!==u||t[22]!==p?(_=p>0?/* @__PURE__ */ (0,Q.jsx)(`rect`,{fill:`none`,height:l-p,rx:1,ry:1,stroke:d,strokeWidth:p,width:u-p,x:s+p/2,y:c+p/2}):null,t[17]=l,t[18]=s,t[19]=d,t[20]=c,t[21]=u,t[22]=p,t[23]=_):_=t[23];let v;return t[24]!==m||t[25]!==h||t[26]!==g||t[27]!==_?(v=/* @__PURE__ */ (0,Q.jsxs)(Q.Fragment,{children:[m,h,g,_]}),t[24]=m,t[25]=h,t[26]=g,t[27]=_,t[28]=v):v=t[28],v}),St=(0,$.memo)(function(e){let t=(0,Z.c)(11),{geometries:n,fadedOpacity:r,legendHoveredIndex:i,hoveredTime:a}=e,o;if(t[0]!==r||t[1]!==n||t[2]!==a||t[3]!==i){let e;t[5]!==r||t[6]!==a||t[7]!==i?(e=e=>/* @__PURE__ */ (0,Q.jsx)(`g`,{opacity:bt(e,r,i,a),style:{transition:`opacity 0.15s ease-in-out`},children:/* @__PURE__ */ (0,Q.jsx)(xt,{geometry:e})},e.time),t[5]=r,t[6]=a,t[7]=i,t[8]=e):e=t[8],o=n.map(e),t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o}else o=t[4];let s;return t[9]===o?s=t[10]:(s=/* @__PURE__ */ (0,Q.jsx)(Q.Fragment,{children:o}),t[9]=o,t[10]=s),s});function Ct(e){let t=(0,Z.c)(48),{geometry:n,delay:r,enterTransition:i,revealEpoch:o}=e,s;t[0]!==r||t[1]!==i?(s=ut(i,r),t[0]=r,t[1]=i,t[2]=s):s=t[2];let c=s,l=`${n.centerX}px ${n.bodyTop+n.bodyHeight/2}px`,u=n.wickTop+n.wickHeight/2,d,f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d={opacity:1},f={opacity:0},t[3]=d,t[4]=f):(d=t[3],f=t[4]);let p=`candle-enter-${n.time}-${o}`,m=`${n.centerX}px ${u}px`,h;t[5]===m?h=t[6]:(h={transformOrigin:m},t[5]=m,t[6]=h);let g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g={duration:.15},t[7]=g):g=t[7];let _;t[8]===c?_=t[9]:(_={...c,opacity:g},t[8]=c,t[9]=_);let v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v={scaleY:1},t[10]=v):v=t[10];let y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(y={scaleY:0},t[11]=y):y=t[11];let b=`${n.centerX}px ${u}px`,x;t[12]===b?x=t[13]:(x={transformOrigin:b},t[12]=b,t[13]=x);let S;t[14]!==n.wickFill||t[15]!==n.wickHeight||t[16]!==n.wickLeft||t[17]!==n.wickTop||t[18]!==c||t[19]!==x?(S=/* @__PURE__ */ (0,Q.jsx)(a.rect,{animate:v,fill:n.wickFill,height:n.wickHeight,initial:y,style:x,transition:c,width:_t,x:n.wickLeft,y:n.wickTop}),t[14]=n.wickFill,t[15]=n.wickHeight,t[16]=n.wickLeft,t[17]=n.wickTop,t[18]=c,t[19]=x,t[20]=S):S=t[20];let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C={scaleY:1},t[21]=C):C=t[21];let w;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(w={scaleY:0},t[22]=w):w=t[22];let T;t[23]===l?T=t[24]:(T={transformOrigin:l},t[23]=l,t[24]=T);let E;t[25]!==n.bodyHeight||t[26]!==n.bodyLeft||t[27]!==n.bodySolidFill||t[28]!==n.bodyTop||t[29]!==n.candleWidth||t[30]!==c||t[31]!==T?(E=/* @__PURE__ */ (0,Q.jsx)(a.rect,{animate:C,fill:n.bodySolidFill,height:n.bodyHeight,initial:w,rx:1,ry:1,stroke:n.bodySolidFill,strokeWidth:1,style:T,transition:c,width:n.candleWidth,x:n.bodyLeft,y:n.bodyTop}),t[25]=n.bodyHeight,t[26]=n.bodyLeft,t[27]=n.bodySolidFill,t[28]=n.bodyTop,t[29]=n.candleWidth,t[30]=c,t[31]=T,t[32]=E):E=t[32];let D;t[33]!==l||t[34]!==n.bodyHeight||t[35]!==n.bodyLeft||t[36]!==n.bodyPattern||t[37]!==n.bodyTop||t[38]!==n.candleWidth||t[39]!==c?(D=n.bodyPattern?/* @__PURE__ */ (0,Q.jsx)(a.rect,{animate:{scaleY:1},fill:n.bodyPattern,height:n.bodyHeight,initial:{scaleY:0},rx:1,ry:1,style:{transformOrigin:l},transition:c,width:n.candleWidth,x:n.bodyLeft,y:n.bodyTop}):null,t[33]=l,t[34]=n.bodyHeight,t[35]=n.bodyLeft,t[36]=n.bodyPattern,t[37]=n.bodyTop,t[38]=n.candleWidth,t[39]=c,t[40]=D):D=t[40];let O;return t[41]!==S||t[42]!==E||t[43]!==D||t[44]!==p||t[45]!==h||t[46]!==_?(O=/* @__PURE__ */ (0,Q.jsxs)(a.g,{animate:d,initial:f,style:h,transition:_,children:[S,E,D]},p),t[41]=S,t[42]=E,t[43]=D,t[44]=p,t[45]=h,t[46]=_,t[47]=O):O=t[47],O}function wt(e){let t=(0,Z.c)(49),{animate:n,positiveFill:r,negativeFill:i,bodyPatternPositive:a,bodyPatternNegative:o,insideStrokeWidth:s,fadedOpacity:c,showHoverFade:l}=e,u=n===void 0||n,d=r===void 0?`url(#candlestick-positive)`:r,f=i===void 0?`url(#candlestick-negative)`:i,p=s===void 0?0:s,m=c===void 0?.3:c,h=l===void 0||l,{data:_,xScale:v,yScale:y,xAccessor:b,animationDuration:x,enterTransition:S,revealEpoch:C,isLoaded:w,bandWidth:T,columnWidth:E,hoveredCandleIndex:D}=g(),O=C===void 0?0:C,{hoveredIndex:k}=ne(),A=Math.min(T??E*.8,E),j,M,N,P;if(t[0]!==u||t[1]!==x||t[2]!==o||t[3]!==a||t[4]!==A||t[5]!==_||t[6]!==S||t[7]!==D||t[8]!==p||t[9]!==w||t[10]!==f||t[11]!==d||t[12]!==O||t[13]!==b||t[14]!==v||t[15]!==y){P=Symbol.for(`react.early_return_sentinel`);bb0:{j=yt(_,v,y,b,A,d,f,a,o,p);let e=D==null?void 0:_[D],n;t[20]!==e||t[21]!==b?(n=e?b(e).getTime():null,t[20]=e,t[21]=b,t[22]=n):n=t[22],N=n;let r;t[23]!==o||t[24]!==a||t[25]!==A||t[26]!==e||t[27]!==p||t[28]!==f||t[29]!==d||t[30]!==b||t[31]!==v||t[32]!==y?(r=e?yt([e],v,y,b,A,d,f,a,o,p)[0]??null:null,t[23]=o,t[24]=a,t[25]=A,t[26]=e,t[27]=p,t[28]=f,t[29]=d,t[30]=b,t[31]=v,t[32]=y,t[33]=r):r=t[33],M=r;let i;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(i={type:`spring`,duration:.8,bounce:.15},t[34]=i):i=t[34];let s=S??i,c=_.length>0?x*.6/_.length:0;if(u&&!w){let e;t[35]!==s||t[36]!==O||t[37]!==c?(e=(e,t)=>/* @__PURE__ */ (0,Q.jsx)(Ct,{delay:t*c/1e3,enterTransition:s,geometry:e,revealEpoch:O},e.time),t[35]=s,t[36]=O,t[37]=c,t[38]=e):e=t[38],P=/* @__PURE__ */ (0,Q.jsx)(`g`,{className:`chart-candlesticks`,children:j.map(e)});break bb0}}t[0]=u,t[1]=x,t[2]=o,t[3]=a,t[4]=A,t[5]=_,t[6]=S,t[7]=D,t[8]=p,t[9]=w,t[10]=f,t[11]=d,t[12]=O,t[13]=b,t[14]=v,t[15]=y,t[16]=j,t[17]=M,t[18]=N,t[19]=P}else j=t[16],M=t[17],N=t[18],P=t[19];if(P!==Symbol.for(`react.early_return_sentinel`))return P;let F=h?N:null,I;t[39]!==m||t[40]!==j||t[41]!==k||t[42]!==F?(I=/* @__PURE__ */ (0,Q.jsx)(St,{fadedOpacity:m,geometries:j,hoveredTime:F,legendHoveredIndex:k}),t[39]=m,t[40]=j,t[41]=k,t[42]=F,t[43]=I):I=t[43];let L;t[44]===M?L=t[45]:(L=M?/* @__PURE__ */ (0,Q.jsx)(`g`,{children:/* @__PURE__ */ (0,Q.jsx)(xt,{geometry:M})}):null,t[44]=M,t[45]=L);let R;return t[46]!==I||t[47]!==L?(R=/* @__PURE__ */ (0,Q.jsxs)(`g`,{className:`chart-candlesticks`,children:[I,L]}),t[46]=I,t[47]=L,t[48]=R):R=t[48],R}wt.displayName=`Candlestick`;export{Ge as Background,k as BarLoadingSkeleton,H as CHART_CLIP_PASSTHROUGH,pe as CHART_DENSITY,ue as CHART_DENSITY_IDS,wt as Candlestick,mt as CandlestickChart,te as ChartConfigProvider,re as ChartLegendHoverProvider,_e as ChartLoadingLabel,L as ChartMarkers,x as ChartProvider,P as ChartRevealClip,Ze as ChartTooltip,c as DEFAULT_ANIMATION_DURATION_MS,o as DEFAULT_ANIMATION_EASING,z as DEFAULT_CHART_CONFIG,fe as DEFAULT_CHART_DENSITY,s as DEFAULT_CHART_ENTER_TRANSITION,ve as DEFAULT_CHART_LIFECYCLE,ge as DEFAULT_CHART_STATUS,m as DEFAULT_Y_AXIS_ID,B as DEFAULT_Y_DOMAIN_TWEEN_MS,Ke as DateTicker,d as Grid,O as LineLoadingSweep,A as MarkerGroup,N as MarkerTooltipContent,We as PATTERN_PRESET_IDS,M as PatternArea,Ve as PatternCircles,Ue as PatternHexagons,Le as PatternLines,ze as PatternWaves,C as ProjectionLine,S as ProjectionLineEndMarker,Qe as ReferenceArea,oe as SeriesMarkers,ae as SeriesPointMarker,V as ShimmeringText,E as StaticChartPreviewProvider,it as TooltipBox,at as TooltipContent,qe as TooltipDot,Ye as TooltipIndicator,Fe as XAxis,rt as YAxis,tt as Y_AXIS_DEFAULT_TICK_COUNT,nt as Y_AXIS_MAX_TICK_COUNT,et as Y_AXIS_MIN_TICK_COUNT,we as buildHorizontalTangentBezierPath,Y as buildProjectionPath,_ as chartCssVars,J as clampHoverIndexToMaxTime,Te as clampPixelXToProjectionHoverMax,G as computeProjectionAnchorTangentSlope,je as computeYDomainsByAxis,y as defaultScatterColors,q as extractProjectionLineConfigs,D as generateChartSkeletonData,f as getPrimaryYScale,ie as getSeriesMarkerVisualExtent,w as getSkeletonHeights,Je as indicatorFadeGradientStops,he as isChartInteractionPhase,Be as isCirclePattern,He as isCirclesPattern,X as isLoadingChromePhase,Oe as isYDomainTweenPhase,Pe as measureMaxLabelWidthPx,Ce as mergeProjectionXDomainMax,U as mergeProjectionYDomain,ke as mergeYDomainRecords,Me as niceYDomain,Re as patternPresetTileSize,Se as projectionDateExtents,Ee as projectionHoverMaxBySeries,De as projectionHoverMaxTime,W as projectionPinnedOverlayX,K as projectionValueExtents,Ie as renderPatternPreset,le as resolveChartMargin,ce as resolveDensityMaxLabels,de as resolveDensityTickCount,me as resolveRestingChartPhase,ee as resolveTooltipBoxMotion,Xe as resolveVerticalFadeSides,Ne as resolveYAxisMarginPx,$e as resolveYAxisTickCount,Ae as shouldTweenYDomain,F as useActiveMarkers,I as useAnimatedYDomains,g as useChart,R as useChartConfig,h as useChartHover,T as useChartInteraction,ne as useChartLegendHover,v as useChartStable,j as useStaticChartPreview,b as useYScale};
|