boltdocs 1.10.2 → 2.0.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.
Files changed (250) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/dist/cache-7G6D532T.mjs +1 -0
  4. package/dist/chunk-A4HQPEPU.mjs +1 -0
  5. package/dist/chunk-BA5NH5HU.mjs +1 -0
  6. package/dist/chunk-BQCD3DWG.mjs +1 -0
  7. package/dist/chunk-H63UMKYF.mjs +1 -0
  8. package/dist/chunk-IWHRQHS7.mjs +1 -0
  9. package/dist/chunk-JZXLCA2E.mjs +1 -0
  10. package/dist/chunk-MFU7Q6WF.mjs +1 -0
  11. package/dist/chunk-QYPNX5UN.mjs +1 -0
  12. package/dist/chunk-XEAPSFMB.mjs +1 -0
  13. package/dist/client/components/mdx/index.d.mts +209 -0
  14. package/dist/client/components/mdx/index.d.ts +209 -0
  15. package/dist/client/components/mdx/index.js +1 -0
  16. package/dist/client/components/mdx/index.mjs +1 -0
  17. package/dist/client/hooks/index.d.mts +133 -0
  18. package/dist/client/hooks/index.d.ts +133 -0
  19. package/dist/client/hooks/index.js +1 -0
  20. package/dist/client/hooks/index.mjs +1 -0
  21. package/dist/client/index.d.mts +138 -298
  22. package/dist/client/index.d.ts +138 -298
  23. package/dist/client/index.js +1 -3630
  24. package/dist/client/index.mjs +1 -697
  25. package/dist/client/ssr.d.mts +7 -3
  26. package/dist/client/ssr.d.ts +7 -3
  27. package/dist/client/ssr.js +1 -2928
  28. package/dist/client/ssr.mjs +1 -33
  29. package/dist/{config-BsFQ-ErD.d.ts → config-CX4l-ZNp.d.mts} +42 -35
  30. package/dist/{config-BsFQ-ErD.d.mts → config-CX4l-ZNp.d.ts} +42 -35
  31. package/dist/node/index.d.mts +2 -4
  32. package/dist/node/index.d.ts +2 -4
  33. package/dist/node/index.js +31 -1161
  34. package/dist/node/index.mjs +31 -736
  35. package/dist/search-dialog-EB3N4TYM.mjs +1 -0
  36. package/dist/types-BuZWFT7r.d.ts +159 -0
  37. package/dist/types-CvT-SGbK.d.mts +159 -0
  38. package/dist/use-routes-5bAtAAYX.d.mts +30 -0
  39. package/dist/use-routes-BefRXY3v.d.ts +30 -0
  40. package/package.json +34 -12
  41. package/src/client/app/config-context.tsx +18 -0
  42. package/src/client/app/docs-layout.tsx +14 -0
  43. package/src/client/app/index.tsx +137 -262
  44. package/src/client/app/mdx-component.tsx +52 -0
  45. package/src/client/app/mdx-components-context.tsx +23 -0
  46. package/src/client/app/mdx-page.tsx +20 -0
  47. package/src/client/app/preload.tsx +38 -30
  48. package/src/client/app/router.tsx +30 -0
  49. package/src/client/app/scroll-handler.tsx +40 -0
  50. package/src/client/app/theme-context.tsx +75 -0
  51. package/src/client/components/default-layout.tsx +80 -0
  52. package/src/client/components/docs-layout.tsx +105 -0
  53. package/src/client/components/icons-dev.tsx +74 -0
  54. package/src/client/components/mdx/admonition.tsx +107 -0
  55. package/src/client/components/mdx/badge.tsx +41 -0
  56. package/src/client/components/mdx/button.tsx +35 -0
  57. package/src/client/components/mdx/card.tsx +124 -0
  58. package/src/client/components/mdx/code-block.tsx +119 -0
  59. package/src/client/components/mdx/component-preview.tsx +47 -0
  60. package/src/client/components/mdx/component-props.tsx +83 -0
  61. package/src/client/components/mdx/field.tsx +66 -0
  62. package/src/client/components/mdx/file-tree.tsx +287 -0
  63. package/src/client/components/mdx/hooks/use-code-block.ts +56 -0
  64. package/src/client/components/mdx/hooks/use-component-preview.ts +16 -0
  65. package/src/client/components/mdx/hooks/useTable.ts +74 -0
  66. package/src/client/components/mdx/hooks/useTabs.ts +68 -0
  67. package/src/client/components/mdx/image.tsx +23 -0
  68. package/src/client/components/mdx/index.ts +53 -0
  69. package/src/client/components/mdx/link.tsx +38 -0
  70. package/src/client/components/mdx/list.tsx +192 -0
  71. package/src/client/components/mdx/table.tsx +156 -0
  72. package/src/client/components/mdx/tabs.tsx +135 -0
  73. package/src/client/components/mdx/video.tsx +68 -0
  74. package/src/client/components/primitives/breadcrumbs.tsx +79 -0
  75. package/src/client/components/primitives/button-group.tsx +54 -0
  76. package/src/client/components/primitives/button.tsx +145 -0
  77. package/src/client/components/primitives/helpers/observer.ts +120 -0
  78. package/src/client/components/primitives/index.ts +17 -0
  79. package/src/client/components/primitives/link.tsx +122 -0
  80. package/src/client/components/primitives/menu.tsx +159 -0
  81. package/src/client/components/primitives/navbar.tsx +359 -0
  82. package/src/client/components/primitives/navigation-menu.tsx +116 -0
  83. package/src/client/components/primitives/on-this-page.tsx +461 -0
  84. package/src/client/components/primitives/page-nav.tsx +87 -0
  85. package/src/client/components/primitives/popover.tsx +47 -0
  86. package/src/client/components/primitives/search-dialog.tsx +183 -0
  87. package/src/client/components/primitives/sidebar.tsx +154 -0
  88. package/src/client/components/primitives/tabs.tsx +90 -0
  89. package/src/client/components/primitives/tooltip.tsx +83 -0
  90. package/src/client/components/primitives/types.ts +11 -0
  91. package/src/client/components/ui-base/breadcrumbs.tsx +42 -0
  92. package/src/client/components/ui-base/copy-markdown.tsx +112 -0
  93. package/src/client/components/ui-base/error-boundary.tsx +52 -0
  94. package/src/client/components/ui-base/github-stars.tsx +27 -0
  95. package/src/client/components/ui-base/head.tsx +69 -0
  96. package/src/client/components/ui-base/loading.tsx +87 -0
  97. package/src/client/components/ui-base/navbar.tsx +138 -0
  98. package/src/client/components/ui-base/not-found.tsx +24 -0
  99. package/src/client/components/ui-base/on-this-page.tsx +152 -0
  100. package/src/client/components/ui-base/page-nav.tsx +39 -0
  101. package/src/client/components/ui-base/powered-by.tsx +19 -0
  102. package/src/client/components/ui-base/progress-bar.tsx +67 -0
  103. package/src/client/components/ui-base/search-dialog.tsx +82 -0
  104. package/src/client/components/ui-base/sidebar.tsx +104 -0
  105. package/src/client/components/ui-base/tabs.tsx +65 -0
  106. package/src/client/components/ui-base/theme-toggle.tsx +32 -0
  107. package/src/client/hooks/index.ts +12 -0
  108. package/src/client/hooks/use-breadcrumbs.ts +22 -0
  109. package/src/client/hooks/use-i18n.ts +84 -0
  110. package/src/client/hooks/use-localized-to.ts +95 -0
  111. package/src/client/hooks/use-location.ts +5 -0
  112. package/src/client/hooks/use-navbar.ts +60 -0
  113. package/src/client/hooks/use-onthispage.ts +23 -0
  114. package/src/client/hooks/use-page-nav.ts +22 -0
  115. package/src/client/hooks/use-routes.ts +72 -0
  116. package/src/client/hooks/use-search.ts +71 -0
  117. package/src/client/hooks/use-sidebar.ts +49 -0
  118. package/src/client/hooks/use-tabs.ts +43 -0
  119. package/src/client/hooks/use-version.ts +78 -0
  120. package/src/client/index.ts +55 -17
  121. package/src/client/integrations/codesandbox.ts +179 -0
  122. package/src/client/ssr.tsx +27 -16
  123. package/src/client/theme/neutral.css +360 -0
  124. package/src/client/types.ts +131 -27
  125. package/src/client/utils/cn.ts +6 -0
  126. package/src/client/utils/copy-clipboard.ts +22 -0
  127. package/src/client/utils/get-base-file-path.ts +21 -0
  128. package/src/client/utils/github.ts +121 -0
  129. package/src/client/utils/use-on-change.ts +15 -0
  130. package/src/client/virtual.d.ts +24 -0
  131. package/src/node/cache.ts +156 -156
  132. package/src/node/config.ts +159 -103
  133. package/src/node/index.ts +13 -13
  134. package/src/node/mdx.ts +213 -61
  135. package/src/node/plugin/entry.ts +29 -18
  136. package/src/node/plugin/html.ts +11 -11
  137. package/src/node/plugin/index.ts +161 -84
  138. package/src/node/plugin/types.ts +2 -4
  139. package/src/node/routes/cache.ts +6 -6
  140. package/src/node/routes/index.ts +206 -113
  141. package/src/node/routes/parser.ts +102 -82
  142. package/src/node/routes/sorter.ts +15 -15
  143. package/src/node/routes/types.ts +24 -24
  144. package/src/node/ssg/index.ts +73 -47
  145. package/src/node/ssg/meta.ts +4 -4
  146. package/src/node/ssg/options.ts +5 -5
  147. package/src/node/ssg/sitemap.ts +14 -14
  148. package/src/node/utils.ts +54 -31
  149. package/tsconfig.json +25 -20
  150. package/tsup.config.ts +23 -14
  151. package/dist/PackageManagerTabs-NVT7G625.mjs +0 -99
  152. package/dist/SearchDialog-AGVF6JBO.mjs +0 -194
  153. package/dist/SearchDialog-YPDOM7Q6.css +0 -2847
  154. package/dist/Video-KNTY5BNO.mjs +0 -6
  155. package/dist/cache-KNL5B4EE.mjs +0 -12
  156. package/dist/chunk-7SFUJWTB.mjs +0 -211
  157. package/dist/chunk-FFBNU6IJ.mjs +0 -386
  158. package/dist/chunk-FMTOYQLO.mjs +0 -37
  159. package/dist/chunk-TKLQWU7H.mjs +0 -1920
  160. package/dist/chunk-Z7JHYNAS.mjs +0 -57
  161. package/dist/client/index.css +0 -2847
  162. package/dist/client/ssr.css +0 -2847
  163. package/dist/types-Dj-bfnC3.d.mts +0 -74
  164. package/dist/types-Dj-bfnC3.d.ts +0 -74
  165. package/src/client/theme/components/CodeBlock/CodeBlock.tsx +0 -61
  166. package/src/client/theme/components/CodeBlock/index.ts +0 -1
  167. package/src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx +0 -131
  168. package/src/client/theme/components/PackageManagerTabs/index.ts +0 -1
  169. package/src/client/theme/components/PackageManagerTabs/pkg-tabs.css +0 -64
  170. package/src/client/theme/components/Playground/Playground.tsx +0 -180
  171. package/src/client/theme/components/Playground/index.ts +0 -1
  172. package/src/client/theme/components/Playground/playground.css +0 -238
  173. package/src/client/theme/components/Video/Video.tsx +0 -84
  174. package/src/client/theme/components/Video/index.ts +0 -1
  175. package/src/client/theme/components/Video/video.css +0 -41
  176. package/src/client/theme/components/mdx/Admonition.tsx +0 -80
  177. package/src/client/theme/components/mdx/Badge.tsx +0 -31
  178. package/src/client/theme/components/mdx/Button.tsx +0 -50
  179. package/src/client/theme/components/mdx/Card.tsx +0 -80
  180. package/src/client/theme/components/mdx/Field.tsx +0 -60
  181. package/src/client/theme/components/mdx/FileTree.tsx +0 -229
  182. package/src/client/theme/components/mdx/List.tsx +0 -57
  183. package/src/client/theme/components/mdx/Table.tsx +0 -151
  184. package/src/client/theme/components/mdx/Tabs.tsx +0 -123
  185. package/src/client/theme/components/mdx/index.ts +0 -27
  186. package/src/client/theme/components/mdx/mdx-components.css +0 -764
  187. package/src/client/theme/icons/bun.tsx +0 -62
  188. package/src/client/theme/icons/deno.tsx +0 -20
  189. package/src/client/theme/icons/discord.tsx +0 -12
  190. package/src/client/theme/icons/github.tsx +0 -15
  191. package/src/client/theme/icons/npm.tsx +0 -13
  192. package/src/client/theme/icons/pnpm.tsx +0 -72
  193. package/src/client/theme/icons/twitter.tsx +0 -12
  194. package/src/client/theme/styles/markdown.css +0 -394
  195. package/src/client/theme/styles/variables.css +0 -175
  196. package/src/client/theme/styles.css +0 -39
  197. package/src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx +0 -68
  198. package/src/client/theme/ui/Breadcrumbs/index.ts +0 -1
  199. package/src/client/theme/ui/CopyMarkdown/CopyMarkdown.tsx +0 -82
  200. package/src/client/theme/ui/CopyMarkdown/copy-markdown.css +0 -112
  201. package/src/client/theme/ui/CopyMarkdown/index.ts +0 -1
  202. package/src/client/theme/ui/ErrorBoundary/ErrorBoundary.tsx +0 -50
  203. package/src/client/theme/ui/ErrorBoundary/error-boundary.css +0 -55
  204. package/src/client/theme/ui/ErrorBoundary/index.ts +0 -1
  205. package/src/client/theme/ui/Footer/footer.css +0 -32
  206. package/src/client/theme/ui/Head/Head.tsx +0 -69
  207. package/src/client/theme/ui/Head/index.ts +0 -1
  208. package/src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx +0 -125
  209. package/src/client/theme/ui/LanguageSwitcher/index.ts +0 -1
  210. package/src/client/theme/ui/LanguageSwitcher/language-switcher.css +0 -98
  211. package/src/client/theme/ui/Layout/Layout.tsx +0 -203
  212. package/src/client/theme/ui/Layout/base.css +0 -106
  213. package/src/client/theme/ui/Layout/index.ts +0 -2
  214. package/src/client/theme/ui/Layout/pagination.css +0 -72
  215. package/src/client/theme/ui/Layout/responsive.css +0 -47
  216. package/src/client/theme/ui/Link/Link.tsx +0 -392
  217. package/src/client/theme/ui/Link/LinkPreview.tsx +0 -59
  218. package/src/client/theme/ui/Link/index.ts +0 -2
  219. package/src/client/theme/ui/Link/link-preview.css +0 -48
  220. package/src/client/theme/ui/Loading/Loading.tsx +0 -10
  221. package/src/client/theme/ui/Loading/index.ts +0 -1
  222. package/src/client/theme/ui/Loading/loading.css +0 -30
  223. package/src/client/theme/ui/Navbar/GithubStars.tsx +0 -27
  224. package/src/client/theme/ui/Navbar/Navbar.tsx +0 -193
  225. package/src/client/theme/ui/Navbar/Tabs.tsx +0 -99
  226. package/src/client/theme/ui/Navbar/index.ts +0 -2
  227. package/src/client/theme/ui/Navbar/navbar.css +0 -347
  228. package/src/client/theme/ui/NotFound/NotFound.tsx +0 -19
  229. package/src/client/theme/ui/NotFound/index.ts +0 -1
  230. package/src/client/theme/ui/NotFound/not-found.css +0 -64
  231. package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +0 -244
  232. package/src/client/theme/ui/OnThisPage/index.ts +0 -1
  233. package/src/client/theme/ui/OnThisPage/toc.css +0 -152
  234. package/src/client/theme/ui/PoweredBy/PoweredBy.tsx +0 -18
  235. package/src/client/theme/ui/PoweredBy/index.ts +0 -1
  236. package/src/client/theme/ui/PoweredBy/powered-by.css +0 -76
  237. package/src/client/theme/ui/ProgressBar/ProgressBar.css +0 -17
  238. package/src/client/theme/ui/ProgressBar/ProgressBar.tsx +0 -51
  239. package/src/client/theme/ui/ProgressBar/index.ts +0 -1
  240. package/src/client/theme/ui/SearchDialog/SearchDialog.tsx +0 -209
  241. package/src/client/theme/ui/SearchDialog/index.ts +0 -1
  242. package/src/client/theme/ui/SearchDialog/search.css +0 -152
  243. package/src/client/theme/ui/Sidebar/Sidebar.tsx +0 -244
  244. package/src/client/theme/ui/Sidebar/index.ts +0 -1
  245. package/src/client/theme/ui/Sidebar/sidebar.css +0 -230
  246. package/src/client/theme/ui/ThemeToggle/ThemeToggle.tsx +0 -69
  247. package/src/client/theme/ui/ThemeToggle/index.ts +0 -1
  248. package/src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx +0 -136
  249. package/src/client/theme/ui/VersionSwitcher/index.ts +0 -1
  250. package/src/client/utils.ts +0 -49
@@ -1,2928 +1 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __esm = (fn, res) => function __init() {
9
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
- };
11
- var __export = (target, all) => {
12
- for (var name in all)
13
- __defProp(target, name, { get: all[name], enumerable: true });
14
- };
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") {
17
- for (let key of __getOwnPropNames(from))
18
- if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
- // If the importer is in node compatibility mode or this is not an ESM
25
- // file that has been converted to a CommonJS file using a Babel-
26
- // compatible transform (i.e. "__esModule" has not been set), then set
27
- // "default" to the CommonJS "module.exports" for node compatibility.
28
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
- mod
30
- ));
31
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
-
33
- // src/client/app/preload.tsx
34
- function usePreload() {
35
- return (0, import_react.useContext)(PreloadContext);
36
- }
37
- function PreloadProvider({
38
- routes,
39
- modules,
40
- children
41
- }) {
42
- const preload = (0, import_react.useCallback)(
43
- (path) => {
44
- const cleanPath = path.split("#")[0].split("?")[0];
45
- const route = routes.find(
46
- (r) => r.path === cleanPath || cleanPath === "/" && r.path === ""
47
- );
48
- if (route && route.filePath) {
49
- const loaderKey = Object.keys(modules).find(
50
- (k) => k.endsWith("/" + route.filePath)
51
- );
52
- if (loaderKey) {
53
- modules[loaderKey]().catch((err) => {
54
- console.error(`[boltdocs] Failed to preload route ${path}:`, err);
55
- });
56
- }
57
- }
58
- },
59
- [routes, modules]
60
- );
61
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PreloadContext.Provider, { value: { preload, routes }, children });
62
- }
63
- var import_react, import_jsx_runtime, PreloadContext;
64
- var init_preload = __esm({
65
- "src/client/app/preload.tsx"() {
66
- "use strict";
67
- import_react = require("react");
68
- import_jsx_runtime = require("react/jsx-runtime");
69
- PreloadContext = (0, import_react.createContext)({
70
- preload: () => {
71
- },
72
- routes: []
73
- });
74
- }
75
- });
76
-
77
- // src/client/theme/ui/Link/link-preview.css
78
- var init_link_preview = __esm({
79
- "src/client/theme/ui/Link/link-preview.css"() {
80
- }
81
- });
82
-
83
- // src/client/theme/ui/Link/LinkPreview.tsx
84
- function LinkPreview({
85
- isVisible,
86
- title,
87
- summary,
88
- x,
89
- y
90
- }) {
91
- const ref = (0, import_react2.useRef)(null);
92
- const [position, setPosition] = (0, import_react2.useState)({ top: 0, left: 0 });
93
- (0, import_react2.useEffect)(() => {
94
- if (ref.current) {
95
- const rect = ref.current.getBoundingClientRect();
96
- const padding = 12;
97
- let top = y + padding;
98
- let left = x + padding;
99
- if (left + rect.width > window.innerWidth - 20) {
100
- left = x - rect.width - padding;
101
- }
102
- if (top + rect.height > window.innerHeight - 20) {
103
- top = y - rect.height - padding;
104
- }
105
- setPosition({ top, left });
106
- }
107
- }, [x, y, isVisible]);
108
- return (0, import_react_dom.createPortal)(
109
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
110
- "div",
111
- {
112
- ref,
113
- className: `boltdocs-link-preview ${isVisible ? "is-visible" : ""}`,
114
- style: {
115
- top: position.top,
116
- left: position.left
117
- },
118
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "boltdocs-link-preview-content", children: [
119
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "boltdocs-link-preview-title", children: title }),
120
- summary && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "boltdocs-link-preview-summary", children: summary })
121
- ] })
122
- }
123
- ),
124
- document.body
125
- );
126
- }
127
- var import_react2, import_react_dom, import_jsx_runtime2;
128
- var init_LinkPreview = __esm({
129
- "src/client/theme/ui/Link/LinkPreview.tsx"() {
130
- "use strict";
131
- import_react2 = require("react");
132
- import_react_dom = require("react-dom");
133
- init_link_preview();
134
- import_jsx_runtime2 = require("react/jsx-runtime");
135
- }
136
- });
137
-
138
- // src/client/theme/ui/Link/Link.tsx
139
- function useLocalizedTo(to) {
140
- const location = (0, import_react_router_dom.useLocation)();
141
- const config = useConfig();
142
- if (!config || typeof to !== "string") return to;
143
- if (!config.i18n && !config.versions) return to;
144
- const basePath = "/docs";
145
- if (!to.startsWith(basePath)) return to;
146
- const curSub = location.pathname.substring(basePath.length);
147
- const curParts = curSub.split("/").filter(Boolean);
148
- let currentVersion = config.versions?.defaultVersion;
149
- let currentLocale = config.i18n?.defaultLocale;
150
- let cIdx = 0;
151
- if (config.versions && curParts.length > cIdx && config.versions.versions[curParts[cIdx]]) {
152
- currentVersion = curParts[cIdx];
153
- cIdx++;
154
- }
155
- if (config.i18n && curParts.length > cIdx && config.i18n.locales[curParts[cIdx]]) {
156
- currentLocale = curParts[cIdx];
157
- }
158
- const toSub = to.substring(basePath.length);
159
- const toParts = toSub.split("/").filter(Boolean);
160
- let tIdx = 0;
161
- let hasVersion = false;
162
- let hasLocale = false;
163
- if (config.versions && toParts.length > tIdx && config.versions.versions[toParts[tIdx]]) {
164
- hasVersion = true;
165
- tIdx++;
166
- }
167
- if (config.i18n && toParts.length > tIdx && config.i18n.locales[toParts[tIdx]]) {
168
- hasLocale = true;
169
- tIdx++;
170
- }
171
- const routeParts = toParts.slice(tIdx);
172
- const finalParts = [];
173
- if (config.versions) {
174
- if (hasVersion) {
175
- finalParts.push(toParts[0]);
176
- } else if (currentVersion) {
177
- finalParts.push(currentVersion);
178
- }
179
- }
180
- if (config.i18n) {
181
- if (hasLocale) {
182
- finalParts.push(toParts[hasVersion ? 1 : 0]);
183
- } else if (currentLocale) {
184
- finalParts.push(currentLocale);
185
- }
186
- }
187
- finalParts.push(...routeParts);
188
- let finalPath = `${basePath}/${finalParts.join("/")}`;
189
- if (finalPath.endsWith("/")) {
190
- finalPath = finalPath.slice(0, -1);
191
- }
192
- return finalPath === basePath ? basePath : finalPath;
193
- }
194
- var import_react3, import_react_router_dom, import_jsx_runtime3, Link, NavLink;
195
- var init_Link = __esm({
196
- "src/client/theme/ui/Link/Link.tsx"() {
197
- "use strict";
198
- import_react3 = __toESM(require("react"));
199
- import_react_router_dom = require("react-router-dom");
200
- init_preload();
201
- init_app();
202
- init_LinkPreview();
203
- import_jsx_runtime3 = require("react/jsx-runtime");
204
- Link = import_react3.default.forwardRef(
205
- (props, ref) => {
206
- const {
207
- boltdocsPrefetch = "hover",
208
- boltdocsPreview = true,
209
- onMouseEnter,
210
- onMouseLeave,
211
- onFocus,
212
- onBlur,
213
- onClick,
214
- to,
215
- ...rest
216
- } = props;
217
- const localizedTo = useLocalizedTo(to);
218
- const { preload, routes } = usePreload();
219
- const config = useConfig();
220
- const navigate = (0, import_react_router_dom.useNavigate)();
221
- const shouldShowPreview = boltdocsPreview && config?.themeConfig?.linkPreview !== false;
222
- const [preview, setPreview] = import_react3.default.useState({ visible: false, x: 0, y: 0, title: "" });
223
- const handleMouseEnter = (e) => {
224
- onMouseEnter?.(e);
225
- if (boltdocsPrefetch === "hover" && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
226
- preload(localizedTo);
227
- }
228
- if (shouldShowPreview && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
229
- const cleanPath = localizedTo.split("#")[0].split("?")[0];
230
- const route = routes.find(
231
- (r) => r.path === cleanPath || cleanPath === "/" && r.path === ""
232
- );
233
- if (route) {
234
- setPreview({
235
- visible: true,
236
- x: e.clientX,
237
- y: e.clientY,
238
- title: route.title,
239
- summary: route.description
240
- });
241
- }
242
- }
243
- };
244
- const handleMouseMove = (e) => {
245
- if (preview.visible) {
246
- setPreview((prev) => ({ ...prev, x: e.clientX, y: e.clientY }));
247
- }
248
- };
249
- const handleMouseLeave = (e) => {
250
- onMouseLeave?.(e);
251
- setPreview((prev) => ({ ...prev, visible: false }));
252
- };
253
- const handleFocus = (e) => {
254
- onFocus?.(e);
255
- if (boltdocsPrefetch === "hover" && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
256
- preload(localizedTo);
257
- }
258
- };
259
- const handleBlur = (e) => {
260
- onBlur?.(e);
261
- setPreview((prev) => ({ ...prev, visible: false }));
262
- };
263
- const handleClick = (e) => {
264
- onClick?.(e);
265
- setPreview((prev) => ({ ...prev, visible: false }));
266
- if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) {
267
- return;
268
- }
269
- if (typeof localizedTo === "string" && !localizedTo.startsWith("http")) {
270
- e.preventDefault();
271
- import_react3.default.startTransition(() => {
272
- navigate(localizedTo);
273
- });
274
- }
275
- };
276
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
277
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
278
- import_react_router_dom.Link,
279
- {
280
- ref,
281
- to: localizedTo,
282
- onMouseEnter: handleMouseEnter,
283
- onMouseMove: handleMouseMove,
284
- onMouseLeave: handleMouseLeave,
285
- onFocus: handleFocus,
286
- onBlur: handleBlur,
287
- onClick: handleClick,
288
- ...rest
289
- }
290
- ),
291
- preview.visible && shouldShowPreview && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
292
- LinkPreview,
293
- {
294
- isVisible: preview.visible,
295
- title: preview.title,
296
- summary: preview.summary,
297
- x: preview.x,
298
- y: preview.y
299
- }
300
- )
301
- ] });
302
- }
303
- );
304
- Link.displayName = "Link";
305
- NavLink = import_react3.default.forwardRef(
306
- (props, ref) => {
307
- const {
308
- boltdocsPrefetch = "hover",
309
- boltdocsPreview = true,
310
- onMouseEnter,
311
- onMouseLeave,
312
- onFocus,
313
- onBlur,
314
- onClick,
315
- to,
316
- ...rest
317
- } = props;
318
- const localizedTo = useLocalizedTo(to);
319
- const { preload, routes } = usePreload();
320
- const config = useConfig();
321
- const navigate = (0, import_react_router_dom.useNavigate)();
322
- const shouldShowPreview = boltdocsPreview && config?.themeConfig?.linkPreview !== false;
323
- const [preview, setPreview] = import_react3.default.useState({ visible: false, x: 0, y: 0, title: "" });
324
- const handleMouseEnter = (e) => {
325
- onMouseEnter?.(e);
326
- if (boltdocsPrefetch === "hover" && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
327
- preload(localizedTo);
328
- }
329
- if (shouldShowPreview && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
330
- const cleanPath = localizedTo.split("#")[0].split("?")[0];
331
- const route = routes.find(
332
- (r) => r.path === cleanPath || cleanPath === "/" && r.path === ""
333
- );
334
- if (route) {
335
- setPreview({
336
- visible: true,
337
- x: e.clientX,
338
- y: e.clientY,
339
- title: route.title,
340
- summary: route.description
341
- });
342
- }
343
- }
344
- };
345
- const handleMouseMove = (e) => {
346
- if (preview.visible) {
347
- setPreview((prev) => ({ ...prev, x: e.clientX, y: e.clientY }));
348
- }
349
- };
350
- const handleMouseLeave = (e) => {
351
- onMouseLeave?.(e);
352
- setPreview((prev) => ({ ...prev, visible: false }));
353
- };
354
- const handleFocus = (e) => {
355
- onFocus?.(e);
356
- if (boltdocsPrefetch === "hover" && typeof localizedTo === "string" && localizedTo.startsWith("/")) {
357
- preload(localizedTo);
358
- }
359
- };
360
- const handleBlur = (e) => {
361
- onBlur?.(e);
362
- setPreview((prev) => ({ ...prev, visible: false }));
363
- };
364
- const handleClick = (e) => {
365
- onClick?.(e);
366
- setPreview((prev) => ({ ...prev, visible: false }));
367
- if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) {
368
- return;
369
- }
370
- if (typeof localizedTo === "string" && !localizedTo.startsWith("http")) {
371
- e.preventDefault();
372
- import_react3.default.startTransition(() => {
373
- navigate(localizedTo);
374
- });
375
- }
376
- };
377
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
378
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
379
- import_react_router_dom.NavLink,
380
- {
381
- ref,
382
- to: localizedTo,
383
- onMouseEnter: handleMouseEnter,
384
- onMouseMove: handleMouseMove,
385
- onMouseLeave: handleMouseLeave,
386
- onFocus: handleFocus,
387
- onBlur: handleBlur,
388
- onClick: handleClick,
389
- ...rest
390
- }
391
- ),
392
- preview.visible && shouldShowPreview && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
393
- LinkPreview,
394
- {
395
- isVisible: preview.visible,
396
- title: preview.title,
397
- summary: preview.summary,
398
- x: preview.x,
399
- y: preview.y
400
- }
401
- )
402
- ] });
403
- }
404
- );
405
- NavLink.displayName = "NavLink";
406
- }
407
- });
408
-
409
- // src/client/theme/ui/Link/index.ts
410
- var init_Link2 = __esm({
411
- "src/client/theme/ui/Link/index.ts"() {
412
- "use strict";
413
- init_Link();
414
- }
415
- });
416
-
417
- // src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx
418
- function getBaseFilePath(filePath, version, locale) {
419
- let path = filePath;
420
- if (version && (path === version || path.startsWith(version + "/"))) {
421
- path = path === version ? "index.md" : path.slice(version.length + 1);
422
- }
423
- if (locale && (path === locale || path.startsWith(locale + "/"))) {
424
- path = path === locale ? "index.md" : path.slice(locale.length + 1);
425
- }
426
- return path;
427
- }
428
- function LanguageSwitcher({
429
- i18n,
430
- currentLocale,
431
- allRoutes
432
- }) {
433
- const [isOpen, setIsOpen] = (0, import_react4.useState)(false);
434
- const dropdownRef = (0, import_react4.useRef)(null);
435
- const navigate = (0, import_react_router_dom2.useNavigate)();
436
- const location = (0, import_react_router_dom2.useLocation)();
437
- (0, import_react4.useEffect)(() => {
438
- function handleClickOutside(event) {
439
- if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
440
- setIsOpen(false);
441
- }
442
- }
443
- document.addEventListener("mousedown", handleClickOutside);
444
- return () => document.removeEventListener("mousedown", handleClickOutside);
445
- }, []);
446
- const handleSelect = (locale) => {
447
- setIsOpen(false);
448
- if (locale === currentLocale) return;
449
- const currentRoute = allRoutes.find((r) => r.path === location.pathname);
450
- let targetPath = "/";
451
- if (currentRoute) {
452
- const baseFile = getBaseFilePath(
453
- currentRoute.filePath,
454
- currentRoute.version,
455
- currentRoute.locale
456
- );
457
- const targetRoute = allRoutes.find(
458
- (r) => getBaseFilePath(r.filePath, r.version, r.locale) === baseFile && (r.locale || i18n.defaultLocale) === locale && r.version === currentRoute.version
459
- );
460
- if (targetRoute) {
461
- targetPath = targetRoute.path;
462
- } else {
463
- const defaultIndexRoute = allRoutes.find(
464
- (r) => getBaseFilePath(r.filePath, r.version, r.locale) === "index.md" && (r.locale || i18n.defaultLocale) === locale && r.version === currentRoute.version
465
- );
466
- targetPath = defaultIndexRoute ? defaultIndexRoute.path : locale === i18n.defaultLocale ? currentRoute.version ? `/${currentRoute.version}` : "/" : currentRoute.version ? `/${currentRoute.version}/${locale}` : `/${locale}`;
467
- }
468
- } else {
469
- targetPath = locale === i18n.defaultLocale ? "/" : `/${locale}`;
470
- }
471
- navigate(targetPath);
472
- };
473
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "boltdocs-language-switcher", ref: dropdownRef, children: [
474
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
475
- "button",
476
- {
477
- className: "language-btn",
478
- onClick: () => setIsOpen(!isOpen),
479
- "aria-label": "Switch language",
480
- "aria-expanded": isOpen,
481
- "aria-haspopup": "listbox",
482
- children: [
483
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.Globe, { size: 18 }),
484
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "language-label", children: i18n.locales[currentLocale] || currentLocale }),
485
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.ChevronDown, { size: 14 })
486
- ]
487
- }
488
- ),
489
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "language-dropdown", children: Object.entries(i18n.locales).map(([key, label]) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
490
- "button",
491
- {
492
- className: `language-option ${key === currentLocale ? "active" : ""}`,
493
- onClick: () => handleSelect(key),
494
- children: label
495
- },
496
- key
497
- )) })
498
- ] });
499
- }
500
- var import_react4, import_lucide_react, import_react_router_dom2, import_jsx_runtime4;
501
- var init_LanguageSwitcher = __esm({
502
- "src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx"() {
503
- "use strict";
504
- import_react4 = require("react");
505
- import_lucide_react = require("lucide-react");
506
- import_react_router_dom2 = require("react-router-dom");
507
- import_jsx_runtime4 = require("react/jsx-runtime");
508
- }
509
- });
510
-
511
- // src/client/theme/ui/LanguageSwitcher/index.ts
512
- var init_LanguageSwitcher2 = __esm({
513
- "src/client/theme/ui/LanguageSwitcher/index.ts"() {
514
- "use strict";
515
- init_LanguageSwitcher();
516
- }
517
- });
518
-
519
- // src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx
520
- function getBaseFilePath2(filePath, version, locale) {
521
- let path = filePath;
522
- if (version && (path === version || path.startsWith(version + "/"))) {
523
- path = path === version ? "index.md" : path.slice(version.length + 1);
524
- }
525
- if (locale && (path === locale || path.startsWith(locale + "/"))) {
526
- path = path === locale ? "index.md" : path.slice(locale.length + 1);
527
- }
528
- return path;
529
- }
530
- function VersionSwitcher({
531
- versions,
532
- currentVersion,
533
- currentLocale,
534
- allRoutes
535
- }) {
536
- const [isOpen, setIsOpen] = (0, import_react5.useState)(false);
537
- const dropdownRef = (0, import_react5.useRef)(null);
538
- const navigate = (0, import_react_router_dom3.useNavigate)();
539
- const location = (0, import_react_router_dom3.useLocation)();
540
- (0, import_react5.useEffect)(() => {
541
- function handleClickOutside(event) {
542
- if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
543
- setIsOpen(false);
544
- }
545
- }
546
- document.addEventListener("mousedown", handleClickOutside);
547
- return () => document.removeEventListener("mousedown", handleClickOutside);
548
- }, []);
549
- const handleSelect = (version) => {
550
- setIsOpen(false);
551
- if (version === currentVersion) return;
552
- const currentRoute = allRoutes.find((r) => r.path === location.pathname);
553
- let targetPath = `/docs/${version}`;
554
- if (currentRoute) {
555
- const baseFile = getBaseFilePath2(
556
- currentRoute.filePath,
557
- currentRoute.version,
558
- currentRoute.locale
559
- );
560
- const targetRoute = allRoutes.find(
561
- (r) => getBaseFilePath2(r.filePath, r.version, r.locale) === baseFile && (r.version || versions.defaultVersion) === version && (currentLocale ? r.locale === currentLocale : !r.locale)
562
- );
563
- if (targetRoute) {
564
- targetPath = targetRoute.path;
565
- } else {
566
- const versionIndexRoute = allRoutes.find(
567
- (r) => getBaseFilePath2(r.filePath, r.version, r.locale) === "index.md" && (r.version || versions.defaultVersion) === version && (currentLocale ? r.locale === currentLocale : !r.locale)
568
- );
569
- targetPath = versionIndexRoute ? versionIndexRoute.path : `/docs/${version}${currentLocale ? `/${currentLocale}` : ""}`;
570
- }
571
- }
572
- navigate(targetPath);
573
- };
574
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
575
- "div",
576
- {
577
- className: "boltdocs-version-switcher",
578
- ref: dropdownRef,
579
- style: { position: "relative", display: "flex", alignItems: "center" },
580
- children: [
581
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
582
- "button",
583
- {
584
- className: "navbar-version",
585
- onClick: () => setIsOpen(!isOpen),
586
- "aria-label": "Switch version",
587
- "aria-expanded": isOpen,
588
- "aria-haspopup": "listbox",
589
- style: {
590
- fontFamily: "inherit",
591
- padding: "0.25rem 0.5rem",
592
- marginLeft: "0.5rem"
593
- },
594
- children: [
595
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: versions.versions[currentVersion] || currentVersion }),
596
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.ChevronDown, { size: 14 })
597
- ]
598
- }
599
- ),
600
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
601
- "div",
602
- {
603
- className: "language-dropdown",
604
- style: {
605
- left: "0.5rem",
606
- right: "auto",
607
- minWidth: "150px",
608
- top: "calc(100% + 8px)"
609
- },
610
- children: Object.entries(versions.versions).map(([key, label]) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
611
- "button",
612
- {
613
- className: `language-option ${key === currentVersion ? "active" : ""}`,
614
- onClick: () => handleSelect(key),
615
- children: label
616
- },
617
- key
618
- ))
619
- }
620
- )
621
- ]
622
- }
623
- );
624
- }
625
- var import_react5, import_lucide_react2, import_react_router_dom3, import_jsx_runtime5;
626
- var init_VersionSwitcher = __esm({
627
- "src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx"() {
628
- "use strict";
629
- import_react5 = require("react");
630
- import_lucide_react2 = require("lucide-react");
631
- import_react_router_dom3 = require("react-router-dom");
632
- import_jsx_runtime5 = require("react/jsx-runtime");
633
- }
634
- });
635
-
636
- // src/client/theme/ui/VersionSwitcher/index.ts
637
- var init_VersionSwitcher2 = __esm({
638
- "src/client/theme/ui/VersionSwitcher/index.ts"() {
639
- "use strict";
640
- init_VersionSwitcher();
641
- }
642
- });
643
-
644
- // src/client/theme/ui/ThemeToggle/ThemeToggle.tsx
645
- function ThemeToggle() {
646
- const [theme, setTheme] = (0, import_react6.useState)("dark");
647
- const [mounted, setMounted] = (0, import_react6.useState)(false);
648
- (0, import_react6.useEffect)(() => {
649
- setMounted(true);
650
- const stored = localStorage.getItem("boltdocs-theme");
651
- if (stored === "light" || stored === "dark") {
652
- setTheme(stored);
653
- } else {
654
- const prefersDark = window.matchMedia(
655
- "(prefers-color-scheme: dark)"
656
- ).matches;
657
- setTheme(prefersDark ? "dark" : "light");
658
- }
659
- const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
660
- const handleChange = (e) => {
661
- if (!localStorage.getItem("boltdocs-theme")) {
662
- setTheme(e.matches ? "dark" : "light");
663
- }
664
- };
665
- mediaQuery.addEventListener("change", handleChange);
666
- return () => mediaQuery.removeEventListener("change", handleChange);
667
- }, []);
668
- (0, import_react6.useEffect)(() => {
669
- if (!mounted) return;
670
- const root = document.documentElement;
671
- if (theme === "light") {
672
- root.classList.add("theme-light");
673
- root.dataset.theme = "light";
674
- } else {
675
- root.classList.remove("theme-light");
676
- root.dataset.theme = "dark";
677
- }
678
- }, [theme, mounted]);
679
- const toggleTheme = () => {
680
- const newTheme = theme === "dark" ? "light" : "dark";
681
- setTheme(newTheme);
682
- localStorage.setItem("boltdocs-theme", newTheme);
683
- };
684
- if (!mounted) {
685
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { className: "navbar-icon-btn", "aria-label": "Toggle theme", disabled: true, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { width: 20, height: 20, display: "inline-block" } }) });
686
- }
687
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
688
- "button",
689
- {
690
- className: "navbar-icon-btn",
691
- onClick: toggleTheme,
692
- "aria-label": "Toggle theme",
693
- title: `Switch to ${theme === "dark" ? "light" : "dark"} theme`,
694
- children: theme === "dark" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react3.Sun, { size: 20 }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react3.Moon, { size: 20 })
695
- }
696
- );
697
- }
698
- var import_react6, import_lucide_react3, import_jsx_runtime6;
699
- var init_ThemeToggle = __esm({
700
- "src/client/theme/ui/ThemeToggle/ThemeToggle.tsx"() {
701
- "use strict";
702
- import_react6 = require("react");
703
- import_lucide_react3 = require("lucide-react");
704
- import_jsx_runtime6 = require("react/jsx-runtime");
705
- }
706
- });
707
-
708
- // src/client/theme/ui/ThemeToggle/index.ts
709
- var init_ThemeToggle2 = __esm({
710
- "src/client/theme/ui/ThemeToggle/index.ts"() {
711
- "use strict";
712
- init_ThemeToggle();
713
- }
714
- });
715
-
716
- // src/client/theme/icons/discord.tsx
717
- var import_jsx_runtime7, Discord;
718
- var init_discord = __esm({
719
- "src/client/theme/icons/discord.tsx"() {
720
- "use strict";
721
- import_jsx_runtime7 = require("react/jsx-runtime");
722
- Discord = (props) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("svg", { ...props, viewBox: "0 0 256 199", preserveAspectRatio: "xMidYMid", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
723
- "path",
724
- {
725
- d: "M216.856 16.597A208.502 208.502 0 0 0 164.042 0c-2.275 4.113-4.933 9.645-6.766 14.046-19.692-2.961-39.203-2.961-58.533 0-1.832-4.4-4.55-9.933-6.846-14.046a207.809 207.809 0 0 0-52.855 16.638C5.618 67.147-3.443 116.4 1.087 164.956c22.169 16.555 43.653 26.612 64.775 33.193A161.094 161.094 0 0 0 79.735 175.3a136.413 136.413 0 0 1-21.846-10.632 108.636 108.636 0 0 0 5.356-4.237c42.122 19.702 87.89 19.702 129.51 0a131.66 131.66 0 0 0 5.355 4.237 136.07 136.07 0 0 1-21.886 10.653c4.006 8.02 8.638 15.67 13.873 22.848 21.142-6.58 42.646-16.637 64.815-33.213 5.316-56.288-9.08-105.09-38.056-148.36ZM85.474 135.095c-12.645 0-23.015-11.805-23.015-26.18s10.149-26.2 23.015-26.2c12.867 0 23.236 11.804 23.015 26.2.02 14.375-10.148 26.18-23.015 26.18Zm85.051 0c-12.645 0-23.014-11.805-23.014-26.18s10.148-26.2 23.014-26.2c12.867 0 23.236 11.804 23.015 26.2 0 14.375-10.148 26.18-23.015 26.18Z",
726
- fill: "currentColor"
727
- }
728
- ) });
729
- }
730
- });
731
-
732
- // src/client/theme/icons/twitter.tsx
733
- var import_jsx_runtime8, XformerlyTwitter;
734
- var init_twitter = __esm({
735
- "src/client/theme/icons/twitter.tsx"() {
736
- "use strict";
737
- import_jsx_runtime8 = require("react/jsx-runtime");
738
- XformerlyTwitter = (props) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("svg", { ...props, fill: "none", viewBox: "0 0 1200 1227", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
739
- "path",
740
- {
741
- fill: "currentColor",
742
- d: "M714.163 519.284 1160.89 0h-105.86L667.137 450.887 357.328 0H0l468.492 681.821L0 1226.37h105.866l409.625-476.152 327.181 476.152H1200L714.137 519.284h.026ZM569.165 687.828l-47.468-67.894-377.686-540.24h162.604l304.797 435.991 47.468 67.894 396.2 566.721H892.476L569.165 687.854v-.026Z"
743
- }
744
- ) });
745
- }
746
- });
747
-
748
- // src/client/theme/icons/github.tsx
749
- var import_jsx_runtime9, GitHub;
750
- var init_github = __esm({
751
- "src/client/theme/icons/github.tsx"() {
752
- "use strict";
753
- import_jsx_runtime9 = require("react/jsx-runtime");
754
- GitHub = (props) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { ...props, viewBox: "0 0 1024 1024", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
755
- "path",
756
- {
757
- fillRule: "evenodd",
758
- clipRule: "evenodd",
759
- d: "M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z",
760
- transform: "scale(64)",
761
- fill: "currentColor"
762
- }
763
- ) });
764
- }
765
- });
766
-
767
- // src/client/utils.ts
768
- async function getStarsRepo(repo) {
769
- const response = await fetch(`https://api.github.com/repos/${repo}`);
770
- const data = await response.json();
771
- if (data.stargazers_count !== void 0) {
772
- return formatStars(data.stargazers_count);
773
- } else {
774
- return "0";
775
- }
776
- }
777
- var formatStars, copyToClipboard;
778
- var init_utils = __esm({
779
- "src/client/utils.ts"() {
780
- "use strict";
781
- formatStars = (count) => {
782
- return Intl.NumberFormat("en", {
783
- notation: "compact",
784
- compactDisplay: "short"
785
- }).format(count);
786
- };
787
- copyToClipboard = async (text) => {
788
- try {
789
- await navigator.clipboard.writeText(text);
790
- return true;
791
- } catch {
792
- const textarea = document.createElement("textarea");
793
- textarea.value = text;
794
- textarea.style.position = "fixed";
795
- textarea.style.opacity = "0";
796
- document.body.appendChild(textarea);
797
- textarea.select();
798
- document.execCommand("copy");
799
- document.body.removeChild(textarea);
800
- return true;
801
- }
802
- };
803
- }
804
- });
805
-
806
- // src/client/theme/ui/Navbar/GithubStars.tsx
807
- function GithubStars({ repo }) {
808
- const [stars, setStars] = (0, import_react7.useState)(null);
809
- (0, import_react7.useEffect)(() => {
810
- if (repo) {
811
- getStarsRepo(repo).then((stars2) => setStars(stars2)).catch(() => setStars("0"));
812
- }
813
- }, [repo]);
814
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
815
- "a",
816
- {
817
- href: `https://github.com/${repo}`,
818
- target: "_blank",
819
- rel: "noopener noreferrer",
820
- className: "navbar-github-stars",
821
- children: [
822
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(GitHub, {}),
823
- stars && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: stars })
824
- ]
825
- }
826
- );
827
- }
828
- var import_react7, import_jsx_runtime10;
829
- var init_GithubStars = __esm({
830
- "src/client/theme/ui/Navbar/GithubStars.tsx"() {
831
- "use strict";
832
- import_react7 = require("react");
833
- init_github();
834
- init_utils();
835
- import_jsx_runtime10 = require("react/jsx-runtime");
836
- }
837
- });
838
-
839
- // src/client/theme/ui/Navbar/Tabs.tsx
840
- function Tabs({ tabs, routes }) {
841
- const location = (0, import_react_router_dom4.useLocation)();
842
- const containerRef = (0, import_react8.useRef)(null);
843
- const tabRefs = (0, import_react8.useRef)([]);
844
- const [indicatorStyle, setIndicatorStyle] = (0, import_react8.useState)({
845
- opacity: 0,
846
- transform: "translateX(0) scaleX(0)",
847
- width: 0
848
- });
849
- const currentRoute = routes.find((r) => r.path === location.pathname);
850
- const currentTabId = currentRoute?.tab?.toLowerCase();
851
- const activeIndex = tabs.findIndex(
852
- (tab) => currentTabId ? currentTabId === tab.id.toLowerCase() : false
853
- );
854
- const finalActiveIndex = activeIndex === -1 ? 0 : activeIndex;
855
- (0, import_react8.useEffect)(() => {
856
- const activeTab = tabRefs.current[finalActiveIndex];
857
- if (activeTab) {
858
- setIndicatorStyle({
859
- opacity: 1,
860
- width: activeTab.offsetWidth,
861
- transform: `translateX(${activeTab.offsetLeft}px)`
862
- });
863
- }
864
- }, [finalActiveIndex, tabs, location.pathname]);
865
- if (!tabs || tabs.length === 0) return null;
866
- const renderTabIcon = (iconName) => {
867
- if (!iconName) return null;
868
- if (iconName.trim().startsWith("<svg")) {
869
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
870
- "span",
871
- {
872
- className: "tab-icon svg-icon",
873
- dangerouslySetInnerHTML: { __html: iconName }
874
- }
875
- );
876
- }
877
- const LucideIcon = Icons[iconName];
878
- if (LucideIcon) {
879
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LucideIcon, { size: 16, className: "tab-icon lucide-icon" });
880
- }
881
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("img", { src: iconName, alt: "", className: "tab-icon img-icon" });
882
- };
883
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "boltdocs-tabs-container", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "boltdocs-tabs", ref: containerRef, children: [
884
- tabs.map((tab, index) => {
885
- const isActive = index === finalActiveIndex;
886
- const firstRoute = routes.find(
887
- (r) => r.tab && r.tab.toLowerCase() === tab.id.toLowerCase()
888
- );
889
- const linkTo = firstRoute ? firstRoute.path : "#";
890
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
891
- Link,
892
- {
893
- to: linkTo,
894
- ref: (el) => {
895
- tabRefs.current[index] = el;
896
- },
897
- className: `boltdocs-tab-item ${isActive ? "active" : ""}`,
898
- children: [
899
- renderTabIcon(tab.icon),
900
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: tab.text })
901
- ]
902
- },
903
- tab.id
904
- );
905
- }),
906
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "boltdocs-tab-indicator", style: indicatorStyle })
907
- ] }) });
908
- }
909
- var import_react8, import_react_router_dom4, Icons, import_jsx_runtime11;
910
- var init_Tabs = __esm({
911
- "src/client/theme/ui/Navbar/Tabs.tsx"() {
912
- "use strict";
913
- import_react8 = require("react");
914
- import_react_router_dom4 = require("react-router-dom");
915
- init_Link2();
916
- Icons = __toESM(require("lucide-react"));
917
- import_jsx_runtime11 = require("react/jsx-runtime");
918
- }
919
- });
920
-
921
- // src/client/theme/ui/SearchDialog/SearchDialog.tsx
922
- function SearchDialog({ routes }) {
923
- const [isOpen, setIsOpen] = (0, import_react9.useState)(false);
924
- const [query, setQuery] = (0, import_react9.useState)("");
925
- const inputRef = (0, import_react9.useRef)(null);
926
- (0, import_react9.useEffect)(() => {
927
- const handleKeyDown = (e) => {
928
- if ((e.metaKey || e.ctrlKey) && e.key === "k") {
929
- e.preventDefault();
930
- setIsOpen((prev) => !prev);
931
- }
932
- if (e.key === "Escape" && isOpen) {
933
- setIsOpen(false);
934
- }
935
- };
936
- window.addEventListener("keydown", handleKeyDown);
937
- return () => window.removeEventListener("keydown", handleKeyDown);
938
- }, [isOpen]);
939
- (0, import_react9.useEffect)(() => {
940
- if (isOpen) {
941
- setTimeout(() => inputRef.current?.focus(), 50);
942
- } else {
943
- setQuery("");
944
- }
945
- }, [isOpen]);
946
- const searchResults = import_react9.default.useMemo(() => {
947
- if (!query) {
948
- return routes.slice(0, 10).map((r) => ({
949
- title: r.title,
950
- path: r.path,
951
- groupTitle: r.groupTitle
952
- }));
953
- }
954
- const results = [];
955
- const lowerQuery = query.toLowerCase();
956
- for (const route of routes) {
957
- if (route.title && route.title.toLowerCase().includes(lowerQuery)) {
958
- results.push({
959
- title: route.title,
960
- path: route.path,
961
- groupTitle: route.groupTitle
962
- });
963
- }
964
- if (route.headings) {
965
- for (const heading of route.headings) {
966
- if (heading.text.toLowerCase().includes(lowerQuery)) {
967
- results.push({
968
- title: heading.text,
969
- path: `${route.path}#${heading.id}`,
970
- groupTitle: route.title,
971
- isHeading: true
972
- });
973
- }
974
- }
975
- }
976
- if (route._content && route._content.toLowerCase().includes(lowerQuery)) {
977
- results.push({
978
- title: route.title,
979
- path: route.path,
980
- groupTitle: route.groupTitle
981
- });
982
- }
983
- }
984
- const uniqueResults = [];
985
- const seenPaths = /* @__PURE__ */ new Set();
986
- for (const res of results) {
987
- if (!seenPaths.has(res.path)) {
988
- seenPaths.add(res.path);
989
- uniqueResults.push(res);
990
- }
991
- }
992
- return uniqueResults.slice(0, 10);
993
- }, [routes, query]);
994
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
995
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
996
- "div",
997
- {
998
- className: "navbar-search",
999
- role: "button",
1000
- tabIndex: 0,
1001
- onClick: () => setIsOpen(true),
1002
- onKeyDown: (e) => {
1003
- if (e.key === "Enter" || e.key === " ") {
1004
- e.preventDefault();
1005
- setIsOpen(true);
1006
- }
1007
- },
1008
- "aria-label": "Open search dialog",
1009
- children: [
1010
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.Search, { className: "boltdocs-search-icon", size: 18 }),
1011
- "Search docs...",
1012
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("kbd", { children: "\u2318K" })
1013
- ]
1014
- }
1015
- ),
1016
- isOpen && (0, import_react_dom2.createPortal)(
1017
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1018
- "div",
1019
- {
1020
- className: "boltdocs-search-overlay",
1021
- onPointerDown: () => setIsOpen(false),
1022
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1023
- "div",
1024
- {
1025
- className: "boltdocs-search-modal",
1026
- role: "dialog",
1027
- "aria-modal": "true",
1028
- "aria-label": "Search",
1029
- onPointerDown: (e) => e.stopPropagation(),
1030
- children: [
1031
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "boltdocs-search-header", children: [
1032
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react4.Search, { size: 18 }),
1033
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1034
- "input",
1035
- {
1036
- ref: inputRef,
1037
- type: "text",
1038
- "aria-label": "Search documentation input",
1039
- placeholder: "Search documentation...",
1040
- value: query,
1041
- onChange: (e) => setQuery(e.target.value)
1042
- }
1043
- ),
1044
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1045
- "button",
1046
- {
1047
- className: "boltdocs-search-close",
1048
- onClick: () => setIsOpen(false),
1049
- "aria-label": "Close search",
1050
- children: "ESC"
1051
- }
1052
- )
1053
- ] }),
1054
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "boltdocs-search-results", children: searchResults.length > 0 ? searchResults.map((result) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1055
- Link,
1056
- {
1057
- to: result.path === "" ? "/" : result.path,
1058
- className: `boltdocs-search-result-item ${result.isHeading ? "is-heading" : ""}`,
1059
- onClick: (e) => {
1060
- const isSamePath = result.path.split("#")[0] === window.location.pathname;
1061
- if (isSamePath && result.isHeading) {
1062
- e.preventDefault();
1063
- const id = result.path.split("#")[1];
1064
- const el = document.getElementById(id);
1065
- if (el) {
1066
- const offset = 80;
1067
- const bodyRect = document.body.getBoundingClientRect().top;
1068
- const elementRect = el.getBoundingClientRect().top;
1069
- const elementPosition = elementRect - bodyRect;
1070
- const offsetPosition = elementPosition - offset;
1071
- window.scrollTo({
1072
- top: offsetPosition,
1073
- behavior: "smooth"
1074
- });
1075
- window.history.pushState(null, "", `#${id}`);
1076
- }
1077
- }
1078
- setIsOpen(false);
1079
- },
1080
- children: [
1081
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "boltdocs-search-result-title", children: [
1082
- result.isHeading ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "heading-indicator", children: "#" }) : null,
1083
- result.title
1084
- ] }),
1085
- result.groupTitle && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "boltdocs-search-result-group", children: result.groupTitle })
1086
- ]
1087
- },
1088
- result.path
1089
- )) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "boltdocs-search-empty", children: [
1090
- 'No results found for "',
1091
- query,
1092
- '"'
1093
- ] }) })
1094
- ]
1095
- }
1096
- )
1097
- }
1098
- ),
1099
- document.body
1100
- )
1101
- ] });
1102
- }
1103
- var import_react9, import_react_dom2, import_lucide_react4, import_jsx_runtime12;
1104
- var init_SearchDialog = __esm({
1105
- "src/client/theme/ui/SearchDialog/SearchDialog.tsx"() {
1106
- "use strict";
1107
- import_react9 = __toESM(require("react"));
1108
- import_react_dom2 = require("react-dom");
1109
- init_Link2();
1110
- import_lucide_react4 = require("lucide-react");
1111
- import_jsx_runtime12 = require("react/jsx-runtime");
1112
- }
1113
- });
1114
-
1115
- // src/client/theme/ui/SearchDialog/index.ts
1116
- var SearchDialog_exports = {};
1117
- __export(SearchDialog_exports, {
1118
- SearchDialog: () => SearchDialog
1119
- });
1120
- var init_SearchDialog2 = __esm({
1121
- "src/client/theme/ui/SearchDialog/index.ts"() {
1122
- "use strict";
1123
- init_SearchDialog();
1124
- }
1125
- });
1126
-
1127
- // src/client/theme/ui/Navbar/Navbar.tsx
1128
- function Navbar({
1129
- config,
1130
- routes,
1131
- allRoutes,
1132
- currentLocale,
1133
- currentVersion
1134
- }) {
1135
- const location = (0, import_react_router_dom5.useLocation)();
1136
- const isHomePage = location.pathname === "/";
1137
- const title = config.themeConfig?.title || "Boltdocs";
1138
- const navItems = config.themeConfig?.navbar || [];
1139
- const socialLinks = config.themeConfig?.socialLinks || [];
1140
- const hasTabs = !isHomePage && config.themeConfig?.tabs && config.themeConfig.tabs.length > 0;
1141
- const leftItems = navItems.filter((item) => item.position !== "right");
1142
- const rightItems = navItems.filter((item) => item.position === "right");
1143
- const renderNavItem = (item, i) => {
1144
- const text = item.label || item.text || "";
1145
- const href = item.to || item.href || item.link || "";
1146
- const isExternal = href.startsWith("http") || href.startsWith("//") || href.includes("://");
1147
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_router_dom5.Link, { to: href, target: isExternal ? "_blank" : void 0, children: [
1148
- text,
1149
- isExternal && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "navbar-external-icon", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1150
- "svg",
1151
- {
1152
- viewBox: "0 0 24 24",
1153
- width: "13",
1154
- height: "13",
1155
- stroke: "currentColor",
1156
- strokeWidth: "2",
1157
- fill: "none",
1158
- strokeLinecap: "round",
1159
- strokeLinejoin: "round",
1160
- children: [
1161
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
1162
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("polyline", { points: "15 3 21 3 21 9" }),
1163
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
1164
- ]
1165
- }
1166
- ) })
1167
- ] }, i);
1168
- };
1169
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("header", { className: `boltdocs-navbar ${hasTabs ? "has-tabs" : ""}`, children: [
1170
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
1171
- "div",
1172
- {
1173
- className: "navbar-container",
1174
- style: { height: "var(--ld-navbar-height)" },
1175
- children: [
1176
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "navbar-left", children: [
1177
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "navbar-logo", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_router_dom5.Link, { to: "/", children: [
1178
- config.themeConfig?.logo ? config.themeConfig.logo.trim().startsWith("<svg") ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1179
- "span",
1180
- {
1181
- className: "navbar-logo-svg",
1182
- dangerouslySetInnerHTML: {
1183
- __html: config.themeConfig.logo
1184
- }
1185
- }
1186
- ) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1187
- "img",
1188
- {
1189
- src: config.themeConfig.logo,
1190
- alt: title,
1191
- className: "navbar-logo-img"
1192
- }
1193
- ) : null,
1194
- title
1195
- ] }) }),
1196
- config.versions && currentVersion && allRoutes ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1197
- VersionSwitcher,
1198
- {
1199
- versions: config.versions,
1200
- currentVersion,
1201
- currentLocale,
1202
- allRoutes
1203
- }
1204
- ) : config.themeConfig?.version ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "navbar-version", children: [
1205
- config.themeConfig.version,
1206
- " ",
1207
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react5.ChevronDown, { size: 14 })
1208
- ] }) : null,
1209
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("nav", { className: "navbar-links", "aria-label": "Top Navigation Left", children: leftItems.map(renderNavItem) })
1210
- ] }),
1211
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "navbar-right", children: [
1212
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("nav", { className: "navbar-links", "aria-label": "Top Navigation Right", children: rightItems.map(renderNavItem) }),
1213
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react10.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "navbar-search-placeholder" }), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SearchDialog2, { routes: routes || [] }) }),
1214
- config.i18n && currentLocale && allRoutes && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1215
- LanguageSwitcher,
1216
- {
1217
- i18n: config.i18n,
1218
- currentLocale,
1219
- allRoutes
1220
- }
1221
- ),
1222
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ThemeToggle, {}),
1223
- config.themeConfig?.githubRepo && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(GithubStars, { repo: config.themeConfig.githubRepo }),
1224
- socialLinks.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "navbar-divider" }),
1225
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "navbar-icons", children: socialLinks.map((link, i) => {
1226
- const IconComp = ICON_MAP[link.icon.toLowerCase()];
1227
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1228
- "a",
1229
- {
1230
- href: link.link,
1231
- target: "_blank",
1232
- rel: "noopener noreferrer",
1233
- className: "navbar-icon-btn",
1234
- "aria-label": link.icon,
1235
- children: IconComp ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconComp, {}) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: link.icon })
1236
- },
1237
- i
1238
- );
1239
- }) })
1240
- ] })
1241
- ]
1242
- }
1243
- ),
1244
- hasTabs && config.themeConfig?.tabs && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1245
- Tabs,
1246
- {
1247
- tabs: config.themeConfig.tabs,
1248
- routes: allRoutes || routes || []
1249
- }
1250
- )
1251
- ] });
1252
- }
1253
- var import_react10, import_react_router_dom5, import_lucide_react5, import_jsx_runtime13, SearchDialog2, ICON_MAP;
1254
- var init_Navbar = __esm({
1255
- "src/client/theme/ui/Navbar/Navbar.tsx"() {
1256
- "use strict";
1257
- import_react10 = require("react");
1258
- import_react_router_dom5 = require("react-router-dom");
1259
- import_lucide_react5 = require("lucide-react");
1260
- init_LanguageSwitcher2();
1261
- init_VersionSwitcher2();
1262
- init_ThemeToggle2();
1263
- init_discord();
1264
- init_twitter();
1265
- init_GithubStars();
1266
- init_Tabs();
1267
- import_jsx_runtime13 = require("react/jsx-runtime");
1268
- SearchDialog2 = (0, import_react10.lazy)(
1269
- () => Promise.resolve().then(() => (init_SearchDialog2(), SearchDialog_exports)).then((m) => ({ default: m.SearchDialog }))
1270
- );
1271
- ICON_MAP = {
1272
- discord: Discord,
1273
- x: XformerlyTwitter
1274
- };
1275
- }
1276
- });
1277
-
1278
- // src/client/theme/ui/Navbar/index.ts
1279
- var init_Navbar2 = __esm({
1280
- "src/client/theme/ui/Navbar/index.ts"() {
1281
- "use strict";
1282
- init_Navbar();
1283
- init_GithubStars();
1284
- }
1285
- });
1286
-
1287
- // src/client/theme/ui/PoweredBy/PoweredBy.tsx
1288
- function PoweredBy() {
1289
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "powered-by-container", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1290
- "a",
1291
- {
1292
- href: "https://github.com/jesusalcaladev/boltdocs",
1293
- target: "_blank",
1294
- rel: "noopener noreferrer",
1295
- className: "powered-by-link",
1296
- children: [
1297
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react6.Zap, { className: "powered-by-icon", size: 12, fill: "currentColor" }),
1298
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "Powered by" }),
1299
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "powered-by-brand", children: "LiteDocs" })
1300
- ]
1301
- }
1302
- ) });
1303
- }
1304
- var import_lucide_react6, import_jsx_runtime14;
1305
- var init_PoweredBy = __esm({
1306
- "src/client/theme/ui/PoweredBy/PoweredBy.tsx"() {
1307
- "use strict";
1308
- import_lucide_react6 = require("lucide-react");
1309
- import_jsx_runtime14 = require("react/jsx-runtime");
1310
- }
1311
- });
1312
-
1313
- // src/client/theme/ui/PoweredBy/index.ts
1314
- var init_PoweredBy2 = __esm({
1315
- "src/client/theme/ui/PoweredBy/index.ts"() {
1316
- "use strict";
1317
- init_PoweredBy();
1318
- }
1319
- });
1320
-
1321
- // src/client/theme/ui/Sidebar/Sidebar.tsx
1322
- function renderBadge(badgeRaw) {
1323
- if (!badgeRaw) return null;
1324
- let text = "";
1325
- let expires = "";
1326
- if (typeof badgeRaw === "string") {
1327
- text = badgeRaw;
1328
- } else {
1329
- text = badgeRaw.text;
1330
- expires = badgeRaw.expires || "";
1331
- }
1332
- if (expires) {
1333
- const expireDate = new Date(expires);
1334
- const now = /* @__PURE__ */ new Date();
1335
- expireDate.setHours(0, 0, 0, 0);
1336
- now.setHours(0, 0, 0, 0);
1337
- if (now > expireDate) {
1338
- return null;
1339
- }
1340
- }
1341
- if (!text) return null;
1342
- let typeClass = "badge-default";
1343
- const lowerText = text.toLowerCase();
1344
- if (lowerText === "new") {
1345
- typeClass = "badge-new";
1346
- } else if (lowerText === "experimental") {
1347
- typeClass = "badge-experimental";
1348
- } else if (lowerText === "updated") {
1349
- typeClass = "badge-updated";
1350
- }
1351
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: `sidebar-badge ${typeClass}`, children: text });
1352
- }
1353
- function renderIcon(iconName, size = 16) {
1354
- if (!iconName) return null;
1355
- const trimmed = iconName.trim();
1356
- if (trimmed.startsWith("<svg") || trimmed.includes("http")) {
1357
- if (trimmed.startsWith("<svg")) {
1358
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1359
- "span",
1360
- {
1361
- className: "sidebar-icon svg-icon",
1362
- dangerouslySetInnerHTML: { __html: trimmed }
1363
- }
1364
- );
1365
- }
1366
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1367
- "img",
1368
- {
1369
- src: trimmed,
1370
- className: "sidebar-icon",
1371
- style: { width: size, height: size },
1372
- alt: ""
1373
- }
1374
- );
1375
- }
1376
- const IconComponent = LucideIcons[iconName];
1377
- if (IconComponent) {
1378
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconComponent, { size, className: "sidebar-icon lucide-icon" });
1379
- }
1380
- return null;
1381
- }
1382
- function Sidebar({
1383
- routes,
1384
- config
1385
- }) {
1386
- const location = (0, import_react_router_dom6.useLocation)();
1387
- const currentRoute = routes.find((r) => r.path === location.pathname);
1388
- const activeTabId = currentRoute?.tab?.toLowerCase();
1389
- const filteredRoutes = activeTabId ? routes.filter((r) => {
1390
- if (!r.tab) return true;
1391
- return r.tab.toLowerCase() === activeTabId;
1392
- }) : routes;
1393
- const ungrouped = [];
1394
- const groupMap = /* @__PURE__ */ new Map();
1395
- for (const route of filteredRoutes) {
1396
- if (!route.group) {
1397
- ungrouped.push(route);
1398
- } else {
1399
- if (!groupMap.has(route.group)) {
1400
- groupMap.set(route.group, {
1401
- slug: route.group,
1402
- title: route.groupTitle || route.group,
1403
- routes: [],
1404
- icon: route.groupIcon
1405
- });
1406
- }
1407
- groupMap.get(route.group).routes.push(route);
1408
- }
1409
- }
1410
- const groups = Array.from(groupMap.values());
1411
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("aside", { className: "boltdocs-sidebar", children: [
1412
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("nav", { "aria-label": "Main Navigation", children: [
1413
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ul", { className: "sidebar-list", children: ungrouped.map((route) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1414
- Link,
1415
- {
1416
- to: route.path === "" ? "/" : route.path,
1417
- className: `sidebar-link ${location.pathname === route.path ? "active" : ""}`,
1418
- "aria-current": location.pathname === route.path ? "page" : void 0,
1419
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sidebar-link-content", children: [
1420
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sidebar-link-title-container", children: [
1421
- renderIcon(route.icon),
1422
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: route.title })
1423
- ] }),
1424
- renderBadge(route.badge)
1425
- ] })
1426
- }
1427
- ) }, route.path)) }),
1428
- groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1429
- SidebarGroupSection,
1430
- {
1431
- group,
1432
- currentPath: location.pathname
1433
- },
1434
- group.slug
1435
- ))
1436
- ] }),
1437
- config.themeConfig?.poweredBy !== false && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PoweredBy, {})
1438
- ] });
1439
- }
1440
- function SidebarGroupSection({
1441
- group,
1442
- currentPath
1443
- }) {
1444
- const isActive = group.routes.some((r) => currentPath === r.path);
1445
- const [open, setOpen] = (0, import_react11.useState)(true);
1446
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sidebar-group", children: [
1447
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1448
- "button",
1449
- {
1450
- className: `sidebar-group-header ${isActive ? "active" : ""}`,
1451
- onClick: () => setOpen(!open),
1452
- "aria-expanded": open,
1453
- "aria-controls": `sidebar-group-${group.slug}`,
1454
- children: [
1455
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "sidebar-group-header-content", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "sidebar-group-title", children: group.title }) }),
1456
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: `sidebar-group-chevron ${open ? "open" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react7.ChevronRight, { size: 16 }) })
1457
- ]
1458
- }
1459
- ),
1460
- open && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ul", { className: "sidebar-group-list", id: `sidebar-group-${group.slug}`, children: group.routes.map((route) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1461
- Link,
1462
- {
1463
- to: route.path === "" ? "/" : route.path,
1464
- className: `sidebar-link sidebar-link-nested ${currentPath === route.path ? "active" : ""}`,
1465
- "aria-current": currentPath === route.path ? "page" : void 0,
1466
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sidebar-link-content", children: [
1467
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "sidebar-link-title-container", children: [
1468
- renderIcon(route.icon),
1469
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: route.title })
1470
- ] }),
1471
- renderBadge(route.badge)
1472
- ] })
1473
- }
1474
- ) }, route.path)) })
1475
- ] });
1476
- }
1477
- var import_react11, import_react_router_dom6, import_lucide_react7, LucideIcons, import_jsx_runtime15;
1478
- var init_Sidebar = __esm({
1479
- "src/client/theme/ui/Sidebar/Sidebar.tsx"() {
1480
- "use strict";
1481
- import_react11 = require("react");
1482
- import_react_router_dom6 = require("react-router-dom");
1483
- init_Link2();
1484
- init_PoweredBy2();
1485
- import_lucide_react7 = require("lucide-react");
1486
- LucideIcons = __toESM(require("lucide-react"));
1487
- import_jsx_runtime15 = require("react/jsx-runtime");
1488
- }
1489
- });
1490
-
1491
- // src/client/theme/ui/Sidebar/index.ts
1492
- var init_Sidebar2 = __esm({
1493
- "src/client/theme/ui/Sidebar/index.ts"() {
1494
- "use strict";
1495
- init_Sidebar();
1496
- }
1497
- });
1498
-
1499
- // src/client/theme/ui/OnThisPage/OnThisPage.tsx
1500
- function OnThisPage({
1501
- headings = [],
1502
- editLink,
1503
- communityHelp,
1504
- filePath
1505
- }) {
1506
- const [activeId, setActiveId] = (0, import_react12.useState)(null);
1507
- const [indicatorStyle, setIndicatorStyle] = (0, import_react12.useState)({});
1508
- const observerRef = (0, import_react12.useRef)(null);
1509
- const location = (0, import_react_router_dom7.useLocation)();
1510
- const listRef = (0, import_react12.useRef)(null);
1511
- const visibleIdsRef = (0, import_react12.useRef)(/* @__PURE__ */ new Set());
1512
- (0, import_react12.useEffect)(() => {
1513
- if (headings.length > 0) {
1514
- const hash = window.location.hash.substring(1);
1515
- if (hash && headings.some((h) => h.id === hash)) {
1516
- setActiveId(hash);
1517
- } else {
1518
- setActiveId(headings[0].id);
1519
- }
1520
- }
1521
- }, [location.pathname, headings]);
1522
- (0, import_react12.useEffect)(() => {
1523
- if (!activeId || !listRef.current) return;
1524
- const activeLink = listRef.current.querySelector(
1525
- `a[href="#${activeId}"]`
1526
- );
1527
- if (activeLink) {
1528
- const top = activeLink.offsetTop;
1529
- const height = activeLink.offsetHeight;
1530
- setIndicatorStyle({
1531
- transform: `translateY(${top}px)`,
1532
- height: `${height}px`,
1533
- opacity: 1
1534
- });
1535
- }
1536
- }, [activeId, headings]);
1537
- (0, import_react12.useEffect)(() => {
1538
- if (headings.length === 0) return;
1539
- visibleIdsRef.current.clear();
1540
- if (observerRef.current) {
1541
- observerRef.current.disconnect();
1542
- }
1543
- const callback = (entries) => {
1544
- entries.forEach((entry) => {
1545
- if (entry.isIntersecting) {
1546
- visibleIdsRef.current.add(entry.target.id);
1547
- } else {
1548
- visibleIdsRef.current.delete(entry.target.id);
1549
- }
1550
- });
1551
- const firstVisible = headings.find((h) => visibleIdsRef.current.has(h.id));
1552
- if (firstVisible) {
1553
- setActiveId(firstVisible.id);
1554
- } else {
1555
- const firstEl = document.getElementById(headings[0].id);
1556
- if (firstEl) {
1557
- const rect = firstEl.getBoundingClientRect();
1558
- if (rect.top > 200) {
1559
- setActiveId(headings[0].id);
1560
- return;
1561
- }
1562
- }
1563
- }
1564
- };
1565
- const observerOptions = {
1566
- root: document.querySelector(".boltdocs-content"),
1567
- rootMargin: "-20% 0px -70% 0px",
1568
- threshold: [0, 1]
1569
- };
1570
- observerRef.current = new IntersectionObserver(callback, observerOptions);
1571
- const observeHeadings = () => {
1572
- headings.forEach(({ id }) => {
1573
- const el = document.getElementById(id);
1574
- if (el) {
1575
- observerRef.current.observe(el);
1576
- }
1577
- });
1578
- };
1579
- observeHeadings();
1580
- const timeoutId = setTimeout(observeHeadings, 1e3);
1581
- const handleScroll = () => {
1582
- const scrollPosition = window.innerHeight + window.pageYOffset;
1583
- const bodyHeight = document.documentElement.scrollHeight;
1584
- if (scrollPosition >= bodyHeight - 50) {
1585
- setActiveId(headings[headings.length - 1].id);
1586
- }
1587
- };
1588
- window.addEventListener("scroll", handleScroll, { passive: true });
1589
- return () => {
1590
- observerRef.current?.disconnect();
1591
- clearTimeout(timeoutId);
1592
- window.removeEventListener("scroll", handleScroll);
1593
- };
1594
- }, [headings, location.pathname]);
1595
- (0, import_react12.useEffect)(() => {
1596
- if (!activeId || !listRef.current) return;
1597
- const activeLink = listRef.current.querySelector(
1598
- `a[href="#${activeId}"]`
1599
- );
1600
- if (activeLink) {
1601
- const container = listRef.current.parentElement;
1602
- if (!container) return;
1603
- const linkRect = activeLink.getBoundingClientRect();
1604
- const containerRect = container.getBoundingClientRect();
1605
- const isVisible = linkRect.top >= containerRect.top && linkRect.bottom <= containerRect.bottom;
1606
- if (!isVisible) {
1607
- activeLink.scrollIntoView({
1608
- behavior: "auto",
1609
- block: "nearest"
1610
- });
1611
- }
1612
- }
1613
- }, [activeId]);
1614
- const handleClick = (0, import_react12.useCallback)(
1615
- (e, id) => {
1616
- e.preventDefault();
1617
- const el = document.getElementById(id);
1618
- if (el) {
1619
- el.scrollIntoView({
1620
- behavior: "smooth"
1621
- });
1622
- setActiveId(id);
1623
- window.history.pushState(null, "", `#${id}`);
1624
- }
1625
- },
1626
- []
1627
- );
1628
- if (headings.length === 0) return null;
1629
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("nav", { className: "boltdocs-on-this-page", "aria-label": "Table of contents", children: [
1630
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "on-this-page-title", children: "On this page" }),
1631
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "on-this-page-container", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "on-this-page-list-container", children: [
1632
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "toc-indicator", style: indicatorStyle }),
1633
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { className: "on-this-page-list", ref: listRef, children: headings.map((h) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { className: h.level === 3 ? "toc-indent" : "", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1634
- "a",
1635
- {
1636
- href: `#${h.id}`,
1637
- className: `toc-link ${activeId === h.id ? "active" : ""}`,
1638
- "aria-current": activeId === h.id ? "true" : void 0,
1639
- onClick: (e) => handleClick(e, h.id),
1640
- children: h.text
1641
- }
1642
- ) }, h.id)) })
1643
- ] }) }),
1644
- (editLink || communityHelp) && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "toc-help", children: [
1645
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "toc-help-title", children: "Need help?" }),
1646
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("ul", { className: "toc-help-links", children: [
1647
- editLink && filePath && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1648
- "a",
1649
- {
1650
- href: editLink.replace(":path", filePath),
1651
- target: "_blank",
1652
- rel: "noopener noreferrer",
1653
- className: "toc-help-link",
1654
- children: [
1655
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react8.Pencil, { size: 16 }),
1656
- "Edit this page"
1657
- ]
1658
- }
1659
- ) }),
1660
- communityHelp && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
1661
- "a",
1662
- {
1663
- href: communityHelp,
1664
- target: "_blank",
1665
- rel: "noopener noreferrer",
1666
- className: "toc-help-link",
1667
- children: [
1668
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react8.CircleHelp, { size: 16 }),
1669
- "Community help"
1670
- ]
1671
- }
1672
- ) })
1673
- ] })
1674
- ] })
1675
- ] });
1676
- }
1677
- var import_react12, import_react_router_dom7, import_lucide_react8, import_jsx_runtime16;
1678
- var init_OnThisPage = __esm({
1679
- "src/client/theme/ui/OnThisPage/OnThisPage.tsx"() {
1680
- "use strict";
1681
- import_react12 = require("react");
1682
- import_react_router_dom7 = require("react-router-dom");
1683
- import_lucide_react8 = require("lucide-react");
1684
- import_jsx_runtime16 = require("react/jsx-runtime");
1685
- }
1686
- });
1687
-
1688
- // src/client/theme/ui/OnThisPage/index.ts
1689
- var init_OnThisPage2 = __esm({
1690
- "src/client/theme/ui/OnThisPage/index.ts"() {
1691
- "use strict";
1692
- init_OnThisPage();
1693
- }
1694
- });
1695
-
1696
- // src/client/theme/ui/Head/Head.tsx
1697
- function Head({ siteTitle, siteDescription, routes }) {
1698
- const location = (0, import_react_router_dom8.useLocation)();
1699
- (0, import_react13.useEffect)(() => {
1700
- const currentRoute = routes.find((r) => r.path === location.pathname);
1701
- const pageTitle = currentRoute?.title;
1702
- const pageDescription = currentRoute?.description || siteDescription || "";
1703
- document.title = pageTitle ? `${pageTitle} | ${siteTitle}` : siteTitle;
1704
- let metaDesc = document.querySelector(
1705
- 'meta[name="description"]'
1706
- );
1707
- if (!metaDesc) {
1708
- metaDesc = document.createElement("meta");
1709
- metaDesc.name = "description";
1710
- document.head.appendChild(metaDesc);
1711
- }
1712
- metaDesc.content = pageDescription;
1713
- setMetaTag("property", "og:title", document.title);
1714
- setMetaTag("property", "og:description", pageDescription);
1715
- setMetaTag("property", "og:type", "article");
1716
- setMetaTag("property", "og:url", window.location.href);
1717
- setMetaTag("name", "twitter:card", "summary");
1718
- setMetaTag("name", "twitter:title", document.title);
1719
- setMetaTag("name", "twitter:description", pageDescription);
1720
- let canonical = document.querySelector(
1721
- 'link[rel="canonical"]'
1722
- );
1723
- if (!canonical) {
1724
- canonical = document.createElement("link");
1725
- canonical.rel = "canonical";
1726
- document.head.appendChild(canonical);
1727
- }
1728
- canonical.href = window.location.origin + location.pathname;
1729
- }, [location.pathname, siteTitle, siteDescription, routes]);
1730
- return null;
1731
- }
1732
- function setMetaTag(attr, key, content) {
1733
- let tag = document.querySelector(
1734
- `meta[${attr}="${key}"]`
1735
- );
1736
- if (!tag) {
1737
- tag = document.createElement("meta");
1738
- tag.setAttribute(attr, key);
1739
- document.head.appendChild(tag);
1740
- }
1741
- tag.content = content;
1742
- }
1743
- var import_react13, import_react_router_dom8;
1744
- var init_Head = __esm({
1745
- "src/client/theme/ui/Head/Head.tsx"() {
1746
- "use strict";
1747
- import_react13 = require("react");
1748
- import_react_router_dom8 = require("react-router-dom");
1749
- }
1750
- });
1751
-
1752
- // src/client/theme/ui/Head/index.ts
1753
- var init_Head2 = __esm({
1754
- "src/client/theme/ui/Head/index.ts"() {
1755
- "use strict";
1756
- init_Head();
1757
- }
1758
- });
1759
-
1760
- // src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx
1761
- function Breadcrumbs({ routes, config }) {
1762
- const location = (0, import_react_router_dom9.useLocation)();
1763
- if (config.themeConfig?.breadcrumbs === false) return null;
1764
- if (location.pathname === "/") return null;
1765
- const currentRoute = routes.find((r) => r.path === location.pathname);
1766
- const groupRoute = currentRoute?.group ? routes.find((r) => r.group === currentRoute.group) : null;
1767
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("nav", { className: "boltdocs-breadcrumbs", "aria-label": "Breadcrumb", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("ol", { className: "boltdocs-breadcrumbs-list", children: [
1768
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { className: "boltdocs-breadcrumbs-item", children: [
1769
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Link, { to: "/", className: "boltdocs-breadcrumbs-link", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.Home, { size: 14 }) }),
1770
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "boltdocs-breadcrumbs-separator", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.ChevronRight, { size: 14 }) })
1771
- ] }),
1772
- currentRoute?.groupTitle && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { className: "boltdocs-breadcrumbs-item", children: [
1773
- groupRoute ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Link, { to: groupRoute.path, className: "boltdocs-breadcrumbs-link", children: currentRoute.groupTitle }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "boltdocs-breadcrumbs-text", children: currentRoute.groupTitle }),
1774
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "boltdocs-breadcrumbs-separator", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.ChevronRight, { size: 14 }) })
1775
- ] }),
1776
- currentRoute?.title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { className: "boltdocs-breadcrumbs-item", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1777
- "span",
1778
- {
1779
- className: "boltdocs-breadcrumbs-text boltdocs-breadcrumbs-active",
1780
- "aria-current": "page",
1781
- children: currentRoute.title
1782
- }
1783
- ) })
1784
- ] }) });
1785
- }
1786
- var import_react_router_dom9, import_lucide_react9, import_jsx_runtime17;
1787
- var init_Breadcrumbs = __esm({
1788
- "src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx"() {
1789
- "use strict";
1790
- import_react_router_dom9 = require("react-router-dom");
1791
- init_Link2();
1792
- import_lucide_react9 = require("lucide-react");
1793
- import_jsx_runtime17 = require("react/jsx-runtime");
1794
- }
1795
- });
1796
-
1797
- // src/client/theme/ui/Breadcrumbs/index.ts
1798
- var init_Breadcrumbs2 = __esm({
1799
- "src/client/theme/ui/Breadcrumbs/index.ts"() {
1800
- "use strict";
1801
- init_Breadcrumbs();
1802
- }
1803
- });
1804
-
1805
- // src/client/theme/ui/ProgressBar/ProgressBar.css
1806
- var init_ProgressBar = __esm({
1807
- "src/client/theme/ui/ProgressBar/ProgressBar.css"() {
1808
- }
1809
- });
1810
-
1811
- // src/client/theme/ui/ProgressBar/ProgressBar.tsx
1812
- function ProgressBar() {
1813
- const [progress, setProgress] = (0, import_react14.useState)(0);
1814
- (0, import_react14.useEffect)(() => {
1815
- let container = null;
1816
- let timer;
1817
- const handleScroll = () => {
1818
- if (!container) return;
1819
- const { scrollTop, scrollHeight, clientHeight } = container;
1820
- if (scrollHeight <= clientHeight) {
1821
- setProgress(0);
1822
- return;
1823
- }
1824
- const scrollPercent = scrollTop / (scrollHeight - clientHeight) * 100;
1825
- setProgress(Math.min(100, Math.max(0, scrollPercent)));
1826
- };
1827
- const attachListener = () => {
1828
- container = document.querySelector(".boltdocs-content");
1829
- if (container) {
1830
- container.addEventListener("scroll", handleScroll);
1831
- handleScroll();
1832
- if (timer) clearInterval(timer);
1833
- return true;
1834
- }
1835
- return false;
1836
- };
1837
- if (!attachListener()) {
1838
- timer = setInterval(attachListener, 100);
1839
- }
1840
- return () => {
1841
- if (container) container.removeEventListener("scroll", handleScroll);
1842
- if (timer) clearInterval(timer);
1843
- };
1844
- }, []);
1845
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "boltdocs-progress-container", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1846
- "div",
1847
- {
1848
- className: "boltdocs-progress-bar",
1849
- style: { width: `${progress}%` }
1850
- }
1851
- ) });
1852
- }
1853
- var import_react14, import_jsx_runtime18;
1854
- var init_ProgressBar2 = __esm({
1855
- "src/client/theme/ui/ProgressBar/ProgressBar.tsx"() {
1856
- "use strict";
1857
- import_react14 = require("react");
1858
- init_ProgressBar();
1859
- import_jsx_runtime18 = require("react/jsx-runtime");
1860
- }
1861
- });
1862
-
1863
- // src/client/theme/ui/ProgressBar/index.ts
1864
- var init_ProgressBar3 = __esm({
1865
- "src/client/theme/ui/ProgressBar/index.ts"() {
1866
- "use strict";
1867
- init_ProgressBar2();
1868
- }
1869
- });
1870
-
1871
- // src/client/theme/ui/ErrorBoundary/error-boundary.css
1872
- var init_error_boundary = __esm({
1873
- "src/client/theme/ui/ErrorBoundary/error-boundary.css"() {
1874
- }
1875
- });
1876
-
1877
- // src/client/theme/ui/ErrorBoundary/ErrorBoundary.tsx
1878
- var import_react15, import_jsx_runtime19, ErrorBoundary;
1879
- var init_ErrorBoundary = __esm({
1880
- "src/client/theme/ui/ErrorBoundary/ErrorBoundary.tsx"() {
1881
- "use strict";
1882
- import_react15 = require("react");
1883
- init_error_boundary();
1884
- import_jsx_runtime19 = require("react/jsx-runtime");
1885
- ErrorBoundary = class extends import_react15.Component {
1886
- state = {
1887
- hasError: false
1888
- };
1889
- static getDerivedStateFromError(error) {
1890
- return { hasError: true, error };
1891
- }
1892
- componentDidCatch(error, errorInfo) {
1893
- console.error("Uncaught error in Boltdocs Layout:", error, errorInfo);
1894
- }
1895
- render() {
1896
- if (this.state.hasError) {
1897
- return this.props.fallback || /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "boltdocs-error-boundary", children: [
1898
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "boltdocs-error-title", children: "Something went wrong" }),
1899
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "boltdocs-error-message", children: this.state.error?.message || "An unexpected error occurred while rendering this page." }),
1900
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1901
- "button",
1902
- {
1903
- className: "boltdocs-error-retry",
1904
- onClick: () => this.setState({ hasError: false }),
1905
- children: "Try again"
1906
- }
1907
- )
1908
- ] });
1909
- }
1910
- return this.props.children;
1911
- }
1912
- };
1913
- }
1914
- });
1915
-
1916
- // src/client/theme/ui/ErrorBoundary/index.ts
1917
- var init_ErrorBoundary2 = __esm({
1918
- "src/client/theme/ui/ErrorBoundary/index.ts"() {
1919
- "use strict";
1920
- init_ErrorBoundary();
1921
- }
1922
- });
1923
-
1924
- // src/client/theme/ui/CopyMarkdown/copy-markdown.css
1925
- var init_copy_markdown = __esm({
1926
- "src/client/theme/ui/CopyMarkdown/copy-markdown.css"() {
1927
- }
1928
- });
1929
-
1930
- // src/client/theme/ui/CopyMarkdown/CopyMarkdown.tsx
1931
- function CopyMarkdown({ content, config }) {
1932
- const [isOpen, setIsOpen] = (0, import_react16.useState)(false);
1933
- const [copied, setCopied] = (0, import_react16.useState)(false);
1934
- const dropdownRef = (0, import_react16.useRef)(null);
1935
- const isEnabled = config !== false;
1936
- const buttonText = typeof config === "object" ? config.text || "Copy Markdown" : "Copy Markdown";
1937
- (0, import_react16.useEffect)(() => {
1938
- function handleClickOutside(event) {
1939
- if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
1940
- setIsOpen(false);
1941
- }
1942
- }
1943
- document.addEventListener("mousedown", handleClickOutside);
1944
- return () => document.removeEventListener("mousedown", handleClickOutside);
1945
- }, []);
1946
- if (!isEnabled || !content) return null;
1947
- const handleCopy = () => {
1948
- navigator.clipboard.writeText(content);
1949
- setCopied(true);
1950
- setIsOpen(false);
1951
- setTimeout(() => setCopied(false), 2e3);
1952
- };
1953
- const handleOpenRaw = () => {
1954
- const blob = new Blob([content], { type: "text/plain;charset=utf-8" });
1955
- const url = URL.createObjectURL(blob);
1956
- window.open(url, "_blank");
1957
- setIsOpen(false);
1958
- };
1959
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "boltdocs-copy-markdown", ref: dropdownRef, children: [
1960
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "copy-btn-group", children: [
1961
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
1962
- "button",
1963
- {
1964
- className: "copy-btn",
1965
- onClick: handleCopy,
1966
- "aria-label": "Copy Markdown",
1967
- children: [
1968
- copied ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.Copy, { size: 16 }),
1969
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "copy-label", children: copied ? "Copied!" : buttonText })
1970
- ]
1971
- }
1972
- ),
1973
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1974
- "button",
1975
- {
1976
- className: `copy-dropdown-toggle ${isOpen ? "is-active" : ""}`,
1977
- onClick: () => setIsOpen(!isOpen),
1978
- "aria-label": "More options",
1979
- "aria-expanded": isOpen,
1980
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.ChevronDown, { size: 14, className: "arrow-icon" })
1981
- }
1982
- )
1983
- ] }),
1984
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "copy-dropdown", children: [
1985
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { className: "copy-option", onClick: handleCopy, children: [
1986
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.Copy, { size: 14 }),
1987
- "Copy Markdown"
1988
- ] }),
1989
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { className: "copy-option", onClick: handleOpenRaw, children: [
1990
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.ExternalLink, { size: 14 }),
1991
- "View as Markdown"
1992
- ] })
1993
- ] })
1994
- ] });
1995
- }
1996
- var import_react16, import_lucide_react10, import_jsx_runtime20;
1997
- var init_CopyMarkdown = __esm({
1998
- "src/client/theme/ui/CopyMarkdown/CopyMarkdown.tsx"() {
1999
- "use strict";
2000
- import_react16 = require("react");
2001
- import_lucide_react10 = require("lucide-react");
2002
- init_copy_markdown();
2003
- import_jsx_runtime20 = require("react/jsx-runtime");
2004
- }
2005
- });
2006
-
2007
- // src/client/theme/ui/CopyMarkdown/index.ts
2008
- var init_CopyMarkdown2 = __esm({
2009
- "src/client/theme/ui/CopyMarkdown/index.ts"() {
2010
- "use strict";
2011
- init_CopyMarkdown();
2012
- }
2013
- });
2014
-
2015
- // src/client/theme/styles.css
2016
- var init_styles = __esm({
2017
- "src/client/theme/styles.css"() {
2018
- }
2019
- });
2020
-
2021
- // src/client/theme/ui/Layout/Layout.tsx
2022
- function ThemeLayout({
2023
- config,
2024
- routes,
2025
- children,
2026
- navbar,
2027
- sidebar,
2028
- toc,
2029
- background,
2030
- head,
2031
- breadcrumbs,
2032
- className = "",
2033
- style
2034
- }) {
2035
- const siteTitle = config.themeConfig?.title || "Boltdocs";
2036
- const siteDescription = config.themeConfig?.description || "";
2037
- const location = (0, import_react_router_dom10.useLocation)();
2038
- const currentIndex = routes.findIndex((r) => r.path === location.pathname);
2039
- const currentRoute = routes[currentIndex];
2040
- const currentLocale = config.i18n ? currentRoute?.locale || config.i18n.defaultLocale : void 0;
2041
- const currentVersion = config.versions ? currentRoute?.version || config.versions.defaultVersion : void 0;
2042
- const filteredRoutes = routes.filter((r) => {
2043
- const localeMatch = config.i18n ? (r.locale || config.i18n.defaultLocale) === currentLocale : true;
2044
- const versionMatch = config.versions ? (r.version || config.versions.defaultVersion) === currentVersion : true;
2045
- return localeMatch && versionMatch;
2046
- });
2047
- const localIndex = filteredRoutes.findIndex(
2048
- (r) => r.path === location.pathname
2049
- );
2050
- const prevPage = localIndex > 0 ? filteredRoutes[localIndex - 1] : null;
2051
- const nextPage = localIndex >= 0 && localIndex < filteredRoutes.length - 1 ? filteredRoutes[localIndex + 1] : null;
2052
- const { preload } = usePreload();
2053
- import_react17.default.useEffect(() => {
2054
- if (prevPage?.path) preload(prevPage.path);
2055
- if (nextPage?.path) preload(nextPage.path);
2056
- }, [prevPage, nextPage, preload]);
2057
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: `boltdocs-layout ${className}`, style, children: [
2058
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ProgressBar, {}),
2059
- head !== void 0 ? head : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2060
- Head,
2061
- {
2062
- siteTitle,
2063
- siteDescription,
2064
- routes
2065
- }
2066
- ),
2067
- navbar !== void 0 ? navbar : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2068
- Navbar,
2069
- {
2070
- config,
2071
- routes: filteredRoutes,
2072
- allRoutes: routes,
2073
- currentLocale,
2074
- currentVersion
2075
- }
2076
- ),
2077
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "boltdocs-main-container", children: [
2078
- sidebar !== void 0 ? sidebar : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Sidebar, { routes: filteredRoutes, config }),
2079
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("main", { className: "boltdocs-content", children: [
2080
- breadcrumbs !== void 0 ? breadcrumbs : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Breadcrumbs, { routes: filteredRoutes, config }),
2081
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "boltdocs-page", children: [
2082
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "boltdocs-page-header", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2083
- CopyMarkdown,
2084
- {
2085
- content: routes[currentIndex]?._rawContent,
2086
- config: config.themeConfig?.copyMarkdown
2087
- }
2088
- ) }),
2089
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ErrorBoundary, { children })
2090
- ] }),
2091
- (prevPage || nextPage) && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("nav", { className: "page-nav", "aria-label": "Pagination", children: [
2092
- prevPage ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2093
- Link,
2094
- {
2095
- to: prevPage.path || "/",
2096
- className: "page-nav-link page-nav-link--prev",
2097
- children: [
2098
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "page-nav-info", children: [
2099
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "page-nav-label", children: "Previous" }),
2100
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "page-nav-title", children: prevPage.title })
2101
- ] }),
2102
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react11.ChevronLeft, { className: "page-nav-arrow", size: 16 })
2103
- ]
2104
- }
2105
- ) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", {}),
2106
- nextPage ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2107
- Link,
2108
- {
2109
- to: nextPage.path || "/",
2110
- className: "page-nav-link page-nav-link--next",
2111
- children: [
2112
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "page-nav-info", children: [
2113
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "page-nav-label", children: "Next" }),
2114
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "page-nav-title", children: nextPage.title })
2115
- ] }),
2116
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react11.ChevronRight, { className: "page-nav-arrow", size: 16 })
2117
- ]
2118
- }
2119
- ) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", {})
2120
- ] })
2121
- ] }),
2122
- toc !== void 0 ? toc : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2123
- OnThisPage,
2124
- {
2125
- headings: routes[currentIndex]?.headings,
2126
- editLink: config.themeConfig?.editLink,
2127
- communityHelp: config.themeConfig?.communityHelp,
2128
- filePath: routes[currentIndex]?.filePath
2129
- }
2130
- )
2131
- ] })
2132
- ] });
2133
- }
2134
- var import_react17, import_react_router_dom10, import_lucide_react11, import_jsx_runtime21;
2135
- var init_Layout = __esm({
2136
- "src/client/theme/ui/Layout/Layout.tsx"() {
2137
- "use strict";
2138
- import_react17 = __toESM(require("react"));
2139
- import_react_router_dom10 = require("react-router-dom");
2140
- init_Link2();
2141
- import_lucide_react11 = require("lucide-react");
2142
- init_preload();
2143
- init_Navbar2();
2144
- init_Sidebar2();
2145
- init_OnThisPage2();
2146
- init_Head2();
2147
- init_Breadcrumbs2();
2148
- init_Navbar2();
2149
- init_Sidebar2();
2150
- init_OnThisPage2();
2151
- init_Head2();
2152
- init_Breadcrumbs2();
2153
- init_ProgressBar3();
2154
- init_ErrorBoundary2();
2155
- init_CopyMarkdown2();
2156
- init_styles();
2157
- import_jsx_runtime21 = require("react/jsx-runtime");
2158
- }
2159
- });
2160
-
2161
- // src/client/theme/ui/Layout/index.ts
2162
- var init_Layout2 = __esm({
2163
- "src/client/theme/ui/Layout/index.ts"() {
2164
- "use strict";
2165
- init_Layout();
2166
- }
2167
- });
2168
-
2169
- // src/client/theme/ui/NotFound/NotFound.tsx
2170
- function NotFound() {
2171
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "boltdocs-not-found", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "not-found-content", children: [
2172
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "not-found-code", children: "404" }),
2173
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h1", { className: "not-found-title", children: "Page Not Found" }),
2174
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "not-found-text", children: "The page you're looking for doesn't exist or has been moved." }),
2175
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Link, { to: "/", className: "not-found-link", children: [
2176
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react12.ArrowLeft, { size: 16 }),
2177
- " Go to Home"
2178
- ] })
2179
- ] }) });
2180
- }
2181
- var import_lucide_react12, import_jsx_runtime22;
2182
- var init_NotFound = __esm({
2183
- "src/client/theme/ui/NotFound/NotFound.tsx"() {
2184
- "use strict";
2185
- init_Link2();
2186
- import_lucide_react12 = require("lucide-react");
2187
- import_jsx_runtime22 = require("react/jsx-runtime");
2188
- }
2189
- });
2190
-
2191
- // src/client/theme/ui/NotFound/index.ts
2192
- var init_NotFound2 = __esm({
2193
- "src/client/theme/ui/NotFound/index.ts"() {
2194
- "use strict";
2195
- init_NotFound();
2196
- }
2197
- });
2198
-
2199
- // src/client/theme/ui/Loading/Loading.tsx
2200
- function Loading() {
2201
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "boltdocs-loading", children: [
2202
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "loading-spinner" }),
2203
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "loading-text", children: "Loading..." })
2204
- ] });
2205
- }
2206
- var import_jsx_runtime23;
2207
- var init_Loading = __esm({
2208
- "src/client/theme/ui/Loading/Loading.tsx"() {
2209
- "use strict";
2210
- import_jsx_runtime23 = require("react/jsx-runtime");
2211
- }
2212
- });
2213
-
2214
- // src/client/theme/ui/Loading/index.ts
2215
- var init_Loading2 = __esm({
2216
- "src/client/theme/ui/Loading/index.ts"() {
2217
- "use strict";
2218
- init_Loading();
2219
- }
2220
- });
2221
-
2222
- // src/client/theme/components/CodeBlock/CodeBlock.tsx
2223
- function CodeBlock({ children, ...props }) {
2224
- const [copied, setCopied] = (0, import_react18.useState)(false);
2225
- const [isExpanded, setIsExpanded] = (0, import_react18.useState)(false);
2226
- const [isExpandable, setIsExpandable] = (0, import_react18.useState)(false);
2227
- const preRef = (0, import_react18.useRef)(null);
2228
- const handleCopy = (0, import_react18.useCallback)(async () => {
2229
- const code = preRef.current?.textContent || "";
2230
- copyToClipboard(code);
2231
- setCopied(true);
2232
- setTimeout(() => setCopied(false), 2e3);
2233
- }, []);
2234
- import_react18.default.useEffect(() => {
2235
- if (preRef.current) {
2236
- const codeLength = preRef.current.textContent?.length || 0;
2237
- setIsExpandable(codeLength > 500);
2238
- }
2239
- }, [children]);
2240
- const shouldTruncate = isExpandable && !isExpanded;
2241
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: `code-block-wrapper ${shouldTruncate ? "is-truncated" : ""}`, children: [
2242
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2243
- "button",
2244
- {
2245
- className: `code-block-copy ${copied ? "copied" : ""}`,
2246
- onClick: handleCopy,
2247
- "aria-label": "Copy code",
2248
- children: copied ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react13.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react13.Copy, { size: 16 })
2249
- }
2250
- ),
2251
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("pre", { ref: preRef, ...props, children }),
2252
- isExpandable && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "code-block-expand-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
2253
- "button",
2254
- {
2255
- className: "code-block-expand-btn",
2256
- onClick: () => setIsExpanded(!isExpanded),
2257
- children: isExpanded ? "Show less" : "Expand code"
2258
- }
2259
- ) })
2260
- ] });
2261
- }
2262
- var import_react18, import_lucide_react13, import_jsx_runtime24;
2263
- var init_CodeBlock = __esm({
2264
- "src/client/theme/components/CodeBlock/CodeBlock.tsx"() {
2265
- "use strict";
2266
- import_react18 = __toESM(require("react"));
2267
- import_lucide_react13 = require("lucide-react");
2268
- init_utils();
2269
- import_jsx_runtime24 = require("react/jsx-runtime");
2270
- }
2271
- });
2272
-
2273
- // src/client/theme/components/CodeBlock/index.ts
2274
- var init_CodeBlock2 = __esm({
2275
- "src/client/theme/components/CodeBlock/index.ts"() {
2276
- "use strict";
2277
- init_CodeBlock();
2278
- }
2279
- });
2280
-
2281
- // src/client/theme/components/Video/Video.tsx
2282
- function Video({
2283
- src,
2284
- poster,
2285
- alt,
2286
- children,
2287
- controls,
2288
- preload = "metadata",
2289
- ...rest
2290
- }) {
2291
- const containerRef = (0, import_react19.useRef)(null);
2292
- const [isVisible, setIsVisible] = (0, import_react19.useState)(false);
2293
- (0, import_react19.useEffect)(() => {
2294
- const el = containerRef.current;
2295
- if (!el) return;
2296
- const observer = new IntersectionObserver(
2297
- ([entry]) => {
2298
- if (entry.isIntersecting) {
2299
- setIsVisible(true);
2300
- observer.disconnect();
2301
- }
2302
- },
2303
- { rootMargin: "200px" }
2304
- );
2305
- observer.observe(el);
2306
- return () => observer.disconnect();
2307
- }, []);
2308
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref: containerRef, className: "boltdocs-video-wrapper", children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
2309
- "video",
2310
- {
2311
- className: "boltdocs-video",
2312
- src,
2313
- poster,
2314
- controls: true,
2315
- preload,
2316
- playsInline: true,
2317
- ...rest,
2318
- children: [
2319
- children,
2320
- "Your browser does not support the video tag."
2321
- ]
2322
- }
2323
- ) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
2324
- "div",
2325
- {
2326
- className: "boltdocs-video-placeholder",
2327
- role: "img",
2328
- "aria-label": alt || "Video"
2329
- }
2330
- ) });
2331
- }
2332
- var import_react19, import_jsx_runtime25;
2333
- var init_Video = __esm({
2334
- "src/client/theme/components/Video/Video.tsx"() {
2335
- "use strict";
2336
- import_react19 = require("react");
2337
- import_jsx_runtime25 = require("react/jsx-runtime");
2338
- }
2339
- });
2340
-
2341
- // src/client/theme/components/Video/index.ts
2342
- var Video_exports = {};
2343
- __export(Video_exports, {
2344
- Video: () => Video
2345
- });
2346
- var init_Video2 = __esm({
2347
- "src/client/theme/components/Video/index.ts"() {
2348
- "use strict";
2349
- init_Video();
2350
- }
2351
- });
2352
-
2353
- // src/client/theme/icons/npm.tsx
2354
- var import_jsx_runtime26, NPM;
2355
- var init_npm = __esm({
2356
- "src/client/theme/icons/npm.tsx"() {
2357
- "use strict";
2358
- import_jsx_runtime26 = require("react/jsx-runtime");
2359
- NPM = (props) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("svg", { ...props, viewBox: "0 0 2500 2500", children: [
2360
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("path", { fill: "#c00", d: "M0 0h2500v2500H0z" }),
2361
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
2362
- "path",
2363
- {
2364
- fill: "#fff",
2365
- d: "M1241.5 268.5h-973v1962.9h972.9V763.5h495v1467.9h495V268.5z"
2366
- }
2367
- )
2368
- ] });
2369
- }
2370
- });
2371
-
2372
- // src/client/theme/icons/pnpm.tsx
2373
- var import_jsx_runtime27, Pnpm;
2374
- var init_pnpm = __esm({
2375
- "src/client/theme/icons/pnpm.tsx"() {
2376
- "use strict";
2377
- import_jsx_runtime27 = require("react/jsx-runtime");
2378
- Pnpm = (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
2379
- "svg",
2380
- {
2381
- ...props,
2382
- xmlnsXlink: "http://www.w3.org/1999/xlink",
2383
- viewBox: "76.58987244897958 44 164.00775510204068 164",
2384
- children: [
2385
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("defs", { children: [
2386
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2387
- "path",
2388
- {
2389
- d: "M237.6 95L187.6 95L187.6 45L237.6 45L237.6 95Z",
2390
- id: "pnpm_dark__b45vdTD8hs"
2391
- }
2392
- ),
2393
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2394
- "path",
2395
- {
2396
- d: "M182.59 95L132.59 95L132.59 45L182.59 45L182.59 95Z",
2397
- id: "pnpm_dark__a40WtxIl8d"
2398
- }
2399
- ),
2400
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2401
- "path",
2402
- {
2403
- d: "M127.59 95L77.59 95L77.59 45L127.59 45L127.59 95Z",
2404
- id: "pnpm_dark__h2CN9AEEpe"
2405
- }
2406
- ),
2407
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2408
- "path",
2409
- {
2410
- d: "M237.6 150L187.6 150L187.6 100L237.6 100L237.6 150Z",
2411
- id: "pnpm_dark__dqv5133G8"
2412
- }
2413
- ),
2414
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2415
- "path",
2416
- {
2417
- d: "M182.59 150L132.59 150L132.59 100L182.59 100L182.59 150Z",
2418
- id: "pnpm_dark__b1Lv79ypvm"
2419
- }
2420
- ),
2421
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2422
- "path",
2423
- {
2424
- d: "M182.59 205L132.59 205L132.59 155L182.59 155L182.59 205Z",
2425
- id: "pnpm_dark__hy1IZWwLX"
2426
- }
2427
- ),
2428
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2429
- "path",
2430
- {
2431
- d: "M237.6 205L187.6 205L187.6 155L237.6 155L237.6 205Z",
2432
- id: "pnpm_dark__akQfjxQes"
2433
- }
2434
- ),
2435
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2436
- "path",
2437
- {
2438
- d: "M127.59 205L77.59 205L77.59 155L127.59 155L127.59 205Z",
2439
- id: "pnpm_dark__bdSrwE5pk"
2440
- }
2441
- )
2442
- ] }),
2443
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("g", { children: [
2444
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("use", { xlinkHref: "#pnpm_dark__b45vdTD8hs", fill: "#f9ad00" }) }),
2445
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("use", { xlinkHref: "#pnpm_dark__a40WtxIl8d", fill: "#f9ad00" }) }),
2446
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("use", { xlinkHref: "#pnpm_dark__h2CN9AEEpe", fill: "#f9ad00" }) }),
2447
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("use", { xlinkHref: "#pnpm_dark__dqv5133G8", fill: "#f9ad00" }) }),
2448
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("use", { xlinkHref: "#pnpm_dark__b1Lv79ypvm", fill: "#ffffff" }) }),
2449
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("use", { xlinkHref: "#pnpm_dark__hy1IZWwLX", fill: "#ffffff" }) }),
2450
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("use", { xlinkHref: "#pnpm_dark__akQfjxQes", fill: "#ffffff" }) }),
2451
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("use", { xlinkHref: "#pnpm_dark__bdSrwE5pk", fill: "#ffffff" }) })
2452
- ] })
2453
- ]
2454
- }
2455
- );
2456
- }
2457
- });
2458
-
2459
- // src/client/theme/icons/bun.tsx
2460
- var import_jsx_runtime28, Bun;
2461
- var init_bun = __esm({
2462
- "src/client/theme/icons/bun.tsx"() {
2463
- "use strict";
2464
- import_jsx_runtime28 = require("react/jsx-runtime");
2465
- Bun = (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("svg", { ...props, viewBox: "0 0 80 70", children: [
2466
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", { d: "M71.09 20.74c-.16-.17-.33-.34-.5-.5s-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5A26.46 26.46 0 0 1 75.5 35.7c0 16.57-16.82 30.05-37.5 30.05-11.58 0-21.94-4.23-28.83-10.86l.5.5.5.5.5.5.5.5.5.5.5.5.5.5C19.55 65.3 30.14 69.75 42 69.75c20.68 0 37.5-13.48 37.5-30 0-7.06-3.04-13.75-8.41-19.01Z" }),
2467
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2468
- "path",
2469
- {
2470
- d: "M73 35.7c0 15.21-15.67 27.54-35 27.54S3 50.91 3 35.7C3 26.27 9 17.94 18.22 13S33.18 3 38 3s8.94 4.13 19.78 10C67 17.94 73 26.27 73 35.7Z",
2471
- style: { fill: "#fbf0df" }
2472
- }
2473
- ),
2474
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2475
- "path",
2476
- {
2477
- d: "M73 35.7a21.67 21.67 0 0 0-.8-5.78c-2.73 33.3-43.35 34.9-59.32 24.94A40 40 0 0 0 38 63.24c19.3 0 35-12.35 35-27.54Z",
2478
- style: { fill: "#f6dece" }
2479
- }
2480
- ),
2481
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2482
- "path",
2483
- {
2484
- d: "M24.53 11.17C29 8.49 34.94 3.46 40.78 3.45A9.29 9.29 0 0 0 38 3c-2.42 0-5 1.25-8.25 3.13-1.13.66-2.3 1.39-3.54 2.15-2.33 1.44-5 3.07-8 4.7C8.69 18.13 3 26.62 3 35.7v1.19c6.06-21.41 17.07-23.04 21.53-25.72Z",
2485
- style: { fill: "#fffefc" }
2486
- }
2487
- ),
2488
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2489
- "path",
2490
- {
2491
- d: "M35.12 5.53A16.41 16.41 0 0 1 29.49 18c-.28.25-.06.73.3.59 3.37-1.31 7.92-5.23 6-13.14-.08-.45-.67-.33-.67.08Zm2.27 0A16.24 16.24 0 0 1 39 19c-.12.35.31.65.55.36 2.19-2.8 4.1-8.36-1.62-14.36-.29-.26-.74.14-.54.49Zm2.76-.17A16.42 16.42 0 0 1 47 17.12a.33.33 0 0 0 .65.11c.92-3.49.4-9.44-7.17-12.53-.4-.16-.66.38-.33.62Zm-18.46 10.4a16.94 16.94 0 0 0 10.47-9c.18-.36.75-.22.66.18-1.73 8-7.52 9.67-11.12 9.45-.38.01-.37-.52-.01-.63Z",
2492
- style: { fill: "#ccbea7", fillRule: "evenodd" }
2493
- }
2494
- ),
2495
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", { d: "M38 65.75C17.32 65.75.5 52.27.5 35.7c0-10 6.18-19.33 16.53-24.92 3-1.6 5.57-3.21 7.86-4.62 1.26-.78 2.45-1.51 3.6-2.19C32 1.89 35 .5 38 .5s5.62 1.2 8.9 3.14c1 .57 2 1.19 3.07 1.87 2.49 1.54 5.3 3.28 9 5.27C69.32 16.37 75.5 25.69 75.5 35.7c0 16.57-16.82 30.05-37.5 30.05ZM38 3c-2.42 0-5 1.25-8.25 3.13-1.13.66-2.3 1.39-3.54 2.15-2.33 1.44-5 3.07-8 4.7C8.69 18.13 3 26.62 3 35.7c0 15.19 15.7 27.55 35 27.55S73 50.89 73 35.7c0-9.08-5.69-17.57-15.22-22.7-3.78-2-6.73-3.88-9.12-5.36-1.09-.67-2.09-1.29-3-1.84C42.63 4 40.42 3 38 3Z" }),
2496
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("g", { children: [
2497
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2498
- "path",
2499
- {
2500
- d: "M45.05 43a8.93 8.93 0 0 1-2.92 4.71 6.81 6.81 0 0 1-4 1.88A6.84 6.84 0 0 1 34 47.71 8.93 8.93 0 0 1 31.12 43a.72.72 0 0 1 .8-.81h12.34a.72.72 0 0 1 .79.81Z",
2501
- style: { fill: "#b71422" }
2502
- }
2503
- ),
2504
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2505
- "path",
2506
- {
2507
- d: "M34 47.79a6.91 6.91 0 0 0 4.12 1.9 6.91 6.91 0 0 0 4.11-1.9 10.63 10.63 0 0 0 1-1.07 6.83 6.83 0 0 0-4.9-2.31 6.15 6.15 0 0 0-5 2.78c.23.21.43.41.67.6Z",
2508
- style: { fill: "#ff6164" }
2509
- }
2510
- ),
2511
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", { d: "M34.16 47a5.36 5.36 0 0 1 4.19-2.08 6 6 0 0 1 4 1.69c.23-.25.45-.51.66-.77a7 7 0 0 0-4.71-1.93 6.36 6.36 0 0 0-4.89 2.36 9.53 9.53 0 0 0 .75.73Z" }),
2512
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("path", { d: "M38.09 50.19a7.42 7.42 0 0 1-4.45-2 9.52 9.52 0 0 1-3.11-5.05 1.2 1.2 0 0 1 .26-1 1.41 1.41 0 0 1 1.13-.51h12.34a1.44 1.44 0 0 1 1.13.51 1.19 1.19 0 0 1 .25 1 9.52 9.52 0 0 1-3.11 5.05 7.42 7.42 0 0 1-4.44 2Zm-6.17-7.4c-.16 0-.2.07-.21.09a8.29 8.29 0 0 0 2.73 4.37A6.23 6.23 0 0 0 38.09 49a6.28 6.28 0 0 0 3.65-1.73 8.3 8.3 0 0 0 2.72-4.37.21.21 0 0 0-.2-.09Z" })
2513
- ] }),
2514
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("g", { children: [
2515
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2516
- "ellipse",
2517
- {
2518
- cx: "53.22",
2519
- cy: "40.18",
2520
- rx: "5.85",
2521
- ry: "3.44",
2522
- style: { fill: "#febbd0" }
2523
- }
2524
- ),
2525
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2526
- "ellipse",
2527
- {
2528
- cx: "22.95",
2529
- cy: "40.18",
2530
- rx: "5.85",
2531
- ry: "3.44",
2532
- style: { fill: "#febbd0" }
2533
- }
2534
- ),
2535
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2536
- "path",
2537
- {
2538
- d: "M25.7 38.8a5.51 5.51 0 1 0-5.5-5.51 5.51 5.51 0 0 0 5.5 5.51Zm24.77 0A5.51 5.51 0 1 0 45 33.29a5.5 5.5 0 0 0 5.47 5.51Z",
2539
- style: { fillRule: "evenodd" }
2540
- }
2541
- ),
2542
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2543
- "path",
2544
- {
2545
- d: "M24 33.64a2.07 2.07 0 1 0-2.06-2.07A2.07 2.07 0 0 0 24 33.64Zm24.77 0a2.07 2.07 0 1 0-2.06-2.07 2.07 2.07 0 0 0 2.04 2.07Z",
2546
- style: { fill: "#fff", fillRule: "evenodd" }
2547
- }
2548
- )
2549
- ] })
2550
- ] });
2551
- }
2552
- });
2553
-
2554
- // src/client/theme/icons/deno.tsx
2555
- var import_jsx_runtime29, Deno;
2556
- var init_deno = __esm({
2557
- "src/client/theme/icons/deno.tsx"() {
2558
- "use strict";
2559
- import_jsx_runtime29 = require("react/jsx-runtime");
2560
- Deno = (props) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2561
- "svg",
2562
- {
2563
- ...props,
2564
- xmlSpace: "preserve",
2565
- fillRule: "evenodd",
2566
- strokeLinejoin: "round",
2567
- strokeMiterlimit: "2",
2568
- clipRule: "evenodd",
2569
- viewBox: "0 0 441 441",
2570
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
2571
- "path",
2572
- {
2573
- fill: "currentColor",
2574
- d: "M229.858-2.62c121.29 5.675 215.154 108.755 209.479 230.045S330.582 442.578 209.292 436.903-5.863 328.149-.188 206.859 108.568-8.296 229.858-2.62Zm51.365 264.922c-13.886-.687-27.594-3.012-38.616-4.857-8.381-1.404-16.33-3.616-22.855-5.858a2.576 2.576 0 0 0-2.932.878c-.678.905-.777 2.22-.02 3.061 3.08 3.418 12.848 10.54 20.439 13.812-6.491 5.357-10.933 17.608-12.684 23.95-2.35 8.51-2.687 20.801-2.12 25.312 2.282 18.146 8.95 34.41 25.467 48.64 11.562 9.96 28.295 16.77 45.399 17.08 23.603.426 51.882-9.705 74.085-32.493 29.028-31.807 48.051-73.17 51.593-119.393 8.434-110.06-74.073-206.264-184.134-214.698C124.785 9.302 28.582 91.81 20.147 201.87c-4.368 56.998 15.655 110.28 51.267 149.576a3.185 3.185 0 0 0 5.422-2.974c-26.39-103.487 30.95-215.162 94.926-250.494 23.751-13.118 46.884-18.1 67.664-9.69 31.814 12.874 50 34.21 89.375 52.163 39.375 17.951 43.625 47.862 32.64 78.098-10.986 30.236-46.358 45.425-80.218 43.753Zm-68.863-160.08c-12.906 1.006-21.384 16.978-22.497 27.253-1.117 10.275 3.978 27.236 20.794 26.91 19.694-.383 25.681-17.238 23.525-33.55-1.618-12.25-11.033-21.456-21.822-20.613Z"
2575
- }
2576
- )
2577
- }
2578
- );
2579
- }
2580
- });
2581
-
2582
- // src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx
2583
- function getCommandForManager(manager, command, pkg) {
2584
- const isInstall = command === "install" || command === "add" || command === "i";
2585
- const isCreate = command === "create" || command === "init";
2586
- const isRun = command === "run" || command === "exec";
2587
- if (isInstall) {
2588
- const pkgArgs2 = pkg ? ` ${pkg}` : "";
2589
- if (manager === "npm") return `npm install${pkgArgs2}`;
2590
- if (manager === "pnpm") return pkg ? `pnpm add${pkgArgs2}` : `pnpm install`;
2591
- if (manager === "bun") return pkg ? `bun add${pkgArgs2}` : `bun install`;
2592
- if (manager === "deno")
2593
- return pkg ? `deno install npm:${pkg}` : `deno install`;
2594
- }
2595
- if (isCreate) {
2596
- const pkgArgs2 = pkg ? ` ${pkg}` : "";
2597
- if (manager === "npm") return `npm create${pkgArgs2}`;
2598
- if (manager === "pnpm") return `pnpm create${pkgArgs2}`;
2599
- if (manager === "bun") return `bun create${pkgArgs2}`;
2600
- if (manager === "deno") return `deno run -A npm:create-${pkg}`;
2601
- }
2602
- if (isRun) {
2603
- const pkgArgs2 = pkg ? ` ${pkg}` : "";
2604
- if (manager === "npm") return `npm run${pkgArgs2}`;
2605
- if (manager === "pnpm") return `pnpm run${pkgArgs2}`;
2606
- if (manager === "bun") return `bun run${pkgArgs2}`;
2607
- if (manager === "deno") return `deno task ${pkg}`;
2608
- }
2609
- const pkgArgs = pkg ? ` ${pkg}` : "";
2610
- return `${manager} ${command}${pkgArgs}`;
2611
- }
2612
- function PackageManagerTabs({
2613
- command,
2614
- pkg = "",
2615
- className = ""
2616
- }) {
2617
- const [activeTab, setActiveTab] = (0, import_react20.useState)("npm");
2618
- const [copied, setCopied] = (0, import_react20.useState)(false);
2619
- const activeCommand = getCommandForManager(activeTab, command, pkg);
2620
- const handleCopy = (0, import_react20.useCallback)(async () => {
2621
- copyToClipboard(activeCommand);
2622
- setCopied(true);
2623
- setTimeout(() => setCopied(false), 2e3);
2624
- }, [activeCommand]);
2625
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: `pkg-tabs-wrapper ${className}`, children: [
2626
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "pkg-tabs-header", children: MANAGERS.map((mgr) => {
2627
- const Icon = mgr.icon;
2628
- const isActive = activeTab === mgr.id;
2629
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
2630
- "button",
2631
- {
2632
- className: `pkg-tab-btn ${isActive ? "active" : ""}`,
2633
- onClick: () => setActiveTab(mgr.id),
2634
- "aria-selected": isActive,
2635
- role: "tab",
2636
- children: [
2637
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon, { className: "pkg-tab-icon", width: "16", height: "16" }),
2638
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: mgr.label })
2639
- ]
2640
- },
2641
- mgr.id
2642
- );
2643
- }) }),
2644
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "code-block-wrapper pkg-tabs-content", children: [
2645
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2646
- "button",
2647
- {
2648
- className: `code-block-copy ${copied ? "copied" : ""}`,
2649
- onClick: handleCopy,
2650
- type: "button",
2651
- "aria-label": "Copy code",
2652
- children: copied ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react14.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react14.Copy, { size: 14 })
2653
- }
2654
- ),
2655
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("pre", { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("code", { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "line", children: activeCommand }) }) })
2656
- ] })
2657
- ] });
2658
- }
2659
- var import_react20, import_lucide_react14, import_jsx_runtime30, MANAGERS;
2660
- var init_PackageManagerTabs = __esm({
2661
- "src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx"() {
2662
- "use strict";
2663
- import_react20 = require("react");
2664
- import_lucide_react14 = require("lucide-react");
2665
- init_npm();
2666
- init_pnpm();
2667
- init_bun();
2668
- init_deno();
2669
- init_utils();
2670
- import_jsx_runtime30 = require("react/jsx-runtime");
2671
- MANAGERS = [
2672
- { id: "npm", label: "npm", icon: NPM },
2673
- { id: "pnpm", label: "pnpm", icon: Pnpm },
2674
- { id: "bun", label: "bun", icon: Bun },
2675
- { id: "deno", label: "deno", icon: Deno }
2676
- ];
2677
- }
2678
- });
2679
-
2680
- // src/client/theme/components/PackageManagerTabs/index.ts
2681
- var PackageManagerTabs_exports = {};
2682
- __export(PackageManagerTabs_exports, {
2683
- PackageManagerTabs: () => PackageManagerTabs
2684
- });
2685
- var init_PackageManagerTabs2 = __esm({
2686
- "src/client/theme/components/PackageManagerTabs/index.ts"() {
2687
- "use strict";
2688
- init_PackageManagerTabs();
2689
- }
2690
- });
2691
-
2692
- // src/client/app/index.tsx
2693
- function useConfig() {
2694
- return (0, import_react23.useContext)(ConfigContext);
2695
- }
2696
- function AppShell({
2697
- initialRoutes,
2698
- initialConfig,
2699
- docsDirName,
2700
- modules,
2701
- hot,
2702
- homePage: HomePage,
2703
- components: customComponents = {}
2704
- }) {
2705
- const [routesInfo, setRoutesInfo] = (0, import_react21.useState)(initialRoutes);
2706
- const [config] = (0, import_react21.useState)(initialConfig);
2707
- const resolveRoutes = (infos) => {
2708
- return infos.filter(
2709
- (route) => !(HomePage && (route.path === "/" || route.path === ""))
2710
- ).map((route) => {
2711
- const loaderKey = Object.keys(modules).find(
2712
- (k) => k === `/${docsDirName}/${route.filePath}`
2713
- );
2714
- const loader = loaderKey ? modules[loaderKey] : null;
2715
- return {
2716
- ...route,
2717
- Component: import_react21.default.lazy(() => {
2718
- if (!loader)
2719
- return Promise.resolve({ default: () => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(NotFound, {}) });
2720
- return loader();
2721
- })
2722
- };
2723
- });
2724
- };
2725
- const [resolvedRoutes, setResolvedRoutes] = (0, import_react21.useState)(
2726
- () => resolveRoutes(initialRoutes)
2727
- );
2728
- (0, import_react21.useEffect)(() => {
2729
- if (hot) {
2730
- hot.on("boltdocs:routes-update", (newRoutes) => {
2731
- setRoutesInfo(newRoutes);
2732
- });
2733
- }
2734
- }, [hot]);
2735
- (0, import_react21.useEffect)(() => {
2736
- setResolvedRoutes(resolveRoutes(routesInfo));
2737
- }, [routesInfo, modules, docsDirName]);
2738
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ConfigContext.Provider, { value: config, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(PreloadProvider, { routes: routesInfo, modules, children: [
2739
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ScrollHandler, {}),
2740
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react_router_dom11.Routes, { children: [
2741
- HomePage && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2742
- import_react_router_dom11.Route,
2743
- {
2744
- path: "/",
2745
- element: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2746
- ThemeLayout,
2747
- {
2748
- config,
2749
- routes: routesInfo,
2750
- sidebar: null,
2751
- toc: null,
2752
- breadcrumbs: null,
2753
- ...config.themeConfig?.layoutProps,
2754
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(HomePage, {})
2755
- }
2756
- )
2757
- }
2758
- ),
2759
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2760
- import_react_router_dom11.Route,
2761
- {
2762
- element: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DocsLayout, { config, routes: routesInfo }),
2763
- children: resolvedRoutes.map((route) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2764
- import_react_router_dom11.Route,
2765
- {
2766
- path: route.path === "" ? "/" : route.path,
2767
- element: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react21.default.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Loading, {}), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2768
- MdxPage,
2769
- {
2770
- Component: route.Component,
2771
- customComponents
2772
- }
2773
- ) })
2774
- },
2775
- route.path
2776
- ))
2777
- },
2778
- "docs-layout"
2779
- ),
2780
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2781
- import_react_router_dom11.Route,
2782
- {
2783
- path: "*",
2784
- element: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2785
- ThemeLayout,
2786
- {
2787
- config,
2788
- routes: routesInfo,
2789
- ...config.themeConfig?.layoutProps,
2790
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(NotFound, {})
2791
- }
2792
- )
2793
- }
2794
- )
2795
- ] })
2796
- ] }) });
2797
- }
2798
- function ScrollHandler() {
2799
- const { pathname, hash } = (0, import_react_router_dom11.useLocation)();
2800
- (0, import_react23.useLayoutEffect)(() => {
2801
- const container = document.querySelector(".boltdocs-content");
2802
- if (!container) return;
2803
- if (hash) {
2804
- const id = hash.replace("#", "");
2805
- const element = document.getElementById(id);
2806
- if (element) {
2807
- const offset = 80;
2808
- const containerRect = container.getBoundingClientRect().top;
2809
- const elementRect = element.getBoundingClientRect().top;
2810
- const elementPosition = elementRect - containerRect;
2811
- const offsetPosition = elementPosition - offset + container.scrollTop;
2812
- container.scrollTo({
2813
- top: offsetPosition,
2814
- behavior: "smooth"
2815
- });
2816
- return;
2817
- }
2818
- }
2819
- container.scrollTo(0, 0);
2820
- }, [pathname, hash]);
2821
- return null;
2822
- }
2823
- function DocsLayout({
2824
- config,
2825
- routes
2826
- }) {
2827
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2828
- ThemeLayout,
2829
- {
2830
- config,
2831
- routes,
2832
- ...config.themeConfig?.layoutProps,
2833
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_router_dom11.Outlet, {})
2834
- }
2835
- );
2836
- }
2837
- function MdxPage({
2838
- Component: Component2,
2839
- customComponents = {}
2840
- }) {
2841
- const allComponents = { ...mdxComponents, ...customComponents };
2842
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react22.MDXProvider, { components: allComponents, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Component2, {}) });
2843
- }
2844
- var import_react21, import_client, import_react_router_dom11, import_react22, import_react23, import_lucide_react15, import_jsx_runtime31, ConfigContext, Video2, PackageManagerTabs2, Heading, mdxComponents;
2845
- var init_app = __esm({
2846
- "src/client/app/index.tsx"() {
2847
- "use strict";
2848
- import_react21 = __toESM(require("react"));
2849
- import_client = __toESM(require("react-dom/client"));
2850
- import_react_router_dom11 = require("react-router-dom");
2851
- init_Layout2();
2852
- init_NotFound2();
2853
- init_Loading2();
2854
- import_react22 = require("@mdx-js/react");
2855
- import_react23 = require("react");
2856
- import_lucide_react15 = require("lucide-react");
2857
- init_CodeBlock2();
2858
- init_preload();
2859
- import_jsx_runtime31 = require("react/jsx-runtime");
2860
- ConfigContext = (0, import_react23.createContext)(null);
2861
- Video2 = (0, import_react23.lazy)(
2862
- () => Promise.resolve().then(() => (init_Video2(), Video_exports)).then((m) => ({ default: m.Video }))
2863
- );
2864
- PackageManagerTabs2 = (0, import_react23.lazy)(
2865
- () => Promise.resolve().then(() => (init_PackageManagerTabs2(), PackageManagerTabs_exports)).then((m) => ({
2866
- default: m.PackageManagerTabs
2867
- }))
2868
- );
2869
- Heading = ({
2870
- level,
2871
- id,
2872
- children
2873
- }) => {
2874
- const Tag = `h${level}`;
2875
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Tag, { id, className: "boltdocs-heading", children: [
2876
- children,
2877
- id && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("a", { href: `#${id}`, className: "header-anchor", "aria-label": "Anchor", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.Link, { size: 16 }) })
2878
- ] });
2879
- };
2880
- mdxComponents = {
2881
- h1: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Heading, { level: 1, ...props }),
2882
- h2: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Heading, { level: 2, ...props }),
2883
- h3: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Heading, { level: 3, ...props }),
2884
- h4: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Heading, { level: 4, ...props }),
2885
- h5: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Heading, { level: 5, ...props }),
2886
- h6: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Heading, { level: 6, ...props }),
2887
- pre: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CodeBlock, { ...props, children: props.children }),
2888
- video: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react23.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "video-skeleton" }), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Video2, { ...props }) }),
2889
- PackageManagerTabs: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react23.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "pkg-tabs-skeleton" }), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PackageManagerTabs2, { ...props }) })
2890
- };
2891
- }
2892
- });
2893
-
2894
- // src/client/ssr.tsx
2895
- var ssr_exports = {};
2896
- __export(ssr_exports, {
2897
- render: () => render
2898
- });
2899
- module.exports = __toCommonJS(ssr_exports);
2900
- var import_react24 = __toESM(require("react"));
2901
- var import_server = __toESM(require("react-dom/server"));
2902
- var import_server2 = require("react-router-dom/server");
2903
- init_app();
2904
- var import_jsx_runtime32 = require("react/jsx-runtime");
2905
- async function render(options) {
2906
- const { path, routes, config, modules, homePage, docsDirName } = options;
2907
- const resolvedModules = {};
2908
- for (const [key, mod] of Object.entries(modules)) {
2909
- resolvedModules[key] = () => Promise.resolve(mod);
2910
- }
2911
- const html = import_server.default.renderToString(
2912
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react24.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_server2.StaticRouter, { location: path, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
2913
- AppShell,
2914
- {
2915
- initialRoutes: routes,
2916
- initialConfig: config,
2917
- docsDirName,
2918
- modules: resolvedModules,
2919
- homePage
2920
- }
2921
- ) }) })
2922
- );
2923
- return html;
2924
- }
2925
- // Annotate the CommonJS export names for ESM import in node:
2926
- 0 && (module.exports = {
2927
- render
2928
- });
1
+ "use strict";var qo=Object.create;var ke=Object.defineProperty;var Ko=Object.getOwnPropertyDescriptor;var Zo=Object.getOwnPropertyNames;var Jo=Object.getPrototypeOf,Qo=Object.prototype.hasOwnProperty;var ct=(e,t)=>{for(var o in t)ke(e,o,{get:t[o],enumerable:!0})},dt=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Zo(t))!Qo.call(e,n)&&n!==o&&ke(e,n,{get:()=>t[n],enumerable:!(r=Ko(t,n))||r.enumerable});return e};var R=(e,t,o)=>(o=e!=null?qo(Jo(e)):{},dt(t||!e||!e.__esModule?ke(o,"default",{value:e,enumerable:!0}):o,e)),Yo=e=>dt(ke({},"__esModule",{value:!0}),e);var Gr={};ct(Gr,{render:()=>_r});module.exports=Yo(Gr);var Uo=R(require("react")),jo=R(require("react-dom/server")),Xo=require("react-router-dom/server");var j=R(require("react")),Wr=R(require("react-dom/client")),ee=require("react-router-dom");var yt=require("lucide-react");var je=R(require("react")),ht=require("react-aria-components"),vt=require("react-router-dom");var mt=require("react-router-dom");var Ae=require("react"),Ge=(0,Ae.createContext)(null);function ie(){let e=(0,Ae.use)(Ge);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e}function Ue(e){let t=(0,mt.useLocation)(),o=ie();if(!o||typeof e!="string"||!o.i18n&&!o.versions)return e;let r="/docs";if(!e.startsWith(r))return e;let s=t.pathname.substring(r.length).split("/").filter(Boolean),c=o.versions?.defaultVersion,i=o.i18n?.defaultLocale,l=0;o.versions&&s.length>l&&o.versions.versions[s[l]]&&(c=s[l],l++),o.i18n&&s.length>l&&o.i18n.locales[s[l]]&&(i=s[l]);let m=e.substring(r.length).split("/").filter(Boolean),p=0,f=!1,g=!1;o.versions&&m.length>p&&o.versions.versions[m[p]]&&(f=!0,p++),o.i18n&&m.length>p&&o.i18n.locales[m[p]]&&(g=!0,p++);let b=m.slice(p),x=[];o.versions&&(f?x.push(m[0]):c&&x.push(c)),o.i18n&&(g?x.push(m[f?1:0]):i&&x.push(i)),x.push(...b);let N=`${r}/${x.join("/")}`;return N.endsWith("/")&&(N=N.slice(0,-1)),N===r?r:N}var te=require("react"),bt=require("react/jsx-runtime"),pt=(0,te.createContext)({preload:()=>{},routes:[]});function ut(){return(0,te.use)(pt)}function ft({routes:e,modules:t,children:o}){let r=(0,te.useRef)(null),n=(0,te.useCallback)(s=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{let c=s.split("#")[0].split("?")[0],i=e.find(l=>l.path===c||c==="/"&&l.path==="");if(i?.filePath){let l=Object.keys(t).find(d=>d.endsWith("/"+i.filePath));l&&t[l]().catch(d=>{console.error(`[boltdocs] Failed to preload route ${s}:`,d)})}},100)},[e,t]);return(0,bt.jsx)(pt.Provider,{value:{preload:n,routes:e},children:o})}var gt=require("clsx"),xt=require("tailwind-merge");function a(...e){return(0,xt.twMerge)((0,gt.clsx)(e))}var Xe=require("react/jsx-runtime"),oe=je.default.forwardRef((e,t)=>{let{href:o,prefetch:r="hover",onMouseEnter:n,onFocus:s,...c}=e,i=Ue(o??""),{preload:l}=ut();return(0,Xe.jsx)(ht.Link,{...c,ref:t,href:i,onMouseEnter:p=>{n?.(p),r==="hover"&&typeof i=="string"&&i.startsWith("/")&&l(i)},onFocus:p=>{s?.(p),r==="hover"&&typeof i=="string"&&i.startsWith("/")&&l(i)}})});oe.displayName="Link";var er=je.default.forwardRef((e,t)=>{let{href:o,end:r=!1,className:n,children:s,...c}=e,i=(0,vt.useLocation)(),l=Ue(o??""),d=r?i.pathname===l:i.pathname.startsWith(l),m=typeof n=="function"?n({isActive:d}):a(n,d&&"active"),p=typeof s=="function"?s({isActive:d}):s;return(0,Xe.jsx)(oe,{...c,ref:t,href:o,className:m,children:p})});er.displayName="NavLink";var Z=require("react/jsx-runtime");function qe(){return(0,Z.jsx)("div",{className:"flex items-center justify-center min-h-[60vh] text-center",children:(0,Z.jsxs)("div",{className:"space-y-4",children:[(0,Z.jsx)("span",{className:"text-8xl font-black tracking-tighter text-primary-500/20",children:"404"}),(0,Z.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"Page Not Found"}),(0,Z.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,Z.jsxs)(oe,{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,Z.jsx)(yt.ArrowLeft,{size:16})," Go to Home"]})]})})}var Le=require("react"),M=require("react/jsx-runtime");function Ct(){let[e,t]=(0,Le.useState)(0);(0,Le.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,M.jsx)("div",{className:"flex flex-col items-center justify-center min-h-[60vh] p-4 text-center",children:(0,M.jsx)("div",{className:"relative group",children:(0,M.jsxs)("div",{className:"relative inline-block",children:[(0,M.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,M.jsx)("title",{children:"Loading indicator background"}),(0,M.jsx)("path",{d:"M29.4449 0H19.4449V16.5L29.4449 6.5V0Z",fill:"currentColor"}),(0,M.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,M.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,M.jsx)("title",{children:"Loading indicator animated fill"}),(0,M.jsx)("path",{d:"M29.4449 0H19.4449V16.5L29.4449 6.5V0Z",fill:"currentColor"}),(0,M.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"})]})]})})})}var X=require("react"),wt=require("react/jsx-runtime"),Rt=(0,X.createContext)(void 0);function Nt({children:e}){let[t,o]=(0,X.useState)("dark"),[r,n]=(0,X.useState)(!1);(0,X.useEffect)(()=>{n(!0);let i=localStorage.getItem("boltdocs-theme");if(i==="light"||i==="dark")o(i);else{let m=window.matchMedia("(prefers-color-scheme: dark)").matches;o(m?"dark":"light")}let l=window.matchMedia("(prefers-color-scheme: dark)"),d=m=>{localStorage.getItem("boltdocs-theme")||o(m.matches?"dark":"light")};return l.addEventListener("change",d),()=>l.removeEventListener("change",d)},[]),(0,X.useEffect)(()=>{if(!r)return;let i=document.documentElement;t==="light"?(i.classList.add("theme-light"),i.dataset.theme="light"):(i.classList.remove("theme-light"),i.dataset.theme="dark")},[t,r]);let s=()=>{let i=t==="dark"?"light":"dark";o(i),localStorage.setItem("boltdocs-theme",i)},c=i=>{o(i),localStorage.setItem("boltdocs-theme",i)};return(0,wt.jsx)(Rt.Provider,{value:{theme:t,toggleTheme:s,setTheme:c},children:e})}function Pt(){let e=(0,X.use)(Rt);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}var We=R(require("virtual:boltdocs-layout"));var Tt=require("react"),kt=require("react-aria-components"),Be=require("react-router-dom"),Lt=require("react/jsx-runtime");function At({children:e}){let t=(0,Be.useNavigate)();return(0,Lt.jsx)(kt.RouterProvider,{navigate:(o,r)=>{(0,Tt.startTransition)(()=>{t(o,r)})},useHref:Be.useHref,children:e})}var Bt=require("react"),It=require("react-router-dom");function Mt(){let{pathname:e,hash:t}=(0,It.useLocation)();return(0,Bt.useLayoutEffect)(()=>{let o=document.querySelector(".boltdocs-content");if(o){if(t){let r=t.replace("#",""),n=document.getElementById(r);if(n){let c=o.getBoundingClientRect().top,d=n.getBoundingClientRect().top-c-80+o.scrollTop;o.scrollTo({top:d,behavior:"smooth"});return}}o.scrollTo(0,0)}},[e,t]),null}var St=require("react-router-dom"),Et=R(require("virtual:boltdocs-layout")),Ke=require("react/jsx-runtime");function Ot(){return(0,Ke.jsx)(Et.default,{children:(0,Ke.jsx)(St.Outlet,{})})}var Ft=require("@mdx-js/react");var Ie=require("react"),zt=require("react/jsx-runtime"),Dt=(0,Ie.createContext)({});function Vt(){return(0,Ie.useContext)(Dt)}function Ht({components:e,children:t}){return(0,zt.jsx)(Dt.Provider,{value:e,children:t})}var Ze=require("react/jsx-runtime");function $t({Component:e}){let t=Vt();return(0,Ze.jsx)(Ft.MDXProvider,{components:t,children:(0,Ze.jsx)(e,{})})}var Wo=require("lucide-react");var lt={};ct(lt,{Admonition:()=>Q,Badge:()=>to,Button:()=>_t,Card:()=>io,Cards:()=>so,Caution:()=>go,CodeBlock:()=>re,ComponentPreview:()=>Lo,ComponentProps:()=>ko,CopyMarkdown:()=>$o,Danger:()=>uo,Field:()=>Ro,FileTree:()=>vo,Image:()=>wo,Important:()=>bo,InfoBox:()=>fo,Link:()=>No,List:()=>xo,Note:()=>co,Tab:()=>Jt,Table:()=>Co,Tabs:()=>Qt,Tip:()=>mo,Video:()=>Yt,Warning:()=>po});var Se=R(require("react-aria-components"));var Wt=require("class-variance-authority"),_=require("react/jsx-runtime"),Me=(0,Wt.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"}}),ae=({href:e,icon:t,iconPosition:o="left",isIconOnly:r,children:n,className:s,variant:c,size:i,rounded:l,iconSize:d,disabled:m,...p})=>{let f=r||!n&&!!t,g=f?(0,_.jsx)("span",{className:"inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]",children:t}):(0,_.jsxs)(_.Fragment,{children:[t&&o==="left"&&(0,_.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t}),(0,_.jsx)("span",{className:"flex items-center",children:n}),t&&o==="right"&&(0,_.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t})]});return e?(0,_.jsx)(Se.Link,{href:e,className:a(Me({variant:c,size:i,rounded:l,iconSize:f?d:void 0,disabled:m}),s),...p,children:g}):(0,_.jsx)(Se.Button,{className:a(Me({variant:c,size:i,rounded:l,iconSize:f?d:void 0,disabled:m}),s),...p,children:g})};var Gt=require("react/jsx-runtime"),_t=({className:e,variant:t,size:o,rounded:r,iconSize:n,disabled:s,...c})=>(0,Gt.jsx)(ae,{className:a("group",Me({variant:t,size:o,rounded:r,iconSize:n,disabled:s,className:e})),...c});var Ee=R(require("react-aria-components")),Oe=require("lucide-react");var Je=require("codesandbox/lib/api/define.js");function Ut(e){let t=e.files||{},o=e.dependencies||{},r=e.devDependencies||{},n=e.title||"codesandbox-project",s=e.description||"Generic Sandbox",c={};for(let[i,l]of Object.entries(t)){let d=typeof l.content=="object"?JSON.stringify(l.content,null,2):l.content;c[i]={content:d,isBinary:l.isBinary??!1}}if(!c["package.json"]){let l=e.template==="vite"||!!r.vite||!!r["@vitejs/plugin-react"]?{dev:"vite",build:"vite build",preview:"vite preview"}:{start:"node index.js"};c["package.json"]={content:JSON.stringify({private:!0,name:n,description:s,type:"module",version:"1.0.0",scripts:e.scripts||l,dependencies:o,devDependencies:r},null,2),isBinary:!1}}return c}function tr(e){let t=Ut(e),o=(0,Je.getParameters)({files:t}),r=new URLSearchParams({parameters:o,installDependencies:"true"});return e.entry&&r.set("file",`/${e.entry}`),{parameters:o,url:`https://codesandbox.io/api/v1/sandboxes/define?${r.toString()}`,options:e}}function jt(e){if(typeof window>"u")return tr(e);let t=Ut(e),o=(0,Je.getParameters)({files:t}),r=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 s=(i,l)=>{let d=document.createElement("input");d.type="hidden",d.name=i,d.value=l,n.appendChild(d)},c=new URLSearchParams({file:`/${r}`,eslint:"0",codemirror:"1",installDependencies:"true"});return s("query",c.toString()),s("parameters",o),document.body.appendChild(n),n.submit(),document.body.removeChild(n),{parameters:o,url:`https://codesandbox.io/api/v1/sandboxes/define?parameters=${o}`,options:e}}var Xt=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement("textarea");return t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),!0}};var G=require("react");function qt(e){let{title:t,sandbox:o}=e,[r,n]=(0,G.useState)(!1),[s,c]=(0,G.useState)(!1),[i,l]=(0,G.useState)(!1),d=(0,G.useRef)(null),m=ie(),p=(0,G.useCallback)(async()=>{let g=d.current?.textContent??"";Xt(g),n(!0),setTimeout(()=>n(!1),2e3)},[]),f=(0,G.useCallback)(()=>{let g=d.current?.textContent??"",b=m?.integrations?.sandbox?.config||{},x=typeof o=="object"?o:b,N=x.entry||"src/App.tsx";jt({title:t??"Code Snippet",...x,files:{...x.files,[N]:{content:g}}})},[t,m,o]);return(0,G.useEffect)(()=>{let g=d.current?.textContent?.length??0;l(g>120)},[e.children,e.highlightedHtml]),{copied:r,isExpanded:s,setIsExpanded:c,isExpandable:i,preRef:d,handleCopy:p,handleSandbox:f,shouldTruncate:i&&!s}}var he=require("react/jsx-runtime");function or(e){let{size:t=20,...o}=e;return{...o,width:t,height:t}}var Kt=e=>(0,he.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...or(e),children:[(0,he.jsx)("title",{children:"CodeSandbox"}),(0,he.jsx)("path",{d:"M0 24h24V0H0v2.455h21.546v19.09H2.454V0H0Z"})]});var le=R(require("react-aria-components"));var z=require("react/jsx-runtime"),nr=({className:e,children:t,...o})=>(0,z.jsx)(le.Tooltip,{...o,offset:8,className:r=>a("group z-50 overflow-visible rounded-md bg-bg-surface/90 px-2.5 py-1.5 text-xs font-medium text-text-main shadow-lg backdrop-blur-md ring-1 ring-border-subtle outline-hidden select-none","data-entering:animate-in data-entering:fade-in data-entering:zoom-in-95 data-entering:duration-100","data-exiting:animate-out data-exiting:fade-out data-exiting:zoom-out-95 data-exiting:duration-75","data-[placement=top]:slide-in-from-bottom-1","data-[placement=bottom]:slide-in-from-top-1","data-[placement=left]:slide-in-from-right-1","data-[placement=right]:slide-in-from-left-1",typeof e=="function"?e(r):e),children:r=>(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(le.OverlayArrow,{children:(0,z.jsxs)("svg",{width:8,height:8,viewBox:"0 0 8 8",className:"fill-bg-surface/90 stroke-border-subtle group-data-[placement=bottom]:rotate-180 group-data-[placement=left]:-rotate-90 group-data-[placement=right]:rotate-90",children:[(0,z.jsx)("title",{children:"Arrow"}),(0,z.jsx)("path",{d:"M0 0 L4 4 L8 0"})]})}),typeof t=="function"?t(r):t]})}),Qe=({content:e,children:t,delay:o=500,closeDelay:r=0,...n})=>(0,z.jsxs)(le.TooltipTrigger,{delay:o,closeDelay:r,children:[t,(0,z.jsx)(nr,{...n,children:e})]});var A=require("react/jsx-runtime");function re(e){let{children:t,sandbox:o,hideSandbox:r=!0,hideCopy:n=!1,highlightedHtml:s,...c}=e,d=!!ie()?.integrations?.sandbox?.enable&&!r,{copied:m,isExpanded:p,setIsExpanded:f,isExpandable:g,preRef:b,handleCopy:x,handleSandbox:N,shouldTruncate:H}=qt(e);return(0,A.jsxs)("div",{className:a("group relative my-6 overflow-hidden rounded-lg border border-border-subtle bg-(--color-code-bg)",H&&"[&>pre]:max-h-[250px] [&>pre]:overflow-hidden"),children:[(0,A.jsxs)("div",{className:"absolute top-3 right-4 z-50 flex items-center gap-2 transition-all duration-300 opacity-0 group-hover:opacity-100",children:[d&&(0,A.jsx)(Qe,{content:"Open in CodeSandbox",children:(0,A.jsx)(Ee.Button,{onPress:N,className:"grid place-items-center w-8 h-8 bg-transparent text-text-muted outline-none cursor-pointer transition-all duration-200 hover:scale-115 hover:text-sky-400 active:scale-95 [&>svg]:w-5 [&>svg]:h-5 [&>svg]:stroke-2","aria-label":"Open in CodeSandbox",children:(0,A.jsx)(Kt,{size:20})})}),!n&&(0,A.jsx)(Qe,{content:m?"Copied!":"Copy code",children:(0,A.jsx)(Ee.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",m?"text-emerald-400":"text-text-muted hover:text-text-main"),"aria-label":"Copy code",children:m?(0,A.jsx)(Oe.Check,{size:20}):(0,A.jsx)(Oe.Copy,{size:20})})})]}),s?(0,A.jsx)("div",{ref:b,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}}):(0,A.jsx)("pre",{ref:b,className:"m-0! rounded-none! border-none! bg-inherit! font-mono text-[0.8125rem] leading-[1.7]",...c,children:t}),g&&(0,A.jsx)("div",{className:a(H?"absolute bottom-0 inset-x-0 h-24 bg-linear-to-t from-(--color-code-bg) to-transparent flex items-end justify-center pb-4 z-10":"relative flex justify-center py-4"),children:(0,A.jsx)(Ee.Button,{onPress:()=>f(!p),className:"rounded-full bg-bg-surface border border-border-subtle px-5 py-2 text-[0.8125rem] font-medium text-text-main outline-none cursor-pointer transition-all hover:bg-border-subtle hover:-translate-y-px backdrop-blur-md",children:p?"Show less":"Expand code"})})]})}var ce=require("react"),ne=R(require("react-aria-components"));var J=require("react");function Zt({initialIndex:e=0,tabs:t}){let o=t[e]?.props.disabled?t.findIndex(d=>!d.props.disabled):e,[r,n]=(0,J.useState)(o===-1?0:o),s=(0,J.useRef)([]),[c,i]=(0,J.useState)({opacity:0,transform:"translateX(0)",width:0});(0,J.useEffect)(()=>{let d=s.current[r];d&&i({opacity:1,width:d.offsetWidth,transform:`translateX(${d.offsetLeft}px)`})},[r,t]);let l=(0,J.useCallback)(d=>{let m=0;if(d.key==="ArrowRight"?m=1:d.key==="ArrowLeft"&&(m=-1),m!==0){let p=(r+m+t.length)%t.length;for(;t[p].props.disabled&&p!==r;)p=(p+m+t.length)%t.length;p!==r&&!t[p].props.disabled&&(n(p),s.current[p]?.focus())}},[r,t]);return{active:r,setActive:n,tabRefs:s,indicatorStyle:c,handleKeyDown:l}}var Ye=require("class-variance-authority"),S=require("react/jsx-runtime"),sr=(0,Ye.cva)("relative flex items-center border-b border-border-subtle gap-1 overflow-x-auto no-scrollbar",{variants:{size:{default:"px-0",compact:"px-2"}},defaultVariants:{size:"default"}}),ir=(0,Ye.cva)("flex items-center gap-2 px-4 py-2.5 text-sm font-medium outline-none transition-all duration-200 cursor-pointer bg-transparent border-none select-none whitespace-nowrap",{variants:{isActive:{true:"text-primary-500",false:"text-text-muted hover:text-text-main"},isDisabled:{true:"opacity-40 pointer-events-none",false:""}},defaultVariants:{isActive:!1,isDisabled:!1}});function Jt({children:e}){let t=typeof e=="string"?(0,S.jsx)(re,{className:"language-bash",children:(0,S.jsx)("code",{children:e.trim()})}):e;return(0,S.jsx)("div",{className:"py-4",children:t})}function Qt({defaultIndex:e=0,children:t}){let o=(0,ce.useMemo)(()=>ce.Children.toArray(t).filter(i=>(0,ce.isValidElement)(i)&&i.props?.label),[t]),{active:r,setActive:n,tabRefs:s,indicatorStyle:c}=Zt({initialIndex:e,tabs:o});return(0,S.jsx)("div",{className:"my-8 w-full group/tabs",children:(0,S.jsxs)(ne.Tabs,{selectedKey:r.toString(),onSelectionChange:i=>n(Number(i)),className:"w-full",children:[(0,S.jsxs)(ne.TabList,{"aria-label":"Content Tabs",className:a(sr()),children:[o.map((i,l)=>{let{label:d,icon:m,disabled:p}=i.props,f=l.toString();return(0,S.jsxs)(ne.Tab,{id:f,isDisabled:p,ref:g=>{s.current[l]=g},className:({isSelected:g,isDisabled:b})=>a(ir({isActive:g,isDisabled:b})),children:[!!m&&(0,S.jsx)("span",{className:"shrink-0 [&>svg]:w-4 [&>svg]:h-4",children:m}),(0,S.jsx)("span",{children:d})]},f)}),(0,S.jsx)("div",{className:"absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300 ease-in-out pointer-events-none",style:c,"aria-hidden":"true"})]}),o.map((i,l)=>(0,S.jsx)(ne.TabPanel,{id:l.toString(),children:o[l]},l))]})})}var de=require("react"),ve=require("react/jsx-runtime");function Yt({src:e,poster:t,alt:o,children:r,controls:n,preload:s="metadata",...c}){let i=(0,de.useRef)(null),[l,d]=(0,de.useState)(!1);return(0,de.useEffect)(()=>{let m=i.current;if(!m)return;let p=new IntersectionObserver(([f])=>{f.isIntersecting&&(d(!0),p.disconnect())},{rootMargin:"200px"});return p.observe(m),()=>p.disconnect()},[]),(0,ve.jsx)("div",{ref:i,className:"my-6 overflow-hidden rounded-lg border border-border-subtle",children:l?(0,ve.jsxs)("video",{className:"block w-full h-auto",src:e,poster:t,controls:!0,preload:s,playsInline:!0,...c,children:[r,"Your browser does not support the video tag."]}):(0,ve.jsx)("div",{className:"aspect-video bg-bg-surface animate-pulse",role:"img","aria-label":o||"Video"})})}var eo=require("class-variance-authority"),oo=require("react/jsx-runtime"),ar=(0,eo.cva)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold tracking-tight",{variants:{variant:{default:"bg-bg-surface text-text-muted border-border-subtle",primary:"bg-primary-500/15 text-primary-400 border-primary-500/20",success:"bg-emerald-500/15 text-emerald-400 border-emerald-500/20",warning:"bg-amber-500/15 text-amber-400 border-amber-500/20",danger:"bg-red-500/15 text-red-400 border-red-500/20",info:"bg-sky-500/15 text-sky-400 border-sky-500/20"}},defaultVariants:{variant:"default"}});function to({variant:e="default",children:t,className:o="",...r}){return(0,oo.jsx)("span",{className:a(ar({variant:e}),o),...r,children:t})}var ye=require("react"),ro=R(require("react-aria-components"));var no=require("class-variance-authority"),E=require("react/jsx-runtime"),lr=(0,no.cva)("grid gap-4 my-6",{variants:{cols:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"}},defaultVariants:{cols:3}});function so({cols:e=3,children:t,className:o="",...r}){return(0,E.jsx)("div",{className:a(lr({cols:e}),o),...r,children:t})}function io({title:e,icon:t,href:o,children:r,className:n="",...s}){let c=(0,ye.useRef)(null),i=(0,ye.useRef)(null),l=(0,ye.useCallback)(p=>{let f=c.current||i.current;if(!f)return;let{left:g,top:b}=f.getBoundingClientRect();f.style.setProperty("--x",`${p.clientX-g}px`),f.style.setProperty("--y",`${p.clientY-b}px`)},[]),d=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:"pointer-events-none absolute -inset-px rounded-xl opacity-0 transition-opacity duration-300 group-hover:opacity-100",style:{background:"radial-gradient(400px circle at var(--x) var(--y), color-mix(in oklch, var(--color-primary-500), transparent 90%), transparent 80%)"}}),t&&(0,E.jsx)("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-primary-500/10 text-primary-400 text-lg transition-transform duration-300 group-hover:scale-105 group-hover:-rotate-3",children:t}),(0,E.jsxs)("div",{className:"space-y-1.5",children:[e&&(0,E.jsx)("h3",{className:"text-sm font-bold text-text-main",children:e}),r&&(0,E.jsx)("div",{className:"text-sm text-text-muted leading-relaxed",children:r})]})]}),m=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 o?(0,E.jsx)(ro.Link,{ref:i,href:o,className:a(m,"no-underline cursor-pointer"),onMouseMove:l,...s,children:d}):(0,E.jsx)("div",{ref:c,role:"presentation",className:m,onMouseMove:l,...s,children:d})}var B=require("lucide-react");var lo=require("class-variance-authority"),P=require("react/jsx-runtime"),cr={note:(0,P.jsx)(B.Bookmark,{size:18}),tip:(0,P.jsx)(B.Lightbulb,{size:18}),info:(0,P.jsx)(B.Info,{size:18}),warning:(0,P.jsx)(B.AlertTriangle,{size:18}),danger:(0,P.jsx)(B.ShieldAlert,{size:18}),important:(0,P.jsx)(B.Flame,{size:18}),caution:(0,P.jsx)(B.Zap,{size:18})},dr={note:"Note",tip:"Tip",info:"Info",warning:"Warning",danger:"Danger",important:"Important",caution:"Caution"},ao=(0,lo.cva)("py-4 px-4 rounded-lg",{variants:{type:{note:"border-primary-400 bg-primary-500/5 text-primary-400",tip:"border-emerald-500 bg-emerald-500/5 text-emerald-500",info:"border-sky-500 bg-sky-500/5 text-sky-500",warning:"border-amber-500 bg-amber-500/5 text-amber-500",danger:"border-red-500 bg-red-500/5 text-red-500",important:"border-orange-500 bg-orange-500/5 text-orange-500",caution:"border-yellow-500 bg-yellow-500/5 text-yellow-500"}},defaultVariants:{type:"note"}});function Q({type:e="note",title:t,children:o,className:r="",...n}){return(0,P.jsxs)("div",{className:a(ao({type:e}),r),role:e==="warning"||e==="danger"?"alert":"note",...n,children:[(0,P.jsxs)("div",{className:"flex items-center flex-row gap-2 mb-2",children:[(0,P.jsx)("span",{className:a("shrink-0",ao({type:e})),children:cr[e]}),(0,P.jsx)("span",{className:"text-sm font-bold tracking-tight text-text-main",children:t||dr[e]})]}),(0,P.jsx)("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 [&>p]:mb-2 [&>p:last-child]:mb-0",children:o})]})}var co=e=>(0,P.jsx)(Q,{type:"note",...e}),mo=e=>(0,P.jsx)(Q,{type:"tip",...e}),po=e=>(0,P.jsx)(Q,{type:"warning",...e}),uo=e=>(0,P.jsx)(Q,{type:"danger",...e}),fo=e=>(0,P.jsx)(Q,{type:"info",...e}),bo=e=>(0,P.jsx)(Q,{type:"important",...e}),go=e=>(0,P.jsx)(Q,{type:"caution",...e});var De=require("react"),me=require("lucide-react");var Ve=require("class-variance-authority"),U=require("react/jsx-runtime"),mr=(0,Ve.cva)("my-6 transition-all duration-200",{variants:{variant:{default:"list-disc pl-5 text-text-muted marker:text-primary-500/50",number:"list-decimal pl-5 text-text-muted marker:text-primary-500/50 marker:font-bold",checked:"list-none p-0",arrow:"list-none p-0",bubble:"list-none p-0"},cols:{1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"},isGrid:{true:"grid gap-x-8 gap-y-3",false:"space-y-2"},dense:{true:"space-y-1",false:"space-y-2"}},compoundVariants:[{variant:"default",dense:!0,className:"space-y-0.5"}],defaultVariants:{variant:"default",cols:1,isGrid:!1,dense:!1}}),pr=(0,Ve.cva)("group flex items-start gap-3 text-sm leading-relaxed transition-all duration-200",{variants:{variant:{default:"",number:"",checked:"hover:translate-x-0.5",arrow:"hover:translate-x-0.5",bubble:"hover:translate-x-0.5"},dense:{true:"py-0",false:"py-0.5"}},defaultVariants:{variant:"default",dense:!1}}),ur=(0,Ve.cva)("mt-1 shrink-0 flex items-center justify-center transition-transform group-hover:scale-110",{variants:{variant:{bubble:"h-5 w-5 rounded-full bg-primary-500/10 text-primary-500 text-[10px] font-bold",default:""}},defaultVariants:{variant:"default"}});function fr({icon:e,children:t,variant:o,dense:r}){return(0,U.jsxs)("li",{className:a(pr({variant:o,dense:r})),children:[e&&(0,U.jsx)("span",{className:a(ur({variant:o==="bubble"?"bubble":"default"})),children:e}),(0,U.jsx)("div",{className:"flex-1 text-text-muted group-hover:text-text-main transition-colors",children:t})]})}var br={checked:e=>(0,U.jsx)(me.Check,{size:14,className:a("text-emerald-500 shrink-0",e)}),arrow:e=>(0,U.jsx)(me.ChevronRight,{size:14,className:a("text-primary-400 shrink-0",e)}),bubble:e=>(0,U.jsx)(me.Circle,{size:6,fill:"currentColor",className:a("text-primary-500 shrink-0",e)}),default:()=>null,number:()=>null};function xo({variant:e="default",cols:t=1,dense:o=!1,children:r,className:n,...s}){let c=t!==void 0&&Number(t)>1,i=br[e],l=mr({variant:e,cols:t,dense:o,isGrid:c,className:n}),d=e==="number"?"ol":"ul";return e==="default"||e==="number"?(0,U.jsx)(d,{className:l,...s,children:r}):(0,U.jsx)("ul",{className:l,...s,children:De.Children.map(r,m=>{if(!(0,De.isValidElement)(m))return m;let p=m,f=p.type==="li"?p.props.children:p.props.children||m;return(0,U.jsx)(fr,{icon:i(),variant:e,dense:o,children:f})})})}var q=require("react"),K=R(require("react-aria-components")),F=require("lucide-react");var w=require("react/jsx-runtime"),Ce=16,Re=2,et={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 ot(e){return typeof e=="string"?e:typeof e=="number"?e.toString():Array.isArray(e)?e.map(ot).join(""):(0,q.isValidElement)(e)&&e.props&&typeof e.props=="object"&&"children"in e.props?ot(e.props.children):""}function gr(e,t){let o=e.toLowerCase(),r="shrink-0 transition-colors duration-200";if(t)return(0,w.jsx)(F.Folder,{size:Ce,strokeWidth:Re,className:a(r,"text-primary-400"),fill:"currentColor",fillOpacity:.15});let n=a(r,"text-text-dim group-hover:text-text-main");return et.CODE.test(o)?(0,w.jsx)(F.FileCode,{size:Ce,strokeWidth:Re,className:n}):et.TEXT.test(o)?(0,w.jsx)(F.FileText,{size:Ce,strokeWidth:Re,className:n}):et.IMAGE.test(o)?(0,w.jsx)(F.FileImage,{size:Ce,strokeWidth:Re,className:n}):(0,w.jsx)(F.File,{size:Ce,strokeWidth:Re,className:n})}function tt(e,t){if(!(0,q.isValidElement)(e))return!1;let o=e.type;if(typeof o=="string")return o===t;if(typeof o=="function")return o.name===t||o.name?.toLowerCase()===t;let r=e.props;return r?.originalType===t||r?.mdxType===t}function xr(e){let t=e.match(/\s+(\/\/|#)\s+(.*)$/);return t?{name:e.slice(0,t.index).trim(),comment:t[2]}:{name:e.trim()}}function He(e,t="root"){if(!(0,q.isValidElement)(e))return[];let o=[];if(tt(e,"ul"))return q.Children.forEach(e.props.children,(r,n)=>{o.push(...He(r,`${t}-${n}`))}),o;if(tt(e,"li")){let r=q.Children.toArray(e.props.children),n=r.findIndex(b=>tt(b,"ul")),s=n!==-1,c=s?r.slice(0,n):r,i=s?r.slice(n):[],l=ot(c),{name:d,comment:m}=xr(l),p=d.endsWith("/"),f=p?d.slice(0,-1):d,g=s||p;return o.push({id:`${t}-${f}`,name:f,comment:m,isFolder:g,children:s?He(i[0],`${t}-${f}`):void 0}),o}return e.props&&typeof e.props=="object"&&"children"in e.props&&q.Children.forEach(e.props.children,(r,n)=>{o.push(...He(r,`${t}-${n}`))}),o}function ho({item:e}){return(0,w.jsxs)(K.TreeItem,{id:e.id,textValue:e.name,className:"outline-none group focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md",children:[(0,w.jsx)(K.TreeItemContent,{children:({isExpanded:t,hasChildItems:o})=>(0,w.jsxs)("div",{className:"flex items-center gap-2 py-1 px-1.5 rounded-md transition-colors hover:bg-primary-500/5 cursor-pointer",children:[(0,w.jsx)("div",{style:{width:"calc((var(--tree-item-level) - 1) * 1rem)"},className:"shrink-0"}),o?(0,w.jsx)(K.Button,{slot:"chevron",className:"outline-none text-text-dim hover:text-primary-400 p-0.5 rounded transition-colors",children:(0,w.jsx)(F.ChevronRight,{size:14,strokeWidth:3,className:a("transition-transform duration-200",t&&"rotate-90")})}):(0,w.jsx)("div",{className:"w-[18px]"}),gr(e.name,e.isFolder),(0,w.jsx)("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&&(0,w.jsxs)("span",{className:"ml-2 text-xs italic text-text-dim opacity-70 group-hover:opacity-100 transition-opacity whitespace-nowrap overflow-hidden text-ellipsis font-sans",children:["//"," ",e.comment]})]})}),e.children&&(0,w.jsx)(K.Collection,{items:e.children,children:t=>(0,w.jsx)(ho,{item:t})})]})}function vo({children:e}){let t=(0,q.useMemo)(()=>He(e),[e]);return(0,w.jsx)("div",{className:"my-8",children:(0,w.jsx)(K.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:o=>(0,w.jsx)(ho,{item:o})})})}var Ne=R(require("react-aria-components"));var pe=require("react");function yo({data:e,sortable:t=!1,paginated:o=!1,pageSize:r=10}){let[n,s]=(0,pe.useState)(null),[c,i]=(0,pe.useState)(1),l=(0,pe.useMemo)(()=>{if(!e)return[];let f=[...e];return t&&n!==null&&f.sort((g,b)=>{let x=g[n.key],N=b[n.key],H=typeof x=="string"?x:"",Te=typeof N=="string"?N:"";return H<Te?n.direction==="asc"?-1:1:H>Te?n.direction==="asc"?1:-1:0}),f},[e,n,t]),d=Math.ceil(l.length/r),m=(0,pe.useMemo)(()=>{if(!o)return l;let f=(c-1)*r;return l.slice(f,f+r)},[l,o,c,r]);return{sortConfig:n,currentPage:c,setCurrentPage:i,totalPages:d,paginatedData:m,requestSort:f=>{if(!t)return;let g="asc";n&&n.key===f&&n.direction==="asc"&&(g="desc"),s({key:f,direction:g})}}}var O=require("lucide-react");var h=require("react/jsx-runtime");function Co({headers:e,data:t,children:o,className:r="",sortable:n=!1,paginated:s=!1,pageSize:c=10}){let{sortConfig:i,currentPage:l,setCurrentPage:d,totalPages:m,paginatedData:p,requestSort:f}=yo({data:t,sortable:n,paginated:s,pageSize:c}),g=x=>n?i?.key!==x?(0,h.jsx)(O.ChevronDown,{size:14,className:"ml-1 opacity-30"}):i.direction==="asc"?(0,h.jsx)(O.ChevronUp,{size:14,className:"ml-1 text-primary-400"}):(0,h.jsx)(O.ChevronDown,{size:14,className:"ml-1 text-primary-400"}):null,b=o||(0,h.jsxs)(h.Fragment,{children:[e&&(0,h.jsx)("thead",{children:(0,h.jsx)("tr",{children:e.map((x,N)=>(0,h.jsx)("th",{onClick:()=>f(N),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:(0,h.jsxs)("div",{className:"flex items-center",children:[x,g(N)]})},N))})}),p&&(0,h.jsx)("tbody",{children:p.map((x,N)=>(0,h.jsx)("tr",{className:"transition-colors hover:bg-bg-surface",children:x.map((H,Te)=>(0,h.jsx)("td",{className:"px-3 py-2 border-b border-border-subtle text-sm text-text-muted",children:H},Te))},N))})]});return(0,h.jsxs)("div",{className:a("my-6 rounded-lg border border-border-subtle overflow-hidden",r),children:[(0,h.jsx)("div",{className:"overflow-x-auto",children:(0,h.jsx)("table",{className:"w-full border-collapse text-sm",children:b})}),s&&m>1&&(0,h.jsxs)("div",{className:"flex items-center justify-between border-t border-border-subtle px-4 py-3",children:[(0,h.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",l," of ",m]}),(0,h.jsxs)("div",{className:"flex items-center gap-1",children:[(0,h.jsx)(Ne.Button,{onPress:()=>d(1),isDisabled:l===1,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:(0,h.jsx)(O.ChevronsLeft,{size:16})}),(0,h.jsx)(Ne.Button,{onPress:()=>d(x=>Math.max(x-1,1)),isDisabled:l===1,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:(0,h.jsx)(O.ChevronLeft,{size:16})}),(0,h.jsx)(Ne.Button,{onPress:()=>d(x=>Math.min(x+1,m)),isDisabled:l===m,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:(0,h.jsx)(O.ChevronRight,{size:16})}),(0,h.jsx)(Ne.Button,{onPress:()=>d(m),isDisabled:l===m,className:"grid place-items-center h-7 w-7 rounded-md text-text-muted outline-none transition-colors hover:bg-bg-surface disabled:opacity-30 disabled:pointer-events-none cursor-pointer",children:(0,h.jsx)(O.ChevronsRight,{size:16})})]})]})]})}var D=require("react/jsx-runtime");function Ro({name:e,type:t,defaultValue:o,required:r=!1,children:n,id:s,className:c=""}){return(0,D.jsxs)("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",c),id:s,children:[(0,D.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,D.jsxs)("div",{className:"flex flex-wrap items-center gap-2.5",children:[(0,D.jsx)("code",{className:"inline-flex items-center rounded-md bg-primary-500/10 px-2.5 py-1 font-mono text-sm font-bold text-primary-400 border border-primary-500/20 shadow-sm transition-colors group-hover:bg-primary-500/15",children:e}),t&&(0,D.jsx)("span",{className:"rounded-md bg-bg-muted/80 border border-border-subtle px-2 py-0.5 text-[11px] font-semibold text-text-muted uppercase tracking-wider shadow-sm",children:t}),r&&(0,D.jsxs)("div",{className:"flex items-center gap-1.5 rounded-full bg-red-500/10 px-2.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-red-400 border border-red-500/20 shadow-sm",children:[(0,D.jsx)("span",{className:"h-1 w-1 rounded-full bg-red-400 animate-pulse"}),"Required"]})]}),o&&(0,D.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-text-muted bg-bg-muted/30 px-2.5 py-1 rounded-md border border-border-subtle/50",children:[(0,D.jsx)("span",{className:"font-semibold opacity-60 uppercase tracking-tighter",children:"Default"}),(0,D.jsx)("code",{className:"font-mono text-text-main font-medium",children:o})]})]}),(0,D.jsx)("div",{className:"text-sm text-text-muted leading-relaxed [&>p]:m-0 selection:bg-primary-500/30",children:n})]})}var Po=require("react/jsx-runtime");function No({to:e,children:t,className:o="",...r}){let n=e&&(e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")),s=a("text-blue-600 hover:text-blue-800 hover:underline cursor-pointer",o);return(0,Po.jsx)(oe,{href:e,className:s,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,...r,children:t})}var To=require("react/jsx-runtime");function wo({src:e,alt:t,theme:o,...r}){let{theme:n}=Pt();return o&&o!==n?null:(0,To.jsx)("img",{src:e,alt:t||"",...r})}var C=require("react/jsx-runtime");function ko({title:e,props:t,className:o=""}){return(0,C.jsxs)("div",{className:a("my-6",o),children:[e&&(0,C.jsx)("h3",{className:"text-base font-bold text-text-main mb-3",children:e}),(0,C.jsx)("div",{className:"overflow-x-auto rounded-lg border border-border-subtle",children:(0,C.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,C.jsx)("thead",{children:(0,C.jsxs)("tr",{children:[(0,C.jsx)("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Property"}),(0,C.jsx)("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Type"}),(0,C.jsx)("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Default"}),(0,C.jsx)("th",{className:"text-left px-4 py-3 border-b-2 border-border-subtle text-xs font-bold uppercase tracking-wider text-text-muted",children:"Description"})]})}),(0,C.jsx)("tbody",{children:t.map((r,n)=>(0,C.jsxs)("tr",{className:"transition-colors hover:bg-bg-surface",children:[(0,C.jsxs)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:[(0,C.jsx)("code",{className:"rounded bg-bg-surface px-1.5 py-0.5 font-mono text-xs font-bold text-primary-400",children:r.name}),r.required&&(0,C.jsx)("span",{className:"ml-1 text-red-400 font-bold",children:"*"})]}),(0,C.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:(0,C.jsx)("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-text-muted",children:r.type})}),(0,C.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle",children:r.defaultValue?(0,C.jsx)("code",{className:"rounded bg-bg-muted px-1.5 py-0.5 font-mono text-xs text-primary-400",children:r.defaultValue}):(0,C.jsx)("span",{className:"text-text-dim",children:"\u2014"})}),(0,C.jsx)("td",{className:"px-4 py-2.5 border-b border-border-subtle text-text-muted",children:r.description})]},`${r.name}-${n}`))})]})})]})}var rt=require("react");function Ao(e){let{code:t,children:o,preview:r}=e,n=(0,rt.useMemo)(()=>(t??(typeof o=="string"?o:"")).trim(),[t,o]),s=(0,rt.useMemo)(()=>r??(typeof o!="string"?o:null),[r,o]);return{initialCode:n,previewElement:s}}var ue=require("react/jsx-runtime");function Lo(e){let{highlightedHtml:t,hideCode:o=!1,hideSandbox:r=!1,hideCopy:n=!1,sandboxOptions:s={}}=e,{initialCode:c,previewElement:i}=Ao(e);return(0,ue.jsxs)("div",{className:"my-6 overflow-hidden rounded-xl border border-border-subtle",children:[(0,ue.jsx)("div",{className:"flex items-center justify-center p-8 bg-bg-surface",children:i}),!o&&(0,ue.jsx)("div",{className:"border-t border-border-subtle",children:(0,ue.jsx)(re,{hideSandbox:r,hideCopy:n,title:s.title,lang:"tsx",highlightedHtml:t,children:c})})]})}var Fo=require("react"),Y=require("lucide-react");var Bo=require("react");var hr=require("react-aria-components"),Pe=require("lucide-react");var Io=require("react/jsx-runtime");var we=R(require("react-aria-components")),vr=require("lucide-react");var it=require("react/jsx-runtime");var k=R(require("react-aria-components")),se=require("lucide-react");var v=require("react/jsx-runtime"),yr=({children:e,isOpen:t,onOpenChange:o,className:r})=>(0,v.jsx)(k.ModalOverlay,{isOpen:t,onOpenChange:o,isDismissable:!0,className:a("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,v.jsx)(k.Modal,{className:a("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,v.jsx)(k.Dialog,{className:"flex flex-col max-h-[70vh] focus:outline-none",children:e})})}),Cr=({children:e,className:t,...o})=>(0,v.jsx)("div",{className:t,children:(0,v.jsx)(k.Autocomplete,{...o,className:"flex flex-col min-h-0",children:e})}),Rr=({className:e,...t})=>(0,v.jsxs)(k.SearchField,{className:"flex items-center gap-3 border-b border-border-subtle px-4 py-4",autoFocus:!0,children:[(0,v.jsx)(se.Search,{className:"h-5 w-5 text-text-muted"}),(0,v.jsx)(k.Input,{...t,className:a("w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none",e),placeholder:"Search documentation..."}),(0,v.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,v.jsx)("kbd",{className:"font-sans",children:"ESC"})})]}),Nr=({children:e,className:t,...o})=>(0,v.jsx)(k.ListBox,{...o,className:a("flex-1 overflow-y-auto p-2 outline-none",t),children:e}),Pr=({children:e,className:t,...o})=>(0,v.jsx)(k.ListBoxItem,{...o,className:a("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,v.jsxs)(v.Fragment,{children:[e,(r.isFocused||r.isSelected)&&(0,v.jsxs)("div",{className:"ml-auto opacity-50 flex items-center gap-1",children:[(0,v.jsx)("span",{className:"text-[10px]",children:"Select"}),(0,v.jsx)(se.CornerDownLeft,{size:10})]})]})}),wr=({isHeading:e,className:t})=>(0,v.jsx)("div",{className:a("shrink-0",t),children:e?(0,v.jsx)(se.Hash,{size:18}):(0,v.jsx)(se.FileText,{size:18})}),Tr=({children:e,className:t})=>(0,v.jsx)("span",{className:a("block font-medium truncate flex-1 text-sm",t),children:e}),kr=({children:e,className:t})=>(0,v.jsx)("span",{className:a("ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100",t),children:e}),si={Root:yr,Autocomplete:Cr,Input:Rr,List:Nr,Item:Object.assign(Pr,{Icon:wr,Title:Tr,Bio:kr})};var V=require("react"),Ar=R(require("scroll-into-view-if-needed"));var Mo=require("react");var So=require("react/jsx-runtime"),hi=(0,V.createContext)(null),vi=(0,V.createContext)(null);function Lr(e){let[t,o]=(0,V.useState)({isOverflowing:!1,isAtBottom:!1});return(0,V.useEffect)(()=>{let r=e.current;if(!r)return;let n=()=>{let c=r.scrollHeight>r.clientHeight,i=r.scrollHeight-r.scrollTop<=r.clientHeight+2;o({isOverflowing:c,isAtBottom:i})};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}var Br=({children:e,className:t,ref:o,...r})=>{let n=(0,V.useRef)(null);(0,V.useImperativeHandle)(o,()=>n.current);let{isOverflowing:s,isAtBottom:c}=Lr(n);return(0,So.jsx)("div",{ref:n,className:a("relative overflow-y-auto boltdocs-otp-content",s&&!c&&"mask-[linear-gradient(to_bottom,black_85%,transparent_100%)]",t),...r,children:e})};Br.displayName="OnThisPageContent";var Eo=R(require("react-aria-components")),$e=require("lucide-react");var $=require("react/jsx-runtime"),Ir=({children:e,className:t})=>(0,$.jsx)("nav",{className:a("grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle",t),children:e}),Mr=({children:e,to:t,direction:o,className:r})=>{let n=o==="next";return(0,$.jsxs)(Eo.Link,{href:t,className:a("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)($e.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)($e.ChevronRight,{className:"ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1"})]})},Sr=({children:e,className:t})=>(0,$.jsx)("span",{className:a("text-xs font-medium uppercase tracking-wider text-text-muted",t),children:e}),Er=({children:e,className:t})=>(0,$.jsx)("span",{className:a("text-base font-bold text-text-main truncate",t),children:e}),Or=({children:e})=>(0,$.jsx)($.Fragment,{children:e}),Ni={PageNavRoot:Ir,PageNavLink:Object.assign(Mr,{Title:Sr,Description:Er,Icon:Or})};var Dr=require("react/jsx-runtime");var Vr=R(require("react-aria-components")),Hr=require("lucide-react");var Oo=require("react/jsx-runtime");var at=require("react-aria-components"),zr=require("lucide-react");var Fr=require("react/jsx-runtime");var Vo=require("react/jsx-runtime"),Do=({children:e,className:t,vertical:o=!1})=>(0,Vo.jsx)("div",{className:a("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 ge=require("lucide-react"),zo=R(require("react")),L=R(require("react-aria-components"));var be=R(require("react-aria-components"));var fe=require("react/jsx-runtime"),Ho=({children:e,className:t,showArrow:o,...r})=>(0,fe.jsxs)(be.Popover,{offset:8,...r,className:be.composeRenderProps(t,n=>a("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,fe.jsx)(be.OverlayArrow,{className:"group",children:(0,fe.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,fe.jsx)("path",{d:"M0 0 L6 6 L12 0"})})}),e]});var I=require("react/jsx-runtime");function nt(e){let[t,o]=zo.default.Children.toArray(e.children).slice(0,2);return(0,I.jsxs)(L.MenuTrigger,{...e,children:[t,(0,I.jsx)(Ho,{placement:e.placement,className:"min-w-[200px]",children:o})]})}function st(e){return(0,I.jsx)(L.Menu,{...e,className:L.composeRenderProps(e.className,t=>a("p-1.5 outline-none max-h-[inherit] overflow-auto",t))})}function ze(e){let t=e.textValue||(typeof e.children=="string"?e.children:void 0);return(0,I.jsx)(L.MenuItem,{...e,textValue:t,className:L.composeRenderProps(e.className,(o,{isFocused:r,isPressed:n,isDisabled:s})=>a("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,I.jsxs)(I.Fragment,{children:[r!=="none"&&(0,I.jsxs)("span",{className:"flex items-center w-4 h-4 shrink-0 justify-center",children:[n&&r==="multiple"&&(0,I.jsx)(ge.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,I.jsx)(ge.Dot,{className:"w-6 h-6 text-primary-500 animate-in zoom-in-50 duration-200"})]}),(0,I.jsx)("div",{className:"flex-1 flex flex-row items-center gap-2.5 truncate font-medium",children:o}),s&&(0,I.jsx)(ge.ChevronRight,{className:"w-4 h-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors"})]}))})}var Fe=require("react-aria-components");var T=require("react/jsx-runtime"),$r=e=>{let[t,o]=(0,Fo.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"}),c=URL.createObjectURL(s);window.open(c,"_blank")}}};function $o({content:e,mdxRaw:t,config:o}){let r=t||e||"",{copied:n,handleCopy:s,handleOpenRaw:c}=$r(r),i=o!==!1,l=typeof o=="object"&&o.text||"Copy Markdown";return!i||!r?null:(0,T.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,T.jsxs)(Do,{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,T.jsx)(ae,{variant:"ghost",onPress:s,icon:n?(0,T.jsx)(Y.Check,{size:16}):(0,T.jsx)(Y.Copy,{size:16}),iconPosition:"left",className:a("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!":l}),(0,T.jsxs)(nt,{placement:"bottom end",children:[(0,T.jsx)(ae,{variant:"ghost",isIconOnly:!0,icon:(0,T.jsx)(Y.ChevronDown,{size:14}),className:a("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,T.jsxs)(st,{className:"w-52",children:[(0,T.jsxs)(ze,{onAction:s,className:"flex flex-row items-start gap-2.5 group",children:[(0,T.jsx)(Y.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,T.jsx)("span",{className:"font-medium text-[0.8125rem]",children:"Copy Markdown"})]}),(0,T.jsxs)(ze,{onAction:c,className:"flex flex-row items-start gap-2.5 group",children:[(0,T.jsx)(Y.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,T.jsx)("span",{className:"font-medium text-[0.8125rem]",children:"View as Markdown"})]})]})]})]})})}var W=require("react/jsx-runtime"),xe=({level:e,id:t,children:o})=>{let r=`h${e}`;return(0,W.jsxs)(r,{id:t,className:"boltdocs-heading",children:[o,t&&(0,W.jsx)("a",{href:`#${t}`,className:"header-anchor","aria-label":"Anchor",children:(0,W.jsx)(Wo.Link,{size:16})})]})},_o={...lt,h1:e=>(0,W.jsx)(xe,{level:1,...e}),h2:e=>(0,W.jsx)(xe,{level:2,...e}),h3:e=>(0,W.jsx)(xe,{level:3,...e}),h4:e=>(0,W.jsx)(xe,{level:4,...e}),h5:e=>(0,W.jsx)(xe,{level:5,...e}),h6:e=>(0,W.jsx)(xe,{level:6,...e}),pre:e=>(0,W.jsx)(re,{...e,children:e.children})};var y=require("react/jsx-runtime");function Go({initialRoutes:e,initialConfig:t,docsDirName:o,modules:r,hot:n,homePage:s,externalPages:c,components:i={}}){let[l,d]=(0,j.useState)(e),[m]=(0,j.useState)(t),p=c||{},f=(0,j.useMemo)(()=>l.filter(b=>!(s&&(b.path==="/"||b.path===""))&&!p[b.path===""?"/":b.path]).map(b=>{let x=Object.keys(r).find(H=>H===`/${o}/${b.filePath}`||H.endsWith(`/${o}/${b.filePath}`)||H.endsWith(`/${o}\\${b.filePath.replace(/\\/g,"/")}`)),N=x?r[x]:null;return{...b,Component:j.default.lazy(async()=>N?await N():{default:qe})}}),[l,r,o,s,p]);(0,j.useEffect)(()=>{n&&n.on("boltdocs:routes-update",b=>{d(b)})},[n]);let g=(0,j.useMemo)(()=>({..._o,...i}),[i]);return(0,y.jsx)(Nt,{children:(0,y.jsx)(Ht,{components:g,children:(0,y.jsx)(Ge.Provider,{value:m,children:(0,y.jsx)(At,{children:(0,y.jsxs)(ft,{routes:l,modules:r,children:[(0,y.jsx)(Mt,{}),(0,y.jsxs)(ee.Routes,{children:[s&&(0,y.jsx)(ee.Route,{path:"/",element:(0,y.jsx)(We.default,{children:(0,y.jsx)(s,{})})}),Object.entries(p).map(([b,x])=>(0,y.jsx)(ee.Route,{path:b,element:(0,y.jsx)(We.default,{children:(0,y.jsx)(x,{})})},b)),(0,y.jsx)(ee.Route,{element:(0,y.jsx)(Ot,{}),children:f.map(b=>(0,y.jsx)(ee.Route,{path:b.path===""?"/":b.path,element:(0,y.jsx)(j.default.Suspense,{fallback:(0,y.jsx)(Ct,{}),children:(0,y.jsx)($t,{Component:b.Component})})},b.path))},"docs-layout"),(0,y.jsx)(ee.Route,{path:"*",element:(0,y.jsx)(We.default,{children:(0,y.jsx)(qe,{})})})]})]})})})})})}var _e=require("react/jsx-runtime");async function _r(e){let{path:t,routes:o,config:r,modules:n,homePage:s,externalPages:c,docsDirName:i}=e,l={};for(let[m,p]of Object.entries(n))l[m]=()=>Promise.resolve(p);return jo.default.renderToString((0,_e.jsx)(Uo.default.StrictMode,{children:(0,_e.jsx)(Xo.StaticRouter,{location:t,children:(0,_e.jsx)(Go,{initialRoutes:o,initialConfig:r,docsDirName:i,modules:l,homePage:s,externalPages:c})})}))}0&&(module.exports={render});