@stacksjs/stx 0.2.672 → 0.2.673

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-s20h5gmr.js → chunk-0f4csefs.js} +2 -2
  2. package/dist/{chunk-p3x21vp7.js → chunk-0qqvmfrw.js} +5 -5
  3. package/dist/{chunk-x68etmdg.js → chunk-1fd7x7b8.js} +1 -1
  4. package/dist/{chunk-5pgk3w2c.js → chunk-1ptwdkvn.js} +1 -1
  5. package/dist/chunk-1v60t3sb.js +2 -0
  6. package/dist/{chunk-f9hrpwsw.js → chunk-5xvan09w.js} +1 -1
  7. package/dist/{chunk-7spxdz5k.js → chunk-6rzshbey.js} +1 -1
  8. package/dist/{chunk-qffbkvfn.js → chunk-7b3kr56x.js} +1 -1
  9. package/dist/{chunk-avnhsjq0.js → chunk-81q3sc0w.js} +1 -1
  10. package/dist/{chunk-aw3meb8t.js → chunk-8d33aqs5.js} +1 -1
  11. package/dist/chunk-8tdz8svp.js +2 -0
  12. package/dist/{chunk-n3m7fkv1.js → chunk-8yqfpkp4.js} +3 -3
  13. package/dist/{chunk-9yxgdy4z.js → chunk-99bhc1h1.js} +1 -1
  14. package/dist/chunk-9rrnyd5m.js +2 -0
  15. package/dist/{chunk-sjcqxfq1.js → chunk-9tdnfztv.js} +2 -2
  16. package/dist/{chunk-wankp78x.js → chunk-agqcqf3q.js} +4 -4
  17. package/dist/{chunk-tb6vacgp.js → chunk-amkwmxs8.js} +1 -1
  18. package/dist/chunk-b1hxtn08.js +2 -0
  19. package/dist/{chunk-qq1k3364.js → chunk-b4vk2m82.js} +1 -1
  20. package/dist/chunk-b58tv8jc.js +25 -0
  21. package/dist/{chunk-am246nf3.js → chunk-b6nzy1rg.js} +1 -1
  22. package/dist/{chunk-sqayfat9.js → chunk-chzgfna2.js} +1 -1
  23. package/dist/{chunk-3349573p.js → chunk-dq56166k.js} +1 -1
  24. package/dist/{chunk-wz6368p4.js → chunk-e6p0k6br.js} +1 -1
  25. package/dist/{chunk-sw6p5176.js → chunk-f8agvh5v.js} +1 -1
  26. package/dist/{chunk-96mm4q2g.js → chunk-g64z2e92.js} +1 -1
  27. package/dist/{chunk-0f33ssaq.js → chunk-gw7h5k3b.js} +1 -1
  28. package/dist/{chunk-8k3rwv8r.js → chunk-h4dkvnhd.js} +2 -2
  29. package/dist/{chunk-9gfffs28.js → chunk-hmyb701s.js} +2 -2
  30. package/dist/{chunk-t9yqq483.js → chunk-hzv2qj0t.js} +2 -2
  31. package/dist/{chunk-7kk2m44a.js → chunk-jefe0rgt.js} +2 -2
  32. package/dist/{chunk-mjm3tyfj.js → chunk-jg5zt20a.js} +5 -5
  33. package/dist/{chunk-wyq0c4wy.js → chunk-jr9wfthg.js} +1 -1
  34. package/dist/{chunk-6xe8rnfv.js → chunk-jst1fbdm.js} +1 -1
  35. package/dist/chunk-kq9y6gfy.js +2 -0
  36. package/dist/{chunk-1mj9crcg.js → chunk-m6q3f5rf.js} +4 -4
  37. package/dist/chunk-md2qhahg.js +2 -0
  38. package/dist/{chunk-wz2zb53w.js → chunk-mxbc2ahy.js} +1 -1
  39. package/dist/{chunk-e44z03s5.js → chunk-p38m3947.js} +1 -1
  40. package/dist/{chunk-06b8btkv.js → chunk-ptcj11b4.js} +1 -1
  41. package/dist/chunk-qcjh3pp8.js +2 -0
  42. package/dist/{chunk-a3yte051.js → chunk-qmfycza5.js} +1 -1
  43. package/dist/{chunk-7d2fab0z.js → chunk-qw441qys.js} +1 -1
  44. package/dist/chunk-qyjsne99.js +2 -0
  45. package/dist/{chunk-a91atghh.js → chunk-rcsgt4wy.js} +1 -1
  46. package/dist/{chunk-5w1c7x22.js → chunk-rermy54w.js} +1 -1
  47. package/dist/{chunk-d6en3vz7.js → chunk-rwjf25ht.js} +1 -1
  48. package/dist/{chunk-sj6mhjdq.js → chunk-rx0ep3v1.js} +1 -1
  49. package/dist/{chunk-t961jbzc.js → chunk-sfc2v7rt.js} +1 -1
  50. package/dist/chunk-sy0z64yz.js +2 -0
  51. package/dist/{chunk-kwek8xdt.js → chunk-t0zh1dn9.js} +6 -6
  52. package/dist/{chunk-23b0khvh.js → chunk-ta7bmfvg.js} +1 -1
  53. package/dist/{chunk-ttbn287w.js → chunk-vhs13kbf.js} +1 -1
  54. package/dist/{chunk-kenbxxbn.js → chunk-wns8g6k9.js} +1 -1
  55. package/dist/{chunk-sqhmkvwd.js → chunk-xr69d4tk.js} +1 -1
  56. package/dist/{chunk-pvb48ehs.js → chunk-xwhmh0w0.js} +1 -1
  57. package/dist/chunk-xz6dw6yw.js +2 -0
  58. package/dist/{chunk-dnw3knxq.js → chunk-y8kdy3d2.js} +1 -1
  59. package/dist/{chunk-a5zqqgx2.js → chunk-yg267y85.js} +1 -1
  60. package/dist/{chunk-yqz01qvy.js → chunk-ynz7bzc6.js} +1 -1
  61. package/dist/{chunk-dw81nc5v.js → chunk-zvygkwyf.js} +1 -1
  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/loops.js +7 -1
  66. package/dist/pwa.js +1 -1
  67. package/dist/ssg.js +2 -2
  68. package/package.json +5 -5
  69. package/dist/chunk-0dcrd58z.js +0 -2
  70. package/dist/chunk-17yfcd5s.js +0 -2
  71. package/dist/chunk-4ve8vsw5.js +0 -2
  72. package/dist/chunk-7a3g26kk.js +0 -2
  73. package/dist/chunk-7dtpszqq.js +0 -2
  74. package/dist/chunk-a95r5nmq.js +0 -25
  75. package/dist/chunk-f8dkq3ta.js +0 -2
  76. package/dist/chunk-sc7hszsx.js +0 -2
  77. package/dist/chunk-we8ptx6w.js +0 -2
  78. package/dist/chunk-z8j2sbnb.js +0 -2
  79. package/dist/chunk-zp9k5pha.js +0 -2
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{gn,jo}from"./chunk-pvb48ehs.js";import"./chunk-1sr6c0nk.js";export{jo as generateRuntimeConfigTypes,gn as prepareRuntimeConfig};
2
+ import{gn,jo}from"./chunk-xwhmh0w0.js";import"./chunk-1sr6c0nk.js";export{jo as generateRuntimeConfigTypes,gn as prepareRuntimeConfig};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{xc,Sc}from"./chunk-0qqvmfrw.js";import"./chunk-ynz7bzc6.js";import"./chunk-qmfycza5.js";import"./chunk-7met6yva.js";import"./chunk-7d4z944r.js";import"./chunk-ptcj11b4.js";import"./chunk-zqtbtqbq.js";import"./chunk-1ptwdkvn.js";import{_i}from"./chunk-jefe0rgt.js";import"./chunk-jxda11cg.js";import"./chunk-89jbdtgw.js";import"./chunk-5xvan09w.js";import"./chunk-rcadtv3x.js";import"./chunk-ta7bmfvg.js";import"./chunk-b823zxq6.js";import"./chunk-ym41ybz2.js";import"./chunk-n38yb274.js";import"./chunk-7b3kr56x.js";import"./chunk-tre98h62.js";import"./chunk-wns8g6k9.js";import"./chunk-dgb4z4kw.js";import"./chunk-r3e6x87d.js";import"./chunk-mmwedr93.js";import"./chunk-aprhqxky.js";import"./chunk-kgfgb971.js";import"./chunk-nrvwejdw.js";import"./chunk-zvygkwyf.js";import"./chunk-sfc2v7rt.js";import"./chunk-3y41efsf.js";import"./chunk-hzv2qj0t.js";import"./chunk-yfvm7q6t.js";import"./chunk-6ajahb2x.js";import"./chunk-1fd7x7b8.js";import"./chunk-mxbc2ahy.js";import"./chunk-md2jn67b.js";import{Te,s}from"./chunk-jg5zt20a.js";import"./chunk-h4dkvnhd.js";import"./chunk-prf164ct.js";import"./chunk-b58tv8jc.js";import"./chunk-m6q3f5rf.js";import"./chunk-99bhc1h1.js";import"./chunk-ka8befem.js";import"./chunk-9tdnfztv.js";import{me}from"./chunk-agqcqf3q.js";import"./chunk-p472crv1.js";import{Xn,Jn}from"./chunk-jst1fbdm.js";import{qr,N,o}from"./chunk-hmyb701s.js";import"./chunk-yg267y85.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-fzqj1mjz.js";import"./chunk-365vg0eg.js";import{g,Ne}from"./chunk-t0zh1dn9.js";import"./chunk-xwhmh0w0.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";import"./chunk-9p6efb17.js";import"./chunk-t2pzy3x1.js";export{qr as buildWebComponents,Jn as cacheTemplate,Xn as checkCache,_i as classifyAllScripts,xc as createMiddleware,Sc as createRoute,N as defaultConfig,g as extractVariables,me as injectRouterScript,o as loadStxConfig,Ne as processClientScript,s as processDirectives,Te as readMarkdownFile};
@@ -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-wz6368p4.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-d6en3vz7.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-e6p0k6br.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-rwjf25ht.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};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{op,na,ip,ra,yl,bl,en,Wn,ap,vl,wl,cp,h}from"./chunk-8k3rwv8r.js";import"./chunk-6xe8rnfv.js";import"./chunk-kwek8xdt.js";import"./chunk-pvb48ehs.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{en as buildCss,vl as extractClassNames,bl as fingerprintConfig,wl as generateCss,ap as getCachedCSS,op as getCssServeAsset,h as injectCss,na as loadCssEngine,ra as loadCssEngineConfig,Wn as rebuildCss,ip as resetCssCache,yl as resolveUserCssConfig,cp as withLinkedModuleBundles};
2
+ import{op,na,ip,ra,yl,bl,en,Wn,ap,vl,wl,cp,h}from"./chunk-h4dkvnhd.js";import"./chunk-jst1fbdm.js";import"./chunk-t0zh1dn9.js";import"./chunk-xwhmh0w0.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{en as buildCss,vl as extractClassNames,bl as fingerprintConfig,wl as generateCss,ap as getCachedCSS,op as getCssServeAsset,h as injectCss,na as loadCssEngine,ra as loadCssEngineConfig,Wn as rebuildCss,ip as resetCssCache,yl as resolveUserCssConfig,cp as withLinkedModuleBundles};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ye,Io,Oo,Kl,Pt,Wa,No,qa,$p,Oe,dn,Ne}from"./chunk-kwek8xdt.js";import{Za,i}from"./chunk-qjtpxsyx.js";import"./chunk-pvb48ehs.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{ye as BROWSER_CORE_IMPORTS,Kl as STX_AUTO_IMPORTS,Io as extractAndStripCssImports,Oe as extractBridgeData,Za as findInterpolationEnd,qa as generateAutoImportDestructuring,$p as generateBrowserAutoImportDestructuring,dn as generateServerDataBridge,Pt as injectBrowserCoreAutoImports,Ne as processClientScript,No as referencesName,Oo as renderVendorStyleTags,i as stripCommentsAndLiterals,Wa as transformAutoImports};
2
+ import{ye,Io,Oo,Kl,Pt,Wa,No,qa,$p,Oe,dn,Ne}from"./chunk-t0zh1dn9.js";import{Za,i}from"./chunk-qjtpxsyx.js";import"./chunk-xwhmh0w0.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{ye as BROWSER_CORE_IMPORTS,Kl as STX_AUTO_IMPORTS,Io as extractAndStripCssImports,Oe as extractBridgeData,Za as findInterpolationEnd,qa as generateAutoImportDestructuring,$p as generateBrowserAutoImportDestructuring,dn as generateServerDataBridge,Pt as injectBrowserCoreAutoImports,Ne as processClientScript,No as referencesName,Oo as renderVendorStyleTags,i as stripCommentsAndLiterals,Wa as transformAutoImports};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Lc,Ju,jc,Bc,Yu,Zu}from"./chunk-23b0khvh.js";import"./chunk-kwek8xdt.js";import"./chunk-pvb48ehs.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{Zu as applySlots,Yu as extractSlotContent,Ju as parseSlotElement,Lc as parseSlots,Bc as processSlots,jc as renderSlot};
2
+ import{Lc,Ju,jc,Bc,Yu,Zu}from"./chunk-ta7bmfvg.js";import"./chunk-t0zh1dn9.js";import"./chunk-xwhmh0w0.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{Zu as applySlots,Yu as extractSlotContent,Ju as parseSlotElement,Lc as parseSlots,Bc as processSlots,jc as renderSlot};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{x}from"./chunk-pxdww4rb.js";import{T,vn}from"./chunk-ce6zddpf.js";import{rn,y,b,S,G}from"./chunk-kwek8xdt.js";import{o}from"./chunk-9gfffs28.js";import{Ce,Xt,Jt,Yt}from"./chunk-x68etmdg.js";import{ht}from"./chunk-sjcqxfq1.js";import{pt,In,Wt,se}from"./chunk-npa7gze7.js";import{C,yr}from"./chunk-fbtv2k1p.js";import w from"path";var v=new Map,k=new Map,A=y(64),E=new Map,Z=["composables","functions"];function z(t){let n=w.basename(t,".ts");return n==="index"||n==="types"||t.endsWith(".d.ts")}async function q(t){if(t)return w.resolve(t);let n=`<default>:${process.cwd()}`,a=E.get(n);if(a!==void 0)return a;let e=await Q();if(e!==null)E.set(n,e);return e}async function Q(){let t=await o(),n=t.root||process.cwd(),a=t.composablesDir;if(a)return w.resolve(n,a);for(let e of Z){let s=w.resolve(n,e);try{let d=new Bun.Glob("**/*.ts");for await(let c of d.scan({cwd:s,absolute:!0}))if(!z(c))return s}catch{}}return null}async function J(t){let n=Array.isArray(t)?t:t?[w.resolve(t)]:(await o())._layerComposableDirs??[await q()].filter((e)=>!!e),a=new Map;for(let e of n){let s=new Bun.Glob("**/*.ts");try{for await(let d of s.scan({cwd:e,absolute:!0})){let c=w.relative(e,d);if(!z(d)&&!a.has(c))a.set(c,d)}}catch{}}return{key:n.join("\x00"),files:[...a.values()].sort()}}async function zs(t){let{files:n}=await J(t),a=G({loader:"ts",target:"browser",define:S()}),e=[];for(let s of n)try{let d=await Bun.file(s).text(),c=a.scan(d).exports.filter((m)=>m!=="default");if(c.length>0)e.push({file:s,names:c})}catch{}return e}function V(t,n){return new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(t)}function L(t,n){let a=new Set(t.match(/\w+/g)),e=new Set;for(let s of n)if(/^\w+$/.test(s)?a.has(s):V(t,s))e.add(s);return e}var U=y(64);function Y(t,n){let a=b(t,n.size),e=U.get(a);if(e)return e;let s;try{s=rn(t,n)}catch{s=L(t,n)}let d=[...t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}\s*=\s*window\.__composables\u0008/g),...t.matchAll(/import\s*\{([^}]*)\}\s*from\s*['"]@composables['"]/g)];for(let c of d)for(let m of c[1].split(",")){let p=m.trim().split(/\s*(?::|\u0008as\u0008)\s*/)[0];if(p&&n.has(p))s.add(p)}return U.set(a,s),s}function ee(t,n,a){let e=new Map;for(let{file:u,names:l}of t)for(let f of l)if(!e.has(f))e.set(f,u);let s=(u)=>{let l=[];for(let f of L(u,e.keys()))l.push(e.get(f));return l},d=new Set(e.keys()),c=(u)=>{let l=[];for(let f of Y(u,d))l.push(e.get(f));return l},m=new Set,p=a.flatMap((u,l)=>l===0?s(u):c(u));while(p.length>0){let u=[];for(let l of p){if(m.has(l))continue;m.add(l);for(let f of c(n.get(l)??""))if(!m.has(f))u.push(f)}p=u}return m}async function zd(t,n,a){let{key:e,files:s}=await J(t);if(!e)return null;let d=()=>[...new Set([...s,...s.flatMap((r)=>Ce(r))])],c=pt(d());if(s.length===0)return se(v,e,c,""),null;s.sort();let m=G({loader:"ts",target:"browser",define:S()}),p=Wt(k,e,c);if(!p){let r=new Map,i=[];for(let g of s)try{let h=await Bun.file(g).text();r.set(g,h);let _=m.scan(h).exports.filter((X)=>X!=="default");if(_.length>0)i.push({file:g,names:_})}catch{r.set(g,"")}p=se(k,e,c,{codeByFile:r,modules:i})}let{codeByFile:u,modules:l}=p,f;if(n===void 0)f=new Set(s);else{let r=a?[n,...a]:[n],i=b(r.join("\x00"),e,r.length,c),g=A.get(i);if(f=g??ee(l,u,r),!g)A.set(i,f)}if(f.size===0)return null;let I=s.filter((r)=>f.has(r)),M=`${e}\x00${I.join("\x00")}\x00${Jt()}`,F=Wt(v,M,c);if(F!==void 0)return F||null;let N=[],B=new Set,R=new Set;for(let r of I)try{let i=u.get(r)??await Bun.file(r).text(),g=w.basename(r,".ts");for(let _ of i.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(_[1])R.add(_[1]);let h=[];try{for(let _ of m.scan(i).exports)if(_!=="default")B.add(_),h.push(_)}catch{}if(i=T(i),Xt(i))i=await Yt(i,r,{projectRoot:process.cwd(),externalizeUserModules:!1,expose:h}),i=ht(i);i=vn(i),i=i.replace(/^export\s+(default\s+)?/gm,""),i=m.transformSync(i),N.push(`// Composable: ${g}
2
+ import{x}from"./chunk-pxdww4rb.js";import{T,vn}from"./chunk-ce6zddpf.js";import{rn,y,b,S,G}from"./chunk-t0zh1dn9.js";import{o}from"./chunk-hmyb701s.js";import{Ce,Xt,Jt,Yt}from"./chunk-1fd7x7b8.js";import{ht}from"./chunk-9tdnfztv.js";import{pt,In,Wt,se}from"./chunk-npa7gze7.js";import{C,yr}from"./chunk-fbtv2k1p.js";import w from"path";var v=new Map,k=new Map,A=y(64),E=new Map,Z=["composables","functions"];function z(t){let n=w.basename(t,".ts");return n==="index"||n==="types"||t.endsWith(".d.ts")}async function q(t){if(t)return w.resolve(t);let n=`<default>:${process.cwd()}`,a=E.get(n);if(a!==void 0)return a;let e=await Q();if(e!==null)E.set(n,e);return e}async function Q(){let t=await o(),n=t.root||process.cwd(),a=t.composablesDir;if(a)return w.resolve(n,a);for(let e of Z){let s=w.resolve(n,e);try{let d=new Bun.Glob("**/*.ts");for await(let c of d.scan({cwd:s,absolute:!0}))if(!z(c))return s}catch{}}return null}async function J(t){let n=Array.isArray(t)?t:t?[w.resolve(t)]:(await o())._layerComposableDirs??[await q()].filter((e)=>!!e),a=new Map;for(let e of n){let s=new Bun.Glob("**/*.ts");try{for await(let d of s.scan({cwd:e,absolute:!0})){let c=w.relative(e,d);if(!z(d)&&!a.has(c))a.set(c,d)}}catch{}}return{key:n.join("\x00"),files:[...a.values()].sort()}}async function zs(t){let{files:n}=await J(t),a=G({loader:"ts",target:"browser",define:S()}),e=[];for(let s of n)try{let d=await Bun.file(s).text(),c=a.scan(d).exports.filter((m)=>m!=="default");if(c.length>0)e.push({file:s,names:c})}catch{}return e}function V(t,n){return new RegExp(`\\b${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(t)}function L(t,n){let a=new Set(t.match(/\w+/g)),e=new Set;for(let s of n)if(/^\w+$/.test(s)?a.has(s):V(t,s))e.add(s);return e}var U=y(64);function Y(t,n){let a=b(t,n.size),e=U.get(a);if(e)return e;let s;try{s=rn(t,n)}catch{s=L(t,n)}let d=[...t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}\s*=\s*window\.__composables\u0008/g),...t.matchAll(/import\s*\{([^}]*)\}\s*from\s*['"]@composables['"]/g)];for(let c of d)for(let m of c[1].split(",")){let p=m.trim().split(/\s*(?::|\u0008as\u0008)\s*/)[0];if(p&&n.has(p))s.add(p)}return U.set(a,s),s}function ee(t,n,a){let e=new Map;for(let{file:u,names:l}of t)for(let f of l)if(!e.has(f))e.set(f,u);let s=(u)=>{let l=[];for(let f of L(u,e.keys()))l.push(e.get(f));return l},d=new Set(e.keys()),c=(u)=>{let l=[];for(let f of Y(u,d))l.push(e.get(f));return l},m=new Set,p=a.flatMap((u,l)=>l===0?s(u):c(u));while(p.length>0){let u=[];for(let l of p){if(m.has(l))continue;m.add(l);for(let f of c(n.get(l)??""))if(!m.has(f))u.push(f)}p=u}return m}async function zd(t,n,a){let{key:e,files:s}=await J(t);if(!e)return null;let d=()=>[...new Set([...s,...s.flatMap((r)=>Ce(r))])],c=pt(d());if(s.length===0)return se(v,e,c,""),null;s.sort();let m=G({loader:"ts",target:"browser",define:S()}),p=Wt(k,e,c);if(!p){let r=new Map,i=[];for(let g of s)try{let h=await Bun.file(g).text();r.set(g,h);let _=m.scan(h).exports.filter((X)=>X!=="default");if(_.length>0)i.push({file:g,names:_})}catch{r.set(g,"")}p=se(k,e,c,{codeByFile:r,modules:i})}let{codeByFile:u,modules:l}=p,f;if(n===void 0)f=new Set(s);else{let r=a?[n,...a]:[n],i=b(r.join("\x00"),e,r.length,c),g=A.get(i);if(f=g??ee(l,u,r),!g)A.set(i,f)}if(f.size===0)return null;let I=s.filter((r)=>f.has(r)),M=`${e}\x00${I.join("\x00")}\x00${Jt()}`,F=Wt(v,M,c);if(F!==void 0)return F||null;let N=[],B=new Set,R=new Set;for(let r of I)try{let i=u.get(r)??await Bun.file(r).text(),g=w.basename(r,".ts");for(let _ of i.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(_[1])R.add(_[1]);let h=[];try{for(let _ of m.scan(i).exports)if(_!=="default")B.add(_),h.push(_)}catch{}if(i=T(i),Xt(i))i=await Yt(i,r,{projectRoot:process.cwd(),externalizeUserModules:!1,expose:h}),i=ht(i);i=vn(i),i=i.replace(/^export\s+(default\s+)?/gm,""),i=m.transformSync(i),N.push(`// Composable: ${g}
3
3
  ${i.trim()}`)}catch(i){console.warn(`[stx] Failed to load composable ${r}:`,i)}if(N.length===0||B.size===0)return se(v,M,c,""),null;let H=[...B].map((r)=>` try { if (!(${JSON.stringify(r)} in __c)) __c[${JSON.stringify(r)}] = ${r}; } catch (e) {}`).join(`
4
4
  `),j=JSON.stringify([...B]),D=N.join(`
5
5
 
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{zs,zd,Hd}from"./chunk-sfc2v7rt.js";import"./chunk-1fd7x7b8.js";import"./chunk-mxbc2ahy.js";import"./chunk-md2jn67b.js";import"./chunk-9tdnfztv.js";import"./chunk-agqcqf3q.js";import"./chunk-p472crv1.js";import"./chunk-hmyb701s.js";import"./chunk-yg267y85.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-fzqj1mjz.js";import"./chunk-365vg0eg.js";import"./chunk-t0zh1dn9.js";import"./chunk-xwhmh0w0.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{Hd as clearComposableCache,zd as getComposableScript,zs as listComposableModules};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{je,mn,ys,Bo,A}from"./chunk-1sr6c0nk.js";import{gn}from"./chunk-pvb48ehs.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-xwhmh0w0.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.672";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.673";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-wz6368p4.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-e6p0k6br.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-96mm4q2g.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-e44z03s5.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-7spxdz5k.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-wyq0c4wy.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-sj6mhjdq.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-sj6mhjdq.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-f8dkq3ta.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-g64z2e92.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-p38m3947.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-6rzshbey.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-jr9wfthg.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-rx0ep3v1.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-rx0ep3v1.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-8tdz8svp.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-wz6368p4.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-sw6p5176.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-e6p0k6br.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-f8agvh5v.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,3 +1,3 @@
1
1
  // @bun
2
- import{p,u}from"./chunk-2dp7hyv7.js";import{be,ue,d}from"./chunk-kwek8xdt.js";function z(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function k(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function B(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=k(t,s+1);if(a===-1)return-1;let f=t.slice(s,a),c=f.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(f))e++}n=a}return-1}function Z(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let c=f[2].toLowerCase();if(f[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);e=s;continue}let g=/\/\s*>$/.test(a),m=i.length===0?a.match(r):null;if(m){let l=m[1]||m[2],h=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=g||N.has(c)?-1:B(t,c,s);if(S===-1)o.push({start:n,end:s,slotName:l,element:h}),e=s;else o.push({start:n,end:S,slotName:l,element:h+t.slice(s,S)}),e=S;continue}if(!g&&!N.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function L(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let c=f[1]==="/",g=f[2].toLowerCase();if(c){let l=i.lastIndexOf(g);if(l!==-1)i.splice(l);e=s;continue}if(g==="template"&&i.length===0){let l=a.match(r);if(l){let h=z(t,s);if(h!==-1){let S=l[1]||l[2]||l[3];o.push({start:n,end:h,slotName:S,content:t.slice(s,h-11).trim(),propsBinding:l[4]||void 0}),e=h;continue}}}if(!/\/\s*>$/.test(a)&&!N.has(g)){if(i.push(g),g==="script"||g==="style"){let l=t.toLowerCase().indexOf(`</${g}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function Lc(t){let o={default:"",named:new Map},i=t,r=L(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=Z(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function Ju(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function jc(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r},a=new Set,f=new Set;if(n.startsWith("{")&&n.endsWith("}")){let c=n.slice(1,-1).split(",").map((g)=>g.trim()).filter(Boolean);for(let g of c){let[m,l]=g.split(":").map((S)=>S.trim()),h=l||m;if(s[h]=o[m],o[m]!==void 0)f.add(h);else a.add(h)}}else if(s[n]=o,Object.values(o).some((c)=>c===void 0))a.add(n);else f.add(n);e=j(e,s,a,f)}return e}function j(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(ue(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!ue(s,r))return e;let a=_(s,o);if(a===void 0)return e;return d(String(a??""))}catch{return`{{ ${n} }}`}})}function _(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!p(t))return;return u(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Bc(t,o,i,r){let e=t;e=await I(e,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(a,f,c,g)=>{let m=o.named.get(f),l=g?.trim()||"",h=c||"",S={},E=[],C=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=C.exec(h))!==null){let w=b[1],x=b[2];S[w]=_(x,i),E.push([w,x])}if(r!==void 0&&m?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=m.propsBinding.trim(),x=be(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let M=E.map(([A,P])=>{let O=S[A],R;try{R=O===void 0?void 0:JSON.stringify(O)}catch{}return`${JSON.stringify(A)}:(${R??P})`}).join(","),v=d(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${d(`${y} in [{${M}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${v}">${m.content}</template>`}return await jc(m,S,l,i)});let s=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return e=e.replace(s,(a,f,c)=>{if(/\bname\s*=/.test(f||""))return a;let g=c?.trim()||"";return o.default||g}),e}async function I(t,o,i){let r=[],e=[];t.replace(o,(a,...f)=>{let c=f[f.length-2];return e.push({match:a,index:c}),r.push(i(a,...f.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:f,index:c}=e[a];s=s.slice(0,c)+n[a]+s.slice(c+f.length)}return s}function Yu(t){let o=Lc(t);return{defaultSlot:o.default,namedSlots:o.named}}async function Zu(t,o,i,r,e){return await Bc(t,{default:o,named:i},r,e)}
2
+ import{p,u}from"./chunk-2dp7hyv7.js";import{be,ue,d}from"./chunk-t0zh1dn9.js";function z(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function k(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function B(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=k(t,s+1);if(a===-1)return-1;let f=t.slice(s,a),c=f.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(f))e++}n=a}return-1}function Z(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let c=f[2].toLowerCase();if(f[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);e=s;continue}let g=/\/\s*>$/.test(a),m=i.length===0?a.match(r):null;if(m){let l=m[1]||m[2],h=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=g||N.has(c)?-1:B(t,c,s);if(S===-1)o.push({start:n,end:s,slotName:l,element:h}),e=s;else o.push({start:n,end:S,slotName:l,element:h+t.slice(s,S)}),e=S;continue}if(!g&&!N.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function L(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let c=f[1]==="/",g=f[2].toLowerCase();if(c){let l=i.lastIndexOf(g);if(l!==-1)i.splice(l);e=s;continue}if(g==="template"&&i.length===0){let l=a.match(r);if(l){let h=z(t,s);if(h!==-1){let S=l[1]||l[2]||l[3];o.push({start:n,end:h,slotName:S,content:t.slice(s,h-11).trim(),propsBinding:l[4]||void 0}),e=h;continue}}}if(!/\/\s*>$/.test(a)&&!N.has(g)){if(i.push(g),g==="script"||g==="style"){let l=t.toLowerCase().indexOf(`</${g}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function Lc(t){let o={default:"",named:new Map},i=t,r=L(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=Z(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function Ju(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function jc(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r},a=new Set,f=new Set;if(n.startsWith("{")&&n.endsWith("}")){let c=n.slice(1,-1).split(",").map((g)=>g.trim()).filter(Boolean);for(let g of c){let[m,l]=g.split(":").map((S)=>S.trim()),h=l||m;if(s[h]=o[m],o[m]!==void 0)f.add(h);else a.add(h)}}else if(s[n]=o,Object.values(o).some((c)=>c===void 0))a.add(n);else f.add(n);e=j(e,s,a,f)}return e}function j(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(ue(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!ue(s,r))return e;let a=_(s,o);if(a===void 0)return e;return d(String(a??""))}catch{return`{{ ${n} }}`}})}function _(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!p(t))return;return u(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Bc(t,o,i,r){let e=t;e=await I(e,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(a,f,c,g)=>{let m=o.named.get(f),l=g?.trim()||"",h=c||"",S={},E=[],C=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=C.exec(h))!==null){let w=b[1],x=b[2];S[w]=_(x,i),E.push([w,x])}if(r!==void 0&&m?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=m.propsBinding.trim(),x=be(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let M=E.map(([A,P])=>{let O=S[A],R;try{R=O===void 0?void 0:JSON.stringify(O)}catch{}return`${JSON.stringify(A)}:(${R??P})`}).join(","),v=d(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${d(`${y} in [{${M}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${v}">${m.content}</template>`}return await jc(m,S,l,i)});let s=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return e=e.replace(s,(a,f,c)=>{if(/\bname\s*=/.test(f||""))return a;let g=c?.trim()||"";return o.default||g}),e}async function I(t,o,i){let r=[],e=[];t.replace(o,(a,...f)=>{let c=f[f.length-2];return e.push({match:a,index:c}),r.push(i(a,...f.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:f,index:c}=e[a];s=s.slice(0,c)+n[a]+s.slice(c+f.length)}return s}function Yu(t){let o=Lc(t);return{defaultSlot:o.default,namedSlots:o.named}}async function Zu(t,o,i,r,e){return await Bc(t,{default:o,named:i},r,e)}
3
3
  export{Lc,Ju,jc,Bc,Yu,Zu};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import"./chunk-2dp7hyv7.js";import"./chunk-pxdww4rb.js";import"./chunk-ce6zddpf.js";import"./chunk-kwek8xdt.js";import"./chunk-1sr6c0nk.js";import"./chunk-pvb48ehs.js";import"./chunk-a3d0g4mr.js";import"./chunk-a5zqqgx2.js";import{c}from"./chunk-zhf01af3.js";import u from"fs";import l from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},i=t.snapshotDir||c(e.root,"story","snapshots");await u.promises.mkdir(i,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((a)=>t.filter.some((o)=>a.fileName.toLowerCase().includes(o.toLowerCase())));for(let a of r)await h(a,i,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let i=e.story;if(!i)return;for(let r of i.variants){n.total++;let a=l.join(t,`${e.id}-${r.id}.snap`),o=g(r.source||""),f=await w(a);if(s.update||!f){let p={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:o};if(await u.promises.writeFile(a,JSON.stringify(p,null,2)),!f)n.new++;n.passed++}else try{let p=await u.promises.readFile(a,"utf-8"),m=JSON.parse(p);if(m.hash===o)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(m.hash,o)})}catch(p){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${p}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await u.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
2
+ import"./chunk-2dp7hyv7.js";import"./chunk-pxdww4rb.js";import"./chunk-ce6zddpf.js";import"./chunk-t0zh1dn9.js";import"./chunk-1sr6c0nk.js";import"./chunk-xwhmh0w0.js";import"./chunk-a3d0g4mr.js";import"./chunk-yg267y85.js";import{c}from"./chunk-zhf01af3.js";import u from"fs";import l from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},i=t.snapshotDir||c(e.root,"story","snapshots");await u.promises.mkdir(i,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((a)=>t.filter.some((o)=>a.fileName.toLowerCase().includes(o.toLowerCase())));for(let a of r)await h(a,i,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let i=e.story;if(!i)return;for(let r of i.variants){n.total++;let a=l.join(t,`${e.id}-${r.id}.snap`),o=g(r.source||""),f=await w(a);if(s.update||!f){let p={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:o};if(await u.promises.writeFile(a,JSON.stringify(p,null,2)),!f)n.new++;n.passed++}else try{let p=await u.promises.readFile(a,"utf-8"),m=JSON.parse(p);if(m.hash===o)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(m.hash,o)})}catch(p){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${p}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await u.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
3
3
  `)}export{F as formatTestResults,d as runVisualTests,x as updateSnapshots};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{g,m,d}from"./chunk-kwek8xdt.js";import{N}from"./chunk-9gfffs28.js";import{s}from"./chunk-mjm3tyfj.js";import k from"path";var q={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var M=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function H(e){let t=[],o=0,n;M.lastIndex=0;while((n=M.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=n[1],i=n[2];t.push({type:"suspense",name:r,content:i}),o=n.index+n[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function rd(e,t={},o={}){let n={...N,...o,streaming:{...q,...o.streaming}},r=n.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),f=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),h={...t,__filename:e,__dirname:k.dirname(e)};if(f.trim())await g(f,h,e);let E=H(c),u=new Set;if(!E.some((w)=>w.type==="suspense")){let w=n.streaming?.strategy||"auto",x=new RegExp(T.source,"g");if(!(w!=="manual"&&x.test(c))){let p=await s(c,h,e,n,u);for(let b=0;b<p.length;b+=r)i.enqueue(p.slice(b,b+r)),await new Promise((y)=>setTimeout(y,0))}else{let p=[],b=new RegExp(T.source,"g"),y;while((y=b.exec(c))!==null)p.push({name:y[1],content:y[2],start:y.index,end:y.index+y[0].length});let v=0;for(let _ of p){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let O=await s(I,h,e,n,u);i.enqueue(O),await new Promise((D)=>setTimeout(D,0))}}let C=await s(_.content,h,e,n,u);i.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await s(_,h,e,n,u);i.enqueue(C)}}}}else{let w=new Map;for(let l of E)if(l.type==="shell"||l.type==="content"){let p=await s(l.content,h,e,n,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
2
+ import{g,m,d}from"./chunk-t0zh1dn9.js";import{N}from"./chunk-hmyb701s.js";import{s}from"./chunk-jg5zt20a.js";import k from"path";var q={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var M=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function H(e){let t=[],o=0,n;M.lastIndex=0;while((n=M.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=n[1],i=n[2];t.push({type:"suspense",name:r,content:i}),o=n.index+n[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function rd(e,t={},o={}){let n={...N,...o,streaming:{...q,...o.streaming}},r=n.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),f=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),h={...t,__filename:e,__dirname:k.dirname(e)};if(f.trim())await g(f,h,e);let E=H(c),u=new Set;if(!E.some((w)=>w.type==="suspense")){let w=n.streaming?.strategy||"auto",x=new RegExp(T.source,"g");if(!(w!=="manual"&&x.test(c))){let p=await s(c,h,e,n,u);for(let b=0;b<p.length;b+=r)i.enqueue(p.slice(b,b+r)),await new Promise((y)=>setTimeout(y,0))}else{let p=[],b=new RegExp(T.source,"g"),y;while((y=b.exec(c))!==null)p.push({name:y[1],content:y[2],start:y.index,end:y.index+y[0].length});let v=0;for(let _ of p){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let O=await s(I,h,e,n,u);i.enqueue(O),await new Promise((D)=>setTimeout(D,0))}}let C=await s(_.content,h,e,n,u);i.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await s(_,h,e,n,u);i.enqueue(C)}}}}else{let w=new Map;for(let l of E)if(l.type==="shell"||l.type==="content"){let p=await s(l.content,h,e,n,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
4
  </div>`),w.set(l.name,s(l.content,h,e,n,u))}i.enqueue(`
5
5
  <script>
@@ -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-kwek8xdt.js";import"./chunk-pvb48ehs.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-t0zh1dn9.js";import"./chunk-xwhmh0w0.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,5 +1,5 @@
1
1
  // @bun
2
- import{mn,A}from"./chunk-1sr6c0nk.js";import m from"fs";import e from"path";async function gn(r,o,i){if(r.__stx_runtime_config)return;let n=mn();if(n||i){r.__stx_runtime_config=n??A(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-aw3meb8t.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=A(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function jo(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
2
+ import{mn,A}from"./chunk-1sr6c0nk.js";import m from"fs";import e from"path";async function gn(r,o,i){if(r.__stx_runtime_config)return;let n=mn();if(n||i){r.__stx_runtime_config=n??A(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-8d33aqs5.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=A(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function jo(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
3
3
  declare module '@stacksjs/stx/runtime-config' { interface PublicRuntimeConfig ${i(o.public??{})} }
4
4
  `),await Bun.write(e.join(r,".stx/runtime-config-server.d.ts"),`import '@stacksjs/stx/runtime-config-server'
5
5
  declare module '@stacksjs/stx/runtime-config-server' { interface PrivateRuntimeConfig ${i(o.private??{})} }
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$u}from"./chunk-qmfycza5.js";import"./chunk-jefe0rgt.js";import"./chunk-mxbc2ahy.js";import"./chunk-agqcqf3q.js";import"./chunk-hmyb701s.js";import"./chunk-yg267y85.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-fzqj1mjz.js";import"./chunk-365vg0eg.js";import"./chunk-t0zh1dn9.js";import"./chunk-xwhmh0w0.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{$u as startProductionServer};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Qs,eo,to,dp,jr,pp}from"./chunk-9yxgdy4z.js";export{jr as clearImageDeliveryCatalog,dp as deliveredImage,to as efficientDeliverySources,Qs as getImageDelivery,eo as isTransparentImage,pp as prepareImageDelivery};
2
+ import{Qs,eo,to,dp,jr,pp}from"./chunk-99bhc1h1.js";export{jr as clearImageDeliveryCatalog,dp as deliveredImage,to as efficientDeliverySources,Qs as getImageDelivery,eo as isTransparentImage,pp as prepareImageDelivery};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{E,t,a}from"./chunk-2dp7hyv7.js";import{K}from"./chunk-kwek8xdt.js";import{fo}from"./chunk-a3d0g4mr.js";import C from"path";var S;async function J(){if(S!==void 0)return S;try{let e=await import("@stacksjs/ts-i18n");S=e.loadLocale??null}catch{S=null}return S}var P={defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},v={},L={},k={};function G(e,s=0){if(s<=0)return!1;return Date.now()-e.loadedAt>s}async function Y(e,s){if({...P,...s.i18n}.cache&&v[e]){let r=v[e],l=s.i18n?.cacheMaxAge??0;if(!G(r,l))return r.translations}if(L[e]?.state==="loading")return L[e].promise;k[e]="loading";let n=T(e,s).then((r)=>(k[e]="loaded",delete L[e],r)).catch((r)=>{throw k[e]="error",L[e]={promise:n,state:"error",error:r instanceof Error?r:Error(String(r))},r});return L[e]={promise:n,state:"loading"},n}async function T(e,s){let i={...P,...s.i18n},n=C.isAbsolute(i.translationsDir)?i.translationsDir:C.resolve(s.root||process.cwd(),i.translationsDir);try{let r=await J(),l=r?await r(e,{translationsDir:n,defaultLocale:i.defaultLocale,sources:te(i.format)}):await Z(e,i,n);if(l===void 0){let u=e!==i.defaultLocale?await T(i.defaultLocale,s):{};if(i.cache)v[e]={translations:u,loadedAt:Date.now(),locale:e};return u}let c=l;if(i.cache)v[e]={translations:c,loadedAt:Date.now(),locale:e};return c}catch(r){if(s.debug)console.error(`Error loading translation file for locale "${e}":`,r);if(e!==i.defaultLocale)return T(i.defaultLocale,s);return{}}}async function Z(e,s,i){let n=C.join(i,`${e}${Q(s.format)}`);try{let r=await import(n);return r.default||r}catch(r){try{let l=await Bun.file(n).text();if(s.format==="yaml"||s.format==="yml")return X(l);if(s.format==="json")return JSON.parse(l);throw r}catch{return}}}function Q(e){switch(e){case"yaml":return".yaml";case"yml":return".yml";case"js":return".js";case"ts":return".ts";case"json":default:return".json"}}function X(e){let s={},i=e.split(`
2
+ import{E,t,a}from"./chunk-2dp7hyv7.js";import{K}from"./chunk-t0zh1dn9.js";import{fo}from"./chunk-a3d0g4mr.js";import C from"path";var S;async function J(){if(S!==void 0)return S;try{let e=await import("@stacksjs/ts-i18n");S=e.loadLocale??null}catch{S=null}return S}var P={defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},v={},L={},k={};function G(e,s=0){if(s<=0)return!1;return Date.now()-e.loadedAt>s}async function Y(e,s){if({...P,...s.i18n}.cache&&v[e]){let r=v[e],l=s.i18n?.cacheMaxAge??0;if(!G(r,l))return r.translations}if(L[e]?.state==="loading")return L[e].promise;k[e]="loading";let n=T(e,s).then((r)=>(k[e]="loaded",delete L[e],r)).catch((r)=>{throw k[e]="error",L[e]={promise:n,state:"error",error:r instanceof Error?r:Error(String(r))},r});return L[e]={promise:n,state:"loading"},n}async function T(e,s){let i={...P,...s.i18n},n=C.isAbsolute(i.translationsDir)?i.translationsDir:C.resolve(s.root||process.cwd(),i.translationsDir);try{let r=await J(),l=r?await r(e,{translationsDir:n,defaultLocale:i.defaultLocale,sources:te(i.format)}):await Z(e,i,n);if(l===void 0){let u=e!==i.defaultLocale?await T(i.defaultLocale,s):{};if(i.cache)v[e]={translations:u,loadedAt:Date.now(),locale:e};return u}let c=l;if(i.cache)v[e]={translations:c,loadedAt:Date.now(),locale:e};return c}catch(r){if(s.debug)console.error(`Error loading translation file for locale "${e}":`,r);if(e!==i.defaultLocale)return T(i.defaultLocale,s);return{}}}async function Z(e,s,i){let n=C.join(i,`${e}${Q(s.format)}`);try{let r=await import(n);return r.default||r}catch(r){try{let l=await Bun.file(n).text();if(s.format==="yaml"||s.format==="yml")return X(l);if(s.format==="json")return JSON.parse(l);throw r}catch{return}}}function Q(e){switch(e){case"yaml":return".yaml";case"yml":return".yml";case"js":return".js";case"ts":return".ts";case"json":default:return".json"}}function X(e){let s={},i=e.split(`
3
3
  `),n=[{obj:s,indent:-1}];for(let r of i){let l=r.replace(/#.*$/,"").trimEnd();if(!l.trim())continue;let c=l.search(/\S/);if(c===-1)continue;while(n.length>1&&n[n.length-1].indent>=c)n.pop();let u=n[n.length-1].obj,o=l.match(/^(\s*)(\S[^:]*):\s*(.*)$/);if(o){let[,,g,p]=o,f=g.trim(),m=p.trim();if(m==="")u[f]={},n.push({obj:u[f],indent:c});else u[f]=ee(m)}}return s}function ee(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let s=e.toLowerCase();if(s==="true"||s==="yes")return!0;if(s==="false"||s==="no")return!1;if(s==="null"||s==="~")return null;let i=Number(e);if(!Number.isNaN(i)&&e!=="")return i;return e}function te(e){switch(e){case"yaml":case"yml":return["yaml"];case"js":case"ts":return["ts"];case"json":default:return["json"]}}async function re(e,s){return Y(e,s)}function ne(e,s){for(let i of e){let n=i.trim(),r=n.match(/^\{(\d+)\}\s*(.*)$/);if(r){let c=Number.parseInt(r[1],10);if(s===c)return r[2];continue}let l=n.match(/^\[(\d+),(\d+|\*)\]\s*(.*)$/);if(l){let c=Number.parseInt(l[1],10),u=l[2]==="*"?Number.POSITIVE_INFINITY:Number.parseInt(l[2],10);if(s>=c&&s<=u)return l[3];continue}}if(e.length===2)return s===1?e[0].trim():e[1].trim();if(s<e.length)return e[s].trim();return e[e.length-1].trim()}function ie(e,s={}){return j(e,s)}function j(e,s){let i="",n=0;while(n<e.length)if(e[n]==="{"){let r=se(e,n);if(r===-1){i+=e[n],n++;continue}let l=e.slice(n+1,r);i+=ae(l,s),n=r+1}else if(e[n]==="'"&&n+1<e.length)if(e[n+1]==="'")i+="'",n+=2;else if(e[n+1]==="{"||e[n+1]==="}")i+=e[n+1],n+=2;else i+=e[n],n++;else i+=e[n],n++;return i}function se(e,s){let i=0;for(let n=s;n<e.length;n++)if(e[n]==="{")i++;else if(e[n]==="}"){if(i--,i===0)return n}return-1}function ae(e,s){let i=oe(e);if(i.length===0)return`{${e}}`;let n=i[0].trim(),r=s[n];if(i.length===1)return r!==void 0?String(r):`{${n}}`;switch(i[1].trim().toLowerCase()){case"plural":return le(r,i.slice(2).join(","),s);case"select":return ue(r,i.slice(2).join(","));case"selectordinal":return de(r,i.slice(2).join(","));case"number":return pe(r,i[2]?.trim());case"date":return fe(r,i[2]?.trim());case"time":return me(r,i[2]?.trim());default:return r!==void 0?String(r):`{${e}}`}}function oe(e){let s=[],i="",n=0;for(let r=0;r<e.length;r++){let l=e[r];if(l==="{")n++,i+=l;else if(l==="}")n--,i+=l;else if(l===","&&n===0)s.push(i),i="";else i+=l}if(i)s.push(i);return s}function le(e,s,i){let n=Number(e)||0,r=I(s),l=`=${n}`;if(r[l])return R(r[l],n,i);let c=ce(n);if(r[c])return R(r[c],n,i);if(r.other)return R(r.other,n,i);return String(n)}function R(e,s,i){let n=e.replace(/#/g,String(s));return j(n,i)}function ce(e){let s=Math.abs(e),i=Math.floor(s),n=String(e).includes(".")?String(e).split(".")[1].length:0;if(i===1&&n===0)return"one";return"other"}function ue(e,s){let i=String(e||""),n=I(s);if(n[i])return n[i];return n.other||String(e)}function de(e,s){let i=Number(e)||0,n=I(s),r=ge(i);if(n[r])return n[r].replace(/#/g,String(i));if(n.other)return n.other.replace(/#/g,String(i));return String(i)}function ge(e){let s=Math.abs(e),i=s%10,n=s%100;if(i===1&&n!==11)return"one";if(i===2&&n!==12)return"two";if(i===3&&n!==13)return"few";return"other"}function I(e){let s={},i=/(\w+|=\d+)\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,n=i.exec(e);while(n!==null)s[n[1]]=n[2],n=i.exec(e);return s}function pe(e,s){let i=Number(e);if(Number.isNaN(i))return String(e);switch(s){case"integer":return Math.floor(i).toLocaleString();case"percent":return`${(i*100).toFixed(0)}%`;case"currency":return i.toLocaleString(void 0,{style:"currency",currency:"USD"});default:return i.toLocaleString()}}function fe(e,s){let i=e instanceof Date?e:new Date(String(e));if(Number.isNaN(i.getTime()))return String(e);let n={};switch(s){case"short":n.dateStyle="short";break;case"medium":n.dateStyle="medium";break;case"long":n.dateStyle="long";break;case"full":n.dateStyle="full";break;default:n.dateStyle="medium"}return i.toLocaleDateString(void 0,n)}function me(e,s){let i=e instanceof Date?e:new Date(String(e));if(Number.isNaN(i.getTime()))return String(e);let n={};switch(s){case"short":n.timeStyle="short";break;case"medium":n.timeStyle="medium";break;case"long":n.timeStyle="long";break;case"full":n.timeStyle="full";break;default:n.timeStyle="short"}return i.toLocaleTimeString(void 0,n)}function be(e){return/\{[^}]+,\s*(?:plural|select|selectordinal|number|date|time)\s*,/.test(e)}function O(e,s,i=!0,n={}){let r=e.split("."),l=s;for(let u of r){if(l===void 0||l===null)break;l=l[u]}if(l===void 0||l===null)return i?e:"";let c=String(l);if(be(c))return ie(c,n);if(c.includes("|")&&"count"in n){let u=Number(n.count),o=c.split("|");c=ne(o,u)}for(let[u,o]of Object.entries(n)){let g=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");c=c.replace(new RegExp(`:${g}`,"g"),()=>String(o))}return c}var D=new Set(["ar","arc","ckb","dv","fa","he","khw","ks","nqo","prs","ps","sd","syr","ug","ur","uz-af","yi"]),he=new Set(["adlm","arab","aran","hebr","nkoo","rohg","syrc","thaa","yezi"]);function q(e){if(!e)return"ltr";let s=e.trim().toLowerCase().replace(/_/g,"-").split("-"),i=s[0];if(!i)return"ltr";let n=s[1]?.length===4?s[1]:void 0;if(n)return he.has(n)?"rtl":"ltr";if(s.length>1&&D.has(`${i}-${s[1]}`))return"rtl";return D.has(i)?"rtl":"ltr"}async function fa(e,s,i,n){let r=e,l=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)([\s\S]*?)@endtranslate/g,c={...P,...n.i18n},u=await re(c.locale,n);s.__translations=u,s.__locale=c.locale,s.__i18nConfig=c,r=await F(r,l,async(p,f,m,w,h)=>{try{let b={};if(m)try{let d=[()=>JSON.parse(m),()=>{let x=`{"data":${m}}`,A=JSON.parse(x);return typeof A.data==="object"?A.data:{}},()=>E(m,s)];for(let x of d)try{if(b=x(),Object.keys(b).length>0)break}catch{}}catch(d){if(n.debug)console.error("Error parsing parameters for @translate directive:",d)}let y=O(f,u,c.fallbackToKey,b);return y?K(r,h,y,!1,p.length):w.trim()}catch(b){if(n.debug)console.error("Error processing @translate directive:",b);return a("Translate",`Error in @translate('${f}'): ${b instanceof Error?b.message:String(b)}`,t.EVALUATION_ERROR)}});let o=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]+\})\s*)?\)/g;if(n.debug){console.warn(`Processing translations in template. Sections: ${r.includes("<h2>Translation with Parameters</h2>")?"Parameters section found":"Parameters section missing"}`);let p=[...r.matchAll(o)];console.warn(`Found ${p.length} @translate matches`),p.forEach((f,m)=>console.warn(`Match ${m}: ${f[0]}, Key: ${f[1]}, Params: ${f[2]||"none"}`))}return r=await F(r,/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)/g,async(p,f,m,w)=>{try{let h={};if(m)try{let b=[()=>JSON.parse(m),()=>{let y=`{"data":${m}}`,d=JSON.parse(y);return typeof d.data==="object"?d.data:{}},()=>E(m,s)];for(let y of b)try{if(h=y(),Object.keys(h).length>0)break}catch{}}catch(b){if(n.debug)console.error("Error parsing parameters for @translate directive:",b)}return K(r,w,O(f,u,c.fallbackToKey,h),!1,p.length)}catch(h){if(n.debug)console.error("Error processing @translate directive:",h);return a("Translate",`Error in @translate('${f}'): ${h instanceof Error?h.message:String(h)}`,t.EVALUATION_ERROR)}}),r}async function F(e,s,i){let n=[];return e.replace(s,(l,...c)=>{let u=i(l,...c).then((o)=>({match:l,replacement:o}));return n.push(u),l}),(await Promise.all(n)).reduce((l,{match:c,replacement:u})=>l.replace(c,()=>u),e)}function _(e,s){if(!e||q(e)!=="rtl")return!1;return!s||s.trim().toLowerCase()!=="rtl"}function V(e){if(!e)return!1;return e.trim().split(/\s+/)[0]?.toLowerCase()==="presentation"||e.trim().split(/\s+/)[0]?.toLowerCase()==="none"}function U(e,s){let i=new RegExp(`\\b${s}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i").exec(e);if(!i)return null;return i[2]??i[3]??i[4]??null}function ga(e,s,i,n){let r=e;r=r.replace(/@a11y\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,u,o)=>{let p={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[u]||"Make this element accessible";return`<!-- a11y-hint: ${o||p} -->`});let l=/@screenReader\(([^@]*)\)@endScreenReader/g;return r=r.replace(l,(c,u)=>`<span class="sr-only">${u.trim()}</span>`),r=r.replace(/@ariaDescribe\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(c,u,o)=>`<span id="${`desc-${u}`}" class="sr-only">${o}</span>`),r}function ye(){return typeof globalThis.document<"u"&&typeof globalThis.document.createElement==="function"}function xe(e){let s=new Map,i=e.replace(/<(\/?)([A-Z][\w:.-]*)(?=[\s/>])/g,(r,l,c)=>{let u=s.get(c);if(!u)u=`stx-a11y-component-${s.size}`,s.set(c,u);return`<${l}${u}`}),n=new Map([...s.entries()].map(([r,l])=>[l,r]));return{protectedSource:i,restore:(r)=>r.replace(/<(\/?)(stx-a11y-component-\d+)(?=[\s/>])/g,(l,c,u)=>{let o=n.get(u);return o?`<${c}${o}`:l})}}function we(e,s){let i=[],n=/<img\s+([^>]*)>/gi,r;r=n.exec(e);while(r!==null){let d=r[1];if(!/\balt\s*=/i.test(d))i.push({type:"missing-alt",element:r[0].substring(0,100),message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"});r=n.exec(e)}let l=/<button([^>]*)>\s*<\/button>/gi;r=l.exec(e);while(r!==null){let d=r[1];if(!/\baria-label\s*=/i.test(d)&&!/\btitle\s*=/i.test(d))i.push({type:"missing-accessible-name",element:r[0].substring(0,100),message:"Empty button missing accessible name",impact:"critical",help:"Add text content, aria-label, or title",helpUrl:"https://web.dev/learn/accessibility/aria-html/"});r=l.exec(e)}let c=/<a\s+([^>]*)>\s*<\/a>/gi;r=c.exec(e);while(r!==null){let d=r[1];if(!/\baria-label\s*=/i.test(d)&&!/\btitle\s*=/i.test(d))i.push({type:"link-missing-text",element:r[0].substring(0,100),message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"});r=c.exec(e)}let u=/<(input|select|textarea)\s+([^>]*)>/gi;r=u.exec(e);while(r!==null){let d=r[2];if(/\btype\s*=\s*["']hidden["']/i.test(d)){r=u.exec(e);continue}let x=/\baria-label\s*=/i.test(d)||/\baria-labelledby\s*=/i.test(d),A=d.match(/\bid\s*=\s*["']([^"']+)["']/i);if(!x){let B=A&&new RegExp(`<label[^>]*\\bfor\\s*=\\s*["']${A[1]}["']`,"i").test(e),M=r.index,N=e.substring(0,M),Se=e.substring(M),H=(N.match(/<label\b/gi)||[]).length,z=(N.match(/<\/label>/gi)||[]).length,W=H>z;if(!B&&!W)i.push({type:"input-missing-label",element:r[0].substring(0,100),message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})}r=u.exec(e)}let o=/<h([1-6])[^>]*>/gi,g=[];r=o.exec(e);while(r!==null)g.push(Number.parseInt(r[1],10)),r=o.exec(e);let p=0;for(let d of g){if(p>0&&d>p+1)i.push({type:"heading-skip",element:`<h${d}>`,message:`Heading level skipped from h${p} to h${d}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});p=d}if(/<html\b/i.test(e)&&!/<html[^>]*\slang\s*=/i.test(e))i.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});let f=e.match(/<html\b([^>]*)>/i);if(f&&_(U(f[1],"lang"),U(f[1],"dir")))i.push({type:"missing-dir",element:f[0].substring(0,100),message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});let m=/<table([^>]*)>([\s\S]*?)<\/table>/gi;r=m.exec(e);while(r!==null){let d=r[2];if(!V(U(r[1],"role"))&&!/<th\b/i.test(d))i.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});r=m.exec(e)}let w=/<(video|audio)[^>]*\sautoplay\s[^>]*>/gi;r=w.exec(e);while(r!==null){if(!/\bmuted\b/i.test(r[0]))i.push({type:"autoplay-audio",element:`<${r[1]}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"});r=w.exec(e)}let h=/\btabindex\s*=\s*["']([1-9]\d*)["']/gi;r=h.exec(e);while(r!==null)i.push({type:"positive-tabindex",element:`tabindex="${r[1]}"`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"}),r=h.exec(e);let b=/<iframe\s+([^>]*)>/gi;r=b.exec(e);while(r!==null){let d=r[1];if(!/\btitle\s*=/i.test(d)&&!/\baria-label\s*=/i.test(d))i.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"});r=b.exec(e)}let y=/<([a-z]+)\s+([^>]*role\s*=\s*["']button["'][^>]*)>/gi;r=y.exec(e);while(r!==null){let d=r[1].toLowerCase(),x=r[2];if(d!=="button"&&!/\btabindex\s*=/i.test(x))i.push({type:"button-not-focusable",element:r[0].substring(0,100),message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"});r=y.exec(e)}return i}async function Ae(e,s){let{protectedSource:i}=xe(e);if(!ye())return we(i,s);let n=[];try{let r=globalThis.document.createElement("div");r.innerHTML=i,r.querySelectorAll("img").forEach((o)=>{if(!o.hasAttribute("alt"))n.push({type:"missing-alt",element:`<${o.outerHTML}>`,message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"})}),r.querySelectorAll('button, a, [role="button"]').forEach((o)=>{if(!(o.hasAttribute("aria-label")||o.hasAttribute("aria-labelledby")||o.textContent&&o.textContent.trim().length>0))n.push({type:"missing-accessible-name",element:`<${o.outerHTML}>`,message:"Interactive element missing accessible name",impact:"critical",help:"Add text content, aria-label, or aria-labelledby",helpUrl:"https://web.dev/learn/accessibility/aria-html/"})}),r.querySelectorAll("input, select, textarea").forEach((o)=>{let g=o.getAttribute("id"),p=g&&r.querySelector(`label[for="${g}"]`),f=o.hasAttribute("aria-label")||o.hasAttribute("aria-labelledby"),m=o.closest("label")!==null;if(!p&&!f&&!m)n.push({type:"input-missing-label",element:`<${o.outerHTML}>`,message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})});let l=Array.from(r.querySelectorAll("h1, h2, h3, h4, h5, h6")),c=0;for(let o of l){let g=Number.parseInt(o.tagName.charAt(1));if(c>0&&g>c+1)n.push({type:"heading-skip",element:`<${o.outerHTML}>`,message:`Heading level skipped from h${c} to h${g}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});c=g}let u=r.querySelector("html");if(i.includes("<html")&&u&&!u.hasAttribute("lang"))n.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});if(u&&_(u.getAttribute("lang"),u.getAttribute("dir")))n.push({type:"missing-dir",element:"<html>",message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});if(r.querySelectorAll("a").forEach((o)=>{let g=o.textContent&&o.textContent.trim().length>0,p=o.hasAttribute("aria-label")||o.hasAttribute("aria-labelledby"),f=o.hasAttribute("title"),m=o.querySelector("img[alt]");if(!g&&!p&&!f&&!m)n.push({type:"link-missing-text",element:`<${o.outerHTML}>`,message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"})}),i.includes("<nav")||i.includes("<header")){if(!r.querySelector('a[href="#main"], a[href="#content"], .skip-link, [class*="skip"]')&&r.querySelectorAll("a").length>5)n.push({type:"missing-skip-link",element:"<nav>",message:"Consider adding a skip navigation link",impact:"minor",help:"Add a skip link to allow keyboard users to bypass navigation",helpUrl:"https://web.dev/learn/accessibility/focus/#skip-links"})}if(r.querySelectorAll("table").forEach((o)=>{if(V(o.getAttribute("role")))return;let g=o.querySelector("caption");if(!o.querySelector("th"))n.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});if(!g&&!o.hasAttribute("aria-label")&&!o.hasAttribute("aria-labelledby"))n.push({type:"table-missing-caption",element:"<table>",message:"Table missing caption or accessible name",impact:"minor",help:"Add a caption element or aria-label to describe the table",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"})}),r.querySelectorAll('[style*="color"]').forEach((o)=>{let g=o.getAttribute("style")||"";if(g.includes("color:")&&!g.includes("background"))n.push({type:"potential-contrast-issue",element:`<${o.tagName.toLowerCase()}>`,message:"Element has inline color style - verify contrast ratio",impact:"minor",help:"Ensure text has sufficient contrast ratio (4.5:1 for normal text)",helpUrl:"https://web.dev/learn/accessibility/color-contrast/"})}),r.querySelectorAll("video[autoplay], audio[autoplay]").forEach((o)=>{if(!o.hasAttribute("muted"))n.push({type:"autoplay-audio",element:`<${o.tagName.toLowerCase()}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"})}),r.querySelectorAll("[tabindex]").forEach((o)=>{if(Number.parseInt(o.getAttribute("tabindex")||"0")>0)n.push({type:"positive-tabindex",element:`<${o.tagName.toLowerCase()}>`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"})}),r.querySelectorAll('[role="button"]').forEach((o)=>{if(!o.hasAttribute("tabindex"))n.push({type:"button-not-focusable",element:`<${o.outerHTML}>`,message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"})}),i.includes("<body")&&!r.querySelector('main, [role="main"]'))n.push({type:"missing-main-landmark",element:"<body>",message:"Document missing main landmark region",impact:"moderate",help:"Add a main element to identify the primary content",helpUrl:"https://web.dev/learn/accessibility/structure/#landmarks"});r.querySelectorAll("iframe").forEach((o)=>{if(!o.hasAttribute("title")&&!o.hasAttribute("aria-label"))n.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"})})}catch(r){console.error(`Error checking accessibility in ${s}:`,r)}return n}async function ma(e,s={}){let i={},{recursive:n=!0,ignorePaths:r=[]}=s,l=Array.isArray(e)?e:[e],c=await fo(l,{recursive:n,ignorePaths:r}),u=[];for(let o of c)try{let g=await Bun.file(o).text();if(o.endsWith("good-a11y.stx"))continue;let p=await Ae(g,o);if(u.push(o),p.length>0)i[o]=p}catch(g){console.error(`Error scanning ${o}:`,g)}return{results:i,scannedFiles:u}}var ha={name:"a11y",handler:(e,s,i,n)=>{if(!s.length)return e;let r=s[0].replace(/['"]/g,""),l=s.length>1?s[1].replace(/['"]/g,""):"",u={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[r]||"Make this element accessible";return`<!-- a11y-hint: ${l||u} -->${e}`},hasEndTag:!1},ya={name:"screenReader",handler:(e)=>`<span class="sr-only">${e}</span>`,hasEndTag:!0};
4
4
  export{fa,ga,ma,ha,ya};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{k}from"./chunk-kwek8xdt.js";import{s}from"./chunk-mjm3tyfj.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let n=u[t[0]];console.log(`
2
+ import{k}from"./chunk-t0zh1dn9.js";import{s}from"./chunk-jg5zt20a.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let n=u[t[0]];console.log(`
3
3
  ${e.bold}${t[0]}${e.reset} - ${n.description}`),console.log(` Usage: ${e.cyan}${n.usage}${e.reset}
4
4
  `)}else{console.log(`
5
5
  ${e.bold}Available Commands:${e.reset}
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{x}from"./chunk-pxdww4rb.js";import{T,vn}from"./chunk-ce6zddpf.js";import{S,G}from"./chunk-kwek8xdt.js";import{o}from"./chunk-9gfffs28.js";import{Ce,Xt,Jt,Yt}from"./chunk-x68etmdg.js";import{ht}from"./chunk-sjcqxfq1.js";import{pt,In,Wt,se}from"./chunk-npa7gze7.js";import{C,yr}from"./chunk-fbtv2k1p.js";import p from"path";var a=new Map;function A(c,n){for(let s of c.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(s[1])n.add(s[1]);for(let s of c.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let i of(s[1]??"").split(",")){let l=((i.includes(":")?i.split(":").pop():i)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(l))n.add(l)}for(let s of c.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let i of(s[1]??"").split(",")){let r=i.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(r))n.add(r)}}async function Bd(c){let n;if(c)n=p.resolve(c);else{let t=await o();n=p.resolve(t.root||process.cwd(),t.storesDir||"stores")}let s=`${n}\x00${Jt()}`,i=new Bun.Glob("*.ts"),r=[];try{for await(let t of i.scan({cwd:n,absolute:!0})){let e=p.basename(t,".ts");if(["index","types"].includes(e))continue;if(t.includes(".d.ts"))continue;r.push(t)}}catch{return se(a,s,"",""),null}let l=()=>[...new Set([...r,...r.flatMap((t)=>Ce(t))])],f=pt(l()),d=Wt(a,s,f);if(d!==void 0)return d||null;if(r.length===0)return se(a,s,f,""),null;let u=[];for(let t of r){let e=await Bun.file(t).text();u.push({file:t,hasUseStore:/useStore\s*\(/.test(e)})}u.sort((t,e)=>{if(t.hasUseStore===e.hasUseStore)return 0;return t.hasUseStore?1:-1});let y=u.map((t)=>t.file),m=[],g=new Set,v=G({loader:"ts",target:"browser",define:S()});for(let t of y)try{let e=await Bun.file(t).text(),_=p.basename(t,".ts");if(A(e,g),Xt(e))e=await Yt(e,t,{projectRoot:process.cwd(),externalizeUserModules:C()});e=ht(e),e=T(e),e=vn(e),e=e.replace(/^export\s+(default\s+)?/gm,""),e=v.transformSync(e),m.push(`// Store: ${_}
2
+ import{x}from"./chunk-pxdww4rb.js";import{T,vn}from"./chunk-ce6zddpf.js";import{S,G}from"./chunk-t0zh1dn9.js";import{o}from"./chunk-hmyb701s.js";import{Ce,Xt,Jt,Yt}from"./chunk-1fd7x7b8.js";import{ht}from"./chunk-9tdnfztv.js";import{pt,In,Wt,se}from"./chunk-npa7gze7.js";import{C,yr}from"./chunk-fbtv2k1p.js";import p from"path";var a=new Map;function A(c,n){for(let s of c.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(s[1])n.add(s[1]);for(let s of c.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let i of(s[1]??"").split(",")){let l=((i.includes(":")?i.split(":").pop():i)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(l))n.add(l)}for(let s of c.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let i of(s[1]??"").split(",")){let r=i.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(r))n.add(r)}}async function Bd(c){let n;if(c)n=p.resolve(c);else{let t=await o();n=p.resolve(t.root||process.cwd(),t.storesDir||"stores")}let s=`${n}\x00${Jt()}`,i=new Bun.Glob("*.ts"),r=[];try{for await(let t of i.scan({cwd:n,absolute:!0})){let e=p.basename(t,".ts");if(["index","types"].includes(e))continue;if(t.includes(".d.ts"))continue;r.push(t)}}catch{return se(a,s,"",""),null}let l=()=>[...new Set([...r,...r.flatMap((t)=>Ce(t))])],f=pt(l()),d=Wt(a,s,f);if(d!==void 0)return d||null;if(r.length===0)return se(a,s,f,""),null;let u=[];for(let t of r){let e=await Bun.file(t).text();u.push({file:t,hasUseStore:/useStore\s*\(/.test(e)})}u.sort((t,e)=>{if(t.hasUseStore===e.hasUseStore)return 0;return t.hasUseStore?1:-1});let y=u.map((t)=>t.file),m=[],g=new Set,v=G({loader:"ts",target:"browser",define:S()});for(let t of y)try{let e=await Bun.file(t).text(),_=p.basename(t,".ts");if(A(e,g),Xt(e))e=await Yt(e,t,{projectRoot:process.cwd(),externalizeUserModules:C()});e=ht(e),e=T(e),e=vn(e),e=e.replace(/^export\s+(default\s+)?/gm,""),e=v.transformSync(e),m.push(`// Store: ${_}
3
3
  ${e.trim()}`)}catch(e){console.warn(`[stx] Failed to load store ${t}:`,e)}if(m.length===0)return se(a,s,f,""),null;let h=m.join(`
4
4
 
5
5
  `),w=`;(function(){