boltdocs 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/bin/boltdocs.js +2 -2
- package/dist/base-ui/index.d.mts +3 -3
- package/dist/base-ui/index.d.ts +3 -3
- package/dist/base-ui/index.js +1 -1
- package/dist/base-ui/index.mjs +1 -1
- package/dist/{cache-CRAZ55X7.mjs → cache-P6WK424C.mjs} +1 -1
- package/dist/chunk-22NXDNP4.mjs +74 -0
- package/dist/chunk-2HUVMMJU.mjs +1 -0
- package/dist/chunk-2Z5T6EAU.mjs +1 -0
- package/dist/chunk-CRZGOE32.mjs +1 -0
- package/dist/chunk-HA6543SL.mjs +1 -0
- package/dist/{chunk-ZK2266IZ.mjs → chunk-RPUERTVC.mjs} +1 -1
- package/dist/{chunk-MZBG4N4W.mjs → chunk-URTD6E6S.mjs} +1 -1
- package/dist/chunk-W2NB4T6V.mjs +1 -0
- package/dist/chunk-Y4RRHPXC.mjs +1 -0
- package/dist/client/index.d.mts +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.mjs +1 -1
- package/dist/client/ssr.js +1 -1
- package/dist/client/ssr.mjs +1 -1
- package/dist/hooks/index.d.mts +7 -15
- package/dist/hooks/index.d.ts +7 -15
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/{loading-chS3pm9W.d.ts → loading-B7X5Wchs.d.ts} +3 -5
- package/dist/{loading-BqGrFWO5.d.mts → loading-WuaQbsKb.d.mts} +3 -5
- package/dist/mdx/index.js +1 -1
- package/dist/mdx/index.mjs +1 -1
- package/dist/node/cli-entry.js +27 -23
- package/dist/node/cli-entry.mjs +5 -1
- package/dist/node/index.js +10 -10
- package/dist/node/index.mjs +1 -1
- package/dist/primitives/index.d.mts +2 -2
- package/dist/primitives/index.d.ts +2 -2
- package/dist/primitives/index.js +1 -1
- package/dist/primitives/index.mjs +1 -1
- package/dist/search-dialog-ZRXBAQJ5.mjs +1 -0
- package/package.json +2 -1
- package/src/client/app/theme-context.tsx +14 -7
- package/src/client/components/default-layout.tsx +6 -2
- package/src/client/components/primitives/navbar.tsx +3 -3
- package/src/client/components/primitives/search-dialog.tsx +4 -4
- package/src/client/components/primitives/sidebar.tsx +3 -2
- package/src/client/components/primitives/skeleton.tsx +26 -0
- package/src/client/components/ui-base/loading.tsx +43 -73
- package/src/client/components/ui-base/navbar.tsx +8 -6
- package/src/client/components/ui-base/page-nav.tsx +2 -1
- package/src/client/components/ui-base/powered-by.tsx +4 -1
- package/src/client/components/ui-base/search-dialog.tsx +16 -5
- package/src/client/components/ui-base/sidebar.tsx +4 -2
- package/src/client/hooks/use-i18n.ts +3 -2
- package/src/client/hooks/use-localized-to.ts +6 -5
- package/src/client/hooks/use-page-nav.ts +27 -6
- package/src/client/hooks/use-routes.ts +2 -1
- package/src/client/hooks/use-search.ts +81 -59
- package/src/client/hooks/use-sidebar.ts +2 -1
- package/src/client/store/use-boltdocs-store.ts +6 -5
- package/src/client/theme/neutral.css +29 -0
- package/src/node/{cli.ts → cli/build.ts} +17 -23
- package/src/node/cli/dev.ts +22 -0
- package/src/node/cli/doctor.ts +243 -0
- package/src/node/cli/index.ts +9 -0
- package/src/node/cli/ui.ts +54 -0
- package/src/node/cli-entry.ts +16 -16
- package/src/node/config.ts +1 -1
- package/src/node/plugin/entry.ts +1 -1
- package/src/node/plugin/index.ts +24 -10
- package/src/node/routes/parser.ts +9 -9
- package/src/node/search/index.ts +55 -0
- package/src/node/ssg/index.ts +14 -6
- package/src/node/ssg/robots.ts +7 -4
- package/dist/chunk-5D6XPYQ3.mjs +0 -74
- package/dist/chunk-6QXCKZAT.mjs +0 -1
- package/dist/chunk-H4M6P3DM.mjs +0 -1
- package/dist/chunk-JXHNX2WN.mjs +0 -1
- package/dist/chunk-Q3MLYTIQ.mjs +0 -1
- package/dist/chunk-RSII2UPE.mjs +0 -1
- package/dist/chunk-ZRJ55GGF.mjs +0 -1
- package/dist/search-dialog-MA5AISC7.mjs +0 -1
package/dist/mdx/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ir=Object.create;var Ce=Object.defineProperty;var lr=Object.getOwnPropertyDescriptor;var cr=Object.getOwnPropertyNames;var dr=Object.getPrototypeOf,pr=Object.prototype.hasOwnProperty;var mr=(e,t)=>{for(var r in t)Ce(e,r,{get:t[r],enumerable:!0})},Je=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of cr(t))!pr.call(e,n)&&n!==r&&Ce(e,n,{get:()=>t[n],enumerable:!(o=lr(t,n))||o.enumerable});return e};var w=(e,t,r)=>(r=e!=null?ir(dr(e)):{},Je(t||!e||!e.__esModule?Ce(r,"default",{value:e,enumerable:!0}):r,e)),ur=e=>Je(Ce({},"__esModule",{value:!0}),e);var io={};mr(io,{Admonition:()=>U,Badge:()=>ut,Button:()=>tt,Card:()=>ht,Cards:()=>gt,Caution:()=>Tt,CodeBlock:()=>ee,ComponentPreview:()=>Ut,ComponentProps:()=>_t,CopyMarkdown:()=>nr,Danger:()=>Pt,Field:()=>Mt,FileTree:()=>It,Image:()=>$t,Important:()=>kt,InfoBox:()=>wt,Link:()=>Ht,List:()=>At,Note:()=>Ct,Tab:()=>ct,Table:()=>St,Tabs:()=>dt,Tip:()=>Nt,Video:()=>pt,Warning:()=>Rt});module.exports=ur(io);var Re=w(require("react-aria-components"));var Qe=require("clsx"),Ye=require("tailwind-merge");function s(...e){return(0,Ye.twMerge)((0,Qe.clsx)(e))}var et=require("class-variance-authority"),F=require("react/jsx-runtime"),Ne=(0,et.cva)("flex flex-row items-center justify-center w-auto font-semibold tracking-tight no-underline whitespace-nowrap select-none outline-none transition-all duration-200 cursor-pointer pressed:scale-[0.97] hover:-translate-y-px leading-none",{variants:{variant:{primary:"bg-primary-500 text-white shadow-md hover:brightness-110 hover:shadow-lg",secondary:"bg-bg-surface text-text-main border border-border-subtle hover:bg-bg-muted hover:border-border-strong",outline:"bg-transparent text-text-main border border-border-strong hover:bg-bg-surface hover:border-primary-500",ghost:"bg-transparent text-text-muted hover:bg-bg-surface hover:text-text-main",danger:"bg-[var(--color-danger-500)]/10 text-[var(--color-danger-500)] border border-[var(--color-danger-500)]/20 hover:bg-[var(--color-danger-500)]/15",success:"bg-[var(--color-success-500)]/10 text-[var(--color-success-500)] border border-[var(--color-success-500)]/20 hover:bg-[var(--color-success-500)]/15",warning:"bg-[var(--color-warning-500)]/10 text-[var(--color-warning-500)] border border-[var(--color-warning-500)]/20 hover:bg-[var(--color-warning-500)]/15",info:"bg-[var(--color-info-500)]/10 text-[var(--color-info-500)] border border-[var(--color-info-500)]/20 hover:bg-[var(--color-info-500)]/15",subtle:"bg-primary-500/10 text-primary-500 hover:bg-primary-500/20",link:"bg-transparent text-primary-500 !p-0 !min-h-0 hover:underline"},size:{sm:"min-h-8 px-3.5 text-[0.8125rem] gap-1.5",md:"min-h-10 px-5 text-[0.9375rem] gap-2",lg:"min-h-12 px-7 text-[1.05rem] gap-2.5"},rounded:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},iconSize:{sm:"w-8 h-8 p-0",md:"w-10 h-10 p-0",lg:"w-12 h-12 p-0"},disabled:{true:"opacity-50 cursor-not-allowed pointer-events-none",false:null}},defaultVariants:{variant:"primary",size:"md",rounded:"md"}}),Q=({href:e,icon:t,iconPosition:r="left",isIconOnly:o,children:n,className:a,variant:c,size:l,rounded:i,iconSize:d,disabled:p,...m})=>{let b=o||!n&&!!t,x=b?(0,F.jsx)("span",{className:"inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]",children:t}):(0,F.jsxs)(F.Fragment,{children:[t&&r==="left"&&(0,F.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t}),(0,F.jsx)("span",{className:"flex items-center",children:n}),t&&r==="right"&&(0,F.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t})]});return e?(0,F.jsx)(Re.Link,{href:e,className:s(Ne({variant:c,size:l,rounded:i,iconSize:b?d:void 0,disabled:p}),a),...m,children:x}):(0,F.jsx)(Re.Button,{className:s(Ne({variant:c,size:l,rounded:i,iconSize:b?d:void 0,disabled:p}),a),...m,children:x})};var rt=require("react/jsx-runtime"),tt=({className:e,variant:t,size:r,rounded:o,iconSize:n,disabled:a,...c})=>(0,rt.jsx)(Q,{className:s("group",Ne({variant:t,size:r,rounded:o,iconSize:n,disabled:a,className:e})),...c});var we=w(require("react-aria-components")),ke=require("lucide-react");var Pe=require("react"),fr=(0,Pe.createContext)(null);function K(){let e=(0,Pe.use)(fr);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e}var De=require("codesandbox/lib/api/define.js");function ot(e){let t=e.files||{},r=e.dependencies||{},o=e.devDependencies||{},n=e.title||"codesandbox-project",a=e.description||"Generic Sandbox",c={};for(let[l,i]of Object.entries(t)){let d=typeof i.content=="object"?JSON.stringify(i.content,null,2):i.content;c[l]={content:d,isBinary:i.isBinary??!1}}if(!c["package.json"]){let i=e.template==="vite"||!!o.vite||!!o["@vitejs/plugin-react"]?{dev:"vite",build:"vite build",preview:"vite preview"}:{start:"node index.js"};c["package.json"]={content:JSON.stringify({private:!0,name:n,description:a,type:"module",version:"1.0.0",scripts:e.scripts||i,dependencies:r,devDependencies:o},null,2),isBinary:!1}}return c}function br(e){let t=ot(e),r=(0,De.getParameters)({files:t}),o=new URLSearchParams({parameters:r,installDependencies:"true"});return e.entry&&o.set("file",`/${e.entry}`),{parameters:r,url:`https://codesandbox.io/api/v1/sandboxes/define?${o.toString()}`,options:e}}function nt(e){if(typeof window>"u")return br(e);let t=ot(e),r=(0,De.getParameters)({files:t}),o=e.entry||"src/App.tsx",n=document.createElement("form");n.method="POST",n.target="_blank",n.action="https://codesandbox.io/api/v1/sandboxes/define",n.style.display="none";let a=(l,i)=>{let d=document.createElement("input");d.type="hidden",d.name=l,d.value=i,n.appendChild(d)},c=new URLSearchParams({file:`/${o}`,eslint:"0",codemirror:"1",installDependencies:"true"});return a("query",c.toString()),a("parameters",r),document.body.appendChild(n),n.submit(),document.body.removeChild(n),{parameters:r,url:`https://codesandbox.io/api/v1/sandboxes/define?parameters=${r}`,options:e}}var st=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement("textarea");return t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),!0}};var W=require("react");function at(e){let{title:t,sandbox:r}=e,[o,n]=(0,W.useState)(!1),[a,c]=(0,W.useState)(!1),[l,i]=(0,W.useState)(!1),d=(0,W.useRef)(null),p=K(),m=(0,W.useCallback)(async()=>{let x=d.current?.textContent??"";st(x),n(!0),setTimeout(()=>n(!1),2e3)},[]),b=(0,W.useCallback)(()=>{let x=d.current?.textContent??"",P=p?.integrations?.sandbox?.config||{},N=typeof r=="object"?r:P,f=N.entry||"src/App.tsx";nt({title:t??"Code Snippet",...N,files:{...N.files,[f]:{content:x}}})},[t,p,r]);return(0,W.useEffect)(()=>{let x=d.current?.textContent?.length??0;i(x>120)},[e.children,e.highlightedHtml]),{copied:o,isExpanded:a,setIsExpanded:c,isExpandable:l,preRef:d,handleCopy:m,handleSandbox:b,shouldTruncate:l&&!a}}var me=require("react/jsx-runtime");function xr(e){let{size:t=20,...r}=e;return{...r,width:t,height:t}}var it=e=>(0,me.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...xr(e),children:[(0,me.jsx)("title",{children:"CodeSandbox"}),(0,me.jsx)("path",{d:"M0 24h24V0H0v2.455h21.546v19.09H2.454V0H0Z"})]});var Y=w(require("react-aria-components"));var V=require("react/jsx-runtime"),hr=({className:e,children:t,...r})=>(0,V.jsx)(Y.Tooltip,{...r,offset:8,className:o=>s("group z-50 overflow-visible rounded-md bg-bg-surface/90 px-2.5 py-1.5 text-xs font-medium text-text-main shadow-lg backdrop-blur-md ring-1 ring-border-subtle outline-hidden select-none","data-entering:animate-in data-entering:fade-in data-entering:zoom-in-95 data-entering:duration-100","data-exiting:animate-out data-exiting:fade-out data-exiting:zoom-out-95 data-exiting:duration-75","data-[placement=top]:slide-in-from-bottom-1","data-[placement=bottom]:slide-in-from-top-1","data-[placement=left]:slide-in-from-right-1","data-[placement=right]:slide-in-from-left-1",typeof e=="function"?e(o):e),children:o=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Y.OverlayArrow,{children:(0,V.jsxs)("svg",{width:8,height:8,viewBox:"0 0 8 8",className:"fill-bg-surface/90 stroke-border-subtle group-data-[placement=bottom]:rotate-180 group-data-[placement=left]:-rotate-90 group-data-[placement=right]:rotate-90",children:[(0,V.jsx)("title",{children:"Arrow"}),(0,V.jsx)("path",{d:"M0 0 L4 4 L8 0"})]})}),typeof t=="function"?t(o):t]})}),ze=({content:e,children:t,delay:r=500,closeDelay:o=0,...n})=>(0,V.jsxs)(Y.TooltipTrigger,{delay:r,closeDelay:o,children:[t,(0,V.jsx)(hr,{...n,children:e})]});var T=require("react/jsx-runtime");function ee(e){let{children:t,sandbox:r,hideSandbox:o=!0,hideCopy:n=!1,highlightedHtml:a,...c}=e,d=!!K()?.integrations?.sandbox?.enable&&!o,{copied:p,isExpanded:m,setIsExpanded:b,isExpandable:x,preRef:P,handleCopy:N,handleSandbox:f,shouldTruncate:H}=at(e);return(0,T.jsxs)("div",{className:s("group relative my-6 overflow-hidden rounded-lg border border-border-subtle bg-(--color-code-bg)",H&&"[&>pre]:max-h-[250px] [&>pre]:overflow-hidden"),children:[(0,T.jsxs)("div",{className:"absolute top-3 right-4 z-50 flex items-center gap-2 transition-all duration-300 opacity-0 group-hover:opacity-100",children:[d&&(0,T.jsx)(ze,{content:"Open in CodeSandbox",children:(0,T.jsx)(we.Button,{onPress:f,className:"grid place-items-center w-8 h-8 bg-transparent text-text-muted outline-none cursor-pointer transition-all duration-200 hover:scale-115 hover:text-sky-400 active:scale-95 [&>svg]:w-5 [&>svg]:h-5 [&>svg]:stroke-2","aria-label":"Open in CodeSandbox",children:(0,T.jsx)(it,{size:20})})}),!n&&(0,T.jsx)(ze,{content:p?"Copied!":"Copy code",children:(0,T.jsx)(we.Button,{onPress:N,className:s("grid place-items-center w-8 h-8 bg-transparent outline-none cursor-pointer transition-all duration-200 hover:scale-115 active:scale-95 [&>svg]:w-5 [&>svg]:h-5 [&>svg]:stroke-2",p?"text-emerald-400":"text-text-muted hover:text-text-main"),"aria-label":"Copy code",children:p?(0,T.jsx)(ke.Check,{size:20}):(0,T.jsx)(ke.Copy,{size:20})})})]}),a?(0,T.jsx)("div",{ref:P,className:"shiki-wrapper [&>pre]:m-0! [&>pre]:rounded-none! [&>pre]:border-none! [&>pre]:bg-inherit! [&>pre>code]:grid! [&>pre>code]:p-5! [&>.shiki.shiki-themes]:bg-transparent!",dangerouslySetInnerHTML:{__html:a}}):(0,T.jsx)("pre",{ref:P,className:"m-0! rounded-none! border-none! bg-inherit! font-mono text-[0.8125rem] leading-[1.7]",...c,children:t}),x&&(0,T.jsx)("div",{className:s(H?"absolute bottom-0 inset-x-0 h-24 bg-linear-to-t from-(--color-code-bg) to-transparent flex items-end justify-center pb-4 z-10":"relative flex justify-center py-4"),children:(0,T.jsx)(we.Button,{onPress:()=>b(!m),className:"rounded-full bg-bg-surface border border-border-subtle px-5 py-2 text-[0.8125rem] font-medium text-text-main outline-none cursor-pointer transition-all hover:bg-border-subtle hover:-translate-y-px backdrop-blur-md",children:m?"Show less":"Expand code"})})]})}var te=require("react"),Z=w(require("react-aria-components"));var j=require("react");function lt({initialIndex:e=0,tabs:t}){let r=t[e]?.props.disabled?t.findIndex(d=>!d.props.disabled):e,[o,n]=(0,j.useState)(r===-1?0:r),a=(0,j.useRef)([]),[c,l]=(0,j.useState)({opacity:0,transform:"translateX(0)",width:0});(0,j.useEffect)(()=>{let d=a.current[o];d&&l({opacity:1,width:d.offsetWidth,transform:`translateX(${d.offsetLeft}px)`})},[o,t]);let i=(0,j.useCallback)(d=>{let p=0;if(d.key==="ArrowRight"?p=1:d.key==="ArrowLeft"&&(p=-1),p!==0){let m=(o+p+t.length)%t.length;for(;t[m].props.disabled&&m!==o;)m=(m+p+t.length)%t.length;m!==o&&!t[m].props.disabled&&(n(m),a.current[m]?.focus())}},[o,t]);return{active:o,setActive:n,tabRefs:a,indicatorStyle:c,handleKeyDown:i}}var He=require("class-variance-authority"),B=require("react/jsx-runtime"),vr=(0,He.cva)("relative flex items-center border-b border-border-subtle gap-1 overflow-x-auto no-scrollbar",{variants:{size:{default:"px-0",compact:"px-2"}},defaultVariants:{size:"default"}}),yr=(0,He.cva)("flex items-center gap-2 px-4 py-2.5 text-sm font-medium outline-none transition-all duration-200 cursor-pointer bg-transparent border-none select-none whitespace-nowrap",{variants:{isActive:{true:"text-primary-500",false:"text-text-muted hover:text-text-main"},isDisabled:{true:"opacity-40 pointer-events-none",false:""}},defaultVariants:{isActive:!1,isDisabled:!1}});function ct({children:e}){let t=typeof e=="string"?(0,B.jsx)(ee,{className:"language-bash",children:(0,B.jsx)("code",{children:e.trim()})}):e;return(0,B.jsx)("div",{className:"py-4",children:t})}function dt({defaultIndex:e=0,children:t}){let r=(0,te.useMemo)(()=>te.Children.toArray(t).filter(l=>(0,te.isValidElement)(l)&&l.props?.label),[t]),{active:o,setActive:n,tabRefs:a,indicatorStyle:c}=lt({initialIndex:e,tabs:r});return(0,B.jsx)("div",{className:"my-8 w-full group/tabs",children:(0,B.jsxs)(Z.Tabs,{selectedKey:o.toString(),onSelectionChange:l=>n(Number(l)),className:"w-full",children:[(0,B.jsxs)(Z.TabList,{"aria-label":"Content Tabs",className:s(vr()),children:[r.map((l,i)=>{let{label:d,icon:p,disabled:m}=l.props,b=i.toString();return(0,B.jsxs)(Z.Tab,{id:b,isDisabled:m,ref:x=>{a.current[i]=x},className:({isSelected:x,isDisabled:P})=>s(yr({isActive:x,isDisabled:P})),children:[!!p&&(0,B.jsx)("span",{className:"shrink-0 [&>svg]:w-4 [&>svg]:h-4",children:p}),(0,B.jsx)("span",{children:d})]},b)}),(0,B.jsx)("div",{className:"absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300 ease-in-out pointer-events-none",style:c,"aria-hidden":"true"})]}),r.map((l,i)=>(0,B.jsx)(Z.TabPanel,{id:i.toString(),children:r[i]},i))]})})}var re=require("react"),ue=require("react/jsx-runtime");function pt({src:e,poster:t,alt:r,children:o,controls:n,preload:a="metadata",...c}){let l=(0,re.useRef)(null),[i,d]=(0,re.useState)(!1);return(0,re.useEffect)(()=>{let p=l.current;if(!p)return;let m=new IntersectionObserver(([b])=>{b.isIntersecting&&(d(!0),m.disconnect())},{rootMargin:"200px"});return m.observe(p),()=>m.disconnect()},[]),(0,ue.jsx)("div",{ref:l,className:"my-6 overflow-hidden rounded-lg border border-border-subtle",children:i?(0,ue.jsxs)("video",{className:"block w-full h-auto",src:e,poster:t,controls:!0,preload:a,playsInline:!0,...c,children:[o,"Your browser does not support the video tag."]}):(0,ue.jsx)("div",{className:"aspect-video bg-bg-surface animate-pulse",role:"img","aria-label":r||"Video"})})}var mt=require("class-variance-authority"),ft=require("react/jsx-runtime"),Cr=(0,mt.cva)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold tracking-tight",{variants:{variant:{default:"bg-bg-surface text-text-muted border-border-subtle",primary:"bg-primary-500/15 text-primary-400 border-primary-500/20",success:"bg-emerald-500/15 text-emerald-400 border-emerald-500/20",warning:"bg-amber-500/15 text-amber-400 border-amber-500/20",danger:"bg-red-500/15 text-red-400 border-red-500/20",info:"bg-sky-500/15 text-sky-400 border-sky-500/20"}},defaultVariants:{variant:"default"}});function ut({variant:e="default",children:t,className:r="",...o}){return(0,ft.jsx)("span",{className:s(Cr({variant:e}),r),...o,children:t})}var fe=require("react"),bt=w(require("react-aria-components"));var xt=require("class-variance-authority"),S=require("react/jsx-runtime"),Nr=(0,xt.cva)("grid gap-4 my-6",{variants:{cols:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"}},defaultVariants:{cols:3}});function gt({cols:e=3,children:t,className:r="",...o}){return(0,S.jsx)("div",{className:s(Nr({cols:e}),r),...o,children:t})}function ht({title:e,icon:t,href:r,children:o,className:n="",...a}){let c=(0,fe.useRef)(null),l=(0,fe.useRef)(null),i=(0,fe.useCallback)(m=>{let b=c.current||l.current;if(!b)return;let{left:x,top:P}=b.getBoundingClientRect();b.style.setProperty("--x",`${m.clientX-x}px`),b.style.setProperty("--y",`${m.clientY-P}px`)},[]),d=(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"pointer-events-none absolute -inset-px rounded-xl opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"radial-gradient(400px circle at var(--x) var(--y), color-mix(in oklch, var(--color-primary-500), transparent 90%), transparent 80%)"}}),t&&(0,S.jsx)("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-primary-500/10 text-primary-400 text-lg transition-transform duration-300 group-hover:scale-105 group-hover:-rotate-3",children:t}),(0,S.jsxs)("div",{className:"space-y-1.5",children:[e&&(0,S.jsx)("h3",{className:"text-sm font-bold text-text-main",children:e}),o&&(0,S.jsx)("div",{className:"text-sm text-text-muted leading-relaxed",children:o})]})]}),p=s("group relative block rounded-xl border border-border-subtle bg-bg-surface p-5 outline-none overflow-hidden","transition-all duration-200 hover:border-primary-500/40 hover:shadow-lg hover:shadow-primary-500/5","focus-visible:ring-2 focus-visible:ring-primary-500/30",n);return r?(0,S.jsx)(bt.Link,{ref:l,href:r,className:s(p,"no-underline cursor-pointer"),onMouseMove:i,...a,children:d}):(0,S.jsx)("div",{ref:c,role:"presentation",className:p,onMouseMove:i,...a,children:d})}var L=require("lucide-react");var yt=require("class-variance-authority"),y=require("react/jsx-runtime"),Rr={note:(0,y.jsx)(L.Bookmark,{size:18}),tip:(0,y.jsx)(L.Lightbulb,{size:18}),info:(0,y.jsx)(L.Info,{size:18}),warning:(0,y.jsx)(L.AlertTriangle,{size:18}),danger:(0,y.jsx)(L.ShieldAlert,{size:18}),important:(0,y.jsx)(L.Flame,{size:18}),caution:(0,y.jsx)(L.Zap,{size:18})},Pr={note:"Note",tip:"Tip",info:"Info",warning:"Warning",danger:"Danger",important:"Important",caution:"Caution"},vt=(0,yt.cva)("py-4 px-4 rounded-lg",{variants:{type:{note:"border-primary-400 bg-primary-500/5 text-primary-400",tip:"border-emerald-500 bg-emerald-500/5 text-emerald-500",info:"border-sky-500 bg-sky-500/5 text-sky-500",warning:"border-amber-500 bg-amber-500/5 text-amber-500",danger:"border-red-500 bg-red-500/5 text-red-500",important:"border-orange-500 bg-orange-500/5 text-orange-500",caution:"border-yellow-500 bg-yellow-500/5 text-yellow-500"}},defaultVariants:{type:"note"}});function U({type:e="note",title:t,children:r,className:o="",...n}){return(0,y.jsxs)("div",{className:s(vt({type:e}),o),role:e==="warning"||e==="danger"?"alert":"note",...n,children:[(0,y.jsxs)("div",{className:"flex items-center flex-row gap-2 mb-2",children:[(0,y.jsx)("span",{className:s("shrink-0",vt({type:e})),children:Rr[e]}),(0,y.jsx)("span",{className:"text-sm font-bold tracking-tight text-text-main",children:t||Pr[e]})]}),(0,y.jsx)("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 [&>p]:mb-2 [&>p:last-child]:mb-0",children:r})]})}var Ct=e=>(0,y.jsx)(U,{type:"note",...e}),Nt=e=>(0,y.jsx)(U,{type:"tip",...e}),Rt=e=>(0,y.jsx)(U,{type:"warning",...e}),Pt=e=>(0,y.jsx)(U,{type:"danger",...e}),wt=e=>(0,y.jsx)(U,{type:"info",...e}),kt=e=>(0,y.jsx)(U,{type:"important",...e}),Tt=e=>(0,y.jsx)(U,{type:"caution",...e});var Te=require("react"),oe=require("lucide-react");var Ae=require("class-variance-authority"),$=require("react/jsx-runtime"),wr=(0,Ae.cva)("my-6 transition-all duration-200",{variants:{variant:{default:"list-disc pl-5 text-text-muted marker:text-primary-500/50",number:"list-decimal pl-5 text-text-muted marker:text-primary-500/50 marker:font-bold",checked:"list-none p-0",arrow:"list-none p-0",bubble:"list-none p-0"},cols:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"},isGrid:{true:"grid gap-x-8 gap-y-3",false:"space-y-2"},dense:{true:"space-y-1",false:"space-y-2"}},compoundVariants:[{variant:"default",dense:!0,className:"space-y-0.5"}],defaultVariants:{variant:"default",cols:1,isGrid:!1,dense:!1}}),kr=(0,Ae.cva)("group flex items-start gap-3 text-sm leading-relaxed transition-all duration-200",{variants:{variant:{default:"",number:"",checked:"hover:translate-x-0.5",arrow:"hover:translate-x-0.5",bubble:"hover:translate-x-0.5"},dense:{true:"py-0",false:"py-0.5"}},defaultVariants:{variant:"default",dense:!1}}),Tr=(0,Ae.cva)("mt-1 shrink-0 flex items-center justify-center transition-transform group-hover:scale-110",{variants:{variant:{bubble:"h-5 w-5 rounded-full bg-primary-500/10 text-primary-500 text-[10px] font-bold",default:""}},defaultVariants:{variant:"default"}});function Ar({icon:e,children:t,variant:r,dense:o}){return(0,$.jsxs)("li",{className:s(kr({variant:r,dense:o})),children:[e&&(0,$.jsx)("span",{className:s(Tr({variant:r==="bubble"?"bubble":"default"})),children:e}),(0,$.jsx)("div",{className:"flex-1 text-text-muted group-hover:text-text-main transition-colors",children:t})]})}var Lr={checked:e=>(0,$.jsx)(oe.Check,{size:14,className:s("text-emerald-500 shrink-0",e)}),arrow:e=>(0,$.jsx)(oe.ChevronRight,{size:14,className:s("text-primary-400 shrink-0",e)}),bubble:e=>(0,$.jsx)(oe.Circle,{size:6,fill:"currentColor",className:s("text-primary-500 shrink-0",e)}),default:()=>null,number:()=>null};function At({variant:e="default",cols:t=1,dense:r=!1,children:o,className:n,...a}){let c=t!==void 0&&Number(t)>1,l=Lr[e],i=wr({variant:e,cols:t,dense:r,isGrid:c,className:n}),d=e==="number"?"ol":"ul";return e==="default"||e==="number"?(0,$.jsx)(d,{className:i,...a,children:o}):(0,$.jsx)("ul",{className:i,...a,children:Te.Children.map(o,p=>{if(!(0,Te.isValidElement)(p))return p;let m=p,b=m.type==="li"?m.props.children:m.props.children||p;return(0,$.jsx)(Ar,{icon:l(),variant:e,dense:r,children:b})})})}var G=require("react"),_=w(require("react-aria-components")),D=require("lucide-react");var C=require("react/jsx-runtime"),be=16,xe=2,Fe={CODE:/\.(ts|tsx|js|jsx|json|mjs|cjs|astro|vue|svelte)$/i,TEXT:/\.(md|mdx|txt)$/i,IMAGE:/\.(png|jpg|jpeg|svg|gif)$/i};function $e(e){return typeof e=="string"?e:typeof e=="number"?e.toString():Array.isArray(e)?e.map($e).join(""):(0,G.isValidElement)(e)&&e.props&&typeof e.props=="object"&&"children"in e.props?$e(e.props.children):""}function Ir(e,t){let r=e.toLowerCase(),o="shrink-0 transition-colors duration-200";if(t)return(0,C.jsx)(D.Folder,{size:be,strokeWidth:xe,className:s(o,"text-primary-400"),fill:"currentColor",fillOpacity:.15});let n=s(o,"text-text-dim group-hover:text-text-main");return Fe.CODE.test(r)?(0,C.jsx)(D.FileCode,{size:be,strokeWidth:xe,className:n}):Fe.TEXT.test(r)?(0,C.jsx)(D.FileText,{size:be,strokeWidth:xe,className:n}):Fe.IMAGE.test(r)?(0,C.jsx)(D.FileImage,{size:be,strokeWidth:xe,className:n}):(0,C.jsx)(D.File,{size:be,strokeWidth:xe,className:n})}function We(e,t){if(!(0,G.isValidElement)(e))return!1;let r=e.type;if(typeof r=="string")return r===t;if(typeof r=="function")return r.name===t||r.name?.toLowerCase()===t;let o=e.props;return o?.originalType===t||o?.mdxType===t}function Br(e){let t=e.match(/\s+(\/\/|#)\s+(.*)$/);return t?{name:e.slice(0,t.index).trim(),comment:t[2]}:{name:e.trim()}}function Le(e,t="root"){if(!(0,G.isValidElement)(e))return[];let r=[];if(We(e,"ul"))return G.Children.forEach(e.props.children,(o,n)=>{r.push(...Le(o,`${t}-${n}`))}),r;if(We(e,"li")){let o=G.Children.toArray(e.props.children),n=o.findIndex(P=>We(P,"ul")),a=n!==-1,c=a?o.slice(0,n):o,l=a?o.slice(n):[],i=$e(c),{name:d,comment:p}=Br(i),m=d.endsWith("/"),b=m?d.slice(0,-1):d,x=a||m;return r.push({id:`${t}-${b}`,name:b,comment:p,isFolder:x,children:a?Le(l[0],`${t}-${b}`):void 0}),r}return e.props&&typeof e.props=="object"&&"children"in e.props&&G.Children.forEach(e.props.children,(o,n)=>{r.push(...Le(o,`${t}-${n}`))}),r}function Lt({item:e}){return(0,C.jsxs)(_.TreeItem,{id:e.id,textValue:e.name,className:"outline-none group focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md",children:[(0,C.jsx)(_.TreeItemContent,{children:({isExpanded:t,hasChildItems:r})=>(0,C.jsxs)("div",{className:"flex items-center gap-2 py-1 px-1.5 rounded-md transition-colors hover:bg-primary-500/5 cursor-pointer",children:[(0,C.jsx)("div",{style:{width:"calc((var(--tree-item-level) - 1) * 1rem)"},className:"shrink-0"}),r?(0,C.jsx)(_.Button,{slot:"chevron",className:"outline-none text-text-dim hover:text-primary-400 p-0.5 rounded transition-colors",children:(0,C.jsx)(D.ChevronRight,{size:14,strokeWidth:3,className:s("transition-transform duration-200",t&&"rotate-90")})}):(0,C.jsx)("div",{className:"w-[18px]"}),Ir(e.name,e.isFolder),(0,C.jsx)("span",{className:s("text-sm transition-colors truncate select-none",e.isFolder?"font-semibold text-text-main":"text-text-muted group-hover:text-text-main"),children:e.name}),e.comment&&(0,C.jsxs)("span",{className:"ml-2 text-xs italic text-text-dim opacity-70 group-hover:opacity-100 transition-opacity whitespace-nowrap overflow-hidden text-ellipsis font-sans",children:["//"," ",e.comment]})]})}),e.children&&(0,C.jsx)(_.Collection,{items:e.children,children:t=>(0,C.jsx)(Lt,{item:t})})]})}function It({children:e}){let t=(0,G.useMemo)(()=>Le(e),[e]);return(0,C.jsx)("div",{className:"my-8",children:(0,C.jsx)(_.Tree,{items:t,"aria-label":"File Tree",className:s("rounded-xl border border-border-subtle bg-bg-surface/50 p-4 font-mono text-sm shadow-sm backdrop-blur-sm outline-none","max-h-[500px] overflow-y-auto scrollbar-thin scrollbar-thumb-border-subtle","focus-visible:ring-2 focus-visible:ring-primary-500/20"),children:r=>(0,C.jsx)(Lt,{item:r})})})}var ge=w(require("react-aria-components"));var ne=require("react");function Bt({data:e,sortable:t=!1,paginated:r=!1,pageSize:o=10}){let[n,a]=(0,ne.useState)(null),[c,l]=(0,ne.useState)(1),i=(0,ne.useMemo)(()=>{if(!e)return[];let b=[...e];return t&&n!==null&&b.sort((x,P)=>{let N=x[n.key],f=P[n.key],H=typeof N=="string"?N:"",X=typeof f=="string"?f:"";return H<X?n.direction==="asc"?-1:1:H>X?n.direction==="asc"?1:-1:0}),b},[e,n,t]),d=Math.ceil(i.length/o),p=(0,ne.useMemo)(()=>{if(!r)return i;let b=(c-1)*o;return i.slice(b,b+o)},[i,r,c,o]);return{sortConfig:n,currentPage:c,setCurrentPage:l,totalPages:d,paginatedData:p,requestSort:b=>{if(!t)return;let x="asc";n&&n.key===b&&n.direction==="asc"&&(x="desc"),a({key:b,direction:x})}}}var M=require("lucide-react");var g=require("react/jsx-runtime");function St({headers:e,data:t,children:r,className:o="",sortable:n=!1,paginated:a=!1,pageSize:c=10}){let{sortConfig:l,currentPage:i,setCurrentPage:d,totalPages:p,paginatedData:m,requestSort:b}=Bt({data:t,sortable:n,paginated:a,pageSize:c}),x=N=>n?l?.key!==N?(0,g.jsx)(M.ChevronDown,{size:14,className:"ml-1 opacity-30"}):l.direction==="asc"?(0,g.jsx)(M.ChevronUp,{size:14,className:"ml-1 text-primary-400"}):(0,g.jsx)(M.ChevronDown,{size:14,className:"ml-1 text-primary-400"}):null,P=r||(0,g.jsxs)(g.Fragment,{children:[e&&(0,g.jsx)("thead",{children:(0,g.jsx)("tr",{children:e.map((N,f)=>(0,g.jsx)("th",{onClick:()=>b(f),className:s("text-left px-3 py-2.5 border-b-2 border-border-subtle text-text-main font-semibold text-sm",n&&"cursor-pointer select-none hover:text-primary-400 transition-colors"),children:(0,g.jsxs)("div",{className:"flex items-center",children:[N,x(f)]})},f))})}),m&&(0,g.jsx)("tbody",{children:m.map((N,f)=>(0,g.jsx)("tr",{className:"transition-colors hover:bg-bg-surface",children:N.map((H,X)=>(0,g.jsx)("td",{className:"px-3 py-2 border-b border-border-subtle text-sm text-text-muted",children:H},X))},f))})]});return(0,g.jsxs)("div",{className:s("my-6 rounded-lg border border-border-subtle overflow-hidden",o),children:[(0,g.jsx)("div",{className:"overflow-x-auto",children:(0,g.jsx)("table",{className:"w-full border-collapse text-sm",children:P})}),a&&p>1&&(0,g.jsxs)("div",{className:"flex items-center justify-between border-t border-border-subtle px-4 py-3",children:[(0,g.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",i," of ",p]}),(0,g.jsxs)("div",{className:"flex items-center gap-1",children:[(0,g.jsx)(ge.Button,{onPress:()=>d(1),isDisabled:i===1,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:(0,g.jsx)(M.ChevronsLeft,{size:16})}),(0,g.jsx)(ge.Button,{onPress:()=>d(N=>Math.max(N-1,1)),isDisabled:i===1,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:(0,g.jsx)(M.ChevronLeft,{size:16})}),(0,g.jsx)(ge.Button,{onPress:()=>d(N=>Math.min(N+1,p)),isDisabled:i===p,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:(0,g.jsx)(M.ChevronRight,{size:16})}),(0,g.jsx)(ge.Button,{onPress:()=>d(p),isDisabled:i===p,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:(0,g.jsx)(M.ChevronsRight,{size:16})})]})]})]})}var E=require("react/jsx-runtime");function Mt({name:e,type:t,defaultValue:r,required:o=!1,children:n,id:a,className:c=""}){return(0,E.jsxs)("article",{className:s("group relative my-6 rounded-xl border border-border-subtle bg-bg-surface p-5 transition-all duration-300","hover:border-primary-500/30 hover:shadow-lg hover:shadow-primary-500/5",c),id:a,children:[(0,E.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,E.jsxs)("div",{className:"flex flex-wrap items-center gap-2.5",children:[(0,E.jsx)("code",{className:"inline-flex items-center rounded-md bg-primary-500/10 px-2.5 py-1 font-mono text-sm font-bold text-primary-400 border border-primary-500/20 shadow-sm transition-colors group-hover:bg-primary-500/15",children:e}),t&&(0,E.jsx)("span",{className:"rounded-md bg-bg-muted/80 border border-border-subtle px-2 py-0.5 text-[11px] font-semibold text-text-muted uppercase tracking-wider shadow-sm",children:t}),o&&(0,E.jsxs)("div",{className:"flex items-center gap-1.5 rounded-full bg-red-500/10 px-2.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-red-400 border border-red-500/20 shadow-sm",children:[(0,E.jsx)("span",{className:"h-1 w-1 rounded-full bg-red-400 animate-pulse"}),"Required"]})]}),r&&(0,E.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-text-muted bg-bg-muted/30 px-2.5 py-1 rounded-md border border-border-subtle/50",children:[(0,E.jsx)("span",{className:"font-semibold opacity-60 uppercase tracking-tighter",children:"Default"}),(0,E.jsx)("code",{className:"font-mono text-text-main font-medium",children:r})]})]}),(0,E.jsx)("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 selection:bg-primary-500/30",children:n})]})}var _e=w(require("react")),Dt=require("react-aria-components"),zt=require("react-router-dom");var Ot=require("react-router-dom");var se=require("react"),Mr=require("react/jsx-runtime"),Sr=(0,se.createContext)({preload:()=>{},routes:[]});function Ie(){return(0,se.use)(Sr)}var Et=require("zustand"),Be=require("zustand/middleware"),Se=(0,Et.create)()((0,Be.persist)(e=>({currentLocale:void 0,currentVersion:void 0,hasHydrated:!1,setLocale:t=>e({currentLocale:t}),setVersion:t=>e({currentVersion:t}),setHasHydrated:t=>e({hasHydrated:t})}),{name:"boltdocs-storage",storage:(0,Be.createJSONStorage)(()=>localStorage),partialize:e=>({currentLocale:e.currentLocale,currentVersion:e.currentVersion}),onRehydrateStorage:()=>e=>{e?.setHasHydrated(!0)}}));function Vt(){let{routes:e}=Ie(),t=K(),r=(0,Ot.useLocation)(),o=Se(f=>f.currentLocale),n=Se(f=>f.currentVersion),a=Se(f=>f.hasHydrated),c=e.find(f=>f.path===r.pathname),l=t.i18n?c?.locale||(a?o:void 0)||t.i18n.defaultLocale:void 0,i=t.versions?c?.version||(a?n:void 0)||t.versions.defaultVersion:void 0,d=e.filter(f=>{let H=t.i18n?(f.locale||t.i18n.defaultLocale)===l:!0,X=t.versions?(f.version||t.versions.defaultVersion)===i:!0;if(!(H&&X))return!1;let Ve=t.i18n;if(Ve){let sr=!!c?.locale,ar=!!f.locale;if(e.some(ye=>ye!==f&&ye.filePath===f.filePath&&ye.version===f.version&&(ye.locale||Ve.defaultLocale)===(f.locale||Ve.defaultLocale))&&sr!==ar)return!1}return!0}),m=t.i18n?.localeConfigs?.[l]?.label||t.i18n?.locales[l]||l,x=t.versions?.versions.find(f=>f.path===i)?.label||i,P=t.i18n?Object.entries(t.i18n.locales).map(([f,H])=>{let X=t.i18n?.localeConfigs?.[f];return{key:f,label:X?.label||H,isCurrent:f===l}}):[],N=t.versions?t.versions.versions.map(f=>({key:f.path,label:f.label,isCurrent:f.path===i})):[];return{routes:d,allRoutes:e,currentRoute:c,currentLocale:l,currentLocaleLabel:m,availableLocales:P,currentVersion:i,currentVersionLabel:x,availableVersions:N,config:t}}function Ge(e){let t=K(),{currentLocale:r,currentVersion:o}=Vt();if(!t||typeof e!="string"||e.startsWith("http")||e.startsWith("//"))return e;let n=t.i18n,a=t.versions;if(!n&&!a)return e;let c=e.startsWith("/docs"),l=e.split("/").filter(Boolean),i=0;l[i]==="docs"&&i++,a&&l.length>i&&a.versions.find(x=>x.path===l[i])&&i++,n&&l.length>i&&n.locales[l[i]]&&i++;let d=l.slice(i),p=[];c&&(p.push("docs"),a&&o&&p.push(o)),n&&r&&r!==n.defaultLocale&&p.push(r),p.push(...d);let m=`/${p.join("/")}`;return m.length>1&&m.endsWith("/")?m.slice(0,-1):m||"/"}var je=require("react/jsx-runtime"),ae=_e.default.forwardRef((e,t)=>{let{href:r,prefetch:o="hover",onMouseEnter:n,onFocus:a,...c}=e,l=Ge(r??""),{preload:i}=Ie();return(0,je.jsx)(Dt.Link,{...c,ref:t,href:l,onMouseEnter:m=>{n?.(m),o==="hover"&&typeof l=="string"&&l.startsWith("/")&&i(l)},onFocus:m=>{a?.(m),o==="hover"&&typeof l=="string"&&l.startsWith("/")&&i(l)}})});ae.displayName="Link";var Er=_e.default.forwardRef((e,t)=>{let{href:r,end:o=!1,className:n,children:a,...c}=e,l=(0,zt.useLocation)(),i=Ge(r??""),d=o?l.pathname===i:l.pathname.startsWith(i),p=typeof n=="function"?n({isActive:d}):s(n,d&&"active"),m=typeof a=="function"?a({isActive:d}):a;return(0,je.jsx)(ae,{...c,ref:t,href:r,className:p,children:m})});Er.displayName="NavLink";var Ft=require("react/jsx-runtime");function Ht({to:e,children:t,className:r="",...o}){let n=e&&(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")),a=s("text-blue-600 hover:text-blue-800 hover:underline cursor-pointer",r);return(0,Ft.jsx)(ae,{href:e,className:a,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,...o,children:t})}var ie=require("react"),Vr=require("react/jsx-runtime"),Or=(0,ie.createContext)(void 0);function Wt(){let e=(0,ie.use)(Or);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}var Gt=require("react/jsx-runtime");function $t({src:e,alt:t,theme:r,...o}){let{theme:n}=Wt();return r&&r!==n?null:(0,Gt.jsx)("img",{src:e,alt:t||"",...o})}var v=require("react/jsx-runtime");function _t({title:e,props:t,className:r=""}){return(0,v.jsxs)("div",{className:s("my-6",r),children:[e&&(0,v.jsx)("h3",{className:"text-base font-bold text-text-main mb-3",children:e}),(0,v.jsx)("div",{className:"overflow-x-auto rounded-lg border border-border-subtle",children:(0,v.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,v.jsx)("thead",{children:(0,v.jsxs)("tr",{children:[(0,v.jsx)("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Property"}),(0,v.jsx)("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Type"}),(0,v.jsx)("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Default"}),(0,v.jsx)("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Description"})]})}),(0,v.jsx)("tbody",{children:t.map((o,n)=>(0,v.jsxs)("tr",{className:"transition-colors hover:bg-bg-surface",children:[(0,v.jsxs)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:[(0,v.jsx)("code",{className:"rounded bg-bg-surface px-1.5 py-0.5 font-mono text-xs font-bold text-primary-400",children:o.name}),o.required&&(0,v.jsx)("span",{className:"ml-1 text-red-400 font-bold",children:"*"})]}),(0,v.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:(0,v.jsx)("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-text-muted",children:o.type})}),(0,v.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:o.defaultValue?(0,v.jsx)("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-primary-400",children:o.defaultValue}):(0,v.jsx)("span",{className:"text-text-dim",children:"\u2014"})}),(0,v.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle text-text-muted",children:o.description})]},`${o.name}-${n}`))})]})})]})}var Ue=require("react");function jt(e){let{code:t,children:r,preview:o}=e,n=(0,Ue.useMemo)(()=>(t??(typeof r=="string"?r:"")).trim(),[t,r]),a=(0,Ue.useMemo)(()=>o??(typeof r!="string"?r:null),[o,r]);return{initialCode:n,previewElement:a}}var le=require("react/jsx-runtime");function Ut(e){let{highlightedHtml:t,hideCode:r=!1,hideSandbox:o=!1,hideCopy:n=!1,sandboxOptions:a={}}=e,{initialCode:c,previewElement:l}=jt(e);return(0,le.jsxs)("div",{className:"my-6 overflow-hidden rounded-xl border border-border-subtle",children:[(0,le.jsx)("div",{className:"flex items-center justify-center p-8 bg-bg-surface",children:l}),!r&&(0,le.jsx)("div",{className:"border-t border-border-subtle",children:(0,le.jsx)(ee,{hideSandbox:o,hideCopy:n,title:a.title,lang:"tsx",highlightedHtml:t,children:c})})]})}var or=require("react"),q=require("lucide-react");var qt=require("react");var Dr=require("react-aria-components"),he=require("lucide-react");var Xt=require("react/jsx-runtime");var ve=w(require("react-aria-components")),zr=require("lucide-react");var Ke=require("react/jsx-runtime");var k=w(require("react-aria-components")),J=require("lucide-react");var h=require("react/jsx-runtime"),Hr=({children:e,isOpen:t,onOpenChange:r,className:o})=>(0,h.jsx)(k.ModalOverlay,{isOpen:t,onOpenChange:r,isDismissable:!0,className:s("fixed inset-0 z-100 bg-black/40 backdrop-blur-sm px-4 py-4 sm:py-20","entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out"),children:(0,h.jsx)(k.Modal,{className:s("mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl ring-1 ring-black/5 outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95",o),children:(0,h.jsx)(k.Dialog,{className:"flex flex-col max-h-[70vh] focus:outline-none",children:e})})}),Fr=({children:e,className:t,onSelectionChange:r,...o})=>(0,h.jsx)("div",{className:t,children:(0,h.jsx)(k.Autocomplete,{...o,onSelectionChange:r,className:"flex flex-col min-h-0",children:e})}),Wr=({className:e,...t})=>(0,h.jsxs)(k.SearchField,{className:"flex items-center gap-3 border-b border-border-subtle px-4 py-4",autoFocus:!0,children:[(0,h.jsx)(J.Search,{className:"h-5 w-5 text-text-muted"}),(0,h.jsx)(k.Input,{...t,className:s("w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none",e),placeholder:"Search documentation..."}),(0,h.jsx)("div",{className:"flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-main px-1.5 py-1 text-[10px] font-medium text-text-muted",children:(0,h.jsx)("kbd",{className:"font-sans",children:"ESC"})})]}),$r=({children:e,className:t,...r})=>(0,h.jsx)(k.ListBox,{...r,className:s("flex-1 overflow-y-auto p-2 outline-none",t),children:e}),Gr=({children:e,className:t,...r})=>(0,h.jsx)(k.ListBoxItem,{...r,className:s("group flex items-center gap-3 rounded-lg p-3 text-left outline-none cursor-pointer transition-colors","text-text-muted hover:bg-bg-main hover:text-text-main focus:bg-primary-500 focus:text-white selected:bg-primary-500 selected:text-white",t),children:o=>(0,h.jsxs)(h.Fragment,{children:[e,(o.isFocused||o.isSelected)&&(0,h.jsxs)("div",{className:"ml-auto opacity-50 flex items-center gap-1",children:[(0,h.jsx)("span",{className:"text-[10px]",children:"Select"}),(0,h.jsx)(J.CornerDownLeft,{size:10})]})]})}),_r=({isHeading:e,className:t})=>(0,h.jsx)("div",{className:s("shrink-0",t),children:e?(0,h.jsx)(J.Hash,{size:18}):(0,h.jsx)(J.FileText,{size:18})}),jr=({children:e,className:t})=>(0,h.jsx)("span",{className:s("block font-medium truncate flex-1 text-sm",t),children:e}),Ur=({children:e,className:t})=>(0,h.jsx)("span",{className:s("ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100",t),children:e}),bs={Root:Hr,Autocomplete:Fr,Input:Wr,List:$r,Item:Object.assign(Gr,{Icon:_r,Title:jr,Bio:Ur})};var O=require("react"),qr=w(require("scroll-into-view-if-needed"));var Kt=require("react");var Zt=require("react/jsx-runtime"),As=(0,O.createContext)(null),Ls=(0,O.createContext)(null);function Xr(e){let[t,r]=(0,O.useState)({isOverflowing:!1,isAtBottom:!1});return(0,O.useEffect)(()=>{let o=e.current;if(!o)return;let n=()=>{let c=o.scrollHeight>o.clientHeight,l=o.scrollHeight-o.scrollTop<=o.clientHeight+2;r({isOverflowing:c,isAtBottom:l})};n(),o.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n);let a=new MutationObserver(n);return a.observe(o,{childList:!0,subtree:!0}),()=>{o.removeEventListener("scroll",n),window.removeEventListener("resize",n),a.disconnect()}},[e]),t}var Kr=({children:e,className:t,ref:r,...o})=>{let n=(0,O.useRef)(null);(0,O.useImperativeHandle)(r,()=>n.current);let{isOverflowing:a,isAtBottom:c}=Xr(n);return(0,Zt.jsx)("div",{ref:n,className:s("relative overflow-y-auto boltdocs-otp-content",a&&!c&&"mask-[linear-gradient(to_bottom,black_85%,transparent_100%)]",t),...o,children:e})};Kr.displayName="OnThisPageContent";var Jt=w(require("react-aria-components")),Oe=require("lucide-react");var z=require("react/jsx-runtime"),Zr=({children:e,className:t})=>(0,z.jsx)("nav",{className:s("grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle",t),children:e}),Jr=({children:e,to:t,direction:r,className:o})=>{let n=r==="next";return(0,z.jsxs)(Jt.Link,{href:t,className:s("flex group items-center p-4 rounded-xl border border-border-subtle bg-bg-surface outline-none","transition-all hover:bg-bg-main hover:border-primary-500 hover:shadow-lg","focus-visible:ring-2 focus-visible:ring-primary-500/30",n?"text-right justify-end":"text-left justify-start",o),children:[!n&&(0,z.jsx)(Oe.ChevronLeft,{className:"mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1"}),(0,z.jsx)("div",{className:"flex flex-col gap-1 flex-1",children:e}),n&&(0,z.jsx)(Oe.ChevronRight,{className:"ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1"})]})},Qr=({children:e,className:t})=>(0,z.jsx)("span",{className:s("text-xs font-medium uppercase tracking-wider text-text-muted",t),children:e}),Yr=({children:e,className:t})=>(0,z.jsx)("span",{className:s("text-base font-bold text-text-main truncate",t),children:e}),eo=({children:e})=>(0,z.jsx)(z.Fragment,{children:e}),Ms={PageNavRoot:Zr,PageNavLink:Object.assign(Jr,{Title:Qr,Description:Yr,Icon:eo})};var to=require("react/jsx-runtime");var ro=w(require("react-aria-components")),oo=require("lucide-react");var Qt=require("react/jsx-runtime");var Ze=require("react-aria-components"),no=require("lucide-react");var so=require("react/jsx-runtime");var er=require("react/jsx-runtime"),Yt=({children:e,className:t,vertical:r=!1})=>(0,er.jsx)("div",{className:s("inline-flex",r?"flex-col":"flex-row",!r&&["[&>*:not(:first-child)]:-ml-px","[&>*:first-child]:rounded-r-none","[&>*:last-child]:rounded-l-none","[&>*:not(:first-child):not(:last-child)]:rounded-none",t?.includes("rounded-full")&&["[&>*:first-child]:rounded-l-full","[&>*:last-child]:rounded-r-full"],t?.includes("rounded-xl")&&["[&>*:first-child]:rounded-l-xl","[&>*:last-child]:rounded-r-xl"],t?.includes("rounded-lg")&&["[&>*:first-child]:rounded-l-lg","[&>*:last-child]:rounded-r-lg"]],r&&["[&>*:not(:first-child)]:-mt-px","[&>*:first-child]:rounded-b-none","[&>*:last-child]:rounded-t-none","[&>*:not(:first-child):not(:last-child)]:rounded-none",t?.includes("rounded-full")&&["[&>*:first-child]:rounded-t-full","[&>*:last-child]:rounded-b-full"]],t),children:e});var pe=require("lucide-react"),rr=w(require("react")),A=w(require("react-aria-components"));var de=w(require("react-aria-components"));var ce=require("react/jsx-runtime"),tr=({children:e,className:t,showArrow:r,...o})=>(0,ce.jsxs)(de.Popover,{offset:8,...o,className:de.composeRenderProps(t,n=>s("z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95 fill-mode-forwards",n)),children:[r&&(0,ce.jsx)(de.OverlayArrow,{className:"group",children:(0,ce.jsx)("svg",{viewBox:"0 0 12 12",className:"block h-3 w-3 fill-bg-surface/80 stroke-border-subtle group-placement-bottom:rotate-180 group-placement-left:-rotate-90 group-placement-right:rotate-90","aria-hidden":"true",children:(0,ce.jsx)("path",{d:"M0 0 L6 6 L12 0"})})}),e]});var I=require("react/jsx-runtime");function qe(e){let[t,r]=rr.default.Children.toArray(e.children).slice(0,2);return(0,I.jsxs)(A.MenuTrigger,{...e,children:[t,(0,I.jsx)(tr,{placement:e.placement,className:"min-w-[200px]",children:r})]})}function Xe(e){return(0,I.jsx)(A.Menu,{...e,className:A.composeRenderProps(e.className,t=>s("p-1.5 outline-none max-h-[inherit] overflow-auto",t))})}function Me(e){let t=e.textValue||(typeof e.children=="string"?e.children:void 0);return(0,I.jsx)(A.MenuItem,{...e,textValue:t,className:A.composeRenderProps(e.className,(r,{isFocused:o,isPressed:n,isDisabled:a})=>s("group relative flex flex-row items-center gap-2.5 px-3 py-1.5 rounded-lg outline-none cursor-default transition-all duration-200","text-text-main text-[0.8125rem]",o&&"bg-primary-500/10 text-primary-600 shadow-sm",n&&"scale-[0.98] bg-primary-500/15",a&&"opacity-40 grayscale pointer-events-none",r)),children:A.composeRenderProps(e.children,(r,{selectionMode:o,isSelected:n,hasSubmenu:a})=>(0,I.jsxs)(I.Fragment,{children:[o!=="none"&&(0,I.jsxs)("span",{className:"flex items-center w-4 h-4 shrink-0 justify-center",children:[n&&o==="multiple"&&(0,I.jsx)(pe.Check,{className:"w-3.5 h-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200"}),n&&o==="single"&&(0,I.jsx)(pe.Dot,{className:"w-6 h-6 text-primary-500 animate-in zoom-in-50 duration-200"})]}),(0,I.jsx)("div",{className:"flex-1 flex flex-row items-center gap-2.5 truncate font-medium",children:r}),a&&(0,I.jsx)(pe.ChevronRight,{className:"w-4 h-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors"})]}))})}var Ee=require("react-aria-components");var R=require("react/jsx-runtime"),ao=e=>{let[t,r]=(0,or.useState)(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)},handleOpenRaw:()=>{let a=new Blob([e],{type:"text/plain;charset=utf-8"}),c=URL.createObjectURL(a);window.open(c,"_blank")}}};function nr({content:e,mdxRaw:t,config:r}){let o=t||e||"",{copied:n,handleCopy:a,handleOpenRaw:c}=ao(o),l=r!==!1,i=typeof r=="object"&&r.text||"Copy Markdown";return!l||!o?null:(0,R.jsx)("div",{className:"relative inline-flex z-100 flex-shrink-0 w-max translate-y-0 active:translate-y-px transition-transform duration-200",children:(0,R.jsxs)(Yt,{className:"rounded-xl border border-border-subtle bg-bg-surface/40 backdrop-blur-md transition-all duration-300 hover:border-primary-500/50 hover:shadow-lg hover:shadow-primary-500/5 group overflow-hidden",children:[(0,R.jsx)(Q,{variant:"ghost",onPress:a,icon:n?(0,R.jsx)(q.Check,{size:16}):(0,R.jsx)(q.Copy,{size:16}),iconPosition:"left",className:s("px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 border-none shrink-0","text-text-main transition-all duration-300 hover:bg-primary-500/5",n&&"text-emerald-500 hover:bg-emerald-500/5"),children:n?"Copied!":i}),(0,R.jsxs)(qe,{placement:"bottom end",children:[(0,R.jsx)(Q,{variant:"ghost",isIconOnly:!0,icon:(0,R.jsx)(q.ChevronDown,{size:14}),className:s("px-3.5 h-9 border-l border-border-subtle/50 text-text-muted rounded-none bg-transparent shrink-0","transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500")}),(0,R.jsxs)(Xe,{className:"w-52",children:[(0,R.jsxs)(Me,{onAction:a,className:"flex flex-row items-start gap-2.5 group",children:[(0,R.jsx)(q.Copy,{size:16,className:"w-4 h-4 shrink-0 mt-0.5 transition-transform duration-200 group-hover:-translate-y-0.5 text-text-muted group-hover:text-primary-500"}),(0,R.jsx)("span",{className:"font-medium text-[0.8125rem]",children:"Copy Markdown"})]}),(0,R.jsxs)(Me,{onAction:c,className:"flex flex-row items-start gap-2.5 group",children:[(0,R.jsx)(q.ExternalLink,{size:16,className:"w-4 h-4 shrink-0 mt-0.5 transition-transform duration-200 group-hover:-translate-y-0.5 text-text-muted group-hover:text-primary-500"}),(0,R.jsx)("span",{className:"font-medium text-[0.8125rem]",children:"View as Markdown"})]})]})]})]})})}
|
|
1
|
+
"use strict";var ir=Object.create;var Ce=Object.defineProperty;var lr=Object.getOwnPropertyDescriptor;var cr=Object.getOwnPropertyNames;var dr=Object.getPrototypeOf,mr=Object.prototype.hasOwnProperty;var pr=(e,t)=>{for(var r in t)Ce(e,r,{get:t[r],enumerable:!0})},Je=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of cr(t))!mr.call(e,n)&&n!==r&&Ce(e,n,{get:()=>t[n],enumerable:!(o=lr(t,n))||o.enumerable});return e};var w=(e,t,r)=>(r=e!=null?ir(dr(e)):{},Je(t||!e||!e.__esModule?Ce(r,"default",{value:e,enumerable:!0}):r,e)),ur=e=>Je(Ce({},"__esModule",{value:!0}),e);var io={};pr(io,{Admonition:()=>U,Badge:()=>ut,Button:()=>tt,Card:()=>ht,Cards:()=>gt,Caution:()=>Tt,CodeBlock:()=>ee,ComponentPreview:()=>Ut,ComponentProps:()=>_t,CopyMarkdown:()=>nr,Danger:()=>Pt,Field:()=>Mt,FileTree:()=>It,Image:()=>$t,Important:()=>kt,InfoBox:()=>wt,Link:()=>Ht,List:()=>At,Note:()=>Ct,Tab:()=>ct,Table:()=>St,Tabs:()=>dt,Tip:()=>Nt,Video:()=>mt,Warning:()=>Rt});module.exports=ur(io);var Re=w(require("react-aria-components"));var Qe=require("clsx"),Ye=require("tailwind-merge");function s(...e){return(0,Ye.twMerge)((0,Qe.clsx)(e))}var et=require("class-variance-authority"),F=require("react/jsx-runtime"),Ne=(0,et.cva)("flex flex-row items-center justify-center w-auto font-semibold tracking-tight no-underline whitespace-nowrap select-none outline-none transition-all duration-200 cursor-pointer pressed:scale-[0.97] hover:-translate-y-px leading-none",{variants:{variant:{primary:"bg-primary-500 text-white shadow-md hover:brightness-110 hover:shadow-lg",secondary:"bg-bg-surface text-text-main border border-border-subtle hover:bg-bg-muted hover:border-border-strong",outline:"bg-transparent text-text-main border border-border-strong hover:bg-bg-surface hover:border-primary-500",ghost:"bg-transparent text-text-muted hover:bg-bg-surface hover:text-text-main",danger:"bg-[var(--color-danger-500)]/10 text-[var(--color-danger-500)] border border-[var(--color-danger-500)]/20 hover:bg-[var(--color-danger-500)]/15",success:"bg-[var(--color-success-500)]/10 text-[var(--color-success-500)] border border-[var(--color-success-500)]/20 hover:bg-[var(--color-success-500)]/15",warning:"bg-[var(--color-warning-500)]/10 text-[var(--color-warning-500)] border border-[var(--color-warning-500)]/20 hover:bg-[var(--color-warning-500)]/15",info:"bg-[var(--color-info-500)]/10 text-[var(--color-info-500)] border border-[var(--color-info-500)]/20 hover:bg-[var(--color-info-500)]/15",subtle:"bg-primary-500/10 text-primary-500 hover:bg-primary-500/20",link:"bg-transparent text-primary-500 !p-0 !min-h-0 hover:underline"},size:{sm:"min-h-8 px-3.5 text-[0.8125rem] gap-1.5",md:"min-h-10 px-5 text-[0.9375rem] gap-2",lg:"min-h-12 px-7 text-[1.05rem] gap-2.5"},rounded:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},iconSize:{sm:"w-8 h-8 p-0",md:"w-10 h-10 p-0",lg:"w-12 h-12 p-0"},disabled:{true:"opacity-50 cursor-not-allowed pointer-events-none",false:null}},defaultVariants:{variant:"primary",size:"md",rounded:"md"}}),Q=({href:e,icon:t,iconPosition:r="left",isIconOnly:o,children:n,className:a,variant:c,size:l,rounded:i,iconSize:d,disabled:m,...p})=>{let b=o||!n&&!!t,x=b?(0,F.jsx)("span",{className:"inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]",children:t}):(0,F.jsxs)(F.Fragment,{children:[t&&r==="left"&&(0,F.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t}),(0,F.jsx)("span",{className:"flex items-center",children:n}),t&&r==="right"&&(0,F.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t})]});return e?(0,F.jsx)(Re.Link,{href:e,className:s(Ne({variant:c,size:l,rounded:i,iconSize:b?d:void 0,disabled:m}),a),...p,children:x}):(0,F.jsx)(Re.Button,{className:s(Ne({variant:c,size:l,rounded:i,iconSize:b?d:void 0,disabled:m}),a),...p,children:x})};var rt=require("react/jsx-runtime"),tt=({className:e,variant:t,size:r,rounded:o,iconSize:n,disabled:a,...c})=>(0,rt.jsx)(Q,{className:s("group",Ne({variant:t,size:r,rounded:o,iconSize:n,disabled:a,className:e})),...c});var we=w(require("react-aria-components")),ke=require("lucide-react");var Pe=require("react"),fr=(0,Pe.createContext)(null);function K(){let e=(0,Pe.use)(fr);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e}var De=require("codesandbox/lib/api/define.js");function ot(e){let t=e.files||{},r=e.dependencies||{},o=e.devDependencies||{},n=e.title||"codesandbox-project",a=e.description||"Generic Sandbox",c={};for(let[l,i]of Object.entries(t)){let d=typeof i.content=="object"?JSON.stringify(i.content,null,2):i.content;c[l]={content:d,isBinary:i.isBinary??!1}}if(!c["package.json"]){let i=e.template==="vite"||!!o.vite||!!o["@vitejs/plugin-react"]?{dev:"vite",build:"vite build",preview:"vite preview"}:{start:"node index.js"};c["package.json"]={content:JSON.stringify({private:!0,name:n,description:a,type:"module",version:"1.0.0",scripts:e.scripts||i,dependencies:r,devDependencies:o},null,2),isBinary:!1}}return c}function br(e){let t=ot(e),r=(0,De.getParameters)({files:t}),o=new URLSearchParams({parameters:r,installDependencies:"true"});return e.entry&&o.set("file",`/${e.entry}`),{parameters:r,url:`https://codesandbox.io/api/v1/sandboxes/define?${o.toString()}`,options:e}}function nt(e){if(typeof window>"u")return br(e);let t=ot(e),r=(0,De.getParameters)({files:t}),o=e.entry||"src/App.tsx",n=document.createElement("form");n.method="POST",n.target="_blank",n.action="https://codesandbox.io/api/v1/sandboxes/define",n.style.display="none";let a=(l,i)=>{let d=document.createElement("input");d.type="hidden",d.name=l,d.value=i,n.appendChild(d)},c=new URLSearchParams({file:`/${o}`,eslint:"0",codemirror:"1",installDependencies:"true"});return a("query",c.toString()),a("parameters",r),document.body.appendChild(n),n.submit(),document.body.removeChild(n),{parameters:r,url:`https://codesandbox.io/api/v1/sandboxes/define?parameters=${r}`,options:e}}var st=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement("textarea");return t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),!0}};var W=require("react");function at(e){let{title:t,sandbox:r}=e,[o,n]=(0,W.useState)(!1),[a,c]=(0,W.useState)(!1),[l,i]=(0,W.useState)(!1),d=(0,W.useRef)(null),m=K(),p=(0,W.useCallback)(async()=>{let x=d.current?.textContent??"";st(x),n(!0),setTimeout(()=>n(!1),2e3)},[]),b=(0,W.useCallback)(()=>{let x=d.current?.textContent??"",P=m?.integrations?.sandbox?.config||{},N=typeof r=="object"?r:P,f=N.entry||"src/App.tsx";nt({title:t??"Code Snippet",...N,files:{...N.files,[f]:{content:x}}})},[t,m,r]);return(0,W.useEffect)(()=>{let x=d.current?.textContent?.length??0;i(x>120)},[e.children,e.highlightedHtml]),{copied:o,isExpanded:a,setIsExpanded:c,isExpandable:l,preRef:d,handleCopy:p,handleSandbox:b,shouldTruncate:l&&!a}}var pe=require("react/jsx-runtime");function xr(e){let{size:t=20,...r}=e;return{...r,width:t,height:t}}var it=e=>(0,pe.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...xr(e),children:[(0,pe.jsx)("title",{children:"CodeSandbox"}),(0,pe.jsx)("path",{d:"M0 24h24V0H0v2.455h21.546v19.09H2.454V0H0Z"})]});var Y=w(require("react-aria-components"));var V=require("react/jsx-runtime"),hr=({className:e,children:t,...r})=>(0,V.jsx)(Y.Tooltip,{...r,offset:8,className:o=>s("group z-50 overflow-visible rounded-md bg-bg-surface/90 px-2.5 py-1.5 text-xs font-medium text-text-main shadow-lg backdrop-blur-md ring-1 ring-border-subtle outline-hidden select-none","data-entering:animate-in data-entering:fade-in data-entering:zoom-in-95 data-entering:duration-100","data-exiting:animate-out data-exiting:fade-out data-exiting:zoom-out-95 data-exiting:duration-75","data-[placement=top]:slide-in-from-bottom-1","data-[placement=bottom]:slide-in-from-top-1","data-[placement=left]:slide-in-from-right-1","data-[placement=right]:slide-in-from-left-1",typeof e=="function"?e(o):e),children:o=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Y.OverlayArrow,{children:(0,V.jsxs)("svg",{width:8,height:8,viewBox:"0 0 8 8",className:"fill-bg-surface/90 stroke-border-subtle group-data-[placement=bottom]:rotate-180 group-data-[placement=left]:-rotate-90 group-data-[placement=right]:rotate-90",children:[(0,V.jsx)("title",{children:"Arrow"}),(0,V.jsx)("path",{d:"M0 0 L4 4 L8 0"})]})}),typeof t=="function"?t(o):t]})}),ze=({content:e,children:t,delay:r=500,closeDelay:o=0,...n})=>(0,V.jsxs)(Y.TooltipTrigger,{delay:r,closeDelay:o,children:[t,(0,V.jsx)(hr,{...n,children:e})]});var T=require("react/jsx-runtime");function ee(e){let{children:t,sandbox:r,hideSandbox:o=!0,hideCopy:n=!1,highlightedHtml:a,...c}=e,d=!!K()?.integrations?.sandbox?.enable&&!o,{copied:m,isExpanded:p,setIsExpanded:b,isExpandable:x,preRef:P,handleCopy:N,handleSandbox:f,shouldTruncate:H}=at(e);return(0,T.jsxs)("div",{className:s("group relative my-6 overflow-hidden rounded-lg border border-border-subtle bg-(--color-code-bg)",H&&"[&>pre]:max-h-[250px] [&>pre]:overflow-hidden"),children:[(0,T.jsxs)("div",{className:"absolute top-3 right-4 z-50 flex items-center gap-2 transition-all duration-300 opacity-0 group-hover:opacity-100",children:[d&&(0,T.jsx)(ze,{content:"Open in CodeSandbox",children:(0,T.jsx)(we.Button,{onPress:f,className:"grid place-items-center w-8 h-8 bg-transparent text-text-muted outline-none cursor-pointer transition-all duration-200 hover:scale-115 hover:text-sky-400 active:scale-95 [&>svg]:w-5 [&>svg]:h-5 [&>svg]:stroke-2","aria-label":"Open in CodeSandbox",children:(0,T.jsx)(it,{size:20})})}),!n&&(0,T.jsx)(ze,{content:m?"Copied!":"Copy code",children:(0,T.jsx)(we.Button,{onPress:N,className:s("grid place-items-center w-8 h-8 bg-transparent outline-none cursor-pointer transition-all duration-200 hover:scale-115 active:scale-95 [&>svg]:w-5 [&>svg]:h-5 [&>svg]:stroke-2",m?"text-emerald-400":"text-text-muted hover:text-text-main"),"aria-label":"Copy code",children:m?(0,T.jsx)(ke.Check,{size:20}):(0,T.jsx)(ke.Copy,{size:20})})})]}),a?(0,T.jsx)("div",{ref:P,className:"shiki-wrapper [&>pre]:m-0! [&>pre]:rounded-none! [&>pre]:border-none! [&>pre]:bg-inherit! [&>pre>code]:grid! [&>pre>code]:p-5! [&>.shiki.shiki-themes]:bg-transparent!",dangerouslySetInnerHTML:{__html:a}}):(0,T.jsx)("pre",{ref:P,className:"m-0! rounded-none! border-none! bg-inherit! font-mono text-[0.8125rem] leading-[1.7]",...c,children:t}),x&&(0,T.jsx)("div",{className:s(H?"absolute bottom-0 inset-x-0 h-24 bg-linear-to-t from-(--color-code-bg) to-transparent flex items-end justify-center pb-4 z-10":"relative flex justify-center py-4"),children:(0,T.jsx)(we.Button,{onPress:()=>b(!p),className:"rounded-full bg-bg-surface border border-border-subtle px-5 py-2 text-[0.8125rem] font-medium text-text-main outline-none cursor-pointer transition-all hover:bg-border-subtle hover:-translate-y-px backdrop-blur-md",children:p?"Show less":"Expand code"})})]})}var te=require("react"),Z=w(require("react-aria-components"));var j=require("react");function lt({initialIndex:e=0,tabs:t}){let r=t[e]?.props.disabled?t.findIndex(d=>!d.props.disabled):e,[o,n]=(0,j.useState)(r===-1?0:r),a=(0,j.useRef)([]),[c,l]=(0,j.useState)({opacity:0,transform:"translateX(0)",width:0});(0,j.useEffect)(()=>{let d=a.current[o];d&&l({opacity:1,width:d.offsetWidth,transform:`translateX(${d.offsetLeft}px)`})},[o,t]);let i=(0,j.useCallback)(d=>{let m=0;if(d.key==="ArrowRight"?m=1:d.key==="ArrowLeft"&&(m=-1),m!==0){let p=(o+m+t.length)%t.length;for(;t[p].props.disabled&&p!==o;)p=(p+m+t.length)%t.length;p!==o&&!t[p].props.disabled&&(n(p),a.current[p]?.focus())}},[o,t]);return{active:o,setActive:n,tabRefs:a,indicatorStyle:c,handleKeyDown:i}}var He=require("class-variance-authority"),B=require("react/jsx-runtime"),vr=(0,He.cva)("relative flex items-center border-b border-border-subtle gap-1 overflow-x-auto no-scrollbar",{variants:{size:{default:"px-0",compact:"px-2"}},defaultVariants:{size:"default"}}),yr=(0,He.cva)("flex items-center gap-2 px-4 py-2.5 text-sm font-medium outline-none transition-all duration-200 cursor-pointer bg-transparent border-none select-none whitespace-nowrap",{variants:{isActive:{true:"text-primary-500",false:"text-text-muted hover:text-text-main"},isDisabled:{true:"opacity-40 pointer-events-none",false:""}},defaultVariants:{isActive:!1,isDisabled:!1}});function ct({children:e}){let t=typeof e=="string"?(0,B.jsx)(ee,{className:"language-bash",children:(0,B.jsx)("code",{children:e.trim()})}):e;return(0,B.jsx)("div",{className:"py-4",children:t})}function dt({defaultIndex:e=0,children:t}){let r=(0,te.useMemo)(()=>te.Children.toArray(t).filter(l=>(0,te.isValidElement)(l)&&l.props?.label),[t]),{active:o,setActive:n,tabRefs:a,indicatorStyle:c}=lt({initialIndex:e,tabs:r});return(0,B.jsx)("div",{className:"my-8 w-full group/tabs",children:(0,B.jsxs)(Z.Tabs,{selectedKey:o.toString(),onSelectionChange:l=>n(Number(l)),className:"w-full",children:[(0,B.jsxs)(Z.TabList,{"aria-label":"Content Tabs",className:s(vr()),children:[r.map((l,i)=>{let{label:d,icon:m,disabled:p}=l.props,b=i.toString();return(0,B.jsxs)(Z.Tab,{id:b,isDisabled:p,ref:x=>{a.current[i]=x},className:({isSelected:x,isDisabled:P})=>s(yr({isActive:x,isDisabled:P})),children:[!!m&&(0,B.jsx)("span",{className:"shrink-0 [&>svg]:w-4 [&>svg]:h-4",children:m}),(0,B.jsx)("span",{children:d})]},b)}),(0,B.jsx)("div",{className:"absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300 ease-in-out pointer-events-none",style:c,"aria-hidden":"true"})]}),r.map((l,i)=>(0,B.jsx)(Z.TabPanel,{id:i.toString(),children:r[i]},i))]})})}var re=require("react"),ue=require("react/jsx-runtime");function mt({src:e,poster:t,alt:r,children:o,controls:n,preload:a="metadata",...c}){let l=(0,re.useRef)(null),[i,d]=(0,re.useState)(!1);return(0,re.useEffect)(()=>{let m=l.current;if(!m)return;let p=new IntersectionObserver(([b])=>{b.isIntersecting&&(d(!0),p.disconnect())},{rootMargin:"200px"});return p.observe(m),()=>p.disconnect()},[]),(0,ue.jsx)("div",{ref:l,className:"my-6 overflow-hidden rounded-lg border border-border-subtle",children:i?(0,ue.jsxs)("video",{className:"block w-full h-auto",src:e,poster:t,controls:!0,preload:a,playsInline:!0,...c,children:[o,"Your browser does not support the video tag."]}):(0,ue.jsx)("div",{className:"aspect-video bg-bg-surface animate-pulse",role:"img","aria-label":r||"Video"})})}var pt=require("class-variance-authority"),ft=require("react/jsx-runtime"),Cr=(0,pt.cva)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold tracking-tight",{variants:{variant:{default:"bg-bg-surface text-text-muted border-border-subtle",primary:"bg-primary-500/15 text-primary-400 border-primary-500/20",success:"bg-emerald-500/15 text-emerald-400 border-emerald-500/20",warning:"bg-amber-500/15 text-amber-400 border-amber-500/20",danger:"bg-red-500/15 text-red-400 border-red-500/20",info:"bg-sky-500/15 text-sky-400 border-sky-500/20"}},defaultVariants:{variant:"default"}});function ut({variant:e="default",children:t,className:r="",...o}){return(0,ft.jsx)("span",{className:s(Cr({variant:e}),r),...o,children:t})}var fe=require("react"),bt=w(require("react-aria-components"));var xt=require("class-variance-authority"),S=require("react/jsx-runtime"),Nr=(0,xt.cva)("grid gap-4 my-6",{variants:{cols:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"}},defaultVariants:{cols:3}});function gt({cols:e=3,children:t,className:r="",...o}){return(0,S.jsx)("div",{className:s(Nr({cols:e}),r),...o,children:t})}function ht({title:e,icon:t,href:r,children:o,className:n="",...a}){let c=(0,fe.useRef)(null),l=(0,fe.useRef)(null),i=(0,fe.useCallback)(p=>{let b=c.current||l.current;if(!b)return;let{left:x,top:P}=b.getBoundingClientRect();b.style.setProperty("--x",`${p.clientX-x}px`),b.style.setProperty("--y",`${p.clientY-P}px`)},[]),d=(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{className:"pointer-events-none absolute -inset-px rounded-xl opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"radial-gradient(400px circle at var(--x) var(--y), color-mix(in oklch, var(--color-primary-500), transparent 90%), transparent 80%)"}}),t&&(0,S.jsx)("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-primary-500/10 text-primary-400 text-lg transition-transform duration-300 group-hover:scale-105 group-hover:-rotate-3",children:t}),(0,S.jsxs)("div",{className:"space-y-1.5",children:[e&&(0,S.jsx)("h3",{className:"text-sm font-bold text-text-main",children:e}),o&&(0,S.jsx)("div",{className:"text-sm text-text-muted leading-relaxed",children:o})]})]}),m=s("group relative block rounded-xl border border-border-subtle bg-bg-surface p-5 outline-none overflow-hidden","transition-all duration-200 hover:border-primary-500/40 hover:shadow-lg hover:shadow-primary-500/5","focus-visible:ring-2 focus-visible:ring-primary-500/30",n);return r?(0,S.jsx)(bt.Link,{ref:l,href:r,className:s(m,"no-underline cursor-pointer"),onMouseMove:i,...a,children:d}):(0,S.jsx)("div",{ref:c,role:"presentation",className:m,onMouseMove:i,...a,children:d})}var L=require("lucide-react");var yt=require("class-variance-authority"),y=require("react/jsx-runtime"),Rr={note:(0,y.jsx)(L.Bookmark,{size:18}),tip:(0,y.jsx)(L.Lightbulb,{size:18}),info:(0,y.jsx)(L.Info,{size:18}),warning:(0,y.jsx)(L.AlertTriangle,{size:18}),danger:(0,y.jsx)(L.ShieldAlert,{size:18}),important:(0,y.jsx)(L.Flame,{size:18}),caution:(0,y.jsx)(L.Zap,{size:18})},Pr={note:"Note",tip:"Tip",info:"Info",warning:"Warning",danger:"Danger",important:"Important",caution:"Caution"},vt=(0,yt.cva)("py-4 px-4 rounded-lg",{variants:{type:{note:"border-primary-400 bg-primary-500/5 text-primary-400",tip:"border-emerald-500 bg-emerald-500/5 text-emerald-500",info:"border-sky-500 bg-sky-500/5 text-sky-500",warning:"border-amber-500 bg-amber-500/5 text-amber-500",danger:"border-red-500 bg-red-500/5 text-red-500",important:"border-orange-500 bg-orange-500/5 text-orange-500",caution:"border-yellow-500 bg-yellow-500/5 text-yellow-500"}},defaultVariants:{type:"note"}});function U({type:e="note",title:t,children:r,className:o="",...n}){return(0,y.jsxs)("div",{className:s(vt({type:e}),o),role:e==="warning"||e==="danger"?"alert":"note",...n,children:[(0,y.jsxs)("div",{className:"flex items-center flex-row gap-2 mb-2",children:[(0,y.jsx)("span",{className:s("shrink-0",vt({type:e})),children:Rr[e]}),(0,y.jsx)("span",{className:"text-sm font-bold tracking-tight text-text-main",children:t||Pr[e]})]}),(0,y.jsx)("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 [&>p]:mb-2 [&>p:last-child]:mb-0",children:r})]})}var Ct=e=>(0,y.jsx)(U,{type:"note",...e}),Nt=e=>(0,y.jsx)(U,{type:"tip",...e}),Rt=e=>(0,y.jsx)(U,{type:"warning",...e}),Pt=e=>(0,y.jsx)(U,{type:"danger",...e}),wt=e=>(0,y.jsx)(U,{type:"info",...e}),kt=e=>(0,y.jsx)(U,{type:"important",...e}),Tt=e=>(0,y.jsx)(U,{type:"caution",...e});var Te=require("react"),oe=require("lucide-react");var Ae=require("class-variance-authority"),$=require("react/jsx-runtime"),wr=(0,Ae.cva)("my-6 transition-all duration-200",{variants:{variant:{default:"list-disc pl-5 text-text-muted marker:text-primary-500/50",number:"list-decimal pl-5 text-text-muted marker:text-primary-500/50 marker:font-bold",checked:"list-none p-0",arrow:"list-none p-0",bubble:"list-none p-0"},cols:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"},isGrid:{true:"grid gap-x-8 gap-y-3",false:"space-y-2"},dense:{true:"space-y-1",false:"space-y-2"}},compoundVariants:[{variant:"default",dense:!0,className:"space-y-0.5"}],defaultVariants:{variant:"default",cols:1,isGrid:!1,dense:!1}}),kr=(0,Ae.cva)("group flex items-start gap-3 text-sm leading-relaxed transition-all duration-200",{variants:{variant:{default:"",number:"",checked:"hover:translate-x-0.5",arrow:"hover:translate-x-0.5",bubble:"hover:translate-x-0.5"},dense:{true:"py-0",false:"py-0.5"}},defaultVariants:{variant:"default",dense:!1}}),Tr=(0,Ae.cva)("mt-1 shrink-0 flex items-center justify-center transition-transform group-hover:scale-110",{variants:{variant:{bubble:"h-5 w-5 rounded-full bg-primary-500/10 text-primary-500 text-[10px] font-bold",default:""}},defaultVariants:{variant:"default"}});function Ar({icon:e,children:t,variant:r,dense:o}){return(0,$.jsxs)("li",{className:s(kr({variant:r,dense:o})),children:[e&&(0,$.jsx)("span",{className:s(Tr({variant:r==="bubble"?"bubble":"default"})),children:e}),(0,$.jsx)("div",{className:"flex-1 text-text-muted group-hover:text-text-main transition-colors",children:t})]})}var Lr={checked:e=>(0,$.jsx)(oe.Check,{size:14,className:s("text-emerald-500 shrink-0",e)}),arrow:e=>(0,$.jsx)(oe.ChevronRight,{size:14,className:s("text-primary-400 shrink-0",e)}),bubble:e=>(0,$.jsx)(oe.Circle,{size:6,fill:"currentColor",className:s("text-primary-500 shrink-0",e)}),default:()=>null,number:()=>null};function At({variant:e="default",cols:t=1,dense:r=!1,children:o,className:n,...a}){let c=t!==void 0&&Number(t)>1,l=Lr[e],i=wr({variant:e,cols:t,dense:r,isGrid:c,className:n}),d=e==="number"?"ol":"ul";return e==="default"||e==="number"?(0,$.jsx)(d,{className:i,...a,children:o}):(0,$.jsx)("ul",{className:i,...a,children:Te.Children.map(o,m=>{if(!(0,Te.isValidElement)(m))return m;let p=m,b=p.type==="li"?p.props.children:p.props.children||m;return(0,$.jsx)(Ar,{icon:l(),variant:e,dense:r,children:b})})})}var G=require("react"),_=w(require("react-aria-components")),D=require("lucide-react");var C=require("react/jsx-runtime"),be=16,xe=2,Fe={CODE:/\.(ts|tsx|js|jsx|json|mjs|cjs|astro|vue|svelte)$/i,TEXT:/\.(md|mdx|txt)$/i,IMAGE:/\.(png|jpg|jpeg|svg|gif)$/i};function $e(e){return typeof e=="string"?e:typeof e=="number"?e.toString():Array.isArray(e)?e.map($e).join(""):(0,G.isValidElement)(e)&&e.props&&typeof e.props=="object"&&"children"in e.props?$e(e.props.children):""}function Ir(e,t){let r=e.toLowerCase(),o="shrink-0 transition-colors duration-200";if(t)return(0,C.jsx)(D.Folder,{size:be,strokeWidth:xe,className:s(o,"text-primary-400"),fill:"currentColor",fillOpacity:.15});let n=s(o,"text-text-dim group-hover:text-text-main");return Fe.CODE.test(r)?(0,C.jsx)(D.FileCode,{size:be,strokeWidth:xe,className:n}):Fe.TEXT.test(r)?(0,C.jsx)(D.FileText,{size:be,strokeWidth:xe,className:n}):Fe.IMAGE.test(r)?(0,C.jsx)(D.FileImage,{size:be,strokeWidth:xe,className:n}):(0,C.jsx)(D.File,{size:be,strokeWidth:xe,className:n})}function We(e,t){if(!(0,G.isValidElement)(e))return!1;let r=e.type;if(typeof r=="string")return r===t;if(typeof r=="function")return r.name===t||r.name?.toLowerCase()===t;let o=e.props;return o?.originalType===t||o?.mdxType===t}function Br(e){let t=e.match(/\s+(\/\/|#)\s+(.*)$/);return t?{name:e.slice(0,t.index).trim(),comment:t[2]}:{name:e.trim()}}function Le(e,t="root"){if(!(0,G.isValidElement)(e))return[];let r=[];if(We(e,"ul"))return G.Children.forEach(e.props.children,(o,n)=>{r.push(...Le(o,`${t}-${n}`))}),r;if(We(e,"li")){let o=G.Children.toArray(e.props.children),n=o.findIndex(P=>We(P,"ul")),a=n!==-1,c=a?o.slice(0,n):o,l=a?o.slice(n):[],i=$e(c),{name:d,comment:m}=Br(i),p=d.endsWith("/"),b=p?d.slice(0,-1):d,x=a||p;return r.push({id:`${t}-${b}`,name:b,comment:m,isFolder:x,children:a?Le(l[0],`${t}-${b}`):void 0}),r}return e.props&&typeof e.props=="object"&&"children"in e.props&&G.Children.forEach(e.props.children,(o,n)=>{r.push(...Le(o,`${t}-${n}`))}),r}function Lt({item:e}){return(0,C.jsxs)(_.TreeItem,{id:e.id,textValue:e.name,className:"outline-none group focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md",children:[(0,C.jsx)(_.TreeItemContent,{children:({isExpanded:t,hasChildItems:r})=>(0,C.jsxs)("div",{className:"flex items-center gap-2 py-1 px-1.5 rounded-md transition-colors hover:bg-primary-500/5 cursor-pointer",children:[(0,C.jsx)("div",{style:{width:"calc((var(--tree-item-level) - 1) * 1rem)"},className:"shrink-0"}),r?(0,C.jsx)(_.Button,{slot:"chevron",className:"outline-none text-text-dim hover:text-primary-400 p-0.5 rounded transition-colors",children:(0,C.jsx)(D.ChevronRight,{size:14,strokeWidth:3,className:s("transition-transform duration-200",t&&"rotate-90")})}):(0,C.jsx)("div",{className:"w-[18px]"}),Ir(e.name,e.isFolder),(0,C.jsx)("span",{className:s("text-sm transition-colors truncate select-none",e.isFolder?"font-semibold text-text-main":"text-text-muted group-hover:text-text-main"),children:e.name}),e.comment&&(0,C.jsxs)("span",{className:"ml-2 text-xs italic text-text-dim opacity-70 group-hover:opacity-100 transition-opacity whitespace-nowrap overflow-hidden text-ellipsis font-sans",children:["//"," ",e.comment]})]})}),e.children&&(0,C.jsx)(_.Collection,{items:e.children,children:t=>(0,C.jsx)(Lt,{item:t})})]})}function It({children:e}){let t=(0,G.useMemo)(()=>Le(e),[e]);return(0,C.jsx)("div",{className:"my-8",children:(0,C.jsx)(_.Tree,{items:t,"aria-label":"File Tree",className:s("rounded-xl border border-border-subtle bg-bg-surface/50 p-4 font-mono text-sm shadow-sm backdrop-blur-sm outline-none","max-h-[500px] overflow-y-auto scrollbar-thin scrollbar-thumb-border-subtle","focus-visible:ring-2 focus-visible:ring-primary-500/20"),children:r=>(0,C.jsx)(Lt,{item:r})})})}var ge=w(require("react-aria-components"));var ne=require("react");function Bt({data:e,sortable:t=!1,paginated:r=!1,pageSize:o=10}){let[n,a]=(0,ne.useState)(null),[c,l]=(0,ne.useState)(1),i=(0,ne.useMemo)(()=>{if(!e)return[];let b=[...e];return t&&n!==null&&b.sort((x,P)=>{let N=x[n.key],f=P[n.key],H=typeof N=="string"?N:"",X=typeof f=="string"?f:"";return H<X?n.direction==="asc"?-1:1:H>X?n.direction==="asc"?1:-1:0}),b},[e,n,t]),d=Math.ceil(i.length/o),m=(0,ne.useMemo)(()=>{if(!r)return i;let b=(c-1)*o;return i.slice(b,b+o)},[i,r,c,o]);return{sortConfig:n,currentPage:c,setCurrentPage:l,totalPages:d,paginatedData:m,requestSort:b=>{if(!t)return;let x="asc";n&&n.key===b&&n.direction==="asc"&&(x="desc"),a({key:b,direction:x})}}}var M=require("lucide-react");var g=require("react/jsx-runtime");function St({headers:e,data:t,children:r,className:o="",sortable:n=!1,paginated:a=!1,pageSize:c=10}){let{sortConfig:l,currentPage:i,setCurrentPage:d,totalPages:m,paginatedData:p,requestSort:b}=Bt({data:t,sortable:n,paginated:a,pageSize:c}),x=N=>n?l?.key!==N?(0,g.jsx)(M.ChevronDown,{size:14,className:"ml-1 opacity-30"}):l.direction==="asc"?(0,g.jsx)(M.ChevronUp,{size:14,className:"ml-1 text-primary-400"}):(0,g.jsx)(M.ChevronDown,{size:14,className:"ml-1 text-primary-400"}):null,P=r||(0,g.jsxs)(g.Fragment,{children:[e&&(0,g.jsx)("thead",{children:(0,g.jsx)("tr",{children:e.map((N,f)=>(0,g.jsx)("th",{onClick:()=>b(f),className:s("text-left px-3 py-2.5 border-b-2 border-border-subtle text-text-main font-semibold text-sm",n&&"cursor-pointer select-none hover:text-primary-400 transition-colors"),children:(0,g.jsxs)("div",{className:"flex items-center",children:[N,x(f)]})},f))})}),p&&(0,g.jsx)("tbody",{children:p.map((N,f)=>(0,g.jsx)("tr",{className:"transition-colors hover:bg-bg-surface",children:N.map((H,X)=>(0,g.jsx)("td",{className:"px-3 py-2 border-b border-border-subtle text-sm text-text-muted",children:H},X))},f))})]});return(0,g.jsxs)("div",{className:s("my-6 rounded-lg border border-border-subtle overflow-hidden",o),children:[(0,g.jsx)("div",{className:"overflow-x-auto",children:(0,g.jsx)("table",{className:"w-full border-collapse text-sm",children:P})}),a&&m>1&&(0,g.jsxs)("div",{className:"flex items-center justify-between border-t border-border-subtle px-4 py-3",children:[(0,g.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",i," of ",m]}),(0,g.jsxs)("div",{className:"flex items-center gap-1",children:[(0,g.jsx)(ge.Button,{onPress:()=>d(1),isDisabled:i===1,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:(0,g.jsx)(M.ChevronsLeft,{size:16})}),(0,g.jsx)(ge.Button,{onPress:()=>d(N=>Math.max(N-1,1)),isDisabled:i===1,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:(0,g.jsx)(M.ChevronLeft,{size:16})}),(0,g.jsx)(ge.Button,{onPress:()=>d(N=>Math.min(N+1,m)),isDisabled:i===m,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:(0,g.jsx)(M.ChevronRight,{size:16})}),(0,g.jsx)(ge.Button,{onPress:()=>d(m),isDisabled:i===m,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:(0,g.jsx)(M.ChevronsRight,{size:16})})]})]})]})}var E=require("react/jsx-runtime");function Mt({name:e,type:t,defaultValue:r,required:o=!1,children:n,id:a,className:c=""}){return(0,E.jsxs)("article",{className:s("group relative my-6 rounded-xl border border-border-subtle bg-bg-surface p-5 transition-all duration-300","hover:border-primary-500/30 hover:shadow-lg hover:shadow-primary-500/5",c),id:a,children:[(0,E.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,E.jsxs)("div",{className:"flex flex-wrap items-center gap-2.5",children:[(0,E.jsx)("code",{className:"inline-flex items-center rounded-md bg-primary-500/10 px-2.5 py-1 font-mono text-sm font-bold text-primary-400 border border-primary-500/20 shadow-sm transition-colors group-hover:bg-primary-500/15",children:e}),t&&(0,E.jsx)("span",{className:"rounded-md bg-bg-muted/80 border border-border-subtle px-2 py-0.5 text-[11px] font-semibold text-text-muted uppercase tracking-wider shadow-sm",children:t}),o&&(0,E.jsxs)("div",{className:"flex items-center gap-1.5 rounded-full bg-red-500/10 px-2.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-red-400 border border-red-500/20 shadow-sm",children:[(0,E.jsx)("span",{className:"h-1 w-1 rounded-full bg-red-400 animate-pulse"}),"Required"]})]}),r&&(0,E.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-text-muted bg-bg-muted/30 px-2.5 py-1 rounded-md border border-border-subtle/50",children:[(0,E.jsx)("span",{className:"font-semibold opacity-60 uppercase tracking-tighter",children:"Default"}),(0,E.jsx)("code",{className:"font-mono text-text-main font-medium",children:r})]})]}),(0,E.jsx)("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 selection:bg-primary-500/30",children:n})]})}var _e=w(require("react")),Dt=require("react-aria-components"),zt=require("react-router-dom");var Ot=require("react-router-dom");var se=require("react"),Mr=require("react/jsx-runtime"),Sr=(0,se.createContext)({preload:()=>{},routes:[]});function Ie(){return(0,se.use)(Sr)}var Et=require("zustand"),Be=require("zustand/middleware"),Se=(0,Et.create)()((0,Be.persist)(e=>({currentLocale:void 0,currentVersion:void 0,hasHydrated:!1,setLocale:t=>e({currentLocale:t}),setVersion:t=>e({currentVersion:t}),setHasHydrated:t=>e({hasHydrated:t})}),{name:"boltdocs-storage",storage:(0,Be.createJSONStorage)(()=>localStorage),partialize:e=>({currentLocale:e.currentLocale,currentVersion:e.currentVersion}),onRehydrateStorage:()=>e=>{e?.setHasHydrated(!0)}}));function Vt(){let{routes:e}=Ie(),t=K(),r=(0,Ot.useLocation)(),o=Se(f=>f.currentLocale),n=Se(f=>f.currentVersion),a=Se(f=>f.hasHydrated),c=e.find(f=>f.path===r.pathname),l=t.i18n?c?.locale||(a?o:void 0)||t.i18n.defaultLocale:void 0,i=t.versions?c?.version||(a?n:void 0)||t.versions.defaultVersion:void 0,d=e.filter(f=>{let H=t.i18n?(f.locale||t.i18n.defaultLocale)===l:!0,X=t.versions?(f.version||t.versions.defaultVersion)===i:!0;if(!(H&&X))return!1;let Ve=t.i18n;if(Ve){let sr=!!c?.locale,ar=!!f.locale;if(e.some(ye=>ye!==f&&ye.filePath===f.filePath&&ye.version===f.version&&(ye.locale||Ve.defaultLocale)===(f.locale||Ve.defaultLocale))&&sr!==ar)return!1}return!0}),p=t.i18n?.localeConfigs?.[l]?.label||t.i18n?.locales[l]||l,x=t.versions?.versions.find(f=>f.path===i)?.label||i,P=t.i18n?Object.entries(t.i18n.locales).map(([f,H])=>{let X=t.i18n?.localeConfigs?.[f];return{key:f,label:X?.label||H,isCurrent:f===l}}):[],N=t.versions?t.versions.versions.map(f=>({key:f.path,label:f.label,isCurrent:f.path===i})):[];return{routes:d,allRoutes:e,currentRoute:c,currentLocale:l,currentLocaleLabel:p,availableLocales:P,currentVersion:i,currentVersionLabel:x,availableVersions:N,config:t}}function Ge(e){let t=K(),{currentLocale:r,currentVersion:o}=Vt();if(!t||typeof e!="string"||e.startsWith("http")||e.startsWith("//"))return e;let n=t.i18n,a=t.versions;if(!n&&!a)return e;let c=e.startsWith("/docs"),l=e.split("/").filter(Boolean),i=0;l[i]==="docs"&&i++,a&&l.length>i&&a.versions.find(x=>x.path===l[i])&&i++,n&&l.length>i&&n.locales[l[i]]&&i++;let d=l.slice(i),m=[];c&&(m.push("docs"),a&&o&&m.push(o)),n&&r&&r!==n.defaultLocale&&m.push(r),m.push(...d);let p=`/${m.join("/")}`;return p.length>1&&p.endsWith("/")?p.slice(0,-1):p||"/"}var je=require("react/jsx-runtime"),ae=_e.default.forwardRef((e,t)=>{let{href:r,prefetch:o="hover",onMouseEnter:n,onFocus:a,...c}=e,l=Ge(r??""),{preload:i}=Ie();return(0,je.jsx)(Dt.Link,{...c,ref:t,href:l,onMouseEnter:p=>{n?.(p),o==="hover"&&typeof l=="string"&&l.startsWith("/")&&i(l)},onFocus:p=>{a?.(p),o==="hover"&&typeof l=="string"&&l.startsWith("/")&&i(l)}})});ae.displayName="Link";var Er=_e.default.forwardRef((e,t)=>{let{href:r,end:o=!1,className:n,children:a,...c}=e,l=(0,zt.useLocation)(),i=Ge(r??""),d=o?l.pathname===i:l.pathname.startsWith(i),m=typeof n=="function"?n({isActive:d}):s(n,d&&"active"),p=typeof a=="function"?a({isActive:d}):a;return(0,je.jsx)(ae,{...c,ref:t,href:r,className:m,children:p})});Er.displayName="NavLink";var Ft=require("react/jsx-runtime");function Ht({to:e,children:t,className:r="",...o}){let n=e&&(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")),a=s("text-blue-600 hover:text-blue-800 hover:underline cursor-pointer",r);return(0,Ft.jsx)(ae,{href:e,className:a,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,...o,children:t})}var ie=require("react"),Vr=require("react/jsx-runtime"),Or=(0,ie.createContext)(void 0);function Wt(){let e=(0,ie.use)(Or);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}var Gt=require("react/jsx-runtime");function $t({src:e,alt:t,theme:r,...o}){let{theme:n}=Wt();return r&&r!==n?null:(0,Gt.jsx)("img",{src:e,alt:t||"",...o})}var v=require("react/jsx-runtime");function _t({title:e,props:t,className:r=""}){return(0,v.jsxs)("div",{className:s("my-6",r),children:[e&&(0,v.jsx)("h3",{className:"text-base font-bold text-text-main mb-3",children:e}),(0,v.jsx)("div",{className:"overflow-x-auto rounded-lg border border-border-subtle",children:(0,v.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,v.jsx)("thead",{children:(0,v.jsxs)("tr",{children:[(0,v.jsx)("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Property"}),(0,v.jsx)("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Type"}),(0,v.jsx)("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Default"}),(0,v.jsx)("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Description"})]})}),(0,v.jsx)("tbody",{children:t.map((o,n)=>(0,v.jsxs)("tr",{className:"transition-colors hover:bg-bg-surface",children:[(0,v.jsxs)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:[(0,v.jsx)("code",{className:"rounded bg-bg-surface px-1.5 py-0.5 font-mono text-xs font-bold text-primary-400",children:o.name}),o.required&&(0,v.jsx)("span",{className:"ml-1 text-red-400 font-bold",children:"*"})]}),(0,v.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:(0,v.jsx)("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-text-muted",children:o.type})}),(0,v.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:o.defaultValue?(0,v.jsx)("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-primary-400",children:o.defaultValue}):(0,v.jsx)("span",{className:"text-text-dim",children:"\u2014"})}),(0,v.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle text-text-muted",children:o.description})]},`${o.name}-${n}`))})]})})]})}var Ue=require("react");function jt(e){let{code:t,children:r,preview:o}=e,n=(0,Ue.useMemo)(()=>(t??(typeof r=="string"?r:"")).trim(),[t,r]),a=(0,Ue.useMemo)(()=>o??(typeof r!="string"?r:null),[o,r]);return{initialCode:n,previewElement:a}}var le=require("react/jsx-runtime");function Ut(e){let{highlightedHtml:t,hideCode:r=!1,hideSandbox:o=!1,hideCopy:n=!1,sandboxOptions:a={}}=e,{initialCode:c,previewElement:l}=jt(e);return(0,le.jsxs)("div",{className:"my-6 overflow-hidden rounded-xl border border-border-subtle",children:[(0,le.jsx)("div",{className:"flex items-center justify-center p-8 bg-bg-surface",children:l}),!r&&(0,le.jsx)("div",{className:"border-t border-border-subtle",children:(0,le.jsx)(ee,{hideSandbox:o,hideCopy:n,title:a.title,lang:"tsx",highlightedHtml:t,children:c})})]})}var or=require("react"),q=require("lucide-react");var qt=require("react");var Dr=require("react-aria-components"),he=require("lucide-react");var Xt=require("react/jsx-runtime");var ve=w(require("react-aria-components")),zr=require("lucide-react");var Ke=require("react/jsx-runtime");var k=w(require("react-aria-components")),J=require("lucide-react");var h=require("react/jsx-runtime"),Hr=({children:e,isOpen:t,onOpenChange:r,className:o})=>(0,h.jsx)(k.ModalOverlay,{isOpen:t,onOpenChange:r,isDismissable:!0,className:s("fixed inset-0 z-100 bg-black/40 backdrop-blur-sm px-4 py-4 sm:py-20","entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out"),children:(0,h.jsx)(k.Modal,{className:s("mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl ring-1 ring-black/5 outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95",o),children:(0,h.jsx)(k.Dialog,{className:"flex flex-col max-h-[70vh] focus:outline-none",children:e})})}),Fr=({children:e,className:t,onSelectionChange:r,...o})=>(0,h.jsx)("div",{className:t,children:(0,h.jsx)(k.Autocomplete,{...o,onSelectionChange:r,className:"flex flex-col min-h-0",children:e})}),Wr=({className:e,...t})=>(0,h.jsxs)(k.SearchField,{className:"flex items-center gap-3 border-b border-border-subtle px-4 py-4",autoFocus:!0,children:[(0,h.jsx)(J.Search,{className:"h-5 w-5 text-text-muted"}),(0,h.jsx)(k.Input,{...t,className:s("w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none",e),placeholder:"Search documentation..."}),(0,h.jsx)("div",{className:"flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-main px-1.5 py-1 text-[10px] font-medium text-text-muted",children:(0,h.jsx)("kbd",{className:"font-sans",children:"ESC"})})]}),$r=({children:e,className:t,...r})=>(0,h.jsx)(k.ListBox,{...r,className:s("flex-1 overflow-y-auto p-2 outline-none",t),children:e}),Gr=({children:e,className:t,...r})=>(0,h.jsx)(k.ListBoxItem,{...r,className:s("group flex items-center gap-3 rounded-lg p-3 text-left outline-none cursor-pointer transition-colors","text-text-muted hover:bg-bg-main hover:text-text-main focus:bg-primary-500 focus:text-white selected:bg-primary-500 selected:text-white",t),children:o=>(0,h.jsxs)(h.Fragment,{children:[e,(o.isFocused||o.isSelected)&&(0,h.jsxs)("div",{className:"ml-auto opacity-50 flex items-center gap-1",children:[(0,h.jsx)("span",{className:"text-[10px]",children:"Select"}),(0,h.jsx)(J.CornerDownLeft,{size:10})]})]})}),_r=({isHeading:e,className:t})=>(0,h.jsx)("div",{className:s("shrink-0",t),children:e?(0,h.jsx)(J.Hash,{size:18}):(0,h.jsx)(J.FileText,{size:18})}),jr=({children:e,className:t})=>(0,h.jsx)("span",{className:s("block font-medium truncate flex-1 text-sm",t),children:e}),Ur=({children:e,className:t})=>(0,h.jsx)("span",{className:s("ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100",t),children:e}),bs={Root:Hr,Autocomplete:Fr,Input:Wr,List:$r,Item:Object.assign(Gr,{Icon:_r,Title:jr,Bio:Ur})};var O=require("react"),qr=w(require("scroll-into-view-if-needed"));var Kt=require("react");var Zt=require("react/jsx-runtime"),As=(0,O.createContext)(null),Ls=(0,O.createContext)(null);function Xr(e){let[t,r]=(0,O.useState)({isOverflowing:!1,isAtBottom:!1});return(0,O.useEffect)(()=>{let o=e.current;if(!o)return;let n=()=>{let c=o.scrollHeight>o.clientHeight,l=o.scrollHeight-o.scrollTop<=o.clientHeight+2;r({isOverflowing:c,isAtBottom:l})};n(),o.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n);let a=new MutationObserver(n);return a.observe(o,{childList:!0,subtree:!0}),()=>{o.removeEventListener("scroll",n),window.removeEventListener("resize",n),a.disconnect()}},[e]),t}var Kr=({children:e,className:t,ref:r,...o})=>{let n=(0,O.useRef)(null);(0,O.useImperativeHandle)(r,()=>n.current);let{isOverflowing:a,isAtBottom:c}=Xr(n);return(0,Zt.jsx)("div",{ref:n,className:s("relative overflow-y-auto boltdocs-otp-content",a&&!c&&"mask-[linear-gradient(to_bottom,black_85%,transparent_100%)]",t),...o,children:e})};Kr.displayName="OnThisPageContent";var Jt=w(require("react-aria-components")),Oe=require("lucide-react");var z=require("react/jsx-runtime"),Zr=({children:e,className:t})=>(0,z.jsx)("nav",{className:s("grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle",t),children:e}),Jr=({children:e,to:t,direction:r,className:o})=>{let n=r==="next";return(0,z.jsxs)(Jt.Link,{href:t,className:s("flex group items-center p-4 rounded-xl border border-border-subtle bg-bg-surface outline-none","transition-all hover:bg-bg-main hover:border-primary-500 hover:shadow-lg","focus-visible:ring-2 focus-visible:ring-primary-500/30",n?"text-right justify-end":"text-left justify-start",o),children:[!n&&(0,z.jsx)(Oe.ChevronLeft,{className:"mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1"}),(0,z.jsx)("div",{className:"flex flex-col gap-1 flex-1",children:e}),n&&(0,z.jsx)(Oe.ChevronRight,{className:"ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1"})]})},Qr=({children:e,className:t})=>(0,z.jsx)("span",{className:s("text-xs font-medium uppercase tracking-wider text-text-muted",t),children:e}),Yr=({children:e,className:t})=>(0,z.jsx)("span",{className:s("text-base font-bold text-text-main truncate",t),children:e}),eo=({children:e})=>(0,z.jsx)(z.Fragment,{children:e}),Ms={PageNavRoot:Zr,PageNavLink:Object.assign(Jr,{Title:Qr,Description:Yr,Icon:eo})};var to=require("react/jsx-runtime");var ro=w(require("react-aria-components")),oo=require("lucide-react");var Qt=require("react/jsx-runtime");var Ze=require("react-aria-components"),no=require("lucide-react");var so=require("react/jsx-runtime");var er=require("react/jsx-runtime"),Yt=({children:e,className:t,vertical:r=!1})=>(0,er.jsx)("div",{className:s("inline-flex",r?"flex-col":"flex-row",!r&&["[&>*:not(:first-child)]:-ml-px","[&>*:first-child]:rounded-r-none","[&>*:last-child]:rounded-l-none","[&>*:not(:first-child):not(:last-child)]:rounded-none",t?.includes("rounded-full")&&["[&>*:first-child]:rounded-l-full","[&>*:last-child]:rounded-r-full"],t?.includes("rounded-xl")&&["[&>*:first-child]:rounded-l-xl","[&>*:last-child]:rounded-r-xl"],t?.includes("rounded-lg")&&["[&>*:first-child]:rounded-l-lg","[&>*:last-child]:rounded-r-lg"]],r&&["[&>*:not(:first-child)]:-mt-px","[&>*:first-child]:rounded-b-none","[&>*:last-child]:rounded-t-none","[&>*:not(:first-child):not(:last-child)]:rounded-none",t?.includes("rounded-full")&&["[&>*:first-child]:rounded-t-full","[&>*:last-child]:rounded-b-full"]],t),children:e});var me=require("lucide-react"),rr=w(require("react")),A=w(require("react-aria-components"));var de=w(require("react-aria-components"));var ce=require("react/jsx-runtime"),tr=({children:e,className:t,showArrow:r,...o})=>(0,ce.jsxs)(de.Popover,{offset:8,...o,className:de.composeRenderProps(t,n=>s("z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95 fill-mode-forwards",n)),children:[r&&(0,ce.jsx)(de.OverlayArrow,{className:"group",children:(0,ce.jsx)("svg",{viewBox:"0 0 12 12",className:"block h-3 w-3 fill-bg-surface/80 stroke-border-subtle group-placement-bottom:rotate-180 group-placement-left:-rotate-90 group-placement-right:rotate-90","aria-hidden":"true",children:(0,ce.jsx)("path",{d:"M0 0 L6 6 L12 0"})})}),e]});var I=require("react/jsx-runtime");function qe(e){let[t,r]=rr.default.Children.toArray(e.children).slice(0,2);return(0,I.jsxs)(A.MenuTrigger,{...e,children:[t,(0,I.jsx)(tr,{placement:e.placement,className:"min-w-[200px]",children:r})]})}function Xe(e){return(0,I.jsx)(A.Menu,{...e,className:A.composeRenderProps(e.className,t=>s("p-1.5 outline-none max-h-[inherit] overflow-auto",t))})}function Me(e){let t=e.textValue||(typeof e.children=="string"?e.children:void 0);return(0,I.jsx)(A.MenuItem,{...e,textValue:t,className:A.composeRenderProps(e.className,(r,{isFocused:o,isPressed:n,isDisabled:a})=>s("group relative flex flex-row items-center gap-2.5 px-3 py-1.5 rounded-lg outline-none cursor-default transition-all duration-200","text-text-main text-[0.8125rem]",o&&"bg-primary-500/10 text-primary-600 shadow-sm",n&&"scale-[0.98] bg-primary-500/15",a&&"opacity-40 grayscale pointer-events-none",r)),children:A.composeRenderProps(e.children,(r,{selectionMode:o,isSelected:n,hasSubmenu:a})=>(0,I.jsxs)(I.Fragment,{children:[o!=="none"&&(0,I.jsxs)("span",{className:"flex items-center w-4 h-4 shrink-0 justify-center",children:[n&&o==="multiple"&&(0,I.jsx)(me.Check,{className:"w-3.5 h-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200"}),n&&o==="single"&&(0,I.jsx)(me.Dot,{className:"w-6 h-6 text-primary-500 animate-in zoom-in-50 duration-200"})]}),(0,I.jsx)("div",{className:"flex-1 flex flex-row items-center gap-2.5 truncate font-medium",children:r}),a&&(0,I.jsx)(me.ChevronRight,{className:"w-4 h-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors"})]}))})}var Ee=require("react-aria-components");var R=require("react/jsx-runtime"),ao=e=>{let[t,r]=(0,or.useState)(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)},handleOpenRaw:()=>{let a=new Blob([e],{type:"text/plain;charset=utf-8"}),c=URL.createObjectURL(a);window.open(c,"_blank")}}};function nr({content:e,mdxRaw:t,config:r}){let o=t||e||"",{copied:n,handleCopy:a,handleOpenRaw:c}=ao(o),l=r!==!1,i=typeof r=="object"&&r.text||"Copy Markdown";return!l||!o?null:(0,R.jsx)("div",{className:"relative inline-flex z-100 flex-shrink-0 w-max translate-y-0 active:translate-y-px transition-transform duration-200",children:(0,R.jsxs)(Yt,{className:"rounded-xl border border-border-subtle bg-bg-surface/40 backdrop-blur-md transition-all duration-300 hover:border-primary-500/50 hover:shadow-lg hover:shadow-primary-500/5 group overflow-hidden",children:[(0,R.jsx)(Q,{variant:"ghost",onPress:a,icon:n?(0,R.jsx)(q.Check,{size:16}):(0,R.jsx)(q.Copy,{size:16}),iconPosition:"left",className:s("px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 border-none shrink-0","text-text-main transition-all duration-300 hover:bg-primary-500/5",n&&"text-emerald-500 hover:bg-emerald-500/5"),children:n?"Copied!":i}),(0,R.jsxs)(qe,{placement:"bottom end",children:[(0,R.jsx)(Q,{variant:"ghost",isIconOnly:!0,icon:(0,R.jsx)(q.ChevronDown,{size:14}),className:s("px-3.5 h-9 border-l border-border-subtle/50 text-text-muted rounded-none bg-transparent shrink-0","transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500")}),(0,R.jsxs)(Xe,{className:"w-52",children:[(0,R.jsxs)(Me,{onAction:a,className:"flex flex-row items-start gap-2.5 group",children:[(0,R.jsx)(q.Copy,{size:16,className:"w-4 h-4 shrink-0 mt-0.5 transition-transform duration-200 group-hover:-translate-y-0.5 text-text-muted group-hover:text-primary-500"}),(0,R.jsx)("span",{className:"font-medium text-[0.8125rem]",children:"Copy Markdown"})]}),(0,R.jsxs)(Me,{onAction:c,className:"flex flex-row items-start gap-2.5 group",children:[(0,R.jsx)(q.ExternalLink,{size:16,className:"w-4 h-4 shrink-0 mt-0.5 transition-transform duration-200 group-hover:-translate-y-0.5 text-text-muted group-hover:text-primary-500"}),(0,R.jsx)("span",{className:"font-medium text-[0.8125rem]",children:"View as Markdown"})]})]})]})]})})}
|
package/dist/mdx/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x}from"../chunk-URTD6E6S.mjs";import{a as y}from"../chunk-RPUERTVC.mjs";import"../chunk-JD3RSDE4.mjs";import"../chunk-T3W44KWY.mjs";import"../chunk-W2NB4T6V.mjs";import"../chunk-NBCYHLAA.mjs";import"../chunk-JZXLCA2E.mjs";export{i as Admonition,f as Badge,a as Button,h as Card,g as Cards,p as Caution,b as CodeBlock,x as ComponentPreview,w as ComponentProps,y as CopyMarkdown,m as Danger,t as Field,r as FileTree,v as Image,o as Important,n as InfoBox,u as Link,q as List,j as Note,c as Tab,s as Table,d as Tabs,k as Tip,e as Video,l as Warning};
|
package/dist/node/cli-entry.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var Ie=Object.create;var vt=Object.defineProperty;var je=Object.getOwnPropertyDescriptor;var He=Object.getOwnPropertyNames;var Le=Object.getPrototypeOf,Ee=Object.prototype.hasOwnProperty;var bt=(o,t)=>()=>(o&&(t=o(o=0)),t);var Ae=(o,t)=>{for(var e in t)vt(o,e,{get:t[e],enumerable:!0})},ze=(o,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of He(t))!Ee.call(o,i)&&i!==e&&vt(o,i,{get:()=>t[i],enumerable:!(s=je(t,i))||s.enumerable});return o};var f=(o,t,e)=>(e=o!=null?Ie(Le(o)):{},ze(t||!o||!o.__esModule?vt(e,"default",{value:o,enumerable:!0}):e,o));var Ne,w,m=bt(()=>{"use strict";Ne=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"?document.currentScript.src:new URL("main.js",document.baseURI).href,w=Ne()});function k(o){return o.replace(/\\/g,"/")}function q(o){return o.replace(/^\d+\./,"")}function nt(o){let t=o.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function Nt(o){return/\.mdx?$/.test(o)}function rt(o){try{return wt.default.statSync(o).mtimeMs}catch{return 0}}function Ut(o){let t=wt.default.readFileSync(o,"utf-8");try{let{data:e,content:s}=(0,zt.default)(t);return{data:e,content:s}}catch{return{data:{},content:t}}}function H(o){return o.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function Ct(o){return H(o)}function Gt(o){let e=o.split("/").map(q).join("/").replace(/\/$/,"");return e=e.replace(/\.mdx?$/,""),(e==="index"||e.endsWith("/index"))&&(e=e.replace(/index$/,"")),e.startsWith("/")||(e="/"+e),e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function J(o){return Pt.default.sanitize(o)}function $t(o){return Pt.default.sanitize(o,{ALLOWED_TAGS:[],KEEP_CONTENT:!0})}function K(o){return o.charAt(0).toUpperCase()+o.slice(1)}function St(o,t){return o?typeof o=="string"?o:t&&o[t]?o[t]:Object.values(o)[0]||"":""}var wt,zt,Pt,T=bt(()=>{"use strict";m();wt=f(require("fs")),zt=f(require("gray-matter")),Pt=f(require("isomorphic-dompurify"))});var Tt={};Ae(Tt,{AssetCache:()=>Rt,FileCache:()=>X,TransformCache:()=>Z,flushCache:()=>Je});async function Je(){await I.flush()}var C,B,E,L,A,st,Ue,at,kt,ro,Mt,Ge,Ve,We,qe,Bt,Dt,I,X,Z,Rt,Q=bt(()=>{"use strict";m();C=f(require("fs")),B=f(require("path")),E=f(require("crypto")),L=f(require("zlib")),A=require("util");T();st=(0,A.promisify)(C.default.writeFile),Ue=(0,A.promisify)(C.default.readFile),at=(0,A.promisify)(C.default.mkdir),kt=(0,A.promisify)(C.default.rename),ro=(0,A.promisify)(C.default.unlink),Mt=process.env.BOLTDOCS_CACHE_DIR||".boltdocs",Ge="assets",Ve="shards",We=parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||"2000",10),qe=process.env.BOLTDOCS_CACHE_COMPRESS!=="0",Bt=class{constructor(t){this.limit=t}cache=new Map;get(t){let e=this.cache.get(t);return e!==void 0&&(this.cache.delete(t),this.cache.set(t,e)),e}set(t,e){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.limit){let s=this.cache.keys().next().value;s!==void 0&&this.cache.delete(s)}this.cache.set(t,e)}get size(){return this.cache.size}clear(){this.cache.clear()}},Dt=class{queue=Promise.resolve();pendingCount=0;add(t){this.pendingCount++,this.queue=this.queue.then(t).finally(()=>{this.pendingCount--})}async flush(){await this.queue}get pending(){return this.pendingCount}},I=new Dt,X=class{entries=new Map;cachePath=null;compress;constructor(t={}){if(this.compress=t.compress!==void 0?t.compress:qe,t.name){let e=t.root||process.cwd(),s=this.compress?"json.gz":"json";this.cachePath=B.default.resolve(e,Mt,`${t.name}.${s}`)}}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&!(!this.cachePath||!C.default.existsSync(this.cachePath)))try{let t=C.default.readFileSync(this.cachePath);this.cachePath.endsWith(".gz")&&(t=L.default.gunzipSync(t));let e=JSON.parse(t.toString("utf-8"));this.entries=new Map(Object.entries(e))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1"||!this.cachePath)return;let t=Object.fromEntries(this.entries),e=JSON.stringify(t),s=this.cachePath,i=this.compress;I.add(async()=>{try{await at(B.default.dirname(s),{recursive:!0});let r=Buffer.from(e);i&&(r=L.default.gzipSync(r));let c=`${s}.${E.default.randomBytes(4).toString("hex")}.tmp`;await st(c,r),await kt(c,s)}catch{}})}get(t){let e=this.entries.get(t);return!e||rt(t)!==e.mtime?null:e.data}set(t,e){this.entries.set(t,{data:e,mtime:rt(t)})}isValid(t){let e=this.entries.get(t);return e?rt(t)===e.mtime:!1}invalidate(t){this.entries.delete(t)}invalidateAll(){this.entries.clear()}pruneStale(t){for(let e of this.entries.keys())t.has(e)||this.entries.delete(e)}get size(){return this.entries.size}async flush(){await I.flush()}},Z=class{index=new Map;memoryCache=new Bt(We);baseDir;shardsDir;indexPath;constructor(t,e=process.cwd()){this.baseDir=B.default.resolve(e,Mt,`transform-${t}`),this.shardsDir=B.default.resolve(this.baseDir,Ve),this.indexPath=B.default.resolve(this.baseDir,"index.json")}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&C.default.existsSync(this.indexPath))try{let t=C.default.readFileSync(this.indexPath,"utf-8");this.index=new Map(Object.entries(JSON.parse(t)))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1")return;let t=JSON.stringify(Object.fromEntries(this.index)),e=this.indexPath;I.add(async()=>{await at(B.default.dirname(e),{recursive:!0}),await st(e,t)})}async getMany(t){let e=new Map,s=[];for(let i of t){let r=this.memoryCache.get(i);r?e.set(i,r):this.index.has(i)&&s.push(i)}if(s.length>0){let i=await Promise.all(s.map(async r=>{let c=this.index.get(r),p=B.default.resolve(this.shardsDir,`${c}.gz`);try{let n=await Ue(p),l=L.default.gunzipSync(n).toString("utf-8");return this.memoryCache.set(r,l),{key:r,val:l}}catch{return null}}));for(let r of i)r&&e.set(r.key,r.val)}return e}get(t){let e=this.memoryCache.get(t);if(e)return e;let s=this.index.get(t);if(!s)return null;let i=B.default.resolve(this.shardsDir,`${s}.gz`);if(!C.default.existsSync(i))return null;try{let r=C.default.readFileSync(i),c=L.default.gunzipSync(r).toString("utf-8");return this.memoryCache.set(t,c),c}catch{return null}}set(t,e){let s=E.default.createHash("md5").update(e).digest("hex");this.index.set(t,s),this.memoryCache.set(t,e);let i=B.default.resolve(this.shardsDir,`${s}.gz`);I.add(async()=>{if(C.default.existsSync(i))return;await at(this.shardsDir,{recursive:!0});let r=L.default.gzipSync(Buffer.from(e)),c=`${i}.${E.default.randomBytes(4).toString("hex")}.tmp`;await st(c,r),await kt(c,i)})}get size(){return this.index.size}async flush(){await I.flush()}},Rt=class{assetsDir;constructor(t=process.cwd()){this.assetsDir=B.default.resolve(t,Mt,Ge)}getFileHash(t){return E.default.createHash("md5").update(C.default.readFileSync(t)).digest("hex")}get(t,e){if(!C.default.existsSync(t))return null;let s=this.getFileHash(t),i=this.getCachedPath(t,`${e}-${s}`);return C.default.existsSync(i)?i:null}set(t,e,s){let i=this.getFileHash(t),r=this.getCachedPath(t,`${e}-${i}`);I.add(async()=>{await at(this.assetsDir,{recursive:!0});let c=`${r}.${E.default.randomBytes(4).toString("hex")}.tmp`;await st(c,s),await kt(c,r)})}getCachedPath(t,e){let s=B.default.extname(t),i=B.default.basename(t,s),r=e.replace(/[^a-z0-9]/gi,"-").toLowerCase();return B.default.join(this.assetsDir,`${i}.${r}${s}`)}clear(){C.default.existsSync(this.assetsDir)&&C.default.rmSync(this.assetsDir,{recursive:!0,force:!0})}async flush(){await I.flush()}}});m();var ke=f(require("cac"));m();var U=require("vite");m();var Pe=f(require("@vitejs/plugin-react")),Ce=f(require("@tailwindcss/vite"));m();var se=require("vite");m();var Kt=f(require("fast-glob"));T();m();Q();var _=new X({name:"routes"});function _t(){_.invalidateAll()}function Ot(o){_.invalidate(o)}m();var z=f(require("path")),Vt=f(require("github-slugger"));T();function Wt(o,t,e,s){let i=decodeURIComponent(o),r=z.default.resolve(i),c=z.default.resolve(t),p=k(z.default.relative(c,r));if(p.startsWith("../")||p===".."||r.includes("\0"))throw new Error(`Security breach: File is outside of docs directory or contains null bytes: ${o}`);let{data:n,content:l}=Ut(o),d=p.split("/"),u,y;if(s?.versions&&d.length>0){let R=d[0],yt=s.versions.prefix||"",it=s.versions.versions.find(W=>{let xt=yt+W.path;return R===xt||R===W.path});it&&(y=it.path,d=d.slice(1))}if(s?.i18n&&d.length>0){let R=d[0];s.i18n.locales[R]&&(u=R,d=d.slice(1))}let x;if(d.length>0){let R=d[0].match(/^\((.+)\)$/);R&&(x=R[1].toLowerCase(),d=d.slice(1))}let S=d.join("/"),a;n.permalink?a=n.permalink.startsWith("/")?n.permalink:`/${n.permalink}`:a=Gt(S||"index.md");let g=e;y&&(g+="/"+y),u&&(g+="/"+u),g+=a==="/"?"":a,(!g||g==="")&&(g="/");let b=d[d.length-1],h=q(b),D=q(z.default.basename(o,z.default.extname(o))),v=n.sidebarPosition??nt(b),$=d.length>=2?d[0]:void 0,P=$?q($):void 0,V=d.length>=2&&/^index\.mdx?$/.test(h),Me=new Vt.default,Et=[],Te=/^(#{2,4})\s+(.+)$/gm;for(let R of l.matchAll(Te)){let yt=R[1].length,it=R[2].replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").trim(),W=J(it).trim(),xt=Me.slug(W);Et.push({level:yt,text:W,id:xt})}let _e=n.title?J(String(n.title)):D,ht=n.description?J(String(n.description)):"";!ht&&l&&(ht=$t(l.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").replace(/\s+/g," ")).trim().slice(0,160));let Oe=n.badge?J(String(n.badge)):void 0,At=n.icon?String(n.icon):void 0,Fe=Ke(l);return{route:{path:g,componentPath:o,filePath:p,title:_e,description:ht,sidebarPosition:v,headings:Et,locale:u,version:y,badge:Oe,icon:At,tab:x,_content:Fe,_rawContent:l},relativeDir:P,isGroupIndex:V,inferredTab:x,groupMeta:V?{title:n.groupTitle||n.title||(P?K(P):""),position:n.groupPosition??n.sidebarPosition??($?nt($):void 0),icon:At}:void 0,inferredGroupPosition:$?nt($):void 0}}function Ke(o){let t=o.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/\{[^\}]+\}/g,"").replace(/[_*`]/g,"").replace(/\s+/g," ");return $t(t).trim()}m();function Jt(o){return o.sort((t,e)=>!t.group&&!e.group?qt(t,e):t.group?e.group?t.group!==e.group?Xe(t,e):qt(t,e):1:-1)}function qt(o,t){return o.sidebarPosition!==void 0&&t.sidebarPosition!==void 0?o.sidebarPosition-t.sidebarPosition:o.sidebarPosition!==void 0?-1:t.sidebarPosition!==void 0?1:o.title.localeCompare(t.title)}function Xe(o,t){return o.groupPosition!==void 0&&t.groupPosition!==void 0?o.groupPosition-t.groupPosition:o.groupPosition!==void 0?-1:t.groupPosition!==void 0?1:(o.groupTitle||o.group).localeCompare(t.groupTitle||t.group)}var Ft=null,Y=new Map;async function tt(o,t,e="/docs",s=!0){let i=performance.now();_.load(),Y.clear(),(process.env.BOLTDOCS_FORCE_REPARSE==="true"||t?.i18n)&&_.invalidateAll();let r;!s&&Ft?r=Ft:(r=await(0,Kt.default)(["**/*.md","**/*.mdx"],{cwd:o,absolute:!0,suppressErrors:!0,followSymbolicLinks:!1}),Ft=r),_.pruneStale(new Set(r));let c=50,p=[],n=0;for(let a=0;a<r.length;a+=c){let g=r.slice(a,a+c),b=await Promise.all(g.map(async h=>{let D=_.get(h);if(D)return n++,D;let v=Wt(h,o,e,t);return _.set(h,v),v}));p.push(...b),a+c<r.length&&await new Promise(h=>setImmediate(h))}_.save();let l=new Map,d=[];for(let a of p)if(a.isGroupIndex&&a.relativeDir&&d.push(a),a.relativeDir){let g=l.get(a.relativeDir);g?(g.position===void 0&&a.inferredGroupPosition!==void 0&&(g.position=a.inferredGroupPosition),!g.icon&&a.route.icon&&(g.icon=a.route.icon)):(g={title:K(a.relativeDir),position:a.inferredGroupPosition,icon:a.route.icon},l.set(a.relativeDir,g))}for(let a of d){let g=l.get(a.relativeDir);a.groupMeta&&(g.title=a.groupMeta.title,a.groupMeta.position!==void 0&&(g.position=a.groupMeta.position),a.groupMeta.icon&&(g.icon=a.groupMeta.icon))}let u=new Array(p.length);for(let a=0;a<p.length;a++){let g=p[a],b=g.relativeDir,h=b?l.get(b):void 0;u[a]={...g.route,group:b,groupTitle:h?.title||(b?K(b):void 0),groupPosition:h?.position,groupIcon:h?.icon}}let y=u;if(t?.i18n){let a=Ze(u,t,e);y=[...u,...a]}let x=Jt(y),S=performance.now()-i;return console.log(`[boltdocs] Route generation: ${S.toFixed(2)}ms (${r.length} files, ${n} cache hits)`),x}function Ze(o,t,e){let s=t.i18n.defaultLocale,i=Object.keys(t.i18n.locales),r=[],c=new Map,p=[];for(let n of o){let l=n.locale||s;c.has(l)||c.set(l,new Set),c.get(l).add(n.path),l===s&&p.push(n)}for(let n of i){let l=c.get(n)||new Set;for(let d of p){let u=Qe(d.path,s,n,e,t);u!==d.path&&(l.has(u)||r.push({...d,path:u,locale:n}))}}return r}function Qe(o,t,e,s,i){let r=`${o}:${e}`,c=Y.get(r);if(c)return c;let p=s;if(i?.versions){let u=i.versions.prefix||"";for(let y of i.versions.versions){let x=u+y.path;if(o.startsWith(`${s}/${x}`)){p+="/"+x;break}if(o.startsWith(`${s}/${y.path}`)){p+="/"+y.path;break}}}let n=o.substring(p.length),l=`/${t}`;if(n.startsWith(l+"/"))n="/"+e+"/"+n.substring(l.length+1);else if(n===l)n="/"+e;else if(n==="/"||n==="")n="/"+e;else{let u=n.startsWith("/")?"":"/";n="/"+e+u+n}let d=p+n;return Y.size>2e3&&Y.clear(),Y.set(r,d),d}var ae=require("vite-plugin-image-optimizer");m();var ct=f(require("path")),Xt=f(require("fs")),Zt=require("vite");var lt=["boltdocs.config.js","boltdocs.config.mjs","boltdocs.config.ts"];async function O(o,t=process.cwd()){let e=t,s={docsDir:ct.default.resolve(o),theme:{title:"Boltdocs",description:"A Vite documentation framework",navbar:[{label:"Home",href:"/"},{label:"Documentation",href:"/docs"}],codeTheme:{light:"github-light",dark:"github-dark"},poweredBy:!0,breadcrumbs:!0}},i={};for(let n of lt){let l=ct.default.resolve(e,n);if(Xt.default.existsSync(l))try{let d=await(0,Zt.loadConfigFromFile)({command:"serve",mode:"development"},l,e);if(d){i=d.config;break}}catch(d){console.warn(`[boltdocs] Failed to load config from ${n}:`,d)}}let c={...{title:i.title,description:i.description,logo:i.logo,favicon:i.favicon,ogImage:i.ogImage,navbar:i.navbar,sidebar:i.sidebar,socialLinks:i.socialLinks,footer:i.footer,githubRepo:i.githubRepo,tabs:i.tabs,codeTheme:i.codeTheme,copyMarkdown:i.copyMarkdown,breadcrumbs:i.breadcrumbs,poweredBy:i.poweredBy,communityHelp:i.communityHelp,version:i.version,editLink:i.editLink},...i.theme||{}},p=Object.fromEntries(Object.entries(c).filter(([n,l])=>l!==void 0));return p.navbar&&(p.navbar=p.navbar.map(n=>({label:n.label||n.text||"",href:n.href||n.link||n.to||"",items:n.items?.map(l=>({label:l.label||l.text||"",href:l.href||l.link||l.to||""}))}))),{docsDir:ct.default.resolve(o),homePage:i.homePage,theme:{...s.theme,...p},i18n:i.i18n,versions:i.versions,siteUrl:i.siteUrl,plugins:i.plugins||[],external:i.external,integrations:i.integrations,robots:i.robots,vite:i.vite}}m();var j=f(require("fs")),F=f(require("path"));T();var oe=require("url"),ie=require("module");m();T();function Qt(o,t){let e=H(t.title),s=H(t.description);return o.replace(/<title>.*?<\/title>/,`<title>${e}</title>`).replace(/(<meta name="description" content=")[^"]*(")/,`$1${s}$2`).replace(/(<meta property="og:title" content=")[^"]*(")/,`$1${e}$2`).replace(/(<meta property="og:description" content=")[^"]*(")/,`$1${s}$2`).replace(/(<meta name="twitter:title" content=")[^"]*(")/,`$1${e}$2`).replace(/(<meta name="twitter:description" content=")[^"]*(")/,`$1${s}$2`)}m();T();function Yt(o,t){let e=t?.siteUrl?.replace(/\/$/,"")||"https://example.com",s=new Date().toISOString().split("T")[0],i=[{url:"/",priority:"1.0",changefreq:"daily"}];if(t?.i18n){let c=t.i18n.defaultLocale;for(let p of Object.keys(t.i18n.locales))p!==c&&i.push({url:`/${p}/`,priority:"1.0",changefreq:"daily"})}return`<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
"use strict";var Je=Object.create;var Mt=Object.defineProperty;var Ke=Object.getOwnPropertyDescriptor;var Xe=Object.getOwnPropertyNames;var Ye=Object.getPrototypeOf,Ze=Object.prototype.hasOwnProperty;var Tt=(o,t)=>()=>(o&&(t=o(o=0)),t);var Yt=(o,t)=>{for(var e in t)Mt(o,e,{get:t[e],enumerable:!0})},Qe=(o,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Xe(t))!Ze.call(o,i)&&i!==e&&Mt(o,i,{get:()=>t[i],enumerable:!(r=Ke(t,i))||r.enumerable});return o};var v=(o,t,e)=>(e=o!=null?Je(Ye(o)):{},Qe(t||!o||!o.__esModule?Mt(e,"default",{value:o,enumerable:!0}):e,o));var to,b,p=Tt(()=>{"use strict";to=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"?document.currentScript.src:new URL("main.js",document.baseURI).href,b=to()});function R(o){return o.replace(/\\/g,"/")}function Z(o){return o.replace(/^\d+\./,"")}function ut(o){let t=o.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function Qt(o){return/\.mdx?$/.test(o)}function gt(o){try{return _t.default.statSync(o).mtimeMs}catch{return 0}}function ft(o){let t=_t.default.readFileSync(o,"utf-8");try{let{data:e,content:r}=(0,Zt.default)(t);return{data:e,content:r}}catch{return{data:{},content:t}}}function E(o){return o.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function Ot(o){return E(o)}function te(o){let e=o.split("/").map(Z).join("/").replace(/\/$/,"");return e=e.replace(/\.mdx?$/,""),(e==="index"||e.endsWith("/index"))&&(e=e.replace(/index$/,"")),e.startsWith("/")||(e="/"+e),e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function Q(o){return Ft.default.sanitize(o)}function It(o){return Ft.default.sanitize(o,{ALLOWED_TAGS:[],KEEP_CONTENT:!0})}function tt(o){return o.charAt(0).toUpperCase()+o.slice(1)}function jt(o,t){return o?typeof o=="string"?o:t&&o[t]?o[t]:Object.values(o)[0]||"":""}var _t,Zt,Ft,T=Tt(()=>{"use strict";p();_t=v(require("fs")),Zt=v(require("gray-matter")),Ft=v(require("isomorphic-dompurify"))});var Nt={};Yt(Nt,{AssetCache:()=>At,FileCache:()=>et,TransformCache:()=>ot,flushCache:()=>so});async function so(){await L.flush()}var S,D,G,U,W,ht,eo,yt,Et,xo,zt,oo,io,no,ro,Lt,Ht,L,et,ot,At,it=Tt(()=>{"use strict";p();S=v(require("fs")),D=v(require("path")),G=v(require("crypto")),U=v(require("zlib")),W=require("util");T();ht=(0,W.promisify)(S.default.writeFile),eo=(0,W.promisify)(S.default.readFile),yt=(0,W.promisify)(S.default.mkdir),Et=(0,W.promisify)(S.default.rename),xo=(0,W.promisify)(S.default.unlink),zt=process.env.BOLTDOCS_CACHE_DIR||".boltdocs",oo="assets",io="shards",no=parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||"2000",10),ro=process.env.BOLTDOCS_CACHE_COMPRESS!=="0",Lt=class{constructor(t){this.limit=t}cache=new Map;get(t){let e=this.cache.get(t);return e!==void 0&&(this.cache.delete(t),this.cache.set(t,e)),e}set(t,e){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.limit){let r=this.cache.keys().next().value;r!==void 0&&this.cache.delete(r)}this.cache.set(t,e)}get size(){return this.cache.size}clear(){this.cache.clear()}},Ht=class{queue=Promise.resolve();pendingCount=0;add(t){this.pendingCount++,this.queue=this.queue.then(t).finally(()=>{this.pendingCount--})}async flush(){await this.queue}get pending(){return this.pendingCount}},L=new Ht,et=class{entries=new Map;cachePath=null;compress;constructor(t={}){if(this.compress=t.compress!==void 0?t.compress:ro,t.name){let e=t.root||process.cwd(),r=this.compress?"json.gz":"json";this.cachePath=D.default.resolve(e,zt,`${t.name}.${r}`)}}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&!(!this.cachePath||!S.default.existsSync(this.cachePath)))try{let t=S.default.readFileSync(this.cachePath);this.cachePath.endsWith(".gz")&&(t=U.default.gunzipSync(t));let e=JSON.parse(t.toString("utf-8"));this.entries=new Map(Object.entries(e))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1"||!this.cachePath)return;let t=Object.fromEntries(this.entries),e=JSON.stringify(t),r=this.cachePath,i=this.compress;L.add(async()=>{try{await yt(D.default.dirname(r),{recursive:!0});let s=Buffer.from(e);i&&(s=U.default.gzipSync(s));let c=`${r}.${G.default.randomBytes(4).toString("hex")}.tmp`;await ht(c,s),await Et(c,r)}catch{}})}get(t){let e=this.entries.get(t);return!e||gt(t)!==e.mtime?null:e.data}set(t,e){this.entries.set(t,{data:e,mtime:gt(t)})}isValid(t){let e=this.entries.get(t);return e?gt(t)===e.mtime:!1}invalidate(t){this.entries.delete(t)}invalidateAll(){this.entries.clear()}pruneStale(t){for(let e of this.entries.keys())t.has(e)||this.entries.delete(e)}get size(){return this.entries.size}async flush(){await L.flush()}},ot=class{index=new Map;memoryCache=new Lt(no);baseDir;shardsDir;indexPath;constructor(t,e=process.cwd()){this.baseDir=D.default.resolve(e,zt,`transform-${t}`),this.shardsDir=D.default.resolve(this.baseDir,io),this.indexPath=D.default.resolve(this.baseDir,"index.json")}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&S.default.existsSync(this.indexPath))try{let t=S.default.readFileSync(this.indexPath,"utf-8");this.index=new Map(Object.entries(JSON.parse(t)))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1")return;let t=JSON.stringify(Object.fromEntries(this.index)),e=this.indexPath;L.add(async()=>{await yt(D.default.dirname(e),{recursive:!0}),await ht(e,t)})}async getMany(t){let e=new Map,r=[];for(let i of t){let s=this.memoryCache.get(i);s?e.set(i,s):this.index.has(i)&&r.push(i)}if(r.length>0){let i=await Promise.all(r.map(async s=>{let c=this.index.get(s),u=D.default.resolve(this.shardsDir,`${c}.gz`);try{let n=await eo(u),l=U.default.gunzipSync(n).toString("utf-8");return this.memoryCache.set(s,l),{key:s,val:l}}catch{return null}}));for(let s of i)s&&e.set(s.key,s.val)}return e}get(t){let e=this.memoryCache.get(t);if(e)return e;let r=this.index.get(t);if(!r)return null;let i=D.default.resolve(this.shardsDir,`${r}.gz`);if(!S.default.existsSync(i))return null;try{let s=S.default.readFileSync(i),c=U.default.gunzipSync(s).toString("utf-8");return this.memoryCache.set(t,c),c}catch{return null}}set(t,e){let r=G.default.createHash("md5").update(e).digest("hex");this.index.set(t,r),this.memoryCache.set(t,e);let i=D.default.resolve(this.shardsDir,`${r}.gz`);L.add(async()=>{if(S.default.existsSync(i))return;await yt(this.shardsDir,{recursive:!0});let s=U.default.gzipSync(Buffer.from(e)),c=`${i}.${G.default.randomBytes(4).toString("hex")}.tmp`;await ht(c,s),await Et(c,i)})}get size(){return this.index.size}async flush(){await L.flush()}},At=class{assetsDir;constructor(t=process.cwd()){this.assetsDir=D.default.resolve(t,zt,oo)}getFileHash(t){return G.default.createHash("md5").update(S.default.readFileSync(t)).digest("hex")}get(t,e){if(!S.default.existsSync(t))return null;let r=this.getFileHash(t),i=this.getCachedPath(t,`${e}-${r}`);return S.default.existsSync(i)?i:null}set(t,e,r){let i=this.getFileHash(t),s=this.getCachedPath(t,`${e}-${i}`);L.add(async()=>{await yt(this.assetsDir,{recursive:!0});let c=`${s}.${G.default.randomBytes(4).toString("hex")}.tmp`;await ht(c,r),await Et(c,s)})}getCachedPath(t,e){let r=D.default.extname(t),i=D.default.basename(t,r),s=e.replace(/[^a-z0-9]/gi,"-").toLowerCase();return D.default.join(this.assetsDir,`${i}.${s}${r}`)}clear(){S.default.existsSync(this.assetsDir)&&S.default.rmSync(this.assetsDir,{recursive:!0,force:!0})}async flush(){await L.flush()}}});p();var Ue=v(require("cac"));p();p();var je=require("vite");p();var Fe=v(require("@vitejs/plugin-react")),Oe=v(require("@tailwindcss/vite"));p();var ye=require("vite");p();var re=v(require("fast-glob"));T();p();it();var O=new et({name:"routes"});function Ut(){O.invalidateAll()}function Gt(o){O.invalidate(o)}p();var V=v(require("path")),ee=v(require("github-slugger"));T();function oe(o,t,e,r){let i=decodeURIComponent(o),s=V.default.resolve(i),c=V.default.resolve(t),u=R(V.default.relative(c,s));if(u.startsWith("../")||u===".."||s.includes("\0"))throw new Error(`Security breach: File is outside of docs directory or contains null bytes: ${o}`);let{data:n,content:l}=ft(o),d=u.split("/"),f,w;if(r?.versions&&d.length>0){let k=d[0],Rt=r.versions.prefix||"",pt=r.versions.versions.find(Y=>{let kt=Rt+Y.path;return k===kt||k===Y.path});pt&&(w=pt.path,d=d.slice(1))}if(r?.i18n&&d.length>0){let k=d[0];r.i18n.locales[k]&&(f=k,d=d.slice(1))}let y;if(d.length>0){let k=d[0].match(/^\((.+)\)$/);k&&(y=k[1].toLowerCase(),d=d.slice(1))}let $=d.join("/"),a;n.permalink?a=n.permalink.startsWith("/")?n.permalink:`/${n.permalink}`:a=te($||"index.md");let m=e;w&&(m+="/"+w),f&&(m+="/"+f),m+=a==="/"?"":a,(!m||m==="")&&(m="/");let x=d[d.length-1],h=Z(x),B=Z(V.default.basename(o,V.default.extname(o))),g=n.sidebarPosition??ut(x),P=d.length>=2?d[0]:void 0,C=P?Z(P):void 0,j=d.length>=2&&/^index\.mdx?$/.test(h),N=new ee.default,X=[],Ge=/^(#{2,4})\s+(.+)$/gm;for(let k of l.matchAll(Ge)){let Rt=k[1].length,pt=k[2].replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").trim(),Y=Q(pt).trim(),kt=N.slug(Y);X.push({level:Rt,text:Y,id:kt})}let We=n.title?Q(String(n.title)):B,Dt=n.description?Q(String(n.description)):"";!Dt&&l&&(Dt=It(l.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").replace(/\s+/g," ")).trim().slice(0,160));let Ve=n.badge?Q(String(n.badge)):void 0,Xt=n.icon?String(n.icon):void 0,qe=ao(l);return{route:{path:m,componentPath:o,filePath:u,title:We,description:Dt,sidebarPosition:g,headings:X,locale:f,version:w,badge:Ve,icon:Xt,tab:y,_content:qe,_rawContent:l},relativeDir:C,isGroupIndex:j,inferredTab:y,groupMeta:j?{title:n.groupTitle||n.title||(C?tt(C):""),position:n.groupPosition??n.sidebarPosition??(P?ut(P):void 0),icon:Xt}:void 0,inferredGroupPosition:P?ut(P):void 0}}function ao(o){let t=o.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/\{[^\}]+\}/g,"").replace(/[_*`]/g,"").replace(/\s+/g," ");return It(t).trim()}p();function ne(o){return o.sort((t,e)=>!t.group&&!e.group?ie(t,e):t.group?e.group?t.group!==e.group?co(t,e):ie(t,e):1:-1)}function ie(o,t){return o.sidebarPosition!==void 0&&t.sidebarPosition!==void 0?o.sidebarPosition-t.sidebarPosition:o.sidebarPosition!==void 0?-1:t.sidebarPosition!==void 0?1:o.title.localeCompare(t.title)}function co(o,t){return o.groupPosition!==void 0&&t.groupPosition!==void 0?o.groupPosition-t.groupPosition:o.groupPosition!==void 0?-1:t.groupPosition!==void 0?1:(o.groupTitle||o.group).localeCompare(t.groupTitle||t.group)}var Wt=null,nt=new Map;async function q(o,t,e="/docs",r=!0){let i=performance.now();O.load(),nt.clear(),(process.env.BOLTDOCS_FORCE_REPARSE==="true"||t?.i18n)&&O.invalidateAll();let s;!r&&Wt?s=Wt:(s=await(0,re.default)(["**/*.md","**/*.mdx"],{cwd:o,absolute:!0,suppressErrors:!0,followSymbolicLinks:!1}),Wt=s),O.pruneStale(new Set(s));let c=50,u=[],n=0;for(let a=0;a<s.length;a+=c){let m=s.slice(a,a+c),x=await Promise.all(m.map(async h=>{let B=O.get(h);if(B)return n++,B;let g=oe(h,o,e,t);return O.set(h,g),g}));u.push(...x),a+c<s.length&&await new Promise(h=>setImmediate(h))}O.save();let l=new Map,d=[];for(let a of u)if(a.isGroupIndex&&a.relativeDir&&d.push(a),a.relativeDir){let m=l.get(a.relativeDir);m?(m.position===void 0&&a.inferredGroupPosition!==void 0&&(m.position=a.inferredGroupPosition),!m.icon&&a.route.icon&&(m.icon=a.route.icon)):(m={title:tt(a.relativeDir),position:a.inferredGroupPosition,icon:a.route.icon},l.set(a.relativeDir,m))}for(let a of d){let m=l.get(a.relativeDir);a.groupMeta&&(m.title=a.groupMeta.title,a.groupMeta.position!==void 0&&(m.position=a.groupMeta.position),a.groupMeta.icon&&(m.icon=a.groupMeta.icon))}let f=new Array(u.length);for(let a=0;a<u.length;a++){let m=u[a],x=m.relativeDir,h=x?l.get(x):void 0;f[a]={...m.route,group:x,groupTitle:h?.title||(x?tt(x):void 0),groupPosition:h?.position,groupIcon:h?.icon}}let w=f;if(t?.i18n){let a=lo(f,t,e);w=[...f,...a]}let y=ne(w),$=performance.now()-i;return console.log(`[boltdocs] Route generation: ${$.toFixed(2)}ms (${s.length} files, ${n} cache hits)`),y}function lo(o,t,e){let r=t.i18n.defaultLocale,i=Object.keys(t.i18n.locales),s=[],c=new Map,u=[];for(let n of o){let l=n.locale||r;c.has(l)||c.set(l,new Set),c.get(l).add(n.path),l===r&&u.push(n)}for(let n of i){let l=c.get(n)||new Set;for(let d of u){let f=mo(d.path,r,n,e,t);f!==d.path&&(l.has(f)||s.push({...d,path:f,locale:n}))}}return s}function mo(o,t,e,r,i){let s=`${o}:${e}`,c=nt.get(s);if(c)return c;let u=r;if(i?.versions){let f=i.versions.prefix||"";for(let w of i.versions.versions){let y=f+w.path;if(o.startsWith(`${r}/${y}`)){u+="/"+y;break}if(o.startsWith(`${r}/${w.path}`)){u+="/"+w.path;break}}}let n=o.substring(u.length),l=`/${t}`;if(n.startsWith(l+"/"))n="/"+e+"/"+n.substring(l.length+1);else if(n===l)n="/"+e;else if(n==="/"||n==="")n="/"+e;else{let f=n.startsWith("/")?"":"/";n="/"+e+f+n}let d=u+n;return nt.size>2e3&&nt.clear(),nt.set(s,d),d}var xe=require("vite-plugin-image-optimizer");p();var xt=v(require("path")),se=v(require("fs")),ae=require("vite");var vt=["boltdocs.config.js","boltdocs.config.mjs","boltdocs.config.ts"];async function M(o,t=process.cwd()){let e=t,r={docsDir:xt.default.resolve(o),theme:{title:"Boltdocs",description:"A Vite documentation framework",navbar:[{label:"Home",href:"/"},{label:"Documentation",href:"/docs"}],codeTheme:{light:"github-light",dark:"github-dark"},poweredBy:!0,breadcrumbs:!0}},i={};for(let n of vt){let l=xt.default.resolve(e,n);if(se.default.existsSync(l))try{let d=await(0,ae.loadConfigFromFile)({command:"serve",mode:"development"},l,e);if(d){i=d.config;break}}catch(d){console.warn(`[boltdocs] Failed to load config from ${n}:`,d)}}let c={...{title:i.title,description:i.description,logo:i.logo,favicon:i.favicon,ogImage:i.ogImage,navbar:i.navbar,sidebar:i.sidebar,socialLinks:i.socialLinks,footer:i.footer,githubRepo:i.githubRepo,tabs:i.tabs,codeTheme:i.codeTheme,copyMarkdown:i.copyMarkdown,breadcrumbs:i.breadcrumbs,poweredBy:i.poweredBy,communityHelp:i.communityHelp,version:i.version,editLink:i.editLink},...i.theme||{}},u=Object.fromEntries(Object.entries(c).filter(([n,l])=>l!==void 0));return u.navbar&&(u.navbar=u.navbar.map(n=>({label:n.label||n.text||"",href:n.href||n.link||n.to||"",items:n.items?.map(l=>({label:l.label||l.text||"",href:l.href||l.link||l.to||""}))}))),{docsDir:xt.default.resolve(o),homePage:i.homePage,theme:{...r.theme,...u},i18n:i.i18n,versions:i.versions,siteUrl:i.siteUrl,plugins:i.plugins||[],external:i.external,integrations:i.integrations,robots:i.robots,vite:i.vite}}p();var H=v(require("fs")),I=v(require("path"));T();var pe=require("url"),ue=require("module");p();T();function ce(o,t){let e=E(t.title),r=E(t.description);return o.replace(/<title>.*?<\/title>/,`<title>${e}</title>`).replace(/(<meta name="description" content=")[^"]*(")/,`$1${r}$2`).replace(/(<meta property="og:title" content=")[^"]*(")/,`$1${e}$2`).replace(/(<meta property="og:description" content=")[^"]*(")/,`$1${r}$2`).replace(/(<meta name="twitter:title" content=")[^"]*(")/,`$1${e}$2`).replace(/(<meta name="twitter:description" content=")[^"]*(")/,`$1${r}$2`)}p();T();function le(o,t){let e=t?.siteUrl?.replace(/\/$/,"")||"https://example.com",r=new Date().toISOString().split("T")[0],i=[{url:"/",priority:"1.0",changefreq:"daily"}];if(t?.i18n){let c=t.i18n.defaultLocale;for(let u of Object.keys(t.i18n.locales))u!==c&&i.push({url:`/${u}/`,priority:"1.0",changefreq:"daily"})}return`<?xml version="1.0" encoding="UTF-8"?>
|
|
3
3
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
4
4
|
${[...i,...o.map(c=>({url:c,priority:"0.8",changefreq:"weekly"}))].map(c=>` <url>
|
|
5
|
-
<loc>${
|
|
6
|
-
<lastmod>${
|
|
5
|
+
<loc>${Ot(e)}${Ot(c.url)}</loc>
|
|
6
|
+
<lastmod>${r}</lastmod>
|
|
7
7
|
<changefreq>${c.changefreq}</changefreq>
|
|
8
8
|
<priority>${c.priority}</priority>
|
|
9
9
|
</url>`).join(`
|
|
10
10
|
`)}
|
|
11
|
-
</urlset>`}
|
|
12
|
-
`,c.disallow){let
|
|
13
|
-
`}if(c.allow){let
|
|
14
|
-
`}
|
|
15
|
-
`}for(let c of i)
|
|
16
|
-
`;return
|
|
17
|
-
const ${
|
|
18
|
-
`),n=c.map(([
|
|
19
|
-
`),
|
|
11
|
+
</urlset>`}p();function bt(o){if(typeof o.robots=="string")return o.robots;let t=o.siteUrl?.replace(/\/$/,"")||"",e=o.robots||{},r=e.rules||[{userAgent:"*",allow:"/"}],i=e.sitemaps||(t?[`${t}/sitemap.xml`]:[]),s="";for(let c of r){if(s+=`User-agent: ${c.userAgent}
|
|
12
|
+
`,c.disallow){let u=Array.isArray(c.disallow)?c.disallow:[c.disallow];for(let n of u)s+=`Disallow: ${n}
|
|
13
|
+
`}if(c.allow){let u=Array.isArray(c.allow)?c.allow:[c.allow];for(let n of u)s+=`Allow: ${n}
|
|
14
|
+
`}s+=`
|
|
15
|
+
`}for(let c of i)s+=`Sitemap: ${c}
|
|
16
|
+
`;return s.trim()}var po=(0,pe.fileURLToPath)(b),de=I.default.dirname(po),me=(0,ue.createRequire)(b);async function Vt(o){let{docsDir:t,docsDirName:e,outDir:r,config:i}=o,s=await q(t,i),c=I.default.resolve(de,"../client/ssr.js");if(!H.default.existsSync(c)){console.error("[boltdocs] SSR module not found at",c,"- Did you build the core package?");return}let u=me("module"),n=u.prototype.require;u.prototype.require=function(a,...m){return a==="virtual:boltdocs-layout"?{__esModule:!0,default:function(h){try{let g=n.apply(this,[I.default.resolve(de,"../client/index.js")]).DefaultLayout||(({children:C})=>C);return n.apply(this,["react"]).createElement(g,h)}catch{return h.children}}}:n.apply(this,[a,...m])};let{render:l}=me(c);u.prototype.require=n;let d=I.default.join(r,"index.html");if(!H.default.existsSync(d)){console.warn("[boltdocs] No index.html found in outDir, skipping SSG.");return}let f=H.default.readFileSync(d,"utf-8");await Promise.all(s.map(async a=>{let m=jt(i?.theme?.title,a.locale)||"Boltdocs",x=jt(i?.theme?.description,a.locale)||"",h=`${a.title} | ${m}`,B=a.description||x,g={};g[`/${e}/${a.filePath}`]={default:()=>null};try{let P=await l({path:a.path,routes:s,config:i||{},docsDirName:e,modules:g,homePage:void 0}),C=ce(f,{title:E(h),description:E(B)}).replace("<!--app-html-->",P).replace('<div id="root"></div>',`<div id="root">${P}</div>`),j=I.default.join(r,a.path);await H.default.promises.mkdir(j,{recursive:!0}),await H.default.promises.writeFile(I.default.join(j,"index.html"),C,"utf-8")}catch(P){console.error(`[boltdocs] Error SSR rendering route ${a.path}:`,P&&(P.stack||P))}}));let w=le(s.map(a=>a.path),i);H.default.writeFileSync(I.default.join(r,"sitemap.xml"),w,"utf-8");let y=bt(i);H.default.writeFileSync(I.default.join(r,"robots.txt"),y,"utf-8"),console.log(`[boltdocs] Generated ${s.length} static pages + sitemap.xml + robots.txt`);let{flushCache:$}=await Promise.resolve().then(()=>(it(),Nt));await $()}T();var _=v(require("path"));p();T();var qt=v(require("path")),ge=v(require("fs"));function fe(o,t){let e=o.homePage?`import HomePage from '${R(o.homePage)}';`:"",r=qt.default.resolve(process.cwd(),"index.css"),i=ge.default.existsSync(r)?"import './index.css';":"",s=o.homePage?"homePage: HomePage,":"",c=t?.plugins?.flatMap(y=>Object.entries(y.components||{}))||[],u=c.map(([y,$])=>`import * as _comp_${y} from '${R($)}';
|
|
17
|
+
const ${y} = _comp_${y}.default || _comp_${y}['${y}'] || _comp_${y};`).join(`
|
|
18
|
+
`),n=c.map(([y])=>y).join(", "),l=qt.default.basename(o.docsDir||"docs"),d=Object.entries(t?.external||{}),f=d.map(([y,$],a)=>`import _ext_${a} from '${R($)}';`).join(`
|
|
19
|
+
`),w=d.length>0?`externalPages: { ${d.map(([y],$)=>`"${y}": _ext_${$}`).join(", ")} },`:"";return`
|
|
20
20
|
import { createBoltdocsApp as _createApp } from 'boltdocs/client';
|
|
21
21
|
import _routes from 'virtual:boltdocs-routes';
|
|
22
22
|
import _config from 'virtual:boltdocs-config';
|
|
23
23
|
import _user_mdx_components from 'virtual:boltdocs-mdx-components';
|
|
24
24
|
${i}
|
|
25
25
|
${e}
|
|
26
|
-
${p}
|
|
27
26
|
${u}
|
|
27
|
+
${f}
|
|
28
28
|
|
|
29
29
|
_createApp({
|
|
30
30
|
target: '#root',
|
|
@@ -33,11 +33,11 @@ _createApp({
|
|
|
33
33
|
config: _config,
|
|
34
34
|
modules: import.meta.glob('/${l}/**/*.{md,mdx}'),
|
|
35
35
|
hot: import.meta.hot,
|
|
36
|
-
${
|
|
37
|
-
${
|
|
36
|
+
${s}
|
|
37
|
+
${w}
|
|
38
38
|
components: { ${n}${n?", ":""} ...(_user_mdx_components || {}) },
|
|
39
39
|
});
|
|
40
|
-
`}
|
|
40
|
+
`}p();function wt(o){return`<!doctype html>
|
|
41
41
|
<html lang="en">
|
|
42
42
|
<head>
|
|
43
43
|
<meta charset="UTF-8" />
|
|
@@ -47,8 +47,8 @@ _createApp({
|
|
|
47
47
|
<body>
|
|
48
48
|
<div id="root"></div>
|
|
49
49
|
</body>
|
|
50
|
-
</html>`}function
|
|
51
|
-
`),
|
|
50
|
+
</html>`}function Jt(o,t){let e=t.theme,r=e?.title||"Boltdocs",i=e?.description||"",s=e?.favicon;!s&&e?.logo&&(typeof e.logo=="string"?s=e.logo:s=e.logo.light||e.logo.dark);let c=[s?`<link rel="icon" href="${s}">`:"",`<meta name="description" content="${i}">`,`<meta property="og:title" content="${r}">`,`<meta property="og:description" content="${i}">`,e?.ogImage?`<meta property="og:image" content="${e.ogImage}">`:"",'<meta property="og:type" content="website">','<meta name="twitter:card" content="summary_large_image">',`<meta name="twitter:title" content="${r}">`,`<meta name="twitter:description" content="${i}">`,e?.ogImage?`<meta name="twitter:image" content="${e.ogImage}">`:"",'<meta name="generator" content="Boltdocs">'].filter(Boolean).join(`
|
|
51
|
+
`),u=`
|
|
52
52
|
<script>
|
|
53
53
|
(function() {
|
|
54
54
|
try {
|
|
@@ -64,12 +64,16 @@ _createApp({
|
|
|
64
64
|
} catch (e) {}
|
|
65
65
|
})();
|
|
66
66
|
</script>
|
|
67
|
-
`;return o.includes("<title>")?o=o.replace(/<title>.*?<\/title>/,`<title>${
|
|
67
|
+
`;return o.includes("<title>")?o=o.replace(/<title>.*?<\/title>/,`<title>${r}</title>`):o=o.replace("</head>",` <title>${r}</title>
|
|
68
68
|
</head>`),o=o.replace("</head>",` ${c}
|
|
69
|
-
${
|
|
70
|
-
</body>`)),o}var
|
|
69
|
+
${u} </head>`),!o.includes("src/main")&&!o.includes("virtual:boltdocs-entry")&&(o=o.replace("</body>",` <script type="module">import "virtual:boltdocs-entry";</script>
|
|
70
|
+
</body>`)),o}p();function he(o){let t=[];for(let e of o)if(t.push({id:e.path,title:e.title,content:e._content||"",url:e.path,display:e.groupTitle?`${e.groupTitle} > ${e.title}`:e.title,locale:e.locale,version:e.version}),e.headings)for(let r of e.headings)t.push({id:`${e.path}#${r.id}`,title:r.text,content:`${r.text} in ${e.title}`,url:`${e.path}#${r.id}`,display:`${e.title} > ${r.text}`,locale:e.locale,version:e.version});return t}var Kt=v(require("fs"));p();function ve(o={},t){let e=_.default.resolve(process.cwd(),o.docsDir||"docs"),r=R(e),i=t,s,c=!1,u=i?.plugins?.flatMap(n=>n.vitePlugins||[])||[];return[{name:"vite-plugin-boltdocs",enforce:"pre",async config(n,l){c=l.command==="build";let d=n.envDir||process.cwd(),f=(0,ye.loadEnv)(l.mode,d,"");return Object.assign(process.env,f),i||(i=await M(e)),{optimizeDeps:{include:["react","react-dom"],exclude:["boltdocs","boltdocs/client","boltdocs/hooks","boltdocs/primitives","boltdocs/base-ui","boltdocs/mdx","boltdocs/integrations","boltdocs/client/hooks","boltdocs/client/primitives"]}}},configResolved(n){s=n},configureServer(n){n.middlewares.use((a,m,x)=>{if(a.url==="/robots.txt"){let h=bt(i);m.statusCode=200,m.setHeader("Content-Type","text/plain"),m.end(h);return}x()}),n.middlewares.use(async(a,m,x)=>{let h=a.url?.split("?")[0]||"/",B=a.headers.accept||"",g=h==="/"||h.startsWith("/docs")||i.i18n&&Object.keys(i.i18n.locales).some(C=>h.startsWith(`/${C}/docs`)||h===`/${C}`)||i.external&&Object.keys(i.external).some(C=>h.startsWith(C)),P=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(h);if(B.includes("text/html")&&!P&&g){let C=wt(i);C=Jt(C,i),C=await n.transformIndexHtml(a.url||"/",C),m.statusCode=200,m.setHeader("Content-Type","text/html"),m.end(C);return}x()});let l=vt.map(a=>_.default.resolve(process.cwd(),a)),d=["tsx","jsx"],f=d.map(a=>_.default.resolve(e,`layout.${a}`)),w=["tsx","ts","jsx","js"],y=w.map(a=>_.default.resolve(e,`mdx-components.${a}`));n.watcher.add([...l,...y,...f]);let $=async(a,m)=>{try{let x=R(a);if(vt.some(g=>x.endsWith(g))){n.restart();return}if(w.some(g=>x.endsWith(`mdx-components.${g}`))){let g=n.moduleGraph.getModuleById("\0virtual:boltdocs-mdx-components");g&&n.moduleGraph.invalidateModule(g),n.ws.send({type:"full-reload"});return}if(d.some(g=>x.endsWith(`layout.${g}`))){let g=n.moduleGraph.getModuleById("\0virtual:boltdocs-layout");g&&n.moduleGraph.invalidateModule(g),n.ws.send({type:"full-reload"});return}if(!x.startsWith(r)||!Qt(x))return;if(m==="add"||m==="unlink"){Ut(),i=await M(e);let g=n.moduleGraph.getModuleById("\0virtual:boltdocs-config");g&&n.moduleGraph.invalidateModule(g),n.ws.send({type:"custom",event:"boltdocs:config-update",data:{theme:i?.theme,integrations:i?.integrations,i18n:i?.i18n,versions:i?.versions,siteUrl:i?.siteUrl}})}else Gt(a);let h=await q(e,i,"/docs",m!=="change"),B=n.moduleGraph.getModuleById("\0virtual:boltdocs-routes");B&&n.moduleGraph.invalidateModule(B),n.ws.send({type:"custom",event:"boltdocs:routes-update",data:h})}catch(x){console.error(`[boltdocs] HMR error during ${m} event:`,x)}};n.watcher.on("add",a=>$(a,"add")),n.watcher.on("unlink",a=>$(a,"unlink")),n.watcher.on("change",a=>$(a,"change"))},resolveId(n){if(n==="virtual:boltdocs-routes"||n==="virtual:boltdocs-config"||n==="virtual:boltdocs-entry"||n==="virtual:boltdocs-mdx-components"||n==="virtual:boltdocs-layout"||n==="virtual:boltdocs-search")return"\0"+n},async load(n){if(n==="\0virtual:boltdocs-routes"){let l=await q(e,i);return`export default ${JSON.stringify(l,null,2)};`}if(n==="\0virtual:boltdocs-config"){let l={theme:i?.theme,integrations:i?.integrations,i18n:i?.i18n,versions:i?.versions,siteUrl:i?.siteUrl};return`export default ${JSON.stringify(l,null,2)};`}if(n==="\0virtual:boltdocs-entry")return fe(o,i);if(n==="\0virtual:boltdocs-mdx-components"){let l=["tsx","ts","jsx","js"],d=null;for(let f of l){let w=_.default.resolve(e,`mdx-components.${f}`);if(Kt.default.existsSync(w)){d=w;break}}if(d){let f=R(d);return`import * as components from '${f}';
|
|
71
71
|
const mdxComponents = components.default || components;
|
|
72
72
|
export default mdxComponents;
|
|
73
|
-
export * from '${
|
|
73
|
+
export * from '${f}';`}return"export default {};"}if(n==="\0virtual:boltdocs-layout"){let l=["tsx","jsx"],d=null;for(let f of l){let w=_.default.resolve(e,`layout.${f}`);if(Kt.default.existsSync(w)){d=w;break}}return d?`import UserLayout from '${R(d)}';
|
|
74
74
|
export default UserLayout;`:`import { DefaultLayout } from 'boltdocs/client';
|
|
75
|
-
export default DefaultLayout;`}},transformIndexHtml:{order:"pre",handler(n){return
|
|
75
|
+
export default DefaultLayout;`}if(n==="\0virtual:boltdocs-search"){let l=await q(e,i),d=he(l);return`export default ${JSON.stringify(d,null,2)};`}},transformIndexHtml:{order:"pre",handler(n){return Jt(n,i)}},async closeBundle(){if(!c)return;let n=s?.build?.outDir?_.default.resolve(s.root,s.build.outDir):_.default.resolve(process.cwd(),"dist"),l=_.default.basename(e||"docs");await Vt({docsDir:e,docsDirName:l,outDir:n,config:i});let{flushCache:d}=await Promise.resolve().then(()=>(it(),Nt));await d()}},(0,xe.ViteImageOptimizer)({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:"preset-default"}]}}),...u.filter(n=>!!n)]}p();var De=v(require("@mdx-js/rollup")),Re=v(require("remark-gfm")),ke=v(require("remark-frontmatter")),Me=v(require("rehype-slug")),Te=v(require("crypto"));p();it();var be="v3",J=new ot("mdx");p();var $e=require("unist-util-visit");p();var we=require("shiki"),$t=null;async function Pt(o){if($t)return $t;let t=typeof o=="object"?[o.light,o.dark]:[o??"github-dark"];return["github-light","github-dark"].forEach(e=>{t.includes(e)||t.push(e)}),$t=await(0,we.createHighlighter)({themes:t,langs:["tsx","jsx","ts","js","json","md","mdx","css","html","bash","sh","yaml","yml"]}),$t}function Pe(o){return async t=>{let e=o?.theme?.codeTheme??{light:"github-light",dark:"github-dark"},r=await Pt(e);(0,$e.visit)(t,["mdxJsxFlowElement","mdxJsxTextElement"],i=>{if(i.name!=="ComponentPreview")return;let s=i.attributes?.find(l=>l.name==="code"),c="";if(s){if(typeof s.value=="string")c=s.value;else if(s.value?.type==="mdxJsxAttributeValueExpression"){let l=s.value.value??"";c=l.match(/^[`'"](.+)[`'"]$/)?.[1]??l}}if(!c)return;let u=typeof e=="object"?{themes:{light:e.light,dark:e.dark},lang:"tsx"}:{theme:e,lang:"tsx"},n=r.codeToHtml(c,u);i.attributes=(i.attributes??[]).filter(l=>l.name!=="highlightedHtml"),i.attributes.push({type:"mdxJsxAttribute",name:"highlightedHtml",value:n})})}}p();var Ce=require("unist-util-visit");function Se(o){return async t=>{let e=o?.theme?.codeTheme||{light:"github-light",dark:"github-dark"},r=await Pt(e);(0,Ce.visit)(t,"element",i=>{if(i.tagName==="pre"&&i.children?.[0]?.tagName==="code"){let s=i.children[0],u=(s.properties?.className||[]).find(w=>w.startsWith("language-")),n=u?u.slice(9):"text",l=s.children[0]?.value||"",d={lang:n};typeof e=="object"?d.themes={light:e.light,dark:e.dark}:d.theme=e;let f=r.codeToHtml(l,d);i.properties.dataHighlighted="true",i.properties.highlightedHtml=f,i.children=[]}})}}var Be=!1,Ct=0,rt=0;function _e(o,t=De.default){let e=o?.plugins?.flatMap(s=>s.remarkPlugins||[])||[],r=o?.plugins?.flatMap(s=>s.rehypePlugins||[])||[],i=t({remarkPlugins:[Re.default,ke.default,[Pe,o],...e],rehypePlugins:[Me.default,[Se,o],...r],jsxRuntime:"automatic",providerImportSource:"@mdx-js/react"});return{...i,name:"vite-plugin-boltdocs-mdx",async buildStart(){Ct=0,rt=0,Be||(J.load(),Be=!0),i.buildStart&&await i.buildStart.call(this)},async transform(s,c,u){if(!c.endsWith(".md")&&!c.endsWith(".mdx"))return i.transform?.call(this,s,c,u);console.log(`[boltdocs] Transforming MDX: ${c}`),rt++;let n=Te.default.createHash("md5").update(s).digest("hex"),l=`${c}:${n}:${be}`,d=J.get(l);if(d)return Ct++,{code:d,map:null};let f=await i.transform.call(this,s,c,u);return f&&typeof f=="object"&&f.code&&J.set(l,f.code),f},async buildEnd(){rt>0&&console.log(`[boltdocs] MDX Cache Performance: ${Ct}/${rt} hits (${Math.round(Ct/rt*100)||0}%)`),J.save(),await J.flush(),i.buildEnd&&await i.buildEnd.call(this)}}}async function Ie(o){let t=o?.docsDir||"docs",e=await M(t),r={...o,homePage:o?.homePage||e.homePage};return[...ve(r,e),_e(e)]}async function st(o,t="development"){let e=await M("docs",o);return{root:o,mode:t,plugins:[(0,Fe.default)(),(0,Oe.default)(),await Ie({docsDir:e.docsDir,homePage:e.homePage})],...e.vite}}var lt={};Yt(lt,{colors:()=>K,error:()=>F,formatLog:()=>St,info:()=>at,success:()=>ct});p();var K={reset:"\x1B[0m",bold:"\x1B[1m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m"};function St(o,t=""){return`${t}${K.bold}[boltdocs]${K.reset} ${o}${K.reset}`}function at(o){console.log(St(o))}function F(o,t){console.error(St(o,K.red)),t&&console.error(t)}function ct(o){console.log(St(o,K.green))}async function Le(o=process.cwd()){try{let t=await st(o,"development"),e=await(0,je.createServer)(t);await e.listen(),e.printUrls(),e.bindCLIShortcuts({print:!0})}catch(t){F("Failed to start dev server:",t),process.exit(1)}}p();var Bt=require("vite");var He=v(require("path")),dt=v(require("fs"));async function Ae(o=process.cwd()){let t=!1,e=He.default.resolve(o,"index.html");try{if(!dt.default.existsSync(e)){let i=await M("docs",o);dt.default.writeFileSync(e,wt(i),"utf-8"),t=!0}let r=await st(o,"production");await(0,Bt.build)(r),ct("Build completed successfully.")}catch(r){F("Build failed:",r),process.exit(1)}finally{t&&dt.default.existsSync(e)&&dt.default.unlinkSync(e)}}async function Ee(o=process.cwd()){try{let t=await st(o,"production");(await(0,Bt.preview)(t)).printUrls()}catch(t){F("Failed to start preview server:",t),process.exit(1)}}p();var A=v(require("path")),mt=v(require("fs")),ze=v(require("fast-glob"));T();async function Ne(o=process.cwd()){let{colors:t}=lt;at(`${t.bold}Running documentation health check...${t.reset}
|
|
76
|
+
`);let e=performance.now();try{let r=await M("docs",o),i=A.default.resolve(o,"docs");mt.default.existsSync(i)||(F(`Documentation directory not found at ${i}`),process.exit(1));let s=await(0,ze.default)(["**/*.md","**/*.mdx"],{cwd:i,absolute:!0,suppressErrors:!0}),c=0,u=0,n=0,l=new Map,d=(y,$)=>{let a=A.default.relative(i,y),m=l.get(a);m||(m=[],l.set(a,m)),m.push($),$.level==="high"?c++:$.level==="warning"?u++:$.level==="low"&&n++},f="/docs";for(let y of s){let{data:$,content:a}=ft(y);$.title||d(y,{level:"warning",message:'Missing "title" in frontmatter.',suggestion:"Add `title: Your Title` to the YAML frontmatter at the top of the file."}),$.description||d(y,{level:"low",message:'Missing "description" in frontmatter.',suggestion:"Adding a description helps with SEO and search previews."});let m=/\[.*?\]\((.*?)\)/g,x=/<a\s+[^>]*href=["']([^"']+)["'][^>]*>/g,h=[...a.matchAll(m),...a.matchAll(x)];for(let B of h){let g=B[1];if(!g||g.startsWith("http")||g.startsWith("https")||g.startsWith("#")||g.startsWith("mailto:")||g.startsWith("tel:")||(g=g.split("#")[0],!g))continue;let P;if(g.startsWith("/")){let N=g;(g.startsWith(f+"/")||g===f)&&(N=g.substring(f.length)),P=A.default.join(i,N)}else P=A.default.resolve(A.default.dirname(y),g);let C=["",".md",".mdx","/index.md","/index.mdx"],j=!1;for(let N of C){let X=P+N;if(mt.default.existsSync(X)&&mt.default.statSync(X).isFile()){j=!0;break}}j||d(y,{level:"high",message:`Broken internal link: "${g}"`,suggestion:`Ensure the file exists at "${P}". If it's a directory, ensure it has an "index.md" or "index.mdx".`})}}if(r.i18n){let{defaultLocale:y,locales:$}=r.i18n,a=Object.keys($).filter(m=>m!==y);for(let m of s){let h=R(A.default.relative(i,m)).split("/");if(h[0]===y){let B=h.slice(1).join("/");for(let g of a){let P=[g,...h.slice(1)],C=A.default.join(i,...P);mt.default.existsSync(C)||d(m,{level:"warning",message:`Missing translation for locale "${g}"`,suggestion:`Create a translated version of this file at "${g}/${B}".`})}}}}if(l.size===0)ct(`All documentation files are healthy!
|
|
77
|
+
`);else{for(let[y,$]of l.entries()){console.log(`\u{1F4C4} ${t.bold}${y}${t.reset}`);let a=$.sort((m,x)=>{let h={high:1,warning:2,low:3};return h[m.level]-h[x.level]});for(let m of a){let x="",h="";m.level==="high"?(x="\u274C",h=t.red):m.level==="warning"?(x="\u26A0\uFE0F",h=t.yellow):(x="\u2139\uFE0F",h=t.cyan),console.log(` ${h}${x} ${m.level.toUpperCase()}:${t.reset} ${m.message}`),m.suggestion&&console.log(` ${t.gray}\u{1F4A1} Suggestion: ${m.suggestion}${t.reset}`)}console.log("")}console.log(`${t.bold}Summary:${t.reset}`),console.log(` ${t.red}${c} high-level errors${t.reset}`),console.log(` ${t.yellow}${u} warnings${t.reset}`),console.log(` ${t.cyan}${n} minor improvements${t.reset}
|
|
78
|
+
`),c>0&&F("HIGH ERROR: Fix these to ensure your documentation builds correctly."),(u>0||n>0)&&at("TIP: Address warnings and suggestions for premium quality docs."),console.log("")}let w=performance.now()-e;at(`Finished in ${w.toFixed(2)}ms
|
|
79
|
+
`),c>0&&process.exit(1)}catch(r){F("Failed to run doctor check:",r),process.exit(1)}}var z=(0,Ue.default)("boltdocs");z.command("[root]","Start development server").alias("dev").action(Le);z.command("build [root]","Build for production").action(Ae);z.command("preview [root]","Preview production build").action(Ee);z.command("doctor [root]","Check documentation health").action(Ne);z.help();z.version("2.0.0");z.parse();
|
package/dist/node/cli-entry.mjs
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{b as
|
|
2
|
+
import{b as L,c as ie,e as V,f as re,h as w,i as Y}from"../chunk-22NXDNP4.mjs";import{a as v,b as te,c as oe,d as n,e as D,i as G,q as se}from"../chunk-Y4RRHPXC.mjs";var S={};oe(S,{colors:()=>x,error:()=>a,formatLog:()=>W,info:()=>b,success:()=>A});function W(s,e=""){return`${e}${x.bold}[boltdocs]${x.reset} ${s}${x.reset}`}function b(s){console.log(W(s))}function a(s,e){console.error(W(s,x.red)),e&&console.error(e)}function A(s){console.log(W(s,x.green))}var x,C=v(()=>{"use strict";n();x={reset:"\x1B[0m",bold:"\x1B[1m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m"}});import{createServer as ne}from"vite";async function q(s=process.cwd()){try{let e=await w(s,"development"),l=await ne(e);await l.listen(),l.printUrls(),l.bindCLIShortcuts({print:!0})}catch(e){a("Failed to start dev server:",e),process.exit(1)}}var J=v(()=>{"use strict";n();Y();C()});import{build as le,preview as ce}from"vite";import ae from"path";import M from"fs";async function K(s=process.cwd()){let e=!1,l=ae.resolve(s,"index.html");try{if(!M.existsSync(l)){let f=await L("docs",s);M.writeFileSync(l,V(f),"utf-8"),e=!0}let g=await w(s,"production");await le(g),A("Build completed successfully.")}catch(g){a("Build failed:",g),process.exit(1)}finally{e&&M.existsSync(l)&&M.unlinkSync(l)}}async function N(s=process.cwd()){try{let e=await w(s,"production");(await ce(e)).printUrls()}catch(e){a("Failed to start preview server:",e),process.exit(1)}}var Q=v(()=>{"use strict";n();Y();re();C()});import u from"path";import R from"fs";import fe from"fast-glob";async function X(s=process.cwd()){let{colors:e}=S;b(`${e.bold}Running documentation health check...${e.reset}
|
|
3
|
+
`);let l=performance.now();try{let g=await L("docs",s),f=u.resolve(s,"docs");R.existsSync(f)||(a(`Documentation directory not found at ${f}`),process.exit(1));let T=await fe(["**/*.md","**/*.mdx"],{cwd:f,absolute:!0,suppressErrors:!0}),k=0,B=0,j=0,P=new Map,F=(r,c)=>{let m=u.relative(f,r),t=P.get(m);t||(t=[],P.set(m,t)),t.push(c),c.level==="high"?k++:c.level==="warning"?B++:c.level==="low"&&j++},E="/docs";for(let r of T){let{data:c,content:m}=G(r);c.title||F(r,{level:"warning",message:'Missing "title" in frontmatter.',suggestion:"Add `title: Your Title` to the YAML frontmatter at the top of the file."}),c.description||F(r,{level:"low",message:'Missing "description" in frontmatter.',suggestion:"Adding a description helps with SEO and search previews."});let t=/\[.*?\]\((.*?)\)/g,d=/<a\s+[^>]*href=["']([^"']+)["'][^>]*>/g,i=[...m.matchAll(t),...m.matchAll(d)];for(let H of i){let o=H[1];if(!o||o.startsWith("http")||o.startsWith("https")||o.startsWith("#")||o.startsWith("mailto:")||o.startsWith("tel:")||(o=o.split("#")[0],!o))continue;let h;if(o.startsWith("/")){let I=o;(o.startsWith(E+"/")||o===E)&&(I=o.substring(E.length)),h=u.join(f,I)}else h=u.resolve(u.dirname(r),o);let O=["",".md",".mdx","/index.md","/index.mdx"],U=!1;for(let I of O){let z=h+I;if(R.existsSync(z)&&R.statSync(z).isFile()){U=!0;break}}U||F(r,{level:"high",message:`Broken internal link: "${o}"`,suggestion:`Ensure the file exists at "${h}". If it's a directory, ensure it has an "index.md" or "index.mdx".`})}}if(g.i18n){let{defaultLocale:r,locales:c}=g.i18n,m=Object.keys(c).filter(t=>t!==r);for(let t of T){let i=D(u.relative(f,t)).split("/");if(i[0]===r){let H=i.slice(1).join("/");for(let o of m){let h=[o,...i.slice(1)],O=u.join(f,...h);R.existsSync(O)||F(t,{level:"warning",message:`Missing translation for locale "${o}"`,suggestion:`Create a translated version of this file at "${o}/${H}".`})}}}}if(P.size===0)A(`All documentation files are healthy!
|
|
4
|
+
`);else{for(let[r,c]of P.entries()){console.log(`\u{1F4C4} ${e.bold}${r}${e.reset}`);let m=c.sort((t,d)=>{let i={high:1,warning:2,low:3};return i[t.level]-i[d.level]});for(let t of m){let d="",i="";t.level==="high"?(d="\u274C",i=e.red):t.level==="warning"?(d="\u26A0\uFE0F",i=e.yellow):(d="\u2139\uFE0F",i=e.cyan),console.log(` ${i}${d} ${t.level.toUpperCase()}:${e.reset} ${t.message}`),t.suggestion&&console.log(` ${e.gray}\u{1F4A1} Suggestion: ${t.suggestion}${e.reset}`)}console.log("")}console.log(`${e.bold}Summary:${e.reset}`),console.log(` ${e.red}${k} high-level errors${e.reset}`),console.log(` ${e.yellow}${B} warnings${e.reset}`),console.log(` ${e.cyan}${j} minor improvements${e.reset}
|
|
5
|
+
`),k>0&&a("HIGH ERROR: Fix these to ensure your documentation builds correctly."),(B>0||j>0)&&b("TIP: Address warnings and suggestions for premium quality docs."),console.log("")}let ee=performance.now()-l;b(`Finished in ${ee.toFixed(2)}ms
|
|
6
|
+
`),k>0&&process.exit(1)}catch(g){a("Failed to run doctor check:",g),process.exit(1)}}var Z=v(()=>{"use strict";n();ie();se();C()});var _=v(()=>{"use strict";n();J();Q();Z();C()});import me from"cac";var de=te(()=>{n();_();var p=me("boltdocs");p.command("[root]","Start development server").alias("dev").action(q);p.command("build [root]","Build for production").action(K);p.command("preview [root]","Preview production build").action(N);p.command("doctor [root]","Check documentation health").action(X);p.help();p.version("2.0.0");p.parse()});export default de();
|