docstra 1.8.1 → 1.8.2

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.
@@ -1 +1 @@
1
- "use strict";"use client";var Be=Object.create;var F=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Ae=Object.getOwnPropertyNames;var $e=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty;var Me=(e,r)=>{for(var t in r)F(e,t,{get:r[t],enumerable:!0})},ne=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Ae(r))!He.call(e,a)&&a!==t&&F(e,a,{get:()=>r[a],enumerable:!(o=Ge(r,a))||o.enumerable});return e};var L=(e,r,t)=>(t=e!=null?Be($e(e)):{},ne(r||!e||!e.__esModule?F(t,"default",{value:e,enumerable:!0}):t,e)),qe=e=>ne(F({},"__esModule",{value:!0}),e);var _e={};Me(_e,{DocstraBody:()=>Ye,DocstraCodeBlock:()=>Qe,DocstraHeader:()=>Ue,DocstraPage:()=>Ve,DocstraProvider:()=>Fe,useDocstra:()=>d});module.exports=qe(_e);var I=require("react"),ue=require("react-toast-msg");var le=require("lucide-react");var se=require("tailwind-merge"),ie=L(require("clsx"));function f(...e){return(0,se.twMerge)((0,ie.default)(e))}var D=require("react"),ce=L(require("fuse.js")),me=L(require("next/link")),de=require("next/navigation"),h=require("react/jsx-runtime");function pe(){let{openSearchBox:e,setOpenSearchBox:r,docs:t}=d(),[o,a]=(0,D.useState)(""),[n,s]=(0,D.useState)([]),m=(0,de.useRouter)();(0,D.useEffect)(()=>{let i=p=>{p.ctrlKey&&p.key==="k"&&(p.preventDefault(),r(!0))};return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[]);let g=(0,D.useMemo)(()=>!t||t.length===0?null:new ce.default(t,{keys:["data.metadata.title","data.metadata.description"],threshold:.3}),[t]);(0,D.useEffect)(()=>{if(o&&g){let i=g.search(o);s(i.map(p=>p.item))}else o||s([])},[o,g]);let k=i=>{if(i.preventDefault(),o){let p=n[0];p&&(m.push(`/docs/${p.slug}`),a(""),r(!1))}};return(0,D.useEffect)(()=>{let i=p=>{p.key==="Escape"&&(r(!1),a(""))};return e&&window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[e]),(0,h.jsx)("div",{onClick:()=>{r(!1),a("")},className:f("fixed inset-0 z-25 flex items-start justify-center bg-white/40 backdrop-blur-md opacity-0 pointer-events-none transition-all duration-300",e&&"opacity-100 pointer-events-auto"),children:(0,h.jsxs)("div",{onClick:i=>i.stopPropagation(),className:"flex flex-col items-center mt-30 max-w-lg w-full max-md:px-4",children:[(0,h.jsx)("form",{onSubmit:k,className:f("relative flex items-center justify-between w-full bg-white border border-slate-200 text-gray-400 h-15 p-0.5 rounded-md",o&&"rounded-b-none border-b-0"),children:e&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(le.SearchIcon,{className:"size-5.5 mx-3 shrink-0"}),(0,h.jsx)("input",{className:"w-full bg-transparent h-full outline-none text-gray-400 placeholder:text-gray-400",type:"text",placeholder:"Search docs...",spellCheck:"false",autoFocus:!0,value:o,onChange:i=>a(i.target.value),name:"searchQuery",required:!0}),(0,h.jsx)("span",{className:"border border-gray-200 px-2 mr-3 py-1 rounded text-xs",children:"Esc"})]})}),(0,h.jsxs)("div",{className:f("max-h-70 overflow-x-hidden overflow-y-auto scrollbar-y w-full bg-white text-slate-700 flex flex-col",o&&"rounded-b-md border border-slate-200"),children:[n.map(i=>(0,h.jsxs)(me.default,{href:`/docs/${i.slug==="index"?"":i.slug}`,onClick:()=>{r(!1),a("")},className:"w-full hover:bg-gray-100/70 border-b border-slate-200 transition-all py-4 px-4 last:mb-2",children:[(0,h.jsx)("h4",{className:"font-medium",children:i.data?.metadata?.title||i.slug}),(0,h.jsx)("p",{className:"text-sm mt-1 text-gray-500",children:i.data?.metadata?.description})]},i.slug)),o&&n.length===0&&(0,h.jsx)("div",{className:"text-gray-500 text-center py-20",children:"No results found"})]})]})})}var G=require("react/jsx-runtime"),fe=(0,I.createContext)(null);function Fe({children:e,docstraConfig:r,docs:t,pageData:o,slug:a}){let n=o||(()=>{let i=Array.isArray(a)?a.length===0?"index":a.join("/"):a||"index";return t.find(p=>p.slug===i)})(),[s,m]=(0,I.useState)(!1),[g,k]=(0,I.useState)(!1);return(0,G.jsxs)(fe.Provider,{value:{openSidebar:s,setOpenSidebar:m,docstraConfig:r,openSearchBox:g,setOpenSearchBox:k,pageData:n,docs:t},children:[(0,G.jsx)(ue.ToastContainer,{}),(0,G.jsx)(pe,{}),e]})}function d(){let e=(0,I.useContext)(fe);if(!e)throw new Error("Please wrap your app with DocstraProvider");return e}var K=require("lucide-react"),ge=require("react");var U=L(require("next/link")),w=require("react/jsx-runtime");function Ue(){let{openSidebar:e,setOpenSidebar:r,docstraConfig:t}=d(),o="https://github.com/"+t?.editOnGithub?.owner+"/"+t?.editOnGithub?.repo;return(0,ge.useEffect)(()=>{e?document.body.classList.add("max-md:overflow-hidden"):document.body.classList.remove("max-md:overflow-hidden")},[e]),(0,w.jsxs)("header",{className:"sticky top-0 z-10 text-sm flex items-center justify-between border-b border-gray-100 h-18 px-4 md:px-6 bg-white",children:[(0,w.jsx)(U.default,{href:t.navbar?.logo?.link||"/",className:"hover:opacity-80 transition",children:(0,w.jsx)("img",{src:t.navbar?.logo?.src||"/logo.png",alt:t.navbar?.logo?.alt||"Logo",className:f("h-9.5 w-auto",t.navbar?.logo?.className)})}),(0,w.jsxs)("div",{className:"hidden divide-x divide-gray-200 md:flex items-center",children:[t.navbar?.links?.map(a=>(0,w.jsx)(U.default,{href:a.href,className:"px-6 hover:text-gray-600",children:a.name},a.name)),(0,w.jsx)(U.default,{href:o||"https://github.com/sudhucodes/docstra",children:(0,w.jsx)("svg",{className:"size-6 mx-6",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:(0,w.jsx)("path",{d:"M12 .3a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57L9 21.07c-3.34.72-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.08-.74.09-.73.09-.73 1.2.09 1.83 1.24 1.83 1.24 1.08 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22l-.01 3.29c0 .31.2.69.82.57A12 12 0 0 0 12 .3"})})})]}),(0,w.jsx)("button",{onClick:()=>r(!e),className:"md:hidden transition text-gray-600 active:ring-2 ring-gray-200 p-1.5 rounded-md",children:e?(0,w.jsx)(K.XIcon,{className:"size-6.5"}):(0,w.jsx)(K.TextAlignEnd,{className:"size-6.5"})})]})}var be=require("lucide-react"),xe=require("next/navigation");var Ke=L(require("lucide-react"));function he(e){if(e)return Ke[e]}var ye=L(require("next/link")),c=require("react/jsx-runtime");function ve(){let{openSidebar:e,setOpenSidebar:r,docstraConfig:t,setOpenSearchBox:o}=d(),a=(0,xe.usePathname)();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:f("fixed inset-0 z-20 bg-black/50 opacity-0 pointer-events-none transition-all duration-300",e&&"opacity-100 pointer-events-auto"),onClick:()=>r(!1)}),(0,c.jsxs)("aside",{className:f("sticky md:top-18 h-[calc(100svh-72px)] scrollbar-y w-screen max-md:rounded-t-lg z-21 md:w-72 pb-10 text-base md:text-sm shrink-0 border-r border-gray-200 p-4 max-md:fixed bg-white overflow-y-auto transition-all duration-300",e?"top-32":"top-full"),children:[(0,c.jsxs)("div",{className:"flex items-center select-none gap-2 cursor-pointer mt-6 mb-4 p-2.5 text-gray-500 border border-gray-200 rounded-lg hover:bg-gray-50",onClick:()=>{r(e&&!1),o(!0)},children:[(0,c.jsx)(be.SearchIcon,{className:"size-4.5"}),(0,c.jsx)("p",{children:"Search"}),(0,c.jsxs)("div",{className:"ms-auto font-mono inline-flex gap-0.5",children:[(0,c.jsx)("span",{className:"rounded-md border border-gray-200 px-1.5",children:"Ctrl"}),(0,c.jsx)("span",{className:"rounded-md border border-gray-200 px-1.5",children:"K"})]})]}),t.sidebar?.links?.map(n=>(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"inline-flex items-center gap-2 mb-2 mt-2 px-2",children:n.section}),(0,c.jsx)("ul",{className:"mb-4",children:n.items.map(s=>{let m=he(s.icon);return(0,c.jsx)("li",{children:(0,c.jsxs)(ye.default,{href:s.href,onNavigate:()=>e&&r(!1),className:f("flex items-center gap-2 text-gray-500 hover:bg-gray-100 py-2 px-2.5 rounded-lg",a===s.href&&"bg-gray-100 text-gray-800"),children:[m&&(0,c.jsx)(m,{className:"size-4"}),(0,c.jsx)("span",{children:s.name})]})},s.href)})})]},n.section))]})]})}var B=require("lucide-react"),Ne=require("next/navigation"),y=require("react");var b=require("react/jsx-runtime");function ke(){let[e,r]=(0,y.useState)(null),[t,o]=(0,y.useState)("down"),[a,n]=(0,y.useState)(!1),[s,m]=(0,y.useState)(!1),{docstraConfig:g,pageData:k}=d(),i=k?.path,p=k?.data?.tableOfContents||[],H=(0,y.useRef)(0),Z=(0,y.useRef)(null),M=(0,Ne.usePathname)(),ee=`${"https://github.com/"+g?.editOnGithub?.owner+"/"+g?.editOnGithub?.repo}/edit/main/${g?.editOnGithub?.path}/${i}`;(0,y.useEffect)(()=>{let u=()=>{let x=window.scrollY;o(x>H.current?"down":"up"),n(x>100),H.current=x};return window.addEventListener("scroll",u),()=>window.removeEventListener("scroll",u)},[]),(0,y.useEffect)(()=>{let u=document.querySelectorAll("h2[id], h3[id]"),x=new IntersectionObserver(z=>{if(s)return;let O=z.filter(E=>E.isIntersecting).sort((E,Ee)=>E.boundingClientRect.top-Ee.boundingClientRect.top);if(O.length>0){let E=t==="down"?O[0].target.id:O[O.length-1].target.id;r(E)}},{rootMargin:"-40% 0px -50% 0px",threshold:[0,.2,.6,1]});return u.forEach(z=>x.observe(z)),Z.current=x,()=>x.disconnect()},[M,t,s]),(0,y.useEffect)(()=>{!(window.scrollY>100)&&r(p[0]?.id)},[p]),(0,y.useEffect)(()=>{if(!e)return;let u=document.querySelector(".toc-scroll-container");if(!u)return;let x=u.querySelector(`a[href="#${e}"]`);if(!x)return;let z=u.getBoundingClientRect(),O=x.getBoundingClientRect();(O.top<z.top||O.bottom>z.bottom)&&x.scrollIntoView({behavior:"smooth",block:"nearest"})},[e]),(0,y.useEffect)(()=>{if(!s)return;let u=setTimeout(()=>m(!1),800);return()=>clearTimeout(u)},[s]);let q=u=>{r(u),m(!0)};return(0,b.jsxs)("aside",{className:"sticky top-18 text-sm hidden xl:block text-gray-500 shrink-0 h-[calc(100svh-72px)] w-64 border-l border-gray-200 p-6 overflow-y-auto",children:[(0,b.jsxs)("p",{className:"flex items-center gap-2 mb-5",children:[(0,b.jsx)(B.TextAlignStartIcon,{className:"size-4"}),"On this page"]}),(0,b.jsx)("ul",{className:"toc-scroll-container max-h-3/4 overflow-y-auto scrollbar-none",children:p.map(u=>(0,b.jsxs)("li",{children:[(0,b.jsx)(we,{heading:u,activeId:e,handleClick:q}),u.children.map(x=>(0,b.jsx)(we,{heading:x,activeId:e,handleClick:q,className:"pl-8"},x.id))]},u.id))}),(0,b.jsx)("hr",{className:"my-6 border-gray-200"}),g.editOnGithub&&(0,b.jsxs)("a",{href:ee,rel:"noopener noreferrer",className:"flex items-center gap-2 text-gray-400 hover:text-gray-700 transition",children:["Edit this page on GitHub",(0,b.jsx)(B.SquareArrowOutUpRightIcon,{className:"size-4"})]}),a&&(0,b.jsxs)("button",{onClick:()=>scrollTo({top:0,behavior:"smooth"}),className:"flex items-center cursor-pointer gap-2 mt-3 text-gray-400 hover:text-gray-700 transition",children:["Scroll to top",(0,b.jsx)(B.ArrowUpCircleIcon,{className:"size-4"})]})]})}function we({heading:e,activeId:r,handleClick:t,className:o}){return(0,b.jsx)("a",{href:`#${e.id}`,className:f("border-l border-gray-200 block py-1.5 pl-4 transition-colors",o,{"border-gray-800 text-gray-900 font-medium":r===e.id,"hover:text-gray-800 hover:border-gray-400":r!==e.id}),onClick:()=>t(e.id),children:e.text})}var A=require("react/jsx-runtime");function Ve({children:e,toc:r=!0,sidebar:t=!0}){return(0,A.jsxs)("div",{className:"min-h-screen flex bg-white w-full",children:[t&&(0,A.jsx)(ve,{}),e,r&&(0,A.jsx)(ke,{})]})}var Ce=require("next/navigation"),De=require("lucide-react"),te=L(require("next/link")),C=require("react/jsx-runtime");function Se(){let r=(0,Ce.usePathname)().split("/").filter(Boolean),t=r.map((o,a)=>{let n="/"+r.slice(0,a+1).join("/"),s=o.replace(/-/g," ").replace(/\b\w/g,m=>m.toUpperCase());return{href:n,title:s}});return(0,C.jsx)("nav",{"aria-label":"Breadcrumb",className:"flex text-sm items-center pb-4 text-gray-500",children:(0,C.jsxs)("ol",{className:"flex items-center space-x-2",children:[(0,C.jsx)("li",{children:(0,C.jsx)(te.default,{href:"/",className:"hover:text-gray-700 transition-colors font-medium",children:"Home"})}),t.map((o,a)=>{let n=a===t.length-1;return(0,C.jsxs)("li",{className:"flex items-center space-x-2",children:[(0,C.jsx)(De.ChevronRight,{className:"w-4 h-4 text-gray-400"}),n?(0,C.jsx)("span",{className:"text-gray-600 font-medium",children:o.title}):(0,C.jsx)(te.default,{href:o.href,className:"hover:text-gray-700 font-medium transition-colors",children:o.title})]},o.href)})]})})}var V=require("lucide-react"),$=require("react");var P=require("react/jsx-runtime");function Le(){let{pageData:e}=d(),[r,t]=(0,$.useState)(!1),[o,a]=(0,$.useState)(null);(0,$.useEffect)(()=>{a(window.location.href)},[]);let n=`Read from this URL: ${o} and explain it to me.`;return(0,P.jsxs)("div",{className:"flex items-center gap-3 mt-6",children:[(0,P.jsxs)("button",{title:"Copy Markdown",onClick:()=>{navigator.clipboard.writeText(e?.data.raw||""),t(!0),setTimeout(()=>t(!1),3e3)},className:"flex items-center cursor-pointer gap-2 bg-gray-50 hover:bg-gray-100 border border-gray-200 px-3 py-2 rounded-md text-xs",children:[r?(0,P.jsx)(V.CheckIcon,{className:"size-3.5"}):(0,P.jsx)(V.CopyIcon,{className:"size-3.5"}),"Copy Markdown"]}),(0,P.jsx)("a",{title:"Ask ChatGPT",href:`https://chatgpt.com/?hints=search&q=${encodeURIComponent(n)}`,className:"flex items-center gap-2 bg-gray-50 hover:bg-gray-100 border border-gray-200 px-3 py-2 rounded-md text-xs",rel:"noreferrer noopener",children:"Ask ChatGPT"})]})}var S=require("react/jsx-runtime");function Oe(){let{pageData:e}=d(),r=e?.data?.metadata?.title,t=e?.data?.metadata?.description;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("h1",{className:"text-3xl font-bold",children:r}),(0,S.jsx)("p",{className:"my-4 text-gray-500",children:t}),(0,S.jsx)(Le,{}),(0,S.jsx)("hr",{className:"my-10 border-gray-200"})]})}var Q=require("react"),_=require("lucide-react");var R=require("react/jsx-runtime");function re({label:e,type:r,placeholder:t="",id:o,required:a=!1,onChange:n,value:s,readOnly:m=!1,className:g="",optional:k=!1}){return(0,R.jsxs)("div",{className:f("flex flex-col mt-4 w-full",g),children:[e&&(0,R.jsxs)("label",{htmlFor:o,className:"font-medium w-max cursor-pointer",children:[e,k&&(0,R.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-1 mt-1",children:"(Optional)"})]}),r==="textarea"?(0,R.jsx)("textarea",{id:o,name:o,className:f("mt-2 w-full p-3 border border-gray-300 resize-none not-focus:hover:border-gray-500 read-only:text-gray-400/80 outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 transition-all duration-200 rounded-lg",g),placeholder:t,required:a,onChange:n,rows:4,value:s,readOnly:m}):(0,R.jsx)("input",{type:r,id:o,name:o,className:"mt-2 w-full h-12 px-3 border border-gray-300 not-focus:hover:border-gray-500 read-only:text-gray-400/80 outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 transition-all duration-200 rounded-lg",placeholder:t,required:a,onChange:n,value:s,readOnly:m})]})}var Ie=require("lucide-react");var oe=require("react/jsx-runtime");function Y({label:e,loading:r,type:t="submit",className:o="",disabled:a=!1,onClick:n}){return(0,oe.jsx)("button",{type:t,disabled:a,className:f("relative w-full mt-4 h-12 px-6 py-3 cursor-pointer font-medium bg-gray-900 hover:opacity-85 text-white rounded-lg",o),"aria-label":e,onClick:n,children:r?(0,oe.jsx)(Ie.Loader2Icon,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 animate-spin mx-auto"}):e})}var l=require("react/jsx-runtime");function Pe(){let[e,r]=(0,Q.useState)(null),{docstraConfig:t}=d(),[o,a]=(0,Q.useState)(""),[n,s]=(0,Q.useState)(!1),m="https://github.com/"+t?.editOnGithub?.owner+"/"+t?.editOnGithub?.repo;return(0,l.jsx)("div",{className:"border-y border-gray-200 mt-20 py-10 space-y-4",children:n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"font-medium text-gray-900",children:"Thank you for your feedback!"}),(0,l.jsx)(Y,{onClick:()=>{s(!1),r(null),a("")},label:"Submit Again",className:"w-max text-sm"})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"font-medium",children:"How is this guide?"}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsxs)("button",{onClick:()=>r("good"),className:`flex items-center cursor-pointer gap-1 px-3 py-2 rounded-full border text-sm ${e==="good"?"bg-green-100 text-green-600 border-green-300":"border-gray-200 text-gray-600 hover:bg-gray-100"}`,children:[(0,l.jsx)(_.ThumbsUp,{className:`size-4 ${e==="good"?"fill-green-600":"text-gray-500"}`}),"Good"]}),(0,l.jsxs)("button",{onClick:()=>r("bad"),className:`flex items-center cursor-pointer gap-1 px-3 py-2 rounded-full border text-sm ${e==="bad"?"bg-red-100 text-red-600 border-red-300":"border-gray-200 text-gray-600 hover:bg-gray-100"}`,children:[(0,l.jsx)(_.ThumbsDown,{className:`size-4 pt-0.5 ${e==="bad"?"fill-red-600":"text-gray-500"}`}),"Bad"]})]}),e&&(0,l.jsxs)("form",{className:"flex flex-col gap-2",action:`https://api.formsync.app/v1/s/${t?.feedback?.formSyncFormID||""}`,method:"POST",children:[(0,l.jsx)(re,{value:o,id:"message",onChange:g=>a(g.target.value),placeholder:"Leave your feedback...",required:!0,type:"textarea"}),(0,l.jsx)("input",{type:"hidden",name:"opinion",value:e}),(0,l.jsx)("input",{type:"hidden",name:"page",value:window.location.href}),(0,l.jsx)("input",{type:"hidden",name:"_redirect",value:window.location.href}),(0,l.jsx)(Y,{label:"Submit",className:"w-max text-sm"}),t?.feedback?.watermark!==!1&&(0,l.jsxs)("p",{className:"text-left text-sm text-gray-500 mt-6",children:["Powered by"," ",(0,l.jsx)("a",{href:`https://www.formsync.app?utm_source=${m}`,className:"text-gray-800",children:"FormSync"})]})]})]})})}var Re=require("next/navigation"),ae=L(require("next/link")),X=require("lucide-react");var N=require("react/jsx-runtime");function Te(){let e=(0,Re.usePathname)(),{docstraConfig:r}=d(),t=r?.sidebar?.links?.flatMap(s=>s.items),o=t.findIndex(s=>s.href===e),a=o>0?t[o-1]:null,n=o<t.length-1?t[o+1]:null;return(0,N.jsxs)("div",{className:"flex flex-col lg:flex-row gap-2 justify-between py-10 mt-10",children:[a?(0,N.jsxs)(ae.default,{href:a.href,className:"flex flex-col items-start gap-2 border border-gray-200 hover:bg-gray-50 py-3 md:min-w-62 pl-4 pr-10 rounded-lg text-sm",children:[(0,N.jsx)("span",{className:"text-gray-500",children:"Previous"}),(0,N.jsxs)("p",{className:"flex items-center font-medium",children:[(0,N.jsx)(X.ArrowLeftIcon,{className:"size-5 mr-2"}),a.name]})]}):(0,N.jsx)("div",{}),n?(0,N.jsxs)(ae.default,{href:n.href,className:"flex flex-col items-end gap-2 border border-gray-200 hover:bg-gray-50 py-3 pr-4 md:min-w-62 pl-10 rounded-lg text-sm",children:[(0,N.jsx)("span",{className:"text-gray-500",children:"Next"}),(0,N.jsxs)("p",{className:"flex items-center font-medium",children:[n.name,(0,N.jsx)(X.ArrowRightIcon,{className:"size-5 ml-2"})]})]}):(0,N.jsx)("div",{})]})}var T=require("react/jsx-runtime");function Ye({children:e}){let{docstraConfig:r}=d();return(0,T.jsxs)("main",{className:"flex-1 px-4 md:px-8 py-10 max-w-full text-base/7",children:[(0,T.jsx)(Se,{}),(0,T.jsx)(Oe,{}),e,r?.feedback?.enabled&&(0,T.jsx)(Pe,{}),(0,T.jsx)(Te,{})]})}var J=require("lucide-react"),W=require("prism-react-renderer"),ze=require("react"),v=require("react/jsx-runtime");function Qe(e){let{filename:r,children:t,className:o}=e,a=!o?.includes("language-"),n=typeof t=="string"?t:t?.props?.children||"";if(a)return(0,v.jsx)("code",{className:"px-1 py-0.5 rounded border border-gray-200 text-gray-800 text-sm",children:n});let[s,m]=(0,ze.useState)(!1),k=o?.match(/language-([\w-]+)/)?.[1]??"txt";return(0,v.jsxs)("div",{className:"max-w-2xl overflow-hidden rounded-lg text-sm text-gray-800 border border-gray-200/80 mt-4",children:[(0,v.jsxs)("div",{className:"flex items-center bg-gray-50 justify-between border-b border-gray-200/80",children:[(0,v.jsx)("span",{className:"text-xs text-gray-400 p-4",children:r||k}),(0,v.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(n.trim()),m(!0),setTimeout(()=>m(!1),2e3)},className:"rounded cursor-pointer aspect-square p-2 m-2 text-xs hover:bg-gray-200 transition",children:s?(0,v.jsx)(J.CheckIcon,{className:"size-4"}):(0,v.jsx)(J.CopyIcon,{className:"size-4"})})]}),(0,v.jsx)(W.Highlight,{theme:W.themes.vsLight,code:n.trim(),language:k,children:({tokens:p,getLineProps:H,getTokenProps:Z})=>(0,v.jsx)("pre",{className:"p-4 font-mono whitespace-pre overflow-x-auto",children:p.map((M,j)=>(0,v.jsxs)("div",{...H({line:M}),children:[(0,v.jsx)("span",{className:"text-slate-500 mr-4 select-none",children:j+1}),M.map((ee,q)=>(0,v.jsx)("span",{...Z({token:ee})},q))]},j))})})]})}0&&(module.exports={DocstraBody,DocstraCodeBlock,DocstraHeader,DocstraPage,DocstraProvider,useDocstra});
1
+ "use strict";"use client";var Ge=Object.create;var U=Object.defineProperty;var Fe=Object.getOwnPropertyDescriptor;var Ae=Object.getOwnPropertyNames;var He=Object.getPrototypeOf,$e=Object.prototype.hasOwnProperty;var Me=(e,r)=>{for(var t in r)U(e,t,{get:r[t],enumerable:!0})},se=(e,r,t,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Ae(r))!$e.call(e,a)&&a!==t&&U(e,a,{get:()=>r[a],enumerable:!(o=Fe(r,a))||o.enumerable});return e};var L=(e,r,t)=>(t=e!=null?Ge(He(e)):{},se(r||!e||!e.__esModule?U(t,"default",{value:e,enumerable:!0}):t,e)),qe=e=>se(U({},"__esModule",{value:!0}),e);var We={};Me(We,{DocstraBody:()=>Qe,DocstraCodeBlock:()=>_e,DocstraHeader:()=>Ke,DocstraPage:()=>Ye,DocstraProvider:()=>Ue,useDocstra:()=>d});module.exports=qe(We);var O=require("react"),fe=require("react-toast-msg");var ce=require("lucide-react");var ie=require("tailwind-merge"),le=L(require("clsx"));function f(...e){return(0,ie.twMerge)((0,le.default)(e))}var D=require("react"),me=L(require("fuse.js")),de=L(require("next/link")),pe=require("next/navigation"),h=require("react/jsx-runtime");function ue(){let{openSearchBox:e,setOpenSearchBox:r,docs:t}=d(),[o,a]=(0,D.useState)(""),[n,s]=(0,D.useState)([]),c=(0,pe.useRouter)();(0,D.useEffect)(()=>{let i=p=>{p.ctrlKey&&p.key==="k"&&(p.preventDefault(),r(!0))};return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[]);let g=(0,D.useMemo)(()=>!t||t.length===0?null:new me.default(t,{keys:["data.metadata.title","data.metadata.description"],threshold:.3}),[t]);(0,D.useEffect)(()=>{if(o&&g){let i=g.search(o);s(i.map(p=>p.item))}else o||s([])},[o,g]);let w=i=>{if(i.preventDefault(),o){let p=n[0];p&&(c.push(`/docs/${p.slug}`),a(""),r(!1))}};return(0,D.useEffect)(()=>{let i=p=>{p.key==="Escape"&&(r(!1),a(""))};return e&&window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[e]),(0,h.jsx)("div",{onClick:()=>{r(!1),a("")},className:f("fixed inset-0 z-25 flex items-start justify-center bg-white/40 backdrop-blur-md opacity-0 pointer-events-none transition-all duration-300",e&&"opacity-100 pointer-events-auto"),children:(0,h.jsxs)("div",{onClick:i=>i.stopPropagation(),className:"flex flex-col items-center mt-30 max-w-lg w-full max-md:px-4",children:[(0,h.jsx)("form",{onSubmit:w,className:f("relative flex items-center justify-between w-full bg-white border border-slate-200 text-gray-400 h-15 p-0.5 rounded-md",o&&"rounded-b-none border-b-0"),children:e&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ce.SearchIcon,{className:"size-5.5 mx-3 shrink-0"}),(0,h.jsx)("input",{className:"w-full bg-transparent h-full outline-none text-gray-400 placeholder:text-gray-400",type:"text",placeholder:"Search docs...",spellCheck:"false",autoFocus:!0,value:o,onChange:i=>a(i.target.value),name:"searchQuery",required:!0}),(0,h.jsx)("span",{className:"border border-gray-200 px-2 mr-3 py-1 rounded text-xs",children:"Esc"})]})}),(0,h.jsxs)("div",{className:f("max-h-70 overflow-x-hidden overflow-y-auto scrollbar-y w-full bg-white text-slate-700 flex flex-col",o&&"rounded-b-md border border-slate-200"),children:[n.map(i=>(0,h.jsxs)(de.default,{href:`/docs/${i.slug==="index"?"":i.slug}`,onClick:()=>{r(!1),a("")},className:"w-full hover:bg-gray-100/70 border-b border-slate-200 transition-all py-4 px-4 last:mb-2",children:[(0,h.jsx)("h4",{className:"font-medium",children:i.data?.metadata?.title||i.slug}),(0,h.jsx)("p",{className:"text-sm mt-1 text-gray-500",children:i.data?.metadata?.description})]},i.slug)),o&&n.length===0&&(0,h.jsx)("div",{className:"text-gray-500 text-center py-20",children:"No results found"})]})]})})}var G=require("react/jsx-runtime"),ge=(0,O.createContext)(null);function Ue({children:e,docstraConfig:r,docs:t,pageData:o,slug:a}){let n=o||(()=>{let i=Array.isArray(a)?a.length===0?"index":a.join("/"):a||"index";return t.find(p=>p.slug===i)})(),[s,c]=(0,O.useState)(!1),[g,w]=(0,O.useState)(!1);return(0,G.jsxs)(ge.Provider,{value:{openSidebar:s,setOpenSidebar:c,docstraConfig:r,openSearchBox:g,setOpenSearchBox:w,pageData:n,docs:t},children:[(0,G.jsx)(fe.ToastContainer,{}),(0,G.jsx)(ue,{}),e]})}function d(){let e=(0,O.useContext)(ge);if(!e)throw new Error("Please wrap your app with DocstraProvider");return e}var V=require("lucide-react"),he=require("react");var K=L(require("next/link")),N=require("react/jsx-runtime");function Ke(){let{openSidebar:e,setOpenSidebar:r,docstraConfig:t}=d(),o="https://github.com/"+t?.editOnGithub?.owner+"/"+t?.editOnGithub?.repo;return(0,he.useEffect)(()=>{e?document.body.classList.add("max-md:overflow-hidden"):document.body.classList.remove("max-md:overflow-hidden")},[e]),(0,N.jsxs)("header",{className:"sticky top-0 z-10 text-sm flex items-center justify-between border-b border-gray-100 h-18 px-4 md:px-6 bg-white",children:[(0,N.jsx)(K.default,{href:t.navbar?.logo?.link||"/",className:"hover:opacity-80 transition",children:(0,N.jsx)("img",{src:t.navbar?.logo?.src||"/logo.png",alt:t.navbar?.logo?.alt||"Logo",className:f("h-9.5 w-auto",t.navbar?.logo?.className)})}),(0,N.jsxs)("div",{className:"hidden divide-x divide-gray-200 md:flex items-center",children:[t.navbar?.links?.map(a=>(0,N.jsx)(K.default,{href:a.href,className:"px-6 hover:text-gray-600",children:a.name},a.name)),(0,N.jsx)(K.default,{href:o||"https://github.com/sudhucodes/docstra",children:(0,N.jsx)("svg",{className:"size-6 mx-6",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:(0,N.jsx)("path",{d:"M12 .3a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57L9 21.07c-3.34.72-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.08-.74.09-.73.09-.73 1.2.09 1.83 1.24 1.83 1.24 1.08 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22l-.01 3.29c0 .31.2.69.82.57A12 12 0 0 0 12 .3"})})})]}),(0,N.jsx)("button",{onClick:()=>r(!e),className:"md:hidden transition text-gray-600 active:ring-2 ring-gray-200 p-1.5 rounded-md",children:e?(0,N.jsx)(V.XIcon,{className:"size-6.5"}):(0,N.jsx)(V.TextAlignEnd,{className:"size-6.5"})})]})}var xe=require("lucide-react"),ye=require("next/navigation");var Ve=L(require("lucide-react"));function be(e){if(e)return Ve[e]}var ve=L(require("next/link")),m=require("react/jsx-runtime");function we(){let{openSidebar:e,setOpenSidebar:r,docstraConfig:t,setOpenSearchBox:o}=d(),a=(0,ye.usePathname)();return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{className:f("fixed inset-0 z-20 bg-black/50 opacity-0 pointer-events-none transition-all duration-300",e&&"opacity-100 pointer-events-auto"),onClick:()=>r(!1)}),(0,m.jsxs)("aside",{className:f("sticky md:top-18 h-[calc(100svh-72px)] scrollbar-y w-screen max-md:rounded-t-lg z-21 md:w-72 pb-10 text-base md:text-sm shrink-0 border-r border-gray-200 p-4 max-md:fixed bg-white overflow-y-auto transition-all duration-300",e?"top-32":"top-full"),children:[(0,m.jsxs)("div",{className:"flex items-center select-none gap-2 cursor-pointer mt-6 mb-4 p-2.5 text-gray-500 border border-gray-200 rounded-lg hover:bg-gray-50",onClick:()=>{r(e&&!1),o(!0)},children:[(0,m.jsx)(xe.SearchIcon,{className:"size-4.5"}),(0,m.jsx)("p",{children:"Search"}),(0,m.jsxs)("div",{className:"ms-auto font-mono inline-flex gap-0.5",children:[(0,m.jsx)("span",{className:"rounded-md border border-gray-200 px-1.5",children:"Ctrl"}),(0,m.jsx)("span",{className:"rounded-md border border-gray-200 px-1.5",children:"K"})]})]}),t.sidebar?.links?.map(n=>(0,m.jsxs)("div",{children:[(0,m.jsx)("p",{className:"inline-flex items-center gap-2 mb-2 mt-2 px-2",children:n.section}),(0,m.jsx)("ul",{className:"mb-4",children:n.items.map(s=>{let c=be(s.icon);return(0,m.jsx)("li",{children:(0,m.jsxs)(ve.default,{href:s.href,onNavigate:()=>e&&r(!1),className:f("flex items-center gap-2 text-gray-500 hover:bg-gray-100 py-2 px-2.5 rounded-lg",a===s.href&&"bg-gray-100 text-gray-800"),children:[c&&(0,m.jsx)(c,{className:"size-4"}),(0,m.jsx)("span",{children:s.name})]})},s.href)})})]},n.section))]})]})}var B=require("lucide-react"),ke=require("next/navigation"),y=require("react");var b=require("react/jsx-runtime");function Ce(){let[e,r]=(0,y.useState)(null),[t,o]=(0,y.useState)("down"),[a,n]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),{docstraConfig:g,pageData:w}=d(),i=w?.path,p=w?.data?.tableOfContents||[],$=(0,y.useRef)(0),Z=(0,y.useRef)(null),M=(0,ke.usePathname)(),ee=`${"https://github.com/"+g?.editOnGithub?.owner+"/"+g?.editOnGithub?.repo}/edit/main/${g?.editOnGithub?.path}/${i}`;(0,y.useEffect)(()=>{let u=()=>{let x=window.scrollY;o(x>$.current?"down":"up"),n(x>100),$.current=x};return window.addEventListener("scroll",u),()=>window.removeEventListener("scroll",u)},[]),(0,y.useEffect)(()=>{let u=document.querySelectorAll("h2[id], h3[id]"),x=new IntersectionObserver(E=>{if(s)return;let I=E.filter(z=>z.isIntersecting).sort((z,Be)=>z.boundingClientRect.top-Be.boundingClientRect.top);if(I.length>0){let z=t==="down"?I[0].target.id:I[I.length-1].target.id;r(z)}},{rootMargin:"-40% 0px -50% 0px",threshold:[0,.2,.6,1]});return u.forEach(E=>x.observe(E)),Z.current=x,()=>x.disconnect()},[M,t,s]),(0,y.useEffect)(()=>{!(window.scrollY>100)&&r(p[0]?.id)},[p]),(0,y.useEffect)(()=>{if(!e)return;let u=document.querySelector(".toc-scroll-container");if(!u)return;let x=u.querySelector(`a[href="#${e}"]`);if(!x)return;let E=u.getBoundingClientRect(),I=x.getBoundingClientRect();(I.top<E.top||I.bottom>E.bottom)&&x.scrollIntoView({behavior:"smooth",block:"nearest"})},[e]),(0,y.useEffect)(()=>{if(!s)return;let u=setTimeout(()=>c(!1),800);return()=>clearTimeout(u)},[s]);let q=u=>{r(u),c(!0)};return(0,b.jsxs)("aside",{className:"sticky top-18 text-sm hidden xl:block text-gray-500 shrink-0 h-[calc(100svh-72px)] w-64 border-l border-gray-200 p-6 overflow-y-auto",children:[(0,b.jsxs)("p",{className:"flex items-center gap-2 mb-5",children:[(0,b.jsx)(B.TextAlignStartIcon,{className:"size-4"}),"On this page"]}),(0,b.jsx)("ul",{className:"toc-scroll-container max-h-3/4 overflow-y-auto scrollbar-none",children:p.map(u=>(0,b.jsxs)("li",{children:[(0,b.jsx)(Ne,{heading:u,activeId:e,handleClick:q}),u.children.map(x=>(0,b.jsx)(Ne,{heading:x,activeId:e,handleClick:q,className:"pl-8"},x.id))]},u.id))}),(0,b.jsx)("hr",{className:"my-6 border-gray-200"}),g.editOnGithub&&(0,b.jsxs)("a",{href:ee,rel:"noopener noreferrer",className:"flex items-center gap-2 text-gray-400 hover:text-gray-700 transition",children:["Edit this page on GitHub",(0,b.jsx)(B.SquareArrowOutUpRightIcon,{className:"size-4"})]}),a&&(0,b.jsxs)("button",{onClick:()=>scrollTo({top:0,behavior:"smooth"}),className:"flex items-center cursor-pointer gap-2 mt-3 text-gray-400 hover:text-gray-700 transition",children:["Scroll to top",(0,b.jsx)(B.ArrowUpCircleIcon,{className:"size-4"})]})]})}function Ne({heading:e,activeId:r,handleClick:t,className:o}){return(0,b.jsx)("a",{href:`#${e.id}`,className:f("border-l border-gray-200 block py-1.5 pl-4 transition-colors",o,{"border-gray-800 text-gray-900 font-medium":r===e.id,"hover:text-gray-800 hover:border-gray-400":r!==e.id}),onClick:()=>t(e.id),children:e.text})}var F=require("react/jsx-runtime");function Ye({children:e,toc:r=!0,sidebar:t=!0}){return(0,F.jsxs)("div",{className:"min-h-screen flex bg-white w-full",children:[t&&(0,F.jsx)(we,{}),e,r&&(0,F.jsx)(Ce,{})]})}var De=require("next/navigation"),Se=require("lucide-react"),te=L(require("next/link")),C=require("react/jsx-runtime");function Le(){let r=(0,De.usePathname)().split("/").filter(Boolean),t=r.map((o,a)=>{let n="/"+r.slice(0,a+1).join("/"),s=o.replace(/-/g," ").replace(/\b\w/g,c=>c.toUpperCase());return{href:n,title:s}});return(0,C.jsx)("nav",{"aria-label":"Breadcrumb",className:"flex text-sm items-center pb-4 text-gray-500",children:(0,C.jsxs)("ol",{className:"flex items-center space-x-2",children:[(0,C.jsx)("li",{children:(0,C.jsx)(te.default,{href:"/",className:"hover:text-gray-700 transition-colors font-medium",children:"Home"})}),t.map((o,a)=>{let n=a===t.length-1;return(0,C.jsxs)("li",{className:"flex items-center space-x-2",children:[(0,C.jsx)(Se.ChevronRight,{className:"w-4 h-4 text-gray-400"}),n?(0,C.jsx)("span",{className:"text-gray-600 font-medium",children:o.title}):(0,C.jsx)(te.default,{href:o.href,className:"hover:text-gray-700 font-medium transition-colors",children:o.title})]},o.href)})]})})}var Y=require("lucide-react"),A=require("react");var P=require("react/jsx-runtime");function Ie(){let{pageData:e}=d(),[r,t]=(0,A.useState)(!1),[o,a]=(0,A.useState)(null);(0,A.useEffect)(()=>{a(window.location.href)},[]);let n=`Read from this URL: ${o} and explain it to me.`;return(0,P.jsxs)("div",{className:"flex items-center gap-3 mt-6",children:[(0,P.jsxs)("button",{title:"Copy Markdown",onClick:()=>{navigator.clipboard.writeText(e?.data.raw||""),t(!0),setTimeout(()=>t(!1),3e3)},className:"flex items-center cursor-pointer gap-2 bg-gray-50 hover:bg-gray-100 border border-gray-200 px-3 py-2 rounded-md text-xs",children:[r?(0,P.jsx)(Y.CheckIcon,{className:"size-3.5"}):(0,P.jsx)(Y.CopyIcon,{className:"size-3.5"}),"Copy Markdown"]}),(0,P.jsx)("a",{title:"Ask ChatGPT",href:`https://chatgpt.com/?hints=search&q=${encodeURIComponent(n)}`,className:"flex items-center gap-2 bg-gray-50 hover:bg-gray-100 border border-gray-200 px-3 py-2 rounded-md text-xs",rel:"noreferrer noopener",children:"Ask ChatGPT"})]})}var S=require("react/jsx-runtime");function Oe(){let{pageData:e}=d(),r=e?.data?.metadata?.title,t=e?.data?.metadata?.description;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("h1",{className:"text-3xl font-bold",children:r}),(0,S.jsx)("p",{className:"my-4 text-gray-500",children:t}),(0,S.jsx)(Ie,{}),(0,S.jsx)("hr",{className:"my-10 border-gray-200"})]})}var H=require("react"),Q=require("lucide-react");var R=require("react/jsx-runtime");function re({label:e,type:r,placeholder:t="",id:o,required:a=!1,onChange:n,value:s,readOnly:c=!1,className:g="",optional:w=!1}){return(0,R.jsxs)("div",{className:f("flex flex-col mt-4 w-full",g),children:[e&&(0,R.jsxs)("label",{htmlFor:o,className:"font-medium w-max cursor-pointer",children:[e,w&&(0,R.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-1 mt-1",children:"(Optional)"})]}),r==="textarea"?(0,R.jsx)("textarea",{id:o,name:o,className:f("mt-2 w-full p-3 border border-gray-300 resize-none not-focus:hover:border-gray-500 read-only:text-gray-400/80 outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 transition-all duration-200 rounded-lg",g),placeholder:t,required:a,onChange:n,rows:4,value:s,readOnly:c}):(0,R.jsx)("input",{type:r,id:o,name:o,className:"mt-2 w-full h-12 px-3 border border-gray-300 not-focus:hover:border-gray-500 read-only:text-gray-400/80 outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 transition-all duration-200 rounded-lg",placeholder:t,required:a,onChange:n,value:s,readOnly:c})]})}var Pe=require("lucide-react");var oe=require("react/jsx-runtime");function ae({label:e,loading:r,type:t="submit",className:o="",disabled:a=!1,onClick:n}){return(0,oe.jsx)("button",{type:t,disabled:a,className:f("relative w-full mt-4 h-12 px-6 py-3 cursor-pointer font-medium bg-gray-900 hover:opacity-85 text-white rounded-lg",o),"aria-label":e,onClick:n,children:r?(0,oe.jsx)(Pe.Loader2Icon,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 animate-spin mx-auto"}):e})}var _=require("formsync"),l=require("react/jsx-runtime");function Re(){let[e,r]=(0,H.useState)(null),{docstraConfig:t}=d(),[o,a]=(0,H.useState)(""),[n,s]=(0,H.useState)(!0),[c,g]=(0,H.useState)(null),w="https://github.com/"+t?.editOnGithub?.owner+"/"+t?.editOnGithub?.repo;return(0,l.jsx)("div",{className:"border-y border-gray-200 mt-20 py-10 space-y-4",children:n?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"font-medium text-gray-900",children:"We appreciate your feedback, Thank you!"}),(0,l.jsx)(ae,{onClick:()=>{s(!1),r(null),a("")},label:"Submit Again",className:"w-max text-sm"})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"font-medium",children:"How is this guide?"}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsxs)("button",{onClick:()=>r("good"),className:`flex items-center cursor-pointer gap-1 px-3 py-2 rounded-full border text-sm ${e==="good"?"bg-green-100 text-green-600 border-green-300":"border-gray-200 text-gray-600 hover:bg-gray-100"}`,children:[(0,l.jsx)(Q.ThumbsUp,{className:`size-4 ${e==="good"?"fill-green-600":"text-gray-500"}`}),"Good"]}),(0,l.jsxs)("button",{onClick:()=>r("bad"),className:`flex items-center cursor-pointer gap-1 px-3 py-2 rounded-full border text-sm ${e==="bad"?"bg-red-100 text-red-600 border-red-300":"border-gray-200 text-gray-600 hover:bg-gray-100"}`,children:[(0,l.jsx)(Q.ThumbsDown,{className:`size-4 pt-0.5 ${e==="bad"?"fill-red-600":"text-gray-500"}`}),"Bad"]})]}),e&&(0,l.jsxs)(_.FormSyncForm,{className:"flex flex-col gap-2",formId:t?.feedback?.formSyncFormID||"",onSuccess:i=>{s(!0),r(null),a("")},onSubmitError:i=>{g(i.message)},children:[(0,l.jsx)(re,{value:o,id:"message",onChange:i=>a(i.target.value),placeholder:"Leave your feedback...",required:!0,type:"textarea"}),c&&(0,l.jsx)("p",{className:"text-red-500",children:c}),(0,l.jsx)("input",{type:"hidden",name:"opinion",value:e}),(0,l.jsx)("input",{type:"hidden",name:"page",value:window.location.href}),(0,l.jsx)("input",{type:"hidden",name:"_redirect",value:window.location.href}),(0,l.jsx)(_.FormSyncButton,{className:"relative mt-4 h-12 px-6 py-3 cursor-pointer font-medium bg-gray-900 hover:opacity-85 text-white rounded-lg w-max text-sm",children:"Submit"}),t?.feedback?.watermark!==!1&&(0,l.jsxs)("p",{className:"text-left text-sm text-gray-500 mt-6",children:["Powered by"," ",(0,l.jsx)("a",{href:`https://www.formsync.app?utm_source=${w}`,className:"text-gray-800",children:"FormSync"})]})]})]})})}var Te=require("next/navigation"),ne=L(require("next/link")),W=require("lucide-react");var k=require("react/jsx-runtime");function Ee(){let e=(0,Te.usePathname)(),{docstraConfig:r}=d(),t=r?.sidebar?.links?.flatMap(s=>s.items),o=t.findIndex(s=>s.href===e),a=o>0?t[o-1]:null,n=o<t.length-1?t[o+1]:null;return(0,k.jsxs)("div",{className:"flex flex-col lg:flex-row gap-2 justify-between py-10 mt-10",children:[a?(0,k.jsxs)(ne.default,{href:a.href,className:"flex flex-col items-start gap-2 border border-gray-200 hover:bg-gray-50 py-3 md:min-w-62 pl-4 pr-10 rounded-lg text-sm",children:[(0,k.jsx)("span",{className:"text-gray-500",children:"Previous"}),(0,k.jsxs)("p",{className:"flex items-center font-medium",children:[(0,k.jsx)(W.ArrowLeftIcon,{className:"size-5 mr-2"}),a.name]})]}):(0,k.jsx)("div",{}),n?(0,k.jsxs)(ne.default,{href:n.href,className:"flex flex-col items-end gap-2 border border-gray-200 hover:bg-gray-50 py-3 pr-4 md:min-w-62 pl-10 rounded-lg text-sm",children:[(0,k.jsx)("span",{className:"text-gray-500",children:"Next"}),(0,k.jsxs)("p",{className:"flex items-center font-medium",children:[n.name,(0,k.jsx)(W.ArrowRightIcon,{className:"size-5 ml-2"})]})]}):(0,k.jsx)("div",{})]})}var T=require("react/jsx-runtime");function Qe({children:e}){let{docstraConfig:r}=d();return(0,T.jsxs)("main",{className:"flex-1 px-4 md:px-8 py-10 max-w-full text-base/7",children:[(0,T.jsx)(Le,{}),(0,T.jsx)(Oe,{}),e,r?.feedback?.enabled&&(0,T.jsx)(Re,{}),(0,T.jsx)(Ee,{})]})}var X=require("lucide-react"),J=require("prism-react-renderer"),ze=require("react"),v=require("react/jsx-runtime");function _e(e){let{filename:r,children:t,className:o}=e,a=!o?.includes("language-"),n=typeof t=="string"?t:t?.props?.children||"";if(a)return(0,v.jsx)("code",{className:"px-1 py-0.5 rounded border border-gray-200 text-gray-800 text-sm",children:n});let[s,c]=(0,ze.useState)(!1),w=o?.match(/language-([\w-]+)/)?.[1]??"txt";return(0,v.jsxs)("div",{className:"max-w-2xl overflow-hidden rounded-lg text-sm text-gray-800 border border-gray-200/80 mt-4",children:[(0,v.jsxs)("div",{className:"flex items-center bg-gray-50 justify-between border-b border-gray-200/80",children:[(0,v.jsx)("span",{className:"text-xs text-gray-400 p-4",children:r||w}),(0,v.jsx)("button",{onClick:()=>{navigator.clipboard.writeText(n.trim()),c(!0),setTimeout(()=>c(!1),2e3)},className:"rounded cursor-pointer aspect-square p-2 m-2 text-xs hover:bg-gray-200 transition",children:s?(0,v.jsx)(X.CheckIcon,{className:"size-4"}):(0,v.jsx)(X.CopyIcon,{className:"size-4"})})]}),(0,v.jsx)(J.Highlight,{theme:J.themes.vsLight,code:n.trim(),language:w,children:({tokens:p,getLineProps:$,getTokenProps:Z})=>(0,v.jsx)("pre",{className:"p-4 font-mono whitespace-pre overflow-x-auto",children:p.map((M,j)=>(0,v.jsxs)("div",{...$({line:M}),children:[(0,v.jsx)("span",{className:"text-slate-500 mr-4 select-none",children:j+1}),M.map((ee,q)=>(0,v.jsx)("span",{...Z({token:ee})},q))]},j))})})]})}0&&(module.exports={DocstraBody,DocstraCodeBlock,DocstraHeader,DocstraPage,DocstraProvider,useDocstra});
@@ -1 +1 @@
1
- "use client";import{createContext as Pe,useContext as Re,useState as Z}from"react";import{ToastContainer as Te}from"react-toast-msg";import{SearchIcon as Ce}from"lucide-react";import{twMerge as Ne}from"tailwind-merge";import ke from"clsx";function p(...e){return Ne(ke(e))}import{useEffect as U,useMemo as De,useState as J}from"react";import Se from"fuse.js";import Le from"next/link";import{useRouter as Oe}from"next/navigation";import{Fragment as Ie,jsx as v,jsxs as B}from"react/jsx-runtime";function W(){let{openSearchBox:e,setOpenSearchBox:o,docs:t}=m(),[r,a]=J(""),[n,s]=J([]),l=Oe();U(()=>{let i=c=>{c.ctrlKey&&c.key==="k"&&(c.preventDefault(),o(!0))};return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[]);let u=De(()=>!t||t.length===0?null:new Se(t,{keys:["data.metadata.title","data.metadata.description"],threshold:.3}),[t]);U(()=>{if(r&&u){let i=u.search(r);s(i.map(c=>c.item))}else r||s([])},[r,u]);let h=i=>{if(i.preventDefault(),r){let c=n[0];c&&(l.push(`/docs/${c.slug}`),a(""),o(!1))}};return U(()=>{let i=c=>{c.key==="Escape"&&(o(!1),a(""))};return e&&window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[e]),v("div",{onClick:()=>{o(!1),a("")},className:p("fixed inset-0 z-25 flex items-start justify-center bg-white/40 backdrop-blur-md opacity-0 pointer-events-none transition-all duration-300",e&&"opacity-100 pointer-events-auto"),children:B("div",{onClick:i=>i.stopPropagation(),className:"flex flex-col items-center mt-30 max-w-lg w-full max-md:px-4",children:[v("form",{onSubmit:h,className:p("relative flex items-center justify-between w-full bg-white border border-slate-200 text-gray-400 h-15 p-0.5 rounded-md",r&&"rounded-b-none border-b-0"),children:e&&B(Ie,{children:[v(Ce,{className:"size-5.5 mx-3 shrink-0"}),v("input",{className:"w-full bg-transparent h-full outline-none text-gray-400 placeholder:text-gray-400",type:"text",placeholder:"Search docs...",spellCheck:"false",autoFocus:!0,value:r,onChange:i=>a(i.target.value),name:"searchQuery",required:!0}),v("span",{className:"border border-gray-200 px-2 mr-3 py-1 rounded text-xs",children:"Esc"})]})}),B("div",{className:p("max-h-70 overflow-x-hidden overflow-y-auto scrollbar-y w-full bg-white text-slate-700 flex flex-col",r&&"rounded-b-md border border-slate-200"),children:[n.map(i=>B(Le,{href:`/docs/${i.slug==="index"?"":i.slug}`,onClick:()=>{o(!1),a("")},className:"w-full hover:bg-gray-100/70 border-b border-slate-200 transition-all py-4 px-4 last:mb-2",children:[v("h4",{className:"font-medium",children:i.data?.metadata?.title||i.slug}),v("p",{className:"text-sm mt-1 text-gray-500",children:i.data?.metadata?.description})]},i.slug)),r&&n.length===0&&v("div",{className:"text-gray-500 text-center py-20",children:"No results found"})]})]})})}import{jsx as j,jsxs as ze}from"react/jsx-runtime";var ee=Pe(null);function It({children:e,docstraConfig:o,docs:t,pageData:r,slug:a}){let n=r||(()=>{let i=Array.isArray(a)?a.length===0?"index":a.join("/"):a||"index";return t.find(c=>c.slug===i)})(),[s,l]=Z(!1),[u,h]=Z(!1);return ze(ee.Provider,{value:{openSidebar:s,setOpenSidebar:l,docstraConfig:o,openSearchBox:u,setOpenSearchBox:h,pageData:n,docs:t},children:[j(Te,{}),j(W,{}),e]})}function m(){let e=Re(ee);if(!e)throw new Error("Please wrap your app with DocstraProvider");return e}import{TextAlignEnd as Ee,XIcon as Be}from"lucide-react";import{useEffect as Ge}from"react";import K from"next/link";import{jsx as x,jsxs as te}from"react/jsx-runtime";function At(){let{openSidebar:e,setOpenSidebar:o,docstraConfig:t}=m(),r="https://github.com/"+t?.editOnGithub?.owner+"/"+t?.editOnGithub?.repo;return Ge(()=>{e?document.body.classList.add("max-md:overflow-hidden"):document.body.classList.remove("max-md:overflow-hidden")},[e]),te("header",{className:"sticky top-0 z-10 text-sm flex items-center justify-between border-b border-gray-100 h-18 px-4 md:px-6 bg-white",children:[x(K,{href:t.navbar?.logo?.link||"/",className:"hover:opacity-80 transition",children:x("img",{src:t.navbar?.logo?.src||"/logo.png",alt:t.navbar?.logo?.alt||"Logo",className:p("h-9.5 w-auto",t.navbar?.logo?.className)})}),te("div",{className:"hidden divide-x divide-gray-200 md:flex items-center",children:[t.navbar?.links?.map(a=>x(K,{href:a.href,className:"px-6 hover:text-gray-600",children:a.name},a.name)),x(K,{href:r||"https://github.com/sudhucodes/docstra",children:x("svg",{className:"size-6 mx-6",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:x("path",{d:"M12 .3a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57L9 21.07c-3.34.72-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.08-.74.09-.73.09-.73 1.2.09 1.83 1.24 1.83 1.24 1.08 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22l-.01 3.29c0 .31.2.69.82.57A12 12 0 0 0 12 .3"})})})]}),x("button",{onClick:()=>o(!e),className:"md:hidden transition text-gray-600 active:ring-2 ring-gray-200 p-1.5 rounded-md",children:e?x(Be,{className:"size-6.5"}):x(Ee,{className:"size-6.5"})})]})}import{SearchIcon as $e}from"lucide-react";import{usePathname as He}from"next/navigation";import*as Ae from"lucide-react";function re(e){if(e)return Ae[e]}import Me from"next/link";import{Fragment as qe,jsx as b,jsxs as S}from"react/jsx-runtime";function oe(){let{openSidebar:e,setOpenSidebar:o,docstraConfig:t,setOpenSearchBox:r}=m(),a=He();return S(qe,{children:[b("div",{className:p("fixed inset-0 z-20 bg-black/50 opacity-0 pointer-events-none transition-all duration-300",e&&"opacity-100 pointer-events-auto"),onClick:()=>o(!1)}),S("aside",{className:p("sticky md:top-18 h-[calc(100svh-72px)] scrollbar-y w-screen max-md:rounded-t-lg z-21 md:w-72 pb-10 text-base md:text-sm shrink-0 border-r border-gray-200 p-4 max-md:fixed bg-white overflow-y-auto transition-all duration-300",e?"top-32":"top-full"),children:[S("div",{className:"flex items-center select-none gap-2 cursor-pointer mt-6 mb-4 p-2.5 text-gray-500 border border-gray-200 rounded-lg hover:bg-gray-50",onClick:()=>{o(e&&!1),r(!0)},children:[b($e,{className:"size-4.5"}),b("p",{children:"Search"}),S("div",{className:"ms-auto font-mono inline-flex gap-0.5",children:[b("span",{className:"rounded-md border border-gray-200 px-1.5",children:"Ctrl"}),b("span",{className:"rounded-md border border-gray-200 px-1.5",children:"K"})]})]}),t.sidebar?.links?.map(n=>S("div",{children:[b("p",{className:"inline-flex items-center gap-2 mb-2 mt-2 px-2",children:n.section}),b("ul",{className:"mb-4",children:n.items.map(s=>{let l=re(s.icon);return b("li",{children:S(Me,{href:s.href,onNavigate:()=>e&&o(!1),className:p("flex items-center gap-2 text-gray-500 hover:bg-gray-100 py-2 px-2.5 rounded-lg",a===s.href&&"bg-gray-100 text-gray-800"),children:[l&&b(l,{className:"size-4"}),b("span",{children:s.name})]})},s.href)})})]},n.section))]})]})}import{ArrowUpCircleIcon as Fe,SquareArrowOutUpRightIcon as Ue,TextAlignStartIcon as Ke}from"lucide-react";import{usePathname as Ve}from"next/navigation";import{useEffect as I,useRef as ae,useState as G}from"react";import{jsx as w,jsxs as P}from"react/jsx-runtime";function se(){let[e,o]=G(null),[t,r]=G("down"),[a,n]=G(!1),[s,l]=G(!1),{docstraConfig:u,pageData:h}=m(),i=h?.path,c=h?.data?.tableOfContents||[],T=ae(0),M=ae(null),z=Ve(),F=`${"https://github.com/"+u?.editOnGithub?.owner+"/"+u?.editOnGithub?.repo}/edit/main/${u?.editOnGithub?.path}/${i}`;I(()=>{let d=()=>{let f=window.scrollY;r(f>T.current?"down":"up"),n(f>100),T.current=f};return window.addEventListener("scroll",d),()=>window.removeEventListener("scroll",d)},[]),I(()=>{let d=document.querySelectorAll("h2[id], h3[id]"),f=new IntersectionObserver(C=>{if(s)return;let N=C.filter(D=>D.isIntersecting).sort((D,we)=>D.boundingClientRect.top-we.boundingClientRect.top);if(N.length>0){let D=t==="down"?N[0].target.id:N[N.length-1].target.id;o(D)}},{rootMargin:"-40% 0px -50% 0px",threshold:[0,.2,.6,1]});return d.forEach(C=>f.observe(C)),M.current=f,()=>f.disconnect()},[z,t,s]),I(()=>{!(window.scrollY>100)&&o(c[0]?.id)},[c]),I(()=>{if(!e)return;let d=document.querySelector(".toc-scroll-container");if(!d)return;let f=d.querySelector(`a[href="#${e}"]`);if(!f)return;let C=d.getBoundingClientRect(),N=f.getBoundingClientRect();(N.top<C.top||N.bottom>C.bottom)&&f.scrollIntoView({behavior:"smooth",block:"nearest"})},[e]),I(()=>{if(!s)return;let d=setTimeout(()=>l(!1),800);return()=>clearTimeout(d)},[s]);let E=d=>{o(d),l(!0)};return P("aside",{className:"sticky top-18 text-sm hidden xl:block text-gray-500 shrink-0 h-[calc(100svh-72px)] w-64 border-l border-gray-200 p-6 overflow-y-auto",children:[P("p",{className:"flex items-center gap-2 mb-5",children:[w(Ke,{className:"size-4"}),"On this page"]}),w("ul",{className:"toc-scroll-container max-h-3/4 overflow-y-auto scrollbar-none",children:c.map(d=>P("li",{children:[w(ne,{heading:d,activeId:e,handleClick:E}),d.children.map(f=>w(ne,{heading:f,activeId:e,handleClick:E,className:"pl-8"},f.id))]},d.id))}),w("hr",{className:"my-6 border-gray-200"}),u.editOnGithub&&P("a",{href:F,rel:"noopener noreferrer",className:"flex items-center gap-2 text-gray-400 hover:text-gray-700 transition",children:["Edit this page on GitHub",w(Ue,{className:"size-4"})]}),a&&P("button",{onClick:()=>scrollTo({top:0,behavior:"smooth"}),className:"flex items-center cursor-pointer gap-2 mt-3 text-gray-400 hover:text-gray-700 transition",children:["Scroll to top",w(Fe,{className:"size-4"})]})]})}function ne({heading:e,activeId:o,handleClick:t,className:r}){return w("a",{href:`#${e.id}`,className:p("border-l border-gray-200 block py-1.5 pl-4 transition-colors",r,{"border-gray-800 text-gray-900 font-medium":o===e.id,"hover:text-gray-800 hover:border-gray-400":o!==e.id}),onClick:()=>t(e.id),children:e.text})}import{jsx as ie,jsxs as Ye}from"react/jsx-runtime";function ar({children:e,toc:o=!0,sidebar:t=!0}){return Ye("div",{className:"min-h-screen flex bg-white w-full",children:[t&&ie(oe,{}),e,o&&ie(se,{})]})}import{usePathname as Qe}from"next/navigation";import{ChevronRight as _e}from"lucide-react";import le from"next/link";import{jsx as L,jsxs as ce}from"react/jsx-runtime";function me(){let o=Qe().split("/").filter(Boolean),t=o.map((r,a)=>{let n="/"+o.slice(0,a+1).join("/"),s=r.replace(/-/g," ").replace(/\b\w/g,l=>l.toUpperCase());return{href:n,title:s}});return L("nav",{"aria-label":"Breadcrumb",className:"flex text-sm items-center pb-4 text-gray-500",children:ce("ol",{className:"flex items-center space-x-2",children:[L("li",{children:L(le,{href:"/",className:"hover:text-gray-700 transition-colors font-medium",children:"Home"})}),t.map((r,a)=>{let n=a===t.length-1;return ce("li",{className:"flex items-center space-x-2",children:[L(_e,{className:"w-4 h-4 text-gray-400"}),n?L("span",{className:"text-gray-600 font-medium",children:r.title}):L(le,{href:r.href,className:"hover:text-gray-700 font-medium transition-colors",children:r.title})]},r.href)})]})})}import{CheckIcon as Xe,CopyIcon as Je}from"lucide-react";import{useEffect as We,useState as de}from"react";import{jsx as V,jsxs as pe}from"react/jsx-runtime";function ue(){let{pageData:e}=m(),[o,t]=de(!1),[r,a]=de(null);We(()=>{a(window.location.href)},[]);let n=`Read from this URL: ${r} and explain it to me.`;return pe("div",{className:"flex items-center gap-3 mt-6",children:[pe("button",{title:"Copy Markdown",onClick:()=>{navigator.clipboard.writeText(e?.data.raw||""),t(!0),setTimeout(()=>t(!1),3e3)},className:"flex items-center cursor-pointer gap-2 bg-gray-50 hover:bg-gray-100 border border-gray-200 px-3 py-2 rounded-md text-xs",children:[o?V(Xe,{className:"size-3.5"}):V(Je,{className:"size-3.5"}),"Copy Markdown"]}),V("a",{title:"Ask ChatGPT",href:`https://chatgpt.com/?hints=search&q=${encodeURIComponent(n)}`,className:"flex items-center gap-2 bg-gray-50 hover:bg-gray-100 border border-gray-200 px-3 py-2 rounded-md text-xs",rel:"noreferrer noopener",children:"Ask ChatGPT"})]})}import{Fragment as Ze,jsx as A,jsxs as je}from"react/jsx-runtime";function fe(){let{pageData:e}=m(),o=e?.data?.metadata?.title,t=e?.data?.metadata?.description;return je(Ze,{children:[A("h1",{className:"text-3xl font-bold",children:o}),A("p",{className:"my-4 text-gray-500",children:t}),A(ue,{}),A("hr",{className:"my-10 border-gray-200"})]})}import{useState as _}from"react";import{ThumbsUp as tt,ThumbsDown as rt}from"lucide-react";import{jsx as Y,jsxs as ge}from"react/jsx-runtime";function Q({label:e,type:o,placeholder:t="",id:r,required:a=!1,onChange:n,value:s,readOnly:l=!1,className:u="",optional:h=!1}){return ge("div",{className:p("flex flex-col mt-4 w-full",u),children:[e&&ge("label",{htmlFor:r,className:"font-medium w-max cursor-pointer",children:[e,h&&Y("span",{className:"text-xs font-normal text-gray-400 ml-1 mt-1",children:"(Optional)"})]}),o==="textarea"?Y("textarea",{id:r,name:r,className:p("mt-2 w-full p-3 border border-gray-300 resize-none not-focus:hover:border-gray-500 read-only:text-gray-400/80 outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 transition-all duration-200 rounded-lg",u),placeholder:t,required:a,onChange:n,rows:4,value:s,readOnly:l}):Y("input",{type:o,id:r,name:r,className:"mt-2 w-full h-12 px-3 border border-gray-300 not-focus:hover:border-gray-500 read-only:text-gray-400/80 outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 transition-all duration-200 rounded-lg",placeholder:t,required:a,onChange:n,value:s,readOnly:l})]})}import{Loader2Icon as et}from"lucide-react";import{jsx as he}from"react/jsx-runtime";function $({label:e,loading:o,type:t="submit",className:r="",disabled:a=!1,onClick:n}){return he("button",{type:t,disabled:a,className:p("relative w-full mt-4 h-12 px-6 py-3 cursor-pointer font-medium bg-gray-900 hover:opacity-85 text-white rounded-lg",r),"aria-label":e,onClick:n,children:o?he(et,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 animate-spin mx-auto"}):e})}import{Fragment as be,jsx as g,jsxs as k}from"react/jsx-runtime";function xe(){let[e,o]=_(null),{docstraConfig:t}=m(),[r,a]=_(""),[n,s]=_(!1),l="https://github.com/"+t?.editOnGithub?.owner+"/"+t?.editOnGithub?.repo;return g("div",{className:"border-y border-gray-200 mt-20 py-10 space-y-4",children:n?k(be,{children:[g("p",{className:"font-medium text-gray-900",children:"Thank you for your feedback!"}),g($,{onClick:()=>{s(!1),o(null),a("")},label:"Submit Again",className:"w-max text-sm"})]}):k(be,{children:[g("p",{className:"font-medium",children:"How is this guide?"}),k("div",{className:"flex gap-2",children:[k("button",{onClick:()=>o("good"),className:`flex items-center cursor-pointer gap-1 px-3 py-2 rounded-full border text-sm ${e==="good"?"bg-green-100 text-green-600 border-green-300":"border-gray-200 text-gray-600 hover:bg-gray-100"}`,children:[g(tt,{className:`size-4 ${e==="good"?"fill-green-600":"text-gray-500"}`}),"Good"]}),k("button",{onClick:()=>o("bad"),className:`flex items-center cursor-pointer gap-1 px-3 py-2 rounded-full border text-sm ${e==="bad"?"bg-red-100 text-red-600 border-red-300":"border-gray-200 text-gray-600 hover:bg-gray-100"}`,children:[g(rt,{className:`size-4 pt-0.5 ${e==="bad"?"fill-red-600":"text-gray-500"}`}),"Bad"]})]}),e&&k("form",{className:"flex flex-col gap-2",action:`https://api.formsync.app/v1/s/${t?.feedback?.formSyncFormID||""}`,method:"POST",children:[g(Q,{value:r,id:"message",onChange:u=>a(u.target.value),placeholder:"Leave your feedback...",required:!0,type:"textarea"}),g("input",{type:"hidden",name:"opinion",value:e}),g("input",{type:"hidden",name:"page",value:window.location.href}),g("input",{type:"hidden",name:"_redirect",value:window.location.href}),g($,{label:"Submit",className:"w-max text-sm"}),t?.feedback?.watermark!==!1&&k("p",{className:"text-left text-sm text-gray-500 mt-6",children:["Powered by"," ",g("a",{href:`https://www.formsync.app?utm_source=${l}`,className:"text-gray-800",children:"FormSync"})]})]})]})})}import{usePathname as ot}from"next/navigation";import ye from"next/link";import{ArrowLeftIcon as at,ArrowRightIcon as nt}from"lucide-react";import{jsx as O,jsxs as R}from"react/jsx-runtime";function ve(){let e=ot(),{docstraConfig:o}=m(),t=o?.sidebar?.links?.flatMap(s=>s.items),r=t.findIndex(s=>s.href===e),a=r>0?t[r-1]:null,n=r<t.length-1?t[r+1]:null;return R("div",{className:"flex flex-col lg:flex-row gap-2 justify-between py-10 mt-10",children:[a?R(ye,{href:a.href,className:"flex flex-col items-start gap-2 border border-gray-200 hover:bg-gray-50 py-3 md:min-w-62 pl-4 pr-10 rounded-lg text-sm",children:[O("span",{className:"text-gray-500",children:"Previous"}),R("p",{className:"flex items-center font-medium",children:[O(at,{className:"size-5 mr-2"}),a.name]})]}):O("div",{}),n?R(ye,{href:n.href,className:"flex flex-col items-end gap-2 border border-gray-200 hover:bg-gray-50 py-3 pr-4 md:min-w-62 pl-10 rounded-lg text-sm",children:[O("span",{className:"text-gray-500",children:"Next"}),R("p",{className:"flex items-center font-medium",children:[n.name,O(nt,{className:"size-5 ml-2"})]})]}):O("div",{})]})}import{jsx as H,jsxs as st}from"react/jsx-runtime";function Yr({children:e}){let{docstraConfig:o}=m();return st("main",{className:"flex-1 px-4 md:px-8 py-10 max-w-full text-base/7",children:[H(me,{}),H(fe,{}),e,o?.feedback?.enabled&&H(xe,{}),H(ve,{})]})}import{CheckIcon as it,CopyIcon as lt}from"lucide-react";import{Highlight as ct,themes as mt}from"prism-react-renderer";import{useState as dt}from"react";import{jsx as y,jsxs as X}from"react/jsx-runtime";function Zr(e){let{filename:o,children:t,className:r}=e,a=!r?.includes("language-"),n=typeof t=="string"?t:t?.props?.children||"";if(a)return y("code",{className:"px-1 py-0.5 rounded border border-gray-200 text-gray-800 text-sm",children:n});let[s,l]=dt(!1),h=r?.match(/language-([\w-]+)/)?.[1]??"txt";return X("div",{className:"max-w-2xl overflow-hidden rounded-lg text-sm text-gray-800 border border-gray-200/80 mt-4",children:[X("div",{className:"flex items-center bg-gray-50 justify-between border-b border-gray-200/80",children:[y("span",{className:"text-xs text-gray-400 p-4",children:o||h}),y("button",{onClick:()=>{navigator.clipboard.writeText(n.trim()),l(!0),setTimeout(()=>l(!1),2e3)},className:"rounded cursor-pointer aspect-square p-2 m-2 text-xs hover:bg-gray-200 transition",children:s?y(it,{className:"size-4"}):y(lt,{className:"size-4"})})]}),y(ct,{theme:mt.vsLight,code:n.trim(),language:h,children:({tokens:c,getLineProps:T,getTokenProps:M})=>y("pre",{className:"p-4 font-mono whitespace-pre overflow-x-auto",children:c.map((z,q)=>X("div",{...T({line:z}),children:[y("span",{className:"text-slate-500 mr-4 select-none",children:q+1}),z.map((F,E)=>y("span",{...M({token:F})},E))]},q))})})]})}export{Yr as DocstraBody,Zr as DocstraCodeBlock,At as DocstraHeader,ar as DocstraPage,It as DocstraProvider,m as useDocstra};
1
+ "use client";import{createContext as Pe,useContext as Re,useState as Z}from"react";import{ToastContainer as Te}from"react-toast-msg";import{SearchIcon as Ce}from"lucide-react";import{twMerge as Ne}from"tailwind-merge";import ke from"clsx";function p(...e){return Ne(ke(e))}import{useEffect as U,useMemo as De,useState as X}from"react";import Se from"fuse.js";import Le from"next/link";import{useRouter as Ie}from"next/navigation";import{Fragment as Oe,jsx as v,jsxs as B}from"react/jsx-runtime";function J(){let{openSearchBox:e,setOpenSearchBox:o,docs:t}=m(),[r,a]=X(""),[n,s]=X([]),l=Ie();U(()=>{let i=c=>{c.ctrlKey&&c.key==="k"&&(c.preventDefault(),o(!0))};return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[]);let u=De(()=>!t||t.length===0?null:new Se(t,{keys:["data.metadata.title","data.metadata.description"],threshold:.3}),[t]);U(()=>{if(r&&u){let i=u.search(r);s(i.map(c=>c.item))}else r||s([])},[r,u]);let g=i=>{if(i.preventDefault(),r){let c=n[0];c&&(l.push(`/docs/${c.slug}`),a(""),o(!1))}};return U(()=>{let i=c=>{c.key==="Escape"&&(o(!1),a(""))};return e&&window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[e]),v("div",{onClick:()=>{o(!1),a("")},className:p("fixed inset-0 z-25 flex items-start justify-center bg-white/40 backdrop-blur-md opacity-0 pointer-events-none transition-all duration-300",e&&"opacity-100 pointer-events-auto"),children:B("div",{onClick:i=>i.stopPropagation(),className:"flex flex-col items-center mt-30 max-w-lg w-full max-md:px-4",children:[v("form",{onSubmit:g,className:p("relative flex items-center justify-between w-full bg-white border border-slate-200 text-gray-400 h-15 p-0.5 rounded-md",r&&"rounded-b-none border-b-0"),children:e&&B(Oe,{children:[v(Ce,{className:"size-5.5 mx-3 shrink-0"}),v("input",{className:"w-full bg-transparent h-full outline-none text-gray-400 placeholder:text-gray-400",type:"text",placeholder:"Search docs...",spellCheck:"false",autoFocus:!0,value:r,onChange:i=>a(i.target.value),name:"searchQuery",required:!0}),v("span",{className:"border border-gray-200 px-2 mr-3 py-1 rounded text-xs",children:"Esc"})]})}),B("div",{className:p("max-h-70 overflow-x-hidden overflow-y-auto scrollbar-y w-full bg-white text-slate-700 flex flex-col",r&&"rounded-b-md border border-slate-200"),children:[n.map(i=>B(Le,{href:`/docs/${i.slug==="index"?"":i.slug}`,onClick:()=>{o(!1),a("")},className:"w-full hover:bg-gray-100/70 border-b border-slate-200 transition-all py-4 px-4 last:mb-2",children:[v("h4",{className:"font-medium",children:i.data?.metadata?.title||i.slug}),v("p",{className:"text-sm mt-1 text-gray-500",children:i.data?.metadata?.description})]},i.slug)),r&&n.length===0&&v("div",{className:"text-gray-500 text-center py-20",children:"No results found"})]})]})})}import{jsx as j,jsxs as Ee}from"react/jsx-runtime";var ee=Pe(null);function Rt({children:e,docstraConfig:o,docs:t,pageData:r,slug:a}){let n=r||(()=>{let i=Array.isArray(a)?a.length===0?"index":a.join("/"):a||"index";return t.find(c=>c.slug===i)})(),[s,l]=Z(!1),[u,g]=Z(!1);return Ee(ee.Provider,{value:{openSidebar:s,setOpenSidebar:l,docstraConfig:o,openSearchBox:u,setOpenSearchBox:g,pageData:n,docs:t},children:[j(Te,{}),j(J,{}),e]})}function m(){let e=Re(ee);if(!e)throw new Error("Please wrap your app with DocstraProvider");return e}import{TextAlignEnd as ze,XIcon as Be}from"lucide-react";import{useEffect as Ge}from"react";import K from"next/link";import{jsx as x,jsxs as te}from"react/jsx-runtime";function Ht(){let{openSidebar:e,setOpenSidebar:o,docstraConfig:t}=m(),r="https://github.com/"+t?.editOnGithub?.owner+"/"+t?.editOnGithub?.repo;return Ge(()=>{e?document.body.classList.add("max-md:overflow-hidden"):document.body.classList.remove("max-md:overflow-hidden")},[e]),te("header",{className:"sticky top-0 z-10 text-sm flex items-center justify-between border-b border-gray-100 h-18 px-4 md:px-6 bg-white",children:[x(K,{href:t.navbar?.logo?.link||"/",className:"hover:opacity-80 transition",children:x("img",{src:t.navbar?.logo?.src||"/logo.png",alt:t.navbar?.logo?.alt||"Logo",className:p("h-9.5 w-auto",t.navbar?.logo?.className)})}),te("div",{className:"hidden divide-x divide-gray-200 md:flex items-center",children:[t.navbar?.links?.map(a=>x(K,{href:a.href,className:"px-6 hover:text-gray-600",children:a.name},a.name)),x(K,{href:r||"https://github.com/sudhucodes/docstra",children:x("svg",{className:"size-6 mx-6",width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:x("path",{d:"M12 .3a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57L9 21.07c-3.34.72-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.08-.74.09-.73.09-.73 1.2.09 1.83 1.24 1.83 1.24 1.08 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22l-.01 3.29c0 .31.2.69.82.57A12 12 0 0 0 12 .3"})})})]}),x("button",{onClick:()=>o(!e),className:"md:hidden transition text-gray-600 active:ring-2 ring-gray-200 p-1.5 rounded-md",children:e?x(Be,{className:"size-6.5"}):x(ze,{className:"size-6.5"})})]})}import{SearchIcon as Ae}from"lucide-react";import{usePathname as He}from"next/navigation";import*as Fe from"lucide-react";function re(e){if(e)return Fe[e]}import $e from"next/link";import{Fragment as Me,jsx as b,jsxs as S}from"react/jsx-runtime";function oe(){let{openSidebar:e,setOpenSidebar:o,docstraConfig:t,setOpenSearchBox:r}=m(),a=He();return S(Me,{children:[b("div",{className:p("fixed inset-0 z-20 bg-black/50 opacity-0 pointer-events-none transition-all duration-300",e&&"opacity-100 pointer-events-auto"),onClick:()=>o(!1)}),S("aside",{className:p("sticky md:top-18 h-[calc(100svh-72px)] scrollbar-y w-screen max-md:rounded-t-lg z-21 md:w-72 pb-10 text-base md:text-sm shrink-0 border-r border-gray-200 p-4 max-md:fixed bg-white overflow-y-auto transition-all duration-300",e?"top-32":"top-full"),children:[S("div",{className:"flex items-center select-none gap-2 cursor-pointer mt-6 mb-4 p-2.5 text-gray-500 border border-gray-200 rounded-lg hover:bg-gray-50",onClick:()=>{o(e&&!1),r(!0)},children:[b(Ae,{className:"size-4.5"}),b("p",{children:"Search"}),S("div",{className:"ms-auto font-mono inline-flex gap-0.5",children:[b("span",{className:"rounded-md border border-gray-200 px-1.5",children:"Ctrl"}),b("span",{className:"rounded-md border border-gray-200 px-1.5",children:"K"})]})]}),t.sidebar?.links?.map(n=>S("div",{children:[b("p",{className:"inline-flex items-center gap-2 mb-2 mt-2 px-2",children:n.section}),b("ul",{className:"mb-4",children:n.items.map(s=>{let l=re(s.icon);return b("li",{children:S($e,{href:s.href,onNavigate:()=>e&&o(!1),className:p("flex items-center gap-2 text-gray-500 hover:bg-gray-100 py-2 px-2.5 rounded-lg",a===s.href&&"bg-gray-100 text-gray-800"),children:[l&&b(l,{className:"size-4"}),b("span",{children:s.name})]})},s.href)})})]},n.section))]})]})}import{ArrowUpCircleIcon as qe,SquareArrowOutUpRightIcon as Ue,TextAlignStartIcon as Ke}from"lucide-react";import{usePathname as Ve}from"next/navigation";import{useEffect as O,useRef as ae,useState as G}from"react";import{jsx as w,jsxs as P}from"react/jsx-runtime";function se(){let[e,o]=G(null),[t,r]=G("down"),[a,n]=G(!1),[s,l]=G(!1),{docstraConfig:u,pageData:g}=m(),i=g?.path,c=g?.data?.tableOfContents||[],T=ae(0),$=ae(null),E=Ve(),q=`${"https://github.com/"+u?.editOnGithub?.owner+"/"+u?.editOnGithub?.repo}/edit/main/${u?.editOnGithub?.path}/${i}`;O(()=>{let d=()=>{let f=window.scrollY;r(f>T.current?"down":"up"),n(f>100),T.current=f};return window.addEventListener("scroll",d),()=>window.removeEventListener("scroll",d)},[]),O(()=>{let d=document.querySelectorAll("h2[id], h3[id]"),f=new IntersectionObserver(C=>{if(s)return;let N=C.filter(D=>D.isIntersecting).sort((D,we)=>D.boundingClientRect.top-we.boundingClientRect.top);if(N.length>0){let D=t==="down"?N[0].target.id:N[N.length-1].target.id;o(D)}},{rootMargin:"-40% 0px -50% 0px",threshold:[0,.2,.6,1]});return d.forEach(C=>f.observe(C)),$.current=f,()=>f.disconnect()},[E,t,s]),O(()=>{!(window.scrollY>100)&&o(c[0]?.id)},[c]),O(()=>{if(!e)return;let d=document.querySelector(".toc-scroll-container");if(!d)return;let f=d.querySelector(`a[href="#${e}"]`);if(!f)return;let C=d.getBoundingClientRect(),N=f.getBoundingClientRect();(N.top<C.top||N.bottom>C.bottom)&&f.scrollIntoView({behavior:"smooth",block:"nearest"})},[e]),O(()=>{if(!s)return;let d=setTimeout(()=>l(!1),800);return()=>clearTimeout(d)},[s]);let z=d=>{o(d),l(!0)};return P("aside",{className:"sticky top-18 text-sm hidden xl:block text-gray-500 shrink-0 h-[calc(100svh-72px)] w-64 border-l border-gray-200 p-6 overflow-y-auto",children:[P("p",{className:"flex items-center gap-2 mb-5",children:[w(Ke,{className:"size-4"}),"On this page"]}),w("ul",{className:"toc-scroll-container max-h-3/4 overflow-y-auto scrollbar-none",children:c.map(d=>P("li",{children:[w(ne,{heading:d,activeId:e,handleClick:z}),d.children.map(f=>w(ne,{heading:f,activeId:e,handleClick:z,className:"pl-8"},f.id))]},d.id))}),w("hr",{className:"my-6 border-gray-200"}),u.editOnGithub&&P("a",{href:q,rel:"noopener noreferrer",className:"flex items-center gap-2 text-gray-400 hover:text-gray-700 transition",children:["Edit this page on GitHub",w(Ue,{className:"size-4"})]}),a&&P("button",{onClick:()=>scrollTo({top:0,behavior:"smooth"}),className:"flex items-center cursor-pointer gap-2 mt-3 text-gray-400 hover:text-gray-700 transition",children:["Scroll to top",w(qe,{className:"size-4"})]})]})}function ne({heading:e,activeId:o,handleClick:t,className:r}){return w("a",{href:`#${e.id}`,className:p("border-l border-gray-200 block py-1.5 pl-4 transition-colors",r,{"border-gray-800 text-gray-900 font-medium":o===e.id,"hover:text-gray-800 hover:border-gray-400":o!==e.id}),onClick:()=>t(e.id),children:e.text})}import{jsx as ie,jsxs as Ye}from"react/jsx-runtime";function sr({children:e,toc:o=!0,sidebar:t=!0}){return Ye("div",{className:"min-h-screen flex bg-white w-full",children:[t&&ie(oe,{}),e,o&&ie(se,{})]})}import{usePathname as Qe}from"next/navigation";import{ChevronRight as _e}from"lucide-react";import le from"next/link";import{jsx as L,jsxs as ce}from"react/jsx-runtime";function me(){let o=Qe().split("/").filter(Boolean),t=o.map((r,a)=>{let n="/"+o.slice(0,a+1).join("/"),s=r.replace(/-/g," ").replace(/\b\w/g,l=>l.toUpperCase());return{href:n,title:s}});return L("nav",{"aria-label":"Breadcrumb",className:"flex text-sm items-center pb-4 text-gray-500",children:ce("ol",{className:"flex items-center space-x-2",children:[L("li",{children:L(le,{href:"/",className:"hover:text-gray-700 transition-colors font-medium",children:"Home"})}),t.map((r,a)=>{let n=a===t.length-1;return ce("li",{className:"flex items-center space-x-2",children:[L(_e,{className:"w-4 h-4 text-gray-400"}),n?L("span",{className:"text-gray-600 font-medium",children:r.title}):L(le,{href:r.href,className:"hover:text-gray-700 font-medium transition-colors",children:r.title})]},r.href)})]})})}import{CheckIcon as We,CopyIcon as Xe}from"lucide-react";import{useEffect as Je,useState as de}from"react";import{jsx as V,jsxs as pe}from"react/jsx-runtime";function ue(){let{pageData:e}=m(),[o,t]=de(!1),[r,a]=de(null);Je(()=>{a(window.location.href)},[]);let n=`Read from this URL: ${r} and explain it to me.`;return pe("div",{className:"flex items-center gap-3 mt-6",children:[pe("button",{title:"Copy Markdown",onClick:()=>{navigator.clipboard.writeText(e?.data.raw||""),t(!0),setTimeout(()=>t(!1),3e3)},className:"flex items-center cursor-pointer gap-2 bg-gray-50 hover:bg-gray-100 border border-gray-200 px-3 py-2 rounded-md text-xs",children:[o?V(We,{className:"size-3.5"}):V(Xe,{className:"size-3.5"}),"Copy Markdown"]}),V("a",{title:"Ask ChatGPT",href:`https://chatgpt.com/?hints=search&q=${encodeURIComponent(n)}`,className:"flex items-center gap-2 bg-gray-50 hover:bg-gray-100 border border-gray-200 px-3 py-2 rounded-md text-xs",rel:"noreferrer noopener",children:"Ask ChatGPT"})]})}import{Fragment as Ze,jsx as F,jsxs as je}from"react/jsx-runtime";function fe(){let{pageData:e}=m(),o=e?.data?.metadata?.title,t=e?.data?.metadata?.description;return je(Ze,{children:[F("h1",{className:"text-3xl font-bold",children:o}),F("p",{className:"my-4 text-gray-500",children:t}),F(ue,{}),F("hr",{className:"my-10 border-gray-200"})]})}import{useState as A}from"react";import{ThumbsUp as tt,ThumbsDown as rt}from"lucide-react";import{jsx as Y,jsxs as ge}from"react/jsx-runtime";function Q({label:e,type:o,placeholder:t="",id:r,required:a=!1,onChange:n,value:s,readOnly:l=!1,className:u="",optional:g=!1}){return ge("div",{className:p("flex flex-col mt-4 w-full",u),children:[e&&ge("label",{htmlFor:r,className:"font-medium w-max cursor-pointer",children:[e,g&&Y("span",{className:"text-xs font-normal text-gray-400 ml-1 mt-1",children:"(Optional)"})]}),o==="textarea"?Y("textarea",{id:r,name:r,className:p("mt-2 w-full p-3 border border-gray-300 resize-none not-focus:hover:border-gray-500 read-only:text-gray-400/80 outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 transition-all duration-200 rounded-lg",u),placeholder:t,required:a,onChange:n,rows:4,value:s,readOnly:l}):Y("input",{type:o,id:r,name:r,className:"mt-2 w-full h-12 px-3 border border-gray-300 not-focus:hover:border-gray-500 read-only:text-gray-400/80 outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 transition-all duration-200 rounded-lg",placeholder:t,required:a,onChange:n,value:s,readOnly:l})]})}import{Loader2Icon as et}from"lucide-react";import{jsx as he}from"react/jsx-runtime";function _({label:e,loading:o,type:t="submit",className:r="",disabled:a=!1,onClick:n}){return he("button",{type:t,disabled:a,className:p("relative w-full mt-4 h-12 px-6 py-3 cursor-pointer font-medium bg-gray-900 hover:opacity-85 text-white rounded-lg",r),"aria-label":e,onClick:n,children:o?he(et,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 animate-spin mx-auto"}):e})}import{FormSyncButton as ot,FormSyncForm as at}from"formsync";import{Fragment as be,jsx as h,jsxs as k}from"react/jsx-runtime";function xe(){let[e,o]=A(null),{docstraConfig:t}=m(),[r,a]=A(""),[n,s]=A(!0),[l,u]=A(null),g="https://github.com/"+t?.editOnGithub?.owner+"/"+t?.editOnGithub?.repo;return h("div",{className:"border-y border-gray-200 mt-20 py-10 space-y-4",children:n?k(be,{children:[h("p",{className:"font-medium text-gray-900",children:"We appreciate your feedback, Thank you!"}),h(_,{onClick:()=>{s(!1),o(null),a("")},label:"Submit Again",className:"w-max text-sm"})]}):k(be,{children:[h("p",{className:"font-medium",children:"How is this guide?"}),k("div",{className:"flex gap-2",children:[k("button",{onClick:()=>o("good"),className:`flex items-center cursor-pointer gap-1 px-3 py-2 rounded-full border text-sm ${e==="good"?"bg-green-100 text-green-600 border-green-300":"border-gray-200 text-gray-600 hover:bg-gray-100"}`,children:[h(tt,{className:`size-4 ${e==="good"?"fill-green-600":"text-gray-500"}`}),"Good"]}),k("button",{onClick:()=>o("bad"),className:`flex items-center cursor-pointer gap-1 px-3 py-2 rounded-full border text-sm ${e==="bad"?"bg-red-100 text-red-600 border-red-300":"border-gray-200 text-gray-600 hover:bg-gray-100"}`,children:[h(rt,{className:`size-4 pt-0.5 ${e==="bad"?"fill-red-600":"text-gray-500"}`}),"Bad"]})]}),e&&k(at,{className:"flex flex-col gap-2",formId:t?.feedback?.formSyncFormID||"",onSuccess:i=>{s(!0),o(null),a("")},onSubmitError:i=>{u(i.message)},children:[h(Q,{value:r,id:"message",onChange:i=>a(i.target.value),placeholder:"Leave your feedback...",required:!0,type:"textarea"}),l&&h("p",{className:"text-red-500",children:l}),h("input",{type:"hidden",name:"opinion",value:e}),h("input",{type:"hidden",name:"page",value:window.location.href}),h("input",{type:"hidden",name:"_redirect",value:window.location.href}),h(ot,{className:"relative mt-4 h-12 px-6 py-3 cursor-pointer font-medium bg-gray-900 hover:opacity-85 text-white rounded-lg w-max text-sm",children:"Submit"}),t?.feedback?.watermark!==!1&&k("p",{className:"text-left text-sm text-gray-500 mt-6",children:["Powered by"," ",h("a",{href:`https://www.formsync.app?utm_source=${g}`,className:"text-gray-800",children:"FormSync"})]})]})]})})}import{usePathname as nt}from"next/navigation";import ye from"next/link";import{ArrowLeftIcon as st,ArrowRightIcon as it}from"lucide-react";import{jsx as I,jsxs as R}from"react/jsx-runtime";function ve(){let e=nt(),{docstraConfig:o}=m(),t=o?.sidebar?.links?.flatMap(s=>s.items),r=t.findIndex(s=>s.href===e),a=r>0?t[r-1]:null,n=r<t.length-1?t[r+1]:null;return R("div",{className:"flex flex-col lg:flex-row gap-2 justify-between py-10 mt-10",children:[a?R(ye,{href:a.href,className:"flex flex-col items-start gap-2 border border-gray-200 hover:bg-gray-50 py-3 md:min-w-62 pl-4 pr-10 rounded-lg text-sm",children:[I("span",{className:"text-gray-500",children:"Previous"}),R("p",{className:"flex items-center font-medium",children:[I(st,{className:"size-5 mr-2"}),a.name]})]}):I("div",{}),n?R(ye,{href:n.href,className:"flex flex-col items-end gap-2 border border-gray-200 hover:bg-gray-50 py-3 pr-4 md:min-w-62 pl-10 rounded-lg text-sm",children:[I("span",{className:"text-gray-500",children:"Next"}),R("p",{className:"flex items-center font-medium",children:[n.name,I(it,{className:"size-5 ml-2"})]})]}):I("div",{})]})}import{jsx as H,jsxs as lt}from"react/jsx-runtime";function Wr({children:e}){let{docstraConfig:o}=m();return lt("main",{className:"flex-1 px-4 md:px-8 py-10 max-w-full text-base/7",children:[H(me,{}),H(fe,{}),e,o?.feedback?.enabled&&H(xe,{}),H(ve,{})]})}import{CheckIcon as ct,CopyIcon as mt}from"lucide-react";import{Highlight as dt,themes as pt}from"prism-react-renderer";import{useState as ut}from"react";import{jsx as y,jsxs as W}from"react/jsx-runtime";function to(e){let{filename:o,children:t,className:r}=e,a=!r?.includes("language-"),n=typeof t=="string"?t:t?.props?.children||"";if(a)return y("code",{className:"px-1 py-0.5 rounded border border-gray-200 text-gray-800 text-sm",children:n});let[s,l]=ut(!1),g=r?.match(/language-([\w-]+)/)?.[1]??"txt";return W("div",{className:"max-w-2xl overflow-hidden rounded-lg text-sm text-gray-800 border border-gray-200/80 mt-4",children:[W("div",{className:"flex items-center bg-gray-50 justify-between border-b border-gray-200/80",children:[y("span",{className:"text-xs text-gray-400 p-4",children:o||g}),y("button",{onClick:()=>{navigator.clipboard.writeText(n.trim()),l(!0),setTimeout(()=>l(!1),2e3)},className:"rounded cursor-pointer aspect-square p-2 m-2 text-xs hover:bg-gray-200 transition",children:s?y(ct,{className:"size-4"}):y(mt,{className:"size-4"})})]}),y(dt,{theme:pt.vsLight,code:n.trim(),language:g,children:({tokens:c,getLineProps:T,getTokenProps:$})=>y("pre",{className:"p-4 font-mono whitespace-pre overflow-x-auto",children:c.map((E,M)=>W("div",{...T({line:E}),children:[y("span",{className:"text-slate-500 mr-4 select-none",children:M+1}),E.map((q,z)=>y("span",{...$({token:q})},z))]},M))})})]})}export{Wr as DocstraBody,to as DocstraCodeBlock,Ht as DocstraHeader,sr as DocstraPage,Rt as DocstraProvider,m as useDocstra};
@@ -1,23 +1,18 @@
1
- "use strict";var Ut=Object.create;var j=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var Bt=Object.getOwnPropertyNames;var Vt=Object.getPrototypeOf,Kt=Object.prototype.hasOwnProperty;var X=(s,t)=>()=>(s&&(t=s(s=0)),t);var at=(s,t)=>{for(var e in t)j(s,e,{get:t[e],enumerable:!0})},ct=(s,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Bt(t))!Kt.call(s,i)&&i!==e&&j(s,i,{get:()=>t[i],enumerable:!(r=Gt(t,i))||r.enumerable});return s};var b=(s,t,e)=>(e=s!=null?Ut(Vt(s)):{},ct(t||!s||!s.__esModule?j(e,"default",{value:s,enumerable:!0}):e,s)),qt=s=>ct(j({},"__esModule",{value:!0}),s);function pt(s,t={}){let e=t.entryType||t.type;if(e==="both"&&(e=y.FILE_DIR_TYPE),e&&(t.type=e),s){if(typeof s!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(e&&!ht.includes(e))throw new Error(`readdirp: Invalid type passed. Use one of ${ht.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return t.root=s,new Q(t)}var D,ut,R,y,J,mt,Qt,ht,Zt,te,ee,se,dt,ft,Q,_t=X(()=>{"use strict";D=require("fs/promises"),ut=require("stream"),R=require("path"),y={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},J={root:".",fileFilter:s=>!0,directoryFilter:s=>!0,type:y.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(J);mt="READDIRP_RECURSIVE_ERROR",Qt=new Set(["ENOENT","EPERM","EACCES","ELOOP",mt]),ht=[y.DIR_TYPE,y.EVERYTHING_TYPE,y.FILE_DIR_TYPE,y.FILE_TYPE],Zt=new Set([y.DIR_TYPE,y.EVERYTHING_TYPE,y.FILE_DIR_TYPE]),te=new Set([y.EVERYTHING_TYPE,y.FILE_DIR_TYPE,y.FILE_TYPE]),ee=s=>Qt.has(s.code),se=process.platform==="win32",dt=s=>!0,ft=s=>{if(s===void 0)return dt;if(typeof s=="function")return s;if(typeof s=="string"){let t=s.trim();return e=>e.basename===t}if(Array.isArray(s)){let t=s.map(e=>e.trim());return e=>t.some(r=>e.basename===r)}return dt},Q=class extends ut.Readable{constructor(t={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:t.highWaterMark});let e={...J,...t},{root:r,type:i}=e;this._fileFilter=ft(e.fileFilter),this._directoryFilter=ft(e.directoryFilter);let n=e.lstat?D.lstat:D.stat;se?this._stat=a=>n(a,{bigint:!0}):this._stat=n,this._maxDepth=e.depth??J.depth,this._wantsDir=i?Zt.has(i):!1,this._wantsFile=i?te.has(i):!1,this._wantsEverything=i===y.EVERYTHING_TYPE,this._root=(0,R.resolve)(r),this._isDirent=!e.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(r,1)],this.reading=!1,this.parent=void 0}async _read(t){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&t>0;){let e=this.parent,r=e&&e.files;if(r&&r.length>0){let{path:i,depth:n}=e,a=r.splice(0,t).map(c=>this._formatEntry(c,i)),o=await Promise.all(a);for(let c of o){if(!c)continue;if(this.destroyed)return;let h=await this._getEntryType(c);h==="directory"&&this._directoryFilter(c)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(c.fullPath,n+1)),this._wantsDir&&(this.push(c),t--)):(h==="file"||this._includeAsFile(c))&&this._fileFilter(c)&&this._wantsFile&&(this.push(c),t--)}}else{let i=this.parents.pop();if(!i){this.push(null);break}if(this.parent=await i,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(t,e){let r;try{r=await(0,D.readdir)(t,this._rdOptions)}catch(i){this._onError(i)}return{files:r,depth:e,path:t}}async _formatEntry(t,e){let r,i=this._isDirent?t.name:t;try{let n=(0,R.resolve)((0,R.join)(e,i));r={path:(0,R.relative)(this._root,n),fullPath:n,basename:i},r[this._statsProp]=this._isDirent?t:await this._stat(n)}catch(n){this._onError(n);return}return r}_onError(t){ee(t)&&!this.destroyed?this.emit("warn",t):this.destroy(t)}async _getEntryType(t){if(!t&&this._statsProp in t)return"";let e=t[this._statsProp];if(e.isFile())return"file";if(e.isDirectory())return"directory";if(e&&e.isSymbolicLink()){let r=t.fullPath;try{let i=await(0,D.realpath)(r),n=await(0,D.lstat)(i);if(n.isFile())return"file";if(n.isDirectory()){let a=i.length;if(r.startsWith(i)&&r.substr(a,1)===R.sep){let o=new Error(`Circular symlink detected: "${r}" points to "${i}"`);return o.code=mt,this._onError(o)}return"directory"}}catch(i){return this._onError(i),""}}}_includeAsFile(t){let e=t&&t[this._statsProp];return e&&this._wantsEverything&&!e.isDirectory()}}});function wt(s,t,e,r,i){let n=(a,o)=>{e(s),i(a,o,{watchedPath:s}),o&&s!==o&&$(m.resolve(s,o),I,m.join(s,o))};try{return(0,S.watch)(s,{persistent:t.persistent},n)}catch(a){r(a);return}}var S,x,m,gt,ie,et,yt,U,G,st,re,ne,oe,Et,p,P,ae,ce,I,M,N,le,he,de,tt,W,fe,L,Pt,H,$,ue,Z,me,Y,xt=X(()=>{"use strict";S=require("fs"),x=require("fs/promises"),m=b(require("path"),1),gt=require("os"),ie="data",et="end",yt="close",U=()=>{},G=process.platform,st=G==="win32",re=G==="darwin",ne=G==="linux",oe=G==="freebsd",Et=(0,gt.type)()==="OS400",p={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},P=p,ae="watch",ce={lstat:x.lstat,stat:x.stat},I="listeners",M="errHandlers",N="rawEmitters",le=[I,M,N],he=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),de=s=>he.has(m.extname(s).slice(1).toLowerCase()),tt=(s,t)=>{s instanceof Set?s.forEach(t):t(s)},W=(s,t,e)=>{let r=s[t];r instanceof Set||(s[t]=r=new Set([r])),r.add(e)},fe=s=>t=>{let e=s[t];e instanceof Set?e.clear():delete s[t]},L=(s,t,e)=>{let r=s[t];r instanceof Set?r.delete(e):r===e&&delete s[t]},Pt=s=>s instanceof Set?s.size===0:!s,H=new Map;$=(s,t,e,r,i)=>{let n=H.get(s);n&&tt(n[t],a=>{a(e,r,i)})},ue=(s,t,e,r)=>{let{listener:i,errHandler:n,rawEmitter:a}=r,o=H.get(t),c;if(!e.persistent)return c=wt(s,e,i,n,a),c?c.close.bind(c):void 0;if(o)W(o,I,i),W(o,M,n),W(o,N,a);else{if(c=wt(s,e,$.bind(null,t,I),n,$.bind(null,t,N)),!c)return;c.on(P.ERROR,async h=>{let l=$.bind(null,t,M);if(o&&(o.watcherUnusable=!0),st&&h.code==="EPERM")try{await(await(0,x.open)(s,"r")).close(),l(h)}catch{}else l(h)}),o={listeners:i,errHandlers:n,rawEmitters:a,watcher:c},H.set(t,o)}return()=>{L(o,I,i),L(o,M,n),L(o,N,a),Pt(o.listeners)&&(o.watcher.close(),H.delete(t),le.forEach(fe(o)),o.watcher=void 0,Object.freeze(o))}},Z=new Map,me=(s,t,e,r)=>{let{listener:i,rawEmitter:n}=r,a=Z.get(t),o=a&&a.options;return o&&(o.persistent<e.persistent||o.interval>e.interval)&&((0,S.unwatchFile)(t),a=void 0),a?(W(a,I,i),W(a,N,n)):(a={listeners:i,rawEmitters:n,options:e,watcher:(0,S.watchFile)(t,e,(c,h)=>{tt(a.rawEmitters,d=>{d(P.CHANGE,t,{curr:c,prev:h})});let l=c.mtimeMs;(c.size!==h.size||l>h.mtimeMs||l===0)&&tt(a.listeners,d=>d(s,c))})},Z.set(t,a)),()=>{L(a,I,i),L(a,N,n),Pt(a.listeners)&&(Z.delete(t),(0,S.unwatchFile)(t),a.options=a.watcher=void 0,Object.freeze(a))}},Y=class{constructor(t){this.fsw=t,this._boundHandleError=e=>t._handleError(e)}_watchWithNodeFs(t,e){let r=this.fsw.options,i=m.dirname(t),n=m.basename(t);this.fsw._getWatchedDir(i).add(n);let o=m.resolve(t),c={persistent:r.persistent};e||(e=U);let h;if(r.usePolling){let l=r.interval!==r.binaryInterval;c.interval=l&&de(n)?r.binaryInterval:r.interval,h=me(t,o,c,{listener:e,rawEmitter:this.fsw._emitRaw})}else h=ue(t,o,c,{listener:e,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return h}_handleFile(t,e,r){if(this.fsw.closed)return;let i=m.dirname(t),n=m.basename(t),a=this.fsw._getWatchedDir(i),o=e;if(a.has(n))return;let c=async(l,d)=>{if(this.fsw._throttle(ae,t,5)){if(!d||d.mtimeMs===0)try{let f=await(0,x.stat)(t);if(this.fsw.closed)return;let _=f.atimeMs,w=f.mtimeMs;if((!_||_<=w||w!==o.mtimeMs)&&this.fsw._emit(P.CHANGE,t,f),(re||ne||oe)&&o.ino!==f.ino){this.fsw._closeFile(l),o=f;let C=this._watchWithNodeFs(t,c);C&&this.fsw._addPathCloser(l,C)}else o=f}catch{this.fsw._remove(i,n)}else if(a.has(n)){let f=d.atimeMs,_=d.mtimeMs;(!f||f<=_||_!==o.mtimeMs)&&this.fsw._emit(P.CHANGE,t,d),o=d}}},h=this._watchWithNodeFs(t,c);if(!(r&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(t)){if(!this.fsw._throttle(P.ADD,t,0))return;this.fsw._emit(P.ADD,t,e)}return h}async _handleSymlink(t,e,r,i){if(this.fsw.closed)return;let n=t.fullPath,a=this.fsw._getWatchedDir(e);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let o;try{o=await(0,x.realpath)(r)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(i)?this.fsw._symlinkPaths.get(n)!==o&&(this.fsw._symlinkPaths.set(n,o),this.fsw._emit(P.CHANGE,r,t.stats)):(a.add(i),this.fsw._symlinkPaths.set(n,o),this.fsw._emit(P.ADD,r,t.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(n))return!0;this.fsw._symlinkPaths.set(n,!0)}_handleRead(t,e,r,i,n,a,o){if(t=m.join(t,""),o=this.fsw._throttle("readdir",t,1e3),!o)return;let c=this.fsw._getWatchedDir(r.path),h=new Set,l=this.fsw._readdirp(t,{fileFilter:d=>r.filterPath(d),directoryFilter:d=>r.filterDir(d)});if(l)return l.on(ie,async d=>{if(this.fsw.closed){l=void 0;return}let f=d.path,_=m.join(t,f);if(h.add(f),!(d.stats.isSymbolicLink()&&await this._handleSymlink(d,t,_,f))){if(this.fsw.closed){l=void 0;return}(f===i||!i&&!c.has(f))&&(this.fsw._incrReadyCount(),_=m.join(n,m.relative(n,_)),this._addToNodeFs(_,e,r,a+1))}}).on(P.ERROR,this._boundHandleError),new Promise((d,f)=>{if(!l)return f();l.once(et,()=>{if(this.fsw.closed){l=void 0;return}let _=o?o.clear():!1;d(void 0),c.getChildren().filter(w=>w!==t&&!h.has(w)).forEach(w=>{this.fsw._remove(t,w)}),l=void 0,_&&this._handleRead(t,!1,r,i,n,a,o)})})}async _handleDir(t,e,r,i,n,a,o){let c=this.fsw._getWatchedDir(m.dirname(t)),h=c.has(m.basename(t));!(r&&this.fsw.options.ignoreInitial)&&!n&&!h&&this.fsw._emit(P.ADD_DIR,t,e),c.add(m.basename(t)),this.fsw._getWatchedDir(t);let l,d,f=this.fsw.options.depth;if((f==null||i<=f)&&!this.fsw._symlinkPaths.has(o)){if(!n&&(await this._handleRead(t,r,a,n,t,i,l),this.fsw.closed))return;d=this._watchWithNodeFs(t,(_,w)=>{w&&w.mtimeMs===0||this._handleRead(_,!1,a,n,t,i,l)})}return d}async _addToNodeFs(t,e,r,i,n){let a=this.fsw._emitReady;if(this.fsw._isIgnored(t)||this.fsw.closed)return a(),!1;let o=this.fsw._getWatchHelpers(t);r&&(o.filterPath=c=>r.filterPath(c),o.filterDir=c=>r.filterDir(c));try{let c=await ce[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,c))return a(),!1;let h=this.fsw.options.followSymlinks,l;if(c.isDirectory()){let d=m.resolve(t),f=h?await(0,x.realpath)(t):t;if(this.fsw.closed||(l=await this._handleDir(o.watchPath,c,e,i,n,o,f),this.fsw.closed))return;d!==f&&f!==void 0&&this.fsw._symlinkPaths.set(d,f)}else if(c.isSymbolicLink()){let d=h?await(0,x.realpath)(t):t;if(this.fsw.closed)return;let f=m.dirname(o.watchPath);if(this.fsw._getWatchedDir(f).add(o.watchPath),this.fsw._emit(P.ADD,o.watchPath,c),l=await this._handleDir(f,c,e,i,t,o,d),this.fsw.closed)return;d!==void 0&&this.fsw._symlinkPaths.set(m.resolve(t),d)}else l=this._handleFile(o.watchPath,c,e);return a(),l&&this.fsw._addPathCloser(t,l),!1}catch(c){if(this.fsw._handleError(c))return a(),t}}}});var Ct={};at(Ct,{FSWatcher:()=>O,WatchHelper:()=>V,default:()=>Ie,watch:()=>kt});function B(s){return Array.isArray(s)?s:[s]}function Pe(s){return typeof s=="function"?s:typeof s=="string"?t=>s===t:s instanceof RegExp?t=>s.test(t):typeof s=="object"&&s!==null?t=>{if(s.path===t)return!0;if(s.recursive){let e=u.relative(s.path,t);return e?!e.startsWith("..")&&!u.isAbsolute(e):!1}return!1}:()=>!1}function xe(s){if(typeof s!="string")throw new Error("string expected");s=u.normalize(s),s=s.replace(/\\/g,"/");let t=!1;s.startsWith("//")&&(t=!0);let e=/\/\//;for(;s.match(e);)s=s.replace(e,"/");return t&&(s="/"+s),s}function Dt(s,t,e){let r=xe(t);for(let i=0;i<s.length;i++){let n=s[i];if(n(r,e))return!0}return!1}function be(s,t){if(s==null)throw new TypeError("anymatch: specify first argument");let r=B(s).map(i=>Pe(i));return t==null?(i,n)=>Dt(r,i,n):Dt(r,t)}function kt(s,t={}){let e=new O(t);return e.add(s),e}var It,K,St,u,it,pe,Ft,_e,we,ge,bt,ye,Ee,rt,Rt,Tt,Nt,vt,De,Re,nt,Te,ve,V,O,Ie,At=X(()=>{"use strict";It=require("fs"),K=require("fs/promises"),St=require("events"),u=b(require("path"),1);_t();xt();it="/",pe="//",Ft=".",_e="..",we="string",ge=/\\/g,bt=/\/\//,ye=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,Ee=/^\.[/\\]/;rt=s=>typeof s=="object"&&s!==null&&!(s instanceof RegExp);Rt=s=>{let t=B(s).flat();if(!t.every(e=>typeof e===we))throw new TypeError(`Non-string provided as watch path: ${t}`);return t.map(Nt)},Tt=s=>{let t=s.replace(ge,it),e=!1;for(t.startsWith(pe)&&(e=!0);t.match(bt);)t=t.replace(bt,it);return e&&(t=it+t),t},Nt=s=>Tt(u.normalize(Tt(s))),vt=(s="")=>t=>typeof t=="string"?Nt(u.isAbsolute(t)?t:u.join(s,t)):t,De=(s,t)=>u.isAbsolute(s)?s:u.join(t,s),Re=Object.freeze(new Set),nt=class{constructor(t,e){this.path=t,this._removeWatcher=e,this.items=new Set}add(t){let{items:e}=this;e&&t!==Ft&&t!==_e&&e.add(t)}async remove(t){let{items:e}=this;if(!e||(e.delete(t),e.size>0))return;let r=this.path;try{await(0,K.readdir)(r)}catch{this._removeWatcher&&this._removeWatcher(u.dirname(r),u.basename(r))}}has(t){let{items:e}=this;if(e)return e.has(t)}getChildren(){let{items:t}=this;return t?[...t.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=U,this.items=Re,Object.freeze(this)}},Te="stat",ve="lstat",V=class{constructor(t,e,r){this.fsw=r;let i=t;this.path=t=t.replace(Ee,""),this.watchPath=i,this.fullWatchPath=u.resolve(i),this.dirParts=[],this.dirParts.forEach(n=>{n.length>1&&n.pop()}),this.followSymlinks=e,this.statMethod=e?Te:ve}entryPath(t){return u.join(this.watchPath,u.relative(this.watchPath,t.fullPath))}filterPath(t){let{stats:e}=t;if(e&&e.isSymbolicLink())return this.filterDir(t);let r=this.entryPath(t);return this.fsw._isntIgnored(r,e)&&this.fsw._hasReadPermissions(e)}filterDir(t){return this.fsw._isntIgnored(this.entryPath(t),t.stats)}},O=class extends St.EventEmitter{constructor(t={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let e=t.awaitWriteFinish,r={stabilityThreshold:2e3,pollInterval:100},i={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...t,ignored:t.ignored?B(t.ignored):B([]),awaitWriteFinish:e===!0?r:typeof e=="object"?{...r,...e}:!1};Et&&(i.usePolling=!0),i.atomic===void 0&&(i.atomic=!i.usePolling);let n=process.env.CHOKIDAR_USEPOLLING;if(n!==void 0){let c=n.toLowerCase();c==="false"||c==="0"?i.usePolling=!1:c==="true"||c==="1"?i.usePolling=!0:i.usePolling=!!c}let a=process.env.CHOKIDAR_INTERVAL;a&&(i.interval=Number.parseInt(a,10));let o=0;this._emitReady=()=>{o++,o>=this._readyCount&&(this._emitReady=U,this._readyEmitted=!0,process.nextTick(()=>this.emit(p.READY)))},this._emitRaw=(...c)=>this.emit(p.RAW,...c),this._boundRemove=this._remove.bind(this),this.options=i,this._nodeFsHandler=new Y(this),Object.freeze(i)}_addIgnoredPath(t){if(rt(t)){for(let e of this._ignoredPaths)if(rt(e)&&e.path===t.path&&e.recursive===t.recursive)return}this._ignoredPaths.add(t)}_removeIgnoredPath(t){if(this._ignoredPaths.delete(t),typeof t=="string")for(let e of this._ignoredPaths)rt(e)&&e.path===t&&this._ignoredPaths.delete(e)}add(t,e,r){let{cwd:i}=this.options;this.closed=!1,this._closePromise=void 0;let n=Rt(t);return i&&(n=n.map(a=>De(a,i))),n.forEach(a=>{this._removeIgnoredPath(a)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=n.length,Promise.all(n.map(async a=>{let o=await this._nodeFsHandler._addToNodeFs(a,!r,void 0,0,e);return o&&this._emitReady(),o})).then(a=>{this.closed||a.forEach(o=>{o&&this.add(u.dirname(o),u.basename(e||o))})}),this}unwatch(t){if(this.closed)return this;let e=Rt(t),{cwd:r}=this.options;return e.forEach(i=>{!u.isAbsolute(i)&&!this._closers.has(i)&&(r&&(i=u.join(r,i)),i=u.resolve(i)),this._closePath(i),this._addIgnoredPath(i),this._watched.has(i)&&this._addIgnoredPath({path:i,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let t=[];return this._closers.forEach(e=>e.forEach(r=>{let i=r();i instanceof Promise&&t.push(i)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=t.length?Promise.all(t).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let t={};return this._watched.forEach((e,r)=>{let n=(this.options.cwd?u.relative(this.options.cwd,r):r)||Ft;t[n]=e.getChildren().sort()}),t}emitWithAll(t,e){this.emit(t,...e),t!==p.ERROR&&this.emit(p.ALL,t,...e)}async _emit(t,e,r){if(this.closed)return;let i=this.options;st&&(e=u.normalize(e)),i.cwd&&(e=u.relative(i.cwd,e));let n=[e];r!=null&&n.push(r);let a=i.awaitWriteFinish,o;if(a&&(o=this._pendingWrites.get(e)))return o.lastChange=new Date,this;if(i.atomic){if(t===p.UNLINK)return this._pendingUnlinks.set(e,[t,...n]),setTimeout(()=>{this._pendingUnlinks.forEach((c,h)=>{this.emit(...c),this.emit(p.ALL,...c),this._pendingUnlinks.delete(h)})},typeof i.atomic=="number"?i.atomic:100),this;t===p.ADD&&this._pendingUnlinks.has(e)&&(t=p.CHANGE,this._pendingUnlinks.delete(e))}if(a&&(t===p.ADD||t===p.CHANGE)&&this._readyEmitted){let c=(h,l)=>{h?(t=p.ERROR,n[0]=h,this.emitWithAll(t,n)):l&&(n.length>1?n[1]=l:n.push(l),this.emitWithAll(t,n))};return this._awaitWriteFinish(e,a.stabilityThreshold,t,c),this}if(t===p.CHANGE&&!this._throttle(p.CHANGE,e,50))return this;if(i.alwaysStat&&r===void 0&&(t===p.ADD||t===p.ADD_DIR||t===p.CHANGE)){let c=i.cwd?u.join(i.cwd,e):e,h;try{h=await(0,K.stat)(c)}catch{}if(!h||this.closed)return;n.push(h)}return this.emitWithAll(t,n),this}_handleError(t){let e=t&&t.code;return t&&e!=="ENOENT"&&e!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||e!=="EPERM"&&e!=="EACCES")&&this.emit(p.ERROR,t),t||this.closed}_throttle(t,e,r){this._throttled.has(t)||this._throttled.set(t,new Map);let i=this._throttled.get(t);if(!i)throw new Error("invalid throttle");let n=i.get(e);if(n)return n.count++,!1;let a,o=()=>{let h=i.get(e),l=h?h.count:0;return i.delete(e),clearTimeout(a),h&&clearTimeout(h.timeoutObject),l};a=setTimeout(o,r);let c={timeoutObject:a,clear:o,count:0};return i.set(e,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(t,e,r,i){let n=this.options.awaitWriteFinish;if(typeof n!="object")return;let a=n.pollInterval,o,c=t;this.options.cwd&&!u.isAbsolute(t)&&(c=u.join(this.options.cwd,t));let h=new Date,l=this._pendingWrites;function d(f){(0,It.stat)(c,(_,w)=>{if(_||!l.has(t)){_&&_.code!=="ENOENT"&&i(_);return}let C=Number(new Date);f&&w.size!==f.size&&(l.get(t).lastChange=C);let Yt=l.get(t);C-Yt.lastChange>=e?(l.delete(t),i(void 0,w)):o=setTimeout(d,a,w)})}l.has(t)||(l.set(t,{lastChange:h,cancelWait:()=>(l.delete(t),clearTimeout(o),r)}),o=setTimeout(d,a))}_isIgnored(t,e){if(this.options.atomic&&ye.test(t))return!0;if(!this._userIgnored){let{cwd:r}=this.options,n=(this.options.ignored||[]).map(vt(r)),o=[...[...this._ignoredPaths].map(vt(r)),...n];this._userIgnored=be(o,void 0)}return this._userIgnored(t,e)}_isntIgnored(t,e){return!this._isIgnored(t,e)}_getWatchHelpers(t){return new V(t,this.options.followSymlinks,this)}_getWatchedDir(t){let e=u.resolve(t);return this._watched.has(e)||this._watched.set(e,new nt(e,this._boundRemove)),this._watched.get(e)}_hasReadPermissions(t){return this.options.ignorePermissionErrors?!0:!!(Number(t.mode)&256)}_remove(t,e,r){let i=u.join(t,e),n=u.resolve(i);if(r=r??(this._watched.has(i)||this._watched.has(n)),!this._throttle("remove",i,100))return;!r&&this._watched.size===1&&this.add(t,e,!0),this._getWatchedDir(i).getChildren().forEach(f=>this._remove(i,f));let c=this._getWatchedDir(t),h=c.has(e);c.remove(e),this._symlinkPaths.has(n)&&this._symlinkPaths.delete(n);let l=i;if(this.options.cwd&&(l=u.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(l)&&this._pendingWrites.get(l).cancelWait()===p.ADD)return;this._watched.delete(i),this._watched.delete(n);let d=r?p.UNLINK_DIR:p.UNLINK;h&&!this._isIgnored(i)&&this._emit(d,i),this._closePath(i)}_closePath(t){this._closeFile(t);let e=u.dirname(t);this._getWatchedDir(e).remove(u.basename(t))}_closeFile(t){let e=this._closers.get(t);e&&(e.forEach(r=>r()),this._closers.delete(t))}_addPathCloser(t,e){if(!e)return;let r=this._closers.get(t);r||(r=[],this._closers.set(t,r)),r.push(e)}_readdirp(t,e){if(this.closed)return;let r={type:p.ALL,alwaysStat:!0,lstat:!0,...e,depth:0},i=pt(t,r);return this._streams.add(i),i.once(yt,()=>{i=void 0}),i.once(et,()=>{i&&(this._streams.delete(i),i=void 0)}),i}};Ie={watch:kt,FSWatcher:O}});var Ae={};at(Ae,{createSource:()=>Ce,defaultMdxComponents:()=>Ne,defineDocstraConfig:()=>Xt,getPageData:()=>ke,withDocstra:()=>Fe});module.exports=qt(Ae);function Xt(s){return s}var v=b(require("fs")),F=b(require("path"));var T={reset:"\x1B[0m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m"},E={info:s=>{console.log(`${T.blue}[Docstra]${T.reset} ${s}`)},success:s=>{console.log(`${T.green}[Docstra]${T.reset} ${s}`)},warn:s=>{console.warn(`${T.yellow}[Docstra Warning]${T.reset} ${s}`)},error:(s,t)=>{console.error(`${T.red}[Docstra Error]${T.reset} ${s}`),t&&console.error(t)}};function A(s){let t=process.cwd(),e=F.default.join(t,".docstra"),r=F.default.join(e,"index.ts");v.default.existsSync(s)||(E.error(`Content directory not found: ${s}`),E.error(`Please create "${s}" or update "contentDir" in docstra.config.ts`),process.exit(1)),v.default.existsSync(e)||v.default.mkdirSync(e,{recursive:!0});let i=lt(s);i.length===0&&E.warn(`No .md or .mdx files found in ${s}`);let n=[],a=[];i.forEach((c,h)=>{let l=F.default.relative(e,c).replace(/\\/g,"/"),d=`d${h}`;n.push(`import * as ${d} from "${l}?docstra";`);let f=F.default.relative(s,c).replace(/\\/g,"/"),_=Jt(f);a.push(`{
2
- slug: "${_}",
3
- path: "${f}",
1
+ "use strict";var W=Object.create;var y=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var B=(e,t)=>{for(var r in t)y(e,r,{get:t[r],enumerable:!0})},w=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of M(t))!L.call(e,n)&&n!==r&&y(e,n,{get:()=>t[n],enumerable:!(o=_(t,n))||o.enumerable});return e};var l=(e,t,r)=>(r=e!=null?W(I(e)):{},w(t||!e||!e.__esModule?y(r,"default",{value:e,enumerable:!0}):r,e)),H=e=>w(y({},"__esModule",{value:!0}),e);var G={};B(G,{createSource:()=>U,defaultMdxComponents:()=>Q,defineDocstraConfig:()=>A,getPageData:()=>R,withDocstra:()=>J});module.exports=H(G);function A(e){return e}var u=l(require("fs")),m=l(require("path"));var d={reset:"\x1B[0m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m"},c={info:e=>{console.log(`${d.blue}[Docstra]${d.reset} ${e}`)},success:e=>{console.log(`${d.green}[Docstra]${d.reset} ${e}`)},warn:e=>{console.warn(`${d.yellow}[Docstra Warning]${d.reset} ${e}`)},error:(e,t)=>{console.error(`${d.red}[Docstra Error]${d.reset} ${e}`),t&&console.error(t)}};function g(e){let t=process.cwd(),r=m.default.join(t,".docstra"),o=m.default.join(r,"index.ts");u.default.existsSync(e)||(c.error(`Content directory not found: ${e}`),c.error(`Please create "${e}" or update "contentDir" in docstra.config.ts`),process.exit(1)),u.default.existsSync(r)||u.default.mkdirSync(r,{recursive:!0});let n=N(e);n.length===0&&c.warn(`No .md or .mdx files found in ${e}`);let s=[],i=[];n.forEach(($,q)=>{let z=m.default.relative(r,$).replace(/\\/g,"/"),p=`d${q}`;s.push(`import * as ${p} from "${z}?docstra";`);let D=m.default.relative(e,$).replace(/\\/g,"/"),O=V(D);i.push(`{
2
+ slug: "${O}",
3
+ path: "${D}",
4
4
  data: {
5
- metadata: ${d}.metadata,
6
- raw: ${d}.raw,
7
- tableOfContents: ${d}.tableOfContents,
8
- mdxContent: ${d}.mdxContent
5
+ metadata: ${p}.metadata,
6
+ raw: ${p}.raw,
7
+ tableOfContents: ${p}.tableOfContents,
8
+ mdxContent: ${p}.mdxContent
9
9
  }
10
- }`)});let o=`// @ts-nocheck -- auto generated by docstra
11
- ${n.join(`
10
+ }`)});let P=`// @ts-nocheck -- auto generated by docstra
11
+ ${s.join(`
12
12
  `)}
13
13
 
14
14
  export const docs = [
15
- ${a.join(`,
15
+ ${i.join(`,
16
16
  `)}
17
17
  ];
18
- `;v.default.writeFileSync(r,o,"utf8")}function lt(s){return v.default.readdirSync(s).flatMap(t=>{let e=F.default.join(s,t);return v.default.statSync(e).isDirectory()?lt(e):t.endsWith(".md")||t.endsWith(".mdx")?[e]:[]})}function Jt(s){return s.replace(/\\/g,"/").replace(/\/index\.(md|mdx)$/,"").replace(/\.(md|mdx)$/,"")}var Wt=!1,ot=null;async function Lt(s){if(Wt)return;Wt=!0,await A(s);let{FSWatcher:t}=await Promise.resolve().then(()=>(At(),Ct)),e="docstra.config.ts",r=new t({ignoreInitial:!0,persistent:!0,ignored:["node_modules",".next"]});r.add([s,e]),E.info("Dev server started..."),r.on("all",async(i,n)=>{!n.endsWith(".md")&&!n.endsWith(".mdx")&&!n.endsWith("docstra.config.ts")||(ot&&clearTimeout(ot),ot=setTimeout(async()=>{await A(s)},200),E.info("MDX content rebuilt successfully"))}),process.on("exit",()=>{r.closed||r.close()})}var q=b(require("path")),Ot=b(require("fs"));var Se="docs/content";function zt(){let s=process.cwd(),t=q.default.join(s,"docstra.config.ts"),e={};if(Ot.default.existsSync(t))try{delete require.cache[require.resolve(t)];let i=require(t);e=i.default??i}catch(i){E.error("Failed to load docstra.config.ts",i),process.exit(1)}else E.warn("No docstra.config.ts found, using defaults");let r=e.contentDir?q.default.resolve(s,e.contentDir):q.default.join(s,Se);return{root:s,contentDir:r,userConfig:e}}var jt=!1;function Fe(s={}){let t=process.env.NODE_ENV==="development",e=process.env.NODE_ENV==="production",r=zt().contentDir;jt||(jt=!0,t&&Lt(r),e&&(A(r),E.info("MDX content generated successfully")));let i={...s.turbopack,rules:{...s.turbopack?.rules,"*.{md,mdx}":{loaders:[{loader:require.resolve("./docstra-loader")}],as:"*.js"}}};return{...s,turbopack:i,pageExtensions:s.pageExtensions??["ts","tsx","js","jsx","md","mdx"],webpack:(n,a)=>(n.module.rules.push({test:/\.(md|mdx)$/,resourceQuery:/docstra/,use:[{loader:require.resolve("./docstra-loader")}]}),typeof s.webpack=="function"?s.webpack(n,a):n)}}var Ht=require("lucide-react");function Mt(s){return s.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}var z=require("react/jsx-runtime");function k({children:s,level:t}){let e=`h${t}`,i=Mt(typeof s=="string"?s:""),n,a;switch(t){case 2:n="text-2xl",a="size-5";break;case 3:n="text-xl",a="size-4.5";break;case 4:n="text-lg",a="size-4.5";break;case 5:n="text-base",a="size-3.5";break;default:n="text-base",a="size-3.5"}return(0,z.jsxs)(e,{id:i,className:`group mt-10 gap-2 mb-4 flex items-center scroll-mt-26 ${n} font-semibold text-gray-900`,children:[(0,z.jsx)("a",{href:`#${i}`,children:s}),(0,z.jsx)(Ht.LinkIcon,{className:`${a} text-gray-400 opacity-0 group-hover:opacity-100 transition`})]})}var $t=b(require("next/link")),g=require("react/jsx-runtime"),Ne={h1:s=>(0,g.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:s.children}),h2:s=>(0,g.jsx)(k,{...s,level:2}),h3:s=>(0,g.jsx)(k,{...s,level:3}),h4:s=>(0,g.jsx)(k,{...s,level:4}),h5:s=>(0,g.jsx)(k,{...s,level:5}),p:s=>(0,g.jsx)("p",{className:"my-5",children:s.children}),hr:()=>(0,g.jsx)("hr",{className:"my-10 border-gray-200"}),a:s=>s.href.startsWith("http")?(0,g.jsx)("a",{href:s.href,className:"underline underline-offset-4",...s,target:"_blank",rel:"noopener noreferrer",children:s.children}):(0,g.jsx)($t.default,{href:s.href,className:"underline underline-offset-4",...s,children:s.children}),ul:s=>(0,g.jsx)("ul",{className:"list-['-'] pl-4 space-y-2",children:s.children}),li:s=>(0,g.jsx)("li",{className:"mb-2 pl-3 text-gray-700",children:s.children}),ol:s=>(0,g.jsx)("ol",{className:"list-decimal pl-4 space-y-2",children:s.children}),blockquote:s=>(0,g.jsx)("blockquote",{className:"border-l-4 border-gray-200 pl-4 my-8 text-gray-700",children:s.children})};function ke(s,t){return t.find(r=>r.slug===(s?.join("/")||"index"))}function Ce(s){return{getPage:t=>{let e=t?.join("/")||"index",r=s.find(a=>a.slug===e);if(!r)return null;let{mdxContent:i,...n}=r.data;return{info:{...r,data:n},body:r.data.mdxContent}},generateStaticParams:()=>s.map(t=>({slug:t.slug==="index"?[]:t.slug.split("/")})),files:s.map(t=>{let{mdxContent:e,...r}=t.data;return{...t,data:r}}),generateSitemap:({baseUrl:t,lastmod:e,changefreq:r,priority:i})=>s.map(n=>({url:`${t}/${n.slug.replace("index","docs")}`,lastModified:e,changeFrequency:r,priority:i}))}}0&&(module.exports={createSource,defaultMdxComponents,defineDocstraConfig,getPageData,withDocstra});
19
- /*! Bundled license information:
20
-
21
- chokidar/esm/index.js:
22
- (*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) *)
23
- */
18
+ `;u.default.writeFileSync(o,P,"utf8")}function N(e){return u.default.readdirSync(e).flatMap(t=>{let r=m.default.join(e,t);return u.default.statSync(r).isDirectory()?N(r):t.endsWith(".md")||t.endsWith(".mdx")?[r]:[]})}function V(e){return e.replace(/\\/g,"/").replace(/\/index\.(md|mdx)$/,"").replace(/\.(md|mdx)$/,"")}var k=!1,b=null;async function v(e){if(k)return;k=!0,await g(e);let{FSWatcher:t}=await import("chokidar"),r="docstra.config.ts",o=new t({ignoreInitial:!0,persistent:!0,ignored:["node_modules",".next"]});o.add([e,r]),c.info("Dev server started..."),o.on("all",async(n,s)=>{!s.endsWith(".md")&&!s.endsWith(".mdx")&&!s.endsWith("docstra.config.ts")||(b&&clearTimeout(b),b=setTimeout(async()=>{await g(e)},200),c.info("MDX content rebuilt successfully"))}),process.on("exit",()=>{o.closed||o.close()})}var h=l(require("path")),C=l(require("fs"));var X="docs/content";function S(){let e=process.cwd(),t=h.default.join(e,"docstra.config.ts"),r={};if(C.default.existsSync(t))try{delete require.cache[require.resolve(t)];let n=require(t);r=n.default??n}catch(n){c.error("Failed to load docstra.config.ts",n),process.exit(1)}else c.warn("No docstra.config.ts found, using defaults");let o=r.contentDir?h.default.resolve(e,r.contentDir):h.default.join(e,X);return{root:e,contentDir:o,userConfig:r}}var T=!1;function J(e={}){let t=process.env.NODE_ENV==="development",r=process.env.NODE_ENV==="production",o=S().contentDir;T||(T=!0,t&&v(o),r&&(g(o),c.info("MDX content generated successfully")));let n={...e.turbopack,rules:{...e.turbopack?.rules,"*.{md,mdx}":{loaders:[{loader:require.resolve("./docstra-loader")}],as:"*.js"}}};return{...e,turbopack:n,pageExtensions:e.pageExtensions??["ts","tsx","js","jsx","md","mdx"],webpack:(s,i)=>(s.module.rules.push({test:/\.(md|mdx)$/,resourceQuery:/docstra/,use:[{loader:require.resolve("./docstra-loader")}]}),typeof e.webpack=="function"?e.webpack(s,i):s)}}var E=require("lucide-react");function F(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}var x=require("react/jsx-runtime");function f({children:e,level:t}){let r=`h${t}`,n=F(typeof e=="string"?e:""),s,i;switch(t){case 2:s="text-2xl",i="size-5";break;case 3:s="text-xl",i="size-4.5";break;case 4:s="text-lg",i="size-4.5";break;case 5:s="text-base",i="size-3.5";break;default:s="text-base",i="size-3.5"}return(0,x.jsxs)(r,{id:n,className:`group mt-10 gap-2 mb-4 flex items-center scroll-mt-26 ${s} font-semibold text-gray-900`,children:[(0,x.jsx)("a",{href:`#${n}`,children:e}),(0,x.jsx)(E.LinkIcon,{className:`${i} text-gray-400 opacity-0 group-hover:opacity-100 transition`})]})}var j=l(require("next/link")),a=require("react/jsx-runtime"),Q={h1:e=>(0,a.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:e.children}),h2:e=>(0,a.jsx)(f,{...e,level:2}),h3:e=>(0,a.jsx)(f,{...e,level:3}),h4:e=>(0,a.jsx)(f,{...e,level:4}),h5:e=>(0,a.jsx)(f,{...e,level:5}),p:e=>(0,a.jsx)("p",{className:"my-5",children:e.children}),hr:()=>(0,a.jsx)("hr",{className:"my-10 border-gray-200"}),a:e=>e.href.startsWith("http")?(0,a.jsx)("a",{href:e.href,className:"underline underline-offset-4",...e,target:"_blank",rel:"noopener noreferrer",children:e.children}):(0,a.jsx)(j.default,{href:e.href,className:"underline underline-offset-4",...e,children:e.children}),ul:e=>(0,a.jsx)("ul",{className:"list-['-'] pl-4 space-y-2",children:e.children}),li:e=>(0,a.jsx)("li",{className:"mb-2 pl-3 text-gray-700",children:e.children}),ol:e=>(0,a.jsx)("ol",{className:"list-decimal pl-4 space-y-2",children:e.children}),blockquote:e=>(0,a.jsx)("blockquote",{className:"border-l-4 border-gray-200 pl-4 my-8 text-gray-700",children:e.children})};function R(e,t){return t.find(o=>o.slug===(e?.join("/")||"index"))}function U(e){return{getPage:t=>{let r=t?.join("/")||"index",o=e.find(i=>i.slug===r);if(!o)return null;let{mdxContent:n,...s}=o.data;return{info:{...o,data:s},body:o.data.mdxContent}},generateStaticParams:()=>e.map(t=>({slug:t.slug==="index"?[]:t.slug.split("/")})),files:e.map(t=>{let{mdxContent:r,...o}=t.data;return{...t,data:o}}),generateSitemap:({baseUrl:t,lastmod:r,changefreq:o,priority:n})=>e.map(s=>({url:`${t}/${s.slug.replace("index","docs")}`,lastModified:r,changeFrequency:o,priority:n}))}}0&&(module.exports={createSource,defaultMdxComponents,defineDocstraConfig,getPageData,withDocstra});
@@ -1,13 +1,13 @@
1
- var At=Object.defineProperty;var b=(s=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(s,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):s)(function(s){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+s+'" is not supported')});var $=(s,t)=>()=>(s&&(t=s(s=0)),t);var Wt=(s,t)=>{for(var e in t)At(s,e,{get:t[e],enumerable:!0})};import{stat as Ot,lstat as st,readdir as zt,realpath as jt}from"fs/promises";import{Readable as Mt}from"stream";import{resolve as it,relative as Ht,join as $t,sep as Yt}from"path";function ct(s,t={}){let e=t.entryType||t.type;if(e==="both"&&(e=g.FILE_DIR_TYPE),e&&(t.type=e),s){if(typeof s!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(e&&!rt.includes(e))throw new Error(`readdirp: Invalid type passed. Use one of ${rt.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return t.root=s,new U(t)}var g,Y,at,Ut,rt,Gt,Bt,Vt,Kt,nt,ot,U,lt=$(()=>{"use strict";g={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},Y={root:".",fileFilter:s=>!0,directoryFilter:s=>!0,type:g.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(Y);at="READDIRP_RECURSIVE_ERROR",Ut=new Set(["ENOENT","EPERM","EACCES","ELOOP",at]),rt=[g.DIR_TYPE,g.EVERYTHING_TYPE,g.FILE_DIR_TYPE,g.FILE_TYPE],Gt=new Set([g.DIR_TYPE,g.EVERYTHING_TYPE,g.FILE_DIR_TYPE]),Bt=new Set([g.EVERYTHING_TYPE,g.FILE_DIR_TYPE,g.FILE_TYPE]),Vt=s=>Ut.has(s.code),Kt=process.platform==="win32",nt=s=>!0,ot=s=>{if(s===void 0)return nt;if(typeof s=="function")return s;if(typeof s=="string"){let t=s.trim();return e=>e.basename===t}if(Array.isArray(s)){let t=s.map(e=>e.trim());return e=>t.some(r=>e.basename===r)}return nt},U=class extends Mt{constructor(t={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:t.highWaterMark});let e={...Y,...t},{root:r,type:i}=e;this._fileFilter=ot(e.fileFilter),this._directoryFilter=ot(e.directoryFilter);let n=e.lstat?st:Ot;Kt?this._stat=a=>n(a,{bigint:!0}):this._stat=n,this._maxDepth=e.depth??Y.depth,this._wantsDir=i?Gt.has(i):!1,this._wantsFile=i?Bt.has(i):!1,this._wantsEverything=i===g.EVERYTHING_TYPE,this._root=it(r),this._isDirent=!e.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(r,1)],this.reading=!1,this.parent=void 0}async _read(t){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&t>0;){let e=this.parent,r=e&&e.files;if(r&&r.length>0){let{path:i,depth:n}=e,a=r.splice(0,t).map(c=>this._formatEntry(c,i)),o=await Promise.all(a);for(let c of o){if(!c)continue;if(this.destroyed)return;let h=await this._getEntryType(c);h==="directory"&&this._directoryFilter(c)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(c.fullPath,n+1)),this._wantsDir&&(this.push(c),t--)):(h==="file"||this._includeAsFile(c))&&this._fileFilter(c)&&this._wantsFile&&(this.push(c),t--)}}else{let i=this.parents.pop();if(!i){this.push(null);break}if(this.parent=await i,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(t,e){let r;try{r=await zt(t,this._rdOptions)}catch(i){this._onError(i)}return{files:r,depth:e,path:t}}async _formatEntry(t,e){let r,i=this._isDirent?t.name:t;try{let n=it($t(e,i));r={path:Ht(this._root,n),fullPath:n,basename:i},r[this._statsProp]=this._isDirent?t:await this._stat(n)}catch(n){this._onError(n);return}return r}_onError(t){Vt(t)&&!this.destroyed?this.emit("warn",t):this.destroy(t)}async _getEntryType(t){if(!t&&this._statsProp in t)return"";let e=t[this._statsProp];if(e.isFile())return"file";if(e.isDirectory())return"directory";if(e&&e.isSymbolicLink()){let r=t.fullPath;try{let i=await jt(r),n=await st(i);if(n.isFile())return"file";if(n.isDirectory()){let a=i.length;if(r.startsWith(i)&&r.substr(a,1)===Yt){let o=new Error(`Circular symlink detected: "${r}" points to "${i}"`);return o.code=at,this._onError(o)}return"directory"}}catch(i){return this._onError(i),""}}}_includeAsFile(t){let e=t&&t[this._statsProp];return e&&this._wantsEverything&&!e.isDirectory()}}});import{watchFile as qt,unwatchFile as ht,watch as Xt}from"fs";import{open as Jt,stat as ft,lstat as Qt,realpath as G}from"fs/promises";import*as m from"path";import{type as Zt}from"os";function dt(s,t,e,r,i){let n=(a,o)=>{e(s),i(a,o,{watchedPath:s}),o&&s!==o&&L(m.resolve(s,o),D,m.join(s,o))};try{return Xt(s,{persistent:t.persistent},n)}catch(a){r(a);return}}var te,K,ut,z,j,q,ee,se,ie,mt,p,P,re,ne,D,A,T,oe,ae,ce,V,N,le,k,pt,W,L,he,B,de,O,_t=$(()=>{"use strict";te="data",K="end",ut="close",z=()=>{},j=process.platform,q=j==="win32",ee=j==="darwin",se=j==="linux",ie=j==="freebsd",mt=Zt()==="OS400",p={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},P=p,re="watch",ne={lstat:Qt,stat:ft},D="listeners",A="errHandlers",T="rawEmitters",oe=[D,A,T],ae=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),ce=s=>ae.has(m.extname(s).slice(1).toLowerCase()),V=(s,t)=>{s instanceof Set?s.forEach(t):t(s)},N=(s,t,e)=>{let r=s[t];r instanceof Set||(s[t]=r=new Set([r])),r.add(e)},le=s=>t=>{let e=s[t];e instanceof Set?e.clear():delete s[t]},k=(s,t,e)=>{let r=s[t];r instanceof Set?r.delete(e):r===e&&delete s[t]},pt=s=>s instanceof Set?s.size===0:!s,W=new Map;L=(s,t,e,r,i)=>{let n=W.get(s);n&&V(n[t],a=>{a(e,r,i)})},he=(s,t,e,r)=>{let{listener:i,errHandler:n,rawEmitter:a}=r,o=W.get(t),c;if(!e.persistent)return c=dt(s,e,i,n,a),c?c.close.bind(c):void 0;if(o)N(o,D,i),N(o,A,n),N(o,T,a);else{if(c=dt(s,e,L.bind(null,t,D),n,L.bind(null,t,T)),!c)return;c.on(P.ERROR,async h=>{let l=L.bind(null,t,A);if(o&&(o.watcherUnusable=!0),q&&h.code==="EPERM")try{await(await Jt(s,"r")).close(),l(h)}catch{}else l(h)}),o={listeners:i,errHandlers:n,rawEmitters:a,watcher:c},W.set(t,o)}return()=>{k(o,D,i),k(o,A,n),k(o,T,a),pt(o.listeners)&&(o.watcher.close(),W.delete(t),oe.forEach(le(o)),o.watcher=void 0,Object.freeze(o))}},B=new Map,de=(s,t,e,r)=>{let{listener:i,rawEmitter:n}=r,a=B.get(t),o=a&&a.options;return o&&(o.persistent<e.persistent||o.interval>e.interval)&&(ht(t),a=void 0),a?(N(a,D,i),N(a,T,n)):(a={listeners:i,rawEmitters:n,options:e,watcher:qt(t,e,(c,h)=>{V(a.rawEmitters,d=>{d(P.CHANGE,t,{curr:c,prev:h})});let l=c.mtimeMs;(c.size!==h.size||l>h.mtimeMs||l===0)&&V(a.listeners,d=>d(s,c))})},B.set(t,a)),()=>{k(a,D,i),k(a,T,n),pt(a.listeners)&&(B.delete(t),ht(t),a.options=a.watcher=void 0,Object.freeze(a))}},O=class{constructor(t){this.fsw=t,this._boundHandleError=e=>t._handleError(e)}_watchWithNodeFs(t,e){let r=this.fsw.options,i=m.dirname(t),n=m.basename(t);this.fsw._getWatchedDir(i).add(n);let o=m.resolve(t),c={persistent:r.persistent};e||(e=z);let h;if(r.usePolling){let l=r.interval!==r.binaryInterval;c.interval=l&&ce(n)?r.binaryInterval:r.interval,h=de(t,o,c,{listener:e,rawEmitter:this.fsw._emitRaw})}else h=he(t,o,c,{listener:e,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return h}_handleFile(t,e,r){if(this.fsw.closed)return;let i=m.dirname(t),n=m.basename(t),a=this.fsw._getWatchedDir(i),o=e;if(a.has(n))return;let c=async(l,d)=>{if(this.fsw._throttle(re,t,5)){if(!d||d.mtimeMs===0)try{let f=await ft(t);if(this.fsw.closed)return;let _=f.atimeMs,w=f.mtimeMs;if((!_||_<=w||w!==o.mtimeMs)&&this.fsw._emit(P.CHANGE,t,f),(ee||se||ie)&&o.ino!==f.ino){this.fsw._closeFile(l),o=f;let I=this._watchWithNodeFs(t,c);I&&this.fsw._addPathCloser(l,I)}else o=f}catch{this.fsw._remove(i,n)}else if(a.has(n)){let f=d.atimeMs,_=d.mtimeMs;(!f||f<=_||_!==o.mtimeMs)&&this.fsw._emit(P.CHANGE,t,d),o=d}}},h=this._watchWithNodeFs(t,c);if(!(r&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(t)){if(!this.fsw._throttle(P.ADD,t,0))return;this.fsw._emit(P.ADD,t,e)}return h}async _handleSymlink(t,e,r,i){if(this.fsw.closed)return;let n=t.fullPath,a=this.fsw._getWatchedDir(e);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let o;try{o=await G(r)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(a.has(i)?this.fsw._symlinkPaths.get(n)!==o&&(this.fsw._symlinkPaths.set(n,o),this.fsw._emit(P.CHANGE,r,t.stats)):(a.add(i),this.fsw._symlinkPaths.set(n,o),this.fsw._emit(P.ADD,r,t.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(n))return!0;this.fsw._symlinkPaths.set(n,!0)}_handleRead(t,e,r,i,n,a,o){if(t=m.join(t,""),o=this.fsw._throttle("readdir",t,1e3),!o)return;let c=this.fsw._getWatchedDir(r.path),h=new Set,l=this.fsw._readdirp(t,{fileFilter:d=>r.filterPath(d),directoryFilter:d=>r.filterDir(d)});if(l)return l.on(te,async d=>{if(this.fsw.closed){l=void 0;return}let f=d.path,_=m.join(t,f);if(h.add(f),!(d.stats.isSymbolicLink()&&await this._handleSymlink(d,t,_,f))){if(this.fsw.closed){l=void 0;return}(f===i||!i&&!c.has(f))&&(this.fsw._incrReadyCount(),_=m.join(n,m.relative(n,_)),this._addToNodeFs(_,e,r,a+1))}}).on(P.ERROR,this._boundHandleError),new Promise((d,f)=>{if(!l)return f();l.once(K,()=>{if(this.fsw.closed){l=void 0;return}let _=o?o.clear():!1;d(void 0),c.getChildren().filter(w=>w!==t&&!h.has(w)).forEach(w=>{this.fsw._remove(t,w)}),l=void 0,_&&this._handleRead(t,!1,r,i,n,a,o)})})}async _handleDir(t,e,r,i,n,a,o){let c=this.fsw._getWatchedDir(m.dirname(t)),h=c.has(m.basename(t));!(r&&this.fsw.options.ignoreInitial)&&!n&&!h&&this.fsw._emit(P.ADD_DIR,t,e),c.add(m.basename(t)),this.fsw._getWatchedDir(t);let l,d,f=this.fsw.options.depth;if((f==null||i<=f)&&!this.fsw._symlinkPaths.has(o)){if(!n&&(await this._handleRead(t,r,a,n,t,i,l),this.fsw.closed))return;d=this._watchWithNodeFs(t,(_,w)=>{w&&w.mtimeMs===0||this._handleRead(_,!1,a,n,t,i,l)})}return d}async _addToNodeFs(t,e,r,i,n){let a=this.fsw._emitReady;if(this.fsw._isIgnored(t)||this.fsw.closed)return a(),!1;let o=this.fsw._getWatchHelpers(t);r&&(o.filterPath=c=>r.filterPath(c),o.filterDir=c=>r.filterDir(c));try{let c=await ne[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,c))return a(),!1;let h=this.fsw.options.followSymlinks,l;if(c.isDirectory()){let d=m.resolve(t),f=h?await G(t):t;if(this.fsw.closed||(l=await this._handleDir(o.watchPath,c,e,i,n,o,f),this.fsw.closed))return;d!==f&&f!==void 0&&this.fsw._symlinkPaths.set(d,f)}else if(c.isSymbolicLink()){let d=h?await G(t):t;if(this.fsw.closed)return;let f=m.dirname(o.watchPath);if(this.fsw._getWatchedDir(f).add(o.watchPath),this.fsw._emit(P.ADD,o.watchPath,c),l=await this._handleDir(f,c,e,i,t,o,d),this.fsw.closed)return;d!==void 0&&this.fsw._symlinkPaths.set(m.resolve(t),d)}else l=this._handleFile(o.watchPath,c,e);return a(),l&&this.fsw._addPathCloser(t,l),!1}catch(c){if(this.fsw._handleError(c))return a(),t}}}});var Rt={};Wt(Rt,{FSWatcher:()=>C,WatchHelper:()=>H,default:()=>Se,watch:()=>Dt});import{stat as fe}from"fs";import{stat as ue,readdir as me}from"fs/promises";import{EventEmitter as pe}from"events";import*as u from"path";function M(s){return Array.isArray(s)?s:[s]}function xe(s){return typeof s=="function"?s:typeof s=="string"?t=>s===t:s instanceof RegExp?t=>s.test(t):typeof s=="object"&&s!==null?t=>{if(s.path===t)return!0;if(s.recursive){let e=u.relative(s.path,t);return e?!e.startsWith("..")&&!u.isAbsolute(e):!1}return!1}:()=>!1}function be(s){if(typeof s!="string")throw new Error("string expected");s=u.normalize(s),s=s.replace(/\\/g,"/");let t=!1;s.startsWith("//")&&(t=!0);let e=/\/\//;for(;s.match(e);)s=s.replace(e,"/");return t&&(s="/"+s),s}function gt(s,t,e){let r=be(t);for(let i=0;i<s.length;i++){let n=s[i];if(n(r,e))return!0}return!1}function De(s,t){if(s==null)throw new TypeError("anymatch: specify first argument");let r=M(s).map(i=>xe(i));return t==null?(i,n)=>gt(r,i,n):gt(r,t)}function Dt(s,t={}){let e=new C(t);return e.add(s),e}var X,_e,xt,we,ge,ye,wt,Ee,Pe,J,yt,Et,bt,Pt,Re,Te,Q,ve,Ie,H,C,Se,Tt=$(()=>{"use strict";lt();_t();X="/",_e="//",xt=".",we="..",ge="string",ye=/\\/g,wt=/\/\//,Ee=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,Pe=/^\.[/\\]/;J=s=>typeof s=="object"&&s!==null&&!(s instanceof RegExp);yt=s=>{let t=M(s).flat();if(!t.every(e=>typeof e===ge))throw new TypeError(`Non-string provided as watch path: ${t}`);return t.map(bt)},Et=s=>{let t=s.replace(ye,X),e=!1;for(t.startsWith(_e)&&(e=!0);t.match(wt);)t=t.replace(wt,X);return e&&(t=X+t),t},bt=s=>Et(u.normalize(Et(s))),Pt=(s="")=>t=>typeof t=="string"?bt(u.isAbsolute(t)?t:u.join(s,t)):t,Re=(s,t)=>u.isAbsolute(s)?s:u.join(t,s),Te=Object.freeze(new Set),Q=class{constructor(t,e){this.path=t,this._removeWatcher=e,this.items=new Set}add(t){let{items:e}=this;e&&t!==xt&&t!==we&&e.add(t)}async remove(t){let{items:e}=this;if(!e||(e.delete(t),e.size>0))return;let r=this.path;try{await me(r)}catch{this._removeWatcher&&this._removeWatcher(u.dirname(r),u.basename(r))}}has(t){let{items:e}=this;if(e)return e.has(t)}getChildren(){let{items:t}=this;return t?[...t.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=z,this.items=Te,Object.freeze(this)}},ve="stat",Ie="lstat",H=class{constructor(t,e,r){this.fsw=r;let i=t;this.path=t=t.replace(Pe,""),this.watchPath=i,this.fullWatchPath=u.resolve(i),this.dirParts=[],this.dirParts.forEach(n=>{n.length>1&&n.pop()}),this.followSymlinks=e,this.statMethod=e?ve:Ie}entryPath(t){return u.join(this.watchPath,u.relative(this.watchPath,t.fullPath))}filterPath(t){let{stats:e}=t;if(e&&e.isSymbolicLink())return this.filterDir(t);let r=this.entryPath(t);return this.fsw._isntIgnored(r,e)&&this.fsw._hasReadPermissions(e)}filterDir(t){return this.fsw._isntIgnored(this.entryPath(t),t.stats)}},C=class extends pe{constructor(t={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let e=t.awaitWriteFinish,r={stabilityThreshold:2e3,pollInterval:100},i={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...t,ignored:t.ignored?M(t.ignored):M([]),awaitWriteFinish:e===!0?r:typeof e=="object"?{...r,...e}:!1};mt&&(i.usePolling=!0),i.atomic===void 0&&(i.atomic=!i.usePolling);let n=process.env.CHOKIDAR_USEPOLLING;if(n!==void 0){let c=n.toLowerCase();c==="false"||c==="0"?i.usePolling=!1:c==="true"||c==="1"?i.usePolling=!0:i.usePolling=!!c}let a=process.env.CHOKIDAR_INTERVAL;a&&(i.interval=Number.parseInt(a,10));let o=0;this._emitReady=()=>{o++,o>=this._readyCount&&(this._emitReady=z,this._readyEmitted=!0,process.nextTick(()=>this.emit(p.READY)))},this._emitRaw=(...c)=>this.emit(p.RAW,...c),this._boundRemove=this._remove.bind(this),this.options=i,this._nodeFsHandler=new O(this),Object.freeze(i)}_addIgnoredPath(t){if(J(t)){for(let e of this._ignoredPaths)if(J(e)&&e.path===t.path&&e.recursive===t.recursive)return}this._ignoredPaths.add(t)}_removeIgnoredPath(t){if(this._ignoredPaths.delete(t),typeof t=="string")for(let e of this._ignoredPaths)J(e)&&e.path===t&&this._ignoredPaths.delete(e)}add(t,e,r){let{cwd:i}=this.options;this.closed=!1,this._closePromise=void 0;let n=yt(t);return i&&(n=n.map(a=>Re(a,i))),n.forEach(a=>{this._removeIgnoredPath(a)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=n.length,Promise.all(n.map(async a=>{let o=await this._nodeFsHandler._addToNodeFs(a,!r,void 0,0,e);return o&&this._emitReady(),o})).then(a=>{this.closed||a.forEach(o=>{o&&this.add(u.dirname(o),u.basename(e||o))})}),this}unwatch(t){if(this.closed)return this;let e=yt(t),{cwd:r}=this.options;return e.forEach(i=>{!u.isAbsolute(i)&&!this._closers.has(i)&&(r&&(i=u.join(r,i)),i=u.resolve(i)),this._closePath(i),this._addIgnoredPath(i),this._watched.has(i)&&this._addIgnoredPath({path:i,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let t=[];return this._closers.forEach(e=>e.forEach(r=>{let i=r();i instanceof Promise&&t.push(i)})),this._streams.forEach(e=>e.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(e=>e.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=t.length?Promise.all(t).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let t={};return this._watched.forEach((e,r)=>{let n=(this.options.cwd?u.relative(this.options.cwd,r):r)||xt;t[n]=e.getChildren().sort()}),t}emitWithAll(t,e){this.emit(t,...e),t!==p.ERROR&&this.emit(p.ALL,t,...e)}async _emit(t,e,r){if(this.closed)return;let i=this.options;q&&(e=u.normalize(e)),i.cwd&&(e=u.relative(i.cwd,e));let n=[e];r!=null&&n.push(r);let a=i.awaitWriteFinish,o;if(a&&(o=this._pendingWrites.get(e)))return o.lastChange=new Date,this;if(i.atomic){if(t===p.UNLINK)return this._pendingUnlinks.set(e,[t,...n]),setTimeout(()=>{this._pendingUnlinks.forEach((c,h)=>{this.emit(...c),this.emit(p.ALL,...c),this._pendingUnlinks.delete(h)})},typeof i.atomic=="number"?i.atomic:100),this;t===p.ADD&&this._pendingUnlinks.has(e)&&(t=p.CHANGE,this._pendingUnlinks.delete(e))}if(a&&(t===p.ADD||t===p.CHANGE)&&this._readyEmitted){let c=(h,l)=>{h?(t=p.ERROR,n[0]=h,this.emitWithAll(t,n)):l&&(n.length>1?n[1]=l:n.push(l),this.emitWithAll(t,n))};return this._awaitWriteFinish(e,a.stabilityThreshold,t,c),this}if(t===p.CHANGE&&!this._throttle(p.CHANGE,e,50))return this;if(i.alwaysStat&&r===void 0&&(t===p.ADD||t===p.ADD_DIR||t===p.CHANGE)){let c=i.cwd?u.join(i.cwd,e):e,h;try{h=await ue(c)}catch{}if(!h||this.closed)return;n.push(h)}return this.emitWithAll(t,n),this}_handleError(t){let e=t&&t.code;return t&&e!=="ENOENT"&&e!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||e!=="EPERM"&&e!=="EACCES")&&this.emit(p.ERROR,t),t||this.closed}_throttle(t,e,r){this._throttled.has(t)||this._throttled.set(t,new Map);let i=this._throttled.get(t);if(!i)throw new Error("invalid throttle");let n=i.get(e);if(n)return n.count++,!1;let a,o=()=>{let h=i.get(e),l=h?h.count:0;return i.delete(e),clearTimeout(a),h&&clearTimeout(h.timeoutObject),l};a=setTimeout(o,r);let c={timeoutObject:a,clear:o,count:0};return i.set(e,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(t,e,r,i){let n=this.options.awaitWriteFinish;if(typeof n!="object")return;let a=n.pollInterval,o,c=t;this.options.cwd&&!u.isAbsolute(t)&&(c=u.join(this.options.cwd,t));let h=new Date,l=this._pendingWrites;function d(f){fe(c,(_,w)=>{if(_||!l.has(t)){_&&_.code!=="ENOENT"&&i(_);return}let I=Number(new Date);f&&w.size!==f.size&&(l.get(t).lastChange=I);let Ct=l.get(t);I-Ct.lastChange>=e?(l.delete(t),i(void 0,w)):o=setTimeout(d,a,w)})}l.has(t)||(l.set(t,{lastChange:h,cancelWait:()=>(l.delete(t),clearTimeout(o),r)}),o=setTimeout(d,a))}_isIgnored(t,e){if(this.options.atomic&&Ee.test(t))return!0;if(!this._userIgnored){let{cwd:r}=this.options,n=(this.options.ignored||[]).map(Pt(r)),o=[...[...this._ignoredPaths].map(Pt(r)),...n];this._userIgnored=De(o,void 0)}return this._userIgnored(t,e)}_isntIgnored(t,e){return!this._isIgnored(t,e)}_getWatchHelpers(t){return new H(t,this.options.followSymlinks,this)}_getWatchedDir(t){let e=u.resolve(t);return this._watched.has(e)||this._watched.set(e,new Q(e,this._boundRemove)),this._watched.get(e)}_hasReadPermissions(t){return this.options.ignorePermissionErrors?!0:!!(Number(t.mode)&256)}_remove(t,e,r){let i=u.join(t,e),n=u.resolve(i);if(r=r??(this._watched.has(i)||this._watched.has(n)),!this._throttle("remove",i,100))return;!r&&this._watched.size===1&&this.add(t,e,!0),this._getWatchedDir(i).getChildren().forEach(f=>this._remove(i,f));let c=this._getWatchedDir(t),h=c.has(e);c.remove(e),this._symlinkPaths.has(n)&&this._symlinkPaths.delete(n);let l=i;if(this.options.cwd&&(l=u.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(l)&&this._pendingWrites.get(l).cancelWait()===p.ADD)return;this._watched.delete(i),this._watched.delete(n);let d=r?p.UNLINK_DIR:p.UNLINK;h&&!this._isIgnored(i)&&this._emit(d,i),this._closePath(i)}_closePath(t){this._closeFile(t);let e=u.dirname(t);this._getWatchedDir(e).remove(u.basename(t))}_closeFile(t){let e=this._closers.get(t);e&&(e.forEach(r=>r()),this._closers.delete(t))}_addPathCloser(t,e){if(!e)return;let r=this._closers.get(t);r||(r=[],this._closers.set(t,r)),r.push(e)}_readdirp(t,e){if(this.closed)return;let r={type:p.ALL,alwaysStat:!0,lstat:!0,...e,depth:0},i=ct(t,r);return this._streams.add(i),i.once(ut,()=>{i=void 0}),i.once(K,()=>{i&&(this._streams.delete(i),i=void 0)}),i}};Se={watch:Dt,FSWatcher:C}});function Oe(s){return s}import R from"fs";import S from"path";var x={reset:"\x1B[0m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m"},E={info:s=>{console.log(`${x.blue}[Docstra]${x.reset} ${s}`)},success:s=>{console.log(`${x.green}[Docstra]${x.reset} ${s}`)},warn:s=>{console.warn(`${x.yellow}[Docstra Warning]${x.reset} ${s}`)},error:(s,t)=>{console.error(`${x.red}[Docstra Error]${x.reset} ${s}`),t&&console.error(t)}};function F(s){let t=process.cwd(),e=S.join(t,".docstra"),r=S.join(e,"index.ts");R.existsSync(s)||(E.error(`Content directory not found: ${s}`),E.error(`Please create "${s}" or update "contentDir" in docstra.config.ts`),process.exit(1)),R.existsSync(e)||R.mkdirSync(e,{recursive:!0});let i=et(s);i.length===0&&E.warn(`No .md or .mdx files found in ${s}`);let n=[],a=[];i.forEach((c,h)=>{let l=S.relative(e,c).replace(/\\/g,"/"),d=`d${h}`;n.push(`import * as ${d} from "${l}?docstra";`);let f=S.relative(s,c).replace(/\\/g,"/"),_=Lt(f);a.push(`{
2
- slug: "${_}",
3
- path: "${f}",
1
+ var d=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});function M(e){return e}import u from"fs";import p from"path";var l={reset:"\x1B[0m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m"},c={info:e=>{console.log(`${l.blue}[Docstra]${l.reset} ${e}`)},success:e=>{console.log(`${l.green}[Docstra]${l.reset} ${e}`)},warn:e=>{console.warn(`${l.yellow}[Docstra Warning]${l.reset} ${e}`)},error:(e,t)=>{console.error(`${l.red}[Docstra Error]${l.reset} ${e}`),t&&console.error(t)}};function g(e){let t=process.cwd(),r=p.join(t,".docstra"),o=p.join(r,"index.ts");u.existsSync(e)||(c.error(`Content directory not found: ${e}`),c.error(`Please create "${e}" or update "contentDir" in docstra.config.ts`),process.exit(1)),u.existsSync(r)||u.mkdirSync(r,{recursive:!0});let s=$(e);s.length===0&&c.warn(`No .md or .mdx files found in ${e}`);let n=[],a=[];s.forEach((h,T)=>{let F=p.relative(r,h).replace(/\\/g,"/"),f=`d${T}`;n.push(`import * as ${f} from "${F}?docstra";`);let b=p.relative(e,h).replace(/\\/g,"/"),E=j(b);a.push(`{
2
+ slug: "${E}",
3
+ path: "${b}",
4
4
  data: {
5
- metadata: ${d}.metadata,
6
- raw: ${d}.raw,
7
- tableOfContents: ${d}.tableOfContents,
8
- mdxContent: ${d}.mdxContent
5
+ metadata: ${f}.metadata,
6
+ raw: ${f}.raw,
7
+ tableOfContents: ${f}.tableOfContents,
8
+ mdxContent: ${f}.mdxContent
9
9
  }
10
- }`)});let o=`// @ts-nocheck -- auto generated by docstra
10
+ }`)});let S=`// @ts-nocheck -- auto generated by docstra
11
11
  ${n.join(`
12
12
  `)}
13
13
 
@@ -15,9 +15,4 @@ export const docs = [
15
15
  ${a.join(`,
16
16
  `)}
17
17
  ];
18
- `;R.writeFileSync(r,o,"utf8")}function et(s){return R.readdirSync(s).flatMap(t=>{let e=S.join(s,t);return R.statSync(e).isDirectory()?et(e):t.endsWith(".md")||t.endsWith(".mdx")?[e]:[]})}function Lt(s){return s.replace(/\\/g,"/").replace(/\/index\.(md|mdx)$/,"").replace(/\.(md|mdx)$/,"")}var vt=!1,Z=null;async function It(s){if(vt)return;vt=!0,await F(s);let{FSWatcher:t}=await Promise.resolve().then(()=>(Tt(),Rt)),e="docstra.config.ts",r=new t({ignoreInitial:!0,persistent:!0,ignored:["node_modules",".next"]});r.add([s,e]),E.info("Dev server started..."),r.on("all",async(i,n)=>{!n.endsWith(".md")&&!n.endsWith(".mdx")&&!n.endsWith("docstra.config.ts")||(Z&&clearTimeout(Z),Z=setTimeout(async()=>{await F(s)},200),E.info("MDX content rebuilt successfully"))}),process.on("exit",()=>{r.closed||r.close()})}import tt from"path";import Fe from"fs";var Ne="docs/content";function St(){let s=process.cwd(),t=tt.join(s,"docstra.config.ts"),e={};if(Fe.existsSync(t))try{delete b.cache[b.resolve(t)];let i=b(t);e=i.default??i}catch(i){E.error("Failed to load docstra.config.ts",i),process.exit(1)}else E.warn("No docstra.config.ts found, using defaults");let r=e.contentDir?tt.resolve(s,e.contentDir):tt.join(s,Ne);return{root:s,contentDir:r,userConfig:e}}var Ft=!1;function ps(s={}){let t=process.env.NODE_ENV==="development",e=process.env.NODE_ENV==="production",r=St().contentDir;Ft||(Ft=!0,t&&It(r),e&&(F(r),E.info("MDX content generated successfully")));let i={...s.turbopack,rules:{...s.turbopack?.rules,"*.{md,mdx}":{loaders:[{loader:b.resolve("./docstra-loader")}],as:"*.js"}}};return{...s,turbopack:i,pageExtensions:s.pageExtensions??["ts","tsx","js","jsx","md","mdx"],webpack:(n,a)=>(n.module.rules.push({test:/\.(md|mdx)$/,resourceQuery:/docstra/,use:[{loader:b.resolve("./docstra-loader")}]}),typeof s.webpack=="function"?s.webpack(n,a):n)}}import{LinkIcon as ke}from"lucide-react";function Nt(s){return s.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}import{jsx as kt,jsxs as Ce}from"react/jsx-runtime";function v({children:s,level:t}){let e=`h${t}`,i=Nt(typeof s=="string"?s:""),n,a;switch(t){case 2:n="text-2xl",a="size-5";break;case 3:n="text-xl",a="size-4.5";break;case 4:n="text-lg",a="size-4.5";break;case 5:n="text-base",a="size-3.5";break;default:n="text-base",a="size-3.5"}return Ce(e,{id:i,className:`group mt-10 gap-2 mb-4 flex items-center scroll-mt-26 ${n} font-semibold text-gray-900`,children:[kt("a",{href:`#${i}`,children:s}),kt(ke,{className:`${a} text-gray-400 opacity-0 group-hover:opacity-100 transition`})]})}import Ae from"next/link";import{jsx as y}from"react/jsx-runtime";var Rs={h1:s=>y("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:s.children}),h2:s=>y(v,{...s,level:2}),h3:s=>y(v,{...s,level:3}),h4:s=>y(v,{...s,level:4}),h5:s=>y(v,{...s,level:5}),p:s=>y("p",{className:"my-5",children:s.children}),hr:()=>y("hr",{className:"my-10 border-gray-200"}),a:s=>s.href.startsWith("http")?y("a",{href:s.href,className:"underline underline-offset-4",...s,target:"_blank",rel:"noopener noreferrer",children:s.children}):y(Ae,{href:s.href,className:"underline underline-offset-4",...s,children:s.children}),ul:s=>y("ul",{className:"list-['-'] pl-4 space-y-2",children:s.children}),li:s=>y("li",{className:"mb-2 pl-3 text-gray-700",children:s.children}),ol:s=>y("ol",{className:"list-decimal pl-4 space-y-2",children:s.children}),blockquote:s=>y("blockquote",{className:"border-l-4 border-gray-200 pl-4 my-8 text-gray-700",children:s.children})};function Is(s,t){return t.find(r=>r.slug===(s?.join("/")||"index"))}function Fs(s){return{getPage:t=>{let e=t?.join("/")||"index",r=s.find(a=>a.slug===e);if(!r)return null;let{mdxContent:i,...n}=r.data;return{info:{...r,data:n},body:r.data.mdxContent}},generateStaticParams:()=>s.map(t=>({slug:t.slug==="index"?[]:t.slug.split("/")})),files:s.map(t=>{let{mdxContent:e,...r}=t.data;return{...t,data:r}}),generateSitemap:({baseUrl:t,lastmod:e,changefreq:r,priority:i})=>s.map(n=>({url:`${t}/${n.slug.replace("index","docs")}`,lastModified:e,changeFrequency:r,priority:i}))}}export{Fs as createSource,Rs as defaultMdxComponents,Oe as defineDocstraConfig,Is as getPageData,ps as withDocstra};
19
- /*! Bundled license information:
20
-
21
- chokidar/esm/index.js:
22
- (*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) *)
23
- */
18
+ `;u.writeFileSync(o,S,"utf8")}function $(e){return u.readdirSync(e).flatMap(t=>{let r=p.join(e,t);return u.statSync(r).isDirectory()?$(r):t.endsWith(".md")||t.endsWith(".mdx")?[r]:[]})}function j(e){return e.replace(/\\/g,"/").replace(/\/index\.(md|mdx)$/,"").replace(/\.(md|mdx)$/,"")}var D=!1,x=null;async function w(e){if(D)return;D=!0,await g(e);let{FSWatcher:t}=await import("chokidar"),r="docstra.config.ts",o=new t({ignoreInitial:!0,persistent:!0,ignored:["node_modules",".next"]});o.add([e,r]),c.info("Dev server started..."),o.on("all",async(s,n)=>{!n.endsWith(".md")&&!n.endsWith(".mdx")&&!n.endsWith("docstra.config.ts")||(x&&clearTimeout(x),x=setTimeout(async()=>{await g(e)},200),c.info("MDX content rebuilt successfully"))}),process.on("exit",()=>{o.closed||o.close()})}import y from"path";import P from"fs";var q="docs/content";function N(){let e=process.cwd(),t=y.join(e,"docstra.config.ts"),r={};if(P.existsSync(t))try{delete d.cache[d.resolve(t)];let s=d(t);r=s.default??s}catch(s){c.error("Failed to load docstra.config.ts",s),process.exit(1)}else c.warn("No docstra.config.ts found, using defaults");let o=r.contentDir?y.resolve(e,r.contentDir):y.join(e,q);return{root:e,contentDir:o,userConfig:r}}var k=!1;function oe(e={}){let t=process.env.NODE_ENV==="development",r=process.env.NODE_ENV==="production",o=N().contentDir;k||(k=!0,t&&w(o),r&&(g(o),c.info("MDX content generated successfully")));let s={...e.turbopack,rules:{...e.turbopack?.rules,"*.{md,mdx}":{loaders:[{loader:d.resolve("./docstra-loader")}],as:"*.js"}}};return{...e,turbopack:s,pageExtensions:e.pageExtensions??["ts","tsx","js","jsx","md","mdx"],webpack:(n,a)=>(n.module.rules.push({test:/\.(md|mdx)$/,resourceQuery:/docstra/,use:[{loader:d.resolve("./docstra-loader")}]}),typeof e.webpack=="function"?e.webpack(n,a):n)}}import{LinkIcon as z}from"lucide-react";function v(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}import{jsx as C,jsxs as O}from"react/jsx-runtime";function m({children:e,level:t}){let r=`h${t}`,s=v(typeof e=="string"?e:""),n,a;switch(t){case 2:n="text-2xl",a="size-5";break;case 3:n="text-xl",a="size-4.5";break;case 4:n="text-lg",a="size-4.5";break;case 5:n="text-base",a="size-3.5";break;default:n="text-base",a="size-3.5"}return O(r,{id:s,className:`group mt-10 gap-2 mb-4 flex items-center scroll-mt-26 ${n} font-semibold text-gray-900`,children:[C("a",{href:`#${s}`,children:e}),C(z,{className:`${a} text-gray-400 opacity-0 group-hover:opacity-100 transition`})]})}import W from"next/link";import{jsx as i}from"react/jsx-runtime";var fe={h1:e=>i("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:e.children}),h2:e=>i(m,{...e,level:2}),h3:e=>i(m,{...e,level:3}),h4:e=>i(m,{...e,level:4}),h5:e=>i(m,{...e,level:5}),p:e=>i("p",{className:"my-5",children:e.children}),hr:()=>i("hr",{className:"my-10 border-gray-200"}),a:e=>e.href.startsWith("http")?i("a",{href:e.href,className:"underline underline-offset-4",...e,target:"_blank",rel:"noopener noreferrer",children:e.children}):i(W,{href:e.href,className:"underline underline-offset-4",...e,children:e.children}),ul:e=>i("ul",{className:"list-['-'] pl-4 space-y-2",children:e.children}),li:e=>i("li",{className:"mb-2 pl-3 text-gray-700",children:e.children}),ol:e=>i("ol",{className:"list-decimal pl-4 space-y-2",children:e.children}),blockquote:e=>i("blockquote",{className:"border-l-4 border-gray-200 pl-4 my-8 text-gray-700",children:e.children})};function xe(e,t){return t.find(o=>o.slug===(e?.join("/")||"index"))}function he(e){return{getPage:t=>{let r=t?.join("/")||"index",o=e.find(a=>a.slug===r);if(!o)return null;let{mdxContent:s,...n}=o.data;return{info:{...o,data:n},body:o.data.mdxContent}},generateStaticParams:()=>e.map(t=>({slug:t.slug==="index"?[]:t.slug.split("/")})),files:e.map(t=>{let{mdxContent:r,...o}=t.data;return{...t,data:o}}),generateSitemap:({baseUrl:t,lastmod:r,changefreq:o,priority:s})=>e.map(n=>({url:`${t}/${n.slug.replace("index","docs")}`,lastModified:r,changeFrequency:o,priority:s}))}}export{he as createSource,fe as defaultMdxComponents,M as defineDocstraConfig,xe as getPageData,oe as withDocstra};
package/package.json CHANGED
@@ -1,73 +1,76 @@
1
- {
2
- "name": "docstra",
3
- "version": "1.8.1",
4
- "bin": {
5
- "docstra": "cli/index.js"
6
- },
7
- "description": "The Modern Documentation Framework for Next.js",
8
- "files": [
9
- "dist",
10
- "cli"
11
- ],
12
- "exports": {
13
- ".": {
14
- "types": "./dist/client/index.d.ts",
15
- "import": "./dist/client/index.mjs",
16
- "require": "./dist/client/index.js"
17
- },
18
- "./server": {
19
- "types": "./dist/server/index.d.ts",
20
- "import": "./dist/server/index.mjs",
21
- "require": "./dist/server/index.js"
22
- },
23
- "./config": {
24
- "types": "./dist/server/index.d.ts",
25
- "import": "./dist/server/index.mjs",
26
- "require": "./dist/server/index.js"
27
- },
28
- "./css": "./dist/styles.css"
29
- },
30
- "scripts": {
31
- "build": "npm run build:ts && npm run build:css",
32
- "dev": "tsup --watch",
33
- "build:ts": "tsup",
34
- "build:css": "npx @tailwindcss/cli -i ./src/styles/input.css -o ./dist/styles.css",
35
- "prettier": "prettier --write src"
36
- },
37
- "devDependencies": {
38
- "@tailwindcss/cli": "^4.1.17",
39
- "@types/node": "^24.10.1",
40
- "@types/react": "^19.2.2",
41
- "@types/react-dom": "^19.2.2",
42
- "@types/webpack": "^5.28.5",
43
- "prettier": "^3.6.2",
44
- "tailwindcss": "^4.1.17",
45
- "tsup": "^8.5.0",
46
- "typescript": "^5.9.3"
47
- },
48
- "dependencies": {
49
- "clsx": "^2.1.1",
50
- "fuse.js": "^7.1.0",
51
- "gray-matter": "^4.0.3",
52
- "lucide-react": "^0.554.0",
53
- "next": "^16.0.3",
54
- "next-mdx-remote": "^5.0.0",
55
- "prism-react-renderer": "^2.4.1",
56
- "react": "^18 || ^19",
57
- "react-dom": "^18 || ^19",
58
- "react-toast-msg": "^2.2.6",
59
- "tailwind-merge": "^3.4.0",
60
- "unist-util-visit": "^5.0.0"
61
- },
62
- "keywords": [
63
- "next",
64
- "nextjs",
65
- "documentation",
66
- "docs",
67
- "docstra",
68
- "nextra",
69
- "tailwindcss"
70
- ],
71
- "author": "@sudhucodes",
72
- "homepage": "https://docstra.sudhucodes.com"
1
+ {
2
+ "name": "docstra",
3
+ "version": "1.8.2",
4
+ "bin": {
5
+ "docstra": "cli/index.js"
6
+ },
7
+ "description": "The Modern Documentation Framework for Next.js",
8
+ "files": [
9
+ "dist",
10
+ "cli"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/client/index.d.ts",
15
+ "import": "./dist/client/index.mjs",
16
+ "require": "./dist/client/index.js"
17
+ },
18
+ "./server": {
19
+ "types": "./dist/server/index.d.ts",
20
+ "import": "./dist/server/index.mjs",
21
+ "require": "./dist/server/index.js"
22
+ },
23
+ "./config": {
24
+ "types": "./dist/server/index.d.ts",
25
+ "import": "./dist/server/index.mjs",
26
+ "require": "./dist/server/index.js"
27
+ },
28
+ "./css": "./dist/styles.css"
29
+ },
30
+ "scripts": {
31
+ "build": "pnpm run build:ts && pnpm run build:css",
32
+ "dev": "tsup --watch",
33
+ "build:ts": "tsup",
34
+ "build:css": "pnpx @tailwindcss/cli -i ./src/styles/input.css -o ./dist/styles.css",
35
+ "prettier": "prettier --write src"
36
+ },
37
+ "devDependencies": {
38
+ "@tailwindcss/cli": "^4.1.17",
39
+ "@types/node": "^24.10.1",
40
+ "@types/react": "^19.2.2",
41
+ "@types/react-dom": "^19.2.2",
42
+ "@types/webpack": "^5.28.5",
43
+ "prettier": "^3.6.2",
44
+ "tailwindcss": "^4.1.17",
45
+ "tsup": "^8.5.0",
46
+ "typescript": "^5.9.3"
47
+ },
48
+ "dependencies": {
49
+ "@mdx-js/mdx": "^3.1.1",
50
+ "chokidar": "^5.0.0",
51
+ "clsx": "^2.1.1",
52
+ "formsync": "^0.1.2",
53
+ "fuse.js": "^7.1.0",
54
+ "gray-matter": "^4.0.3",
55
+ "lucide-react": "^0.554.0",
56
+ "next": "^16.0.3",
57
+ "next-mdx-remote": "^5.0.0",
58
+ "prism-react-renderer": "^2.4.1",
59
+ "react": "^18 || ^19",
60
+ "react-dom": "^18 || ^19",
61
+ "react-toast-msg": "^2.5.5",
62
+ "tailwind-merge": "^3.4.0",
63
+ "unist-util-visit": "^5.0.0"
64
+ },
65
+ "keywords": [
66
+ "next",
67
+ "nextjs",
68
+ "documentation",
69
+ "docs",
70
+ "docstra",
71
+ "nextra",
72
+ "tailwindcss"
73
+ ],
74
+ "author": "@sudhucodes",
75
+ "homepage": "https://docstra.sudhucodes.com"
73
76
  }