@stacksjs/stx 0.2.602 → 0.2.604

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 (58) hide show
  1. package/dist/builtins/stx-image.js +9 -1
  2. package/dist/{chunk-z45vasvd.js → chunk-00vp75pj.js} +1 -1
  3. package/dist/{chunk-ydjvq37t.js → chunk-08p1kxsj.js} +1 -1
  4. package/dist/{chunk-0503xem3.js → chunk-0rekvsy4.js} +1 -1
  5. package/dist/chunk-1sbj8yqe.js +2 -0
  6. package/dist/{chunk-dp3y2rzk.js → chunk-38mt99p3.js} +1 -1
  7. package/dist/{chunk-hzx1w6zp.js → chunk-3xdfqn0d.js} +2 -2
  8. package/dist/{chunk-g0vea6pt.js → chunk-5c153w4j.js} +1 -1
  9. package/dist/{chunk-ab2pgm10.js → chunk-6vncjspv.js} +1 -1
  10. package/dist/{chunk-xqq5qhry.js → chunk-788d9msn.js} +1 -1
  11. package/dist/{chunk-5p6hhtts.js → chunk-79zfhk62.js} +1 -1
  12. package/dist/{chunk-ws47nafx.js → chunk-7ejmya3v.js} +1 -1
  13. package/dist/{chunk-251nphdz.js → chunk-8mffwm1f.js} +1 -1
  14. package/dist/{chunk-hcpp6yar.js → chunk-8txwa114.js} +1 -1
  15. package/dist/{chunk-5gc66nr0.js → chunk-a1szmtn1.js} +2 -2
  16. package/dist/{chunk-e7hmrrmt.js → chunk-afmzxwj1.js} +1 -1
  17. package/dist/{chunk-m8hf7ptd.js → chunk-bk3yktq8.js} +1 -1
  18. package/dist/{chunk-dwdfgvt5.js → chunk-bn7fzfc2.js} +1 -1
  19. package/dist/{chunk-2mb8tf3m.js → chunk-bpz3yv92.js} +1 -1
  20. package/dist/{chunk-hpjtzap4.js → chunk-bx3qewwk.js} +1 -1
  21. package/dist/{chunk-r6s1bweb.js → chunk-de3gknmn.js} +1 -1
  22. package/dist/{chunk-4zynysf7.js → chunk-djqmzzn6.js} +1 -1
  23. package/dist/{chunk-9vyq00n1.js → chunk-eactb0nz.js} +1 -1
  24. package/dist/{chunk-xkq16s3g.js → chunk-er5wxv0f.js} +1 -1
  25. package/dist/chunk-esac5ych.js +2 -0
  26. package/dist/{chunk-gxm1rb64.js → chunk-et8wjgxw.js} +1 -1
  27. package/dist/{chunk-tsr1segw.js → chunk-ftr0fvw7.js} +2 -2
  28. package/dist/{chunk-4c3w08zb.js → chunk-g3qbe5y2.js} +1 -1
  29. package/dist/{chunk-2jmm2r0n.js → chunk-h5g8k974.js} +1 -1
  30. package/dist/chunk-hvd9qc98.js +2 -0
  31. package/dist/{chunk-tthvk93d.js → chunk-hvqjs9ps.js} +1 -1
  32. package/dist/{chunk-cqpa9t8d.js → chunk-j0z7010x.js} +213 -213
  33. package/dist/{chunk-wv7n3rf7.js → chunk-jb6zejnt.js} +1 -1
  34. package/dist/{chunk-6xw8e915.js → chunk-jczknjbw.js} +1 -1
  35. package/dist/{chunk-1qzwmwy3.js → chunk-jjs6nqh1.js} +1 -1
  36. package/dist/{chunk-7p24w8s7.js → chunk-jmczvhpy.js} +1 -1
  37. package/dist/{chunk-67c7b1sq.js → chunk-kn2exbq7.js} +2 -2
  38. package/dist/{chunk-1r9pp3n6.js → chunk-r4adpej7.js} +1 -1
  39. package/dist/{chunk-twzgm77s.js → chunk-rd7w0cx4.js} +5 -5
  40. package/dist/{chunk-8703zy2m.js → chunk-rd9yv1n3.js} +1 -1
  41. package/dist/{chunk-s7j2nfgm.js → chunk-t9914jjh.js} +1 -1
  42. package/dist/{chunk-2hfkz731.js → chunk-vmsw9sdw.js} +1 -1
  43. package/dist/{chunk-ej48g5jf.js → chunk-wf2wnmjg.js} +1 -1
  44. package/dist/{chunk-cazey998.js → chunk-xarb7knj.js} +1 -1
  45. package/dist/{chunk-g1fzq7ph.js → chunk-xcyreehd.js} +1 -1
  46. package/dist/{chunk-vdx8k2rz.js → chunk-xe7jw7nn.js} +1 -1
  47. package/dist/{chunk-00prqyk1.js → chunk-xwatzxk5.js} +1 -1
  48. package/dist/{chunk-c5f6nasc.js → chunk-ydt4sd6m.js} +1 -1
  49. package/dist/{chunk-evzxtxk3.js → chunk-zg0pnh4w.js} +1 -1
  50. package/dist/cli.js +7 -7
  51. package/dist/craft-entry.js +1 -1
  52. package/dist/craft.js +1 -1
  53. package/dist/pwa.js +1 -1
  54. package/dist/ssg.js +2 -2
  55. package/package.json +5 -5
  56. package/dist/chunk-5h7804sa.js +0 -2
  57. package/dist/chunk-gdnyhem4.js +0 -2
  58. package/dist/chunk-vjp3zha1.js +0 -2
@@ -107,7 +107,7 @@ export const StxImageBuiltin = {
107
107
  name: "StxImage",
108
108
  aliases: ["Image", "stx-image", "stx-img"],
109
109
  render(props, _slotContent, _ctx) {
110
- const src = resolveProp(props, "src") || "", delivery = getImageDelivery(src), alt = resolveProp(props, "alt") || "", width = resolveProp(props, "width") || (delivery ? String(delivery.source.width) : void 0), height = resolveProp(props, "height") || (delivery ? String(delivery.source.height) : void 0), sizes = resolveProp(props, "sizes"), srcset = resolveProp(props, "srcset"), densities = resolveProp(props, "densities"), format = resolveProp(props, "format"), transparent = isTransparentImage(src) || getImagePlaceholder(src)?.transparent === !0, placeholder = resolveProp(props, "placeholder") || (delivery && !transparent ? "thumbhash" : void 0), placeholderColor = resolveProp(props, "placeholderColor") || "#e5e7eb", provider = resolveProp(props, "provider"), className = resolveProp(props, "class") || resolveProp(props, "className") || "", style = resolveProp(props, "style") || "", quality = resolveProp(props, "quality"), lazy = resolveBoolProp(props, "lazy", !0), preload = resolveBoolProp(props, "preload", !1), priority = resolveBoolProp(props, "priority", !1), explicitLoading = resolveProp(props, "loading"), decoding = resolveProp(props, "decoding") || "async", usePicture = !!delivery || resolveBoolProp(props, "picture", !1) || !!format, numWidth = width ? Number.parseInt(width) : void 0, numHeight = height ? Number.parseInt(height) : void 0;
110
+ const src = resolveProp(props, "src") || "", delivery = getImageDelivery(src), alt = resolveProp(props, "alt") || "", width = resolveProp(props, "width") || (delivery ? String(delivery.source.width) : void 0), height = resolveProp(props, "height") || (delivery ? String(delivery.source.height) : void 0), sizes = resolveProp(props, "sizes"), srcset = resolveProp(props, "srcset"), densities = resolveProp(props, "densities"), format = resolveProp(props, "format"), transparent = isTransparentImage(src) || getImagePlaceholder(src)?.transparent === !0, placeholder = resolveProp(props, "placeholder") || (delivery && !transparent ? "thumbhash" : void 0), placeholderColor = resolveProp(props, "placeholderColor") || "#e5e7eb", provider = resolveProp(props, "provider"), className = resolveProp(props, "class") || resolveProp(props, "className") || "", style = resolveProp(props, "style") || "", objectFit = resolveProp(props, "objectFit") || resolveProp(props, "fit"), objectPosition = resolveProp(props, "objectPosition") || resolveProp(props, "position"), quality = resolveProp(props, "quality"), lazy = resolveBoolProp(props, "lazy", !0), preload = resolveBoolProp(props, "preload", !1), priority = resolveBoolProp(props, "priority", !1), explicitLoading = resolveProp(props, "loading"), decoding = resolveProp(props, "decoding") || "async", usePicture = !!delivery || resolveBoolProp(props, "picture", !1) || !!format, numWidth = width ? Number.parseInt(width) : void 0, numHeight = height ? Number.parseInt(height) : void 0;
111
111
  let finalSrcset = srcset || "", finalSizes = "";
112
112
  if (delivery) {
113
113
  finalSrcset = delivery.sources[delivery.fallback.format] || "";
@@ -123,6 +123,10 @@ export const StxImageBuiltin = {
123
123
  const styles = [];
124
124
  if (style)
125
125
  styles.push(style);
126
+ if (objectFit)
127
+ styles.push(`object-fit:${objectFit}`);
128
+ if (objectPosition)
129
+ styles.push(`object-position:${objectPosition}`);
126
130
  if (numWidth && numHeight)
127
131
  styles.push(`aspect-ratio:${numWidth}/${numHeight}`);
128
132
  const placeholderProperties = [], derivedPlaceholder = placeholder === "blur" || placeholder === "color" || placeholder === "thumbhash";
@@ -184,6 +188,10 @@ export const StxImageBuiltin = {
184
188
  "class",
185
189
  "className",
186
190
  "style",
191
+ "objectFit",
192
+ "objectPosition",
193
+ "fit",
194
+ "position",
187
195
  "format",
188
196
  "provider",
189
197
  "quality",
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{pd,Ic,Cs,_s,xi,Si,Es,Ts,ar,Oc,ki,Ci,Dc,Ye}from"./chunk-cqpa9t8d.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-6xw8e915.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-nfht2ryp.js";import"./chunk-82bttwqm.js";export{pd as clearScriptScanCache,Es as convertServerLoopAttributesToDirectives,xi as convertSignalDirectivesToAttributes,Ts as convertSignalLoopsToAttributes,Oc as extractExports,Ci as findMarkupIndexOutsideScripts,_s as hasSignalsSyntax,Cs as parseLoopExpression,Si as preEvalLiteralReactiveIfs,ar as processScriptSetup,ki as processSignals,Dc as rewriteStxImportSpecifiers,Ic as scanScriptTags,Ye as stripStxRuntimeImports};
2
+ import{pd,Ic,Cs,_s,xi,Si,Es,Ts,ar,Oc,ki,Ci,Dc,Ye}from"./chunk-j0z7010x.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-jczknjbw.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-nfht2ryp.js";import"./chunk-82bttwqm.js";export{pd as clearScriptScanCache,Es as convertServerLoopAttributesToDirectives,xi as convertSignalDirectivesToAttributes,Ts as convertSignalLoopsToAttributes,Oc as extractExports,Ci as findMarkupIndexOutsideScripts,_s as hasSignalsSyntax,Cs as parseLoopExpression,Si as preEvalLiteralReactiveIfs,ar as processScriptSetup,ki as processSignals,Dc as rewriteStxImportSpecifiers,Ic as scanScriptTags,Ye as stripStxRuntimeImports};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ba,So,wl,va,wa,xl,Sl}from"./chunk-xkq16s3g.js";import"./chunk-wv7n3rf7.js";import"./chunk-xqq5qhry.js";import"./chunk-7p24w8s7.js";import"./chunk-tds3d65g.js";import{Je,Ac}from"./chunk-cqpa9t8d.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-6xw8e915.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-nfht2ryp.js";import"./chunk-82bttwqm.js";export{ba as buildVirtualSource,Je as extractScriptBlocks,Ac as extractTemplateExpressions,va as findRuntimeTypeDeclarations,wa as findStxModuleDeclarations,Sl as formatTypecheckDiagnostics,wl as sourcePathFor,xl as typecheckStxFiles,So as virtualPathFor};
2
+ import{ba,So,wl,va,wa,xl,Sl}from"./chunk-er5wxv0f.js";import"./chunk-jb6zejnt.js";import"./chunk-788d9msn.js";import"./chunk-jmczvhpy.js";import"./chunk-tds3d65g.js";import{Je,Ac}from"./chunk-j0z7010x.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-jczknjbw.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-nfht2ryp.js";import"./chunk-82bttwqm.js";export{ba as buildVirtualSource,Je as extractScriptBlocks,Ac as extractTemplateExpressions,va as findRuntimeTypeDeclarations,wa as findStxModuleDeclarations,Sl as formatTypecheckDiagnostics,wl as sourcePathFor,xl as typecheckStxFiles,So as virtualPathFor};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Cl}from"./chunk-2hfkz731.js";import"./chunk-hzx1w6zp.js";import"./chunk-vn6h03nq.js";import"./chunk-7p24w8s7.js";import"./chunk-cqpa9t8d.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-6xw8e915.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-nfht2ryp.js";import"./chunk-82bttwqm.js";export{Cl as buildForProduction};
2
+ import{Cl}from"./chunk-vmsw9sdw.js";import"./chunk-3xdfqn0d.js";import"./chunk-vn6h03nq.js";import"./chunk-jmczvhpy.js";import"./chunk-j0z7010x.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-jczknjbw.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-nfht2ryp.js";import"./chunk-82bttwqm.js";export{Cl as buildForProduction};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ca,la}from"./chunk-rd7w0cx4.js";import"./chunk-5c153w4j.js";import"./chunk-xcyreehd.js";import"./chunk-tc3ne706.js";import"./chunk-g6ew2drc.js";import"./chunk-er5wxv0f.js";import"./chunk-4h58as2c.js";import"./chunk-vmsw9sdw.js";import{ko}from"./chunk-3xdfqn0d.js";import"./chunk-hsy9rhct.js";import"./chunk-f17rcvdb.js";import"./chunk-ydt4sd6m.js";import"./chunk-tnafnb23.js";import"./chunk-nb0ytx70.js";import"./chunk-rd9yv1n3.js";import"./chunk-1944jgb2.js";import"./chunk-gzpxvca7.js";import"./chunk-y09g63k0.js";import"./chunk-bsy10tz6.js";import"./chunk-htcptqtn.js";import"./chunk-wkxzzdzs.js";import"./chunk-bfbmdjh4.js";import"./chunk-jb6zejnt.js";import"./chunk-hz11wmx9.js";import"./chunk-q1cvef6b.js";import"./chunk-axz1x4r9.js";import"./chunk-h7atbtds.js";import"./chunk-8s7zbhdd.js";import"./chunk-de3gknmn.js";import"./chunk-vn6h03nq.js";import"./chunk-79zfhk62.js";import"./chunk-ftr0fvw7.js";import"./chunk-y0qjpcc8.js";import"./chunk-zrw1zf54.js";import"./chunk-788d9msn.js";import"./chunk-jmczvhpy.js";import"./chunk-tds3d65g.js";import{xe,hn,yn,J,u,n,dr,A,o,ge}from"./chunk-j0z7010x.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-jczknjbw.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-nfht2ryp.js";import"./chunk-82bttwqm.js";export{dr as buildWebComponents,yn as cacheTemplate,hn as checkCache,ko as classifyAllScripts,ca as createMiddleware,la as createRoute,A as defaultConfig,u as extractVariables,J as injectRouterScript,o as loadStxConfig,xe as processClientScript,n as processDirectives,ge as readMarkdownFile};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{J,Ds,Ns,Ms,n}from"./chunk-cqpa9t8d.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-6xw8e915.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-nfht2ryp.js";import"./chunk-82bttwqm.js";export{J as injectRouterScript,n as processDirectives,Ds as processJsonDirective,Ns as processOnceDirective,Ms as validateClientScript};
2
+ import{J,Ds,Ns,Ms,n}from"./chunk-j0z7010x.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-jczknjbw.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-nfht2ryp.js";import"./chunk-82bttwqm.js";export{J as injectRouterScript,n as processDirectives,Ds as processJsonDirective,Ns as processOnceDirective,Ms as validateClientScript};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Bt}from"./chunk-gh181dnr.js";import{li,ms,V,We,ee,It,x,Ke,Xe,cr,u}from"./chunk-cqpa9t8d.js";import{N}from"./chunk-zvs13kgh.js";var H=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function B(t,n,e){let r={fullTag:e,content:n,attrs:t};if(/\bserver\b/.test(t))return{...r,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...r,type:"client"};if(H.test(n))return{...r,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...r,type:"client"};return{...r,type:"server"}}var q=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function ko(t){let n=[],e=[],r=[],i=0;while(i<t.length){let s=t.indexOf("<",i);if(s===-1)break;let a=We(t,s);if(a>s){i=a;continue}let o=V(t,s);if(o>s){let c=t.slice(s,o),f=q.exec(c);if(f){let l=B(f[1],f[2],c);switch(l.type){case"signals":n.push(l);break;case"client":e.push(l);break;case"server":r.push(l);break}}i=o;continue}i=s+(t.startsWith("<!--",s)?4:1)}return{signals:n,client:e,server:r}}var z=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function G(t){let n=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=e.exec(t))!==null)n.push({start:r.index,end:r.index+r[0].length});return n}function P(t,n){return n.some((e)=>t>=e.start&&t<e.end)}function U(t){let n=(t||"").trim();if(!n)return null;if(/[\s>+~,:]/.test(n))return null;let e={},r=n,i=r.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),r=r.slice(i[0].length);while(r.length>0){let s=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(s){if(e.attr=s[1],s[3]!==void 0&&s[3]!=="")e.attrValue=s[3];r=r.slice(s[0].length);continue}let a=r.match(/^#([\w-]+)/);if(a){e.id=a[1],r=r.slice(a[0].length);continue}let o=r.match(/^\.([\w-]+)/);if(o){e.className=o[1],r=r.slice(o[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function W(t,n){if(n.attr){if(!(n.attrValue===void 0?new RegExp(`\\b${n.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${n.attr}\\s*=\\s*(["'])\\s*${n.attrValue}\\s*\\1`,"i")).test(t))return!1}if(n.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${n.id}\\s*\\1`,"i").test(t))return!1}if(n.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(n.className))return!1}return!0}function O(t,n="main"){let e=U(n);if(!e)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,i=G(t),s;while((s=r.exec(t))!==null){if(P(s.index,i))continue;let a=s[1].toLowerCase(),o=s[2]||"";if(o.trimEnd().endsWith("/")||z.has(a))continue;if(e.tag&&e.tag!==a)continue;if(!W(o,e))continue;let c=s[0],f=s.index+c.length,l=new RegExp(`<(/?)${a}\\b([^>]*)>`,"gi");l.lastIndex=f;let g=1,m;while((m=l.exec(t))!==null){if(P(m.index,i))continue;let S=m[1]==="/";if(!S&&(m[2]||"").trimEnd().endsWith("/"))continue;if(g+=S?-1:1,g===0)return{openTag:c,openIndex:s.index,start:f,end:m.index,tagName:a}}return null}return null}var Le="private, no-store";function Co(t){return t.replace(/&#(\d+);/g,(n,e)=>M(Number(e),n)).replace(/&#x([0-9a-f]+);/gi,(n,e)=>M(Number.parseInt(e,16),n)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function M(t,n){if(!Number.isInteger(t)||t<0||t>1114111)return n;try{return String.fromCodePoint(t)}catch{return n}}function oe(t){return t.headers.get("X-STX-Router")==="true"}function X(t,n){if(!t)return n;return t.split(",").some((r)=>r.trim().toLowerCase()===n.toLowerCase())?t:`${t}, ${n}`}function T(t){return{Vary:X(t,"X-STX-Router")}}import E from"path";var J="stx-page-head:",K=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,v={dev:null,prod:null};function Y(){let t=N()?"dev":"prod",n=v[t];if(n!==null)return n;try{let e=import.meta.require("./chunk-xmz2h8cb.js"),r=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;v[t]=`<script>${r()}</script>`}catch{v[t]=""}return v[t]}async function _o(t,n){if(n===!1)return null;if(n&&typeof n==="string"){let r=E.resolve(t,n);if(await Bun.file(r).exists())return r;return null}let e=E.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Fr(t,n){try{let e=await Bun.file(t).text(),r=e,i=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(i)r=i[1].trim();let s=ko(e),a=[...s.client.map((d)=>d.fullTag),...s.signals.map((d)=>d.fullTag)],o=[],c=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,f;while((f=c.exec(e))!==null)o.push(f[0]);let l=r;for(let d of s.server)l=l.replace(d.fullTag,"");for(let d of s.client)l=l.replace(d.fullTag,"");l=l.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let g="<!--__STX_PAGE_SLOT__-->";if(l=l.replace(/<slot\s*\/>/gi,g).replace(/<slot\s*>\s*<\/slot>/gi,g),!l.includes(g))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:m,extractVariables:S,defaultConfig:b,loadStxConfig:w}=await import("./chunk-vjp3zha1.js"),y=await w(),p={__filename:t,__dirname:E.dirname(t)};for(let d of a){let C=d.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!d.includes("client")&&!d.includes('type="module"'))await S(C[1],p,t)}let R=await m(l,p,t,{...b,...y,...n},new Set),h=R.indexOf(g);if(h===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:R.substring(0,h),afterSlot:R.substring(h+g.length),filePath:t,shellScripts:a,shellStyles:o}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function qn(t,n,e){let r,i="",s=n.match(K);if(s){n=n.replace(s[0],"");try{let l=Buffer.from(s[1],"base64").toString("utf8"),g=l.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(g)r=g[1].trim();i=l.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let a=e||r||"stx App",o=Y(),c="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
2
+ import{Bt}from"./chunk-gh181dnr.js";import{li,ms,V,We,ee,It,x,Ke,Xe,cr,u}from"./chunk-j0z7010x.js";import{N}from"./chunk-zvs13kgh.js";var H=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function B(t,n,e){let r={fullTag:e,content:n,attrs:t};if(/\bserver\b/.test(t))return{...r,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...r,type:"client"};if(H.test(n))return{...r,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...r,type:"client"};return{...r,type:"server"}}var q=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function ko(t){let n=[],e=[],r=[],i=0;while(i<t.length){let s=t.indexOf("<",i);if(s===-1)break;let a=We(t,s);if(a>s){i=a;continue}let o=V(t,s);if(o>s){let c=t.slice(s,o),f=q.exec(c);if(f){let l=B(f[1],f[2],c);switch(l.type){case"signals":n.push(l);break;case"client":e.push(l);break;case"server":r.push(l);break}}i=o;continue}i=s+(t.startsWith("<!--",s)?4:1)}return{signals:n,client:e,server:r}}var z=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function G(t){let n=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=e.exec(t))!==null)n.push({start:r.index,end:r.index+r[0].length});return n}function P(t,n){return n.some((e)=>t>=e.start&&t<e.end)}function U(t){let n=(t||"").trim();if(!n)return null;if(/[\s>+~,:]/.test(n))return null;let e={},r=n,i=r.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),r=r.slice(i[0].length);while(r.length>0){let s=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(s){if(e.attr=s[1],s[3]!==void 0&&s[3]!=="")e.attrValue=s[3];r=r.slice(s[0].length);continue}let a=r.match(/^#([\w-]+)/);if(a){e.id=a[1],r=r.slice(a[0].length);continue}let o=r.match(/^\.([\w-]+)/);if(o){e.className=o[1],r=r.slice(o[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function W(t,n){if(n.attr){if(!(n.attrValue===void 0?new RegExp(`\\b${n.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${n.attr}\\s*=\\s*(["'])\\s*${n.attrValue}\\s*\\1`,"i")).test(t))return!1}if(n.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${n.id}\\s*\\1`,"i").test(t))return!1}if(n.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(n.className))return!1}return!0}function O(t,n="main"){let e=U(n);if(!e)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,i=G(t),s;while((s=r.exec(t))!==null){if(P(s.index,i))continue;let a=s[1].toLowerCase(),o=s[2]||"";if(o.trimEnd().endsWith("/")||z.has(a))continue;if(e.tag&&e.tag!==a)continue;if(!W(o,e))continue;let c=s[0],f=s.index+c.length,l=new RegExp(`<(/?)${a}\\b([^>]*)>`,"gi");l.lastIndex=f;let g=1,m;while((m=l.exec(t))!==null){if(P(m.index,i))continue;let S=m[1]==="/";if(!S&&(m[2]||"").trimEnd().endsWith("/"))continue;if(g+=S?-1:1,g===0)return{openTag:c,openIndex:s.index,start:f,end:m.index,tagName:a}}return null}return null}var Le="private, no-store";function Co(t){return t.replace(/&#(\d+);/g,(n,e)=>M(Number(e),n)).replace(/&#x([0-9a-f]+);/gi,(n,e)=>M(Number.parseInt(e,16),n)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function M(t,n){if(!Number.isInteger(t)||t<0||t>1114111)return n;try{return String.fromCodePoint(t)}catch{return n}}function oe(t){return t.headers.get("X-STX-Router")==="true"}function X(t,n){if(!t)return n;return t.split(",").some((r)=>r.trim().toLowerCase()===n.toLowerCase())?t:`${t}, ${n}`}function T(t){return{Vary:X(t,"X-STX-Router")}}import E from"path";var J="stx-page-head:",K=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,v={dev:null,prod:null};function Y(){let t=N()?"dev":"prod",n=v[t];if(n!==null)return n;try{let e=import.meta.require("./chunk-xmz2h8cb.js"),r=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;v[t]=`<script>${r()}</script>`}catch{v[t]=""}return v[t]}async function _o(t,n){if(n===!1)return null;if(n&&typeof n==="string"){let r=E.resolve(t,n);if(await Bun.file(r).exists())return r;return null}let e=E.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Fr(t,n){try{let e=await Bun.file(t).text(),r=e,i=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(i)r=i[1].trim();let s=ko(e),a=[...s.client.map((d)=>d.fullTag),...s.signals.map((d)=>d.fullTag)],o=[],c=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,f;while((f=c.exec(e))!==null)o.push(f[0]);let l=r;for(let d of s.server)l=l.replace(d.fullTag,"");for(let d of s.client)l=l.replace(d.fullTag,"");l=l.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let g="<!--__STX_PAGE_SLOT__-->";if(l=l.replace(/<slot\s*\/>/gi,g).replace(/<slot\s*>\s*<\/slot>/gi,g),!l.includes(g))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:m,extractVariables:S,defaultConfig:b,loadStxConfig:w}=await import("./chunk-1sbj8yqe.js"),y=await w(),p={__filename:t,__dirname:E.dirname(t)};for(let d of a){let C=d.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!d.includes("client")&&!d.includes('type="module"'))await S(C[1],p,t)}let R=await m(l,p,t,{...b,...y,...n},new Set),h=R.indexOf(g);if(h===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:R.substring(0,h),afterSlot:R.substring(h+g.length),filePath:t,shellScripts:a,shellStyles:o}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function qn(t,n,e){let r,i="",s=n.match(K);if(s){n=n.replace(s[0],"");try{let l=Buffer.from(s[1],"base64").toString("utf8"),g=l.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(g)r=g[1].trim();i=l.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let a=e||r||"stx App",o=Y(),c="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -27,5 +27,5 @@ ${o}
27
27
  `));if(i.length>0)y.push(i.filter((p)=>!c.has(p)).join(`
28
28
  `));if(S.length>0)y.push(S.filter((p)=>!c.has(p)).join(`
29
29
  `));return y.push(m),y.join(`
30
- `)}import k from"fs";import D from"path";function To(t,n,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:n,outputDir:e}}function $o(t,n){let e=D.join(n,"manifest.json");k.writeFileSync(e,JSON.stringify(t,null,2))}function Ro(t){let n=D.join(t,"manifest.json");if(!k.existsSync(n))return null;try{let e=k.readFileSync(n,"utf-8"),r=JSON.parse(e);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function _(t,n,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function Q(t){let n=t.headers.get("content-type")||"",e={},r=(i,s)=>{let a=e[i];if(a===void 0)e[i]=s;else if(Array.isArray(a))a.push(s);else e[i]=[a,s]};if(n.includes("multipart/form-data")){let i=await t.formData();for(let[s,a]of i.entries())if(typeof a==="string")r(s,a);return e}if(n.includes("application/x-www-form-urlencoded")){for(let[i,s]of new URLSearchParams(await t.text()).entries())r(i,s);return e}return e}function zr(t){if(!t)return!1;let n=t.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function F(t,n={}){let e=n.request,r=n.method??e?.method;if(!e||!zr(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await Q(e)}catch{}let s=await t.action({request:e,form:i,params:n.params??{},query:t.query??{},cookies:n.cookies??{}});if(s&&typeof s==="object"){let a=s,o=tt(a.cookies),c=a.redirect;if(typeof c==="string"&&c)return{redirect:c,ran:!0,...o.length>0?{cookies:o}:{}};let{cookies:f,redirect:l,...g}=a;if(Object.assign(t,g),o.length>0)return{ran:!0,cookies:o}}return{ran:!0}}function tt(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let n=[];for(let[e,r]of Object.entries(t)){if(!e)continue;if(typeof r==="string"){n.push(_(e,r));continue}if(r&&typeof r==="object"){let i=r;if(typeof i.value!=="string")continue;n.push(_(e,i.value,i))}}return n}function Ao(t,n=[],e){let r=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of n)r.append("Set-Cookie",i);for(let[i,s]of Object.entries(e??{}))if(i.toLowerCase()!=="location")r.set(i,s);return new Response(null,{status:303,headers:r})}async function Wt(t,n={}){let{html:e,context:r,redirect:i,cookies:s}=await et(t,n),a=Ke(r),o=Xe(r);if(i)return{html:e,redirect:i,cookies:s,status:a,headers:o};let{extractStreamBoundaries:c}=await import("./chunk-4zynysf7.js"),f=c(r),l=t.streamTemplates;if(l&&Object.keys(l).length>0){let{processDirectives:g}=await import("./chunk-dp3y2rzk.js"),{defaultConfig:m}=await import("./chunk-evzxtxk3.js"),S=r.streamBoundaries||{},b={...m,autoShell:!1},w=Object.keys(l).map((p)=>({id:p,render:async()=>{let R=typeof S[p]==="function"?await S[p]():void 0;return g(l[p],{...r,$boundary:R},t.sourceFile,b,new Set)}})),y=new Set(w.map((p)=>p.id));f=[...(f||[]).filter((p)=>!y.has(p.id)),...w]}return{html:e,boundaries:f&&f.length>0?f:void 0,cookies:s,status:a,headers:o}}async function et(t,n){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...n};if(!t.hasServerScripts&&!ms(t.html))return{html:t.html,context:e};for(let a of t.serverScriptContent)try{await u(a,e,t.sourceFile)}catch(o){if(n.__stx_strict_hydration)throw o;console.warn(`[stx] Server script error in ${t.sourceFile}:`,o)}let r=await F(e,{request:n.request,method:n.method,params:n.params??{},cookies:n.cookies??{}}),i=(a)=>{let o=a.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),c=cr(e);if(!c)return o;let f=o.indexOf("</head>");return f<0?c+o:o.slice(0,f)+c+o.slice(f)};if(r.redirect)return{html:t.html,context:e,redirect:r.redirect,cookies:r.cookies};if(!ms(t.html))return{html:i(t.html),context:e,cookies:r.cookies};let s=new Map;for(let[a,o]of Object.entries(t.placeholders))if(o.expression)try{let c=x(o.expression,e);if(o.type==="raw")s.set(a,c!==void 0&&c!==null?String(c):"");else s.set(a,c!==void 0&&c!==null?It(String(c)):"")}catch(c){if(n.__stx_strict_hydration)throw c;s.set(a,"")}return{html:i(li(t.html,s)),context:e,cookies:r.cookies}}
30
+ `)}import k from"fs";import D from"path";function To(t,n,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:n,outputDir:e}}function $o(t,n){let e=D.join(n,"manifest.json");k.writeFileSync(e,JSON.stringify(t,null,2))}function Ro(t){let n=D.join(t,"manifest.json");if(!k.existsSync(n))return null;try{let e=k.readFileSync(n,"utf-8"),r=JSON.parse(e);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function _(t,n,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function Q(t){let n=t.headers.get("content-type")||"",e={},r=(i,s)=>{let a=e[i];if(a===void 0)e[i]=s;else if(Array.isArray(a))a.push(s);else e[i]=[a,s]};if(n.includes("multipart/form-data")){let i=await t.formData();for(let[s,a]of i.entries())if(typeof a==="string")r(s,a);return e}if(n.includes("application/x-www-form-urlencoded")){for(let[i,s]of new URLSearchParams(await t.text()).entries())r(i,s);return e}return e}function zr(t){if(!t)return!1;let n=t.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function F(t,n={}){let e=n.request,r=n.method??e?.method;if(!e||!zr(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await Q(e)}catch{}let s=await t.action({request:e,form:i,params:n.params??{},query:t.query??{},cookies:n.cookies??{}});if(s&&typeof s==="object"){let a=s,o=tt(a.cookies),c=a.redirect;if(typeof c==="string"&&c)return{redirect:c,ran:!0,...o.length>0?{cookies:o}:{}};let{cookies:f,redirect:l,...g}=a;if(Object.assign(t,g),o.length>0)return{ran:!0,cookies:o}}return{ran:!0}}function tt(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let n=[];for(let[e,r]of Object.entries(t)){if(!e)continue;if(typeof r==="string"){n.push(_(e,r));continue}if(r&&typeof r==="object"){let i=r;if(typeof i.value!=="string")continue;n.push(_(e,i.value,i))}}return n}function Ao(t,n=[],e){let r=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of n)r.append("Set-Cookie",i);for(let[i,s]of Object.entries(e??{}))if(i.toLowerCase()!=="location")r.set(i,s);return new Response(null,{status:303,headers:r})}async function Wt(t,n={}){let{html:e,context:r,redirect:i,cookies:s}=await et(t,n),a=Ke(r),o=Xe(r);if(i)return{html:e,redirect:i,cookies:s,status:a,headers:o};let{extractStreamBoundaries:c}=await import("./chunk-djqmzzn6.js"),f=c(r),l=t.streamTemplates;if(l&&Object.keys(l).length>0){let{processDirectives:g}=await import("./chunk-38mt99p3.js"),{defaultConfig:m}=await import("./chunk-zg0pnh4w.js"),S=r.streamBoundaries||{},b={...m,autoShell:!1},w=Object.keys(l).map((p)=>({id:p,render:async()=>{let R=typeof S[p]==="function"?await S[p]():void 0;return g(l[p],{...r,$boundary:R},t.sourceFile,b,new Set)}})),y=new Set(w.map((p)=>p.id));f=[...(f||[]).filter((p)=>!y.has(p.id)),...w]}return{html:e,boundaries:f&&f.length>0?f:void 0,cookies:s,status:a,headers:o}}async function et(t,n){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...n};if(!t.hasServerScripts&&!ms(t.html))return{html:t.html,context:e};for(let a of t.serverScriptContent)try{await u(a,e,t.sourceFile)}catch(o){if(n.__stx_strict_hydration)throw o;console.warn(`[stx] Server script error in ${t.sourceFile}:`,o)}let r=await F(e,{request:n.request,method:n.method,params:n.params??{},cookies:n.cookies??{}}),i=(a)=>{let o=a.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),c=cr(e);if(!c)return o;let f=o.indexOf("</head>");return f<0?c+o:o.slice(0,f)+c+o.slice(f)};if(r.redirect)return{html:t.html,context:e,redirect:r.redirect,cookies:r.cookies};if(!ms(t.html))return{html:i(t.html),context:e,cookies:r.cookies};let s=new Map;for(let[a,o]of Object.entries(t.placeholders))if(o.expression)try{let c=x(o.expression,e);if(o.type==="raw")s.set(a,c!==void 0&&c!==null?String(c):"");else s.set(a,c!==void 0&&c!==null?It(String(c)):"")}catch(c){if(n.__stx_strict_hydration)throw c;s.set(a,"")}return{html:i(li(t.html,s)),context:e,cookies:r.cookies}}
31
31
  export{ko,Le,Co,oe,T,_o,Fr,qn,ve,Eo,ie,To,$o,Ro,zr,Ao,Wt};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{X,n}from"./chunk-cqpa9t8d.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let r=u[t[0]];console.log(`
2
+ import{X,n}from"./chunk-j0z7010x.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let r=u[t[0]];console.log(`
3
3
  ${e.bold}${t[0]}${e.reset} - ${r.description}`),console.log(` Usage: ${e.cyan}${r.usage}${e.reset}
4
4
  `)}else{console.log(`
5
5
  ${e.bold}Available Commands:${e.reset}
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{id,di,ad,pi,Ec,Tc,Dt,wn,cd,$c,Rc,ld,f}from"./chunk-cqpa9t8d.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-6xw8e915.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-nfht2ryp.js";import"./chunk-82bttwqm.js";export{Dt as buildCss,$c as extractClassNames,Tc as fingerprintConfig,Rc as generateCss,cd as getCachedCSS,id as getCssServeAsset,f as injectCss,di as loadCssEngine,pi as loadCssEngineConfig,wn as rebuildCss,ad as resetCssCache,Ec as resolveUserCssConfig,ld as withLinkedModuleBundles};
2
+ import{id,di,ad,pi,Ec,Tc,Dt,wn,cd,$c,Rc,ld,f}from"./chunk-j0z7010x.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-jczknjbw.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-nfht2ryp.js";import"./chunk-82bttwqm.js";export{Dt as buildCss,$c as extractClassNames,Tc as fingerprintConfig,Rc as generateCss,cd as getCachedCSS,id as getCssServeAsset,f as injectCss,di as loadCssEngine,pi as loadCssEngineConfig,wn as rebuildCss,ad as resetCssCache,Ec as resolveUserCssConfig,ld as withLinkedModuleBundles};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{fn,ue}from"./chunk-tds3d65g.js";import{m,gn,w,Ue,o,P}from"./chunk-cqpa9t8d.js";import{us}from"./chunk-7p24w8s7.js";import{s,Ee}from"./chunk-6eg9a3mt.js";import{a}from"./chunk-dgtxj56t.js";import h from"path";import v from"fs";import{AsyncLocalStorage as fe}from"async_hooks";var me=10;function J(e,n,r){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(h.basename(e))||us(e,n,r)}var re=1,se=new Map,V=600,ge=100,W=new Map;async function he(e){let n=W.get(e)??0;if(n>0&&n<ge){W.set(e,n+1);return}W.set(e,1);try{let r=(await v.promises.readdir(e)).filter((c)=>c.endsWith(".js"));if(r.length<=V)return;let p=(await Promise.all(r.map(async(c)=>{try{return{name:c,at:(await v.promises.stat(h.join(e,c))).mtimeMs}}catch{return null}}))).filter((c)=>c!==null);p.sort((c,l)=>l.at-c.at);for(let c of p.slice(V)){let l=c.name.slice(0,-3);await v.promises.rm(h.join(e,`${l}.js`),{force:!0}),await v.promises.rm(h.join(e,`${l}.deps.json`),{force:!0})}D("pruned bundle cache to",V,"entries")}catch{}}function le(e){return se.get(e)??[]}function X(e,n){if(e)se.set(e,n)}function uc(e=process.env){return e.STX_DEBUG==="true"||e.STX_DEBUG==="1"}function D(...e){if(uc())console.log("[stx:bundler]",...e)}var Z=[];function ri(e,n,r){Z.push({filePath:e||"<inline>",message:n,details:r})}function kt(){return Z.slice()}function Ct(){Z.length=0}var H;function Wu(e){H=e}function si(){if(H)return H;try{let e=P.strict;return typeof e==="object"&&e!==null?e.bundlerFallback??"warn":"warn"}catch{return"warn"}}var q=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function _t(e){let n=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,r;while((r=n.exec(e))!==null){let p=r[1];if(!q.some((l)=>l.test(p)))return D("detected user import:",p),!0}let u=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((r=u.exec(e))!==null){let p=r[1];if(/\.css(?:\?.*)?$/.test(p))continue;if(!q.some((l)=>l.test(p)))return D("detected side-effect import:",p),!0}return!1}var pn="stx-module:",xe=/\.(?:[cm]?[jt]sx?|json)$/i;function dc(e,n){return h.relative(e,n).split(h.sep).join("/")}function pc(e,n){if(n.size===0)return e;return e.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(r,u,p,c)=>{let l=n.get(c);return l&&!c.startsWith(pn)?`${u}${p}${l}${p}`:r})}function fc(e,n){let r=0,u=(c)=>{let l=`__stxMod${r++}`,E=JSON.stringify(c);return n.push(`var ${l} = globalThis.__stxModules && globalThis.__stxModules[${E}];`,`if (${l} === undefined) throw new Error("[stx] module " + ${JSON.stringify(E)} + " is not registered on this page (#1957)");`),l},p=(c,l)=>{for(let E of c.split(",")){let _=E.trim();if(!_)continue;let j=_.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!j)continue;let d=j[1].startsWith('"')?JSON.parse(j[1]):j[1],t=j[2]??d;n.push(`var ${t} = ${l}[${JSON.stringify(d)}];`)}};return e=e.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(c,l,E)=>{let _=E.slice(pn.length),j=u(_),d=l.trim(),t=d.match(/^([\w$]+)\s*(?:,\s*|$)/);if(t&&!d.startsWith("{")&&!d.startsWith("*"))n.push(`var ${t[1]} = ${j}.default;`),d=d.slice(t[0].length).trim();let i=d.match(/^\*\s*as\s+([\w$]+)$/);if(i)n.push(`var ${i[1]} = ${j};`);else if(d.startsWith("{"))p(d.replace(/^\{|\}$/g,""),j);return""}),e=e.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(c,l)=>(u(l.slice(pn.length)),"")),e}function te(e){let n=[e,`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.mjs`,`${e}.jsx`,h.join(e,"index.ts"),h.join(e,"index.tsx"),h.join(e,"index.js"),h.join(e,"index.mjs")];for(let r of n)try{if(v.existsSync(r)&&v.statSync(r,{throwIfNoEntry:!1})?.isFile())return r}catch{}return}var Y=new fe;function is(e,n){let r=new Bun.CryptoHasher("md5");for(let[u,p]of[...e].sort(([c],[l])=>c<l?-1:c>l?1:0))r.update(`${u}\x00${p}\x00`);return Y.run({modules:e,key:r.digest("hex").slice(0,12)},n)}function Et(){return Y.getStore()?.key??""}function $e(e,n,r,u,p,c=new Map,l,E){let _=(d,t,i)=>{if(J(t,e,l))return null;if(!p||d!==r||!xe.test(t))return null;try{if(!v.statSync(t,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}u.add(t);let x=`${pn}${dc(process.cwd(),t)}`;return c.set(i,x),{path:x,external:!0}},j=(d,t)=>{let i=d===r?n:h.dirname(d),x=h.resolve(i,t);return te(x)??x};return{name:"stx-client-bundle",setup(d){if(d.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(t)=>({path:t.path,external:!0})),d.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(t)=>({path:t.path,external:!0})),d.onResolve({filter:/^\//},(t)=>{let i=te(t.path);if(i){let x=_(t.importer,i,t.path);if(x)return x;if(i!==r)u.add(i);return{path:i}}return{path:t.path,external:!0}}),d.onResolve({filter:/^\.\.?\//},(t)=>{let i=j(t.importer,t.path),x=_(t.importer,i,t.path);if(x)return x;return u.add(i),{path:i}}),d.onResolve({filter:/^[@~]\//},(t)=>{let i=h.resolve(e,t.path.slice(2)),x=[i,`${i}.ts`,`${i}.tsx`,`${i}.js`,`${i}.mjs`,`${i}.jsx`,h.join(i,"index.ts"),h.join(i,"index.tsx"),h.join(i,"index.js"),h.join(i,"index.mjs")];for(let F of x)if(v.existsSync(F)&&v.statSync(F,{throwIfNoEntry:!1})?.isFile()){let B=_(t.importer,F,t.path);if(B)return B;return D(`resolved ${t.path[0]}/ import:`,t.path,"\u2192",F),u.add(F),{path:F}}return console.warn(`[stx:bundler] could not resolve ${t.path[0]}/ import:`,t.path),{path:i}}),p)d.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(t)=>{if(t.importer!==r)return;let i=`${pn}npm:${t.path}`;return c.set(t.path,i),{path:i,external:!0}});d.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(t)=>{if(J(t.path,e,l))throw Error(`Server-only API source cannot be imported by a client script: ${t.path}`);let i=h.extname(t.path).toLowerCase(),x=i===".json"?"json":i===".tsx"?"tsx":i===".jsx"?"jsx":i===".ts"||i===".mts"||i===".cts"?"ts":"js";if(t.path!==r)u.add(t.path);let F=E?.get(t.path);if(F!==void 0)return{contents:F,loader:"js"};return{contents:v.readFileSync(t.path,"utf8"),loader:x}})}}}var G=new Map,k=m(64),ne=Symbol.for("stx.client-bundle-build-queue");function gc(e){let n=globalThis,u=(n[ne]??Promise.resolve()).then(e,e);return n[ne]=u.then(()=>{return},()=>{return}),u}async function Tt(e,n,r={}){let u=r.projectRoot||process.cwd(),p=(await o(u)).serverApi,c=r.minify??!1,l=r.externalizeUserModules??!0,E=r.expose?.length?[...new Set(r.expose)].sort():void 0,_=r.cacheDir||a(u,"bundle-cache"),j=Y.getStore(),d=new Bun.CryptoHasher("md5");d.update(`${me}\x00${Ue()}\x00${JSON.stringify(p??!1)}\x00${l?"registry":"inline"}\x00${E?E.join(","):"*"}\x00${c?"minified":"readable"}\x00${j?.key??""}\x00${e}\x00${n}`);let t=d.digest("hex").slice(0,12),i=h.join(_,`${t}.js`),x=k.get(i);if(x){if(gn(x.files)&&x.files.every((M)=>!J(M.path,u,p))){D("memo hit:",t);let M=x.files.map((A)=>A.path);return X(n,M),r.collectInputs?.push(...M),x.code}k.delete(i),D("memo invalidated by dep change:",t)}let F=h.join(_,`${t}.deps.json`),B=Bun.file(i);if(await B.exists()){let M=Bun.file(F),A=!1,N=null;if(await M.exists())try{let I=JSON.parse(await M.text());if(I.metadataVersion!==re||!Array.isArray(I.files))A=!1;else N=I.files,A=!0;if(N&&(!gn(N)||N.some((g)=>J(g.path,u,p))))A=!1}catch{A=!1}if(A){if(D("cache hit:",t),N)X(n,N.map((g)=>g.path)),r.collectInputs?.push(...N.map((g)=>g.path));let I=await B.text();if(N)k.set(i,{code:I,files:N});return I}D("cache invalidated by dep change:",t)}let U=G.get(t);if(U){let M=await U;if(r.collectInputs)r.collectInputs.push(...(k.get(i)?.files??[]).map((A)=>A.path));return M}let L=gc(()=>be(e,n,{projectRoot:u,minify:c,cacheDir:_,hash:t,cachePath:i,depsPath:F,collectInputs:r.collectInputs,externalizeUserModules:l,serverApi:p,expose:E,throwOnFailure:r.throwOnFailure,substitutes:j?.modules}));G.set(t,L);try{return await L}finally{G.delete(t)}}var ye=0;function mc(e){return`${e}-${process.pid}-${++ye}`}async function be(e,n,r){let{projectRoot:u,minify:p,cacheDir:c,hash:l,cachePath:E,depsPath:_,externalizeUserModules:j}=r,d=a(u,"bundle-tmp"),t=mc(l),i=h.join(d,`${t}.ts`),x=h.join(d,"out",t);v.mkdirSync(d,{recursive:!0}),v.mkdirSync(x,{recursive:!0});let F=h.dirname(n),B=new Set,U=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,L=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,M=s(e),{depths:A,balanced:N}=Ee(M),I=(S)=>!N||A[S]===0,g;while((g=U.exec(M))!==null){if(g[1])continue;if(!I(g.index))continue;if(g[2])g[2].split(",").forEach((S)=>{let f=we(S);if(f)B.add(f)});else if(g[3])B.add(g[3])}while((g=L.exec(M))!==null){if(g[1])continue;if(!I(g.index))continue;B.add(g[2])}let ie=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=ie.exec(M))!==null){if(!I(g.index))continue;let S=/^\s*['"]([^'"]+)['"]/.exec(e.slice(g.index+g[0].length))?.[1];if(S&&q.some((f)=>f.test(S)))continue;if(g[1])B.add(g[1]);if(g[2])B.add(g[2]);for(let f of(g[3]??"").split(",")){let b=f.trim();if(!b||/^type\s/.test(b))continue;let T=/\bas\s+(\w+)\s*$/.exec(b)?.[1]??/^\w+$/.exec(b)?.[0];if(T)B.add(T)}}for(let S of M.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let f of S[1].split(",")){let b=/\bas\s+(\w+)\s*$/.exec(f)?.[1]??/^\s*(\w+)\s*$/.exec(f)?.[1];if(b)B.delete(b)}let oe=B.size>0?`
2
+ import{fn,ue}from"./chunk-tds3d65g.js";import{m,gn,w,Ue,o,P}from"./chunk-j0z7010x.js";import{us}from"./chunk-jmczvhpy.js";import{s,Ee}from"./chunk-6eg9a3mt.js";import{a}from"./chunk-dgtxj56t.js";import h from"path";import v from"fs";import{AsyncLocalStorage as fe}from"async_hooks";var me=10;function J(e,n,r){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(h.basename(e))||us(e,n,r)}var re=1,se=new Map,V=600,ge=100,W=new Map;async function he(e){let n=W.get(e)??0;if(n>0&&n<ge){W.set(e,n+1);return}W.set(e,1);try{let r=(await v.promises.readdir(e)).filter((c)=>c.endsWith(".js"));if(r.length<=V)return;let p=(await Promise.all(r.map(async(c)=>{try{return{name:c,at:(await v.promises.stat(h.join(e,c))).mtimeMs}}catch{return null}}))).filter((c)=>c!==null);p.sort((c,l)=>l.at-c.at);for(let c of p.slice(V)){let l=c.name.slice(0,-3);await v.promises.rm(h.join(e,`${l}.js`),{force:!0}),await v.promises.rm(h.join(e,`${l}.deps.json`),{force:!0})}D("pruned bundle cache to",V,"entries")}catch{}}function le(e){return se.get(e)??[]}function X(e,n){if(e)se.set(e,n)}function uc(e=process.env){return e.STX_DEBUG==="true"||e.STX_DEBUG==="1"}function D(...e){if(uc())console.log("[stx:bundler]",...e)}var Z=[];function ri(e,n,r){Z.push({filePath:e||"<inline>",message:n,details:r})}function kt(){return Z.slice()}function Ct(){Z.length=0}var H;function Wu(e){H=e}function si(){if(H)return H;try{let e=P.strict;return typeof e==="object"&&e!==null?e.bundlerFallback??"warn":"warn"}catch{return"warn"}}var q=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function _t(e){let n=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,r;while((r=n.exec(e))!==null){let p=r[1];if(!q.some((l)=>l.test(p)))return D("detected user import:",p),!0}let u=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((r=u.exec(e))!==null){let p=r[1];if(/\.css(?:\?.*)?$/.test(p))continue;if(!q.some((l)=>l.test(p)))return D("detected side-effect import:",p),!0}return!1}var pn="stx-module:",xe=/\.(?:[cm]?[jt]sx?|json)$/i;function dc(e,n){return h.relative(e,n).split(h.sep).join("/")}function pc(e,n){if(n.size===0)return e;return e.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(r,u,p,c)=>{let l=n.get(c);return l&&!c.startsWith(pn)?`${u}${p}${l}${p}`:r})}function fc(e,n){let r=0,u=(c)=>{let l=`__stxMod${r++}`,E=JSON.stringify(c);return n.push(`var ${l} = globalThis.__stxModules && globalThis.__stxModules[${E}];`,`if (${l} === undefined) throw new Error("[stx] module " + ${JSON.stringify(E)} + " is not registered on this page (#1957)");`),l},p=(c,l)=>{for(let E of c.split(",")){let _=E.trim();if(!_)continue;let j=_.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!j)continue;let d=j[1].startsWith('"')?JSON.parse(j[1]):j[1],t=j[2]??d;n.push(`var ${t} = ${l}[${JSON.stringify(d)}];`)}};return e=e.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(c,l,E)=>{let _=E.slice(pn.length),j=u(_),d=l.trim(),t=d.match(/^([\w$]+)\s*(?:,\s*|$)/);if(t&&!d.startsWith("{")&&!d.startsWith("*"))n.push(`var ${t[1]} = ${j}.default;`),d=d.slice(t[0].length).trim();let i=d.match(/^\*\s*as\s+([\w$]+)$/);if(i)n.push(`var ${i[1]} = ${j};`);else if(d.startsWith("{"))p(d.replace(/^\{|\}$/g,""),j);return""}),e=e.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(c,l)=>(u(l.slice(pn.length)),"")),e}function te(e){let n=[e,`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.mjs`,`${e}.jsx`,h.join(e,"index.ts"),h.join(e,"index.tsx"),h.join(e,"index.js"),h.join(e,"index.mjs")];for(let r of n)try{if(v.existsSync(r)&&v.statSync(r,{throwIfNoEntry:!1})?.isFile())return r}catch{}return}var Y=new fe;function is(e,n){let r=new Bun.CryptoHasher("md5");for(let[u,p]of[...e].sort(([c],[l])=>c<l?-1:c>l?1:0))r.update(`${u}\x00${p}\x00`);return Y.run({modules:e,key:r.digest("hex").slice(0,12)},n)}function Et(){return Y.getStore()?.key??""}function $e(e,n,r,u,p,c=new Map,l,E){let _=(d,t,i)=>{if(J(t,e,l))return null;if(!p||d!==r||!xe.test(t))return null;try{if(!v.statSync(t,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}u.add(t);let x=`${pn}${dc(process.cwd(),t)}`;return c.set(i,x),{path:x,external:!0}},j=(d,t)=>{let i=d===r?n:h.dirname(d),x=h.resolve(i,t);return te(x)??x};return{name:"stx-client-bundle",setup(d){if(d.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(t)=>({path:t.path,external:!0})),d.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(t)=>({path:t.path,external:!0})),d.onResolve({filter:/^\//},(t)=>{let i=te(t.path);if(i){let x=_(t.importer,i,t.path);if(x)return x;if(i!==r)u.add(i);return{path:i}}return{path:t.path,external:!0}}),d.onResolve({filter:/^\.\.?\//},(t)=>{let i=j(t.importer,t.path),x=_(t.importer,i,t.path);if(x)return x;return u.add(i),{path:i}}),d.onResolve({filter:/^[@~]\//},(t)=>{let i=h.resolve(e,t.path.slice(2)),x=[i,`${i}.ts`,`${i}.tsx`,`${i}.js`,`${i}.mjs`,`${i}.jsx`,h.join(i,"index.ts"),h.join(i,"index.tsx"),h.join(i,"index.js"),h.join(i,"index.mjs")];for(let F of x)if(v.existsSync(F)&&v.statSync(F,{throwIfNoEntry:!1})?.isFile()){let B=_(t.importer,F,t.path);if(B)return B;return D(`resolved ${t.path[0]}/ import:`,t.path,"\u2192",F),u.add(F),{path:F}}return console.warn(`[stx:bundler] could not resolve ${t.path[0]}/ import:`,t.path),{path:i}}),p)d.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(t)=>{if(t.importer!==r)return;let i=`${pn}npm:${t.path}`;return c.set(t.path,i),{path:i,external:!0}});d.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(t)=>{if(J(t.path,e,l))throw Error(`Server-only API source cannot be imported by a client script: ${t.path}`);let i=h.extname(t.path).toLowerCase(),x=i===".json"?"json":i===".tsx"?"tsx":i===".jsx"?"jsx":i===".ts"||i===".mts"||i===".cts"?"ts":"js";if(t.path!==r)u.add(t.path);let F=E?.get(t.path);if(F!==void 0)return{contents:F,loader:"js"};return{contents:v.readFileSync(t.path,"utf8"),loader:x}})}}}var G=new Map,k=m(64),ne=Symbol.for("stx.client-bundle-build-queue");function gc(e){let n=globalThis,u=(n[ne]??Promise.resolve()).then(e,e);return n[ne]=u.then(()=>{return},()=>{return}),u}async function Tt(e,n,r={}){let u=r.projectRoot||process.cwd(),p=(await o(u)).serverApi,c=r.minify??!1,l=r.externalizeUserModules??!0,E=r.expose?.length?[...new Set(r.expose)].sort():void 0,_=r.cacheDir||a(u,"bundle-cache"),j=Y.getStore(),d=new Bun.CryptoHasher("md5");d.update(`${me}\x00${Ue()}\x00${JSON.stringify(p??!1)}\x00${l?"registry":"inline"}\x00${E?E.join(","):"*"}\x00${c?"minified":"readable"}\x00${j?.key??""}\x00${e}\x00${n}`);let t=d.digest("hex").slice(0,12),i=h.join(_,`${t}.js`),x=k.get(i);if(x){if(gn(x.files)&&x.files.every((M)=>!J(M.path,u,p))){D("memo hit:",t);let M=x.files.map((A)=>A.path);return X(n,M),r.collectInputs?.push(...M),x.code}k.delete(i),D("memo invalidated by dep change:",t)}let F=h.join(_,`${t}.deps.json`),B=Bun.file(i);if(await B.exists()){let M=Bun.file(F),A=!1,N=null;if(await M.exists())try{let I=JSON.parse(await M.text());if(I.metadataVersion!==re||!Array.isArray(I.files))A=!1;else N=I.files,A=!0;if(N&&(!gn(N)||N.some((g)=>J(g.path,u,p))))A=!1}catch{A=!1}if(A){if(D("cache hit:",t),N)X(n,N.map((g)=>g.path)),r.collectInputs?.push(...N.map((g)=>g.path));let I=await B.text();if(N)k.set(i,{code:I,files:N});return I}D("cache invalidated by dep change:",t)}let U=G.get(t);if(U){let M=await U;if(r.collectInputs)r.collectInputs.push(...(k.get(i)?.files??[]).map((A)=>A.path));return M}let L=gc(()=>be(e,n,{projectRoot:u,minify:c,cacheDir:_,hash:t,cachePath:i,depsPath:F,collectInputs:r.collectInputs,externalizeUserModules:l,serverApi:p,expose:E,throwOnFailure:r.throwOnFailure,substitutes:j?.modules}));G.set(t,L);try{return await L}finally{G.delete(t)}}var ye=0;function mc(e){return`${e}-${process.pid}-${++ye}`}async function be(e,n,r){let{projectRoot:u,minify:p,cacheDir:c,hash:l,cachePath:E,depsPath:_,externalizeUserModules:j}=r,d=a(u,"bundle-tmp"),t=mc(l),i=h.join(d,`${t}.ts`),x=h.join(d,"out",t);v.mkdirSync(d,{recursive:!0}),v.mkdirSync(x,{recursive:!0});let F=h.dirname(n),B=new Set,U=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,L=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,M=s(e),{depths:A,balanced:N}=Ee(M),I=(S)=>!N||A[S]===0,g;while((g=U.exec(M))!==null){if(g[1])continue;if(!I(g.index))continue;if(g[2])g[2].split(",").forEach((S)=>{let f=we(S);if(f)B.add(f)});else if(g[3])B.add(g[3])}while((g=L.exec(M))!==null){if(g[1])continue;if(!I(g.index))continue;B.add(g[2])}let ie=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=ie.exec(M))!==null){if(!I(g.index))continue;let S=/^\s*['"]([^'"]+)['"]/.exec(e.slice(g.index+g[0].length))?.[1];if(S&&q.some((f)=>f.test(S)))continue;if(g[1])B.add(g[1]);if(g[2])B.add(g[2]);for(let f of(g[3]??"").split(",")){let b=f.trim();if(!b||/^type\s/.test(b))continue;let T=/\bas\s+(\w+)\s*$/.exec(b)?.[1]??/^\w+$/.exec(b)?.[0];if(T)B.add(T)}}for(let S of M.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let f of S[1].split(",")){let b=/\bas\s+(\w+)\s*$/.exec(f)?.[1]??/^\s*(\w+)\s*$/.exec(f)?.[1];if(b)B.delete(b)}let oe=B.size>0?`
3
3
  export { ${[...B].join(", ")} }`:"";await Bun.write(i,e+oe),D("bundling:",l,"from:",h.basename(n));let Q=new Set,K=new Map;try{let S=await Bun.build({entrypoints:[i],outdir:x,target:"browser",format:"esm",minify:p?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[$e(u,F,i,Q,j,K,r.serverApi,r.substitutes)],define:{"process.env.NODE_ENV":p?'"production"':'"development"',...w()},root:u});if(!S.success){let R=S.logs.filter((O)=>O.level==="error").map((O)=>O.message).join(", ")||`Unable to bundle ${h.basename(n)}`,C=fn(S.logs,n||void 0);if(console.warn("[stx:bundler] build failed:",R),ri(n||"",R,C),r.throwOnFailure||si()==="error")throw Error(R);return e}let f="";for(let y of S.outputs){f=await y.text();break}let b=[];for(let y of f.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let R of y[1].split(",")){let C=R.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(C){b.push([C[2],C[1]]);continue}let O=R.trim();if(/^[A-Za-z_$][\w$]*$/.test(O))b.push([O,O])}if(r.expose){let y=new Set(r.expose);for(let R=b.length-1;R>=0;R--)if(!y.has(b[R][0]))b.splice(R,1)}let T=[];f=fc(pc(f,K),T);let ae=f.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(f=f.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),p&&f)try{f=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(f)}catch{}let ee=`__stxBundle_${l}`,ce=b.map(([y,R])=>`${JSON.stringify(y)}: ${R}`).join(", "),de=b.map(([y])=>`var ${y} = undefined;`).join(`
4
4
  `),pe=b.map(([y])=>`${y} = ${ee}[${JSON.stringify(y)}];`).join(`
5
5
  `);if(f=`${ae.join(`
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{b,u,n,g,A}from"./chunk-cqpa9t8d.js";import k from"path";var q={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var M=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function H(e){let t=[],o=0,s;M.lastIndex=0;while((s=M.exec(e))!==null){if(s.index>o){let a=e.slice(o,s.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=s[1],i=s[2];t.push({type:"suspense",name:r,content:i}),o=s.index+s[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function Tu(e,t={},o={}){let s={...A,...o,streaming:{...q,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:k.dirname(e)};if(m.trim())await u(m,y,e);let E=H(c),l=new Set;if(!E.some((h)=>h.type==="suspense")){let h=s.streaming?.strategy||"auto",S=new RegExp(T.source,"g");if(!(h!=="manual"&&S.test(c))){let p=await n(c,y,e,s,l);for(let x=0;x<p.length;x+=r)i.enqueue(p.slice(x,x+r)),await new Promise((f)=>setTimeout(f,0))}else{let p=[],x=new RegExp(T.source,"g"),f;while((f=x.exec(c))!==null)p.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let v=0;for(let _ of p){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let O=await n(I,y,e,s,l);i.enqueue(O),await new Promise((D)=>setTimeout(D,0))}}let C=await n(_.content,y,e,s,l);i.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await n(_,y,e,s,l);i.enqueue(C)}}}}else{let h=new Map;for(let d of E)if(d.type==="shell"||d.type==="content"){let p=await n(d.content,y,e,s,l);i.enqueue(p)}else if(d.type==="suspense"&&d.name){let p=`stx-suspense-${d.name}`;i.enqueue(`<div id="${p}" data-suspense="${d.name}" style="display:contents;">
2
+ import{b,u,n,g,A}from"./chunk-j0z7010x.js";import k from"path";var q={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var M=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function H(e){let t=[],o=0,s;M.lastIndex=0;while((s=M.exec(e))!==null){if(s.index>o){let a=e.slice(o,s.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=s[1],i=s[2];t.push({type:"suspense",name:r,content:i}),o=s.index+s[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function Tu(e,t={},o={}){let s={...A,...o,streaming:{...q,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:k.dirname(e)};if(m.trim())await u(m,y,e);let E=H(c),l=new Set;if(!E.some((h)=>h.type==="suspense")){let h=s.streaming?.strategy||"auto",S=new RegExp(T.source,"g");if(!(h!=="manual"&&S.test(c))){let p=await n(c,y,e,s,l);for(let x=0;x<p.length;x+=r)i.enqueue(p.slice(x,x+r)),await new Promise((f)=>setTimeout(f,0))}else{let p=[],x=new RegExp(T.source,"g"),f;while((f=x.exec(c))!==null)p.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let v=0;for(let _ of p){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let O=await n(I,y,e,s,l);i.enqueue(O),await new Promise((D)=>setTimeout(D,0))}}let C=await n(_.content,y,e,s,l);i.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await n(_,y,e,s,l);i.enqueue(C)}}}}else{let h=new Map;for(let d of E)if(d.type==="shell"||d.type==="content"){let p=await n(d.content,y,e,s,l);i.enqueue(p)}else if(d.type==="suspense"&&d.name){let p=`stx-suspense-${d.name}`;i.enqueue(`<div id="${p}" data-suspense="${d.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
4
  </div>`),h.set(d.name,n(d.content,y,e,s,l))}i.enqueue(`
5
5
  <script>
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{xn,Pc,ks}from"./chunk-cqpa9t8d.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-6xw8e915.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import{Re}from"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-nfht2ryp.js";import"./chunk-82bttwqm.js";export{Re as freeIdentifiers,ks as processComponents,Pc as processESImports,xn as rendersAsElement};
2
+ import{xn,Pc,ks}from"./chunk-j0z7010x.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-jczknjbw.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import{Re}from"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-nfht2ryp.js";import"./chunk-82bttwqm.js";export{Re as freeIdentifiers,ks as processComponents,Pc as processESImports,xn as rendersAsElement};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ys,bs,vs,ud,or,dd}from"./chunk-cqpa9t8d.js";export{or as clearImageDeliveryCatalog,ud as deliveredImage,vs as efficientDeliverySources,ys as getImageDelivery,bs as isTransparentImage,dd as prepareImageDelivery};
2
+ import{ys,bs,vs,ud,or,dd}from"./chunk-j0z7010x.js";export{or as clearImageDeliveryCatalog,ud as deliveredImage,vs as efficientDeliverySources,ys as getImageDelivery,bs as isTransparentImage,dd as prepareImageDelivery};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Mt,Nc,Mc,Lc,jc,Bc,u,Fc,$s,zc,_i,Ei}from"./chunk-cqpa9t8d.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-6xw8e915.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-nfht2ryp.js";import"./chunk-82bttwqm.js";export{Mt as STX_ENGINE_BINDING_NAMES,$s as convertToCommonJS,_i as extractScriptFromTemplate,u as extractVariables,Ei as hasVariables,Fc as isCompleteImport,Bc as isMissingBindingFailure,Lc as isModuleResolutionFailure,jc as isSyntaxFailure,zc as splitDeclaration,Nc as stripTypeScript,Mc as withoutStxReferrer};
2
+ import{Mt,Nc,Mc,Lc,jc,Bc,u,Fc,$s,zc,_i,Ei}from"./chunk-j0z7010x.js";import"./chunk-t19th11m.js";import"./chunk-v8ze2q95.js";import"./chunk-k71e38fk.js";import"./chunk-jczknjbw.js";import"./chunk-48s1nprc.js";import"./chunk-qf39z0hg.js";import"./chunk-gh181dnr.js";import"./chunk-38mt83wa.js";import"./chunk-jtq8e3b0.js";import"./chunk-b3c1gggs.js";import"./chunk-nfht2ryp.js";import"./chunk-82bttwqm.js";export{Mt as STX_ENGINE_BINDING_NAMES,$s as convertToCommonJS,_i as extractScriptFromTemplate,u as extractVariables,Ei as hasVariables,Fc as isCompleteImport,Bc as isMissingBindingFailure,Lc as isModuleResolutionFailure,jc as isSyntaxFailure,zc as splitDeclaration,Nc as stripTypeScript,Mc as withoutStxReferrer};