boltdocs 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/base-ui/index.d.mts +25 -0
- package/dist/base-ui/index.d.ts +25 -0
- package/dist/base-ui/index.js +1 -0
- package/dist/base-ui/index.mjs +1 -0
- package/dist/{cache-Q4T6VAUL.mjs → cache-CRAZ55X7.mjs} +1 -1
- package/dist/chunk-5D6XPYQ3.mjs +74 -0
- package/dist/chunk-6QXCKZAT.mjs +1 -0
- package/dist/chunk-H4M6P3DM.mjs +1 -0
- package/dist/chunk-JD3RSDE4.mjs +1 -0
- package/dist/chunk-JXHNX2WN.mjs +1 -0
- package/dist/chunk-JZXLCA2E.mjs +1 -0
- package/dist/chunk-MZBG4N4W.mjs +1 -0
- package/dist/chunk-NBCYHLAA.mjs +1 -0
- package/dist/chunk-Q3MLYTIQ.mjs +1 -0
- package/dist/chunk-RSII2UPE.mjs +1 -0
- package/dist/chunk-T3W44KWY.mjs +1 -0
- package/dist/chunk-ZK2266IZ.mjs +1 -0
- package/dist/chunk-ZRJ55GGF.mjs +1 -0
- package/dist/client/index.d.mts +13 -115
- package/dist/client/index.d.ts +13 -115
- package/dist/client/index.js +1 -1
- package/dist/client/index.mjs +1 -1
- package/dist/client/ssr.js +1 -1
- package/dist/client/ssr.mjs +1 -1
- package/dist/client/types.d.mts +3 -0
- package/dist/client/types.d.ts +3 -0
- package/dist/client/types.js +1 -0
- package/dist/client/types.mjs +0 -0
- package/dist/copy-markdown-C-90ixSe.d.ts +15 -0
- package/dist/copy-markdown-CbS8X-qe.d.mts +15 -0
- package/dist/{client/hooks → hooks}/index.d.mts +25 -12
- package/dist/{client/hooks → hooks}/index.d.ts +25 -12
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/index.mjs +1 -0
- package/dist/integrations/index.d.mts +48 -0
- package/dist/integrations/index.d.ts +48 -0
- package/dist/integrations/index.js +1 -0
- package/dist/integrations/index.mjs +1 -0
- package/dist/link-DfBwCeZc.d.mts +68 -0
- package/dist/link-DfBwCeZc.d.ts +68 -0
- package/dist/loading-BqGrFWO5.d.mts +68 -0
- package/dist/loading-chS3pm9W.d.ts +68 -0
- package/dist/{client/components/mdx → mdx}/index.d.mts +6 -38
- package/dist/{client/components/mdx → mdx}/index.d.ts +6 -38
- package/dist/mdx/index.js +1 -0
- package/dist/mdx/index.mjs +1 -0
- package/dist/node/cli-entry.js +27 -27
- package/dist/node/cli-entry.mjs +1 -1
- package/dist/node/index.d.mts +44 -14
- package/dist/node/index.d.ts +44 -14
- package/dist/node/index.js +23 -23
- package/dist/node/index.mjs +1 -1
- package/dist/primitives/index.d.mts +301 -0
- package/dist/primitives/index.d.ts +301 -0
- package/dist/primitives/index.js +1 -0
- package/dist/primitives/index.mjs +1 -0
- package/dist/search-dialog-MA5AISC7.mjs +1 -0
- package/dist/{types-Cp21DHI6.d.mts → types-j7jvWsJj.d.mts} +63 -17
- package/dist/{types-Cp21DHI6.d.ts → types-j7jvWsJj.d.ts} +63 -17
- package/dist/{use-routes-xLhumjbV.d.ts → use-routes-Cd806kGw.d.ts} +1 -1
- package/dist/{use-routes-8Iei6jTp.d.mts → use-routes-DDL0_jkQ.d.mts} +1 -1
- package/package.json +34 -8
- package/src/client/app/index.tsx +155 -35
- package/src/client/app/mdx-component.tsx +7 -3
- package/src/client/app/theme-context.tsx +40 -23
- package/src/client/components/default-layout.tsx +12 -6
- package/src/client/components/primitives/breadcrumbs.tsx +1 -1
- package/src/client/components/primitives/navbar.tsx +5 -2
- package/src/client/components/primitives/search-dialog.tsx +12 -3
- package/src/client/components/ui-base/breadcrumbs.tsx +1 -1
- package/src/client/components/ui-base/index.ts +17 -0
- package/src/client/components/ui-base/navbar.tsx +66 -33
- package/src/client/components/ui-base/powered-by.tsx +8 -5
- package/src/client/components/ui-base/sidebar.tsx +31 -22
- package/src/client/components/ui-base/tabs.tsx +4 -1
- package/src/client/components/ui-base/theme-toggle.tsx +35 -15
- package/src/client/hooks/use-i18n.ts +37 -7
- package/src/client/hooks/use-localized-to.ts +45 -68
- package/src/client/hooks/use-navbar.ts +10 -3
- package/src/client/hooks/use-routes.ts +61 -17
- package/src/client/hooks/use-search.ts +21 -5
- package/src/client/hooks/use-sidebar.ts +5 -2
- package/src/client/hooks/use-version.ts +5 -0
- package/src/client/integrations/index.ts +1 -0
- package/src/client/store/use-boltdocs-store.ts +43 -0
- package/src/client/types.ts +4 -2
- package/src/client/utils/i18n.ts +23 -0
- package/src/node/config.ts +54 -17
- package/src/node/index.ts +1 -1
- package/src/node/mdx/cache.ts +12 -0
- package/src/node/mdx/highlighter.ts +47 -0
- package/src/node/mdx/index.ts +114 -0
- package/src/node/mdx/rehype-shiki.ts +53 -0
- package/src/node/mdx/remark-shiki.ts +61 -0
- package/src/node/plugin/html.ts +8 -4
- package/src/node/plugin/index.ts +117 -68
- package/src/node/routes/index.ts +34 -13
- package/src/node/routes/parser.ts +12 -4
- package/src/node/ssg/index.ts +3 -3
- package/src/node/utils.ts +32 -2
- package/tsup.config.ts +7 -2
- package/dist/chunk-52MVMZWS.mjs +0 -1
- package/dist/chunk-BVWWKXJH.mjs +0 -1
- package/dist/chunk-DVY3RDXD.mjs +0 -1
- package/dist/chunk-FUVYCYWC.mjs +0 -1
- package/dist/chunk-GBLMDJ2B.mjs +0 -1
- package/dist/chunk-ISPX45DF.mjs +0 -1
- package/dist/chunk-PNXZMUCO.mjs +0 -1
- package/dist/chunk-V2ZHKQSP.mjs +0 -74
- package/dist/client/components/mdx/index.js +0 -1
- package/dist/client/components/mdx/index.mjs +0 -1
- package/dist/client/hooks/index.js +0 -1
- package/dist/client/hooks/index.mjs +0 -1
- package/dist/search-dialog-TWGYKF2D.mjs +0 -1
- package/src/node/mdx.ts +0 -279
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# boltdocs
|
|
2
2
|
|
|
3
|
+
## 2.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`766daf2`](https://github.com/jesusalcaladev/boltdocs/commit/766daf21becafaa173a65cc8bea4d31b32ce8640) Thanks [@jesusalcaladev](https://github.com/jesusalcaladev)! - feat: support i18n in links & tabs
|
|
8
|
+
feat: change component Loading
|
|
9
|
+
feat: dectecttheme of system
|
|
10
|
+
perf: better calc in the routes & navigation
|
|
11
|
+
|
|
12
|
+
## 2.1.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`1ce39bb`](https://github.com/jesusalcaladev/boltdocs/commit/1ce39bbe07974f35f6a04c341c5578c337f37024) Thanks [@jesusalcaladev](https://github.com/jesusalcaladev)! - fix: repared error of deploy
|
|
17
|
+
|
|
3
18
|
## 2.1.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { B as Breadcrumbs, E as ErrorBoundary, H as Head, L as Loading, N as Navbar, a as NotFound, O as OnThisPage, P as PageNav, b as ProgressBar, S as Sidebar } from '../loading-BqGrFWO5.mjs';
|
|
2
|
+
export { C as CopyMarkdown, a as CopyMarkdownProps } from '../copy-markdown-CbS8X-qe.mjs';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { a as BoltdocsTab, C as ComponentRoute } from '../types-j7jvWsJj.mjs';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'vite';
|
|
7
|
+
|
|
8
|
+
declare function GithubStars({ repo }: {
|
|
9
|
+
repo: string;
|
|
10
|
+
}): react_jsx_runtime.JSX.Element;
|
|
11
|
+
|
|
12
|
+
declare function PoweredBy(): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
declare function SearchDialog({ routes }: {
|
|
15
|
+
routes: any[];
|
|
16
|
+
}): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
declare function Tabs({ tabs, routes, }: {
|
|
19
|
+
tabs: BoltdocsTab[];
|
|
20
|
+
routes: ComponentRoute[];
|
|
21
|
+
}): react_jsx_runtime.JSX.Element;
|
|
22
|
+
|
|
23
|
+
declare function ThemeToggle(): react_jsx_runtime.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { GithubStars, PoweredBy, SearchDialog, Tabs, ThemeToggle };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { B as Breadcrumbs, E as ErrorBoundary, H as Head, L as Loading, N as Navbar, a as NotFound, O as OnThisPage, P as PageNav, b as ProgressBar, S as Sidebar } from '../loading-chS3pm9W.js';
|
|
2
|
+
export { C as CopyMarkdown, a as CopyMarkdownProps } from '../copy-markdown-C-90ixSe.js';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { a as BoltdocsTab, C as ComponentRoute } from '../types-j7jvWsJj.js';
|
|
5
|
+
import 'react';
|
|
6
|
+
import 'vite';
|
|
7
|
+
|
|
8
|
+
declare function GithubStars({ repo }: {
|
|
9
|
+
repo: string;
|
|
10
|
+
}): react_jsx_runtime.JSX.Element;
|
|
11
|
+
|
|
12
|
+
declare function PoweredBy(): react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
declare function SearchDialog({ routes }: {
|
|
15
|
+
routes: any[];
|
|
16
|
+
}): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
declare function Tabs({ tabs, routes, }: {
|
|
19
|
+
tabs: BoltdocsTab[];
|
|
20
|
+
routes: ComponentRoute[];
|
|
21
|
+
}): react_jsx_runtime.JSX.Element;
|
|
22
|
+
|
|
23
|
+
declare function ThemeToggle(): react_jsx_runtime.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { GithubStars, PoweredBy, SearchDialog, Tabs, ThemeToggle };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var fr=Object.create;var Ve=Object.defineProperty;var gr=Object.getOwnPropertyDescriptor;var hr=Object.getOwnPropertyNames;var br=Object.getPrototypeOf,xr=Object.prototype.hasOwnProperty;var y=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ut=(e,t)=>{for(var o in t)Ve(e,o,{get:t[o],enumerable:!0})},jt=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of hr(t))!xr.call(e,n)&&n!==o&&Ve(e,n,{get:()=>t[n],enumerable:!(r=gr(t,n))||r.enumerable});return e};var V=(e,t,o)=>(o=e!=null?fr(br(e)):{},jt(t||!e||!e.__esModule?Ve(o,"default",{value:e,enumerable:!0}):o,e)),vr=e=>jt(Ve({},"__esModule",{value:!0}),e);var i=y(()=>{"use strict"});function F(){let e=(0,De.use)(Cr);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e}var De,Cr,pe=y(()=>{"use strict";i();De=require("react"),Cr=(0,De.createContext)(null)});function He(){return(0,ue.use)(yr)}var ue,Nr,yr,mt=y(()=>{"use strict";i();ue=require("react"),Nr=require("react/jsx-runtime"),yr=(0,ue.createContext)({preload:()=>{},routes:[]})});var Kt,ze,ne,$e=y(()=>{"use strict";i();Kt=require("zustand"),ze=require("zustand/middleware"),ne=(0,Kt.create)()((0,ze.persist)(e=>({currentLocale:void 0,currentVersion:void 0,hasHydrated:!1,setLocale:t=>e({currentLocale:t}),setVersion:t=>e({currentVersion:t}),setHasHydrated:t=>e({hasHydrated:t})}),{name:"boltdocs-storage",storage:(0,ze.createJSONStorage)(()=>localStorage),partialize:e=>({currentLocale:e.currentLocale,currentVersion:e.currentVersion}),onRehydrateStorage:()=>e=>{e?.setHasHydrated(!0)}}))});function k(){let{routes:e}=He(),t=F(),o=(0,qt.useLocation)(),r=ne(h=>h.currentLocale),n=ne(h=>h.currentVersion),s=ne(h=>h.hasHydrated),a=e.find(h=>h.path===o.pathname),l=t.i18n?a?.locale||(s?r:void 0)||t.i18n.defaultLocale:void 0,c=t.versions?a?.version||(s?n:void 0)||t.versions.defaultVersion:void 0,f=e.filter(h=>{let Z=t.i18n?(h.locale||t.i18n.defaultLocale)===l:!0,lt=t.versions?(h.version||t.versions.defaultVersion)===c:!0;if(!(Z&<))return!1;let ct=t.i18n;if(ct){let ur=!!a?.locale,dr=!!h.locale;if(e.some(Ee=>Ee!==h&&Ee.filePath===h.filePath&&Ee.version===h.version&&(Ee.locale||ct.defaultLocale)===(h.locale||ct.defaultLocale))&&ur!==dr)return!1}return!0}),p=t.i18n?.localeConfigs?.[l]?.label||t.i18n?.locales[l]||l,v=t.versions?.versions.find(h=>h.path===c)?.label||c,N=t.i18n?Object.entries(t.i18n.locales).map(([h,Z])=>{let lt=t.i18n?.localeConfigs?.[h];return{key:h,label:lt?.label||Z,isCurrent:h===l}}):[],C=t.versions?t.versions.versions.map(h=>({key:h.path,label:h.label,isCurrent:h.path===c})):[];return{routes:f,allRoutes:e,currentRoute:a,currentLocale:l,currentLocaleLabel:p,availableLocales:N,currentVersion:c,currentVersionLabel:v,availableVersions:C,config:t}}var qt,W=y(()=>{"use strict";i();qt=require("react-router-dom");pe();mt();$e()});function m(...e){return(0,Qt.twMerge)((0,Zt.clsx)(e))}var Zt,Qt,I=y(()=>{"use strict";i();Zt=require("clsx"),Qt=require("tailwind-merge")});var de,Jt,ke,Yt,pt,ut,eo,dt=y(()=>{"use strict";i();de=require("react-aria-components"),Jt=require("lucide-react");I();ke=require("react/jsx-runtime"),Yt=({children:e,className:t,...o})=>(0,ke.jsx)(de.Breadcrumbs,{className:m("flex items-center gap-1.5 pl-0! mb-0 text-sm text-text-muted",t),...o,children:e}),pt=({children:e,className:t,...o})=>(0,ke.jsx)(de.Breadcrumb,{className:m("flex items-center mb-0 gap-1.5",t),...o,children:e}),ut=({children:e,href:t,className:o,...r})=>(0,ke.jsx)(de.Link,{href:t,className:m("transition-colors outline-none hover:text-text-main focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm","current:font-medium current:text-text-main current:pointer-events-none cursor-pointer",o),...r,children:e}),eo=({className:e})=>(0,ke.jsx)(Jt.ChevronRight,{size:14,className:m("shrink-0 text-text-dim",e)})});function Ge(e){let{size:t=20,...o}=e;return{...o,width:t,height:t}}var D,_e,ro,no,so,ft=y(()=>{"use strict";i();D=require("react/jsx-runtime");_e=e=>(0,D.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...Ge(e),children:[(0,D.jsx)("title",{children:"GitHub"}),(0,D.jsx)("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]}),ro=e=>(0,D.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...Ge(e),children:[(0,D.jsx)("title",{children:"Discord"}),(0,D.jsx)("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418Z"})]}),no=e=>(0,D.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...Ge(e),children:[(0,D.jsx)("title",{children:"X"}),(0,D.jsx)("path",{d:"M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"})]}),so=e=>(0,D.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...Ge(e),children:[(0,D.jsx)("title",{children:"Bluesky"}),(0,D.jsx)("path",{d:"M5.202 2.857C7.954 4.922 10.913 9.11 12 11.358c1.087-2.247 4.046-6.436 6.798-8.501C20.783 1.366 24 .213 24 3.883c0 .732-.42 6.156-.667 7.037-.856 3.061-3.978 3.842-6.755 3.37 4.854.826 6.089 3.562 3.422 6.299-5.065 5.196-7.28-1.304-7.847-2.97-.104-.305-.152-.448-.153-.327 0-.121-.05.022-.153.327-.568 1.666-2.782 8.166-7.847 2.97-2.667-2.737-1.432-5.473 3.422-6.3-2.777.473-5.899-.308-6.755-3.369C.42 10.04 0 4.615 0 3.883c0-3.67 3.217-2.517 5.202-1.026"})]})});var Fe,io,J,x,Rr,wr,Tr,Lr,kr,Sr,Ir,Br,Mr,Ar,Or,Er,Vr,Dr,Hr,O,We=y(()=>{"use strict";i();Fe=require("react");Ue();io=require("react-aria-components"),J=require("lucide-react");ft();x=require("react/jsx-runtime"),Rr=({children:e,className:t,...o})=>(0,x.jsx)("header",{className:m("boltdocs-navbar sticky top-0 z-50 w-full border-b border-border-subtle bg-bg-main/80 backdrop-blur-md",t),...o,children:e}),wr=({children:e,className:t})=>(0,x.jsx)("div",{className:m("mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6",t),children:e}),Tr=({children:e,className:t})=>(0,x.jsx)("div",{className:m("flex items-center gap-4",t),children:e}),Lr=({children:e,className:t})=>(0,x.jsx)("div",{className:m("flex items-center gap-2 md:gap-4",t),children:e}),kr=({children:e,className:t})=>(0,x.jsx)("div",{className:m("hidden lg:flex flex-1 justify-center items-center gap-4 px-4",t),children:e}),Sr=({src:e,alt:t,width:o=24,height:r=24,className:n})=>(0,x.jsx)(z,{href:"/",className:m("flex items-center gap-2 shrink-0 outline-none",n),children:e?(0,x.jsx)("img",{src:e,alt:t,width:o,height:r,className:"h-6 w-6 object-contain"}):null}),Ir=({children:e,className:t})=>(0,x.jsx)("span",{className:m("text-lg font-bold tracking-tight hidden sm:inline-block",t),children:e}),Br=({children:e,className:t})=>(0,x.jsx)("nav",{className:m("hidden md:flex items-center gap-6 text-sm font-medium",t),children:e}),Mr=({label:e,href:t,active:o,to:r,className:n})=>(0,x.jsxs)(z,{href:t,target:r==="external"?"_blank":void 0,className:m("transition-colors outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm",{"text-primary-500 font-bold":o,"text-text-muted hover:text-text-main font-medium":!o},n),children:[e,r==="external"&&(0,x.jsx)("span",{className:"ml-1 inline-block",children:(0,x.jsx)(J.ExternalLink,{size:12})})]}),Ar=({className:e,onPress:t})=>{let[o,r]=(0,Fe.useState)(!1),n=o&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return(0,Fe.useEffect)(()=>{r(!0)},[]),(0,x.jsxs)(io.Button,{onPress:t,className:m("flex items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-muted outline-none cursor-pointer","transition-colors hover:border-border-strong hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30","w-full max-w-[320px] justify-between",e),children:[(0,x.jsxs)("div",{className:"flex items-center gap-2",children:[(0,x.jsx)(J.Search,{size:16}),(0,x.jsx)("span",{className:"hidden sm:inline-block",children:"Search docs..."})]}),(0,x.jsxs)("div",{className:"hidden sm:flex items-center gap-1 pointer-events-none select-none",children:[(0,x.jsx)("kbd",{className:"flex h-5 items-center justify-center rounded border border-border-subtle bg-bg-main px-1.5 font-mono text-[10px] font-medium",children:n?"\u2318":"Ctrl"}),(0,x.jsx)("kbd",{className:"flex h-5 w-5 items-center justify-center rounded border border-border-subtle bg-bg-main font-mono text-[10px] font-medium",children:"K"})]})]})},Or=({className:e,theme:t,onThemeChange:o})=>(0,x.jsx)(he.ToggleButton,{isSelected:t==="dark",onChange:o,className:m("rounded-md p-2 text-text-muted outline-none cursor-pointer transition-colors","hover:bg-bg-surface hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30",e),"aria-label":"Toggle theme",children:t==="dark"?(0,x.jsx)(J.Sun,{size:20}):(0,x.jsx)(J.Moon,{size:20})}),Er=({label:e,className:t,onPress:o,isCurrent:r})=>(0,x.jsx)(U,{onAction:o,className:m(r&&"bg-primary-500 text-white font-medium hover:bg-primary-600 focus:bg-primary-600 focus:text-white",t),children:e}),Vr=({name:e})=>{if(e==="github")return(0,x.jsx)(_e,{});if(e==="discord")return(0,x.jsx)(ro,{});if(e==="x")return(0,x.jsx)(no,{});if(e==="bluesky")return(0,x.jsx)(so,{})},Dr=({icon:e,link:t,className:o})=>(0,x.jsx)(z,{href:t,target:"_blank",rel:"noopener noreferrer",className:m("rounded-md p-2 text-text-muted outline-none transition-colors","hover:bg-bg-surface hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30",o),children:(0,x.jsx)(Vr,{name:e})}),Hr=({className:e})=>(0,x.jsx)(he.Separator,{orientation:"vertical",className:m("h-6 w-px bg-border-subtle mx-1",e)}),O={NavbarRoot:Rr,NavbarLeft:Tr,NavbarRight:Lr,NavbarCenter:kr,NavbarLogo:Sr,Title:Ir,Links:Br,Link:Mr,SearchTrigger:Ar,Theme:Or,Item:Er,Socials:Dr,Split:Hr,Content:wr}});var Se,zr,gt,ao=y(()=>{"use strict";i();Se=V(require("react-aria-components")),zr=require("lucide-react");I();gt=require("react/jsx-runtime")});var B,se,P,ht,bt,xt,vt,Ct,yt,Nt,Pt,ms,Rt=y(()=>{"use strict";i();B=V(require("react-aria-components")),se=require("lucide-react");I();P=require("react/jsx-runtime"),ht=({children:e,isOpen:t,onOpenChange:o,className:r})=>(0,P.jsx)(B.ModalOverlay,{isOpen:t,onOpenChange:o,isDismissable:!0,className:m("fixed inset-0 z-100 bg-black/40 backdrop-blur-sm px-4 py-4 sm:py-20","entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out"),children:(0,P.jsx)(B.Modal,{className:m("mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl ring-1 ring-black/5 outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95",r),children:(0,P.jsx)(B.Dialog,{className:"flex flex-col max-h-[70vh] focus:outline-none",children:e})})}),bt=({children:e,className:t,onSelectionChange:o,...r})=>(0,P.jsx)("div",{className:t,children:(0,P.jsx)(B.Autocomplete,{...r,onSelectionChange:o,className:"flex flex-col min-h-0",children:e})}),xt=({className:e,...t})=>(0,P.jsxs)(B.SearchField,{className:"flex items-center gap-3 border-b border-border-subtle px-4 py-4",autoFocus:!0,children:[(0,P.jsx)(se.Search,{className:"h-5 w-5 text-text-muted"}),(0,P.jsx)(B.Input,{...t,className:m("w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none",e),placeholder:"Search documentation..."}),(0,P.jsx)("div",{className:"flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-main px-1.5 py-1 text-[10px] font-medium text-text-muted",children:(0,P.jsx)("kbd",{className:"font-sans",children:"ESC"})})]}),vt=({children:e,className:t,...o})=>(0,P.jsx)(B.ListBox,{...o,className:m("flex-1 overflow-y-auto p-2 outline-none",t),children:e}),Ct=({children:e,className:t,...o})=>(0,P.jsx)(B.ListBoxItem,{...o,className:m("group flex items-center gap-3 rounded-lg p-3 text-left outline-none cursor-pointer transition-colors","text-text-muted hover:bg-bg-main hover:text-text-main focus:bg-primary-500 focus:text-white selected:bg-primary-500 selected:text-white",t),children:r=>(0,P.jsxs)(P.Fragment,{children:[e,(r.isFocused||r.isSelected)&&(0,P.jsxs)("div",{className:"ml-auto opacity-50 flex items-center gap-1",children:[(0,P.jsx)("span",{className:"text-[10px]",children:"Select"}),(0,P.jsx)(se.CornerDownLeft,{size:10})]})]})}),yt=({isHeading:e,className:t})=>(0,P.jsx)("div",{className:m("shrink-0",t),children:e?(0,P.jsx)(se.Hash,{size:18}):(0,P.jsx)(se.FileText,{size:18})}),Nt=({children:e,className:t})=>(0,P.jsx)("span",{className:m("block font-medium truncate flex-1 text-sm",t),children:e}),Pt=({children:e,className:t})=>(0,P.jsx)("span",{className:m("ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100",t),children:e}),ms={Root:ht,Autocomplete:bt,Input:xt,List:vt,Item:Object.assign(Ct,{Icon:yt,Title:Nt,Bio:Pt})}});function lo(e,t){let o=(0,je.useRef)(e);(0,je.useEffect)(()=>{o.current!==e&&(t(e),o.current=e)},[e,t])}var je,co=y(()=>{"use strict";i();je=require("react")});function wt(e){return e.startsWith("#")?e.slice(1):null}var mo=y(()=>{"use strict";i()});function $r(){let e=(0,R.use)(Lt);if(!e)throw new Error("Component must be used under the <AnchorProvider /> component.");return e}function Gr(e){let[t,o]=(0,R.useState)({isOverflowing:!1,isAtBottom:!1});return(0,R.useEffect)(()=>{let r=e.current;if(!r)return;let n=()=>{let a=r.scrollHeight>r.clientHeight,l=r.scrollHeight-r.scrollTop<=r.clientHeight+2;o({isOverflowing:a,isAtBottom:l})};n(),r.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n);let s=new MutationObserver(n);return s.observe(r,{childList:!0,subtree:!0}),()=>{r.removeEventListener("scroll",n),window.removeEventListener("resize",n),s.disconnect()}},[e]),t}function fo(){let e=$r();return(0,R.useMemo)(()=>{let t;for(let o of e)o.active&&(!t||o.t>t.t)&&(t=o);return t?.id},[e])}function go({containerRef:e,children:t}){return(0,j.jsx)(uo.Provider,{value:e,children:t})}function ho({toc:e,single:t=!1,children:o}){let r=(0,R.useMemo)(()=>new Tt,[]),[n,s]=(0,R.useState)(r.items);return r.single=t,(0,R.useEffect)(()=>{r.setItems(e)},[r,e]),(0,R.useEffect)(()=>(r.watch({rootMargin:"0px",threshold:.98}),r.onChange=()=>s([...r.items]),()=>{r.unwatch()}),[r]),(0,j.jsx)(Lt.Provider,{value:n,children:o})}var R,po,j,Lt,uo,Tt,_r,Fr,bo,Wr,Ur,jr,Kr,le,kt=y(()=>{"use strict";i();R=require("react"),po=V(require("scroll-into-view-if-needed"));I();co();mo();j=require("react/jsx-runtime"),Lt=(0,R.createContext)(null),uo=(0,R.createContext)(null),Tt=class{items=[];single=!1;observer=null;onChange;callback(t){if(t.length===0)return;let o=!1;if(this.items=this.items.map(r=>{let n=t.find(a=>a.target.id===r.id),s=n?n.isIntersecting:r.active&&!r.fallback;return this.single&&o&&(s=!1),r.active!==s&&(r={...r,t:Date.now(),active:s,fallback:!1}),s&&(o=!0),r}),!o&&t[0].rootBounds){let r=t[0].rootBounds.top,n=Number.MAX_VALUE,s=-1;for(let a=0;a<this.items.length;a++){let l=document.getElementById(this.items[a].id);if(!l)continue;let c=Math.abs(r-l.getBoundingClientRect().top);c<n&&(s=a,n=c)}s!==-1&&(this.items[s]={...this.items[s],active:!0,fallback:!0,t:Date.now()})}this.onChange?.()}setItems(t){let o=this.observer;if(o)for(let r of this.items){let n=document.getElementById(r.id);n&&o.unobserve(n)}this.items=[];for(let r of t){let n=wt(r.url);n&&this.items.push({id:n,active:!1,fallback:!1,t:0,original:r})}this.watchItems(),typeof window<"u"&&(setTimeout(()=>this.watchItems(),100),setTimeout(()=>this.watchItems(),500),setTimeout(()=>this.watchItems(),1e3)),this.onChange?.()}watch(t){this.observer||(this.observer=new IntersectionObserver(this.callback.bind(this),t),this.watchItems())}watchItems(){if(this.observer)for(let t of this.items){let o=document.getElementById(t.id);o&&this.observer.observe(o)}}unwatch(){this.observer?.disconnect(),this.observer=null}};_r=({children:e,className:t})=>(0,j.jsx)("nav",{className:m("sticky top-navbar hidden xl:flex flex-col shrink-0","w-toc","py-8 pl-6 pr-4",t),children:e}),Fr=({children:e,className:t,...o})=>(0,j.jsx)("div",{className:m("mb-4 text-xs font-bold uppercase tracking-wider text-text-main",t),...o,children:e}),bo=({children:e,className:t,ref:o,...r})=>{let n=(0,R.useRef)(null);(0,R.useImperativeHandle)(o,()=>n.current);let{isOverflowing:s,isAtBottom:a}=Gr(n);return(0,j.jsx)("div",{ref:n,className:m("relative overflow-y-auto boltdocs-otp-content",s&&!a&&"mask-[linear-gradient(to_bottom,black_85%,transparent_100%)]",t),...r,children:e})};bo.displayName="OnThisPageContent";Wr=({children:e,className:t})=>(0,j.jsx)("ul",{className:m("relative space-y-1 text-sm border-l border-border-subtle",t),children:e}),Ur=({level:e,children:t,className:o})=>(0,j.jsx)("li",{className:m(e===3&&"pl-3",o),children:t}),jr=({children:e,href:t,active:o,onClick:r,className:n})=>{let s=(0,R.use)(Lt),a=(0,R.use)(uo),l=t?wt(t):null,c=(0,R.useRef)(null),[f,d]=(0,R.useState)(o);return lo(l&&s?s.find(p=>p.id===l)?.active:null,p=>{p!==null&&p!==f&&(d(!!p),p&&c.current&&a?.current&&(0,po.default)(c.current,{behavior:"smooth",block:"center",inline:"center",scrollMode:"if-needed",boundary:a.current}))}),(0,R.useEffect)(()=>{o!==void 0&&d(o)},[o]),(0,j.jsx)("a",{ref:c,href:t,onClick:r,"data-active":f,className:m("block py-1 pl-4 text-[13px] outline-none transition-colors hover:text-text-main",f?"text-primary-500 font-medium":"text-text-muted",n),children:e})},Kr=({style:e,className:t})=>(0,j.jsx)("div",{className:m("absolute -left-px w-0.5 rounded-full bg-primary-500 transition-all duration-300",t),style:e}),le={OnThisPageRoot:_r,OnThisPageHeader:Fr,OnThisPageContent:bo,OnThisPageList:Wr,OnThisPageItem:Ur,OnThisPageLink:jr,OnThisPageIndicator:Kr}});var xo,Ke,$,qr,Xr,Zr,Qr,Jr,ie,St=y(()=>{"use strict";i();xo=V(require("react-aria-components")),Ke=require("lucide-react");I();$=require("react/jsx-runtime"),qr=({children:e,className:t})=>(0,$.jsx)("nav",{className:m("grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle",t),children:e}),Xr=({children:e,to:t,direction:o,className:r})=>{let n=o==="next";return(0,$.jsxs)(xo.Link,{href:t,className:m("flex group items-center p-4 rounded-xl border border-border-subtle bg-bg-surface outline-none","transition-all hover:bg-bg-main hover:border-primary-500 hover:shadow-lg","focus-visible:ring-2 focus-visible:ring-primary-500/30",n?"text-right justify-end":"text-left justify-start",r),children:[!n&&(0,$.jsx)(Ke.ChevronLeft,{className:"mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1"}),(0,$.jsx)("div",{className:"flex flex-col gap-1 flex-1",children:e}),n&&(0,$.jsx)(Ke.ChevronRight,{className:"ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1"})]})},Zr=({children:e,className:t})=>(0,$.jsx)("span",{className:m("text-xs font-medium uppercase tracking-wider text-text-muted",t),children:e}),Qr=({children:e,className:t})=>(0,$.jsx)("span",{className:m("text-base font-bold text-text-main truncate",t),children:e}),Jr=({children:e})=>(0,$.jsx)($.Fragment,{children:e}),ie={PageNavRoot:qr,PageNavLink:Object.assign(Xr,{Title:Zr,Description:Qr,Icon:Jr})}});var be,Yr,en,tn,on,rn,It,Bt=y(()=>{"use strict";i();I();be=require("react/jsx-runtime"),Yr=({children:e,className:t="",...o})=>(0,be.jsx)("div",{className:m("w-full",t),...o,children:e}),en=({children:e,className:t=""})=>(0,be.jsx)("div",{role:"tablist",className:m("relative flex flex-row items-center border-b border-border-subtle",t),children:e}),tn=({children:e,id:t,selected:o,className:r="",...n})=>(0,be.jsx)("button",{role:"tab","aria-selected":o,className:m("flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors outline-none cursor-pointer bg-transparent border-none",o?"text-primary-500":"text-text-muted hover:text-text-main",r),...n,children:e}),on=({children:e,className:t=""})=>(0,be.jsx)("div",{className:m("p-4 outline-none",t),children:e}),rn=({className:e="",style:t})=>(0,be.jsx)("div",{className:m("absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300",e),style:t}),It={TabsRoot:Yr,TabsList:en,TabsItem:tn,TabsContent:on,TabsIndicator:rn}});function Ie(e){let t=F(),{currentLocale:o,currentVersion:r}=k();if(!t||typeof e!="string"||e.startsWith("http")||e.startsWith("//"))return e;let n=t.i18n,s=t.versions;if(!n&&!s)return e;let a=e.startsWith("/docs"),l=e.split("/").filter(Boolean),c=0;l[c]==="docs"&&c++,s&&l.length>c&&s.versions.find(v=>v.path===l[c])&&c++,n&&l.length>c&&n.locales[l[c]]&&c++;let f=l.slice(c),d=[];a&&(d.push("docs"),s&&r&&d.push(r)),n&&o&&o!==n.defaultLocale&&d.push(o),d.push(...f);let p=`/${d.join("/")}`;return p.length>1&&p.endsWith("/")?p.slice(0,-1):p||"/"}var Mt=y(()=>{"use strict";i();pe();W()});var At,vo,Co,Ot,z,nn,Be=y(()=>{"use strict";i();At=V(require("react")),vo=require("react-aria-components"),Co=require("react-router-dom");Mt();mt();I();Ot=require("react/jsx-runtime"),z=At.default.forwardRef((e,t)=>{let{href:o,prefetch:r="hover",onMouseEnter:n,onFocus:s,...a}=e,l=Ie(o??""),{preload:c}=He();return(0,Ot.jsx)(vo.Link,{...a,ref:t,href:l,onMouseEnter:p=>{n?.(p),r==="hover"&&typeof l=="string"&&l.startsWith("/")&&c(l)},onFocus:p=>{s?.(p),r==="hover"&&typeof l=="string"&&l.startsWith("/")&&c(l)}})});z.displayName="Link";nn=At.default.forwardRef((e,t)=>{let{href:o,end:r=!1,className:n,children:s,...a}=e,l=(0,Co.useLocation)(),c=Ie(o??""),f=r?l.pathname===c:l.pathname.startsWith(c),d=typeof n=="function"?n({isActive:f}):m(n,f&&"active"),p=typeof s=="function"?s({isActive:f}):s;return(0,Ot.jsx)(z,{...a,ref:t,href:o,className:d,children:p})});nn.displayName="NavLink"});var yo,No,M,sn,an,ln,cn,mn,xe,Et=y(()=>{"use strict";i();Be();yo=V(require("react-aria-components")),No=require("lucide-react");I();M=require("react/jsx-runtime"),sn=({badge:e})=>{let t={new:"bg-primary-500/20 text-primary-500",updated:"bg-gray-500/20 text-gray-500",deprecated:"bg-red-500/20 text-red-500"};if(typeof e=="object"&&e?.expires){let r=new Date(e.expires),n=new Date,s=r.getTime()-n.getTime();if(Math.ceil(s/(1e3*60*60*24))===0)return null}let o=typeof e=="string"?e:e?.text;return(0,M.jsx)("span",{className:m("ml-auto flex h-4.5 items-center rounded-full text-[9px] font-medium px-1.5 py-0.5 text-center whitespace-nowrap",t[o]||t.new),children:o})},an=({children:e,className:t})=>(0,M.jsx)("aside",{className:m("boltdocs-sidebar sticky top-navbar hidden lg:flex flex-col shrink-0","w-sidebar h-full","overflow-y-auto border-r border-border-subtle bg-bg-main","py-6 px-4",t),children:(0,M.jsx)("nav",{className:"flex-1 space-y-6",children:e})}),ln=({children:e,title:t,icon:o,isOpen:r=!0,onToggle:n,className:s})=>(0,M.jsxs)("div",{className:m("space-y-1",s),children:[t&&(0,M.jsxs)(yo.Button,{onPress:n,className:m("flex w-full items-center justify-between px-2 py-1.5 text-xs font-bold uppercase tracking-wider outline-none cursor-pointer","text-text-muted hover:text-text-main transition-colors","focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md"),children:[(0,M.jsxs)("div",{className:"flex items-center gap-2",children:[o&&(0,M.jsx)(o,{size:14}),t]}),(0,M.jsx)(No.ChevronRight,{size:14,className:m("transition-transform duration-200",r&&"rotate-90")})]}),r&&(0,M.jsx)("div",{className:"space-y-0.5",children:e})]}),cn=({children:e,className:t})=>(0,M.jsx)("div",{className:m(t),children:e}),mn=({label:e,href:t,active:o,icon:r,badge:n,className:s})=>(0,M.jsxs)(z,{href:t,className:m("group flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-primary-500/30",o?"bg-primary-500/10 text-primary-500 font-medium":"text-text-muted hover:bg-bg-surface hover:text-text-main",s),children:[r&&(0,M.jsx)(r,{size:16,className:m(o?"text-primary-500":"text-text-muted group-hover:text-text-main")}),(0,M.jsx)("span",{className:"truncate",children:e}),n&&(0,M.jsx)(sn,{badge:n})]}),xe={SidebarRoot:an,SidebarGroup:ln,SidebarGroupItem:cn,SidebarLink:mn}});var qe,Ro,G,Po,Y,Vt=y(()=>{"use strict";i();qe=V(require("react-aria-components"));I();Ro=require("class-variance-authority"),G=require("react/jsx-runtime"),Po=(0,Ro.cva)("flex flex-row items-center justify-center w-auto font-semibold tracking-tight no-underline whitespace-nowrap select-none outline-none transition-all duration-200 cursor-pointer pressed:scale-[0.97] hover:-translate-y-px leading-none",{variants:{variant:{primary:"bg-primary-500 text-white shadow-md hover:brightness-110 hover:shadow-lg",secondary:"bg-bg-surface text-text-main border border-border-subtle hover:bg-bg-muted hover:border-border-strong",outline:"bg-transparent text-text-main border border-border-strong hover:bg-bg-surface hover:border-primary-500",ghost:"bg-transparent text-text-muted hover:bg-bg-surface hover:text-text-main",danger:"bg-[var(--color-danger-500)]/10 text-[var(--color-danger-500)] border border-[var(--color-danger-500)]/20 hover:bg-[var(--color-danger-500)]/15",success:"bg-[var(--color-success-500)]/10 text-[var(--color-success-500)] border border-[var(--color-success-500)]/20 hover:bg-[var(--color-success-500)]/15",warning:"bg-[var(--color-warning-500)]/10 text-[var(--color-warning-500)] border border-[var(--color-warning-500)]/20 hover:bg-[var(--color-warning-500)]/15",info:"bg-[var(--color-info-500)]/10 text-[var(--color-info-500)] border border-[var(--color-info-500)]/20 hover:bg-[var(--color-info-500)]/15",subtle:"bg-primary-500/10 text-primary-500 hover:bg-primary-500/20",link:"bg-transparent text-primary-500 !p-0 !min-h-0 hover:underline"},size:{sm:"min-h-8 px-3.5 text-[0.8125rem] gap-1.5",md:"min-h-10 px-5 text-[0.9375rem] gap-2",lg:"min-h-12 px-7 text-[1.05rem] gap-2.5"},rounded:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},iconSize:{sm:"w-8 h-8 p-0",md:"w-10 h-10 p-0",lg:"w-12 h-12 p-0"},disabled:{true:"opacity-50 cursor-not-allowed pointer-events-none",false:null}},defaultVariants:{variant:"primary",size:"md",rounded:"md"}}),Y=({href:e,icon:t,iconPosition:o="left",isIconOnly:r,children:n,className:s,variant:a,size:l,rounded:c,iconSize:f,disabled:d,...p})=>{let u=r||!n&&!!t,v=u?(0,G.jsx)("span",{className:"inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]",children:t}):(0,G.jsxs)(G.Fragment,{children:[t&&o==="left"&&(0,G.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t}),(0,G.jsx)("span",{className:"flex items-center",children:n}),t&&o==="right"&&(0,G.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t})]});return e?(0,G.jsx)(qe.Link,{href:e,className:m(Po({variant:a,size:l,rounded:c,iconSize:u?f:void 0,disabled:d}),s),...p,children:v}):(0,G.jsx)(qe.Button,{className:m(Po({variant:a,size:l,rounded:c,iconSize:u?f:void 0,disabled:d}),s),...p,children:v})}});var To,wo,Lo=y(()=>{"use strict";i();I();To=require("react/jsx-runtime"),wo=({children:e,className:t,vertical:o=!1})=>(0,To.jsx)("div",{className:m("inline-flex",o?"flex-col":"flex-row",!o&&["[&>*:not(:first-child)]:-ml-px","[&>*:first-child]:rounded-r-none","[&>*:last-child]:rounded-l-none","[&>*:not(:first-child):not(:last-child)]:rounded-none",t?.includes("rounded-full")&&["[&>*:first-child]:rounded-l-full","[&>*:last-child]:rounded-r-full"],t?.includes("rounded-xl")&&["[&>*:first-child]:rounded-l-xl","[&>*:last-child]:rounded-r-xl"],t?.includes("rounded-lg")&&["[&>*:first-child]:rounded-l-lg","[&>*:last-child]:rounded-r-lg"]],o&&["[&>*:not(:first-child)]:-mt-px","[&>*:first-child]:rounded-b-none","[&>*:last-child]:rounded-t-none","[&>*:not(:first-child):not(:last-child)]:rounded-none",t?.includes("rounded-full")&&["[&>*:first-child]:rounded-t-full","[&>*:last-child]:rounded-b-full"]],t),children:e})});var Ce,ve,Dt,Ht=y(()=>{"use strict";"use client";i();Ce=V(require("react-aria-components"));I();ve=require("react/jsx-runtime"),Dt=({children:e,className:t,showArrow:o,...r})=>(0,ve.jsxs)(Ce.Popover,{offset:8,...r,className:Ce.composeRenderProps(t,n=>m("z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95 fill-mode-forwards",n)),children:[o&&(0,ve.jsx)(Ce.OverlayArrow,{className:"group",children:(0,ve.jsx)("svg",{viewBox:"0 0 12 12",className:"block h-3 w-3 fill-bg-surface/80 stroke-border-subtle group-placement-bottom:rotate-180 group-placement-left:-rotate-90 group-placement-right:rotate-90","aria-hidden":"true",children:(0,ve.jsx)("path",{d:"M0 0 L6 6 L12 0"})})}),e]})});function fe(e){let[t,o]=zt.default.Children.toArray(e.children).slice(0,2);return(0,T.jsxs)(L.MenuTrigger,{...e,children:[t,(0,T.jsx)(Dt,{placement:e.placement,className:"min-w-[200px]",children:o})]})}function pn(e){let[t,o]=zt.default.Children.toArray(e.children).slice(0,2);return(0,T.jsxs)(L.SubmenuTrigger,{...e,children:[t,(0,T.jsx)(Dt,{offset:-4,crossOffset:-4,children:o})]})}function ge(e){return(0,T.jsx)(L.Menu,{...e,className:L.composeRenderProps(e.className,t=>m("p-1.5 outline-none max-h-[inherit] overflow-auto",t))})}function U(e){let t=e.textValue||(typeof e.children=="string"?e.children:void 0);return(0,T.jsx)(L.MenuItem,{...e,textValue:t,className:L.composeRenderProps(e.className,(o,{isFocused:r,isPressed:n,isDisabled:s})=>m("group relative flex flex-row items-center gap-2.5 px-3 py-1.5 rounded-lg outline-none cursor-default transition-all duration-200","text-text-main text-[0.8125rem]",r&&"bg-primary-500/10 text-primary-600 shadow-sm",n&&"scale-[0.98] bg-primary-500/15",s&&"opacity-40 grayscale pointer-events-none",o)),children:L.composeRenderProps(e.children,(o,{selectionMode:r,isSelected:n,hasSubmenu:s})=>(0,T.jsxs)(T.Fragment,{children:[r!=="none"&&(0,T.jsxs)("span",{className:"flex items-center w-4 h-4 shrink-0 justify-center",children:[n&&r==="multiple"&&(0,T.jsx)(ye.Check,{className:"w-3.5 h-3.5 stroke-[2.5px] text-primary-500 animate-in zoom-in-50 duration-200"}),n&&r==="single"&&(0,T.jsx)(ye.Dot,{className:"w-6 h-6 text-primary-500 animate-in zoom-in-50 duration-200"})]}),(0,T.jsx)("div",{className:"flex-1 flex flex-row items-center gap-2.5 truncate font-medium",children:o}),s&&(0,T.jsx)(ye.ChevronRight,{className:"w-4 h-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors"})]}))})}function un({title:e,...t}){return(0,T.jsxs)(L.MenuSection,{...t,className:m("flex flex-col gap-0.5",t.className),children:[e&&(0,T.jsx)(L.Header,{className:"px-3 py-2 text-[10px] font-bold uppercase tracking-[0.075em] text-text-muted/50 select-none",children:e}),(0,T.jsx)(L.Collection,{items:t.items,children:t.children})]})}function dn(e){return(0,T.jsx)(L.Separator,{...e,className:"mx-2 my-1.5 border-t border-border-subtle/50"})}var ye,zt,L,T,ee,Xe=y(()=>{"use strict";"use client";i();ye=require("lucide-react"),zt=V(require("react")),L=V(require("react-aria-components"));Ht();I();T=require("react/jsx-runtime");ee={Root:ge,Item:U,Trigger:fe,SubTrigger:pn,Section:un,Separator:dn}});var $t,Gt,ko=y(()=>{"use strict";i();$t=V(require("react-aria-components"));I();Gt=require("react/jsx-runtime")});var he,Ue=y(()=>{"use strict";i();We();ao();Rt();kt();St();Bt();Et();dt();Vt();Lo();Xe();Ht();ko();Be();he=require("react-aria-components");I()});function jo(e){let{currentLocale:t,currentVersion:o}=k(),[r,n]=(0,Ae.useState)(!1),[s,a]=(0,Ae.useState)(""),l=(0,Ae.useMemo)(()=>{let c=e.filter(u=>{let v=!t||u.locale===t,N=!o||u.version===o;return v&&N});if(!s)return c.slice(0,10).map(u=>({id:u.path,title:u.title,path:u.path,bio:u.description||"",groupTitle:u.groupTitle}));let f=[],d=s.toLowerCase();for(let u of c)if(u.title?.toLowerCase().includes(d)&&f.push({id:u.path,title:u.title,path:u.path,bio:u.description||"",groupTitle:u.groupTitle}),u.headings)for(let v of u.headings)v.text.toLowerCase().includes(d)&&f.push({id:`${u.path}#${v.id}`,title:v.text,path:`${u.path}#${v.id}`,bio:`Heading in ${u.title}`,groupTitle:u.title,isHeading:!0});let p=new Set;return f.filter(u=>p.has(u.path)?!1:(p.add(u.path),!0)).slice(0,10)},[e,s,t,o]);return{isOpen:r,setIsOpen:n,query:s,setQuery:a,list:l,input:{value:s,onChange:c=>a(c.target.value)}}}var Ae,Ko=y(()=>{"use strict";i();Ae=require("react");W()});var Xo={};Ut(Xo,{SearchDialog:()=>_t});function _t({routes:e}){let{isOpen:t,setIsOpen:o,query:r,setQuery:n,list:s}=jo(e),a=(0,qo.useNavigate)();(0,nt.useEffect)(()=>{let c=f=>{(/Mac/.test(navigator.userAgent)?f.metaKey:f.ctrlKey)&&(f.key==="k"||f.key==="j")&&(f.preventDefault(),o(u=>!u))};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[o]);let l=(0,nt.useCallback)(c=>{let f=String(c);if(o(!1),f.includes("#")){let[d,p]=f.split("#");a(d),setTimeout(()=>{let u=document.getElementById(p);u&&u.scrollIntoView({behavior:"smooth"})},100)}else a(f)},[a,o]);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(O.SearchTrigger,{onPress:()=>o(!0)}),(0,E.jsx)(ht,{isOpen:t,onOpenChange:o,children:(0,E.jsxs)(bt,{onSelectionChange:l,children:[(0,E.jsx)(xt,{value:r,onChange:c=>n(c.target.value)}),(0,E.jsx)(vt,{items:s,children:c=>(0,E.jsxs)(Ct,{onPress:()=>l(c.id),textValue:c.title,children:[(0,E.jsx)(yt,{isHeading:c.isHeading}),(0,E.jsxs)("div",{className:"flex flex-col justify-center gap-0.5",children:[(0,E.jsx)(Nt,{children:c.title}),(0,E.jsx)(Pt,{children:c.groupTitle})]})]},c.id)})]})})]})}var nt,qo,E,Ft=y(()=>{"use strict";i();nt=require("react");Ko();Rt();We();qo=require("react-router-dom"),E=require("react/jsx-runtime")});var Ln={};Ut(Ln,{Breadcrumbs:()=>oo,CopyMarkdown:()=>Io,ErrorBoundary:()=>Ze,GithubStars:()=>Je,Head:()=>Eo,Loading:()=>Vo,Navbar:()=>Qo,NotFound:()=>Yo,OnThisPage:()=>or,PageNav:()=>nr,PoweredBy:()=>it,ProgressBar:()=>ar,SearchDialog:()=>_t,Sidebar:()=>pr,Tabs:()=>rt,ThemeToggle:()=>ot});module.exports=vr(Ln);i();i();i();W();function Xt(){let{currentRoute:e}=k(),t=[];return e&&(e.groupTitle&&t.push({label:e.groupTitle}),t.push({label:e.title,href:e.path})),{crumbs:t,activeRoute:e}}var to=require("lucide-react");dt();I();pe();var Q=require("react/jsx-runtime");function oo(){let{crumbs:e,activeRoute:t}=Xt(),r=F().theme||{};return e.length===0||!r?.breadcrumbs?null:(0,Q.jsxs)(Yt,{children:[(0,Q.jsx)(pt,{children:(0,Q.jsx)(ut,{href:"/",children:(0,Q.jsx)(to.Home,{size:14})})}),e.map((n,s)=>(0,Q.jsxs)(pt,{children:[(0,Q.jsx)(eo,{}),(0,Q.jsx)(ut,{href:n.href,className:m({"font-medium text-text-main":n.href===t?.path}),children:n.label})]},`crumb-${n.href}-${n.label}-${s}`))]})}i();var So=require("react"),te=require("lucide-react");Ue();var S=require("react/jsx-runtime"),fn=e=>{let[t,o]=(0,So.useState)(!1);return{copied:t,handleCopy:()=>{navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)},handleOpenRaw:()=>{let s=new Blob([e],{type:"text/plain;charset=utf-8"}),a=URL.createObjectURL(s);window.open(a,"_blank")}}};function Io({content:e,mdxRaw:t,config:o}){let r=t||e||"",{copied:n,handleCopy:s,handleOpenRaw:a}=fn(r),l=o!==!1,c=typeof o=="object"&&o.text||"Copy Markdown";return!l||!r?null:(0,S.jsx)("div",{className:"relative inline-flex z-100 flex-shrink-0 w-max translate-y-0 active:translate-y-px transition-transform duration-200",children:(0,S.jsxs)(wo,{className:"rounded-xl border border-border-subtle bg-bg-surface/40 backdrop-blur-md transition-all duration-300 hover:border-primary-500/50 hover:shadow-lg hover:shadow-primary-500/5 group overflow-hidden",children:[(0,S.jsx)(Y,{variant:"ghost",onPress:s,icon:n?(0,S.jsx)(te.Check,{size:16}):(0,S.jsx)(te.Copy,{size:16}),iconPosition:"left",className:m("px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 border-none shrink-0","text-text-main transition-all duration-300 hover:bg-primary-500/5",n&&"text-emerald-500 hover:bg-emerald-500/5"),children:n?"Copied!":c}),(0,S.jsxs)(fe,{placement:"bottom end",children:[(0,S.jsx)(Y,{variant:"ghost",isIconOnly:!0,icon:(0,S.jsx)(te.ChevronDown,{size:14}),className:m("px-3.5 h-9 border-l border-border-subtle/50 text-text-muted rounded-none bg-transparent shrink-0","transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500")}),(0,S.jsxs)(ge,{className:"w-52",children:[(0,S.jsxs)(U,{onAction:s,className:"flex flex-row items-start gap-2.5 group",children:[(0,S.jsx)(te.Copy,{size:16,className:"w-4 h-4 shrink-0 mt-0.5 transition-transform duration-200 group-hover:-translate-y-0.5 text-text-muted group-hover:text-primary-500"}),(0,S.jsx)("span",{className:"font-medium text-[0.8125rem]",children:"Copy Markdown"})]}),(0,S.jsxs)(U,{onAction:a,className:"flex flex-row items-start gap-2.5 group",children:[(0,S.jsx)(te.ExternalLink,{size:16,className:"w-4 h-4 shrink-0 mt-0.5 transition-transform duration-200 group-hover:-translate-y-0.5 text-text-muted group-hover:text-primary-500"}),(0,S.jsx)("span",{className:"font-medium text-[0.8125rem]",children:"View as Markdown"})]})]})]})]})})}i();var Bo=require("react");Ue();var Ne=require("react/jsx-runtime"),Ze=class extends Bo.Component{state={hasError:!1};static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,o){console.error("Uncaught error in Boltdocs Layout:",t,o)}render(){return this.state.hasError?this.props.fallback||(0,Ne.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-[40vh] text-center gap-4 px-4",children:[(0,Ne.jsx)("div",{className:"text-lg font-bold text-red-400",children:"Something went wrong"}),(0,Ne.jsx)("p",{className:"text-sm text-text-muted max-w-md",children:this.state.error?.message||"An unexpected error occurred while rendering this page."}),(0,Ne.jsx)(Y,{className:"rounded-lg border border-border-subtle bg-bg-surface px-5 py-2 text-sm font-medium text-text-main transition-colors hover:bg-bg-muted cursor-pointer",onPress:()=>this.setState({hasError:!1}),children:"Try again"})]}):this.props.children}};i();var Qe=require("react");i();var gn="https://api.github.com";async function Mo(e,t,o=gn){let r=new Headers;t&&r.append("authorization",t);let s=await(await fetch(`${o}/repos/${e}`,{headers:r})).json();return s.stargazers_count!==void 0?hn(s.stargazers_count):"0"}var hn=e=>Intl.NumberFormat("en",{notation:"compact",compactDisplay:"short"}).format(e);ft();var Me=require("react/jsx-runtime");function Je({repo:e}){let[t,o]=(0,Qe.useState)(null);return(0,Qe.useEffect)(()=>{e&&Mo(e).then(r=>o(r)).catch(()=>o("0"))},[e]),(0,Me.jsxs)("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-md border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-xs font-medium text-text-muted transition-all hover:bg-bg-main hover:border-border-strong hover:text-text-main",children:[(0,Me.jsx)(_e,{className:"h-4 w-4"}),t&&(0,Me.jsx)("span",{className:"tabular-nums",children:t})]})}i();var Ao=require("react"),Oo=require("react-router-dom");function Eo({siteTitle:e,siteDescription:t,routes:o}){let r=(0,Oo.useLocation)();return(0,Ao.useEffect)(()=>{let n=o.find(f=>f.path===r.pathname),s=n?.title,a=n?.description||t||"";document.title=s?`${s} | ${e}`:e;let l=document.querySelector('meta[name="description"]');l||(l=document.createElement("meta"),l.name="description",document.head.appendChild(l)),l.content=a,ce("property","og:title",document.title),ce("property","og:description",a),ce("property","og:type","article"),ce("property","og:url",window.location.href),ce("name","twitter:card","summary"),ce("name","twitter:title",document.title),ce("name","twitter:description",a);let c=document.querySelector('link[rel="canonical"]');c||(c=document.createElement("link"),c.rel="canonical",document.head.appendChild(c)),c.href=window.location.origin+r.pathname},[r.pathname,e,t,o]),null}function ce(e,t,o){let r=document.querySelector(`meta[${e}="${t}"]`);r||(r=document.createElement("meta"),r.setAttribute(e,t),document.head.appendChild(r)),r.content=o}i();var Ye=require("react"),H=require("react/jsx-runtime");function Vo(){let[e,t]=(0,Ye.useState)(0);(0,Ye.useEffect)(()=>{let r=0,n=!0,s=setInterval(()=>{n?(r+=1,r>=100&&(r=100,n=!1)):(r-=1,r<=0&&(r=0,n=!0)),t(r)},20);return()=>clearInterval(s)},[]);let o=`inset(${100-e}% 0 0 0)`;return(0,H.jsx)("div",{className:"flex flex-col items-center justify-center min-h-[60vh] p-4 text-center",children:(0,H.jsx)("div",{className:"relative group",children:(0,H.jsxs)("div",{className:"relative inline-block",children:[(0,H.jsxs)("svg",{className:"w-24 h-auto opacity-10 filter grayscale brightness-50",viewBox:"0 0 60 51",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true",children:[(0,H.jsx)("title",{children:"Loading indicator background"}),(0,H.jsx)("path",{d:"M29.4449 0H19.4449V16.5L29.4449 6.5V0Z",fill:"currentColor"}),(0,H.jsx)("path",{d:"M26.9449 22.7265C26.9449 22.5077 21.2201 27.0658 16.9449 28.5C13.7491 29.5721 12.3156 29.5038 8.94486 29.5C5.59532 29.4963 0 28.5 0 28.5C0 28.5 5.57953 28.5146 8.94486 27.5C12.5409 26.4158 14.8203 25.5843 17.9449 23.5C23.3445 19.898 29.4449 11.5 29.4449 11.5L29.9449 18C29.9449 18 33.5825 15.8308 36.4449 15C39.4452 14.1291 44.4449 14 44.4449 14C44.4449 14 36.9449 19 34.4449 21.5C31.5322 24.4126 29.8582 26.9017 29.4449 31C29.1217 34.2041 29.4771 36.4508 31.4449 39C33.5792 41.765 35.952 43.0183 39.4449 43C42.677 42.9831 45.3003 42.4182 47.4449 40C49.7406 37.4113 50.2495 34.4466 49.9449 31C49.6603 27.7804 48.4876 25.4953 45.9449 23.5C43.2931 21.4191 36.4449 24 36.4449 24L47.9449 15C47.9449 15 51.5761 16.771 53.4449 18.5C55.711 20.5967 56.7467 22.1546 57.9449 25C59.1784 27.9295 59.4832 29.8216 59.4449 33C59.4089 35.9867 59.179 37.78 57.9449 40.5C56.8475 42.9185 55.8511 44.6507 53.9449 46.5C51.9236 48.4609 50.5803 49.0076 47.9449 50C45.5414 50.9051 44.0131 51 41.4449 51C38.8766 51 37.3235 50.9685 34.9449 50C32.4851 48.9985 29.4449 46 29.4449 46V51H19.4449V37.9904L22.9449 31.4226L26.9449 22.7265Z",fill:"currentColor"})]}),(0,H.jsxs)("svg",{className:"absolute top-0 left-0 w-24 h-auto text-primary-500 drop-shadow-[0_0_20px_rgba(var(--primary-rgb),0.5)] transition-[clip-path] duration-100 ease-linear",style:{clipPath:o},viewBox:"0 0 60 51",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true",children:[(0,H.jsx)("title",{children:"Loading indicator animated fill"}),(0,H.jsx)("path",{d:"M29.4449 0H19.4449V16.5L29.4449 6.5V0Z",fill:"currentColor"}),(0,H.jsx)("path",{d:"M26.9449 22.7265C26.9449 22.5077 21.2201 27.0658 16.9449 28.5C13.7491 29.5721 12.3156 29.5038 8.94486 29.5C5.59532 29.4963 0 28.5 0 28.5C0 28.5 5.57953 28.5146 8.94486 27.5C12.5409 26.4158 14.8203 25.5843 17.9449 23.5C23.3445 19.898 29.4449 11.5 29.4449 11.5L29.9449 18C29.9449 18 33.5825 15.8308 36.4449 15C39.4452 14.1291 44.4449 14 44.4449 14C44.4449 14 36.9449 19 34.4449 21.5C31.5322 24.4126 29.8582 26.9017 29.4449 31C29.1217 34.2041 29.4771 36.4508 31.4449 39C33.5792 41.765 35.952 43.0183 39.4449 43C42.677 42.9831 45.3003 42.4182 47.4449 40C49.7406 37.4113 50.2495 34.4466 49.9449 31C49.6603 27.7804 48.4876 25.4953 45.9449 23.5C43.2931 21.4191 36.4449 24 36.4449 24L47.9449 15C47.9449 15 51.5761 16.771 53.4449 18.5C55.711 20.5967 56.7467 22.1546 57.9449 25C59.1784 27.9295 59.4832 29.8216 59.4449 33C59.4089 35.9867 59.179 37.78 57.9449 40.5C56.8475 42.9185 55.8511 44.6507 53.9449 46.5C51.9236 48.4609 50.5803 49.0076 47.9449 50C45.5414 50.9051 44.0131 51 41.4449 51C38.8766 51 37.3235 50.9685 34.9449 50C32.4851 48.9985 29.4449 46 29.4449 46V51H19.4449V37.9904L22.9449 31.4226L26.9449 22.7265Z",fill:"currentColor"})]})]})})})}i();var st=require("react");i();var Do=require("react-router-dom");pe();i();var Pe=require("react"),xn=require("react/jsx-runtime"),bn=(0,Pe.createContext)(void 0);function et(){let e=(0,Pe.use)(bn);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}i();function Re(e,t){return e?typeof e=="string"?e:t&&e[t]?e[t]:Object.values(e)[0]||"":""}W();function Ho(){let e=F(),{theme:t}=et(),o=(0,Do.useLocation)(),{currentLocale:r}=k(),n=e.theme||{},s=Re(n.title,r)||"Boltdocs",a=n.navbar||[],l=n.socialLinks||[],c=n.githubRepo,f=a.map(N=>{let C=N.href||N.to||N.link||"";return{label:Re(N.label||N.text,r),href:C,active:o.pathname===C,to:C.startsWith("http")||C.startsWith("//")?"external":void 0,items:N.items?.map(h=>({label:Re(h.label||h.text,r),href:h.href||h.link||h.to||""}))}}),d=n.logo,p=d?typeof d=="string"?d:t==="dark"?d.dark:d.light:null,u={alt:(d&&typeof d=="object"?d.alt:void 0)||s,width:d&&typeof d=="object"?d.width:void 0,height:d&&typeof d=="object"?d.height:void 0},v=c?`https://github.com/${c}`:null;return{links:f,title:s,logo:p,logoProps:u,github:v,social:l,config:e,theme:t}}i();var zo=require("react-router-dom");i();function ae(e,t,o){let r=e;return t&&(r===t||r.startsWith(t+"/"))&&(r=r===t?"index.md":r.slice(t.length+1)),o&&(r===o||r.startsWith(o+"/"))&&(r=r===o?"index.md":r.slice(o.length+1)),r}W();$e();function $o(){let e=(0,zo.useNavigate)(),t=k(),{allRoutes:o,currentRoute:r,currentVersion:n,currentLocale:s,config:a}=t,l=a.versions,c=ne(p=>p.setVersion),f=p=>{if(!l||p===n)return;c(p);let u=`/docs/${p}`;if(r){let v=ae(r.filePath,r.version,r.locale),N=o.find(C=>ae(C.filePath,C.version,C.locale)===v&&(C.version||l.defaultVersion)===p&&(s?C.locale===s:!C.locale));if(N)u=N.path;else{let C=o.find(h=>ae(h.filePath,h.version,h.locale)==="index.md"&&(h.version||l.defaultVersion)===p&&(s?h.locale===s:!h.locale));u=C?C.path:`/docs/${p}${s?`/${s}`:""}`}}e(u)},d=t.availableVersions.map(p=>({...p,label:p.label,value:p.key}));return{currentVersion:n,currentVersionLabel:t.currentVersionLabel,availableVersions:d,handleVersionChange:f}}i();var Go=require("react-router-dom");W();$e();function _o(){let e=(0,Go.useNavigate)(),t=k(),{allRoutes:o,currentRoute:r,currentLocale:n,config:s}=t,a=s.i18n,l=ne(u=>u.setLocale),c=u=>{if(!a||u===n)return;l(u);let v="/";if(r){let N=ae(r.filePath,r.version,r.locale),C=o.find(h=>ae(h.filePath,h.version,h.locale)===N&&(h.locale||a.defaultLocale)===u&&h.version===r.version);if(C)v=C.path;else{let h=o.find(Z=>ae(Z.filePath,Z.version,Z.locale)==="index.md"&&(Z.locale||a.defaultLocale)===u&&Z.version===r.version);v=h?h.path:u===a.defaultLocale?r.version?`/${r.version}`:"/":r.version?`/${r.version}/${u}`:`/${u}`}}else{let N=o.find(C=>(C.filePath==="index.mdx"||C.filePath==="index.md")&&(C.locale||a.defaultLocale)===u&&!C.version);N?v=N.path:v=u===a.defaultLocale?"/":`/${u}`}e(v)},d=s.i18n?.localeConfigs?.[n]?.label||s.i18n?.locales[n]||n,p=s.i18n?Object.entries(s.i18n.locales).map(([u,v])=>{let N=s.i18n?.localeConfigs?.[u];return{key:u,label:N?.label||v,value:u,isCurrent:u===n}}):[];return{currentLocale:n,currentLocaleLabel:d,availableLocales:p,handleLocaleChange:c}}W();We();i();var tt=require("react"),oe=require("lucide-react");var Fo=require("react-aria-components");Xe();var A=require("react/jsx-runtime");function ot(){let{theme:e,setTheme:t}=et(),[o,r]=(0,tt.useState)(!1);return(0,tt.useEffect)(()=>{r(!0)},[]),o?(0,A.jsxs)(fe,{placement:"bottom right",children:[(0,A.jsx)(Fo.Button,{className:"flex h-9 w-9 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-bg-surface hover:text-text-main outline-none focus-visible:ring-2 focus-visible:ring-primary-500","aria-label":"Selection theme",children:(0,A.jsx)(e==="system"?oe.Monitor:e==="dark"?oe.Moon:oe.Sun,{size:20,className:"animate-in fade-in zoom-in duration-300"})}),(0,A.jsxs)(ge,{selectionMode:"single",selectedKeys:[e],onSelectionChange:s=>{let a=Array.from(s)[0];t(a)},children:[(0,A.jsxs)(U,{id:"light",children:[(0,A.jsx)(oe.Sun,{size:16}),(0,A.jsx)("span",{children:"Light"})]}),(0,A.jsxs)(U,{id:"dark",children:[(0,A.jsx)(oe.Moon,{size:16}),(0,A.jsx)("span",{children:"Dark"})]}),(0,A.jsxs)(U,{id:"system",children:[(0,A.jsx)(oe.Monitor,{size:16}),(0,A.jsx)("span",{children:"System"})]})]})]}):(0,A.jsx)("div",{className:"h-9 w-9"})}i();i();var Wo=require("react-router-dom"),we=require("react");function Uo(e=[],t=[]){let o=(0,Wo.useLocation)(),r=(0,we.useRef)([]),[n,s]=(0,we.useState)({opacity:0,transform:"translateX(0) scaleX(0)",width:0}),l=t.find(d=>d.path===o.pathname)?.tab?.toLowerCase(),c=e.findIndex(d=>d.id.toLowerCase()===l),f=c===-1?0:c;return(0,we.useEffect)(()=>{let d=r.current[f];d&&s({opacity:1,width:d.offsetWidth,transform:`translateX(${d.offsetLeft}px)`})},[f,e.length,o.pathname]),{tabs:e,activeIndex:f,indicatorStyle:n,tabRefs:r,activeTabId:l}}Bt();Be();var vn=V(require("lucide-react"));W();var K=require("react/jsx-runtime");function rt({tabs:e,routes:t}){let{currentLocale:o}=k(),{indicatorStyle:r,tabRefs:n,activeIndex:s}=Uo(e,t),a=l=>{if(!l)return null;if(l.trim().startsWith("<svg"))return(0,K.jsx)("span",{className:"h-4 w-4",dangerouslySetInnerHTML:{__html:l}});let c=vn[l];return c?(0,K.jsx)(c,{size:16}):(0,K.jsx)("img",{src:l,alt:"",className:"h-4 w-4 object-contain"})};return(0,K.jsx)("div",{className:"mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6",children:(0,K.jsxs)(It.TabsList,{className:"border-none py-0",children:[e.map((l,c)=>{let f=c===s,d=t.find(u=>u.tab&&u.tab.toLowerCase()===l.id.toLowerCase()),p=d?d.path:"#";return(0,K.jsxs)(z,{href:p,ref:u=>{n.current[c]=u},className:`relative flex items-center gap-2 px-4 py-3 text-sm font-medium transition-colors outline-none ${f?"text-primary-500":"text-text-muted hover:text-text-main"}`,children:[a(l.icon),(0,K.jsx)("span",{children:Re(l.text,o)})]},l.id)}),(0,K.jsx)(It.TabsIndicator,{style:r})]})})}var Zo=require("react-router-dom");Xe();Vt();var Oe=require("lucide-react");Mt();var b=require("react/jsx-runtime"),Cn=(0,st.lazy)(()=>Promise.resolve().then(()=>(Ft(),Xo)).then(e=>({default:e.SearchDialog})));function Qo(){let{links:e,title:t,logo:o,logoProps:r,github:n,social:s,config:a}=Ho(),{routes:l,allRoutes:c,currentVersion:f,currentLocale:d}=k(),{pathname:p}=(0,Zo.useLocation)(),u=a.theme||{},v=u?.tabs&&u.tabs.length>0;return(0,b.jsxs)(O.NavbarRoot,{className:v?"border-b-0":"",children:[(0,b.jsxs)(O.Content,{children:[(0,b.jsxs)(O.NavbarLeft,{children:[(0,b.jsx)(O.NavbarLogo,{src:o??"",alt:r?.alt||t,width:r?.width??24,height:r?.height??24}),(0,b.jsx)(O.Title,{children:t}),a.versions&&f&&(0,b.jsx)(Nn,{}),(0,b.jsx)(O.Links,{children:e.map(N=>(0,b.jsx)(yn,{link:N},N.href))})]}),(0,b.jsx)(O.NavbarCenter,{children:(0,b.jsx)(st.Suspense,{fallback:(0,b.jsx)("div",{className:"h-9 w-32 animate-pulse rounded-md bg-bg-surface"}),children:(0,b.jsx)(Cn,{routes:l||[]})})}),(0,b.jsxs)(O.NavbarRight,{children:[a.i18n&&d&&(0,b.jsx)(Pn,{}),(0,b.jsx)(O.Split,{}),(0,b.jsx)(ot,{}),n&&(0,b.jsx)(Je,{repo:u?.githubRepo??""}),s.length>0&&(0,b.jsx)(O.Split,{}),(0,b.jsx)("div",{className:"flex items-center gap-1",children:s.map(({icon:N,link:C})=>(0,b.jsx)(O.Socials,{icon:N,link:C,className:"p-1.5"},C))})]})]}),p!=="/"&&v&&u?.tabs&&(0,b.jsx)("div",{className:"w-full border-b border-border-subtle bg-bg-main",children:(0,b.jsx)(rt,{tabs:u.tabs,routes:c||l||[]})})]})}function yn({link:e}){let t=Ie(e.href);return(0,b.jsx)(O.Link,{...e,href:t})}function Nn(){let{currentVersionLabel:e,availableVersions:t,handleVersionChange:o}=$o();return t.length===0?null:(0,b.jsxs)(ee.Trigger,{children:[(0,b.jsx)(Y,{variant:"outline",size:"sm",rounded:"lg",iconPosition:"right",icon:(0,b.jsx)(Oe.ChevronDown,{className:"w-3.5 h-3.5 text-text-muted/60"}),className:"h-8 border-border-subtle/60 bg-bg-surface/30 backdrop-blur-sm transition-all duration-200 hover:border-primary-500/50 hover:bg-primary-500/5",children:(0,b.jsx)("span",{className:"font-semibold text-[0.8125rem]",children:e})}),(0,b.jsx)(ee.Root,{children:(0,b.jsx)(ee.Section,{items:t,children:r=>(0,b.jsx)(ee.Item,{onPress:()=>o(r.value),children:r.label},`${r.value??""}`)})})]})}function Pn(){let{currentLocale:e,availableLocales:t,handleLocaleChange:o}=_o();return t.length===0?null:(0,b.jsxs)(ee.Trigger,{children:[(0,b.jsx)(Y,{variant:"outline",size:"sm",rounded:"lg",iconPosition:"right",icon:(0,b.jsx)(Oe.ChevronDown,{className:"w-3.5 h-3.5 text-text-muted/60"}),className:"h-8 border-border-subtle/60 bg-bg-surface/30 backdrop-blur-sm transition-all duration-200 hover:border-primary-500/50 hover:bg-primary-500/5 px-2.5",children:(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)(Oe.Languages,{className:"w-3.5 h-3.5 text-primary-500"}),(0,b.jsx)("span",{className:"font-bold text-[0.75rem] tracking-wider uppercase opacity-90",children:e||"en"})]})}),(0,b.jsx)(ee.Root,{children:(0,b.jsx)(ee.Section,{items:t,children:r=>(0,b.jsx)(ee.Item,{onPress:()=>o(r.value),children:(0,b.jsxs)("div",{className:"flex items-center justify-between w-full gap-4",children:[(0,b.jsx)("span",{children:r.label}),(0,b.jsx)("span",{className:"text-[10px] font-bold opacity-40 uppercase tracking-tighter",children:r.value})]})},`${r.value??""}`)})})]})}i();var Jo=require("lucide-react");Be();var re=require("react/jsx-runtime");function Yo(){return(0,re.jsx)("div",{className:"flex items-center justify-center min-h-[60vh] text-center",children:(0,re.jsxs)("div",{className:"space-y-4",children:[(0,re.jsx)("span",{className:"text-8xl font-black tracking-tighter text-primary-500/20",children:"404"}),(0,re.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"Page Not Found"}),(0,re.jsx)("p",{className:"text-sm text-text-muted max-w-sm mx-auto",children:"The page you're looking for doesn't exist or has been moved."}),(0,re.jsxs)(z,{href:"/",className:"inline-flex items-center gap-2 rounded-lg bg-primary-500 px-5 py-2.5 text-sm font-semibold text-white outline-none transition-all hover:brightness-110 hover:shadow-lg focus-visible:ring-2 focus-visible:ring-primary-500/30",children:[(0,re.jsx)(Jo.ArrowLeft,{size:16})," Go to Home"]})]})})}i();kt();var _=V(require("react"));i();var er=require("react");function tr(e=[]){let[t,o]=(0,er.useState)(null);return{headings:e,activeId:t,setActiveId:o}}var Te=require("lucide-react"),w=require("react/jsx-runtime");function or({headings:e=[],editLink:t,communityHelp:o,filePath:r}){let{headings:n}=tr(e),s=_.default.useMemo(()=>n.map(a=>({title:a.text,url:`#${a.id}`,depth:a.level})),[n]);return n.length===0?null:(0,w.jsx)(ho,{toc:s,children:(0,w.jsx)(Rn,{headings:n,editLink:t,communityHelp:o,filePath:r})})}function Rn({headings:e,editLink:t,communityHelp:o,filePath:r}){let n=fo(),[s,a]=(0,_.useState)({opacity:0}),l=(0,_.useRef)(null),c=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(!n||!l.current)return;let d=l.current.querySelector(`a[href="#${n}"]`);d&&a({transform:`translateY(${d.offsetTop}px)`,height:`${d.offsetHeight}px`,opacity:1})},[n]);let f=(0,_.useCallback)((d,p)=>{d.preventDefault();let u=document.getElementById(p);u&&(u.scrollIntoView({behavior:"smooth"}),window.history.pushState(null,"",`#${p}`))},[]);return(0,w.jsxs)(le.OnThisPageRoot,{children:[(0,w.jsxs)(le.OnThisPageHeader,{className:"flex flex-row gap-x-2",children:[(0,w.jsx)(Te.TextAlignStart,{size:16}),"On this page"]}),(0,w.jsx)(go,{containerRef:c,children:(0,w.jsxs)(le.OnThisPageContent,{className:"max-h-[450px] boltdocs-otp-scroll-area",ref:c,children:[(0,w.jsx)(le.OnThisPageIndicator,{style:s}),(0,w.jsx)("ul",{className:"relative space-y-2 border-l border-border-subtle",ref:l,children:e.map(d=>(0,w.jsx)(le.OnThisPageItem,{level:d.level,children:(0,w.jsx)(le.OnThisPageLink,{href:`#${d.id}`,active:n===d.id,onClick:p=>f(p,d.id),className:"pl-4",children:d.text})},d.id))})]})}),(t||o)&&(0,w.jsxs)("div",{className:"mt-8 pt-8 border-t border-border-subtle space-y-4",children:[(0,w.jsx)("p",{className:"text-xs font-bold uppercase tracking-wider text-text-main",children:"Need help?"}),(0,w.jsxs)("ul",{className:"space-y-3",children:[t&&r&&(0,w.jsx)("li",{children:(0,w.jsxs)("a",{href:t.replace(":path",r),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-text-muted hover:text-text-main transition-colors",children:[(0,w.jsx)(Te.Pencil,{size:16}),"Edit this page"]})}),o&&(0,w.jsx)("li",{children:(0,w.jsxs)("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-text-muted hover:text-text-main transition-colors",children:[(0,w.jsx)(Te.CircleHelp,{size:16}),"Community help"]})})]})]})]})}i();i();W();function rr(){let{routes:e}=k(),t=window.location.pathname,o=e.findIndex(a=>a.path===t),r=e[o],n=o>0?e[o-1]:null,s=o<e.length-1?e[o+1]:null;return{prevPage:n,nextPage:s,currentRoute:r}}St();var q=require("react/jsx-runtime");function nr(){let{prevPage:e,nextPage:t}=rr();return!e&&!t?null:(0,q.jsxs)(ie.PageNavRoot,{children:[e?(0,q.jsxs)(ie.PageNavLink,{to:e.path,direction:"prev",children:[(0,q.jsx)(ie.PageNavLink.Title,{children:"Previous"}),(0,q.jsx)(ie.PageNavLink.Description,{children:e.title})]}):(0,q.jsx)("div",{}),t&&(0,q.jsxs)(ie.PageNavLink,{to:t.path,direction:"next",children:[(0,q.jsx)(ie.PageNavLink.Title,{children:"Next"}),(0,q.jsx)(ie.PageNavLink.Description,{children:t.title})]})]})}i();var sr=require("lucide-react"),me=require("react/jsx-runtime");function it(){return(0,me.jsx)("div",{className:"flex items-center justify-center mt-10 mb-4 px-4 w-full",children:(0,me.jsxs)("a",{href:"https://github.com/jesusalcaladev/boltdocs",target:"_blank",rel:"noopener noreferrer",className:"group relative flex items-center gap-2 px-4 py-2 rounded-full border border-border-subtle bg-bg-surface/50 backdrop-blur-md transition-all duration-300 hover:border-primary-500/50 hover:bg-bg-surface hover:shadow-xl hover:shadow-primary-500/5 select-none",children:[(0,me.jsx)(sr.Zap,{className:"w-3.5 h-3.5 text-text-muted group-hover:text-primary-500 transition-colors duration-300",fill:"currentColor"}),(0,me.jsxs)("span",{className:"text-[11px] font-medium text-text-muted group-hover:text-text-main transition-colors duration-300 tracking-wide",children:["Powered by ",(0,me.jsx)("strong",{className:"font-bold text-text-main/80 group-hover:text-text-main",children:"Boltdocs"})]})]})})}i();var at=require("react"),ir=require("react-aria-components"),Wt=require("react/jsx-runtime");function ar(){let[e,t]=(0,at.useState)(0);return(0,at.useEffect)(()=>{let o=null,r,n=()=>{if(!o)return;let{scrollTop:a,scrollHeight:l,clientHeight:c}=o;if(l<=c){t(0);return}let f=a/(l-c)*100;t(Math.min(100,Math.max(0,f)))},s=()=>(o=document.querySelector(".boltdocs-content"),o?(o.addEventListener("scroll",n),n(),r&&clearInterval(r),!0):!1);return s()||(r=setInterval(s,100)),()=>{o&&o.removeEventListener("scroll",n),r&&clearInterval(r)}},[]),(0,Wt.jsx)(ir.ProgressBar,{value:e,"aria-label":"Reading progress",className:"fixed top-0 left-0 right-0 z-999 h-0.5 bg-transparent w-full pointer-events-none",children:({percentage:o})=>(0,Wt.jsx)("div",{className:"h-full bg-primary-500 transition-[width] duration-300 ease-out shadow-[0_0_8px_rgba(var(--primary-rgb),0.4)]",style:{width:`${o}%`}})})}Ft();i();var Le=require("react");i();var lr=require("react-router-dom");pe();function cr(e){let t=F(),o=(0,lr.useLocation)(),r=p=>p.endsWith("/")&&p.length>1?p.slice(0,-1):p,n=r(o.pathname),s=e.find(p=>r(p.path)===n),a=s?.tab?.toLowerCase(),l=a?e.filter(p=>!p.tab||p.tab.toLowerCase()===a):e,c=[],f=new Map;for(let p of l)p.group?(f.has(p.group)||f.set(p.group,{slug:p.group,title:p.groupTitle||p.group,routes:[],icon:p.groupIcon}),f.get(p.group).routes.push(p)):c.push(p);return{groups:Array.from(f.values()),ungrouped:c,activeRoute:s,activePath:n,config:t}}Et();var wn=V(require("lucide-react")),X=require("react/jsx-runtime");function mr(e){return e&&wn[e]||void 0}function Tn({group:e,activePath:t,getIcon:o}){let r=(0,Le.useMemo)(()=>e.routes.some(a=>a.path===t),[e.routes,t]),[n,s]=(0,Le.useState)(!0);return(0,Le.useEffect)(()=>{r&&s(!0)},[r]),(0,X.jsx)(xe.SidebarGroup,{title:e.title,isOpen:n,onToggle:()=>s(!n),children:e.routes.map(a=>{let l=t===(a.path.endsWith("/")?a.path.slice(0,-1):a.path);return(0,X.jsx)(xe.SidebarLink,{label:a.title,href:a.path,active:l,icon:o(a.icon),badge:a.badge},a.path)})})}function pr({routes:e,config:t}){let{groups:o,ungrouped:r,activePath:n}=cr(e),s=t.theme||{};return(0,X.jsxs)(xe.SidebarRoot,{children:[r.length>0&&(0,X.jsx)(xe.SidebarGroup,{className:"mb-6",children:r.map(a=>{let l=n===(a.path.endsWith("/")?a.path.slice(0,-1):a.path);return(0,X.jsx)(xe.SidebarLink,{label:a.title,href:a.path,active:l,icon:mr(a.icon),badge:a.badge},a.path)})}),o.map(a=>(0,X.jsx)(Tn,{group:a,activePath:n,getIcon:mr},a.slug)),s?.poweredBy&&(0,X.jsx)("div",{className:"mt-auto pt-8",children:(0,X.jsx)(it,{})})]})}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r,b as e,c as p,d as t,e as m,f,g as x,h as d,i as g,j as n,k as s,l as y,m as b,n as i}from"../chunk-6QXCKZAT.mjs";import"../chunk-RSII2UPE.mjs";import{a as o}from"../chunk-ZK2266IZ.mjs";import"../chunk-JD3RSDE4.mjs";import{a}from"../chunk-H4M6P3DM.mjs";import"../chunk-JXHNX2WN.mjs";import"../chunk-ZRJ55GGF.mjs";import"../chunk-NBCYHLAA.mjs";import"../chunk-JZXLCA2E.mjs";export{s as Breadcrumbs,o as CopyMarkdown,i as ErrorBoundary,t as GithubStars,n as Head,e as Loading,f as Navbar,r as NotFound,g as OnThisPage,y as PageNav,x as PoweredBy,b as ProgressBar,a as SearchDialog,d as Sidebar,m as Tabs,p as ThemeToggle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{q as a,r as b,s as c,t as d,u as e}from"./chunk-Q3MLYTIQ.mjs";e();export{c as AssetCache,a as FileCache,b as TransformCache,d as flushCache};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import{a as v,c as u,d as S,e as W,f as q,g as xt,h as bt,i as F,j as it,k as vt,l as E,m as nt,n as G,o as rt,p as _,q as Pt,r as wt,u as Ct}from"./chunk-Q3MLYTIQ.mjs";function st(){M.invalidateAll()}function at(o){M.invalidate(o)}var M,$t=v(()=>{"use strict";u();Ct();M=new Pt({name:"routes"})});import A from"path";import se from"github-slugger";function kt(o,r,i,d){let e=decodeURIComponent(o),l=A.resolve(e),c=A.resolve(r),m=S(A.relative(c,l));if(m.startsWith("../")||m===".."||l.includes("\0"))throw new Error(`Security breach: File is outside of docs directory or contains null bytes: ${o}`);let{data:t,content:s}=bt(o),a=m.split("/"),p,h;if(d?.versions&&a.length>0){let R=a[0],et=d.versions.prefix||"",V=d.versions.versions.find(O=>{let ot=et+O.path;return R===ot||R===O.path});V&&(h=V.path,a=a.slice(1))}if(d?.i18n&&a.length>0){let R=a[0];d.i18n.locales[R]&&(p=R,a=a.slice(1))}let y;if(a.length>0){let R=a[0].match(/^\((.+)\)$/);R&&(y=R[1].toLowerCase(),a=a.slice(1))}let k=a.join("/"),n;t.permalink?n=t.permalink.startsWith("/")?t.permalink:`/${t.permalink}`:n=vt(k||"index.md");let g=i;h&&(g+="/"+h),p&&(g+="/"+p),g+=n==="/"?"":n,(!g||g==="")&&(g="/");let b=a[a.length-1],f=W(b),B=W(A.basename(o,A.extname(o))),x=t.sidebarPosition??q(b),$=a.length>=2?a[0]:void 0,P=$?W($):void 0,L=a.length>=2&&/^index\.mdx?$/.test(f),ee=new se,ht=[],oe=/^(#{2,4})\s+(.+)$/gm;for(let R of s.matchAll(oe)){let et=R[1].length,V=R[2].replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").trim(),O=E(V).trim(),ot=ee.slug(O);ht.push({level:et,text:O,id:ot})}let ie=t.title?E(String(t.title)):B,tt=t.description?E(String(t.description)):"";!tt&&s&&(tt=nt(s.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").replace(/\s+/g," ")).trim().slice(0,160));let ne=t.badge?E(String(t.badge)):void 0,yt=t.icon?String(t.icon):void 0,re=ae(s);return{route:{path:g,componentPath:o,filePath:m,title:ie,description:tt,sidebarPosition:x,headings:ht,locale:p,version:h,badge:ne,icon:yt,tab:y,_content:re,_rawContent:s},relativeDir:P,isGroupIndex:L,inferredTab:y,groupMeta:L?{title:t.groupTitle||t.title||(P?G(P):""),position:t.groupPosition??t.sidebarPosition??($?q($):void 0),icon:yt}:void 0,inferredGroupPosition:$?q($):void 0}}function ae(o){let r=o.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/\{[^\}]+\}/g,"").replace(/[_*`]/g,"").replace(/\s+/g," ");return nt(r).trim()}var Bt=v(()=>{"use strict";u();_()});function St(o){return o.sort((r,i)=>!r.group&&!i.group?Rt(r,i):r.group?i.group?r.group!==i.group?le(r,i):Rt(r,i):1:-1)}function Rt(o,r){return o.sidebarPosition!==void 0&&r.sidebarPosition!==void 0?o.sidebarPosition-r.sidebarPosition:o.sidebarPosition!==void 0?-1:r.sidebarPosition!==void 0?1:o.title.localeCompare(r.title)}function le(o,r){return o.groupPosition!==void 0&&r.groupPosition!==void 0?o.groupPosition-r.groupPosition:o.groupPosition!==void 0?-1:r.groupPosition!==void 0?1:(o.groupTitle||o.group).localeCompare(r.groupTitle||r.group)}var Mt=v(()=>{"use strict";u()});import ce from"fast-glob";async function U(o,r,i="/docs",d=!0){let e=performance.now();M.load(),N.clear(),(process.env.BOLTDOCS_FORCE_REPARSE==="true"||r?.i18n)&&M.invalidateAll();let l;!d&<?l=lt:(l=await ce(["**/*.md","**/*.mdx"],{cwd:o,absolute:!0,suppressErrors:!0,followSymbolicLinks:!1}),lt=l),M.pruneStale(new Set(l));let c=50,m=[],t=0;for(let n=0;n<l.length;n+=c){let g=l.slice(n,n+c),b=await Promise.all(g.map(async f=>{let B=M.get(f);if(B)return t++,B;let x=kt(f,o,i,r);return M.set(f,x),x}));m.push(...b),n+c<l.length&&await new Promise(f=>setImmediate(f))}M.save();let s=new Map,a=[];for(let n of m)if(n.isGroupIndex&&n.relativeDir&&a.push(n),n.relativeDir){let g=s.get(n.relativeDir);g?(g.position===void 0&&n.inferredGroupPosition!==void 0&&(g.position=n.inferredGroupPosition),!g.icon&&n.route.icon&&(g.icon=n.route.icon)):(g={title:G(n.relativeDir),position:n.inferredGroupPosition,icon:n.route.icon},s.set(n.relativeDir,g))}for(let n of a){let g=s.get(n.relativeDir);n.groupMeta&&(g.title=n.groupMeta.title,n.groupMeta.position!==void 0&&(g.position=n.groupMeta.position),n.groupMeta.icon&&(g.icon=n.groupMeta.icon))}let p=new Array(m.length);for(let n=0;n<m.length;n++){let g=m[n],b=g.relativeDir,f=b?s.get(b):void 0;p[n]={...g.route,group:b,groupTitle:f?.title||(b?G(b):void 0),groupPosition:f?.position,groupIcon:f?.icon}}let h=p;if(r?.i18n){let n=de(p,r,i);h=[...p,...n]}let y=St(h),k=performance.now()-e;return console.log(`[boltdocs] Route generation: ${k.toFixed(2)}ms (${l.length} files, ${t} cache hits)`),y}function de(o,r,i){let d=r.i18n.defaultLocale,e=Object.keys(r.i18n.locales),l=[],c=new Map,m=[];for(let t of o){let s=t.locale||d;c.has(s)||c.set(s,new Set),c.get(s).add(t.path),s===d&&m.push(t)}for(let t of e){let s=c.get(t)||new Set;for(let a of m){let p=me(a.path,d,t,i,r);p!==a.path&&(s.has(p)||l.push({...a,path:p,locale:t}))}}return l}function me(o,r,i,d,e){let l=`${o}:${i}`,c=N.get(l);if(c)return c;let m=d;if(e?.versions){let p=e.versions.prefix||"";for(let h of e.versions.versions){let y=p+h.path;if(o.startsWith(`${d}/${y}`)){m+="/"+y;break}if(o.startsWith(`${d}/${h.path}`)){m+="/"+h.path;break}}}let t=o.substring(m.length),s=`/${r}`;if(t.startsWith(s+"/"))t="/"+i+"/"+t.substring(s.length+1);else if(t===s)t="/"+i;else if(t==="/"||t==="")t="/"+i;else{let p=t.startsWith("/")?"":"/";t="/"+i+p+t}let a=m+t;return N.size>2e3&&N.clear(),N.set(l,a),a}var lt,N,ct=v(()=>{"use strict";u();_();$t();Bt();Mt();lt=null,N=new Map});import dt from"path";import pe from"fs";import{loadConfigFromFile as ge}from"vite";function ue(o){return o}async function j(o,r=process.cwd()){let i=r,d={docsDir:dt.resolve(o),theme:{title:"Boltdocs",description:"A Vite documentation framework",navbar:[{label:"Home",href:"/"},{label:"Documentation",href:"/docs"}],codeTheme:{light:"github-light",dark:"github-dark"},poweredBy:!0,breadcrumbs:!0}},e={};for(let t of J){let s=dt.resolve(i,t);if(pe.existsSync(s))try{let a=await ge({command:"serve",mode:"development"},s,i);if(a){e=a.config;break}}catch(a){console.warn(`[boltdocs] Failed to load config from ${t}:`,a)}}let c={...{title:e.title,description:e.description,logo:e.logo,favicon:e.favicon,ogImage:e.ogImage,navbar:e.navbar,sidebar:e.sidebar,socialLinks:e.socialLinks,footer:e.footer,githubRepo:e.githubRepo,tabs:e.tabs,codeTheme:e.codeTheme,copyMarkdown:e.copyMarkdown,breadcrumbs:e.breadcrumbs,poweredBy:e.poweredBy,communityHelp:e.communityHelp,version:e.version,editLink:e.editLink},...e.theme||{}},m=Object.fromEntries(Object.entries(c).filter(([t,s])=>s!==void 0));return m.navbar&&(m.navbar=m.navbar.map(t=>({label:t.label||t.text||"",href:t.href||t.link||t.to||"",items:t.items?.map(s=>({label:s.label||s.text||"",href:s.href||s.link||s.to||""}))}))),{docsDir:dt.resolve(o),homePage:e.homePage,theme:{...d.theme,...m},i18n:e.i18n,versions:e.versions,siteUrl:e.siteUrl,plugins:e.plugins||[],external:e.external,integrations:e.integrations,robots:e.robots,vite:e.vite}}var J,X=v(()=>{"use strict";u();J=["boltdocs.config.js","boltdocs.config.mjs","boltdocs.config.ts"]});function Dt(o,r){let i=F(r.title),d=F(r.description);return o.replace(/<title>.*?<\/title>/,`<title>${i}</title>`).replace(/(<meta name="description" content=")[^"]*(")/,`$1${d}$2`).replace(/(<meta property="og:title" content=")[^"]*(")/,`$1${i}$2`).replace(/(<meta property="og:description" content=")[^"]*(")/,`$1${d}$2`).replace(/(<meta name="twitter:title" content=")[^"]*(")/,`$1${i}$2`).replace(/(<meta name="twitter:description" content=")[^"]*(")/,`$1${d}$2`)}var Tt=v(()=>{"use strict";u();_()});function _t(o,r){let i=r?.siteUrl?.replace(/\/$/,"")||"https://example.com",d=new Date().toISOString().split("T")[0],e=[{url:"/",priority:"1.0",changefreq:"daily"}];if(r?.i18n){let c=r.i18n.defaultLocale;for(let m of Object.keys(r.i18n.locales))m!==c&&e.push({url:`/${m}/`,priority:"1.0",changefreq:"daily"})}return`<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
3
|
+
${[...e,...o.map(c=>({url:c,priority:"0.8",changefreq:"weekly"}))].map(c=>` <url>
|
|
4
|
+
<loc>${it(i)}${it(c.url)}</loc>
|
|
5
|
+
<lastmod>${d}</lastmod>
|
|
6
|
+
<changefreq>${c.changefreq}</changefreq>
|
|
7
|
+
<priority>${c.priority}</priority>
|
|
8
|
+
</url>`).join(`
|
|
9
|
+
`)}
|
|
10
|
+
</urlset>`}var jt=v(()=>{"use strict";u();_()});function K(o){if(typeof o.robots=="string")return o.robots;let r=o.siteUrl?.replace(/\/$/,"")||"",i=o.robots||{},d=i.rules||[{userAgent:"*",allow:"/"}],e=i.sitemaps||(r?[`${r}/sitemap.xml`]:[]),l="";for(let c of d){if(l+=`User-agent: ${c.userAgent}
|
|
11
|
+
`,c.disallow){let m=Array.isArray(c.disallow)?c.disallow:[c.disallow];for(let t of m)l+=`Disallow: ${t}
|
|
12
|
+
`}if(c.allow){let m=Array.isArray(c.allow)?c.allow:[c.allow];for(let t of m)l+=`Allow: ${t}
|
|
13
|
+
`}l+=`
|
|
14
|
+
`}for(let c of e)l+=`Sitemap: ${c}
|
|
15
|
+
`;return l.trim()}var mt=v(()=>{"use strict";u()});import I from"fs";import T from"path";import{fileURLToPath as fe}from"url";import{createRequire as he}from"module";async function pt(o){let{docsDir:r,docsDirName:i,outDir:d,config:e}=o,l=await U(r,e),c=T.resolve(It,"../client/ssr.js");if(!I.existsSync(c)){console.error("[boltdocs] SSR module not found at",c,"- Did you build the core package?");return}let m=Ft("module"),t=m.prototype.require;m.prototype.require=function(n,...g){return n==="virtual:boltdocs-layout"?{__esModule:!0,default:function(f){try{let x=t.apply(this,[T.resolve(It,"../client/index.js")]).DefaultLayout||(({children:P})=>P);return t.apply(this,["react"]).createElement(x,f)}catch{return f.children}}}:t.apply(this,[n,...g])};let{render:s}=Ft(c);m.prototype.require=t;let a=T.join(d,"index.html");if(!I.existsSync(a)){console.warn("[boltdocs] No index.html found in outDir, skipping SSG.");return}let p=I.readFileSync(a,"utf-8");await Promise.all(l.map(async n=>{let g=rt(e?.theme?.title,n.locale)||"Boltdocs",b=rt(e?.theme?.description,n.locale)||"",f=`${n.title} | ${g}`,B=n.description||b,x={};x[`/${i}/${n.filePath}`]={default:()=>null};try{let $=await s({path:n.path,routes:l,config:e||{},docsDirName:i,modules:x,homePage:void 0}),P=Dt(p,{title:F(f),description:F(B)}).replace("<!--app-html-->",$).replace('<div id="root"></div>',`<div id="root">${$}</div>`),L=T.join(d,n.path);await I.promises.mkdir(L,{recursive:!0}),await I.promises.writeFile(T.join(L,"index.html"),P,"utf-8")}catch($){console.error(`[boltdocs] Error SSR rendering route ${n.path}:`,$&&($.stack||$))}}));let h=_t(l.map(n=>n.path),e);I.writeFileSync(T.join(d,"sitemap.xml"),h,"utf-8");let y=K(e);I.writeFileSync(T.join(d,"robots.txt"),y,"utf-8"),console.log(`[boltdocs] Generated ${l.length} static pages + sitemap.xml + robots.txt`);let{flushCache:k}=await import("./cache-CRAZ55X7.mjs");await k()}var ye,It,Ft,gt=v(()=>{"use strict";u();ct();_();Tt();jt();mt();ye=fe(import.meta.url),It=T.dirname(ye),Ft=he(import.meta.url)});import Ht from"path";import xe from"fs";function Lt(o,r){let i=o.homePage?`import HomePage from '${S(o.homePage)}';`:"",d=Ht.resolve(process.cwd(),"index.css"),e=xe.existsSync(d)?"import './index.css';":"",l=o.homePage?"homePage: HomePage,":"",c=r?.plugins?.flatMap(y=>Object.entries(y.components||{}))||[],m=c.map(([y,k])=>`import * as _comp_${y} from '${S(k)}';
|
|
16
|
+
const ${y} = _comp_${y}.default || _comp_${y}['${y}'] || _comp_${y};`).join(`
|
|
17
|
+
`),t=c.map(([y])=>y).join(", "),s=Ht.basename(o.docsDir||"docs"),a=Object.entries(r?.external||{}),p=a.map(([y,k],n)=>`import _ext_${n} from '${S(k)}';`).join(`
|
|
18
|
+
`),h=a.length>0?`externalPages: { ${a.map(([y],k)=>`"${y}": _ext_${k}`).join(", ")} },`:"";return`
|
|
19
|
+
import { createBoltdocsApp as _createApp } from 'boltdocs/client';
|
|
20
|
+
import _routes from 'virtual:boltdocs-routes';
|
|
21
|
+
import _config from 'virtual:boltdocs-config';
|
|
22
|
+
import _user_mdx_components from 'virtual:boltdocs-mdx-components';
|
|
23
|
+
${e}
|
|
24
|
+
${i}
|
|
25
|
+
${m}
|
|
26
|
+
${p}
|
|
27
|
+
|
|
28
|
+
_createApp({
|
|
29
|
+
target: '#root',
|
|
30
|
+
routes: _routes,
|
|
31
|
+
docsDirName: '${s}',
|
|
32
|
+
config: _config,
|
|
33
|
+
modules: import.meta.glob('/${s}/**/*.{md,mdx}'),
|
|
34
|
+
hot: import.meta.hot,
|
|
35
|
+
${l}
|
|
36
|
+
${h}
|
|
37
|
+
components: { ${t}${t?", ":""} ...(_user_mdx_components || {}) },
|
|
38
|
+
});
|
|
39
|
+
`}var Ot=v(()=>{"use strict";u();_()});function Et(o){return`<!doctype html>
|
|
40
|
+
<html lang="en">
|
|
41
|
+
<head>
|
|
42
|
+
<meta charset="UTF-8" />
|
|
43
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
44
|
+
<title>${o.theme?.title||"Boltdocs"}</title>
|
|
45
|
+
</head>
|
|
46
|
+
<body>
|
|
47
|
+
<div id="root"></div>
|
|
48
|
+
</body>
|
|
49
|
+
</html>`}function ut(o,r){let i=r.theme,d=i?.title||"Boltdocs",e=i?.description||"",l=i?.favicon;!l&&i?.logo&&(typeof i.logo=="string"?l=i.logo:l=i.logo.light||i.logo.dark);let c=[l?`<link rel="icon" href="${l}">`:"",`<meta name="description" content="${e}">`,`<meta property="og:title" content="${d}">`,`<meta property="og:description" content="${e}">`,i?.ogImage?`<meta property="og:image" content="${i.ogImage}">`:"",'<meta property="og:type" content="website">','<meta name="twitter:card" content="summary_large_image">',`<meta name="twitter:title" content="${d}">`,`<meta name="twitter:description" content="${e}">`,i?.ogImage?`<meta name="twitter:image" content="${i.ogImage}">`:"",'<meta name="generator" content="Boltdocs">'].filter(Boolean).join(`
|
|
50
|
+
`),m=`
|
|
51
|
+
<script>
|
|
52
|
+
(function() {
|
|
53
|
+
try {
|
|
54
|
+
var stored = localStorage.getItem("boltdocs-theme");
|
|
55
|
+
var theme = stored || (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
|
|
56
|
+
if (theme === "light") {
|
|
57
|
+
document.documentElement.classList.add("theme-light");
|
|
58
|
+
document.documentElement.dataset.theme = "light";
|
|
59
|
+
} else {
|
|
60
|
+
document.documentElement.classList.remove("theme-light");
|
|
61
|
+
document.documentElement.dataset.theme = "dark";
|
|
62
|
+
}
|
|
63
|
+
} catch (e) {}
|
|
64
|
+
})();
|
|
65
|
+
</script>
|
|
66
|
+
`;return o.includes("<title>")?o=o.replace(/<title>.*?<\/title>/,`<title>${d}</title>`):o=o.replace("</head>",` <title>${d}</title>
|
|
67
|
+
</head>`),o=o.replace("</head>",` ${c}
|
|
68
|
+
${m} </head>`),!o.includes("src/main")&&!o.includes("virtual:boltdocs-entry")&&(o=o.replace("</body>",` <script type="module">import "virtual:boltdocs-entry";</script>
|
|
69
|
+
</body>`)),o}var Gt=v(()=>{"use strict";u()});var At=v(()=>{"use strict";u()});import{loadEnv as be}from"vite";import{ViteImageOptimizer as ve}from"vite-plugin-image-optimizer";import D from"path";import Nt from"fs";function Ut(o={},r){let i=D.resolve(process.cwd(),o.docsDir||"docs"),d=S(i),e=r,l,c=!1,m=e?.plugins?.flatMap(t=>t.vitePlugins||[])||[];return[{name:"vite-plugin-boltdocs",enforce:"pre",async config(t,s){c=s.command==="build";let a=t.envDir||process.cwd(),p=be(s.mode,a,"");return Object.assign(process.env,p),e||(e=await j(i)),{optimizeDeps:{include:["react","react-dom"],exclude:["boltdocs","boltdocs/client","boltdocs/hooks","boltdocs/primitives","boltdocs/base-ui","boltdocs/mdx","boltdocs/integrations","boltdocs/client/hooks","boltdocs/client/primitives"]}}},configResolved(t){l=t},configureServer(t){t.middlewares.use((n,g,b)=>{if(n.url==="/robots.txt"){let f=K(e);g.statusCode=200,g.setHeader("Content-Type","text/plain"),g.end(f);return}b()}),t.middlewares.use(async(n,g,b)=>{let f=n.url?.split("?")[0]||"/",B=n.headers.accept||"",x=f==="/"||f.startsWith("/docs")||e.i18n&&Object.keys(e.i18n.locales).some(P=>f.startsWith(`/${P}/docs`)||f===`/${P}`)||e.external&&Object.keys(e.external).some(P=>f.startsWith(P)),$=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(f);if(B.includes("text/html")&&!$&&x){let P=Et(e);P=ut(P,e),P=await t.transformIndexHtml(n.url||"/",P),g.statusCode=200,g.setHeader("Content-Type","text/html"),g.end(P);return}b()});let s=J.map(n=>D.resolve(process.cwd(),n)),a=["tsx","jsx"],p=a.map(n=>D.resolve(i,`layout.${n}`)),h=["tsx","ts","jsx","js"],y=h.map(n=>D.resolve(i,`mdx-components.${n}`));t.watcher.add([...s,...y,...p]);let k=async(n,g)=>{try{let b=S(n);if(J.some(x=>b.endsWith(x))){t.restart();return}if(h.some(x=>b.endsWith(`mdx-components.${x}`))){let x=t.moduleGraph.getModuleById("\0virtual:boltdocs-mdx-components");x&&t.moduleGraph.invalidateModule(x),t.ws.send({type:"full-reload"});return}if(a.some(x=>b.endsWith(`layout.${x}`))){let x=t.moduleGraph.getModuleById("\0virtual:boltdocs-layout");x&&t.moduleGraph.invalidateModule(x),t.ws.send({type:"full-reload"});return}if(!b.startsWith(d)||!xt(b))return;if(g==="add"||g==="unlink"){st(),e=await j(i);let x=t.moduleGraph.getModuleById("\0virtual:boltdocs-config");x&&t.moduleGraph.invalidateModule(x),t.ws.send({type:"custom",event:"boltdocs:config-update",data:{theme:e?.theme,integrations:e?.integrations,i18n:e?.i18n,versions:e?.versions,siteUrl:e?.siteUrl}})}else at(n);let f=await U(i,e,"/docs",g!=="change"),B=t.moduleGraph.getModuleById("\0virtual:boltdocs-routes");B&&t.moduleGraph.invalidateModule(B),t.ws.send({type:"custom",event:"boltdocs:routes-update",data:f})}catch(b){console.error(`[boltdocs] HMR error during ${g} event:`,b)}};t.watcher.on("add",n=>k(n,"add")),t.watcher.on("unlink",n=>k(n,"unlink")),t.watcher.on("change",n=>k(n,"change"))},resolveId(t){if(t==="virtual:boltdocs-routes"||t==="virtual:boltdocs-config"||t==="virtual:boltdocs-entry"||t==="virtual:boltdocs-mdx-components"||t==="virtual:boltdocs-layout")return"\0"+t},async load(t){if(t==="\0virtual:boltdocs-routes"){let s=await U(i,e);return`export default ${JSON.stringify(s,null,2)};`}if(t==="\0virtual:boltdocs-config"){let s={theme:e?.theme,integrations:e?.integrations,i18n:e?.i18n,versions:e?.versions,siteUrl:e?.siteUrl};return`export default ${JSON.stringify(s,null,2)};`}if(t==="\0virtual:boltdocs-entry")return Lt(o,e);if(t==="\0virtual:boltdocs-mdx-components"){let s=["tsx","ts","jsx","js"],a=null;for(let p of s){let h=D.resolve(i,`mdx-components.${p}`);if(Nt.existsSync(h)){a=h;break}}if(a){let p=S(a);return`import * as components from '${p}';
|
|
70
|
+
const mdxComponents = components.default || components;
|
|
71
|
+
export default mdxComponents;
|
|
72
|
+
export * from '${p}';`}return"export default {};"}if(t==="\0virtual:boltdocs-layout"){let s=["tsx","jsx"],a=null;for(let p of s){let h=D.resolve(i,`layout.${p}`);if(Nt.existsSync(h)){a=h;break}}return a?`import UserLayout from '${S(a)}';
|
|
73
|
+
export default UserLayout;`:`import { DefaultLayout } from 'boltdocs/client';
|
|
74
|
+
export default DefaultLayout;`}},transformIndexHtml:{order:"pre",handler(t){return ut(t,e)}},async closeBundle(){if(!c)return;let t=l?.build?.outDir?D.resolve(l.root,l.build.outDir):D.resolve(process.cwd(),"dist"),s=D.basename(i||"docs");await pt({docsDir:i,docsDirName:s,outDir:t,config:e});let{flushCache:a}=await import("./cache-CRAZ55X7.mjs");await a()}},ve({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:"preset-default"}]}}),...m.filter(t=>!!t)]}var zt=v(()=>{"use strict";u();ct();X();gt();_();Ot();Gt();mt();At()});var Vt,H,Wt=v(()=>{"use strict";u();Ct();Vt="v3",H=new wt("mdx")});import{createHighlighter as Pe}from"shiki";async function Q(o){if(Z)return Z;let r=typeof o=="object"?[o.light,o.dark]:[o??"github-dark"];return["github-light","github-dark"].forEach(i=>{r.includes(i)||r.push(i)}),Z=await Pe({themes:r,langs:["tsx","jsx","ts","js","json","md","mdx","css","html","bash","sh","yaml","yml"]}),Z}var Z,ft=v(()=>{"use strict";u();Z=null});import{visit as we}from"unist-util-visit";function qt(o){return async r=>{let i=o?.theme?.codeTheme??{light:"github-light",dark:"github-dark"},d=await Q(i);we(r,["mdxJsxFlowElement","mdxJsxTextElement"],e=>{if(e.name!=="ComponentPreview")return;let l=e.attributes?.find(s=>s.name==="code"),c="";if(l){if(typeof l.value=="string")c=l.value;else if(l.value?.type==="mdxJsxAttributeValueExpression"){let s=l.value.value??"";c=s.match(/^[`'"](.+)[`'"]$/)?.[1]??s}}if(!c)return;let m=typeof i=="object"?{themes:{light:i.light,dark:i.dark},lang:"tsx"}:{theme:i,lang:"tsx"},t=d.codeToHtml(c,m);e.attributes=(e.attributes??[]).filter(s=>s.name!=="highlightedHtml"),e.attributes.push({type:"mdxJsxAttribute",name:"highlightedHtml",value:t})})}}var Jt=v(()=>{"use strict";u();ft()});import{visit as Ce}from"unist-util-visit";function Xt(o){return async r=>{let i=o?.theme?.codeTheme||{light:"github-light",dark:"github-dark"},d=await Q(i);Ce(r,"element",e=>{if(e.tagName==="pre"&&e.children?.[0]?.tagName==="code"){let l=e.children[0],m=(l.properties?.className||[]).find(h=>h.startsWith("language-")),t=m?m.slice(9):"text",s=l.children[0]?.value||"",a={lang:t};typeof i=="object"?a.themes={light:i.light,dark:i.dark}:a.theme=i;let p=d.codeToHtml(s,a);e.properties.dataHighlighted="true",e.properties.highlightedHtml=p,e.children=[]}})}}var Kt=v(()=>{"use strict";u();ft()});import $e from"@mdx-js/rollup";import ke from"remark-gfm";import Be from"remark-frontmatter";import Re from"rehype-slug";import Se from"crypto";function Qt(o,r=$e){let i=o?.plugins?.flatMap(l=>l.remarkPlugins||[])||[],d=o?.plugins?.flatMap(l=>l.rehypePlugins||[])||[],e=r({remarkPlugins:[ke,Be,[qt,o],...i],rehypePlugins:[Re,[Xt,o],...d],jsxRuntime:"automatic",providerImportSource:"@mdx-js/react"});return{...e,name:"vite-plugin-boltdocs-mdx",async buildStart(){Y=0,z=0,Zt||(H.load(),Zt=!0),e.buildStart&&await e.buildStart.call(this)},async transform(l,c,m){if(!c.endsWith(".md")&&!c.endsWith(".mdx"))return e.transform?.call(this,l,c,m);console.log(`[boltdocs] Transforming MDX: ${c}`),z++;let t=Se.createHash("md5").update(l).digest("hex"),s=`${c}:${t}:${Vt}`,a=H.get(s);if(a)return Y++,{code:a,map:null};let p=await e.transform.call(this,l,c,m);return p&&typeof p=="object"&&p.code&&H.set(s,p.code),p},async buildEnd(){z>0&&console.log(`[boltdocs] MDX Cache Performance: ${Y}/${z} hits (${Math.round(Y/z*100)||0}%)`),H.save(),await H.flush(),e.buildEnd&&await e.buildEnd.call(this)}}}var Zt,Y,z,Yt=v(()=>{"use strict";u();Wt();Jt();Kt();Zt=!1,Y=0,z=0});import Me from"@vitejs/plugin-react";import De from"@tailwindcss/vite";async function te(o){let r=o?.docsDir||"docs",i=await j(r),d={...o,homePage:o?.homePage||i.homePage};return[...Ut(d,i),Qt(i)]}async function yi(o,r="development"){let i=await j("docs",o);return{root:o,mode:r,plugins:[Me(),De(),await te({docsDir:i.docsDir,homePage:i.homePage})],...i.vite}}var Te=v(()=>{u();zt();Yt();X();gt();X()});export{ue as a,j as b,pt as c,Et as d,Gt as e,te as f,yi as g,Te as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as oe,b as ne,c as ae,d as ie,e as se,f as le,g as me,h as ce,i as pe}from"./chunk-RSII2UPE.mjs";import{b as J}from"./chunk-JD3RSDE4.mjs";import{J as Y,L as Q,M as X,U as y,_ as v,a as W,b as O,e as k,ea as $,f as K,ja as w,ka as j,la as z,ma as A,na as ee,qa as te,sa as re,ta as H,wa as f,y as u}from"./chunk-ZRJ55GGF.mjs";import{b as F,f as B,g as Z}from"./chunk-NBCYHLAA.mjs";import{ArrowLeft as Ie}from"lucide-react";import{jsx as S,jsxs as ue}from"react/jsx-runtime";function yt(){return S("div",{className:"flex items-center justify-center min-h-[60vh] text-center",children:ue("div",{className:"space-y-4",children:[S("span",{className:"text-8xl font-black tracking-tighter text-primary-500/20",children:"404"}),S("h1",{className:"text-2xl font-bold text-text-main",children:"Page Not Found"}),S("p",{className:"text-sm text-text-muted max-w-sm mx-auto",children:"The page you're looking for doesn't exist or has been moved."}),ue(O,{href:"/",className:"inline-flex items-center gap-2 rounded-lg bg-primary-500 px-5 py-2.5 text-sm font-semibold text-white outline-none transition-all hover:brightness-110 hover:shadow-lg focus-visible:ring-2 focus-visible:ring-primary-500/30",children:[S(Ie,{size:16})," Go to Home"]})]})})}import{useEffect as Me,useState as Ee}from"react";import{jsx as x,jsxs as D}from"react/jsx-runtime";function wt(){let[e,r]=Ee(0);Me(()=>{let t=0,a=!0,l=setInterval(()=>{a?(t+=1,t>=100&&(t=100,a=!1)):(t-=1,t<=0&&(t=0,a=!0)),r(t)},20);return()=>clearInterval(l)},[]);let o=`inset(${100-e}% 0 0 0)`;return x("div",{className:"flex flex-col items-center justify-center min-h-[60vh] p-4 text-center",children:x("div",{className:"relative group",children:D("div",{className:"relative inline-block",children:[D("svg",{className:"w-24 h-auto opacity-10 filter grayscale brightness-50",viewBox:"0 0 60 51",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true",children:[x("title",{children:"Loading indicator background"}),x("path",{d:"M29.4449 0H19.4449V16.5L29.4449 6.5V0Z",fill:"currentColor"}),x("path",{d:"M26.9449 22.7265C26.9449 22.5077 21.2201 27.0658 16.9449 28.5C13.7491 29.5721 12.3156 29.5038 8.94486 29.5C5.59532 29.4963 0 28.5 0 28.5C0 28.5 5.57953 28.5146 8.94486 27.5C12.5409 26.4158 14.8203 25.5843 17.9449 23.5C23.3445 19.898 29.4449 11.5 29.4449 11.5L29.9449 18C29.9449 18 33.5825 15.8308 36.4449 15C39.4452 14.1291 44.4449 14 44.4449 14C44.4449 14 36.9449 19 34.4449 21.5C31.5322 24.4126 29.8582 26.9017 29.4449 31C29.1217 34.2041 29.4771 36.4508 31.4449 39C33.5792 41.765 35.952 43.0183 39.4449 43C42.677 42.9831 45.3003 42.4182 47.4449 40C49.7406 37.4113 50.2495 34.4466 49.9449 31C49.6603 27.7804 48.4876 25.4953 45.9449 23.5C43.2931 21.4191 36.4449 24 36.4449 24L47.9449 15C47.9449 15 51.5761 16.771 53.4449 18.5C55.711 20.5967 56.7467 22.1546 57.9449 25C59.1784 27.9295 59.4832 29.8216 59.4449 33C59.4089 35.9867 59.179 37.78 57.9449 40.5C56.8475 42.9185 55.8511 44.6507 53.9449 46.5C51.9236 48.4609 50.5803 49.0076 47.9449 50C45.5414 50.9051 44.0131 51 41.4449 51C38.8766 51 37.3235 50.9685 34.9449 50C32.4851 48.9985 29.4449 46 29.4449 46V51H19.4449V37.9904L22.9449 31.4226L26.9449 22.7265Z",fill:"currentColor"})]}),D("svg",{className:"absolute top-0 left-0 w-24 h-auto text-primary-500 drop-shadow-[0_0_20px_rgba(var(--primary-rgb),0.5)] transition-[clip-path] duration-100 ease-linear",style:{clipPath:o},viewBox:"0 0 60 51",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-hidden":"true",children:[x("title",{children:"Loading indicator animated fill"}),x("path",{d:"M29.4449 0H19.4449V16.5L29.4449 6.5V0Z",fill:"currentColor"}),x("path",{d:"M26.9449 22.7265C26.9449 22.5077 21.2201 27.0658 16.9449 28.5C13.7491 29.5721 12.3156 29.5038 8.94486 29.5C5.59532 29.4963 0 28.5 0 28.5C0 28.5 5.57953 28.5146 8.94486 27.5C12.5409 26.4158 14.8203 25.5843 17.9449 23.5C23.3445 19.898 29.4449 11.5 29.4449 11.5L29.9449 18C29.9449 18 33.5825 15.8308 36.4449 15C39.4452 14.1291 44.4449 14 44.4449 14C44.4449 14 36.9449 19 34.4449 21.5C31.5322 24.4126 29.8582 26.9017 29.4449 31C29.1217 34.2041 29.4771 36.4508 31.4449 39C33.5792 41.765 35.952 43.0183 39.4449 43C42.677 42.9831 45.3003 42.4182 47.4449 40C49.7406 37.4113 50.2495 34.4466 49.9449 31C49.6603 27.7804 48.4876 25.4953 45.9449 23.5C43.2931 21.4191 36.4449 24 36.4449 24L47.9449 15C47.9449 15 51.5761 16.771 53.4449 18.5C55.711 20.5967 56.7467 22.1546 57.9449 25C59.1784 27.9295 59.4832 29.8216 59.4449 33C59.4089 35.9867 59.179 37.78 57.9449 40.5C56.8475 42.9185 55.8511 44.6507 53.9449 46.5C51.9236 48.4609 50.5803 49.0076 47.9449 50C45.5414 50.9051 44.0131 51 41.4449 51C38.8766 51 37.3235 50.9685 34.9449 50C32.4851 48.9985 29.4449 46 29.4449 46V51H19.4449V37.9904L22.9449 31.4226L26.9449 22.7265Z",fill:"currentColor"})]})]})})})}import{useEffect as Be,useState as Oe}from"react";import{Sun as de,Moon as ge,Monitor as fe}from"lucide-react";import{Button as He}from"react-aria-components";import{jsx as h,jsxs as R}from"react/jsx-runtime";function he(){let{theme:e,setTheme:r}=J(),[o,t]=Oe(!1);return Be(()=>{t(!0)},[]),o?R(te,{placement:"bottom right",children:[h(He,{className:"flex h-9 w-9 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-bg-surface hover:text-text-main outline-none focus-visible:ring-2 focus-visible:ring-primary-500","aria-label":"Selection theme",children:h(e==="system"?fe:e==="dark"?ge:de,{size:20,className:"animate-in fade-in zoom-in duration-300"})}),R(re,{selectionMode:"single",selectedKeys:[e],onSelectionChange:l=>{let n=Array.from(l)[0];r(n)},children:[R(H,{id:"light",children:[h(de,{size:16}),h("span",{children:"Light"})]}),R(H,{id:"dark",children:[h(ge,{size:16}),h("span",{children:"Dark"})]}),R(H,{id:"system",children:[h(fe,{size:16}),h("span",{children:"System"})]})]})]}):h("div",{className:"h-9 w-9"})}import{useEffect as Ae,useState as De}from"react";var $e="https://api.github.com";async function be(e,r,o=$e){let t=new Headers;r&&t.append("authorization",r);let l=await(await fetch(`${o}/repos/${e}`,{headers:t})).json();return l.stargazers_count!==void 0?ze(l.stargazers_count):"0"}var ze=e=>Intl.NumberFormat("en",{notation:"compact",compactDisplay:"short"}).format(e);import{jsx as ve,jsxs as Ve}from"react/jsx-runtime";function xe({repo:e}){let[r,o]=De(null);return Ae(()=>{e&&be(e).then(t=>o(t)).catch(()=>o("0"))},[e]),Ve("a",{href:`https://github.com/${e}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-md border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-xs font-medium text-text-muted transition-all hover:bg-bg-main hover:border-border-strong hover:text-text-main",children:[ve(K,{className:"h-4 w-4"}),r&&ve("span",{className:"tabular-nums",children:r})]})}import*as _e from"lucide-react";import{jsx as T,jsxs as Ne}from"react/jsx-runtime";function ye({tabs:e,routes:r}){let{currentLocale:o}=B(),{indicatorStyle:t,tabRefs:a,activeIndex:l}=se(e,r),n=s=>{if(!s)return null;if(s.trim().startsWith("<svg"))return T("span",{className:"h-4 w-4",dangerouslySetInnerHTML:{__html:s}});let m=_e[s];return m?T(m,{size:16}):T("img",{src:s,alt:"",className:"h-4 w-4 object-contain"})};return T("div",{className:"mx-auto max-w-(--breakpoint-3xl) px-4 md:px-6",children:Ne($.TabsList,{className:"border-none py-0",children:[e.map((s,m)=>{let g=m===l,c=r.find(p=>p.tab&&p.tab.toLowerCase()===s.id.toLowerCase()),b=c?c.path:"#";return Ne(O,{href:b,ref:p=>{a.current[m]=p},className:`relative flex items-center gap-2 px-4 py-3 text-sm font-medium transition-colors outline-none ${g?"text-primary-500":"text-text-muted hover:text-text-main"}`,children:[n(s.icon),T("span",{children:oe(s.text,o)})]},s.id)}),T($.TabsIndicator,{style:t})]})})}import{Suspense as Ge,lazy as qe}from"react";import{useLocation as Ue}from"react-router-dom";import{ChevronDown as Pe,Languages as Fe}from"lucide-react";import{jsx as i,jsxs as N}from"react/jsx-runtime";var Ze=qe(()=>import("./search-dialog-MA5AISC7.mjs").then(e=>({default:e.SearchDialog})));function lr(){let{links:e,title:r,logo:o,logoProps:t,github:a,social:l,config:n}=ne(),{routes:s,allRoutes:m,currentVersion:g,currentLocale:c}=B(),{pathname:b}=Ue(),p=n.theme||{},q=p?.tabs&&p.tabs.length>0;return N(u.NavbarRoot,{className:q?"border-b-0":"",children:[N(u.Content,{children:[N(u.NavbarLeft,{children:[i(u.NavbarLogo,{src:o??"",alt:t?.alt||r,width:t?.width??24,height:t?.height??24}),i(u.Title,{children:r}),n.versions&&g&&i(Je,{}),i(u.Links,{children:e.map(E=>i(We,{link:E},E.href))})]}),i(u.NavbarCenter,{children:i(Ge,{fallback:i("div",{className:"h-9 w-32 animate-pulse rounded-md bg-bg-surface"}),children:i(Ze,{routes:s||[]})})}),N(u.NavbarRight,{children:[n.i18n&&c&&i(Ke,{}),i(u.Split,{}),i(he,{}),a&&i(xe,{repo:p?.githubRepo??""}),l.length>0&&i(u.Split,{}),i("div",{className:"flex items-center gap-1",children:l.map(({icon:E,link:U})=>i(u.Socials,{icon:E,link:U,className:"p-1.5"},U))})]})]}),b!=="/"&&q&&p?.tabs&&i("div",{className:"w-full border-b border-border-subtle bg-bg-main",children:i(ye,{tabs:p.tabs,routes:m||s||[]})})]})}function We({link:e}){let r=Z(e.href);return i(u.Link,{...e,href:r})}function Je(){let{currentVersionLabel:e,availableVersions:r,handleVersionChange:o}=ae();return r.length===0?null:N(f.Trigger,{children:[i(k,{variant:"outline",size:"sm",rounded:"lg",iconPosition:"right",icon:i(Pe,{className:"w-3.5 h-3.5 text-text-muted/60"}),className:"h-8 border-border-subtle/60 bg-bg-surface/30 backdrop-blur-sm transition-all duration-200 hover:border-primary-500/50 hover:bg-primary-500/5",children:i("span",{className:"font-semibold text-[0.8125rem]",children:e})}),i(f.Root,{children:i(f.Section,{items:r,children:t=>i(f.Item,{onPress:()=>o(t.value),children:t.label},`${t.value??""}`)})})]})}function Ke(){let{currentLocale:e,availableLocales:r,handleLocaleChange:o}=ie();return r.length===0?null:N(f.Trigger,{children:[i(k,{variant:"outline",size:"sm",rounded:"lg",iconPosition:"right",icon:i(Pe,{className:"w-3.5 h-3.5 text-text-muted/60"}),className:"h-8 border-border-subtle/60 bg-bg-surface/30 backdrop-blur-sm transition-all duration-200 hover:border-primary-500/50 hover:bg-primary-500/5 px-2.5",children:N("div",{className:"flex items-center gap-1.5",children:[i(Fe,{className:"w-3.5 h-3.5 text-primary-500"}),i("span",{className:"font-bold text-[0.75rem] tracking-wider uppercase opacity-90",children:e||"en"})]})}),i(f.Root,{children:i(f.Section,{items:r,children:t=>i(f.Item,{onPress:()=>o(t.value),children:N("div",{className:"flex items-center justify-between w-full gap-4",children:[i("span",{children:t.label}),i("span",{className:"text-[10px] font-bold opacity-40 uppercase tracking-tighter",children:t.value})]})},`${t.value??""}`)})})]})}import{Zap as Ye}from"lucide-react";import{jsx as V,jsxs as Ce}from"react/jsx-runtime";function Le(){return V("div",{className:"flex items-center justify-center mt-10 mb-4 px-4 w-full",children:Ce("a",{href:"https://github.com/jesusalcaladev/boltdocs",target:"_blank",rel:"noopener noreferrer",className:"group relative flex items-center gap-2 px-4 py-2 rounded-full border border-border-subtle bg-bg-surface/50 backdrop-blur-md transition-all duration-300 hover:border-primary-500/50 hover:bg-bg-surface hover:shadow-xl hover:shadow-primary-500/5 select-none",children:[V(Ye,{className:"w-3.5 h-3.5 text-text-muted group-hover:text-primary-500 transition-colors duration-300",fill:"currentColor"}),Ce("span",{className:"text-[11px] font-medium text-text-muted group-hover:text-text-main transition-colors duration-300 tracking-wide",children:["Powered by ",V("strong",{className:"font-bold text-text-main/80 group-hover:text-text-main",children:"Boltdocs"})]})]})})}import{useState as Qe,useEffect as Xe,useMemo as je}from"react";import*as et from"lucide-react";import{jsx as P,jsxs as rt}from"react/jsx-runtime";function we(e){return e&&et[e]||void 0}function tt({group:e,activePath:r,getIcon:o}){let t=je(()=>e.routes.some(n=>n.path===r),[e.routes,r]),[a,l]=Qe(!0);return Xe(()=>{t&&l(!0)},[t]),P(w.SidebarGroup,{title:e.title,isOpen:a,onToggle:()=>l(!a),children:e.routes.map(n=>{let s=r===(n.path.endsWith("/")?n.path.slice(0,-1):n.path);return P(w.SidebarLink,{label:n.title,href:n.path,active:s,icon:o(n.icon),badge:n.badge},n.path)})})}function vr({routes:e,config:r}){let{groups:o,ungrouped:t,activePath:a}=le(e),l=r.theme||{};return rt(w.SidebarRoot,{children:[t.length>0&&P(w.SidebarGroup,{className:"mb-6",children:t.map(n=>{let s=a===(n.path.endsWith("/")?n.path.slice(0,-1):n.path);return P(w.SidebarLink,{label:n.title,href:n.path,active:s,icon:we(n.icon),badge:n.badge},n.path)})}),o.map(n=>P(tt,{group:n,activePath:a,getIcon:we},n.slug)),l?.poweredBy&&P("div",{className:"mt-auto pt-8",children:P(Le,{})})]})}import ot,{useRef as Te,useEffect as nt,useState as at,useCallback as it}from"react";import{Pencil as st,CircleHelp as lt,TextAlignStart as mt}from"lucide-react";import{jsx as d,jsxs as C}from"react/jsx-runtime";function wr({headings:e=[],editLink:r,communityHelp:o,filePath:t}){let{headings:a}=me(e),l=ot.useMemo(()=>a.map(n=>({title:n.text,url:`#${n.id}`,depth:n.level})),[a]);return a.length===0?null:d(X,{toc:l,children:d(ct,{headings:a,editLink:r,communityHelp:o,filePath:t})})}function ct({headings:e,editLink:r,communityHelp:o,filePath:t}){let a=Y(),[l,n]=at({opacity:0}),s=Te(null),m=Te(null);nt(()=>{if(!a||!s.current)return;let c=s.current.querySelector(`a[href="#${a}"]`);c&&n({transform:`translateY(${c.offsetTop}px)`,height:`${c.offsetHeight}px`,opacity:1})},[a]);let g=it((c,b)=>{c.preventDefault();let p=document.getElementById(b);p&&(p.scrollIntoView({behavior:"smooth"}),window.history.pushState(null,"",`#${b}`))},[]);return C(y.OnThisPageRoot,{children:[C(y.OnThisPageHeader,{className:"flex flex-row gap-x-2",children:[d(mt,{size:16}),"On this page"]}),d(Q,{containerRef:m,children:C(y.OnThisPageContent,{className:"max-h-[450px] boltdocs-otp-scroll-area",ref:m,children:[d(y.OnThisPageIndicator,{style:l}),d("ul",{className:"relative space-y-2 border-l border-border-subtle",ref:s,children:e.map(c=>d(y.OnThisPageItem,{level:c.level,children:d(y.OnThisPageLink,{href:`#${c.id}`,active:a===c.id,onClick:b=>g(b,c.id),className:"pl-4",children:c.text})},c.id))})]})}),(r||o)&&C("div",{className:"mt-8 pt-8 border-t border-border-subtle space-y-4",children:[d("p",{className:"text-xs font-bold uppercase tracking-wider text-text-main",children:"Need help?"}),C("ul",{className:"space-y-3",children:[r&&t&&d("li",{children:C("a",{href:r.replace(":path",t),target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-text-muted hover:text-text-main transition-colors",children:[d(st,{size:16}),"Edit this page"]})}),o&&d("li",{children:C("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-text-muted hover:text-text-main transition-colors",children:[d(lt,{size:16}),"Community help"]})})]})]})]})}import{useEffect as pt}from"react";import{useLocation as ut}from"react-router-dom";function Ir({siteTitle:e,siteDescription:r,routes:o}){let t=ut();return pt(()=>{let a=o.find(g=>g.path===t.pathname),l=a?.title,n=a?.description||r||"";document.title=l?`${l} | ${e}`:e;let s=document.querySelector('meta[name="description"]');s||(s=document.createElement("meta"),s.name="description",document.head.appendChild(s)),s.content=n,L("property","og:title",document.title),L("property","og:description",n),L("property","og:type","article"),L("property","og:url",window.location.href),L("name","twitter:card","summary"),L("name","twitter:title",document.title),L("name","twitter:description",n);let m=document.querySelector('link[rel="canonical"]');m||(m=document.createElement("link"),m.rel="canonical",document.head.appendChild(m)),m.href=window.location.origin+t.pathname},[t.pathname,e,r,o]),null}function L(e,r,o){let t=document.querySelector(`meta[${e}="${r}"]`);t||(t=document.createElement("meta"),t.setAttribute(e,r),document.head.appendChild(t)),t.content=o}import{Home as dt}from"lucide-react";import{jsx as I,jsxs as ke}from"react/jsx-runtime";function zr(){let{crumbs:e,activeRoute:r}=ce(),t=F().theme||{};return e.length===0||!t?.breadcrumbs?null:ke(j,{children:[I(z,{children:I(A,{href:"/",children:I(dt,{size:14})})}),e.map((a,l)=>ke(z,{children:[I(ee,{}),I(A,{href:a.href,className:W({"font-medium text-text-main":a.href===r?.path}),children:a.label})]},`crumb-${a.href}-${a.label}-${l}`))]})}import{jsx as M,jsxs as _}from"react/jsx-runtime";function Gr(){let{prevPage:e,nextPage:r}=pe();return!e&&!r?null:_(v.PageNavRoot,{children:[e?_(v.PageNavLink,{to:e.path,direction:"prev",children:[M(v.PageNavLink.Title,{children:"Previous"}),M(v.PageNavLink.Description,{children:e.title})]}):M("div",{}),r&&_(v.PageNavLink,{to:r.path,direction:"next",children:[M(v.PageNavLink.Title,{children:"Next"}),M(v.PageNavLink.Description,{children:r.title})]})]})}import{useEffect as gt,useState as ft}from"react";import{ProgressBar as ht}from"react-aria-components";import{jsx as Se}from"react/jsx-runtime";function Wr(){let[e,r]=ft(0);return gt(()=>{let o=null,t,a=()=>{if(!o)return;let{scrollTop:n,scrollHeight:s,clientHeight:m}=o;if(s<=m){r(0);return}let g=n/(s-m)*100;r(Math.min(100,Math.max(0,g)))},l=()=>(o=document.querySelector(".boltdocs-content"),o?(o.addEventListener("scroll",a),a(),t&&clearInterval(t),!0):!1);return l()||(t=setInterval(l,100)),()=>{o&&o.removeEventListener("scroll",a),t&&clearInterval(t)}},[]),Se(ht,{value:e,"aria-label":"Reading progress",className:"fixed top-0 left-0 right-0 z-999 h-0.5 bg-transparent w-full pointer-events-none",children:({percentage:o})=>Se("div",{className:"h-full bg-primary-500 transition-[width] duration-300 ease-out shadow-[0_0_8px_rgba(var(--primary-rgb),0.4)]",style:{width:`${o}%`}})})}import{Component as bt}from"react";import{jsx as G,jsxs as vt}from"react/jsx-runtime";var Re=class extends bt{state={hasError:!1};static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,o){console.error("Uncaught error in Boltdocs Layout:",r,o)}render(){return this.state.hasError?this.props.fallback||vt("div",{className:"flex flex-col items-center justify-center min-h-[40vh] text-center gap-4 px-4",children:[G("div",{className:"text-lg font-bold text-red-400",children:"Something went wrong"}),G("p",{className:"text-sm text-text-muted max-w-md",children:this.state.error?.message||"An unexpected error occurred while rendering this page."}),G(k,{className:"rounded-lg border border-border-subtle bg-bg-surface px-5 py-2 text-sm font-medium text-text-main transition-colors hover:bg-bg-muted cursor-pointer",onPress:()=>this.setState({hasError:!1}),children:"Try again"})]}):this.props.children}};export{yt as a,wt as b,he as c,xe as d,ye as e,lr as f,Le as g,vr as h,wr as i,Ir as j,zr as k,Gr as l,Wr as m,Re as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f}from"./chunk-JXHNX2WN.mjs";import{A as u,B as m,C as S,D as d,E as p,F as y,G as D,y as g,z as h}from"./chunk-ZRJ55GGF.mjs";import{useEffect as K,useCallback as M}from"react";import{useNavigate as R}from"react-router-dom";import{Fragment as T,jsx as o,jsxs as n}from"react/jsx-runtime";function A({routes:v}){let{isOpen:I,setIsOpen:a,query:w,setQuery:k,list:E}=f(v),r=R();K(()=>{let e=t=>{(/Mac/.test(navigator.userAgent)?t.metaKey:t.ctrlKey)&&(t.key==="k"||t.key==="j")&&(t.preventDefault(),a(i=>!i))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[a]);let l=M(e=>{let t=String(e);if(a(!1),t.includes("#")){let[s,c]=t.split("#");r(s),setTimeout(()=>{let i=document.getElementById(c);i&&i.scrollIntoView({behavior:"smooth"})},100)}else r(t)},[r,a]);return n(T,{children:[o(g.SearchTrigger,{onPress:()=>a(!0)}),o(h,{isOpen:I,onOpenChange:a,children:n(u,{onSelectionChange:l,children:[o(m,{value:w,onChange:e=>k(e.target.value)}),o(S,{items:E,children:e=>n(d,{onPress:()=>l(e.id),textValue:e.title,children:[o(p,{isHeading:e.isHeading}),n("div",{className:"flex flex-col justify-center gap-0.5",children:[o(y,{children:e.title}),o(D,{children:e.groupTitle})]})]},e.id)})]})})]})}export{A as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as v,use as k,useEffect as l,useState as a}from"react";import{jsx as y}from"react/jsx-runtime";var u=v(void 0);function C({children:o}){let[r,d]=a("system"),[T,m]=a("dark"),[i,g]=a(!1);l(()=>{g(!0);let e=localStorage.getItem("boltdocs-theme"),s=e==="light"||e==="dark"||e==="system"?e:"system";d(s);let t=window.matchMedia("(prefers-color-scheme: dark)");((h,n)=>{m(h==="system"?n?"dark":"light":h)})(s,t.matches);let c=h=>{m(n=>(localStorage.getItem("boltdocs-theme")||"system")==="system"?h.matches?"dark":"light":n)};return t.addEventListener("change",c),()=>t.removeEventListener("change",c)},[]),l(()=>{if(!i)return;let e=window.matchMedia("(prefers-color-scheme: dark)").matches,s=r==="system"?e?"dark":"light":r;m(s);let t=document.documentElement;s==="light"?(t.classList.add("theme-light"),t.dataset.theme="light"):(t.classList.remove("theme-light"),t.dataset.theme="dark")},[r,i]);let f=e=>{d(e),localStorage.setItem("boltdocs-theme",e)};return y(u.Provider,{value:{theme:r,resolvedTheme:T,setTheme:f},children:o})}function E(){let o=k(u);if(o===void 0)throw new Error("useTheme must be used within a ThemeProvider");return o}export{C as a,E as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as c}from"./chunk-NBCYHLAA.mjs";import{useState as h,useMemo as C}from"react";function b(a){let{currentLocale:o,currentVersion:s}=c(),[d,g]=h(!1),[i,u]=h(""),f=C(()=>{let n=a.filter(t=>{let e=!o||t.locale===o,m=!s||t.version===s;return e&&m});if(!i)return n.slice(0,10).map(t=>({id:t.path,title:t.title,path:t.path,bio:t.description||"",groupTitle:t.groupTitle}));let r=[],l=i.toLowerCase();for(let t of n)if(t.title?.toLowerCase().includes(l)&&r.push({id:t.path,title:t.title,path:t.path,bio:t.description||"",groupTitle:t.groupTitle}),t.headings)for(let e of t.headings)e.text.toLowerCase().includes(l)&&r.push({id:`${t.path}#${e.id}`,title:e.text,path:`${t.path}#${e.id}`,bio:`Heading in ${t.title}`,groupTitle:t.title,isHeading:!0});let p=new Set;return r.filter(t=>p.has(t.path)?!1:(p.add(t.path),!0)).slice(0,10)},[a,i,o,s]);return{isOpen:d,setIsOpen:g,query:i,setQuery:u,list:f,input:{value:i,onChange:n=>u(n.target.value)}}}export{b as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=Object.defineProperty;var e=(c,a)=>{for(var b in a)d(c,b,{get:a[b],enumerable:!0})};export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as se}from"./chunk-ZK2266IZ.mjs";import{b as ee}from"./chunk-JD3RSDE4.mjs";import{b as oe}from"./chunk-T3W44KWY.mjs";import{a,b as Q,d as te,e as re,g as ne,h as $}from"./chunk-ZRJ55GGF.mjs";import{b as F}from"./chunk-NBCYHLAA.mjs";import{a as Ue}from"./chunk-JZXLCA2E.mjs";var nr={};Ue(nr,{Admonition:()=>P,Badge:()=>ye,Button:()=>ae,Card:()=>Re,Cards:()=>Ne,Caution:()=>Ve,CodeBlock:()=>L,ComponentPreview:()=>Ke,ComponentProps:()=>qe,CopyMarkdown:()=>se,Danger:()=>Ee,Field:()=>We,FileTree:()=>Me,Image:()=>_e,Important:()=>Ie,InfoBox:()=>Le,Link:()=>$e,List:()=>Se,Note:()=>we,Tab:()=>be,Table:()=>Oe,Tabs:()=>fe,Tip:()=>Te,Video:()=>ge,Warning:()=>Ae});import{jsx as je}from"react/jsx-runtime";var ae=({className:e,variant:t,size:r,rounded:o,iconSize:n,disabled:s,...u})=>je(re,{className:a("group",te({variant:t,size:r,rounded:o,iconSize:n,disabled:s,className:e})),...u});import*as O from"react-aria-components";import{Copy as Je,Check as Qe}from"lucide-react";var ie=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement("textarea");return t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),!0}};import{useCallback as le,useEffect as Ye,useRef as Ze,useState as _}from"react";function de(e){let{title:t,sandbox:r}=e,[o,n]=_(!1),[s,u]=_(!1),[p,c]=_(!1),l=Ze(null),i=F(),d=le(async()=>{let b=l.current?.textContent??"";ie(b),n(!0),setTimeout(()=>n(!1),2e3)},[]),m=le(()=>{let b=l.current?.textContent??"",v=i?.integrations?.sandbox?.config||{},x=typeof r=="object"?r:v,C=x.entry||"src/App.tsx";oe({title:t??"Code Snippet",...x,files:{...x.files,[C]:{content:b}}})},[t,i,r]);return Ye(()=>{let b=l.current?.textContent?.length??0;c(b>120)},[e.children,e.highlightedHtml]),{copied:o,isExpanded:s,setIsExpanded:u,isExpandable:p,preRef:l,handleCopy:d,handleSandbox:m,shouldTruncate:p&&!s}}import{jsx as N,jsxs as ce}from"react/jsx-runtime";function L(e){let{children:t,sandbox:r,hideSandbox:o=!0,hideCopy:n=!1,highlightedHtml:s,...u}=e,l=!!F()?.integrations?.sandbox?.enable&&!o,{copied:i,isExpanded:d,setIsExpanded:m,isExpandable:b,preRef:v,handleCopy:x,handleSandbox:C,shouldTruncate:A}=de(e);return ce("div",{className:a("group relative my-6 overflow-hidden rounded-lg border border-border-subtle bg-(--color-code-bg)",A&&"[&>pre]:max-h-[250px] [&>pre]:overflow-hidden"),children:[ce("div",{className:"absolute top-3 right-4 z-50 flex items-center gap-2 transition-all duration-300 opacity-0 group-hover:opacity-100",children:[l&&N($,{content:"Open in CodeSandbox",children:N(O.Button,{onPress:C,className:"grid place-items-center w-8 h-8 bg-transparent text-text-muted outline-none cursor-pointer transition-all duration-200 hover:scale-115 hover:text-sky-400 active:scale-95 [&>svg]:w-5 [&>svg]:h-5 [&>svg]:stroke-2","aria-label":"Open in CodeSandbox",children:N(ne,{size:20})})}),!n&&N($,{content:i?"Copied!":"Copy code",children:N(O.Button,{onPress:x,className:a("grid place-items-center w-8 h-8 bg-transparent outline-none cursor-pointer transition-all duration-200 hover:scale-115 active:scale-95 [&>svg]:w-5 [&>svg]:h-5 [&>svg]:stroke-2",i?"text-emerald-400":"text-text-muted hover:text-text-main"),"aria-label":"Copy code",children:i?N(Qe,{size:20}):N(Je,{size:20})})})]}),s?N("div",{ref:v,className:"shiki-wrapper [&>pre]:m-0! [&>pre]:rounded-none! [&>pre]:border-none! [&>pre]:bg-inherit! [&>pre>code]:grid! [&>pre>code]:p-5! [&>.shiki.shiki-themes]:bg-transparent!",dangerouslySetInnerHTML:{__html:s}}):N("pre",{ref:v,className:"m-0! rounded-none! border-none! bg-inherit! font-mono text-[0.8125rem] leading-[1.7]",...u,children:t}),b&&N("div",{className:a(A?"absolute bottom-0 inset-x-0 h-24 bg-linear-to-t from-(--color-code-bg) to-transparent flex items-end justify-center pb-4 z-10":"relative flex justify-center py-4"),children:N(O.Button,{onPress:()=>m(!d),className:"rounded-full bg-bg-surface border border-border-subtle px-5 py-2 text-[0.8125rem] font-medium text-text-main outline-none cursor-pointer transition-all hover:bg-border-subtle hover:-translate-y-px backdrop-blur-md",children:d?"Show less":"Expand code"})})]})}import{Children as ot,isValidElement as nt,useMemo as st}from"react";import*as w from"react-aria-components";import{useState as pe,useRef as et,useEffect as tt,useCallback as rt}from"react";function me({initialIndex:e=0,tabs:t}){let r=t[e]?.props.disabled?t.findIndex(l=>!l.props.disabled):e,[o,n]=pe(r===-1?0:r),s=et([]),[u,p]=pe({opacity:0,transform:"translateX(0)",width:0});tt(()=>{let l=s.current[o];l&&p({opacity:1,width:l.offsetWidth,transform:`translateX(${l.offsetLeft}px)`})},[o,t]);let c=rt(l=>{let i=0;if(l.key==="ArrowRight"?i=1:l.key==="ArrowLeft"&&(i=-1),i!==0){let d=(o+i+t.length)%t.length;for(;t[d].props.disabled&&d!==o;)d=(d+i+t.length)%t.length;d!==o&&!t[d].props.disabled&&(n(d),s.current[d]?.focus())}},[o,t]);return{active:o,setActive:n,tabRefs:s,indicatorStyle:u,handleKeyDown:c}}import{cva as ue}from"class-variance-authority";import{jsx as k,jsxs as q}from"react/jsx-runtime";var at=ue("relative flex items-center border-b border-border-subtle gap-1 overflow-x-auto no-scrollbar",{variants:{size:{default:"px-0",compact:"px-2"}},defaultVariants:{size:"default"}}),it=ue("flex items-center gap-2 px-4 py-2.5 text-sm font-medium outline-none transition-all duration-200 cursor-pointer bg-transparent border-none select-none whitespace-nowrap",{variants:{isActive:{true:"text-primary-500",false:"text-text-muted hover:text-text-main"},isDisabled:{true:"opacity-40 pointer-events-none",false:""}},defaultVariants:{isActive:!1,isDisabled:!1}});function be({children:e}){let t=typeof e=="string"?k(L,{className:"language-bash",children:k("code",{children:e.trim()})}):e;return k("div",{className:"py-4",children:t})}function fe({defaultIndex:e=0,children:t}){let r=st(()=>ot.toArray(t).filter(p=>nt(p)&&p.props?.label),[t]),{active:o,setActive:n,tabRefs:s,indicatorStyle:u}=me({initialIndex:e,tabs:r});return k("div",{className:"my-8 w-full group/tabs",children:q(w.Tabs,{selectedKey:o.toString(),onSelectionChange:p=>n(Number(p)),className:"w-full",children:[q(w.TabList,{"aria-label":"Content Tabs",className:a(at()),children:[r.map((p,c)=>{let{label:l,icon:i,disabled:d}=p.props,m=c.toString();return q(w.Tab,{id:m,isDisabled:d,ref:b=>{s.current[c]=b},className:({isSelected:b,isDisabled:v})=>a(it({isActive:b,isDisabled:v})),children:[!!i&&k("span",{className:"shrink-0 [&>svg]:w-4 [&>svg]:h-4",children:i}),k("span",{children:l})]},m)}),k("div",{className:"absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300 ease-in-out pointer-events-none",style:u,"aria-hidden":"true"})]}),r.map((p,c)=>k(w.TabPanel,{id:c.toString(),children:r[c]},c))]})})}import{useRef as lt,useState as dt,useEffect as ct}from"react";import{jsx as xe,jsxs as pt}from"react/jsx-runtime";function ge({src:e,poster:t,alt:r,children:o,controls:n,preload:s="metadata",...u}){let p=lt(null),[c,l]=dt(!1);return ct(()=>{let i=p.current;if(!i)return;let d=new IntersectionObserver(([m])=>{m.isIntersecting&&(l(!0),d.disconnect())},{rootMargin:"200px"});return d.observe(i),()=>d.disconnect()},[]),xe("div",{ref:p,className:"my-6 overflow-hidden rounded-lg border border-border-subtle",children:c?pt("video",{className:"block w-full h-auto",src:e,poster:t,controls:!0,preload:s,playsInline:!0,...u,children:[o,"Your browser does not support the video tag."]}):xe("div",{className:"aspect-video bg-bg-surface animate-pulse",role:"img","aria-label":r||"Video"})})}import{cva as mt}from"class-variance-authority";import{jsx as bt}from"react/jsx-runtime";var ut=mt("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold tracking-tight",{variants:{variant:{default:"bg-bg-surface text-text-muted border-border-subtle",primary:"bg-primary-500/15 text-primary-400 border-primary-500/20",success:"bg-emerald-500/15 text-emerald-400 border-emerald-500/20",warning:"bg-amber-500/15 text-amber-400 border-amber-500/20",danger:"bg-red-500/15 text-red-400 border-red-500/20",info:"bg-sky-500/15 text-sky-400 border-sky-500/20"}},defaultVariants:{variant:"default"}});function ye({variant:e="default",children:t,className:r="",...o}){return bt("span",{className:a(ut({variant:e}),r),...o,children:t})}import{useCallback as ft,useRef as he}from"react";import*as Ce from"react-aria-components";import{cva as xt}from"class-variance-authority";import{Fragment as yt,jsx as E,jsxs as ve}from"react/jsx-runtime";var gt=xt("grid gap-4 my-6",{variants:{cols:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"}},defaultVariants:{cols:3}});function Ne({cols:e=3,children:t,className:r="",...o}){return E("div",{className:a(gt({cols:e}),r),...o,children:t})}function Re({title:e,icon:t,href:r,children:o,className:n="",...s}){let u=he(null),p=he(null),c=ft(d=>{let m=u.current||p.current;if(!m)return;let{left:b,top:v}=m.getBoundingClientRect();m.style.setProperty("--x",`${d.clientX-b}px`),m.style.setProperty("--y",`${d.clientY-v}px`)},[]),l=ve(yt,{children:[E("div",{className:"pointer-events-none absolute -inset-px rounded-xl opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"radial-gradient(400px circle at var(--x) var(--y), color-mix(in oklch, var(--color-primary-500), transparent 90%), transparent 80%)"}}),t&&E("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-primary-500/10 text-primary-400 text-lg transition-transform duration-300 group-hover:scale-105 group-hover:-rotate-3",children:t}),ve("div",{className:"space-y-1.5",children:[e&&E("h3",{className:"text-sm font-bold text-text-main",children:e}),o&&E("div",{className:"text-sm text-text-muted leading-relaxed",children:o})]})]}),i=a("group relative block rounded-xl border border-border-subtle bg-bg-surface p-5 outline-none overflow-hidden","transition-all duration-200 hover:border-primary-500/40 hover:shadow-lg hover:shadow-primary-500/5","focus-visible:ring-2 focus-visible:ring-primary-500/30",n);return r?E(Ce.Link,{ref:p,href:r,className:a(i,"no-underline cursor-pointer"),onMouseMove:c,...s,children:l}):E("div",{ref:u,role:"presentation",className:i,onMouseMove:c,...s,children:l})}import{Info as ht,Lightbulb as vt,AlertTriangle as Ct,ShieldAlert as Nt,Bookmark as Rt,Zap as Pt,Flame as kt}from"lucide-react";import{cva as wt}from"class-variance-authority";import{jsx as g,jsxs as ke}from"react/jsx-runtime";var Tt={note:g(Rt,{size:18}),tip:g(vt,{size:18}),info:g(ht,{size:18}),warning:g(Ct,{size:18}),danger:g(Nt,{size:18}),important:g(kt,{size:18}),caution:g(Pt,{size:18})},At={note:"Note",tip:"Tip",info:"Info",warning:"Warning",danger:"Danger",important:"Important",caution:"Caution"},Pe=wt("py-4 px-4 rounded-lg",{variants:{type:{note:"border-primary-400 bg-primary-500/5 text-primary-400",tip:"border-emerald-500 bg-emerald-500/5 text-emerald-500",info:"border-sky-500 bg-sky-500/5 text-sky-500",warning:"border-amber-500 bg-amber-500/5 text-amber-500",danger:"border-red-500 bg-red-500/5 text-red-500",important:"border-orange-500 bg-orange-500/5 text-orange-500",caution:"border-yellow-500 bg-yellow-500/5 text-yellow-500"}},defaultVariants:{type:"note"}});function P({type:e="note",title:t,children:r,className:o="",...n}){return ke("div",{className:a(Pe({type:e}),o),role:e==="warning"||e==="danger"?"alert":"note",...n,children:[ke("div",{className:"flex items-center flex-row gap-2 mb-2",children:[g("span",{className:a("shrink-0",Pe({type:e})),children:Tt[e]}),g("span",{className:"text-sm font-bold tracking-tight text-text-main",children:t||At[e]})]}),g("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 [&>p]:mb-2 [&>p:last-child]:mb-0",children:r})]})}var we=e=>g(P,{type:"note",...e}),Te=e=>g(P,{type:"tip",...e}),Ae=e=>g(P,{type:"warning",...e}),Ee=e=>g(P,{type:"danger",...e}),Le=e=>g(P,{type:"info",...e}),Ie=e=>g(P,{type:"important",...e}),Ve=e=>g(P,{type:"caution",...e});import{Children as Et,isValidElement as Lt}from"react";import{Check as It,ChevronRight as Vt,Circle as St}from"lucide-react";import{cva as G}from"class-variance-authority";import{jsx as T,jsxs as Ft}from"react/jsx-runtime";var Bt=G("my-6 transition-all duration-200",{variants:{variant:{default:"list-disc pl-5 text-text-muted marker:text-primary-500/50",number:"list-decimal pl-5 text-text-muted marker:text-primary-500/50 marker:font-bold",checked:"list-none p-0",arrow:"list-none p-0",bubble:"list-none p-0"},cols:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"},isGrid:{true:"grid gap-x-8 gap-y-3",false:"space-y-2"},dense:{true:"space-y-1",false:"space-y-2"}},compoundVariants:[{variant:"default",dense:!0,className:"space-y-0.5"}],defaultVariants:{variant:"default",cols:1,isGrid:!1,dense:!1}}),Mt=G("group flex items-start gap-3 text-sm leading-relaxed transition-all duration-200",{variants:{variant:{default:"",number:"",checked:"hover:translate-x-0.5",arrow:"hover:translate-x-0.5",bubble:"hover:translate-x-0.5"},dense:{true:"py-0",false:"py-0.5"}},defaultVariants:{variant:"default",dense:!1}}),Dt=G("mt-1 shrink-0 flex items-center justify-center transition-transform group-hover:scale-110",{variants:{variant:{bubble:"h-5 w-5 rounded-full bg-primary-500/10 text-primary-500 text-[10px] font-bold",default:""}},defaultVariants:{variant:"default"}});function zt({icon:e,children:t,variant:r,dense:o}){return Ft("li",{className:a(Mt({variant:r,dense:o})),children:[e&&T("span",{className:a(Dt({variant:r==="bubble"?"bubble":"default"})),children:e}),T("div",{className:"flex-1 text-text-muted group-hover:text-text-main transition-colors",children:t})]})}var Ht={checked:e=>T(It,{size:14,className:a("text-emerald-500 shrink-0",e)}),arrow:e=>T(Vt,{size:14,className:a("text-primary-400 shrink-0",e)}),bubble:e=>T(St,{size:6,fill:"currentColor",className:a("text-primary-500 shrink-0",e)}),default:()=>null,number:()=>null};function Se({variant:e="default",cols:t=1,dense:r=!1,children:o,className:n,...s}){let u=t!==void 0&&Number(t)>1,p=Ht[e],c=Bt({variant:e,cols:t,dense:r,isGrid:u,className:n}),l=e==="number"?"ol":"ul";return e==="default"||e==="number"?T(l,{className:c,...s,children:o}):T("ul",{className:c,...s,children:Et.map(o,i=>{if(!Lt(i))return i;let d=i,m=d.type==="li"?d.props.children:d.props.children||i;return T(zt,{icon:p(),variant:e,dense:r,children:m})})})}import{Children as X,isValidElement as Z,useMemo as Ot}from"react";import*as R from"react-aria-components";import{Folder as Wt,FileText as $t,File as _t,FileCode as qt,FileImage as Gt,ChevronRight as Xt}from"lucide-react";import{jsx as y,jsxs as j}from"react/jsx-runtime";var S=16,B=2,K={CODE:/\.(ts|tsx|js|jsx|json|mjs|cjs|astro|vue|svelte)$/i,TEXT:/\.(md|mdx|txt)$/i,IMAGE:/\.(png|jpg|jpeg|svg|gif)$/i};function Y(e){return typeof e=="string"?e:typeof e=="number"?e.toString():Array.isArray(e)?e.map(Y).join(""):Z(e)&&e.props&&typeof e.props=="object"&&"children"in e.props?Y(e.props.children):""}function Kt(e,t){let r=e.toLowerCase(),o="shrink-0 transition-colors duration-200";if(t)return y(Wt,{size:S,strokeWidth:B,className:a(o,"text-primary-400"),fill:"currentColor",fillOpacity:.15});let n=a(o,"text-text-dim group-hover:text-text-main");return K.CODE.test(r)?y(qt,{size:S,strokeWidth:B,className:n}):K.TEXT.test(r)?y($t,{size:S,strokeWidth:B,className:n}):K.IMAGE.test(r)?y(Gt,{size:S,strokeWidth:B,className:n}):y(_t,{size:S,strokeWidth:B,className:n})}function U(e,t){if(!Z(e))return!1;let r=e.type;if(typeof r=="string")return r===t;if(typeof r=="function")return r.name===t||r.name?.toLowerCase()===t;let o=e.props;return o?.originalType===t||o?.mdxType===t}function Ut(e){let t=e.match(/\s+(\/\/|#)\s+(.*)$/);return t?{name:e.slice(0,t.index).trim(),comment:t[2]}:{name:e.trim()}}function W(e,t="root"){if(!Z(e))return[];let r=[];if(U(e,"ul"))return X.forEach(e.props.children,(o,n)=>{r.push(...W(o,`${t}-${n}`))}),r;if(U(e,"li")){let o=X.toArray(e.props.children),n=o.findIndex(v=>U(v,"ul")),s=n!==-1,u=s?o.slice(0,n):o,p=s?o.slice(n):[],c=Y(u),{name:l,comment:i}=Ut(c),d=l.endsWith("/"),m=d?l.slice(0,-1):l,b=s||d;return r.push({id:`${t}-${m}`,name:m,comment:i,isFolder:b,children:s?W(p[0],`${t}-${m}`):void 0}),r}return e.props&&typeof e.props=="object"&&"children"in e.props&&X.forEach(e.props.children,(o,n)=>{r.push(...W(o,`${t}-${n}`))}),r}function Be({item:e}){return j(R.TreeItem,{id:e.id,textValue:e.name,className:"outline-none group focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md",children:[y(R.TreeItemContent,{children:({isExpanded:t,hasChildItems:r})=>j("div",{className:"flex items-center gap-2 py-1 px-1.5 rounded-md transition-colors hover:bg-primary-500/5 cursor-pointer",children:[y("div",{style:{width:"calc((var(--tree-item-level) - 1) * 1rem)"},className:"shrink-0"}),r?y(R.Button,{slot:"chevron",className:"outline-none text-text-dim hover:text-primary-400 p-0.5 rounded transition-colors",children:y(Xt,{size:14,strokeWidth:3,className:a("transition-transform duration-200",t&&"rotate-90")})}):y("div",{className:"w-[18px]"}),Kt(e.name,e.isFolder),y("span",{className:a("text-sm transition-colors truncate select-none",e.isFolder?"font-semibold text-text-main":"text-text-muted group-hover:text-text-main"),children:e.name}),e.comment&&j("span",{className:"ml-2 text-xs italic text-text-dim opacity-70 group-hover:opacity-100 transition-opacity whitespace-nowrap overflow-hidden text-ellipsis font-sans",children:["//"," ",e.comment]})]})}),e.children&&y(R.Collection,{items:e.children,children:t=>y(Be,{item:t})})]})}function Me({children:e}){let t=Ot(()=>W(e),[e]);return y("div",{className:"my-8",children:y(R.Tree,{items:t,"aria-label":"File Tree",className:a("rounded-xl border border-border-subtle bg-bg-surface/50 p-4 font-mono text-sm shadow-sm backdrop-blur-sm outline-none","max-h-[500px] overflow-y-auto scrollbar-thin scrollbar-thumb-border-subtle","focus-visible:ring-2 focus-visible:ring-primary-500/20"),children:r=>y(Be,{item:r})})})}import*as M from"react-aria-components";import{useState as De,useMemo as ze}from"react";function He({data:e,sortable:t=!1,paginated:r=!1,pageSize:o=10}){let[n,s]=De(null),[u,p]=De(1),c=ze(()=>{if(!e)return[];let m=[...e];return t&&n!==null&&m.sort((b,v)=>{let x=b[n.key],C=v[n.key],A=typeof x=="string"?x:"",H=typeof C=="string"?C:"";return A<H?n.direction==="asc"?-1:1:A>H?n.direction==="asc"?1:-1:0}),m},[e,n,t]),l=Math.ceil(c.length/o),i=ze(()=>{if(!r)return c;let m=(u-1)*o;return c.slice(m,m+o)},[c,r,u,o]);return{sortConfig:n,currentPage:u,setCurrentPage:p,totalPages:l,paginatedData:i,requestSort:m=>{if(!t)return;let b="asc";n&&n.key===m&&n.direction==="asc"&&(b="desc"),s({key:m,direction:b})}}}import{ChevronUp as jt,ChevronDown as Fe,ChevronLeft as Yt,ChevronRight as Zt,ChevronsLeft as Jt,ChevronsRight as Qt}from"lucide-react";import{Fragment as er,jsx as f,jsxs as I}from"react/jsx-runtime";function Oe({headers:e,data:t,children:r,className:o="",sortable:n=!1,paginated:s=!1,pageSize:u=10}){let{sortConfig:p,currentPage:c,setCurrentPage:l,totalPages:i,paginatedData:d,requestSort:m}=He({data:t,sortable:n,paginated:s,pageSize:u}),b=x=>n?p?.key!==x?f(Fe,{size:14,className:"ml-1 opacity-30"}):p.direction==="asc"?f(jt,{size:14,className:"ml-1 text-primary-400"}):f(Fe,{size:14,className:"ml-1 text-primary-400"}):null,v=r||I(er,{children:[e&&f("thead",{children:f("tr",{children:e.map((x,C)=>f("th",{onClick:()=>m(C),className:a("text-left px-3 py-2.5 border-b-2 border-border-subtle text-text-main font-semibold text-sm",n&&"cursor-pointer select-none hover:text-primary-400 transition-colors"),children:I("div",{className:"flex items-center",children:[x,b(C)]})},C))})}),d&&f("tbody",{children:d.map((x,C)=>f("tr",{className:"transition-colors hover:bg-bg-surface",children:x.map((A,H)=>f("td",{className:"px-3 py-2 border-b border-border-subtle text-sm text-text-muted",children:A},H))},C))})]});return I("div",{className:a("my-6 rounded-lg border border-border-subtle overflow-hidden",o),children:[f("div",{className:"overflow-x-auto",children:f("table",{className:"w-full border-collapse text-sm",children:v})}),s&&i>1&&I("div",{className:"flex items-center justify-between border-t border-border-subtle px-4 py-3",children:[I("span",{className:"text-xs text-text-muted",children:["Page ",c," of ",i]}),I("div",{className:"flex items-center gap-1",children:[f(M.Button,{onPress:()=>l(1),isDisabled:c===1,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:f(Jt,{size:16})}),f(M.Button,{onPress:()=>l(x=>Math.max(x-1,1)),isDisabled:c===1,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:f(Yt,{size:16})}),f(M.Button,{onPress:()=>l(x=>Math.min(x+1,i)),isDisabled:c===i,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:f(Zt,{size:16})}),f(M.Button,{onPress:()=>l(i),isDisabled:c===i,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:f(Qt,{size:16})})]})]})]})}import{jsx as V,jsxs as D}from"react/jsx-runtime";function We({name:e,type:t,defaultValue:r,required:o=!1,children:n,id:s,className:u=""}){return D("article",{className:a("group relative my-6 rounded-xl border border-border-subtle bg-bg-surface p-5 transition-all duration-300","hover:border-primary-500/30 hover:shadow-lg hover:shadow-primary-500/5",u),id:s,children:[D("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[D("div",{className:"flex flex-wrap items-center gap-2.5",children:[V("code",{className:"inline-flex items-center rounded-md bg-primary-500/10 px-2.5 py-1 font-mono text-sm font-bold text-primary-400 border border-primary-500/20 shadow-sm transition-colors group-hover:bg-primary-500/15",children:e}),t&&V("span",{className:"rounded-md bg-bg-muted/80 border border-border-subtle px-2 py-0.5 text-[11px] font-semibold text-text-muted uppercase tracking-wider shadow-sm",children:t}),o&&D("div",{className:"flex items-center gap-1.5 rounded-full bg-red-500/10 px-2.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-red-400 border border-red-500/20 shadow-sm",children:[V("span",{className:"h-1 w-1 rounded-full bg-red-400 animate-pulse"}),"Required"]})]}),r&&D("div",{className:"flex items-center gap-2 text-[11px] text-text-muted bg-bg-muted/30 px-2.5 py-1 rounded-md border border-border-subtle/50",children:[V("span",{className:"font-semibold opacity-60 uppercase tracking-tighter",children:"Default"}),V("code",{className:"font-mono text-text-main font-medium",children:r})]})]}),V("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 selection:bg-primary-500/30",children:n})]})}import{jsx as tr}from"react/jsx-runtime";function $e({to:e,children:t,className:r="",...o}){let n=e&&(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")),s=a("text-blue-600 hover:text-blue-800 hover:underline cursor-pointer",r);return tr(Q,{href:e,className:s,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,...o,children:t})}import{jsx as rr}from"react/jsx-runtime";function _e({src:e,alt:t,theme:r,...o}){let{theme:n}=ee();return r&&r!==n?null:rr("img",{src:e,alt:t||"",...o})}import{jsx as h,jsxs as z}from"react/jsx-runtime";function qe({title:e,props:t,className:r=""}){return z("div",{className:a("my-6",r),children:[e&&h("h3",{className:"text-base font-bold text-text-main mb-3",children:e}),h("div",{className:"overflow-x-auto rounded-lg border border-border-subtle",children:z("table",{className:"w-full border-collapse text-sm",children:[h("thead",{children:z("tr",{children:[h("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Property"}),h("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Type"}),h("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Default"}),h("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Description"})]})}),h("tbody",{children:t.map((o,n)=>z("tr",{className:"transition-colors hover:bg-bg-surface",children:[z("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:[h("code",{className:"rounded bg-bg-surface px-1.5 py-0.5 font-mono text-xs font-bold text-primary-400",children:o.name}),o.required&&h("span",{className:"ml-1 text-red-400 font-bold",children:"*"})]}),h("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:h("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-text-muted",children:o.type})}),h("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:o.defaultValue?h("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-primary-400",children:o.defaultValue}):h("span",{className:"text-text-dim",children:"\u2014"})}),h("td",{className:"px-4 py-2.5 border-b border-border-subtle text-text-muted",children:o.description})]},`${o.name}-${n}`))})]})})]})}import{useMemo as Ge}from"react";function Xe(e){let{code:t,children:r,preview:o}=e,n=Ge(()=>(t??(typeof r=="string"?r:"")).trim(),[t,r]),s=Ge(()=>o??(typeof r!="string"?r:null),[o,r]);return{initialCode:n,previewElement:s}}import{jsx as J,jsxs as or}from"react/jsx-runtime";function Ke(e){let{highlightedHtml:t,hideCode:r=!1,hideSandbox:o=!1,hideCopy:n=!1,sandboxOptions:s={}}=e,{initialCode:u,previewElement:p}=Xe(e);return or("div",{className:"my-6 overflow-hidden rounded-xl border border-border-subtle",children:[J("div",{className:"flex items-center justify-center p-8 bg-bg-surface",children:p}),!r&&J("div",{className:"border-t border-border-subtle",children:J(L,{hideSandbox:o,hideCopy:n,title:s.title,lang:"tsx",highlightedHtml:t,children:u})})]})}export{ae as a,L as b,be as c,fe as d,ge as e,ye as f,Ne as g,Re as h,P as i,we as j,Te as k,Ae as l,Ee as m,Le as n,Ie as o,Ve as p,Se as q,Me as r,Oe as s,We as t,$e as u,_e as v,qe as w,Ke as x,nr as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as B,use as T}from"react";var k=B(null);function h(){let o=T(k);if(!o)throw new Error("useConfig must be used within a ConfigProvider");return o}import{useLocation as $}from"react-router-dom";import{createContext as w,use as W,useCallback as M,useRef as O}from"react";import{jsx as j}from"react/jsx-runtime";var P=w({preload:()=>{},routes:[]});function b(){return W(P)}function J({routes:o,modules:e,children:l}){let c=O(null),i=M(s=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{let a=s.split("#")[0].split("?")[0],r=o.find(n=>n.path===a||a==="/"&&n.path==="");if(r?.filePath){let n=Object.keys(e).find(u=>u.endsWith("/"+r.filePath));n&&e[n]().catch(u=>{console.error(`[boltdocs] Failed to preload route ${s}:`,u)})}},100)},[o,e]);return j(P.Provider,{value:{preload:i,routes:o},children:l})}import{create as z}from"zustand";import{persist as A,createJSONStorage as N}from"zustand/middleware";var g=z()(A(o=>({currentLocale:void 0,currentVersion:void 0,hasHydrated:!1,setLocale:e=>o({currentLocale:e}),setVersion:e=>o({currentVersion:e}),setHasHydrated:e=>o({hasHydrated:e})}),{name:"boltdocs-storage",storage:N(()=>localStorage),partialize:o=>({currentLocale:o.currentLocale,currentVersion:o.currentVersion}),onRehydrateStorage:()=>o=>{o?.setHasHydrated(!0)}}));function y(){let{routes:o}=b(),e=h(),l=$(),c=g(t=>t.currentLocale),i=g(t=>t.currentVersion),s=g(t=>t.hasHydrated),a=o.find(t=>t.path===l.pathname),r=e.i18n?a?.locale||(s?c:void 0)||e.i18n.defaultLocale:void 0,n=e.versions?a?.version||(s?i:void 0)||e.versions.defaultVersion:void 0,u=o.filter(t=>{let v=e.i18n?(t.locale||e.i18n.defaultLocale)===r:!0,C=e.versions?(t.version||e.versions.defaultVersion)===n:!0;if(!(v&&C))return!1;let L=e.i18n;if(L){let S=!!a?.locale,H=!!t.locale;if(o.some(p=>p!==t&&p.filePath===t.filePath&&p.version===t.version&&(p.locale||L.defaultLocale)===(t.locale||L.defaultLocale))&&S!==H)return!1}return!0}),f=e.i18n?.localeConfigs?.[r]?.label||e.i18n?.locales[r]||r,m=e.versions?.versions.find(t=>t.path===n)?.label||n,V=e.i18n?Object.entries(e.i18n.locales).map(([t,v])=>{let C=e.i18n?.localeConfigs?.[t];return{key:t,label:C?.label||v,isCurrent:t===r}}):[],x=e.versions?e.versions.versions.map(t=>({key:t.path,label:t.label,isCurrent:t.path===n})):[];return{routes:u,allRoutes:o,currentRoute:a,currentLocale:r,currentLocaleLabel:f,availableLocales:V,currentVersion:n,currentVersionLabel:m,availableVersions:x,config:e}}function ne(o){let e=h(),{currentLocale:l,currentVersion:c}=y();if(!e||typeof o!="string"||o.startsWith("http")||o.startsWith("//"))return o;let i=e.i18n,s=e.versions;if(!i&&!s)return o;let a=o.startsWith("/docs"),r=o.split("/").filter(Boolean),n=0;r[n]==="docs"&&n++,s&&r.length>n&&s.versions.find(m=>m.path===r[n])&&n++,i&&r.length>n&&i.locales[r[n]]&&n++;let u=r.slice(n),d=[];a&&(d.push("docs"),s&&c&&d.push(c)),i&&l&&l!==i.defaultLocale&&d.push(l),d.push(...u);let f=`/${d.join("/")}`;return f.length>1&&f.endsWith("/")?f.slice(0,-1):f||"/"}export{k as a,h as b,b as c,J as d,g as e,y as f,ne as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var y=(s,t)=>()=>(s&&(t=s(s=0)),t);var K=(s,t)=>()=>(t||s((t={exports:{}}).exports,t),t.exports);import U from"path";import{fileURLToPath as J}from"url";var u=y(()=>{"use strict"});import P from"fs";import F from"gray-matter";import O from"isomorphic-dompurify";function Y(s){return s.replace(/\\/g,"/")}function L(s){return s.replace(/^\d+\./,"")}function Z(s){let t=s.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function tt(s){return/\.mdx?$/.test(s)}function m(s){try{return P.statSync(s).mtimeMs}catch{return 0}}function et(s){let t=P.readFileSync(s,"utf-8");try{let{data:e,content:r}=F(t);return{data:e,content:r}}catch{return{data:{},content:t}}}function M(s){return s.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function st(s){return M(s)}function rt(s){let e=s.split("/").map(L).join("/").replace(/\/$/,"");return e=e.replace(/\.mdx?$/,""),(e==="index"||e.endsWith("/index"))&&(e=e.replace(/index$/,"")),e.startsWith("/")||(e="/"+e),e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function it(s){return O.sanitize(s)}function nt(s){return O.sanitize(s,{ALLOWED_TAGS:[],KEEP_CONTENT:!0})}function at(s){return s.charAt(0).toUpperCase()+s.slice(1)}function ct(s,t){return s?typeof s=="string"?s:t&&s[t]?s[t]:Object.values(s)[0]||"":""}var _=y(()=>{"use strict";u()});import a from"fs";import o from"path";import g from"crypto";import d from"zlib";import{promisify as l}from"util";async function yt(){await h.flush()}var p,A,f,S,ft,C,B,N,R,j,x,v,h,b,z,$,I=y(()=>{u();_();p=l(a.writeFile),A=l(a.readFile),f=l(a.mkdir),S=l(a.rename),ft=l(a.unlink),C=process.env.BOLTDOCS_CACHE_DIR||".boltdocs",B="assets",N="shards",R=parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||"2000",10),j=process.env.BOLTDOCS_CACHE_COMPRESS!=="0",x=class{constructor(t){this.limit=t}cache=new Map;get(t){let e=this.cache.get(t);return e!==void 0&&(this.cache.delete(t),this.cache.set(t,e)),e}set(t,e){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.limit){let r=this.cache.keys().next().value;r!==void 0&&this.cache.delete(r)}this.cache.set(t,e)}get size(){return this.cache.size}clear(){this.cache.clear()}},v=class{queue=Promise.resolve();pendingCount=0;add(t){this.pendingCount++,this.queue=this.queue.then(t).finally(()=>{this.pendingCount--})}async flush(){await this.queue}get pending(){return this.pendingCount}},h=new v,b=class{entries=new Map;cachePath=null;compress;constructor(t={}){if(this.compress=t.compress!==void 0?t.compress:j,t.name){let e=t.root||process.cwd(),r=this.compress?"json.gz":"json";this.cachePath=o.resolve(e,C,`${t.name}.${r}`)}}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&!(!this.cachePath||!a.existsSync(this.cachePath)))try{let t=a.readFileSync(this.cachePath);this.cachePath.endsWith(".gz")&&(t=d.gunzipSync(t));let e=JSON.parse(t.toString("utf-8"));this.entries=new Map(Object.entries(e))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1"||!this.cachePath)return;let t=Object.fromEntries(this.entries),e=JSON.stringify(t),r=this.cachePath,n=this.compress;h.add(async()=>{try{await f(o.dirname(r),{recursive:!0});let i=Buffer.from(e);n&&(i=d.gzipSync(i));let c=`${r}.${g.randomBytes(4).toString("hex")}.tmp`;await p(c,i),await S(c,r)}catch{}})}get(t){let e=this.entries.get(t);return!e||m(t)!==e.mtime?null:e.data}set(t,e){this.entries.set(t,{data:e,mtime:m(t)})}isValid(t){let e=this.entries.get(t);return e?m(t)===e.mtime:!1}invalidate(t){this.entries.delete(t)}invalidateAll(){this.entries.clear()}pruneStale(t){for(let e of this.entries.keys())t.has(e)||this.entries.delete(e)}get size(){return this.entries.size}async flush(){await h.flush()}},z=class{index=new Map;memoryCache=new x(R);baseDir;shardsDir;indexPath;constructor(t,e=process.cwd()){this.baseDir=o.resolve(e,C,`transform-${t}`),this.shardsDir=o.resolve(this.baseDir,N),this.indexPath=o.resolve(this.baseDir,"index.json")}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&a.existsSync(this.indexPath))try{let t=a.readFileSync(this.indexPath,"utf-8");this.index=new Map(Object.entries(JSON.parse(t)))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1")return;let t=JSON.stringify(Object.fromEntries(this.index)),e=this.indexPath;h.add(async()=>{await f(o.dirname(e),{recursive:!0}),await p(e,t)})}async getMany(t){let e=new Map,r=[];for(let n of t){let i=this.memoryCache.get(n);i?e.set(n,i):this.index.has(n)&&r.push(n)}if(r.length>0){let n=await Promise.all(r.map(async i=>{let c=this.index.get(i),T=o.resolve(this.shardsDir,`${c}.gz`);try{let w=await A(T),D=d.gunzipSync(w).toString("utf-8");return this.memoryCache.set(i,D),{key:i,val:D}}catch{return null}}));for(let i of n)i&&e.set(i.key,i.val)}return e}get(t){let e=this.memoryCache.get(t);if(e)return e;let r=this.index.get(t);if(!r)return null;let n=o.resolve(this.shardsDir,`${r}.gz`);if(!a.existsSync(n))return null;try{let i=a.readFileSync(n),c=d.gunzipSync(i).toString("utf-8");return this.memoryCache.set(t,c),c}catch{return null}}set(t,e){let r=g.createHash("md5").update(e).digest("hex");this.index.set(t,r),this.memoryCache.set(t,e);let n=o.resolve(this.shardsDir,`${r}.gz`);h.add(async()=>{if(a.existsSync(n))return;await f(this.shardsDir,{recursive:!0});let i=d.gzipSync(Buffer.from(e)),c=`${n}.${g.randomBytes(4).toString("hex")}.tmp`;await p(c,i),await S(c,n)})}get size(){return this.index.size}async flush(){await h.flush()}},$=class{assetsDir;constructor(t=process.cwd()){this.assetsDir=o.resolve(t,C,B)}getFileHash(t){return g.createHash("md5").update(a.readFileSync(t)).digest("hex")}get(t,e){if(!a.existsSync(t))return null;let r=this.getFileHash(t),n=this.getCachedPath(t,`${e}-${r}`);return a.existsSync(n)?n:null}set(t,e,r){let n=this.getFileHash(t),i=this.getCachedPath(t,`${e}-${n}`);h.add(async()=>{await f(this.assetsDir,{recursive:!0});let c=`${i}.${g.randomBytes(4).toString("hex")}.tmp`;await p(c,r),await S(c,i)})}getCachedPath(t,e){let r=o.extname(t),n=o.basename(t,r),i=e.replace(/[^a-z0-9]/gi,"-").toLowerCase();return o.join(this.assetsDir,`${n}.${i}${r}`)}clear(){a.existsSync(this.assetsDir)&&a.rmSync(this.assetsDir,{recursive:!0,force:!0})}async flush(){await h.flush()}}});export{y as a,K as b,u as c,Y as d,L as e,Z as f,tt as g,et as h,M as i,st as j,rt as k,it as l,nt as m,at as n,ct as o,_ as p,b as q,z as r,$ as s,yt as t,I as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as y}from"./chunk-JD3RSDE4.mjs";import{b as x,e as R,f as b}from"./chunk-NBCYHLAA.mjs";import{useLocation as P}from"react-router-dom";function C(e,o){return e?typeof e=="string"?e:o&&e[o]?e[o]:Object.values(e)[0]||"":""}function U(){let e=x(),{theme:o}=y(),i=P(),{currentLocale:t}=b(),c=e.theme||{},s=C(c.title,t)||"Boltdocs",f=c.navbar||[],d=c.socialLinks||[],h=c.githubRepo,p=f.map(g=>{let l=g.href||g.to||g.link||"";return{label:C(g.label||g.text,t),href:l,active:i.pathname===l,to:l.startsWith("http")||l.startsWith("//")?"external":void 0,items:g.items?.map(u=>({label:C(u.label||u.text,t),href:u.href||u.link||u.to||""}))}}),r=c.logo,n=r?typeof r=="string"?r:o==="dark"?r.dark:r.light:null,a={alt:(r&&typeof r=="object"?r.alt:void 0)||s,width:r&&typeof r=="object"?r.width:void 0,height:r&&typeof r=="object"?r.height:void 0},m=h?`https://github.com/${h}`:null;return{links:p,title:s,logo:n,logoProps:a,github:m,social:d,config:e,theme:o}}import{useNavigate as V}from"react-router-dom";function v(e,o,i){let t=e;return o&&(t===o||t.startsWith(o+"/"))&&(t=t===o?"index.md":t.slice(o.length+1)),i&&(t===i||t.startsWith(i+"/"))&&(t=t===i?"index.md":t.slice(i.length+1)),t}function D(){let e=V(),o=b(),{allRoutes:i,currentRoute:t,currentVersion:c,currentLocale:s,config:f}=o,d=f.versions,h=R(n=>n.setVersion),p=n=>{if(!d||n===c)return;h(n);let a=`/docs/${n}`;if(t){let m=v(t.filePath,t.version,t.locale),g=i.find(l=>v(l.filePath,l.version,l.locale)===m&&(l.version||d.defaultVersion)===n&&(s?l.locale===s:!l.locale));if(g)a=g.path;else{let l=i.find(u=>v(u.filePath,u.version,u.locale)==="index.md"&&(u.version||d.defaultVersion)===n&&(s?u.locale===s:!u.locale));a=l?l.path:`/docs/${n}${s?`/${s}`:""}`}}e(a)},r=o.availableVersions.map(n=>({...n,label:n.label,value:n.key}));return{currentVersion:c,currentVersionLabel:o.currentVersionLabel,availableVersions:r,handleVersionChange:p}}import{useNavigate as I}from"react-router-dom";function Z(){let e=I(),o=b(),{allRoutes:i,currentRoute:t,currentLocale:c,config:s}=o,f=s.i18n,d=R(a=>a.setLocale),h=a=>{if(!f||a===c)return;d(a);let m="/";if(t){let g=v(t.filePath,t.version,t.locale),l=i.find(u=>v(u.filePath,u.version,u.locale)===g&&(u.locale||f.defaultLocale)===a&&u.version===t.version);if(l)m=l.path;else{let u=i.find(L=>v(L.filePath,L.version,L.locale)==="index.md"&&(L.locale||f.defaultLocale)===a&&L.version===t.version);m=u?u.path:a===f.defaultLocale?t.version?`/${t.version}`:"/":t.version?`/${t.version}/${a}`:`/${a}`}}else{let g=i.find(l=>(l.filePath==="index.mdx"||l.filePath==="index.md")&&(l.locale||f.defaultLocale)===a&&!l.version);g?m=g.path:m=a===f.defaultLocale?"/":`/${a}`}e(m)},r=s.i18n?.localeConfigs?.[c]?.label||s.i18n?.locales[c]||c,n=s.i18n?Object.entries(s.i18n.locales).map(([a,m])=>{let g=s.i18n?.localeConfigs?.[a];return{key:a,label:g?.label||m,value:a,isCurrent:a===c}}):[];return{currentLocale:c,currentLocaleLabel:r,availableLocales:n,handleLocaleChange:h}}import{useLocation as T}from"react-router-dom";import{useEffect as w,useState as $,useRef as k}from"react";function nt(e=[],o=[]){let i=T(),t=k([]),[c,s]=$({opacity:0,transform:"translateX(0) scaleX(0)",width:0}),d=o.find(r=>r.path===i.pathname)?.tab?.toLowerCase(),h=e.findIndex(r=>r.id.toLowerCase()===d),p=h===-1?0:h;return w(()=>{let r=t.current[p];r&&s({opacity:1,width:r.offsetWidth,transform:`translateX(${r.offsetLeft}px)`})},[p,e.length,i.pathname]),{tabs:e,activeIndex:p,indicatorStyle:c,tabRefs:t,activeTabId:d}}import{useLocation as S}from"react-router-dom";function st(e){let o=x(),i=S(),t=n=>n.endsWith("/")&&n.length>1?n.slice(0,-1):n,c=t(i.pathname),s=e.find(n=>t(n.path)===c),f=s?.tab?.toLowerCase(),d=f?e.filter(n=>!n.tab||n.tab.toLowerCase()===f):e,h=[],p=new Map;for(let n of d)n.group?(p.has(n.group)||p.set(n.group,{slug:n.group,title:n.groupTitle||n.group,routes:[],icon:n.groupIcon}),p.get(n.group).routes.push(n)):h.push(n);return{groups:Array.from(p.values()),ungrouped:h,activeRoute:s,activePath:c,config:o}}import{useState as B}from"react";function lt(e=[]){let[o,i]=B(null);return{headings:e,activeId:o,setActiveId:i}}function gt(){let{currentRoute:e}=b(),o=[];return e&&(e.groupTitle&&o.push({label:e.groupTitle}),o.push({label:e.title,href:e.path})),{crumbs:o,activeRoute:e}}function ht(){let{routes:e}=b(),o=window.location.pathname,i=e.findIndex(f=>f.path===o),t=e[i],c=i>0?e[i-1]:null,s=i<e.length-1?e[i+1]:null;return{prevPage:c,nextPage:s,currentRoute:t}}export{C as a,U as b,D as c,Z as d,nt as e,st as f,lt as g,gt as h,ht as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getParameters as l}from"codesandbox/lib/api/define.js";function f(e){let r=e.files||{},i=e.dependencies||{},t=e.devDependencies||{},n=e.title||"codesandbox-project",d=e.description||"Generic Sandbox",a={};for(let[c,s]of Object.entries(r)){let o=typeof s.content=="object"?JSON.stringify(s.content,null,2):s.content;a[c]={content:o,isBinary:s.isBinary??!1}}if(!a["package.json"]){let s=e.template==="vite"||!!t.vite||!!t["@vitejs/plugin-react"]?{dev:"vite",build:"vite build",preview:"vite preview"}:{start:"node index.js"};a["package.json"]={content:JSON.stringify({private:!0,name:n,description:d,type:"module",version:"1.0.0",scripts:e.scripts||s,dependencies:i,devDependencies:t},null,2),isBinary:!1}}return a}function p(e){let r=f(e),i=l({files:r}),t=new URLSearchParams({parameters:i,installDependencies:"true"});return e.entry&&t.set("file",`/${e.entry}`),{parameters:i,url:`https://codesandbox.io/api/v1/sandboxes/define?${t.toString()}`,options:e}}function u(e){if(typeof window>"u")return p(e);let r=f(e),i=l({files:r}),t=e.entry||"src/App.tsx",n=document.createElement("form");n.method="POST",n.target="_blank",n.action="https://codesandbox.io/api/v1/sandboxes/define",n.style.display="none";let d=(c,s)=>{let o=document.createElement("input");o.type="hidden",o.name=c,o.value=s,n.appendChild(o)},a=new URLSearchParams({file:`/${t}`,eslint:"0",codemirror:"1",installDependencies:"true"});return d("query",a.toString()),d("parameters",i),document.body.appendChild(n),n.submit(),document.body.removeChild(n),{parameters:i,url:`https://codesandbox.io/api/v1/sandboxes/define?parameters=${i}`,options:e}}function b(e){let r=f(e),i=l({files:r}),t=e.embed||{},n=new URLSearchParams({parameters:i,embed:"1"});return t.view&&n.set("view",t.view),t.theme&&n.set("theme",t.theme),t.hideNavigation&&n.set("hidenavigation","1"),e.entry&&n.set("file",`/${e.entry}`),{parameters:i,url:`https://codesandbox.io/api/v1/sandboxes/define?${n.toString()}`,options:e}}export{p as a,u as b,b as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as l,e as d,oa as u,qa as c,sa as h,ta as m}from"./chunk-ZRJ55GGF.mjs";import{useState as g}from"react";import{Copy as x,Check as w,ExternalLink as f,ChevronDown as v}from"lucide-react";import{jsx as e,jsxs as o}from"react/jsx-runtime";var C=r=>{let[s,t]=g(!1);return{copied:s,handleCopy:()=>{navigator.clipboard.writeText(r),t(!0),setTimeout(()=>t(!1),2e3)},handleOpenRaw:()=>{let a=new Blob([r],{type:"text/plain;charset=utf-8"}),p=URL.createObjectURL(a);window.open(p,"_blank")}}};function R({content:r,mdxRaw:s,config:t}){let i=s||r||"",{copied:n,handleCopy:a,handleOpenRaw:p}=C(i),b=t!==!1,y=typeof t=="object"&&t.text||"Copy Markdown";return!b||!i?null:e("div",{className:"relative inline-flex z-100 flex-shrink-0 w-max translate-y-0 active:translate-y-px transition-transform duration-200",children:o(u,{className:"rounded-xl border border-border-subtle bg-bg-surface/40 backdrop-blur-md transition-all duration-300 hover:border-primary-500/50 hover:shadow-lg hover:shadow-primary-500/5 group overflow-hidden",children:[e(d,{variant:"ghost",onPress:a,icon:n?e(w,{size:16}):e(x,{size:16}),iconPosition:"left",className:l("px-5 py-2 bg-transparent text-[0.8125rem] font-semibold h-9 border-none shrink-0","text-text-main transition-all duration-300 hover:bg-primary-500/5",n&&"text-emerald-500 hover:bg-emerald-500/5"),children:n?"Copied!":y}),o(c,{placement:"bottom end",children:[e(d,{variant:"ghost",isIconOnly:!0,icon:e(v,{size:14}),className:l("px-3.5 h-9 border-l border-border-subtle/50 text-text-muted rounded-none bg-transparent shrink-0","transition-all duration-300 hover:bg-primary-500/5 hover:text-primary-500")}),o(h,{className:"w-52",children:[o(m,{onAction:a,className:"flex flex-row items-start gap-2.5 group",children:[e(x,{size:16,className:"w-4 h-4 shrink-0 mt-0.5 transition-transform duration-200 group-hover:-translate-y-0.5 text-text-muted group-hover:text-primary-500"}),e("span",{className:"font-medium text-[0.8125rem]",children:"Copy Markdown"})]}),o(m,{onAction:p,className:"flex flex-row items-start gap-2.5 group",children:[e(f,{size:16,className:"w-4 h-4 shrink-0 mt-0.5 transition-transform duration-200 group-hover:-translate-y-0.5 text-text-muted group-hover:text-primary-500"}),e("span",{className:"font-medium text-[0.8125rem]",children:"View as Markdown"})]})]})]})]})})}export{R as a};
|