@ngrok/mantle 0.83.0 → 0.83.2

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/agent.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrok/mantle",
3
- "version": "0.83.0",
3
+ "version": "0.83.2",
4
4
  "origin": "https://mantle.ngrok.com",
5
5
  "endpoints": {
6
6
  "docs": "https://mantle.ngrok.com/",
@@ -157,7 +157,7 @@ declare const Workspace: ({ asChild, children, className, "data-slot": dataSlot,
157
157
  *
158
158
  * | CSS Variable | Default | Description |
159
159
  * | --- | --- | --- |
160
- * | `--app-layout-card-gutter` | `0.5rem` | The gap between the card and the window edge, the notice above it, and the rail beside it (8px). `AppLayout.Header` subtracts twice this value when deriving its height, so overriding it keeps the toolbar aligned with the sidebar header. |
160
+ * | `--app-layout-card-gutter` | `0.5rem` | The gap between the card and the window edge, the notice above it, and the rail beside it (8px). `AppLayout.Header` subtracts twice this value when deriving its height, so overriding it keeps the toolbar aligned with the sidebar header's band. |
161
161
  *
162
162
  * @see https://mantle.ngrok.com/layouts/app-layout#applayoutcontent
163
163
  *
@@ -207,16 +207,18 @@ declare const Content: ({ asChild, children, className, "data-slot": dataSlot, .
207
207
  * toolbar is `h-14`. When the shell contains a `Sidebar.Header` (detected via
208
208
  * `:has()` from `AppLayout.Root`), the toolbar instead derives its height from
209
209
  * the sidebar's public `--sidebar-header-height` token, subtracting twice the
210
- * card gutter and twice the card's hairline border — which keeps the two rows'
211
- * vertical centers on the same band by construction, for any header height.
212
- * Override `--sidebar-header-height` on a common ancestor (e.g.
213
- * `AppLayout.Root`'s `className`) and both rows move together.
210
+ * card gutter and twice the card's hairline border — which keeps this toolbar's
211
+ * vertical center on the band that token names, by construction, for any band
212
+ * height. The band belongs to the sidebar header's first row, so a header that
213
+ * stacks a second row grows downward and this toolbar keeps matching the
214
+ * switcher row alone. Override `--sidebar-header-height` on a common ancestor
215
+ * (e.g. `AppLayout.Root`'s `className`) and both rows move together.
214
216
  *
215
217
  * **CSS variables (public API):**
216
218
  *
217
219
  * | CSS Variable | Default | Description |
218
220
  * | --- | --- | --- |
219
- * | `--sidebar-header-height` | `4.5rem` | Read, not owned: `Sidebar.Header` owns this token and `AppLayout.Header` derives its own height from it whenever a sidebar header is present in the shell. Set it on a common ancestor of both rows (e.g. `AppLayout.Root`), never on one of them, since custom properties only inherit downward. |
221
+ * | `--sidebar-header-height` | `4.5rem` | Read, not owned: `Sidebar.Header` owns this token — the band its first row sits on — and `AppLayout.Header` derives its own height from it whenever a sidebar header is present in the shell. Set it on a common ancestor of both rows (e.g. `AppLayout.Root`), never on one of them, since custom properties only inherit downward. |
220
222
  * | `--app-layout-card-gutter` | `0.5rem` | Read, not owned: `AppLayout.Content` owns this token. The derived height subtracts twice its value, so changing the card gutter keeps the two rows aligned instead of drifting. |
221
223
  *
222
224
  * @see https://mantle.ngrok.com/layouts/app-layout#applayoutheader
@@ -1,4 +1,4 @@
1
- import { _ as PointShape, a as LegendPrimitiveProps, c as XAxisPrimitiveProps, f as ChartDatum, g as CurveKind, h as ContinuousXScale, i as GridPrimitiveProps, l as YAxisPrimitiveProps, m as ChartSeriesSlot, n as ChartRootBaseProps, o as ReferenceLinePrimitiveProps, p as ChartDatumEvent, r as CopyButtonPrimitiveProps, s as TooltipPrimitiveProps, t as ChartAccessibilityProps, v as SeriesColor } from "./chart-0zcFJh4n.js";
1
+ import { _ as PointShape, a as LegendPrimitiveProps, c as XAxisPrimitiveProps, f as ChartDatum, g as CurveKind, h as ContinuousXScale, i as GridPrimitiveProps, l as YAxisPrimitiveProps, m as ChartSeriesSlot, n as ChartRootBaseProps, o as ReferenceLinePrimitiveProps, p as ChartDatumEvent, r as CopyButtonPrimitiveProps, s as TooltipPrimitiveProps, t as ChartAccessibilityProps, v as SeriesColor } from "./chart-TWkSYqAs.js";
2
2
  //#region src/components/area-chart/area-chart.d.ts
3
3
  /**
4
4
  * Props for {@link AreaChart.Root}. Areas fill from a shared zero baseline, so
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-DBxT9BNl.js";import{jsx as l}from"react/jsx-runtime";const u={Root:e=>l(o,{kind:`area`,componentName:`AreaChart`,slotName:`area-chart`,...e}),Area:e=>a(`AreaChart.Area`,`area`,e),Grid:e=>n(`AreaChart.Grid`,e),XAxis:e=>t(`AreaChart.XAxis`,e),YAxis:e=>r(`AreaChart.YAxis`,e),ReferenceLine:t=>e(`AreaChart.ReferenceLine`,t),Tooltip:e=>s(`AreaChart.Tooltip`,e),Legend:e=>l(i,{partName:`AreaChart.Legend`,slotName:`area-chart`,...e}),CopyButton:e=>l(c,{partName:`AreaChart.CopyButton`,slotName:`area-chart`,...e})};export{u as AreaChart};
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-DorYMICt.js";import{jsx as l}from"react/jsx-runtime";const u={Root:e=>l(o,{kind:`area`,componentName:`AreaChart`,slotName:`area-chart`,...e}),Area:e=>a(`AreaChart.Area`,`area`,e),Grid:e=>n(`AreaChart.Grid`,e),XAxis:e=>t(`AreaChart.XAxis`,e),YAxis:e=>r(`AreaChart.YAxis`,e),ReferenceLine:t=>e(`AreaChart.ReferenceLine`,t),Tooltip:e=>s(`AreaChart.Tooltip`,e),Legend:e=>l(i,{partName:`AreaChart.Legend`,slotName:`area-chart`,...e}),CopyButton:e=>l(c,{partName:`AreaChart.CopyButton`,slotName:`area-chart`,...e})};export{u as AreaChart};
@@ -1,4 +1,4 @@
1
- import { a as LegendPrimitiveProps, c as XAxisPrimitiveProps, d as BarTexture, f as ChartDatum, i as GridPrimitiveProps, l as YAxisPrimitiveProps, m as ChartSeriesSlot, n as ChartRootBaseProps, o as ReferenceLinePrimitiveProps, p as ChartDatumEvent, r as CopyButtonPrimitiveProps, s as TooltipPrimitiveProps, t as ChartAccessibilityProps, u as BarOrientation, v as SeriesColor } from "./chart-0zcFJh4n.js";
1
+ import { a as LegendPrimitiveProps, c as XAxisPrimitiveProps, d as BarTexture, f as ChartDatum, i as GridPrimitiveProps, l as YAxisPrimitiveProps, m as ChartSeriesSlot, n as ChartRootBaseProps, o as ReferenceLinePrimitiveProps, p as ChartDatumEvent, r as CopyButtonPrimitiveProps, s as TooltipPrimitiveProps, t as ChartAccessibilityProps, u as BarOrientation, v as SeriesColor } from "./chart-TWkSYqAs.js";
2
2
  //#region src/components/bar-chart/bar-chart.d.ts
3
3
  /**
4
4
  * Props for {@link BarChart.Root}. Bars encode value by length from a shared
package/dist/bar-chart.js CHANGED
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-DBxT9BNl.js";import{jsx as l}from"react/jsx-runtime";const u={Root:e=>l(o,{kind:`bar`,componentName:`BarChart`,slotName:`bar-chart`,...e}),Bar:e=>a(`BarChart.Bar`,`bar`,e),Grid:e=>n(`BarChart.Grid`,e),XAxis:e=>t(`BarChart.XAxis`,e),YAxis:e=>r(`BarChart.YAxis`,e),ReferenceLine:t=>e(`BarChart.ReferenceLine`,t),Tooltip:e=>s(`BarChart.Tooltip`,e),Legend:e=>l(i,{partName:`BarChart.Legend`,slotName:`bar-chart`,...e}),CopyButton:e=>l(c,{partName:`BarChart.CopyButton`,slotName:`bar-chart`,...e})};export{u as BarChart};
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-DorYMICt.js";import{jsx as l}from"react/jsx-runtime";const u={Root:e=>l(o,{kind:`bar`,componentName:`BarChart`,slotName:`bar-chart`,...e}),Bar:e=>a(`BarChart.Bar`,`bar`,e),Grid:e=>n(`BarChart.Grid`,e),XAxis:e=>t(`BarChart.XAxis`,e),YAxis:e=>r(`BarChart.YAxis`,e),ReferenceLine:t=>e(`BarChart.ReferenceLine`,t),Tooltip:e=>s(`BarChart.Tooltip`,e),Legend:e=>l(i,{partName:`BarChart.Legend`,slotName:`bar-chart`,...e}),CopyButton:e=>l(c,{partName:`BarChart.CopyButton`,slotName:`bar-chart`,...e})};export{u as BarChart};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./button-CCkGqE1t.js";import{t as i}from"./use-copy-to-clipboard-CSyp4Zk0.js";import{createContext as a,useContext as o,useEffect as s,useId as c,useLayoutEffect as l,useMemo as u,useRef as d,useState as f,useSyncExternalStore as p}from"react";import m from"tiny-invariant";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{CheckIcon as v}from"@phosphor-icons/react/Check";import{CopyIcon as y}from"@phosphor-icons/react/Copy";import{scaleTime as b}from"d3-scale";import{area as x,curveLinear as S,curveMonotoneX as C,curveStep as w,line as T}from"d3-shape";const E=(e,t)=>Reflect.get(e,t),D=e=>{let{step:t,slot:n}=e,r=Math.min(64,Math.max(24,t*.6));return Math.min(n,r)},O=.5,k=(e,t)=>e<0?e:t,A=e=>{let{lower:t,upper:n,toPixel:r,reveal:i,gap:a}=e,o=r(t<0?n:t),s=o+(r(k(t,n))-o)*i;if(Math.abs(o-r(0))<O)return{baseline:o,value:s};let c=Math.min(a,Math.abs(o-s)/2);return{baseline:o-Math.sign(o-s)*c,value:s}},j=e=>{let{lower:t,upper:n,pileOuter:r,toPixel:i}=e;if(Number.isNaN(r))return!1;let a=i(k(t,n));return Math.abs(a-i(r))<O},ee=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`,`chart-other`],te=e=>ee.includes(e),M=e=>`--color-${e}`,ne=`var(--color-chart-decorative)`,re=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`],ie=e=>{let t=e.toLowerCase();return t.includes(`var(`)||t.includes(`currentcolor`)},N=(e,t)=>{let n=e.ownerDocument,r=n.createElement(`span`);r.style.display=`none`,r.style.color=t,e.appendChild(r);let i=n.defaultView?.getComputedStyle(r).color??``;return r.remove(),i},P=(e,t)=>te(t)?N(e,`var(${M(t)})`):ie(t)?N(e,t):t,F=e=>({grid:N(e,`var(--border-color-card-muted)`),baseline:N(e,`var(--border-color-card)`),tickText:N(e,`var(--text-color-muted)`),reference:N(e,`var(--color-neutral-500)`),surface:N(e,`var(--background-color-card)`)}),ae=e=>`${e.className}|${e.getAttribute(`data-applied-theme`)??``}|${e.getAttribute(`data-theme`)??``}`,oe=(e,t)=>{let n=new MutationObserver(t);return n.observe(e,{attributes:!0,attributeFilter:[`class`,`data-applied-theme`,`data-theme`]}),()=>n.disconnect()},I=1.5,se=1.1,L=1.6,ce=e=>`oklch(from ${e} calc(l - 0.18) c h)`,R=(e,t,n)=>{let r=I;if(n===`up`){e.moveTo(-1.5,t+r),e.lineTo(t+r,-1.5),e.moveTo(-1.5,r),e.lineTo(r,-1.5),e.moveTo(t-r,t+r),e.lineTo(t+r,t-r);return}e.moveTo(-1.5,-1.5),e.lineTo(t+r,t+r),e.moveTo(t-r,-1.5),e.lineTo(t+r,r),e.moveTo(-1.5,t-r),e.lineTo(r,t+r)},z=(e,t)=>{let{size:n,width:r}=t;e.fillRect(0,n/2-r/2,n,r)},B=(e,t)=>{let{size:n,width:r}=t;e.fillRect(n/2-r/2,0,r,n)},le={hatch:(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=I,e.beginPath(),R(e,t,`up`),e.stroke()},"hatch-reverse":(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=I,e.beginPath(),R(e,t,`down`),e.stroke()},crosshatch:(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=1,e.beginPath(),R(e,t,`up`),R(e,t,`down`),e.stroke()},perpendicular:(e,{size:t,ink:n,orientation:r})=>{e.fillStyle=n,r===`horizontal`?B(e,{size:t,width:2}):z(e,{size:t,width:2})},parallel:(e,{size:t,ink:n,orientation:r})=>{e.fillStyle=n,r===`horizontal`?z(e,{size:t,width:2}):B(e,{size:t,width:2})},grid:(e,{size:t,ink:n})=>{e.fillStyle=n,z(e,{size:t,width:se}),B(e,{size:t,width:se})},dots:(e,{size:t,ink:n})=>{e.fillStyle=n,e.beginPath(),e.arc(t/4,t/4,L,0,Math.PI*2),e.moveTo(3*t/4+L,3*t/4),e.arc(3*t/4,3*t/4,L,0,Math.PI*2),e.fill()}},V=(e,t)=>{let{texture:n,color:r,ink:i,devicePixelRatio:a,orientation:o}=t,s=e.canvas.ownerDocument.createElement(`canvas`);s.width=Math.max(1,Math.round(8*a)),s.height=s.width;let c=s.getContext(`2d`);if(c==null)return null;let l=s.width/8;c.scale(l,l),c.fillStyle=r,c.fillRect(0,0,8,8),le[n](c,{size:8,ink:i,orientation:o});let u=e.createPattern(s,`repeat`);return u?.setTransform({a:1/l,b:0,c:0,d:1/l,e:0,f:0}),u},H=e=>{let{pointCount:t,columnCount:n,wasDecimated:r}=e;return n<=0?!1:r?t>=n*3:t>=n*4},ue=e=>{let{xs:t,values:n,startIndex:r,endIndex:i,positionK:a,positionB:o,columnCount:s}=e,c=new Uint8Array(s),l=new Float64Array(s),u=new Float64Array(s),d=new Float64Array(s),f=new Float64Array(s);for(let e=r;e<=i;e++){let r=n[e]??NaN;if(Number.isNaN(r))continue;let i=t[e]??NaN,p=Math.floor(i*a+o);if(p===s&&(p=s-1),!(p<0||p>=s)){if(c[p]===0){c[p]=1,l[p]=r,u[p]=r,d[p]=r,f[p]=r;continue}r<(l[p]??1/0)&&(l[p]=r),r>(u[p]??-1/0)&&(u[p]=r),f[p]=r}}return{columnCount:s,hasData:c,minValue:l,maxValue:u,inValue:d,outValue:f}},U=new Intl.NumberFormat,de=new Intl.NumberFormat(void 0,{maximumSignificantDigits:4}),fe=new Map,W=(e,t)=>{let n=Object.is(e,-0)?0:e,r=t?.maximumFractionDigits;if(r!=null){let e=fe.get(r);return e??(e=new Intl.NumberFormat(void 0,{maximumFractionDigits:r}),fe.set(r,e)),e.format(n)}return n!==0&&Math.abs(n)<1?de.format(n):U.format(n)},pe=e=>!Number.isFinite(e)||e<=0?0:Math.min(20,Math.max(0,-Math.floor(Math.log10(e)))),me=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),he=new Intl.DateTimeFormat(void 0,{year:`numeric`,month:`short`,day:`numeric`}),ge=e=>e.getHours()!==0||e.getMinutes()!==0||e.getSeconds()!==0||e.getMilliseconds()!==0,G=(e,t)=>typeof e==`string`?e:typeof e==`number`?W(e):Number.isNaN(e.getTime())?`—`:t?.datasetHasTimeOfDay??ge(e)?me.format(e):he.format(e),_e=(e,t,n)=>{if(t<=0)return null;let r=0,i=t-1,a=e[0]??0,o=e[i]??0;if(n<=a)return 0;if(n>=o)return i;for(;i-r>1;){let t=r+i>>1;(e[t]??0)<=n?r=t:i=t}let s=n-(e[r]??0);return(e[i]??0)-n<s?i:r},ve=Math.PI/2-.05,ye=e=>({cosYaw:Math.cos(e.yaw),sinYaw:Math.sin(e.yaw),cosPitch:Math.cos(e.pitch),sinPitch:Math.sin(e.pitch)}),be=(e,t,n,r)=>{let i=e*r.cosYaw+n*r.sinYaw,a=-e*r.sinYaw+n*r.cosYaw,o=t*r.cosPitch-a*r.sinPitch,s=t*r.sinPitch+a*r.cosPitch,c=4/(4+s);return{x:i*c,y:o*c,depth:s,scale:c}},xe=e=>Math.min(ve,Math.max(-ve,e)),Se=(e,t)=>{let n=t[1]-t[0];return n===0?0:(e-t[0])/n*2-1},Ce=[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1],[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],we=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]],Te=Math.sqrt(50),Ee=Math.sqrt(10),De=Math.sqrt(2),K=(e,t,n,r)=>{let i=(t-e)/Math.max(0,n),a=r?.integer?Math.max(1,i):i,o=Math.floor(Math.log10(a)),s=a/10**o,c=s>=Te?10:s>=Ee?5:s>=De?2:1,l,u,d;return o<0?(d=10**-o/c,l=Math.round(e*d),u=Math.round(t*d),l/d<e&&(l+=1),u/d>t&&--u,d=-d):(d=10**o*c,l=Math.round(e/d),u=Math.round(t/d),l*d<e&&(l+=1),u*d>t&&--u),u<l&&.5<=n&&n<2?K(e,t,n*2,r):[l,u,d]},Oe=(e,t,n,r)=>{if(!(n>0))return[];if(e===t)return r?.integer&&!Number.isInteger(e)?[]:[e];let i=t<e,[a,o,s]=i?K(t,e,n,r):K(e,t,n,r);if(!(o>=a))return[];let c=o-a+1,l=[];for(let e=0;e<c;e+=1){let t=i?o-e:a+e;l.push(s<0?t/-s:t*s)}return l},ke=(e,t,n)=>K(e,t,n)[2],Ae=(e,t)=>{let n=e[1]-e[0];if(n===0)return{k:0,b:(t[0]+t[1])/2};let r=(t[1]-t[0])/n;return{k:r,b:t[0]-e[0]*r}},je=e=>{let{count:t,rangeStart:n,rangeEnd:r,paddingInner:i,paddingOuter:a}=e,o=r-n;if(t<=0||o<=0)return{count:Math.max(0,t),rangeStart:n,step:0,bandwidth:0,offset:0};let s=o/Math.max(1,t-i+a*2);return{count:t,rangeStart:n,step:s,bandwidth:s*(1-i),offset:s*a}},q=(e,t)=>e.rangeStart+e.offset+t*e.step,J=(e,t)=>q(e,t)+e.bandwidth/2,Me=(e,t)=>({start:q(e,t)-(e.step-e.bandwidth)/2,size:e.step}),Ne=(e,t)=>{if(e.count===0||e.step===0)return null;let n=Math.floor((t-e.rangeStart-e.offset+e.step/2-e.bandwidth/2)/e.step);return Math.min(e.count-1,Math.max(0,n))},Pe=(e,t,n)=>Oe(e[0],e[1],t,n);let Fe=null,Ie=null;const Le=e=>{if(Ie!=null&&Fe!=null&&Fe[0]===e[0]&&Fe[1]===e[1])return Ie;let t=b().domain([new Date(e[0]),new Date(e[1])]);return Fe=[e[0],e[1]],Ie=t,t},Re=(e,t)=>Le(e).ticks(t).map(e=>e.getTime()),ze=e=>{let t=Le(e).tickFormat();return e=>t(new Date(e))},Y=(e,t)=>{if(e[0]>e[1])return Y([e[1],e[0]],t);if(e[0]===e[1]){let n=e[0],r=n===0?1:Math.abs(n)*.5;return Y([n-r,n+r],t)}let n=e[0],r=e[1],i=NaN;for(let e=0;e<10;e++){let e=ke(n,r,t);if(e===i||e===0||!Number.isFinite(e))break;if(e>0)n=Math.floor(n/e)*e,r=Math.ceil(r/e)*e;else{let t=-e;n=Math.floor(n*t)/t,r=Math.ceil(r*t)/t}i=e}return[n,r]},Be=(e,t)=>{let n=Y(e,t);return e[0]===0?[0,n[1]]:n},Ve=e=>e===`monotone`?C:e===`step`?w:S,X=e=>Math.round(e)+.5,He=(e,t)=>{let{plot:n,color:r,xLines:i,yLines:a}=t;e.save(),e.strokeStyle=r,e.lineWidth=1;for(let t of i)e.globalAlpha=t.alpha,e.beginPath(),e.moveTo(X(t.position),n.top),e.lineTo(X(t.position),n.top+n.height),e.stroke();for(let t of a)e.globalAlpha=t.alpha,e.beginPath(),e.moveTo(n.left,X(t.position)),e.lineTo(n.left+n.width,X(t.position)),e.stroke();e.restore()},Ue=(e,t)=>{let{plot:n,color:r,y:i}=t;e.strokeStyle=r,e.lineWidth=1,e.beginPath(),e.moveTo(n.left,X(i)),e.lineTo(n.left+n.width,X(i)),e.stroke()},We=(e,t)=>{let{plot:n,color:r,x:i}=t;e.strokeStyle=r,e.lineWidth=1,e.beginPath(),e.moveTo(X(i),n.top),e.lineTo(X(i),n.top+n.height),e.stroke()},Ge=(e,t)=>{let{fill:n,rects:r}=t;e.fillStyle=n,e.beginPath();for(let t of r){let n=Math.max(.5,t.width),r=Math.min(t.valueY,t.baselineY),i=Math.abs(t.baselineY-t.valueY);if(i===0)continue;let a=t.rounded&&n>=8?Math.min(4,n/2,i):0;if(a===0){e.rect(t.x,r,n,i);continue}t.valueY<=t.baselineY?e.roundRect(t.x,r,n,i,[a,a,0,0]):e.roundRect(t.x,r,n,i,[0,0,a,a])}e.fill()},Ke=(e,t)=>{let{fill:n,rects:r}=t;e.fillStyle=n,e.beginPath();for(let t of r){let n=Math.max(.5,t.height),r=Math.min(t.valueX,t.baselineX),i=Math.abs(t.valueX-t.baselineX);if(i===0)continue;let a=t.rounded&&n>=8?Math.min(4,n/2,i):0;if(a===0){e.rect(r,t.y,i,n);continue}t.valueX>=t.baselineX?e.roundRect(r,t.y,i,n,[0,a,a,0]):e.roundRect(r,t.y,i,n,[a,0,0,a])}e.fill()},qe=(e,t)=>{let{color:n,curve:r,indexes:i,xAt:a,yAt:o,definedAt:s}=t,c=T().x(a).y(o).defined(s).curve(Ve(r)).context(e);e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath(),c(i),e.stroke()},Je=(e,t)=>{let{color:n,curve:r,indexes:i,xAt:a,y0At:o,y1At:s,definedAt:c}=t,l=x().x(a).y0(o).y1(s).defined(c).curve(Ve(r)).context(e);e.beginPath(),l(i),e.save(),e.globalAlpha=.1,e.fillStyle=n,e.fill(),e.restore();let u=T().x(a).y(s).defined(c).curve(Ve(r)).context(e);e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath(),u(i),e.stroke()},Ye=(e,t)=>{let{color:n,columns:r,columnToX:i,valueK:a,valueB:o}=t;e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath();let s=!1;for(let t=0;t<r.columnCount;t++){if(r.hasData[t]===0){s=!1;continue}let n=i(t),c=(r.inValue[t]??0)*a+o,l=(r.minValue[t]??0)*a+o,u=(r.maxValue[t]??0)*a+o,d=(r.outValue[t]??0)*a+o;s?e.lineTo(n,c):(e.moveTo(n,c),s=!0),(l!==c||u!==c)&&(e.lineTo(n,l),e.lineTo(n,u)),d!==u&&e.lineTo(n,d)}e.stroke()},Xe=(e,t)=>{let{color:n,lowerColumns:r,upperColumns:i,columnToX:a,valueK:o,valueB:s}=t;e.beginPath();let c=-1,l=t=>{if(c<0)return;let n=!1;for(let r=c;r<=t;r++){let t=a(r),c=(i.maxValue[r]??0)*o+s;n?e.lineTo(t,c):(e.moveTo(t,c),n=!0)}for(let n=t;n>=c;n--){let t=a(n),i=(r.minValue[n]??0)*o+s;e.lineTo(t,i)}e.closePath(),c=-1};for(let e=0;e<i.columnCount;e++){if(i.hasData[e]===0){l(e-1);continue}c<0&&(c=e)}l(i.columnCount-1),e.save(),e.globalAlpha=.1,e.fillStyle=n,e.fill(),e.restore(),Ye(e,{color:n,columns:i,columnToX:a,valueK:o,valueB:s})},Ze=(e,t,n,r,i)=>{let a=!1;for(let[o,s]of i)a?e.lineTo(t+o*r,n+s*r):(e.moveTo(t+o*r,n+s*r),a=!0);e.closePath()},Qe=[[-1/3,-1],[1/3,-1],[1/3,-1/3],[1,-1/3],[1,1/3],[1/3,1/3],[1/3,1],[-1/3,1],[-1/3,1/3],[-1,1/3],[-1,-1/3],[-1/3,-1/3]],$e=Qe.map(([e,t])=>[(e-t)/Math.SQRT2,(e+t)/Math.SQRT2]),et=Array.from({length:10},(e,t)=>{let n=-Math.PI/2+t*Math.PI/5,r=t%2==0?1:.382;return[Math.cos(n)*r,Math.sin(n)*r]}),tt={circle:(e,t,n,r)=>{e.arc(t,n,r,0,Math.PI*2)},square:(e,t,n,r)=>{let i=r*.886;e.moveTo(t-i,n-i),e.lineTo(t+i,n-i),e.lineTo(t+i,n+i),e.lineTo(t-i,n+i),e.closePath()},triangle:(e,t,n,r)=>{let i=r*1.55;e.moveTo(t,n-i),e.lineTo(t+i*.866,n+i*.5),e.lineTo(t-i*.866,n+i*.5),e.closePath()},diamond:(e,t,n,r)=>{let i=r*1.253;e.moveTo(t,n-i),e.lineTo(t+i,n),e.lineTo(t,n+i),e.lineTo(t-i,n),e.closePath()},"triangle-down":(e,t,n,r)=>{let i=r*1.55;e.moveTo(t,n+i),e.lineTo(t+i*.866,n-i*.5),e.lineTo(t-i*.866,n-i*.5),e.closePath()},plus:(e,t,n,r)=>{Ze(e,t,n,r*1.189,Qe)},cross:(e,t,n,r)=>{Ze(e,t,n,r*1.189,$e)},star:(e,t,n,r)=>{Ze(e,t,n,r*1.673,et)}},nt=(e,t,n,r,i)=>{tt[i](e,t,n,r)},rt=(e,t)=>{let{color:n,surface:r,shape:i,indexes:a,xAt:o,yAt:s,definedAt:c}=t;e.fillStyle=n,e.strokeStyle=r,e.lineWidth=2;for(let t of a)c(t)&&(e.beginPath(),nt(e,o(t),s(t),4,i),e.fill(),e.stroke())},it=5e3,at=2e4,ot=(e,t)=>{let{color:n,surface:r,shape:i,totalPointCount:a,indexes:o,xAt:s,yAt:c,radiusAt:l}=t;if(e.fillStyle=n,a>at){e.beginPath();for(let t of o)l(t)<=0||e.rect(s(t)-1,c(t)-1,2,2);e.fill();return}let u=a<=it;e.strokeStyle=r,e.lineWidth=2;for(let t of o){let n=l(t);n<=0||(e.beginPath(),nt(e,s(t),c(t),n,i),e.fill(),u&&e.stroke())}},st=(e,t)=>{let{count:n,order:r,screenX:i,screenY:a,radius:o,colorAt:s,shapeAt:c,alphaAt:l,surface:u}=t;if(e.save(),n>at){let t=``,n=-1;for(let c of r){let r=s(c);r!==t&&(e.fillStyle=r,t=r);let u=l(c);u!==n&&(e.globalAlpha=u,n=u);let d=Math.max(1,(o[c]??0)/2);e.fillRect((i[c]??0)-d/2,(a[c]??0)-d/2,d,d)}e.restore();return}let d=n<=it;e.strokeStyle=u,e.lineWidth=2;let f=``,p=-1;for(let t of r){let n=s(t);n!==f&&(e.fillStyle=n,f=n);let r=l(t);r!==p&&(e.globalAlpha=r,p=r),e.beginPath(),nt(e,i[t]??0,a[t]??0,o[t]??0,c(t)),e.fill(),d&&e.stroke()}e.restore()},ct=(e,t)=>{let{gridColor:n,axisColor:r,corners:i,edges:a,cubeAlpha:o,axes:s}=t;if(e.save(),o>.01){e.globalAlpha=o,e.strokeStyle=n,e.lineWidth=1,e.beginPath();for(let[t,n]of a){let r=i[t],a=i[n];r!=null&&a!=null&&(e.moveTo(r.x,r.y),e.lineTo(a.x,a.y))}e.stroke()}e.strokeStyle=r;for(let{alpha:t,from:n,to:r}of s)t<=.01||(e.globalAlpha=t,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,r.y),e.stroke());e.restore()},lt=(e,t)=>{let{textColor:n,fontFamily:r,plot:i,center:a,axes:o}=t;e.save(),e.fillStyle=n,e.font=`11px ${r}`,e.textAlign=`center`,e.textBaseline=`middle`;for(let{label:t,alpha:n,from:r,to:s}of o){if(n<=.01)continue;let o=Math.hypot(r.x-a.x,r.y-a.y),c=Math.hypot(s.x-a.x,s.y-a.y),l=c>=o?s:r,u=c>=o?r:s,d=Math.max(1,Math.hypot(l.x-u.x,l.y-u.y)),f=(l.x-u.x)/d*16,p=(l.y-u.y)/d*16,m=Math.min(i.left+i.width-8,Math.max(i.left+8,l.x+f)),h=Math.min(i.top+i.height-6,Math.max(i.top+6,l.y+p));e.globalAlpha=n,e.fillText(t,m,h)}e.restore()},ut=(e,t)=>{let{plot:n,color:r,textColor:i,y:a,label:o,fontFamily:s}=t;e.strokeStyle=r,e.lineWidth=1,e.setLineDash([4,4]),e.beginPath(),e.moveTo(n.left,X(a)),e.lineTo(n.left+n.width,X(a)),e.stroke(),e.setLineDash([]),o!=null&&o.length>0&&(e.font=`11px ${s}`,e.fillStyle=i,e.textAlign=`right`,e.textBaseline=`bottom`,e.fillText(o,n.left+n.width-4,a-3))},dt=(e,t)=>{let{plot:n,color:r,textColor:i,x:a,label:o,fontFamily:s}=t;if(e.strokeStyle=r,e.lineWidth=1,e.setLineDash([4,4]),e.beginPath(),e.moveTo(X(a),n.top),e.lineTo(X(a),n.top+n.height),e.stroke(),e.setLineDash([]),o!=null&&o.length>0){e.font=`11px ${s}`,e.fillStyle=i;let t=e.measureText(o).width,r=a+4+t<=n.left+n.width;e.textAlign=r?`left`:`right`,e.textBaseline=`top`,e.fillText(o,r?a+4:a-4,n.top+3)}},ft=(e,t)=>{let{plot:n,color:r,fontFamily:i,xLabels:a,yLabels:o}=t;e.save(),e.font=`11px ${i}`,e.fillStyle=r,e.textAlign=`right`,e.textBaseline=`middle`;for(let t of o)e.globalAlpha=t.alpha,e.fillText(t.text,n.left-8,t.position);e.textAlign=`center`,e.textBaseline=`top`;for(let t of a)e.globalAlpha=t.alpha,e.fillText(t.text,t.position,n.top+n.height+8);e.restore()},pt=e=>{let t=e.length,n=e[0]?.length??0,r=[],i=[];for(let e=0;e<t;e++)r.push(new Float64Array(n)),i.push(new Float64Array(n));let a=0,o=0,s=new Float64Array(n),c=new Float64Array(n),l=new Int32Array(n).fill(-1),u=new Int32Array(n).fill(-1);for(let d=0;d<t;d++){let t=e[d],f=r[d],p=i[d];if(t!=null&&f!=null&&p!=null)for(let e=0;e<n;e++){let n=t[e]??NaN;if(Number.isNaN(n)){f[e]=NaN,p[e]=NaN;continue}if(n>=0){let t=s[e]??0,r=t+n;s[e]=r,f[e]=t,p[e]=r,r>o&&(o=r),n>0&&(l[e]=d)}else{let t=c[e]??0,r=t+n;c[e]=r,f[e]=r,p[e]=t,r<a&&(a=r),u[e]=d}}}return{lower:r,upper:i,min:a,max:o,positiveEnd:l,negativeEnd:u}},mt=e=>1-(1-e)**3;var ht=class{#e=new Float64Array;#t=new Float64Array;#n=new Float64Array;#r=0;#i=0;#a=!1;get active(){return this.#a}values(){return this.#n}retarget(e,t){let{duration:n,now:r}=t,i=e.length,a=this.#n.length!==i;if(a&&(this.#e=new Float64Array(i),this.#t=new Float64Array(i),this.#n=new Float64Array(i)),a||n<=0){for(let t=0;t<i;t++){let n=e[t]??NaN;this.#e[t]=n,this.#t[t]=n,this.#n[t]=n}this.#a=!1;return}let o=!1;for(let t=0;t<i;t++){let n=e[t]??NaN,r=this.#n[t]??NaN;if(r!==n&&!(Number.isNaN(r)&&Number.isNaN(n))){o=!0;break}}if(!o){for(let t=0;t<i;t++)this.#t[t]=e[t]??NaN;this.#a=!1;return}for(let t=0;t<i;t++)this.#e[t]=this.#n[t]??NaN,this.#t[t]=e[t]??NaN;this.#r=r,this.#i=n,this.#a=!0}snap(){this.#n.set(this.#t),this.#a=!1}tick(e){if(!this.#a)return!1;let t=Math.min(1,(e-this.#r)/this.#i),n=mt(t);for(let e=0;e<this.#n.length;e++){let t=this.#e[e]??NaN,r=this.#t[e]??NaN;if(Number.isNaN(t)||Number.isNaN(r)){this.#n[e]=r;continue}this.#n[e]=t+(r-t)*n}return t>=1&&(this.#a=!1),this.#a}},gt=class{#e=new Float64Array;#t=new Float64Array;#n=0;#r=!1;#i;#a;#o=0;constructor(e={}){this.#i=e.speed??.14,this.#a=e.epsilon??.001}get active(){return this.#r}values(){return this.#t}jump(e){this.#t.length!==e.length&&(this.#e=new Float64Array(e.length),this.#t=new Float64Array(e.length));for(let t=0;t<e.length;t++){let n=e[t]??NaN;this.#e[t]=n,this.#t[t]=n}this.#r=!1}aim(e,t){if(this.#t.length!==e.length){this.jump(e);return}let n=!1;for(let t=0;t<e.length;t++){let r=e[t]??NaN,i=this.#e[t]??NaN;if(i!==r&&!(Number.isNaN(i)&&Number.isNaN(r))){n=!0;break}}if(!n)return;let r=0;for(let t=0;t<e.length;t++){let n=e[t]??NaN;this.#e[t]=n;let i=Math.abs(n-(this.#t[t]??NaN));Number.isFinite(i)&&i>r&&(r=i)}this.#o=r,this.#r||(this.#r=!0,this.#n=t)}tick(e){if(!this.#r)return!1;let t=Math.min(50,Math.max(0,e-this.#n));this.#n=e;let n=1-(1-this.#i)**(t/16.67),r=Math.max(this.#o*this.#a,2**-52),i=!0;for(let e=0;e<this.#t.length;e++){let t=this.#e[e]??NaN,a=this.#t[e]??NaN;if(Number.isNaN(t)||Number.isNaN(a)){this.#t[e]=t;continue}let o=a+(t-a)*n;n>0&&o===a||Math.abs(t-o)<=r?this.#t[e]=t:(this.#t[e]=o,i=!1)}return this.#r=!i,this.#r}};const _t=e=>`${e.colorInput}|${e.texture}`,vt={bar:`BarChart.Bar`,line:`LineChart.Line`,area:`AreaChart.Area`,scatter:`ScatterPlot.Point`},yt=1e3;var bt=class{#e;#t;#n;#r={xKey:``,xScale:`linear`,yDomain:[`auto`,`auto`],orientation:`vertical`,zKey:null,dimensions:3,stacked:!1,animate:!0};#i={onDatumActivate:null,onActiveIndexChange:null};#a;#o=null;#s=null;#c=null;#l=null;#u=0;#d=0;#f=1;#p=[];#m=0;#h=new Float64Array;#g=[];#_=null;#v=null;#y=!1;#b=!1;#x=new Map;#S=0;#C=0;#w=!0;#T=!0;#E=null;#D=new gt({speed:.16});#O=new gt({speed:.2});#k=new Map;#A=new Map;#j=!1;#M=new Map;#N=new Map;#P=0;#F=!1;#I=new Map;#L={alpha:0,target:0};#R=0;#z=null;#B=null;#V=null;#H={left:0,top:0,width:0,height:0};#U=null;#W=new Float64Array;#G=[0,1];#K={yaw:.65,pitch:-.35};#q=new gt({speed:.12});#J=new gt({speed:.16});#Y=null;#X=!1;#Z=null;#Q=new Int32Array;#$=new Map;#ee=``;#te=null;#ne=null;#re=null;#ie=void 0;#ae=null;#oe=!1;#se=null;#ce=null;#le={width:0,height:0};#ue=!1;#de=!1;#fe=0;#pe=!1;constructor(e){this.#e=e.kind,this.#t=e.elements,this.#n=e.store,this.#a=e.elements.canvas.getContext(`2d`),this.#n.onSeriesChange=()=>{this.#b=!0,this.#Te()},this.#n.onPresentationChange=()=>{this.#Te()},typeof ResizeObserver<`u`&&(this.#o=new ResizeObserver(e=>{let t=e[0];t!=null&&(this.#u=t.contentRect.width,this.#d=t.contentRect.height,this.#f=this.#ke(),this.#I.clear(),this.#te=null,this.#Te())}),this.#o.observe(e.elements.plot),this.#c=new ResizeObserver(()=>{this.#le={width:this.#t.tooltip.offsetWidth,height:this.#t.tooltip.offsetHeight},this.#Ee()}),this.#c.observe(e.elements.tooltip));let t=e.elements.root.ownerDocument.documentElement;this.#s=oe(t,()=>{this.#V=null,this.#Te()}),this.#me(),this.#J.jump([1,1])}destroy(){this.#pe=!0,this.#o?.disconnect(),this.#c?.disconnect(),this.#s?.(),this.#l?.(),this.#n.onSeriesChange=null,this.#n.onPresentationChange=null,this.#z!=null&&(clearTimeout(this.#z),this.#z=null),this.#fe!==0&&cancelAnimationFrame(this.#fe)}#me(){if(typeof matchMedia>`u`||this.#pe)return;this.#l?.();let e=matchMedia(`(resolution: ${this.#ke()}dppx)`),t=()=>{this.#f=this.#ke(),this.#I.clear(),this.#Te(),this.#me()};e.addEventListener(`change`,t,{once:!0}),this.#l=()=>e.removeEventListener(`change`,t)}setOptions(e){let t=this.#r;if(this.#r=e,t.xScale!==e.xScale&&this.#M.clear(),t.animate&&!e.animate&&this.#he(),t.dimensions!==e.dimensions){let t=[+(e.dimensions>=2),+(e.dimensions>=3)],n=xt(e.dimensions);if(this.#ve()===0||!this.#j)this.#J.jump(t),this.#K=n,this.#q.jump([n.yaw,n.pitch]);else{let e=n.yaw+Math.round((this.#K.yaw-n.yaw)/(Math.PI*2))*Math.PI*2;this.#J.aim(t,performance.now()),this.#q.jump([this.#K.yaw,this.#K.pitch]),this.#q.aim([e,n.pitch],performance.now())}}(t.xKey!==e.xKey||t.xScale!==e.xScale||t.zKey!==e.zKey||t.stacked!==e.stacked||t.yDomain[0]!==e.yDomain[0]||t.yDomain[1]!==e.yDomain[1])&&(this.#b=!0),this.#Te()}setCallbacks(e){this.#i=e}setRows(e){e!==this.#p&&(this.#p=e,this.#b=!0,this.#Te())}flushIngest(){!this.#b||this.#pe||(this.#b=!1,this.#ge())}setControlledActiveIndex(e){let t=this.#ae;this.#ae=null;let n=this.#ie!==void 0;if(this.#ie=e,e!==void 0){let n=t!=null&&t.index===e&&t.viaKeyboard;this.#nt(e==null?null:this.#$e(e),{viaKeyboard:n,notify:!1})}else n&&this.#nt(null,{viaKeyboard:!1,notify:!1});this.#Ee()}handlePointerMove(e,t){if(this.#Y!=null){let n=e-this.#Y.lastX,r=t-this.#Y.lastY;(this.#Y.moved||Math.abs(n)+Math.abs(r)>3)&&(this.#Y.moved=!0,this.#K={yaw:this.#K.yaw+n*.008,pitch:xe(this.#K.pitch+r*.008)},this.#q.jump([this.#K.yaw,this.#K.pitch]),this.#Y.lastX=e,this.#Y.lastY=t,this.#nt(null,{viaKeyboard:!1,notify:!1}),this.#Te());return}if(this.#se=e,this.#ce=t,this.#e===`scatter`){let n=this.#lt(e,t);this.#ne=n?.seriesKey??null,this.#te=n==null?null:{x:n.screenX,y:n.screenY},this.#nt(n?.index??null,{viaKeyboard:!1,notify:!0});return}let n=this.#et(e,t);this.#nt(n,{viaKeyboard:!1,notify:!0})}handlePointerDown(e,t){if(this.#X=!0,this.#xe()){this.#Y={lastX:e,lastY:t,moved:!1};return}this.handlePointerMove(e,t)}handlePointerUp(e,t){let n=this.#Y;this.#Y=null;let r=this.#X;if(this.#X=!1,n!=null){if(n.moved)return;this.handlePointerMove(e,t)}r&&this.handleActivate(e,t)}handlePointerLeave(){this.#se=null,this.#ce=null,this.#Y=null,this.#X=!1,this.#ne=null,this.#te=null,this.#nt(null,{viaKeyboard:!1,notify:!0})}handleActivate(e,t){let n=this.#Ze();if(n==null)return;let r=this.#Qe(n),i=this.#p[r];if(i==null)return;let a=this.#e===`scatter`?this.#ne:e==null||t==null?null:this.#tt(n,e,t);this.#i.onDatumActivate?.({index:r,xValue:this.#g[n]??``,datum:i,dataKey:a})}handleKeyDown(e){if(this.#m===0)return!1;let t=this.#m-1,n=this.#Ze(),r=this.#F?Math.max(1,Math.floor(this.#m/Math.max(1,this.#H.width*this.#f))):1,i=Math.max(1,Math.floor(this.#m/10)),a=(()=>{switch(e){case`ArrowLeft`:return Math.max(0,(n??this.#m)-r);case`ArrowRight`:return Math.min(t,(n??-1)+r);case`PageUp`:return Math.min(t,(n??0)+i);case`PageDown`:return Math.max(0,(n??t)-i);case`Home`:return 0;case`End`:return t;case`Escape`:return null;default:return}})();return a===void 0?e===`Enter`||e===` `?(this.handleActivate(null,null),!0):!1:(this.#se=null,this.#ce=null,this.#ne=null,this.#te=null,this.#nt(a,{viaKeyboard:!0,notify:!0}),!0)}invalidateColors(){this.#V=null,this.#Te()}#he(){this.#D.jump(this.#ye()),this.#O.jump(this.#be()),this.#J.jump([+(this.#r.dimensions>=2),+(this.#r.dimensions>=3)]);let e=xt(this.#r.dimensions);this.#K=e,this.#q.jump([e.yaw,e.pitch]);for(let e of this.#k.values())e.snap();for(let e of this.#A.values())e.snap();this.#L.alpha=this.#L.target,this.#Te()}#ge(){let e=this.#p,{xKey:t,xScale:n}=this.#r,r=this.#n.seriesSpecs();this.#I.clear();let i=this.#h;if(n===`band`||n===`point`){let n=e.length,r=new Float64Array(n),i=Array.from({length:n},()=>``),a=!1;for(let o=0;o<n;o++){let n=e[o],s=n==null?void 0:E(n,t);s!==void 0&&(a=!0),i[o]=typeof s==`string`||typeof s==`number`||s instanceof Date?s:String(s),r[o]=o}m(n===0||a,`${this.#Ce()} xKey "${t}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#_=null,this.#v=null,this.#m=n,this.#h=r,this.#g=i,this.#T=!0}else{let r=[],i=!1,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e[s],l=c==null?void 0:E(c,t);l!==void 0&&(i=!0),l!=null&&(a=!0);let u=Et(l,n===`time`);Number.isFinite(u)&&(r.push({source:s,x:u}),o=!0)}m(e.length===0||i,`${this.#Ce()} xKey "${t}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),m(!a||o,`${this.#Ce()} could not read any "${t}" values as ${n===`time`?`dates`:`numbers`} for the "${n}" x scale — check the xScale and the data types.`);let s=!0;for(let e=1;e<r.length;e++)if((r[e]?.x??0)<(r[e-1]?.x??0)){s=!1;break}let c=s?r:r.toSorted((e,t)=>e.x-t.x),l=c.length,u=new Float64Array(l),d=Array.from({length:l},()=>``),f=l===e.length,p=!0,h=new Int32Array(l);for(let e=0;e<l;e++){let t=c[e];t!=null&&(u[e]=t.x,Number.isInteger(t.x)||(p=!1),n===`time`?d[e]=new Date(t.x):d[e]=t.x,h[e]=t.source,t.source!==e&&(f=!1))}if(f)this.#_=null,this.#v=null;else{this.#_=h;let t=new Int32Array(e.length).fill(-1);for(let e=0;e<l;e++){let n=h[e];n!=null&&(t[n]=e)}this.#v=t}this.#m=l,this.#h=u,this.#g=d,this.#T=p}let a=!1;for(let e of this.#g)if(e instanceof Date&&ge(e)){a=!0;break}this.#y=a;let o=this.#h[0],s=this.#h[this.#m-1],c=i[0],l=i[i.length-1];!this.#xe()&&(n===`linear`||n===`time`)&&o!=null&&s!=null&&c!=null&&l!=null&&o>c&&s>=l?(this.#L.target=1,this.#R=performance.now()):(o!==c||s!==l)&&(this.#L.target=0);let u=this.#m,d=i.length===u&&u<=2500;if(d){for(let e=0;e<u;e++)if(i[e]!==this.#h[e]){d=!1;break}}let f=this.#x;this.#x=new Map;let p=1/0,h=-1/0,g=!0;for(let t of r){let n=new Float64Array(u),r=!1;for(let i=0;i<u;i++){let a=e[this.#_==null?i:this.#_[i]??i],o=a==null?void 0:E(a,t.dataKey);if(o===void 0){n[i]=NaN;continue}r=!0;let s=typeof o==`number`&&Number.isFinite(o)?o:NaN;n[i]=s,Number.isNaN(s)||(s<p&&(p=s),s>h&&(h=s),Number.isInteger(s)||(g=!1))}m(u===0||r,`${vt[t.mark]} dataKey "${t.dataKey}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#x.set(t.dataKey,n)}this.#S=p===1/0?0:p,this.#C=h===-1/0?0:h,this.#w=g;let _=this.#r.zKey;if(this.#e===`scatter`&&_!=null){let t=new Float64Array(u),n=1/0,r=-1/0,i=!1;for(let a=0;a<u;a++){let o=e[this.#_==null?a:this.#_[a]??a],s=o==null?void 0:E(o,_);s!==void 0&&(i=!0);let c=typeof s==`number`&&Number.isFinite(s)?s:NaN;t[a]=c,Number.isNaN(c)||(c<n&&(n=c),c>r&&(r=c))}m(u===0||i,`ScatterPlot.Root zKey "${_}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#W=t,this.#G=n===1/0?[0,1]:Y([n,r],5)}else this.#W=new Float64Array;this.#Z=null,this.#te=null,this.#E=this.#r.stacked?pt(r.map(e=>this.#x.get(e.dataKey)??new Float64Array)):null,this.#F=H({pointCount:u,columnCount:Math.max(1,Math.round(this.#H.width*this.#f)),wasDecimated:this.#F});let v=this.#V;if(v!=null){for(let e of this.#n.seriesMeta())if(v.inputs.get(e.dataKey)!==_t(e)){this.#V=null;break}}this.#_e(r,f,d);let y=this.#Ze();y!=null&&this.#nt(Math.min(y,Math.max(0,u-1)),{viaKeyboard:this.#oe,notify:!1}),this.#ot({force:!0})}#_e(e,t,n){let r=performance.now(),i=this.#ve(),a=!this.#j;this.#j=this.#j||this.#m>0,a||i===0?(this.#D.jump(this.#ye()),this.#O.jump(this.#be())):(this.#D.aim(this.#ye(),r),this.#O.aim(this.#be(),r));let o=this.#m>0&&this.#m<=2500&&n,s=new Set,c=(e,t,n)=>{s.add(e);let a=this.#k.get(e);a??(a=new ht,this.#k.set(e,a));let c=o&&n&&a.values().length===t.length;a.retarget(t,{duration:c?i:0,now:r})};e.forEach((e,n)=>{let i=t.has(e.dataKey);if(this.#E==null?c(e.dataKey,this.#x.get(e.dataKey)??new Float64Array,i):(c(`${e.dataKey}:lower`,this.#E.lower[n]??new Float64Array,i),c(`${e.dataKey}:upper`,this.#E.upper[n]??new Float64Array,i)),!this.#A.has(e.dataKey)&&this.#m>0){let t=new ht;t.retarget([0],{duration:0,now:r}),t.retarget([1],{duration:this.#ve(),now:r}),this.#A.set(e.dataKey,t)}});for(let e of this.#k.keys())s.has(e)||this.#k.delete(e)}#ve(){return!this.#r.animate||typeof matchMedia<`u`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:280}#ye(){let[e,t]=this.#r.yDomain,n,r;if(this.#E==null?this.#e===`line`||this.#e===`scatter`?(n=this.#S,r=this.#C):(n=Math.min(0,this.#S),r=Math.max(0,this.#C)):(n=Math.min(0,this.#E.min),r=Math.max(0,this.#E.max)),typeof e==`number`&&(n=e),typeof t==`number`&&(r=t),this.#m===0)return[0,1];let i=this.#e===`bar`||this.#e===`area`?Be([n,r],5):Y([n,r],5);return[typeof e==`number`?e:i[0],typeof t==`number`?t:i[1]]}#be(){if(this.#m===0)return[0,1];let e=this.#h[0]??0,t=this.#h[this.#m-1]??0;return e===t?[e-.5,t+.5]:this.#e===`scatter`?Y([e,t],5):[e,t]}#xe(){return this.#e===`scatter`&&this.#r.zKey!=null}#Se(){return this.#e===`bar`&&this.#r.orientation===`horizontal`}#Ce(){return`${vt[this.#e].split(`.`)[0]??`Chart`}.Root`}#we(e,t){let n=this.#B;n??(n=this.#t.canvas.ownerDocument.createElement(`canvas`),this.#B=n),(n.width!==e||n.height!==t)&&(n.width=e,n.height=t);let r=n.getContext(`2d`);return r==null?null:{canvas:n,ctx:r}}#Te(){this.#de=!0,this.#De()}#Ee(){this.#De()}#De(){this.#ue||this.#pe||(this.#ue=!0,this.#fe=requestAnimationFrame(()=>{this.#ue=!1,this.#fe=0,this.#Oe()}))}#Oe(){if(!this.#pe){if(this.flushIngest(),this.#de){this.#de=!1;let e=performance.now(),t=!1;t=this.#D.tick(e)||t,t=this.#O.tick(e)||t;for(let n of this.#k.values())t=n.tick(e)||t;for(let n of this.#A.values())t=n.tick(e)||t;if(t=this.#J.tick(e)||t,this.#q.tick(e)){t=!0;let e=this.#q.values();this.#K={yaw:e[0]??this.#K.yaw,pitch:e[1]??this.#K.pitch}}this.#Ae(),this.#Me(),t=this.#ze(e)||t,t&&this.#Te()}this.#dt()}}#ke(){return typeof devicePixelRatio==`number`&&devicePixelRatio>0?Math.min(devicePixelRatio,3):1}#Ae(){let e=this.#t.root,t=`${ae(e.ownerDocument.documentElement)}|${this.#f}|${this.#r.orientation}`;if(this.#V?.signature===t)return;let n=e.ownerDocument.defaultView;if(n==null)return;let r=this.#a,i=new Map,a=new Map,o=new Map;for(let t of this.#n.seriesMeta()){let n=P(e,t.colorInput);if(i.set(t.dataKey,n),a.set(t.dataKey,_t(t)),r!=null&&t.mark===`bar`&&t.texture!==`solid`){let i=V(r,{texture:t.texture,color:n,ink:N(e,ce(n)),devicePixelRatio:this.#f,orientation:this.#r.orientation});i!=null&&o.set(t.dataKey,i)}}this.#V={signature:t,series:i,inputs:a,barTextures:o,chrome:F(e),fontFamily:n.getComputedStyle(e).fontFamily||`sans-serif`}}#je(e){let t=this.#V?.signature??``;t!==this.#ee&&(this.#$.clear(),this.#ee=t);let n=this.#$.get(e);if(n!=null)return n;let r=P(this.#t.root,e);return this.#$.set(e,r),r}#Me(){let e=this.#n.getSnapshot(),t=this.#xe(),n=this.#Se(),r=!t&&e.xAxis!=null,i=!t&&e.yAxis!=null,a=n?r:i,o=(n?i:r)?24:8,s=Math.max(0,this.#d-8-o);this.#H={left:8,top:8,width:Math.max(0,this.#u-16),height:s};let c=8;if(a){c=40;let e=this.#a;if(e!=null&&this.#V!=null){e.font=`11px ${this.#V.fontFamily}`;let t=0,r=n?this.#Re().map(e=>e.text):this.#Le().map(e=>e.text);for(let n of r){let r=e.measureText(n).width;r>t&&(t=r)}c=Math.ceil(t)+14}}this.#H={left:c,top:8,width:Math.max(0,this.#u-c-8),height:s};let l=n?this.#H.top:this.#H.left,u=n?this.#H.top+this.#H.height:this.#H.left+this.#H.width;this.#U=this.#r.xScale===`band`?je({count:this.#m,rangeStart:l,rangeEnd:u,paddingInner:.2,paddingOuter:.1}):this.#r.xScale===`point`?je({count:this.#m,rangeStart:l,rangeEnd:u,paddingInner:1,paddingOuter:.5}):null,this.#F=H({pointCount:this.#m,columnCount:Math.max(1,Math.round(this.#H.width*this.#f)),wasDecimated:this.#F})}#Ne(){let e=this.#D.values();return Ae([e[0]??0,e[1]??1],[this.#H.top+this.#H.height,this.#H.top])}#Pe(){let e=this.#D.values(),t=this.#Se()?[this.#H.left,this.#H.left+this.#H.width]:[this.#H.top+this.#H.height,this.#H.top];return Ae([e[0]??0,e[1]??1],t)}#Fe(){let e=this.#O.values();return Ae([e[0]??0,e[1]??1],[this.#H.left,this.#H.left+this.#H.width])}#Ie(e){let t=this.#U;if(t!=null)return J(t,e);let{k:n,b:r}=this.#Fe();return(this.#h[e]??0)*n+r}#Le(){let e=this.#n.getSnapshot(),t=this.#D.values(),n=Pe([t[0]??0,t[1]??1],e.yAxis?.tickCount??5,{integer:this.#w}),r=e.yAxis?.tickFormat,i=n.length>1?pe(Math.abs((n[1]??0)-(n[0]??0))):void 0;return n.map(e=>({value:e,text:r==null?W(e,i==null?void 0:{maximumFractionDigits:i}):r(e)}))}#Re(){let e=this.#n.getSnapshot(),t=e.xAxis?.tickFormat;if(this.#U!=null){let e=this.#Se(),n=e?this.#H.height:this.#H.width,r=Math.max(1,Math.floor(n/(e?15:60))),i=Math.max(1,Math.ceil(this.#m/r)),a=[];for(let e=0;e<this.#m;e+=i){let n=this.#g[e]??``;a.push({index:e,value:e,text:t==null?G(n,{datasetHasTimeOfDay:this.#y}):t(n)})}return a}let n=this.#O.values(),r=[n[0]??0,n[1]??1],i=e.xAxis?.tickCount??Math.max(2,Math.floor(this.#H.width/90));if(this.#r.xScale===`time`){let e=ze(r);return Re(r,i).map(n=>({index:null,value:n,text:t==null?e(n):t(new Date(n))}))}let a=Pe(r,i,{integer:this.#T}),o=a.length>1?pe(Math.abs((a[1]??0)-(a[0]??0))):void 0;return a.map(e=>({index:null,value:e,text:t==null?W(e,o==null?void 0:{maximumFractionDigits:o}):t(e)}))}#ze(e){let t=this.#a,n=this.#V;if(t==null||n==null||this.#u<=0||this.#d<=0)return!1;let r=Math.min(50,Math.max(0,e-this.#P));this.#P=e;let i=this.#t.canvas,a=Math.round(this.#u*this.#f),o=Math.round(this.#d*this.#f);(i.width!==a||i.height!==o)&&(i.width=a,i.height=o),t.setTransform(this.#f,0,0,this.#f,0,0),t.clearRect(0,0,this.#u,this.#d);let s=this.#n.getSnapshot(),c=this.#H;if(c.width<=0||c.height<=0)return!1;let l=this.#Ne(),u=this.#Fe(),d=this.#n.seriesSpecs(),f=this.#xe(),p=this.#ve()===0,m=f?[]:this.#Be(t,n.fontFamily),h=f?[]:this.#Ve(t,n.fontFamily),g=St(this.#M,m,r,p);g=St(this.#N,h,r,p)||g;let _=this.#L;if(_.target===1){if(e-this.#R>yt)_.target=0;else if(this.#z==null){let t=yt-(e-this.#R)+17;this.#z=setTimeout(()=>{this.#z=null,this.#Te()},t)}}if(p)_.alpha=_.target;else{let e=1-(1-(_.target>_.alpha?.16:.08))**(r/16.67);_.alpha+=(_.target-_.alpha)*e,Math.abs(_.target-_.alpha)<.02&&(_.alpha=_.target)}_.alpha!==_.target&&(g=!0);let v=this.#Se(),y=v?this.#Pe():l,b=e=>this.#U==null?e*u.k+u.b:J(this.#U,e),x=e=>e*y.k+y.b,S=[...this.#M.entries()].map(([e,t])=>({position:b(e),alpha:t.alpha})),C=[...this.#N.entries()].map(([e,t])=>({position:x(e),alpha:t.alpha}));if(s.grid!=null&&!f){let e=s.grid.lines??(v?`vertical`:`horizontal`),r=v?S:C,i=v?C:S;He(t,{plot:c,color:n.chrome.grid,xLines:e===`horizontal`?[]:i,yLines:e===`vertical`?[]:r})}let w=Math.min(40,c.width*.25),T=t,E=null;_.alpha>.01&&w>1&&(E=this.#we(a,o),E!=null&&(E.ctx.setTransform(this.#f,0,0,this.#f,0,0),E.ctx.clearRect(0,0,this.#u,this.#d),T=E.ctx)),T.save(),T.beginPath(),T.rect(c.left,c.top,c.width,c.height+1),T.clip();let D=null;if(this.#e===`bar`?v?this.#qe(T,d):this.#Ke(T,d,l):this.#e===`scatter`?D=this.#st(T,d,l):this.#Je(T,d,l),T.restore(),E!=null){T.save(),T.globalCompositeOperation=`destination-out`;let e=T.createLinearGradient(c.left,0,c.left+w,0);e.addColorStop(0,`rgba(0, 0, 0, ${_.alpha})`),e.addColorStop(1,`rgba(0, 0, 0, 0)`),T.fillStyle=e,T.fillRect(c.left,c.top,w,c.height+1),T.restore(),t.drawImage(E.canvas,0,0,this.#u,this.#d)}D!=null&&lt(t,{textColor:n.chrome.tickText,fontFamily:n.fontFamily,plot:c,center:D.center,axes:D.axes}),this.#e===`bar`&&this.#m>0&&(v?We(t,{plot:c,color:n.chrome.baseline,x:x(0)}):Ue(t,{plot:c,color:n.chrome.baseline,y:x(0)}));for(let e of f?[]:s.referenceLines){let r=x(e.y);if(v?r<c.left||r>c.left+c.width:r<c.top||r>c.top+c.height)continue;let i=e.color==null?n.chrome.reference:this.#je(e.color);v?dt(t,{plot:c,color:i,textColor:n.chrome.tickText,x:r,label:e.label,fontFamily:n.fontFamily}):ut(t,{plot:c,color:i,textColor:n.chrome.tickText,y:r,label:e.label,fontFamily:n.fontFamily})}let O=s.xAxis==null||f?[]:[...this.#M.entries()].map(([e,t])=>({position:b(e),text:t.text,alpha:t.alpha})),k=s.yAxis==null||f?[]:[...this.#N.entries()].map(([e,t])=>({position:x(e),text:t.text,alpha:t.alpha})),A=v?k:O,j=v?O:k;return(A.length>0||j.length>0)&&ft(t,{plot:c,color:n.chrome.tickText,fontFamily:n.fontFamily,xLabels:A,yLabels:j}),g}#Be(e,t){e.font=`11px ${t}`;let n=this.#Se(),r=this.#Fe(),i=[],a=-1/0;for(let t of this.#Re()){let o=t.index!=null&&this.#U!=null,s=o&&this.#U!=null?J(this.#U,t.index??0):t.value*r.k+r.b,c=n?15/2:e.measureText(t.text).width/2,l=n?2:8;s-c<a+l||(a=s+c,i.push({key:o?t.index??0:t.value,text:t.text}))}return i}#Ve(e,t){let n=this.#Le();if(!this.#Se())return n.map(e=>({key:e.value,text:e.text}));e.font=`11px ${t}`;let r=this.#Pe(),i=[],a=-1/0;for(let t of n){let n=t.value*r.k+r.b,o=e.measureText(t.text).width/2;n-o<a+8||(a=n+o,i.push({key:t.value,text:t.text}))}return i}#He(e,t){let n=t===`value`?e.dataKey:`${e.dataKey}:${t}`;if(!this.#F&&this.#m<=2500){let e=this.#k.get(n);if(e!=null&&e.values().length===this.#m)return e.values()}if(t===`value`)return this.#x.get(e.dataKey)??new Float64Array;let r=this.#n.seriesSpecs().findIndex(t=>t.dataKey===e.dataKey);return(t===`lower`?this.#E?.lower:this.#E?.upper)?.[r]??new Float64Array}#Ue(e){return this.#A.get(e)?.values()[0]??1}#We(e,t){if(e==null)return 0;let n=e[t]??0;return Number.isNaN(n)?0:n}#Ge(e,t,n){let r=this.#E;if(r==null)return!0;let i=r.lower[e]?.[t]??NaN,a=r.upper[e]?.[t]??NaN;if(Number.isNaN(i)||Number.isNaN(a))return!1;let o=i<0,s=(o?r.negativeEnd:r.positiveEnd)[t]??-1;if(s<0)return!1;let c=(o?r.lower:r.upper)[s]?.[t]??NaN;return j({lower:i,upper:a,pileOuter:c,toPixel:n})}#Ke(e,t,n){let r=this.#U,i=this.#V;if(r==null||i==null||this.#m===0||t.length===0)return;let a=this.#E!=null,o=a?1:t.length,s=r.bandwidth>=8*o?2:+(r.bandwidth>=3*o),c=(r.bandwidth-s*(o-1))/o,l=D({step:r.step,slot:c}),u=e=>e*n.k+n.b;t.forEach((t,n)=>{let d=this.#Ue(t.dataKey),f=[],p=a?this.#He(t,`lower`):null,m=a?this.#He(t,`upper`):this.#He(t,`value`);for(let e=0;e<this.#m;e++){let t=m[e]??NaN;if(Number.isNaN(t))continue;let i=this.#We(p,e),h=a?q(r,e)+(r.bandwidth-l)/2:q(r,e)+(r.bandwidth-(c*o+s*(o-1)))/2+n*(c+s)+(c-l)/2,g=A({lower:i,upper:t,toPixel:u,reveal:d,gap:a?s:0});f.push({x:h,width:l,baselineY:g.baseline,valueY:g.value,rounded:this.#Ge(n,e,u)})}Ge(e,{fill:i.barTextures.get(t.dataKey)??i.series.get(t.dataKey)??`currentColor`,rects:f})})}#qe(e,t){let n=this.#U,r=this.#V;if(n==null||r==null||this.#m===0||t.length===0)return;let i=this.#Pe(),a=this.#E!=null,o=a?1:t.length,s=n.bandwidth>=8*o?2:+(n.bandwidth>=3*o),c=(n.bandwidth-s*(o-1))/o,l=D({step:n.step,slot:c}),u=e=>e*i.k+i.b;t.forEach((t,i)=>{let d=this.#Ue(t.dataKey),f=[],p=a?this.#He(t,`lower`):null,m=a?this.#He(t,`upper`):this.#He(t,`value`);for(let e=0;e<this.#m;e++){let t=m[e]??NaN;if(Number.isNaN(t))continue;let r=this.#We(p,e),h=a?q(n,e)+(n.bandwidth-l)/2:q(n,e)+(n.bandwidth-(c*o+s*(o-1)))/2+i*(c+s)+(c-l)/2,g=A({lower:r,upper:t,toPixel:u,reveal:d,gap:a?s:0});f.push({y:h,height:l,baselineX:g.baseline,valueX:g.value,rounded:this.#Ge(i,e,u)})}Ke(e,{fill:r.barTextures.get(t.dataKey)??r.series.get(t.dataKey)??`currentColor`,rects:f})})}#Je(e,t,n){let r=this.#V;if(r==null||this.#m===0)return;let i=this.#Fe(),a=this.#U,o=e=>a==null?(this.#h[e]??0)*i.k+i.b:J(a,e);t.forEach(t=>{let i=r.series.get(t.dataKey)??`currentColor`,a=this.#Ue(t.dataKey);if(e.save(),a<1&&(e.beginPath(),e.rect(this.#H.left,0,this.#H.width*a,this.#d),e.clip()),this.#F){this.#Ye(e,t,i,n),e.restore();return}let s=t.mark===`area`,c=this.#He(t,this.#E==null?`value`:`upper`),l=this.#E==null?null:this.#He(t,`lower`),u=e=>!Number.isNaN(c[e]??NaN),d=[];for(let e=0;e<this.#m;e++)(!t.connectNulls||u(e))&&d.push(e);let f=e=>(c[e]??0)*n.k+n.b;if(s){let r=l==null?()=>0*n.k+n.b:e=>(l[e]??0)*n.k+n.b;Je(e,{color:i,curve:t.curve,indexes:d,xAt:o,y0At:r,y1At:f,definedAt:u})}else qe(e,{color:i,curve:t.curve,indexes:d,xAt:o,yAt:f,definedAt:u}),t.markers&&this.#H.width/this.#m>=12&&rt(e,{color:i,surface:r.chrome.surface,shape:this.#n.seriesShape(t.dataKey),indexes:d,xAt:o,yAt:f,definedAt:u});e.restore()})}#Ye(e,t,n,r){let i=Math.max(1,Math.round(this.#H.width*this.#f)),a=e=>this.#H.left+(e+.5)/this.#f;if(t.mark===`area`){let o=this.#Xe(`${t.dataKey}:upper`,this.#He(t,this.#E==null?`value`:`upper`),i),s=this.#E==null?null:this.#Xe(`${t.dataKey}:lower`,this.#He(t,`lower`),i);s==null?Xe(e,{color:n,lowerColumns:Dt(o,0),upperColumns:o,columnToX:a,valueK:r.k,valueB:r.b}):Xe(e,{color:n,lowerColumns:s,upperColumns:o,columnToX:a,valueK:r.k,valueB:r.b});return}let o=this.#Xe(t.dataKey,this.#He(t,`value`),i);Ye(e,{color:n,columns:o,columnToX:a,valueK:r.k,valueB:r.b})}#Xe(e,t,n){let r=this.#O.values(),i=`${r[0]??0}:${r[1]??1}:${n}`,a=this.#I.get(e);if(a!=null&&a.key===i)return a.columns;let o=[r[0]??0,r[1]??1],s=Ae(o,[0,n]),c=ue({xs:this.#h,values:t,startIndex:0,endIndex:this.#m-1,positionK:s.k,positionB:s.b,columnCount:n});return this.#I.set(e,{key:i,columns:c}),c}#Ze(){if(this.#m===0)return null;let e;return e=this.#ie===void 0?this.#re:this.#ie==null?null:this.#$e(this.#ie),e==null?null:Math.min(Math.max(0,e),this.#m-1)}#Qe(e){return this.#_==null?e:this.#_[e]??e}#$e(e){if(this.#p.length===0)return null;let t=Math.min(Math.max(0,e),this.#p.length-1);if(this.#v==null)return t;let n=this.#v[t]??-1;return n===-1?null:n}#et(e,t){if(this.#m===0)return null;let n=this.#U;if(n!=null)return Ne(n,this.#Se()?t:e);let{k:r,b:i}=this.#Fe();if(r===0)return 0;let a=e;if(this.#F){let t=Math.floor((e-this.#H.left)*this.#f);a=this.#H.left+(t+.5)/this.#f}return _e(this.#h,this.#m,(a-i)/r)}#tt(e,t,n){let r=this.#n.seriesSpecs(),i=this.#Se(),a=this.#U;if(this.#e===`bar`&&this.#E==null&&a!=null&&r.length>1){let o=(i?n:t)-q(a,e),s=Math.floor(o/Math.max(1,a.bandwidth)*r.length);return r[Math.min(r.length-1,Math.max(0,s))]?.dataKey??null}let{k:o,b:s}=i?this.#Pe():this.#Ne(),c=i?t:n,l=this.#E;if(this.#e===`bar`&&l!=null)for(let t=0;t<r.length;t++){let n=l.lower[t]?.[e]??NaN,i=l.upper[t]?.[e]??NaN;if(Number.isNaN(n)||Number.isNaN(i)||n===i)continue;let a=n*o+s,u=i*o+s;if(c>=Math.min(a,u)&&c<=Math.max(a,u))return r[t]?.dataKey??null}let u=null,d=1/0;return r.forEach((t,n)=>{let r=(this.#E==null?this.#x.get(t.dataKey):this.#E.upper[n])?.[e]??NaN;if(Number.isNaN(r))return;let i=Math.abs(r*o+s-c);i<d&&(d=i,u=t.dataKey)}),u}#nt(e,t){let n=e==null||this.#m===0?null:Math.min(Math.max(0,e),this.#m-1),r=this.#ie!==void 0;if(t.notify&&n!==this.#Ze()){let e=n==null?null:this.#Qe(n);if(this.#i.onActiveIndexChange?.(e),r){this.#ae={index:e,viaKeyboard:t.viaKeyboard};return}}this.#oe=t.viaKeyboard,r||(this.#re=n),this.#ot(),this.#Ee()}#rt=null;#it=!1;#at=null;#ot(e={force:!1}){let t=this.#Ze();if(!e.force&&t===this.#rt&&this.#oe===this.#it&&this.#ne===this.#at)return;if(this.#rt=t,this.#it=this.#oe,this.#at=this.#ne,t==null||this.#m===0){this.#n.publishHover(null);return}let n=this.#Qe(t),r=this.#p[n]??{},i=this.#n.seriesMeta().map(e=>{let n=this.#x.get(e.dataKey)?.[t]??NaN;return{dataKey:e.dataKey,label:e.label,value:Number.isNaN(n)?null:n,color:e.color}});this.#r.stacked&&i.reverse(),this.#e===`scatter`&&(i=this.#ne==null?i.filter(e=>e.value!=null):i.filter(e=>e.dataKey===this.#ne));let a={index:n,xValue:this.#g[t]??``,datum:r,points:i,viaKeyboard:this.#oe};if(this.#xe()){let e=this.#W[t]??NaN;a.zValue=Number.isNaN(e)?null:e}this.#n.publishHover(a)}#st(e,t,n){let r=this.#V;if(r==null||this.#m===0||t.length===0)return null;if(this.#xe())return this.#ct(e,t);let i=this.#Fe(),a=t.map(e=>{let t=this.#He(e,`value`),n=[];for(let e=0;e<this.#m;e++)Number.isNaN(t[e]??NaN)||n.push(e);return n}),o=a.reduce((e,t)=>e+t.length,0);return t.forEach((t,s)=>{let c=this.#He(t,`value`),l=a[s]??[];e.save(),e.globalAlpha=this.#Ue(t.dataKey),ot(e,{color:r.series.get(t.dataKey)??`currentColor`,surface:r.chrome.surface,shape:this.#n.seriesShape(t.dataKey),totalPointCount:o,indexes:l,xAt:e=>(this.#h[e]??0)*i.k+i.b,yAt:e=>(c[e]??0)*n.k+n.b,radiusAt:()=>4}),e.restore()}),null}#ct(e,t){let n=this.#V;if(n==null)return null;let r=this.#H,i=ye(this.#K),a=r.left+r.width/2,o=r.top+r.height/2,s=this.#J.values(),c=s[0]??1,l=s[1]??1,u=.85-.22*c-.11*l,d=Math.min(r.width,r.height)/2*u,f=this.#O.values(),p=[f[0]??0,f[1]??1],m=this.#D.values(),h=[m[0]??0,m[1]??1],g=this.#G,_=t.map(e=>this.#Ue(e.dataKey)),v=this.#J.values(),y=v[0]??1,b=v[1]??1,x=(e,t,n)=>{let r=be(e,t,n,i);return{x:a+r.x*d,y:o-r.y*d}},S=Ce.map(([e,t,n])=>x(e,t,n)),C=t[0],w=t.length===1&&C!=null?C.dataKey:`y`,T=[{label:this.#r.xKey,alpha:1,from:x(-1,-y,-b),to:x(1,-y,-b)},{label:w,alpha:y,from:x(-1,-1,-b),to:x(-1,1,-b)},{label:this.#r.zKey??`z`,alpha:b,from:x(-1,-y,-1),to:x(-1,-y,1)}];ct(e,{gridColor:n.chrome.grid,axisColor:n.chrome.baseline,corners:S,edges:we,cubeAlpha:b,axes:T});let E=this.#m*t.length,D=this.#Z;(D==null||D.screenX.length<E)&&(D={screenX:new Float64Array(E),screenY:new Float64Array(E),radius:new Float64Array(E),seriesIndex:new Int32Array(E),pointIndex:new Int32Array(E),depths:new Float64Array(E),count:0});let O=D.depths,k=0;t.forEach((e,t)=>{let n=this.#He(e,`value`);for(let e=0;e<this.#m;e++){let r=n[e]??NaN,s=this.#W[e]??NaN;if(Number.isNaN(r)||Number.isNaN(s))continue;let c=be(Se(this.#h[e]??0,p),Se(r,h)*y,Se(s,g)*b,i);D.screenX[k]=a+c.x*d,D.screenY[k]=o-c.y*d,D.radius[k]=4*c.scale,D.seriesIndex[k]=t,D.pointIndex[k]=e,O[k]=c.depth,k+=1}}),D.count=k,this.#Z=D,this.#Q.length<k&&(this.#Q=new Int32Array(E));let A=this.#Q.subarray(0,k);for(let e=0;e<k;e++)A[e]=e;A.sort((e,t)=>(O[t]??0)-(O[e]??0));let j=t.map(e=>this.#n.seriesShape(e.dataKey));return st(e,{count:k,order:A,screenX:D.screenX,screenY:D.screenY,radius:D.radius,colorAt:e=>{let r=t[D.seriesIndex[e]??0];return r==null?`currentColor`:n.series.get(r.dataKey)??`currentColor`},shapeAt:e=>j[D.seriesIndex[e]??0]??`circle`,alphaAt:e=>_[D.seriesIndex[e]??0]??1,surface:n.chrome.surface}),{center:{x:a,y:o},axes:T}}#lt(e,t){let n=this.#n.seriesSpecs(),r=576,i=null;if(this.#xe()){let a=this.#Z;if(a==null)return null;for(let o=0;o<a.count;o++){let s=(a.screenX[o]??0)-e,c=(a.screenY[o]??0)-t,l=s*s+c*c;if(l<r){let e=n[a.seriesIndex[o]??0];if(e==null)continue;r=l,i={seriesKey:e.dataKey,index:a.pointIndex[o]??0,screenX:a.screenX[o]??0,screenY:a.screenY[o]??0}}}return i}let a=this.#Fe(),o=this.#Ne();for(let s of n){let n=this.#x.get(s.dataKey);if(n!=null)for(let c=0;c<this.#m;c++){let l=n[c]??NaN;if(Number.isNaN(l))continue;let u=(this.#h[c]??0)*a.k+a.b,d=l*o.k+o.b,f=u-e,p=d-t,m=f*f+p*p;m<r&&(r=m,i={seriesKey:s.dataKey,index:c,screenX:u,screenY:d})}}return i}#ut(e){let t=this.#n.seriesSpecs();if(this.#xe()){let t=this.#Z;if(t==null)return null;for(let n=0;n<t.count;n++)if((t.pointIndex[n]??-1)===e)return{x:t.screenX[n]??0,y:t.screenY[n]??0};return null}let n=this.#Fe(),r=this.#Ne();for(let i of t){let t=this.#x.get(i.dataKey)?.[e]??NaN;if(!Number.isNaN(t))return{x:(this.#h[e]??0)*n.k+n.b,y:t*r.k+r.b}}return null}#dt(){let{crosshair:e,band:t,markers:n,tooltip:r}=this.#t,i=this.#Ze(),a=i!=null&&this.#m>0,o=this.#e===`bar`,s=this.#e===`scatter`;if(e.style.opacity=a&&!o&&!s?`1`:`0`,t.style.opacity=a&&o?`1`:`0`,n.style.opacity=a&&!o?`1`:`0`,r.style.opacity=a?`1`:`0`,!a)return;let c=this.#H;if(s){let e=this.#te??this.#ut(i);if(e==null){n.style.opacity=`0`,r.style.opacity=`0`;return}for(;n.children.length>1;)n.lastElementChild?.remove();n.children.length===0&&n.appendChild(wt(n.ownerDocument));let t=n.children[0];if(t instanceof HTMLElement){let n=this.#n.seriesMeta(),r=this.#ne==null?n.find(e=>{let t=this.#x.get(e.dataKey)?.[i]??NaN;return!Number.isNaN(t)}):n.find(e=>e.dataKey===this.#ne);t.style.opacity=`1`,Tt(t,r?.shape??`circle`,r?.color??`currentColor`),t.style.transform=`translate3d(${e.x}px, ${e.y}px, 0)`}this.#ft(e.x,e.y);return}let l=this.#Ie(i),u=this.#Se();if(o){let e=this.#U;if(e!=null){let n=Me(e,i),r=Math.max(1,n.size),a=n.start-(r-n.size)/2;u?(t.style.transform=`translate3d(${c.left}px, ${a}px, 0)`,t.style.width=`${c.width}px`,t.style.height=`${r}px`):(t.style.transform=`translate3d(${a}px, ${c.top}px, 0)`,t.style.width=`${r}px`,t.style.height=`${c.height}px`)}}else{e.style.transform=`translate3d(${l}px, ${c.top}px, 0)`,e.style.height=`${c.height}px`;let t=this.#n.seriesMeta(),r=this.#n.seriesSpecs();for(;n.children.length>t.length;)n.lastElementChild?.remove();for(;n.children.length<t.length;)n.appendChild(wt(n.ownerDocument));let a=this.#Ne();t.forEach((e,t)=>{let o=n.children[t];if(!(o instanceof HTMLElement))return;let s=this.#x.get(e.dataKey)?.[i]??NaN,c=r[t],u=c==null?NaN:this.#He(c,this.#E==null?`value`:`upper`)[i]??NaN;if(Number.isNaN(s)||Number.isNaN(u)){o.style.opacity=`0`;return}o.style.opacity=`1`,Tt(o,e.shape,e.color),o.style.transform=`translate3d(${l}px, ${u*a.k+a.b}px, 0)`})}o&&u&&this.#U!=null?this.#ft(this.#se??c.left+c.width/2,J(this.#U,i)):this.#ft(l,this.#ce??c.top+8)}#ft(e,t){let n=this.#H,r=this.#t.tooltip,i=this.#le,a=e+12;a+i.width>n.left+n.width&&e-12-i.width>=n.left&&(a=e-12-i.width);let o=Math.max(0,Math.min(t-i.height/2,n.top+n.height-i.height));r.style.transform=`translate3d(${a}px, ${o}px, 0)`}};const xt=e=>e===3?{yaw:.65,pitch:-.35}:{yaw:0,pitch:0},St=(e,t,n,r)=>{for(let t of e.values())t.target=0;for(let n of t){let t=e.get(n.key);t==null?e.set(n.key,{alpha:+!!r,target:1,text:n.text}):(t.target=1,t.text=n.text)}let i=1-.84**(n/16.67),a=1-.88**(n/16.67),o=!1;for(let[t,n]of e){if(r)n.alpha=n.target;else{let e=n.target>n.alpha?i:a;n.alpha+=(n.target-n.alpha)*e}if(n.target===1&&n.alpha>.98&&(n.alpha=1),n.target===0&&n.alpha<.03){e.delete(t);continue}n.alpha!==n.target&&(o=!0)}return o},Ct={circle:`circle(50%)`,square:`inset(8%)`,triangle:`polygon(50% 0%, 100% 100%, 0% 100%)`,diamond:`polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)`,"triangle-down":`polygon(0% 0%, 100% 0%, 50% 100%)`,plus:`polygon(33.33% 0%, 66.67% 0%, 66.67% 33.33%, 100% 33.33%, 100% 66.67%, 66.67% 66.67%, 66.67% 100%, 33.33% 100%, 33.33% 66.67%, 0% 66.67%, 0% 33.33%, 33.33% 33.33%)`,cross:`polygon(73.57% 2.86%, 97.14% 26.43%, 73.57% 50%, 97.14% 73.57%, 73.57% 97.14%, 50% 73.57%, 26.43% 97.14%, 2.86% 73.57%, 26.43% 50%, 2.86% 26.43%, 26.43% 2.86%, 50% 26.43%)`,star:`polygon(50% 2.45%, 61.8% 38.77%, 100% 38.77%, 69.1% 61.23%, 80.9% 97.55%, 50% 75.1%, 19.1% 97.55%, 30.9% 61.23%, 0% 38.77%, 38.2% 38.77%)`},wt=e=>{let t=e.createElement(`div`);t.setAttribute(`data-slot`,`chart-active-point`),t.style.position=`absolute`,t.style.width=`12px`,t.style.height=`12px`,t.style.left=`-6px`,t.style.top=`-6px`;let n=e.createElement(`div`);n.style.position=`absolute`,n.style.inset=`0`,n.style.backgroundColor=`var(--background-color-card)`;let r=e.createElement(`div`);return r.style.position=`absolute`,r.style.inset=`2px`,t.appendChild(n),t.appendChild(r),t},Tt=(e,t,n)=>{let r=Ct[t];e.setAttribute(`data-shape`,t);let[i,a]=e.children;i instanceof HTMLElement&&(i.style.clipPath=r),a instanceof HTMLElement&&(a.style.clipPath=r,a.style.backgroundColor=n)},Et=(e,t)=>e instanceof Date?e.getTime():typeof e==`number`?e:t&&typeof e==`string`?new Date(e).getTime():NaN,Dt=(e,t)=>({columnCount:e.columnCount,hasData:e.hasData,minValue:new Float64Array(e.columnCount).fill(t),maxValue:new Float64Array(e.columnCount).fill(t),inValue:new Float64Array(e.columnCount).fill(t),outValue:new Float64Array(e.columnCount).fill(t)}),Ot=e=>e.replaceAll(`|`,`\\|`).replaceAll(/\s*\n\s*/g,` `),kt=e=>e instanceof Date?Number.isNaN(e.getTime())?`—`:e.toISOString():typeof e==`number`?Number.isFinite(e)?String(e):`—`:typeof e==`string`?Ot(e):`—`,At=e=>typeof e==`number`&&Number.isFinite(e)?String(e):`—`,jt=e=>`| ${e.join(` | `)} |`,Mt=({data:e,xKey:t,series:n,zKey:r})=>{let i=[Ot(t),...n.map(e=>Ot(e.label)),...r==null?[]:[Ot(r)]],a=e.map(e=>[kt(E(e,t)),...n.map(t=>At(E(e,t.dataKey))),...r==null?[]:[At(E(e,r))]]);return[jt(i),jt(i.map(()=>`---`)),...a.map(e=>jt(e))].join(`
2
+ `)},Nt=(e,t)=>e==null?`var(${M(t)})`:te(e)?`var(${M(e)})`:e,Pt={"chart-1":`circle`,"chart-2":`square`,"chart-3":`triangle`,"chart-4":`diamond`,"chart-5":`triangle-down`,"chart-6":`plus`,"chart-7":`cross`,"chart-8":`star`,"chart-other":`circle`},Ft=(e,t)=>e??Pt[t],It={1:`chart-1`,2:`chart-2`,3:`chart-3`,4:`chart-4`,5:`chart-5`,6:`chart-6`,7:`chart-7`,8:`chart-8`,other:`chart-other`},Lt=e=>{let t=new Set;for(let n of e)n.seriesSlot!=null&&n.seriesSlot!==`other`&&t.add(It[n.seriesSlot]);let n=new Map,r=new Set(t);for(let t of e){if(t.seriesSlot!=null){n.set(t.dataKey,It[t.seriesSlot]);continue}let e=re.find(e=>!r.has(e))??`chart-other`;n.set(t.dataKey,e),r.add(e)}return n};var Rt=class{#e=new Set;#t={series:[],hover:null,grid:null,xAxis:null,yAxis:null,referenceLines:[],tooltip:null,orientation:`vertical`};#n=new Map;#r=new Map;#i=0;#a=null;#o=!1;#s=`vertical`;#c=null;#l=null;#u=new Map;#d=new Map;#f=null;#p=null;onSeriesChange=null;onPresentationChange=null;subscribe=e=>(this.#e.add(e),()=>{this.#e.delete(e)});getSnapshot=()=>this.#t;seriesSpecs(){return[...this.#n.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec)}seriesShape(e){let t=this.seriesSpecs(),n=Lt(t).get(e)??`chart-other`;return Ft(t.find(t=>t.dataKey===e)?.shape,n)}registerSeries(e){let t=this.#r.get(e.dataKey)??this.#i++;return this.#r.set(e.dataKey,t),this.#n.set(e.dataKey,{spec:e,sequence:t}),this.#m({seriesChanged:!0}),()=>{this.#n.get(e.dataKey)?.spec===e&&(this.#n.delete(e.dataKey),this.#m({seriesChanged:!0}))}}setDecorative(e){this.#o!==e&&(this.#o=e,this.#m({seriesChanged:!0}))}setOrientation(e){this.#s!==e&&(this.#s=e,this.#m())}registerGrid(e){let t={lines:e};return this.#a=t,this.#m(),()=>{this.#a===t&&(this.#a=null,this.#m())}}registerXAxis(e){return this.#c=e,this.#m(),()=>{this.#c===e&&(this.#c=null,this.#m())}}registerYAxis(e){return this.#l=e,this.#m(),()=>{this.#l===e&&(this.#l=null,this.#m())}}registerReferenceLine(e,t){let n=this.#d.get(e)??this.#i++;return this.#d.set(e,n),this.#u.set(e,{spec:t,sequence:n}),this.#m(),()=>{this.#u.get(e)?.spec===t&&(this.#u.delete(e),this.#m())}}registerTooltip(e){return this.#f=e,this.#m(),()=>{this.#f===e&&(this.#f=null,this.#m())}}publishHover(e){this.#p!==e&&(this.#p=e,this.#t={...this.#t,hover:e},this.#h())}seriesMeta(){let e=this.seriesSpecs(),t=Lt(e);return e.map(e=>{let n=t.get(e.dataKey)??`chart-other`,r=this.#o?ne:Nt(e.color,n),i=this.#o?ne:e.color??n;return{dataKey:e.dataKey,label:e.label,mark:e.mark,color:r,colorInput:i,shape:Ft(e.shape,n),texture:e.texture}})}#m(e={seriesChanged:!1}){this.#t={series:this.seriesMeta(),hover:this.#p,grid:this.#a,xAxis:this.#c,yAxis:this.#l,referenceLines:[...this.#u.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec),tooltip:this.#f,orientation:this.#s},this.#h(),e.seriesChanged?this.onSeriesChange?.():this.onPresentationChange?.()}#h(){for(let e of this.#e)e()}};const zt=a(null),Z=e=>{let t=o(zt);return m(t,`${e} must be composed inside ${e.split(`.`)[0]}.Root — it registers into the chart it belongs to and renders nothing on its own.`),t},Bt=e=>p(e.subscribe,e.getSnapshot,e.getSnapshot),Vt=(e,t)=>{for(let n of e){let e=E(n,t);if(e!=null)return e instanceof Date?`time`:typeof e==`number`?`linear`:`point`}return`point`},Ht=[`auto`,`auto`],Ut=({kind:r,componentName:i,slotName:a,data:o,xKey:s,xScale:p,zKey:v,dimensions:y=3,yDomain:b=Ht,stacked:x=!1,orientation:S=`vertical`,animate:C=!0,pending:w=!1,decorative:T=!1,activeIndex:D,onActiveIndexChange:O,onDatumActivate:k,className:A,children:j,ref:ee,"data-slot":te,"aria-label":M,"aria-labelledby":ne,"aria-hidden":re,tabIndex:ie,...N})=>{let[P]=f(()=>new Rt),F=d(null),[ae]=f(()=>({kind:r,componentName:i,store:P,engineRef:F,dataRef:{current:{data:o,xKey:s,zKey:v}}}));l(()=>{ae.dataRef.current={data:o,xKey:s,zKey:v}},[ae,o,s,v]);let oe=d(null),I=e(oe,ee),se=d(null),L=d(null),ce=d(null),R=d(null),z=d(null),B=d(null),le=c(),V=r===`bar`?`band`:p??Vt(o,s);m(r!==`scatter`||o.length===0||V!==`point`,`${i}.Root requires numeric or Date x values — the "${s}" values are not numbers or dates, so they have no position on a continuous scatter axis.`);let[H,ue]=b,U=u(()=>{for(let e of o){let t=E(e,s);if(t instanceof Date&&ge(t))return!0}return!1},[o,s]);return l(()=>{let e=oe.current,t=se.current,n=L.current,i=ce.current,a=R.current,o=z.current,s=B.current;if(e==null||t==null||n==null||i==null||a==null||o==null||s==null)return;let c=new bt({kind:r,store:P,elements:{root:e,plot:t,canvas:n,crosshair:i,band:a,markers:o,tooltip:s}});return F.current=c,()=>{F.current=null,c.destroy()}},[r,P]),l(()=>{F.current?.setOptions({xKey:s,xScale:V,yDomain:[H,ue],zKey:v??null,dimensions:y,stacked:x,orientation:S,animate:C}),P.setOrientation(S),P.setDecorative(T)},[P,T,s,V,H,ue,v,y,x,S,C]),l(()=>{F.current?.setRows(o)},[o]),l(()=>{F.current?.setCallbacks(T?{onDatumActivate:null,onActiveIndexChange:null}:{onDatumActivate:k??null,onActiveIndexChange:O??null})}),l(()=>{F.current?.setControlledActiveIndex(T?void 0:D)},[T,D]),l(()=>{F.current?.flushIngest()}),g(`div`,{"data-slot":n(te,a),className:t(`relative flex aspect-video w-full flex-col`,A),"aria-hidden":T?!0:re,tabIndex:T?void 0:ie,ref:I,...N,children:_(zt.Provider,{value:ae,children:[_(`div`,{"data-slot":`${a}-plot`,className:t(`relative min-h-0 w-full flex-1`,w&&`opacity-60 transition-opacity duration-300`),ref:se,children:[g(`canvas`,{"data-slot":`${a}-canvas`,ref:L,"aria-hidden":!0,className:`absolute inset-0 size-full`}),T?null:_(h,{children:[g(`div`,{role:`application`,"aria-label":M,"aria-labelledby":ne,"aria-describedby":le,tabIndex:0,className:t(`focus-visible:ring-focus-accent absolute inset-0 rounded-sm outline-none focus-visible:ring-2`,(r===`line`||r===`area`)&&`cursor-crosshair`,r===`scatter`&&v!=null&&`touch-none cursor-grab active:cursor-grabbing`),onPointerDown:e=>{e.isTrusted&&r===`scatter`&&v!=null&&e.currentTarget.setPointerCapture(e.pointerId),F.current?.handlePointerDown(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerMove:e=>{F.current?.handlePointerMove(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerUp:e=>{F.current?.handlePointerUp(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerLeave:()=>{F.current?.handlePointerLeave()},onPointerCancel:()=>{F.current?.handlePointerLeave()},onBlur:()=>{F.current?.handlePointerLeave()},onKeyDown:e=>{F.current?.handleKeyDown(e.key)&&e.preventDefault()}}),g(`span`,{id:le,className:`sr-only`,children:`Use the left and right arrow keys to move between data points, Home and End to jump to the first and last, and Enter to activate the current point.`})]}),g(`div`,{"data-slot":`${a}-crosshair`,ref:ce,"aria-hidden":!0,className:`bg-neutral-500 pointer-events-none absolute left-0 top-0 w-px opacity-0`}),g(`div`,{"data-slot":`${a}-hover-band`,ref:R,"aria-hidden":!0,className:`bg-neutral-500/10 pointer-events-none absolute left-0 top-0 rounded-sm opacity-0`}),g(`div`,{"data-slot":`${a}-markers`,ref:z,"aria-hidden":!0,className:`pointer-events-none absolute inset-0 opacity-0`}),g(Zt,{slotName:a,store:P,tooltipRef:B,xHasTimeOfDay:U})]}),j,T?null:_(h,{children:[g(rn,{store:P,xHasTimeOfDay:U}),g(an,{data:o,label:M,slotName:a,store:P,xHasTimeOfDay:U,xKey:s,zKey:v})]})]})})},Wt=(e,t,n)=>{let r=Z(e);m(r.kind===t,`${e} cannot be composed inside ${r.componentName}.Root — compose ${r.componentName} series parts instead.`);let{dataKey:i,label:a,seriesSlot:o,color:s,curve:c=`linear`,markers:u=!1,connectNulls:d=!1,shape:f,texture:p=`solid`}=n;return l(()=>r.store.registerSeries({dataKey:i,label:a??i,seriesSlot:o,color:s,mark:t,curve:c,markers:u,connectNulls:d,shape:f,texture:p}),[r.store,i,a,o,s,t,c,u,d,f,p]),null},Gt=(e,t)=>{let n=Z(e),{lines:r}=t;return l(()=>n.store.registerGrid(r),[n.store,r]),null},Kt=(e,t)=>{let n=Z(e),{tickFormat:r,tickCount:i}=t;return l(()=>n.store.registerXAxis({tickFormat:r,tickCount:i}),[n.store,r,i]),null},qt=(e,t)=>{let n=Z(e),{tickFormat:r,tickCount:i}=t;return l(()=>n.store.registerYAxis({tickFormat:r,tickCount:i}),[n.store,r,i]),null},Jt=(e,t)=>{let n=Z(e),r=c(),{y:i,label:a,color:o}=t;return l(()=>n.store.registerReferenceLine(r,{y:i,label:a,color:o}),[n.store,r,i,a,o]),null},Yt=(e,t)=>{let n=Z(e),{labelFormat:r,valueFormat:i,indicator:a=`line`,footer:o,children:s,...c}=t;return l(()=>n.store.registerTooltip({labelFormat:r,valueFormat:i,indicator:a,footer:o,children:s,divProps:c})),null},Xt=(e,t,n)=>e==null?`—`:n==null?W(e):n(e,t),Zt=({slotName:n,store:r,tooltipRef:i,xHasTimeOfDay:a})=>{let o=Bt(r),s=o.tooltip,c=o.hover,{className:u,ref:f,style:p,...m}=s?.divProps??{},v=d(null),y=e(i,v);l(()=>{if(f==null)return;let e=v.current;if(typeof f==`function`){let t=f(e);return()=>{typeof t==`function`?t():f(null)}}return f.current=e,()=>{f.current=null}},[f]);let b=s?.footer;return g(`div`,{"data-slot":`${n}-tooltip`,ref:y,className:t(`bg-popover border-popover text-strong pointer-events-none absolute left-0 top-0 z-10 min-w-32 rounded-md border px-2.5 py-1.5 text-xs shadow-md`,u),style:{opacity:0,...p},...m,children:c==null?null:s?.children==null?_(h,{children:[g(`div`,{className:`text-muted font-medium`,children:s?.labelFormat==null?G(c.xValue,{datasetHasTimeOfDay:a}):s.labelFormat(c.xValue)}),g(`div`,{className:`mt-1 grid gap-1`,children:c.points.map(e=>_(`div`,{className:`flex items-center gap-1.5`,children:[s?.indicator===`none`?null:g(`span`,{"aria-hidden":!0,className:`h-2.5 w-0.5 shrink-0 rounded-full`,style:{backgroundColor:e.color}}),g(`span`,{className:`text-muted`,children:e.label}),g(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:Xt(e.value,e.dataKey,s?.valueFormat)})]},e.dataKey))}),c.zValue===void 0?null:_(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[g(`span`,{className:`text-muted`,children:`z`}),g(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:c.zValue==null?`—`:W(c.zValue)})]}),b==null?null:g(`div`,{className:`text-muted mt-1`,children:typeof b==`function`?b(c):b})]}):s.children(c)})},Q=(e,t,n=3)=>`repeating-linear-gradient(${e}, ${t} 0, ${t} 1px, transparent 1px, transparent ${n}px)`,$=`forced-color-adjust-none [print-color-adjust:exact] [-webkit-print-color-adjust:exact]`,Qt={hatch:({ink:e})=>({backgroundImage:Q(`135deg`,e)}),"hatch-reverse":({ink:e})=>({backgroundImage:Q(`45deg`,e)}),crosshatch:({ink:e})=>({backgroundImage:`${Q(`135deg`,e,4)}, ${Q(`45deg`,e,4)}`}),perpendicular:({ink:e,orientation:t})=>({backgroundImage:Q(t===`horizontal`?`90deg`:`0deg`,e)}),parallel:({ink:e,orientation:t})=>({backgroundImage:Q(t===`horizontal`?`0deg`:`90deg`,e)}),grid:({ink:e})=>({backgroundImage:`${Q(`0deg`,e,4)}, ${Q(`90deg`,e,4)}`}),dots:({ink:e})=>({backgroundImage:`radial-gradient(circle at 1px 1px, ${e} 0.75px, transparent 0.8px)`,backgroundSize:`3px 3px`})},$t=(e,t,n)=>e===`solid`?{}:Qt[e]({ink:ce(t),orientation:n}),en=({series:e,orientation:n})=>e.mark===`bar`?g(`span`,{"aria-hidden":!0,"data-texture":e.texture,className:t(`size-2 shrink-0 rounded-[2px]`,$),style:{backgroundColor:e.color,...$t(e.texture,e.color,n)}}):e.mark===`line`?_(`span`,{"aria-hidden":!0,className:`relative flex h-2 w-3 shrink-0 items-center justify-center`,children:[g(`span`,{className:t(`absolute inset-x-0 top-1/2 h-0.5 -translate-y-1/2 rounded-full`,$),style:{backgroundColor:e.color}}),g(`span`,{"data-shape":e.shape,className:t(`relative size-2`,$),style:{backgroundColor:e.color,clipPath:Ct[e.shape]}})]}):g(`span`,{"aria-hidden":!0,"data-shape":e.shape,className:t(`size-2 shrink-0`,$),style:{backgroundColor:e.color,clipPath:Ct[e.shape]}}),tn=({partName:e,slotName:n,className:r,children:i,...a})=>{let o=Z(e),s=Bt(o.store);return s.series.length<2?null:g(`div`,{"data-slot":`${n}-legend`,className:t(`text-muted flex flex-wrap items-center gap-x-4 gap-y-1 pt-3 text-xs`,r),...a,children:i==null?s.series.map(e=>_(`div`,{className:`flex items-center gap-1.5`,children:[g(en,{series:e,orientation:s.orientation}),e.label]},e.dataKey)):i(s.series)})},nn=({partName:e,slotName:t,label:n=`Copy data as Markdown`,onCopy:a,onCopyError:o,onClick:c,ref:l,...u})=>{let p=Z(e),m=i(),[h,_]=f(!1),b=d(void 0);return s(()=>()=>{b.current!=null&&clearTimeout(b.current)},[]),g(r,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,"data-slot":`${t}-copy-button`,label:n,icon:g(h?v:y,{}),ref:l,onClick:async e=>{try{if(c?.(e),e.defaultPrevented){b.current!=null&&(clearTimeout(b.current),b.current=void 0),_(!1);return}let{data:t,xKey:n,zKey:r}=p.dataRef.current,i=Mt({data:t,xKey:n,zKey:r,series:p.store.getSnapshot().series});await m(i),a?.(i),_(!0),b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{_(!1)},2e3)}catch(e){o?.(e)}},...u})},rn=({store:e,xHasTimeOfDay:t})=>{let n=Bt(e),[r,i]=f(``),a=n.hover;return s(()=>{if(a==null||!a.viaKeyboard){i(``);return}let e=a.points.map(e=>`${e.label}: ${e.value==null?`no data`:W(e.value)}`).join(`, `),n=a.zValue===void 0?``:`, z: ${a.zValue==null?`no data`:W(a.zValue)}`,r=setTimeout(()=>{i(`${G(a.xValue,{datasetHasTimeOfDay:t})}. ${e}${n}`)},120);return()=>clearTimeout(r)},[a,t]),g(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:r})},an=({data:e,label:t,slotName:n,store:r,xHasTimeOfDay:i,xKey:a,zKey:o})=>{let s=Bt(r);if(e.length===0||s.series.length===0)return null;let c=e.slice(0,150);return g(`div`,{className:`sr-only`,"data-slot":`${n}-data-table`,children:_(`table`,{children:[g(`caption`,{children:`${t==null?`Chart data`:`${t} — chart data`}${e.length>150?`. Showing the first 150 of ${e.length} rows.`:`.`}`}),g(`thead`,{children:_(`tr`,{children:[g(`th`,{scope:`col`,children:a}),s.series.map(e=>g(`th`,{scope:`col`,children:e.label},e.dataKey)),o==null?null:g(`th`,{scope:`col`,children:o})]})}),g(`tbody`,{children:c.map((e,t)=>{let n=E(e,a),r=n instanceof Date&&!Number.isNaN(n.getTime()),c=typeof n==`string`||typeof n==`number`||n instanceof Date?G(n,{datasetHasTimeOfDay:i}):String(n);return _(`tr`,{children:[g(`th`,{scope:`row`,"data-value":typeof n==`number`&&Number.isFinite(n)?n:void 0,children:r?g(`time`,{dateTime:n.toISOString(),children:c}):c}),s.series.map(t=>{let n=E(e,t.dataKey),r=typeof n==`number`&&Number.isFinite(n);return g(`td`,{"data-value":r?n:void 0,children:r?W(n):`—`},t.dataKey)}),o==null?null:(()=>{let t=E(e,o),n=typeof t==`number`&&Number.isFinite(t);return g(`td`,{"data-value":n?t:void 0,children:n?W(t):`—`})})()]},t)})})]})})};export{Jt as a,Kt as c,Gt as i,qt as l,tn as n,Wt as o,Ut as r,Yt as s,nn as t};
@@ -268,6 +268,8 @@ type ChartInteractionProps = {
268
268
  * hidden from assistive technology (no accessible name, no sr-only data
269
269
  * table, no live region), removed from the tab order, and inert to pointer
270
270
  * and keyboard, so the accessible-name and interaction props are forbidden.
271
+ * It also paints every series in one neutral fill instead of the categorical
272
+ * palette, low enough in contrast that a message laid over it stays readable.
271
273
  *
272
274
  * `decorative` communicates intent — "these values are not information" —
273
275
  * where a `disabled` flag would be ambiguous (a chart is not a form control).
@@ -276,15 +278,51 @@ type ChartAccessibilityProps = ({
276
278
  decorative?: false;
277
279
  } & ChartAccessibleName & ChartInteractionProps) | {
278
280
  /**
279
- * Render the chart as a decorative placeholder: it keeps its visual
280
- * rendering and animation but is hidden from assistive technology,
281
- * removed from the tab order, and inert to pointer and keyboard no
282
- * hover band, tooltip, data table, or live region. Use it for
283
- * empty-state backdrops and atmospheric graphics whose values are not
284
- * real data; it forbids the accessible-name and interaction props,
285
- * which have no meaning without real data.
281
+ * Render the chart as a decorative placeholder a backdrop whose
282
+ * values are not information. Use it for an empty-state graphic or an
283
+ * atmospheric hero, never for data a reader might act on.
284
+ *
285
+ * A decorative chart keeps its canvas rendering and its animation. It
286
+ * drops every layer that only real data needs:
287
+ *
288
+ * - hidden from assistive technology — no accessible name, no sr-only
289
+ * data table, no live region
290
+ * - out of the tab order, and inert to pointer and keyboard — no hover
291
+ * band, no tooltip, no activation
292
+ * - the accessible-name and interaction props are forbidden at the type
293
+ * level, because they have no meaning without real data
294
+ *
295
+ * It also drops the categorical palette. Every series paints
296
+ * `--color-chart-decorative`, one neutral fill that outranks a series'
297
+ * `color` and `seriesSlot` — a backdrop encodes no series identity, and
298
+ * a hue on values that are not information invites a reader to decode
299
+ * it. The token is the darkest neutral step that keeps `text-muted`
300
+ * over the WCAG AA floor for 14px text in all four themes (4.56:1 in
301
+ * light, 4.93:1 in dark), so an overlaid message needs no scrim, no
302
+ * blur, and no dimming to stay readable.
303
+ * `chart/decorative-contrast.test.tsx` measures every theme.
304
+ *
305
+ * Retune the fill per chart by redeclaring the token in `className`:
306
+ * `[--color-chart-decorative:var(--color-neutral-100)]`. Re-measure the
307
+ * message against the new value when you do.
286
308
  *
287
309
  * @default false
310
+ *
311
+ * @example
312
+ * ```tsx
313
+ * // The message is a sibling of the chart, so AT still announces it.
314
+ * <div className="relative w-full">
315
+ * <BarChart.Root data={placeholderUsage} xKey="day" decorative>
316
+ * <BarChart.Bar dataKey="value" />
317
+ * </BarChart.Root>
318
+ * <Empty.Root className="absolute inset-0 m-auto h-fit w-fit">
319
+ * <Empty.Title>No usage yet</Empty.Title>
320
+ * <Empty.Description>
321
+ * <p>Traffic will appear here once your endpoints start receiving requests.</p>
322
+ * </Empty.Description>
323
+ * </Empty.Root>
324
+ * </div>
325
+ * ```
288
326
  */
289
327
  decorative: true;
290
328
  "aria-label"?: never;
package/dist/command.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
2
- import { t as Dialog } from "./dialog-02mNrAT1.js";
2
+ import { t as Dialog } from "./dialog-B6h1BCDL.js";
3
3
  import { t as Slot } from "./slot-DdgxmuI5.js";
4
4
  import { ComponentProps, ComponentPropsWithoutRef, ReactElement, ReactNode, Ref } from "react";
5
5
  import { Command as Command$1, useCommandState } from "cmdk";
package/dist/command.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DpNWVci8.js";import{n as r}from"./separator-D0D6VyyM.js";import{t as i}from"./dialog-BRjTD83p.js";import{n as a,t as o}from"./use-is-apple-platform-Cxwrb86L.js";import{t as s}from"./use-callback-ref-IYti9y7x.js";import{t as c}from"./kbd-K8iaZ-Ti.js";import{createContext as l,useCallback as u,useContext as d,useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import g from"tiny-invariant";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{MagnifyingGlassIcon as y}from"@phosphor-icons/react/MagnifyingGlass";import{Command as b,useCommandState as x}from"cmdk";const S=l(null);function C(){let e=d(S);return g(e,`useCommandDialog must be used within Command.DialogRoot.`),e}function w(){return d(S)}function T(e){let t=d(S);return g(t,`Command.${e} must be rendered inside Command.DialogRoot.`),t}const E=new Set([` `,`Enter`]);function D(e){return e.isComposing||e.key===`Process`||e.keyCode===229?{type:`open`}:e.metaKey||e.ctrlKey||e.altKey||E.has(e.key)?{type:`ignore`}:[...e.key].length===1?{type:`seed`,query:e.key}:{type:`ignore`}}function O(e){let t=(e.clipboardData?.getData(`text/plain`)??``).replace(/\s+/g,` `).trim();return t===``?{type:`open`}:{type:`seed`,query:t}}const k=({"aria-keyshortcuts":e,children:r,"data-slot":a,onKeyDown:s,onPaste:c,...l})=>{let{keyboardShortcut:u,open:d,openWithQuery:f}=T(`SearchTrigger`),p=o(),m=e=>{e.type!==`ignore`&&f(e.type===`seed`?e.query:void 0)},h=p?`Meta+K`:`Control+K`;return _(i.Trigger,{asChild:!0,children:_(n,{...l,"aria-keyshortcuts":e??(u?h:void 0),"data-slot":t(a,`command-search-trigger`),"data-state":d?`open`:`closed`,onKeyDown:e=>{if(s?.(e),e.defaultPrevented)return;let t=D(e.nativeEvent);t.type===`seed`&&e.preventDefault(),m(t)},onPaste:e=>{c?.(e),!e.defaultPrevented&&m(O(e.nativeEvent))},children:r})})},A=[];function j(){let e=Symbol(`command-keyboard-shortcut`);return A.push(e),{isOwner:()=>A[0]===e,release:()=>{let t=A.indexOf(e);t!==-1&&A.splice(t,1)}}}function M(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`TEXTAREA`:!1}function N({enabled:e,onTrigger:t}){let n=s(t);f(()=>{if(!e)return;let t=j(),r=a(),i=e=>{if(!t.isOwner()||e.defaultPrevented||e.repeat||M(e.target))return;let i=r?e.metaKey:e.ctrlKey,a=r?e.ctrlKey:e.metaKey;e.key.toLowerCase()===`k`&&i&&!a&&!e.altKey&&!e.shiftKey&&(e.preventDefault(),n())};return window.addEventListener(`keydown`,i),()=>{window.removeEventListener(`keydown`,i),t.release()}},[e,n])}const P=({className:t,...n})=>_(b,{"data-slot":`command`,className:e(`bg-popover flex h-full w-full flex-col overflow-hidden rounded-md`,t),...n}),F={Root:P,DialogRoot:({children:e,defaultOpen:t=!1,keyboardShortcut:n=!0,onOpenChange:r,open:a,...o})=>{let s=a!=null,[c,l]=h(t),d=s?a:c,[f,m]=h(``),g=u((e,t)=>{e&&m(t??``),s||l(e),r?.(e)},[s,r]),v=u(e=>{g(e)},[g]),y=u(e=>{g(!0,e)},[g]),b=u(()=>{g(!d)},[g,d]);N({enabled:n,onTrigger:b});let x=p(()=>({keyboardShortcut:n,open:d,openWithQuery:y,query:f,setOpen:v,setQuery:m,toggle:b}),[n,d,y,f,v,b]);return _(S.Provider,{value:x,children:_(i.Root,{open:d,onOpenChange:v,...o,children:e})})},SearchTrigger:k,DialogTrigger:i.Trigger,DialogContent:({children:t,className:n,description:r=`Search for a command to run...`,filter:a,shouldFilter:o,showCloseButton:s=!0,title:c=`Command Palette`})=>{let l=m(null);return v(i.Content,{ref:l,className:e(`overflow-hidden p-0 relative`,n),onOpenAutoFocus:e=>{let t=l.current?.querySelector(`[data-slot~="command-input"]`);if(!(t instanceof HTMLInputElement)||t.disabled)return;e.preventDefault(),t.focus({preventScroll:!0});let n=t.value.length;t.setSelectionRange(n,n)},children:[v(i.Header,{className:`sr-only absolute`,children:[_(i.Title,{children:c}),_(i.Description,{children:r})]}),_(P,{className:`**:data-[slot=command-input-wrapper]:h-12 **:[[cmdk-input]]:h-12 **:data-[slot=command-group]:px-2 **:data-[slot=command-list]:pb-1`,filter:a,shouldFilter:o,children:t}),s&&_(`div`,{className:`absolute top-1.5 right-1.5`,children:_(i.CloseIconButton,{})})]})},Input:({className:n,"data-slot":r,onValueChange:i,ref:a,value:o,...s})=>{let c=w(),l=o!=null,u=l?o:c?.query;return v(`div`,{ref:a,"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b border-popover px-3`,children:[_(y,{className:`size-5 shrink-0 opacity-50`}),_(b.Input,{className:e(`placeholder:text-muted flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,n),onValueChange:e=>{l||c?.setQuery(e),i?.(e)},value:u,...s,"data-slot":t(r,`command-input`)})]})},List:({className:t,...n})=>_(b.List,{"data-slot":`command-list`,className:e(`max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto scrollbar`,t),...n}),Empty:({className:t,...n})=>_(b.Empty,{"data-slot":`command-empty`,className:e(`py-6 text-center text-sm`,t),...n}),Group:({className:t,...n})=>_(b.Group,{"data-slot":`command-group`,className:e(`[&>[cmdk-group-heading]]:text-muted overflow-hidden p-1 [&>[cmdk-group-heading]]:px-2 [&>[cmdk-group-heading]]:py-1.5 [&>[cmdk-group-heading]]:text-xs [&>[cmdk-group-heading]]:font-medium`,t),...n}),Item:({className:t,...n})=>_(b.Item,{"data-slot":`command-item`,className:e(`data-[selected=true]:bg-active-menu-item [:where(&_svg)]:text-muted relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [:where(&_svg)]:size-5`,t),...n}),Shortcut:({className:t,...n})=>_(`span`,{"data-slot":`command-shortcut`,className:e(`text-muted ml-auto text-xs tracking-widest`,t),...n}),Separator:({className:t,...n})=>_(b.Separator,{"data-slot":`command-separator`,asChild:!0,...n,children:_(r,{className:e(`-mx-1 my-1 w-auto`,t)})})};function I({className:t,...n}){let r=o(),i=r?`⌘`:`⌃`,a=r?`Command`:`Control`;return v(c,{...n,suppressHydrationWarning:!0,"data-slot":`meta-key`,className:e(i===`⌃`&&`font-medium`,t),children:[_(`span`,{className:`sr-only`,children:a}),i]})}export{F as Command,I as MetaKey,D as searchActionFromKeyDown,O as searchActionFromPaste,C as useCommandDialog,x as useCommandState};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DpNWVci8.js";import{n as r}from"./separator-D0D6VyyM.js";import{t as i}from"./dialog-32Hq6w6P.js";import{n as a,t as o}from"./use-is-apple-platform-Cxwrb86L.js";import{t as s}from"./use-callback-ref-IYti9y7x.js";import{t as c}from"./kbd-K8iaZ-Ti.js";import{createContext as l,useCallback as u,useContext as d,useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import g from"tiny-invariant";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{MagnifyingGlassIcon as y}from"@phosphor-icons/react/MagnifyingGlass";import{Command as b,useCommandState as x}from"cmdk";const S=l(null);function C(){let e=d(S);return g(e,`useCommandDialog must be used within Command.DialogRoot.`),e}function w(){return d(S)}function T(e){let t=d(S);return g(t,`Command.${e} must be rendered inside Command.DialogRoot.`),t}const E=new Set([` `,`Enter`]);function D(e){return e.isComposing||e.key===`Process`||e.keyCode===229?{type:`open`}:e.metaKey||e.ctrlKey||e.altKey||E.has(e.key)?{type:`ignore`}:[...e.key].length===1?{type:`seed`,query:e.key}:{type:`ignore`}}function O(e){let t=(e.clipboardData?.getData(`text/plain`)??``).replace(/\s+/g,` `).trim();return t===``?{type:`open`}:{type:`seed`,query:t}}const k=({"aria-keyshortcuts":e,children:r,"data-slot":a,onKeyDown:s,onPaste:c,...l})=>{let{keyboardShortcut:u,open:d,openWithQuery:f}=T(`SearchTrigger`),p=o(),m=e=>{e.type!==`ignore`&&f(e.type===`seed`?e.query:void 0)},h=p?`Meta+K`:`Control+K`;return _(i.Trigger,{asChild:!0,children:_(n,{...l,"aria-keyshortcuts":e??(u?h:void 0),"data-slot":t(a,`command-search-trigger`),"data-state":d?`open`:`closed`,onKeyDown:e=>{if(s?.(e),e.defaultPrevented)return;let t=D(e.nativeEvent);t.type===`seed`&&e.preventDefault(),m(t)},onPaste:e=>{c?.(e),!e.defaultPrevented&&m(O(e.nativeEvent))},children:r})})},A=[];function j(){let e=Symbol(`command-keyboard-shortcut`);return A.push(e),{isOwner:()=>A[0]===e,release:()=>{let t=A.indexOf(e);t!==-1&&A.splice(t,1)}}}function M(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`TEXTAREA`:!1}function N({enabled:e,onTrigger:t}){let n=s(t);f(()=>{if(!e)return;let t=j(),r=a(),i=e=>{if(!t.isOwner()||e.defaultPrevented||e.repeat||M(e.target))return;let i=r?e.metaKey:e.ctrlKey,a=r?e.ctrlKey:e.metaKey;e.key.toLowerCase()===`k`&&i&&!a&&!e.altKey&&!e.shiftKey&&(e.preventDefault(),n())};return window.addEventListener(`keydown`,i),()=>{window.removeEventListener(`keydown`,i),t.release()}},[e,n])}const P=({className:t,...n})=>_(b,{"data-slot":`command`,className:e(`bg-popover flex h-full w-full flex-col overflow-hidden rounded-md`,t),...n}),F={Root:P,DialogRoot:({children:e,defaultOpen:t=!1,keyboardShortcut:n=!0,onOpenChange:r,open:a,...o})=>{let s=a!=null,[c,l]=h(t),d=s?a:c,[f,m]=h(``),g=u((e,t)=>{e&&m(t??``),s||l(e),r?.(e)},[s,r]),v=u(e=>{g(e)},[g]),y=u(e=>{g(!0,e)},[g]),b=u(()=>{g(!d)},[g,d]);N({enabled:n,onTrigger:b});let x=p(()=>({keyboardShortcut:n,open:d,openWithQuery:y,query:f,setOpen:v,setQuery:m,toggle:b}),[n,d,y,f,v,b]);return _(S.Provider,{value:x,children:_(i.Root,{open:d,onOpenChange:v,...o,children:e})})},SearchTrigger:k,DialogTrigger:i.Trigger,DialogContent:({children:t,className:n,description:r=`Search for a command to run...`,filter:a,shouldFilter:o,showCloseButton:s=!0,title:c=`Command Palette`})=>{let l=m(null);return v(i.Content,{ref:l,className:e(`overflow-hidden p-0 relative`,n),onOpenAutoFocus:e=>{let t=l.current?.querySelector(`[data-slot~="command-input"]`);if(!(t instanceof HTMLInputElement)||t.disabled)return;e.preventDefault(),t.focus({preventScroll:!0});let n=t.value.length;t.setSelectionRange(n,n)},children:[v(i.Header,{className:`sr-only absolute`,children:[_(i.Title,{children:c}),_(i.Description,{children:r})]}),_(P,{className:`**:data-[slot=command-input-wrapper]:h-12 **:[[cmdk-input]]:h-12 **:data-[slot=command-group]:px-2 **:data-[slot=command-list]:pb-1`,filter:a,shouldFilter:o,children:t}),s&&_(`div`,{className:`absolute top-1.5 right-1.5`,children:_(i.CloseIconButton,{})})]})},Input:({className:n,"data-slot":r,onValueChange:i,ref:a,value:o,...s})=>{let c=w(),l=o!=null,u=l?o:c?.query;return v(`div`,{ref:a,"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b border-popover px-3`,children:[_(y,{className:`size-5 shrink-0 opacity-50`}),_(b.Input,{className:e(`placeholder:text-muted flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,n),onValueChange:e=>{l||c?.setQuery(e),i?.(e)},value:u,...s,"data-slot":t(r,`command-input`)})]})},List:({className:t,...n})=>_(b.List,{"data-slot":`command-list`,className:e(`max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto scrollbar`,t),...n}),Empty:({className:t,...n})=>_(b.Empty,{"data-slot":`command-empty`,className:e(`py-6 text-center text-sm`,t),...n}),Group:({className:t,...n})=>_(b.Group,{"data-slot":`command-group`,className:e(`[&>[cmdk-group-heading]]:text-muted overflow-hidden p-1 [&>[cmdk-group-heading]]:px-2 [&>[cmdk-group-heading]]:py-1.5 [&>[cmdk-group-heading]]:text-xs [&>[cmdk-group-heading]]:font-medium`,t),...n}),Item:({className:t,...n})=>_(b.Item,{"data-slot":`command-item`,className:e(`data-[selected=true]:bg-active-menu-item [:where(&_svg)]:text-muted relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [:where(&_svg)]:size-5`,t),...n}),Shortcut:({className:t,...n})=>_(`span`,{"data-slot":`command-shortcut`,className:e(`text-muted ml-auto text-xs tracking-widest`,t),...n}),Separator:({className:t,...n})=>_(b.Separator,{"data-slot":`command-separator`,asChild:!0,...n,children:_(r,{className:e(`-mx-1 my-1 w-auto`,t)})})};function I({className:t,...n}){let r=o(),i=r?`⌘`:`⌃`,a=r?`Command`:`Control`;return v(c,{...n,suppressHydrationWarning:!0,"data-slot":`meta-key`,className:e(i===`⌃`&&`font-medium`,t),children:[_(`span`,{className:`sr-only`,children:a}),i]})}export{F as Command,I as MetaKey,D as searchActionFromKeyDown,O as searchActionFromPaste,C as useCommandDialog,x as useCommandState};
@@ -0,0 +1 @@
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./button-CCkGqE1t.js";import{a as n,c as r,i,n as a,o,r as s,s as c,t as l}from"./primitive-D-9GIFWb.js";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{XIcon as f}from"@phosphor-icons/react/X";const p=o,m=e=>u(r,{"data-slot":`dialog-trigger`,...e}),h=n,g=e=>u(l,{"data-slot":`dialog-close`,...e}),_=({className:t,ref:n,...r})=>u(i,{ref:n,"data-slot":`dialog-overlay`,className:e(`bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-50 backdrop-blur-xs`,t),...r}),v={centered:`inset-4`,"full-page":`inset-4`,"full-bleed":`inset-0`},y={centered:`border-dialog rounded-xl border`,"full-page":`border-dialog h-full max-w-none rounded-xl border`,"full-bleed":`h-full max-w-none`},b={Root:p,Body:({className:t,...n})=>u(`div`,{"data-slot":`dialog-body`,className:e(`scrollbar scrollbar-gutter-stable text-body flex-1 overflow-y-auto p-6`,t),...n}),Close:g,CloseIconButton:({size:e=`md`,type:n=`button`,label:r=`Close Dialog`,appearance:i=`ghost`,intent:a=`neutral`,...o})=>u(l,{asChild:!0,children:u(t,{appearance:i,"data-slot":`dialog-close-icon-button`,icon:u(f,{}),intent:a,label:r,size:e,type:n,...o})}),Content:({appearance:t=`centered`,children:n,className:r,preferredWidth:i,ref:o,...s})=>d(h,{children:[u(_,{}),u(`div`,{className:e(`fixed z-50 flex items-center justify-center`,v[t]),children:u(a,{"data-appearance":t,"data-mantle-modal-content":!0,"data-slot":`dialog-content`,className:e(`flex max-h-full w-full flex-1 flex-col`,`outline-hidden focus-within:outline-hidden`,`bg-dialog shadow-lg transition-transform duration-200`,`data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95`,y[t],t===`centered`&&(i??`max-w-lg`),r),ref:o,...s,children:n})})]}),Description:({className:t,ref:n,...r})=>u(s,{ref:n,"data-slot":`dialog-description`,className:e(`text-muted`,t),...r}),Footer:({className:t,...n})=>u(`div`,{"data-slot":`dialog-footer`,className:e(`border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-4`,t),...n}),Header:({className:t,children:n,...r})=>u(`div`,{"data-slot":`dialog-header`,className:e(`border-dialog-muted text-strong relative flex shrink-0 items-center justify-between gap-2 border-b px-6 py-4`,`has-[.icon-button]:pr-4`,t),...r,children:n}),Overlay:_,Portal:h,Title:({className:t,ref:n,...r})=>u(c,{ref:n,"data-slot":`dialog-title`,className:e(`text-strong truncate text-lg font-medium`,t),...r}),Trigger:m};export{b as t};
@@ -105,17 +105,40 @@ declare const Close: (props: ComponentProps<typeof Close$1>) => import("react").
105
105
  * ```
106
106
  */
107
107
  declare const Overlay: ({ className, ref, ...props }: ComponentProps<typeof Overlay$1>) => import("react").JSX.Element;
108
- type ContentProps = ComponentProps<typeof Content$1> & {
108
+ type ContentProps = ComponentProps<typeof Content$1> & ({
109
109
  /**
110
- * The preferred width of the `Dialog.Content` as a tailwind `max-w-` class.
110
+ * How much of the viewport the dialog claims. `"centered"` is a card
111
+ * capped at `preferredWidth`; `"full-page"` fills the 16px-inset box
112
+ * `Dialog.Content` already positions itself in; `"full-bleed"` fills the
113
+ * viewport edge to edge, square and unbordered.
111
114
  *
112
- * By default, a `Dialog`'s content width is responsive with a default
113
- * preferred width: the maximum width of the `Dialog.Content`
115
+ * Reflected as `data-appearance`.
114
116
  *
115
- * @default `max-w-lg`
117
+ * @default "centered"
118
+ */
119
+ appearance?: "centered";
120
+ /**
121
+ * The maximum width of a `"centered"` dialog, as a Tailwind `max-w-`
122
+ * class. The dialog stays responsive below it.
123
+ *
124
+ * @default "max-w-lg"
116
125
  */
117
126
  preferredWidth?: `max-w-${string}`;
118
- };
127
+ } | {
128
+ /**
129
+ * How much of the viewport the dialog claims. `"full-page"` fills the
130
+ * 16px-inset box `Dialog.Content` already positions itself in;
131
+ * `"full-bleed"` fills the whole viewport, square and unbordered.
132
+ *
133
+ * Reflected as `data-appearance`.
134
+ */
135
+ appearance: "full-page" | "full-bleed";
136
+ /**
137
+ * Never set here. A `"full-page"` or `"full-bleed"` dialog fills its box,
138
+ * so it has no width to cap — pass `appearance="centered"` to cap it.
139
+ */
140
+ preferredWidth?: never;
141
+ });
119
142
  /**
120
143
  * The container for the dialog content.
121
144
  * Renders on top of the overlay and is centered in the viewport.
@@ -124,6 +147,15 @@ type ContentProps = ComponentProps<typeof Content$1> & {
124
147
  * shared floating z-index. When multiple shared layers are open, the most
125
148
  * recently mounted layer renders on top.
126
149
  *
150
+ * `appearance` decides how much of the viewport the dialog claims. `"centered"`
151
+ * caps it at `preferredWidth`, `"full-page"` fills the 16px-inset box, and
152
+ * `"full-bleed"` fills the whole viewport.
153
+ *
154
+ * | Data Attribute | Value | Description |
155
+ * | ----------------- | ------------------------------------------------ | -------------------------------------------------------------------- |
156
+ * | `data-appearance` | `"centered"` \| `"full-page"` \| `"full-bleed"` | Reflects the resolved `appearance`. |
157
+ * | `data-state` | `"open"` \| `"closed"` | Stamped by Radix; drives the open and close animation. |
158
+ *
127
159
  * @see https://mantle.ngrok.com/components/overlays/dialog#dialogcontent
128
160
  *
129
161
  * @example
@@ -150,8 +182,32 @@ type ContentProps = ComponentProps<typeof Content$1> & {
150
182
  * </Dialog.Content>
151
183
  * </Dialog.Root>
152
184
  * ```
185
+ *
186
+ * @example
187
+ * Full bleed, for content that needs the whole viewport:
188
+ * ```tsx
189
+ * <Dialog.Root>
190
+ * <Dialog.Trigger asChild>
191
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
192
+ * </Dialog.Trigger>
193
+ * <Dialog.Content appearance="full-bleed">
194
+ * <Dialog.Header>
195
+ * <Dialog.Title>Request log</Dialog.Title>
196
+ * <Dialog.CloseIconButton />
197
+ * </Dialog.Header>
198
+ * <Dialog.Body>
199
+ * <p>This is the dialog content.</p>
200
+ * </Dialog.Body>
201
+ * <Dialog.Footer>
202
+ * <Dialog.Close asChild>
203
+ * <Button type="button" appearance="outlined" intent="neutral">Close</Button>
204
+ * </Dialog.Close>
205
+ * </Dialog.Footer>
206
+ * </Dialog.Content>
207
+ * </Dialog.Root>
208
+ * ```
153
209
  */
154
- declare const Content: ({ children, className, preferredWidth, ref, ...props }: ContentProps) => import("react").JSX.Element;
210
+ declare const Content: ({ appearance, children, className, preferredWidth, ref, ...props }: ContentProps) => import("react").JSX.Element;
155
211
  /**
156
212
  * Contains the header content of the dialog, including the title and close button.
157
213
  *
@@ -550,6 +606,15 @@ declare const Dialog: {
550
606
  * shared floating z-index. When multiple shared layers are open, the most
551
607
  * recently mounted layer renders on top.
552
608
  *
609
+ * `appearance` decides how much of the viewport the dialog claims. `"centered"`
610
+ * caps it at `preferredWidth`, `"full-page"` fills the 16px-inset box, and
611
+ * `"full-bleed"` fills the whole viewport.
612
+ *
613
+ * | Data Attribute | Value | Description |
614
+ * | ----------------- | ------------------------------------------------ | -------------------------------------------------------------------- |
615
+ * | `data-appearance` | `"centered"` \| `"full-page"` \| `"full-bleed"` | Reflects the resolved `appearance`. |
616
+ * | `data-state` | `"open"` \| `"closed"` | Stamped by Radix; drives the open and close animation. |
617
+ *
553
618
  * @see https://mantle.ngrok.com/components/overlays/dialog#dialogcontent
554
619
  *
555
620
  * @example
@@ -576,6 +641,30 @@ declare const Dialog: {
576
641
  * </Dialog.Content>
577
642
  * </Dialog.Root>
578
643
  * ```
644
+ *
645
+ * @example
646
+ * Full bleed, for content that needs the whole viewport:
647
+ * ```tsx
648
+ * <Dialog.Root>
649
+ * <Dialog.Trigger asChild>
650
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
651
+ * </Dialog.Trigger>
652
+ * <Dialog.Content appearance="full-bleed">
653
+ * <Dialog.Header>
654
+ * <Dialog.Title>Request log</Dialog.Title>
655
+ * <Dialog.CloseIconButton />
656
+ * </Dialog.Header>
657
+ * <Dialog.Body>
658
+ * <p>This is the dialog content.</p>
659
+ * </Dialog.Body>
660
+ * <Dialog.Footer>
661
+ * <Dialog.Close asChild>
662
+ * <Button type="button" appearance="outlined" intent="neutral">Close</Button>
663
+ * </Dialog.Close>
664
+ * </Dialog.Footer>
665
+ * </Dialog.Content>
666
+ * </Dialog.Root>
667
+ * ```
579
668
  */
580
669
  readonly Content: typeof Content;
581
670
  /**
package/dist/dialog.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { c as isDialogOverlayTarget } from "./dialog-BM4wPCft.js";
2
- import { t as Dialog } from "./dialog-02mNrAT1.js";
2
+ import { t as Dialog } from "./dialog-B6h1BCDL.js";
3
3
  export { Dialog, isDialogOverlayTarget };
package/dist/dialog.js CHANGED
@@ -1 +1 @@
1
- import{l as e}from"./primitive-D-9GIFWb.js";import{t}from"./dialog-BRjTD83p.js";export{t as Dialog,e as isDialogOverlayTarget};
1
+ import{l as e}from"./primitive-D-9GIFWb.js";import{t}from"./dialog-32Hq6w6P.js";export{t as Dialog,e as isDialogOverlayTarget};
@@ -1,4 +1,4 @@
1
- import { _ as PointShape, a as LegendPrimitiveProps, c as XAxisPrimitiveProps, f as ChartDatum, g as CurveKind, h as ContinuousXScale, i as GridPrimitiveProps, l as YAxisPrimitiveProps, m as ChartSeriesSlot, n as ChartRootBaseProps, o as ReferenceLinePrimitiveProps, p as ChartDatumEvent, r as CopyButtonPrimitiveProps, s as TooltipPrimitiveProps, t as ChartAccessibilityProps, v as SeriesColor } from "./chart-0zcFJh4n.js";
1
+ import { _ as PointShape, a as LegendPrimitiveProps, c as XAxisPrimitiveProps, f as ChartDatum, g as CurveKind, h as ContinuousXScale, i as GridPrimitiveProps, l as YAxisPrimitiveProps, m as ChartSeriesSlot, n as ChartRootBaseProps, o as ReferenceLinePrimitiveProps, p as ChartDatumEvent, r as CopyButtonPrimitiveProps, s as TooltipPrimitiveProps, t as ChartAccessibilityProps, v as SeriesColor } from "./chart-TWkSYqAs.js";
2
2
  //#region src/components/line-chart/line-chart.d.ts
3
3
  /**
4
4
  * Props for {@link LineChart.Root}. Lines encode value by vertical position,
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-DBxT9BNl.js";import{jsx as l}from"react/jsx-runtime";const u={Root:e=>l(o,{kind:`line`,componentName:`LineChart`,slotName:`line-chart`,...e}),Line:e=>a(`LineChart.Line`,`line`,e),Grid:e=>n(`LineChart.Grid`,e),XAxis:e=>t(`LineChart.XAxis`,e),YAxis:e=>r(`LineChart.YAxis`,e),ReferenceLine:t=>e(`LineChart.ReferenceLine`,t),Tooltip:e=>s(`LineChart.Tooltip`,e),Legend:e=>l(i,{partName:`LineChart.Legend`,slotName:`line-chart`,...e}),CopyButton:e=>l(c,{partName:`LineChart.CopyButton`,slotName:`line-chart`,...e})};export{u as LineChart};
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-DorYMICt.js";import{jsx as l}from"react/jsx-runtime";const u={Root:e=>l(o,{kind:`line`,componentName:`LineChart`,slotName:`line-chart`,...e}),Line:e=>a(`LineChart.Line`,`line`,e),Grid:e=>n(`LineChart.Grid`,e),XAxis:e=>t(`LineChart.XAxis`,e),YAxis:e=>r(`LineChart.YAxis`,e),ReferenceLine:t=>e(`LineChart.ReferenceLine`,t),Tooltip:e=>s(`LineChart.Tooltip`,e),Legend:e=>l(i,{partName:`LineChart.Legend`,slotName:`line-chart`,...e}),CopyButton:e=>l(c,{partName:`LineChart.CopyButton`,slotName:`line-chart`,...e})};export{u as LineChart};
package/dist/llms.txt CHANGED
@@ -1,4 +1,4 @@
1
- # @ngrok/mantle (0.83.0)
1
+ # @ngrok/mantle (0.83.2)
2
2
 
3
3
  > Offline discovery hint shipped inside the @ngrok/mantle npm package. Authoritative metadata lives at https://mantle.ngrok.com/for-ai-agents.
4
4
 
@@ -314,6 +314,10 @@ mantle.css for the full strategy.
314
314
  --color-chart-8: oklch(0.835 0.133 88.5); /* #ecc458 */
315
315
  --color-chart-other: var(--color-neutral-500);
316
316
 
317
+ /* The decorative-chart fill — this theme's neutral-200, which holds
318
+ --text-color-muted at 8.14:1. See mantle.css for the derivation. */
319
+ --color-chart-decorative: var(--color-neutral-200);
320
+
317
321
  --text-color-strong: var(--color-black);
318
322
  --text-color-body: var(--color-neutral-950);
319
323
  --text-color-muted: --alpha(var(--color-black) / 0.75);
@@ -348,6 +348,10 @@ MARK: INVERT THEME in mantle.css for the full strategy.
348
348
  --color-chart-8: oklch(0.668 0.137 83.5); /* #bd8c01 */
349
349
  --color-chart-other: var(--color-neutral-500);
350
350
 
351
+ /* The decorative-chart fill — this theme's neutral-200, which holds
352
+ --text-color-muted at 4.93:1. See mantle.css for the derivation. */
353
+ --color-chart-decorative: var(--color-neutral-200);
354
+
351
355
  --text-color-strong: #fff;
352
356
  --text-color-body: --alpha(#fff / 0.7);
353
357
  --text-color-muted: --alpha(#fff / 0.5);
@@ -310,6 +310,10 @@ mantle.css for the full strategy.
310
310
  --color-chart-8: oklch(0.621 0.128 78); /* #b07b06 */
311
311
  --color-chart-other: var(--color-neutral-500);
312
312
 
313
+ /* The decorative-chart fill — this theme's neutral-200, which holds
314
+ --text-color-muted at 9.08:1. See mantle.css for the derivation. */
315
+ --color-chart-decorative: var(--color-neutral-200);
316
+
313
317
  --text-color-strong: var(--color-black);
314
318
  --text-color-body: var(--color-neutral-950);
315
319
  --text-color-muted: --alpha(var(--color-black) / 0.75);
package/dist/mantle.css CHANGED
@@ -266,7 +266,8 @@ MARK: THEME
266
266
  pair of slots stays apart for full-color readers and for dichromats, and so
267
267
  every slot clears 3:1 on that theme's card surface. Assign slots to series in
268
268
  order and never re-assign a series' slot when others are filtered out; series
269
- beyond 8 use --color-chart-other. */
269
+ beyond 8 use --color-chart-other, and a decorative chart paints every series
270
+ with --color-chart-decorative. */
270
271
  --color-chart-1: var(--color-chart-1);
271
272
  --color-chart-2: var(--color-chart-2);
272
273
  --color-chart-3: var(--color-chart-3);
@@ -276,6 +277,7 @@ MARK: THEME
276
277
  --color-chart-7: var(--color-chart-7);
277
278
  --color-chart-8: var(--color-chart-8);
278
279
  --color-chart-other: var(--color-chart-other);
280
+ --color-chart-decorative: var(--color-chart-decorative);
279
281
  }
280
282
 
281
283
  /**
@@ -391,6 +393,14 @@ from `:root` (see MARK: INVERT THEME below).
391
393
  --color-chart-8: oklch(0.621 0.125 80.1); /* #ad7d0f */
392
394
  --color-chart-other: var(--color-neutral-500);
393
395
 
396
+ /* The fill every series wears on a decorative chart, in place of its categorical
397
+ slot. It is neutral because a placeholder encodes no series identity, and it is
398
+ this light because the message laid over it must stay readable: --text-color-muted
399
+ over neutral-200 measures 4.56:1 here, and neutral-300 drops it to 4.24:1 — under
400
+ the 4.5:1 floor for 14px text. Each theme aliases its own neutral-200, and
401
+ chart/decorative-contrast.test.tsx measures all four. */
402
+ --color-chart-decorative: var(--color-neutral-200);
403
+
394
404
  --text-color-strong: var(--color-neutral-950);
395
405
  --text-color-body: --alpha(var(--color-neutral-950) / 0.75);
396
406
  --text-color-muted: --alpha(var(--color-neutral-950) / 0.6);
@@ -1,4 +1,4 @@
1
- import { _ as PointShape, a as LegendPrimitiveProps, c as XAxisPrimitiveProps, f as ChartDatum, i as GridPrimitiveProps, l as YAxisPrimitiveProps, m as ChartSeriesSlot, n as ChartRootBaseProps, o as ReferenceLinePrimitiveProps, p as ChartDatumEvent, r as CopyButtonPrimitiveProps, s as TooltipPrimitiveProps, t as ChartAccessibilityProps, v as SeriesColor } from "./chart-0zcFJh4n.js";
1
+ import { _ as PointShape, a as LegendPrimitiveProps, c as XAxisPrimitiveProps, f as ChartDatum, i as GridPrimitiveProps, l as YAxisPrimitiveProps, m as ChartSeriesSlot, n as ChartRootBaseProps, o as ReferenceLinePrimitiveProps, p as ChartDatumEvent, r as CopyButtonPrimitiveProps, s as TooltipPrimitiveProps, t as ChartAccessibilityProps, v as SeriesColor } from "./chart-TWkSYqAs.js";
2
2
  //#region src/components/scatter-plot/scatter-plot.d.ts
3
3
  /**
4
4
  * Props for {@link ScatterPlot.Root}. Scatter x values must be continuous
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-DBxT9BNl.js";import{jsx as l}from"react/jsx-runtime";const u={Root:e=>l(o,{kind:`scatter`,componentName:`ScatterPlot`,slotName:`scatter-plot`,...e}),Point:e=>a(`ScatterPlot.Point`,`scatter`,e),Grid:e=>n(`ScatterPlot.Grid`,e),XAxis:e=>t(`ScatterPlot.XAxis`,e),YAxis:e=>r(`ScatterPlot.YAxis`,e),ReferenceLine:t=>e(`ScatterPlot.ReferenceLine`,t),Tooltip:e=>s(`ScatterPlot.Tooltip`,e),Legend:e=>l(i,{partName:`ScatterPlot.Legend`,slotName:`scatter-plot`,...e}),CopyButton:e=>l(c,{partName:`ScatterPlot.CopyButton`,slotName:`scatter-plot`,...e})};export{u as ScatterPlot};
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./chart-DorYMICt.js";import{jsx as l}from"react/jsx-runtime";const u={Root:e=>l(o,{kind:`scatter`,componentName:`ScatterPlot`,slotName:`scatter-plot`,...e}),Point:e=>a(`ScatterPlot.Point`,`scatter`,e),Grid:e=>n(`ScatterPlot.Grid`,e),XAxis:e=>t(`ScatterPlot.XAxis`,e),YAxis:e=>r(`ScatterPlot.YAxis`,e),ReferenceLine:t=>e(`ScatterPlot.ReferenceLine`,t),Tooltip:e=>s(`ScatterPlot.Tooltip`,e),Legend:e=>l(i,{partName:`ScatterPlot.Legend`,slotName:`scatter-plot`,...e}),CopyButton:e=>l(c,{partName:`ScatterPlot.CopyButton`,slotName:`scatter-plot`,...e})};export{u as ScatterPlot};
package/dist/sidebar.d.ts CHANGED
@@ -478,19 +478,31 @@ type SidebarHeaderProps = ComponentProps<"div"> & WithAsChild & WithDataSlot;
478
478
  /**
479
479
  * The top container of a `Sidebar.Nav`, pinned above the scrollable
480
480
  * `Sidebar.Body`. Typically holds an app/product switcher built from
481
- * `Sidebar.SwitcherTrigger` composed with a `DropdownMenu` or `Dialog`. Its
482
- * height is the public `--sidebar-header-height` CSS variable (default
483
- * `4.5rem`), which centers the switcher row on the same horizontal band as an
484
- * `AppLayout.Header` toolbar when a sidebar header is composed inside an
485
- * `AppLayout`, the toolbar derives its own height from the same variable, so
486
- * overriding it at a shared ancestor (e.g. `AppLayout.Root`) moves both rows
487
- * together and the alignment holds by construction.
481
+ * `Sidebar.SwitcherTrigger` composed with a `DropdownMenu` or `Dialog`.
482
+ *
483
+ * Its **first child** owns a band exactly `--sidebar-header-height` tall
484
+ * (default `4.5rem`) and centers inside it. When a sidebar header is composed
485
+ * inside an `AppLayout`, the toolbar derives its own height from the same
486
+ * variable, so overriding it at a shared ancestor (e.g. `AppLayout.Root`) moves
487
+ * the switcher row and the toolbar together and the alignment holds by
488
+ * construction.
489
+ *
490
+ * Every child after the first stacks flush below the band in its own row, the
491
+ * way rows stack in `Sidebar.Footer` — the band's own lower half is the space
492
+ * between them. The header grows to fit them. The band, and with it the toolbar,
493
+ * stays the height of the switcher row alone, so a search row pinned under the
494
+ * switcher (`Sidebar.SearchTrigger`) needs no override and no hand-copied
495
+ * padding.
496
+ *
497
+ * The alignment is positional: keep the aligned row as the header's first direct
498
+ * child. A wrapper around both rows takes the band itself. A first row taller
499
+ * than the band overflows it — raise the variable instead.
488
500
  *
489
501
  * **CSS variables (public API):**
490
502
  *
491
503
  * | CSS Variable | Default | Description |
492
504
  * | --- | --- | --- |
493
- * | `--sidebar-header-height` | `4.5rem` | The header row height (72px). Set it on a common ancestor of the sidebar and `AppLayout.Header`, not on `Sidebar.Nav`, so both rows read one value. |
505
+ * | `--sidebar-header-height` | `4.5rem` | The first child's band (72px) — the height an `AppLayout.Header` toolbar matches, not a cap on the header, which grows for every row after the first. Set it on a common ancestor of the sidebar and `AppLayout.Header`, not on `Sidebar.Nav`, so both rows read one value. |
494
506
  *
495
507
  * @see https://mantle.ngrok.com/components/navigation/sidebar#sidebarheader
496
508
  *
@@ -1041,18 +1053,17 @@ type SidebarSearchTriggerProps = ComponentProps<"button"> & WithDataSlot & ({
1041
1053
  /**
1042
1054
  * The search row — the row that opens a search or command palette.
1043
1055
  *
1044
- * Put it at the top of `Sidebar.Body`, above the first `Sidebar.Group`: it
1045
- * needs no height change, and it lands in the same `px-3` gutter as the
1046
- * navigation rows, so it shares their column in both panel states.
1056
+ * Put it at the top of `Sidebar.Body`, above the first `Sidebar.Group`: it lands
1057
+ * in the same `px-3` gutter as the navigation rows, so it shares their column in
1058
+ * both panel states, and it scrolls with them.
1047
1059
  *
1048
- * `Sidebar.Header`, under the switcher, also works the header's own `gap-2`
1049
- * sets the spacing at the cost of a taller header. That height is a fixed one
1050
- * row so it can align with an `AppLayout.Header` toolbar, so a stack of two
1051
- * needs `--sidebar-header-height` raised on a **common ancestor of both rows**
1052
- * (`<AppLayout.Root className="[--sidebar-header-height:6rem]">`). Setting it on
1053
- * `Sidebar.Nav` only looks right: custom properties inherit downward, so
1054
- * `AppLayout.Header` would keep the `4.5rem` default and the two rows would stop
1055
- * being center-aligned.
1060
+ * `Sidebar.Header`, under the switcher, also works, and pins the row above the
1061
+ * scrolling body instead. The switcher stays the header's first child, so it
1062
+ * keeps the `--sidebar-header-height` band an `AppLayout.Header` toolbar
1063
+ * matches, and this row takes the next row down — the header grows for it, so
1064
+ * nothing needs a token override. The header reserves no scrollbar gutter, so on
1065
+ * a platform whose scrollbars take space the row runs wider than the navigation
1066
+ * rows below it, which sit inside `Sidebar.Body`'s reserved gutter.
1056
1067
  *
1057
1068
  * It is deliberately a navigation row and not a text field. The row is the same
1058
1069
  * chrome as a `Sidebar.ItemButton` — same height, padding, radius, hover, and
@@ -1685,8 +1696,9 @@ declare const Sidebar: {
1685
1696
  readonly Trigger: typeof Trigger;
1686
1697
  /**
1687
1698
  * The pinned top container of the panel, typically holding the app
1688
- * switcher (`Sidebar.SwitcherTrigger` + `DropdownMenu`/`Dialog`). Its
1689
- * height vertically aligns the switcher with an `AppLayout.Header`.
1699
+ * switcher (`Sidebar.SwitcherTrigger` + `DropdownMenu`/`Dialog`). Its first
1700
+ * child owns the band that aligns the switcher with an `AppLayout.Header`;
1701
+ * later rows stack below the band.
1690
1702
  *
1691
1703
  * @see https://mantle.ngrok.com/components/navigation/sidebar#sidebarheader
1692
1704
  *
@@ -2146,9 +2158,10 @@ declare const Sidebar: {
2146
2158
  */
2147
2159
  readonly ItemButton: typeof ItemButton;
2148
2160
  /**
2149
- * The search row for `Sidebar.Body`: an item-shaped row whose `shortcut` hint
2150
- * appears on hover or focus, and the same chip as any other row in the
2151
- * collapsed icon rail. Not state-wired compose with
2161
+ * The search row: an item-shaped row whose `shortcut` hint appears on hover or
2162
+ * focus, and the same chip as any other row in the collapsed icon rail. Goes
2163
+ * in `Sidebar.Body` to scroll with the navigation, or in `Sidebar.Header` to
2164
+ * stay pinned above it. Not state-wired — compose with
2152
2165
  * `Command.SearchTrigger`.
2153
2166
  *
2154
2167
  * **Data attributes:**
package/dist/sidebar.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DpNWVci8.js";import{t as r}from"./button-CCkGqE1t.js";import{t as i}from"./use-is-hydrated-DDCqXmju.js";import{n as a}from"./separator-D0D6VyyM.js";import{n as o,t as s}from"./use-is-apple-platform-Cxwrb86L.js";import{t as c}from"./use-callback-ref-IYti9y7x.js";import{n as l}from"./cookie-ca4g5CKp.js";import{t as u}from"./sheet-BOSknSN9.js";import{r as d}from"./use-breakpoint-Dqu12Szq.js";import{t as f}from"./tooltip-Dnu35cjU.js";import{createContext as p,useCallback as m,useContext as h,useEffect as g,useId as _,useMemo as v,useRef as y,useState as b}from"react";import x from"tiny-invariant";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";import{SidebarSimpleIcon as T}from"@phosphor-icons/react/SidebarSimple";const E={sm:`hidden sm:block`,md:`hidden md:block`,lg:`hidden lg:block`},D=p(null);function O(){let e=h(D);return x(e,`useSidebar must be used within Sidebar.Root.`),e}function k(e){let t=h(D);return x(t,`Sidebar.${e} must be rendered inside Sidebar.Root.`),t}const A=[];function j(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`:!1}function M(){let e=Symbol(`sidebar-keyboard-shortcut`);return A.push(e),{isOwner:()=>A[0]===e,release:()=>{let t=A.indexOf(e);t!==-1&&A.splice(t,1)}}}const N=({children:e,defaultOpen:t=!0,keyboardShortcut:n=!0,mobileBreakpoint:r=`lg`,onOpenChange:i,onOpenMobileChange:a,open:s,openMobile:l})=>{let u=d(r),f=_(),p=s!=null,[h,x]=b(t),S=p?s:h,w=m(e=>{p||x(e),i?.(e)},[p,i]),T=l!=null,[E,O]=b(!1),k=T?l:E,A=m(e=>{T||O(e),a?.(e)},[T,a]),N=y(u);g(()=>{let e=N.current&&!u;N.current=u,e&&k&&A(!1)},[u,k,A]);let P=m(()=>{u?A(!k):w(!S)},[u,S,k,w,A]),F=c(P);g(()=>{if(!n)return;let e=M(),t=o(),r=n=>{if(!e.isOwner()||j(n.target))return;let r=t?n.metaKey:n.ctrlKey,i=t?n.ctrlKey:n.metaKey;n.key.toLowerCase()===`b`&&r&&!i&&!n.altKey&&!n.shiftKey&&(n.preventDefault(),F())};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),e.release()}},[n,F]);let I=v(()=>({isMobile:u,keyboardShortcut:n,mobileBreakpoint:r,navId:f,open:S,openMobile:k,setOpen:w,setOpenMobile:A,toggle:P}),[u,n,r,f,S,k,w,A,P]);return C(D.Provider,{value:I,children:e})},P=({"aria-label":n,"aria-labelledby":r,children:a,className:o,"data-slot":s,...c})=>{let{isMobile:l,mobileBreakpoint:d,navId:f,open:p,openMobile:m,setOpenMobile:h}=k(`Nav`),g=i(),_=n??(r==null?`Main`:void 0);return l?C(u.Root,{open:m,onOpenChange:h,children:w(u.Content,{side:`left`,preferredWidth:`sm:max-w-(--sidebar-width-mobile,18rem)`,"data-slot":t(s,`sidebar-nav`),"data-mobile":``,...r==null?null:{"aria-labelledby":r},className:e(`bg-base w-(--sidebar-width-mobile,18rem) max-w-full p-0`,o),...c,children:[C(u.Title,{className:`sr-only`,children:_??`Sidebar`}),C(`nav`,{id:f,"aria-label":_,"aria-labelledby":r,className:`flex h-full w-full min-w-0 flex-col text-sm`,children:a})]})}):C(`div`,{"data-slot":t(s,`sidebar-nav`),"data-state":p?`expanded`:`collapsed`,"data-hydrated":g?``:void 0,className:e(`group/sidebar-nav bg-base relative h-full w-(--sidebar-width,16rem) shrink-0 overflow-hidden`,`data-[state=collapsed]:w-(--sidebar-width-icon,3.25rem)`,!g&&E[d],g&&[`transition-[width] duration-200 ease-linear motion-reduce:transition-none`],o),...c,children:C(`nav`,{id:f,"aria-label":_,"aria-labelledby":r,className:`absolute inset-y-0 left-0 flex w-full min-w-0 flex-col text-sm`,children:a})})},F=C(T,{}),I=({label:e,shortcut:t})=>t==null?e:w(`span`,{className:`flex items-center gap-1.5`,children:[e,C(`span`,{"aria-hidden":!0,className:`inline-flex shrink-0 items-center gap-0.5 [&_kbd]:h-4 [&_kbd]:min-w-4 [&_kbd]:bg-neutral-500/25 [&_kbd]:px-0.5 [&_kbd]:text-xs`,children:t})]}),L=({appearance:e=`ghost`,"data-slot":n,icon:i=F,intent:a=`neutral`,label:o=`Toggle Sidebar`,onClick:c,shortcut:l,...u})=>{let{isMobile:d,keyboardShortcut:p,navId:m,open:h,openMobile:g,toggle:_}=k(`Trigger`),v=s(),y=d?g:h,b=!d||g,x=p?l:void 0,S=v?`Meta+B`:`Control+B`;return w(f.Root,{children:[C(f.Trigger,{asChild:!0,children:C(r,{appearance:e,"aria-controls":b?m:void 0,"aria-expanded":y,"aria-keyshortcuts":p?S:void 0,"data-slot":t(n,`sidebar-trigger`),"data-state":y?`expanded`:`collapsed`,icon:i,intent:a,label:o,onClick:e=>{c?.(e),e.defaultPrevented||_()},...u})}),C(f.Content,{"data-slot":`sidebar-trigger-tooltip`,children:C(I,{label:o,shortcut:x})})]})},R=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-header`),className:e(`flex h-(--sidebar-header-height,4.5rem) shrink-0 flex-col justify-center gap-2 px-3`,`group-data-[state=expanded]/sidebar-nav:pr-1`,a),...s,children:i}),z=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-body`),className:e(`scrollbar scrollbar-gutter-stable scroll-fade-y flex-1 scroll-py-6 space-y-2 overflow-y-auto overflow-x-hidden px-3 pt-1.5 pb-4`,`group-data-[state=expanded]/sidebar-nav:pr-1`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-none`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-gutter-auto`,`group-data-[state=collapsed]/sidebar-nav:[&::-webkit-scrollbar]:hidden`,a),...s,children:i}),B=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-footer`),className:e(`shrink-0 px-3 pt-3 pb-3.5`,`group-data-[state=expanded]/sidebar-nav:pr-1`,a),...s,children:i}),V=p(null),H=({asChild:r,children:i,className:a,"data-slot":o,...s})=>{let[c,l]=b(null),u=v(()=>({mountedLabelId:c,setMountedLabelId:l}),[c]),d=r?n:`div`;return C(V.Provider,{value:u,children:C(d,{"data-slot":t(o,`sidebar-group`),className:e(`pt-0.5`,a),...s,children:i})})},U=({asChild:r,children:i,className:a,"data-slot":o,id:s,...c})=>{let l=h(V),u=_(),d=s??(l==null?void 0:u),f=l?.setMountedLabelId;return g(()=>{if(f!=null&&d!=null)return f(d),()=>{f(null)}},[f,d]),C(r?n:`div`,{id:d,"data-slot":t(o,`sidebar-group-label`),className:e(`text-muted flex min-w-0 items-center gap-2 truncate px-2 py-1 text-xs font-medium`,`group-data-[state=collapsed]/sidebar-nav:opacity-0`,`group-data-[state=collapsed]/sidebar-nav:pointer-events-none`,`group-data-hydrated/sidebar-nav:transition-opacity group-data-hydrated/sidebar-nav:duration-200 group-data-hydrated/sidebar-nav:ease-linear group-data-hydrated/sidebar-nav:motion-reduce:transition-none`,a),...c,children:i})},W=({"aria-labelledby":r,asChild:i,children:a,className:o,"data-slot":s,...c})=>{let l=h(V);return C(i?n:`ul`,{"aria-labelledby":r??l?.mountedLabelId??void 0,"data-slot":t(s,`sidebar-list`),className:e(`mb-2 space-y-px`,o),...c,children:a})},G=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`li`,{"data-slot":t(o,`sidebar-item`),className:e(`list-none`,a),...s,children:i}),K=[`ring-focus-accent flex w-full min-w-0 items-center gap-2 truncate rounded-md px-2 py-1 text-left font-normal transition-none focus:outline-hidden focus-visible:ring-4`,`text-body hover:text-strong hover:bg-neutral-500/10`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`group-data-[state=collapsed]/sidebar-nav:ml-1`,`group-data-[state=collapsed]/sidebar-nav:w-7`,`group-data-[state=collapsed]/sidebar-nav:p-1`],q={Root:N,Nav:P,Trigger:L,Header:R,Body:z,Footer:B,Group:H,GroupLabel:U,List:W,Item:G,ItemButton:({asChild:r,children:i,className:a,current:o,"data-slot":s,type:c,...l})=>C(r?n:`button`,{"data-slot":t(s,`sidebar-item-button`),"data-current":o?``:void 0,"aria-current":o?`page`:void 0,type:r?c:c??`button`,className:e(K,`data-current:bg-neutral-500/15 data-current:text-strong`,`aria-[current=page]:bg-neutral-500/15 aria-[current=page]:text-strong`,`[&>svg]:text-muted hover:[&>svg]:text-strong data-current:[&>svg]:text-strong aria-[current=page]:[&>svg]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,a),...l,children:i}),SearchTrigger:({asChild:r,children:i,className:a,"data-slot":o,shortcut:s,type:c,...l})=>{let u=r?n:`button`,d=s==null?i:w(S,{children:[i,C(`span`,{"aria-hidden":!0,className:e(`pointer-events-none -mr-1 ml-auto inline-flex shrink-0 items-center gap-0.5 opacity-0 select-none`,`group-hover:opacity-100 group-focus-visible:opacity-100`,`group-data-[state=collapsed]/sidebar-nav:hidden`,`[&_kbd]:text-body [&_kbd]:h-5 [&_kbd]:min-w-5 [&_kbd]:bg-neutral-500/20 [&_kbd]:px-1 [&_kbd]:text-xs [&_kbd]:font-normal`),children:s})]});return C(u,{"data-slot":t(o,`sidebar-search-trigger`),type:r?c:c??`button`,className:e(`group`,K,`[&>svg:first-child]:text-muted hover:[&>svg:first-child]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,a),...l,children:d})},SwitcherTrigger:({asChild:r,children:i,className:a,"data-slot":o,type:s,...c})=>C(r?n:`button`,{"data-slot":t(o,`sidebar-switcher-trigger`),type:r?s:s??`button`,className:e(`text-body hover:text-strong hover:bg-neutral-500/10 flex w-full min-w-0 items-center gap-2 rounded-[0.625rem] py-1 pr-1.5 pl-1 text-left font-medium transition-none`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`ring-focus-accent focus:outline-hidden focus-visible:ring-4`,`*:first:size-7`,`group-data-[state=collapsed]/sidebar-nav:w-9`,`group-data-[state=collapsed]/sidebar-nav:p-1`,`group-data-[state=collapsed]/sidebar-nav:[&>:not(:first-child)]:sr-only`,a),...c,children:i}),Tooltip:({children:e,"data-slot":n,label:r,shortcut:i,side:a=`right`,...o})=>{let{isMobile:s,open:c}=k(`Tooltip`),l=!s&&!c,[u,d]=b(!1),[p,m]=b(l);return p!==l&&(m(l),d(!1)),w(f.Root,{disableHoverableContent:!0,onOpenChange:e=>{d(e&&l)},open:l&&u,children:[C(f.Trigger,{asChild:!0,children:e}),C(f.Content,{"data-slot":t(n,`sidebar-tooltip`),side:a,...o,children:C(I,{label:r,shortcut:i})})]})},Separator:({className:n,"data-slot":r,...i})=>C(a,{"data-slot":t(r,`sidebar-separator`),className:e(`my-3`,`group-data-[state=collapsed]/sidebar-nav:w-9`,n),...i})},J=`mantle-sidebar-state`,Y={collapsed:`collapsed`,expanded:`expanded`};function X(e){let t=l(e,J);if(t===Y.expanded)return!0;if(t===Y.collapsed)return!1}function Z(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?Y.expanded:Y.collapsed,c=[`${J}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{J as SIDEBAR_STATE_COOKIE_NAME,q as Sidebar,X as extractSidebarStateCookie,Z as serializeSidebarStateCookie,O as useSidebar};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DpNWVci8.js";import{t as r}from"./button-CCkGqE1t.js";import{t as i}from"./use-is-hydrated-DDCqXmju.js";import{n as a}from"./separator-D0D6VyyM.js";import{n as o,t as s}from"./use-is-apple-platform-Cxwrb86L.js";import{t as c}from"./use-callback-ref-IYti9y7x.js";import{n as l}from"./cookie-ca4g5CKp.js";import{t as u}from"./sheet-BOSknSN9.js";import{r as d}from"./use-breakpoint-Dqu12Szq.js";import{t as f}from"./tooltip-Dnu35cjU.js";import{createContext as p,useCallback as m,useContext as h,useEffect as g,useId as _,useMemo as v,useRef as y,useState as b}from"react";import x from"tiny-invariant";import{Fragment as S,jsx as C,jsxs as w}from"react/jsx-runtime";import{SidebarSimpleIcon as T}from"@phosphor-icons/react/SidebarSimple";const E={sm:`hidden sm:block`,md:`hidden md:block`,lg:`hidden lg:block`},D=p(null);function O(){let e=h(D);return x(e,`useSidebar must be used within Sidebar.Root.`),e}function k(e){let t=h(D);return x(t,`Sidebar.${e} must be rendered inside Sidebar.Root.`),t}const A=[];function j(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`:!1}function M(){let e=Symbol(`sidebar-keyboard-shortcut`);return A.push(e),{isOwner:()=>A[0]===e,release:()=>{let t=A.indexOf(e);t!==-1&&A.splice(t,1)}}}const N=({children:e,defaultOpen:t=!0,keyboardShortcut:n=!0,mobileBreakpoint:r=`lg`,onOpenChange:i,onOpenMobileChange:a,open:s,openMobile:l})=>{let u=d(r),f=_(),p=s!=null,[h,x]=b(t),S=p?s:h,w=m(e=>{p||x(e),i?.(e)},[p,i]),T=l!=null,[E,O]=b(!1),k=T?l:E,A=m(e=>{T||O(e),a?.(e)},[T,a]),N=y(u);g(()=>{let e=N.current&&!u;N.current=u,e&&k&&A(!1)},[u,k,A]);let P=m(()=>{u?A(!k):w(!S)},[u,S,k,w,A]),F=c(P);g(()=>{if(!n)return;let e=M(),t=o(),r=n=>{if(!e.isOwner()||j(n.target))return;let r=t?n.metaKey:n.ctrlKey,i=t?n.ctrlKey:n.metaKey;n.key.toLowerCase()===`b`&&r&&!i&&!n.altKey&&!n.shiftKey&&(n.preventDefault(),F())};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),e.release()}},[n,F]);let I=v(()=>({isMobile:u,keyboardShortcut:n,mobileBreakpoint:r,navId:f,open:S,openMobile:k,setOpen:w,setOpenMobile:A,toggle:P}),[u,n,r,f,S,k,w,A,P]);return C(D.Provider,{value:I,children:e})},P=({"aria-label":n,"aria-labelledby":r,children:a,className:o,"data-slot":s,...c})=>{let{isMobile:l,mobileBreakpoint:d,navId:f,open:p,openMobile:m,setOpenMobile:h}=k(`Nav`),g=i(),_=n??(r==null?`Main`:void 0);return l?C(u.Root,{open:m,onOpenChange:h,children:w(u.Content,{side:`left`,preferredWidth:`sm:max-w-(--sidebar-width-mobile,18rem)`,"data-slot":t(s,`sidebar-nav`),"data-mobile":``,...r==null?null:{"aria-labelledby":r},className:e(`bg-base w-(--sidebar-width-mobile,18rem) max-w-full p-0`,o),...c,children:[C(u.Title,{className:`sr-only`,children:_??`Sidebar`}),C(`nav`,{id:f,"aria-label":_,"aria-labelledby":r,className:`flex h-full w-full min-w-0 flex-col text-sm`,children:a})]})}):C(`div`,{"data-slot":t(s,`sidebar-nav`),"data-state":p?`expanded`:`collapsed`,"data-hydrated":g?``:void 0,className:e(`group/sidebar-nav bg-base relative h-full w-(--sidebar-width,16rem) shrink-0 overflow-hidden`,`data-[state=collapsed]:w-(--sidebar-width-icon,3.25rem)`,!g&&E[d],g&&[`transition-[width] duration-200 ease-linear motion-reduce:transition-none`],o),...c,children:C(`nav`,{id:f,"aria-label":_,"aria-labelledby":r,className:`absolute inset-y-0 left-0 flex w-full min-w-0 flex-col text-sm`,children:a})})},F=C(T,{}),I=({label:e,shortcut:t})=>t==null?e:w(`span`,{className:`flex items-center gap-1.5`,children:[e,C(`span`,{"aria-hidden":!0,className:`inline-flex shrink-0 items-center gap-0.5 [&_kbd]:h-4 [&_kbd]:min-w-4 [&_kbd]:bg-neutral-500/25 [&_kbd]:px-0.5 [&_kbd]:text-xs`,children:t})]}),L=({appearance:e=`ghost`,"data-slot":n,icon:i=F,intent:a=`neutral`,label:o=`Toggle Sidebar`,onClick:c,shortcut:l,...u})=>{let{isMobile:d,keyboardShortcut:p,navId:m,open:h,openMobile:g,toggle:_}=k(`Trigger`),v=s(),y=d?g:h,b=!d||g,x=p?l:void 0,S=v?`Meta+B`:`Control+B`;return w(f.Root,{children:[C(f.Trigger,{asChild:!0,children:C(r,{appearance:e,"aria-controls":b?m:void 0,"aria-expanded":y,"aria-keyshortcuts":p?S:void 0,"data-slot":t(n,`sidebar-trigger`),"data-state":y?`expanded`:`collapsed`,icon:i,intent:a,label:o,onClick:e=>{c?.(e),e.defaultPrevented||_()},...u})}),C(f.Content,{"data-slot":`sidebar-trigger-tooltip`,children:C(I,{label:o,shortcut:x})})]})},R=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-header`),className:e(`grid grid-cols-1 grid-rows-(--sidebar-header-height,4.5rem) shrink-0 items-center px-3`,`group-data-[state=expanded]/sidebar-nav:pr-1`,a),...s,children:i}),z=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-body`),className:e(`scrollbar scrollbar-gutter-stable scroll-fade-y flex-1 scroll-py-6 space-y-2 overflow-y-auto overflow-x-hidden px-3 pt-1.5 pb-4`,`group-data-[state=expanded]/sidebar-nav:pr-1`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-none`,`group-data-[state=collapsed]/sidebar-nav:scrollbar-gutter-auto`,`group-data-[state=collapsed]/sidebar-nav:[&::-webkit-scrollbar]:hidden`,a),...s,children:i}),B=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`div`,{"data-slot":t(o,`sidebar-footer`),className:e(`shrink-0 px-3 pt-3 pb-3.5`,`group-data-[state=expanded]/sidebar-nav:pr-1`,a),...s,children:i}),V=p(null),H=({asChild:r,children:i,className:a,"data-slot":o,...s})=>{let[c,l]=b(null),u=v(()=>({mountedLabelId:c,setMountedLabelId:l}),[c]),d=r?n:`div`;return C(V.Provider,{value:u,children:C(d,{"data-slot":t(o,`sidebar-group`),className:e(`pt-0.5`,a),...s,children:i})})},U=({asChild:r,children:i,className:a,"data-slot":o,id:s,...c})=>{let l=h(V),u=_(),d=s??(l==null?void 0:u),f=l?.setMountedLabelId;return g(()=>{if(f!=null&&d!=null)return f(d),()=>{f(null)}},[f,d]),C(r?n:`div`,{id:d,"data-slot":t(o,`sidebar-group-label`),className:e(`text-muted flex min-w-0 items-center gap-2 truncate px-2 py-1 text-xs font-medium`,`group-data-[state=collapsed]/sidebar-nav:opacity-0`,`group-data-[state=collapsed]/sidebar-nav:pointer-events-none`,`group-data-hydrated/sidebar-nav:transition-opacity group-data-hydrated/sidebar-nav:duration-200 group-data-hydrated/sidebar-nav:ease-linear group-data-hydrated/sidebar-nav:motion-reduce:transition-none`,a),...c,children:i})},W=({"aria-labelledby":r,asChild:i,children:a,className:o,"data-slot":s,...c})=>{let l=h(V);return C(i?n:`ul`,{"aria-labelledby":r??l?.mountedLabelId??void 0,"data-slot":t(s,`sidebar-list`),className:e(`mb-2 space-y-px`,o),...c,children:a})},G=({asChild:r,children:i,className:a,"data-slot":o,...s})=>C(r?n:`li`,{"data-slot":t(o,`sidebar-item`),className:e(`list-none`,a),...s,children:i}),K=[`ring-focus-accent flex w-full min-w-0 items-center gap-2 truncate rounded-md px-2 py-1 text-left font-normal transition-none focus:outline-hidden focus-visible:ring-4`,`text-body hover:text-strong hover:bg-neutral-500/10`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`group-data-[state=collapsed]/sidebar-nav:ml-1`,`group-data-[state=collapsed]/sidebar-nav:w-7`,`group-data-[state=collapsed]/sidebar-nav:p-1`],q={Root:N,Nav:P,Trigger:L,Header:R,Body:z,Footer:B,Group:H,GroupLabel:U,List:W,Item:G,ItemButton:({asChild:r,children:i,className:a,current:o,"data-slot":s,type:c,...l})=>C(r?n:`button`,{"data-slot":t(s,`sidebar-item-button`),"data-current":o?``:void 0,"aria-current":o?`page`:void 0,type:r?c:c??`button`,className:e(K,`data-current:bg-neutral-500/15 data-current:text-strong`,`aria-[current=page]:bg-neutral-500/15 aria-[current=page]:text-strong`,`[&>svg]:text-muted hover:[&>svg]:text-strong data-current:[&>svg]:text-strong aria-[current=page]:[&>svg]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,a),...l,children:i}),SearchTrigger:({asChild:r,children:i,className:a,"data-slot":o,shortcut:s,type:c,...l})=>{let u=r?n:`button`,d=s==null?i:w(S,{children:[i,C(`span`,{"aria-hidden":!0,className:e(`pointer-events-none -mr-1 ml-auto inline-flex shrink-0 items-center gap-0.5 opacity-0 select-none`,`group-hover:opacity-100 group-focus-visible:opacity-100`,`group-data-[state=collapsed]/sidebar-nav:hidden`,`[&_kbd]:text-body [&_kbd]:h-5 [&_kbd]:min-w-5 [&_kbd]:bg-neutral-500/20 [&_kbd]:px-1 [&_kbd]:text-xs [&_kbd]:font-normal`),children:s})]});return C(u,{"data-slot":t(o,`sidebar-search-trigger`),type:r?c:c??`button`,className:e(`group`,K,`[&>svg:first-child]:text-muted hover:[&>svg:first-child]:text-strong [&>svg:first-child]:size-5 [&>svg]:shrink-0`,a),...l,children:d})},SwitcherTrigger:({asChild:r,children:i,className:a,"data-slot":o,type:s,...c})=>C(r?n:`button`,{"data-slot":t(o,`sidebar-switcher-trigger`),type:r?s:s??`button`,className:e(`text-body hover:text-strong hover:bg-neutral-500/10 flex w-full min-w-0 items-center gap-2 rounded-[0.625rem] py-1 pr-1.5 pl-1 text-left font-medium transition-none`,`data-state-open:bg-neutral-500/15 data-state-open:text-strong`,`ring-focus-accent focus:outline-hidden focus-visible:ring-4`,`*:first:size-7`,`group-data-[state=collapsed]/sidebar-nav:w-9`,`group-data-[state=collapsed]/sidebar-nav:p-1`,`group-data-[state=collapsed]/sidebar-nav:[&>:not(:first-child)]:sr-only`,a),...c,children:i}),Tooltip:({children:e,"data-slot":n,label:r,shortcut:i,side:a=`right`,...o})=>{let{isMobile:s,open:c}=k(`Tooltip`),l=!s&&!c,[u,d]=b(!1),[p,m]=b(l);return p!==l&&(m(l),d(!1)),w(f.Root,{disableHoverableContent:!0,onOpenChange:e=>{d(e&&l)},open:l&&u,children:[C(f.Trigger,{asChild:!0,children:e}),C(f.Content,{"data-slot":t(n,`sidebar-tooltip`),side:a,...o,children:C(I,{label:r,shortcut:i})})]})},Separator:({className:n,"data-slot":r,...i})=>C(a,{"data-slot":t(r,`sidebar-separator`),className:e(`my-3`,`group-data-[state=collapsed]/sidebar-nav:w-9`,n),...i})},J=`mantle-sidebar-state`,Y={collapsed:`collapsed`,expanded:`expanded`};function X(e){let t=l(e,J);if(t===Y.expanded)return!0;if(t===Y.collapsed)return!1}function Z(e,t={}){let{domain:n,maxAge:r=31536e3,path:i=`/`,sameSite:a=`Lax`,secure:o=!1}=t,s=e?Y.expanded:Y.collapsed,c=[`${J}=${s}`,`Max-Age=${r}`,`Path=${i}`];return n!=null&&c.push(`Domain=${n}`),c.push(`SameSite=${a}`),o&&c.push(`Secure`),c.join(`; `)}export{J as SIDEBAR_STATE_COOKIE_NAME,q as Sidebar,X as extractSidebarStateCookie,Z as serializeSidebarStateCookie,O as useSidebar};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrok/mantle",
3
- "version": "0.83.0",
3
+ "version": "0.83.2",
4
4
  "description": "mantle is ngrok's UI library and design system.",
5
5
  "homepage": "https://mantle.ngrok.com",
6
6
  "license": "MIT",
@@ -117,7 +117,7 @@
117
117
  "./well": "./dist/well.js"
118
118
  },
119
119
  "dependencies": {
120
- "@ariakit/react": "0.4.35",
120
+ "@ariakit/react": "0.4.36",
121
121
  "@headlessui/react": "2.2.10",
122
122
  "@radix-ui/react-dialog": "1.1.23",
123
123
  "@radix-ui/react-dropdown-menu": "2.1.24",
@@ -1,2 +0,0 @@
1
- import{n as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./button-CCkGqE1t.js";import{t as i}from"./use-copy-to-clipboard-CSyp4Zk0.js";import{createContext as a,useContext as o,useEffect as s,useId as c,useLayoutEffect as l,useMemo as u,useRef as d,useState as f,useSyncExternalStore as p}from"react";import m from"tiny-invariant";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{CheckIcon as v}from"@phosphor-icons/react/Check";import{CopyIcon as y}from"@phosphor-icons/react/Copy";import{scaleTime as b}from"d3-scale";import{area as x,curveLinear as S,curveMonotoneX as C,curveStep as w,line as T}from"d3-shape";const E=(e,t)=>Reflect.get(e,t),D=.5,O=(e,t)=>e<0?e:t,k=e=>{let{lower:t,upper:n,toPixel:r,reveal:i,gap:a}=e,o=r(t<0?n:t),s=o+(r(O(t,n))-o)*i;if(Math.abs(o-r(0))<D)return{baseline:o,value:s};let c=Math.min(a,Math.abs(o-s)/2);return{baseline:o-Math.sign(o-s)*c,value:s}},A=e=>{let{lower:t,upper:n,pileOuter:r,toPixel:i}=e;if(Number.isNaN(r))return!1;let a=i(O(t,n));return Math.abs(a-i(r))<D},j=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`,`chart-other`],ee=e=>j.includes(e),te=e=>`--color-${e}`,ne=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`],re=e=>{let t=e.toLowerCase();return t.includes(`var(`)||t.includes(`currentcolor`)},M=(e,t)=>{let n=e.ownerDocument,r=n.createElement(`span`);r.style.display=`none`,r.style.color=t,e.appendChild(r);let i=n.defaultView?.getComputedStyle(r).color??``;return r.remove(),i},ie=(e,t)=>ee(t)?M(e,`var(${te(t)})`):re(t)?M(e,t):t,ae=e=>({grid:M(e,`var(--border-color-card-muted)`),baseline:M(e,`var(--border-color-card)`),tickText:M(e,`var(--text-color-muted)`),reference:M(e,`var(--color-neutral-500)`),surface:M(e,`var(--background-color-card)`)}),N=e=>`${e.className}|${e.getAttribute(`data-applied-theme`)??``}|${e.getAttribute(`data-theme`)??``}`,P=(e,t)=>{let n=new MutationObserver(t);return n.observe(e,{attributes:!0,attributeFilter:[`class`,`data-applied-theme`,`data-theme`]}),()=>n.disconnect()},F=1.5,I=1.1,L=1.6,R=e=>`oklch(from ${e} calc(l - 0.18) c h)`,z=(e,t,n)=>{let r=F;if(n===`up`){e.moveTo(-1.5,t+r),e.lineTo(t+r,-1.5),e.moveTo(-1.5,r),e.lineTo(r,-1.5),e.moveTo(t-r,t+r),e.lineTo(t+r,t-r);return}e.moveTo(-1.5,-1.5),e.lineTo(t+r,t+r),e.moveTo(t-r,-1.5),e.lineTo(t+r,r),e.moveTo(-1.5,t-r),e.lineTo(r,t+r)},B=(e,t)=>{let{size:n,width:r}=t;e.fillRect(0,n/2-r/2,n,r)},V=(e,t)=>{let{size:n,width:r}=t;e.fillRect(n/2-r/2,0,r,n)},oe={hatch:(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=F,e.beginPath(),z(e,t,`up`),e.stroke()},"hatch-reverse":(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=F,e.beginPath(),z(e,t,`down`),e.stroke()},crosshatch:(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=1,e.beginPath(),z(e,t,`up`),z(e,t,`down`),e.stroke()},perpendicular:(e,{size:t,ink:n,orientation:r})=>{e.fillStyle=n,r===`horizontal`?V(e,{size:t,width:2}):B(e,{size:t,width:2})},parallel:(e,{size:t,ink:n,orientation:r})=>{e.fillStyle=n,r===`horizontal`?B(e,{size:t,width:2}):V(e,{size:t,width:2})},grid:(e,{size:t,ink:n})=>{e.fillStyle=n,B(e,{size:t,width:I}),V(e,{size:t,width:I})},dots:(e,{size:t,ink:n})=>{e.fillStyle=n,e.beginPath(),e.arc(t/4,t/4,L,0,Math.PI*2),e.moveTo(3*t/4+L,3*t/4),e.arc(3*t/4,3*t/4,L,0,Math.PI*2),e.fill()}},se=(e,t)=>{let{texture:n,color:r,ink:i,devicePixelRatio:a,orientation:o}=t,s=e.canvas.ownerDocument.createElement(`canvas`);s.width=Math.max(1,Math.round(8*a)),s.height=s.width;let c=s.getContext(`2d`);if(c==null)return null;let l=s.width/8;c.scale(l,l),c.fillStyle=r,c.fillRect(0,0,8,8),oe[n](c,{size:8,ink:i,orientation:o});let u=e.createPattern(s,`repeat`);return u?.setTransform({a:1/l,b:0,c:0,d:1/l,e:0,f:0}),u},H=e=>{let{pointCount:t,columnCount:n,wasDecimated:r}=e;return n<=0?!1:r?t>=n*3:t>=n*4},U=e=>{let{xs:t,values:n,startIndex:r,endIndex:i,positionK:a,positionB:o,columnCount:s}=e,c=new Uint8Array(s),l=new Float64Array(s),u=new Float64Array(s),d=new Float64Array(s),f=new Float64Array(s);for(let e=r;e<=i;e++){let r=n[e]??NaN;if(Number.isNaN(r))continue;let i=t[e]??NaN,p=Math.floor(i*a+o);if(p===s&&(p=s-1),!(p<0||p>=s)){if(c[p]===0){c[p]=1,l[p]=r,u[p]=r,d[p]=r,f[p]=r;continue}r<(l[p]??1/0)&&(l[p]=r),r>(u[p]??-1/0)&&(u[p]=r),f[p]=r}}return{columnCount:s,hasData:c,minValue:l,maxValue:u,inValue:d,outValue:f}},ce=new Intl.NumberFormat,le=new Intl.NumberFormat(void 0,{maximumSignificantDigits:4}),W=new Map,G=(e,t)=>{let n=Object.is(e,-0)?0:e,r=t?.maximumFractionDigits;if(r!=null){let e=W.get(r);return e??(e=new Intl.NumberFormat(void 0,{maximumFractionDigits:r}),W.set(r,e)),e.format(n)}return n!==0&&Math.abs(n)<1?le.format(n):ce.format(n)},ue=e=>!Number.isFinite(e)||e<=0?0:Math.min(20,Math.max(0,-Math.floor(Math.log10(e)))),de=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),fe=new Intl.DateTimeFormat(void 0,{year:`numeric`,month:`short`,day:`numeric`}),pe=e=>e.getHours()!==0||e.getMinutes()!==0||e.getSeconds()!==0||e.getMilliseconds()!==0,K=(e,t)=>typeof e==`string`?e:typeof e==`number`?G(e):Number.isNaN(e.getTime())?`—`:t?.datasetHasTimeOfDay??pe(e)?de.format(e):fe.format(e),me=(e,t,n)=>{if(t<=0)return null;let r=0,i=t-1,a=e[0]??0,o=e[i]??0;if(n<=a)return 0;if(n>=o)return i;for(;i-r>1;){let t=r+i>>1;(e[t]??0)<=n?r=t:i=t}let s=n-(e[r]??0);return(e[i]??0)-n<s?i:r},he=Math.PI/2-.05,ge=e=>({cosYaw:Math.cos(e.yaw),sinYaw:Math.sin(e.yaw),cosPitch:Math.cos(e.pitch),sinPitch:Math.sin(e.pitch)}),_e=(e,t,n,r)=>{let i=e*r.cosYaw+n*r.sinYaw,a=-e*r.sinYaw+n*r.cosYaw,o=t*r.cosPitch-a*r.sinPitch,s=t*r.sinPitch+a*r.cosPitch,c=4/(4+s);return{x:i*c,y:o*c,depth:s,scale:c}},ve=e=>Math.min(he,Math.max(-he,e)),ye=(e,t)=>{let n=t[1]-t[0];return n===0?0:(e-t[0])/n*2-1},be=[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1],[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],xe=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]],Se=Math.sqrt(50),Ce=Math.sqrt(10),we=Math.sqrt(2),q=(e,t,n,r)=>{let i=(t-e)/Math.max(0,n),a=r?.integer?Math.max(1,i):i,o=Math.floor(Math.log10(a)),s=a/10**o,c=s>=Se?10:s>=Ce?5:s>=we?2:1,l,u,d;return o<0?(d=10**-o/c,l=Math.round(e*d),u=Math.round(t*d),l/d<e&&(l+=1),u/d>t&&--u,d=-d):(d=10**o*c,l=Math.round(e/d),u=Math.round(t/d),l*d<e&&(l+=1),u*d>t&&--u),u<l&&.5<=n&&n<2?q(e,t,n*2,r):[l,u,d]},Te=(e,t,n,r)=>{if(!(n>0))return[];if(e===t)return r?.integer&&!Number.isInteger(e)?[]:[e];let i=t<e,[a,o,s]=i?q(t,e,n,r):q(e,t,n,r);if(!(o>=a))return[];let c=o-a+1,l=[];for(let e=0;e<c;e+=1){let t=i?o-e:a+e;l.push(s<0?t/-s:t*s)}return l},Ee=(e,t,n)=>q(e,t,n)[2],De=(e,t)=>{let n=e[1]-e[0];if(n===0)return{k:0,b:(t[0]+t[1])/2};let r=(t[1]-t[0])/n;return{k:r,b:t[0]-e[0]*r}},Oe=e=>{let{count:t,rangeStart:n,rangeEnd:r,paddingInner:i,paddingOuter:a}=e,o=r-n;if(t<=0||o<=0)return{count:Math.max(0,t),rangeStart:n,step:0,bandwidth:0,offset:0};let s=o/Math.max(1,t-i+a*2);return{count:t,rangeStart:n,step:s,bandwidth:s*(1-i),offset:s*a}},J=(e,t)=>e.rangeStart+e.offset+t*e.step,Y=(e,t)=>J(e,t)+e.bandwidth/2,ke=(e,t)=>({start:J(e,t)-(e.step-e.bandwidth)/2,size:e.step}),Ae=(e,t)=>{if(e.count===0||e.step===0)return null;let n=Math.floor((t-e.rangeStart-e.offset+e.step/2-e.bandwidth/2)/e.step);return Math.min(e.count-1,Math.max(0,n))},je=(e,t,n)=>Te(e[0],e[1],t,n);let Me=null,Ne=null;const Pe=e=>{if(Ne!=null&&Me!=null&&Me[0]===e[0]&&Me[1]===e[1])return Ne;let t=b().domain([new Date(e[0]),new Date(e[1])]);return Me=[e[0],e[1]],Ne=t,t},Fe=(e,t)=>Pe(e).ticks(t).map(e=>e.getTime()),Ie=e=>{let t=Pe(e).tickFormat();return e=>t(new Date(e))},X=(e,t)=>{if(e[0]>e[1])return X([e[1],e[0]],t);if(e[0]===e[1]){let n=e[0],r=n===0?1:Math.abs(n)*.5;return X([n-r,n+r],t)}let n=e[0],r=e[1],i=NaN;for(let e=0;e<10;e++){let e=Ee(n,r,t);if(e===i||e===0||!Number.isFinite(e))break;if(e>0)n=Math.floor(n/e)*e,r=Math.ceil(r/e)*e;else{let t=-e;n=Math.floor(n*t)/t,r=Math.ceil(r*t)/t}i=e}return[n,r]},Le=(e,t)=>{let n=X(e,t);return e[0]===0?[0,n[1]]:n},Re=e=>e===`monotone`?C:e===`step`?w:S,Z=e=>Math.round(e)+.5,ze=(e,t)=>{let{plot:n,color:r,xLines:i,yLines:a}=t;e.save(),e.strokeStyle=r,e.lineWidth=1;for(let t of i)e.globalAlpha=t.alpha,e.beginPath(),e.moveTo(Z(t.position),n.top),e.lineTo(Z(t.position),n.top+n.height),e.stroke();for(let t of a)e.globalAlpha=t.alpha,e.beginPath(),e.moveTo(n.left,Z(t.position)),e.lineTo(n.left+n.width,Z(t.position)),e.stroke();e.restore()},Be=(e,t)=>{let{plot:n,color:r,y:i}=t;e.strokeStyle=r,e.lineWidth=1,e.beginPath(),e.moveTo(n.left,Z(i)),e.lineTo(n.left+n.width,Z(i)),e.stroke()},Ve=(e,t)=>{let{plot:n,color:r,x:i}=t;e.strokeStyle=r,e.lineWidth=1,e.beginPath(),e.moveTo(Z(i),n.top),e.lineTo(Z(i),n.top+n.height),e.stroke()},He=(e,t)=>{let{fill:n,rects:r}=t;e.fillStyle=n,e.beginPath();for(let t of r){let n=Math.max(.5,t.width),r=Math.min(t.valueY,t.baselineY),i=Math.abs(t.baselineY-t.valueY);if(i===0)continue;let a=t.rounded&&n>=8?Math.min(4,n/2,i):0;if(a===0){e.rect(t.x,r,n,i);continue}t.valueY<=t.baselineY?e.roundRect(t.x,r,n,i,[a,a,0,0]):e.roundRect(t.x,r,n,i,[0,0,a,a])}e.fill()},Ue=(e,t)=>{let{fill:n,rects:r}=t;e.fillStyle=n,e.beginPath();for(let t of r){let n=Math.max(.5,t.height),r=Math.min(t.valueX,t.baselineX),i=Math.abs(t.valueX-t.baselineX);if(i===0)continue;let a=t.rounded&&n>=8?Math.min(4,n/2,i):0;if(a===0){e.rect(r,t.y,i,n);continue}t.valueX>=t.baselineX?e.roundRect(r,t.y,i,n,[0,a,a,0]):e.roundRect(r,t.y,i,n,[a,0,0,a])}e.fill()},We=(e,t)=>{let{color:n,curve:r,indexes:i,xAt:a,yAt:o,definedAt:s}=t,c=T().x(a).y(o).defined(s).curve(Re(r)).context(e);e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath(),c(i),e.stroke()},Ge=(e,t)=>{let{color:n,curve:r,indexes:i,xAt:a,y0At:o,y1At:s,definedAt:c}=t,l=x().x(a).y0(o).y1(s).defined(c).curve(Re(r)).context(e);e.beginPath(),l(i),e.save(),e.globalAlpha=.1,e.fillStyle=n,e.fill(),e.restore();let u=T().x(a).y(s).defined(c).curve(Re(r)).context(e);e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath(),u(i),e.stroke()},Ke=(e,t)=>{let{color:n,columns:r,columnToX:i,valueK:a,valueB:o}=t;e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath();let s=!1;for(let t=0;t<r.columnCount;t++){if(r.hasData[t]===0){s=!1;continue}let n=i(t),c=(r.inValue[t]??0)*a+o,l=(r.minValue[t]??0)*a+o,u=(r.maxValue[t]??0)*a+o,d=(r.outValue[t]??0)*a+o;s?e.lineTo(n,c):(e.moveTo(n,c),s=!0),(l!==c||u!==c)&&(e.lineTo(n,l),e.lineTo(n,u)),d!==u&&e.lineTo(n,d)}e.stroke()},qe=(e,t)=>{let{color:n,lowerColumns:r,upperColumns:i,columnToX:a,valueK:o,valueB:s}=t;e.beginPath();let c=-1,l=t=>{if(c<0)return;let n=!1;for(let r=c;r<=t;r++){let t=a(r),c=(i.maxValue[r]??0)*o+s;n?e.lineTo(t,c):(e.moveTo(t,c),n=!0)}for(let n=t;n>=c;n--){let t=a(n),i=(r.minValue[n]??0)*o+s;e.lineTo(t,i)}e.closePath(),c=-1};for(let e=0;e<i.columnCount;e++){if(i.hasData[e]===0){l(e-1);continue}c<0&&(c=e)}l(i.columnCount-1),e.save(),e.globalAlpha=.1,e.fillStyle=n,e.fill(),e.restore(),Ke(e,{color:n,columns:i,columnToX:a,valueK:o,valueB:s})},Je=(e,t,n,r,i)=>{let a=!1;for(let[o,s]of i)a?e.lineTo(t+o*r,n+s*r):(e.moveTo(t+o*r,n+s*r),a=!0);e.closePath()},Ye=[[-1/3,-1],[1/3,-1],[1/3,-1/3],[1,-1/3],[1,1/3],[1/3,1/3],[1/3,1],[-1/3,1],[-1/3,1/3],[-1,1/3],[-1,-1/3],[-1/3,-1/3]],Xe=Ye.map(([e,t])=>[(e-t)/Math.SQRT2,(e+t)/Math.SQRT2]),Ze=Array.from({length:10},(e,t)=>{let n=-Math.PI/2+t*Math.PI/5,r=t%2==0?1:.382;return[Math.cos(n)*r,Math.sin(n)*r]}),Qe={circle:(e,t,n,r)=>{e.arc(t,n,r,0,Math.PI*2)},square:(e,t,n,r)=>{let i=r*.886;e.moveTo(t-i,n-i),e.lineTo(t+i,n-i),e.lineTo(t+i,n+i),e.lineTo(t-i,n+i),e.closePath()},triangle:(e,t,n,r)=>{let i=r*1.55;e.moveTo(t,n-i),e.lineTo(t+i*.866,n+i*.5),e.lineTo(t-i*.866,n+i*.5),e.closePath()},diamond:(e,t,n,r)=>{let i=r*1.253;e.moveTo(t,n-i),e.lineTo(t+i,n),e.lineTo(t,n+i),e.lineTo(t-i,n),e.closePath()},"triangle-down":(e,t,n,r)=>{let i=r*1.55;e.moveTo(t,n+i),e.lineTo(t+i*.866,n-i*.5),e.lineTo(t-i*.866,n-i*.5),e.closePath()},plus:(e,t,n,r)=>{Je(e,t,n,r*1.189,Ye)},cross:(e,t,n,r)=>{Je(e,t,n,r*1.189,Xe)},star:(e,t,n,r)=>{Je(e,t,n,r*1.673,Ze)}},$e=(e,t,n,r,i)=>{Qe[i](e,t,n,r)},et=(e,t)=>{let{color:n,surface:r,shape:i,indexes:a,xAt:o,yAt:s,definedAt:c}=t;e.fillStyle=n,e.strokeStyle=r,e.lineWidth=2;for(let t of a)c(t)&&(e.beginPath(),$e(e,o(t),s(t),4,i),e.fill(),e.stroke())},tt=5e3,nt=2e4,rt=(e,t)=>{let{color:n,surface:r,shape:i,totalPointCount:a,indexes:o,xAt:s,yAt:c,radiusAt:l}=t;if(e.fillStyle=n,a>nt){e.beginPath();for(let t of o)l(t)<=0||e.rect(s(t)-1,c(t)-1,2,2);e.fill();return}let u=a<=tt;e.strokeStyle=r,e.lineWidth=2;for(let t of o){let n=l(t);n<=0||(e.beginPath(),$e(e,s(t),c(t),n,i),e.fill(),u&&e.stroke())}},it=(e,t)=>{let{count:n,order:r,screenX:i,screenY:a,radius:o,colorAt:s,shapeAt:c,alphaAt:l,surface:u}=t;if(e.save(),n>nt){let t=``,n=-1;for(let c of r){let r=s(c);r!==t&&(e.fillStyle=r,t=r);let u=l(c);u!==n&&(e.globalAlpha=u,n=u);let d=Math.max(1,(o[c]??0)/2);e.fillRect((i[c]??0)-d/2,(a[c]??0)-d/2,d,d)}e.restore();return}let d=n<=tt;e.strokeStyle=u,e.lineWidth=2;let f=``,p=-1;for(let t of r){let n=s(t);n!==f&&(e.fillStyle=n,f=n);let r=l(t);r!==p&&(e.globalAlpha=r,p=r),e.beginPath(),$e(e,i[t]??0,a[t]??0,o[t]??0,c(t)),e.fill(),d&&e.stroke()}e.restore()},at=(e,t)=>{let{gridColor:n,axisColor:r,corners:i,edges:a,cubeAlpha:o,axes:s}=t;if(e.save(),o>.01){e.globalAlpha=o,e.strokeStyle=n,e.lineWidth=1,e.beginPath();for(let[t,n]of a){let r=i[t],a=i[n];r!=null&&a!=null&&(e.moveTo(r.x,r.y),e.lineTo(a.x,a.y))}e.stroke()}e.strokeStyle=r;for(let{alpha:t,from:n,to:r}of s)t<=.01||(e.globalAlpha=t,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,r.y),e.stroke());e.restore()},ot=(e,t)=>{let{textColor:n,fontFamily:r,plot:i,center:a,axes:o}=t;e.save(),e.fillStyle=n,e.font=`11px ${r}`,e.textAlign=`center`,e.textBaseline=`middle`;for(let{label:t,alpha:n,from:r,to:s}of o){if(n<=.01)continue;let o=Math.hypot(r.x-a.x,r.y-a.y),c=Math.hypot(s.x-a.x,s.y-a.y),l=c>=o?s:r,u=c>=o?r:s,d=Math.max(1,Math.hypot(l.x-u.x,l.y-u.y)),f=(l.x-u.x)/d*16,p=(l.y-u.y)/d*16,m=Math.min(i.left+i.width-8,Math.max(i.left+8,l.x+f)),h=Math.min(i.top+i.height-6,Math.max(i.top+6,l.y+p));e.globalAlpha=n,e.fillText(t,m,h)}e.restore()},st=(e,t)=>{let{plot:n,color:r,textColor:i,y:a,label:o,fontFamily:s}=t;e.strokeStyle=r,e.lineWidth=1,e.setLineDash([4,4]),e.beginPath(),e.moveTo(n.left,Z(a)),e.lineTo(n.left+n.width,Z(a)),e.stroke(),e.setLineDash([]),o!=null&&o.length>0&&(e.font=`11px ${s}`,e.fillStyle=i,e.textAlign=`right`,e.textBaseline=`bottom`,e.fillText(o,n.left+n.width-4,a-3))},ct=(e,t)=>{let{plot:n,color:r,textColor:i,x:a,label:o,fontFamily:s}=t;if(e.strokeStyle=r,e.lineWidth=1,e.setLineDash([4,4]),e.beginPath(),e.moveTo(Z(a),n.top),e.lineTo(Z(a),n.top+n.height),e.stroke(),e.setLineDash([]),o!=null&&o.length>0){e.font=`11px ${s}`,e.fillStyle=i;let t=e.measureText(o).width,r=a+4+t<=n.left+n.width;e.textAlign=r?`left`:`right`,e.textBaseline=`top`,e.fillText(o,r?a+4:a-4,n.top+3)}},lt=(e,t)=>{let{plot:n,color:r,fontFamily:i,xLabels:a,yLabels:o}=t;e.save(),e.font=`11px ${i}`,e.fillStyle=r,e.textAlign=`right`,e.textBaseline=`middle`;for(let t of o)e.globalAlpha=t.alpha,e.fillText(t.text,n.left-8,t.position);e.textAlign=`center`,e.textBaseline=`top`;for(let t of a)e.globalAlpha=t.alpha,e.fillText(t.text,t.position,n.top+n.height+8);e.restore()},ut=e=>{let t=e.length,n=e[0]?.length??0,r=[],i=[];for(let e=0;e<t;e++)r.push(new Float64Array(n)),i.push(new Float64Array(n));let a=0,o=0,s=new Float64Array(n),c=new Float64Array(n),l=new Int32Array(n).fill(-1),u=new Int32Array(n).fill(-1);for(let d=0;d<t;d++){let t=e[d],f=r[d],p=i[d];if(t!=null&&f!=null&&p!=null)for(let e=0;e<n;e++){let n=t[e]??NaN;if(Number.isNaN(n)){f[e]=NaN,p[e]=NaN;continue}if(n>=0){let t=s[e]??0,r=t+n;s[e]=r,f[e]=t,p[e]=r,r>o&&(o=r),n>0&&(l[e]=d)}else{let t=c[e]??0,r=t+n;c[e]=r,f[e]=r,p[e]=t,r<a&&(a=r),u[e]=d}}}return{lower:r,upper:i,min:a,max:o,positiveEnd:l,negativeEnd:u}},dt=e=>1-(1-e)**3;var ft=class{#e=new Float64Array;#t=new Float64Array;#n=new Float64Array;#r=0;#i=0;#a=!1;get active(){return this.#a}values(){return this.#n}retarget(e,t){let{duration:n,now:r}=t,i=e.length,a=this.#n.length!==i;if(a&&(this.#e=new Float64Array(i),this.#t=new Float64Array(i),this.#n=new Float64Array(i)),a||n<=0){for(let t=0;t<i;t++){let n=e[t]??NaN;this.#e[t]=n,this.#t[t]=n,this.#n[t]=n}this.#a=!1;return}let o=!1;for(let t=0;t<i;t++){let n=e[t]??NaN,r=this.#n[t]??NaN;if(r!==n&&!(Number.isNaN(r)&&Number.isNaN(n))){o=!0;break}}if(!o){for(let t=0;t<i;t++)this.#t[t]=e[t]??NaN;this.#a=!1;return}for(let t=0;t<i;t++)this.#e[t]=this.#n[t]??NaN,this.#t[t]=e[t]??NaN;this.#r=r,this.#i=n,this.#a=!0}snap(){this.#n.set(this.#t),this.#a=!1}tick(e){if(!this.#a)return!1;let t=Math.min(1,(e-this.#r)/this.#i),n=dt(t);for(let e=0;e<this.#n.length;e++){let t=this.#e[e]??NaN,r=this.#t[e]??NaN;if(Number.isNaN(t)||Number.isNaN(r)){this.#n[e]=r;continue}this.#n[e]=t+(r-t)*n}return t>=1&&(this.#a=!1),this.#a}},pt=class{#e=new Float64Array;#t=new Float64Array;#n=0;#r=!1;#i;#a;#o=0;constructor(e={}){this.#i=e.speed??.14,this.#a=e.epsilon??.001}get active(){return this.#r}values(){return this.#t}jump(e){this.#t.length!==e.length&&(this.#e=new Float64Array(e.length),this.#t=new Float64Array(e.length));for(let t=0;t<e.length;t++){let n=e[t]??NaN;this.#e[t]=n,this.#t[t]=n}this.#r=!1}aim(e,t){if(this.#t.length!==e.length){this.jump(e);return}let n=!1;for(let t=0;t<e.length;t++){let r=e[t]??NaN,i=this.#e[t]??NaN;if(i!==r&&!(Number.isNaN(i)&&Number.isNaN(r))){n=!0;break}}if(!n)return;let r=0;for(let t=0;t<e.length;t++){let n=e[t]??NaN;this.#e[t]=n;let i=Math.abs(n-(this.#t[t]??NaN));Number.isFinite(i)&&i>r&&(r=i)}this.#o=r,this.#r||(this.#r=!0,this.#n=t)}tick(e){if(!this.#r)return!1;let t=Math.min(50,Math.max(0,e-this.#n));this.#n=e;let n=1-(1-this.#i)**(t/16.67),r=Math.max(this.#o*this.#a,2**-52),i=!0;for(let e=0;e<this.#t.length;e++){let t=this.#e[e]??NaN,a=this.#t[e]??NaN;if(Number.isNaN(t)||Number.isNaN(a)){this.#t[e]=t;continue}let o=a+(t-a)*n;n>0&&o===a||Math.abs(t-o)<=r?this.#t[e]=t:(this.#t[e]=o,i=!1)}return this.#r=!i,this.#r}};const mt=e=>`${e.colorInput}|${e.texture}`,ht={bar:`BarChart.Bar`,line:`LineChart.Line`,area:`AreaChart.Area`,scatter:`ScatterPlot.Point`},gt=1e3;var _t=class{#e;#t;#n;#r={xKey:``,xScale:`linear`,yDomain:[`auto`,`auto`],orientation:`vertical`,zKey:null,dimensions:3,stacked:!1,animate:!0};#i={onDatumActivate:null,onActiveIndexChange:null};#a;#o=null;#s=null;#c=null;#l=null;#u=0;#d=0;#f=1;#p=[];#m=0;#h=new Float64Array;#g=[];#_=null;#v=null;#y=!1;#b=!1;#x=new Map;#S=0;#C=0;#w=!0;#T=!0;#E=null;#D=new pt({speed:.16});#O=new pt({speed:.2});#k=new Map;#A=new Map;#j=!1;#M=new Map;#N=new Map;#P=0;#F=!1;#I=new Map;#L={alpha:0,target:0};#R=0;#z=null;#B=null;#V=null;#H={left:0,top:0,width:0,height:0};#U=null;#W=new Float64Array;#G=[0,1];#K={yaw:.65,pitch:-.35};#q=new pt({speed:.12});#J=new pt({speed:.16});#Y=null;#X=!1;#Z=null;#Q=new Int32Array;#$=new Map;#ee=``;#te=null;#ne=null;#re=null;#ie=void 0;#ae=null;#oe=!1;#se=null;#ce=null;#le={width:0,height:0};#ue=!1;#de=!1;#fe=0;#pe=!1;constructor(e){this.#e=e.kind,this.#t=e.elements,this.#n=e.store,this.#a=e.elements.canvas.getContext(`2d`),this.#n.onSeriesChange=()=>{this.#b=!0,this.#Te()},this.#n.onPresentationChange=()=>{this.#Te()},typeof ResizeObserver<`u`&&(this.#o=new ResizeObserver(e=>{let t=e[0];t!=null&&(this.#u=t.contentRect.width,this.#d=t.contentRect.height,this.#f=this.#ke(),this.#I.clear(),this.#te=null,this.#Te())}),this.#o.observe(e.elements.plot),this.#c=new ResizeObserver(()=>{this.#le={width:this.#t.tooltip.offsetWidth,height:this.#t.tooltip.offsetHeight},this.#Ee()}),this.#c.observe(e.elements.tooltip));let t=e.elements.root.ownerDocument.documentElement;this.#s=P(t,()=>{this.#V=null,this.#Te()}),this.#me(),this.#J.jump([1,1])}destroy(){this.#pe=!0,this.#o?.disconnect(),this.#c?.disconnect(),this.#s?.(),this.#l?.(),this.#n.onSeriesChange=null,this.#n.onPresentationChange=null,this.#z!=null&&(clearTimeout(this.#z),this.#z=null),this.#fe!==0&&cancelAnimationFrame(this.#fe)}#me(){if(typeof matchMedia>`u`||this.#pe)return;this.#l?.();let e=matchMedia(`(resolution: ${this.#ke()}dppx)`),t=()=>{this.#f=this.#ke(),this.#I.clear(),this.#Te(),this.#me()};e.addEventListener(`change`,t,{once:!0}),this.#l=()=>e.removeEventListener(`change`,t)}setOptions(e){let t=this.#r;if(this.#r=e,t.xScale!==e.xScale&&this.#M.clear(),t.animate&&!e.animate&&this.#he(),t.dimensions!==e.dimensions){let t=[+(e.dimensions>=2),+(e.dimensions>=3)],n=vt(e.dimensions);if(this.#ve()===0||!this.#j)this.#J.jump(t),this.#K=n,this.#q.jump([n.yaw,n.pitch]);else{let e=n.yaw+Math.round((this.#K.yaw-n.yaw)/(Math.PI*2))*Math.PI*2;this.#J.aim(t,performance.now()),this.#q.jump([this.#K.yaw,this.#K.pitch]),this.#q.aim([e,n.pitch],performance.now())}}(t.xKey!==e.xKey||t.xScale!==e.xScale||t.zKey!==e.zKey||t.stacked!==e.stacked||t.yDomain[0]!==e.yDomain[0]||t.yDomain[1]!==e.yDomain[1])&&(this.#b=!0),this.#Te()}setCallbacks(e){this.#i=e}setRows(e){e!==this.#p&&(this.#p=e,this.#b=!0,this.#Te())}flushIngest(){!this.#b||this.#pe||(this.#b=!1,this.#ge())}setControlledActiveIndex(e){let t=this.#ae;this.#ae=null;let n=this.#ie!==void 0;if(this.#ie=e,e!==void 0){let n=t!=null&&t.index===e&&t.viaKeyboard;this.#nt(e==null?null:this.#$e(e),{viaKeyboard:n,notify:!1})}else n&&this.#nt(null,{viaKeyboard:!1,notify:!1});this.#Ee()}handlePointerMove(e,t){if(this.#Y!=null){let n=e-this.#Y.lastX,r=t-this.#Y.lastY;(this.#Y.moved||Math.abs(n)+Math.abs(r)>3)&&(this.#Y.moved=!0,this.#K={yaw:this.#K.yaw+n*.008,pitch:ve(this.#K.pitch+r*.008)},this.#q.jump([this.#K.yaw,this.#K.pitch]),this.#Y.lastX=e,this.#Y.lastY=t,this.#nt(null,{viaKeyboard:!1,notify:!1}),this.#Te());return}if(this.#se=e,this.#ce=t,this.#e===`scatter`){let n=this.#lt(e,t);this.#ne=n?.seriesKey??null,this.#te=n==null?null:{x:n.screenX,y:n.screenY},this.#nt(n?.index??null,{viaKeyboard:!1,notify:!0});return}let n=this.#et(e,t);this.#nt(n,{viaKeyboard:!1,notify:!0})}handlePointerDown(e,t){if(this.#X=!0,this.#xe()){this.#Y={lastX:e,lastY:t,moved:!1};return}this.handlePointerMove(e,t)}handlePointerUp(e,t){let n=this.#Y;this.#Y=null;let r=this.#X;if(this.#X=!1,n!=null){if(n.moved)return;this.handlePointerMove(e,t)}r&&this.handleActivate(e,t)}handlePointerLeave(){this.#se=null,this.#ce=null,this.#Y=null,this.#X=!1,this.#ne=null,this.#te=null,this.#nt(null,{viaKeyboard:!1,notify:!0})}handleActivate(e,t){let n=this.#Ze();if(n==null)return;let r=this.#Qe(n),i=this.#p[r];if(i==null)return;let a=this.#e===`scatter`?this.#ne:e==null||t==null?null:this.#tt(n,e,t);this.#i.onDatumActivate?.({index:r,xValue:this.#g[n]??``,datum:i,dataKey:a})}handleKeyDown(e){if(this.#m===0)return!1;let t=this.#m-1,n=this.#Ze(),r=this.#F?Math.max(1,Math.floor(this.#m/Math.max(1,this.#H.width*this.#f))):1,i=Math.max(1,Math.floor(this.#m/10)),a=(()=>{switch(e){case`ArrowLeft`:return Math.max(0,(n??this.#m)-r);case`ArrowRight`:return Math.min(t,(n??-1)+r);case`PageUp`:return Math.min(t,(n??0)+i);case`PageDown`:return Math.max(0,(n??t)-i);case`Home`:return 0;case`End`:return t;case`Escape`:return null;default:return}})();return a===void 0?e===`Enter`||e===` `?(this.handleActivate(null,null),!0):!1:(this.#se=null,this.#ce=null,this.#ne=null,this.#te=null,this.#nt(a,{viaKeyboard:!0,notify:!0}),!0)}invalidateColors(){this.#V=null,this.#Te()}#he(){this.#D.jump(this.#ye()),this.#O.jump(this.#be()),this.#J.jump([+(this.#r.dimensions>=2),+(this.#r.dimensions>=3)]);let e=vt(this.#r.dimensions);this.#K=e,this.#q.jump([e.yaw,e.pitch]);for(let e of this.#k.values())e.snap();for(let e of this.#A.values())e.snap();this.#L.alpha=this.#L.target,this.#Te()}#ge(){let e=this.#p,{xKey:t,xScale:n}=this.#r,r=this.#n.seriesSpecs();this.#I.clear();let i=this.#h;if(n===`band`||n===`point`){let n=e.length,r=new Float64Array(n),i=Array.from({length:n},()=>``),a=!1;for(let o=0;o<n;o++){let n=e[o],s=n==null?void 0:E(n,t);s!==void 0&&(a=!0),i[o]=typeof s==`string`||typeof s==`number`||s instanceof Date?s:String(s),r[o]=o}m(n===0||a,`${this.#Ce()} xKey "${t}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#_=null,this.#v=null,this.#m=n,this.#h=r,this.#g=i,this.#T=!0}else{let r=[],i=!1,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e[s],l=c==null?void 0:E(c,t);l!==void 0&&(i=!0),l!=null&&(a=!0);let u=Ct(l,n===`time`);Number.isFinite(u)&&(r.push({source:s,x:u}),o=!0)}m(e.length===0||i,`${this.#Ce()} xKey "${t}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),m(!a||o,`${this.#Ce()} could not read any "${t}" values as ${n===`time`?`dates`:`numbers`} for the "${n}" x scale — check the xScale and the data types.`);let s=!0;for(let e=1;e<r.length;e++)if((r[e]?.x??0)<(r[e-1]?.x??0)){s=!1;break}let c=s?r:r.toSorted((e,t)=>e.x-t.x),l=c.length,u=new Float64Array(l),d=Array.from({length:l},()=>``),f=l===e.length,p=!0,h=new Int32Array(l);for(let e=0;e<l;e++){let t=c[e];t!=null&&(u[e]=t.x,Number.isInteger(t.x)||(p=!1),n===`time`?d[e]=new Date(t.x):d[e]=t.x,h[e]=t.source,t.source!==e&&(f=!1))}if(f)this.#_=null,this.#v=null;else{this.#_=h;let t=new Int32Array(e.length).fill(-1);for(let e=0;e<l;e++){let n=h[e];n!=null&&(t[n]=e)}this.#v=t}this.#m=l,this.#h=u,this.#g=d,this.#T=p}let a=!1;for(let e of this.#g)if(e instanceof Date&&pe(e)){a=!0;break}this.#y=a;let o=this.#h[0],s=this.#h[this.#m-1],c=i[0],l=i[i.length-1];!this.#xe()&&(n===`linear`||n===`time`)&&o!=null&&s!=null&&c!=null&&l!=null&&o>c&&s>=l?(this.#L.target=1,this.#R=performance.now()):(o!==c||s!==l)&&(this.#L.target=0);let u=this.#m,d=i.length===u&&u<=2500;if(d){for(let e=0;e<u;e++)if(i[e]!==this.#h[e]){d=!1;break}}let f=this.#x;this.#x=new Map;let p=1/0,h=-1/0,g=!0;for(let t of r){let n=new Float64Array(u),r=!1;for(let i=0;i<u;i++){let a=e[this.#_==null?i:this.#_[i]??i],o=a==null?void 0:E(a,t.dataKey);if(o===void 0){n[i]=NaN;continue}r=!0;let s=typeof o==`number`&&Number.isFinite(o)?o:NaN;n[i]=s,Number.isNaN(s)||(s<p&&(p=s),s>h&&(h=s),Number.isInteger(s)||(g=!1))}m(u===0||r,`${ht[t.mark]} dataKey "${t.dataKey}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#x.set(t.dataKey,n)}this.#S=p===1/0?0:p,this.#C=h===-1/0?0:h,this.#w=g;let _=this.#r.zKey;if(this.#e===`scatter`&&_!=null){let t=new Float64Array(u),n=1/0,r=-1/0,i=!1;for(let a=0;a<u;a++){let o=e[this.#_==null?a:this.#_[a]??a],s=o==null?void 0:E(o,_);s!==void 0&&(i=!0);let c=typeof s==`number`&&Number.isFinite(s)?s:NaN;t[a]=c,Number.isNaN(c)||(c<n&&(n=c),c>r&&(r=c))}m(u===0||i,`ScatterPlot.Root zKey "${_}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#W=t,this.#G=n===1/0?[0,1]:X([n,r],5)}else this.#W=new Float64Array;this.#Z=null,this.#te=null,this.#E=this.#r.stacked?ut(r.map(e=>this.#x.get(e.dataKey)??new Float64Array)):null,this.#F=H({pointCount:u,columnCount:Math.max(1,Math.round(this.#H.width*this.#f)),wasDecimated:this.#F});let v=this.#V;if(v!=null){for(let e of this.#n.seriesMeta())if(v.inputs.get(e.dataKey)!==mt(e)){this.#V=null;break}}this.#_e(r,f,d);let y=this.#Ze();y!=null&&this.#nt(Math.min(y,Math.max(0,u-1)),{viaKeyboard:this.#oe,notify:!1}),this.#ot({force:!0})}#_e(e,t,n){let r=performance.now(),i=this.#ve(),a=!this.#j;this.#j=this.#j||this.#m>0,a||i===0?(this.#D.jump(this.#ye()),this.#O.jump(this.#be())):(this.#D.aim(this.#ye(),r),this.#O.aim(this.#be(),r));let o=this.#m>0&&this.#m<=2500&&n,s=new Set,c=(e,t,n)=>{s.add(e);let a=this.#k.get(e);a??(a=new ft,this.#k.set(e,a));let c=o&&n&&a.values().length===t.length;a.retarget(t,{duration:c?i:0,now:r})};e.forEach((e,n)=>{let i=t.has(e.dataKey);if(this.#E==null?c(e.dataKey,this.#x.get(e.dataKey)??new Float64Array,i):(c(`${e.dataKey}:lower`,this.#E.lower[n]??new Float64Array,i),c(`${e.dataKey}:upper`,this.#E.upper[n]??new Float64Array,i)),!this.#A.has(e.dataKey)&&this.#m>0){let t=new ft;t.retarget([0],{duration:0,now:r}),t.retarget([1],{duration:this.#ve(),now:r}),this.#A.set(e.dataKey,t)}});for(let e of this.#k.keys())s.has(e)||this.#k.delete(e)}#ve(){return!this.#r.animate||typeof matchMedia<`u`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:280}#ye(){let[e,t]=this.#r.yDomain,n,r;if(this.#E==null?this.#e===`line`||this.#e===`scatter`?(n=this.#S,r=this.#C):(n=Math.min(0,this.#S),r=Math.max(0,this.#C)):(n=Math.min(0,this.#E.min),r=Math.max(0,this.#E.max)),typeof e==`number`&&(n=e),typeof t==`number`&&(r=t),this.#m===0)return[0,1];let i=this.#e===`bar`||this.#e===`area`?Le([n,r],5):X([n,r],5);return[typeof e==`number`?e:i[0],typeof t==`number`?t:i[1]]}#be(){if(this.#m===0)return[0,1];let e=this.#h[0]??0,t=this.#h[this.#m-1]??0;return e===t?[e-.5,t+.5]:this.#e===`scatter`?X([e,t],5):[e,t]}#xe(){return this.#e===`scatter`&&this.#r.zKey!=null}#Se(){return this.#e===`bar`&&this.#r.orientation===`horizontal`}#Ce(){return`${ht[this.#e].split(`.`)[0]??`Chart`}.Root`}#we(e,t){let n=this.#B;n??(n=this.#t.canvas.ownerDocument.createElement(`canvas`),this.#B=n),(n.width!==e||n.height!==t)&&(n.width=e,n.height=t);let r=n.getContext(`2d`);return r==null?null:{canvas:n,ctx:r}}#Te(){this.#de=!0,this.#De()}#Ee(){this.#De()}#De(){this.#ue||this.#pe||(this.#ue=!0,this.#fe=requestAnimationFrame(()=>{this.#ue=!1,this.#fe=0,this.#Oe()}))}#Oe(){if(!this.#pe){if(this.flushIngest(),this.#de){this.#de=!1;let e=performance.now(),t=!1;t=this.#D.tick(e)||t,t=this.#O.tick(e)||t;for(let n of this.#k.values())t=n.tick(e)||t;for(let n of this.#A.values())t=n.tick(e)||t;if(t=this.#J.tick(e)||t,this.#q.tick(e)){t=!0;let e=this.#q.values();this.#K={yaw:e[0]??this.#K.yaw,pitch:e[1]??this.#K.pitch}}this.#Ae(),this.#Me(),t=this.#ze(e)||t,t&&this.#Te()}this.#dt()}}#ke(){return typeof devicePixelRatio==`number`&&devicePixelRatio>0?Math.min(devicePixelRatio,3):1}#Ae(){let e=this.#t.root,t=`${N(e.ownerDocument.documentElement)}|${this.#f}|${this.#r.orientation}`;if(this.#V?.signature===t)return;let n=e.ownerDocument.defaultView;if(n==null)return;let r=this.#a,i=new Map,a=new Map,o=new Map;for(let t of this.#n.seriesMeta()){let n=ie(e,t.colorInput);if(i.set(t.dataKey,n),a.set(t.dataKey,mt(t)),r!=null&&t.mark===`bar`&&t.texture!==`solid`){let i=se(r,{texture:t.texture,color:n,ink:M(e,R(n)),devicePixelRatio:this.#f,orientation:this.#r.orientation});i!=null&&o.set(t.dataKey,i)}}this.#V={signature:t,series:i,inputs:a,barTextures:o,chrome:ae(e),fontFamily:n.getComputedStyle(e).fontFamily||`sans-serif`}}#je(e){let t=this.#V?.signature??``;t!==this.#ee&&(this.#$.clear(),this.#ee=t);let n=this.#$.get(e);if(n!=null)return n;let r=ie(this.#t.root,e);return this.#$.set(e,r),r}#Me(){let e=this.#n.getSnapshot(),t=this.#xe(),n=this.#Se(),r=!t&&e.xAxis!=null,i=!t&&e.yAxis!=null,a=n?r:i,o=(n?i:r)?24:8,s=Math.max(0,this.#d-8-o);this.#H={left:8,top:8,width:Math.max(0,this.#u-16),height:s};let c=8;if(a){c=40;let e=this.#a;if(e!=null&&this.#V!=null){e.font=`11px ${this.#V.fontFamily}`;let t=0,r=n?this.#Re().map(e=>e.text):this.#Le().map(e=>e.text);for(let n of r){let r=e.measureText(n).width;r>t&&(t=r)}c=Math.ceil(t)+14}}this.#H={left:c,top:8,width:Math.max(0,this.#u-c-8),height:s};let l=n?this.#H.top:this.#H.left,u=n?this.#H.top+this.#H.height:this.#H.left+this.#H.width;this.#U=this.#r.xScale===`band`?Oe({count:this.#m,rangeStart:l,rangeEnd:u,paddingInner:.2,paddingOuter:.1}):this.#r.xScale===`point`?Oe({count:this.#m,rangeStart:l,rangeEnd:u,paddingInner:1,paddingOuter:.5}):null,this.#F=H({pointCount:this.#m,columnCount:Math.max(1,Math.round(this.#H.width*this.#f)),wasDecimated:this.#F})}#Ne(){let e=this.#D.values();return De([e[0]??0,e[1]??1],[this.#H.top+this.#H.height,this.#H.top])}#Pe(){let e=this.#D.values(),t=this.#Se()?[this.#H.left,this.#H.left+this.#H.width]:[this.#H.top+this.#H.height,this.#H.top];return De([e[0]??0,e[1]??1],t)}#Fe(){let e=this.#O.values();return De([e[0]??0,e[1]??1],[this.#H.left,this.#H.left+this.#H.width])}#Ie(e){let t=this.#U;if(t!=null)return Y(t,e);let{k:n,b:r}=this.#Fe();return(this.#h[e]??0)*n+r}#Le(){let e=this.#n.getSnapshot(),t=this.#D.values(),n=je([t[0]??0,t[1]??1],e.yAxis?.tickCount??5,{integer:this.#w}),r=e.yAxis?.tickFormat,i=n.length>1?ue(Math.abs((n[1]??0)-(n[0]??0))):void 0;return n.map(e=>({value:e,text:r==null?G(e,i==null?void 0:{maximumFractionDigits:i}):r(e)}))}#Re(){let e=this.#n.getSnapshot(),t=e.xAxis?.tickFormat;if(this.#U!=null){let e=this.#Se(),n=e?this.#H.height:this.#H.width,r=Math.max(1,Math.floor(n/(e?15:60))),i=Math.max(1,Math.ceil(this.#m/r)),a=[];for(let e=0;e<this.#m;e+=i){let n=this.#g[e]??``;a.push({index:e,value:e,text:t==null?K(n,{datasetHasTimeOfDay:this.#y}):t(n)})}return a}let n=this.#O.values(),r=[n[0]??0,n[1]??1],i=e.xAxis?.tickCount??Math.max(2,Math.floor(this.#H.width/90));if(this.#r.xScale===`time`){let e=Ie(r);return Fe(r,i).map(n=>({index:null,value:n,text:t==null?e(n):t(new Date(n))}))}let a=je(r,i,{integer:this.#T}),o=a.length>1?ue(Math.abs((a[1]??0)-(a[0]??0))):void 0;return a.map(e=>({index:null,value:e,text:t==null?G(e,o==null?void 0:{maximumFractionDigits:o}):t(e)}))}#ze(e){let t=this.#a,n=this.#V;if(t==null||n==null||this.#u<=0||this.#d<=0)return!1;let r=Math.min(50,Math.max(0,e-this.#P));this.#P=e;let i=this.#t.canvas,a=Math.round(this.#u*this.#f),o=Math.round(this.#d*this.#f);(i.width!==a||i.height!==o)&&(i.width=a,i.height=o),t.setTransform(this.#f,0,0,this.#f,0,0),t.clearRect(0,0,this.#u,this.#d);let s=this.#n.getSnapshot(),c=this.#H;if(c.width<=0||c.height<=0)return!1;let l=this.#Ne(),u=this.#Fe(),d=this.#n.seriesSpecs(),f=this.#xe(),p=this.#ve()===0,m=f?[]:this.#Be(t,n.fontFamily),h=f?[]:this.#Ve(t,n.fontFamily),g=yt(this.#M,m,r,p);g=yt(this.#N,h,r,p)||g;let _=this.#L;if(_.target===1){if(e-this.#R>gt)_.target=0;else if(this.#z==null){let t=gt-(e-this.#R)+17;this.#z=setTimeout(()=>{this.#z=null,this.#Te()},t)}}if(p)_.alpha=_.target;else{let e=1-(1-(_.target>_.alpha?.16:.08))**(r/16.67);_.alpha+=(_.target-_.alpha)*e,Math.abs(_.target-_.alpha)<.02&&(_.alpha=_.target)}_.alpha!==_.target&&(g=!0);let v=this.#Se(),y=v?this.#Pe():l,b=e=>this.#U==null?e*u.k+u.b:Y(this.#U,e),x=e=>e*y.k+y.b,S=[...this.#M.entries()].map(([e,t])=>({position:b(e),alpha:t.alpha})),C=[...this.#N.entries()].map(([e,t])=>({position:x(e),alpha:t.alpha}));if(s.grid!=null&&!f){let e=s.grid.lines??(v?`vertical`:`horizontal`),r=v?S:C,i=v?C:S;ze(t,{plot:c,color:n.chrome.grid,xLines:e===`horizontal`?[]:i,yLines:e===`vertical`?[]:r})}let w=Math.min(40,c.width*.25),T=t,E=null;_.alpha>.01&&w>1&&(E=this.#we(a,o),E!=null&&(E.ctx.setTransform(this.#f,0,0,this.#f,0,0),E.ctx.clearRect(0,0,this.#u,this.#d),T=E.ctx)),T.save(),T.beginPath(),T.rect(c.left,c.top,c.width,c.height+1),T.clip();let D=null;if(this.#e===`bar`?v?this.#qe(T,d):this.#Ke(T,d,l):this.#e===`scatter`?D=this.#st(T,d,l):this.#Je(T,d,l),T.restore(),E!=null){T.save(),T.globalCompositeOperation=`destination-out`;let e=T.createLinearGradient(c.left,0,c.left+w,0);e.addColorStop(0,`rgba(0, 0, 0, ${_.alpha})`),e.addColorStop(1,`rgba(0, 0, 0, 0)`),T.fillStyle=e,T.fillRect(c.left,c.top,w,c.height+1),T.restore(),t.drawImage(E.canvas,0,0,this.#u,this.#d)}D!=null&&ot(t,{textColor:n.chrome.tickText,fontFamily:n.fontFamily,plot:c,center:D.center,axes:D.axes}),this.#e===`bar`&&this.#m>0&&(v?Ve(t,{plot:c,color:n.chrome.baseline,x:x(0)}):Be(t,{plot:c,color:n.chrome.baseline,y:x(0)}));for(let e of f?[]:s.referenceLines){let r=x(e.y);if(v?r<c.left||r>c.left+c.width:r<c.top||r>c.top+c.height)continue;let i=e.color==null?n.chrome.reference:this.#je(e.color);v?ct(t,{plot:c,color:i,textColor:n.chrome.tickText,x:r,label:e.label,fontFamily:n.fontFamily}):st(t,{plot:c,color:i,textColor:n.chrome.tickText,y:r,label:e.label,fontFamily:n.fontFamily})}let O=s.xAxis==null||f?[]:[...this.#M.entries()].map(([e,t])=>({position:b(e),text:t.text,alpha:t.alpha})),k=s.yAxis==null||f?[]:[...this.#N.entries()].map(([e,t])=>({position:x(e),text:t.text,alpha:t.alpha})),A=v?k:O,j=v?O:k;return(A.length>0||j.length>0)&&lt(t,{plot:c,color:n.chrome.tickText,fontFamily:n.fontFamily,xLabels:A,yLabels:j}),g}#Be(e,t){e.font=`11px ${t}`;let n=this.#Se(),r=this.#Fe(),i=[],a=-1/0;for(let t of this.#Re()){let o=t.index!=null&&this.#U!=null,s=o&&this.#U!=null?Y(this.#U,t.index??0):t.value*r.k+r.b,c=n?15/2:e.measureText(t.text).width/2,l=n?2:8;s-c<a+l||(a=s+c,i.push({key:o?t.index??0:t.value,text:t.text}))}return i}#Ve(e,t){let n=this.#Le();if(!this.#Se())return n.map(e=>({key:e.value,text:e.text}));e.font=`11px ${t}`;let r=this.#Pe(),i=[],a=-1/0;for(let t of n){let n=t.value*r.k+r.b,o=e.measureText(t.text).width/2;n-o<a+8||(a=n+o,i.push({key:t.value,text:t.text}))}return i}#He(e,t){let n=t===`value`?e.dataKey:`${e.dataKey}:${t}`;if(!this.#F&&this.#m<=2500){let e=this.#k.get(n);if(e!=null&&e.values().length===this.#m)return e.values()}if(t===`value`)return this.#x.get(e.dataKey)??new Float64Array;let r=this.#n.seriesSpecs().findIndex(t=>t.dataKey===e.dataKey);return(t===`lower`?this.#E?.lower:this.#E?.upper)?.[r]??new Float64Array}#Ue(e){return this.#A.get(e)?.values()[0]??1}#We(e,t){if(e==null)return 0;let n=e[t]??0;return Number.isNaN(n)?0:n}#Ge(e,t,n){let r=this.#E;if(r==null)return!0;let i=r.lower[e]?.[t]??NaN,a=r.upper[e]?.[t]??NaN;if(Number.isNaN(i)||Number.isNaN(a))return!1;let o=i<0,s=(o?r.negativeEnd:r.positiveEnd)[t]??-1;if(s<0)return!1;let c=(o?r.lower:r.upper)[s]?.[t]??NaN;return A({lower:i,upper:a,pileOuter:c,toPixel:n})}#Ke(e,t,n){let r=this.#U,i=this.#V;if(r==null||i==null||this.#m===0||t.length===0)return;let a=this.#E!=null,o=a?1:t.length,s=r.bandwidth>=8*o?2:+(r.bandwidth>=3*o),c=(r.bandwidth-s*(o-1))/o,l=Math.min(24,c),u=e=>e*n.k+n.b;t.forEach((t,n)=>{let d=this.#Ue(t.dataKey),f=[],p=a?this.#He(t,`lower`):null,m=a?this.#He(t,`upper`):this.#He(t,`value`);for(let e=0;e<this.#m;e++){let t=m[e]??NaN;if(Number.isNaN(t))continue;let i=this.#We(p,e),h=a?J(r,e)+(r.bandwidth-l)/2:J(r,e)+(r.bandwidth-(c*o+s*(o-1)))/2+n*(c+s)+(c-l)/2,g=k({lower:i,upper:t,toPixel:u,reveal:d,gap:a?s:0});f.push({x:h,width:l,baselineY:g.baseline,valueY:g.value,rounded:this.#Ge(n,e,u)})}He(e,{fill:i.barTextures.get(t.dataKey)??i.series.get(t.dataKey)??`currentColor`,rects:f})})}#qe(e,t){let n=this.#U,r=this.#V;if(n==null||r==null||this.#m===0||t.length===0)return;let i=this.#Pe(),a=this.#E!=null,o=a?1:t.length,s=n.bandwidth>=8*o?2:+(n.bandwidth>=3*o),c=(n.bandwidth-s*(o-1))/o,l=Math.min(24,c),u=e=>e*i.k+i.b;t.forEach((t,i)=>{let d=this.#Ue(t.dataKey),f=[],p=a?this.#He(t,`lower`):null,m=a?this.#He(t,`upper`):this.#He(t,`value`);for(let e=0;e<this.#m;e++){let t=m[e]??NaN;if(Number.isNaN(t))continue;let r=this.#We(p,e),h=a?J(n,e)+(n.bandwidth-l)/2:J(n,e)+(n.bandwidth-(c*o+s*(o-1)))/2+i*(c+s)+(c-l)/2,g=k({lower:r,upper:t,toPixel:u,reveal:d,gap:a?s:0});f.push({y:h,height:l,baselineX:g.baseline,valueX:g.value,rounded:this.#Ge(i,e,u)})}Ue(e,{fill:r.barTextures.get(t.dataKey)??r.series.get(t.dataKey)??`currentColor`,rects:f})})}#Je(e,t,n){let r=this.#V;if(r==null||this.#m===0)return;let i=this.#Fe(),a=this.#U,o=e=>a==null?(this.#h[e]??0)*i.k+i.b:Y(a,e);t.forEach(t=>{let i=r.series.get(t.dataKey)??`currentColor`,a=this.#Ue(t.dataKey);if(e.save(),a<1&&(e.beginPath(),e.rect(this.#H.left,0,this.#H.width*a,this.#d),e.clip()),this.#F){this.#Ye(e,t,i,n),e.restore();return}let s=t.mark===`area`,c=this.#He(t,this.#E==null?`value`:`upper`),l=this.#E==null?null:this.#He(t,`lower`),u=e=>!Number.isNaN(c[e]??NaN),d=[];for(let e=0;e<this.#m;e++)(!t.connectNulls||u(e))&&d.push(e);let f=e=>(c[e]??0)*n.k+n.b;if(s){let r=l==null?()=>0*n.k+n.b:e=>(l[e]??0)*n.k+n.b;Ge(e,{color:i,curve:t.curve,indexes:d,xAt:o,y0At:r,y1At:f,definedAt:u})}else We(e,{color:i,curve:t.curve,indexes:d,xAt:o,yAt:f,definedAt:u}),t.markers&&this.#H.width/this.#m>=12&&et(e,{color:i,surface:r.chrome.surface,shape:this.#n.seriesShape(t.dataKey),indexes:d,xAt:o,yAt:f,definedAt:u});e.restore()})}#Ye(e,t,n,r){let i=Math.max(1,Math.round(this.#H.width*this.#f)),a=e=>this.#H.left+(e+.5)/this.#f;if(t.mark===`area`){let o=this.#Xe(`${t.dataKey}:upper`,this.#He(t,this.#E==null?`value`:`upper`),i),s=this.#E==null?null:this.#Xe(`${t.dataKey}:lower`,this.#He(t,`lower`),i);s==null?qe(e,{color:n,lowerColumns:wt(o,0),upperColumns:o,columnToX:a,valueK:r.k,valueB:r.b}):qe(e,{color:n,lowerColumns:s,upperColumns:o,columnToX:a,valueK:r.k,valueB:r.b});return}let o=this.#Xe(t.dataKey,this.#He(t,`value`),i);Ke(e,{color:n,columns:o,columnToX:a,valueK:r.k,valueB:r.b})}#Xe(e,t,n){let r=this.#O.values(),i=`${r[0]??0}:${r[1]??1}:${n}`,a=this.#I.get(e);if(a!=null&&a.key===i)return a.columns;let o=[r[0]??0,r[1]??1],s=De(o,[0,n]),c=U({xs:this.#h,values:t,startIndex:0,endIndex:this.#m-1,positionK:s.k,positionB:s.b,columnCount:n});return this.#I.set(e,{key:i,columns:c}),c}#Ze(){if(this.#m===0)return null;let e;return e=this.#ie===void 0?this.#re:this.#ie==null?null:this.#$e(this.#ie),e==null?null:Math.min(Math.max(0,e),this.#m-1)}#Qe(e){return this.#_==null?e:this.#_[e]??e}#$e(e){if(this.#p.length===0)return null;let t=Math.min(Math.max(0,e),this.#p.length-1);if(this.#v==null)return t;let n=this.#v[t]??-1;return n===-1?null:n}#et(e,t){if(this.#m===0)return null;let n=this.#U;if(n!=null)return Ae(n,this.#Se()?t:e);let{k:r,b:i}=this.#Fe();if(r===0)return 0;let a=e;if(this.#F){let t=Math.floor((e-this.#H.left)*this.#f);a=this.#H.left+(t+.5)/this.#f}return me(this.#h,this.#m,(a-i)/r)}#tt(e,t,n){let r=this.#n.seriesSpecs(),i=this.#Se(),a=this.#U;if(this.#e===`bar`&&this.#E==null&&a!=null&&r.length>1){let o=(i?n:t)-J(a,e),s=Math.floor(o/Math.max(1,a.bandwidth)*r.length);return r[Math.min(r.length-1,Math.max(0,s))]?.dataKey??null}let{k:o,b:s}=i?this.#Pe():this.#Ne(),c=i?t:n,l=this.#E;if(this.#e===`bar`&&l!=null)for(let t=0;t<r.length;t++){let n=l.lower[t]?.[e]??NaN,i=l.upper[t]?.[e]??NaN;if(Number.isNaN(n)||Number.isNaN(i)||n===i)continue;let a=n*o+s,u=i*o+s;if(c>=Math.min(a,u)&&c<=Math.max(a,u))return r[t]?.dataKey??null}let u=null,d=1/0;return r.forEach((t,n)=>{let r=(this.#E==null?this.#x.get(t.dataKey):this.#E.upper[n])?.[e]??NaN;if(Number.isNaN(r))return;let i=Math.abs(r*o+s-c);i<d&&(d=i,u=t.dataKey)}),u}#nt(e,t){let n=e==null||this.#m===0?null:Math.min(Math.max(0,e),this.#m-1),r=this.#ie!==void 0;if(t.notify&&n!==this.#Ze()){let e=n==null?null:this.#Qe(n);if(this.#i.onActiveIndexChange?.(e),r){this.#ae={index:e,viaKeyboard:t.viaKeyboard};return}}this.#oe=t.viaKeyboard,r||(this.#re=n),this.#ot(),this.#Ee()}#rt=null;#it=!1;#at=null;#ot(e={force:!1}){let t=this.#Ze();if(!e.force&&t===this.#rt&&this.#oe===this.#it&&this.#ne===this.#at)return;if(this.#rt=t,this.#it=this.#oe,this.#at=this.#ne,t==null||this.#m===0){this.#n.publishHover(null);return}let n=this.#Qe(t),r=this.#p[n]??{},i=this.#n.seriesMeta().map(e=>{let n=this.#x.get(e.dataKey)?.[t]??NaN;return{dataKey:e.dataKey,label:e.label,value:Number.isNaN(n)?null:n,color:e.color}});this.#r.stacked&&i.reverse(),this.#e===`scatter`&&(i=this.#ne==null?i.filter(e=>e.value!=null):i.filter(e=>e.dataKey===this.#ne));let a={index:n,xValue:this.#g[t]??``,datum:r,points:i,viaKeyboard:this.#oe};if(this.#xe()){let e=this.#W[t]??NaN;a.zValue=Number.isNaN(e)?null:e}this.#n.publishHover(a)}#st(e,t,n){let r=this.#V;if(r==null||this.#m===0||t.length===0)return null;if(this.#xe())return this.#ct(e,t);let i=this.#Fe(),a=t.map(e=>{let t=this.#He(e,`value`),n=[];for(let e=0;e<this.#m;e++)Number.isNaN(t[e]??NaN)||n.push(e);return n}),o=a.reduce((e,t)=>e+t.length,0);return t.forEach((t,s)=>{let c=this.#He(t,`value`),l=a[s]??[];e.save(),e.globalAlpha=this.#Ue(t.dataKey),rt(e,{color:r.series.get(t.dataKey)??`currentColor`,surface:r.chrome.surface,shape:this.#n.seriesShape(t.dataKey),totalPointCount:o,indexes:l,xAt:e=>(this.#h[e]??0)*i.k+i.b,yAt:e=>(c[e]??0)*n.k+n.b,radiusAt:()=>4}),e.restore()}),null}#ct(e,t){let n=this.#V;if(n==null)return null;let r=this.#H,i=ge(this.#K),a=r.left+r.width/2,o=r.top+r.height/2,s=this.#J.values(),c=s[0]??1,l=s[1]??1,u=.85-.22*c-.11*l,d=Math.min(r.width,r.height)/2*u,f=this.#O.values(),p=[f[0]??0,f[1]??1],m=this.#D.values(),h=[m[0]??0,m[1]??1],g=this.#G,_=t.map(e=>this.#Ue(e.dataKey)),v=this.#J.values(),y=v[0]??1,b=v[1]??1,x=(e,t,n)=>{let r=_e(e,t,n,i);return{x:a+r.x*d,y:o-r.y*d}},S=be.map(([e,t,n])=>x(e,t,n)),C=t[0],w=t.length===1&&C!=null?C.dataKey:`y`,T=[{label:this.#r.xKey,alpha:1,from:x(-1,-y,-b),to:x(1,-y,-b)},{label:w,alpha:y,from:x(-1,-1,-b),to:x(-1,1,-b)},{label:this.#r.zKey??`z`,alpha:b,from:x(-1,-y,-1),to:x(-1,-y,1)}];at(e,{gridColor:n.chrome.grid,axisColor:n.chrome.baseline,corners:S,edges:xe,cubeAlpha:b,axes:T});let E=this.#m*t.length,D=this.#Z;(D==null||D.screenX.length<E)&&(D={screenX:new Float64Array(E),screenY:new Float64Array(E),radius:new Float64Array(E),seriesIndex:new Int32Array(E),pointIndex:new Int32Array(E),depths:new Float64Array(E),count:0});let O=D.depths,k=0;t.forEach((e,t)=>{let n=this.#He(e,`value`);for(let e=0;e<this.#m;e++){let r=n[e]??NaN,s=this.#W[e]??NaN;if(Number.isNaN(r)||Number.isNaN(s))continue;let c=_e(ye(this.#h[e]??0,p),ye(r,h)*y,ye(s,g)*b,i);D.screenX[k]=a+c.x*d,D.screenY[k]=o-c.y*d,D.radius[k]=4*c.scale,D.seriesIndex[k]=t,D.pointIndex[k]=e,O[k]=c.depth,k+=1}}),D.count=k,this.#Z=D,this.#Q.length<k&&(this.#Q=new Int32Array(E));let A=this.#Q.subarray(0,k);for(let e=0;e<k;e++)A[e]=e;A.sort((e,t)=>(O[t]??0)-(O[e]??0));let j=t.map(e=>this.#n.seriesShape(e.dataKey));return it(e,{count:k,order:A,screenX:D.screenX,screenY:D.screenY,radius:D.radius,colorAt:e=>{let r=t[D.seriesIndex[e]??0];return r==null?`currentColor`:n.series.get(r.dataKey)??`currentColor`},shapeAt:e=>j[D.seriesIndex[e]??0]??`circle`,alphaAt:e=>_[D.seriesIndex[e]??0]??1,surface:n.chrome.surface}),{center:{x:a,y:o},axes:T}}#lt(e,t){let n=this.#n.seriesSpecs(),r=576,i=null;if(this.#xe()){let a=this.#Z;if(a==null)return null;for(let o=0;o<a.count;o++){let s=(a.screenX[o]??0)-e,c=(a.screenY[o]??0)-t,l=s*s+c*c;if(l<r){let e=n[a.seriesIndex[o]??0];if(e==null)continue;r=l,i={seriesKey:e.dataKey,index:a.pointIndex[o]??0,screenX:a.screenX[o]??0,screenY:a.screenY[o]??0}}}return i}let a=this.#Fe(),o=this.#Ne();for(let s of n){let n=this.#x.get(s.dataKey);if(n!=null)for(let c=0;c<this.#m;c++){let l=n[c]??NaN;if(Number.isNaN(l))continue;let u=(this.#h[c]??0)*a.k+a.b,d=l*o.k+o.b,f=u-e,p=d-t,m=f*f+p*p;m<r&&(r=m,i={seriesKey:s.dataKey,index:c,screenX:u,screenY:d})}}return i}#ut(e){let t=this.#n.seriesSpecs();if(this.#xe()){let t=this.#Z;if(t==null)return null;for(let n=0;n<t.count;n++)if((t.pointIndex[n]??-1)===e)return{x:t.screenX[n]??0,y:t.screenY[n]??0};return null}let n=this.#Fe(),r=this.#Ne();for(let i of t){let t=this.#x.get(i.dataKey)?.[e]??NaN;if(!Number.isNaN(t))return{x:(this.#h[e]??0)*n.k+n.b,y:t*r.k+r.b}}return null}#dt(){let{crosshair:e,band:t,markers:n,tooltip:r}=this.#t,i=this.#Ze(),a=i!=null&&this.#m>0,o=this.#e===`bar`,s=this.#e===`scatter`;if(e.style.opacity=a&&!o&&!s?`1`:`0`,t.style.opacity=a&&o?`1`:`0`,n.style.opacity=a&&!o?`1`:`0`,r.style.opacity=a?`1`:`0`,!a)return;let c=this.#H;if(s){let e=this.#te??this.#ut(i);if(e==null){n.style.opacity=`0`,r.style.opacity=`0`;return}for(;n.children.length>1;)n.lastElementChild?.remove();n.children.length===0&&n.appendChild(xt(n.ownerDocument));let t=n.children[0];if(t instanceof HTMLElement){let n=this.#n.seriesMeta(),r=this.#ne==null?n.find(e=>{let t=this.#x.get(e.dataKey)?.[i]??NaN;return!Number.isNaN(t)}):n.find(e=>e.dataKey===this.#ne);t.style.opacity=`1`,St(t,r?.shape??`circle`,r?.color??`currentColor`),t.style.transform=`translate3d(${e.x}px, ${e.y}px, 0)`}this.#ft(e.x,e.y);return}let l=this.#Ie(i),u=this.#Se();if(o){let e=this.#U;if(e!=null){let n=ke(e,i),r=Math.max(1,n.size),a=n.start-(r-n.size)/2;u?(t.style.transform=`translate3d(${c.left}px, ${a}px, 0)`,t.style.width=`${c.width}px`,t.style.height=`${r}px`):(t.style.transform=`translate3d(${a}px, ${c.top}px, 0)`,t.style.width=`${r}px`,t.style.height=`${c.height}px`)}}else{e.style.transform=`translate3d(${l}px, ${c.top}px, 0)`,e.style.height=`${c.height}px`;let t=this.#n.seriesMeta(),r=this.#n.seriesSpecs();for(;n.children.length>t.length;)n.lastElementChild?.remove();for(;n.children.length<t.length;)n.appendChild(xt(n.ownerDocument));let a=this.#Ne();t.forEach((e,t)=>{let o=n.children[t];if(!(o instanceof HTMLElement))return;let s=this.#x.get(e.dataKey)?.[i]??NaN,c=r[t],u=c==null?NaN:this.#He(c,this.#E==null?`value`:`upper`)[i]??NaN;if(Number.isNaN(s)||Number.isNaN(u)){o.style.opacity=`0`;return}o.style.opacity=`1`,St(o,e.shape,e.color),o.style.transform=`translate3d(${l}px, ${u*a.k+a.b}px, 0)`})}o&&u&&this.#U!=null?this.#ft(this.#se??c.left+c.width/2,Y(this.#U,i)):this.#ft(l,this.#ce??c.top+8)}#ft(e,t){let n=this.#H,r=this.#t.tooltip,i=this.#le,a=e+12;a+i.width>n.left+n.width&&e-12-i.width>=n.left&&(a=e-12-i.width);let o=Math.max(0,Math.min(t-i.height/2,n.top+n.height-i.height));r.style.transform=`translate3d(${a}px, ${o}px, 0)`}};const vt=e=>e===3?{yaw:.65,pitch:-.35}:{yaw:0,pitch:0},yt=(e,t,n,r)=>{for(let t of e.values())t.target=0;for(let n of t){let t=e.get(n.key);t==null?e.set(n.key,{alpha:+!!r,target:1,text:n.text}):(t.target=1,t.text=n.text)}let i=1-.84**(n/16.67),a=1-.88**(n/16.67),o=!1;for(let[t,n]of e){if(r)n.alpha=n.target;else{let e=n.target>n.alpha?i:a;n.alpha+=(n.target-n.alpha)*e}if(n.target===1&&n.alpha>.98&&(n.alpha=1),n.target===0&&n.alpha<.03){e.delete(t);continue}n.alpha!==n.target&&(o=!0)}return o},bt={circle:`circle(50%)`,square:`inset(8%)`,triangle:`polygon(50% 0%, 100% 100%, 0% 100%)`,diamond:`polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)`,"triangle-down":`polygon(0% 0%, 100% 0%, 50% 100%)`,plus:`polygon(33.33% 0%, 66.67% 0%, 66.67% 33.33%, 100% 33.33%, 100% 66.67%, 66.67% 66.67%, 66.67% 100%, 33.33% 100%, 33.33% 66.67%, 0% 66.67%, 0% 33.33%, 33.33% 33.33%)`,cross:`polygon(73.57% 2.86%, 97.14% 26.43%, 73.57% 50%, 97.14% 73.57%, 73.57% 97.14%, 50% 73.57%, 26.43% 97.14%, 2.86% 73.57%, 26.43% 50%, 2.86% 26.43%, 26.43% 2.86%, 50% 26.43%)`,star:`polygon(50% 2.45%, 61.8% 38.77%, 100% 38.77%, 69.1% 61.23%, 80.9% 97.55%, 50% 75.1%, 19.1% 97.55%, 30.9% 61.23%, 0% 38.77%, 38.2% 38.77%)`},xt=e=>{let t=e.createElement(`div`);t.setAttribute(`data-slot`,`chart-active-point`),t.style.position=`absolute`,t.style.width=`12px`,t.style.height=`12px`,t.style.left=`-6px`,t.style.top=`-6px`;let n=e.createElement(`div`);n.style.position=`absolute`,n.style.inset=`0`,n.style.backgroundColor=`var(--background-color-card)`;let r=e.createElement(`div`);return r.style.position=`absolute`,r.style.inset=`2px`,t.appendChild(n),t.appendChild(r),t},St=(e,t,n)=>{let r=bt[t];e.setAttribute(`data-shape`,t);let[i,a]=e.children;i instanceof HTMLElement&&(i.style.clipPath=r),a instanceof HTMLElement&&(a.style.clipPath=r,a.style.backgroundColor=n)},Ct=(e,t)=>e instanceof Date?e.getTime():typeof e==`number`?e:t&&typeof e==`string`?new Date(e).getTime():NaN,wt=(e,t)=>({columnCount:e.columnCount,hasData:e.hasData,minValue:new Float64Array(e.columnCount).fill(t),maxValue:new Float64Array(e.columnCount).fill(t),inValue:new Float64Array(e.columnCount).fill(t),outValue:new Float64Array(e.columnCount).fill(t)}),Tt=e=>e.replaceAll(`|`,`\\|`).replaceAll(/\s*\n\s*/g,` `),Et=e=>e instanceof Date?Number.isNaN(e.getTime())?`—`:e.toISOString():typeof e==`number`?Number.isFinite(e)?String(e):`—`:typeof e==`string`?Tt(e):`—`,Dt=e=>typeof e==`number`&&Number.isFinite(e)?String(e):`—`,Ot=e=>`| ${e.join(` | `)} |`,kt=({data:e,xKey:t,series:n,zKey:r})=>{let i=[Tt(t),...n.map(e=>Tt(e.label)),...r==null?[]:[Tt(r)]],a=e.map(e=>[Et(E(e,t)),...n.map(t=>Dt(E(e,t.dataKey))),...r==null?[]:[Dt(E(e,r))]]);return[Ot(i),Ot(i.map(()=>`---`)),...a.map(e=>Ot(e))].join(`
2
- `)},At=(e,t)=>e==null?`var(${te(t)})`:ee(e)?`var(${te(e)})`:e,jt={"chart-1":`circle`,"chart-2":`square`,"chart-3":`triangle`,"chart-4":`diamond`,"chart-5":`triangle-down`,"chart-6":`plus`,"chart-7":`cross`,"chart-8":`star`,"chart-other":`circle`},Mt=(e,t)=>e??jt[t],Nt={1:`chart-1`,2:`chart-2`,3:`chart-3`,4:`chart-4`,5:`chart-5`,6:`chart-6`,7:`chart-7`,8:`chart-8`,other:`chart-other`},Pt=e=>{let t=new Set;for(let n of e)n.seriesSlot!=null&&n.seriesSlot!==`other`&&t.add(Nt[n.seriesSlot]);let n=new Map,r=new Set(t);for(let t of e){if(t.seriesSlot!=null){n.set(t.dataKey,Nt[t.seriesSlot]);continue}let e=ne.find(e=>!r.has(e))??`chart-other`;n.set(t.dataKey,e),r.add(e)}return n};var Ft=class{#e=new Set;#t={series:[],hover:null,grid:null,xAxis:null,yAxis:null,referenceLines:[],tooltip:null,orientation:`vertical`};#n=new Map;#r=new Map;#i=0;#a=null;#o=`vertical`;#s=null;#c=null;#l=new Map;#u=new Map;#d=null;#f=null;onSeriesChange=null;onPresentationChange=null;subscribe=e=>(this.#e.add(e),()=>{this.#e.delete(e)});getSnapshot=()=>this.#t;seriesSpecs(){return[...this.#n.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec)}seriesShape(e){let t=this.seriesSpecs(),n=Pt(t).get(e)??`chart-other`;return Mt(t.find(t=>t.dataKey===e)?.shape,n)}registerSeries(e){let t=this.#r.get(e.dataKey)??this.#i++;return this.#r.set(e.dataKey,t),this.#n.set(e.dataKey,{spec:e,sequence:t}),this.#p({seriesChanged:!0}),()=>{this.#n.get(e.dataKey)?.spec===e&&(this.#n.delete(e.dataKey),this.#p({seriesChanged:!0}))}}setOrientation(e){this.#o!==e&&(this.#o=e,this.#p())}registerGrid(e){let t={lines:e};return this.#a=t,this.#p(),()=>{this.#a===t&&(this.#a=null,this.#p())}}registerXAxis(e){return this.#s=e,this.#p(),()=>{this.#s===e&&(this.#s=null,this.#p())}}registerYAxis(e){return this.#c=e,this.#p(),()=>{this.#c===e&&(this.#c=null,this.#p())}}registerReferenceLine(e,t){let n=this.#u.get(e)??this.#i++;return this.#u.set(e,n),this.#l.set(e,{spec:t,sequence:n}),this.#p(),()=>{this.#l.get(e)?.spec===t&&(this.#l.delete(e),this.#p())}}registerTooltip(e){return this.#d=e,this.#p(),()=>{this.#d===e&&(this.#d=null,this.#p())}}publishHover(e){this.#f!==e&&(this.#f=e,this.#t={...this.#t,hover:e},this.#m())}seriesMeta(){let e=this.seriesSpecs(),t=Pt(e);return e.map(e=>{let n=t.get(e.dataKey)??`chart-other`;return{dataKey:e.dataKey,label:e.label,mark:e.mark,color:At(e.color,n),colorInput:e.color??n,shape:Mt(e.shape,n),texture:e.texture}})}#p(e={seriesChanged:!1}){this.#t={series:this.seriesMeta(),hover:this.#f,grid:this.#a,xAxis:this.#s,yAxis:this.#c,referenceLines:[...this.#l.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec),tooltip:this.#d,orientation:this.#o},this.#m(),e.seriesChanged?this.onSeriesChange?.():this.onPresentationChange?.()}#m(){for(let e of this.#e)e()}};const It=a(null),Q=e=>{let t=o(It);return m(t,`${e} must be composed inside ${e.split(`.`)[0]}.Root — it registers into the chart it belongs to and renders nothing on its own.`),t},Lt=e=>p(e.subscribe,e.getSnapshot,e.getSnapshot),Rt=(e,t)=>{for(let n of e){let e=E(n,t);if(e!=null)return e instanceof Date?`time`:typeof e==`number`?`linear`:`point`}return`point`},zt=[`auto`,`auto`],Bt=({kind:r,componentName:i,slotName:a,data:o,xKey:s,xScale:p,zKey:v,dimensions:y=3,yDomain:b=zt,stacked:x=!1,orientation:S=`vertical`,animate:C=!0,pending:w=!1,decorative:T=!1,activeIndex:D,onActiveIndexChange:O,onDatumActivate:k,className:A,children:j,ref:ee,"data-slot":te,"aria-label":ne,"aria-labelledby":re,"aria-hidden":M,tabIndex:ie,...ae})=>{let[N]=f(()=>new Ft),P=d(null),[F]=f(()=>({kind:r,componentName:i,store:N,engineRef:P,dataRef:{current:{data:o,xKey:s,zKey:v}}}));l(()=>{F.dataRef.current={data:o,xKey:s,zKey:v}},[F,o,s,v]);let I=d(null),L=e(I,ee),R=d(null),z=d(null),B=d(null),V=d(null),oe=d(null),se=d(null),H=c(),U=r===`bar`?`band`:p??Rt(o,s);m(r!==`scatter`||o.length===0||U!==`point`,`${i}.Root requires numeric or Date x values — the "${s}" values are not numbers or dates, so they have no position on a continuous scatter axis.`);let[ce,le]=b,W=u(()=>{for(let e of o){let t=E(e,s);if(t instanceof Date&&pe(t))return!0}return!1},[o,s]);return l(()=>{let e=I.current,t=R.current,n=z.current,i=B.current,a=V.current,o=oe.current,s=se.current;if(e==null||t==null||n==null||i==null||a==null||o==null||s==null)return;let c=new _t({kind:r,store:N,elements:{root:e,plot:t,canvas:n,crosshair:i,band:a,markers:o,tooltip:s}});return P.current=c,()=>{P.current=null,c.destroy()}},[r,N]),l(()=>{P.current?.setOptions({xKey:s,xScale:U,yDomain:[ce,le],zKey:v??null,dimensions:y,stacked:x,orientation:S,animate:C}),N.setOrientation(S)},[N,s,U,ce,le,v,y,x,S,C]),l(()=>{P.current?.setRows(o)},[o]),l(()=>{P.current?.setCallbacks(T?{onDatumActivate:null,onActiveIndexChange:null}:{onDatumActivate:k??null,onActiveIndexChange:O??null})}),l(()=>{P.current?.setControlledActiveIndex(T?void 0:D)},[T,D]),l(()=>{P.current?.flushIngest()}),g(`div`,{"data-slot":n(te,a),className:t(`relative flex aspect-video w-full flex-col`,A),"aria-hidden":T?!0:M,tabIndex:T?void 0:ie,ref:L,...ae,children:_(It.Provider,{value:F,children:[_(`div`,{"data-slot":`${a}-plot`,className:t(`relative min-h-0 w-full flex-1`,w&&`opacity-60 transition-opacity duration-300`),ref:R,children:[g(`canvas`,{"data-slot":`${a}-canvas`,ref:z,"aria-hidden":!0,className:`absolute inset-0 size-full`}),T?null:_(h,{children:[g(`div`,{role:`application`,"aria-label":ne,"aria-labelledby":re,"aria-describedby":H,tabIndex:0,className:t(`focus-visible:ring-focus-accent absolute inset-0 rounded-sm outline-none focus-visible:ring-2`,(r===`line`||r===`area`)&&`cursor-crosshair`,r===`scatter`&&v!=null&&`touch-none cursor-grab active:cursor-grabbing`),onPointerDown:e=>{e.isTrusted&&r===`scatter`&&v!=null&&e.currentTarget.setPointerCapture(e.pointerId),P.current?.handlePointerDown(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerMove:e=>{P.current?.handlePointerMove(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerUp:e=>{P.current?.handlePointerUp(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerLeave:()=>{P.current?.handlePointerLeave()},onPointerCancel:()=>{P.current?.handlePointerLeave()},onBlur:()=>{P.current?.handlePointerLeave()},onKeyDown:e=>{P.current?.handleKeyDown(e.key)&&e.preventDefault()}}),g(`span`,{id:H,className:`sr-only`,children:`Use the left and right arrow keys to move between data points, Home and End to jump to the first and last, and Enter to activate the current point.`})]}),g(`div`,{"data-slot":`${a}-crosshair`,ref:B,"aria-hidden":!0,className:`bg-neutral-500 pointer-events-none absolute left-0 top-0 w-px opacity-0`}),g(`div`,{"data-slot":`${a}-hover-band`,ref:V,"aria-hidden":!0,className:`bg-neutral-500/10 pointer-events-none absolute left-0 top-0 rounded-sm opacity-0`}),g(`div`,{"data-slot":`${a}-markers`,ref:oe,"aria-hidden":!0,className:`pointer-events-none absolute inset-0 opacity-0`}),g(Jt,{slotName:a,store:N,tooltipRef:se,xHasTimeOfDay:W})]}),j,T?null:_(h,{children:[g(tn,{store:N,xHasTimeOfDay:W}),g(nn,{data:o,label:ne,slotName:a,store:N,xHasTimeOfDay:W,xKey:s,zKey:v})]})]})})},Vt=(e,t,n)=>{let r=Q(e);m(r.kind===t,`${e} cannot be composed inside ${r.componentName}.Root — compose ${r.componentName} series parts instead.`);let{dataKey:i,label:a,seriesSlot:o,color:s,curve:c=`linear`,markers:u=!1,connectNulls:d=!1,shape:f,texture:p=`solid`}=n;return l(()=>r.store.registerSeries({dataKey:i,label:a??i,seriesSlot:o,color:s,mark:t,curve:c,markers:u,connectNulls:d,shape:f,texture:p}),[r.store,i,a,o,s,t,c,u,d,f,p]),null},Ht=(e,t)=>{let n=Q(e),{lines:r}=t;return l(()=>n.store.registerGrid(r),[n.store,r]),null},Ut=(e,t)=>{let n=Q(e),{tickFormat:r,tickCount:i}=t;return l(()=>n.store.registerXAxis({tickFormat:r,tickCount:i}),[n.store,r,i]),null},Wt=(e,t)=>{let n=Q(e),{tickFormat:r,tickCount:i}=t;return l(()=>n.store.registerYAxis({tickFormat:r,tickCount:i}),[n.store,r,i]),null},Gt=(e,t)=>{let n=Q(e),r=c(),{y:i,label:a,color:o}=t;return l(()=>n.store.registerReferenceLine(r,{y:i,label:a,color:o}),[n.store,r,i,a,o]),null},Kt=(e,t)=>{let n=Q(e),{labelFormat:r,valueFormat:i,indicator:a=`line`,footer:o,children:s,...c}=t;return l(()=>n.store.registerTooltip({labelFormat:r,valueFormat:i,indicator:a,footer:o,children:s,divProps:c})),null},qt=(e,t,n)=>e==null?`—`:n==null?G(e):n(e,t),Jt=({slotName:n,store:r,tooltipRef:i,xHasTimeOfDay:a})=>{let o=Lt(r),s=o.tooltip,c=o.hover,{className:u,ref:f,style:p,...m}=s?.divProps??{},v=d(null),y=e(i,v);l(()=>{if(f==null)return;let e=v.current;if(typeof f==`function`){let t=f(e);return()=>{typeof t==`function`?t():f(null)}}return f.current=e,()=>{f.current=null}},[f]);let b=s?.footer;return g(`div`,{"data-slot":`${n}-tooltip`,ref:y,className:t(`bg-popover border-popover text-strong pointer-events-none absolute left-0 top-0 z-10 min-w-32 rounded-md border px-2.5 py-1.5 text-xs shadow-md`,u),style:{opacity:0,...p},...m,children:c==null?null:s?.children==null?_(h,{children:[g(`div`,{className:`text-muted font-medium`,children:s?.labelFormat==null?K(c.xValue,{datasetHasTimeOfDay:a}):s.labelFormat(c.xValue)}),g(`div`,{className:`mt-1 grid gap-1`,children:c.points.map(e=>_(`div`,{className:`flex items-center gap-1.5`,children:[s?.indicator===`none`?null:g(`span`,{"aria-hidden":!0,className:`h-2.5 w-0.5 shrink-0 rounded-full`,style:{backgroundColor:e.color}}),g(`span`,{className:`text-muted`,children:e.label}),g(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:qt(e.value,e.dataKey,s?.valueFormat)})]},e.dataKey))}),c.zValue===void 0?null:_(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[g(`span`,{className:`text-muted`,children:`z`}),g(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:c.zValue==null?`—`:G(c.zValue)})]}),b==null?null:g(`div`,{className:`text-muted mt-1`,children:typeof b==`function`?b(c):b})]}):s.children(c)})},$=(e,t,n=3)=>`repeating-linear-gradient(${e}, ${t} 0, ${t} 1px, transparent 1px, transparent ${n}px)`,Yt=`forced-color-adjust-none [print-color-adjust:exact] [-webkit-print-color-adjust:exact]`,Xt={hatch:({ink:e})=>({backgroundImage:$(`135deg`,e)}),"hatch-reverse":({ink:e})=>({backgroundImage:$(`45deg`,e)}),crosshatch:({ink:e})=>({backgroundImage:`${$(`135deg`,e,4)}, ${$(`45deg`,e,4)}`}),perpendicular:({ink:e,orientation:t})=>({backgroundImage:$(t===`horizontal`?`90deg`:`0deg`,e)}),parallel:({ink:e,orientation:t})=>({backgroundImage:$(t===`horizontal`?`0deg`:`90deg`,e)}),grid:({ink:e})=>({backgroundImage:`${$(`0deg`,e,4)}, ${$(`90deg`,e,4)}`}),dots:({ink:e})=>({backgroundImage:`radial-gradient(circle at 1px 1px, ${e} 0.75px, transparent 0.8px)`,backgroundSize:`3px 3px`})},Zt=(e,t,n)=>e===`solid`?{}:Xt[e]({ink:R(t),orientation:n}),Qt=({series:e,orientation:n})=>e.mark===`bar`?g(`span`,{"aria-hidden":!0,"data-texture":e.texture,className:t(`size-2 shrink-0 rounded-[2px]`,Yt),style:{backgroundColor:e.color,...Zt(e.texture,e.color,n)}}):e.mark===`line`?_(`span`,{"aria-hidden":!0,className:`relative flex h-2 w-3 shrink-0 items-center justify-center`,children:[g(`span`,{className:t(`absolute inset-x-0 top-1/2 h-0.5 -translate-y-1/2 rounded-full`,Yt),style:{backgroundColor:e.color}}),g(`span`,{"data-shape":e.shape,className:t(`relative size-2`,Yt),style:{backgroundColor:e.color,clipPath:bt[e.shape]}})]}):g(`span`,{"aria-hidden":!0,"data-shape":e.shape,className:t(`size-2 shrink-0`,Yt),style:{backgroundColor:e.color,clipPath:bt[e.shape]}}),$t=({partName:e,slotName:n,className:r,children:i,...a})=>{let o=Q(e),s=Lt(o.store);return s.series.length<2?null:g(`div`,{"data-slot":`${n}-legend`,className:t(`text-muted flex flex-wrap items-center gap-x-4 gap-y-1 pt-3 text-xs`,r),...a,children:i==null?s.series.map(e=>_(`div`,{className:`flex items-center gap-1.5`,children:[g(Qt,{series:e,orientation:s.orientation}),e.label]},e.dataKey)):i(s.series)})},en=({partName:e,slotName:t,label:n=`Copy data as Markdown`,onCopy:a,onCopyError:o,onClick:c,ref:l,...u})=>{let p=Q(e),m=i(),[h,_]=f(!1),b=d(void 0);return s(()=>()=>{b.current!=null&&clearTimeout(b.current)},[]),g(r,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,"data-slot":`${t}-copy-button`,label:n,icon:g(h?v:y,{}),ref:l,onClick:async e=>{try{if(c?.(e),e.defaultPrevented){b.current!=null&&(clearTimeout(b.current),b.current=void 0),_(!1);return}let{data:t,xKey:n,zKey:r}=p.dataRef.current,i=kt({data:t,xKey:n,zKey:r,series:p.store.getSnapshot().series});await m(i),a?.(i),_(!0),b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{_(!1)},2e3)}catch(e){o?.(e)}},...u})},tn=({store:e,xHasTimeOfDay:t})=>{let n=Lt(e),[r,i]=f(``),a=n.hover;return s(()=>{if(a==null||!a.viaKeyboard){i(``);return}let e=a.points.map(e=>`${e.label}: ${e.value==null?`no data`:G(e.value)}`).join(`, `),n=a.zValue===void 0?``:`, z: ${a.zValue==null?`no data`:G(a.zValue)}`,r=setTimeout(()=>{i(`${K(a.xValue,{datasetHasTimeOfDay:t})}. ${e}${n}`)},120);return()=>clearTimeout(r)},[a,t]),g(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:r})},nn=({data:e,label:t,slotName:n,store:r,xHasTimeOfDay:i,xKey:a,zKey:o})=>{let s=Lt(r);if(e.length===0||s.series.length===0)return null;let c=e.slice(0,150);return g(`div`,{className:`sr-only`,"data-slot":`${n}-data-table`,children:_(`table`,{children:[g(`caption`,{children:`${t==null?`Chart data`:`${t} — chart data`}${e.length>150?`. Showing the first 150 of ${e.length} rows.`:`.`}`}),g(`thead`,{children:_(`tr`,{children:[g(`th`,{scope:`col`,children:a}),s.series.map(e=>g(`th`,{scope:`col`,children:e.label},e.dataKey)),o==null?null:g(`th`,{scope:`col`,children:o})]})}),g(`tbody`,{children:c.map((e,t)=>{let n=E(e,a),r=n instanceof Date&&!Number.isNaN(n.getTime()),c=typeof n==`string`||typeof n==`number`||n instanceof Date?K(n,{datasetHasTimeOfDay:i}):String(n);return _(`tr`,{children:[g(`th`,{scope:`row`,"data-value":typeof n==`number`&&Number.isFinite(n)?n:void 0,children:r?g(`time`,{dateTime:n.toISOString(),children:c}):c}),s.series.map(t=>{let n=E(e,t.dataKey),r=typeof n==`number`&&Number.isFinite(n);return g(`td`,{"data-value":r?n:void 0,children:r?G(n):`—`},t.dataKey)}),o==null?null:(()=>{let t=E(e,o),n=typeof t==`number`&&Number.isFinite(t);return g(`td`,{"data-value":n?t:void 0,children:n?G(t):`—`})})()]},t)})})]})})};export{Gt as a,Ut as c,Ht as i,Wt as l,$t as n,Vt as o,Bt as r,Kt as s,en as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./button-CCkGqE1t.js";import{a as n,c as r,i,n as a,o,r as s,s as c,t as l}from"./primitive-D-9GIFWb.js";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{XIcon as f}from"@phosphor-icons/react/X";const p=o,m=e=>u(r,{"data-slot":`dialog-trigger`,...e}),h=n,g=e=>u(l,{"data-slot":`dialog-close`,...e}),_=({className:t,ref:n,...r})=>u(i,{ref:n,"data-slot":`dialog-overlay`,className:e(`bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-50 backdrop-blur-xs`,t),...r}),v={Root:p,Body:({className:t,...n})=>u(`div`,{"data-slot":`dialog-body`,className:e(`scrollbar scrollbar-gutter-stable text-body flex-1 overflow-y-auto p-6`,t),...n}),Close:g,CloseIconButton:({size:e=`md`,type:n=`button`,label:r=`Close Dialog`,appearance:i=`ghost`,intent:a=`neutral`,...o})=>u(l,{asChild:!0,children:u(t,{appearance:i,"data-slot":`dialog-close-icon-button`,icon:u(f,{}),intent:a,label:r,size:e,type:n,...o})}),Content:({children:t,className:n,preferredWidth:r=`max-w-lg`,ref:i,...o})=>d(h,{children:[u(_,{}),u(`div`,{className:`fixed inset-4 z-50 flex items-center justify-center`,children:u(a,{"data-mantle-modal-content":!0,"data-slot":`dialog-content`,className:e(`flex max-h-full w-full flex-1 flex-col`,`outline-hidden focus-within:outline-hidden`,`border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200`,`data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95`,r,n),ref:i,...o,children:t})})]}),Description:({className:t,ref:n,...r})=>u(s,{ref:n,"data-slot":`dialog-description`,className:e(`text-muted`,t),...r}),Footer:({className:t,...n})=>u(`div`,{"data-slot":`dialog-footer`,className:e(`border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-4`,t),...n}),Header:({className:t,children:n,...r})=>u(`div`,{"data-slot":`dialog-header`,className:e(`border-dialog-muted text-strong relative flex shrink-0 items-center justify-between gap-2 border-b px-6 py-4`,`has-[.icon-button]:pr-4`,t),...r,children:n}),Overlay:_,Portal:h,Title:({className:t,ref:n,...r})=>u(c,{ref:n,"data-slot":`dialog-title`,className:e(`text-strong truncate text-lg font-medium`,t),...r}),Trigger:m};export{v as t};