@brickkit/cli 0.10.0 → 0.11.0

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 (76) hide show
  1. package/README.md +1 -1
  2. package/dashboard-dist/CollapsiblePanel-BX79_W-b.js +2 -0
  3. package/dashboard-dist/CompositeRoot-xzybXjnx.js +1 -0
  4. package/dashboard-dist/PopoverPopup-CvlmC7EL.js +1 -0
  5. package/dashboard-dist/{api-reference-r893F8zi.js → api-reference-BcAYVYwJ.js} +8 -8
  6. package/dashboard-dist/app.css +1 -1
  7. package/dashboard-dist/app.js +13 -13
  8. package/dashboard-dist/core-BGO9JZ1r.js +1 -0
  9. package/dashboard-dist/docs-DHikPD2v.js +4 -0
  10. package/dashboard-dist/kit.js +1 -0
  11. package/dashboard-dist/popover-DG498XHH.js +1 -0
  12. package/dashboard-dist/react-dom-client.js +3 -0
  13. package/dashboard-dist/react-dom.js +3 -0
  14. package/dashboard-dist/react-jsx-runtime.js +1 -1
  15. package/dashboard-dist/react.js +3 -3
  16. package/dashboard-dist/theme.css +123 -0
  17. package/dist/bin.d.ts.map +1 -1
  18. package/dist/bin.js +440 -44
  19. package/dist/bin.js.map +1 -1
  20. package/dist/client-contract-file2.js +1 -1
  21. package/dist/client-contract2.js +12 -6
  22. package/dist/client-contract2.js.map +1 -1
  23. package/dist/config.js +252 -0
  24. package/dist/config.js.map +1 -0
  25. package/dist/dashboard-extension.d.ts +27 -0
  26. package/dist/dashboard-extension.d.ts.map +1 -0
  27. package/dist/dashboard.d.ts +3127 -0
  28. package/dist/dev-telemetry-store.js +1407 -952
  29. package/dist/dev-telemetry-store.js.map +1 -1
  30. package/dist/dev-worker.js +2 -2
  31. package/dist/index.d.ts +95 -6
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +4 -4
  34. package/dist/lint/eslint.d.ts +2 -0
  35. package/dist/lint/eslint.js +1 -0
  36. package/dist/lint/oxlint.d.ts +19 -0
  37. package/dist/lint/oxlint.d.ts.map +1 -0
  38. package/dist/lint/oxlint.js +19 -0
  39. package/dist/lint/oxlint.js.map +1 -0
  40. package/dist/plugin.d.ts +76 -0
  41. package/dist/plugin.d.ts.map +1 -0
  42. package/dist/plugin.js +66 -0
  43. package/dist/plugin.js.map +1 -0
  44. package/dist/presets.js +1070 -0
  45. package/dist/presets.js.map +1 -0
  46. package/dist/runner.js +112 -26
  47. package/dist/runner.js.map +1 -1
  48. package/dist/vite.d.ts +6 -3
  49. package/dist/vite.d.ts.map +1 -1
  50. package/dist/vite.js +9 -3
  51. package/dist/vite.js.map +1 -1
  52. package/dist/workflows2.js +1 -1
  53. package/inspector-dist/client/assets/app-CvoGgWcV.css +1 -0
  54. package/inspector-dist/client/assets/{manifest-4baa7c6f.js → manifest-139c9319.js} +1 -1
  55. package/inspector-dist/client/assets/root-BMHd_XHz.css +1 -0
  56. package/inspector-dist/server/assets/{app-C-ZVJtic.js → app-DUP5RybL.js} +11 -11
  57. package/inspector-dist/server/assets/{highlighted-body-B3W2YXNL-C8sq8F_D.js → highlighted-body-B3W2YXNL-D2g4hL2-.js} +1 -1
  58. package/inspector-dist/server/assets/{index-CYlmUaKx.js → index-D71yP6AL.js} +2 -2
  59. package/inspector-dist/server/assets/{index-CWJr34WJ.js → index-wGSWRns3.js} +1 -1
  60. package/inspector-dist/server/assets/{mermaid-3ZIDBTTL-Dv5rjfMN.js → mermaid-3ZIDBTTL-DsvuKoEV.js} +1 -1
  61. package/inspector-dist/server/assets/{token-DnLp3wBO.js → token-ClUZZwXl.js} +1 -1
  62. package/inspector-dist/server/assets/{token-util-Bpfp-B0w.js → token-util-DSxMZ6nI.js} +1 -1
  63. package/inspector-dist/server/assets/{wrapper-D5LIcZ_u.js → wrapper-B3vstpCO.js} +2 -2
  64. package/inspector-dist/server/assets/{zstd-browser-decoder-BM8GpVB8.js → zstd-browser-decoder-Dn82m2BU.js} +1 -1
  65. package/inspector-dist/server/index.js +1 -1
  66. package/package.json +30 -6
  67. package/dashboard-dist/CollapsiblePanel-a54TwMKb.js +0 -2
  68. package/dashboard-dist/PopoverPopup-BLzjTqsi.js +0 -1
  69. package/dashboard-dist/core-BWAwhSFf.js +0 -1
  70. package/dashboard-dist/docs-CkMy3Y5i.js +0 -4
  71. package/dashboard-dist/preload-helper-CjQDFR0M.js +0 -1
  72. package/dist/build.js +0 -119
  73. package/dist/build.js.map +0 -1
  74. package/inspector-dist/client/assets/app-CY7CQBRo.css +0 -1
  75. package/inspector-dist/client/assets/root-CfCr265_.css +0 -1
  76. /package/inspector-dist/client/assets/{root-Bmn5n3jF.js → root-cbi6iYwg.js} +0 -0
@@ -1,2 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{At as t,Bt as n,Dt as r,K as i,M as a,N as o,Ot as s,P as c,Qt as l,St as u,Tt as d,W as f,X as p,_n as m,_t as h,at as g,bt as _,c as v,dt as y,en as b,et as x,gn as S,ht as C,it as w,j as T,jt as E,k as D,kt as O,l as k,mn as A,n as j,nn as M,o as N,on as P,pn as F,pt as I,q as ee,r as L,s as R,tn as te,un as z,vt as B}from"./preload-helper-CjQDFR0M.js";var V={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};V.node;var H=A(V),U={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};U.node;var W=A(U),ne={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};ne.node;var G=A(ne),re={name:`clipboard`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]};re.node;var ie=A(re),ae={name:`copy-check`,size:24,node:[[`path`,{d:`m12 15 2 2 4-4`,key:`2c609p`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};ae.node;var oe=A(ae),se={name:`file`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]};se.node;var ce=A(se),le={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};le.node;var ue=A(le),de={name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]};de.node;var fe=A(de),pe={name:`link`,size:24,node:[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]};pe.node;var me=A(pe),he=48,K=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-he-t;return n},ge=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},_e=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-he;n+=i>>>1^-(i&1),t[r]=n}return t},ve=384,ye=[],be=ge(K(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),xe=ge(K(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),Se=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,Ce=(()=>{let e=be.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=be[n];i<be[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(be[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=be[i];a<be[i+1];a++)n[r++]=e,e+=t[e]}return n})(),we=K(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),Te=ge(K(`123333359346463635126536711576`)),Ee=K(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),De=K(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),Oe=_e(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),ke=(()=>{let e=new Int32Array(319).fill(-1),t=_e(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=_e(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),Ae=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),je=_e(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),Me=_e(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),Ne=_e(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±`),Pe=new Int32Array(995),Fe=new Int32Array(995),Ie=new Int32Array(995),Le=``,Re=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<je.length;r++)for(let i of Ae[Ne[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),Re[a*2]=Le.length,Re[a*2+1]=i.length,Le+=i),Pe[n]=je[r],Fe[n]=Me[r],Ie[n]=a,n++}}var q=_e(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),ze=ge(K(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),Be=_e(`2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222`),Ve=K(`ij`),He=K(`—`),Ue=K(`1`),We={GROUP_COUNT:ve,customValidatorNames:ye,edgeStart:be,labelStart:xe,labelText:Se,edgeTarget:Ce,nodeGroup:we,nodeVlist:ke,vlistPat:Te,vlistOps:Ee,vlistRef:De,vlistGroup:Oe,litAnchor:Pe,litGroup:Fe,litPool:Ie,poolOffsets:Re,poolText:Le,adjGid:q,adjStart:ze,adjTgt:Be,patGid:Ve,patTgt:He,postfixLookupGroups:Ue,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},Ge=`line`in Error(),Ke=-1,qe=-1,Je=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Ye=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},Xe=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let ee=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(Je(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;ee[n]!==-1;)n=n+1&I-1;ee[n]=e}let L=(e,t,n,r)=>{let i=(Je(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=ee[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},R=n.cacheSize??8192,te=n.prefix??e.prefix??``,z=te===``?``:te+`:`,B=z.length,V=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),H=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,U=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,W=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ne=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,G=0,re=-1,ie=-1,ae=-1,oe=-1,se=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ce=e=>/\s/.test(String.fromCharCode(e)),le=(e,t,n)=>{if(G=0,re=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)G=1;else if(r===40&&i===41)G=2;else return;ae=t+1,oe=n-1;let a=t+1;if(se(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!se(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(re=t+1,ie=a,ae=a+1)}},ue=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},de=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pe=e=>!!e&&!Number.isNaN(Number(e)),me=(e,t,n)=>{if(n-t<11||!ue(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&ue(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&ue(e,t+10,t+18,`-normal/`)},he=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],K=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),ge=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],_e=(e,t,n,r)=>{if(e>=10){if(e>=25)return V[e-25](t.slice(n,r));let i=e-10;if(G!==he[i])return!1;if(re>=0){for(let e of K[i])if(ue(t,re,ie,e))return!0;return!1}switch(ge[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(ae,oe);return H.test(e)&&!U.test(e)}case 3:return pe(t.slice(ae,oe));case 4:return ne.test(t.slice(ae,oe));default:return W.test(t.slice(ae,oe))}}switch(e){case 0:return!0;case 1:return G===0;case 2:return G===1;case 3:return G===2;case 4:return de.test(t.slice(n,r));case 5:return pe(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&pe(t.slice(n,r-1));case 8:return fe.test(t.slice(n,r));default:return me(t,n,r)}},ve=new Set(typeof E==`string`?E.split(` `):E),ye=(e,t,n,r,i,a)=>{let o=Je(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},be=new Map,xe=new Map,Se=2,Ce=4096,we=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||ve.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=xe.get(s);return c===void 0&&xe.set(s,c=Se++),c},Te=new Map,Ee=r,De=r+4096,Oe=()=>Ee++,ke=2097152,Ae=8192,je=new Int32Array(Ae),Me=Array(Ae).fill(null),Ne=new Int32Array(Ae),Pe=new Int32Array(Ae),Fe=new Uint8Array(Ae),Ie=0,Le=(e,t,n,r,i,a,o,s)=>{let c=e;if(Me[e]!==null){if(Me[e|1]===null)c=e|1;else if(!(Ie++&3))c=e|Ie>>2&1;else return}Me[c]=t.slice(n,r),je[c]=i,Ne[c]=a,Pe[c]=o,Fe[c]=s},Re=()=>Me.fill(null),q=256,ze=[new Int32Array(q),new Int32Array(q),new Int32Array(q),new Int32Array(q)],[Be,Ve,He,Ue]=ze,We=new Uint8Array(q),Xe=new Uint8Array(q),Ze=()=>{q*=2,ze=ze.map(e=>{let t=new Int32Array(q);return t.set(e),t}),[Be,Ve,He,Ue]=ze;let e=new Uint8Array(q);e.set(We),We=e,Xe=new Uint8Array(q)},Qe=64,et=new Int32Array(Qe),tt=new Int32Array(Qe),nt=new Int32Array(r),J=2048,rt=21,it=new Float64Array(J),Y=new Int32Array(J),X=0,Z=(e,t)=>{if(e===0&&t<r)return nt[t]===X?1:(nt[t]=X,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>rt;for(;Y[i]===X;){if(it[i]===n)return 1;i=i+1&J-1}return it[i]=n,Y[i]=X,0},at=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?Ke:ye(Te,e,t+1,r,0,Oe)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=tt[t];if(r>n)continue;let i=et[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=L(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;le(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(_e(d[t],e,r,n))return p[h+t]}return Ke},ot=e=>{let t=e.length,n=0,c=0,u=!1;(Se>Ce||be.size>Ce)&&(be=new Map,xe=new Map,Se=2,Re()),Ee>De&&(Te=new Map,Ee=r,Re());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ce(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&ce(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===q&&Ze();let _=n++;Be[_]=p,Ve[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(je[y]===v&&Me[y]!==null&&Me[y].length===g?t=y:je[y|1]===v&&Me[y|1]!==null&&Me[y|1].length===g&&(t=y|1),t>=0){let n=Me[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){He[_]=Ne[t],Ue[_]=Pe[t],We[_]=Fe[t];continue}}}let b=p;if(B!==0){if(h-p<=B||!e.startsWith(z,p)){He[_]=Ke,Le(y,e,p,h,v,Ke,0,0);continue}b=p+B}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,ee=-1,L=0;(l[0]>=0||N[0]===1)&&(et[0]=0,tt[0]=M,L=1);let R=qe,te=0;for(let t=M;t<D;t++)if(t===A&&(R=F<I?qe:P,te=L),P!==qe){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=ee)):P=qe;else{let e=i[P],t=i[P+1],c=qe;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],ee=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(L===Qe){Qe*=2;let e=new Int32Array(Qe);e.set(et),et=e;let t=new Int32Array(Qe);t.set(tt),tt=t}et[L]=r,tt[L]=t+2,L++}}A===D&&(R=F<I?qe:P,te=L);let V=F<I?qe:P,H,U=!1;if(A>=0){if(U=!0,H=at(e,E,A,R,te),H!==Ke&&H<r&&j[H]){let t=at(e,E,D,V,L);t!==Ke&&t!==H&&(H=t,U=!1)}else H===Ke&&(H=at(e,E,D,V,L),U=!1)}else H=at(e,E,D,V,L);let W=0,ne=0;H===Ke?He[_]=Ke:(ne=+!!U,W=b>=C?+!!O:ye(be,e,b,C,+!!O,e=>we(e,O)),He[_]=H,We[_]=ne,Ue[_]=W),Le(y,e,p,h,v,H,W,ne)}if(n===0)return``;if(n===1)return Be[0]===0&&Ve[0]===t?e:e.slice(Be[0],Ve[0]);if(n*k>J){for(;n*k>J;)J<<=1,rt--;it=new Float64Array(J),Y=new Int32Array(J)}if(Se>=ke||Ee>=ke)throw Error(`cn: too many distinct classes in one merge`);X=X+1|0,X===0&&(nt.fill(0),Y.fill(0),X=1);let f=!1;for(let e=n-1;e>=0;e--){let t=He[e];if(t===Ke){Xe[e]=1;continue}let n=Ue[e];if(Z(n,t)===1)Xe[e]=0,f=!0;else if(Xe[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)Z(n,x[e]);if(We[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&Z(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Xe[m]){m++;continue}let t=Be[m],r=Ve[m],i=m+1;for(;i<n&&Xe[i]&&Be[i]===r+1&&e.charCodeAt(r)===32;)r=Ve[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},st=16384,Q=new Int32Array(st*2),ct=0,$=1,lt=Object.create(null),ut=Object.create(null),dt=new Map,ft=new Map,pt=0,mt=0,ht=()=>{ct^=st,$=$+1|0,mt=0},gt=e=>{let t=lt[e];if(t!==void 0)return t;let n=Ye(e,0,e.length),r=(n&16383)+ct,i=Q[r]===(n^$)||Q[r^st]===(n^$-1);return i&&(t=ut[e],t!==void 0)?(lt[e]=t,t):(t=ot(e),i?(lt[e]=t,++pt>R&&(pt=0,ut=lt,lt=Object.create(null),ht())):(Q[r]=n^$,++mt>st&&ht()),t)},_t=e=>{let t=dt.get(e);if(t!==void 0)return t;let n=Ye(e,0,e.length),r=(n&16383)+ct,i=Q[r]===(n^$)||Q[r^st]===(n^$-1);return i&&(t=ft.get(e),t!==void 0)?(dt.set(e,t),t):(t=ot(e),i?(dt.set(e,t),++pt>R&&(pt=0,ft=dt,dt=new Map,ht())):(Q[r]=n^$,++mt>st&&ht()),t)},vt=e=>{let t=Ye(e,0,e.length),n=(t&16383)+ct;return Q[n]===(t^$)||Q[n^st]===(t^$-1)||(Q[n]=t^$,++mt>st&&ht(),!1)},yt=R===0?ot:Ge?e=>{let t=dt.get(e);return t===void 0?_t(e):t}:gt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?yt(arguments[0]):yt($e.apply(null,arguments))},mergeString:yt,seenBefore:R===0?()=>!1:vt,mergeUncached:ot}},Ze=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:Ze(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},Qe=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:Ze(i,t);a&&(n&&(n+=` `),n+=a)}return n},$e=function(){return Qe(arguments,!1)},et=256,tt=16,nt=1024,J=4096,rt=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(J).fill(``),l=Array(J).fill(``),u=Array(J).fill(``));let i=Ye(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=Ze(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>tt&&(_.miss=tt,_.skip=nt,_.e.length=0,_.at=0);let u=_.e;u.length<et?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(Ze(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},it=Xe(We),Y=rt(it.mergeString,it);it.merge;var X=e(m(),1),Z=e(S(),1),at=`size-5 -me-0.5 fill-(--callout-color) text-fd-card`;function ot({children:e,title:t,...n}){return(0,Z.jsxs)(Q,{...n,children:[t&&(0,Z.jsx)(ct,{children:t}),(0,Z.jsx)($,{children:e})]})}function st(e){return e===`warn`?`warning`:e===`tip`?`info`:e}function Q({type:e=`info`,icon:t,children:n,className:r,style:i,...a}){let o=st(e);return(0,Z.jsxs)(`div`,{className:Y(`flex gap-2 my-4 rounded-xl border bg-fd-card p-3 ps-1 text-sm text-fd-card-foreground`,r),style:{"--callout-color":`var(--color-fd-${o}, var(--color-fd-muted))`,...i},...a,children:[(0,Z.jsx)(`div`,{role:`none`,className:`w-0.5 bg-(--callout-color)/50 rounded-sm`}),t??{info:(0,Z.jsx)(ue,{className:at}),warning:(0,Z.jsx)(z,{className:at}),error:(0,Z.jsx)(G,{className:at}),success:(0,Z.jsx)(W,{className:at}),idea:(0,Z.jsx)(fe,{className:`size-5 -me-0.5 fill-(--callout-color) text-(--callout-color)`})}[o],(0,Z.jsx)(`div`,{className:`flex flex-col gap-2 min-w-0 flex-1`,children:n})]})}function ct({children:e,className:t,...n}){return(0,Z.jsx)(`p`,{className:Y(`font-medium my-0!`,t),...n,children:e})}function $({children:e,className:t,...n}){return(0,Z.jsx)(`div`,{className:Y(`text-fd-muted-foreground prose-no-margin empty:hidden`,t),...n,children:e})}var lt=()=>{throw Error("You need to wrap your application inside `FrameworkProvider`.")},ut=(0,X.createContext)({useParams:lt,useRouter:lt,usePathname:lt});function dt(e){let{Image:t}=(0,X.use)(ut);if(!t){let{src:t,alt:n,priority:r,...i}=e;return(0,Z.jsx)(`img`,{alt:n,src:t,fetchPriority:r?`high`:`auto`,...i})}return(0,Z.jsx)(t,{...e})}function ft(e){let{Link:t}=(0,X.use)(ut);if(!t){let{href:t,prefetch:n,...r}=e;return(0,Z.jsx)(`a`,{href:t,...r})}return(0,Z.jsx)(t,{...e})}function pt({ref:e,href:t=`#`,external:n=!!(t.match(/^\w+:/)||t.startsWith(`//`)),prefetch:r,children:i,...a}){return n?(0,Z.jsx)(`a`,{ref:e,href:t,rel:`noreferrer noopener`,target:`_blank`,...a,children:i}):(0,Z.jsx)(ft,{ref:e,href:t,prefetch:r,...a,children:i})}function mt(e){return(0,Z.jsx)(`div`,{...e,className:Y(`grid grid-cols-2 gap-3 @container`,e.className),children:e.children})}function ht({icon:e,title:t,description:n,...r}){let i=r.href?pt:`div`;return(0,Z.jsxs)(i,{...r,"data-card":!0,className:Y(`block rounded-xl border bg-fd-card p-4 text-fd-card-foreground transition-colors @max-lg:col-span-full`,r.href&&`hover:bg-fd-accent/80`,r.className),children:[e?(0,Z.jsx)(`div`,{className:`not-prose mb-2 w-fit shadow-md rounded-lg border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4`,children:e}):null,(0,Z.jsx)(`h3`,{className:`not-prose mb-1 text-sm font-medium`,children:t}),n?(0,Z.jsx)(`p`,{className:`my-0! text-sm text-fd-muted-foreground`,children:n}):null,(0,Z.jsx)(`div`,{className:`text-sm text-fd-muted-foreground prose-no-margin empty:hidden`,children:r.children})]})}var gt=`bg-fd-primary text-fd-primary-foreground hover:bg-fd-primary/80`,_t={default:gt,primary:gt,outline:`border hover:bg-fd-accent hover:text-fd-accent-foreground`,ghost:`hover:bg-fd-accent hover:text-fd-accent-foreground`,secondary:`border bg-fd-secondary text-fd-secondary-foreground hover:bg-fd-accent hover:text-fd-accent-foreground`},vt=l(`inline-flex items-center justify-center rounded-md p-2 text-sm font-medium transition-colors duration-100 disabled:pointer-events-none disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fd-ring`,{variants:{variant:_t,color:_t,size:{sm:`gap-1 px-2 py-1.5 text-xs`,icon:`p-1.5 [&_svg]:size-5`,"icon-sm":`p-1.5 [&_svg]:size-4.5`,"icon-xs":`p-1 [&_svg]:size-4`}}});function yt(e){let[t,n]=(0,X.useState)(!1),r=(0,X.useRef)(e),i=(0,X.useRef)(null);r.current=e;let a=(0,X.useCallback)(()=>{i.current&&window.clearTimeout(i.current),Promise.resolve(r.current()).then(()=>{n(!0),i.current=window.setTimeout(()=>{n(!1)},1500)})},[]);return(0,X.useEffect)(()=>()=>{i.current&&window.clearTimeout(i.current)},[]),[t,a]}var bt=(0,X.createContext)({}),xt=/\\?\{([^}]+)\}/g;function St({note:e}={}){let t=(0,X.use)(bt);return(0,X.useMemo)(()=>Ct(t,{note:e}),[t,e])}function Ct(e,{note:t}={}){let n=(n,r={})=>{let{note:i,variables:a}=r,o=[];t&&o.push(t),i&&o.push(i);let s=e[wt(n,o)]??n;return a&&(s=s.replaceAll(xt,(e,t)=>e[0]===`\\`?e.slice(1):t in a?a[t]:e)),s};return n.jsx=(n,r={})=>{let{note:i,variables:a,tags:o}=r,s=[];t&&s.push(t),i&&s.push(i);let c=e[wt(n,s)]??n;return o?Dt(c,a,o):a?Tt(c,a):c},n.translations=e,n}function wt(e,t){return e+t.map(e=>`(${e})`).join(``)}function Tt(e,t){let n=0,r=[];for(let i of e.matchAll(xt)){let[a,o]=i;n<i.index&&r.push(e.slice(n,i.index)),n=i.index+a.length,a[0]===`\\`?r.push(a.slice(1)):o in t?r.push(kt(t[o],n)):r.push(a)}return r.push(e.slice(n)),r}var Et=/\\?<([^>]+)>/g;function Dt(e,t,n){let r=[{children:[]}],i=0,a=()=>{let e=r.pop();r[r.length-1].children.push(kt(e.tag&&n[e.tag]?Ot(n[e.tag],e.children):e.children,i))};for(let o of e.matchAll(Et)){let s=r[r.length-1],[c,l]=o;if(i<o.index){let n=e.slice(i,o.index);s.children.push(t?Tt(n,t):n)}if(i=o.index+c.length,c[0]===`\\`){let e=c.slice(1);s.children.push(t?Tt(e,t):e)}else if(l[0]===`/`){let e=l.slice(1);s.tag===e?a():s.children.push(t?Tt(c,t):c)}else if(l.at(-1)===`/`){let e=l.slice(0,-1);n[e]&&s.children.push(kt(Ot(n[e]),i))}else r.push({children:[],tag:l})}if(i<e.length){let n=e.slice(i);r[r.length-1].children.push(t?Tt(n,t):n)}for(;r.length>1;)a();return r[0].children}function Ot(e,t){return(0,X.isValidElement)(e)?t===void 0?e:(0,X.cloneElement)(e,void 0,t):e(t)}function kt(e,t){return(0,X.isValidElement)(e)?(0,X.cloneElement)(e,{key:t}):e}function At({as:e,...t}){let n=e??`h1`,r=St({note:`heading anchor`}),[i,a]=yt(()=>{if(!t.id)return;let e=new URL(window.location.href);return e.hash=t.id,navigator.clipboard.writeText(e.href)});return t.id?(0,Z.jsxs)(n,{...t,className:Y(`group/heading flex scroll-m-28 flex-row items-center gap-1`,t.className),children:[(0,Z.jsx)(`a`,{"data-card":``,href:`#${t.id}`,children:t.children}),(0,Z.jsxs)(`button`,{"aria-live":`polite`,className:Y(vt({variant:`ghost`,size:`icon-xs`}),`not-prose shrink-0 text-fd-muted-foreground opacity-0 transition-opacity group-hover/heading:opacity-100`),onClick:a,children:[i?(0,Z.jsx)(oe,{}):(0,Z.jsx)(me,{}),(0,Z.jsx)(`span`,{className:`sr-only`,children:r(i?`Copied Anchor Link`:`Copy Anchor Link`,{note:`aria-label`})})]})]}):(0,Z.jsx)(n,{...t})}function jt(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})}}var Mt=X.createContext(void 0);function Nt(){let e=X.useContext(Mt);if(e===void 0)throw Error(O(64));return e}var Pt=`data-activation-direction`,Ft={tabActivationDirection:e=>({[Pt]:e})},It=X.forwardRef(function(e,n){let{className:r,defaultValue:i=0,onValueChange:a,orientation:o=`horizontal`,render:s,value:c,style:l,...u}=e,d=e.defaultValue!==void 0,f=X.useRef([]),[m,h]=X.useState(()=>new Map),[g,_]=k({controlled:c,default:i,name:`Tabs`,state:`value`}),v=c!==void 0,[y,S]=X.useState(()=>new Map),C=X.useRef(void 0),T=X.useCallback(e=>Lt(y,e),[y]),[D,O]=X.useState(()=>({previousValue:g,tabActivationDirection:`none`})),{previousValue:A,tabActivationDirection:j}=D,M=j,P=!1;A!==g&&(M=Rt(A,g,o,y),P=A!=null&&g!=null&&T(g)==null);let F=P?A:g,ee=A!==F||j!==M;t(()=>{ee&&O({previousValue:F,tabActivationDirection:M})},[F,ee,M]);let L=E((e,t)=>{t.activationDirection=Rt(g,e,o,y),a?.(e,t),!t.isCanceled&&_(()=>e)}),R=E((e,t)=>{a?.(e,I(t,void 0,void 0,{activationDirection:`none`}))}),te=E((e,t)=>(h(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{h(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),z=X.useCallback(e=>m.get(e),[m]),B=X.useCallback(e=>{for(let t of y.values())if(e===t.value)return t.id},[y]),V=X.useMemo(()=>({getTabElementBySelectedValue:T,getTabIdByPanelValue:B,getTabPanelIdByValue:z,onValueChange:L,orientation:o,registerMountedTabPanel:te,setTabMap:S,tabActivationDirection:M,value:g}),[T,B,z,L,o,te,S,M,g]),H=X.useMemo(()=>{for(let e of y.values())if(e.value===g)return e},[y,g]),U=X.useMemo(()=>{for(let e of y.values())if(!e.disabled)return e.value},[y]),W=X.useRef(!d),ne=X.useRef(i),G=X.useRef(d),re=X.useRef(!1);t(()=>{if(v)return;function e(e,t){_(()=>e),O({previousValue:e,tabActivationDirection:`none`}),R(e,t),W.current=!1}if(y.size===0){re.current&&g!==null&&!C.current?.isConnected&&e(null,w);return}re.current=!0,C.current=y.keys().next().value;let t=H?.disabled,n=H==null&&g!==null;if(!t&&g===ne.current&&(G.current=!1),G.current&&t&&g===ne.current)return;let r=W.current;if(t||n){let n=U??null;if(g===n){W.current=!1;return}let i=w;r?i=x:t&&(i=p),e(n,i)}else r&&H!=null&&(R(g,x),W.current=!1)},[U,v,R,H,_,y,g]);let ie=b(`div`,e,{state:{orientation:o,tabActivationDirection:M},ref:n,props:u,stateAttributesMapping:Ft});return(0,Z.jsx)(Mt.Provider,{value:V,children:(0,Z.jsx)(N,{elementsRef:f,children:ie})})});function Lt(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function Rt(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=Lt(r,e),c=Lt(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var zt=X.createContext(void 0);function Bt(){let e=X.useContext(zt);if(e===void 0)throw Error(O(65));return e}var Vt=X.forwardRef(function(e,n){let{className:i,disabled:a=!1,render:o,value:c,id:l,nativeButton:u=!0,style:f,...p}=e,{value:m,getTabPanelIdByValue:h,onValueChange:v,orientation:y,tabActivationDirection:x}=Nt(),{activateOnFocus:S,registerTabResizeObserverElement:C,tabsListElement:w}=Bt(),{highlightedIndex:D,onHighlightedIndexChange:O}=s(),k=T(l),A=X.useMemo(()=>({disabled:a,id:k,value:c}),[a,k,c]),{compositeProps:j,compositeRef:M,index:N}=R({metadata:A}),P=c===m,F=X.useRef(!1),ee=X.useRef(null),te=E(e=>{ee.current?.(),ee.current=e?C(e):null});t(()=>{if(F.current){F.current=!1;return}if(!(P&&N>-1&&D!==N))return;let e=w;if(e!=null){let t=B(r(e));if(t&&_(e,t))return}a||O(N)},[P,N,D,O,a,w]);let{getButtonProps:z,buttonRef:V}=d({disabled:a,native:u,focusableWhenDisabled:!0}),H=h(c),U=X.useRef(!1),W=X.useRef(!1);function ne(e){v(c,I(g,e.nativeEvent,void 0,{activationDirection:`none`}))}function G(e){P||a||ne(e)}function re(e){P||a||S&&(!U.current||W.current)&&ne(e)}function ie(e){if(P||a)return;U.current=!0,W.current=e.button===0;let t=r(e.currentTarget);function n(){U.current=!1,W.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return b(`button`,e,{state:{disabled:a,active:P,orientation:y,tabActivationDirection:x},ref:[n,V,M,te],props:[j,{role:`tab`,"aria-controls":H,"aria-selected":P,id:k,onClick:G,onFocus:re,onPointerDown:ie,[L]:P?``:void 0,onKeyDownCapture(){F.current=!0}},p,z],stateAttributesMapping:Ft})}),Ht=`data-index`,Ut={...Ft,...C},Wt=X.forwardRef(function(e,n){let{className:r,value:i,render:o,keepMounted:s=!1,style:l,...u}=e,{value:d,getTabIdByPanelValue:f,orientation:p,tabActivationDirection:m,registerMountedTabPanel:h}=Nt(),g=T(),{ref:_,index:y}=v(),x=i===d,{mounted:S,transitionStatus:C,setMounted:w}=c(x),E=!S,O=f(i),k={hidden:E,orientation:p,tabActivationDirection:m,transitionStatus:C},A=X.useRef(null),j=b(`div`,e,{state:k,ref:[n,_,A],props:[{"aria-labelledby":O,hidden:E,id:g,role:`tabpanel`,tabIndex:x?0:-1,inert:D(!x),[Ht]:y},u],stateAttributesMapping:Ut});return a({open:x,ref:A,onComplete(){x||w(!1)}}),t(()=>{if(!(g==null||E&&!s))return h(i,g)},[E,s,i,g,h]),s||S?j:null}),Gt=X.forwardRef(function(e,n){let{activateOnFocus:r=!1,className:i,loopFocus:a=!0,render:o,style:s,...c}=e,{orientation:l,setTabMap:u,tabActivationDirection:d}=Nt(),[f,p]=X.useState(0),[m,h]=X.useState(null),g=X.useRef(new Set),_=X.useRef(new Set),v=X.useRef(null);t(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{g.current.forEach(e=>{e()})});return v.current=e,m&&e.observe(m),_.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),v.current=null}},[m]);let y=E(e=>(g.current.add(e),()=>{g.current.delete(e)})),b=E(e=>(_.current.add(e),v.current?.observe(e),()=>{_.current.delete(e),v.current?.unobserve(e)})),x={orientation:l,tabActivationDirection:d},S={"aria-orientation":l===`vertical`?`vertical`:void 0,role:`tablist`},C=X.useMemo(()=>({activateOnFocus:r,registerIndicatorUpdateListener:y,registerTabResizeObserverElement:b,tabsListElement:m}),[r,y,b,m]);return(0,Z.jsx)(zt.Provider,{value:C,children:(0,Z.jsx)(j,{render:o,className:i,style:s,state:x,refs:[n,h],props:[S,c],stateAttributesMapping:Ft,highlightedIndex:f,enableHomeAndEndKeys:!0,loopFocus:a,orientation:l,onHighlightedIndexChange:p,onMapChange:u,disabledIndices:M})})}),Kt=new Map,qt=(0,X.createContext)(null);function Jt(){let e=(0,X.use)(qt);if(!e)throw Error(`You must wrap your component in <Tabs>`);return e}var Yt=Gt;function Xt({value:e,ref:t,...n}){let{triggers:r}=Jt();return(0,Z.jsx)(Vt,{ref:jt(t,t=>{t?r.add(e):r.delete(e)}),value:e,...n})}function Zt({ref:e,groupId:t,persist:n=!1,updateAnchor:r=!1,defaultValue:i,value:a,onValueChange:o,...s}){let c=(0,X.useRef)(null),l=(0,X.useMemo)(()=>new Map,[]),u=(0,X.useMemo)(()=>new Map,[]),d=(0,X.useMemo)(()=>new Set,[]),[f,p]=a===void 0?(0,X.useState)(i):[a,e=>o?.(e)],m=(0,X.useEffectEvent)(e=>{d.has(e)&&p(e)}),h=(0,X.useEffectEvent)(()=>{let e=window.location.hash.slice(1);if(!e)return;for(let[t,n]of l.entries())if(n===e){p(t),c.current?.scrollIntoView();return}let t=document.getElementById(e);if(t){for(let[e,n]of u.entries())if(n.contains(t)){p(e),requestAnimationFrame(()=>t.scrollIntoView());return}}});return(0,X.useLayoutEffect)(()=>{if(!t)return;let e=sessionStorage.getItem(t);n&&(e??=localStorage.getItem(t)),e&&m(e);let r=Kt.get(t)??new Set;return r.add(m),Kt.set(t,r),()=>{r.delete(m)}},[t,n]),(0,X.useLayoutEffect)(()=>(h(),window.addEventListener(`hashchange`,h),()=>window.removeEventListener(`hashchange`,h)),[]),(0,Z.jsx)(It,{ref:jt(e,c),value:f,onValueChange:e=>{if(r){let t=l.get(e);t&&window.history.replaceState(null,``,`#${t}`)}if(t){let r=Kt.get(t);if(r)for(let t of r)t(e);sessionStorage.setItem(t,e),n&&localStorage.setItem(t,e)}else p(e)},...s,children:(0,Z.jsx)(qt,{value:(0,X.useMemo)(()=>({valueToIdMap:l,panels:u,triggers:d}),[l,u,d]),children:s.children})})}function Qt({value:e,ref:t,...n}){let{valueToIdMap:r,panels:i}=Jt();return n.id&&r.set(e,n.id),(0,Z.jsx)(Wt,{ref:jt(t,t=>{t?i.set(e,t):i.delete(e)}),value:e,...n,children:n.children})}var $t=(0,X.createContext)(null);function en(e){return(0,Z.jsx)(`pre`,{...e,className:Y(`min-w-full w-max *:flex *:flex-col`,e.className),children:e.children})}function tn({ref:e,title:t,allowCopy:n=!0,keepBackground:r=!1,icon:i,viewportProps:a={},children:o,Actions:s=e=>(0,Z.jsx)(`div`,{...e,className:Y(`empty:hidden`,e.className)}),...c}){let l=(0,X.use)($t)!==null,u=(0,X.useRef)(null);return n===`true`?n=!0:n===`false`&&(n=!1),(0,Z.jsxs)(`figure`,{ref:e,dir:`ltr`,...c,tabIndex:-1,className:Y(l?`bg-fd-secondary -mx-px -mb-px last:rounded-b-xl`:`my-4 bg-fd-card rounded-xl`,r&&`bg-(--shiki-light-bg) dark:bg-(--shiki-dark-bg)`,`shiki relative border not-prose overflow-hidden text-sm`,c.className),children:[t?(0,Z.jsxs)(`div`,{className:`flex text-fd-muted-foreground items-center gap-2 h-9.5 border-b px-4`,children:[typeof i==`string`?(0,Z.jsx)(`div`,{className:`[&_svg]:size-3.5`,dangerouslySetInnerHTML:{__html:i}}):i,(0,Z.jsx)(`figcaption`,{className:`flex-1 truncate`,children:t}),s({className:`-me-2`,children:n&&(0,Z.jsx)(nn,{containerRef:u})})]}):s({className:`absolute top-2 right-2 z-2 backdrop-blur-lg rounded-lg text-fd-muted-foreground`,children:n&&(0,Z.jsx)(nn,{containerRef:u})}),(0,Z.jsx)(`div`,{ref:u,...a,role:`region`,tabIndex:0,className:Y(`text-[0.8125rem] py-3.5 overflow-auto max-h-[600px] fd-scroll-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-fd-ring`,a.className),style:{"--padding-right":t?void 0:`calc(var(--spacing) * 8)`,counterSet:c[`data-line-numbers`]?`line ${Number(c[`data-line-numbers-start`]??1)-1}`:void 0,...a.style},children:o})]})}function nn({className:e,containerRef:t,...n}){let r=St({note:`code block`}),[i,a]=yt(()=>{let e=t.current?.getElementsByTagName(`pre`).item(0);if(!e)return;let n=e.cloneNode(!0);return n.querySelectorAll(`.nd-copy-ignore`).forEach(e=>{e.replaceWith(`
2
- `)}),navigator.clipboard.writeText(n.textContent??``)});return(0,Z.jsxs)(`button`,{type:`button`,"data-checked":i||void 0,className:Y(vt({className:`hover:text-fd-accent-foreground data-checked:text-fd-accent-foreground`,size:`icon-xs`}),e),"aria-live":`polite`,onClick:a,...n,children:[i?(0,Z.jsx)(F,{}):(0,Z.jsx)(ie,{}),(0,Z.jsx)(`span`,{className:`sr-only`,children:r(i?`Copied Text`:`Copy Text`,{note:`aria-label`})})]})}function rn({ref:e,className:t,...n}){let r=(0,X.useRef)(null),i=(0,X.use)($t)!==null;return(0,Z.jsx)(Zt,{ref:jt(r,e),...n,className:e=>Y(`bg-fd-card rounded-xl border`,!i&&`my-4`,typeof t==`function`?t(e):t),children:(0,Z.jsx)($t,{value:(0,X.useMemo)(()=>({containerRef:r,nested:i}),[i]),children:n.children})})}function an({className:e,...t}){return(0,Z.jsx)(Yt,{...t,className:t=>Y(`flex flex-row px-2 overflow-x-auto text-fd-muted-foreground`,typeof e==`function`?e(t):e),children:t.children})}function on({children:e,className:t,...n}){return(0,Z.jsxs)(Xt,{...n,className:e=>Y(`relative group inline-flex text-sm font-medium text-nowrap items-center transition-colors gap-2 px-2 py-1.5 [&_svg]:size-3.5`,e.active?`text-fd-primary`:`hover:text-fd-accent-foreground`,typeof t==`function`?t(e):t),children:[(0,Z.jsx)(`div`,{className:`absolute inset-x-2 bottom-0 h-px group-data-active:bg-fd-primary`}),e]})}function sn(e){return(0,Z.jsx)(Qt,{...e})}function cn(e){return(0,Z.jsx)(dt,{sizes:`(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px`,...e,className:Y(`rounded-lg`,e.className)})}function ln(e){return(0,Z.jsx)(`div`,{className:`relative overflow-auto prose-no-margin my-6`,children:(0,Z.jsx)(`table`,{...e})})}var un={CodeBlockTab:sn,CodeBlockTabs:rn,CodeBlockTabsList:an,CodeBlockTabsTrigger:on,pre:e=>(0,Z.jsx)(tn,{...e,children:(0,Z.jsx)(en,{children:e.children})}),Card:ht,Cards:mt,a:pt,img:cn,h1:e=>(0,Z.jsx)(At,{as:`h1`,...e}),h2:e=>(0,Z.jsx)(At,{as:`h2`,...e}),h3:e=>(0,Z.jsx)(At,{as:`h3`,...e}),h4:e=>(0,Z.jsx)(At,{as:`h4`,...e}),h5:e=>(0,Z.jsx)(At,{as:`h5`,...e}),h6:e=>(0,Z.jsx)(At,{as:`h6`,...e}),table:ln,Callout:ot,CalloutContainer:Q,CalloutTitle:ct,CalloutDescription:$};function dn(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=k({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:l,transitionStatus:u}=c(a,!0,!0),d=T(),[f,p]=X.useState(),m=f===null?void 0:f??d,h=E(e=>{let t=!a,n=I(y,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return X.useMemo(()=>({defaultPanelId:d,disabled:i,handleTrigger:h,mounted:s,open:a,panelId:m,setMounted:l,setOpen:o,setPanelIdState:p,transitionStatus:u}),[d,i,h,s,a,m,l,o,p,u])}var fn=X.createContext(void 0);function pn(){let e=X.useContext(fn);if(e===void 0)throw Error(O(15));return e}var mn=`data-open`,hn=`data-closed`,gn=h,_n=`data-panel-open`,vn={[mn]:``},yn={[hn]:``},bn={open(e){return e?{[_n]:``}:null}},xn={open(e){return e?vn:yn}},Sn={...xn,...C},Cn=X.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=E(o),d=dn({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=X.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=X.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=b(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:Sn});return(0,Z.jsx)(fn.Provider,{value:p,children:m})}),wn={...bn,...C},Tn=X.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=pn(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:f,...p}=e,{getButtonProps:m,buttonRef:h}=d({disabled:c,native:u});return b(`button`,e,{state:a,ref:[t,h],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},p,m],stateAttributesMapping:wn})}),En={height:void 0,width:void 0};function Dn(e){let{externalRef:n,hiddenUntilFound:r,id:s,keepMounted:c,mounted:l,onOpenChange:d,open:p,setMounted:m,setOpen:h,transitionStatus:_}=e,v=X.useRef(null),y=X.useRef(null),[b,x]=X.useState(En),S=X.useRef(En),C=X.useRef(!1),w=X.useRef(p),T=X.useRef(!1),[D,O]=X.useState(!1),k=X.useRef(null),A=P(n,v),j=i(p),M=o(v),N=!p&&!l,F=D?`idle`:_,L=p&&(w.current||T.current),R=!p&&l&&y.current===`css-animation`&&b.height===void 0&&b.width===void 0?S.current:b,te=r&&N&&y.current!==`css-animation`,z=E((e,t=!0)=>{t&&(S.current=e),x(e)}),B=E(()=>{k.current?.(),k.current=null}),V=E(e=>{B(),k.current=()=>{k.current=null,e()}}),H=E(()=>{p&&l&&y.current===`css-animation`&&(T.current=!0)});t(()=>{D&&_!==`starting`&&O(!1)},[D,_]),X.useEffect(()=>()=>{H(),B()},[H,B]),t(()=>{p||(w.current=!1,T.current=!1);let e=v.current;if(!e)return;!p&&k.current&&B();let t=kn(e,L);if(y.current=t,p&&_===`idle`&&w.current&&t===`css-animation`){S.current=On(e);return}if(p&&_===`starting`){let n=C.current;if(C.current=!1,t===`none`){z(On(e)),O(!0);return}if(t===`css-transition`){let t=Mn(e);if(z(On(e)),!n)return t;let r=jn(e,`transition-duration`,`0s`);return V(r),O(!0),t}z(On(e));let r=jn(e,`animation-name`,`none`);if(!n){r();return}let i=jn(e,`animation-duration`,`0s`);r(),V(i),O(!0);return}if(!p&&l&&(_===`idle`||_===`starting`)){if(t===`none`){z(En,!1),m(!1);return}z(On(e));return}if(_!==`ending`)return;if(t===`none`){m(!1);return}let n=On(e);n.height>0||n.width>0?(z(n),t===`css-animation`&&jn(e,`animation-name`,`none`)()):m(!1)},[l,p,B,z,m,V,L,_]),a({enabled:p&&l&&F===`idle`,open:!0,ref:v,onComplete(){p&&z(En,!1)}}),X.useEffect(()=>{if(p||!l||F!==`ending`)return;if(!v.current){m(!1),z(En,!1);return}let e=new AbortController,t=-1;function n(){j.current||(m(!1),z(En,!1))}return t=f.request(()=>{M(n,e.signal)}),()=>{f.cancel(t),e.abort()}},[j,l,p,F,M,z,m]),t(()=>{let e=v.current;e&&r&&N&&e.setAttribute(`hidden`,`until-found`)},[N,r]),X.useEffect(function(){let e=v.current;if(!e)return;let t=u.create(),n=-1,r=(r,i)=>{t.start(0,()=>{j.current||(n=f.request(()=>{j.current||(r&&(C.current=!1),i&&e.setAttribute(gn,``),e.setAttribute(`hidden`,`until-found`))}))})},i=ee(e,`beforematch`,t=>{let n=I(g,t);if(d(!0,n),n.isCanceled){r(!1,!1);return}C.current=!0;let i=e.hasAttribute(gn);e.removeAttribute(gn),h(!0),r(!0,i)});return()=>{t.clear(),f.cancel(n),i()}},[j,d,h]);let U=c||r||l||p;return{height:R.height,props:{...te?{[gn]:``}:void 0,hidden:N,id:s},ref:A,shouldPreventOpenAnimation:L,shouldRender:U,transitionStatus:F,width:R.width}}function On(e){return{height:e.scrollHeight,width:e.scrollWidth}}function kn(e,t){let r=n(e).getComputedStyle(e),i=(r.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&An(r.animationDuration),a=An(r.transitionDuration);return i&&a||a?`css-transition`:i?`css-animation`:`none`}function An(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function jn(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{r===``?e.style.removeProperty(t):e.style.setProperty(t,r,i)}}function Mn(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})}let r=f.request(n);return()=>{f.cancel(r),n()}}var Nn=`--collapsible-panel-height`,Pn=`--collapsible-panel-width`,Fn=X.forwardRef(function(e,n){let{className:r,hiddenUntilFound:i,keepMounted:a,render:o,id:s,style:c,...l}=e,{defaultPanelId:u,mounted:d,onOpenChange:f,open:p,setMounted:m,setPanelIdState:h,setOpen:g,state:_,transitionStatus:v}=pn(),y=i??!1,x=a??!1,S=s||void 0,C=S??u;t(()=>(h(e=>S??(e===null?void 0:e)),()=>{h(e=>e===S?null:e)}),[S,h]);let{height:w,props:T,ref:E,shouldPreventOpenAnimation:D,shouldRender:O,transitionStatus:k,width:A}=Dn({externalRef:n,hiddenUntilFound:y,id:C,keepMounted:x,mounted:d,onOpenChange:f,open:p,setMounted:m,setOpen:g,transitionStatus:v}),j={..._,transitionStatus:k},M=te(c,j),N=b(`div`,{...e,style:void 0},{state:j,ref:E,props:[T,{style:{[Nn]:w===void 0?`auto`:`${w}px`,[Pn]:A===void 0?`auto`:`${A}px`}},l,M?{style:M}:void 0,D?{style:{animationName:`none`}}:void 0],stateAttributesMapping:Sn});return O?N:null});export{pt as A,Nt as C,St as D,Ct as E,ue as F,ce as I,H as L,ot as M,Y as N,yt as O,me as P,Ft as S,At as T,Gt as _,xn as a,Bt as b,pn as c,tn as d,en as f,Xt as g,Yt as h,Cn as i,dt as j,vt as k,dn as l,Qt as m,Dn as n,bn as o,Zt as p,Tn as r,fn as s,Fn as t,un as u,Wt as v,jt as w,It as x,Vt as y};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{$ as n,A as r,At as i,Bt as a,Ct as o,Dt as s,F as c,Ft as l,G as u,Gt as d,Ht as f,I as p,It as m,Jt as h,K as g,Kt as _,L as v,Lt as y,M as b,Mt as x,N as S,Nt as C,P as w,Pt as T,Q as E,Qt as D,Rt as O,St as k,Tt as A,Ut as j,V as M,Vt as N,W as ee,Wt as te,Xt as ne,Yt as P,Z as re,Zt as F,_n as I,_t as L,an as ie,at as R,bt as z,cn as ae,d as oe,dt as B,en as V,gn as se,gt as ce,hn as le,ht as ue,i as de,in as fe,j as pe,jt as H,k as U,kt as W,lt as G,mn as me,nn as he,on as ge,ot as _e,pt as K,q,qt as ve,rn as ye,s as be,sn as xe,ut as J,vt as Y,wt as Se,xt as X,yt as Ce,zt as we}from"./preload-helper-CjQDFR0M.js";var Te={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Te.node;var Ee=me(Te),De={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};De.node;var Oe=me(De),ke={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};ke.node;var Ae=me(ke),je={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};je.node;var Me=me(je);function Ne(e){return V(e.defaultTagName??`div`,e,e)}var Z=e(I(),1),Q=e(se(),1),Pe=e(le(),1),Fe=D(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Ie({className:e,variant:t=`default`,render:n,...r}){return Ne({defaultTagName:`span`,props:ae({className:F(Fe({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var Le=[],Re=void 0;function ze(){return Re}function Be(e){Le.push(e)}function Ve(e){let t=(t,n)=>{let r=xe(Ue).current,i;try{Re=r;for(let e of Le)e.before(r);i=e(t,n);for(let e of Le)e.after(r);r.didInitialize=!0}finally{Re=void 0}return i};return t.displayName=e.displayName||e.name,t}function He(e){return Z.forwardRef(Ve(e))}function Ue(){return{didInitialize:!1}}function We(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Ge,platform:Ke,maxTouchPoints:qe}=We(),Je=Ge.toLowerCase(),Ye=Ke.toLowerCase(),Xe=/^i(os$|p)/.test(Ye)||Ye===`macintel`&&qe>1,Ze=`android`,Qe=Ye===Ze||Je.includes(Ze),$e=!Xe&&Ye.startsWith(`mac`);Ye.startsWith(`win`),!Qe&&/^(linux|chrome os)/.test(Ye);var et=$e||Xe,tt=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!tt&&Je.includes(`firefox`),!tt&&Je.includes(`chrom`);var nt=et,rt=/jsdom|happydom/.test(Je);function it(e){e.preventDefault(),e.stopPropagation()}function at(e){return`nativeEvent`in e}function ot(e){return e.pointerType===``&&e.isTrusted?!0:Qe&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function st(e){return rt?!1:!Qe&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(Qe||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function ct(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function lt(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var ut=`data-base-ui-focusable`,dt=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,ft=`ArrowLeft`,pt=`ArrowRight`,mt=`ArrowUp`,ht=`ArrowDown`,gt=`data-open`,_t=`data-closed`,vt=L,yt=ce,bt=`data-anchor-hidden`,xt=`data-popup-open`,St=`data-pressed`,Ct={[xt]:``},wt={[xt]:``,[St]:``},Tt={[gt]:``},Et={[_t]:``},Dt={[bt]:``},Ot={open(e){return e?Ct:null}},kt={open(e){return e?wt:null}},At={open(e){return e?Tt:Et},anchorHidden(e){return e?Dt:null}},jt={...At,...ue},Mt=`data-trigger-disabled`;function Nt(e,t){if(!f(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Mt);for(let[,e]of t.entries())if(z(e,n))return!e.hasAttribute(Mt);return!1}function Pt(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Ft(e){return e.matches(`html,body`)}function It(e){return j(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Lt(e){return Ce(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${dt}`)!=null}function Rt(e){return e?e.getAttribute(`role`)===`combobox`&&It(e):!1}function zt(e){if(!e||rt)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Bt(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Vt(e,t){return t!=null&&!ct(t)?0:typeof e==`function`?e():e}function Ht(e,t,n){let r=Vt(e,n);return typeof r==`number`?r:r?.[t]}function Ut(e){return typeof e==`function`?e():e}function Wt(e,t){return t||e===`click`||e===`mousedown`}function Gt(e){return e?.includes(`mouse`)&&e!==`mousedown`}function Kt(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}var qt={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Jt={...qt,position:`fixed`,margin:0,top:0,left:0},Yt={...qt,position:`absolute`},Xt=Z.forwardRef(function(e,t){let[n,r]=Z.useState();i(()=>{nt&&tt&&r(`button`)},[]);let a={tabIndex:0,role:n};return(0,Q.jsx)(`span`,{...e,ref:t,style:Jt,"aria-hidden":!n||void 0,...a,"data-base-ui-focus-guard":``})}),Zt=Math.min,Qt=Math.max,$t=Math.round,en=Math.floor,tn=e=>({x:e,y:e}),nn={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function rn(e,t,n){return Qt(e,Zt(t,n))}function an(e,t){return typeof e==`function`?e(t):e}function on(e){return e.split(`-`)[0]}function sn(e){return e.split(`-`)[1]}function cn(e){return e===`x`?`y`:`x`}function ln(e){return e===`y`?`height`:`width`}function un(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function dn(e){return cn(un(e))}function fn(e,t,n){n===void 0&&(n=!1);let r=sn(e),i=dn(e),a=ln(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=xn(o)),[o,xn(o)]}function pn(e){let t=xn(e);return[mn(e),t,mn(t)]}function mn(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var hn=[`left`,`right`],gn=[`right`,`left`],_n=[`top`,`bottom`],vn=[`bottom`,`top`];function yn(e,t,n){switch(e){case`top`:case`bottom`:return n?t?gn:hn:t?hn:gn;case`left`:case`right`:return t?_n:vn;default:return[]}}function bn(e,t,n,r){let i=sn(e),a=yn(on(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(mn)))),a}function xn(e){let t=on(e);return nn[t]+e.slice(t.length)}function Sn(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Cn(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Sn(e)}function wn(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var Tn=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function En(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return ve(n)?n.host:null}function Dn(e){for(let t of Array.from(e.children))if(m(t)===`summary`)return t;return null}function On(e,t){let n=Dn(t);return!!n&&(e===n||z(n,e))}function kn(e){let t=e?m(e):``;return e!=null&&e.matches(Tn)&&(t!==`summary`||e.parentElement!=null&&m(e.parentElement)===`details`&&Dn(e.parentElement)===e)&&(t!==`details`||Dn(e)==null)&&(t!==`input`||e.type!==`hidden`)}function An(e){if(!kn(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=En(t)){let n=t!==e,r=m(t)===`slot`;if(t.hasAttribute(`inert`)||n&&m(t)===`details`&&!t.open&&!On(e,t)||t.hasAttribute(`hidden`)||!r&&!jn(t,n))return!1}return!0}function jn(e,t){let n=x(e);return t?n.display!==`none`:M(e,n)}function Mn(e){let t=e.tabIndex;if(t<0){let t=m(e);if(t===`details`||t===`audio`||t===`video`||j(e)&&e.isContentEditable)return 0}return t}function Nn(e){if(m(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Pn(e,t){let n=Nn(e);if(!n)return!0;let r=t.find(e=>{let t=Nn(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Nn(e);return t?.name===n.name&&t.form===n.form})===n}function Fn(e){if(j(e)&&m(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return j(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function In(e,t){Fn(e).forEach(e=>{kn(e)&&t.push(e),In(e,t)})}function Ln(e,t,n){Fn(e).forEach(e=>{j(e)&&e.matches(t)&&n.push(e),Ln(e,t,n)})}function Rn(e){return An(e)&&Mn(e)>=0}function zn(e){let t=[];return In(e,t),t.filter(An)}function Bn(e){let t=zn(e);return t.filter(e=>Mn(e)>=0&&Pn(e,t))}function Vn(e,t){let n=Bn(e),r=n.length;if(r===0)return;let i=Y(s(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Hn(e){return Vn(s(e).body,1)||e}function Un(e){return Vn(s(e).body,-1)||e}function Wn(e,t,n){if(!e)return null;let r=[];In(s(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(An);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!z(n,o)&&Rn(o)&&Pn(o,a))return o}return r[i]}function Gn(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!z(n,r)}function Kn(e){Bn(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function qn(e){let t=[];Ln(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Jn(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Jn(e,t.id,n)])}function Yn(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Xn(e){return`data-base-ui-${e}`}var Zn=0;function Qn(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Zn);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),fe;let o=requestAnimationFrame(a);return Zn=o,()=>{Zn===o&&(cancelAnimationFrame(o),Zn=0)}}var $n=`data-base-ui-inert`,er=new WeakMap,tr=new WeakSet,nr=new WeakMap,rr=0;function ir(e){return e?ve(e)?e.host:ir(e.parentNode):null}var ar=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=ir(t);return e.contains(n)?n:null}).filter(e=>e!=null),or=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},sr=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{m(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function cr(e,t,n,{mark:r=!0}){let i=ar(t,e),a=r?sr(t,or(i),new Set(i)):[],o=[],s=[];if(n){let e=ar(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);sr(t,or(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(er.get(e)||0)+1;er.set(e,r),o.push(e),r===1&&n&&tr.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(nr.get(e)||0)+1;nr.set(e,t),s.push(e),t===1&&e.setAttribute($n,``)}),rr+=1,()=>{o.forEach(e=>{let t=(er.get(e)||0)-1;er.set(e,t),t||(tr.has(e)||e.removeAttribute(`aria-hidden`),tr.delete(e))}),r&&s.forEach(e=>{let t=(nr.get(e)||0)-1;nr.set(e,t),t||e.removeAttribute($n)}),--rr,rr||(er=new WeakMap,tr=new WeakSet,nr=new WeakMap)}}function lr(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=s(e[0]).body;return cr(e,i,n,{mark:r})}var ur={style:{transition:`none`}},dr=`data-base-ui-click-trigger`,fr={fallbackAxisSide:`none`},pr={fallbackAxisSide:`end`},mr={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},hr=Z.createContext(null),gr=()=>Z.useContext(hr),_r=Xn(`portal`);function vr(e={}){let{ref:t,container:n,componentProps:r=ye,elementProps:a}=e,o=p(),s=gr()?.portalNode,[c,l]=Z.useState(null),[u,f]=Z.useState(null),m=H(e=>{e!==null&&f(e)}),h=Z.useRef(null);i(()=>{if(n===null){h.current&&(h.current=null,f(null),l(null));return}let e=(n&&(d(n)?n:n.current))??s??document.body;e==null?h.current&&(h.current=null,f(null),l(null)):h.current!==e&&(h.current=e,f(null),l(e))},[n,s]);let g=V(`div`,r,{ref:[t,m],props:[{id:o,[_r]:``},a]}),_=c&&g?Pe.createPortal(g,c):null;return{node:u,nodeId:Z.isValidElement(g)?g.props.id:void 0,subtree:_}}var yr=Z.forwardRef(function(e,t){let{render:n,className:r,style:a,children:o,container:s,portalOwnerRole:c,...l}=e,{node:u,nodeId:d,subtree:f}=vr({container:s,ref:t,componentProps:e,elementProps:l}),p=Z.useRef(null),m=Z.useRef(null),h=Z.useRef(null),g=Z.useRef(null),[_,v]=Z.useState(null),y=Z.useRef(!1),b=_?.modal,x=_?.open,S=!!_&&!_.modal&&_.open&&!!u;Z.useEffect(()=>{if(!u||b)return;function e(e){u&&e.relatedTarget&&Gn(e)&&(e.type===`focusin`?y.current&&=(qn(u),!1):(Kn(u),y.current=!0))}return Kt(q(u,`focusin`,e,!0),q(u,`focusout`,e,!0))},[u,b]),i(()=>{u&&x===!0&&y.current&&(qn(u),y.current=!1)},[x,u]);let C=Z.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:m,beforeInsideRef:h,afterInsideRef:g,portalNode:u,setFocusManagerState:v}),[u]);return(0,Q.jsxs)(Z.Fragment,{children:[f,(0,Q.jsxs)(hr.Provider,{value:C,children:[S&&u&&(0,Q.jsx)(Xt,{"data-type":`outside`,ref:p,onFocus:e=>{Gn(e,u)?h.current?.focus():Un(_?_.domReference:null)?.focus()}}),S&&u&&(0,Q.jsx)(`span`,{role:c,"aria-owns":d,style:mr}),u&&Pe.createPortal(o,u),S&&u&&(0,Q.jsx)(Xt,{"data-type":`outside`,ref:m,onFocus:e=>{Gn(e,u)?g.current?.focus():(Hn(_?_.domReference:null)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,K(`focus-out`,e.nativeEvent)))}})]})]})});function br(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var xr=class{nodesRef={current:[]};events=br();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},Sr=Z.createContext(null),Cr=Z.createContext(null),wr=()=>Z.useContext(Sr)?.id||null,Tr=e=>{let t=Z.useContext(Cr);return e??t};function Er(e){let t=p(),n=Tr(e),r=wr();return i(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Dr(e){let{children:t,id:n}=e,r=wr();return(0,Q.jsx)(Sr.Provider,{value:Z.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Or(e){let{children:t,externalTree:n}=e,r=xe(()=>n??new xr).current;return(0,Q.jsx)(Cr.Provider,{value:r,children:t})}function kr(e,t){let n=a(X(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(ot(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Ar=20,jr=[];function Mr(){jr=jr.filter(e=>e.deref()?.isConnected)}function Nr(e){Mr(),e&&m(e)!==`body`&&(jr.push(new WeakRef(e)),jr.length>Ar&&(jr=jr.slice(-20)))}function Pr(){return Mr(),jr[jr.length-1]?.deref()}function Fr(e){return e?Rn(e)?e:Bn(e)[0]||e:null}function Ir(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=zn(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Rn(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Lr(e){let{context:t,children:n,disabled:r=!1,initialFocus:a=!0,returnFocus:l=!0,explicitReturnFocus:d,restoreFocus:f=!1,modal:p=!0,closeOnFocusOut:h=!0,openInteractionType:_=``,nextFocusableElement:v,previousFocusableElement:y,beforeContentFocusGuardRef:b,externalTree:x,getInsideElements:S}=e,C=t.useState(`open`),w=t.useState(`domReferenceElement`),T=t.useState(`floatingElement`),{events:D,dataRef:O}=t.context,k=H(()=>O.current.floatingContext?.nodeId),A=a===!1,N=Rt(w)&&A,ee=g(a),te=g(l),ne=g(d),P=g(_),re=g(C),F=Tr(x),I=gr(),L=Z.useRef(!1),ie=Z.useRef(!1),R=Z.useRef(!1),ae=Z.useRef(null),oe=Z.useRef(``),B=Z.useRef(``),V=Z.useRef(null),se=Z.useRef(null),ce=ge(V,b,I?.beforeInsideRef),le=ge(se,I?.afterInsideRef),ue=o(),de=o(),fe=u(),pe=I!=null,U=Bt(T),W=H((e=U)=>e?Bn(e):[]),G=H(()=>S?.().filter(e=>e!=null)??[]);Z.useEffect(()=>{if(r||!p)return;function e(e){e.key===`Tab`&&z(U,Y(s(U)))&&W().length===0&&!N&&it(e)}let t=s(U);return q(t,`keydown`,e)},[r,U,p,N,W]),Z.useEffect(()=>{if(r||!C)return;let e=s(U);function t(){R.current=!1}function n(e){let t=X(e),n=G(),r=z(T,t)||z(w,t)||z(I?.portalNode,t)||n.some(e=>e===t||z(e,t));R.current=!r,B.current=e.pointerType||`keyboard`,Ce(t,`[data-base-ui-click-trigger]`)&&(ie.current=!0,de.start(0,()=>{ie.current=!1}))}function i(){B.current=`keyboard`}return Kt(q(e,`pointerdown`,n,!0),q(e,`pointerup`,t,!0),q(e,`pointercancel`,t,!0),q(e,`keydown`,i,!0),t)},[r,T,w,U,C,I,de,G]),Z.useEffect(()=>{if(r||!h)return;let e=s(U);function n(){ie.current=!0,de.start(0,()=>{ie.current=!1})}function i(e){let t=X(e);Rn(t)&&(ae.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=X(n);p&&r==null&&a!=null&&z(T,a)&&Nr(a),queueMicrotask(()=>{let o=k(),s=t.context.triggerElements,l=G(),u=r?.hasAttribute(Xn(`focus-guard`))&&[V.current,se.current,I?.beforeInsideRef.current,I?.afterInsideRef.current,I?.beforeOutsideRef.current,I?.afterOutsideRef.current,c(y),c(v)].includes(r),d=!(z(w,r)||z(T,r)||z(r,T)||z(I?.portalNode,r)||l.some(e=>e===r||z(e,r))||s.hasMatchingElement(e=>z(e,r))||u||F&&(Jn(F.nodesRef.current,o).find(e=>z(e.context?.elements.floating,r)||z(e.context?.elements.domReference,r))||Yn(F.nodesRef.current,o).find(e=>[e.context?.elements.floating,Bt(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===w&&U&&Ir(U),f&&i!==w&&!M(a)&&Y(e)===e.body){if(j(U)&&(U.focus(),f===`popup`)){fe.request(()=>{U.focus()});return}let e=W(),t=ae.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||U;j(n)&&n.focus()}O.current.insideReactTree?O.current.insideReactTree=!1:(N||!p)&&r&&d&&!ie.current&&(N||r!==Pr())&&(L.current=!0,t.setOpen(!1,K(E,n)))})}function o(){R.current||(O.current.insideReactTree=!0,ue.start(0,()=>{O.current.insideReactTree=!1}))}let l=j(w)?w:null;if(T||l)return Kt(l&&q(l,`focusout`,a),l&&q(l,`pointerdown`,n),T&&q(T,`focusin`,i),T&&q(T,`focusout`,a),T&&I&&q(T,`focusout`,o,!0))},[r,w,T,U,p,F,I,t,h,f,W,N,k,O,ue,de,fe,v,y,G]),Z.useEffect(()=>{if(r||!T||!C)return;let e=Array.from(I?.portalNode?.querySelectorAll(`[${Xn(`portal`)}]`)||[]),t=(F?Yn(F.nodesRef.current,k()):[]).find(e=>Rt(e.context?.elements.domReference||null))?.context?.elements.domReference,n=lr([T,...e,V.current,se.current,I?.beforeOutsideRef.current,I?.afterOutsideRef.current,...G(),t,c(y),c(v),N?w:null].filter(e=>e!=null),{ariaHidden:p||N,mark:!1}),i=lr([T,...e].filter(e=>e!=null));return()=>{i(),n()}},[C,r,w,T,p,I,N,F,k,v,y,G]),i(()=>{if(!C||r||!j(U))return;oe.current=``,B.current=``;let e=s(U),t=Y(e);queueMicrotask(()=>{let n=ee.current,r=typeof n==`function`?n(P.current||``):n;if(r===void 0||r===!1||z(U,t))return;let i=null,a=()=>(i??=W(U),i[0]||U),o;o=r===!0||r===null?a():c(r),o||=a();let s=z(U,Y(e)),l=O.current.openEvent,u=l?.type===`mousedown`&&ot(l);Qn(o,{sync:u,preventScroll:o===U,shouldFocus(){if(!re.current)return!1;if(s)return!0;let t=Y(e);return!(t!==o&&z(U,t))}})})},[r,C,U,W,ee,P,re,O]);let me=Z.useRef(null);i(()=>{if(r||!U){me.current=null;return}me.current&&=(me.current.cancelled=!0,null);let e=s(U),t=Y(e),n=P.current==null;Nr(t);function i(e){if(e.open||(oe.current=kr(e.nativeEvent,B.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Xn(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(L.current=!0),e.reason===`outside-press`){if(e.nested)L.current=!1;else if(ot(e.nativeEvent)||st(e.nativeEvent))L.current=!1;else{let e=!1;s(U).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?L.current=!1:L.current=!0}}}D.on(`openchange`,i);function a(e){let r=te.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=w?.isConnected?w:null,o=t?.isConnected&&m(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Pr()||null,typeof i==`boolean`?s:c(i)||s||null}return()=>{D.off(`openchange`,i);let t=Y(e),n=G(),r=z(T,t)||n.some(e=>e===t||z(e,t))||F&&Jn(F.nodesRef.current,k(),!1).some(e=>z(e.context?.elements.floating,t)),o=te.current,s=oe.current,c=a(s),l={cancelled:!1};me.current=l,queueMicrotask(()=>{me.current===l&&(me.current=null);let n=Fr(c),i=ne.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!L.current&&j(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}L.current=!1})}},[r,T,U,te,ne,P,D,F,w,k,G]),i(()=>{if(!tt||C||!T)return;let e=Y(s(T));j(e)&&It(e)&&z(T,e)&&e.blur()},[C,T]),i(()=>{if(!r&&I)return I.setFocusManagerState({modal:p,closeOnFocusOut:h,open:C,onOpenChange:t.setOpen,domReference:w}),()=>{I.setFocusManagerState(null)}},[r,I,p,C,t,h,w]),i(()=>{if(!r&&U)return Ir(U),()=>{queueMicrotask(Mr)}},[r,U]);let he=!r&&(!p||!N)&&(pe||p);return(0,Q.jsxs)(Z.Fragment,{children:[he&&(0,Q.jsx)(Xt,{"data-type":`inside`,ref:ce,onFocus:e=>{if(p){let e=W();Qn(e[e.length-1])}else I?.portalNode&&(L.current=!1,Gn(e,I.portalNode)?Hn(w)?.focus():c(y??I.beforeOutsideRef)?.focus())}}),n,he&&(0,Q.jsx)(Xt,{"data-type":`inside`,ref:le,onFocus:e=>{p?Qn(W()[0]):I?.portalNode&&(h&&(L.current=!0),Gn(e,I.portalNode)?Un(w)?.focus():c(v??I.afterOutsideRef)?.focus())}})]})}function Rr(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:s=!0,touchOpenDelay:c=0,reason:l=B}=t,d=e.context.dataRef,f=Z.useRef(void 0),p=u(),m=o(),h=Z.useMemo(()=>{function t(t,n,r,i){let a=K(l,n,r);t&&i===`touch`&&c>0?m.start(c,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=d.current.openEvent,o=e.select(`domReferenceElement`)!==n;return t&&o||!t||!i?!0:a&&(typeof s==`function`?s():s)?!r(a.type):!1}return{onPointerDown(e){f.current=ct(e.pointerType,!0)&&st(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=f.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||ct(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),u=X(s),d=It(u);if(d||o===`virtual`){t(l,s,d?u:i.currentTarget,o);return}let m=i.currentTarget;p.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=f.current;r===`mousedown`&&o?f.current=void 0:ct(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){f.current=void 0}}},[d,r,a,l,e,s,i,p,m,c]);return Z.useMemo(()=>n?{reference:h}:ye,[n,h])}function zr(){return!1}function Br(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Vr(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:c=zr,bubbles:l,externalTree:u}=t,d=e.useState(`open`),p=e.useState(`floatingElement`),{dataRef:m,events:h}=e.context,g=Tr(u),_=H(typeof i==`function`?i:()=>!1),v=typeof i==`function`?_:i,y=v!==!1,b=H(()=>a),{escapeKey:S,outsidePress:C}=Br(l),w=Z.useRef(!1),T=Z.useRef(!1),E=Z.useRef(!1),D=Z.useRef(!1),O=Z.useRef(!1),A=Z.useRef(``),M=Z.useRef(null),N=o(),ee=o(),ne=o(),P=H(()=>{ee.clear(),m.current.insideReactTree=!1}),F=H(e=>{let t=m.current.floatingContext?.nodeId;return(g?Jn(g.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),I=H(t=>Pt(t,e.select(`floatingElement`))||Pt(t,e.select(`domReferenceElement`))),L=H(t=>{c()&&e.setOpen(!1,K(B,t.nativeEvent))}),ie=H(t=>{if(!d||!n||!r||t.key!==`Escape`)return;let i=at(t)?t.nativeEvent:t;if(O.current||i.isComposing||!S&&F(`__escapeKeyBubbles`))return;let a=K(re,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!S&&!a.isPropagationAllowed&&t.stopPropagation()}),R=H(()=>{m.current.insideReactTree=!0,ee.start(0,P)}),ae=H(t=>{if(!d||!n||t.button!==0)return;let r=X(t.nativeEvent);z(e.select(`floatingElement`),r)&&(w.current||(w.current=!0,T.current=!1))}),oe=H(e=>{d&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&w.current&&(T.current=!0)});Z.useEffect(()=>{function e(e){e.open||(D.current=!1)}return h.on(`openchange`,e),()=>{h.off(`openchange`,e)}},[h]),Z.useEffect(()=>P,[P]),Z.useEffect(()=>{if(!d||!n)return d||(D.current=!1,O.current=!1,A.current=``,M.current=null),P;m.current.__escapeKeyBubbles=S,m.current.__outsidePressBubbles=C;let t=new k,i=s(p);function a(){ne.clear(),O.current=!0}function o(){O.current=!0,ne.start(tt?5:0,()=>{O.current=!1})}function c(){E.current=!0,t.start(0,()=>{E.current=!1})}function l(){w.current=!1,T.current=!1}function u(){let e=A.current,t=e===`pen`||!e?`mouse`:e,n=b(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function h(e){let t=u();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function _(e){let t=m.current.floatingContext?.nodeId,n=g&&Jn(g.nodesRef.current,t).some(t=>Pt(e,t.context?.elements.floating));return I(e)||n}function ee(n){if(h(n)){n.type!==`click`&&!I(n)&&(t.clear(),E.current=!1),P();return}if(m.current.insideReactTree){P();return}let r=X(n),i=`[${Xn(`inert`)}]`,a=f(r)?r.getRootNode():null,o=Array.from((ve(a)?a:s(e.select(`floatingElement`))).querySelectorAll(i)),c=e.context.triggerElements;if(r&&(c.hasElement(r)||c.hasMatchingElement(e=>z(e,r))))return;let l=f(r)?r:null;for(;l&&!te(l);){let e=we(l);if(te(e)||!f(e))break;l=e}if(!(o.length&&f(r)&&!Ft(r)&&!z(r,e.select(`floatingElement`))&&o.every(e=>!z(l,e)))){if(j(r)&&!(`touches`in n)){let e=te(r),t=x(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!_(n)){if(u()===`intentional`){if(n.detail!==0&&!ot(n)&&!D.current)return;if(E.current){t.clear(),E.current=!1;return}}(typeof v!=`function`||v(n))&&(F(`__outsidePressBubbles`)||(e.setOpen(!1,K(_e,n)),P()))}}}function re(t){u()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!I(t)&&ee(t)}function L(t){if(u()!==`sloppy`||!e.select(`open`)||!n||I(t))return;let r=t.touches[0];r&&(M.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},N.start(1e3,()=>{M.current&&(M.current.dismissOnTouchEnd=!1,M.current.dismissOnMouseDown=!1)}))}function R(e,t){let n=X(e);if(!n)return;let r=q(n,e.type,()=>{t(e),r()})}function ae(e){A.current=`touch`,R(e,L)}function oe(e){N.clear(),e.type===`pointerdown`&&(e.button===0&&(D.current=!0),A.current=e.pointerType),(e.type!==`mousedown`||!M.current||M.current.dismissOnMouseDown)&&R(e,e=>{e.type===`pointerdown`?re(e):ee(e)})}function B(e){if(e.type===`pointercancel`&&(D.current=!1),!w.current)return;let n=T.current;l(),u()===`intentional`&&(e.type===`pointercancel`?n&&c():_(e)||(n?c():(typeof v!=`function`||v(e))&&(t.clear(),E.current=!0,P())))}function V(e){if(u()!==`sloppy`||!M.current||I(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-M.current.startX),r=Math.abs(t.clientY-M.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(M.current.dismissOnTouchEnd=!0),i>10&&(ee(e),N.clear(),M.current=null)}function se(e){R(e,V)}function ce(e){u()===`sloppy`&&M.current&&!I(e)&&(M.current.dismissOnTouchEnd&&ee(e),N.clear(),M.current=null)}function le(e){R(e,ce)}let ue=Kt(r&&Kt(q(i,`keydown`,ie),q(i,`compositionstart`,a),q(i,`compositionend`,o)),y&&Kt(q(i,`click`,oe,!0),q(i,`pointerdown`,oe,!0),q(i,`pointerup`,B,!0),q(i,`pointercancel`,B,!0),q(i,`mousedown`,oe,!0),q(i,`mouseup`,B,!0),q(i,`touchstart`,ae,{capture:!0,passive:!0}),q(i,`touchmove`,se,{capture:!0,passive:!0}),q(i,`touchend`,le,{capture:!0,passive:!0})));return()=>{ue(),t.clear(),l(),E.current=!1}},[m,p,r,y,v,d,n,S,C,ie,P,b,F,I,g,e,N,ne]);let V=Z.useMemo(()=>({onKeyDown:ie,onPointerDown:L,onClick:L}),[ie,L]),se=Z.useMemo(()=>({onKeyDown:ie,onPointerDown:oe,onMouseDown:oe,onClickCapture:R,onMouseDownCapture(e){R(),ae(e)},onPointerDownCapture(e){R(),ae(e)},onMouseUpCapture:R,onTouchEndCapture:R,onTouchMoveCapture:R}),[ie,R,ae,oe]);return Z.useMemo(()=>n?{reference:V,floating:se,trigger:V}:{},[n,V,se])}function Hr(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:a,nested:o,onOpenChange:s}=e,c=t.useState(`open`),l=t.useState(`activeTriggerElement`),u=t.useState(n?`popupElement`:`positionerElement`),d=s;return t.useSyncedValue(`floatingId`,a),i(()=>{let e={open:c,floatingId:a,referenceElement:l,floatingElement:u};f(l)&&(e.domReferenceElement=l),r.state.positionReference===r.state.referenceElement&&(e.positionReference=l),r.update(e)},[c,a,l,u,r]),r.context.onOpenChange=d,r.context.nested=o,r}function Ur(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:a,onUnmount:o,animateInitialOpen:s}=e,c=H(a),{mounted:l,setMounted:u,transitionStatus:d}=w(t,!1,!1,s),f=!t&&r;i(()=>{t&&c(!1)},[t,c]);let p=Z.useRef(l),m=Z.useRef(!1),h=v(),g=()=>{p.current=!1,u(!1),o()};i(()=>{p.current=l,m.current&&(m.current=!1,!t&&l&&g())});let _=H(()=>{p.current&&(t?(m.current=!0,h()):g())});return b({enabled:l&&!t&&!f,open:t,ref:n,onComplete(){t||_()}}),{mounted:l,transitionStatus:d,preventUnmountingOnClose:f,forceUnmount:_}}var Wr={tabIndex:-1,[ut]:``};function Gr(e){return t=>t!==`touch`||e.current}function Kr(e,t=!1){let n=p(),r=wr()!=null,i=xe(()=>e(n,r)).current;return Hr({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function qr({handle:e,store:t}){return i(()=>e.attachStore(t),[e,t]),null}function Jr(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Yr(e,t){let n=Z.useRef(null);return H(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Jr(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Jr(t))})}function Xr(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function Zr(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Qr(e,t,n,r={}){let i=n.reason,a=i===J,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Zr(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=Xr(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?Pe.flushSync(l):l()}function $r(e,t,n,r){let a=n.useState(`isMountedByTrigger`,e),o=Yr(e,n),s=H(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),c=H(e=>{o(e),e&&s(e)});return i(()=>(c(t.current),()=>c(null)),[c,t,n,e]),i(()=>{if(a){let e={activeTriggerElement:t.current,...r};n.update(e)}},[a,n,t,...Object.values(r)]),{registerTrigger:c,isMountedByThisTrigger:a}}function ei(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=Z.useRef(null),a=e.useState(`open`),o=e.useState(`triggerCount`),s=e.useState(`activeTriggerId`),c=e.useState(`activeTriggerElement`);i(()=>{if(!a){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,i={};e.state.triggerCount!==t&&(i.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(i.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){i.activeTriggerId=t,i.activeTriggerElement=n,r.current=t;break}i.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;i.activeTriggerId=e,i.activeTriggerElement=n,r.current=e}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=K(R);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[a,e,o,s,c,n])}function ti(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=Ur({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return xe(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function ni(e,t){e.useSyncedValues(t),i(()=>()=>{e.update({activeTriggerProps:ye,inactiveTriggerProps:ye,popupProps:ye})},[e])}function ri(e,t){i(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),i(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var ii=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},ai=t((e=>{var t=I();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),oi=t(((e,t)=>{t.exports=ai()})),si=t((e=>{var t=I(),n=oi();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ci=t(((e,t)=>{t.exports=si()})),li=oi(),ui=ci(),di=ie(19)?mi:hi;function fi(e,t,n,r,i){return di(e,t,n,r,i)}function pi(e,t,n,r,i){let a=Z.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,li.useSyncExternalStore)(e.subscribe,a,a)}Be({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,li.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function mi(e,t,n,r,i){let a=ze();if(!a)return pi(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function hi(e,t,n,r,i){return(0,ui.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var gi=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return fi(this,e,t,n,r)}},_i=class extends gi{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){Z.useDebugValue(e);let n=this;i(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;i(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);i(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){Z.useDebugValue(e);let n=this,r=t!==void 0;i(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return Z.useDebugValue(e),fi(this,this.selectors[e],t,n,r)}useContextCallback(e,t){Z.useDebugValue(e);let n=H(t??fe);this.context[e]=n}useStateSetter(e){let t=Z.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},vi={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},yi=class extends _i{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:br(),nested:n,triggerElements:i},vi),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&lt(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function bi(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new yi({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ye,inactiveTriggerProps:ye,popupProps:ye}}var xi=e=>e.triggerIdProp??e.activeTriggerId,Si=e=>e.openProp??e.open,Ci=e=>(e.popupElement?.id??e.floatingId)||void 0;function wi(e,t){return t!==void 0&&Si(e)&&xi(e)===t}function Ti(e,t){return wi(e,t)?!0:t!==void 0&&Si(e)&&xi(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Ei={open:Si,mounted:e=>e.mounted,transitionStatus:e=>Si(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:xi,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Ci,isTriggerActive:(e,t)=>t!==void 0&&xi(e)===t,isOpenedByTrigger:(e,t)=>wi(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&xi(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Ti(e,t)?Ci(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Di(e){let t=Z.useCallback(t=>e===void 0?fe:e.subscribeStore(t),[e]),n=Z.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,li.useSyncExternalStore)(t,n,()=>e?.serverStore)}var Oi=$e&&tt;function ki(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:c}=e.context,l=Z.useRef(!1),u=Z.useRef(null),d=Z.useRef(!0),p=o();Z.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=a(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&j(t)&&t===Y(s(t))&&(l.current=!0,u.current=t)}function o(){d.current=!0}function c(){d.current=!1}return Kt(q(r,`blur`,i),Oi&&q(r,`keydown`,o,!0),Oi&&q(r,`pointerdown`,c,!0))},[e,n]),Z.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);f(t)&&(u.current=t,l.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let m=Z.useMemo(()=>{function t(){l.current=!1,u.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(l.current){if(u.current===i)return;t()}let a=X(n.nativeEvent);if(f(a)){if(Oi&&!n.relatedTarget){if(!d.current&&!It(a))return}else if(!zt(a))return}let o=Nt(n.relatedTarget,e.context.triggerElements),{nativeEvent:s,currentTarget:c}=n;e.select(`open`)&&o||!r?e.setOpen(!0,K(G,s,c)):p.start(r,()=>{l.current||e.setOpen(!0,K(G,s,c))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,a=f(r)&&r.hasAttribute(Xn(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;p.start(0,()=>{let t=e.select(`domReferenceElement`),n=Y(s(t));(r||n!==t)&&(z(c.current.floatingContext?.refs.floating.current,n)||z(t,n)||a||Nt(r??n,e.context.triggerElements)||e.setOpen(!1,K(G,i)))})}}},[c,r,e,p]);return Z.useMemo(()=>n?{reference:m,trigger:m}:{},[n,m])}var Ai=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new k;restTimeout=new k;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},ji=new WeakMap;function Mi(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&ji.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),ji.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Ni(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=ji.get(n);a&&a!==e&&Mi(a),Mi(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,ji.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Pi(e){let t=e.context.dataRef.current,n=xe(()=>t.hoverInteractionState??Ai.create()).current;return t.hoverInteractionState||=n,Se(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Fi(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:a}=t,c=e.useState(`open`),l=e.useState(`floatingElement`),u=e.useState(`domReferenceElement`),{dataRef:d}=e.context,p=Tr(),m=wr(),h=Pi(e),g=o(),_=H(()=>Wt(d.current.openEvent?.type,h.interactedInside)),v=H(()=>Gt(d.current.openEvent?.type)),y=H(()=>{Mi(h)});i(()=>{c||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,y())},[c,h,y]),Z.useEffect(()=>y,[y]),i(()=>{if(n&&c&&h.handleCloseOptions?.blockPointerEvents&&v()&&f(u)&&l){let e=u,t=l,n=s(l),r=p?.nodesRef.current.find(e=>e.id===m)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=h.pointerEventsScopeElement===t?null:h.pointerEventsScopeElement,a=r===t?null:r,o=h.handleCloseOptions?.getScope?.()??i??a??Ce(e,`[data-rootownerid]`)??n.body;return Ni(h,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{y()}}},[n,c,u,l,h,v,p,m,y]),Z.useEffect(()=>{if(!n)return;function t(){return!!(p&&m&&Jn(p.nodesRef.current,m).length>0)}function i(t){let n=Ht(r,`close`,h.pointerType),i=()=>{e.setOpen(!1,K(J,t)),p?.events.emit(`floating.closed`,t)};n?h.openChangeTimeout.start(n,i):(h.openChangeTimeout.clear(),i())}function o(e){let t=X(e);Lt(t)?h.interactedInside=Ce(t,`[aria-haspopup]`)!=null:h.interactedInside=!1}function s(){h.openChangeTimeout.clear(),g.clear(),p?.events.off(`floating.closed`,u),y()}function c(n){if(t()&&p){p.events.on(`floating.closed`,u);return}if(Nt(n.relatedTarget,e.context.triggerElements))return;let r=d.current.floatingContext?.nodeId??a,o=n.relatedTarget;p&&r&&f(o)&&Jn(p.nodesRef.current,r,!1).some(e=>z(e.context?.elements.floating,o))||(h.handler?h.handler(n):(y(),v()&&!_()&&i(n)))}function u(n){p&&m&&!t()&&g.start(0,()=>{p.events.off(`floating.closed`,u),e.setOpen(!1,K(J,n)),p.events.emit(`floating.closed`,n)})}let b=l;return Kt(b&&q(b,`mouseenter`,s),b&&q(b,`mouseleave`,c),b&&q(b,`pointerdown`,o,!0),()=>{p?.events.off(`floating.closed`,u)})},[n,l,e,d,r,a,v,_,y,h,p,m,g])}var Ii={current:null};function Li(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:c=!0,triggerElementRef:l=Ii,externalTree:u,isActiveTrigger:d=!0,getHandleCloseContext:p,isClosing:m,shouldOpen:h,guardStaleOpen:_=!1}=t,{dataRef:v,events:y}=e.context,b=Tr(u),x=Pi(e),S=Z.useRef(!1),C=g(i),w=g(r),T=g(o),E=g(n),D=g(h),O=g(m),k=H(()=>Wt(v.current.openEvent?.type,x.interactedInside)),A=H(()=>D.current?.()!==!1),j=H((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!z(t,n);if(!f(r))return!1;let a=r;return i.hasMatchingElement(e=>z(e,a))&&(!t||!z(t,a))}),M=H(()=>{x.handler&&=(s(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,x.handler),void 0)}),N=H(()=>{Mi(x)});return d&&(x.handleCloseOptions=i?.__options),Z.useEffect(()=>M,[M]),Z.useEffect(()=>{if(!n)return;function e(e){e.open?S.current=!1:(S.current=e.reason===J,M(),x.openChangeTimeout.clear(),x.restTimeout.clear(),x.blockMouseMove=!0,x.restTimeoutPending=!1)}return y.on(`openchange`,e),()=>{y.off(`openchange`,e)}},[n,y,x,M]),Z.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=Ht(w.current,`close`,x.pointerType);r?x.openChangeTimeout.start(r,()=>{e.setOpen(!1,K(J,t)),b?.events.emit(`floating.closed`,t)}):n&&(x.openChangeTimeout.clear(),e.setOpen(!1,K(J,t)),b?.events.emit(`floating.closed`,t))}let r=l.current??(d?e.select(`domReferenceElement`):null);if(!f(r))return;function i(t){if(x.openChangeTimeout.clear(),x.blockMouseMove=!1,a&&!ct(x.pointerType))return;let n=Ut(T.current),r=Ht(w.current,`open`,x.pointerType),i=X(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(f(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(z(t,i)){c=t;break}}f(o)&&f(s)&&!e.context.triggerElements.hasElement(o)&&z(o,s)&&(c=s);let l=c!=null&&j(s,c,i),u=e.select(`open`),d=O.current?.()??e.select(`transitionStatus`)===`ending`,p=!u&&d&&S.current,m=!l&&f(c)&&f(s)&&z(s,c)&&p,h=n>0&&!r,g=l&&(u||p)||m,_=!u||l;g?A()&&e.setOpen(!0,K(J,t,c)):h||(r?x.openChangeTimeout.start(r,()=>{_&&A()&&e.setOpen(!0,K(J,t,c))}):_&&A()&&e.setOpen(!0,K(J,t,c)))}function o(n){if(k()){N();return}M();let r=e.select(`domReferenceElement`),i=s(r);x.restTimeout.clear(),x.restTimeoutPending=!1;let a=v.current.floatingContext??p?.();if(!Nt(n.relatedTarget,e.context.triggerElements)){if(C.current&&a){e.select(`open`)||x.openChangeTimeout.clear();let r=l.current;x.handler=C.current({...a,tree:b,x:n.clientX,y:n.clientY,onClose(){N(),M(),E.current&&!k()&&r===e.select(`domReferenceElement`)&&t(n,!0)}}),i.addEventListener(`mousemove`,x.handler),x.handler(n)}else(x.pointerType!==`touch`||!z(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function u(e){z(r,e.relatedTarget)||(x.openChangeTimeout.clear(),x.restTimeout.clear(),x.restTimeoutPending=!1)}let m=_?q(r,`mouseout`,u):void 0;return c?Kt(q(r,`mousemove`,i,{once:!0}),q(r,`mouseenter`,i),q(r,`mouseleave`,o),m):Kt(q(r,`mouseenter`,i),q(r,`mouseleave`,o),m)},[M,N,v,w,e,n,C,x,d,j,k,a,c,T,l,b,E,p,O,A,_]),Z.useMemo(()=>{if(!n)return;function t(e){x.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=j(i,r,t.target);if(a&&!ct(x.pointerType))return;if(o&&s&&x.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=x.handleCloseOptions?.getScope?.()??r.ownerDocument.body;Ni(x,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=Ut(T.current);if(o&&!s||c===0||!s&&x.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;x.restTimeout.clear();function l(){if(x.restTimeoutPending=!1,k())return;let t=e.select(`open`);!x.blockMouseMove&&(!t||s)&&A()&&e.setOpen(!0,K(J,n,r))}x.pointerType===`touch`?Pe.flushSync(()=>{l()}):s&&o?l():(x.restTimeoutPending=!0,x.restTimeout.start(c,l))}}},[n,x,k,j,a,e,T,A])}var Ri=.1,zi=Ri*Ri,$=.5;function Bi(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Vi(e,t,n,r,i,a,o,s,c,l){let u=!1;return Bi(e,t,n,r,i,a)&&(u=!u),Bi(e,t,i,a,o,s)&&(u=!u),Bi(e,t,o,s,c,l)&&(u=!u),Bi(e,t,c,l,n,r)&&(u=!u),u}function Hi(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Ui(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Wi(e={}){let{blockPointerEvents:t=!1}=e,n=new k,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,p=typeof performance<`u`?performance.now():0;function m(e,t){let n=performance.now(),r=n-p;if(u===null||d===null||r===0)return u=e,d=t,p=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*zi;return u=e,d=t,p=n,o<s}function h(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:p}=r,g=X(r),_=r.type===`mouseleave`,v=z(u,g),y=z(a,g);if(v&&(l=!0,!_))return;if(y&&(l=!1,!_)){l=!0;return}if(_&&f(r.relatedTarget)&&z(u,r.relatedTarget))return;function b(){return!!(s&&Jn(s.nodesRef.current,o).length>0)}function x(){b()||h()}if(b())return;let S=a.getBoundingClientRect(),C=u.getBoundingClientRect(),w=e>C.right-C.width/2,T=t>C.bottom-C.height/2,E=C.width>S.width,D=C.height>S.height,O=(E?S:C).left,k=(E?S:C).right,A=(D?S:C).top,j=(D?S:C).bottom;if(c===`top`&&t>=S.bottom-1||c===`bottom`&&t<=S.top+1||c===`left`&&e>=S.right-1||c===`right`&&e<=S.left+1){x();return}let M=!1;switch(c){case`top`:M=Ui(d,p,O,S.top+1,k,C.bottom-1);break;case`bottom`:M=Ui(d,p,O,C.top+1,k,S.bottom-1);break;case`left`:M=Ui(d,p,C.right-1,j,S.left+1,A);break;case`right`:M=Ui(d,p,S.right-1,j,C.left+1,A)}if(M)return;if(l&&!Hi(d,p,S)||!_&&m(d,p)){x();return}let N=!1;switch(c){case`top`:{let n=E?$/2:$*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t+$+1,o=w||E?C.bottom-$:C.top,s=w?E?C.bottom-$:C.top:C.bottom-$;N=Vi(d,p,r,a,i,a,C.left,o,C.right,s);break}case`bottom`:{let n=E?$/2:$*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t-$,o=w||E?C.top+$:C.bottom,s=w?E?C.top+$:C.bottom:C.top+$;N=Vi(d,p,r,a,i,a,C.left,o,C.right,s);break}case`left`:{let n=D?$/2:$*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e+$+1,o=T||D?C.right-$:C.left,s=T?D?C.right-$:C.left:C.right-$;N=Vi(d,p,o,C.top,s,C.bottom,a,r,a,i);break}case`right`:{let n=D?$/2:$*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e-$,o=T||D?C.left+$:C.right,s=T?D?C.left+$:C.right:C.left+$;N=Vi(d,p,a,r,a,i,o,C.top,s,C.bottom);break}}N?l||n.start(40,x):x()}};return r.__options={...e,blockPointerEvents:t},r}function Gi(e,t,n){let{reference:r,floating:i}=e,a=un(t),o=dn(t),s=ln(o),c=on(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=sn(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Ki(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=an(t,e),p=Cn(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=wn(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=wn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var qi=50,Ji=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ki},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Gi(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<qi&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Gi(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Yi=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=an(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=on(r),_=un(o),v=on(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[xn(o)]:pn(o)),x=p!==`none`;!d&&x&&b.push(...bn(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=fn(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===un(t)||T.every(e=>un(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=un(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Xi=new Set([`left`,`top`]);async function Zi(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=on(n),s=sn(n),c=un(n)===`y`,l=Xi.has(o)?-1:1,u=a&&c?-1:1,d=an(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Qi=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Zi(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},$i=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=an(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=un(i),p=cn(f),m=u[p],h=u[f],g=(e,t)=>rn(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},ea=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=an(e,t),u={x:n,y:r},d=un(i),f=cn(d),p=u[f],m=u[d],h=an(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Xi.has(on(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ta=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=an(e,t),c=await i.detectOverflow(t,s),l=on(n),u=sn(n),d=un(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Zt(p-c[m],g),y=Zt(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Qt(c.left,c.right):S=p-2*Qt(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function na(e){let t=x(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=j(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=$t(n)!==a||$t(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ra(e){return f(e)?e:e.contextElement}function ia(e){let t=ra(e);if(!j(t))return tn(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=na(t),o=(a?$t(n.width):n.width)/r,s=(a?$t(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var aa=tn(0);function oa(e){let t=a(e);return!ne()||!t.visualViewport?aa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sa(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===a(e)}function ca(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),o=ra(e),s=tn(1);t&&(r?f(r)&&(s=ia(r)):s=ia(e));let c=sa(o,n,r)?oa(o):tn(0),u=(i.left+c.x)/s.x,d=(i.top+c.y)/s.y,p=i.width/s.x,m=i.height/s.y;if(o&&r){let e=a(o),t=f(r)?a(r):r,n=e,i=l(n);for(;i&&t!==n;){let e=ia(i),t=i.getBoundingClientRect(),r=x(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,d*=e.y,p*=e.x,m*=e.y,u+=o,d+=s,n=a(i),i=l(n)}}return wn({width:p,height:m,x:u,y:d})}function la(e,t){let n=y(e).scrollLeft;return t?t.left+n:ca(T(e)).left+n}function ua(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-la(e,n),y:n.top+t.scrollTop}}function da(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=T(r),s=t?P(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=tn(1),u=tn(0),d=j(r);if((d||!a)&&((m(r)!==`body`||_(o))&&(c=y(r)),d)){let e=ca(r);l=ia(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ua(o,c):tn(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function fa(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function pa(e){let t=y(e),n=e.ownerDocument.body,r=Qt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Qt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+la(e),o=-t.scrollTop;return x(n).direction===`rtl`&&(a+=Qt(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ma=25;function ha(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=a(e),o=T(e),s=i.visualViewport,c=o.clientWidth,l=o.clientHeight,u=0,d=0;if(s){let e=!ne()||t===`fixed`;r?e||(u=-s.offsetLeft,d=-s.offsetTop):(c=s.width,l=s.height,e&&(u=s.offsetLeft,d=s.offsetTop))}if(la(o)<=0){let e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-r),a=getComputedStyle(o).scrollbarGutter===`stable both-edges`?i/2:i;a<=ma&&(c-=a)}return{width:c,height:l,x:u,y:d}}function ga(e,t){let n=ca(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ia(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function _a(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ha(e,n,t);else if(t===`document`)r=pa(T(e));else if(f(t))r=ga(t,n);else{let n=oa(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return wn(r)}function va(e,t){let n=t.get(e);if(n)return n;let r=O(e,[],!1).filter(e=>f(e)&&m(e)!==`body`),i=null,a=x(e).position===`fixed`,o=a?we(e):e;for(;f(o)&&!te(o);){let e=x(o),t=N(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=we(o)}return t.set(e,r),r}function ya(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?P(t)?[]:va(t,this._c):[].concat(n),r],o=_a(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=_a(t,a[e],i);s=Qt(n.top,s),c=Zt(n.right,c),l=Zt(n.bottom,l),u=Qt(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ba(e){let{width:t,height:n}=na(e);return{width:t,height:n}}function xa(e,t,n){let r=j(t),i=T(t),a=n===`fixed`,o=ca(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=tn(0);if((r||!a)&&((m(t)!==`body`||_(i))&&(s=y(t)),r)){let e=ca(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=la(i));let l=i&&!r&&!a?ua(i,s):tn(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Sa(e){return x(e).position===`static`}function Ca(e,t){if(!j(e)||x(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return T(e)===n&&(n=n.ownerDocument.body),n}function wa(e,t){let n=a(e);if(P(e))return n;if(!j(e)){let t=we(e);for(;t&&!te(t);){if(f(t)&&!Sa(t))return t;t=we(t)}return n}let r=Ca(e,t);for(;r&&h(r)&&Sa(r);)r=Ca(r,t);return r&&te(r)&&Sa(r)&&!N(r)?n:r||C(e)||n}var Ta=async function(e){let t=this.getOffsetParent||wa,n=this.getDimensions,r=await n(e.floating);return{reference:xa(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ea(e){return x(e).direction===`rtl`}var Da={convertOffsetParentRelativeRectToViewportRelativeRect:da,getDocumentElement:T,getClippingRect:ya,getOffsetParent:wa,getElementRects:Ta,getClientRects:fa,getDimensions:ba,getScale:ia,isElement:f,isRTL:Ea};function Oa(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ka(e,t,n){let r=null,i,o=T(e);function s(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function c(n,a){n===void 0&&(n=!1),a===void 0&&(a=1),s();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=en(d),h=en(o.clientWidth-(u+f)),g=en(o.clientHeight-(d+p)),_=en(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Qt(0,Zt(1,a))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Oa(l,e.getBoundingClientRect()))return c();if(n!==a){if(!y)return c();n?c(!1,n):i=setTimeout(()=>{c(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:o.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let l=a(e),u=()=>c(n);return l.addEventListener(`resize`,u),c(!0),()=>{l.removeEventListener(`resize`,u),s()}}function Aa(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ra(e),u=i||a?[...l?O(l):[],...t?O(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?ka(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?ca(e):null;c&&g();function g(){let t=ca(e);h&&!Oa(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ja=Qi,Ma=$i,Na=Yi,Pa=ta,Fa=ea,Ia=(e,t,n)=>{let r=new Map,i=n??{},a={...Da,...i.platform,_c:r};return Ji(e,t,{...i,platform:a})},La=typeof document<`u`?Z.useLayoutEffect:function(){};function Ra(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ra(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Ra(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function za(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ba(e,t){let n=za(e);return Math.round(t*n)/n}function Va(e){let t=Z.useRef(e);return La(()=>{t.current=e}),t}function Ha(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=Z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=Z.useState(r);Ra(f,r)||p(r);let[m,h]=Z.useState(null),[g,_]=Z.useState(null),v=Z.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=Z.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=Z.useRef(null),C=Z.useRef(null),w=Z.useRef(u),T=c!=null,E=Va(c),D=Va(i),O=Va(l),k=Z.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Ia(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Ra(w.current,t)&&(w.current=t,Pe.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);La(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=Z.useRef(!1);La(()=>(A.current=!0,()=>{A.current=!1}),[]),La(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=Z.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=Z.useMemo(()=>({reference:b,floating:x}),[b,x]),N=Z.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Ba(M.floating,u.x),r=Ba(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...za(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return Z.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Ua=(e,t)=>{let n=ja(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wa=(e,t)=>{let n=Ma(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ga=(e,t)=>({fn:Fa(e).fn,options:[e,t]}),Ka=(e,t)=>{let n=Na(e);return{name:n.name,fn:n.fn,options:[e,t]}},qa=(e,t)=>{let n=Pa(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Ja(e){let{nodeId:t,externalTree:n,rootContext:r}=e,a=r.useState(`referenceElement`),o=r.useState(`floatingElement`),s=r.useState(`domReferenceElement`),c=r.useState(`open`),l=r.useState(`floatingId`),[u,d]=Z.useState(null),p=Z.useRef(null),m=Tr(n),h=Z.useMemo(()=>({reference:a,floating:o,domReference:s}),[a,o,s]),g=Ha({...e,elements:{...h,...u&&{reference:u}}}),_=Z.useCallback(e=>{let t=f(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),g.refs.setReference(t)},[g.refs]),v=Z.useMemo(()=>({...g.refs,setPositionReference:_,domReference:p}),[g.refs,_]),y=Z.useMemo(()=>({...g.elements,domReference:s}),[g.elements,s]),b=Z.useMemo(()=>({...g,dataRef:r.context.dataRef,open:c,onOpenChange:r.setOpen,events:r.context.events,floatingId:l,refs:v,elements:y,nodeId:t,rootStore:r}),[g,v,y,t,r,c,l]);return i(()=>{s&&(p.current=s)},[s]),i(()=>{r.context.dataRef.current.floatingContext=b;let e=m?.nodesRef.current.find(e=>e.id===t);e&&(e.context=b)}),Z.useMemo(()=>({...g,context:b,refs:v,elements:y,rootStore:r}),[g,v,y,b,r])}var Ya=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=an(e,t)||{};if(l==null)return{};let d=Cn(u),f={x:n,y:r},p=dn(i),m=ln(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=rn(D,k,O),j=!c.arrow&&sn(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Xa=(e,t)=>{let{name:n,fn:r}=Ya(e);return{name:n,fn:r,options:[e,t]}},Za={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Qa={sideX:`left`,sideY:`top`},$a=`--available-width`,eo=`--available-height`,to=`--anchor-width`,no=`--anchor-height`,ro=`--transform-origin`,io=$a,ao=eo;function oo(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function so(e,t,n){let{rects:r,placement:i}=e;return{side:oo(t,on(i),n),align:sn(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function co(e){return lo(e,Ja)}function lo(e,t){let{anchor:n,positionMethod:o=`absolute`,side:c=`bottom`,sideOffset:l=0,align:u=`center`,alignOffset:d=0,collisionBoundary:f,collisionPadding:p=5,sticky:m=!1,arrowPadding:h=5,disableAnchorTracking:_=!1,inline:v,keepMounted:y=!1,floatingRootContext:b,mounted:x,collisionAvoidance:S,shift:C,nodeId:w,adaptiveOrigin:T,lazyFlip:E=!1,externalTree:D}=e,O=S.side||`flip`,k=S.align||`flip`,A=S.fallbackAxisSide||`end`,j=C?.crossAxis??!1,M=C?.rootBoundary,N=typeof n==`function`?n:void 0,ee=H(N),te=N?ee:n,ne=g(n),P=g(x),re=r()===`rtl`,[F,I]=Z.useState(null);!x&&F!==null&&I(null);let L=E===`placement`,ie=F?on(F):null,R=F&&L?sn(F)||`center`:null,z=ie||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":re?`left`:`right`,"inline-start":re?`right`:`left`}[c],ae=R||u,oe=ae===`center`?z:`${z}-${ae}`,B=p;typeof B==`number`?B={top:B,right:B,bottom:B,left:B}:B&&={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0};let V=+(c===`bottom`),se=+(c===`top`),ce=+(c===`right`),le=+(c===`left`),ue={boundary:f===`clipping-ancestors`?`clippingAncestors`:f,padding:B},de=Z.useRef(null),fe=g(l),pe=g(d),U=typeof l==`function`?0:l,W=typeof d==`function`?0:d,G=[];v&&G.push(v),G.push(Ua(e=>{let t=so(e,c,re),n=typeof fe.current==`function`?fe.current(t):fe.current,r=typeof pe.current==`function`?pe.current(t):pe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[U,W,re,c]));let me=k===`none`&&O!==`shift`,he=!me&&(m||j||O===`shift`),ge=O===`none`?null:Ka({...ue,padding:{top:B.top+1+V,right:B.right+1+le,bottom:B.bottom+1+se,left:B.left+1+ce},mainAxis:!j&&O===`flip`,crossAxis:k===`flip`&&`alignment`,fallbackAxisSideDirection:A}),_e=me?null:Wa({...ue,rootBoundary:M,mainAxis:k!==`none`,crossAxis:he,limiter:m||j?void 0:Ga(e=>{if(!de.current)return{};let{width:t,height:n}=de.current.getBoundingClientRect(),r=un(on(e.placement)),i=r===`y`?t:n,a=r===`y`?B.left+B.right:B.top+B.bottom;return{offset:i/2+a/2}})},[ue,m,j,M,B,k]);O===`shift`||k===`shift`||ae===`center`?G.push(_e,ge):G.push(ge,_e),G.push(qa({...ue,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!P.current)return;let i=e.style;i.setProperty(io,`${t}px`),i.setProperty(ao,`${n}px`);let o=a(e).devicePixelRatio||1,{x:s,y:c,width:l,height:u}=r.reference,d=(Math.round((s+l)*o)-Math.round(s*o))/o,f=(Math.round((c+u)*o)-Math.round(c*o))/o;i.setProperty(to,`${d}px`),i.setProperty(no,`${f}px`)}}),Xa(e=>({element:de.current||s(e.elements.floating).createElement(`div`),padding:de.current?h:0}),[h]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:i,rects:a,y:o}=e,s=on(r),u=sn(r),d=un(s)===`y`,f=de.current,p=typeof l==`function`?l(so(e,c,re)):l,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&i.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=s===`top`||s===`left`?`calc(100% + ${p}px)`:`${-p}px`;return he&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${a.reference.y+a.reference.height/2-o}px`),t.style.setProperty(ro,d?`${m} ${h}`:`${h} ${m}`),{}}},Za,T),i(()=>{!x&&b&&b.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[x,b]);let K=Z.useMemo(()=>({ancestorScroll:!_,elementResize:!_&&typeof ResizeObserver<`u`,layoutShift:!_&&typeof IntersectionObserver<`u`}),[_]),{refs:q,elements:ve,x:ye,y:be,middlewareData:xe,update:J,placement:Y,context:Se,isPositioned:X,floatingStyles:Ce}=t({rootContext:b,open:y?x:void 0,placement:oe,middleware:G,strategy:o,whileElementsMounted:y?void 0:(...e)=>Aa(...e,K),nodeId:w,externalTree:D}),{sideX:we,sideY:Te}=xe.adaptiveOrigin||Qa,Ee=X?o:`fixed`,De=Z.useMemo(()=>{let e;return e=X?T?{position:Ee,[we]:ye,[Te]:be}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[io]=`100vw`,e[ao]=`100vh`,X||(e.opacity=0),e},[T,Ee,we,ye,Te,be,Ce,X]),Oe=Z.useRef(null);i(()=>{if(!x)return;let e=ne.current,t=typeof e==`function`?e():e,n=(uo(t)?t.current:t)||null;n!==Oe.current&&(q.setPositionReference(n),Oe.current=n)},[x,q,te,ne]),Z.useEffect(()=>{if(!x)return;let e=ne.current;typeof e!=`function`&&uo(e)&&e.current!==Oe.current&&(q.setPositionReference(e.current),Oe.current=e.current)},[x,q,te,ne]),Z.useEffect(()=>{if(y&&x&&ve.reference&&ve.floating)return Aa(ve.reference,ve.floating,J,K)},[y,x,ve,J,K]);let ke=on(Y),Ae=oo(c,ke,re),je=sn(Y)||`center`,Me=!!xe.hide?.referenceHidden;i(()=>{E&&x&&X&&(ke!==z||L&&je!==ae)&&I(Y)},[E,L,x,X,Y,ke,je,z,ae]);let Ne=Z.useMemo(()=>({position:`absolute`,top:xe.arrow?.y,left:xe.arrow?.x}),[xe.arrow]),Q=xe.arrow?.centerOffset!==0;return Z.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:de,arrowUncentered:Q,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:q,context:Se,isPositioned:X,update:J}),[De,Ne,de,Q,Ae,je,ke,Me,q,Se,X,J])}function uo(e){return e!=null&&`current`in e}function fo(e){return e===`starting`?ur:ye}function po(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),V(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},fo(r),i],stateAttributesMapping:At})}function mo(e,t,n,r=!0,a,o){let[s,c]=Z.useState(),l=pe(a?`${a}-label`:void 0),u=!!o?.trim(),d=e??(u?void 0:t)??s;return i(()=>{let i=e||t||u||!r?void 0:ho(n.current,l);s!==i&&c(i)}),d}function ho(e,t){let n=go(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function go(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function _o(e){let{render:t,className:n,style:r,state:i=ye,props:a=he,refs:o=he,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=be({metadata:s});return V(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}var vo=Z.createContext(void 0);function yo(e){let t=Z.useContext(vo);if(t===void 0&&!e)throw Error(W(69));return t}function bo(e){return e.status===`error`||(e.httpStatus??0)>=400}function xo(e){return e===void 0?`running`:e<1?`${e.toFixed(2)} ms`:e<100?`${e.toFixed(1).replace(/\.0$/,``)} ms`:e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(2)} s`}function So(e,t){let n=new Date(e),r=String(n.getMilliseconds()).padStart(3,`0`).slice(0,2),i=`${n.toLocaleTimeString([],{hour12:!1})}.${r}`;return t?`${n.toLocaleDateString([],{month:`short`,day:`numeric`})} ${i}`:i}function Co(e){return new Date(e).toLocaleTimeString([],{hour12:!1})}function wo(e){return new Date(e).toLocaleString([],{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hour12:!1})}function To(e,t){return t<=1296e5?new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,hour12:!1}):new Date(e).toLocaleDateString([],{month:`short`,day:`numeric`})}function Eo(e){return`${(e*100).toFixed(1).replace(/\.0$/,``)}%`}function Do(e){return e>=1e4?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function Oo(e,t){if(e.length===0)return 0;let n=(e.length-1)*t,r=Math.floor(n),i=Math.ceil(n);return e[r]+(e[i]-e[r])*(n-r)}function ko(e){return e.attributes[`db.statement`]===void 0?e.name.startsWith(`action `)?`action`:e.name.startsWith(`rpc `)?`rpc`:e.attributes[`http.route`]===void 0?`other`:`http`:`sql`}function Ao(e){let t=new Map(e.map(e=>[e.spanId,e.parentSpanId])),n=new Map,r=e=>{let i=n.get(e);if(i!==void 0)return i;let a=t.get(e),o=a!==void 0&&t.has(a)?r(a)+1:0;return n.set(e,o),o};for(let t of e)r(t.spanId);return n}var jo=e=>e.endMs===void 0?0:e.endMs-e.startMs,Mo=(e,t)=>{let n=e?.[t];return typeof n==`string`?n:void 0};function No(e){let t=e.spans.filter(e=>ko(e)===`sql`),n=t.map(jo),r;for(let t of e.spans){let e=t.events.find(e=>e.name===`exception`),n=Mo(t.attributes,`brick.error.code`);if(e||n){r={message:Mo(e?.attributes,`exception.message`)??t.statusMessage,stack:Mo(e?.attributes,`exception.stacktrace`),code:n,span:t.name};break}}return{action:e.spans.find(e=>ko(e)===`action`),calls:e.spans.filter(e=>ko(e)===`rpc`),queries:{count:t.length,totalMs:n.reduce((e,t)=>e+t,0),slowestMs:Math.max(0,...n)},exception:r}}function Po(e,t){if(!t)return e;let n=(Array.isArray(e.servers)?e.servers:[]).filter(e=>typeof e?.url==`string`).map(e=>{let n=e.url;return n.includes(`{`)?e:{...e,url:new URL(n,`${t}/`).href.replace(/\/$/,``)}});return{...e,servers:n.length>0?n:[{url:t,description:`Dev server`}]}}var Fo={http:`bg-span-request`,action:`bg-span-action`,rpc:`bg-span-rpc`,sql:`bg-span-sql`,other:`bg-span-other`},Io={http:`Request`,action:`Action`,rpc:`Service call`,sql:`SQL`,other:`Other`},Lo=`bg-[image:repeating-linear-gradient(135deg,transparent_0_4px,color-mix(in_oklab,var(--background)_45%,transparent)_4px_8px)]`;function Ro(e){return e.status===`error`}function zo({span:e}){let t=Object.entries(e.attributes).filter(([,e])=>e!==void 0),n=e.events.filter(e=>e.name===`exception`);return(0,Q.jsxs)(`div`,{className:`mb-2 flex flex-col gap-2`,children:[(0,Q.jsx)(`dl`,{className:`m-0 grid grid-cols-[max-content_minmax(0,1fr)] gap-x-4 gap-y-0.5 border bg-muted/50 p-3 font-mono text-xs leading-[18px]`,children:t.map(([e,t])=>(0,Q.jsxs)(`div`,{className:`contents`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,Q.jsx)(`dd`,{className:`m-0 [overflow-wrap:anywhere]`,children:String(t)})]},e))}),n.map((e,t)=>(0,Q.jsxs)(`pre`,{className:`m-0 overflow-auto border bg-muted/50 p-3 font-mono text-xs leading-[18px] [overflow-wrap:anywhere] whitespace-pre-wrap`,children:[String(e.attributes[`exception.message`]??``),e.attributes[`exception.stacktrace`]?`\n\n${String(e.attributes[`exception.stacktrace`])}`:``]},t))]})}function Bo({trace:e,now:t}){let[n,r]=(0,Z.useState)(),i=Ao(e.spans),a=Math.max(e.endMs??t,...e.spans.map(e=>e.endMs??t)),o=Math.max(a-e.startMs,.001),s=[...new Set(e.spans.map(ko))];return(0,Q.jsxs)(`div`,{className:`flex flex-col px-4 pt-2 pb-4`,children:[(0,Q.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[s.map(e=>(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(`i`,{className:F(`size-2 rounded-[1px]`,Fo[e])}),Io[e]]},e)),e.spans.some(Ro)&&(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(`i`,{className:`size-2 rounded-[1px] bg-destructive`}),`Failed`]})]}),e.spans.map(a=>{let s=a.endMs??t,c=ko(a),l=Math.min(Math.max((a.startMs-e.startMs)/o*100,0),99.5),u=Math.min(Math.max((s-a.startMs)/o*100,.5),100-l),d=n===a.spanId;return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`button`,{type:`button`,"aria-expanded":d,onClick:()=>r(d?void 0:a.spanId),className:`group grid min-h-7 w-full grid-cols-[minmax(120px,38%)_minmax(0,1fr)_64px] items-center gap-3 text-left`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center truncate text-[13px] text-muted-foreground group-hover:text-foreground`,style:{paddingLeft:(i.get(a.spanId)??0)*14},title:String(a.attributes[`db.statement`]??a.name),children:[(0,Q.jsx)(`i`,{className:F(`mr-2 size-2 shrink-0 rounded-[1px]`,Ro(a)?`bg-destructive`:Fo[c])}),(0,Q.jsx)(`span`,{className:`truncate`,children:a.name})]}),(0,Q.jsx)(`span`,{className:`relative h-3 overflow-hidden bg-border/70`,children:(0,Q.jsx)(`span`,{className:F(`absolute inset-y-0 min-w-0.5 rounded-[1.5px]`,Ro(a)?`bg-destructive`:Fo[c],a.status===`running`&&Lo),style:{left:`${l}%`,width:`${u}%`}})}),(0,Q.jsx)(`span`,{className:`text-right text-xs text-muted-foreground tabular-nums`,children:xo(a.endMs===void 0?void 0:a.endMs-a.startMs)})]}),d&&(0,Q.jsx)(zo,{span:a})]},a.spanId)}),e.truncated&&(0,Q.jsx)(Ie,{variant:`outline`,className:`mt-2 self-start`,children:`Some spans were dropped`})]})}var Vo=Z.createContext(void 0);function Ho(e){let t=Z.useContext(Vo);if(t===void 0&&!e)throw Error(W(47));return t}var Uo={...Ei,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!Ei.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&Ei.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>Ei.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Wo=class extends _i{constructor(e,t,n){let r=new ii;super(Go(e,r,t,n),Ko(r),Uo)}setOpen=(e,t)=>{let n=t.reason===J,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=Zr(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=Xr(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),Pe.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function Go(e,t,n,r=!1){let i={...bi(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function Ko(e){return{popupRef:Z.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:Z.createRef(),beforeTriggerFocusGuardRef:Z.createRef(),beforeContentFocusGuardRef:Z.createRef(),stickIfOpenTimeout:new k,stickIfOpen:!0,triggerElements:e}}var qo=Ve(function({props:e}){let{children:t,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,modal:s=!1,handle:c,triggerId:l,defaultTriggerId:u=null}=e,d=Yo(c,{modal:s,open:i,openProp:r,activeTriggerId:u,triggerIdProp:l});d.useControlledProp(`openProp`,r),d.useControlledProp(`triggerIdProp`,l);let f=d.useState(`open`),p=d.useState(`mounted`),m=d.useState(`payload`);d.useContextCallback(`onOpenChange`,a),d.useContextCallback(`onOpenChangeComplete`,o),ri(d,f),ei(d);let{forceUnmount:h}=ti(f,d,()=>{d.context.stickIfOpen=!0,d.set(`openChangeReason`,null)});d.useSyncedValues({modal:s}),Z.useEffect(()=>{f||d.context.stickIfOpenTimeout.clear()},[d,f]),Z.useImperativeHandle(e.actionsRef,()=>({unmount:h,close:()=>d.setOpen(!1,K(n))}),[h,d]);let g=f||p||c!=null;return(0,Q.jsxs)(Vo.Provider,{value:d,children:[c&&(0,Q.jsx)(qr,{handle:c,store:d}),g&&(0,Q.jsx)(Xo,{store:d,modal:s}),typeof t==`function`?t({payload:m}):t]})});function Jo(e){return Ho(!0)?(0,Q.jsx)(qo,{props:e}):(0,Q.jsx)(Or,{children:(0,Q.jsx)(qo,{props:e})})}function Yo(e,t){let n=Kr((e,n)=>new Wo(t,e,n));return Z.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function Xo({store:e,modal:t}){let n=Vr(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return ni(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}function Zo(e,t){function n(n,r,i){let a=n.currentTarget;Pe.flushSync(()=>{e.setOpen(!1,K(E,n.nativeEvent,a))}),Wn(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&Gn(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Qo(e){let t=Z.useRef(``),n=Z.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:Z.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function $o(e,t){let{onClick:n,onPointerDown:r}=Qo(H((n,r)=>{(typeof e==`function`?e():e)||t(r||(Xe?`touch`:``))}));return Z.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function es(e){let[t,n]=Z.useState(null),r=$o(e,n);return oe(e,t=>{t&&!e&&n(null)}),Z.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var ts=He(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=Ho(!0),h=Di(s)??m;if(!h)throw Error(W(74));let g=pe(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=Z.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=$r(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`isPressOpenedByTrigger`,g),T=h.useState(`isTouchPressOpen`,l),E=h.useState(`hasTriggerFocusGuards`,g),D=Li(v,{enabled:!a&&l&&!T,mouseOnly:!0,move:!1,handleClose:Wi(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),O=Rr(v,{stickIfOpen:H(()=>h.context.stickIfOpen)}),k=$o(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),j=h.useState(`triggerProps`,C),{getButtonProps:M,buttonRef:N}=A({disabled:a,native:o}),ee={open(e){return w?kt.open(e):Ot.open(e)}},{handlePreFocusGuardFocus:te,handleFocusTargetFocus:ne}=Zo(h,x),P=V(`button`,e,{state:{disabled:a,open:y},ref:[N,t,S,x],props:[O.reference,D,j,k,{[dr]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,M],stateAttributesMapping:ee}),re=(0,Q.jsx)(Z.Fragment,{children:P},g);return E?(0,Q.jsxs)(Z.Fragment,{children:[(0,Q.jsx)(Xt,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:te}),re,(0,Q.jsx)(Xt,{ref:h.context.triggerFocusTargetRef,onFocus:ne})]}):re}),ns=Z.createContext(void 0);function rs(){let e=Z.useContext(ns);if(e===void 0)throw Error(W(45));return e}var is=Z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Ho().useState(`mounted`)||n?(0,Q.jsx)(ns.Provider,{value:n,children:(0,Q.jsx)(yr,{ref:t,...r})}):null}),as=Z.createContext(void 0);function os(){let e=Z.useContext(as);if(!e)throw Error(W(46));return e}var ss=Z.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Q.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function cs(e){let{store:t,domReference:n,positionerElement:r,open:a}=e,o=Z.useRef(null),s=Z.useRef(null),c=S(r);i(()=>{a||(s.current?.abort(),s.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[a,t]),i(()=>{let e=n,r=o.current;if(e&&(o.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return s.current=i,c(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,c,t])}var ls={},us={},ds=``;function fs(e,t){return _(e)?e:t}function ps(e,t,n){return/hidden|clip/.test(e.getComputedStyle(fs(t,n)).overflowY)}function ms(e){if(typeof document>`u`)return!1;let t=s(e);return a(t).innerWidth-t.documentElement.clientWidth>0}function hs(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=s(e),n=t.documentElement,r=t.body,i=fs(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let c=i.offsetWidth;i.style.overflowY=`hidden`;let l=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,c===l}function gs(e){let t=s(e),n=t.documentElement,r=t.body,i=fs(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function _s(e){let t=s(e),n=t.documentElement,r=t.body,i=a(n),o=0,c=0,l=!1,u=ee.create();if(tt&&(i.visualViewport?.scale??1)!==1)return()=>{};function d(){let t=i.getComputedStyle(n),a=i.getComputedStyle(r),s=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;o=n.scrollTop,c=n.scrollLeft,ls={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ds=n.style.scrollBehavior,us={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||a.overflowY===`scroll`,p=t.overflowX===`scroll`||a.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(a.marginTop)+parseFloat(a.marginBottom),_=parseFloat(a.marginLeft)+parseFloat(a.marginRight),v=fs(n,r);l=hs(e),l?(n.style.scrollbarGutter=s,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:s,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=o,r.scrollLeft=c,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function f(){Object.assign(n.style,ls),Object.assign(r.style,us),l||(n.scrollTop=o,n.scrollLeft=c,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=ds)}function p(){f(),u.request(d)}d();let m=q(i,`resize`,p);return()=>{u.cancel(),f(),typeof i.removeEventListener==`function`&&m()}}var vs=new class{lockCount=0;restore=null;timeoutLock=k.create();timeoutUnlock=k.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=s(e),n=t.documentElement,r=t.body,i=a(n);if(ps(i,n,r)){let t=new i.MutationObserver(()=>{ps(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let o=Xe||!ms(e);this.restore=o?gs(e):_s(e)}};function ys(e=!0,t=null){i(()=>{if(e)return vs.acquire(t)},[e,t])}var bs=20;function xs(e,t,n,r){let[a,o]=Z.useState(!1);i(()=>{if(!e||!t||n==null){o(!1);return}let r=s(n).documentElement.clientWidth,i=n.offsetWidth;o(r>0&&i>0&&i>=r-bs)},[e,t,n]),ys(e&&(!t||a),r)}var Ss=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=pr,..._}=e,v=Ho(),y=rs(),b=Er(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=co({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:v.useState(`adaptiveOrigin`)});cs({store:v,domReference:x.useState(`domReferenceElement`),positionerElement:O,open:C});let M=E===!0&&w!==`trigger-hover`;xs(C&&M,D===`touch`,O,T);let N=v.useStateSetter(`positionerElement`),ee=po(e,{open:C,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:k},{styles:j.positionerStyles,transitionStatus:A,props:_,refs:[t,N],hidden:!S,inert:!C});return(0,Q.jsxs)(as.Provider,{value:j,children:[S&&M&&(0,Q.jsx)(ss,{inert:U(!C),cutout:T}),(0,Q.jsx)(Dr,{id:b,children:ee})]})}),Cs=Z.createContext(void 0);function ws(){let[e,t]=Z.useState(0),n=H(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:Z.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var Ts=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=Ho(),l=os(),u=yo(!0)!=null,{context:d,hasClosePart:f}=ws(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),x=c.useState(`modal`),S=c.useState(`mounted`),C=c.useState(`openChangeReason`),w=c.useState(`activeTriggerElement`),T=c.useState(`floatingRootContext`),E=T.useState(`floatingId`),D=c.useState(`disabled`),O=c.useState(`openOnHover`),k=c.useState(`closeDelay`);b({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),Fi(T,{enabled:O&&!D,closeDelay:k});let A=a===void 0?Gr(c.context.popupRef):a,M=x!==!1&&f;c.useSyncedValue(`focusManagerModal`,M);let N=c.useStateSetter(`popupElement`),ee={open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},te=V(`div`,e,{state:ee,ref:[t,c.context.popupRef,N],props:[_,{id:E,role:`dialog`,...Wr,"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&de.has(e.key)&&e.stopPropagation()}},fo(g),s],stateAttributesMapping:jt});return(0,Q.jsx)(Lr,{context:T,openInteractionType:m,modal:M,disabled:!S||C===`trigger-hover`,initialFocus:A,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:j(w)?w:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,Q.jsx)(Cs.Provider,{value:d,children:te})})});export{ti as $,He as $t,po as A,Mt as At,bi as B,vt as Bt,Oo as C,Xt as Ct,yo as D,Bt as Dt,Po as E,Ht as Et,Li as F,xt as Ft,ii as G,ct as Gt,yi as H,ft as Ht,Fi as I,St as It,Qr as J,it as Jt,Wr as K,ot as Kt,Pi as L,_t as Lt,co as M,jt as Mt,Da as N,kt as Nt,_o as O,Rt as Ot,Wi as P,Ot as Pt,ei as Q,Ve as Qt,ki as R,yt as Rt,bo as S,$t as St,ko as T,Yt as Tt,_i as U,pt as Ut,Ei as V,ht as Vt,oi as W,mt as Wt,Gr as X,tt as Xt,Zr as Y,rt as Yt,Xr as Z,$e as Zt,Do as _,dr as _t,cs as a,Hr as at,Eo as b,Qn as bt,ts as c,Lr as ct,Zo as d,Er as dt,Ie as en,ni as et,Jo as f,wr as ft,Co as g,vr as gt,To as h,yr as ht,ys as i,Ee as in,Ur as it,fo as j,At as jt,mo as k,It as kt,es as l,Dr as lt,No as m,xr as mt,Ss as n,Ae as nn,ri as nt,ss as o,Vr as ot,Bo as p,Tr as pt,qr as q,st as qt,xs as r,Oe as rn,$r as rt,is as s,Rr as st,Ts as t,Me as tn,Kr as tt,$o as u,Or as ut,wo as v,fr as vt,Ao as w,Jt as wt,So as x,wn as xt,xo as y,pr as yt,Di as z,gt as zt};
@@ -1 +0,0 @@
1
- export{w as isSpecialLang}from"./api-reference-r893F8zi.js";
@@ -1,4 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{At as t,Qt as n,Tt as r,Zt as i,_n as a,c as o,dn as s,en as c,fn as l,gn as u,hn as d,ht as f,j as p,jt as m,kt as h,l as g,ln as _,mn as v,nn as y,o as b,pn as x,t as S,tn as C,u as w,w as T,x as E,y as D}from"./preload-helper-CjQDFR0M.js";import{A as O,D as k,I as A,L as j,M,N,O as ee,P,a as F,c as te,d as I,f as ne,g as re,h as ie,i as ae,j as oe,k as L,l as se,m as ce,n as le,o as ue,p as de,r as fe,s as pe,t as me,u as he,w as ge}from"./CollapsiblePanel-a54TwMKb.js";var _e={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};_e.node;var ve=v(_e),ye={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};ye.node;var be=v(ye),R=e(a(),1);async function xe(e,t){let n=await fetch(e,{signal:t});if(n.status!==404){if(!n.ok)throw Error(await n.text());return await n.json()}}function Se(e){let[t,n]=(0,R.useState)();return(0,R.useEffect)(()=>{let e=new AbortController;return xe(`/api/docs`,e.signal).then(e=>e&&n(e),()=>{}),()=>e.abort()},[e]),t}function Ce(e,t){let n=e.join(`/`),[r,i]=(0,R.useState)();return(0,R.useEffect)(()=>{let t=new AbortController;return xe(`/api/docs/page/${e.map(encodeURIComponent).join(`/`)}`,t.signal).then(e=>i({key:n,value:e?{status:`ready`,page:e}:{status:`missing`}}),e=>{t.signal.aborted||i({key:n,value:{status:`failed`,message:e instanceof Error?e.message:String(e)}})}),()=>t.abort()},[n,t]),r&&r.key===n?r.value:{status:`loading`}}function we(e,t){let[n,r]=(0,R.useState)();return(0,R.useEffect)(()=>{if(!e)return;let n=!0,i=`/api/docs/components.js?v=${t}`;return S(()=>import(i).then(e=>{let i=e.components??e.default;n&&r({revision:t,value:{components:i&&typeof i==`object`?i:{}}})},async e=>{let a=await fetch(i).then(e=>e.ok?void 0:e.text()).catch(()=>void 0);n&&r({revision:t,value:{components:{},error:a??(e instanceof Error?e.message:String(e))}})}),[]),()=>{n=!1}},[e,t]),e?n&&n.revision===t?n.value:void 0:{components:{}}}var z=e(u(),1),Te=R.createContext(void 0);function Ee(){let e=R.useContext(Te);if(e===void 0)throw Error(h(10));return e}var De={value:()=>null},Oe=R.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,hiddenUntilFound:a,keepMounted:o,loopFocus:s,onValueChange:l,multiple:u=!1,orientation:d=`vertical`,value:f,defaultValue:p,style:h,..._}=e,v=p??y,x=R.useRef([]),[S,C]=g({controlled:f,default:v,name:`Accordion`,state:`value`}),w=m((e,t,n)=>{let r;r=u?t?[...S,e]:S.filter(t=>t!==e):S[0]===e?[]:[e],l?.(r,n),!n.isCanceled&&C(r)}),T=R.useMemo(()=>({value:S,disabled:i,orientation:d}),[S,i,d]),E=R.useMemo(()=>({disabled:i,handleValueChange:w,hiddenUntilFound:a??!1,keepMounted:o??!1,state:T,value:S}),[i,w,a,o,T,S]),D=c(`div`,e,{state:T,ref:t,props:_,stateAttributesMapping:De});return(0,z.jsx)(Te.Provider,{value:E,children:(0,z.jsx)(b,{elementsRef:x,children:D})})}),ke=R.createContext(void 0);function B(){let e=R.useContext(ke);if(e===void 0)throw Error(h(9));return e}var Ae=`data-index`,V={...F,index:e=>({[Ae]:String(e)}),...f,value:()=>null},je=R.forwardRef(function(e,t){let{className:n,disabled:r=!1,onOpenChange:i,render:a,value:s,style:l,...u}=e,{ref:d,index:f}=o(),{disabled:h,handleValueChange:g,state:_,value:v}=Ee(),y=p(),b=s??y,x=r||h,S=v.includes(b),C=m((e,t)=>{i?.(e,t),!t.isCanceled&&g(b,e,t)}),w=se({open:S,onOpenChange:C,disabled:x}),T=R.useMemo(()=>({...w,onOpenChange:C,state:{open:w.open,disabled:w.disabled,transitionStatus:w.transitionStatus}}),[w,C]),E=R.useMemo(()=>({..._,hidden:!S&&!w.mounted,index:f,disabled:x,open:S}),[w.mounted,x,f,S,_]),D=p(),[O,k]=R.useState(),A=O===null?void 0:O??D,j=R.useMemo(()=>({defaultTriggerId:D,open:S,state:E,setTriggerId:k,triggerId:A}),[D,S,E,k,A]),M=c(`div`,e,{state:E,ref:[t,d],props:u,stateAttributesMapping:V});return(0,z.jsx)(pe.Provider,{value:T,children:(0,z.jsx)(ke.Provider,{value:j,children:M})})}),Me=R.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=B();return c(`h3`,e,{state:o,ref:t,props:a,stateAttributesMapping:V})}),Ne={...V,...ue},Pe=R.forwardRef(function(e,n){let{disabled:i,className:a,id:o,render:s,nativeButton:l=!0,style:u,...d}=e,{panelId:f,open:p,handleTrigger:m,disabled:h}=te(),{getButtonProps:g,buttonRef:_}=r({disabled:i||h,native:l}),{defaultTriggerId:v,state:y,setTriggerId:b}=B(),x=o||void 0,S=x??v;return t(()=>(b(e=>x??(e===null?void 0:e)),()=>{b(e=>e===x?null:e)}),[x,b]),c(`button`,e,{state:y,ref:[n,_],props:[{"aria-controls":p?f:void 0,"aria-expanded":p,id:S,onClick:m},d,g],stateAttributesMapping:Ne})}),Fe=`--accordion-panel-height`,Ie=`--accordion-panel-width`,Le=R.forwardRef(function(e,n){let{className:r,hiddenUntilFound:i,keepMounted:a,id:o,render:s,style:l,...u}=e,{hiddenUntilFound:d,keepMounted:f}=Ee(),{defaultPanelId:p,mounted:m,onOpenChange:h,open:g,setMounted:_,setOpen:v,setPanelIdState:y,transitionStatus:b}=te(),x=i??d,S=a??f,w=o||void 0,T=o??p;t(()=>(y(e=>w??(e===null?void 0:e)),()=>{y(e=>e===w?null:e)}),[w,y]);let{height:E,props:D,ref:O,shouldPreventOpenAnimation:k,shouldRender:A,transitionStatus:j,width:M}=le({externalRef:n,hiddenUntilFound:x,id:T,keepMounted:S,mounted:m,onOpenChange:h,open:g,setMounted:_,setOpen:v,transitionStatus:b}),{state:N,triggerId:ee}=B(),P={...N,transitionStatus:j},F=C(l,P),I=c(`div`,{...e,style:void 0},{state:P,ref:O,props:[D,{"aria-labelledby":ee,role:`region`,style:{[Fe]:E===void 0?`auto`:`${E}px`,[Ie]:M===void 0?`auto`:`${M}px`}},u,F?{style:F}:void 0,k?{style:{animationName:`none`}}:void 0],stateAttributesMapping:V});return A?I:null});function Re({className:e,...t}){return(0,z.jsx)(Oe,{className:t=>N(`divide-y divide-fd-border overflow-hidden rounded-lg border bg-fd-card`,typeof e==`function`?e(t):e),...t})}function ze({children:e,...t}){return(0,z.jsx)(je,{...t,children:e})}function Be({className:e,children:t,...n}){return(0,z.jsx)(Me,{className:t=>N(`scroll-m-24 not-prose flex flex-row items-center text-fd-card-foreground font-medium has-focus-visible:bg-fd-accent`,typeof e==`function`?e(t):e),...n,children:t})}function Ve({className:e,children:t,...n}){return(0,z.jsxs)(Pe,{className:t=>N(`group flex flex-1 items-center gap-2 px-3 py-2.5 text-start focus-visible:outline-none`,typeof e==`function`?e(t):e),...n,children:[(0,z.jsx)(j,{className:`size-4 shrink-0 text-fd-muted-foreground transition-transform duration-200 group-data-panel-open:rotate-90`}),t]})}function He({className:e,children:t,...n}){return(0,z.jsx)(Le,{className:t=>N(`h-(--accordion-panel-height) overflow-hidden transition-[height] ease-out data-ending-style:h-0 data-starting-style:h-0`,typeof e==`function`?e(t):e),...n,children:t})}function Ue({ref:e,className:t,defaultValue:n,...r}){let i=(0,R.useRef)(null),a=ge(e,i),[o,s]=(0,R.useState)(n??[]);return(0,R.useEffect)(()=>{let e=window.location.hash.substring(1),t=i.current;if(!t||e.length===0)return;let n=document.getElementById(e);if(!n||!t.contains(n))return;let r=n.getAttribute(`data-accordion-value`);r&&s(e=>[r,...e])},[]),(0,z.jsx)(Re,{ref:a,value:o,onValueChange:s,className:e=>N(`divide-y divide-fd-border overflow-hidden rounded-lg border bg-fd-card`,typeof t==`function`?t(e):t),...r})}function We({title:e,id:t,value:n=String(e),children:r,...i}){return(0,z.jsxs)(ze,{value:n,...i,children:[(0,z.jsxs)(Be,{id:t,"data-accordion-value":n,children:[(0,z.jsx)(Ve,{children:e}),t?(0,z.jsx)(Ge,{id:t}):null]}),(0,z.jsx)(He,{hiddenUntilFound:!0,children:(0,z.jsx)(`div`,{className:`px-4 pb-2 text-[0.9375rem] prose-no-margin [&[hidden]:not([hidden='until-found'])]:hidden`,children:r})})]})}function Ge({id:e}){let t=k({note:`accordion`}),[n,r]=ee(()=>{let t=new URL(window.location.href);return t.hash=e,navigator.clipboard.writeText(t.toString())});return(0,z.jsxs)(`button`,{type:`button`,"aria-live":`polite`,className:N(L({variant:`ghost`,className:`text-fd-muted-foreground me-2`})),onClick:r,children:[n?(0,z.jsx)(x,{className:`size-3.5`}):(0,z.jsx)(P,{className:`size-3.5`}),(0,z.jsx)(`span`,{className:`sr-only`,children:t(n?`Copied Link`:`Copy Link`,{note:`aria-label`})})]})}function Ke({id:e,variant:t=`normal`,changeLayout:n=!0,height:r=`3rem`,rainbowColors:i=[`rgba(0,149,255,0.56)`,`rgba(231,77,255,0.77)`,`rgba(255,0,0,0.73)`,`rgba(131,255,166,0.66)`],...a}){let o=k({note:`banner`}),[s,c]=(0,R.useState)(!0),l=e?`nd-banner-${Ye(e)}`:null;(0,R.useEffect)(()=>{l&&localStorage.getItem(l)===`true`&&c(!1)},[l]);function u(){c(!1),l&&localStorage.setItem(l,`true`)}return s?(0,z.jsxs)(`div`,{id:e,...a,className:N(`sticky top-0 z-40 flex flex-row items-center justify-center px-4 text-center text-sm font-medium`,t===`normal`&&`bg-fd-secondary`,t===`rainbow`&&`bg-fd-background`,!s&&`hidden`,a.className),style:{height:r},children:[n&&s?(0,z.jsx)(`style`,{children:l?`:root:not(.${l}) { --fd-banner-height: ${r}; }`:`:root { --fd-banner-height: ${r}; }`}):null,l?(0,z.jsx)(`style`,{children:`.${l} #${e} { display: none; }`}):null,l?(0,z.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`if (localStorage.getItem('${l}') === 'true') document.documentElement.classList.add('${l}');`}}):null,t===`rainbow`?Je({colors:i}):null,a.children,e?(0,z.jsx)(`button`,{type:`button`,"aria-label":o(`Close Banner`,{note:`aria-label`}),onClick:u,className:N(L({variant:`ghost`,className:`absolute inset-e-2 top-1/2 -translate-y-1/2 text-fd-muted-foreground/50`,size:`icon-sm`})),children:(0,z.jsx)(_,{})}):null]}):null}var qe=`linear-gradient(to bottom,white,transparent), radial-gradient(circle at top center, white, transparent)`;function Je({colors:e}){return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`absolute inset-0 -z-1`,style:{maskImage:qe,maskComposite:`intersect`,animation:`fd-moving-banner 20s linear infinite`,backgroundImage:`repeating-linear-gradient(70deg, ${[...e,e[0]].map((t,n)=>`${t} ${n*50/e.length}%`).join(`, `)})`,backgroundSize:`200% 100%`,filter:`saturate(2)`}}),(0,z.jsx)(`style`,{children:`@keyframes fd-moving-banner {
2
- from { background-position: 0% 0; }
3
- to { background-position: 100% 0; }
4
- }`})]})}function Ye(e){let t=`abcdefghijklmnopqrstuvwxyz234567`,n=``,r=0,i=0;for(let a=0;a<e.length;a++)for(r=r<<8|e.charCodeAt(a),i+=8;i>=5;)i-=5,n+=t[r>>i&31];return i>0&&(n+=t[r<<5-i&31]),n}var H=ae,U=fe;function Xe({children:e,className:t,...n}){return(0,z.jsx)(me,{...n,className:e=>N(`overflow-hidden [&[hidden]:not([hidden='until-found'])]:hidden h-(--collapsible-panel-height) transition-[height,opacity] data-starting-style:opacity-0 data-starting-style:h-0 data-ending-style:h-0 data-ending-style:opacity-0`,typeof t==`function`?t(e):t),children:e})}var Ze=n(`flex flex-row items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-fd-accent hover:text-fd-accent-foreground [&_svg]:size-4`);function Qe({className:e,...t}){return(0,z.jsx)(`div`,{className:N(`not-prose rounded-md border bg-fd-card p-2`,e),...t,children:t.children})}function $e({name:e,icon:t=(0,z.jsx)(A,{}),className:n,...r}){return(0,z.jsxs)(`div`,{className:N(Ze({className:n})),...r,children:[t,e]})}function et({name:e,defaultOpen:t=!1,...n}){let[r,i]=(0,R.useState)(t);return(0,z.jsxs)(H,{open:r,onOpenChange:i,...n,children:[(0,z.jsxs)(U,{className:N(Ze({className:`w-full`})),children:[r?(0,z.jsx)(ve,{}):(0,z.jsx)(be,{}),e]}),(0,z.jsx)(Xe,{children:(0,z.jsx)(`div`,{className:`ms-2 flex flex-col border-l ps-2`,children:n.children})})]})}var tt=e=>{let t=`-zoom`,n=[`clip-path`,`fill`,`mask`,`marker-start`,`marker-mid`,`marker-end`],r=new Map;if(e.hasAttribute(`id`)){let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i}e.querySelectorAll(`[id]`).forEach(e=>{let{id:n}=e,i=n+t;r.set(n,i);let a=e;a.id=i});let i=n.map(e=>`[${e}]`).join(`, `);e.querySelectorAll(i).forEach(e=>{for(let t of n){let n=e.getAttribute(t);if(n?.startsWith(`url(#`)===!0){let i=n.slice(5,-1),a=r.get(i);a!==void 0&&e.setAttribute(t,`url(#${a})`)}}}),e.querySelectorAll(`style`).forEach(e=>{let{textContent:t}=e;if(t!==``){let n=t;if(r.forEach((e,t)=>{n=n.replaceAll(`#${t}`,`#${e}`)}),n!==t){let t=e;t.textContent=n}}})};function nt(e){return typeof Element>`u`?!1:e instanceof Element}var W=(e,t)=>nt(t)&&t.tagName.toUpperCase()===e,rt=e=>W(`DIV`,e)||W(`SPAN`,e),G=e=>W(`IMG`,e),it=e=>e.complete&&e.naturalHeight!==0,K=e=>W(`SVG`,e),at=e=>{if(e!==null)return G(e)?e.alt:e.getAttribute(`aria-label`)??void 0},ot=/url(?:\(['"]?)(?<url>.*?)(?:['"]?\))/,st=e=>{if(e!==null){if(G(e))return e.currentSrc===``?void 0:e.currentSrc;if(rt(e)){let{backgroundImage:t}=window.getComputedStyle(e);if(t!==``)return ot.exec(t)?.[1]}}},ct=e=>{if(e==null)return{};if(K(e)){let{parentElement:t}=e,n=e.getBoundingClientRect();if(t==null)return{height:n.height,left:n.left,width:n.width,top:n.top};{let e=t.getBoundingClientRect();return{height:n.height,left:e.left-n.left,top:e.top-n.top,width:n.width}}}return{height:e.offsetHeight,left:e.offsetLeft,width:e.offsetWidth,top:e.offsetTop}},lt=({height:e,offset:t,width:n})=>Math.min((window.innerWidth-t*2)/n,(window.innerHeight-t*2)/e),ut=({containerHeight:e,containerWidth:t,offset:n,targetHeight:r,targetWidth:i})=>{let a=lt({height:r,offset:n,width:i}),o=i>r?i/t:r/e;return a>1?o:a*o},dt=({containerHeight:e,containerWidth:t,hasScalableSrc:n,offset:r,targetHeight:i,targetWidth:a})=>e===0||t===0?1:!n&&i!==0&&a!==0?ut({containerHeight:e,containerWidth:t,offset:r,targetHeight:i,targetWidth:a}):lt({height:e,offset:r,width:t}),ft=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s})=>{let c=dt({containerHeight:e,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s});return{top:n,left:t,width:r*c,height:e*c,initialTransform:`translate(0,0) scale(${1/c})`}},q=(e,t)=>{let n=parseFloat(e);return e.endsWith(`%`)?t*n/100:n},J=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,offset:a,position:o,targetHeight:s,targetWidth:c,visibleHeight:l,visibleWidth:u})=>{let[d=`50%`,f=`50%`]=o.split(` `),p=q(d,r-u),m=q(f,e-l),h=dt({containerHeight:l,containerWidth:u,hasScalableSrc:i,offset:a,targetHeight:s,targetWidth:c});return{top:n+m,left:t+p,width:u*h,height:l*h,initialTransform:`translate(0,0) scale(${1/h})`}},pt=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,objectFit:a,objectPosition:o,offset:s,targetHeight:c,targetWidth:l})=>{let u=a;u===`scale-down`&&(u=l<=r&&c<=e?`none`:`contain`);let d={containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,offset:s,position:o,targetHeight:c,targetWidth:l};if(u===`cover`||u===`contain`){let t=r/l,n=e/c,i=u===`cover`?Math.max(t,n):Math.min(t,n);return J({...d,visibleWidth:l*i,visibleHeight:c*i})}if(u===`none`)return J({...d,visibleWidth:l,visibleHeight:c});{let a=r/l,o=e/c,u=Math.max(a,o),d=dt({containerHeight:c*u,containerWidth:l*u,hasScalableSrc:i,offset:s,targetHeight:c,targetWidth:l});return{top:n,left:t,width:r*d,height:e*d,initialTransform:`translate(0,0) scale(${1/d})`}}},mt=({backgroundPosition:e,backgroundSize:t,containerHeight:n,containerLeft:r,containerTop:i,containerWidth:a,hasScalableSrc:o,offset:s,targetHeight:c,targetWidth:l})=>{let u={containerHeight:n,containerLeft:r,containerTop:i,containerWidth:a,hasScalableSrc:o,offset:s,position:e,targetHeight:c,targetWidth:l};if(t===`cover`||t===`contain`){let e=a/l,r=n/c,i=t===`cover`?Math.max(e,r):Math.min(e,r);return J({...u,visibleWidth:l*i,visibleHeight:c*i})}if(t===`auto`)return J({...u,visibleWidth:l,visibleHeight:c});{let[e=`50%`,r=`50%`]=t.split(` `),i=q(e,a),o=q(r,n),s=i/l,d=o/c,f=Math.min(s,d);return J({...u,visibleWidth:l*f,visibleHeight:c*f})}},ht=({height:e,initialTransform:t,isZoomed:n,left:r,top:i,userTransform:a,width:o})=>{let s=``;if(a!==`none`&&a!==``){let t=o/2,n=e/2;s=`translate(${t}px,${n}px) ${a} translate(${-t}px,${-n}px)`}if(!n)return s===``?t:`${t} ${s}`;let c=window.innerWidth/2,l=window.innerHeight/2,u=r+o/2,d=i+e/2,f=`translate(${c-u}px,${l-d}px) scale(1)`;return s===``?f:`${f} ${s}`},gt=({fallback:e,natural:t})=>t!==void 0&&t!==0?t:e,_t=/\.svg$/i,vt=({hasZoomImg:e,imgSrc:t,isSvg:n})=>n||t?.slice(0,18)===`data:image/svg+xml`||e||t!==void 0&&_t.test(t),yt=({hasZoomImg:e,imgSrc:t,isSvg:n,isZoomed:r,loadedImgEl:i,offset:a,shouldRefresh:o,targetEl:s})=>{let c=vt({hasZoomImg:e,imgSrc:t,isSvg:n}),l=s.getBoundingClientRect(),u=window.getComputedStyle(s),d=i!=null&&rt(s),f=i!=null&&!d,p=gt({fallback:l.height,natural:i?.naturalHeight}),m=gt({fallback:l.width,natural:i?.naturalWidth}),{height:h,left:g,top:_,width:v}=l,y=d?mt({backgroundPosition:u.backgroundPosition,backgroundSize:u.backgroundSize,containerHeight:h,containerLeft:g,containerTop:_,containerWidth:v,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}):f?pt({containerHeight:h,containerLeft:g,containerTop:_,containerWidth:v,hasScalableSrc:c,objectFit:u.objectFit,objectPosition:u.objectPosition,offset:a,targetHeight:p,targetWidth:m}):ft({containerHeight:h,containerLeft:g,containerTop:_,containerWidth:v,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}),b={top:y.top,left:y.left,width:y.width,height:y.height,transform:ht({...y,isZoomed:r,userTransform:u.transform})};return r&&o&&(b.transitionDuration=`0.01ms`),b},bt=e(d()),xt=[`img`,`svg`,`[role="img"]`,`[data-zoom]`].map(e=>`${e}:not([aria-hidden="true"])`).join(`,`),St={overflow:``,width:``};function Ct(){let e=document.querySelector(`[data-rmiz-portal]`);if(e!=null)return e;let t=document.createElement(`div`);return t.setAttribute(`data-rmiz-portal`,``),document.body.appendChild(t),t}function wt(e){e.preventDefault()}function Tt(e){return R.createElement(Et,{...e})}var Et=class extends R.Component{constructor(){super(...arguments),this.state={id:``,isZoomImgLoaded:!1,loadedImgEl:void 0,modalState:`UNLOADED`,shouldRefresh:!1,styleGhost:{}},this.refContent=R.createRef(),this.refDialog=R.createRef(),this.refModalContent=R.createRef(),this.refModalImg=R.createRef(),this.refWrap=R.createRef(),this.imgEl=null,this.isScaling=!1,this.prevBodyAttrs=St,this.styleModalImg={},this.handleModalStateChange=e=>{let{state:{modalState:t}}=this;e!==`LOADING`&&t===`LOADING`?(this.isScaling=!1,this.loadZoomImg(),window.addEventListener(`resize`,this.handleResize,{passive:!0}),window.addEventListener(`touchstart`,this.handleTouchStart,{passive:!0}),window.addEventListener(`touchmove`,this.handleTouchMove,{passive:!0}),window.addEventListener(`touchend`,this.handleTouchEnd,{passive:!0}),window.addEventListener(`touchcancel`,this.handleTouchCancel,{passive:!0}),document.addEventListener(`keydown`,this.handleKeyDown,!0)):e!==`LOADED`&&t===`LOADED`?window.addEventListener(`wheel`,this.handleWheel,{passive:!0}):e!==`UNLOADING`&&t===`UNLOADING`?(this.ensureImgTransitionEnd(),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),document.removeEventListener(`keydown`,this.handleKeyDown,!0)):e!==`UNLOADED`&&t===`UNLOADED`&&(this.bodyScrollEnable(),window.removeEventListener(`resize`,this.handleResize),this.refDialog.current?.close())},this.setId=()=>{let e=()=>Math.random().toString(16).slice(-4);this.setState({id:e()+e()+e()})},this.setAndTrackImg=()=>{let{refContent:{current:e}}=this;e!=null&&(this.imgEl=e.querySelector(xt),this.imgEl===null?this.contentNotFoundChangeObserver??(this.contentNotFoundChangeObserver=new MutationObserver(this.setAndTrackImg),this.contentNotFoundChangeObserver.observe(e,{childList:!0,subtree:!0})):(this.contentNotFoundChangeObserver?.disconnect(),this.imgEl.addEventListener(`load`,this.handleImgLoad),this.imgEl.addEventListener(`click`,this.handleZoom),this.state.loadedImgEl??this.handleImgLoad(),this.imgElResizeObserver=new ResizeObserver(e=>{let[t]=e;t?.target!==void 0&&(this.imgEl=t.target,this.setState({styleGhost:ct(this.imgEl)}))}),this.imgElResizeObserver.observe(this.imgEl),this.contentChangeObserver??(this.contentChangeObserver=new MutationObserver(()=>{this.setState({styleGhost:ct(this.imgEl)})}),this.contentChangeObserver.observe(e,{attributes:!0,childList:!0,subtree:!0}))))},this.handleIfZoomChanged=e=>{let{props:{isZoomed:t}}=this;!e&&t?this.zoom():e&&!t&&this.unzoom()},this.handleImgLoad=()=>{let e=st(this.imgEl);if(e==null||e===``)return;let t=new Image,{imgEl:n}=this;if(G(n)){let{sizes:e,srcset:r,crossOrigin:i}=n;t.sizes=e,t.srcset=r,t.crossOrigin=i}t.src=e;let r=()=>{this.setState({loadedImgEl:t,styleGhost:ct(this.imgEl)})};t.decode().then(r).catch(()=>{it(t)?r():t.onload=r})},this.handleZoom=e=>{this.props.isDisabled!==!0&&this.hasImage()&&this.props.onZoomChange?.(!0,{event:e})},this.handleUnzoom=e=>{this.props.isDisabled!==!0&&this.props.onZoomChange?.(!1,{event:e})},this.handleBtnUnzoomClick=e=>{e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e)},this.handleDialogClick=e=>{(e.target===this.refModalContent.current||e.target===this.refModalImg.current)&&(e.stopPropagation(),this.handleUnzoom(e))},this.handleDialogClose=e=>{e.stopPropagation(),this.handleUnzoom(e)},this.handleKeyDown=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e))},this.handleWheel=e=>{e.ctrlKey||this.isScaling||(window.visualViewport?.scale??1)>1||(e.stopPropagation(),queueMicrotask(()=>{this.handleUnzoom(e)}))},this.handleTouchStart=e=>{if(e.touches.length>1){this.isScaling=!0;return}let{changedTouches:t}=e,[n]=t;if(t.length===1&&n!==void 0){let{screenY:e}=n;this.touchYStart=e}},this.handleTouchMove=e=>{let t=window.visualViewport?.scale??1,{changedTouches:n}=e,[r]=n;if(this.props.canSwipeToUnzoom&&!this.isScaling&&t<=1&&this.touchYStart!=null&&r!==void 0){let{screenY:t}=r;this.touchYEnd=t;let n=Math.max(this.touchYStart,this.touchYEnd),i=Math.min(this.touchYStart,this.touchYEnd);Math.abs(n-i)>this.props.swipeToUnzoomThreshold&&(this.touchYStart=void 0,this.touchYEnd=void 0,this.handleUnzoom(e))}},this.handleTouchEnd=()=>{this.touchYStart=void 0,this.touchYEnd=void 0},this.handleTouchCancel=()=>{this.touchYStart=void 0,this.touchYEnd=void 0},this.handleResize=()=>{this.setState({shouldRefresh:!0})},this.hasImage=()=>this.imgEl!==null&&(this.state.loadedImgEl!==void 0||K(this.imgEl))&&window.getComputedStyle(this.imgEl).display!==`none`,this.zoom=()=>{this.bodyScrollDisable(),this.refDialog.current?.showModal(),this.setState({modalState:`LOADING`})},this.unzoom=()=>{this.setState({modalState:`UNLOADING`})},this.handleImgTransitionEnd=()=>{clearTimeout(this.timeoutTransitionEnd),this.state.modalState===`LOADING`?this.setState({modalState:`LOADED`}):this.state.modalState===`UNLOADING`&&this.setState({shouldRefresh:!1,modalState:`UNLOADED`})},this.ensureImgTransitionEnd=()=>{if(this.refModalImg.current!==null){let{transitionDuration:e}=window.getComputedStyle(this.refModalImg.current),t=parseFloat(e);if(t!==0&&!Number.isNaN(t)){let n=t*(e.endsWith(`ms`)?1:1e3)+50;this.timeoutTransitionEnd=setTimeout(this.handleImgTransitionEnd,n)}}},this.bodyScrollDisable=()=>{let e=document.body.style;this.prevBodyAttrs={overflow:e.overflow,width:e.width};let t=document.body.clientWidth;e.overflow=`hidden`,e.width=`${t}px`},this.bodyScrollEnable=()=>{let e=document.body.style,t=this.prevBodyAttrs;e.width=t.width,e.overflow=t.overflow,this.prevBodyAttrs=St},this.loadZoomImg=()=>{let{props:{zoomImg:e}}=this;if(e==null)return;let{src:t}=e;if(t!==void 0&&t!==``){let n=new Image;n.sizes=e.sizes??``,n.srcset=e.srcSet??``,n.crossOrigin=e.crossOrigin??void 0,n.src=t;let r=()=>{this.setState({isZoomImgLoaded:!0})};n.decode().then(r).catch(()=>{it(n)?r():n.onload=r})}},this.UNSAFE_handleSvg=()=>{let{imgEl:e,refModalImg:t,styleModalImg:n}=this;if(K(e)){let r=e.cloneNode(!0);tt(r),r.style.width=`${n.width??0}px`,r.style.height=`${n.height??0}px`,r.addEventListener(`click`,this.handleUnzoom),t.current?.firstChild?.remove(),t.current?.appendChild(r)}}}render(){let{handleBtnUnzoomClick:e,handleDialogClick:t,handleDialogClose:n,handleUnzoom:r,handleZoom:i,imgEl:a,props:{a11yNameButtonUnzoom:o,a11yNameButtonZoom:s,children:c,classDialog:l,IconUnzoom:u,IconZoom:d,wrapElement:f,ZoomContent:p,zoomImg:m,zoomMargin:h},refContent:g,refDialog:_,refModalContent:v,refModalImg:y,refWrap:b,state:{id:x,isZoomImgLoaded:S,loadedImgEl:C,modalState:w,shouldRefresh:T,styleGhost:E}}=this,D=`rmiz-modal-${x}`,O=`rmiz-modal-img-${x}`,k=rt(a),A=G(a),j=K(a),M=at(a),N=st(a),ee=A?a.sizes:void 0,P=A?a.srcset:void 0,F=A?a.crossOrigin:void 0,te=m?.src!==void 0&&m.src!==``,I=this.hasImage(),ne=M!==void 0&&M!==``?`${s}: ${M}`:s,re=w===`LOADING`||w===`LOADED`,ie=I?`found`:`not-found`,ae=w===`UNLOADED`||w===`UNLOADING`?`hidden`:`visible`,oe={visibility:w===`UNLOADED`?`visible`:`hidden`};this.styleModalImg=I&&a!==null?yt({hasZoomImg:te,imgSrc:N,isSvg:j,isZoomed:re,loadedImgEl:C,offset:h,shouldRefresh:T,targetEl:a}):{};let L=null;if(I){let t=A||k?R.createElement(`img`,{alt:M,crossOrigin:F,sizes:ee,src:N,srcSet:P,...S&&w===`LOADED`?m:{},"data-rmiz-modal-img":``,height:this.styleModalImg.height??void 0,id:O,onTransitionEnd:this.handleImgTransitionEnd,ref:y,style:this.styleModalImg,width:this.styleModalImg.width??void 0}):j?R.createElement(`div`,{"data-rmiz-modal-img":!0,onTransitionEnd:this.handleImgTransitionEnd,ref:y,style:this.styleModalImg}):null,n=R.createElement(`button`,{"aria-label":o,"data-rmiz-btn-unzoom":``,onClick:e,type:`button`},R.createElement(u,null));L=p==null?R.createElement(R.Fragment,null,t,n):R.createElement(p,{buttonUnzoom:n,modalState:w,img:t,isZoomImgLoaded:S,onUnzoom:r})}return R.createElement(f,{"data-rmiz":``,ref:b},R.createElement(f,{"data-rmiz-content":ie,ref:g,style:oe},c),I&&R.createElement(f,{"data-rmiz-ghost":``,style:E},R.createElement(`button`,{"aria-label":ne,"data-rmiz-btn-zoom":``,onClick:i,type:`button`},R.createElement(d,null))),I&&bt.createPortal(R.createElement(`dialog`,{"aria-labelledby":O,"aria-modal":`true`,className:l,"data-rmiz-modal":``,id:D,onClick:t,onClose:n,onCancel:wt,ref:_,role:`dialog`},R.createElement(`div`,{"data-rmiz-modal-overlay":ae}),R.createElement(`div`,{"data-rmiz-modal-content":``,ref:v},L)),Ct()))}componentDidMount(){this.setId(),this.setAndTrackImg(),this.handleImgLoad(),this.UNSAFE_handleSvg()}componentWillUnmount(){this.state.modalState!==`UNLOADED`&&this.bodyScrollEnable(),this.contentChangeObserver?.disconnect(),this.contentNotFoundChangeObserver?.disconnect(),this.imgElResizeObserver?.disconnect(),this.imgEl?.removeEventListener(`load`,this.handleImgLoad),this.imgEl?.removeEventListener(`click`,this.handleZoom),clearTimeout(this.timeoutTransitionEnd),window.removeEventListener(`wheel`,this.handleWheel),window.removeEventListener(`touchstart`,this.handleTouchStart),window.removeEventListener(`touchmove`,this.handleTouchMove),window.removeEventListener(`touchend`,this.handleTouchEnd),window.removeEventListener(`touchcancel`,this.handleTouchCancel),window.removeEventListener(`resize`,this.handleResize),document.removeEventListener(`keydown`,this.handleKeyDown,!0)}componentDidUpdate(e,t){this.handleModalStateChange(t.modalState),this.UNSAFE_handleSvg(),this.handleIfZoomChanged(e.isZoomed)}};Et.defaultProps={a11yNameButtonUnzoom:`Minimize image`,a11yNameButtonZoom:`Expand image`,canSwipeToUnzoom:!0,IconUnzoom:Dt,IconZoom:Ot,isDisabled:!1,swipeToUnzoomThreshold:10,wrapElement:`div`,zoomMargin:0};function Dt(){return R.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-unzoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},R.createElement(`path`,{d:`M 14.144531 1.148438 L 9 6.292969 L 9 3 L 8 3 L 8 8 L 13 8 L 13 7 L 9.707031 7 L 14.855469 1.851563 Z M 8 8 L 3 8 L 3 9 L 6.292969 9 L 1.148438 14.144531 L 1.851563 14.855469 L 7 9.707031 L 7 13 L 8 13 Z`}))}function Ot(){return R.createElement(`svg`,{"aria-hidden":`true`,"data-rmiz-btn-zoom-icon":!0,fill:`currentColor`,focusable:`false`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`},R.createElement(`path`,{d:`M 9 1 L 9 2 L 12.292969 2 L 2 12.292969 L 2 9 L 1 9 L 1 14 L 6 14 L 6 13 L 2.707031 13 L 13 2.707031 L 13 6 L 14 6 L 14 1 Z`}))}function kt({onZoomChange:e,...t}){let[n,r]=R.useState(!1),i=R.useCallback((t,{event:n})=>{r(t),e?.(t,{event:n})},[e]);return R.createElement(Tt,{...t,isZoomed:n,onZoomChange:i})}function At(e){return typeof e==`string`?e:typeof e==`object`?`default`in e?e.default.src:e.src:``}function jt({zoomInProps:e,children:t,rmiz:n,...r}){return(0,z.jsx)(kt,{zoomMargin:20,wrapElement:`span`,...n,zoomImg:{src:At(r.src),sizes:void 0,...e},children:t??(0,z.jsx)(oe,{sizes:`(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px`,...r})})}function Mt({items:e,className:t,...n}){let r=k({note:`inline table of contents`});return(0,z.jsxs)(H,{...n,className:e=>N(`not-prose rounded-lg border bg-fd-card text-fd-card-foreground`,typeof t==`function`?t(e):t),children:[(0,z.jsxs)(U,{className:`group inline-flex w-full items-center justify-between px-4 py-2.5 font-medium`,children:[n.children??r(`Table of Contents`),(0,z.jsx)(l,{className:`size-4 transition-transform duration-200 group-data-open:rotate-180`})]}),(0,z.jsx)(Xe,{children:(0,z.jsx)(`div`,{className:`flex flex-col p-4 pt-0 text-sm text-fd-muted-foreground`,children:e.map(e=>(0,z.jsx)(`a`,{href:e.url,className:`border-s py-1.5 hover:text-fd-accent-foreground`,style:{paddingInlineStart:12*Math.max(e.depth-1,0)},children:e.title},e.url))})})]})}function Nt({children:e}){return(0,z.jsx)(`div`,{className:`fd-steps`,children:e})}function Pt({children:e}){return(0,z.jsx)(`div`,{className:`fd-step`,children:e})}var Ft=(0,R.createContext)(null);function It(){let e=(0,R.useContext)(Ft);if(!e)throw Error(`You must wrap your component in <Tabs>`);return e}function Lt({className:e,...t}){return(0,z.jsx)(ie,{...t,className:t=>N(`flex gap-3.5 text-fd-secondary-foreground overflow-x-auto px-4 not-prose`,typeof e==`function`?e(t):e)})}function Rt({className:e,...t}){return(0,z.jsx)(re,{...t,className:t=>N(`inline-flex items-center gap-2 whitespace-nowrap text-fd-muted-foreground border-b border-transparent py-2 text-sm font-medium transition-colors [&_svg]:size-4 hover:text-fd-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[active]:border-fd-primary data-[active]:text-fd-primary`,typeof e==`function`?e(t):e)})}function zt({ref:e,className:t,items:n,label:r,defaultIndex:i=0,defaultValue:a=n?Y(n[i]):void 0,...o}){let s=(0,R.useMemo)(()=>[],[]);return(0,z.jsxs)(de,{ref:e,className:e=>N(`flex flex-col overflow-hidden rounded-xl border bg-fd-secondary my-4`,typeof t==`function`?t(e):t),defaultValue:a,...o,children:[n&&(0,z.jsxs)(Lt,{children:[r&&(0,z.jsx)(`span`,{className:`text-sm font-medium my-auto me-auto`,children:r}),n.map(e=>(0,z.jsx)(Rt,{value:Y(e),children:e},e))]}),(0,z.jsx)(Ft.Provider,{value:(0,R.useMemo)(()=>({items:n,collection:s}),[s,n]),children:o.children})]})}function Bt({value:e,...t}){let{items:n}=It(),r=e??n?.at(Ht());if(!r)throw Error("Failed to resolve tab `value`, please pass a `value` prop to the Tab component.");return(0,z.jsx)(Vt,{value:Y(r),...t,children:t.children})}function Vt({value:e,className:t,...n}){return(0,z.jsx)(ce,{value:e,className:e=>N(`p-4 text-[0.9375rem] bg-fd-background rounded-xl outline-none prose-no-margin data-[inactive]:hidden [&>figure:only-child]:-m-4 [&>figure:only-child]:border-none`,typeof t==`function`?t(e):t),...n,children:n.children})}function Ht(){let e=(0,R.useId)(),{collection:t}=It();return(0,R.useEffect)(()=>()=>{let n=t.indexOf(e);n!==-1&&t.splice(n,1)},[e,t]),t.includes(e)||t.push(e),t.indexOf(e)}function Y(e){return e.toLowerCase().replace(/\s/,`-`)}var X=n(`text-fd-muted-foreground not-prose pe-2`);function Ut({id:e,type:t,className:n,...r}){let i=k({note:`type table`});return(0,z.jsxs)(`div`,{id:e,className:N(`@container flex flex-col p-1 bg-fd-card text-fd-card-foreground rounded-2xl border my-6 text-sm overflow-hidden`,n),...r,children:[(0,z.jsxs)(`div`,{className:`flex font-medium items-center px-3 py-1 not-prose text-fd-muted-foreground`,children:[(0,z.jsx)(`p`,{className:`w-1/4`,children:i(`Prop`)}),(0,z.jsx)(`p`,{className:`@max-xl:hidden`,children:i(`Type`)})]}),Object.entries(t).map(([t,n])=>(0,z.jsx)(Wt,{parentId:e,name:t,item:n},t))]})}function Wt({parentId:e,name:t,item:{parameters:n=[],description:r,required:i=!1,deprecated:a,typeDescription:o,default:s,type:c,typeDescriptionLink:u,returns:d}}){let f=k({note:`type table`}),[p,m]=(0,R.useState)(!1),h=e?`${e}-${t}`:void 0;return(0,R.useEffect)(()=>{let e=window.location.hash;h&&e&&`#${h}`===e&&m(!0)},[h]),(0,z.jsxs)(H,{id:h,open:p,onOpenChange:e=>{e&&h&&window.history.replaceState(null,``,`#${h}`),m(e)},className:N(`rounded-xl border overflow-hidden scroll-m-20 transition-all`,p?`shadow-sm bg-fd-background not-last:mb-2`:`border-transparent`),children:[(0,z.jsxs)(U,{className:`relative flex flex-row items-center w-full group text-start px-3 py-2 not-prose hover:bg-fd-accent`,children:[(0,z.jsxs)(`code`,{className:N(`text-fd-primary min-w-fit w-1/4 font-mono font-medium pe-2`,a&&`line-through text-fd-primary/50`),children:[t,!i&&`?`]}),u?(0,z.jsx)(O,{href:u,className:`underline @max-xl:hidden`,children:c}):(0,z.jsx)(`span`,{className:`@max-xl:hidden`,children:c}),(0,z.jsx)(l,{className:`absolute inset-e-2 size-4 text-fd-muted-foreground transition-transform group-data-[open]:rotate-180`})]}),(0,z.jsx)(Xe,{children:(0,z.jsxs)(`div`,{className:`grid grid-cols-[1fr_3fr] gap-y-4 text-sm p-3 overflow-auto fd-scroll-container border-t`,children:[(0,z.jsx)(`div`,{className:`text-sm prose col-span-full prose-no-margin empty:hidden`,children:r}),o&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:N(X()),children:f(`Type`)}),(0,z.jsx)(`p`,{className:`my-auto not-prose`,children:o})]}),s&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:N(X()),children:f(`Default`)}),(0,z.jsx)(`p`,{className:`my-auto not-prose`,children:s})]}),n.length>0&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:N(X()),children:f(`Parameters`)}),(0,z.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.map(e=>(0,z.jsxs)(`div`,{className:`inline-flex items-center flex-wrap gap-1`,children:[(0,z.jsxs)(`p`,{className:`font-medium not-prose text-nowrap`,children:[e.name,` -`]}),(0,z.jsx)(`div`,{className:`text-sm prose prose-no-margin`,children:e.description})]},e.name))})]}),d&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{className:N(X()),children:f(`Returns`)}),(0,z.jsx)(`div`,{className:`my-auto text-sm prose prose-no-margin`,children:d})]})]})})]})}var Gt=(0,R.createContext)([]);function Kt(e){let t=(0,R.useContext)(Gt);return(0,z.jsx)(Mt,{items:t,...e})}function qt({code:e,title:t}){return(0,z.jsx)(I,{title:t,children:(0,z.jsx)(ne,{children:(0,z.jsx)(`code`,{children:e})})})}function Jt(e){return()=>(0,z.jsx)(M,{type:`warn`,title:`<${e}> is not available here`,children:`It needs a build step or the network, so it shows on your docs site but not in the dashboard.`})}function Yt(e={}){return{...he,img:e=>(0,z.jsx)(jt,{...e}),Callout:M,Tabs:zt,Tab:Bt,Steps:Nt,Step:Pt,Accordions:Ue,Accordion:We,Files:Qe,File:$e,Folder:et,TypeTable:Ut,Banner:Ke,InlineTOC:Kt,DynamicCodeBlock:qt,AutoTypeTable:Jt(`AutoTypeTable`),GithubInfo:Jt(`GithubInfo`),GraphView:Jt(`GraphView`),...e}}function Xt(e){return Function(e)({Fragment:R.Fragment,jsx:z.jsx,jsxs:z.jsxs}).default}var Zt=class extends R.Component{state={};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`Docs page failed to render`,e,t.componentStack)}componentDidUpdate(e){e.reset.some((e,t)=>e!==this.props.reset[t])&&this.state.error&&this.setState({error:void 0})}render(){let{error:e}=this.state;if(!e)return this.props.children;let t=/Expected component `([^`]+)` to be defined/.exec(e.message);return(0,z.jsx)(M,{type:`error`,title:t?`<${t[1]}> is not defined`:`This page failed to render`,children:t?`Export ${t[1]} from the file named in documentation.components, or import it in the page.`:e.message})}};function Qt(e){document.getElementById(e)?.scrollIntoView({block:`start`})}function $t(e){let t=e.target.closest(`a`)?.getAttribute(`href`);if(!t||!t.startsWith(`#`)||t.startsWith(`#/`))return;e.preventDefault();let n=t.slice(1);try{n=decodeURIComponent(n)}catch{}Qt(n)}function en(e,t){let[n,r]=(0,R.useState)();return(0,R.useEffect)(()=>{let t=e.map(e=>e.url.slice(1)),n=()=>{let e=t[0];for(let n of t){let t=document.getElementById(n);t&&t.getBoundingClientRect().top<=120&&(e=n)}r(e)};return n(),window.addEventListener(`scroll`,n,{passive:!0}),()=>window.removeEventListener(`scroll`,n)},[e,t]),n}function tn({headings:e,page:t}){let n=en(e,t);return e.length===0?null:(0,z.jsxs)(`nav`,{"aria-label":`On this page`,className:`flex flex-col gap-0.5 text-sm`,children:[(0,z.jsx)(`div`,{className:`mb-1.5 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:`On this page`}),e.map(e=>(0,z.jsx)(`a`,{href:e.url,onClick:$t,"aria-current":e.url.slice(1)===n?`location`:void 0,style:{paddingLeft:`${Math.max(e.depth-2,0)*12+8}px`},className:i(`rounded-md py-1 pr-2 text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-[current=location]:font-medium aria-[current=location]:text-foreground`),children:e.title},e.url))]})}function nn({page:e,project:t}){let n=(0,R.useMemo)(()=>Yt(t?.components),[t]),r=(0,R.useMemo)(()=>{try{return{Page:Xt(e.code)}}catch(e){return{error:e instanceof Error?e.message:String(e)}}},[e.code]);if(`error`in r)return(0,z.jsx)(M,{type:`error`,title:`This page could not run`,children:r.error});let{Page:i}=r;return(0,z.jsx)(Gt.Provider,{value:e.toc,children:(0,z.jsx)(Zt,{reset:[e.code,n],children:(0,z.jsx)(i,{components:n})})})}function rn({page:e,project:t}){return(0,z.jsxs)(`article`,{onClick:$t,className:`min-w-0`,children:[(0,z.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,children:e.title}),e.description&&(0,z.jsx)(`p`,{className:`mt-2 mb-8 text-base text-muted-foreground`,children:e.description}),t?.error&&(0,z.jsx)(M,{type:`warn`,title:`Your components did not load`,children:t.error}),e.error?(0,z.jsx)(M,{type:`error`,title:`${e.path} does not compile`,children:(0,z.jsx)(`pre`,{className:`font-mono text-xs whitespace-pre-wrap`,children:e.error})}):(0,z.jsx)(`div`,{className:`prose max-w-none`,children:(0,z.jsx)(nn,{page:e,project:t})})]})}function an({path:e,revision:t,project:n,onPage:r,onMissing:i}){let a=Ce(e,t),o=a.status===`ready`?a.page:void 0;return(0,R.useEffect)(()=>r(o),[o,r]),(0,R.useEffect)(()=>{a.status===`missing`&&i()},[a.status,i]),a.status===`loading`||a.status===`ready`&&!n?(0,z.jsx)(D,{title:`Loading page`}):a.status===`missing`?(0,z.jsx)(D,{title:`No such page`,hint:`There is no page at /${e.join(`/`)}`}):a.status===`failed`?(0,z.jsx)(M,{type:`error`,title:`The page could not be loaded`,children:a.message}):(0,z.jsx)(rn,{page:a.page,project:n})}function Z(e){return e.split(`/`).filter(Boolean)}var Q=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),on=(e,t)=>e.type===`page`?Q(Z(e.url),t):e.type===`folder`?(e.index?Q(Z(e.index.url),t):!1)||e.children.some(e=>on(e,t)):!1,$=`flex min-h-7 items-center rounded-md px-2 py-1 text-sm text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 aria-[current=page]:bg-muted aria-[current=page]:font-medium aria-[current=page]:text-foreground`;function sn({node:e,current:t,depth:n}){let r=on(e,t),[a,o]=(0,R.useState)(),s=a??(r||e.defaultOpen===!0);return(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`div`,{className:`flex items-center`,children:[e.index?(0,z.jsx)(`a`,{href:E(Z(e.index.url)),"aria-current":Q(Z(e.index.url),t)?`page`:void 0,className:i($,`flex-1 font-medium text-foreground`),children:e.name}):(0,z.jsx)(`button`,{type:`button`,onClick:()=>o(!s),className:i($,`flex-1 cursor-pointer text-left font-medium text-foreground`),children:e.name}),(0,z.jsx)(`button`,{type:`button`,"aria-label":`${s?`Collapse`:`Expand`} ${e.name}`,"aria-expanded":s,onClick:()=>o(!s),className:`grid size-7 shrink-0 cursor-pointer place-items-center rounded-md text-muted-foreground outline-none hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,z.jsx)(j,{className:i(`size-3.5 transition-transform`,s&&`rotate-90`)})})]}),s&&(0,z.jsx)(`div`,{className:`ml-2 border-l pl-1.5`,children:(0,z.jsx)(cn,{nodes:e.children,current:t,depth:n+1})})]})}function cn({nodes:e,current:t,depth:n}){return(0,z.jsx)(z.Fragment,{children:e.map((e,r)=>e.type===`separator`?(0,z.jsx)(`div`,{className:`mt-4 mb-1 px-2 text-xs font-medium tracking-wide text-muted-foreground uppercase first:mt-0`,children:e.name},`separator-${r}`):e.type===`folder`?(0,z.jsx)(sn,{node:e,current:t,depth:n},`folder-${e.name}-${r}`):(0,z.jsx)(`a`,{href:E(Z(e.url)),"aria-current":Q(Z(e.url),t)?`page`:void 0,className:$,children:e.name},e.url))})}function ln({nodes:e,current:t}){return(0,z.jsx)(`nav`,{"aria-label":`Docs pages`,className:`flex flex-col gap-0.5`,children:(0,z.jsx)(cn,{nodes:e,current:t,depth:0})})}function un(e){for(let t of e){if(t.type===`page`)return Z(t.url);if(t.type===`folder`){if(t.index)return Z(t.index.url);let e=un(t.children);if(e)return e}}}function dn({revision:e}){let[t,n]=(0,R.useState)(``),[r,i]=(0,R.useState)([]);return(0,R.useEffect)(()=>{if(!t.trim()){i([]);return}let e=new AbortController,n=setTimeout(()=>{fetch(`/api/docs/search?q=${encodeURIComponent(t)}`,{signal:e.signal}).then(e=>e.ok?e.json():[]).then(e=>i(e.slice(0,12)),()=>{})},150);return()=>{clearTimeout(n),e.abort()}},[t,e]),(0,z.jsxs)(`div`,{className:`relative`,children:[(0,z.jsx)(s,{className:`pointer-events-none absolute top-2.5 left-2.5 size-3.5 text-muted-foreground`}),(0,z.jsx)(w,{type:`search`,value:t,placeholder:`Search docs`,"aria-label":`Search docs`,className:`pl-8`,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Escape`&&n(``)}}),t.trim()&&(0,z.jsx)(`div`,{role:`listbox`,"aria-label":`Search results`,className:`absolute inset-x-0 top-full z-20 mt-1 max-h-96 overflow-y-auto rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:r.length===0?(0,z.jsx)(`div`,{className:`px-2 py-3 text-center text-xs text-muted-foreground`,children:`No results`}):r.map(e=>{let[t,r]=e.url.split(`#`);return(0,z.jsxs)(`a`,{role:`option`,"aria-selected":!1,href:E(Z(t??``),r),onClick:()=>n(``),className:`flex flex-col rounded-md px-2 py-1.5 text-sm outline-none hover:bg-muted focus-visible:bg-muted`,children:[(0,z.jsx)(`span`,{className:e.type===`page`?`font-medium`:`truncate`,children:e.content}),(0,z.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[e.type===`page`?`Page`:e.type===`heading`?`Heading`:`Text`,` · `,e.url]})]},e.id)})})]})}function fn({docs:e,route:t}){return e?e.status===`missing`?(0,z.jsx)(D,{title:`The docs need two packages`,hint:`Install them with: bun add -d ${e.packages?.join(` `)??`fumadocs-core @mdx-js/mdx`}`}):e.status===`error`?(0,z.jsx)(D,{title:`The docs cannot be shown`,hint:e.message}):(0,z.jsx)(pn,{docs:e,route:t}):(0,z.jsx)(D,{title:`No documentation`,hint:`Set documentation: './docs' in brick() to show a folder of pages here`})}function pn({docs:e,route:t}){let n=Se(e.revision),r=we(e.components,e.revision),[i,a]=(0,R.useState)(),o=(0,R.useMemo)(()=>i?.toc??[],[i]),{path:s,anchor:c}=t,l=(0,R.useCallback)(()=>{if(s.length>0||!n)return;let e=un(n.tree.children);e&&location.replace(E(e))},[s.length,n]);(0,R.useEffect)(()=>{if(!i)return;let e=()=>{let e=c?document.getElementById(c):void 0;e?e.scrollIntoView({block:`start`}):window.scrollTo(0,0)};if(e(),!c)return;let t=()=>{document.removeEventListener(`load`,e,!0),window.removeEventListener(`wheel`,t),window.removeEventListener(`touchstart`,t),window.removeEventListener(`keydown`,t),clearTimeout(n)},n=setTimeout(t,2e3);return document.addEventListener(`load`,e,!0),window.addEventListener(`wheel`,t,{passive:!0}),window.addEventListener(`touchstart`,t,{passive:!0}),window.addEventListener(`keydown`,t),t},[i?.path,c]);let u=T(`(min-width: 1024px)`),d=n?.tree.name??e.title,f=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(dn,{revision:e.revision}),n&&(0,z.jsx)(ln,{nodes:n.tree.children,current:s})]});return(0,z.jsxs)(`div`,{className:`flex min-h-[calc(100svh-3.5rem)]`,children:[u&&(0,z.jsxs)(`aside`,{className:`sticky top-14 flex h-[calc(100svh-3.5rem)] w-64 shrink-0 flex-col gap-3 overflow-y-auto border-r p-3`,children:[(0,z.jsx)(`div`,{className:`px-1 pt-1 text-sm font-semibold`,children:d}),f]}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[!u&&(0,z.jsxs)(`details`,{className:`border-b p-3`,children:[(0,z.jsxs)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:[d,`: pages and search`]}),(0,z.jsx)(`div`,{className:`mt-3 flex flex-col gap-3`,children:f})]}),(0,z.jsx)(`div`,{className:`mx-auto max-w-3xl px-6 py-10 max-sm:px-4`,children:(0,z.jsx)(an,{path:s,revision:e.revision,project:r,onPage:a,onMissing:l})})]}),(0,z.jsx)(`aside`,{className:`sticky top-14 hidden h-[calc(100svh-3.5rem)] w-56 shrink-0 overflow-y-auto p-4 pt-10 xl:block`,children:(0,z.jsx)(tn,{headings:o,page:i?.path})})]})}export{fn as default};