1import{R as e,p as r,a as t,B as s,H as n,J as a}from"./chunk-6CSD65Y2-xYubHBmU.js";import{dJ as o,dK as l,a4 as i,a3 as c,q as d,ac as u,ad as m,ae as h,ag as x,bl as p,W as f,b5 as g,bn as b,dL as j,ay as v,h as y,dM as N,bA as w,cf as k,d2 as C,dN as R,a7 as S,d0 as A,dO as E,A as L,cE as T,bi as I,dP as _,b as D,ao as O,a1 as $,dQ as B,a8 as q,I as M,B as P,g as F,dR as K,cA as z,bv as W,bw as U,bx as V,by as Q,bU as H}from"./CoreLayout-V9PVLCM0.js";import{U as G,P as J}from"./USTALogo-P-ie0qNe.js";import{W as Y}from"./WorkspaceMenu-DuxeUjKB.js";import{S as Z}from"./skeleton-HiKLIgRk.js";import{j as X,m as ee,i as re,c as te,d as se,s as ne,X as ae}from"./overlayFocus-BmDVzTk_.js";import{u as oe}from"./index-BcwKVuK3.js";import{R as le,T as ie,c as ce,d as de,C as ue,a as me,b as he}from"./collapsible-BnskTiB4.js";import{C as xe}from"./card-C2UeeBp1.js";import{I as pe,G as fe}from"./voiceStore-D_K9cjIr.js";import{M as ge}from"./user-BccZgP0Q.js";import{M as be,r as je}from"./index-exbxqtqy.js";import{b as ve}from"./useDebounce-B9SwkRXs.js";import{m as ye}from"./inputModality-CmrdtIiD.js";import"./createLucideIcon-B7UGDY3i.js";import"./loader-circle-Mux4UJzI.js";import"./index-BfJR_dAR.js";import"./AdminRoute-YaPmKRZJ.js";import"./AuthContextDefinition-CrUuQ85U.js";var Ne="Accordion",we=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ke,Ce,Re]=o(Ne),[Se]=se(Ne,[Re,de]),Ae=de(),Ee=e.forwardRef((e,t)=>{const{type:s,...n}=e,a=n,o=n;return r.jsx(ke.Provider,{scope:e.__scopeAccordion,children:"multiple"===s?r.jsx(Oe,{...o,ref:t}):r.jsx(De,{...a,ref:t})})});Ee.displayName=Ne;var[Le,Te]=Se(Ne),[Ie,_e]=Se(Ne,{collapsible:!1}),De=e.forwardRef((t,s)=>{const{value:n,defaultValue:a,onValueChange:o=()=>{},collapsible:l=!1,...i}=t,[c,d]=X({prop:n,defaultProp:a??"",onChange:o,caller:Ne});return r.jsx(Le,{scope:t.__scopeAccordion,value:e.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:e.useCallback(()=>l&&d(""),[l,d]),children:r.jsx(Ie,{scope:t.__scopeAccordion,collapsible:l,children:r.jsx(qe,{...i,ref:s})})})}),Oe=e.forwardRef((t,s)=>{const{value:n,defaultValue:a,onValueChange:o=()=>{},...l}
1=t,[i,c]=X({prop:n,defaultProp:a??[],onChange:o,caller:Ne}),d=e.useCallback(e=>c((r=[])=>[...r,e]),[c]),u=e.useCallback(e=>c((r=[])=>r.filter(r=>r!==e)),[c]);return r.jsx(Le,{scope:t.__scopeAccordion,value:i,onItemOpen:d,onItemClose:u,children:r.jsx(Ie,{scope:t.__scopeAccordion,collapsible:!0,children:r.jsx(qe,{...l,ref:s})})})}),[$e,Be]=Se(Ne),qe=e.forwardRef((t,s)=>{const{__scopeAccordion:n,disabled:a,dir:o,orientation:i="vertical",...c}=t,d=e.useRef(null),u=oe(d,s),m=Ce(n),h="ltr"===l(o),x=te(t.onKeyDown,e=>{if(!we.includes(e.key))return;const r=e.target,t=m().filter(e=>!e.ref.current?.disabled),s=t.findIndex(e=>e.ref.current===r),n=t.length;if(-1===s)return;e.preventDefault();let a=s;const o=n-1,l=()=>{a=s+1,a>o&&(a=0)},c=()=>{a=s-1,a<0&&(a=o)};switch(e.key){case"Home":a=0;break;case"End":a=o;break;case"ArrowRight":"horizontal"===i&&(h?l():c());break;case"ArrowDown":"vertical"===i&&l();break;case"ArrowLeft":"horizontal"===i&&(h?c():l());break;case"ArrowUp":"vertical"===i&&c()}const d=a%n;t[d].ref.current?.focus()});return r.jsx($e,{scope:n,disabled:a,direction:o,orientation:i,children:r.jsx(ke.Slot,{scope:n,children:r.jsx(re.div,{...c,"data-orientation":i,ref:u,onKeyDown:a?void 0:x})})})}),Me="AccordionItem",[Pe,Fe]=Se(Me),Ke=e.forwardRef((e,t)=>{const{__scopeAccordion:s,value:n,...a}=e,o=Be(Me,s),l=Te(Me,s),i=Ae(s),c=ee(),d=n&&l.value.includes(n)||!1,u=o.disabled||e.disabled;return r.jsx(Pe,{scope:s,open:d,disabled:u,triggerId:c,children:r.jsx(le,{"data-orientation":o.orientation,"data-state":Ge(d),...i,...a,ref:t,disabled:u,open:d,onOpenChange:e=>{e?l.onItemOpen(n):l.onItemClose(n)}})})});Ke.displayName=Me;var ze="AccordionHeader",We=e.forwardRef((e,t)=>{const{__scopeAccordion:s,...n}=e,a=Be(Ne,s),o=Fe(ze,s);return r.jsx(re.h3,{"data-orientation":a.orientation,"data-state":Ge(o.open),"data-disabled":o.disabled?"":void 0,...n,ref:t})});We.displayName=ze;var Ue="AccordionTrigger",Ve=e.forwardRef((e,t)=>{const{__scopeAccordion:s,...n}=e,a=Be(Ne,s),o=Fe(Ue,s),l=_e(Ue,s),i=Ae(s);return r.jsx(ke.ItemSlot,{scope:s,children:r.jsx(ie,{"aria-disabled":o.open&&!l.collapsible||void 0,"data-orientation":a.orientation,id:o.triggerId,...i,...n,ref:t})})});Ve.displayName=Ue;var Qe="AccordionContent",He=e.forwardRef((e,t)=>{const{__scopeAccordion:s,...n}=e,a=Be(Ne,s),o=Fe(Qe,s),l=Ae(s);return r.jsx(ce,{role:"region","aria-labelledby":o.triggerId,"data-orientation":a.orientation,...l,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});function Ge(e){return e?"open":"closed"}He.displayName=Qe;var Je=Ke,Ye=We,Ze=Ve,Xe=He;const er=Ee,rr=t.forwardRef(({className:e,...t},s)=>r.jsx(Je,{ref:s,className:i("border-b border-border",e),...t}));rr.displayName="AccordionItem";const tr=t.forwardRef(({className:e,children:t,...s},n)=>r.jsx(Ye,{className:"flex",children:r.jsxs(Ze,{ref:n,className:i("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...s,children:[t,r.jsx(c,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));tr.displayName=Ze.displayName;const sr=t.forwardRef(({className:e,children:t,...s},n)=>r.jsx(Xe,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...s,children:r.jsx("div",{className:i("pb-4 pt-0",e),children:t})}));sr.displayName=Xe.displayName;const nr={Activity:L,Blocks:E,BookOpen:A,Bot:S,Compass:R,GitMerge:C,KeyRound:k,LayoutDashboard:w,LifeBuoy:N,Mail:ge,Play:y,Plug:v,Rocket:j,Settings:pe,ShieldCheck:b,Timer:g,Workflow:f,Zap:p},ar={cards:e=>e.every(or)?r.jsx(lr,{entries:e}):null,steps:(e,t)=>e.every(or)?r.jsx(ir,{entries:e,render:t}):null,tabs:(e,t)=>e.every(e=>"string"==typeof e?.label)?r.jsx(cr,{entries:e,render:t}):null,accordion:(e,t)=>e.every(or)?r.jsx(dr,{entries:e,render:t}):null,properties:(e,t)=>e.every(e=>"string"==typeof e?.name)?r.jsx(ur,{entries:e,render:t}):null};function or(e){return"string"==typeof e?.title}function lr({entries:e}){return r.jsx("div",{className:"mt-6 grid gap-3 sm:grid-cols-2",children:e.map(e=>{const t=e.icon?nr[e.icon]:void 0,n=r.jsx(xe,{className:i("group h-full border-[hsl(var(--border))] p-4 shadow-none transition-colors",e.href&&"hover:border-[hsl(var(--muted-foreground)/0.5)] hover:bg-[hsl(var(--muted)/0.5)]"),children:r.jsxs("div",{className:"flex items-start gap-3",children:[t&&r.jsx("span",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.6)]",children:r.jsx(t,{className:"h-4 w-4 text-foreground","aria-hidden":"true"})}),r.jsxs("div",{className:"min-w-0",children:[r.jsxs("p",{className:"flex items-center gap-1.5 text-sm font-semibold text-foreground",children:[e.title,e.href&&r.jsx(T,{"aria-hidden":"true",className:"h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform group-hover:translate-x-0.5"})]}),e.description&&r.jsx("p",{className:"mt-1 text-[13px] leading-6 text-muted-foreground",children:e.description})]})]})});return e.href?r.jsx(s,{to:e.href,className:"no-underline",children:n},e.title):r.jsx("div",{children:n},e.title)})})}function ir({entries:e,render:t}){return r.jsx("ol",{className:"mt-6 space-y-0",children:e.map((s,n)=>r.jsxs("li",{className:"relative flex gap-4 pb-6 last:pb-0",children:[n<e.length-1&&r.jsx("span",{"aria-hidden":"true",className:"absolute left-[13px] top-8 bottom-0 w-px bg-[hsl(var(--border))]"}),r.jsx("span",{className:"relative z-10 flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-[hsl(var(--border))] bg-[hsl(var(--background))] text-xs font-semibold text-foreground",children:n+1}),r.jsxs("div",{className:"min-w-0 flex-1 pt-0.5",children:[r.jsx("p",{className:"text-sm font-semibold text-foreground",children:s.title}),s.content&&r.jsx("div",{className:"mt-1 text-[15px] [&>*:first-child]:mt-0",children:t(s.content)})]})]},s.title))})}function cr({entries:e,render:s}){const n=t.useId();return r.jsxs(u,{defaultValue:`${n}-0`,className:"mt-6",children:[r.jsx(m,{children:e.map((e,t)=>r.jsx(h,{value:`${n}-${t}`,children:e.label},e.label))}),e.map((e,t)=>r.jsx(x,{value:`${n}-${t}`,children:r.jsx("div",{className:"text-[15px] [&>*:first-child]:mt-0",children:s(e.content??"")})},e.label))]})}function dr({entries:e,render:t}){return r.jsx(er,{type:"single",collapsible:!0,className:"mt-6 rounded-lg border border-[hsl(var(--border))] px-4",children:e.map((e,s)=>r.jsxs(rr,{value:`item-${s}`,className:"last:border-b-0",children:[r.jsx(tr,{className:"text-left text-sm hover:no-underline",children:e.title}),r.jsx(sr,{className:"text-[15px] [&>*:first-child]:mt-0",children:t(e.content??"")})]},e.title))})}function ur({entries:e,render:t}){return r.jsx("dl",{className:"mt-6 divide-y divide-[hsl(var(--border))] rounded-lg border border-[hsl(var(--border))]",children:e.map(e=>r.jsxs("div",{className:"px-4 py-3",children:[r.jsxs("dt",{className:"flex flex-wrap items-center gap-2",children:[r.jsx("code",{className:"rounded border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.7)] px-1.5 py-0.5 font-mono text-[13px] font-medium text-foreground",children:e.name}),e.type&&r.jsx(d,{variant:"secondaryStatic",size:"xq",className:"font-mono",children:e.type}),e.required?r.jsx(d,{variant:"outline",size:"xq",className:"border-[hsl(var(--border))]",children:"Required"}):r.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Optional"}),e.default&&r.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["Default: ",r.jsx("code",{className:"font-mono",children:e.default})]})]}),e.description&&r.jsx("dd",{className:"mt-1 text-[14px] leading-6 text-[hsl(var(--foreground)/0.85)] [&>*:first-child]:mt-0",children:t(e.description)})]},e.name))})}function mr(e){return e.trim().toLowerCase().replace(/[`*_~]/g,"").replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}const hr={note:{label:"Note",icon:$,wrapper:"border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.5)]",accent:"text-foreground"},tip:{label:"Tip",icon:O,wrapper:"border-[hsl(var(--accent-emerald))] bg-[hsl(var(--accent-emerald)/0.35)]",accent:"text-emerald-800 dark:text-[hsl(var(--accent-emerald-foreground))]"},important:{label:"Important",icon:I,wrapper:"border-[hsl(var(--accent-indigo))] bg-[hsl(var(--accent-indigo)/0.35)]",accent:"text-[hsl(var(--accent-indigo-foreground))]"},warning:{label:"Warning",icon:D,wrapper:"border-[hsl(var(--accent-amber))] bg-[hsl(var(--accent-amber)/0.35)]",accent:"text-[hsl(var(--accent-amber-foreground))]"},caution:{label:"Caution",icon:_,wrapper:"border-[hsl(var(--destructive)/0.4)] bg-[hsl(var(--destructive)/0.08)]",accent:"text-[hsl(var(--accent-red-foreground))]"}};function xr(e){return null==e||"boolean"==typeof e?"":"string"==typeof e||"number"==typeof e?String(e):Array.isArray(e)?e.map(xr).join(""):"object"==typeof e&&"props"in e?xr(e.props?.children):""}function pr({level:e,children:t,className:s}){const n=xr(t),a=mr(n),o=`h${e}`;return r.jsx(o,{id:a,className:i("group scroll-mt-24",s),children:r.jsxs("a",{href:`#${a}`,className:"no-underline text-inherit","aria-label":`Link to section: ${n}`,children:[t,r.jsx(I,{"aria-hidden":"true",className:"ml-2 inline h-3.5 w-3.5 -translate-y-
1px text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100"})]})})}function fr({kind:e,children:t}){const s=hr[e],n=s.icon;return r.jsxs("div",{className:i("my-6 rounded-lg border px-4 py-3",s.wrapper),children:[r.jsxs("p",{className:i("mb-1 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide",s.accent),children:[r.jsx(n,{className:"h-4 w-4","aria-hidden":"true"}),s.label]}),r.jsx("div",{className:"text-sm leading-6 text-foreground [&>p]:mt-0 [&>p+p]:mt-3",children:t})]})}const gr={h1:({children:e})=>r.jsx("h1",{className:"mb-3 text-[2rem] font-semibold leading-tight tracking-tight text-foreground",children:e}),h2:({children:e})=>r.jsx(pr,{level:2,className:"mt-12 border-t border-[hsl(var(--border))] pt-8 text-xl font-semibold tracking-tight text-foreground first:mt-0 first:border-0 first:pt-0",children:e}),h3:({children:e})=>r.jsx(pr,{level:3,className:"mt-8 text-base font-semibold tracking-tight text-foreground",children:e}),h4:({children:e})=>r.jsx("h4",{className:"mt-6 text-sm font-semibold uppercase tracking-wide text-muted-foreground",children:e}),p:({children:e})=>r.jsx("p",{className:"mt-4 max-w-[56ch] leading-7 text-[hsl(var(--foreground)/0.85)]",children:e}),ul:({children:e})=>r.jsx("ul",{className:"mt-4 space-y-2 pl-5 [&>li]:list-disc [&>li]:marker:text-muted-foreground",children:e}),ol:({children:e})=>r.jsx("ol",{className:"mt-4 space-y-2 pl-5 [&>li]:list-decimal [&>li]:marker:text-muted-foreground",children:e}),li:({children:e})=>r.jsx("li",{className:"max-w-[56ch] leading-7 text-[hsl(var(--foreground)/0.85)] [&>ul]:mt-2 [&>ol]:mt-2",children:e}),a:function({href:e,children:t,...n}){const a="font-medium text-foreground underline decoration-[hsl(var(--border))] decoration-2 underline-offset-4 transition-colors hover:decoration-[hsl(var(--foreground))]";return e&&e.startsWith("/")?r.jsx(s,{to:e,className:a,children:t}):r.jsx("a",{href:e,className:a,target:e?.startsWith("#")?void 0:"_blank",rel:e?.startsWith("#")?void 0:"noreferrer noopener",...n,children:t})},blockquote:function({children:e}){const s=t.Children.toArray(e),n=s.find(t.isValidElement),a=n?t.Children.toArray(n.props.children):[],o="string"==typeof a[0]?a[0]:"",l=/^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*/i.exec(o);return n&&l?(a[0]=o.slice(l[0].length),r.jsx(fr,{kind:l[1].toLowerCase(),children:s.map(e=>e===n?t.cloneElement(n,void 0,a):e)})):r.jsx("blockquote",{className:"my-6 border-l-2 border-[hsl(var(--border))] pl-4 text-muted-foreground italic",children:e})},hr:()=>r.jsx("hr",{className:"my-10 border-[hsl(var(--border))]"}),strong:({children:e})=>r.jsx("strong",{className:"font-semibold text-foreground",children:e}),table:({children:e})=>r.jsx("div",{className:"mt-6 min-w-0 overflow-x-auto",children:r.jsx("table",{className:"w-full border-collapse border-y border-[hsl(var(--border))] text-sm tabular-nums [&>tbody>tr:last-child>td]:border-b-0",children:e})}),th:({children:e,style:t,align:s})=>r.jsx("th",{style:t,align:s,className:"border-b border-[hsl(var(--border))] px-3 py-2 text-left align-bottom text-xs font-semibold text-foreground [&_code]:whitespace-nowrap [&_p]:m-0",children:e}),td:({children:e,style:t,align:s})=>r.jsx("td",{style:t,align:s,className:"border-b border-[hsl(var(--border))] px-3 py-2 align-top text-[hsl(var(--foreground)/0.85)] [&_code]:whitespace-nowrap [&_p]:m-0",children:e}),pre:({children:e})=>{const t=function(e){const r=Array.isArray(e)?e[0]:e;if(!r||"object"!=typeof r||!("props"in r))return null;const t=r.props,s=/language-([\w-]+)/.exec(t?.className??"")?.[1];if(!s)return null;return{language:s,source:xr(t?.children)}}(e);if(t&&(void 0!==(s=t.language)&&s in ar)){const e=function(e,r,t){let s;try{s=JSON.parse(r)}catch{return null}return Array.isArray(s)&&0!==s.length?ar[e]?.(s,t)??null:null}(t.language,t.source,br);if(e)return e}var s;return r.jsx("pre",{className:"mt-4 overflow-x-auto rounded-lg border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.5)] p-4 text-[13px] leading-6",children:e})},code:({children:e,className:t})=>Boolean(t?.startsWith("language-"))?r.jsx("code",{className:"font-mono text-foreground",children:e}):r.jsx("code",{className:"rounded border border-[hsl(var(--border))] bg-[hsl(var(--muted)/0.7)] px-1.5 py-0.5 font-mono text-[0.85em] text-foreground",children:e})};function br(e){return r.jsx(be,{remarkPlugins:[je],components:gr,children:e})}const jr=t.memo(function({source:e}){return r.jsx("div",{className:"docs-article max-w-[46rem] text-[15px]",children:r.jsx(be,{remarkPlugins:[je],components:gr,children:e})})}),vr={Rocket:j,Compass:R,Workflow:f,Blocks:E,Plug:v,Timer:g,BookOpen:A,ShieldCheck:b,LifeBuoy:N};function yr({geometry:e,animated:s,onTransitionEnd:n,followLayout:a=!1,className:o}){const l=t.useRef(null),c=null!==l.current;e&&(l.current=e);const d=e??l.current,u=null!==e,m=Boolean(s&&c&&u&&!a);return r.jsx("div",{"aria-hidden":"true",onTransitionEnd:n,className:i("pointer-events-none absolute left-0 top-0 rounded-md bg-[hsl(var(--muted))]",u?"opacity-100":"opacity-0",o),style:{width:d?.width??0,height:d?.height??0,transform:`translate(${d?.left??0}px, ${d?.top??0}px)`,transition:s?m?"transform 220ms cubic-bezier(0.16, 1, 0.3, 1), opacity 120ms linear":"opacity 120ms linear":"none"}})}const Nr={getManifest:()=>fe.get("/documentation/manifest"),getPage:e=>fe.get(`/documentation/pages/${encodeURIComponent(e)}`),search:e=>fe.get("/documentation/search",{q:e})},wr=["documentation"],kr="overview";function Cr(e){return[...wr,"page",e]}function Rr(e){return[...wr,"search",e]}function Sr(e,r){if(e)return e.sections.find(e=>e.pages.some(e=>e.slug===r))}function Ar({activeSlug:e,query:n,onQueryChange:a,manifest:o,manifestStatus:l,onRetryManifest:c,onNavigate:d,autoFocusSearch:u}){const m=t.useRef(null),h=t.useRef(e),[x,p]=t.useState(!1),f=o?.sections??[],[g,b]=t.useState(()=>{const r=Sr(o,e);return r?[r.id]:[]});t.useEffect(()=>{h.current=e;const r=Sr(o,e);r&&b(e=>e.includes(r.id)?e:[...e,r.id])},[e,o]);const j=function(e){const r=ve(e.trim(),300),t=q({queryKey:Rr(r),queryFn:()=>Nr.search(r),enabled:r.length>0,staleTime:3e4,gcTime:3e5,refetchOnWindowFocus:!1});return{...t,debouncedQuery:r,results:t.data?.results??[],isDebouncing:e.trim()!==r}}(n),v=n.trim().length>0,y=Sr(o,e),N=Boolean(y&&g.includes(y.id)),w=h.current!==e,k=function(e,r=[]){const s=!B(),n=t.useRef(null),a=t.useRef(new Map),o=t.useRef(null),l=t.useRef(null),[i,c]=t.useState(null),[d,u]=t.useState(e),[m,h]=t.useState(!1),x=t.useCallback(()=>{const r=n.current,t=e?a.current.get(e):void 0;if(!r||!t)return void(e&&o.current!==e||(o.current=null,c(null)));const s=r.getBoundingClientRect(),l=t.getBoundingClientRect(),i={top:l.top-s.top+r.scrollTop,left:l.left-s.left+r.scrollLeft,width:l.width,height:l.height};o.current=e,c(e=>e&&e.top===i.top&&e.left===i.left&&e.width===i.width&&e.height===i.height?e:i)},[e]),p=t.useCallback(e=>{n.current=e,e&&x()},[x]),f=t.useCallback((e,r)=>{r?a.current.set(e,r):a.current.delete(e)},[]),g=null!==e&&o.current===e;t.useLayoutEffect(()=>{if(x(),null!==l.current&&(cancelAnimationFrame(l.current),l.current=null),!g)return void h(!1);h(!0);const e=performance.now(),r=()=>{x(),performance.now()-e<250?l.current=requestAnimationFrame(r):(l.current=null,h(!1))};return l.current=requestAnimationFrame(r),()=>{null!==l.current&&(cancelAnimationFrame(l.current),l.current=null)}},[x,...r]),t.useEffect(()=>{const e=n.current;if(!e||"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(()=>x());return r.observe(e),()=>r.disconnect()},[x]);const b=t.useRef(e),j=null!==i;t.useEffect(()=>{if(b.current===e)return;const r=j&&s;b.current=e,u(r?null:e)},[e,j,s]),t.useEffect(()=>{if(d===e)return;const r=setTimeout(()=>u(e),280);return()=>clearTimeout(r)},[d,e]);const v=t.useCallback(()=>u(e),[e]);return{containerRef:p,registerItem:f,geometry:i,settledKey:d,onTransitionEnd:v,animated:s,followLayout:m}}(v||!N&&!w?null:e,[g,v]);return t.useEffect(()=>p(!0),[]),t.useEffect(()=>{u&&!ne()&&m.current?.focus()},[u]),t.useEffect(()=>{const e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key.toLowerCase()&&(e.preventDefault(),m.current?.focus(),m.current?.select())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),r.jsxs("nav",{"aria-label":"Documentation",className:"flex h-full flex-col",children:[r.jsxs("div",{className:"relative shrink-0 px-3 pb-3 pt-4",children:[r.jsx(M,{ref:m,icon:"Search",type:"search",value:n,onChange:e=>a(e.target.value),onKeyDown:e=>{"Escape"===e.key&&a("")},placeholder:"Search docs","aria-label":"Search documentation",inputClassName:"!pr-16 [&::-webkit-search-cancel-button]:hidden"}),v?r.jsx("button",{type:"button",onClick:()=>{a(""),m.current?.focus()},"aria-label":"Clear search",className:"absolute right-6 top-1/2 -translate-y-1/2 roun
1ded p-0.5 text-muted-foreground transition-colors hover:text-foreground",children:r.jsx(ae,{className:"h-3.5 w-3.5"})}):r.jsx("kbd",{className:"pointer-events-none absolute right-6 top-1/2 hidden -translate-y-1/2 rounded border border-[hsl(var(--border))] bg-[hsl(var(--muted))] px-1.5 py-0.5 font-mono text-xs text-foreground lg:block",children:"âK"})]}),r.jsxs("div",{ref:k.containerRef,className:"relative min-h-0 flex-1 overflow-y-auto px-3 pb-8",children:[!v&&r.jsx(yr,{geometry:k.geometry,animated:k.animated,onTransitionEnd:k.onTransitionEnd,followLayout:k.followLayout}),v?r.jsx(Er,{results:j.results,isLoading:j.isLoading||j.isFetching||j.isDebouncing,isError:j.isError,onRetry:()=>{j.refetch()},activeSlug:e,onNavigate:d}):"loading"===l?r.jsx("p",{className:"px-2 py-6 text-sm text-muted-foreground",children:"Loading pagesâ¦"}):"error"===l?r.jsxs("div",{className:"px-2 py-6 text-sm text-foreground",children:[r.jsx("p",{className:"text-muted-foreground",children:"Documentation could not be loaded."}),r.jsx(P,{variant:"outline",size:"sm",className:"mt-3",onClick:c,children:"Retry"})]}):r.jsx("ul",{className:"space-y-1",children:f.map(t=>{const n=(a=t.icon,vr[a]??A);var a;const o=g.includes(t.id),l=t.pages.some(r=>r.slug===e);return r.jsx("li",{children:r.jsxs(ue,{open:o,onOpenChange:e=>b(r=>e?[...r,t.id]:r.filter(e=>e!==t.id)),children:[r.jsxs(me,{className:i("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-xs font-semibold uppercase tracking-wider transition-colors",l?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[r.jsx(n,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),r.jsx("span",{className:"flex-1 text-left",children:t.title}),r.jsx(F,{"aria-hidden":"true",className:i("h-3.5 w-3.5 shrink-0 transition-transform duration-150",o&&"rotate-90")})]}),r.jsx(he,{className:i("overflow-hidden",x&&"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"),children:r.jsx("ul",{className:"mt-0.5 space-y-px pl-2",children:t.pages.map(t=>{const n=t.slug===e;return r.jsx("li",{children:r.jsx(s,{ref:e=>k.registerItem(t.slug,e),to:`/core/docs/${t.slug}`,onClick:d,"aria-current":n?"page":void 0,className:i("relative block rounded-md px-3 py-1.5 text-sm transition-colors",n?"text-foreground":"text-muted-foreground",k.settledKey===t.slug&&"font-semibold",!n&&"hover:text-foreground"),children:t.title})},t.slug)})})})]})},t.id)})})]})]})}function Er({results:e,isLoading:t,isError:n,onRetry:a,activeSlug:o,onNavigate:l}){return n?r.jsxs("div",{className:"px-2 py-6 text-sm text-foreground",children:[r.jsx("p",{className:"text-muted-foreground",children:"Search failed."}),r.jsx(P,{variant:"outline",size:"sm",className:"mt-3",onClick:a,children:"Retry"})]}):t&&0===e.length?r.jsx("p",{className:"px-2 py-6 text-sm text-muted-foreground",children:"Searchingâ¦"}):0===e.length?r.jsx("p",{className:"px-2 py-6 text-sm text-muted-foreground",children:"No matching pages."}):r.jsx("ul",{className:"space-y-1",children:e.map(e=>r.jsx("li",{children:r.jsxs(s,{to:`/core/docs/${e.slug}`,onClick:l,"aria-current":e.slug===o?"page":void 0,className:i("block rounded-md px-2 py-2 transition-colors",e.slug===o?"bg-[hsl(var(--muted))] font-semibold":"hover:bg-[hsl(var(--muted)/0.6)]"),children:[r.jsx("span",{className:"block text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:e.sectionTitle}),r.jsx("span",{className:"block text-sm font-medium text-foreground",children:e.title}),r.jsx("span",{className:"mt-0.5 line-clamp-2 block text-xs leading-5 text-muted-foreground",children:e.snippet})]})},e.slug))})}function Lr({headings:e,scrollRoot:s}){const[n,a]=t.useState("");return t.useEffect(()=>{if(0===e.length)return;const r=e.map(e=>document.getElementById(e.id)).filter(e=>null!==e);if(0===r.length)return;const t=new IntersectionObserver(e=>{const r=e.filter(e=>e.isIntersecting).sort((e,r)=>e.boundingClientRect.top-r.boundingClientRect.top);r.length>0&&a(r[0].target.id)},{root:s??null,rootMargin:"0px 0px -70% 0px",threshold:0});return r.forEach(e=>t.observe(e)),a(e=>
1e||r[0].id),()=>t.disconnect()},[e,s]),e.length<2?null:r.jsxs("nav",{"aria-label":"On this page",className:"text-sm",children:[r.jsx("p",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"On this page"}),r.jsx("ul",{className:"space-y-1 border-l border-[hsl(var(--border))] py-2 pl-3",children:e.map(e=>r.jsx("li",{children:r.jsx("a",{href:`#${e.id}`,onClick:r=>{r.preventDefault();const t=document.getElementById(e.id);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),window.history.replaceState(null,"",`#${e.id}`),a(e.id))},className:i("block border-l-2 py-1.5 pr-2 transition-colors",3===e.depth?"pl-6 text-[13px]":"pl-3",n===e.id?"border-l-[hsl(var(--foreground))] font-medium text-foreground":"border-l-transparent text-muted-foreground hover:text-foreground"),children:e.text})},e.id))})]})}const Tr=()=>{const{slug:e}=n(),o=e??kr,{isDesktop:l,isLargeDesktop:i}=K(),c=l||i,[d,u]=t.useState(""),[m,h]=t.useState(!1),[x,p]=t.useState(null),f=q({queryKey:[...wr,"manifest"],queryFn:()=>Nr.getManifest(),staleTime:3e5,gcTime:3e5,refetchOnWindowFocus:!1}),g=function(e,r){if(e)for(const t of e.sections){const e=t.pages.find(e=>e.slug===r);if(e)return e}}(f.data,o),b=function(e,r=!0){return q({queryKey:Cr(e),queryFn:()=>Nr.getPage(e),enabled:r&&e.length>0,staleTime:3e5,gcTime:3e5,refetchOnWindowFocus:!1})}(o,Boolean(f.data)&&Boolean(g));t.useEffect(()=>{h(!1),u("")},[o]),t.useEffect(()=>{if(c)return;const e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key.toLowerCase()&&(e.preventDefault(),ye(),h(!0))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[c]);const j=b.data?.source??"",v=t.useMemo(()=>b.isSuccess?function(e){const r=[];let t=!1;for(const s of e.split("\n")){if(/^\s*(```|~~~)/.test(s)){t=!t;continue}if(t)continue;const e=/^(#{2,3})\s+(.*\S)\s*$/.exec(s);if(!e)continue;const n=e[2].replace(/\s*#+\s*$/,"");r.push({id:mr(n),text:n.replace(/[`*_]/g,""),depth:2===e[1].length?2:3})}return r}(j):[],[b.isSuccess,j]);if(t.useEffect(()=>{if(!b.isSuccess)return;const e=window.location.hash.slice(1);if(e){const r=requestAnimationFrame(()=>{document.getElementById(e)?.scrollIntoView({block:"start"})});return()=>cancelAnimationFrame(r)}"function"==typeof x?.scrollTo?x.scrollTo({top:0}):x&&(x.scrollTop=0)},[o,b.isSuccess,x]),f.isSuccess&&!g)return r.jsx(a,{to:`/core/docs/${f.data.defaultSlug||kr}`,replace:!0});const y=b.data?.title??g?.title,N=b.data?.description??g?.description,w=b.data?.sectionTitle,k=b.data?.previous??null,C=b.data?.next??null;return r.jsxs("div",{className:"docs-page flex h-[calc(100dvh-1rem)] flex-col bg-[hsl(var(--background))]",children:[r.jsx("header",{className:"shrink-0 border-b border-[hsl(var(--border))] bg-[hsl(var(--muted))]",children:r.jsxs("div",{className:"mx-auto flex max-w-[1600px] items-center gap-2 px-4 py-4 sm:gap-3 sm:px-6",children:[r.jsx("div",{className:"hidden shrink-0 sm:block",children:r.jsx(G,{size:"md"})}),!c&&r.jsx(P,{variant:"toolbar",size:"icon",className:"h-9 w-9","aria-label":"Open documentation menu","aria-expanded":m,onClick:()=>h(!0),children:r.jsx(z,{className:"h-4 w-4"})}),r.jsx("div",{className:"shrink-0",children:r.jsx(Y,{currentPage:"docs"})}),r.jsx("div",{className:"ml-auto shrink-0",children:r.jsx(J,{})})]})}),r.jsxs("div",{className:"mx-auto flex w-full min-h-0 max-w-[1600px] flex-1",children:[c&&r.jsx("aside",{className:"w-[270px] shrink-0 border-r border-[hsl(var(--border))]",children:r.jsx(Ar,{activeSlug:o,query:d,onQueryChange:u,manifest:f.data,manifestStatus:Ir(f),onRetryManifest:()=>{f.refetch()}})}),!c&&r.jsx(W,{open:m,onOpenChange:h,children:r.jsxs(U,{side:"left",showClose:!1,className:"flex w-[286px] max-w-[85vw] flex-col gap-0 p-0",children:[r.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-[hsl(var(--border))] px-4 py-3",children:[r.jsx(V,{className:"text-sm font-semibold text-foreground",children:"Documentation"}),r.jsx(Q,{className:"sr-only",children:"Documentation sections and search"}),r.jsx(P,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Close documentation menu",onClick:()=>h(!1),children:r.jsx(ae,{className:"h-4 w-4"})})]}),r.jsx(Ar,{activeSlug:o,query:d,onQueryChange:u,autoFocusSearch:!0,onNavigate:()=>h(!1),manifest:f.data,manifestStatus:Ir(f),onRetryManifest:()=>{f.refetch()}})]})}),r.jsx("main",{ref:p,className:"min-w-0 flex-1 overflow-y-auto",children:r.jsxs("div",{className:"flex gap-10 px-5 py-8 sm:px-10",children:[r.jsxs("article",{className:"min-w-0 flex-1",children:[r.jsxs("nav",{"aria-label":"Breadcrumb",className:"mb-2 text-xs text-muted-foreground",children:[r.jsx(s,{to:"/core/docs",className:"transition-colors hover:text-foreground",children:"Docs"}),w&&r.jsx("span",{className:"px-1.5",children:"/"}),w&&r.jsx("span",{children:w})]}),y?r.jsx("h1",{className:"text-[2rem] font-semibold leading-tight tracking-tight text-foreground",children:y}):r.jsx(Z,{className:"h-10 w-2/3"}),N?r.jsx("p",{className:"mt-2 max-w-[56ch] text-[15px] leading-7 text-muted-foreground",children:N}):r.jsx(Z,{className:"mt-2 h-5 w-5/6"}),r.jsx("div",{className:"mt-8",children:r.jsx(_r,{isLoading:f.isLoading||Boolean(g)&&b.isLoading&&!b.data,isError:f.isError||b.isError,isSuccess:b.isSuccess,isEmpty:b.isSuccess&&0===j.trim().length,errorMessage:f.error?.message||b.error?.message||"This page could not be loaded. Try again shortly.",source:j,onRetry:()=>{f.isError&&f.refetch(),b.isError&&b.refetch()}})}),r.jsx(Or,{previous:k,next:C})]}),r.jsx("div",{className:"hidden w-[220px] shrink-0 xl:block",children:r.jsx("div",{className:"sticky top-0 max-h-[calc(100vh-8rem)] overflow-y-auto py-1",children:r.jsx(Lr,{headings:v,scrollRoot:x})})})]})})]})]})};function Ir(e){return e.isError?"error":e.isSuccess?"success":"loading"}
1function _r({isLoading:e,isError:t,isSuccess:s,isEmpty:n,errorMessage:a,source:o,onRetry:l}){return t?r.jsxs("div",{className:"rounded-lg border border-[hsl(var(--destructive)/0.4)] bg-[hsl(var(--destructive)/0.08)] px-4 py-3 text-sm text-foreground",children:[r.jsx("p",{children:a}),r.jsx(P,{variant:"outline",size:"sm",className:"mt-3",onClick:l,children:"Retry"})]}):e?r.jsx(Dr,{}):n?r.jsx("p",{className:"text-sm text-muted-foreground",children:"This page has no content yet."}):s?r.jsx(jr,{source:o}):r.jsx(Dr,{})}function Dr(){return r.jsxs("div",{className:"max-w-[46rem] space-y-4","aria-hidden":"true",children:[r.jsx(Z,{className:"h-4 w-2/3"}),r.jsx(Z,{className:"h-4 w-full"}),r.jsx(Z,{className:"h-4 w-5/6"}),r.jsx(Z,{className:"h-24 w-full"}),r.jsx(Z,{className:"h-4 w-3/4"})]})}function Or({previous:e,next:t}){return e||t?r.jsxs("div",{className:"mt-16 grid max-w-[46rem] gap-3 border-t border-[hsl(var(--border))] pt-6 sm:grid-cols-2",children:[e?r.jsxs(s,{to:`/core/docs/${e.slug}`,className:"group rounded-lg border border-[hsl(var(--border))] px-4 py-3 transition-colors hover:bg-[hsl(var(--muted)/0.6)]",children:[r.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[r.jsx(H,{className:"h-3.5 w-3.5"}),"Previous"]}),r.jsx("span",{className:"mt-1 block text-sm font-medium text-foreground",children:e.title})]}):r.jsx("span",{}),t&&r.jsxs(s,{to:`/core/docs/${t.slug}`,className:"group rounded-lg border border-[hsl(var(--border))] px-4 py-3 text-right transition-colors hover:bg-[hsl(var(--muted)/0.6)] sm:col-start-2",children:[r.jsxs("span",{className:"flex items-center justify-end gap-1.5 text-xs text-muted-foreground",children:["Next",r.jsx(T,{className:"h-3.5 w-3.5"})]}),r.jsx("span",{className:"mt-1 block text-sm font-medium text-foreground",children:t.title})]})]}):null}export{Tr as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.