@stacksjs/stx 0.2.910 → 0.2.912

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 (84) hide show
  1. package/dist/{chunk-2r84qtat.js → chunk-03sqt4jx.js} +2 -2
  2. package/dist/{chunk-q33tyfpp.js → chunk-1gfc406y.js} +1 -1
  3. package/dist/{chunk-2cbrcb9m.js → chunk-28f696hb.js} +1 -1
  4. package/dist/{chunk-g17g6w1t.js → chunk-46fzxsh0.js} +2 -2
  5. package/dist/chunk-59nhx5mp.js +2 -0
  6. package/dist/{chunk-pp89n1et.js → chunk-5xsghm23.js} +1 -1
  7. package/dist/chunk-68qw8ak4.js +2 -0
  8. package/dist/{chunk-cw7vnkc8.js → chunk-6ryenxnh.js} +1 -1
  9. package/dist/chunk-759jwj0e.js +3 -0
  10. package/dist/{chunk-87aqcw1w.js → chunk-7y5fkje7.js} +1 -1
  11. package/dist/chunk-83ykx150.js +2 -0
  12. package/dist/{chunk-29trx6h3.js → chunk-8vk795yg.js} +1 -1
  13. package/dist/{chunk-gt3426kc.js → chunk-996gpkb6.js} +1 -1
  14. package/dist/{chunk-5k55yk8g.js → chunk-9ejbveb6.js} +1 -1
  15. package/dist/{chunk-b234w3mf.js → chunk-9gptdyqq.js} +14 -4
  16. package/dist/{chunk-ah615efp.js → chunk-9kaxt6tw.js} +1 -1
  17. package/dist/{chunk-x40j9ta1.js → chunk-a5920t9d.js} +2 -2
  18. package/dist/{chunk-cqcxj08t.js → chunk-a5990vzz.js} +1 -1
  19. package/dist/{chunk-gwvkqf5r.js → chunk-aahxd88g.js} +4 -4
  20. package/dist/chunk-ardnfxn5.js +2 -0
  21. package/dist/chunk-bjbzpy42.js +2 -0
  22. package/dist/{chunk-xjbj655y.js → chunk-btetjy8n.js} +3 -3
  23. package/dist/{chunk-kvcz1926.js → chunk-c0738x1k.js} +1 -1
  24. package/dist/{chunk-7apr0ww2.js → chunk-c8qp8b5z.js} +1 -1
  25. package/dist/{chunk-ggez55jb.js → chunk-cxzy7kxg.js} +7 -7
  26. package/dist/{chunk-4zw9trtx.js → chunk-d2rwg24x.js} +1 -1
  27. package/dist/chunk-dhk7355h.js +2 -0
  28. package/dist/{chunk-dh4p07cc.js → chunk-dqwc5b8m.js} +1 -1
  29. package/dist/{chunk-13kfjnyn.js → chunk-ff03ga49.js} +4 -4
  30. package/dist/chunk-fwebja2k.js +2 -0
  31. package/dist/{chunk-44qcbbc4.js → chunk-gmk82cm4.js} +1 -1
  32. package/dist/{chunk-vd03gnnb.js → chunk-jbbgye38.js} +5 -5
  33. package/dist/{chunk-magfdzdj.js → chunk-jcmhpbh4.js} +1 -1
  34. package/dist/{chunk-pmmctgdd.js → chunk-jk6zn8tw.js} +1 -1
  35. package/dist/{chunk-zbzfkh3m.js → chunk-jkenezzp.js} +1 -1
  36. package/dist/{chunk-caaexbqy.js → chunk-kfvp7mh1.js} +1 -1
  37. package/dist/{chunk-9grwqzpe.js → chunk-nkkassx2.js} +1 -1
  38. package/dist/{chunk-azyq6fds.js → chunk-nxcg5tf5.js} +1 -1
  39. package/dist/{chunk-pgqc8895.js → chunk-pdvssk6k.js} +4 -4
  40. package/dist/{chunk-r425m35g.js → chunk-pgb2p7pm.js} +1 -1
  41. package/dist/chunk-prekacv2.js +2 -0
  42. package/dist/{chunk-jcp3rs1t.js → chunk-pthvpadr.js} +1 -1
  43. package/dist/{chunk-e4fseqnv.js → chunk-pwv6pvnm.js} +1 -1
  44. package/dist/{chunk-ccq7d7ar.js → chunk-q3ccf7ky.js} +1 -1
  45. package/dist/{chunk-a259mfax.js → chunk-q3smaxw7.js} +2 -2
  46. package/dist/{chunk-94k80qpp.js → chunk-r3eq7mza.js} +1 -1
  47. package/dist/{chunk-dqt1kw68.js → chunk-rektg4nx.js} +1 -1
  48. package/dist/{chunk-4ccbj4z6.js → chunk-rpyhbyt7.js} +1 -1
  49. package/dist/chunk-rssjx1mg.js +2 -0
  50. package/dist/chunk-rtrhv7nd.js +2 -0
  51. package/dist/{chunk-c829tgwv.js → chunk-s1sm41pe.js} +1 -1
  52. package/dist/chunk-vavq2ak3.js +2 -0
  53. package/dist/{chunk-kvrbdez2.js → chunk-ve0sbkrt.js} +1 -1
  54. package/dist/{chunk-9nf58keq.js → chunk-vhk5m98x.js} +1 -1
  55. package/dist/{chunk-q6jecdtg.js → chunk-vktbykbf.js} +1 -1
  56. package/dist/{chunk-8d6wkfdx.js → chunk-vr9dbmxh.js} +2 -2
  57. package/dist/{chunk-4kh0616n.js → chunk-vys2c06e.js} +4 -4
  58. package/dist/{chunk-pn3gj7zm.js → chunk-wnnj29pg.js} +1 -1
  59. package/dist/{chunk-ba27s9vr.js → chunk-wsg1evmc.js} +1 -1
  60. package/dist/{chunk-d5szrgdq.js → chunk-wvpk866c.js} +1 -1
  61. package/dist/{chunk-3760wpvw.js → chunk-x5x8hbm0.js} +1 -1
  62. package/dist/{chunk-ph8k7jdx.js → chunk-xsxdyzha.js} +2 -2
  63. package/dist/{chunk-688hf1mx.js → chunk-ypy1k5t0.js} +1 -1
  64. package/dist/{chunk-cd2jc724.js → chunk-zcgks568.js} +1 -1
  65. package/dist/{chunk-anj2j86n.js → chunk-zqvkbj0k.js} +2 -2
  66. package/dist/{chunk-r2ns89f7.js → chunk-zytwcfbt.js} +1 -1
  67. package/dist/cli.js +7 -7
  68. package/dist/craft-entry.js +1 -1
  69. package/dist/craft.js +1 -1
  70. package/dist/pwa.js +1 -1
  71. package/dist/ssg.js +2 -2
  72. package/package.json +5 -5
  73. package/dist/chunk-1a911c4c.js +0 -2
  74. package/dist/chunk-24hrd8sg.js +0 -2
  75. package/dist/chunk-3rzpkjmn.js +0 -2
  76. package/dist/chunk-6w9sgs52.js +0 -2
  77. package/dist/chunk-7w9ksdbp.js +0 -2
  78. package/dist/chunk-850b0cxa.js +0 -2
  79. package/dist/chunk-9yvhj108.js +0 -2
  80. package/dist/chunk-cf4apy9s.js +0 -3
  81. package/dist/chunk-ssdjny2r.js +0 -2
  82. package/dist/chunk-sx1jg8dw.js +0 -2
  83. package/dist/chunk-vf29gp9a.js +0 -2
  84. package/dist/chunk-ya8nwtdn.js +0 -2
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$m}from"./chunk-jkenezzp.js";import"./chunk-03sqt4jx.js";import"./chunk-zytwcfbt.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-9gptdyqq.js";import"./chunk-cxzy7kxg.js";import"./chunk-d2rwg24x.js";import"./chunk-w98yt4d4.js";import"./chunk-c08jvjqt.js";import"./chunk-phzhmnnm.js";import"./chunk-ck4ypzet.js";import"./chunk-0jdz31q1.js";import"./chunk-4b110x6r.js";export{$m as buildApp};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Uo,Vh,Wh}from"./chunk-wnnj29pg.js";import"./chunk-rpyhbyt7.js";import"./chunk-vr9dbmxh.js";import"./chunk-cwcmmgvz.js";import"./chunk-zqvkbj0k.js";import"./chunk-pdvssk6k.js";import"./chunk-v0yay1kw.js";import"./chunk-13awnyq0.js";import"./chunk-03sqt4jx.js";import"./chunk-zytwcfbt.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-9gptdyqq.js";import"./chunk-cxzy7kxg.js";import"./chunk-d2rwg24x.js";import"./chunk-w98yt4d4.js";import"./chunk-c08jvjqt.js";import"./chunk-phzhmnnm.js";import"./chunk-ck4ypzet.js";import"./chunk-0jdz31q1.js";import"./chunk-4b110x6r.js";export{Wh as clearComposableCache,Vh as getComposableScript,Uo as listComposableModules};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import{Bn}from"./chunk-c08jvjqt.js";import{B,Q,x,Kt,Xt,zr,y,Pl,Ki,Y,N}from"./chunk-ggez55jb.js";import{gn}from"./chunk-7apr0ww2.js";import{r}from"./chunk-cf4apy9s.js";import{ne}from"./chunk-e5rag6rh.js";import{L,c}from"./chunk-8tfpv6zf.js";var J=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function K(t){let s=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,n;while((n=e.exec(t))!==null)s.push({start:n.index,end:n.index+n[0].length});return s}function I(t,s){return s.some((e)=>t>=e.start&&t<e.end)}function Z(t){let s=(t||"").trim();if(!s)return null;if(/[\s>+~,:]/.test(s))return null;let e={},n=s,i=n.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),n=n.slice(i[0].length);while(n.length>0){let o=n.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(o){if(e.attr=o[1],o[3]!==void 0&&o[3]!=="")e.attrValue=o[3];n=n.slice(o[0].length);continue}let l=n.match(/^#([\w-]+)/);if(l){e.id=l[1],n=n.slice(l[0].length);continue}let a=n.match(/^\.([\w-]+)/);if(a){e.className=a[1],n=n.slice(a[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function tt(t,s){if(s.attr){if(!(s.attrValue===void 0?new RegExp(`\\b${s.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${s.attr}\\s*=\\s*(["'])\\s*${s.attrValue}\\s*\\1`,"i")).test(t))return!1}if(s.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${s.id}\\s*\\1`,"i").test(t))return!1}if(s.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(s.className))return!1}return!0}function T(t,s="main"){let e=Z(s);if(!e)return null;let n=/<([a-z][\w-]*)\b([^>]*)>/gi,i=K(t),o;while((o=n.exec(t))!==null){if(I(o.index,i))continue;let l=o[1].toLowerCase(),a=o[2]||"";if(a.trimEnd().endsWith("/")||J.has(l))continue;if(e.tag&&e.tag!==l)continue;if(!tt(a,e))continue;let u=o[0],g=o.index+u.length,f=new RegExp(`<(/?)${l}\\b([^>]*)>`,"gi");f.lastIndex=g;let d=1,h;while((h=f.exec(t))!==null){if(I(h.index,i))continue;let b=h[1]==="/";if(!b&&(h[2]||"").trimEnd().endsWith("/"))continue;if(d+=b?-1:1,d===0)return{openTag:u,openIndex:o.index,start:g,end:h.index,tagName:l}}return null}return null}var Et="private, no-store";function cn(t){return t.replace(/&#(\d+);/g,(s,e)=>D(Number(e),s)).replace(/&#x([0-9a-f]+);/gi,(s,e)=>D(Number.parseInt(e,16),s)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function D(t,s){if(!Number.isInteger(t)||t<0||t>1114111)return s;try{return String.fromCodePoint(t)}catch{return s}}function Be(t){return t.headers.get("X-STX-Router")==="true"}function H(t,s){if(!t)return s;return t.split(",").some((n)=>n.trim().toLowerCase()===s.toLowerCase())?t:`${t}, ${s}`}function V(t){let s=H(t,"X-STX-Router");for(let e of ds)s=H(s,e);return{Vary:s}}var ds=["X-STX-Have-Layout","X-STX-Have-Layout-Group"];function k(t){return t.replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function F(t){let s=/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i.exec(t)?.[1]??"",e=/<(meta|link)\b(?:[^>"']|"[^"]*"|'[^']*')*>|<title\b[^>]*>[\s\S]*?<\/title\s*>/giy;return x(s,(n,i)=>(e.lastIndex=i,e.exec(n)?e.lastIndex:-1)).map(({token:n})=>n)}function q(t){let s=Object.create(null),e=t.replace(/^<\w+\b|>$/g,"");for(let n of e.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)){let i=n[1].toLowerCase();if(!(i in s))s[i]=n[2]??n[3]??n[4]??""}return s}function Kn(t){let s=[];for(let e of F(t)){if(/^<title\b/i.test(e)){s.push(`<title>${k(e.replace(/^<title\b[^>]*>|<\/title\s*>$/gi,""))}</title>`);continue}let n=q(e);if(/^<meta\b/i.test(e)){let i=n.property?"property":"name",o=cn(n[i]??"").toLowerCase();if(o==="description"||/^(?:og|twitter):[\w:]+$/.test(o))s.push(`<meta ${i}="${r(o)}" content="${k(n.content??"")}">`)}else{let i=cn(n.rel??"").toLowerCase();if(i==="canonical"||i==="alternate"&&n.hreflang)s.push(`<link rel="${i}" href="${k(n.href??"")}"${i==="alternate"?` hreflang="${k(n.hreflang)}"`:""}>`)}}return`<template data-stx-page-head="1">${s.join("")}</template>
2
+ import{Bn}from"./chunk-c08jvjqt.js";import{B,Q,x,Kt,Xt,zr,y,Pl,Ki,Y,N}from"./chunk-cxzy7kxg.js";import{gn}from"./chunk-c8qp8b5z.js";import{r}from"./chunk-759jwj0e.js";import{ne}from"./chunk-e5rag6rh.js";import{L,c}from"./chunk-8tfpv6zf.js";var J=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function K(t){let s=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,n;while((n=e.exec(t))!==null)s.push({start:n.index,end:n.index+n[0].length});return s}function I(t,s){return s.some((e)=>t>=e.start&&t<e.end)}function Z(t){let s=(t||"").trim();if(!s)return null;if(/[\s>+~,:]/.test(s))return null;let e={},n=s,i=n.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),n=n.slice(i[0].length);while(n.length>0){let o=n.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(o){if(e.attr=o[1],o[3]!==void 0&&o[3]!=="")e.attrValue=o[3];n=n.slice(o[0].length);continue}let l=n.match(/^#([\w-]+)/);if(l){e.id=l[1],n=n.slice(l[0].length);continue}let a=n.match(/^\.([\w-]+)/);if(a){e.className=a[1],n=n.slice(a[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function tt(t,s){if(s.attr){if(!(s.attrValue===void 0?new RegExp(`\\b${s.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${s.attr}\\s*=\\s*(["'])\\s*${s.attrValue}\\s*\\1`,"i")).test(t))return!1}if(s.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${s.id}\\s*\\1`,"i").test(t))return!1}if(s.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(s.className))return!1}return!0}function T(t,s="main"){let e=Z(s);if(!e)return null;let n=/<([a-z][\w-]*)\b([^>]*)>/gi,i=K(t),o;while((o=n.exec(t))!==null){if(I(o.index,i))continue;let l=o[1].toLowerCase(),a=o[2]||"";if(a.trimEnd().endsWith("/")||J.has(l))continue;if(e.tag&&e.tag!==l)continue;if(!tt(a,e))continue;let u=o[0],g=o.index+u.length,f=new RegExp(`<(/?)${l}\\b([^>]*)>`,"gi");f.lastIndex=g;let d=1,h;while((h=f.exec(t))!==null){if(I(h.index,i))continue;let b=h[1]==="/";if(!b&&(h[2]||"").trimEnd().endsWith("/"))continue;if(d+=b?-1:1,d===0)return{openTag:u,openIndex:o.index,start:g,end:h.index,tagName:l}}return null}return null}var Et="private, no-store";function cn(t){return t.replace(/&#(\d+);/g,(s,e)=>D(Number(e),s)).replace(/&#x([0-9a-f]+);/gi,(s,e)=>D(Number.parseInt(e,16),s)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function D(t,s){if(!Number.isInteger(t)||t<0||t>1114111)return s;try{return String.fromCodePoint(t)}catch{return s}}function Be(t){return t.headers.get("X-STX-Router")==="true"}function H(t,s){if(!t)return s;return t.split(",").some((n)=>n.trim().toLowerCase()===s.toLowerCase())?t:`${t}, ${s}`}function V(t){let s=H(t,"X-STX-Router");for(let e of ds)s=H(s,e);return{Vary:s}}var ds=["X-STX-Have-Layout","X-STX-Have-Layout-Group"];function k(t){return t.replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function F(t){let s=/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i.exec(t)?.[1]??"",e=/<(meta|link)\b(?:[^>"']|"[^"]*"|'[^']*')*>|<title\b[^>]*>[\s\S]*?<\/title\s*>/giy;return x(s,(n,i)=>(e.lastIndex=i,e.exec(n)?e.lastIndex:-1)).map(({token:n})=>n)}function q(t){let s=Object.create(null),e=t.replace(/^<\w+\b|>$/g,"");for(let n of e.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)){let i=n[1].toLowerCase();if(!(i in s))s[i]=n[2]??n[3]??n[4]??""}return s}function Kn(t){let s=[];for(let e of F(t)){if(/^<title\b/i.test(e)){s.push(`<title>${k(e.replace(/^<title\b[^>]*>|<\/title\s*>$/gi,""))}</title>`);continue}let n=q(e);if(/^<meta\b/i.test(e)){let i=n.property?"property":"name",o=cn(n[i]??"").toLowerCase();if(o==="description"||/^(?:og|twitter):[\w:]+$/.test(o))s.push(`<meta ${i}="${r(o)}" content="${k(n.content??"")}">`)}else{let i=cn(n.rel??"").toLowerCase();if(i==="canonical"||i==="alternate"&&n.hreflang)s.push(`<link rel="${i}" href="${k(n.href??"")}"${i==="alternate"?` hreflang="${k(n.hreflang)}"`:""}>`)}}return`<template data-stx-page-head="1">${s.join("")}</template>
3
3
  `}var et=["media","crossorigin","integrity"];function Xn(t){let s=[];for(let e of F(t)){if(!/^<link\b/i.test(e))continue;let n=q(e);if(cn(n.rel??"").trim().toLowerCase()!=="stylesheet")continue;if(!n.href||"data-css"in n||"disabled"in n)continue;let i=et.filter((o)=>(o in n)).map((o)=>` ${o}="${k(n[o])}"`).join("");s.push(`<link rel="stylesheet" href="${k(n.href)}"${i}>`)}return s.length?`<template data-stx-page-css="1">${s.join("")}</template>
4
- `:""}import P from"path";var nt="stx-page-head:",rt=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,_={dev:null,prod:null};function st(){let t=ne()?"dev":"prod",s=_[t];if(s!==null)return s;try{let e=import.meta.require("./chunk-pp89n1et.js"),n=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;_[t]=`<script>${n()}</script>`}catch{_[t]=""}return _[t]}async function Da(t,s){if(s===!1)return null;if(s&&typeof s==="string"){let n=P.resolve(t,s);if(await Bun.file(n).exists())return n;return null}let e=P.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Bo(t,s){try{let e=await Bun.file(t).text(),n=e,i=B(e);if(i)n=i.content.trim();let o=gn(e),l=[...o.client.map((p)=>p.fullTag),...o.signals.map((p)=>p.fullTag)],a=[],u=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,g;while((g=u.exec(e))!==null)a.push(g[0]);let f=n;for(let p of o.server)f=f.replace(p.fullTag,"");for(let p of o.client)f=f.replace(p.fullTag,"");f=f.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let d="<!--__STX_PAGE_SLOT__-->";if(f=f.replace(/<slot\s*\/>/gi,d).replace(/<slot\s*>\s*<\/slot>/gi,d),!f.includes(d))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:h,extractVariables:b,defaultConfig:w,loadStxConfig:R}=await import("./chunk-sx1jg8dw.js"),E=await R(),m={__filename:t,__dirname:P.dirname(t)};for(let p of l){let C=p.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!p.includes("client")&&!p.includes('type="module"'))await b(C[1],m,t)}let S=await h(f,m,t,{...w,...E,...s},new Set),A=S.indexOf(d);if(A===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:S.substring(0,A),afterSlot:S.substring(A+d.length),filePath:t,shellScripts:l,shellStyles:a}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function ps(t,s,e){let n,i="",o=s.match(rt);if(o){s=s.replace(o[0],"");try{let f=Buffer.from(o[1],"base64").toString("utf8"),d=f.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(d)n=d[1].trim();i=f.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let l=e||n||"stx App",a=st(),u="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
4
+ `:""}import P from"path";var nt="stx-page-head:",rt=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,_={dev:null,prod:null};function st(){let t=ne()?"dev":"prod",s=_[t];if(s!==null)return s;try{let e=import.meta.require("./chunk-5xsghm23.js"),n=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;_[t]=`<script>${n()}</script>`}catch{_[t]=""}return _[t]}async function Da(t,s){if(s===!1)return null;if(s&&typeof s==="string"){let n=P.resolve(t,s);if(await Bun.file(n).exists())return n;return null}let e=P.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Bo(t,s){try{let e=await Bun.file(t).text(),n=e,i=B(e);if(i)n=i.content.trim();let o=gn(e),l=[...o.client.map((p)=>p.fullTag),...o.signals.map((p)=>p.fullTag)],a=[],u=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,g;while((g=u.exec(e))!==null)a.push(g[0]);let f=n;for(let p of o.server)f=f.replace(p.fullTag,"");for(let p of o.client)f=f.replace(p.fullTag,"");f=f.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let d="<!--__STX_PAGE_SLOT__-->";if(f=f.replace(/<slot\s*\/>/gi,d).replace(/<slot\s*>\s*<\/slot>/gi,d),!f.includes(d))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:h,extractVariables:b,defaultConfig:w,loadStxConfig:R}=await import("./chunk-vavq2ak3.js"),E=await R(),m={__filename:t,__dirname:P.dirname(t)};for(let p of l){let C=p.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!p.includes("client")&&!p.includes('type="module"'))await b(C[1],m,t)}let S=await h(f,m,t,{...w,...E,...s},new Set),A=S.indexOf(d);if(A===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:S.substring(0,A),afterSlot:S.substring(A+d.length),filePath:t,shellScripts:l,shellStyles:a}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function ps(t,s,e){let n,i="",o=s.match(rt);if(o){s=s.replace(o[0],"");try{let f=Buffer.from(o[1],"base64").toString("utf8"),d=f.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(d)n=d[1].trim();i=f.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let l=e||n||"stx App",a=st(),u="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
5
5
  <html lang="en">
6
6
  <head>
7
7
  <meta charset="UTF-8">
@@ -29,5 +29,5 @@ ${a}
29
29
  `));if(o.length>0)m.push(o.filter((S)=>!g.has(S)).join(`
30
30
  `));if(w.length>0)m.push(w.filter((S)=>!g.has(S)).join(`
31
31
  `));return m.push(b),m.join(`
32
- `)}import O from"fs";import X from"path";function ja(t,s,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:s,outputDir:e}}function Ba(t,s){let e=X.join(s,"manifest.json");O.writeFileSync(e,JSON.stringify(t,null,2))}function Fa(t){let s=X.join(t,"manifest.json");if(!O.existsSync(s))return null;try{let e=O.readFileSync(s,"utf-8"),n=JSON.parse(e);if(n.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${n.version}`),null;return n}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function M(t,s,e={}){let n=`${encodeURIComponent(t)}=${encodeURIComponent(s)}`;if(e.maxAge!==void 0)n+=`; Max-Age=${e.maxAge}`;if(e.expires)n+=`; Expires=${e.expires.toUTCString()}`;if(e.path)n+=`; Path=${e.path}`;if(e.domain)n+=`; Domain=${e.domain}`;if(e.secure)n+="; Secure";if(e.httpOnly)n+="; HttpOnly";if(e.sameSite)n+=`; SameSite=${e.sameSite}`;return n}async function at(t){let s=t.headers.get("content-type")||"",e={},n=(i,o)=>{let l=e[i];if(l===void 0)e[i]=o;else if(Array.isArray(l))l.push(o);else e[i]=[l,o]};if(s.includes("multipart/form-data")){let i=await t.formData();for(let[o,l]of i.entries())if(typeof l==="string")n(o,l);return e}if(s.includes("application/x-www-form-urlencoded")){for(let[i,o]of new URLSearchParams(await t.text()).entries())n(i,o);return e}return e}function Fo(t){if(!t)return!1;let s=t.toUpperCase();return s!=="GET"&&s!=="HEAD"}async function z(t,s={}){let e=s.request,n=s.method??e?.method;if(!e||!Fo(n))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await at(e)}catch{}let o=await t.action({request:e,form:i,params:s.params??{},query:t.query??{},cookies:s.cookies??{}});if(o&&typeof o==="object"){let l=o,a=ct(l.cookies),u=l.redirect;if(typeof u==="string"&&u)return{redirect:u,ran:!0,...a.length>0?{cookies:a}:{}};let{cookies:g,redirect:f,...d}=l;if(Object.assign(t,d),a.length>0)return{ran:!0,cookies:a}}return{ran:!0}}function ct(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let s=[];for(let[e,n]of Object.entries(t)){if(!e)continue;if(typeof n==="string"){s.push(M(e,n));continue}if(n&&typeof n==="object"){let i=n;if(typeof i.value!=="string")continue;s.push(M(e,i.value,i))}}return s}function za(t,s=[],e){let n=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of s)n.append("Set-Cookie",i);for(let[i,o]of Object.entries(e??{}))if(i.toLowerCase()!=="location")n.set(i,o);return new Response(null,{status:303,headers:n})}async function Gn(t,s={}){let{html:e,context:n,redirect:i,cookies:o}=await lt(t,s),l=Kt(n),a=Xt(n);if(i)return{html:e,redirect:i,cookies:o,status:l,headers:a};let{extractStreamBoundaries:u}=await import("./chunk-6w9sgs52.js"),g=u(n),f=t.streamTemplates;if(f&&Object.keys(f).length>0){let{processDirectives:d}=await import("./chunk-ssdjny2r.js"),{defaultConfig:h}=await import("./chunk-44qcbbc4.js"),b=n.streamBoundaries||{},w={...h,autoShell:!1},R=Object.keys(f).map((m)=>({id:m,render:async()=>{let S=typeof b[m]==="function"?await b[m]():void 0;return d(f[m],{...n,$boundary:S},t.sourceFile,w,new Set)}})),E=new Set(R.map((m)=>m.id));g=[...(g||[]).filter((m)=>!E.has(m.id)),...R]}return{html:e,boundaries:g&&g.length>0?g:void 0,cookies:o,status:l,headers:a}}async function lt(t,s){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...s};if(!t.hasServerScripts&&!Ki(t.html))return{html:t.html,context:e};for(let l of t.serverScriptContent)try{await y(l,e,t.sourceFile)}catch(a){if(s.__stx_strict_hydration)throw a;console.warn(`[stx] Server script error in ${t.sourceFile}:`,a)}let n=await z(e,{request:s.request,method:s.method,params:s.params??{},cookies:s.cookies??{}}),i=(l)=>{let a=l.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),u=zr(e);if(!u)return a;let g=L(a);return g<0?u+a:a.slice(0,g)+u+a.slice(g)};if(n.redirect)return{html:t.html,context:e,redirect:n.redirect,cookies:n.cookies};if(!Ki(t.html))return{html:i(t.html),context:e,cookies:n.cookies};let o=new Map;for(let[l,a]of Object.entries(t.placeholders))if(a.expression)try{let u=N(a.expression,e);if(a.type==="raw")o.set(l,u!==void 0&&u!==null?String(u):"");else o.set(l,u!==void 0&&u!==null?Y(String(u)):"")}catch(u){if(s.__stx_strict_hydration)throw u;o.set(l,"")}return{html:i(Pl(t.html,o)),context:e,cookies:n.cookies}}
32
+ `)}import O from"fs";import X from"path";function ja(t,s,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:s,outputDir:e}}function Ba(t,s){let e=X.join(s,"manifest.json");O.writeFileSync(e,JSON.stringify(t,null,2))}function Fa(t){let s=X.join(t,"manifest.json");if(!O.existsSync(s))return null;try{let e=O.readFileSync(s,"utf-8"),n=JSON.parse(e);if(n.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${n.version}`),null;return n}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function M(t,s,e={}){let n=`${encodeURIComponent(t)}=${encodeURIComponent(s)}`;if(e.maxAge!==void 0)n+=`; Max-Age=${e.maxAge}`;if(e.expires)n+=`; Expires=${e.expires.toUTCString()}`;if(e.path)n+=`; Path=${e.path}`;if(e.domain)n+=`; Domain=${e.domain}`;if(e.secure)n+="; Secure";if(e.httpOnly)n+="; HttpOnly";if(e.sameSite)n+=`; SameSite=${e.sameSite}`;return n}async function at(t){let s=t.headers.get("content-type")||"",e={},n=(i,o)=>{let l=e[i];if(l===void 0)e[i]=o;else if(Array.isArray(l))l.push(o);else e[i]=[l,o]};if(s.includes("multipart/form-data")){let i=await t.formData();for(let[o,l]of i.entries())if(typeof l==="string")n(o,l);return e}if(s.includes("application/x-www-form-urlencoded")){for(let[i,o]of new URLSearchParams(await t.text()).entries())n(i,o);return e}return e}function Fo(t){if(!t)return!1;let s=t.toUpperCase();return s!=="GET"&&s!=="HEAD"}async function z(t,s={}){let e=s.request,n=s.method??e?.method;if(!e||!Fo(n))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await at(e)}catch{}let o=await t.action({request:e,form:i,params:s.params??{},query:t.query??{},cookies:s.cookies??{}});if(o&&typeof o==="object"){let l=o,a=ct(l.cookies),u=l.redirect;if(typeof u==="string"&&u)return{redirect:u,ran:!0,...a.length>0?{cookies:a}:{}};let{cookies:g,redirect:f,...d}=l;if(Object.assign(t,d),a.length>0)return{ran:!0,cookies:a}}return{ran:!0}}function ct(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let s=[];for(let[e,n]of Object.entries(t)){if(!e)continue;if(typeof n==="string"){s.push(M(e,n));continue}if(n&&typeof n==="object"){let i=n;if(typeof i.value!=="string")continue;s.push(M(e,i.value,i))}}return s}function za(t,s=[],e){let n=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of s)n.append("Set-Cookie",i);for(let[i,o]of Object.entries(e??{}))if(i.toLowerCase()!=="location")n.set(i,o);return new Response(null,{status:303,headers:n})}async function Gn(t,s={}){let{html:e,context:n,redirect:i,cookies:o}=await lt(t,s),l=Kt(n),a=Xt(n);if(i)return{html:e,redirect:i,cookies:o,status:l,headers:a};let{extractStreamBoundaries:u}=await import("./chunk-68qw8ak4.js"),g=u(n),f=t.streamTemplates;if(f&&Object.keys(f).length>0){let{processDirectives:d}=await import("./chunk-59nhx5mp.js"),{defaultConfig:h}=await import("./chunk-gmk82cm4.js"),b=n.streamBoundaries||{},w={...h,autoShell:!1},R=Object.keys(f).map((m)=>({id:m,render:async()=>{let S=typeof b[m]==="function"?await b[m]():void 0;return d(f[m],{...n,$boundary:S},t.sourceFile,w,new Set)}})),E=new Set(R.map((m)=>m.id));g=[...(g||[]).filter((m)=>!E.has(m.id)),...R]}return{html:e,boundaries:g&&g.length>0?g:void 0,cookies:o,status:l,headers:a}}async function lt(t,s){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...s};if(!t.hasServerScripts&&!Ki(t.html))return{html:t.html,context:e};for(let l of t.serverScriptContent)try{await y(l,e,t.sourceFile)}catch(a){if(s.__stx_strict_hydration)throw a;console.warn(`[stx] Server script error in ${t.sourceFile}:`,a)}let n=await z(e,{request:s.request,method:s.method,params:s.params??{},cookies:s.cookies??{}}),i=(l)=>{let a=l.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),u=zr(e);if(!u)return a;let g=L(a);return g<0?u+a:a.slice(0,g)+u+a.slice(g)};if(n.redirect)return{html:t.html,context:e,redirect:n.redirect,cookies:n.cookies};if(!Ki(t.html))return{html:i(t.html),context:e,cookies:n.cookies};let o=new Map;for(let[l,a]of Object.entries(t.placeholders))if(a.expression)try{let u=N(a.expression,e);if(a.type==="raw")o.set(l,u!==void 0&&u!==null?String(u):"");else o.set(l,u!==void 0&&u!==null?Y(String(u)):"")}catch(u){if(s.__stx_strict_hydration)throw u;o.set(l,"")}return{html:i(Pl(t.html,o)),context:e,cookies:n.cookies}}
33
33
  export{Et,cn,Be,V,ds,Kn,Xn,Da,Bo,ps,ot,La,Tt,Fe,ja,Ba,Fa,Fo,za,Gn};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ns,$o,vm,su,Ro}from"./chunk-g17g6w1t.js";import"./chunk-13awnyq0.js";import"./chunk-ck4ypzet.js";import"./chunk-0jdz31q1.js";export{vm as buildModuleRegistryScript,Ro as buildSharedModuleRegistries,su as exportsMutableBinding,ns as registeredModuleIdsIn,$o as registeredModuleNamesIn};
2
+ import{ns,$o,vm,su,Ro}from"./chunk-46fzxsh0.js";import"./chunk-13awnyq0.js";import"./chunk-ck4ypzet.js";import"./chunk-0jdz31q1.js";export{vm as buildModuleRegistryScript,Ro as buildSharedModuleRegistries,su as exportsMutableBinding,ns as registeredModuleIdsIn,$o as registeredModuleNamesIn};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Q,Xe}from"./chunk-ggez55jb.js";var o=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function u(t,e,r){let i={fullTag:r,content:e,attrs:t};if(/\bserver\b/.test(t))return{...i,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...i,type:"client"};if(o.test(e))return{...i,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...i,type:"client"};return{...i,type:"server"}}var S=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function gn(t){let e=[],r=[],i=[],c=0;while(c<t.length){let s=t.indexOf("<",c);if(s===-1)break;let p=Xe(t,s);if(p>s){c=p;continue}let a=Q(t,s);if(a>s){let f=t.slice(s,a),l=S.exec(f);if(l){let n=u(l[1],l[2],f);switch(n.type){case"signals":e.push(n);break;case"client":r.push(n);break;case"server":i.push(n);break}}c=a;continue}c=s+(t.startsWith("<!--",s)?4:1)}return{signals:e,client:r,server:i}}
2
+ import{Q,Xe}from"./chunk-cxzy7kxg.js";var o=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function u(t,e,r){let i={fullTag:r,content:e,attrs:t};if(/\bserver\b/.test(t))return{...i,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...i,type:"client"};if(o.test(e))return{...i,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...i,type:"client"};return{...i,type:"server"}}var S=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function gn(t){let e=[],r=[],i=[],c=0;while(c<t.length){let s=t.indexOf("<",c);if(s===-1)break;let p=Xe(t,s);if(p>s){c=p;continue}let a=Q(t,s);if(a>s){let f=t.slice(s,a),l=S.exec(f);if(l){let n=u(l[1],l[2],f);switch(n.type){case"signals":e.push(n);break;case"client":r.push(n);break;case"server":i.push(n);break}}c=a;continue}c=s+(t.startsWith("<!--",s)?4:1)}return{signals:e,client:r,server:i}}
3
3
  export{gn};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{et,Ln,go,Yi,z}from"./chunk-w98yt4d4.js";import{Dn}from"./chunk-4zw9trtx.js";import{Zr,C,Ul,vt,oa,Vl}from"./chunk-4b110x6r.js";import{D}from"./chunk-phzhmnnm.js";import{T,R}from"./chunk-0jdz31q1.js";import{Yr,xo,Hn,Fl,je}from"./chunk-ck4ypzet.js";import{mo,d,m,Ee,Ur,p,te,K,be,_,yt,wo,Le,nt,vo}from"./chunk-c08jvjqt.js";import{w}from"./chunk-v6gkjg5f.js";import{ne}from"./chunk-e5rag6rh.js";import{t,h}from"./chunk-ahf9j8wb.js";import{c}from"./chunk-8tfpv6zf.js";import Rt from"path";import mn from"process";import{AsyncLocalStorage as ac}from"async_hooks";var ri=new ac;function Pn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function ii(e,n){return ri.run(Pn(e),n)}async function oi(e,n){let r=ri.getStore();if(!r)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let i=r.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let u=JSON.stringify(l,(v,S)=>{if(S===void 0||typeof S==="function"||typeof S==="symbol"||typeof S==="bigint"||typeof S==="number"&&!Number.isFinite(S))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(S&&typeof S==="object"&&!Array.isArray(S)&&Object.getPrototypeOf(S)!==Object.prototype&&Object.getPrototypeOf(S)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return S}),f=JSON.parse(u);return r.values.set(e,f),f}).catch((l)=>{throw r.pending.delete(e),l});return r.pending.set(e,a),a}function zr(e){let n=e.__stx_server_data;if(!n?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(n.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function G(e,n=!1){let r=t(e),i=[],a=new Set,l=0,u=0,f=r.length,v=()=>{if(l!==0)return;let S=r.slice(u).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(S){if(n&&S[1]==="const")return;let V=S[2];if(!a.has(V))i.push(V),a.add(V);return}let I=r.slice(u).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){if(n&&r.slice(u).startsWith("const"))return;I[1].split(",").forEach((V)=>{let W=V.trim();if(!W)return;let Z=W.indexOf(":"),X=(Z>=0?W.slice(Z+1).trim():W).split(/[\s=]/)[0];if(X&&!a.has(X))i.push(X),a.add(X)});return}let j=r.slice(u).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(j){if(n&&r.slice(u).startsWith("const"))return;j[1].split(",").forEach((V)=>{let W=V.trim().replace(/^\.\.\./,"");if(!W)return;let Z=W.split(/[\s=]/)[0];if(Z&&!a.has(Z))i.push(Z),a.add(Z)});return}if(n)return;let L=r.slice(u).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let V=L[1];if(!a.has(V))i.push(V),a.add(V);return}let M=r.slice(u).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let V=M[1];if(!a.has(V))i.push(V),a.add(V)}};while(u<f){if(r[u]==="{"){l++,u++;continue}if(r[u]==="}"){l--,u++;continue}if(l===0&&/[a-z]/i.test(r[u])&&(u===0||/\s|[;{}()]/.test(r[u-1])))v();u++}return i.join(", ")}function Js(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function cc(e,n=G(e).split(",").map((r)=>r.trim()).filter(Boolean)){let r=new Set(G(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>r.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function Ys(e,n){let r=`{ ${cc(e,n)} }`;return G(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${r}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:r}import ln from"fs";import Ue from"path";function J(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var ai=new Map;function Nr(e,n=!0){let r=ai.get(e);if(n&&r)return r;let i=new Map,a=[Ue.join(e,"src"),Ue.join(e,"dist"),e];function l(u,f){if(f>6)return;let v;try{v=ln.readdirSync(u,{withFileTypes:!0})}catch{return}for(let S of v){let I=Ue.join(u,S.name);if(S.isDirectory()){if(S.name==="node_modules"||S.name.startsWith("."))continue;l(I,f+1)}else if(S.isFile()&&S.name.endsWith(".stx")){let j=S.name.slice(0,-4);if(!i.has(j))i.set(j,I);let L=j.toLowerCase();if(!i.has(L))i.set(L,I);let M=J(j);if(!i.has(M))i.set(M,I)}}}for(let u of a)if(l(u,0),i.size>0)break;if(n)ai.set(e,i);return i}function Zs(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let r=n;while(!0){let i=Ue.join(r,"node_modules",e);try{if(ln.statSync(i).isDirectory())return i}catch{}let a=Ue.dirname(r);if(a===r)return null;r=a}}function Qs(e,n,r={}){return[Ue.resolve(Ue.dirname(n),`${e}.stx`),Ue.resolve(Ue.dirname(n),e),Ue.resolve(r.componentsDir||"components",`${e}.stx`),Ue.resolve(r.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function ci(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,r=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=J(n);return[n,r,i]}function Ii(e,n){let[r,i,a]=ci(e);for(let l of[r,r.toLowerCase(),i,a]){let u=n?.__importedComponents?.get(l);if(u!==void 0)return u}}function Oi(e,n){let r=n?Ue.resolve(n):void 0,i=Ue.dirname(Ue.resolve(e));for(;;){if(ln.existsSync(Ue.join(i,"package.json")))return r&&i===r?void 0:i;let a=Ue.dirname(i);if(a===i)return;i=a}}var lc=["src/ui","src/components","components","dist"];function us(e,n){let r=Ue.resolve(e);if(!n&&!r.split(Ue.sep).includes("node_modules"))return[];let i=Oi(r,n);if(!i)return[];let a=[];try{let f=JSON.parse(ln.readFileSync(Ue.join(i,"package.json"),"utf8")).stx?.components;if(Array.isArray(f))a=f.filter((v)=>typeof v==="string")}catch{}let l=a.length?a:lc;return[Ue.dirname(Ue.resolve(e)),...l.map((u)=>Ue.resolve(i,u))]}function*Ni(e,n,r={},i){let a=ci(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Ue.resolve(Ue.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],u=r.projectRoot||process.cwd(),f=[...us(n,r.projectRoot),...i?.__originalFilePath?[Ue.join(Ue.dirname(i.__originalFilePath),"components")]:[],...r.componentsDir?[r.componentsDir]:[],Ue.join(Ue.dirname(n),"components"),Ue.resolve(u,"src/components"),Ue.resolve(u,"components"),...import.meta.dir?[Ue.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(f)){for(let S of l)yield Ue.join(v,S);try{for(let S of ln.readdirSync(v,{withFileTypes:!0}))if(S.isDirectory())for(let I of l)yield Ue.join(v,S.name,I)}catch{}}}function li(e,n,r={},i){let a=Ii(e,i);if(a!==void 0)return a;for(let l of Ni(e,n,r,i))try{if(ln.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function eo(e,n=[],r={}){let i=new Set([...e].map((S)=>S.replace(/[-_]/g,"").toLowerCase()));if(!i.has("src")&&!i.has("source")||!i.has("alt")&&!i.has("decorative"))return!1;let a=new Map(Object.entries(r).map(([S,I])=>[S.replace(/[-_]/g,"").toLowerCase(),I])),l=a.get("alt"),u=a.get("decorative"),f=typeof l==="string"&&!!l.trim(),v=typeof u==="string"?!["false","0","off","no"].includes(u.trim().toLowerCase()):Boolean(u);if(!f&&!v)return!1;if(["defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((S)=>i.has(S)))return!1;if([...n].some((S)=>!["load","error"].includes(S.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;if(i.has("resizemode")&&(i.has("fit")||i.has("objectfit")))return!1;if(i.has("src")&&i.has("source"))return!1;return["fit","objectfit","resizemode","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((S)=>i.has(S))}import Ns from"fs";import xe from"path";import Zt from"path";import jn from"fs";var uc=new Set(["touchstart","touchmove","wheel","mousewheel"]);function qs(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return uc.has(e.toLowerCase())}var ui=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"]),pi={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"},pc=new Set(["ctrl","alt","shift","meta"]),gi={left:0,middle:1,right:2};function fi(e){let n={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let r of e){let i=r.toLowerCase();if(i==="prevent")n.prevent=!0;else if(i==="stop")n.stop=!0;else if(i==="once")n.once=!0;else if(i==="capture")n.capture=!0;else if(i==="self")n.self=!0;else if(i==="passive")n.passive=!0;else if(i==="nonpassive")n.nonpassive=!0;else if(pc.has(i))n.systemKeys.push(i);else if(i in gi)n.mouse=i;else if(i in pi||/^[a-z]$/.test(i))n.keys.push(pi[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);n.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);n.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return n}function mi(e,n=""){let r=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[u,f,v]=l,S=l.index,I=S+u.length,j=`__stx_evt_${n}${i++}`,L=[],M=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,V;while((V=M.exec(v))!==null){let[,Z,q]=V,X=Z.split("."),U=X[0];if(!ui.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:fi(X.slice(1)),elementId:j})}let W=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((V=W.exec(v))!==null){let[,Z,q]=V,X=Z.split("."),U=X[0];if(!ui.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:fi(X.slice(1)),elementId:j})}if(L.length>0)r.push({originalTag:u,elementId:j,events:L,startIndex:S,endIndex:I})}return r}function fc(e){let n=[],{modifiers:r}=e;if(r.self)n.push("if ($event.target !== $el) return");for(let i of r.systemKeys)n.push(`if (!$event.${i}Key) return`);if(r.keys.length>0){let i=r.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(r.mouse!==null){let i=gi[r.mouse];n.push(`if ($event.button !== ${i}) return`)}if(r.prevent)n.push("$event.preventDefault()");if(r.stop)n.push("$event.stopPropagation()");return n.join("; ")}function dc(e,n){let r=e;if(n.debounce!==null)r=`__stx_debounce(() => { ${r} }, ${n.debounce})`;else if(n.throttle!==null)r=`__stx_throttle(() => { ${r} }, ${n.throttle})`;return r}function Xs(e){let n=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n))return e;return`if (typeof ${n} === 'function' && !${n}._isSignal) ${n}($event);`}function gc(e){let{modifiers:n}=e,r=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=fc(e),a=dc(Xs(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(qs(e.event,n))l.push("passive: true");let u=l.length>0?`, { ${l.join(", ")} }`:"",f=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
2
+ import{et,Ln,go,Yi,z}from"./chunk-w98yt4d4.js";import{Dn}from"./chunk-d2rwg24x.js";import{Zr,C,Ul,vt,oa,Vl}from"./chunk-4b110x6r.js";import{D}from"./chunk-phzhmnnm.js";import{T,R}from"./chunk-0jdz31q1.js";import{Yr,xo,Hn,Fl,je}from"./chunk-ck4ypzet.js";import{mo,d,m,Ee,Ur,p,te,K,be,_,yt,wo,Le,nt,vo}from"./chunk-c08jvjqt.js";import{w}from"./chunk-v6gkjg5f.js";import{ne}from"./chunk-e5rag6rh.js";import{t,h}from"./chunk-ahf9j8wb.js";import{c}from"./chunk-8tfpv6zf.js";import Rt from"path";import mn from"process";import{AsyncLocalStorage as ac}from"async_hooks";var ri=new ac;function Pn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function ii(e,n){return ri.run(Pn(e),n)}async function oi(e,n){let r=ri.getStore();if(!r)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let i=r.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let u=JSON.stringify(l,(v,S)=>{if(S===void 0||typeof S==="function"||typeof S==="symbol"||typeof S==="bigint"||typeof S==="number"&&!Number.isFinite(S))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(S&&typeof S==="object"&&!Array.isArray(S)&&Object.getPrototypeOf(S)!==Object.prototype&&Object.getPrototypeOf(S)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return S}),f=JSON.parse(u);return r.values.set(e,f),f}).catch((l)=>{throw r.pending.delete(e),l});return r.pending.set(e,a),a}function zr(e){let n=e.__stx_server_data;if(!n?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(n.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function G(e,n=!1){let r=t(e),i=[],a=new Set,l=0,u=0,f=r.length,v=()=>{if(l!==0)return;let S=r.slice(u).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(S){if(n&&S[1]==="const")return;let V=S[2];if(!a.has(V))i.push(V),a.add(V);return}let I=r.slice(u).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){if(n&&r.slice(u).startsWith("const"))return;I[1].split(",").forEach((V)=>{let W=V.trim();if(!W)return;let Z=W.indexOf(":"),X=(Z>=0?W.slice(Z+1).trim():W).split(/[\s=]/)[0];if(X&&!a.has(X))i.push(X),a.add(X)});return}let j=r.slice(u).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(j){if(n&&r.slice(u).startsWith("const"))return;j[1].split(",").forEach((V)=>{let W=V.trim().replace(/^\.\.\./,"");if(!W)return;let Z=W.split(/[\s=]/)[0];if(Z&&!a.has(Z))i.push(Z),a.add(Z)});return}if(n)return;let L=r.slice(u).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let V=L[1];if(!a.has(V))i.push(V),a.add(V);return}let M=r.slice(u).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let V=M[1];if(!a.has(V))i.push(V),a.add(V)}};while(u<f){if(r[u]==="{"){l++,u++;continue}if(r[u]==="}"){l--,u++;continue}if(l===0&&/[a-z]/i.test(r[u])&&(u===0||/\s|[;{}()]/.test(r[u-1])))v();u++}return i.join(", ")}function Js(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function cc(e,n=G(e).split(",").map((r)=>r.trim()).filter(Boolean)){let r=new Set(G(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>r.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function Ys(e,n){let r=`{ ${cc(e,n)} }`;return G(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${r}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:r}import ln from"fs";import Ue from"path";function J(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var ai=new Map;function Nr(e,n=!0){let r=ai.get(e);if(n&&r)return r;let i=new Map,a=[Ue.join(e,"src"),Ue.join(e,"dist"),e];function l(u,f){if(f>6)return;let v;try{v=ln.readdirSync(u,{withFileTypes:!0})}catch{return}for(let S of v){let I=Ue.join(u,S.name);if(S.isDirectory()){if(S.name==="node_modules"||S.name.startsWith("."))continue;l(I,f+1)}else if(S.isFile()&&S.name.endsWith(".stx")){let j=S.name.slice(0,-4);if(!i.has(j))i.set(j,I);let L=j.toLowerCase();if(!i.has(L))i.set(L,I);let M=J(j);if(!i.has(M))i.set(M,I)}}}for(let u of a)if(l(u,0),i.size>0)break;if(n)ai.set(e,i);return i}function Zs(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let r=n;while(!0){let i=Ue.join(r,"node_modules",e);try{if(ln.statSync(i).isDirectory())return i}catch{}let a=Ue.dirname(r);if(a===r)return null;r=a}}function Qs(e,n,r={}){return[Ue.resolve(Ue.dirname(n),`${e}.stx`),Ue.resolve(Ue.dirname(n),e),Ue.resolve(r.componentsDir||"components",`${e}.stx`),Ue.resolve(r.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function ci(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,r=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=J(n);return[n,r,i]}function Ii(e,n){let[r,i,a]=ci(e);for(let l of[r,r.toLowerCase(),i,a]){let u=n?.__importedComponents?.get(l);if(u!==void 0)return u}}function Oi(e,n){let r=n?Ue.resolve(n):void 0,i=Ue.dirname(Ue.resolve(e));for(;;){if(ln.existsSync(Ue.join(i,"package.json")))return r&&i===r?void 0:i;let a=Ue.dirname(i);if(a===i)return;i=a}}var lc=["src/ui","src/components","components","dist"];function us(e,n){let r=Ue.resolve(e);if(!n&&!r.split(Ue.sep).includes("node_modules"))return[];let i=Oi(r,n);if(!i)return[];let a=[];try{let f=JSON.parse(ln.readFileSync(Ue.join(i,"package.json"),"utf8")).stx?.components;if(Array.isArray(f))a=f.filter((v)=>typeof v==="string")}catch{}let l=a.length?a:lc;return[Ue.dirname(Ue.resolve(e)),...l.map((u)=>Ue.resolve(i,u))]}function*Ni(e,n,r={},i){let a=ci(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Ue.resolve(Ue.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],u=r.projectRoot||process.cwd(),f=[...us(n,r.projectRoot),...i?.__originalFilePath?[Ue.join(Ue.dirname(i.__originalFilePath),"components")]:[],...r.componentsDir?[r.componentsDir]:[],Ue.join(Ue.dirname(n),"components"),Ue.resolve(u,"src/components"),Ue.resolve(u,"components"),...import.meta.dir?[Ue.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(f)){for(let S of l)yield Ue.join(v,S);try{for(let S of ln.readdirSync(v,{withFileTypes:!0}))if(S.isDirectory())for(let I of l)yield Ue.join(v,S.name,I)}catch{}}}function li(e,n,r={},i){let a=Ii(e,i);if(a!==void 0)return a;for(let l of Ni(e,n,r,i))try{if(ln.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function eo(e,n=[],r={}){let i=new Set([...e].map((S)=>S.replace(/[-_]/g,"").toLowerCase()));if(!i.has("src")&&!i.has("source")||!i.has("alt")&&!i.has("decorative"))return!1;let a=new Map(Object.entries(r).map(([S,I])=>[S.replace(/[-_]/g,"").toLowerCase(),I])),l=a.get("alt"),u=a.get("decorative"),f=typeof l==="string"&&!!l.trim(),v=typeof u==="string"?!["false","0","off","no"].includes(u.trim().toLowerCase()):Boolean(u);if(!f&&!v)return!1;if(["defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((S)=>i.has(S)))return!1;if([...n].some((S)=>!["load","error"].includes(S.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;if(i.has("resizemode")&&(i.has("fit")||i.has("objectfit")))return!1;if(i.has("src")&&i.has("source"))return!1;return["fit","objectfit","resizemode","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((S)=>i.has(S))}import Ns from"fs";import xe from"path";import Zt from"path";import jn from"fs";var uc=new Set(["touchstart","touchmove","wheel","mousewheel"]);function qs(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return uc.has(e.toLowerCase())}var ui=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"]),pi={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"},pc=new Set(["ctrl","alt","shift","meta"]),gi={left:0,middle:1,right:2};function fi(e){let n={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let r of e){let i=r.toLowerCase();if(i==="prevent")n.prevent=!0;else if(i==="stop")n.stop=!0;else if(i==="once")n.once=!0;else if(i==="capture")n.capture=!0;else if(i==="self")n.self=!0;else if(i==="passive")n.passive=!0;else if(i==="nonpassive")n.nonpassive=!0;else if(pc.has(i))n.systemKeys.push(i);else if(i in gi)n.mouse=i;else if(i in pi||/^[a-z]$/.test(i))n.keys.push(pi[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);n.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);n.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return n}function mi(e,n=""){let r=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[u,f,v]=l,S=l.index,I=S+u.length,j=`__stx_evt_${n}${i++}`,L=[],M=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,V;while((V=M.exec(v))!==null){let[,Z,q]=V,X=Z.split("."),U=X[0];if(!ui.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:fi(X.slice(1)),elementId:j})}let W=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((V=W.exec(v))!==null){let[,Z,q]=V,X=Z.split("."),U=X[0];if(!ui.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:fi(X.slice(1)),elementId:j})}if(L.length>0)r.push({originalTag:u,elementId:j,events:L,startIndex:S,endIndex:I})}return r}function fc(e){let n=[],{modifiers:r}=e;if(r.self)n.push("if ($event.target !== $el) return");for(let i of r.systemKeys)n.push(`if (!$event.${i}Key) return`);if(r.keys.length>0){let i=r.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(r.mouse!==null){let i=gi[r.mouse];n.push(`if ($event.button !== ${i}) return`)}if(r.prevent)n.push("$event.preventDefault()");if(r.stop)n.push("$event.stopPropagation()");return n.join("; ")}function dc(e,n){let r=e;if(n.debounce!==null)r=`__stx_debounce(() => { ${r} }, ${n.debounce})`;else if(n.throttle!==null)r=`__stx_throttle(() => { ${r} }, ${n.throttle})`;return r}function Xs(e){let n=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n))return e;return`if (typeof ${n} === 'function' && !${n}._isSignal) ${n}($event);`}function gc(e){let{modifiers:n}=e,r=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=fc(e),a=dc(Xs(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(qs(e.event,n))l.push("passive: true");let u=l.length>0?`, { ${l.join(", ")} }`:"",f=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
3
3
  (function() {
4
4
  var $el = document.getElementById('${r}');
5
5
  if (!$el) return;
@@ -112,7 +112,7 @@ else {
112
112
  `)}
113
113
  })();
114
114
  </script>`}function mc(e,n=""){let r=mi(e,n);if(r.length===0)return{template:e,bindings:[]};let i=e,a=[];for(let l=r.length-1;l>=0;l--){let u=r[l],f=u.originalTag;if(!f.includes(" id="))f=f.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${u.elementId}"`);else{let v=f.match(/id=["']([^"']+)["']/);if(v)for(let S of u.events)S.elementId=v[1]}for(let v of u.events){let S=v.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),I=new RegExp(`\\s*${S}\\s*=\\s*"[^"]*"`,"g"),j=new RegExp(`\\s*${S}\\s*=\\s*'[^']*'`,"g");f=f.replace(I,""),f=f.replace(j,"")}i=i.slice(0,u.startIndex)+f+i.slice(u.endIndex),a.push(...u.events)}return{template:i,bindings:a}}function di(e){let n=e.$uid;return typeof n==="string"&&n?`${n}_`:""}function ol(e,n,r){if(Vl(e))return e;if(n.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:f,bindings:v}=mc(e,di(n)),S=n.__stx_event_bindings||[];return n.__stx_event_bindings=[...S,...v],f}let i=mi(e,di(n));if(i.length===0)return e;let a=e;for(let f=i.length-1;f>=0;f--){let v=i[f],S=v.originalTag;if(!S.includes(" id="))S=S.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${v.elementId}"`);else{let I=S.match(/id=["']([^"']+)["']/);if(I)for(let j of v.events)j.elementId=I[1]}for(let I of v.events){let j=I.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),L=new RegExp(`\\s*${j}\\s*=\\s*"[^"]*"`,"g"),M=new RegExp(`\\s*${j}\\s*=\\s*'[^']*'`,"g");S=S.replace(L,""),S=S.replace(M,"")}a=a.slice(0,v.startIndex)+S+a.slice(v.endIndex)}let l=Mi(i.flatMap((f)=>f.events)),u=c(a);if(u!==-1)a=a.slice(0,u)+l+`
115
- `+a.slice(u);else a+=l;return a}function hi(e,n){let r=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(n){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))r.add(a)}return r}function Ut(e,n){let r=t(e),{depths:i,balanced:a}=h(r),l=(f)=>!a||i[f]===0,u=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let f of r.matchAll(u)){let v=(f.index??0)+f[0].length-f[1].length;if(l(v))return!0}for(let f of r.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(f.index??0)&&hi(f[1],!0).has(n))return!0;for(let f of r.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(f.index??0)&&hi(f[1],!1).has(n))return!0;return!1}var qe="0.2.910";var xi=Symbol.for(`stx.lazy-module-promises.${qe}`);function xc(){let e=globalThis;return e[xi]??=new Map,e[xi]}function o(e,n){let r=xc(),i=`${import.meta.url}\x00${e}`,a=r.get(i);if(a)return a;let l=n();return r.set(i,l),l.catch(()=>{if(r.get(i)===l)r.delete(i)}),l}var bc=/<\/(script)/gi;function me(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(bc,"<\\/$1")}import bi from"fs";var yi=[];function k(e){let n=new T(e);return yi.push(n),n}function il(){for(let e of yi)e.clear()}function E(e,...n){return`${n.map((r)=>String(r??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function Mr(e){let n=[];for(let r of new Set(e))try{n.push({path:r,mtimeMs:bi.statSync(r).mtimeMs})}catch{}return n}function to(e){for(let n of e)try{if(bi.statSync(n.path).mtimeMs!==n.mtimeMs)return!1}catch{return!1}return!0}var Oe=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var yc=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function _c(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let r=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!r)return null;return{pkg:r[1],subpath:r[2]||""}}let n=e.match(/^([^/]+)(\/.*)?$/);if(!n)return null;return{pkg:n[1],subpath:n[2]||""}}function wc(e,n){let r=n;while(!0){let i=Zt.join(r,"node_modules",e,"package.json");if(jn.existsSync(i))return Zt.dirname(i);let a=Zt.dirname(r);if(a===r)return null;r=a}}function vc(e,n){if(!e||typeof e!=="object")return null;let r=(a)=>{if(typeof a==="string")return a;if(a&&typeof a==="object"){if(typeof a.import==="string")return a.import;if(typeof a.default==="string")return a.default;if(typeof a.import==="object")return r(a.import);if(typeof a.default==="object")return r(a.default)}return null};if(Object.prototype.hasOwnProperty.call(e,n))return r(e[n]);let i=null;for(let a of Object.keys(e)){let l=a.indexOf("*");if(l===-1)continue;let u=a.slice(0,l),f=a.slice(l+1);if(!n.startsWith(u)||!n.endsWith(f))continue;if(n.length<u.length+f.length)continue;if(!i||u.length>i.prefix.length)i={pattern:a,prefix:u,suffix:f}}if(i){let a=n.slice(i.prefix.length,n.length-i.suffix.length),l=r(e[i.pattern]);if(l)return l.replace("*",a)}return null}function Sc(e,n){let r=_c(e);if(!r||!r.subpath)return null;let i=wc(r.pkg,n);if(!i)return null;let a;try{a=JSON.parse(jn.readFileSync(Zt.join(i,"package.json"),"utf8"))}catch{return null}let l=`.${r.subpath}`,u=vc(a.exports,l);if(!u)return null;let f=Zt.resolve(i,u);return jn.existsSync(f)?f:null}function Vi(e,n){let r=n.filePath?Zt.dirname(n.filePath):n.projectRoot||process.cwd(),i=n.projectRoot||process.cwd(),a=new Set,l=[],u=[];return{code:e.replace(yc,(v,S)=>{let I;try{if(S.startsWith("./")||S.startsWith("../")||S.startsWith("/")){if(I=S.startsWith("/")?S:Zt.resolve(r,S),!jn.existsSync(I))throw Error(`file not found: ${I}`)}else{let j=null;try{j=Bun.resolveSync(S,i)}catch{j=Sc(S,i)}if(!j)throw Error(`could not resolve ${S} (Bun.resolveSync + exports fallback both failed)`);I=j}}catch(j){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(S)} (from ${n.filePath||"<unknown>"}): ${j?.message||j}`),u.push(S),""}if(a.has(I))return"";a.add(I);try{let j=jn.readFileSync(I,"utf8");l.push({source:S,resolvedPath:I,contents:j})}catch(j){console.warn(`[stx:vendor-css] could not read ${I}: ${j?.message||j}`),u.push(S)}return""}),styles:l,unresolved:u}}function $c(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Wi(e){if(e.length===0)return"";return`${e.map((n)=>`<style data-stx-vendor="${$c(n.source)}" data-stx-layer="vendor">
115
+ `+a.slice(u);else a+=l;return a}function hi(e,n){let r=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(n){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))r.add(a)}return r}function Ut(e,n){let r=t(e),{depths:i,balanced:a}=h(r),l=(f)=>!a||i[f]===0,u=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let f of r.matchAll(u)){let v=(f.index??0)+f[0].length-f[1].length;if(l(v))return!0}for(let f of r.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(f.index??0)&&hi(f[1],!0).has(n))return!0;for(let f of r.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(f.index??0)&&hi(f[1],!1).has(n))return!0;return!1}var qe="0.2.912";var xi=Symbol.for(`stx.lazy-module-promises.${qe}`);function xc(){let e=globalThis;return e[xi]??=new Map,e[xi]}function o(e,n){let r=xc(),i=`${import.meta.url}\x00${e}`,a=r.get(i);if(a)return a;let l=n();return r.set(i,l),l.catch(()=>{if(r.get(i)===l)r.delete(i)}),l}var bc=/<\/(script)/gi;function me(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(bc,"<\\/$1")}import bi from"fs";var yi=[];function k(e){let n=new T(e);return yi.push(n),n}function il(){for(let e of yi)e.clear()}function E(e,...n){return`${n.map((r)=>String(r??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function Mr(e){let n=[];for(let r of new Set(e))try{n.push({path:r,mtimeMs:bi.statSync(r).mtimeMs})}catch{}return n}function to(e){for(let n of e)try{if(bi.statSync(n.path).mtimeMs!==n.mtimeMs)return!1}catch{return!1}return!0}var Oe=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var yc=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function _c(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let r=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!r)return null;return{pkg:r[1],subpath:r[2]||""}}let n=e.match(/^([^/]+)(\/.*)?$/);if(!n)return null;return{pkg:n[1],subpath:n[2]||""}}function wc(e,n){let r=n;while(!0){let i=Zt.join(r,"node_modules",e,"package.json");if(jn.existsSync(i))return Zt.dirname(i);let a=Zt.dirname(r);if(a===r)return null;r=a}}function vc(e,n){if(!e||typeof e!=="object")return null;let r=(a)=>{if(typeof a==="string")return a;if(a&&typeof a==="object"){if(typeof a.import==="string")return a.import;if(typeof a.default==="string")return a.default;if(typeof a.import==="object")return r(a.import);if(typeof a.default==="object")return r(a.default)}return null};if(Object.prototype.hasOwnProperty.call(e,n))return r(e[n]);let i=null;for(let a of Object.keys(e)){let l=a.indexOf("*");if(l===-1)continue;let u=a.slice(0,l),f=a.slice(l+1);if(!n.startsWith(u)||!n.endsWith(f))continue;if(n.length<u.length+f.length)continue;if(!i||u.length>i.prefix.length)i={pattern:a,prefix:u,suffix:f}}if(i){let a=n.slice(i.prefix.length,n.length-i.suffix.length),l=r(e[i.pattern]);if(l)return l.replace("*",a)}return null}function Sc(e,n){let r=_c(e);if(!r||!r.subpath)return null;let i=wc(r.pkg,n);if(!i)return null;let a;try{a=JSON.parse(jn.readFileSync(Zt.join(i,"package.json"),"utf8"))}catch{return null}let l=`.${r.subpath}`,u=vc(a.exports,l);if(!u)return null;let f=Zt.resolve(i,u);return jn.existsSync(f)?f:null}function Vi(e,n){let r=n.filePath?Zt.dirname(n.filePath):n.projectRoot||process.cwd(),i=n.projectRoot||process.cwd(),a=new Set,l=[],u=[];return{code:e.replace(yc,(v,S)=>{let I;try{if(S.startsWith("./")||S.startsWith("../")||S.startsWith("/")){if(I=S.startsWith("/")?S:Zt.resolve(r,S),!jn.existsSync(I))throw Error(`file not found: ${I}`)}else{let j=null;try{j=Bun.resolveSync(S,i)}catch{j=Sc(S,i)}if(!j)throw Error(`could not resolve ${S} (Bun.resolveSync + exports fallback both failed)`);I=j}}catch(j){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(S)} (from ${n.filePath||"<unknown>"}): ${j?.message||j}`),u.push(S),""}if(a.has(I))return"";a.add(I);try{let j=jn.readFileSync(I,"utf8");l.push({source:S,resolvedPath:I,contents:j})}catch(j){console.warn(`[stx:vendor-css] could not read ${I}: ${j?.message||j}`),u.push(S)}return""}),styles:l,unresolved:u}}function $c(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Wi(e){if(e.length===0)return"";return`${e.map((n)=>`<style data-stx-vendor="${$c(n.source)}" data-stx-layer="vendor">
116
116
  @layer vendor {
117
117
  ${n.contents}
118
118
  }
@@ -182,7 +182,7 @@ else {
182
182
  // STX: auto-generated event bindings
183
183
  ${e.map((r,i)=>Mc(r,i)).join(`
184
184
  `)}`}function Si(e){let n=[],r=new Set,i=e.replace(/^\s*import\s+.*$/gm,""),a=0,l=i.length,u=0;while(u<l){let f=i[u];if(f==="'"||f==='"'||f==="`"){let v=f;if(u++,v==="`"){let S=0;while(u<l){if(i[u]==="\\"){u+=2;continue}if(i[u]==="`"&&S===0){u++;break}if(i[u]==="$"&&i[u+1]==="{"){S++,u+=2;continue}if(i[u]==="}"&&S>0){S--,u++;continue}u++}}else while(u<l){if(i[u]==="\\"){u+=2;continue}if(i[u]===v){u++;break}u++}continue}if(f==="/"&&i[u+1]==="/"){while(u<l&&i[u]!==`
185
- `)u++;continue}if(f==="/"&&i[u+1]==="*"){u+=2;while(u<l-1&&!(i[u]==="*"&&i[u+1]==="/"))u++;u+=2;continue}if(f==="{"){a++,u++;continue}if(f==="}"){a--,u++;continue}if(a===0){let v=i.slice(u),S=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(S){let L=S[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=S[0].length;continue}let I=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){I[1].split(",").forEach((L)=>{let M=L.trim(),V=M.indexOf(":"),W=V>=0?M.slice(V+1).trim().split(/[\s=]/)[0]:M.split(/[\s=]/)[0];if(W&&!W.startsWith("_")&&!r.has(W))n.push(W),r.add(W)}),u+=I[0].length;continue}let j=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(j){let L=j[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=j[0].length;continue}}u++}return n}var Nc=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 Lc(e){let n=new Set,r=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(L){let M;while((M=r.exec(L))!==null){let V=M[0];if(!Nc.has(V))n.add(V)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let u=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=u.exec(e))!==null)i(l[1]);let f=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=f.exec(e))!==null)i(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)i(l[1]);let S=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=S.exec(e))!==null)i(l[1]);let I=/@model\s*=\s*["']([^"']*)["']/gi;while((l=I.exec(e))!==null)i(l[1]);let j=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=j.exec(e))!==null)i(l[1]);return n}async function Je(e,n={}){let r=e,i="",a=!1,l=[],u=Vi(r,{filePath:n.filePath,projectRoot:n.projectRoot});r=u.code;let f=Wi(u.styles),v=Gt(r);r=v.code,l=[...v.imports,...v.models];let{hasUserImports:S,bundleClientScript:I}=await o("stx/client-script-bundler",()=>import("./chunk-q33tyfpp.js"));if(S(r))r=await I(r,n.filePath||"",{projectRoot:n.projectRoot,minify:n.production}),a=!0;if(n.autoImports!==!1){let U=_l(r);r=U.code,i=Cl(U.stxImports,U.browserImports.filter((H)=>!l.includes(H)))}if(i=`${In(r,n.serverData)}${i}`,r=D(r),!a&&Ye(n.attrs||""))r=Ze(r);let j=Dc(n.eventBindings||[]),L=(n.attrs||"").trim(),M=/\btype\s*=\s*["']module["']/i.test(L),V=n.instanceId?` data-stx-instance="${n.instanceId}"`:"";if(M){let U=L.replace(/\btype\s*=\s*["']module["']/i,"").trim(),H=`type="module" data-stx-scoped${V}${U?` ${U}`:""}`;return`${f}<script ${H}>
185
+ `)u++;continue}if(f==="/"&&i[u+1]==="*"){u+=2;while(u<l-1&&!(i[u]==="*"&&i[u+1]==="/"))u++;u+=2;continue}if(f==="{"){a++,u++;continue}if(f==="}"){a--,u++;continue}if(a===0){let v=i.slice(u),S=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(S){let L=S[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=S[0].length;continue}let I=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){I[1].split(",").forEach((L)=>{let M=L.trim(),V=M.indexOf(":"),W=V>=0?M.slice(V+1).trim().split(/[\s=]/)[0]:M.split(/[\s=]/)[0];if(W&&!W.startsWith("_")&&!r.has(W))n.push(W),r.add(W)}),u+=I[0].length;continue}let j=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(j){let L=j[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=j[0].length;continue}}u++}return n}var Nc=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 Lc(e){let n=new Set,r=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(L){let M;while((M=r.exec(L))!==null){let V=M[0];if(!Nc.has(V))n.add(V)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let u=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=u.exec(e))!==null)i(l[1]);let f=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=f.exec(e))!==null)i(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)i(l[1]);let S=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=S.exec(e))!==null)i(l[1]);let I=/@model\s*=\s*["']([^"']*)["']/gi;while((l=I.exec(e))!==null)i(l[1]);let j=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=j.exec(e))!==null)i(l[1]);return n}async function Je(e,n={}){let r=e,i="",a=!1,l=[],u=Vi(r,{filePath:n.filePath,projectRoot:n.projectRoot});r=u.code;let f=Wi(u.styles),v=Gt(r);r=v.code,l=[...v.imports,...v.models];let{hasUserImports:S,bundleClientScript:I}=await o("stx/client-script-bundler",()=>import("./chunk-1gfc406y.js"));if(S(r))r=await I(r,n.filePath||"",{projectRoot:n.projectRoot,minify:n.production}),a=!0;if(n.autoImports!==!1){let U=_l(r);r=U.code,i=Cl(U.stxImports,U.browserImports.filter((H)=>!l.includes(H)))}if(i=`${In(r,n.serverData)}${i}`,r=D(r),!a&&Ye(n.attrs||""))r=Ze(r);let j=Dc(n.eventBindings||[]),L=(n.attrs||"").trim(),M=/\btype\s*=\s*["']module["']/i.test(L),V=n.instanceId?` data-stx-instance="${n.instanceId}"`:"";if(M){let U=L.replace(/\btype\s*=\s*["']module["']/i,"").trim(),H=`type="module" data-stx-scoped${V}${U?` ${U}`:""}`;return`${f}<script ${H}>
186
186
  ${me(`${i}${r}
187
187
  ${j}`)}
188
188
  </script>`}let W=oa(e),Z=/function __stx_setup_/.test(r),q=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function X(U){let H=U.length>0?`
@@ -1183,9 +1183,9 @@ ${S.join(`
1183
1183
  `){let V=e[a];if(V==="\\"){a+=2;continue}if(V==="[")M=!0;else if(V==="]")M=!1;else if(V==="/"&&!M){a++;while(a<l&&/[a-z]/i.test(e[a]))a++;return}a++}},L=()=>{if(i!==0)return;let M=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(M){let q=M[2].split(",").map((X)=>{let U=X.trim().split(":");return U[U.length-1].trim()});for(let X of q)if(X&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(X)&&!r.has(X))n.push(X),r.add(X);return}let V=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(V){let q=V[2];if(!r.has(q))n.push(q),r.add(q);return}let W=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(W){let q=W[1];if(!r.has(q))n.push(q),r.add(q);return}let Z=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Z){let q=Z[1];if(!r.has(q))n.push(q),r.add(q)}};while(a<l){if(v())continue;if(e[a]==="'"||e[a]==='"'){u(e[a]);continue}if(e[a]==="`"){f();continue}if(e[a]==="/"&&I()){j();continue}if(e[a]==="{"){i++,a++;continue}if(e[a]==="}"){i--,a++;continue}if(i===0&&/[a-z]/i.test(e[a])&&(a===0||/\s|[;{}()]/.test(e[a-1])))L();a++}return n}function zp(e,n,r){for(let i of ee(e)){let a=O(i.attrs);if(["server","src","component","stx:component"].some((f)=>a.has(f))||!kt(a))continue;let l=fn(e.slice(i.bodyStart,i.bodyEnd));if(!l)continue;let u=Object.assign(Object.create(null),r);for(let[f,v]of Object.entries(l.defaults))if(u[f]===void 0)u[f]=Cs(v);for(let f of new Set([...l.propNames,...Object.keys(l.defaults)])){let v=l.localBindings[f]??(l.propBindings[f]?void 0:f);if(v)Object.defineProperty(n,v,{value:u[f],writable:!0,enumerable:!0,configurable:!0})}if(l.identifier)Object.defineProperty(n,l.identifier,{value:u,writable:!0,enumerable:!0,configurable:!0})}}var Bp=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function Xg(e,n){let r=Vt(e),i=e.slice(r).match(/^<([a-zA-Z][a-zA-Z0-9-]*)/);if(!i)return null;let a=i[1].toLowerCase();if(!Bp.has(a))return null;let l=new RegExp(`<\\/?${a}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),u=x(e,(I,j)=>(l.lastIndex=j,l.exec(I)?.index===j?l.lastIndex:-1));if(a==="span"&&/\sdata-stx-scope\s*=/.test(u[0]?.token||""))return null;let f=0,v=!1;for(let I of u){if(f+=I.token.startsWith("</")?-1:1,f<0)return null;if(f===0){if(e.slice(I.end).trim())return null;v=!0;break}}if(!v)return null;let S=r+i[0].length;return e.slice(0,S)+n+e.slice(S)}function Ha(e,n){if(!e)return!1;return[...n.additionalComponentsDirs??[],...n.fallbackComponentsDir?[n.fallbackComponentsDir]:[]].some((i)=>{let a=xe.relative(xe.resolve(i),xe.resolve(e));return!a.startsWith("..")&&!xe.isAbsolute(a)})}async function Hr(e,n,r,i,a){let l=e.endsWith(".stx")?e.slice(0,-4):e,u=(ce)=>ce.split("-").map((le)=>le.charAt(0).toUpperCase()+le.slice(1)).join(""),f=r.__importedComponents;if(f){for(let ce of[l,l.toLowerCase(),u(l),J(l)])if(f.has(ce))return!0}let v=[...new Set([`${l}.stx`,`${u(l)}.stx`,`${J(l)}.stx`])],S=typeof a.root==="string"?xe.resolve(a.root):void 0,I=S??xe.dirname(i),j=[],L=(ce)=>{if(ce&&!j.includes(ce))j.push(ce)};for(let ce of us(i,S))L(ce);let M=r.__originalFilePath;if(M)L(xe.join(xe.dirname(M),"components"));if(Ha(n,a))L(a._rootComponentsDir);L(n),L(a._rootComponentsDir),L(xe.join(xe.dirname(i),"components")),L(a.componentsDir);for(let ce of a.additionalComponentsDirs??[])L(ce);let V=a._targetComponentFallbackNames?.some((ce)=>ce.toLowerCase()===l.toLowerCase());if(!V)for(let ce of a._targetComponentDirs??[])L(ce);if(S)L(xe.resolve(S,"resources/views/components")),L(xe.resolve(S,"resources/components")),L(xe.resolve(S,"src/components")),L(xe.resolve(S,"components"));for(let ce of a._layerComponentDirs??[])L(ce);let W=a._pluginComponentDirs;if(Array.isArray(W))for(let ce of W)L(typeof ce==="string"?ce:null);if(L(a.fallbackComponentsDir),V)for(let ce of a._targetComponentDirs??[])L(ce);let Z=a._nativePrimitivesFallback;if(Z&&!Z.except.some((ce)=>ce.toLowerCase()===l.toLowerCase()))L(Z.dir);if(l.startsWith("./")||l.startsWith("../"))return s(xe.resolve(xe.dirname(i),`${l}.stx`));let q=Na(xe.resolve(import.meta.dir,"components")),X=j.map((ce)=>xe.isAbsolute(ce)?ce:xe.resolve(I,ce)),U=`${v.join("\x00")}\x00\x00${X.join("\x00")}`,H=Or.get(U);if(H!==void 0)return H;let re=!1;e:for(let ce of X){if(Na(ce)===q)continue;for(let le of v)if(await s(xe.join(ce,le))){re=!0;break e}}return Or.set(U,re),re}function Na(e){let n=Pr.get(e);if(n!==void 0)return n;let r=e;try{r=Ns.realpathSync(e)}catch{}return Pr.set(e,r),r}function Gg(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function El(e){if(!e)return!1;let n=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(n)}function Wp(e,n,r){if(!e.includes("{{")&&!e.includes("{!!"))return e;let i=(a,l)=>{let u;try{u=N(a,n)}catch{return l}if(u===void 0||u===null)return"";let f=String(u);if(/<\/style/i.test(f))return console.warn(`[stx] a <style> expression in ${r??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return f};return e.replace(/\{!!([\s\S]*?)!!\}/g,(a,l)=>i(l,a)).replace(/\{\{([\s\S]*?)\}\}/g,(a,l)=>i(l,a))}var La=new Set;function za(e,n,r,i){let a=`${e}\x00${n}\x00${i??""}`;if(!process.env.STX_DEBUG&&La.has(a))return;La.add(a);let l=n?` used in ${n}`:"",u=i?` Cause: ${i}.`:"",f=r.length>0?`
1184
1184
  searched:
1185
1185
  ${r.map((v)=>` - ${v}`).join(`
1186
- `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${u}${f}`)}function Ba(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Fp=new Set(["for","if","show","key","ref","class","className","style"]),Wa=new Set,Ka="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",Tl=new RegExp(`\\b(?:${Ka})\\s*(?:<[^>]*>)?\\s*\\(`);function qi(e){let n=new Set,r=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${Ka})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let i of e){let a;while((a=r.exec(i))!==null)n.add(a[1]);r.lastIndex=0}return[...n]}async function Qe(e,n,r,i,a,l,u,f=new Set,v,S=mt(a),I,j=e){let{extractVariables:L}=await o("stx/variable-extractor",()=>import("./chunk-3760wpvw.js")),M=f??new Set;if(M.has(e))return`[Circular component reference: ${e}]`;let V=new Set(M);V.add(e);let W=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let Z=W&&W!=="load"&&Gg(W)?W:"";try{let q=(ge)=>ge.split("-").map((ve)=>ve.charAt(0).toUpperCase()+ve.slice(1)).join(""),X=j.endsWith(".stx")?j.slice(0,-4):j,U=null,H=a.__importedComponents;if(H){let ge=[X,X.toLowerCase(),q(X),J(X)];for(let ve of ge)if(H.has(ve)){U=H.get(ve);break}}let re=[];if(!U){let ge=[`${X}.stx`,`${q(X)}.stx`,`${J(X)}.stx`],ve=[...new Set(ge)],ze=a.__originalFilePath,Se=[];for(let Pe of us(l))if(!Se.includes(Pe))Se.push(Pe);let pt=Se.length;for(let Pe of u._layerComponentDirs??[])if(!Se.includes(Pe))Se.push(Pe);if(ze){let Pe=xe.join(xe.dirname(ze),"components");Se.push(Pe)}let tt=u._rootComponentsDir;if(typeof tt==="string"&&Ha(i,u)&&!Se.includes(tt))Se.push(tt);if(i&&!Se.includes(i))Se.push(i);if(typeof tt==="string"&&!Se.includes(tt))Se.push(tt);let It=xe.join(xe.dirname(l),"components");if(!Se.includes(It))Se.push(It);if(u.componentsDir&&u.componentsDir!==i&&!Se.includes(u.componentsDir))Se.push(u.componentsDir);for(let Pe of u.additionalComponentsDirs??[])if(Pe&&!Se.includes(Pe))Se.push(Pe);let sn=u._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(X),Pt=(I?.events??[]).map((Pe)=>Pe.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),es=Object.hasOwn(n,"checked")||Boolean(I?.reactiveProps?.includes("checked")),Bs=Object.hasOwn(n,"value")||Boolean(I?.reactiveProps?.includes("value")),Ws=!Pt.includes("valuechange")&&(es||Pt.includes("change")&&!Bs),Ft=u._nativeHostAttrs&&/^textinput$/i.test(X),rn=Pt.includes("update:value")&&!Pt.includes("input"),Cn=u._nativeHostAttrs&&/^video$/i.test(X),Fs=u._nativeHostAttrs&&/^image$/i.test(X),ts=eo([...Object.keys(n),...I?.reactiveProps??[]],I?.events,n),on=Object.hasOwn(n,"src")||Boolean(I?.reactiveProps?.includes("src")),ns=Object.hasOwn(n,"source")||Boolean(I?.reactiveProps?.includes("source")),ss=Cn&&(on||ns)&&(I?.events??[]).every((Pe)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(Pe.replace(/^@/,"").split(".")[0])),rs=new Set(["","primary","secondary","outline","ghost","danger"]),is=typeof n.variant==="string"?n.variant.trim().toLowerCase():"",os=u._nativeHostAttrs&&/^button$/i.test(X)&&!rs.has(is),Qr=u._targetComponentFallbackNames?.some((Pe)=>Pe.toLowerCase()===X.toLowerCase())??!1,Vs=Qr&&(!sn||Ws)&&(!Ft||rn)&&(!Cn||ss)&&(!Fs||ts)&&!os;for(let Pe of Vs?[]:u._targetComponentDirs??[])if(Pe&&!Se.includes(Pe))Se.push(Pe);let an=typeof u.root==="string"?xe.resolve(u.root):void 0,ei=an??xe.dirname(l),cn=[];if(an)cn.push(xe.resolve(an,"resources/views/components")),cn.push(xe.resolve(an,"resources/components")),cn.push(xe.resolve(an,"src/components")),cn.push(xe.resolve(an,"components"));cn.push(xe.resolve(import.meta.dir,"components"));for(let Pe of cn)if(!Se.includes(Pe))Se.push(Pe);if(Qr){let Pe=(u._componentPackageDirs??[]).filter((bt)=>typeof bt==="string"&&bt.length>0),Ot=(Vs?Pe.length?Pe:u._pluginComponentDirs??[]:u._targetComponentDirs??[]).filter((bt)=>typeof bt==="string"&&bt.length>0);if(Ot.length){let bt=Se.slice(pt).map((dt)=>xe.isAbsolute(dt)?dt:xe.resolve(ei,dt)).filter((dt)=>!Ot.includes(dt)),cs=`${X}\x00${bt.join("\x00")}`,Ct=Ir.get(cs);if(Ct===void 0){Ct=!1;for(let dt of bt){for(let Ht of ve)if(await s(xe.join(dt,Ht))){Ct=!0;break}if(Ct)break}Ir.set(cs,Ct)}if(!Ct){for(let dt of Ot){let Ht=Se.indexOf(dt);if(Ht>=0)Se.splice(Ht,1)}Se.splice(pt,0,...Ot)}}}let ti=u._pluginComponentDirs;if(Array.isArray(ti)){for(let Pe of ti)if(typeof Pe==="string"&&!Se.includes(Pe))Se.push(Pe)}if(u.fallbackComponentsDir&&!Se.includes(u.fallbackComponentsDir))Se.push(u.fallbackComponentsDir);if(Vs){for(let Pe of u._targetComponentDirs??[])if(Pe&&!Se.includes(Pe))Se.push(Pe)}let as=u._nativePrimitivesFallback;if(as&&!as.except.some((Pe)=>Pe.toLowerCase()===X.toLowerCase())&&!Se.includes(as.dir))Se.push(as.dir);let ni=[...new Set(Se.map((Pe)=>{if(!Pe)return Pe;return xe.isAbsolute(Pe)?Pe:xe.resolve(ei,Pe)}))];Se.length=0,Se.push(...ni);let Us=`${X}\x00${l}\x00${ni.join("\x00")}`,Hs=Ms.get(Us);if(Hs)if(await s(Hs))U=Hs;else Ms.delete(Us);if(!U&&(X.startsWith("./")||X.startsWith("../")))U=xe.resolve(xe.dirname(l),`${X}.stx`),re.push(U);else if(!U)for(let Pe of Se){if(!Pe)continue;for(let Ot of ve){let bt=xe.join(Pe,Ot);if(re.push(bt),await s(bt)){U=bt;break}}if(U)break;if(!U)try{let Ot=await import("fs");if(!Ot.statSync(Pe,{throwIfNoEntry:!1})?.isDirectory())continue;let cs=8,Ct=[{path:Pe,depth:0}];while(Ct.length>0&&!U){let dt=Ct.pop();if(dt.depth>=cs)continue;let Ht;try{Ht=Ot.readdirSync(dt.path,{withFileTypes:!0})}catch{continue}for(let ls of Ht){if(!ls.isDirectory())continue;if(ls.name==="node_modules"||ls.name.startsWith("."))continue;let si=xe.join(dt.path,ls.name);for(let oc of ve){let Ks=xe.join(si,oc);if(re.push(Ks),await s(Ks)){U=Ks;break}}if(U)break;Ct.push({path:si,depth:dt.depth+1})}}}catch{}if(U)break}if(U)Ms.set(Us,U)}if(!U||!await s(U))return za(e,l,re),Ba(e);v.add(U);let ce;if(qn.has(U)&&Tr.get(U)===Pa(U))ce=qn.get(U);else try{let ge=Pa(U);ce=await Bun.file(U).text(),qn.set(U,ce),Tr.set(U,ge)}catch(ge){let ve=ge instanceof Error?ge.message:String(ge);return za(e,l,[U],ve),Ba(e)}if(I)for(let ge of new Set([...Object.keys(n),...I.reactiveProps??[]])){let ve=ge.toLowerCase();if(ve.startsWith("aria-")||ve.startsWith("data-"))continue;let ze=ge.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${ze}\\b`).test(ce))I.declaredProps.add(ge);if(new RegExp(`\\$props\\s*(?:\\.\\s*${ze}\\b|\\[\\s*['"]${ze}['"]\\s*\\])`).test(ce)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${ze}['"]`).test(ce))I.consumedProps?.add(ge)}if(I?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(ce))for(let ge of I.reactiveProps){if(Fp.has(ge)||I.consumedProps?.has(ge))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${ge.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(ce))continue;let ve=`${U}\x00${ge}`;if(Wa.has(ve))continue;Wa.add(ve),console.warn(`[stx] ${xe.basename(U)} reads \`${ge}\` with defineProps(), which is not live, but ${xe.basename(l)} binds it (:${ge}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${ge}').`)}let le=new Set(["__originalFilePath","__importedComponents",ms,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),pe={};for(let[ge,ve]of Object.entries(a))if(!ge.startsWith("__")||le.has(ge))pe[ge]=ve;let Re=S.length>0?{[ws]:[...S]}:{},Ae=r;if(r.includes("@include")){let{processIncludes:ge}=await o("stx/includes",()=>import("./chunk-2cbrcb9m.js"));Ae=await ge(r,a,l,u,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(Ae)){let{processComponents:ge}=await o("stx/component-renderer",()=>import("./chunk-dqt1kw68.js")),ve={...a,__processedComponents:M,...Re};Ae=await ge(Ae,ve,l,u,v);let ze=ve.__stx_preserved_client_expressions;if(Array.isArray(ze)&&ze.length>0)a.__stx_preserved_client_expressions=[...new Set([...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...ze])]}let we=[];if(El(Ae)){let{processExpressions:ge}=await o("stx/expressions",()=>import("./chunk-pmmctgdd.js")),ve=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Re}:S.length>0?{...a,...Re}:a;Ae=ge(Ae,ve,l);for(let ze of Ae.matchAll(/\{\{([\s\S]*?)\}\}/g))we.push(ze[1].trim())}let fe=new Set(Array.isArray(a.__stx_client_declared_names)?a.__stx_client_declared_names:[]),We=[];if(fe.size>0&&Ae)for(let ge of Ae.matchAll(/<[A-Z][\w.-]*\b([^>]*)>/g))for(let ve of ge[1].matchAll(/\s(?:v-model(?::[\w-]+)?|:[\w-]+)\s*=\s*"([^"]*)"/g)){let ze=ve[1].trim();try{if(ze&&Ee(ze).some((Se)=>fe.has(Se)))We.push(ze)}catch{}}let Fe=se(Ae),it=[],ot=Fe.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(ge,ve)=>{let ze=Fe.scripts[Number(ve)]||"",Se=ze.match(/^<script\b([^>]*)>/i)?.[1]||"",pt=Se.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),tt=!pt||["module","text/javascript","application/javascript"].includes(pt),It=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${Se}`);if(!/\bserver\b/i.test(Se)&&tt&&!It)return it.push(ze),"";return ze}),{extractSlotContent:At}=await o("stx/slots",()=>import("./chunk-e4fseqnv.js")),St=At(ot),at={};if(St.defaultSlot?.trim())at.default=St.defaultSlot;for(let[ge,ve]of St.namedSlots)at[ge]=ve.content;let $t=a.__stx_scope_seq??={n:0,key:po(String(a.__filename??l))},Ve=Ua(e,process.cwd()),ut=`stx_${(Ve.endsWith(".stx")?Ve.slice(0,-4):Ve).replace(/[^a-zA-Z0-9]/g,"_")}_${++$t.n}_${$t.key}`,De={...pe,$uid:ut,$native:u._nativeHostAttrs===!0,...n,props:n,slot:ot,$slots:at,__processedComponents:V,__sections:{},__stx_signals_gate:Me(ce)||El(r),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...we],__stx_caller_client_bindings:[...Array.isArray(a.__stx_caller_client_bindings)?a.__stx_caller_client_bindings:[],...We]};if(/import\s/.test(ce)){De.__importedComponents=new Map(De.__importedComponents);let{processESImports:ge}=await o("stx/component-renderer",()=>import("./chunk-dqt1kw68.js"));ce=await ge(ce,De,U,u,v)}zp(ce,De,n);let Mt=ce,Dt=B(Mt);if(Dt)Mt=Dt.content.trim();let zs=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,hn=[...ce.matchAll(zs)];for(let[,ge,ve]of hn)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(ge))Ke(ve,U,u.strict);let xt=[],xn=null,Nt=hn.some((ge)=>/\bserver\b/.test(ge[1]||"")&&/\bcache\b/.test(ge[1]||"")),tn=null,bn=null,yn=null,Jn=0,_n=null;if(Pp(u),Nt&&Wr>0){let ge=Mp({props:n,slot:Ae,slotContext:r.trim()?Dp(pe):void 0,buildMode:u.buildMode??"",skipEventDirectives:u.skipEventDirectives===!0,native:u._nativeHostAttrs===!0,clientLoopNames:[...S].sort(),layers:u._layerGraph?.layers.map((ve)=>ve.configFile),uid:ut});if(ge!==null){tn=`${U}\x00${E(ce)}\x00${ge}`;let ve=Ds.get(tn);if(ve){for(let ze of ve.dependencies)v.add(ze);if(Pi(a,ve.clientFactories),$t.n+=ve.uidsConsumed,ve.preservedClientExpressions.length>0){let ze=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let Se of ve.preservedClientExpressions)ze.add(Se);a.__stx_preserved_client_expressions=[...ze]}return ve.output}bn=new Set(v),yn=Ai(a),Jn=$t.n,_n=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let Tt=new Set;for(let ge of hn){let ve=ge[1]||"",ze=ge[2]||"",Se=ve.includes("server");if(Ye(ve)&&ze.trim())ze=Ze(ze);if(Se&&ze){for(let tt of ye(ze))Tt.add(tt);try{await L(ze,De,U,{onFailure:(tt)=>{if(tt.kind!=="unknown")xn=tt.kind}})}catch(tt){}}if(!Se){let tt=ze.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),It=tt.includes("{{")&&tt.includes("}}"),sn=tt.includes("{!!")&&tt.includes("!!}");if(It||sn)tt=Xi(tt,De,U);let Pt=ve.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");xt.push(`<script${Pt}>${tt}</script>`)}}let jt=se(ce).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),wn=jt?jt[1]:"",ue=jt?jt[2]:"",de="",$e=wn&&/\bscoped\b/i.test(wn);if(jt)de=`<style${wn}>${Wp(ue,De,U)}</style>`;let Te=Mt;if(Te=Te.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),jt)Te=Te.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let ge=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ve=[];if(Te=Te.replace(ge,(ze,Se)=>{let pt=Se.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(pt)ve.push(`<style${pt[1]}>${pt[2]}</style>`);return""}),Te=Te.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ve.length>0)de=`${de}${ve.join(`
1187
- `)}`}if(r&&Te.includes("{{ text || slot }}"))Te=Te.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>r);let{applySlots:st}=await o("stx/slots",()=>import("./chunk-e4fseqnv.js")),{defaultSlot:ct,namedSlots:nn}=St,Gr=a.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(ot),Lt=xt.length>0&&dr(Te)||u._nativeHostAttrs===!0&&xt.length>0||Gr&&xt.length>0||xt.some((ge)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(ge)),Xn=(ge)=>Lt?qo(ge,ut):ge,Gn=new Map([...nn].map(([ge,ve])=>[ge,{...ve,content:Xn(ve.content)}]));Te=await st(Te,Lt?Ko(Xn(ct),ut):ct,Gn,De,Lt?ut:"");let vn=qi(xt),Sn=(Array.isArray(De.__stx_client_signal_names)?De.__stx_client_signal_names:[]).filter((ge)=>!Tt.has(ge));if(vn.length>0||Sn.length>0)De.__stx_client_signal_names=[...new Set([...Sn,...vn])];else delete De.__stx_client_signal_names;let En=io(xt.join(`
1188
- `)),kn=(Array.isArray(De.__stx_client_declared_names)?De.__stx_client_declared_names:[]).filter((ge)=>!Tt.has(ge)&&!(ge in n));if(En.size>0||kn.length>0)De.__stx_client_declared_names=[...new Set([...kn,...En])];else delete De.__stx_client_declared_names;let zt=S.filter((ge)=>!Tt.has(ge)&&!(ge in n));if(zt.length>0)De[ws]=zt;let Yn={...u,_rootComponentsDir:u._rootComponentsDir||u.componentsDir,componentsDir:xe.dirname(U),skipSignalsRuntime:!0,skipEventDirectives:u._nativeHostAttrs===!0||Lt||xt.length===0,defaultLayout:void 0};De.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:Qn}=await o("stx/process",()=>import("./chunk-ssdjny2r.js")),Be=await Qn(Te,De,U,Yn,v),Et=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let ge of Be.matchAll(/\{\{([\s\S]*?)\}\}/g))Et.add(ge[1].trim());if(Et.size>0)a.__stx_preserved_client_expressions=[...Et];let Bt=ut,ft=Be;if(Lt){let ge="";if(Object.keys(n).length>0)try{ge=` data-stx-props="${Rr(JSON.stringify(n))}"`}catch{}let ve=Z?` stx-hydrate="${Rr(Z)}"`:"",ze=Object.fromEntries(Object.entries(at).map(([Ft,rn])=>[Ft,Boolean(rn)])),Se=Object.keys(ze).length>0?` data-stx-slots="${Rr(JSON.stringify(ze))}"`:"",pt=` data-stx-scope="${Bt}"${ge}${Se}${ve}`,tt=Be.slice(Vt(Be)),It=/^<span(?=[\s/>])/i.test(tt),sn=/^<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(tt),Pt=/^<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(tt),es=It?"span":"div",Bs=sn&&u._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':Pt&&u._nativeHostAttrs?' style="width:100%;height:100%"':It||sn?' style="display:contents"':"";ft=Xg(Be,pt)??`<${es}${pt} data-stx-component-wrapper${Bs}>${Be}</${es}>`;let Ws=await Promise.all(xt.map(async(Ft)=>{let rn=Ft.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!rn)return Ft;let[,Cn,Fs]=rn,ts=ja(Ft,De,U);if(ts!==null)return ts;let on=await Up(Fs,U,u.buildMode==="compile"),ns=In(on.clientCode,Ge(De)),{vendorStyleTags:ss}=on,rs=ns?`function(__scopeId) {
1186
+ `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${u}${f}`)}function Ba(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Fp=new Set(["for","if","show","key","ref","class","className","style"]),Wa=new Set,Ka="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",Tl=new RegExp(`\\b(?:${Ka})\\s*(?:<[^>]*>)?\\s*\\(`);function qi(e){let n=new Set,r=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${Ka})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let i of e){let a;while((a=r.exec(i))!==null)n.add(a[1]);r.lastIndex=0}return[...n]}async function Qe(e,n,r,i,a,l,u,f=new Set,v,S=mt(a),I,j=e){let{extractVariables:L}=await o("stx/variable-extractor",()=>import("./chunk-x5x8hbm0.js")),M=f??new Set;if(M.has(e))return`[Circular component reference: ${e}]`;let V=new Set(M);V.add(e);let W=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let Z=W&&W!=="load"&&Gg(W)?W:"";try{let q=(ge)=>ge.split("-").map((ve)=>ve.charAt(0).toUpperCase()+ve.slice(1)).join(""),X=j.endsWith(".stx")?j.slice(0,-4):j,U=null,H=a.__importedComponents;if(H){let ge=[X,X.toLowerCase(),q(X),J(X)];for(let ve of ge)if(H.has(ve)){U=H.get(ve);break}}let re=[];if(!U){let ge=[`${X}.stx`,`${q(X)}.stx`,`${J(X)}.stx`],ve=[...new Set(ge)],ze=a.__originalFilePath,Se=[];for(let Pe of us(l))if(!Se.includes(Pe))Se.push(Pe);let pt=Se.length;for(let Pe of u._layerComponentDirs??[])if(!Se.includes(Pe))Se.push(Pe);if(ze){let Pe=xe.join(xe.dirname(ze),"components");Se.push(Pe)}let tt=u._rootComponentsDir;if(typeof tt==="string"&&Ha(i,u)&&!Se.includes(tt))Se.push(tt);if(i&&!Se.includes(i))Se.push(i);if(typeof tt==="string"&&!Se.includes(tt))Se.push(tt);let It=xe.join(xe.dirname(l),"components");if(!Se.includes(It))Se.push(It);if(u.componentsDir&&u.componentsDir!==i&&!Se.includes(u.componentsDir))Se.push(u.componentsDir);for(let Pe of u.additionalComponentsDirs??[])if(Pe&&!Se.includes(Pe))Se.push(Pe);let sn=u._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(X),Pt=(I?.events??[]).map((Pe)=>Pe.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),es=Object.hasOwn(n,"checked")||Boolean(I?.reactiveProps?.includes("checked")),Bs=Object.hasOwn(n,"value")||Boolean(I?.reactiveProps?.includes("value")),Ws=!Pt.includes("valuechange")&&(es||Pt.includes("change")&&!Bs),Ft=u._nativeHostAttrs&&/^textinput$/i.test(X),rn=Pt.includes("update:value")&&!Pt.includes("input"),Cn=u._nativeHostAttrs&&/^video$/i.test(X),Fs=u._nativeHostAttrs&&/^image$/i.test(X),ts=eo([...Object.keys(n),...I?.reactiveProps??[]],I?.events,n),on=Object.hasOwn(n,"src")||Boolean(I?.reactiveProps?.includes("src")),ns=Object.hasOwn(n,"source")||Boolean(I?.reactiveProps?.includes("source")),ss=Cn&&(on||ns)&&(I?.events??[]).every((Pe)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(Pe.replace(/^@/,"").split(".")[0])),rs=new Set(["","primary","secondary","outline","ghost","danger"]),is=typeof n.variant==="string"?n.variant.trim().toLowerCase():"",os=u._nativeHostAttrs&&/^button$/i.test(X)&&!rs.has(is),Qr=u._targetComponentFallbackNames?.some((Pe)=>Pe.toLowerCase()===X.toLowerCase())??!1,Vs=Qr&&(!sn||Ws)&&(!Ft||rn)&&(!Cn||ss)&&(!Fs||ts)&&!os;for(let Pe of Vs?[]:u._targetComponentDirs??[])if(Pe&&!Se.includes(Pe))Se.push(Pe);let an=typeof u.root==="string"?xe.resolve(u.root):void 0,ei=an??xe.dirname(l),cn=[];if(an)cn.push(xe.resolve(an,"resources/views/components")),cn.push(xe.resolve(an,"resources/components")),cn.push(xe.resolve(an,"src/components")),cn.push(xe.resolve(an,"components"));cn.push(xe.resolve(import.meta.dir,"components"));for(let Pe of cn)if(!Se.includes(Pe))Se.push(Pe);if(Qr){let Pe=(u._componentPackageDirs??[]).filter((bt)=>typeof bt==="string"&&bt.length>0),Ot=(Vs?Pe.length?Pe:u._pluginComponentDirs??[]:u._targetComponentDirs??[]).filter((bt)=>typeof bt==="string"&&bt.length>0);if(Ot.length){let bt=Se.slice(pt).map((dt)=>xe.isAbsolute(dt)?dt:xe.resolve(ei,dt)).filter((dt)=>!Ot.includes(dt)),cs=`${X}\x00${bt.join("\x00")}`,Ct=Ir.get(cs);if(Ct===void 0){Ct=!1;for(let dt of bt){for(let Ht of ve)if(await s(xe.join(dt,Ht))){Ct=!0;break}if(Ct)break}Ir.set(cs,Ct)}if(!Ct){for(let dt of Ot){let Ht=Se.indexOf(dt);if(Ht>=0)Se.splice(Ht,1)}Se.splice(pt,0,...Ot)}}}let ti=u._pluginComponentDirs;if(Array.isArray(ti)){for(let Pe of ti)if(typeof Pe==="string"&&!Se.includes(Pe))Se.push(Pe)}if(u.fallbackComponentsDir&&!Se.includes(u.fallbackComponentsDir))Se.push(u.fallbackComponentsDir);if(Vs){for(let Pe of u._targetComponentDirs??[])if(Pe&&!Se.includes(Pe))Se.push(Pe)}let as=u._nativePrimitivesFallback;if(as&&!as.except.some((Pe)=>Pe.toLowerCase()===X.toLowerCase())&&!Se.includes(as.dir))Se.push(as.dir);let ni=[...new Set(Se.map((Pe)=>{if(!Pe)return Pe;return xe.isAbsolute(Pe)?Pe:xe.resolve(ei,Pe)}))];Se.length=0,Se.push(...ni);let Us=`${X}\x00${l}\x00${ni.join("\x00")}`,Hs=Ms.get(Us);if(Hs)if(await s(Hs))U=Hs;else Ms.delete(Us);if(!U&&(X.startsWith("./")||X.startsWith("../")))U=xe.resolve(xe.dirname(l),`${X}.stx`),re.push(U);else if(!U)for(let Pe of Se){if(!Pe)continue;for(let Ot of ve){let bt=xe.join(Pe,Ot);if(re.push(bt),await s(bt)){U=bt;break}}if(U)break;if(!U)try{let Ot=await import("fs");if(!Ot.statSync(Pe,{throwIfNoEntry:!1})?.isDirectory())continue;let cs=8,Ct=[{path:Pe,depth:0}];while(Ct.length>0&&!U){let dt=Ct.pop();if(dt.depth>=cs)continue;let Ht;try{Ht=Ot.readdirSync(dt.path,{withFileTypes:!0})}catch{continue}for(let ls of Ht){if(!ls.isDirectory())continue;if(ls.name==="node_modules"||ls.name.startsWith("."))continue;let si=xe.join(dt.path,ls.name);for(let oc of ve){let Ks=xe.join(si,oc);if(re.push(Ks),await s(Ks)){U=Ks;break}}if(U)break;Ct.push({path:si,depth:dt.depth+1})}}}catch{}if(U)break}if(U)Ms.set(Us,U)}if(!U||!await s(U))return za(e,l,re),Ba(e);v.add(U);let ce;if(qn.has(U)&&Tr.get(U)===Pa(U))ce=qn.get(U);else try{let ge=Pa(U);ce=await Bun.file(U).text(),qn.set(U,ce),Tr.set(U,ge)}catch(ge){let ve=ge instanceof Error?ge.message:String(ge);return za(e,l,[U],ve),Ba(e)}if(I)for(let ge of new Set([...Object.keys(n),...I.reactiveProps??[]])){let ve=ge.toLowerCase();if(ve.startsWith("aria-")||ve.startsWith("data-"))continue;let ze=ge.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${ze}\\b`).test(ce))I.declaredProps.add(ge);if(new RegExp(`\\$props\\s*(?:\\.\\s*${ze}\\b|\\[\\s*['"]${ze}['"]\\s*\\])`).test(ce)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${ze}['"]`).test(ce))I.consumedProps?.add(ge)}if(I?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(ce))for(let ge of I.reactiveProps){if(Fp.has(ge)||I.consumedProps?.has(ge))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${ge.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(ce))continue;let ve=`${U}\x00${ge}`;if(Wa.has(ve))continue;Wa.add(ve),console.warn(`[stx] ${xe.basename(U)} reads \`${ge}\` with defineProps(), which is not live, but ${xe.basename(l)} binds it (:${ge}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${ge}').`)}let le=new Set(["__originalFilePath","__importedComponents",ms,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),pe={};for(let[ge,ve]of Object.entries(a))if(!ge.startsWith("__")||le.has(ge))pe[ge]=ve;let Re=S.length>0?{[ws]:[...S]}:{},Ae=r;if(r.includes("@include")){let{processIncludes:ge}=await o("stx/includes",()=>import("./chunk-28f696hb.js"));Ae=await ge(r,a,l,u,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(Ae)){let{processComponents:ge}=await o("stx/component-renderer",()=>import("./chunk-rektg4nx.js")),ve={...a,__processedComponents:M,...Re};Ae=await ge(Ae,ve,l,u,v);let ze=ve.__stx_preserved_client_expressions;if(Array.isArray(ze)&&ze.length>0)a.__stx_preserved_client_expressions=[...new Set([...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...ze])]}let we=[];if(El(Ae)){let{processExpressions:ge}=await o("stx/expressions",()=>import("./chunk-jk6zn8tw.js")),ve=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Re}:S.length>0?{...a,...Re}:a;Ae=ge(Ae,ve,l);for(let ze of Ae.matchAll(/\{\{([\s\S]*?)\}\}/g))we.push(ze[1].trim())}let fe=new Set(Array.isArray(a.__stx_client_declared_names)?a.__stx_client_declared_names:[]),We=[];if(fe.size>0&&Ae)for(let ge of Ae.matchAll(/<[A-Z][\w.-]*\b([^>]*)>/g))for(let ve of ge[1].matchAll(/\s(?:v-model(?::[\w-]+)?|:[\w-]+)\s*=\s*"([^"]*)"/g)){let ze=ve[1].trim();try{if(ze&&Ee(ze).some((Se)=>fe.has(Se)))We.push(ze)}catch{}}let Fe=se(Ae),it=[],ot=Fe.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(ge,ve)=>{let ze=Fe.scripts[Number(ve)]||"",Se=ze.match(/^<script\b([^>]*)>/i)?.[1]||"",pt=Se.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),tt=!pt||["module","text/javascript","application/javascript"].includes(pt),It=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${Se}`);if(!/\bserver\b/i.test(Se)&&tt&&!It)return it.push(ze),"";return ze}),{extractSlotContent:At}=await o("stx/slots",()=>import("./chunk-pwv6pvnm.js")),St=At(ot),at={};if(St.defaultSlot?.trim())at.default=St.defaultSlot;for(let[ge,ve]of St.namedSlots)at[ge]=ve.content;let $t=a.__stx_scope_seq??={n:0,key:po(String(a.__filename??l))},Ve=Ua(e,process.cwd()),ut=`stx_${(Ve.endsWith(".stx")?Ve.slice(0,-4):Ve).replace(/[^a-zA-Z0-9]/g,"_")}_${++$t.n}_${$t.key}`,De={...pe,$uid:ut,$native:u._nativeHostAttrs===!0,...n,props:n,slot:ot,$slots:at,__processedComponents:V,__sections:{},__stx_signals_gate:Me(ce)||El(r),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...we],__stx_caller_client_bindings:[...Array.isArray(a.__stx_caller_client_bindings)?a.__stx_caller_client_bindings:[],...We]};if(/import\s/.test(ce)){De.__importedComponents=new Map(De.__importedComponents);let{processESImports:ge}=await o("stx/component-renderer",()=>import("./chunk-rektg4nx.js"));ce=await ge(ce,De,U,u,v)}zp(ce,De,n);let Mt=ce,Dt=B(Mt);if(Dt)Mt=Dt.content.trim();let zs=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,hn=[...ce.matchAll(zs)];for(let[,ge,ve]of hn)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(ge))Ke(ve,U,u.strict);let xt=[],xn=null,Nt=hn.some((ge)=>/\bserver\b/.test(ge[1]||"")&&/\bcache\b/.test(ge[1]||"")),tn=null,bn=null,yn=null,Jn=0,_n=null;if(Pp(u),Nt&&Wr>0){let ge=Mp({props:n,slot:Ae,slotContext:r.trim()?Dp(pe):void 0,buildMode:u.buildMode??"",skipEventDirectives:u.skipEventDirectives===!0,native:u._nativeHostAttrs===!0,clientLoopNames:[...S].sort(),layers:u._layerGraph?.layers.map((ve)=>ve.configFile),uid:ut});if(ge!==null){tn=`${U}\x00${E(ce)}\x00${ge}`;let ve=Ds.get(tn);if(ve){for(let ze of ve.dependencies)v.add(ze);if(Pi(a,ve.clientFactories),$t.n+=ve.uidsConsumed,ve.preservedClientExpressions.length>0){let ze=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let Se of ve.preservedClientExpressions)ze.add(Se);a.__stx_preserved_client_expressions=[...ze]}return ve.output}bn=new Set(v),yn=Ai(a),Jn=$t.n,_n=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let Tt=new Set;for(let ge of hn){let ve=ge[1]||"",ze=ge[2]||"",Se=ve.includes("server");if(Ye(ve)&&ze.trim())ze=Ze(ze);if(Se&&ze){for(let tt of ye(ze))Tt.add(tt);try{await L(ze,De,U,{onFailure:(tt)=>{if(tt.kind!=="unknown")xn=tt.kind}})}catch(tt){}}if(!Se){let tt=ze.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),It=tt.includes("{{")&&tt.includes("}}"),sn=tt.includes("{!!")&&tt.includes("!!}");if(It||sn)tt=Xi(tt,De,U);let Pt=ve.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");xt.push(`<script${Pt}>${tt}</script>`)}}let jt=se(ce).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),wn=jt?jt[1]:"",ue=jt?jt[2]:"",de="",$e=wn&&/\bscoped\b/i.test(wn);if(jt)de=`<style${wn}>${Wp(ue,De,U)}</style>`;let Te=Mt;if(Te=Te.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),jt)Te=Te.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let ge=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ve=[];if(Te=Te.replace(ge,(ze,Se)=>{let pt=Se.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(pt)ve.push(`<style${pt[1]}>${pt[2]}</style>`);return""}),Te=Te.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ve.length>0)de=`${de}${ve.join(`
1187
+ `)}`}if(r&&Te.includes("{{ text || slot }}"))Te=Te.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>r);let{applySlots:st}=await o("stx/slots",()=>import("./chunk-pwv6pvnm.js")),{defaultSlot:ct,namedSlots:nn}=St,Gr=a.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(ot),Lt=xt.length>0&&dr(Te)||u._nativeHostAttrs===!0&&xt.length>0||Gr&&xt.length>0||xt.some((ge)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(ge)),Xn=(ge)=>Lt?qo(ge,ut):ge,Gn=new Map([...nn].map(([ge,ve])=>[ge,{...ve,content:Xn(ve.content)}]));Te=await st(Te,Lt?Ko(Xn(ct),ut):ct,Gn,De,Lt?ut:"");let vn=qi(xt),Sn=(Array.isArray(De.__stx_client_signal_names)?De.__stx_client_signal_names:[]).filter((ge)=>!Tt.has(ge));if(vn.length>0||Sn.length>0)De.__stx_client_signal_names=[...new Set([...Sn,...vn])];else delete De.__stx_client_signal_names;let En=io(xt.join(`
1188
+ `)),kn=(Array.isArray(De.__stx_client_declared_names)?De.__stx_client_declared_names:[]).filter((ge)=>!Tt.has(ge)&&!(ge in n));if(En.size>0||kn.length>0)De.__stx_client_declared_names=[...new Set([...kn,...En])];else delete De.__stx_client_declared_names;let zt=S.filter((ge)=>!Tt.has(ge)&&!(ge in n));if(zt.length>0)De[ws]=zt;let Yn={...u,_rootComponentsDir:u._rootComponentsDir||u.componentsDir,componentsDir:xe.dirname(U),skipSignalsRuntime:!0,skipEventDirectives:u._nativeHostAttrs===!0||Lt||xt.length===0,defaultLayout:void 0};De.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:Qn}=await o("stx/process",()=>import("./chunk-59nhx5mp.js")),Be=await Qn(Te,De,U,Yn,v),Et=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let ge of Be.matchAll(/\{\{([\s\S]*?)\}\}/g))Et.add(ge[1].trim());if(Et.size>0)a.__stx_preserved_client_expressions=[...Et];let Bt=ut,ft=Be;if(Lt){let ge="";if(Object.keys(n).length>0)try{ge=` data-stx-props="${Rr(JSON.stringify(n))}"`}catch{}let ve=Z?` stx-hydrate="${Rr(Z)}"`:"",ze=Object.fromEntries(Object.entries(at).map(([Ft,rn])=>[Ft,Boolean(rn)])),Se=Object.keys(ze).length>0?` data-stx-slots="${Rr(JSON.stringify(ze))}"`:"",pt=` data-stx-scope="${Bt}"${ge}${Se}${ve}`,tt=Be.slice(Vt(Be)),It=/^<span(?=[\s/>])/i.test(tt),sn=/^<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(tt),Pt=/^<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(tt),es=It?"span":"div",Bs=sn&&u._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':Pt&&u._nativeHostAttrs?' style="width:100%;height:100%"':It||sn?' style="display:contents"':"";ft=Xg(Be,pt)??`<${es}${pt} data-stx-component-wrapper${Bs}>${Be}</${es}>`;let Ws=await Promise.all(xt.map(async(Ft)=>{let rn=Ft.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!rn)return Ft;let[,Cn,Fs]=rn,ts=ja(Ft,De,U);if(ts!==null)return ts;let on=await Up(Fs,U,u.buildMode==="compile"),ns=In(on.clientCode,Ge(De)),{vendorStyleTags:ss}=on,rs=ns?`function(__scopeId) {
1189
1189
  ${ns}
1190
1190
  return (${on.factoryBody})(__scopeId);
1191
1191
  }`:on.factoryBody,is=Z?null:or(a,rs),os=is?`window.__stxComponentFactories[${JSON.stringify(is)}](${JSON.stringify(Bt)});`:`(${rs})(${JSON.stringify(Bt)});`;if(Z)return`${ss}<script type="stx/island" data-stx-island="${Bt}" data-stx-scoped data-stx-owner="${Bt}"${Cn}>${me(os)}</script>`;return`${ss}<script data-stx-scoped data-stx-run="always" data-stx-owner="${Bt}"${Cn}>${me(os)}</script>`}));if(ft=ft+`
@@ -1211,7 +1211,7 @@ ${He.yellow}${He.bold}Message:${He.reset} ${n}
1211
1211
  `,f)I+=`
1212
1212
  ${He.blue}${He.bold}Context:${He.reset}
1213
1213
  ${He.dim}${f}${He.reset}
1214
- `;return I}function Ce(){qn.clear(),Tr.clear(),Ms.clear(),Ir.clear(),Or.clear(),Pr.clear(),Ds.clear()}function Iy(){return{size:qn.size,maxSize:500}}var Ar=k(128);async function Up(e,n,r){let i=E(e,n,r),a=Ar.get(i);if(a){if(to(a.deps))return a;Ar.delete(i)}let l=Vi(e,{filePath:n,projectRoot:process.cwd()}),u=l.code,f=Wi(l.styles);u=Gt(u).code;let{hasUserImports:v,bundleClientScript:S}=await o("stx/client-script-bundler",()=>import("./chunk-q33tyfpp.js")),I=[],j=!1;if(v(u)){let X=u;u=await S(X,n,{projectRoot:process.cwd(),minify:r,collectInputs:I}),j=u===X}let{stripStxRuntimeImports:L}=await o("stx/signal-processing",()=>import("./chunk-r425m35g.js"));u=L(u);let M=D(u),V=Lp(M),W=new Set(G(M,!0).split(",").map((X)=>X.trim())),Z=`function(__scopeId) {
1214
+ `;return I}function Ce(){qn.clear(),Tr.clear(),Ms.clear(),Ir.clear(),Or.clear(),Pr.clear(),Ds.clear()}function Iy(){return{size:qn.size,maxSize:500}}var Ar=k(128);async function Up(e,n,r){let i=E(e,n,r),a=Ar.get(i);if(a){if(to(a.deps))return a;Ar.delete(i)}let l=Vi(e,{filePath:n,projectRoot:process.cwd()}),u=l.code,f=Wi(l.styles);u=Gt(u).code;let{hasUserImports:v,bundleClientScript:S}=await o("stx/client-script-bundler",()=>import("./chunk-1gfc406y.js")),I=[],j=!1;if(v(u)){let X=u;u=await S(X,n,{projectRoot:process.cwd(),minify:r,collectInputs:I}),j=u===X}let{stripStxRuntimeImports:L}=await o("stx/signal-processing",()=>import("./chunk-pgb2p7pm.js"));u=L(u);let M=D(u),V=Lp(M),W=new Set(G(M,!0).split(",").map((X)=>X.trim())),Z=`function(__scopeId) {
1215
1215
  ${vt("const",[...Ul,...V],M)}
1216
1216
  const __scope = window.stx._scopes = window.stx._scopes || {};
1217
1217
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ln,z}from"./chunk-w98yt4d4.js";import m from"fs";import e from"path";async function Dn(r,o,i){if(r.__stx_runtime_config)return;let n=Ln();if(n||i){r.__stx_runtime_config=n??z(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-44qcbbc4.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=z(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function Ji(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
2
+ import{Ln,z}from"./chunk-w98yt4d4.js";import m from"fs";import e from"path";async function Dn(r,o,i){if(r.__stx_runtime_config)return;let n=Ln();if(n||i){r.__stx_runtime_config=n??z(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-gmk82cm4.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=z(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function Ji(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
3
3
  declare module '@stacksjs/stx/runtime-config' { interface PublicRuntimeConfig ${i(o.public??{})} }
4
4
  `),await Bun.write(e.join(r,".stx/runtime-config-server.d.ts"),`import '@stacksjs/stx/runtime-config-server'
5
5
  declare module '@stacksjs/stx/runtime-config-server' { interface PrivateRuntimeConfig ${i(o.private??{})} }
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Lm}from"./chunk-jcmhpbh4.js";import"./chunk-btetjy8n.js";import"./chunk-0mxkw6m6.js";import"./chunk-c8qp8b5z.js";import"./chunk-vr9dbmxh.js";import"./chunk-vys2c06e.js";import"./chunk-a5920t9d.js";import"./chunk-ff03ga49.js";import"./chunk-fs43342z.js";import"./chunk-wsg1evmc.js";import"./chunk-759jwj0e.js";import"./chunk-s1sm41pe.js";import"./chunk-9bexzgws.js";import"./chunk-zqvkbj0k.js";import"./chunk-pdvssk6k.js";import"./chunk-v0yay1kw.js";import"./chunk-ve0sbkrt.js";import"./chunk-13awnyq0.js";import"./chunk-03sqt4jx.js";import"./chunk-zytwcfbt.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-9gptdyqq.js";import"./chunk-cxzy7kxg.js";import"./chunk-d2rwg24x.js";import"./chunk-w98yt4d4.js";import"./chunk-c08jvjqt.js";import"./chunk-phzhmnnm.js";import"./chunk-ck4ypzet.js";import"./chunk-0jdz31q1.js";import"./chunk-4b110x6r.js";export{Lm as buildForProduction};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{m,p}from"./chunk-c08jvjqt.js";import{oe,F,g}from"./chunk-ggez55jb.js";function z(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function k(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function B(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let f=t.indexOf("-->",s+4);n=f===-1?t.length:f+3;continue}let a=k(t,s+1);if(a===-1)return-1;let u=t.slice(s,a),c=u.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(u))e++}n=a}return-1}function Z(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[2].toLowerCase();if(u[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);e=s;continue}let f=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let l=d[1]||d[2],h=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=f||N.has(c)?-1:B(t,c,s);if(S===-1)o.push({start:n,end:s,slotName:l,element:h}),e=s;else o.push({start:n,end:S,slotName:l,element:h+t.slice(s,S)}),e=S;continue}if(!f&&!N.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function L(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[1]==="/",f=u[2].toLowerCase();if(c){let l=i.lastIndexOf(f);if(l!==-1)i.splice(l);e=s;continue}if(f==="template"&&i.length===0){let l=a.match(r);if(l){let h=z(t,s);if(h!==-1){let S=l[1]||l[2]||l[3];o.push({start:n,end:h,slotName:S,content:t.slice(s,h-11).trim(),propsBinding:l[4]||void 0}),e=h;continue}}}if(!/\/\s*>$/.test(a)&&!N.has(f)){if(i.push(f),f==="script"||f==="style"){let l=t.toLowerCase().indexOf(`</${f}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function vu(t){let o={default:"",named:new Map},i=t,r=L(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=Z(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function Jm(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function xu(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r},a=new Set,u=new Set;if(n.startsWith("{")&&n.endsWith("}")){let c=n.slice(1,-1).split(",").map((f)=>f.trim()).filter(Boolean);for(let f of c){let[d,l]=f.split(":").map((S)=>S.trim()),h=l||d;if(s[h]=o[d],o[d]!==void 0)u.add(h);else a.add(h)}}else if(s[n]=o,Object.values(o).some((c)=>c===void 0))a.add(n);else u.add(n);e=j(e,s,a,u)}return e}function j(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(F(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!F(s,r))return e;let a=_(s,o);if(a===void 0)return e;return g(String(a??""))}catch{return`{{ ${n} }}`}})}function _(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!m(t))return;return p(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Su(t,o,i,r){let e=t;e=await I(e,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(a,u,c,f)=>{let d=o.named.get(u),l=f?.trim()||"",h=c||"",S={},E=[],C=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=C.exec(h))!==null){let w=b[1],x=b[2];S[w]=_(x,i),E.push([w,x])}if(r!==void 0&&d?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=d.propsBinding.trim(),x=oe(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let M=E.map(([A,P])=>{let O=S[A],R;try{R=O===void 0?void 0:JSON.stringify(O)}catch{}return`${JSON.stringify(A)}:(${R??P})`}).join(","),v=g(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${g(`${y} in [{${M}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${v}">${d.content}</template>`}return await xu(d,S,l,i)});let s=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return e=e.replace(s,(a,u,c)=>{if(/\bname\s*=/.test(u||""))return a;let f=c?.trim()||"";return o.default||f}),e}async function I(t,o,i){let r=[],e=[];t.replace(o,(a,...u)=>{let c=u[u.length-2];return e.push({match:a,index:c}),r.push(i(a,...u.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:u,index:c}=e[a];s=s.slice(0,c)+n[a]+s.slice(c+u.length)}return s}function Ym(t){let o=vu(t);return{defaultSlot:o.default,namedSlots:o.named}}async function Zm(t,o,i,r,e){return await Su(t,{default:o,named:i},r,e)}
2
+ import{m,p}from"./chunk-c08jvjqt.js";import{oe,F,g}from"./chunk-cxzy7kxg.js";function z(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function k(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function B(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let f=t.indexOf("-->",s+4);n=f===-1?t.length:f+3;continue}let a=k(t,s+1);if(a===-1)return-1;let u=t.slice(s,a),c=u.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(u))e++}n=a}return-1}function Z(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[2].toLowerCase();if(u[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);e=s;continue}let f=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let l=d[1]||d[2],h=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=f||N.has(c)?-1:B(t,c,s);if(S===-1)o.push({start:n,end:s,slotName:l,element:h}),e=s;else o.push({start:n,end:S,slotName:l,element:h+t.slice(s,S)}),e=S;continue}if(!f&&!N.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function L(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[1]==="/",f=u[2].toLowerCase();if(c){let l=i.lastIndexOf(f);if(l!==-1)i.splice(l);e=s;continue}if(f==="template"&&i.length===0){let l=a.match(r);if(l){let h=z(t,s);if(h!==-1){let S=l[1]||l[2]||l[3];o.push({start:n,end:h,slotName:S,content:t.slice(s,h-11).trim(),propsBinding:l[4]||void 0}),e=h;continue}}}if(!/\/\s*>$/.test(a)&&!N.has(f)){if(i.push(f),f==="script"||f==="style"){let l=t.toLowerCase().indexOf(`</${f}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function vu(t){let o={default:"",named:new Map},i=t,r=L(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=Z(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function Jm(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function xu(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r},a=new Set,u=new Set;if(n.startsWith("{")&&n.endsWith("}")){let c=n.slice(1,-1).split(",").map((f)=>f.trim()).filter(Boolean);for(let f of c){let[d,l]=f.split(":").map((S)=>S.trim()),h=l||d;if(s[h]=o[d],o[d]!==void 0)u.add(h);else a.add(h)}}else if(s[n]=o,Object.values(o).some((c)=>c===void 0))a.add(n);else u.add(n);e=j(e,s,a,u)}return e}function j(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(F(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!F(s,r))return e;let a=_(s,o);if(a===void 0)return e;return g(String(a??""))}catch{return`{{ ${n} }}`}})}function _(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!m(t))return;return p(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Su(t,o,i,r){let e=t;e=await I(e,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(a,u,c,f)=>{let d=o.named.get(u),l=f?.trim()||"",h=c||"",S={},E=[],C=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=C.exec(h))!==null){let w=b[1],x=b[2];S[w]=_(x,i),E.push([w,x])}if(r!==void 0&&d?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=d.propsBinding.trim(),x=oe(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let M=E.map(([A,P])=>{let O=S[A],R;try{R=O===void 0?void 0:JSON.stringify(O)}catch{}return`${JSON.stringify(A)}:(${R??P})`}).join(","),v=g(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${g(`${y} in [{${M}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${v}">${d.content}</template>`}return await xu(d,S,l,i)});let s=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return e=e.replace(s,(a,u,c)=>{if(/\bname\s*=/.test(u||""))return a;let f=c?.trim()||"";return o.default||f}),e}async function I(t,o,i){let r=[],e=[];t.replace(o,(a,...u)=>{let c=u[u.length-2];return e.push({match:a,index:c}),r.push(i(a,...u.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:u,index:c}=e[a];s=s.slice(0,c)+n[a]+s.slice(c+u.length)}return s}function Ym(t){let o=vu(t);return{defaultSlot:o.default,namedSlots:o.named}}async function Zm(t,o,i,r,e){return await Su(t,{default:o,named:i},r,e)}
3
3
  export{vu,Jm,xu,Su,Ym,Zm};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{d,m,M,p,te}from"./chunk-c08jvjqt.js";import{T}from"./chunk-0jdz31q1.js";import{G,Js,Ke,B,Vt,Fr,Ye,Ze,s,b,Me,P}from"./chunk-ggez55jb.js";import{vt}from"./chunk-4b110x6r.js";import{D}from"./chunk-phzhmnnm.js";import{ge}from"./chunk-9bexzgws.js";import{W,ut}from"./chunk-1jxkc6d0.js";import{I,Fn}from"./chunk-e5rag6rh.js";import A from"path";import{existsSync as ye}from"fs";function ae(c,e){let a=0;for(let r=e;r<c.length;r++){let S=c[r];if(S==="("||S==="["||S==="{")a++;else if(S===")"||S==="]"||S==="}")a--;else if(S===","&&a===0)return r}return-1}function $e(c,e,a){let r=c,S=new RegExp(`${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),n=S.exec(r);while(n){let u=n.index,t=u+n[0].length-1,C=1,z=t+1;while(z<r.length&&C>0){if(r[z]==="(")C++;else if(r[z]===")")C--;z++}if(C!==0)break;let ie=r.substring(t+1,z-1),N=`${a}(${ie})`;r=r.substring(0,u)+N+r.substring(z),S.lastIndex=u+N.length,n=S.exec(r)}return r}function Ee(c){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test(c)}function he(c){let e=c,a=[],r=new Set,S=0,n=0,u=e.length,t=(N)=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]===N){n++;return}n++}},C=()=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]==="`"){n++;return}if(e[n]==="$"&&e[n+1]==="{"){n+=2;let N=1;while(n<u&&N>0)if(e[n]==="{")N++,n++;else if(e[n]==="}")N--,n++;else if(e[n]==="'"||e[n]==='"')t(e[n]);else if(e[n]==="`")C();else n++;continue}n++}},z=()=>{if(e[n]==="/"&&e[n+1]==="/"){while(n<u&&e[n]!==`
2
+ import{d,m,M,p,te}from"./chunk-c08jvjqt.js";import{T}from"./chunk-0jdz31q1.js";import{G,Js,Ke,B,Vt,Fr,Ye,Ze,s,b,Me,P}from"./chunk-cxzy7kxg.js";import{vt}from"./chunk-4b110x6r.js";import{D}from"./chunk-phzhmnnm.js";import{ge}from"./chunk-9bexzgws.js";import{W,ut}from"./chunk-1jxkc6d0.js";import{I,Fn}from"./chunk-e5rag6rh.js";import A from"path";import{existsSync as ye}from"fs";function ae(c,e){let a=0;for(let r=e;r<c.length;r++){let S=c[r];if(S==="("||S==="["||S==="{")a++;else if(S===")"||S==="]"||S==="}")a--;else if(S===","&&a===0)return r}return-1}function $e(c,e,a){let r=c,S=new RegExp(`${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),n=S.exec(r);while(n){let u=n.index,t=u+n[0].length-1,C=1,z=t+1;while(z<r.length&&C>0){if(r[z]==="(")C++;else if(r[z]===")")C--;z++}if(C!==0)break;let ie=r.substring(t+1,z-1),N=`${a}(${ie})`;r=r.substring(0,u)+N+r.substring(z),S.lastIndex=u+N.length,n=S.exec(r)}return r}function Ee(c){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test(c)}function he(c){let e=c,a=[],r=new Set,S=0,n=0,u=e.length,t=(N)=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]===N){n++;return}n++}},C=()=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]==="`"){n++;return}if(e[n]==="$"&&e[n+1]==="{"){n+=2;let N=1;while(n<u&&N>0)if(e[n]==="{")N++,n++;else if(e[n]==="}")N--,n++;else if(e[n]==="'"||e[n]==='"')t(e[n]);else if(e[n]==="`")C();else n++;continue}n++}},z=()=>{if(e[n]==="/"&&e[n+1]==="/"){while(n<u&&e[n]!==`
3
3
  `)n++;return!0}if(e[n]==="/"&&e[n+1]==="*"){n+=2;while(n<u-1&&!(e[n]==="*"&&e[n+1]==="/"))n++;return n+=2,!0}return!1},ie=()=>{if(S!==0)return;let N=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(N){let H=N[2];if(!r.has(H))a.push(H),r.add(H);return}let se=e.slice(n).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(se){let H=se[1];if(!r.has(H))a.push(H),r.add(H);return}let Y=e.slice(n).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Y){let H=Y[1];if(!r.has(H))a.push(H),r.add(H)}};while(n<u){if(z())continue;if(e[n]==="'"||e[n]==='"'){t(e[n]);continue}if(e[n]==="`"){C();continue}if(e[n]==="{"){S++,n++;continue}if(e[n]==="}"){S--,n++;continue}if(S===0&&/[a-z]/i.test(e[n])&&(n===0||/\s|[;{}()]/.test(e[n-1])))ie();n++}return a.join(", ")}function ve(c,e=""){let a=he(c).split(",").map((r)=>r.trim()).filter(Boolean);return`
4
4
  (function() {
5
5
  ${vt("var",a)}
@@ -44,10 +44,10 @@ ${n}
44
44
  }
45
45
  if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
46
46
  }
47
- })();`;return a+c+r}function Te(c,e){if(W(c)){let n=W(c).tag.match(/data-stx-scope="([^"]*)"/);if(n)return{html:c,mergedIntoExisting:n[1],stamped:!0,root:"body"};return{html:ut(c,(u,t)=>`<body${t} data-stx-scope="${e}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let a=Vt(c),r=c.slice(a).match(/^(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(r){let S=r[1]+r[2],n=r[1].slice(1),u=S.match(/data-stx-scope="([^"]*)"/);if(u)return{html:c,mergedIntoExisting:u[1],stamped:!0,root:n};let t=c.slice(0,a),C=r[1],z=r[2];return{html:`${t}${C} data-stx-scope="${e}"${z}${c.slice(a+r[0].length)}`,mergedIntoExisting:null,stamped:!0,root:n}}return{html:c,mergedIntoExisting:null,stamped:!1,root:null}}var Ae=0;function fe(c,e){let a=A.basename(c,".stx").replace(/[^a-zA-Z0-9]/g,"_"),r=e.__stx_scope_seq;return r?`stx_scope_${a}_${++r.n}_${r.key}`:`stx_scope_${a}_${++Ae}`}var le=new Set,pe=new Set;function uy(){le.clear(),pe.clear()}var Ce=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function fg(c){let e=(t)=>t.replace(/[^\n]/g," "),a=c.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,e).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,e).replace(/<!--[\s\S]*?-->/g,e).replace(/\x00STX_HTML_COMMENT_\d+\x00/g,e).replace(/\{\{[\s\S]*?\}\}/g,e).replace(/\{!![\s\S]*?!!\}/g,e),r=[],S=0,n=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,u;while((u=n.exec(a))!==null){let t=u[1]==="/",C=u[2],z=u[3]==="/"||Ce.has(C.toLowerCase());if(t){S=Math.max(0,S-1);continue}if(S===0)r.push(C);if(!z)S++}return r}function me(c){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(c)}var lt=new T(500),Dc=new Set;function dy(){Dc.clear()}function De(c){if(c.__onceStore instanceof Set)return c.__onceStore;return Dc}async function Ts(c,e,a,r,S,n=new Set){let u=r.partialsDir||A.join(A.dirname(a),"partials");if(u&&!A.isAbsolute(u))u=A.resolve(process.cwd(),u);let t=$e(c,"@partial","@include"),C=De(e);t=t.replace(/@once([\s\S]*?)@endonce/g,(f,v,h)=>{let g=v.trim(),i=`${a}:${g}`;if(C.has(i))return"";return C.add(i),v});{let f=/@includeIf\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")")i--;x++}if(i!==0)break;let l=t.substring(g+1,x-1),o=l.match(/^\s*['"]([^'"]+)['"]/);if(!o){f.lastIndex=x;continue}let O=o[1],F=z(O,u,a),E="";if(F&&await Bun.file(F).exists())S.add(F),E=`@include(${l})`;t=t.substring(0,h)+E+t.substring(x),f.lastIndex=0}}for(let[f,v]of[["@includeWhen",!1],["@includeUnless",!0]]){let h=new RegExp(`${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),g;while((g=h.exec(t))!==null){let i=g.index,x=i+g[0].length-1,l=1,o=x+1;while(o<t.length&&l>0){if(t[o]==="(")l++;else if(t[o]===")")l--;o++}if(l!==0)break;let O=t.substring(x+1,o-1),F=ae(O,0);if(F===-1){h.lastIndex=o;continue}let E=O.substring(0,F).trim(),V=O.substring(F+1).trim(),U=V.match(/^\s*['"]([^'"]+)['"]/);if(!U){h.lastIndex=o;continue}let _=U[1],q=V.substring(U[0].length),j,R=ae(q,0);if(R!==-1)j=q.substring(R+1).trim();try{let k=`Boolean(${E})`,L;if(m(k)){let oe=p(k,Object.keys(e));L=Boolean(oe(...Object.values(e)))}else L=Boolean(d(k,e));let ee=v?!L:L,re="";if(ee){let oe=z(_,u,a);if(oe&&await Bun.file(oe).exists())S.add(oe);re=`@include('${_}'${j?`, ${j}`:""})`}t=t.substring(0,i)+re+t.substring(o),h.lastIndex=0}catch(k){let L=k instanceof Error?k.message:String(k),ee=b("Include",`Error evaluating ${f} condition: ${L}`,a,c,i);t=t.substring(0,i)+ee+t.substring(o),h.lastIndex=0}}}{let f=/@each\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),O=l.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!O){f.lastIndex=0,t=t.replace(o,"");continue}let[,F,E,V,U]=O;try{let _,q=E.trim();if(m(q))_=p(q,Object.keys(e))(...Object.values(e));else _=d(q,e);let j="";if(Array.isArray(_)&&_.length>0)for(let R of _){let k={...e,[V]:R},L=await se(F,k,c,h);j+=L}else if(U)j=await se(U,{},c,h);t=t.substring(0,h)+j+t.substring(x+1),f.lastIndex=0}catch(_){let q=_ instanceof Error?_.message:String(_);t=t.substring(0,h)+b("Each",`Error in @each: ${q}`,a,c,h)+t.substring(x+1),f.lastIndex=0}}}{let f=/@includeFirst\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),O=l.match(/^\s*(\[[^\]]+\])/);if(!O){f.lastIndex=0,t=t.replace(o,"");continue}let F=O[1],E=l.slice(O[0].length),V,U=E.match(/^\s*,\s*\{/);if(U){E=E.slice(U[0].length-1);let j=1,R=1;while(R<E.length&&j>0){if(E[R]==="{")j++;else if(E[R]==="}"){if(j--,j===0)break}R++}V=E.substring(0,R+1),E=E.slice(R+1)}let _,q=E.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(q)_=q[1];try{let j=JSON.parse(F.replace(/'/g,'"')),R={};if(V)try{R=M(V,e)}catch(L){let ee=L instanceof Error?L.message:String(L);if(r.debug){let re=b("Include",`Error parsing includeFirst variables: ${ee}`,a,c,h,o);t=t.replace(o,()=>re)}else t=t.replace(o,()=>_||"");continue}let k=!1;for(let L of j){let ee=z(L,u,a);if(!ee)continue;if(await s(ee)){let re=await se(L,R,c,h);t=t.replace(o,()=>re),k=!0;break}}if(!k)if(_!==void 0)t=t.replace(o,()=>_);else if(r.debug){let L=b("Include",`None of the includeFirst paths exist: ${F}`,a,c,h,o);t=t.replace(o,()=>L)}else t=t.replace(o,"")}catch(j){let R=j instanceof Error?j.message:String(j),k=b("Include",`Error processing @includeFirst: ${R}`,a,c,h,o);t=t.replace(o,()=>k)}f.lastIndex=0}}function z(f,v,h){try{let g=f;if(!f.endsWith(".stx"))g=`${f}.stx`;let i=A.resolve(v),x=A.resolve(A.dirname(h)),l;if(!g.startsWith("./")&&!g.startsWith("../")){for(let U of r._layerPartialDirs??[]){let _=A.resolve(U,g);if(_.startsWith(`${A.resolve(U)}${A.sep}`)&&ye(_))return _}l=A.resolve(v,g)}else l=A.resolve(x,g);let o=A.normalize(l),O=o.startsWith(i+A.sep)||o===i,F=o.startsWith(x+A.sep)||o===x,E=!1,V=A.dirname(x);if(o.startsWith(V+A.sep)){if(!A.relative(V,o).split(A.sep).some((j)=>j.startsWith(".")&&j!=="."&&j!==".."))E=!0}if(!O&&!F&&!E)return console.error(`Security: Path traversal attempt blocked for include path: ${f}`),console.error(` Resolved to: ${o}`),console.error(` Allowed dirs: ${i}, ${x}`),null;return o}catch(g){return console.error(`Error resolving path ${f}: ${g}`),null}}let ie=A.resolve(a);n.add(ie);function N(f,v,h,g){return r.onIncludeError?.({includePath:f,templatePath:a,message:v,partialsDir:u}),b("Include",v,a,h,g)}async function se(f,v={},h,g){let i=z(f,u,a);if(!i)return N(f,`Could not resolve path for include: ${f}`,h,g);let x=A.resolve(i);if(n.has(x)){let l=[...n,x].map((o)=>A.basename(o)).join(" -> ");return N(f,`Circular include detected: ${l}`,h,g)}try{S.add(i);let l;if(!l)try{l=await Bun.file(i).text()}catch(y){let K=y instanceof Error?y.message:String(y);return N(f,`Error loading include file ${f}: ${K}`,h,g)}if(l)l=l.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(l&&l.includes("@stream")){let{processStreamDirectives:y}=await import("./chunk-6w9sgs52.js");l=y(l,e)}if(l&&(r.debug||!I()&&!Fn()))try{let{warnUnbalancedTags:y}=await import("./chunk-20hy5p3p.js");y(l,i)}catch{}try{let{processESImports:y}=await import("./chunk-dqt1kw68.js");l=await y(l,e,i,r,S)}catch(y){if(r.debug)console.warn(`[stx] partial ES import extraction skipped for ${i}:`,y instanceof Error?y.message:y)}let o=l,O=B(o);if(O)o=O.content.trim();let E=l.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),V="";if(E)V=`<style${E[1]}>${E[2]}</style>`;let U=[];o=o.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(y,K,w)=>{if(!me(K))return"";return U.push({attrs:K,body:w}),`__STX_DATA_BLOCK_${U.length-1}__`}),o=o.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let _={...e};_.__stx_signals_gate=Me(l,i);for(let[y,K]of Object.entries(v))_[y]=K;let q=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,j=[...l.matchAll(q)].sort((y,K)=>{let w=(y[1]||"").includes("server"),X=(K[1]||"").includes("server");return Number(X)-Number(w)}),R="",k=null,L=!1,ee=!1;for(let y of j){let K=y[1]||"",w=y[2]||"";if(me(K))continue;let X=K.includes("server"),be=Ye(K);if(!X&&!/\bsrc\s*=/i.test(K))Ke(w,i,r.strict);if(!X&&w.trim()){let{interpolateScriptExpressions:Z}=await import("./chunk-pmmctgdd.js");w=Z(w,_,f)}let ce="";try{let{extractAndStripCssImports:Z,renderVendorStyleTags:Q}=await import("./chunk-cw7vnkc8.js"),ne=Z(w,{filePath:i,projectRoot:process.cwd()});w=ne.code,ce=Q(ne.styles)}catch(Z){if(r.debug)console.warn(`[stx] vendor-css extractor skipped for ${i}:`,Z instanceof Error?Z.message:Z)}if(be&&w.trim())w=Ze(w);if(!X){try{let{injectBrowserCoreAutoImports:Q}=await import("./chunk-cw7vnkc8.js");w=Q(w).code;let{hasUserImports:ne,bundleClientScript:Se}=await import("./chunk-q33tyfpp.js");if(ne(w))w=await Se(w,i,{projectRoot:process.cwd()})}catch(Q){if(r.debug)console.warn(`[stx] bundler skipped for ${i}:`,Q instanceof Error?Q.message:Q)}let{stripStxRuntimeImports:Z}=await import("./chunk-r425m35g.js");w=Z(w)}let de=Ee(w);if(!X){let{extractBridgeData:Z,generateServerDataBridge:Q}=await import("./chunk-cw7vnkc8.js"),ne=Q(w,Z(_));if(ne)w=`${ne}
47
+ })();`;return a+c+r}function Te(c,e){if(W(c)){let n=W(c).tag.match(/data-stx-scope="([^"]*)"/);if(n)return{html:c,mergedIntoExisting:n[1],stamped:!0,root:"body"};return{html:ut(c,(u,t)=>`<body${t} data-stx-scope="${e}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let a=Vt(c),r=c.slice(a).match(/^(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(r){let S=r[1]+r[2],n=r[1].slice(1),u=S.match(/data-stx-scope="([^"]*)"/);if(u)return{html:c,mergedIntoExisting:u[1],stamped:!0,root:n};let t=c.slice(0,a),C=r[1],z=r[2];return{html:`${t}${C} data-stx-scope="${e}"${z}${c.slice(a+r[0].length)}`,mergedIntoExisting:null,stamped:!0,root:n}}return{html:c,mergedIntoExisting:null,stamped:!1,root:null}}var Ae=0;function fe(c,e){let a=A.basename(c,".stx").replace(/[^a-zA-Z0-9]/g,"_"),r=e.__stx_scope_seq;return r?`stx_scope_${a}_${++r.n}_${r.key}`:`stx_scope_${a}_${++Ae}`}var le=new Set,pe=new Set;function uy(){le.clear(),pe.clear()}var Ce=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function fg(c){let e=(t)=>t.replace(/[^\n]/g," "),a=c.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,e).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,e).replace(/<!--[\s\S]*?-->/g,e).replace(/\x00STX_HTML_COMMENT_\d+\x00/g,e).replace(/\{\{[\s\S]*?\}\}/g,e).replace(/\{!![\s\S]*?!!\}/g,e),r=[],S=0,n=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,u;while((u=n.exec(a))!==null){let t=u[1]==="/",C=u[2],z=u[3]==="/"||Ce.has(C.toLowerCase());if(t){S=Math.max(0,S-1);continue}if(S===0)r.push(C);if(!z)S++}return r}function me(c){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(c)}var lt=new T(500),Dc=new Set;function dy(){Dc.clear()}function De(c){if(c.__onceStore instanceof Set)return c.__onceStore;return Dc}async function Ts(c,e,a,r,S,n=new Set){let u=r.partialsDir||A.join(A.dirname(a),"partials");if(u&&!A.isAbsolute(u))u=A.resolve(process.cwd(),u);let t=$e(c,"@partial","@include"),C=De(e);t=t.replace(/@once([\s\S]*?)@endonce/g,(f,v,h)=>{let g=v.trim(),i=`${a}:${g}`;if(C.has(i))return"";return C.add(i),v});{let f=/@includeIf\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")")i--;x++}if(i!==0)break;let l=t.substring(g+1,x-1),o=l.match(/^\s*['"]([^'"]+)['"]/);if(!o){f.lastIndex=x;continue}let O=o[1],F=z(O,u,a),E="";if(F&&await Bun.file(F).exists())S.add(F),E=`@include(${l})`;t=t.substring(0,h)+E+t.substring(x),f.lastIndex=0}}for(let[f,v]of[["@includeWhen",!1],["@includeUnless",!0]]){let h=new RegExp(`${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),g;while((g=h.exec(t))!==null){let i=g.index,x=i+g[0].length-1,l=1,o=x+1;while(o<t.length&&l>0){if(t[o]==="(")l++;else if(t[o]===")")l--;o++}if(l!==0)break;let O=t.substring(x+1,o-1),F=ae(O,0);if(F===-1){h.lastIndex=o;continue}let E=O.substring(0,F).trim(),V=O.substring(F+1).trim(),U=V.match(/^\s*['"]([^'"]+)['"]/);if(!U){h.lastIndex=o;continue}let _=U[1],q=V.substring(U[0].length),j,R=ae(q,0);if(R!==-1)j=q.substring(R+1).trim();try{let k=`Boolean(${E})`,L;if(m(k)){let oe=p(k,Object.keys(e));L=Boolean(oe(...Object.values(e)))}else L=Boolean(d(k,e));let ee=v?!L:L,re="";if(ee){let oe=z(_,u,a);if(oe&&await Bun.file(oe).exists())S.add(oe);re=`@include('${_}'${j?`, ${j}`:""})`}t=t.substring(0,i)+re+t.substring(o),h.lastIndex=0}catch(k){let L=k instanceof Error?k.message:String(k),ee=b("Include",`Error evaluating ${f} condition: ${L}`,a,c,i);t=t.substring(0,i)+ee+t.substring(o),h.lastIndex=0}}}{let f=/@each\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),O=l.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!O){f.lastIndex=0,t=t.replace(o,"");continue}let[,F,E,V,U]=O;try{let _,q=E.trim();if(m(q))_=p(q,Object.keys(e))(...Object.values(e));else _=d(q,e);let j="";if(Array.isArray(_)&&_.length>0)for(let R of _){let k={...e,[V]:R},L=await se(F,k,c,h);j+=L}else if(U)j=await se(U,{},c,h);t=t.substring(0,h)+j+t.substring(x+1),f.lastIndex=0}catch(_){let q=_ instanceof Error?_.message:String(_);t=t.substring(0,h)+b("Each",`Error in @each: ${q}`,a,c,h)+t.substring(x+1),f.lastIndex=0}}}{let f=/@includeFirst\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),O=l.match(/^\s*(\[[^\]]+\])/);if(!O){f.lastIndex=0,t=t.replace(o,"");continue}let F=O[1],E=l.slice(O[0].length),V,U=E.match(/^\s*,\s*\{/);if(U){E=E.slice(U[0].length-1);let j=1,R=1;while(R<E.length&&j>0){if(E[R]==="{")j++;else if(E[R]==="}"){if(j--,j===0)break}R++}V=E.substring(0,R+1),E=E.slice(R+1)}let _,q=E.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(q)_=q[1];try{let j=JSON.parse(F.replace(/'/g,'"')),R={};if(V)try{R=M(V,e)}catch(L){let ee=L instanceof Error?L.message:String(L);if(r.debug){let re=b("Include",`Error parsing includeFirst variables: ${ee}`,a,c,h,o);t=t.replace(o,()=>re)}else t=t.replace(o,()=>_||"");continue}let k=!1;for(let L of j){let ee=z(L,u,a);if(!ee)continue;if(await s(ee)){let re=await se(L,R,c,h);t=t.replace(o,()=>re),k=!0;break}}if(!k)if(_!==void 0)t=t.replace(o,()=>_);else if(r.debug){let L=b("Include",`None of the includeFirst paths exist: ${F}`,a,c,h,o);t=t.replace(o,()=>L)}else t=t.replace(o,"")}catch(j){let R=j instanceof Error?j.message:String(j),k=b("Include",`Error processing @includeFirst: ${R}`,a,c,h,o);t=t.replace(o,()=>k)}f.lastIndex=0}}function z(f,v,h){try{let g=f;if(!f.endsWith(".stx"))g=`${f}.stx`;let i=A.resolve(v),x=A.resolve(A.dirname(h)),l;if(!g.startsWith("./")&&!g.startsWith("../")){for(let U of r._layerPartialDirs??[]){let _=A.resolve(U,g);if(_.startsWith(`${A.resolve(U)}${A.sep}`)&&ye(_))return _}l=A.resolve(v,g)}else l=A.resolve(x,g);let o=A.normalize(l),O=o.startsWith(i+A.sep)||o===i,F=o.startsWith(x+A.sep)||o===x,E=!1,V=A.dirname(x);if(o.startsWith(V+A.sep)){if(!A.relative(V,o).split(A.sep).some((j)=>j.startsWith(".")&&j!=="."&&j!==".."))E=!0}if(!O&&!F&&!E)return console.error(`Security: Path traversal attempt blocked for include path: ${f}`),console.error(` Resolved to: ${o}`),console.error(` Allowed dirs: ${i}, ${x}`),null;return o}catch(g){return console.error(`Error resolving path ${f}: ${g}`),null}}let ie=A.resolve(a);n.add(ie);function N(f,v,h,g){return r.onIncludeError?.({includePath:f,templatePath:a,message:v,partialsDir:u}),b("Include",v,a,h,g)}async function se(f,v={},h,g){let i=z(f,u,a);if(!i)return N(f,`Could not resolve path for include: ${f}`,h,g);let x=A.resolve(i);if(n.has(x)){let l=[...n,x].map((o)=>A.basename(o)).join(" -> ");return N(f,`Circular include detected: ${l}`,h,g)}try{S.add(i);let l;if(!l)try{l=await Bun.file(i).text()}catch(y){let K=y instanceof Error?y.message:String(y);return N(f,`Error loading include file ${f}: ${K}`,h,g)}if(l)l=l.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(l&&l.includes("@stream")){let{processStreamDirectives:y}=await import("./chunk-68qw8ak4.js");l=y(l,e)}if(l&&(r.debug||!I()&&!Fn()))try{let{warnUnbalancedTags:y}=await import("./chunk-20hy5p3p.js");y(l,i)}catch{}try{let{processESImports:y}=await import("./chunk-rektg4nx.js");l=await y(l,e,i,r,S)}catch(y){if(r.debug)console.warn(`[stx] partial ES import extraction skipped for ${i}:`,y instanceof Error?y.message:y)}let o=l,O=B(o);if(O)o=O.content.trim();let E=l.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),V="";if(E)V=`<style${E[1]}>${E[2]}</style>`;let U=[];o=o.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(y,K,w)=>{if(!me(K))return"";return U.push({attrs:K,body:w}),`__STX_DATA_BLOCK_${U.length-1}__`}),o=o.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let _={...e};_.__stx_signals_gate=Me(l,i);for(let[y,K]of Object.entries(v))_[y]=K;let q=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,j=[...l.matchAll(q)].sort((y,K)=>{let w=(y[1]||"").includes("server"),X=(K[1]||"").includes("server");return Number(X)-Number(w)}),R="",k=null,L=!1,ee=!1;for(let y of j){let K=y[1]||"",w=y[2]||"";if(me(K))continue;let X=K.includes("server"),be=Ye(K);if(!X&&!/\bsrc\s*=/i.test(K))Ke(w,i,r.strict);if(!X&&w.trim()){let{interpolateScriptExpressions:Z}=await import("./chunk-jk6zn8tw.js");w=Z(w,_,f)}let ce="";try{let{extractAndStripCssImports:Z,renderVendorStyleTags:Q}=await import("./chunk-6ryenxnh.js"),ne=Z(w,{filePath:i,projectRoot:process.cwd()});w=ne.code,ce=Q(ne.styles)}catch(Z){if(r.debug)console.warn(`[stx] vendor-css extractor skipped for ${i}:`,Z instanceof Error?Z.message:Z)}if(be&&w.trim())w=Ze(w);if(!X){try{let{injectBrowserCoreAutoImports:Q}=await import("./chunk-6ryenxnh.js");w=Q(w).code;let{hasUserImports:ne,bundleClientScript:Se}=await import("./chunk-1gfc406y.js");if(ne(w))w=await Se(w,i,{projectRoot:process.cwd()})}catch(Q){if(r.debug)console.warn(`[stx] bundler skipped for ${i}:`,Q instanceof Error?Q.message:Q)}let{stripStxRuntimeImports:Z}=await import("./chunk-pgb2p7pm.js");w=Z(w)}let de=Ee(w);if(!X){let{extractBridgeData:Z,generateServerDataBridge:Q}=await import("./chunk-6ryenxnh.js"),ne=Q(w,Z(_));if(ne)w=`${ne}
48
48
  ${w}`}if(de&&!X){L=!0,k=fe(i,e);let Z=D(w),Q=ue(Z,k);R+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${k}">${Q}</script>
49
- `;continue}if(X)try{let{extractVariables:Z}=await import("./chunk-3760wpvw.js");await Z(w,_,i)}catch(Z){if(r.debug)console.warn(`Warning: Could not extract variables from server script in ${i}:`,Z)}if(!X&&!de){let Z=K.replace(/\bclient\b/i,"").trim();k=fe(i,e);let Q=D(w),ne=ue(Q,k);if(/__scopeRegistration\["(?!__stx)[^"]+"\]\s*=|Object\.defineProperty\(__scopeRegistration, "(?!__stx)/.test(ne))ee=!0;R+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${k}"${Z?` ${Z}`:""}>${ne}</script>
50
- `}}if(U.length>0){let{interpolateScriptExpressions:y}=await import("./chunk-pmmctgdd.js");o=o.replace(/__STX_DATA_BLOCK_(\d+)__/g,(K,w)=>{let X=U[Number(w)];return`<script${X.attrs}>${y(X.body,_,f)}</script>`})}if(k){let y=Te(o,k);if(o=y.html,y.mergedIntoExisting){let w=k,X=y.mergedIntoExisting;R=R.split(`'${w}'`).join(`'${X}'`).split(`"${w}"`).join(`"${X}"`),k=X}else if(!y.stamped&&L&&!le.has(i))le.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`);if(y.stamped&&y.root!=="body"&&(L||ee)&&!pe.has(i)){let w=fg(o);if(w.length>1)pe.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares ${L?"signals":"bindings"} and has ${w.length} top-level elements (${w.map((X)=>`<${X}>`).join(", ")}). Only the first is scoped, so bindings in the others cannot see what this partial's script declares. Wrap the partial's markup in a single root element.`)}let K=y.stamped&&y.root!==null&&Fr(y.root);R=ke(R,K?k:null)}if(o.includes("@include")||o.includes("@partial"))o=await Ts(o,_,i,r,S,n);let{processLoops:re,reportDeferredLoopWarnings:oe}=await import("./chunk-24hrd8sg.js"),J=re(o,_,i,void 0,!0);J=ge(J,_,i),J=oe(J);let{processMetaDirectives:xe,processSeoDirective:_e,processStructuredData:we}=await import("./chunk-94r6mkcy.js");if(J=xe(J,_,i,r),J=we(J,_,i),J=_e(J,_,i,r),J=P(J,_,i),V)J+=`
49
+ `;continue}if(X)try{let{extractVariables:Z}=await import("./chunk-x5x8hbm0.js");await Z(w,_,i)}catch(Z){if(r.debug)console.warn(`Warning: Could not extract variables from server script in ${i}:`,Z)}if(!X&&!de){let Z=K.replace(/\bclient\b/i,"").trim();k=fe(i,e);let Q=D(w),ne=ue(Q,k);if(/__scopeRegistration\["(?!__stx)[^"]+"\]\s*=|Object\.defineProperty\(__scopeRegistration, "(?!__stx)/.test(ne))ee=!0;R+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${k}"${Z?` ${Z}`:""}>${ne}</script>
50
+ `}}if(U.length>0){let{interpolateScriptExpressions:y}=await import("./chunk-jk6zn8tw.js");o=o.replace(/__STX_DATA_BLOCK_(\d+)__/g,(K,w)=>{let X=U[Number(w)];return`<script${X.attrs}>${y(X.body,_,f)}</script>`})}if(k){let y=Te(o,k);if(o=y.html,y.mergedIntoExisting){let w=k,X=y.mergedIntoExisting;R=R.split(`'${w}'`).join(`'${X}'`).split(`"${w}"`).join(`"${X}"`),k=X}else if(!y.stamped&&L&&!le.has(i))le.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`);if(y.stamped&&y.root!=="body"&&(L||ee)&&!pe.has(i)){let w=fg(o);if(w.length>1)pe.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares ${L?"signals":"bindings"} and has ${w.length} top-level elements (${w.map((X)=>`<${X}>`).join(", ")}). Only the first is scoped, so bindings in the others cannot see what this partial's script declares. Wrap the partial's markup in a single root element.`)}let K=y.stamped&&y.root!==null&&Fr(y.root);R=ke(R,K?k:null)}if(o.includes("@include")||o.includes("@partial"))o=await Ts(o,_,i,r,S,n);let{processLoops:re,reportDeferredLoopWarnings:oe}=await import("./chunk-rtrhv7nd.js"),J=re(o,_,i,void 0,!0);J=ge(J,_,i),J=oe(J);let{processMetaDirectives:xe,processSeoDirective:_e,processStructuredData:we}=await import("./chunk-94r6mkcy.js");if(J=xe(J,_,i,r),J=we(J,_,i),J=_e(J,_,i,r),J=P(J,_,i),V)J+=`
51
51
  `+V;if(R)J+=`
52
52
  `+R;return J}catch(l){if(l instanceof te)throw l;let o=l instanceof Error?l.message:String(l);return N(f,`Error processing include ${f}: ${o}`,h,g)}}let Y=/@include\s*\(/g,H;while((H=Y.exec(t))!==null){let f=H.index,v=f+H[0].length-1,h=1,g=v+1;while(g<t.length&&h>0){if(t[g]==="(")h++;else if(t[g]===")")h--;g++}if(h!==0)break;let i=t.substring(f,g),x=t.substring(v+1,g-1),l=x.match(/^\s*['"]([^'"]+)['"]/);if(!l){Y.lastIndex=g;continue}let o=l[1],O,F=x.substring(l[0].length),E=ae(F,0);if(E!==-1)O=F.substring(E+1).trim();let V={};if(O)try{V=M(O,e)}catch(_){let q=_ instanceof Error?_.message:String(_);t=t.replace(i,b("Include",`Error parsing include variables for ${o}: ${q}`,a,c,f)),Y.lastIndex=0;continue}let U=await se(o,V,c,f);t=t.substring(0,f)+U+t.substring(g),Y.lastIndex=0}return t}function $s(c,e){let a=c;function r(S,n,u,t){let C=S,z=!0;while(z){z=!1;let ie=new RegExp(`@${n}\\(['"]([^'"]+)['"]\\)`),N=C.match(ie);if(!N||N.index===void 0)break;let se=N.index,Y=N[1],H=se+N[0].length,f=new RegExp(`@${n}\\(`),v=new RegExp(`@${u}(?![a-z])`),h=1,g=H,i=-1;while(h>0&&g<C.length){let l=C.slice(g),o=l.match(f),O=l.match(v),F=o?g+o.index:1/0,E=O?g+O.index:1/0;if(F<E)h++,g=F+(o[0].length||1);else if(E<1/0){if(h--,h===0){i=E;break}g=E+u.length+1}else break}if(i===-1)break;let x=C.slice(H,i);if(!e[Y])e[Y]=[];if(t)e[Y].unshift(x);else e[Y].push(x);C=C.substring(0,se)+C.substring(i+`@${u}`.length),z=!0}return C}return a=r(a,"push","endpush",!1),a=r(a,"prepend","endprepend",!0),a}function Rs(c,e){return c.replace(/@stack\(['"]([^'"]+)['"]\)/g,(a,r)=>{if(!e[r]||e[r].length===0)return"";return e[r].join(`
53
53
  `)})}
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Rm}from"./chunk-wvpk866c.js";import"./chunk-btetjy8n.js";import"./chunk-c8qp8b5z.js";import"./chunk-vr9dbmxh.js";import"./chunk-759jwj0e.js";import"./chunk-pdvssk6k.js";import"./chunk-03sqt4jx.js";import"./chunk-zytwcfbt.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-9gptdyqq.js";import"./chunk-cxzy7kxg.js";import"./chunk-d2rwg24x.js";import"./chunk-w98yt4d4.js";import"./chunk-c08jvjqt.js";import"./chunk-phzhmnnm.js";import"./chunk-ck4ypzet.js";import"./chunk-0jdz31q1.js";import"./chunk-4b110x6r.js";export{Rm as startProductionServer};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{q,Sg,vi,Wc,a,j,_y,Cy}from"./chunk-2r84qtat.js";import"./chunk-r2ns89f7.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-b234w3mf.js";import"./chunk-ggez55jb.js";import"./chunk-4zw9trtx.js";import"./chunk-w98yt4d4.js";import"./chunk-c08jvjqt.js";import"./chunk-phzhmnnm.js";import"./chunk-ck4ypzet.js";import"./chunk-0jdz31q1.js";import"./chunk-4b110x6r.js";export{j as config,q as defaultConfig,_y as defineStxConfig,vi as discoverConfig,a as loadStxConfig,Wc as resolveInstalledPackage,Sg as resolveStxDirectories,Cy as validateConfig};
2
+ import{q,Sg,vi,Wc,a,j,_y,Cy}from"./chunk-03sqt4jx.js";import"./chunk-zytwcfbt.js";import"./chunk-razwegar.js";import"./chunk-mpfm5ctr.js";import"./chunk-eca022er.js";import"./chunk-9gptdyqq.js";import"./chunk-cxzy7kxg.js";import"./chunk-d2rwg24x.js";import"./chunk-w98yt4d4.js";import"./chunk-c08jvjqt.js";import"./chunk-phzhmnnm.js";import"./chunk-ck4ypzet.js";import"./chunk-0jdz31q1.js";import"./chunk-4b110x6r.js";export{j as config,q as defaultConfig,_y as defineStxConfig,vi as discoverConfig,a as loadStxConfig,Wc as resolveInstalledPackage,Sg as resolveStxDirectories,Cy as validateConfig};