boltdocs 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/bin/boltdocs.js +2 -2
  3. package/dist/base-ui/index.d.mts +3 -3
  4. package/dist/base-ui/index.d.ts +3 -3
  5. package/dist/base-ui/index.js +1 -1
  6. package/dist/base-ui/index.mjs +1 -1
  7. package/dist/{cache-CRAZ55X7.mjs → cache-P6WK424C.mjs} +1 -1
  8. package/dist/chunk-22NXDNP4.mjs +74 -0
  9. package/dist/chunk-2HUVMMJU.mjs +1 -0
  10. package/dist/chunk-2Z5T6EAU.mjs +1 -0
  11. package/dist/chunk-CRZGOE32.mjs +1 -0
  12. package/dist/chunk-HA6543SL.mjs +1 -0
  13. package/dist/{chunk-ZK2266IZ.mjs → chunk-RPUERTVC.mjs} +1 -1
  14. package/dist/{chunk-MZBG4N4W.mjs → chunk-URTD6E6S.mjs} +1 -1
  15. package/dist/chunk-W2NB4T6V.mjs +1 -0
  16. package/dist/chunk-Y4RRHPXC.mjs +1 -0
  17. package/dist/client/index.d.mts +1 -1
  18. package/dist/client/index.d.ts +1 -1
  19. package/dist/client/index.js +1 -1
  20. package/dist/client/index.mjs +1 -1
  21. package/dist/client/ssr.js +1 -1
  22. package/dist/client/ssr.mjs +1 -1
  23. package/dist/hooks/index.d.mts +7 -15
  24. package/dist/hooks/index.d.ts +7 -15
  25. package/dist/hooks/index.js +1 -1
  26. package/dist/hooks/index.mjs +1 -1
  27. package/dist/{loading-chS3pm9W.d.ts → loading-B7X5Wchs.d.ts} +3 -5
  28. package/dist/{loading-BqGrFWO5.d.mts → loading-WuaQbsKb.d.mts} +3 -5
  29. package/dist/mdx/index.js +1 -1
  30. package/dist/mdx/index.mjs +1 -1
  31. package/dist/node/cli-entry.js +27 -23
  32. package/dist/node/cli-entry.mjs +5 -1
  33. package/dist/node/index.js +10 -10
  34. package/dist/node/index.mjs +1 -1
  35. package/dist/primitives/index.d.mts +2 -2
  36. package/dist/primitives/index.d.ts +2 -2
  37. package/dist/primitives/index.js +1 -1
  38. package/dist/primitives/index.mjs +1 -1
  39. package/dist/search-dialog-ZRXBAQJ5.mjs +1 -0
  40. package/package.json +2 -1
  41. package/src/client/app/theme-context.tsx +14 -7
  42. package/src/client/components/default-layout.tsx +6 -2
  43. package/src/client/components/primitives/navbar.tsx +3 -3
  44. package/src/client/components/primitives/search-dialog.tsx +4 -4
  45. package/src/client/components/primitives/sidebar.tsx +3 -2
  46. package/src/client/components/primitives/skeleton.tsx +26 -0
  47. package/src/client/components/ui-base/loading.tsx +43 -73
  48. package/src/client/components/ui-base/navbar.tsx +8 -6
  49. package/src/client/components/ui-base/page-nav.tsx +2 -1
  50. package/src/client/components/ui-base/powered-by.tsx +4 -1
  51. package/src/client/components/ui-base/search-dialog.tsx +16 -5
  52. package/src/client/components/ui-base/sidebar.tsx +4 -2
  53. package/src/client/hooks/use-i18n.ts +3 -2
  54. package/src/client/hooks/use-localized-to.ts +6 -5
  55. package/src/client/hooks/use-page-nav.ts +27 -6
  56. package/src/client/hooks/use-routes.ts +2 -1
  57. package/src/client/hooks/use-search.ts +81 -59
  58. package/src/client/hooks/use-sidebar.ts +2 -1
  59. package/src/client/store/use-boltdocs-store.ts +6 -5
  60. package/src/client/theme/neutral.css +29 -0
  61. package/src/node/{cli.ts → cli/build.ts} +17 -23
  62. package/src/node/cli/dev.ts +22 -0
  63. package/src/node/cli/doctor.ts +243 -0
  64. package/src/node/cli/index.ts +9 -0
  65. package/src/node/cli/ui.ts +54 -0
  66. package/src/node/cli-entry.ts +16 -16
  67. package/src/node/config.ts +1 -1
  68. package/src/node/plugin/entry.ts +1 -1
  69. package/src/node/plugin/index.ts +24 -10
  70. package/src/node/routes/parser.ts +9 -9
  71. package/src/node/search/index.ts +55 -0
  72. package/src/node/ssg/index.ts +14 -6
  73. package/src/node/ssg/robots.ts +7 -4
  74. package/dist/chunk-5D6XPYQ3.mjs +0 -74
  75. package/dist/chunk-6QXCKZAT.mjs +0 -1
  76. package/dist/chunk-H4M6P3DM.mjs +0 -1
  77. package/dist/chunk-JXHNX2WN.mjs +0 -1
  78. package/dist/chunk-Q3MLYTIQ.mjs +0 -1
  79. package/dist/chunk-RSII2UPE.mjs +0 -1
  80. package/dist/chunk-ZRJ55GGF.mjs +0 -1
  81. package/dist/search-dialog-MA5AISC7.mjs +0 -1
@@ -1,27 +1,27 @@
1
- "use strict";var ke=Object.create;var et=Object.defineProperty;var Me=Object.getOwnPropertyDescriptor;var Te=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Oe=Object.prototype.hasOwnProperty;var ht=(o,t)=>()=>(o&&(t=o(o=0)),t);var Ht=(o,t)=>{for(var e in t)et(o,e,{get:t[e],enumerable:!0})},Lt=(o,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Te(t))!Oe.call(o,i)&&i!==e&&et(o,i,{get:()=>t[i],enumerable:!(s=Me(t,i))||s.enumerable});return o};var v=(o,t,e)=>(e=o!=null?ke(_e(o)):{},Lt(t||!o||!o.__esModule?et(e,"default",{value:o,enumerable:!0}):e,o)),Fe=o=>Lt(et({},"__esModule",{value:!0}),o);var Ie,P,m=ht(()=>{"use strict";Ie=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"?document.currentScript.src:new URL("main.js",document.baseURI).href,P=Ie()});function k(o){return o.replace(/\\/g,"/")}function V(o){return o.replace(/^\d+\./,"")}function ot(o){let t=o.match(/^(\d+)\./);return t?parseInt(t[1],10):void 0}function zt(o){return/\.mdx?$/.test(o)}function it(o){try{return yt.default.statSync(o).mtimeMs}catch{return 0}}function At(o){let t=yt.default.readFileSync(o,"utf-8");try{let{data:e,content:s}=(0,Et.default)(t);return{data:e,content:s}}catch{return{data:{},content:t}}}function H(o){return o.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function bt(o){return H(o)}function Nt(o){let e=o.split("/").map(V).join("/").replace(/\/$/,"");return e=e.replace(/\.mdx?$/,""),(e==="index"||e.endsWith("/index"))&&(e=e.replace(/index$/,"")),e.startsWith("/")||(e="/"+e),e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}function W(o){return xt.default.sanitize(o)}function vt(o){return xt.default.sanitize(o,{ALLOWED_TAGS:[],KEEP_CONTENT:!0})}function q(o){return o.charAt(0).toUpperCase()+o.slice(1)}function Pt(o,t){return o?typeof o=="string"?o:t&&o[t]?o[t]:Object.values(o)[0]||"":""}var yt,Et,xt,T=ht(()=>{"use strict";m();yt=v(require("fs")),Et=v(require("gray-matter")),xt=v(require("isomorphic-dompurify"))});var Dt={};Ht(Dt,{AssetCache:()=>$t,FileCache:()=>J,TransformCache:()=>K,flushCache:()=>Ae});async function Ae(){await F.flush()}var C,B,E,L,z,nt,je,rt,St,to,Bt,He,Le,Ee,ze,wt,Ct,F,J,K,$t,X=ht(()=>{"use strict";m();C=v(require("fs")),B=v(require("path")),E=v(require("crypto")),L=v(require("zlib")),z=require("util");T();nt=(0,z.promisify)(C.default.writeFile),je=(0,z.promisify)(C.default.readFile),rt=(0,z.promisify)(C.default.mkdir),St=(0,z.promisify)(C.default.rename),to=(0,z.promisify)(C.default.unlink),Bt=process.env.BOLTDOCS_CACHE_DIR||".boltdocs",He="assets",Le="shards",Ee=parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||"2000",10),ze=process.env.BOLTDOCS_CACHE_COMPRESS!=="0",wt=class{constructor(t){this.limit=t}cache=new Map;get(t){let e=this.cache.get(t);return e!==void 0&&(this.cache.delete(t),this.cache.set(t,e)),e}set(t,e){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.limit){let s=this.cache.keys().next().value;s!==void 0&&this.cache.delete(s)}this.cache.set(t,e)}get size(){return this.cache.size}clear(){this.cache.clear()}},Ct=class{queue=Promise.resolve();pendingCount=0;add(t){this.pendingCount++,this.queue=this.queue.then(t).finally(()=>{this.pendingCount--})}async flush(){await this.queue}get pending(){return this.pendingCount}},F=new Ct,J=class{entries=new Map;cachePath=null;compress;constructor(t={}){if(this.compress=t.compress!==void 0?t.compress:ze,t.name){let e=t.root||process.cwd(),s=this.compress?"json.gz":"json";this.cachePath=B.default.resolve(e,Bt,`${t.name}.${s}`)}}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&!(!this.cachePath||!C.default.existsSync(this.cachePath)))try{let t=C.default.readFileSync(this.cachePath);this.cachePath.endsWith(".gz")&&(t=L.default.gunzipSync(t));let e=JSON.parse(t.toString("utf-8"));this.entries=new Map(Object.entries(e))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1"||!this.cachePath)return;let t=Object.fromEntries(this.entries),e=JSON.stringify(t),s=this.cachePath,i=this.compress;F.add(async()=>{try{await rt(B.default.dirname(s),{recursive:!0});let r=Buffer.from(e);i&&(r=L.default.gzipSync(r));let c=`${s}.${E.default.randomBytes(4).toString("hex")}.tmp`;await nt(c,r),await St(c,s)}catch{}})}get(t){let e=this.entries.get(t);return!e||it(t)!==e.mtime?null:e.data}set(t,e){this.entries.set(t,{data:e,mtime:it(t)})}isValid(t){let e=this.entries.get(t);return e?it(t)===e.mtime:!1}invalidate(t){this.entries.delete(t)}invalidateAll(){this.entries.clear()}pruneStale(t){for(let e of this.entries.keys())t.has(e)||this.entries.delete(e)}get size(){return this.entries.size}async flush(){await F.flush()}},K=class{index=new Map;memoryCache=new wt(Ee);baseDir;shardsDir;indexPath;constructor(t,e=process.cwd()){this.baseDir=B.default.resolve(e,Bt,`transform-${t}`),this.shardsDir=B.default.resolve(this.baseDir,Le),this.indexPath=B.default.resolve(this.baseDir,"index.json")}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&C.default.existsSync(this.indexPath))try{let t=C.default.readFileSync(this.indexPath,"utf-8");this.index=new Map(Object.entries(JSON.parse(t)))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1")return;let t=JSON.stringify(Object.fromEntries(this.index)),e=this.indexPath;F.add(async()=>{await rt(B.default.dirname(e),{recursive:!0}),await nt(e,t)})}async getMany(t){let e=new Map,s=[];for(let i of t){let r=this.memoryCache.get(i);r?e.set(i,r):this.index.has(i)&&s.push(i)}if(s.length>0){let i=await Promise.all(s.map(async r=>{let c=this.index.get(r),p=B.default.resolve(this.shardsDir,`${c}.gz`);try{let n=await je(p),l=L.default.gunzipSync(n).toString("utf-8");return this.memoryCache.set(r,l),{key:r,val:l}}catch{return null}}));for(let r of i)r&&e.set(r.key,r.val)}return e}get(t){let e=this.memoryCache.get(t);if(e)return e;let s=this.index.get(t);if(!s)return null;let i=B.default.resolve(this.shardsDir,`${s}.gz`);if(!C.default.existsSync(i))return null;try{let r=C.default.readFileSync(i),c=L.default.gunzipSync(r).toString("utf-8");return this.memoryCache.set(t,c),c}catch{return null}}set(t,e){let s=E.default.createHash("md5").update(e).digest("hex");this.index.set(t,s),this.memoryCache.set(t,e);let i=B.default.resolve(this.shardsDir,`${s}.gz`);F.add(async()=>{if(C.default.existsSync(i))return;await rt(this.shardsDir,{recursive:!0});let r=L.default.gzipSync(Buffer.from(e)),c=`${i}.${E.default.randomBytes(4).toString("hex")}.tmp`;await nt(c,r),await St(c,i)})}get size(){return this.index.size}async flush(){await F.flush()}},$t=class{assetsDir;constructor(t=process.cwd()){this.assetsDir=B.default.resolve(t,Bt,He)}getFileHash(t){return E.default.createHash("md5").update(C.default.readFileSync(t)).digest("hex")}get(t,e){if(!C.default.existsSync(t))return null;let s=this.getFileHash(t),i=this.getCachedPath(t,`${e}-${s}`);return C.default.existsSync(i)?i:null}set(t,e,s){let i=this.getFileHash(t),r=this.getCachedPath(t,`${e}-${i}`);F.add(async()=>{await rt(this.assetsDir,{recursive:!0});let c=`${r}.${E.default.randomBytes(4).toString("hex")}.tmp`;await nt(c,s),await St(c,r)})}getCachedPath(t,e){let s=B.default.extname(t),i=B.default.basename(t,s),r=e.replace(/[^a-z0-9]/gi,"-").toLowerCase();return B.default.join(this.assetsDir,`${i}.${r}${s}`)}clear(){C.default.existsSync(this.assetsDir)&&C.default.rmSync(this.assetsDir,{recursive:!0,force:!0})}async flush(){await F.flush()}}});var Je={};Ht(Je,{createViteConfig:()=>qe,default:()=>Ft,defineConfig:()=>Xt,generateStaticPages:()=>lt,resolveConfig:()=>I});module.exports=Fe(Je);m();var we=v(require("@vitejs/plugin-react")),Ce=v(require("@tailwindcss/vite"));m();var se=require("vite");m();var qt=v(require("fast-glob"));T();m();X();var _=new J({name:"routes"});function Rt(){_.invalidateAll()}function kt(o){_.invalidate(o)}m();var A=v(require("path")),Ut=v(require("github-slugger"));T();function Gt(o,t,e,s){let i=decodeURIComponent(o),r=A.default.resolve(i),c=A.default.resolve(t),p=k(A.default.relative(c,r));if(p.startsWith("../")||p===".."||r.includes("\0"))throw new Error(`Security breach: File is outside of docs directory or contains null bytes: ${o}`);let{data:n,content:l}=At(o),d=p.split("/"),u,h;if(s?.versions&&d.length>0){let R=d[0],gt=s.versions.prefix||"",tt=s.versions.versions.find(G=>{let ft=gt+G.path;return R===ft||R===G.path});tt&&(h=tt.path,d=d.slice(1))}if(s?.i18n&&d.length>0){let R=d[0];s.i18n.locales[R]&&(u=R,d=d.slice(1))}let y;if(d.length>0){let R=d[0].match(/^\((.+)\)$/);R&&(y=R[1].toLowerCase(),d=d.slice(1))}let S=d.join("/"),a;n.permalink?a=n.permalink.startsWith("/")?n.permalink:`/${n.permalink}`:a=Nt(S||"index.md");let g=e;h&&(g+="/"+h),u&&(g+="/"+u),g+=a==="/"?"":a,(!g||g==="")&&(g="/");let b=d[d.length-1],f=V(b),D=V(A.default.basename(o,A.default.extname(o))),x=n.sidebarPosition??ot(b),$=d.length>=2?d[0]:void 0,w=$?V($):void 0,U=d.length>=2&&/^index\.mdx?$/.test(f),$e=new Ut.default,It=[],Se=/^(#{2,4})\s+(.+)$/gm;for(let R of l.matchAll(Se)){let gt=R[1].length,tt=R[2].replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").trim(),G=W(tt).trim(),ft=$e.slug(G);It.push({level:gt,text:G,id:ft})}let Be=n.title?W(String(n.title)):D,ut=n.description?W(String(n.description)):"";!ut&&l&&(ut=vt(l.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").replace(/\s+/g," ")).trim().slice(0,160));let De=n.badge?W(String(n.badge)):void 0,jt=n.icon?String(n.icon):void 0,Re=Ne(l);return{route:{path:g,componentPath:o,filePath:p,title:Be,description:ut,sidebarPosition:x,headings:It,locale:u,version:h,badge:De,icon:jt,tab:y,_content:Re,_rawContent:l},relativeDir:w,isGroupIndex:U,inferredTab:y,groupMeta:U?{title:n.groupTitle||n.title||(w?q(w):""),position:n.groupPosition??n.sidebarPosition??($?ot($):void 0),icon:jt}:void 0,inferredGroupPosition:$?ot($):void 0}}function Ne(o){let t=o.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/\{[^\}]+\}/g,"").replace(/[_*`]/g,"").replace(/\s+/g," ");return vt(t).trim()}m();function Wt(o){return o.sort((t,e)=>!t.group&&!e.group?Vt(t,e):t.group?e.group?t.group!==e.group?Ue(t,e):Vt(t,e):1:-1)}function Vt(o,t){return o.sidebarPosition!==void 0&&t.sidebarPosition!==void 0?o.sidebarPosition-t.sidebarPosition:o.sidebarPosition!==void 0?-1:t.sidebarPosition!==void 0?1:o.title.localeCompare(t.title)}function Ue(o,t){return o.groupPosition!==void 0&&t.groupPosition!==void 0?o.groupPosition-t.groupPosition:o.groupPosition!==void 0?-1:t.groupPosition!==void 0?1:(o.groupTitle||o.group).localeCompare(t.groupTitle||t.group)}var Mt=null,Z=new Map;async function Q(o,t,e="/docs",s=!0){let i=performance.now();_.load(),Z.clear(),(process.env.BOLTDOCS_FORCE_REPARSE==="true"||t?.i18n)&&_.invalidateAll();let r;!s&&Mt?r=Mt:(r=await(0,qt.default)(["**/*.md","**/*.mdx"],{cwd:o,absolute:!0,suppressErrors:!0,followSymbolicLinks:!1}),Mt=r),_.pruneStale(new Set(r));let c=50,p=[],n=0;for(let a=0;a<r.length;a+=c){let g=r.slice(a,a+c),b=await Promise.all(g.map(async f=>{let D=_.get(f);if(D)return n++,D;let x=Gt(f,o,e,t);return _.set(f,x),x}));p.push(...b),a+c<r.length&&await new Promise(f=>setImmediate(f))}_.save();let l=new Map,d=[];for(let a of p)if(a.isGroupIndex&&a.relativeDir&&d.push(a),a.relativeDir){let g=l.get(a.relativeDir);g?(g.position===void 0&&a.inferredGroupPosition!==void 0&&(g.position=a.inferredGroupPosition),!g.icon&&a.route.icon&&(g.icon=a.route.icon)):(g={title:q(a.relativeDir),position:a.inferredGroupPosition,icon:a.route.icon},l.set(a.relativeDir,g))}for(let a of d){let g=l.get(a.relativeDir);a.groupMeta&&(g.title=a.groupMeta.title,a.groupMeta.position!==void 0&&(g.position=a.groupMeta.position),a.groupMeta.icon&&(g.icon=a.groupMeta.icon))}let u=new Array(p.length);for(let a=0;a<p.length;a++){let g=p[a],b=g.relativeDir,f=b?l.get(b):void 0;u[a]={...g.route,group:b,groupTitle:f?.title||(b?q(b):void 0),groupPosition:f?.position,groupIcon:f?.icon}}let h=u;if(t?.i18n){let a=Ge(u,t,e);h=[...u,...a]}let y=Wt(h),S=performance.now()-i;return console.log(`[boltdocs] Route generation: ${S.toFixed(2)}ms (${r.length} files, ${n} cache hits)`),y}function Ge(o,t,e){let s=t.i18n.defaultLocale,i=Object.keys(t.i18n.locales),r=[],c=new Map,p=[];for(let n of o){let l=n.locale||s;c.has(l)||c.set(l,new Set),c.get(l).add(n.path),l===s&&p.push(n)}for(let n of i){let l=c.get(n)||new Set;for(let d of p){let u=Ve(d.path,s,n,e,t);u!==d.path&&(l.has(u)||r.push({...d,path:u,locale:n}))}}return r}function Ve(o,t,e,s,i){let r=`${o}:${e}`,c=Z.get(r);if(c)return c;let p=s;if(i?.versions){let u=i.versions.prefix||"";for(let h of i.versions.versions){let y=u+h.path;if(o.startsWith(`${s}/${y}`)){p+="/"+y;break}if(o.startsWith(`${s}/${h.path}`)){p+="/"+h.path;break}}}let n=o.substring(p.length),l=`/${t}`;if(n.startsWith(l+"/"))n="/"+e+"/"+n.substring(l.length+1);else if(n===l)n="/"+e;else if(n==="/"||n==="")n="/"+e;else{let u=n.startsWith("/")?"":"/";n="/"+e+u+n}let d=p+n;return Z.size>2e3&&Z.clear(),Z.set(r,d),d}var ae=require("vite-plugin-image-optimizer");m();var st=v(require("path")),Jt=v(require("fs")),Kt=require("vite");function Xt(o){return o}var at=["boltdocs.config.js","boltdocs.config.mjs","boltdocs.config.ts"];async function I(o,t=process.cwd()){let e=t,s={docsDir:st.default.resolve(o),theme:{title:"Boltdocs",description:"A Vite documentation framework",navbar:[{label:"Home",href:"/"},{label:"Documentation",href:"/docs"}],codeTheme:{light:"github-light",dark:"github-dark"},poweredBy:!0,breadcrumbs:!0}},i={};for(let n of at){let l=st.default.resolve(e,n);if(Jt.default.existsSync(l))try{let d=await(0,Kt.loadConfigFromFile)({command:"serve",mode:"development"},l,e);if(d){i=d.config;break}}catch(d){console.warn(`[boltdocs] Failed to load config from ${n}:`,d)}}let c={...{title:i.title,description:i.description,logo:i.logo,favicon:i.favicon,ogImage:i.ogImage,navbar:i.navbar,sidebar:i.sidebar,socialLinks:i.socialLinks,footer:i.footer,githubRepo:i.githubRepo,tabs:i.tabs,codeTheme:i.codeTheme,copyMarkdown:i.copyMarkdown,breadcrumbs:i.breadcrumbs,poweredBy:i.poweredBy,communityHelp:i.communityHelp,version:i.version,editLink:i.editLink},...i.theme||{}},p=Object.fromEntries(Object.entries(c).filter(([n,l])=>l!==void 0));return p.navbar&&(p.navbar=p.navbar.map(n=>({label:n.label||n.text||"",href:n.href||n.link||n.to||"",items:n.items?.map(l=>({label:l.label||l.text||"",href:l.href||l.link||l.to||""}))}))),{docsDir:st.default.resolve(o),homePage:i.homePage,theme:{...s.theme,...p},i18n:i.i18n,versions:i.versions,siteUrl:i.siteUrl,plugins:i.plugins||[],external:i.external,integrations:i.integrations,robots:i.robots,vite:i.vite}}m();var j=v(require("fs")),O=v(require("path"));T();var ee=require("url"),oe=require("module");m();T();function Zt(o,t){let e=H(t.title),s=H(t.description);return o.replace(/<title>.*?<\/title>/,`<title>${e}</title>`).replace(/(<meta name="description" content=")[^"]*(")/,`$1${s}$2`).replace(/(<meta property="og:title" content=")[^"]*(")/,`$1${e}$2`).replace(/(<meta property="og:description" content=")[^"]*(")/,`$1${s}$2`).replace(/(<meta name="twitter:title" content=")[^"]*(")/,`$1${e}$2`).replace(/(<meta name="twitter:description" content=")[^"]*(")/,`$1${s}$2`)}m();T();function Qt(o,t){let e=t?.siteUrl?.replace(/\/$/,"")||"https://example.com",s=new Date().toISOString().split("T")[0],i=[{url:"/",priority:"1.0",changefreq:"daily"}];if(t?.i18n){let c=t.i18n.defaultLocale;for(let p of Object.keys(t.i18n.locales))p!==c&&i.push({url:`/${p}/`,priority:"1.0",changefreq:"daily"})}return`<?xml version="1.0" encoding="UTF-8"?>
1
+ "use strict";var Me=Object.create;var et=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,Fe=Object.prototype.hasOwnProperty;var ht=(o,e)=>()=>(o&&(e=o(o=0)),e);var Ht=(o,e)=>{for(var t in e)et(o,t,{get:e[t],enumerable:!0})},Lt=(o,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _e(e))!Fe.call(o,i)&&i!==t&&et(o,i,{get:()=>e[i],enumerable:!(s=Te(e,i))||s.enumerable});return o};var v=(o,e,t)=>(t=o!=null?Me(Oe(o)):{},Lt(e||!o||!o.__esModule?et(t,"default",{value:o,enumerable:!0}):t,o)),Ie=o=>Lt(et({},"__esModule",{value:!0}),o);var je,P,m=ht(()=>{"use strict";je=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"?document.currentScript.src:new URL("main.js",document.baseURI).href,P=je()});function k(o){return o.replace(/\\/g,"/")}function W(o){return o.replace(/^\d+\./,"")}function ot(o){let e=o.match(/^(\d+)\./);return e?parseInt(e[1],10):void 0}function zt(o){return/\.mdx?$/.test(o)}function it(o){try{return yt.default.statSync(o).mtimeMs}catch{return 0}}function At(o){let e=yt.default.readFileSync(o,"utf-8");try{let{data:t,content:s}=(0,Et.default)(e);return{data:t,content:s}}catch{return{data:{},content:e}}}function H(o){return o.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function bt(o){return H(o)}function Nt(o){let t=o.split("/").map(W).join("/").replace(/\/$/,"");return t=t.replace(/\.mdx?$/,""),(t==="index"||t.endsWith("/index"))&&(t=t.replace(/index$/,"")),t.startsWith("/")||(t="/"+t),t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t}function q(o){return xt.default.sanitize(o)}function vt(o){return xt.default.sanitize(o,{ALLOWED_TAGS:[],KEEP_CONTENT:!0})}function J(o){return o.charAt(0).toUpperCase()+o.slice(1)}function Pt(o,e){return o?typeof o=="string"?o:e&&o[e]?o[e]:Object.values(o)[0]||"":""}var yt,Et,xt,T=ht(()=>{"use strict";m();yt=v(require("fs")),Et=v(require("gray-matter")),xt=v(require("isomorphic-dompurify"))});var Bt={};Ht(Bt,{AssetCache:()=>$t,FileCache:()=>K,TransformCache:()=>X,flushCache:()=>Ne});async function Ne(){await F.flush()}var C,D,E,L,z,nt,He,rt,St,eo,Dt,Le,Ee,ze,Ae,wt,Ct,F,K,X,$t,Z=ht(()=>{"use strict";m();C=v(require("fs")),D=v(require("path")),E=v(require("crypto")),L=v(require("zlib")),z=require("util");T();nt=(0,z.promisify)(C.default.writeFile),He=(0,z.promisify)(C.default.readFile),rt=(0,z.promisify)(C.default.mkdir),St=(0,z.promisify)(C.default.rename),eo=(0,z.promisify)(C.default.unlink),Dt=process.env.BOLTDOCS_CACHE_DIR||".boltdocs",Le="assets",Ee="shards",ze=parseInt(process.env.BOLTDOCS_CACHE_LRU_LIMIT||"2000",10),Ae=process.env.BOLTDOCS_CACHE_COMPRESS!=="0",wt=class{constructor(e){this.limit=e}cache=new Map;get(e){let t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.limit){let s=this.cache.keys().next().value;s!==void 0&&this.cache.delete(s)}this.cache.set(e,t)}get size(){return this.cache.size}clear(){this.cache.clear()}},Ct=class{queue=Promise.resolve();pendingCount=0;add(e){this.pendingCount++,this.queue=this.queue.then(e).finally(()=>{this.pendingCount--})}async flush(){await this.queue}get pending(){return this.pendingCount}},F=new Ct,K=class{entries=new Map;cachePath=null;compress;constructor(e={}){if(this.compress=e.compress!==void 0?e.compress:Ae,e.name){let t=e.root||process.cwd(),s=this.compress?"json.gz":"json";this.cachePath=D.default.resolve(t,Dt,`${e.name}.${s}`)}}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&!(!this.cachePath||!C.default.existsSync(this.cachePath)))try{let e=C.default.readFileSync(this.cachePath);this.cachePath.endsWith(".gz")&&(e=L.default.gunzipSync(e));let t=JSON.parse(e.toString("utf-8"));this.entries=new Map(Object.entries(t))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1"||!this.cachePath)return;let e=Object.fromEntries(this.entries),t=JSON.stringify(e),s=this.cachePath,i=this.compress;F.add(async()=>{try{await rt(D.default.dirname(s),{recursive:!0});let r=Buffer.from(t);i&&(r=L.default.gzipSync(r));let c=`${s}.${E.default.randomBytes(4).toString("hex")}.tmp`;await nt(c,r),await St(c,s)}catch{}})}get(e){let t=this.entries.get(e);return!t||it(e)!==t.mtime?null:t.data}set(e,t){this.entries.set(e,{data:t,mtime:it(e)})}isValid(e){let t=this.entries.get(e);return t?it(e)===t.mtime:!1}invalidate(e){this.entries.delete(e)}invalidateAll(){this.entries.clear()}pruneStale(e){for(let t of this.entries.keys())e.has(t)||this.entries.delete(t)}get size(){return this.entries.size}async flush(){await F.flush()}},X=class{index=new Map;memoryCache=new wt(ze);baseDir;shardsDir;indexPath;constructor(e,t=process.cwd()){this.baseDir=D.default.resolve(t,Dt,`transform-${e}`),this.shardsDir=D.default.resolve(this.baseDir,Ee),this.indexPath=D.default.resolve(this.baseDir,"index.json")}load(){if(process.env.BOLTDOCS_NO_CACHE!=="1"&&C.default.existsSync(this.indexPath))try{let e=C.default.readFileSync(this.indexPath,"utf-8");this.index=new Map(Object.entries(JSON.parse(e)))}catch{}}save(){if(process.env.BOLTDOCS_NO_CACHE==="1")return;let e=JSON.stringify(Object.fromEntries(this.index)),t=this.indexPath;F.add(async()=>{await rt(D.default.dirname(t),{recursive:!0}),await nt(t,e)})}async getMany(e){let t=new Map,s=[];for(let i of e){let r=this.memoryCache.get(i);r?t.set(i,r):this.index.has(i)&&s.push(i)}if(s.length>0){let i=await Promise.all(s.map(async r=>{let c=this.index.get(r),p=D.default.resolve(this.shardsDir,`${c}.gz`);try{let n=await He(p),l=L.default.gunzipSync(n).toString("utf-8");return this.memoryCache.set(r,l),{key:r,val:l}}catch{return null}}));for(let r of i)r&&t.set(r.key,r.val)}return t}get(e){let t=this.memoryCache.get(e);if(t)return t;let s=this.index.get(e);if(!s)return null;let i=D.default.resolve(this.shardsDir,`${s}.gz`);if(!C.default.existsSync(i))return null;try{let r=C.default.readFileSync(i),c=L.default.gunzipSync(r).toString("utf-8");return this.memoryCache.set(e,c),c}catch{return null}}set(e,t){let s=E.default.createHash("md5").update(t).digest("hex");this.index.set(e,s),this.memoryCache.set(e,t);let i=D.default.resolve(this.shardsDir,`${s}.gz`);F.add(async()=>{if(C.default.existsSync(i))return;await rt(this.shardsDir,{recursive:!0});let r=L.default.gzipSync(Buffer.from(t)),c=`${i}.${E.default.randomBytes(4).toString("hex")}.tmp`;await nt(c,r),await St(c,i)})}get size(){return this.index.size}async flush(){await F.flush()}},$t=class{assetsDir;constructor(e=process.cwd()){this.assetsDir=D.default.resolve(e,Dt,Le)}getFileHash(e){return E.default.createHash("md5").update(C.default.readFileSync(e)).digest("hex")}get(e,t){if(!C.default.existsSync(e))return null;let s=this.getFileHash(e),i=this.getCachedPath(e,`${t}-${s}`);return C.default.existsSync(i)?i:null}set(e,t,s){let i=this.getFileHash(e),r=this.getCachedPath(e,`${t}-${i}`);F.add(async()=>{await rt(this.assetsDir,{recursive:!0});let c=`${r}.${E.default.randomBytes(4).toString("hex")}.tmp`;await nt(c,s),await St(c,r)})}getCachedPath(e,t){let s=D.default.extname(e),i=D.default.basename(e,s),r=t.replace(/[^a-z0-9]/gi,"-").toLowerCase();return D.default.join(this.assetsDir,`${i}.${r}${s}`)}clear(){C.default.existsSync(this.assetsDir)&&C.default.rmSync(this.assetsDir,{recursive:!0,force:!0})}async flush(){await F.flush()}}});var Ke={};Ht(Ke,{createViteConfig:()=>Je,default:()=>Ft,defineConfig:()=>Xt,generateStaticPages:()=>lt,resolveConfig:()=>I});module.exports=Ie(Ke);m();var Ce=v(require("@vitejs/plugin-react")),$e=v(require("@tailwindcss/vite"));m();var ae=require("vite");m();var qt=v(require("fast-glob"));T();m();Z();var _=new K({name:"routes"});function Rt(){_.invalidateAll()}function kt(o){_.invalidate(o)}m();var A=v(require("path")),Ut=v(require("github-slugger"));T();function Gt(o,e,t,s){let i=decodeURIComponent(o),r=A.default.resolve(i),c=A.default.resolve(e),p=k(A.default.relative(c,r));if(p.startsWith("../")||p===".."||r.includes("\0"))throw new Error(`Security breach: File is outside of docs directory or contains null bytes: ${o}`);let{data:n,content:l}=At(o),d=p.split("/"),u,h;if(s?.versions&&d.length>0){let R=d[0],gt=s.versions.prefix||"",tt=s.versions.versions.find(V=>{let ft=gt+V.path;return R===ft||R===V.path});tt&&(h=tt.path,d=d.slice(1))}if(s?.i18n&&d.length>0){let R=d[0];s.i18n.locales[R]&&(u=R,d=d.slice(1))}let y;if(d.length>0){let R=d[0].match(/^\((.+)\)$/);R&&(y=R[1].toLowerCase(),d=d.slice(1))}let S=d.join("/"),a;n.permalink?a=n.permalink.startsWith("/")?n.permalink:`/${n.permalink}`:a=Nt(S||"index.md");let g=t;h&&(g+="/"+h),u&&(g+="/"+u),g+=a==="/"?"":a,(!g||g==="")&&(g="/");let b=d[d.length-1],f=W(b),B=W(A.default.basename(o,A.default.extname(o))),x=n.sidebarPosition??ot(b),$=d.length>=2?d[0]:void 0,w=$?W($):void 0,G=d.length>=2&&/^index\.mdx?$/.test(f),Se=new Ut.default,It=[],De=/^(#{2,4})\s+(.+)$/gm;for(let R of l.matchAll(De)){let gt=R[1].length,tt=R[2].replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").trim(),V=q(tt).trim(),ft=Se.slug(V);It.push({level:gt,text:V,id:ft})}let Be=n.title?q(String(n.title)):B,ut=n.description?q(String(n.description)):"";!ut&&l&&(ut=vt(l.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/[_*`]/g,"").replace(/\s+/g," ")).trim().slice(0,160));let Re=n.badge?q(String(n.badge)):void 0,jt=n.icon?String(n.icon):void 0,ke=Ue(l);return{route:{path:g,componentPath:o,filePath:p,title:Be,description:ut,sidebarPosition:x,headings:It,locale:u,version:h,badge:Re,icon:jt,tab:y,_content:ke,_rawContent:l},relativeDir:w,isGroupIndex:G,inferredTab:y,groupMeta:G?{title:n.groupTitle||n.title||(w?J(w):""),position:n.groupPosition??n.sidebarPosition??($?ot($):void 0),icon:jt}:void 0,inferredGroupPosition:$?ot($):void 0}}function Ue(o){let e=o.replace(/^#+.*$/gm,"").replace(/\[([^\]]+)\]\([^\)]+\)/g,"$1").replace(/\{[^\}]+\}/g,"").replace(/[_*`]/g,"").replace(/\s+/g," ");return vt(e).trim()}m();function Wt(o){return o.sort((e,t)=>!e.group&&!t.group?Vt(e,t):e.group?t.group?e.group!==t.group?Ge(e,t):Vt(e,t):1:-1)}function Vt(o,e){return o.sidebarPosition!==void 0&&e.sidebarPosition!==void 0?o.sidebarPosition-e.sidebarPosition:o.sidebarPosition!==void 0?-1:e.sidebarPosition!==void 0?1:o.title.localeCompare(e.title)}function Ge(o,e){return o.groupPosition!==void 0&&e.groupPosition!==void 0?o.groupPosition-e.groupPosition:o.groupPosition!==void 0?-1:e.groupPosition!==void 0?1:(o.groupTitle||o.group).localeCompare(e.groupTitle||e.group)}var Mt=null,Q=new Map;async function N(o,e,t="/docs",s=!0){let i=performance.now();_.load(),Q.clear(),(process.env.BOLTDOCS_FORCE_REPARSE==="true"||e?.i18n)&&_.invalidateAll();let r;!s&&Mt?r=Mt:(r=await(0,qt.default)(["**/*.md","**/*.mdx"],{cwd:o,absolute:!0,suppressErrors:!0,followSymbolicLinks:!1}),Mt=r),_.pruneStale(new Set(r));let c=50,p=[],n=0;for(let a=0;a<r.length;a+=c){let g=r.slice(a,a+c),b=await Promise.all(g.map(async f=>{let B=_.get(f);if(B)return n++,B;let x=Gt(f,o,t,e);return _.set(f,x),x}));p.push(...b),a+c<r.length&&await new Promise(f=>setImmediate(f))}_.save();let l=new Map,d=[];for(let a of p)if(a.isGroupIndex&&a.relativeDir&&d.push(a),a.relativeDir){let g=l.get(a.relativeDir);g?(g.position===void 0&&a.inferredGroupPosition!==void 0&&(g.position=a.inferredGroupPosition),!g.icon&&a.route.icon&&(g.icon=a.route.icon)):(g={title:J(a.relativeDir),position:a.inferredGroupPosition,icon:a.route.icon},l.set(a.relativeDir,g))}for(let a of d){let g=l.get(a.relativeDir);a.groupMeta&&(g.title=a.groupMeta.title,a.groupMeta.position!==void 0&&(g.position=a.groupMeta.position),a.groupMeta.icon&&(g.icon=a.groupMeta.icon))}let u=new Array(p.length);for(let a=0;a<p.length;a++){let g=p[a],b=g.relativeDir,f=b?l.get(b):void 0;u[a]={...g.route,group:b,groupTitle:f?.title||(b?J(b):void 0),groupPosition:f?.position,groupIcon:f?.icon}}let h=u;if(e?.i18n){let a=Ve(u,e,t);h=[...u,...a]}let y=Wt(h),S=performance.now()-i;return console.log(`[boltdocs] Route generation: ${S.toFixed(2)}ms (${r.length} files, ${n} cache hits)`),y}function Ve(o,e,t){let s=e.i18n.defaultLocale,i=Object.keys(e.i18n.locales),r=[],c=new Map,p=[];for(let n of o){let l=n.locale||s;c.has(l)||c.set(l,new Set),c.get(l).add(n.path),l===s&&p.push(n)}for(let n of i){let l=c.get(n)||new Set;for(let d of p){let u=We(d.path,s,n,t,e);u!==d.path&&(l.has(u)||r.push({...d,path:u,locale:n}))}}return r}function We(o,e,t,s,i){let r=`${o}:${t}`,c=Q.get(r);if(c)return c;let p=s;if(i?.versions){let u=i.versions.prefix||"";for(let h of i.versions.versions){let y=u+h.path;if(o.startsWith(`${s}/${y}`)){p+="/"+y;break}if(o.startsWith(`${s}/${h.path}`)){p+="/"+h.path;break}}}let n=o.substring(p.length),l=`/${e}`;if(n.startsWith(l+"/"))n="/"+t+"/"+n.substring(l.length+1);else if(n===l)n="/"+t;else if(n==="/"||n==="")n="/"+t;else{let u=n.startsWith("/")?"":"/";n="/"+t+u+n}let d=p+n;return Q.size>2e3&&Q.clear(),Q.set(r,d),d}var ce=require("vite-plugin-image-optimizer");m();var st=v(require("path")),Jt=v(require("fs")),Kt=require("vite");function Xt(o){return o}var at=["boltdocs.config.js","boltdocs.config.mjs","boltdocs.config.ts"];async function I(o,e=process.cwd()){let t=e,s={docsDir:st.default.resolve(o),theme:{title:"Boltdocs",description:"A Vite documentation framework",navbar:[{label:"Home",href:"/"},{label:"Documentation",href:"/docs"}],codeTheme:{light:"github-light",dark:"github-dark"},poweredBy:!0,breadcrumbs:!0}},i={};for(let n of at){let l=st.default.resolve(t,n);if(Jt.default.existsSync(l))try{let d=await(0,Kt.loadConfigFromFile)({command:"serve",mode:"development"},l,t);if(d){i=d.config;break}}catch(d){console.warn(`[boltdocs] Failed to load config from ${n}:`,d)}}let c={...{title:i.title,description:i.description,logo:i.logo,favicon:i.favicon,ogImage:i.ogImage,navbar:i.navbar,sidebar:i.sidebar,socialLinks:i.socialLinks,footer:i.footer,githubRepo:i.githubRepo,tabs:i.tabs,codeTheme:i.codeTheme,copyMarkdown:i.copyMarkdown,breadcrumbs:i.breadcrumbs,poweredBy:i.poweredBy,communityHelp:i.communityHelp,version:i.version,editLink:i.editLink},...i.theme||{}},p=Object.fromEntries(Object.entries(c).filter(([n,l])=>l!==void 0));return p.navbar&&(p.navbar=p.navbar.map(n=>({label:n.label||n.text||"",href:n.href||n.link||n.to||"",items:n.items?.map(l=>({label:l.label||l.text||"",href:l.href||l.link||l.to||""}))}))),{docsDir:st.default.resolve(o),homePage:i.homePage,theme:{...s.theme,...p},i18n:i.i18n,versions:i.versions,siteUrl:i.siteUrl,plugins:i.plugins||[],external:i.external,integrations:i.integrations,robots:i.robots,vite:i.vite}}m();var j=v(require("fs")),O=v(require("path"));T();var ee=require("url"),oe=require("module");m();T();function Zt(o,e){let t=H(e.title),s=H(e.description);return o.replace(/<title>.*?<\/title>/,`<title>${t}</title>`).replace(/(<meta name="description" content=")[^"]*(")/,`$1${s}$2`).replace(/(<meta property="og:title" content=")[^"]*(")/,`$1${t}$2`).replace(/(<meta property="og:description" content=")[^"]*(")/,`$1${s}$2`).replace(/(<meta name="twitter:title" content=")[^"]*(")/,`$1${t}$2`).replace(/(<meta name="twitter:description" content=")[^"]*(")/,`$1${s}$2`)}m();T();function Qt(o,e){let t=e?.siteUrl?.replace(/\/$/,"")||"https://example.com",s=new Date().toISOString().split("T")[0],i=[{url:"/",priority:"1.0",changefreq:"daily"}];if(e?.i18n){let c=e.i18n.defaultLocale;for(let p of Object.keys(e.i18n.locales))p!==c&&i.push({url:`/${p}/`,priority:"1.0",changefreq:"daily"})}return`<?xml version="1.0" encoding="UTF-8"?>
2
2
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3
3
  ${[...i,...o.map(c=>({url:c,priority:"0.8",changefreq:"weekly"}))].map(c=>` <url>
4
- <loc>${bt(e)}${bt(c.url)}</loc>
4
+ <loc>${bt(t)}${bt(c.url)}</loc>
5
5
  <lastmod>${s}</lastmod>
6
6
  <changefreq>${c.changefreq}</changefreq>
7
7
  <priority>${c.priority}</priority>
8
8
  </url>`).join(`
9
9
  `)}
10
- </urlset>`}m();function ct(o){if(typeof o.robots=="string")return o.robots;let t=o.siteUrl?.replace(/\/$/,"")||"",e=o.robots||{},s=e.rules||[{userAgent:"*",allow:"/"}],i=e.sitemaps||(t?[`${t}/sitemap.xml`]:[]),r="";for(let c of s){if(r+=`User-agent: ${c.userAgent}
10
+ </urlset>`}m();function ct(o){if(typeof o.robots=="string")return o.robots;let e=o.siteUrl?.replace(/\/$/,"")||"",t=o.robots||{},s=t.rules||[{userAgent:"*",allow:"/"}],i=t.sitemaps||(e?[`${e}/sitemap.xml`]:[]),r="";for(let c of s){if(r+=`User-agent: ${c.userAgent}
11
11
  `,c.disallow){let p=Array.isArray(c.disallow)?c.disallow:[c.disallow];for(let n of p)r+=`Disallow: ${n}
12
12
  `}if(c.allow){let p=Array.isArray(c.allow)?c.allow:[c.allow];for(let n of p)r+=`Allow: ${n}
13
13
  `}r+=`
14
14
  `}for(let c of i)r+=`Sitemap: ${c}
15
- `;return r.trim()}var We=(0,ee.fileURLToPath)(P),Yt=O.default.dirname(We),te=(0,oe.createRequire)(P);async function lt(o){let{docsDir:t,docsDirName:e,outDir:s,config:i}=o,r=await Q(t,i),c=O.default.resolve(Yt,"../client/ssr.js");if(!j.default.existsSync(c)){console.error("[boltdocs] SSR module not found at",c,"- Did you build the core package?");return}let p=te("module"),n=p.prototype.require;p.prototype.require=function(a,...g){return a==="virtual:boltdocs-layout"?{__esModule:!0,default:function(f){try{let x=n.apply(this,[O.default.resolve(Yt,"../client/index.js")]).DefaultLayout||(({children:w})=>w);return n.apply(this,["react"]).createElement(x,f)}catch{return f.children}}}:n.apply(this,[a,...g])};let{render:l}=te(c);p.prototype.require=n;let d=O.default.join(s,"index.html");if(!j.default.existsSync(d)){console.warn("[boltdocs] No index.html found in outDir, skipping SSG.");return}let u=j.default.readFileSync(d,"utf-8");await Promise.all(r.map(async a=>{let g=Pt(i?.theme?.title,a.locale)||"Boltdocs",b=Pt(i?.theme?.description,a.locale)||"",f=`${a.title} | ${g}`,D=a.description||b,x={};x[`/${e}/${a.filePath}`]={default:()=>null};try{let $=await l({path:a.path,routes:r,config:i||{},docsDirName:e,modules:x,homePage:void 0}),w=Zt(u,{title:H(f),description:H(D)}).replace("<!--app-html-->",$).replace('<div id="root"></div>',`<div id="root">${$}</div>`),U=O.default.join(s,a.path);await j.default.promises.mkdir(U,{recursive:!0}),await j.default.promises.writeFile(O.default.join(U,"index.html"),w,"utf-8")}catch($){console.error(`[boltdocs] Error SSR rendering route ${a.path}:`,$&&($.stack||$))}}));let h=Qt(r.map(a=>a.path),i);j.default.writeFileSync(O.default.join(s,"sitemap.xml"),h,"utf-8");let y=ct(i);j.default.writeFileSync(O.default.join(s,"robots.txt"),y,"utf-8"),console.log(`[boltdocs] Generated ${r.length} static pages + sitemap.xml + robots.txt`);let{flushCache:S}=await Promise.resolve().then(()=>(X(),Dt));await S()}T();var M=v(require("path"));m();T();var Tt=v(require("path")),ie=v(require("fs"));function ne(o,t){let e=o.homePage?`import HomePage from '${k(o.homePage)}';`:"",s=Tt.default.resolve(process.cwd(),"index.css"),i=ie.default.existsSync(s)?"import './index.css';":"",r=o.homePage?"homePage: HomePage,":"",c=t?.plugins?.flatMap(y=>Object.entries(y.components||{}))||[],p=c.map(([y,S])=>`import * as _comp_${y} from '${k(S)}';
15
+ `;return r.trim()}var qe=(0,ee.fileURLToPath)(P),Yt=O.default.dirname(qe),te=(0,oe.createRequire)(P);async function lt(o){let{docsDir:e,docsDirName:t,outDir:s,config:i}=o,r=await N(e,i),c=O.default.resolve(Yt,"../client/ssr.js");if(!j.default.existsSync(c)){console.error("[boltdocs] SSR module not found at",c,"- Did you build the core package?");return}let p=te("module"),n=p.prototype.require;p.prototype.require=function(a,...g){return a==="virtual:boltdocs-layout"?{__esModule:!0,default:function(f){try{let x=n.apply(this,[O.default.resolve(Yt,"../client/index.js")]).DefaultLayout||(({children:w})=>w);return n.apply(this,["react"]).createElement(x,f)}catch{return f.children}}}:n.apply(this,[a,...g])};let{render:l}=te(c);p.prototype.require=n;let d=O.default.join(s,"index.html");if(!j.default.existsSync(d)){console.warn("[boltdocs] No index.html found in outDir, skipping SSG.");return}let u=j.default.readFileSync(d,"utf-8");await Promise.all(r.map(async a=>{let g=Pt(i?.theme?.title,a.locale)||"Boltdocs",b=Pt(i?.theme?.description,a.locale)||"",f=`${a.title} | ${g}`,B=a.description||b,x={};x[`/${t}/${a.filePath}`]={default:()=>null};try{let $=await l({path:a.path,routes:r,config:i||{},docsDirName:t,modules:x,homePage:void 0}),w=Zt(u,{title:H(f),description:H(B)}).replace("<!--app-html-->",$).replace('<div id="root"></div>',`<div id="root">${$}</div>`),G=O.default.join(s,a.path);await j.default.promises.mkdir(G,{recursive:!0}),await j.default.promises.writeFile(O.default.join(G,"index.html"),w,"utf-8")}catch($){console.error(`[boltdocs] Error SSR rendering route ${a.path}:`,$&&($.stack||$))}}));let h=Qt(r.map(a=>a.path),i);j.default.writeFileSync(O.default.join(s,"sitemap.xml"),h,"utf-8");let y=ct(i);j.default.writeFileSync(O.default.join(s,"robots.txt"),y,"utf-8"),console.log(`[boltdocs] Generated ${r.length} static pages + sitemap.xml + robots.txt`);let{flushCache:S}=await Promise.resolve().then(()=>(Z(),Bt));await S()}T();var M=v(require("path"));m();T();var Tt=v(require("path")),ie=v(require("fs"));function ne(o,e){let t=o.homePage?`import HomePage from '${k(o.homePage)}';`:"",s=Tt.default.resolve(process.cwd(),"index.css"),i=ie.default.existsSync(s)?"import './index.css';":"",r=o.homePage?"homePage: HomePage,":"",c=e?.plugins?.flatMap(y=>Object.entries(y.components||{}))||[],p=c.map(([y,S])=>`import * as _comp_${y} from '${k(S)}';
16
16
  const ${y} = _comp_${y}.default || _comp_${y}['${y}'] || _comp_${y};`).join(`
17
- `),n=c.map(([y])=>y).join(", "),l=Tt.default.basename(o.docsDir||"docs"),d=Object.entries(t?.external||{}),u=d.map(([y,S],a)=>`import _ext_${a} from '${k(S)}';`).join(`
17
+ `),n=c.map(([y])=>y).join(", "),l=Tt.default.basename(o.docsDir||"docs"),d=Object.entries(e?.external||{}),u=d.map(([y,S],a)=>`import _ext_${a} from '${k(S)}';`).join(`
18
18
  `),h=d.length>0?`externalPages: { ${d.map(([y],S)=>`"${y}": _ext_${S}`).join(", ")} },`:"";return`
19
19
  import { createBoltdocsApp as _createApp } from 'boltdocs/client';
20
20
  import _routes from 'virtual:boltdocs-routes';
21
21
  import _config from 'virtual:boltdocs-config';
22
22
  import _user_mdx_components from 'virtual:boltdocs-mdx-components';
23
23
  ${i}
24
- ${e}
24
+ ${t}
25
25
  ${p}
26
26
  ${u}
27
27
 
@@ -46,7 +46,7 @@ _createApp({
46
46
  <body>
47
47
  <div id="root"></div>
48
48
  </body>
49
- </html>`}function _t(o,t){let e=t.theme,s=e?.title||"Boltdocs",i=e?.description||"",r=e?.favicon;!r&&e?.logo&&(typeof e.logo=="string"?r=e.logo:r=e.logo.light||e.logo.dark);let c=[r?`<link rel="icon" href="${r}">`:"",`<meta name="description" content="${i}">`,`<meta property="og:title" content="${s}">`,`<meta property="og:description" content="${i}">`,e?.ogImage?`<meta property="og:image" content="${e.ogImage}">`:"",'<meta property="og:type" content="website">','<meta name="twitter:card" content="summary_large_image">',`<meta name="twitter:title" content="${s}">`,`<meta name="twitter:description" content="${i}">`,e?.ogImage?`<meta name="twitter:image" content="${e.ogImage}">`:"",'<meta name="generator" content="Boltdocs">'].filter(Boolean).join(`
49
+ </html>`}function _t(o,e){let t=e.theme,s=t?.title||"Boltdocs",i=t?.description||"",r=t?.favicon;!r&&t?.logo&&(typeof t.logo=="string"?r=t.logo:r=t.logo.light||t.logo.dark);let c=[r?`<link rel="icon" href="${r}">`:"",`<meta name="description" content="${i}">`,`<meta property="og:title" content="${s}">`,`<meta property="og:description" content="${i}">`,t?.ogImage?`<meta property="og:image" content="${t.ogImage}">`:"",'<meta property="og:type" content="website">','<meta name="twitter:card" content="summary_large_image">',`<meta name="twitter:title" content="${s}">`,`<meta name="twitter:description" content="${i}">`,t?.ogImage?`<meta name="twitter:image" content="${t.ogImage}">`:"",'<meta name="generator" content="Boltdocs">'].filter(Boolean).join(`
50
50
  `),p=`
51
51
  <script>
52
52
  (function() {
@@ -66,9 +66,9 @@ _createApp({
66
66
  `;return o.includes("<title>")?o=o.replace(/<title>.*?<\/title>/,`<title>${s}</title>`):o=o.replace("</head>",` <title>${s}</title>
67
67
  </head>`),o=o.replace("</head>",` ${c}
68
68
  ${p} </head>`),!o.includes("src/main")&&!o.includes("virtual:boltdocs-entry")&&(o=o.replace("</body>",` <script type="module">import "virtual:boltdocs-entry";</script>
69
- </body>`)),o}var Ot=v(require("fs"));m();function ce(o={},t){let e=M.default.resolve(process.cwd(),o.docsDir||"docs"),s=k(e),i=t,r,c=!1,p=i?.plugins?.flatMap(n=>n.vitePlugins||[])||[];return[{name:"vite-plugin-boltdocs",enforce:"pre",async config(n,l){c=l.command==="build";let d=n.envDir||process.cwd(),u=(0,se.loadEnv)(l.mode,d,"");return Object.assign(process.env,u),i||(i=await I(e)),{optimizeDeps:{include:["react","react-dom"],exclude:["boltdocs","boltdocs/client","boltdocs/hooks","boltdocs/primitives","boltdocs/base-ui","boltdocs/mdx","boltdocs/integrations","boltdocs/client/hooks","boltdocs/client/primitives"]}}},configResolved(n){r=n},configureServer(n){n.middlewares.use((a,g,b)=>{if(a.url==="/robots.txt"){let f=ct(i);g.statusCode=200,g.setHeader("Content-Type","text/plain"),g.end(f);return}b()}),n.middlewares.use(async(a,g,b)=>{let f=a.url?.split("?")[0]||"/",D=a.headers.accept||"",x=f==="/"||f.startsWith("/docs")||i.i18n&&Object.keys(i.i18n.locales).some(w=>f.startsWith(`/${w}/docs`)||f===`/${w}`)||i.external&&Object.keys(i.external).some(w=>f.startsWith(w)),$=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(f);if(D.includes("text/html")&&!$&&x){let w=re(i);w=_t(w,i),w=await n.transformIndexHtml(a.url||"/",w),g.statusCode=200,g.setHeader("Content-Type","text/html"),g.end(w);return}b()});let l=at.map(a=>M.default.resolve(process.cwd(),a)),d=["tsx","jsx"],u=d.map(a=>M.default.resolve(e,`layout.${a}`)),h=["tsx","ts","jsx","js"],y=h.map(a=>M.default.resolve(e,`mdx-components.${a}`));n.watcher.add([...l,...y,...u]);let S=async(a,g)=>{try{let b=k(a);if(at.some(x=>b.endsWith(x))){n.restart();return}if(h.some(x=>b.endsWith(`mdx-components.${x}`))){let x=n.moduleGraph.getModuleById("\0virtual:boltdocs-mdx-components");x&&n.moduleGraph.invalidateModule(x),n.ws.send({type:"full-reload"});return}if(d.some(x=>b.endsWith(`layout.${x}`))){let x=n.moduleGraph.getModuleById("\0virtual:boltdocs-layout");x&&n.moduleGraph.invalidateModule(x),n.ws.send({type:"full-reload"});return}if(!b.startsWith(s)||!zt(b))return;if(g==="add"||g==="unlink"){Rt(),i=await I(e);let x=n.moduleGraph.getModuleById("\0virtual:boltdocs-config");x&&n.moduleGraph.invalidateModule(x),n.ws.send({type:"custom",event:"boltdocs:config-update",data:{theme:i?.theme,integrations:i?.integrations,i18n:i?.i18n,versions:i?.versions,siteUrl:i?.siteUrl}})}else kt(a);let f=await Q(e,i,"/docs",g!=="change"),D=n.moduleGraph.getModuleById("\0virtual:boltdocs-routes");D&&n.moduleGraph.invalidateModule(D),n.ws.send({type:"custom",event:"boltdocs:routes-update",data:f})}catch(b){console.error(`[boltdocs] HMR error during ${g} event:`,b)}};n.watcher.on("add",a=>S(a,"add")),n.watcher.on("unlink",a=>S(a,"unlink")),n.watcher.on("change",a=>S(a,"change"))},resolveId(n){if(n==="virtual:boltdocs-routes"||n==="virtual:boltdocs-config"||n==="virtual:boltdocs-entry"||n==="virtual:boltdocs-mdx-components"||n==="virtual:boltdocs-layout")return"\0"+n},async load(n){if(n==="\0virtual:boltdocs-routes"){let l=await Q(e,i);return`export default ${JSON.stringify(l,null,2)};`}if(n==="\0virtual:boltdocs-config"){let l={theme:i?.theme,integrations:i?.integrations,i18n:i?.i18n,versions:i?.versions,siteUrl:i?.siteUrl};return`export default ${JSON.stringify(l,null,2)};`}if(n==="\0virtual:boltdocs-entry")return ne(o,i);if(n==="\0virtual:boltdocs-mdx-components"){let l=["tsx","ts","jsx","js"],d=null;for(let u of l){let h=M.default.resolve(e,`mdx-components.${u}`);if(Ot.default.existsSync(h)){d=h;break}}if(d){let u=k(d);return`import * as components from '${u}';
69
+ </body>`)),o}m();function se(o){let e=[];for(let t of o)if(e.push({id:t.path,title:t.title,content:t._content||"",url:t.path,display:t.groupTitle?`${t.groupTitle} > ${t.title}`:t.title,locale:t.locale,version:t.version}),t.headings)for(let s of t.headings)e.push({id:`${t.path}#${s.id}`,title:s.text,content:`${s.text} in ${t.title}`,url:`${t.path}#${s.id}`,display:`${t.title} > ${s.text}`,locale:t.locale,version:t.version});return e}var Ot=v(require("fs"));m();function le(o={},e){let t=M.default.resolve(process.cwd(),o.docsDir||"docs"),s=k(t),i=e,r,c=!1,p=i?.plugins?.flatMap(n=>n.vitePlugins||[])||[];return[{name:"vite-plugin-boltdocs",enforce:"pre",async config(n,l){c=l.command==="build";let d=n.envDir||process.cwd(),u=(0,ae.loadEnv)(l.mode,d,"");return Object.assign(process.env,u),i||(i=await I(t)),{optimizeDeps:{include:["react","react-dom"],exclude:["boltdocs","boltdocs/client","boltdocs/hooks","boltdocs/primitives","boltdocs/base-ui","boltdocs/mdx","boltdocs/integrations","boltdocs/client/hooks","boltdocs/client/primitives"]}}},configResolved(n){r=n},configureServer(n){n.middlewares.use((a,g,b)=>{if(a.url==="/robots.txt"){let f=ct(i);g.statusCode=200,g.setHeader("Content-Type","text/plain"),g.end(f);return}b()}),n.middlewares.use(async(a,g,b)=>{let f=a.url?.split("?")[0]||"/",B=a.headers.accept||"",x=f==="/"||f.startsWith("/docs")||i.i18n&&Object.keys(i.i18n.locales).some(w=>f.startsWith(`/${w}/docs`)||f===`/${w}`)||i.external&&Object.keys(i.external).some(w=>f.startsWith(w)),$=/\.(js|css|png|jpe?g|gif|svg|ico|webp|woff2?|ttf|otf|mp4|webm|ogg|mp3|wav|flac|aac|pdf|zip|gz|map|json)$/i.test(f);if(B.includes("text/html")&&!$&&x){let w=re(i);w=_t(w,i),w=await n.transformIndexHtml(a.url||"/",w),g.statusCode=200,g.setHeader("Content-Type","text/html"),g.end(w);return}b()});let l=at.map(a=>M.default.resolve(process.cwd(),a)),d=["tsx","jsx"],u=d.map(a=>M.default.resolve(t,`layout.${a}`)),h=["tsx","ts","jsx","js"],y=h.map(a=>M.default.resolve(t,`mdx-components.${a}`));n.watcher.add([...l,...y,...u]);let S=async(a,g)=>{try{let b=k(a);if(at.some(x=>b.endsWith(x))){n.restart();return}if(h.some(x=>b.endsWith(`mdx-components.${x}`))){let x=n.moduleGraph.getModuleById("\0virtual:boltdocs-mdx-components");x&&n.moduleGraph.invalidateModule(x),n.ws.send({type:"full-reload"});return}if(d.some(x=>b.endsWith(`layout.${x}`))){let x=n.moduleGraph.getModuleById("\0virtual:boltdocs-layout");x&&n.moduleGraph.invalidateModule(x),n.ws.send({type:"full-reload"});return}if(!b.startsWith(s)||!zt(b))return;if(g==="add"||g==="unlink"){Rt(),i=await I(t);let x=n.moduleGraph.getModuleById("\0virtual:boltdocs-config");x&&n.moduleGraph.invalidateModule(x),n.ws.send({type:"custom",event:"boltdocs:config-update",data:{theme:i?.theme,integrations:i?.integrations,i18n:i?.i18n,versions:i?.versions,siteUrl:i?.siteUrl}})}else kt(a);let f=await N(t,i,"/docs",g!=="change"),B=n.moduleGraph.getModuleById("\0virtual:boltdocs-routes");B&&n.moduleGraph.invalidateModule(B),n.ws.send({type:"custom",event:"boltdocs:routes-update",data:f})}catch(b){console.error(`[boltdocs] HMR error during ${g} event:`,b)}};n.watcher.on("add",a=>S(a,"add")),n.watcher.on("unlink",a=>S(a,"unlink")),n.watcher.on("change",a=>S(a,"change"))},resolveId(n){if(n==="virtual:boltdocs-routes"||n==="virtual:boltdocs-config"||n==="virtual:boltdocs-entry"||n==="virtual:boltdocs-mdx-components"||n==="virtual:boltdocs-layout"||n==="virtual:boltdocs-search")return"\0"+n},async load(n){if(n==="\0virtual:boltdocs-routes"){let l=await N(t,i);return`export default ${JSON.stringify(l,null,2)};`}if(n==="\0virtual:boltdocs-config"){let l={theme:i?.theme,integrations:i?.integrations,i18n:i?.i18n,versions:i?.versions,siteUrl:i?.siteUrl};return`export default ${JSON.stringify(l,null,2)};`}if(n==="\0virtual:boltdocs-entry")return ne(o,i);if(n==="\0virtual:boltdocs-mdx-components"){let l=["tsx","ts","jsx","js"],d=null;for(let u of l){let h=M.default.resolve(t,`mdx-components.${u}`);if(Ot.default.existsSync(h)){d=h;break}}if(d){let u=k(d);return`import * as components from '${u}';
70
70
  const mdxComponents = components.default || components;
71
71
  export default mdxComponents;
72
- export * from '${u}';`}return"export default {};"}if(n==="\0virtual:boltdocs-layout"){let l=["tsx","jsx"],d=null;for(let u of l){let h=M.default.resolve(e,`layout.${u}`);if(Ot.default.existsSync(h)){d=h;break}}return d?`import UserLayout from '${k(d)}';
72
+ export * from '${u}';`}return"export default {};"}if(n==="\0virtual:boltdocs-layout"){let l=["tsx","jsx"],d=null;for(let u of l){let h=M.default.resolve(t,`layout.${u}`);if(Ot.default.existsSync(h)){d=h;break}}return d?`import UserLayout from '${k(d)}';
73
73
  export default UserLayout;`:`import { DefaultLayout } from 'boltdocs/client';
74
- export default DefaultLayout;`}},transformIndexHtml:{order:"pre",handler(n){return _t(n,i)}},async closeBundle(){if(!c)return;let n=r?.build?.outDir?M.default.resolve(r.root,r.build.outDir):M.default.resolve(process.cwd(),"dist"),l=M.default.basename(e||"docs");await lt({docsDir:e,docsDirName:l,outDir:n,config:i});let{flushCache:d}=await Promise.resolve().then(()=>(X(),Dt));await d()}},(0,ae.ViteImageOptimizer)({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:"preset-default"}]}}),...p.filter(n=>!!n)]}m();var he=v(require("@mdx-js/rollup")),ye=v(require("remark-gfm")),xe=v(require("remark-frontmatter")),be=v(require("rehype-slug")),ve=v(require("crypto"));m();X();var le="v3",N=new K("mdx");m();var pe=require("unist-util-visit");m();var de=require("shiki"),dt=null;async function pt(o){if(dt)return dt;let t=typeof o=="object"?[o.light,o.dark]:[o??"github-dark"];return["github-light","github-dark"].forEach(e=>{t.includes(e)||t.push(e)}),dt=await(0,de.createHighlighter)({themes:t,langs:["tsx","jsx","ts","js","json","md","mdx","css","html","bash","sh","yaml","yml"]}),dt}function me(o){return async t=>{let e=o?.theme?.codeTheme??{light:"github-light",dark:"github-dark"},s=await pt(e);(0,pe.visit)(t,["mdxJsxFlowElement","mdxJsxTextElement"],i=>{if(i.name!=="ComponentPreview")return;let r=i.attributes?.find(l=>l.name==="code"),c="";if(r){if(typeof r.value=="string")c=r.value;else if(r.value?.type==="mdxJsxAttributeValueExpression"){let l=r.value.value??"";c=l.match(/^[`'"](.+)[`'"]$/)?.[1]??l}}if(!c)return;let p=typeof e=="object"?{themes:{light:e.light,dark:e.dark},lang:"tsx"}:{theme:e,lang:"tsx"},n=s.codeToHtml(c,p);i.attributes=(i.attributes??[]).filter(l=>l.name!=="highlightedHtml"),i.attributes.push({type:"mdxJsxAttribute",name:"highlightedHtml",value:n})})}}m();var ue=require("unist-util-visit");function ge(o){return async t=>{let e=o?.theme?.codeTheme||{light:"github-light",dark:"github-dark"},s=await pt(e);(0,ue.visit)(t,"element",i=>{if(i.tagName==="pre"&&i.children?.[0]?.tagName==="code"){let r=i.children[0],p=(r.properties?.className||[]).find(h=>h.startsWith("language-")),n=p?p.slice(9):"text",l=r.children[0]?.value||"",d={lang:n};typeof e=="object"?d.themes={light:e.light,dark:e.dark}:d.theme=e;let u=s.codeToHtml(l,d);i.properties.dataHighlighted="true",i.properties.highlightedHtml=u,i.children=[]}})}}var fe=!1,mt=0,Y=0;function Pe(o,t=he.default){let e=o?.plugins?.flatMap(r=>r.remarkPlugins||[])||[],s=o?.plugins?.flatMap(r=>r.rehypePlugins||[])||[],i=t({remarkPlugins:[ye.default,xe.default,[me,o],...e],rehypePlugins:[be.default,[ge,o],...s],jsxRuntime:"automatic",providerImportSource:"@mdx-js/react"});return{...i,name:"vite-plugin-boltdocs-mdx",async buildStart(){mt=0,Y=0,fe||(N.load(),fe=!0),i.buildStart&&await i.buildStart.call(this)},async transform(r,c,p){if(!c.endsWith(".md")&&!c.endsWith(".mdx"))return i.transform?.call(this,r,c,p);console.log(`[boltdocs] Transforming MDX: ${c}`),Y++;let n=ve.default.createHash("md5").update(r).digest("hex"),l=`${c}:${n}:${le}`,d=N.get(l);if(d)return mt++,{code:d,map:null};let u=await i.transform.call(this,r,c,p);return u&&typeof u=="object"&&u.code&&N.set(l,u.code),u},async buildEnd(){Y>0&&console.log(`[boltdocs] MDX Cache Performance: ${mt}/${Y} hits (${Math.round(mt/Y*100)||0}%)`),N.save(),await N.flush(),i.buildEnd&&await i.buildEnd.call(this)}}}async function Ft(o){let t=o?.docsDir||"docs",e=await I(t),s={...o,homePage:o?.homePage||e.homePage};return[...ce(s,e),Pe(e)]}async function qe(o,t="development"){let e=await I("docs",o);return{root:o,mode:t,plugins:[(0,we.default)(),(0,Ce.default)(),await Ft({docsDir:e.docsDir,homePage:e.homePage})],...e.vite}}0&&(module.exports={createViteConfig,defineConfig,generateStaticPages,resolveConfig});
74
+ export default DefaultLayout;`}if(n==="\0virtual:boltdocs-search"){let l=await N(t,i),d=se(l);return`export default ${JSON.stringify(d,null,2)};`}},transformIndexHtml:{order:"pre",handler(n){return _t(n,i)}},async closeBundle(){if(!c)return;let n=r?.build?.outDir?M.default.resolve(r.root,r.build.outDir):M.default.resolve(process.cwd(),"dist"),l=M.default.basename(t||"docs");await lt({docsDir:t,docsDirName:l,outDir:n,config:i});let{flushCache:d}=await Promise.resolve().then(()=>(Z(),Bt));await d()}},(0,ce.ViteImageOptimizer)({includePublic:!0,png:{quality:80},jpeg:{quality:80},jpg:{quality:80},webp:{quality:80},avif:{quality:80},svg:{multipass:!0,plugins:[{name:"preset-default"}]}}),...p.filter(n=>!!n)]}m();var ye=v(require("@mdx-js/rollup")),xe=v(require("remark-gfm")),be=v(require("remark-frontmatter")),ve=v(require("rehype-slug")),Pe=v(require("crypto"));m();Z();var de="v3",U=new X("mdx");m();var me=require("unist-util-visit");m();var pe=require("shiki"),dt=null;async function pt(o){if(dt)return dt;let e=typeof o=="object"?[o.light,o.dark]:[o??"github-dark"];return["github-light","github-dark"].forEach(t=>{e.includes(t)||e.push(t)}),dt=await(0,pe.createHighlighter)({themes:e,langs:["tsx","jsx","ts","js","json","md","mdx","css","html","bash","sh","yaml","yml"]}),dt}function ue(o){return async e=>{let t=o?.theme?.codeTheme??{light:"github-light",dark:"github-dark"},s=await pt(t);(0,me.visit)(e,["mdxJsxFlowElement","mdxJsxTextElement"],i=>{if(i.name!=="ComponentPreview")return;let r=i.attributes?.find(l=>l.name==="code"),c="";if(r){if(typeof r.value=="string")c=r.value;else if(r.value?.type==="mdxJsxAttributeValueExpression"){let l=r.value.value??"";c=l.match(/^[`'"](.+)[`'"]$/)?.[1]??l}}if(!c)return;let p=typeof t=="object"?{themes:{light:t.light,dark:t.dark},lang:"tsx"}:{theme:t,lang:"tsx"},n=s.codeToHtml(c,p);i.attributes=(i.attributes??[]).filter(l=>l.name!=="highlightedHtml"),i.attributes.push({type:"mdxJsxAttribute",name:"highlightedHtml",value:n})})}}m();var ge=require("unist-util-visit");function fe(o){return async e=>{let t=o?.theme?.codeTheme||{light:"github-light",dark:"github-dark"},s=await pt(t);(0,ge.visit)(e,"element",i=>{if(i.tagName==="pre"&&i.children?.[0]?.tagName==="code"){let r=i.children[0],p=(r.properties?.className||[]).find(h=>h.startsWith("language-")),n=p?p.slice(9):"text",l=r.children[0]?.value||"",d={lang:n};typeof t=="object"?d.themes={light:t.light,dark:t.dark}:d.theme=t;let u=s.codeToHtml(l,d);i.properties.dataHighlighted="true",i.properties.highlightedHtml=u,i.children=[]}})}}var he=!1,mt=0,Y=0;function we(o,e=ye.default){let t=o?.plugins?.flatMap(r=>r.remarkPlugins||[])||[],s=o?.plugins?.flatMap(r=>r.rehypePlugins||[])||[],i=e({remarkPlugins:[xe.default,be.default,[ue,o],...t],rehypePlugins:[ve.default,[fe,o],...s],jsxRuntime:"automatic",providerImportSource:"@mdx-js/react"});return{...i,name:"vite-plugin-boltdocs-mdx",async buildStart(){mt=0,Y=0,he||(U.load(),he=!0),i.buildStart&&await i.buildStart.call(this)},async transform(r,c,p){if(!c.endsWith(".md")&&!c.endsWith(".mdx"))return i.transform?.call(this,r,c,p);console.log(`[boltdocs] Transforming MDX: ${c}`),Y++;let n=Pe.default.createHash("md5").update(r).digest("hex"),l=`${c}:${n}:${de}`,d=U.get(l);if(d)return mt++,{code:d,map:null};let u=await i.transform.call(this,r,c,p);return u&&typeof u=="object"&&u.code&&U.set(l,u.code),u},async buildEnd(){Y>0&&console.log(`[boltdocs] MDX Cache Performance: ${mt}/${Y} hits (${Math.round(mt/Y*100)||0}%)`),U.save(),await U.flush(),i.buildEnd&&await i.buildEnd.call(this)}}}async function Ft(o){let e=o?.docsDir||"docs",t=await I(e),s={...o,homePage:o?.homePage||t.homePage};return[...le(s,t),we(t)]}async function Je(o,e="development"){let t=await I("docs",o);return{root:o,mode:e,plugins:[(0,Ce.default)(),(0,$e.default)(),await Ft({docsDir:t.docsDir,homePage:t.homePage})],...t.vite}}0&&(module.exports={createViteConfig,defineConfig,generateStaticPages,resolveConfig});
@@ -1 +1 @@
1
- import{a,b,c,f as d,g as e,h as f}from"../chunk-5D6XPYQ3.mjs";import"../chunk-Q3MLYTIQ.mjs";f();export{e as createViteConfig,d as default,a as defineConfig,c as generateStaticPages,b as resolveConfig};
1
+ import{a,b,d as c,g as d,h as e,i as f}from"../chunk-22NXDNP4.mjs";import"../chunk-Y4RRHPXC.mjs";f();export{e as createViteConfig,d as default,a as defineConfig,c as generateStaticPages,b as resolveConfig};
@@ -102,14 +102,14 @@ interface SearchDialogItemIconProps {
102
102
  className?: string;
103
103
  }
104
104
  declare const SearchDialogRoot: ({ children, isOpen, onOpenChange, className, }: SearchDialogProps) => react_jsx_runtime.JSX.Element;
105
- declare const SearchDialogAutocomplete: ({ children, className, onSelectionChange, ...props }: RAC.AutocompleteProps<object> & {
105
+ declare const SearchDialogAutocomplete: <T extends object>({ children, className, onSelectionChange, ...props }: RAC.AutocompleteProps<T> & {
106
106
  className?: string;
107
107
  onSelectionChange?: (key: RAC.Key) => void;
108
108
  }) => react_jsx_runtime.JSX.Element;
109
109
  declare const SearchDialogInput: ({ className, ...props }: RAC.InputProps & {
110
110
  className?: string;
111
111
  }) => react_jsx_runtime.JSX.Element;
112
- declare const SearchDialogList: ({ children, className, ...props }: RAC.ListBoxProps<object> & {
112
+ declare const SearchDialogList: <T extends object>({ children, className, ...props }: RAC.ListBoxProps<T> & {
113
113
  className?: string;
114
114
  }) => react_jsx_runtime.JSX.Element;
115
115
  declare const SearchDialogItemRoot: ({ children, className, ...props }: SearchDialogItemProps) => react_jsx_runtime.JSX.Element;
@@ -102,14 +102,14 @@ interface SearchDialogItemIconProps {
102
102
  className?: string;
103
103
  }
104
104
  declare const SearchDialogRoot: ({ children, isOpen, onOpenChange, className, }: SearchDialogProps) => react_jsx_runtime.JSX.Element;
105
- declare const SearchDialogAutocomplete: ({ children, className, onSelectionChange, ...props }: RAC.AutocompleteProps<object> & {
105
+ declare const SearchDialogAutocomplete: <T extends object>({ children, className, onSelectionChange, ...props }: RAC.AutocompleteProps<T> & {
106
106
  className?: string;
107
107
  onSelectionChange?: (key: RAC.Key) => void;
108
108
  }) => react_jsx_runtime.JSX.Element;
109
109
  declare const SearchDialogInput: ({ className, ...props }: RAC.InputProps & {
110
110
  className?: string;
111
111
  }) => react_jsx_runtime.JSX.Element;
112
- declare const SearchDialogList: ({ children, className, ...props }: RAC.ListBoxProps<object> & {
112
+ declare const SearchDialogList: <T extends object>({ children, className, ...props }: RAC.ListBoxProps<T> & {
113
113
  className?: string;
114
114
  }) => react_jsx_runtime.JSX.Element;
115
115
  declare const SearchDialogItemRoot: ({ children, className, ...props }: SearchDialogItemProps) => react_jsx_runtime.JSX.Element;
@@ -1 +1 @@
1
- "use strict";var lt=Object.create;var _=Object.defineProperty;var ct=Object.getOwnPropertyDescriptor;var mt=Object.getOwnPropertyNames;var pt=Object.getPrototypeOf,ut=Object.prototype.hasOwnProperty;var dt=(e,t)=>{for(var o in t)_(e,o,{get:t[o],enumerable:!0})},ve=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of mt(t))!ut.call(e,n)&&n!==o&&_(e,n,{get:()=>t[n],enumerable:!(r=ct(t,n))||r.enumerable});return e};var w=(e,t,o)=>(o=e!=null?lt(pt(e)):{},ve(t||!e||!e.__esModule?_(o,"default",{value:e,enumerable:!0}):o,e)),ft=e=>ve(_({},"__esModule",{value:!0}),e);var po={};dt(po,{AnchorProvider:()=>Et,BreadcrumbsItem:()=>oo,BreadcrumbsLink:()=>ro,BreadcrumbsRoot:()=>to,BreadcrumbsSeparator:()=>no,Button:()=>se,ButtonGroup:()=>so,Icon:()=>we,Link:()=>B,Menu:()=>ae,MenuItem:()=>le,MenuSection:()=>ao,MenuSeparator:()=>lo,MenuTrigger:()=>ie,NavLink:()=>Qe,NavbarCenter:()=>Ct,NavbarContent:()=>bt,NavbarItem:()=>At,NavbarLeft:()=>ht,NavbarLink:()=>Pt,NavbarLinks:()=>Rt,NavbarLogo:()=>yt,NavbarMenu:()=>kt,NavbarRight:()=>vt,NavbarRoot:()=>xt,NavbarSearchTrigger:()=>wt,NavbarSocials:()=>Bt,NavbarSplit:()=>It,NavbarTheme:()=>Tt,NavbarTitle:()=>Nt,OnThisPageContent:()=>We,OnThisPageHeader:()=>Dt,OnThisPageIndicator:()=>Ft,OnThisPageItem:()=>Ht,OnThisPageLink:()=>Wt,OnThisPageList:()=>Vt,OnThisPageRoot:()=>zt,PageNavDescription:()=>Ke,PageNavIcon:()=>Xe,PageNavLink:()=>je,PageNavRoot:()=>Ge,PageNavTitle:()=>_e,Popover:()=>te,ScrollProvider:()=>Ot,SearchDialogAutocomplete:()=>Be,SearchDialogInput:()=>Ie,SearchDialogItemBio:()=>Ee,SearchDialogItemIcon:()=>Me,SearchDialogItemRoot:()=>Se,SearchDialogItemTitle:()=>Oe,SearchDialogList:()=>Le,SearchDialogRoot:()=>Ae,Separator:()=>I.Separator,SidebarGroup:()=>Qt,SidebarGroupItem:()=>Yt,SidebarLink:()=>eo,SidebarRoot:()=>qt,SubmenuTrigger:()=>io,TabsContent:()=>Kt,TabsIndicator:()=>Xt,TabsItem:()=>_t,TabsList:()=>jt,TabsRoot:()=>Gt,ToggleButton:()=>I.ToggleButton,Tooltip:()=>mo,buttonVariants:()=>be,cn:()=>s,useActiveAnchor:()=>St,useActiveAnchors:()=>Mt,useItems:()=>de,useScrollStatus:()=>He});module.exports=ft(po);var X=require("react");var Pe=require("react-aria-components"),k=require("lucide-react");var N=require("react/jsx-runtime");function K(e){let{size:t=20,...o}=e;return{...o,width:t,height:t}}var Ce=e=>(0,N.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...K(e),children:[(0,N.jsx)("title",{children:"GitHub"}),(0,N.jsx)("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]}),ye=e=>(0,N.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...K(e),children:[(0,N.jsx)("title",{children:"Discord"}),(0,N.jsx)("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418Z"})]}),Ne=e=>(0,N.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...K(e),children:[(0,N.jsx)("title",{children:"X"}),(0,N.jsx)("path",{d:"M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"})]});var Re=e=>(0,N.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...K(e),children:[(0,N.jsx)("title",{children:"Bluesky"}),(0,N.jsx)("path",{d:"M5.202 2.857C7.954 4.922 10.913 9.11 12 11.358c1.087-2.247 4.046-6.436 6.798-8.501C20.783 1.366 24 .213 24 3.883c0 .732-.42 6.156-.667 7.037-.856 3.061-3.978 3.842-6.755 3.37 4.854.826 6.089 3.562 3.422 6.299-5.065 5.196-7.28-1.304-7.847-2.97-.104-.305-.152-.448-.153-.327 0-.121-.05.022-.153.327-.568 1.666-2.782 8.166-7.847 2.97-2.667-2.737-1.432-5.473 3.422-6.3-2.777.473-5.899-.308-6.755-3.369C.42 10.04 0 4.615 0 3.883c0-3.67 3.217-2.517 5.202-1.026"})]});var a=require("react/jsx-runtime"),xt=({children:e,className:t,...o})=>(0,a.jsx)("header",{className:s("boltdocs-navbar sticky top-0 z-50 w-full border-b border-border-subtle bg-bg-main/80 backdrop-blur-md",t),...o,children:e}),bt=({children:e,className:t})=>(0,a.jsx)("div",{className:s("mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6",t),children:e}),ht=({children:e,className:t})=>(0,a.jsx)("div",{className:s("flex items-center gap-4",t),children:e}),vt=({children:e,className:t})=>(0,a.jsx)("div",{className:s("flex items-center gap-2 md:gap-4",t),children:e}),Ct=({children:e,className:t})=>(0,a.jsx)("div",{className:s("hidden lg:flex flex-1 justify-center items-center gap-4 px-4",t),children:e}),yt=({src:e,alt:t,width:o=24,height:r=24,className:n})=>(0,a.jsx)(B,{href:"/",className:s("flex items-center gap-2 shrink-0 outline-none",n),children:e?(0,a.jsx)("img",{src:e,alt:t,width:o,height:r,className:"h-6 w-6 object-contain"}):null}),Nt=({children:e,className:t})=>(0,a.jsx)("span",{className:s("text-lg font-bold tracking-tight hidden sm:inline-block",t),children:e}),Rt=({children:e,className:t})=>(0,a.jsx)("nav",{className:s("hidden md:flex items-center gap-6 text-sm font-medium",t),children:e}),Pt=({label:e,href:t,active:o,to:r,className:n})=>(0,a.jsxs)(B,{href:t,target:r==="external"?"_blank":void 0,className:s("transition-colors outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm",{"text-primary-500 font-bold":o,"text-text-muted hover:text-text-main font-medium":!o},n),children:[e,r==="external"&&(0,a.jsx)("span",{className:"ml-1 inline-block",children:(0,a.jsx)(k.ExternalLink,{size:12})})]}),wt=({className:e,onPress:t})=>{let[o,r]=(0,X.useState)(!1),n=o&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return(0,X.useEffect)(()=>{r(!0)},[]),(0,a.jsxs)(Pe.Button,{onPress:t,className:s("flex items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-muted outline-none cursor-pointer","transition-colors hover:border-border-strong hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30","w-full max-w-[320px] justify-between",e),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(k.Search,{size:16}),(0,a.jsx)("span",{className:"hidden sm:inline-block",children:"Search docs..."})]}),(0,a.jsxs)("div",{className:"hidden sm:flex items-center gap-1 pointer-events-none select-none",children:[(0,a.jsx)("kbd",{className:"flex h-5 items-center justify-center rounded border border-border-subtle bg-bg-main px-1.5 font-mono text-[10px] font-medium",children:n?"\u2318":"Ctrl"}),(0,a.jsx)("kbd",{className:"flex h-5 w-5 items-center justify-center rounded border border-border-subtle bg-bg-main font-mono text-[10px] font-medium",children:"K"})]})]})},Tt=({className:e,theme:t,onThemeChange:o})=>(0,a.jsx)(I.ToggleButton,{isSelected:t==="dark",onChange:o,className:s("rounded-md p-2 text-text-muted outline-none cursor-pointer transition-colors","hover:bg-bg-surface hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30",e),"aria-label":"Toggle theme",children:t==="dark"?(0,a.jsx)(k.Sun,{size:20}):(0,a.jsx)(k.Moon,{size:20})}),kt=({label:e,children:t,className:o,icon:r})=>(0,a.jsxs)(ie,{placement:"bottom end",children:[(0,a.jsxs)(se,{variant:"ghost",className:s("flex items-center gap-1.5 rounded-md px-3 py-1.5 text-text-muted outline-none cursor-pointer transition-colors","hover:bg-bg-surface hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30",o),children:[r&&(0,a.jsx)("span",{className:"flex items-center shrink-0",children:r}),(0,a.jsx)("span",{className:"text-[13px] font-bold uppercase tracking-wide",children:e}),(0,a.jsx)(k.ChevronDown,{size:14,className:"ml-0.5 opacity-50"})]}),(0,a.jsx)(ae,{className:"min-w-[180px]",children:t})]}),At=({label:e,className:t,onPress:o,isCurrent:r})=>(0,a.jsx)(le,{onAction:o,className:s(r&&"bg-primary-500 text-white font-medium hover:bg-primary-600 focus:bg-primary-600 focus:text-white",t),children:e}),we=({name:e})=>{if(e==="github")return(0,a.jsx)(Ce,{});if(e==="discord")return(0,a.jsx)(ye,{});if(e==="x")return(0,a.jsx)(Ne,{});if(e==="bluesky")return(0,a.jsx)(Re,{})},Bt=({icon:e,link:t,className:o})=>(0,a.jsx)(B,{href:t,target:"_blank",rel:"noopener noreferrer",className:s("rounded-md p-2 text-text-muted outline-none transition-colors","hover:bg-bg-surface hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30",o),children:(0,a.jsx)(we,{name:e})}),It=({className:e})=>(0,a.jsx)(I.Separator,{orientation:"vertical",className:s("h-6 w-px bg-border-subtle mx-1",e)});var F=w(require("react-aria-components")),Lt=require("lucide-react");var Te=require("clsx"),ke=require("tailwind-merge");function s(...e){return(0,ke.twMerge)((0,Te.clsx)(e))}var ce=require("react/jsx-runtime");var h=w(require("react-aria-components")),L=require("lucide-react");var u=require("react/jsx-runtime"),Ae=({children:e,isOpen:t,onOpenChange:o,className:r})=>(0,u.jsx)(h.ModalOverlay,{isOpen:t,onOpenChange:o,isDismissable:!0,className:s("fixed inset-0 z-100 bg-black/40 backdrop-blur-sm px-4 py-4 sm:py-20","entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out"),children:(0,u.jsx)(h.Modal,{className:s("mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl ring-1 ring-black/5 outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95",r),children:(0,u.jsx)(h.Dialog,{className:"flex flex-col max-h-[70vh] focus:outline-none",children:e})})}),Be=({children:e,className:t,onSelectionChange:o,...r})=>(0,u.jsx)("div",{className:t,children:(0,u.jsx)(h.Autocomplete,{...r,onSelectionChange:o,className:"flex flex-col min-h-0",children:e})}),Ie=({className:e,...t})=>(0,u.jsxs)(h.SearchField,{className:"flex items-center gap-3 border-b border-border-subtle px-4 py-4",autoFocus:!0,children:[(0,u.jsx)(L.Search,{className:"h-5 w-5 text-text-muted"}),(0,u.jsx)(h.Input,{...t,className:s("w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none",e),placeholder:"Search documentation..."}),(0,u.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,u.jsx)("kbd",{className:"font-sans",children:"ESC"})})]}),Le=({children:e,className:t,...o})=>(0,u.jsx)(h.ListBox,{...o,className:s("flex-1 overflow-y-auto p-2 outline-none",t),children:e}),Se=({children:e,className:t,...o})=>(0,u.jsx)(h.ListBoxItem,{...o,className:s("group flex items-center gap-3 rounded-lg p-3 text-left outline-none cursor-pointer transition-colors","text-text-muted hover:bg-bg-main hover:text-text-main focus:bg-primary-500 focus:text-white selected:bg-primary-500 selected:text-white",t),children:r=>(0,u.jsxs)(u.Fragment,{children:[e,(r.isFocused||r.isSelected)&&(0,u.jsxs)("div",{className:"ml-auto opacity-50 flex items-center gap-1",children:[(0,u.jsx)("span",{className:"text-[10px]",children:"Select"}),(0,u.jsx)(L.CornerDownLeft,{size:10})]})]})}),Me=({isHeading:e,className:t})=>(0,u.jsx)("div",{className:s("shrink-0",t),children:e?(0,u.jsx)(L.Hash,{size:18}):(0,u.jsx)(L.FileText,{size:18})}),Oe=({children:e,className:t})=>(0,u.jsx)("span",{className:s("block font-medium truncate flex-1 text-sm",t),children:e}),Ee=({children:e,className:t})=>(0,u.jsx)("span",{className:s("ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100",t),children:e}),wo={Root:Ae,Autocomplete:Be,Input:Ie,List:Le,Item:Object.assign(Se,{Icon:Me,Title:Oe,Bio:Ee})};var d=require("react"),De=w(require("scroll-into-view-if-needed"));var U=require("react");function ze(e,t){let o=(0,U.useRef)(e);(0,U.useEffect)(()=>{o.current!==e&&(t(e),o.current=e)},[e,t])}function me(e){return e.startsWith("#")?e.slice(1):null}var A=require("react/jsx-runtime"),ue=(0,d.createContext)(null),Ve=(0,d.createContext)(null),pe=class{items=[];single=!1;observer=null;onChange;callback(t){if(t.length===0)return;let o=!1;if(this.items=this.items.map(r=>{let n=t.find(m=>m.target.id===r.id),i=n?n.isIntersecting:r.active&&!r.fallback;return this.single&&o&&(i=!1),r.active!==i&&(r={...r,t:Date.now(),active:i,fallback:!1}),i&&(o=!0),r}),!o&&t[0].rootBounds){let r=t[0].rootBounds.top,n=Number.MAX_VALUE,i=-1;for(let m=0;m<this.items.length;m++){let l=document.getElementById(this.items[m].id);if(!l)continue;let c=Math.abs(r-l.getBoundingClientRect().top);c<n&&(i=m,n=c)}i!==-1&&(this.items[i]={...this.items[i],active:!0,fallback:!0,t:Date.now()})}this.onChange?.()}setItems(t){let o=this.observer;if(o)for(let r of this.items){let n=document.getElementById(r.id);n&&o.unobserve(n)}this.items=[];for(let r of t){let n=me(r.url);n&&this.items.push({id:n,active:!1,fallback:!1,t:0,original:r})}this.watchItems(),typeof window<"u"&&(setTimeout(()=>this.watchItems(),100),setTimeout(()=>this.watchItems(),500),setTimeout(()=>this.watchItems(),1e3)),this.onChange?.()}watch(t){this.observer||(this.observer=new IntersectionObserver(this.callback.bind(this),t),this.watchItems())}watchItems(){if(this.observer)for(let t of this.items){let o=document.getElementById(t.id);o&&this.observer.observe(o)}}unwatch(){this.observer?.disconnect(),this.observer=null}};function de(){let e=(0,d.use)(ue);if(!e)throw new Error("Component must be used under the <AnchorProvider /> component.");return e}function He(e){let[t,o]=(0,d.useState)({isOverflowing:!1,isAtBottom:!1});return(0,d.useEffect)(()=>{let r=e.current;if(!r)return;let n=()=>{let m=r.scrollHeight>r.clientHeight,l=r.scrollHeight-r.scrollTop<=r.clientHeight+2;o({isOverflowing:m,isAtBottom:l})};n(),r.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n);let i=new MutationObserver(n);return i.observe(r,{childList:!0,subtree:!0}),()=>{r.removeEventListener("scroll",n),window.removeEventListener("resize",n),i.disconnect()}},[e]),t}function St(){let e=de();return(0,d.useMemo)(()=>{let t;for(let o of e)o.active&&(!t||o.t>t.t)&&(t=o);return t?.id},[e])}function Mt(){let e=de();return(0,d.useMemo)(()=>{let t=[];for(let o of e)o.active&&t.push(o.id);return t},[e])}function Ot({containerRef:e,children:t}){return(0,A.jsx)(Ve.Provider,{value:e,children:t})}function Et({toc:e,single:t=!1,children:o}){let r=(0,d.useMemo)(()=>new pe,[]),[n,i]=(0,d.useState)(r.items);return r.single=t,(0,d.useEffect)(()=>{r.setItems(e)},[r,e]),(0,d.useEffect)(()=>(r.watch({rootMargin:"0px",threshold:.98}),r.onChange=()=>i([...r.items]),()=>{r.unwatch()}),[r]),(0,A.jsx)(ue.Provider,{value:n,children:o})}var zt=({children:e,className:t})=>(0,A.jsx)("nav",{className:s("sticky top-navbar hidden xl:flex flex-col shrink-0","w-toc","py-8 pl-6 pr-4",t),children:e}),Dt=({children:e,className:t,...o})=>(0,A.jsx)("div",{className:s("mb-4 text-xs font-bold uppercase tracking-wider text-text-main",t),...o,children:e}),We=({children:e,className:t,ref:o,...r})=>{let n=(0,d.useRef)(null);(0,d.useImperativeHandle)(o,()=>n.current);let{isOverflowing:i,isAtBottom:m}=He(n);return(0,A.jsx)("div",{ref:n,className:s("relative overflow-y-auto boltdocs-otp-content",i&&!m&&"mask-[linear-gradient(to_bottom,black_85%,transparent_100%)]",t),...r,children:e})};We.displayName="OnThisPageContent";var Vt=({children:e,className:t})=>(0,A.jsx)("ul",{className:s("relative space-y-1 text-sm border-l border-border-subtle",t),children:e}),Ht=({level:e,children:t,className:o})=>(0,A.jsx)("li",{className:s(e===3&&"pl-3",o),children:t}),Wt=({children:e,href:t,active:o,onClick:r,className:n})=>{let i=(0,d.use)(ue),m=(0,d.use)(Ve),l=t?me(t):null,c=(0,d.useRef)(null),[C,y]=(0,d.useState)(o);return ze(l&&i?i.find(g=>g.id===l)?.active:null,g=>{g!==null&&g!==C&&(y(!!g),g&&c.current&&m?.current&&(0,De.default)(c.current,{behavior:"smooth",block:"center",inline:"center",scrollMode:"if-needed",boundary:m.current}))}),(0,d.useEffect)(()=>{o!==void 0&&y(o)},[o]),(0,A.jsx)("a",{ref:c,href:t,onClick:r,"data-active":C,className:s("block py-1 pl-4 text-[13px] outline-none transition-colors hover:text-text-main",C?"text-primary-500 font-medium":"text-text-muted",n),children:e})},Ft=({style:e,className:t})=>(0,A.jsx)("div",{className:s("absolute -left-px w-0.5 rounded-full bg-primary-500 transition-all duration-300",t),style:e});var Fe=w(require("react-aria-components")),Z=require("lucide-react");var R=require("react/jsx-runtime"),Ge=({children:e,className:t})=>(0,R.jsx)("nav",{className:s("grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle",t),children:e}),je=({children:e,to:t,direction:o,className:r})=>{let n=o==="next";return(0,R.jsxs)(Fe.Link,{href:t,className:s("flex group items-center p-4 rounded-xl border border-border-subtle bg-bg-surface outline-none","transition-all hover:bg-bg-main hover:border-primary-500 hover:shadow-lg","focus-visible:ring-2 focus-visible:ring-primary-500/30",n?"text-right justify-end":"text-left justify-start",r),children:[!n&&(0,R.jsx)(Z.ChevronLeft,{className:"mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1"}),(0,R.jsx)("div",{className:"flex flex-col gap-1 flex-1",children:e}),n&&(0,R.jsx)(Z.ChevronRight,{className:"ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1"})]})},_e=({children:e,className:t})=>(0,R.jsx)("span",{className:s("text-xs font-medium uppercase tracking-wider text-text-muted",t),children:e}),Ke=({children:e,className:t})=>(0,R.jsx)("span",{className:s("text-base font-bold text-text-main truncate",t),children:e}),Xe=({children:e})=>(0,R.jsx)(R.Fragment,{children:e}),Ho={PageNavRoot:Ge,PageNavLink:Object.assign(je,{Title:_e,Description:Ke,Icon:Xe})};var M=require("react/jsx-runtime"),Gt=({children:e,className:t="",...o})=>(0,M.jsx)("div",{className:s("w-full",t),...o,children:e}),jt=({children:e,className:t=""})=>(0,M.jsx)("div",{role:"tablist",className:s("relative flex flex-row items-center border-b border-border-subtle",t),children:e}),_t=({children:e,id:t,selected:o,className:r="",...n})=>(0,M.jsx)("button",{role:"tab","aria-selected":o,className:s("flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors outline-none cursor-pointer bg-transparent border-none",o?"text-primary-500":"text-text-muted hover:text-text-main",r),...n,children:e}),Kt=({children:e,className:t=""})=>(0,M.jsx)("div",{className:s("p-4 outline-none",t),children:e}),Xt=({className:e="",style:t})=>(0,M.jsx)("div",{className:s("absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300",e),style:t});var ge=w(require("react")),Je=require("react-aria-components"),qe=require("react-router-dom");var $=require("react"),Ut=(0,$.createContext)(null);function J(){let e=(0,$.use)(Ut);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e}var Ze=require("react-router-dom");var O=require("react"),$t=require("react/jsx-runtime"),Zt=(0,O.createContext)({preload:()=>{},routes:[]});function q(){return(0,O.use)(Zt)}var Ue=require("zustand"),Q=require("zustand/middleware"),Y=(0,Ue.create)()((0,Q.persist)(e=>({currentLocale:void 0,currentVersion:void 0,hasHydrated:!1,setLocale:t=>e({currentLocale:t}),setVersion:t=>e({currentVersion:t}),setHasHydrated:t=>e({hasHydrated:t})}),{name:"boltdocs-storage",storage:(0,Q.createJSONStorage)(()=>localStorage),partialize:e=>({currentLocale:e.currentLocale,currentVersion:e.currentVersion}),onRehydrateStorage:()=>e=>{e?.setHasHydrated(!0)}}));function $e(){let{routes:e}=q(),t=J(),o=(0,Ze.useLocation)(),r=Y(p=>p.currentLocale),n=Y(p=>p.currentVersion),i=Y(p=>p.hasHydrated),m=e.find(p=>p.path===o.pathname),l=t.i18n?m?.locale||(i?r:void 0)||t.i18n.defaultLocale:void 0,c=t.versions?m?.version||(i?n:void 0)||t.versions.defaultVersion:void 0,C=e.filter(p=>{let oe=t.i18n?(p.locale||t.i18n.defaultLocale)===l:!0,re=t.versions?(p.version||t.versions.defaultVersion)===c:!0;if(!(oe&&re))return!1;let ne=t.i18n;if(ne){let it=!!m?.locale,at=!!p.locale;if(e.some(j=>j!==p&&j.filePath===p.filePath&&j.version===p.version&&(j.locale||ne.defaultLocale)===(p.locale||ne.defaultLocale))&&it!==at)return!1}return!0}),g=t.i18n?.localeConfigs?.[l]?.label||t.i18n?.locales[l]||l,S=t.versions?.versions.find(p=>p.path===c)?.label||c,nt=t.i18n?Object.entries(t.i18n.locales).map(([p,oe])=>{let re=t.i18n?.localeConfigs?.[p];return{key:p,label:re?.label||oe,isCurrent:p===l}}):[],st=t.versions?t.versions.versions.map(p=>({key:p.path,label:p.label,isCurrent:p.path===c})):[];return{routes:C,allRoutes:e,currentRoute:m,currentLocale:l,currentLocaleLabel:g,availableLocales:nt,currentVersion:c,currentVersionLabel:S,availableVersions:st,config:t}}function fe(e){let t=J(),{currentLocale:o,currentVersion:r}=$e();if(!t||typeof e!="string"||e.startsWith("http")||e.startsWith("//"))return e;let n=t.i18n,i=t.versions;if(!n&&!i)return e;let m=e.startsWith("/docs"),l=e.split("/").filter(Boolean),c=0;l[c]==="docs"&&c++,i&&l.length>c&&i.versions.find(S=>S.path===l[c])&&c++,n&&l.length>c&&n.locales[l[c]]&&c++;let C=l.slice(c),y=[];m&&(y.push("docs"),i&&r&&y.push(r)),n&&o&&o!==n.defaultLocale&&y.push(o),y.push(...C);let g=`/${y.join("/")}`;return g.length>1&&g.endsWith("/")?g.slice(0,-1):g||"/"}var xe=require("react/jsx-runtime"),B=ge.default.forwardRef((e,t)=>{let{href:o,prefetch:r="hover",onMouseEnter:n,onFocus:i,...m}=e,l=fe(o??""),{preload:c}=q();return(0,xe.jsx)(Je.Link,{...m,ref:t,href:l,onMouseEnter:g=>{n?.(g),r==="hover"&&typeof l=="string"&&l.startsWith("/")&&c(l)},onFocus:g=>{i?.(g),r==="hover"&&typeof l=="string"&&l.startsWith("/")&&c(l)}})});B.displayName="Link";var Qe=ge.default.forwardRef((e,t)=>{let{href:o,end:r=!1,className:n,children:i,...m}=e,l=(0,qe.useLocation)(),c=fe(o??""),C=r?l.pathname===c:l.pathname.startsWith(c),y=typeof n=="function"?n({isActive:C}):s(n,C&&"active"),g=typeof i=="function"?i({isActive:C}):i;return(0,xe.jsx)(B,{...m,ref:t,href:o,className:y,children:g})});Qe.displayName="NavLink";var Ye=w(require("react-aria-components")),et=require("lucide-react");var v=require("react/jsx-runtime"),Jt=({badge:e})=>{let t={new:"bg-primary-500/20 text-primary-500",updated:"bg-gray-500/20 text-gray-500",deprecated:"bg-red-500/20 text-red-500"};if(typeof e=="object"&&e?.expires){let r=new Date(e.expires),n=new Date,i=r.getTime()-n.getTime();if(Math.ceil(i/(1e3*60*60*24))===0)return null}let o=typeof e=="string"?e:e?.text;return(0,v.jsx)("span",{className:s("ml-auto flex h-4.5 items-center rounded-full text-[9px] font-medium px-1.5 py-0.5 text-center whitespace-nowrap",t[o]||t.new),children:o})},qt=({children:e,className:t})=>(0,v.jsx)("aside",{className:s("boltdocs-sidebar sticky top-navbar hidden lg:flex flex-col shrink-0","w-sidebar h-full","overflow-y-auto border-r border-border-subtle bg-bg-main","py-6 px-4",t),children:(0,v.jsx)("nav",{className:"flex-1 space-y-6",children:e})}),Qt=({children:e,title:t,icon:o,isOpen:r=!0,onToggle:n,className:i})=>(0,v.jsxs)("div",{className:s("space-y-1",i),children:[t&&(0,v.jsxs)(Ye.Button,{onPress:n,className:s("flex w-full items-center justify-between px-2 py-1.5 text-xs font-bold uppercase tracking-wider outline-none cursor-pointer","text-text-muted hover:text-text-main transition-colors","focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md"),children:[(0,v.jsxs)("div",{className:"flex items-center gap-2",children:[o&&(0,v.jsx)(o,{size:14}),t]}),(0,v.jsx)(et.ChevronRight,{size:14,className:s("transition-transform duration-200",r&&"rotate-90")})]}),r&&(0,v.jsx)("div",{className:"space-y-0.5",children:e})]}),Yt=({children:e,className:t})=>(0,v.jsx)("div",{className:s(t),children:e}),eo=({label:e,href:t,active:o,icon:r,badge:n,className:i})=>(0,v.jsxs)(B,{href:t,className:s("group flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-primary-500/30",o?"bg-primary-500/10 text-primary-500 font-medium":"text-text-muted hover:bg-bg-surface hover:text-text-main",i),children:[r&&(0,v.jsx)(r,{size:16,className:s(o?"text-primary-500":"text-text-muted group-hover:text-text-main")}),(0,v.jsx)("span",{className:"truncate",children:e}),n&&(0,v.jsx)(Jt,{badge:n})]});var E=require("react-aria-components"),tt=require("lucide-react");var G=require("react/jsx-runtime"),to=({children:e,className:t,...o})=>(0,G.jsx)(E.Breadcrumbs,{className:s("flex items-center gap-1.5 pl-0! mb-0 text-sm text-text-muted",t),...o,children:e}),oo=({children:e,className:t,...o})=>(0,G.jsx)(E.Breadcrumb,{className:s("flex items-center mb-0 gap-1.5",t),...o,children:e}),ro=({children:e,href:t,className:o,...r})=>(0,G.jsx)(E.Link,{href:t,className:s("transition-colors outline-none hover:text-text-main focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm","current:font-medium current:text-text-main current:pointer-events-none cursor-pointer",o),...r,children:e}),no=({className:e})=>(0,G.jsx)(tt.ChevronRight,{size:14,className:s("shrink-0 text-text-dim",e)});var ee=w(require("react-aria-components"));var ot=require("class-variance-authority"),T=require("react/jsx-runtime"),be=(0,ot.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"}}),se=({href:e,icon:t,iconPosition:o="left",isIconOnly:r,children:n,className:i,variant:m,size:l,rounded:c,iconSize:C,disabled:y,...g})=>{let W=r||!n&&!!t,S=W?(0,T.jsx)("span",{className:"inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]",children:t}):(0,T.jsxs)(T.Fragment,{children:[t&&o==="left"&&(0,T.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t}),(0,T.jsx)("span",{className:"flex items-center",children:n}),t&&o==="right"&&(0,T.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t})]});return e?(0,T.jsx)(ee.Link,{href:e,className:s(be({variant:m,size:l,rounded:c,iconSize:W?C:void 0,disabled:y}),i),...g,children:S}):(0,T.jsx)(ee.Button,{className:s(be({variant:m,size:l,rounded:c,iconSize:W?C:void 0,disabled:y}),i),...g,children:S})};var rt=require("react/jsx-runtime"),so=({children:e,className:t,vertical:o=!1})=>(0,rt.jsx)("div",{className:s("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 V=require("lucide-react"),he=w(require("react")),b=w(require("react-aria-components"));var D=w(require("react-aria-components"));var z=require("react/jsx-runtime"),te=({children:e,className:t,showArrow:o,...r})=>(0,z.jsxs)(D.Popover,{offset:8,...r,className:D.composeRenderProps(t,n=>s("z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95 fill-mode-forwards",n)),children:[o&&(0,z.jsx)(D.OverlayArrow,{className:"group",children:(0,z.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,z.jsx)("path",{d:"M0 0 L6 6 L12 0"})})}),e]});var x=require("react/jsx-runtime");function ie(e){let[t,o]=he.default.Children.toArray(e.children).slice(0,2);return(0,x.jsxs)(b.MenuTrigger,{...e,children:[t,(0,x.jsx)(te,{placement:e.placement,className:"min-w-[200px]",children:o})]})}function io(e){let[t,o]=he.default.Children.toArray(e.children).slice(0,2);return(0,x.jsxs)(b.SubmenuTrigger,{...e,children:[t,(0,x.jsx)(te,{offset:-4,crossOffset:-4,children:o})]})}function ae(e){return(0,x.jsx)(b.Menu,{...e,className:b.composeRenderProps(e.className,t=>s("p-1.5 outline-none max-h-[inherit] overflow-auto",t))})}function le(e){let t=e.textValue||(typeof e.children=="string"?e.children:void 0);return(0,x.jsx)(b.MenuItem,{...e,textValue:t,className:b.composeRenderProps(e.className,(o,{isFocused:r,isPressed:n,isDisabled:i})=>s("group relative flex flex-row items-center gap-2.5 px-3 py-1.5 rounded-lg outline-none cursor-default transition-all duration-200","text-text-main text-[0.8125rem]",r&&"bg-primary-500/10 text-primary-600 shadow-sm",n&&"scale-[0.98] bg-primary-500/15",i&&"opacity-40 grayscale pointer-events-none",o)),children:b.composeRenderProps(e.children,(o,{selectionMode:r,isSelected:n,hasSubmenu:i})=>(0,x.jsxs)(x.Fragment,{children:[r!=="none"&&(0,x.jsxs)("span",{className:"flex items-center w-4 h-4 shrink-0 justify-center",children:[n&&r==="multiple"&&(0,x.jsx)(V.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,x.jsx)(V.Dot,{className:"w-6 h-6 text-primary-500 animate-in zoom-in-50 duration-200"})]}),(0,x.jsx)("div",{className:"flex-1 flex flex-row items-center gap-2.5 truncate font-medium",children:o}),i&&(0,x.jsx)(V.ChevronRight,{className:"w-4 h-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors"})]}))})}function ao({title:e,...t}){return(0,x.jsxs)(b.MenuSection,{...t,className:s("flex flex-col gap-0.5",t.className),children:[e&&(0,x.jsx)(b.Header,{className:"px-3 py-2 text-[10px] font-bold uppercase tracking-[0.075em] text-text-muted/50 select-none",children:e}),(0,x.jsx)(b.Collection,{items:t.items,children:t.children})]})}function lo(e){return(0,x.jsx)(b.Separator,{...e,className:"mx-2 my-1.5 border-t border-border-subtle/50"})}var H=w(require("react-aria-components"));var P=require("react/jsx-runtime"),co=({className:e,children:t,...o})=>(0,P.jsx)(H.Tooltip,{...o,offset:8,className:r=>s("group z-50 overflow-visible rounded-md bg-bg-surface/90 px-2.5 py-1.5 text-xs font-medium text-text-main shadow-lg backdrop-blur-md ring-1 ring-border-subtle outline-hidden select-none","data-entering:animate-in data-entering:fade-in data-entering:zoom-in-95 data-entering:duration-100","data-exiting:animate-out data-exiting:fade-out data-exiting:zoom-out-95 data-exiting:duration-75","data-[placement=top]:slide-in-from-bottom-1","data-[placement=bottom]:slide-in-from-top-1","data-[placement=left]:slide-in-from-right-1","data-[placement=right]:slide-in-from-left-1",typeof e=="function"?e(r):e),children:r=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(H.OverlayArrow,{children:(0,P.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,P.jsx)("title",{children:"Arrow"}),(0,P.jsx)("path",{d:"M0 0 L4 4 L8 0"})]})}),typeof t=="function"?t(r):t]})}),mo=({content:e,children:t,delay:o=500,closeDelay:r=0,...n})=>(0,P.jsxs)(H.TooltipTrigger,{delay:o,closeDelay:r,children:[t,(0,P.jsx)(co,{...n,children:e})]});var I=require("react-aria-components");
1
+ "use strict";var lt=Object.create;var _=Object.defineProperty;var ct=Object.getOwnPropertyDescriptor;var mt=Object.getOwnPropertyNames;var pt=Object.getPrototypeOf,ut=Object.prototype.hasOwnProperty;var dt=(e,t)=>{for(var o in t)_(e,o,{get:t[o],enumerable:!0})},ve=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of mt(t))!ut.call(e,n)&&n!==o&&_(e,n,{get:()=>t[n],enumerable:!(r=ct(t,n))||r.enumerable});return e};var w=(e,t,o)=>(o=e!=null?lt(pt(e)):{},ve(t||!e||!e.__esModule?_(o,"default",{value:e,enumerable:!0}):o,e)),ft=e=>ve(_({},"__esModule",{value:!0}),e);var po={};dt(po,{AnchorProvider:()=>Et,BreadcrumbsItem:()=>oo,BreadcrumbsLink:()=>ro,BreadcrumbsRoot:()=>to,BreadcrumbsSeparator:()=>no,Button:()=>se,ButtonGroup:()=>so,Icon:()=>we,Link:()=>B,Menu:()=>ae,MenuItem:()=>le,MenuSection:()=>ao,MenuSeparator:()=>lo,MenuTrigger:()=>ie,NavLink:()=>Qe,NavbarCenter:()=>Ct,NavbarContent:()=>ht,NavbarItem:()=>At,NavbarLeft:()=>bt,NavbarLink:()=>Pt,NavbarLinks:()=>Rt,NavbarLogo:()=>yt,NavbarMenu:()=>kt,NavbarRight:()=>vt,NavbarRoot:()=>xt,NavbarSearchTrigger:()=>wt,NavbarSocials:()=>Bt,NavbarSplit:()=>It,NavbarTheme:()=>Tt,NavbarTitle:()=>Nt,OnThisPageContent:()=>We,OnThisPageHeader:()=>Dt,OnThisPageIndicator:()=>Ft,OnThisPageItem:()=>Ht,OnThisPageLink:()=>Wt,OnThisPageList:()=>Vt,OnThisPageRoot:()=>zt,PageNavDescription:()=>Ke,PageNavIcon:()=>Xe,PageNavLink:()=>je,PageNavRoot:()=>Ge,PageNavTitle:()=>_e,Popover:()=>te,ScrollProvider:()=>Ot,SearchDialogAutocomplete:()=>Be,SearchDialogInput:()=>Ie,SearchDialogItemBio:()=>Ee,SearchDialogItemIcon:()=>Me,SearchDialogItemRoot:()=>Se,SearchDialogItemTitle:()=>Oe,SearchDialogList:()=>Le,SearchDialogRoot:()=>Ae,Separator:()=>I.Separator,SidebarGroup:()=>Qt,SidebarGroupItem:()=>Yt,SidebarLink:()=>eo,SidebarRoot:()=>qt,SubmenuTrigger:()=>io,TabsContent:()=>Kt,TabsIndicator:()=>Xt,TabsItem:()=>_t,TabsList:()=>jt,TabsRoot:()=>Gt,ToggleButton:()=>I.ToggleButton,Tooltip:()=>mo,buttonVariants:()=>he,cn:()=>s,useActiveAnchor:()=>St,useActiveAnchors:()=>Mt,useItems:()=>de,useScrollStatus:()=>He});module.exports=ft(po);var X=require("react");var Pe=require("react-aria-components"),k=require("lucide-react");var N=require("react/jsx-runtime");function K(e){let{size:t=20,...o}=e;return{...o,width:t,height:t}}var Ce=e=>(0,N.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...K(e),children:[(0,N.jsx)("title",{children:"GitHub"}),(0,N.jsx)("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]}),ye=e=>(0,N.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...K(e),children:[(0,N.jsx)("title",{children:"Discord"}),(0,N.jsx)("path",{d:"M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418Z"})]}),Ne=e=>(0,N.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...K(e),children:[(0,N.jsx)("title",{children:"X"}),(0,N.jsx)("path",{d:"M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"})]});var Re=e=>(0,N.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",...K(e),children:[(0,N.jsx)("title",{children:"Bluesky"}),(0,N.jsx)("path",{d:"M5.202 2.857C7.954 4.922 10.913 9.11 12 11.358c1.087-2.247 4.046-6.436 6.798-8.501C20.783 1.366 24 .213 24 3.883c0 .732-.42 6.156-.667 7.037-.856 3.061-3.978 3.842-6.755 3.37 4.854.826 6.089 3.562 3.422 6.299-5.065 5.196-7.28-1.304-7.847-2.97-.104-.305-.152-.448-.153-.327 0-.121-.05.022-.153.327-.568 1.666-2.782 8.166-7.847 2.97-2.667-2.737-1.432-5.473 3.422-6.3-2.777.473-5.899-.308-6.755-3.369C.42 10.04 0 4.615 0 3.883c0-3.67 3.217-2.517 5.202-1.026"})]});var a=require("react/jsx-runtime"),xt=({children:e,className:t,...o})=>(0,a.jsx)("header",{className:s("boltdocs-navbar sticky top-0 z-50 w-full border-b border-border-subtle bg-bg-main/80 backdrop-blur-md",t),...o,children:e}),ht=({children:e,className:t})=>(0,a.jsx)("div",{className:s("mx-auto flex lg:h-navbar max-w-(--breakpoint-3xl) items-center justify-between px-4 md:px-6",t),children:e}),bt=({children:e,className:t})=>(0,a.jsx)("div",{className:s("flex items-center gap-4",t),children:e}),vt=({children:e,className:t})=>(0,a.jsx)("div",{className:s("flex items-center gap-2 md:gap-4",t),children:e}),Ct=({children:e,className:t})=>(0,a.jsx)("div",{className:s("hidden lg:flex flex-1 justify-center items-center gap-4 px-4",t),children:e}),yt=({src:e,alt:t,width:o=24,height:r=24,className:n})=>(0,a.jsx)(B,{href:"/",className:s("flex items-center gap-2 shrink-0 outline-none",n),children:e?(0,a.jsx)("img",{src:e,alt:t,width:o,height:r,className:"h-6 w-6 object-contain"}):null}),Nt=({children:e,className:t})=>(0,a.jsx)("span",{className:s("text-lg font-bold tracking-tight hidden sm:inline-block",t),children:e}),Rt=({children:e,className:t})=>(0,a.jsx)("nav",{className:s("hidden md:flex items-center gap-6 text-sm font-medium",t),children:e}),Pt=({label:e,href:t,active:o,to:r,className:n})=>(0,a.jsxs)(B,{href:t,target:r==="external"?"_blank":void 0,className:s("transition-colors outline-none focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm",{"text-primary-500 font-bold":o,"text-text-muted hover:text-text-main font-medium":!o},n),children:[e,r==="external"&&(0,a.jsx)("span",{className:"ml-1 inline-block",children:(0,a.jsx)(k.ExternalLink,{size:12})})]}),wt=({className:e,onPress:t})=>{let[o,r]=(0,X.useState)(!1),n=o&&/Mac|iPod|iPhone|iPad/.test(navigator.platform);return(0,X.useEffect)(()=>{r(!0)},[]),(0,a.jsxs)(Pe.Button,{onPress:t,className:s("flex items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-muted outline-none cursor-pointer","transition-all duration-200 hover:border-border-strong hover:text-text-main hover:bg-bg-muted hover:shadow-sm active:scale-[0.98]","focus-visible:ring-2 focus-visible:ring-primary-500/30","w-full max-w-[320px] justify-between",e),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(k.Search,{size:16}),(0,a.jsx)("span",{className:"hidden sm:inline-block",children:"Search docs..."})]}),(0,a.jsxs)("div",{className:"hidden sm:flex items-center gap-1 pointer-events-none select-none",children:[(0,a.jsx)("kbd",{className:"flex h-5 items-center justify-center rounded border border-border-subtle bg-bg-main px-1.5 font-mono text-[10px] font-medium",children:n?"\u2318":"Ctrl"}),(0,a.jsx)("kbd",{className:"flex h-5 w-5 items-center justify-center rounded border border-border-subtle bg-bg-main font-mono text-[10px] font-medium",children:"K"})]})]})},Tt=({className:e,theme:t,onThemeChange:o})=>(0,a.jsx)(I.ToggleButton,{isSelected:t==="dark",onChange:o,className:s("rounded-md p-2 text-text-muted outline-none cursor-pointer","transition-all duration-300 hover:bg-bg-surface hover:text-text-main hover:rotate-12 active:scale-90","focus-visible:ring-2 focus-visible:ring-primary-500/30",e),"aria-label":"Toggle theme",children:t==="dark"?(0,a.jsx)(k.Sun,{size:20}):(0,a.jsx)(k.Moon,{size:20})}),kt=({label:e,children:t,className:o,icon:r})=>(0,a.jsxs)(ie,{placement:"bottom end",children:[(0,a.jsxs)(se,{variant:"ghost",className:s("flex items-center gap-1.5 rounded-md px-3 py-1.5 text-text-muted outline-none cursor-pointer transition-colors","hover:bg-bg-surface hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30",o),children:[r&&(0,a.jsx)("span",{className:"flex items-center shrink-0",children:r}),(0,a.jsx)("span",{className:"text-[13px] font-bold uppercase tracking-wide",children:e}),(0,a.jsx)(k.ChevronDown,{size:14,className:"ml-0.5 opacity-50"})]}),(0,a.jsx)(ae,{className:"min-w-[180px]",children:t})]}),At=({label:e,className:t,onPress:o,isCurrent:r})=>(0,a.jsx)(le,{onAction:o,className:s(r&&"bg-primary-500 text-white font-medium hover:bg-primary-600 focus:bg-primary-600 focus:text-white",t),children:e}),we=({name:e})=>{if(e==="github")return(0,a.jsx)(Ce,{});if(e==="discord")return(0,a.jsx)(ye,{});if(e==="x")return(0,a.jsx)(Ne,{});if(e==="bluesky")return(0,a.jsx)(Re,{})},Bt=({icon:e,link:t,className:o})=>(0,a.jsx)(B,{href:t,target:"_blank",rel:"noopener noreferrer",className:s("rounded-md p-2 text-text-muted outline-none transition-colors","hover:bg-bg-surface hover:text-text-main","focus-visible:ring-2 focus-visible:ring-primary-500/30",o),children:(0,a.jsx)(we,{name:e})}),It=({className:e})=>(0,a.jsx)(I.Separator,{orientation:"vertical",className:s("h-6 w-px bg-border-subtle mx-1",e)});var F=w(require("react-aria-components")),Lt=require("lucide-react");var Te=require("clsx"),ke=require("tailwind-merge");function s(...e){return(0,ke.twMerge)((0,Te.clsx)(e))}var ce=require("react/jsx-runtime");var b=w(require("react-aria-components")),L=require("lucide-react");var u=require("react/jsx-runtime"),Ae=({children:e,isOpen:t,onOpenChange:o,className:r})=>(0,u.jsx)(b.ModalOverlay,{isOpen:t,onOpenChange:o,isDismissable:!0,className:s("fixed inset-0 z-100 bg-black/40 backdrop-blur-sm px-4 py-4 sm:py-20","entering:animate-in entering:fade-in exiting:animate-out exiting:fade-out"),children:(0,u.jsx)(b.Modal,{className:s("mx-auto w-full max-w-2xl overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl ring-1 ring-black/5 outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95",r),children:(0,u.jsx)(b.Dialog,{className:"flex flex-col max-h-[70vh] focus:outline-none",children:e})})}),Be=({children:e,className:t,onSelectionChange:o,...r})=>(0,u.jsx)("div",{className:t,children:(0,u.jsx)(b.Autocomplete,{...r,onSelectionChange:o,className:"flex flex-col min-h-0",children:e})}),Ie=({className:e,...t})=>(0,u.jsxs)(b.SearchField,{className:"flex items-center gap-3 border-b border-border-subtle px-4 py-4",autoFocus:!0,children:[(0,u.jsx)(L.Search,{className:"h-5 w-5 text-text-muted"}),(0,u.jsx)(b.Input,{...t,className:s("w-full bg-transparent text-lg text-text-main placeholder-text-muted outline-none",e),placeholder:"Search documentation..."}),(0,u.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,u.jsx)("kbd",{className:"font-sans",children:"ESC"})})]}),Le=({children:e,className:t,...o})=>(0,u.jsx)(b.ListBox,{...o,className:s("flex-1 overflow-y-auto p-2 outline-none",t),children:e}),Se=({children:e,className:t,...o})=>(0,u.jsx)(b.ListBoxItem,{...o,className:s("group flex items-center gap-3 rounded-lg p-3 text-left outline-none cursor-pointer transition-colors","text-text-muted hover:bg-bg-main hover:text-text-main focus:bg-primary-500 focus:text-white selected:bg-primary-500 selected:text-white",t),children:r=>(0,u.jsxs)(u.Fragment,{children:[e,(r.isFocused||r.isSelected)&&(0,u.jsxs)("div",{className:"ml-auto opacity-50 flex items-center gap-1",children:[(0,u.jsx)("span",{className:"text-[10px]",children:"Select"}),(0,u.jsx)(L.CornerDownLeft,{size:10})]})]})}),Me=({isHeading:e,className:t})=>(0,u.jsx)("div",{className:s("shrink-0",t),children:e?(0,u.jsx)(L.Hash,{size:18}):(0,u.jsx)(L.FileText,{size:18})}),Oe=({children:e,className:t})=>(0,u.jsx)("span",{className:s("block font-medium truncate flex-1 text-sm",t),children:e}),Ee=({children:e,className:t})=>(0,u.jsx)("span",{className:s("ml-2 text-xs opacity-70 truncate hidden sm:inline group-focus:opacity-100",t),children:e}),wo={Root:Ae,Autocomplete:Be,Input:Ie,List:Le,Item:Object.assign(Se,{Icon:Me,Title:Oe,Bio:Ee})};var d=require("react"),De=w(require("scroll-into-view-if-needed"));var U=require("react");function ze(e,t){let o=(0,U.useRef)(e);(0,U.useEffect)(()=>{o.current!==e&&(t(e),o.current=e)},[e,t])}function me(e){return e.startsWith("#")?e.slice(1):null}var A=require("react/jsx-runtime"),ue=(0,d.createContext)(null),Ve=(0,d.createContext)(null),pe=class{items=[];single=!1;observer=null;onChange;callback(t){if(t.length===0)return;let o=!1;if(this.items=this.items.map(r=>{let n=t.find(m=>m.target.id===r.id),i=n?n.isIntersecting:r.active&&!r.fallback;return this.single&&o&&(i=!1),r.active!==i&&(r={...r,t:Date.now(),active:i,fallback:!1}),i&&(o=!0),r}),!o&&t[0].rootBounds){let r=t[0].rootBounds.top,n=Number.MAX_VALUE,i=-1;for(let m=0;m<this.items.length;m++){let l=document.getElementById(this.items[m].id);if(!l)continue;let c=Math.abs(r-l.getBoundingClientRect().top);c<n&&(i=m,n=c)}i!==-1&&(this.items[i]={...this.items[i],active:!0,fallback:!0,t:Date.now()})}this.onChange?.()}setItems(t){let o=this.observer;if(o)for(let r of this.items){let n=document.getElementById(r.id);n&&o.unobserve(n)}this.items=[];for(let r of t){let n=me(r.url);n&&this.items.push({id:n,active:!1,fallback:!1,t:0,original:r})}this.watchItems(),typeof window<"u"&&(setTimeout(()=>this.watchItems(),100),setTimeout(()=>this.watchItems(),500),setTimeout(()=>this.watchItems(),1e3)),this.onChange?.()}watch(t){this.observer||(this.observer=new IntersectionObserver(this.callback.bind(this),t),this.watchItems())}watchItems(){if(this.observer)for(let t of this.items){let o=document.getElementById(t.id);o&&this.observer.observe(o)}}unwatch(){this.observer?.disconnect(),this.observer=null}};function de(){let e=(0,d.use)(ue);if(!e)throw new Error("Component must be used under the <AnchorProvider /> component.");return e}function He(e){let[t,o]=(0,d.useState)({isOverflowing:!1,isAtBottom:!1});return(0,d.useEffect)(()=>{let r=e.current;if(!r)return;let n=()=>{let m=r.scrollHeight>r.clientHeight,l=r.scrollHeight-r.scrollTop<=r.clientHeight+2;o({isOverflowing:m,isAtBottom:l})};n(),r.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n);let i=new MutationObserver(n);return i.observe(r,{childList:!0,subtree:!0}),()=>{r.removeEventListener("scroll",n),window.removeEventListener("resize",n),i.disconnect()}},[e]),t}function St(){let e=de();return(0,d.useMemo)(()=>{let t;for(let o of e)o.active&&(!t||o.t>t.t)&&(t=o);return t?.id},[e])}function Mt(){let e=de();return(0,d.useMemo)(()=>{let t=[];for(let o of e)o.active&&t.push(o.id);return t},[e])}function Ot({containerRef:e,children:t}){return(0,A.jsx)(Ve.Provider,{value:e,children:t})}function Et({toc:e,single:t=!1,children:o}){let r=(0,d.useMemo)(()=>new pe,[]),[n,i]=(0,d.useState)(r.items);return r.single=t,(0,d.useEffect)(()=>{r.setItems(e)},[r,e]),(0,d.useEffect)(()=>(r.watch({rootMargin:"0px",threshold:.98}),r.onChange=()=>i([...r.items]),()=>{r.unwatch()}),[r]),(0,A.jsx)(ue.Provider,{value:n,children:o})}var zt=({children:e,className:t})=>(0,A.jsx)("nav",{className:s("sticky top-navbar hidden xl:flex flex-col shrink-0","w-toc","py-8 pl-6 pr-4",t),children:e}),Dt=({children:e,className:t,...o})=>(0,A.jsx)("div",{className:s("mb-4 text-xs font-bold uppercase tracking-wider text-text-main",t),...o,children:e}),We=({children:e,className:t,ref:o,...r})=>{let n=(0,d.useRef)(null);(0,d.useImperativeHandle)(o,()=>n.current);let{isOverflowing:i,isAtBottom:m}=He(n);return(0,A.jsx)("div",{ref:n,className:s("relative overflow-y-auto boltdocs-otp-content",i&&!m&&"mask-[linear-gradient(to_bottom,black_85%,transparent_100%)]",t),...r,children:e})};We.displayName="OnThisPageContent";var Vt=({children:e,className:t})=>(0,A.jsx)("ul",{className:s("relative space-y-1 text-sm border-l border-border-subtle",t),children:e}),Ht=({level:e,children:t,className:o})=>(0,A.jsx)("li",{className:s(e===3&&"pl-3",o),children:t}),Wt=({children:e,href:t,active:o,onClick:r,className:n})=>{let i=(0,d.use)(ue),m=(0,d.use)(Ve),l=t?me(t):null,c=(0,d.useRef)(null),[C,y]=(0,d.useState)(o);return ze(l&&i?i.find(g=>g.id===l)?.active:null,g=>{g!==null&&g!==C&&(y(!!g),g&&c.current&&m?.current&&(0,De.default)(c.current,{behavior:"smooth",block:"center",inline:"center",scrollMode:"if-needed",boundary:m.current}))}),(0,d.useEffect)(()=>{o!==void 0&&y(o)},[o]),(0,A.jsx)("a",{ref:c,href:t,onClick:r,"data-active":C,className:s("block py-1 pl-4 text-[13px] outline-none transition-colors hover:text-text-main",C?"text-primary-500 font-medium":"text-text-muted",n),children:e})},Ft=({style:e,className:t})=>(0,A.jsx)("div",{className:s("absolute -left-px w-0.5 rounded-full bg-primary-500 transition-all duration-300",t),style:e});var Fe=w(require("react-aria-components")),Z=require("lucide-react");var R=require("react/jsx-runtime"),Ge=({children:e,className:t})=>(0,R.jsx)("nav",{className:s("grid grid-cols-1 sm:grid-cols-2 gap-4 mt-12 pt-8 border-t border-border-subtle",t),children:e}),je=({children:e,to:t,direction:o,className:r})=>{let n=o==="next";return(0,R.jsxs)(Fe.Link,{href:t,className:s("flex group items-center p-4 rounded-xl border border-border-subtle bg-bg-surface outline-none","transition-all hover:bg-bg-main hover:border-primary-500 hover:shadow-lg","focus-visible:ring-2 focus-visible:ring-primary-500/30",n?"text-right justify-end":"text-left justify-start",r),children:[!n&&(0,R.jsx)(Z.ChevronLeft,{className:"mr-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:-translate-x-1"}),(0,R.jsx)("div",{className:"flex flex-col gap-1 flex-1",children:e}),n&&(0,R.jsx)(Z.ChevronRight,{className:"ml-3 h-5 w-5 text-text-muted group-hover:text-primary-500 transition-transform group-hover:translate-x-1"})]})},_e=({children:e,className:t})=>(0,R.jsx)("span",{className:s("text-xs font-medium uppercase tracking-wider text-text-muted",t),children:e}),Ke=({children:e,className:t})=>(0,R.jsx)("span",{className:s("text-base font-bold text-text-main truncate",t),children:e}),Xe=({children:e})=>(0,R.jsx)(R.Fragment,{children:e}),Ho={PageNavRoot:Ge,PageNavLink:Object.assign(je,{Title:_e,Description:Ke,Icon:Xe})};var M=require("react/jsx-runtime"),Gt=({children:e,className:t="",...o})=>(0,M.jsx)("div",{className:s("w-full",t),...o,children:e}),jt=({children:e,className:t=""})=>(0,M.jsx)("div",{role:"tablist",className:s("relative flex flex-row items-center border-b border-border-subtle",t),children:e}),_t=({children:e,id:t,selected:o,className:r="",...n})=>(0,M.jsx)("button",{role:"tab","aria-selected":o,className:s("flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors outline-none cursor-pointer bg-transparent border-none",o?"text-primary-500":"text-text-muted hover:text-text-main",r),...n,children:e}),Kt=({children:e,className:t=""})=>(0,M.jsx)("div",{className:s("p-4 outline-none",t),children:e}),Xt=({className:e="",style:t})=>(0,M.jsx)("div",{className:s("absolute bottom-0 h-0.5 bg-primary-500 transition-all duration-300",e),style:t});var ge=w(require("react")),Je=require("react-aria-components"),qe=require("react-router-dom");var $=require("react"),Ut=(0,$.createContext)(null);function J(){let e=(0,$.use)(Ut);if(!e)throw new Error("useConfig must be used within a ConfigProvider");return e}var Ze=require("react-router-dom");var O=require("react"),$t=require("react/jsx-runtime"),Zt=(0,O.createContext)({preload:()=>{},routes:[]});function q(){return(0,O.use)(Zt)}var Ue=require("zustand"),Q=require("zustand/middleware"),Y=(0,Ue.create)()((0,Q.persist)(e=>({currentLocale:void 0,currentVersion:void 0,hasHydrated:!1,setLocale:t=>e({currentLocale:t}),setVersion:t=>e({currentVersion:t}),setHasHydrated:t=>e({hasHydrated:t})}),{name:"boltdocs-storage",storage:(0,Q.createJSONStorage)(()=>localStorage),partialize:e=>({currentLocale:e.currentLocale,currentVersion:e.currentVersion}),onRehydrateStorage:()=>e=>{e?.setHasHydrated(!0)}}));function $e(){let{routes:e}=q(),t=J(),o=(0,Ze.useLocation)(),r=Y(p=>p.currentLocale),n=Y(p=>p.currentVersion),i=Y(p=>p.hasHydrated),m=e.find(p=>p.path===o.pathname),l=t.i18n?m?.locale||(i?r:void 0)||t.i18n.defaultLocale:void 0,c=t.versions?m?.version||(i?n:void 0)||t.versions.defaultVersion:void 0,C=e.filter(p=>{let oe=t.i18n?(p.locale||t.i18n.defaultLocale)===l:!0,re=t.versions?(p.version||t.versions.defaultVersion)===c:!0;if(!(oe&&re))return!1;let ne=t.i18n;if(ne){let it=!!m?.locale,at=!!p.locale;if(e.some(j=>j!==p&&j.filePath===p.filePath&&j.version===p.version&&(j.locale||ne.defaultLocale)===(p.locale||ne.defaultLocale))&&it!==at)return!1}return!0}),g=t.i18n?.localeConfigs?.[l]?.label||t.i18n?.locales[l]||l,S=t.versions?.versions.find(p=>p.path===c)?.label||c,nt=t.i18n?Object.entries(t.i18n.locales).map(([p,oe])=>{let re=t.i18n?.localeConfigs?.[p];return{key:p,label:re?.label||oe,isCurrent:p===l}}):[],st=t.versions?t.versions.versions.map(p=>({key:p.path,label:p.label,isCurrent:p.path===c})):[];return{routes:C,allRoutes:e,currentRoute:m,currentLocale:l,currentLocaleLabel:g,availableLocales:nt,currentVersion:c,currentVersionLabel:S,availableVersions:st,config:t}}function fe(e){let t=J(),{currentLocale:o,currentVersion:r}=$e();if(!t||typeof e!="string"||e.startsWith("http")||e.startsWith("//"))return e;let n=t.i18n,i=t.versions;if(!n&&!i)return e;let m=e.startsWith("/docs"),l=e.split("/").filter(Boolean),c=0;l[c]==="docs"&&c++,i&&l.length>c&&i.versions.find(S=>S.path===l[c])&&c++,n&&l.length>c&&n.locales[l[c]]&&c++;let C=l.slice(c),y=[];m&&(y.push("docs"),i&&r&&y.push(r)),n&&o&&o!==n.defaultLocale&&y.push(o),y.push(...C);let g=`/${y.join("/")}`;return g.length>1&&g.endsWith("/")?g.slice(0,-1):g||"/"}var xe=require("react/jsx-runtime"),B=ge.default.forwardRef((e,t)=>{let{href:o,prefetch:r="hover",onMouseEnter:n,onFocus:i,...m}=e,l=fe(o??""),{preload:c}=q();return(0,xe.jsx)(Je.Link,{...m,ref:t,href:l,onMouseEnter:g=>{n?.(g),r==="hover"&&typeof l=="string"&&l.startsWith("/")&&c(l)},onFocus:g=>{i?.(g),r==="hover"&&typeof l=="string"&&l.startsWith("/")&&c(l)}})});B.displayName="Link";var Qe=ge.default.forwardRef((e,t)=>{let{href:o,end:r=!1,className:n,children:i,...m}=e,l=(0,qe.useLocation)(),c=fe(o??""),C=r?l.pathname===c:l.pathname.startsWith(c),y=typeof n=="function"?n({isActive:C}):s(n,C&&"active"),g=typeof i=="function"?i({isActive:C}):i;return(0,xe.jsx)(B,{...m,ref:t,href:o,className:y,children:g})});Qe.displayName="NavLink";var Ye=w(require("react-aria-components")),et=require("lucide-react");var v=require("react/jsx-runtime"),Jt=({badge:e})=>{let t={new:"bg-primary-500/20 text-primary-500",updated:"bg-gray-500/20 text-gray-500",deprecated:"bg-red-500/20 text-red-500"};if(typeof e=="object"&&e?.expires){let r=new Date(e.expires),n=new Date,i=r.getTime()-n.getTime();if(Math.ceil(i/(1e3*60*60*24))===0)return null}let o=typeof e=="string"?e:e?.text;return(0,v.jsx)("span",{className:s("ml-auto flex h-4.5 items-center rounded-full text-[9px] font-medium px-1.5 py-0.5 text-center whitespace-nowrap",t[o]||t.new),children:o})},qt=({children:e,className:t})=>(0,v.jsx)("aside",{className:s("boltdocs-sidebar sticky top-navbar hidden lg:flex flex-col shrink-0","w-sidebar h-full","overflow-y-auto border-r border-border-subtle bg-bg-main","py-6 px-4",t),children:(0,v.jsx)("nav",{className:"flex-1 space-y-6",children:e})}),Qt=({children:e,title:t,icon:o,isOpen:r=!0,onToggle:n,className:i})=>(0,v.jsxs)("div",{className:s("space-y-1",i),children:[t&&(0,v.jsxs)(Ye.Button,{onPress:n,className:s("flex w-full items-center justify-between px-2 py-1.5 text-xs font-bold uppercase tracking-wider outline-none cursor-pointer","text-text-muted hover:text-text-main transition-colors","focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-md"),children:[(0,v.jsxs)("div",{className:"flex items-center gap-2",children:[o&&(0,v.jsx)(o,{size:14}),t]}),(0,v.jsx)(et.ChevronRight,{size:14,className:s("transition-transform duration-200",r&&"rotate-90")})]}),r&&(0,v.jsx)("div",{className:"space-y-0.5",children:e})]}),Yt=({children:e,className:t})=>(0,v.jsx)("div",{className:s(t),children:e}),eo=({label:e,href:t,active:o,icon:r,badge:n,className:i})=>(0,v.jsxs)(B,{href:t,className:s("group flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none","transition-all duration-200 ease-in-out","focus-visible:ring-2 focus-visible:ring-primary-500/30",o?"bg-primary-500/10 text-primary-500 font-medium":"text-text-muted hover:bg-bg-surface hover:text-text-main hover:translate-x-1",i),children:[r&&(0,v.jsx)(r,{size:16,className:s(o?"text-primary-500":"text-text-muted group-hover:text-text-main")}),(0,v.jsx)("span",{className:"truncate",children:e}),n&&(0,v.jsx)(Jt,{badge:n})]});var E=require("react-aria-components"),tt=require("lucide-react");var G=require("react/jsx-runtime"),to=({children:e,className:t,...o})=>(0,G.jsx)(E.Breadcrumbs,{className:s("flex items-center gap-1.5 pl-0! mb-0 text-sm text-text-muted",t),...o,children:e}),oo=({children:e,className:t,...o})=>(0,G.jsx)(E.Breadcrumb,{className:s("flex items-center mb-0 gap-1.5",t),...o,children:e}),ro=({children:e,href:t,className:o,...r})=>(0,G.jsx)(E.Link,{href:t,className:s("transition-colors outline-none hover:text-text-main focus-visible:ring-2 focus-visible:ring-primary-500/30 rounded-sm","current:font-medium current:text-text-main current:pointer-events-none cursor-pointer",o),...r,children:e}),no=({className:e})=>(0,G.jsx)(tt.ChevronRight,{size:14,className:s("shrink-0 text-text-dim",e)});var ee=w(require("react-aria-components"));var ot=require("class-variance-authority"),T=require("react/jsx-runtime"),he=(0,ot.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"}}),se=({href:e,icon:t,iconPosition:o="left",isIconOnly:r,children:n,className:i,variant:m,size:l,rounded:c,iconSize:C,disabled:y,...g})=>{let W=r||!n&&!!t,S=W?(0,T.jsx)("span",{className:"inline-flex items-center justify-center [&>svg]:w-[1.2rem] [&>svg]:h-[1.2rem]",children:t}):(0,T.jsxs)(T.Fragment,{children:[t&&o==="left"&&(0,T.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t}),(0,T.jsx)("span",{className:"flex items-center",children:n}),t&&o==="right"&&(0,T.jsx)("span",{className:"inline-flex items-center shrink-0 [&>svg]:w-[1.1rem] [&>svg]:h-[1.1rem]",children:t})]});return e?(0,T.jsx)(ee.Link,{href:e,className:s(he({variant:m,size:l,rounded:c,iconSize:W?C:void 0,disabled:y}),i),...g,children:S}):(0,T.jsx)(ee.Button,{className:s(he({variant:m,size:l,rounded:c,iconSize:W?C:void 0,disabled:y}),i),...g,children:S})};var rt=require("react/jsx-runtime"),so=({children:e,className:t,vertical:o=!1})=>(0,rt.jsx)("div",{className:s("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 V=require("lucide-react"),be=w(require("react")),h=w(require("react-aria-components"));var D=w(require("react-aria-components"));var z=require("react/jsx-runtime"),te=({children:e,className:t,showArrow:o,...r})=>(0,z.jsxs)(D.Popover,{offset:8,...r,className:D.composeRenderProps(t,n=>s("z-50 overflow-auto rounded-xl border border-border-subtle bg-bg-surface/80 shadow-xl backdrop-blur-md outline-none","entering:animate-in entering:fade-in entering:zoom-in-95 exiting:animate-out exiting:fade-out exiting:zoom-out-95 fill-mode-forwards",n)),children:[o&&(0,z.jsx)(D.OverlayArrow,{className:"group",children:(0,z.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,z.jsx)("path",{d:"M0 0 L6 6 L12 0"})})}),e]});var x=require("react/jsx-runtime");function ie(e){let[t,o]=be.default.Children.toArray(e.children).slice(0,2);return(0,x.jsxs)(h.MenuTrigger,{...e,children:[t,(0,x.jsx)(te,{placement:e.placement,className:"min-w-[200px]",children:o})]})}function io(e){let[t,o]=be.default.Children.toArray(e.children).slice(0,2);return(0,x.jsxs)(h.SubmenuTrigger,{...e,children:[t,(0,x.jsx)(te,{offset:-4,crossOffset:-4,children:o})]})}function ae(e){return(0,x.jsx)(h.Menu,{...e,className:h.composeRenderProps(e.className,t=>s("p-1.5 outline-none max-h-[inherit] overflow-auto",t))})}function le(e){let t=e.textValue||(typeof e.children=="string"?e.children:void 0);return(0,x.jsx)(h.MenuItem,{...e,textValue:t,className:h.composeRenderProps(e.className,(o,{isFocused:r,isPressed:n,isDisabled:i})=>s("group relative flex flex-row items-center gap-2.5 px-3 py-1.5 rounded-lg outline-none cursor-default transition-all duration-200","text-text-main text-[0.8125rem]",r&&"bg-primary-500/10 text-primary-600 shadow-sm",n&&"scale-[0.98] bg-primary-500/15",i&&"opacity-40 grayscale pointer-events-none",o)),children:h.composeRenderProps(e.children,(o,{selectionMode:r,isSelected:n,hasSubmenu:i})=>(0,x.jsxs)(x.Fragment,{children:[r!=="none"&&(0,x.jsxs)("span",{className:"flex items-center w-4 h-4 shrink-0 justify-center",children:[n&&r==="multiple"&&(0,x.jsx)(V.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,x.jsx)(V.Dot,{className:"w-6 h-6 text-primary-500 animate-in zoom-in-50 duration-200"})]}),(0,x.jsx)("div",{className:"flex-1 flex flex-row items-center gap-2.5 truncate font-medium",children:o}),i&&(0,x.jsx)(V.ChevronRight,{className:"w-4 h-4 ml-auto text-text-muted group-focused:text-primary-500/70 transition-colors"})]}))})}function ao({title:e,...t}){return(0,x.jsxs)(h.MenuSection,{...t,className:s("flex flex-col gap-0.5",t.className),children:[e&&(0,x.jsx)(h.Header,{className:"px-3 py-2 text-[10px] font-bold uppercase tracking-[0.075em] text-text-muted/50 select-none",children:e}),(0,x.jsx)(h.Collection,{items:t.items,children:t.children})]})}function lo(e){return(0,x.jsx)(h.Separator,{...e,className:"mx-2 my-1.5 border-t border-border-subtle/50"})}var H=w(require("react-aria-components"));var P=require("react/jsx-runtime"),co=({className:e,children:t,...o})=>(0,P.jsx)(H.Tooltip,{...o,offset:8,className:r=>s("group z-50 overflow-visible rounded-md bg-bg-surface/90 px-2.5 py-1.5 text-xs font-medium text-text-main shadow-lg backdrop-blur-md ring-1 ring-border-subtle outline-hidden select-none","data-entering:animate-in data-entering:fade-in data-entering:zoom-in-95 data-entering:duration-100","data-exiting:animate-out data-exiting:fade-out data-exiting:zoom-out-95 data-exiting:duration-75","data-[placement=top]:slide-in-from-bottom-1","data-[placement=bottom]:slide-in-from-top-1","data-[placement=left]:slide-in-from-right-1","data-[placement=right]:slide-in-from-left-1",typeof e=="function"?e(r):e),children:r=>(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(H.OverlayArrow,{children:(0,P.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,P.jsx)("title",{children:"Arrow"}),(0,P.jsx)("path",{d:"M0 0 L4 4 L8 0"})]})}),typeof t=="function"?t(r):t]})}),mo=({content:e,children:t,delay:o=500,closeDelay:r=0,...n})=>(0,P.jsxs)(H.TooltipTrigger,{delay:o,closeDelay:r,children:[t,(0,P.jsx)(co,{...n,children:e})]});var I=require("react-aria-components");
@@ -1 +1 @@
1
- import{$ as W,A as x,B as y,C as z,D as A,E as B,F as C,G as D,H as E,I as F,J as G,K as H,L as I,M as J,N as K,O as L,P as M,Q as N,R as O,S as P,T as Q,V as R,W as S,X as T,Y as U,Z as V,a,aa as X,b,ba as Y,c,ca as Z,d,da as _,e,fa as $,ga as aa,h as f,ha as ba,i as g,ia as ca,j as h,k as i,ka as da,l as j,la as ea,m as k,ma as fa,n as l,na as ga,o as m,oa as ha,p as n,pa as ia,q as o,qa as ja,r as p,ra as ka,s as q,sa as la,t as r,ta as ma,u as s,ua as na,v as t,va as oa,w as u,x as v,xa as pa,ya as qa,z as w}from"../chunk-ZRJ55GGF.mjs";import"../chunk-NBCYHLAA.mjs";import"../chunk-JZXLCA2E.mjs";export{J as AnchorProvider,ea as BreadcrumbsItem,fa as BreadcrumbsLink,da as BreadcrumbsRoot,ga as BreadcrumbsSeparator,e as Button,ha as ButtonGroup,t as Icon,b as Link,la as Menu,ma as MenuItem,na as MenuSection,oa as MenuSeparator,ja as MenuTrigger,c as NavLink,k as NavbarCenter,h as NavbarContent,s as NavbarItem,i as NavbarLeft,o as NavbarLink,n as NavbarLinks,l as NavbarLogo,r as NavbarMenu,j as NavbarRight,g as NavbarRoot,p as NavbarSearchTrigger,u as NavbarSocials,v as NavbarSplit,q as NavbarTheme,m as NavbarTitle,M as OnThisPageContent,L as OnThisPageHeader,Q as OnThisPageIndicator,O as OnThisPageItem,P as OnThisPageLink,N as OnThisPageList,K as OnThisPageRoot,U as PageNavDescription,V as PageNavIcon,S as PageNavLink,R as PageNavRoot,T as PageNavTitle,ia as Popover,I as ScrollProvider,x as SearchDialogAutocomplete,y as SearchDialogInput,D as SearchDialogItemBio,B as SearchDialogItemIcon,A as SearchDialogItemRoot,C as SearchDialogItemTitle,z as SearchDialogList,w as SearchDialogRoot,pa as Separator,aa as SidebarGroup,ba as SidebarGroupItem,ca as SidebarLink,$ as SidebarRoot,ka as SubmenuTrigger,Z as TabsContent,_ as TabsIndicator,Y as TabsItem,X as TabsList,W as TabsRoot,qa as ToggleButton,f as Tooltip,d as buttonVariants,a as cn,G as useActiveAnchor,H as useActiveAnchors,E as useItems,F as useScrollStatus};
1
+ import{$ as W,A as x,B as y,C as z,D as A,E as B,F as C,G as D,H as E,I as F,J as G,K as H,L as I,M as J,N as K,O as L,P as M,Q as N,R as O,S as P,T as Q,V as R,W as S,X as T,Y as U,Z as V,a,aa as X,b,ba as Y,c,ca as Z,d,da as _,e,fa as $,ga as aa,h as f,ha as ba,i as g,ia as ca,j as h,k as i,ka as da,l as j,la as ea,m as k,ma as fa,n as l,na as ga,o as m,oa as ha,p as n,pa as ia,q as o,qa as ja,r as p,ra as ka,s as q,sa as la,t as r,ta as ma,u as s,ua as na,v as t,va as oa,w as u,x as v,xa as pa,ya as qa,z as w}from"../chunk-W2NB4T6V.mjs";import"../chunk-NBCYHLAA.mjs";import"../chunk-JZXLCA2E.mjs";export{J as AnchorProvider,ea as BreadcrumbsItem,fa as BreadcrumbsLink,da as BreadcrumbsRoot,ga as BreadcrumbsSeparator,e as Button,ha as ButtonGroup,t as Icon,b as Link,la as Menu,ma as MenuItem,na as MenuSection,oa as MenuSeparator,ja as MenuTrigger,c as NavLink,k as NavbarCenter,h as NavbarContent,s as NavbarItem,i as NavbarLeft,o as NavbarLink,n as NavbarLinks,l as NavbarLogo,r as NavbarMenu,j as NavbarRight,g as NavbarRoot,p as NavbarSearchTrigger,u as NavbarSocials,v as NavbarSplit,q as NavbarTheme,m as NavbarTitle,M as OnThisPageContent,L as OnThisPageHeader,Q as OnThisPageIndicator,O as OnThisPageItem,P as OnThisPageLink,N as OnThisPageList,K as OnThisPageRoot,U as PageNavDescription,V as PageNavIcon,S as PageNavLink,R as PageNavRoot,T as PageNavTitle,ia as Popover,I as ScrollProvider,x as SearchDialogAutocomplete,y as SearchDialogInput,D as SearchDialogItemBio,B as SearchDialogItemIcon,A as SearchDialogItemRoot,C as SearchDialogItemTitle,z as SearchDialogList,w as SearchDialogRoot,pa as Separator,aa as SidebarGroup,ba as SidebarGroupItem,ca as SidebarLink,$ as SidebarRoot,ka as SubmenuTrigger,Z as TabsContent,_ as TabsIndicator,Y as TabsItem,X as TabsList,W as TabsRoot,qa as ToggleButton,f as Tooltip,d as buttonVariants,a as cn,G as useActiveAnchor,H as useActiveAnchors,E as useItems,F as useScrollStatus};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-HA6543SL.mjs";import"./chunk-2Z5T6EAU.mjs";import"./chunk-W2NB4T6V.mjs";import"./chunk-NBCYHLAA.mjs";import"./chunk-JZXLCA2E.mjs";export{a as SearchDialog};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "boltdocs",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "A lightweight documentation generator for React projects.",
5
5
  "main": "dist/node/index.js",
6
6
  "module": "dist/node/index.mjs",
@@ -88,6 +88,7 @@
88
88
  "clsx": "^2.1.1",
89
89
  "codesandbox": "^2.2.3",
90
90
  "fast-glob": "^3.3.3",
91
+ "flexsearch": "^0.8.212",
91
92
  "github-slugger": "^2.0.0",
92
93
  "gray-matter": "^4.0.3",
93
94
  "isomorphic-dompurify": "^3.7.1",
@@ -19,12 +19,15 @@ export function ThemeProvider({ children }: { children: React.ReactNode }) {
19
19
  useEffect(() => {
20
20
  setMounted(true)
21
21
  const stored = localStorage.getItem('boltdocs-theme') as Theme | null
22
- const initialTheme = (stored === 'light' || stored === 'dark' || stored === 'system') ? stored : 'system'
23
-
22
+ const initialTheme =
23
+ stored === 'light' || stored === 'dark' || stored === 'system'
24
+ ? stored
25
+ : 'system'
26
+
24
27
  setThemeState(initialTheme)
25
28
 
26
29
  const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)')
27
-
30
+
28
31
  const updateResolved = (currentTheme: Theme, isDark: boolean) => {
29
32
  if (currentTheme === 'system') {
30
33
  setResolvedTheme(isDark ? 'dark' : 'light')
@@ -37,10 +40,11 @@ export function ThemeProvider({ children }: { children: React.ReactNode }) {
37
40
 
38
41
  const handleChange = (e: MediaQueryListEvent) => {
39
42
  // Re-read current theme state from some stable ref would be better, but we can capture it
40
- // actually, the second useEffect will handle the source of truth,
43
+ // actually, the second useEffect will handle the source of truth,
41
44
  // but this listener ensures 'system' updates instantly.
42
45
  setResolvedTheme((prevResolved) => {
43
- const currentTheme = localStorage.getItem('boltdocs-theme') as Theme || 'system'
46
+ const currentTheme =
47
+ (localStorage.getItem('boltdocs-theme') as Theme) || 'system'
44
48
  if (currentTheme === 'system') {
45
49
  return e.matches ? 'dark' : 'light'
46
50
  }
@@ -56,8 +60,11 @@ export function ThemeProvider({ children }: { children: React.ReactNode }) {
56
60
  useEffect(() => {
57
61
  if (!mounted) return
58
62
 
59
- const isSystemDark = window.matchMedia('(prefers-color-scheme: dark)').matches
60
- const nextResolved = theme === 'system' ? (isSystemDark ? 'dark' : 'light') : theme
63
+ const isSystemDark = window.matchMedia(
64
+ '(prefers-color-scheme: dark)',
65
+ ).matches
66
+ const nextResolved =
67
+ theme === 'system' ? (isSystemDark ? 'dark' : 'light') : theme
61
68
 
62
69
  setResolvedTheme(nextResolved as 'light' | 'dark')
63
70
 
@@ -42,8 +42,12 @@ export function DefaultLayout({ children }: LayoutProps) {
42
42
  <DocsLayout>
43
43
  <ProgressBar />
44
44
  <Head
45
- siteTitle={getTranslated(config.theme?.title, currentLocale) || 'Boltdocs'}
46
- siteDescription={getTranslated(config.theme?.description, currentLocale) || ''}
45
+ siteTitle={
46
+ getTranslated(config.theme?.title, currentLocale) || 'Boltdocs'
47
+ }
48
+ siteDescription={
49
+ getTranslated(config.theme?.description, currentLocale) || ''
50
+ }
47
51
  routes={allRoutes}
48
52
  />
49
53
  <Navbar />
@@ -214,7 +214,7 @@ export const NavbarSearchTrigger = ({
214
214
  onPress={onPress}
215
215
  className={cn(
216
216
  'flex items-center gap-2 rounded-full border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-muted outline-none cursor-pointer',
217
- 'transition-colors hover:border-border-strong hover:text-text-main',
217
+ 'transition-all duration-200 hover:border-border-strong hover:text-text-main hover:bg-bg-muted hover:shadow-sm active:scale-[0.98]',
218
218
  'focus-visible:ring-2 focus-visible:ring-primary-500/30',
219
219
  'w-full max-w-[320px] justify-between',
220
220
  className,
@@ -246,8 +246,8 @@ export const NavbarTheme = ({
246
246
  isSelected={theme === 'dark'}
247
247
  onChange={onThemeChange}
248
248
  className={cn(
249
- 'rounded-md p-2 text-text-muted outline-none cursor-pointer transition-colors',
250
- 'hover:bg-bg-surface hover:text-text-main',
249
+ 'rounded-md p-2 text-text-muted outline-none cursor-pointer',
250
+ 'transition-all duration-300 hover:bg-bg-surface hover:text-text-main hover:rotate-12 active:scale-90',
251
251
  'focus-visible:ring-2 focus-visible:ring-primary-500/30',
252
252
  className,
253
253
  )}
@@ -50,12 +50,12 @@ export const SearchDialogRoot = ({
50
50
  )
51
51
  }
52
52
 
53
- export const SearchDialogAutocomplete = ({
53
+ export const SearchDialogAutocomplete = <T extends object>({
54
54
  children,
55
55
  className,
56
56
  onSelectionChange,
57
57
  ...props
58
- }: RAC.AutocompleteProps<object> & {
58
+ }: RAC.AutocompleteProps<T> & {
59
59
  className?: string
60
60
  onSelectionChange?: (key: RAC.Key) => void
61
61
  }) => {
@@ -98,11 +98,11 @@ export const SearchDialogInput = ({
98
98
  )
99
99
  }
100
100
 
101
- export const SearchDialogList = ({
101
+ export const SearchDialogList = <T extends object>({
102
102
  children,
103
103
  className,
104
104
  ...props
105
- }: RAC.ListBoxProps<object> & { className?: string }) => {
105
+ }: RAC.ListBoxProps<T> & { className?: string }) => {
106
106
  return (
107
107
  <RAC.ListBox
108
108
  {...props}
@@ -122,11 +122,12 @@ export const SidebarLink = ({
122
122
  <Link
123
123
  href={href}
124
124
  className={cn(
125
- 'group flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none transition-colors',
125
+ 'group flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm outline-none',
126
+ 'transition-all duration-200 ease-in-out',
126
127
  'focus-visible:ring-2 focus-visible:ring-primary-500/30',
127
128
  active
128
129
  ? 'bg-primary-500/10 text-primary-500 font-medium'
129
- : 'text-text-muted hover:bg-bg-surface hover:text-text-main',
130
+ : 'text-text-muted hover:bg-bg-surface hover:text-text-main hover:translate-x-1',
130
131
  className,
131
132
  )}
132
133
  >