@stacksjs/stx 0.2.296 → 0.2.299

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 (170) hide show
  1. package/dist/{chunk-nqwjb8k7.js → chunk-00mag1n0.js} +1 -1
  2. package/dist/chunk-0dz7yme0.js +2 -0
  3. package/dist/chunk-0hjsgddy.js +2 -0
  4. package/dist/{chunk-6z04mpxz.js → chunk-17389q0t.js} +22 -22
  5. package/dist/{chunk-85mzetge.js → chunk-18kcg747.js} +2 -2
  6. package/dist/chunk-1bn1wp3r.js +2 -0
  7. package/dist/chunk-1vzgt63y.js +2 -0
  8. package/dist/{chunk-xtwybxtw.js → chunk-1zvyq6jj.js} +1 -1
  9. package/dist/{chunk-c5rehxqy.js → chunk-1zyqv8p8.js} +1 -1
  10. package/dist/chunk-23jg0x9d.js +2 -0
  11. package/dist/{chunk-e3ta86aa.js → chunk-2d9yq3m4.js} +1 -1
  12. package/dist/chunk-2dsyd62p.js +2 -0
  13. package/dist/{chunk-mywp77gt.js → chunk-3bc8bqw2.js} +1 -1
  14. package/dist/{chunk-9616c6wn.js → chunk-3x05529h.js} +1 -1
  15. package/dist/{chunk-d3kac3mv.js → chunk-42b81qv3.js} +1 -1
  16. package/dist/chunk-4kzk4s3f.js +2 -0
  17. package/dist/{chunk-xc4b1ngp.js → chunk-4r5rpv5e.js} +1 -1
  18. package/dist/{chunk-jmh31a2a.js → chunk-54fnvfp1.js} +2 -2
  19. package/dist/{chunk-fz91fd99.js → chunk-5c8f2rt7.js} +2 -2
  20. package/dist/chunk-5fmpyxwr.js +2 -0
  21. package/dist/{chunk-8bxtvsgm.js → chunk-634gaa9d.js} +1 -1
  22. package/dist/{chunk-hmf9z4jx.js → chunk-683tfkz4.js} +1 -1
  23. package/dist/{chunk-vwqv8f0y.js → chunk-6bcw8twx.js} +1 -1
  24. package/dist/{chunk-k70fgb2f.js → chunk-6btbgxh1.js} +1 -1
  25. package/dist/{chunk-k78gvm0g.js → chunk-6rzwef28.js} +1 -1
  26. package/dist/chunk-6sz2hd8t.js +2 -0
  27. package/dist/{chunk-ynt7y2n5.js → chunk-6w8fa3b8.js} +1 -1
  28. package/dist/{chunk-3mbkn6vk.js → chunk-6xbscz34.js} +2 -2
  29. package/dist/{chunk-xtx53xyz.js → chunk-7eea1cse.js} +1 -1
  30. package/dist/{chunk-nmkra8q5.js → chunk-7eg7ep8f.js} +2 -2
  31. package/dist/{chunk-maq28582.js → chunk-7g37nv98.js} +2 -2
  32. package/dist/chunk-7v83gvj4.js +2 -0
  33. package/dist/{chunk-pb4jjbpq.js → chunk-7wh0eyz9.js} +3 -3
  34. package/dist/chunk-7xbk9755.js +2 -0
  35. package/dist/chunk-812p93m2.js +2 -0
  36. package/dist/{chunk-nnkz36zg.js → chunk-8jy8mt5m.js} +1 -1
  37. package/dist/{chunk-vqtbc3q4.js → chunk-8xzcfg5w.js} +2 -2
  38. package/dist/{chunk-efr3ejqt.js → chunk-91007tan.js} +1 -1
  39. package/dist/{chunk-24pgjzmy.js → chunk-9k5p10e4.js} +2 -2
  40. package/dist/{chunk-phrd5kxe.js → chunk-9vft4bjw.js} +1 -1
  41. package/dist/{chunk-5ey1fdjf.js → chunk-9vpabjdm.js} +1 -1
  42. package/dist/{chunk-2v69c72j.js → chunk-9xa9kvtr.js} +1 -1
  43. package/dist/{chunk-h625b8k6.js → chunk-b24h02ck.js} +2 -2
  44. package/dist/{chunk-dn8006f7.js → chunk-bkbr9yz2.js} +1 -1
  45. package/dist/{chunk-psraz70k.js → chunk-bt6mqvzy.js} +1 -1
  46. package/dist/chunk-c1jkpd5e.js +2 -0
  47. package/dist/chunk-cgw60tse.js +2 -0
  48. package/dist/{chunk-sptmr6wf.js → chunk-cp60r9ck.js} +1 -1
  49. package/dist/{chunk-4vpsvh6x.js → chunk-ctz53mbz.js} +1 -1
  50. package/dist/{chunk-nx96x8sh.js → chunk-d3r5pdz7.js} +1 -1
  51. package/dist/{chunk-mx93vwmq.js → chunk-ddrsx18x.js} +1 -1
  52. package/dist/{chunk-bc7emj22.js → chunk-dfnevxkj.js} +1 -1
  53. package/dist/chunk-dg5mhg7t.js +2 -0
  54. package/dist/chunk-fc7dc3f6.js +2 -0
  55. package/dist/{chunk-vqxpsd6r.js → chunk-ffetkbht.js} +1 -1
  56. package/dist/{chunk-9a1f6dz7.js → chunk-fj6fbqgb.js} +1 -1
  57. package/dist/{chunk-a84j7v61.js → chunk-fsq7492g.js} +1 -1
  58. package/dist/chunk-geyrsxc0.js +2 -0
  59. package/dist/{chunk-e2ymkgjk.js → chunk-gfrznj5v.js} +137 -137
  60. package/dist/{chunk-qzbwa5xe.js → chunk-gmfcddcw.js} +1 -1
  61. package/dist/{chunk-03mc9wc9.js → chunk-gn6m4f5p.js} +2 -2
  62. package/dist/chunk-h58zg4p4.js +2 -0
  63. package/dist/{chunk-8zyv8jf3.js → chunk-hqqas72x.js} +1 -1
  64. package/dist/{chunk-knz3zy2t.js → chunk-jbrdrxrc.js} +2 -2
  65. package/dist/{chunk-4yqnabzy.js → chunk-jk4bexrn.js} +1 -1
  66. package/dist/chunk-jv41s3xp.js +2 -0
  67. package/dist/{chunk-3jxt0y11.js → chunk-k4v9k7vj.js} +1 -1
  68. package/dist/chunk-k8j9bt64.js +2 -0
  69. package/dist/{chunk-k7mewajj.js → chunk-kpgvx2p1.js} +1 -1
  70. package/dist/chunk-ky8g0n1e.js +2 -0
  71. package/dist/chunk-m7dw0h4b.js +2 -0
  72. package/dist/{chunk-wvxce7p4.js → chunk-m8qcap5h.js} +2 -2
  73. package/dist/{chunk-kp8ec2f4.js → chunk-mq0vtxe6.js} +2 -2
  74. package/dist/{chunk-fdnbqt4r.js → chunk-mtbtnryk.js} +1 -1
  75. package/dist/{chunk-vrhp2xnm.js → chunk-mzbnczgk.js} +2 -2
  76. package/dist/{chunk-vg8yh8te.js → chunk-nn4k6hvv.js} +1 -1
  77. package/dist/{chunk-asn02v4q.js → chunk-p2aa1ak4.js} +2 -2
  78. package/dist/{chunk-ahdzc50z.js → chunk-peytnjme.js} +1 -1
  79. package/dist/{chunk-6tzzh1dg.js → chunk-pt902dd9.js} +1 -1
  80. package/dist/{chunk-8h9xqc3p.js → chunk-q0h9kdms.js} +1 -1
  81. package/dist/chunk-q1pqkc22.js +2 -0
  82. package/dist/{chunk-ahqn4s3t.js → chunk-q6xfyasj.js} +1 -1
  83. package/dist/{chunk-a668m28h.js → chunk-qg6pg6ze.js} +1 -1
  84. package/dist/{chunk-wb00aqm7.js → chunk-qga8gyr7.js} +1 -1
  85. package/dist/{chunk-mdd9yk4f.js → chunk-qx1zbx35.js} +1 -1
  86. package/dist/{chunk-0xtnepfj.js → chunk-qx7c8qnw.js} +1 -1
  87. package/dist/{chunk-224m1jrf.js → chunk-r19ajkwr.js} +3 -3
  88. package/dist/{chunk-29hfy1xw.js → chunk-rkz0rhx4.js} +1 -1
  89. package/dist/{chunk-qxmywwq5.js → chunk-rn2nsn9e.js} +2 -2
  90. package/dist/chunk-rxnxjw3d.js +2 -0
  91. package/dist/{chunk-3npkbgfm.js → chunk-s710wybv.js} +1 -1
  92. package/dist/{chunk-5t50pdtm.js → chunk-shem708r.js} +1 -1
  93. package/dist/{chunk-qfec1s34.js → chunk-snsb8nm6.js} +3 -3
  94. package/dist/chunk-sprn2n68.js +2 -0
  95. package/dist/{chunk-zwknasm0.js → chunk-sqqwas4j.js} +1 -1
  96. package/dist/chunk-syvg73q0.js +2 -0
  97. package/dist/{chunk-6sy85s25.js → chunk-tn1za8mt.js} +1 -1
  98. package/dist/chunk-trpmf02p.js +30 -0
  99. package/dist/{chunk-kgxkrnyt.js → chunk-v4vvm7mz.js} +1 -1
  100. package/dist/chunk-v54vyt8g.js +2 -0
  101. package/dist/chunk-v5jtjp8t.js +2 -0
  102. package/dist/{chunk-wvq1g6gr.js → chunk-v8474ah4.js} +1 -1
  103. package/dist/{chunk-hvqae2g1.js → chunk-vdzv694w.js} +1 -1
  104. package/dist/chunk-vk57tj7y.js +2 -0
  105. package/dist/chunk-vw5zxsc1.js +2 -0
  106. package/dist/{chunk-fed3xsp9.js → chunk-w8yac9xp.js} +1 -1
  107. package/dist/{chunk-2b9r38hs.js → chunk-wbq4srvy.js} +1 -1
  108. package/dist/{chunk-6tqbgd20.js → chunk-wdw9hb5y.js} +1 -1
  109. package/dist/{chunk-jem20v5k.js → chunk-weqpt9nt.js} +1 -1
  110. package/dist/{chunk-pfwhd5xs.js → chunk-x14vvxfh.js} +2 -2
  111. package/dist/{chunk-wyxw61az.js → chunk-x4prtyjs.js} +1 -1
  112. package/dist/chunk-xjnx0ms8.js +2 -0
  113. package/dist/{chunk-1ge7rfg4.js → chunk-y33hd9x7.js} +1 -1
  114. package/dist/{chunk-k0y7ta0d.js → chunk-y9nyqcha.js} +1 -1
  115. package/dist/chunk-yft2a2bf.js +2 -0
  116. package/dist/chunk-yjvd2p32.js +2 -0
  117. package/dist/{chunk-3rjeare9.js → chunk-ykgj5w4g.js} +2 -2
  118. package/dist/{chunk-bax52sn4.js → chunk-yq903p32.js} +2 -2
  119. package/dist/chunk-yvnx05f6.js +2 -0
  120. package/dist/{chunk-6kdb8j9d.js → chunk-ze3qgdaf.js} +1 -1
  121. package/dist/{chunk-6xsxkzhy.js → chunk-zqrh41k8.js} +1 -1
  122. package/dist/chunk-zv2hvn7r.js +2 -0
  123. package/dist/cli.js +14 -14
  124. package/dist/client-script-bundler.js +1 -1
  125. package/dist/craft-entry.js +1 -1
  126. package/dist/craft.js +1 -1
  127. package/dist/database.js +1 -1
  128. package/dist/dev-server/serve-app.js +2 -2
  129. package/dist/pwa.js +2 -2
  130. package/dist/spa-nav.d.ts +20 -0
  131. package/dist/spa-nav.js +12 -0
  132. package/dist/ssg.js +2 -2
  133. package/dist/visual-testing.js +1 -1
  134. package/package.json +5 -5
  135. package/dist/chunk-2a8q7c9z.js +0 -2
  136. package/dist/chunk-2enzjhrh.js +0 -2
  137. package/dist/chunk-31e2jrb4.js +0 -2
  138. package/dist/chunk-3fv1agwg.js +0 -2
  139. package/dist/chunk-3nmkjd4b.js +0 -2
  140. package/dist/chunk-44gm42cq.js +0 -2
  141. package/dist/chunk-76p7bnw1.js +0 -2
  142. package/dist/chunk-7mem81az.js +0 -2
  143. package/dist/chunk-7ncfmg13.js +0 -2
  144. package/dist/chunk-86cmtck2.js +0 -2
  145. package/dist/chunk-8tdj5zep.js +0 -2
  146. package/dist/chunk-a9c8w6fq.js +0 -2
  147. package/dist/chunk-b24chdr8.js +0 -2
  148. package/dist/chunk-cfx3vjh6.js +0 -2
  149. package/dist/chunk-e17ys98t.js +0 -2
  150. package/dist/chunk-f57xky9r.js +0 -2
  151. package/dist/chunk-f76qk302.js +0 -2
  152. package/dist/chunk-fqggvrwy.js +0 -2
  153. package/dist/chunk-fz52r2f7.js +0 -2
  154. package/dist/chunk-gbewds58.js +0 -2
  155. package/dist/chunk-gw431w90.js +0 -2
  156. package/dist/chunk-hfjhybrn.js +0 -2
  157. package/dist/chunk-k2f4jwez.js +0 -2
  158. package/dist/chunk-m38tpeke.js +0 -2
  159. package/dist/chunk-my8x4p73.js +0 -2
  160. package/dist/chunk-pb5s3vwg.js +0 -2
  161. package/dist/chunk-psbfqbkt.js +0 -2
  162. package/dist/chunk-pwyjrwrc.js +0 -2
  163. package/dist/chunk-q2dmpbqf.js +0 -2
  164. package/dist/chunk-sq24kkns.js +0 -2
  165. package/dist/chunk-tqtcs1wb.js +0 -2
  166. package/dist/chunk-tt50t72e.js +0 -30
  167. package/dist/chunk-vt31an48.js +0 -2
  168. package/dist/chunk-wrm7300v.js +0 -2
  169. package/dist/chunk-yzb748mw.js +0 -2
  170. package/dist/chunk-zafnsr0w.js +0 -2
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$u as J,Au as i,Bu as j,Cu as k,Du as l,Eu as m,Fu as n,Gu as o,Hu as p,Iu as q,Ju as r,Ku as s,Lu as t,Mu as u,Nu as v,Ou as w,Pu as x,Qu as y,Ru as z,Su as A,Tu as B,Uu as C,Vu as D,Wu as E,Xu as F,Yu as G,Zu as H,_u as I,bv as K,dv as L,su as a,tu as b,uu as c,vu as d,wu as e,xu as f,yu as g,zu as h}from"./chunk-jmh31a2a.js";import"./chunk-vwqv8f0y.js";L();export{o as setAppUrl,H as runMiddleware,r as route,j as resolveLayoutChain,s as resetRoutes,z as registerMiddleware,g as patternToRegex,t as navigateTo,h as matchRoute,E as loadMiddlewareFromDirectory,c as isNonPageRoutePattern,b as isNonPageRoutePath,B as hasMiddleware,K as getRouterScript,D as getMiddlewareNames,A as getMiddleware,d as generateRouteTypes,e as generateRouteManifest,n as formatRoutes,m as findErrorPage,f as filePathToPattern,J as extractLayoutMetadata,I as deriveLayoutGroup,q as defineRoutes,p as defineRoute,v as defineMiddleware,y as createStorageManager,w as createServerCookieManager,l as createRouter,F as createRouteLocation,G as createMiddlewareContext,x as createClientCookieManager,C as clearMiddleware,i as bracketPathToRegex,u as abortNavigation,k as Router,a as NON_PAGE_DIRS};
2
+ import{$u as I,Au as h,Bu as i,Cu as j,Du as k,Eu as l,Fu as m,Gu as n,Hu as o,Iu as p,Ju as q,Ku as r,Lu as s,Mu as t,Nu as u,Ou as v,Pu as w,Qu as x,Ru as y,Su as z,Tu as A,Uu as B,Vu as C,Wu as D,Xu as E,Yu as F,Zu as G,_u as H,av as J,cv as K,ev as L,tu as a,uu as b,vu as c,wu as d,xu as e,yu as f,zu as g}from"./chunk-54fnvfp1.js";import"./chunk-6bcw8twx.js";L();export{o as setAppUrl,H as runMiddleware,r as route,j as resolveLayoutChain,s as resetRoutes,z as registerMiddleware,g as patternToRegex,t as navigateTo,h as matchRoute,E as loadMiddlewareFromDirectory,c as isNonPageRoutePattern,b as isNonPageRoutePath,B as hasMiddleware,K as getRouterScript,D as getMiddlewareNames,A as getMiddleware,d as generateRouteTypes,e as generateRouteManifest,n as formatRoutes,m as findErrorPage,f as filePathToPattern,J as extractLayoutMetadata,I as deriveLayoutGroup,q as defineRoutes,p as defineRoute,v as defineMiddleware,y as createStorageManager,w as createServerCookieManager,l as createRouter,F as createRouteLocation,G as createMiddlewareContext,x as createClientCookieManager,C as clearMiddleware,i as bracketPathToRegex,u as abortNavigation,k as Router,a as NON_PAGE_DIRS};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Zp as M,bq as x}from"./chunk-6z04mpxz.js";import{jt as T}from"./chunk-qfec1s34.js";import{nv as N}from"./chunk-vwqv8f0y.js";import V from"fs";import Z from"path";var y=new Map,W=new Map;async function R(j){let z;for(let J=0;J<3;J++)try{let X=(await V.promises.stat(j)).mtime.getTime(),Q=W.get(j);if(Q&&Q.mtime===X)return Q.content;let Y=await Bun.file(j).text(),K=(await V.promises.stat(j)).mtime.getTime();if(K!==X)continue;return W.set(j,{content:Y,mtime:K}),Y}catch(I){z=I;break}throw W.delete(j),Error(`File not found: ${j}${z?` (${z.message})`:""}`)}function S(j){W.delete(j)}function _(j){for(let B of W.keys())if(B.startsWith(j))W.delete(B)}var q=null,w=null,G=null;function C(j){G=j}async function b(j=!1){let B=G??await import("./chunk-wb00aqm7.js");if(j)return B.generateSignalsRuntimeDev();if(q===null)q=B.generateSignalsRuntime();return q}var D=null;async function A(){if(D===null){let{getRouterScript:j}=await import("./chunk-qzbwa5xe.js");D=j()}return D}var L={};async function g(j,B=!1){let z=j==="runtime"?await b(B):await A(),J=j==="runtime"&&B?"runtime-debug":j,I=L[J];if(!I||I.content!==z)I={content:z,hash:Bun.hash(z).toString(16).padStart(16,"0").slice(0,16)},L[J]=I;return{content:z,hash:I.hash,url:`/_stx/${j}.${I.hash}.js`}}function u(){W.clear(),x(),T(),q=null,w=null,D=null}function O(j){let B={debug:j.debug===!0,middleware:(j.middleware??[]).map((z)=>({name:z.name,timing:z.timing,handler:String(z.handler)})),customDirectives:(j.customDirectives??[]).map((z)=>({name:z.name,hasEndTag:z.hasEndTag===!0,handler:String(z.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(B)).digest("hex")}async function P(j,B){try{if(!B.cachePath)return null;let z=Z.resolve(B.cachePath),J=Z.join(z,`${U(j)}.html`),I=Z.join(z,`${U(j)}.meta.json`);if(!await M(J)||!await M(I))return null;let X=await Bun.file(I).text(),Q=JSON.parse(X);if(Q.cacheVersion!==B.cacheVersion)return null;if(Q.optionsSignature!==O(B))return null;if((await V.promises.stat(j)).mtime.getTime()>Q.mtime)return null;for(let $ of Q.dependencies)if(await M($)){if((await V.promises.stat($)).mtime.getTime()>Q.mtime)return null}else return null;return await Bun.file(J).text()}catch(z){return console.warn(`Cache error for ${j}:`,z),null}}async function p(j,B,z,J){try{if(!J.cachePath)return;let I=Z.resolve(J.cachePath);await V.promises.mkdir(I,{recursive:!0});let X=Z.join(I,`${U(j)}.html`),Q=Z.join(I,`${U(j)}.meta.json`),Y=await V.promises.stat(j);await Bun.write(X,B);let $={sourcePath:j,mtime:Y.mtime.getTime(),dependencies:Array.from(z),cacheVersion:J.cacheVersion,optionsSignature:O(J),generatedAt:Date.now()};await Bun.write(Q,JSON.stringify($,null,2)),y.set(j,{output:B,mtime:Y.mtime.getTime(),dependencies:z})}catch(I){console.warn(`Failed to cache template ${j}:`,I)}}var v=16;function U(j){return new Bun.CryptoHasher("sha1").update(j).digest("hex").substring(0,v)}
3
- export{y as Oj,R as Pj,S as Qj,_ as Rj,C as Sj,b as Tj,A as Uj,g as Vj,u as Wj,P as Xj,p as Yj,U as Zj};
2
+ import{_p as M,cq as x}from"./chunk-17389q0t.js";import{kt as T}from"./chunk-snsb8nm6.js";import{ov as N}from"./chunk-6bcw8twx.js";import V from"fs";import Z from"path";var y=new Map,W=new Map;async function R(j){let z;for(let J=0;J<3;J++)try{let X=(await V.promises.stat(j)).mtime.getTime(),Q=W.get(j);if(Q&&Q.mtime===X)return Q.content;let Y=await Bun.file(j).text(),K=(await V.promises.stat(j)).mtime.getTime();if(K!==X)continue;return W.set(j,{content:Y,mtime:K}),Y}catch(I){z=I;break}throw W.delete(j),Error(`File not found: ${j}${z?` (${z.message})`:""}`)}function S(j){W.delete(j)}function _(j){for(let B of W.keys())if(B.startsWith(j))W.delete(B)}var q=null,w=null,G=null;function C(j){G=j}async function b(j=!1){let B=G??await import("./chunk-qga8gyr7.js");if(j)return B.generateSignalsRuntimeDev();if(q===null)q=B.generateSignalsRuntime();return q}var D=null;async function A(){if(D===null){let{getRouterScript:j}=await import("./chunk-gmfcddcw.js");D=j()}return D}var L={};async function g(j,B=!1){let z=j==="runtime"?await b(B):await A(),J=j==="runtime"&&B?"runtime-debug":j,I=L[J];if(!I||I.content!==z)I={content:z,hash:Bun.hash(z).toString(16).padStart(16,"0").slice(0,16)},L[J]=I;return{content:z,hash:I.hash,url:`/_stx/${j}.${I.hash}.js`}}function u(){W.clear(),x(),T(),q=null,w=null,D=null}function O(j){let B={debug:j.debug===!0,middleware:(j.middleware??[]).map((z)=>({name:z.name,timing:z.timing,handler:String(z.handler)})),customDirectives:(j.customDirectives??[]).map((z)=>({name:z.name,hasEndTag:z.hasEndTag===!0,handler:String(z.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(B)).digest("hex")}async function P(j,B){try{if(!B.cachePath)return null;let z=Z.resolve(B.cachePath),J=Z.join(z,`${U(j)}.html`),I=Z.join(z,`${U(j)}.meta.json`);if(!await M(J)||!await M(I))return null;let X=await Bun.file(I).text(),Q=JSON.parse(X);if(Q.cacheVersion!==B.cacheVersion)return null;if(Q.optionsSignature!==O(B))return null;if((await V.promises.stat(j)).mtime.getTime()>Q.mtime)return null;for(let $ of Q.dependencies)if(await M($)){if((await V.promises.stat($)).mtime.getTime()>Q.mtime)return null}else return null;return await Bun.file(J).text()}catch(z){return console.warn(`Cache error for ${j}:`,z),null}}async function p(j,B,z,J){try{if(!J.cachePath)return;let I=Z.resolve(J.cachePath);await V.promises.mkdir(I,{recursive:!0});let X=Z.join(I,`${U(j)}.html`),Q=Z.join(I,`${U(j)}.meta.json`),Y=await V.promises.stat(j);await Bun.write(X,B);let $={sourcePath:j,mtime:Y.mtime.getTime(),dependencies:Array.from(z),cacheVersion:J.cacheVersion,optionsSignature:O(J),generatedAt:Date.now()};await Bun.write(Q,JSON.stringify($,null,2)),y.set(j,{output:B,mtime:Y.mtime.getTime(),dependencies:z})}catch(I){console.warn(`Failed to cache template ${j}:`,I)}}var v=16;function U(j){return new Bun.CryptoHasher("sha1").update(j).digest("hex").substring(0,v)}
3
+ export{y as Pj,R as Qj,S as Rj,_ as Sj,C as Tj,b as Uj,A as Vj,g as Wj,u as Xj,P as Yj,p as Zj,U as _j};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{gr as a,hr as b,ir as c,jr as d,kr as e,lr as f}from"./chunk-17389q0t.js";import"./chunk-6xbscz34.js";import"./chunk-bkbr9yz2.js";import"./chunk-nn4k6hvv.js";import"./chunk-1zyqv8p8.js";import"./chunk-1zvyq6jj.js";import"./chunk-snsb8nm6.js";import"./chunk-v4vvm7mz.js";import"./chunk-s710wybv.js";import"./chunk-00mag1n0.js";import"./chunk-d3r5pdz7.js";import"./chunk-ze3qgdaf.js";import"./chunk-54fnvfp1.js";import"./chunk-42b81qv3.js";import"./chunk-6bcw8twx.js";export{f as validateConfig,b as resolveStxDirectories,c as loadStxConfig,e as defineStxConfig,a as defaultConfig,d as config};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ag as c,Bg as d,Cg as e,Dg as f,Eg as g,Fg as h,Gg as i,Hg as j,Ig as k,Jg as l,yg as a,zg as b}from"./chunk-8bxtvsgm.js";import"./chunk-vwqv8f0y.js";export{g as toUsers,f as toUser,c as stopBroadcasting,b as startBroadcasting,d as loadChannels,a as getBroadcastServer,j as channel,h as broadcastPrivate,i as broadcastPresence,e as broadcast,l as BroadcastServer,k as Broadcast};
2
+ import{Ag as b,Bg as c,Cg as d,Dg as e,Eg as f,Fg as g,Gg as h,Hg as i,Ig as j,Jg as k,Kg as l,zg as a}from"./chunk-634gaa9d.js";import"./chunk-6bcw8twx.js";export{g as toUsers,f as toUser,c as stopBroadcasting,b as startBroadcasting,d as loadChannels,a as getBroadcastServer,j as channel,h as broadcastPrivate,i as broadcastPresence,e as broadcast,l as BroadcastServer,k as Broadcast};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{kv as W,lv as k,mv as G}from"./chunk-vwqv8f0y.js";import A from"fs";import B from"path";function h(j){let q=0;for(let K=0;K<j.length;K++){let Q=j[K];q=(q<<5)-q+Q,q=q&q}return Math.abs(q).toString(16).padStart(8,"0")}function u(j,q){let K=B.basename(j);for(let Q of q)if(Q.startsWith("*.")){let Y=Q.slice(1);if(K.endsWith(Y))return!0}else if(Q.includes("*")){let Y=new RegExp(`^${Q.replace(/\*/g,".*")}$`);if(Y.test(K)||Y.test(j))return!0}else if(K===Q||j.includes(Q))return!0;return!1}function f(j,q,K){let Q=B.extname(j).toLowerCase(),Y=l[Q],X=(K.maxFileSizeKB||500)*1024;if(q>X)return!1;if(K.exclude&&u(j,K.exclude))return!1;if(K.include&&K.include.length>0){for(let Z of K.include)if(Z.startsWith("*.")){if(j.endsWith(Z.slice(1)))return!0}else if(j.includes(Z))return!0}if(Y&&K[Y]===!0)return!0;if(!Y)return!1;return!1}function T(j,q,K,Q){let Y=A.readdirSync(j,{withFileTypes:!0});for(let X of Y){let Z=B.join(j,X.name);if(X.isDirectory()){if(["node_modules",".git",".stx"].includes(X.name))continue;T(Z,q,K,Q)}else if(X.isFile()){let O=A.statSync(Z),_=B.relative(q,Z);if(f(_,O.size,K)){let $=A.readFileSync(Z),L=h($),V=`/${_.replace(/\\/g,"/")}`;Q.push({url:V,revision:L,size:O.size})}}}}function U(j,q){let K=q.pwa?.precache,Q=[];if(!K?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!A.existsSync(j))return{entries:[],totalSize:0,fileCount:0};T(j,j,K,Q),Q.sort((X,Z)=>X.url.localeCompare(Z.url));let Y=Q.reduce((X,Z)=>X+Z.size,0);return{entries:Q,totalSize:Y,fileCount:Q.length}}function J(j){if(j.entries.length===0)return"[]";return`[
2
+ import{lv as W,mv as k,nv as G}from"./chunk-6bcw8twx.js";import A from"fs";import B from"path";function h(j){let q=0;for(let K=0;K<j.length;K++){let Q=j[K];q=(q<<5)-q+Q,q=q&q}return Math.abs(q).toString(16).padStart(8,"0")}function u(j,q){let K=B.basename(j);for(let Q of q)if(Q.startsWith("*.")){let Y=Q.slice(1);if(K.endsWith(Y))return!0}else if(Q.includes("*")){let Y=new RegExp(`^${Q.replace(/\*/g,".*")}$`);if(Y.test(K)||Y.test(j))return!0}else if(K===Q||j.includes(Q))return!0;return!1}function f(j,q,K){let Q=B.extname(j).toLowerCase(),Y=l[Q],X=(K.maxFileSizeKB||500)*1024;if(q>X)return!1;if(K.exclude&&u(j,K.exclude))return!1;if(K.include&&K.include.length>0){for(let Z of K.include)if(Z.startsWith("*.")){if(j.endsWith(Z.slice(1)))return!0}else if(j.includes(Z))return!0}if(Y&&K[Y]===!0)return!0;if(!Y)return!1;return!1}function T(j,q,K,Q){let Y=A.readdirSync(j,{withFileTypes:!0});for(let X of Y){let Z=B.join(j,X.name);if(X.isDirectory()){if(["node_modules",".git",".stx"].includes(X.name))continue;T(Z,q,K,Q)}else if(X.isFile()){let O=A.statSync(Z),_=B.relative(q,Z);if(f(_,O.size,K)){let $=A.readFileSync(Z),L=h($),V=`/${_.replace(/\\/g,"/")}`;Q.push({url:V,revision:L,size:O.size})}}}}function U(j,q){let K=q.pwa?.precache,Q=[];if(!K?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!A.existsSync(j))return{entries:[],totalSize:0,fileCount:0};T(j,j,K,Q),Q.sort((X,Z)=>X.url.localeCompare(Z.url));let Y=Q.reduce((X,Z)=>X+Z.size,0);return{entries:Q,totalSize:Y,fileCount:Q.length}}function J(j){if(j.entries.length===0)return"[]";return`[
3
3
  ${j.entries.map((K)=>` { url: '${K.url}', revision: '${K.revision}' }`).join(`,
4
4
  `)}
5
5
  ]`}function E(j){if(j<1024)return`${j} B`;if(j<1048576)return`${(j/1024).toFixed(1)} KB`;return`${(j/1048576).toFixed(2)} MB`}var l;var F=G(()=>{l={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"}});function g(j){let q={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return q[j]||q["network-first"]}function R(j){return g(j).className}function M(j){let q=j.pwa;if(!q?.enabled)return"";let K=q.routes||[],Q=q.cacheStorage,Y=[];for(let X of K){let Z=R(X.strategy),O=[];if(X.maxAgeSeconds||X.maxEntries||Q?.maxEntries){let $=X.maxEntries||Q?.maxEntries||100,L=X.maxAgeSeconds||(Q?.maxAge?Q.maxAge*24*60*60:void 0);O.push(`new ExpirationPlugin({
@@ -1191,4 +1191,4 @@ if ('serviceWorker' in navigator) {
1191
1191
  });
1192
1192
  }
1193
1193
  </script>`}function Vj(){return'<link rel="manifest" href="/manifest.json">'}function Aj(j){return`<meta name="theme-color" content="${N(j)}">`}function N(j){return j.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}
1194
- export{U as Nk,J as Ok,E as Pk,F as Qk,w as Rk,z as Sk,y as Tk,qj as Uk,H as Vk,I as Wk,Lj as Xk,Uj as Yk,Vj as Zk,Aj as _k};
1194
+ export{U as Ok,J as Pk,E as Qk,F as Rk,w as Sk,z as Tk,y as Uk,qj as Vk,H as Wk,I as Xk,Lj as Yk,Uj as Zk,Vj as _k,Aj as $k};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Af as w,Bf as x,Cf as y,Df as z,Ef as A,Ff as B,Gf as C,Hf as D,If as E,xf as t,yf as u,zf as v}from"./chunk-k7mewajj.js";import{Kg as r,Lg as s}from"./chunk-vrhp2xnm.js";import{Eh as b,Fh as c,Gh as d,Hh as e,Ih as f,Jh as g,Kh as h,Mh as i,Nh as j,Oh as k,Ph as l,Qh as m,Rh as n,Sh as o,Th as p,Uh as q}from"./chunk-pfwhd5xs.js";import{qi as a}from"./chunk-k0y7ta0d.js";import"./chunk-dn8006f7.js";import"./chunk-vwqv8f0y.js";export{D as writeImageManifest,a as rewriteImagesWithSiblings,t as renderImageComponent,v as processImageComponents,g as processImage,u as parseImageComponent,A as optimizeImage,B as optimizeDirectory,e as isSharpAvailable,m as isImageFile,f as isImageBackendAvailable,y as imageDirective,r as handleImageRequest,l as groupVariantsByFormat,o as getTotalSize,n as getMimeType,h as getImageMetadata,k as getFallbackVariant,i as generateSrcSet,j as generateSizes,C as generateImageManifest,p as formatSize,E as defaultImageConfig,z as createImagePlugin,s as createImageHandler,x as createImageDirective,w as clearImageCache,q as ImageProcessingError,b as DEFAULT_WIDTHS,d as DEFAULT_QUALITY,c as DEFAULT_FORMATS};
2
+ import{Af as w,Bf as x,Cf as y,Df as z,Ef as A,Ff as B,Gf as C,Hf as D,If as E,xf as t,yf as u,zf as v}from"./chunk-kpgvx2p1.js";import{Lg as r,Mg as s}from"./chunk-mzbnczgk.js";import{Fh as b,Gh as c,Hh as d,Ih as e,Jh as f,Kh as g,Lh as h,Nh as i,Oh as j,Ph as k,Qh as l,Rh as m,Sh as n,Th as o,Uh as p,Vh as q}from"./chunk-x14vvxfh.js";import{ri as a}from"./chunk-y9nyqcha.js";import"./chunk-bkbr9yz2.js";import"./chunk-6bcw8twx.js";export{D as writeImageManifest,a as rewriteImagesWithSiblings,t as renderImageComponent,v as processImageComponents,g as processImage,u as parseImageComponent,A as optimizeImage,B as optimizeDirectory,e as isSharpAvailable,m as isImageFile,f as isImageBackendAvailable,y as imageDirective,r as handleImageRequest,l as groupVariantsByFormat,o as getTotalSize,n as getMimeType,h as getImageMetadata,k as getFallbackVariant,i as generateSrcSet,j as generateSizes,C as generateImageManifest,p as formatSize,E as defaultImageConfig,z as createImagePlugin,s as createImageHandler,x as createImageDirective,w as clearImageCache,q as ImageProcessingError,b as DEFAULT_WIDTHS,d as DEFAULT_QUALITY,c as DEFAULT_FORMATS};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Zt as a,_t as b}from"./chunk-00mag1n0.js";import"./chunk-6bcw8twx.js";export{a as transformStoreImports,b as stripModuleImports};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{hg as a,jg as JF,kg as ZF,lg as qF}from"./chunk-tt50t72e.js";import{rg as p}from"./chunk-bax52sn4.js";import{sj as C,tj as D}from"./chunk-kp8ec2f4.js";import{Fk as QF,Gk as XF,Hk as YF}from"./chunk-xtx53xyz.js";import{Gp as FF,Kp as c,Mm as u,co as o,em as d,fr as n,gm as l,hr as N,jp as e,yp as t}from"./chunk-6z04mpxz.js";import{Bt as r}from"./chunk-qfec1s34.js";import{bv as S,dv as WF}from"./chunk-jmh31a2a.js";import G from"fs";import Z from"path";import{createHash as $F}from"crypto";WF();function g(J){return $F("sha256").update(J).digest("hex").slice(0,8)}function f(J=!1){let q=J?D():C(),z=g(q);return{content:q,filename:`runtime.${z}.js`,hash:z}}function m(){let J=S(),q=g(J);return{content:J,filename:`router.${q}.js`,hash:q}}function UF(J){return{runtimeTag:J.runtime?`<script src="/__stx/${J.runtime.filename}"></script>`:"",routerTag:J.router?`<script src="/__stx/${J.router.filename}"></script>`:"",cssTag:J.css?`<link rel="stylesheet" href="/__stx/${J.css.filename}">`:""}}import h from"path";import{createHash as GF}from"crypto";function VF(J={}){let q=new Set;return{context:new Proxy(J,{get(Q,X){if(X in Q)return Q[X];if(typeof X==="string"&&!X.startsWith("__"))q.add(X);return},has(Q,X){if(X in Q)return!0;if(typeof X==="string"&&!X.startsWith("__"))q.add(X);return!1}}),accessedKeys:q}}async function i(J,q,z={}){let Q=h.resolve(J),X=await Bun.file(Q).text(),I=GF("sha256").update(X).digest("hex").slice(0,16);d();let K={};try{K=await N()}catch{}let B=[],V=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,k;while((k=V.exec(X))!==null){let $=k[1];if(/\bserver\b/.test($))B.push(k[2])}let W=new Set(B.flatMap(($)=>p($))),{context:w}=VF({__filename:Q,__dirname:h.dirname(Q),__stx_serverDeclared:W}),E=new Set,L={...n,...K,...z,buildMode:"compile",strict:!1},_=await c(X,w,Q,L,E),U=a(_),H=l();return{route:q,sourceFile:J,html:_,fragment:U,placeholders:H,hasServerScripts:B.length>0,serverScriptContent:B,dependencies:Array.from(E),contentHash:I,status:u(X),streamTemplates:w.__streamTemplates}}var kF=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function s(J,q){let z=0,Q=0;if(!G.existsSync(J))return{copied:z,bytes:Q};G.mkdirSync(q,{recursive:!0});function X(I,K){let B=G.readdirSync(I,{withFileTypes:!0});for(let V of B){if(kF.has(V.name))continue;let k=Z.join(I,V.name),W=Z.join(K,V.name);if(V.isDirectory())G.mkdirSync(W,{recursive:!0}),X(k,W);else if(V.isFile()){if(G.existsSync(W))continue;G.copyFileSync(k,W),z++,Q+=G.statSync(W).size}}}return X(J,q),{copied:z,bytes:Q}}async function dF(J={}){let q=Date.now(),z=Z.resolve(J.root||process.cwd()),Q=Z.resolve(z,J.outputDir||".output");console.log("[stx build] Starting production build...");let X={};try{X=await N()}catch{}let I=J.componentsDir??X.componentsDir??"components",K=J.partialsDir??X.partialsDir??"partials",B=J.layoutsDir??X.layoutsDir??"layouts",V=J.publicDir??X.publicDir??"public",k=X.app?.head||{},W=X.app?.colorMode,w=X.router?.container||"main";if(G.existsSync(Q))G.rmSync(Q,{recursive:!0});let E=[Z.join(Q,"public","__stx"),Z.join(Q,"public","assets"),Z.join(Q,"server","pages"),Z.join(Q,"server","fragments")];for(let Y of E)G.mkdirSync(Y,{recursive:!0});console.log("[stx build] Discovering routes...");let L=o(z),_=["components","layouts","partials"],U=L.filter((Y)=>{return!_.some((F)=>Y.pattern.startsWith(`/${F}/`)||Y.pattern===`/${F}`)});console.log(`[stx build] Found ${U.length} page routes (${L.length-U.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let H=f(J.debug),$=m();await Bun.write(Z.join(Q,"public","__stx",H.filename),H.content),await Bun.write(Z.join(Q,"public","__stx",$.filename),$.content),console.log(`[stx build] Runtime: ${H.filename} (${(H.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${$.filename} (${($.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let O=[],j=[];for(let Y of U)try{let F=await i(Y.filePath,Y.pattern,{componentsDir:I,partialsDir:K,layoutsDir:B,debug:J.debug});if(O.push(F),F.html=F.html.replace(/runtime\.__STX_HASH__\.js/g,H.filename).replace(/router\.__STX_HASH__\.js/g,$.filename),F.html=FF(F.html,k,{bodyScripts:[`<script src="/__stx/${$.filename}"></script>`],...W&&{colorMode:W}}),W)F.html=e(F.html,W);if(k.htmlAttrs)F.html=t(F.html,k.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(F.html)){let T=F.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(T&&T[1]){let P=T[1];F.html=F.html.replace(" "+P,""),F.html=F.html.replace(/<body([^>]*)>/,`<body$1 ${P}>`)}}F.html=F.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),F.html=await r(F.html),F.fragment=JF(F.html,w);let y=Y.pattern==="/"?"index":Y.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),b=Z.join("server","pages",`${y}.compiled.json`),A=Z.join("server","fragments",`${y}.html`);await Bun.write(Z.join(Q,b),JSON.stringify(F,null,2)),await Bun.write(Z.join(Q,A),F.fragment),j.push({pattern:Y.pattern,compiledPath:b,fragmentPath:A,isDynamic:F.hasServerScripts,hasParams:Y.pattern.includes(":")||Y.pattern.includes("[")}),console.log(`[stx build] \u2713 ${Y.pattern}`)}catch(F){console.error(`[stx build] \u2717 ${Y.pattern}:`,F instanceof Error?F.message:F)}let M=Z.resolve(z,V);if(G.existsSync(M)){let{copied:Y,bytes:F}=s(M,Z.join(Q,"public"));if(Y>0)console.log(`[stx build] Copied ${Y} public asset${Y===1?"":"s"} (${(F/1024).toFixed(1)}KB) from ${V}/`)}let v=YF(z);if(v){let{copied:Y,bytes:F}=s(v,Z.join(Q,"public",XF));if(Y>0)console.log(`[stx build] Copied ${Y} asset${Y===1?"":"s"} (${(F/1024).toFixed(1)}KB) from ${QF}/`)}let R={runtime:H.filename,router:$.filename},zF=ZF(j,R,Q);qF(zF,Q);let x=Date.now()-q;return console.log(`
2
+ import{ig as a,kg as JF,lg as ZF,mg as qF}from"./chunk-trpmf02p.js";import{sg as p}from"./chunk-yq903p32.js";import{tj as C,uj as D}from"./chunk-mq0vtxe6.js";import{Gk as QF,Hk as XF,Ik as YF}from"./chunk-7eea1cse.js";import{Hp as FF,Lp as c,Nm as u,do as o,fm as d,gr as n,hm as l,ir as N,kp as e,zp as t}from"./chunk-17389q0t.js";import{Ct as r}from"./chunk-snsb8nm6.js";import{cv as S,ev as WF}from"./chunk-54fnvfp1.js";import G from"fs";import Z from"path";import{createHash as $F}from"crypto";WF();function g(J){return $F("sha256").update(J).digest("hex").slice(0,8)}function f(J=!1){let q=J?D():C(),z=g(q);return{content:q,filename:`runtime.${z}.js`,hash:z}}function m(){let J=S(),q=g(J);return{content:J,filename:`router.${q}.js`,hash:q}}function UF(J){return{runtimeTag:J.runtime?`<script src="/__stx/${J.runtime.filename}"></script>`:"",routerTag:J.router?`<script src="/__stx/${J.router.filename}"></script>`:"",cssTag:J.css?`<link rel="stylesheet" href="/__stx/${J.css.filename}">`:""}}import h from"path";import{createHash as GF}from"crypto";function VF(J={}){let q=new Set;return{context:new Proxy(J,{get(Q,X){if(X in Q)return Q[X];if(typeof X==="string"&&!X.startsWith("__"))q.add(X);return},has(Q,X){if(X in Q)return!0;if(typeof X==="string"&&!X.startsWith("__"))q.add(X);return!1}}),accessedKeys:q}}async function i(J,q,z={}){let Q=h.resolve(J),X=await Bun.file(Q).text(),I=GF("sha256").update(X).digest("hex").slice(0,16);d();let K={};try{K=await N()}catch{}let B=[],V=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,k;while((k=V.exec(X))!==null){let $=k[1];if(/\bserver\b/.test($))B.push(k[2])}let W=new Set(B.flatMap(($)=>p($))),{context:w}=VF({__filename:Q,__dirname:h.dirname(Q),__stx_serverDeclared:W}),E=new Set,L={...n,...K,...z,buildMode:"compile",strict:!1},_=await c(X,w,Q,L,E),U=a(_),H=l();return{route:q,sourceFile:J,html:_,fragment:U,placeholders:H,hasServerScripts:B.length>0,serverScriptContent:B,dependencies:Array.from(E),contentHash:I,status:u(X),streamTemplates:w.__streamTemplates}}var kF=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function s(J,q){let z=0,Q=0;if(!G.existsSync(J))return{copied:z,bytes:Q};G.mkdirSync(q,{recursive:!0});function X(I,K){let B=G.readdirSync(I,{withFileTypes:!0});for(let V of B){if(kF.has(V.name))continue;let k=Z.join(I,V.name),W=Z.join(K,V.name);if(V.isDirectory())G.mkdirSync(W,{recursive:!0}),X(k,W);else if(V.isFile()){if(G.existsSync(W))continue;G.copyFileSync(k,W),z++,Q+=G.statSync(W).size}}}return X(J,q),{copied:z,bytes:Q}}async function dF(J={}){let q=Date.now(),z=Z.resolve(J.root||process.cwd()),Q=Z.resolve(z,J.outputDir||".output");console.log("[stx build] Starting production build...");let X={};try{X=await N()}catch{}let I=J.componentsDir??X.componentsDir??"components",K=J.partialsDir??X.partialsDir??"partials",B=J.layoutsDir??X.layoutsDir??"layouts",V=J.publicDir??X.publicDir??"public",k=X.app?.head||{},W=X.app?.colorMode,w=X.router?.container||"main";if(G.existsSync(Q))G.rmSync(Q,{recursive:!0});let E=[Z.join(Q,"public","__stx"),Z.join(Q,"public","assets"),Z.join(Q,"server","pages"),Z.join(Q,"server","fragments")];for(let Y of E)G.mkdirSync(Y,{recursive:!0});console.log("[stx build] Discovering routes...");let L=o(z),_=["components","layouts","partials"],U=L.filter((Y)=>{return!_.some((F)=>Y.pattern.startsWith(`/${F}/`)||Y.pattern===`/${F}`)});console.log(`[stx build] Found ${U.length} page routes (${L.length-U.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let H=f(J.debug),$=m();await Bun.write(Z.join(Q,"public","__stx",H.filename),H.content),await Bun.write(Z.join(Q,"public","__stx",$.filename),$.content),console.log(`[stx build] Runtime: ${H.filename} (${(H.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${$.filename} (${($.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let O=[],j=[];for(let Y of U)try{let F=await i(Y.filePath,Y.pattern,{componentsDir:I,partialsDir:K,layoutsDir:B,debug:J.debug});if(O.push(F),F.html=F.html.replace(/runtime\.__STX_HASH__\.js/g,H.filename).replace(/router\.__STX_HASH__\.js/g,$.filename),F.html=FF(F.html,k,{bodyScripts:[`<script src="/__stx/${$.filename}"></script>`],...W&&{colorMode:W}}),W)F.html=e(F.html,W);if(k.htmlAttrs)F.html=t(F.html,k.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(F.html)){let T=F.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(T&&T[1]){let P=T[1];F.html=F.html.replace(" "+P,""),F.html=F.html.replace(/<body([^>]*)>/,`<body$1 ${P}>`)}}F.html=F.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),F.html=await r(F.html),F.fragment=JF(F.html,w);let y=Y.pattern==="/"?"index":Y.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),b=Z.join("server","pages",`${y}.compiled.json`),A=Z.join("server","fragments",`${y}.html`);await Bun.write(Z.join(Q,b),JSON.stringify(F,null,2)),await Bun.write(Z.join(Q,A),F.fragment),j.push({pattern:Y.pattern,compiledPath:b,fragmentPath:A,isDynamic:F.hasServerScripts,hasParams:Y.pattern.includes(":")||Y.pattern.includes("[")}),console.log(`[stx build] \u2713 ${Y.pattern}`)}catch(F){console.error(`[stx build] \u2717 ${Y.pattern}:`,F instanceof Error?F.message:F)}let M=Z.resolve(z,V);if(G.existsSync(M)){let{copied:Y,bytes:F}=s(M,Z.join(Q,"public"));if(Y>0)console.log(`[stx build] Copied ${Y} public asset${Y===1?"":"s"} (${(F/1024).toFixed(1)}KB) from ${V}/`)}let v=YF(z);if(v){let{copied:Y,bytes:F}=s(v,Z.join(Q,"public",XF));if(Y>0)console.log(`[stx build] Copied ${Y} asset${Y===1?"":"s"} (${(F/1024).toFixed(1)}KB) from ${QF}/`)}let R={runtime:H.filename,router:$.filename},zF=ZF(j,R,Q);qF(zF,Q);let x=Date.now()-q;return console.log(`
3
3
  [stx build] Done in ${x}ms \u2014 ${O.length} pages compiled`),{pageCount:O.length,assets:R,outputDir:Q,duration:x}}
4
4
  export{g as Rf,f as Sf,m as Tf,UF as Uf,i as Vf,dF as Wf};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Jf as c,Kf as d,Lf as e,Mf as f,Nf as g,Of as h}from"./chunk-2d9yq3m4.js";import{og as a,rg as b}from"./chunk-yq903p32.js";import"./chunk-9k5p10e4.js";import"./chunk-91007tan.js";import"./chunk-17389q0t.js";import"./chunk-6xbscz34.js";import"./chunk-bkbr9yz2.js";import"./chunk-nn4k6hvv.js";import"./chunk-1zyqv8p8.js";import"./chunk-1zvyq6jj.js";import"./chunk-snsb8nm6.js";import"./chunk-v4vvm7mz.js";import"./chunk-s710wybv.js";import"./chunk-00mag1n0.js";import"./chunk-d3r5pdz7.js";import"./chunk-ze3qgdaf.js";import"./chunk-54fnvfp1.js";import"./chunk-42b81qv3.js";import"./chunk-6bcw8twx.js";export{d as virtualPathFor,g as typecheckStxFiles,e as sourcePathFor,h as formatTypecheckDiagnostics,f as findRuntimeTypeDeclarations,b as extractTemplateExpressions,a as extractScriptBlocks,c as buildVirtualSource};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Eh as L,Fh as w,Gh as x,Hh as p,Ih as F,Jh as T,Mh as I,Nh as f,Oh as l,Ph as n,Qh as i,Rh as P,Sh as o,Th as a}from"./chunk-pfwhd5xs.js";import{Us as ZG}from"./chunk-dn8006f7.js";function HG(X,Z={}){let{src:G,alt:J,width:q,height:$,sizes:K="100vw",loading:Q="lazy",priority:Y=!1,quality:M=x,placeholder:N="none",formats:j=w,widths:C=L,decoding:B="async",fetchpriority:V,objectFit:O,objectPosition:W}=X,H=X.class,z=X.style,{processedImage:R,variants:_,optimize:E=!0,isDev:S=!1}=Z;if(_&&_.length>0)return OG(X,_,R);if(S||!E)return MG(X);return VG(X)}function OG(X,Z,G){let{src:J,alt:q,width:$,height:K,sizes:Q="100vw",loading:Y="lazy",priority:M=!1,decoding:N="async",fetchpriority:j,objectFit:C,objectPosition:B,placeholder:V="none"}=X,O=X.class,W=X.style,H=n(Z),z=l(Z),R=typeof Q==="object"?f(Q):Q,_=G?G.aspectRatio:$&&K?Number($)/Number(K):void 0,E=[];if(_)E.push(`aspect-ratio: ${_}`);if(C)E.push(`object-fit: ${C}`);if(B)E.push(`object-position: ${B}`);if(W)E.push(W);let S=E.length>0?` style="${E.join("; ")}"`:"",b=O?` class="${O}"`:"",u=M?"":` loading="${Y}"`,d=` decoding="${N}"`,h=j?` fetchpriority="${j}"`:M?' fetchpriority="high"':"",r=["avif","webp","jpeg","png"],s=[];for(let U of r){let D=H.get(U);if(D&&D.length>0){let m=I(D),QG=P(U);s.push(` <source type="${QG}" srcset="${m}" sizes="${R}" />`)}}let e="",t="",g;if(V!=="none"&&G?.placeholder){let U=`img-${Math.random().toString(36).slice(2,8)}`;if(e=`<div class="stx-image-wrapper" id="${U}">`,t="</div>",V==="blur")g=`
2
+ import{Fh as L,Gh as w,Hh as x,Ih as p,Jh as F,Kh as T,Nh as I,Oh as f,Ph as l,Qh as n,Rh as i,Sh as P,Th as o,Uh as a}from"./chunk-x14vvxfh.js";import{Vs as ZG}from"./chunk-bkbr9yz2.js";function HG(X,Z={}){let{src:G,alt:J,width:q,height:$,sizes:K="100vw",loading:Q="lazy",priority:Y=!1,quality:M=x,placeholder:N="none",formats:j=w,widths:C=L,decoding:B="async",fetchpriority:V,objectFit:O,objectPosition:W}=X,H=X.class,z=X.style,{processedImage:R,variants:_,optimize:E=!0,isDev:S=!1}=Z;if(_&&_.length>0)return OG(X,_,R);if(S||!E)return MG(X);return VG(X)}function OG(X,Z,G){let{src:J,alt:q,width:$,height:K,sizes:Q="100vw",loading:Y="lazy",priority:M=!1,decoding:N="async",fetchpriority:j,objectFit:C,objectPosition:B,placeholder:V="none"}=X,O=X.class,W=X.style,H=n(Z),z=l(Z),R=typeof Q==="object"?f(Q):Q,_=G?G.aspectRatio:$&&K?Number($)/Number(K):void 0,E=[];if(_)E.push(`aspect-ratio: ${_}`);if(C)E.push(`object-fit: ${C}`);if(B)E.push(`object-position: ${B}`);if(W)E.push(W);let S=E.length>0?` style="${E.join("; ")}"`:"",b=O?` class="${O}"`:"",u=M?"":` loading="${Y}"`,d=` decoding="${N}"`,h=j?` fetchpriority="${j}"`:M?' fetchpriority="high"':"",r=["avif","webp","jpeg","png"],s=[];for(let U of r){let D=H.get(U);if(D&&D.length>0){let m=I(D),QG=P(U);s.push(` <source type="${QG}" srcset="${m}" sizes="${R}" />`)}}let e="",t="",g;if(V!=="none"&&G?.placeholder){let U=`img-${Math.random().toString(36).slice(2,8)}`;if(e=`<div class="stx-image-wrapper" id="${U}">`,t="</div>",V==="blur")g=`
3
3
  #${U} {
4
4
  position: relative;
5
5
  background-image: url('${G.placeholder}');
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ip as b,Jp as c,Kp as d,Lp as e,go as a}from"./chunk-17389q0t.js";import"./chunk-6xbscz34.js";import"./chunk-bkbr9yz2.js";import"./chunk-nn4k6hvv.js";import"./chunk-1zyqv8p8.js";import"./chunk-1zvyq6jj.js";import"./chunk-snsb8nm6.js";import"./chunk-v4vvm7mz.js";import"./chunk-s710wybv.js";import"./chunk-00mag1n0.js";import"./chunk-d3r5pdz7.js";import"./chunk-ze3qgdaf.js";import"./chunk-54fnvfp1.js";import"./chunk-42b81qv3.js";import"./chunk-6bcw8twx.js";export{d as validateClientScript,c as processOnceDirective,b as processJsonDirective,e as processDirectives,a as injectRouterScript};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{dt as a,et as b,ft as c}from"./chunk-1zvyq6jj.js";import"./chunk-6bcw8twx.js";export{c as prepareImageDelivery,a as getImageDelivery,b as clearImageDeliveryCatalog};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{dv as y}from"./chunk-jmh31a2a.js";import N from"fs";import B from"path";var Y="_stx";function L(M){return Bun.hash(M).toString(16).slice(0,8)}function T(M){let C=[],v=(q)=>{for(let g of N.readdirSync(q,{withFileTypes:!0})){let j=B.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(N.existsSync(M))v(M);return C}var S=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-runtime src="${M}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-router src="${M}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(M)=>`<link data-css="generated" rel="stylesheet" href="${M}">`}];function _(M,C=`/${Y}`){let v=[],q=new Set,g=0,j=M;for(let G of S)j=j.replace(G.pattern,(R,K,W)=>{if(/\b(?:src|href)\s*=/.test(K)||!W.trim())return R;let Q=`${G.prefix}.${L(W)}.${G.extension}`;if(!q.has(Q))q.add(Q),v.push({filename:Q,contents:W,contentType:G.contentType});return g+=W.length,G.replace(`${C}/${Q}`)});return{html:j,assets:v,bytesInlined:g}}function a(M){let C={pages:0,assets:0,bytesInlined:0},v=B.join(M,Y),q=new Set;for(let g of T(M)){let j=N.readFileSync(g,"utf8"),{html:G,assets:R,bytesInlined:K}=_(j);if(G===j)continue;for(let W of R){if(q.has(W.filename))continue;q.add(W.filename),N.mkdirSync(v,{recursive:!0}),N.writeFileSync(B.join(v,W.filename),W.contents),C.assets++}N.writeFileSync(g,G),C.bytesInlined+=K,C.pages++}return C}import z from"fs";import P from"path";var I=1024,E=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,d=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function b(M){return Bun.hash(M).toString(16).slice(0,8)}function p(M){let C=[],v=(q)=>{for(let g of z.readdirSync(q,{withFileTypes:!0})){let j=P.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(z.existsSync(M))v(M);return C}function D(M,C){let v=M.match(new RegExp(`\\b${C}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!v)return;return v[2]??v[3]??v[4]??""}function m(M,C,v){if(v.length<I)return!1;if(/\b(?:src|href)\s*=/i.test(C))return!1;if(M.toLowerCase()==="script"){if(!d.has((D(C,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function o(M){let C=[];for(let v of M.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))C.push([v.index,v.index+v[0].length]);return C}function s(M){let C={pages:0,assets:0,bytesInlined:0},v=p(M);if(v.length<2)return C;let q=new Map,g=new Map;for(let Q of v){let O=z.readFileSync(Q,"utf8");q.set(Q,O);let x=o(O);for(let U of O.matchAll(E)){let[w,V,J,$]=U;if(!m(V,J,$))continue;if(x.some(([A,k])=>U.index>=A&&U.index<k))continue;let H=`${V.toLowerCase()}\x00${$}`,X=g.get(H);if(X)X.push({file:Q,whole:w,tag:V,attrs:J,body:$});else g.set(H,[{file:Q,whole:w,tag:V,attrs:J,body:$}])}}let j=[...g.values()].filter((Q)=>new Set(Q.map((O)=>O.file)).size>1);if(j.length===0)return C;let G=P.join(M,Y),R=new Map(q),K=new Map,W=[];for(let Q of j){let{tag:O,body:x}=Q[0],U=O.toLowerCase()==="script",w=`${U?"chunk":"style"}.${b(x)}.${U?"js":"css"}`;W.push({filename:w,contents:x,contentType:U?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let V=`/${Y}/${w}`;for(let J of Q){let $=U?`<script${J.attrs} src="${V}"></script>`:`<link${J.attrs} rel="stylesheet" href="${V}">`,H=R.get(J.file),X=H.replace(J.whole,()=>$);if(X===H)continue;R.set(J.file,X),K.set(J.file,(K.get(J.file)??0)+J.body.length)}}z.mkdirSync(G,{recursive:!0});for(let Q of W)z.writeFileSync(P.join(G,Q.filename),Q.contents),C.assets++;for(let[Q,O]of R){if(O===q.get(Q))continue;z.writeFileSync(Q,O),C.pages++,C.bytesInlined+=K.get(Q)??0}return C}y();import Z from"fs";import F from"path";var h="layout-types.d.ts";function f(M){let C=[],v=(q,g)=>{let j;try{j=Z.readdirSync(q,{withFileTypes:!0})}catch{return}for(let G of j){if(G.name.startsWith("."))continue;let R=F.join(q,G.name);if(G.isDirectory())v(R,g?`${g}/${G.name}`:G.name);else if(G.isFile()&&G.name.endsWith(".stx")&&G.name!=="_layout.stx"){let K=G.name.slice(0,-4);C.push(g?`${g}/${K}`:K)}}};return v(M,""),C.sort()}function c(M){let C=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(M.length===0)return C.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),C.join(`
2
+ import{ev as y}from"./chunk-54fnvfp1.js";import N from"fs";import B from"path";var Y="_stx";function L(M){return Bun.hash(M).toString(16).slice(0,8)}function T(M){let C=[],v=(q)=>{for(let g of N.readdirSync(q,{withFileTypes:!0})){let j=B.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(N.existsSync(M))v(M);return C}var S=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-runtime src="${M}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-router src="${M}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(M)=>`<link data-css="generated" rel="stylesheet" href="${M}">`}];function _(M,C=`/${Y}`){let v=[],q=new Set,g=0,j=M;for(let G of S)j=j.replace(G.pattern,(R,K,W)=>{if(/\b(?:src|href)\s*=/.test(K)||!W.trim())return R;let Q=`${G.prefix}.${L(W)}.${G.extension}`;if(!q.has(Q))q.add(Q),v.push({filename:Q,contents:W,contentType:G.contentType});return g+=W.length,G.replace(`${C}/${Q}`)});return{html:j,assets:v,bytesInlined:g}}function a(M){let C={pages:0,assets:0,bytesInlined:0},v=B.join(M,Y),q=new Set;for(let g of T(M)){let j=N.readFileSync(g,"utf8"),{html:G,assets:R,bytesInlined:K}=_(j);if(G===j)continue;for(let W of R){if(q.has(W.filename))continue;q.add(W.filename),N.mkdirSync(v,{recursive:!0}),N.writeFileSync(B.join(v,W.filename),W.contents),C.assets++}N.writeFileSync(g,G),C.bytesInlined+=K,C.pages++}return C}import z from"fs";import P from"path";var I=1024,E=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,d=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function b(M){return Bun.hash(M).toString(16).slice(0,8)}function p(M){let C=[],v=(q)=>{for(let g of z.readdirSync(q,{withFileTypes:!0})){let j=P.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(z.existsSync(M))v(M);return C}function D(M,C){let v=M.match(new RegExp(`\\b${C}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!v)return;return v[2]??v[3]??v[4]??""}function m(M,C,v){if(v.length<I)return!1;if(/\b(?:src|href)\s*=/i.test(C))return!1;if(M.toLowerCase()==="script"){if(!d.has((D(C,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function o(M){let C=[];for(let v of M.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))C.push([v.index,v.index+v[0].length]);return C}function s(M){let C={pages:0,assets:0,bytesInlined:0},v=p(M);if(v.length<2)return C;let q=new Map,g=new Map;for(let Q of v){let O=z.readFileSync(Q,"utf8");q.set(Q,O);let x=o(O);for(let U of O.matchAll(E)){let[w,V,J,$]=U;if(!m(V,J,$))continue;if(x.some(([A,k])=>U.index>=A&&U.index<k))continue;let H=`${V.toLowerCase()}\x00${$}`,X=g.get(H);if(X)X.push({file:Q,whole:w,tag:V,attrs:J,body:$});else g.set(H,[{file:Q,whole:w,tag:V,attrs:J,body:$}])}}let j=[...g.values()].filter((Q)=>new Set(Q.map((O)=>O.file)).size>1);if(j.length===0)return C;let G=P.join(M,Y),R=new Map(q),K=new Map,W=[];for(let Q of j){let{tag:O,body:x}=Q[0],U=O.toLowerCase()==="script",w=`${U?"chunk":"style"}.${b(x)}.${U?"js":"css"}`;W.push({filename:w,contents:x,contentType:U?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let V=`/${Y}/${w}`;for(let J of Q){let $=U?`<script${J.attrs} src="${V}"></script>`:`<link${J.attrs} rel="stylesheet" href="${V}">`,H=R.get(J.file),X=H.replace(J.whole,()=>$);if(X===H)continue;R.set(J.file,X),K.set(J.file,(K.get(J.file)??0)+J.body.length)}}z.mkdirSync(G,{recursive:!0});for(let Q of W)z.writeFileSync(P.join(G,Q.filename),Q.contents),C.assets++;for(let[Q,O]of R){if(O===q.get(Q))continue;z.writeFileSync(Q,O),C.pages++,C.bytesInlined+=K.get(Q)??0}return C}y();import Z from"fs";import F from"path";var h="layout-types.d.ts";function f(M){let C=[],v=(q,g)=>{let j;try{j=Z.readdirSync(q,{withFileTypes:!0})}catch{return}for(let G of j){if(G.name.startsWith("."))continue;let R=F.join(q,G.name);if(G.isDirectory())v(R,g?`${g}/${G.name}`:G.name);else if(G.isFile()&&G.name.endsWith(".stx")&&G.name!=="_layout.stx"){let K=G.name.slice(0,-4);C.push(g?`${g}/${K}`:K)}}};return v(M,""),C.sort()}function c(M){let C=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(M.length===0)return C.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),C.join(`
3
3
  `);return C.push("declare module '@stacksjs/stx' {"," interface KnownLayouts {",...M.map((v)=>` '${v}': true`)," }","}","","export {}",""),C.join(`
4
4
  `)}function HM(M,C){if(!M)return[];let v=F.isAbsolute(M)?M:F.resolve(process.cwd(),M),q=f(v),g=c(q),j=F.join(C,h);try{if(Z.existsSync(j)&&Z.readFileSync(j,"utf8")===g)return q;Z.mkdirSync(C,{recursive:!0}),Z.writeFileSync(j,g)}catch{}return q}
5
- export{Y as xk,_ as yk,a as zk,s as Ak,h as Bk,f as Ck,c as Dk,HM as Ek};
5
+ export{Y as yk,_ as zk,a as Ak,s as Bk,h as Ck,f as Dk,c as Ek,HM as Fk};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Aj as K,Bj as N,Cj as O,Dj as P,Ej as Q,Fj as T,Jj as U,Kj as V,Lj as W,Mj as Y}from"./chunk-fed3xsp9.js";import{pu as J}from"./chunk-6kdb8j9d.js";function $(){let w=q(Z());try{let z=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(w);return z=z.replace(/\}(var |let |const |function )/g,"};$1"),z}catch{return w}}function q(w){let E=[],z=0,I="console.log(";while(z<w.length){let F=w.indexOf(I,z);if(F===-1){E.push(w.slice(z));break}E.push(w.slice(z,F));let G=1,x=F+I.length;while(x<w.length&&G>0){let B=w[x];if(B==='"'||B==="'"||B==="`"){let _=B;x++;while(x<w.length&&w[x]!==_){if(w[x]==="\\")x++;x++}x++;continue}if(B==="(")G++;else if(B===")")G--;x++}E.push("0"),z=x}return E.join("")}function Z(){return`
2
+ import{Bj as K,Cj as N,Dj as O,Ej as P,Fj as Q,Gj as T,Kj as U,Lj as V,Mj as W,Nj as Y}from"./chunk-w8yac9xp.js";import{qu as J}from"./chunk-ze3qgdaf.js";function $(){let w=q(Z());try{let z=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(w);return z=z.replace(/\}(var |let |const |function )/g,"};$1"),z}catch{return w}}function q(w){let E=[],z=0,I="console.log(";while(z<w.length){let F=w.indexOf(I,z);if(F===-1){E.push(w.slice(z));break}E.push(w.slice(z,F));let G=1,x=F+I.length;while(x<w.length&&G>0){let B=w[x];if(B==='"'||B==="'"||B==="`"){let _=B;x++;while(x<w.length&&w[x]!==_){if(w[x]==="\\")x++;x++}x++;continue}if(B==="(")G++;else if(B===")")G--;x++}E.push("0"),z=x}return E.join("")}function Z(){return`
3
3
  // STX Signals Runtime (Development Build)
4
4
  console.log('[stx] signals runtime loading');
5
5
  // Pre-initialization shim: capture onMount/onDestroy calls made before the runtime IIFE runs
@@ -8205,4 +8205,4 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
8205
8205
  }
8206
8206
  })();
8207
8207
  `}var C={state:K,derived:N,effect:O,batch:P,onMount:Q,onDestroy:T,isSignal:U,isDerived:V,untrack:W,peek:Y,generateSignalsRuntime:$,generateSignalsRuntimeDev:Z};
8208
- export{$ as sj,Z as tj,C as uj};
8208
+ export{$ as tj,Z as uj,C as vj};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$h as c,Zh as a,_h as b,ai as d,bi as e,ci as f,di as g,ei as h,fi as i,gi as j,hi as k}from"./chunk-mywp77gt.js";import"./chunk-vwqv8f0y.js";export{i as processStaticDirectives,b as processPartialHydrationDirectives,h as onHydrated,g as isHydrated,d as hydrateIsland,e as hydrateByStrategy,f as hydrateAll,c as generatePartialHydrationCSS,j as generateIslandManifest,k as default,a as createIslandRegistry};
2
+ import{$h as b,_h as a,ai as c,bi as d,ci as e,di as f,ei as g,fi as h,gi as i,hi as j,ii as k}from"./chunk-3bc8bqw2.js";import"./chunk-6bcw8twx.js";export{i as processStaticDirectives,b as processPartialHydrationDirectives,h as onHydrated,g as isHydrated,d as hydrateIsland,e as hydrateByStrategy,f as hydrateAll,c as generatePartialHydrationCSS,j as generateIslandManifest,k as default,a as createIslandRegistry};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Rh as T}from"./chunk-pfwhd5xs.js";import{nv as I}from"./chunk-vwqv8f0y.js";import E from"fs";import X from"path";import U from"crypto";var _=new Set(["webp","avif","jpeg","png"]),F=new Set(["cover","contain","fill","inside","outside"]),A=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),S=4096,y=80,D="cover";async function g(k,G){let J=G.routePath??"/_stx/img",B=new URL(k.url);if(B.pathname!==J)return null;let $=q(B,G);if(!$.ok)return new Response($.error,{status:$.status,headers:{"Content-Type":"text/plain"}});let{srcFsPath:j,srcUrl:K,width:H,height:v,format:Z,quality:Y,fit:z}=$,C;try{C=E.statSync(j)}catch{return new Response(`Source image not found: ${K}`,{status:404,headers:{"Content-Type":"text/plain"}})}if(!C.isFile())return new Response("Not a file",{status:404,headers:{"Content-Type":"text/plain"}});let N=G.cacheDir??".stx/cache/img";await E.promises.mkdir(N,{recursive:!0});let V=`${j}:${C.mtimeMs}:${C.size}`,O=`${H}x${v}:${Z}:${Y}:${z}`,b=U.createHash("sha256").update(`${V}|${O}`).digest("hex").slice(0,16),Q=X.join(N,`${b}.${Z}`),W={"Content-Type":T(Z),"Cache-Control":"public, max-age=31536000, immutable",ETag:`"${b}"`,"X-Stx-Image-Cache":"HIT"};if(k.headers.get("if-none-match")===`"${b}"`)return new Response(null,{status:304,headers:W});let L=Bun.file(Q);if(await L.exists())return new Response(L,{headers:W});try{let R=Buffer.from(await Bun.file(j).arrayBuffer()),{resizeAndConvert:M}=await P(),w=await M(R,{width:H,height:v,format:Z,quality:Y,fit:z});return await Bun.write(Q,w),W["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(w),{headers:W})}catch(R){let M=R.message;return new Response(`Image processing failed: ${M}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function l(k){return async(G)=>{return await g(G,k)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}}function q(k,G){let J=k.searchParams.get("src");if(!J)return{ok:!1,error:"Missing required param: src",status:400};if(!J.startsWith("/"))return{ok:!1,error:"src must be an absolute URL path (start with /)",status:400};if(J.startsWith("//"))return{ok:!1,error:"src must be a local path",status:400};let B=X.extname(J).toLowerCase();if(!A.has(B))return{ok:!1,error:`Unsupported source extension: ${B}`,status:400};let $=X.resolve(G.publicDir),j=X.resolve($,J.slice(1));if(!j.startsWith(`${$}${X.sep}`)&&j!==$)return{ok:!1,error:"src is outside publicDir",status:400};let K=G.maxWidth??S,H=G.maxHeight??S,v=k.searchParams.get("w"),Z=k.searchParams.get("h"),Y=v?Number.parseInt(v,10):0,z=Z?Number.parseInt(Z,10):0;if(v&&(!Number.isFinite(Y)||Y<=0))return{ok:!1,error:"Invalid w (must be positive integer)",status:400};if(Z&&(!Number.isFinite(z)||z<=0))return{ok:!1,error:"Invalid h (must be positive integer)",status:400};if(!v&&!Z)return{ok:!1,error:"At least one of w or h is required",status:400};let C=Math.min(Y||K,K),N=Math.min(z||H,H),V=k.searchParams.get("f")||"webp";if(!_.has(V))return{ok:!1,error:`Invalid f (must be one of: ${[..._].join(", ")})`,status:400};let O=V,b=k.searchParams.get("q"),Q=b?Number.parseInt(b,10):G.defaultQuality??y;if(!Number.isFinite(Q)||Q<1||Q>100)return{ok:!1,error:"Invalid q (must be 1-100)",status:400};let x=k.searchParams.get("fit")||G.defaultFit||D;if(!F.has(x))return{ok:!1,error:`Invalid fit (must be one of: ${[...F].join(", ")})`,status:400};return{ok:!0,srcFsPath:j,srcUrl:J,width:C,height:N,format:O,quality:Q,fit:x}}async function P(){return await import("./chunk-mdd9yk4f.js")}
3
- export{g as Kg,l as Lg};
2
+ import{Sh as T}from"./chunk-x14vvxfh.js";import{ov as I}from"./chunk-6bcw8twx.js";import E from"fs";import X from"path";import U from"crypto";var _=new Set(["webp","avif","jpeg","png"]),F=new Set(["cover","contain","fill","inside","outside"]),A=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),S=4096,y=80,D="cover";async function g(k,G){let J=G.routePath??"/_stx/img",B=new URL(k.url);if(B.pathname!==J)return null;let $=q(B,G);if(!$.ok)return new Response($.error,{status:$.status,headers:{"Content-Type":"text/plain"}});let{srcFsPath:j,srcUrl:K,width:H,height:v,format:Z,quality:Y,fit:z}=$,C;try{C=E.statSync(j)}catch{return new Response(`Source image not found: ${K}`,{status:404,headers:{"Content-Type":"text/plain"}})}if(!C.isFile())return new Response("Not a file",{status:404,headers:{"Content-Type":"text/plain"}});let N=G.cacheDir??".stx/cache/img";await E.promises.mkdir(N,{recursive:!0});let V=`${j}:${C.mtimeMs}:${C.size}`,O=`${H}x${v}:${Z}:${Y}:${z}`,b=U.createHash("sha256").update(`${V}|${O}`).digest("hex").slice(0,16),Q=X.join(N,`${b}.${Z}`),W={"Content-Type":T(Z),"Cache-Control":"public, max-age=31536000, immutable",ETag:`"${b}"`,"X-Stx-Image-Cache":"HIT"};if(k.headers.get("if-none-match")===`"${b}"`)return new Response(null,{status:304,headers:W});let L=Bun.file(Q);if(await L.exists())return new Response(L,{headers:W});try{let R=Buffer.from(await Bun.file(j).arrayBuffer()),{resizeAndConvert:M}=await P(),w=await M(R,{width:H,height:v,format:Z,quality:Y,fit:z});return await Bun.write(Q,w),W["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(w),{headers:W})}catch(R){let M=R.message;return new Response(`Image processing failed: ${M}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function l(k){return async(G)=>{return await g(G,k)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}}function q(k,G){let J=k.searchParams.get("src");if(!J)return{ok:!1,error:"Missing required param: src",status:400};if(!J.startsWith("/"))return{ok:!1,error:"src must be an absolute URL path (start with /)",status:400};if(J.startsWith("//"))return{ok:!1,error:"src must be a local path",status:400};let B=X.extname(J).toLowerCase();if(!A.has(B))return{ok:!1,error:`Unsupported source extension: ${B}`,status:400};let $=X.resolve(G.publicDir),j=X.resolve($,J.slice(1));if(!j.startsWith(`${$}${X.sep}`)&&j!==$)return{ok:!1,error:"src is outside publicDir",status:400};let K=G.maxWidth??S,H=G.maxHeight??S,v=k.searchParams.get("w"),Z=k.searchParams.get("h"),Y=v?Number.parseInt(v,10):0,z=Z?Number.parseInt(Z,10):0;if(v&&(!Number.isFinite(Y)||Y<=0))return{ok:!1,error:"Invalid w (must be positive integer)",status:400};if(Z&&(!Number.isFinite(z)||z<=0))return{ok:!1,error:"Invalid h (must be positive integer)",status:400};if(!v&&!Z)return{ok:!1,error:"At least one of w or h is required",status:400};let C=Math.min(Y||K,K),N=Math.min(z||H,H),V=k.searchParams.get("f")||"webp";if(!_.has(V))return{ok:!1,error:`Invalid f (must be one of: ${[..._].join(", ")})`,status:400};let O=V,b=k.searchParams.get("q"),Q=b?Number.parseInt(b,10):G.defaultQuality??y;if(!Number.isFinite(Q)||Q<1||Q>100)return{ok:!1,error:"Invalid q (must be 1-100)",status:400};let x=k.searchParams.get("fit")||G.defaultFit||D;if(!F.has(x))return{ok:!1,error:`Invalid fit (must be one of: ${[...F].join(", ")})`,status:400};return{ok:!0,srcFsPath:j,srcUrl:J,width:C,height:N,format:O,quality:Q,fit:x}}async function P(){return await import("./chunk-qx1zbx35.js")}
3
+ export{g as Lg,l as Mg};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  import{existsSync as U,statSync as V}from"fs";import z from"path";var W=/[*?[\]{}]/;function X(D){return W.test(D)}async function $(D,E={}){let H=E.cwd??process.cwd(),N=E.recursive!==!1,Q=E.ignorePaths??[],J=globalThis.Bun.Glob,K=new Set,F=(j)=>{if(j.includes(`${z.sep}node_modules${z.sep}`)||j.includes(`${z.sep}dist${z.sep}`))return;if(Q.some((q)=>q&&j.includes(z.normalize(q))))return;K.add(j)},R=async(j)=>{try{for await(let q of new J(j).scan({cwd:H,absolute:!0}))F(q)}catch{}};for(let j of D){if(!j)continue;if(X(j)){await R(j);continue}let q=z.resolve(H,j);if(!U(q))continue;if(V(q).isDirectory()){for await(let T of new J(N?"**/*.stx":"*.stx").scan({cwd:q,absolute:!0}))F(T);continue}F(q)}return[...K].sort()}
3
- export{X as Zs,$ as _s};
3
+ export{X as _s,$ as $s};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{rm as I}from"./chunk-6z04mpxz.js";import{$r as F,ds as V}from"./chunk-3mbkn6vk.js";function R(j,W){let U=1,z=W,G="<template",X="</template";while(z<j.length&&U>0){let J=j.indexOf("<",z);if(J===-1)break;if(z=J,j.startsWith(G,z)&&(z+G.length>=j.length||/[\s>\/]/.test(j[z+G.length]))){U++,z+=G.length;continue}if(j.startsWith(X,z)){let Y=j.indexOf(">",z+X.length);if(Y!==-1){if(U--,U===0)return Y+1;z=Y+1;continue}}z++}return U===0?z:-1}var P=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function D(j,W){let U=null;for(let z=W;z<j.length;z++){let G=j[z];if(U){if(G==="\\"){z++;continue}if(G===U)U=null;continue}if(G==='"'||G==="'"){U=G;continue}if(G===">")return z+1}return-1}function b(j){let W=[],U=[],z=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,G=0;while(G<j.length){let X=j.indexOf("<",G);if(X===-1)break;if(j.startsWith("<!--",X)){let $=j.indexOf("-->",X+4);G=$===-1?j.length:$+3;continue}let J=D(j,X+1);if(J===-1)break;let Y=j.slice(X,J),Q=Y.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!Q){G=J;continue}let Z=Q[1]==="/",H=Q[2].toLowerCase();if(Z){let $=U.lastIndexOf(H);if($!==-1)U.splice($);G=J;continue}if(H==="template"&&U.length===0){let $=Y.match(z);if($){let K=R(j,J);if(K!==-1){let O=$[1]||$[2]||$[3];W.push({start:X,end:K,slotName:O,content:j.slice(J,K-11).trim(),propsBinding:$[4]||void 0}),G=K;continue}}}if(!/\/\s*>$/.test(Y)&&!P.has(H)){if(U.push(H),H==="script"||H==="style"){let $=j.toLowerCase().indexOf(`</${H}>`,J);if($!==-1){G=$;continue}}}G=J}return W}function w(j){let W={default:"",named:new Map},U=j,z=b(j);for(let Q of z)W.named.set(Q.slotName,{name:Q.slotName,content:Q.content,propsBinding:Q.propsBinding});z.sort((Q,Z)=>Z.start-Q.start);for(let Q of z)U=U.slice(0,Q.start)+U.slice(Q.end);let G=[],X=/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*?)\bslot="([^"]+)"([^>]*)>([\s\S]*?)<\/\1>/gi,J;while((J=X.exec(U))!==null){let[Q,Z,H,_,$,K]=J,O=H.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),B=$.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),L=(O+B).trim(),q=`<${Z}${L?" "+L:""}>${K}</${Z}>`;G.push({start:J.index,end:J.index+Q.length,slotName:_,element:q})}let Y=/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*?)\bslot="([^"]+)"([^>]*?)\/>/gi;while((J=Y.exec(U))!==null){let[Q,Z,H,_,$]=J,K=H.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),O=$.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),B=(K+O).trim(),L=`<${Z}${B?" "+B:""} />`;G.push({start:J.index,end:J.index+Q.length,slotName:_,element:L})}G.sort((Q,Z)=>Z.start-Q.start);for(let Q of G){let Z=W.named.get(Q.slotName);if(Z)Z.content+=Q.element;else W.named.set(Q.slotName,{name:Q.slotName,content:Q.element});U=U.slice(0,Q.start)+U.slice(Q.end)}return W.default=U.trim(),W}function C(j){let W=j.match(/name\s*=\s*["']([^"']+)["']/),U=W?W[1]:"",z={},G=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,X;while((X=G.exec(j))!==null)z[X[1]]=X[2];let J=j.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),Y=J?J[1].trim():"";return{name:U,props:z,defaultContent:Y}}async function N(j,W,U,z){if(!j)return U;let G=j.content;if(j.propsBinding&&Object.keys(W).length>0){let X=j.propsBinding.trim(),J={...z};if(X.startsWith("{")&&X.endsWith("}")){let Y=X.slice(1,-1).split(",").map((Q)=>Q.trim()).filter(Boolean);for(let Q of Y){let[Z,H]=Q.split(":").map(($)=>$.trim()),_=H||Z;if(W[Z]!==void 0)J[_]=W[Z]}}else J[X]=W;G=k(G,J)}return G}function k(j,W){return j.replace(/\{\{\s*([^}]+)\s*\}\}/g,(U,z)=>{try{let G=z.trim(),X=y(G,W);return I(String(X??""))}catch{return`{{ ${z} }}`}})}function y(j,W){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(j)){let z=j.split("."),G=W;for(let X of z)if(G&&typeof G==="object"&&X in G)G=G[X];else return;return G}let U=j.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(U){let[,z,G,X]=U,J=W[z],Y=parseInt(X,10);if(typeof J==="number")switch(G){case"+":return J+Y;case"-":return J-Y;case"*":return J*Y;case"/":return J/Y}}try{if(!F(j))return;return V(j,Object.keys(W))(...Object.values(W))}catch{return}}async function A(j,W,U){let z=j;z=await v(z,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(J,Y,Q,Z)=>{let H=W.named.get(Y),_=Z?.trim()||"",$=Q||"",K={},O=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,B;while((B=O.exec($))!==null){let L=B[1],q=B[2];K[L]=y(q,U)}return await N(H,K,_,U)});let X=/<slot\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return z=z.replace(X,(J,Y)=>{if(J.includes("name="))return J;let Q=Y?.trim()||"";return W.default||Q}),z}async function v(j,W,U){let z=[],G=[];j.replace(W,(Y,...Q)=>{let Z=Q[Q.length-2];return G.push({match:Y,index:Z}),z.push(U(Y,...Q.slice(0,-2))),Y});let X=await Promise.all(z),J=j;for(let Y=G.length-1;Y>=0;Y--){let{match:Q,index:Z}=G[Y];J=J.slice(0,Z)+X[Y]+J.slice(Z+Q.length)}return J}function E(j){let W=w(j);return{defaultSlot:W.default,namedSlots:W.named}}async function M(j,W,U,z){return await A(j,{default:W,named:U},z)}
3
- export{w as Ng,C as Og,N as Pg,A as Qg,E as Rg,M as Sg};
2
+ import{sm as I}from"./chunk-17389q0t.js";import{as as F,es as V}from"./chunk-6xbscz34.js";function R(j,W){let U=1,z=W,G="<template",X="</template";while(z<j.length&&U>0){let J=j.indexOf("<",z);if(J===-1)break;if(z=J,j.startsWith(G,z)&&(z+G.length>=j.length||/[\s>\/]/.test(j[z+G.length]))){U++,z+=G.length;continue}if(j.startsWith(X,z)){let Y=j.indexOf(">",z+X.length);if(Y!==-1){if(U--,U===0)return Y+1;z=Y+1;continue}}z++}return U===0?z:-1}var P=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function D(j,W){let U=null;for(let z=W;z<j.length;z++){let G=j[z];if(U){if(G==="\\"){z++;continue}if(G===U)U=null;continue}if(G==='"'||G==="'"){U=G;continue}if(G===">")return z+1}return-1}function b(j){let W=[],U=[],z=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,G=0;while(G<j.length){let X=j.indexOf("<",G);if(X===-1)break;if(j.startsWith("<!--",X)){let $=j.indexOf("-->",X+4);G=$===-1?j.length:$+3;continue}let J=D(j,X+1);if(J===-1)break;let Y=j.slice(X,J),Q=Y.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!Q){G=J;continue}let Z=Q[1]==="/",H=Q[2].toLowerCase();if(Z){let $=U.lastIndexOf(H);if($!==-1)U.splice($);G=J;continue}if(H==="template"&&U.length===0){let $=Y.match(z);if($){let K=R(j,J);if(K!==-1){let O=$[1]||$[2]||$[3];W.push({start:X,end:K,slotName:O,content:j.slice(J,K-11).trim(),propsBinding:$[4]||void 0}),G=K;continue}}}if(!/\/\s*>$/.test(Y)&&!P.has(H)){if(U.push(H),H==="script"||H==="style"){let $=j.toLowerCase().indexOf(`</${H}>`,J);if($!==-1){G=$;continue}}}G=J}return W}function w(j){let W={default:"",named:new Map},U=j,z=b(j);for(let Q of z)W.named.set(Q.slotName,{name:Q.slotName,content:Q.content,propsBinding:Q.propsBinding});z.sort((Q,Z)=>Z.start-Q.start);for(let Q of z)U=U.slice(0,Q.start)+U.slice(Q.end);let G=[],X=/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*?)\bslot="([^"]+)"([^>]*)>([\s\S]*?)<\/\1>/gi,J;while((J=X.exec(U))!==null){let[Q,Z,H,_,$,K]=J,O=H.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),B=$.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),L=(O+B).trim(),q=`<${Z}${L?" "+L:""}>${K}</${Z}>`;G.push({start:J.index,end:J.index+Q.length,slotName:_,element:q})}let Y=/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*?)\bslot="([^"]+)"([^>]*?)\/>/gi;while((J=Y.exec(U))!==null){let[Q,Z,H,_,$]=J,K=H.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),O=$.replace(/\s*slot="[^"]*"\s*/," ").trimEnd(),B=(K+O).trim(),L=`<${Z}${B?" "+B:""} />`;G.push({start:J.index,end:J.index+Q.length,slotName:_,element:L})}G.sort((Q,Z)=>Z.start-Q.start);for(let Q of G){let Z=W.named.get(Q.slotName);if(Z)Z.content+=Q.element;else W.named.set(Q.slotName,{name:Q.slotName,content:Q.element});U=U.slice(0,Q.start)+U.slice(Q.end)}return W.default=U.trim(),W}function C(j){let W=j.match(/name\s*=\s*["']([^"']+)["']/),U=W?W[1]:"",z={},G=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,X;while((X=G.exec(j))!==null)z[X[1]]=X[2];let J=j.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),Y=J?J[1].trim():"";return{name:U,props:z,defaultContent:Y}}async function N(j,W,U,z){if(!j)return U;let G=j.content;if(j.propsBinding&&Object.keys(W).length>0){let X=j.propsBinding.trim(),J={...z};if(X.startsWith("{")&&X.endsWith("}")){let Y=X.slice(1,-1).split(",").map((Q)=>Q.trim()).filter(Boolean);for(let Q of Y){let[Z,H]=Q.split(":").map(($)=>$.trim()),_=H||Z;if(W[Z]!==void 0)J[_]=W[Z]}}else J[X]=W;G=k(G,J)}return G}function k(j,W){return j.replace(/\{\{\s*([^}]+)\s*\}\}/g,(U,z)=>{try{let G=z.trim(),X=y(G,W);return I(String(X??""))}catch{return`{{ ${z} }}`}})}function y(j,W){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(j)){let z=j.split("."),G=W;for(let X of z)if(G&&typeof G==="object"&&X in G)G=G[X];else return;return G}let U=j.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(U){let[,z,G,X]=U,J=W[z],Y=parseInt(X,10);if(typeof J==="number")switch(G){case"+":return J+Y;case"-":return J-Y;case"*":return J*Y;case"/":return J/Y}}try{if(!F(j))return;return V(j,Object.keys(W))(...Object.values(W))}catch{return}}async function A(j,W,U){let z=j;z=await v(z,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(J,Y,Q,Z)=>{let H=W.named.get(Y),_=Z?.trim()||"",$=Q||"",K={},O=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,B;while((B=O.exec($))!==null){let L=B[1],q=B[2];K[L]=y(q,U)}return await N(H,K,_,U)});let X=/<slot\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return z=z.replace(X,(J,Y)=>{if(J.includes("name="))return J;let Q=Y?.trim()||"";return W.default||Q}),z}async function v(j,W,U){let z=[],G=[];j.replace(W,(Y,...Q)=>{let Z=Q[Q.length-2];return G.push({match:Y,index:Z}),z.push(U(Y,...Q.slice(0,-2))),Y});let X=await Promise.all(z),J=j;for(let Y=G.length-1;Y>=0;Y--){let{match:Q,index:Z}=G[Y];J=J.slice(0,Z)+X[Y]+J.slice(Z+Q.length)}return J}function E(j){let W=w(j);return{defaultSlot:W.default,namedSlots:W.named}}async function M(j,W,U,z){return await A(j,{default:W,named:U},z)}
3
+ export{w as Og,C as Pg,N as Qg,A as Rg,E as Sg,M as Tg};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-vwqv8f0y.js";var N=0;function P(){return`eb-${++N}-${Date.now().toString(36)}`}function W(q,z={},A){let j=/@errorBoundary(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@enderrorBoundary/gi;return q.replace(j,(D,F,J,K)=>{let L=P(),M=Q(F||"");return T(L,J.trim(),K.trim(),M)})}function Q(q){let z={},A=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\w+))/g,j;while((j=A.exec(q))!==null){let D=j[1],F=j[2]||j[3]||j[4];switch(D){case"id":z.id=F;break;case"logErrors":z.logErrors=F==="true";break}}return z}function T(q,z,A,j){let D=j.logErrors!==!1;return`
2
+ import"./chunk-6bcw8twx.js";var N=0;function P(){return`eb-${++N}-${Date.now().toString(36)}`}function W(q,z={},A){let j=/@errorBoundary(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@enderrorBoundary/gi;return q.replace(j,(D,F,J,K)=>{let L=P(),M=Q(F||"");return T(L,J.trim(),K.trim(),M)})}function Q(q){let z={},A=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\w+))/g,j;while((j=A.exec(q))!==null){let D=j[1],F=j[2]||j[3]||j[4];switch(D){case"id":z.id=F;break;case"logErrors":z.logErrors=F==="true";break}}return z}function T(q,z,A,j){let D=j.logErrors!==!1;return`
3
3
  <div class="stx-error-boundary" data-boundary-id="${q}" data-has-error="false">
4
4
  <div class="stx-error-boundary-content" data-boundary-content="${q}">
5
5
  ${z}
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{ag as t,bg as e,dg as b,mg as JJ}from"./chunk-tt50t72e.js";import{Pm as u,Qm as l,eo as o,im as y,jm as P,sm as x,xo as g,zm as v}from"./chunk-6z04mpxz.js";import{$u as s,dv as OJ,yu as a}from"./chunk-jmh31a2a.js";import{nv as R}from"./chunk-vwqv8f0y.js";import r from"fs";import B from"path";var{serve:IJ}=globalThis.Bun;function q(J,K,Q={}){let X=`${encodeURIComponent(J)}=${encodeURIComponent(K)}`;if(Q.maxAge!==void 0)X+=`; Max-Age=${Q.maxAge}`;if(Q.expires)X+=`; Expires=${Q.expires.toUTCString()}`;if(Q.path)X+=`; Path=${Q.path}`;if(Q.domain)X+=`; Domain=${Q.domain}`;if(Q.secure)X+="; Secure";if(Q.httpOnly)X+="; HttpOnly";if(Q.sameSite)X+=`; SameSite=${Q.sameSite}`;return X}async function KJ(J){let K=J.headers.get("content-type")||"",Q={},X=(Z,$)=>{let G=Q[Z];if(G===void 0)Q[Z]=$;else if(Array.isArray(G))G.push($);else Q[Z]=[G,$]};if(K.includes("multipart/form-data")){let Z=await J.formData();for(let[$,G]of Z.entries())if(typeof G==="string")X($,G);return Q}if(K.includes("application/x-www-form-urlencoded")){for(let[Z,$]of new URLSearchParams(await J.text()).entries())X(Z,$);return Q}return Q}function f(J){if(!J)return!1;let K=J.toUpperCase();return K!=="GET"&&K!=="HEAD"}async function h(J,K={}){let Q=K.request,X=K.method??Q?.method;if(!Q||!f(X))return{ran:!1};if(typeof J.action!=="function")return{ran:!1};let Z={};try{Z=await KJ(Q)}catch{}let $=await J.action({request:Q,form:Z,params:K.params??{},query:J.query??{},cookies:K.cookies??{}});if($&&typeof $==="object"){let G=$,W=QJ(G.cookies),I=G.redirect;if(typeof I==="string"&&I)return{redirect:I,ran:!0,...W.length>0?{cookies:W}:{}};let{cookies:_,redirect:N,...U}=G;if(Object.assign(J,U),W.length>0)return{ran:!0,cookies:W}}return{ran:!0}}function QJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return[];let K=[];for(let[Q,X]of Object.entries(J)){if(!Q)continue;if(typeof X==="string"){K.push(q(Q,X));continue}if(X&&typeof X==="object"){let Z=X;if(typeof Z.value!=="string")continue;K.push(q(Q,Z.value,Z))}}return K}function m(J,K=[],Q){let X=new Headers({Location:J,"Cache-Control":"no-store"});for(let Z of K)X.append("Set-Cookie",Z);for(let[Z,$]of Object.entries(Q??{}))if(Z.toLowerCase()!=="location")X.set(Z,$);return new Response(null,{status:303,headers:X})}async function wJ(J,K={}){return(await c(J,K)).html}async function d(J,K={}){let{html:Q,context:X,redirect:Z,cookies:$}=await c(J,K),G=u(X),W=l(X);if(Z)return{html:Q,redirect:Z,cookies:$,status:G,headers:W};let{extractStreamBoundaries:I}=await import("./chunk-7ncfmg13.js"),_=I(X),N=J.streamTemplates;if(N&&Object.keys(N).length>0){let{processDirectives:U}=await import("./chunk-vt31an48.js"),{defaultConfig:z}=await import("./chunk-b24chdr8.js"),O=X.streamBoundaries||{},w={...z,autoShell:!1},D=Object.keys(N).map((V)=>({id:V,render:async()=>{let F=typeof O[V]==="function"?await O[V]():void 0;return U(N[V],{...X,$boundary:F},J.sourceFile,w,new Set)}})),E=new Set(D.map((V)=>V.id));_=[...(_||[]).filter((V)=>!E.has(V.id)),...D]}return{html:Q,boundaries:_&&_.length>0?_:void 0,cookies:$,status:G,headers:W}}async function c(J,K){let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};if(!J.hasServerScripts&&!P(J.html))return{html:J.html,context:Q};for(let $ of J.serverScriptContent)try{await g($,Q,J.sourceFile)}catch(G){console.warn(`[stx] Server script error in ${J.sourceFile}:`,G)}let X=await h(Q,{request:K.request,method:K.method,params:K.params??{},cookies:K.cookies??{}});if(X.redirect)return{html:J.html,context:Q,redirect:X.redirect,cookies:X.cookies};if(!P(J.html))return{html:J.html,context:Q,cookies:X.cookies};let Z=new Map;for(let[$,G]of Object.entries(J.placeholders))if(G.expression)try{let W=v(G.expression,Q);if(G.type==="raw")Z.set($,W!==void 0&&W!==null?String(W):"");else Z.set($,W!==void 0&&W!==null?x(String(W)):"")}catch{Z.set($,"")}return{html:y(J.html,Z),context:Q,cookies:X.cookies}}async function AJ(J,K={}){if(!J.hasServerScripts&&!P(J.fragment))return J.fragment;let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};for(let Z of J.serverScriptContent)try{await g(Z,Q,J.sourceFile)}catch($){console.warn(`[stx] Server script error in ${J.sourceFile}:`,$)}if(!P(J.fragment))return J.fragment;let X=new Map;for(let[Z,$]of Object.entries(J.placeholders))if($.expression)try{let G=v($.expression,Q);if($.type==="raw")X.set(Z,G!==void 0&&G!==null?String(G):"");else X.set(Z,G!==void 0&&G!==null?x(String(G)):"")}catch{X.set(Z,"")}return y(J.fragment,X)}OJ();import C from"zlib";import{promisify as n}from"util";var XJ=n(C.brotliCompress),ZJ=n(C.gzip),$J=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],GJ=["text/event-stream","multipart/x-mixed-replace"],UJ=1024;function WJ(J){if(!J)return!1;let K=J.toLowerCase();if(GJ.some((Q)=>K.startsWith(Q)))return!1;return $J.some((Q)=>K.startsWith(Q))}function jJ(J){let K=new Map;for(let Q of J.split(",")){let[X,...Z]=Q.trim().split(";"),$=X.trim().toLowerCase();if(!$)continue;let G=1;for(let W of Z){let I=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(W);if(!I)continue;let _=Number.parseFloat(I[1]);if(Number.isFinite(_))G=_}K.set($,G)}return K}function YJ(J){if(!J)return null;let K=jJ(J),Q=K.get("*"),X=(Z)=>K.get(Z)??Q??0;if(X("br")>0)return"br";if(X("gzip")>0)return"gzip";return null}async function i(J,K,Q={}){if(K.headers.get("content-encoding"))return K;if(K.status===204||K.status===304||!K.body)return K;if(!WJ(K.headers.get("content-type")))return K;let X=YJ(J.headers.get("accept-encoding"));if(!X)return K;let Z;try{Z=new Uint8Array(await K.arrayBuffer())}catch{return K}let $=()=>new Response(Z,{status:K.status,statusText:K.statusText,headers:p(K.headers)});if(Z.length<(Q.threshold??UJ))return $();try{let G=X==="br"?await XJ(Z,{params:{[C.constants.BROTLI_PARAM_QUALITY]:Q.quality??5,[C.constants.BROTLI_PARAM_SIZE_HINT]:Z.length}}):await ZJ(Z);if(G.length>=Z.length)return $();let W=p(K.headers);return W.set("Content-Encoding",X),W.set("Content-Length",String(G.length)),new Response(G,{status:K.status,statusText:K.statusText,headers:W})}catch{return $()}}function p(J){let K=new Headers(J),Q=K.get("Vary");if(!Q)return K.set("Vary","Accept-Encoding"),K;if(!Q.split(",").some((Z)=>Z.trim().toLowerCase()==="accept-encoding"))K.set("Vary",`${Q}, Accept-Encoding`);return K}var _J={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function mJ(J={}){let K=B.resolve(J.outputDir||".output"),Q=J.port||3000,X=JJ(K);if(!X)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${X.routes.length} routes...`);let Z=new Map,$=new Map,G=new Map,W=new Map;for(let U of X.routes)try{let z=B.join(K,U.compiledPath),O=JSON.parse(await Bun.file(z).text());Z.set(U.pattern,O),G.set(U.pattern,s(O.html)),W.set(U.pattern,o(O.html));let w=B.join(K,U.fragmentPath);if(await Bun.file(w).exists())$.set(U.pattern,await Bun.file(w).text())}catch(z){console.warn(`[stx] Failed to load route ${U.pattern}:`,z)}let I=new Map,_=[];for(let U of X.routes)if(U.hasParams){let{regex:z,params:O}=a(U.pattern);_.push({regex:z,route:U,paramNames:O})}else I.set(U.pattern,U);let N=IJ({port:Q,async fetch(U){return i(U,await(async()=>{let O=new URL(U.url).pathname;if(J.onRequest){let j=await J.onRequest(U);if(j)return j}if(J.apiRoutes?.[O])return J.apiRoutes[O](U);if((U.method==="GET"||U.method==="HEAD")&&O!=="/"){let j=B.resolve(K,"public"),Y;try{Y=decodeURIComponent(O)}catch{Y=O}if(!Y.includes("\x00")){let L=B.resolve(j,`.${Y}`);if(L===j||L.startsWith(`${j}${B.sep}`))try{if(r.existsSync(L)&&r.statSync(L).isFile()){let M=B.extname(L).toLowerCase(),S=_J[M]||"application/octet-stream",H=O.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(O);return new Response(Bun.file(L),{headers:{"Content-Type":S,"Cache-Control":H?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let w=e(U),D=null,E={};if(D=I.get(O)||null,!D)for(let{regex:j,route:Y,paramNames:L}of _){let A=O.match(j);if(A){D=Y,L.forEach((M,S)=>{E[M]=A[S+1]});break}}if(!D){let j=I.get("/404")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}if(w){let j=$.get(D.pattern);if(j){let Y=G.get(D.pattern);return new Response(j,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...W.has(D.pattern)?{"X-STX-Runtime":W.get(D.pattern)?"true":"false"}:{},...Y?{"X-STX-Layout":Y.layout,"X-STX-Layout-Group":Y.group}:{},...b(),"Cache-Control":t}})}}let V=f(U.method),F=Z.get(D.pattern);if(!F){let j=I.get("/500")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(!V&&!F.hasServerScripts&&Object.keys(F.placeholders).length===0)return new Response(F.html,{status:F.status??200,headers:{"Content-Type":"text/html",...b(),"Cache-Control":"public, max-age=60"}});try{let{html:j,boundaries:Y,redirect:L,cookies:A,status:M,headers:S}=await d(F,{params:E,request:U,method:U.method});if(L)return m(L,A,S);if(Y&&Y.length>0){let{renderStreamingPage:T,streamToResponse:k}=await import("./chunk-7ncfmg13.js");return k(T(j,Y,{timeoutMs:30000}),{status:M??F.status??200,headers:{"Cache-Control":"no-cache",...S}})}let H=new Headers({"Content-Type":"text/html",...b(),"Cache-Control":"no-cache"});for(let T of A??[])H.append("Set-Cookie",T);for(let[T,k]of Object.entries(S??{}))H.set(T,k);return new Response(j,{status:M??F.status??200,headers:H})}catch(j){return console.error(`[stx] Hydration error for ${O}:`,j),new Response(F.html,{headers:{"Content-Type":"text/html"}})}})())}});return console.log(`[stx] Production server running at http://localhost:${Q}`),console.log(`[stx] Serving ${X.routes.length} routes (${Z.size} pre-loaded)`),{port:Q,stop:()=>N.stop()}}
2
+ import{ag as t,cg as e,eg as b,ng as JJ}from"./chunk-trpmf02p.js";import{Am as v,Qm as u,Rm as l,fo as o,jm as y,km as P,tm as x,yo as g}from"./chunk-17389q0t.js";import{av as s,ev as OJ,zu as a}from"./chunk-54fnvfp1.js";import{ov as R}from"./chunk-6bcw8twx.js";import r from"fs";import B from"path";var{serve:IJ}=globalThis.Bun;function q(J,K,Q={}){let X=`${encodeURIComponent(J)}=${encodeURIComponent(K)}`;if(Q.maxAge!==void 0)X+=`; Max-Age=${Q.maxAge}`;if(Q.expires)X+=`; Expires=${Q.expires.toUTCString()}`;if(Q.path)X+=`; Path=${Q.path}`;if(Q.domain)X+=`; Domain=${Q.domain}`;if(Q.secure)X+="; Secure";if(Q.httpOnly)X+="; HttpOnly";if(Q.sameSite)X+=`; SameSite=${Q.sameSite}`;return X}async function KJ(J){let K=J.headers.get("content-type")||"",Q={},X=(Z,$)=>{let G=Q[Z];if(G===void 0)Q[Z]=$;else if(Array.isArray(G))G.push($);else Q[Z]=[G,$]};if(K.includes("multipart/form-data")){let Z=await J.formData();for(let[$,G]of Z.entries())if(typeof G==="string")X($,G);return Q}if(K.includes("application/x-www-form-urlencoded")){for(let[Z,$]of new URLSearchParams(await J.text()).entries())X(Z,$);return Q}return Q}function f(J){if(!J)return!1;let K=J.toUpperCase();return K!=="GET"&&K!=="HEAD"}async function h(J,K={}){let Q=K.request,X=K.method??Q?.method;if(!Q||!f(X))return{ran:!1};if(typeof J.action!=="function")return{ran:!1};let Z={};try{Z=await KJ(Q)}catch{}let $=await J.action({request:Q,form:Z,params:K.params??{},query:J.query??{},cookies:K.cookies??{}});if($&&typeof $==="object"){let G=$,W=QJ(G.cookies),I=G.redirect;if(typeof I==="string"&&I)return{redirect:I,ran:!0,...W.length>0?{cookies:W}:{}};let{cookies:_,redirect:N,...U}=G;if(Object.assign(J,U),W.length>0)return{ran:!0,cookies:W}}return{ran:!0}}function QJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return[];let K=[];for(let[Q,X]of Object.entries(J)){if(!Q)continue;if(typeof X==="string"){K.push(q(Q,X));continue}if(X&&typeof X==="object"){let Z=X;if(typeof Z.value!=="string")continue;K.push(q(Q,Z.value,Z))}}return K}function m(J,K=[],Q){let X=new Headers({Location:J,"Cache-Control":"no-store"});for(let Z of K)X.append("Set-Cookie",Z);for(let[Z,$]of Object.entries(Q??{}))if(Z.toLowerCase()!=="location")X.set(Z,$);return new Response(null,{status:303,headers:X})}async function wJ(J,K={}){return(await c(J,K)).html}async function d(J,K={}){let{html:Q,context:X,redirect:Z,cookies:$}=await c(J,K),G=u(X),W=l(X);if(Z)return{html:Q,redirect:Z,cookies:$,status:G,headers:W};let{extractStreamBoundaries:I}=await import("./chunk-sprn2n68.js"),_=I(X),N=J.streamTemplates;if(N&&Object.keys(N).length>0){let{processDirectives:U}=await import("./chunk-ky8g0n1e.js"),{defaultConfig:z}=await import("./chunk-h58zg4p4.js"),O=X.streamBoundaries||{},w={...z,autoShell:!1},D=Object.keys(N).map((V)=>({id:V,render:async()=>{let F=typeof O[V]==="function"?await O[V]():void 0;return U(N[V],{...X,$boundary:F},J.sourceFile,w,new Set)}})),E=new Set(D.map((V)=>V.id));_=[...(_||[]).filter((V)=>!E.has(V.id)),...D]}return{html:Q,boundaries:_&&_.length>0?_:void 0,cookies:$,status:G,headers:W}}async function c(J,K){let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};if(!J.hasServerScripts&&!P(J.html))return{html:J.html,context:Q};for(let $ of J.serverScriptContent)try{await g($,Q,J.sourceFile)}catch(G){console.warn(`[stx] Server script error in ${J.sourceFile}:`,G)}let X=await h(Q,{request:K.request,method:K.method,params:K.params??{},cookies:K.cookies??{}});if(X.redirect)return{html:J.html,context:Q,redirect:X.redirect,cookies:X.cookies};if(!P(J.html))return{html:J.html,context:Q,cookies:X.cookies};let Z=new Map;for(let[$,G]of Object.entries(J.placeholders))if(G.expression)try{let W=v(G.expression,Q);if(G.type==="raw")Z.set($,W!==void 0&&W!==null?String(W):"");else Z.set($,W!==void 0&&W!==null?x(String(W)):"")}catch{Z.set($,"")}return{html:y(J.html,Z),context:Q,cookies:X.cookies}}async function AJ(J,K={}){if(!J.hasServerScripts&&!P(J.fragment))return J.fragment;let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};for(let Z of J.serverScriptContent)try{await g(Z,Q,J.sourceFile)}catch($){console.warn(`[stx] Server script error in ${J.sourceFile}:`,$)}if(!P(J.fragment))return J.fragment;let X=new Map;for(let[Z,$]of Object.entries(J.placeholders))if($.expression)try{let G=v($.expression,Q);if($.type==="raw")X.set(Z,G!==void 0&&G!==null?String(G):"");else X.set(Z,G!==void 0&&G!==null?x(String(G)):"")}catch{X.set(Z,"")}return y(J.fragment,X)}OJ();import C from"zlib";import{promisify as n}from"util";var XJ=n(C.brotliCompress),ZJ=n(C.gzip),$J=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],GJ=["text/event-stream","multipart/x-mixed-replace"],UJ=1024;function WJ(J){if(!J)return!1;let K=J.toLowerCase();if(GJ.some((Q)=>K.startsWith(Q)))return!1;return $J.some((Q)=>K.startsWith(Q))}function jJ(J){let K=new Map;for(let Q of J.split(",")){let[X,...Z]=Q.trim().split(";"),$=X.trim().toLowerCase();if(!$)continue;let G=1;for(let W of Z){let I=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(W);if(!I)continue;let _=Number.parseFloat(I[1]);if(Number.isFinite(_))G=_}K.set($,G)}return K}function YJ(J){if(!J)return null;let K=jJ(J),Q=K.get("*"),X=(Z)=>K.get(Z)??Q??0;if(X("br")>0)return"br";if(X("gzip")>0)return"gzip";return null}async function i(J,K,Q={}){if(K.headers.get("content-encoding"))return K;if(K.status===204||K.status===304||!K.body)return K;if(!WJ(K.headers.get("content-type")))return K;let X=YJ(J.headers.get("accept-encoding"));if(!X)return K;let Z;try{Z=new Uint8Array(await K.arrayBuffer())}catch{return K}let $=()=>new Response(Z,{status:K.status,statusText:K.statusText,headers:p(K.headers)});if(Z.length<(Q.threshold??UJ))return $();try{let G=X==="br"?await XJ(Z,{params:{[C.constants.BROTLI_PARAM_QUALITY]:Q.quality??5,[C.constants.BROTLI_PARAM_SIZE_HINT]:Z.length}}):await ZJ(Z);if(G.length>=Z.length)return $();let W=p(K.headers);return W.set("Content-Encoding",X),W.set("Content-Length",String(G.length)),new Response(G,{status:K.status,statusText:K.statusText,headers:W})}catch{return $()}}function p(J){let K=new Headers(J),Q=K.get("Vary");if(!Q)return K.set("Vary","Accept-Encoding"),K;if(!Q.split(",").some((Z)=>Z.trim().toLowerCase()==="accept-encoding"))K.set("Vary",`${Q}, Accept-Encoding`);return K}var _J={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function mJ(J={}){let K=B.resolve(J.outputDir||".output"),Q=J.port||3000,X=JJ(K);if(!X)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${X.routes.length} routes...`);let Z=new Map,$=new Map,G=new Map,W=new Map;for(let U of X.routes)try{let z=B.join(K,U.compiledPath),O=JSON.parse(await Bun.file(z).text());Z.set(U.pattern,O),G.set(U.pattern,s(O.html)),W.set(U.pattern,o(O.html));let w=B.join(K,U.fragmentPath);if(await Bun.file(w).exists())$.set(U.pattern,await Bun.file(w).text())}catch(z){console.warn(`[stx] Failed to load route ${U.pattern}:`,z)}let I=new Map,_=[];for(let U of X.routes)if(U.hasParams){let{regex:z,params:O}=a(U.pattern);_.push({regex:z,route:U,paramNames:O})}else I.set(U.pattern,U);let N=IJ({port:Q,async fetch(U){return i(U,await(async()=>{let O=new URL(U.url).pathname;if(J.onRequest){let j=await J.onRequest(U);if(j)return j}if(J.apiRoutes?.[O])return J.apiRoutes[O](U);if((U.method==="GET"||U.method==="HEAD")&&O!=="/"){let j=B.resolve(K,"public"),Y;try{Y=decodeURIComponent(O)}catch{Y=O}if(!Y.includes("\x00")){let L=B.resolve(j,`.${Y}`);if(L===j||L.startsWith(`${j}${B.sep}`))try{if(r.existsSync(L)&&r.statSync(L).isFile()){let M=B.extname(L).toLowerCase(),S=_J[M]||"application/octet-stream",H=O.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(O);return new Response(Bun.file(L),{headers:{"Content-Type":S,"Cache-Control":H?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let w=e(U),D=null,E={};if(D=I.get(O)||null,!D)for(let{regex:j,route:Y,paramNames:L}of _){let A=O.match(j);if(A){D=Y,L.forEach((M,S)=>{E[M]=A[S+1]});break}}if(!D){let j=I.get("/404")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}if(w){let j=$.get(D.pattern);if(j){let Y=G.get(D.pattern);return new Response(j,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...W.has(D.pattern)?{"X-STX-Runtime":W.get(D.pattern)?"true":"false"}:{},...Y?{"X-STX-Layout":Y.layout,"X-STX-Layout-Group":Y.group}:{},...b(),"Cache-Control":t}})}}let V=f(U.method),F=Z.get(D.pattern);if(!F){let j=I.get("/500")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(!V&&!F.hasServerScripts&&Object.keys(F.placeholders).length===0)return new Response(F.html,{status:F.status??200,headers:{"Content-Type":"text/html",...b(),"Cache-Control":"public, max-age=60"}});try{let{html:j,boundaries:Y,redirect:L,cookies:A,status:M,headers:S}=await d(F,{params:E,request:U,method:U.method});if(L)return m(L,A,S);if(Y&&Y.length>0){let{renderStreamingPage:T,streamToResponse:k}=await import("./chunk-sprn2n68.js");return k(T(j,Y,{timeoutMs:30000}),{status:M??F.status??200,headers:{"Cache-Control":"no-cache",...S}})}let H=new Headers({"Content-Type":"text/html",...b(),"Cache-Control":"no-cache"});for(let T of A??[])H.append("Set-Cookie",T);for(let[T,k]of Object.entries(S??{}))H.set(T,k);return new Response(j,{status:M??F.status??200,headers:H})}catch(j){return console.error(`[stx] Hydration error for ${O}:`,j),new Response(F.html,{headers:{"Content-Type":"text/html"}})}})())}});return console.log(`[stx] Production server running at http://localhost:${Q}`),console.log(`[stx] Serving ${X.routes.length} routes (${Z.size} pre-loaded)`),{port:Q,stop:()=>N.stop()}}
3
3
  export{WJ as Ye,YJ as Ze,i as _e,q as $e,KJ as af,f as bf,h as cf,m as df,wJ as ef,d as ff,AJ as gf,mJ as hf};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{nv as Y}from"./chunk-vwqv8f0y.js";import{mkdir as O,writeFile as q}from"fs/promises";import{join as X}from"path";var T="https://api.iconify.design";async function k(){let E=await fetch(`${T}/collections`);if(!E.ok)throw Error(`Failed to fetch collections: ${E.statusText}`);return await E.json()}async function P(E,z){try{let U=Y.resolve("@iconify/json"),S=`${`${U.substring(0,U.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${E}.json`,M=Bun.file(S);if(await M.exists()){let V=await M.json();if(z&&z.length>0){let Z={};for(let L of z)if(V.icons[L])Z[L]=V.icons[L];return{...V,icons:Z}}return V}}catch{}let K=z&&z.length>0?`${T}/${E}.json?icons=${z.join(",")}`:`${T}/${E}.json`,Q=await fetch(K);if(!Q.ok)throw Error(`Failed to fetch icons for ${E}: ${Q.statusText}`);return await Q.json()}function j(E,z=24,K=24){return{body:E.body,width:E.width||z,height:E.height||K,viewBox:`0 0 ${E.width||z} ${E.height||K}`}}function F(E,z){let K=B(E);return`import type { IconData } from '@stacksjs/iconify-core'
2
+ import{ov as Y}from"./chunk-6bcw8twx.js";import{mkdir as O,writeFile as q}from"fs/promises";import{join as X}from"path";var T="https://api.iconify.design";async function k(){let E=await fetch(`${T}/collections`);if(!E.ok)throw Error(`Failed to fetch collections: ${E.statusText}`);return await E.json()}async function P(E,z){try{let U=Y.resolve("@iconify/json"),S=`${`${U.substring(0,U.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${E}.json`,M=Bun.file(S);if(await M.exists()){let V=await M.json();if(z&&z.length>0){let Z={};for(let L of z)if(V.icons[L])Z[L]=V.icons[L];return{...V,icons:Z}}return V}}catch{}let K=z&&z.length>0?`${T}/${E}.json?icons=${z.join(",")}`:`${T}/${E}.json`,Q=await fetch(K);if(!Q.ok)throw Error(`Failed to fetch icons for ${E}: ${Q.statusText}`);return await Q.json()}function j(E,z=24,K=24){return{body:E.body,width:E.width||z,height:E.height||K,viewBox:`0 0 ${E.width||z} ${E.height||K}`}}function F(E,z){let K=B(E);return`import type { IconData } from '@stacksjs/iconify-core'
3
3
 
4
4
  export const ${K}: IconData = ${JSON.stringify(z,null,2)}
5
5
 
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{hf as a}from"./chunk-pt902dd9.js";import"./chunk-trpmf02p.js";import"./chunk-17389q0t.js";import"./chunk-6xbscz34.js";import"./chunk-bkbr9yz2.js";import"./chunk-nn4k6hvv.js";import"./chunk-1zyqv8p8.js";import"./chunk-1zvyq6jj.js";import"./chunk-snsb8nm6.js";import"./chunk-v4vvm7mz.js";import"./chunk-s710wybv.js";import"./chunk-00mag1n0.js";import"./chunk-d3r5pdz7.js";import"./chunk-ze3qgdaf.js";import"./chunk-54fnvfp1.js";import"./chunk-42b81qv3.js";import"./chunk-6bcw8twx.js";export{a as startProductionServer};
@@ -5,4 +5,4 @@ var P=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{nam
5
5
  ${F} [${U.join(`,
6
6
  ${F} `)}]`:"";return`Craft.create("${j.zigType}", ${Q}${W})`}function s(j,q,F){if(q.target==="universal"){let G=[];G.push("// Universal entry point"),G.push("");for(let[Q,U]of F)G.push(`// --- ${Q.toUpperCase()} ---`),G.push(`#if ${Q.toUpperCase()}`),G.push(U),G.push("#endif"),G.push("");return G.join(`
7
7
  `)}return F.get(q.target)||J(j,q)}function r(j,q,F){let G=[];function Q(U){G.push({name:U.zigType,hash:D(JSON.stringify(U.props)),props:Object.keys(U.props),events:Array.from(U.events.keys()),slots:[],isNative:U.zigType.startsWith("craft.")});for(let W of U.children)Q(W)}return Q(q),{version:"1.0.0",components:G,entry:j.id,assets:[],styles:j.styles}}function p(j,q){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var d=0;function E(){return`id_${++d}`}function D(j){let q=0;for(let F=0;F<j.length;F++){let G=j.charCodeAt(F);q=(q<<5)-q+G,q=q&q}return Math.abs(q).toString(36)}function l(j){return j.charAt(0).toUpperCase()+j.slice(1)}function i(j){let q=[],F=/<script[^>]*>([\s\S]*?)<\/script>/gi,G;while((G=F.exec(j))!==null)q.push(G[1]);return q}function a(j){let q=[],F=/<style[^>]*>([\s\S]*?)<\/style>/gi,G;while((G=F.exec(j))!==null)q.push(G[1]);return q}function B(j){let q=j.type==="component"?1:0;if(j.children)for(let F of j.children)q+=B(F);return q}function b(j){let q=j.zigType.startsWith("craft.")?1:0;for(let F of j.children)q+=b(F);return q}function o(j){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(q)=>{console.log(`[craft-compiler] File changed: ${q}`)}}}var t={compileToNative:k,createHotReloadServer:o,NATIVE_COMPONENTS:P},e=t;
8
- export{P as nk,k as ok,o as pk,e as qk};
8
+ export{P as ok,k as pk,o as qk,e as rk};
@@ -81,4 +81,4 @@ else {
81
81
  </div>
82
82
  ${U}
83
83
  `})}
84
- export{_ as ri};
84
+ export{_ as si};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{sj as o,tj as p,uj as q}from"./chunk-kp8ec2f4.js";import{Aj as a,Bj as b,Cj as c,Dj as d,Ej as e,Fj as f,Gj as g,Hj as h,Ij as i,Jj as j,Kj as k,Lj as l,Mj as m,Nj as n}from"./chunk-fed3xsp9.js";import"./chunk-6kdb8j9d.js";import"./chunk-vwqv8f0y.js";export{n as useOptimistic,l as untrack,a as state,g as runMountCallbacks,h as runDestroyCallbacks,i as pendingLifecycleCounts,m as peek,e as onMount,f as onDestroy,j as isSignal,k as isDerived,p as generateSignalsRuntimeDev,o as generateSignalsRuntime,c as effect,b as derived,q as default,d as batch};
2
+ import{tj as o,uj as p,vj as q}from"./chunk-mq0vtxe6.js";import{Bj as a,Cj as b,Dj as c,Ej as d,Fj as e,Gj as f,Hj as g,Ij as h,Jj as i,Kj as j,Lj as k,Mj as l,Nj as m,Oj as n}from"./chunk-w8yac9xp.js";import"./chunk-ze3qgdaf.js";import"./chunk-6bcw8twx.js";export{n as useOptimistic,l as untrack,a as state,g as runMountCallbacks,h as runDestroyCallbacks,i as pendingLifecycleCounts,m as peek,e as onMount,f as onDestroy,j as isSignal,k as isDerived,p as generateSignalsRuntimeDev,o as generateSignalsRuntime,c as effect,b as derived,q as default,d as batch};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Eh as a,Fh as b,Gh as c,Hh as d,Ih as e,Jh as f,Kh as g,Lh as h,Mh as i,Nh as j,Oh as k,Ph as l,Qh as m,Rh as n,Sh as o,Th as p,Uh as q}from"./chunk-pfwhd5xs.js";import"./chunk-vwqv8f0y.js";export{h as resizeAndConvert,f as processImage,d as isSharpAvailable,m as isImageFile,e as isImageBackendAvailable,l as groupVariantsByFormat,o as getTotalSize,n as getMimeType,g as getImageMetadata,k as getFallbackVariant,i as generateSrcSet,j as generateSizes,p as formatSize,q as ImageProcessingError,a as DEFAULT_WIDTHS,c as DEFAULT_QUALITY,b as DEFAULT_FORMATS};
2
+ import{Fh as a,Gh as b,Hh as c,Ih as d,Jh as e,Kh as f,Lh as g,Mh as h,Nh as i,Oh as j,Ph as k,Qh as l,Rh as m,Sh as n,Th as o,Uh as p,Vh as q}from"./chunk-x14vvxfh.js";import"./chunk-6bcw8twx.js";export{h as resizeAndConvert,f as processImage,d as isSharpAvailable,m as isImageFile,e as isImageBackendAvailable,l as groupVariantsByFormat,o as getTotalSize,n as getMimeType,g as getImageMetadata,k as getFallbackVariant,i as generateSrcSet,j as generateSizes,p as formatSize,q as ImageProcessingError,a as DEFAULT_WIDTHS,c as DEFAULT_QUALITY,b as DEFAULT_FORMATS};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ri as a,Si as b,Ti as c,Ui as d,Vi as e,Wi as f,Xi as g}from"./chunk-jem20v5k.js";import"./chunk-vwqv8f0y.js";export{d as useVirtualList,b as processVirtualListDirectives,f as processVirtualGridDirectives,e as processInfiniteListDirectives,c as generateVirtualListCSS,g as default,a as createVirtualList};
2
+ import{Si as a,Ti as b,Ui as c,Vi as d,Wi as e,Xi as f,Yi as g}from"./chunk-weqpt9nt.js";import"./chunk-6bcw8twx.js";export{d as useVirtualList,b as processVirtualListDirectives,f as processVirtualGridDirectives,e as processInfiniteListDirectives,c as generateVirtualListCSS,g as default,a as createVirtualList};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import{Ul as ZJ,ir as QJ}from"./chunk-6z04mpxz.js";import{at as JJ,bt as KJ}from"./chunk-c5rehxqy.js";import{it as $J,mt as g}from"./chunk-qfec1s34.js";import{Gt as h}from"./chunk-kgxkrnyt.js";import j from"path";import O from"fs";function qJ(J){if(!J||typeof J!=="object")return!1;let K=J;return typeof K.message==="string"&&(K.name==="BuildMessage"||K.name==="ResolveMessage"||("position"in K))}function VJ(J){if(J&&typeof J==="object"&&Array.isArray(J.errors))return J.errors;return[J]}function E(J,K){let G=[];for(let W of VJ(J)){if(qJ(W)){let Y=W.position||void 0;G.push({file:K||Y?.file,line:Y?.line,column:Y?.column,message:W.message??"",lineText:Y?.lineText});continue}G.push({file:K,message:W instanceof Error?W.message:String(W)})}return G}function i(J,K){return E(J,K).map((G)=>{let W=G.file?`${G.file}${G.line?`:${G.line}${G.column?`:${G.column}`:""}`:""}`:"",Y=G.lineText?`
2
+ import{Vl as ZJ,jr as QJ}from"./chunk-17389q0t.js";import{bt as JJ,ct as KJ}from"./chunk-1zyqv8p8.js";import{jt as $J,nt as g}from"./chunk-snsb8nm6.js";import{Ht as h}from"./chunk-v4vvm7mz.js";import j from"path";import O from"fs";function qJ(J){if(!J||typeof J!=="object")return!1;let K=J;return typeof K.message==="string"&&(K.name==="BuildMessage"||K.name==="ResolveMessage"||("position"in K))}function VJ(J){if(J&&typeof J==="object"&&Array.isArray(J.errors))return J.errors;return[J]}function E(J,K){let G=[];for(let W of VJ(J)){if(qJ(W)){let Y=W.position||void 0;G.push({file:K||Y?.file,line:Y?.line,column:Y?.column,message:W.message??"",lineText:Y?.lineText});continue}G.push({file:K,message:W instanceof Error?W.message:String(W)})}return G}function i(J,K){return E(J,K).map((G)=>{let W=G.file?`${G.file}${G.line?`:${G.line}${G.column?`:${G.column}`:""}`:""}`:"",Y=G.lineText?`
3
3
  ${G.lineText.trim()}`:"";return W?`${W}: ${G.message}${Y}`:`${G.message}${Y}`}).join(`
4
- `)}var kJ=6,GJ=1,WJ=new Map,b=600,OJ=100,P=new Map;async function AJ(J){let K=P.get(J)??0;if(K>0&&K<OJ){P.set(J,K+1);return}P.set(J,1);try{let G=(await O.promises.readdir(J)).filter((H)=>H.endsWith(".js"));if(G.length<=b)return;let Y=(await Promise.all(G.map(async(H)=>{try{return{name:H,at:(await O.promises.stat(j.join(J,H))).mtimeMs}}catch{return null}}))).filter((H)=>H!==null);Y.sort((H,Q)=>Q.at-H.at);for(let H of Y.slice(b)){let Q=H.name.slice(0,-3);await O.promises.rm(j.join(J,`${Q}.js`),{force:!0}),await O.promises.rm(j.join(J,`${Q}.deps.json`),{force:!0})}T("pruned bundle cache to",b,"entries")}catch{}}function bJ(J){return WJ.get(J)??[]}function m(J,K){if(J)WJ.set(J,K)}function wJ(J=process.env){return J.STX_DEBUG==="true"||J.STX_DEBUG==="1"}function T(...J){if(wJ())console.log("[stx:bundler]",...J)}var p=[];function r(J,K,G){p.push({filePath:J||"<inline>",message:K,details:G})}function PJ(){return p.slice()}function fJ(){p.length=0}var u;function gJ(J){u=J}function s(){if(u)return u;try{let J=QJ.strict;return typeof J==="object"&&J!==null?J.bundlerFallback??"warn":"warn"}catch{return"warn"}}var t=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function mJ(J){let K=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,G;while((G=K.exec(J))!==null){let Y=G[1];if(!t.some((Q)=>Q.test(Y)))return T("detected user import:",Y),!0}let W=/^[ \t]*import[ \t]+['"]([^'"]+)['"]/gm;while((G=W.exec(J))!==null){let Y=G[1];if(/\.css(?:\?.*)?$/.test(Y))continue;if(!t.some((Q)=>Q.test(Y)))return T("detected side-effect import:",Y),!0}return!1}var v="stx-module:",UJ=/\.(?:[cm]?[jt]sx?|json)$/i;function CJ(J,K){return j.relative(J,K).split(j.sep).join("/")}function LJ(J,K){if(K.size===0)return J;return J.replace(/^([ \t]*import\s+(?:[^;"']*?\s+from\s+)?)(["'])([^"']+)\2/gm,(G,W,Y,H)=>{let Q=K.get(H);return Q&&!H.startsWith(v)?`${W}${Y}${Q}${Y}`:G})}function TJ(J,K){let G=0,W=(H)=>{let Q=`__stxMod${G++}`,A=JSON.stringify(H);return K.push(`var ${Q} = globalThis.__stxModules && globalThis.__stxModules[${A}];`,`if (${Q} === undefined) throw new Error("[stx] module " + ${JSON.stringify(A)} + " is not registered on this page (#1957)");`),Q},Y=(H,Q)=>{for(let A of H.split(",")){let z=A.trim();if(!z)continue;let Z=z.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!Z)continue;let $=Z[1].startsWith('"')?JSON.parse(Z[1]):Z[1],X=Z[2]??$;K.push(`var ${X} = ${Q}[${JSON.stringify($)}];`)}};return J=J.replace(/^[ \t]*import\s+([^;"']*?)\s+from\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(H,Q,A)=>{let z=A.slice(v.length),Z=W(z),$=Q.trim(),X=$.match(/^([\w$]+)\s*(?:,\s*|$)/);if(X&&!$.startsWith("{")&&!$.startsWith("*"))K.push(`var ${X[1]} = ${Z}.default;`),$=$.slice(X[0].length).trim();let k=$.match(/^\*\s*as\s+([\w$]+)$/);if(k)K.push(`var ${k[1]} = ${Z};`);else if($.startsWith("{"))Y($.replace(/^\{|\}$/g,""),Z);return""}),J=J.replace(/^[ \t]*import\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(H,Q)=>{return W(Q.slice(v.length)),""}),J}function a(J){let K=[J,`${J}.ts`,`${J}.tsx`,`${J}.js`,`${J}.mjs`,`${J}.jsx`,j.join(J,"index.ts"),j.join(J,"index.tsx"),j.join(J,"index.js"),j.join(J,"index.mjs")];for(let G of K)try{if(O.existsSync(G)&&O.statSync(G,{throwIfNoEntry:!1})?.isFile())return G}catch{}return}function MJ(J,K,G,W,Y,H=new Map){let Q=(z,Z,$)=>{if(!Y||z!==G||!UJ.test(Z))return null;try{if(!O.statSync(Z,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}W.add(Z);let X=`${v}${CJ(process.cwd(),Z)}`;return H.set($,X),{path:X,external:!0}},A=(z,Z)=>{let $=z===G?K:j.dirname(z),X=j.resolve($,Z);return a(X)??X};return{name:"stx-client-bundle",setup(z){z.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(Z)=>({path:Z.path,external:!0})),z.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(Z)=>({path:Z.path,external:!0})),z.onResolve({filter:/^\//},(Z)=>{let $=a(Z.path);if($){let X=Q(Z.importer,$,Z.path);if(X)return X;if($!==G)W.add($);return{path:$}}return{path:Z.path,external:!0}}),z.onResolve({filter:/^\.\.?\//},(Z)=>{let $=A(Z.importer,Z.path),X=Q(Z.importer,$,Z.path);if(X)return X;return W.add($),{path:$}}),z.onResolve({filter:/^[@~]\//},(Z)=>{let $=j.resolve(J,Z.path.slice(2)),X=[$,`${$}.ts`,`${$}.tsx`,`${$}.js`,`${$}.mjs`,`${$}.jsx`,j.join($,"index.ts"),j.join($,"index.tsx"),j.join($,"index.js"),j.join($,"index.mjs")];for(let k of X)if(O.existsSync(k)&&O.statSync(k,{throwIfNoEntry:!1})?.isFile()){let _=Q(Z.importer,k,Z.path);if(_)return _;return T(`resolved ${Z.path[0]}/ import:`,Z.path,"\u2192",k),W.add(k),{path:k}}return console.warn(`[stx:bundler] could not resolve ${Z.path[0]}/ import:`,Z.path),{path:$}}),z.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(Z)=>{if(!Y||Z.importer!==G)return;let $=`${v}npm:${Z.path}`;return H.set(Z.path,$),{path:$,external:!0}}),z.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(Z)=>{let $=j.extname(Z.path).toLowerCase(),X=$===".json"?"json":$===".tsx"?"tsx":$===".jsx"?"jsx":$===".ts"||$===".mts"||$===".cts"?"ts":"js";if(Z.path!==G)W.add(Z.path);return{contents:O.readFileSync(Z.path,"utf8"),loader:X}})}}}var f=new Map,F=$J(64),e=Symbol.for("stx.client-bundle-build-queue");function SJ(J){let K=globalThis,W=(K[e]??Promise.resolve()).then(J,J);return K[e]=W.then(()=>{return},()=>{return}),W}async function uJ(J,K,G={}){let W=G.projectRoot||process.cwd(),Y=G.minify??!1,H=G.externalizeUserModules??!0,Q=G.cacheDir||h(W,"bundle-cache"),A=new Bun.CryptoHasher("md5");A.update(`${kJ}\x00${H?"registry":"inline"}\x00${J}\x00${K}`);let z=A.digest("hex").slice(0,12),Z=j.join(Q,`${z}.js`),$=F.get(Z);if($){if(g($.files)){T("memo hit:",z);let S=$.files.map((L)=>L.path);return m(K,S),G.collectInputs?.push(...S),$.code}F.delete(Z),T("memo invalidated by dep change:",z)}let X=j.join(Q,`${z}.deps.json`),k=Bun.file(Z);if(await k.exists()){let S=Bun.file(X),L=!0,w=null;if(await S.exists())try{let I=JSON.parse(await S.text());if(I.metadataVersion!==GJ||!Array.isArray(I.files))L=!1;else w=I.files;if(w&&!g(w))L=!1}catch{L=!1}if(L){if(T("cache hit:",z),w)m(K,w.map((y)=>y.path)),G.collectInputs?.push(...w.map((y)=>y.path));let I=await k.text();if(w)F.set(Z,{code:I,files:w});return I}T("cache invalidated by dep change:",z)}let _=f.get(z);if(_){let S=await _;if(G.collectInputs)G.collectInputs.push(...(F.get(Z)?.files??[]).map((L)=>L.path));return S}let M=SJ(()=>xJ(J,K,{projectRoot:W,minify:Y,cacheDir:Q,hash:z,cachePath:Z,depsPath:X,collectInputs:G.collectInputs,externalizeUserModules:H}));f.set(z,M);try{return await M}finally{f.delete(z)}}async function xJ(J,K,G){let{projectRoot:W,minify:Y,cacheDir:H,hash:Q,cachePath:A,depsPath:z,externalizeUserModules:Z}=G,$=h(W,"bundle-tmp"),X=j.join($,`${Q}.ts`),k=j.join($,"out",Q);O.mkdirSync($,{recursive:!0}),O.mkdirSync(k,{recursive:!0});let _=j.dirname(K),M=new Set,S=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,L=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,w=JJ(J),{depths:I,balanced:y}=KJ(w),c=(U)=>!y||I[U]===0,C;while((C=S.exec(w))!==null){if(C[1])continue;if(!c(C.index))continue;if(C[2])C[2].split(",").forEach((U)=>{let V=IJ(U);if(V)M.add(V)});else if(C[3])M.add(C[3])}while((C=L.exec(w))!==null){if(C[1])continue;if(!c(C.index))continue;M.add(C[2])}let YJ=M.size>0?`
4
+ `)}var kJ=7,GJ=1,WJ=new Map,b=600,OJ=100,P=new Map;async function AJ(J){let K=P.get(J)??0;if(K>0&&K<OJ){P.set(J,K+1);return}P.set(J,1);try{let G=(await O.promises.readdir(J)).filter((H)=>H.endsWith(".js"));if(G.length<=b)return;let Y=(await Promise.all(G.map(async(H)=>{try{return{name:H,at:(await O.promises.stat(j.join(J,H))).mtimeMs}}catch{return null}}))).filter((H)=>H!==null);Y.sort((H,Q)=>Q.at-H.at);for(let H of Y.slice(b)){let Q=H.name.slice(0,-3);await O.promises.rm(j.join(J,`${Q}.js`),{force:!0}),await O.promises.rm(j.join(J,`${Q}.deps.json`),{force:!0})}T("pruned bundle cache to",b,"entries")}catch{}}function bJ(J){return WJ.get(J)??[]}function m(J,K){if(J)WJ.set(J,K)}function wJ(J=process.env){return J.STX_DEBUG==="true"||J.STX_DEBUG==="1"}function T(...J){if(wJ())console.log("[stx:bundler]",...J)}var p=[];function r(J,K,G){p.push({filePath:J||"<inline>",message:K,details:G})}function PJ(){return p.slice()}function fJ(){p.length=0}var u;function gJ(J){u=J}function s(){if(u)return u;try{let J=QJ.strict;return typeof J==="object"&&J!==null?J.bundlerFallback??"warn":"warn"}catch{return"warn"}}var t=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function mJ(J){let K=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,G;while((G=K.exec(J))!==null){let Y=G[1];if(!t.some((Q)=>Q.test(Y)))return T("detected user import:",Y),!0}let W=/^[ \t]*import[ \t]+['"]([^'"]+)['"]/gm;while((G=W.exec(J))!==null){let Y=G[1];if(/\.css(?:\?.*)?$/.test(Y))continue;if(!t.some((Q)=>Q.test(Y)))return T("detected side-effect import:",Y),!0}return!1}var v="stx-module:",UJ=/\.(?:[cm]?[jt]sx?|json)$/i;function CJ(J,K){return j.relative(J,K).split(j.sep).join("/")}function LJ(J,K){if(K.size===0)return J;return J.replace(/^([ \t]*import\s+(?:[^;"']*?\s+from\s+)?)(["'])([^"']+)\2/gm,(G,W,Y,H)=>{let Q=K.get(H);return Q&&!H.startsWith(v)?`${W}${Y}${Q}${Y}`:G})}function TJ(J,K){let G=0,W=(H)=>{let Q=`__stxMod${G++}`,A=JSON.stringify(H);return K.push(`var ${Q} = globalThis.__stxModules && globalThis.__stxModules[${A}];`,`if (${Q} === undefined) throw new Error("[stx] module " + ${JSON.stringify(A)} + " is not registered on this page (#1957)");`),Q},Y=(H,Q)=>{for(let A of H.split(",")){let z=A.trim();if(!z)continue;let Z=z.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!Z)continue;let $=Z[1].startsWith('"')?JSON.parse(Z[1]):Z[1],X=Z[2]??$;K.push(`var ${X} = ${Q}[${JSON.stringify($)}];`)}};return J=J.replace(/^[ \t]*import\s+([^;"']*?)\s+from\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(H,Q,A)=>{let z=A.slice(v.length),Z=W(z),$=Q.trim(),X=$.match(/^([\w$]+)\s*(?:,\s*|$)/);if(X&&!$.startsWith("{")&&!$.startsWith("*"))K.push(`var ${X[1]} = ${Z}.default;`),$=$.slice(X[0].length).trim();let k=$.match(/^\*\s*as\s+([\w$]+)$/);if(k)K.push(`var ${k[1]} = ${Z};`);else if($.startsWith("{"))Y($.replace(/^\{|\}$/g,""),Z);return""}),J=J.replace(/^[ \t]*import\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(H,Q)=>{return W(Q.slice(v.length)),""}),J}function a(J){let K=[J,`${J}.ts`,`${J}.tsx`,`${J}.js`,`${J}.mjs`,`${J}.jsx`,j.join(J,"index.ts"),j.join(J,"index.tsx"),j.join(J,"index.js"),j.join(J,"index.mjs")];for(let G of K)try{if(O.existsSync(G)&&O.statSync(G,{throwIfNoEntry:!1})?.isFile())return G}catch{}return}function MJ(J,K,G,W,Y,H=new Map){let Q=(z,Z,$)=>{if(!Y||z!==G||!UJ.test(Z))return null;try{if(!O.statSync(Z,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}W.add(Z);let X=`${v}${CJ(process.cwd(),Z)}`;return H.set($,X),{path:X,external:!0}},A=(z,Z)=>{let $=z===G?K:j.dirname(z),X=j.resolve($,Z);return a(X)??X};return{name:"stx-client-bundle",setup(z){z.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(Z)=>({path:Z.path,external:!0})),z.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(Z)=>({path:Z.path,external:!0})),z.onResolve({filter:/^\//},(Z)=>{let $=a(Z.path);if($){let X=Q(Z.importer,$,Z.path);if(X)return X;if($!==G)W.add($);return{path:$}}return{path:Z.path,external:!0}}),z.onResolve({filter:/^\.\.?\//},(Z)=>{let $=A(Z.importer,Z.path),X=Q(Z.importer,$,Z.path);if(X)return X;return W.add($),{path:$}}),z.onResolve({filter:/^[@~]\//},(Z)=>{let $=j.resolve(J,Z.path.slice(2)),X=[$,`${$}.ts`,`${$}.tsx`,`${$}.js`,`${$}.mjs`,`${$}.jsx`,j.join($,"index.ts"),j.join($,"index.tsx"),j.join($,"index.js"),j.join($,"index.mjs")];for(let k of X)if(O.existsSync(k)&&O.statSync(k,{throwIfNoEntry:!1})?.isFile()){let _=Q(Z.importer,k,Z.path);if(_)return _;return T(`resolved ${Z.path[0]}/ import:`,Z.path,"\u2192",k),W.add(k),{path:k}}return console.warn(`[stx:bundler] could not resolve ${Z.path[0]}/ import:`,Z.path),{path:$}}),z.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(Z)=>{if(!Y||Z.importer!==G)return;let $=`${v}npm:${Z.path}`;return H.set(Z.path,$),{path:$,external:!0}}),z.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(Z)=>{let $=j.extname(Z.path).toLowerCase(),X=$===".json"?"json":$===".tsx"?"tsx":$===".jsx"?"jsx":$===".ts"||$===".mts"||$===".cts"?"ts":"js";if(Z.path!==G)W.add(Z.path);return{contents:O.readFileSync(Z.path,"utf8"),loader:X}})}}}var f=new Map,F=$J(64),e=Symbol.for("stx.client-bundle-build-queue");function SJ(J){let K=globalThis,W=(K[e]??Promise.resolve()).then(J,J);return K[e]=W.then(()=>{return},()=>{return}),W}async function uJ(J,K,G={}){let W=G.projectRoot||process.cwd(),Y=G.minify??!1,H=G.externalizeUserModules??!0,Q=G.cacheDir||h(W,"bundle-cache"),A=new Bun.CryptoHasher("md5");A.update(`${kJ}\x00${H?"registry":"inline"}\x00${J}\x00${K}`);let z=A.digest("hex").slice(0,12),Z=j.join(Q,`${z}.js`),$=F.get(Z);if($){if(g($.files)){T("memo hit:",z);let S=$.files.map((L)=>L.path);return m(K,S),G.collectInputs?.push(...S),$.code}F.delete(Z),T("memo invalidated by dep change:",z)}let X=j.join(Q,`${z}.deps.json`),k=Bun.file(Z);if(await k.exists()){let S=Bun.file(X),L=!0,w=null;if(await S.exists())try{let I=JSON.parse(await S.text());if(I.metadataVersion!==GJ||!Array.isArray(I.files))L=!1;else w=I.files;if(w&&!g(w))L=!1}catch{L=!1}if(L){if(T("cache hit:",z),w)m(K,w.map((y)=>y.path)),G.collectInputs?.push(...w.map((y)=>y.path));let I=await k.text();if(w)F.set(Z,{code:I,files:w});return I}T("cache invalidated by dep change:",z)}let _=f.get(z);if(_){let S=await _;if(G.collectInputs)G.collectInputs.push(...(F.get(Z)?.files??[]).map((L)=>L.path));return S}let M=SJ(()=>xJ(J,K,{projectRoot:W,minify:Y,cacheDir:Q,hash:z,cachePath:Z,depsPath:X,collectInputs:G.collectInputs,externalizeUserModules:H}));f.set(z,M);try{return await M}finally{f.delete(z)}}async function xJ(J,K,G){let{projectRoot:W,minify:Y,cacheDir:H,hash:Q,cachePath:A,depsPath:z,externalizeUserModules:Z}=G,$=h(W,"bundle-tmp"),X=j.join($,`${Q}.ts`),k=j.join($,"out",Q);O.mkdirSync($,{recursive:!0}),O.mkdirSync(k,{recursive:!0});let _=j.dirname(K),M=new Set,S=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,L=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,w=JJ(J),{depths:I,balanced:y}=KJ(w),c=(U)=>!y||I[U]===0,C;while((C=S.exec(w))!==null){if(C[1])continue;if(!c(C.index))continue;if(C[2])C[2].split(",").forEach((U)=>{let V=IJ(U);if(V)M.add(V)});else if(C[3])M.add(C[3])}while((C=L.exec(w))!==null){if(C[1])continue;if(!c(C.index))continue;M.add(C[2])}let YJ=M.size>0?`
5
5
  export { ${[...M].join(", ")} }`:"";await Bun.write(X,J+YJ),T("bundling:",Q,"from:",j.basename(K));let o=new Set,n=new Map;try{let U=await Bun.build({entrypoints:[X],outdir:k,target:"browser",format:"esm",minify:Y,plugins:[MJ(W,_,X,o,Z,n)],define:{"process.env.NODE_ENV":Y?'"production"':'"development"',...ZJ()},root:W});if(!U.success){let N=U.logs.filter((B)=>B.level==="error").map((B)=>B.message).join(", ")||`Unable to bundle ${j.basename(K)}`,R=E(U.logs,K||void 0);if(console.warn("[stx:bundler] build failed:",N),r(K||"",N,R),s()==="error")throw Error(N);return J}let V="";for(let q of U.outputs){V=await q.text();break}let x=[];for(let q of V.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let N of q[1].split(",")){let R=N.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(R){x.push([R[2],R[1]]);continue}let B=N.trim();if(/^[A-Za-z_$][\w$]*$/.test(B))x.push([B,B])}let l=[];V=TJ(LJ(V,n),l);let HJ=V.match(/^\s*import\s+[^;]+;?\s*$/gm)||[];V=V.replace(/^\s*import\s+[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim();let d=`__stxBundle_${Q}`,zJ=x.map(([q,N])=>`${JSON.stringify(q)}: ${N}`).join(", "),XJ=x.map(([q])=>`var ${q} = undefined;`).join(`
6
6
  `),jJ=x.map(([q])=>`${q} = ${d}[${JSON.stringify(q)}];`).join(`
7
7
  `);if(V=`${HJ.join(`
@@ -14,4 +14,4 @@ ${V}
14
14
  return { ${zJ} };
15
15
  })();
16
16
  ${jJ}`.trim(),T("bundled:",Q,"output:",V.length,"bytes"),M.size>0&&x.length===0)return console.warn(`[stx:bundler] dropped every binding for ${j.basename(K)} (${Q}); serving the unbundled source and not caching this result`),J;O.mkdirSync(H,{recursive:!0}),await Bun.write(A,V);let D=Array.from(o).map((q)=>{try{return{path:q,mtimeMs:O.statSync(q).mtimeMs}}catch{return null}}).filter((q)=>q!==null);return await Bun.write(z,JSON.stringify({metadataVersion:GJ,files:D})),m(K,D.map((q)=>q.path)),G.collectInputs?.push(...D.map((q)=>q.path)),F.set(A,{code:V,files:D}),await AJ(H),V}catch(U){let V=E(U,K||void 0),x=i(U,K||void 0);if(console.warn(`[stx:bundler] error: ${x}`),r(K||"",x,V),s()==="error")throw U;return J}finally{try{O.rmSync(X,{force:!0}),O.rmSync(k,{recursive:!0,force:!0})}catch{}}}function IJ(J){let K=J.trim();if(!K)return null;let G=K.indexOf("=");if(G!==-1)K=K.slice(0,G).trim();let W=K.indexOf(":");if(W!==-1)K=K.slice(W+1).trim();if(K.startsWith("..."))K=K.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(K)?K:null}
17
- export{i as $k,bJ as al,wJ as bl,r as cl,PJ as dl,fJ as el,gJ as fl,s as gl,mJ as hl,v as il,CJ as jl,LJ as kl,TJ as ll,SJ as ml,uJ as nl};
17
+ export{i as al,bJ as bl,wJ as cl,r as dl,PJ as el,fJ as fl,gJ as gl,s as hl,mJ as il,v as jl,CJ as kl,LJ as ll,TJ as ml,SJ as nl,uJ as ol};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{It as a,Jt as b,Kt as c,Lt as d,Mt as e,Nt as f,Ot as g,Pt as h,Qt as i,Rt as j,St as k,Tt as l,Ut as m,Vt as n,Wt as o,Xt as p}from"./chunk-3npkbgfm.js";import"./chunk-vwqv8f0y.js";export{i as useTitle,f as useSeoMeta,i as usePageTitle,d as useHead,g as seoMetaToHeadConfig,c as resetHead,k as renderHtmlAttrs,j as renderHead,l as renderBodyAttrs,o as processTitleDirective,p as processMetaDirective,n as processHeadDirective,e as mergeHeadConfigs,b as getPageMeta,a as getHead,h as definePageMeta,m as applyHead};
2
+ import{Jt as a,Kt as b,Lt as c,Mt as d,Nt as e,Ot as f,Pt as g,Qt as h,Rt as i,St as j,Tt as k,Ut as l,Vt as m,Wt as n,Xt as o,Yt as p}from"./chunk-s710wybv.js";import"./chunk-6bcw8twx.js";export{i as useTitle,f as useSeoMeta,i as usePageTitle,d as useHead,g as seoMetaToHeadConfig,c as resetHead,k as renderHtmlAttrs,j as renderHead,l as renderBodyAttrs,o as processTitleDirective,p as processMetaDirective,n as processHeadDirective,e as mergeHeadConfigs,b as getPageMeta,a as getHead,h as definePageMeta,m as applyHead};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{bj as O,cj as w,dj as Z}from"./chunk-efr3ejqt.js";import{al as R,hl as U,nl as T}from"./chunk-224m1jrf.js";import{Sp as k,Ul as M,hr as C,so as W}from"./chunk-6z04mpxz.js";import{Yt as E,Zt as L}from"./chunk-nqwjb8k7.js";import{bu as B}from"./chunk-6kdb8j9d.js";import $ from"path";var Y=new Map;function b(Q,z){for(let J of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(J[1])z.add(J[1]);for(let J of Q.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let H of(J[1]??"").split(",")){let K=((H.includes(":")?H.split(":").pop():H)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(K))z.add(K)}for(let J of Q.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let H of(J[1]??"").split(",")){let V=H.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(V))z.add(V)}}async function l(Q){let z;if(Q)z=$.resolve(Q);else{let q=await C();z=$.resolve(q.root||process.cwd(),q.storesDir||"stores")}let J=new Bun.Glob("*.ts"),H=[];try{for await(let q of J.scan({cwd:z,absolute:!0})){let y=$.basename(q,".ts");if(["index","types"].includes(y))continue;if(q.includes(".d.ts"))continue;H.push(q)}}catch{return Z(Y,z,"",""),null}let V=()=>[...new Set([...H,...H.flatMap((q)=>R(q))])],K=O(V()),P=w(Y,z,K);if(P!==void 0)return P||null;if(H.length===0)return Z(Y,z,K,""),null;let A=[];for(let q of H){let y=await Bun.file(q).text();A.push({file:q,hasUseStore:/useStore\s*\(/.test(y)})}A.sort((q,y)=>{if(q.hasUseStore===y.hasUseStore)return 0;return q.hasUseStore?1:-1});let N=A.map((q)=>q.file),G=[],X=new Set,F=k({loader:"ts",target:"browser",define:M()});for(let q of N)try{let y=await Bun.file(q).text(),I=$.basename(q,".ts");if(b(y,X),U(y))y=await T(y,q,{projectRoot:process.cwd(),externalizeUserModules:!1});y=W(y),y=E(y),y=L(y),y=y.replace(/^export\s+(default\s+)?/gm,""),y=F.transformSync(y),G.push(`// Store: ${I}
2
+ import{cj as O,dj as w,ej as Z}from"./chunk-91007tan.js";import{bl as R,il as U,ol as T}from"./chunk-r19ajkwr.js";import{Tp as k,Vl as M,ir as C,to as W}from"./chunk-17389q0t.js";import{Zt as E,_t as L}from"./chunk-00mag1n0.js";import{cu as B}from"./chunk-ze3qgdaf.js";import $ from"path";var Y=new Map;function b(Q,z){for(let J of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(J[1])z.add(J[1]);for(let J of Q.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let H of(J[1]??"").split(",")){let K=((H.includes(":")?H.split(":").pop():H)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(K))z.add(K)}for(let J of Q.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let H of(J[1]??"").split(",")){let V=H.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(V))z.add(V)}}async function l(Q){let z;if(Q)z=$.resolve(Q);else{let q=await C();z=$.resolve(q.root||process.cwd(),q.storesDir||"stores")}let J=new Bun.Glob("*.ts"),H=[];try{for await(let q of J.scan({cwd:z,absolute:!0})){let y=$.basename(q,".ts");if(["index","types"].includes(y))continue;if(q.includes(".d.ts"))continue;H.push(q)}}catch{return Z(Y,z,"",""),null}let V=()=>[...new Set([...H,...H.flatMap((q)=>R(q))])],K=O(V()),P=w(Y,z,K);if(P!==void 0)return P||null;if(H.length===0)return Z(Y,z,K,""),null;let A=[];for(let q of H){let y=await Bun.file(q).text();A.push({file:q,hasUseStore:/useStore\s*\(/.test(y)})}A.sort((q,y)=>{if(q.hasUseStore===y.hasUseStore)return 0;return q.hasUseStore?1:-1});let N=A.map((q)=>q.file),G=[],X=new Set,F=k({loader:"ts",target:"browser",define:M()});for(let q of N)try{let y=await Bun.file(q).text(),I=$.basename(q,".ts");if(b(y,X),U(y))y=await T(y,q,{projectRoot:process.cwd(),externalizeUserModules:!1});y=W(y),y=E(y),y=L(y),y=y.replace(/^export\s+(default\s+)?/gm,""),y=F.transformSync(y),G.push(`// Store: ${I}
3
3
  ${y.trim()}`)}catch(y){console.warn(`[stx] Failed to load store ${q}:`,y)}if(G.length===0)return Z(Y,z,K,""),null;let j=G.join(`
4
4
 
5
5
  `),x=`;(function(){
@@ -8,4 +8,4 @@ ${B.filter((q)=>!X.has(q)&&new RegExp(`\\b${q}\\b`).test(j)).map((q)=>`var ${q}
8
8
  `)}
9
9
  ${j}
10
10
  })();`;return K=O(V()),Z(Y,z,K,x),x}function a(){Y.clear()}
11
- export{l as Yi,a as Zi};
11
+ export{l as Zi,a as _i};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ji as a,ki as b,li as c,mi as d,ni as e,oi as f,pi as g,qi as h}from"./chunk-7eg7ep8f.js";import"./chunk-w8yac9xp.js";import"./chunk-6bcw8twx.js";export{d as v,a as useForm,g as processHasErrorsDirective,h as processFormValidationDirectives,f as processErrorsDirective,e as processErrorDirective,b as defineForm,c as Validator};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
2
  var K={},Y=[],O={};function I(){return K}function h(){return O}function D(){K={},Y.length=0,O={}}function U(j){K=Q(K,j)}function Q(j,z){return{title:z.title??j.title,titleTemplate:z.titleTemplate??j.titleTemplate,base:z.base??j.base,meta:[...j.meta||[],...z.meta||[]],link:[...j.link||[],...z.link||[]],script:[...j.script||[],...z.script||[]],style:[...j.style||[],...z.style||[]],htmlAttrs:{...j.htmlAttrs,...z.htmlAttrs},bodyAttrs:{...j.bodyAttrs,...z.bodyAttrs}}}function Z(j){U(_(j))}function _(j){let z=[];if(j.description)z.push({name:"description",content:j.description});if(j.keywords){let L=Array.isArray(j.keywords)?j.keywords.join(", "):j.keywords;z.push({name:"keywords",content:L})}if(j.author)z.push({name:"author",content:j.author});if(j.robots)z.push({name:"robots",content:j.robots});let A=j.ogTitle??j.title,B=j.ogDescription??j.description;if(A)z.push({property:"og:title",content:A});if(B)z.push({property:"og:description",content:B});if(j.ogImage)z.push({property:"og:image",content:j.ogImage});if(j.ogUrl)z.push({property:"og:url",content:j.ogUrl});if(j.ogType)z.push({property:"og:type",content:j.ogType});if(j.ogSiteName)z.push({property:"og:site_name",content:j.ogSiteName});if(j.ogLocale)z.push({property:"og:locale",content:j.ogLocale});let E=j.twitterTitle??j.title,F=j.twitterDescription??j.description,J=j.twitterImage??j.ogImage;if(j.twitterCard)z.push({name:"twitter:card",content:j.twitterCard});if(E)z.push({name:"twitter:title",content:E});if(F)z.push({name:"twitter:description",content:F});if(J)z.push({name:"twitter:image",content:J});if(j.twitterSite)z.push({name:"twitter:site",content:j.twitterSite});if(j.twitterCreator)z.push({name:"twitter:creator",content:j.twitterCreator});if(j.articleAuthor)z.push({property:"article:author",content:j.articleAuthor});if(j.articlePublishedTime)z.push({property:"article:published_time",content:j.articlePublishedTime});if(j.articleModifiedTime)z.push({property:"article:modified_time",content:j.articleModifiedTime});if(j.articleSection)z.push({property:"article:section",content:j.articleSection});if(j.articleTags)for(let L of j.articleTags)z.push({property:"article:tag",content:L});let G=[];if(j.canonical)G.push({rel:"canonical",href:j.canonical});return{title:j.title,titleTemplate:j.titleTemplate,meta:z,link:G}}function S(j){if(O={...O,...j},j.title||j.description)Z({title:j.title,description:j.description})}function P(j){let z=typeof j==="function"?j():j;U({title:z})}function C(j=K){let z=[];if(j.title){let A=j.title;if(j.titleTemplate)A=typeof j.titleTemplate==="function"?j.titleTemplate(A):j.titleTemplate.replace("%s",A);z.push(`<title>${N(A)}</title>`)}if(j.base){let A=Object.entries(j.base).map(([B,E])=>`${B}="${N(E)}"`).join(" ");z.push(`<base ${A}>`)}for(let A of j.meta||[]){let B=Object.entries(A).filter(([E,F])=>F!==void 0).map(([E,F])=>{return`${E==="httpEquiv"?"http-equiv":E}="${N(String(F))}"`}).join(" ");z.push(`<meta ${B}>`)}for(let A of j.link||[]){let B=Object.entries(A).filter(([E,F])=>F!==void 0).map(([E,F])=>`${E}="${N(String(F))}"`).join(" ");z.push(`<link ${B}>`)}for(let A of j.script||[]){let{content:B,...E}=A,F=Object.entries(E).filter(([J,G])=>G!==void 0).map(([J,G])=>{if(typeof G==="boolean")return G?J:"";return`${J}="${N(String(G))}"`}).filter(Boolean).join(" ");if(B)z.push(`<script ${F}>${B}</script>`);else z.push(`<script ${F}></script>`)}for(let A of j.style||[]){let B=A.type?` type="${A.type}"`:"";z.push(`<style${B}>${A.content}</style>`)}return z.join(`
3
3
  `)}function M(j=K){if(!j.htmlAttrs)return"";return Object.entries(j.htmlAttrs).map(([z,A])=>`${z}="${N(A)}"`).join(" ")}function V(j=K){if(!j.bodyAttrs)return"";return Object.entries(j.bodyAttrs).map(([z,A])=>`${z}="${N(A)}"`).join(" ")}function N(j){return j.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function w(j=K){if(typeof document>"u")return;if(j.title){let z=j.title;if(j.titleTemplate)z=typeof j.titleTemplate==="function"?j.titleTemplate(z):j.titleTemplate.replace("%s",z);document.title=z}for(let z of j.meta||[]){let A=z.name?`meta[name="${z.name}"]`:z.property?`meta[property="${z.property}"]`:null;if(A){let B=document.querySelector(A);if(!B){if(B=document.createElement("meta"),z.name)B.setAttribute("name",z.name);if(z.property)B.setAttribute("property",z.property);document.head.appendChild(B)}B.setAttribute("content",z.content)}}for(let z of j.link||[]){let A=`link[rel="${z.rel}"]${z.href?`[href="${z.href}"]`:""}`,B=document.querySelector(A);if(!B)B=document.createElement("link"),document.head.appendChild(B);for(let[E,F]of Object.entries(z))if(F!==void 0)B.setAttribute(E,String(F))}if(j.htmlAttrs)for(let[z,A]of Object.entries(j.htmlAttrs))if(z==="class")for(let B of String(A).split(/\s+/).filter(Boolean))document.documentElement.classList.add(B);else document.documentElement.setAttribute(z,A);if(j.bodyAttrs)for(let[z,A]of Object.entries(j.bodyAttrs))document.body.setAttribute(z,A)}function y(j){let z="";return{content:j.replace(/@head\s*([\s\S]*?)@endhead/g,(B,E)=>{return z+=E.trim()+`
4
- `,""}),headContent:z.trim()}}function x(j,z){return j.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(A,B,E,F)=>{let J=B?E:z[(F||"").trim()]??F,G=z.__stx_runtime_head??{};return z.__stx_runtime_head=Q(G,{title:J}),""})}function T(j,z){return j.replace(/@meta\s*\(\s*(['"`])(.+?)\1\s*,\s*(?:(['"`])(.+?)\3|([^)]+))\s*\)/g,(A,B,E,F,J,G)=>{let L=F?J:G,R=F?L:z[(L||"").trim()]??L,W=E.includes(":")?{property:E,content:R}:{name:E,content:R},X=z.__stx_runtime_head??{};return z.__stx_runtime_head=Q(X,{meta:[W]}),""})}export{I as It,h as Jt,D as Kt,U as Lt,Q as Mt,Z as Nt,_ as Ot,S as Pt,P as Qt,C as Rt,M as St,V as Tt,w as Ut,y as Vt,x as Wt,T as Xt};
4
+ `,""}),headContent:z.trim()}}function x(j,z){return j.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(A,B,E,F)=>{let J=B?E:z[(F||"").trim()]??F,G=z.__stx_runtime_head??{};return z.__stx_runtime_head=Q(G,{title:J}),""})}function T(j,z){return j.replace(/@meta\s*\(\s*(['"`])(.+?)\1\s*,\s*(?:(['"`])(.+?)\3|([^)]+))\s*\)/g,(A,B,E,F,J,G)=>{let L=F?J:G,R=F?L:z[(L||"").trim()]??L,W=E.includes(":")?{property:E,content:R}:{name:E,content:R},X=z.__stx_runtime_head??{};return z.__stx_runtime_head=Q(X,{meta:[W]}),""})}export{I as Jt,h as Kt,D as Lt,U as Mt,Q as Nt,Z as Ot,_ as Pt,S as Qt,P as Rt,C as St,M as Tt,V as Ut,w as Vt,y as Wt,x as Xt,T as Yt};