deepspace 0.33.1 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +5 -1
  3. package/dist/{chunk-PZDVKSLI.js → chunk-ESEI3MMY.js} +2 -2
  4. package/dist/{chunk-PZDVKSLI.js.map → chunk-ESEI3MMY.js.map} +1 -1
  5. package/dist/chunk-ESYXTIV2.js +1957 -0
  6. package/dist/chunk-ESYXTIV2.js.map +1 -0
  7. package/dist/cli.js +151 -53
  8. package/dist/cli.js.map +1 -1
  9. package/dist/documentation-client-core.js +1 -1
  10. package/dist/documentation-default-renderer.cjs +1 -1
  11. package/dist/documentation-react.js +1 -1
  12. package/dist/documentation-runtime.js +10 -10
  13. package/dist/documentation-server-core.js +1 -1
  14. package/dist/documentation.js +47 -22
  15. package/dist/documentation.js.map +1 -1
  16. package/dist/expo.d.ts +83 -0
  17. package/dist/expo.js +242 -0
  18. package/dist/expo.js.map +1 -0
  19. package/dist/index.d.ts +110 -23
  20. package/dist/index.js +134 -53
  21. package/dist/index.js.map +1 -1
  22. package/dist/server.d.ts +205 -37
  23. package/dist/server.js +290 -97
  24. package/dist/server.js.map +1 -1
  25. package/dist/testing.js +45 -3
  26. package/dist/testing.js.map +1 -1
  27. package/dist/worker.d.ts +348 -48
  28. package/dist/worker.js +547 -110
  29. package/dist/worker.js.map +1 -1
  30. package/features/documents/feature.json +15 -0
  31. package/features/documents/src/DocumentsListPage.tsx +22 -8
  32. package/features/documents/src/InviteDialog.tsx +63 -42
  33. package/features/documents/src/__tests__/documents-find-invitee-action.test.ts +131 -0
  34. package/features/documents/src/__tests__/documents-invitee-lookup.test.ts +67 -0
  35. package/features/documents/src/documents-find-invitee-action.ts +56 -0
  36. package/features/documents/src/documents-invitee-lookup.ts +38 -0
  37. package/features/documents/src/documents-ui.css +10 -0
  38. package/package.json +29 -9
@@ -16,7 +16,7 @@ import {
16
16
  Warning,
17
17
  documentationLogicalPath,
18
18
  documentationPublicPath
19
- } from "./chunk-PZDVKSLI.js";
19
+ } from "./chunk-ESYXTIV2.js";
20
20
 
21
21
  // src/documentation/runtime/client.tsx
22
22
  import { useCallback, useEffect, useRef, useState } from "react";
@@ -64,7 +64,7 @@ Learn more: https://react.dev/warnings/version-mismatch`))}uf();function sf(e,n)
64
64
  ${c}`)}),[n.config.assistant.access,n.page.title,r]);return(0,S.jsxs)("article",{className:"documentation-article",ref:i,children:[(0,S.jsx)(bb,{items:n.breadcrumbs}),(0,S.jsxs)("header",{className:"documentation-article-header",children:[(0,S.jsxs)("div",{className:"documentation-article-meta",children:[n.config.theme.eyebrowStyle!=="none"&&(0,S.jsx)("div",{className:"documentation-eyebrow",children:n.page.kind==="openapi"?"API reference":n.config.theme.eyebrowStyle==="breadcrumbs"?n.breadcrumbs.join(" / "):n.breadcrumbs[0]??"Documentation"}),(0,S.jsx)(Df,{data:n,onAssistantOpen:r})]}),(0,S.jsx)("h1",{children:n.page.title}),n.page.description&&(0,S.jsx)("p",{className:"documentation-lede",children:n.page.description})]}),(0,S.jsx)(yb,{headings:Lf(n.page.headings)}),(0,S.jsxs)(Mf,{value:a,children:[e??(0,S.jsx)("div",{className:"documentation-prose","data-prose":"html",dangerouslySetInnerHTML:{__html:n.page.html}}),l.map(c=>(0,Of.createPortal)((0,S.jsx)(Pf,{readCode:()=>Tb(c.pre)}),c.host,c.key))]}),n.page.openapi?.playground&&(0,S.jsx)(mb,{operation:n.page.openapi}),t&&(0,S.jsx)("div",{className:"documentation-launcher-dock",children:t}),(0,S.jsxs)("nav",{className:"documentation-pagination","aria-label":"Page navigation",children:[n.previous?(0,S.jsxs)("a",{rel:"prev",href:Te(n.basePath,n.previous.route),children:[(0,S.jsx)("small",{children:"Previous"}),(0,S.jsxs)("span",{children:[(0,S.jsx)(pt,{className:"is-back"}),n.previous.title]})]}):(0,S.jsx)("span",{}),n.next?(0,S.jsxs)("a",{rel:"next",href:Te(n.basePath,n.next.route),children:[(0,S.jsx)("small",{children:"Next"}),(0,S.jsxs)("span",{children:[n.next.title,(0,S.jsx)(pt,{})]})]}):(0,S.jsx)("span",{})]})]})}function bb({items:e}){return(0,S.jsx)("nav",{className:"documentation-breadcrumbs","aria-label":"Breadcrumb",children:e.map((n,t)=>(0,S.jsxs)("span",{children:[t>0&&(0,S.jsx)(pt,{}),n]},`${n}:${e.slice(0,t+1).join("/")}`))})}function Lf(e){return e.filter(n=>n.depth===2||n.depth===3)}function Hf({active:e,headings:n}){return(0,S.jsx)(S.Fragment,{children:n.map(t=>(0,S.jsx)("a",{"aria-current":e===t.id?"location":void 0,className:`${t.depth===3?"depth-3 ":""}${e===t.id?"is-active":""}`,href:`#${t.id}`,children:t.text},t.id))})}function yb({headings:e}){return e.length===0?null:(0,S.jsxs)("details",{className:"documentation-outline-disclosure",children:[(0,S.jsxs)("summary",{children:[(0,S.jsx)(Af,{}),"On this page"]}),(0,S.jsx)("nav",{className:"documentation-outline","aria-label":"On this page",children:(0,S.jsx)(Hf,{active:"",headings:e})})]})}function Bf({data:e}){let n=(0,Me.useMemo)(()=>Lf(e.page.headings),[e.page.headings]),[t,r]=(0,Me.useState)(n[0]?.id??"");return(0,Me.useEffect)(()=>r(n[0]?.id??""),[n]),(0,Me.useEffect)(()=>{let i=null,l=()=>{i=null;let o=document.documentElement,u=(Number.parseFloat(getComputedStyle(o).scrollPaddingTop)||96)+4,s=o.scrollHeight>window.innerHeight+4&&window.innerHeight+window.scrollY>=o.scrollHeight-2,d=n[0]?.id??"";for(let h of n){let E=document.getElementById(h.id);if(E)if(E.getBoundingClientRect().top<=u)d=h.id;else break}if(s){let h=decodeURIComponent(window.location.hash.slice(1));if(h&&n.some(E=>E.id===h)){let E=document.getElementById(h)?.getBoundingClientRect().top;E!==void 0&&E>u&&E<window.innerHeight&&(d=h)}}r(d)},a=()=>{i===null&&(i=window.requestAnimationFrame(l))},c=o=>{o.target instanceof Element&&o.target.closest(".documentation-outline a")&&window.setTimeout(a,0)};return l(),window.addEventListener("scroll",a,{passive:!0}),window.addEventListener("resize",a,{passive:!0}),window.addEventListener("popstate",a),window.addEventListener("hashchange",a),document.addEventListener("click",c),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a),window.removeEventListener("popstate",a),window.removeEventListener("hashchange",a),document.removeEventListener("click",c),i!==null&&window.cancelAnimationFrame(i)}},[n]),(0,S.jsx)("aside",{className:"documentation-context-rail","aria-label":"Page context",children:n.length>0&&(0,S.jsxs)("nav",{className:"documentation-outline","aria-label":"On this page",children:[(0,S.jsx)("h2",{children:"On this page"}),(0,S.jsx)(Hf,{active:t,headings:n})]})})}function mb({operation:e}){let[n,t]=(0,Me.useState)(""),[r,i]=(0,Me.useState)(""),[l,a]=(0,Me.useState)("No request sent."),[c,o]=(0,Me.useState)(!1);if(!e.baseUrl)return null;let u=`${e.baseUrl.replace(/\/$/,"")}${e.path}`,f=async()=>{o(!0),a("Sending request\u2026");try{let s={};r&&(s.Authorization=`Bearer ${r}`),n.trim()&&(s["Content-Type"]="application/json");let d=await fetch(u,{method:e.method,headers:s,body:["GET","HEAD"].includes(e.method)?void 0:n.trim()||void 0}),h=await d.text();a(`${d.status} ${d.statusText}
65
65
 
66
66
  ${h}`)}catch(s){a(fa(s))}finally{o(!1)}};return(0,S.jsxs)("section",{className:"documentation-playground","data-playground":!0,children:[(0,S.jsxs)("div",{className:"documentation-playground-title",children:[(0,S.jsxs)("div",{children:[(0,S.jsx)("span",{className:`method method-${e.method.toLowerCase()}`,children:e.method}),(0,S.jsx)("strong",{children:"Try this operation"})]}),(0,S.jsx)("code",{children:u})]}),(0,S.jsx)("p",{children:"Requests run in your browser. Tokens stay in memory and never enter search or assistant context."}),(0,S.jsxs)("label",{children:[(0,S.jsx)("span",{children:"Bearer token"}),(0,S.jsx)("input",{type:"password",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",spellCheck:!1,value:r,onChange:s=>i(s.target.value),placeholder:"Optional"})]}),(0,S.jsxs)("label",{children:[(0,S.jsx)("span",{children:"JSON body"}),(0,S.jsx)("textarea",{rows:7,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",spellCheck:!1,value:n,onChange:s=>t(s.target.value),placeholder:"{}"})]}),(0,S.jsx)("button",{type:"button",disabled:c,onClick:f,children:c?"Sending\u2026":`Send ${e.method} request`}),(0,S.jsx)("pre",{"aria-live":"polite",children:l})]})}function Eb(e,n){let[t,r]=(0,Me.useState)([]);return(0,Me.useEffect)(()=>{let i=e.current;if(!i)return;let l=[],a=[];return i.querySelectorAll(Nf+" pre").forEach((c,o)=>{let u=document.createElement("div");u.className="documentation-code-block",c.replaceWith(u),u.appendChild(c);let f=c.getAttribute("data-code-title");if(f&&!u.closest("[data-tab-group]")){let h=document.createElement("div");h.className="documentation-code-title",h.textContent=f,u.insertBefore(h,c)}let s=document.createElement("div");s.className="documentation-code-actions";let d=_f(c.querySelector("code")?.className??"");if(d){let h=document.createElement("span");h.className="documentation-code-language",h.textContent=d,s.appendChild(h)}u.appendChild(s),l.push({block:u,pre:c}),a.push({key:`${n}:${o}`,host:s,pre:c})}),r(a),()=>{r([]);for(let{block:c,pre:o}of l)c.replaceWith(o)}},[e,n]),t}function Tb(e){return e.querySelector("code")?.textContent??e.textContent??""}function xb(e,n){(0,Me.useEffect)(()=>{let t=e.current;if(!t)return;let r=[];return t.querySelectorAll(`${Nf} [data-tab-group]`).forEach((i,l)=>{if(i.querySelector(":scope > .documentation-tab-buttons"))return;let a=Array.from(i.querySelectorAll(":scope > [data-tab]"));if(a.length===0)return;let c=document.createElement("div");c.className="documentation-tab-buttons",c.setAttribute("role","tablist");let o=a.map((E,y)=>E.dataset.tabTitle??`Tab ${y+1}`),u=(E,y=!1)=>{if(a.forEach((g,m)=>{g.hidden=m!==E,g.setAttribute("role","tabpanel")}),Array.from(c.querySelectorAll("button")).forEach((g,m)=>{g.setAttribute("aria-selected",m===E?"true":"false"),g.setAttribute("tabindex",m===E?"0":"-1")}),y){let g=o[E];g&&(Yi("deepspace-documentation-tab-selection",g),document.dispatchEvent(new CustomEvent("deepspace-documentation-tab-change",{detail:{label:g,source:i}})))}};a.forEach((E,y)=>{let g=document.createElement("button");g.type="button",g.id=`documentation-tab-${l}-${y}`,g.setAttribute("role","tab"),g.textContent=o[y],E.setAttribute("aria-labelledby",g.id);let m=()=>u(y,!0),T=w=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(w.key))return;w.preventDefault();let I=w.key==="Home"?0:w.key==="End"?a.length-1:(y+(w.key==="ArrowRight"?1:-1)+a.length)%a.length;u(I),c.querySelectorAll("button")[I]?.focus()};g.addEventListener("click",m),g.addEventListener("keydown",T),c.appendChild(g),r.push(()=>{g.removeEventListener("click",m),g.removeEventListener("keydown",T)})});let f=i.querySelector(":scope > .documentation-code-group-title");f&&i.insertBefore(c,f.nextSibling),f||i.insertBefore(c,i.firstChild);let s=E=>{let y=E.detail;if(!y?.label||y.source===i)return;let g=o.findIndex(m=>m===y.label);g>=0&&u(g)};document.addEventListener("deepspace-documentation-tab-change",s);let d=Gi("deepspace-documentation-tab-selection"),h=d?o.findIndex(E=>E===d):-1;u(h>=0?h:0),r.push(()=>{document.removeEventListener("deepspace-documentation-tab-change",s),c.remove()})}),()=>r.reverse().forEach(i=>i())},[e,n.page.route])}var Pe=J(un(),1);function zf(e){if(!e||e.startsWith(":")||!e.startsWith("data:"))return null;let n=e.slice(5).replace(/^ /,"").replace(/\r$/,"");if(n==="[DONE]")return null;try{let t=JSON.parse(n);return!t||typeof t!="object"?null:t}catch{return null}}function St(e){let n=e.trim();return!n||/^documentation$/i.test(n)?"documentation":/(?:\bdocs?|documentation)$/i.test(n)?n:`${n} documentation`}function Wf(e,n=12){let t=[];for(let i=0;i<e.length-1;i+=1){let l=e[i];if(l?.role!=="user"||l.state!==void 0||!l.text.trim())continue;let a=e[i+1];a?.role!=="assistant"||a.state!==void 0||!a.text.trim()||(t.push([{role:"user",content:l.text},{role:"assistant",content:a.text}]),i+=1)}let r=Math.max(0,Math.floor(n/2));return r===0?[]:t.slice(-r).flat()}var Uf=J(un(),1);function Cr(e,n,t,r=!0,i){(0,Uf.useEffect)(()=>{if(!e)return;let l=document.activeElement,a=n.current,c=window.requestAnimationFrame(()=>{(a?.querySelector("[data-autofocus]")??a?.querySelector("button,a,input,textarea"))?.focus()}),o=u=>{if(u.key==="Escape"){u.preventDefault(),t();return}if(!r||u.key!=="Tab"||!a)return;let f=Array.from(a.querySelectorAll('a[href],button:not([disabled]),input:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])'));if(f.length===0)return;let s=f[0],d=f[f.length-1];u.shiftKey&&document.activeElement===s?(u.preventDefault(),d?.focus()):!u.shiftKey&&document.activeElement===d&&(u.preventDefault(),s?.focus())};return document.addEventListener("keydown",o),()=>{window.cancelAnimationFrame(c),document.removeEventListener("keydown",o),(i?document.getElementById(i):l?.isConnected&&l!==document.body&&!a?.contains(l)?l:null)?.focus()}},[t,e,n,i,r])}var M=J(Ie(),1);function Yf({input:e,name:n,onInputChange:t,onSubmit:r}){let i=St(n);return(0,M.jsxs)("form",{className:"documentation-assistant-launcher",id:"deepspace-documentation-assistant-launcher",onSubmit:a=>{a.preventDefault();let c=e.trim();c&&r(c)},children:[(0,M.jsx)("input",{"aria-label":`Ask the ${i} agent`,autoCapitalize:"sentences",autoComplete:"off",autoCorrect:"off",enterKeyHint:"send",id:"deepspace-documentation-assistant-launcher-input",maxLength:4e3,onChange:a=>t(a.target.value),placeholder:"Ask anything\u2026",spellCheck:!1,value:e}),(0,M.jsxs)("span",{"aria-hidden":"true",className:"documentation-launcher-hint",children:[(0,M.jsx)("kbd",{children:"\u2318"}),(0,M.jsx)("kbd",{children:"I"})]}),(0,M.jsx)("button",{className:"documentation-launcher-send",type:"submit",disabled:!e.trim(),"aria-label":"Send question to documentation agent",children:(0,M.jsx)(uc,{})})]})}function Xf({access:e,basePath:n,input:t,name:r,onClose:i,onInputChange:l,open:a,route:c,seed:o,suggestions:u}){let f=(0,Pe.useRef)(null),s=(0,Pe.useRef)(null),d=(0,Pe.useRef)(null),h=(0,Pe.useRef)(null),E=(0,Pe.useRef)(null),y=(0,Pe.useRef)(null),g=(0,Pe.useRef)(0),[m,T]=(0,Pe.useState)([{id:"welcome",role:"assistant",text:`I can search the ${St(r)} and cite the exact pages I use.`}]),[w,I]=(0,Pe.useState)(!1);if(Cr(a,f,i,!1,"deepspace-documentation-assistant-launcher-input"),(0,Pe.useEffect)(()=>{if(!a||o.id===0||g.current===o.id||(g.current=o.id,!o.submit||!o.value?.trim()))return;y.current=o.value;let k=window.requestAnimationFrame(()=>s.current?.requestSubmit());return()=>window.cancelAnimationFrame(k)},[a,o]),(0,Pe.useEffect)(()=>{let k=d.current;k&&(k.scrollTop=k.scrollHeight)},[m]),(0,Pe.useEffect)(()=>{let k=h.current;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,160)}px`,k.style.overflowY=k.scrollHeight>160?"auto":"hidden")},[t,a]),(0,Pe.useEffect)(()=>()=>E.current?.abort(),[]),!a)return null;let R=async k=>{k?.preventDefault();let Z=(y.current??t).trim();if(y.current=null,!Z||w)return;let P=Wf(m);l(""),I(!0);let le=`user-${Date.now()}`,p=`assistant-${Date.now()}`;T(he=>[...he,{id:le,role:"user",text:Z},{id:p,role:"assistant",text:"",state:"streaming",status:"Searching this documentation\u2026"}]);let U=new AbortController;E.current=U;let G=!1,O=window.setTimeout(()=>{T(he=>he.map(ee=>ee.id===p?{...ee,status:"Still working through the documentation\u2026"}:ee))},12e3),$=window.setTimeout(()=>{G=!0,U.abort()},12e4);try{let he={"Content-Type":"application/json"};if(e==="authenticated"){let V=await fetch("/api/auth/token",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"}}),z=V.ok?await V.json().catch(()=>null):null;if(!z?.token)throw new Error("Sign in to use the documentation assistant.");he.Authorization=`Bearer ${z.token}`}let ee=await fetch(Te(n,"/api/ai"),{method:"POST",headers:he,body:JSON.stringify({question:Z,route:c,messages:P}),signal:U.signal});if(!ee.ok||!ee.body){let V=await ee.json().catch(()=>null);throw new Error(V?.error??`Assistant unavailable (${ee.status})`)}let xe=ee.body.getReader(),ve=new TextDecoder,ae="",oe="",fe=V=>{let z=zf(V);if(z){if(z.type==="text-delta"&&typeof z.delta=="string")oe+=z.delta,T(de=>de.map(N=>N.id===p?{...N,text:oe,state:"streaming",status:void 0}:N));else if(z.type==="tool-input-available"){let de=z.toolName==="documentation_read"?"Reading the relevant source pages\u2026":"Searching this documentation\u2026";T(N=>N.map($e=>$e.id===p?{...$e,status:de}:$e))}else if(z.type==="tool-output-available")T(de=>de.map(N=>N.id===p?{...N,status:"Reviewing the source material\u2026"}:N));else if(z.type==="error")throw new Error(typeof z.errorText=="string"?z.errorText:"The assistant stream failed.")}};for(;;){let V=await xe.read();if(V.done)break;ae+=ve.decode(V.value,{stream:!0});let z=ae.split(/\r?\n/);ae=z.pop()??"";for(let de of z)fe(de)}ae+=ve.decode(),fe(ae),T(V=>V.map(z=>z.id===p?{...z,text:oe||"No answer was returned.",state:void 0}:z))}catch(he){let ee=G?"The documentation search took too long. Try a narrower question.":U.signal.aborted?"Response stopped.":fa(he);T(xe=>xe.map(ve=>ve.id===p?{...ve,text:ee,state:"error"}:ve))}finally{window.clearTimeout(O),window.clearTimeout($),E.current=null,I(!1)}},x=u??["How do I get started?","Show me a complete example","What should I understand first?"];return(0,M.jsxs)("aside",{"aria-label":"Documentation assistant",className:"documentation-assistant",id:"deepspace-documentation-assistant",ref:f,role:"complementary",children:[(0,M.jsxs)("header",{children:[(0,M.jsx)("div",{children:(0,M.jsxs)("span",{children:[(0,M.jsxs)("strong",{id:"deepspace-documentation-assistant-title",children:["Ask ",r]}),(0,M.jsx)("small",{children:"Answers from this documentation build"})]})}),(0,M.jsx)("button",{type:"button",onClick:i,"aria-label":"Close documentation assistant",children:(0,M.jsx)(ga,{})})]}),(0,M.jsxs)("div",{className:"documentation-assistant-messages",ref:d,"aria-live":"polite",children:[m.map(k=>(0,M.jsx)("div",{className:`documentation-assistant-message is-${k.role}${k.state?` is-${k.state}`:""}`,children:(0,M.jsxs)("div",{children:[k.role==="assistant"?(0,M.jsx)(wb,{value:k.text}):k.text,k.state==="streaming"&&!k.text&&(0,M.jsxs)("span",{className:"documentation-assistant-activity",role:"status",children:[(0,M.jsx)("span",{"aria-hidden":"true"}),k.status??"Working\u2026"]})]})},k.id)),m.length===1&&(0,M.jsxs)("div",{className:"documentation-assistant-suggestions",children:[(0,M.jsx)("p",{children:"Try asking"}),x.map(k=>(0,M.jsx)("button",{type:"button",onClick:()=>l(k),children:k},k))]})]}),(0,M.jsxs)("form",{className:"documentation-assistant-composer",onSubmit:R,ref:s,children:[(0,M.jsx)("textarea",{"aria-label":"Ask a documentation question",autoCapitalize:"sentences",autoComplete:"off",autoCorrect:"off","data-autofocus":!0,enterKeyHint:"send",maxLength:4e3,onChange:k=>l(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),R())},placeholder:"Ask a question about this documentation",ref:h,rows:1,spellCheck:!1,value:t}),w?(0,M.jsx)("button",{type:"button",onClick:()=>E.current?.abort(),"aria-label":"Stop response",children:(0,M.jsx)(pf,{})}):(0,M.jsx)("button",{type:"submit",disabled:!t.trim(),"aria-label":"Send question",children:(0,M.jsx)(uc,{})})]}),(0,M.jsx)("footer",{children:"Responses cite this deployment and may still contain mistakes."})]})}function wb({value:e}){let n=[],t=/```([^\n`]*)\n([\s\S]*?)(?:```|$)/g,r=0;for(let i of e.matchAll(t)){let l=i.index??0;l>r&&n.push(...Gf(e.slice(r,l),`text-${r}`)),n.push((0,M.jsx)(Cb,{code:(i[2]??"").replace(/\n$/,""),language:(i[1]??"").trim().split(/\s+/,1)[0]??""},`code-${l}`)),r=l+i[0].length}return r<e.length&&n.push(...Gf(e.slice(r),`text-${r}`)),(0,M.jsx)("div",{className:"documentation-assistant-markdown",children:n})}function Cb({code:e,language:n}){let[t,r]=(0,Pe.useState)(!1);return(0,M.jsxs)("figure",{className:"documentation-assistant-code",children:[(0,M.jsxs)("figcaption",{children:[(0,M.jsx)("span",{children:n||"Code"}),(0,M.jsx)("button",{type:"button",onClick:async()=>{await kt(e),r(!0),window.setTimeout(()=>r(!1),1400)},children:t?"Copied":"Copy"})]}),(0,M.jsx)("pre",{children:(0,M.jsx)("code",{children:e})})]})}function Gf(e,n){let t=e.split(`
67
- `),r=[],i=0;for(;i<t.length;){let l=t[i]?.trim()??"";if(!l){i+=1;continue}let a=l.match(/^(#{1,4})\s+(.+)$/);if(a){r.push((0,M.jsx)("strong",{className:"documentation-assistant-heading",children:sc(a[2])},`${n}-heading-${i}`)),i+=1;continue}let c=/^[-*]\s+/.test(l),o=/^\d+[.)]\s+/.test(l);if(c||o){let f=[];for(;i<t.length;){let s=t[i]?.trim()??"",d=c?s.match(/^[-*]\s+(.+)$/):s.match(/^\d+[.)]\s+(.+)$/);if(!d)break;f.push((0,M.jsx)("li",{children:sc(d[1])},`${n}-item-${i}`)),i+=1}r.push(c?(0,M.jsx)("ul",{children:f},`${n}-list-${i}`):(0,M.jsx)("ol",{children:f},`${n}-list-${i}`));continue}let u=[l];for(i+=1;i<t.length;){let f=t[i]?.trim()??"";if(!f||/^(?:#{1,4}\s+|[-*]\s+|\d+[.)]\s+)/.test(f))break;u.push(f),i+=1}r.push((0,M.jsx)("p",{children:u.map((f,s)=>(0,M.jsxs)("span",{children:[sc(f),s<u.length-1&&" "]},`${s}:${f.slice(0,18)}`))},`${n}-paragraph-${i}`))}return r}function sc(e){let n=/(\[[^\]]+\]\((?:https?:\/\/|\/)[^)]+\)|`[^`]+`|\*\*[^*]+\*\*)/g;return e.split(n).filter(Boolean).map((t,r)=>{let i=t.match(/^\[([^\]]+)\]\(((?:https?:\/\/|\/)[^)]+)\)$/);return i?(0,M.jsx)("a",{href:i[2],...ut(i[2]),children:i[1]},`${r}:${t}`):t.startsWith("`")&&t.endsWith("`")?(0,M.jsx)("code",{children:t.slice(1,-1)},`${r}:${t}`):t.startsWith("**")&&t.endsWith("**")?(0,M.jsx)("strong",{children:t.slice(2,-2)},`${r}:${t}`):(0,M.jsx)("span",{children:t},`${r}:${t}`)})}var $t=J(un(),1);var Zf="0.33.1";var C=J(Ie(),1);function Jf({data:e,onMenuOpen:n,onSearchOpen:t}){return(0,C.jsxs)("header",{className:"documentation-header",children:[(0,C.jsx)("a",{className:"documentation-brand",href:e.config.theme.logoHref??Te(e.basePath,"/"),"aria-label":`${St(e.config.name)} home`,...ut(e.config.theme.logoHref??Te(e.basePath,"/")),children:(0,C.jsx)(Qf,{data:e})}),(0,C.jsx)("div",{className:"documentation-header-center",children:(0,C.jsxs)("button",{className:"documentation-search-trigger",type:"button",onClick:t,"aria-label":"Search documentation",children:[(0,C.jsx)(Xi,{}),(0,C.jsx)("span",{children:"Search documentation"}),(0,C.jsx)("kbd",{children:"\u2318K"})]})}),(0,C.jsx)("nav",{className:"documentation-top-links","aria-label":"Product navigation",children:e.config.links.map(r=>(0,C.jsxs)("a",{href:r.href,...ut(r.href),children:[r.label,sa(r.href)&&(0,C.jsx)(Zi,{})]},`${r.label}:${r.href}`))}),(0,C.jsxs)("div",{className:"documentation-mobile-actions",children:[(0,C.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:t,"aria-label":"Search documentation",children:(0,C.jsx)(Xi,{})}),(0,C.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:n,"aria-label":"Open documentation navigation",children:(0,C.jsx)(Ef,{})})]})]})}function Qf({data:e}){let{logo:n,logoDark:t}=e.config.theme;return n?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("img",{className:"documentation-brand-logo documentation-brand-logo-light",src:n,alt:""}),(0,C.jsx)("img",{className:"documentation-brand-logo documentation-brand-logo-dark",src:t??n,alt:""}),(0,C.jsx)("span",{className:"documentation-brand-product",children:"Documentation"})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{className:"documentation-brand-mark",children:(0,C.jsx)(Tr,{})}),(0,C.jsx)("span",{className:"documentation-brand-name",children:e.config.name})]})}function Vf({data:e}){return(0,C.jsxs)("aside",{className:"documentation-sidebar","aria-label":"Documentation navigation",children:[(0,C.jsx)("nav",{className:"documentation-page-tree",children:(0,C.jsx)(ya,{activeRoute:e.page.route,basePath:e.basePath,nodes:e.navigation})}),(0,C.jsxs)("div",{className:"documentation-sidebar-footer",children:[!e.config.theme.strictMode&&(0,C.jsx)(qf,{defaultMode:e.config.theme.defaultMode??"system"}),e.config.footer.length>0&&(0,C.jsx)("nav",{"aria-label":"Documentation footer",children:e.config.footer.map(n=>(0,C.jsx)("a",{href:n.href,...ut(n.href),children:n.label},`${n.label}:${n.href}`))}),(0,C.jsx)("span",{children:`Built with deepspace ${Zf}`})]})]})}function ya({activeRoute:e,basePath:n,depth:t=0,nodes:r}){return(0,C.jsx)(C.Fragment,{children:r.map(i=>{if(i.kind==="group"){let c=jf(i,e);return t===0?(0,C.jsxs)("section",{className:"documentation-nav-section",children:[(0,C.jsx)("h2",{children:i.label}),(0,C.jsx)(ya,{activeRoute:e,basePath:n,depth:t+1,nodes:i.items})]},`group:${i.label}`):(0,C.jsxs)("details",{className:"documentation-nav-folder",open:c,children:[(0,C.jsxs)("summary",{children:[(0,C.jsx)("span",{children:i.label}),(0,C.jsx)(va,{})]}),(0,C.jsx)("div",{children:(0,C.jsx)(ya,{activeRoute:e,basePath:n,depth:t+1,nodes:i.items})})]},`group:${i.label}`)}let l=i.kind==="page"?Te(n,i.route):i.href,a=i.kind==="page"&&i.route===e;return(0,C.jsxs)("a",{"aria-current":a?"page":void 0,className:a?"documentation-nav-link is-active":"documentation-nav-link",href:l,...ut(l),children:[(0,C.jsx)("span",{children:i.label}),sa(l)&&(0,C.jsx)(Zi,{})]},`${i.kind}:${l}`)})})}function Kf({data:e,onClose:n,open:t}){let r=(0,$t.useRef)(null);return Cr(t,r,n),t?(0,C.jsx)("div",{className:"documentation-modal-layer",role:"presentation",onMouseDown:i=>{i.currentTarget===i.target&&n()},children:(0,C.jsxs)("div",{className:"documentation-mobile-nav",role:"dialog","aria-modal":"true","aria-label":"Documentation navigation",ref:r,children:[(0,C.jsxs)("header",{children:[(0,C.jsx)("a",{"aria-label":`${St(e.config.name)} home`,className:"documentation-brand",href:e.config.theme.logoHref??Te(e.basePath,"/"),...ut(e.config.theme.logoHref??Te(e.basePath,"/")),children:(0,C.jsx)(Qf,{data:e})}),(0,C.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:n,"aria-label":"Close documentation navigation","data-autofocus":!0,children:(0,C.jsx)(ga,{})})]}),(0,C.jsx)("nav",{className:"documentation-page-tree",children:(0,C.jsx)(ya,{activeRoute:e.page.route,basePath:e.basePath,nodes:e.navigation})}),(0,C.jsxs)("footer",{children:[!e.config.theme.strictMode&&(0,C.jsx)(qf,{defaultMode:e.config.theme.defaultMode??"system"}),e.config.footer.map(i=>(0,C.jsx)("a",{href:i.href,...ut(i.href),children:i.label},`${i.label}:${i.href}`))]})]})}):null}function qf({defaultMode:e}){let[n,t]=(0,$t.useState)(e);(0,$t.useEffect)(()=>{let i=Gi("deepspace-documentation-theme");(i==="light"||i==="dark"||i==="system")&&t(i)},[]),(0,$t.useEffect)(()=>kb(n),[n]);let r=i=>{t(i),Yi("deepspace-documentation-theme",i)};return(0,C.jsxs)("div",{className:"documentation-theme-controls",role:"group","aria-label":"Theme preference",children:[(0,C.jsx)("button",{"aria-pressed":n==="system","aria-label":"Use system theme",onClick:()=>r("system"),type:"button",children:(0,C.jsx)(wf,{})}),(0,C.jsx)("button",{"aria-pressed":n==="light","aria-label":"Use light theme",onClick:()=>r("light"),type:"button",children:(0,C.jsx)(Tf,{})}),(0,C.jsx)("button",{"aria-pressed":n==="dark","aria-label":"Use dark theme",onClick:()=>r("dark"),type:"button",children:(0,C.jsx)(xf,{})})]})}function jf(e,n){return e.items.some(t=>t.kind==="page"?t.route===n:t.kind==="group"&&jf(t,n))}function kb(e){let n=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{document.documentElement.dataset.themeMode=e,document.documentElement.dataset.theme=e==="system"?n.matches?"dark":"light":e};return t(),n.addEventListener?.("change",t),()=>n.removeEventListener?.("change",t)}var je=J(un(),1);var D=J(Ie(),1);function $f({assistantEnabled:e,basePath:n,name:t,onAssistantOpen:r,onClose:i,onNavigate:l,open:a}){let c=(0,je.useRef)(null),o=(0,je.useRef)(null),[u,f]=(0,je.useState)(null),[s,d]=(0,je.useState)(!1),[h,E]=(0,je.useState)(""),[y,g]=(0,je.useState)(0);Cr(a,c,i),(0,je.useEffect)(()=>{!a||u||s||(d(!0),fetch(Te(n,"/search.json")).then(R=>R.ok?R.json():[]).then(f).catch(()=>f([])).finally(()=>d(!1)))},[n,u,s,a]),(0,je.useEffect)(()=>{a||(E(""),g(0))},[a]),(0,je.useEffect)(()=>{o.current?.querySelector(`#documentation-search-option-${y}`)?.scrollIntoView({block:"nearest"})},[y,h]);let m=(0,je.useMemo)(()=>pb(u??[]),[u]),T=(0,je.useMemo)(()=>Sb(m,h),[m,h]);if(!a)return null;let w=T.length+(e&&h.trim()?1:0),I=R=>{if(R.key==="ArrowDown"&&w>0)R.preventDefault(),g(x=>(x+1)%w);else if(R.key==="ArrowUp"&&w>0)R.preventDefault(),g(x=>(x-1+w)%w);else if(R.key==="Enter"){R.preventDefault();let x=y<T.length?T[y]:void 0;if(x){i();let k=Te(n,x.href);l?l(k):window.location.assign(k)}else e&&h.trim()&&r(h.trim())}};return(0,D.jsx)("div",{className:"documentation-modal-layer documentation-search-layer",role:"presentation",onMouseDown:R=>{R.currentTarget===R.target&&i()},children:(0,D.jsxs)("div",{className:"documentation-search-dialog",role:"dialog","aria-modal":"true","aria-label":"Search documentation",ref:c,children:[(0,D.jsxs)("label",{className:"documentation-search-input",children:[(0,D.jsx)(Xi,{}),(0,D.jsx)("input",{"aria-activedescendant":w>0?`documentation-search-option-${y}`:void 0,"aria-controls":"documentation-search-results","aria-expanded":"true","aria-label":`Search ${St(t)}`,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off","data-autofocus":!0,enterKeyHint:"go",onChange:R=>{E(R.target.value),g(0)},onKeyDown:I,placeholder:`Search ${t}`,role:"combobox",spellCheck:!1,value:h}),(0,D.jsx)("kbd",{children:"Esc"})]}),(0,D.jsxs)("div",{className:"documentation-search-results",id:"documentation-search-results",ref:o,role:"listbox","aria-label":"Search results",children:[!h.trim()&&(0,D.jsxs)("div",{className:"documentation-search-empty",children:[(0,D.jsx)(Tr,{}),(0,D.jsx)("strong",{children:"Find an answer in these docs"}),(0,D.jsx)("span",{children:"Search pages, headings, APIs, and examples."})]}),h.trim()&&s&&(0,D.jsx)("div",{className:"documentation-search-state",children:"Searching this documentation\u2026"}),h.trim()&&!s&&T.length===0&&(0,D.jsxs)("div",{className:"documentation-search-state",children:["No documentation matched \u201C",h.trim(),"\u201D."]}),T.map((R,x)=>(0,D.jsxs)("a",{"aria-selected":y===x,className:y===x?"documentation-search-result is-active":"documentation-search-result",href:Te(n,R.href),id:`documentation-search-option-${x}`,onClick:i,onMouseEnter:()=>g(x),role:"option",children:[(0,D.jsx)("span",{className:"documentation-search-kind",children:R.kind==="section"?(0,D.jsx)(Sf,{}):(0,D.jsx)(ba,{})}),(0,D.jsxs)("span",{className:"documentation-search-copy",children:[(0,D.jsx)("strong",{children:Ab(R.title,h)}),R.kind==="section"?(0,D.jsxs)("span",{className:"documentation-search-crumbs",children:[R.context,(0,D.jsx)(pt,{}),R.title]}):(0,D.jsx)("small",{children:R.context})]}),(0,D.jsx)(pt,{})]},R.href)),e&&h.trim()&&(0,D.jsxs)("button",{"aria-selected":y===T.length,className:y===T.length?"documentation-search-assistant is-active":"documentation-search-assistant",id:`documentation-search-option-${T.length}`,onClick:()=>r(h.trim()),onMouseEnter:()=>g(T.length),role:"option",type:"button",children:[(0,D.jsx)(ha,{}),(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{children:"Ask DeepSpace"}),(0,D.jsx)("small",{children:"Answer from the current documentation with citations"})]}),(0,D.jsx)(pt,{})]})]}),(0,D.jsxs)("footer",{children:[(0,D.jsxs)("span",{children:[(0,D.jsx)("kbd",{children:"\u2191"}),(0,D.jsx)("kbd",{children:"\u2193"})," select"]}),(0,D.jsxs)("span",{children:[(0,D.jsx)("kbd",{children:"\u21B5"})," open"]}),(0,D.jsxs)("span",{children:[(0,D.jsx)("kbd",{children:"esc"})," close"]})]})]})})}function pb(e){return e.map(n=>({entry:n,title:Qi(n.title),headings:n.headings.map(t=>({heading:t,normalized:Qi(t.text)})),headingText:Qi(n.headings.map(t=>t.text).join(" ")),haystack:Qi(`${n.description??""} ${n.text}`)}))}function Sb(e,n){let t=Qi(n);if(!t)return[];let r=t.split(" ").filter(Boolean),i=[];for(let{entry:l,title:a,headings:c,headingText:o,haystack:u}of e){let f=a===t?180:a.startsWith(t)?110:a.includes(t)?75:0;o.includes(t)&&(f+=55);for(let s of r)a.includes(s)?f+=24:o.includes(s)?f+=14:u.includes(s)?f+=5:f-=18;f>0&&i.push({route:l.route,score:f,result:{href:l.route,kind:"page",title:l.title,context:l.description??l.text.slice(0,150)}});for(let{heading:s,normalized:d}of c){let h=d===t?120:d.startsWith(t)?80:d.includes(t)?60:0;if(h===0)for(let E of r)d.includes(E)&&(h+=18);h<=0||i.push({route:`${l.route}#${s.id}`,score:h,result:{href:`${l.route}#${s.id}`,kind:"section",title:s.text,context:l.title}})}}return i.sort((l,a)=>a.score-l.score||l.route.localeCompare(a.route)).slice(0,10).map(l=>l.result)}function Ab(e,n){let t=n.trim();if(!t)return e;let r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?e:(0,D.jsxs)(D.Fragment,{children:[e.slice(0,r),(0,D.jsx)("mark",{children:e.slice(r,r+t.length)}),e.slice(r+t.length)]})}function Qi(e){return e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g," ").trim()}var ze=J(Ie(),1);function ed({data:e,children:n,navigating:t=!1,onNavigate:r}){let[i,l]=(0,Bn.useState)(!1),[a,c]=(0,Bn.useState)(!1),[o,u]=(0,Bn.useState)(!1),[f,s]=(0,Bn.useState)(""),[d,h]=(0,Bn.useState)({id:0,submit:!1}),E=e.config.assistant.access==="disabled"?null:e.config.assistant.access,y=E!==null,g=["documentation-app",y?"has-assistant":"",o?"is-assistant-open":"",t?"is-navigating":""].filter(Boolean).join(" "),m=(0,Bn.useCallback)((T,w=!1)=>{T!==void 0&&s(T),h(I=>({id:I.id+1,submit:w,value:T})),c(!1),u(!0)},[]);return(0,Bn.useEffect)(()=>{let T=w=>{(w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="k"&&(w.preventDefault(),c(!0)),(w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="i"&&(w.preventDefault(),e.config.assistant.access!=="disabled"&&m())};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[e.config.assistant.access,m]),(0,Bn.useEffect)(()=>{l(!1),c(!1)},[e.page.route]),(0,ze.jsxs)("div",{"aria-busy":t||void 0,className:g,children:[(0,ze.jsx)("a",{className:"documentation-skip-link",href:"#documentation-content",children:"Skip to main content"}),(0,ze.jsx)(Jf,{data:e,onMenuOpen:()=>l(!0),onSearchOpen:()=>c(!0)}),(0,ze.jsxs)("div",{className:"documentation-frame",children:[(0,ze.jsx)(Vf,{data:e}),(0,ze.jsx)("main",{className:"documentation-main",id:"documentation-content",children:(0,ze.jsxs)("div",{className:"documentation-reader-grid",children:[(0,ze.jsx)("div",{className:"documentation-reader-column",children:(0,ze.jsx)(Ff,{data:e,launcher:E&&!o?(0,ze.jsx)(Yf,{input:f,name:e.config.name,onInputChange:s,onSubmit:T=>m(T,!0)}):void 0,onAssistantOpen:m,children:n})}),(0,ze.jsx)(Bf,{data:e})]})})]}),(0,ze.jsx)(Kf,{data:e,onClose:()=>l(!1),open:i}),(0,ze.jsx)($f,{assistantEnabled:y,basePath:e.basePath,name:e.config.name,onAssistantOpen:m,onClose:()=>c(!1),onNavigate:r,open:a}),E&&(0,ze.jsx)(Xf,{access:E,basePath:e.basePath,input:f,name:e.config.name,onClose:()=>u(!1),onInputChange:s,open:o,route:e.page.route,seed:d,suggestions:e.config.assistant.suggestions})]})}function Ib(e){return(0,td.renderToString)((0,nd.createElement)(ed,{data:e}))}0&&(module.exports={renderDefaultDocumentation});
67
+ `),r=[],i=0;for(;i<t.length;){let l=t[i]?.trim()??"";if(!l){i+=1;continue}let a=l.match(/^(#{1,4})\s+(.+)$/);if(a){r.push((0,M.jsx)("strong",{className:"documentation-assistant-heading",children:sc(a[2])},`${n}-heading-${i}`)),i+=1;continue}let c=/^[-*]\s+/.test(l),o=/^\d+[.)]\s+/.test(l);if(c||o){let f=[];for(;i<t.length;){let s=t[i]?.trim()??"",d=c?s.match(/^[-*]\s+(.+)$/):s.match(/^\d+[.)]\s+(.+)$/);if(!d)break;f.push((0,M.jsx)("li",{children:sc(d[1])},`${n}-item-${i}`)),i+=1}r.push(c?(0,M.jsx)("ul",{children:f},`${n}-list-${i}`):(0,M.jsx)("ol",{children:f},`${n}-list-${i}`));continue}let u=[l];for(i+=1;i<t.length;){let f=t[i]?.trim()??"";if(!f||/^(?:#{1,4}\s+|[-*]\s+|\d+[.)]\s+)/.test(f))break;u.push(f),i+=1}r.push((0,M.jsx)("p",{children:u.map((f,s)=>(0,M.jsxs)("span",{children:[sc(f),s<u.length-1&&" "]},`${s}:${f.slice(0,18)}`))},`${n}-paragraph-${i}`))}return r}function sc(e){let n=/(\[[^\]]+\]\((?:https?:\/\/|\/)[^)]+\)|`[^`]+`|\*\*[^*]+\*\*)/g;return e.split(n).filter(Boolean).map((t,r)=>{let i=t.match(/^\[([^\]]+)\]\(((?:https?:\/\/|\/)[^)]+)\)$/);return i?(0,M.jsx)("a",{href:i[2],...ut(i[2]),children:i[1]},`${r}:${t}`):t.startsWith("`")&&t.endsWith("`")?(0,M.jsx)("code",{children:t.slice(1,-1)},`${r}:${t}`):t.startsWith("**")&&t.endsWith("**")?(0,M.jsx)("strong",{children:t.slice(2,-2)},`${r}:${t}`):(0,M.jsx)("span",{children:t},`${r}:${t}`)})}var $t=J(un(),1);var Zf="0.35.0";var C=J(Ie(),1);function Jf({data:e,onMenuOpen:n,onSearchOpen:t}){return(0,C.jsxs)("header",{className:"documentation-header",children:[(0,C.jsx)("a",{className:"documentation-brand",href:e.config.theme.logoHref??Te(e.basePath,"/"),"aria-label":`${St(e.config.name)} home`,...ut(e.config.theme.logoHref??Te(e.basePath,"/")),children:(0,C.jsx)(Qf,{data:e})}),(0,C.jsx)("div",{className:"documentation-header-center",children:(0,C.jsxs)("button",{className:"documentation-search-trigger",type:"button",onClick:t,"aria-label":"Search documentation",children:[(0,C.jsx)(Xi,{}),(0,C.jsx)("span",{children:"Search documentation"}),(0,C.jsx)("kbd",{children:"\u2318K"})]})}),(0,C.jsx)("nav",{className:"documentation-top-links","aria-label":"Product navigation",children:e.config.links.map(r=>(0,C.jsxs)("a",{href:r.href,...ut(r.href),children:[r.label,sa(r.href)&&(0,C.jsx)(Zi,{})]},`${r.label}:${r.href}`))}),(0,C.jsxs)("div",{className:"documentation-mobile-actions",children:[(0,C.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:t,"aria-label":"Search documentation",children:(0,C.jsx)(Xi,{})}),(0,C.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:n,"aria-label":"Open documentation navigation",children:(0,C.jsx)(Ef,{})})]})]})}function Qf({data:e}){let{logo:n,logoDark:t}=e.config.theme;return n?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("img",{className:"documentation-brand-logo documentation-brand-logo-light",src:n,alt:""}),(0,C.jsx)("img",{className:"documentation-brand-logo documentation-brand-logo-dark",src:t??n,alt:""}),(0,C.jsx)("span",{className:"documentation-brand-product",children:"Documentation"})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{className:"documentation-brand-mark",children:(0,C.jsx)(Tr,{})}),(0,C.jsx)("span",{className:"documentation-brand-name",children:e.config.name})]})}function Vf({data:e}){return(0,C.jsxs)("aside",{className:"documentation-sidebar","aria-label":"Documentation navigation",children:[(0,C.jsx)("nav",{className:"documentation-page-tree",children:(0,C.jsx)(ya,{activeRoute:e.page.route,basePath:e.basePath,nodes:e.navigation})}),(0,C.jsxs)("div",{className:"documentation-sidebar-footer",children:[!e.config.theme.strictMode&&(0,C.jsx)(qf,{defaultMode:e.config.theme.defaultMode??"system"}),e.config.footer.length>0&&(0,C.jsx)("nav",{"aria-label":"Documentation footer",children:e.config.footer.map(n=>(0,C.jsx)("a",{href:n.href,...ut(n.href),children:n.label},`${n.label}:${n.href}`))}),(0,C.jsx)("span",{children:`Built with deepspace ${Zf}`})]})]})}function ya({activeRoute:e,basePath:n,depth:t=0,nodes:r}){return(0,C.jsx)(C.Fragment,{children:r.map(i=>{if(i.kind==="group"){let c=jf(i,e);return t===0?(0,C.jsxs)("section",{className:"documentation-nav-section",children:[(0,C.jsx)("h2",{children:i.label}),(0,C.jsx)(ya,{activeRoute:e,basePath:n,depth:t+1,nodes:i.items})]},`group:${i.label}`):(0,C.jsxs)("details",{className:"documentation-nav-folder",open:c,children:[(0,C.jsxs)("summary",{children:[(0,C.jsx)("span",{children:i.label}),(0,C.jsx)(va,{})]}),(0,C.jsx)("div",{children:(0,C.jsx)(ya,{activeRoute:e,basePath:n,depth:t+1,nodes:i.items})})]},`group:${i.label}`)}let l=i.kind==="page"?Te(n,i.route):i.href,a=i.kind==="page"&&i.route===e;return(0,C.jsxs)("a",{"aria-current":a?"page":void 0,className:a?"documentation-nav-link is-active":"documentation-nav-link",href:l,...ut(l),children:[(0,C.jsx)("span",{children:i.label}),sa(l)&&(0,C.jsx)(Zi,{})]},`${i.kind}:${l}`)})})}function Kf({data:e,onClose:n,open:t}){let r=(0,$t.useRef)(null);return Cr(t,r,n),t?(0,C.jsx)("div",{className:"documentation-modal-layer",role:"presentation",onMouseDown:i=>{i.currentTarget===i.target&&n()},children:(0,C.jsxs)("div",{className:"documentation-mobile-nav",role:"dialog","aria-modal":"true","aria-label":"Documentation navigation",ref:r,children:[(0,C.jsxs)("header",{children:[(0,C.jsx)("a",{"aria-label":`${St(e.config.name)} home`,className:"documentation-brand",href:e.config.theme.logoHref??Te(e.basePath,"/"),...ut(e.config.theme.logoHref??Te(e.basePath,"/")),children:(0,C.jsx)(Qf,{data:e})}),(0,C.jsx)("button",{className:"documentation-icon-button",type:"button",onClick:n,"aria-label":"Close documentation navigation","data-autofocus":!0,children:(0,C.jsx)(ga,{})})]}),(0,C.jsx)("nav",{className:"documentation-page-tree",children:(0,C.jsx)(ya,{activeRoute:e.page.route,basePath:e.basePath,nodes:e.navigation})}),(0,C.jsxs)("footer",{children:[!e.config.theme.strictMode&&(0,C.jsx)(qf,{defaultMode:e.config.theme.defaultMode??"system"}),e.config.footer.map(i=>(0,C.jsx)("a",{href:i.href,...ut(i.href),children:i.label},`${i.label}:${i.href}`))]})]})}):null}function qf({defaultMode:e}){let[n,t]=(0,$t.useState)(e);(0,$t.useEffect)(()=>{let i=Gi("deepspace-documentation-theme");(i==="light"||i==="dark"||i==="system")&&t(i)},[]),(0,$t.useEffect)(()=>kb(n),[n]);let r=i=>{t(i),Yi("deepspace-documentation-theme",i)};return(0,C.jsxs)("div",{className:"documentation-theme-controls",role:"group","aria-label":"Theme preference",children:[(0,C.jsx)("button",{"aria-pressed":n==="system","aria-label":"Use system theme",onClick:()=>r("system"),type:"button",children:(0,C.jsx)(wf,{})}),(0,C.jsx)("button",{"aria-pressed":n==="light","aria-label":"Use light theme",onClick:()=>r("light"),type:"button",children:(0,C.jsx)(Tf,{})}),(0,C.jsx)("button",{"aria-pressed":n==="dark","aria-label":"Use dark theme",onClick:()=>r("dark"),type:"button",children:(0,C.jsx)(xf,{})})]})}function jf(e,n){return e.items.some(t=>t.kind==="page"?t.route===n:t.kind==="group"&&jf(t,n))}function kb(e){let n=window.matchMedia("(prefers-color-scheme: dark)"),t=()=>{document.documentElement.dataset.themeMode=e,document.documentElement.dataset.theme=e==="system"?n.matches?"dark":"light":e};return t(),n.addEventListener?.("change",t),()=>n.removeEventListener?.("change",t)}var je=J(un(),1);var D=J(Ie(),1);function $f({assistantEnabled:e,basePath:n,name:t,onAssistantOpen:r,onClose:i,onNavigate:l,open:a}){let c=(0,je.useRef)(null),o=(0,je.useRef)(null),[u,f]=(0,je.useState)(null),[s,d]=(0,je.useState)(!1),[h,E]=(0,je.useState)(""),[y,g]=(0,je.useState)(0);Cr(a,c,i),(0,je.useEffect)(()=>{!a||u||s||(d(!0),fetch(Te(n,"/search.json")).then(R=>R.ok?R.json():[]).then(f).catch(()=>f([])).finally(()=>d(!1)))},[n,u,s,a]),(0,je.useEffect)(()=>{a||(E(""),g(0))},[a]),(0,je.useEffect)(()=>{o.current?.querySelector(`#documentation-search-option-${y}`)?.scrollIntoView({block:"nearest"})},[y,h]);let m=(0,je.useMemo)(()=>pb(u??[]),[u]),T=(0,je.useMemo)(()=>Sb(m,h),[m,h]);if(!a)return null;let w=T.length+(e&&h.trim()?1:0),I=R=>{if(R.key==="ArrowDown"&&w>0)R.preventDefault(),g(x=>(x+1)%w);else if(R.key==="ArrowUp"&&w>0)R.preventDefault(),g(x=>(x-1+w)%w);else if(R.key==="Enter"){R.preventDefault();let x=y<T.length?T[y]:void 0;if(x){i();let k=Te(n,x.href);l?l(k):window.location.assign(k)}else e&&h.trim()&&r(h.trim())}};return(0,D.jsx)("div",{className:"documentation-modal-layer documentation-search-layer",role:"presentation",onMouseDown:R=>{R.currentTarget===R.target&&i()},children:(0,D.jsxs)("div",{className:"documentation-search-dialog",role:"dialog","aria-modal":"true","aria-label":"Search documentation",ref:c,children:[(0,D.jsxs)("label",{className:"documentation-search-input",children:[(0,D.jsx)(Xi,{}),(0,D.jsx)("input",{"aria-activedescendant":w>0?`documentation-search-option-${y}`:void 0,"aria-controls":"documentation-search-results","aria-expanded":"true","aria-label":`Search ${St(t)}`,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off","data-autofocus":!0,enterKeyHint:"go",onChange:R=>{E(R.target.value),g(0)},onKeyDown:I,placeholder:`Search ${t}`,role:"combobox",spellCheck:!1,value:h}),(0,D.jsx)("kbd",{children:"Esc"})]}),(0,D.jsxs)("div",{className:"documentation-search-results",id:"documentation-search-results",ref:o,role:"listbox","aria-label":"Search results",children:[!h.trim()&&(0,D.jsxs)("div",{className:"documentation-search-empty",children:[(0,D.jsx)(Tr,{}),(0,D.jsx)("strong",{children:"Find an answer in these docs"}),(0,D.jsx)("span",{children:"Search pages, headings, APIs, and examples."})]}),h.trim()&&s&&(0,D.jsx)("div",{className:"documentation-search-state",children:"Searching this documentation\u2026"}),h.trim()&&!s&&T.length===0&&(0,D.jsxs)("div",{className:"documentation-search-state",children:["No documentation matched \u201C",h.trim(),"\u201D."]}),T.map((R,x)=>(0,D.jsxs)("a",{"aria-selected":y===x,className:y===x?"documentation-search-result is-active":"documentation-search-result",href:Te(n,R.href),id:`documentation-search-option-${x}`,onClick:i,onMouseEnter:()=>g(x),role:"option",children:[(0,D.jsx)("span",{className:"documentation-search-kind",children:R.kind==="section"?(0,D.jsx)(Sf,{}):(0,D.jsx)(ba,{})}),(0,D.jsxs)("span",{className:"documentation-search-copy",children:[(0,D.jsx)("strong",{children:Ab(R.title,h)}),R.kind==="section"?(0,D.jsxs)("span",{className:"documentation-search-crumbs",children:[R.context,(0,D.jsx)(pt,{}),R.title]}):(0,D.jsx)("small",{children:R.context})]}),(0,D.jsx)(pt,{})]},R.href)),e&&h.trim()&&(0,D.jsxs)("button",{"aria-selected":y===T.length,className:y===T.length?"documentation-search-assistant is-active":"documentation-search-assistant",id:`documentation-search-option-${T.length}`,onClick:()=>r(h.trim()),onMouseEnter:()=>g(T.length),role:"option",type:"button",children:[(0,D.jsx)(ha,{}),(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{children:"Ask DeepSpace"}),(0,D.jsx)("small",{children:"Answer from the current documentation with citations"})]}),(0,D.jsx)(pt,{})]})]}),(0,D.jsxs)("footer",{children:[(0,D.jsxs)("span",{children:[(0,D.jsx)("kbd",{children:"\u2191"}),(0,D.jsx)("kbd",{children:"\u2193"})," select"]}),(0,D.jsxs)("span",{children:[(0,D.jsx)("kbd",{children:"\u21B5"})," open"]}),(0,D.jsxs)("span",{children:[(0,D.jsx)("kbd",{children:"esc"})," close"]})]})]})})}function pb(e){return e.map(n=>({entry:n,title:Qi(n.title),headings:n.headings.map(t=>({heading:t,normalized:Qi(t.text)})),headingText:Qi(n.headings.map(t=>t.text).join(" ")),haystack:Qi(`${n.description??""} ${n.text}`)}))}function Sb(e,n){let t=Qi(n);if(!t)return[];let r=t.split(" ").filter(Boolean),i=[];for(let{entry:l,title:a,headings:c,headingText:o,haystack:u}of e){let f=a===t?180:a.startsWith(t)?110:a.includes(t)?75:0;o.includes(t)&&(f+=55);for(let s of r)a.includes(s)?f+=24:o.includes(s)?f+=14:u.includes(s)?f+=5:f-=18;f>0&&i.push({route:l.route,score:f,result:{href:l.route,kind:"page",title:l.title,context:l.description??l.text.slice(0,150)}});for(let{heading:s,normalized:d}of c){let h=d===t?120:d.startsWith(t)?80:d.includes(t)?60:0;if(h===0)for(let E of r)d.includes(E)&&(h+=18);h<=0||i.push({route:`${l.route}#${s.id}`,score:h,result:{href:`${l.route}#${s.id}`,kind:"section",title:s.text,context:l.title}})}}return i.sort((l,a)=>a.score-l.score||l.route.localeCompare(a.route)).slice(0,10).map(l=>l.result)}function Ab(e,n){let t=n.trim();if(!t)return e;let r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?e:(0,D.jsxs)(D.Fragment,{children:[e.slice(0,r),(0,D.jsx)("mark",{children:e.slice(r,r+t.length)}),e.slice(r+t.length)]})}function Qi(e){return e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g," ").trim()}var ze=J(Ie(),1);function ed({data:e,children:n,navigating:t=!1,onNavigate:r}){let[i,l]=(0,Bn.useState)(!1),[a,c]=(0,Bn.useState)(!1),[o,u]=(0,Bn.useState)(!1),[f,s]=(0,Bn.useState)(""),[d,h]=(0,Bn.useState)({id:0,submit:!1}),E=e.config.assistant.access==="disabled"?null:e.config.assistant.access,y=E!==null,g=["documentation-app",y?"has-assistant":"",o?"is-assistant-open":"",t?"is-navigating":""].filter(Boolean).join(" "),m=(0,Bn.useCallback)((T,w=!1)=>{T!==void 0&&s(T),h(I=>({id:I.id+1,submit:w,value:T})),c(!1),u(!0)},[]);return(0,Bn.useEffect)(()=>{let T=w=>{(w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="k"&&(w.preventDefault(),c(!0)),(w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="i"&&(w.preventDefault(),e.config.assistant.access!=="disabled"&&m())};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[e.config.assistant.access,m]),(0,Bn.useEffect)(()=>{l(!1),c(!1)},[e.page.route]),(0,ze.jsxs)("div",{"aria-busy":t||void 0,className:g,children:[(0,ze.jsx)("a",{className:"documentation-skip-link",href:"#documentation-content",children:"Skip to main content"}),(0,ze.jsx)(Jf,{data:e,onMenuOpen:()=>l(!0),onSearchOpen:()=>c(!0)}),(0,ze.jsxs)("div",{className:"documentation-frame",children:[(0,ze.jsx)(Vf,{data:e}),(0,ze.jsx)("main",{className:"documentation-main",id:"documentation-content",children:(0,ze.jsxs)("div",{className:"documentation-reader-grid",children:[(0,ze.jsx)("div",{className:"documentation-reader-column",children:(0,ze.jsx)(Ff,{data:e,launcher:E&&!o?(0,ze.jsx)(Yf,{input:f,name:e.config.name,onInputChange:s,onSubmit:T=>m(T,!0)}):void 0,onAssistantOpen:m,children:n})}),(0,ze.jsx)(Bf,{data:e})]})})]}),(0,ze.jsx)(Kf,{data:e,onClose:()=>l(!1),open:i}),(0,ze.jsx)($f,{assistantEnabled:y,basePath:e.basePath,name:e.config.name,onAssistantOpen:m,onClose:()=>c(!1),onNavigate:r,open:a}),E&&(0,ze.jsx)(Xf,{access:E,basePath:e.basePath,input:f,name:e.config.name,onClose:()=>u(!1),onInputChange:s,open:o,route:e.page.route,seed:d,suggestions:e.config.assistant.suggestions})]})}function Ib(e){return(0,td.renderToString)((0,nd.createElement)(ed,{data:e}))}0&&(module.exports={renderDefaultDocumentation});
68
68
  /*! Bundled license information:
69
69
 
70
70
  react/cjs/react.production.js:
@@ -14,7 +14,7 @@ import {
14
14
  Tabs,
15
15
  Tip,
16
16
  Warning
17
- } from "./chunk-PZDVKSLI.js";
17
+ } from "./chunk-ESYXTIV2.js";
18
18
  export {
19
19
  Accordion,
20
20
  AccordionGroup,