@brickkit/cli 0.16.0-beta.2 → 0.16.0-beta.3

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 (43) hide show
  1. package/README.md +22 -0
  2. package/dashboard-dist/{api-reference-FojtkYBA.js → api-reference-ZQs4Z4Yd.js} +71 -71
  3. package/dashboard-dist/app.css +1 -1
  4. package/dashboard-dist/app.js +12 -12
  5. package/dashboard-dist/{client-Cnm0Im6o.js → client-CFM1S4Xv.js} +1 -1
  6. package/dashboard-dist/{core-SiSejpN2.js → core-VNHGFYB7.js} +1 -1
  7. package/dashboard-dist/{docs-D1HrRL0z.js → docs-CM2krp6H.js} +2 -2
  8. package/dashboard-dist/kit.js +1 -1
  9. package/dashboard-dist/popover-CVY1eRNY.js +1 -0
  10. package/dashboard-dist/theme.css +48 -39
  11. package/dist/bin.js +2 -1
  12. package/dist/bin.js.map +1 -1
  13. package/dist/build.js +6 -1
  14. package/dist/build.js.map +1 -1
  15. package/dist/dashboard-host.js +2594 -898
  16. package/dist/dashboard-host.js.map +1 -1
  17. package/dist/dashboard-protocol.js +4 -0
  18. package/dist/dashboard-protocol.js.map +1 -1
  19. package/dist/dashboard.d.ts +3 -3
  20. package/dist/package.js +5 -0
  21. package/dist/package.js.map +1 -0
  22. package/dist/production-dashboard.js +1 -0
  23. package/dist/production-dashboard.js.map +1 -1
  24. package/dist/project.js +2 -3
  25. package/dist/project.js.map +1 -1
  26. package/dist/vite.js +1 -0
  27. package/dist/vite.js.map +1 -1
  28. package/inspector-dist/client/assets/{app-Wfnqu2Ic.css → app-PJHZvcxl.css} +49 -40
  29. package/inspector-dist/client/assets/{manifest-cfc09adc.js → manifest-274ef876.js} +1 -1
  30. package/inspector-dist/client/assets/{root-CVescmwt.css → root-CPvk93Fe.css} +49 -40
  31. package/inspector-dist/server/assets/{app-DUrMEdTr.js → app-DdYuYhBk.js} +51 -17
  32. package/inspector-dist/server/assets/{functions-CvYRS9L5.js → functions-BebJWj30.js} +2 -2
  33. package/inspector-dist/server/assets/{serialization-BMjuH1Dy.js → serialization-Cgu5b7aC.js} +1 -1
  34. package/inspector-dist/server/assets/{token-B03I2FMb.js → token-3-nUtxO2.js} +1 -1
  35. package/inspector-dist/server/assets/{token-CXQG49kq.js → token-DH652a7D.js} +1 -1
  36. package/inspector-dist/server/assets/token-util-wQgchIHA.js +3 -0
  37. package/inspector-dist/server/assets/{ws-transport-CMidAEKi.js → ws-transport-7nLI4Gq9.js} +1 -1
  38. package/inspector-dist/server/index.js +1 -1
  39. package/package.json +2 -2
  40. package/dashboard-dist/PopoverPopup-CiI2avT_.js +0 -1
  41. package/dashboard-dist/popover-Da7zBKDq.js +0 -1
  42. package/inspector-dist/server/assets/token-util-DQqrmFHy.js +0 -3
  43. /package/inspector-dist/client/assets/{root-CVhM1JOR.js → root-2KbsWt-J.js} +0 -0
@@ -1 +1 @@
1
- export{U as Custom,G as DefaultResultDisplay,W as default}from"./api-reference-FojtkYBA.js";
1
+ export{U as Custom,G as DefaultResultDisplay,W as default}from"./api-reference-ZQs4Z4Yd.js";
@@ -1 +1 @@
1
- export{H as ShikiError,t as addClassToHast,T as applyColorReplacements,n as codeToHast,r as codeToHtml,i as codeToTokens,a as codeToTokensBase,E as codeToTokensWithThemes,o as createBundledHighlighter,s as createCssVariablesTheme,c as createHighlighterCore,l as createHighlighterCoreSync,u as createPositionConverter,D as createShikiInternal,O as createShikiInternalSync,k as createShikiPrimitive,A as createShikiPrimitiveAsync,d as createSingletonShorthands,f as flatTokenVariants,j as getLastGrammarState,p as getSingletonHighlighterCore,m as getTokenStyleObject,h as guessEmbeddedLanguages,g as hastToHtml,M as isNoneTheme,N as isPlainLang,P as isSpecialLang,F as isSpecialTheme,_ as makeSingletonHighlighter,v as makeSingletonHighlighterCore,I as normalizeGetter,L as normalizeTheme,R as resolveColorReplacements,z as splitLines,y as splitToken,b as splitTokens,x as stringifyTokenStyle,B as toArray,S as tokenizeAnsiWithTheme,V as tokenizeWithTheme,C as tokensToHast,w as transformerDecorations}from"./api-reference-FojtkYBA.js";
1
+ export{H as ShikiError,t as addClassToHast,T as applyColorReplacements,n as codeToHast,r as codeToHtml,i as codeToTokens,a as codeToTokensBase,E as codeToTokensWithThemes,o as createBundledHighlighter,s as createCssVariablesTheme,c as createHighlighterCore,l as createHighlighterCoreSync,u as createPositionConverter,D as createShikiInternal,O as createShikiInternalSync,k as createShikiPrimitive,A as createShikiPrimitiveAsync,d as createSingletonShorthands,f as flatTokenVariants,j as getLastGrammarState,p as getSingletonHighlighterCore,m as getTokenStyleObject,h as guessEmbeddedLanguages,g as hastToHtml,M as isNoneTheme,N as isPlainLang,P as isSpecialLang,F as isSpecialTheme,_ as makeSingletonHighlighter,v as makeSingletonHighlighterCore,I as normalizeGetter,L as normalizeTheme,R as resolveColorReplacements,z as splitLines,y as splitToken,b as splitTokens,x as stringifyTokenStyle,B as toArray,S as tokenizeAnsiWithTheme,V as tokenizeWithTheme,C as tokensToHast,w as transformerDecorations}from"./api-reference-ZQs4Z4Yd.js";
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Gn as t,Hn as n,Mn as r,Nn as i,Pn as a,S as o,Un as s,Vn as c,Wn as l,a as u,c as d,cn as f,kn as p,kt as m,ln as h,rn as g,s as _,sn as v}from"./CompositeRoot-D4sRkYq3.js";import{J as y,at as b,b as x,et as S,it as C,k as w,ot as T,wt as E}from"./popover-Da7zBKDq.js";import{A as D,F as O,I as k,M as A,N as j,O as M,P as N,R as P,T as F,a as I,c as ee,d as L,f as te,g as ne,h as re,i as ie,j as R,k as z,l as ae,m as oe,n as se,o as ce,p as le,r as ue,s as de,t as fe,u as pe,w as me}from"./CollapsiblePanel-DvJpFahB.js";import{c as he,f as ge,o as _e}from"./app.js";var ve={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`}]]};ve.node;var ye=n(ve),be={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`}]]};be.node;var xe=n(be),B=e(t(),1);async function Se(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 Ce(e){let[t,n]=(0,B.useState)();return(0,B.useEffect)(()=>{let e=new AbortController;return Se(S.info,e.signal).then(e=>e&&n(e),()=>{}),()=>e.abort()},[e]),t}function we(e,t){let n=e.join(`/`),[r,i]=(0,B.useState)();return(0,B.useEffect)(()=>{let t=new AbortController;return Se(b(e),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 Te(e,t){let[n,r]=(0,B.useState)();return(0,B.useEffect)(()=>{if(!e)return;let n=!0,i=`${S.components}?v=${t}`;return 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 V=e(s(),1),Ee=B.createContext(void 0);function De(){let e=B.useContext(Ee);if(e===void 0)throw Error(v(10));return e}var Oe={value:()=>null},ke=B.forwardRef(function(e,t){let{render:n,className:i,disabled:o=!1,hiddenUntilFound:s,keepMounted:c,loopFocus:l,onValueChange:f,multiple:p=!1,orientation:m=`vertical`,value:g,defaultValue:_,style:v,...y}=e,b=_??a,x=B.useRef([]),[S,C]=d({controlled:g,default:b,name:`Accordion`,state:`value`}),w=h((e,t,n)=>{let r;r=p?t?[...S,e]:S.filter(t=>t!==e):S[0]===e?[]:[e],f?.(r,n),n.isCanceled||C(r)}),T=B.useMemo(()=>({value:S,disabled:o,orientation:m}),[S,o,m]),E=B.useMemo(()=>({disabled:o,handleValueChange:w,hiddenUntilFound:s??!1,keepMounted:c??!1,state:T,value:S}),[o,w,s,c,T,S]),D=r(`div`,e,{state:T,ref:t,props:y,stateAttributesMapping:Oe});return(0,V.jsx)(Ee.Provider,{value:E,children:(0,V.jsx)(u,{elementsRef:x,children:D})})}),Ae=B.createContext(void 0);function H(){let e=B.useContext(Ae);if(e===void 0)throw Error(v(9));return e}var je=`data-index`,U={...I,index:e=>({[je]:String(e)}),...m,value:()=>null},Me=B.forwardRef(function(e,t){let{className:n,disabled:i=!1,onOpenChange:a,render:s,value:c,style:l,...u}=e,{ref:d,index:f}=_(),{disabled:p,handleValueChange:m,state:g,value:v}=De(),y=o(),b=c??y,x=i||p,S=v.includes(b),C=h((e,t)=>{a?.(e,t),t.isCanceled||m(b,e,t)}),w=ae({open:S,onOpenChange:C,disabled:x}),T=B.useMemo(()=>({...w,onOpenChange:C,state:{open:w.open,disabled:w.disabled,transitionStatus:w.transitionStatus}}),[w,C]),E=B.useMemo(()=>({...g,hidden:!S&&!w.mounted,index:f,disabled:x,open:S}),[w.mounted,x,f,S,g]),D=o(),[O,k]=B.useState(),A=O===null?void 0:O??D,j=B.useMemo(()=>({defaultTriggerId:D,open:S,state:E,setTriggerId:k,triggerId:A}),[D,S,E,k,A]),M=r(`div`,e,{state:E,ref:[t,d],props:u,stateAttributesMapping:U});return(0,V.jsx)(de.Provider,{value:T,children:(0,V.jsx)(Ae.Provider,{value:j,children:M})})}),Ne=B.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,{state:s}=H();return r(`h3`,e,{state:s,ref:t,props:o,stateAttributesMapping:U})}),Pe={...U,...ce},Fe=B.forwardRef(function(e,t){let{disabled:n,className:i,id:a,render:o,nativeButton:s=!0,style:c,...l}=e,{panelId:u,open:d,handleTrigger:p,disabled:m}=ee(),{getButtonProps:h,buttonRef:_}=g({disabled:n||m,native:s}),{defaultTriggerId:v,state:y,setTriggerId:b}=H(),x=a||void 0,S=x??v;return f(()=>(b(e=>x??(e===null?void 0:e)),()=>{b(e=>e===x?null:e)}),[x,b]),r(`button`,e,{state:y,ref:[t,_],props:[{"aria-controls":d?u:void 0,"aria-expanded":d,id:S,onClick:p},l,h],stateAttributesMapping:Pe})}),Ie=`--accordion-panel-height`,Le=`--accordion-panel-width`,Re=B.forwardRef(function(e,t){let{className:n,hiddenUntilFound:a,keepMounted:o,id:s,render:c,style:l,...u}=e,{hiddenUntilFound:d,keepMounted:p}=De(),{defaultPanelId:m,mounted:h,onOpenChange:g,open:_,setMounted:v,setOpen:y,setPanelIdState:b,transitionStatus:x}=ee(),S=a??d,C=o??p,w=s||void 0,T=s??m;f(()=>(b(e=>w??(e===null?void 0:e)),()=>{b(e=>e===w?null:e)}),[w,b]);let{height:E,props:D,ref:O,shouldPreventOpenAnimation:k,shouldRender:A,transitionStatus:j,width:M}=se({externalRef:t,hiddenUntilFound:S,id:T,keepMounted:C,mounted:h,onOpenChange:g,open:_,setMounted:v,setOpen:y,transitionStatus:x}),{state:N,triggerId:P}=H(),F={...N,transitionStatus:j},I=i(l,F),L=r(`div`,{...e,style:void 0},{state:F,ref:O,props:[D,{"aria-labelledby":P,role:`region`,style:{[Ie]:E===void 0?`auto`:`${E}px`,[Le]:M===void 0?`auto`:`${M}px`}},u,I?{style:I}:void 0,k?{style:{animationName:`none`}}:void 0],stateAttributesMapping:U});return A?L:null});function ze({className:e,...t}){return(0,V.jsx)(ke,{className:t=>N(`divide-y divide-fd-border overflow-hidden rounded-lg border bg-fd-card`,typeof e==`function`?e(t):e),...t})}function Be({children:e,...t}){return(0,V.jsx)(Me,{...t,children:e})}function Ve({className:e,children:t,...n}){return(0,V.jsx)(Ne,{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 He({className:e,children:t,...n}){return(0,V.jsxs)(Fe,{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,V.jsx)(P,{className:`size-4 shrink-0 text-fd-muted-foreground transition-transform duration-200 group-data-panel-open:rotate-90`}),t]})}function Ue({className:e,children:t,...n}){return(0,V.jsx)(Re,{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 We({ref:e,className:t,defaultValue:n,...r}){let i=(0,B.useRef)(null),a=F(e,i),[o,s]=(0,B.useState)(n??[]);return(0,B.useEffect)(()=>{let e=me(),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,V.jsx)(ze,{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 Ge({title:e,id:t,value:n=String(e),children:r,...i}){return(0,V.jsxs)(Be,{value:n,...i,children:[(0,V.jsxs)(Ve,{id:t,"data-accordion-value":n,children:[(0,V.jsx)(He,{children:e}),t?(0,V.jsx)(Ke,{id:t}):null]}),(0,V.jsx)(Ue,{hiddenUntilFound:!0,children:(0,V.jsx)(`div`,{className:`px-4 pb-2 text-[0.9375rem] prose-no-margin [&[hidden]:not([hidden='until-found'])]:hidden`,children:r})})]})}function Ke({id:e}){let t=M({note:`accordion`}),[n,r]=z(()=>{let t=new URL(window.location.href);return t.hash=e,navigator.clipboard.writeText(t.toString())});return(0,V.jsxs)(`button`,{type:`button`,"aria-live":`polite`,className:N(D({variant:`ghost`,className:`text-fd-muted-foreground me-2`})),onClick:r,children:[n?(0,V.jsx)(c,{className:`size-3.5`}):(0,V.jsx)(O,{className:`size-3.5`}),(0,V.jsx)(`span`,{className:`sr-only`,children:t(n?`Copied Link`:`Copy Link`,{note:`aria-label`})})]})}function qe({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=M({note:`banner`}),[s,c]=(0,B.useState)(!0),l=e?`nd-banner-${Xe(e)}`:null;(0,B.useEffect)(()=>{l&&localStorage.getItem(l)===`true`&&c(!1)},[l]);function u(){c(!1),l&&localStorage.setItem(l,`true`)}return s?(0,V.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,V.jsx)(`style`,{children:l?`:root:not(.${l}) { --fd-banner-height: ${r}; }`:`:root { --fd-banner-height: ${r}; }`}):null,l?(0,V.jsx)(`style`,{children:`.${l} #${e} { display: none; }`}):null,l?(0,V.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`if (localStorage.getItem('${l}') === 'true') document.documentElement.classList.add('${l}');`}}):null,t===`rainbow`?Ye({colors:i}):null,a.children,e?(0,V.jsx)(`button`,{type:`button`,"aria-label":o(`Close Banner`,{note:`aria-label`}),onClick:u,className:N(D({variant:`ghost`,className:`absolute inset-e-2 top-1/2 -translate-y-1/2 text-fd-muted-foreground/50`,size:`icon-sm`})),children:(0,V.jsx)(_e,{})}):null]}):null}var Je=`linear-gradient(to bottom,white,transparent), radial-gradient(circle at top center, white, transparent)`;function Ye({colors:e}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`absolute inset-0 -z-1`,style:{maskImage:Je,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,V.jsx)(`style`,{children:`@keyframes fd-moving-banner {
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Gn as t,Hn as n,Mn as r,Nn as i,Pn as a,S as o,Un as s,Vn as c,Wn as l,a as u,c as d,cn as f,kn as p,kt as m,ln as h,rn as g,s as _,sn as v}from"./CompositeRoot-D4sRkYq3.js";import{Kn as y,N as b,U as x,bt as S,ct as C,mt as w,vt as T,yt as E}from"./popover-CVY1eRNY.js";import{A as D,F as O,I as k,M as A,N as j,O as M,P as N,R as P,T as F,a as I,c as ee,d as L,f as te,g as ne,h as re,i as ie,j as R,k as z,l as ae,m as oe,n as se,o as ce,p as le,r as ue,s as de,t as fe,u as pe,w as me}from"./CollapsiblePanel-DvJpFahB.js";import{c as he,f as ge,o as _e}from"./app.js";var ve={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`}]]};ve.node;var ye=n(ve),be={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`}]]};be.node;var xe=n(be),B=e(t(),1);async function Se(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 Ce(e){let[t,n]=(0,B.useState)();return(0,B.useEffect)(()=>{let e=new AbortController;return Se(w.info,e.signal).then(e=>e&&n(e),()=>{}),()=>e.abort()},[e]),t}function we(e,t){let n=e.join(`/`),[r,i]=(0,B.useState)();return(0,B.useEffect)(()=>{let t=new AbortController;return Se(E(e),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 Te(e,t){let[n,r]=(0,B.useState)();return(0,B.useEffect)(()=>{if(!e)return;let n=!0,i=`${w.components}?v=${t}`;return 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 V=e(s(),1),Ee=B.createContext(void 0);function De(){let e=B.useContext(Ee);if(e===void 0)throw Error(v(10));return e}var Oe={value:()=>null},ke=B.forwardRef(function(e,t){let{render:n,className:i,disabled:o=!1,hiddenUntilFound:s,keepMounted:c,loopFocus:l,onValueChange:f,multiple:p=!1,orientation:m=`vertical`,value:g,defaultValue:_,style:v,...y}=e,b=_??a,x=B.useRef([]),[S,C]=d({controlled:g,default:b,name:`Accordion`,state:`value`}),w=h((e,t,n)=>{let r;r=p?t?[...S,e]:S.filter(t=>t!==e):S[0]===e?[]:[e],f?.(r,n),n.isCanceled||C(r)}),T=B.useMemo(()=>({value:S,disabled:o,orientation:m}),[S,o,m]),E=B.useMemo(()=>({disabled:o,handleValueChange:w,hiddenUntilFound:s??!1,keepMounted:c??!1,state:T,value:S}),[o,w,s,c,T,S]),D=r(`div`,e,{state:T,ref:t,props:y,stateAttributesMapping:Oe});return(0,V.jsx)(Ee.Provider,{value:E,children:(0,V.jsx)(u,{elementsRef:x,children:D})})}),Ae=B.createContext(void 0);function H(){let e=B.useContext(Ae);if(e===void 0)throw Error(v(9));return e}var je=`data-index`,U={...I,index:e=>({[je]:String(e)}),...m,value:()=>null},Me=B.forwardRef(function(e,t){let{className:n,disabled:i=!1,onOpenChange:a,render:s,value:c,style:l,...u}=e,{ref:d,index:f}=_(),{disabled:p,handleValueChange:m,state:g,value:v}=De(),y=o(),b=c??y,x=i||p,S=v.includes(b),C=h((e,t)=>{a?.(e,t),t.isCanceled||m(b,e,t)}),w=ae({open:S,onOpenChange:C,disabled:x}),T=B.useMemo(()=>({...w,onOpenChange:C,state:{open:w.open,disabled:w.disabled,transitionStatus:w.transitionStatus}}),[w,C]),E=B.useMemo(()=>({...g,hidden:!S&&!w.mounted,index:f,disabled:x,open:S}),[w.mounted,x,f,S,g]),D=o(),[O,k]=B.useState(),A=O===null?void 0:O??D,j=B.useMemo(()=>({defaultTriggerId:D,open:S,state:E,setTriggerId:k,triggerId:A}),[D,S,E,k,A]),M=r(`div`,e,{state:E,ref:[t,d],props:u,stateAttributesMapping:U});return(0,V.jsx)(de.Provider,{value:T,children:(0,V.jsx)(Ae.Provider,{value:j,children:M})})}),Ne=B.forwardRef(function(e,t){let{render:n,className:i,style:a,...o}=e,{state:s}=H();return r(`h3`,e,{state:s,ref:t,props:o,stateAttributesMapping:U})}),Pe={...U,...ce},Fe=B.forwardRef(function(e,t){let{disabled:n,className:i,id:a,render:o,nativeButton:s=!0,style:c,...l}=e,{panelId:u,open:d,handleTrigger:p,disabled:m}=ee(),{getButtonProps:h,buttonRef:_}=g({disabled:n||m,native:s}),{defaultTriggerId:v,state:y,setTriggerId:b}=H(),x=a||void 0,S=x??v;return f(()=>(b(e=>x??(e===null?void 0:e)),()=>{b(e=>e===x?null:e)}),[x,b]),r(`button`,e,{state:y,ref:[t,_],props:[{"aria-controls":d?u:void 0,"aria-expanded":d,id:S,onClick:p},l,h],stateAttributesMapping:Pe})}),Ie=`--accordion-panel-height`,Le=`--accordion-panel-width`,Re=B.forwardRef(function(e,t){let{className:n,hiddenUntilFound:a,keepMounted:o,id:s,render:c,style:l,...u}=e,{hiddenUntilFound:d,keepMounted:p}=De(),{defaultPanelId:m,mounted:h,onOpenChange:g,open:_,setMounted:v,setOpen:y,setPanelIdState:b,transitionStatus:x}=ee(),S=a??d,C=o??p,w=s||void 0,T=s??m;f(()=>(b(e=>w??(e===null?void 0:e)),()=>{b(e=>e===w?null:e)}),[w,b]);let{height:E,props:D,ref:O,shouldPreventOpenAnimation:k,shouldRender:A,transitionStatus:j,width:M}=se({externalRef:t,hiddenUntilFound:S,id:T,keepMounted:C,mounted:h,onOpenChange:g,open:_,setMounted:v,setOpen:y,transitionStatus:x}),{state:N,triggerId:P}=H(),F={...N,transitionStatus:j},I=i(l,F),L=r(`div`,{...e,style:void 0},{state:F,ref:O,props:[D,{"aria-labelledby":P,role:`region`,style:{[Ie]:E===void 0?`auto`:`${E}px`,[Le]:M===void 0?`auto`:`${M}px`}},u,I?{style:I}:void 0,k?{style:{animationName:`none`}}:void 0],stateAttributesMapping:U});return A?L:null});function ze({className:e,...t}){return(0,V.jsx)(ke,{className:t=>N(`divide-y divide-fd-border overflow-hidden rounded-lg border bg-fd-card`,typeof e==`function`?e(t):e),...t})}function Be({children:e,...t}){return(0,V.jsx)(Me,{...t,children:e})}function Ve({className:e,children:t,...n}){return(0,V.jsx)(Ne,{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 He({className:e,children:t,...n}){return(0,V.jsxs)(Fe,{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,V.jsx)(P,{className:`size-4 shrink-0 text-fd-muted-foreground transition-transform duration-200 group-data-panel-open:rotate-90`}),t]})}function Ue({className:e,children:t,...n}){return(0,V.jsx)(Re,{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 We({ref:e,className:t,defaultValue:n,...r}){let i=(0,B.useRef)(null),a=F(e,i),[o,s]=(0,B.useState)(n??[]);return(0,B.useEffect)(()=>{let e=me(),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,V.jsx)(ze,{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 Ge({title:e,id:t,value:n=String(e),children:r,...i}){return(0,V.jsxs)(Be,{value:n,...i,children:[(0,V.jsxs)(Ve,{id:t,"data-accordion-value":n,children:[(0,V.jsx)(He,{children:e}),t?(0,V.jsx)(Ke,{id:t}):null]}),(0,V.jsx)(Ue,{hiddenUntilFound:!0,children:(0,V.jsx)(`div`,{className:`px-4 pb-2 text-[0.9375rem] prose-no-margin [&[hidden]:not([hidden='until-found'])]:hidden`,children:r})})]})}function Ke({id:e}){let t=M({note:`accordion`}),[n,r]=z(()=>{let t=new URL(window.location.href);return t.hash=e,navigator.clipboard.writeText(t.toString())});return(0,V.jsxs)(`button`,{type:`button`,"aria-live":`polite`,className:N(D({variant:`ghost`,className:`text-fd-muted-foreground me-2`})),onClick:r,children:[n?(0,V.jsx)(c,{className:`size-3.5`}):(0,V.jsx)(O,{className:`size-3.5`}),(0,V.jsx)(`span`,{className:`sr-only`,children:t(n?`Copied Link`:`Copy Link`,{note:`aria-label`})})]})}function qe({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=M({note:`banner`}),[s,c]=(0,B.useState)(!0),l=e?`nd-banner-${Xe(e)}`:null;(0,B.useEffect)(()=>{l&&localStorage.getItem(l)===`true`&&c(!1)},[l]);function u(){c(!1),l&&localStorage.setItem(l,`true`)}return s?(0,V.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,V.jsx)(`style`,{children:l?`:root:not(.${l}) { --fd-banner-height: ${r}; }`:`:root { --fd-banner-height: ${r}; }`}):null,l?(0,V.jsx)(`style`,{children:`.${l} #${e} { display: none; }`}):null,l?(0,V.jsx)(`script`,{dangerouslySetInnerHTML:{__html:`if (localStorage.getItem('${l}') === 'true') document.documentElement.classList.add('${l}');`}}):null,t===`rainbow`?Ye({colors:i}):null,a.children,e?(0,V.jsx)(`button`,{type:`button`,"aria-label":o(`Close Banner`,{note:`aria-label`}),onClick:u,className:N(D({variant:`ghost`,className:`absolute inset-e-2 top-1/2 -translate-y-1/2 text-fd-muted-foreground/50`,size:`icon-sm`})),children:(0,V.jsx)(_e,{})}):null]}):null}var Je=`linear-gradient(to bottom,white,transparent), radial-gradient(circle at top center, white, transparent)`;function Ye({colors:e}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`absolute inset-0 -z-1`,style:{maskImage:Je,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,V.jsx)(`style`,{children:`@keyframes fd-moving-banner {
2
2
  from { background-position: 0% 0; }
3
3
  to { background-position: 100% 0; }
4
- }`})]})}function Xe(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 W=ie,G=ue;function Ze({children:e,className:t,...n}){return(0,V.jsx)(fe,{...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 Qe=p(`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 $e({className:e,...t}){return(0,V.jsx)(`div`,{className:N(`not-prose rounded-md border bg-fd-card p-2`,e),...t,children:t.children})}function et({name:e,icon:t=(0,V.jsx)(k,{}),className:n,...r}){return(0,V.jsxs)(`div`,{className:N(Qe({className:n})),...r,children:[t,e]})}function tt({name:e,defaultOpen:t=!1,...n}){let[r,i]=(0,B.useState)(t);return(0,V.jsxs)(W,{open:r,onOpenChange:i,...n,children:[(0,V.jsxs)(G,{className:N(Qe({className:`w-full`})),children:[r?(0,V.jsx)(ye,{}):(0,V.jsx)(xe,{}),e]}),(0,V.jsx)(Ze,{children:(0,V.jsx)(`div`,{className:`ms-2 flex flex-col border-l ps-2`,children:n.children})})]})}var nt=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 rt(e){return typeof Element>`u`?!1:e instanceof Element}var K=(e,t)=>rt(t)&&t.tagName.toUpperCase()===e,it=e=>K(`DIV`,e)||K(`SPAN`,e),q=e=>K(`IMG`,e),at=e=>e.complete&&e.naturalHeight!==0,J=e=>K(`SVG`,e),ot=e=>{if(e!==null)return q(e)?e.alt:e.getAttribute(`aria-label`)??void 0},st=/url(?:\(['"]?)(?<url>.*?)(?:['"]?\))/,ct=e=>{if(e!==null){if(q(e))return e.currentSrc===``?void 0:e.currentSrc;if(it(e)){let{backgroundImage:t}=window.getComputedStyle(e);if(t!==``)return st.exec(t)?.[1]}}},lt=e=>{if(e==null)return{};if(J(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}},ut=({height:e,offset:t,width:n})=>Math.min((window.innerWidth-t*2)/n,(window.innerHeight-t*2)/e),dt=({containerHeight:e,containerWidth:t,offset:n,targetHeight:r,targetWidth:i})=>{let a=ut({height:r,offset:n,width:i}),o=i>r?i/t:r/e;return a>1?o:a*o},ft=({containerHeight:e,containerWidth:t,hasScalableSrc:n,offset:r,targetHeight:i,targetWidth:a})=>e===0||t===0?1:!n&&i!==0&&a!==0?dt({containerHeight:e,containerWidth:t,offset:r,targetHeight:i,targetWidth:a}):ut({height:e,offset:r,width:t}),pt=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s})=>{let c=ft({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})`}},Y=(e,t)=>{let n=parseFloat(e);return e.endsWith(`%`)?t*n/100:n},X=({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=Y(d,r-u),m=Y(f,e-l),h=ft({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})`}},mt=({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 X({...d,visibleWidth:l*i,visibleHeight:c*i})}if(u===`none`)return X({...d,visibleWidth:l,visibleHeight:c});{let a=r/l,o=e/c,u=Math.max(a,o),d=ft({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})`}}},ht=({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 X({...u,visibleWidth:l*i,visibleHeight:c*i})}if(t===`auto`)return X({...u,visibleWidth:l,visibleHeight:c});{let[e=`50%`,r=`50%`]=t.split(` `),i=Y(e,a),o=Y(r,n),s=i/l,d=o/c,f=Math.min(s,d);return X({...u,visibleWidth:l*f,visibleHeight:c*f})}},gt=({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}`},_t=({fallback:e,natural:t})=>t!==void 0&&t!==0?t:e,vt=/\.svg$/i,yt=({hasZoomImg:e,imgSrc:t,isSvg:n})=>n||t?.slice(0,18)===`data:image/svg+xml`||e||t!==void 0&&vt.test(t),bt=({hasZoomImg:e,imgSrc:t,isSvg:n,isZoomed:r,loadedImgEl:i,offset:a,shouldRefresh:o,targetEl:s})=>{let c=yt({hasZoomImg:e,imgSrc:t,isSvg:n}),l=s.getBoundingClientRect(),u=window.getComputedStyle(s),d=i!=null&&it(s),f=i!=null&&!d,p=_t({fallback:l.height,natural:i?.naturalHeight}),m=_t({fallback:l.width,natural:i?.naturalWidth}),{height:h,left:g,top:_,width:v}=l,y=d?ht({backgroundPosition:u.backgroundPosition,backgroundSize:u.backgroundSize,containerHeight:h,containerLeft:g,containerTop:_,containerWidth:v,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}):f?mt({containerHeight:h,containerLeft:g,containerTop:_,containerWidth:v,hasScalableSrc:c,objectFit:u.objectFit,objectPosition:u.objectPosition,offset:a,targetHeight:p,targetWidth:m}):pt({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:gt({...y,isZoomed:r,userTransform:u.transform})};return r&&o&&(b.transitionDuration=`0.01ms`),b},xt=e(l()),St=[`img`,`svg`,`[role="img"]`,`[data-zoom]`].map(e=>`${e}:not([aria-hidden="true"])`).join(`,`),Ct={overflow:``,width:``};function wt(){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 Tt(e){e.preventDefault()}function Et(e){return B.createElement(Dt,{...e})}var Dt=class extends B.Component{constructor(){super(...arguments),this.state={id:``,isZoomImgLoaded:!1,loadedImgEl:void 0,modalState:`UNLOADED`,shouldRefresh:!1,styleGhost:{}},this.refContent=B.createRef(),this.refDialog=B.createRef(),this.refModalContent=B.createRef(),this.refModalImg=B.createRef(),this.refWrap=B.createRef(),this.imgEl=null,this.isScaling=!1,this.prevBodyAttrs=Ct,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(St),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:lt(this.imgEl)}))}),this.imgElResizeObserver.observe(this.imgEl),this.contentChangeObserver??(this.contentChangeObserver=new MutationObserver(()=>{this.setState({styleGhost:lt(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=ct(this.imgEl);if(e==null||e===``)return;let t=new Image,{imgEl:n}=this;if(q(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:lt(this.imgEl)})};t.decode().then(r).catch(()=>{at(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||J(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=Ct},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(()=>{at(n)?r():n.onload=r})}},this.UNSAFE_handleSvg=()=>{let{imgEl:e,refModalImg:t,styleModalImg:n}=this;if(J(e)){let r=e.cloneNode(!0);nt(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=it(a),A=q(a),j=J(a),M=ot(a),N=ct(a),P=A?a.sizes:void 0,F=A?a.srcset:void 0,I=A?a.crossOrigin:void 0,ee=m?.src!==void 0&&m.src!==``,L=this.hasImage(),te=M!==void 0&&M!==``?`${s}: ${M}`:s,ne=w===`LOADING`||w===`LOADED`,re=L?`found`:`not-found`,ie=w===`UNLOADED`||w===`UNLOADING`?`hidden`:`visible`,R={visibility:w===`UNLOADED`?`visible`:`hidden`};this.styleModalImg=L&&a!==null?bt({hasZoomImg:ee,imgSrc:N,isSvg:j,isZoomed:ne,loadedImgEl:C,offset:h,shouldRefresh:T,targetEl:a}):{};let z=null;if(L){let t=A||k?B.createElement(`img`,{alt:M,crossOrigin:I,sizes:P,src:N,srcSet:F,...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?B.createElement(`div`,{"data-rmiz-modal-img":!0,onTransitionEnd:this.handleImgTransitionEnd,ref:y,style:this.styleModalImg}):null,n=B.createElement(`button`,{"aria-label":o,"data-rmiz-btn-unzoom":``,onClick:e,type:`button`},B.createElement(u,null));z=p==null?B.createElement(B.Fragment,null,t,n):B.createElement(p,{buttonUnzoom:n,modalState:w,img:t,isZoomImgLoaded:S,onUnzoom:r})}return B.createElement(f,{"data-rmiz":``,ref:b},B.createElement(f,{"data-rmiz-content":re,ref:g,style:R},c),L&&B.createElement(f,{"data-rmiz-ghost":``,style:E},B.createElement(`button`,{"aria-label":te,"data-rmiz-btn-zoom":``,onClick:i,type:`button`},B.createElement(d,null))),L&&xt.createPortal(B.createElement(`dialog`,{"aria-labelledby":O,"aria-modal":`true`,className:l,"data-rmiz-modal":``,id:D,onClick:t,onClose:n,onCancel:Tt,ref:_,role:`dialog`},B.createElement(`div`,{"data-rmiz-modal-overlay":ie}),B.createElement(`div`,{"data-rmiz-modal-content":``,ref:v},z)),wt()))}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)}};Dt.defaultProps={a11yNameButtonUnzoom:`Minimize image`,a11yNameButtonZoom:`Expand image`,canSwipeToUnzoom:!0,IconUnzoom:Ot,IconZoom:kt,isDisabled:!1,swipeToUnzoomThreshold:10,wrapElement:`div`,zoomMargin:0};function Ot(){return B.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`},B.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 kt(){return B.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`},B.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 At({onZoomChange:e,...t}){let[n,r]=B.useState(!1),i=B.useCallback((t,{event:n})=>{r(t),e?.(t,{event:n})},[e]);return B.createElement(Et,{...t,isZoomed:n,onZoomChange:i})}var jt=(0,B.createContext)(null);function Mt(e){return typeof e==`string`?e:typeof e==`object`?`default`in e?e.default.src:e.src:``}function Nt({zoomInProps:e,children:t,rmiz:n,caption:r,...i}){let a=(0,B.use)(jt),o={src:Mt(i.src),sizes:void 0,...e},s=t??(0,V.jsx)(j,{sizes:`(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px`,...i});return a?(0,V.jsx)(`span`,{role:`button`,tabIndex:0,"aria-haspopup":`dialog`,ref:e=>{if(e)return a.register({element:e,image:{alt:i.alt,...o},caption:r??i.title})},onClick:e=>{e.target!==e.currentTarget&&a.open(e.currentTarget)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a.open(e.currentTarget))},className:`block outline-none [&_img]:cursor-zoom-in [&:focus-visible_img]:ring-2 [&:focus-visible_img]:ring-fd-ring`,children:s}):(0,V.jsx)(At,{zoomMargin:20,wrapElement:`span`,...n,zoomImg:o,children:s})}function Pt({items:e,className:t,...n}){let r=M({note:`inline table of contents`});return(0,V.jsxs)(W,{...n,className:e=>N(`not-prose rounded-lg border bg-fd-card text-fd-card-foreground`,typeof t==`function`?t(e):t),children:[(0,V.jsxs)(G,{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,V.jsx)(ge,{className:`size-4 transition-transform duration-200 group-data-open:rotate-180`})]}),(0,V.jsx)(Ze,{children:(0,V.jsx)(`div`,{className:`flex flex-col p-4 pt-0 text-sm text-fd-muted-foreground`,children:e.map(e=>(0,V.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 Ft({children:e}){return(0,V.jsx)(`div`,{className:`fd-steps`,children:e})}function It({children:e}){return(0,V.jsx)(`div`,{className:`fd-step`,children:e})}var Lt=(0,B.createContext)(null);function Rt(){let e=(0,B.useContext)(Lt);if(!e)throw Error(`You must wrap your component in <Tabs>`);return e}function zt({className:e,...t}){return(0,V.jsx)(re,{...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 Bt({className:e,...t}){return(0,V.jsx)(ne,{...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 Vt({ref:e,className:t,items:n,label:r,defaultIndex:i=0,defaultValue:a=n?Gt(n[i]):void 0,...o}){let s=(0,B.useMemo)(()=>[],[]);return(0,V.jsxs)(le,{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,V.jsxs)(zt,{children:[r&&(0,V.jsx)(`span`,{className:`text-sm font-medium my-auto me-auto`,children:r}),n.map(e=>(0,V.jsx)(Bt,{value:Gt(e),children:e},e))]}),(0,V.jsx)(Lt.Provider,{value:(0,B.useMemo)(()=>({items:n,collection:s}),[s,n]),children:o.children})]})}function Ht({value:e,...t}){let{items:n}=Rt(),r=e??n?.at(Wt());if(!r)throw Error("Failed to resolve tab `value`, please pass a `value` prop to the Tab component.");return(0,V.jsx)(Ut,{value:Gt(r),...t,children:t.children})}function Ut({value:e,className:t,...n}){return(0,V.jsx)(oe,{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 Wt(){let e=(0,B.useId)(),{collection:t}=Rt();return(0,B.useEffect)(()=>()=>{let n=t.indexOf(e);n!==-1&&t.splice(n,1)},[e,t]),t.includes(e)||t.push(e),t.indexOf(e)}function Gt(e){return e.toLowerCase().replace(/\s+/g,`-`)}var Z=p(`text-fd-muted-foreground not-prose pe-2`);function Kt({id:e,type:t,className:n,...r}){let i=M({note:`type table`});return(0,V.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,V.jsxs)(`div`,{className:`flex font-medium items-center px-3 py-1 not-prose text-fd-muted-foreground`,children:[(0,V.jsx)(`p`,{className:`w-1/4`,children:i(`Prop`)}),(0,V.jsx)(`p`,{className:`@max-xl:hidden`,children:i(`Type`)})]}),Object.entries(t).map(([t,n])=>(0,V.jsx)(qt,{parentId:e,name:t,item:n},t))]})}function qt({parentId:e,name:t,item:{parameters:n=[],description:r,required:i=!1,deprecated:a,typeDescription:o,default:s,type:c,typeDescriptionLink:l,returns:u}}){let d=M({note:`type table`}),[f,p]=(0,B.useState)(!1),m=e?`${e}-${t}`:void 0;return(0,B.useEffect)(()=>{let e=me();m&&e&&m===e&&p(!0)},[m]),(0,V.jsxs)(W,{id:m,open:f,onOpenChange:e=>{e&&m&&window.history.replaceState(null,``,`#${m}`),p(e)},className:N(`rounded-xl border overflow-hidden scroll-m-20 transition-all`,f?`shadow-sm bg-fd-background not-last:mb-2`:`border-transparent`),children:[(0,V.jsxs)(G,{className:`relative flex flex-row items-center w-full group text-start px-3 py-2 not-prose hover:bg-fd-accent`,children:[(0,V.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&&`?`]}),l?(0,V.jsx)(A,{href:l,className:`underline @max-xl:hidden`,children:c}):(0,V.jsx)(`span`,{className:`@max-xl:hidden`,children:c}),(0,V.jsx)(ge,{className:`absolute inset-e-2 size-4 text-fd-muted-foreground transition-transform group-data-[open]:rotate-180`})]}),(0,V.jsx)(Ze,{children:(0,V.jsxs)(`div`,{className:`grid grid-cols-[1fr_3fr] gap-y-4 text-sm p-3 overflow-auto fd-scroll-container border-t`,children:[(0,V.jsx)(`div`,{className:`prose prose-sm col-span-full prose-no-margin empty:hidden`,children:r}),o&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:N(Z()),children:d(`Type`)}),(0,V.jsx)(`p`,{className:`my-auto not-prose`,children:o})]}),s&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:N(Z()),children:d(`Default`)}),(0,V.jsx)(`p`,{className:`my-auto not-prose`,children:s})]}),n.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:N(Z()),children:d(`Parameters`)}),(0,V.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.map(e=>(0,V.jsxs)(`div`,{className:`inline-flex items-center flex-wrap gap-1`,children:[(0,V.jsxs)(`p`,{className:`font-medium not-prose text-nowrap`,children:[e.name,` -`]}),(0,V.jsx)(`div`,{className:`prose prose-sm prose-no-margin`,children:e.description})]},e.name))})]}),u&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:N(Z()),children:d(`Returns`)}),(0,V.jsx)(`div`,{className:`my-auto prose prose-sm prose-no-margin`,children:u})]})]})})]})}var Jt=(0,B.createContext)([]);function Yt(e){let t=(0,B.useContext)(Jt);return(0,V.jsx)(Pt,{items:t,...e})}function Xt({code:e,title:t}){return(0,V.jsx)(L,{title:t,children:(0,V.jsx)(te,{children:(0,V.jsx)(`code`,{children:e})})})}function Zt(e){return()=>(0,V.jsx)(R,{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 Qt(e={}){return{...pe,img:e=>(0,V.jsx)(Nt,{...e}),Callout:R,Tabs:Vt,Tab:Ht,Steps:Ft,Step:It,Accordions:We,Accordion:Ge,Files:$e,File:et,Folder:tt,TypeTable:Kt,Banner:qe,InlineTOC:Yt,DynamicCodeBlock:Xt,AutoTypeTable:Zt(`AutoTypeTable`),GithubInfo:Zt(`GithubInfo`),GraphView:Zt(`GraphView`),...e}}function $t(e){return Function(e)({Fragment:B.Fragment,jsx:V.jsx,jsxs:V.jsxs}).default}var en=class extends B.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,V.jsx)(R,{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 tn(e){document.getElementById(e)?.scrollIntoView({block:`start`})}function nn(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{}tn(n)}function rn(e,t){let[n,r]=(0,B.useState)();return(0,B.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 an({headings:e,page:t}){let n=rn(e,t);return e.length===0?null:(0,V.jsxs)(`nav`,{"aria-label":`On this page`,className:`flex flex-col gap-0.5 text-sm`,children:[(0,V.jsx)(`div`,{className:`mb-1.5 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:`On this page`}),e.map(e=>(0,V.jsx)(`a`,{href:e.url,onClick:nn,"aria-current":e.url.slice(1)===n?`location`:void 0,style:{paddingLeft:`${Math.max(e.depth-2,0)*12+8}px`},className:E(`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 on({page:e,project:t}){let n=(0,B.useMemo)(()=>Qt(t?.components),[t]),r=(0,B.useMemo)(()=>{try{return{Page:$t(e.code)}}catch(e){return{error:e instanceof Error?e.message:String(e)}}},[e.code]);if(`error`in r)return(0,V.jsx)(R,{type:`error`,title:`This page could not run`,children:r.error});let{Page:i}=r;return(0,V.jsx)(Jt.Provider,{value:e.toc,children:(0,V.jsx)(en,{reset:[e.code,n],children:(0,V.jsx)(i,{components:n})})})}function sn({page:e,project:t}){return(0,V.jsxs)(`article`,{onClick:nn,className:`min-w-0`,children:[(0,V.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,children:e.title}),e.description&&(0,V.jsx)(`p`,{className:`mt-2 mb-8 text-base text-muted-foreground`,children:e.description}),t?.error&&(0,V.jsx)(R,{type:`warn`,title:`Your components did not load`,children:t.error}),e.error?(0,V.jsx)(R,{type:`error`,title:`${e.path} does not compile`,children:(0,V.jsx)(`pre`,{className:`font-mono text-xs whitespace-pre-wrap`,children:e.error})}):(0,V.jsx)(`div`,{className:`prose max-w-none`,children:(0,V.jsx)(on,{page:e,project:t})})]})}function cn({path:e,revision:t,project:n,onPage:r,onMissing:i}){let a=we(e,t),o=a.status===`ready`?a.page:void 0;return(0,B.useEffect)(()=>r(o),[o,r]),(0,B.useEffect)(()=>{a.status===`missing`&&i()},[a.status,i]),a.status===`loading`||a.status===`ready`&&!n?(0,V.jsx)(w,{title:`Loading page`}):a.status===`missing`?(0,V.jsx)(w,{title:`No such page`,hint:`There is no page at /${e.join(`/`)}`}):a.status===`failed`?(0,V.jsx)(R,{type:`error`,title:`The page could not be loaded`,children:a.message}):(0,V.jsx)(sn,{page:a.page,project:n})}function Q(e){return e.split(`/`).filter(Boolean)}var $=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),ln=(e,t)=>e.type===`page`?$(Q(e.url),t):e.type===`folder`?(e.index?$(Q(e.index.url),t):!1)||e.children.some(e=>ln(e,t)):!1,un=`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 dn({node:e,current:t,depth:n}){let r=ln(e,t),[i,a]=(0,B.useState)(),o=i??(r||e.defaultOpen===!0);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`flex items-center`,children:[e.index?(0,V.jsx)(`a`,{href:C(Q(e.index.url)),"aria-current":$(Q(e.index.url),t)?`page`:void 0,className:E(un,`flex-1 font-medium text-foreground`),children:e.name}):(0,V.jsx)(`button`,{type:`button`,onClick:()=>a(!o),className:E(un,`flex-1 cursor-pointer text-left font-medium text-foreground`),children:e.name}),(0,V.jsx)(`button`,{type:`button`,"aria-label":`${o?`Collapse`:`Expand`} ${e.name}`,"aria-expanded":o,onClick:()=>a(!o),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,V.jsx)(P,{className:E(`size-3.5 transition-transform`,o&&`rotate-90`)})})]}),o&&(0,V.jsx)(`div`,{className:`ml-2 border-l pl-1.5`,children:(0,V.jsx)(fn,{nodes:e.children,current:t,depth:n+1})})]})}function fn({nodes:e,current:t,depth:n}){return(0,V.jsx)(V.Fragment,{children:e.map((e,r)=>e.type===`separator`?(0,V.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,V.jsx)(dn,{node:e,current:t,depth:n},`folder-${e.name}-${r}`):(0,V.jsx)(`a`,{href:C(Q(e.url)),"aria-current":$(Q(e.url),t)?`page`:void 0,className:un,children:e.name},e.url))})}function pn({nodes:e,current:t}){return(0,V.jsx)(`nav`,{"aria-label":`Docs pages`,className:`flex flex-col gap-0.5`,children:(0,V.jsx)(fn,{nodes:e,current:t,depth:0})})}function mn(e){for(let t of e){if(t.type===`page`)return Q(t.url);if(t.type===`folder`){if(t.index)return Q(t.index.url);let e=mn(t.children);if(e)return e}}}function hn({revision:e}){let[t,n]=(0,B.useState)(``),[r,i]=(0,B.useState)([]);return(0,B.useEffect)(()=>{if(!t.trim()){i([]);return}let e=new AbortController,n=setTimeout(()=>{fetch(T(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,V.jsxs)(`div`,{className:`relative`,children:[(0,V.jsx)(he,{className:`pointer-events-none absolute top-2.5 left-2.5 size-3.5 text-muted-foreground`}),(0,V.jsx)(x,{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,V.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,V.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,V.jsxs)(`a`,{role:`option`,"aria-selected":!1,href:C(Q(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,V.jsx)(`span`,{className:e.type===`page`?`font-medium`:`truncate`,children:e.content}),(0,V.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[e.type===`page`?`Page`:e.type===`heading`?`Heading`:`Text`,` · `,e.url]})]},e.id)})})]})}function gn({docs:e,route:t}){return e?e.status===`missing`?(0,V.jsx)(w,{title:`The docs need packages that are not installed`,hint:`Install them with: bun add -d ${e.packages.join(` `)}`}):e.status===`error`?(0,V.jsx)(w,{title:`The docs cannot be shown`,hint:e.message}):(0,V.jsx)(_n,{docs:e,route:t}):(0,V.jsx)(w,{title:`No documentation`,hint:`Set documentation: './docs' in brick() to show a folder of pages here`})}function _n({docs:e,route:t}){let n=Ce(e.revision),r=Te(e.components,e.revision),[i,a]=(0,B.useState)(),o=(0,B.useMemo)(()=>i?.toc??[],[i]),{path:s,anchor:c}=t,l=(0,B.useCallback)(()=>{if(s.length>0||!n)return;let e=mn(n.tree.children);e&&location.replace(C(e))},[s.length,n]);(0,B.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=y(`(min-width: 1024px)`),d=n?.tree.name??e.title,f=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(hn,{revision:e.revision}),n&&(0,V.jsx)(pn,{nodes:n.tree.children,current:s})]});return(0,V.jsxs)(`div`,{className:`flex min-h-[calc(100svh-3.5rem)]`,children:[u&&(0,V.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,V.jsx)(`div`,{className:`px-1 pt-1 text-sm font-semibold`,children:d}),f]}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[!u&&(0,V.jsxs)(`details`,{className:`border-b p-3`,children:[(0,V.jsxs)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:[d,`: pages and search`]}),(0,V.jsx)(`div`,{className:`mt-3 flex flex-col gap-3`,children:f})]}),(0,V.jsx)(`div`,{className:`mx-auto max-w-3xl px-6 py-10 max-sm:px-4`,children:(0,V.jsx)(cn,{path:s,revision:e.revision,project:r,onPage:a,onMissing:l})})]}),(0,V.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,V.jsx)(an,{headings:o,page:i?.path})})]})}export{gn as default};
4
+ }`})]})}function Xe(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 W=ie,G=ue;function Ze({children:e,className:t,...n}){return(0,V.jsx)(fe,{...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 Qe=p(`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 $e({className:e,...t}){return(0,V.jsx)(`div`,{className:N(`not-prose rounded-md border bg-fd-card p-2`,e),...t,children:t.children})}function et({name:e,icon:t=(0,V.jsx)(k,{}),className:n,...r}){return(0,V.jsxs)(`div`,{className:N(Qe({className:n})),...r,children:[t,e]})}function tt({name:e,defaultOpen:t=!1,...n}){let[r,i]=(0,B.useState)(t);return(0,V.jsxs)(W,{open:r,onOpenChange:i,...n,children:[(0,V.jsxs)(G,{className:N(Qe({className:`w-full`})),children:[r?(0,V.jsx)(ye,{}):(0,V.jsx)(xe,{}),e]}),(0,V.jsx)(Ze,{children:(0,V.jsx)(`div`,{className:`ms-2 flex flex-col border-l ps-2`,children:n.children})})]})}var nt=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 rt(e){return typeof Element>`u`?!1:e instanceof Element}var K=(e,t)=>rt(t)&&t.tagName.toUpperCase()===e,it=e=>K(`DIV`,e)||K(`SPAN`,e),q=e=>K(`IMG`,e),at=e=>e.complete&&e.naturalHeight!==0,J=e=>K(`SVG`,e),ot=e=>{if(e!==null)return q(e)?e.alt:e.getAttribute(`aria-label`)??void 0},st=/url(?:\(['"]?)(?<url>.*?)(?:['"]?\))/,ct=e=>{if(e!==null){if(q(e))return e.currentSrc===``?void 0:e.currentSrc;if(it(e)){let{backgroundImage:t}=window.getComputedStyle(e);if(t!==``)return st.exec(t)?.[1]}}},lt=e=>{if(e==null)return{};if(J(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}},ut=({height:e,offset:t,width:n})=>Math.min((window.innerWidth-t*2)/n,(window.innerHeight-t*2)/e),dt=({containerHeight:e,containerWidth:t,offset:n,targetHeight:r,targetWidth:i})=>{let a=ut({height:r,offset:n,width:i}),o=i>r?i/t:r/e;return a>1?o:a*o},ft=({containerHeight:e,containerWidth:t,hasScalableSrc:n,offset:r,targetHeight:i,targetWidth:a})=>e===0||t===0?1:!n&&i!==0&&a!==0?dt({containerHeight:e,containerWidth:t,offset:r,targetHeight:i,targetWidth:a}):ut({height:e,offset:r,width:t}),pt=({containerHeight:e,containerLeft:t,containerTop:n,containerWidth:r,hasScalableSrc:i,offset:a,targetHeight:o,targetWidth:s})=>{let c=ft({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})`}},Y=(e,t)=>{let n=parseFloat(e);return e.endsWith(`%`)?t*n/100:n},X=({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=Y(d,r-u),m=Y(f,e-l),h=ft({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})`}},mt=({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 X({...d,visibleWidth:l*i,visibleHeight:c*i})}if(u===`none`)return X({...d,visibleWidth:l,visibleHeight:c});{let a=r/l,o=e/c,u=Math.max(a,o),d=ft({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})`}}},ht=({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 X({...u,visibleWidth:l*i,visibleHeight:c*i})}if(t===`auto`)return X({...u,visibleWidth:l,visibleHeight:c});{let[e=`50%`,r=`50%`]=t.split(` `),i=Y(e,a),o=Y(r,n),s=i/l,d=o/c,f=Math.min(s,d);return X({...u,visibleWidth:l*f,visibleHeight:c*f})}},gt=({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}`},_t=({fallback:e,natural:t})=>t!==void 0&&t!==0?t:e,vt=/\.svg$/i,yt=({hasZoomImg:e,imgSrc:t,isSvg:n})=>n||t?.slice(0,18)===`data:image/svg+xml`||e||t!==void 0&&vt.test(t),bt=({hasZoomImg:e,imgSrc:t,isSvg:n,isZoomed:r,loadedImgEl:i,offset:a,shouldRefresh:o,targetEl:s})=>{let c=yt({hasZoomImg:e,imgSrc:t,isSvg:n}),l=s.getBoundingClientRect(),u=window.getComputedStyle(s),d=i!=null&&it(s),f=i!=null&&!d,p=_t({fallback:l.height,natural:i?.naturalHeight}),m=_t({fallback:l.width,natural:i?.naturalWidth}),{height:h,left:g,top:_,width:v}=l,y=d?ht({backgroundPosition:u.backgroundPosition,backgroundSize:u.backgroundSize,containerHeight:h,containerLeft:g,containerTop:_,containerWidth:v,hasScalableSrc:c,offset:a,targetHeight:p,targetWidth:m}):f?mt({containerHeight:h,containerLeft:g,containerTop:_,containerWidth:v,hasScalableSrc:c,objectFit:u.objectFit,objectPosition:u.objectPosition,offset:a,targetHeight:p,targetWidth:m}):pt({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:gt({...y,isZoomed:r,userTransform:u.transform})};return r&&o&&(b.transitionDuration=`0.01ms`),b},xt=e(l()),St=[`img`,`svg`,`[role="img"]`,`[data-zoom]`].map(e=>`${e}:not([aria-hidden="true"])`).join(`,`),Ct={overflow:``,width:``};function wt(){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 Tt(e){e.preventDefault()}function Et(e){return B.createElement(Dt,{...e})}var Dt=class extends B.Component{constructor(){super(...arguments),this.state={id:``,isZoomImgLoaded:!1,loadedImgEl:void 0,modalState:`UNLOADED`,shouldRefresh:!1,styleGhost:{}},this.refContent=B.createRef(),this.refDialog=B.createRef(),this.refModalContent=B.createRef(),this.refModalImg=B.createRef(),this.refWrap=B.createRef(),this.imgEl=null,this.isScaling=!1,this.prevBodyAttrs=Ct,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(St),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:lt(this.imgEl)}))}),this.imgElResizeObserver.observe(this.imgEl),this.contentChangeObserver??(this.contentChangeObserver=new MutationObserver(()=>{this.setState({styleGhost:lt(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=ct(this.imgEl);if(e==null||e===``)return;let t=new Image,{imgEl:n}=this;if(q(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:lt(this.imgEl)})};t.decode().then(r).catch(()=>{at(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||J(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=Ct},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(()=>{at(n)?r():n.onload=r})}},this.UNSAFE_handleSvg=()=>{let{imgEl:e,refModalImg:t,styleModalImg:n}=this;if(J(e)){let r=e.cloneNode(!0);nt(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=it(a),A=q(a),j=J(a),M=ot(a),N=ct(a),P=A?a.sizes:void 0,F=A?a.srcset:void 0,I=A?a.crossOrigin:void 0,ee=m?.src!==void 0&&m.src!==``,L=this.hasImage(),te=M!==void 0&&M!==``?`${s}: ${M}`:s,ne=w===`LOADING`||w===`LOADED`,re=L?`found`:`not-found`,ie=w===`UNLOADED`||w===`UNLOADING`?`hidden`:`visible`,R={visibility:w===`UNLOADED`?`visible`:`hidden`};this.styleModalImg=L&&a!==null?bt({hasZoomImg:ee,imgSrc:N,isSvg:j,isZoomed:ne,loadedImgEl:C,offset:h,shouldRefresh:T,targetEl:a}):{};let z=null;if(L){let t=A||k?B.createElement(`img`,{alt:M,crossOrigin:I,sizes:P,src:N,srcSet:F,...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?B.createElement(`div`,{"data-rmiz-modal-img":!0,onTransitionEnd:this.handleImgTransitionEnd,ref:y,style:this.styleModalImg}):null,n=B.createElement(`button`,{"aria-label":o,"data-rmiz-btn-unzoom":``,onClick:e,type:`button`},B.createElement(u,null));z=p==null?B.createElement(B.Fragment,null,t,n):B.createElement(p,{buttonUnzoom:n,modalState:w,img:t,isZoomImgLoaded:S,onUnzoom:r})}return B.createElement(f,{"data-rmiz":``,ref:b},B.createElement(f,{"data-rmiz-content":re,ref:g,style:R},c),L&&B.createElement(f,{"data-rmiz-ghost":``,style:E},B.createElement(`button`,{"aria-label":te,"data-rmiz-btn-zoom":``,onClick:i,type:`button`},B.createElement(d,null))),L&&xt.createPortal(B.createElement(`dialog`,{"aria-labelledby":O,"aria-modal":`true`,className:l,"data-rmiz-modal":``,id:D,onClick:t,onClose:n,onCancel:Tt,ref:_,role:`dialog`},B.createElement(`div`,{"data-rmiz-modal-overlay":ie}),B.createElement(`div`,{"data-rmiz-modal-content":``,ref:v},z)),wt()))}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)}};Dt.defaultProps={a11yNameButtonUnzoom:`Minimize image`,a11yNameButtonZoom:`Expand image`,canSwipeToUnzoom:!0,IconUnzoom:Ot,IconZoom:kt,isDisabled:!1,swipeToUnzoomThreshold:10,wrapElement:`div`,zoomMargin:0};function Ot(){return B.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`},B.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 kt(){return B.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`},B.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 At({onZoomChange:e,...t}){let[n,r]=B.useState(!1),i=B.useCallback((t,{event:n})=>{r(t),e?.(t,{event:n})},[e]);return B.createElement(Et,{...t,isZoomed:n,onZoomChange:i})}var jt=(0,B.createContext)(null);function Mt(e){return typeof e==`string`?e:typeof e==`object`?`default`in e?e.default.src:e.src:``}function Nt({zoomInProps:e,children:t,rmiz:n,caption:r,...i}){let a=(0,B.use)(jt),o={src:Mt(i.src),sizes:void 0,...e},s=t??(0,V.jsx)(j,{sizes:`(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px`,...i});return a?(0,V.jsx)(`span`,{role:`button`,tabIndex:0,"aria-haspopup":`dialog`,ref:e=>{if(e)return a.register({element:e,image:{alt:i.alt,...o},caption:r??i.title})},onClick:e=>{e.target!==e.currentTarget&&a.open(e.currentTarget)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a.open(e.currentTarget))},className:`block outline-none [&_img]:cursor-zoom-in [&:focus-visible_img]:ring-2 [&:focus-visible_img]:ring-fd-ring`,children:s}):(0,V.jsx)(At,{zoomMargin:20,wrapElement:`span`,...n,zoomImg:o,children:s})}function Pt({items:e,className:t,...n}){let r=M({note:`inline table of contents`});return(0,V.jsxs)(W,{...n,className:e=>N(`not-prose rounded-lg border bg-fd-card text-fd-card-foreground`,typeof t==`function`?t(e):t),children:[(0,V.jsxs)(G,{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,V.jsx)(ge,{className:`size-4 transition-transform duration-200 group-data-open:rotate-180`})]}),(0,V.jsx)(Ze,{children:(0,V.jsx)(`div`,{className:`flex flex-col p-4 pt-0 text-sm text-fd-muted-foreground`,children:e.map(e=>(0,V.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 Ft({children:e}){return(0,V.jsx)(`div`,{className:`fd-steps`,children:e})}function It({children:e}){return(0,V.jsx)(`div`,{className:`fd-step`,children:e})}var Lt=(0,B.createContext)(null);function Rt(){let e=(0,B.useContext)(Lt);if(!e)throw Error(`You must wrap your component in <Tabs>`);return e}function zt({className:e,...t}){return(0,V.jsx)(re,{...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 Bt({className:e,...t}){return(0,V.jsx)(ne,{...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 Vt({ref:e,className:t,items:n,label:r,defaultIndex:i=0,defaultValue:a=n?Gt(n[i]):void 0,...o}){let s=(0,B.useMemo)(()=>[],[]);return(0,V.jsxs)(le,{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,V.jsxs)(zt,{children:[r&&(0,V.jsx)(`span`,{className:`text-sm font-medium my-auto me-auto`,children:r}),n.map(e=>(0,V.jsx)(Bt,{value:Gt(e),children:e},e))]}),(0,V.jsx)(Lt.Provider,{value:(0,B.useMemo)(()=>({items:n,collection:s}),[s,n]),children:o.children})]})}function Ht({value:e,...t}){let{items:n}=Rt(),r=e??n?.at(Wt());if(!r)throw Error("Failed to resolve tab `value`, please pass a `value` prop to the Tab component.");return(0,V.jsx)(Ut,{value:Gt(r),...t,children:t.children})}function Ut({value:e,className:t,...n}){return(0,V.jsx)(oe,{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 Wt(){let e=(0,B.useId)(),{collection:t}=Rt();return(0,B.useEffect)(()=>()=>{let n=t.indexOf(e);n!==-1&&t.splice(n,1)},[e,t]),t.includes(e)||t.push(e),t.indexOf(e)}function Gt(e){return e.toLowerCase().replace(/\s+/g,`-`)}var Z=p(`text-fd-muted-foreground not-prose pe-2`);function Kt({id:e,type:t,className:n,...r}){let i=M({note:`type table`});return(0,V.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,V.jsxs)(`div`,{className:`flex font-medium items-center px-3 py-1 not-prose text-fd-muted-foreground`,children:[(0,V.jsx)(`p`,{className:`w-1/4`,children:i(`Prop`)}),(0,V.jsx)(`p`,{className:`@max-xl:hidden`,children:i(`Type`)})]}),Object.entries(t).map(([t,n])=>(0,V.jsx)(qt,{parentId:e,name:t,item:n},t))]})}function qt({parentId:e,name:t,item:{parameters:n=[],description:r,required:i=!1,deprecated:a,typeDescription:o,default:s,type:c,typeDescriptionLink:l,returns:u}}){let d=M({note:`type table`}),[f,p]=(0,B.useState)(!1),m=e?`${e}-${t}`:void 0;return(0,B.useEffect)(()=>{let e=me();m&&e&&m===e&&p(!0)},[m]),(0,V.jsxs)(W,{id:m,open:f,onOpenChange:e=>{e&&m&&window.history.replaceState(null,``,`#${m}`),p(e)},className:N(`rounded-xl border overflow-hidden scroll-m-20 transition-all`,f?`shadow-sm bg-fd-background not-last:mb-2`:`border-transparent`),children:[(0,V.jsxs)(G,{className:`relative flex flex-row items-center w-full group text-start px-3 py-2 not-prose hover:bg-fd-accent`,children:[(0,V.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&&`?`]}),l?(0,V.jsx)(A,{href:l,className:`underline @max-xl:hidden`,children:c}):(0,V.jsx)(`span`,{className:`@max-xl:hidden`,children:c}),(0,V.jsx)(ge,{className:`absolute inset-e-2 size-4 text-fd-muted-foreground transition-transform group-data-[open]:rotate-180`})]}),(0,V.jsx)(Ze,{children:(0,V.jsxs)(`div`,{className:`grid grid-cols-[1fr_3fr] gap-y-4 text-sm p-3 overflow-auto fd-scroll-container border-t`,children:[(0,V.jsx)(`div`,{className:`prose prose-sm col-span-full prose-no-margin empty:hidden`,children:r}),o&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:N(Z()),children:d(`Type`)}),(0,V.jsx)(`p`,{className:`my-auto not-prose`,children:o})]}),s&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:N(Z()),children:d(`Default`)}),(0,V.jsx)(`p`,{className:`my-auto not-prose`,children:s})]}),n.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:N(Z()),children:d(`Parameters`)}),(0,V.jsx)(`div`,{className:`flex flex-col gap-2`,children:n.map(e=>(0,V.jsxs)(`div`,{className:`inline-flex items-center flex-wrap gap-1`,children:[(0,V.jsxs)(`p`,{className:`font-medium not-prose text-nowrap`,children:[e.name,` -`]}),(0,V.jsx)(`div`,{className:`prose prose-sm prose-no-margin`,children:e.description})]},e.name))})]}),u&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:N(Z()),children:d(`Returns`)}),(0,V.jsx)(`div`,{className:`my-auto prose prose-sm prose-no-margin`,children:u})]})]})})]})}var Jt=(0,B.createContext)([]);function Yt(e){let t=(0,B.useContext)(Jt);return(0,V.jsx)(Pt,{items:t,...e})}function Xt({code:e,title:t}){return(0,V.jsx)(L,{title:t,children:(0,V.jsx)(te,{children:(0,V.jsx)(`code`,{children:e})})})}function Zt(e){return()=>(0,V.jsx)(R,{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 Qt(e={}){return{...pe,img:e=>(0,V.jsx)(Nt,{...e}),Callout:R,Tabs:Vt,Tab:Ht,Steps:Ft,Step:It,Accordions:We,Accordion:Ge,Files:$e,File:et,Folder:tt,TypeTable:Kt,Banner:qe,InlineTOC:Yt,DynamicCodeBlock:Xt,AutoTypeTable:Zt(`AutoTypeTable`),GithubInfo:Zt(`GithubInfo`),GraphView:Zt(`GraphView`),...e}}function $t(e){return Function(e)({Fragment:B.Fragment,jsx:V.jsx,jsxs:V.jsxs}).default}var en=class extends B.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,V.jsx)(R,{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 tn(e){document.getElementById(e)?.scrollIntoView({block:`start`})}function nn(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{}tn(n)}function rn(e,t){let[n,r]=(0,B.useState)();return(0,B.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 an({headings:e,page:t}){let n=rn(e,t);return e.length===0?null:(0,V.jsxs)(`nav`,{"aria-label":`On this page`,className:`flex flex-col gap-0.5 text-sm`,children:[(0,V.jsx)(`div`,{className:`mb-1.5 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:`On this page`}),e.map(e=>(0,V.jsx)(`a`,{href:e.url,onClick:nn,"aria-current":e.url.slice(1)===n?`location`:void 0,style:{paddingLeft:`${Math.max(e.depth-2,0)*12+8}px`},className:y(`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 on({page:e,project:t}){let n=(0,B.useMemo)(()=>Qt(t?.components),[t]),r=(0,B.useMemo)(()=>{try{return{Page:$t(e.code)}}catch(e){return{error:e instanceof Error?e.message:String(e)}}},[e.code]);if(`error`in r)return(0,V.jsx)(R,{type:`error`,title:`This page could not run`,children:r.error});let{Page:i}=r;return(0,V.jsx)(Jt.Provider,{value:e.toc,children:(0,V.jsx)(en,{reset:[e.code,n],children:(0,V.jsx)(i,{components:n})})})}function sn({page:e,project:t}){return(0,V.jsxs)(`article`,{onClick:nn,className:`min-w-0`,children:[(0,V.jsx)(`h1`,{className:`text-3xl font-semibold tracking-tight`,children:e.title}),e.description&&(0,V.jsx)(`p`,{className:`mt-2 mb-8 text-base text-muted-foreground`,children:e.description}),t?.error&&(0,V.jsx)(R,{type:`warn`,title:`Your components did not load`,children:t.error}),e.error?(0,V.jsx)(R,{type:`error`,title:`${e.path} does not compile`,children:(0,V.jsx)(`pre`,{className:`font-mono text-xs whitespace-pre-wrap`,children:e.error})}):(0,V.jsx)(`div`,{className:`prose max-w-none`,children:(0,V.jsx)(on,{page:e,project:t})})]})}function cn({path:e,revision:t,project:n,onPage:r,onMissing:i}){let a=we(e,t),o=a.status===`ready`?a.page:void 0;return(0,B.useEffect)(()=>r(o),[o,r]),(0,B.useEffect)(()=>{a.status===`missing`&&i()},[a.status,i]),a.status===`loading`||a.status===`ready`&&!n?(0,V.jsx)(x,{title:`Loading page`}):a.status===`missing`?(0,V.jsx)(x,{title:`No such page`,hint:`There is no page at /${e.join(`/`)}`}):a.status===`failed`?(0,V.jsx)(R,{type:`error`,title:`The page could not be loaded`,children:a.message}):(0,V.jsx)(sn,{page:a.page,project:n})}function Q(e){return e.split(`/`).filter(Boolean)}var $=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),ln=(e,t)=>e.type===`page`?$(Q(e.url),t):e.type===`folder`?(e.index?$(Q(e.index.url),t):!1)||e.children.some(e=>ln(e,t)):!1,un=`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 dn({node:e,current:t,depth:n}){let r=ln(e,t),[i,a]=(0,B.useState)(),o=i??(r||e.defaultOpen===!0);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`flex items-center`,children:[e.index?(0,V.jsx)(`a`,{href:T(Q(e.index.url)),"aria-current":$(Q(e.index.url),t)?`page`:void 0,className:y(un,`flex-1 font-medium text-foreground`),children:e.name}):(0,V.jsx)(`button`,{type:`button`,onClick:()=>a(!o),className:y(un,`flex-1 cursor-pointer text-left font-medium text-foreground`),children:e.name}),(0,V.jsx)(`button`,{type:`button`,"aria-label":`${o?`Collapse`:`Expand`} ${e.name}`,"aria-expanded":o,onClick:()=>a(!o),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,V.jsx)(P,{className:y(`size-3.5 transition-transform`,o&&`rotate-90`)})})]}),o&&(0,V.jsx)(`div`,{className:`ml-2 border-l pl-1.5`,children:(0,V.jsx)(fn,{nodes:e.children,current:t,depth:n+1})})]})}function fn({nodes:e,current:t,depth:n}){return(0,V.jsx)(V.Fragment,{children:e.map((e,r)=>e.type===`separator`?(0,V.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,V.jsx)(dn,{node:e,current:t,depth:n},`folder-${e.name}-${r}`):(0,V.jsx)(`a`,{href:T(Q(e.url)),"aria-current":$(Q(e.url),t)?`page`:void 0,className:un,children:e.name},e.url))})}function pn({nodes:e,current:t}){return(0,V.jsx)(`nav`,{"aria-label":`Docs pages`,className:`flex flex-col gap-0.5`,children:(0,V.jsx)(fn,{nodes:e,current:t,depth:0})})}function mn(e){for(let t of e){if(t.type===`page`)return Q(t.url);if(t.type===`folder`){if(t.index)return Q(t.index.url);let e=mn(t.children);if(e)return e}}}function hn({revision:e}){let[t,n]=(0,B.useState)(``),[r,i]=(0,B.useState)([]);return(0,B.useEffect)(()=>{if(!t.trim()){i([]);return}let e=new AbortController,n=setTimeout(()=>{fetch(S(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,V.jsxs)(`div`,{className:`relative`,children:[(0,V.jsx)(he,{className:`pointer-events-none absolute top-2.5 left-2.5 size-3.5 text-muted-foreground`}),(0,V.jsx)(b,{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,V.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,V.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,V.jsxs)(`a`,{role:`option`,"aria-selected":!1,href:T(Q(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,V.jsx)(`span`,{className:e.type===`page`?`font-medium`:`truncate`,children:e.content}),(0,V.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[e.type===`page`?`Page`:e.type===`heading`?`Heading`:`Text`,` · `,e.url]})]},e.id)})})]})}function gn({docs:e,route:t}){return e?e.status===`missing`?(0,V.jsx)(x,{title:`The docs need packages that are not installed`,hint:`Install them with: bun add -d ${e.packages.join(` `)}`}):e.status===`error`?(0,V.jsx)(x,{title:`The docs cannot be shown`,hint:e.message}):(0,V.jsx)(_n,{docs:e,route:t}):(0,V.jsx)(x,{title:`No documentation`,hint:`Set documentation: './docs' in brick() to show a folder of pages here`})}function _n({docs:e,route:t}){let n=Ce(e.revision),r=Te(e.components,e.revision),[i,a]=(0,B.useState)(),o=(0,B.useMemo)(()=>i?.toc??[],[i]),{path:s,anchor:c}=t,l=(0,B.useCallback)(()=>{if(s.length>0||!n)return;let e=mn(n.tree.children);e&&location.replace(T(e))},[s.length,n]);(0,B.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=C(`(min-width: 1024px)`),d=n?.tree.name??e.title,f=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(hn,{revision:e.revision}),n&&(0,V.jsx)(pn,{nodes:n.tree.children,current:s})]});return(0,V.jsxs)(`div`,{className:`flex min-h-[calc(100svh-3.5rem)]`,children:[u&&(0,V.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,V.jsx)(`div`,{className:`px-1 pt-1 text-sm font-semibold`,children:d}),f]}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[!u&&(0,V.jsxs)(`details`,{className:`border-b p-3`,children:[(0,V.jsxs)(`summary`,{className:`cursor-pointer text-sm font-medium`,children:[d,`: pages and search`]}),(0,V.jsx)(`div`,{className:`mt-3 flex flex-col gap-3`,children:f})]}),(0,V.jsx)(`div`,{className:`mx-auto max-w-3xl px-6 py-10 max-sm:px-4`,children:(0,V.jsx)(cn,{path:s,revision:e.revision,project:r,onPage:a,onMissing:l})})]}),(0,V.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,V.jsx)(an,{headings:o,page:i?.path})})]})}export{gn as default};
@@ -1 +1 @@
1
- export{St as Badge,bt as Button,S as Card,C as CardAction,w as CardContent,T as CardDescription,E as CardFooter,D as CardHeader,O as CardTitle,o as Checkbox,k as Empty,b as Input,vt as Kbd,yt as KbdGroup,i as Metric,A as PageHeader,x as Panel,t as Popover,n as PopoverContent,r as PopoverTrigger,_t as Separator,a as SparkBars,s as Table,c as TableBody,l as TableCaption,u as TableCell,d as TableFooter,f as TableHead,p as TableHeader,m as TableRow,_ as Toggle,h as ToggleGroup,g as ToggleGroupItem,ft as Tooltip,pt as TooltipContent,mt as TooltipProvider,ht as TooltipTrigger,I as appFetch,Ct as badgeVariants,xt as buttonVariants,wt as cn,L as createAppClient,U as defineDashboard,v as toggleVariants,z as useAppFetch,B as useAppQuery,V as useArchitecture,H as useRequests}from"./popover-Da7zBKDq.js";
1
+ export{Wn as Badge,Hn as Button,I as Card,L as CardAction,R as CardContent,z as CardDescription,B as CardFooter,V as CardHeader,H as CardTitle,v as Checkbox,U as Empty,N as Input,Bn as Kbd,Vn as KbdGroup,g as Metric,W as PageHeader,F as Panel,t as Popover,n as PopoverContent,r as PopoverTrigger,zn as Separator,_ as SparkBars,y as Table,b as TableBody,x as TableCaption,S as TableCell,C as TableFooter,w as TableHead,T as TableHeader,E as TableRow,k as Toggle,D as ToggleGroup,O as ToggleGroupItem,Et as Tooltip,Dt as TooltipContent,Ot as TooltipProvider,kt as TooltipTrigger,X as appFetch,Gn as badgeVariants,Un as buttonVariants,Kn as cn,Z as createAppClient,rt as defineDashboard,A as toggleVariants,$ as useAppFetch,et as useAppQuery,tt as useArchitecture,nt as useRequests}from"./popover-CVY1eRNY.js";