@stacksjs/stx 0.2.668 → 0.2.669

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 (79) hide show
  1. package/dist/{chunk-sme31jbj.js → chunk-03wssg2z.js} +1 -1
  2. package/dist/{chunk-8kskjg62.js → chunk-0q0tpmr5.js} +1 -1
  3. package/dist/chunk-0zrskbkk.js +2 -0
  4. package/dist/{chunk-kpeep7gq.js → chunk-144yp2bw.js} +1 -1
  5. package/dist/{chunk-heh151bn.js → chunk-1cnwcn01.js} +1 -1
  6. package/dist/{chunk-6by8f7n9.js → chunk-1mz8fw0m.js} +4 -4
  7. package/dist/chunk-21jz51jg.js +2 -0
  8. package/dist/chunk-2bspyg11.js +2 -0
  9. package/dist/{chunk-4m1hye28.js → chunk-43r0hjne.js} +1 -1
  10. package/dist/{chunk-zcz97ber.js → chunk-4b1ed4qv.js} +1 -1
  11. package/dist/chunk-5hqrw558.js +2 -0
  12. package/dist/{chunk-c4qebqmk.js → chunk-5j970c0z.js} +1 -1
  13. package/dist/{chunk-wesafj4a.js → chunk-5pe26hxm.js} +1 -1
  14. package/dist/{chunk-hkqhpckf.js → chunk-604yfrmq.js} +1 -1
  15. package/dist/{chunk-65b6cy92.js → chunk-679tc0c4.js} +1 -1
  16. package/dist/{chunk-t7jxkrbx.js → chunk-7n7078xp.js} +1 -1
  17. package/dist/chunk-7nsb5pxp.js +2 -0
  18. package/dist/chunk-7tp1j22e.js +2 -0
  19. package/dist/{chunk-6z2sdfac.js → chunk-87bs5f18.js} +1 -1
  20. package/dist/{chunk-k5mez1vx.js → chunk-8rx1bves.js} +1 -1
  21. package/dist/{chunk-fmkcc7g1.js → chunk-8w9z30yx.js} +1 -1
  22. package/dist/{chunk-s5w3t7xw.js → chunk-9hngzqp5.js} +1 -1
  23. package/dist/{chunk-zdgsj39g.js → chunk-ackk8wq5.js} +1 -1
  24. package/dist/{chunk-cyq1jcg2.js → chunk-b5ktzth7.js} +5 -5
  25. package/dist/{chunk-x986xz7h.js → chunk-b7vz9m5q.js} +1 -1
  26. package/dist/{chunk-3641xvaw.js → chunk-bmd035rk.js} +1 -1
  27. package/dist/{chunk-ca6vx6vg.js → chunk-cca86043.js} +1 -1
  28. package/dist/{chunk-493x6e71.js → chunk-d2zzqfgq.js} +2 -2
  29. package/dist/{chunk-2hxwds8c.js → chunk-d5d1b6w0.js} +1 -1
  30. package/dist/{chunk-cba7953e.js → chunk-e7wxt37f.js} +1 -1
  31. package/dist/{chunk-fpz59dhz.js → chunk-ea7ekakt.js} +4 -4
  32. package/dist/{chunk-61n06wra.js → chunk-ev0t17cq.js} +1 -1
  33. package/dist/{chunk-6tngeb4b.js → chunk-fpbff6s1.js} +1 -1
  34. package/dist/{chunk-fb93n9ts.js → chunk-gea2ty3e.js} +1 -1
  35. package/dist/{chunk-41cvkdcm.js → chunk-gmgdmsdz.js} +1 -1
  36. package/dist/{chunk-02gn092e.js → chunk-hesyghn7.js} +1 -1
  37. package/dist/{chunk-vfba7nz5.js → chunk-hnx88y3p.js} +21 -20
  38. package/dist/{chunk-tq0bgaae.js → chunk-j10smv8e.js} +1 -1
  39. package/dist/{chunk-4teqcbw0.js → chunk-jf1vs526.js} +2 -2
  40. package/dist/{chunk-c3dk9pkf.js → chunk-jsqh5fyn.js} +1 -1
  41. package/dist/{chunk-0hemydnd.js → chunk-jz6t1nes.js} +1 -1
  42. package/dist/{chunk-e8gcqp8w.js → chunk-kd6qactf.js} +2 -2
  43. package/dist/{chunk-rcefnd1g.js → chunk-ken0q08p.js} +5 -5
  44. package/dist/chunk-kff0hgg5.js +2 -0
  45. package/dist/chunk-m1ggzh60.js +2 -0
  46. package/dist/{chunk-vg9bz5zs.js → chunk-mezzmwc5.js} +1 -1
  47. package/dist/chunk-msm3gqay.js +2 -0
  48. package/dist/{chunk-t01c62y5.js → chunk-ndhkwfyq.js} +1 -1
  49. package/dist/{chunk-9edksf8x.js → chunk-nt7jxmpy.js} +1 -1
  50. package/dist/{chunk-hm9jt1p9.js → chunk-nx6d1hj7.js} +1 -1
  51. package/dist/{chunk-9k2wz3k1.js → chunk-nytb5e4v.js} +2 -2
  52. package/dist/{chunk-dtjybwtz.js → chunk-nzj3a6mj.js} +1 -1
  53. package/dist/{chunk-vdjj4vrp.js → chunk-p23sz4rr.js} +6 -6
  54. package/dist/{chunk-3n9vaxnt.js → chunk-p5sjezzx.js} +1 -1
  55. package/dist/{chunk-w6x8m0tz.js → chunk-xrdrwrfe.js} +1 -1
  56. package/dist/chunk-y1kaq1cd.js +2 -0
  57. package/dist/{chunk-060298px.js → chunk-ynyssmdy.js} +2 -2
  58. package/dist/{chunk-avph47dc.js → chunk-ys3tmk8w.js} +1 -1
  59. package/dist/{chunk-ynh1ppa6.js → chunk-ywqs7x8g.js} +1 -1
  60. package/dist/{chunk-9vaz5f9j.js → chunk-zshhn7nz.js} +1 -1
  61. package/dist/{chunk-dy5j389v.js → chunk-ztp2rgpp.js} +2 -2
  62. package/dist/cli.js +7 -7
  63. package/dist/craft-entry.js +1 -1
  64. package/dist/craft.js +1 -1
  65. package/dist/native/compiler/html-to-ir.js +33 -1
  66. package/dist/native/compiler/layout-chrome.js +51 -4
  67. package/dist/pwa.js +1 -1
  68. package/dist/ssg.js +2 -2
  69. package/package.json +5 -5
  70. package/dist/chunk-2ecgyqam.js +0 -2
  71. package/dist/chunk-gkmpr64n.js +0 -2
  72. package/dist/chunk-hj0raner.js +0 -2
  73. package/dist/chunk-hx9cn2s4.js +0 -2
  74. package/dist/chunk-n7a33e3v.js +0 -2
  75. package/dist/chunk-r7cenpxp.js +0 -2
  76. package/dist/chunk-sz6xdz4h.js +0 -2
  77. package/dist/chunk-tw0wc95k.js +0 -2
  78. package/dist/chunk-v0091n1g.js +0 -2
  79. package/dist/chunk-vryzt0p0.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{t,a}from"./chunk-2dp7hyv7.js";import{n,pn,m}from"./chunk-vdjj4vrp.js";import{Ye}from"./chunk-365vg0eg.js";import{Xr,Jr}from"./chunk-fzqj1mjz.js";import{va,go,Gr,Kr}from"./chunk-04kg16qs.js";import{ha,ya}from"./chunk-9edksf8x.js";import{bt}from"./chunk-3hxd5td3.js";import{nn,Ca,tr,nr}from"./chunk-zhf01af3.js";import{f}from"./chunk-b7e07ybq.js";import{Ts}from"./chunk-qv6axke4.js";import Q from"fs";import j from"path";import{loadConfigWithResult as Ht}from"bunfig";var B={duration:300,delay:0,ease:"ease",direction:"both"};function nt(e,r={}){let{duration:i,delay:l,ease:s,direction:c,custom:d}={...B,...r};if(e==="custom"&&d)return d;switch(e){case"fade":return`${c==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
2
+ import{t,a}from"./chunk-2dp7hyv7.js";import{n,pn,m}from"./chunk-p23sz4rr.js";import{Ye}from"./chunk-365vg0eg.js";import{Xr,Jr}from"./chunk-fzqj1mjz.js";import{va,go,Gr,Kr}from"./chunk-04kg16qs.js";import{ha,ya}from"./chunk-nt7jxmpy.js";import{bt}from"./chunk-3hxd5td3.js";import{nn,Ca,tr,nr}from"./chunk-zhf01af3.js";import{f}from"./chunk-b7e07ybq.js";import{Ts}from"./chunk-qv6axke4.js";import Q from"fs";import j from"path";import{loadConfigWithResult as Ht}from"bunfig";var B={duration:300,delay:0,ease:"ease",direction:"both"};function nt(e,r={}){let{duration:i,delay:l,ease:s,direction:c,custom:d}={...B,...r};if(e==="custom"&&d)return d;switch(e){case"fade":return`${c==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
3
3
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
4
4
  @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${c==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"transform: translateY(0); opacity: 1; animation: slideOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: translateY(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
5
5
  @keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@@ -1307,6 +1307,6 @@ ${y}
1307
1307
  customElements.define('${r}', ${d});
1308
1308
  `}async function Qe(e,r,i,l){if(r.length<1)return a("WebComponent","@webcomponent directive requires at least the tag name parameter",t.INVALID_DIRECTIVE_SYNTAX);let s=r[0].replace(/['"]/g,""),d=(i.__stx_options||{}).componentsDir||"components",p=q.isAbsolute(d)?[q.join(d,`${s}.stx`),q.join(q.dirname(l),`${s}.stx`)]:[q.join(q.dirname(l),d,`${s}.stx`),q.join(process.cwd(),d,`${s}.stx`),q.join(q.dirname(l),`${s}.stx`)],u=null;for(let h of p)if(await n(h)){u=await Bun.file(h).text();break}if(!u)return a("WebComponent",`Component file not found: ${s}.stx`,t.FILE_NOT_FOUND);let g=Ft(u,s);return`<script type="module">
1309
1309
  ${qt(g)}
1310
- </script>`}var N={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:nn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Ie,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Qe,hasEndTag:!1,description:"Include a web component in the template"},ha,ya,Xr,Jr,De,ke,Ae,Pe,_e,Oe,Fe,$e,...Ts],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Ut(e,r,i){let l=r||"pages";if(e)return{root:e,pagesDir:l};let s=i||process.cwd(),c=j.join(s,"resources","views"),d=j.join(s,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=j.join(s,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:l};return{root:".",pagesDir:l}}var et=new Set,ue=["partialsDir","componentsDir","layoutsDir"],Se=new WeakMap;function Bt(e,r){let i=r.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let l=e.replace(/\\/g,"/"),s=i.replace(/\\/g,"/");return l===s||l.startsWith(`${s}/`)}function Rl(e,r){let i=!e.root,l=Ut(e.root,e.pagesDir,r);if(e.root=l.root,e.pagesDir=l.pagesDir,i&&l.root!=="."){let s=`${r}::${l.root}`;if(!et.has(s))et.add(s),console.warn(`[stx] No "root" in config \u2014 inferred "${l.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Se.has(e)){let s={};for(let c of ue){let d=e[c];if(typeof d==="string"&&d)s[c]=d}Se.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let c of ue){let d=e[c];if(typeof d!=="string"||!d)continue;if(j.isAbsolute(d)||Bt(d,s))continue;e[c]=j.join(s,d)}}for(let s of ue){let c=e[s];if(typeof c!=="string"||!c||j.isAbsolute(c))continue;e[s]=j.resolve(r,c)}return e}function Jt(e,r){let i=Se.get(e);for(let l of ue){let s=e[l];if(typeof s!=="string"||!s)continue;let c=j.isAbsolute(s)?s:j.join(r,s);if(Q.existsSync(c))continue;let d=i?.[l]??s,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(l)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Kt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Gt(e){if(Ca(e.stateDir),e.stateDir=tr(),e.cachePath=nr(e.cachePath),e.build)e.build.cacheDir=nr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=nr(e.media.cache.directory);if(e.story)e.story.outDir=nr(e.story.outDir)}var K=null,Y=new Map,de=new Map,se=null;async function po(e,r=Ht){try{return await r(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}async function o(e){let r=e?j.resolve(e):process.cwd(),i=de.get(r);if(i&&i.signature!==Gr(i.graph)){let c=Y.get(r);if(Y.delete(r),de.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-3n9vaxnt.js"),{partialsCache:p}=await import("./chunk-fb93n9ts.js");if(d(),p.clear(),c&&i.configSignature===Kr(i.graph)){let u=c.then(async(g)=>{let y={...i.graph};await go(y,r),de.set(r,{graph:y,signature:Gr(y),configSignature:Kr(y)});let h={...g,_layerGraph:y};if(!e)K=h;return h});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let l=Y.get(r);if(l)return l;let s=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(j.join(r,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(j.join(r,"config",`ui${v}`))),u;if(d&&p){let v=await po({name:"ui",cwd:j.join(r,"config"),defaultConfig:N,errorPolicy:"throw",verbose:!1});u=(await po({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await po({name:"stx",alias:"ui",cwd:r,defaultConfig:N,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await va(r,N);u=v.config,de.set(r,{graph:v.graph,signature:Gr(v.graph),configSignature:Kr(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-02ymqwmj.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-tq0bgaae.js");await b(r,u.runtimeConfig)}Kt(u),Gt(u),Rl(u,r),Jt(u,r);let g=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{f.resolve(b,{paths:[r]}),g.push(b)}catch{}}let h=[...u.plugins??[],...g];if(h.length>0){let{pluginManager:v}=await import("./chunk-fcn71bq1.js"),b=[],x=[];for(let P of h){let S=typeof P==="string"?P:P[0],A=typeof P==="string"?{}:P[1]||{};try{let k,E;try{let w=f.resolve(S,{paths:[r]});k=await import(w),E=j.dirname(w)}catch{let w=j.resolve(r,S);k=await import(w),E=j.dirname(w)}let I=k.default||k;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(j.resolve(E,C))}if(I.pages){let w=j.resolve(E,I.pages),C=A.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(A,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
1310
+ </script>`}var N={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:nn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Ie,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Qe,hasEndTag:!1,description:"Include a web component in the template"},ha,ya,Xr,Jr,De,ke,Ae,Pe,_e,Oe,Fe,$e,...Ts],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Ut(e,r,i){let l=r||"pages";if(e)return{root:e,pagesDir:l};let s=i||process.cwd(),c=j.join(s,"resources","views"),d=j.join(s,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=j.join(s,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:l};return{root:".",pagesDir:l}}var et=new Set,ue=["partialsDir","componentsDir","layoutsDir"],Se=new WeakMap;function Bt(e,r){let i=r.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let l=e.replace(/\\/g,"/"),s=i.replace(/\\/g,"/");return l===s||l.startsWith(`${s}/`)}function Rl(e,r){let i=!e.root,l=Ut(e.root,e.pagesDir,r);if(e.root=l.root,e.pagesDir=l.pagesDir,i&&l.root!=="."){let s=`${r}::${l.root}`;if(!et.has(s))et.add(s),console.warn(`[stx] No "root" in config \u2014 inferred "${l.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Se.has(e)){let s={};for(let c of ue){let d=e[c];if(typeof d==="string"&&d)s[c]=d}Se.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let c of ue){let d=e[c];if(typeof d!=="string"||!d)continue;if(j.isAbsolute(d)||Bt(d,s))continue;e[c]=j.join(s,d)}}for(let s of ue){let c=e[s];if(typeof c!=="string"||!c||j.isAbsolute(c))continue;e[s]=j.resolve(r,c)}return e}function Jt(e,r){let i=Se.get(e);for(let l of ue){let s=e[l];if(typeof s!=="string"||!s)continue;let c=j.isAbsolute(s)?s:j.join(r,s);if(Q.existsSync(c))continue;let d=i?.[l]??s,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(l)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Kt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Gt(e){if(Ca(e.stateDir),e.stateDir=tr(),e.cachePath=nr(e.cachePath),e.build)e.build.cacheDir=nr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=nr(e.media.cache.directory);if(e.story)e.story.outDir=nr(e.story.outDir)}var K=null,Y=new Map,de=new Map,se=null;async function po(e,r=Ht){try{return await r(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}async function o(e){let r=e?j.resolve(e):process.cwd(),i=de.get(r);if(i&&i.signature!==Gr(i.graph)){let c=Y.get(r);if(Y.delete(r),de.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-p5sjezzx.js"),{partialsCache:p}=await import("./chunk-gea2ty3e.js");if(d(),p.clear(),c&&i.configSignature===Kr(i.graph)){let u=c.then(async(g)=>{let y={...i.graph};await go(y,r),de.set(r,{graph:y,signature:Gr(y),configSignature:Kr(y)});let h={...g,_layerGraph:y};if(!e)K=h;return h});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let l=Y.get(r);if(l)return l;let s=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(j.join(r,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(j.join(r,"config",`ui${v}`))),u;if(d&&p){let v=await po({name:"ui",cwd:j.join(r,"config"),defaultConfig:N,errorPolicy:"throw",verbose:!1});u=(await po({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await po({name:"stx",alias:"ui",cwd:r,defaultConfig:N,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await va(r,N);u=v.config,de.set(r,{graph:v.graph,signature:Gr(v.graph),configSignature:Kr(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-02ymqwmj.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-j10smv8e.js");await b(r,u.runtimeConfig)}Kt(u),Gt(u),Rl(u,r),Jt(u,r);let g=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{f.resolve(b,{paths:[r]}),g.push(b)}catch{}}let h=[...u.plugins??[],...g];if(h.length>0){let{pluginManager:v}=await import("./chunk-fcn71bq1.js"),b=[],x=[];for(let P of h){let S=typeof P==="string"?P:P[0],A=typeof P==="string"?{}:P[1]||{};try{let k,E;try{let w=f.resolve(S,{paths:[r]});k=await import(w),E=j.dirname(w)}catch{let w=j.resolve(r,S);k=await import(w),E=j.dirname(w)}let I=k.default||k;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(j.resolve(E,C))}if(I.pages){let w=j.resolve(E,I.pages),C=A.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(A,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
1311
1311
  `)}catch(k){console.warn(`[stx] Failed to load plugin ${S}:`,k.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}return u})();if(Y.set(r,s),s.catch(()=>{if(Y.get(r)===s)Y.delete(r)}),!e)se=s,s.then((c)=>{K=c}).catch(()=>{});return s}var R=new Proxy(N,{get(e,r){if(K&&r in K)return K[r];if(!se)o().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[r]}});function xp(e){return e}function Sp(e){let r=[],i=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")r.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")r.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")r.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")r.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(e.streaming){if(e.streaming.bufferSize!==void 0){if(typeof e.streaming.bufferSize!=="number"||e.streaming.bufferSize<=0)r.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(e.streaming.timeout!==void 0){if(typeof e.streaming.timeout!=="number"||e.streaming.timeout<=0)r.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(e.streaming.strategy!==void 0){let l=["auto","manual","sections"];if(!l.includes(e.streaming.strategy))r.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.i18n){if(e.i18n.format!==void 0){let l=["json","yaml","yml","js"];if(!l.includes(e.i18n.format))r.push({path:"i18n.format",message:`i18n.format must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.animation){if(e.animation.defaultDuration!==void 0){if(typeof e.animation.defaultDuration!=="number"||e.animation.defaultDuration<0)r.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(e.animation.staggerDelay!==void 0){if(typeof e.animation.staggerDelay!=="number"||e.animation.staggerDelay<0)r.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(e.a11y){if(e.a11y.level!==void 0){let l=["AA","AAA"];if(!l.includes(e.a11y.level))r.push({path:"a11y.level",message:`a11y.level must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.hydration){if(e.hydration.mode!==void 0){let l=["progressive","islands"];if(!l.includes(e.hydration.mode))r.push({path:"hydration.mode",message:`hydration.mode must be one of: ${l.join(", ")}`,severity:"error"})}if(e.hydration.preload!==void 0){let l=["none","eager","lazy"];if(!l.includes(e.hydration.preload))r.push({path:"hydration.preload",message:`hydration.preload must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))r.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((l,s)=>{if(!l.name||typeof l.name!=="string")r.push({path:`customDirectives[${s}].name`,message:"Custom directive must have a name string",severity:"error"});if(!l.handler||typeof l.handler!=="function")r.push({path:`customDirectives[${s}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))r.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((l,s)=>{if(!l.name||typeof l.name!=="string")r.push({path:`middleware[${s}].name`,message:"Middleware must have a name string",severity:"error"});if(!l.handler||typeof l.handler!=="function")r.push({path:`middleware[${s}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!l.timing||!["before","after"].includes(l.timing))r.push({path:`middleware[${s}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(e.debug===!0&&e.cache===!0)i.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(e.seo?.enabled===!0&&!e.seo?.defaultConfig?.title)i.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(e.pwa){if(e.pwa.enabled===!0&&!e.pwa.manifest?.name)r.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(e.pwa.manifest?.display!==void 0){let l=["fullscreen","standalone","minimal-ui","browser"];if(!l.includes(e.pwa.manifest.display))r.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${l.join(", ")}`,severity:"error"})}if(e.pwa.manifest?.orientation!==void 0){let l=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!l.includes(e.pwa.manifest.orientation))r.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${l.join(", ")}`,severity:"error"})}if(e.pwa.routes){let l=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];e.pwa.routes.forEach((s,c)=>{if(!s.pattern||typeof s.pattern!=="string")r.push({path:`pwa.routes[${c}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!l.includes(s.strategy))r.push({path:`pwa.routes[${c}].strategy`,message:`PWA route strategy must be one of: ${l.join(", ")}`,severity:"error"});if(s.maxAgeSeconds!==void 0&&(typeof s.maxAgeSeconds!=="number"||s.maxAgeSeconds<0))r.push({path:`pwa.routes[${c}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(s.maxEntries!==void 0&&(typeof s.maxEntries!=="number"||s.maxEntries<1))r.push({path:`pwa.routes[${c}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((s)=>typeof s!=="number"||s<16||s>1024).length>0)r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(e.pwa.icons?.purpose){let l=["any","maskable","monochrome"];if(e.pwa.icons.purpose.filter((c)=>!l.includes(c)).length>0)r.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${l.join(", ")}`,severity:"error"})}if(e.pwa.enabled===!0&&!e.pwa.icons?.src)i.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(e.pwa.enabled===!0&&!e.pwa.manifest?.themeColor)i.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:r.length===0,errors:r,warnings:i}}
1312
1312
  export{ua,da,Yn,Xe,pa,qr,N,Rl,po,o,R,xp,Sp};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Fo,vs,l,p,E,tt,u,ws,t,a,w}from"./chunk-2dp7hyv7.js";import{he,Tt,It,K,k}from"./chunk-vdjj4vrp.js";import{ee}from"./chunk-ka8befem.js";import{Ur}from"./chunk-p472crv1.js";var ae=1000,ue=!1;function fe(n,r){let o=/@(include|partial)\s*\(\s*(['"])([^'"]+)\2\s*,\s*/g,e="",s=0,i;while((i=o.exec(n))!==null){let d=i.index+i[0].length,y=i.index+i[0].indexOf("("),m=w(n,"(",")",y);if(m===-1)continue;let c=n.slice(d,m).trim();if(!c)continue;if(!Object.keys(r).some((b)=>new RegExp(`(?:^|[^\\w$.])${b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w$])`).test(c)))continue;let g;try{let b=E(c,r);if(!b||typeof b!=="object")continue;g=JSON.stringify(b)}catch{continue}e+=n.slice(s,d)+g,s=m,o.lastIndex=m}return s===0?n:e+n.slice(s)}function ge(n,r){let o=/@component\s*\(/g,e=n,s,i=[];while((s=o.exec(e))!==null){let d=s.index,y=d+s[0].length-1,m=1,c=y+1;while(c<e.length&&m>0){if(e[c]==="(")m++;else if(e[c]===")"){if(m--,m===0)break}c++}if(m!==0)continue;let f=e.substring(y+1,c),g=c+1,b=f.match(/^\s*['"]([^'"]+)['"]/);if(!b)continue;let x=b[1],h=f.slice(b[0].length),_=h.match(/^\s*,\s*/);if(!_)continue;let S=h.slice(_[0].length).trim();if(!S)continue;try{let P=E(S,r),F=JSON.stringify(P),R=`@component('${x}', ${F})`;i.push({start:d,end:g,replacement:R})}catch{continue}}for(let d=i.length-1;d>=0;d--){let{start:y,end:m,replacement:c}=i[d];e=e.substring(0,y)+c+e.substring(m)}return e}function te(n,r,o){let e=n,s=new RegExp(`${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\(`),i;while((i=s.exec(e))!==null){let d=i.index,y=d+i[0].length-1,m=1,c=y+1,f=null,g=!1;while(c<e.length&&m>0){let h=e[c];if(g){g=!1,c++;continue}if(h==="\\"&&f){g=!0,c++;continue}if(f){if(h===f)f=null;c++;continue}if(h==='"'||h==="'"||h==="`"){f=h,c++;continue}if(h==="(")m++;else if(h===")"){if(m--,m===0)break}c++}if(m!==0)break;let b=e.substring(y+1,c),x=o(b);e=e.substring(0,d)+x+e.substring(c+1)}return e}function pe(n,r){let o=n;return o=o.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)(?=\s+[^=]|\s*\/?>|\s*$)/g,(e,s)=>{if(s in r)return`:${s}="${s}"`;return e}),o=o.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,(e,s,i)=>{try{let d=Object.keys(r),y=Object.values(r);Fo(i);let c=u(i,d)(...y),f=JSON.stringify(c);if(f===void 0){if(!tt(i).some((x)=>!(x in r)))return"";return e}let g=Buffer.from(f,"utf8").toString("base64");return`__stx_${s}="${g}"`}catch(d){return e}}),o}var Y="<!--__STX_BREAK__-->",G="<!--__STX_CONTINUE__-->";function se(n,r){let o=/\{\{\{?|\{!!|@(break|continue)(?![\w$])/g,e="",s=0;for(let i=o.exec(n);i;i=o.exec(n)){if(!i[1]){let c=i[0].length===3&&i[0]==="{{{"?3:2,f=i[0]==="{!!"?n.indexOf("!!}",o.lastIndex):he(n,i.index,c);if(f<0)break;o.lastIndex=f+(i[0]==="{!!"?3:c);continue}let d=o.lastIndex,y=!0,m=/^\s*\(/.exec(n.slice(d));if(m){let c=d+m[0].length-1,f=w(n,"(",")",c);if(f<0)break;d=f+1;try{let g=`!!(${n.slice(c+1,f).trim()})`;y=p(g)?Boolean(u(g,Object.keys(r))(...Object.values(r))):Boolean(l(g,r))}catch{y=!1}}if(e+=n.slice(s,i.index),y)return e+(i[1]==="break"?Y:G);s=d,o.lastIndex=d}return e+n.slice(s)}function oe(n){let r=(s)=>s.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),o="",e=0;return It(n,(s,i,d)=>(o+=ne(r(n.slice(e,d))),o+=`\${__stxRenderLoopValue(${d}, (${i}), ${s.length})}`,e=d+s.length,s)),o+ne(r(n.slice(e)))}function ie(n,r,o,e){return K(n,r,o==null?"":String(o),!1,e)}function ne(n){let r=n;return r=te(r,"@break",(o)=>{let e=o.trim();if(!ws(e))return"";return`\`; if (${e}) { break; } result += \``}),r=te(r,"@continue",(o)=>{let e=o.trim();if(!ws(e))return"";return`\`; if (${e}) { continue; } result += \``}),r=r.replace(/@break(?!\()/g,"`; break; result += `"),r=r.replace(/@continue(?!\()/g,"`; continue; result += `"),r}function de(n){let r=/@forelse\s*\(/g,o,e=[],s=/@foreach\s*\(/g,i=/@endforeach/g,d;while((d=s.exec(n))!==null)e.push({pos:d.index,delta:1});while((d=i.exec(n))!==null)e.push({pos:d.index,delta:-1});e.sort((f,g)=>f.pos-g.pos);let y=[],m=0;for(let f of e)m+=f.delta,y.push({pos:f.pos,depth:m});function c(f){let g=0,b=y.length-1,x=0;while(g<=b){let h=g+b>>1;if(y[h].pos<=f)x=y[h].depth,g=h+1;else b=h-1}return x}while((o=r.exec(n))!==null){if(c(o.index)>0)continue;let f=o.index,g=o.index+o[0].length-1,b=1,x=g+1,h=-1;while(x<n.length&&b>0){if(n[x]==="(")b++;else if(n[x]===")"){if(b--,b===0){h=x;break}}x++}if(h===-1)continue;let _=n.substring(g+1,h),S=Tt(_);if(!S)continue;let{arrayExpr:P,itemVar:F}=S,R=h+1,N=1,U=R,v=/@forelse\s*\(/g,V=/@endforelse/g,I=-1;while(N>0&&U<n.length){v.lastIndex=U,V.lastIndex=U;let A=v.exec(n),T=V.exec(n);if(!T)break;if(A&&A.index<T.index)N++,U=A.index+A[0].length;else{if(N--,N===0){I=T.index;break}U=T.index+11}}if(I===-1)continue;let j=n.substring(R,I),z=I+11,M=-1,W=0,O=0;while(O<j.length){let A=j.indexOf("@",O);if(A===-1)break;let T=j.substring(A);if(/^@forelse\s*\(/.test(T))W++,O=A+1;else if(T.startsWith("@endforelse"))W--,O=A+11;else if(W===0&&T.startsWith("@empty")){if(j.length<=A+6||!/[a-z]/i.test(j[A+6])){M=A;break}O=A+1}else O=A+1}if(M===-1)continue;return{start:f,end:z,arrayExpr:P,itemVar:F,foreachContent:j.substring(0,M),emptyContent:j.substring(M+6)}}return null}function re(n,r){let o=n;while(!0){let e=de(o);if(!e)break;let{start:s,end:i,arrayExpr:d,itemVar:y,foreachContent:m,emptyContent:c}=e;try{let f;if(p(d))f=u(d,Object.keys(r))(...Object.values(r));else f=l(d,r);let g;if(!Array.isArray(f)||f.length===0)g=c;else g=`@foreach (${d} as ${y})${m}@endforeach`;o=o.substring(0,s)+g+o.substring(i)}catch(f){let g=f instanceof Error?f.message:String(f),b=a("Forelse",`Error in @forelse(${d} as ${y}): ${g}`,t.EVALUATION_ERROR);o=o.substring(0,s)+b+o.substring(i)}}return o}var ce="<!--stx:foreach-not-iterable:",me=/<!--stx:foreach-not-iterable:([^|>]*)\|([^>]*?)-->/g;function be(n,r){return`${ce}${encodeURIComponent(n)}|${encodeURIComponent(r)}-->`}function xe(n,r){console.warn(`[stx] @foreach(${n}) in ${r}: ${n} is not iterable server-side, so the loop rendered nothing. `+"Values a server loop reads must come from <script server> or the page context \u2014 "+"a plain <script> runs in the browser.")}function Nr(n){if(!n.includes(ce))return n;return n.replace(me,(r,o,e)=>(xe(decodeURIComponent(o),decodeURIComponent(e)),""))}function qn(n,r,o,e,s=!1){let i=n;i=re(i,r);function d(c){let f=/@foreach\s*\(/g,g;while((g=f.exec(c))!==null){let b=g.index,x=g.index+g[0].length-1,h=1,_=x+1,S=-1;while(_<c.length&&h>0){if(c[_]==="(")h++;else if(c[_]===")"){if(h--,h===0){S=_;break}}_++}if(S===-1)continue;let P=c.substring(x+1,S),F=Tt(P);if(!F)continue;let R=b,{arrayExpr:N,itemVar:U}=F,v=S+1,V=1,I=v,j=/@foreach\s*\(/g,z=/@endforeach/g;while(V>0&&I<c.length){j.lastIndex=I,z.lastIndex=I;let M=j.exec(c),W=z.exec(c);if(!W)break;if(M&&M.index<W.index)V++,I=M.index+M[0].length;else{if(V--,V===0){let O=c.substring(v,W.index),A=W.index+11;return{start:R,end:A,arrayExpr:N,itemVar:U,content:O}}I=W.index+11}}}return null}function y(c,f){let g=c;while(!0){let b=d(g);if(!b)break;let{start:x,end:h,arrayExpr:_,itemVar:S,content:P}=b;try{let F=_.trim(),R;if(p(F))R=u(F,Object.keys(f))(...Object.values(f));else R=l(F,f);let N=!1;if(!Array.isArray(R))if(R instanceof Map)R=Array.from(R),N=!0;else if(R instanceof Set)R=Array.from(R);else if(typeof R==="string")R=Array.from(R);else if(R&&typeof R==="object"&&!(R instanceof Date)&&!(R instanceof RegExp))R=Object.entries(R),N=!0;else{let O=be(F,o)+a("Foreach",`Error in @foreach: ${F} is not iterable`,t.TYPE_ERROR);g=g.substring(0,x)+O+g.substring(h);continue}let U=e?.loops?.useAltLoopVariable??ue,v=S.trim(),V=null,I,j=!1;if(v.includes("=>")){let O=v.split("=>").map((A)=>A.trim());if(O.length===2&&O[0]&&O[1])V=O[0],I=O[1];else I=v}else if(!v.startsWith("[")&&!v.startsWith("{")&&v.includes(",")){let O=v.split(",").map((A)=>A.trim());if(O.length===2&&O[0]&&O[1])I=O[0],V=O[1],j=!0;else I=v}else I=v;let z="",M=R,W=f[vs]??new WeakMap;for(let O=0;O<M.length;O++){let A=M[O],T={index:O,iteration:O+1,first:O===0,last:O===M.length-1,count:M.length},L={...f,loop:T,$loop:T,[vs]:W};if(I.startsWith("[")&&I.endsWith("]")){let J=I.slice(1,-1).split(",").map((B)=>B.trim());if(Array.isArray(A))J.forEach((B,D)=>{if(B)L[B]=A[D]});else L[I]=A}else if(I.startsWith("{")&&I.endsWith("}")){let J=I.slice(1,-1).split(",").map((B)=>B.trim()).filter(Boolean);if(A!==null&&typeof A==="object")J.forEach((B)=>{let D=B.indexOf(":"),q=(D===-1?B:B.slice(0,D)).trim(),Q=D===-1?q:B.slice(D+1).trim();if(q&&Q)L[Q]=A[q]});else L[I]=A}else L[I]=A;if(V)if(!j&&N&&Array.isArray(A)&&A.length===2)L[V]=A[0],L[I]=A[1];else L[V]=O;let C=re(P,L);C=qn(C,L,o,e,!0),C=ee(C,L,o),C=se(C,L);let Z=C.indexOf(Y),H=C.indexOf(G),X=Z<0?H:H<0?Z:Math.min(Z,H);if(X>=0)C=C.slice(0,X);if(C=k(C,L,o),C=pe(C,L),C=ge(C,L),C=fe(C,L),z+=C,X>=0&&X===Z)break}g=g.substring(0,x)+z+g.substring(h)}catch(F){let R=a("Foreach",`Error in @foreach(${_.trim()} as ${S.trim()}): ${F instanceof Error?F.message:String(F)}`,t.EVALUATION_ERROR);g=g.substring(0,x)+R+g.substring(h)}}return g}i=y(i,r),i=ye(i,r,o,e);let m=e?.loops?.maxWhileIterations??ae;return i=Re(i,r,m),s?i:Nr(i)}function xl(n){let r=/^(\s*)([A-Za-z_$][\w$]*|\[[^\]]*\]|\{[^}]*\})(\s+(?:of|in)\s)/.exec(n);if(!r||/^(?:const|let|var)$/.test(r[2]))return n;return`${r[1]}let ${n.slice(r[1].length)}`}function le(n){return ws(n)}function ye(n,r,o,e){let s=n,i=!0;while(i){i=!1;let d=s.match(/@for\s*\(/);if(!d||d.index===void 0)break;let y=d.index,m=y+d[0].length-1,c=w(s,"(",")",m);if(c===-1)break;let f=xl(s.slice(m+1,c)),g=c+1,b=Ur(s.slice(y),"for","endfor");if(b.length===0)break;let x=b[0].content,h=y+b[0].end;if(!le(f)){let _=a("For",`Unsafe expression in @for: ${f}`,t.UNSAFE_EXPRESSION);s=s.substring(0,y)+_+s.substring(h),i=!0;continue}try{let _=Ee(f),S=/@(?:for|foreach|if|unless)\s*\(/.test(x);if(_.length>0&&S){let v=$e({forExpr:f,content:x,iterVarNames:_,context:r,filePath:o,options:e});s=s.substring(0,y)+v+s.substring(h),i=!0;continue}let P=Object.keys(r),F=Object.values(r),R=oe(x),U=Function(...P,"__stxRenderLoopValue",`
2
+ import{Fo,vs,l,p,E,tt,u,ws,t,a,w}from"./chunk-2dp7hyv7.js";import{he,Tt,It,K,k}from"./chunk-p23sz4rr.js";import{ee}from"./chunk-ka8befem.js";import{Ur}from"./chunk-p472crv1.js";var ae=1000,ue=!1;function fe(n,r){let o=/@(include|partial)\s*\(\s*(['"])([^'"]+)\2\s*,\s*/g,e="",s=0,i;while((i=o.exec(n))!==null){let d=i.index+i[0].length,y=i.index+i[0].indexOf("("),m=w(n,"(",")",y);if(m===-1)continue;let c=n.slice(d,m).trim();if(!c)continue;if(!Object.keys(r).some((b)=>new RegExp(`(?:^|[^\\w$.])${b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w$])`).test(c)))continue;let g;try{let b=E(c,r);if(!b||typeof b!=="object")continue;g=JSON.stringify(b)}catch{continue}e+=n.slice(s,d)+g,s=m,o.lastIndex=m}return s===0?n:e+n.slice(s)}function ge(n,r){let o=/@component\s*\(/g,e=n,s,i=[];while((s=o.exec(e))!==null){let d=s.index,y=d+s[0].length-1,m=1,c=y+1;while(c<e.length&&m>0){if(e[c]==="(")m++;else if(e[c]===")"){if(m--,m===0)break}c++}if(m!==0)continue;let f=e.substring(y+1,c),g=c+1,b=f.match(/^\s*['"]([^'"]+)['"]/);if(!b)continue;let x=b[1],h=f.slice(b[0].length),_=h.match(/^\s*,\s*/);if(!_)continue;let S=h.slice(_[0].length).trim();if(!S)continue;try{let P=E(S,r),F=JSON.stringify(P),R=`@component('${x}', ${F})`;i.push({start:d,end:g,replacement:R})}catch{continue}}for(let d=i.length-1;d>=0;d--){let{start:y,end:m,replacement:c}=i[d];e=e.substring(0,y)+c+e.substring(m)}return e}function te(n,r,o){let e=n,s=new RegExp(`${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\(`),i;while((i=s.exec(e))!==null){let d=i.index,y=d+i[0].length-1,m=1,c=y+1,f=null,g=!1;while(c<e.length&&m>0){let h=e[c];if(g){g=!1,c++;continue}if(h==="\\"&&f){g=!0,c++;continue}if(f){if(h===f)f=null;c++;continue}if(h==='"'||h==="'"||h==="`"){f=h,c++;continue}if(h==="(")m++;else if(h===")"){if(m--,m===0)break}c++}if(m!==0)break;let b=e.substring(y+1,c),x=o(b);e=e.substring(0,d)+x+e.substring(c+1)}return e}function pe(n,r){let o=n;return o=o.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)(?=\s+[^=]|\s*\/?>|\s*$)/g,(e,s)=>{if(s in r)return`:${s}="${s}"`;return e}),o=o.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,(e,s,i)=>{try{let d=Object.keys(r),y=Object.values(r);Fo(i);let c=u(i,d)(...y),f=JSON.stringify(c);if(f===void 0){if(!tt(i).some((x)=>!(x in r)))return"";return e}let g=Buffer.from(f,"utf8").toString("base64");return`__stx_${s}="${g}"`}catch(d){return e}}),o}var Y="<!--__STX_BREAK__-->",G="<!--__STX_CONTINUE__-->";function se(n,r){let o=/\{\{\{?|\{!!|@(break|continue)(?![\w$])/g,e="",s=0;for(let i=o.exec(n);i;i=o.exec(n)){if(!i[1]){let c=i[0].length===3&&i[0]==="{{{"?3:2,f=i[0]==="{!!"?n.indexOf("!!}",o.lastIndex):he(n,i.index,c);if(f<0)break;o.lastIndex=f+(i[0]==="{!!"?3:c);continue}let d=o.lastIndex,y=!0,m=/^\s*\(/.exec(n.slice(d));if(m){let c=d+m[0].length-1,f=w(n,"(",")",c);if(f<0)break;d=f+1;try{let g=`!!(${n.slice(c+1,f).trim()})`;y=p(g)?Boolean(u(g,Object.keys(r))(...Object.values(r))):Boolean(l(g,r))}catch{y=!1}}if(e+=n.slice(s,i.index),y)return e+(i[1]==="break"?Y:G);s=d,o.lastIndex=d}return e+n.slice(s)}function oe(n){let r=(s)=>s.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),o="",e=0;return It(n,(s,i,d)=>(o+=ne(r(n.slice(e,d))),o+=`\${__stxRenderLoopValue(${d}, (${i}), ${s.length})}`,e=d+s.length,s)),o+ne(r(n.slice(e)))}function ie(n,r,o,e){return K(n,r,o==null?"":String(o),!1,e)}function ne(n){let r=n;return r=te(r,"@break",(o)=>{let e=o.trim();if(!ws(e))return"";return`\`; if (${e}) { break; } result += \``}),r=te(r,"@continue",(o)=>{let e=o.trim();if(!ws(e))return"";return`\`; if (${e}) { continue; } result += \``}),r=r.replace(/@break(?!\()/g,"`; break; result += `"),r=r.replace(/@continue(?!\()/g,"`; continue; result += `"),r}function de(n){let r=/@forelse\s*\(/g,o,e=[],s=/@foreach\s*\(/g,i=/@endforeach/g,d;while((d=s.exec(n))!==null)e.push({pos:d.index,delta:1});while((d=i.exec(n))!==null)e.push({pos:d.index,delta:-1});e.sort((f,g)=>f.pos-g.pos);let y=[],m=0;for(let f of e)m+=f.delta,y.push({pos:f.pos,depth:m});function c(f){let g=0,b=y.length-1,x=0;while(g<=b){let h=g+b>>1;if(y[h].pos<=f)x=y[h].depth,g=h+1;else b=h-1}return x}while((o=r.exec(n))!==null){if(c(o.index)>0)continue;let f=o.index,g=o.index+o[0].length-1,b=1,x=g+1,h=-1;while(x<n.length&&b>0){if(n[x]==="(")b++;else if(n[x]===")"){if(b--,b===0){h=x;break}}x++}if(h===-1)continue;let _=n.substring(g+1,h),S=Tt(_);if(!S)continue;let{arrayExpr:P,itemVar:F}=S,R=h+1,N=1,U=R,v=/@forelse\s*\(/g,V=/@endforelse/g,I=-1;while(N>0&&U<n.length){v.lastIndex=U,V.lastIndex=U;let A=v.exec(n),T=V.exec(n);if(!T)break;if(A&&A.index<T.index)N++,U=A.index+A[0].length;else{if(N--,N===0){I=T.index;break}U=T.index+11}}if(I===-1)continue;let j=n.substring(R,I),z=I+11,M=-1,W=0,O=0;while(O<j.length){let A=j.indexOf("@",O);if(A===-1)break;let T=j.substring(A);if(/^@forelse\s*\(/.test(T))W++,O=A+1;else if(T.startsWith("@endforelse"))W--,O=A+11;else if(W===0&&T.startsWith("@empty")){if(j.length<=A+6||!/[a-z]/i.test(j[A+6])){M=A;break}O=A+1}else O=A+1}if(M===-1)continue;return{start:f,end:z,arrayExpr:P,itemVar:F,foreachContent:j.substring(0,M),emptyContent:j.substring(M+6)}}return null}function re(n,r){let o=n;while(!0){let e=de(o);if(!e)break;let{start:s,end:i,arrayExpr:d,itemVar:y,foreachContent:m,emptyContent:c}=e;try{let f;if(p(d))f=u(d,Object.keys(r))(...Object.values(r));else f=l(d,r);let g;if(!Array.isArray(f)||f.length===0)g=c;else g=`@foreach (${d} as ${y})${m}@endforeach`;o=o.substring(0,s)+g+o.substring(i)}catch(f){let g=f instanceof Error?f.message:String(f),b=a("Forelse",`Error in @forelse(${d} as ${y}): ${g}`,t.EVALUATION_ERROR);o=o.substring(0,s)+b+o.substring(i)}}return o}var ce="<!--stx:foreach-not-iterable:",me=/<!--stx:foreach-not-iterable:([^|>]*)\|([^>]*?)-->/g;function be(n,r){return`${ce}${encodeURIComponent(n)}|${encodeURIComponent(r)}-->`}function xe(n,r){console.warn(`[stx] @foreach(${n}) in ${r}: ${n} is not iterable server-side, so the loop rendered nothing. `+"Values a server loop reads must come from <script server> or the page context \u2014 "+"a plain <script> runs in the browser.")}function Nr(n){if(!n.includes(ce))return n;return n.replace(me,(r,o,e)=>(xe(decodeURIComponent(o),decodeURIComponent(e)),""))}function qn(n,r,o,e,s=!1){let i=n;i=re(i,r);function d(c){let f=/@foreach\s*\(/g,g;while((g=f.exec(c))!==null){let b=g.index,x=g.index+g[0].length-1,h=1,_=x+1,S=-1;while(_<c.length&&h>0){if(c[_]==="(")h++;else if(c[_]===")"){if(h--,h===0){S=_;break}}_++}if(S===-1)continue;let P=c.substring(x+1,S),F=Tt(P);if(!F)continue;let R=b,{arrayExpr:N,itemVar:U}=F,v=S+1,V=1,I=v,j=/@foreach\s*\(/g,z=/@endforeach/g;while(V>0&&I<c.length){j.lastIndex=I,z.lastIndex=I;let M=j.exec(c),W=z.exec(c);if(!W)break;if(M&&M.index<W.index)V++,I=M.index+M[0].length;else{if(V--,V===0){let O=c.substring(v,W.index),A=W.index+11;return{start:R,end:A,arrayExpr:N,itemVar:U,content:O}}I=W.index+11}}}return null}function y(c,f){let g=c;while(!0){let b=d(g);if(!b)break;let{start:x,end:h,arrayExpr:_,itemVar:S,content:P}=b;try{let F=_.trim(),R;if(p(F))R=u(F,Object.keys(f))(...Object.values(f));else R=l(F,f);let N=!1;if(!Array.isArray(R))if(R instanceof Map)R=Array.from(R),N=!0;else if(R instanceof Set)R=Array.from(R);else if(typeof R==="string")R=Array.from(R);else if(R&&typeof R==="object"&&!(R instanceof Date)&&!(R instanceof RegExp))R=Object.entries(R),N=!0;else{let O=be(F,o)+a("Foreach",`Error in @foreach: ${F} is not iterable`,t.TYPE_ERROR);g=g.substring(0,x)+O+g.substring(h);continue}let U=e?.loops?.useAltLoopVariable??ue,v=S.trim(),V=null,I,j=!1;if(v.includes("=>")){let O=v.split("=>").map((A)=>A.trim());if(O.length===2&&O[0]&&O[1])V=O[0],I=O[1];else I=v}else if(!v.startsWith("[")&&!v.startsWith("{")&&v.includes(",")){let O=v.split(",").map((A)=>A.trim());if(O.length===2&&O[0]&&O[1])I=O[0],V=O[1],j=!0;else I=v}else I=v;let z="",M=R,W=f[vs]??new WeakMap;for(let O=0;O<M.length;O++){let A=M[O],T={index:O,iteration:O+1,first:O===0,last:O===M.length-1,count:M.length},L={...f,loop:T,$loop:T,[vs]:W};if(I.startsWith("[")&&I.endsWith("]")){let J=I.slice(1,-1).split(",").map((B)=>B.trim());if(Array.isArray(A))J.forEach((B,D)=>{if(B)L[B]=A[D]});else L[I]=A}else if(I.startsWith("{")&&I.endsWith("}")){let J=I.slice(1,-1).split(",").map((B)=>B.trim()).filter(Boolean);if(A!==null&&typeof A==="object")J.forEach((B)=>{let D=B.indexOf(":"),q=(D===-1?B:B.slice(0,D)).trim(),Q=D===-1?q:B.slice(D+1).trim();if(q&&Q)L[Q]=A[q]});else L[I]=A}else L[I]=A;if(V)if(!j&&N&&Array.isArray(A)&&A.length===2)L[V]=A[0],L[I]=A[1];else L[V]=O;let C=re(P,L);C=qn(C,L,o,e,!0),C=ee(C,L,o),C=se(C,L);let Z=C.indexOf(Y),H=C.indexOf(G),X=Z<0?H:H<0?Z:Math.min(Z,H);if(X>=0)C=C.slice(0,X);if(C=k(C,L,o),C=pe(C,L),C=ge(C,L),C=fe(C,L),z+=C,X>=0&&X===Z)break}g=g.substring(0,x)+z+g.substring(h)}catch(F){let R=a("Foreach",`Error in @foreach(${_.trim()} as ${S.trim()}): ${F instanceof Error?F.message:String(F)}`,t.EVALUATION_ERROR);g=g.substring(0,x)+R+g.substring(h)}}return g}i=y(i,r),i=ye(i,r,o,e);let m=e?.loops?.maxWhileIterations??ae;return i=Re(i,r,m),s?i:Nr(i)}function xl(n){let r=/^(\s*)([A-Za-z_$][\w$]*|\[[^\]]*\]|\{[^}]*\})(\s+(?:of|in)\s)/.exec(n);if(!r||/^(?:const|let|var)$/.test(r[2]))return n;return`${r[1]}let ${n.slice(r[1].length)}`}function le(n){return ws(n)}function ye(n,r,o,e){let s=n,i=!0;while(i){i=!1;let d=s.match(/@for\s*\(/);if(!d||d.index===void 0)break;let y=d.index,m=y+d[0].length-1,c=w(s,"(",")",m);if(c===-1)break;let f=xl(s.slice(m+1,c)),g=c+1,b=Ur(s.slice(y),"for","endfor");if(b.length===0)break;let x=b[0].content,h=y+b[0].end;if(!le(f)){let _=a("For",`Unsafe expression in @for: ${f}`,t.UNSAFE_EXPRESSION);s=s.substring(0,y)+_+s.substring(h),i=!0;continue}try{let _=Ee(f),S=/@(?:for|foreach|if|unless)\s*\(/.test(x);if(_.length>0&&S){let v=$e({forExpr:f,content:x,iterVarNames:_,context:r,filePath:o,options:e});s=s.substring(0,y)+v+s.substring(h),i=!0;continue}let P=Object.keys(r),F=Object.values(r),R=oe(x),U=Function(...P,"__stxRenderLoopValue",`
3
3
  let result = '';
4
4
  for (${f}) {
5
5
  result += \`${R}\`;
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{je,mn,ys,Bo,A}from"./chunk-1sr6c0nk.js";import{gn}from"./chunk-kpeep7gq.js";import{br,x,ic,st,Go,ac}from"./chunk-pxdww4rb.js";import{T}from"./chunk-ce6zddpf.js";import{bs,l,p,Nt,u,z,D,w,Ss,xe,Fe,ks}from"./chunk-2dp7hyv7.js";import{i,et}from"./chunk-qjtpxsyx.js";import{f}from"./chunk-b7e07ybq.js";import{H}from"./chunk-fbtv2k1p.js";import Je from"path";import Ct from"process";import{AsyncLocalStorage as io}from"async_hooks";var nr=new io;function ln(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function ur(e,s){return nr.run(ln(e),s)}async function fr(e,s){let t=nr.getStore();if(!t)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let o=t.pending.get(e);if(o)return o;let a=Promise.resolve().then(s).then((h)=>{let c=JSON.stringify(h,(E,R)=>{if(R===void 0||typeof R==="function"||typeof R==="symbol"||typeof R==="bigint"||typeof R==="number"&&!Number.isFinite(R))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(R&&typeof R==="object"&&!Array.isArray(R)&&Object.getPrototypeOf(R)!==Object.prototype&&Object.getPrototypeOf(R)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return R}),v=JSON.parse(c);return t.values.set(e,v),v}).catch((h)=>{throw t.pending.delete(e),h});return t.pending.set(e,a),a}function cr(e){let s=e.__stx_server_data;if(!s?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(s.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function L(e,s=!1){let t=i(e),o=[],a=new Set,h=0,c=0,v=t.length,E=()=>{if(h!==0)return;let R=t.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(R){if(s&&R[1]==="const")return;let I=R[2];if(!a.has(I))o.push(I),a.add(I);return}let C=t.slice(c).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(C){if(s&&t.slice(c).startsWith("const"))return;C[1].split(",").forEach((I)=>{let P=I.trim();if(!P)return;let Z=P.indexOf(":"),V=(Z>=0?P.slice(Z+1).trim():P).split(/[\s=]/)[0];if(V&&!a.has(V))o.push(V),a.add(V)});return}let O=t.slice(c).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(O){if(s&&t.slice(c).startsWith("const"))return;O[1].split(",").forEach((I)=>{let P=I.trim().replace(/^\.\.\./,"");if(!P)return;let Z=P.split(/[\s=]/)[0];if(Z&&!a.has(Z))o.push(Z),a.add(Z)});return}if(s)return;let M=t.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let I=M[1];if(!a.has(I))o.push(I),a.add(I);return}let N=t.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(N){let I=N[1];if(!a.has(I))o.push(I),a.add(I)}};while(c<v){if(t[c]==="{"){h++,c++;continue}if(t[c]==="}"){h--,c++;continue}if(h===0&&/[a-z]/i.test(t[c])&&(c===0||/\s|[;{}()]/.test(t[c-1])))E();c++}return o.join(", ")}function ns(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function oo(e,s=L(e).split(",").map((t)=>t.trim()).filter(Boolean)){let t=new Set(L(e,!0).split(",").map((o)=>o.trim()));return s.map((o)=>t.has(o)?`get ${o}() { return ${o} }, set ${o}(__stxValue_${o}) { ${o} = __stxValue_${o} }`:o).join(", ")}function rs(e,s){let t=`{ ${oo(e,s)} }`;return L(e).split(",").some((o)=>o.trim()==="__stxLiveBindings")?`Object.defineProperties(${t}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:t}import kn from"fs";import Ce from"path";function j(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var pr=new Map;function ss(e,s=!0){let t=pr.get(e);if(s&&t)return t;let o=new Map,a=[Ce.join(e,"src"),Ce.join(e,"dist"),e];function h(c,v){if(v>6)return;let E;try{E=kn.readdirSync(c,{withFileTypes:!0})}catch{return}for(let R of E){let C=Ce.join(c,R.name);if(R.isDirectory()){if(R.name==="node_modules"||R.name.startsWith("."))continue;h(C,v+1)}else if(R.isFile()&&R.name.endsWith(".stx")){let O=R.name.slice(0,-4);if(!o.has(O))o.set(O,C);let M=O.toLowerCase();if(!o.has(M))o.set(M,C);let N=j(O);if(!o.has(N))o.set(N,C)}}}for(let c of a)if(h(c,0),o.size>0)break;if(s)pr.set(e,o);return o}function os(e,s){if(e.startsWith(".")||e.startsWith("/"))return null;let t=s;while(!0){let o=Ce.join(t,"node_modules",e);try{if(kn.statSync(o).isDirectory())return o}catch{}let a=Ce.dirname(t);if(a===t)return null;t=a}}function is(e,s,t={}){return[Ce.resolve(Ce.dirname(s),`${e}.stx`),Ce.resolve(Ce.dirname(s),e),Ce.resolve(t.componentsDir||"components",`${e}.stx`),Ce.resolve(t.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function dr(e){let s=e.endsWith(".stx")?e.slice(0,-4):e,t=s.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),o=j(s);return[s,t,o]}function So(e,s){let[t,o,a]=dr(e);for(let h of[t,t.toLowerCase(),o,a]){let c=s?.__importedComponents?.get(h);if(c!==void 0)return c}}function*ko(e,s,t={},o){let a=dr(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Ce.resolve(Ce.dirname(s),`${a[0]}.stx`);return}let h=[...new Set(a.map((E)=>`${E}.stx`))],c=t.projectRoot||process.cwd(),v=[...o?.__originalFilePath?[Ce.join(Ce.dirname(o.__originalFilePath),"components")]:[],...t.componentsDir?[t.componentsDir]:[],Ce.join(Ce.dirname(s),"components"),Ce.resolve(c,"src/components"),Ce.resolve(c,"components"),...import.meta.dir?[Ce.resolve(import.meta.dir,"components")]:[]];for(let E of new Set(v)){for(let R of h)yield Ce.join(E,R);try{for(let R of kn.readdirSync(E,{withFileTypes:!0}))if(R.isDirectory())for(let C of h)yield Ce.join(E,R.name,C)}catch{}}}function gr(e,s,t={},o){let a=So(e,o);if(a!==void 0)return a;for(let h of ko(e,s,t,o))try{if(kn.statSync(h,{throwIfNoEntry:!1})?.isFile())return h}catch{}return null}import Ks from"fs";import oe from"path";import mt from"path";import Kt from"fs";var ao=new Set(["touchstart","touchmove","wheel","mousewheel"]);function es(e,s){if(s.passive)return!0;if(s.prevent||s.nonpassive)return!1;return ao.has(e.toLowerCase())}var mr=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),hr={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},co=new Set(["ctrl","alt","shift","meta"]),_r={left:0,middle:1,right:2};function xr(e){let s={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let t of e){let o=t.toLowerCase();if(o==="prevent")s.prevent=!0;else if(o==="stop")s.stop=!0;else if(o==="once")s.once=!0;else if(o==="capture")s.capture=!0;else if(o==="self")s.self=!0;else if(o==="passive")s.passive=!0;else if(o==="nonpassive")s.nonpassive=!0;else if(co.has(o))s.systemKeys.push(o);else if(o in _r)s.mouse=o;else if(o in hr||/^[a-z]$/.test(o))s.keys.push(hr[o]||o.toUpperCase());else if(o.startsWith("debounce")){let a=o.match(/debounce(?:\.(\d+))?/);s.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(o.startsWith("throttle")){let a=o.match(/throttle(?:\.(\d+))?/);s.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return s}function wr(e,s=""){let t=[],o=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,h;while((h=a.exec(e))!==null){let[c,v,E]=h,R=h.index,C=R+c.length,O=`__stx_evt_${s}${o++}`,M=[],N=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,I;while((I=N.exec(E))!==null){let[,Z,U]=I,V=Z.split("."),X=V[0];if(!mr.has(X))continue;M.push({attribute:`@${Z}`,event:X,handler:U,modifiers:xr(V.slice(1)),elementId:O})}let P=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((I=P.exec(E))!==null){let[,Z,U]=I,V=Z.split("."),X=V[0];if(!mr.has(X))continue;M.push({attribute:`@${Z}`,event:X,handler:U,modifiers:xr(V.slice(1)),elementId:O})}if(M.length>0)t.push({originalTag:c,elementId:O,events:M,startIndex:R,endIndex:C})}return t}function lo(e){let s=[],{modifiers:t}=e;if(t.self)s.push("if ($event.target !== $el) return");for(let o of t.systemKeys)s.push(`if (!$event.${o}Key) return`);if(t.keys.length>0){let o=t.keys.map((a)=>`$event.key === '${a}'`).join(" || ");s.push(`if (!(${o})) return`)}if(t.mouse!==null){let o=_r[t.mouse];s.push(`if ($event.button !== ${o}) return`)}if(t.prevent)s.push("$event.preventDefault()");if(t.stop)s.push("$event.stopPropagation()");return s.join("; ")}function uo(e,s){let t=e;if(s.debounce!==null)t=`__stx_debounce(() => { ${t} }, ${s.debounce})`;else if(s.throttle!==null)t=`__stx_throttle(() => { ${t} }, ${s.throttle})`;return t}function ts(e){let s=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(s))return e;return`if (typeof ${s} === 'function' && !${s}._isSignal) ${s}($event);`}function fo(e){let{modifiers:s}=e,t=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),o=lo(e),a=uo(ts(e.handler),s),h=[];if(s.once)h.push("once: true");if(s.capture)h.push("capture: true");if(es(e.event,s))h.push("passive: true");let c=h.length>0?`, { ${h.join(", ")} }`:"",v=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
2
+ import{je,mn,ys,Bo,A}from"./chunk-1sr6c0nk.js";import{gn}from"./chunk-144yp2bw.js";import{br,x,ic,st,Go,ac}from"./chunk-pxdww4rb.js";import{T}from"./chunk-ce6zddpf.js";import{bs,l,p,Nt,u,z,D,w,Ss,xe,Fe,ks}from"./chunk-2dp7hyv7.js";import{i,et}from"./chunk-qjtpxsyx.js";import{f}from"./chunk-b7e07ybq.js";import{H}from"./chunk-fbtv2k1p.js";import Je from"path";import Ct from"process";import{AsyncLocalStorage as io}from"async_hooks";var nr=new io;function ln(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function ur(e,s){return nr.run(ln(e),s)}async function fr(e,s){let t=nr.getStore();if(!t)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let o=t.pending.get(e);if(o)return o;let a=Promise.resolve().then(s).then((h)=>{let c=JSON.stringify(h,(E,R)=>{if(R===void 0||typeof R==="function"||typeof R==="symbol"||typeof R==="bigint"||typeof R==="number"&&!Number.isFinite(R))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(R&&typeof R==="object"&&!Array.isArray(R)&&Object.getPrototypeOf(R)!==Object.prototype&&Object.getPrototypeOf(R)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return R}),v=JSON.parse(c);return t.values.set(e,v),v}).catch((h)=>{throw t.pending.delete(e),h});return t.pending.set(e,a),a}function cr(e){let s=e.__stx_server_data;if(!s?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(s.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function L(e,s=!1){let t=i(e),o=[],a=new Set,h=0,c=0,v=t.length,E=()=>{if(h!==0)return;let R=t.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(R){if(s&&R[1]==="const")return;let I=R[2];if(!a.has(I))o.push(I),a.add(I);return}let C=t.slice(c).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(C){if(s&&t.slice(c).startsWith("const"))return;C[1].split(",").forEach((I)=>{let P=I.trim();if(!P)return;let Z=P.indexOf(":"),V=(Z>=0?P.slice(Z+1).trim():P).split(/[\s=]/)[0];if(V&&!a.has(V))o.push(V),a.add(V)});return}let O=t.slice(c).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(O){if(s&&t.slice(c).startsWith("const"))return;O[1].split(",").forEach((I)=>{let P=I.trim().replace(/^\.\.\./,"");if(!P)return;let Z=P.split(/[\s=]/)[0];if(Z&&!a.has(Z))o.push(Z),a.add(Z)});return}if(s)return;let M=t.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let I=M[1];if(!a.has(I))o.push(I),a.add(I);return}let N=t.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(N){let I=N[1];if(!a.has(I))o.push(I),a.add(I)}};while(c<v){if(t[c]==="{"){h++,c++;continue}if(t[c]==="}"){h--,c++;continue}if(h===0&&/[a-z]/i.test(t[c])&&(c===0||/\s|[;{}()]/.test(t[c-1])))E();c++}return o.join(", ")}function ns(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function oo(e,s=L(e).split(",").map((t)=>t.trim()).filter(Boolean)){let t=new Set(L(e,!0).split(",").map((o)=>o.trim()));return s.map((o)=>t.has(o)?`get ${o}() { return ${o} }, set ${o}(__stxValue_${o}) { ${o} = __stxValue_${o} }`:o).join(", ")}function rs(e,s){let t=`{ ${oo(e,s)} }`;return L(e).split(",").some((o)=>o.trim()==="__stxLiveBindings")?`Object.defineProperties(${t}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:t}import kn from"fs";import Ce from"path";function j(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var pr=new Map;function ss(e,s=!0){let t=pr.get(e);if(s&&t)return t;let o=new Map,a=[Ce.join(e,"src"),Ce.join(e,"dist"),e];function h(c,v){if(v>6)return;let E;try{E=kn.readdirSync(c,{withFileTypes:!0})}catch{return}for(let R of E){let C=Ce.join(c,R.name);if(R.isDirectory()){if(R.name==="node_modules"||R.name.startsWith("."))continue;h(C,v+1)}else if(R.isFile()&&R.name.endsWith(".stx")){let O=R.name.slice(0,-4);if(!o.has(O))o.set(O,C);let M=O.toLowerCase();if(!o.has(M))o.set(M,C);let N=j(O);if(!o.has(N))o.set(N,C)}}}for(let c of a)if(h(c,0),o.size>0)break;if(s)pr.set(e,o);return o}function os(e,s){if(e.startsWith(".")||e.startsWith("/"))return null;let t=s;while(!0){let o=Ce.join(t,"node_modules",e);try{if(kn.statSync(o).isDirectory())return o}catch{}let a=Ce.dirname(t);if(a===t)return null;t=a}}function is(e,s,t={}){return[Ce.resolve(Ce.dirname(s),`${e}.stx`),Ce.resolve(Ce.dirname(s),e),Ce.resolve(t.componentsDir||"components",`${e}.stx`),Ce.resolve(t.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function dr(e){let s=e.endsWith(".stx")?e.slice(0,-4):e,t=s.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),o=j(s);return[s,t,o]}function So(e,s){let[t,o,a]=dr(e);for(let h of[t,t.toLowerCase(),o,a]){let c=s?.__importedComponents?.get(h);if(c!==void 0)return c}}function*ko(e,s,t={},o){let a=dr(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Ce.resolve(Ce.dirname(s),`${a[0]}.stx`);return}let h=[...new Set(a.map((E)=>`${E}.stx`))],c=t.projectRoot||process.cwd(),v=[...o?.__originalFilePath?[Ce.join(Ce.dirname(o.__originalFilePath),"components")]:[],...t.componentsDir?[t.componentsDir]:[],Ce.join(Ce.dirname(s),"components"),Ce.resolve(c,"src/components"),Ce.resolve(c,"components"),...import.meta.dir?[Ce.resolve(import.meta.dir,"components")]:[]];for(let E of new Set(v)){for(let R of h)yield Ce.join(E,R);try{for(let R of kn.readdirSync(E,{withFileTypes:!0}))if(R.isDirectory())for(let C of h)yield Ce.join(E,R.name,C)}catch{}}}function gr(e,s,t={},o){let a=So(e,o);if(a!==void 0)return a;for(let h of ko(e,s,t,o))try{if(kn.statSync(h,{throwIfNoEntry:!1})?.isFile())return h}catch{}return null}import Ks from"fs";import oe from"path";import mt from"path";import Kt from"fs";var ao=new Set(["touchstart","touchmove","wheel","mousewheel"]);function es(e,s){if(s.passive)return!0;if(s.prevent||s.nonpassive)return!1;return ao.has(e.toLowerCase())}var mr=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),hr={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},co=new Set(["ctrl","alt","shift","meta"]),_r={left:0,middle:1,right:2};function xr(e){let s={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let t of e){let o=t.toLowerCase();if(o==="prevent")s.prevent=!0;else if(o==="stop")s.stop=!0;else if(o==="once")s.once=!0;else if(o==="capture")s.capture=!0;else if(o==="self")s.self=!0;else if(o==="passive")s.passive=!0;else if(o==="nonpassive")s.nonpassive=!0;else if(co.has(o))s.systemKeys.push(o);else if(o in _r)s.mouse=o;else if(o in hr||/^[a-z]$/.test(o))s.keys.push(hr[o]||o.toUpperCase());else if(o.startsWith("debounce")){let a=o.match(/debounce(?:\.(\d+))?/);s.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(o.startsWith("throttle")){let a=o.match(/throttle(?:\.(\d+))?/);s.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return s}function wr(e,s=""){let t=[],o=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,h;while((h=a.exec(e))!==null){let[c,v,E]=h,R=h.index,C=R+c.length,O=`__stx_evt_${s}${o++}`,M=[],N=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,I;while((I=N.exec(E))!==null){let[,Z,U]=I,V=Z.split("."),X=V[0];if(!mr.has(X))continue;M.push({attribute:`@${Z}`,event:X,handler:U,modifiers:xr(V.slice(1)),elementId:O})}let P=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((I=P.exec(E))!==null){let[,Z,U]=I,V=Z.split("."),X=V[0];if(!mr.has(X))continue;M.push({attribute:`@${Z}`,event:X,handler:U,modifiers:xr(V.slice(1)),elementId:O})}if(M.length>0)t.push({originalTag:c,elementId:O,events:M,startIndex:R,endIndex:C})}return t}function lo(e){let s=[],{modifiers:t}=e;if(t.self)s.push("if ($event.target !== $el) return");for(let o of t.systemKeys)s.push(`if (!$event.${o}Key) return`);if(t.keys.length>0){let o=t.keys.map((a)=>`$event.key === '${a}'`).join(" || ");s.push(`if (!(${o})) return`)}if(t.mouse!==null){let o=_r[t.mouse];s.push(`if ($event.button !== ${o}) return`)}if(t.prevent)s.push("$event.preventDefault()");if(t.stop)s.push("$event.stopPropagation()");return s.join("; ")}function uo(e,s){let t=e;if(s.debounce!==null)t=`__stx_debounce(() => { ${t} }, ${s.debounce})`;else if(s.throttle!==null)t=`__stx_throttle(() => { ${t} }, ${s.throttle})`;return t}function ts(e){let s=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(s))return e;return`if (typeof ${s} === 'function' && !${s}._isSignal) ${s}($event);`}function fo(e){let{modifiers:s}=e,t=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),o=lo(e),a=uo(ts(e.handler),s),h=[];if(s.once)h.push("once: true");if(s.capture)h.push("capture: true");if(es(e.event,s))h.push("passive: true");let c=h.length>0?`, { ${h.join(", ")} }`:"",v=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
3
3
  (function() {
4
4
  var $el = document.getElementById('${t}');
5
5
  if (!$el) return;
@@ -112,7 +112,7 @@ else {
112
112
  `)}
113
113
  })();
114
114
  </script>`}function po(e,s=""){let t=wr(e,s);if(t.length===0)return{template:e,bindings:[]};let o=e,a=[];for(let h=t.length-1;h>=0;h--){let c=t[h],v=c.originalTag;if(!v.includes(" id="))v=v.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${c.elementId}"`);else{let E=v.match(/id=["']([^"']+)["']/);if(E)for(let R of c.events)R.elementId=E[1]}for(let E of c.events){let R=E.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),C=new RegExp(`\\s*${R}\\s*=\\s*"[^"]*"`,"g"),O=new RegExp(`\\s*${R}\\s*=\\s*'[^']*'`,"g");v=v.replace(C,""),v=v.replace(O,"")}o=o.slice(0,c.startIndex)+v+o.slice(c.endIndex),a.push(...c.events)}return{template:o,bindings:a}}function yr(e){let s=e.$uid;return typeof s==="string"&&s?`${s}_`:""}function Ea(e,s,t){if(ac(e))return e;if(s.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:v,bindings:E}=po(e,yr(s)),R=s.__stx_event_bindings||[];return s.__stx_event_bindings=[...R,...E],v}let o=wr(e,yr(s));if(o.length===0)return e;let a=e;for(let v=o.length-1;v>=0;v--){let E=o[v],R=E.originalTag;if(!R.includes(" id="))R=R.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${E.elementId}"`);else{let C=R.match(/id=["']([^"']+)["']/);if(C)for(let O of E.events)O.elementId=C[1]}for(let C of E.events){let O=C.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),M=new RegExp(`\\s*${O}\\s*=\\s*"[^"]*"`,"g"),N=new RegExp(`\\s*${O}\\s*=\\s*'[^']*'`,"g");R=R.replace(M,""),R=R.replace(N,"")}a=a.slice(0,E.startIndex)+R+a.slice(E.endIndex)}let h=_o(o.flatMap((v)=>v.events)),c=a.lastIndexOf("</body>");if(c!==-1)a=a.slice(0,c)+h+`
115
- `+a.slice(c);else a+=h;return a}function Sr(e,s){let t=new Set;for(let o of e.split(",")){let a=o.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(s){let h=a.lastIndexOf(":");if(h!==-1)a=a.slice(h+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))t.add(a)}return t}function Ht(e,s){let t=i(e),{depths:o,balanced:a}=et(t),h=(v)=>!a||o[v]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${s}\\b)`,"g");for(let v of t.matchAll(c)){let E=(v.index??0)+v[0].length-v[1].length;if(h(E))return!0}for(let v of t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(h(v.index??0)&&Sr(v[1],!0).has(s))return!0;for(let v of t.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(h(v.index??0)&&Sr(v[1],!1).has(s))return!0;return!1}var $r="",Rn,ut=/^[A-Za-z_$][\w$]*$/,go=new Set(["if","for","while","switch","with"]),vr=["(","[","{"],Er=[")","]","}"],mo=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function ho(e){let s=i(e),t=[];for(let o of s.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=o.index??0;t.push({text:o[0],start:a,end:a+o[0].length})}return{code:s,tokens:t}}function fs(e){if(Rn&&e===$r)return Rn;let{code:s,tokens:t}=ho(e),o=new Map,a=[];for(let I=0;I<t.length;I++){let P=t[I].text;if(["(","[","{"].includes(P))a.push(I);else if([")","]","}"].includes(P)){let Z=a.at(-1);if(Z!==void 0&&["()","[]","{}"].includes(t[Z].text+P))a.pop(),o.set(Z,I),o.set(I,Z)}}function h(I,P){let Z=[],U=I;for(let V=I;V<P;V++){if(["(","[","{"].includes(t[V].text)&&(o.get(V)??P)<P){V=o.get(V);continue}if(t[V].text===",")Z.push([U,V]),U=V+1}return Z.push([U,P]),Z}let c=[];function v(I,P,Z,U=!1){if(t[I]?.text==="...")I++;if(I>=P)return;let V=t[I].text;if(ut.test(V)){if(Z.add(V),Z===C)c.push({name:V,token:I,functionScoped:U});return}if(V!=="{"&&V!=="[")return;let X=o.get(I);if(X===void 0||X>=P)return;for(let[Y,Q]of h(I+1,X)){let re=Y;if(V==="{")for(let pe=Y;pe<Q;pe++){if(t[pe].text===":"){re=pe+1;break}if(t[pe].text==="=")break;if(["(","[","{"].includes(t[pe].text)&&o.has(pe))pe=o.get(pe)}v(re,Q,Z,U)}}function E(I,P){let Z=new Set;for(let[U,V]of h(I,P))v(U,V,Z);return Z}function R(I){let P=I;for(;P<t.length;P++){let Z=t[P].text;if(["(","[","{"].includes(Z)&&o.has(P)){P=o.get(P);continue}if([",",";",")","]","}"].includes(Z))break}return t[Math.max(I,P-1)]?.end??s.length}let C=new Set,O=[];for(let I=0;I<t.length;I++)if(t[I].text==="=>"){let P=I-1,Z=P,U;if(t[P]?.text===")"&&o.has(P))Z=o.get(P),U=E(Z+1,P);else if(t[P]&&ut.test(t[P].text))U=new Set([t[P].text]);else continue;let V=I+1,X=t[V]?.text==="{"&&o.has(V)?t[o.get(V)].end:R(V);O.push({start:t[Z].start,end:X,bodyStart:t[V]?.start??X,functionBody:!0,names:U})}else if(t[I].text==="("&&o.has(I)){let P=t[I-1]?.text;if(!P||go.has(P)||!ut.test(P)&&P!=="*"&&P!=="]")continue;let Z=o.get(I),U=Z+1;if(t[U]?.text===":"){U++;while(U<t.length&&!["{","=>",";","="].includes(t[U].text))U++}if(t[U]?.text!=="{"||!o.has(U))continue;O.push({start:t[I].start,end:t[o.get(U)].end,bodyStart:t[U].start,functionBody:P!=="catch",names:E(I+1,Z)})}function M(I){let P=I;for(;P<t.length;P++){let Z=t[P].text;if(vr.includes(Z)&&o.has(P)){P=o.get(P);continue}if(Z===";"||Er.includes(Z))break;let U=t[P-1];if(P>I&&mo.has(Z)&&U.text!==".")break;if(P>I&&/[\n\r]/.test(s.slice(U.end,t[P].start))&&(/^[\w$]+$/.test(U.text)||Er.includes(U.text)||['"',"'","`"].includes(U.text))&&ut.test(Z)&&!["in","of","instanceof"].includes(Z))break}return P}let N=[];for(let I=0;I<t.length;I++){if(t[I].text!=="for")continue;let P=t[I+1]?.text==="await"?I+2:I+1;if(t[P]?.text!=="("||!o.has(P))continue;let Z=o.get(P),U=Z+1,V=t[U]?.text==="{"&&o.has(U)?o.get(U):M(U),X=t[V]?.text===";"||t[V]?.text==="}"?t[V].end:t[Math.max(U,V-1)]?.end??s.length;N.push({headStart:P,headEnd:Z,start:t[P].start,end:X})}for(let I=0;I<t.length;I++){let P=t[I].text,Z=t[I-1]?.text;if(Z==="."||t[I+1]?.text===":")continue;if(Z==="as"||Z==="<")continue;if(P==="const"||P==="let"||P==="var"){let U=M(I+1),V=I+1,X=!1,Y=!1,Q=0;for(let re=I+1;re<=U;re++){let pe=t[re]?.text;if(re<U&&vr.includes(pe)&&o.has(re)&&o.get(re)<U){re=o.get(re);continue}if(re<U&&pe===":"&&!Y)X=!0;else if(re<U&&pe==="="&&Q===0)X=!1,Y=!0;else if(re<U&&X&&pe==="<")Q++;else if(re<U&&X&&pe===">"&&Q>0)Q--;else if(re===U||pe===","&&Q===0)v(V,re,C,P==="var"),V=re+1,X=!1,Y=!1}}else if(P==="function"||P==="class"){let U=I+1;if(t[U]?.text==="*")U++;if(t[U]&&ut.test(t[U].text)&&t[U].text!=="extends")C.add(t[U].text),c.push({name:t[U].text,token:U})}else if(P==="import"){let U=I+1;if(t[U]?.text==="*"&&t[U+1]?.text==="as")U+=2;let V=t[U]?.text;if(V&&ut.test(V)&&V!=="type"&&t[U+1]?.text!=="("&&t[U+1]?.text!==".")C.add(V),c.push({name:V,token:U,file:!0});let X=t[U]?.text==="{"?U:t[U+1]?.text===","&&t[U+2]?.text==="{"?U+2:-1;if(X!==-1&&o.has(X)){let Y=o.get(X);for(let[Q,re]of h(X+1,Y)){let pe=re-1;while(pe>=Q&&!ut.test(t[pe].text))pe--;if(pe>=Q&&t[pe].text!=="type")c.push({name:t[pe].text,token:pe,file:!0})}}}}return $r=e,Rn={code:s,scopes:O,loops:N,declarations:C,sites:c,tokens:t,pairs:o},Rn}function xs(e){let s=fs(e);return{code:s.code,shadows:(t,o)=>s.scopes.some((a)=>o>=a.start&&o<a.end&&a.names.has(t))}}function Cn(e){return new Set(fs(e).declarations)}function rn(e,s){let{scopes:t,loops:o,sites:a,tokens:h,pairs:c}=fs(e),v=Array.from({length:h.length},()=>-1),E=[];for(let N=0;N<h.length;N++){v[N]=E.length?E[E.length-1]:-1;let I=h[N].text;if(I==="{"&&c.has(N))E.push(N);else if(I==="}"&&E.length&&c.get(N)===E[E.length-1])E.pop()}let R=new Set,C=new Map;for(let N of a){if(!s.has(N.name))continue;R.add(N.token);let I=N.file?-1:v[N.token],P=I===-1?[0,Number.POSITIVE_INFINITY]:[h[I].start,h[c.get(I)].end];if(N.functionScoped){let U=h[N.token].start,V=t.filter((X)=>X.functionBody&&U>=X.bodyStart&&U<X.end).sort((X,Y)=>X.end-X.bodyStart-(Y.end-Y.bodyStart))[0];P=V?[V.bodyStart,V.end]:[0,Number.POSITIVE_INFINITY]}else if(!N.file){let U=o.filter((V)=>N.token>V.headStart&&N.token<V.headEnd).sort((V,X)=>V.headEnd-V.headStart-(X.headEnd-X.headStart))[0];if(U)P=[U.start,U.end]}let Z=C.get(N.name);if(Z)Z.push(P);else C.set(N.name,[P])}let O=new Set;for(let N=0;N<h.length;N++){if(h[N].text!=="import"||h[N-1]?.text===".")continue;let I=N+1;if(h[I]?.text==="type")I++;if(h[I]&&ut.test(h[I].text)&&h[I+1]?.text===",")I+=2;if(h[I]?.text==="{"&&c.has(I))for(let P=I+1;P<c.get(I);P++)O.add(P)}let M=new Set;for(let N=0;N<h.length;N++){let I=h[N].text;if(!s.has(I)||M.has(I)||R.has(N)||O.has(N))continue;let P=h[N-1]?.text;if(P==="#"||P==="."&&h[N-2]?.text!=="..")continue;if(h[N+1]?.text===":"&&(P==="{"||P===","))continue;let Z=h[N].start;if(C.get(I)?.some(([U,V])=>Z>=U&&Z<V))continue;if(t.some((U)=>Z>=U.start&&Z<U.end&&U.names.has(I)))continue;M.add(I)}return M}var Re="0.2.668";var kr=Symbol.for(`stx.lazy-module-promises.${Re}`);function bo(){let e=globalThis;return e[kr]??=new Map,e[kr]}function r(e,s){let t=bo(),o=`${import.meta.url}\x00${e}`,a=t.get(o);if(a)return a;let h=s();return t.set(o,h),h.catch(()=>{if(t.get(o)===h)t.delete(o)}),h}var yo=/<\/(script)/gi;function sn(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(yo,"<\\/$1")}import Tr from"fs";class B{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,s){this.maxSize=e,this.options=s??null,this.sizes=s?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let s=this.cache.keys().next().value;if(s===void 0)break;this.delete(s)}}get(e){if(!this.cache.has(e))return;let s=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,s),s}set(e,s){if(this.cache.has(e))this.delete(e);let t=this.options?this.options.sizeOf(s):0;if(this.options&&t>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+t>this.options.maxBytes)){let o=this.cache.keys().next().value;if(o===void 0)break;this.delete(o)}if(this.cache.set(e,s),this.sizes)this.sizes.set(e,t),this.bytes+=t}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let s=this.sizes.get(e);if(s!==void 0)this.bytes-=s,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var St=new Map,wo=500;function Et(e,s){if(s?.includes("g"))return new RegExp(e,s);let t=`${e}:${s||""}`;if(!St.has(t)){if(St.size>=wo){let o=St.keys().next().value;if(o)St.delete(o)}St.set(t,new RegExp(e,s))}return St.get(t)}class Rr{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let s=Array.from(new Set(e)),t=s.sort().join(","),o=this.pool.find((v)=>v.context.join(",")===t);if(o)return o.func;let a=this.fnCache,h=this.fnCacheMaxSize,c=(...v)=>(E)=>{try{let R=`${t}:${E}`,C=a.get(R);if(!C){if(a.size>=h){let O=a.keys().next().value;if(O)a.delete(O)}C=Function(...s,`
115
+ `+a.slice(c);else a+=h;return a}function Sr(e,s){let t=new Set;for(let o of e.split(",")){let a=o.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(s){let h=a.lastIndexOf(":");if(h!==-1)a=a.slice(h+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))t.add(a)}return t}function Ht(e,s){let t=i(e),{depths:o,balanced:a}=et(t),h=(v)=>!a||o[v]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${s}\\b)`,"g");for(let v of t.matchAll(c)){let E=(v.index??0)+v[0].length-v[1].length;if(h(E))return!0}for(let v of t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(h(v.index??0)&&Sr(v[1],!0).has(s))return!0;for(let v of t.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(h(v.index??0)&&Sr(v[1],!1).has(s))return!0;return!1}var $r="",Rn,ut=/^[A-Za-z_$][\w$]*$/,go=new Set(["if","for","while","switch","with"]),vr=["(","[","{"],Er=[")","]","}"],mo=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function ho(e){let s=i(e),t=[];for(let o of s.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=o.index??0;t.push({text:o[0],start:a,end:a+o[0].length})}return{code:s,tokens:t}}function fs(e){if(Rn&&e===$r)return Rn;let{code:s,tokens:t}=ho(e),o=new Map,a=[];for(let I=0;I<t.length;I++){let P=t[I].text;if(["(","[","{"].includes(P))a.push(I);else if([")","]","}"].includes(P)){let Z=a.at(-1);if(Z!==void 0&&["()","[]","{}"].includes(t[Z].text+P))a.pop(),o.set(Z,I),o.set(I,Z)}}function h(I,P){let Z=[],U=I;for(let V=I;V<P;V++){if(["(","[","{"].includes(t[V].text)&&(o.get(V)??P)<P){V=o.get(V);continue}if(t[V].text===",")Z.push([U,V]),U=V+1}return Z.push([U,P]),Z}let c=[];function v(I,P,Z,U=!1){if(t[I]?.text==="...")I++;if(I>=P)return;let V=t[I].text;if(ut.test(V)){if(Z.add(V),Z===C)c.push({name:V,token:I,functionScoped:U});return}if(V!=="{"&&V!=="[")return;let X=o.get(I);if(X===void 0||X>=P)return;for(let[Y,Q]of h(I+1,X)){let re=Y;if(V==="{")for(let pe=Y;pe<Q;pe++){if(t[pe].text===":"){re=pe+1;break}if(t[pe].text==="=")break;if(["(","[","{"].includes(t[pe].text)&&o.has(pe))pe=o.get(pe)}v(re,Q,Z,U)}}function E(I,P){let Z=new Set;for(let[U,V]of h(I,P))v(U,V,Z);return Z}function R(I){let P=I;for(;P<t.length;P++){let Z=t[P].text;if(["(","[","{"].includes(Z)&&o.has(P)){P=o.get(P);continue}if([",",";",")","]","}"].includes(Z))break}return t[Math.max(I,P-1)]?.end??s.length}let C=new Set,O=[];for(let I=0;I<t.length;I++)if(t[I].text==="=>"){let P=I-1,Z=P,U;if(t[P]?.text===")"&&o.has(P))Z=o.get(P),U=E(Z+1,P);else if(t[P]&&ut.test(t[P].text))U=new Set([t[P].text]);else continue;let V=I+1,X=t[V]?.text==="{"&&o.has(V)?t[o.get(V)].end:R(V);O.push({start:t[Z].start,end:X,bodyStart:t[V]?.start??X,functionBody:!0,names:U})}else if(t[I].text==="("&&o.has(I)){let P=t[I-1]?.text;if(!P||go.has(P)||!ut.test(P)&&P!=="*"&&P!=="]")continue;let Z=o.get(I),U=Z+1;if(t[U]?.text===":"){U++;while(U<t.length&&!["{","=>",";","="].includes(t[U].text))U++}if(t[U]?.text!=="{"||!o.has(U))continue;O.push({start:t[I].start,end:t[o.get(U)].end,bodyStart:t[U].start,functionBody:P!=="catch",names:E(I+1,Z)})}function M(I){let P=I;for(;P<t.length;P++){let Z=t[P].text;if(vr.includes(Z)&&o.has(P)){P=o.get(P);continue}if(Z===";"||Er.includes(Z))break;let U=t[P-1];if(P>I&&mo.has(Z)&&U.text!==".")break;if(P>I&&/[\n\r]/.test(s.slice(U.end,t[P].start))&&(/^[\w$]+$/.test(U.text)||Er.includes(U.text)||['"',"'","`"].includes(U.text))&&ut.test(Z)&&!["in","of","instanceof"].includes(Z))break}return P}let N=[];for(let I=0;I<t.length;I++){if(t[I].text!=="for")continue;let P=t[I+1]?.text==="await"?I+2:I+1;if(t[P]?.text!=="("||!o.has(P))continue;let Z=o.get(P),U=Z+1,V=t[U]?.text==="{"&&o.has(U)?o.get(U):M(U),X=t[V]?.text===";"||t[V]?.text==="}"?t[V].end:t[Math.max(U,V-1)]?.end??s.length;N.push({headStart:P,headEnd:Z,start:t[P].start,end:X})}for(let I=0;I<t.length;I++){let P=t[I].text,Z=t[I-1]?.text;if(Z==="."||t[I+1]?.text===":")continue;if(Z==="as"||Z==="<")continue;if(P==="const"||P==="let"||P==="var"){let U=M(I+1),V=I+1,X=!1,Y=!1,Q=0;for(let re=I+1;re<=U;re++){let pe=t[re]?.text;if(re<U&&vr.includes(pe)&&o.has(re)&&o.get(re)<U){re=o.get(re);continue}if(re<U&&pe===":"&&!Y)X=!0;else if(re<U&&pe==="="&&Q===0)X=!1,Y=!0;else if(re<U&&X&&pe==="<")Q++;else if(re<U&&X&&pe===">"&&Q>0)Q--;else if(re===U||pe===","&&Q===0)v(V,re,C,P==="var"),V=re+1,X=!1,Y=!1}}else if(P==="function"||P==="class"){let U=I+1;if(t[U]?.text==="*")U++;if(t[U]&&ut.test(t[U].text)&&t[U].text!=="extends")C.add(t[U].text),c.push({name:t[U].text,token:U})}else if(P==="import"){let U=I+1;if(t[U]?.text==="*"&&t[U+1]?.text==="as")U+=2;let V=t[U]?.text;if(V&&ut.test(V)&&V!=="type"&&t[U+1]?.text!=="("&&t[U+1]?.text!==".")C.add(V),c.push({name:V,token:U,file:!0});let X=t[U]?.text==="{"?U:t[U+1]?.text===","&&t[U+2]?.text==="{"?U+2:-1;if(X!==-1&&o.has(X)){let Y=o.get(X);for(let[Q,re]of h(X+1,Y)){let pe=re-1;while(pe>=Q&&!ut.test(t[pe].text))pe--;if(pe>=Q&&t[pe].text!=="type")c.push({name:t[pe].text,token:pe,file:!0})}}}}return $r=e,Rn={code:s,scopes:O,loops:N,declarations:C,sites:c,tokens:t,pairs:o},Rn}function xs(e){let s=fs(e);return{code:s.code,shadows:(t,o)=>s.scopes.some((a)=>o>=a.start&&o<a.end&&a.names.has(t))}}function Cn(e){return new Set(fs(e).declarations)}function rn(e,s){let{scopes:t,loops:o,sites:a,tokens:h,pairs:c}=fs(e),v=Array.from({length:h.length},()=>-1),E=[];for(let N=0;N<h.length;N++){v[N]=E.length?E[E.length-1]:-1;let I=h[N].text;if(I==="{"&&c.has(N))E.push(N);else if(I==="}"&&E.length&&c.get(N)===E[E.length-1])E.pop()}let R=new Set,C=new Map;for(let N of a){if(!s.has(N.name))continue;R.add(N.token);let I=N.file?-1:v[N.token],P=I===-1?[0,Number.POSITIVE_INFINITY]:[h[I].start,h[c.get(I)].end];if(N.functionScoped){let U=h[N.token].start,V=t.filter((X)=>X.functionBody&&U>=X.bodyStart&&U<X.end).sort((X,Y)=>X.end-X.bodyStart-(Y.end-Y.bodyStart))[0];P=V?[V.bodyStart,V.end]:[0,Number.POSITIVE_INFINITY]}else if(!N.file){let U=o.filter((V)=>N.token>V.headStart&&N.token<V.headEnd).sort((V,X)=>V.headEnd-V.headStart-(X.headEnd-X.headStart))[0];if(U)P=[U.start,U.end]}let Z=C.get(N.name);if(Z)Z.push(P);else C.set(N.name,[P])}let O=new Set;for(let N=0;N<h.length;N++){if(h[N].text!=="import"||h[N-1]?.text===".")continue;let I=N+1;if(h[I]?.text==="type")I++;if(h[I]&&ut.test(h[I].text)&&h[I+1]?.text===",")I+=2;if(h[I]?.text==="{"&&c.has(I))for(let P=I+1;P<c.get(I);P++)O.add(P)}let M=new Set;for(let N=0;N<h.length;N++){let I=h[N].text;if(!s.has(I)||M.has(I)||R.has(N)||O.has(N))continue;let P=h[N-1]?.text;if(P==="#"||P==="."&&h[N-2]?.text!=="..")continue;if(h[N+1]?.text===":"&&(P==="{"||P===","))continue;let Z=h[N].start;if(C.get(I)?.some(([U,V])=>Z>=U&&Z<V))continue;if(t.some((U)=>Z>=U.start&&Z<U.end&&U.names.has(I)))continue;M.add(I)}return M}var Re="0.2.669";var kr=Symbol.for(`stx.lazy-module-promises.${Re}`);function bo(){let e=globalThis;return e[kr]??=new Map,e[kr]}function r(e,s){let t=bo(),o=`${import.meta.url}\x00${e}`,a=t.get(o);if(a)return a;let h=s();return t.set(o,h),h.catch(()=>{if(t.get(o)===h)t.delete(o)}),h}var yo=/<\/(script)/gi;function sn(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(yo,"<\\/$1")}import Tr from"fs";class B{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,s){this.maxSize=e,this.options=s??null,this.sizes=s?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let s=this.cache.keys().next().value;if(s===void 0)break;this.delete(s)}}get(e){if(!this.cache.has(e))return;let s=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,s),s}set(e,s){if(this.cache.has(e))this.delete(e);let t=this.options?this.options.sizeOf(s):0;if(this.options&&t>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+t>this.options.maxBytes)){let o=this.cache.keys().next().value;if(o===void 0)break;this.delete(o)}if(this.cache.set(e,s),this.sizes)this.sizes.set(e,t),this.bytes+=t}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let s=this.sizes.get(e);if(s!==void 0)this.bytes-=s,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var St=new Map,wo=500;function Et(e,s){if(s?.includes("g"))return new RegExp(e,s);let t=`${e}:${s||""}`;if(!St.has(t)){if(St.size>=wo){let o=St.keys().next().value;if(o)St.delete(o)}St.set(t,new RegExp(e,s))}return St.get(t)}class Rr{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let s=Array.from(new Set(e)),t=s.sort().join(","),o=this.pool.find((v)=>v.context.join(",")===t);if(o)return o.func;let a=this.fnCache,h=this.fnCacheMaxSize,c=(...v)=>(E)=>{try{let R=`${t}:${E}`,C=a.get(R);if(!C){if(a.size>=h){let O=a.keys().next().value;if(O)a.delete(O)}C=Function(...s,`
116
116
  'use strict';
117
117
  try {
118
118
  return ${E};
@@ -193,7 +193,7 @@ else {
193
193
  // STX: auto-generated event bindings
194
194
  ${e.map((t,o)=>na(t,o)).join(`
195
195
  `)}`}function Mr(e){let s=[],t=new Set,o=e.replace(/^\s*import\s+.*$/gm,""),a=0,h=o.length,c=0;while(c<h){let v=o[c];if(v==="'"||v==='"'||v==="`"){let E=v;if(c++,E==="`"){let R=0;while(c<h){if(o[c]==="\\"){c+=2;continue}if(o[c]==="`"&&R===0){c++;break}if(o[c]==="$"&&o[c+1]==="{"){R++,c+=2;continue}if(o[c]==="}"&&R>0){R--,c++;continue}c++}}else while(c<h){if(o[c]==="\\"){c+=2;continue}if(o[c]===E){c++;break}c++}continue}if(v==="/"&&o[c+1]==="/"){while(c<h&&o[c]!==`
196
- `)c++;continue}if(v==="/"&&o[c+1]==="*"){c+=2;while(c<h-1&&!(o[c]==="*"&&o[c+1]==="/"))c++;c+=2;continue}if(v==="{"){a++,c++;continue}if(v==="}"){a--,c++;continue}if(a===0){let E=o.slice(c),R=E.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(R){let M=R[1];if(!M.startsWith("_")&&!t.has(M))s.push(M),t.add(M);c+=R[0].length;continue}let C=E.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(C){C[1].split(",").forEach((M)=>{let N=M.trim(),I=N.indexOf(":"),P=I>=0?N.slice(I+1).trim().split(/[\s=]/)[0]:N.split(/[\s=]/)[0];if(P&&!P.startsWith("_")&&!t.has(P))s.push(P),t.add(P)}),c+=C[0].length;continue}let O=E.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(O){let M=O[1];if(!M.startsWith("_")&&!t.has(M))s.push(M),t.add(M);c+=O[0].length;continue}}c++}return s}var ra=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function ia(e){let s=new Set,t=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function o(M){let N;while((N=t.exec(M))!==null){let I=N[0];if(!ra.has(I))s.add(I)}}let a=/\{\{([\s\S]*?)\}\}/g,h;while((h=a.exec(e))!==null)o(h[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((h=c.exec(e))!==null)o(h[1]);let v=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((h=v.exec(e))!==null)o(h[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((h=E.exec(e))!==null)o(h[1]);let R=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((h=R.exec(e))!==null)o(h[1]);let C=/@model\s*=\s*["']([^"']*)["']/gi;while((h=C.exec(e))!==null)o(h[1]);let O=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((h=O.exec(e))!==null)o(h[1]);return s}async function Ne(e,s={}){let t=e,o="",a=!1,h=[],c=Io(t,{filePath:s.filePath,projectRoot:s.projectRoot});t=c.code;let v=Oo(c.styles),E=Pt(t);t=E.code,h=[...E.imports,...E.models];let{hasUserImports:R,bundleClientScript:C}=await r("stx/client-script-bundler",()=>import("./chunk-ynh1ppa6.js"));if(R(t))t=await C(t,s.filePath||"",{projectRoot:s.projectRoot,minify:s.production}),a=!0;if(s.autoImports!==!1){let X=Wa(t);t=X.code,o=qa(X.stxImports,X.browserImports.filter((Y)=>!h.includes(Y)))}if(o=`${dn(t,s.serverData)}${o}`,t=T(t),!a&&De(s.attrs||""))t=Me(t);let O=sa(s.eventBindings||[]),M=(s.attrs||"").trim(),N=/\btype\s*=\s*["']module["']/i.test(M),I=s.instanceId?` data-stx-instance="${s.instanceId}"`:"";if(N){let X=M.replace(/\btype\s*=\s*["']module["']/i,"").trim(),Y=`type="module" data-stx-scoped${I}${X?` ${X}`:""}`;return`${v}<script ${Y}>
196
+ `)c++;continue}if(v==="/"&&o[c+1]==="*"){c+=2;while(c<h-1&&!(o[c]==="*"&&o[c+1]==="/"))c++;c+=2;continue}if(v==="{"){a++,c++;continue}if(v==="}"){a--,c++;continue}if(a===0){let E=o.slice(c),R=E.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(R){let M=R[1];if(!M.startsWith("_")&&!t.has(M))s.push(M),t.add(M);c+=R[0].length;continue}let C=E.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(C){C[1].split(",").forEach((M)=>{let N=M.trim(),I=N.indexOf(":"),P=I>=0?N.slice(I+1).trim().split(/[\s=]/)[0]:N.split(/[\s=]/)[0];if(P&&!P.startsWith("_")&&!t.has(P))s.push(P),t.add(P)}),c+=C[0].length;continue}let O=E.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(O){let M=O[1];if(!M.startsWith("_")&&!t.has(M))s.push(M),t.add(M);c+=O[0].length;continue}}c++}return s}var ra=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function ia(e){let s=new Set,t=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function o(M){let N;while((N=t.exec(M))!==null){let I=N[0];if(!ra.has(I))s.add(I)}}let a=/\{\{([\s\S]*?)\}\}/g,h;while((h=a.exec(e))!==null)o(h[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((h=c.exec(e))!==null)o(h[1]);let v=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((h=v.exec(e))!==null)o(h[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((h=E.exec(e))!==null)o(h[1]);let R=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((h=R.exec(e))!==null)o(h[1]);let C=/@model\s*=\s*["']([^"']*)["']/gi;while((h=C.exec(e))!==null)o(h[1]);let O=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((h=O.exec(e))!==null)o(h[1]);return s}async function Ne(e,s={}){let t=e,o="",a=!1,h=[],c=Io(t,{filePath:s.filePath,projectRoot:s.projectRoot});t=c.code;let v=Oo(c.styles),E=Pt(t);t=E.code,h=[...E.imports,...E.models];let{hasUserImports:R,bundleClientScript:C}=await r("stx/client-script-bundler",()=>import("./chunk-ywqs7x8g.js"));if(R(t))t=await C(t,s.filePath||"",{projectRoot:s.projectRoot,minify:s.production}),a=!0;if(s.autoImports!==!1){let X=Wa(t);t=X.code,o=qa(X.stxImports,X.browserImports.filter((Y)=>!h.includes(Y)))}if(o=`${dn(t,s.serverData)}${o}`,t=T(t),!a&&De(s.attrs||""))t=Me(t);let O=sa(s.eventBindings||[]),M=(s.attrs||"").trim(),N=/\btype\s*=\s*["']module["']/i.test(M),I=s.instanceId?` data-stx-instance="${s.instanceId}"`:"";if(N){let X=M.replace(/\btype\s*=\s*["']module["']/i,"").trim(),Y=`type="module" data-stx-scoped${I}${X?` ${X}`:""}`;return`${v}<script ${Y}>
197
197
  ${sn(`${o}${t}
198
198
  ${O}`)}
199
199
  </script>`}let P=Go(e),Z=/function __stx_setup_/.test(t),U=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function V(X){let Y=X.length>0?`
@@ -286,8 +286,8 @@ ${R.join(`
286
286
  `)a++;return!0}if(e[a]==="/"&&e[a+1]==="*"){a+=2;while(a<h-1&&!(e[a]==="*"&&e[a+1]==="/"))a++;return a+=2,!0}return!1},R=()=>{if(o!==0)return;let C=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(C){let I=C[2].split(",").map((P)=>{let Z=P.trim().split(":");return Z[Z.length-1].trim()});for(let P of I)if(P&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(P)&&!t.has(P))s.push(P),t.add(P);return}let O=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(O){let I=O[2];if(!t.has(I))s.push(I),t.add(I);return}let M=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let I=M[1];if(!t.has(I))s.push(I),t.add(I);return}let N=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(N){let I=N[1];if(!t.has(I))s.push(I),t.add(I)}};while(a<h){if(E())continue;if(e[a]==="'"||e[a]==='"'){c(e[a]);continue}if(e[a]==="`"){v();continue}if(e[a]==="{"){o++,a++;continue}if(e[a]==="}"){o--,a++;continue}if(o===0&&/[a-z]/i.test(e[a])&&(a===0||/\s|[;{}()]/.test(e[a-1])))R();a++}return s}function fl(e){let s=[],t=0,o=0,a=null;for(let h=0;h<e.length;h++){let c=e[h];if(a){if(c==="\\"){h++;continue}if(c===a)a=null;continue}if(c==='"'||c==="'"||c==="`"){a=c;continue}if(c==="("||c==="["||c==="{")t++;else if(c===")"||c==="]"||c==="}")t--;else if(c===","&&t===0)s.push(e.slice(o,h)),o=h+1}if(o<e.length)s.push(e.slice(o));return s}function pl(e){let s=0,t=null;for(let o=0;o<e.length;o++){let a=e[o];if(t){if(a==="\\"){o++;continue}if(a===t)t=null;continue}if(a==='"'||a==="'"||a==="`"){t=a;continue}if(a==="("||a==="["||a==="{")s++;else if(a===")"||a==="]"||a==="}")s--;else if(a==="="&&s===0){let h=e[o-1],c=e[o+1];if(h==="!"||h==="<"||h===">"||h==="=")continue;if(c==="="||c===">")continue;return o}}return-1}function dl(e,s){try{let t=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec(e);if(!t)return;let o=t.index-1;while(o>=0&&/\s/.test(e[o]))o--;if(e[o]!=="}")return;let a=o,h=0,c=-1;for(;o>=0;o--){let E=e[o];if(E==="}")h++;else if(E==="{"){if(h--,h===0){c=o;break}}}if(c===-1)return;let v=e.slice(c+1,a);for(let E of fl(v)){let R=E.trim();if(!R||R.startsWith("..."))continue;let C=pl(R);if(C===-1)continue;let O=R.slice(0,C).trim();if(!/^[A-Z_$][\w$]*$/i.test(O))continue;if(s[O]!==void 0)continue;let M=R.slice(C+1).trim();if(!M)continue;try{let N=Object.keys(s).filter(Nt),I=Function(...N,`"use strict"; return (${M});`);s[O]=I(...N.map((P)=>s[P]))}catch{}}}catch{}}var gl=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function tu(e,s){let t=e.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)<([a-zA-Z][a-zA-Z0-9-]*)/s);if(!t)return null;let o=t[2].toLowerCase();if(!gl.has(o))return null;let a=new RegExp(`<\\/?${o}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),h=ce(e,(R,C)=>(a.lastIndex=C,a.exec(R)?.index===C?a.lastIndex:-1));if(o==="span"&&/\sdata-stx-scope\s*=/.test(h[0]?.token||""))return null;let c=0,v=!1;for(let R of h){if(c+=R.token.startsWith("</")?-1:1,c<0)return null;if(c===0){if(e.slice(R.end).trim())return null;v=!0;break}}if(!v)return null;let E=t[0].length;return e.slice(0,E)+s+e.slice(E)}async function lr(e,s,t,o,a){let h=e.endsWith(".stx")?e.slice(0,-4):e,c=(Q)=>Q.split("-").map((re)=>re.charAt(0).toUpperCase()+re.slice(1)).join(""),v=t.__importedComponents;if(v){for(let Q of[h,h.toLowerCase(),c(h),j(h)])if(v.has(Q))return!0}let E=[...new Set([`${h}.stx`,`${c(h)}.stx`,`${j(h)}.stx`])],R=typeof a.root==="string"?oe.resolve(a.root):void 0,C=R??oe.dirname(o),O=[],M=(Q)=>{if(Q&&!O.includes(Q))O.push(Q)},N=t.__originalFilePath;if(N)M(oe.join(oe.dirname(N),"components"));M(s),M(a._rootComponentsDir),M(oe.join(oe.dirname(o),"components")),M(a.componentsDir);let I=a._targetComponentFallbackNames?.some((Q)=>Q.toLowerCase()===h.toLowerCase());if(!I)for(let Q of a._targetComponentDirs??[])M(Q);if(R)M(oe.resolve(R,"resources/views/components")),M(oe.resolve(R,"resources/components")),M(oe.resolve(R,"src/components")),M(oe.resolve(R,"components"));for(let Q of a._layerComponentDirs??[])M(Q);let P=a._pluginComponentDirs;if(Array.isArray(P))for(let Q of P)M(typeof Q==="string"?Q:null);if(M(a.fallbackComponentsDir),I)for(let Q of a._targetComponentDirs??[])M(Q);if(h.startsWith("./")||h.startsWith("../"))return n(oe.resolve(oe.dirname(o),`${h}.stx`));let Z=Li(oe.resolve(import.meta.dir,"components")),U=O.map((Q)=>oe.isAbsolute(Q)?Q:oe.resolve(C,Q)),V=`${E.join("\x00")}\x00\x00${U.join("\x00")}`,X=Fs.get(V);if(X!==void 0)return X;let Y=!1;e:for(let Q of U){if(Li(Q)===Z)continue;for(let re of E)if(await n(oe.join(Q,re))){Y=!0;break e}}return Fs.set(V,Y),Y}function Li(e){let s=Vs.get(e);if(s!==void 0)return s;let t=e;try{t=Ks.realpathSync(e)}catch{}return Vs.set(e,t),t}function nu(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function Ga(e){if(!e)return!1;let s=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(s)}function ml(e,s,t){if(!e.includes("{{")&&!e.includes("{!!"))return e;let o=(a,h)=>{let c;try{c=_(a,s)}catch{return h}if(c===void 0||c===null)return"";let v=String(c);if(/<\/style/i.test(v))return console.warn(`[stx] a <style> expression in ${t??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return v};return e.replace(/\{!!([\s\S]*?)!!\}/g,(a,h)=>o(h,a)).replace(/\{\{([\s\S]*?)\}\}/g,(a,h)=>o(h,a))}var Bi=new Set;function zi(e,s,t,o){let a=`${e}\x00${s}\x00${o??""}`;if(!process.env.STX_DEBUG&&Bi.has(a))return;Bi.add(a);let h=s?` used in ${s}`:"",c=o?` Cause: ${o}.`:"",v=t.length>0?`
287
287
  searched:
288
288
  ${t.map((E)=>` - ${E}`).join(`
289
- `)}`:"";console.error(`[stx] component <${e}> could not be resolved${h}, so it rendered as nothing.${c}${v}`)}function Wi(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}function Do(e){let s=new Set,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let o of e){let a;while((a=t.exec(o))!==null)s.add(a[1]);t.lastIndex=0}return[...s]}async function Le(e,s,t,o,a,h,c,v=new Set,E,R=Qe(a),C,O=e){let{extractVariables:M}=await r("stx/variable-extractor",()=>import("./chunk-s5w3t7xw.js")),N=v??new Set;if(N.has(e))return`[Circular component reference: ${e}]`;let I=new Set(N);I.add(e);let P=typeof s.client==="string"?s.client.trim():"";if("client"in s)delete s.client;let Z=P&&P!=="load"&&nu(P)?P:"";try{let U=(ie)=>ie.split("-").map((se)=>se.charAt(0).toUpperCase()+se.slice(1)).join(""),V=O.endsWith(".stx")?O.slice(0,-4):O,X=null,Y=a.__importedComponents;if(Y){let ie=[V,V.toLowerCase(),U(V),j(V)];for(let se of ie)if(Y.has(se)){X=Y.get(se);break}}let Q=[];if(!X){let ie=[`${V}.stx`,`${U(V)}.stx`,`${j(V)}.stx`],se=[...new Set(ie)],ge=a.__originalFilePath,me=[];if(me.push(...c._layerComponentDirs??[]),ge){let Se=oe.join(oe.dirname(ge),"components");me.push(Se)}if(o)me.push(o);let He=c._rootComponentsDir;if(typeof He==="string"&&!me.includes(He))me.push(He);let Be=oe.join(oe.dirname(h),"components");if(!me.includes(Be))me.push(Be);if(c.componentsDir&&c.componentsDir!==o&&!me.includes(c.componentsDir))me.push(c.componentsDir);let at=c._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(V),ct=(C?.events??[]).map((Se)=>Se.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),lt=Object.hasOwn(s,"checked")||Boolean(C?.reactiveProps?.includes("checked")),_t=Object.hasOwn(s,"value")||Boolean(C?.reactiveProps?.includes("value")),_n=!ct.includes("valuechange")&&(lt||ct.includes("change")&&!_t),Xn=c._nativeHostAttrs&&/^textinput$/i.test(V),wt=ct.includes("update:value")&&!ct.includes("input"),Vt=c._targetComponentFallbackNames?.some((Se)=>Se.toLowerCase()===V.toLowerCase())&&(!at||_n)&&(!Xn||wt);for(let Se of Vt?[]:c._targetComponentDirs??[])if(Se&&!me.includes(Se))me.push(Se);let nt=typeof c.root==="string"?oe.resolve(c.root):void 0,wn=nt??oe.dirname(h),rt=[];if(nt)rt.push(oe.resolve(nt,"resources/views/components")),rt.push(oe.resolve(nt,"resources/components")),rt.push(oe.resolve(nt,"src/components")),rt.push(oe.resolve(nt,"components"));rt.push(oe.resolve(import.meta.dir,"components"));for(let Se of rt)if(!me.includes(Se))me.push(Se);let Ut=c._pluginComponentDirs;if(Array.isArray(Ut)){for(let Se of Ut)if(typeof Se==="string"&&!me.includes(Se))me.push(Se)}if(c.fallbackComponentsDir&&!me.includes(c.fallbackComponentsDir))me.push(c.fallbackComponentsDir);if(Vt){for(let Se of c._targetComponentDirs??[])if(Se&&!me.includes(Se))me.push(Se)}let Qs=[...new Set(me.map((Se)=>{if(!Se)return Se;return oe.isAbsolute(Se)?Se:oe.resolve(wn,Se)}))];me.length=0,me.push(...Qs);let Jn=`${V}\x00${h}\x00${Qs.join("\x00")}`,Gn=Fn.get(Jn);if(Gn)if(await n(Gn))X=Gn;else Fn.delete(Jn);if(!X&&(V.startsWith("./")||V.startsWith("../")))X=oe.resolve(oe.dirname(h),`${V}.stx`),Q.push(X);else if(!X)for(let Se of me){if(!Se)continue;for(let Sn of se){let $n=oe.join(Se,Sn);if(Q.push($n),await n($n)){X=$n;break}}if(X)break;if(!X)try{let Sn=await import("fs");if(!Sn.statSync(Se,{throwIfNoEntry:!1})?.isDirectory())continue;let so=8,Yn=[{path:Se,depth:0}];while(Yn.length>0&&!X){let vn=Yn.pop();if(vn.depth>=so)continue;let er;try{er=Sn.readdirSync(vn.path,{withFileTypes:!0})}catch{continue}for(let En of er){if(!En.isDirectory())continue;if(En.name==="node_modules"||En.name.startsWith("."))continue;let tr=oe.join(vn.path,En.name);for(let ro of se){let Qn=oe.join(tr,ro);if(Q.push(Qn),await n(Qn)){X=Qn;break}}if(X)break;Yn.push({path:tr,depth:vn.depth+1})}}}catch{}if(X)break}if(X)Fn.set(Jn,X)}if(!X||!await n(X))return zi(e,h,Q),Wi(e);E.add(X);let re;if(Qt.has(X))re=Qt.get(X);else try{re=await Bun.file(X).text(),Qt.set(X,re)}catch(ie){let se=ie instanceof Error?ie.message:String(ie);return zi(e,h,[X],se),Wi(e)}if(C)for(let ie of new Set([...Object.keys(s),...C.reactiveProps??[]])){let se=ie.toLowerCase();if(se.startsWith("aria-")||se.startsWith("data-"))continue;let ge=ie.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${ge}\\b`).test(re))C.declaredProps.add(ie);if(new RegExp(`\\$props\\s*(?:\\.\\s*${ge}\\b|\\[\\s*['"]${ge}['"]\\s*\\])`).test(re)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${ge}['"]`).test(re))C.consumedProps?.add(ie)}let pe=new Set(["__originalFilePath","__importedComponents",Tn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),Ee={};for(let[ie,se]of Object.entries(a))if(!ie.startsWith("__")||pe.has(ie))Ee[ie]=se;let ke=R.length>0?{[Nn]:[...R]}:{},We=t;if(t.includes("@include")){let{processIncludes:ie}=await r("stx/includes",()=>import("./chunk-fb93n9ts.js"));We=await ie(t,a,h,c,E)}if(/<[A-Z][\w.-]*[\s/>]/.test(We)){let{processComponents:ie}=await r("stx/component-renderer",()=>import("./chunk-avph47dc.js"));We=await ie(We,{...a,__processedComponents:N,...ke},h,c,E)}let Te=[];if(Ga(We)){let{processExpressions:ie}=await r("stx/expressions",()=>import("./chunk-9vaz5f9j.js")),se=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...ke}:R.length>0?{...a,...ke}:a;We=ie(We,se,h);for(let ge of We.matchAll(/\{\{([\s\S]*?)\}\}/g))Te.push(ge[1].trim())}let Ke=q(We),Ge=[],xt=Ke.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(ie,se)=>{let ge=Ke.scripts[Number(se)]||"",me=ge.match(/^<script\b([^>]*)>/i)?.[1]||"",He=me.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Be=!He||["module","text/javascript","application/javascript"].includes(He),at=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${me}`);if(!/\bserver\b/i.test(me)&&Be&&!at)return Ge.push(ge),"";return ge}),{extractSlotContent:Hn}=await r("stx/slots",()=>import("./chunk-wesafj4a.js")),ft=Hn(xt),pt={};if(ft.defaultSlot?.trim())pt.default=ft.defaultSlot;for(let[ie,se]of ft.namedSlots)pt[ie]=se.content;let dt=a.__stx_scope_seq??={n:0,key:ms(String(a.__filename??h))},Ot=Vi(e,process.cwd()),it=`stx_${(Ot.endsWith(".stx")?Ot.slice(0,-4):Ot).replace(/[^a-zA-Z0-9]/g,"_")}_${++dt.n}_${dt.key}`,Ve={...Ee,$uid:it,$native:c._nativeHostAttrs===!0,...s,props:s,slot:xt,$slots:pt,__processedComponents:I,__sections:{},__stx_signals_gate:ve(re)||Ga(t),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Te]};dl(re,Ve);let Mt=re,tn=ae(Mt);if(tn)Mt=tn.content.trim();let Kn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Dt=[...re.matchAll(Kn)];for(let[,ie,se]of Dt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(ie))Ae(se,X,c.strict);let Xe=[],jt=null,Zn=Dt.some((ie)=>/\bserver\b/.test(ie[1]||"")&&/\bcache\b/.test(ie[1]||"")),bt=null,Ye=null,Lt=null,nn=0,Bt=null;if(ol(c),Zn&&Us>0){let ie=al({props:s,slot:We,slotContext:t.trim()?cl(Ee):void 0,buildMode:c.buildMode??"",skipEventDirectives:c.skipEventDirectives===!0,native:c._nativeHostAttrs===!0,clientLoopNames:[...R].sort(),layers:c._layerGraph?.layers.map((se)=>se.configFile),uid:it});if(ie!==null){bt=`${X}\x00${b(re)}\x00${ie}`;let se=Vn.get(bt);if(se){for(let ge of se.dependencies)E.add(ge);if(Br(a,se.clientFactories),dt.n+=se.uidsConsumed,se.preservedClientExpressions.length>0){let ge=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let me of se.preservedClientExpressions)ge.add(me);a.__stx_preserved_client_expressions=[...ge]}return se.output}Ye=new Set(E),Lt=Nr(a),nn=dt.n,Bt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let zt=new Set;for(let ie of Dt){let se=ie[1]||"",ge=ie[2]||"",me=se.includes("server");if(De(se)&&ge.trim())ge=Me(ge);if(me&&ge){for(let Be of Ie(ge))zt.add(Be);try{await M(ge,Ve,X,{onFailure:(Be)=>{if(Be.kind!=="unknown")jt=Be.kind}})}catch(Be){}}if(!me){let Be=ge.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),at=Be.includes("{{")&&Be.includes("}}"),ct=Be.includes("{!!")&&Be.includes("!!}");if(at||ct)Be=Lo(Be,Ve,X);let lt=se.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Xe.push(`<script${lt}>${Be}</script>`)}}let Ze=q(re).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Wt=Ze?Ze[1]:"",qn=Ze?Ze[2]:"",tt="",J=Wt&&/\bscoped\b/i.test(Wt);if(Ze)tt=`<style${Wt}>${ml(qn,Ve,X)}</style>`;let ee=Mt;if(ee=ee.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Ze)ee=ee.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let ie=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,se=[];if(ee=ee.replace(ie,(ge,me)=>{let He=me.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(He)se.push(`<style${He[1]}>${He[2]}</style>`);return""}),ee=ee.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),se.length>0)tt=`${tt}${se.join(`
290
- `)}`}if(t&&ee.includes("{{ text || slot }}"))ee=ee.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>t);let{applySlots:fe}=await r("stx/slots",()=>import("./chunk-wesafj4a.js")),{defaultSlot:_e,namedSlots:$e}=ft,ze=c._nativeHostAttrs===!0&&Xe.length>0||Xe.some((ie)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(ie)),gt=(ie)=>ze?gi(ie,it):ie,Ys=new Map([...$e].map(([ie,se])=>[ie,{...se,content:gt(se.content)}]));ee=await fe(ee,gt(_e),Ys,Ve,ze?it:"");let hn=Do(Xe),xn=(Array.isArray(Ve.__stx_client_signal_names)?Ve.__stx_client_signal_names:[]).filter((ie)=>!zt.has(ie));if(hn.length>0||xn.length>0)Ve.__stx_client_signal_names=[...new Set([...xn,...hn])];else delete Ve.__stx_client_signal_names;let Ft=R.filter((ie)=>!zt.has(ie)&&!(ie in s));if(Ft.length>0)Ve[Nn]=Ft;let bn={...c,_rootComponentsDir:c._rootComponentsDir||c.componentsDir,componentsDir:oe.dirname(X),skipSignalsRuntime:!0,skipEventDirectives:c._nativeHostAttrs===!0||ze||Xe.length===0,defaultLayout:void 0};Ve.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:yn}=await r("stx/process",()=>import("./chunk-r7cenpxp.js")),ot=await yn(ee,Ve,X,bn,E),yt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let ie of ot.matchAll(/\{\{([\s\S]*?)\}\}/g))yt.add(ie[1].trim());if(yt.size>0)a.__stx_preserved_client_expressions=[...yt];let qe=it,Ue=ot;if(ze){let ie="";if(Object.keys(s).length>0)try{ie=` data-stx-props="${zs(JSON.stringify(s))}"`}catch{}let se=Z?` stx-hydrate="${zs(Z)}"`:"",ge=Object.fromEntries(Object.entries(pt).map(([lt,_t])=>[lt,Boolean(_t)])),me=Object.keys(ge).length>0?` data-stx-slots="${zs(JSON.stringify(ge))}"`:"",He=` data-stx-scope="${qe}"${ie}${me}${se}`,Be=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(ot),at=Be?"span":"div";Ue=tu(ot,He)??`<${at}${He} data-stx-component-wrapper${Be?' style="display:contents"':""}>${ot}</${at}>`;let ct=await Promise.all(Xe.map(async(lt)=>{let _t=lt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!_t)return lt;let[,_n,Xn]=_t,wt=await bl(Xn,X,c.buildMode==="compile"),Vt=dn(wt.clientCode,Oe(Ve)),{vendorStyleTags:nt}=wt,wn=Vt?`function(__scopeId) {
289
+ `)}`:"";console.error(`[stx] component <${e}> could not be resolved${h}, so it rendered as nothing.${c}${v}`)}function Wi(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}function Do(e){let s=new Set,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let o of e){let a;while((a=t.exec(o))!==null)s.add(a[1]);t.lastIndex=0}return[...s]}async function Le(e,s,t,o,a,h,c,v=new Set,E,R=Qe(a),C,O=e){let{extractVariables:M}=await r("stx/variable-extractor",()=>import("./chunk-9hngzqp5.js")),N=v??new Set;if(N.has(e))return`[Circular component reference: ${e}]`;let I=new Set(N);I.add(e);let P=typeof s.client==="string"?s.client.trim():"";if("client"in s)delete s.client;let Z=P&&P!=="load"&&nu(P)?P:"";try{let U=(ie)=>ie.split("-").map((se)=>se.charAt(0).toUpperCase()+se.slice(1)).join(""),V=O.endsWith(".stx")?O.slice(0,-4):O,X=null,Y=a.__importedComponents;if(Y){let ie=[V,V.toLowerCase(),U(V),j(V)];for(let se of ie)if(Y.has(se)){X=Y.get(se);break}}let Q=[];if(!X){let ie=[`${V}.stx`,`${U(V)}.stx`,`${j(V)}.stx`],se=[...new Set(ie)],ge=a.__originalFilePath,me=[];if(me.push(...c._layerComponentDirs??[]),ge){let Se=oe.join(oe.dirname(ge),"components");me.push(Se)}if(o)me.push(o);let He=c._rootComponentsDir;if(typeof He==="string"&&!me.includes(He))me.push(He);let Be=oe.join(oe.dirname(h),"components");if(!me.includes(Be))me.push(Be);if(c.componentsDir&&c.componentsDir!==o&&!me.includes(c.componentsDir))me.push(c.componentsDir);let at=c._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(V),ct=(C?.events??[]).map((Se)=>Se.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),lt=Object.hasOwn(s,"checked")||Boolean(C?.reactiveProps?.includes("checked")),_t=Object.hasOwn(s,"value")||Boolean(C?.reactiveProps?.includes("value")),_n=!ct.includes("valuechange")&&(lt||ct.includes("change")&&!_t),Xn=c._nativeHostAttrs&&/^textinput$/i.test(V),wt=ct.includes("update:value")&&!ct.includes("input"),Vt=c._targetComponentFallbackNames?.some((Se)=>Se.toLowerCase()===V.toLowerCase())&&(!at||_n)&&(!Xn||wt);for(let Se of Vt?[]:c._targetComponentDirs??[])if(Se&&!me.includes(Se))me.push(Se);let nt=typeof c.root==="string"?oe.resolve(c.root):void 0,wn=nt??oe.dirname(h),rt=[];if(nt)rt.push(oe.resolve(nt,"resources/views/components")),rt.push(oe.resolve(nt,"resources/components")),rt.push(oe.resolve(nt,"src/components")),rt.push(oe.resolve(nt,"components"));rt.push(oe.resolve(import.meta.dir,"components"));for(let Se of rt)if(!me.includes(Se))me.push(Se);let Ut=c._pluginComponentDirs;if(Array.isArray(Ut)){for(let Se of Ut)if(typeof Se==="string"&&!me.includes(Se))me.push(Se)}if(c.fallbackComponentsDir&&!me.includes(c.fallbackComponentsDir))me.push(c.fallbackComponentsDir);if(Vt){for(let Se of c._targetComponentDirs??[])if(Se&&!me.includes(Se))me.push(Se)}let Qs=[...new Set(me.map((Se)=>{if(!Se)return Se;return oe.isAbsolute(Se)?Se:oe.resolve(wn,Se)}))];me.length=0,me.push(...Qs);let Jn=`${V}\x00${h}\x00${Qs.join("\x00")}`,Gn=Fn.get(Jn);if(Gn)if(await n(Gn))X=Gn;else Fn.delete(Jn);if(!X&&(V.startsWith("./")||V.startsWith("../")))X=oe.resolve(oe.dirname(h),`${V}.stx`),Q.push(X);else if(!X)for(let Se of me){if(!Se)continue;for(let Sn of se){let $n=oe.join(Se,Sn);if(Q.push($n),await n($n)){X=$n;break}}if(X)break;if(!X)try{let Sn=await import("fs");if(!Sn.statSync(Se,{throwIfNoEntry:!1})?.isDirectory())continue;let so=8,Yn=[{path:Se,depth:0}];while(Yn.length>0&&!X){let vn=Yn.pop();if(vn.depth>=so)continue;let er;try{er=Sn.readdirSync(vn.path,{withFileTypes:!0})}catch{continue}for(let En of er){if(!En.isDirectory())continue;if(En.name==="node_modules"||En.name.startsWith("."))continue;let tr=oe.join(vn.path,En.name);for(let ro of se){let Qn=oe.join(tr,ro);if(Q.push(Qn),await n(Qn)){X=Qn;break}}if(X)break;Yn.push({path:tr,depth:vn.depth+1})}}}catch{}if(X)break}if(X)Fn.set(Jn,X)}if(!X||!await n(X))return zi(e,h,Q),Wi(e);E.add(X);let re;if(Qt.has(X))re=Qt.get(X);else try{re=await Bun.file(X).text(),Qt.set(X,re)}catch(ie){let se=ie instanceof Error?ie.message:String(ie);return zi(e,h,[X],se),Wi(e)}if(C)for(let ie of new Set([...Object.keys(s),...C.reactiveProps??[]])){let se=ie.toLowerCase();if(se.startsWith("aria-")||se.startsWith("data-"))continue;let ge=ie.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${ge}\\b`).test(re))C.declaredProps.add(ie);if(new RegExp(`\\$props\\s*(?:\\.\\s*${ge}\\b|\\[\\s*['"]${ge}['"]\\s*\\])`).test(re)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${ge}['"]`).test(re))C.consumedProps?.add(ie)}let pe=new Set(["__originalFilePath","__importedComponents",Tn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),Ee={};for(let[ie,se]of Object.entries(a))if(!ie.startsWith("__")||pe.has(ie))Ee[ie]=se;let ke=R.length>0?{[Nn]:[...R]}:{},We=t;if(t.includes("@include")){let{processIncludes:ie}=await r("stx/includes",()=>import("./chunk-gea2ty3e.js"));We=await ie(t,a,h,c,E)}if(/<[A-Z][\w.-]*[\s/>]/.test(We)){let{processComponents:ie}=await r("stx/component-renderer",()=>import("./chunk-ys3tmk8w.js"));We=await ie(We,{...a,__processedComponents:N,...ke},h,c,E)}let Te=[];if(Ga(We)){let{processExpressions:ie}=await r("stx/expressions",()=>import("./chunk-zshhn7nz.js")),se=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...ke}:R.length>0?{...a,...ke}:a;We=ie(We,se,h);for(let ge of We.matchAll(/\{\{([\s\S]*?)\}\}/g))Te.push(ge[1].trim())}let Ke=q(We),Ge=[],xt=Ke.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(ie,se)=>{let ge=Ke.scripts[Number(se)]||"",me=ge.match(/^<script\b([^>]*)>/i)?.[1]||"",He=me.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Be=!He||["module","text/javascript","application/javascript"].includes(He),at=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${me}`);if(!/\bserver\b/i.test(me)&&Be&&!at)return Ge.push(ge),"";return ge}),{extractSlotContent:Hn}=await r("stx/slots",()=>import("./chunk-5pe26hxm.js")),ft=Hn(xt),pt={};if(ft.defaultSlot?.trim())pt.default=ft.defaultSlot;for(let[ie,se]of ft.namedSlots)pt[ie]=se.content;let dt=a.__stx_scope_seq??={n:0,key:ms(String(a.__filename??h))},Ot=Vi(e,process.cwd()),it=`stx_${(Ot.endsWith(".stx")?Ot.slice(0,-4):Ot).replace(/[^a-zA-Z0-9]/g,"_")}_${++dt.n}_${dt.key}`,Ve={...Ee,$uid:it,$native:c._nativeHostAttrs===!0,...s,props:s,slot:xt,$slots:pt,__processedComponents:I,__sections:{},__stx_signals_gate:ve(re)||Ga(t),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Te]};dl(re,Ve);let Mt=re,tn=ae(Mt);if(tn)Mt=tn.content.trim();let Kn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Dt=[...re.matchAll(Kn)];for(let[,ie,se]of Dt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(ie))Ae(se,X,c.strict);let Xe=[],jt=null,Zn=Dt.some((ie)=>/\bserver\b/.test(ie[1]||"")&&/\bcache\b/.test(ie[1]||"")),bt=null,Ye=null,Lt=null,nn=0,Bt=null;if(ol(c),Zn&&Us>0){let ie=al({props:s,slot:We,slotContext:t.trim()?cl(Ee):void 0,buildMode:c.buildMode??"",skipEventDirectives:c.skipEventDirectives===!0,native:c._nativeHostAttrs===!0,clientLoopNames:[...R].sort(),layers:c._layerGraph?.layers.map((se)=>se.configFile),uid:it});if(ie!==null){bt=`${X}\x00${b(re)}\x00${ie}`;let se=Vn.get(bt);if(se){for(let ge of se.dependencies)E.add(ge);if(Br(a,se.clientFactories),dt.n+=se.uidsConsumed,se.preservedClientExpressions.length>0){let ge=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let me of se.preservedClientExpressions)ge.add(me);a.__stx_preserved_client_expressions=[...ge]}return se.output}Ye=new Set(E),Lt=Nr(a),nn=dt.n,Bt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let zt=new Set;for(let ie of Dt){let se=ie[1]||"",ge=ie[2]||"",me=se.includes("server");if(De(se)&&ge.trim())ge=Me(ge);if(me&&ge){for(let Be of Ie(ge))zt.add(Be);try{await M(ge,Ve,X,{onFailure:(Be)=>{if(Be.kind!=="unknown")jt=Be.kind}})}catch(Be){}}if(!me){let Be=ge.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),at=Be.includes("{{")&&Be.includes("}}"),ct=Be.includes("{!!")&&Be.includes("!!}");if(at||ct)Be=Lo(Be,Ve,X);let lt=se.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Xe.push(`<script${lt}>${Be}</script>`)}}let Ze=q(re).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Wt=Ze?Ze[1]:"",qn=Ze?Ze[2]:"",tt="",J=Wt&&/\bscoped\b/i.test(Wt);if(Ze)tt=`<style${Wt}>${ml(qn,Ve,X)}</style>`;let ee=Mt;if(ee=ee.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Ze)ee=ee.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let ie=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,se=[];if(ee=ee.replace(ie,(ge,me)=>{let He=me.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(He)se.push(`<style${He[1]}>${He[2]}</style>`);return""}),ee=ee.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),se.length>0)tt=`${tt}${se.join(`
290
+ `)}`}if(t&&ee.includes("{{ text || slot }}"))ee=ee.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>t);let{applySlots:fe}=await r("stx/slots",()=>import("./chunk-5pe26hxm.js")),{defaultSlot:_e,namedSlots:$e}=ft,ze=c._nativeHostAttrs===!0&&Xe.length>0||Xe.some((ie)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(ie)),gt=(ie)=>ze?gi(ie,it):ie,Ys=new Map([...$e].map(([ie,se])=>[ie,{...se,content:gt(se.content)}]));ee=await fe(ee,gt(_e),Ys,Ve,ze?it:"");let hn=Do(Xe),xn=(Array.isArray(Ve.__stx_client_signal_names)?Ve.__stx_client_signal_names:[]).filter((ie)=>!zt.has(ie));if(hn.length>0||xn.length>0)Ve.__stx_client_signal_names=[...new Set([...xn,...hn])];else delete Ve.__stx_client_signal_names;let Ft=R.filter((ie)=>!zt.has(ie)&&!(ie in s));if(Ft.length>0)Ve[Nn]=Ft;let bn={...c,_rootComponentsDir:c._rootComponentsDir||c.componentsDir,componentsDir:oe.dirname(X),skipSignalsRuntime:!0,skipEventDirectives:c._nativeHostAttrs===!0||ze||Xe.length===0,defaultLayout:void 0};Ve.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:yn}=await r("stx/process",()=>import("./chunk-y1kaq1cd.js")),ot=await yn(ee,Ve,X,bn,E),yt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let ie of ot.matchAll(/\{\{([\s\S]*?)\}\}/g))yt.add(ie[1].trim());if(yt.size>0)a.__stx_preserved_client_expressions=[...yt];let qe=it,Ue=ot;if(ze){let ie="";if(Object.keys(s).length>0)try{ie=` data-stx-props="${zs(JSON.stringify(s))}"`}catch{}let se=Z?` stx-hydrate="${zs(Z)}"`:"",ge=Object.fromEntries(Object.entries(pt).map(([lt,_t])=>[lt,Boolean(_t)])),me=Object.keys(ge).length>0?` data-stx-slots="${zs(JSON.stringify(ge))}"`:"",He=` data-stx-scope="${qe}"${ie}${me}${se}`,Be=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(ot),at=Be?"span":"div";Ue=tu(ot,He)??`<${at}${He} data-stx-component-wrapper${Be?' style="display:contents"':""}>${ot}</${at}>`;let ct=await Promise.all(Xe.map(async(lt)=>{let _t=lt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!_t)return lt;let[,_n,Xn]=_t,wt=await bl(Xn,X,c.buildMode==="compile"),Vt=dn(wt.clientCode,Oe(Ve)),{vendorStyleTags:nt}=wt,wn=Vt?`function(__scopeId) {
291
291
  ${Vt}
292
292
  return (${wt.factoryBody})(__scopeId);
293
293
  }`:wt.factoryBody,rt=Z?null:ws(a,wn),Ut=rt?`window.__stxComponentFactories[${JSON.stringify(rt)}](${JSON.stringify(qe)});`:`(${wn})(${JSON.stringify(qe)});`;if(Z)return`${nt}<script type="stx/island" data-stx-island="${qe}" data-stx-scoped data-stx-owner="${qe}"${_n}>${Ut}</script>`;return`${nt}<script data-stx-scoped data-stx-run="always" data-stx-owner="${qe}"${_n}>${Ut}</script>`}));if(Ue=Ue+`
@@ -313,7 +313,7 @@ ${we.yellow}${we.bold}Message:${we.reset} ${s}
313
313
  `,v)C+=`
314
314
  ${we.blue}${we.bold}Context:${we.reset}
315
315
  ${we.dim}${v}${we.reset}
316
- `;return C}function de(){Qt.clear(),Fn.clear(),Fs.clear(),Vs.clear(),Vn.clear()}function Rp(){return{size:Qt.size,maxSize:500}}var Ws=y(128);async function bl(e,s,t){let o=b(e,s,t),a=Ws.get(o);if(a){if(as(a.deps))return a;Ws.delete(o)}let h=Io(e,{filePath:s,projectRoot:process.cwd()}),c=h.code,v=Oo(h.styles);c=Pt(c).code;let{hasUserImports:E,bundleClientScript:R}=await r("stx/client-script-bundler",()=>import("./chunk-ynh1ppa6.js")),C=[],O=!1;if(E(c)){let V=c;c=await R(V,s,{projectRoot:process.cwd(),minify:t,collectInputs:C}),O=c===V}let{stripStxRuntimeImports:M}=await r("stx/signal-processing",()=>import("./chunk-zdgsj39g.js"));c=M(c);let N=T(c),I=ul(N),P=new Set(L(N,!0).split(",").map((V)=>V.trim())),Z=`function(__scopeId) {
316
+ `;return C}function de(){Qt.clear(),Fn.clear(),Fs.clear(),Vs.clear(),Vn.clear()}function Rp(){return{size:Qt.size,maxSize:500}}var Ws=y(128);async function bl(e,s,t){let o=b(e,s,t),a=Ws.get(o);if(a){if(as(a.deps))return a;Ws.delete(o)}let h=Io(e,{filePath:s,projectRoot:process.cwd()}),c=h.code,v=Oo(h.styles);c=Pt(c).code;let{hasUserImports:E,bundleClientScript:R}=await r("stx/client-script-bundler",()=>import("./chunk-ywqs7x8g.js")),C=[],O=!1;if(E(c)){let V=c;c=await R(V,s,{projectRoot:process.cwd(),minify:t,collectInputs:C}),O=c===V}let{stripStxRuntimeImports:M}=await r("stx/signal-processing",()=>import("./chunk-ackk8wq5.js"));c=M(c);let N=T(c),I=ul(N),P=new Set(L(N,!0).split(",").map((V)=>V.trim())),Z=`function(__scopeId) {
317
317
  ${st("const",[...ic,...I],N)}
318
318
  const __scope = window.stx._scopes = window.stx._scopes || {};
319
319
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{g,Po,Va,Ua,Xl,Jl,Yl,Zl,Ql,ms,eu,De,G,Me,tu,lr,nu,Ga,Do,Le,n,pn,Ka,m,de,Rp}from"./chunk-vdjj4vrp.js";import"./chunk-kpeep7gq.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{de as clearComponentCache,Do as componentClientSignalNames,Po as convertToCommonJS,m as createDetailedErrorMessage,Ql as extractDirectiveNames,Va as extractScriptFromTemplate,g as extractVariables,n as fileExists,Rp as getComponentCacheStats,Jl as getPositionInfo,G as getSharedTranspiler,Ka as getSourceLineInfo,Zl as hasDirectives,Ua as hasVariables,nu as isHydrateTrigger,eu as isJavaScriptScript,Le as renderComponentWithSlot,pn as resolveTemplatePath,tu as scopeOnRootElement,ms as scopeSequenceKey,De as shouldTranspileTypeScript,Ga as slotContentHasExpressions,Me as transpileTypeScript,lr as userComponentFileExists,Yl as validateDirective,Xl as validateTemplate};
2
+ import{g,Po,Va,Ua,Xl,Jl,Yl,Zl,Ql,ms,eu,De,G,Me,tu,lr,nu,Ga,Do,Le,n,pn,Ka,m,de,Rp}from"./chunk-p23sz4rr.js";import"./chunk-144yp2bw.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{de as clearComponentCache,Do as componentClientSignalNames,Po as convertToCommonJS,m as createDetailedErrorMessage,Ql as extractDirectiveNames,Va as extractScriptFromTemplate,g as extractVariables,n as fileExists,Rp as getComponentCacheStats,Jl as getPositionInfo,G as getSharedTranspiler,Ka as getSourceLineInfo,Zl as hasDirectives,Ua as hasVariables,nu as isHydrateTrigger,eu as isJavaScriptScript,Le as renderComponentWithSlot,pn as resolveTemplatePath,tu as scopeOnRootElement,ms as scopeSequenceKey,De as shouldTranspileTypeScript,Ga as slotContentHasExpressions,Me as transpileTypeScript,lr as userComponentFileExists,Yl as validateDirective,Xl as validateTemplate};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
2
  import m from"path";var y=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function I(...o){let r=new Set;for(let s of o){if(!s||!s.includes("__stxModules["))continue;for(let e of s.matchAll(y))try{r.add(JSON.parse(`"${e[1]}"`))}catch{}}return[...r].sort()}async function w(o,r={}){if(o.length===0)return null;let s=process.cwd(),e=[],a=[];o.forEach((t,c)=>{let i=t.startsWith("npm:")?t.slice(4):m.resolve(s,t),l=`__stxRegistered${c}`,p=JSON.stringify(t);e.push(`import * as ${l} from ${JSON.stringify(i)};`),a.push(`if (!globalThis.__stxModules[${p}]) globalThis.__stxModules[${p}] = ${l};`)});let d=[...e,"globalThis.__stxModules = globalThis.__stxModules || {};",...a].join(`
3
- `),n;try{let{bundleClientScript:t}=await import("./chunk-ynh1ppa6.js");n=await t(d,m.join(s,".stx-module-registry.ts"),{projectRoot:s,minify:r.minify,externalizeUserModules:!1,collectInputs:r.collectInputs,throwOnFailure:!0})}catch(t){let{formatBuildFailure:c}=await import("./chunk-280p4q7a.js"),i=c(t);console.warn(`[stx] could not build the page module registry (#1957): ${i}`);let l=`[stx] the page module registry did not build, so ${o.join(", ")} cannot load (#1957): ${i}`;return`;console.error(${JSON.stringify(l)});`}let{transformAutoImports:f,generateAutoImportDestructuring:_}=await import("./chunk-c4qebqmk.js"),u=f(n),h=_(u.stxImports,u.browserImports),{transformStoreImports:x}=await import("./chunk-hvtzw1jh.js");n=x(u.code);let g=JSON.stringify(new Bun.CryptoHasher("md5").update(d).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${g}]) return;`,` __stxBundles[${g}] = true;`,h,n,"})();"].join(`
3
+ `),n;try{let{bundleClientScript:t}=await import("./chunk-ywqs7x8g.js");n=await t(d,m.join(s,".stx-module-registry.ts"),{projectRoot:s,minify:r.minify,externalizeUserModules:!1,collectInputs:r.collectInputs,throwOnFailure:!0})}catch(t){let{formatBuildFailure:c}=await import("./chunk-280p4q7a.js"),i=c(t);console.warn(`[stx] could not build the page module registry (#1957): ${i}`);let l=`[stx] the page module registry did not build, so ${o.join(", ")} cannot load (#1957): ${i}`;return`;console.error(${JSON.stringify(l)});`}let{transformAutoImports:f,generateAutoImportDestructuring:_}=await import("./chunk-5j970c0z.js"),u=f(n),h=_(u.stxImports,u.browserImports),{transformStoreImports:x}=await import("./chunk-hvtzw1jh.js");n=x(u.code);let g=JSON.stringify(new Bun.CryptoHasher("md5").update(d).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${g}]) return;`,` __stxBundles[${g}] = true;`,h,n,"})();"].join(`
4
4
  `)}export{w as buildModuleRegistryScript,I as registeredModuleIdsIn};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Hn,s}from"./chunk-ken0q08p.js";import"./chunk-ztp2rgpp.js";import"./chunk-prf164ct.js";import"./chunk-nzj3a6mj.js";import"./chunk-1mz8fw0m.js";import"./chunk-nx6d1hj7.js";import"./chunk-ka8befem.js";import"./chunk-ynyssmdy.js";import{me}from"./chunk-ea7ekakt.js";import"./chunk-p472crv1.js";import"./chunk-87bs5f18.js";import"./chunk-nytb5e4v.js";import"./chunk-nt7jxmpy.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-fzqj1mjz.js";import"./chunk-365vg0eg.js";import{Ae,ps,gs}from"./chunk-p23sz4rr.js";import"./chunk-144yp2bw.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{Hn as buildModulesTag,me as injectRouterScript,s as processDirectives,ps as processJsonDirective,gs as processOnceDirective,Ae as validateClientScript};
@@ -1,8 +1,8 @@
1
1
  // @bun
2
- import{st,cc}from"./chunk-pxdww4rb.js";import{T}from"./chunk-ce6zddpf.js";import{L,rs,r,sn,W,ce,$a,Pt,dn,De,Me}from"./chunk-vdjj4vrp.js";import{Kn}from"./chunk-fpz59dhz.js";import{U}from"./chunk-bnn7pd62.js";import{tn}from"./chunk-p472crv1.js";var j=`(?:"[^"]*"|'[^']*'|[^>"'])*`,Q=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,K=65536,Y=4,O=new Map;function fp(){O.clear()}function q(e){let i=[];for(let s of ce(e,W)){let t=s.token.match(/^<script\b([^>]*)>/i),n=s.token.match(/<\/script\s*>$/i);if(!t||!n)continue;let a=t[0].length,l=s.token.length-n[0].length;i.push(Object.freeze({fullMatch:s.token,attrs:t[1],body:s.token.slice(a,l),start:s.start,end:s.end}))}return i}function _l(e,i={}){let s=e.length>=K,t=s?O.get(e):void 0;if(t===void 0){if(t=q(e),s)$a(O,Y),O.set(e,t)}let n=i.skipAttrs;if(!n)return t.slice();let a=[];for(let l of t)if(n.lastIndex=0,!n.test(l.attrs))a.push(l);return a}function oo(e){let i=e.trim(),s=i.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(s){let n=s[1].trim(),a=s[2].trim(),{itemVar:l,indexVar:o}=B(a);if(l)return{style:"as",iterable:n,itemVar:l,indexVar:o}}let t=i.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(t){let n=t[1].trim(),a=t[2].trim(),{itemVar:l,indexVar:o}=B(n);if(l)return{style:"in",iterable:a,itemVar:l,indexVar:o}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function B(e){let i=e.trim(),s=i.match(/^(\w+)\s*=>\s*(\w+)$/);if(s)return{itemVar:s[2],indexVar:s[1]};let t=i.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(t)return{itemVar:t[1],indexVar:t[2]||null};let n=i.match(/^(\w+)\s*,\s*(\w+)$/);if(n)return{itemVar:n[1],indexVar:n[2]};let a=i.match(/^(\w+)$/);if(a)return{itemVar:a[1],indexVar:null};return{itemVar:null,indexVar:null}}function Fr(e,i){return cc(e,i)}function ee(e){let i=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,s=0,t;while((t=i.exec(e))!==null){let n=t[1];if(n.startsWith("if"))s++;else if(n==="endif")s--;else if(s===0)return!0}return!1}function J(e){let i=new Set,s=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel)\s*(?:<[^>]*>)?\s*\(/g,n;while((n=s.exec(e))!==null){let a=n[1],l;while((l=t.exec(a))!==null)i.add(l[1])}return i}function te(e){if(!/[:@]for\s*=/.test(e)&&!/\bx-for\s*=/.test(e))return[];let i=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${j})>`,"iy"),s=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,t=ce(e,(a,l)=>{i.lastIndex=l;let o=i.exec(a);if(!o||o.index!==l||!s.test(o[2]))return-1;return i.lastIndex}),n=[];for(let a of t){i.lastIndex=0;let l=i.exec(a.token);if(!l)continue;let o=l[2].match(s),p=oo(o?.[1]??o?.[2]??""),h=[p.itemVar,p.indexVar].filter(Boolean);if(h.length===0)continue;let u=l[1],g=/\/\s*>$/.test(a.token)||N.has(u.toLowerCase())?a.end:z(e,a.start,u,a.end);if(g!==-1)n.push({start:a.start,end:g,vars:new Set(h)})}return n}var Z=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function ne(e){return e.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function F(e,i,s,t){if(!e)return!1;let n=ne(e),a=!1,l=!1,o=!1,p=/([a-zA-Z_$][\w$]*)/g,h;while((h=p.exec(n))!==null){let d=h[1];if(n.slice(0,h.index).trimEnd().endsWith("."))continue;if(Z.has(d))continue;if(i.has(d)||t?.has(d))a=!0;else if(s&&d in s)l=!0}let u=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,c;while((c=u.exec(n))!==null){let d=c[1];if(n.slice(0,c.index).trimEnd().endsWith("."))continue;if(Z.has(d)||s&&d in s)continue;o=!0}return(a||o)&&!l}function M(e,i,s){let t=s===void 0?` ${i}`:` ${i}="${s.replace(/"/g,"&quot;")}"`,n=e.trim(),a=n.match(Q);if(a&&se(a[3],a[1])){let[,l,o,p]=a;return`<${l}${o}${t}>${p}</${l}>`}return`<template${t}>${n}</template>`}function se(e,i){let s=new RegExp(`<(/)?${i}(?=[\\s/>])`,"gi"),t=0,n;while((n=s.exec(e))!==null)if(n[1]){if(t--,t<0)return!1}else t++;return!0}function io(e,i){let s=J(e);function t(n){let a=n,l=te(n),o=(c)=>{let g=new Set;for(let d of l)if(c>d.start&&c<d.end)for(let f of d.vars)g.add(f);return g},p=/@if\s*\(/g,h,u=[];while((h=p.exec(a))!==null){let c=h.index,g=c+h[0].length,d=1,f=g;while(f<a.length&&d>0){if(a[f]==="(")d++;else if(a[f]===")")d--;f++}if(d!==0)continue;let b=a.substring(g,f-1).trim(),E=f,S=1,w=E,m=/@(if\s*\(|endif)/g;m.lastIndex=E;let x;while((x=m.exec(a))!==null)if(x[1].startsWith("if"))S++;else if(x[1]==="endif"){if(S--,S===0){w=x.index+x[0].length;break}}if(S!==0)continue;let C=a.substring(E,w-6).trim(),R;if(ee(C)){let _=tn(a.substring(c,w));if(_.length===0)continue;let v=_[0].branches.filter((A)=>A.type!=="else"),I=o(c);if(!(v.length>0&&v.every((A)=>F(A.condition,s,i,I))))continue;R=_[0].branches.map((A)=>{let V=t(A.content);if(A.type==="elseif")return M(V,"@else-if",A.condition??"");if(A.type==="else")return M(V,"@else");return M(V,"@if",A.condition??"")}).join(`
2
+ import{st,cc}from"./chunk-pxdww4rb.js";import{T}from"./chunk-ce6zddpf.js";import{L,rs,r,sn,W,ce,$a,Pt,dn,De,Me}from"./chunk-p23sz4rr.js";import{Kn}from"./chunk-ea7ekakt.js";import{U}from"./chunk-bnn7pd62.js";import{tn}from"./chunk-p472crv1.js";var j=`(?:"[^"]*"|'[^']*'|[^>"'])*`,Q=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,K=65536,Y=4,O=new Map;function fp(){O.clear()}function q(e){let i=[];for(let s of ce(e,W)){let t=s.token.match(/^<script\b([^>]*)>/i),n=s.token.match(/<\/script\s*>$/i);if(!t||!n)continue;let a=t[0].length,l=s.token.length-n[0].length;i.push(Object.freeze({fullMatch:s.token,attrs:t[1],body:s.token.slice(a,l),start:s.start,end:s.end}))}return i}function _l(e,i={}){let s=e.length>=K,t=s?O.get(e):void 0;if(t===void 0){if(t=q(e),s)$a(O,Y),O.set(e,t)}let n=i.skipAttrs;if(!n)return t.slice();let a=[];for(let l of t)if(n.lastIndex=0,!n.test(l.attrs))a.push(l);return a}function oo(e){let i=e.trim(),s=i.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(s){let n=s[1].trim(),a=s[2].trim(),{itemVar:l,indexVar:o}=B(a);if(l)return{style:"as",iterable:n,itemVar:l,indexVar:o}}let t=i.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(t){let n=t[1].trim(),a=t[2].trim(),{itemVar:l,indexVar:o}=B(n);if(l)return{style:"in",iterable:a,itemVar:l,indexVar:o}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function B(e){let i=e.trim(),s=i.match(/^(\w+)\s*=>\s*(\w+)$/);if(s)return{itemVar:s[2],indexVar:s[1]};let t=i.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(t)return{itemVar:t[1],indexVar:t[2]||null};let n=i.match(/^(\w+)\s*,\s*(\w+)$/);if(n)return{itemVar:n[1],indexVar:n[2]};let a=i.match(/^(\w+)$/);if(a)return{itemVar:a[1],indexVar:null};return{itemVar:null,indexVar:null}}function Fr(e,i){return cc(e,i)}function ee(e){let i=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,s=0,t;while((t=i.exec(e))!==null){let n=t[1];if(n.startsWith("if"))s++;else if(n==="endif")s--;else if(s===0)return!0}return!1}function J(e){let i=new Set,s=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel)\s*(?:<[^>]*>)?\s*\(/g,n;while((n=s.exec(e))!==null){let a=n[1],l;while((l=t.exec(a))!==null)i.add(l[1])}return i}function te(e){if(!/[:@]for\s*=/.test(e)&&!/\bx-for\s*=/.test(e))return[];let i=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${j})>`,"iy"),s=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,t=ce(e,(a,l)=>{i.lastIndex=l;let o=i.exec(a);if(!o||o.index!==l||!s.test(o[2]))return-1;return i.lastIndex}),n=[];for(let a of t){i.lastIndex=0;let l=i.exec(a.token);if(!l)continue;let o=l[2].match(s),p=oo(o?.[1]??o?.[2]??""),h=[p.itemVar,p.indexVar].filter(Boolean);if(h.length===0)continue;let u=l[1],g=/\/\s*>$/.test(a.token)||N.has(u.toLowerCase())?a.end:z(e,a.start,u,a.end);if(g!==-1)n.push({start:a.start,end:g,vars:new Set(h)})}return n}var Z=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function ne(e){return e.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function F(e,i,s,t){if(!e)return!1;let n=ne(e),a=!1,l=!1,o=!1,p=/([a-zA-Z_$][\w$]*)/g,h;while((h=p.exec(n))!==null){let d=h[1];if(n.slice(0,h.index).trimEnd().endsWith("."))continue;if(Z.has(d))continue;if(i.has(d)||t?.has(d))a=!0;else if(s&&d in s)l=!0}let u=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,c;while((c=u.exec(n))!==null){let d=c[1];if(n.slice(0,c.index).trimEnd().endsWith("."))continue;if(Z.has(d)||s&&d in s)continue;o=!0}return(a||o)&&!l}function M(e,i,s){let t=s===void 0?` ${i}`:` ${i}="${s.replace(/"/g,"&quot;")}"`,n=e.trim(),a=n.match(Q);if(a&&se(a[3],a[1])){let[,l,o,p]=a;return`<${l}${o}${t}>${p}</${l}>`}return`<template${t}>${n}</template>`}function se(e,i){let s=new RegExp(`<(/)?${i}(?=[\\s/>])`,"gi"),t=0,n;while((n=s.exec(e))!==null)if(n[1]){if(t--,t<0)return!1}else t++;return!0}function io(e,i){let s=J(e);function t(n){let a=n,l=te(n),o=(c)=>{let g=new Set;for(let d of l)if(c>d.start&&c<d.end)for(let f of d.vars)g.add(f);return g},p=/@if\s*\(/g,h,u=[];while((h=p.exec(a))!==null){let c=h.index,g=c+h[0].length,d=1,f=g;while(f<a.length&&d>0){if(a[f]==="(")d++;else if(a[f]===")")d--;f++}if(d!==0)continue;let b=a.substring(g,f-1).trim(),E=f,S=1,w=E,m=/@(if\s*\(|endif)/g;m.lastIndex=E;let x;while((x=m.exec(a))!==null)if(x[1].startsWith("if"))S++;else if(x[1]==="endif"){if(S--,S===0){w=x.index+x[0].length;break}}if(S!==0)continue;let C=a.substring(E,w-6).trim(),R;if(ee(C)){let _=tn(a.substring(c,w));if(_.length===0)continue;let v=_[0].branches.filter((A)=>A.type!=="else"),I=o(c);if(!(v.length>0&&v.every((A)=>F(A.condition,s,i,I))))continue;R=_[0].branches.map((A)=>{let V=t(A.content);if(A.type==="elseif")return M(V,"@else-if",A.condition??"");if(A.type==="else")return M(V,"@else");return M(V,"@if",A.condition??"")}).join(`
3
3
  `)}else{if(!F(b,s,i,o(c)))continue;R=M(t(C),"@if",b)}u.push({start:c,end:w,replacement:R}),p.lastIndex=w}for(let c=u.length-1;c>=0;c--){let{start:g,end:d,replacement:f}=u[c];a=a.substring(0,g)+f+a.substring(d)}return a}return t(e)}function re(e){let i=e.trim();if(i==="")return;if(i==="true")return!0;if(i==="false")return!1;if(i==="null")return!1;if(i==="undefined")return!1;if(i==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(i)){let n=Number(i);return n!==0&&!Number.isNaN(n)}let s=i.match(/^'((?:\\.|[^'\\])*)'$/);if(s)return s[1].length>0;let t=i.match(/^"((?:\\.|[^"\\])*)"$/);if(t)return t[1].length>0;return}var N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),G=/<(script|style)\b/iy,ie=/<\/script/gi,oe=/<\/style/gi;function z(e,i,s,t){if(N.has(s.toLowerCase()))return t;let n=s.toLowerCase(),a=e.length,l=1,o=t;while(o<a){let p=e.indexOf("<",o);if(p===-1)return-1;if(o=p,e.startsWith("<!--",o)){let g=e.indexOf("-->",o+4);if(g===-1)return-1;o=g+3;continue}G.lastIndex=o;let h=G.exec(e);if(h){let g=e.indexOf(">",o);if(g===-1)return-1;if(e[g-1]==="/"){o=g+1;continue}let d=h[1].toLowerCase()==="script"?ie:oe;d.lastIndex=o;let f=d.exec(e);if(f===null)return-1;let b=e.indexOf(">",f.index);if(b===-1)return-1;o=b+1;continue}if(e[o+1]==="/"){let g=/^<\/([a-z][\w-]*)\s*>/i.exec(e.slice(o,o+64));if(!g){o++;continue}if(g[1].toLowerCase()===n){if(l--,o+=g[0].length,l===0)return o;continue}o+=g[0].length;continue}let u=/^<([a-z][\w-]*)\b/i.exec(e.slice(o,o+64));if(!u){o++;continue}let c=e.indexOf(">",o);if(c===-1)return-1;if(u[1].toLowerCase()===n){let g=e.slice(o,c+1);if(!(/\/\s*>$/.test(g)||N.has(n)))l++}o=c+1}return-1}var ae=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function le(e,i){let s=i,t=e.length;for(;;){while(s<t&&e[s]!=="<")s++;if(s>=t)return!1;if(e.startsWith("<!--",s)){let l=e.indexOf("-->",s+4);if(l===-1)return!1;s=l+3;continue}break}if(e[s+1]==="/")return!1;let n=e.indexOf(">",s);if(n===-1)return!1;let a=e.slice(s,n+1);return ae.test(a)}function ao(e){if(!e.includes(":if")&&!e.includes(":show")&&!e.includes("x-if")&&!e.includes("x-show")&&!e.includes("@if=")&&!e.includes("@show="))return e;let i=[],s=/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,t;while((t=s.exec(e))!==null)i.push([t.index,t.index+t[0].length]);let n=(c)=>i.some(([g,d])=>c>=g&&c<d),a=/<([a-zA-Z][\w-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*?)\s+(:if|:show|x-if|x-show|@if|@show)\s*=\s*"([^"]*)"((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)(\/?)>/g,l=[],o;while((o=a.exec(e))!==null){if(n(o.index))continue;let[c,g,d,f,b,E,S]=o,w=re(b);if(w===void 0)continue;let m=o.index,x=m+c.length,_=!!S||/\/\s*>$/.test(c)||N.has(g.toLowerCase())?x:z(e,m,g,x);if(_===-1)continue;if((f===":if"||f==="x-if"||f==="@if")&&le(e,_)){a.lastIndex=x;continue}if(w===!0){let I=`<${g}${d}${E}${S}>`;l.push({start:m,end:x,replacement:I});continue}l.push({start:m,end:_,replacement:""}),a.lastIndex=_}if(l.length===0)return e;l.sort((c,g)=>c.start-g.start);let p=[],h=-1;for(let c of l){if(c.start<h)continue;p.push(c),h=c.end}let u=e;for(let c=p.length-1;c>=0;c--){let{start:g,end:d,replacement:f}=p[c];u=u.substring(0,g)+f+u.substring(d)}return u}var X=[":for","@for","x-for"];function zr(e,i){if(!i||Object.keys(i).length===0)return e;if(!X.some((o)=>e.includes(`${o}=`)))return e;let s=J(e);if(Array.isArray(i.__stx_client_signal_names)){for(let o of i.__stx_client_signal_names)if(typeof o==="string")s.add(o)}let t=e,n=[],a=/<([a-zA-Z][\w-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g,l;while((l=a.exec(t))!==null){let[o,p,h]=l,u=l.index,c=u+o.length,g=X.map((R)=>({attr:R,m:new RegExp(`\\s${R}="([^"]*)"`).exec(h)})).find((R)=>R.m!==null);if(!g||!g.m)continue;let d=oo(g.m[1]);if(!d.iterable||!d.itemVar)continue;let f=d.iterable.trim().split(/[.[(]/)[0].trim();if(!f||s.has(f)||!(f in i))continue;let b=z(t,u,p,c);if(b===-1)continue;let E=h.replace(new RegExp(`\\s${g.attr}="[^"]*"`),"").replace(/\s:key="[^"]*"/,"").replace(/\sx-cloak(?=\s|$)/,""),S=t.slice(c,b-`</${p}>`.length),w={...i,[d.itemVar]:void 0};if(d.indexVar)w[d.indexVar]=void 0;let m=zr(S,w),x=d.indexVar?`${d.iterable} as ${d.indexVar} => ${d.itemVar}`:`${d.iterable} as ${d.itemVar}`,C=p.toLowerCase()==="template"?m:`<${p}${E}>${m}</${p}>`;n.push({start:u,end:b,replacement:`@foreach(${x})${C}@endforeach`}),a.lastIndex=b}for(let o=n.length-1;o>=0;o--){let{start:p,end:h,replacement:u}=n[o];t=t.slice(0,p)+u+t.slice(h)}return t}function Hr(e,i){let s=e,t=/@(for|foreach)\s*\(/g,n,a=[],l=[];while((n=t.exec(s))!==null){let o=n[1],p=n.index,h=p+n[0].length,u=1,c=h;while(c<s.length&&u>0){if(s[c]==="(")u++;else if(s[c]===")")u--;c++}if(u!==0)continue;let g=s.substring(h,c-1).trim(),d=c,f=oo(g),b=o==="for"?"@endfor":"@endforeach",E=1,S=d,w=o==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${o}\\s*\\(|end${o})`,"g");w.lastIndex=d;let m;while((m=w.exec(s))!==null)if(m[1].startsWith(o))E++;else if(E--,E===0){S=m.index+m[0].length;break}if(E!==0)continue;let x=()=>{let y=[f.itemVar,f.indexVar].filter(Boolean);if(y.length)l.push({start:p,end:S,vars:y})};if(f.iterable){let y=f.iterable.trim();if(y.startsWith("[")||y.startsWith("{")||y.startsWith("'")||y.startsWith('"')||y.startsWith("`")||/^-?\d/.test(y)){x();continue}let k=y.split(/[.[(]/)[0].trim(),A=i?k in i:!1,V=l.some((P)=>p>P.start&&p<P.end&&P.vars.includes(k));if(k&&(A||V)){x();continue}}if(f.style==="as")g=f.indexVar?`(${f.itemVar}, ${f.indexVar}) in ${f.iterable}`:`${f.itemVar} in ${f.iterable}`;let C=s.substring(d,S-b.length).trim(),R=i?{...i}:{};if(f.itemVar)delete R[f.itemVar];if(f.indexVar)delete R[f.indexVar];let _=Hr(C,R),v=_.match(Q),I;if(v){let[,y,k,A]=v;I=`<${y}${k} @for="${g}">${A}</${y}>`}else I=`<template @for="${g}">${_}</template>`;a.push({start:p,end:S,replacement:I}),t.lastIndex=S}for(let o=a.length-1;o>=0;o--){let{start:p,end:h,replacement:u}=a[o];s=s.substring(0,p)+u+s.substring(h)}return s}function ue(e){let i=new Set,s=[],t=0,n=0,a=e.length,l=(u)=>{let c=t+1;while(c<a){let g=e[c];if(g==="\\"){c+=2;continue}if(g===u)return c+1;c++}return a},o=()=>{let u=t+2;while(u<a&&e[u]!==`
4
4
  `)u++;return u},p=()=>{let u=t+2;while(u<a-1){if(e[u]==="*"&&e[u+1]==="/")return u+2;u++}return a},h=(u)=>{let c=u,g=0;while(c<a){let d=e[c];if(d==="/"&&e[c+1]==="/"){let f=c+2;while(f<a&&e[f]!==`
5
- `)f++;c=f;continue}if(d==="/"&&e[c+1]==="*"){let f=c+2;while(f<a-1&&!(e[f]==="*"&&e[f+1]==="/"))f++;c=f+2;continue}if(d==='"'||d==="'"||d==="`"){let f=c+1;while(f<a){if(e[f]==="\\"){f+=2;continue}if(e[f]===d){f++;break}f++}c=f;continue}if(d==="("||d==="["||d==="{"){g++,c++;continue}if(d===")"||d==="]"||d==="}"){g--,c++;continue}if(d===";"&&g===0)return c+1;c++}return a};while(t<a){let u=e[t];if(u==="/"&&e[t+1]==="/"){let c=o();s.push(e.slice(t,c)),t=c;continue}if(u==="/"&&e[t+1]==="*"){let c=p();s.push(e.slice(t,c)),t=c;continue}if(u==='"'||u==="'"||u==="`"){let c=l(u);s.push(e.slice(t,c)),t=c;continue}if(u==="{"){n++,s.push(u),t++;continue}if(u==="}"){n--,s.push(u),t++;continue}if(n===0){let c=t>0?e[t-1]:"";if(c===""||/\s/.test(c)||c===";"||c==="}"||c==="{"){let d=e.slice(t).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(d){let f=d[2],b=h(t+d[0].length);if(i.has(f)){s.push(`/* stx: deduped const ${f} */`),t=b;continue}i.add(f),s.push(e.slice(t,b)),t=b;continue}}}s.push(u),t++}return s.join("")}var fe=new Set(["script","style","html","head","meta","link","title","!doctype"]);function D(e,i,s){for(let t of s){if(t.start>=i)return!1;if(t.end>e)return!0}return!1}function de(e,i,s){let t=0;while(t<e.length){let n=e.indexOf(i,t);if(n===-1)return!1;if(!D(n,n+i.length,s))return!0;t=n+i.length}return!1}function ge(e,i){if(de(e,"<body",i)){let n=new RegExp(`<body(${j})>`,"g"),a;while((a=n.exec(e))!==null)if(!D(a.index,a.index+a[0].length,i))return a.index+a[0].length-1;return null}let s=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${j})>`,"gi"),t;while((t=s.exec(e))!==null){if(D(t.index,t.index+t[0].length,i))continue;if(fe.has(t[1].toLowerCase()))continue;return t.index+t[0].length-1}return null}function pe(e,i,s,t){let n=[],a=` data-stx="${t}"`,l=0,o=!1,p=(h)=>{if(s!==null&&!o&&s>=l&&s<=h)n.push(e.slice(l,s),a,e.slice(s,h)),o=!0;else n.push(e.slice(l,h))};for(let h of i){if(h.start<l)continue;p(h.start),l=h.end}return p(e.length),n.join("")}async function Vr(e,i,s,t={}){let n=_l(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),a=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,l=[],{hasUserImports:o,bundleClientScript:p}=await r("stx/client-script-bundler",()=>import("./chunk-ynh1ppa6.js"));for(let m of n){let x=m.body;if(De(m.attrs))x=Me(x);if(t.forceClientSetup||a.test(x)){l.push({content:x,start:m.start,end:m.end});continue}if(!o(x))continue;try{let C=await p(Pt(x).code,i||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(a.test(C))l.push({content:x,start:m.start,end:m.end})}catch{}}if(l.length===0)return{output:e,setupCode:null};let h=`${i??""}\x00${l.map((m)=>m.content).join("\x00")}`,u=`__stx_setup_${Bun.hash(h).toString(36).slice(0,10)}`,c=[];for(let m=0;m<l.length;m++){let x=l[m].bundled??Pt(l[m].content).code;if(!l[m].bundled&&o(x))x=await p(x,i||"",{projectRoot:process.cwd()});x=ht(x);let C=T(x);c.push(`// \u2500\u2500 merged signal script #${m+1} \u2500\u2500
5
+ `)f++;c=f;continue}if(d==="/"&&e[c+1]==="*"){let f=c+2;while(f<a-1&&!(e[f]==="*"&&e[f+1]==="/"))f++;c=f+2;continue}if(d==='"'||d==="'"||d==="`"){let f=c+1;while(f<a){if(e[f]==="\\"){f+=2;continue}if(e[f]===d){f++;break}f++}c=f;continue}if(d==="("||d==="["||d==="{"){g++,c++;continue}if(d===")"||d==="]"||d==="}"){g--,c++;continue}if(d===";"&&g===0)return c+1;c++}return a};while(t<a){let u=e[t];if(u==="/"&&e[t+1]==="/"){let c=o();s.push(e.slice(t,c)),t=c;continue}if(u==="/"&&e[t+1]==="*"){let c=p();s.push(e.slice(t,c)),t=c;continue}if(u==='"'||u==="'"||u==="`"){let c=l(u);s.push(e.slice(t,c)),t=c;continue}if(u==="{"){n++,s.push(u),t++;continue}if(u==="}"){n--,s.push(u),t++;continue}if(n===0){let c=t>0?e[t-1]:"";if(c===""||/\s/.test(c)||c===";"||c==="}"||c==="{"){let d=e.slice(t).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(d){let f=d[2],b=h(t+d[0].length);if(i.has(f)){s.push(`/* stx: deduped const ${f} */`),t=b;continue}i.add(f),s.push(e.slice(t,b)),t=b;continue}}}s.push(u),t++}return s.join("")}var fe=new Set(["script","style","html","head","meta","link","title","!doctype"]);function D(e,i,s){for(let t of s){if(t.start>=i)return!1;if(t.end>e)return!0}return!1}function de(e,i,s){let t=0;while(t<e.length){let n=e.indexOf(i,t);if(n===-1)return!1;if(!D(n,n+i.length,s))return!0;t=n+i.length}return!1}function ge(e,i){if(de(e,"<body",i)){let n=new RegExp(`<body(${j})>`,"g"),a;while((a=n.exec(e))!==null)if(!D(a.index,a.index+a[0].length,i))return a.index+a[0].length-1;return null}let s=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${j})>`,"gi"),t;while((t=s.exec(e))!==null){if(D(t.index,t.index+t[0].length,i))continue;if(fe.has(t[1].toLowerCase()))continue;return t.index+t[0].length-1}return null}function pe(e,i,s,t){let n=[],a=` data-stx="${t}"`,l=0,o=!1,p=(h)=>{if(s!==null&&!o&&s>=l&&s<=h)n.push(e.slice(l,s),a,e.slice(s,h)),o=!0;else n.push(e.slice(l,h))};for(let h of i){if(h.start<l)continue;p(h.start),l=h.end}return p(e.length),n.join("")}async function Vr(e,i,s,t={}){let n=_l(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),a=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,l=[],{hasUserImports:o,bundleClientScript:p}=await r("stx/client-script-bundler",()=>import("./chunk-ywqs7x8g.js"));for(let m of n){let x=m.body;if(De(m.attrs))x=Me(x);if(t.forceClientSetup||a.test(x)){l.push({content:x,start:m.start,end:m.end});continue}if(!o(x))continue;try{let C=await p(Pt(x).code,i||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(a.test(C))l.push({content:x,start:m.start,end:m.end})}catch{}}if(l.length===0)return{output:e,setupCode:null};let h=`${i??""}\x00${l.map((m)=>m.content).join("\x00")}`,u=`__stx_setup_${Bun.hash(h).toString(36).slice(0,10)}`,c=[];for(let m=0;m<l.length;m++){let x=l[m].bundled??Pt(l[m].content).code;if(!l[m].bundled&&o(x))x=await p(x,i||"",{projectRoot:process.cwd()});x=ht(x);let C=T(x);c.push(`// \u2500\u2500 merged signal script #${m+1} \u2500\u2500
6
6
  ${C}`)}let g=c.join(`
7
7
 
8
8
  `);g=ue(g);let f=L(g).split(",").map((m)=>m.trim()).filter(Boolean),b=dn(g,s),E=`
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{kl,Br}from"./chunk-hm9jt1p9.js";import"./chunk-ka8befem.js";import"./chunk-p472crv1.js";import{ar}from"./chunk-vdjj4vrp.js";import"./chunk-kpeep7gq.js";import"./chunk-1sr6c0nk.js";import{tt}from"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{tt as freeIdentifiers,Br as processComponents,kl as processESImports,ar as rendersAsElement};
2
+ import{kl,Br}from"./chunk-nx6d1hj7.js";import"./chunk-ka8befem.js";import"./chunk-p472crv1.js";import{ar}from"./chunk-p23sz4rr.js";import"./chunk-144yp2bw.js";import"./chunk-1sr6c0nk.js";import{tt}from"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{tt as freeIdentifiers,Br as processComponents,kl as processESImports,ar as rendersAsElement};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ll,ul,Ce,dl,Qi,Gt,Kt,rp,ea,Xt,Fn,pl,fl,gl,qs,Jt,ml,Yt,hl}from"./chunk-zcz97ber.js";import"./chunk-sme31jbj.js";import"./chunk-md2jn67b.js";import"./chunk-9k2wz3k1.js";import"./chunk-9edksf8x.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-fzqj1mjz.js";import"./chunk-365vg0eg.js";import"./chunk-vdjj4vrp.js";import"./chunk-kpeep7gq.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{Fn as MODULE_SPECIFIER_PREFIX,ll as bundleCacheDir,ul as bundleCacheEntryLimit,Yt as bundleClientScript,Kt as clearBundleFailures,Ce as clientBundleDependencies,Gt as getBundleFailures,Xt as hasUserImports,Jt as moduleSubstitutionKey,fl as normalizeRegistrySpecifiers,ml as queueClientBundleBuild,Qi as recordBundleFailure,pl as registryIdForPath,ea as resolveBundlerFallback,gl as rewriteRegistryImports,rp as setBundlerFallbackMode,dl as shouldLogBundlerDiagnostics,hl as tempBuildName,qs as withModuleSubstitutes};
2
+ import{ll,ul,Ce,dl,Qi,Gt,Kt,rp,ea,Xt,Fn,pl,fl,gl,qs,Jt,ml,Yt,hl}from"./chunk-4b1ed4qv.js";import"./chunk-03wssg2z.js";import"./chunk-md2jn67b.js";import"./chunk-nytb5e4v.js";import"./chunk-nt7jxmpy.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-fzqj1mjz.js";import"./chunk-365vg0eg.js";import"./chunk-p23sz4rr.js";import"./chunk-144yp2bw.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{Fn as MODULE_SPECIFIER_PREFIX,ll as bundleCacheDir,ul as bundleCacheEntryLimit,Yt as bundleClientScript,Kt as clearBundleFailures,Ce as clientBundleDependencies,Gt as getBundleFailures,Xt as hasUserImports,Jt as moduleSubstitutionKey,fl as normalizeRegistrySpecifiers,ml as queueClientBundleBuild,Qi as recordBundleFailure,pl as registryIdForPath,ea as resolveBundlerFallback,gl as rewriteRegistryImports,rp as setBundlerFallbackMode,dl as shouldLogBundlerDiagnostics,hl as tempBuildName,qs as withModuleSubstitutes};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{he,hs,ru,Ap,su,Pp,It,d,F,K,fn,ve,ou,Lo,iu,Ip,k,au,Op,_,Np}from"./chunk-vdjj4vrp.js";import"./chunk-kpeep7gq.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{au as applyFilters,Pp as clearCustomFilters,ou as clientLoopScopes,hs as defaultFilters,fn as escapeAttributeValue,d as escapeHtml,F as escapeHtmlValue,K as escapeInterpolatedHtmlValue,_ as evaluateExpression,he as findMustacheEnd,su as getAllFilters,iu as interpolateScriptAttributes,Lo as interpolateScriptExpressions,Ip as interpolateScriptsInTemplate,k as processExpressions,ru as registerFilter,Ap as registerFilters,It as replaceInterpolations,Op as resetRejectedExpressionWarnings,Np as unescapeHtml,ve as usesSignalsInScript};
2
+ import{he,hs,ru,Ap,su,Pp,It,d,F,K,fn,ve,ou,Lo,iu,Ip,k,au,Op,_,Np}from"./chunk-p23sz4rr.js";import"./chunk-144yp2bw.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{au as applyFilters,Pp as clearCustomFilters,ou as clientLoopScopes,hs as defaultFilters,fn as escapeAttributeValue,d as escapeHtml,F as escapeHtmlValue,K as escapeInterpolatedHtmlValue,_ as evaluateExpression,he as findMustacheEnd,su as getAllFilters,iu as interpolateScriptAttributes,Lo as interpolateScriptExpressions,Ip as interpolateScriptsInTemplate,k as processExpressions,ru as registerFilter,Ap as registerFilters,It as replaceInterpolations,Op as resetRejectedExpressionWarnings,Np as unescapeHtml,ve as usesSignalsInScript};