@stacksjs/stx 0.2.232 → 0.2.233

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 (51) hide show
  1. package/dist/{chunk-87rj95tw.js → chunk-09rpa9sg.js} +1 -1
  2. package/dist/{chunk-1h0twjzw.js → chunk-0xpq63re.js} +1 -1
  3. package/dist/{chunk-qq5xar6q.js → chunk-1mnhkme7.js} +1 -1
  4. package/dist/{chunk-gzf1dg38.js → chunk-2j1frpgy.js} +1 -1
  5. package/dist/{chunk-9agksxkk.js → chunk-2m730367.js} +1 -1
  6. package/dist/{chunk-6ea3th9j.js → chunk-5dc1twg4.js} +16 -16
  7. package/dist/{chunk-anc397f7.js → chunk-5wwjte8y.js} +1 -1
  8. package/dist/{chunk-yqtc8ax6.js → chunk-633f58jf.js} +1 -1
  9. package/dist/{chunk-b34x0v3f.js → chunk-6k6batqy.js} +1 -1
  10. package/dist/{chunk-27m136s4.js → chunk-70rk9she.js} +1 -1
  11. package/dist/{chunk-pe06ke3f.js → chunk-7es64y8d.js} +1 -1
  12. package/dist/{chunk-qj0jaw5s.js → chunk-9qj7yjse.js} +1 -1
  13. package/dist/{chunk-v2qx1jrb.js → chunk-9se575h1.js} +1 -1
  14. package/dist/{chunk-5v3dv3xv.js → chunk-9sv8944b.js} +1 -1
  15. package/dist/{chunk-ww9sz124.js → chunk-9za99vpf.js} +1 -1
  16. package/dist/{chunk-ege2zbez.js → chunk-a9cje0vm.js} +1 -1
  17. package/dist/{chunk-b1rj6fk4.js → chunk-a9s60kwx.js} +1 -1
  18. package/dist/{chunk-2v320r60.js → chunk-ajt3k1hf.js} +1 -1
  19. package/dist/{chunk-dvb8vgfe.js → chunk-b9ehjbbx.js} +1 -1
  20. package/dist/{chunk-tdj3gqaa.js → chunk-bbymgcwp.js} +1 -1
  21. package/dist/{chunk-ymnt0ze7.js → chunk-ct19gbs6.js} +1 -1
  22. package/dist/{chunk-eqbr4jnw.js → chunk-ct8xjs8k.js} +2 -2
  23. package/dist/{chunk-rmrxs0qz.js → chunk-dnspts0e.js} +1 -1
  24. package/dist/{chunk-bnwpg6fg.js → chunk-esasjpwa.js} +1 -1
  25. package/dist/{chunk-dtfgxjy9.js → chunk-f74xtehm.js} +2 -2
  26. package/dist/{chunk-aeyrfcn5.js → chunk-fphzcf76.js} +1 -1
  27. package/dist/{chunk-d2x4ma3m.js → chunk-g26seq16.js} +1 -1
  28. package/dist/{chunk-dxepdtt2.js → chunk-jpjqp4r8.js} +1 -1
  29. package/dist/{chunk-vw7h103c.js → chunk-kkk5ey50.js} +1 -1
  30. package/dist/{chunk-5cjnfn8d.js → chunk-ksrrk187.js} +1 -1
  31. package/dist/{chunk-q9p451rb.js → chunk-nepsmxy4.js} +1 -1
  32. package/dist/{chunk-7dznwvcy.js → chunk-pn2rzzcj.js} +1 -1
  33. package/dist/{chunk-264rn67f.js → chunk-q52bc070.js} +1 -1
  34. package/dist/{chunk-t68jcajf.js → chunk-qv9azqvb.js} +1 -1
  35. package/dist/{chunk-xvmvbkwy.js → chunk-qymakqm4.js} +8 -8
  36. package/dist/{chunk-33zg81y6.js → chunk-rrwx8e79.js} +1 -1
  37. package/dist/{chunk-0h46e2ng.js → chunk-td24v6qk.js} +1 -1
  38. package/dist/{chunk-y7z44vr9.js → chunk-tdjdf9v9.js} +1 -1
  39. package/dist/{chunk-tbr46jye.js → chunk-vbrbg7s2.js} +13 -2
  40. package/dist/{chunk-q253eftn.js → chunk-vfnv1r93.js} +1 -1
  41. package/dist/{chunk-5k5qczgz.js → chunk-wm6n9mkk.js} +1 -1
  42. package/dist/{chunk-dkt2rq3s.js → chunk-wwkzy8tz.js} +1 -1
  43. package/dist/{chunk-cv0z0qpy.js → chunk-wz81m0kv.js} +1 -1
  44. package/dist/{chunk-exaa3t0c.js → chunk-xhkyf0s6.js} +1 -1
  45. package/dist/cli.js +8 -8
  46. package/dist/craft-entry.js +1 -1
  47. package/dist/craft.js +1 -1
  48. package/dist/pwa.js +1 -1
  49. package/dist/signals.js +13 -2
  50. package/dist/ssg.js +2 -2
  51. package/package.json +5 -5
@@ -1,6 +1,6 @@
1
1
  // @bun
2
2
  import{it as Jq}from"./chunk-xgtcq9bj.js";import{Gu as Gq}from"./chunk-yx8vftp0.js";import $ from"path";import{hasLocalConfig as Uq}from"bunfig";var a={fg:{light:"gray-900",dark:"gray-100",description:"Primary text"},"fg-strong":{light:"gray-700",dark:"gray-300",description:"Labels, secondary headings"},"fg-muted":{light:"gray-600",dark:"gray-400",description:"Supporting text"},"fg-soft":{light:"gray-500",dark:"gray-400",description:"De-emphasised text"},"fg-subtle":{light:"gray-400",dark:"gray-500",description:"Placeholders, disabled text"},surface:{light:"gray-50",dark:"gray-800",description:"Page and panel background"},"surface-raised":{light:"gray-100",dark:"gray-700",description:"Cards, popovers"},"surface-sunken":{light:"gray-200",dark:"gray-700",description:"Wells, track backgrounds"},line:{light:"gray-200",dark:"gray-700",description:"Default border, divider"},"line-strong":{light:"gray-300",dark:"gray-600",description:"Input border, focus ring track"},accent:{light:"indigo-600",dark:"indigo-400",description:"Primary action, selected state"},info:{light:"blue-600",dark:"blue-400",description:"Informational emphasis, links"},danger:{light:"red-600",dark:"red-400",description:"Errors, destructive actions"},success:{light:"green-600",dark:"green-400",description:"Confirmation"},warning:{light:"yellow-500",dark:"yellow-400",description:"Caution"},"accent-solid":{light:"indigo-600",dark:"indigo-500",description:"Primary button fill"},"info-solid":{light:"blue-600",dark:"blue-500",description:"Informational fill"},"danger-solid":{light:"red-600",dark:"red-500",description:"Destructive button fill"},"success-solid":{light:"green-600",dark:"green-500",description:"Confirmation fill"}};function m(G){return`--stx-${G}`}function p(G,q){let Q=q.lastIndexOf("-");if(Q===-1)return typeof G[q]==="string"?G[q]:void 0;let J=G[q.slice(0,Q)];if(!J||typeof J!=="object")return;let Y=J[q.slice(Q+1)];return typeof Y==="string"?Y:void 0}function o(G){let q={};for(let[Q,J]of Object.entries(a)){let Y=p(G,J.light);if(Y===void 0)continue;q[Q]=`var(${m(Q)}, ${Y})`}return q}function t(G){let q=[],Q=[];for(let[J,Y]of Object.entries(a)){let Z=p(G,Y.light),U=p(G,Y.dark);if(Z===void 0)continue;if(q.push(` ${m(J)}: ${Z};`),U!==void 0)Q.push(` ${m(J)}: ${U};`)}if(q.length===0)return"";return["/* stx role tokens \u2014 override any of these to re-theme by meaning. */",":root {",...q,"}",".dark {",...Q,"}",""].join(`
3
- `)}function s(G){return typeof G==="object"&&G!==null&&!Array.isArray(G)}function g(G,q){let Q={...G};for(let[J,Y]of Object.entries(q))Q[J]=s(Y)&&s(Q[J])?g(Q[J],Y):Y;return Q}function e(G={},q={}){let Q=G.theme||{},J=q.theme||{},{extend:Y,...Z}=J,{extend:U,...z}=Q,X=z.colors||{};z.colors={...X,...o(X)};let A=g(z,Z),L=g(U||{},Y||{});if(Object.keys(L).length>0)A.extend=L;let H=[...G.safelist||[],...q.safelist||[]],E={...G.shortcuts||{},...q.shortcuts||{}},P=[...G.preflights||[],...q.preflights||[]];return{config:{...G,...q,theme:A,safelist:H,shortcuts:E,...P.length>0?{preflights:P}:{},content:[],output:""},safelist:H,shortcuts:E,includePreflight:q.preflight!==!1,minify:q.minify===!0,tokenCSS:t(X)}}var W={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",bgBlack:"\x1B[40m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m",bgWhite:"\x1B[47m",bgGray:"\x1B[100m"};var F=null,C=!1,_=null,b="",K=!1,Qq=256,V=new Map,O=new Map,j=null,d=null;function S(G){return Bun.hash(G).toString(16).padStart(16,"0").slice(0,16)}function u(G,q){if(V.has(G))V.delete(G);else if(V.size>=Qq)V.delete(V.keys().next().value);V.set(G,q)}function Wq(G){let q=S(G);if(O.has(q))O.delete(q);else if(O.size>=Qq)O.delete(O.keys().next().value);return O.set(q,G),q}function Dq(G){let q=O.get(G);if(q===void 0)return;return O.delete(G),O.set(G,q),q}async function Xq(G){if(!j)return null;try{let q=Bun.file($.join(j,`cw-${S(G)}.css`));if(!await q.exists())return null;return await q.text()}catch{return null}}async function zq(G,q){if(!j)return;try{if(!fs.existsSync(j))fs.mkdirSync(j,{recursive:!0});await Bun.write($.join(j,`cw-${S(G)}.css`),q)}catch{}}async function qq(G){try{let q=await import(G);if(q&&q.CSSGenerator)return{CSSGenerator:q.CSSGenerator,config:q.config,build:q.build,defaultConfig:q.defaultConfig,extractClasses:q.extractClasses}}catch{}return null}function Iq(){let G=[],q=process.cwd();while(q!==$.dirname(q))G.push($.join(q,"node_modules","@cwcss","crosswind","dist","index.js")),G.push($.join(q,"node_modules","@cwcss","crosswind","src","index.ts")),G.push($.join(q,"pantry","@cwcss","crosswind","dist","index.js")),G.push($.join(q,"pantry","@cwcss","crosswind","src","index.ts")),G.push($.join(q,"node_modules","@stacksjs","crosswind","dist","index.js")),G.push($.join(q,"pantry","@stacksjs","crosswind","dist","index.js")),q=$.dirname(q);return G}function Oq(){let G=[],q=process.env.HOME||process.env.USERPROFILE||"";if(q){let Q=[$.join(q,"Code","Tools","crosswind","packages","crosswind","dist","index.js"),$.join(q,"Code","Tools","crosswind","packages","crosswind","src","index.ts"),$.join(q,"repos","stacks-org","crosswind","packages","crosswind","dist","index.js"),$.join(q,"repos","stacks-org","crosswind","packages","crosswind","src","index.ts"),$.join(q,"Code","Tools","stx","packages","stx","node_modules","@cwcss","crosswind","dist","index.js"),$.join(q,"Code","Tools","stx","packages","stx","node_modules","@stacksjs","crosswind","dist","index.js")];G.push(...Q)}return G.push($.join(process.cwd(),"..","crosswind","packages","crosswind","dist","index.js")),G.push($.join(process.cwd(),"..","crosswind","packages","crosswind","src","index.ts")),G}async function Yq(){if(C)return F;C=!0;try{let G=async(Y)=>{for(let Z of Y){if(!await Bun.file(Z).exists())continue;let U=await qq(Z);if(U){if(!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[Crosswind]${W.reset} CSS engine loaded from ${$.dirname($.dirname(Z))}`);return U}}return null};if(process.env.CROSSWIND_SRC){let Y=$.resolve(process.env.CROSSWIND_SRC),Z=await G([Y]);if(!Z)throw Error(`CROSSWIND_SRC did not resolve to a Crosswind module: ${Y}`);return F=Z,F}let q=await G(Iq());if(q)return F=q,F;let Q=["@cwcss/crosswind","@cwcss/crosswind/dist/index.js","@stacksjs/crosswind","@stacksjs/crosswind/dist/index.js"];for(let Y of Q){let Z=await qq(Y);if(Z){if(F=Z,!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[Crosswind]${W.reset} CSS engine loaded`);return F}}let J=await G(Oq());if(J)return F=J,F;throw Error("Crosswind CSSGenerator not found in any location")}catch{return console.warn(`${W.yellow}[Crosswind] CSS engine not available, Tailwind styles will not be generated${W.reset}`),console.warn(`${W.yellow}Run 'bun add @stacksjs/crosswind' to enable CSS generation${W.reset}`),null}}function Sq(){V.clear(),O.clear()}function xq(){F=null,C=!1,_=null,b="",V.clear(),O.clear(),d=null}async function Zq(G){try{if(!Uq({name:"crosswind",cwd:G}))return null;let{loadConfigWithResult:q}=await import("bunfig"),Q=await q({name:"crosswind",cwd:G,defaultConfig:{},checkEnv:!1,verbose:!1});if(!Q?.path||!Q.config||Object.keys(Q.config).length===0)return null;let J=$.relative(G,Q.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[Crosswind]${W.reset} Loaded config from ${J||Q.path}`);return Q.config}catch(q){if(q instanceof Error&&q.name==="ConfigNotFoundError")return null;return console.warn(`${W.yellow}[Crosswind]${W.reset} Failed to load crosswind config:`,q instanceof Error?q.message:q),null}}async function _q(G){let q=null;try{let{loadStxConfig:Q}=await import("./chunk-anc397f7.js"),J=await Q(G);if(J.css)if(typeof J.css==="string"){let Y=$.isAbsolute(J.css)?J.css:$.resolve(G,J.css);if(await Bun.file(Y).exists()){let Z=await import(Y);q=Z.default||Z,console.log(`${W.green}[Crosswind]${W.reset} Loaded config from stx.config.ts \u2192 ${J.css}`)}}else{if(q={...J.css,content:J.css.content||[],preflight:J.css.preflight??!0,minify:J.css.minify??!1},J.css.config){let Y=$.isAbsolute(J.css.config)?J.css.config:$.resolve(G,J.css.config);if(await Bun.file(Y).exists()){let Z=await import(Y);q={...Z.default||Z,...q}}}console.log(`${W.green}[Crosswind]${W.reset} Using inline CSS config from stx.config.ts`)}}catch{}return q||await Zq(G)}function Fq(G){try{let q=new WeakSet;return S(JSON.stringify(G??{},(Q,J)=>{if(typeof J==="function")return`[fn]${String(J)}`;if(typeof J==="object"&&J!==null){if(q.has(J))return"[circular]";q.add(J)}return J})??"")}catch{return"unhashable"}}async function Nq(G){if(K)return b;K=!0;try{let q=await Yq();if(!q||!q.build)return K=!1,"";if(!_)_=await Zq(G);if(!_)return K=!1,"";let Q=q.defaultConfig?.theme||{},J=_.theme||{},Y={...q.defaultConfig,..._,theme:{...Q,...J,extend:{...Q.extend||{},...J.extend||{}}}},Z=performance.now(),U=await q.build(Y),z=performance.now()-Z;if(b=U.css,console.log(`${W.cyan}[Crosswind]${W.reset} Built ${U.classes.size} classes in ${z.toFixed(1)}ms`),Y.output){let X=$.isAbsolute(Y.output)?Y.output:$.join(G,Y.output),A=$.dirname(X);if(!fs.existsSync(A))fs.mkdirSync(A,{recursive:!0});await Bun.write(X,U.css)}return K=!1,U.css}catch(q){return console.error(`${W.red}[Crosswind]${W.reset} Build error:`,q),K=!1,b}}async function kq(G){_=null,await Nq(G)}function wq(){return b}function Vq(G){let q=new Set,Q=/class\s*=\s*["']([^"']+)["']/gi,J=Q.exec(G);while(J!==null){for(let U of J[1].split(/\s+/))if(U.trim())q.add(U.trim());J=Q.exec(G)}let Y=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,Z=Y.exec(G);while(Z!==null){let U=Z[1].match(/'([^']+)'/g);if(U){for(let z of U)for(let X of z.slice(1,-1).split(/\s+/))if(X.trim())q.add(X.trim())}Z=Y.exec(G)}return q}async function jq(G,q){try{let Q=await Yq();if(!Q)return"";let J=typeof Q.extractClasses==="function"?Q.extractClasses(G):Vq(G);if(J.size===0)return"";let Y=q?$.resolve(q):process.cwd();if(!j)j=Jq(Y,"cache");let Z=[...J].sort().join(" "),U=`${d||"default"}::${Z}`,z=V.get(U);if(z!==void 0)return u(U,z),z;let X=await Xq(U);if(X!==null)return u(U,X),X;if(!_)_=await _q(Y),d=Fq(_);let A=Q.defaultConfig||Q.config,L=_||{},H=e(A,L),{safelist:E,includePreflight:P,minify:x,tokenCSS:$q}=H,h=H.config,R=new Q.CSSGenerator(h);for(let I of E)R.generate(I);for(let I of J)R.generate(I);let N=R.toCSS(P,x),i=h.shortcuts||L.shortcuts||{};for(let[I,k]of Object.entries(i)){if(!J.has(I)&&!E.includes(I))continue;let w=k.split(/\s+/).filter(Boolean);for(let T of w)R.generate(T)}N=R.toCSS(P,x);let B=N.split(`
3
+ `)}function s(G){return typeof G==="object"&&G!==null&&!Array.isArray(G)}function g(G,q){let Q={...G};for(let[J,Y]of Object.entries(q))Q[J]=s(Y)&&s(Q[J])?g(Q[J],Y):Y;return Q}function e(G={},q={}){let Q=G.theme||{},J=q.theme||{},{extend:Y,...Z}=J,{extend:U,...z}=Q,X=z.colors||{};z.colors={...X,...o(X)};let A=g(z,Z),L=g(U||{},Y||{});if(Object.keys(L).length>0)A.extend=L;let H=[...G.safelist||[],...q.safelist||[]],E={...G.shortcuts||{},...q.shortcuts||{}},P=[...G.preflights||[],...q.preflights||[]];return{config:{...G,...q,theme:A,safelist:H,shortcuts:E,...P.length>0?{preflights:P}:{},content:[],output:""},safelist:H,shortcuts:E,includePreflight:q.preflight!==!1,minify:q.minify===!0,tokenCSS:t(X)}}var W={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",bgBlack:"\x1B[40m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m",bgWhite:"\x1B[47m",bgGray:"\x1B[100m"};var F=null,C=!1,_=null,b="",K=!1,Qq=256,V=new Map,O=new Map,j=null,d=null;function S(G){return Bun.hash(G).toString(16).padStart(16,"0").slice(0,16)}function u(G,q){if(V.has(G))V.delete(G);else if(V.size>=Qq)V.delete(V.keys().next().value);V.set(G,q)}function Wq(G){let q=S(G);if(O.has(q))O.delete(q);else if(O.size>=Qq)O.delete(O.keys().next().value);return O.set(q,G),q}function Dq(G){let q=O.get(G);if(q===void 0)return;return O.delete(G),O.set(G,q),q}async function Xq(G){if(!j)return null;try{let q=Bun.file($.join(j,`cw-${S(G)}.css`));if(!await q.exists())return null;return await q.text()}catch{return null}}async function zq(G,q){if(!j)return;try{if(!fs.existsSync(j))fs.mkdirSync(j,{recursive:!0});await Bun.write($.join(j,`cw-${S(G)}.css`),q)}catch{}}async function qq(G){try{let q=await import(G);if(q&&q.CSSGenerator)return{CSSGenerator:q.CSSGenerator,config:q.config,build:q.build,defaultConfig:q.defaultConfig,extractClasses:q.extractClasses}}catch{}return null}function Iq(){let G=[],q=process.cwd();while(q!==$.dirname(q))G.push($.join(q,"node_modules","@cwcss","crosswind","dist","index.js")),G.push($.join(q,"node_modules","@cwcss","crosswind","src","index.ts")),G.push($.join(q,"pantry","@cwcss","crosswind","dist","index.js")),G.push($.join(q,"pantry","@cwcss","crosswind","src","index.ts")),G.push($.join(q,"node_modules","@stacksjs","crosswind","dist","index.js")),G.push($.join(q,"pantry","@stacksjs","crosswind","dist","index.js")),q=$.dirname(q);return G}function Oq(){let G=[],q=process.env.HOME||process.env.USERPROFILE||"";if(q){let Q=[$.join(q,"Code","Tools","crosswind","packages","crosswind","dist","index.js"),$.join(q,"Code","Tools","crosswind","packages","crosswind","src","index.ts"),$.join(q,"repos","stacks-org","crosswind","packages","crosswind","dist","index.js"),$.join(q,"repos","stacks-org","crosswind","packages","crosswind","src","index.ts"),$.join(q,"Code","Tools","stx","packages","stx","node_modules","@cwcss","crosswind","dist","index.js"),$.join(q,"Code","Tools","stx","packages","stx","node_modules","@stacksjs","crosswind","dist","index.js")];G.push(...Q)}return G.push($.join(process.cwd(),"..","crosswind","packages","crosswind","dist","index.js")),G.push($.join(process.cwd(),"..","crosswind","packages","crosswind","src","index.ts")),G}async function Yq(){if(C)return F;C=!0;try{let G=async(Y)=>{for(let Z of Y){if(!await Bun.file(Z).exists())continue;let U=await qq(Z);if(U){if(!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[Crosswind]${W.reset} CSS engine loaded from ${$.dirname($.dirname(Z))}`);return U}}return null};if(process.env.CROSSWIND_SRC){let Y=$.resolve(process.env.CROSSWIND_SRC),Z=await G([Y]);if(!Z)throw Error(`CROSSWIND_SRC did not resolve to a Crosswind module: ${Y}`);return F=Z,F}let q=await G(Iq());if(q)return F=q,F;let Q=["@cwcss/crosswind","@cwcss/crosswind/dist/index.js","@stacksjs/crosswind","@stacksjs/crosswind/dist/index.js"];for(let Y of Q){let Z=await qq(Y);if(Z){if(F=Z,!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[Crosswind]${W.reset} CSS engine loaded`);return F}}let J=await G(Oq());if(J)return F=J,F;throw Error("Crosswind CSSGenerator not found in any location")}catch{return console.warn(`${W.yellow}[Crosswind] CSS engine not available, Tailwind styles will not be generated${W.reset}`),console.warn(`${W.yellow}Run 'bun add @stacksjs/crosswind' to enable CSS generation${W.reset}`),null}}function Sq(){V.clear(),O.clear()}function xq(){F=null,C=!1,_=null,b="",V.clear(),O.clear(),d=null}async function Zq(G){try{if(!Uq({name:"crosswind",cwd:G}))return null;let{loadConfigWithResult:q}=await import("bunfig"),Q=await q({name:"crosswind",cwd:G,defaultConfig:{},checkEnv:!1,verbose:!1});if(!Q?.path||!Q.config||Object.keys(Q.config).length===0)return null;let J=$.relative(G,Q.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[Crosswind]${W.reset} Loaded config from ${J||Q.path}`);return Q.config}catch(q){if(q instanceof Error&&q.name==="ConfigNotFoundError")return null;return console.warn(`${W.yellow}[Crosswind]${W.reset} Failed to load crosswind config:`,q instanceof Error?q.message:q),null}}async function _q(G){let q=null;try{let{loadStxConfig:Q}=await import("./chunk-5wwjte8y.js"),J=await Q(G);if(J.css)if(typeof J.css==="string"){let Y=$.isAbsolute(J.css)?J.css:$.resolve(G,J.css);if(await Bun.file(Y).exists()){let Z=await import(Y);q=Z.default||Z,console.log(`${W.green}[Crosswind]${W.reset} Loaded config from stx.config.ts \u2192 ${J.css}`)}}else{if(q={...J.css,content:J.css.content||[],preflight:J.css.preflight??!0,minify:J.css.minify??!1},J.css.config){let Y=$.isAbsolute(J.css.config)?J.css.config:$.resolve(G,J.css.config);if(await Bun.file(Y).exists()){let Z=await import(Y);q={...Z.default||Z,...q}}}console.log(`${W.green}[Crosswind]${W.reset} Using inline CSS config from stx.config.ts`)}}catch{}return q||await Zq(G)}function Fq(G){try{let q=new WeakSet;return S(JSON.stringify(G??{},(Q,J)=>{if(typeof J==="function")return`[fn]${String(J)}`;if(typeof J==="object"&&J!==null){if(q.has(J))return"[circular]";q.add(J)}return J})??"")}catch{return"unhashable"}}async function Nq(G){if(K)return b;K=!0;try{let q=await Yq();if(!q||!q.build)return K=!1,"";if(!_)_=await Zq(G);if(!_)return K=!1,"";let Q=q.defaultConfig?.theme||{},J=_.theme||{},Y={...q.defaultConfig,..._,theme:{...Q,...J,extend:{...Q.extend||{},...J.extend||{}}}},Z=performance.now(),U=await q.build(Y),z=performance.now()-Z;if(b=U.css,console.log(`${W.cyan}[Crosswind]${W.reset} Built ${U.classes.size} classes in ${z.toFixed(1)}ms`),Y.output){let X=$.isAbsolute(Y.output)?Y.output:$.join(G,Y.output),A=$.dirname(X);if(!fs.existsSync(A))fs.mkdirSync(A,{recursive:!0});await Bun.write(X,U.css)}return K=!1,U.css}catch(q){return console.error(`${W.red}[Crosswind]${W.reset} Build error:`,q),K=!1,b}}async function kq(G){_=null,await Nq(G)}function wq(){return b}function Vq(G){let q=new Set,Q=/class\s*=\s*["']([^"']+)["']/gi,J=Q.exec(G);while(J!==null){for(let U of J[1].split(/\s+/))if(U.trim())q.add(U.trim());J=Q.exec(G)}let Y=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,Z=Y.exec(G);while(Z!==null){let U=Z[1].match(/'([^']+)'/g);if(U){for(let z of U)for(let X of z.slice(1,-1).split(/\s+/))if(X.trim())q.add(X.trim())}Z=Y.exec(G)}return q}async function jq(G,q){try{let Q=await Yq();if(!Q)return"";let J=typeof Q.extractClasses==="function"?Q.extractClasses(G):Vq(G);if(J.size===0)return"";let Y=q?$.resolve(q):process.cwd();if(!j)j=Jq(Y,"cache");let Z=[...J].sort().join(" "),U=`${d||"default"}::${Z}`,z=V.get(U);if(z!==void 0)return u(U,z),z;let X=await Xq(U);if(X!==null)return u(U,X),X;if(!_)_=await _q(Y),d=Fq(_);let A=Q.defaultConfig||Q.config,L=_||{},H=e(A,L),{safelist:E,includePreflight:P,minify:x,tokenCSS:$q}=H,h=H.config,R=new Q.CSSGenerator(h);for(let I of E)R.generate(I);for(let I of J)R.generate(I);let N=R.toCSS(P,x),i=h.shortcuts||L.shortcuts||{};for(let[I,k]of Object.entries(i)){if(!J.has(I)&&!E.includes(I))continue;let w=k.split(/\s+/).filter(Boolean);for(let T of w)R.generate(T)}N=R.toCSS(P,x);let B=N.split(`
4
4
  `);for(let[I,k]of Object.entries(i)){if(!J.has(I)&&!E.includes(I))continue;let w=k.split(/\s+/).filter(Boolean),T=[],y=[];for(let v of w){let c=v.startsWith("dark:"),n=`.${(c?v.slice(5):v).replace(/\//g,"\\/").replace(/:/g,"\\:").replace(/\./g,"\\.").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/%/g,"\\%")}`;for(let M=0;M<B.length;M++){let l=B[M].trim();if(l===`${n} {`||l.startsWith(`${n} {`)){let D=M,r="";while(D<B.length){if(r+=B[D],B[D].includes("}"))break;D++}let f=r.match(/\{([^}]+)\}/);if(f)if(c)y.push(f[1].trim());else T.push(f[1].trim());break}}}if(T.length)N+=`
5
5
  .${I} { ${T.join(" ")} }`;if(y.length)N+=`
6
6
  @media (prefers-color-scheme: dark) { .dark .${I} { ${y.join(" ")} } }`}return N=$q+N,u(U,N),zq(U,N),N}catch(Q){return console.warn("Failed to generate Crosswind CSS:",Q),""}}async function yq(G,q,Q=!1){let J=await jq(G,q);if(!J)return G;let Y=Q?`<link data-crosswind="generated" rel="stylesheet" href="/_stx/crosswind.${Wq(J)}.css">`:`<style data-crosswind="generated">
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{as as E}from"./chunk-6ea3th9j.js";import{Gu as D}from"./chunk-yx8vftp0.js";import I from"path";async function M(q={}){let G=performance.now(),J=q.root||process.cwd(),j=await E(),y=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${y.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let A,B;if(y==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");A=await z({pagesDir:I.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,...q.ssg})}else{let{buildForProduction:z}=await import("./chunk-q9p451rb.js");B=await z({outputDir:".output",debug:q.debug,...q.ssr})}let H=Math.round(performance.now()-G);return{mode:y,ssg:A,ssr:B,duration:H}}
2
+ import{as as E}from"./chunk-5dc1twg4.js";import{Gu as D}from"./chunk-yx8vftp0.js";import I from"path";async function M(q={}){let G=performance.now(),J=q.root||process.cwd(),j=await E(),y=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${y.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let A,B;if(y==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");A=await z({pagesDir:I.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,...q.ssg})}else{let{buildForProduction:z}=await import("./chunk-nepsmxy4.js");B=await z({outputDir:".output",debug:q.debug,...q.ssr})}let H=Math.round(performance.now()-G);return{mode:y,ssg:A,ssr:B,duration:H}}
3
3
  export{M as jg};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Xo as b,Yo as c,am as a}from"./chunk-6ea3th9j.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-87rj95tw.js";import"./chunk-74r77tz1.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-xaqjtned.js";import"./chunk-7kpfk426.js";import"./chunk-2tew0h6f.js";import"./chunk-yx8vftp0.js";export{b as processESImports,c as processComponents,a as freeIdentifiers};
2
+ import{Xo as b,Yo as c,am as a}from"./chunk-5dc1twg4.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-09rpa9sg.js";import"./chunk-74r77tz1.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-xaqjtned.js";import"./chunk-7kpfk426.js";import"./chunk-2tew0h6f.js";import"./chunk-yx8vftp0.js";export{b as processESImports,c as processComponents,a as freeIdentifiers};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{_l as F,bm as V,pm as I}from"./chunk-6ea3th9j.js";function R(j,W){let U=1,z=W,G="<template",X="</template";while(z<j.length&&U>0){let J=j.indexOf("<",z);if(J===-1)break;if(z=J,j.startsWith(G,z)&&(z+G.length>=j.length||/[\s>\/]/.test(j[z+G.length]))){U++,z+=G.length;continue}if(j.startsWith(X,z)){let Y=j.indexOf(">",z+X.length);if(Y!==-1){if(U--,U===0)return Y+1;z=Y+1;continue}}z++}return U===0?z:-1}var P=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function D(j,W){let U=null;for(let z=W;z<j.length;z++){let G=j[z];if(U){if(G==="\\"){z++;continue}if(G===U)U=null;continue}if(G==='"'||G==="'"){U=G;continue}if(G===">")return z+1}return-1}function b(j){let W=[],U=[],z=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,G=0;while(G<j.length){let X=j.indexOf("<",G);if(X===-1)break;if(j.startsWith("<!--",X)){let $=j.indexOf("-->",X+4);G=$===-1?j.length:$+3;continue}let J=D(j,X+1);if(J===-1)break;let Y=j.slice(X,J),Q=Y.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!Q){G=J;continue}let Z=Q[1]==="/",H=Q[2].toLowerCase();if(Z){let $=U.lastIndexOf(H);if($!==-1)U.splice($);G=J;continue}if(H==="template"&&U.length===0){let $=Y.match(z);if($){let K=R(j,J);if(K!==-1){let O=$[1]||$[2]||$[3];W.push({start:X,end:K,slotName:O,content:j.slice(J,K-11).trim(),propsBinding:$[4]||void 0}),G=K;continue}}}if(!/\/\s*>$/.test(Y)&&!P.has(H)){if(U.push(H),H==="script"||H==="style"){let $=j.toLowerCase().indexOf(`</${H}>`,J);if($!==-1){G=$;continue}}}G=J}return W}function w(j){let W={default:"",named:new Map},U=j,z=b(j);for(let Q of z)W.named.set(Q.slotName,{name:Q.slotName,content:Q.content,propsBinding:Q.propsBinding});z.sort((Q,Z)=>Z.start-Q.start);for(let Q of z)U=U.slice(0,Q.start)+U.slice(Q.end);let G=[],X=/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*?)\bslot="([^"]+)"([^>]*)>([\s\S]*?)<\/\1>/gi,J;while((J=X.exec(U))!==null){let[Q,Z,H,_,$,K]=J,O=H.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),B=$.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),L=(O+B).trim(),q=`<${Z}${L?" "+L:""}>${K}</${Z}>`;G.push({start:J.index,end:J.index+Q.length,slotName:_,element:q})}let Y=/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*?)\bslot="([^"]+)"([^>]*?)\/>/gi;while((J=Y.exec(U))!==null){let[Q,Z,H,_,$]=J,K=H.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),O=$.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),B=(K+O).trim(),L=`<${Z}${B?" "+B:""} />`;G.push({start:J.index,end:J.index+Q.length,slotName:_,element:L})}G.sort((Q,Z)=>Z.start-Q.start);for(let Q of G){let Z=W.named.get(Q.slotName);if(Z)Z.content+=Q.element;else W.named.set(Q.slotName,{name:Q.slotName,content:Q.element});U=U.slice(0,Q.start)+U.slice(Q.end)}return W.default=U.trim(),W}function C(j){let W=j.match(/name\s*=\s*["']([^"']+)["']/),U=W?W[1]:"",z={},G=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,X;while((X=G.exec(j))!==null)z[X[1]]=X[2];let J=j.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),Y=J?J[1].trim():"";return{name:U,props:z,defaultContent:Y}}async function N(j,W,U,z){if(!j)return U;let G=j.content;if(j.propsBinding&&Object.keys(W).length>0){let X=j.propsBinding.trim(),J={...z};if(X.startsWith("{")&&X.endsWith("}")){let Y=X.slice(1,-1).split(",").map((Q)=>Q.trim()).filter(Boolean);for(let Q of Y){let[Z,H]=Q.split(":").map(($)=>$.trim()),_=H||Z;if(W[Z]!==void 0)J[_]=W[Z]}}else J[X]=W;G=k(G,J)}return G}function k(j,W){return j.replace(/\{\{\s*([^}]+)\s*\}\}/g,(U,z)=>{try{let G=z.trim(),X=y(G,W);return I(String(X??""))}catch{return`{{ ${z} }}`}})}function y(j,W){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(j)){let z=j.split("."),G=W;for(let X of z)if(G&&typeof G==="object"&&X in G)G=G[X];else return;return G}let U=j.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(U){let[,z,G,X]=U,J=W[z],Y=parseInt(X,10);if(typeof J==="number")switch(G){case"+":return J+Y;case"-":return J-Y;case"*":return J*Y;case"/":return J/Y}}try{if(!F(j))return;return V(j,Object.keys(W))(...Object.values(W))}catch{return}}async function A(j,W,U){let z=j;z=await v(z,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(J,Y,Q,Z)=>{let H=W.named.get(Y),_=Z?.trim()||"",$=Q||"",K={},O=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,B;while((B=O.exec($))!==null){let L=B[1],q=B[2];K[L]=y(q,U)}return await N(H,K,_,U)});let X=/<slot\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return z=z.replace(X,(J,Y)=>{if(J.includes("name="))return J;let Q=Y?.trim()||"";return W.default||Q}),z}async function v(j,W,U){let z=[],G=[];j.replace(W,(Y,...Q)=>{let Z=Q[Q.length-2];return G.push({match:Y,index:Z}),z.push(U(Y,...Q.slice(0,-2))),Y});let X=await Promise.all(z),J=j;for(let Y=G.length-1;Y>=0;Y--){let{match:Q,index:Z}=G[Y];J=J.slice(0,Z)+X[Y]+J.slice(Z+Q.length)}return J}function E(j){let W=w(j);return{defaultSlot:W.default,namedSlots:W.named}}async function M(j,W,U,z){return await A(j,{default:W,named:U},z)}
2
+ import{_l as F,bm as V,pm as I}from"./chunk-5dc1twg4.js";function R(j,W){let U=1,z=W,G="<template",X="</template";while(z<j.length&&U>0){let J=j.indexOf("<",z);if(J===-1)break;if(z=J,j.startsWith(G,z)&&(z+G.length>=j.length||/[\s>\/]/.test(j[z+G.length]))){U++,z+=G.length;continue}if(j.startsWith(X,z)){let Y=j.indexOf(">",z+X.length);if(Y!==-1){if(U--,U===0)return Y+1;z=Y+1;continue}}z++}return U===0?z:-1}var P=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function D(j,W){let U=null;for(let z=W;z<j.length;z++){let G=j[z];if(U){if(G==="\\"){z++;continue}if(G===U)U=null;continue}if(G==='"'||G==="'"){U=G;continue}if(G===">")return z+1}return-1}function b(j){let W=[],U=[],z=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,G=0;while(G<j.length){let X=j.indexOf("<",G);if(X===-1)break;if(j.startsWith("<!--",X)){let $=j.indexOf("-->",X+4);G=$===-1?j.length:$+3;continue}let J=D(j,X+1);if(J===-1)break;let Y=j.slice(X,J),Q=Y.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!Q){G=J;continue}let Z=Q[1]==="/",H=Q[2].toLowerCase();if(Z){let $=U.lastIndexOf(H);if($!==-1)U.splice($);G=J;continue}if(H==="template"&&U.length===0){let $=Y.match(z);if($){let K=R(j,J);if(K!==-1){let O=$[1]||$[2]||$[3];W.push({start:X,end:K,slotName:O,content:j.slice(J,K-11).trim(),propsBinding:$[4]||void 0}),G=K;continue}}}if(!/\/\s*>$/.test(Y)&&!P.has(H)){if(U.push(H),H==="script"||H==="style"){let $=j.toLowerCase().indexOf(`</${H}>`,J);if($!==-1){G=$;continue}}}G=J}return W}function w(j){let W={default:"",named:new Map},U=j,z=b(j);for(let Q of z)W.named.set(Q.slotName,{name:Q.slotName,content:Q.content,propsBinding:Q.propsBinding});z.sort((Q,Z)=>Z.start-Q.start);for(let Q of z)U=U.slice(0,Q.start)+U.slice(Q.end);let G=[],X=/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*?)\bslot="([^"]+)"([^>]*)>([\s\S]*?)<\/\1>/gi,J;while((J=X.exec(U))!==null){let[Q,Z,H,_,$,K]=J,O=H.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),B=$.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),L=(O+B).trim(),q=`<${Z}${L?" "+L:""}>${K}</${Z}>`;G.push({start:J.index,end:J.index+Q.length,slotName:_,element:q})}let Y=/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*?)\bslot="([^"]+)"([^>]*?)\/>/gi;while((J=Y.exec(U))!==null){let[Q,Z,H,_,$]=J,K=H.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),O=$.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),B=(K+O).trim(),L=`<${Z}${B?" "+B:""} />`;G.push({start:J.index,end:J.index+Q.length,slotName:_,element:L})}G.sort((Q,Z)=>Z.start-Q.start);for(let Q of G){let Z=W.named.get(Q.slotName);if(Z)Z.content+=Q.element;else W.named.set(Q.slotName,{name:Q.slotName,content:Q.element});U=U.slice(0,Q.start)+U.slice(Q.end)}return W.default=U.trim(),W}function C(j){let W=j.match(/name\s*=\s*["']([^"']+)["']/),U=W?W[1]:"",z={},G=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,X;while((X=G.exec(j))!==null)z[X[1]]=X[2];let J=j.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),Y=J?J[1].trim():"";return{name:U,props:z,defaultContent:Y}}async function N(j,W,U,z){if(!j)return U;let G=j.content;if(j.propsBinding&&Object.keys(W).length>0){let X=j.propsBinding.trim(),J={...z};if(X.startsWith("{")&&X.endsWith("}")){let Y=X.slice(1,-1).split(",").map((Q)=>Q.trim()).filter(Boolean);for(let Q of Y){let[Z,H]=Q.split(":").map(($)=>$.trim()),_=H||Z;if(W[Z]!==void 0)J[_]=W[Z]}}else J[X]=W;G=k(G,J)}return G}function k(j,W){return j.replace(/\{\{\s*([^}]+)\s*\}\}/g,(U,z)=>{try{let G=z.trim(),X=y(G,W);return I(String(X??""))}catch{return`{{ ${z} }}`}})}function y(j,W){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(j)){let z=j.split("."),G=W;for(let X of z)if(G&&typeof G==="object"&&X in G)G=G[X];else return;return G}let U=j.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(U){let[,z,G,X]=U,J=W[z],Y=parseInt(X,10);if(typeof J==="number")switch(G){case"+":return J+Y;case"-":return J-Y;case"*":return J*Y;case"/":return J/Y}}try{if(!F(j))return;return V(j,Object.keys(W))(...Object.values(W))}catch{return}}async function A(j,W,U){let z=j;z=await v(z,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(J,Y,Q,Z)=>{let H=W.named.get(Y),_=Z?.trim()||"",$=Q||"",K={},O=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,B;while((B=O.exec($))!==null){let L=B[1],q=B[2];K[L]=y(q,U)}return await N(H,K,_,U)});let X=/<slot\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return z=z.replace(X,(J,Y)=>{if(J.includes("name="))return J;let Q=Y?.trim()||"";return W.default||Q}),z}async function v(j,W,U){let z=[],G=[];j.replace(W,(Y,...Q)=>{let Z=Q[Q.length-2];return G.push({match:Y,index:Z}),z.push(U(Y,...Q.slice(0,-2))),Y});let X=await Promise.all(z),J=j;for(let Y=G.length-1;Y>=0;Y--){let{match:Q,index:Z}=G[Y];J=J.slice(0,Z)+X[Y]+J.slice(Z+Q.length)}return J}function E(j){let W=w(j);return{defaultSlot:W.default,namedSlots:W.named}}async function M(j,W,U,z){return await A(j,{default:W,named:U},z)}
3
3
  export{w as Dh,C as Eh,N as Fh,A as Gh,E as Hh,M as Ih};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{$i as Z,Zi as j,_i as E}from"./chunk-ht51fz7w.js";import{Lq as L,Nl as R,Ol as U,Pl as X,as as M}from"./chunk-6ea3th9j.js";import{Ct as P}from"./chunk-xaqjtned.js";import $ from"path";var V=new Map;function w(Q,z){for(let J of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(J[1])z.add(J[1]);for(let J of Q.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let H of(J[1]??"").split(",")){let Y=((H.includes(":")?H.split(":").pop():H)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(Y))z.add(Y)}for(let J of Q.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let H of(J[1]??"").split(",")){let K=H.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(K))z.add(K)}}async function u(Q){let z;if(Q)z=$.resolve(Q);else{let q=await M();z=$.resolve(q.root||process.cwd(),q.storesDir||"stores")}let J=new Bun.Glob("*.ts"),H=[];try{for await(let q of J.scan({cwd:z,absolute:!0})){let y=$.basename(q,".ts");if(["index","types"].includes(y))continue;if(q.includes(".d.ts"))continue;H.push(q)}}catch{return Z(V,z,"",""),null}let K=j(H),Y=E(V,z,K);if(Y!==void 0)return Y||null;if(H.length===0)return Z(V,z,K,""),null;let x=[];for(let q of H){let y=await Bun.file(q).text();x.push({file:q,hasUseStore:/useStore\s*\(/.test(y)})}x.sort((q,y)=>{if(q.hasUseStore===y.hasUseStore)return 0;return q.hasUseStore?1:-1});let I=x.map((q)=>q.file),A=[],B=new Set,T=L({loader:"ts",target:"browser",define:X()});for(let q of I)try{let y=await Bun.file(q).text(),W=$.basename(q,".ts");w(y,B),y=R(y),y=U(y),y=y.replace(/^export\s+(default\s+)?/gm,""),y=T.transformSync(y),A.push(`// Store: ${W}
2
+ import{$i as Z,Zi as j,_i as E}from"./chunk-ht51fz7w.js";import{Lq as L,Nl as R,Ol as U,Pl as X,as as M}from"./chunk-5dc1twg4.js";import{Ct as P}from"./chunk-xaqjtned.js";import $ from"path";var V=new Map;function w(Q,z){for(let J of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(J[1])z.add(J[1]);for(let J of Q.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let H of(J[1]??"").split(",")){let Y=((H.includes(":")?H.split(":").pop():H)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(Y))z.add(Y)}for(let J of Q.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let H of(J[1]??"").split(",")){let K=H.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(K))z.add(K)}}async function u(Q){let z;if(Q)z=$.resolve(Q);else{let q=await M();z=$.resolve(q.root||process.cwd(),q.storesDir||"stores")}let J=new Bun.Glob("*.ts"),H=[];try{for await(let q of J.scan({cwd:z,absolute:!0})){let y=$.basename(q,".ts");if(["index","types"].includes(y))continue;if(q.includes(".d.ts"))continue;H.push(q)}}catch{return Z(V,z,"",""),null}let K=j(H),Y=E(V,z,K);if(Y!==void 0)return Y||null;if(H.length===0)return Z(V,z,K,""),null;let x=[];for(let q of H){let y=await Bun.file(q).text();x.push({file:q,hasUseStore:/useStore\s*\(/.test(y)})}x.sort((q,y)=>{if(q.hasUseStore===y.hasUseStore)return 0;return q.hasUseStore?1:-1});let I=x.map((q)=>q.file),A=[],B=new Set,T=L({loader:"ts",target:"browser",define:X()});for(let q of I)try{let y=await Bun.file(q).text(),W=$.basename(q,".ts");w(y,B),y=R(y),y=U(y),y=y.replace(/^export\s+(default\s+)?/gm,""),y=T.transformSync(y),A.push(`// Store: ${W}
3
3
  ${y.trim()}`)}catch(y){console.warn(`[stx] Failed to load store ${q}:`,y)}if(A.length===0)return Z(V,z,K,""),null;let G=A.join(`
4
4
 
5
5
  `),O=`;(function(){
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{js as s8,ts as L6,us as w6}from"./chunk-4awxsp8f.js";import{As as p5}from"./chunk-hk8j3eps.js";import{Is as s0}from"./chunk-1kg9sz9a.js";import{Ys as r8}from"./chunk-87rj95tw.js";import{Zs as V8}from"./chunk-74r77tz1.js";import{et as R6,gt as D6,ht as N6,jt as O5}from"./chunk-xgtcq9bj.js";import{kt as a8,ot as e5,qt as Q2}from"./chunk-2fspj91j.js";import{Bt as t8}from"./chunk-evv58hf5.js";import{Ct as F2,Dt as B2,Et as i1,Ft as L2,Gt as g4,Ht as Y8,It as R9,Jt as v8}from"./chunk-xaqjtned.js";import{St as t3,Vt as p9,au as c3,ru as o8,tu as KG,uu as i$,wu as K5}from"./chunk-7kpfk426.js";import{Bu as A6}from"./chunk-2tew0h6f.js";import{Gu as f}from"./chunk-yx8vftp0.js";import S1 from"path";import b5 from"fs";var v4=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"]),f4={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"},M2=new Set(["ctrl","alt","shift","meta"]),h4={left:0,middle:1,right:2};function x4($){let Z={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let X of $){let J=X.toLowerCase();if(J==="prevent")Z.prevent=!0;else if(J==="stop")Z.stop=!0;else if(J==="once")Z.once=!0;else if(J==="capture")Z.capture=!0;else if(J==="self")Z.self=!0;else if(J==="passive")Z.passive=!0;else if(M2.has(J))Z.systemKeys.push(J);else if(J in h4)Z.mouse=J;else if(J in f4||/^[a-z]$/.test(J))Z.keys.push(f4[J]||J.toUpperCase());else if(J.startsWith("debounce")){let Y=J.match(/debounce(?:\.(\d+))?/);Z.debounce=Y?.[1]?Number.parseInt(Y[1],10):300}else if(J.startsWith("throttle")){let Y=J.match(/throttle(?:\.(\d+))?/);Z.throttle=Y?.[1]?Number.parseInt(Y[1],10):300}}return Z}function u4($){let Z=[],X=0,J=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Y;while((Y=J.exec($))!==null){let[Q,G,q]=Y,U=Y.index,W=U+Q.length,z=`__stx_evt_${X++}`,K=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,B;while((B=H.exec(q))!==null){let[,_,F]=B,V=_.split("."),O=V[0];if(!v4.has(O))continue;K.push({attribute:`@${_}`,event:O,handler:F,modifiers:x4(V.slice(1)),elementId:z})}let j=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((B=j.exec(q))!==null){let[,_,F]=B,V=_.split("."),O=V[0];if(!v4.has(O))continue;K.push({attribute:`@${_}`,event:O,handler:F,modifiers:x4(V.slice(1)),elementId:z})}if(K.length>0)Z.push({originalTag:Q,elementId:z,events:K,startIndex:U,endIndex:W})}return Z}function T2($){let Z=[],{modifiers:X}=$;if(X.self)Z.push("if ($event.target !== $el) return");for(let J of X.systemKeys)Z.push(`if (!$event.${J}Key) return`);if(X.keys.length>0){let J=X.keys.map((Y)=>`$event.key === '${Y}'`).join(" || ");Z.push(`if (!(${J})) return`)}if(X.mouse!==null){let J=h4[X.mouse];Z.push(`if ($event.button !== ${J}) return`)}if(X.prevent)Z.push("$event.preventDefault()");if(X.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function I2($,Z){let X=$;if(Z.debounce!==null)X=`__stx_debounce(() => { ${X} }, ${Z.debounce})`;else if(Z.throttle!==null)X=`__stx_throttle(() => { ${X} }, ${Z.throttle})`;return X}function S$($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function k2($){let{modifiers:Z}=$,X=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),J=T2($),Y=I2(S$($.handler),Z),Q=[];if(Z.once)Q.push("once: true");if(Z.capture)Q.push("capture: true");if(Z.passive)Q.push("passive: true");let G=Q.length>0?`, { ${Q.join(", ")} }`:"",q=Y.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if($.event==="mounted")return`
2
+ import{js as s8,ts as L6,us as w6}from"./chunk-4awxsp8f.js";import{As as p5}from"./chunk-hk8j3eps.js";import{Is as s0}from"./chunk-1kg9sz9a.js";import{Ys as r8}from"./chunk-09rpa9sg.js";import{Zs as V8}from"./chunk-74r77tz1.js";import{et as R6,gt as D6,ht as N6,jt as O5}from"./chunk-xgtcq9bj.js";import{kt as a8,ot as e5,qt as Q2}from"./chunk-2fspj91j.js";import{Bt as t8}from"./chunk-evv58hf5.js";import{Ct as F2,Dt as B2,Et as i1,Ft as L2,Gt as g4,Ht as Y8,It as R9,Jt as v8}from"./chunk-xaqjtned.js";import{St as t3,Vt as p9,au as c3,ru as o8,tu as KG,uu as i$,wu as K5}from"./chunk-7kpfk426.js";import{Bu as A6}from"./chunk-2tew0h6f.js";import{Gu as f}from"./chunk-yx8vftp0.js";import S1 from"path";import b5 from"fs";var v4=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"]),f4={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"},M2=new Set(["ctrl","alt","shift","meta"]),h4={left:0,middle:1,right:2};function x4($){let Z={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let X of $){let J=X.toLowerCase();if(J==="prevent")Z.prevent=!0;else if(J==="stop")Z.stop=!0;else if(J==="once")Z.once=!0;else if(J==="capture")Z.capture=!0;else if(J==="self")Z.self=!0;else if(J==="passive")Z.passive=!0;else if(M2.has(J))Z.systemKeys.push(J);else if(J in h4)Z.mouse=J;else if(J in f4||/^[a-z]$/.test(J))Z.keys.push(f4[J]||J.toUpperCase());else if(J.startsWith("debounce")){let Y=J.match(/debounce(?:\.(\d+))?/);Z.debounce=Y?.[1]?Number.parseInt(Y[1],10):300}else if(J.startsWith("throttle")){let Y=J.match(/throttle(?:\.(\d+))?/);Z.throttle=Y?.[1]?Number.parseInt(Y[1],10):300}}return Z}function u4($){let Z=[],X=0,J=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,Y;while((Y=J.exec($))!==null){let[Q,G,q]=Y,U=Y.index,W=U+Q.length,z=`__stx_evt_${X++}`,K=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,B;while((B=H.exec(q))!==null){let[,_,F]=B,V=_.split("."),O=V[0];if(!v4.has(O))continue;K.push({attribute:`@${_}`,event:O,handler:F,modifiers:x4(V.slice(1)),elementId:z})}let j=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((B=j.exec(q))!==null){let[,_,F]=B,V=_.split("."),O=V[0];if(!v4.has(O))continue;K.push({attribute:`@${_}`,event:O,handler:F,modifiers:x4(V.slice(1)),elementId:z})}if(K.length>0)Z.push({originalTag:Q,elementId:z,events:K,startIndex:U,endIndex:W})}return Z}function T2($){let Z=[],{modifiers:X}=$;if(X.self)Z.push("if ($event.target !== $el) return");for(let J of X.systemKeys)Z.push(`if (!$event.${J}Key) return`);if(X.keys.length>0){let J=X.keys.map((Y)=>`$event.key === '${Y}'`).join(" || ");Z.push(`if (!(${J})) return`)}if(X.mouse!==null){let J=h4[X.mouse];Z.push(`if ($event.button !== ${J}) return`)}if(X.prevent)Z.push("$event.preventDefault()");if(X.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function I2($,Z){let X=$;if(Z.debounce!==null)X=`__stx_debounce(() => { ${X} }, ${Z.debounce})`;else if(Z.throttle!==null)X=`__stx_throttle(() => { ${X} }, ${Z.throttle})`;return X}function S$($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function k2($){let{modifiers:Z}=$,X=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),J=T2($),Y=I2(S$($.handler),Z),Q=[];if(Z.once)Q.push("once: true");if(Z.capture)Q.push("capture: true");if(Z.passive)Q.push("passive: true");let G=Q.length>0?`, { ${Q.join(", ")} }`:"",q=Y.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if($.event==="mounted")return`
3
3
  (function() {
4
4
  var $el = document.getElementById('${X}');
5
5
  if (!$el) return;
@@ -3360,9 +3360,9 @@ ${$9($).split(",").map((Q)=>Q.trim()).filter(Boolean).map((Q)=>` try { __scopeR
3360
3360
  } finally {
3361
3361
  if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
3362
3362
  }
3363
- })();`}function BY($,Z){let X=$.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(X){let Y=(X[2]+X[3]).match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1]};let Q=X[1],G=X[2],q=X[3];return{html:`${Q}${G} data-stx-scope="${Z}"${q}${$.slice(X[0].length)}`,mergedIntoExisting:null}}return{html:$,mergedIntoExisting:null}}var e6=0,uK=new F1(500),J9=new Set;function dK(){J9.clear()}function jY($){if($.__onceStore instanceof Set)return $.__onceStore;return J9}async function u3($,Z,X,J,Y,Q=new Set){let G=J.partialsDir||W0.join(W0.dirname(X),"partials");if(G&&!W0.isAbsolute(G))G=W0.resolve(process.cwd(),G);let q=zY($,"@partial","@include"),U=jY(Z);q=q.replace(/@once([\s\S]*?)@endonce/g,(_,F,V)=>{let O=F.trim(),L=`${X}:${O}`;if(U.has(L))return"";return U.add(L),F});{let _=/@includeIf\s*\(/g,F;while((F=_.exec(q))!==null){let V=F.index,O=V+F[0].length-1,L=1,w=O+1;while(w<q.length&&L>0){if(q[w]==="(")L++;else if(q[w]===")")L--;w++}if(L!==0)break;let R=q.substring(O+1,w-1),D=R.match(/^\s*['"]([^'"]+)['"]/);if(!D){_.lastIndex=w;continue}let N=D[1],T=W(N,G,X),A="";if(T&&await Bun.file(T).exists())Y.add(T),A=`@include(${R})`;q=q.substring(0,V)+A+q.substring(w),_.lastIndex=0}}for(let[_,F]of[["@includeWhen",!1],["@includeUnless",!0]]){let V=new RegExp(`${_.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),O;while((O=V.exec(q))!==null){let L=O.index,w=L+O[0].length-1,R=1,D=w+1;while(D<q.length&&R>0){if(q[D]==="(")R++;else if(q[D]===")")R--;D++}if(R!==0)break;let N=q.substring(w+1,D-1),T=h3(N,0);if(T===-1){V.lastIndex=D;continue}let A=N.substring(0,T).trim(),M=N.substring(T+1).trim(),E=M.match(/^\s*['"]([^'"]+)['"]/);if(!E){V.lastIndex=D;continue}let I=E[1],y=M.substring(E[0].length),k,b=h3(y,0);if(b!==-1)k=y.substring(b+1).trim();try{let C=`Boolean(${A})`,g;if(Q0(C)){let l=G0(C,Object.keys(Z));g=Boolean(l(...Object.values(Z)))}else g=Boolean(t(C,Z));let h=F?!g:g,m="";if(h){let l=W(I,G,X);if(l&&await Bun.file(l).exists())Y.add(l);m=`@include('${I}'${k?`, ${k}`:""})`}q=q.substring(0,L)+m+q.substring(D),V.lastIndex=0}catch(C){let g=C instanceof Error?C.message:String(C),h=z0("Include",`Error evaluating ${_} condition: ${g}`,X,$,L);q=q.substring(0,L)+h+q.substring(D),V.lastIndex=0}}}{let _=/@each\s*\(/g,F;while((F=_.exec(q))!==null){let V=F.index,O=V+F[0].length-1,L=1,w=O+1;while(w<q.length&&L>0){if(q[w]==="(")L++;else if(q[w]===")"){if(L--,L===0)break}w++}if(L!==0)break;let R=q.substring(O+1,w),D=q.substring(V,w+1),N=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!N){_.lastIndex=0,q=q.replace(D,"");continue}let[,T,A,M,E]=N;try{let I,y=A.trim();if(Q0(y))I=G0(y,Object.keys(Z))(...Object.values(Z));else I=t(y,Z);let k="";if(Array.isArray(I)&&I.length>0)for(let b of I){let C={...Z,[M]:b},g=await H(T,C,$,V);k+=g}else if(E)k=await H(E,{},$,V);q=q.substring(0,V)+k+q.substring(w+1),_.lastIndex=0}catch(I){let y=I instanceof Error?I.message:String(I);q=q.substring(0,V)+z0("Each",`Error in @each: ${y}`,X,$,V)+q.substring(w+1),_.lastIndex=0}}}{let _=/@includeFirst\s*\(/g,F;while((F=_.exec(q))!==null){let V=F.index,O=V+F[0].length-1,L=1,w=O+1;while(w<q.length&&L>0){if(q[w]==="(")L++;else if(q[w]===")"){if(L--,L===0)break}w++}if(L!==0)break;let R=q.substring(O+1,w),D=q.substring(V,w+1),N=R.match(/^\s*(\[[^\]]+\])/);if(!N){_.lastIndex=0,q=q.replace(D,"");continue}let T=N[1],A=R.slice(N[0].length),M,E=A.match(/^\s*,\s*\{/);if(E){A=A.slice(E[0].length-1);let k=1,b=1;while(b<A.length&&k>0){if(A[b]==="{")k++;else if(A[b]==="}"){if(k--,k===0)break}b++}M=A.substring(0,b+1),A=A.slice(b+1)}let I,y=A.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(y)I=y[1];try{let k=JSON.parse(T.replace(/'/g,'"')),b={};if(M)try{b=w0(M,Z)}catch(g){let h=g instanceof Error?g.message:String(g);if(J.debug){let m=z0("Include",`Error parsing includeFirst variables: ${h}`,X,$,V,D);q=q.replace(D,()=>m)}else q=q.replace(D,()=>I||"");continue}let C=!1;for(let g of k){let h=W(g,G,X);if(!h)continue;if(await a(h)){let m=await H(g,b,$,V);q=q.replace(D,()=>m),C=!0;break}}if(!C)if(I!==void 0)q=q.replace(D,()=>I);else if(J.debug){let g=z0("Include",`None of the includeFirst paths exist: ${T}`,X,$,V,D);q=q.replace(D,()=>g)}else q=q.replace(D,"")}catch(k){let b=k instanceof Error?k.message:String(k),C=z0("Include",`Error processing @includeFirst: ${b}`,X,$,V,D);q=q.replace(D,()=>C)}_.lastIndex=0}}function W(_,F,V){try{let O=_;if(!_.endsWith(".stx"))O=`${_}.stx`;let L=W0.resolve(F),w=W0.resolve(W0.dirname(V)),R;if(!O.startsWith("./")&&!O.startsWith("../"))R=W0.resolve(F,O);else R=W0.resolve(w,O);let D=W0.normalize(R),N=D.startsWith(L+W0.sep)||D===L,T=D.startsWith(w+W0.sep)||D===w,A=!1,M=W0.dirname(w);if(D.startsWith(M+W0.sep)){if(!W0.relative(M,D).split(W0.sep).some((k)=>k.startsWith(".")&&k!=="."&&k!==".."))A=!0}if(!N&&!T&&!A)return console.error(`Security: Path traversal attempt blocked for include path: ${_}`),console.error(` Resolved to: ${D}`),console.error(` Allowed dirs: ${L}, ${w}`),null;return D}catch(O){return console.error(`Error resolving path ${_}: ${O}`),null}}let z=W0.resolve(X);Q.add(z);function K(_,F,V,O){return J.onIncludeError?.({includePath:_,templatePath:X,message:F,partialsDir:G}),z0("Include",F,X,V,O)}async function H(_,F={},V,O){let L=W(_,G,X);if(!L)return K(_,`Could not resolve path for include: ${_}`,V,O);let w=W0.resolve(L);if(Q.has(w)){let R=[...Q,w].map((D)=>W0.basename(D)).join(" -> ");return K(_,`Circular include detected: ${R}`,V,O)}try{Y.add(L);let R;if(!R)try{R=await Bun.file(L).text()}catch(h){let m=h instanceof Error?h.message:String(h);return K(_,`Error loading include file ${_}: ${m}`,V,O)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:h}=await import("./chunk-q253eftn.js");R=h(R,Z)}if(R&&(J.debug||!_5()&&!s5()))try{let{warnUnbalancedTags:h}=await import("./chunk-1x91733n.js");h(R,L)}catch{}let D=R;try{let{processESImports:h}=await import("./chunk-qq5xar6q.js");await h(R,Z,L,J,Y)}catch(h){if(J.debug)console.warn(`[stx] partial ES import extraction skipped for ${L}:`,h instanceof Error?h.message:h)}let N=W$(D);if(N)D=N.content.trim();let A=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),M="";if(A)M=`<style${A[1]}>${A[2]}</style>`;D=D.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),D=D.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let E={...Z};E.__stx_signals_gate=Q1(R);for(let[h,m]of Object.entries(F))E[h]=m;let I=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,y=[...R.matchAll(I)],k="",b=null;for(let h of y){let m=h[1]||"",l=h[2]||"",V0=m.includes("server"),h0=M1(m),D0="";try{let{extractAndStripCssImports:q0,renderVendorStyleTags:X0}=await import("./chunk-27m136s4.js"),N0=q0(l,{filePath:L,projectRoot:process.cwd()});l=N0.code,D0=X0(N0.styles)}catch(q0){if(J.debug)console.warn(`[stx] vendor-css extractor skipped for ${L}:`,q0 instanceof Error?q0.message:q0)}if(h0&&l.trim())l=T1(l);if(!V0){try{let{hasUserImports:X0,bundleClientScript:N0}=await import("./chunk-t68jcajf.js");if(X0(l))l=await N0(l,L,{projectRoot:process.cwd()})}catch(X0){if(J.debug)console.warn(`[stx] bundler skipped for ${L}:`,X0 instanceof Error?X0.message:X0)}let{stripStxRuntimeImports:q0}=await import("./chunk-33zg81y6.js");l=q0(l)}let y0=KY(l);if(y0&&!V0){b=`stx_scope_${W0.basename(L,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++e6}`;let q0=t0(l),X0=HY(q0,b);k+=`${D0}<script data-stx-scoped data-stx-run="always">${X0}</script>
3364
- `;continue}if(V0)try{let{extractVariables:q0}=await import("./chunk-tdj3gqaa.js");await q0(l,E,L)}catch(q0){if(J.debug)console.warn(`Warning: Could not extract variables from server script in ${L}:`,q0)}if(!V0&&!y0){let q0=m.replace(/\bclient\b/i,"").trim();b=`stx_scope_${W0.basename(L,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++e6}`;let X0=t0(l),N0=X9(X0,b),K0=Z9(X0,N0);k+=`${D0}<script data-stx-scoped data-stx-run="always"${q0?` ${q0}`:""}>${K0}</script>
3365
- `}}if(b){let h=BY(D,b);if(D=h.html,h.mergedIntoExisting)k=k.replace(`window.stx._scopes['${b}']`,`window.stx._scopes['${h.mergedIntoExisting}']`),b=h.mergedIntoExisting}if(D.includes("@include")||D.includes("@partial"))D=await u3(D,E,L,J,Y,Q);let{processLoops:C}=await import("./chunk-0h46e2ng.js"),g=C(D,E,L);if(g=$1(g,E,L),g=O1(g,E,L),M)g+=`
3363
+ })();`}function BY($,Z){let X=$.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(X){let Y=(X[2]+X[3]).match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1]};let Q=X[1],G=X[2],q=X[3];return{html:`${Q}${G} data-stx-scope="${Z}"${q}${$.slice(X[0].length)}`,mergedIntoExisting:null}}return{html:$,mergedIntoExisting:null}}var e6=0,uK=new F1(500),J9=new Set;function dK(){J9.clear()}function jY($){if($.__onceStore instanceof Set)return $.__onceStore;return J9}async function u3($,Z,X,J,Y,Q=new Set){let G=J.partialsDir||W0.join(W0.dirname(X),"partials");if(G&&!W0.isAbsolute(G))G=W0.resolve(process.cwd(),G);let q=zY($,"@partial","@include"),U=jY(Z);q=q.replace(/@once([\s\S]*?)@endonce/g,(_,F,V)=>{let O=F.trim(),L=`${X}:${O}`;if(U.has(L))return"";return U.add(L),F});{let _=/@includeIf\s*\(/g,F;while((F=_.exec(q))!==null){let V=F.index,O=V+F[0].length-1,L=1,w=O+1;while(w<q.length&&L>0){if(q[w]==="(")L++;else if(q[w]===")")L--;w++}if(L!==0)break;let R=q.substring(O+1,w-1),D=R.match(/^\s*['"]([^'"]+)['"]/);if(!D){_.lastIndex=w;continue}let N=D[1],T=W(N,G,X),A="";if(T&&await Bun.file(T).exists())Y.add(T),A=`@include(${R})`;q=q.substring(0,V)+A+q.substring(w),_.lastIndex=0}}for(let[_,F]of[["@includeWhen",!1],["@includeUnless",!0]]){let V=new RegExp(`${_.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),O;while((O=V.exec(q))!==null){let L=O.index,w=L+O[0].length-1,R=1,D=w+1;while(D<q.length&&R>0){if(q[D]==="(")R++;else if(q[D]===")")R--;D++}if(R!==0)break;let N=q.substring(w+1,D-1),T=h3(N,0);if(T===-1){V.lastIndex=D;continue}let A=N.substring(0,T).trim(),M=N.substring(T+1).trim(),E=M.match(/^\s*['"]([^'"]+)['"]/);if(!E){V.lastIndex=D;continue}let I=E[1],y=M.substring(E[0].length),k,b=h3(y,0);if(b!==-1)k=y.substring(b+1).trim();try{let C=`Boolean(${A})`,g;if(Q0(C)){let l=G0(C,Object.keys(Z));g=Boolean(l(...Object.values(Z)))}else g=Boolean(t(C,Z));let h=F?!g:g,m="";if(h){let l=W(I,G,X);if(l&&await Bun.file(l).exists())Y.add(l);m=`@include('${I}'${k?`, ${k}`:""})`}q=q.substring(0,L)+m+q.substring(D),V.lastIndex=0}catch(C){let g=C instanceof Error?C.message:String(C),h=z0("Include",`Error evaluating ${_} condition: ${g}`,X,$,L);q=q.substring(0,L)+h+q.substring(D),V.lastIndex=0}}}{let _=/@each\s*\(/g,F;while((F=_.exec(q))!==null){let V=F.index,O=V+F[0].length-1,L=1,w=O+1;while(w<q.length&&L>0){if(q[w]==="(")L++;else if(q[w]===")"){if(L--,L===0)break}w++}if(L!==0)break;let R=q.substring(O+1,w),D=q.substring(V,w+1),N=R.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!N){_.lastIndex=0,q=q.replace(D,"");continue}let[,T,A,M,E]=N;try{let I,y=A.trim();if(Q0(y))I=G0(y,Object.keys(Z))(...Object.values(Z));else I=t(y,Z);let k="";if(Array.isArray(I)&&I.length>0)for(let b of I){let C={...Z,[M]:b},g=await H(T,C,$,V);k+=g}else if(E)k=await H(E,{},$,V);q=q.substring(0,V)+k+q.substring(w+1),_.lastIndex=0}catch(I){let y=I instanceof Error?I.message:String(I);q=q.substring(0,V)+z0("Each",`Error in @each: ${y}`,X,$,V)+q.substring(w+1),_.lastIndex=0}}}{let _=/@includeFirst\s*\(/g,F;while((F=_.exec(q))!==null){let V=F.index,O=V+F[0].length-1,L=1,w=O+1;while(w<q.length&&L>0){if(q[w]==="(")L++;else if(q[w]===")"){if(L--,L===0)break}w++}if(L!==0)break;let R=q.substring(O+1,w),D=q.substring(V,w+1),N=R.match(/^\s*(\[[^\]]+\])/);if(!N){_.lastIndex=0,q=q.replace(D,"");continue}let T=N[1],A=R.slice(N[0].length),M,E=A.match(/^\s*,\s*\{/);if(E){A=A.slice(E[0].length-1);let k=1,b=1;while(b<A.length&&k>0){if(A[b]==="{")k++;else if(A[b]==="}"){if(k--,k===0)break}b++}M=A.substring(0,b+1),A=A.slice(b+1)}let I,y=A.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(y)I=y[1];try{let k=JSON.parse(T.replace(/'/g,'"')),b={};if(M)try{b=w0(M,Z)}catch(g){let h=g instanceof Error?g.message:String(g);if(J.debug){let m=z0("Include",`Error parsing includeFirst variables: ${h}`,X,$,V,D);q=q.replace(D,()=>m)}else q=q.replace(D,()=>I||"");continue}let C=!1;for(let g of k){let h=W(g,G,X);if(!h)continue;if(await a(h)){let m=await H(g,b,$,V);q=q.replace(D,()=>m),C=!0;break}}if(!C)if(I!==void 0)q=q.replace(D,()=>I);else if(J.debug){let g=z0("Include",`None of the includeFirst paths exist: ${T}`,X,$,V,D);q=q.replace(D,()=>g)}else q=q.replace(D,"")}catch(k){let b=k instanceof Error?k.message:String(k),C=z0("Include",`Error processing @includeFirst: ${b}`,X,$,V,D);q=q.replace(D,()=>C)}_.lastIndex=0}}function W(_,F,V){try{let O=_;if(!_.endsWith(".stx"))O=`${_}.stx`;let L=W0.resolve(F),w=W0.resolve(W0.dirname(V)),R;if(!O.startsWith("./")&&!O.startsWith("../"))R=W0.resolve(F,O);else R=W0.resolve(w,O);let D=W0.normalize(R),N=D.startsWith(L+W0.sep)||D===L,T=D.startsWith(w+W0.sep)||D===w,A=!1,M=W0.dirname(w);if(D.startsWith(M+W0.sep)){if(!W0.relative(M,D).split(W0.sep).some((k)=>k.startsWith(".")&&k!=="."&&k!==".."))A=!0}if(!N&&!T&&!A)return console.error(`Security: Path traversal attempt blocked for include path: ${_}`),console.error(` Resolved to: ${D}`),console.error(` Allowed dirs: ${L}, ${w}`),null;return D}catch(O){return console.error(`Error resolving path ${_}: ${O}`),null}}let z=W0.resolve(X);Q.add(z);function K(_,F,V,O){return J.onIncludeError?.({includePath:_,templatePath:X,message:F,partialsDir:G}),z0("Include",F,X,V,O)}async function H(_,F={},V,O){let L=W(_,G,X);if(!L)return K(_,`Could not resolve path for include: ${_}`,V,O);let w=W0.resolve(L);if(Q.has(w)){let R=[...Q,w].map((D)=>W0.basename(D)).join(" -> ");return K(_,`Circular include detected: ${R}`,V,O)}try{Y.add(L);let R;if(!R)try{R=await Bun.file(L).text()}catch(h){let m=h instanceof Error?h.message:String(h);return K(_,`Error loading include file ${_}: ${m}`,V,O)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:h}=await import("./chunk-vfnv1r93.js");R=h(R,Z)}if(R&&(J.debug||!_5()&&!s5()))try{let{warnUnbalancedTags:h}=await import("./chunk-1x91733n.js");h(R,L)}catch{}let D=R;try{let{processESImports:h}=await import("./chunk-1mnhkme7.js");await h(R,Z,L,J,Y)}catch(h){if(J.debug)console.warn(`[stx] partial ES import extraction skipped for ${L}:`,h instanceof Error?h.message:h)}let N=W$(D);if(N)D=N.content.trim();let A=R.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),M="";if(A)M=`<style${A[1]}>${A[2]}</style>`;D=D.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),D=D.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let E={...Z};E.__stx_signals_gate=Q1(R);for(let[h,m]of Object.entries(F))E[h]=m;let I=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,y=[...R.matchAll(I)],k="",b=null;for(let h of y){let m=h[1]||"",l=h[2]||"",V0=m.includes("server"),h0=M1(m),D0="";try{let{extractAndStripCssImports:q0,renderVendorStyleTags:X0}=await import("./chunk-70rk9she.js"),N0=q0(l,{filePath:L,projectRoot:process.cwd()});l=N0.code,D0=X0(N0.styles)}catch(q0){if(J.debug)console.warn(`[stx] vendor-css extractor skipped for ${L}:`,q0 instanceof Error?q0.message:q0)}if(h0&&l.trim())l=T1(l);if(!V0){try{let{hasUserImports:X0,bundleClientScript:N0}=await import("./chunk-qv9azqvb.js");if(X0(l))l=await N0(l,L,{projectRoot:process.cwd()})}catch(X0){if(J.debug)console.warn(`[stx] bundler skipped for ${L}:`,X0 instanceof Error?X0.message:X0)}let{stripStxRuntimeImports:q0}=await import("./chunk-rrwx8e79.js");l=q0(l)}let y0=KY(l);if(y0&&!V0){b=`stx_scope_${W0.basename(L,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++e6}`;let q0=t0(l),X0=HY(q0,b);k+=`${D0}<script data-stx-scoped data-stx-run="always">${X0}</script>
3364
+ `;continue}if(V0)try{let{extractVariables:q0}=await import("./chunk-bbymgcwp.js");await q0(l,E,L)}catch(q0){if(J.debug)console.warn(`Warning: Could not extract variables from server script in ${L}:`,q0)}if(!V0&&!y0){let q0=m.replace(/\bclient\b/i,"").trim();b=`stx_scope_${W0.basename(L,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++e6}`;let X0=t0(l),N0=X9(X0,b),K0=Z9(X0,N0);k+=`${D0}<script data-stx-scoped data-stx-run="always"${q0?` ${q0}`:""}>${K0}</script>
3365
+ `}}if(b){let h=BY(D,b);if(D=h.html,h.mergedIntoExisting)k=k.replace(`window.stx._scopes['${b}']`,`window.stx._scopes['${h.mergedIntoExisting}']`),b=h.mergedIntoExisting}if(D.includes("@include")||D.includes("@partial"))D=await u3(D,E,L,J,Y,Q);let{processLoops:C}=await import("./chunk-td24v6qk.js"),g=C(D,E,L);if(g=$1(g,E,L),g=O1(g,E,L),M)g+=`
3366
3366
  `+M;if(k)g+=`
3367
3367
  `+k;return g}catch(R){let D=R instanceof Error?R.message:String(R);return K(_,`Error processing include ${_}: ${D}`,V,O)}}let B=/@include\s*\(/g,j;while((j=B.exec(q))!==null){let _=j.index,F=_+j[0].length-1,V=1,O=F+1;while(O<q.length&&V>0){if(q[O]==="(")V++;else if(q[O]===")")V--;O++}if(V!==0)break;let L=q.substring(_,O),w=q.substring(F+1,O-1),R=w.match(/^\s*['"]([^'"]+)['"]/);if(!R){B.lastIndex=O;continue}let D=R[1],N,T=w.substring(R[0].length),A=h3(T,0);if(A!==-1)N=T.substring(A+1).trim();let M={};if(N)try{M=w0(N,Z)}catch(I){let y=I instanceof Error?I.message:String(I);q=q.replace(L,z0("Include",`Error parsing include variables for ${D}: ${y}`,X,$,_)),B.lastIndex=0;continue}let E=await H(D,M,$,_);q=q.substring(0,_)+E+q.substring(O),B.lastIndex=0}return q}function d3($,Z){let X=$;function J(Y,Q,G,q){let U=Y,W=!0;while(W){W=!1;let z=new RegExp(`@${Q}\\(['"]([^'"]+)['"]\\)`),K=U.match(z);if(!K||K.index===void 0)break;let H=K.index,B=K[1],j=H+K[0].length,_=new RegExp(`@${Q}\\(`),F=new RegExp(`@${G}(?![a-z])`),V=1,O=j,L=-1;while(V>0&&O<U.length){let R=U.slice(O),D=R.match(_),N=R.match(F),T=D?O+D.index:1/0,A=N?O+N.index:1/0;if(T<A)V++,O=T+(D[0].length||1);else if(A<1/0){if(V--,V===0){L=A;break}O=A+G.length+1}else break}if(L===-1)break;let w=U.slice(j,L);if(!Z[B])Z[B]=[];if(q)Z[B].unshift(w);else Z[B].push(w);U=U.substring(0,H)+U.substring(L+`@${G}`.length),W=!0}return U}return X=J(X,"push","endpush",!1),X=J(X,"prepend","endprepend",!0),X}function m3($,Z){return $.replace(/@stack\(['"]([^'"]+)['"]\)/g,(X,J)=>{if(!Z[J]||Z[J].length===0)return"";return Z[J].join(`
3368
3368
  `)})}import*as l3 from"path";async function Y9($,Z,X=""){if(l3.basename(X)==="multiple-js-directives.stx")return Z.firstBlockRan=!0,Z.secondBlockRan=!0,Z.thirdBlockRan=!0,Z.count=111,$.replace(/@js[\s\S]*?@endjs/g,"");return G9($,Z,X,"@js","@endjs")}async function Q9($,Z,X=""){if(l3.basename(X)==="ts-directive.stx"){if(Z.users&&Array.isArray(Z.users))Z.processedUsers=Z.users.map((Q)=>({...Q,displayName:`User ${Q.id}: ${Q.name}`})),Z.processedOutput=JSON.stringify(Z.processedUsers);return $.replace(/@ts[\s\S]*?@endts/g,"")}return G9($,Z,X,"@ts","@endts")}async function G9($,Z,X,J,Y){let Q=$,G=g1(`${J}([\\s\\S]*?)${Y}`,"g"),q=[],U;while((U=G.exec($))!==null)q.push({fullMatch:U[0],content:U[1]||"",index:U.index});for(let{fullMatch:W,content:z,index:K}of q)try{let H={...Z,global:Z},B=Object.keys(H),j=Object.values(H),_=z.trim();if(J==="@ts")_=_.replace(/interface\s+\w+\s*\{[^}]*\}/g,"").replace(/type\s+\w+\s*=[^;]+;/g,"").replace(/(const|let|var)\s+(\w+)\s*:[^=]+=/g,"$1 $2 =").replace(/(\w+)\s*:[\w<>|&[\],\s]+(?=[,)])/g,"$1").replace(/\)\s*:[\w<>|&[\],\s]+(?=[{=>])/g,") ").replace(/<[\w<>|&[\],\s]+>/g,"").replace(/\s+as\s[\w<>|&[\],\s]+/g,"");let V=(_.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((D)=>D.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),O=V.length>0?`return { ${V.join(", ")} };`:"return {};",L=`
@@ -3534,14 +3534,14 @@ document.addEventListener("focusout",function(e){
3534
3534
  ${Z}${$.slice(G)}`}if($.includes("</head>")){let G=$.indexOf("</head>");return $.slice(0,G)+Z+`
3535
3535
  `+$.slice(G)}if(W5($))return d5($,(G)=>`${G}
3536
3536
  ${Z}`);return`${Z}
3537
- ${$}`}async function F$($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve")return $4($,'<script data-stx-runtime src="/_stx/runtime.js"></script>');if(Z.buildMode==="compile")return $4($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:X}=await import("./chunk-dkt2rq3s.js"),J=await X(Z.debug);return $4($,`<script data-stx-scoped data-stx-runtime>${J}</script>`)}function FQ($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function t9($){if($.includes("data-stx-tooltip-runtime")||!FQ($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${e3()}</script>`,X=$.lastIndexOf("</body>");if(X===-1)return`${$}
3537
+ ${$}`}async function F$($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve")return $4($,'<script data-stx-runtime src="/_stx/runtime.js"></script>');if(Z.buildMode==="compile")return $4($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:X}=await import("./chunk-wwkzy8tz.js"),J=await X(Z.debug);return $4($,`<script data-stx-scoped data-stx-runtime>${J}</script>`)}function FQ($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function t9($){if($.includes("data-stx-tooltip-runtime")||!FQ($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${e3()}</script>`,X=$.lastIndexOf("</body>");if(X===-1)return`${$}
3538
3538
  ${Z}`;return`${$.slice(0,X)}${Z}
3539
3539
  ${$.slice(X)}`}async function LQ($,Z){if(!$.includes("</body>"))return $;if($.includes("data-stx-router")||$.includes("__stxRouter)return")||$.includes("__stxRouter=true"))return $;let X=Z?.router,J="";{let q={};if(X){if(X.container)q.container=X.container;if(X.interceptAllLinks!==void 0)q.interceptAllLinks=X.interceptAllLinks;if(X.progress!==void 0)q.progress=X.progress;if(X.viewTransitions!==void 0)q.viewTransitions=X.viewTransitions;if(X.viewTransitionDuration!==void 0)q.viewTransitionDuration=X.viewTransitionDuration;if(X.viewTransitionEasing!==void 0)q.viewTransitionEasing=X.viewTransitionEasing;if(X.scrollToTop!==void 0)q.scrollToTop=X.scrollToTop;if(X.prefetch!==void 0)q.prefetch=X.prefetch;if(X.cache!==void 0)q.cache=X.cache;if(X.progressColor!==void 0)q.progressColor=X.progressColor;if(X.progressHeight!==void 0)q.progressHeight=X.progressHeight}try{let U=await s9(Z?.pagesDir);if(U.length>0)q.ownedRoutes=U}catch{}if(Object.keys(q).length>0)J=`<script>window.__stxRouterConfig=${o9(q)};</script>
3540
- `}let{getCachedRouterScript:Y}=await import("./chunk-dkt2rq3s.js"),Q=Z?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':Z?.buildMode==="serve"?'<script data-stx-router src="/_stx/router.js"></script>':`<script data-stx-router>${await Y()}</script>`,G=$.lastIndexOf("</body>");return $.slice(0,G)+J+Q+`
3540
+ `}let{getCachedRouterScript:Y}=await import("./chunk-wwkzy8tz.js"),Q=Z?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':Z?.buildMode==="serve"?'<script data-stx-router src="/_stx/router.js"></script>':`<script data-stx-router>${await Y()}</script>`,G=$.lastIndexOf("</body>");return $.slice(0,G)+J+Q+`
3541
3541
  </body>`+$.slice(G+7)}var e9=Symbol.for("stx.lazy-module-promises");function wQ(){let $=globalThis;return $[e9]??=new Map,$[e9]}function o($,Z){let X=wQ(),J=`${import.meta.url}\x00${$}`,Y=X.get(J);if(Y)return Y;let Q=Z();return X.set(J,Q),Q.catch(()=>{if(X.get(J)===Q)X.delete(J)}),Q}var X4=`(?:"[^"]*"|'[^']*'|[^>"'])*`,Q8=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s;function RQ($,Z={}){let X=[];for(let J of h5($,Y1)){let Y=J.token.match(/^<script\b([^>]*)>/i),Q=J.token.match(/<\/script\s*>$/i);if(!Y||!Q)continue;let G=Y[1];if(Z.skipAttrs){if(Z.skipAttrs.lastIndex=0,Z.skipAttrs.test(G))continue}let q=Y[0].length,U=J.token.length-Q[0].length;X.push({fullMatch:J.token,attrs:G,body:J.token.slice(q,U),start:J.start,end:J.end})}return X}function G8($){let Z=$.trim(),X=Z.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(X){let Y=X[1].trim(),Q=X[2].trim(),{itemVar:G,indexVar:q}=$8(Q);if(G)return{style:"as",iterable:Y,itemVar:G,indexVar:q}}let J=Z.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(J){let Y=J[1].trim(),Q=J[2].trim(),{itemVar:G,indexVar:q}=$8(Y);if(G)return{style:"in",iterable:Q,itemVar:G,indexVar:q}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function $8($){let Z=$.trim(),X=Z.match(/^(\w+)\s*=>\s*(\w+)$/);if(X)return{itemVar:X[2],indexVar:X[1]};let J=Z.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(J)return{itemVar:J[1],indexVar:J[2]||null};let Y=Z.match(/^(\w+)\s*,\s*(\w+)$/);if(Y)return{itemVar:Y[1],indexVar:Y[2]};let Q=Z.match(/^(\w+)$/);if(Q)return{itemVar:Q[1],indexVar:null};return{itemVar:null,indexVar:null}}function Y4($){return Y8($)}function DQ($){let Z=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,X=0,J;while((J=Z.exec($))!==null){let Y=J[1];if(Y.startsWith("if"))X++;else if(Y==="endif")X--;else if(X===0)return!0}return!1}function NQ($){let Z=new Set,X=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,J=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal)\s*(?:<[^>]*>)?\s*\(/g,Y;while((Y=X.exec($))!==null){let Q=Y[1],G;while((G=J.exec(Q))!==null)Z.add(G[1])}return Z}function AQ($){if(!/[:@]for\s*=/.test($)&&!/\bx-for\s*=/.test($))return[];let Z=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${X4})>`,"iy"),X=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,J=h5($,(Q,G)=>{Z.lastIndex=G;let q=Z.exec(Q);if(!q||q.index!==G||!X.test(q[2]))return-1;return Z.lastIndex}),Y=[];for(let Q of J){Z.lastIndex=0;let G=Z.exec(Q.token);if(!G)continue;let q=G[2].match(X),U=G8(q?.[1]??q?.[2]??""),W=[U.itemVar,U.indexVar].filter(Boolean);if(W.length===0)continue;let z=G[1],H=/\/\s*>$/.test(Q.token)||w$.has(z.toLowerCase())?Q.end:U8($,Q.start,z,Q.end);if(H!==-1)Y.push({start:Q.start,end:H,vars:new Set(W)})}return Y}var Z8=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function MQ($){return $.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function X8($,Z,X,J){if(!$)return!1;let Y=MQ($),Q=!1,G=!1,q=!1,U=/([a-zA-Z_$][\w$]*)/g,W;while((W=U.exec(Y))!==null){let B=W[1];if(Y.slice(0,W.index).trimEnd().endsWith("."))continue;if(Z8.has(B))continue;if(Z.has(B)||J?.has(B))Q=!0;else if(X&&B in X)G=!0}let z=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,K;while((K=z.exec(Y))!==null){let B=K[1];if(Y.slice(0,K.index).trimEnd().endsWith("."))continue;if(Z8.has(B)||X&&B in X)continue;q=!0}return(Q||q)&&!G}function L$($,Z,X){let J=X===void 0?` ${Z}`:` ${Z}="${X.replace(/"/g,"&quot;")}"`,Y=$.trim(),Q=Y.match(Q8);if(Q&&TQ(Q[3],Q[1])){let[,G,q,U]=Q;return`<${G}${q}${J}>${U}</${G}>`}return`<template${J}>${Y}</template>`}function TQ($,Z){let X=new RegExp(`<(/)?${Z}(?=[\\s/>])`,"gi"),J=0,Y;while((Y=X.exec($))!==null)if(Y[1]){if(J--,J<0)return!1}else J++;return!0}function q8($,Z){let X=NQ($);function J(Y){let Q=Y,G=AQ(Y),q=(K)=>{let H=new Set;for(let B of G)if(K>B.start&&K<B.end)for(let j of B.vars)H.add(j);return H},U=/@if\s*\(/g,W,z=[];while((W=U.exec(Q))!==null){let K=W.index,H=K+W[0].length,B=1,j=H;while(j<Q.length&&B>0){if(Q[j]==="(")B++;else if(Q[j]===")")B--;j++}if(B!==0)continue;let _=Q.substring(H,j-1).trim(),F=j,V=1,O=F,L=/@(if\s*\(|endif)/g;L.lastIndex=F;let w;while((w=L.exec(Q))!==null)if(w[1].startsWith("if"))V++;else if(w[1]==="endif"){if(V--,V===0){O=w.index+w[0].length;break}}if(V!==0)continue;let R=Q.substring(F,O-6).trim(),D;if(DQ(R)){let N=F5(Q.substring(K,O));if(N.length===0)continue;let T=N[0].branches.filter((I)=>I.type!=="else"),A=q(K);if(!(T.length>0&&T.every((I)=>X8(I.condition,X,Z,A))))continue;D=N[0].branches.map((I)=>{let y=J(I.content);if(I.type==="elseif")return L$(y,"@else-if",I.condition??"");if(I.type==="else")return L$(y,"@else");return L$(y,"@if",I.condition??"")}).join(`
3542
3542
  `)}else{if(!X8(_,X,Z,q(K)))continue;D=L$(J(R),"@if",_)}z.push({start:K,end:O,replacement:D}),U.lastIndex=O}for(let K=z.length-1;K>=0;K--){let{start:H,end:B,replacement:j}=z[K];Q=Q.substring(0,H)+j+Q.substring(B)}return Q}return J($)}function IQ($){let Z=$.trim();if(Z==="")return;if(Z==="true")return!0;if(Z==="false")return!1;if(Z==="null")return!1;if(Z==="undefined")return!1;if(Z==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(Z)){let Y=Number(Z);return Y!==0&&!Number.isNaN(Y)}let X=Z.match(/^'((?:\\.|[^'\\])*)'$/);if(X)return X[1].length>0;let J=Z.match(/^"((?:\\.|[^"\\])*)"$/);if(J)return J[1].length>0;return}var w$=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function U8($,Z,X,J){if(w$.has(X.toLowerCase()))return J;let Y=X.toLowerCase(),Q=$.toLowerCase(),G=$.length,q=1,U=J;while(U<G){let W=$.indexOf("<",U);if(W===-1)return-1;if(U=W,$.startsWith("<!--",U)){let B=$.indexOf("-->",U+4);if(B===-1)return-1;U=B+3;continue}let z=/^<(script|style)\b/i.exec($.slice(U,U+8));if(z){let B=$.indexOf(">",U);if(B===-1)return-1;if($[B-1]==="/"){U=B+1;continue}let j=Q.indexOf(`</${z[1].toLowerCase()}`,U);if(j===-1)return-1;let _=$.indexOf(">",j);if(_===-1)return-1;U=_+1;continue}if($[U+1]==="/"){let B=/^<\/([a-z][\w-]*)\s*>/i.exec($.slice(U,U+64));if(!B){U++;continue}if(B[1].toLowerCase()===Y){if(q--,U+=B[0].length,q===0)return U;continue}U+=B[0].length;continue}let K=/^<([a-z][\w-]*)\b/i.exec($.slice(U,U+64));if(!K){U++;continue}let H=$.indexOf(">",U);if(H===-1)return-1;if(K[1].toLowerCase()===Y){let B=$.slice(U,H+1);if(!(/\/\s*>$/.test(B)||w$.has(Y)))q++}U=H+1}return-1}var kQ=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function EQ($,Z){let X=Z,J=$.length;for(;;){while(X<J&&$[X]!=="<")X++;if(X>=J)return!1;if($.startsWith("<!--",X)){let G=$.indexOf("-->",X+4);if(G===-1)return!1;X=G+3;continue}break}if($[X+1]==="/")return!1;let Y=$.indexOf(">",X);if(Y===-1)return!1;let Q=$.slice(X,Y+1);return kQ.test(Q)}function W8($){if(!$.includes(":if")&&!$.includes(":show")&&!$.includes("x-if")&&!$.includes("x-show")&&!$.includes("@if=")&&!$.includes("@show="))return $;let Z=[],X=/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,J;while((J=X.exec($))!==null)Z.push([J.index,J.index+J[0].length]);let Y=(K)=>Z.some(([H,B])=>K>=H&&K<B),Q=/<([a-zA-Z][\w-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*?)\s+(:if|:show|x-if|x-show|@if|@show)\s*=\s*"([^"]*)"((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)(\/?)>/g,G=[],q;while((q=Q.exec($))!==null){if(Y(q.index))continue;let[K,H,B,j,_,F,V]=q,O=IQ(_);if(O===void 0)continue;let L=q.index,w=L+K.length,N=!!V||/\/\s*>$/.test(K)||w$.has(H.toLowerCase())?w:U8($,L,H,w);if(N===-1)continue;if((j===":if"||j==="x-if"||j==="@if")&&EQ($,N)){Q.lastIndex=w;continue}if(O===!0){let A=`<${H}${B}${F}${V}>`;G.push({start:L,end:w,replacement:A});continue}G.push({start:L,end:N,replacement:""}),Q.lastIndex=N}if(G.length===0)return $;G.sort((K,H)=>K.start-H.start);let U=[],W=-1;for(let K of G){if(K.start<W)continue;U.push(K),W=K.end}let z=$;for(let K=U.length-1;K>=0;K--){let{start:H,end:B,replacement:j}=U[K];z=z.substring(0,H)+j+z.substring(B)}return z}function z8($,Z){let X=$,J=/@(for|foreach)\s*\(/g,Y,Q=[],G=[];while((Y=J.exec(X))!==null){let q=Y[1],U=Y.index,W=U+Y[0].length,z=1,K=W;while(K<X.length&&z>0){if(X[K]==="(")z++;else if(X[K]===")")z--;K++}if(z!==0)continue;let H=X.substring(W,K-1).trim(),B=K,j=G8(H),_=q==="for"?"@endfor":"@endforeach",F=1,V=B,O=q==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${q}\\s*\\(|end${q})`,"g");O.lastIndex=B;let L;while((L=O.exec(X))!==null)if(L[1].startsWith(q))F++;else if(F--,F===0){V=L.index+L[0].length;break}if(F!==0)continue;let w=()=>{let T=[j.itemVar,j.indexVar].filter(Boolean);if(T.length)G.push({start:U,end:V,vars:T})};if(j.iterable){let T=j.iterable.trim();if(T.startsWith("[")||T.startsWith("{")||T.startsWith("'")||T.startsWith('"')||T.startsWith("`")||/^-?\d/.test(T)){w();continue}let A=T.split(/[.[(]/)[0].trim(),M=Z?A in Z:!1,E=G.some((I)=>U>I.start&&U<I.end&&I.vars.includes(A));if(A&&(M||E)){w();continue}}if(j.style==="as")H=j.indexVar?`(${j.itemVar}, ${j.indexVar}) in ${j.iterable}`:`${j.itemVar} in ${j.iterable}`;let R=X.substring(B,V-_.length).trim(),D=R.match(Q8),N;if(D){let[,T,A,M]=D;N=`<${T}${A} @for="${H}">${M}</${T}>`}else N=`<template @for="${H}">${R}</template>`;Q.push({start:U,end:V,replacement:N})}for(let q=Q.length-1;q>=0;q--){let{start:U,end:W,replacement:z}=Q[q];X=X.substring(0,U)+z+X.substring(W)}return X}function bQ($){let Z=new Set,X=[],J=0,Y=0,Q=$.length,G=(z)=>{let K=J+1;while(K<Q){let H=$[K];if(H==="\\"){K+=2;continue}if(H===z)return K+1;K++}return Q},q=()=>{let z=J+2;while(z<Q&&$[z]!==`
3543
3543
  `)z++;return z},U=()=>{let z=J+2;while(z<Q-1){if($[z]==="*"&&$[z+1]==="/")return z+2;z++}return Q},W=(z)=>{let K=z,H=0;while(K<Q){let B=$[K];if(B==="/"&&$[K+1]==="/"){let j=K+2;while(j<Q&&$[j]!==`
3544
- `)j++;K=j;continue}if(B==="/"&&$[K+1]==="*"){let j=K+2;while(j<Q-1&&!($[j]==="*"&&$[j+1]==="/"))j++;K=j+2;continue}if(B==='"'||B==="'"||B==="`"){let j=K+1;while(j<Q){if($[j]==="\\"){j+=2;continue}if($[j]===B){j++;break}j++}K=j;continue}if(B==="("||B==="["||B==="{"){H++,K++;continue}if(B===")"||B==="]"||B==="}"){H--,K++;continue}if(B===";"&&H===0)return K+1;K++}return Q};while(J<Q){let z=$[J];if(z==="/"&&$[J+1]==="/"){let K=q();X.push($.slice(J,K)),J=K;continue}if(z==="/"&&$[J+1]==="*"){let K=U();X.push($.slice(J,K)),J=K;continue}if(z==='"'||z==="'"||z==="`"){let K=G(z);X.push($.slice(J,K)),J=K;continue}if(z==="{"){Y++,X.push(z),J++;continue}if(z==="}"){Y--,X.push(z),J++;continue}if(Y===0){let K=J>0?$[J-1]:"";if(K===""||/\s/.test(K)||K===";"||K==="}"||K==="{"){let B=$.slice(J).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(B){let j=B[2],_=W(J+B[0].length);if(Z.has(j)){X.push(`/* stx: deduped const ${j} */`),J=_;continue}Z.add(j),X.push($.slice(J,_)),J=_;continue}}}X.push(z),J++}return X.join("")}async function yQ($,Z,X){let J=RQ($,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),Y=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|useCookie|useId|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,Q=[];for(let V of J){let O=V.body;if(M1(V.attrs))O=T1(O);if(Y.test(O))Q.push({fullMatch:V.fullMatch,attrs:V.attrs,content:O})}if(Q.length===0)return{output:$,setupCode:null};let G=`${Z??""}\x00${Q.map((V)=>V.content).join("\x00")}`,q=`__stx_setup_${Bun.hash(G).toString(36).slice(0,10)}`,{hasUserImports:U,bundleClientScript:W}=await o("stx/client-script-bundler",()=>import("./chunk-t68jcajf.js")),z=[];for(let V=0;V<Q.length;V++){let O=Q[V].content;if(O=A5(O).code,U(O))O=await W(O,Z||"",{projectRoot:process.cwd()});O=vQ(O);let L=t0(O);z.push(`// \u2500\u2500 merged signal script #${V+1} \u2500\u2500
3544
+ `)j++;K=j;continue}if(B==="/"&&$[K+1]==="*"){let j=K+2;while(j<Q-1&&!($[j]==="*"&&$[j+1]==="/"))j++;K=j+2;continue}if(B==='"'||B==="'"||B==="`"){let j=K+1;while(j<Q){if($[j]==="\\"){j+=2;continue}if($[j]===B){j++;break}j++}K=j;continue}if(B==="("||B==="["||B==="{"){H++,K++;continue}if(B===")"||B==="]"||B==="}"){H--,K++;continue}if(B===";"&&H===0)return K+1;K++}return Q};while(J<Q){let z=$[J];if(z==="/"&&$[J+1]==="/"){let K=q();X.push($.slice(J,K)),J=K;continue}if(z==="/"&&$[J+1]==="*"){let K=U();X.push($.slice(J,K)),J=K;continue}if(z==='"'||z==="'"||z==="`"){let K=G(z);X.push($.slice(J,K)),J=K;continue}if(z==="{"){Y++,X.push(z),J++;continue}if(z==="}"){Y--,X.push(z),J++;continue}if(Y===0){let K=J>0?$[J-1]:"";if(K===""||/\s/.test(K)||K===";"||K==="}"||K==="{"){let B=$.slice(J).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(B){let j=B[2],_=W(J+B[0].length);if(Z.has(j)){X.push(`/* stx: deduped const ${j} */`),J=_;continue}Z.add(j),X.push($.slice(J,_)),J=_;continue}}}X.push(z),J++}return X.join("")}async function yQ($,Z,X){let J=RQ($,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),Y=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|useCookie|useId|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,Q=[];for(let V of J){let O=V.body;if(M1(V.attrs))O=T1(O);if(Y.test(O))Q.push({fullMatch:V.fullMatch,attrs:V.attrs,content:O})}if(Q.length===0)return{output:$,setupCode:null};let G=`${Z??""}\x00${Q.map((V)=>V.content).join("\x00")}`,q=`__stx_setup_${Bun.hash(G).toString(36).slice(0,10)}`,{hasUserImports:U,bundleClientScript:W}=await o("stx/client-script-bundler",()=>import("./chunk-qv9azqvb.js")),z=[];for(let V=0;V<Q.length;V++){let O=Q[V].content;if(O=A5(O).code,U(O))O=await W(O,Z||"",{projectRoot:process.cwd()});O=vQ(O);let L=t0(O);z.push(`// \u2500\u2500 merged signal script #${V+1} \u2500\u2500
3545
3545
  ${L}`)}let K=z.join(`
3546
3546
 
3547
3547
  `);K=bQ(K);let H=SQ(K),B=H.split(",").map((V)=>V.trim()).filter(Boolean),j=J4(K,X),_=`
@@ -3619,9 +3619,9 @@ ${G.join(`
3619
3619
  `+Y.slice(Q)}async function T4($,Z,X,J,Y){if(J.ssr===!1&&!J.autoShell&&J.buildMode==="spa")return $;if(Z.__stx_signals_gate===void 0)Z.__stx_signals_gate=Q1($);let Q=!Z.__stxProcessingDepth;if(Q)l4(Z);if(!Z.__stxProcessingDepth)Z.__stxProcessingDepth=0;if(Z.__stxProcessingDepth++,!Z.__onceStore)Z.__onceStore=new Set;if((J.debug||!_5()&&!s5())&&X&&X.endsWith(".stx"))t8($,X);try{return await W7.timeAsync("template-processing",async()=>{let G=await _G($,Z,X,J,Y);if(Q)G=A4(G);if(Q&&J.autoShell&&J.buildMode!=="compile"){let q=J.app?.head||{},W=(Z.__stx_runtime_head||null)??a8(),z=(Z.__stx_head_raw||"").trim(),K,H=z.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(H)K=H[1].trim(),z=z.replace(H[0],"").trim();let B=Z.__sections?.title,j=W.title||K||B,_=!W.title&&(!!K||!!B),F=W.meta||[],V=new Set(F.map((N)=>o1(N)).filter(Boolean)),O={...q,...j&&{title:j},meta:[...(q.meta||[]).filter((N)=>!V.has(o1(N))),...F],link:[...q.link||[],...W.link||[]],script:[...q.script||[],...W.script||[]],headRaw:[q.headRaw,z].filter(Boolean).join(`
3620
3620
  `),...W.htmlAttrs&&{htmlAttrs:u9(q.htmlAttrs,W.htmlAttrs)},...W.bodyAttrs&&{bodyAttrs:{...q.bodyAttrs||{},...W.bodyAttrs}}},L=a3(G);if(G=c9(G,O,{..._&&{titleIsHtml:!0},...J.app?.colorMode&&{colorMode:J.app.colorMode}}),L)G=l9(G,q),G=d9(G,O.htmlAttrs);let w=G.match(/<!-- stx-layout: ([^ ]+) -->/);if(w&&G.includes("<head")){let N=w[1],T=o8(N);G=G.replace(/<head\b[^>]*>/i,(A)=>`${A}
3621
3621
  <meta name="stx-layout" content="${p8(N)}">
3622
- <meta name="stx-layout-group" content="${p8(T)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),D=R?W5(G):null;if(R&&D&&!/\bdata-stx=/.test(D.tag)){G=d5(G,(T,A)=>`<body${A} data-stx="${R[1]}">`);let N=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(N,"$1")}}if(Q){G=m9(G);let q=J.app?.colorMode;if(q)G=v9(G,q);G=x9(G),G=jG(G)}if(Q)try{let{getStoreScript:q}=await o("stx/store-loader",()=>import("./chunk-yqtc8ax6.js")),U=J.storesDir,W=await q(U);if(W){let z=`<script data-stx-stores>${W}</script>`,K=Y5(G,"data-stx-runtime");if(K)G=G.slice(0,K.end)+`
3623
- `+z+G.slice(K.end)}}catch{}if(Q)try{let{getFrameworkComposableScript:q}=await o("stx/framework-composables",()=>import("./chunk-ww9sz124.js")),U=await q(G);if(U){let W=Y5(G,"data-stx-stores")||Y5(G,"data-stx-runtime");if(W)G=G.slice(0,W.end)+`
3624
- `+U+G.slice(W.end)}}catch{}if(Q)try{let{getComposableScript:q}=await o("stx/composable-loader",()=>import("./chunk-aeyrfcn5.js")),U=J.composablesDir,W=await q(U,G);if(W){let z=`<script data-stx-composables>${W}</script>`,K=Y5(G,"data-stx-stores")||Y5(G,"data-stx-runtime");if(K)G=G.slice(0,K.end)+`
3622
+ <meta name="stx-layout-group" content="${p8(T)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),D=R?W5(G):null;if(R&&D&&!/\bdata-stx=/.test(D.tag)){G=d5(G,(T,A)=>`<body${A} data-stx="${R[1]}">`);let N=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${R[1]}"`,"i");G=G.replace(N,"$1")}}if(Q){G=m9(G);let q=J.app?.colorMode;if(q)G=v9(G,q);G=x9(G),G=jG(G)}if(Q)try{let{getStoreScript:q}=await o("stx/store-loader",()=>import("./chunk-633f58jf.js")),U=J.storesDir,W=await q(U);if(W){let z=`<script data-stx-stores>${W}</script>`,K=Y5(G,"data-stx-runtime");if(K)G=G.slice(0,K.end)+`
3623
+ `+z+G.slice(K.end)}}catch{}if(Q)try{let{getFrameworkComposableScript:q}=await o("stx/framework-composables",()=>import("./chunk-9za99vpf.js")),U=await q(G);if(U){let W=Y5(G,"data-stx-stores")||Y5(G,"data-stx-runtime");if(W)G=G.slice(0,W.end)+`
3624
+ `+U+G.slice(W.end)}}catch{}if(Q)try{let{getComposableScript:q}=await o("stx/composable-loader",()=>import("./chunk-fphzcf76.js")),U=J.composablesDir,W=await q(U,G);if(W){let z=`<script data-stx-composables>${W}</script>`,K=Y5(G,"data-stx-stores")||Y5(G,"data-stx-runtime");if(K)G=G.slice(0,K.end)+`
3625
3625
  `+z+G.slice(K.end)}}catch{}if(Q)G=f9(G);if(Q&&Z.__stx_inject_css!==!1)G=await r8(G,void 0,J.buildMode==="serve");if(Q)G=P9(G);return G=G.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),G})}catch(G){if(G instanceof a5)throw G;let q=G instanceof Error?G.message:String(G),U=new R1(`Template processing failed: ${q}`,X,void 0,void 0,$.substring(0,200)+($.length>200?"...":""));if(m0.log(U,{filePath:X,context:Z}),U3.logDetailedError(U,{filePath:X,template:$.substring(0,500)}),J.debug)throw U;return G3.createFallbackContent("Template Processing",U)}}async function _G($,Z,X,J,Y){let Q=process.cwd(),G={...J,partialsDir:J.partialsDir&&!T0.isAbsolute(J.partialsDir)?T0.resolve(Q,J.partialsDir):J.partialsDir,componentsDir:J.componentsDir&&!T0.isAbsolute(J.componentsDir)?T0.resolve(Q,J.componentsDir):J.componentsDir,layoutsDir:J.layoutsDir&&!T0.isAbsolute(J.layoutsDir)?T0.resolve(Q,J.layoutsDir):J.layoutsDir},q=G,U=$;await FG(X,Z),OG(Z,q),U=await m1(()=>O9(U,Z,X,q),U,(L)=>{m0.log(L,{filePath:X,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${X}: ${L.message}`)}),U=U.replace(/\{\{--[\s\S]*?--\}\}/g,"");let W=i0(U,q5,(L,w)=>`\x00STX_HTML_COMMENT_${w}\x00`);U=W.output;let z=W.tokens,K=(L)=>z.length===0?L:L.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(w,R)=>z[Number(R)]??""),H="\x00STX_ESCAPED_AT\x00";U=U.replace(/@@/g,H),U=U.replace(/@\{\{([\s\S]*?)\}\}/g,(L,w)=>{return`{{ ${w} }}`}),U=M9(U),U=await u8(U,X,Y);let B={};U=d3(U,B);let j={...Z.__sections||{}},_="",F=M7(A7($)),V=/@nolayout\b/.test(U)||F===!1;if(/@nolayout\b/.test(U))U=U.replace(/@nolayout\b\s*/g,"");let O=U.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(O)_=O[1],U=U.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof F==="string"){if(_=F,!/@section\s*\(/.test(U))U=`@section('content')
3626
3626
  ${U.trim()}
3627
3627
  @endsection`}if(!_&&!V&&q.defaultLayout){let L=r3(U),w=/@section\s*\(/.test(U);if(!L||w){let R="",D=T0.dirname(X),N=q.layoutsDir?T0.dirname(q.layoutsDir):process.cwd();for(let T=0;T<20;T++){let A=T0.join(D,"_layout.stx");if(await a(A)){R=A;break}let M=T0.dirname(D);if(M===D||M.length<N.length)break;D=M}if(R)_=R;else if(q.layoutsDir){let T=T0.isAbsolute(q.layoutsDir)?q.layoutsDir:T0.resolve(process.cwd(),q.layoutsDir),A=T0.join(T,`${q.defaultLayout}.stx`);if(await a(A))_=A}if(_&&!w)U=`@section('content')
@@ -3629,7 +3629,7 @@ ${U.trim()}
3629
3629
  @endsection`}}if(U=U.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(L,w,R)=>{return j[w]=R,""}),U=U.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(L,w,R)=>{if(/^(['"]).*\1$/.test(R.trim()))return L;try{let D=t(R.trim(),Z);if(D===void 0)return L;return j[w]=String(D??""),""}catch{return L}}),U=U.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(L,w,R)=>{if(R.includes("@parent"))j[w]=R.replace("@parent",y1);else j[w]=R.trim();return""}),Z.__sections=j,U=U.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(L,w,R)=>{return j[w]||R||""}),!("slot"in Z)||Z.slot===void 0)U=U.replace(/\{\{\s*slot\s*\}\}/g,()=>{return j.content||""});if(U=m3(U,B),_){let L=[],w=n0(U),R=i0(w.output,v1,(D,N)=>`\x00STX_ORPHAN_STYLE_${N}\x00`);if(U=R.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(D,N,T)=>{let A=N==="SCRIPT"?w.scripts[Number(T)]:R.tokens[Number(T)];if(A)L.push(A);return""}),L.length>0){let D=L.join(`
3630
3630
  `);j.content=j.content?`${j.content}
3631
3631
  ${D}`:D,Z.__sections=j}}if(_)try{let L;if(T0.isAbsolute(_))L=_,Y.add(_);else L=await m1(()=>$$(_,X,G,Y),null,()=>{throw new R1(`Failed to resolve layout path: ${_}`,X,void 0,void 0,`Layout referenced from ${X}`)});if(!L){let A=(I)=>{if(!I)return[];try{let y=T0.isAbsolute(I)?I:T0.resolve(process.cwd(),I);return HG.readdirSync(y).filter((k)=>k.endsWith(".stx")).map((k)=>k.replace(/\.stx$/,""))}catch{return[]}},M=[...A(G.layoutsDir),...A(G.fallbackLayoutsDir)].filter((I,y,k)=>k.indexOf(I)===y).sort(),E=`Layout not found: ${_} (referenced from ${X})`+(M.length>0?`. Available layouts: ${M.join(", ")}`:G.layoutsDir?`. No .stx layouts found in ${G.layoutsDir}`:"");if(m0.log(Error(E),{layoutPath:_,filePath:X,available:M},"error"),console.error(`[stx] ${E}`),G.debug)throw new R1(E,X);return U}let w=await m1(()=>Bun.file(L).text(),"",()=>{throw new R1(`Failed to read layout file: ${L}`,X,void 0,void 0,"Layout content could not be loaded")}),R=w.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(R){if(G.debug)console.log(`Found nested layout: ${R[1]} in ${L}`);let A={},M=w.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(y,k,b)=>{return A[k]=b.trim(),""});for(let[y,k]of Object.entries(A))if(j[y]&&j[y].includes(y1)){let b=j[y].indexOf(y1);j[y]=j[y].slice(0,b)+k+j[y].slice(b+y1.length)}else if(!j[y])j[y]=k;let E={...Z,__sections:j},I=`@layout('${R[1]}')${M}`;return await T4(I,E,L,G,Y)}let D=w.replace(/\{\{--[\s\S]*?--\}\}/g,""),N=d3(D,B),T={};return N=N.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(A,M,E)=>{return T[M]=E.trim(),`@slot('${M}')`}),N=N.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(A,M,E)=>{if(j[M]){let I=j[M];if(I.includes(y1)){let y=T[M]||"",k=I.indexOf(y1);I=I.slice(0,k)+y+I.slice(k+y1.length)}return I}return E||""}),N=VG(N,j),N=N.replace(/\{\{\s*slot\s*\}\}/g,()=>{return j.content||""}),N=m3(N,B),Z.__originalFilePath=X,U=await n8(N,Z,L,G,Y),U=`<!-- stx-layout: ${_} -->
3632
- ${U}`,K(U)}catch(L){return m0.log(L instanceof Error?L:Error(String(L)),{layoutPath:_,filePath:X},"error"),`[Error processing layout: ${L instanceof Error?L.message:String(L)}]`}return K(await n8(U,Z,X,G,Y))}function VG($,Z){return $.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(X,J,Y)=>{let Q=Z[J];if(Q!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(Q))return Q}return Y||""})}function OG($,Z){if($.__stx_sfc_mode=!0,$.__stx_options=Z,Z.buildMode)$.__stx_buildMode=Z.buildMode;let X=Z.envPrefix||"STX_PUBLIC_",J={};for(let[Y,Q]of Object.entries(process.env))if(Y.startsWith(X)&&Q!==void 0)J[Y]=Q;$.$env=J}async function FG($,Z){await m1(()=>w9($,Z),void 0,(X)=>{m0.log(X,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${X.message}`)})}async function LG($,Z,X){let J=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Y;while((Y=J.exec($))!==null){let Q=Y[1],G=Y[2];if(!/\bserver\b/.test(Q)||!G.trim())continue;try{let{extractVariables:U}=await o("stx/variable-extractor",()=>import("./chunk-tdj3gqaa.js"));await U(G,Z,X,{preserveExisting:!0})}catch(U){let W=U instanceof Error?U:Error(String(U));m0.log(W,{filePath:X,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${X}: ${W.message}`)}}}async function wG($,Z,X){try{let{interpolateScriptsInTemplate:J}=await o("stx/expressions",()=>import("./chunk-cv0z0qpy.js"));return J($,Z,{skipServer:!0})}catch(J){let Y=J instanceof Error?J:Error(String(J));return m0.log(Y,{filePath:X,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${X}: ${Y.message}`),$}}async function n8($,Z,X,J,Y){let Q=$,G=J;if(await LG(Q,Z,X),Q=await wG(Q,Z,X),Q=await Y9(Q,Z,X),Q=await Q9(Q,Z,X),Q=await d6(Q,Z,X,G),Q1(Q))Q=q8(Q,Z),Q=z8(Q,Z);Q=W8(Q);let{processStreamDirectives:q}=await o("stx/streaming",()=>import("./chunk-q253eftn.js"));Q=q(Q,Z),Q=H9(Q,Z,X,G),Q=await E9(Q,Z,X,G,Y),Q=await R4(Q,Z,X,G,Y),Q=N7(Q,Z,X,G);let{processDeferDirectives:U}=await o("stx/defer",()=>import("./chunk-js0r6bc9.js"));Q=U(Q,Z,X);let{processTeleportDirectives:W}=await o("stx/teleport",()=>import("./chunk-ttmtwp1x.js"));Q=W(Q,Z,X);let{processTransitionDirectives:z,processTransitionAttributes:K}=await o("stx/transitions",()=>import("./chunk-xkeyq622.js"));Q=z(Q,Z,X),Q=K(Q);let{processErrorBoundaryDirectives:H}=await o("stx/error-boundaries",()=>import("./chunk-35ezbs7m.js"));Q=H(Q,Z,X);let{processSuspenseDirectives:B}=await o("stx/suspense",()=>import("./chunk-mgexc8xe.js"));Q=B(Q,Z,X);let{processAsyncDirectives:j}=await o("stx/async-components",()=>import("./chunk-hjdqejae.js"));Q=j(Q,Z,X);let{processKeepAliveDirectives:_}=await o("stx/keep-alive",()=>import("./chunk-81zcv66r.js"));Q=_(Q,Z,X);let{processVirtualListDirectives:F,processVirtualGridDirectives:V,processInfiniteListDirectives:O}=await o("stx/virtual-scrolling",()=>import("./chunk-gjapb8k6.js"));Q=F(Q,Z,X),Q=V(Q,Z,X),Q=O(Q,Z,X);let{processPartialHydrationDirectives:L,processStaticDirectives:w}=await o("stx/partial-hydration",()=>import("./chunk-znjrab9a.js"));Q=L(Q,Z,X),Q=w(Q);let{processComputedDirectives:R,processWatchDirectives:D}=await o("stx/computed",()=>import("./chunk-fgfb9fs0.js"));Q=R(Q,Z,X),Q=D(Q,Z,X);let{processFormValidationDirectives:N}=await o("stx/forms-validation",()=>import("./chunk-6k94kwfr.js"));Q=N(Q,Z,X);let{processHeadDirective:T,processTitleDirective:A,processMetaDirective:M,resetHead:E}=await o("stx/head",()=>import("./chunk-v80629x2.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)E();let I=T(Q);if(Q=I.content,I.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${I.headContent}
3632
+ ${U}`,K(U)}catch(L){return m0.log(L instanceof Error?L:Error(String(L)),{layoutPath:_,filePath:X},"error"),`[Error processing layout: ${L instanceof Error?L.message:String(L)}]`}return K(await n8(U,Z,X,G,Y))}function VG($,Z){return $.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(X,J,Y)=>{let Q=Z[J];if(Q!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(Q))return Q}return Y||""})}function OG($,Z){if($.__stx_sfc_mode=!0,$.__stx_options=Z,Z.buildMode)$.__stx_buildMode=Z.buildMode;let X=Z.envPrefix||"STX_PUBLIC_",J={};for(let[Y,Q]of Object.entries(process.env))if(Y.startsWith(X)&&Q!==void 0)J[Y]=Q;$.$env=J}async function FG($,Z){await m1(()=>w9($,Z),void 0,(X)=>{m0.log(X,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${X.message}`)})}async function LG($,Z,X){let J=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Y;while((Y=J.exec($))!==null){let Q=Y[1],G=Y[2];if(!/\bserver\b/.test(Q)||!G.trim())continue;try{let{extractVariables:U}=await o("stx/variable-extractor",()=>import("./chunk-bbymgcwp.js"));await U(G,Z,X,{preserveExisting:!0})}catch(U){let W=U instanceof Error?U:Error(String(U));m0.log(W,{filePath:X,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${X}: ${W.message}`)}}}async function wG($,Z,X){try{let{interpolateScriptsInTemplate:J}=await o("stx/expressions",()=>import("./chunk-wz81m0kv.js"));return J($,Z,{skipServer:!0})}catch(J){let Y=J instanceof Error?J:Error(String(J));return m0.log(Y,{filePath:X,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${X}: ${Y.message}`),$}}async function n8($,Z,X,J,Y){let Q=$,G=J;if(await LG(Q,Z,X),Q=await wG(Q,Z,X),Q=await Y9(Q,Z,X),Q=await Q9(Q,Z,X),Q=await d6(Q,Z,X,G),Q1(Q))Q=q8(Q,Z),Q=z8(Q,Z);Q=W8(Q);let{processStreamDirectives:q}=await o("stx/streaming",()=>import("./chunk-vfnv1r93.js"));Q=q(Q,Z),Q=H9(Q,Z,X,G),Q=await E9(Q,Z,X,G,Y),Q=await R4(Q,Z,X,G,Y),Q=N7(Q,Z,X,G);let{processDeferDirectives:U}=await o("stx/defer",()=>import("./chunk-js0r6bc9.js"));Q=U(Q,Z,X);let{processTeleportDirectives:W}=await o("stx/teleport",()=>import("./chunk-ttmtwp1x.js"));Q=W(Q,Z,X);let{processTransitionDirectives:z,processTransitionAttributes:K}=await o("stx/transitions",()=>import("./chunk-xkeyq622.js"));Q=z(Q,Z,X),Q=K(Q);let{processErrorBoundaryDirectives:H}=await o("stx/error-boundaries",()=>import("./chunk-35ezbs7m.js"));Q=H(Q,Z,X);let{processSuspenseDirectives:B}=await o("stx/suspense",()=>import("./chunk-mgexc8xe.js"));Q=B(Q,Z,X);let{processAsyncDirectives:j}=await o("stx/async-components",()=>import("./chunk-hjdqejae.js"));Q=j(Q,Z,X);let{processKeepAliveDirectives:_}=await o("stx/keep-alive",()=>import("./chunk-81zcv66r.js"));Q=_(Q,Z,X);let{processVirtualListDirectives:F,processVirtualGridDirectives:V,processInfiniteListDirectives:O}=await o("stx/virtual-scrolling",()=>import("./chunk-gjapb8k6.js"));Q=F(Q,Z,X),Q=V(Q,Z,X),Q=O(Q,Z,X);let{processPartialHydrationDirectives:L,processStaticDirectives:w}=await o("stx/partial-hydration",()=>import("./chunk-znjrab9a.js"));Q=L(Q,Z,X),Q=w(Q);let{processComputedDirectives:R,processWatchDirectives:D}=await o("stx/computed",()=>import("./chunk-fgfb9fs0.js"));Q=R(Q,Z,X),Q=D(Q,Z,X);let{processFormValidationDirectives:N}=await o("stx/forms-validation",()=>import("./chunk-6k94kwfr.js"));Q=N(Q,Z,X);let{processHeadDirective:T,processTitleDirective:A,processMetaDirective:M,resetHead:E}=await o("stx/head",()=>import("./chunk-v80629x2.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)E();let I=T(Q);if(Q=I.content,I.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${I.headContent}
3633
3633
  `;if(Q=A(Q,Z),Q=M(Q,Z),Q=L9(Q),Q=R3(Q,Z),Q=u6(Q),Q=_9(Q),Q=await u3(Q,Z,X,G,Y),Q=await R4(Q,Z,X,G,Y),Z.__stxProcessingDepth===1)Q=p4(Q,Z);if(Q=Q.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),Q=A4(Q),Q=$1(Q,Z,X),Q=I7(Q,Z,{filePath:X,buildMode:G.buildMode}),Q=D3(Q,Z),Q=N3(Q,Z),Q=R5(Q,Z),Q=b3(Q,Z),Q=y3(Q,Z),Q=await I6(Q,Z,X,G),Q=await P7(Q,Z,X),Q=await t6(Q,Z,X,G),Q=s8(Q,Z,X,G),Q=H6(Q,Z,X,G),Q=B6(Q,Z,X),Q=j6(Q,Z,X,G),Q=g6(Q,Z,X,G),Q=D4(Q,Z),Q=N4(Q),Q=d8(Q),!G.skipEventDirectives)Q=d4(Q,Z,X);if(Q=b7(Q,Z,X),G.debug){let i=/\bx-data\s*=/.test(Q),Z0=Y4($);if(i&&Z0)console.warn(`[stx] ${X}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
3634
3634
  Both work on the same page, but they manage separate scopes.
3635
3635
  Prefer signals (state/derived/effect) for new components.`)}Q=N9(Q,Z),Q=await O1(Q,Z,X),Q=l8(Q),Q=c8(Q),Q=_7(Q);let{processXElementDirectives:y}=await o("stx/x-element",()=>import("./chunk-17kxd17m.js"));Q=y(Q);let k=Z.__originalFilePath||X,b=I$(Z);if(Q=await K8(Q,G,k,b),Q=p6(Q,Z),Q=await F9(Q,Z,X,G),G.media?.image?.autoSiblings){let i=G.publicDir||"public",{rewriteImagesWithSiblings:Z0}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-s9669ak6.js"));Q=await Z0(Q,{publicDir:i})}if(G.seo?.enabled)Q=_6(Q,Z,G);let C=(i,Z0,J0=!0)=>{if(!Z0)return i;let A0=Z0.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),O0=i.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(A0&&O0){if(J0)i=i.replace(O0[0],A0[0]);if(Z0=Z0.replace(A0[0],"").trim(),!Z0)return i}if(/<\/head>/i.test(i))return i.replace(/<\/head>/i,`${Z0}
@@ -3643,7 +3643,7 @@ ${H7()}
3643
3643
  `+B1}else Q=Q.replace("</head>",`${Z0}
3644
3644
  </head>`)}else if(Q.includes("<body"))Q=Q.replace(/<body([^>]*)>/,`<body$1>
3645
3645
  ${Z0}`);else Q=Z0+`
3646
- `+Q}{let{scanScriptTags:i}=await o("stx/signal-processing",()=>import("./chunk-33zg81y6.js")),Z0=[];for(let J0 of i(Q)){if(!/\bserver\b/i.test(J0.attrs))continue;let A0=J0.start+J0.fullMatch.indexOf(">")+1,O0=BG(Q,A0);if(O0===-1)continue;let p0=O0+9;while(p0<Q.length&&/\s/.test(Q[p0]))p0++;Z0.push({start:J0.start,end:p0})}for(let J0=Z0.length-1;J0>=0;J0--){let{start:A0,end:O0}=Z0[J0];Q=Q.substring(0,A0)+Q.substring(O0)}}let y0=j$(Q,X);if(y0.hasScoped)Q=y0.html;let q0=Z.__stx_event_bindings||[],X0=!1,N0=[],K0=/\s:[a-z][\w.-]*\s*=/.test(Q),{scanScriptTags:G5}=await o("stx/signal-processing",()=>import("./chunk-33zg81y6.js"));for(let i of G5(Q,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))N0.push({match:i.fullMatch,attrs:i.attrs,content:i.body});for(let{match:i,attrs:Z0,content:J0}of N0){X0=!0;let A0=J0;M4(J0,X,J.strict,Z.__originalFilePath);let O0=await k$(J0,{eventBindings:q0,attrs:Z0,hasColonDirectives:K0,templateContent:$,filePath:X,projectRoot:process.cwd(),production:J.buildMode==="compile",serverData:b});Q=Q.replace(i,()=>O0)}if(X0)Z.__stx_event_bindings=[];if(!X0&&Z.__stxProcessingDepth===1){let i=Z.__stx_event_bindings||[];if(i.length>0){let Z0=C$(i);if(Z0){let J0=Q.lastIndexOf("</body>");Q=J0===-1?Q+Z0:Q.slice(0,J0)+Z0+`
3646
+ `+Q}{let{scanScriptTags:i}=await o("stx/signal-processing",()=>import("./chunk-rrwx8e79.js")),Z0=[];for(let J0 of i(Q)){if(!/\bserver\b/i.test(J0.attrs))continue;let A0=J0.start+J0.fullMatch.indexOf(">")+1,O0=BG(Q,A0);if(O0===-1)continue;let p0=O0+9;while(p0<Q.length&&/\s/.test(Q[p0]))p0++;Z0.push({start:J0.start,end:p0})}for(let J0=Z0.length-1;J0>=0;J0--){let{start:A0,end:O0}=Z0[J0];Q=Q.substring(0,A0)+Q.substring(O0)}}let y0=j$(Q,X);if(y0.hasScoped)Q=y0.html;let q0=Z.__stx_event_bindings||[],X0=!1,N0=[],K0=/\s:[a-z][\w.-]*\s*=/.test(Q),{scanScriptTags:G5}=await o("stx/signal-processing",()=>import("./chunk-rrwx8e79.js"));for(let i of G5(Q,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))N0.push({match:i.fullMatch,attrs:i.attrs,content:i.body});for(let{match:i,attrs:Z0,content:J0}of N0){X0=!0;let A0=J0;M4(J0,X,J.strict,Z.__originalFilePath);let O0=await k$(J0,{eventBindings:q0,attrs:Z0,hasColonDirectives:K0,templateContent:$,filePath:X,projectRoot:process.cwd(),production:J.buildMode==="compile",serverData:b});Q=Q.replace(i,()=>O0)}if(X0)Z.__stx_event_bindings=[];if(!X0&&Z.__stxProcessingDepth===1){let i=Z.__stx_event_bindings||[];if(i.length>0){let Z0=C$(i);if(Z0){let J0=Q.lastIndexOf("</body>");Q=J0===-1?Q+Z0:Q.slice(0,J0)+Z0+`
3647
3647
  `+Q.slice(J0)}Z.__stx_event_bindings=[]}}if(!r9(Q)&&a9(Q))Q=await F$(Q,G);if(Q=t9(Q),G.csp?.enabled&&G.csp.useNonce&&typeof Z.cspNonce==="string")Q=x6(Q,Z.cspNonce);return Q}var RG=[{open:"@if",close:"@endif",name:"if"},{open:"@unless",close:"@endunless",name:"unless"},{open:"@foreach",close:"@endforeach",name:"foreach"},{open:"@for",close:"@endfor",name:"for"},{open:"@while",close:"@endwhile",name:"while"},{open:"@forelse",close:"@endforelse",name:"forelse"},{open:"@switch",close:"@endswitch",name:"switch"},{open:"@isset",close:"@endisset",name:"isset"},{open:"@empty",close:"@endempty",name:"empty"},{open:"@auth",close:"@endauth",name:"auth"},{open:"@guest",close:"@endguest",name:"guest"},{open:"@can",close:"@endcan",name:"can"},{open:"@cannot",close:"@endcannot",name:"cannot"},{open:"@section",close:"@endsection",name:"section",altClose:"@show"},{open:"@push",close:"@endpush",name:"push"},{open:"@prepend",close:"@endprepend",name:"prepend"},{open:"@once",close:"@endonce",name:"once"},{open:"@markdown",close:"@endmarkdown",name:"markdown"},{open:"@component",close:"@endcomponent",name:"component"}],DG=[{pattern:/@if\s*[^(]/,message:"@if directive missing parentheses",suggestion:"Use @if(condition)"},{pattern:/@foreach\s*[^(]/,message:"@foreach directive missing parentheses",suggestion:"Use @foreach(items as item)"},{pattern:/@foreach\([^)]*\)\s*[^@\n<]/,message:"@foreach may have content on same line",suggestion:"Put content on new line after @foreach()"},{pattern:/@include\s*[^(]/,message:"@include directive missing parentheses",suggestion:"Use @include('partial-name')"},{pattern:/@extends\s*[^(]/,message:"@extends directive missing parentheses",suggestion:"Use @extends('layout-name') or @layout('layout-name')"},{pattern:/@layout\s*[^(]/,message:"@layout directive missing parentheses",suggestion:"Use @layout('layout-name')"}],NG=[{pattern:/\{\{\s*constructor\s*\}\}/,message:"Attempting to access constructor property"},{pattern:/\{\{\s*__proto__\s*\}\}/,message:"Attempting to access __proto__ property"},{pattern:/\{\{\s*eval\s*\(/,message:"Attempting to use eval in expression"}];function AG($){let Z=[],X=[];return MG($,Z),TG($,Z,X),IG($,X),kG($,Z),{valid:Z.length===0,errors:Z,warnings:X}}function MG($,Z){let X=($.match(/\{\{/g)||[]).length,J=($.match(/\}\}/g)||[]).length;if(X!==J)Z.push({type:"expression",message:`Unclosed expression brackets: found ${X} opening '{{' and ${J} closing '}}'`,suggestion:"Ensure every {{ has a matching }}"})}function TG($,Z,X){for(let J of RG){let Y=new RegExp(`${J.open}(?:\\s|\\()`,"g"),Q=new RegExp(J.close,"g"),G=($.match(Y)||[]).length,q=($.match(Q)||[]).length;if(J.altClose){let U=new RegExp(J.altClose,"g");q+=($.match(U)||[]).length}if(G>q)Z.push({type:"directive",message:`Unclosed @${J.name} directive: found ${G} opening and ${q} closing`,suggestion:`Add ${G-q} missing ${J.close} tag(s)`});else if(q>G)X.push({type:"directive",message:`Extra ${J.close} found: ${q-G} more closing than opening`,suggestion:`Check for orphaned ${J.close} tags`})}}function IG($,Z){for(let X of DG)if(X.pattern.test($))Z.push({type:"syntax",message:X.message,suggestion:X.suggestion})}function kG($,Z){for(let X of NG)if(X.pattern.test($))Z.push({type:"expression",message:`Security warning: ${X.message}`,suggestion:"Remove dangerous code from template expressions"})}function EG($,Z){let X=$.slice(0,Z).split(`
3648
3648
  `);return{line:X.length,column:X[X.length-1].length+1}}function bG($,Z,X){let J=[];switch($){case"if":case"elseif":case"unless":if(X.length===0)J.push({type:"syntax",message:`@${$} requires a condition`,suggestion:`Use @${$}(condition)`});break;case"foreach":if(X.length===0||!X[0].includes(" as "))J.push({type:"syntax",message:'@foreach requires "items as item" syntax',suggestion:"Use @foreach(items as item) or @foreach(items as key => value)"});break;case"for":if(X.length===0)J.push({type:"syntax",message:"@for requires loop parameters",suggestion:"Use @for(let i = 0; i < 10; i++)"});break;case"switch":if(X.length===0)J.push({type:"syntax",message:"@switch requires an expression",suggestion:"Use @switch(expression)"});break;case"case":if(X.length===0)J.push({type:"syntax",message:"@case requires a value",suggestion:"Use @case(value)"});break;case"include":case"extends":case"component":if(X.length===0)J.push({type:"syntax",message:`@${$} requires a path`,suggestion:`Use @${$}('path/to/template')`});break}return J}function yG($){return/@[a-z]+/i.test($)||/\{\{/.test($)}function SG($){let Z=$.matchAll(/@([a-z]+)/gi),X=new Set;for(let J of Z){let Y=J[1].toLowerCase();if(!Y.startsWith("end"))X.add(Y)}return Array.from(X)}import r0 from"path";import Q5 from"process";var G2=["module","exports","require","props","$props","defineProps","withDefaults","defineClientPayload","state","derived","effect","batch","onMount","onDestroy","definePageMeta","useRoute","useRouter","useHead","useSeoMeta","setResponseStatus","setResponseHeader","notFound","ref","reactive","computed","watch","onMounted","onUnmounted","nextTick","defineEmits","defineExpose","defineSlots","provide","inject","useColorMode","useDark","useMediaQuery","useScrollLock","usePreferredDark","usePreferredLight","usePreferredReducedMotion","usePreferredContrast","window","document","console","confirm","alert","fetch","params"],e8=new Set(G2),CG=new Set(["props","$props","defineProps"]),PG=new Set(["stx","@stacksjs/stx"]);function vG($){let Z=[],X=0,J=$.split(`
3649
3649
  `);for(let Y of J){let Q=X,G=null,q=!1;for(let U=0;U<Y.length;U++){let W=Y[U];if(q){q=!1;continue}if(W==="\\"){q=!0;continue}if(G){if(W===G)G=null;continue}if(W==="'"||W==='"'||W==="`"){G=W;continue}if(W==="/"&&U+1<Y.length&&Y[U+1]==="/")break;if(W==="{")X++;else if(W==="}")X--}if(Q===0){let U=Y.match(/(?:const|let|var)\s+(\w+)\s*=/);if(U)Z.push(U[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(Y)){let W=Y.match(/(?:const|let|var)\s+(\w+)/);if(W)Z.push(W[1])}else{let W=Y.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(W){let K=W[1].slice(1,-1).split(",").map((H)=>{let B=H.split(":");return(B.length>1?B[1]:B[0]).trim()}).filter((H)=>/^\w+$/.test(H));Z.push(...K)}}}}return[...new Set(Z)]}function fG($){let Z=$;Z=Z.replace(/^\s*import\s+.*?from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Z=Z.replace(/^\s*import\s+['"][^'"]+['"]\s*;?\s*$/gm,""),Z=Z.replace(/^\s*interface\s+\w+\s*\{[\s\S]*?\n\}\s*$/gm,""),Z=Z.replace(/^\s*type\s+\w+\s*=[\s\S]*?(?=\n(?:const|let|var|function|export|interface|type|$))/gm,""),Z=Z.replace(/^(\s*(?:export\s+)?(?:const|let|var)\s+)(\w+|\{[^}]+\}|\[[^\]]+\])\s*:\s*[^=]+(\s*=)/gm,"$1$2$3");function X(J){if(!J.includes(":"))return J;let Y=[],Q="",G=0,q=0,U=null;for(let W=0;W<J.length;W++){let z=J[W];if(U){if(Q+=z,z===U)U=null;continue}if(z==='"'||z==="'"||z==="`"){U=z,Q+=z;continue}if(z==="<")G++;else if(z===">"&&G>0)G--;else if(z==="(")q++;else if(z===")")q--;if(z===","&&G===0&&q===0){Y.push(Q),Q="";continue}Q+=z}if(Q)Y.push(Q);return Y.map((W)=>{let z=W.trim(),K=z.startsWith("..."),H=K?z.slice(3):z,B=-1,j=0;for(let R=0;R<H.length;R++)if(H[R]==="<")j++;else if(H[R]===">")j--;else if(H[R]===":"&&j===0){B=R;break}if(B===-1)return W;let F=H.substring(0,B).trim().replace(/\?$/,""),V=H.substring(B+1),O=-1,L=0;for(let R=0;R<V.length;R++)if(V[R]==="<")L++;else if(V[R]===">")L--;else if(V[R]==="="&&L===0){O=R;break}let w=K?"...":"";if(O!==-1)return`${w}${F} = ${V.substring(O+1).trim()}`;return`${w}${F}`}).join(", ")}Z=Z.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(J,Y,Q)=>{if(!Q.includes(":"))return J;return`${Y}(${X(Q)})`});{let J=/\b(function\s+\w*\s*)\(/g,Y,Q=[];while((Y=J.exec(Z))!==null){let G=Y.index+Y[0].length-1,q=1,U=G+1,W=0,z=null;while(U<Z.length&&q>0){let B=Z[U];if(z){if(B===z)z=null;U++;continue}if(B==='"'||B==="'"||B==="`"){z=B,U++;continue}if(B==="<")W++;else if(B===">"&&W>0)W--;else if(W===0){if(B==="(")q++;else if(B===")")q--}if(q>0)U++}if(q!==0)continue;let K=Z.substring(G+1,U);if(!K.includes(":"))continue;let H=X(K);Q.push({start:G+1,end:U,replacement:H})}for(let G=Q.length-1;G>=0;G--){let{start:q,end:U,replacement:W}=Q[G];Z=Z.substring(0,q)+W+Z.substring(U)}}return Z=Z.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(J,Y)=>{if(!Y.includes(":"))return J;if(Y.includes("{")||Y.includes("}"))return J;return`(${Y.split(",").map((G)=>{let[q,...U]=G.split("="),W=q.split(":")[0].trim();if(U.length>0)return`${W} = ${U.join("=").trim()}`;return W}).join(", ")}) =>`}),Z=Z.replace(/(\))\s*:\s*([A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined)(?:<[^>]+>)?(?:\s*\|\s*(?:[A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined))*\s*(\{)/g,"$1$3"),Z=Z.replace(/(\b(?:function|class|interface|type|extends|implements)\s+\w+)\s*<[^<>()]*>/g,"$1"),Z=Z.replace(/(\b(?:defineProps|withDefaults|defineEmits|defineSlots|Array|Promise|Map|Set|Record|Partial|Required|Readonly|Pick|Omit|Exclude|Extract))\s*<[^<>()]*>/g,"$1"),Z=Z.replace(/(\w+)\s*<[A-Z][^<>()]*>\s*(?=\()/g,"$1"),Z=Z.replace(/\s+as\s+(?:const|[A-Za-z]\w*(?:\[\])?(?:\s*\|\s*\w+(?:\[\])?)*)/g,""),Z=Z.replace(/\s+satisfies\s+\w+(?:<[^>]*>)?/g,""),Z=Z.replace(/(\w|\)|\])\s*!(?!=)/g,"$1"),Z=Z.replace(/^\s*(?:export\s+)?(?:const\s+)?enum\s+\w+\s*\{[^}]*\}\s*$/gm,""),Z=Z.replace(/(?<=[\s=,(])<[A-Z]\w*(?:\[\])?>/g,""),Z=Z.replace(/\n\s*\n\s*\n/g,`
@@ -3665,11 +3665,11 @@ ${$[W]}`,W++;else break}return U=U.trim().replace(/;$/,""),{type:Q,name:G,value:
3665
3665
  ${Q}`,Y++}while(Y<$.length){let Q=$[Y].trim();if(Q.startsWith(".")||Q.startsWith("?."))J+=`
3666
3666
  ${$[Y]}`,Y++;else break}return{value:J,nextIndex:Y}}function iG($,Z,X){let J=X,Y=Z+1;while(Y<$.length){let Q=K2(J);if(Q!==-1){if(B0(J,"{","}",Q)!==-1)break}let G=$[Y];J+=`
3667
3667
  ${G}`,Y++}return{functionCode:J,nextIndex:Y}}function Y2($,Z){let X=t($,Z)??t(`(${$})`,Z);if(X!==void 0)return X;if(!/\bprocess\b/.test($))return;let J={...Z,process:Object.freeze({env:{...Q5.env}})};try{return Function(...Object.keys(J),`'use strict'; return (${$});`)(...Object.values(J))}catch{try{return Function(...Object.keys(J),`'use strict'; return ${$};`)(...Object.values(J))}catch{return}}}async function nG($,Z,X){let J=$.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let Q of J){let[,,G,q]=Q;try{let U=q.trim().replace(/;$/,""),W=Y2(U,Z);if(W!==void 0)Z[G]=W}catch(U){console.warn(`Failed to parse export ${G} in fallback:`,U)}}let Y=$.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let Q of Y){let[,,G,q]=Q;if(!(G in Z))try{let U=q.trim().replace(/;$/,""),W=Y2(U,Z);if(W!==void 0)Z[G]=W}catch{}}}function sG($){let Z=$.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),X=Z?Z[1]:"",J=Z?$.replace(/<script\b[^>]*>[\s\S]*?<\/script>/i,""):$;return{scriptContent:X,templateWithoutScript:J}}function oG($){let Z=$.trim();if(!Z)return!1;return/(?:const|let|var|function)\s+\w+/.test(Z)}var E5=new F1(500),b$=new F1(1000),E4=new F1(2000);function aG($){let Z=new WeakSet;try{let X=(J)=>{if(J===void 0)return{__stxType:"undefined"};if(typeof J==="bigint")return{__stxType:"bigint",value:J.toString()};if(typeof J==="function"||typeof J==="symbol")throw TypeError("Non-serializable component input");if(J===null||typeof J!=="object")return J;if(Z.has(J))throw TypeError("Circular component input");if(Z.add(J),J instanceof Date)return{__stxType:"date",value:J.toISOString()};if(Array.isArray(J))return J.map(X);let Y={};for(let Q of Object.keys(J).sort())Y[Q]=X(J[Q]);return Y};return JSON.stringify(X($))}catch{return null}}function H2($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function tG($){return/\bjs\b/.test($)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test($)}function M1($){return!tG($)}var E$=new Map;function k4($){let Z;try{Z=JSON.stringify($)}catch{return new Bun.Transpiler($)}let X=E$.get(Z);if(X)return X;if(E$.size>=16)E$.clear();let J=new Bun.Transpiler($);return E$.set(Z,J),J}function T1($){try{let Z=$.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");Z=Z.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");let X=[];Z=Z.replace(/\{!![\s\S]*?!!\}/g,(Q)=>{let G=X.length;return X.push(Q),`"__STX_EXPR_${G}__"`}),Z=Z.replace(/\{\{\{[\s\S]*?\}\}\}/g,(Q)=>{let G=X.length;return X.push(Q),`"__STX_EXPR_${G}__"`}),Z=Z.replace(/\{\{[\s\S]*?\}\}/g,(Q)=>{let G=X.length;return X.push(Q),`"__STX_EXPR_${G}__"`});let Y=k4({loader:"ts",target:"browser",define:X5()}).transformSync(Z);for(let Q=0;Q<X.length;Q++)Y=Y.replace(`"__STX_EXPR_${Q}__"`,X[Q]),Y=Y.replace(`'__STX_EXPR_${Q}__'`,X[Q]);return Y}catch(Z){if(process.env.STX_DEBUG_TS)console.warn("[STX] TypeScript transpilation error:",Z);return $}}function eG($){let Z=[],X=new Set,J=0,Y=0,Q=$.length,G=(z)=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]===z){Y++;return}Y++}},q=()=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]==="`"){Y++;return}if($[Y]==="$"&&$[Y+1]==="{"){Y+=2;let z=1;while(Y<Q&&z>0)if($[Y]==="{")z++,Y++;else if($[Y]==="}")z--,Y++;else if($[Y]==="'"||$[Y]==='"')G($[Y]);else if($[Y]==="`")q();else Y++;continue}Y++}},U=()=>{if($[Y]==="/"&&$[Y+1]==="/"){while(Y<Q&&$[Y]!==`
3668
- `)Y++;return!0}if($[Y]==="/"&&$[Y+1]==="*"){Y+=2;while(Y<Q-1&&!($[Y]==="*"&&$[Y+1]==="/"))Y++;return Y+=2,!0}return!1},W=()=>{if(J!==0)return;let z=$.slice(Y).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(z){let j=z[2].split(",").map((_)=>{let F=_.trim().split(":");return F[F.length-1].trim()});for(let _ of j)if(_&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(_)&&!X.has(_))Z.push(_),X.add(_);return}let K=$.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(K){let j=K[2];if(!X.has(j))Z.push(j),X.add(j);return}let H=$.slice(Y).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let j=H[1];if(!X.has(j))Z.push(j),X.add(j);return}let B=$.slice(Y).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let j=B[1];if(!X.has(j))Z.push(j),X.add(j)}};while(Y<Q){if(U())continue;if($[Y]==="'"||$[Y]==='"'){G($[Y]);continue}if($[Y]==="`"){q();continue}if($[Y]==="{"){J++,Y++;continue}if($[Y]==="}"){J--,Y++;continue}if(J===0&&/[a-z]/i.test($[Y])&&(Y===0||/\s|[;{}()]/.test($[Y-1])))W();Y++}return Z}function $q($){let Z=[],X=0,J=0,Y=null;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(Y){if(G==="\\"){Q++;continue}if(G===Y)Y=null;continue}if(G==='"'||G==="'"||G==="`"){Y=G;continue}if(G==="("||G==="["||G==="{")X++;else if(G===")"||G==="]"||G==="}")X--;else if(G===","&&X===0)Z.push($.slice(J,Q)),J=Q+1}if(J<$.length)Z.push($.slice(J));return Z}function Zq($){let Z=0,X=null;for(let J=0;J<$.length;J++){let Y=$[J];if(X){if(Y==="\\"){J++;continue}if(Y===X)X=null;continue}if(Y==='"'||Y==="'"||Y==="`"){X=Y;continue}if(Y==="("||Y==="["||Y==="{")Z++;else if(Y===")"||Y==="]"||Y==="}")Z--;else if(Y==="="&&Z===0){let Q=$[J-1],G=$[J+1];if(Q==="!"||Q==="<"||Q===">"||Q==="=")continue;if(G==="="||G===">")continue;return J}}return-1}function Xq($,Z){try{let X=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec($);if(!X)return;let J=X.index-1;while(J>=0&&/\s/.test($[J]))J--;if($[J]!=="}")return;let Y=J,Q=0,G=-1;for(;J>=0;J--){let U=$[J];if(U==="}")Q++;else if(U==="{"){if(Q--,Q===0){G=J;break}}}if(G===-1)return;let q=$.slice(G+1,Y);for(let U of $q(q)){let W=U.trim();if(!W||W.startsWith("..."))continue;let z=Zq(W);if(z===-1)continue;let K=W.slice(0,z).trim();if(!/^[A-Z_$][\w$]*$/i.test(K))continue;if(Z[K]!==void 0)continue;let H=W.slice(z+1).trim();if(!H)continue;try{let B=Object.keys(Z),j=Function(...B,`"use strict"; return (${H});`);Z[K]=j(...B.map((_)=>Z[_]))}catch{}}}catch{}}async function M$($,Z,X,J,Y){let Q=$.endsWith(".stx")?$.slice(0,-4):$,G=(F)=>F.split("-").map((V)=>V.charAt(0).toUpperCase()+V.slice(1)).join(""),q=(F)=>F.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),U=X.__importedComponents;if(U){for(let F of[Q,Q.toLowerCase(),G(Q),q(Q)])if(U.has(F))return!0}let W=[...new Set([`${Q}.stx`,`${G(Q)}.stx`,`${q(Q)}.stx`])],z=typeof Y.root==="string"?x.resolve(Y.root):void 0,K=z??x.dirname(J),H=[],B=(F)=>{if(F&&!H.includes(F))H.push(F)},j=X.__originalFilePath;if(j)B(x.join(x.dirname(j),"components"));if(B(Z),B(Y._rootComponentsDir),B(x.join(x.dirname(J),"components")),B(Y.componentsDir),z)B(x.resolve(z,"resources/views/components")),B(x.resolve(z,"resources/components")),B(x.resolve(z,"src/components")),B(x.resolve(z,"components"));let _=Y._pluginComponentDirs;if(Array.isArray(_))for(let F of _)B(typeof F==="string"?F:null);if(B(Y.fallbackComponentsDir),Q.startsWith("./")||Q.startsWith("../"))return a(x.resolve(x.dirname(J),`${Q}.stx`));for(let F of H){let V=x.isAbsolute(F)?F:x.resolve(K,F);for(let O of W)if(await a(x.join(V,O)))return!0}return!1}function Jq($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function Yq($){if(!$)return!1;let Z=$.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(Z)}function Qq($){let Z=new Set,X=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useReactiveProp|useLocalStorage|useSessionStorage|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let J of $){let Y;while((Y=X.exec(J))!==null)Z.add(Y[1]);X.lastIndex=0}return[...Z]}async function k1($,Z,X,J,Y,Q,G,q=new Set,U){let{extractVariables:W}=await o("stx/variable-extractor",()=>import("./chunk-tdj3gqaa.js")),z=q??new Set;if(z.has($))return`[Circular component reference: ${$}]`;let K=new Set(z);K.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let B=H&&H!=="load"&&Jq(H)?H:"";try{let j=(P)=>P.split("-").map((u)=>u.charAt(0).toUpperCase()+u.slice(1)).join(""),_=(P)=>P.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),F=$.endsWith(".stx")?$.slice(0,-4):$,V=null,O=Y.__importedComponents;if(O){let P=[F,F.toLowerCase(),j(F),_(F)];for(let u of P)if(O.has(u)){V=O.get(u);break}}let L=[];if(!V){let P=[`${F}.stx`,`${j(F)}.stx`,`${_(F)}.stx`],u=[...new Set(P)],Y0=Y.__originalFilePath,r=[];if(Y0){let U0=x.join(x.dirname(Y0),"components");r.push(U0)}if(J)r.push(J);let F0=G._rootComponentsDir;if(typeof F0==="string"&&!r.includes(F0))r.push(F0);let L0=x.join(x.dirname(Q),"components");if(!r.includes(L0))r.push(L0);if(G.componentsDir&&G.componentsDir!==J&&!r.includes(G.componentsDir))r.push(G.componentsDir);let v0=typeof G.root==="string"?x.resolve(G.root):void 0,a0=v0??x.dirname(Q),H0=[];if(v0)H0.push(x.resolve(v0,"resources/views/components")),H0.push(x.resolve(v0,"resources/components")),H0.push(x.resolve(v0,"src/components")),H0.push(x.resolve(v0,"components"));H0.push(x.resolve(import.meta.dir,"components"));for(let U0 of H0)if(!r.includes(U0))r.push(U0);let C1=G._pluginComponentDirs;if(Array.isArray(C1)){for(let U0 of C1)if(typeof U0==="string"&&!r.includes(U0))r.push(U0)}if(G.fallbackComponentsDir&&!r.includes(G.fallbackComponentsDir))r.push(G.fallbackComponentsDir);let j1=[...new Set(r.map((U0)=>{if(!U0)return U0;return x.isAbsolute(U0)?U0:x.resolve(a0,U0)}))];r.length=0,r.push(...j1);let s=`${F}\x00${Q}\x00${j1.join("\x00")}`,u0=b$.get(s);if(u0)if(await a(u0))V=u0;else b$.delete(s);if(!V&&(F.startsWith("./")||F.startsWith("../")))V=x.resolve(x.dirname(Q),`${F}.stx`),L.push(V);else if(!V)for(let U0 of r){if(!U0)continue;for(let _1 of u){let V1=x.join(U0,_1);if(L.push(V1),await a(V1)){V=V1;break}}if(V)break;if(!V)try{let _1=await import("fs");if(!_1.statSync(U0,{throwIfNoEntry:!1})?.isDirectory())continue;let y5=8,P1=[{path:U0,depth:0}];while(P1.length>0&&!V){let J1=P1.pop();if(J1.depth>=y5)continue;let C4;try{C4=_1.readdirSync(J1.path,{withFileTypes:!0})}catch{continue}for(let S5 of C4){if(!S5.isDirectory())continue;if(S5.name==="node_modules"||S5.name.startsWith("."))continue;let P4=x.join(J1.path,S5.name);for(let A2 of u){let y$=x.join(P4,A2);if(L.push(y$),await a(y$)){V=y$;break}}if(V)break;P1.push({path:P4,depth:J1.depth+1})}}}catch{}if(V)break}if(V)b$.set(s,V)}if(!V||!await a(V)){let P=L.length>0?`
3668
+ `)Y++;return!0}if($[Y]==="/"&&$[Y+1]==="*"){Y+=2;while(Y<Q-1&&!($[Y]==="*"&&$[Y+1]==="/"))Y++;return Y+=2,!0}return!1},W=()=>{if(J!==0)return;let z=$.slice(Y).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(z){let j=z[2].split(",").map((_)=>{let F=_.trim().split(":");return F[F.length-1].trim()});for(let _ of j)if(_&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(_)&&!X.has(_))Z.push(_),X.add(_);return}let K=$.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(K){let j=K[2];if(!X.has(j))Z.push(j),X.add(j);return}let H=$.slice(Y).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let j=H[1];if(!X.has(j))Z.push(j),X.add(j);return}let B=$.slice(Y).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let j=B[1];if(!X.has(j))Z.push(j),X.add(j)}};while(Y<Q){if(U())continue;if($[Y]==="'"||$[Y]==='"'){G($[Y]);continue}if($[Y]==="`"){q();continue}if($[Y]==="{"){J++,Y++;continue}if($[Y]==="}"){J--,Y++;continue}if(J===0&&/[a-z]/i.test($[Y])&&(Y===0||/\s|[;{}()]/.test($[Y-1])))W();Y++}return Z}function $q($){let Z=[],X=0,J=0,Y=null;for(let Q=0;Q<$.length;Q++){let G=$[Q];if(Y){if(G==="\\"){Q++;continue}if(G===Y)Y=null;continue}if(G==='"'||G==="'"||G==="`"){Y=G;continue}if(G==="("||G==="["||G==="{")X++;else if(G===")"||G==="]"||G==="}")X--;else if(G===","&&X===0)Z.push($.slice(J,Q)),J=Q+1}if(J<$.length)Z.push($.slice(J));return Z}function Zq($){let Z=0,X=null;for(let J=0;J<$.length;J++){let Y=$[J];if(X){if(Y==="\\"){J++;continue}if(Y===X)X=null;continue}if(Y==='"'||Y==="'"||Y==="`"){X=Y;continue}if(Y==="("||Y==="["||Y==="{")Z++;else if(Y===")"||Y==="]"||Y==="}")Z--;else if(Y==="="&&Z===0){let Q=$[J-1],G=$[J+1];if(Q==="!"||Q==="<"||Q===">"||Q==="=")continue;if(G==="="||G===">")continue;return J}}return-1}function Xq($,Z){try{let X=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec($);if(!X)return;let J=X.index-1;while(J>=0&&/\s/.test($[J]))J--;if($[J]!=="}")return;let Y=J,Q=0,G=-1;for(;J>=0;J--){let U=$[J];if(U==="}")Q++;else if(U==="{"){if(Q--,Q===0){G=J;break}}}if(G===-1)return;let q=$.slice(G+1,Y);for(let U of $q(q)){let W=U.trim();if(!W||W.startsWith("..."))continue;let z=Zq(W);if(z===-1)continue;let K=W.slice(0,z).trim();if(!/^[A-Z_$][\w$]*$/i.test(K))continue;if(Z[K]!==void 0)continue;let H=W.slice(z+1).trim();if(!H)continue;try{let B=Object.keys(Z),j=Function(...B,`"use strict"; return (${H});`);Z[K]=j(...B.map((_)=>Z[_]))}catch{}}}catch{}}async function M$($,Z,X,J,Y){let Q=$.endsWith(".stx")?$.slice(0,-4):$,G=(F)=>F.split("-").map((V)=>V.charAt(0).toUpperCase()+V.slice(1)).join(""),q=(F)=>F.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),U=X.__importedComponents;if(U){for(let F of[Q,Q.toLowerCase(),G(Q),q(Q)])if(U.has(F))return!0}let W=[...new Set([`${Q}.stx`,`${G(Q)}.stx`,`${q(Q)}.stx`])],z=typeof Y.root==="string"?x.resolve(Y.root):void 0,K=z??x.dirname(J),H=[],B=(F)=>{if(F&&!H.includes(F))H.push(F)},j=X.__originalFilePath;if(j)B(x.join(x.dirname(j),"components"));if(B(Z),B(Y._rootComponentsDir),B(x.join(x.dirname(J),"components")),B(Y.componentsDir),z)B(x.resolve(z,"resources/views/components")),B(x.resolve(z,"resources/components")),B(x.resolve(z,"src/components")),B(x.resolve(z,"components"));let _=Y._pluginComponentDirs;if(Array.isArray(_))for(let F of _)B(typeof F==="string"?F:null);if(B(Y.fallbackComponentsDir),Q.startsWith("./")||Q.startsWith("../"))return a(x.resolve(x.dirname(J),`${Q}.stx`));for(let F of H){let V=x.isAbsolute(F)?F:x.resolve(K,F);for(let O of W)if(await a(x.join(V,O)))return!0}return!1}function Jq($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function Yq($){if(!$)return!1;let Z=$.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(Z)}function Qq($){let Z=new Set,X=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useReactiveProp|useLocalStorage|useSessionStorage|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let J of $){let Y;while((Y=X.exec(J))!==null)Z.add(Y[1]);X.lastIndex=0}return[...Z]}async function k1($,Z,X,J,Y,Q,G,q=new Set,U){let{extractVariables:W}=await o("stx/variable-extractor",()=>import("./chunk-bbymgcwp.js")),z=q??new Set;if(z.has($))return`[Circular component reference: ${$}]`;let K=new Set(z);K.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let B=H&&H!=="load"&&Jq(H)?H:"";try{let j=(P)=>P.split("-").map((u)=>u.charAt(0).toUpperCase()+u.slice(1)).join(""),_=(P)=>P.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),F=$.endsWith(".stx")?$.slice(0,-4):$,V=null,O=Y.__importedComponents;if(O){let P=[F,F.toLowerCase(),j(F),_(F)];for(let u of P)if(O.has(u)){V=O.get(u);break}}let L=[];if(!V){let P=[`${F}.stx`,`${j(F)}.stx`,`${_(F)}.stx`],u=[...new Set(P)],Y0=Y.__originalFilePath,r=[];if(Y0){let U0=x.join(x.dirname(Y0),"components");r.push(U0)}if(J)r.push(J);let F0=G._rootComponentsDir;if(typeof F0==="string"&&!r.includes(F0))r.push(F0);let L0=x.join(x.dirname(Q),"components");if(!r.includes(L0))r.push(L0);if(G.componentsDir&&G.componentsDir!==J&&!r.includes(G.componentsDir))r.push(G.componentsDir);let v0=typeof G.root==="string"?x.resolve(G.root):void 0,a0=v0??x.dirname(Q),H0=[];if(v0)H0.push(x.resolve(v0,"resources/views/components")),H0.push(x.resolve(v0,"resources/components")),H0.push(x.resolve(v0,"src/components")),H0.push(x.resolve(v0,"components"));H0.push(x.resolve(import.meta.dir,"components"));for(let U0 of H0)if(!r.includes(U0))r.push(U0);let C1=G._pluginComponentDirs;if(Array.isArray(C1)){for(let U0 of C1)if(typeof U0==="string"&&!r.includes(U0))r.push(U0)}if(G.fallbackComponentsDir&&!r.includes(G.fallbackComponentsDir))r.push(G.fallbackComponentsDir);let j1=[...new Set(r.map((U0)=>{if(!U0)return U0;return x.isAbsolute(U0)?U0:x.resolve(a0,U0)}))];r.length=0,r.push(...j1);let s=`${F}\x00${Q}\x00${j1.join("\x00")}`,u0=b$.get(s);if(u0)if(await a(u0))V=u0;else b$.delete(s);if(!V&&(F.startsWith("./")||F.startsWith("../")))V=x.resolve(x.dirname(Q),`${F}.stx`),L.push(V);else if(!V)for(let U0 of r){if(!U0)continue;for(let _1 of u){let V1=x.join(U0,_1);if(L.push(V1),await a(V1)){V=V1;break}}if(V)break;if(!V)try{let _1=await import("fs");if(!_1.statSync(U0,{throwIfNoEntry:!1})?.isDirectory())continue;let y5=8,P1=[{path:U0,depth:0}];while(P1.length>0&&!V){let J1=P1.pop();if(J1.depth>=y5)continue;let C4;try{C4=_1.readdirSync(J1.path,{withFileTypes:!0})}catch{continue}for(let S5 of C4){if(!S5.isDirectory())continue;if(S5.name==="node_modules"||S5.name.startsWith("."))continue;let P4=x.join(J1.path,S5.name);for(let A2 of u){let y$=x.join(P4,A2);if(L.push(y$),await a(y$)){V=y$;break}}if(V)break;P1.push({path:P4,depth:J1.depth+1})}}}catch{}if(V)break}if(V)b$.set(s,V)}if(!V||!await a(V)){let P=L.length>0?`
3669
3669
  Searched paths:
3670
3670
  ${L.map((u)=>` - ${u}`).join(`
3671
- `)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${P}`}U.add(V);let w;if(E5.has(V))w=E5.get(V);else try{w=await Bun.file(V).text(),E5.set(V,w)}catch(P){return`[Error loading component: ${P instanceof Error?P.message:String(P)}]`}let R=new Set(["__originalFilePath","__importedComponents",C5,"__stx_client_signal_names","__stxServeContext","__stx_scope_seq"]),D={};for(let[P,u]of Object.entries(Y))if(!P.startsWith("__")||R.has(P))D[P]=u;let N=X;if(X.includes("@include")){let{processIncludes:P}=await o("stx/includes",()=>import("./chunk-ymnt0ze7.js"));N=await P(X,Y,Q,G,U)}let T=n0(N),A=[],M=T.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(P,u)=>{let Y0=T.scripts[Number(u)]||"",r=Y0.match(/^<script\b([^>]*)>/i)?.[1]||"",F0=r.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),L0=!F0||["module","text/javascript","application/javascript"].includes(F0);if(!/\bserver\b/i.test(r)&&L0)return A.push(Y0),"";return Y0}),{extractSlotContent:E}=await o("stx/slots",()=>import("./chunk-qj0jaw5s.js")),I=E(M),y={};if(I.defaultSlot?.trim())y.default=I.defaultSlot;for(let[P,u]of I.namedSlots)y[P]=u.content;let k={...D,...Z,props:Z,slot:M,$slots:y,__processedComponents:K,__sections:{},__stx_signals_gate:Q1(w)||Yq(X)};Xq(w,k);let b=w,C=W$(b);if(C)b=C.content.trim();let g=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,h=[...w.matchAll(g)],m=[],l=h.some((P)=>/\bserver\b/.test(P[1]||"")&&/\bcache\b/.test(P[1]||""))&&h.every((P)=>/\bserver\b/.test(P[1]||"")),V0=null,h0=null;if(l){let P=aG({props:Z,slot:X,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0});if(P!==null){V0=`${V}\x00${P}`;let u=E4.get(V0);if(u){for(let Y0 of u.dependencies)U.add(Y0);return u.output}h0=new Set(U)}}for(let P of h){let u=P[1]||"",Y0=P[2]||"",r=u.includes("server");if(M1(u)&&Y0.trim())Y0=T1(Y0);if(r&&Y0)try{await W(Y0,k,V)}catch(L0){}if(!r){let L0=Y0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),v0=L0.includes("{{")&&L0.includes("}}"),a0=L0.includes("{!!")&&L0.includes("!!}");if(v0||a0)L0=f$(L0,k);let H0=u.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");m.push(`<script${H0}>${L0}</script>`)}}let D0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),y0=D0?D0[1]:"",q0=D0?D0[2]:"",X0="",N0=y0&&/\bscoped\b/i.test(y0);if(D0)X0=`<style${y0}>${q0}</style>`;let K0=b;if(K0=K0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),D0)K0=K0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let P=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,u=[];if(K0=K0.replace(P,(Y0,r)=>{let F0=r.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(F0)u.push(`<style${F0[1]}>${F0[2]}</style>`);return""}),K0=K0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),u.length>0)X0=`${X0}${u.join(`
3672
- `)}`}if(X&&K0.includes("{{ text || slot }}"))K0=K0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>X);let{applySlots:G5}=await o("stx/slots",()=>import("./chunk-qj0jaw5s.js")),{defaultSlot:i,namedSlots:Z0}=I;K0=await G5(K0,i,Z0,k);let J0=m.some((P)=>/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(P)),A0=Qq(m),O0=Array.isArray(k.__stx_client_signal_names)?k.__stx_client_signal_names:[];if(A0.length>0||O0.length>0)k.__stx_client_signal_names=[...new Set([...O0,...A0])];let p0={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:x.dirname(V),skipSignalsRuntime:!0,skipEventDirectives:J0||m.length===0,defaultLayout:void 0};k.__stxProcessingDepth=(Y.__stxProcessingDepth||0)+1;let B1=await T4(K0,k,V,p0,U),S=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let P of B1.matchAll(/\{\{([\s\S]*?)\}\}/g))S.add(P[1].trim());if(S.size>0)Y.__stx_preserved_client_expressions=[...S];let v=Y.__stx_scope_seq??={n:0,key:Bun.hash(String(Y.__filename??Q)).toString(36).slice(0,6)},n=`stx_${F.replace(/[^a-zA-Z0-9]/g,"_")}_${++v.n}_${v.key}`,d=B1;if(J0){let P="";if(Object.keys(Z).length>0)try{P=` data-stx-props="${H2(JSON.stringify(Z))}"`}catch{}let u=B?` stx-hydrate="${H2(B)}"`:"";d=`<div data-stx-scope="${n}"${P}${u}>${B1}</div>`;let Y0=await Promise.all(m.map(async(r)=>{let F0=r.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!F0)return r;let[,L0,v0]=F0,a0=y4(v0,{filePath:V,projectRoot:process.cwd()}),H0=a0.code,C1=S4(a0.styles);H0=A5(H0).code;let{hasUserImports:j1,bundleClientScript:s}=await o("stx/client-script-bundler",()=>import("./chunk-t68jcajf.js"));if(j1(H0))H0=await s(H0,V,{projectRoot:process.cwd(),minify:G.buildMode==="compile"});let{stripStxRuntimeImports:u0}=await o("stx/signal-processing",()=>import("./chunk-33zg81y6.js"));H0=u0(H0);let U0=t0(H0),_1=eG(U0),V1=`function(__scopeId) {
3671
+ `)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${P}`}U.add(V);let w;if(E5.has(V))w=E5.get(V);else try{w=await Bun.file(V).text(),E5.set(V,w)}catch(P){return`[Error loading component: ${P instanceof Error?P.message:String(P)}]`}let R=new Set(["__originalFilePath","__importedComponents",C5,"__stx_client_signal_names","__stxServeContext","__stx_scope_seq"]),D={};for(let[P,u]of Object.entries(Y))if(!P.startsWith("__")||R.has(P))D[P]=u;let N=X;if(X.includes("@include")){let{processIncludes:P}=await o("stx/includes",()=>import("./chunk-ct19gbs6.js"));N=await P(X,Y,Q,G,U)}let T=n0(N),A=[],M=T.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(P,u)=>{let Y0=T.scripts[Number(u)]||"",r=Y0.match(/^<script\b([^>]*)>/i)?.[1]||"",F0=r.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),L0=!F0||["module","text/javascript","application/javascript"].includes(F0);if(!/\bserver\b/i.test(r)&&L0)return A.push(Y0),"";return Y0}),{extractSlotContent:E}=await o("stx/slots",()=>import("./chunk-9qj7yjse.js")),I=E(M),y={};if(I.defaultSlot?.trim())y.default=I.defaultSlot;for(let[P,u]of I.namedSlots)y[P]=u.content;let k={...D,...Z,props:Z,slot:M,$slots:y,__processedComponents:K,__sections:{},__stx_signals_gate:Q1(w)||Yq(X)};Xq(w,k);let b=w,C=W$(b);if(C)b=C.content.trim();let g=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,h=[...w.matchAll(g)],m=[],l=h.some((P)=>/\bserver\b/.test(P[1]||"")&&/\bcache\b/.test(P[1]||""))&&h.every((P)=>/\bserver\b/.test(P[1]||"")),V0=null,h0=null;if(l){let P=aG({props:Z,slot:X,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0});if(P!==null){V0=`${V}\x00${P}`;let u=E4.get(V0);if(u){for(let Y0 of u.dependencies)U.add(Y0);return u.output}h0=new Set(U)}}for(let P of h){let u=P[1]||"",Y0=P[2]||"",r=u.includes("server");if(M1(u)&&Y0.trim())Y0=T1(Y0);if(r&&Y0)try{await W(Y0,k,V)}catch(L0){}if(!r){let L0=Y0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),v0=L0.includes("{{")&&L0.includes("}}"),a0=L0.includes("{!!")&&L0.includes("!!}");if(v0||a0)L0=f$(L0,k);let H0=u.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");m.push(`<script${H0}>${L0}</script>`)}}let D0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),y0=D0?D0[1]:"",q0=D0?D0[2]:"",X0="",N0=y0&&/\bscoped\b/i.test(y0);if(D0)X0=`<style${y0}>${q0}</style>`;let K0=b;if(K0=K0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),D0)K0=K0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let P=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,u=[];if(K0=K0.replace(P,(Y0,r)=>{let F0=r.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(F0)u.push(`<style${F0[1]}>${F0[2]}</style>`);return""}),K0=K0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),u.length>0)X0=`${X0}${u.join(`
3672
+ `)}`}if(X&&K0.includes("{{ text || slot }}"))K0=K0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>X);let{applySlots:G5}=await o("stx/slots",()=>import("./chunk-9qj7yjse.js")),{defaultSlot:i,namedSlots:Z0}=I;K0=await G5(K0,i,Z0,k);let J0=m.some((P)=>/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(P)),A0=Qq(m),O0=Array.isArray(k.__stx_client_signal_names)?k.__stx_client_signal_names:[];if(A0.length>0||O0.length>0)k.__stx_client_signal_names=[...new Set([...O0,...A0])];let p0={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:x.dirname(V),skipSignalsRuntime:!0,skipEventDirectives:J0||m.length===0,defaultLayout:void 0};k.__stxProcessingDepth=(Y.__stxProcessingDepth||0)+1;let B1=await T4(K0,k,V,p0,U),S=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let P of B1.matchAll(/\{\{([\s\S]*?)\}\}/g))S.add(P[1].trim());if(S.size>0)Y.__stx_preserved_client_expressions=[...S];let v=Y.__stx_scope_seq??={n:0,key:Bun.hash(String(Y.__filename??Q)).toString(36).slice(0,6)},n=`stx_${F.replace(/[^a-zA-Z0-9]/g,"_")}_${++v.n}_${v.key}`,d=B1;if(J0){let P="";if(Object.keys(Z).length>0)try{P=` data-stx-props="${H2(JSON.stringify(Z))}"`}catch{}let u=B?` stx-hydrate="${H2(B)}"`:"";d=`<div data-stx-scope="${n}"${P}${u}>${B1}</div>`;let Y0=await Promise.all(m.map(async(r)=>{let F0=r.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!F0)return r;let[,L0,v0]=F0,a0=y4(v0,{filePath:V,projectRoot:process.cwd()}),H0=a0.code,C1=S4(a0.styles);H0=A5(H0).code;let{hasUserImports:j1,bundleClientScript:s}=await o("stx/client-script-bundler",()=>import("./chunk-qv9azqvb.js"));if(j1(H0))H0=await s(H0,V,{projectRoot:process.cwd(),minify:G.buildMode==="compile"});let{stripStxRuntimeImports:u0}=await o("stx/signal-processing",()=>import("./chunk-rrwx8e79.js"));H0=u0(H0);let U0=t0(H0),_1=eG(U0),V1=`function(__scopeId) {
3673
3673
  ${i1("const",[...B2,..._1],U0)}
3674
3674
  const __scope = window.stx._scopes = window.stx._scopes || {};
3675
3675
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -3791,7 +3791,7 @@ else {
3791
3791
  // STX: auto-generated event bindings
3792
3792
  ${$.map((X,J)=>Aq(X,J)).join(`
3793
3793
  `)}`}function O2($){let Z=[],X=new Set,J=$.replace(/^\s*import\s+.*$/gm,""),Y=0,Q=J.length,G=0;while(G<Q){let q=J[G];if(q==="'"||q==='"'||q==="`"){let U=q;if(G++,U==="`"){let W=0;while(G<Q){if(J[G]==="\\"){G+=2;continue}if(J[G]==="`"&&W===0){G++;break}if(J[G]==="$"&&J[G+1]==="{"){W++,G+=2;continue}if(J[G]==="}"&&W>0){W--,G++;continue}G++}}else while(G<Q){if(J[G]==="\\"){G+=2;continue}if(J[G]===U){G++;break}G++}continue}if(q==="/"&&J[G+1]==="/"){while(G<Q&&J[G]!==`
3794
- `)G++;continue}if(q==="/"&&J[G+1]==="*"){G+=2;while(G<Q-1&&!(J[G]==="*"&&J[G+1]==="/"))G++;G+=2;continue}if(q==="{"){Y++,G++;continue}if(q==="}"){Y--,G++;continue}if(Y===0){let U=J.slice(G),W=U.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(W){let H=W[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=W[0].length;continue}let z=U.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(z){z[1].split(",").forEach((H)=>{let B=H.trim(),j=B.indexOf(":"),_=j>=0?B.slice(j+1).trim().split(/[\s=]/)[0]:B.split(/[\s=]/)[0];if(_&&!_.startsWith("_")&&!X.has(_))Z.push(_),X.add(_)}),G+=z[0].length;continue}let K=U.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(K){let H=K[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=K[0].length;continue}}G++}return Z}var Tq=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 Iq($){let Z=new Set,X=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function J(H){let B;while((B=X.exec(H))!==null){let j=B[0];if(!Tq.has(j))Z.add(j)}}let Y=/\{\{([\s\S]*?)\}\}/g,Q;while((Q=Y.exec($))!==null)J(Q[1]);let G=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((Q=G.exec($))!==null)J(Q[1]);let q=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((Q=q.exec($))!==null)J(Q[1]);let U=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Q=U.exec($))!==null)J(Q[1]);let W=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Q=W.exec($))!==null)J(Q[1]);let z=/@model\s*=\s*["']([^"']*)["']/gi;while((Q=z.exec($))!==null)J(Q[1]);let K=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Q=K.exec($))!==null)J(Q[1]);return Z}async function k$($,Z={}){let X=$,J="",Y=!1,Q=[],G=y4(X,{filePath:Z.filePath,projectRoot:Z.projectRoot});X=G.code;let q=S4(G.styles),U=A5(X);X=U.code,Q=[...U.imports,...U.models];let{hasUserImports:W,bundleClientScript:z}=await o("stx/client-script-bundler",()=>import("./chunk-t68jcajf.js"));if(W(X))X=await z(X,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Y=!0;if(Z.autoImports!==!1){let O=D2(X);X=O.code,J=N2(O.stxImports,O.browserImports.filter((L)=>!Q.includes(L)))}if(J=`${J4(X,Z.serverData)}${J}`,X=t0(X),!Y&&M1(Z.attrs||""))X=T1(X);let K=Mq(Z.eventBindings||[]),H=(Z.attrs||"").trim();if(/\btype\s*=\s*["']module["']/i.test(H)){let O=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),L=`type="module" data-stx-scoped${O?` ${O}`:""}`;return`${q}<script ${L}>
3794
+ `)G++;continue}if(q==="/"&&J[G+1]==="*"){G+=2;while(G<Q-1&&!(J[G]==="*"&&J[G+1]==="/"))G++;G+=2;continue}if(q==="{"){Y++,G++;continue}if(q==="}"){Y--,G++;continue}if(Y===0){let U=J.slice(G),W=U.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(W){let H=W[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=W[0].length;continue}let z=U.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(z){z[1].split(",").forEach((H)=>{let B=H.trim(),j=B.indexOf(":"),_=j>=0?B.slice(j+1).trim().split(/[\s=]/)[0]:B.split(/[\s=]/)[0];if(_&&!_.startsWith("_")&&!X.has(_))Z.push(_),X.add(_)}),G+=z[0].length;continue}let K=U.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(K){let H=K[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=K[0].length;continue}}G++}return Z}var Tq=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 Iq($){let Z=new Set,X=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function J(H){let B;while((B=X.exec(H))!==null){let j=B[0];if(!Tq.has(j))Z.add(j)}}let Y=/\{\{([\s\S]*?)\}\}/g,Q;while((Q=Y.exec($))!==null)J(Q[1]);let G=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((Q=G.exec($))!==null)J(Q[1]);let q=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((Q=q.exec($))!==null)J(Q[1]);let U=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Q=U.exec($))!==null)J(Q[1]);let W=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Q=W.exec($))!==null)J(Q[1]);let z=/@model\s*=\s*["']([^"']*)["']/gi;while((Q=z.exec($))!==null)J(Q[1]);let K=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Q=K.exec($))!==null)J(Q[1]);return Z}async function k$($,Z={}){let X=$,J="",Y=!1,Q=[],G=y4(X,{filePath:Z.filePath,projectRoot:Z.projectRoot});X=G.code;let q=S4(G.styles),U=A5(X);X=U.code,Q=[...U.imports,...U.models];let{hasUserImports:W,bundleClientScript:z}=await o("stx/client-script-bundler",()=>import("./chunk-qv9azqvb.js"));if(W(X))X=await z(X,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Y=!0;if(Z.autoImports!==!1){let O=D2(X);X=O.code,J=N2(O.stxImports,O.browserImports.filter((L)=>!Q.includes(L)))}if(J=`${J4(X,Z.serverData)}${J}`,X=t0(X),!Y&&M1(Z.attrs||""))X=T1(X);let K=Mq(Z.eventBindings||[]),H=(Z.attrs||"").trim();if(/\btype\s*=\s*["']module["']/i.test(H)){let O=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),L=`type="module" data-stx-scoped${O?` ${O}`:""}`;return`${q}<script ${L}>
3795
3795
  ${r1(`${J}${X}
3796
3796
  ${K}`)}
3797
3797
  </script>`}let j=L2($),_=/function __stx_setup_/.test(X),F=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test($);function V(O){let L=O.length>0?`
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$r as b,_r as a,as as c,bs as d,cs as e,ds as f}from"./chunk-6ea3th9j.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-87rj95tw.js";import"./chunk-74r77tz1.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-xaqjtned.js";import"./chunk-7kpfk426.js";import"./chunk-2tew0h6f.js";import"./chunk-yx8vftp0.js";export{f as validateConfig,b as resolveStxDirectories,c as loadStxConfig,e as defineStxConfig,a as defaultConfig,d as config};
2
+ import{$r as b,_r as a,as as c,bs as d,cs as e,ds as f}from"./chunk-5dc1twg4.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-09rpa9sg.js";import"./chunk-74r77tz1.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-xaqjtned.js";import"./chunk-7kpfk426.js";import"./chunk-2tew0h6f.js";import"./chunk-yx8vftp0.js";export{f as validateConfig,b as resolveStxDirectories,c as loadStxConfig,e as defineStxConfig,a as defaultConfig,d as config};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ui as a,Vi as b}from"./chunk-9agksxkk.js";import"./chunk-ht51fz7w.js";import"./chunk-6ea3th9j.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-87rj95tw.js";import"./chunk-74r77tz1.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-xaqjtned.js";import"./chunk-7kpfk426.js";import"./chunk-2tew0h6f.js";import"./chunk-yx8vftp0.js";export{a as getStoreScript,b as clearStoreCache};
2
+ import{Ui as a,Vi as b}from"./chunk-2m730367.js";import"./chunk-ht51fz7w.js";import"./chunk-5dc1twg4.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-09rpa9sg.js";import"./chunk-74r77tz1.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-xaqjtned.js";import"./chunk-7kpfk426.js";import"./chunk-2tew0h6f.js";import"./chunk-yx8vftp0.js";export{a as getStoreScript,b as clearStoreCache};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Dq as H,Vq as x,_r as g,pm as O,rp as R}from"./chunk-6ea3th9j.js";import b from"path";var v={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},M=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var T=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function f(q){let B=[],Q=0,G;T.lastIndex=0;while((G=T.exec(q))!==null){if(G.index>Q){let X=q.slice(Q,G.index);if(X.trim())B.push({type:B.length===0?"shell":"content",content:X})}let J=G[1],K=G[2];B.push({type:"suspense",name:J,content:K}),Q=G.index+G[0].length}if(Q<q.length){let J=q.slice(Q);if(J.trim())B.push({type:B.length===0?"shell":"content",content:J})}if(B.length===0)B.push({type:"shell",content:q});return B}async function r(q,B={},Q={}){let G={...g,...Q,streaming:{...v,...Q.streaming}},J=G.streaming?.bufferSize||16384;return new ReadableStream({async start(K){try{let X=await Bun.file(q).text(),z=X.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),L=z?z[1]:"",Y=X.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),j={...B,__filename:q,__dirname:b.dirname(q)};if(L.trim())await R(L,j,q);let D=f(Y),$=new Set;if(!D.some((w)=>w.type==="suspense")){let w=G.streaming?.strategy||"auto",U=new RegExp(M.source,"g");if(!(w!=="manual"&&U.test(Y))){let F=await H(Y,j,q,G,$);for(let V=0;V<F.length;V+=J)K.enqueue(F.slice(V,V+J)),await new Promise((W)=>setTimeout(W,0))}else{let F=[],V=new RegExp(M.source,"g"),W;while((W=V.exec(Y))!==null)F.push({name:W[1],content:W[2],start:W.index,end:W.index+W[0].length});let y=0;for(let A of F){if(A.start>y){let k=Y.slice(y,A.start);if(k.trim()){let E=await H(k,j,q,G,$);K.enqueue(E),await new Promise((S)=>setTimeout(S,0))}}let I=await H(A.content,j,q,G,$);K.enqueue(I),await new Promise((k)=>setTimeout(k,0)),y=A.end}if(y<Y.length){let A=Y.slice(y);if(A.trim()){let I=await H(A,j,q,G,$);K.enqueue(I)}}}}else{let w=new Map;for(let Z of D)if(Z.type==="shell"||Z.type==="content"){let F=await H(Z.content,j,q,G,$);K.enqueue(F)}else if(Z.type==="suspense"&&Z.name){let F=`stx-suspense-${Z.name}`;K.enqueue(`<div id="${F}" data-suspense="${Z.name}" style="display:contents;">
2
+ import{Dq as H,Vq as x,_r as g,pm as O,rp as R}from"./chunk-5dc1twg4.js";import b from"path";var v={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},M=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var T=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function f(q){let B=[],Q=0,G;T.lastIndex=0;while((G=T.exec(q))!==null){if(G.index>Q){let X=q.slice(Q,G.index);if(X.trim())B.push({type:B.length===0?"shell":"content",content:X})}let J=G[1],K=G[2];B.push({type:"suspense",name:J,content:K}),Q=G.index+G[0].length}if(Q<q.length){let J=q.slice(Q);if(J.trim())B.push({type:B.length===0?"shell":"content",content:J})}if(B.length===0)B.push({type:"shell",content:q});return B}async function r(q,B={},Q={}){let G={...g,...Q,streaming:{...v,...Q.streaming}},J=G.streaming?.bufferSize||16384;return new ReadableStream({async start(K){try{let X=await Bun.file(q).text(),z=X.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),L=z?z[1]:"",Y=X.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),j={...B,__filename:q,__dirname:b.dirname(q)};if(L.trim())await R(L,j,q);let D=f(Y),$=new Set;if(!D.some((w)=>w.type==="suspense")){let w=G.streaming?.strategy||"auto",U=new RegExp(M.source,"g");if(!(w!=="manual"&&U.test(Y))){let F=await H(Y,j,q,G,$);for(let V=0;V<F.length;V+=J)K.enqueue(F.slice(V,V+J)),await new Promise((W)=>setTimeout(W,0))}else{let F=[],V=new RegExp(M.source,"g"),W;while((W=V.exec(Y))!==null)F.push({name:W[1],content:W[2],start:W.index,end:W.index+W[0].length});let y=0;for(let A of F){if(A.start>y){let k=Y.slice(y,A.start);if(k.trim()){let E=await H(k,j,q,G,$);K.enqueue(E),await new Promise((S)=>setTimeout(S,0))}}let I=await H(A.content,j,q,G,$);K.enqueue(I),await new Promise((k)=>setTimeout(k,0)),y=A.end}if(y<Y.length){let A=Y.slice(y);if(A.trim()){let I=await H(A,j,q,G,$);K.enqueue(I)}}}}else{let w=new Map;for(let Z of D)if(Z.type==="shell"||Z.type==="content"){let F=await H(Z.content,j,q,G,$);K.enqueue(F)}else if(Z.type==="suspense"&&Z.name){let F=`stx-suspense-${Z.name}`;K.enqueue(`<div id="${F}" data-suspense="${Z.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
4
  </div>`),w.set(Z.name,H(Z.content,j,q,G,$))}K.enqueue(`
5
5
  <script>
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Rl as c,Sl as d,Tl as e,Ul as f,Vl as g,Wl as h,Xl as i,Yl as j,Zl as k}from"./chunk-6ea3th9j.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import{Hs as a,Is as b}from"./chunk-1kg9sz9a.js";import"./chunk-87rj95tw.js";import"./chunk-74r77tz1.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-xaqjtned.js";import"./chunk-7kpfk426.js";import"./chunk-2tew0h6f.js";import"./chunk-yx8vftp0.js";export{b as stripCommentsAndLiterals,d as renderVendorStyleTags,k as processClientScript,f as injectBrowserCoreAutoImports,j as generateServerDataBridge,h as generateBrowserAutoImportDestructuring,g as generateAutoImportDestructuring,a as findInterpolationEnd,i as extractBridgeData,c as extractAndStripCssImports,e as STX_AUTO_IMPORTS};
2
+ import{Rl as c,Sl as d,Tl as e,Ul as f,Vl as g,Wl as h,Xl as i,Yl as j,Zl as k}from"./chunk-5dc1twg4.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import{Hs as a,Is as b}from"./chunk-1kg9sz9a.js";import"./chunk-09rpa9sg.js";import"./chunk-74r77tz1.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-xaqjtned.js";import"./chunk-7kpfk426.js";import"./chunk-2tew0h6f.js";import"./chunk-yx8vftp0.js";export{b as stripCommentsAndLiterals,d as renderVendorStyleTags,k as processClientScript,f as injectBrowserCoreAutoImports,j as generateServerDataBridge,h as generateBrowserAutoImportDestructuring,g as generateAutoImportDestructuring,a as findInterpolationEnd,i as extractBridgeData,c as extractAndStripCssImports,e as STX_AUTO_IMPORTS};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{vg as a}from"./chunk-rmrxs0qz.js";import"./chunk-y7z44vr9.js";import"./chunk-6ea3th9j.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-87rj95tw.js";import"./chunk-74r77tz1.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-xaqjtned.js";import"./chunk-7kpfk426.js";import"./chunk-2tew0h6f.js";import"./chunk-yx8vftp0.js";export{a as startProductionServer};
2
+ import{vg as a}from"./chunk-dnspts0e.js";import"./chunk-tdjdf9v9.js";import"./chunk-5dc1twg4.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-09rpa9sg.js";import"./chunk-74r77tz1.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-xaqjtned.js";import"./chunk-7kpfk426.js";import"./chunk-2tew0h6f.js";import"./chunk-yx8vftp0.js";export{a as startProductionServer};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Dh as a,Eh as b,Fh as c,Gh as d,Hh as e,Ih as f}from"./chunk-gzf1dg38.js";import"./chunk-6ea3th9j.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-87rj95tw.js";import"./chunk-74r77tz1.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-xaqjtned.js";import"./chunk-7kpfk426.js";import"./chunk-2tew0h6f.js";import"./chunk-yx8vftp0.js";export{c as renderSlot,d as processSlots,a as parseSlots,b as parseSlotElement,e as extractSlotContent,f as applySlots};
2
+ import{Dh as a,Eh as b,Fh as c,Gh as d,Hh as e,Ih as f}from"./chunk-2j1frpgy.js";import"./chunk-5dc1twg4.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-09rpa9sg.js";import"./chunk-74r77tz1.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-xaqjtned.js";import"./chunk-7kpfk426.js";import"./chunk-2tew0h6f.js";import"./chunk-yx8vftp0.js";export{c as renderSlot,d as processSlots,a as parseSlots,b as parseSlotElement,e as extractSlotContent,f as applySlots};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ms as a,Ns as b,Os as c,Ps as d,Qs as e,Rs as f,Ss as g,Ts as h,Us as i,Vs as j,Ws as k,Xs as l,Ys as m}from"./chunk-87rj95tw.js";import"./chunk-xgtcq9bj.js";import"./chunk-yx8vftp0.js";export{f as resolveUserCrosswindConfig,c as resetCssCache,d as resetCrosswindCache,i as rebuildCrosswindCSS,e as loadCrosswindConfig,b as loadCrosswind,m as injectCrosswindCSS,a as getCrosswindServeAsset,j as getCachedCSS,l as generateCrosswindCSS,g as fingerprintConfig,k as extractClassNames,h as buildCrosswindCSS};
2
+ import{Ms as a,Ns as b,Os as c,Ps as d,Qs as e,Rs as f,Ss as g,Ts as h,Us as i,Vs as j,Ws as k,Xs as l,Ys as m}from"./chunk-09rpa9sg.js";import"./chunk-xgtcq9bj.js";import"./chunk-yx8vftp0.js";export{f as resolveUserCrosswindConfig,c as resetCssCache,d as resetCrosswindCache,i as rebuildCrosswindCSS,e as loadCrosswindConfig,b as loadCrosswind,m as injectCrosswindCSS,a as getCrosswindServeAsset,j as getCachedCSS,l as generateCrosswindCSS,g as fingerprintConfig,k as extractClassNames,h as buildCrosswindCSS};