1import{z as I,f as j,k as e,E as S,aE as $,bi as D,r as h,R as k,i as T,e as R,d as P,ax as L,a4 as A}from"./main-DK4sLkaF.js";import{g as B}from"./MarkDownComponents-DoM93Nrj.js";const N={all:["docs"],content:t=>[...N.all,"content",t]};function M(t){return I({queryKey:N.content(t||""),queryFn:async()=>{if(!t)throw new Error("File is required");const s=await fetch(`/docs/${t}`);if(!s.ok)throw new Error(`Failed to load documentation: ${s.statusText}`);const i=await s.text();if(i.startsWith("<!doctype html>")||i.startsWith("<!DOCTYPE html>"))throw new Error("Documentation content not found");return i},enabled:!!t,staleTime:600*1e3,retry:2})}const q=({children:t})=>{const s=j(c=>c.mode),i=B(s),l={textPrimary:s?"#ffffff":"#1a1a1a",textTertiary:s?"#737373":"#9ca3af",border:s?"#2a2a2a":"#e5e7eb",success:"#8b5cf6",successBg:s?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.08)"};return e.jsx("div",{className:"docs-container w-full overflow-y-auto h-full scrollbar-thin scrollbar-thumb-transparent font-documentation",style:{color:l.textPrimary},children:e.jsxs("div",{className:"p-6 md:p-8 shadow-none",children:[e.jsx("div",{className:"mb-6 text-center",children:e.jsx("div",{className:"flex justify-center gap-3 mb-4 flex-wrap",children:e.jsx(S,{className:"text-xs font-medium h-[22px] rounded-md",style:{backgroundColor:l.successBg,color:l.success,border:`1px solid ${l.success}`},children:"API v1.0"})})}),e.jsx("div",{className:"[&>*:first-child]:mt-0 [&>*:last-child]:mb-0",children:e.jsx($,{remarkPlugins:[D],components:i,children:t})}),e.jsx("div",{className:"mt-6 pt-4 text-center",style:{borderTop:`1px solid ${l.border}`},children:e.jsx("p",{className:"text-[0.75rem]",style:{color:l.textTertiary},children:"For technical support and advanced integrations, contact our engineering team."})})]})})},w=t=>t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-"),G=({markdownContent:t,mode:s})=>{const[i,l]=h.useState(""),c=k.useRef(!1),m=h.useMemo(()=>{const n=[],r=/^##\s+(.+)$/gm,a=/^###\s+(.+)$/gm;let d;for(;(d=r.exec(t))!==null;){const x=d[1];n.push({id:w(x),text:x,level:2})}for(;(d=a.exec(t))!==null;){const x=d[1];n.push({id:w(x),text:x,level:3})}return n},[t]);h.useEffect(()=>{if(m.length===0)return;const n=new IntersectionObserver(r=>{c.current||r.forEach(a=>{if(a.isIntersecting){const d=a.target.getAttribute("id");d&&l(d)}})},{rootMargin:"-80px 0px -80% 0px",threshold:0});return m.forEach(r=>{const a=document.getElementById(r.id);a&&n.observe(a)}),()=>n.disconnect()},[m]);const f=n=>{l(n),c.current=!0;const r=document.getElementById(n);r&&(r.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout(()=>{c.current=!1},1e3))};if(m.length===0)return null;const u={text:s?"#e5e5e5":"#1f2937",textSecondary:s?"#a3a3a3":"#6b7280",primary:"var(--primary)",hoverBg:s?"rgba(255, 255, 255, 0.05)":"rgba(0, 0, 0, 0.05)"};return e.jsx("nav",{className:"hidden xl:block w-64 flex-shrink-0 sticky top-24 self-start max-h-[calc(100vh-7rem)] overflow-y-auto pl-6",style:{scrollbarWidth:"thin"},children:e.jsxs("div",{className:"pb-4",children:[e.jsx("h4",{className:"text-sm font-semibold mb-4 font-documentation uppercase tracking-wider",style:{color:u.text},children:"On this page"}),e.jsx("ul",{className:"space-y-1",children:m.map(n=>e.jsx("li",{className:n.level===3?"pl-4":"",children:e.jsx("button",{onClick:()=>f(n.id),className:`w-full text-left py-1.5 px-2 rounded text-sm transition-all duration-150 font-documentation ${i===n.id?"font-semibold":"font-light"}`,style:{color:i===n.id?u.primary:u.textSecondary,backgroundColor:i===n.id?u.hoverBg:"transparent",borderLeft:i===n.id?`2px solid ${u.primary}`:"2px solid transparent",paddingLeft:i===n.id?"0.4rem":"0.5rem"},onMouseEnter:r=>{i!==n.id&&(r.currentTarget.style.backgroundColor=u.hoverBg)},onMouseLeave:r=>{i!==n.id&&(r.currentTarget.style.backgroundColor="transparent")},children:n.text})},n.id))})]})})},y=[{id:"overview",title:"Overview",icon:null,file:"overview.md",section:"Getting Started"},{id:"quickstart",title:"Quick Start",icon:null,file:"quickstart.md",section:"Getting Started"},{id:"claude-code",title:"Claude Code",icon:null,file:"claude-code-integration.md",section:"Setup Guides"},{id:"codex",title:"Codex CLI",icon:null,file:"codex-integration.md",section:"Setup Guides"},{id:"cursor-integration",title:"Cursor",icon:null,file:"cursor-integration.md",section:"Setup Guides"},{id:"kilocode",title:"KiloCode",icon:null,file:"kilocode-integration.md",section:"IDE Integrations"},{id:"windsurf",title:"Windsurf",icon:null,file:"windsurf-integration.md",section:"IDE Integrations"},{id:"cline",title:"Cline",icon:null,file:"cline-integration.md",section:"IDE Integrations"},{id:"roocode",title:"Roo Code",icon:null,file:"roocode-integration.md",section:"IDE Integrations"},{id:"aider",title:"Aider",icon:null,file:"aider-integration.md",section:"CLI Tools"},{id:"openhands",title:"OpenHands",icon:null,file:"openhands-integration.md",section:"CLI Tools"},{id:"agentic-tool-calling",title:"Agentic Tool Calling",icon:null,file:"agentic-tool-calling.md",section:"Agentic"},{id:"api-reference",title:"API Reference",icon:null,file:"api-reference.md",section:"Resources"},{id:"examples",title:"Examples",icon:null,file:"examples.md",section:"Resources"},{id:"best-practices",title:"Best Practices",icon:null,file:"best-practices.md",section:"Resources"},{id:"error-handling",title:"Error Handling",icon:null,file:"error-handling.md",section:"Resources"}],W=()=>{const t=j(o=>o.mode),{isDeveloperPortal:s}=T(),i=R(),l=P(),c=h.useMemo(()=>s?y.filter(o=>!["overview","quickstart","api-reference"].includes(o.id)):y,[s]),m=l.pathname.split("/"),f=c[0]?.id||"overview",u=m[2]||f,n=c.find(o=>o.id===u)||c[0],{data:r,isLoading:a,error:d}=M(n.file),x=h.useMemo(()=>!s||!r?r||"":r.replace(/\/v1\/tokenreduction/g,"/v1/code").replace(/tokenreduction/g,"code").replace(/Token Reduction/g,"Code Generation").replace(/token reduction/g,"code generation"),[r,s]),p=d?d.message:null,C=o=>{i(`/docs/${o}`)};return e.jsxs("div",{className:`flex h-full ${t?"bg-background":"bg-white"}`,children:[e.jsx("div",{className:`hidden w-64 border-r border-border-default flex-shrink-0 overflow-y-auto md:block ${t?"bg-card":"bg-white"}`,children:e.jsxs("div",{className:"p-4",children:[e.jsx("h2",{className:`text-lg font-semibold mb-4 ${t?"text-white":"text-black"}`,children:"Documentation"}),e.jsx("nav",{className:"space-y-0.5",children:c.map((o,g)=>{const b=o.id===u,v=g>0?c[g-1]:null,E=!v||v.section!==o.section;return e.jsxs(k.Fragment,{children:[E&&o.section&&e.jsx("div",{className:`${g>0?"mt-6":"mt-0"} mb-2`,children:e.jsx("div",{className:`text-xs font-semibold uppercase tracking-wider px-3 py-2 ${t?"text-white/40":"text-black/40"}`,children:o.section})}),e.jsxs("button",{onClick:()=>C(o.id),className:`w-full flex items-center justify-between px-3 py-2.5 rounded-lg text-sm font-medium transition-colors ${b?t?"bg-primary/20 text-primary border border-primary/30":"bg-primary/10 text-primary border border-primary/30":t?"text-white/70 hover:text-white hover:bg-white/5":"text-black/70 hover:text-black hover:bg-black/5"}`,children:[e.jsx("span",{className:"text-left",children:o.title}),b&&e.jsx(L,{className:"h-4 w-4 shrink-0"})]})]},o.id)})})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"max-w-[1400px] mx-auto flex",children:[e.jsx("div",{className:"flex-1 min-w-0",children:a?e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:`text-center ${t?"text-white/70":"text-black/70"}`,children:[e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"}),e.jsx("p",{children:"Loading documentation..."})]})}):p?e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"text-center",children:[e.jsx(A,{className:"h-12 w-12 text-red-500 mx-auto mb-4"}),e.jsx("h3",{className:`text-lg font-semibold mb-2 ${t?"text-white":"text-black"}`,children:"Error Loading Documentation"}),e.jsx("p",{className:t?"text-white/70":"text-black/70",children:p})]})}):e.jsx(q,{children:x})}),!a&&!p&&r&&e.jsx(G,{markdownContent:r,mode:t})]})})]})};export{W 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.