@ngrok/mantle 0.84.3 → 0.85.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/dist/accordion.js +1 -1
  2. package/dist/agent.json +1 -1
  3. package/dist/alert-OP_-aGJD.js +1 -0
  4. package/dist/alert-center.js +1 -1
  5. package/dist/alert-dialog.js +1 -1
  6. package/dist/alert.js +1 -1
  7. package/dist/anchor-BnMhJYS4.js +1 -0
  8. package/dist/anchor.js +1 -1
  9. package/dist/app-layout.js +1 -1
  10. package/dist/area-chart.js +1 -1
  11. package/dist/avatar.js +1 -1
  12. package/dist/badge.js +1 -1
  13. package/dist/bar-chart.js +1 -1
  14. package/dist/breadcrumb.js +1 -1
  15. package/dist/browser-only-Crr3sgA0.js +1 -0
  16. package/dist/browser-only.js +1 -1
  17. package/dist/button-BFpCB99R.js +1 -0
  18. package/dist/button-Dij5vCQG.js +1 -0
  19. package/dist/button-pwkdtR3U.js +1 -0
  20. package/dist/button.js +1 -1
  21. package/dist/calendar.js +1 -1
  22. package/dist/card.js +1 -1
  23. package/dist/centered-layout.js +1 -1
  24. package/dist/chart-2rorgvW0.js +2 -0
  25. package/dist/checkbox-DbJSqSNN.js +1 -0
  26. package/dist/checkbox.js +1 -1
  27. package/dist/choice-SRyLguqU.js +1 -0
  28. package/dist/choice.js +1 -1
  29. package/dist/code-block.js +6 -6
  30. package/dist/code.js +1 -1
  31. package/dist/combobox.js +1 -1
  32. package/dist/command.js +1 -1
  33. package/dist/compose-refs-sFdxsL7k.js +1 -0
  34. package/dist/{copy-to-clipboard-B4UB6pts.js → copy-to-clipboard-Cza2OT47.js} +1 -1
  35. package/dist/data-table.d.ts +204 -75
  36. package/dist/data-table.js +1 -1
  37. package/dist/description-list.js +1 -1
  38. package/dist/dialog-Ddhwzen3.js +1 -0
  39. package/dist/dialog.js +1 -1
  40. package/dist/dropdown-menu-WydWB9lo.js +1 -0
  41. package/dist/dropdown-menu.js +1 -1
  42. package/dist/empty.js +1 -1
  43. package/dist/field.js +1 -1
  44. package/dist/flag.js +1 -1
  45. package/dist/hooks.js +1 -1
  46. package/dist/hover-card.js +1 -1
  47. package/dist/icon-BT8FnkkJ.js +1 -0
  48. package/dist/icon.js +1 -1
  49. package/dist/icons-BQRcOU6J.js +1 -0
  50. package/dist/icons-Bu-2boul.js +1 -0
  51. package/dist/icons-C3rVfpx9.js +1 -0
  52. package/dist/icons.js +1 -1
  53. package/dist/input-yq0jLE4e.js +1 -0
  54. package/dist/input.js +1 -1
  55. package/dist/kbd-CJ8hNZfS.js +1 -0
  56. package/dist/kbd.js +1 -1
  57. package/dist/label-BAy0Mg59.js +1 -0
  58. package/dist/label.js +1 -1
  59. package/dist/layer-container-R7aux3n8.js +1 -0
  60. package/dist/layer-container.js +1 -1
  61. package/dist/line-chart.js +1 -1
  62. package/dist/list-BleZ-43e.js +1 -0
  63. package/dist/list.js +1 -1
  64. package/dist/live-region-B2vJRvPH.js +1 -0
  65. package/dist/live-region.js +1 -1
  66. package/dist/llms.txt +1 -1
  67. package/dist/main.js +1 -1
  68. package/dist/media-object.js +1 -1
  69. package/dist/multi-select.js +1 -1
  70. package/dist/otp-input.js +1 -1
  71. package/dist/pagination.js +1 -1
  72. package/dist/popover-H_1pLGLc.js +1 -0
  73. package/dist/popover.js +1 -1
  74. package/dist/primitive-C5AerOO8.js +1 -0
  75. package/dist/progress.js +1 -1
  76. package/dist/qr-code.js +1 -1
  77. package/dist/radio-group.js +1 -1
  78. package/dist/sandbar.js +1 -1
  79. package/dist/sandboxed-on-click-BLvvSqOP.js +1 -0
  80. package/dist/sandboxed-on-click.js +1 -1
  81. package/dist/scatter-plot.js +1 -1
  82. package/dist/select-sOHUE2Bm.js +1 -0
  83. package/dist/select.js +1 -1
  84. package/dist/selectable-list.js +1 -1
  85. package/dist/separator-D98be0gY.js +1 -0
  86. package/dist/separator.js +1 -1
  87. package/dist/sheet-D8KGX4q1.js +1 -0
  88. package/dist/sheet.js +1 -1
  89. package/dist/sidebar.js +1 -1
  90. package/dist/skeleton-bVDP8BzY.js +1 -0
  91. package/dist/skeleton.js +1 -1
  92. package/dist/skip-to-main-link.js +1 -1
  93. package/dist/slider.js +1 -1
  94. package/dist/slot-BsvE2ntj.js +1 -0
  95. package/dist/slot.js +1 -1
  96. package/dist/split-button.js +1 -1
  97. package/dist/switch.js +1 -1
  98. package/dist/table-Bje71vHb.js +1 -0
  99. package/dist/table.js +1 -1
  100. package/dist/tabs.js +1 -1
  101. package/dist/text-area.js +1 -1
  102. package/dist/theme-C1kFFdIk.js +1 -0
  103. package/dist/theme-switcher.js +1 -1
  104. package/dist/theme.js +1 -1
  105. package/dist/toast.js +1 -1
  106. package/dist/tooltip-DikKOzqN.js +1 -0
  107. package/dist/tooltip.js +1 -1
  108. package/dist/use-breakpoint-CjyNk0fi.js +1 -0
  109. package/dist/use-callback-ref-BvVyI5K1.js +1 -0
  110. package/dist/use-copy-to-clipboard-ByLT8veV.js +1 -0
  111. package/dist/use-matches-media-query-m860lols.js +1 -0
  112. package/dist/use-prefers-reduced-motion-Cj9tJ181.js +1 -0
  113. package/dist/utils.js +1 -1
  114. package/dist/visually-hidden.js +1 -1
  115. package/dist/well.js +1 -1
  116. package/package.json +2 -2
  117. package/dist/alert-DtBQuuuP.js +0 -1
  118. package/dist/anchor-Cqu4GPPV.js +0 -1
  119. package/dist/browser-only-CmEEzfU3.js +0 -1
  120. package/dist/button-CaM-ZAH5.js +0 -1
  121. package/dist/button-DGsTE3P2.js +0 -1
  122. package/dist/button-Wn-yt0c_.js +0 -1
  123. package/dist/chart-B_rZqf8a.js +0 -2
  124. package/dist/checkbox-Gg6nGUnR.js +0 -1
  125. package/dist/choice-CT_AdesL.js +0 -1
  126. package/dist/compose-refs-DdUwopIY.js +0 -1
  127. package/dist/dialog-CA-1Z0Np.js +0 -1
  128. package/dist/dropdown-menu-lxHsgLiw.js +0 -1
  129. package/dist/icon-CGKaq_tV.js +0 -1
  130. package/dist/icons-B_DDQcVD.js +0 -1
  131. package/dist/icons-CF1lbWtp.js +0 -1
  132. package/dist/icons-Cie4gcrm.js +0 -1
  133. package/dist/input-BhykQSvJ.js +0 -1
  134. package/dist/kbd-4_0Y_8rx.js +0 -1
  135. package/dist/label-BqIp6kFx.js +0 -1
  136. package/dist/layer-container-BTcQpd4K.js +0 -1
  137. package/dist/list-Bo1mExIg.js +0 -1
  138. package/dist/live-region-CV7kykeo.js +0 -1
  139. package/dist/popover-Bp-9B3GR.js +0 -1
  140. package/dist/primitive-CejGAoGb.js +0 -1
  141. package/dist/sandboxed-on-click-UagMFl_U.js +0 -1
  142. package/dist/select-Dov9H2CX.js +0 -1
  143. package/dist/separator-Da8lDnio.js +0 -1
  144. package/dist/sheet-C6UGAvRk.js +0 -1
  145. package/dist/skeleton-paJOgf-f.js +0 -1
  146. package/dist/slot-C3gII_9c.js +0 -1
  147. package/dist/table-EZNW3nFk.js +0 -1
  148. package/dist/theme-DN-Et3A_.js +0 -1
  149. package/dist/tooltip-CkAibjBb.js +0 -1
  150. package/dist/use-breakpoint-BhJ_3El2.js +0 -1
  151. package/dist/use-callback-ref-IYti9y7x.js +0 -1
  152. package/dist/use-copy-to-clipboard-CSyp4Zk0.js +0 -1
  153. package/dist/use-matches-media-query-DCBT6iNA.js +0 -1
  154. package/dist/use-prefers-reduced-motion-DHYDQk1h.js +0 -1
@@ -0,0 +1,2 @@
1
+ import{n as e,t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./cx-0HCjnNv1.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as i}from"./button-pwkdtR3U.js";import{t as a}from"./use-copy-to-clipboard-ByLT8veV.js";import{t as o}from"./alternate-announcement-BkH4bOKp.js";import{t as s}from"./live-region-B2vJRvPH.js";import{c}from"react/compiler-runtime";import{createContext as l,useContext as u,useEffect as d,useId as f,useLayoutEffect as p,useRef as m,useState as h,useSyncExternalStore as g}from"react";import _ from"tiny-invariant";import{Fragment as v,jsx as y,jsxs as b}from"react/jsx-runtime";import{CheckIcon as x}from"@phosphor-icons/react/Check";import{CopyIcon as S}from"@phosphor-icons/react/Copy";import{scaleTime as C}from"d3-scale";import{area as w,curveLinear as T,curveMonotoneX as E,curveStep as D,line as O}from"d3-shape";const k=(e,t)=>Reflect.get(e,t),A=e=>{let{step:t,slot:n}=e,r=Math.min(64,Math.max(24,t*.6));return Math.min(n,r)},j=.5,M=(e,t)=>e<0?e:t,N=e=>{let{lower:t,upper:n,toPixel:r,reveal:i,gap:a}=e,o=r(t<0?n:t),s=o+(r(M(t,n))-o)*i;if(Math.abs(o-r(0))<j)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}},P=e=>{let{lower:t,upper:n,pileOuter:r,toPixel:i}=e;if(Number.isNaN(r))return!1;let a=i(M(t,n));return Math.abs(a-i(r))<j},F=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`,`chart-other`],I=e=>F.includes(e),L=e=>`--color-${e}`,R=`var(--color-chart-decorative)`,ee=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`],z=e=>{let t=e.toLowerCase();return t.includes(`var(`)||t.includes(`currentcolor`)},B=(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},te=(e,t)=>I(t)?B(e,`var(${L(t)})`):z(t)?B(e,t):t,ne=e=>({grid:B(e,`var(--border-color-card-muted)`),baseline:B(e,`var(--border-color-card)`),tickText:B(e,`var(--text-color-muted)`),reference:B(e,`var(--color-neutral-500)`),surface:B(e,`var(--background-color-card)`)}),re=e=>`${e.className}|${e.getAttribute(`data-applied-theme`)??``}|${e.getAttribute(`data-theme`)??``}`,ie=(e,t)=>{let n=new MutationObserver(t);return n.observe(e,{attributes:!0,attributeFilter:[`class`,`data-applied-theme`,`data-theme`]}),()=>n.disconnect()},ae=1.5,V=1.1,H=1.6,U=e=>`oklch(from ${e} calc(l - 0.18) c h)`,W=(e,t,n)=>{let r=ae;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)},oe=(e,t)=>{let{size:n,width:r}=t;e.fillRect(0,n/2-r/2,n,r)},se=(e,t)=>{let{size:n,width:r}=t;e.fillRect(n/2-r/2,0,r,n)},ce={hatch:(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=ae,e.beginPath(),W(e,t,`up`),e.stroke()},"hatch-reverse":(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=ae,e.beginPath(),W(e,t,`down`),e.stroke()},crosshatch:(e,{size:t,ink:n})=>{e.strokeStyle=n,e.lineWidth=1,e.beginPath(),W(e,t,`up`),W(e,t,`down`),e.stroke()},perpendicular:(e,{size:t,ink:n,orientation:r})=>{e.fillStyle=n,r===`horizontal`?se(e,{size:t,width:2}):oe(e,{size:t,width:2})},parallel:(e,{size:t,ink:n,orientation:r})=>{e.fillStyle=n,r===`horizontal`?oe(e,{size:t,width:2}):se(e,{size:t,width:2})},grid:(e,{size:t,ink:n})=>{e.fillStyle=n,oe(e,{size:t,width:V}),se(e,{size:t,width:V})},dots:(e,{size:t,ink:n})=>{e.fillStyle=n,e.beginPath(),e.arc(t/4,t/4,H,0,Math.PI*2),e.moveTo(3*t/4+H,3*t/4),e.arc(3*t/4,3*t/4,H,0,Math.PI*2),e.fill()}},le=(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),ce[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},ue=e=>{let{pointCount:t,columnCount:n,wasDecimated:r}=e;return n<=0?!1:r?t>=n*3:t>=n*4},de=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}},fe=new Intl.NumberFormat,pe=new Intl.NumberFormat(void 0,{maximumSignificantDigits:4}),me=new Map,G=(e,t)=>{let n=Object.is(e,-0)?0:e,r=t?.maximumFractionDigits;if(r!=null){let e=me.get(r);return e??(e=new Intl.NumberFormat(void 0,{maximumFractionDigits:r}),me.set(r,e)),e.format(n)}return n!==0&&Math.abs(n)<1?pe.format(n):fe.format(n)},he=e=>!Number.isFinite(e)||e<=0?0:Math.min(20,Math.max(0,-Math.floor(Math.log10(e)))),ge=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),_e=new Intl.DateTimeFormat(void 0,{year:`numeric`,month:`short`,day:`numeric`}),ve=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??ve(e)?ge.format(e):_e.format(e),ye=(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},be=Math.PI/2-.05,xe=e=>({cosYaw:Math.cos(e.yaw),sinYaw:Math.sin(e.yaw),cosPitch:Math.cos(e.pitch),sinPitch:Math.sin(e.pitch)}),Se=(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}},Ce=e=>Math.min(be,Math.max(-be,e)),q=(e,t)=>{let n=t[1]-t[0];return n===0?0:(e-t[0])/n*2-1},we=[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1],[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],Te=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]],Ee=Math.sqrt(50),De=Math.sqrt(10),Oe=Math.sqrt(2),J=(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>=Ee?10:s>=De?5:s>=Oe?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?J(e,t,n*2,r):[l,u,d]},ke=(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?J(t,e,n,r):J(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},Ae=(e,t,n)=>J(e,t,n)[2],je=(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}},Me=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}},Y=(e,t)=>e.rangeStart+e.offset+t*e.step,X=(e,t)=>Y(e,t)+e.bandwidth/2,Ne=(e,t)=>({start:Y(e,t)-(e.step-e.bandwidth)/2,size:e.step}),Pe=(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))},Fe=(e,t,n)=>ke(e[0],e[1],t,n);let Ie=null,Le=null;const Re=e=>{if(Le!=null&&Ie!=null&&Ie[0]===e[0]&&Ie[1]===e[1])return Le;let t=C().domain([new Date(e[0]),new Date(e[1])]);return Ie=[e[0],e[1]],Le=t,t},ze=(e,t)=>Re(e).ticks(t).map(e=>e.getTime()),Be=e=>{let t=Re(e).tickFormat();return e=>t(new Date(e))},Z=(e,t)=>{if(e[0]>e[1])return Z([e[1],e[0]],t);if(e[0]===e[1]){let n=e[0],r=n===0?1:Math.abs(n)*.5;return Z([n-r,n+r],t)}let n=e[0],r=e[1],i=NaN;for(let e=0;e<10;e++){let e=Ae(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]},Ve=(e,t)=>{let n=Z(e,t);return e[0]===0?[0,n[1]]:n},Q=e=>e===`monotone`?E:e===`step`?D:T,$=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($(t.position),n.top),e.lineTo($(t.position),n.top+n.height),e.stroke();for(let t of a)e.globalAlpha=t.alpha,e.beginPath(),e.moveTo(n.left,$(t.position)),e.lineTo(n.left+n.width,$(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,$(i)),e.lineTo(n.left+n.width,$(i)),e.stroke()},We=(e,t)=>{let{plot:n,color:r,x:i}=t;e.strokeStyle=r,e.lineWidth=1,e.beginPath(),e.moveTo($(i),n.top),e.lineTo($(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=O().x(a).y(o).defined(s).curve(Q(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=w().x(a).y0(o).y1(s).defined(c).curve(Q(r)).context(e);e.beginPath(),l(i),e.save(),e.globalAlpha=.1,e.fillStyle=n,e.fill(),e.restore();let u=O().x(a).y(s).defined(c).curve(Q(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,$(a)),e.lineTo(n.left+n.width,$(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($(a),n.top),e.lineTo($(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=null;#M=!1;#N=new Map;#P=new Map;#F=0;#I=!1;#L=new Map;#R={alpha:0,target:0};#z=0;#B=null;#V=null;#H=null;#U={left:0,top:0,width:0,height:0};#W=null;#G=new Float64Array;#K=[0,1];#q={yaw:.65,pitch:-.35};#J=new gt({speed:.12});#Y=new gt({speed:.16});#X=null;#Z=!1;#Q=null;#$=new Int32Array;#ee=new Map;#te=``;#ne=null;#re=null;#ie=null;#ae=void 0;#oe=null;#se=!1;#ce=null;#le=null;#ue={width:0,height:0};#de=!1;#fe=!1;#pe=0;#me=!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.#De()},this.#n.onPresentationChange=()=>{this.#De()},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.#je(),this.#L.clear(),this.#ne=null,this.#De())}),this.#o.observe(e.elements.plot),this.#c=new ResizeObserver(()=>{this.#ue={width:this.#t.tooltip.offsetWidth,height:this.#t.tooltip.offsetHeight},this.#Oe()}),this.#c.observe(e.elements.tooltip));let t=e.elements.root.ownerDocument.documentElement;this.#s=ie(t,()=>{this.#H=null,this.#De()}),this.#he(),this.#Y.jump([1,1])}destroy(){this.#me=!0,this.#o?.disconnect(),this.#c?.disconnect(),this.#s?.(),this.#l?.(),this.#n.onSeriesChange=null,this.#n.onPresentationChange=null,this.#B!=null&&(clearTimeout(this.#B),this.#B=null),this.#pe!==0&&cancelAnimationFrame(this.#pe)}#he(){if(typeof matchMedia>`u`||this.#me)return;this.#l?.();let e=matchMedia(`(resolution: ${this.#je()}dppx)`),t=()=>{this.#f=this.#je(),this.#L.clear(),this.#De(),this.#he()};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.#N.clear(),t.animate&&!e.animate&&this.#ge(),t.dimensions!==e.dimensions){let t=[+(e.dimensions>=2),+(e.dimensions>=3)],n=xt(e.dimensions);if(this.#ye()===0||!this.#M)this.#Y.jump(t),this.#q=n,this.#J.jump([n.yaw,n.pitch]);else{let e=n.yaw+Math.round((this.#q.yaw-n.yaw)/(Math.PI*2))*Math.PI*2;this.#Y.aim(t,performance.now()),this.#J.jump([this.#q.yaw,this.#q.pitch]),this.#J.aim([e,n.pitch],performance.now())}}(t.xKey!==e.xKey||t.xScale!==e.xScale||t.zKey!==e.zKey||t.stacked!==e.stacked)&&(this.#b=!0),(t.yDomain[0]!==e.yDomain[0]||t.yDomain[1]!==e.yDomain[1])&&(this.#ne=null,this.#M&&(this.#ye()===0?this.#D.jump(this.#xe()):this.#D.aim(this.#xe(),performance.now()))),this.#De()}setCallbacks(e){this.#i=e}setRows(e){e!==this.#p&&(this.#p=e,this.#b=!0,this.#De())}flushIngest(){!this.#b||this.#me||(this.#b=!1,this.#_e())}setControlledActiveIndex(e){let t=this.#oe;this.#oe=null;let n=this.#ae!==void 0;if(this.#ae=e,e!==void 0){let n=t!=null&&t.index===e&&t.viaKeyboard;this.#at(e==null?null:this.#tt(e),{viaKeyboard:n,notify:!1})}else n&&this.#at(null,{viaKeyboard:!1,notify:!1});this.#Oe()}handlePointerMove(e,t){if(this.#X!=null){let n=e-this.#X.lastX,r=t-this.#X.lastY;(this.#X.moved||Math.abs(n)+Math.abs(r)>3)&&(this.#X.moved=!0,this.#q={yaw:this.#q.yaw+n*.008,pitch:Ce(this.#q.pitch+r*.008)},this.#J.jump([this.#q.yaw,this.#q.pitch]),this.#X.lastX=e,this.#X.lastY=t,this.#at(null,{viaKeyboard:!1,notify:!1}),this.#De());return}if(this.#ce=e,this.#le=t,this.#e===`scatter`){let n=this.#ft(e,t);this.#re=n?.seriesKey??null,this.#ne=n==null?null:{x:n.screenX,y:n.screenY},this.#at(n?.index??null,{viaKeyboard:!1,notify:!0});return}let n=this.#rt(e,t);this.#at(n,{viaKeyboard:!1,notify:!0})}handlePointerDown(e,t){if(this.#Z=!0,this.#Ce()){this.#X={lastX:e,lastY:t,moved:!1};return}this.handlePointerMove(e,t)}handlePointerUp(e,t){let n=this.#X;this.#X=null;let r=this.#Z;if(this.#Z=!1,n!=null){if(n.moved)return;this.handlePointerMove(e,t)}r&&this.handleActivate(e,t)}handlePointerLeave(){this.#ce=null,this.#le=null,this.#X=null,this.#Z=!1,this.#re=null,this.#ne=null,this.#at(null,{viaKeyboard:!1,notify:!0})}handleActivate(e,t){let n=this.#$e();if(n==null)return;let r=this.#et(n),i=this.#p[r];if(i==null)return;let a=this.#e===`scatter`?this.#re:e==null||t==null?null:this.#it(n,e,t);this.#i.onDatumActivate?.({index:r,xValue:this.#nt(n),datum:i,dataKey:a})}handleKeyDown(e){if(this.#m===0)return!1;let t=this.#m-1,n=this.#$e(),r=this.#I?Math.max(1,Math.floor(this.#m/Math.max(1,this.#U.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.#ce=null,this.#le=null,this.#re=null,this.#ne=null,this.#at(a,{viaKeyboard:!0,notify:!0}),!0)}invalidateColors(){this.#H=null,this.#De()}#ge(){this.#D.jump(this.#xe()),this.#O.jump(this.#Se()),this.#Y.jump([+(this.#r.dimensions>=2),+(this.#r.dimensions>=3)]);let e=xt(this.#r.dimensions);this.#q=e,this.#J.jump([e.yaw,e.pitch]);for(let e of this.#k.values())e.snap();for(let e of this.#A.values())e.snap();this.#R.alpha=this.#R.target,this.#De()}#_e(){let e=this.#p,{xKey:t,xScale:n}=this.#r,r=this.#n.seriesSpecs();this.#L.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:k(n,t);s!==void 0&&(a=!0),i[o]=typeof s==`string`||typeof s==`number`||s instanceof Date?s:String(s),r[o]=o}_(n===0||a,`${this.#Te()} 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:k(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)}_(e.length===0||i,`${this.#Te()} xKey "${t}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),_(!a||o,`${this.#Te()} 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=l===e.length,f=!0,p=new Int32Array(l);for(let e=0;e<l;e++){let t=c[e];t!=null&&(u[e]=t.x,Number.isInteger(t.x)||(f=!1),p[e]=t.source,t.source!==e&&(d=!1))}if(d)this.#_=null,this.#v=null;else{this.#_=p;let t=new Int32Array(e.length).fill(-1);for(let e=0;e<l;e++){let n=p[e];n!=null&&(t[n]=e)}this.#v=t}this.#m=l,this.#h=u,this.#g=[],this.#T=f}let a=!1;for(let e of this.#g)if(e instanceof Date&&ve(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.#Ce()&&(n===`linear`||n===`time`)&&o!=null&&s!=null&&c!=null&&l!=null&&o>c&&s>=l?(this.#R.target=1,this.#z=performance.now()):(o!==c||s!==l)&&(this.#R.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,m=-1/0,h=!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:k(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>m&&(m=s),Number.isInteger(s)||(h=!1))}_(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=m===-1/0?0:m,this.#w=h;let g=this.#r.zKey;if(this.#e===`scatter`&&g!=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:k(o,g);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))}_(u===0||i,`ScatterPlot.Root zKey "${g}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#G=t,this.#K=n===1/0?[0,1]:Z([n,r],5)}else this.#G=new Float64Array;this.#Q=null,this.#ne=null,this.#E=this.#r.stacked?pt(r.map(e=>this.#x.get(e.dataKey)??new Float64Array)):null,this.#I=ue({pointCount:u,columnCount:Math.max(1,Math.round(this.#U.width*this.#f)),wasDecimated:this.#I});let v=this.#H;if(v!=null){for(let e of this.#n.seriesMeta())if(v.inputs.get(e.dataKey)!==_t(e)){this.#H=null;break}}this.#ve(r,f,d);let y=this.#$e();y!=null&&this.#at(Math.min(y,Math.max(0,u-1)),{viaKeyboard:this.#se,notify:!1}),this.#lt({force:!0})}#ve(e,t,n){let r=performance.now(),i=this.#ye(),a=!this.#M;this.#M=this.#M||this.#m>0,a||i===0?(this.#D.jump(this.#xe()),this.#O.jump(this.#Se())):(this.#D.aim(this.#xe(),r),this.#O.aim(this.#Se(),r));let o=this.#m>0&&this.#m<=2500&&n,s=new Set,c=new Set,l=(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)=>{c.add(e.dataKey);let a=t.has(e.dataKey);if(this.#E==null?l(e.dataKey,this.#x.get(e.dataKey)??new Float64Array,a):(l(`${e.dataKey}:lower`,this.#E.lower[n]??new Float64Array,a),l(`${e.dataKey}:upper`,this.#E.upper[n]??new Float64Array,a)),!this.#A.has(e.dataKey)&&this.#m>0){let t=new ht;t.retarget([0],{duration:0,now:r}),t.retarget([1],{duration:i,now:r}),this.#A.set(e.dataKey,t)}});for(let e of this.#k.keys())s.has(e)||this.#k.delete(e);for(let e of this.#A.keys())c.has(e)||this.#A.delete(e)}#ye(){return!this.#r.animate||this.#be()?0:280}#be(){return typeof matchMedia>`u`?!1:(this.#j??=matchMedia(`(prefers-reduced-motion: reduce)`),this.#j.matches)}#xe(){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`?Ve([n,r],5):Z([n,r],5);return[typeof e==`number`?e:i[0],typeof t==`number`?t:i[1]]}#Se(){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`?Z([e,t],5):[e,t]}#Ce(){return this.#e===`scatter`&&this.#r.zKey!=null}#we(){return this.#e===`bar`&&this.#r.orientation===`horizontal`}#Te(){return`${vt[this.#e].split(`.`)[0]??`Chart`}.Root`}#Ee(e,t){let n=this.#V;n??(n=this.#t.canvas.ownerDocument.createElement(`canvas`),this.#V=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}}#De(){this.#fe=!0,this.#ke()}#Oe(){this.#ke()}#ke(){this.#de||this.#me||(this.#de=!0,this.#pe=requestAnimationFrame(()=>{this.#de=!1,this.#pe=0,this.#Ae()}))}#Ae(){if(!this.#me){if(this.flushIngest(),this.#fe){this.#fe=!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.#Y.tick(e)||t,this.#J.tick(e)){t=!0;let e=this.#J.values();this.#q={yaw:e[0]??this.#q.yaw,pitch:e[1]??this.#q.pitch}}this.#Me(),this.#Pe(),t=this.#Ve(e)||t,t&&this.#De()}this.#mt()}}#je(){return typeof devicePixelRatio==`number`&&devicePixelRatio>0?Math.min(devicePixelRatio,3):1}#Me(){let e=this.#t.root,t=`${re(e.ownerDocument.documentElement)}|${this.#f}|${this.#r.orientation}`;if(this.#H?.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=te(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=le(r,{texture:t.texture,color:n,ink:B(e,U(n)),devicePixelRatio:this.#f,orientation:this.#r.orientation});i!=null&&o.set(t.dataKey,i)}}this.#H={signature:t,series:i,inputs:a,barTextures:o,chrome:ne(e),fontFamily:n.getComputedStyle(e).fontFamily||`sans-serif`}}#Ne(e){let t=this.#H?.signature??``;t!==this.#te&&(this.#ee.clear(),this.#te=t);let n=this.#ee.get(e);if(n!=null)return n;let r=te(this.#t.root,e);return this.#ee.set(e,r),r}#Pe(){let e=this.#n.getSnapshot(),t=this.#Ce(),n=this.#we(),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.#U={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.#H!=null){e.font=`11px ${this.#H.fontFamily}`;let t=0,r=n?this.#Be().map(e=>e.text):this.#ze().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.#U={left:c,top:8,width:Math.max(0,this.#u-c-8),height:s};let l=n?this.#U.top:this.#U.left,u=n?this.#U.top+this.#U.height:this.#U.left+this.#U.width;this.#W=this.#r.xScale===`band`?Me({count:this.#m,rangeStart:l,rangeEnd:u,paddingInner:.2,paddingOuter:.1}):this.#r.xScale===`point`?Me({count:this.#m,rangeStart:l,rangeEnd:u,paddingInner:1,paddingOuter:.5}):null,this.#I=ue({pointCount:this.#m,columnCount:Math.max(1,Math.round(this.#U.width*this.#f)),wasDecimated:this.#I})}#Fe(){let e=this.#D.values();return je([e[0]??0,e[1]??1],[this.#U.top+this.#U.height,this.#U.top])}#Ie(){let e=this.#D.values(),t=this.#we()?[this.#U.left,this.#U.left+this.#U.width]:[this.#U.top+this.#U.height,this.#U.top];return je([e[0]??0,e[1]??1],t)}#Le(){let e=this.#O.values();return je([e[0]??0,e[1]??1],[this.#U.left,this.#U.left+this.#U.width])}#Re(e){let t=this.#W;if(t!=null)return X(t,e);let{k:n,b:r}=this.#Le();return(this.#h[e]??0)*n+r}#ze(){let e=this.#n.getSnapshot(),t=this.#D.values(),n=Fe([t[0]??0,t[1]??1],e.yAxis?.tickCount??5,{integer:this.#w}),r=e.yAxis?.tickFormat,i=n.length>1?he(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)}))}#Be(){let e=this.#n.getSnapshot(),t=e.xAxis?.tickFormat;if(this.#W!=null){let e=this.#we(),n=e?this.#U.height:this.#U.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.#U.width/90));if(this.#r.xScale===`time`){let e=Be(r);return ze(r,i).map(n=>({index:null,value:n,text:t==null?e(n):t(new Date(n))}))}let a=Fe(r,i,{integer:this.#T}),o=a.length>1?he(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)}))}#Ve(e){let t=this.#a,n=this.#H;if(t==null||n==null||this.#u<=0||this.#d<=0)return!1;let r=Math.min(50,Math.max(0,e-this.#F));this.#F=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.#U;if(c.width<=0||c.height<=0)return!1;let l=this.#Fe(),u=this.#Le(),d=this.#n.seriesSpecs(),f=this.#Ce(),p=this.#ye()===0,m=f?[]:this.#He(t,n.fontFamily),h=f?[]:this.#Ue(t,n.fontFamily),g=St(this.#N,m,r,p);g=St(this.#P,h,r,p)||g;let _=this.#R;if(_.target===1){if(e-this.#z>yt)_.target=0;else if(this.#B==null){let t=yt-(e-this.#z)+17;this.#B=setTimeout(()=>{this.#B=null,this.#De()},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.#we(),y=v?this.#Ie():l,b=e=>this.#W==null?e*u.k+u.b:X(this.#W,e),x=e=>e*y.k+y.b,S=[...this.#N.entries()].map(([e,t])=>({position:b(e),alpha:t.alpha})),C=[...this.#P.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.#Ee(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.#Ye(T,d):this.#Je(T,d,l):this.#e===`scatter`?D=this.#ut(T,d,l):this.#Xe(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.#Ne(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.#N.entries()].map(([e,t])=>({position:b(e),text:t.text,alpha:t.alpha})),k=s.yAxis==null||f?[]:[...this.#P.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}#He(e,t){e.font=`11px ${t}`;let n=this.#we(),r=this.#Le(),i=[],a=-1/0;for(let t of this.#Be()){let o=t.index!=null&&this.#W!=null,s=o&&this.#W!=null?X(this.#W,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}#Ue(e,t){let n=this.#ze();if(!this.#we())return n.map(e=>({key:e.value,text:e.text}));e.font=`11px ${t}`;let r=this.#Ie(),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}#We(e,t,n){let r=t===`value`?e.dataKey:`${e.dataKey}:${t}`;if(!this.#I&&this.#m<=2500){let e=this.#k.get(r);if(e!=null&&e.values().length===this.#m)return e.values()}return t===`value`?this.#x.get(e.dataKey)??new Float64Array:(t===`lower`?this.#E?.lower:this.#E?.upper)?.[n]??new Float64Array}#Ge(e){return this.#A.get(e)?.values()[0]??1}#Ke(e,t){if(e==null)return 0;let n=e[t]??0;return Number.isNaN(n)?0:n}#qe(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 P({lower:i,upper:a,pileOuter:c,toPixel:n})}#Je(e,t,n){let r=this.#W,i=this.#H;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=A({step:r.step,slot:c}),u=e=>e*n.k+n.b;t.forEach((t,n)=>{let d=this.#Ge(t.dataKey),f=[],p=a?this.#We(t,`lower`,n):null,m=a?this.#We(t,`upper`,n):this.#We(t,`value`,n);for(let e=0;e<this.#m;e++){let t=m[e]??NaN;if(Number.isNaN(t))continue;let i=this.#Ke(p,e),h=a?Y(r,e)+(r.bandwidth-l)/2:Y(r,e)+(r.bandwidth-(c*o+s*(o-1)))/2+n*(c+s)+(c-l)/2,g=N({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.#qe(n,e,u)})}Ge(e,{fill:i.barTextures.get(t.dataKey)??i.series.get(t.dataKey)??`currentColor`,rects:f})})}#Ye(e,t){let n=this.#W,r=this.#H;if(n==null||r==null||this.#m===0||t.length===0)return;let i=this.#Ie(),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=A({step:n.step,slot:c}),u=e=>e*i.k+i.b;t.forEach((t,i)=>{let d=this.#Ge(t.dataKey),f=[],p=a?this.#We(t,`lower`,i):null,m=a?this.#We(t,`upper`,i):this.#We(t,`value`,i);for(let e=0;e<this.#m;e++){let t=m[e]??NaN;if(Number.isNaN(t))continue;let r=this.#Ke(p,e),h=a?Y(n,e)+(n.bandwidth-l)/2:Y(n,e)+(n.bandwidth-(c*o+s*(o-1)))/2+i*(c+s)+(c-l)/2,g=N({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.#qe(i,e,u)})}Ke(e,{fill:r.barTextures.get(t.dataKey)??r.series.get(t.dataKey)??`currentColor`,rects:f})})}#Xe(e,t,n){let r=this.#H;if(r==null||this.#m===0)return;let i=this.#Le(),a=this.#W,o=e=>a==null?(this.#h[e]??0)*i.k+i.b:X(a,e);t.forEach((t,i)=>{let a=r.series.get(t.dataKey)??`currentColor`,s=this.#Ge(t.dataKey);if(e.save(),s<1&&(e.beginPath(),e.rect(this.#U.left,0,this.#U.width*s,this.#d),e.clip()),this.#I){this.#Ze(e,t,i,a,n),e.restore();return}let c=t.mark===`area`,l=this.#We(t,this.#E==null?`value`:`upper`,i),u=this.#E==null?null:this.#We(t,`lower`,i),d=e=>!Number.isNaN(l[e]??NaN),f=[];for(let e=0;e<this.#m;e++)(!t.connectNulls||d(e))&&f.push(e);let p=e=>(l[e]??0)*n.k+n.b;if(c){let r=u==null?()=>0*n.k+n.b:e=>(u[e]??0)*n.k+n.b;Je(e,{color:a,curve:t.curve,indexes:f,xAt:o,y0At:r,y1At:p,definedAt:d})}else qe(e,{color:a,curve:t.curve,indexes:f,xAt:o,yAt:p,definedAt:d}),t.markers&&this.#U.width/this.#m>=12&&rt(e,{color:a,surface:r.chrome.surface,shape:this.#n.seriesShape(t.dataKey),indexes:f,xAt:o,yAt:p,definedAt:d});e.restore()})}#Ze(e,t,n,r,i){let a=Math.max(1,Math.round(this.#U.width*this.#f)),o=e=>this.#U.left+(e+.5)/this.#f;if(t.mark===`area`){let s=this.#Qe(`${t.dataKey}:upper`,this.#We(t,this.#E==null?`value`:`upper`,n),a),c=this.#E==null?null:this.#Qe(`${t.dataKey}:lower`,this.#We(t,`lower`,n),a);c==null?Xe(e,{color:r,lowerColumns:Dt(s,0),upperColumns:s,columnToX:o,valueK:i.k,valueB:i.b}):Xe(e,{color:r,lowerColumns:c,upperColumns:s,columnToX:o,valueK:i.k,valueB:i.b});return}let s=this.#Qe(t.dataKey,this.#We(t,`value`,n),a);Ye(e,{color:r,columns:s,columnToX:o,valueK:i.k,valueB:i.b})}#Qe(e,t,n){let r=this.#O.values(),i=`${r[0]??0}:${r[1]??1}:${n}`,a=this.#L.get(e);if(a!=null&&a.key===i)return a.columns;let o=[r[0]??0,r[1]??1],s=je(o,[0,n]),c=de({xs:this.#h,values:t,startIndex:0,endIndex:this.#m-1,positionK:s.k,positionB:s.b,columnCount:n});return this.#L.set(e,{key:i,columns:c}),c}#$e(){if(this.#m===0)return null;let e;return e=this.#ae===void 0?this.#ie:this.#ae==null?null:this.#tt(this.#ae),e==null?null:Math.min(Math.max(0,e),this.#m-1)}#et(e){return this.#_==null?e:this.#_[e]??e}#tt(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}#nt(e){if(e<0||e>=this.#m)return``;let{xScale:t}=this.#r;if(t===`band`||t===`point`)return this.#g[e]??``;let n=this.#h[e]??0;return t===`time`?new Date(n):n}#rt(e,t){if(this.#m===0)return null;let n=this.#W;if(n!=null)return Pe(n,this.#we()?t:e);let{k:r,b:i}=this.#Le();if(r===0)return 0;let a=e;if(this.#I){let t=Math.floor((e-this.#U.left)*this.#f);a=this.#U.left+(t+.5)/this.#f}return ye(this.#h,this.#m,(a-i)/r)}#it(e,t,n){let r=this.#n.seriesSpecs(),i=this.#we(),a=this.#W;if(this.#e===`bar`&&this.#E==null&&a!=null&&r.length>1){let o=(i?n:t)-Y(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.#Ie():this.#Fe(),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}#at(e,t){let n=e==null||this.#m===0?null:Math.min(Math.max(0,e),this.#m-1),r=this.#ae!==void 0;if(t.notify&&n!==this.#$e()){let e=n==null?null:this.#et(n);if(this.#i.onActiveIndexChange?.(e),r){this.#oe={index:e,viaKeyboard:t.viaKeyboard};return}}this.#se=t.viaKeyboard,r||(this.#ie=n),this.#lt(),this.#Oe()}#ot=null;#st=!1;#ct=null;#lt(e={force:!1}){let t=this.#$e();if(!e.force&&t===this.#ot&&this.#se===this.#st&&this.#re===this.#ct)return;if(this.#ot=t,this.#st=this.#se,this.#ct=this.#re,t==null||this.#m===0){this.#n.publishHover(null);return}let n=this.#et(t),r=this.#p[n]??{},i=this.#n.getSnapshot().series.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.#re==null?i.filter(e=>e.value!=null):i.filter(e=>e.dataKey===this.#re));let a={index:n,xValue:this.#nt(t),datum:r,points:i,viaKeyboard:this.#se};if(this.#Ce()){let e=this.#G[t]??NaN;a.zValue=Number.isNaN(e)?null:e}this.#n.publishHover(a)}#ut(e,t,n){let r=this.#H;if(r==null||this.#m===0||t.length===0)return null;if(this.#Ce())return this.#dt(e,t);let i=this.#Le(),a=t.map((e,t)=>{let n=this.#We(e,`value`,t),r=[];for(let e=0;e<this.#m;e++)Number.isNaN(n[e]??NaN)||r.push(e);return r}),o=a.reduce((e,t)=>e+t.length,0);return t.forEach((t,s)=>{let c=this.#We(t,`value`,s),l=a[s]??[];e.save(),e.globalAlpha=this.#Ge(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}#dt(e,t){let n=this.#H;if(n==null)return null;let r=this.#U,i=xe(this.#q),a=r.left+r.width/2,o=r.top+r.height/2,s=this.#Y.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.#K,_=t.map(e=>this.#Ge(e.dataKey)),v=this.#Y.values(),y=v[0]??1,b=v[1]??1,x=(e,t,n)=>{let r=Se(e,t,n,i);return{x:a+r.x*d,y:o-r.y*d}},S=we.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:Te,cubeAlpha:b,axes:T});let E=this.#m*t.length,D=this.#Q;(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.#We(e,`value`,t);for(let e=0;e<this.#m;e++){let r=n[e]??NaN,s=this.#G[e]??NaN;if(Number.isNaN(r)||Number.isNaN(s))continue;let c=Se(q(this.#h[e]??0,p),q(r,h)*y,q(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.#Q=D,this.#$.length<k&&(this.#$=new Int32Array(E));let A=this.#$.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}}#ft(e,t){let n=this.#n.seriesSpecs(),r=576,i=null;if(this.#Ce()){let a=this.#Q;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.#Le(),o=this.#Fe();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}#pt(e){let t=this.#n.seriesSpecs();if(this.#Ce()){let t=this.#Q;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.#Le(),r=this.#Fe();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}#mt(){let{crosshair:e,band:t,markers:n,tooltip:r}=this.#t,i=this.#$e(),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.#U;if(s){let e=this.#ne??this.#pt(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.getSnapshot().series,r=this.#re==null?n.find(e=>{let t=this.#x.get(e.dataKey)?.[i]??NaN;return!Number.isNaN(t)}):n.find(e=>e.dataKey===this.#re);t.style.opacity=`1`,Tt(t,r?.shape??`circle`,r?.color??`currentColor`),t.style.transform=`translate3d(${e.x}px, ${e.y}px, 0)`}this.#ht(e.x,e.y);return}let l=this.#Re(i),u=this.#we();if(o){let e=this.#W;if(e!=null){let n=Ne(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.getSnapshot().series;for(;n.children.length>t.length;)n.lastElementChild?.remove();for(;n.children.length<t.length;)n.appendChild(wt(n.ownerDocument));let r=this.#Fe();t.forEach((e,t)=>{let a=n.children[t];if(!(a instanceof HTMLElement))return;let o=this.#x.get(e.dataKey)?.[i]??NaN,s=this.#We(e,this.#E==null?`value`:`upper`,t)[i]??NaN;if(Number.isNaN(o)||Number.isNaN(s)){a.style.opacity=`0`;return}a.style.opacity=`1`,Tt(a,e.shape,e.color),a.style.transform=`translate3d(${l}px, ${s*r.k+r.b}px, 0)`})}o&&u&&this.#W!=null?this.#ht(this.#ce??c.left+c.width/2,X(this.#W,i)):this.#ht(l,this.#le??c.top+8)}#ht(e,t){let n=this.#U,r=this.#t.tooltip,i=this.#ue,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(k(e,t)),...n.map(t=>At(k(e,t.dataKey))),...r==null?[]:[At(k(e,r))]]);return[jt(i),jt(i.map(()=>`---`)),...a.map(e=>jt(e))].join(`
2
+ `)},Nt=(e,t)=>e==null?`var(${L(t)})`:I(e)?`var(${L(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=ee.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){return this.#t.series.find(t=>t.dataKey===e)?.shape??Pt[`chart-other`]}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?R:Nt(e.color,n),i=this.#o?R: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=l(null),Bt=e=>{let t=u(zt);return _(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},Vt=e=>g(e.subscribe,e.getSnapshot,e.getSnapshot),Ht=e=>{let t=c(3),n,r;return t[0]===e?(n=t[1],r=t[2]):(n=()=>e.getSnapshot().series,r=()=>e.getSnapshot().series,t[0]=e,t[1]=n,t[2]=r),g(e.subscribe,n,r)},Ut=e=>{let t=c(3),n,r;return t[0]===e?(n=t[1],r=t[2]):(n=()=>e.getSnapshot().orientation,r=()=>e.getSnapshot().orientation,t[0]=e,t[1]=n,t[2]=r),g(e.subscribe,n,r)},Wt=(e,t)=>{let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.hasOwn(t,n)&&Object.is(Reflect.get(e,n),Reflect.get(t,n)))},Gt=e=>{let[t,n]=h(e);return Wt(t,e)?t:(n(e),e)},Kt=(e,t)=>{for(let n of e){let e=k(n,t);if(e!=null)return e instanceof Date?`time`:typeof e==`number`?`linear`:`point`}return`point`},qt=[`auto`,`auto`],Jt=t=>{let i=c(133),a,o,s,l,u,d,g,x,S,C,w,T,E,D,O,A,j,M,N,P,F,I,L,R,ee,z;i[0]===t?(a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],d=i[6],g=i[7],x=i[8],S=i[9],C=i[10],w=i[11],T=i[12],E=i[13],D=i[14],O=i[15],A=i[16],j=i[17],M=i[18],N=i[19],P=i[20],F=i[21],I=i[22],L=i[23],R=i[24],ee=i[25],z=i[26]):({kind:C,componentName:g,slotName:O,data:x,xKey:R,xScale:ee,zKey:z,dimensions:A,yDomain:j,stacked:M,orientation:N,animate:P,pending:F,decorative:I,activeIndex:a,onActiveIndexChange:w,onDatumActivate:T,className:d,children:u,ref:D,"data-slot":S,"aria-label":s,"aria-labelledby":l,"aria-hidden":o,tabIndex:L,...E}=t,i[0]=t,i[1]=a,i[2]=o,i[3]=s,i[4]=l,i[5]=u,i[6]=d,i[7]=g,i[8]=x,i[9]=S,i[10]=C,i[11]=w,i[12]=T,i[13]=E,i[14]=D,i[15]=O,i[16]=A,i[17]=j,i[18]=M,i[19]=N,i[20]=P,i[21]=F,i[22]=I,i[23]=L,i[24]=R,i[25]=ee,i[26]=z);let B=A===void 0?3:A,te=j===void 0?qt:j,ne=M!==void 0&&M,re=N===void 0?`vertical`:N,ie=P===void 0||P,ae=F!==void 0&&F,V=I!==void 0&&I,[H]=h(mn),U=m(null),W;i[27]!==x||i[28]!==R||i[29]!==z?(W={data:x,xKey:R,zKey:z},i[27]=x,i[28]=R,i[29]=z,i[30]=W):W=i[30];let oe=m(W),se;i[31]!==g||i[32]!==C||i[33]!==H?(se=()=>({kind:C,componentName:g,store:H,engineRef:U,dataRef:oe}),i[31]=g,i[32]=C,i[33]=H,i[34]=se):se=i[34];let[ce]=h(se),le,ue;i[35]!==x||i[36]!==R||i[37]!==z?(le=()=>{oe.current={data:x,xKey:R,zKey:z}},ue=[x,R,z],i[35]=x,i[36]=R,i[37]=z,i[38]=le,i[39]=ue):(le=i[38],ue=i[39]),p(le,ue);let de=m(null),fe=e(de,D),pe=m(null),me=m(null),G=m(null),he=m(null),ge=m(null),_e=m(null),K=f(),ye;i[40]!==x||i[41]!==C||i[42]!==R||i[43]!==ee?(ye=C===`bar`?`band`:ee??Kt(x,R),i[40]=x,i[41]=C,i[42]=R,i[43]=ee,i[44]=ye):ye=i[44];let be=ye;_(C!==`scatter`||x.length===0||be!==`point`,`${g}.Root requires numeric or Date x values — the "${R}" values are not numbers or dates, so they have no position on a continuous scatter axis.`);let[xe,Se]=te,Ce;bb0:{for(let e of x){let t=k(e,R);if(t instanceof Date&&ve(t)){Ce=!0;break bb0}}Ce=!1}let q=Ce,we,Te;i[45]!==C||i[46]!==H?(we=()=>{let e=de.current,t=pe.current,n=me.current,r=G.current,i=he.current,a=ge.current,o=_e.current;if(e==null||t==null||n==null||r==null||i==null||a==null||o==null)return;let s=new bt({kind:C,store:H,elements:{root:e,plot:t,canvas:n,crosshair:r,band:i,markers:a,tooltip:o}});return U.current=s,()=>{U.current=null,s.destroy()}},Te=[C,H],i[45]=C,i[46]=H,i[47]=we,i[48]=Te):(we=i[47],Te=i[48]),p(we,Te);let Ee,De;i[49]!==ie||i[50]!==V||i[51]!==B||i[52]!==re||i[53]!==be||i[54]!==ne||i[55]!==H||i[56]!==R||i[57]!==Se||i[58]!==xe||i[59]!==z?(Ee=()=>{U.current?.setOptions({xKey:R,xScale:be,yDomain:[xe,Se],zKey:z??null,dimensions:B,stacked:ne,orientation:re,animate:ie}),H.setOrientation(re),H.setDecorative(V)},De=[H,V,R,be,xe,Se,z,B,ne,re,ie],i[49]=ie,i[50]=V,i[51]=B,i[52]=re,i[53]=be,i[54]=ne,i[55]=H,i[56]=R,i[57]=Se,i[58]=xe,i[59]=z,i[60]=Ee,i[61]=De):(Ee=i[60],De=i[61]),p(Ee,De);let Oe,J;i[62]===x?(Oe=i[63],J=i[64]):(Oe=()=>{U.current?.setRows(x)},J=[x],i[62]=x,i[63]=Oe,i[64]=J),p(Oe,J);let ke;i[65]!==V||i[66]!==w||i[67]!==T?(ke=()=>{U.current?.setCallbacks(V?{onDatumActivate:null,onActiveIndexChange:null}:{onDatumActivate:T??null,onActiveIndexChange:w??null})},i[65]=V,i[66]=w,i[67]=T,i[68]=ke):ke=i[68],p(ke);let Ae,je;i[69]!==a||i[70]!==V?(Ae=()=>{U.current?.setControlledActiveIndex(V?void 0:a)},je=[V,a],i[69]=a,i[70]=V,i[71]=Ae,i[72]=je):(Ae=i[71],je=i[72]),p(Ae,je);let Me;i[73]===Symbol.for(`react.memo_cache_sentinel`)?(Me=()=>{U.current?.flushIngest()},i[73]=Me):Me=i[73],p(Me);let Y;i[74]!==S||i[75]!==O?(Y=r(S,O),i[74]=S,i[75]=O,i[76]=Y):Y=i[76];let X;i[77]===d?X=i[78]:(X=n(`relative flex aspect-video w-full flex-col`,d),i[77]=d,i[78]=X);let Ne=V?!0:o,Pe=V?void 0:L,Fe=V?!0:void 0,Ie=`${O}-plot`,Le=ae&&`opacity-60 transition-opacity duration-300`,Re;i[79]===Le?Re=i[80]:(Re=n(`relative min-h-0 w-full flex-1`,Le),i[79]=Le,i[80]=Re);let ze=`${O}-canvas`,Be;i[81]===ze?Be=i[82]:(Be=y(`canvas`,{"data-slot":ze,ref:me,"aria-hidden":!0,className:`absolute inset-0 size-full`}),i[81]=ze,i[82]=Be);let Z;i[83]!==s||i[84]!==l||i[85]!==V||i[86]!==K||i[87]!==C||i[88]!==z?(Z=V?null:b(v,{children:[y(`div`,{role:`application`,"aria-label":s,"aria-labelledby":l,"aria-describedby":K,tabIndex:0,className:n(`focus-visible:ring-focus-accent absolute inset-0 rounded-sm outline-none focus-visible:ring-2`,(C===`line`||C===`area`)&&`cursor-crosshair`,C===`scatter`&&z!=null&&`touch-none cursor-grab active:cursor-grabbing`),onPointerDown:e=>{e.isTrusted&&C===`scatter`&&z!=null&&e.currentTarget.setPointerCapture(e.pointerId),U.current?.handlePointerDown(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerMove:e=>{U.current?.handlePointerMove(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerUp:e=>{U.current?.handlePointerUp(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerLeave:()=>{U.current?.handlePointerLeave()},onPointerCancel:()=>{U.current?.handlePointerLeave()},onBlur:()=>{U.current?.handlePointerLeave()},onKeyDown:e=>{U.current?.handleKeyDown(e.key)&&e.preventDefault()}}),y(`span`,{id:K,className:`sr-only`,children:`Use the left and right arrow keys to move between data points, Page Up and Page Down to jump by a tenth of the data, Home and End to jump to the first and last, Enter or Space to activate the current point, and Escape to dismiss the readout.`})]}),i[83]=s,i[84]=l,i[85]=V,i[86]=K,i[87]=C,i[88]=z,i[89]=Z):Z=i[89];let Ve=`${O}-crosshair`,Q;i[90]===Ve?Q=i[91]:(Q=y(`div`,{"data-slot":Ve,ref:G,"aria-hidden":!0,className:`bg-neutral-500 pointer-events-none absolute left-0 top-0 w-px opacity-0`}),i[90]=Ve,i[91]=Q);let $=`${O}-hover-band`,He;i[92]===$?He=i[93]:(He=y(`div`,{"data-slot":$,ref:he,"aria-hidden":!0,className:`bg-neutral-500/10 pointer-events-none absolute left-0 top-0 rounded-sm opacity-0`}),i[92]=$,i[93]=He);let Ue=`${O}-markers`,We;i[94]===Ue?We=i[95]:(We=y(`div`,{"data-slot":Ue,ref:ge,"aria-hidden":!0,className:`pointer-events-none absolute inset-0 opacity-0`}),i[94]=Ue,i[95]=We);let Ge;i[96]!==O||i[97]!==H||i[98]!==q?(Ge=y(nn,{slotName:O,store:H,tooltipRef:_e,xHasTimeOfDay:q}),i[96]=O,i[97]=H,i[98]=q,i[99]=Ge):Ge=i[99];let Ke;i[100]!==Ie||i[101]!==Re||i[102]!==Be||i[103]!==Z||i[104]!==Q||i[105]!==He||i[106]!==We||i[107]!==Ge?(Ke=b(`div`,{"data-slot":Ie,className:Re,ref:pe,children:[Be,Z,Q,He,We,Ge]}),i[100]=Ie,i[101]=Re,i[102]=Be,i[103]=Z,i[104]=Q,i[105]=He,i[106]=We,i[107]=Ge,i[108]=Ke):Ke=i[108];let qe;i[109]!==s||i[110]!==l||i[111]!==x||i[112]!==V||i[113]!==O||i[114]!==H||i[115]!==q||i[116]!==R||i[117]!==z?(qe=V?null:b(v,{children:[y(dn,{store:H,xHasTimeOfDay:q}),y(pn,{data:x,label:s,labelledBy:l,slotName:O,store:H,xHasTimeOfDay:q,xKey:R,zKey:z})]}),i[109]=s,i[110]=l,i[111]=x,i[112]=V,i[113]=O,i[114]=H,i[115]=q,i[116]=R,i[117]=z,i[118]=qe):qe=i[118];let Je;i[119]!==u||i[120]!==ce||i[121]!==Ke||i[122]!==qe?(Je=b(zt.Provider,{value:ce,children:[Ke,u,qe]}),i[119]=u,i[120]=ce,i[121]=Ke,i[122]=qe,i[123]=Je):Je=i[123];let Ye;return i[124]!==fe||i[125]!==E||i[126]!==Y||i[127]!==X||i[128]!==Ne||i[129]!==Pe||i[130]!==Fe||i[131]!==Je?(Ye=y(`div`,{"data-slot":Y,className:X,"aria-hidden":Ne,tabIndex:Pe,inert:Fe,ref:fe,...E,children:Je}),i[124]=fe,i[125]=E,i[126]=Y,i[127]=X,i[128]=Ne,i[129]=Pe,i[130]=Fe,i[131]=Je,i[132]=Ye):Ye=i[132],Ye},Yt=(e,t,n)=>{let r=c(13),i=Bt(e);_(i.kind===t,`${e} cannot be composed inside ${i.componentName}.Root — compose ${i.componentName} series parts instead.`);let{dataKey:a,label:o,seriesSlot:s,color:l,curve:u,markers:d,connectNulls:f,shape:m,texture:h}=n,g=u===void 0?`linear`:u,v=d!==void 0&&d,y=f!==void 0&&f,b=h===void 0?`solid`:h,x,S;return r[0]!==l||r[1]!==y||r[2]!==i.store||r[3]!==g||r[4]!==a||r[5]!==o||r[6]!==t||r[7]!==v||r[8]!==s||r[9]!==m||r[10]!==b?(x=()=>i.store.registerSeries({dataKey:a,label:o??a,seriesSlot:s,color:l,mark:t,curve:g,markers:v,connectNulls:y,shape:m,texture:b}),S=[i.store,a,o,s,l,t,g,v,y,m,b],r[0]=l,r[1]=y,r[2]=i.store,r[3]=g,r[4]=a,r[5]=o,r[6]=t,r[7]=v,r[8]=s,r[9]=m,r[10]=b,r[11]=x,r[12]=S):(x=r[11],S=r[12]),p(x,S),null},Xt=(e,t)=>{let n=c(4),r=Bt(e),{lines:i}=t,a,o;return n[0]!==r.store||n[1]!==i?(a=()=>r.store.registerGrid(i),o=[r.store,i],n[0]=r.store,n[1]=i,n[2]=a,n[3]=o):(a=n[2],o=n[3]),p(a,o),null},Zt=(e,t)=>{let n=c(5),r=Bt(e),{tickFormat:i,tickCount:a}=t,o,s;return n[0]!==r.store||n[1]!==a||n[2]!==i?(o=()=>r.store.registerXAxis({tickFormat:i,tickCount:a}),s=[r.store,i,a],n[0]=r.store,n[1]=a,n[2]=i,n[3]=o,n[4]=s):(o=n[3],s=n[4]),p(o,s),null},Qt=(e,t)=>{let n=c(5),r=Bt(e),{tickFormat:i,tickCount:a}=t,o,s;return n[0]!==r.store||n[1]!==a||n[2]!==i?(o=()=>r.store.registerYAxis({tickFormat:i,tickCount:a}),s=[r.store,i,a],n[0]=r.store,n[1]=a,n[2]=i,n[3]=o,n[4]=s):(o=n[3],s=n[4]),p(o,s),null},$t=(e,t)=>{let n=c(7),r=Bt(e),i=f(),{y:a,label:o,color:s}=t,l,u;return n[0]!==s||n[1]!==r.store||n[2]!==i||n[3]!==o||n[4]!==a?(l=()=>r.store.registerReferenceLine(i,{y:a,label:o,color:s}),u=[r.store,i,a,o,s],n[0]=s,n[1]=r.store,n[2]=i,n[3]=o,n[4]=a,n[5]=l,n[6]=u):(l=n[5],u=n[6]),p(l,u),null},en=(e,t)=>{let n=c(16),r=Bt(e),i,a,o,s,l,u;n[0]===t?(i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],u=n[6]):({labelFormat:s,valueFormat:u,indicator:l,footer:o,children:i,...a}=t,n[0]=t,n[1]=i,n[2]=a,n[3]=o,n[4]=s,n[5]=l,n[6]=u);let d=l===void 0?`line`:l,f=Gt(a),m,h;return n[7]!==i||n[8]!==r.store||n[9]!==o||n[10]!==d||n[11]!==s||n[12]!==f||n[13]!==u?(m=()=>r.store.registerTooltip({labelFormat:s,valueFormat:u,indicator:d,footer:o,children:i,divProps:f}),h=[r.store,s,u,d,o,i,f],n[7]=i,n[8]=r.store,n[9]=o,n[10]=d,n[11]=s,n[12]=f,n[13]=u,n[14]=m,n[15]=h):(m=n[14],h=n[15]),p(m,h),null},tn=(e,t,n)=>e==null?`—`:n==null?G(e):n(e,t),nn=r=>{let i=c(26),{slotName:a,store:o,tooltipRef:s,xHasTimeOfDay:l}=r,u=Vt(o),d=u.tooltip,f=u.hover,h;i[0]===d?.divProps?h=i[1]:(h=d?.divProps??{},i[0]=d?.divProps,i[1]=h);let g,_,x,S;i[2]===h?(g=i[3],_=i[4],x=i[5],S=i[6]):({className:g,ref:_,style:S,...x}=h,i[2]=h,i[3]=g,i[4]=_,i[5]=x,i[6]=S);let C=m(null),w=e(s,C),T,E;i[7]===_?(T=i[8],E=i[9]):(T=()=>{if(_==null)return;let e=t(_),n=e(C.current);return()=>{typeof n==`function`?n():e(null)}},E=[_],i[7]=_,i[8]=T,i[9]=E),p(T,E);let D=d?.footer,O=`${a}-tooltip`,k;i[10]===g?k=i[11]:(k=n(`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`,g),i[10]=g,i[11]=k);let A;i[12]===S?A=i[13]:(A={opacity:0,...S},i[12]=S,i[13]=A);let j=A,M;i[14]!==d||i[15]!==D||i[16]!==f||i[17]!==l?(M=f==null?null:d?.children==null?b(v,{children:[y(`div`,{className:`text-muted font-medium`,children:d?.labelFormat==null?K(f.xValue,{datasetHasTimeOfDay:l}):d.labelFormat(f.xValue)}),y(`div`,{className:`mt-1 grid gap-1`,children:f.points.map(e=>b(`div`,{className:`flex items-center gap-1.5`,children:[d?.indicator===`none`?null:y(`span`,{"aria-hidden":!0,className:`h-2.5 w-0.5 shrink-0 rounded-full`,style:{backgroundColor:e.color}}),y(`span`,{className:`text-muted`,children:e.label}),y(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:tn(e.value,e.dataKey,d?.valueFormat)})]},e.dataKey))}),f.zValue===void 0?null:b(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[y(`span`,{className:`text-muted`,children:`z`}),y(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:f.zValue==null?`—`:G(f.zValue)})]}),D==null?null:y(`div`,{className:`text-muted mt-1`,children:typeof D==`function`?D(f):D})]}):d.children(f),i[14]=d,i[15]=D,i[16]=f,i[17]=l,i[18]=M):M=i[18];let N;return i[19]!==w||i[20]!==x||i[21]!==O||i[22]!==k||i[23]!==j||i[24]!==M?(N=y(`div`,{"data-slot":O,ref:w,className:k,style:j,...x,children:M}),i[19]=w,i[20]=x,i[21]=O,i[22]=k,i[23]=j,i[24]=M,i[25]=N):N=i[25],N},rn=(e,t,n=3)=>`repeating-linear-gradient(${e}, ${t} 0, ${t} 1px, transparent 1px, transparent ${n}px)`,an=`forced-color-adjust-none [print-color-adjust:exact] [-webkit-print-color-adjust:exact]`,on={hatch:({ink:e})=>({backgroundImage:rn(`135deg`,e)}),"hatch-reverse":({ink:e})=>({backgroundImage:rn(`45deg`,e)}),crosshatch:({ink:e})=>({backgroundImage:`${rn(`135deg`,e,4)}, ${rn(`45deg`,e,4)}`}),perpendicular:({ink:e,orientation:t})=>({backgroundImage:rn(t===`horizontal`?`90deg`:`0deg`,e)}),parallel:({ink:e,orientation:t})=>({backgroundImage:rn(t===`horizontal`?`0deg`:`90deg`,e)}),grid:({ink:e})=>({backgroundImage:`${rn(`0deg`,e,4)}, ${rn(`90deg`,e,4)}`}),dots:({ink:e})=>({backgroundImage:`radial-gradient(circle at 1px 1px, ${e} 0.75px, transparent 0.8px)`,backgroundSize:`3px 3px`})},sn=(e,t,n)=>e===`solid`?{}:on[e]({ink:U(t),orientation:n}),cn=e=>{let t=c(31),{series:r,orientation:i}=e;if(r.mark===`bar`){let e=r.texture,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=n(`size-2 shrink-0 rounded-[2px]`,an),t[0]=a):a=t[0];let o=r.color,s;t[1]!==i||t[2]!==r.color||t[3]!==r.texture?(s=sn(r.texture,r.color,i),t[1]=i,t[2]=r.color,t[3]=r.texture,t[4]=s):s=t[4];let c;t[5]!==r.color||t[6]!==s?(c={backgroundColor:o,...s},t[5]=r.color,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==r.texture||t[9]!==c?(l=y(`span`,{"aria-hidden":!0,"data-texture":e,className:a,style:c}),t[8]=r.texture,t[9]=c,t[10]=l):l=t[10],l}if(r.mark===`line`){let e;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=n(`absolute inset-x-0 top-1/2 h-0.5 -translate-y-1/2 rounded-full`,an),t[11]=e):e=t[11];let i;t[12]===r.color?i=t[13]:(i=y(`span`,{className:e,style:{backgroundColor:r.color}}),t[12]=r.color,t[13]=i);let a=r.shape,o;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(o=n(`relative size-2`,an),t[14]=o):o=t[14];let s=Ct[r.shape],c;t[15]!==r.color||t[16]!==s?(c={backgroundColor:r.color,clipPath:s},t[15]=r.color,t[16]=s,t[17]=c):c=t[17];let l;t[18]!==r.shape||t[19]!==c?(l=y(`span`,{"data-shape":a,className:o,style:c}),t[18]=r.shape,t[19]=c,t[20]=l):l=t[20];let u;return t[21]!==i||t[22]!==l?(u=b(`span`,{"aria-hidden":!0,className:`relative flex h-2 w-3 shrink-0 items-center justify-center`,children:[i,l]}),t[21]=i,t[22]=l,t[23]=u):u=t[23],u}let a=r.shape,o;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(o=n(`size-2 shrink-0`,an),t[24]=o):o=t[24];let s=Ct[r.shape],l;t[25]!==r.color||t[26]!==s?(l={backgroundColor:r.color,clipPath:s},t[25]=r.color,t[26]=s,t[27]=l):l=t[27];let u;return t[28]!==r.shape||t[29]!==l?(u=y(`span`,{"aria-hidden":!0,"data-shape":a,className:o,style:l}),t[28]=r.shape,t[29]=l,t[30]=u):u=t[30],u},ln=e=>{let t=c(17),r,i,a,o,s;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4],s=t[5]):({partName:a,slotName:s,className:i,children:r,...o}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s);let l=Bt(a),u=Ht(l.store),d=Ut(l.store);if(u.length<2)return null;let f=`${s}-legend`,p;t[6]===i?p=t[7]:(p=n(`text-muted flex flex-wrap items-center gap-x-4 gap-y-1 pt-3 text-xs`,i),t[6]=i,t[7]=p);let m;t[8]!==r||t[9]!==d||t[10]!==u?(m=r==null?u.map(e=>b(`div`,{className:`flex items-center gap-1.5`,children:[y(cn,{series:e,orientation:d}),e.label]},e.dataKey)):r(u),t[8]=r,t[9]=d,t[10]=u,t[11]=m):m=t[11];let h;return t[12]!==o||t[13]!==f||t[14]!==p||t[15]!==m?(h=y(`div`,{"data-slot":f,className:p,...o,children:m}),t[12]=o,t[13]=f,t[14]=p,t[15]=m,t[16]=h):h=t[16],h},un=e=>{let t=c(31),n,r,l,u,f,p,g,_;t[0]===e?(n=t[1],r=t[2],l=t[3],u=t[4],f=t[5],p=t[6],g=t[7],_=t[8]):({partName:u,slotName:g,label:_,onCopy:r,onCopyError:l,onClick:n,ref:p,...f}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=l,t[4]=u,t[5]=f,t[6]=p,t[7]=g,t[8]=_);let C=_===void 0?`Copy data as Markdown`:_,w=Bt(u),T=a(),[E,D]=h(``),O=E!==``,k=m(!1),A=m(void 0),j,M;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>()=>{A.current!=null&&clearTimeout(A.current)},M=[],t[9]=j,t[10]=M):(j=t[9],M=t[10]),d(j,M);let N=`${g}-copy-button`,P;t[11]===O?P=t[12]:(P=y(O?x:S,{}),t[11]=O,t[12]=P);let F;t[13]!==w||t[14]!==T||t[15]!==n||t[16]!==r||t[17]!==l?(F=async e=>{try{if(n?.(e),e.defaultPrevented){A.current!=null&&(clearTimeout(A.current),A.current=void 0),D(``);return}let{data:t,xKey:i,zKey:a}=w.dataRef.current,s=Mt({data:t,xKey:i,zKey:a,series:w.store.getSnapshot().series});await T(s),r?.(s),D(o(`Copied`,k)),A.current!=null&&clearTimeout(A.current),A.current=setTimeout(()=>{D(``)},2e3)}catch(e){l?.(e)}},t[13]=w,t[14]=T,t[15]=n,t[16]=r,t[17]=l,t[18]=F):F=t[18];let I;t[19]!==C||t[20]!==f||t[21]!==p||t[22]!==N||t[23]!==P||t[24]!==F?(I=y(i,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,"data-slot":N,label:C,icon:P,ref:p,onClick:F,...f}),t[19]=C,t[20]=f,t[21]=p,t[22]=N,t[23]=P,t[24]=F,t[25]=I):I=t[25];let L;t[26]===E?L=t[27]:(L=y(s,{children:E}),t[26]=E,t[27]=L);let R;return t[28]!==I||t[29]!==L?(R=b(v,{children:[I,L]}),t[28]=I,t[29]=L,t[30]=R):R=t[30],R},dn=e=>{let t=c(6),{store:n,xHasTimeOfDay:r}=e,i=Vt(n),[a,o]=h(``),s=i.hover,l,u;t[0]!==s||t[1]!==r?(l=()=>{if(s==null||!s.viaKeyboard){o(``);return}let e=s.points.map(hn).join(`, `),t=s.zValue===void 0?``:`, z: ${s.zValue==null?`no data`:G(s.zValue)}`,n=setTimeout(()=>{o(`${K(s.xValue,{datasetHasTimeOfDay:r})}. ${e}${t}`)},120);return()=>clearTimeout(n)},u=[s,r],t[0]=s,t[1]=r,t[2]=l,t[3]=u):(l=t[2],u=t[3]),d(l,u);let f;return t[4]===a?f=t[5]:(f=y(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:a}),t[4]=a,t[5]=f),f},fn=(e,t)=>{let n=c(3),[r,i]=h(void 0),a,o;return n[0]===t?(a=n[1],o=n[2]):(a=()=>{if(t==null){i(void 0);return}let e=t.split(/\s+/).map(gn).filter(Boolean).join(` `);i(e||void 0)},o=[t],n[0]=t,n[1]=a,n[2]=o),d(a,o),e??r},pn=e=>{let t=c(39),{data:n,label:r,labelledBy:i,slotName:a,store:o,xHasTimeOfDay:s,xKey:l,zKey:u}=e,d=Ht(o),f=fn(r,i);if(n.length===0||d.length===0)return null;let p,m,h,g,_;if(t[0]!==n||t[1]!==f||t[2]!==d||t[3]!==a||t[4]!==s||t[5]!==l||t[6]!==u){let e=n.slice(0,150);g=`sr-only`,_=`${a}-data-table`;let r=`${f==null?`Chart data`:`${f} — chart data`}${n.length>150?`. Showing the first 150 of ${n.length} rows.`:`.`}`;t[12]===r?m=t[13]:(m=y(`caption`,{children:r}),t[12]=r,t[13]=m);let i;t[14]===l?i=t[15]:(i=y(`th`,{scope:`col`,children:l}),t[14]=l,t[15]=i);let o;t[16]===d?o=t[17]:(o=d.map(_n),t[16]=d,t[17]=o);let c;t[18]===u?c=t[19]:(c=u==null?null:y(`th`,{scope:`col`,children:u}),t[18]=u,t[19]=c),t[20]!==i||t[21]!==o||t[22]!==c?(h=y(`thead`,{children:b(`tr`,{children:[i,o,c]})}),t[20]=i,t[21]=o,t[22]=c,t[23]=h):h=t[23];let v;t[24]!==d||t[25]!==s||t[26]!==l||t[27]!==u?(v=(e,t)=>{let n=k(e,l),r=n instanceof Date&&!Number.isNaN(n.getTime()),i=typeof n==`string`||typeof n==`number`||n instanceof Date?K(n,{datasetHasTimeOfDay:s}):String(n);return b(`tr`,{children:[y(`th`,{scope:`row`,"data-value":typeof n==`number`&&Number.isFinite(n)?n:void 0,children:r?y(`time`,{dateTime:n.toISOString(),children:i}):i}),d.map(t=>{let n=k(e,t.dataKey),r=typeof n==`number`&&Number.isFinite(n);return y(`td`,{"data-value":r?n:void 0,children:r?G(n):`—`},t.dataKey)}),u==null?null:(()=>{let t=k(e,u),n=typeof t==`number`&&Number.isFinite(t);return y(`td`,{"data-value":n?t:void 0,children:n?G(t):`—`})})()]},t)},t[24]=d,t[25]=s,t[26]=l,t[27]=u,t[28]=v):v=t[28],p=e.map(v),t[0]=n,t[1]=f,t[2]=d,t[3]=a,t[4]=s,t[5]=l,t[6]=u,t[7]=p,t[8]=m,t[9]=h,t[10]=g,t[11]=_}else p=t[7],m=t[8],h=t[9],g=t[10],_=t[11];let v;t[29]===p?v=t[30]:(v=y(`tbody`,{children:p}),t[29]=p,t[30]=v);let x;t[31]!==m||t[32]!==h||t[33]!==v?(x=b(`table`,{children:[m,h,v]}),t[31]=m,t[32]=h,t[33]=v,t[34]=x):x=t[34];let S;return t[35]!==g||t[36]!==_||t[37]!==x?(S=y(`div`,{className:g,"data-slot":_,children:x}),t[35]=g,t[36]=_,t[37]=x,t[38]=S):S=t[38],S};function mn(){return new Rt}function hn(e){return`${e.label}: ${e.value==null?`no data`:G(e.value)}`}function gn(e){return document.getElementById(e)?.textContent?.trim()??``}function _n(e){return y(`th`,{scope:`col`,children:e.label},e.dataKey)}export{$t as a,Zt as c,Xt as i,Qt as l,ln as n,Yt as o,Jt as r,en as s,un as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./clsx-DUGZgXfJ.js";import{a as r,r as i}from"./field-Bpptk_9t.js";import{c as a}from"react/compiler-runtime";import{useRef as o,useState as s}from"react";import{jsx as c}from"react/jsx-runtime";const l=e=>e===`indeterminate`,u=u=>{let d=a(37),f,p,m,h,g,_,v,y,b,x;d[0]===u?(f=d[1],p=d[2],m=d[3],h=d[4],g=d[5],_=d[6],v=d[7],y=d[8],b=d[9],x=d[10]):({"aria-invalid":f,className:g,checked:p,defaultChecked:m,defaultValue:x,onClick:_,readOnly:y,ref:b,validation:h,...v}=u,d[0]=u,d[1]=f,d[2]=p,d[3]=m,d[4]=h,d[5]=g,d[6]=_,d[7]=v,d[8]=y,d[9]=b,d[10]=x);let S=x===void 0?`on`:x,C=o(null),w=t(C,b),[T]=s(m),E=r(),D=h??E,O;d[11]!==f||d[12]!==D?(O=i({"aria-invalid":f,validation:D}),d[11]=f,d[12]=D,d[13]=O):O=d[13];let{ariaInvalid:k,validation:A}=O,j=p??T,M,N;d[14]===j?(M=d[15],N=d[16]):(M=()=>{C.current&&(C.current.indeterminate=l(j))},N=[j],d[14]=j,d[15]=M,d[16]=N),e(M,N);let P;d[17]!==p||d[18]!==T?(P=p==null?{defaultChecked:l(T)?void 0:T}:{checked:!l(p)&&p},d[17]=p,d[18]=T,d[19]=P):P=d[19];let F=P,I=l(p)?`mixed`:p,L=y||void 0,R;d[20]===g?R=d[21]:(R=n(`border-form bg-form shrink-0 cursor-pointer select-none appearance-none rounded border disabled:cursor-default disabled:opacity-50`,`bg-center bg-no-repeat focus:outline-hidden`,`focus-visible:border-accent-600 focus-visible:ring-focus-accent focus-visible:outline-hidden focus-visible:ring-4`,`checked:border-accent-600 checked:bg-accent-600 checked:bg-checked-icon`,`indeterminate:border-accent-600 indeterminate:bg-accent-600 indeterminate:bg-indeterminate-icon`,`data-validation-success:border-success-600 data-validation-success:checked:bg-success-600 data-validation-success:indeterminate:bg-success-600 focus-visible:data-validation-success:border-success-600 focus-visible:data-validation-success:ring-focus-success`,`data-validation-warning:border-warning-600 data-validation-warning:checked:bg-warning-600 data-validation-warning:indeterminate:bg-warning-600 focus-visible:data-validation-warning:border-warning-600 focus-visible:data-validation-warning:ring-focus-warning`,`data-validation-error:border-danger-600 data-validation-error:checked:bg-danger-600 data-validation-error:indeterminate:bg-danger-600 focus-visible:data-validation-error:border-danger-600 focus-visible:data-validation-error:ring-focus-danger`,`where:block where:size-4 where:p-0`,g),d[20]=g,d[21]=R);let z=A||void 0,B;d[22]!==_||d[23]!==y?(B=e=>{if(y){e.preventDefault();return}_?.(e)},d[22]=_,d[23]=y,d[24]=B):B=d[24];let V;return d[25]!==k||d[26]!==F||d[27]!==w||d[28]!==S||d[29]!==v||d[30]!==y||d[31]!==z||d[32]!==B||d[33]!==I||d[34]!==L||d[35]!==R?(V=c(`input`,{"aria-checked":I,"aria-invalid":k,"aria-readonly":L,"data-slot":`checkbox`,className:R,...F,"data-validation":z,defaultValue:S,onClick:B,readOnly:y,ref:w,type:`checkbox`,...v}),d[25]=k,d[26]=F,d[27]=w,d[28]=S,d[29]=v,d[30]=y,d[31]=z,d[32]=B,d[33]=I,d[34]=L,d[35]=R,d[36]=V):V=d[36],V};function d({allSelected:e,someSelected:t}){return e?!0:t?`indeterminate`:!1}export{d as n,u as t};
package/dist/checkbox.js CHANGED
@@ -1 +1 @@
1
- import{n as e,t}from"./checkbox-Gg6nGUnR.js";export{t as Checkbox,e as selectAllChecked};
1
+ import{n as e,t}from"./checkbox-DbJSqSNN.js";export{t as Checkbox,e as selectAllChecked};
@@ -0,0 +1 @@
1
+ import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./cx-0HCjnNv1.js";import{t as r}from"./slot-BsvE2ntj.js";import{t as i}from"./interactive-target-BXScNeOr.js";import{t as a}from"./field-B1wqeZr4.js";import{t as o}from"./label-BAy0Mg59.js";import{t as s}from"./radio-group-HDVxTNPi.js";import{c}from"react/compiler-runtime";import{cloneElement as l,createContext as u,isValidElement as d,useContext as f,useId as p,useRef as m}from"react";import h from"tiny-invariant";import{jsx as g}from"react/jsx-runtime";const _=u(null);function v(e){let t=f(_);return h(t,`Choice.${e} must be rendered inside Choice.Root.`),t}const y=e=>{let t=c(36),r,i,o,s,l,u,d,h,v,y;t[0]===e?(r=t[1],i=t[2],o=t[3],s=t[4],l=t[5],u=t[6],d=t[7],h=t[8],v=t[9],y=t[10]):({"aria-describedby":r,"aria-errormessage":i,"aria-invalid":o,children:s,className:l,disabled:y,id:u,name:d,ref:v,...h}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=d,t[8]=h,t[9]=v,t[10]=y);let b=y!==void 0&&y,x=f(a),S=x?.id,C=x?.name,w=x?.[`aria-describedby`],T=x?.[`aria-invalid`],E=x?.[`aria-errormessage`],D=p(),O=p(),k=m(null),A=S??u??D,j=w??r,M;t[11]!==O||t[12]!==j?(M=[j,O].filter(Boolean).join(` `)||void 0,t[11]=O,t[12]=j,t[13]=M):M=t[13];let N=M,P=C??d,F=T??o,I=E??i,L;t[14]!==A||t[15]!==N||t[16]!==b||t[17]!==P||t[18]!==F||t[19]!==I?(L={id:A,name:P,disabled:b,"aria-describedby":N,"aria-invalid":F,"aria-errormessage":I},t[14]=A,t[15]=N,t[16]=b,t[17]=P,t[18]=F,t[19]=I,t[20]=L):L=t[20];let R;t[21]!==A||t[22]!==O||t[23]!==b||t[24]!==L?(R={controlId:A,descriptionId:O,disabled:b,labelRef:k,controlProps:L},t[21]=A,t[22]=O,t[23]=b,t[24]=L,t[25]=R):R=t[25];let z=R,B;t[26]===l?B=t[27]:(B=n(`flex w-full items-start gap-2`,l),t[26]=l,t[27]=B);let V;t[28]!==s||t[29]!==h||t[30]!==v||t[31]!==B?(V=g(`div`,{ref:v,"data-slot":`choice`,className:B,...h,children:s}),t[28]=s,t[29]=h,t[30]=v,t[31]=B,t[32]=V):V=t[32];let H;return t[33]!==z||t[34]!==V?(H=g(_.Provider,{value:z,children:V}),t[33]=z,t[34]=V,t[35]=H):H=t[35],H},b=e=>{let t=c(15),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({children:r,className:i,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let{controlProps:s}=v(`Indicator`),u;t[5]!==r||t[6]!==s?(u=d(r)?l(r,{...s,disabled:s.disabled||r.props.disabled===!0,name:s.name??r.props.name,"aria-invalid":s[`aria-invalid`]??r.props[`aria-invalid`],"aria-errormessage":s[`aria-errormessage`]??r.props[`aria-errormessage`]}):r,t[5]=r,t[6]=s,t[7]=u):u=t[7];let f=u,p;t[8]===i?p=t[9]:(p=n(`flex h-lh shrink-0 items-center text-sm`,i),t[8]=i,t[9]=p);let m;return t[10]!==f||t[11]!==a||t[12]!==o||t[13]!==p?(m=g(`span`,{ref:o,"data-slot":`choice-indicator`,className:p,...a,children:f}),t[10]=f,t[11]=a,t[12]=o,t[13]=p,t[14]=m):m=t[14],m},x=e=>{let t=c(12),i,a,o,s;t[0]===e?(i=t[1],a=t[2],o=t[3],s=t[4]):({asChild:i,className:a,ref:s,...o}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=s);let l=i?r:`div`,u;t[5]===a?u=t[6]:(u=n(`flex min-w-0 flex-1 flex-col gap-0.5`,a),t[5]=a,t[6]=u);let d;return t[7]!==l||t[8]!==o||t[9]!==s||t[10]!==u?(d=g(l,{ref:s,"data-slot":`choice-content`,className:u,...o}),t[7]=l,t[8]=o,t[9]=s,t[10]=u,t[11]=d):d=t[11],d},S=e=>{let r=c(13),i,a,s;r[0]===e?(i=r[1],a=r[2],s=r[3]):({className:i,ref:s,...a}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=s);let{controlId:l,disabled:u,labelRef:d}=v(`Label`),f=t(d,s),p=u&&`opacity-50`,m;r[4]!==i||r[5]!==p?(m=n(p,i),r[4]=i,r[5]=p,r[6]=m):m=r[6];let h;return r[7]!==f||r[8]!==l||r[9]!==u||r[10]!==a||r[11]!==m?(h=g(o,{ref:f,"data-slot":`choice-label`,className:m,...a,htmlFor:l,disabled:u}),r[7]=f,r[8]=l,r[9]=u,r[10]=a,r[11]=m,r[12]=h):h=r[12],h},C=t=>{let i=c(19),a,o,l,u,d;i[0]===t?(a=i[1],o=i[2],l=i[3],u=i[4],d=i[5]):({asChild:a,className:o,id:l,ref:d,...u}=t,i[0]=t,i[1]=a,i[2]=o,i[3]=l,i[4]=u,i[5]=d);let{disabled:m}=v(`Title`),h=f(s),_=p(),y=l??_,b,x;i[6]!==h||i[7]!==y?(b=()=>h?.registerLabelId(y),x=[h,y],i[6]=h,i[7]=y,i[8]=b,i[9]=x):(b=i[8],x=i[9]),e(b,x);let S=a?r:`p`,C=m&&`opacity-50`,w;i[10]!==o||i[11]!==C?(w=n(`text-strong text-sm font-medium font-sans`,C,o),i[10]=o,i[11]=C,i[12]=w):w=i[12];let T;return i[13]!==S||i[14]!==u||i[15]!==d||i[16]!==w||i[17]!==y?(T=g(S,{ref:d,"data-slot":`choice-title`,className:w,...u,id:y}),i[13]=S,i[14]=u,i[15]=d,i[16]=w,i[17]=y,i[18]=T):T=i[18],T};function w(e){return e.defaultPrevented||i(e.target,e.currentTarget)?!1:e.currentTarget.closest(`label`)==null}const T={Root:y,Indicator:b,Content:x,Label:S,Title:C,Description:t=>{let i=c(24),a,o,l,u,d;i[0]===t?(a=i[1],o=i[2],l=i[3],u=i[4],d=i[5]):({asChild:a,className:o,onClick:l,ref:d,...u}=t,i[0]=t,i[1]=a,i[2]=o,i[3]=l,i[4]=u,i[5]=d);let{descriptionId:p,disabled:m,labelRef:h}=v(`Description`),_=f(s),y,b;i[6]!==p||i[7]!==_?(y=()=>_?.registerDescriptionId(p),b=[_,p],i[6]=p,i[7]=_,i[8]=y,i[9]=b):(y=i[8],b=i[9]),e(y,b);let x=a?r:`p`,S=!m&&`[[data-slot~=choice-label]~&]:cursor-pointer`,C=m&&`opacity-50`,T;i[10]!==o||i[11]!==S||i[12]!==C?(T=n(`text-body text-sm leading-4`,S,C,o),i[10]=o,i[11]=S,i[12]=C,i[13]=T):T=i[13];let E;i[14]!==h||i[15]!==l?(E=e=>{l?.(e),w(e)&&(h.current?.click(),e.preventDefault())},i[14]=h,i[15]=l,i[16]=E):E=i[16];let D;return i[17]!==x||i[18]!==p||i[19]!==u||i[20]!==d||i[21]!==T||i[22]!==E?(D=g(x,{ref:d,"data-slot":`choice-description`,className:T,onClick:E,...u,id:p}),i[17]=x,i[18]=p,i[19]=u,i[20]=d,i[21]=T,i[22]=E,i[23]=D):D=i[23],D}};export{T as t};
package/dist/choice.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./choice-CT_AdesL.js";export{e as Choice};
1
+ import{t as e}from"./choice-SRyLguqU.js";export{e as Choice};
@@ -1,7 +1,7 @@
1
- import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-DdUwopIY.js";import{t as n}from"./cx-0HCjnNv1.js";import{t as r}from"./icon-CGKaq_tV.js";import{t as i}from"./slot-C3gII_9c.js";import{t as a}from"./button-CaM-ZAH5.js";import{t as o}from"./use-copy-to-clipboard-CSyp4Zk0.js";import{t as s}from"./alternate-announcement-BkH4bOKp.js";import{t as c}from"./live-region-CV7kykeo.js";import{t as l}from"./icons-CF1lbWtp.js";import{S as u,_ as d,a as f,b as p,c as m,d as h,f as g,g as _,h as v,i as y,l as b,m as x,n as S,o as C,p as w,r as T,s as E,t as D,u as O,v as k,y as A}from"./code-block-BE3Q0iAo.js";import{CaretDownIcon as ee}from"@phosphor-icons/react/CaretDown";import{createContext as j,useCallback as M,useContext as N,useEffect as P,useId as F,useLayoutEffect as te,useMemo as I,useRef as L,useState as R}from"react";import z from"tiny-invariant";import{jsx as B,jsxs as V}from"react/jsx-runtime";import{CheckIcon as ne}from"@phosphor-icons/react/Check";import{CopyIcon as re}from"@phosphor-icons/react/Copy";import{FileTextIcon as ie}from"@phosphor-icons/react/FileText";import{TerminalIcon as ae}from"@phosphor-icons/react/Terminal";import{Content as oe,List as se,Root as H,Trigger as U}from"@radix-ui/react-tabs";function W(e){let t=-1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`&`||r===`<`||r===`>`||r===`"`||r===`'`){t=n;break}}if(t===-1)return e;let n=e.slice(0,t);for(let r=t;r<e.length;r++){let t=e[r];switch(t){case`&`:n+=`&amp;`;break;case`<`:n+=`&lt;`;break;case`>`:n+=`&gt;`;break;case`"`:n+=`&quot;`;break;case`'`:n+=`&#39;`;break;default:n+=t}}return n}const G=new WeakMap;function K(e){let t=new Set;if(e==null||e===``)return t;for(let n of e.split(` `))n!==``&&t.add(n);return t}function ce(e){let t=G.get(e);if(t!=null&&de(t))return t;let n=new Map,r=new WeakMap,i=e.querySelectorAll(`[data-fold-regions]`);for(let e=0;e<i.length;e+=1){let t=i[e];if(!(t instanceof HTMLElement))continue;let a=K(t.dataset.foldRegions);if(a.size!==0){r.set(t,a);for(let e of a){let r=n.get(e);r??(r=[],n.set(e,r)),r.push(t)}}}let a={regionToLines:n,lineToRegions:r};return G.set(e,a),a}function le(e){G.delete(e)}function ue(e){le(e),e.removeAttribute(`data-folded-regions`)}function de(e){for(let t of e.regionToLines.values()){if(t.length===0)continue;let e=t[0];if(e!=null)return e.isConnected}return!0}function fe(e,t,n){let r=!1;for(let e of n)if(t.has(e)){r=!0;break}r?e.dataset.foldHidden=`true`:delete e.dataset.foldHidden}function pe(e){let t=e.dataset.foldLine;if(t==null||t===``)return!1;let n=e.closest(`[data-slot='code-block-code']`)?.querySelector(`code`);if(n==null)return!1;let r=K(n.getAttribute(`data-folded-regions`)),i=!r.has(t);i?r.add(t):r.delete(t),r.size===0?n.removeAttribute(`data-folded-regions`):n.setAttribute(`data-folded-regions`,[...r].join(` `)),e.setAttribute(`aria-expanded`,i?`false`:`true`);let{regionToLines:a,lineToRegions:o}=ce(n),s=a.get(t);if(s!=null)for(let e of s){let t=o.get(e);t!=null&&fe(e,r,t)}return!0}function me(e){let t=e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`.mantle-code-fold-toggle`);n instanceof HTMLButtonElement&&pe(n)};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}}const q=j(null);function J(){let e=N(q);return z(e!=null,`CodeBlock subcomponents must be rendered within a <CodeBlock.Root>.`),e}const he=({asChild:e=!1,className:t,defaultTab:r,activeTab:a,onActiveTabChange:o,ref:s,...c})=>{let l=L(``),u=F(),d=L(0),[f,p]=R(!1),[m,h]=R(!1),g=M(()=>{z(d.current===0,`You can only render a single CodeBlock.Code within a CodeBlock.`),d.current+=1},[]),_=M(()=>{--d.current},[]),v=I(()=>({codeId:u,copyTextRef:l,hasCodeExpander:f,isCodeExpanded:m,registerCode:g,setHasCodeExpander:p,setIsCodeExpanded:h,unregisterCode:_}),[u,f,m,g,_]),y=r!=null||a!=null,b=B(e?i:`div`,{"data-slot":`code-block`,className:n(`text-mono w-full overflow-hidden rounded-md border border-gray-300 bg-base font-mono`,`[&_svg]:shrink-0`,t),ref:s,...c});return B(q.Provider,{value:v,children:y?B(H,{asChild:!0,defaultValue:r,value:a,onValueChange:o,children:b}):b})},ge=({asChild:e=!1,className:t,ref:r,...a})=>B(e?i:`div`,{"data-slot":`code-block-body`,className:n(`relative`,`[&_.mantle-code-line]:pr-4`,`[&:has([data-slot=code-block-copy-button])_.mantle-code-line:nth-child(-n+2)]:pr-14`,t),ref:r,...a}),_e=/SHIKI_VAL_(\d+)/g;function ve(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}const Y=new Map;function ye(e){if(e==null||e.length===0)return _e;let t=Y.get(e);return t??(Y.size>=500&&Y.clear(),t=RegExp(`${ve(e)}(\\d+)__`,`g`),Y.set(e,t)),t}function X(e,t,n,r){if(n==null){if(!e.includes(`SHIKI_VAL_`))return e}else if(!e.includes(n))return e;return e.replaceAll(ye(n),(e,n)=>{let i=Number.parseInt(n,10);return Number.isNaN(i)||i<0||i>=t.length?e:r(t[i])})}function be(e,t,n){return X(e,t,n,e=>W(String(e)))}function xe(e,t,n){return X(e,t,n,e=>String(e))}const Se=({className:e,style:r,value:i,ref:a,...o})=>{let s=L(null),c=t(s,a),{codeId:l,copyTextRef:u,hasCodeExpander:d,isCodeExpanded:f,registerCode:p,unregisterCode:m}=J(),{language:h,code:g,"~preValToken":_,"~preVals":v,"~highlightLines":y,"~lineNumberStart":b,"~preHtml":x,"~showLineNumbers":S}=i,C=y,w=b??1,T=S??!1,E=I(()=>v!=null&&v.length>0?xe(g,v,_):g,[_,v,g]);te(()=>{u.current=E},[u,E]),P(()=>(p(),()=>{m()}),[p,m]);let D=I(()=>{if(x!=null)return v!=null&&v.length>0?be(x,v,_):x},[x,_,v]);P(()=>{let e=s.current;if(e==null)return;let t=e.querySelector(`code`);return t!=null&&ue(t),me(e)},[D]);let O=D!=null,k=D??W(E),A=I(()=>({__html:k}),[k]);return B(`pre`,{"data-slot":`code-block-code`,"data-state":d?f?`expanded`:`collapsed`:void 0,className:n(`scrollbar overflow-x-auto overscroll-x-none overflow-y-hidden py-4`,!O&&`pr-14`,`data-[mantle-line-numbers~='false']:pl-4`,`text-mono m-0 font-mono outline-hidden`,`data-[state=collapsed]:max-h-[13.6rem]`,e),"data-highlighted":O?`true`:`false`,"data-lang":h,"data-mantle-highlight-lines":O&&C!=null&&C.length>0?C.join(`,`):void 0,"data-mantle-line-number-start":O&&T?String(w):`1`,"data-mantle-line-numbers":O&&T?`true`:`false`,id:l,ref:c,style:{...r,"--mantle-line-number-start":String(w),tabSize:2,MozTabSize:2},...o,translate:`no`,children:B(`code`,{className:`text-size-inherit block min-w-full w-max`,dangerouslySetInnerHTML:A})})},Ce=({asChild:e=!1,className:t,ref:r,...a})=>B(e?i:`div`,{"data-slot":`code-block-header`,className:n(`flex items-center gap-1 border-b border-gray-300 bg-base px-4 py-2 text-gray-700`,t),ref:r,...a}),we=({asChild:e=!1,className:t,ref:r,...a})=>B(e?i:`h3`,{"data-slot":`code-block-title`,ref:r,className:n(`m-0 font-sans text-xs font-medium`,t),translate:`no`,...a}),Te=({className:e,label:t=`Copy code`,onCopy:r,onCopyError:i,onClick:l,ref:u,...d})=>{let{copyTextRef:f}=J(),p=o(),[m,h]=R(``),g=m!==``,_=L(!1),v=L(void 0);return P(()=>()=>{v.current!=null&&clearTimeout(v.current)},[]),V(`span`,{"data-slot":`code-block-copy-button`,className:`absolute right-3 top-3 z-10 inline-flex size-7 items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] bg-base`,children:[B(c,{children:m}),B(a,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,label:t,icon:B(g?ne:re,{}),className:n(`bg-base not-disabled:hover:bg-neutral-500/15`,e),ref:u,onClick:async e=>{try{if(l?.(e),e.defaultPrevented){v.current!=null&&clearTimeout(v.current);return}let t=f.current;await p(t),r?.(t),h(s(`Copied`,_)),v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{h(``)},2e3)}catch(e){i?.(e)}},...d})]})},Ee=({className:t,onClick:i,ref:a,...o})=>{let{codeId:s,isCodeExpanded:c,setIsCodeExpanded:l,setHasCodeExpander:u}=J();return e(()=>(u(!0),()=>{u(!1)}),[u]),V(`button`,{...o,"data-slot":`code-block-expander-button`,"aria-controls":s,"aria-expanded":c,className:n(`flex w-full items-center justify-center gap-0.5 border-t border-gray-300 bg-base px-4 py-2 font-sans text-gray-700 hover:bg-base-hover`,t),ref:a,type:`button`,onClick:e=>{l(e=>!e),i?.(e)},children:[c?`Show less`:`Show more`,` `,B(r,{svg:B(ee,{weight:`bold`}),className:n(`size-4`,c&&`rotate-180`,`transition-all duration-150`)})]})};function De({className:e,preset:t,svg:i,...a}){let o=i;if(t!=null)switch(t){case`file`:o=B(ie,{weight:`fill`});break;case`cli`:o=B(ae,{weight:`fill`});break;case`traffic-policy`:o=B(l,{})}return B(r,{"data-slot":`code-block-icon`,className:n(`size-5`,e),svg:o,...a})}const Oe={Root:he,Body:ge,Code:Se,CopyButton:Te,ExpanderButton:Ee,Header:Ce,Icon:De,TabContent:e=>B(oe,{"data-slot":`code-block-tab-content`,...e}),TabList:({className:e,ref:t,...r})=>B(se,{"data-slot":`code-block-tab-list`,className:n(`scroll-fade-x flex min-w-0 items-center gap-1 overflow-x-auto overscroll-x-none`,`-m-1 p-1`,e),ref:t,...r}),TabTrigger:({className:e,ref:t,...r})=>B(U,{"data-slot":`code-block-tab-trigger`,className:n(`shrink-0 cursor-pointer rounded px-1.5 py-0.5 font-sans text-xs font-medium whitespace-nowrap`,`text-gray-600 outline-hidden`,`hover:text-gray-900`,`data-[state=active]:bg-neutral-500/15 data-[state=active]:text-strong`,`focus-visible:ring-focus-accent focus-visible:ring-4`,e),ref:t,...r}),Title:we},Z=`var(--shiki-foreground)`;function Q(e){return e.replace(/[&<]/g,e=>e===`&`?`&#x26;`:`&#x3C;`)}function ke(e){return e===` `||e===` `||e===`
2
- `||e===`\r`||e===`{`||e===`}`||e===`[`||e===`]`||e===`:`||e===`,`||e===`"`}function Ae(e,t,n){let r=e.length,i=[],a=`"`,o=t+1;for(;o<r;){let t=e[o];if(t===`\\`){let t=e[o+1]===`u`&&/^[0-9a-fA-F]{4}$/.test(e.slice(o+2,o+6))?6:2;a!==``&&(i.push({text:a,isEscape:!1}),a=``),i.push({text:e.slice(o,o+t),isEscape:!0}),o+=t;continue}if(t===`"`){a+=`"`,o+=1;break}a+=t,o+=1}a!==``&&i.push({text:a,isEscape:!1});let s=o;for(;s<r;){let t=e[s];if(t===` `||t===` `||t===`
3
- `||t===`\r`){s+=1;continue}break}let c=e[s]===`:`?`var(--shiki-token-keyword)`:`var(--shiki-token-string-expression)`;for(let e of i)n(e.text,e.isEscape?`var(--shiki-token-escape, var(--shiki-token-constant))`:c);return o}function je(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n!=null&&n.color==null){let r=Z;for(let n=t+1;n<e.length;n+=1){let t=e[n];if(t!=null&&t.color!=null){r=t.color;break}}n.color=r}}let t=``,n=``,r=null,i=()=>{r!=null&&(t+=`<span style="color:${r}">${Q(n)}</span>`),n=``,r=null};for(let t of e)t!=null&&(t.color===r?n+=t.text:(i(),n=t.text,r=t.color));return i(),`<span class="line">${t}</span>`}function $(e){let t=[[]],n=t[0]??[],r=e.length,i=0,a=(e,t)=>{n.push({text:e,color:t})};for(;i<r;){let o=e[i];if(o===`
1
+ import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./cx-0HCjnNv1.js";import{t as r}from"./icon-BT8FnkkJ.js";import{t as i}from"./slot-BsvE2ntj.js";import{t as a}from"./button-pwkdtR3U.js";import{t as o}from"./use-copy-to-clipboard-ByLT8veV.js";import{t as s}from"./alternate-announcement-BkH4bOKp.js";import{t as c}from"./live-region-B2vJRvPH.js";import{t as l}from"./icons-C3rVfpx9.js";import{S as u,_ as d,a as f,b as p,c as m,d as h,f as g,g as _,h as v,i as y,l as b,m as x,n as S,o as C,p as w,r as T,s as E,t as D,u as O,v as k,y as A}from"./code-block-BE3Q0iAo.js";import{c as j}from"react/compiler-runtime";import{CaretDownIcon as M}from"@phosphor-icons/react/CaretDown";import{createContext as N,useContext as P,useEffect as ee,useId as F,useLayoutEffect as te,useRef as I,useState as L}from"react";import R from"tiny-invariant";import{jsx as z,jsxs as B}from"react/jsx-runtime";import{CheckIcon as V}from"@phosphor-icons/react/Check";import{CopyIcon as H}from"@phosphor-icons/react/Copy";import{FileTextIcon as U}from"@phosphor-icons/react/FileText";import{TerminalIcon as W}from"@phosphor-icons/react/Terminal";import{Content as ne,List as G,Root as re,Trigger as K}from"@radix-ui/react-tabs";function ie(e){let t=-1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`&`||r===`<`||r===`>`||r===`"`||r===`'`){t=n;break}}if(t===-1)return e;let n=e.slice(0,t);for(let r=t;r<e.length;r++){let t=e[r];switch(t){case`&`:n+=`&amp;`;break;case`<`:n+=`&lt;`;break;case`>`:n+=`&gt;`;break;case`"`:n+=`&quot;`;break;case`'`:n+=`&#39;`;break;default:n+=t}}return n}const q=new WeakMap;function J(e){let t=new Set;if(e==null||e===``)return t;for(let n of e.split(` `))n!==``&&t.add(n);return t}function Y(e){let t=q.get(e);if(t!=null&&oe(t))return t;let n=new Map,r=new WeakMap,i=e.querySelectorAll(`[data-fold-regions]`);for(let e=0;e<i.length;e+=1){let t=i[e];if(!(t instanceof HTMLElement))continue;let a=J(t.dataset.foldRegions);if(a.size!==0){r.set(t,a);for(let e of a){let r=n.get(e);r??(r=[],n.set(e,r)),r.push(t)}}}let a={regionToLines:n,lineToRegions:r};return q.set(e,a),a}function X(e){q.delete(e)}function ae(e){X(e),e.removeAttribute(`data-folded-regions`)}function oe(e){for(let t of e.regionToLines.values()){if(t.length===0)continue;let e=t[0];if(e!=null)return e.isConnected}return!0}function Z(e,t,n){let r=!1;for(let e of n)if(t.has(e)){r=!0;break}r?e.dataset.foldHidden=`true`:delete e.dataset.foldHidden}function se(e){let t=e.dataset.foldLine;if(t==null||t===``)return!1;let n=e.closest(`[data-slot='code-block-code']`)?.querySelector(`code`);if(n==null)return!1;let r=J(n.getAttribute(`data-folded-regions`)),i=!r.has(t);i?r.add(t):r.delete(t),r.size===0?n.removeAttribute(`data-folded-regions`):n.setAttribute(`data-folded-regions`,[...r].join(` `)),e.setAttribute(`aria-expanded`,i?`false`:`true`);let{regionToLines:a,lineToRegions:o}=Y(n),s=a.get(t);if(s!=null)for(let e of s){let t=o.get(e);t!=null&&Z(e,r,t)}return!0}function ce(e){let t=e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`.mantle-code-fold-toggle`);n instanceof HTMLButtonElement&&se(n)};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}}const Q=N(null);function le(){let e=P(Q);return R(e!=null,`CodeBlock subcomponents must be rendered within a <CodeBlock.Root>.`),e}const $=e=>{let t=j(30),r,a,o,s,c,l,u;t[0]===e?(r=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7]):({asChild:u,className:a,defaultTab:o,activeTab:r,onActiveTabChange:s,ref:l,...c}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=u);let d=u!==void 0&&u,f=I(``),p=F(),m=I(0),[h,g]=L(!1),[_,v]=L(!1),y;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{R(m.current===0,`You can only render a single CodeBlock.Code within a CodeBlock.`),m.current+=1},t[8]=y):y=t[8];let b=y,x;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>{--m.current},t[9]=x):x=t[9];let S=x,C;t[10]!==p||t[11]!==h||t[12]!==_?(C={codeId:p,copyTextRef:f,hasCodeExpander:h,isCodeExpanded:_,registerCode:b,setHasCodeExpander:g,setIsCodeExpanded:v,unregisterCode:S},t[10]=p,t[11]=h,t[12]=_,t[13]=C):C=t[13];let w=C,T=o!=null||r!=null,E=d?i:`div`,D;t[14]===a?D=t[15]:(D=n(`text-mono w-full overflow-hidden rounded-md border border-gray-300 bg-base font-mono`,`[&_svg]:shrink-0`,a),t[14]=a,t[15]=D);let O;t[16]!==E||t[17]!==c||t[18]!==l||t[19]!==D?(O=z(E,{"data-slot":`code-block`,className:D,ref:l,...c}),t[16]=E,t[17]=c,t[18]=l,t[19]=D,t[20]=O):O=t[20];let k=O,A;t[21]!==r||t[22]!==o||t[23]!==T||t[24]!==s||t[25]!==k?(A=T?z(re,{asChild:!0,defaultValue:o,value:r,onValueChange:s,children:k}):k,t[21]=r,t[22]=o,t[23]=T,t[24]=s,t[25]=k,t[26]=A):A=t[26];let M;return t[27]!==w||t[28]!==A?(M=z(Q.Provider,{value:w,children:A}),t[27]=w,t[28]=A,t[29]=M):M=t[29],M},ue=e=>{let t=j(12),r,a,o,s;t[0]===e?(r=t[1],a=t[2],o=t[3],s=t[4]):({asChild:s,className:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=o,t[4]=s);let c=s!==void 0&&s?i:`div`,l;t[5]===r?l=t[6]:(l=n(`relative`,`[&_.mantle-code-line]:pr-4`,`[&:has([data-slot=code-block-copy-button])_.mantle-code-line:nth-child(-n+2)]:pr-14`,r),t[5]=r,t[6]=l);let u;return t[7]!==c||t[8]!==a||t[9]!==o||t[10]!==l?(u=z(c,{"data-slot":`code-block-body`,className:l,ref:o,...a}),t[7]=c,t[8]=a,t[9]=o,t[10]=l,t[11]=u):u=t[11],u},de=/SHIKI_VAL_(\d+)/g;function fe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}const pe=new Map;function me(e){if(e==null||e.length===0)return de;let t=pe.get(e);return t??(pe.size>=500&&pe.clear(),t=RegExp(`${fe(e)}(\\d+)__`,`g`),pe.set(e,t)),t}function he(e,t,n,r){if(n==null){if(!e.includes(`SHIKI_VAL_`))return e}else if(!e.includes(n))return e;return e.replaceAll(me(n),(e,n)=>{let i=Number.parseInt(n,10);return Number.isNaN(i)||i<0||i>=t.length?e:r(t[i])})}function ge(e,t,n){return he(e,t,n,e=>ie(String(e)))}function _e(e,t,n){return he(e,t,n,e=>String(e))}const ve=e=>{let r=j(54),i,a,o,s,c;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5]):({className:i,style:s,value:c,ref:o,...a}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c);let l=I(null),u=t(l,o),{codeId:d,copyTextRef:f,hasCodeExpander:p,isCodeExpanded:m,registerCode:h,unregisterCode:g}=le(),{language:_,code:v,"~preValToken":y,"~preVals":b,"~highlightLines":x,"~lineNumberStart":S,"~preHtml":C,"~showLineNumbers":w}=c,T=x,E=S??1,D=w??!1,O;r[6]!==y||r[7]!==b||r[8]!==v?(O=b!=null&&b.length>0?_e(v,b,y):v,r[6]=y,r[7]=b,r[8]=v,r[9]=O):O=r[9];let k=O,A,M;r[10]!==k||r[11]!==f?(A=()=>{f.current=k},M=[f,k],r[10]=k,r[11]=f,r[12]=A,r[13]=M):(A=r[12],M=r[13]),te(A,M);let N,P;r[14]!==h||r[15]!==g?(N=()=>(h(),()=>{g()}),P=[h,g],r[14]=h,r[15]=g,r[16]=N,r[17]=P):(N=r[16],P=r[17]),ee(N,P);let F;bb0:{if(C==null){F=void 0;break bb0}let e;r[18]!==C||r[19]!==y||r[20]!==b?(e=b!=null&&b.length>0?ge(C,b,y):C,r[18]=C,r[19]=y,r[20]=b,r[21]=e):e=r[21],F=e}let L=F,R;r[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>{let e=l.current;if(e==null)return;let t=e.querySelector(`code`);return t!=null&&ae(t),ce(e)},r[22]=R):R=r[22];let B;r[23]===L?B=r[24]:(B=[L],r[23]=L,r[24]=B),ee(R,B);let V=L!=null,H;r[25]!==k||r[26]!==L?(H=L??ie(k),r[25]=k,r[26]=L,r[27]=H):H=r[27];let U=H,W;r[28]===U?W=r[29]:(W={__html:U},r[28]=U,r[29]=W);let ne=W,G=p?m?`expanded`:`collapsed`:void 0,re=!V&&`pr-14`,K;r[30]!==i||r[31]!==re?(K=n(`scrollbar overflow-x-auto overscroll-x-none overflow-y-hidden py-4`,re,`data-[mantle-line-numbers~='false']:pl-4`,`text-mono m-0 font-mono outline-hidden`,`data-[state=collapsed]:max-h-[13.6rem]`,i),r[30]=i,r[31]=re,r[32]=K):K=r[32];let q=V?`true`:`false`,J;r[33]!==T||r[34]!==V?(J=V&&T!=null&&T.length>0?T.join(`,`):void 0,r[33]=T,r[34]=V,r[35]=J):J=r[35];let Y=V&&D?String(E):`1`,X=V&&D?`true`:`false`,oe=String(E),Z;r[36]!==s||r[37]!==oe?(Z={...s,"--mantle-line-number-start":oe,tabSize:2,MozTabSize:2},r[36]=s,r[37]=oe,r[38]=Z):Z=r[38];let se=Z,Q;r[39]===ne?Q=r[40]:(Q=z(`code`,{className:`text-size-inherit block min-w-full w-max`,dangerouslySetInnerHTML:ne}),r[39]=ne,r[40]=Q);let $;return r[41]!==d||r[42]!==u||r[43]!==_||r[44]!==a||r[45]!==G||r[46]!==K||r[47]!==q||r[48]!==J||r[49]!==Y||r[50]!==X||r[51]!==se||r[52]!==Q?($=z(`pre`,{"data-slot":`code-block-code`,"data-state":G,className:K,"data-highlighted":q,"data-lang":_,"data-mantle-highlight-lines":J,"data-mantle-line-number-start":Y,"data-mantle-line-numbers":X,id:d,ref:u,style:se,...a,translate:`no`,children:Q}),r[41]=d,r[42]=u,r[43]=_,r[44]=a,r[45]=G,r[46]=K,r[47]=q,r[48]=J,r[49]=Y,r[50]=X,r[51]=se,r[52]=Q,r[53]=$):$=r[53],$},ye=e=>{let t=j(12),r,a,o,s;t[0]===e?(r=t[1],a=t[2],o=t[3],s=t[4]):({asChild:s,className:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=o,t[4]=s);let c=s!==void 0&&s?i:`div`,l;t[5]===r?l=t[6]:(l=n(`flex items-center gap-1 border-b border-gray-300 bg-base px-4 py-2 text-gray-700`,r),t[5]=r,t[6]=l);let u;return t[7]!==c||t[8]!==a||t[9]!==o||t[10]!==l?(u=z(c,{"data-slot":`code-block-header`,className:l,ref:o,...a}),t[7]=c,t[8]=a,t[9]=o,t[10]=l,t[11]=u):u=t[11],u},be=e=>{let t=j(12),r,a,o,s;t[0]===e?(r=t[1],a=t[2],o=t[3],s=t[4]):({asChild:s,className:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=o,t[4]=s);let c=s!==void 0&&s?i:`h3`,l;t[5]===r?l=t[6]:(l=n(`m-0 font-sans text-xs font-medium`,r),t[5]=r,t[6]=l);let u;return t[7]!==c||t[8]!==a||t[9]!==o||t[10]!==l?(u=z(c,{"data-slot":`code-block-title`,ref:o,className:l,translate:`no`,...a}),t[7]=c,t[8]=a,t[9]=o,t[10]=l,t[11]=u):u=t[11],u},xe=e=>{let t=j(32),r,i,l,u,d,f,p;t[0]===e?(r=t[1],i=t[2],l=t[3],u=t[4],d=t[5],f=t[6],p=t[7]):({className:r,label:p,onCopy:l,onCopyError:u,onClick:i,ref:f,...d}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=l,t[4]=u,t[5]=d,t[6]=f,t[7]=p);let m=p===void 0?`Copy code`:p,{copyTextRef:h}=le(),g=o(),[_,v]=L(``),y=_!==``,b=I(!1),x=I(void 0),S,C;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>()=>{x.current!=null&&clearTimeout(x.current)},C=[],t[8]=S,t[9]=C):(S=t[8],C=t[9]),ee(S,C);let w;t[10]===_?w=t[11]:(w=z(c,{children:_}),t[10]=_,t[11]=w);let T;t[12]===y?T=t[13]:(T=z(y?V:H,{}),t[12]=y,t[13]=T);let E;t[14]===r?E=t[15]:(E=n(`bg-base not-disabled:hover:bg-neutral-500/15`,r),t[14]=r,t[15]=E);let D;t[16]!==h||t[17]!==g||t[18]!==i||t[19]!==l||t[20]!==u?(D=async e=>{try{if(i?.(e),e.defaultPrevented){x.current!=null&&clearTimeout(x.current);return}let t=h.current;await g(t),l?.(t),v(s(`Copied`,b)),x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{v(``)},2e3)}catch(e){u?.(e)}},t[16]=h,t[17]=g,t[18]=i,t[19]=l,t[20]=u,t[21]=D):D=t[21];let O;t[22]!==m||t[23]!==d||t[24]!==f||t[25]!==T||t[26]!==E||t[27]!==D?(O=z(a,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,label:m,icon:T,className:E,ref:f,onClick:D,...d}),t[22]=m,t[23]=d,t[24]=f,t[25]=T,t[26]=E,t[27]=D,t[28]=O):O=t[28];let k;return t[29]!==w||t[30]!==O?(k=B(`span`,{"data-slot":`code-block-copy-button`,className:`absolute right-3 top-3 z-10 inline-flex size-7 items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] bg-base`,children:[w,O]}),t[29]=w,t[30]=O,t[31]=k):k=t[31],k},Se=t=>{let i=j(27),a,o,s,c;i[0]===t?(a=i[1],o=i[2],s=i[3],c=i[4]):({className:a,onClick:o,ref:c,...s}=t,i[0]=t,i[1]=a,i[2]=o,i[3]=s,i[4]=c);let{codeId:l,isCodeExpanded:u,setIsCodeExpanded:d,setHasCodeExpander:f}=le(),p,m;i[5]===f?(p=i[6],m=i[7]):(p=()=>(f(!0),()=>{f(!1)}),m=[f],i[5]=f,i[6]=p,i[7]=m),e(p,m);let h;i[8]===a?h=i[9]:(h=n(`flex w-full items-center justify-center gap-0.5 border-t border-gray-300 bg-base px-4 py-2 font-sans text-gray-700 hover:bg-base-hover`,a),i[8]=a,i[9]=h);let g;i[10]!==o||i[11]!==d?(g=e=>{d(Te),o?.(e)},i[10]=o,i[11]=d,i[12]=g):g=i[12];let _=u?`Show less`:`Show more`,v;i[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=z(M,{weight:`bold`}),i[13]=v):v=i[13];let y=u&&`rotate-180`,b;i[14]===y?b=i[15]:(b=n(`size-4`,y,`transition-all duration-150`),i[14]=y,i[15]=b);let x;i[16]===b?x=i[17]:(x=z(r,{svg:v,className:b}),i[16]=b,i[17]=x);let S;return i[18]!==l||i[19]!==u||i[20]!==s||i[21]!==c||i[22]!==h||i[23]!==g||i[24]!==_||i[25]!==x?(S=B(`button`,{...s,"data-slot":`code-block-expander-button`,"aria-controls":l,"aria-expanded":u,className:h,ref:c,type:`button`,onClick:g,children:[_,` `,x]}),i[18]=l,i[19]=u,i[20]=s,i[21]=c,i[22]=h,i[23]=g,i[24]=_,i[25]=x,i[26]=S):S=i[26],S};function Ce(e){let t=j(14),i,a,o,s;t[0]===e?(i=t[1],a=t[2],o=t[3],s=t[4]):({className:a,preset:o,svg:i,...s}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=s);let c=i;if(o!=null)bb0:switch(o){case`file`:{let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=z(U,{weight:`fill`}),t[5]=e):e=t[5],c=e;break bb0}case`cli`:{let e;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=z(W,{weight:`fill`}),t[6]=e):e=t[6],c=e;break bb0}case`traffic-policy`:{let e;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=z(l,{}),t[7]=e):e=t[7],c=e}}let u;t[8]===a?u=t[9]:(u=n(`size-5`,a),t[8]=a,t[9]=u);let d;return t[10]!==s||t[11]!==c||t[12]!==u?(d=z(r,{"data-slot":`code-block-icon`,className:u,svg:c,...s}),t[10]=s,t[11]=c,t[12]=u,t[13]=d):d=t[13],d}const we={Root:$,Body:ue,Code:ve,CopyButton:xe,ExpanderButton:Se,Header:ye,Icon:Ce,TabContent:e=>{let t=j(2),n;return t[0]===e?n=t[1]:(n=z(ne,{"data-slot":`code-block-tab-content`,...e}),t[0]=e,t[1]=n),n},TabList:e=>{let t=j(10),r,i,a;t[0]===e?(r=t[1],i=t[2],a=t[3]):({className:r,ref:a,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a);let o;t[4]===r?o=t[5]:(o=n(`scroll-fade-x flex min-w-0 items-center gap-1 overflow-x-auto overscroll-x-none`,`-m-1 p-1`,r),t[4]=r,t[5]=o);let s;return t[6]!==i||t[7]!==a||t[8]!==o?(s=z(G,{"data-slot":`code-block-tab-list`,className:o,ref:a,...i}),t[6]=i,t[7]=a,t[8]=o,t[9]=s):s=t[9],s},TabTrigger:e=>{let t=j(10),r,i,a;t[0]===e?(r=t[1],i=t[2],a=t[3]):({className:r,ref:a,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a);let o;t[4]===r?o=t[5]:(o=n(`shrink-0 cursor-pointer rounded px-1.5 py-0.5 font-sans text-xs font-medium whitespace-nowrap`,`text-gray-600 outline-hidden`,`hover:text-gray-900`,`data-[state=active]:bg-neutral-500/15 data-[state=active]:text-strong`,`focus-visible:ring-focus-accent focus-visible:ring-4`,r),t[4]=r,t[5]=o);let s;return t[6]!==i||t[7]!==a||t[8]!==o?(s=z(K,{"data-slot":`code-block-tab-trigger`,className:o,ref:a,...i}),t[6]=i,t[7]=a,t[8]=o,t[9]=s):s=t[9],s},Title:be};function Te(e){return!e}const Ee=`var(--shiki-foreground)`;function De(e){return e.replace(/[&<]/g,e=>e===`&`?`&#x26;`:`&#x3C;`)}function Oe(e){return e===` `||e===` `||e===`
2
+ `||e===`\r`||e===`{`||e===`}`||e===`[`||e===`]`||e===`:`||e===`,`||e===`"`}function ke(e,t,n){let r=e.length,i=[],a=`"`,o=t+1;for(;o<r;){let t=e[o];if(t===`\\`){let t=e[o+1]===`u`&&/^[0-9a-fA-F]{4}$/.test(e.slice(o+2,o+6))?6:2;a!==``&&(i.push({text:a,isEscape:!1}),a=``),i.push({text:e.slice(o,o+t),isEscape:!0}),o+=t;continue}if(t===`"`){a+=`"`,o+=1;break}a+=t,o+=1}a!==``&&i.push({text:a,isEscape:!1});let s=o;for(;s<r;){let t=e[s];if(t===` `||t===` `||t===`
3
+ `||t===`\r`){s+=1;continue}break}let c=e[s]===`:`?`var(--shiki-token-keyword)`:`var(--shiki-token-string-expression)`;for(let e of i)n(e.text,e.isEscape?`var(--shiki-token-escape, var(--shiki-token-constant))`:c);return o}function Ae(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n!=null&&n.color==null){let r=Ee;for(let n=t+1;n<e.length;n+=1){let t=e[n];if(t!=null&&t.color!=null){r=t.color;break}}n.color=r}}let t=``,n=``,r=null,i=()=>{r!=null&&(t+=`<span style="color:${r}">${De(n)}</span>`),n=``,r=null};for(let t of e)t!=null&&(t.color===r?n+=t.text:(i(),n=t.text,r=t.color));return i(),`<span class="line">${t}</span>`}function je(e){let t=[[]],n=t[0]??[],r=e.length,i=0,a=(e,t)=>{n.push({text:e,color:t})};for(;i<r;){let o=e[i];if(o===`
4
4
  `||o===`\r`){o===`\r`&&e[i+1]===`
5
- `&&(i+=1);let r=[];t.push(r),n=r,i+=1;continue}if(o===` `||o===` `){let t=i+1;for(;t<r;){let n=e[t];if(n!==` `&&n!==` `)break;t+=1}a(e.slice(i,t),null),i=t;continue}if(o===`{`||o===`}`||o===`[`||o===`]`){a(o,Z),i+=1;continue}if(o===`:`||o===`,`){a(o,`var(--shiki-token-punctuation)`),i+=1;continue}if(o===`"`){i=Ae(e,i,a);continue}let s=i+1;for(;s<r&&!ke(e[s]??``);)s+=1;a(e.slice(i,s),`var(--shiki-token-constant)`),i=s}return t.map(je).join(`
6
- `)}function Me(e){let t=new WeakSet;try{return JSON.stringify(e,(e,n)=>{if(typeof n==`bigint`)return n.toString();if(typeof n==`object`&&n){if(t.has(n))return`[Circular]`;t.add(n)}return n},2)??``}catch{try{return String(e)}catch{return``}}}function Ne(e,{showLineNumbers:t=!1,foldable:n=!0}={}){let r=Me(e),i=d({html:$(r),foldableRanges:n?k(r):void 0,showLineNumbers:t});return p({language:`json`,code:r,preHtml:i,showLineNumbers:t})}function Pe(e,t){let n=1;if(n>t)return!0;for(let r=0;r<e.length;r++)if(e[r]===`
7
- `&&(n+=1,n>t))return!0;return!1}export{Oe as CodeBlock,v as computeFoldRanges,k as computeJsonFoldRanges,p as createMantleCodeBlockValue,d as decorateHighlightedHtml,D as defaultMeta,W as escapeHtml,A as finalizeFoldRanges,_ as foldStrategyFor,Pe as hasMoreThanNLines,w as inferIndentation,x as isIndentation,b as isSupportedLanguage,Ne as jsonCodeBlockValue,$ as jsonToShikiHtml,u as mantleCode,g as normalizeIndentation,S as normalizeValue,C as parseCodeBlockHighlightLines,E as parseCodeBlockLineNumberStart,m as parseCodeBlockShowLineNumbers,O as parseLanguage,T as parseMetastring,y as resolvePreRenderedCodeBlockProps,h as supportedLanguages,f as tokenizeMetastring};
5
+ `&&(i+=1);let r=[];t.push(r),n=r,i+=1;continue}if(o===` `||o===` `){let t=i+1;for(;t<r;){let n=e[t];if(n!==` `&&n!==` `)break;t+=1}a(e.slice(i,t),null),i=t;continue}if(o===`{`||o===`}`||o===`[`||o===`]`){a(o,Ee),i+=1;continue}if(o===`:`||o===`,`){a(o,`var(--shiki-token-punctuation)`),i+=1;continue}if(o===`"`){i=ke(e,i,a);continue}let s=i+1;for(;s<r&&!Oe(e[s]??``);)s+=1;a(e.slice(i,s),`var(--shiki-token-constant)`),i=s}return t.map(Ae).join(`
6
+ `)}function Me(e){let t=new WeakSet;try{return JSON.stringify(e,(e,n)=>{if(typeof n==`bigint`)return n.toString();if(typeof n==`object`&&n){if(t.has(n))return`[Circular]`;t.add(n)}return n},2)??``}catch{try{return String(e)}catch{return``}}}function Ne(e,{showLineNumbers:t=!1,foldable:n=!0}={}){let r=Me(e),i=d({html:je(r),foldableRanges:n?k(r):void 0,showLineNumbers:t});return p({language:`json`,code:r,preHtml:i,showLineNumbers:t})}function Pe(e,t){let n=1;if(n>t)return!0;for(let r=0;r<e.length;r++)if(e[r]===`
7
+ `&&(n+=1,n>t))return!0;return!1}export{we as CodeBlock,v as computeFoldRanges,k as computeJsonFoldRanges,p as createMantleCodeBlockValue,d as decorateHighlightedHtml,D as defaultMeta,ie as escapeHtml,A as finalizeFoldRanges,_ as foldStrategyFor,Pe as hasMoreThanNLines,w as inferIndentation,x as isIndentation,b as isSupportedLanguage,Ne as jsonCodeBlockValue,je as jsonToShikiHtml,u as mantleCode,g as normalizeIndentation,S as normalizeValue,C as parseCodeBlockHighlightLines,E as parseCodeBlockLineNumberStart,m as parseCodeBlockShowLineNumbers,O as parseLanguage,T as parseMetastring,y as resolvePreRenderedCodeBlockProps,h as supportedLanguages,f as tokenizeMetastring};
package/dist/code.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./slot-C3gII_9c.js";import{jsx as n}from"react/jsx-runtime";const r=({asChild:r,className:i,ref:a,...o})=>n(r?t:`code`,{ref:a,"data-slot":`code`,className:e(`border-gray-500/15 rounded-md border bg-gray-500/5 px-1 font-mono text-[0.8em]`,i),translate:`no`,...o});export{r as Code};
1
+ import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./slot-BsvE2ntj.js";import{c as n}from"react/compiler-runtime";import{jsx as r}from"react/jsx-runtime";const i=i=>{let a=n(12),o,s,c,l;a[0]===i?(o=a[1],s=a[2],c=a[3],l=a[4]):({asChild:o,className:s,ref:l,...c}=i,a[0]=i,a[1]=o,a[2]=s,a[3]=c,a[4]=l);let u=o?t:`code`,d;a[5]===s?d=a[6]:(d=e(`border-gray-500/15 rounded-md border bg-gray-500/5 px-1 font-mono text-[0.8em]`,s),a[5]=s,a[6]=d);let f;return a[7]!==u||a[8]!==c||a[9]!==l||a[10]!==d?(f=r(u,{ref:l,"data-slot":`code`,className:d,translate:`no`,...c}),a[7]=u,a[8]=c,a[9]=l,a[10]=d,a[11]=f):f=a[11],f};export{i as Code};
package/dist/combobox.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./slot-C3gII_9c.js";import{a as n,r}from"./field-Bpptk_9t.js";import{n as i}from"./separator-Da8lDnio.js";import{jsx as a}from"react/jsx-runtime";import*as o from"@ariakit/react";const s={Root:({children:e,...t})=>a(o.ComboboxProvider,{...t,children:e}),Content:({asChild:n=!1,children:r,className:i,ref:s,sameWidth:c=!0,unmountOnHide:l=!0,...u})=>a(o.ComboboxPopover,{"data-slot":`combobox-content`,className:e(`border-popover bg-popover relative z-50 max-h-96 min-w-32 scrollbar overflow-y-scroll overflow-x-hidden rounded-md border shadow-md p-1 my-2 space-y-px font-sans focus:outline-hidden`,i),ref:s,render:n?({ref:e,...n})=>a(t,{ref:e,...n}):void 0,sameWidth:c,unmountOnHide:l,...u,children:r}),Group:({asChild:n=!1,children:r,className:i,ref:s,...c})=>a(o.ComboboxGroup,{"data-slot":`combobox-group`,className:e(`space-y-px`,i),ref:s,render:n?({ref:e,...n})=>a(t,{ref:e,...n}):void 0,...c,children:r}),GroupLabel:({asChild:n=!1,children:r,className:i,ref:s,...c})=>a(o.ComboboxGroupLabel,{"data-slot":`combobox-group-label`,className:e(`text-muted px-2 py-1 text-xs font-medium`,i),ref:s,render:n?({ref:e,...n})=>a(t,{ref:e,...n}):void 0,...c,children:r}),Input:({"aria-invalid":t,autoComplete:i=`list`,autoSelect:s=`always`,className:c,ref:l,validation:u,...d})=>{let f=n(),{ariaInvalid:p,validation:m}=r({"aria-invalid":t,validation:u??f});return a(o.Combobox,{"aria-invalid":p,autoComplete:i,autoSelect:s,"data-slot":`combobox-input`,className:e(`pointer-coarse:text-base h-9 text-sm`,`bg-form relative block w-full rounded-md border px-3 py-2 border-form text-strong font-sans`,`placeholder:text-placeholder`,`aria-disabled:opacity-50`,`hover:border-neutral-400`,`focus:outline-hidden focus:ring-4 aria-expanded:ring-4`,`focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent`,`data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success`,`data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning`,`data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger`,`autofill:shadow-(--color-blue-50) autofill:bg-blue-50 autofill:[-webkit-text-fill-color:var(--text-color-strong)]`,c),"data-validation":m||void 0,ref:l,...d})},Item:({asChild:n=!1,children:r,className:i,focusOnHover:s=!0,ref:c,value:l,...u})=>a(o.ComboboxItem,{"data-slot":`combobox-item`,className:e(`cursor-pointer rounded-md px-2 py-1.5 text-strong text-sm flex min-w-0 gap-2 items-center [&>svg]:size-5 [&_svg]:shrink-0`,`data-active-item:bg-active-menu-item`,`aria-disabled:opacity-50`,i),focusOnHover:s,ref:c,render:n?({ref:e,...n})=>a(t,{ref:e,...n}):void 0,value:l,...u,children:r}),ItemValue:({asChild:n=!1,className:r,ref:i,...s})=>a(o.ComboboxItemValue,{"data-slot":`combobox-item-value`,className:e(`*:data-user-value:font-medium flex-1 shrink-0 text-strong font-normal`,r),ref:i,render:n?({ref:e,...n})=>a(t,{ref:e,...n}):void 0,...s}),Separator:({className:t,ref:n,...r})=>a(i,{ref:n,"data-slot":`combobox-separator`,className:e(`-mx-1.25 my-1 w-auto`,t),...r})};export{s as Combobox};
1
+ import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./slot-BsvE2ntj.js";import{a as n,r}from"./field-Bpptk_9t.js";import{n as i}from"./separator-D98be0gY.js";import{c as a}from"react/compiler-runtime";import{jsx as o}from"react/jsx-runtime";import*as s from"@ariakit/react";const c={Root:e=>{let t=a(6),n,r;t[0]===e?(n=t[1],r=t[2]):({children:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=o(s.ComboboxProvider,{...r,children:n}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i},Content:t=>{let n=a(18),r,i,c,u,d,f,p;n[0]===t?(r=n[1],i=n[2],c=n[3],u=n[4],d=n[5],f=n[6],p=n[7]):({asChild:d,children:r,className:i,ref:u,sameWidth:f,unmountOnHide:p,...c}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=c,n[4]=u,n[5]=d,n[6]=f,n[7]=p);let m=d!==void 0&&d,h=f===void 0||f,g=p===void 0||p,_;n[8]===i?_=n[9]:(_=e(`border-popover bg-popover relative z-50 max-h-96 min-w-32 scrollbar overflow-y-scroll overflow-x-hidden rounded-md border shadow-md p-1 my-2 space-y-px font-sans focus:outline-hidden`,i),n[8]=i,n[9]=_);let v=m?l:void 0,y;return n[10]!==r||n[11]!==c||n[12]!==u||n[13]!==h||n[14]!==_||n[15]!==v||n[16]!==g?(y=o(s.ComboboxPopover,{"data-slot":`combobox-content`,className:_,ref:u,render:v,sameWidth:h,unmountOnHide:g,...c,children:r}),n[10]=r,n[11]=c,n[12]=u,n[13]=h,n[14]=_,n[15]=v,n[16]=g,n[17]=y):y=n[17],y},Group:t=>{let n=a(14),r,i,c,l,u;n[0]===t?(r=n[1],i=n[2],c=n[3],l=n[4],u=n[5]):({asChild:u,children:r,className:i,ref:l,...c}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=c,n[4]=l,n[5]=u);let f=u!==void 0&&u,p;n[6]===i?p=n[7]:(p=e(`space-y-px`,i),n[6]=i,n[7]=p);let m=f?d:void 0,h;return n[8]!==r||n[9]!==c||n[10]!==l||n[11]!==p||n[12]!==m?(h=o(s.ComboboxGroup,{"data-slot":`combobox-group`,className:p,ref:l,render:m,...c,children:r}),n[8]=r,n[9]=c,n[10]=l,n[11]=p,n[12]=m,n[13]=h):h=n[13],h},GroupLabel:t=>{let n=a(14),r,i,c,l,u;n[0]===t?(r=n[1],i=n[2],c=n[3],l=n[4],u=n[5]):({asChild:u,children:r,className:i,ref:l,...c}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=c,n[4]=l,n[5]=u);let d=u!==void 0&&u,p;n[6]===i?p=n[7]:(p=e(`text-muted px-2 py-1 text-xs font-medium`,i),n[6]=i,n[7]=p);let m=d?f:void 0,h;return n[8]!==r||n[9]!==c||n[10]!==l||n[11]!==p||n[12]!==m?(h=o(s.ComboboxGroupLabel,{"data-slot":`combobox-group-label`,className:p,ref:l,render:m,...c,children:r}),n[8]=r,n[9]=c,n[10]=l,n[11]=p,n[12]=m,n[13]=h):h=n[13],h},Input:t=>{let i=a(21),c,l,u,d,f,p,m;i[0]===t?(c=i[1],l=i[2],u=i[3],d=i[4],f=i[5],p=i[6],m=i[7]):({"aria-invalid":c,autoComplete:p,autoSelect:m,className:u,ref:f,validation:l,...d}=t,i[0]=t,i[1]=c,i[2]=l,i[3]=u,i[4]=d,i[5]=f,i[6]=p,i[7]=m);let h=p===void 0?`list`:p,g=m===void 0?`always`:m,_=n(),v=l??_,y;i[8]!==c||i[9]!==v?(y=r({"aria-invalid":c,validation:v}),i[8]=c,i[9]=v,i[10]=y):y=i[10];let{ariaInvalid:b,validation:x}=y,S;i[11]===u?S=i[12]:(S=e(`pointer-coarse:text-base h-9 text-sm`,`bg-form relative block w-full rounded-md border px-3 py-2 border-form text-strong font-sans`,`placeholder:text-placeholder`,`aria-disabled:opacity-50`,`hover:border-neutral-400`,`focus:outline-hidden focus:ring-4 aria-expanded:ring-4`,`focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent`,`data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success`,`data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning`,`data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger`,`autofill:shadow-(--color-blue-50) autofill:bg-blue-50 autofill:[-webkit-text-fill-color:var(--text-color-strong)]`,u),i[11]=u,i[12]=S);let C=x||void 0,w;return i[13]!==b||i[14]!==h||i[15]!==g||i[16]!==d||i[17]!==f||i[18]!==S||i[19]!==C?(w=o(s.Combobox,{"aria-invalid":b,autoComplete:h,autoSelect:g,"data-slot":`combobox-input`,className:S,"data-validation":C,ref:f,...d}),i[13]=b,i[14]=h,i[15]=g,i[16]=d,i[17]=f,i[18]=S,i[19]=C,i[20]=w):w=i[20],w},Item:t=>{let n=a(18),r,i,c,l,d,f,p;n[0]===t?(r=n[1],i=n[2],c=n[3],l=n[4],d=n[5],f=n[6],p=n[7]):({asChild:d,children:r,className:i,focusOnHover:f,ref:l,value:p,...c}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=c,n[4]=l,n[5]=d,n[6]=f,n[7]=p);let m=d!==void 0&&d,h=f===void 0||f,g;n[8]===i?g=n[9]:(g=e(`cursor-pointer rounded-md px-2 py-1.5 text-strong text-sm flex min-w-0 gap-2 items-center [&>svg]:size-5 [&_svg]:shrink-0`,`data-active-item:bg-active-menu-item`,`aria-disabled:opacity-50`,i),n[8]=i,n[9]=g);let _=m?u:void 0,v;return n[10]!==r||n[11]!==h||n[12]!==c||n[13]!==l||n[14]!==g||n[15]!==_||n[16]!==p?(v=o(s.ComboboxItem,{"data-slot":`combobox-item`,className:g,focusOnHover:h,ref:l,render:_,value:p,...c,children:r}),n[10]=r,n[11]=h,n[12]=c,n[13]=l,n[14]=g,n[15]=_,n[16]=p,n[17]=v):v=n[17],v},ItemValue:t=>{let n=a(12),r,i,c,l;n[0]===t?(r=n[1],i=n[2],c=n[3],l=n[4]):({asChild:l,className:r,ref:c,...i}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=c,n[4]=l);let u=l!==void 0&&l,d;n[5]===r?d=n[6]:(d=e(`*:data-user-value:font-medium flex-1 shrink-0 text-strong font-normal`,r),n[5]=r,n[6]=d);let f=u?p:void 0,m;return n[7]!==i||n[8]!==c||n[9]!==d||n[10]!==f?(m=o(s.ComboboxItemValue,{"data-slot":`combobox-item-value`,className:d,ref:c,render:f,...i}),n[7]=i,n[8]=c,n[9]=d,n[10]=f,n[11]=m):m=n[11],m},Separator:t=>{let n=a(10),r,s,c;n[0]===t?(r=n[1],s=n[2],c=n[3]):({className:r,ref:c,...s}=t,n[0]=t,n[1]=r,n[2]=s,n[3]=c);let l;n[4]===r?l=n[5]:(l=e(`-mx-1.25 my-1 w-auto`,r),n[4]=r,n[5]=l);let u;return n[6]!==s||n[7]!==c||n[8]!==l?(u=o(i,{ref:c,"data-slot":`combobox-separator`,className:l,...s}),n[6]=s,n[7]=c,n[8]=l,n[9]=u):u=n[9],u}};function l(e){let{ref:n,...r}=e;return o(t,{ref:n,...r})}function u(e){let{ref:n,...r}=e;return o(t,{ref:n,...r})}function d(e){let{ref:n,...r}=e;return o(t,{ref:n,...r})}function f(e){let{ref:n,...r}=e;return o(t,{ref:n,...r})}function p(e){let{ref:n,...r}=e;return o(t,{ref:n,...r})}export{c as Combobox};
package/dist/command.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./cx-0HCjnNv1.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./slot-C3gII_9c.js";import{t as i}from"./use-is-hydrated-DDCqXmju.js";import{n as a}from"./separator-Da8lDnio.js";import{t as o}from"./dialog-CA-1Z0Np.js";import{n as s,t as c}from"./use-is-apple-platform-CMPzIYjz.js";import{t as l}from"./use-callback-ref-IYti9y7x.js";import{t as u}from"./kbd-4_0Y_8rx.js";import{createContext as d,useCallback as f,useContext as p,useEffect as m,useMemo as h,useRef as g,useState as _}from"react";import v from"tiny-invariant";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{MagnifyingGlassIcon as x}from"@phosphor-icons/react/MagnifyingGlass";import{Command as S,useCommandState as C}from"cmdk";const w=d(null);function T(){let e=p(w);return v(e,`useCommandDialog must be used within Command.DialogRoot.`),e}function E(){return p(w)}function D(e){let t=p(w);return v(t,`Command.${e} must be rendered inside Command.DialogRoot.`),t}const O=new Set([` `,`Enter`]);function k(e){return e.isComposing||e.key===`Process`||e.keyCode===229?{type:`open`}:e.metaKey||e.ctrlKey||e.altKey||O.has(e.key)?{type:`ignore`}:[...e.key].length===1?{type:`seed`,query:e.key}:{type:`ignore`}}function A(e){let t=(e.clipboardData?.getData(`text/plain`)??``).replace(/\s+/g,` `).trim();return t===``?{type:`open`}:{type:`seed`,query:t}}const j=({"aria-keyshortcuts":e,children:t,"data-slot":i,onKeyDown:a,onPaste:s,...l})=>{let{keyboardShortcut:u,open:d,openWithQuery:f}=D(`SearchTrigger`),p=c(),m=e=>{e.type!==`ignore`&&f(e.type===`seed`?e.query:void 0)},h=p?`Meta+K`:`Control+K`;return y(o.Trigger,{asChild:!0,children:y(r,{...l,"aria-keyshortcuts":e??(u?h:void 0),"data-slot":n(i,`command-search-trigger`),"data-state":d?`open`:`closed`,onKeyDown:e=>{if(a?.(e),e.defaultPrevented)return;let t=k(e.nativeEvent);t.type===`seed`&&e.preventDefault(),m(t)},onPaste:e=>{s?.(e),!e.defaultPrevented&&m(A(e.nativeEvent))},children:t})})},M=[];function N(){let e=Symbol(`command-keyboard-shortcut`);return M.push(e),{isOwner:()=>M[0]===e,release:()=>{let t=M.indexOf(e);t!==-1&&M.splice(t,1)}}}function P(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`TEXTAREA`:!1}function F({enabled:e,onTrigger:t}){let n=l(t);m(()=>{if(!e)return;let t=N(),r=s(),i=e=>{if(!t.isOwner()||e.defaultPrevented||e.repeat||P(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 I=({className:e,...n})=>y(S,{"data-slot":`command`,className:t(`bg-popover flex h-full w-full flex-col overflow-hidden rounded-md`,e),...n}),L={Root:I,DialogRoot:({children:t,defaultOpen:n=!1,keyboardShortcut:r=!0,onOpenChange:i,open:a,...s})=>{let c=a!=null,[l,u]=_(n),d=c?a:l,[p,m]=_(``),v=g(i);e(()=>{v.current=i});let b=f((e,t)=>{e&&m(t??``),c||u(e),v.current?.(e)},[c]),x=f(e=>{b(e)},[b]),S=f(e=>{b(!0,e)},[b]),C=f(()=>{b(!d)},[b,d]);F({enabled:r,onTrigger:C});let T=h(()=>({keyboardShortcut:r,open:d,openWithQuery:S,query:p,setOpen:x,setQuery:m,toggle:C}),[r,d,S,p,x,C]);return y(w.Provider,{value:T,children:y(o.Root,{open:d,onOpenChange:x,...s,children:t})})},SearchTrigger:j,DialogTrigger:o.Trigger,DialogContent:({children:e,className:n,description:r=`Search for a command to run...`,filter:i,shouldFilter:a,showCloseButton:s=!0,title:c=`Command Palette`})=>{let l=g(null);return b(o.Content,{ref:l,className:t(`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:[b(o.Header,{className:`sr-only absolute`,children:[y(o.Title,{children:c}),y(o.Description,{children:r})]}),y(I,{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:i,shouldFilter:a,children:e}),s&&y(`div`,{className:`absolute top-1.5 right-1.5`,children:y(o.CloseIconButton,{})})]})},Input:({className:e,"data-slot":r,onValueChange:i,ref:a,value:o,...s})=>{let c=E(),l=o!=null,u=l?o:c?.query;return b(`div`,{ref:a,"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b border-popover px-3`,children:[y(x,{"aria-hidden":!0,className:`size-5 shrink-0 opacity-50`}),y(S.Input,{className:t(`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`,e),onValueChange:e=>{l||c?.setQuery(e),i?.(e)},value:u,...s,"data-slot":n(r,`command-input`)})]})},List:({className:e,...n})=>y(S.List,{"data-slot":`command-list`,className:t(`max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto scrollbar`,e),...n}),Empty:({className:e,...n})=>i()?y(S.Empty,{"data-slot":`command-empty`,className:t(`py-6 text-center text-sm`,e),...n}):null,Group:({className:e,...n})=>y(S.Group,{"data-slot":`command-group`,className:t(`[&>[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`,e),...n}),Item:({className:e,...n})=>y(S.Item,{"data-slot":`command-item`,className:t(`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`,e),...n}),Shortcut:({className:e,...n})=>y(`span`,{"data-slot":`command-shortcut`,className:t(`text-muted ml-auto text-xs tracking-widest`,e),...n,translate:`no`}),Separator:({className:e,...n})=>y(S.Separator,{"data-slot":`command-separator`,asChild:!0,...n,children:y(a,{className:t(`-mx-1 my-1 w-auto`,e)})})};function R({className:e,...n}){let r=c(),i=r?`⌘`:`⌃`,a=r?`Command`:`Control`;return b(u,{...n,suppressHydrationWarning:!0,"data-slot":`meta-key`,className:t(i===`⌃`&&`font-medium`,e),children:[y(`span`,{className:`sr-only`,children:a}),y(`span`,{"aria-hidden":!0,children:i})]})}export{L as Command,R as MetaKey,k as searchActionFromKeyDown,A as searchActionFromPaste,T as useCommandDialog,C as useCommandState};
1
+ import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./cx-0HCjnNv1.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./slot-BsvE2ntj.js";import{t as i}from"./use-is-hydrated-DDCqXmju.js";import{n as a}from"./separator-D98be0gY.js";import{t as o}from"./dialog-Ddhwzen3.js";import{n as s,t as c}from"./use-is-apple-platform-CMPzIYjz.js";import{t as l}from"./use-callback-ref-BvVyI5K1.js";import{t as u}from"./kbd-CJ8hNZfS.js";import{c as d}from"react/compiler-runtime";import{createContext as f,useContext as p,useEffect as m,useRef as h,useState as g}from"react";import _ from"tiny-invariant";import{jsx as v,jsxs as y}from"react/jsx-runtime";import{MagnifyingGlassIcon as b}from"@phosphor-icons/react/MagnifyingGlass";import{Command as x,useCommandState as S}from"cmdk";const C=f(null);function w(){let e=p(C);return _(e,`useCommandDialog must be used within Command.DialogRoot.`),e}function T(){return p(C)}function E(e){let t=p(C);return _(t,`Command.${e} must be rendered inside Command.DialogRoot.`),t}const D=new Set([` `,`Enter`]);function O(e){return e.isComposing||e.key===`Process`||e.keyCode===229?{type:`open`}:e.metaKey||e.ctrlKey||e.altKey||D.has(e.key)?{type:`ignore`}:[...e.key].length===1?{type:`seed`,query:e.key}:{type:`ignore`}}function k(e){let t=(e.clipboardData?.getData(`text/plain`)??``).replace(/\s+/g,` `).trim();return t===``?{type:`open`}:{type:`seed`,query:t}}const A=e=>{let t=d(25),i,a,s,l,u,f;t[0]===e?(i=t[1],a=t[2],s=t[3],l=t[4],u=t[5],f=t[6]):({"aria-keyshortcuts":i,children:a,"data-slot":s,onKeyDown:l,onPaste:u,...f}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=s,t[4]=l,t[5]=u,t[6]=f);let{keyboardShortcut:p,open:m,openWithQuery:h}=E(`SearchTrigger`),g=c(),_;t[7]===h?_=t[8]:(_=e=>{e.type!==`ignore`&&h(e.type===`seed`?e.query:void 0)},t[7]=h,t[8]=_);let y=_,b=i??(p?g?`Meta+K`:`Control+K`:void 0),x;t[9]===s?x=t[10]:(x=n(s,`command-search-trigger`),t[9]=s,t[10]=x);let S=m?`open`:`closed`,C;t[11]!==y||t[12]!==l?(C=e=>{if(l?.(e),e.defaultPrevented)return;let t=O(e.nativeEvent);t.type===`seed`&&e.preventDefault(),y(t)},t[11]=y,t[12]=l,t[13]=C):C=t[13];let w;t[14]!==y||t[15]!==u?(w=e=>{u?.(e),!e.defaultPrevented&&y(k(e.nativeEvent))},t[14]=y,t[15]=u,t[16]=w):w=t[16];let T;return t[17]!==a||t[18]!==f||t[19]!==b||t[20]!==x||t[21]!==S||t[22]!==C||t[23]!==w?(T=v(o.Trigger,{asChild:!0,children:v(r,{...f,"aria-keyshortcuts":b,"data-slot":x,"data-state":S,onKeyDown:C,onPaste:w,children:a})}),t[17]=a,t[18]=f,t[19]=b,t[20]=x,t[21]=S,t[22]=C,t[23]=w,t[24]=T):T=t[24],T},j=[];function M(){let e=Symbol(`command-keyboard-shortcut`);return j.push(e),{isOwner:()=>j[0]===e,release:()=>{let t=j.indexOf(e);t!==-1&&j.splice(t,1)}}}function N(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName===`TEXTAREA`:!1}function P(e){let t=d(4),{enabled:n,onTrigger:r}=e,i=l(r),a,o;t[0]!==n||t[1]!==i?(a=()=>{if(!n)return;let e=M(),t=s(),r=n=>{if(!e.isOwner()||n.defaultPrevented||n.repeat||N(n.target))return;let r=t?n.metaKey:n.ctrlKey,a=t?n.ctrlKey:n.metaKey;n.key.toLowerCase()===`k`&&r&&!a&&!n.altKey&&!n.shiftKey&&(n.preventDefault(),i())};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),e.release()}},o=[n,i],t[0]=n,t[1]=i,t[2]=a,t[3]=o):(a=t[2],o=t[3]),m(a,o)}const F=e=>{let n=d(8),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=t(`bg-popover flex h-full w-full flex-col overflow-hidden rounded-md`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=v(x,{"data-slot":`command`,className:a,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o},I={Root:F,DialogRoot:t=>{let n=d(36),r,i,a,s,c,l;n[0]===t?(r=n[1],i=n[2],a=n[3],s=n[4],c=n[5],l=n[6]):({children:r,defaultOpen:c,keyboardShortcut:l,onOpenChange:i,open:a,...s}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=a,n[4]=s,n[5]=c,n[6]=l);let u=c!==void 0&&c,f=l===void 0||l,p=a!=null,[m,_]=g(u),y=p?a:m,[b,x]=g(``),S=h(i),w;n[7]===i?w=n[8]:(w=()=>{S.current=i},n[7]=i,n[8]=w),e(w);let T;n[9]===p?T=n[10]:(T=(e,t)=>{e&&x(t??``),p||_(e),S.current?.(e)},n[9]=p,n[10]=T);let E=T,D;n[11]===E?D=n[12]:(D=e=>{E(e)},n[11]=E,n[12]=D);let O=D,k;n[13]===E?k=n[14]:(k=e=>{E(!0,e)},n[13]=E,n[14]=k);let A=k,j;n[15]!==E||n[16]!==y?(j=()=>{E(!y)},n[15]=E,n[16]=y,n[17]=j):j=n[17];let M=j,N;n[18]!==f||n[19]!==M?(N={enabled:f,onTrigger:M},n[18]=f,n[19]=M,n[20]=N):N=n[20],P(N);let F;n[21]!==f||n[22]!==y||n[23]!==A||n[24]!==b||n[25]!==O||n[26]!==M?(F={keyboardShortcut:f,open:y,openWithQuery:A,query:b,setOpen:O,setQuery:x,toggle:M},n[21]=f,n[22]=y,n[23]=A,n[24]=b,n[25]=O,n[26]=M,n[27]=F):F=n[27];let I=F,L;n[28]!==r||n[29]!==y||n[30]!==s||n[31]!==O?(L=v(o.Root,{open:y,onOpenChange:O,...s,children:r}),n[28]=r,n[29]=y,n[30]=s,n[31]=O,n[32]=L):L=n[32];let R;return n[33]!==I||n[34]!==L?(R=v(C.Provider,{value:I,children:L}),n[33]=I,n[34]=L,n[35]=R):R=n[35],R},SearchTrigger:A,DialogTrigger:o.Trigger,DialogContent:e=>{let n=d(21),{children:r,className:i,description:a,filter:s,shouldFilter:c,showCloseButton:l,title:u}=e,f=a===void 0?`Search for a command to run...`:a,p=l===void 0||l,m=u===void 0?`Command Palette`:u,g=h(null),_;n[0]===i?_=n[1]:(_=t(`overflow-hidden p-0 relative`,i),n[0]=i,n[1]=_);let b;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>{let t=g.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)},n[2]=b):b=n[2];let x;n[3]===m?x=n[4]:(x=v(o.Title,{children:m}),n[3]=m,n[4]=x);let S;n[5]===f?S=n[6]:(S=v(o.Description,{children:f}),n[5]=f,n[6]=S);let C;n[7]!==x||n[8]!==S?(C=y(o.Header,{className:`sr-only absolute`,children:[x,S]}),n[7]=x,n[8]=S,n[9]=C):C=n[9];let w;n[10]!==r||n[11]!==s||n[12]!==c?(w=v(F,{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:s,shouldFilter:c,children:r}),n[10]=r,n[11]=s,n[12]=c,n[13]=w):w=n[13];let T;n[14]===p?T=n[15]:(T=p&&v(`div`,{className:`absolute top-1.5 right-1.5`,children:v(o.CloseIconButton,{})}),n[14]=p,n[15]=T);let E;return n[16]!==T||n[17]!==_||n[18]!==C||n[19]!==w?(E=y(o.Content,{ref:g,className:_,onOpenAutoFocus:b,children:[C,w,T]}),n[16]=T,n[17]=_,n[18]=C,n[19]=w,n[20]=E):E=n[20],E},Input:e=>{let r=d(25),i,a,o,s,c,l;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],l=r[6]):({className:i,"data-slot":a,onValueChange:o,ref:c,value:l,...s}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c,r[6]=l);let u=T(),f=l!=null,p=f?l:u?.query,m;r[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=v(b,{"aria-hidden":!0,className:`size-5 shrink-0 opacity-50`}),r[7]=m):m=r[7];let h;r[8]===i?h=r[9]:(h=t(`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`,i),r[8]=i,r[9]=h);let g;r[10]!==u||r[11]!==f||r[12]!==o?(g=e=>{f||u?.setQuery(e),o?.(e)},r[10]=u,r[11]=f,r[12]=o,r[13]=g):g=r[13];let _;r[14]===a?_=r[15]:(_=n(a,`command-input`),r[14]=a,r[15]=_);let S;r[16]!==s||r[17]!==p||r[18]!==h||r[19]!==g||r[20]!==_?(S=v(x.Input,{className:h,onValueChange:g,value:p,...s,"data-slot":_}),r[16]=s,r[17]=p,r[18]=h,r[19]=g,r[20]=_,r[21]=S):S=r[21];let C;return r[22]!==c||r[23]!==S?(C=y(`div`,{ref:c,"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b border-popover px-3`,children:[m,S]}),r[22]=c,r[23]=S,r[24]=C):C=r[24],C},List:e=>{let n=d(8),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=t(`max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto scrollbar`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=v(x.List,{"data-slot":`command-list`,className:a,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o},Empty:e=>{let n=d(8),r,a;if(n[0]===e?(r=n[1],a=n[2]):({className:r,...a}=e,n[0]=e,n[1]=r,n[2]=a),!i())return null;let o;n[3]===r?o=n[4]:(o=t(`py-6 text-center text-sm`,r),n[3]=r,n[4]=o);let s;return n[5]!==a||n[6]!==o?(s=v(x.Empty,{"data-slot":`command-empty`,className:o,...a}),n[5]=a,n[6]=o,n[7]=s):s=n[7],s},Group:e=>{let n=d(8),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=t(`[&>[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`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=v(x.Group,{"data-slot":`command-group`,className:a,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o},Item:e=>{let n=d(8),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=t(`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`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=v(x.Item,{"data-slot":`command-item`,className:a,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o},Shortcut:e=>{let n=d(8),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=t(`text-muted ml-auto text-xs tracking-widest`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=v(`span`,{"data-slot":`command-shortcut`,className:a,...i,translate:`no`}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o},Separator:e=>{let n=d(10),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let o;n[3]===r?o=n[4]:(o=t(`-mx-1 my-1 w-auto`,r),n[3]=r,n[4]=o);let s;n[5]===o?s=n[6]:(s=v(a,{className:o}),n[5]=o,n[6]=s);let c;return n[7]!==i||n[8]!==s?(c=v(x.Separator,{"data-slot":`command-separator`,asChild:!0,...i,children:s}),n[7]=i,n[8]=s,n[9]=c):c=n[9],c}};function L(e){let n=d(15),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a=c(),o=a?`⌘`:`⌃`,s=a?`Command`:`Control`,l=o===`⌃`&&`font-medium`,f;n[3]!==r||n[4]!==l?(f=t(l,r),n[3]=r,n[4]=l,n[5]=f):f=n[5];let p;n[6]===s?p=n[7]:(p=v(`span`,{className:`sr-only`,children:s}),n[6]=s,n[7]=p);let m;n[8]===o?m=n[9]:(m=v(`span`,{"aria-hidden":!0,children:o}),n[8]=o,n[9]=m);let h;return n[10]!==i||n[11]!==f||n[12]!==p||n[13]!==m?(h=y(u,{...i,suppressHydrationWarning:!0,"data-slot":`meta-key`,className:f,children:[p,m]}),n[10]=i,n[11]=f,n[12]=p,n[13]=m,n[14]=h):h=n[14],h}export{I as Command,L as MetaKey,O as searchActionFromKeyDown,k as searchActionFromPaste,w as useCommandDialog,S as useCommandState};
@@ -0,0 +1 @@
1
+ import{c as e}from"react/compiler-runtime";function t(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function n(...e){return n=>{let r=!1,i=e.map(e=>{let i=t(e,n);return typeof i==`function`&&(r=!0),i});if(r)return()=>{for(let n=0;n<i.length;n++){let r=i[n];typeof r==`function`?r():t(e[n],null)}}}}function r(t,r,i){let a=e(4),o;return a[0]!==t||a[1]!==r||a[2]!==i?(o=e=>n(t,r,i)(e),a[0]=t,a[1]=r,a[2]=i,a[3]=o):o=a[3],o}export{r as n,n as t};
@@ -1 +1 @@
1
- import{n as e}from"./browser-only-CmEEzfU3.js";async function t(t){if(!e())throw Error(`copyToClipboard requires a DOM environment`);try{if(typeof navigator.clipboard?.writeText==`function`)await navigator.clipboard.writeText(t);else throw Error(`writeText not supported`)}catch(e){try{n(t)}catch{throw e}}}function n(e){let t=document.createElement(`textarea`);t.value=e,document.body.appendChild(t);try{if(t.select(),!document.execCommand(`copy`))throw Error(`document.execCommand("copy") failed`)}finally{document.body.removeChild(t)}}export{t};
1
+ import{n as e}from"./browser-only-Crr3sgA0.js";async function t(t){if(!e())throw Error(`copyToClipboard requires a DOM environment`);try{if(typeof navigator.clipboard?.writeText==`function`)await navigator.clipboard.writeText(t);else throw Error(`writeText not supported`)}catch(e){try{n(t)}catch{throw e}}}function n(e){let t=document.createElement(`textarea`);t.value=e,document.body.appendChild(t);try{if(t.select(),!document.execCommand(`copy`))throw Error(`document.execCommand("copy") failed`)}finally{document.body.removeChild(t)}}export{t};