boltdocs 2.7.0 → 2.7.1
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/dist/client/index.cjs +1 -1
- package/dist/client/index.d.cts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +1 -1
- package/dist/node/cli-entry.cjs +1 -1
- package/dist/node/cli-entry.mjs +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/{node-CinkUtxV.cjs → node-BzKYJJuY.cjs} +2 -3
- package/dist/{node-C2nWXElP.mjs → node-m6fKXXVs.mjs} +2 -3
- package/dist/{package-HegMOTL_.mjs → package-2TVh81ZC.mjs} +1 -1
- package/dist/{package-BMYLDBBP.cjs → package-D1O_gJub.cjs} +1 -1
- package/package.json +1 -1
- package/src/client/ssg/index.ts +1 -0
package/dist/client/index.cjs
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../icons-dev-rzdz6Lf3.cjs`),t=require(`../docs-layout-BlDhcQRv.cjs`),n=require(`../image-DIGjCPe6.cjs`),r=require(`../search-dialog-D26rUnJ_.cjs`),i=require(`../search-dialog-BACuzoVX.cjs`),a=require(`../mdx-hpErbRUe.cjs`);let o=require(`react-router-dom`),s=require(`react`),c=require(`react/jsx-runtime`),l=require(`lucide-react`);l=e.O(l);let u=require(`react-aria-components`),d=require(`react-helmet-async`);d=e.O(d);let f=require(`virtual:boltdocs-mdx-components`);f=e.O(f);let p=require(`virtual:boltdocs-layout`);p=e.O(p);const m=Symbol.for(`__BDOCS_MDX_COMPONENTS_CONTEXT__`),h=Symbol.for(`__BDOCS_MDX_COMPONENTS_INSTANCE__`),g=globalThis[m]||(globalThis[m]=(0,s.createContext)({}));function _(){let e=(0,s.use)(g);return(!e||Object.keys(e).length===0)&&globalThis[h]?globalThis[h]:e}function v({components:e,children:t}){let n=(0,s.useMemo)(()=>{let t={},n={};return Object.entries(e).forEach(([e,r])=>{if(e.startsWith(`Frontmatter_`)){let t=e.slice(12);n[t]=r}else t[e]=r}),t.Frontmatter=n,t},[e]);return typeof globalThis<`u`&&(globalThis[h]=n),(0,c.jsx)(g.Provider,{value:n,children:t})}function y(){let{currentRoute:t}=e.x(),n=[];return t&&(t.groupTitle&&n.push({label:t.groupTitle}),n.push({label:t.title,href:t.path})),{crumbs:n,activeRoute:t}}function b(){let{crumbs:n,activeRoute:r}=y();return n.length===0?null:(0,c.jsxs)(t.N.Root,{className:`gap-2 text-xs sm:text-sm font-medium`,children:[(0,c.jsx)(t.N.Item,{children:(0,c.jsx)(t.N.Link,{href:`/`,className:`text-muted hover:text-body transition-colors flex items-center`,children:(0,c.jsx)(l.Home,{size:14})})}),n.map((n,i)=>{let a=n.href===r?.path;return(0,c.jsxs)(t.N.Item,{className:`gap-2`,children:[(0,c.jsx)(t.N.Separator,{className:`text-muted/40`}),(0,c.jsx)(t.N.Link,{href:n.href,className:e.y(`transition-colors`,a?`text-body font-semibold cursor-default pointer-events-none`:`text-muted hover:text-body`),children:n.label})]},`crumb-${n.href}-${n.label}-${i}`)})]})}const x=e=>{let[t,n]=(0,s.useState)(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},handleOpenRaw:()=>{let t=new Blob([e],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t);window.open(n,`_blank`)}}};function S({content:n,mdxRaw:r}){let i=r||n||``,{copied:a,handleCopy:o,handleOpenRaw:s}=x(i);return i?(0,c.jsx)(`div`,{className:`relative inline-flex z-100 shrink-0 w-max`,children:(0,c.jsxs)(t.j,{className:`rounded-xl border border-subtle bg-surface transition-all duration-300 hover:border-primary-500/50 group overflow-hidden`,children:[(0,c.jsx)(t.M,{onPress:o,className:e.y(`md:hidden flex items-center justify-center w-8 h-8 bg-transparent outline-none select-none cursor-pointer border-none`,`text-muted transition-all duration-300 hover:bg-primary-500/5 hover:text-body`,a&&`text-emerald-500 hover:bg-emerald-500/5`),"aria-label":a?`Copied!`:`Copy Markdown`,children:a?(0,c.jsx)(l.Check,{size:14}):(0,c.jsx)(l.Copy,{size:14})}),(0,c.jsxs)(t.M,{onPress:o,className:e.y(`hidden md:flex items-center gap-2 px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 shrink-0 outline-none select-none cursor-pointer border-none`,`text-body transition-all duration-300 hover:bg-primary-500/5`,a&&`text-emerald-500 hover:bg-emerald-500/5`),children:[a?(0,c.jsx)(l.Check,{size:16}):(0,c.jsx)(l.Copy,{size:16}),a?`Copied!`:`Copy Markdown`]}),(0,c.jsxs)(t.k.Trigger,{placement:`bottom end`,children:[(0,c.jsx)(t.M,{className:e.y(`flex items-center justify-center px-2.5 md:px-3.5 h-8 md:h-9 border-none border-l border-subtle/50 text-muted rounded-none bg-transparent shrink-0 outline-none select-none cursor-pointer`,`transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500`),children:(0,c.jsx)(l.ChevronDown,{size:14})}),(0,c.jsxs)(t.k.Root,{className:`w-52 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[(0,c.jsxs)(t.k.Item,{onAction:o,className:`flex items-center px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[(0,c.jsx)(l.Copy,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Copy Markdown`})]}),(0,c.jsxs)(t.k.Item,{onAction:s,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[(0,c.jsx)(l.ExternalLink,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),(0,c.jsx)(`span`,{className:`ml-2`,children:`View as Markdown`})]})]})]})]})}):null}function C({children:e,fallback:n}){return(0,c.jsx)(t.D,{fallback:n,children:e})}async function w(e,t,n=`https://api.github.com`){let r=new Headers;t&&r.append(`authorization`,t);let i=await(await fetch(`${n}/repos/${e}`,{headers:r})).json();return i.stargazers_count===void 0?`0`:T(i.stargazers_count)}const T=e=>Intl.NumberFormat(`en`,{notation:`compact`,compactDisplay:`short`}).format(e);function E({repo:t}){let[n,r]=(0,s.useState)(null);return(0,s.useEffect)(()=>{t&&w(t).then(e=>r(e)).catch(()=>r(`0`))},[t]),(0,c.jsxs)(`a`,{href:`https://github.com/${t}`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-muted dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 hover:border-primary-500/50 hover:text-body select-none outline-none`,children:[(0,c.jsx)(e.s,{className:`h-4 w-4 text-body`}),n!==null&&(0,c.jsxs)(`span`,{className:`tabular-nums font-medium`,children:[n,` stars`]})]})}function D(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function O(){let t=e.D(),{theme:r,resolvedTheme:i}=n.l(),a=(0,o.useLocation)(),{currentLocale:c}=e.x(),l=t.theme||{},u=D(l.title,c)||`Boltdocs`,d=l.navbar||[],f=l.socialLinks||[],p=l.githubRepo,m=(0,s.useMemo)(()=>d.map(e=>{let n=e.href||e.to||e.link||``,r=e=>{let n=a.pathname;if(n===e)return!0;if(!e||e===`/`)return n===`/`;let r=e=>{let n=e.split(`/`).filter(Boolean),r=0;return t.i18n?.locales&&n[r]&&t.i18n.locales[n[r]]&&r++,t.versions?.versions&&n[r]&&t.versions.versions.some(e=>e.path===n[r])&&r++,n.slice(r)},i=r(e),o=r(n);return i.length===0?o.length===0:o.length<i.length?!1:i.every((e,t)=>o[t]===e)},i=(e=>{if(!(!e||e.length===0))return e.map(e=>{let t=e.href||e.to||e.link||``;return{label:D(e.label||e.text,c),href:t,active:r(t),to:t.startsWith(`http`)||t.startsWith(`//`)?`external`:void 0}})})(e.items);return{label:D(e.label||e.text,c),href:n,active:r(n),to:n.startsWith(`http`)||n.startsWith(`//`)?`external`:void 0,items:i}}),[d,a.pathname,c,t]),h=l.logo;return{links:m,title:u,logo:h?typeof h==`string`?h:i===`dark`?h.dark:h.light:null,logoProps:{alt:(h&&typeof h==`object`?h.alt:void 0)||u,width:h&&typeof h==`object`?h.width:void 0,height:h&&typeof h==`object`?h.height:void 0},github:p?`https://github.com/${p}`:null,social:f,config:t,theme:r}}function ee(){let{theme:e,setTheme:r}=n.l(),[i,a]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{a(!0)},[]),!i)return(0,c.jsx)(`div`,{className:`h-9 w-9`});let o=e===`system`?l.Monitor:e===`dark`?l.Moon:l.Sun;return(0,c.jsxs)(t.k.Trigger,{placement:`bottom right`,children:[(0,c.jsx)(u.Button,{className:`flex h-9 w-9 items-center justify-center rounded-xl text-muted transition-colors hover:bg-surface hover:text-body outline-none border-none bg-transparent cursor-pointer`,"aria-label":`Selection theme`,children:(0,c.jsx)(o,{size:20,className:`animate-in fade-in zoom-in duration-300`})}),(0,c.jsxs)(t.k.Root,{selectionMode:`single`,selectedKeys:[e],onSelectionChange:e=>{let t=Array.from(e)[0];r(t)},className:`w-36 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[(0,c.jsxs)(t.k.Item,{id:`light`,className:`group flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(l.Sun,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Light`})]}),(0,c.jsxs)(t.k.Item,{id:`dark`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(l.Moon,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Dark`})]}),(0,c.jsxs)(t.k.Item,{id:`system`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(l.Monitor,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`System`})]})]})]})}function k({className:t}){let{theme:r,setTheme:i}=n.l(),[a,o]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{o(!0)},[]),!a)return(0,c.jsx)(`div`,{className:e.y(`h-10 w-full bg-surface rounded-xl animate-pulse`,t)});let u=r===`dark`;return(0,c.jsxs)(`div`,{className:e.y(`flex p-1 bg-surface border border-subtle rounded-xl relative w-full h-11`,t),children:[(0,c.jsx)(`div`,{className:e.y(`absolute inset-y-1 w-[calc(50%-4px)] bg-main border border-subtle rounded-lg transition-all duration-300 ease-out shadow-xs`,u?`translate-x-full`:`translate-x-0`)}),(0,c.jsx)(`button`,{onClick:()=>i(`light`),className:e.y(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,u?`text-muted hover:text-body`:`text-body font-semibold`),"aria-label":`Light mode`,children:(0,c.jsx)(l.Sun,{size:18})}),(0,c.jsx)(`button`,{onClick:()=>i(`dark`),className:e.y(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,u?`text-body font-semibold`:`text-muted hover:text-body`),"aria-label":`Dark mode`,children:(0,c.jsx)(l.Moon,{size:18})})]})}function A(t=[],n=[]){let r=(0,o.useLocation)(),i=(0,s.useRef)([]),[a,c]=(0,s.useState)({opacity:0,transform:`translateX(0) scaleX(0)`,width:0}),l=e.S(r.pathname),u=n.find(t=>e.S(t.path)===l)?.tab?.toLowerCase(),d=t.findIndex(e=>e.id.toLowerCase()===u),f=d===-1?0:d;return(0,s.useEffect)(()=>{let e=i.current[f];e&&c({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[f,t.length,r.pathname]),{tabs:t,activeIndex:f,indicatorStyle:a,tabRefs:i,activeTabId:u}}function te({tabs:n,routes:r}){let{currentLocale:i}=e.x(),{indicatorStyle:a,tabRefs:o,activeIndex:u}=A(n,r);(0,s.useEffect)(()=>{let e=o.current[u];e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[u]);let d=e=>{if(!e)return null;if(e.trim().startsWith(`<svg`))return(0,c.jsx)(`span`,{className:`h-4 w-4`,dangerouslySetInnerHTML:{__html:e}});let t=l[e];return t?(0,c.jsx)(t,{size:16}):(0,c.jsx)(`img`,{src:e,alt:``,className:`h-4 w-4 object-contain`})};return(0,c.jsx)(`div`,{className:`mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6 select-none`,children:(0,c.jsxs)(t.E.List,{className:`border-none py-0 scrollbar-hide relative flex flex-row items-center`,children:[n.map((t,n)=>{let a=n===u,s=r.find(e=>e.tab&&e.tab.toLowerCase()===t.id.toLowerCase());return(0,c.jsxs)(e._,{href:s?s.path:`#`,ref:e=>{o.current[n]=e},className:`relative flex items-center gap-2 px-4 py-3.5 text-sm font-semibold transition-colors duration-300 outline-none whitespace-nowrap ${a?`text-primary-500`:`text-muted hover:text-body`}`,children:[d(t.icon),(0,c.jsx)(`span`,{children:D(t.text,i)})]},t.id)}),(0,c.jsx)(t.E.Indicator,{style:a,className:`h-0.5 bg-primary-500 rounded-full transition-all duration-300`})]})})}function j(e,t,n){let r=e;return t&&(r===t||r.startsWith(t+`/`))&&(r=r===t?`index.md`:r.slice(t.length+1)),n&&(r===n||r.startsWith(n+`/`))&&(r=r===n?`index.md`:r.slice(n.length+1)),r}function M(){let t=(0,o.useNavigate)(),n=e.D(),{allRoutes:r,currentRoute:i,currentVersion:a,currentLocale:c}=e.x(),l=n.versions,{setVersion:u}=e.w();return{currentVersion:a,currentVersionLabel:l?.versions?.find?.(e=>e.path===a)?.label||a,availableVersions:(0,s.useMemo)(()=>l?l.versions.map(e=>({key:e.path,label:e.label,value:e.path,isCurrent:e.path===a})):[],[l,a]),handleVersionChange:e=>{if(!l||e===a)return;u(e);let o=`${(n.base||`/docs`).replace(/\/$/,``)}/${e}${c?`/${c}`:``}`;if(i){let t=j(i.filePath,i.version,i.locale),a=r.find(r=>j(r.filePath,r.version,r.locale)===t&&(r.version||l.defaultVersion)===e&&(!n.i18n||(r.locale||n.i18n.defaultLocale)===c));if(a)o=a.path;else{let t=r.find(t=>j(t.filePath,t.version,t.locale)===`index.md`&&(t.version||l.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===c));t&&(o=t.path)}}else{let t=r.find(t=>(t.version||l.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===c));t&&(o=t.path)}t(o)}}}function N(){let t=(0,o.useNavigate)(),n=e.D(),{allRoutes:r,currentRoute:i,currentLocale:a,currentVersion:c}=e.x(),l=n.i18n,{setLocale:u}=e.w(),d=e=>{if(!l||e===a)return;u(e);let o=n.base||`/`,s=o===`/`?``:o.replace(/\/$/,``),d=!!i?.filePath,f=``;if(i)if(d){let t=j(i.filePath,i.version,i.locale),n=r.find(n=>j(n.filePath,n.version,n.locale)===t&&(n.locale||l.defaultLocale)===e&&n.version===i.version);if(n)f=n.path;else{let t=r.find(t=>j(t.filePath,t.version,t.locale)===`index.md`&&(t.locale||l.defaultLocale)===e&&t.version===i.version);f=t?t.path:`${s}${i.version?`/${i.version}`:``}${e===l.defaultLocale?``:`/${e}`}`||`/`}}else{let t=i.path,n=t.split(`/`).filter(Boolean);if(n.length>0&&(Array.isArray(l.locales)?l.locales.includes(n[0]):l.locales[n[0]])&&(n.shift(),t=`/`+n.join(`/`)),e===l.defaultLocale)f=t===``?`/`:t;else{let n=t.startsWith(`/`)?t:`/${t}`;f=`/${e}${n===`/`?``:n}`}}else{let t=r.find(t=>(t.locale||l.defaultLocale)===e&&(t.version||n.versions?.defaultVersion)===(c||n.versions?.defaultVersion));if(t)f=t.path;else{let t=c&&c!==n.versions?.defaultVersion?`/${c}`:``;f=e===l.defaultLocale?`${s}${t}`:`${s}${t}/${e}`}}(!f||f===``)&&(f=`/`),f=f.replace(/\/+/g,`/`),t(f)},f=l?.locales,p=f?Array.isArray(f)?a:f[a]:void 0;return{currentLocale:a,currentLocaleLabel:l?.localeConfigs?.[a]?.label||p||a,availableLocales:(0,s.useMemo)(()=>l?Array.isArray(l.locales)?l.locales.map(e=>({key:e,label:l?.localeConfigs?.[e]?.label||e,value:e,isCurrent:e===a})):Object.entries(l.locales).map(([e,t])=>({key:e,label:l?.localeConfigs?.[e]?.label||t,value:e,isCurrent:e===a})):[],[l,a]),handleLocaleChange:d}}function P({className:n}){let{currentVersionLabel:r,availableVersions:i,handleVersionChange:a}=M();return i.length===0?null:(0,c.jsxs)(t.k.Trigger,{children:[(0,c.jsxs)(t.M,{className:e.y(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,n),children:[(0,c.jsx)(`span`,{className:`font-semibold text-[0.8125rem]`,children:r}),(0,c.jsx)(l.ChevronDown,{className:`w-3.5 h-3.5 text-muted/60`})]}),(0,c.jsx)(t.k.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:(0,c.jsx)(t.k.Section,{items:i,children:e=>(0,c.jsx)(t.k.Item,{onPress:()=>a(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body hover:bg-primary-50/50 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:e.label},`${e.value??``}`)})})]})}function F({className:n}){let{currentLocale:r,availableLocales:i,handleLocaleChange:a}=N();return i.length===0?null:(0,c.jsxs)(t.k.Trigger,{children:[(0,c.jsxs)(t.M,{className:e.y(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,n),children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,c.jsx)(l.Languages,{className:`w-3.5 h-3.5 text-primary-500`}),(0,c.jsx)(`span`,{className:`font-bold text-[0.75rem] uppercase opacity-90`,children:r||`en`})]}),(0,c.jsx)(l.ChevronDown,{className:`w-3.5 h-3.5 text-muted/60`})]}),(0,c.jsx)(t.k.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:(0,c.jsx)(t.k.Section,{items:i,children:e=>(0,c.jsx)(t.k.Item,{onPress:()=>a(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:(0,c.jsx)(`span`,{children:e.label})},`${e.value??``}`)})})]})}const I=(0,s.lazy)(()=>Promise.resolve().then(()=>require(`../search-dialog-CGyrozZE.cjs`)).then(e=>({default:e.SearchDialog})));function L(){let{links:n,title:i,logo:a,logoProps:u,github:d,social:f,config:p}=O(),{routes:m,allRoutes:h,currentRoute:g,currentVersion:_,currentLocale:v}=e.x(),{pathname:y}=(0,o.useLocation)(),{isSidebarOpen:b,toggleSidebar:x}=t.T(),[S,C]=(0,s.useState)(!1),w=p.theme||{},T=!!g?.filePath,D=w?.tabs&&w.tabs.length>0;return(0,c.jsxs)(r.n.Root,{className:e.y(`border-b border-subtle bg-main/80 backdrop-blur-md`,D&&`border-b-0`),children:[(0,c.jsxs)(r.n.Content,{children:[(0,c.jsxs)(r.n.Left,{children:[T&&(0,c.jsx)(t.M,{onPress:x,className:`mr-2 lg:hidden p-1.5 h-8 w-8 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 transition-colors`,"aria-label":b?`Close sidebar`:`Open sidebar`,children:b?(0,c.jsx)(l.X,{className:`w-5 h-5 text-body`}):(0,c.jsx)(l.Menu,{className:`w-5 h-5 text-body`})}),a&&(0,c.jsx)(r.n.Logo,{src:a,alt:u?.alt||i,width:u?.width??24,height:u?.height??24,href:`site:/`}),(0,c.jsx)(r.n.Title,{href:`site:/`,children:i}),(0,c.jsx)(`div`,{className:`hidden sm:block`,children:p.versions&&_&&(0,c.jsx)(P,{})})]}),(0,c.jsx)(r.n.Center,{children:(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(`div`,{className:`h-9 w-32 animate-pulse rounded-md bg-surface`}),children:(0,c.jsx)(I,{routes:m||[]})})}),(0,c.jsxs)(r.n.Right,{children:[(0,c.jsx)(s.Suspense,{fallback:null,children:(0,c.jsx)(`div`,{className:`lg:hidden`,children:(0,c.jsx)(I,{routes:m||[]})})}),(0,c.jsx)(r.n.Links,{children:n.map(e=>(0,c.jsx)(ne,{link:e},e.href))}),(0,c.jsxs)(`div`,{className:`hidden sm:flex items-center gap-2`,children:[p.i18n&&v&&(0,c.jsx)(F,{}),(0,c.jsx)(r.n.Split,{className:`bg-subtle`})]}),(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(ee,{})}),d&&(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(E,{repo:w?.githubRepo??``})}),f.length>0&&(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(r.n.Split,{className:`bg-subtle`})}),(0,c.jsx)(`div`,{className:`hidden md:flex items-center gap-1`,children:f.map(({icon:e,link:t})=>(0,c.jsx)(r.n.Socials,{icon:e,link:t,className:`p-1.5 text-muted hover:text-body hover:bg-surface rounded-md transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`},t))}),(0,c.jsx)(r.n.More,{onPress:()=>C(!0),className:`text-muted hover:text-body active:scale-90 transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`})]})]}),(0,c.jsxs)(r.n.MobileMenu,{isOpen:S,onClose:()=>C(!1),className:`bg-main/98 backdrop-blur-2xl`,children:[(0,c.jsx)(`div`,{className:`flex flex-col gap-1`,children:n.map(e=>(0,c.jsx)(R,{link:e,onClose:()=>C(!1)},e.href))}),f.length>0&&(0,c.jsxs)(`div`,{className:`mt-6`,children:[(0,c.jsx)(`div`,{className:`px-4 mb-4 text-xs font-bold uppercase tracking-widest text-muted/50`,children:`Connect`}),(0,c.jsx)(`div`,{className:`flex flex-wrap gap-2 px-2`,children:f.map(({icon:e,link:t})=>(0,c.jsx)(r.n.Socials,{icon:e,link:t,className:`p-3 bg-surface border border-subtle rounded-xl flex-1 justify-center`},t))})]})]}),T&&D&&w?.tabs&&(0,c.jsx)(`div`,{className:`w-full border-b border-subtle bg-main`,children:(0,c.jsx)(te,{tabs:w.tabs,routes:h||m||[]})})]})}function ne({link:t}){let n=e.b(t.href||``),{pathname:i}=(0,o.useLocation)(),a=i===n||i.startsWith(n+`/`);return t.items&&t.items.length>0?(0,c.jsx)(r.n.Dropdown,{label:(0,c.jsx)(`span`,{className:e.y(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm px-2 py-1`,a?`text-primary-500`:`text-muted hover:text-body`),children:t.label}),children:t.items?.map(t=>(0,c.jsx)(r.n.DropdownItem,{href:e.b(t.href||``),label:t.label},t.href))}):(0,c.jsx)(r.n.Link,{...t,href:n,active:a,className:e.y(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,a?`text-primary-500`:`text-muted hover:text-body`)})}function R({link:t,onClose:n}){let i=e.b(t.href||``),{pathname:a}=(0,o.useLocation)(),s=a===i;return t.items&&t.items.length>0?(0,c.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,c.jsx)(`div`,{className:e.y(`px-3 py-2 text-sm transition-all`,s?`text-body`:`text-muted/80 hover:text-body`),children:t.label}),(0,c.jsx)(`div`,{className:`flex flex-col gap-1 pl-4`,children:t.items?.map(e=>(0,c.jsx)(R,{link:e,onClose:n},e.href))})]}):(0,c.jsx)(r.n.MobileLink,{...t,href:i,active:s,onPress:n,className:e.y(`transition-all`,s?`text-body`:`text-muted/80 hover:text-body`)})}function z(){return(0,c.jsx)(`div`,{className:`flex items-center justify-center min-h-[65vh] text-center px-4`,children:(0,c.jsxs)(`div`,{className:`space-y-6 max-w-md mx-auto p-8 border border-subtle bg-surface rounded-2xl shadow-xs`,children:[(0,c.jsx)(`span`,{className:`block text-7xl font-extrabold tracking-tight text-primary-500`,children:`404`}),(0,c.jsxs)(`div`,{className:`space-y-2`,children:[(0,c.jsx)(`h1`,{className:`text-xl font-bold text-body`,children:`Page Not Found`}),(0,c.jsx)(`p`,{className:`text-sm text-muted leading-relaxed`,children:`The page you're looking for doesn't exist or has been moved.`})]}),(0,c.jsxs)(e._,{href:`/`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-main px-6 py-2.5 text-xs font-semibold text-body hover:bg-primary-50/50 hover:border-primary-500/50 transition-all duration-300 outline-none select-none`,children:[(0,c.jsx)(l.ArrowLeft,{size:14}),` Go to Home`]})]})})}function B({headings:e=[],editLink:n,communityHelp:r,filePath:i}){return e.length===0?null:(0,c.jsxs)(t._.Root,{children:[(0,c.jsxs)(t._.Header,{className:`flex flex-row gap-x-2`,children:[(0,c.jsx)(l.TextAlignStart,{size:16}),`On this page`]}),(0,c.jsx)(t._.Tree,{headings:e}),(n||r)&&(0,c.jsxs)(`div`,{className:`mt-8 pt-8 border-t border-subtle space-y-4`,children:[(0,c.jsx)(`p`,{className:`text-xs font-bold text-body`,children:`Need help?`}),(0,c.jsxs)(`ul`,{className:`space-y-3`,children:[n&&i&&(0,c.jsx)(`li`,{children:(0,c.jsxs)(`a`,{href:n.replace(`:path`,i),target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[(0,c.jsx)(l.Pencil,{size:16}),`Edit this page`]})}),r&&(0,c.jsx)(`li`,{children:(0,c.jsxs)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[(0,c.jsx)(l.CircleHelp,{size:16}),`Community help`]})})]})]})]})}function V(){let{routes:t,currentRoute:n}=e.x(),r=(0,o.useLocation)();return(0,s.useMemo)(()=>{if(!n)return{prevPage:null,nextPage:null,currentRoute:null};let e=n.tab?.toLowerCase(),i=e?t.filter(t=>t.tab?.toLowerCase()===e):t.filter(e=>!e.tab),a=i.findIndex(e=>e.path===r.pathname);return{prevPage:a>0?i[a-1]:null,nextPage:a!==-1&&a<i.length-1?i[a+1]:null,currentRoute:n}},[t,n,r.pathname])}function H(){let{prevPage:e,nextPage:n}=V();return!e&&!n?null:(0,c.jsxs)(t.h.Root,{className:`pt-8 border-t border-subtle grid sm:grid-cols-2 gap-4 animate-in fade-in slide-in-from-bottom-4 duration-700 select-none`,children:[e?(0,c.jsxs)(t.h.Link,{to:e.path,direction:`prev`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[(0,c.jsx)(t.h.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Previous`}),(0,c.jsx)(t.h.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:e.title})]}):(0,c.jsx)(`div`,{}),n?(0,c.jsxs)(t.h.Link,{to:n.path,direction:`next`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[(0,c.jsx)(t.h.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Next`}),(0,c.jsx)(t.h.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:n.title})]}):(0,c.jsx)(`div`,{})]})}function re({routes:e,config:n}){let{logo:r,title:i,logoProps:a}=O(),{closeSidebar:o}=t.T(),s=r?(0,c.jsx)(`img`,{src:r,alt:a?.alt||i,width:24,height:24,className:`rounded-xl`}):null,u=n.versions||n.i18n;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(t.i.Root,{children:(0,c.jsx)(t.i.Content,{children:(0,c.jsx)(t.i.Items,{routes:e})})}),(0,c.jsxs)(t.i.Mobile,{children:[(0,c.jsxs)(t.i.Header,{children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-3`,children:[s,(0,c.jsx)(`span`,{className:`font-bold text-lg tracking-tight text-body truncate max-w-[120px]`,children:i})]}),(0,c.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,c.jsx)(k,{className:`w-24 h-9 rounded-xl`}),(0,c.jsx)(t.M,{onPress:o,className:`h-9 w-9 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 text-muted hover:text-body transition-colors`,"aria-label":`Close sidebar`,children:(0,c.jsx)(l.X,{size:20})})]})]}),(0,c.jsxs)(t.i.Content,{children:[u&&(0,c.jsxs)(`div`,{className:`flex flex-col gap-4 mb-10`,children:[(0,c.jsxs)(`div`,{className:`flex gap-3`,children:[n.versions&&(0,c.jsx)(P,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`}),n.i18n&&(0,c.jsx)(F,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`})]}),(0,c.jsx)(`div`,{className:`mt-2 border-b border-subtle`})]}),(0,c.jsx)(t.i.Items,{routes:e})]})]})]})}const U=Object.assign(re,{Root:t.i.Root,Mobile:t.i.Mobile,Header:t.i.Header,Content:t.i.Content,Group:t.i.Group,Link:t.i.Link,SubGroup:t.i.SubGroup,Item:t.i.Item,Items:t.i.Items});function W({date:e}){if(!e)return null;let t=new Date(e);if(isNaN(t.getTime()))return null;let n=t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`});return(0,c.jsxs)(`div`,{className:`mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none`,children:[(0,c.jsx)(`span`,{}),(0,c.jsxs)(`span`,{className:`italic`,children:[`Last updated on `,n]})]})}function ie({route:e,content:t,mdxComponents:n}){let r=_(),i=(0,s.useMemo)(()=>({LastUpdated:W,...r,...n}),[r,n]),a=i.LastUpdated||W;return t?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(t,{components:i}),e?.lastUpdated&&(0,c.jsx)(a,{date:e.lastUpdated})]}):null}function G({MDXComponent:e,mdxComponents:t}){let n=(0,o.useLoaderData)(),r=e||n?.MDXComponent,i=t||n?.mdxComponents;return r?(0,c.jsx)(ie,{route:{path:n.path,filePath:n.filePath,title:n.frontmatter.title,description:n.frontmatter.description,headings:n.headings,locale:n.locale,version:n.version,group:n.group,groupTitle:n.groupTitle,lastUpdated:n.lastUpdated,frontmatter:n.frontmatter},content:r,mdxComponents:i}):null}const K=d,q=K.Helmet||K.default?.Helmet||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e})),J=K.HelmetProvider||K.default?.HelmetProvider||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e}));function ae(){let{pathname:e,hash:t}=(0,o.useLocation)();return(0,s.useLayoutEffect)(()=>{let e=document.querySelector(`.boltdocs-content`)||window,n=()=>e===window?window.scrollY:e.scrollTop,r=(t,n=`auto`)=>{e===window?window.scrollTo({top:t,behavior:n}):e.scrollTo({top:t,behavior:n})};if(t){let i=t.replace(`#`,``),a=document.getElementById(i);if(a){let t=e===window?0:e.getBoundingClientRect().top;r(a.getBoundingClientRect().top-t-80+n(),`auto`);return}}r(0)},[e,t]),null}const oe={...a.t,NotFound:z,404:z};function Y(e){return e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e}function se({config:t}){let{currentLocale:n}=e.w();return(0,s.useEffect)(()=>{if(!t.i18n||typeof document>`u`)return;let e=n||t.i18n.defaultLocale,r=t.i18n.localeConfigs?.[e];document.documentElement.lang=r?.htmlLang||e||`en`,document.documentElement.dir=r?.direction||`ltr`},[n,t.i18n]),null}function ce({config:t,routeMap:n}){let r=(0,o.useLocation)(),{setLocale:i,setVersion:a}=e.w();return(0,s.useEffect)(()=>{let e=Y(r.pathname),o=n.get(e);o&&(t.i18n&&i(o.locale||t.i18n.defaultLocale),t.versions&&a(o.version||t.versions.defaultVersion))},[r.pathname,t,n,i,a]),null}function X({config:r,routes:i,components:a={}}){let l=(0,s.useMemo)(()=>({...oe,...f.default,...a}),[a]),{pathname:u}=(0,o.useLocation)(),d=(0,s.useMemo)(()=>Y(u||`/`),[u]),p=(0,s.useMemo)(()=>{let e=new Map;for(let t of i){let n=Y(t.path===``?`/`:t.path);e.set(n,t)}return e},[i]),m=(0,s.useMemo)(()=>{let e=p.get(d),t,n;return e&&(r.i18n&&(t=e.locale||r.i18n.defaultLocale),r.versions&&(n=e.version||r.versions.defaultVersion)),{initLocale:t,initVersion:n}},[d,r,p]);return(0,c.jsx)(J,{children:(0,c.jsx)(e.T,{routes:i,children:(0,c.jsx)(n.c,{children:(0,c.jsx)(t.w,{children:(0,c.jsx)(v,{components:l,children:(0,c.jsxs)(e.E.Provider,{value:r,children:[(0,c.jsx)(ae,{}),(0,c.jsxs)(e.C,{initialLocale:m.initLocale,initialVersion:m.initVersion,children:[(0,c.jsx)(ce,{config:r,routeMap:p}),(0,c.jsx)(se,{config:r}),(0,c.jsx)(o.Outlet,{})]})]})})})})})})}function le({siteTitle:t,siteDescription:n,routes:r}){let i=(0,o.useLocation)(),a=e.D(),{currentLocale:l}=e.x(),u=(0,s.useMemo)(()=>r?.find?.(e=>e.path===i.pathname),[r,i.pathname]),d=u?.title,f=D(n,l),p=u?.description||f||``,m=D(t,l),h=d?`${d} | ${m}`:m,g=u?.seo||{},_=a?.seo?.metatags||{},v=a?.seo?.thumbnails?.background,y=g[`og:image`]||v;return(0,c.jsxs)(q,{children:[(0,c.jsx)(`title`,{children:h}),(0,c.jsx)(`meta`,{name:`description`,content:p}),(0,c.jsx)(`meta`,{property:`og:title`,content:h}),(0,c.jsx)(`meta`,{property:`og:description`,content:p}),(0,c.jsx)(`meta`,{property:`og:type`,content:`article`}),typeof window<`u`&&(0,c.jsx)(`meta`,{property:`og:url`,content:window.location.href}),typeof window<`u`&&(0,c.jsx)(`link`,{rel:`canonical`,href:window.location.origin+i.pathname}),(0,c.jsx)(`meta`,{name:`twitter:card`,content:`summary`}),(0,c.jsx)(`meta`,{name:`twitter:title`,content:h}),(0,c.jsx)(`meta`,{name:`twitter:description`,content:p}),y&&(0,c.jsx)(`meta`,{name:`twitter:image`,content:y}),y&&(0,c.jsx)(`meta`,{property:`og:image`,content:y}),(0,c.jsx)(`meta`,{name:`generator`,content:`Boltdocs`}),Object.entries(_).map(([e,t])=>e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?(0,c.jsx)(`meta`,{property:e,content:t},e):(0,c.jsx)(`meta`,{name:e,content:t},e)),Object.entries(g).map(([e,t])=>e===`noindex`&&t===!0?(0,c.jsx)(`meta`,{name:`robots`,content:`noindex`},`noindex`):e===`robots`?(0,c.jsx)(`meta`,{name:`robots`,content:t},`robots`):e===`canonical`?(0,c.jsx)(`link`,{rel:`canonical`,href:t},`canonical`):e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?(0,c.jsx)(`meta`,{property:e,content:t},e):(0,c.jsx)(`meta`,{name:e,content:t},e))]})}function ue(){let t=e.D(),{currentRoute:n,allRoutes:r}=e.x();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(le,{siteTitle:t.theme?.title,siteDescription:t.theme?.description,routes:r||[]}),(0,c.jsx)(p.default,{route:n,children:(0,c.jsx)(o.Outlet,{})})]})}const de=()=>(0,c.jsx)(`div`,{className:`text-muted text-sm py-4`,children:`Loading...`}),fe=({moduleLoader:e,moduleKey:t,route:n,components:r})=>{let i=e?.default??e??null;return(0,s.useEffect)(()=>{if(!{}.hot||!t)return;let e=e=>{e.relPath.replace(/\\/g,`/`).replace(/^\//,``)===n.filePath.replace(/\\/g,`/`).replace(/^\//,``)&&import(t+`?t=`+Date.now()).then(e=>{})};return{}.hot.on(`boltdocs:mdx-update`,e),()=>({}).hot?.off(`boltdocs:mdx-update`,e)},[t,n.filePath]),i?(0,c.jsx)(G,{MDXComponent:i,mdxComponents:r}):(0,c.jsx)(de,{})},pe=()=>{let e=_();return(0,c.jsx)(e.NotFound||e[404]||z,{})};function me(e){let{routesData:t,config:n,mdxModules:r,externalPages:i,externalLayout:a,components:s}=e,l=a||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e})),u=e=>{let t=n.base||`/`;return e.startsWith(t)?e:`${t===`/`?``:t.replace(/\/$/,``)}${e.startsWith(`/`)?e:`/${e}`}`||`/`},d=[],f=n.versions?.defaultVersion,p=(n.base||`/docs`).replace(/\/$/,``);f&&t.forEach(e=>{if(e.version)return;let t=e.path||``,n=t.startsWith(p)?t.substring(p.length).replace(/^\//,``):t.replace(/^\//,``);if(!(n===f||n.startsWith(`${f}/`))){let t=`${p}/${f}/${n}`.replace(/\/+/g,`/`).replace(/\/$/,``)||`/`;d.push({...e,path:t,version:f})}});let m=[...t,...d],h=new Map,g=Object.keys(r);if(g.length>0){let e=g[0].replace(/\\/g,`/`).split(`/`).filter(Boolean)[0]||`docs`,t=`/${e}/`,n=`./${e}/`;for(let e of g){let r=e.replace(/\\/g,`/`),i=``;r.indexOf(t)===-1?r.startsWith(n)&&(i=r.substring(n.length)):i=r.substring(r.indexOf(t)+t.length),i?h.set(i,e):h.set(r,e)}}let _=m.map(e=>{let t=e.filePath.replace(/\\/g,`/`),n=h.get(t),i=n?r[n]:null,a=u(e.path===``?`/`:e.path);return{path:a,element:(0,c.jsx)(fe,{moduleKey:n,moduleLoader:i,route:e,components:s},n||a),loader:async()=>({path:a,frontmatter:{title:e.title,description:e.description||``,...e.frontmatter||{}},headings:e.headings||[],filePath:e.filePath,locale:e.locale,version:e.version,group:e.group,groupTitle:e.groupTitle,date:e.date,lastUpdated:e.lastUpdated}),getStaticPaths:()=>[a]}}),v=(n.base||`/docs`).replace(/\/$/,``);v||=`/`;let y=n.i18n?.locales?Array.isArray(n.i18n.locales)?n.i18n.locales:Object.keys(n.i18n.locales):[],b=n.versions?.versions?.map(e=>e.path)||[],x=[];x.push({path:v,filter:()=>!0});let S=[];b.length>0&&b.forEach(e=>S.push(`/${e}`)),y.length>0&&y.forEach(e=>S.push(`/${e}`)),b.length>0&&y.length>0&&b.forEach(e=>{y.forEach(t=>{S.push(`/${e}/${t}`)})}),S.forEach(e=>{let t=v===`/`?e:`${v}${e}`;x.push({path:t,filter:e=>e.startsWith(t.replace(/\/$/,``)+`/`)})});let C=new Set(_.map(e=>(e.path||``).replace(/\/$/,``))),w=new Set;i&&Object.keys(i).forEach(e=>{let t=e.startsWith(`/`)?e:`/${e}`;w.add(t.replace(/\/$/,``)),n.i18n&&Object.keys(n.i18n.locales).forEach(e=>{w.add(`/${e}${t===`/`?``:t}`.replace(/\/$/,``))})}),x.forEach(({path:e,filter:t})=>{if(e===`/`)return;let r=e.replace(/\/$/,``);if(!(C.has(r)||w.has(r))){let i=n.theme?.tabs?.[0]?.id,a=i?`${r}/${i}`.replace(/\/+/g,`/`):null,s=a&&C.has(a.replace(/\/$/,``))?_.find(e=>e.path.replace(/\/$/,``)===a.replace(/\/$/,``)):_.find(e=>t(e.path)&&e.path!==r),l=s?s.path:_.length>0?_[0].path:null;l&&_.push({path:e,element:(0,c.jsx)(o.Navigate,{to:l,replace:!0}),loader:async()=>({path:e}),getStaticPaths:()=>[e]})}});let T=[{element:(0,c.jsx)(ue,{}),children:_}],E=[];return i&&Object.entries(i).forEach(([e,t])=>{let r=e.startsWith(`/`)?e:`/${e}`;T.find(e=>e.path===r)||(E.push({path:r,locale:n.i18n?.defaultLocale,title:e===`/`?`Home`:e.replace(/^\//,``).split(`/`).pop()||`Page`,filePath:``,headings:[]}),T.push({path:r,element:(0,c.jsx)(l,{children:(0,c.jsx)(t,{})}),loader:async()=>({path:r,locale:n.i18n?.defaultLocale}),getStaticPaths:()=>[r]}),n.i18n&&Object.keys(n.i18n.locales).forEach(n=>{let r=`/${n}${e===`/`?``:e}`;T.find(e=>e.path===r)||(E.push({path:r,locale:n,title:e,filePath:``,headings:[]}),T.push({path:r,element:(0,c.jsx)(l,{children:(0,c.jsx)(t,{})}),loader:async()=>({path:r,locale:n}),getStaticPaths:()=>[r]}))}))}),T.push({path:`*`,element:(0,c.jsx)(l,{children:(0,c.jsx)(pe,{})})}),[{element:(0,c.jsx)(X,{config:n,routes:[...m,...E],components:s}),children:T}]}function Z(e){return typeof window>`u`?Q():typeof window.gtag==`function`?he(e):window.dataLayer?ge(e):Q()}function he(e){return{trackPageView:(t,n)=>{window.gtag?.(`event`,`page_view`,{page_path:t,page_title:n||document.title,send_to:e?.ga4?.measurementId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.gtag?.(`event`,t,{event_category:n,event_label:r,value:i,send_to:e?.ga4?.measurementId,...a})},trackSearch:(t,n)=>{window.gtag?.(`event`,`search`,{search_term:t,results_count:n,send_to:e?.ga4?.measurementId})},trackDownload:(t,n)=>{window.gtag?.(`event`,`file_download`,{file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.ga4?.measurementId})},trackExternalLink:t=>{window.gtag?.(`event`,`external_link`,{link_url:t,send_to:e?.ga4?.measurementId})},isEnabled:!0}}function ge(e){return{trackPageView:(t,n)=>{window.dataLayer?.push({event:`page_view`,page_path:t,page_title:n||document.title,send_to:e?.gtm?.tagId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.dataLayer?.push({event:t,event_category:n,event_label:r,value:i,send_to:e?.gtm?.tagId,...a})},trackSearch:(t,n)=>{window.dataLayer?.push({event:`search`,search_term:t,results_count:n,send_to:e?.gtm?.tagId})},trackDownload:(t,n)=>{window.dataLayer?.push({event:`file_download`,file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.gtm?.tagId})},trackExternalLink:t=>{window.dataLayer?.push({event:`external_link`,link_url:t,send_to:e?.gtm?.tagId})},isEnabled:!0}}function Q(){return{trackPageView:()=>{},trackEvent:()=>{},trackSearch:()=>{},trackDownload:()=>{},trackExternalLink:()=>{},isEnabled:!1}}const $=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`);function _e(e={}){let{config:n,autoTrackPageViews:r=!0,autoTrackDownloads:i=!0,autoTrackExternalLinks:a=!0,excludePatterns:o=[]}=e,c=typeof globalThis<`u`?globalThis[$]:void 0,l=n??c?.integrations,u=(0,s.useMemo)(()=>Z(l),[l]),d=(0,s.useRef)(``),f=t.r();return(0,s.useEffect)(()=>{if(!r||!u.isEnabled)return;let e=f.pathname+f.search;e!==d.current&&(d.current=e,u.trackPageView(e,document.title))},[f.pathname,r,u]),(0,s.useEffect)(()=>{if(!i||!u.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);if(n&&!o.some(e=>e.test(n))&&(t.hasAttribute(`download`)||/\.(pdf|doc|docx|xls|xlsx|ppt|pptx|zip|rar|7z|tar|gz|mp3|mp4|avi|mov|png|jpg|jpeg|gif|svg|webp)$/i.test(n))){let e=n.split(`/`).pop()||n;u.trackDownload(e,e.split(`.`).pop())}};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[i,a,u,o]),(0,s.useEffect)(()=>{if(!a||!u.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);n&&(o.some(e=>e.test(n))||(n.startsWith(`http://`)||n.startsWith(`https://`)||n.startsWith(`//`))&&!n.includes(window.location.hostname)&&u.trackExternalLink(n))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[a,u,o]),u}function ve(){let e=(0,s.useMemo)(()=>Z(),[]);return(0,s.useCallback)((t,n)=>{e.trackPageView(t,n)},[e])}function ye(){let e=(0,s.useMemo)(()=>Z(),[]);return(0,s.useCallback)(t=>{e.trackEvent(t)},[e])}function be({children:n}){let{routes:r,currentRoute:i}=e.x(),a=e.D();return(0,c.jsxs)(t.t,{className:`selection:bg-primary-500/10 selection:text-primary-500`,children:[(0,c.jsx)(L,{}),(0,c.jsxs)(t.t.Body,{className:`bg-main`,children:[(0,c.jsx)(U,{routes:r||[],config:a}),(0,c.jsx)(t.t.Content,{className:`animate-in fade-in duration-500 scroll-smooth`,children:(0,c.jsxs)(t.t.ContentMdx,{className:`max-w-5xl px-2 pt-8 pb-24`,children:[(0,c.jsxs)(t.t.Header,{children:[(0,c.jsxs)(`div`,{className:`mb-4 border-b border-subtle pb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,c.jsx)(b,{}),(0,c.jsx)(S,{mdxRaw:i?._rawContent,route:i})]}),i?.title&&(0,c.jsx)(`h1`,{className:`text-4xl font-bold tracking-tight text-default mb-3`,children:i.title}),i?.description&&(0,c.jsx)(`p`,{className:`text-lg text-muted-foreground mb-6 leading-relaxed`,children:i.description})]}),(0,c.jsx)(C,{children:(0,c.jsx)(`div`,{className:`prose prose-neutral dark:prose-invert max-w-none`,children:n})}),(0,c.jsx)(t.t.Footer,{children:(0,c.jsx)(H,{})})]})}),(0,c.jsx)(B,{headings:i?.headings,editLink:a.theme?.editLink,communityHelp:a.theme?.communityHelp,filePath:i?.filePath})]})]})}const xe=Object.assign(be,{Body:t.t.Body,Content:t.t.Content,ContentMdx:t.t.ContentMdx,Header:t.t.Header,Footer:t.t.Footer});exports.BoltdocsShell=X,exports.Breadcrumbs=b,exports.Card=a.r,exports.Cards=a.n,exports.CopyMarkdown=S,exports.DocsLayout=xe,exports.ErrorBoundary=C,exports.MdxPage=G,exports.Navbar=L,exports.NotFound=z,exports.OnThisPage=B,exports.PageNav=H,exports.SearchDialog=i.t,exports.Sidebar=U,exports.cn=e.y,exports.copyToClipboard=a.i,exports.createRoutes=me,exports.getStarsRepo=w,exports.getTranslated=D,exports.reactToText=a.a,exports.useAnalytics=_e,exports.useBreadcrumbs=y,exports.useConfig=e.D,exports.useI18n=N,exports.useLocalizedTo=e.b,exports.useLocation=t.r,exports.useMdxComponents=_,exports.useNavbar=O,exports.usePageNav=V,exports.useRoutes=e.x,exports.useSearch=i.n,exports.useSearchHighlight=t.n,exports.useSidebar=t.m,exports.useTabs=A,exports.useTheme=n.l,exports.useTrackEvent=ye,exports.useTrackPageView=ve,exports.useUI=t.T,exports.useVersion=M;
|
|
6
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../icons-dev-rzdz6Lf3.cjs`),t=require(`../docs-layout-BlDhcQRv.cjs`),n=require(`../image-DIGjCPe6.cjs`),r=require(`../search-dialog-D26rUnJ_.cjs`),i=require(`../search-dialog-BACuzoVX.cjs`),a=require(`../mdx-hpErbRUe.cjs`);let o=require(`react-router-dom`),s=require(`react`),c=require(`react/jsx-runtime`),l=require(`lucide-react`);l=e.O(l);let u=require(`react-aria-components`),d=require(`react-helmet-async`);d=e.O(d);let f=require(`virtual:boltdocs-mdx-components`);f=e.O(f);let p=require(`virtual:boltdocs-layout`);p=e.O(p);let m=require(`@bdocs/ssg`);const h=Symbol.for(`__BDOCS_MDX_COMPONENTS_CONTEXT__`),g=Symbol.for(`__BDOCS_MDX_COMPONENTS_INSTANCE__`),_=globalThis[h]||(globalThis[h]=(0,s.createContext)({}));function v(){let e=(0,s.use)(_);return(!e||Object.keys(e).length===0)&&globalThis[g]?globalThis[g]:e}function y({components:e,children:t}){let n=(0,s.useMemo)(()=>{let t={},n={};return Object.entries(e).forEach(([e,r])=>{if(e.startsWith(`Frontmatter_`)){let t=e.slice(12);n[t]=r}else t[e]=r}),t.Frontmatter=n,t},[e]);return typeof globalThis<`u`&&(globalThis[g]=n),(0,c.jsx)(_.Provider,{value:n,children:t})}function b(){let{currentRoute:t}=e.x(),n=[];return t&&(t.groupTitle&&n.push({label:t.groupTitle}),n.push({label:t.title,href:t.path})),{crumbs:n,activeRoute:t}}function x(){let{crumbs:n,activeRoute:r}=b();return n.length===0?null:(0,c.jsxs)(t.N.Root,{className:`gap-2 text-xs sm:text-sm font-medium`,children:[(0,c.jsx)(t.N.Item,{children:(0,c.jsx)(t.N.Link,{href:`/`,className:`text-muted hover:text-body transition-colors flex items-center`,children:(0,c.jsx)(l.Home,{size:14})})}),n.map((n,i)=>{let a=n.href===r?.path;return(0,c.jsxs)(t.N.Item,{className:`gap-2`,children:[(0,c.jsx)(t.N.Separator,{className:`text-muted/40`}),(0,c.jsx)(t.N.Link,{href:n.href,className:e.y(`transition-colors`,a?`text-body font-semibold cursor-default pointer-events-none`:`text-muted hover:text-body`),children:n.label})]},`crumb-${n.href}-${n.label}-${i}`)})]})}const S=e=>{let[t,n]=(0,s.useState)(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},handleOpenRaw:()=>{let t=new Blob([e],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t);window.open(n,`_blank`)}}};function C({content:n,mdxRaw:r}){let i=r||n||``,{copied:a,handleCopy:o,handleOpenRaw:s}=S(i);return i?(0,c.jsx)(`div`,{className:`relative inline-flex z-100 shrink-0 w-max`,children:(0,c.jsxs)(t.j,{className:`rounded-xl border border-subtle bg-surface transition-all duration-300 hover:border-primary-500/50 group overflow-hidden`,children:[(0,c.jsx)(t.M,{onPress:o,className:e.y(`md:hidden flex items-center justify-center w-8 h-8 bg-transparent outline-none select-none cursor-pointer border-none`,`text-muted transition-all duration-300 hover:bg-primary-500/5 hover:text-body`,a&&`text-emerald-500 hover:bg-emerald-500/5`),"aria-label":a?`Copied!`:`Copy Markdown`,children:a?(0,c.jsx)(l.Check,{size:14}):(0,c.jsx)(l.Copy,{size:14})}),(0,c.jsxs)(t.M,{onPress:o,className:e.y(`hidden md:flex items-center gap-2 px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 shrink-0 outline-none select-none cursor-pointer border-none`,`text-body transition-all duration-300 hover:bg-primary-500/5`,a&&`text-emerald-500 hover:bg-emerald-500/5`),children:[a?(0,c.jsx)(l.Check,{size:16}):(0,c.jsx)(l.Copy,{size:16}),a?`Copied!`:`Copy Markdown`]}),(0,c.jsxs)(t.k.Trigger,{placement:`bottom end`,children:[(0,c.jsx)(t.M,{className:e.y(`flex items-center justify-center px-2.5 md:px-3.5 h-8 md:h-9 border-none border-l border-subtle/50 text-muted rounded-none bg-transparent shrink-0 outline-none select-none cursor-pointer`,`transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500`),children:(0,c.jsx)(l.ChevronDown,{size:14})}),(0,c.jsxs)(t.k.Root,{className:`w-52 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[(0,c.jsxs)(t.k.Item,{onAction:o,className:`flex items-center px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[(0,c.jsx)(l.Copy,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Copy Markdown`})]}),(0,c.jsxs)(t.k.Item,{onAction:s,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[(0,c.jsx)(l.ExternalLink,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),(0,c.jsx)(`span`,{className:`ml-2`,children:`View as Markdown`})]})]})]})]})}):null}function w({children:e,fallback:n}){return(0,c.jsx)(t.D,{fallback:n,children:e})}async function T(e,t,n=`https://api.github.com`){let r=new Headers;t&&r.append(`authorization`,t);let i=await(await fetch(`${n}/repos/${e}`,{headers:r})).json();return i.stargazers_count===void 0?`0`:E(i.stargazers_count)}const E=e=>Intl.NumberFormat(`en`,{notation:`compact`,compactDisplay:`short`}).format(e);function D({repo:t}){let[n,r]=(0,s.useState)(null);return(0,s.useEffect)(()=>{t&&T(t).then(e=>r(e)).catch(()=>r(`0`))},[t]),(0,c.jsxs)(`a`,{href:`https://github.com/${t}`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-muted dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 hover:border-primary-500/50 hover:text-body select-none outline-none`,children:[(0,c.jsx)(e.s,{className:`h-4 w-4 text-body`}),n!==null&&(0,c.jsxs)(`span`,{className:`tabular-nums font-medium`,children:[n,` stars`]})]})}function O(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function k(){let t=e.D(),{theme:r,resolvedTheme:i}=n.l(),a=(0,o.useLocation)(),{currentLocale:c}=e.x(),l=t.theme||{},u=O(l.title,c)||`Boltdocs`,d=l.navbar||[],f=l.socialLinks||[],p=l.githubRepo,m=(0,s.useMemo)(()=>d.map(e=>{let n=e.href||e.to||e.link||``,r=e=>{let n=a.pathname;if(n===e)return!0;if(!e||e===`/`)return n===`/`;let r=e=>{let n=e.split(`/`).filter(Boolean),r=0;return t.i18n?.locales&&n[r]&&t.i18n.locales[n[r]]&&r++,t.versions?.versions&&n[r]&&t.versions.versions.some(e=>e.path===n[r])&&r++,n.slice(r)},i=r(e),o=r(n);return i.length===0?o.length===0:o.length<i.length?!1:i.every((e,t)=>o[t]===e)},i=(e=>{if(!(!e||e.length===0))return e.map(e=>{let t=e.href||e.to||e.link||``;return{label:O(e.label||e.text,c),href:t,active:r(t),to:t.startsWith(`http`)||t.startsWith(`//`)?`external`:void 0}})})(e.items);return{label:O(e.label||e.text,c),href:n,active:r(n),to:n.startsWith(`http`)||n.startsWith(`//`)?`external`:void 0,items:i}}),[d,a.pathname,c,t]),h=l.logo;return{links:m,title:u,logo:h?typeof h==`string`?h:i===`dark`?h.dark:h.light:null,logoProps:{alt:(h&&typeof h==`object`?h.alt:void 0)||u,width:h&&typeof h==`object`?h.width:void 0,height:h&&typeof h==`object`?h.height:void 0},github:p?`https://github.com/${p}`:null,social:f,config:t,theme:r}}function ee(){let{theme:e,setTheme:r}=n.l(),[i,a]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{a(!0)},[]),!i)return(0,c.jsx)(`div`,{className:`h-9 w-9`});let o=e===`system`?l.Monitor:e===`dark`?l.Moon:l.Sun;return(0,c.jsxs)(t.k.Trigger,{placement:`bottom right`,children:[(0,c.jsx)(u.Button,{className:`flex h-9 w-9 items-center justify-center rounded-xl text-muted transition-colors hover:bg-surface hover:text-body outline-none border-none bg-transparent cursor-pointer`,"aria-label":`Selection theme`,children:(0,c.jsx)(o,{size:20,className:`animate-in fade-in zoom-in duration-300`})}),(0,c.jsxs)(t.k.Root,{selectionMode:`single`,selectedKeys:[e],onSelectionChange:e=>{let t=Array.from(e)[0];r(t)},className:`w-36 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[(0,c.jsxs)(t.k.Item,{id:`light`,className:`group flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(l.Sun,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Light`})]}),(0,c.jsxs)(t.k.Item,{id:`dark`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(l.Moon,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`Dark`})]}),(0,c.jsxs)(t.k.Item,{id:`system`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[(0,c.jsx)(l.Monitor,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),(0,c.jsx)(`span`,{className:`ml-2`,children:`System`})]})]})]})}function A({className:t}){let{theme:r,setTheme:i}=n.l(),[a,o]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{o(!0)},[]),!a)return(0,c.jsx)(`div`,{className:e.y(`h-10 w-full bg-surface rounded-xl animate-pulse`,t)});let u=r===`dark`;return(0,c.jsxs)(`div`,{className:e.y(`flex p-1 bg-surface border border-subtle rounded-xl relative w-full h-11`,t),children:[(0,c.jsx)(`div`,{className:e.y(`absolute inset-y-1 w-[calc(50%-4px)] bg-main border border-subtle rounded-lg transition-all duration-300 ease-out shadow-xs`,u?`translate-x-full`:`translate-x-0`)}),(0,c.jsx)(`button`,{onClick:()=>i(`light`),className:e.y(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,u?`text-muted hover:text-body`:`text-body font-semibold`),"aria-label":`Light mode`,children:(0,c.jsx)(l.Sun,{size:18})}),(0,c.jsx)(`button`,{onClick:()=>i(`dark`),className:e.y(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,u?`text-body font-semibold`:`text-muted hover:text-body`),"aria-label":`Dark mode`,children:(0,c.jsx)(l.Moon,{size:18})})]})}function j(t=[],n=[]){let r=(0,o.useLocation)(),i=(0,s.useRef)([]),[a,c]=(0,s.useState)({opacity:0,transform:`translateX(0) scaleX(0)`,width:0}),l=e.S(r.pathname),u=n.find(t=>e.S(t.path)===l)?.tab?.toLowerCase(),d=t.findIndex(e=>e.id.toLowerCase()===u),f=d===-1?0:d;return(0,s.useEffect)(()=>{let e=i.current[f];e&&c({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[f,t.length,r.pathname]),{tabs:t,activeIndex:f,indicatorStyle:a,tabRefs:i,activeTabId:u}}function te({tabs:n,routes:r}){let{currentLocale:i}=e.x(),{indicatorStyle:a,tabRefs:o,activeIndex:u}=j(n,r);(0,s.useEffect)(()=>{let e=o.current[u];e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[u]);let d=e=>{if(!e)return null;if(e.trim().startsWith(`<svg`))return(0,c.jsx)(`span`,{className:`h-4 w-4`,dangerouslySetInnerHTML:{__html:e}});let t=l[e];return t?(0,c.jsx)(t,{size:16}):(0,c.jsx)(`img`,{src:e,alt:``,className:`h-4 w-4 object-contain`})};return(0,c.jsx)(`div`,{className:`mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6 select-none`,children:(0,c.jsxs)(t.E.List,{className:`border-none py-0 scrollbar-hide relative flex flex-row items-center`,children:[n.map((t,n)=>{let a=n===u,s=r.find(e=>e.tab&&e.tab.toLowerCase()===t.id.toLowerCase());return(0,c.jsxs)(e._,{href:s?s.path:`#`,ref:e=>{o.current[n]=e},className:`relative flex items-center gap-2 px-4 py-3.5 text-sm font-semibold transition-colors duration-300 outline-none whitespace-nowrap ${a?`text-primary-500`:`text-muted hover:text-body`}`,children:[d(t.icon),(0,c.jsx)(`span`,{children:O(t.text,i)})]},t.id)}),(0,c.jsx)(t.E.Indicator,{style:a,className:`h-0.5 bg-primary-500 rounded-full transition-all duration-300`})]})})}function M(e,t,n){let r=e;return t&&(r===t||r.startsWith(t+`/`))&&(r=r===t?`index.md`:r.slice(t.length+1)),n&&(r===n||r.startsWith(n+`/`))&&(r=r===n?`index.md`:r.slice(n.length+1)),r}function N(){let t=(0,o.useNavigate)(),n=e.D(),{allRoutes:r,currentRoute:i,currentVersion:a,currentLocale:c}=e.x(),l=n.versions,{setVersion:u}=e.w();return{currentVersion:a,currentVersionLabel:l?.versions?.find?.(e=>e.path===a)?.label||a,availableVersions:(0,s.useMemo)(()=>l?l.versions.map(e=>({key:e.path,label:e.label,value:e.path,isCurrent:e.path===a})):[],[l,a]),handleVersionChange:e=>{if(!l||e===a)return;u(e);let o=`${(n.base||`/docs`).replace(/\/$/,``)}/${e}${c?`/${c}`:``}`;if(i){let t=M(i.filePath,i.version,i.locale),a=r.find(r=>M(r.filePath,r.version,r.locale)===t&&(r.version||l.defaultVersion)===e&&(!n.i18n||(r.locale||n.i18n.defaultLocale)===c));if(a)o=a.path;else{let t=r.find(t=>M(t.filePath,t.version,t.locale)===`index.md`&&(t.version||l.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===c));t&&(o=t.path)}}else{let t=r.find(t=>(t.version||l.defaultVersion)===e&&(!n.i18n||(t.locale||n.i18n.defaultLocale)===c));t&&(o=t.path)}t(o)}}}function P(){let t=(0,o.useNavigate)(),n=e.D(),{allRoutes:r,currentRoute:i,currentLocale:a,currentVersion:c}=e.x(),l=n.i18n,{setLocale:u}=e.w(),d=e=>{if(!l||e===a)return;u(e);let o=n.base||`/`,s=o===`/`?``:o.replace(/\/$/,``),d=!!i?.filePath,f=``;if(i)if(d){let t=M(i.filePath,i.version,i.locale),n=r.find(n=>M(n.filePath,n.version,n.locale)===t&&(n.locale||l.defaultLocale)===e&&n.version===i.version);if(n)f=n.path;else{let t=r.find(t=>M(t.filePath,t.version,t.locale)===`index.md`&&(t.locale||l.defaultLocale)===e&&t.version===i.version);f=t?t.path:`${s}${i.version?`/${i.version}`:``}${e===l.defaultLocale?``:`/${e}`}`||`/`}}else{let t=i.path,n=t.split(`/`).filter(Boolean);if(n.length>0&&(Array.isArray(l.locales)?l.locales.includes(n[0]):l.locales[n[0]])&&(n.shift(),t=`/`+n.join(`/`)),e===l.defaultLocale)f=t===``?`/`:t;else{let n=t.startsWith(`/`)?t:`/${t}`;f=`/${e}${n===`/`?``:n}`}}else{let t=r.find(t=>(t.locale||l.defaultLocale)===e&&(t.version||n.versions?.defaultVersion)===(c||n.versions?.defaultVersion));if(t)f=t.path;else{let t=c&&c!==n.versions?.defaultVersion?`/${c}`:``;f=e===l.defaultLocale?`${s}${t}`:`${s}${t}/${e}`}}(!f||f===``)&&(f=`/`),f=f.replace(/\/+/g,`/`),t(f)},f=l?.locales,p=f?Array.isArray(f)?a:f[a]:void 0;return{currentLocale:a,currentLocaleLabel:l?.localeConfigs?.[a]?.label||p||a,availableLocales:(0,s.useMemo)(()=>l?Array.isArray(l.locales)?l.locales.map(e=>({key:e,label:l?.localeConfigs?.[e]?.label||e,value:e,isCurrent:e===a})):Object.entries(l.locales).map(([e,t])=>({key:e,label:l?.localeConfigs?.[e]?.label||t,value:e,isCurrent:e===a})):[],[l,a]),handleLocaleChange:d}}function F({className:n}){let{currentVersionLabel:r,availableVersions:i,handleVersionChange:a}=N();return i.length===0?null:(0,c.jsxs)(t.k.Trigger,{children:[(0,c.jsxs)(t.M,{className:e.y(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,n),children:[(0,c.jsx)(`span`,{className:`font-semibold text-[0.8125rem]`,children:r}),(0,c.jsx)(l.ChevronDown,{className:`w-3.5 h-3.5 text-muted/60`})]}),(0,c.jsx)(t.k.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:(0,c.jsx)(t.k.Section,{items:i,children:e=>(0,c.jsx)(t.k.Item,{onPress:()=>a(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body hover:bg-primary-50/50 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:e.label},`${e.value??``}`)})})]})}function I({className:n}){let{currentLocale:r,availableLocales:i,handleLocaleChange:a}=P();return i.length===0?null:(0,c.jsxs)(t.k.Trigger,{children:[(0,c.jsxs)(t.M,{className:e.y(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,n),children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,c.jsx)(l.Languages,{className:`w-3.5 h-3.5 text-primary-500`}),(0,c.jsx)(`span`,{className:`font-bold text-[0.75rem] uppercase opacity-90`,children:r||`en`})]}),(0,c.jsx)(l.ChevronDown,{className:`w-3.5 h-3.5 text-muted/60`})]}),(0,c.jsx)(t.k.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:(0,c.jsx)(t.k.Section,{items:i,children:e=>(0,c.jsx)(t.k.Item,{onPress:()=>a(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:(0,c.jsx)(`span`,{children:e.label})},`${e.value??``}`)})})]})}const L=(0,s.lazy)(()=>Promise.resolve().then(()=>require(`../search-dialog-CGyrozZE.cjs`)).then(e=>({default:e.SearchDialog})));function R(){let{links:n,title:i,logo:a,logoProps:u,github:d,social:f,config:p}=k(),{routes:m,allRoutes:h,currentRoute:g,currentVersion:_,currentLocale:v}=e.x(),{pathname:y}=(0,o.useLocation)(),{isSidebarOpen:b,toggleSidebar:x}=t.T(),[S,C]=(0,s.useState)(!1),w=p.theme||{},T=!!g?.filePath,E=w?.tabs&&w.tabs.length>0;return(0,c.jsxs)(r.n.Root,{className:e.y(`border-b border-subtle bg-main/80 backdrop-blur-md`,E&&`border-b-0`),children:[(0,c.jsxs)(r.n.Content,{children:[(0,c.jsxs)(r.n.Left,{children:[T&&(0,c.jsx)(t.M,{onPress:x,className:`mr-2 lg:hidden p-1.5 h-8 w-8 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 transition-colors`,"aria-label":b?`Close sidebar`:`Open sidebar`,children:b?(0,c.jsx)(l.X,{className:`w-5 h-5 text-body`}):(0,c.jsx)(l.Menu,{className:`w-5 h-5 text-body`})}),a&&(0,c.jsx)(r.n.Logo,{src:a,alt:u?.alt||i,width:u?.width??24,height:u?.height??24,href:`site:/`}),(0,c.jsx)(r.n.Title,{href:`site:/`,children:i}),(0,c.jsx)(`div`,{className:`hidden sm:block`,children:p.versions&&_&&(0,c.jsx)(F,{})})]}),(0,c.jsx)(r.n.Center,{children:(0,c.jsx)(s.Suspense,{fallback:(0,c.jsx)(`div`,{className:`h-9 w-32 animate-pulse rounded-md bg-surface`}),children:(0,c.jsx)(L,{routes:m||[]})})}),(0,c.jsxs)(r.n.Right,{children:[(0,c.jsx)(s.Suspense,{fallback:null,children:(0,c.jsx)(`div`,{className:`lg:hidden`,children:(0,c.jsx)(L,{routes:m||[]})})}),(0,c.jsx)(r.n.Links,{children:n.map(e=>(0,c.jsx)(ne,{link:e},e.href))}),(0,c.jsxs)(`div`,{className:`hidden sm:flex items-center gap-2`,children:[p.i18n&&v&&(0,c.jsx)(I,{}),(0,c.jsx)(r.n.Split,{className:`bg-subtle`})]}),(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(ee,{})}),d&&(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(D,{repo:w?.githubRepo??``})}),f.length>0&&(0,c.jsx)(`div`,{className:`hidden md:block`,children:(0,c.jsx)(r.n.Split,{className:`bg-subtle`})}),(0,c.jsx)(`div`,{className:`hidden md:flex items-center gap-1`,children:f.map(({icon:e,link:t})=>(0,c.jsx)(r.n.Socials,{icon:e,link:t,className:`p-1.5 text-muted hover:text-body hover:bg-surface rounded-md transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`},t))}),(0,c.jsx)(r.n.More,{onPress:()=>C(!0),className:`text-muted hover:text-body active:scale-90 transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`})]})]}),(0,c.jsxs)(r.n.MobileMenu,{isOpen:S,onClose:()=>C(!1),className:`bg-main/98 backdrop-blur-2xl`,children:[(0,c.jsx)(`div`,{className:`flex flex-col gap-1`,children:n.map(e=>(0,c.jsx)(z,{link:e,onClose:()=>C(!1)},e.href))}),f.length>0&&(0,c.jsxs)(`div`,{className:`mt-6`,children:[(0,c.jsx)(`div`,{className:`px-4 mb-4 text-xs font-bold uppercase tracking-widest text-muted/50`,children:`Connect`}),(0,c.jsx)(`div`,{className:`flex flex-wrap gap-2 px-2`,children:f.map(({icon:e,link:t})=>(0,c.jsx)(r.n.Socials,{icon:e,link:t,className:`p-3 bg-surface border border-subtle rounded-xl flex-1 justify-center`},t))})]})]}),T&&E&&w?.tabs&&(0,c.jsx)(`div`,{className:`w-full border-b border-subtle bg-main`,children:(0,c.jsx)(te,{tabs:w.tabs,routes:h||m||[]})})]})}function ne({link:t}){let n=e.b(t.href||``),{pathname:i}=(0,o.useLocation)(),a=i===n||i.startsWith(n+`/`);return t.items&&t.items.length>0?(0,c.jsx)(r.n.Dropdown,{label:(0,c.jsx)(`span`,{className:e.y(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm px-2 py-1`,a?`text-primary-500`:`text-muted hover:text-body`),children:t.label}),children:t.items?.map(t=>(0,c.jsx)(r.n.DropdownItem,{href:e.b(t.href||``),label:t.label},t.href))}):(0,c.jsx)(r.n.Link,{...t,href:n,active:a,className:e.y(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,a?`text-primary-500`:`text-muted hover:text-body`)})}function z({link:t,onClose:n}){let i=e.b(t.href||``),{pathname:a}=(0,o.useLocation)(),s=a===i;return t.items&&t.items.length>0?(0,c.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,c.jsx)(`div`,{className:e.y(`px-3 py-2 text-sm transition-all`,s?`text-body`:`text-muted/80 hover:text-body`),children:t.label}),(0,c.jsx)(`div`,{className:`flex flex-col gap-1 pl-4`,children:t.items?.map(e=>(0,c.jsx)(z,{link:e,onClose:n},e.href))})]}):(0,c.jsx)(r.n.MobileLink,{...t,href:i,active:s,onPress:n,className:e.y(`transition-all`,s?`text-body`:`text-muted/80 hover:text-body`)})}function B(){return(0,c.jsx)(`div`,{className:`flex items-center justify-center min-h-[65vh] text-center px-4`,children:(0,c.jsxs)(`div`,{className:`space-y-6 max-w-md mx-auto p-8 border border-subtle bg-surface rounded-2xl shadow-xs`,children:[(0,c.jsx)(`span`,{className:`block text-7xl font-extrabold tracking-tight text-primary-500`,children:`404`}),(0,c.jsxs)(`div`,{className:`space-y-2`,children:[(0,c.jsx)(`h1`,{className:`text-xl font-bold text-body`,children:`Page Not Found`}),(0,c.jsx)(`p`,{className:`text-sm text-muted leading-relaxed`,children:`The page you're looking for doesn't exist or has been moved.`})]}),(0,c.jsxs)(e._,{href:`/`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-main px-6 py-2.5 text-xs font-semibold text-body hover:bg-primary-50/50 hover:border-primary-500/50 transition-all duration-300 outline-none select-none`,children:[(0,c.jsx)(l.ArrowLeft,{size:14}),` Go to Home`]})]})})}function V({headings:e=[],editLink:n,communityHelp:r,filePath:i}){return e.length===0?null:(0,c.jsxs)(t._.Root,{children:[(0,c.jsxs)(t._.Header,{className:`flex flex-row gap-x-2`,children:[(0,c.jsx)(l.TextAlignStart,{size:16}),`On this page`]}),(0,c.jsx)(t._.Tree,{headings:e}),(n||r)&&(0,c.jsxs)(`div`,{className:`mt-8 pt-8 border-t border-subtle space-y-4`,children:[(0,c.jsx)(`p`,{className:`text-xs font-bold text-body`,children:`Need help?`}),(0,c.jsxs)(`ul`,{className:`space-y-3`,children:[n&&i&&(0,c.jsx)(`li`,{children:(0,c.jsxs)(`a`,{href:n.replace(`:path`,i),target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[(0,c.jsx)(l.Pencil,{size:16}),`Edit this page`]})}),r&&(0,c.jsx)(`li`,{children:(0,c.jsxs)(`a`,{href:r,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[(0,c.jsx)(l.CircleHelp,{size:16}),`Community help`]})})]})]})]})}function H(){let{routes:t,currentRoute:n}=e.x(),r=(0,o.useLocation)();return(0,s.useMemo)(()=>{if(!n)return{prevPage:null,nextPage:null,currentRoute:null};let e=n.tab?.toLowerCase(),i=e?t.filter(t=>t.tab?.toLowerCase()===e):t.filter(e=>!e.tab),a=i.findIndex(e=>e.path===r.pathname);return{prevPage:a>0?i[a-1]:null,nextPage:a!==-1&&a<i.length-1?i[a+1]:null,currentRoute:n}},[t,n,r.pathname])}function U(){let{prevPage:e,nextPage:n}=H();return!e&&!n?null:(0,c.jsxs)(t.h.Root,{className:`pt-8 border-t border-subtle grid sm:grid-cols-2 gap-4 animate-in fade-in slide-in-from-bottom-4 duration-700 select-none`,children:[e?(0,c.jsxs)(t.h.Link,{to:e.path,direction:`prev`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[(0,c.jsx)(t.h.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Previous`}),(0,c.jsx)(t.h.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:e.title})]}):(0,c.jsx)(`div`,{}),n?(0,c.jsxs)(t.h.Link,{to:n.path,direction:`next`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[(0,c.jsx)(t.h.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Next`}),(0,c.jsx)(t.h.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:n.title})]}):(0,c.jsx)(`div`,{})]})}function W({routes:e,config:n}){let{logo:r,title:i,logoProps:a}=k(),{closeSidebar:o}=t.T(),s=r?(0,c.jsx)(`img`,{src:r,alt:a?.alt||i,width:24,height:24,className:`rounded-xl`}):null,u=n.versions||n.i18n;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(t.i.Root,{children:(0,c.jsx)(t.i.Content,{children:(0,c.jsx)(t.i.Items,{routes:e})})}),(0,c.jsxs)(t.i.Mobile,{children:[(0,c.jsxs)(t.i.Header,{children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-3`,children:[s,(0,c.jsx)(`span`,{className:`font-bold text-lg tracking-tight text-body truncate max-w-[120px]`,children:i})]}),(0,c.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,c.jsx)(A,{className:`w-24 h-9 rounded-xl`}),(0,c.jsx)(t.M,{onPress:o,className:`h-9 w-9 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 text-muted hover:text-body transition-colors`,"aria-label":`Close sidebar`,children:(0,c.jsx)(l.X,{size:20})})]})]}),(0,c.jsxs)(t.i.Content,{children:[u&&(0,c.jsxs)(`div`,{className:`flex flex-col gap-4 mb-10`,children:[(0,c.jsxs)(`div`,{className:`flex gap-3`,children:[n.versions&&(0,c.jsx)(F,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`}),n.i18n&&(0,c.jsx)(I,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`})]}),(0,c.jsx)(`div`,{className:`mt-2 border-b border-subtle`})]}),(0,c.jsx)(t.i.Items,{routes:e})]})]})]})}const G=Object.assign(W,{Root:t.i.Root,Mobile:t.i.Mobile,Header:t.i.Header,Content:t.i.Content,Group:t.i.Group,Link:t.i.Link,SubGroup:t.i.SubGroup,Item:t.i.Item,Items:t.i.Items});function K({date:e}){if(!e)return null;let t=new Date(e);if(isNaN(t.getTime()))return null;let n=t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`});return(0,c.jsxs)(`div`,{className:`mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none`,children:[(0,c.jsx)(`span`,{}),(0,c.jsxs)(`span`,{className:`italic`,children:[`Last updated on `,n]})]})}function re({route:e,content:t,mdxComponents:n}){let r=v(),i=(0,s.useMemo)(()=>({LastUpdated:K,...r,...n}),[r,n]),a=i.LastUpdated||K;return t?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(t,{components:i}),e?.lastUpdated&&(0,c.jsx)(a,{date:e.lastUpdated})]}):null}function q({MDXComponent:e,mdxComponents:t}){let n=(0,o.useLoaderData)(),r=e||n?.MDXComponent,i=t||n?.mdxComponents;return r?(0,c.jsx)(re,{route:{path:n.path,filePath:n.filePath,title:n.frontmatter.title,description:n.frontmatter.description,headings:n.headings,locale:n.locale,version:n.version,group:n.group,groupTitle:n.groupTitle,lastUpdated:n.lastUpdated,frontmatter:n.frontmatter},content:r,mdxComponents:i}):null}const J=d,Y=J.Helmet||J.default?.Helmet||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e})),ie=J.HelmetProvider||J.default?.HelmetProvider||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e}));function ae(){let{pathname:e,hash:t}=(0,o.useLocation)();return(0,s.useLayoutEffect)(()=>{let e=document.querySelector(`.boltdocs-content`)||window,n=()=>e===window?window.scrollY:e.scrollTop,r=(t,n=`auto`)=>{e===window?window.scrollTo({top:t,behavior:n}):e.scrollTo({top:t,behavior:n})};if(t){let i=t.replace(`#`,``),a=document.getElementById(i);if(a){let t=e===window?0:e.getBoundingClientRect().top;r(a.getBoundingClientRect().top-t-80+n(),`auto`);return}}r(0)},[e,t]),null}const oe={...a.t,NotFound:B,404:B};function X(e){return e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e}function se({config:t}){let{currentLocale:n}=e.w();return(0,s.useEffect)(()=>{if(!t.i18n||typeof document>`u`)return;let e=n||t.i18n.defaultLocale,r=t.i18n.localeConfigs?.[e];document.documentElement.lang=r?.htmlLang||e||`en`,document.documentElement.dir=r?.direction||`ltr`},[n,t.i18n]),null}function ce({config:t,routeMap:n}){let r=(0,o.useLocation)(),{setLocale:i,setVersion:a}=e.w();return(0,s.useEffect)(()=>{let e=X(r.pathname),o=n.get(e);o&&(t.i18n&&i(o.locale||t.i18n.defaultLocale),t.versions&&a(o.version||t.versions.defaultVersion))},[r.pathname,t,n,i,a]),null}function Z({config:r,routes:i,components:a={}}){let l=(0,s.useMemo)(()=>({...oe,...f.default,...a}),[a]),{pathname:u}=(0,o.useLocation)(),d=(0,s.useMemo)(()=>X(u||`/`),[u]),p=(0,s.useMemo)(()=>{let e=new Map;for(let t of i){let n=X(t.path===``?`/`:t.path);e.set(n,t)}return e},[i]),m=(0,s.useMemo)(()=>{let e=p.get(d),t,n;return e&&(r.i18n&&(t=e.locale||r.i18n.defaultLocale),r.versions&&(n=e.version||r.versions.defaultVersion)),{initLocale:t,initVersion:n}},[d,r,p]);return(0,c.jsx)(ie,{children:(0,c.jsx)(e.T,{routes:i,children:(0,c.jsx)(n.c,{children:(0,c.jsx)(t.w,{children:(0,c.jsx)(y,{components:l,children:(0,c.jsxs)(e.E.Provider,{value:r,children:[(0,c.jsx)(ae,{}),(0,c.jsxs)(e.C,{initialLocale:m.initLocale,initialVersion:m.initVersion,children:[(0,c.jsx)(ce,{config:r,routeMap:p}),(0,c.jsx)(se,{config:r}),(0,c.jsx)(o.Outlet,{})]})]})})})})})})}function le({siteTitle:t,siteDescription:n,routes:r}){let i=(0,o.useLocation)(),a=e.D(),{currentLocale:l}=e.x(),u=(0,s.useMemo)(()=>r?.find?.(e=>e.path===i.pathname),[r,i.pathname]),d=u?.title,f=O(n,l),p=u?.description||f||``,m=O(t,l),h=d?`${d} | ${m}`:m,g=u?.seo||{},_=a?.seo?.metatags||{},v=a?.seo?.thumbnails?.background,y=g[`og:image`]||v;return(0,c.jsxs)(Y,{children:[(0,c.jsx)(`title`,{children:h}),(0,c.jsx)(`meta`,{name:`description`,content:p}),(0,c.jsx)(`meta`,{property:`og:title`,content:h}),(0,c.jsx)(`meta`,{property:`og:description`,content:p}),(0,c.jsx)(`meta`,{property:`og:type`,content:`article`}),typeof window<`u`&&(0,c.jsx)(`meta`,{property:`og:url`,content:window.location.href}),typeof window<`u`&&(0,c.jsx)(`link`,{rel:`canonical`,href:window.location.origin+i.pathname}),(0,c.jsx)(`meta`,{name:`twitter:card`,content:`summary`}),(0,c.jsx)(`meta`,{name:`twitter:title`,content:h}),(0,c.jsx)(`meta`,{name:`twitter:description`,content:p}),y&&(0,c.jsx)(`meta`,{name:`twitter:image`,content:y}),y&&(0,c.jsx)(`meta`,{property:`og:image`,content:y}),(0,c.jsx)(`meta`,{name:`generator`,content:`Boltdocs`}),Object.entries(_).map(([e,t])=>e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?(0,c.jsx)(`meta`,{property:e,content:t},e):(0,c.jsx)(`meta`,{name:e,content:t},e)),Object.entries(g).map(([e,t])=>e===`noindex`&&t===!0?(0,c.jsx)(`meta`,{name:`robots`,content:`noindex`},`noindex`):e===`robots`?(0,c.jsx)(`meta`,{name:`robots`,content:t},`robots`):e===`canonical`?(0,c.jsx)(`link`,{rel:`canonical`,href:t},`canonical`):e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?(0,c.jsx)(`meta`,{property:e,content:t},e):(0,c.jsx)(`meta`,{name:e,content:t},e))]})}function ue(){let t=e.D(),{currentRoute:n,allRoutes:r}=e.x();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(le,{siteTitle:t.theme?.title,siteDescription:t.theme?.description,routes:r||[]}),(0,c.jsx)(p.default,{route:n,children:(0,c.jsx)(o.Outlet,{})})]})}const de=()=>(0,c.jsx)(`div`,{className:`text-muted text-sm py-4`,children:`Loading...`}),fe=({moduleLoader:e,moduleKey:t,route:n,components:r})=>{let i=e?.default??e??null;return(0,s.useEffect)(()=>{if(!{}.hot||!t)return;let e=e=>{e.relPath.replace(/\\/g,`/`).replace(/^\//,``)===n.filePath.replace(/\\/g,`/`).replace(/^\//,``)&&import(t+`?t=`+Date.now()).then(e=>{})};return{}.hot.on(`boltdocs:mdx-update`,e),()=>({}).hot?.off(`boltdocs:mdx-update`,e)},[t,n.filePath]),i?(0,c.jsx)(q,{MDXComponent:i,mdxComponents:r}):(0,c.jsx)(de,{})},pe=()=>{let e=v();return(0,c.jsx)(e.NotFound||e[404]||B,{})};function me(e){let{routesData:t,config:n,mdxModules:r,externalPages:i,externalLayout:a,components:s}=e,l=a||(({children:e})=>(0,c.jsx)(c.Fragment,{children:e})),u=e=>{let t=n.base||`/`;return e.startsWith(t)?e:`${t===`/`?``:t.replace(/\/$/,``)}${e.startsWith(`/`)?e:`/${e}`}`||`/`},d=[],f=n.versions?.defaultVersion,p=(n.base||`/docs`).replace(/\/$/,``);f&&t.forEach(e=>{if(e.version)return;let t=e.path||``,n=t.startsWith(p)?t.substring(p.length).replace(/^\//,``):t.replace(/^\//,``);if(!(n===f||n.startsWith(`${f}/`))){let t=`${p}/${f}/${n}`.replace(/\/+/g,`/`).replace(/\/$/,``)||`/`;d.push({...e,path:t,version:f})}});let m=[...t,...d],h=new Map,g=Object.keys(r);if(g.length>0){let e=g[0].replace(/\\/g,`/`).split(`/`).filter(Boolean)[0]||`docs`,t=`/${e}/`,n=`./${e}/`;for(let e of g){let r=e.replace(/\\/g,`/`),i=``;r.indexOf(t)===-1?r.startsWith(n)&&(i=r.substring(n.length)):i=r.substring(r.indexOf(t)+t.length),i?h.set(i,e):h.set(r,e)}}let _=m.map(e=>{let t=e.filePath.replace(/\\/g,`/`),n=h.get(t),i=n?r[n]:null,a=u(e.path===``?`/`:e.path);return{path:a,element:(0,c.jsx)(fe,{moduleKey:n,moduleLoader:i,route:e,components:s},n||a),loader:async()=>({path:a,frontmatter:{title:e.title,description:e.description||``,...e.frontmatter||{}},headings:e.headings||[],filePath:e.filePath,locale:e.locale,version:e.version,group:e.group,groupTitle:e.groupTitle,date:e.date,lastUpdated:e.lastUpdated}),getStaticPaths:()=>[a]}}),v=(n.base||`/docs`).replace(/\/$/,``);v||=`/`;let y=n.i18n?.locales?Array.isArray(n.i18n.locales)?n.i18n.locales:Object.keys(n.i18n.locales):[],b=n.versions?.versions?.map(e=>e.path)||[],x=[];x.push({path:v,filter:()=>!0});let S=[];b.length>0&&b.forEach(e=>S.push(`/${e}`)),y.length>0&&y.forEach(e=>S.push(`/${e}`)),b.length>0&&y.length>0&&b.forEach(e=>{y.forEach(t=>{S.push(`/${e}/${t}`)})}),S.forEach(e=>{let t=v===`/`?e:`${v}${e}`;x.push({path:t,filter:e=>e.startsWith(t.replace(/\/$/,``)+`/`)})});let C=new Set(_.map(e=>(e.path||``).replace(/\/$/,``))),w=new Set;i&&Object.keys(i).forEach(e=>{let t=e.startsWith(`/`)?e:`/${e}`;w.add(t.replace(/\/$/,``)),n.i18n&&Object.keys(n.i18n.locales).forEach(e=>{w.add(`/${e}${t===`/`?``:t}`.replace(/\/$/,``))})}),x.forEach(({path:e,filter:t})=>{if(e===`/`)return;let r=e.replace(/\/$/,``);if(!(C.has(r)||w.has(r))){let i=n.theme?.tabs?.[0]?.id,a=i?`${r}/${i}`.replace(/\/+/g,`/`):null,s=a&&C.has(a.replace(/\/$/,``))?_.find(e=>e.path.replace(/\/$/,``)===a.replace(/\/$/,``)):_.find(e=>t(e.path)&&e.path!==r),l=s?s.path:_.length>0?_[0].path:null;l&&_.push({path:e,element:(0,c.jsx)(o.Navigate,{to:l,replace:!0}),loader:async()=>({path:e}),getStaticPaths:()=>[e]})}});let T=[{element:(0,c.jsx)(ue,{}),children:_}],E=[];return i&&Object.entries(i).forEach(([e,t])=>{let r=e.startsWith(`/`)?e:`/${e}`;T.find(e=>e.path===r)||(E.push({path:r,locale:n.i18n?.defaultLocale,title:e===`/`?`Home`:e.replace(/^\//,``).split(`/`).pop()||`Page`,filePath:``,headings:[]}),T.push({path:r,element:(0,c.jsx)(l,{children:(0,c.jsx)(t,{})}),loader:async()=>({path:r,locale:n.i18n?.defaultLocale}),getStaticPaths:()=>[r]}),n.i18n&&Object.keys(n.i18n.locales).forEach(n=>{let r=`/${n}${e===`/`?``:e}`;T.find(e=>e.path===r)||(E.push({path:r,locale:n,title:e,filePath:``,headings:[]}),T.push({path:r,element:(0,c.jsx)(l,{children:(0,c.jsx)(t,{})}),loader:async()=>({path:r,locale:n}),getStaticPaths:()=>[r]}))}))}),T.push({path:`*`,element:(0,c.jsx)(l,{children:(0,c.jsx)(pe,{})})}),[{element:(0,c.jsx)(Z,{config:n,routes:[...m,...E],components:s}),children:T}]}function Q(e){return typeof window>`u`?$():typeof window.gtag==`function`?he(e):window.dataLayer?ge(e):$()}function he(e){return{trackPageView:(t,n)=>{window.gtag?.(`event`,`page_view`,{page_path:t,page_title:n||document.title,send_to:e?.ga4?.measurementId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.gtag?.(`event`,t,{event_category:n,event_label:r,value:i,send_to:e?.ga4?.measurementId,...a})},trackSearch:(t,n)=>{window.gtag?.(`event`,`search`,{search_term:t,results_count:n,send_to:e?.ga4?.measurementId})},trackDownload:(t,n)=>{window.gtag?.(`event`,`file_download`,{file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.ga4?.measurementId})},trackExternalLink:t=>{window.gtag?.(`event`,`external_link`,{link_url:t,send_to:e?.ga4?.measurementId})},isEnabled:!0}}function ge(e){return{trackPageView:(t,n)=>{window.dataLayer?.push({event:`page_view`,page_path:t,page_title:n||document.title,send_to:e?.gtm?.tagId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.dataLayer?.push({event:t,event_category:n,event_label:r,value:i,send_to:e?.gtm?.tagId,...a})},trackSearch:(t,n)=>{window.dataLayer?.push({event:`search`,search_term:t,results_count:n,send_to:e?.gtm?.tagId})},trackDownload:(t,n)=>{window.dataLayer?.push({event:`file_download`,file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.gtm?.tagId})},trackExternalLink:t=>{window.dataLayer?.push({event:`external_link`,link_url:t,send_to:e?.gtm?.tagId})},isEnabled:!0}}function $(){return{trackPageView:()=>{},trackEvent:()=>{},trackSearch:()=>{},trackDownload:()=>{},trackExternalLink:()=>{},isEnabled:!1}}const _e=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`);function ve(e={}){let{config:n,autoTrackPageViews:r=!0,autoTrackDownloads:i=!0,autoTrackExternalLinks:a=!0,excludePatterns:o=[]}=e,c=typeof globalThis<`u`?globalThis[_e]:void 0,l=n??c?.integrations,u=(0,s.useMemo)(()=>Q(l),[l]),d=(0,s.useRef)(``),f=t.r();return(0,s.useEffect)(()=>{if(!r||!u.isEnabled)return;let e=f.pathname+f.search;e!==d.current&&(d.current=e,u.trackPageView(e,document.title))},[f.pathname,r,u]),(0,s.useEffect)(()=>{if(!i||!u.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);if(n&&!o.some(e=>e.test(n))&&(t.hasAttribute(`download`)||/\.(pdf|doc|docx|xls|xlsx|ppt|pptx|zip|rar|7z|tar|gz|mp3|mp4|avi|mov|png|jpg|jpeg|gif|svg|webp)$/i.test(n))){let e=n.split(`/`).pop()||n;u.trackDownload(e,e.split(`.`).pop())}};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[i,a,u,o]),(0,s.useEffect)(()=>{if(!a||!u.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);n&&(o.some(e=>e.test(n))||(n.startsWith(`http://`)||n.startsWith(`https://`)||n.startsWith(`//`))&&!n.includes(window.location.hostname)&&u.trackExternalLink(n))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[a,u,o]),u}function ye(){let e=(0,s.useMemo)(()=>Q(),[]);return(0,s.useCallback)((t,n)=>{e.trackPageView(t,n)},[e])}function be(){let e=(0,s.useMemo)(()=>Q(),[]);return(0,s.useCallback)(t=>{e.trackEvent(t)},[e])}function xe({children:n}){let{routes:r,currentRoute:i}=e.x(),a=e.D();return(0,c.jsxs)(t.t,{className:`selection:bg-primary-500/10 selection:text-primary-500`,children:[(0,c.jsx)(R,{}),(0,c.jsxs)(t.t.Body,{className:`bg-main`,children:[(0,c.jsx)(G,{routes:r||[],config:a}),(0,c.jsx)(t.t.Content,{className:`animate-in fade-in duration-500 scroll-smooth`,children:(0,c.jsxs)(t.t.ContentMdx,{className:`max-w-5xl px-2 pt-8 pb-24`,children:[(0,c.jsxs)(t.t.Header,{children:[(0,c.jsxs)(`div`,{className:`mb-4 border-b border-subtle pb-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,c.jsx)(x,{}),(0,c.jsx)(C,{mdxRaw:i?._rawContent,route:i})]}),i?.title&&(0,c.jsx)(`h1`,{className:`text-4xl font-bold tracking-tight text-default mb-3`,children:i.title}),i?.description&&(0,c.jsx)(`p`,{className:`text-lg text-muted-foreground mb-6 leading-relaxed`,children:i.description})]}),(0,c.jsx)(w,{children:(0,c.jsx)(`div`,{className:`prose prose-neutral dark:prose-invert max-w-none`,children:n})}),(0,c.jsx)(t.t.Footer,{children:(0,c.jsx)(U,{})})]})}),(0,c.jsx)(V,{headings:i?.headings,editLink:a.theme?.editLink,communityHelp:a.theme?.communityHelp,filePath:i?.filePath})]})]})}const Se=Object.assign(xe,{Body:t.t.Body,Content:t.t.Content,ContentMdx:t.t.ContentMdx,Header:t.t.Header,Footer:t.t.Footer});exports.BoltdocsShell=Z,exports.Breadcrumbs=x,exports.Card=a.r,exports.Cards=a.n,exports.CopyMarkdown=C,exports.DocsLayout=Se,exports.ErrorBoundary=w,exports.MdxPage=q,exports.Navbar=R,exports.NotFound=B,exports.OnThisPage=V,exports.PageNav=U,exports.SearchDialog=i.t,exports.Sidebar=G,Object.defineProperty(exports,`ViteReactSSG`,{enumerable:!0,get:function(){return m.ViteReactSSG}}),exports.cn=e.y,exports.copyToClipboard=a.i,exports.createRoutes=me,exports.getStarsRepo=T,exports.getTranslated=O,exports.reactToText=a.a,exports.useAnalytics=ve,exports.useBreadcrumbs=b,exports.useConfig=e.D,exports.useI18n=P,exports.useLocalizedTo=e.b,exports.useLocation=t.r,exports.useMdxComponents=v,exports.useNavbar=k,exports.usePageNav=H,exports.useRoutes=e.x,exports.useSearch=i.n,exports.useSearchHighlight=t.n,exports.useSidebar=t.m,exports.useTabs=j,exports.useTheme=n.l,exports.useTrackEvent=be,exports.useTrackPageView=ye,exports.useUI=t.T,exports.useVersion=N;
|
package/dist/client/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ import { C as BoltdocsConfig, D as BoltdocsSocialLink, E as BoltdocsMdxComponent
|
|
|
3
3
|
import { n as Card, t as Cards } from "../cards-CQn9mXZS.cjs";
|
|
4
4
|
import * as _$react from "react";
|
|
5
5
|
import React$1, { JSXElementConstructor, ReactNode } from "react";
|
|
6
|
-
import { RouteRecord } from "@bdocs/ssg";
|
|
6
|
+
import { RouteRecord, ViteReactSSG } from "@bdocs/ssg";
|
|
7
7
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
8
8
|
import * as _$react_router_dom0 from "react-router-dom";
|
|
9
9
|
import { LinkProps } from "react-router-dom";
|
|
@@ -390,4 +390,4 @@ declare const copyToClipboard: (text: string) => Promise<boolean>;
|
|
|
390
390
|
*/
|
|
391
391
|
declare function getStarsRepo(repo: string, token?: string, baseUrl?: string): Promise<string>;
|
|
392
392
|
//#endregion
|
|
393
|
-
export { BoltdocsConfig, type BoltdocsLocale, BoltdocsShell, BoltdocsTab, type BoltdocsTypes, type BoltdocsVersion, Breadcrumbs, Card, Cards, ComponentRoute, CopyMarkdown, DocsLayout, ErrorBoundary, LayoutProps, MdxPage, Navbar, NavbarLink, NotFound, OnThisPage, OnThisPageProps, PageNav, SearchDialog, Sidebar, SidebarProps, SiteConfig, TabsProps, cn, copyToClipboard, createRoutes, getStarsRepo, getTranslated, reactToText, useAnalytics, useBreadcrumbs, useConfig, useI18n, useLocalizedTo, useLocation, useMdxComponents, useNavbar, usePageNav, useRoutes, useSearch, useSearchHighlight, useSidebar, useTabs, useTheme, useTrackEvent, useTrackPageView, useUI, useVersion };
|
|
393
|
+
export { BoltdocsConfig, type BoltdocsLocale, BoltdocsShell, BoltdocsTab, type BoltdocsTypes, type BoltdocsVersion, Breadcrumbs, Card, Cards, ComponentRoute, CopyMarkdown, DocsLayout, ErrorBoundary, LayoutProps, MdxPage, Navbar, NavbarLink, NotFound, OnThisPage, OnThisPageProps, PageNav, SearchDialog, Sidebar, SidebarProps, SiteConfig, TabsProps, ViteReactSSG, cn, copyToClipboard, createRoutes, getStarsRepo, getTranslated, reactToText, useAnalytics, useBreadcrumbs, useConfig, useI18n, useLocalizedTo, useLocation, useMdxComponents, useNavbar, usePageNav, useRoutes, useSearch, useSearchHighlight, useSidebar, useTabs, useTheme, useTrackEvent, useTrackPageView, useUI, useVersion };
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
import { C as BoltdocsConfig, D as BoltdocsSocialLink, E as BoltdocsMdxComponents, O as BoltdocsTypes, S as TabsProps, T as BoltdocsLocale, _ as LayoutProps, a as SidebarItem, b as SidebarProps, d as SidebarMobile, f as SidebarRoot, g as ComponentRoute, h as BoltdocsTab, i as SidebarHeader, k as BoltdocsVersion, m as ComponentBase, n as SidebarContent, s as SidebarItems, u as SidebarLinkProps, v as NavbarLink, w as BoltdocsIntegrationsConfig, x as SiteConfig, y as OnThisPageProps } from "../sidebar-Dr1TiRIy.js";
|
|
3
3
|
import { n as Card, t as Cards } from "../cards-BLoSiRuL.js";
|
|
4
|
+
import { RouteRecord, ViteReactSSG } from "@bdocs/ssg";
|
|
4
5
|
import * as _$react_router_dom0 from "react-router-dom";
|
|
5
6
|
import { LinkProps } from "react-router-dom";
|
|
6
7
|
import * as _$react from "react";
|
|
7
8
|
import React$1, { JSXElementConstructor, ReactNode } from "react";
|
|
8
9
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
9
10
|
import { ClassValue } from "clsx";
|
|
10
|
-
import { RouteRecord } from "@bdocs/ssg";
|
|
11
11
|
|
|
12
12
|
//#region src/client/ssg/create-routes.d.ts
|
|
13
13
|
interface CreateRoutesOptions {
|
|
@@ -390,4 +390,4 @@ declare const copyToClipboard: (text: string) => Promise<boolean>;
|
|
|
390
390
|
*/
|
|
391
391
|
declare function getStarsRepo(repo: string, token?: string, baseUrl?: string): Promise<string>;
|
|
392
392
|
//#endregion
|
|
393
|
-
export { BoltdocsConfig, type BoltdocsLocale, BoltdocsShell, BoltdocsTab, type BoltdocsTypes, type BoltdocsVersion, Breadcrumbs, Card, Cards, ComponentRoute, CopyMarkdown, DocsLayout, ErrorBoundary, LayoutProps, MdxPage, Navbar, NavbarLink, NotFound, OnThisPage, OnThisPageProps, PageNav, SearchDialog, Sidebar, SidebarProps, SiteConfig, TabsProps, cn, copyToClipboard, createRoutes, getStarsRepo, getTranslated, reactToText, useAnalytics, useBreadcrumbs, useConfig, useI18n, useLocalizedTo, useLocation, useMdxComponents, useNavbar, usePageNav, useRoutes, useSearch, useSearchHighlight, useSidebar, useTabs, useTheme, useTrackEvent, useTrackPageView, useUI, useVersion };
|
|
393
|
+
export { BoltdocsConfig, type BoltdocsLocale, BoltdocsShell, BoltdocsTab, type BoltdocsTypes, type BoltdocsVersion, Breadcrumbs, Card, Cards, ComponentRoute, CopyMarkdown, DocsLayout, ErrorBoundary, LayoutProps, MdxPage, Navbar, NavbarLink, NotFound, OnThisPage, OnThisPageProps, PageNav, SearchDialog, Sidebar, SidebarProps, SiteConfig, TabsProps, ViteReactSSG, cn, copyToClipboard, createRoutes, getStarsRepo, getTranslated, reactToText, useAnalytics, useBreadcrumbs, useConfig, useI18n, useLocalizedTo, useLocation, useMdxComponents, useNavbar, usePageNav, useRoutes, useSearch, useSearchHighlight, useSidebar, useTabs, useTheme, useTrackEvent, useTrackPageView, useUI, useVersion };
|
package/dist/client/index.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import{r as e,t}from"../search-dialog-BKagVT17.js";import{C as n,D as r,E as i,S as a,T as o,_ as s,b as c,s as l,w as u,x as d,y as f}from"../icons-dev-CrQLjoQp.js";import{D as p,E as m,M as h,N as g,T as _,_ as v,h as y,i as b,j as x,k as S,m as C,n as w,r as ee,t as T,w as te}from"../docs-layout-BvAOWEJw.js";import{c as ne,l as E}from"../image-BkIfa9oo.js";import{n as D}from"../search-dialog-C8w12eUx.js";import{a as re,i as ie,n as ae,r as oe,t as se}from"../mdx-K0WYBAJ3.js";import{Navigate as ce,Outlet as O,useLoaderData as le,useLocation as k,useNavigate as ue}from"react-router-dom";import{Suspense as de,createContext as fe,lazy as pe,use as me,useCallback as he,useEffect as A,useLayoutEffect as ge,useMemo as j,useRef as _e,useState as M}from"react";import{Fragment as N,jsx as P,jsxs as F}from"react/jsx-runtime";import*as I from"lucide-react";import{ArrowLeft as ve,Check as L,ChevronDown as R,CircleHelp as ye,Copy as z,ExternalLink as be,Home as xe,Languages as Se,Menu as Ce,Monitor as B,Moon as V,Pencil as we,Sun as H,TextAlignStart as Te,X as Ee}from"lucide-react";import{Button as De}from"react-aria-components";import*as Oe from"react-helmet-async";import ke from"virtual:boltdocs-mdx-components";import Ae from"virtual:boltdocs-layout";const je=Symbol.for(`__BDOCS_MDX_COMPONENTS_CONTEXT__`),U=Symbol.for(`__BDOCS_MDX_COMPONENTS_INSTANCE__`),W=globalThis[je]||(globalThis[je]=fe({}));function G(){let e=me(W);return(!e||Object.keys(e).length===0)&&globalThis[U]?globalThis[U]:e}function Me({components:e,children:t}){let n=j(()=>{let t={},n={};return Object.entries(e).forEach(([e,r])=>{if(e.startsWith(`Frontmatter_`)){let t=e.slice(12);n[t]=r}else t[e]=r}),t.Frontmatter=n,t},[e]);return typeof globalThis<`u`&&(globalThis[U]=n),P(W.Provider,{value:n,children:t})}function Ne(){let{currentRoute:e}=d(),t=[];return e&&(e.groupTitle&&t.push({label:e.groupTitle}),t.push({label:e.title,href:e.path})),{crumbs:t,activeRoute:e}}function Pe(){let{crumbs:e,activeRoute:t}=Ne();return e.length===0?null:F(g.Root,{className:`gap-2 text-xs sm:text-sm font-medium`,children:[P(g.Item,{children:P(g.Link,{href:`/`,className:`text-muted hover:text-body transition-colors flex items-center`,children:P(xe,{size:14})})}),e.map((e,n)=>{let r=e.href===t?.path;return F(g.Item,{className:`gap-2`,children:[P(g.Separator,{className:`text-muted/40`}),P(g.Link,{href:e.href,className:f(`transition-colors`,r?`text-body font-semibold cursor-default pointer-events-none`:`text-muted hover:text-body`),children:e.label})]},`crumb-${e.href}-${e.label}-${n}`)})]})}const Fe=e=>{let[t,n]=M(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},handleOpenRaw:()=>{let t=new Blob([e],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t);window.open(n,`_blank`)}}};function Ie({content:e,mdxRaw:t}){let n=t||e||``,{copied:r,handleCopy:i,handleOpenRaw:a}=Fe(n);return n?P(`div`,{className:`relative inline-flex z-100 shrink-0 w-max`,children:F(x,{className:`rounded-xl border border-subtle bg-surface transition-all duration-300 hover:border-primary-500/50 group overflow-hidden`,children:[P(h,{onPress:i,className:f(`md:hidden flex items-center justify-center w-8 h-8 bg-transparent outline-none select-none cursor-pointer border-none`,`text-muted transition-all duration-300 hover:bg-primary-500/5 hover:text-body`,r&&`text-emerald-500 hover:bg-emerald-500/5`),"aria-label":r?`Copied!`:`Copy Markdown`,children:P(r?L:z,{size:14})}),F(h,{onPress:i,className:f(`hidden md:flex items-center gap-2 px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 shrink-0 outline-none select-none cursor-pointer border-none`,`text-body transition-all duration-300 hover:bg-primary-500/5`,r&&`text-emerald-500 hover:bg-emerald-500/5`),children:[P(r?L:z,{size:16}),r?`Copied!`:`Copy Markdown`]}),F(S.Trigger,{placement:`bottom end`,children:[P(h,{className:f(`flex items-center justify-center px-2.5 md:px-3.5 h-8 md:h-9 border-none border-l border-subtle/50 text-muted rounded-none bg-transparent shrink-0 outline-none select-none cursor-pointer`,`transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500`),children:P(R,{size:14})}),F(S.Root,{className:`w-52 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[F(S.Item,{onAction:i,className:`flex items-center px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[P(z,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),P(`span`,{className:`ml-2`,children:`Copy Markdown`})]}),F(S.Item,{onAction:a,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[P(be,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),P(`span`,{className:`ml-2`,children:`View as Markdown`})]})]})]})]})}):null}function Le({children:e,fallback:t}){return P(p,{fallback:t,children:e})}async function Re(e,t,n=`https://api.github.com`){let r=new Headers;t&&r.append(`authorization`,t);let i=await(await fetch(`${n}/repos/${e}`,{headers:r})).json();return i.stargazers_count===void 0?`0`:ze(i.stargazers_count)}const ze=e=>Intl.NumberFormat(`en`,{notation:`compact`,compactDisplay:`short`}).format(e);function Be({repo:e}){let[t,n]=M(null);return A(()=>{e&&Re(e).then(e=>n(e)).catch(()=>n(`0`))},[e]),F(`a`,{href:`https://github.com/${e}`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-muted dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 hover:border-primary-500/50 hover:text-body select-none outline-none`,children:[P(l,{className:`h-4 w-4 text-body`}),t!==null&&F(`span`,{className:`tabular-nums font-medium`,children:[t,` stars`]})]})}function K(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function q(){let e=r(),{theme:t,resolvedTheme:n}=E(),i=k(),{currentLocale:a}=d(),o=e.theme||{},s=K(o.title,a)||`Boltdocs`,c=o.navbar||[],l=o.socialLinks||[],u=o.githubRepo,f=j(()=>c.map(t=>{let n=t.href||t.to||t.link||``,r=t=>{let n=i.pathname;if(n===t)return!0;if(!t||t===`/`)return n===`/`;let r=t=>{let n=t.split(`/`).filter(Boolean),r=0;return e.i18n?.locales&&n[r]&&e.i18n.locales[n[r]]&&r++,e.versions?.versions&&n[r]&&e.versions.versions.some(e=>e.path===n[r])&&r++,n.slice(r)},a=r(t),o=r(n);return a.length===0?o.length===0:o.length<a.length?!1:a.every((e,t)=>o[t]===e)},o=(e=>{if(!(!e||e.length===0))return e.map(e=>{let t=e.href||e.to||e.link||``;return{label:K(e.label||e.text,a),href:t,active:r(t),to:t.startsWith(`http`)||t.startsWith(`//`)?`external`:void 0}})})(t.items);return{label:K(t.label||t.text,a),href:n,active:r(n),to:n.startsWith(`http`)||n.startsWith(`//`)?`external`:void 0,items:o}}),[c,i.pathname,a,e]),p=o.logo;return{links:f,title:s,logo:p?typeof p==`string`?p:n===`dark`?p.dark:p.light:null,logoProps:{alt:(p&&typeof p==`object`?p.alt:void 0)||s,width:p&&typeof p==`object`?p.width:void 0,height:p&&typeof p==`object`?p.height:void 0},github:u?`https://github.com/${u}`:null,social:l,config:e,theme:t}}function Ve(){let{theme:e,setTheme:t}=E(),[n,r]=M(!1);if(A(()=>{r(!0)},[]),!n)return P(`div`,{className:`h-9 w-9`});let i=e===`system`?B:e===`dark`?V:H;return F(S.Trigger,{placement:`bottom right`,children:[P(De,{className:`flex h-9 w-9 items-center justify-center rounded-xl text-muted transition-colors hover:bg-surface hover:text-body outline-none border-none bg-transparent cursor-pointer`,"aria-label":`Selection theme`,children:P(i,{size:20,className:`animate-in fade-in zoom-in duration-300`})}),F(S.Root,{selectionMode:`single`,selectedKeys:[e],onSelectionChange:e=>{let n=Array.from(e)[0];t(n)},className:`w-36 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[F(S.Item,{id:`light`,className:`group flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[P(H,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),P(`span`,{className:`ml-2`,children:`Light`})]}),F(S.Item,{id:`dark`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[P(V,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),P(`span`,{className:`ml-2`,children:`Dark`})]}),F(S.Item,{id:`system`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[P(B,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),P(`span`,{className:`ml-2`,children:`System`})]})]})]})}function He({className:e}){let{theme:t,setTheme:n}=E(),[r,i]=M(!1);if(A(()=>{i(!0)},[]),!r)return P(`div`,{className:f(`h-10 w-full bg-surface rounded-xl animate-pulse`,e)});let a=t===`dark`;return F(`div`,{className:f(`flex p-1 bg-surface border border-subtle rounded-xl relative w-full h-11`,e),children:[P(`div`,{className:f(`absolute inset-y-1 w-[calc(50%-4px)] bg-main border border-subtle rounded-lg transition-all duration-300 ease-out shadow-xs`,a?`translate-x-full`:`translate-x-0`)}),P(`button`,{onClick:()=>n(`light`),className:f(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,a?`text-muted hover:text-body`:`text-body font-semibold`),"aria-label":`Light mode`,children:P(H,{size:18})}),P(`button`,{onClick:()=>n(`dark`),className:f(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,a?`text-body font-semibold`:`text-muted hover:text-body`),"aria-label":`Dark mode`,children:P(V,{size:18})})]})}function Ue(e=[],t=[]){let n=k(),r=_e([]),[i,o]=M({opacity:0,transform:`translateX(0) scaleX(0)`,width:0}),s=a(n.pathname),c=t.find(e=>a(e.path)===s)?.tab?.toLowerCase(),l=e.findIndex(e=>e.id.toLowerCase()===c),u=l===-1?0:l;return A(()=>{let e=r.current[u];e&&o({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[u,e.length,n.pathname]),{tabs:e,activeIndex:u,indicatorStyle:i,tabRefs:r,activeTabId:c}}function We({tabs:e,routes:t}){let{currentLocale:n}=d(),{indicatorStyle:r,tabRefs:i,activeIndex:a}=Ue(e,t);A(()=>{let e=i.current[a];e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[a]);let o=e=>{if(!e)return null;if(e.trim().startsWith(`<svg`))return P(`span`,{className:`h-4 w-4`,dangerouslySetInnerHTML:{__html:e}});let t=I[e];return t?P(t,{size:16}):P(`img`,{src:e,alt:``,className:`h-4 w-4 object-contain`})};return P(`div`,{className:`mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6 select-none`,children:F(m.List,{className:`border-none py-0 scrollbar-hide relative flex flex-row items-center`,children:[e.map((e,r)=>{let c=r===a,l=t.find(t=>t.tab&&t.tab.toLowerCase()===e.id.toLowerCase());return F(s,{href:l?l.path:`#`,ref:e=>{i.current[r]=e},className:`relative flex items-center gap-2 px-4 py-3.5 text-sm font-semibold transition-colors duration-300 outline-none whitespace-nowrap ${c?`text-primary-500`:`text-muted hover:text-body`}`,children:[o(e.icon),P(`span`,{children:K(e.text,n)})]},e.id)}),P(m.Indicator,{style:r,className:`h-0.5 bg-primary-500 rounded-full transition-all duration-300`})]})})}function J(e,t,n){let r=e;return t&&(r===t||r.startsWith(t+`/`))&&(r=r===t?`index.md`:r.slice(t.length+1)),n&&(r===n||r.startsWith(n+`/`))&&(r=r===n?`index.md`:r.slice(n.length+1)),r}function Ge(){let e=ue(),t=r(),{allRoutes:n,currentRoute:i,currentVersion:a,currentLocale:o}=d(),s=t.versions,{setVersion:c}=u();return{currentVersion:a,currentVersionLabel:s?.versions?.find?.(e=>e.path===a)?.label||a,availableVersions:j(()=>s?s.versions.map(e=>({key:e.path,label:e.label,value:e.path,isCurrent:e.path===a})):[],[s,a]),handleVersionChange:r=>{if(!s||r===a)return;c(r);let l=`${(t.base||`/docs`).replace(/\/$/,``)}/${r}${o?`/${o}`:``}`;if(i){let e=J(i.filePath,i.version,i.locale),a=n.find(n=>J(n.filePath,n.version,n.locale)===e&&(n.version||s.defaultVersion)===r&&(!t.i18n||(n.locale||t.i18n.defaultLocale)===o));if(a)l=a.path;else{let e=n.find(e=>J(e.filePath,e.version,e.locale)===`index.md`&&(e.version||s.defaultVersion)===r&&(!t.i18n||(e.locale||t.i18n.defaultLocale)===o));e&&(l=e.path)}}else{let e=n.find(e=>(e.version||s.defaultVersion)===r&&(!t.i18n||(e.locale||t.i18n.defaultLocale)===o));e&&(l=e.path)}e(l)}}}function Ke(){let e=ue(),t=r(),{allRoutes:n,currentRoute:i,currentLocale:a,currentVersion:o}=d(),s=t.i18n,{setLocale:c}=u(),l=r=>{if(!s||r===a)return;c(r);let l=t.base||`/`,u=l===`/`?``:l.replace(/\/$/,``),d=!!i?.filePath,f=``;if(i)if(d){let e=J(i.filePath,i.version,i.locale),t=n.find(t=>J(t.filePath,t.version,t.locale)===e&&(t.locale||s.defaultLocale)===r&&t.version===i.version);if(t)f=t.path;else{let e=n.find(e=>J(e.filePath,e.version,e.locale)===`index.md`&&(e.locale||s.defaultLocale)===r&&e.version===i.version);f=e?e.path:`${u}${i.version?`/${i.version}`:``}${r===s.defaultLocale?``:`/${r}`}`||`/`}}else{let e=i.path,t=e.split(`/`).filter(Boolean);if(t.length>0&&(Array.isArray(s.locales)?s.locales.includes(t[0]):s.locales[t[0]])&&(t.shift(),e=`/`+t.join(`/`)),r===s.defaultLocale)f=e===``?`/`:e;else{let t=e.startsWith(`/`)?e:`/${e}`;f=`/${r}${t===`/`?``:t}`}}else{let e=n.find(e=>(e.locale||s.defaultLocale)===r&&(e.version||t.versions?.defaultVersion)===(o||t.versions?.defaultVersion));if(e)f=e.path;else{let e=o&&o!==t.versions?.defaultVersion?`/${o}`:``;f=r===s.defaultLocale?`${u}${e}`:`${u}${e}/${r}`}}(!f||f===``)&&(f=`/`),f=f.replace(/\/+/g,`/`),e(f)},f=s?.locales,p=f?Array.isArray(f)?a:f[a]:void 0;return{currentLocale:a,currentLocaleLabel:s?.localeConfigs?.[a]?.label||p||a,availableLocales:j(()=>s?Array.isArray(s.locales)?s.locales.map(e=>({key:e,label:s?.localeConfigs?.[e]?.label||e,value:e,isCurrent:e===a})):Object.entries(s.locales).map(([e,t])=>({key:e,label:s?.localeConfigs?.[e]?.label||t,value:e,isCurrent:e===a})):[],[s,a]),handleLocaleChange:l}}function qe({className:e}){let{currentVersionLabel:t,availableVersions:n,handleVersionChange:r}=Ge();return n.length===0?null:F(S.Trigger,{children:[F(h,{className:f(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,e),children:[P(`span`,{className:`font-semibold text-[0.8125rem]`,children:t}),P(R,{className:`w-3.5 h-3.5 text-muted/60`})]}),P(S.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:P(S.Section,{items:n,children:e=>P(S.Item,{onPress:()=>r(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body hover:bg-primary-50/50 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:e.label},`${e.value??``}`)})})]})}function Je({className:e}){let{currentLocale:t,availableLocales:n,handleLocaleChange:r}=Ke();return n.length===0?null:F(S.Trigger,{children:[F(h,{className:f(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,e),children:[F(`div`,{className:`flex items-center gap-1.5`,children:[P(Se,{className:`w-3.5 h-3.5 text-primary-500`}),P(`span`,{className:`font-bold text-[0.75rem] uppercase opacity-90`,children:t||`en`})]}),P(R,{className:`w-3.5 h-3.5 text-muted/60`})]}),P(S.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:P(S.Section,{items:n,children:e=>P(S.Item,{onPress:()=>r(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:P(`span`,{children:e.label})},`${e.value??``}`)})})]})}const Ye=pe(()=>import(`../search-dialog-BKagVT17.js`).then(e=>e.n).then(e=>({default:e.SearchDialog})));function Xe(){let{links:e,title:t,logo:n,logoProps:r,github:i,social:a,config:o}=q(),{routes:s,allRoutes:c,currentRoute:l,currentVersion:u,currentLocale:p}=d(),{pathname:m}=k(),{isSidebarOpen:g,toggleSidebar:v}=_(),[y,b]=M(!1),x=o.theme||{},S=!!l?.filePath,C=x?.tabs&&x.tabs.length>0;return F(D.Root,{className:f(`border-b border-subtle bg-main/80 backdrop-blur-md`,C&&`border-b-0`),children:[F(D.Content,{children:[F(D.Left,{children:[S&&P(h,{onPress:v,className:`mr-2 lg:hidden p-1.5 h-8 w-8 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 transition-colors`,"aria-label":g?`Close sidebar`:`Open sidebar`,children:P(g?Ee:Ce,{className:`w-5 h-5 text-body`})}),n&&P(D.Logo,{src:n,alt:r?.alt||t,width:r?.width??24,height:r?.height??24,href:`site:/`}),P(D.Title,{href:`site:/`,children:t}),P(`div`,{className:`hidden sm:block`,children:o.versions&&u&&P(qe,{})})]}),P(D.Center,{children:P(de,{fallback:P(`div`,{className:`h-9 w-32 animate-pulse rounded-md bg-surface`}),children:P(Ye,{routes:s||[]})})}),F(D.Right,{children:[P(de,{fallback:null,children:P(`div`,{className:`lg:hidden`,children:P(Ye,{routes:s||[]})})}),P(D.Links,{children:e.map(e=>P(Ze,{link:e},e.href))}),F(`div`,{className:`hidden sm:flex items-center gap-2`,children:[o.i18n&&p&&P(Je,{}),P(D.Split,{className:`bg-subtle`})]}),P(`div`,{className:`hidden md:block`,children:P(Ve,{})}),i&&P(`div`,{className:`hidden md:block`,children:P(Be,{repo:x?.githubRepo??``})}),a.length>0&&P(`div`,{className:`hidden md:block`,children:P(D.Split,{className:`bg-subtle`})}),P(`div`,{className:`hidden md:flex items-center gap-1`,children:a.map(({icon:e,link:t})=>P(D.Socials,{icon:e,link:t,className:`p-1.5 text-muted hover:text-body hover:bg-surface rounded-md transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`},t))}),P(D.More,{onPress:()=>b(!0),className:`text-muted hover:text-body active:scale-90 transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`})]})]}),F(D.MobileMenu,{isOpen:y,onClose:()=>b(!1),className:`bg-main/98 backdrop-blur-2xl`,children:[P(`div`,{className:`flex flex-col gap-1`,children:e.map(e=>P(Qe,{link:e,onClose:()=>b(!1)},e.href))}),a.length>0&&F(`div`,{className:`mt-6`,children:[P(`div`,{className:`px-4 mb-4 text-xs font-bold uppercase tracking-widest text-muted/50`,children:`Connect`}),P(`div`,{className:`flex flex-wrap gap-2 px-2`,children:a.map(({icon:e,link:t})=>P(D.Socials,{icon:e,link:t,className:`p-3 bg-surface border border-subtle rounded-xl flex-1 justify-center`},t))})]})]}),S&&C&&x?.tabs&&P(`div`,{className:`w-full border-b border-subtle bg-main`,children:P(We,{tabs:x.tabs,routes:c||s||[]})})]})}function Ze({link:e}){let t=c(e.href||``),{pathname:n}=k(),r=n===t||n.startsWith(t+`/`);return e.items&&e.items.length>0?P(D.Dropdown,{label:P(`span`,{className:f(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm px-2 py-1`,r?`text-primary-500`:`text-muted hover:text-body`),children:e.label}),children:e.items?.map(e=>P(D.DropdownItem,{href:c(e.href||``),label:e.label},e.href))}):P(D.Link,{...e,href:t,active:r,className:f(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,r?`text-primary-500`:`text-muted hover:text-body`)})}function Qe({link:e,onClose:t}){let n=c(e.href||``),{pathname:r}=k(),i=r===n;return e.items&&e.items.length>0?F(`div`,{className:`flex flex-col gap-1`,children:[P(`div`,{className:f(`px-3 py-2 text-sm transition-all`,i?`text-body`:`text-muted/80 hover:text-body`),children:e.label}),P(`div`,{className:`flex flex-col gap-1 pl-4`,children:e.items?.map(e=>P(Qe,{link:e,onClose:t},e.href))})]}):P(D.MobileLink,{...e,href:n,active:i,onPress:t,className:f(`transition-all`,i?`text-body`:`text-muted/80 hover:text-body`)})}function Y(){return P(`div`,{className:`flex items-center justify-center min-h-[65vh] text-center px-4`,children:F(`div`,{className:`space-y-6 max-w-md mx-auto p-8 border border-subtle bg-surface rounded-2xl shadow-xs`,children:[P(`span`,{className:`block text-7xl font-extrabold tracking-tight text-primary-500`,children:`404`}),F(`div`,{className:`space-y-2`,children:[P(`h1`,{className:`text-xl font-bold text-body`,children:`Page Not Found`}),P(`p`,{className:`text-sm text-muted leading-relaxed`,children:`The page you're looking for doesn't exist or has been moved.`})]}),F(s,{href:`/`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-main px-6 py-2.5 text-xs font-semibold text-body hover:bg-primary-50/50 hover:border-primary-500/50 transition-all duration-300 outline-none select-none`,children:[P(ve,{size:14}),` Go to Home`]})]})})}function $e({headings:e=[],editLink:t,communityHelp:n,filePath:r}){return e.length===0?null:F(v.Root,{children:[F(v.Header,{className:`flex flex-row gap-x-2`,children:[P(Te,{size:16}),`On this page`]}),P(v.Tree,{headings:e}),(t||n)&&F(`div`,{className:`mt-8 pt-8 border-t border-subtle space-y-4`,children:[P(`p`,{className:`text-xs font-bold text-body`,children:`Need help?`}),F(`ul`,{className:`space-y-3`,children:[t&&r&&P(`li`,{children:F(`a`,{href:t.replace(`:path`,r),target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[P(we,{size:16}),`Edit this page`]})}),n&&P(`li`,{children:F(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[P(ye,{size:16}),`Community help`]})})]})]})]})}function et(){let{routes:e,currentRoute:t}=d(),n=k();return j(()=>{if(!t)return{prevPage:null,nextPage:null,currentRoute:null};let r=t.tab?.toLowerCase(),i=r?e.filter(e=>e.tab?.toLowerCase()===r):e.filter(e=>!e.tab),a=i.findIndex(e=>e.path===n.pathname);return{prevPage:a>0?i[a-1]:null,nextPage:a!==-1&&a<i.length-1?i[a+1]:null,currentRoute:t}},[e,t,n.pathname])}function tt(){let{prevPage:e,nextPage:t}=et();return!e&&!t?null:F(y.Root,{className:`pt-8 border-t border-subtle grid sm:grid-cols-2 gap-4 animate-in fade-in slide-in-from-bottom-4 duration-700 select-none`,children:[e?F(y.Link,{to:e.path,direction:`prev`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[P(y.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Previous`}),P(y.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:e.title})]}):P(`div`,{}),t?F(y.Link,{to:t.path,direction:`next`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[P(y.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Next`}),P(y.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:t.title})]}):P(`div`,{})]})}function nt({routes:e,config:t}){let{logo:n,title:r,logoProps:i}=q(),{closeSidebar:a}=_(),o=n?P(`img`,{src:n,alt:i?.alt||r,width:24,height:24,className:`rounded-xl`}):null,s=t.versions||t.i18n;return F(N,{children:[P(b.Root,{children:P(b.Content,{children:P(b.Items,{routes:e})})}),F(b.Mobile,{children:[F(b.Header,{children:[F(`div`,{className:`flex items-center gap-3`,children:[o,P(`span`,{className:`font-bold text-lg tracking-tight text-body truncate max-w-[120px]`,children:r})]}),F(`div`,{className:`flex items-center gap-2`,children:[P(He,{className:`w-24 h-9 rounded-xl`}),P(h,{onPress:a,className:`h-9 w-9 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 text-muted hover:text-body transition-colors`,"aria-label":`Close sidebar`,children:P(I.X,{size:20})})]})]}),F(b.Content,{children:[s&&F(`div`,{className:`flex flex-col gap-4 mb-10`,children:[F(`div`,{className:`flex gap-3`,children:[t.versions&&P(qe,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`}),t.i18n&&P(Je,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`})]}),P(`div`,{className:`mt-2 border-b border-subtle`})]}),P(b.Items,{routes:e})]})]})]})}const rt=Object.assign(nt,{Root:b.Root,Mobile:b.Mobile,Header:b.Header,Content:b.Content,Group:b.Group,Link:b.Link,SubGroup:b.SubGroup,Item:b.Item,Items:b.Items});function it({date:e}){if(!e)return null;let t=new Date(e);if(isNaN(t.getTime()))return null;let n=t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`});return F(`div`,{className:`mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none`,children:[P(`span`,{}),F(`span`,{className:`italic`,children:[`Last updated on `,n]})]})}function at({route:e,content:t,mdxComponents:n}){let r=G(),i=j(()=>({LastUpdated:it,...r,...n}),[r,n]),a=i.LastUpdated||it;return t?F(N,{children:[P(t,{components:i}),e?.lastUpdated&&P(a,{date:e.lastUpdated})]}):null}function ot({MDXComponent:e,mdxComponents:t}){let n=le(),r=e||n?.MDXComponent,i=t||n?.mdxComponents;return r?P(at,{route:{path:n.path,filePath:n.filePath,title:n.frontmatter.title,description:n.frontmatter.description,headings:n.headings,locale:n.locale,version:n.version,group:n.group,groupTitle:n.groupTitle,lastUpdated:n.lastUpdated,frontmatter:n.frontmatter},content:r,mdxComponents:i}):null}const X=Oe,st=X.Helmet||X.default?.Helmet||(({children:e})=>P(N,{children:e})),ct=X.HelmetProvider||X.default?.HelmetProvider||(({children:e})=>P(N,{children:e}));function lt(){let{pathname:e,hash:t}=k();return ge(()=>{let e=document.querySelector(`.boltdocs-content`)||window,n=()=>e===window?window.scrollY:e.scrollTop,r=(t,n=`auto`)=>{e===window?window.scrollTo({top:t,behavior:n}):e.scrollTo({top:t,behavior:n})};if(t){let i=t.replace(`#`,``),a=document.getElementById(i);if(a){let t=e===window?0:e.getBoundingClientRect().top;r(a.getBoundingClientRect().top-t-80+n(),`auto`);return}}r(0)},[e,t]),null}const ut={...se,NotFound:Y,404:Y};function Z(e){return e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e}function dt({config:e}){let{currentLocale:t}=u();return A(()=>{if(!e.i18n||typeof document>`u`)return;let n=t||e.i18n.defaultLocale,r=e.i18n.localeConfigs?.[n];document.documentElement.lang=r?.htmlLang||n||`en`,document.documentElement.dir=r?.direction||`ltr`},[t,e.i18n]),null}function ft({config:e,routeMap:t}){let n=k(),{setLocale:r,setVersion:i}=u();return A(()=>{let a=Z(n.pathname),o=t.get(a);o&&(e.i18n&&r(o.locale||e.i18n.defaultLocale),e.versions&&i(o.version||e.versions.defaultVersion))},[n.pathname,e,t,r,i]),null}function pt({config:e,routes:t,components:r={}}){let a=j(()=>({...ut,...ke,...r}),[r]),{pathname:s}=k(),c=j(()=>Z(s||`/`),[s]),l=j(()=>{let e=new Map;for(let n of t){let t=Z(n.path===``?`/`:n.path);e.set(t,n)}return e},[t]),u=j(()=>{let t=l.get(c),n,r;return t&&(e.i18n&&(n=t.locale||e.i18n.defaultLocale),e.versions&&(r=t.version||e.versions.defaultVersion)),{initLocale:n,initVersion:r}},[c,e,l]);return P(ct,{children:P(o,{routes:t,children:P(ne,{children:P(te,{children:P(Me,{components:a,children:F(i.Provider,{value:e,children:[P(lt,{}),F(n,{initialLocale:u.initLocale,initialVersion:u.initVersion,children:[P(ft,{config:e,routeMap:l}),P(dt,{config:e}),P(O,{})]})]})})})})})})}function mt({siteTitle:e,siteDescription:t,routes:n}){let i=k(),a=r(),{currentLocale:o}=d(),s=j(()=>n?.find?.(e=>e.path===i.pathname),[n,i.pathname]),c=s?.title,l=K(t,o),u=s?.description||l||``,f=K(e,o),p=c?`${c} | ${f}`:f,m=s?.seo||{},h=a?.seo?.metatags||{},g=a?.seo?.thumbnails?.background,_=m[`og:image`]||g;return F(st,{children:[P(`title`,{children:p}),P(`meta`,{name:`description`,content:u}),P(`meta`,{property:`og:title`,content:p}),P(`meta`,{property:`og:description`,content:u}),P(`meta`,{property:`og:type`,content:`article`}),typeof window<`u`&&P(`meta`,{property:`og:url`,content:window.location.href}),typeof window<`u`&&P(`link`,{rel:`canonical`,href:window.location.origin+i.pathname}),P(`meta`,{name:`twitter:card`,content:`summary`}),P(`meta`,{name:`twitter:title`,content:p}),P(`meta`,{name:`twitter:description`,content:u}),_&&P(`meta`,{name:`twitter:image`,content:_}),_&&P(`meta`,{property:`og:image`,content:_}),P(`meta`,{name:`generator`,content:`Boltdocs`}),Object.entries(h).map(([e,t])=>e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?P(`meta`,{property:e,content:t},e):P(`meta`,{name:e,content:t},e)),Object.entries(m).map(([e,t])=>e===`noindex`&&t===!0?P(`meta`,{name:`robots`,content:`noindex`},`noindex`):e===`robots`?P(`meta`,{name:`robots`,content:t},`robots`):e===`canonical`?P(`link`,{rel:`canonical`,href:t},`canonical`):e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?P(`meta`,{property:e,content:t},e):P(`meta`,{name:e,content:t},e))]})}function ht(){let e=r(),{currentRoute:t,allRoutes:n}=d();return F(N,{children:[P(mt,{siteTitle:e.theme?.title,siteDescription:e.theme?.description,routes:n||[]}),P(Ae,{route:t,children:P(O,{})})]})}const gt=()=>P(`div`,{className:`text-muted text-sm py-4`,children:`Loading...`}),_t=({moduleLoader:e,moduleKey:t,route:n,components:r})=>{let i=e?.default??e??null;return A(()=>{if(!import.meta.hot||!t)return;let e=e=>{e.relPath.replace(/\\/g,`/`).replace(/^\//,``)===n.filePath.replace(/\\/g,`/`).replace(/^\//,``)&&import(t+`?t=`+Date.now()).then(e=>{})};return import.meta.hot.on(`boltdocs:mdx-update`,e),()=>import.meta.hot?.off(`boltdocs:mdx-update`,e)},[t,n.filePath]),i?P(ot,{MDXComponent:i,mdxComponents:r}):P(gt,{})},vt=()=>{let e=G();return P(e.NotFound||e[404]||Y,{})};function yt(e){let{routesData:t,config:n,mdxModules:r,externalPages:i,externalLayout:a,components:o}=e,s=a||(({children:e})=>P(N,{children:e})),c=e=>{let t=n.base||`/`;return e.startsWith(t)?e:`${t===`/`?``:t.replace(/\/$/,``)}${e.startsWith(`/`)?e:`/${e}`}`||`/`},l=[],u=n.versions?.defaultVersion,d=(n.base||`/docs`).replace(/\/$/,``);u&&t.forEach(e=>{if(e.version)return;let t=e.path||``,n=t.startsWith(d)?t.substring(d.length).replace(/^\//,``):t.replace(/^\//,``);if(!(n===u||n.startsWith(`${u}/`))){let t=`${d}/${u}/${n}`.replace(/\/+/g,`/`).replace(/\/$/,``)||`/`;l.push({...e,path:t,version:u})}});let f=[...t,...l],p=new Map,m=Object.keys(r);if(m.length>0){let e=m[0].replace(/\\/g,`/`).split(`/`).filter(Boolean)[0]||`docs`,t=`/${e}/`,n=`./${e}/`;for(let e of m){let r=e.replace(/\\/g,`/`),i=``;r.indexOf(t)===-1?r.startsWith(n)&&(i=r.substring(n.length)):i=r.substring(r.indexOf(t)+t.length),i?p.set(i,e):p.set(r,e)}}let h=f.map(e=>{let t=e.filePath.replace(/\\/g,`/`),n=p.get(t),i=n?r[n]:null,a=c(e.path===``?`/`:e.path);return{path:a,element:P(_t,{moduleKey:n,moduleLoader:i,route:e,components:o},n||a),loader:async()=>({path:a,frontmatter:{title:e.title,description:e.description||``,...e.frontmatter||{}},headings:e.headings||[],filePath:e.filePath,locale:e.locale,version:e.version,group:e.group,groupTitle:e.groupTitle,date:e.date,lastUpdated:e.lastUpdated}),getStaticPaths:()=>[a]}}),g=(n.base||`/docs`).replace(/\/$/,``);g||=`/`;let _=n.i18n?.locales?Array.isArray(n.i18n.locales)?n.i18n.locales:Object.keys(n.i18n.locales):[],v=n.versions?.versions?.map(e=>e.path)||[],y=[];y.push({path:g,filter:()=>!0});let b=[];v.length>0&&v.forEach(e=>b.push(`/${e}`)),_.length>0&&_.forEach(e=>b.push(`/${e}`)),v.length>0&&_.length>0&&v.forEach(e=>{_.forEach(t=>{b.push(`/${e}/${t}`)})}),b.forEach(e=>{let t=g===`/`?e:`${g}${e}`;y.push({path:t,filter:e=>e.startsWith(t.replace(/\/$/,``)+`/`)})});let x=new Set(h.map(e=>(e.path||``).replace(/\/$/,``))),S=new Set;i&&Object.keys(i).forEach(e=>{let t=e.startsWith(`/`)?e:`/${e}`;S.add(t.replace(/\/$/,``)),n.i18n&&Object.keys(n.i18n.locales).forEach(e=>{S.add(`/${e}${t===`/`?``:t}`.replace(/\/$/,``))})}),y.forEach(({path:e,filter:t})=>{if(e===`/`)return;let r=e.replace(/\/$/,``);if(!(x.has(r)||S.has(r))){let i=n.theme?.tabs?.[0]?.id,a=i?`${r}/${i}`.replace(/\/+/g,`/`):null,o=a&&x.has(a.replace(/\/$/,``))?h.find(e=>e.path.replace(/\/$/,``)===a.replace(/\/$/,``)):h.find(e=>t(e.path)&&e.path!==r),s=o?o.path:h.length>0?h[0].path:null;s&&h.push({path:e,element:P(ce,{to:s,replace:!0}),loader:async()=>({path:e}),getStaticPaths:()=>[e]})}});let C=[{element:P(ht,{}),children:h}],w=[];return i&&Object.entries(i).forEach(([e,t])=>{let r=e.startsWith(`/`)?e:`/${e}`;C.find(e=>e.path===r)||(w.push({path:r,locale:n.i18n?.defaultLocale,title:e===`/`?`Home`:e.replace(/^\//,``).split(`/`).pop()||`Page`,filePath:``,headings:[]}),C.push({path:r,element:P(s,{children:P(t,{})}),loader:async()=>({path:r,locale:n.i18n?.defaultLocale}),getStaticPaths:()=>[r]}),n.i18n&&Object.keys(n.i18n.locales).forEach(n=>{let r=`/${n}${e===`/`?``:e}`;C.find(e=>e.path===r)||(w.push({path:r,locale:n,title:e,filePath:``,headings:[]}),C.push({path:r,element:P(s,{children:P(t,{})}),loader:async()=>({path:r,locale:n}),getStaticPaths:()=>[r]}))}))}),C.push({path:`*`,element:P(s,{children:P(vt,{})})}),[{element:P(pt,{config:n,routes:[...f,...w],components:o}),children:C}]}function Q(e){return typeof window>`u`?$():typeof window.gtag==`function`?bt(e):window.dataLayer?xt(e):$()}function bt(e){return{trackPageView:(t,n)=>{window.gtag?.(`event`,`page_view`,{page_path:t,page_title:n||document.title,send_to:e?.ga4?.measurementId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.gtag?.(`event`,t,{event_category:n,event_label:r,value:i,send_to:e?.ga4?.measurementId,...a})},trackSearch:(t,n)=>{window.gtag?.(`event`,`search`,{search_term:t,results_count:n,send_to:e?.ga4?.measurementId})},trackDownload:(t,n)=>{window.gtag?.(`event`,`file_download`,{file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.ga4?.measurementId})},trackExternalLink:t=>{window.gtag?.(`event`,`external_link`,{link_url:t,send_to:e?.ga4?.measurementId})},isEnabled:!0}}function xt(e){return{trackPageView:(t,n)=>{window.dataLayer?.push({event:`page_view`,page_path:t,page_title:n||document.title,send_to:e?.gtm?.tagId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.dataLayer?.push({event:t,event_category:n,event_label:r,value:i,send_to:e?.gtm?.tagId,...a})},trackSearch:(t,n)=>{window.dataLayer?.push({event:`search`,search_term:t,results_count:n,send_to:e?.gtm?.tagId})},trackDownload:(t,n)=>{window.dataLayer?.push({event:`file_download`,file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.gtm?.tagId})},trackExternalLink:t=>{window.dataLayer?.push({event:`external_link`,link_url:t,send_to:e?.gtm?.tagId})},isEnabled:!0}}function $(){return{trackPageView:()=>{},trackEvent:()=>{},trackSearch:()=>{},trackDownload:()=>{},trackExternalLink:()=>{},isEnabled:!1}}const St=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`);function Ct(e={}){let{config:t,autoTrackPageViews:n=!0,autoTrackDownloads:r=!0,autoTrackExternalLinks:i=!0,excludePatterns:a=[]}=e,o=typeof globalThis<`u`?globalThis[St]:void 0,s=t??o?.integrations,c=j(()=>Q(s),[s]),l=_e(``),u=ee();return A(()=>{if(!n||!c.isEnabled)return;let e=u.pathname+u.search;e!==l.current&&(l.current=e,c.trackPageView(e,document.title))},[u.pathname,n,c]),A(()=>{if(!r||!c.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);if(n&&!a.some(e=>e.test(n))&&(t.hasAttribute(`download`)||/\.(pdf|doc|docx|xls|xlsx|ppt|pptx|zip|rar|7z|tar|gz|mp3|mp4|avi|mov|png|jpg|jpeg|gif|svg|webp)$/i.test(n))){let e=n.split(`/`).pop()||n;c.trackDownload(e,e.split(`.`).pop())}};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[r,i,c,a]),A(()=>{if(!i||!c.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);n&&(a.some(e=>e.test(n))||(n.startsWith(`http://`)||n.startsWith(`https://`)||n.startsWith(`//`))&&!n.includes(window.location.hostname)&&c.trackExternalLink(n))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[i,c,a]),c}function wt(){let e=j(()=>Q(),[]);return he((t,n)=>{e.trackPageView(t,n)},[e])}function Tt(){let e=j(()=>Q(),[]);return he(t=>{e.trackEvent(t)},[e])}function Et({children:e}){let{routes:t,currentRoute:n}=d(),i=r();return F(T,{className:`selection:bg-primary-500/10 selection:text-primary-500`,children:[P(Xe,{}),F(T.Body,{className:`bg-main`,children:[P(rt,{routes:t||[],config:i}),P(T.Content,{className:`animate-in fade-in duration-500 scroll-smooth`,children:F(T.ContentMdx,{className:`max-w-5xl px-2 pt-8 pb-24`,children:[F(T.Header,{children:[F(`div`,{className:`mb-4 border-b border-subtle pb-4 flex flex-wrap items-center justify-between gap-3`,children:[P(Pe,{}),P(Ie,{mdxRaw:n?._rawContent,route:n})]}),n?.title&&P(`h1`,{className:`text-4xl font-bold tracking-tight text-default mb-3`,children:n.title}),n?.description&&P(`p`,{className:`text-lg text-muted-foreground mb-6 leading-relaxed`,children:n.description})]}),P(Le,{children:P(`div`,{className:`prose prose-neutral dark:prose-invert max-w-none`,children:e})}),P(T.Footer,{children:P(tt,{})})]})}),P($e,{headings:n?.headings,editLink:i.theme?.editLink,communityHelp:i.theme?.communityHelp,filePath:n?.filePath})]})]})}const Dt=Object.assign(Et,{Body:T.Body,Content:T.Content,ContentMdx:T.ContentMdx,Header:T.Header,Footer:T.Footer});export{pt as BoltdocsShell,Pe as Breadcrumbs,oe as Card,ae as Cards,Ie as CopyMarkdown,Dt as DocsLayout,Le as ErrorBoundary,ot as MdxPage,Xe as Navbar,Y as NotFound,$e as OnThisPage,tt as PageNav,t as SearchDialog,rt as Sidebar,f as cn,ie as copyToClipboard,yt as createRoutes,Re as getStarsRepo,K as getTranslated,re as reactToText,Ct as useAnalytics,Ne as useBreadcrumbs,r as useConfig,Ke as useI18n,c as useLocalizedTo,ee as useLocation,G as useMdxComponents,q as useNavbar,et as usePageNav,d as useRoutes,e as useSearch,w as useSearchHighlight,C as useSidebar,Ue as useTabs,E as useTheme,Tt as useTrackEvent,wt as useTrackPageView,_ as useUI,Ge as useVersion};
|
|
6
|
+
import{r as e,t}from"../search-dialog-BKagVT17.js";import{C as n,D as r,E as i,S as a,T as o,_ as s,b as c,s as l,w as u,x as d,y as f}from"../icons-dev-CrQLjoQp.js";import{D as p,E as m,M as h,N as g,T as _,_ as v,h as y,i as b,j as x,k as S,m as C,n as w,r as ee,t as T,w as te}from"../docs-layout-BvAOWEJw.js";import{c as ne,l as E}from"../image-BkIfa9oo.js";import{n as D}from"../search-dialog-C8w12eUx.js";import{a as re,i as ie,n as ae,r as oe,t as se}from"../mdx-K0WYBAJ3.js";import{ViteReactSSG as ce}from"@bdocs/ssg";import{Navigate as le,Outlet as ue,useLoaderData as de,useLocation as O,useNavigate as fe}from"react-router-dom";import{Suspense as k,createContext as pe,lazy as me,use as he,useCallback as ge,useEffect as A,useLayoutEffect as _e,useMemo as j,useRef as M,useState as N}from"react";import{Fragment as P,jsx as F,jsxs as I}from"react/jsx-runtime";import*as L from"lucide-react";import{ArrowLeft as ve,Check as ye,ChevronDown as R,CircleHelp as be,Copy as z,ExternalLink as xe,Home as Se,Languages as Ce,Menu as we,Monitor as Te,Moon as B,Pencil as Ee,Sun as V,TextAlignStart as De,X as Oe}from"lucide-react";import{Button as ke}from"react-aria-components";import*as Ae from"react-helmet-async";import je from"virtual:boltdocs-mdx-components";import Me from"virtual:boltdocs-layout";const H=Symbol.for(`__BDOCS_MDX_COMPONENTS_CONTEXT__`),U=Symbol.for(`__BDOCS_MDX_COMPONENTS_INSTANCE__`),W=globalThis[H]||(globalThis[H]=pe({}));function G(){let e=he(W);return(!e||Object.keys(e).length===0)&&globalThis[U]?globalThis[U]:e}function Ne({components:e,children:t}){let n=j(()=>{let t={},n={};return Object.entries(e).forEach(([e,r])=>{if(e.startsWith(`Frontmatter_`)){let t=e.slice(12);n[t]=r}else t[e]=r}),t.Frontmatter=n,t},[e]);return typeof globalThis<`u`&&(globalThis[U]=n),F(W.Provider,{value:n,children:t})}function Pe(){let{currentRoute:e}=d(),t=[];return e&&(e.groupTitle&&t.push({label:e.groupTitle}),t.push({label:e.title,href:e.path})),{crumbs:t,activeRoute:e}}function Fe(){let{crumbs:e,activeRoute:t}=Pe();return e.length===0?null:I(g.Root,{className:`gap-2 text-xs sm:text-sm font-medium`,children:[F(g.Item,{children:F(g.Link,{href:`/`,className:`text-muted hover:text-body transition-colors flex items-center`,children:F(Se,{size:14})})}),e.map((e,n)=>{let r=e.href===t?.path;return I(g.Item,{className:`gap-2`,children:[F(g.Separator,{className:`text-muted/40`}),F(g.Link,{href:e.href,className:f(`transition-colors`,r?`text-body font-semibold cursor-default pointer-events-none`:`text-muted hover:text-body`),children:e.label})]},`crumb-${e.href}-${e.label}-${n}`)})]})}const Ie=e=>{let[t,n]=N(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},handleOpenRaw:()=>{let t=new Blob([e],{type:`text/plain;charset=utf-8`}),n=URL.createObjectURL(t);window.open(n,`_blank`)}}};function Le({content:e,mdxRaw:t}){let n=t||e||``,{copied:r,handleCopy:i,handleOpenRaw:a}=Ie(n);return n?F(`div`,{className:`relative inline-flex z-100 shrink-0 w-max`,children:I(x,{className:`rounded-xl border border-subtle bg-surface transition-all duration-300 hover:border-primary-500/50 group overflow-hidden`,children:[F(h,{onPress:i,className:f(`md:hidden flex items-center justify-center w-8 h-8 bg-transparent outline-none select-none cursor-pointer border-none`,`text-muted transition-all duration-300 hover:bg-primary-500/5 hover:text-body`,r&&`text-emerald-500 hover:bg-emerald-500/5`),"aria-label":r?`Copied!`:`Copy Markdown`,children:F(r?ye:z,{size:14})}),I(h,{onPress:i,className:f(`hidden md:flex items-center gap-2 px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 shrink-0 outline-none select-none cursor-pointer border-none`,`text-body transition-all duration-300 hover:bg-primary-500/5`,r&&`text-emerald-500 hover:bg-emerald-500/5`),children:[F(r?ye:z,{size:16}),r?`Copied!`:`Copy Markdown`]}),I(S.Trigger,{placement:`bottom end`,children:[F(h,{className:f(`flex items-center justify-center px-2.5 md:px-3.5 h-8 md:h-9 border-none border-l border-subtle/50 text-muted rounded-none bg-transparent shrink-0 outline-none select-none cursor-pointer`,`transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500`),children:F(R,{size:14})}),I(S.Root,{className:`w-52 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[I(S.Item,{onAction:i,className:`flex items-center px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[F(z,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),F(`span`,{className:`ml-2`,children:`Copy Markdown`})]}),I(S.Item,{onAction:a,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group`,children:[F(xe,{size:16,className:`size-4 text-muted dark:group-hover:text-primary-500 group-hover:text-primary-400`}),F(`span`,{className:`ml-2`,children:`View as Markdown`})]})]})]})]})}):null}function Re({children:e,fallback:t}){return F(p,{fallback:t,children:e})}async function ze(e,t,n=`https://api.github.com`){let r=new Headers;t&&r.append(`authorization`,t);let i=await(await fetch(`${n}/repos/${e}`,{headers:r})).json();return i.stargazers_count===void 0?`0`:Be(i.stargazers_count)}const Be=e=>Intl.NumberFormat(`en`,{notation:`compact`,compactDisplay:`short`}).format(e);function Ve({repo:e}){let[t,n]=N(null);return A(()=>{e&&ze(e).then(e=>n(e)).catch(()=>n(`0`))},[e]),I(`a`,{href:`https://github.com/${e}`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-surface px-3 py-1.5 text-xs font-semibold text-muted dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 hover:border-primary-500/50 hover:text-body select-none outline-none`,children:[F(l,{className:`h-4 w-4 text-body`}),t!==null&&I(`span`,{className:`tabular-nums font-medium`,children:[t,` stars`]})]})}function K(e,t){return e?typeof e==`string`?e:t&&e[t]?e[t]:Object.values(e)[0]||``:``}function q(){let e=r(),{theme:t,resolvedTheme:n}=E(),i=O(),{currentLocale:a}=d(),o=e.theme||{},s=K(o.title,a)||`Boltdocs`,c=o.navbar||[],l=o.socialLinks||[],u=o.githubRepo,f=j(()=>c.map(t=>{let n=t.href||t.to||t.link||``,r=t=>{let n=i.pathname;if(n===t)return!0;if(!t||t===`/`)return n===`/`;let r=t=>{let n=t.split(`/`).filter(Boolean),r=0;return e.i18n?.locales&&n[r]&&e.i18n.locales[n[r]]&&r++,e.versions?.versions&&n[r]&&e.versions.versions.some(e=>e.path===n[r])&&r++,n.slice(r)},a=r(t),o=r(n);return a.length===0?o.length===0:o.length<a.length?!1:a.every((e,t)=>o[t]===e)},o=(e=>{if(!(!e||e.length===0))return e.map(e=>{let t=e.href||e.to||e.link||``;return{label:K(e.label||e.text,a),href:t,active:r(t),to:t.startsWith(`http`)||t.startsWith(`//`)?`external`:void 0}})})(t.items);return{label:K(t.label||t.text,a),href:n,active:r(n),to:n.startsWith(`http`)||n.startsWith(`//`)?`external`:void 0,items:o}}),[c,i.pathname,a,e]),p=o.logo;return{links:f,title:s,logo:p?typeof p==`string`?p:n===`dark`?p.dark:p.light:null,logoProps:{alt:(p&&typeof p==`object`?p.alt:void 0)||s,width:p&&typeof p==`object`?p.width:void 0,height:p&&typeof p==`object`?p.height:void 0},github:u?`https://github.com/${u}`:null,social:l,config:e,theme:t}}function He(){let{theme:e,setTheme:t}=E(),[n,r]=N(!1);if(A(()=>{r(!0)},[]),!n)return F(`div`,{className:`h-9 w-9`});let i=e===`system`?Te:e===`dark`?B:V;return I(S.Trigger,{placement:`bottom right`,children:[F(ke,{className:`flex h-9 w-9 items-center justify-center rounded-xl text-muted transition-colors hover:bg-surface hover:text-body outline-none border-none bg-transparent cursor-pointer`,"aria-label":`Selection theme`,children:F(i,{size:20,className:`animate-in fade-in zoom-in duration-300`})}),I(S.Root,{selectionMode:`single`,selectedKeys:[e],onSelectionChange:e=>{let n=Array.from(e)[0];t(n)},className:`w-36 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:[I(S.Item,{id:`light`,className:`group flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[F(V,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),F(`span`,{className:`ml-2`,children:`Light`})]}),I(S.Item,{id:`dark`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[F(B,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),F(`span`,{className:`ml-2`,children:`Dark`})]}),I(S.Item,{id:`system`,className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:[F(Te,{className:`group-hover:text-primary-500 dark:group-hover:text-primary-200`,size:16}),F(`span`,{className:`ml-2`,children:`System`})]})]})]})}function Ue({className:e}){let{theme:t,setTheme:n}=E(),[r,i]=N(!1);if(A(()=>{i(!0)},[]),!r)return F(`div`,{className:f(`h-10 w-full bg-surface rounded-xl animate-pulse`,e)});let a=t===`dark`;return I(`div`,{className:f(`flex p-1 bg-surface border border-subtle rounded-xl relative w-full h-11`,e),children:[F(`div`,{className:f(`absolute inset-y-1 w-[calc(50%-4px)] bg-main border border-subtle rounded-lg transition-all duration-300 ease-out shadow-xs`,a?`translate-x-full`:`translate-x-0`)}),F(`button`,{onClick:()=>n(`light`),className:f(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,a?`text-muted hover:text-body`:`text-body font-semibold`),"aria-label":`Light mode`,children:F(V,{size:18})}),F(`button`,{onClick:()=>n(`dark`),className:f(`flex-1 flex items-center justify-center rounded-lg z-10 transition-colors outline-none cursor-pointer border-none bg-transparent`,a?`text-body font-semibold`:`text-muted hover:text-body`),"aria-label":`Dark mode`,children:F(B,{size:18})})]})}function We(e=[],t=[]){let n=O(),r=M([]),[i,o]=N({opacity:0,transform:`translateX(0) scaleX(0)`,width:0}),s=a(n.pathname),c=t.find(e=>a(e.path)===s)?.tab?.toLowerCase(),l=e.findIndex(e=>e.id.toLowerCase()===c),u=l===-1?0:l;return A(()=>{let e=r.current[u];e&&o({opacity:1,width:e.offsetWidth,transform:`translateX(${e.offsetLeft}px)`})},[u,e.length,n.pathname]),{tabs:e,activeIndex:u,indicatorStyle:i,tabRefs:r,activeTabId:c}}function Ge({tabs:e,routes:t}){let{currentLocale:n}=d(),{indicatorStyle:r,tabRefs:i,activeIndex:a}=We(e,t);A(()=>{let e=i.current[a];e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})},[a]);let o=e=>{if(!e)return null;if(e.trim().startsWith(`<svg`))return F(`span`,{className:`h-4 w-4`,dangerouslySetInnerHTML:{__html:e}});let t=L[e];return t?F(t,{size:16}):F(`img`,{src:e,alt:``,className:`h-4 w-4 object-contain`})};return F(`div`,{className:`mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6 select-none`,children:I(m.List,{className:`border-none py-0 scrollbar-hide relative flex flex-row items-center`,children:[e.map((e,r)=>{let c=r===a,l=t.find(t=>t.tab&&t.tab.toLowerCase()===e.id.toLowerCase());return I(s,{href:l?l.path:`#`,ref:e=>{i.current[r]=e},className:`relative flex items-center gap-2 px-4 py-3.5 text-sm font-semibold transition-colors duration-300 outline-none whitespace-nowrap ${c?`text-primary-500`:`text-muted hover:text-body`}`,children:[o(e.icon),F(`span`,{children:K(e.text,n)})]},e.id)}),F(m.Indicator,{style:r,className:`h-0.5 bg-primary-500 rounded-full transition-all duration-300`})]})})}function J(e,t,n){let r=e;return t&&(r===t||r.startsWith(t+`/`))&&(r=r===t?`index.md`:r.slice(t.length+1)),n&&(r===n||r.startsWith(n+`/`))&&(r=r===n?`index.md`:r.slice(n.length+1)),r}function Ke(){let e=fe(),t=r(),{allRoutes:n,currentRoute:i,currentVersion:a,currentLocale:o}=d(),s=t.versions,{setVersion:c}=u();return{currentVersion:a,currentVersionLabel:s?.versions?.find?.(e=>e.path===a)?.label||a,availableVersions:j(()=>s?s.versions.map(e=>({key:e.path,label:e.label,value:e.path,isCurrent:e.path===a})):[],[s,a]),handleVersionChange:r=>{if(!s||r===a)return;c(r);let l=`${(t.base||`/docs`).replace(/\/$/,``)}/${r}${o?`/${o}`:``}`;if(i){let e=J(i.filePath,i.version,i.locale),a=n.find(n=>J(n.filePath,n.version,n.locale)===e&&(n.version||s.defaultVersion)===r&&(!t.i18n||(n.locale||t.i18n.defaultLocale)===o));if(a)l=a.path;else{let e=n.find(e=>J(e.filePath,e.version,e.locale)===`index.md`&&(e.version||s.defaultVersion)===r&&(!t.i18n||(e.locale||t.i18n.defaultLocale)===o));e&&(l=e.path)}}else{let e=n.find(e=>(e.version||s.defaultVersion)===r&&(!t.i18n||(e.locale||t.i18n.defaultLocale)===o));e&&(l=e.path)}e(l)}}}function qe(){let e=fe(),t=r(),{allRoutes:n,currentRoute:i,currentLocale:a,currentVersion:o}=d(),s=t.i18n,{setLocale:c}=u(),l=r=>{if(!s||r===a)return;c(r);let l=t.base||`/`,u=l===`/`?``:l.replace(/\/$/,``),d=!!i?.filePath,f=``;if(i)if(d){let e=J(i.filePath,i.version,i.locale),t=n.find(t=>J(t.filePath,t.version,t.locale)===e&&(t.locale||s.defaultLocale)===r&&t.version===i.version);if(t)f=t.path;else{let e=n.find(e=>J(e.filePath,e.version,e.locale)===`index.md`&&(e.locale||s.defaultLocale)===r&&e.version===i.version);f=e?e.path:`${u}${i.version?`/${i.version}`:``}${r===s.defaultLocale?``:`/${r}`}`||`/`}}else{let e=i.path,t=e.split(`/`).filter(Boolean);if(t.length>0&&(Array.isArray(s.locales)?s.locales.includes(t[0]):s.locales[t[0]])&&(t.shift(),e=`/`+t.join(`/`)),r===s.defaultLocale)f=e===``?`/`:e;else{let t=e.startsWith(`/`)?e:`/${e}`;f=`/${r}${t===`/`?``:t}`}}else{let e=n.find(e=>(e.locale||s.defaultLocale)===r&&(e.version||t.versions?.defaultVersion)===(o||t.versions?.defaultVersion));if(e)f=e.path;else{let e=o&&o!==t.versions?.defaultVersion?`/${o}`:``;f=r===s.defaultLocale?`${u}${e}`:`${u}${e}/${r}`}}(!f||f===``)&&(f=`/`),f=f.replace(/\/+/g,`/`),e(f)},f=s?.locales,p=f?Array.isArray(f)?a:f[a]:void 0;return{currentLocale:a,currentLocaleLabel:s?.localeConfigs?.[a]?.label||p||a,availableLocales:j(()=>s?Array.isArray(s.locales)?s.locales.map(e=>({key:e,label:s?.localeConfigs?.[e]?.label||e,value:e,isCurrent:e===a})):Object.entries(s.locales).map(([e,t])=>({key:e,label:s?.localeConfigs?.[e]?.label||t,value:e,isCurrent:e===a})):[],[s,a]),handleLocaleChange:l}}function Je({className:e}){let{currentVersionLabel:t,availableVersions:n,handleVersionChange:r}=Ke();return n.length===0?null:I(S.Trigger,{children:[I(h,{className:f(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,e),children:[F(`span`,{className:`font-semibold text-[0.8125rem]`,children:t}),F(R,{className:`w-3.5 h-3.5 text-muted/60`})]}),F(S.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:F(S.Section,{items:n,children:e=>F(S.Item,{onPress:()=>r(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body hover:bg-primary-50/50 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:e.label},`${e.value??``}`)})})]})}function Ye({className:e}){let{currentLocale:t,availableLocales:n,handleLocaleChange:r}=qe();return n.length===0?null:I(S.Trigger,{children:[I(h,{className:f(`flex h-9 items-center justify-between gap-2 border border-subtle bg-surface px-4 py-1.5 rounded-xl text-xs font-semibold text-body hover:bg-primary-50/20 hover:border-primary-500/50 transition-all duration-300 outline-none select-none cursor-pointer`,e),children:[I(`div`,{className:`flex items-center gap-1.5`,children:[F(Ce,{className:`w-3.5 h-3.5 text-primary-500`}),F(`span`,{className:`font-bold text-[0.75rem] uppercase opacity-90`,children:t||`en`})]}),F(R,{className:`w-3.5 h-3.5 text-muted/60`})]}),F(S.Root,{className:`w-40 bg-main border border-subtle rounded-xl p-1.5 shadow-md outline-none flex flex-col gap-0.5 animate-fade-in z-100`,children:F(S.Section,{items:n,children:e=>F(S.Item,{onPress:()=>r(e.value),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-xs font-medium text-body dark:hover:bg-primary-300/50 hover:bg-primary-200/50 transition-colors duration-100 cursor-pointer select-none outline-none group data-selected:text-primary-500 data-selected:bg-primary-500/5`,children:F(`span`,{children:e.label})},`${e.value??``}`)})})]})}const Xe=me(()=>import(`../search-dialog-BKagVT17.js`).then(e=>e.n).then(e=>({default:e.SearchDialog})));function Ze(){let{links:e,title:t,logo:n,logoProps:r,github:i,social:a,config:o}=q(),{routes:s,allRoutes:c,currentRoute:l,currentVersion:u,currentLocale:p}=d(),{pathname:m}=O(),{isSidebarOpen:g,toggleSidebar:v}=_(),[y,b]=N(!1),x=o.theme||{},S=!!l?.filePath,C=x?.tabs&&x.tabs.length>0;return I(D.Root,{className:f(`border-b border-subtle bg-main/80 backdrop-blur-md`,C&&`border-b-0`),children:[I(D.Content,{children:[I(D.Left,{children:[S&&F(h,{onPress:v,className:`mr-2 lg:hidden p-1.5 h-8 w-8 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 transition-colors`,"aria-label":g?`Close sidebar`:`Open sidebar`,children:F(g?Oe:we,{className:`w-5 h-5 text-body`})}),n&&F(D.Logo,{src:n,alt:r?.alt||t,width:r?.width??24,height:r?.height??24,href:`site:/`}),F(D.Title,{href:`site:/`,children:t}),F(`div`,{className:`hidden sm:block`,children:o.versions&&u&&F(Je,{})})]}),F(D.Center,{children:F(k,{fallback:F(`div`,{className:`h-9 w-32 animate-pulse rounded-md bg-surface`}),children:F(Xe,{routes:s||[]})})}),I(D.Right,{children:[F(k,{fallback:null,children:F(`div`,{className:`lg:hidden`,children:F(Xe,{routes:s||[]})})}),F(D.Links,{children:e.map(e=>F(Qe,{link:e},e.href))}),I(`div`,{className:`hidden sm:flex items-center gap-2`,children:[o.i18n&&p&&F(Ye,{}),F(D.Split,{className:`bg-subtle`})]}),F(`div`,{className:`hidden md:block`,children:F(He,{})}),i&&F(`div`,{className:`hidden md:block`,children:F(Ve,{repo:x?.githubRepo??``})}),a.length>0&&F(`div`,{className:`hidden md:block`,children:F(D.Split,{className:`bg-subtle`})}),F(`div`,{className:`hidden md:flex items-center gap-1`,children:a.map(({icon:e,link:t})=>F(D.Socials,{icon:e,link:t,className:`p-1.5 text-muted hover:text-body hover:bg-surface rounded-md transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`},t))}),F(D.More,{onPress:()=>b(!0),className:`text-muted hover:text-body active:scale-90 transition-all focus-visible:ring-2 focus-visible:ring-primary-500/30`})]})]}),I(D.MobileMenu,{isOpen:y,onClose:()=>b(!1),className:`bg-main/98 backdrop-blur-2xl`,children:[F(`div`,{className:`flex flex-col gap-1`,children:e.map(e=>F($e,{link:e,onClose:()=>b(!1)},e.href))}),a.length>0&&I(`div`,{className:`mt-6`,children:[F(`div`,{className:`px-4 mb-4 text-xs font-bold uppercase tracking-widest text-muted/50`,children:`Connect`}),F(`div`,{className:`flex flex-wrap gap-2 px-2`,children:a.map(({icon:e,link:t})=>F(D.Socials,{icon:e,link:t,className:`p-3 bg-surface border border-subtle rounded-xl flex-1 justify-center`},t))})]})]}),S&&C&&x?.tabs&&F(`div`,{className:`w-full border-b border-subtle bg-main`,children:F(Ge,{tabs:x.tabs,routes:c||s||[]})})]})}function Qe({link:e}){let t=c(e.href||``),{pathname:n}=O(),r=n===t||n.startsWith(t+`/`);return e.items&&e.items.length>0?F(D.Dropdown,{label:F(`span`,{className:f(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm px-2 py-1`,r?`text-primary-500`:`text-muted hover:text-body`),children:e.label}),children:e.items?.map(e=>F(D.DropdownItem,{href:c(e.href||``),label:e.label},e.href))}):F(D.Link,{...e,href:t,active:r,className:f(`transition-colors outline-none font-medium focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm`,r?`text-primary-500`:`text-muted hover:text-body`)})}function $e({link:e,onClose:t}){let n=c(e.href||``),{pathname:r}=O(),i=r===n;return e.items&&e.items.length>0?I(`div`,{className:`flex flex-col gap-1`,children:[F(`div`,{className:f(`px-3 py-2 text-sm transition-all`,i?`text-body`:`text-muted/80 hover:text-body`),children:e.label}),F(`div`,{className:`flex flex-col gap-1 pl-4`,children:e.items?.map(e=>F($e,{link:e,onClose:t},e.href))})]}):F(D.MobileLink,{...e,href:n,active:i,onPress:t,className:f(`transition-all`,i?`text-body`:`text-muted/80 hover:text-body`)})}function Y(){return F(`div`,{className:`flex items-center justify-center min-h-[65vh] text-center px-4`,children:I(`div`,{className:`space-y-6 max-w-md mx-auto p-8 border border-subtle bg-surface rounded-2xl shadow-xs`,children:[F(`span`,{className:`block text-7xl font-extrabold tracking-tight text-primary-500`,children:`404`}),I(`div`,{className:`space-y-2`,children:[F(`h1`,{className:`text-xl font-bold text-body`,children:`Page Not Found`}),F(`p`,{className:`text-sm text-muted leading-relaxed`,children:`The page you're looking for doesn't exist or has been moved.`})]}),I(s,{href:`/`,className:`inline-flex items-center gap-2 rounded-xl border border-subtle bg-main px-6 py-2.5 text-xs font-semibold text-body hover:bg-primary-50/50 hover:border-primary-500/50 transition-all duration-300 outline-none select-none`,children:[F(ve,{size:14}),` Go to Home`]})]})})}function et({headings:e=[],editLink:t,communityHelp:n,filePath:r}){return e.length===0?null:I(v.Root,{children:[I(v.Header,{className:`flex flex-row gap-x-2`,children:[F(De,{size:16}),`On this page`]}),F(v.Tree,{headings:e}),(t||n)&&I(`div`,{className:`mt-8 pt-8 border-t border-subtle space-y-4`,children:[F(`p`,{className:`text-xs font-bold text-body`,children:`Need help?`}),I(`ul`,{className:`space-y-3`,children:[t&&r&&F(`li`,{children:I(`a`,{href:t.replace(`:path`,r),target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[F(Ee,{size:16}),`Edit this page`]})}),n&&F(`li`,{children:I(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-2 text-sm text-muted hover:text-body transition-colors`,children:[F(be,{size:16}),`Community help`]})})]})]})]})}function tt(){let{routes:e,currentRoute:t}=d(),n=O();return j(()=>{if(!t)return{prevPage:null,nextPage:null,currentRoute:null};let r=t.tab?.toLowerCase(),i=r?e.filter(e=>e.tab?.toLowerCase()===r):e.filter(e=>!e.tab),a=i.findIndex(e=>e.path===n.pathname);return{prevPage:a>0?i[a-1]:null,nextPage:a!==-1&&a<i.length-1?i[a+1]:null,currentRoute:t}},[e,t,n.pathname])}function nt(){let{prevPage:e,nextPage:t}=tt();return!e&&!t?null:I(y.Root,{className:`pt-8 border-t border-subtle grid sm:grid-cols-2 gap-4 animate-in fade-in slide-in-from-bottom-4 duration-700 select-none`,children:[e?I(y.Link,{to:e.path,direction:`prev`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[F(y.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Previous`}),F(y.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:e.title})]}):F(`div`,{}),t?I(y.Link,{to:t.path,direction:`next`,className:`group border border-subtle bg-surface p-5 rounded-2xl transition-all duration-300 hover:border-primary-500/50 hover:bg-primary-50/20`,children:[F(y.Title,{className:`text-xs font-bold uppercase tracking-wider text-muted/60 mb-1`,children:`Next`}),F(y.Description,{className:`text-sm sm:text-base font-bold text-body group-hover:text-primary-500 transition-colors`,children:t.title})]}):F(`div`,{})]})}function rt({routes:e,config:t}){let{logo:n,title:r,logoProps:i}=q(),{closeSidebar:a}=_(),o=n?F(`img`,{src:n,alt:i?.alt||r,width:24,height:24,className:`rounded-xl`}):null,s=t.versions||t.i18n;return I(P,{children:[F(b.Root,{children:F(b.Content,{children:F(b.Items,{routes:e})})}),I(b.Mobile,{children:[I(b.Header,{children:[I(`div`,{className:`flex items-center gap-3`,children:[o,F(`span`,{className:`font-bold text-lg tracking-tight text-body truncate max-w-[120px]`,children:r})]}),I(`div`,{className:`flex items-center gap-2`,children:[F(Ue,{className:`w-24 h-9 rounded-xl`}),F(h,{onPress:a,className:`h-9 w-9 flex items-center justify-center bg-transparent border-none outline-none select-none cursor-pointer rounded-xl hover:bg-primary-50/50 text-muted hover:text-body transition-colors`,"aria-label":`Close sidebar`,children:F(L.X,{size:20})})]})]}),I(b.Content,{children:[s&&I(`div`,{className:`flex flex-col gap-4 mb-10`,children:[I(`div`,{className:`flex gap-3`,children:[t.versions&&F(Je,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`}),t.i18n&&F(Ye,{className:`flex-1 justify-between h-10 bg-surface border-subtle rounded-xl`})]}),F(`div`,{className:`mt-2 border-b border-subtle`})]}),F(b.Items,{routes:e})]})]})]})}const it=Object.assign(rt,{Root:b.Root,Mobile:b.Mobile,Header:b.Header,Content:b.Content,Group:b.Group,Link:b.Link,SubGroup:b.SubGroup,Item:b.Item,Items:b.Items});function at({date:e}){if(!e)return null;let t=new Date(e);if(isNaN(t.getTime()))return null;let n=t.toLocaleDateString(void 0,{year:`numeric`,month:`long`,day:`numeric`});return I(`div`,{className:`mt-16 pt-6 border-t border-subtle flex items-center justify-between text-xs text-muted select-none`,children:[F(`span`,{}),I(`span`,{className:`italic`,children:[`Last updated on `,n]})]})}function ot({route:e,content:t,mdxComponents:n}){let r=G(),i=j(()=>({LastUpdated:at,...r,...n}),[r,n]),a=i.LastUpdated||at;return t?I(P,{children:[F(t,{components:i}),e?.lastUpdated&&F(a,{date:e.lastUpdated})]}):null}function X({MDXComponent:e,mdxComponents:t}){let n=de(),r=e||n?.MDXComponent,i=t||n?.mdxComponents;return r?F(ot,{route:{path:n.path,filePath:n.filePath,title:n.frontmatter.title,description:n.frontmatter.description,headings:n.headings,locale:n.locale,version:n.version,group:n.group,groupTitle:n.groupTitle,lastUpdated:n.lastUpdated,frontmatter:n.frontmatter},content:r,mdxComponents:i}):null}const Z=Ae,st=Z.Helmet||Z.default?.Helmet||(({children:e})=>F(P,{children:e})),ct=Z.HelmetProvider||Z.default?.HelmetProvider||(({children:e})=>F(P,{children:e}));function lt(){let{pathname:e,hash:t}=O();return _e(()=>{let e=document.querySelector(`.boltdocs-content`)||window,n=()=>e===window?window.scrollY:e.scrollTop,r=(t,n=`auto`)=>{e===window?window.scrollTo({top:t,behavior:n}):e.scrollTo({top:t,behavior:n})};if(t){let i=t.replace(`#`,``),a=document.getElementById(i);if(a){let t=e===window?0:e.getBoundingClientRect().top;r(a.getBoundingClientRect().top-t-80+n(),`auto`);return}}r(0)},[e,t]),null}const ut={...se,NotFound:Y,404:Y};function Q(e){return e.endsWith(`/`)&&e.length>1?e.slice(0,-1):e}function dt({config:e}){let{currentLocale:t}=u();return A(()=>{if(!e.i18n||typeof document>`u`)return;let n=t||e.i18n.defaultLocale,r=e.i18n.localeConfigs?.[n];document.documentElement.lang=r?.htmlLang||n||`en`,document.documentElement.dir=r?.direction||`ltr`},[t,e.i18n]),null}function ft({config:e,routeMap:t}){let n=O(),{setLocale:r,setVersion:i}=u();return A(()=>{let a=Q(n.pathname),o=t.get(a);o&&(e.i18n&&r(o.locale||e.i18n.defaultLocale),e.versions&&i(o.version||e.versions.defaultVersion))},[n.pathname,e,t,r,i]),null}function pt({config:e,routes:t,components:r={}}){let a=j(()=>({...ut,...je,...r}),[r]),{pathname:s}=O(),c=j(()=>Q(s||`/`),[s]),l=j(()=>{let e=new Map;for(let n of t){let t=Q(n.path===``?`/`:n.path);e.set(t,n)}return e},[t]),u=j(()=>{let t=l.get(c),n,r;return t&&(e.i18n&&(n=t.locale||e.i18n.defaultLocale),e.versions&&(r=t.version||e.versions.defaultVersion)),{initLocale:n,initVersion:r}},[c,e,l]);return F(ct,{children:F(o,{routes:t,children:F(ne,{children:F(te,{children:F(Ne,{components:a,children:I(i.Provider,{value:e,children:[F(lt,{}),I(n,{initialLocale:u.initLocale,initialVersion:u.initVersion,children:[F(ft,{config:e,routeMap:l}),F(dt,{config:e}),F(ue,{})]})]})})})})})})}function mt({siteTitle:e,siteDescription:t,routes:n}){let i=O(),a=r(),{currentLocale:o}=d(),s=j(()=>n?.find?.(e=>e.path===i.pathname),[n,i.pathname]),c=s?.title,l=K(t,o),u=s?.description||l||``,f=K(e,o),p=c?`${c} | ${f}`:f,m=s?.seo||{},h=a?.seo?.metatags||{},g=a?.seo?.thumbnails?.background,_=m[`og:image`]||g;return I(st,{children:[F(`title`,{children:p}),F(`meta`,{name:`description`,content:u}),F(`meta`,{property:`og:title`,content:p}),F(`meta`,{property:`og:description`,content:u}),F(`meta`,{property:`og:type`,content:`article`}),typeof window<`u`&&F(`meta`,{property:`og:url`,content:window.location.href}),typeof window<`u`&&F(`link`,{rel:`canonical`,href:window.location.origin+i.pathname}),F(`meta`,{name:`twitter:card`,content:`summary`}),F(`meta`,{name:`twitter:title`,content:p}),F(`meta`,{name:`twitter:description`,content:u}),_&&F(`meta`,{name:`twitter:image`,content:_}),_&&F(`meta`,{property:`og:image`,content:_}),F(`meta`,{name:`generator`,content:`Boltdocs`}),Object.entries(h).map(([e,t])=>e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?F(`meta`,{property:e,content:t},e):F(`meta`,{name:e,content:t},e)),Object.entries(m).map(([e,t])=>e===`noindex`&&t===!0?F(`meta`,{name:`robots`,content:`noindex`},`noindex`):e===`robots`?F(`meta`,{name:`robots`,content:t},`robots`):e===`canonical`?F(`link`,{rel:`canonical`,href:t},`canonical`):e.startsWith(`og:`)||e.startsWith(`music:`)||e.startsWith(`video:`)||e.startsWith(`article:`)||e.startsWith(`book:`)||e.startsWith(`profile:`)?F(`meta`,{property:e,content:t},e):F(`meta`,{name:e,content:t},e))]})}function ht(){let e=r(),{currentRoute:t,allRoutes:n}=d();return I(P,{children:[F(mt,{siteTitle:e.theme?.title,siteDescription:e.theme?.description,routes:n||[]}),F(Me,{route:t,children:F(ue,{})})]})}const gt=()=>F(`div`,{className:`text-muted text-sm py-4`,children:`Loading...`}),_t=({moduleLoader:e,moduleKey:t,route:n,components:r})=>{let i=e?.default??e??null;return A(()=>{if(!import.meta.hot||!t)return;let e=e=>{e.relPath.replace(/\\/g,`/`).replace(/^\//,``)===n.filePath.replace(/\\/g,`/`).replace(/^\//,``)&&import(t+`?t=`+Date.now()).then(e=>{})};return import.meta.hot.on(`boltdocs:mdx-update`,e),()=>import.meta.hot?.off(`boltdocs:mdx-update`,e)},[t,n.filePath]),i?F(X,{MDXComponent:i,mdxComponents:r}):F(gt,{})},vt=()=>{let e=G();return F(e.NotFound||e[404]||Y,{})};function yt(e){let{routesData:t,config:n,mdxModules:r,externalPages:i,externalLayout:a,components:o}=e,s=a||(({children:e})=>F(P,{children:e})),c=e=>{let t=n.base||`/`;return e.startsWith(t)?e:`${t===`/`?``:t.replace(/\/$/,``)}${e.startsWith(`/`)?e:`/${e}`}`||`/`},l=[],u=n.versions?.defaultVersion,d=(n.base||`/docs`).replace(/\/$/,``);u&&t.forEach(e=>{if(e.version)return;let t=e.path||``,n=t.startsWith(d)?t.substring(d.length).replace(/^\//,``):t.replace(/^\//,``);if(!(n===u||n.startsWith(`${u}/`))){let t=`${d}/${u}/${n}`.replace(/\/+/g,`/`).replace(/\/$/,``)||`/`;l.push({...e,path:t,version:u})}});let f=[...t,...l],p=new Map,m=Object.keys(r);if(m.length>0){let e=m[0].replace(/\\/g,`/`).split(`/`).filter(Boolean)[0]||`docs`,t=`/${e}/`,n=`./${e}/`;for(let e of m){let r=e.replace(/\\/g,`/`),i=``;r.indexOf(t)===-1?r.startsWith(n)&&(i=r.substring(n.length)):i=r.substring(r.indexOf(t)+t.length),i?p.set(i,e):p.set(r,e)}}let h=f.map(e=>{let t=e.filePath.replace(/\\/g,`/`),n=p.get(t),i=n?r[n]:null,a=c(e.path===``?`/`:e.path);return{path:a,element:F(_t,{moduleKey:n,moduleLoader:i,route:e,components:o},n||a),loader:async()=>({path:a,frontmatter:{title:e.title,description:e.description||``,...e.frontmatter||{}},headings:e.headings||[],filePath:e.filePath,locale:e.locale,version:e.version,group:e.group,groupTitle:e.groupTitle,date:e.date,lastUpdated:e.lastUpdated}),getStaticPaths:()=>[a]}}),g=(n.base||`/docs`).replace(/\/$/,``);g||=`/`;let _=n.i18n?.locales?Array.isArray(n.i18n.locales)?n.i18n.locales:Object.keys(n.i18n.locales):[],v=n.versions?.versions?.map(e=>e.path)||[],y=[];y.push({path:g,filter:()=>!0});let b=[];v.length>0&&v.forEach(e=>b.push(`/${e}`)),_.length>0&&_.forEach(e=>b.push(`/${e}`)),v.length>0&&_.length>0&&v.forEach(e=>{_.forEach(t=>{b.push(`/${e}/${t}`)})}),b.forEach(e=>{let t=g===`/`?e:`${g}${e}`;y.push({path:t,filter:e=>e.startsWith(t.replace(/\/$/,``)+`/`)})});let x=new Set(h.map(e=>(e.path||``).replace(/\/$/,``))),S=new Set;i&&Object.keys(i).forEach(e=>{let t=e.startsWith(`/`)?e:`/${e}`;S.add(t.replace(/\/$/,``)),n.i18n&&Object.keys(n.i18n.locales).forEach(e=>{S.add(`/${e}${t===`/`?``:t}`.replace(/\/$/,``))})}),y.forEach(({path:e,filter:t})=>{if(e===`/`)return;let r=e.replace(/\/$/,``);if(!(x.has(r)||S.has(r))){let i=n.theme?.tabs?.[0]?.id,a=i?`${r}/${i}`.replace(/\/+/g,`/`):null,o=a&&x.has(a.replace(/\/$/,``))?h.find(e=>e.path.replace(/\/$/,``)===a.replace(/\/$/,``)):h.find(e=>t(e.path)&&e.path!==r),s=o?o.path:h.length>0?h[0].path:null;s&&h.push({path:e,element:F(le,{to:s,replace:!0}),loader:async()=>({path:e}),getStaticPaths:()=>[e]})}});let C=[{element:F(ht,{}),children:h}],w=[];return i&&Object.entries(i).forEach(([e,t])=>{let r=e.startsWith(`/`)?e:`/${e}`;C.find(e=>e.path===r)||(w.push({path:r,locale:n.i18n?.defaultLocale,title:e===`/`?`Home`:e.replace(/^\//,``).split(`/`).pop()||`Page`,filePath:``,headings:[]}),C.push({path:r,element:F(s,{children:F(t,{})}),loader:async()=>({path:r,locale:n.i18n?.defaultLocale}),getStaticPaths:()=>[r]}),n.i18n&&Object.keys(n.i18n.locales).forEach(n=>{let r=`/${n}${e===`/`?``:e}`;C.find(e=>e.path===r)||(w.push({path:r,locale:n,title:e,filePath:``,headings:[]}),C.push({path:r,element:F(s,{children:F(t,{})}),loader:async()=>({path:r,locale:n}),getStaticPaths:()=>[r]}))}))}),C.push({path:`*`,element:F(s,{children:F(vt,{})})}),[{element:F(pt,{config:n,routes:[...f,...w],components:o}),children:C}]}function $(e){return typeof window>`u`?St():typeof window.gtag==`function`?bt(e):window.dataLayer?xt(e):St()}function bt(e){return{trackPageView:(t,n)=>{window.gtag?.(`event`,`page_view`,{page_path:t,page_title:n||document.title,send_to:e?.ga4?.measurementId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.gtag?.(`event`,t,{event_category:n,event_label:r,value:i,send_to:e?.ga4?.measurementId,...a})},trackSearch:(t,n)=>{window.gtag?.(`event`,`search`,{search_term:t,results_count:n,send_to:e?.ga4?.measurementId})},trackDownload:(t,n)=>{window.gtag?.(`event`,`file_download`,{file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.ga4?.measurementId})},trackExternalLink:t=>{window.gtag?.(`event`,`external_link`,{link_url:t,send_to:e?.ga4?.measurementId})},isEnabled:!0}}function xt(e){return{trackPageView:(t,n)=>{window.dataLayer?.push({event:`page_view`,page_path:t,page_title:n||document.title,send_to:e?.gtm?.tagId})},trackEvent:({action:t,category:n,label:r,value:i,params:a})=>{window.dataLayer?.push({event:t,event_category:n,event_label:r,value:i,send_to:e?.gtm?.tagId,...a})},trackSearch:(t,n)=>{window.dataLayer?.push({event:`search`,search_term:t,results_count:n,send_to:e?.gtm?.tagId})},trackDownload:(t,n)=>{window.dataLayer?.push({event:`file_download`,file_name:t,file_type:n||t.split(`.`).pop(),send_to:e?.gtm?.tagId})},trackExternalLink:t=>{window.dataLayer?.push({event:`external_link`,link_url:t,send_to:e?.gtm?.tagId})},isEnabled:!0}}function St(){return{trackPageView:()=>{},trackEvent:()=>{},trackSearch:()=>{},trackDownload:()=>{},trackExternalLink:()=>{},isEnabled:!1}}const Ct=Symbol.for(`__BDOCS_CONFIG_INSTANCE__`);function wt(e={}){let{config:t,autoTrackPageViews:n=!0,autoTrackDownloads:r=!0,autoTrackExternalLinks:i=!0,excludePatterns:a=[]}=e,o=typeof globalThis<`u`?globalThis[Ct]:void 0,s=t??o?.integrations,c=j(()=>$(s),[s]),l=M(``),u=ee();return A(()=>{if(!n||!c.isEnabled)return;let e=u.pathname+u.search;e!==l.current&&(l.current=e,c.trackPageView(e,document.title))},[u.pathname,n,c]),A(()=>{if(!r||!c.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);if(n&&!a.some(e=>e.test(n))&&(t.hasAttribute(`download`)||/\.(pdf|doc|docx|xls|xlsx|ppt|pptx|zip|rar|7z|tar|gz|mp3|mp4|avi|mov|png|jpg|jpeg|gif|svg|webp)$/i.test(n))){let e=n.split(`/`).pop()||n;c.trackDownload(e,e.split(`.`).pop())}};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[r,i,c,a]),A(()=>{if(!i||!c.isEnabled)return;let e=e=>{let t=e.target?.closest(`a`);if(!t)return;let n=t.getAttribute(`href`);n&&(a.some(e=>e.test(n))||(n.startsWith(`http://`)||n.startsWith(`https://`)||n.startsWith(`//`))&&!n.includes(window.location.hostname)&&c.trackExternalLink(n))};return document.addEventListener(`click`,e),()=>document.removeEventListener(`click`,e)},[i,c,a]),c}function Tt(){let e=j(()=>$(),[]);return ge((t,n)=>{e.trackPageView(t,n)},[e])}function Et(){let e=j(()=>$(),[]);return ge(t=>{e.trackEvent(t)},[e])}function Dt({children:e}){let{routes:t,currentRoute:n}=d(),i=r();return I(T,{className:`selection:bg-primary-500/10 selection:text-primary-500`,children:[F(Ze,{}),I(T.Body,{className:`bg-main`,children:[F(it,{routes:t||[],config:i}),F(T.Content,{className:`animate-in fade-in duration-500 scroll-smooth`,children:I(T.ContentMdx,{className:`max-w-5xl px-2 pt-8 pb-24`,children:[I(T.Header,{children:[I(`div`,{className:`mb-4 border-b border-subtle pb-4 flex flex-wrap items-center justify-between gap-3`,children:[F(Fe,{}),F(Le,{mdxRaw:n?._rawContent,route:n})]}),n?.title&&F(`h1`,{className:`text-4xl font-bold tracking-tight text-default mb-3`,children:n.title}),n?.description&&F(`p`,{className:`text-lg text-muted-foreground mb-6 leading-relaxed`,children:n.description})]}),F(Re,{children:F(`div`,{className:`prose prose-neutral dark:prose-invert max-w-none`,children:e})}),F(T.Footer,{children:F(nt,{})})]})}),F(et,{headings:n?.headings,editLink:i.theme?.editLink,communityHelp:i.theme?.communityHelp,filePath:n?.filePath})]})]})}const Ot=Object.assign(Dt,{Body:T.Body,Content:T.Content,ContentMdx:T.ContentMdx,Header:T.Header,Footer:T.Footer});export{pt as BoltdocsShell,Fe as Breadcrumbs,oe as Card,ae as Cards,Le as CopyMarkdown,Ot as DocsLayout,Re as ErrorBoundary,X as MdxPage,Ze as Navbar,Y as NotFound,et as OnThisPage,nt as PageNav,t as SearchDialog,it as Sidebar,ce as ViteReactSSG,f as cn,ie as copyToClipboard,yt as createRoutes,ze as getStarsRepo,K as getTranslated,re as reactToText,wt as useAnalytics,Pe as useBreadcrumbs,r as useConfig,qe as useI18n,c as useLocalizedTo,ee as useLocation,G as useMdxComponents,q as useNavbar,tt as usePageNav,d as useRoutes,e as useSearch,w as useSearchHighlight,C as useSidebar,We as useTabs,E as useTheme,Et as useTrackEvent,Tt as useTrackPageView,_ as useUI,Ke as useVersion};
|
package/dist/node/cli-entry.cjs
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* Copyright (c) 2026 Jesus Alcala
|
|
5
5
|
* Licensed under the MIT License.
|
|
6
6
|
*/
|
|
7
|
-
const e=require(`../chunk-Ds5LZdWN.cjs`),t=require(`../routes-Co1mRM58.cjs`),n=require(`../node-
|
|
7
|
+
const e=require(`../chunk-Ds5LZdWN.cjs`),t=require(`../routes-Co1mRM58.cjs`),n=require(`../node-BzKYJJuY.cjs`),r=require(`../doctor-COpf35L2.cjs`);let i=require(`vite`),a=require(`node:path`);a=e.n(a);let o=require(`cac`);o=e.n(o);let s=require(`@bdocs/ssg/node`);async function c(e=process.cwd()){try{let t=await(0,s.createServer)(await n.n(e,`development`));await t.listen(),t.printUrls(),t.bindCLIShortcuts({print:!0})}catch(e){r.u(`Failed to start dev server:`,e),process.exit(1)}}async function l(e=process.cwd()){try{let i=await n.n(e,`production`),o=await r.p(`docs`,e),c=await t.t(a.default.resolve(e,`docs`),o,i.base),l={};for(let e of c)if(e.path&&e.componentPath){l[e.path]=e.componentPath;let t=e.path.replace(/\/$/,``);l[t]=e.componentPath}await(0,s.build)({entry:`boltdocs/entry`,routeToSourceFileMap:l,cacheDir:a.default.resolve(e,`.boltdocs`)},i),r.d(`SSG build completed successfully!`)}catch(e){r.u(`Build failed:`,e),process.exit(1)}}async function u(e=process.cwd()){try{(await(0,i.preview)(await n.n(e,`production`))).printUrls()}catch(e){r.u(`Failed to start preview server:`,e),process.exit(1)}}const d=(0,o.default)(`boltdocs`);d.command(`[root]`,`Start development server`).alias(`dev`).action(c),d.command(`build [root]`,`Build for production`).action(l),d.command(`preview [root]`,`Preview production build`).action(u),d.command(`doctor [root]`,`Check the health of your documentation`).option(`--fix`,`Automatically fix broken internal links and sync translations`).option(`--check-external`,`Verify external links (slower)`).option(`--init`,`Initialize doctor.json with default configuration`).action(async(e,t)=>{let{doctorAction:n}=await Promise.resolve().then(()=>require(`../doctor-BQiQhCTl.cjs`));await n(e,t)}),d.command(`generate-changelog <file>`,`Generate changelog documentation from CHANGELOG.md`).option(`-o, --output <path>`,`Output folder (default: docs/changelog)`,{default:`docs/changelog`}).option(`-t, --title <text>`,`Title for changelog pages`,{default:`Changelog`}).option(`--infer-tab`,`Infer tab from folder name (default: true)`,{default:!0}).option(`-l, --limit <number>`,`Limit number of versions to generate`).action(async(e,t)=>{let{generateChangelog:n}=await Promise.resolve().then(()=>require(`../generator-DGW6pkCC.cjs`));await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0})}),d.help(),d.version(`2.0.0`),d.parse();
|
package/dist/node/cli-entry.mjs
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* Copyright (c) 2026 Jesus Alcala
|
|
5
5
|
* Licensed under the MIT License.
|
|
6
6
|
*/
|
|
7
|
-
import{i as e,o as t,r as n}from"../doctor-Dh1XP7Pz.mjs";import{t as r}from"../routes-CMUZGI6T.mjs";import{n as i}from"../node-
|
|
7
|
+
import{i as e,o as t,r as n}from"../doctor-Dh1XP7Pz.mjs";import{t as r}from"../routes-CMUZGI6T.mjs";import{n as i}from"../node-m6fKXXVs.mjs";import{preview as a}from"vite";import o from"node:path";import s from"cac";import{build as c,createServer as l}from"@bdocs/ssg/node";async function u(e=process.cwd()){try{let t=await l(await i(e,`development`));await t.listen(),t.printUrls(),t.bindCLIShortcuts({print:!0})}catch(e){n(`Failed to start dev server:`,e),process.exit(1)}}async function d(a=process.cwd()){try{let n=await i(a,`production`),s=await t(`docs`,a),l=await r(o.resolve(a,`docs`),s,n.base),u={};for(let e of l)if(e.path&&e.componentPath){u[e.path]=e.componentPath;let t=e.path.replace(/\/$/,``);u[t]=e.componentPath}await c({entry:`boltdocs/entry`,routeToSourceFileMap:u,cacheDir:o.resolve(a,`.boltdocs`)},n),e(`SSG build completed successfully!`)}catch(e){n(`Build failed:`,e),process.exit(1)}}async function f(e=process.cwd()){try{(await a(await i(e,`production`))).printUrls()}catch(e){n(`Failed to start preview server:`,e),process.exit(1)}}const p=s(`boltdocs`);p.command(`[root]`,`Start development server`).alias(`dev`).action(u),p.command(`build [root]`,`Build for production`).action(d),p.command(`preview [root]`,`Preview production build`).action(f),p.command(`doctor [root]`,`Check the health of your documentation`).option(`--fix`,`Automatically fix broken internal links and sync translations`).option(`--check-external`,`Verify external links (slower)`).option(`--init`,`Initialize doctor.json with default configuration`).action(async(e,t)=>{let{doctorAction:n}=await import(`../doctor-Dh1XP7Pz.mjs`).then(e=>e.t);await n(e,t)}),p.command(`generate-changelog <file>`,`Generate changelog documentation from CHANGELOG.md`).option(`-o, --output <path>`,`Output folder (default: docs/changelog)`,{default:`docs/changelog`}).option(`-t, --title <text>`,`Title for changelog pages`,{default:`Changelog`}).option(`--infer-tab`,`Infer tab from folder name (default: true)`,{default:!0}).option(`-l, --limit <number>`,`Limit number of versions to generate`).action(async(e,t)=>{let{generateChangelog:n}=await import(`../generator-Dv3wEmhZ.mjs`);await n(e,{output:t.output,title:t.title,inferTab:t.inferTab,limit:t.limit?parseInt(String(t.limit),10):void 0})}),p.help(),p.version(`2.0.0`),p.parse();export{};
|
package/dist/node/index.cjs
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../utils-Clzu7jvb.cjs`),t=require(`../node-
|
|
6
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../utils-Clzu7jvb.cjs`),t=require(`../node-BzKYJJuY.cjs`),n=require(`../doctor-COpf35L2.cjs`);exports.BoltdocsPluginStore=t.u,exports.PluginCompatibilityError=t.d,exports.PluginError=t.f,exports.PluginHookError=t.p,exports.PluginLifecycleManager=t.a,exports.PluginPermissionError=t.m,exports.PluginSandbox=t.o,exports.PluginValidationError=t.h,exports.SecurePluginSchema=t.s,exports.createPlugin=t.i,exports.createViteConfig=t.n,exports.default=t.t,exports.defineConfig=n.h,exports.generateEntryCode=t.r,exports.hasPermission=t.c,exports.normalizePath=e.l,exports.resolveConfig=n.p,exports.sanitizeFilename=e.d,exports.validatePlugins=t.l;
|
package/dist/node/index.mjs
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import{c as e,o as t}from"../doctor-Dh1XP7Pz.mjs";import{d as n,l as r}from"../utils-BxNAXhZZ.mjs";import{a as i,c as a,d as o,f as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v}from"../node-
|
|
6
|
+
import{c as e,o as t}from"../doctor-Dh1XP7Pz.mjs";import{d as n,l as r}from"../utils-BxNAXhZZ.mjs";import{a as i,c as a,d as o,f as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v}from"../node-m6fKXXVs.mjs";export{v as BoltdocsPluginStore,o as PluginCompatibilityError,s as PluginError,m as PluginHookError,i as PluginLifecycleManager,d as PluginPermissionError,p as PluginSandbox,c as PluginValidationError,g as SecurePluginSchema,l as createPlugin,f as createViteConfig,_ as default,e as defineConfig,h as generateEntryCode,a as hasPermission,r as normalizePath,t as resolveConfig,n as sanitizeFilename,u as validatePlugins};
|
|
@@ -71,8 +71,7 @@ ${e.filter(e=>e.seo?.noindex||typeof e.seo?.robots==`string`&&e.seo.robots.inclu
|
|
|
71
71
|
</body>`)),e}var R=class e extends Error{pluginName;constructor(t,n){super(`[plugin:${t}] ${n}`),this.name=`PluginError`,this.pluginName=t,Object.setPrototypeOf(this,e.prototype)}},z=class e extends R{constructor(t,n){super(t,`Validation failed: ${n}`),this.name=`PluginValidationError`,Object.setPrototypeOf(this,e.prototype)}},ue=class e extends R{constructor(t,n){super(t,`Compatibility error: ${n}`),this.name=`PluginCompatibilityError`,Object.setPrototypeOf(this,e.prototype)}},B=class e extends R{constructor(t,n){super(t,`Missing required permission: '${n}'`),this.name=`PluginPermissionError`,Object.setPrototypeOf(this,e.prototype)}},de=class e extends R{hookName;constructor(t,n,r){super(t,`Error in hook '${n}': ${r.message}`),this.name=`PluginHookError`,this.hookName=n,this.stack=r.stack,Object.setPrototypeOf(this,e.prototype)}},fe=class{data=new Map;getNamespaceKey(e,t){return`${e}:${t}`}get(e,t){let n=this.getNamespaceKey(e,t),r=this.data.get(n);if(r!==void 0)return typeof r==`object`&&r?JSON.parse(JSON.stringify(r)):r}set(e,t,n){let r=this.getNamespaceKey(e,t),i=typeof n==`object`&&n?JSON.parse(JSON.stringify(n)):n;this.data.set(r,i)}has(e,t){let n=this.getNamespaceKey(e,t);return this.data.has(n)}};const pe=i._.extend({version:u.z.string().optional(),boltdocsVersion:u.z.string().optional(),permissions:u.z.array(u.z.string()).optional(),hooks:u.z.object({beforeBuild:u.z.function().optional(),afterBuild:u.z.function().optional(),beforeDev:u.z.function().optional(),afterDev:u.z.function().optional(),configResolved:u.z.function().optional(),buildEnd:u.z.function().optional()}).optional()});function me(e,t){let n=[],r=new Set;for(let i of e){let e=pe.safeParse(i);if(!e.success)throw new z(i.name||`unknown`,e.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `));let a=e.data;if(r.has(a.name))throw new z(a.name,`Duplicate plugin name detected`);if(r.add(a.name),a.boltdocsVersion&&!m.default.satisfies(t,a.boltdocsVersion))throw new ue(a.name,`Plugin expects Boltdocs version ${a.boltdocsVersion}, but current is ${t}`);if(a.components){for(let[e,t]of Object.entries(a.components))if((t.includes(`..`)||h.default.isAbsolute(t))&&t.includes(`..`))throw new z(a.name,`Component '${e}' has an invalid path: traversal sequences are not allowed.`)}n.push(a)}return n}function V(e,t){return e.permissions?e.permissions.includes(t):!1}var H=class e{static checkPermission(e,t){if(!V(e,t))throw new B(e.name,t)}static getSanitizedCapabilities(e){return{remarkPlugins:V(e,`mdx:remark`)?e.remarkPlugins:[],rehypePlugins:V(e,`mdx:rehype`)?e.rehypePlugins:[],vitePlugins:V(e,`vite:config`)?e.vitePlugins:[],components:V(e,`components`)?e.components:{}}}static async executeWithIsolation(t,n,r,i){try{return e.checkPermission(t,n),await i()}catch(e){if(e instanceof B){console.warn(`[boltdocs] Skipping hook '${r}' for plugin '${t.name}': ${e.message}`);return}throw e}}},he=class{plugins;config;store;constructor(e,t){this.plugins=e,this.config=t,this.store=new fe}async runHook(e,...t){let n=this.getSortedPlugins();for(let r of n){if(!r.hooks?.[e])continue;let n=this.createContext(r),i=e.toLowerCase().includes(`build`),a=e.toLowerCase().includes(`dev`),o=i?`hooks:build`:a?`hooks:dev`:void 0;try{o?await H.executeWithIsolation(r,o,e,()=>r.hooks[e](n,...t)):await r.hooks[e](n,...t)}catch(t){let i=new de(r.name,e,t instanceof Error?t:Error(String(t)));n.logger.error(i)}}}getSortedPlugins(){let e=this.plugins.filter(e=>e.enforce===`pre`),t=this.plugins.filter(e=>!e.enforce),n=this.plugins.filter(e=>e.enforce===`post`);return[...e,...t,...n]}createContext(e){return{config:Object.freeze({...this.config}),meta:{name:e.name,version:e.version,boltdocsVersion:e.boltdocsVersion},store:{get:(e,t)=>this.store.get(e,t),set:(e,t,n)=>this.store.set(e,t,n),has:(e,t)=>this.store.has(e,t)},logger:this.createLogger(e.name)}}createLogger(e){let t=`[plugin:${e}]`;return{info:e=>console.log(`${t} INFO: ${e}`),warn:e=>console.warn(`${t} WARN: ${e}`),error:e=>{let n=e instanceof Error?e.message:e;console.error(`${t} ERROR: ${n}`)},debug:e=>console.debug(`${t} DEBUG: ${e}`)}}};function ge(e){return e}function U(e){return typeof e==`string`?[e]:Array.isArray(e)?e.flatMap(U):e&&typeof e==`object`?Object.values(e).flatMap(U):[]}const _e=new Set([`title`,`description`,`permalink`,`sidebarPosition`,`sidebarLabel`,`sidebarHidden`,`hidden`,`category`,`order`,`badge`,`icon`,`date`,`lastUpdated`,`groupTitle`,`groupPosition`,`seo`]);function ve(e){let t=[];for(let n of e){let e=``;n.frontmatter&&(e=U(Object.entries(n.frontmatter).filter(([e])=>!_e.has(e)).map(([e,t])=>t)).join(` `));let r=e?`${n._content||``} ${e}`:n._content||``;if(t.push({id:n.path,title:n.title,content:r,url:n.path,display:n.groupTitle?`${n.groupTitle} > ${n.title}`:n.title,locale:n.locale,version:n.version}),n.headings)for(let e of n.headings)t.push({id:`${n.path}#${e.id}`,title:e.text,content:`${e.text} in ${n.title}`,url:`${n.path}#${e.id}`,display:`${n.title} > ${e.text}`,locale:n.locale,version:n.version})}return t}function W(e,n,r=!1){let i=h.default.resolve(process.cwd(),`index.css`),a=l.default.existsSync(i)?`import './index.css';`:``,o=n?.plugins?.flatMap(e=>Object.entries(e.components||{}))||[],s=o.map(([e,n])=>`import * as _comp_${e} from '${t.l(n)}';
|
|
72
72
|
const ${e} = _comp_${e}.default || _comp_${e}['${e}'] || _comp_${e};`).join(`
|
|
73
73
|
`),c=o.map(([e])=>e).join(`, `),u=h.default.basename(e.docsDir||`docs`),d=h.default.resolve(process.cwd(),e.docsDir||`docs`),f=[`tsx`,`ts`,`jsx`,`js`].map(e=>h.default.resolve(d,`pages-external/index.${e}`)).find(e=>l.default.existsSync(e));return`
|
|
74
|
-
import { ViteReactSSG } from '
|
|
75
|
-
import { createRoutes } from 'boltdocs/client';
|
|
74
|
+
import { ViteReactSSG, createRoutes } from 'boltdocs/client';
|
|
76
75
|
import _routes from 'virtual:boltdocs-routes.ts';
|
|
77
76
|
import _config from 'virtual:boltdocs-config.ts';
|
|
78
77
|
import _user_mdx_components from 'virtual:boltdocs-mdx-components.tsx';
|
|
@@ -105,7 +104,7 @@ export const createRoot = ViteReactSSG(
|
|
|
105
104
|
const mdxComponents = components.default || components;
|
|
106
105
|
export default mdxComponents;
|
|
107
106
|
export * from '${e}';`}return`export default {};`}if(u===`layout`){let e=[`tsx`,`jsx`],n=null;for(let t of e){let e=c.default.resolve(a,`layout.${t}`);if(d.default.existsSync(e)){n=e;break}}if(n)return`import UserLayout from '${t.l(n)}';
|
|
108
|
-
export default UserLayout;`;throw Error(`[Boltdocs] Layout file not found. A 'layout.tsx' or 'layout.jsx' file is mandatory in your docs directory. Please create one to define your site structure.`)}if(u===`icons`){let e=[`tsx`,`jsx`,`ts`,`js`],n=null;for(let t of e){let e=c.default.resolve(a,`icons.${t}`);if(d.default.existsSync(e)){n=e;break}}return n?`import * as icons from '${t.l(n)}';\nexport default icons;`:`export default {};`}if(u===`search`){if(!K){let e=ve(await r.t(a,l));K=`export default ${JSON.stringify(e,null,2)};`}return K}if(u===`client`){let e=__dirname,n=``;for(;e&&e!==c.default.parse(e).root;){let r=c.default.join(e,`src/client/index.ts`),i=c.default.join(e,`dist/client/index.mjs`),a=c.default.join(e,`client/index.ts`);if(d.default.existsSync(r)){n=t.l(r);break}if(d.default.existsSync(i)){n=t.l(i);break}if(d.default.existsSync(a)){n=t.l(a);break}e=c.default.dirname(e)}if(!n)throw Error(`[boltdocs] Could not resolve boltdocs/client entry point starting from ${__dirname}`);return`export * from '${n}';`}}}}const xe={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains`};function Se(e){let t=process.env.NODE_ENV===`development`,n={"default-src":[`'self'`],"script-src":[`'self'`,`'unsafe-inline'`],"style-src":[`'self'`,`'unsafe-inline'`],"img-src":[`'self'`,`data:`,`https:`],"font-src":[`'self'`],"connect-src":[`'self'`]};return t&&(n[`script-src`]=[`'self'`,`'unsafe-eval'`,`'unsafe-inline'`],n[`style-src`]=[`'self'`,`'unsafe-inline'`]),Object.entries(n).map(([e,t])=>`${e} ${t.join(` `)}`).join(`; `)}const q=new Map;async function Ce(e){try{let{data:n}=await t.u(e),r=JSON.stringify(n);return f.default.createHash(`md5`).update(r).digest(`hex`)}catch{return``}}function we(e){return q.get(e)}function Te(e,t){q.set(e,t)}function Ee(e){q.delete(e)}function J(e,t){let n=e.moduleGraph.getModuleById(`\0virtual:boltdocs-${t}.ts`);n&&e.moduleGraph.invalidateModule(n)}function De(e,n,a,o,s){let l=new Map;return{name:`vite-plugin-boltdocs-dev-server`,apply:`serve`,async configureServer(o){let u=s();await u?.runHook(`beforeDev`),i.s(e,process.cwd(),a()).catch(e=>{console.error(`[boltdocs] Failed to generate initial link tree:`,e)}),setTimeout(async()=>{try{let{generateRoutes:t}=await Promise.resolve().then(()=>require(`./routes-CHf76Ye4.cjs`)),n=await t(e,a());for(let e of n)if(e.filePath){let t=c.default.relative(process.cwd(),e.filePath).replace(/\\/g,`/`),n=t.startsWith(`/`)?t:`/${t}`;await o.transformRequest(n).catch(()=>{}),await new Promise(e=>setTimeout(e,50))}}catch{}},1e3),o.middlewares.use((e,t,n)=>{process.env.NODE_ENV===`production`&&Object.entries(xe).forEach(([e,n])=>{t.setHeader(e,n)});let r=a();r.security?.enableCSP&&t.setHeader(`Content-Security-Policy`,Se(r)),n()}),o.middlewares.use((e,t,n)=>{if(e.url===`/robots.txt`){n();return}n()}),o.middlewares.use(async(e,t,n)=>{let r=e.url?.split(`?`)[0]||`/`,i=e.headers.accept||``,s=a(),c=/\.(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(r);if(i.includes(`text/html`)&&!c){let n=ce(s);n=le(n,s),n=await o.transformIndexHtml(e.url||`/`,n),t.statusCode=200,t.setHeader(`Content-Type`,`text/html`),t.end(n);return}n()});let d=i.f.map(e=>c.default.resolve(process.cwd(),e)),f=[`tsx`,`jsx`].map(t=>c.default.resolve(e,`layout.${t}`)),p=[`tsx`,`ts`,`jsx`,`js`],m=p.map(t=>c.default.resolve(e,`mdx-components.${t}`)),h=p.map(t=>c.default.resolve(e,`pages-external/index.${t}`)),g=p.map(t=>c.default.resolve(e,`icons.${t}`));o.watcher.add([...d,...m,...f,...h,...g]);let _=async(s,u)=>{try{let d=t.l(s);if(i.f.some(e=>d.endsWith(e))){o.restart();return}if(p.some(e=>d.endsWith(`mdx-components.${e}`))){i.g(a(),e),J(o,`mdx-components.tsx`),o.ws.send({type:`full-reload`});return}if(p.some(e=>d.endsWith(`icons.${e}`))){J(o,`icons.tsx`),o.ws.send({type:`full-reload`});return}if(d.endsWith(`layout.tsx`)||d.endsWith(`layout.jsx`)){J(o,`layout.tsx`),o.ws.send({type:`full-reload`});return}if(d.includes(`/pages-external/`)||d.includes(`\\pages-external\\`)){J(o,`entry`),o.ws.send({type:`full-reload`});return}if(!d.toLowerCase().startsWith(n.toLowerCase())||!t.s(d))return;if(u===`add`||u===`unlink`){u===`unlink`&&Ee(s),r.n(),ye();let t=a();i.g(t,e),J(o,`config`),J(o,`routes`),J(o,`search`),i.s(e,process.cwd(),t).catch(e=>{console.error(`[boltdocs] Failed to update link tree:`,e)}),o.ws.send({type:`custom`,event:`boltdocs:config-update`,data:{theme:t?.theme,i18n:t?.i18n,versions:t?.versions,siteUrl:t?.siteUrl}}),o.ws.send({type:`full-reload`});return}l.has(d)&&clearTimeout(l.get(d)),l.set(d,setTimeout(async()=>{l.delete(d);try{let n=we(s),i=await Ce(s);Te(s,i),r.r(s),n!==void 0&&n!==i&&(J(o,`routes`),J(o,`search`));let a=t.l(c.default.relative(e,s)),l=o.moduleGraph.getModulesByFile(d);if(l)for(let e of l)o.moduleGraph.invalidateModule(e);o.ws.send({type:`custom`,event:`boltdocs:mdx-update`,data:{file:d,relPath:a}})}catch(e){console.error(`[boltdocs] HMR error processing content change:`,e)}},150))}catch(e){console.error(`[boltdocs] HMR error during ${u} event:`,e)}};o.watcher.on(`add`,e=>_(e,`add`)),o.watcher.on(`unlink`,e=>_(e,`unlink`)),o.watcher.on(`change`,e=>_(e,`change`)),await u?.runHook(`afterDev`)},handleHotUpdate({file:e,server:r}){let i=t.l(e);if(i.toLowerCase().startsWith(n.toLowerCase())&&t.s(i))return[]}}}function Oe(e={},n){let a=c.default.resolve(process.cwd(),e.docsDir||`docs`),o=t.l(a),l=n,u,f=!1,m,h=[],g=()=>l;return[{name:`vite-plugin-boltdocs`,enforce:`pre`,async config(e,t){f=t.command===`build`;let n=e.envDir||process.cwd(),o=(0,s.loadEnv)(t.mode,n,``);Object.assign(process.env,o),l||=await i.m(a);let u=(await Promise.resolve().then(()=>require(`./package-BMYLDBBP.cjs`))).version,p=me(l.plugins||[],u);return l.plugins=p,m=new he(p,l),h=p.flatMap(e=>H.getSanitizedCapabilities(e).vitePlugins||[]),f&&await m.runHook(`beforeBuild`),{ssgOptions:{entry:`boltdocs/entry`,htmlEntry:`index.html`,dirStyle:`nested`,includeAllRoutes:!0,mock:!0,script:`async`,beastiesOptions:{preload:`media`},onFinished:async e=>{let t=oe(ae(await r.t(a,l)),l);t&&d.default.writeFileSync(c.default.join(e,`sitemap.xml`),t);let n=se(l);d.default.writeFileSync(c.default.join(e,`robots.txt`),n)}},build:{ssrManifest:f},async config(){return{optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-router-dom`,`react-helmet-async`],exclude:[`boltdocs`,`boltdocs/client`]},resolve:{dedupe:[`react`,`react-dom`]}}}}},configResolved(e){u=e,m?.runHook(`configResolved`,l)},transformIndexHtml:{order:`pre`,handler(e){return le(e,l)}},async buildEnd(){let{pool:e}=await Promise.resolve().then(()=>require(`./worker-pool-BwU8ckrg.cjs`));await e.terminate()},async closeBundle(){!f||u?.build?.ssr||(await m?.runHook(`afterBuild`),await m?.runHook(`buildEnd`))}},be(e,g,()=>u,a),De(a,o,g,e=>{l=e},()=>m),{...(0,p.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`}]}}),apply:`build`},...h]}const Y=new n.r(`mdx`),ke=[b.default.default||b.default,x.default.default||x.default,S.default.default||S.default,C.default.default||C.default,w.default.default||w.default,T.default.default||T.default,E.default.default||E.default],Ae=[D.default,O.default,k.default,A.default,j.default,M.default,N.default,P.default,F.default,re.default,ie.default,I.default,L.default];let je=null,X=null;const Me=()=>(je??=(0,te.createJavaScriptRegexEngine)(),je),Ne=async e=>X||(X=(0,ne.createHighlighterCore)({themes:ke,langs:Ae,engine:Me()}),X),Z={JSX_FLOW_ELEMENT:`mdxJsxFlowElement`,JSX_TEXT_ELEMENT:`mdxJsxTextElement`,JSX_ATTRIBUTE:`mdxJsxAttribute`,ELEMENT:`element`,TEXT:`text`,CODE:`code`},Pe={PRE:`pre`,CODE:`code`},Q={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},$={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},Fe={LIGHT:`github-light`,DARK:`github-dark`},Ie={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},Le=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,$.LINE_NUMBERS)}}},Re=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,$.WORD_WRAP)}}},ze=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[Q.TITLE]=t)}}),Be=()=>({name:`AddLanguageProperty`,pre(e){e.properties[Q.LANG]=this.options.lang||Ie.LANG}});function Ve(e){let t={};if(!e)return t;/lineNumbers|showLineNumbers/.test(e)&&(t.lineNumbers=!0),/wordWrap|word-wrap/.test(e)&&(t.wordWrap=!0);let n=e.match(/title=(["'])(.*?)\1/);return n&&(t.title=n[2]),t}var He=class{config;constructor(e){this.config=e}getTheme(){return this.config?.theme?.codeTheme||{light:Fe.LIGHT,dark:Fe.DARK}}async getHighlighter(){return await Ne(this.getTheme())}getOptions(e,t){let n=this.getTheme(),r={},i=``;typeof t==`string`?(i=t,r=Ve(t)):t&&(r=t,i=t.__raw||``);let a={lang:e||Ie.LANG,meta:{__raw:i,...r},transformers:[Le(),Re(),ze(),Be()]};return typeof n==`object`?a.themes={light:n.light,dark:n.dark}:a.theme=n,a}async render(e,t,n){try{let r=await this.getHighlighter(),i=this.getOptions(t,n);return r.codeToHtml(e,i)}catch(t){return console.error(`[ShikiAdapter] Failed to render code:`,t),`<pre class="${$.FALLBACK}"><code>${Ue(e)}</code></pre>`}}};function Ue(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}let We=null,Ge;function Ke(e){let t=JSON.stringify(e?.theme?.codeTheme||null);return(We===null||Ge!==t)&&(We=new He(e),Ge=t),We}function qe(e){let t=Ke(e);return async e=>{let n=await t.getHighlighter();(0,ee.visit)(e,Z.ELEMENT,e=>{if(e.tagName===Pe.PRE&&e.children?.[0]?.type===Z.ELEMENT&&e.children[0].tagName===Pe.CODE){let r=e.children[0],i=(r.properties?.className||[]).find(e=>e.startsWith(`language-`)),a=i?i.slice(9):Ie.MDX_DEFAULT_LANG;if(a===`mermaid`)return;let o=r.children?.[0]?.value||``,s=Ve(r.properties?.metastring||r.data?.meta||``),c=t.getOptions(a,s),l=``;try{l=n.codeToHtml(o,c)}catch(e){console.error(`[rehypeShiki] Failed to highlight code block:`,e),l=`<pre class="${$.FALLBACK}"><code>${Ue(o)}</code></pre>`}e.properties=e.properties||{},s.title&&(e.properties[Q.TITLE]=s.title),e.properties[Q.HIGHLIGHTED]=`true`,e.properties[Q.HIGHLIGHTED_HTML]=l,e.properties[Q.LANG]=a,e.children=[]}})}}function Je(){return e=>{(0,ee.visit)(e,Z.CODE,e=>{e.meta&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties.metastring=e.meta)})}}let Ye=!1;function Xe(e,t=g.default){let n=e?.plugins?.flatMap(e=>H.getSanitizedCapabilities(e).remarkPlugins||[])||[],r=e?.plugins?.flatMap(e=>H.getSanitizedCapabilities(e).rehypePlugins||[])||[],i=t({remarkPlugins:[_.default,v.default,Je,...n],rehypePlugins:[y.default,[qe,e],...r],jsxRuntime:`automatic`});return{...i,name:`vite-plugin-boltdocs-mdx`,async buildStart(){Ye||=(await Y.load(),!0),i.buildStart&&await i.buildStart.call(this)},async transform(e,t,n){let[r]=t.split(`?`);if(!r.endsWith(`.md`)&&!r.endsWith(`.mdx`))return i.transform?.call(this,e,t,n);let a=`${r}:${f.default.createHash(`md5`).update(e).digest(`hex`)}:${process.env.NODE_ENV===`production`?`prod`:`dev`}:v3`,o=await Y.getAsync(a);if(o)return{code:o,map:null};let s=await i.transform.call(this,e,r,n);return s&&typeof s==`object`&&s.code&&(process.env.NODE_ENV!==`production`&&(s.code+=`
|
|
107
|
+
export default UserLayout;`;throw Error(`[Boltdocs] Layout file not found. A 'layout.tsx' or 'layout.jsx' file is mandatory in your docs directory. Please create one to define your site structure.`)}if(u===`icons`){let e=[`tsx`,`jsx`,`ts`,`js`],n=null;for(let t of e){let e=c.default.resolve(a,`icons.${t}`);if(d.default.existsSync(e)){n=e;break}}return n?`import * as icons from '${t.l(n)}';\nexport default icons;`:`export default {};`}if(u===`search`){if(!K){let e=ve(await r.t(a,l));K=`export default ${JSON.stringify(e,null,2)};`}return K}if(u===`client`){let e=__dirname,n=``;for(;e&&e!==c.default.parse(e).root;){let r=c.default.join(e,`src/client/index.ts`),i=c.default.join(e,`dist/client/index.mjs`),a=c.default.join(e,`client/index.ts`);if(d.default.existsSync(r)){n=t.l(r);break}if(d.default.existsSync(i)){n=t.l(i);break}if(d.default.existsSync(a)){n=t.l(a);break}e=c.default.dirname(e)}if(!n)throw Error(`[boltdocs] Could not resolve boltdocs/client entry point starting from ${__dirname}`);return`export * from '${n}';`}}}}const xe={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains`};function Se(e){let t=process.env.NODE_ENV===`development`,n={"default-src":[`'self'`],"script-src":[`'self'`,`'unsafe-inline'`],"style-src":[`'self'`,`'unsafe-inline'`],"img-src":[`'self'`,`data:`,`https:`],"font-src":[`'self'`],"connect-src":[`'self'`]};return t&&(n[`script-src`]=[`'self'`,`'unsafe-eval'`,`'unsafe-inline'`],n[`style-src`]=[`'self'`,`'unsafe-inline'`]),Object.entries(n).map(([e,t])=>`${e} ${t.join(` `)}`).join(`; `)}const q=new Map;async function Ce(e){try{let{data:n}=await t.u(e),r=JSON.stringify(n);return f.default.createHash(`md5`).update(r).digest(`hex`)}catch{return``}}function we(e){return q.get(e)}function Te(e,t){q.set(e,t)}function Ee(e){q.delete(e)}function J(e,t){let n=e.moduleGraph.getModuleById(`\0virtual:boltdocs-${t}.ts`);n&&e.moduleGraph.invalidateModule(n)}function De(e,n,a,o,s){let l=new Map;return{name:`vite-plugin-boltdocs-dev-server`,apply:`serve`,async configureServer(o){let u=s();await u?.runHook(`beforeDev`),i.s(e,process.cwd(),a()).catch(e=>{console.error(`[boltdocs] Failed to generate initial link tree:`,e)}),setTimeout(async()=>{try{let{generateRoutes:t}=await Promise.resolve().then(()=>require(`./routes-CHf76Ye4.cjs`)),n=await t(e,a());for(let e of n)if(e.filePath){let t=c.default.relative(process.cwd(),e.filePath).replace(/\\/g,`/`),n=t.startsWith(`/`)?t:`/${t}`;await o.transformRequest(n).catch(()=>{}),await new Promise(e=>setTimeout(e,50))}}catch{}},1e3),o.middlewares.use((e,t,n)=>{process.env.NODE_ENV===`production`&&Object.entries(xe).forEach(([e,n])=>{t.setHeader(e,n)});let r=a();r.security?.enableCSP&&t.setHeader(`Content-Security-Policy`,Se(r)),n()}),o.middlewares.use((e,t,n)=>{if(e.url===`/robots.txt`){n();return}n()}),o.middlewares.use(async(e,t,n)=>{let r=e.url?.split(`?`)[0]||`/`,i=e.headers.accept||``,s=a(),c=/\.(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(r);if(i.includes(`text/html`)&&!c){let n=ce(s);n=le(n,s),n=await o.transformIndexHtml(e.url||`/`,n),t.statusCode=200,t.setHeader(`Content-Type`,`text/html`),t.end(n);return}n()});let d=i.f.map(e=>c.default.resolve(process.cwd(),e)),f=[`tsx`,`jsx`].map(t=>c.default.resolve(e,`layout.${t}`)),p=[`tsx`,`ts`,`jsx`,`js`],m=p.map(t=>c.default.resolve(e,`mdx-components.${t}`)),h=p.map(t=>c.default.resolve(e,`pages-external/index.${t}`)),g=p.map(t=>c.default.resolve(e,`icons.${t}`));o.watcher.add([...d,...m,...f,...h,...g]);let _=async(s,u)=>{try{let d=t.l(s);if(i.f.some(e=>d.endsWith(e))){o.restart();return}if(p.some(e=>d.endsWith(`mdx-components.${e}`))){i.g(a(),e),J(o,`mdx-components.tsx`),o.ws.send({type:`full-reload`});return}if(p.some(e=>d.endsWith(`icons.${e}`))){J(o,`icons.tsx`),o.ws.send({type:`full-reload`});return}if(d.endsWith(`layout.tsx`)||d.endsWith(`layout.jsx`)){J(o,`layout.tsx`),o.ws.send({type:`full-reload`});return}if(d.includes(`/pages-external/`)||d.includes(`\\pages-external\\`)){J(o,`entry`),o.ws.send({type:`full-reload`});return}if(!d.toLowerCase().startsWith(n.toLowerCase())||!t.s(d))return;if(u===`add`||u===`unlink`){u===`unlink`&&Ee(s),r.n(),ye();let t=a();i.g(t,e),J(o,`config`),J(o,`routes`),J(o,`search`),i.s(e,process.cwd(),t).catch(e=>{console.error(`[boltdocs] Failed to update link tree:`,e)}),o.ws.send({type:`custom`,event:`boltdocs:config-update`,data:{theme:t?.theme,i18n:t?.i18n,versions:t?.versions,siteUrl:t?.siteUrl}}),o.ws.send({type:`full-reload`});return}l.has(d)&&clearTimeout(l.get(d)),l.set(d,setTimeout(async()=>{l.delete(d);try{let n=we(s),i=await Ce(s);Te(s,i),r.r(s),n!==void 0&&n!==i&&(J(o,`routes`),J(o,`search`));let a=t.l(c.default.relative(e,s)),l=o.moduleGraph.getModulesByFile(d);if(l)for(let e of l)o.moduleGraph.invalidateModule(e);o.ws.send({type:`custom`,event:`boltdocs:mdx-update`,data:{file:d,relPath:a}})}catch(e){console.error(`[boltdocs] HMR error processing content change:`,e)}},150))}catch(e){console.error(`[boltdocs] HMR error during ${u} event:`,e)}};o.watcher.on(`add`,e=>_(e,`add`)),o.watcher.on(`unlink`,e=>_(e,`unlink`)),o.watcher.on(`change`,e=>_(e,`change`)),await u?.runHook(`afterDev`)},handleHotUpdate({file:e,server:r}){let i=t.l(e);if(i.toLowerCase().startsWith(n.toLowerCase())&&t.s(i))return[]}}}function Oe(e={},n){let a=c.default.resolve(process.cwd(),e.docsDir||`docs`),o=t.l(a),l=n,u,f=!1,m,h=[],g=()=>l;return[{name:`vite-plugin-boltdocs`,enforce:`pre`,async config(e,t){f=t.command===`build`;let n=e.envDir||process.cwd(),o=(0,s.loadEnv)(t.mode,n,``);Object.assign(process.env,o),l||=await i.m(a);let u=(await Promise.resolve().then(()=>require(`./package-D1O_gJub.cjs`))).version,p=me(l.plugins||[],u);return l.plugins=p,m=new he(p,l),h=p.flatMap(e=>H.getSanitizedCapabilities(e).vitePlugins||[]),f&&await m.runHook(`beforeBuild`),{ssgOptions:{entry:`boltdocs/entry`,htmlEntry:`index.html`,dirStyle:`nested`,includeAllRoutes:!0,mock:!0,script:`async`,beastiesOptions:{preload:`media`},onFinished:async e=>{let t=oe(ae(await r.t(a,l)),l);t&&d.default.writeFileSync(c.default.join(e,`sitemap.xml`),t);let n=se(l);d.default.writeFileSync(c.default.join(e,`robots.txt`),n)}},build:{ssrManifest:f},async config(){return{optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-router-dom`,`react-helmet-async`],exclude:[`boltdocs`,`boltdocs/client`]},resolve:{dedupe:[`react`,`react-dom`]}}}}},configResolved(e){u=e,m?.runHook(`configResolved`,l)},transformIndexHtml:{order:`pre`,handler(e){return le(e,l)}},async buildEnd(){let{pool:e}=await Promise.resolve().then(()=>require(`./worker-pool-BwU8ckrg.cjs`));await e.terminate()},async closeBundle(){!f||u?.build?.ssr||(await m?.runHook(`afterBuild`),await m?.runHook(`buildEnd`))}},be(e,g,()=>u,a),De(a,o,g,e=>{l=e},()=>m),{...(0,p.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`}]}}),apply:`build`},...h]}const Y=new n.r(`mdx`),ke=[b.default.default||b.default,x.default.default||x.default,S.default.default||S.default,C.default.default||C.default,w.default.default||w.default,T.default.default||T.default,E.default.default||E.default],Ae=[D.default,O.default,k.default,A.default,j.default,M.default,N.default,P.default,F.default,re.default,ie.default,I.default,L.default];let je=null,X=null;const Me=()=>(je??=(0,te.createJavaScriptRegexEngine)(),je),Ne=async e=>X||(X=(0,ne.createHighlighterCore)({themes:ke,langs:Ae,engine:Me()}),X),Z={JSX_FLOW_ELEMENT:`mdxJsxFlowElement`,JSX_TEXT_ELEMENT:`mdxJsxTextElement`,JSX_ATTRIBUTE:`mdxJsxAttribute`,ELEMENT:`element`,TEXT:`text`,CODE:`code`},Pe={PRE:`pre`,CODE:`code`},Q={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},$={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},Fe={LIGHT:`github-light`,DARK:`github-dark`},Ie={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},Le=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,$.LINE_NUMBERS)}}},Re=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,$.WORD_WRAP)}}},ze=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[Q.TITLE]=t)}}),Be=()=>({name:`AddLanguageProperty`,pre(e){e.properties[Q.LANG]=this.options.lang||Ie.LANG}});function Ve(e){let t={};if(!e)return t;/lineNumbers|showLineNumbers/.test(e)&&(t.lineNumbers=!0),/wordWrap|word-wrap/.test(e)&&(t.wordWrap=!0);let n=e.match(/title=(["'])(.*?)\1/);return n&&(t.title=n[2]),t}var He=class{config;constructor(e){this.config=e}getTheme(){return this.config?.theme?.codeTheme||{light:Fe.LIGHT,dark:Fe.DARK}}async getHighlighter(){return await Ne(this.getTheme())}getOptions(e,t){let n=this.getTheme(),r={},i=``;typeof t==`string`?(i=t,r=Ve(t)):t&&(r=t,i=t.__raw||``);let a={lang:e||Ie.LANG,meta:{__raw:i,...r},transformers:[Le(),Re(),ze(),Be()]};return typeof n==`object`?a.themes={light:n.light,dark:n.dark}:a.theme=n,a}async render(e,t,n){try{let r=await this.getHighlighter(),i=this.getOptions(t,n);return r.codeToHtml(e,i)}catch(t){return console.error(`[ShikiAdapter] Failed to render code:`,t),`<pre class="${$.FALLBACK}"><code>${Ue(e)}</code></pre>`}}};function Ue(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}let We=null,Ge;function Ke(e){let t=JSON.stringify(e?.theme?.codeTheme||null);return(We===null||Ge!==t)&&(We=new He(e),Ge=t),We}function qe(e){let t=Ke(e);return async e=>{let n=await t.getHighlighter();(0,ee.visit)(e,Z.ELEMENT,e=>{if(e.tagName===Pe.PRE&&e.children?.[0]?.type===Z.ELEMENT&&e.children[0].tagName===Pe.CODE){let r=e.children[0],i=(r.properties?.className||[]).find(e=>e.startsWith(`language-`)),a=i?i.slice(9):Ie.MDX_DEFAULT_LANG;if(a===`mermaid`)return;let o=r.children?.[0]?.value||``,s=Ve(r.properties?.metastring||r.data?.meta||``),c=t.getOptions(a,s),l=``;try{l=n.codeToHtml(o,c)}catch(e){console.error(`[rehypeShiki] Failed to highlight code block:`,e),l=`<pre class="${$.FALLBACK}"><code>${Ue(o)}</code></pre>`}e.properties=e.properties||{},s.title&&(e.properties[Q.TITLE]=s.title),e.properties[Q.HIGHLIGHTED]=`true`,e.properties[Q.HIGHLIGHTED_HTML]=l,e.properties[Q.LANG]=a,e.children=[]}})}}function Je(){return e=>{(0,ee.visit)(e,Z.CODE,e=>{e.meta&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties.metastring=e.meta)})}}let Ye=!1;function Xe(e,t=g.default){let n=e?.plugins?.flatMap(e=>H.getSanitizedCapabilities(e).remarkPlugins||[])||[],r=e?.plugins?.flatMap(e=>H.getSanitizedCapabilities(e).rehypePlugins||[])||[],i=t({remarkPlugins:[_.default,v.default,Je,...n],rehypePlugins:[y.default,[qe,e],...r],jsxRuntime:`automatic`});return{...i,name:`vite-plugin-boltdocs-mdx`,async buildStart(){Ye||=(await Y.load(),!0),i.buildStart&&await i.buildStart.call(this)},async transform(e,t,n){let[r]=t.split(`?`);if(!r.endsWith(`.md`)&&!r.endsWith(`.mdx`))return i.transform?.call(this,e,t,n);let a=`${r}:${f.default.createHash(`md5`).update(e).digest(`hex`)}:${process.env.NODE_ENV===`production`?`prod`:`dev`}:v3`,o=await Y.getAsync(a);if(o)return{code:o,map:null};let s=await i.transform.call(this,e,r,n);return s&&typeof s==`object`&&s.code&&(process.env.NODE_ENV!==`production`&&(s.code+=`
|
|
109
108
|
if (import.meta.hot) {
|
|
110
109
|
import.meta.hot.accept();
|
|
111
110
|
}
|
|
@@ -71,8 +71,7 @@ ${e.filter(e=>e.seo?.noindex||typeof e.seo?.robots==`string`&&e.seo.robots.inclu
|
|
|
71
71
|
</body>`)),e}var D=class e extends Error{pluginName;constructor(t,n){super(`[plugin:${t}] ${n}`),this.name=`PluginError`,this.pluginName=t,Object.setPrototypeOf(this,e.prototype)}},O=class e extends D{constructor(t,n){super(t,`Validation failed: ${n}`),this.name=`PluginValidationError`,Object.setPrototypeOf(this,e.prototype)}},k=class e extends D{constructor(t,n){super(t,`Compatibility error: ${n}`),this.name=`PluginCompatibilityError`,Object.setPrototypeOf(this,e.prototype)}},A=class e extends D{constructor(t,n){super(t,`Missing required permission: '${n}'`),this.name=`PluginPermissionError`,Object.setPrototypeOf(this,e.prototype)}},j=class e extends D{hookName;constructor(t,n,r){super(t,`Error in hook '${n}': ${r.message}`),this.name=`PluginHookError`,this.hookName=n,this.stack=r.stack,Object.setPrototypeOf(this,e.prototype)}},M=class{data=new Map;getNamespaceKey(e,t){return`${e}:${t}`}get(e,t){let n=this.getNamespaceKey(e,t),r=this.data.get(n);if(r!==void 0)return typeof r==`object`&&r?JSON.parse(JSON.stringify(r)):r}set(e,t,n){let r=this.getNamespaceKey(e,t),i=typeof n==`object`&&n?JSON.parse(JSON.stringify(n)):n;this.data.set(r,i)}has(e,t){let n=this.getNamespaceKey(e,t);return this.data.has(n)}};const N=i.extend({version:y.string().optional(),boltdocsVersion:y.string().optional(),permissions:y.array(y.string()).optional(),hooks:y.object({beforeBuild:y.function().optional(),afterBuild:y.function().optional(),beforeDev:y.function().optional(),afterDev:y.function().optional(),configResolved:y.function().optional(),buildEnd:y.function().optional()}).optional()});function P(e,t){let n=[],r=new Set;for(let i of e){let e=N.safeParse(i);if(!e.success)throw new O(i.name||`unknown`,e.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `));let a=e.data;if(r.has(a.name))throw new O(a.name,`Duplicate plugin name detected`);if(r.add(a.name),a.boltdocsVersion&&!te.satisfies(t,a.boltdocsVersion))throw new k(a.name,`Plugin expects Boltdocs version ${a.boltdocsVersion}, but current is ${t}`);if(a.components){for(let[e,t]of Object.entries(a.components))if((t.includes(`..`)||S.isAbsolute(t))&&t.includes(`..`))throw new O(a.name,`Component '${e}' has an invalid path: traversal sequences are not allowed.`)}n.push(a)}return n}function F(e,t){return e.permissions?e.permissions.includes(t):!1}var I=class e{static checkPermission(e,t){if(!F(e,t))throw new A(e.name,t)}static getSanitizedCapabilities(e){return{remarkPlugins:F(e,`mdx:remark`)?e.remarkPlugins:[],rehypePlugins:F(e,`mdx:rehype`)?e.rehypePlugins:[],vitePlugins:F(e,`vite:config`)?e.vitePlugins:[],components:F(e,`components`)?e.components:{}}}static async executeWithIsolation(t,n,r,i){try{return e.checkPermission(t,n),await i()}catch(e){if(e instanceof A){console.warn(`[boltdocs] Skipping hook '${r}' for plugin '${t.name}': ${e.message}`);return}throw e}}},L=class{plugins;config;store;constructor(e,t){this.plugins=e,this.config=t,this.store=new M}async runHook(e,...t){let n=this.getSortedPlugins();for(let r of n){if(!r.hooks?.[e])continue;let n=this.createContext(r),i=e.toLowerCase().includes(`build`),a=e.toLowerCase().includes(`dev`),o=i?`hooks:build`:a?`hooks:dev`:void 0;try{o?await I.executeWithIsolation(r,o,e,()=>r.hooks[e](n,...t)):await r.hooks[e](n,...t)}catch(t){let i=new j(r.name,e,t instanceof Error?t:Error(String(t)));n.logger.error(i)}}}getSortedPlugins(){let e=this.plugins.filter(e=>e.enforce===`pre`),t=this.plugins.filter(e=>!e.enforce),n=this.plugins.filter(e=>e.enforce===`post`);return[...e,...t,...n]}createContext(e){return{config:Object.freeze({...this.config}),meta:{name:e.name,version:e.version,boltdocsVersion:e.boltdocsVersion},store:{get:(e,t)=>this.store.get(e,t),set:(e,t,n)=>this.store.set(e,t,n),has:(e,t)=>this.store.has(e,t)},logger:this.createLogger(e.name)}}createLogger(e){let t=`[plugin:${e}]`;return{info:e=>console.log(`${t} INFO: ${e}`),warn:e=>console.warn(`${t} WARN: ${e}`),error:e=>{let n=e instanceof Error?e.message:e;console.error(`${t} ERROR: ${n}`)},debug:e=>console.debug(`${t} DEBUG: ${e}`)}}};function je(e){return e}const R=_.dirname(ne(import.meta.url));function z(e){return typeof e==`string`?[e]:Array.isArray(e)?e.flatMap(z):e&&typeof e==`object`?Object.values(e).flatMap(z):[]}const Me=new Set([`title`,`description`,`permalink`,`sidebarPosition`,`sidebarLabel`,`sidebarHidden`,`hidden`,`category`,`order`,`badge`,`icon`,`date`,`lastUpdated`,`groupTitle`,`groupPosition`,`seo`]);function Ne(e){let t=[];for(let n of e){let e=``;n.frontmatter&&(e=z(Object.entries(n.frontmatter).filter(([e])=>!Me.has(e)).map(([e,t])=>t)).join(` `));let r=e?`${n._content||``} ${e}`:n._content||``;if(t.push({id:n.path,title:n.title,content:r,url:n.path,display:n.groupTitle?`${n.groupTitle} > ${n.title}`:n.title,locale:n.locale,version:n.version}),n.headings)for(let e of n.headings)t.push({id:`${n.path}#${e.id}`,title:e.text,content:`${e.text} in ${n.title}`,url:`${n.path}#${e.id}`,display:`${n.title} > ${e.text}`,locale:n.locale,version:n.version})}return t}function B(e,t,n=!1){let r=S.resolve(process.cwd(),`index.css`),i=v.existsSync(r)?`import './index.css';`:``,o=t?.plugins?.flatMap(e=>Object.entries(e.components||{}))||[],s=o.map(([e,t])=>`import * as _comp_${e} from '${a(t)}';
|
|
72
72
|
const ${e} = _comp_${e}.default || _comp_${e}['${e}'] || _comp_${e};`).join(`
|
|
73
73
|
`),c=o.map(([e])=>e).join(`, `),l=S.basename(e.docsDir||`docs`),u=S.resolve(process.cwd(),e.docsDir||`docs`),d=[`tsx`,`ts`,`jsx`,`js`].map(e=>S.resolve(u,`pages-external/index.${e}`)).find(e=>v.existsSync(e));return`
|
|
74
|
-
import { ViteReactSSG } from '
|
|
75
|
-
import { createRoutes } from 'boltdocs/client';
|
|
74
|
+
import { ViteReactSSG, createRoutes } from 'boltdocs/client';
|
|
76
75
|
import _routes from 'virtual:boltdocs-routes.ts';
|
|
77
76
|
import _config from 'virtual:boltdocs-config.ts';
|
|
78
77
|
import _user_mdx_components from 'virtual:boltdocs-mdx-components.tsx';
|
|
@@ -105,7 +104,7 @@ export const createRoot = ViteReactSSG(
|
|
|
105
104
|
const mdxComponents = components.default || components;
|
|
106
105
|
export default mdxComponents;
|
|
107
106
|
export * from '${e}';`}return`export default {};`}if(c===`layout`){let e=[`tsx`,`jsx`],t=null;for(let n of e){let e=_.resolve(r,`layout.${n}`);if(b.existsSync(e)){t=e;break}}if(t)return`import UserLayout from '${a(t)}';
|
|
108
|
-
export default UserLayout;`;throw Error(`[Boltdocs] Layout file not found. A 'layout.tsx' or 'layout.jsx' file is mandatory in your docs directory. Please create one to define your site structure.`)}if(c===`icons`){let e=[`tsx`,`jsx`,`ts`,`js`],t=null;for(let n of e){let e=_.resolve(r,`icons.${n}`);if(b.existsSync(e)){t=e;break}}return t?`import * as icons from '${a(t)}';\nexport default icons;`:`export default {};`}if(c===`search`){if(!H){let e=Ne(await f(r,s));H=`export default ${JSON.stringify(e,null,2)};`}return H}if(c===`client`){let e=R,t=``;for(;e&&e!==_.parse(e).root;){let n=_.join(e,`src/client/index.ts`),r=_.join(e,`dist/client/index.mjs`),i=_.join(e,`client/index.ts`);if(b.existsSync(n)){t=a(n);break}if(b.existsSync(r)){t=a(r);break}if(b.existsSync(i)){t=a(i);break}e=_.dirname(e)}if(!t)throw Error(`[boltdocs] Could not resolve boltdocs/client entry point starting from ${R}`);return`export * from '${t}';`}}}}const U={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains`};function Ie(e){let t=process.env.NODE_ENV===`development`,n={"default-src":[`'self'`],"script-src":[`'self'`,`'unsafe-inline'`],"style-src":[`'self'`,`'unsafe-inline'`],"img-src":[`'self'`,`data:`,`https:`],"font-src":[`'self'`],"connect-src":[`'self'`]};return t&&(n[`script-src`]=[`'self'`,`'unsafe-eval'`,`'unsafe-inline'`],n[`style-src`]=[`'self'`,`'unsafe-inline'`]),Object.entries(n).map(([e,t])=>`${e} ${t.join(` `)}`).join(`; `)}const W=new Map;async function Le(e){try{let{data:t}=await c(e),n=JSON.stringify(t);return x.createHash(`md5`).update(n).digest(`hex`)}catch{return``}}function Re(e){return W.get(e)}function ze(e,t){W.set(e,t)}function Be(e){W.delete(e)}function G(e,t){let n=e.moduleGraph.getModuleById(`\0virtual:boltdocs-${t}.ts`);n&&e.moduleGraph.invalidateModule(n)}function Ve(r,i,o,c,l){let f=new Map;return{name:`vite-plugin-boltdocs-dev-server`,apply:`serve`,async configureServer(c){let p=l();await p?.runHook(`beforeDev`),n(r,process.cwd(),o()).catch(e=>{console.error(`[boltdocs] Failed to generate initial link tree:`,e)}),setTimeout(async()=>{try{let{generateRoutes:e}=await import(`./routes-CMUZGI6T.mjs`).then(e=>e.r),t=await e(r,o());for(let e of t)if(e.filePath){let t=_.relative(process.cwd(),e.filePath).replace(/\\/g,`/`),n=t.startsWith(`/`)?t:`/${t}`;await c.transformRequest(n).catch(()=>{}),await new Promise(e=>setTimeout(e,50))}}catch{}},1e3),c.middlewares.use((e,t,n)=>{process.env.NODE_ENV===`production`&&Object.entries(U).forEach(([e,n])=>{t.setHeader(e,n)});let r=o();r.security?.enableCSP&&t.setHeader(`Content-Security-Policy`,Ie(r)),n()}),c.middlewares.use((e,t,n)=>{if(e.url===`/robots.txt`){n();return}n()}),c.middlewares.use(async(e,t,n)=>{let r=e.url?.split(`?`)[0]||`/`,i=e.headers.accept||``,a=o(),s=/\.(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(r);if(i.includes(`text/html`)&&!s){let n=T(a);n=E(n,a),n=await c.transformIndexHtml(e.url||`/`,n),t.statusCode=200,t.setHeader(`Content-Type`,`text/html`),t.end(n);return}n()});let m=e.map(e=>_.resolve(process.cwd(),e)),h=[`tsx`,`jsx`].map(e=>_.resolve(r,`layout.${e}`)),g=[`tsx`,`ts`,`jsx`,`js`],v=g.map(e=>_.resolve(r,`mdx-components.${e}`)),y=g.map(e=>_.resolve(r,`pages-external/index.${e}`)),b=g.map(e=>_.resolve(r,`icons.${e}`));c.watcher.add([...m,...v,...h,...y,...b]);let x=async(l,p)=>{try{let m=a(l);if(e.some(e=>m.endsWith(e))){c.restart();return}if(g.some(e=>m.endsWith(`mdx-components.${e}`))){t(o(),r),G(c,`mdx-components.tsx`),c.ws.send({type:`full-reload`});return}if(g.some(e=>m.endsWith(`icons.${e}`))){G(c,`icons.tsx`),c.ws.send({type:`full-reload`});return}if(m.endsWith(`layout.tsx`)||m.endsWith(`layout.jsx`)){G(c,`layout.tsx`),c.ws.send({type:`full-reload`});return}if(m.includes(`/pages-external/`)||m.includes(`\\pages-external\\`)){G(c,`entry`),c.ws.send({type:`full-reload`});return}if(!m.toLowerCase().startsWith(i.toLowerCase())||!s(m))return;if(p===`add`||p===`unlink`){p===`unlink`&&Be(l),d(),Pe();let e=o();t(e,r),G(c,`config`),G(c,`routes`),G(c,`search`),n(r,process.cwd(),e).catch(e=>{console.error(`[boltdocs] Failed to update link tree:`,e)}),c.ws.send({type:`custom`,event:`boltdocs:config-update`,data:{theme:e?.theme,i18n:e?.i18n,versions:e?.versions,siteUrl:e?.siteUrl}}),c.ws.send({type:`full-reload`});return}f.has(m)&&clearTimeout(f.get(m)),f.set(m,setTimeout(async()=>{f.delete(m);try{let e=Re(l),t=await Le(l);ze(l,t),u(l),e!==void 0&&e!==t&&(G(c,`routes`),G(c,`search`));let n=a(_.relative(r,l)),i=c.moduleGraph.getModulesByFile(m);if(i)for(let e of i)c.moduleGraph.invalidateModule(e);c.ws.send({type:`custom`,event:`boltdocs:mdx-update`,data:{file:m,relPath:n}})}catch(e){console.error(`[boltdocs] HMR error processing content change:`,e)}},150))}catch(e){console.error(`[boltdocs] HMR error during ${p} event:`,e)}};c.watcher.on(`add`,e=>x(e,`add`)),c.watcher.on(`unlink`,e=>x(e,`unlink`)),c.watcher.on(`change`,e=>x(e,`change`)),await p?.runHook(`afterDev`)},handleHotUpdate({file:e,server:t}){let n=a(e);if(n.toLowerCase().startsWith(i.toLowerCase())&&s(n))return[]}}}function He(e={},t){let n=_.resolve(process.cwd(),e.docsDir||`docs`),i=a(n),o=t,s,c=!1,l,u=[],d=()=>o;return[{name:`vite-plugin-boltdocs`,enforce:`pre`,async config(e,t){c=t.command===`build`;let i=e.envDir||process.cwd(),a=h(t.mode,i,``);Object.assign(process.env,a),o||=await r(n);let s=(await import(`./package-HegMOTL_.mjs`)).version,d=P(o.plugins||[],s);return o.plugins=d,l=new L(d,o),u=d.flatMap(e=>I.getSanitizedCapabilities(e).vitePlugins||[]),c&&await l.runHook(`beforeBuild`),{ssgOptions:{entry:`boltdocs/entry`,htmlEntry:`index.html`,dirStyle:`nested`,includeAllRoutes:!0,mock:!0,script:`async`,beastiesOptions:{preload:`media`},onFinished:async e=>{let t=ke(w(await f(n,o)),o);t&&b.writeFileSync(_.join(e,`sitemap.xml`),t);let r=Ae(o);b.writeFileSync(_.join(e,`robots.txt`),r)}},build:{ssrManifest:c},async config(){return{optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-router-dom`,`react-helmet-async`],exclude:[`boltdocs`,`boltdocs/client`]},resolve:{dedupe:[`react`,`react-dom`]}}}}},configResolved(e){s=e,l?.runHook(`configResolved`,o)},transformIndexHtml:{order:`pre`,handler(e){return E(e,o)}},async buildEnd(){let{pool:e}=await import(`./worker-pool-Bd8Y9KDv.mjs`);await e.terminate()},async closeBundle(){!c||s?.build?.ssr||(await l?.runHook(`afterBuild`),await l?.runHook(`buildEnd`))}},Fe(e,d,()=>s,n),Ve(n,i,d,e=>{o=e},()=>l),{...ee({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:`preset-default`}]}}),apply:`build`},...u]}const K=new l(`mdx`),Ue=[le.default||le,ue.default||ue,de.default||de,fe.default||fe,pe.default||pe,me.default||me,he.default||he],We=[ge,_e,ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe];let Ge=null,q=null;const Ke=()=>(Ge??=se(),Ge),qe=async e=>q||(q=ce({themes:Ue,langs:We,engine:Ke()}),q),J={JSX_FLOW_ELEMENT:`mdxJsxFlowElement`,JSX_TEXT_ELEMENT:`mdxJsxTextElement`,JSX_ATTRIBUTE:`mdxJsxAttribute`,ELEMENT:`element`,TEXT:`text`,CODE:`code`},Je={PRE:`pre`,CODE:`code`},Y={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},X={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},Ye={LIGHT:`github-light`,DARK:`github-dark`},Z={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},Xe=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,X.LINE_NUMBERS)}}},Ze=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,X.WORD_WRAP)}}},Qe=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[Y.TITLE]=t)}}),$e=()=>({name:`AddLanguageProperty`,pre(e){e.properties[Y.LANG]=this.options.lang||Z.LANG}});function et(e){let t={};if(!e)return t;/lineNumbers|showLineNumbers/.test(e)&&(t.lineNumbers=!0),/wordWrap|word-wrap/.test(e)&&(t.wordWrap=!0);let n=e.match(/title=(["'])(.*?)\1/);return n&&(t.title=n[2]),t}var tt=class{config;constructor(e){this.config=e}getTheme(){return this.config?.theme?.codeTheme||{light:Ye.LIGHT,dark:Ye.DARK}}async getHighlighter(){return await qe(this.getTheme())}getOptions(e,t){let n=this.getTheme(),r={},i=``;typeof t==`string`?(i=t,r=et(t)):t&&(r=t,i=t.__raw||``);let a={lang:e||Z.LANG,meta:{__raw:i,...r},transformers:[Xe(),Ze(),Qe(),$e()]};return typeof n==`object`?a.themes={light:n.light,dark:n.dark}:a.theme=n,a}async render(e,t,n){try{let r=await this.getHighlighter(),i=this.getOptions(t,n);return r.codeToHtml(e,i)}catch(t){return console.error(`[ShikiAdapter] Failed to render code:`,t),`<pre class="${X.FALLBACK}"><code>${nt(e)}</code></pre>`}}};function nt(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}let Q=null,rt;function it(e){let t=JSON.stringify(e?.theme?.codeTheme||null);return(Q===null||rt!==t)&&(Q=new tt(e),rt=t),Q}function at(e){let t=it(e);return async e=>{let n=await t.getHighlighter();C(e,J.ELEMENT,e=>{if(e.tagName===Je.PRE&&e.children?.[0]?.type===J.ELEMENT&&e.children[0].tagName===Je.CODE){let r=e.children[0],i=(r.properties?.className||[]).find(e=>e.startsWith(`language-`)),a=i?i.slice(9):Z.MDX_DEFAULT_LANG;if(a===`mermaid`)return;let o=r.children?.[0]?.value||``,s=et(r.properties?.metastring||r.data?.meta||``),c=t.getOptions(a,s),l=``;try{l=n.codeToHtml(o,c)}catch(e){console.error(`[rehypeShiki] Failed to highlight code block:`,e),l=`<pre class="${X.FALLBACK}"><code>${nt(o)}</code></pre>`}e.properties=e.properties||{},s.title&&(e.properties[Y.TITLE]=s.title),e.properties[Y.HIGHLIGHTED]=`true`,e.properties[Y.HIGHLIGHTED_HTML]=l,e.properties[Y.LANG]=a,e.children=[]}})}}function ot(){return e=>{C(e,J.CODE,e=>{e.meta&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties.metastring=e.meta)})}}let st=!1;function $(e,t=re){let n=e?.plugins?.flatMap(e=>I.getSanitizedCapabilities(e).remarkPlugins||[])||[],r=e?.plugins?.flatMap(e=>I.getSanitizedCapabilities(e).rehypePlugins||[])||[],i=t({remarkPlugins:[ie,ae,ot,...n],rehypePlugins:[oe,[at,e],...r],jsxRuntime:`automatic`});return{...i,name:`vite-plugin-boltdocs-mdx`,async buildStart(){st||=(await K.load(),!0),i.buildStart&&await i.buildStart.call(this)},async transform(e,t,n){let[r]=t.split(`?`);if(!r.endsWith(`.md`)&&!r.endsWith(`.mdx`))return i.transform?.call(this,e,t,n);let a=`${r}:${x.createHash(`md5`).update(e).digest(`hex`)}:${process.env.NODE_ENV===`production`?`prod`:`dev`}:v3`,o=await K.getAsync(a);if(o)return{code:o,map:null};let s=await i.transform.call(this,e,r,n);return s&&typeof s==`object`&&s.code&&(process.env.NODE_ENV!==`production`&&(s.code+=`
|
|
107
|
+
export default UserLayout;`;throw Error(`[Boltdocs] Layout file not found. A 'layout.tsx' or 'layout.jsx' file is mandatory in your docs directory. Please create one to define your site structure.`)}if(c===`icons`){let e=[`tsx`,`jsx`,`ts`,`js`],t=null;for(let n of e){let e=_.resolve(r,`icons.${n}`);if(b.existsSync(e)){t=e;break}}return t?`import * as icons from '${a(t)}';\nexport default icons;`:`export default {};`}if(c===`search`){if(!H){let e=Ne(await f(r,s));H=`export default ${JSON.stringify(e,null,2)};`}return H}if(c===`client`){let e=R,t=``;for(;e&&e!==_.parse(e).root;){let n=_.join(e,`src/client/index.ts`),r=_.join(e,`dist/client/index.mjs`),i=_.join(e,`client/index.ts`);if(b.existsSync(n)){t=a(n);break}if(b.existsSync(r)){t=a(r);break}if(b.existsSync(i)){t=a(i);break}e=_.dirname(e)}if(!t)throw Error(`[boltdocs] Could not resolve boltdocs/client entry point starting from ${R}`);return`export * from '${t}';`}}}}const U={"X-Content-Type-Options":`nosniff`,"X-Frame-Options":`DENY`,"X-XSS-Protection":`1; mode=block`,"Referrer-Policy":`strict-origin-when-cross-origin`,"Permissions-Policy":`camera=(), microphone=(), geolocation=()`,"Strict-Transport-Security":`max-age=31536000; includeSubDomains`};function Ie(e){let t=process.env.NODE_ENV===`development`,n={"default-src":[`'self'`],"script-src":[`'self'`,`'unsafe-inline'`],"style-src":[`'self'`,`'unsafe-inline'`],"img-src":[`'self'`,`data:`,`https:`],"font-src":[`'self'`],"connect-src":[`'self'`]};return t&&(n[`script-src`]=[`'self'`,`'unsafe-eval'`,`'unsafe-inline'`],n[`style-src`]=[`'self'`,`'unsafe-inline'`]),Object.entries(n).map(([e,t])=>`${e} ${t.join(` `)}`).join(`; `)}const W=new Map;async function Le(e){try{let{data:t}=await c(e),n=JSON.stringify(t);return x.createHash(`md5`).update(n).digest(`hex`)}catch{return``}}function Re(e){return W.get(e)}function ze(e,t){W.set(e,t)}function Be(e){W.delete(e)}function G(e,t){let n=e.moduleGraph.getModuleById(`\0virtual:boltdocs-${t}.ts`);n&&e.moduleGraph.invalidateModule(n)}function Ve(r,i,o,c,l){let f=new Map;return{name:`vite-plugin-boltdocs-dev-server`,apply:`serve`,async configureServer(c){let p=l();await p?.runHook(`beforeDev`),n(r,process.cwd(),o()).catch(e=>{console.error(`[boltdocs] Failed to generate initial link tree:`,e)}),setTimeout(async()=>{try{let{generateRoutes:e}=await import(`./routes-CMUZGI6T.mjs`).then(e=>e.r),t=await e(r,o());for(let e of t)if(e.filePath){let t=_.relative(process.cwd(),e.filePath).replace(/\\/g,`/`),n=t.startsWith(`/`)?t:`/${t}`;await c.transformRequest(n).catch(()=>{}),await new Promise(e=>setTimeout(e,50))}}catch{}},1e3),c.middlewares.use((e,t,n)=>{process.env.NODE_ENV===`production`&&Object.entries(U).forEach(([e,n])=>{t.setHeader(e,n)});let r=o();r.security?.enableCSP&&t.setHeader(`Content-Security-Policy`,Ie(r)),n()}),c.middlewares.use((e,t,n)=>{if(e.url===`/robots.txt`){n();return}n()}),c.middlewares.use(async(e,t,n)=>{let r=e.url?.split(`?`)[0]||`/`,i=e.headers.accept||``,a=o(),s=/\.(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(r);if(i.includes(`text/html`)&&!s){let n=T(a);n=E(n,a),n=await c.transformIndexHtml(e.url||`/`,n),t.statusCode=200,t.setHeader(`Content-Type`,`text/html`),t.end(n);return}n()});let m=e.map(e=>_.resolve(process.cwd(),e)),h=[`tsx`,`jsx`].map(e=>_.resolve(r,`layout.${e}`)),g=[`tsx`,`ts`,`jsx`,`js`],v=g.map(e=>_.resolve(r,`mdx-components.${e}`)),y=g.map(e=>_.resolve(r,`pages-external/index.${e}`)),b=g.map(e=>_.resolve(r,`icons.${e}`));c.watcher.add([...m,...v,...h,...y,...b]);let x=async(l,p)=>{try{let m=a(l);if(e.some(e=>m.endsWith(e))){c.restart();return}if(g.some(e=>m.endsWith(`mdx-components.${e}`))){t(o(),r),G(c,`mdx-components.tsx`),c.ws.send({type:`full-reload`});return}if(g.some(e=>m.endsWith(`icons.${e}`))){G(c,`icons.tsx`),c.ws.send({type:`full-reload`});return}if(m.endsWith(`layout.tsx`)||m.endsWith(`layout.jsx`)){G(c,`layout.tsx`),c.ws.send({type:`full-reload`});return}if(m.includes(`/pages-external/`)||m.includes(`\\pages-external\\`)){G(c,`entry`),c.ws.send({type:`full-reload`});return}if(!m.toLowerCase().startsWith(i.toLowerCase())||!s(m))return;if(p===`add`||p===`unlink`){p===`unlink`&&Be(l),d(),Pe();let e=o();t(e,r),G(c,`config`),G(c,`routes`),G(c,`search`),n(r,process.cwd(),e).catch(e=>{console.error(`[boltdocs] Failed to update link tree:`,e)}),c.ws.send({type:`custom`,event:`boltdocs:config-update`,data:{theme:e?.theme,i18n:e?.i18n,versions:e?.versions,siteUrl:e?.siteUrl}}),c.ws.send({type:`full-reload`});return}f.has(m)&&clearTimeout(f.get(m)),f.set(m,setTimeout(async()=>{f.delete(m);try{let e=Re(l),t=await Le(l);ze(l,t),u(l),e!==void 0&&e!==t&&(G(c,`routes`),G(c,`search`));let n=a(_.relative(r,l)),i=c.moduleGraph.getModulesByFile(m);if(i)for(let e of i)c.moduleGraph.invalidateModule(e);c.ws.send({type:`custom`,event:`boltdocs:mdx-update`,data:{file:m,relPath:n}})}catch(e){console.error(`[boltdocs] HMR error processing content change:`,e)}},150))}catch(e){console.error(`[boltdocs] HMR error during ${p} event:`,e)}};c.watcher.on(`add`,e=>x(e,`add`)),c.watcher.on(`unlink`,e=>x(e,`unlink`)),c.watcher.on(`change`,e=>x(e,`change`)),await p?.runHook(`afterDev`)},handleHotUpdate({file:e,server:t}){let n=a(e);if(n.toLowerCase().startsWith(i.toLowerCase())&&s(n))return[]}}}function He(e={},t){let n=_.resolve(process.cwd(),e.docsDir||`docs`),i=a(n),o=t,s,c=!1,l,u=[],d=()=>o;return[{name:`vite-plugin-boltdocs`,enforce:`pre`,async config(e,t){c=t.command===`build`;let i=e.envDir||process.cwd(),a=h(t.mode,i,``);Object.assign(process.env,a),o||=await r(n);let s=(await import(`./package-2TVh81ZC.mjs`)).version,d=P(o.plugins||[],s);return o.plugins=d,l=new L(d,o),u=d.flatMap(e=>I.getSanitizedCapabilities(e).vitePlugins||[]),c&&await l.runHook(`beforeBuild`),{ssgOptions:{entry:`boltdocs/entry`,htmlEntry:`index.html`,dirStyle:`nested`,includeAllRoutes:!0,mock:!0,script:`async`,beastiesOptions:{preload:`media`},onFinished:async e=>{let t=ke(w(await f(n,o)),o);t&&b.writeFileSync(_.join(e,`sitemap.xml`),t);let r=Ae(o);b.writeFileSync(_.join(e,`robots.txt`),r)}},build:{ssrManifest:c},async config(){return{optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-router-dom`,`react-helmet-async`],exclude:[`boltdocs`,`boltdocs/client`]},resolve:{dedupe:[`react`,`react-dom`]}}}}},configResolved(e){s=e,l?.runHook(`configResolved`,o)},transformIndexHtml:{order:`pre`,handler(e){return E(e,o)}},async buildEnd(){let{pool:e}=await import(`./worker-pool-Bd8Y9KDv.mjs`);await e.terminate()},async closeBundle(){!c||s?.build?.ssr||(await l?.runHook(`afterBuild`),await l?.runHook(`buildEnd`))}},Fe(e,d,()=>s,n),Ve(n,i,d,e=>{o=e},()=>l),{...ee({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:`preset-default`}]}}),apply:`build`},...u]}const K=new l(`mdx`),Ue=[le.default||le,ue.default||ue,de.default||de,fe.default||fe,pe.default||pe,me.default||me,he.default||he],We=[ge,_e,ve,ye,be,xe,Se,Ce,we,Te,Ee,De,Oe];let Ge=null,q=null;const Ke=()=>(Ge??=se(),Ge),qe=async e=>q||(q=ce({themes:Ue,langs:We,engine:Ke()}),q),J={JSX_FLOW_ELEMENT:`mdxJsxFlowElement`,JSX_TEXT_ELEMENT:`mdxJsxTextElement`,JSX_ATTRIBUTE:`mdxJsxAttribute`,ELEMENT:`element`,TEXT:`text`,CODE:`code`},Je={PRE:`pre`,CODE:`code`},Y={TITLE:`data-title`,LANG:`data-lang`,HIGHLIGHTED:`data-highlighted`,HIGHLIGHTED_HTML:`data-highlighted-html`},X={LINE_NUMBERS:`shiki-line-numbers`,WORD_WRAP:`shiki-word-wrap`,FALLBACK:`shiki-fallback`},Ye={LIGHT:`github-light`,DARK:`github-dark`},Z={LANG:`plaintext`,MDX_DEFAULT_LANG:`text`},Xe=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:line-numbers`,pre(e){let n=this.options.meta?.lineNumbers===!0;(t||n)&&this.addClassToHast(e,X.LINE_NUMBERS)}}},Ze=(e={})=>{let{activateByDefault:t=!1}=e;return{name:`boltdocs:word-wrap`,pre(e){let n=this.options.meta?.wordWrap===!0;(t||n)&&this.addClassToHast(e,X.WORD_WRAP)}}},Qe=()=>({name:`AddTitleProperty`,pre(e){let t=this.options.meta?.title;t&&(e.properties[Y.TITLE]=t)}}),$e=()=>({name:`AddLanguageProperty`,pre(e){e.properties[Y.LANG]=this.options.lang||Z.LANG}});function et(e){let t={};if(!e)return t;/lineNumbers|showLineNumbers/.test(e)&&(t.lineNumbers=!0),/wordWrap|word-wrap/.test(e)&&(t.wordWrap=!0);let n=e.match(/title=(["'])(.*?)\1/);return n&&(t.title=n[2]),t}var tt=class{config;constructor(e){this.config=e}getTheme(){return this.config?.theme?.codeTheme||{light:Ye.LIGHT,dark:Ye.DARK}}async getHighlighter(){return await qe(this.getTheme())}getOptions(e,t){let n=this.getTheme(),r={},i=``;typeof t==`string`?(i=t,r=et(t)):t&&(r=t,i=t.__raw||``);let a={lang:e||Z.LANG,meta:{__raw:i,...r},transformers:[Xe(),Ze(),Qe(),$e()]};return typeof n==`object`?a.themes={light:n.light,dark:n.dark}:a.theme=n,a}async render(e,t,n){try{let r=await this.getHighlighter(),i=this.getOptions(t,n);return r.codeToHtml(e,i)}catch(t){return console.error(`[ShikiAdapter] Failed to render code:`,t),`<pre class="${X.FALLBACK}"><code>${nt(e)}</code></pre>`}}};function nt(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}let Q=null,rt;function it(e){let t=JSON.stringify(e?.theme?.codeTheme||null);return(Q===null||rt!==t)&&(Q=new tt(e),rt=t),Q}function at(e){let t=it(e);return async e=>{let n=await t.getHighlighter();C(e,J.ELEMENT,e=>{if(e.tagName===Je.PRE&&e.children?.[0]?.type===J.ELEMENT&&e.children[0].tagName===Je.CODE){let r=e.children[0],i=(r.properties?.className||[]).find(e=>e.startsWith(`language-`)),a=i?i.slice(9):Z.MDX_DEFAULT_LANG;if(a===`mermaid`)return;let o=r.children?.[0]?.value||``,s=et(r.properties?.metastring||r.data?.meta||``),c=t.getOptions(a,s),l=``;try{l=n.codeToHtml(o,c)}catch(e){console.error(`[rehypeShiki] Failed to highlight code block:`,e),l=`<pre class="${X.FALLBACK}"><code>${nt(o)}</code></pre>`}e.properties=e.properties||{},s.title&&(e.properties[Y.TITLE]=s.title),e.properties[Y.HIGHLIGHTED]=`true`,e.properties[Y.HIGHLIGHTED_HTML]=l,e.properties[Y.LANG]=a,e.children=[]}})}}function ot(){return e=>{C(e,J.CODE,e=>{e.meta&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties.metastring=e.meta)})}}let st=!1;function $(e,t=re){let n=e?.plugins?.flatMap(e=>I.getSanitizedCapabilities(e).remarkPlugins||[])||[],r=e?.plugins?.flatMap(e=>I.getSanitizedCapabilities(e).rehypePlugins||[])||[],i=t({remarkPlugins:[ie,ae,ot,...n],rehypePlugins:[oe,[at,e],...r],jsxRuntime:`automatic`});return{...i,name:`vite-plugin-boltdocs-mdx`,async buildStart(){st||=(await K.load(),!0),i.buildStart&&await i.buildStart.call(this)},async transform(e,t,n){let[r]=t.split(`?`);if(!r.endsWith(`.md`)&&!r.endsWith(`.mdx`))return i.transform?.call(this,e,t,n);let a=`${r}:${x.createHash(`md5`).update(e).digest(`hex`)}:${process.env.NODE_ENV===`production`?`prod`:`dev`}:v3`,o=await K.getAsync(a);if(o)return{code:o,map:null};let s=await i.transform.call(this,e,r,n);return s&&typeof s==`object`&&s.code&&(process.env.NODE_ENV!==`production`&&(s.code+=`
|
|
109
108
|
if (import.meta.hot) {
|
|
110
109
|
import.meta.hot.accept();
|
|
111
110
|
}
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Copyright (c) 2026 Jesus Alcala
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
var e=`2.7.
|
|
6
|
+
var e=`2.7.1`;Object.defineProperty(exports,`version`,{enumerable:!0,get:function(){return e}});
|
package/package.json
CHANGED
package/src/client/ssg/index.ts
CHANGED