@stacksjs/stx 0.2.674 → 0.2.676

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 (244) hide show
  1. package/dist/{chunk-szevd7d5.js → chunk-028e9fty.js} +2 -2
  2. package/dist/{chunk-rr527jt6.js → chunk-078qg8r5.js} +2 -2
  3. package/dist/chunk-0gk78x3r.js +2 -0
  4. package/dist/{chunk-fw413k9q.js → chunk-1b9thkg5.js} +2 -2
  5. package/dist/chunk-1e73whqh.js +2 -0
  6. package/dist/chunk-1rztwjdj.js +130 -0
  7. package/dist/{chunk-srq9fqq8.js → chunk-245sas8r.js} +38 -38
  8. package/dist/chunk-248a88mc.js +2 -0
  9. package/dist/chunk-2nqtmp8c.js +2 -0
  10. package/dist/chunk-2pga7zzb.js +4 -0
  11. package/dist/{chunk-bkkpq8dx.js → chunk-304dbbsw.js} +10 -10
  12. package/dist/{chunk-z22zy22p.js → chunk-34e8e8te.js} +2 -2
  13. package/dist/{chunk-md2jn67b.js → chunk-374nhgyf.js} +2 -2
  14. package/dist/chunk-3bfegbpw.js +2 -0
  15. package/dist/chunk-3gdt16xa.js +2 -0
  16. package/dist/chunk-3wsm9g9c.js +2 -0
  17. package/dist/chunk-3xx9d934.js +2 -0
  18. package/dist/{chunk-ham5x7ts.js → chunk-4fhbh04h.js} +4 -4
  19. package/dist/{chunk-5vt48yce.js → chunk-4jnv2v5e.js} +9 -9
  20. package/dist/chunk-4rk5qnqf.js +24 -0
  21. package/dist/chunk-526mf3fr.js +4 -0
  22. package/dist/chunk-54zkkxmb.js +2 -0
  23. package/dist/{chunk-kdebh22m.js → chunk-551s7ha0.js} +10 -10
  24. package/dist/chunk-5v7vm8cv.js +14 -0
  25. package/dist/{chunk-rdr09efy.js → chunk-5z0q3qv3.js} +5 -5
  26. package/dist/{chunk-6sjtyd0k.js → chunk-5z8mq37c.js} +4 -4
  27. package/dist/{chunk-ce6zddpf.js → chunk-6beg47t4.js} +2 -2
  28. package/dist/{chunk-trz8z4j4.js → chunk-6bwca55g.js} +37 -37
  29. package/dist/chunk-6kam8r5y.js +2 -0
  30. package/dist/{chunk-tddnb5bv.js → chunk-6ycyaf5g.js} +2 -2
  31. package/dist/chunk-707sx5sk.js +20 -0
  32. package/dist/chunk-78d5tn4r.js +2 -0
  33. package/dist/{chunk-pb6erpj3.js → chunk-78x52gz3.js} +5 -5
  34. package/dist/{chunk-zp79zkkd.js → chunk-78yjmbbs.js} +2 -2
  35. package/dist/{chunk-v21bhhjb.js → chunk-7j7h1eg3.js} +1 -1
  36. package/dist/{chunk-zmg1peyg.js → chunk-8aq07a1j.js} +3 -3
  37. package/dist/chunk-8p92r2sc.js +2 -0
  38. package/dist/chunk-909ymsjz.js +2 -0
  39. package/dist/{chunk-r7fdw2v5.js → chunk-97h9ga3b.js} +3 -3
  40. package/dist/chunk-9859r1d5.js +2 -0
  41. package/dist/{chunk-25zmy8q6.js → chunk-9wdd7eq6.js} +2 -2
  42. package/dist/{chunk-p6qd7ad0.js → chunk-a2zb5fgg.js} +2 -2
  43. package/dist/chunk-arh1qgmp.js +2 -0
  44. package/dist/chunk-b18x0v21.js +2 -0
  45. package/dist/chunk-b23vscaq.js +2 -0
  46. package/dist/{chunk-4b9s7wgy.js → chunk-be2rswkw.js} +2 -2
  47. package/dist/{chunk-qz5b8ed4.js → chunk-bh19ezq0.js} +5 -5
  48. package/dist/chunk-bm42rsaa.js +2 -0
  49. package/dist/{chunk-cbjabv1w.js → chunk-bpj387yx.js} +6 -6
  50. package/dist/chunk-c4enpsj8.js +2 -0
  51. package/dist/chunk-cdbaanmx.js +2 -0
  52. package/dist/chunk-cfm6a679.js +2 -0
  53. package/dist/chunk-cs8wq7nv.js +2 -0
  54. package/dist/{chunk-hegfgw27.js → chunk-cxgremn0.js} +5 -5
  55. package/dist/chunk-d2xf5hh9.js +2 -0
  56. package/dist/{chunk-rym0309c.js → chunk-d4ch6exz.js} +3 -3
  57. package/dist/chunk-dda8pdya.js +2 -0
  58. package/dist/{chunk-7adznted.js → chunk-dera8fmc.js} +2 -2
  59. package/dist/chunk-dmd7mgjw.js +3 -0
  60. package/dist/chunk-ds91e0fe.js +2 -0
  61. package/dist/{chunk-hgry3mjd.js → chunk-dxh45gve.js} +1 -1
  62. package/dist/chunk-e492je6q.js +2 -0
  63. package/dist/{chunk-7j1zgrnf.js → chunk-ehzd1yc6.js} +9 -9
  64. package/dist/chunk-etz2dmec.js +2 -0
  65. package/dist/{chunk-4s8zacxg.js → chunk-f26n6y9p.js} +4 -4
  66. package/dist/{chunk-4w6baw62.js → chunk-fbrgz3s8.js} +2 -2
  67. package/dist/chunk-fd72t30s.js +2 -0
  68. package/dist/{chunk-sqn3y9qt.js → chunk-fdvfzknd.js} +2 -2
  69. package/dist/chunk-ft3f9nj0.js +2 -0
  70. package/dist/{chunk-dgc1a3yt.js → chunk-fzc98qgn.js} +7 -7
  71. package/dist/{chunk-s0vtjyyj.js → chunk-g12ht81a.js} +2 -2
  72. package/dist/chunk-g6gqja52.js +2 -0
  73. package/dist/{chunk-hb3edeq9.js → chunk-ga5kjf9b.js} +6 -6
  74. package/dist/chunk-ggwvnpwj.js +2 -0
  75. package/dist/{chunk-hsmcbh0p.js → chunk-ghm9f13q.js} +5 -5
  76. package/dist/chunk-gx6wxmbv.js +2 -0
  77. package/dist/chunk-gz5rvwgx.js +2 -0
  78. package/dist/chunk-hamk3dky.js +2 -0
  79. package/dist/{chunk-vayhx642.js → chunk-haz2ezyk.js} +2 -2
  80. package/dist/chunk-hh58k0nh.js +3 -0
  81. package/dist/chunk-hqj28381.js +3 -0
  82. package/dist/chunk-j60jye3e.js +25 -0
  83. package/dist/chunk-jjet6qxq.js +2 -0
  84. package/dist/chunk-jk7chxkt.js +2 -0
  85. package/dist/{chunk-d09q93yf.js → chunk-jv021x8e.js} +2 -2
  86. package/dist/{chunk-pg2v1pb5.js → chunk-k06n5bjp.js} +3 -3
  87. package/dist/{chunk-35ezh7de.js → chunk-k72jqz6a.js} +3 -3
  88. package/dist/chunk-kn34esxw.js +2 -0
  89. package/dist/chunk-kqbpkg8n.js +2 -0
  90. package/dist/{chunk-aet1pgw7.js → chunk-krcd3039.js} +74 -74
  91. package/dist/{chunk-asezs2n3.js → chunk-kxj8e1gd.js} +6 -6
  92. package/dist/{chunk-5zhp87wv.js → chunk-mabja59q.js} +2 -2
  93. package/dist/chunk-mf19qxgv.js +3 -0
  94. package/dist/chunk-mjsebtg6.js +2 -0
  95. package/dist/{chunk-fd49fahd.js → chunk-mn47s2ef.js} +5 -5
  96. package/dist/{chunk-nj343mw2.js → chunk-mq915g3j.js} +5 -5
  97. package/dist/chunk-n63r9b4f.js +2 -0
  98. package/dist/{chunk-j6m8xqh3.js → chunk-n8wvqnfc.js} +2 -2
  99. package/dist/chunk-n94ts3t9.js +21 -0
  100. package/dist/{chunk-w7t2cfgy.js → chunk-p27ptd9f.js} +65 -65
  101. package/dist/{chunk-t0k16vqv.js → chunk-p9az13b2.js} +2 -2
  102. package/dist/chunk-pwn0j1vq.js +2 -0
  103. package/dist/chunk-q1jcf6vm.js +2 -0
  104. package/dist/{chunk-am2w363p.js → chunk-q3gactm1.js} +4 -4
  105. package/dist/chunk-q3nnaxf9.js +2 -0
  106. package/dist/{chunk-w3d98907.js → chunk-q4rejyd2.js} +2 -2
  107. package/dist/{chunk-hz4x7h0n.js → chunk-qbzqary0.js} +5 -5
  108. package/dist/{chunk-a4p18ybc.js → chunk-qr7a378v.js} +3 -3
  109. package/dist/{chunk-bsajk82t.js → chunk-qwdcts9w.js} +19 -19
  110. package/dist/chunk-rc79yyqx.js +2 -0
  111. package/dist/{chunk-yx3dpdwc.js → chunk-rfc5pdv2.js} +3 -3
  112. package/dist/chunk-rnws0dh3.js +2 -0
  113. package/dist/chunk-rxxajm31.js +31 -0
  114. package/dist/{chunk-thceyzj6.js → chunk-rza1p6e4.js} +2 -2
  115. package/dist/chunk-s73z8zss.js +11 -0
  116. package/dist/chunk-s8qe247r.js +2 -0
  117. package/dist/{chunk-d1a86qx8.js → chunk-sptewgky.js} +1 -1
  118. package/dist/{chunk-mwnhdsbp.js → chunk-sqh3tvtw.js} +2 -2
  119. package/dist/{chunk-6s7tvmqp.js → chunk-sr3hmrah.js} +2 -2
  120. package/dist/chunk-sswy3tfc.js +2 -0
  121. package/dist/chunk-swxznm5v.js +2 -0
  122. package/dist/{chunk-9dtbvjpp.js → chunk-tmqrbs98.js} +31 -20
  123. package/dist/chunk-tst8p27s.js +12 -0
  124. package/dist/chunk-tz09earb.js +2 -0
  125. package/dist/{chunk-fbmth6xv.js → chunk-vay5v6sj.js} +13 -13
  126. package/dist/{chunk-ck2e3e47.js → chunk-vd5w1jaz.js} +3 -3
  127. package/dist/chunk-vewt3464.js +2 -0
  128. package/dist/{chunk-xghcsg3f.js → chunk-vg1pg6yt.js} +1 -1
  129. package/dist/{chunk-s2wptfm1.js → chunk-wav0xbnb.js} +2 -2
  130. package/dist/chunk-whzvx5w5.js +2 -0
  131. package/dist/chunk-wk1gt95z.js +2 -0
  132. package/dist/{chunk-t9kxhe46.js → chunk-wr1gm35v.js} +1 -1
  133. package/dist/{chunk-faakv1p6.js → chunk-wscnjtss.js} +2 -2
  134. package/dist/{chunk-t79jfpv6.js → chunk-x4q4bx3q.js} +2 -2
  135. package/dist/chunk-x63f2ywm.js +2 -0
  136. package/dist/{chunk-y1pcdeg9.js → chunk-x7wr720m.js} +5 -5
  137. package/dist/chunk-xk7cp691.js +2 -0
  138. package/dist/chunk-xna6b7km.js +2 -0
  139. package/dist/{chunk-v6peecfp.js → chunk-xnx06qqt.js} +2 -2
  140. package/dist/chunk-xw4rm5zj.js +2 -0
  141. package/dist/{chunk-5qtthtg3.js → chunk-y34tyrpb.js} +7 -7
  142. package/dist/chunk-yar7fwrb.js +2 -0
  143. package/dist/{chunk-2zzc7006.js → chunk-yn9kvsk1.js} +2 -2
  144. package/dist/chunk-yt33wzqk.js +2 -0
  145. package/dist/chunk-z35ftpqp.js +421 -0
  146. package/dist/{chunk-4bgjrrvz.js → chunk-z7ghjs7w.js} +1 -1
  147. package/dist/chunk-zq7xbc1k.js +2 -0
  148. package/dist/cli.js +22 -22
  149. package/dist/client/signals-for-runtime.js +16 -5
  150. package/dist/craft-entry.js +2 -2
  151. package/dist/craft.js +2 -2
  152. package/dist/native/compiler/headwind-to-style.js +13 -1
  153. package/dist/native/compiler/html-to-ir.d.ts +2 -0
  154. package/dist/native/compiler/html-to-ir.js +9 -0
  155. package/dist/native/compiler/ir.d.ts +1 -0
  156. package/dist/native/compiler/render-screen.js +4 -3
  157. package/dist/native/compiler/style-config.d.ts +3 -0
  158. package/dist/native/compiler/style-config.js +5 -0
  159. package/dist/native/components/primitives.d.ts +2 -0
  160. package/dist/native/event-names.js +2 -0
  161. package/dist/native/prop-names.js +1 -0
  162. package/dist/native/runtime/craft-bridge.js +15 -8
  163. package/dist/pwa.js +3 -3
  164. package/dist/signal-processing.js +75 -16
  165. package/dist/ssg-static-paths.d.ts +12 -0
  166. package/dist/ssg-static-paths.js +62 -0
  167. package/dist/ssg.d.ts +2 -4
  168. package/dist/ssg.js +43 -47
  169. package/dist/utils.js +1 -1
  170. package/package.json +2 -2
  171. package/dist/chunk-0jwdcqj8.js +0 -2
  172. package/dist/chunk-0mwdq478.js +0 -2
  173. package/dist/chunk-0nfqgv4n.js +0 -4
  174. package/dist/chunk-1y6egkty.js +0 -2
  175. package/dist/chunk-280p4q7a.js +0 -2
  176. package/dist/chunk-2881tcqt.js +0 -2
  177. package/dist/chunk-2a775q7x.js +0 -2
  178. package/dist/chunk-2asdbd5e.js +0 -2
  179. package/dist/chunk-34yj93hh.js +0 -2
  180. package/dist/chunk-40tswfe7.js +0 -21
  181. package/dist/chunk-41de209e.js +0 -2
  182. package/dist/chunk-506mv7hb.js +0 -3
  183. package/dist/chunk-5s1ay9mv.js +0 -2
  184. package/dist/chunk-7kznee1g.js +0 -2
  185. package/dist/chunk-7mvz972c.js +0 -12
  186. package/dist/chunk-80zgyaqe.js +0 -2
  187. package/dist/chunk-84tqb1rn.js +0 -2
  188. package/dist/chunk-8azm7nha.js +0 -2
  189. package/dist/chunk-902qnyg0.js +0 -2
  190. package/dist/chunk-9n6jwcpb.js +0 -2
  191. package/dist/chunk-a6y8td0d.js +0 -2
  192. package/dist/chunk-a7kt1ts4.js +0 -2
  193. package/dist/chunk-a81y8g40.js +0 -2
  194. package/dist/chunk-aft1zc84.js +0 -2
  195. package/dist/chunk-bawq4fqy.js +0 -31
  196. package/dist/chunk-bdp2r0v4.js +0 -2
  197. package/dist/chunk-brtvm8mb.js +0 -2
  198. package/dist/chunk-bvzr9zqt.js +0 -2
  199. package/dist/chunk-cbvgtf3m.js +0 -2
  200. package/dist/chunk-cfydbaeq.js +0 -2
  201. package/dist/chunk-dq8c3h4n.js +0 -2
  202. package/dist/chunk-e36pne7n.js +0 -2
  203. package/dist/chunk-e62qfexp.js +0 -2
  204. package/dist/chunk-eq5jzaj5.js +0 -2
  205. package/dist/chunk-f9zyf9n6.js +0 -421
  206. package/dist/chunk-fb7t1nn9.js +0 -24
  207. package/dist/chunk-fr39emcz.js +0 -2
  208. package/dist/chunk-fsq13amm.js +0 -2
  209. package/dist/chunk-fxh12vqd.js +0 -2
  210. package/dist/chunk-gcc9fa33.js +0 -2
  211. package/dist/chunk-h6t2ney6.js +0 -2
  212. package/dist/chunk-hvtzw1jh.js +0 -2
  213. package/dist/chunk-j8g5cvvm.js +0 -2
  214. package/dist/chunk-jzjpyyw2.js +0 -2
  215. package/dist/chunk-k1b8x73j.js +0 -2
  216. package/dist/chunk-nw9bdk2n.js +0 -2
  217. package/dist/chunk-p4jkswz8.js +0 -2
  218. package/dist/chunk-p4r90vqf.js +0 -2
  219. package/dist/chunk-p8bgy5tt.js +0 -2
  220. package/dist/chunk-pqqe2b6m.js +0 -11
  221. package/dist/chunk-q6nwcav4.js +0 -2
  222. package/dist/chunk-qmqavdz2.js +0 -2
  223. package/dist/chunk-qpw72bty.js +0 -2
  224. package/dist/chunk-qwnh1kj6.js +0 -2
  225. package/dist/chunk-qy9m6qdn.js +0 -2
  226. package/dist/chunk-qychcdsm.js +0 -2
  227. package/dist/chunk-rj3w1ama.js +0 -2
  228. package/dist/chunk-rv39s5az.js +0 -20
  229. package/dist/chunk-sf0r963g.js +0 -2
  230. package/dist/chunk-ss820yys.js +0 -2
  231. package/dist/chunk-t4j9g2vh.js +0 -2
  232. package/dist/chunk-trh7s6k3.js +0 -130
  233. package/dist/chunk-ttemwrbx.js +0 -2
  234. package/dist/chunk-twqzn21x.js +0 -14
  235. package/dist/chunk-v14rq8b4.js +0 -3
  236. package/dist/chunk-vdxg7e1y.js +0 -4
  237. package/dist/chunk-vq513cxx.js +0 -2
  238. package/dist/chunk-vvq8xe3n.js +0 -2
  239. package/dist/chunk-w8t31bn9.js +0 -2
  240. package/dist/chunk-x1kz4d7j.js +0 -2
  241. package/dist/chunk-xaa36b0x.js +0 -3
  242. package/dist/chunk-xcsyqwxf.js +0 -25
  243. package/dist/chunk-xn9jrjzh.js +0 -2
  244. package/dist/chunk-z97bwx8m.js +0 -2
package/dist/ssg.js CHANGED
@@ -1,58 +1,54 @@
1
1
  // @bun
2
- import"./chunk-md2jn67b.js";import"./chunk-bsajk82t.js";import"./chunk-zp79zkkd.js";import"./chunk-ce6zddpf.js";import"./chunk-f9zyf9n6.js";import"./chunk-25zmy8q6.js";import"./chunk-mwnhdsbp.js";import"./chunk-7adznted.js";import{wt,xt,St,kt,_t,Ct}from"./chunk-4s8zacxg.js";import{o}from"./chunk-srq9fqq8.js";import{Zr}from"./chunk-5qtthtg3.js";import"./chunk-am2w363p.js";import"./chunk-hz4x7h0n.js";import{Ce,Gt,Kt}from"./chunk-rv39s5az.js";import"./chunk-4b9s7wgy.js";import{h}from"./chunk-kdebh22m.js";import{gt,s}from"./chunk-aet1pgw7.js";import"./chunk-7j1zgrnf.js";import"./chunk-bkkpq8dx.js";import"./chunk-40tswfe7.js";import"./chunk-xcsyqwxf.js";import"./chunk-rr527jt6.js";import{Yi,Zi,Qi}from"./chunk-r7fdw2v5.js";import{qt,jn,Bn}from"./chunk-xaa36b0x.js";import"./chunk-v6peecfp.js";import{U,he}from"./chunk-twqzn21x.js";import"./chunk-hgry3mjd.js";import"./chunk-rym0309c.js";import{c}from"./chunk-v14rq8b4.js";import x from"fs";import g from"path";import{createHash as mt}from"crypto";function yt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var vt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function bt(t){return Bun.hash(t).toString(16)}function nt(t,n={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let i=new Map,r=t.replace(vt,(e,l,w,y)=>{let f=y.trim();if(!f)return e;if(/\bdata-stx-src=/.test(w))return e;if(n.minify)f=yt(f);let S=bt(f);if(!i.has(S))i.set(S,f);let P=n.integrity?` data-stx-integrity="sha384-${mt("sha384").update(f).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${l}" data-stx-src="/_stx/islands/${S}.js"${P}${w}></script>`}),a=Array.from(i,([e,l])=>({hash:e,code:l}));return{html:r,chunks:a}}var Pt=new Set(["visible","idle"]);function it(t){if(!t.includes("data-stx-src="))return t;let n=new Map,i=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,r;while((r=i.exec(t))!==null)n.set(r[1],r[2]);let a=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,l;while((l=e.exec(t))!==null)if(Pt.has(n.get(l[1])||""))a.add(l[2]);let w=t.lastIndexOf("</head>");if(a.size===0||w===-1)return t;let y=Array.from(a).filter((f)=>!t.includes(`rel="prefetch" href="${f}"`)).map((f)=>`<link rel="prefetch" href="${f}" as="script">`).join("");if(!y)return t;return t.slice(0,w)+y+t.slice(w)}var $t=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function q(t){let n=t.trim();if(!n)return null;let i=/^https?:\/\//i.test(n)?n:`https://${n}`;try{return new URL(i).origin+new URL(i).pathname.replace(/\/$/,"")}catch{return null}}function Dt(t){for(let n of $t){let i=t[n];if(!i)continue;let r=q(i);if(r)return{url:r,source:"env",via:n}}return null}function st(t){if(!t||typeof t!=="object")return null;let n=t,i=n.site?.url??n.url??n.app?.url;return typeof i==="string"?q(i):null}async function Rt(t){let{existsSync:n}=await import("fs"),i=await import("path");for(let r of["site.config.ts","site.config.js",".config/site.config.ts"]){let a=i.resolve(t,r);if(!n(a))continue;try{let e=await import(a),l=st(e.default??e);if(l)return l}catch{}}return null}async function at(t={}){let n=t.cwd??process.cwd(),i=t.env??process.env;if(t.explicit){let l=q(t.explicit);if(l)return{url:l,source:"option"}}let r=st(t.stxConfig);if(r)return{url:r,source:"stx.config",via:"site.url"};let a=await Rt(n);if(a)return{url:a,source:"site.config",via:"url"};let e=Dt(i);if(e)return e;return{url:"http://localhost",source:"fallback"}}function ot(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
3
- `)}class ct{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,n=""){this.cacheDir=t,this.salt=n}async load(){if(this.loaded)return;let t=g.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let n=JSON.parse(await Bun.file(t).text());for(let[i,r]of Object.entries(n))this.cache.set(i,r)}catch{}this.loaded=!0}async save(){await x.promises.mkdir(this.cacheDir,{recursive:!0});let t=g.join(this.cacheDir,"build-cache.json"),n={};for(let[i,r]of this.cache)n[i]=r;await Bun.write(t,JSON.stringify(n))}getHash(t,n){let i=x.statSync(t),r=`${this.salt}|${t}:${i.mtimeMs}`;for(let e of n)if(x.existsSync(e)){let l=x.statSync(e);r+=`:${e}:${l.mtimeMs}`}let a=0;for(let e=0;e<r.length;e++){let l=r.charCodeAt(e);a=(a<<5)-a+l,a=a&a}return Math.abs(a).toString(36)}get(t,n){let i=this.cache.get(t);if(!i)return null;let r=this.getHash(n,i.dependencies??[]);if(i.hash!==r)return this.cache.delete(t),null;return i.html}set(t,n,i,r){let a=this.getHash(n,i);this.cache.set(t,{hash:a,html:r,generatedAt:Date.now(),dependencies:i})}}class lt{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let n=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return g.join(this.cacheDir,"isr",n)}async get(t){let n=this.getFilePath(t);if(!await Bun.file(n).exists())return null;try{return JSON.parse(await Bun.file(n).text())}catch{return null}}async set(t,n){let i=this.getFilePath(t);await x.promises.mkdir(g.dirname(i),{recursive:!0}),await Bun.write(i,JSON.stringify(n))}async invalidate(t){let n=this.getFilePath(t);if(await Bun.file(n).exists())await x.promises.unlink(n)}async invalidatePattern(t){let n=g.join(this.cacheDir,"isr");if(!x.existsSync(n))return;let i=await x.promises.readdir(n);for(let r of i){let a=r.replace(/_/g,"/").replace(".json","");if(t.test(a))await x.promises.unlink(g.join(n,r))}}async needsRevalidation(t){let n=await this.get(t);if(!n)return!0;return Date.now()>n.revalidateAfter}}async function Et(t){try{let i=(await Bun.file(t).text()).match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!i)return null;let r=i[1];if(!r.includes("getStaticPaths"))return null;let a=r.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticPaths\s*\([^)]*\)\s*\{([\s\S]*?)\n[\t ]*\}/);if(!a)return null;return await Function(`
4
- return (async function getStaticPaths() {
5
- ${a[1]}
6
- })()
7
- `)()}catch(n){return console.error(`Error extracting static paths from ${t}:`,n),null}}async function It(t){let n=[];if(!t.isDynamic)n.push({url:t.pattern,params:{}});else{let i=await Et(t.filePath);if(!i||i.paths.length===0)return console.warn(`Warning: Dynamic route ${t.pattern} has no getStaticPaths or returned empty paths`),n;for(let r of i.paths){let a=t.pattern;for(let[e,l]of Object.entries(r.params))a=a.replace(`:${e}`,l).replace(`:${e}*`,l);n.push({url:a,params:r.params,props:r.props,revalidate:r.revalidate})}}return n}async function Bt(t){let n=[t.replace(/\.stx$/,".data.ts"),t.replace(/\.stx$/,".data.js"),t+".data.ts",t+".data.js"];for(let i of n)if(await Bun.file(i).exists())try{let r=await import(i);if(typeof r.default==="function")return await r.default();else if(typeof r.default==="object")return r.default;else if(typeof r.getData==="function")return await r.getData();else{let{default:a,...e}=r;return e}}catch(r){console.error(`Error loading data file ${i}:`,r)}return null}async function jt(t,n,i){let r=t.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!r)return null;let a=r[1];if(!a.includes("getStaticProps"))return null;try{let e=a.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!e)return null;return await Function("params",`
2
+ import"./chunk-374nhgyf.js";import{y,nc}from"./chunk-qwdcts9w.js";import"./chunk-78yjmbbs.js";import"./chunk-6beg47t4.js";import{Et}from"./chunk-z35ftpqp.js";import"./chunk-9wdd7eq6.js";import"./chunk-sqh3tvtw.js";import"./chunk-dera8fmc.js";import{wt,xt,St,kt,_t,Ct}from"./chunk-f26n6y9p.js";import{i}from"./chunk-245sas8r.js";import{es}from"./chunk-y34tyrpb.js";import"./chunk-q3gactm1.js";import"./chunk-qbzqary0.js";import{Ee,Xt,Jt}from"./chunk-707sx5sk.js";import"./chunk-be2rswkw.js";import{h}from"./chunk-551s7ha0.js";import{gt,o}from"./chunk-krcd3039.js";import"./chunk-ehzd1yc6.js";import"./chunk-304dbbsw.js";import"./chunk-n94ts3t9.js";import"./chunk-j60jye3e.js";import"./chunk-078qg8r5.js";import{Zi,Qi,ea}from"./chunk-97h9ga3b.js";import{Kt,Fn,zn}from"./chunk-hqj28381.js";import{Gt}from"./chunk-dmd7mgjw.js";import"./chunk-xnx06qqt.js";import{W,ye}from"./chunk-5v7vm8cv.js";import"./chunk-dxh45gve.js";import"./chunk-d4ch6exz.js";import{c}from"./chunk-mf19qxgv.js";import{r,fe}from"./chunk-tst8p27s.js";import k from"fs";import p from"path";import{createHash as Pt}from"crypto";function $t(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var Dt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Rt(t){return Bun.hash(t).toString(16)}function at(t,n={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let a=new Map,s=t.replace(Dt,(e,u,f,x)=>{let m=x.trim();if(!m)return e;if(/\bdata-stx-src=/.test(f))return e;if(n.minify)m=$t(m);let b=Rt(m);if(!a.has(b))a.set(b,m);let v=n.integrity?` data-stx-integrity="sha384-${Pt("sha384").update(m).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${b}.js"${v}${f}></script>`}),l=Array.from(a,([e,u])=>({hash:e,code:u}));return{html:s,chunks:l}}var It=new Set(["visible","idle"]);function ot(t){if(!t.includes("data-stx-src="))return t;let n=new Map,a=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,s;while((s=a.exec(t))!==null)n.set(s[1],s[2]);let l=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=e.exec(t))!==null)if(It.has(n.get(u[1])||""))l.add(u[2]);let f=t.lastIndexOf("</head>");if(l.size===0||f===-1)return t;let x=Array.from(l).filter((m)=>!t.includes(`rel="prefetch" href="${m}"`)).map((m)=>`<link rel="prefetch" href="${m}" as="script">`).join("");if(!x)return t;return t.slice(0,f)+x+t.slice(f)}var Bt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function K(t){let n=t.trim();if(!n)return null;let a=/^https?:\/\//i.test(n)?n:`https://${n}`;try{return new URL(a).origin+new URL(a).pathname.replace(/\/$/,"")}catch{return null}}function jt(t){for(let n of Bt){let a=t[n];if(!a)continue;let s=K(a);if(s)return{url:s,source:"env",via:n}}return null}function ct(t){if(!t||typeof t!=="object")return null;let n=t,a=n.site?.url??n.url??n.app?.url;return typeof a==="string"?K(a):null}async function Ft(t){let{existsSync:n}=await import("fs"),a=await import("path");for(let s of["site.config.ts","site.config.js",".config/site.config.ts"]){let l=a.resolve(t,s);if(!n(l))continue;try{let e=await import(l),u=ct(e.default??e);if(u)return u}catch{}}return null}async function lt(t={}){let n=t.cwd??process.cwd(),a=t.env??process.env;if(t.explicit){let u=K(t.explicit);if(u)return{url:u,source:"option"}}let s=ct(t.stxConfig);if(s)return{url:s,source:"stx.config",via:"site.url"};let l=await Ft(n);if(l)return{url:l,source:"site.config",via:"url"};let e=jt(a);if(e)return e;return{url:"http://localhost",source:"fallback"}}function ut(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
3
+ `)}function q(t){return async()=>({paths:await t(),fallback:!1})}var Tt;function Ot(t){let n=r(t),{depths:a}=fe(n),s=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,l;while((l=s.exec(n))!==null){if(a[l.index]!==0)continue;let u=y(n,"(",")",s.lastIndex-1),f=n.indexOf("{",u+1),x=y(n,"{","}",f);if(u<0||f<0||x<0)break;return t.slice(l.index,x+1)}let e=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((l=e.exec(n))!==null){if(a[l.index]!==0)continue;let u=nc(n,e.lastIndex).endPos;return t.slice(e.lastIndex,u).trim()}throw SyntaxError("Could not extract getStaticPaths; use a top-level function or const declaration")}async function dt(t){let n="read";try{let a=await Bun.file(t).text();n="parse";let s=Gt(a),l=[...s.server,...s.client,...s.signals].filter((e)=>/(?:^|\s)server(?:\s|=|$)/i.test(r(e.attrs))).sort((e,u)=>a.indexOf(e.fullTag)-a.indexOf(u.fullTag));for(let e of l){if(!/\bgetStaticPaths\b/.test(r(e.content)))continue;let u=(Tt??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(e.content);if(!/\bgetStaticPaths\b/.test(r(u)))continue;let f=Ot(u);if(/\bdefineStaticPaths\b/.test(r(f))&&Et(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");n="execute";let x=Function("defineStaticPaths",`return (${f})`)(q);if(typeof x!=="function")throw TypeError("getStaticPaths must be a function");let m=await x();n="result";let b=Array.isArray(m)?{paths:m}:m;if(!b||typeof b!=="object"||!("paths"in b)||!Array.isArray(b.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let v of b.paths)if(!v||typeof v!=="object"||!v.params||typeof v.params!=="object"||Array.isArray(v.params))throw TypeError("Each getStaticPaths path must contain a params object");return{kind:"ok",value:b}}return{kind:"absent"}}catch(a){return{kind:"error",phase:n,error:a instanceof Error?a:Error(String(a))}}}class pt{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,n=""){this.cacheDir=t,this.salt=n}async load(){if(this.loaded)return;let t=p.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let n=JSON.parse(await Bun.file(t).text());for(let[a,s]of Object.entries(n))this.cache.set(a,s)}catch{}this.loaded=!0}async save(){await k.promises.mkdir(this.cacheDir,{recursive:!0});let t=p.join(this.cacheDir,"build-cache.json"),n={};for(let[a,s]of this.cache)n[a]=s;await Bun.write(t,JSON.stringify(n))}getHash(t,n){let a=k.statSync(t),s=`${this.salt}|${t}:${a.mtimeMs}`;for(let e of n)if(k.existsSync(e)){let u=k.statSync(e);s+=`:${e}:${u.mtimeMs}`}let l=0;for(let e=0;e<s.length;e++){let u=s.charCodeAt(e);l=(l<<5)-l+u,l=l&l}return Math.abs(l).toString(36)}get(t,n){let a=this.cache.get(t);if(!a)return null;let s=this.getHash(n,a.dependencies??[]);if(a.hash!==s)return this.cache.delete(t),null;return a.html}set(t,n,a,s){let l=this.getHash(n,a);this.cache.set(t,{hash:l,html:s,generatedAt:Date.now(),dependencies:a})}}class ht{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let n=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return p.join(this.cacheDir,"isr",n)}async get(t){let n=this.getFilePath(t);if(!await Bun.file(n).exists())return null;try{return JSON.parse(await Bun.file(n).text())}catch{return null}}async set(t,n){let a=this.getFilePath(t);await k.promises.mkdir(p.dirname(a),{recursive:!0}),await Bun.write(a,JSON.stringify(n))}async invalidate(t){let n=this.getFilePath(t);if(await Bun.file(n).exists())await k.promises.unlink(n)}async invalidatePattern(t){let n=p.join(this.cacheDir,"isr");if(!k.existsSync(n))return;let a=await k.promises.readdir(n);for(let s of a){let l=s.replace(/_/g,"/").replace(".json","");if(t.test(l))await k.promises.unlink(p.join(n,s))}}async needsRevalidation(t){let n=await this.get(t);if(!n)return!0;return Date.now()>n.revalidateAfter}}async function At(t){let n=[];if(!t.isDynamic)n.push({url:t.pattern,params:{}});else{let a=await dt(t.filePath);if(a.kind==="error")throw Error(`getStaticPaths ${a.phase} failed for ${t.pattern} (${t.filePath}): ${a.error.message}`,{cause:a.error});if(a.kind==="absent")return console.warn(`Warning: Dynamic route ${t.pattern} (${t.filePath}) has no getStaticPaths`),n;let s=a.value;if(s.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${t.pattern} (${t.filePath})`),n;for(let l of s.paths){let e=t.pattern;for(let[u,f]of Object.entries(l.params))e=e.replace(`:${u}`,f).replace(`:${u}*`,f);n.push({url:e,params:l.params,props:l.props,revalidate:l.revalidate})}}return n}async function Lt(t){let n=[t.replace(/\.stx$/,".data.ts"),t.replace(/\.stx$/,".data.js"),t+".data.ts",t+".data.js"];for(let a of n)if(await Bun.file(a).exists())try{let s=await import(a);if(typeof s.default==="function")return await s.default();else if(typeof s.default==="object")return s.default;else if(typeof s.getData==="function")return await s.getData();else{let{default:l,...e}=s;return e}}catch(s){console.error(`Error loading data file ${a}:`,s)}return null}async function Ut(t,n,a){let s=t.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!s)return null;let l=s[1];if(!l.includes("getStaticProps"))return null;try{let e=l.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!e)return null;return await Function("params",`
8
4
  return (async function getStaticProps() {
9
5
  ${e[1]}
10
6
  })()
11
- `)(n)}catch(e){return console.error(`Error executing getStaticProps in ${i}:`,e),null}}function Ft(t){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(t)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(t)}async function ut(t,n,i={},r,a){let e=await Bun.file(t.filePath).text(),l=await Bt(t.filePath),w=await jt(e,n,t.filePath),y={...l||{},...w||{},...i,params:n,$route:{path:t.pattern,params:n}},f=new Set,S=[],P=[],D={...a,...r.partialsDir?{partialsDir:r.partialsDir}:{},...r.componentsDir?{componentsDir:r.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(b)=>{S.push(`${g.relative(process.cwd(),b.templatePath)}: ${b.message}
12
- resolved against partialsDir: ${b.partialsDir}`)},onServerScriptError:(b)=>{P.push(`${g.relative(process.cwd(),b.sourcePath)} (${b.kind}): ${b.message}`)}};if(Ft(e))console.warn(`Warning: ${t.pattern} exports a page action, which cannot run in a static build. Its form will submit to a file. Serve this route with the production server, or point the form's action at a route handler.`);let p=await s(e,y,t.filePath,D,f);for(let b of[t.filePath,...f])for(let B of Ce(b))f.add(B);if(Object.keys(n).length>0){let b=`<script>if(window.stx)window.stx._rp=${JSON.stringify(n)};else window.__stx_rp=${JSON.stringify(n)};</script>`;if(p.includes("</head>"))p=p.replace("</head>",`${b}
13
- </head>`);else p=`${b}
14
- ${p}`}if(p=await he(p,{router:r.router}),p=await h(p),r.minify!==!1)return{html:Ot(p),dependencies:Array.from(f),includeFailures:S,serverScriptFailures:P};return{html:p,dependencies:Array.from(f),includeFailures:S,serverScriptFailures:P}}function Ot(t){let n=[],i=0,r=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,a;while((a=r.exec(t))!==null){let l=t.slice(i,a.index);n.push(l.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><"));let w=a[1],y=a[2],f=a[3];y=y.replace(/([^:"\\'`])\/\/(?!\/)(?![*!])([^\n]*)/g,"$1"),n.push(w+y+f),i=a.index+a[0].length}let e=t.slice(i);return n.push(e.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><")),n.join("").trim()}function Tt(t){let n=0;for(let i=0;i<t.length;i++){let r=t.charCodeAt(i);n=(n<<5)-n+r,n=n&n}return`"${Math.abs(n).toString(36)}"`}function At(t,n,i,r){if(i?.sitemap===!1)return!0;if(/<meta[^>]+name=["']robots["'][^>]+content=["'][^"']*noindex/i.test(n))return!0;return r.some((a)=>{if(a instanceof RegExp)return a.test(t);return a.endsWith("/")?t===a.slice(0,-1)||t.startsWith(a):t===a})}function Lt(t,n){return`<?xml version="1.0" encoding="UTF-8"?>
7
+ `)(n)}catch(e){return console.error(`Error executing getStaticProps in ${a}:`,e),null}}function Mt(t){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(t)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(t)}async function ft(t,n,a={},s,l){let e=await Bun.file(t.filePath).text(),u=await Lt(t.filePath),f=await Ut(e,n,t.filePath),x={...u||{},...f||{},...a,params:n,$route:{path:t.pattern,params:n}},m=new Set,b=[],v=[],R={...l,...s.partialsDir?{partialsDir:s.partialsDir}:{},...s.componentsDir?{componentsDir:s.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(D)=>{b.push(`${p.relative(process.cwd(),D.templatePath)}: ${D.message}
8
+ resolved against partialsDir: ${D.partialsDir}`)},onServerScriptError:(D)=>{v.push(`${p.relative(process.cwd(),D.sourcePath)} (${D.kind}): ${D.message}`)}};if(Mt(e))console.warn(`Warning: ${t.pattern} exports a page action, which cannot run in a static build. Its form will submit to a file. Serve this route with the production server, or point the form's action at a route handler.`);let S=await o(e,x,t.filePath,R,m);for(let D of[t.filePath,...m])for(let F of Ee(D))m.add(F);if(Object.keys(n).length>0){let D=`<script>if(window.stx)window.stx._rp=${JSON.stringify(n)};else window.__stx_rp=${JSON.stringify(n)};</script>`;if(S.includes("</head>"))S=S.replace("</head>",`${D}
9
+ </head>`);else S=`${D}
10
+ ${S}`}if(S=await ye(S,{router:s.router}),S=await h(S),s.minify!==!1)return{html:Nt(S),dependencies:Array.from(m),includeFailures:b,serverScriptFailures:v};return{html:S,dependencies:Array.from(m),includeFailures:b,serverScriptFailures:v}}function Nt(t){let n=[],a=0,s=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,l;while((l=s.exec(t))!==null){let u=t.slice(a,l.index);n.push(u.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><"));let f=l[1],x=l[2],m=l[3];x=x.replace(/([^:"\\'`])\/\/(?!\/)(?![*!])([^\n]*)/g,"$1"),n.push(f+x+m),a=l.index+l[0].length}let e=t.slice(a);return n.push(e.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><")),n.join("").trim()}function zt(t){let n=0;for(let a=0;a<t.length;a++){let s=t.charCodeAt(a);n=(n<<5)-n+s,n=n&n}return`"${Math.abs(n).toString(36)}"`}function Ht(t,n,a,s){if(a?.sitemap===!1)return!0;if(/<meta[^>]+name=["']robots["'][^>]+content=["'][^"']*noindex/i.test(n))return!0;return s.some((l)=>{if(l instanceof RegExp)return l.test(t);return l.endsWith("/")?t===l.slice(0,-1)||t.startsWith(l):t===l})}function Wt(t,n){return`<?xml version="1.0" encoding="UTF-8"?>
15
11
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
16
- ${t.map((r)=>{let a=new URL(r.loc,n).href,e=` <url>
17
- <loc>${I(a)}</loc>`;if(r.lastmod)e+=`
18
- <lastmod>${r.lastmod}</lastmod>`;if(r.changefreq)e+=`
19
- <changefreq>${r.changefreq}</changefreq>`;if(r.priority!==void 0)e+=`
20
- <priority>${r.priority}</priority>`;return e+=`
12
+ ${t.map((s)=>{let l=new URL(s.loc,n).href,e=` <url>
13
+ <loc>${j(l)}</loc>`;if(s.lastmod)e+=`
14
+ <lastmod>${s.lastmod}</lastmod>`;if(s.changefreq)e+=`
15
+ <changefreq>${s.changefreq}</changefreq>`;if(s.priority!==void 0)e+=`
16
+ <priority>${s.priority}</priority>`;return e+=`
21
17
  </url>`,e}).join(`
22
18
  `)}
23
- </urlset>`}function I(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function Mt(t,n){let i=n.map((r)=>{let a=" <item>";if(a+=`
24
- <title>${I(r.title)}</title>`,a+=`
25
- <link>${I(r.link)}</link>`,r.description)a+=`
26
- <description>${I(r.description)}</description>`;if(r.pubDate)a+=`
27
- <pubDate>${r.pubDate.toUTCString()}</pubDate>`;if(r.author)a+=`
28
- <author>${I(r.author)}</author>`;if(r.categories)for(let e of r.categories)a+=`
29
- <category>${I(e)}</category>`;if(r.guid)a+=`
30
- <guid>${I(r.guid)}</guid>`;return a+=`
31
- </item>`,a});return`<?xml version="1.0" encoding="UTF-8"?>
19
+ </urlset>`}function j(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function qt(t,n){let a=n.map((s)=>{let l=" <item>";if(l+=`
20
+ <title>${j(s.title)}</title>`,l+=`
21
+ <link>${j(s.link)}</link>`,s.description)l+=`
22
+ <description>${j(s.description)}</description>`;if(s.pubDate)l+=`
23
+ <pubDate>${s.pubDate.toUTCString()}</pubDate>`;if(s.author)l+=`
24
+ <author>${j(s.author)}</author>`;if(s.categories)for(let e of s.categories)l+=`
25
+ <category>${j(e)}</category>`;if(s.guid)l+=`
26
+ <guid>${j(s.guid)}</guid>`;return l+=`
27
+ </item>`,l});return`<?xml version="1.0" encoding="UTF-8"?>
32
28
  <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
33
29
  <channel>
34
- <title>${I(t.title)}</title>
35
- <link>${I(t.link)}</link>
36
- <description>${I(t.description)}</description>
30
+ <title>${j(t.title)}</title>
31
+ <link>${j(t.link)}</link>
32
+ <description>${j(t.description)}</description>
37
33
  ${t.language?`<language>${t.language}</language>`:""}
38
- ${t.copyright?`<copyright>${I(t.copyright)}</copyright>`:""}
34
+ ${t.copyright?`<copyright>${j(t.copyright)}</copyright>`:""}
39
35
  <lastBuildDate>${new Date().toUTCString()}</lastBuildDate>
40
36
  <atom:link href="${t.link}/rss.xml" rel="self" type="application/rss+xml"/>
41
- ${i.join(`
37
+ ${a.join(`
42
38
  `)}
43
39
  </channel>
44
- </rss>`}async function Ut(t={}){let n=Date.now();Kt();let i=await o(process.cwd()),r=i.build||{},a=await at({explicit:t.domain||r.domain,stxConfig:i});if(a.source==="fallback"&&(t.sitemap??r.sitemap??!0))console.warn(ot());let e={router:t.router??i?.router??{},pagesDir:t.pagesDir||r.pagesDir||"pages",outputDir:t.outputDir||r.outputDir||"dist",baseUrl:t.baseUrl||r.baseUrl||"/",domain:a.url,revalidate:t.revalidate??r.revalidate??!1,sitemap:t.sitemap??r.sitemap??!0,sitemapExclude:t.sitemapExclude||r.sitemapExclude||[],robots:t.robots??r.robots??!0,rss:t.rss??r.rss??!1,concurrency:t.concurrency||r.concurrency||10,cache:t.cache??r.cache??!0,cacheDir:t.cacheDir||r.cacheDir||c(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??r.minify??!0,generate404:t.generate404??r.generate404??!0,publicDir:t.publicDir||r.publicDir||"public",trailingSlash:t.trailingSlash??r.trailingSlash??!1,cleanOutput:t.cleanOutput??r.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||i?.partialsDir||"",componentsDir:t.componentsDir||i?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},l={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},w=new Set,y=0,f={},S={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&x.existsSync(e.outputDir))await x.promises.rm(e.outputDir,{recursive:!0});await x.promises.mkdir(e.outputDir,{recursive:!0});let D=e.cacheSalt;if(!D){let{resolveUserCssConfig:u,fingerprintConfig:m}=await import("./chunk-5s1ay9mv.js");try{D=m(await u(process.cwd()))}catch{}}let{prepareImageDelivery:p}=await import("./chunk-k1b8x73j.js"),b=await p(e.publicDir,e.outputDir);if(b.count>0)console.log(`Optimized ${b.count} image(s) for responsive delivery`),D=[D,b.fingerprint].filter(Boolean).join(":");let B=new ct(e.cacheDir,D);if(e.cache)await B.load();try{let{generateCss:u}=await import("./chunk-5s1ay9mv.js");await u('<div class="bg-black"></div>')}catch{}wt();let dt=i?.routeMiddleware?.dir||"middleware";await St(process.cwd(),dt);let H=xt();if(H.length>0)console.log(`Loaded ${H.length} middleware: ${H.join(", ")}`);let pt=i?.routeMiddleware?.global||[];Qi(i?.layoutsDir,c(process.cwd()));let V=U(".",{pagesDir:e.pagesDir,pagesDirs:i?._layerPageDirs});console.log(`Found ${V.length} routes`);let G=[];for(let u of V){let m=await It(u);for(let v of m)G.push({route:u,url:v.url,params:v.params,props:v.props,revalidate:v.revalidate??e.revalidate})}l.totalPages=G.length,console.log(`Generating ${l.totalPages} pages...`);let A=[],K=[];for(let u=0;u<G.length;u+=e.concurrency)K.push(G.slice(u,u+e.concurrency));for(let u of K)await Promise.all(u.map(async(m)=>{let{route:v,url:d,params:L,props:ht,revalidate:Z}=m;try{await e.hooks.onPageStart?.(d);let j=await Bun.file(v.filePath).text(),F=Wt(j),ft=F?.middleware?Array.isArray(F.middleware)?F.middleware:[F.middleware]:[],Q=[...pt,...ft];if(Q.length>0){let C=kt(d,L,F||{}),O=_t(C,null,void 0,{isServer:!0}),E=await Ct(Q,O);if(E.redirect){let R=typeof E.redirect==="string"?E.redirect:E.redirect.path||E.redirect,_=Jt(String(R),d),T=Vt(d,e);await x.promises.mkdir(g.dirname(T),{recursive:!0}),await Bun.write(T,_),l.successCount++,l.pages.push({route:d,outputPath:T,size:Buffer.byteLength(_),cached:!1}),A.push({loc:d,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${d} \u2192 redirect to ${R}`);return}if(E.abort){let R=typeof E.abort==="string"?E.abort:E.abort?.error?.message||"aborted";console.warn(` \u21B3 ${d} \u2014 middleware aborted: ${R}`);return}}let tt=j.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(tt)try{if(!await Function("route",`
45
- const validate = ${tt[1]};
40
+ </rss>`}async function Vt(t={}){let n=Date.now();Jt();let a=await i(process.cwd()),s=a.build||{},l=await lt({explicit:t.domain||s.domain,stxConfig:a});if(l.source==="fallback"&&(t.sitemap??s.sitemap??!0))console.warn(ut());let e={router:t.router??a?.router??{},pagesDir:t.pagesDir||s.pagesDir||"pages",outputDir:t.outputDir||s.outputDir||"dist",baseUrl:t.baseUrl||s.baseUrl||"/",domain:l.url,revalidate:t.revalidate??s.revalidate??!1,sitemap:t.sitemap??s.sitemap??!0,sitemapExclude:t.sitemapExclude||s.sitemapExclude||[],robots:t.robots??s.robots??!0,rss:t.rss??s.rss??!1,concurrency:t.concurrency||s.concurrency||10,cache:t.cache??s.cache??!0,cacheDir:t.cacheDir||s.cacheDir||c(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??s.minify??!0,generate404:t.generate404??s.generate404??!0,publicDir:t.publicDir||s.publicDir||"public",trailingSlash:t.trailingSlash??s.trailingSlash??!1,cleanOutput:t.cleanOutput??s.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||a?.partialsDir||"",componentsDir:t.componentsDir||a?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},f=new Set,x=0,m={},b={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&k.existsSync(e.outputDir))await k.promises.rm(e.outputDir,{recursive:!0});await k.promises.mkdir(e.outputDir,{recursive:!0});let R=e.cacheSalt;if(!R){let{resolveUserCssConfig:d,fingerprintConfig:w}=await import("./chunk-78d5tn4r.js");try{R=w(await d(process.cwd()))}catch{}}let{prepareImageDelivery:S}=await import("./chunk-q3nnaxf9.js"),D=await S(e.publicDir,e.outputDir);if(D.count>0)console.log(`Optimized ${D.count} image(s) for responsive delivery`),R=[R,D.fingerprint].filter(Boolean).join(":");let F=new pt(e.cacheDir,R);if(e.cache)await F.load();try{let{generateCss:d}=await import("./chunk-78d5tn4r.js");await d('<div class="bg-black"></div>')}catch{}wt();let mt=a?.routeMiddleware?.dir||"middleware";await St(process.cwd(),mt);let J=xt();if(J.length>0)console.log(`Loaded ${J.length} middleware: ${J.join(", ")}`);let yt=a?.routeMiddleware?.global||[];ea(a?.layoutsDir,c(process.cwd()));let Y=W(".",{pagesDir:e.pagesDir,pagesDirs:a?._layerPageDirs});console.log(`Found ${Y.length} routes`);let U=[];for(let d of Y)try{let w=await At(d);for(let P of w)U.push({route:d,url:P.url,params:P.params,props:P.props,revalidate:P.revalidate??e.revalidate})}catch(w){let P=w instanceof Error?w:Error(String(w));u.failedCount++,u.errors.push({route:d.pattern,error:P}),await e.hooks.onError?.(P,d.pattern),console.error(`Error discovering paths for ${d.pattern}:`,P)}u.totalPages=U.length+u.failedCount,console.log(`Generating ${U.length} pages...`);let M=[],Z=[];for(let d=0;d<U.length;d+=e.concurrency)Z.push(U.slice(d,d+e.concurrency));for(let d of Z)await Promise.all(d.map(async(w)=>{let{route:P,url:g,params:_,props:bt,revalidate:et}=w;try{await e.hooks.onPageStart?.(g);let T=await Bun.file(P.filePath).text(),O=Qt(T),vt=O?.middleware?Array.isArray(O.middleware)?O.middleware:[O.middleware]:[],rt=[...yt,...vt];if(rt.length>0){let I=kt(g,_,O||{}),A=_t(I,null,void 0,{isServer:!0}),B=await Ct(rt,A);if(B.redirect){let E=typeof B.redirect==="string"?B.redirect:B.redirect.path||B.redirect,N=te(String(E),g),L=ee(g,e);await k.promises.mkdir(p.dirname(L),{recursive:!0}),await Bun.write(L,N),u.successCount++,u.pages.push({route:g,outputPath:L,size:Buffer.byteLength(N),cached:!1}),M.push({loc:g,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${g} \u2192 redirect to ${E}`);return}if(B.abort){let E=typeof B.abort==="string"?B.abort:B.abort?.error?.message||"aborted";console.warn(` \u21B3 ${g} \u2014 middleware aborted: ${E}`);return}}let nt=T.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(nt)try{if(!await Function("route",`
41
+ const validate = ${nt[1]};
46
42
  return validate(route);
47
- `)({params:L})){console.warn(`Validation failed for ${d}, skipping...`);return}}catch{}let k=null,et=!1;if(e.cache){if(k=B.get(d,v.filePath),k)et=!0,l.cachedCount++}if(!k){let C=await ut(v,L,ht,e,i);if(k=C.html,e.failOnIncludeError&&C.includeFailures.length>0)throw Error(`${C.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
48
- ${C.includeFailures.join(`
43
+ `)({params:_})){console.warn(`Validation failed for ${g}, skipping...`);return}}catch{}let C=null,it=!1;if(e.cache){if(C=F.get(g,P.filePath),C)it=!0,u.cachedCount++}if(!C){let I=await ft(P,_,bt,e,a);if(C=I.html,e.failOnIncludeError&&I.includeFailures.length>0)throw Error(`${I.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
44
+ ${I.includeFailures.join(`
49
45
  `)}
50
- Set ssg.failOnIncludeError to false to build anyway.`);if(e.failOnServerScriptError&&C.serverScriptFailures.length>0)throw Error(`${C.serverScriptFailures.length} <script server> block(s) failed, so this page would have shipped with the content they produce missing:
51
- ${C.serverScriptFailures.join(`
46
+ Set ssg.failOnIncludeError to false to build anyway.`);if(e.failOnServerScriptError&&I.serverScriptFailures.length>0)throw Error(`${I.serverScriptFailures.length} <script server> block(s) failed, so this page would have shipped with the content they produce missing:
47
+ ${I.serverScriptFailures.join(`
52
48
  `)}
53
- Set ssg.failOnServerScriptError to false to build anyway.`);if(e.cache)B.set(d,v.filePath,C.dependencies,k)}let M;if(e.trailingSlash)M=g.join(e.outputDir,d,"index.html");else M=d==="/"?g.join(e.outputDir,"index.html"):g.join(e.outputDir,`${d}.html`);if(e.chunkIslands){let{html:C,chunks:O}=nt(k,{integrity:e.integrityIslands,minify:e.minify});if(O.length>0){let E=g.join(e.outputDir,"_stx","islands");await x.promises.mkdir(E,{recursive:!0});for(let R of O){let _=g.join(E,`${R.hash}.js`);if(!await Bun.file(_).exists())await Bun.write(_,R.code);if(!w.has(R.hash)){w.add(R.hash);let T=Buffer.byteLength(R.code,"utf8");y+=T,f[R.hash]={bytes:T,file:`/_stx/islands/${R.hash}.js`}}}if(S[d]=O.map((R)=>R.hash),k=C,e.prefetchIslands)k=it(k)}}if(await x.promises.mkdir(g.dirname(M),{recursive:!0}),await Bun.write(M,k),!At(d,k,F,e.sitemapExclude))A.push({loc:d,lastmod:new Date().toISOString().split("T")[0],priority:d==="/"?1:0.8});let rt={route:d,outputPath:M,size:Buffer.byteLength(k,"utf8"),cached:et};if(Z!==!1)rt.revalidateAt=Date.now()+Z*1000;l.pages.push(rt),l.successCount++,await e.hooks.onPageEnd?.(d,k)}catch(j){l.failedCount++,l.errors.push({route:d,error:j}),await e.hooks.onError?.(j,d),console.error(`Error generating ${d}:`,j)}}));let X=Gt();if(X.length>0){let u=X.map((m)=>`${m.filePath}: ${m.message}`).join(`
49
+ Set ssg.failOnServerScriptError to false to build anyway.`);if(e.cache)F.set(g,P.filePath,I.dependencies,C)}let G;if(e.trailingSlash)G=p.join(e.outputDir,g,"index.html");else G=g==="/"?p.join(e.outputDir,"index.html"):p.join(e.outputDir,`${g}.html`);if(e.chunkIslands){let{html:I,chunks:A}=at(C,{integrity:e.integrityIslands,minify:e.minify});if(A.length>0){let B=p.join(e.outputDir,"_stx","islands");await k.promises.mkdir(B,{recursive:!0});for(let E of A){let N=p.join(B,`${E.hash}.js`);if(!await Bun.file(N).exists())await Bun.write(N,E.code);if(!f.has(E.hash)){f.add(E.hash);let L=Buffer.byteLength(E.code,"utf8");x+=L,m[E.hash]={bytes:L,file:`/_stx/islands/${E.hash}.js`}}}if(b[g]=A.map((E)=>E.hash),C=I,e.prefetchIslands)C=ot(C)}}if(await k.promises.mkdir(p.dirname(G),{recursive:!0}),await Bun.write(G,C),!Ht(g,C,O,e.sitemapExclude))M.push({loc:g,lastmod:new Date().toISOString().split("T")[0],priority:g==="/"?1:0.8});let st={route:g,outputPath:G,size:Buffer.byteLength(C,"utf8"),cached:it};if(et!==!1)st.revalidateAt=Date.now()+et*1000;u.pages.push(st),u.successCount++,await e.hooks.onPageEnd?.(g,C)}catch(T){u.failedCount++,u.errors.push({route:g,error:T}),await e.hooks.onError?.(T,g),console.error(`Error generating ${g}:`,T)}}));let Q=Xt();if(Q.length>0){let d=Q.map((w)=>`${w.filePath}: ${w.message}`).join(`
54
50
  `);throw Error(`Client script bundling failed:
55
- ${u}`)}if(e.cache)await B.save();if(e.generate404){let u=g.join(e.pagesDir,"404.stx");if(await Bun.file(u).exists()){let m=new Set,v={...i,debug:!1,cache:!1},d=await s(await Bun.file(u).text(),{},u,v,m);await Bun.write(g.join(e.outputDir,"404.html"),d)}else await Bun.write(g.join(e.outputDir,"404.html"),`<!DOCTYPE html>
51
+ ${d}`)}if(e.cache)await F.save();if(e.generate404){let d=p.join(e.pagesDir,"404.stx");if(await Bun.file(d).exists()){let w=new Set,P={...a,debug:!1,cache:!1},g=await o(await Bun.file(d).text(),{},d,P,w);await Bun.write(p.join(e.outputDir,"404.html"),g)}else await Bun.write(p.join(e.outputDir,"404.html"),`<!DOCTYPE html>
56
52
  <html lang="en">
57
53
  <head>
58
54
  <meta charset="UTF-8">
@@ -73,16 +69,16 @@ ${u}`)}if(e.cache)await B.save();if(e.generate404){let u=g.join(e.pagesDir,"404.
73
69
  <a href="/">Go home</a>
74
70
  </div>
75
71
  </body>
76
- </html>`)}for(let u of[500]){let m=g.join(e.pagesDir,`${u}.stx`);if(await Bun.file(m).exists()){let v=new Set,d={...i,debug:!1,cache:!1},L=await s(await Bun.file(m).text(),{},m,d,v);await Bun.write(g.join(e.outputDir,`${u}.html`),L)}}let W=g.join(e.pagesDir,"error.stx");if(await Bun.file(W).exists()){let u=new Set,m={...i,debug:!1,cache:!1},v=await s(await Bun.file(W).text(),{},W,m,u);await Bun.write(g.join(e.outputDir,"error.html"),v)}if(e.sitemap&&A.length>0){let u=Lt(A,e.domain),m=g.join(e.outputDir,"sitemap.xml");await Bun.write(m,u),l.sitemapPath=m,console.log(`Generated sitemap.xml with ${A.length} URLs`)}if(e.robots!==!1){let u=typeof e.robots==="object"?e.robots:{},m=[...e.sitemapExclude.filter((d)=>typeof d==="string"),...u.disallow||[]],v=Zr({rules:[{userAgent:u.userAgent||"*",allow:u.allow||["/"],...m.length>0?{disallow:m}:{}}],...u.sitemap!==!1&&l.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(g.join(e.outputDir,"robots.txt"),v),console.log("Generated robots.txt")}if(e.rss){let u=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},m=[];if(u.getItems)m=await u.getItems();let v=Mt(u,m),d=g.join(e.outputDir,"rss.xml");await Bun.write(d,v),l.rssPath=d,console.log(`Generated rss.xml with ${m.length} items`)}let N=Yi(e.outputDir);if(N.assets>0)console.log(`Externalized ${N.assets} asset(s) from ${N.pages} page(s) (${(N.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let z=Zi(e.outputDir);if(z.assets>0)console.log(`Externalized ${z.assets} repeated asset(s) from ${z.pages} page(s) (${(z.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(e.publicDir&&x.existsSync(e.publicDir))await J(e.publicDir,e.outputDir),console.log(`Copied public assets from ${e.publicDir}`);let Y=Bn();if(Y)await J(Y,g.join(e.outputDir,jn)),console.log(`Copied assets from ${qt}`)}catch(D){throw await e.hooks.onError?.(D),D}if(l.buildTime=Date.now()-n,w.size>0){l.islandChunks={count:w.size,totalBytes:y};let D={generatedChunks:w.size,totalBytes:y,chunks:f,pages:S};await Bun.write(g.join(e.outputDir,"_stx","islands-manifest.json"),JSON.stringify(D,null,2))}await e.hooks.onBuildEnd?.(l);let P=l.islandChunks?`
77
- Island chunks: ${l.islandChunks.count} (${(l.islandChunks.totalBytes/1024).toFixed(1)} KB lifted out of inline HTML)`:"";return console.log(`
72
+ </html>`)}for(let d of[500]){let w=p.join(e.pagesDir,`${d}.stx`);if(await Bun.file(w).exists()){let P=new Set,g={...a,debug:!1,cache:!1},_=await o(await Bun.file(w).text(),{},w,g,P);await Bun.write(p.join(e.outputDir,`${d}.html`),_)}}let V=p.join(e.pagesDir,"error.stx");if(await Bun.file(V).exists()){let d=new Set,w={...a,debug:!1,cache:!1},P=await o(await Bun.file(V).text(),{},V,w,d);await Bun.write(p.join(e.outputDir,"error.html"),P)}if(e.sitemap&&M.length>0){let d=Wt(M,e.domain),w=p.join(e.outputDir,"sitemap.xml");await Bun.write(w,d),u.sitemapPath=w,console.log(`Generated sitemap.xml with ${M.length} URLs`)}if(e.robots!==!1){let d=typeof e.robots==="object"?e.robots:{},w=[...e.sitemapExclude.filter((g)=>typeof g==="string"),...d.disallow||[]],P=es({rules:[{userAgent:d.userAgent||"*",allow:d.allow||["/"],...w.length>0?{disallow:w}:{}}],...d.sitemap!==!1&&u.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(p.join(e.outputDir,"robots.txt"),P),console.log("Generated robots.txt")}if(e.rss){let d=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},w=[];if(d.getItems)w=await d.getItems();let P=qt(d,w),g=p.join(e.outputDir,"rss.xml");await Bun.write(g,P),u.rssPath=g,console.log(`Generated rss.xml with ${w.length} items`)}let z=Zi(e.outputDir);if(z.assets>0)console.log(`Externalized ${z.assets} asset(s) from ${z.pages} page(s) (${(z.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let H=Qi(e.outputDir);if(H.assets>0)console.log(`Externalized ${H.assets} repeated asset(s) from ${H.pages} page(s) (${(H.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(e.publicDir&&k.existsSync(e.publicDir))await X(e.publicDir,e.outputDir),console.log(`Copied public assets from ${e.publicDir}`);let tt=zn();if(tt)await X(tt,p.join(e.outputDir,Fn)),console.log(`Copied assets from ${Kt}`)}catch(R){throw await e.hooks.onError?.(R),R}if(u.buildTime=Date.now()-n,f.size>0){u.islandChunks={count:f.size,totalBytes:x};let R={generatedChunks:f.size,totalBytes:x,chunks:m,pages:b};await Bun.write(p.join(e.outputDir,"_stx","islands-manifest.json"),JSON.stringify(R,null,2))}await e.hooks.onBuildEnd?.(u);let v=u.islandChunks?`
73
+ Island chunks: ${u.islandChunks.count} (${(u.islandChunks.totalBytes/1024).toFixed(1)} KB lifted out of inline HTML)`:"";return console.log(`
78
74
  Build complete!
79
- Total: ${l.totalPages} pages
80
- Success: ${l.successCount}
81
- Cached: ${l.cachedCount}
82
- Failed: ${l.failedCount}
83
- Time: ${l.buildTime}ms${P}
84
- `),l}async function J(t,n){await x.promises.mkdir(n,{recursive:!0});let i=await x.promises.readdir(t,{withFileTypes:!0});for(let r of i){let a=g.join(t,r.name),e=g.join(n,r.name);if(r.isDirectory())await x.promises.mkdir(e,{recursive:!0}),await J(a,e);else await x.promises.copyFile(a,e)}}function Nt(t={}){let n=t.cacheDir||c(process.cwd(),"ssg-cache"),i=new lt(n),r=t.revalidate||3600;return{async get(a){let e=await i.get(a);if(!e)return null;if(Date.now()>e.revalidateAfter)this.revalidate(a).catch(console.error);return{html:e.html,headers:{"Cache-Control":`public, max-age=${r}, stale-while-revalidate=${r*2}`,ETag:e.etag,"X-ISR-Generated":new Date(e.generatedAt).toISOString(),...e.headers}}},async revalidate(a){let l=U(".",{pagesDir:t.pagesDir||"pages"}).find((P)=>a.match(P.regex)!==null);if(!l){console.warn(`Route not found for revalidation: ${a}`);return}let w=a.match(l.regex),y={};if(w)l.params.forEach((P,D)=>{y[P]=w[D+1]});let f=await o(),{html:S}=await ut(l,y,{},t,f);await i.set(a,{html:S,generatedAt:Date.now(),revalidateAfter:Date.now()+r*1000,etag:Tt(S)}),console.log(`Revalidated: ${a}`)},async invalidate(a){if(typeof a==="string")await i.invalidate(a);else await i.invalidatePattern(a)}}}function zt(t){return async()=>({paths:await t(),fallback:!1})}function Ht(){return{name:"markdown",extensions:[".md",".mdx"],async load(t){let n=await Bun.file(t).text(),i=n.match(/^---\n([\s\S]*?)\n---/),r={},a=n;if(i){let f=i[1];a=n.slice(i[0].length).trim();for(let S of f.split(`
85
- `)){let P=S.indexOf(":");if(P>0){let D=S.slice(0,P).trim(),p=S.slice(P+1).trim();if(p==="true")p=!0;else if(p==="false")p=!1;else if(/^\d+$/.test(p))p=parseInt(p,10);else if(/^\d+\.\d+$/.test(p))p=parseFloat(p);else if(p.startsWith("[")&&p.endsWith("]"))p=p.slice(1,-1).split(",").map((b)=>b.trim().replace(/^['"]|['"]$/g,""));r[D]=p}}}let e=a.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/`([^`]+)`/gim,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim,'<a href="$2">$1</a>').replace(/\n/gim,"<br>"),l=[],w=/<h([1-6])>([^<]+)<\/h[1-6]>/gi,y;while((y=w.exec(e))!==null){let f=parseInt(y[1],10),S=y[2],P=S.toLowerCase().replace(/[^a-z0-9]+/g,"-");l.push({id:P,text:S,level:f})}return{content:e,data:r,toc:l}}}}function Wt(t){return gt(t)}function Jt(t,n){return`<!DOCTYPE html>
75
+ Total: ${u.totalPages} pages
76
+ Success: ${u.successCount}
77
+ Cached: ${u.cachedCount}
78
+ Failed: ${u.failedCount}
79
+ Time: ${u.buildTime}ms${v}
80
+ `),u}async function X(t,n){await k.promises.mkdir(n,{recursive:!0});let a=await k.promises.readdir(t,{withFileTypes:!0});for(let s of a){let l=p.join(t,s.name),e=p.join(n,s.name);if(s.isDirectory())await k.promises.mkdir(e,{recursive:!0}),await X(l,e);else await k.promises.copyFile(l,e)}}function Yt(t={}){let n=t.cacheDir||c(process.cwd(),"ssg-cache"),a=new ht(n),s=t.revalidate||3600;return{async get(l){let e=await a.get(l);if(!e)return null;if(Date.now()>e.revalidateAfter)this.revalidate(l).catch(console.error);return{html:e.html,headers:{"Cache-Control":`public, max-age=${s}, stale-while-revalidate=${s*2}`,ETag:e.etag,"X-ISR-Generated":new Date(e.generatedAt).toISOString(),...e.headers}}},async revalidate(l){let u=W(".",{pagesDir:t.pagesDir||"pages"}).find((v)=>l.match(v.regex)!==null);if(!u){console.warn(`Route not found for revalidation: ${l}`);return}let f=l.match(u.regex),x={};if(f)u.params.forEach((v,R)=>{x[v]=f[R+1]});let m=await i(),{html:b}=await ft(u,x,{},t,m);await a.set(l,{html:b,generatedAt:Date.now(),revalidateAfter:Date.now()+s*1000,etag:zt(b)}),console.log(`Revalidated: ${l}`)},async invalidate(l){if(typeof l==="string")await a.invalidate(l);else await a.invalidatePattern(l)}}}function Zt(){return{name:"markdown",extensions:[".md",".mdx"],async load(t){let n=await Bun.file(t).text(),a=n.match(/^---\n([\s\S]*?)\n---/),s={},l=n;if(a){let m=a[1];l=n.slice(a[0].length).trim();for(let b of m.split(`
81
+ `)){let v=b.indexOf(":");if(v>0){let R=b.slice(0,v).trim(),S=b.slice(v+1).trim();if(S==="true")S=!0;else if(S==="false")S=!1;else if(/^\d+$/.test(S))S=parseInt(S,10);else if(/^\d+\.\d+$/.test(S))S=parseFloat(S);else if(S.startsWith("[")&&S.endsWith("]"))S=S.slice(1,-1).split(",").map((D)=>D.trim().replace(/^['"]|['"]$/g,""));s[R]=S}}}let e=l.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/`([^`]+)`/gim,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim,'<a href="$2">$1</a>').replace(/\n/gim,"<br>"),u=[],f=/<h([1-6])>([^<]+)<\/h[1-6]>/gi,x;while((x=f.exec(e))!==null){let m=parseInt(x[1],10),b=x[2],v=b.toLowerCase().replace(/[^a-z0-9]+/g,"-");u.push({id:v,text:b,level:m})}return{content:e,data:s,toc:u}}}}function Qt(t){return gt(t)}function te(t,n){return`<!DOCTYPE html>
86
82
  <html>
87
83
  <head>
88
84
  <meta charset="utf-8">
@@ -94,4 +90,4 @@ Build complete!
94
90
  <p>Redirecting to <a href="${t}">${t}</a>...</p>
95
91
  <script>window.location.replace('${t}')</script>
96
92
  </body>
97
- </html>`}function Vt(t,n){if(t==="/"||t==="")return g.join(n.outputDir,"index.html");let i=t.replace(/^\/|\/$/g,"");if(n.trailingSlash)return g.join(n.outputDir,i,"index.html");return g.join(n.outputDir,`${i}.html`)}var ye={generateStaticSite:Ut,createISRHandler:Nt,defineStaticPaths:zt,createMarkdownLoader:Ht};export{Nt as createISRHandler,Ht as createMarkdownLoader,Ft as declaresPageAction,ye as default,zt as defineStaticPaths,Ut as generateStaticSite,At as isExcludedFromSitemap};
93
+ </html>`}function ee(t,n){if(t==="/"||t==="")return p.join(n.outputDir,"index.html");let a=t.replace(/^\/|\/$/g,"");if(n.trailingSlash)return p.join(n.outputDir,a,"index.html");return p.join(n.outputDir,`${a}.html`)}var je={generateStaticSite:Vt,createISRHandler:Yt,defineStaticPaths:q,createMarkdownLoader:Zt};export{Yt as createISRHandler,Zt as createMarkdownLoader,Mt as declaresPageAction,je as default,q as defineStaticPaths,Vt as generateStaticSite,Ht as isExcludedFromSitemap};
package/dist/utils.js CHANGED
@@ -659,7 +659,7 @@ export async function renderComponentWithSlot(componentPath, props, slotContent,
659
659
  searchDirs.push(parentRelative);
660
660
  if (options.componentsDir && options.componentsDir !== componentsDir && !searchDirs.includes(options.componentsDir))
661
661
  searchDirs.push(options.componentsDir);
662
- const checkedControl = options._nativeHostAttrs && /^(?:checkbox|switch)$/i.test(baseName), eventNames = (renderMetadata?.events ?? []).map((name) => name.replace(/^@/, "").split(".")[0].toLowerCase().replace(/-/g, "")), usesChecked = Object.hasOwn(props, "checked") || Boolean(renderMetadata?.reactiveProps?.includes("checked")), usesValue = Object.hasOwn(props, "value") || Boolean(renderMetadata?.reactiveProps?.includes("value")), sharedCheckedUsage = !eventNames.includes("valuechange") && (usesChecked || eventNames.includes("change") && !usesValue), textInput = options._nativeHostAttrs && /^textinput$/i.test(baseName), sharedTextInputUsage = eventNames.includes("update:value") && !eventNames.includes("input"), targetIsFallback = options._targetComponentFallbackNames?.some((name) => name.toLowerCase() === baseName.toLowerCase()) && (!checkedControl || sharedCheckedUsage) && (!textInput || sharedTextInputUsage);
662
+ const checkedControl = options._nativeHostAttrs && /^(?:checkbox|switch)$/i.test(baseName), eventNames = (renderMetadata?.events ?? []).map((name) => name.replace(/^@/, "").split(".")[0].toLowerCase().replace(/-/g, "")), usesChecked = Object.hasOwn(props, "checked") || Boolean(renderMetadata?.reactiveProps?.includes("checked")), usesValue = Object.hasOwn(props, "value") || Boolean(renderMetadata?.reactiveProps?.includes("value")), sharedCheckedUsage = !eventNames.includes("valuechange") && (usesChecked || eventNames.includes("change") && !usesValue), textInput = options._nativeHostAttrs && /^textinput$/i.test(baseName), sharedTextInputUsage = eventNames.includes("update:value") && !eventNames.includes("input"), video = options._nativeHostAttrs && /^video$/i.test(baseName), usesSrc = Object.hasOwn(props, "src") || Boolean(renderMetadata?.reactiveProps?.includes("src")), usesSource = Object.hasOwn(props, "source") || Boolean(renderMetadata?.reactiveProps?.includes("source")), sharedVideoUsage = video && usesSrc && !usesSource && (renderMetadata?.events ?? []).every((event) => /^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(event.replace(/^@/, "").split(".")[0])), targetIsFallback = options._targetComponentFallbackNames?.some((name) => name.toLowerCase() === baseName.toLowerCase()) && (!checkedControl || sharedCheckedUsage) && (!textInput || sharedTextInputUsage) && (!video || sharedVideoUsage);
663
663
  for (const dir of targetIsFallback ? [] : options._targetComponentDirs ?? [])
664
664
  if (dir && !searchDirs.includes(dir))
665
665
  searchDirs.push(dir);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.674",
4
+ "version": "0.2.676",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -131,7 +131,7 @@
131
131
  "@stacksjs/desktop": "0.2.674",
132
132
  "@stacksjs/sanitizer": "0.2.674",
133
133
  "@stacksjs/ts-i18n": "^0.1.11",
134
- "bun-plugin-stx": "0.2.674",
134
+ "bun-plugin-stx": "0.2.676",
135
135
  "bunfig": "^0.15.21",
136
136
  "stx-router": "0.2.674",
137
137
  "ts-broadcasting": "^0.0.11",
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Xu}from"./chunk-z22zy22p.js";import"./chunk-srq9fqq8.js";import"./chunk-rym0309c.js";import"./chunk-7adznted.js";import"./chunk-am2w363p.js";import"./chunk-5qtthtg3.js";import"./chunk-4s8zacxg.js";import"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{Xu as buildApp};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{up,kl,qe,oa,dp,Mr,Lr,jr}from"./chunk-bkkpq8dx.js";import"./chunk-7j1zgrnf.js";import"./chunk-v6peecfp.js";import"./chunk-hgry3mjd.js";import"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{dp as clearOnceStore,oa as onceStore,qe as partialsCache,Mr as processIncludes,Lr as processStackPushDirectives,jr as processStackReplacements,up as resetUnscopedSignalWarnings,kl as topLevelElements};
@@ -1,4 +0,0 @@
1
- // @bun
2
- import a from"fs";function pt(r){return o(r)}var g=1000,i=new Map;function In(){i.clear()}function o(r){return[...r].sort().map((n)=>{try{let t=a.statSync(n);return`${n}:${t.size}:${t.mtimeMs}`}catch{return`${n}:missing`}}).join(`
3
- `)}function Wt(r,n,t){let e=r.get(n);return e!==void 0&&e.signature===t?e.value:void 0}function ie(r,n,t,e){return r.set(n,{signature:t,value:e}),e}
4
- export{pt,In,Wt,ie};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Pl,go}from"./chunk-7adznted.js";export{Pl as looksLikeGlob,go as resolveStxTargets};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{zn,Ee}from"./chunk-md2jn67b.js";export{zn as describeBuildFailure,Ee as formatBuildFailure};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{N,Al,fo,o,R,Sp,kp}from"./chunk-srq9fqq8.js";import"./chunk-rym0309c.js";import"./chunk-7adznted.js";import"./chunk-am2w363p.js";import"./chunk-5qtthtg3.js";import"./chunk-4s8zacxg.js";import"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{R as config,N as defaultConfig,Sp as defineStxConfig,fo as discoverConfig,o as loadStxConfig,Al as resolveStxDirectories,kp as validateConfig};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ul,dl,Ce,pl,ea,Gt,Kt,sp,ta,Xt,Fn,fl,gl,ml,Gs,Jt,hl,Yt,yl}from"./chunk-rv39s5az.js";import"./chunk-hz4x7h0n.js";import"./chunk-md2jn67b.js";import"./chunk-srq9fqq8.js";import"./chunk-rym0309c.js";import"./chunk-7adznted.js";import"./chunk-am2w363p.js";import"./chunk-5qtthtg3.js";import"./chunk-4s8zacxg.js";import"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{Fn as MODULE_SPECIFIER_PREFIX,ul as bundleCacheDir,dl as bundleCacheEntryLimit,Yt as bundleClientScript,Kt as clearBundleFailures,Ce as clientBundleDependencies,Gt as getBundleFailures,Xt as hasUserImports,Jt as moduleSubstitutionKey,gl as normalizeRegistrySpecifiers,hl as queueClientBundleBuild,ea as recordBundleFailure,fl as registryIdForPath,ta as resolveBundlerFallback,ml as rewriteRegistryImports,sp as setBundlerFallbackMode,pl as shouldLogBundlerDiagnostics,yl as tempBuildName,Gs as withModuleSubstitutes};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Y,Z,Q,Cn,fe,_e,Ar,zc,dt,Ut,En,Tn,$n,ee,Rn,An,Pr}from"./chunk-t79jfpv6.js";import"./chunk-a4p18ybc.js";export{Z as DEFAULT_FORMATS,Q as DEFAULT_QUALITY,Y as DEFAULT_WIDTHS,Pr as ImageProcessingError,An as formatSize,Ut as generateSizes,dt as generateSrcSet,En as getFallbackVariant,Ar as getImageMetadata,ee as getMimeType,Rn as getTotalSize,Tn as groupVariantsByFormat,fe as isImageBackendAvailable,$n as isImageFile,Cn as isSharpAvailable,_e as processImage,zc as resizeAndConvert};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Tl,mp,hp,yp,bp,$l,Rl,vp,wp,po,xp,Jn,Yn,qr}from"./chunk-4b9s7wgy.js";import{Ze}from"./chunk-2zzc7006.js";import"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{bp as __setSignalsGeneratorsForTest,Ze as cacheEngineFingerprint,Yn as cacheTemplate,Jn as checkCache,xp as clearDevCaches,Rl as getCachedRouterScript,$l as getCachedSignalsRuntime,vp as getServeClientAsset,po as getServeModuleBundle,qr as hashFilePath,hp as invalidateFileCache,yp as invalidateFileCacheByDir,mp as readFileCached,wp as registerServeModuleBundle,Tl as templateCache};
@@ -1,21 +0,0 @@
1
- // @bun
2
- import{st,lc}from"./chunk-zp79zkkd.js";import{T}from"./chunk-ce6zddpf.js";import{L,ss,r,sn,q,ue,Ra,Pt,dn,De,Me}from"./chunk-f9zyf9n6.js";import{Xn}from"./chunk-twqzn21x.js";import{W}from"./chunk-p6qd7ad0.js";import{tn}from"./chunk-hgry3mjd.js";var j=`(?:"[^"]*"|'[^']*'|[^>"'])*`,H=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,Q=65536,J=4,O=new Map;function gp(){O.clear()}function K(e){let i=[];for(let s of ue(e,q)){let t=s.token.match(/^<script\b([^>]*)>/i),n=s.token.match(/<\/script\s*>$/i);if(!t||!n)continue;let a=t[0].length,l=s.token.length-n[0].length;i.push(Object.freeze({fullMatch:s.token,attrs:t[1],body:s.token.slice(a,l),start:s.start,end:s.end}))}return i}function Cl(e,i={}){let s=e.length>=Q,t=s?O.get(e):void 0;if(t===void 0){if(t=K(e),s)Ra(O,J),O.set(e,t)}let n=i.skipAttrs;if(!n)return t.slice();let a=[];for(let l of t)if(n.lastIndex=0,!n.test(l.attrs))a.push(l);return a}function io(e){let i=e.trim(),s=i.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(s){let n=s[1].trim(),a=s[2].trim(),{itemVar:l,indexVar:o}=B(a);if(l)return{style:"as",iterable:n,itemVar:l,indexVar:o}}let t=i.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(t){let n=t[1].trim(),a=t[2].trim(),{itemVar:l,indexVar:o}=B(n);if(l)return{style:"in",iterable:a,itemVar:l,indexVar:o}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function B(e){let i=e.trim(),s=i.match(/^(\w+)\s*=>\s*(\w+)$/);if(s)return{itemVar:s[2],indexVar:s[1]};let t=i.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(t)return{itemVar:t[1],indexVar:t[2]||null};let n=i.match(/^(\w+)\s*,\s*(\w+)$/);if(n)return{itemVar:n[1],indexVar:n[2]};let a=i.match(/^(\w+)$/);if(a)return{itemVar:a[1],indexVar:null};return{itemVar:null,indexVar:null}}function zr(e,i){return lc(e,i)}function Y(e){let i=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,s=0,t;while((t=i.exec(e))!==null){let n=t[1];if(n.startsWith("if"))s++;else if(n==="endif")s--;else if(s===0)return!0}return!1}function Gn(e){let i=new Set,s=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel)\s*(?:<[^>]*>)?\s*\(/g,n;while((n=s.exec(e))!==null){let a=n[1],l;while((l=t.exec(a))!==null)i.add(l[1])}return i}function ee(e){if(!/[:@]for\s*=/.test(e)&&!/\bx-for\s*=/.test(e))return[];let i=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${j})>`,"iy"),s=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,t=ue(e,(a,l)=>{i.lastIndex=l;let o=i.exec(a);if(!o||o.index!==l||!s.test(o[2]))return-1;return i.lastIndex}),n=[];for(let a of t){i.lastIndex=0;let l=i.exec(a.token);if(!l)continue;let o=l[2].match(s),p=io(o?.[1]??o?.[2]??""),h=[p.itemVar,p.indexVar].filter(Boolean);if(h.length===0)continue;let u=l[1],g=/\/\s*>$/.test(a.token)||N.has(u.toLowerCase())?a.end:z(e,a.start,u,a.end);if(g!==-1)n.push({start:a.start,end:g,vars:new Set(h)})}return n}var Z=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function te(e){return e.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function F(e,i,s,t){if(!e)return!1;let n=te(e),a=!1,l=!1,o=!1,p=/([a-zA-Z_$][\w$]*)/g,h;while((h=p.exec(n))!==null){let d=h[1];if(n.slice(0,h.index).trimEnd().endsWith("."))continue;if(Z.has(d))continue;if(i.has(d)||t?.has(d))a=!0;else if(s&&d in s)l=!0}let u=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,c;while((c=u.exec(n))!==null){let d=c[1];if(n.slice(0,c.index).trimEnd().endsWith("."))continue;if(Z.has(d)||s&&d in s)continue;o=!0}return(a||o)&&!l}function M(e,i,s){let t=s===void 0?` ${i}`:` ${i}="${s.replace(/"/g,"&quot;")}"`,n=e.trim(),a=n.match(H);if(a&&ne(a[3],a[1])){let[,l,o,p]=a;return`<${l}${o}${t}>${p}</${l}>`}return`<template${t}>${n}</template>`}function ne(e,i){let s=new RegExp(`<(/)?${i}(?=[\\s/>])`,"gi"),t=0,n;while((n=s.exec(e))!==null)if(n[1]){if(t--,t<0)return!1}else t++;return!0}function ao(e,i){let s=Gn(e);function t(n){let a=n,l=ee(n),o=(c)=>{let g=new Set;for(let d of l)if(c>d.start&&c<d.end)for(let f of d.vars)g.add(f);return g},p=/@if\s*\(/g,h,u=[];while((h=p.exec(a))!==null){let c=h.index,g=c+h[0].length,d=1,f=g;while(f<a.length&&d>0){if(a[f]==="(")d++;else if(a[f]===")")d--;f++}if(d!==0)continue;let b=a.substring(g,f-1).trim(),E=f,S=1,w=E,m=/@(if\s*\(|endif)/g;m.lastIndex=E;let x;while((x=m.exec(a))!==null)if(x[1].startsWith("if"))S++;else if(x[1]==="endif"){if(S--,S===0){w=x.index+x[0].length;break}}if(S!==0)continue;let C=a.substring(E,w-6).trim(),R;if(Y(C)){let _=tn(a.substring(c,w));if(_.length===0)continue;let v=_[0].branches.filter((A)=>A.type!=="else"),I=o(c);if(!(v.length>0&&v.every((A)=>F(A.condition,s,i,I))))continue;R=_[0].branches.map((A)=>{let V=t(A.content);if(A.type==="elseif")return M(V,"@else-if",A.condition??"");if(A.type==="else")return M(V,"@else");return M(V,"@if",A.condition??"")}).join(`
3
- `)}else{if(!F(b,s,i,o(c)))continue;R=M(t(C),"@if",b)}u.push({start:c,end:w,replacement:R}),p.lastIndex=w}for(let c=u.length-1;c>=0;c--){let{start:g,end:d,replacement:f}=u[c];a=a.substring(0,g)+f+a.substring(d)}return a}return t(e)}function se(e){let i=e.trim();if(i==="")return;if(i==="true")return!0;if(i==="false")return!1;if(i==="null")return!1;if(i==="undefined")return!1;if(i==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(i)){let n=Number(i);return n!==0&&!Number.isNaN(n)}let s=i.match(/^'((?:\\.|[^'\\])*)'$/);if(s)return s[1].length>0;let t=i.match(/^"((?:\\.|[^"\\])*)"$/);if(t)return t[1].length>0;return}var N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),U=/<(script|style)\b/iy,re=/<\/script/gi,ie=/<\/style/gi;function z(e,i,s,t){if(N.has(s.toLowerCase()))return t;let n=s.toLowerCase(),a=e.length,l=1,o=t;while(o<a){let p=e.indexOf("<",o);if(p===-1)return-1;if(o=p,e.startsWith("<!--",o)){let g=e.indexOf("-->",o+4);if(g===-1)return-1;o=g+3;continue}U.lastIndex=o;let h=U.exec(e);if(h){let g=e.indexOf(">",o);if(g===-1)return-1;if(e[g-1]==="/"){o=g+1;continue}let d=h[1].toLowerCase()==="script"?re:ie;d.lastIndex=o;let f=d.exec(e);if(f===null)return-1;let b=e.indexOf(">",f.index);if(b===-1)return-1;o=b+1;continue}if(e[o+1]==="/"){let g=/^<\/([a-z][\w-]*)\s*>/i.exec(e.slice(o,o+64));if(!g){o++;continue}if(g[1].toLowerCase()===n){if(l--,o+=g[0].length,l===0)return o;continue}o+=g[0].length;continue}let u=/^<([a-z][\w-]*)\b/i.exec(e.slice(o,o+64));if(!u){o++;continue}let c=e.indexOf(">",o);if(c===-1)return-1;if(u[1].toLowerCase()===n){let g=e.slice(o,c+1);if(!(/\/\s*>$/.test(g)||N.has(n)))l++}o=c+1}return-1}var oe=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function ce(e,i){let s=i,t=e.length;for(;;){while(s<t&&e[s]!=="<")s++;if(s>=t)return!1;if(e.startsWith("<!--",s)){let l=e.indexOf("-->",s+4);if(l===-1)return!1;s=l+3;continue}break}if(e[s+1]==="/")return!1;let n=e.indexOf(">",s);if(n===-1)return!1;let a=e.slice(s,n+1);return oe.test(a)}function co(e){if(!e.includes(":if")&&!e.includes(":show")&&!e.includes("x-if")&&!e.includes("x-show")&&!e.includes("@if=")&&!e.includes("@show="))return e;let i=[],s=/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,t;while((t=s.exec(e))!==null)i.push([t.index,t.index+t[0].length]);let n=(c)=>i.some(([g,d])=>c>=g&&c<d),a=/<([a-zA-Z][\w-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*?)\s+(:if|:show|x-if|x-show|@if|@show)\s*=\s*"([^"]*)"((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)(\/?)>/g,l=[],o;while((o=a.exec(e))!==null){if(n(o.index))continue;let[c,g,d,f,b,E,S]=o,w=se(b);if(w===void 0)continue;let m=o.index,x=m+c.length,_=!!S||/\/\s*>$/.test(c)||N.has(g.toLowerCase())?x:z(e,m,g,x);if(_===-1)continue;if((f===":if"||f==="x-if"||f==="@if")&&ce(e,_)){a.lastIndex=x;continue}if(w===!0){let I=`<${g}${d}${E}${S}>`;l.push({start:m,end:x,replacement:I});continue}l.push({start:m,end:_,replacement:""}),a.lastIndex=_}if(l.length===0)return e;l.sort((c,g)=>c.start-g.start);let p=[],h=-1;for(let c of l){if(c.start<h)continue;p.push(c),h=c.end}let u=e;for(let c=p.length-1;c>=0;c--){let{start:g,end:d,replacement:f}=p[c];u=u.substring(0,g)+f+u.substring(d)}return u}var G=[":for","@for","x-for"];function Hr(e,i){if(!i||Object.keys(i).length===0)return e;if(!G.some((o)=>e.includes(`${o}=`)))return e;let s=Gn(e);if(Array.isArray(i.__stx_client_signal_names)){for(let o of i.__stx_client_signal_names)if(typeof o==="string")s.add(o)}let t=e,n=[],a=/<([a-zA-Z][\w-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g,l;while((l=a.exec(t))!==null){let[o,p,h]=l,u=l.index,c=u+o.length,g=G.map((R)=>({attr:R,m:new RegExp(`\\s${R}="([^"]*)"`).exec(h)})).find((R)=>R.m!==null);if(!g||!g.m)continue;let d=io(g.m[1]);if(!d.iterable||!d.itemVar)continue;let f=d.iterable.trim().split(/[.[(]/)[0].trim();if(!f||s.has(f)||!(f in i))continue;let b=z(t,u,p,c);if(b===-1)continue;let E=h.replace(new RegExp(`\\s${g.attr}="[^"]*"`),"").replace(/\s:key="[^"]*"/,"").replace(/\sx-cloak(?=\s|$)/,""),S=t.slice(c,b-`</${p}>`.length),w={...i,[d.itemVar]:void 0};if(d.indexVar)w[d.indexVar]=void 0;let m=Hr(S,w),x=d.indexVar?`${d.iterable} as ${d.indexVar} => ${d.itemVar}`:`${d.iterable} as ${d.itemVar}`,C=p.toLowerCase()==="template"?m:`<${p}${E}>${m}</${p}>`;n.push({start:u,end:b,replacement:`@foreach(${x})${C}@endforeach`}),a.lastIndex=b}for(let o=n.length-1;o>=0;o--){let{start:p,end:h,replacement:u}=n[o];t=t.slice(0,p)+u+t.slice(h)}return t}function Vr(e,i){let s=e,t=/@(for|foreach)\s*\(/g,n,a=[],l=[];while((n=t.exec(s))!==null){let o=n[1],p=n.index,h=p+n[0].length,u=1,c=h;while(c<s.length&&u>0){if(s[c]==="(")u++;else if(s[c]===")")u--;c++}if(u!==0)continue;let g=s.substring(h,c-1).trim(),d=c,f=io(g),b=o==="for"?"@endfor":"@endforeach",E=1,S=d,w=o==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${o}\\s*\\(|end${o})`,"g");w.lastIndex=d;let m;while((m=w.exec(s))!==null)if(m[1].startsWith(o))E++;else if(E--,E===0){S=m.index+m[0].length;break}if(E!==0)continue;let x=()=>{let y=[f.itemVar,f.indexVar].filter(Boolean);if(y.length)l.push({start:p,end:S,vars:y})};if(f.iterable){let y=f.iterable.trim();if(y.startsWith("[")||y.startsWith("{")||y.startsWith("'")||y.startsWith('"')||y.startsWith("`")||/^-?\d/.test(y)){x();continue}let k=y.split(/[.[(]/)[0].trim(),A=i?k in i:!1,V=l.some((P)=>p>P.start&&p<P.end&&P.vars.includes(k));if(k&&(A||V)){x();continue}}if(f.style==="as")g=f.indexVar?`(${f.itemVar}, ${f.indexVar}) in ${f.iterable}`:`${f.itemVar} in ${f.iterable}`;let C=s.substring(d,S-b.length).trim(),R=i?{...i}:{};if(f.itemVar)delete R[f.itemVar];if(f.indexVar)delete R[f.indexVar];let _=Vr(C,R),v=_.match(H),I;if(v){let[,y,k,A]=v;I=`<${y}${k} @for="${g}">${A}</${y}>`}else I=`<template @for="${g}">${_}</template>`;a.push({start:p,end:S,replacement:I}),t.lastIndex=S}for(let o=a.length-1;o>=0;o--){let{start:p,end:h,replacement:u}=a[o];s=s.substring(0,p)+u+s.substring(h)}return s}function ae(e){let i=new Set,s=[],t=0,n=0,a=e.length,l=(u)=>{let c=t+1;while(c<a){let g=e[c];if(g==="\\"){c+=2;continue}if(g===u)return c+1;c++}return a},o=()=>{let u=t+2;while(u<a&&e[u]!==`
4
- `)u++;return u},p=()=>{let u=t+2;while(u<a-1){if(e[u]==="*"&&e[u+1]==="/")return u+2;u++}return a},h=(u)=>{let c=u,g=0;while(c<a){let d=e[c];if(d==="/"&&e[c+1]==="/"){let f=c+2;while(f<a&&e[f]!==`
5
- `)f++;c=f;continue}if(d==="/"&&e[c+1]==="*"){let f=c+2;while(f<a-1&&!(e[f]==="*"&&e[f+1]==="/"))f++;c=f+2;continue}if(d==='"'||d==="'"||d==="`"){let f=c+1;while(f<a){if(e[f]==="\\"){f+=2;continue}if(e[f]===d){f++;break}f++}c=f;continue}if(d==="("||d==="["||d==="{"){g++,c++;continue}if(d===")"||d==="]"||d==="}"){g--,c++;continue}if(d===";"&&g===0)return c+1;c++}return a};while(t<a){let u=e[t];if(u==="/"&&e[t+1]==="/"){let c=o();s.push(e.slice(t,c)),t=c;continue}if(u==="/"&&e[t+1]==="*"){let c=p();s.push(e.slice(t,c)),t=c;continue}if(u==='"'||u==="'"||u==="`"){let c=l(u);s.push(e.slice(t,c)),t=c;continue}if(u==="{"){n++,s.push(u),t++;continue}if(u==="}"){n--,s.push(u),t++;continue}if(n===0){let c=t>0?e[t-1]:"";if(c===""||/\s/.test(c)||c===";"||c==="}"||c==="{"){let d=e.slice(t).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(d){let f=d[2],b=h(t+d[0].length);if(i.has(f)){s.push(`/* stx: deduped const ${f} */`),t=b;continue}i.add(f),s.push(e.slice(t,b)),t=b;continue}}}s.push(u),t++}return s.join("")}var le=new Set(["script","style","html","head","meta","link","title","!doctype"]);function D(e,i,s){for(let t of s){if(t.start>=i)return!1;if(t.end>e)return!0}return!1}function fe(e,i,s){let t=0;while(t<e.length){let n=e.indexOf(i,t);if(n===-1)return!1;if(!D(n,n+i.length,s))return!0;t=n+i.length}return!1}function de(e,i){if(fe(e,"<body",i)){let n=new RegExp(`<body(${j})>`,"g"),a;while((a=n.exec(e))!==null)if(!D(a.index,a.index+a[0].length,i))return a.index+a[0].length-1;return null}let s=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${j})>`,"gi"),t;while((t=s.exec(e))!==null){if(D(t.index,t.index+t[0].length,i))continue;if(le.has(t[1].toLowerCase()))continue;return t.index+t[0].length-1}return null}function ge(e,i,s,t){let n=[],a=` data-stx="${t}"`,l=0,o=!1,p=(h)=>{if(s!==null&&!o&&s>=l&&s<=h)n.push(e.slice(l,s),a,e.slice(s,h)),o=!0;else n.push(e.slice(l,h))};for(let h of i){if(h.start<l)continue;p(h.start),l=h.end}return p(e.length),n.join("")}async function Ur(e,i,s,t={}){let n=Cl(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),a=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,l=[],{hasUserImports:o,bundleClientScript:p}=await r("stx/client-script-bundler",()=>import("./chunk-2a775q7x.js"));for(let m of n){let x=m.body;if(De(m.attrs))x=Me(x);if(t.forceClientSetup||a.test(x)){l.push({content:x,start:m.start,end:m.end});continue}if(!o(x))continue;try{let C=await p(Pt(x).code,i||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(a.test(C))l.push({content:x,start:m.start,end:m.end})}catch{}}if(l.length===0)return{output:e,setupCode:null};let h=`${i??""}\x00${l.map((m)=>m.content).join("\x00")}`,u=`__stx_setup_${Bun.hash(h).toString(36).slice(0,10)}`,c=[];for(let m=0;m<l.length;m++){let x=l[m].bundled??Pt(l[m].content).code;if(!l[m].bundled&&o(x))x=await p(x,i||"",{projectRoot:process.cwd()});x=ht(x);let C=T(x);c.push(`// \u2500\u2500 merged signal script #${m+1} \u2500\u2500
6
- ${C}`)}let g=c.join(`
7
-
8
- `);g=ae(g);let f=L(g).split(",").map((m)=>m.trim()).filter(Boolean),b=dn(g,s),E=`
9
- <script data-stx-scoped>
10
- function ${u}() {
11
- ${st("const",f)}
12
- ${sn(`${b}${g}`)}
13
- return ${ss(g,f)};
14
- }
15
- window.__stx_latestSetup=${u};
16
- if(window.stx)window.stx._latestSetup=${u};
17
- </script>`,S=de(e,l);return{output:ge(e,l,S,u),setupCode:E}}async function lo(e,i,s,t){if(!zr(e,s))return e;let n=e;if(i.skipSignalsRuntime)return n;let{output:a,setupCode:l}=await Ur(n,s,t);if(n=a,!l){let o=W(n);if(o&&!/data-stx/.test(o.attrs)&&!/data-stx-auto/.test(o.attrs)){let p=o.tag.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>");n=n.slice(0,o.index)+p+n.slice(o.index+o.tag.length)}}if(n=await Xn(n,i),l){let o=aa(n,/<\/head>/i),p=o===-1?aa(n,/<body[^>]*>/i):-1;if(o!==-1)n=`${n.slice(0,o)}${l}
18
- ${n.slice(o)}`;else if(p!==-1){let h=/<body[^>]*>/i.exec(n.slice(p))[0],u=p+h.length;n=`${n.slice(0,u)}
19
- ${l}${n.slice(u)}`}else n=`${n}
20
- ${l}`}return n}function aa(e,i){let s=/<(script|style)\b[\s\S]*?<\/\1>/gi,t=[],n;while((n=s.exec(e))!==null)t.push([n.index,n.index+n[0].length]);let a=new RegExp(i.source,i.flags.replace(/[gy]/g,"")),l=0;while(l<e.length){let o=a.exec(e.slice(l));if(!o)return-1;let p=l+o.index;if(!t.some(([u,c])=>p>=u&&p<c))return p;l=p+Math.max(o[0].length,1)}return-1}var X="/* [stx import stripped, resolved via window.stx in __stx_setup] */";function El(e){let i=[];for(let s of e.split(",")){let t=s.trim();if(!t||t.startsWith("type "))continue;let n=t.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(n&&n[1]!==n[2])i.push(`${n[2]} = ${n[1]}`)}if(i.length===0)return X;return`var ${i.join(", ")}; ${X}`}var pe=/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm;function ht(e){return e.replace(pe,(i,s)=>El(s))}
21
- export{gp,Cl,io,zr,Gn,ao,co,Hr,Vr,Ur,lo,aa,El,ht};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ns,vi,Er,Ds,Ms,Sn,Vt,wi,Tr,$r,Ls,js,Au,Pu,lt}from"./chunk-fd49fahd.js";export{lt as DeployError,vi as calculateSha1,Er as collectDeployFiles,$r as createDefaultNetlifyConfig,Ds as createFileManifest,Ns as createNetlifyClient,Au as deploy,Tr as detectProjectConfig,Ms as filterRequiredFiles,Sn as formatSize,wi as generateNetlifyToml,Vt as getTotalSize,js as hasNetlifyConfig,Pu as initNetlify,Ls as writeNetlifyConfig};
@@ -1,3 +0,0 @@
1
- // @bun
2
- function C(){let{NODE_ENV:n}=process.env;return n==="production"}function V(){let{STX_DEBUG:n}=process.env;return!C()||n==="true"}function bn(){let{NODE_ENV:n}=process.env;return n==="test"}function Go(n){return n==="compile"||C()}function br(n){if(!n)return n;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim()}catch{return n}}
3
- export{C,V,bn,Go,br};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ip,ra,ap,sa,bl,vl,en,Wn,cp,wl,xl,lp,h}from"./chunk-kdebh22m.js";import"./chunk-4b9s7wgy.js";import"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{en as buildCss,wl as extractClassNames,vl as fingerprintConfig,xl as generateCss,cp as getCachedCSS,ip as getCssServeAsset,h as injectCss,ra as loadCssEngine,sa as loadCssEngineConfig,Wn as rebuildCss,ap as resetCssCache,bl as resolveUserCssConfig,lp as withLinkedModuleBundles};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{sd,ji,al,od,id,ad,cd,ld,cl,ll,ud,dd,pd,fd}from"./chunk-5vt48yce.js";import"./chunk-aet1pgw7.js";import"./chunk-kdebh22m.js";import"./chunk-rr527jt6.js";import"./chunk-xcsyqwxf.js";import"./chunk-bkkpq8dx.js";import"./chunk-7j1zgrnf.js";import"./chunk-v6peecfp.js";import"./chunk-40tswfe7.js";import"./chunk-twqzn21x.js";import"./chunk-hgry3mjd.js";import"./chunk-4b9s7wgy.js";import"./chunk-srq9fqq8.js";import"./chunk-rym0309c.js";import"./chunk-7adznted.js";import"./chunk-am2w363p.js";import"./chunk-5qtthtg3.js";import"./chunk-4s8zacxg.js";import"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{al as SUSPENSE_RESOLVER_RUNTIME,ji as buildSuspenseResolveScript,ld as createStreamRenderer,ad as extractStreamBoundaries,fd as generateHydrationRuntime,ll as islandDirective,dd as processSectionDirectives,id as processStreamDirectives,ud as registerStreamingDirectives,od as renderStreamingPage,sd as streamTemplate,cd as streamTemplateSimple,pd as streamToResponse,cl as streamingSuspenseDirective};
@@ -1,12 +0,0 @@
1
- // @bun
2
- function o(t,l){let n=t[l],e=l+1;while(e<t.length){if(t[e]==="\\"){e+=2;continue}if(t[e]===n)return e+1;e++}return t.length}function b(t,l){let n=l+1;while(n<t.length){if(t[n]==="\\"){n+=2;continue}if(t[n]==="`")return n+1;if(t[n]==="$"&&t[n+1]==="{"){if(n=Qa(t,n+2),n<t.length)n++;continue}n++}return t.length}function Qa(t,l){let n=1,e=l,s="{",f="";while(e<t.length){let r=t[e];if(r==="\\"){e+=2;continue}if(r==='"'||r==="'"){e=o(t,e),s=h,f="";continue}if(r==="`"){e=b(t,e),s=h,f="";continue}if(r==="/"&&t[e+1]==="/"){while(e<t.length&&t[e]!==`
3
- `)e++;continue}if(r==="/"&&t[e+1]==="*"){e+=2;while(e<t.length&&t.slice(e,e+2)!=="*/")e++;e+=2;continue}if(r==="/"&&a(s,f)){let u=w(t,e);if(u!==-1){e=u,s=h,f="";continue}}if(r==="{")n++;else if(r==="}"){if(n--,n===0)return e}if(/[\w$]/.test(r))f=/[\w$]/.test(s)?f+r:r,s=r;else if(!/\s/.test(r))s=r,f="";e++}return t.length}var m=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function a(t,l){if(l)return m.has(l);return!(t===")"||t==="]"||t===h)}var h="\x00";function w(t,l){let n=l+1,e=!1;while(n<t.length){let s=t[n];if(s===`
4
- `)return-1;if(s==="\\"){n+=2;continue}if(s==="[")e=!0;else if(s==="]")e=!1;else if(s==="/"&&!e){n++;while(n<t.length&&/[a-z]/i.test(t[n]))n++;return n}n++}return-1}function i(t){let l="",n=0,e="",s="";while(n<t.length){let f=t.slice(n,n+2);if(f==="//"){while(n<t.length&&t[n]!==`
5
- `)l+=" ",n++;continue}if(f==="/*"){while(n<t.length&&t.slice(n,n+2)!=="*/")l+=t[n]===`
6
- `?`
7
- `:" ",n++;l+=" ",n+=2;continue}let r=t[n];if(r==='"'||r==="'"){let u=r;l+=" ",n++;while(n<t.length&&t[n]!==u){if(t[n]==="\\"){l+=" ",n+=2;continue}l+=t[n]===`
8
- `?`
9
- `:" ",n++}l+=" ",n++,e=h,s="";continue}if(r==="/"&&a(e,s)){let u=w(t,n);if(u!==-1){l+=`/${" ".repeat(u-n-2)}/`,n=u,e=h,s="";continue}}if(r==="`"){l+=" ",n++;while(n<t.length&&t[n]!=="`"){if(t[n]==="\\"){l+=" ",n+=2;continue}if(t[n]==="$"&&t[n+1]==="{"){let u=n+2,g=Qa(t,u);if(l+=" ",l+=i(t.slice(u,g)),g<t.length)l+=" ";n=g+1;continue}l+=t[n]===`
10
- `?`
11
- `:" ",n++}l+=" ",n++,e=h,s="";continue}if(l+=r,n++,/[\w$]/.test(r))s=/[\w$]/.test(e)?s+r:r,e=r;else if(!/\s/.test(r))e=r,s=""}return l}function et(t){let l=new Uint16Array(t.length),n=0,e=!0;for(let s=0;s<t.length;s++){let f=t[s];if(f===")"||f==="]"||f==="}")if(n===0)e=!1;else n--;if(l[s]=n,f==="("||f==="["||f==="{")n++}return{depths:l,balanced:e&&n===0}}
12
- export{Qa,i,et};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Hs,Hd,Vd}from"./chunk-hsmcbh0p.js";import"./chunk-rv39s5az.js";import"./chunk-hz4x7h0n.js";import"./chunk-md2jn67b.js";import"./chunk-40tswfe7.js";import"./chunk-twqzn21x.js";import"./chunk-hgry3mjd.js";import"./chunk-srq9fqq8.js";import"./chunk-rym0309c.js";import"./chunk-7adznted.js";import"./chunk-am2w363p.js";import"./chunk-5qtthtg3.js";import"./chunk-4s8zacxg.js";import"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{Vd as clearComposableCache,Hd as getComposableScript,Hs as listComposableModules};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ft,On,Ud}from"./chunk-9dtbvjpp.js";import{ae,Nn,Wd,Dn,Vs,Ir,Or,qd,Gd,Kd,Mn,Ln,Us,Nr,Xd}from"./chunk-t0k16vqv.js";import"./chunk-zp79zkkd.js";export{Vs as batch,Ud as default,Nn as derived,Dn as effect,ft as generateSignalsRuntime,On as generateSignalsRuntimeDev,Ln as isDerived,Mn as isSignal,Wd as memo,Or as onDestroy,Ir as onMount,Nr as peek,Kd as pendingLifecycleCounts,Gd as runDestroyCallbacks,qd as runMountCallbacks,ae as state,Us as untrack,Xd as useOptimistic};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Di,Mi,Hc,Vc,Uc,Wc,ed}from"./chunk-asezs2n3.js";export{Di as createVirtualList,ed as default,Hc as generateVirtualListCSS,Uc as processInfiniteListDirectives,Wc as processVirtualGridDirectives,Mi as processVirtualListDirectives,Vc as useVirtualList};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{un,Hl,Vl,Ul,Wl,ql,g,Gl,Io,Kl,Ua,Wa}from"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{un as STX_ENGINE_BINDING_NAMES,Io as convertToCommonJS,Ua as extractScriptFromTemplate,g as extractVariables,Wa as hasVariables,Gl as isCompleteImport,ql as isMissingBindingFailure,Ul as isModuleResolutionFailure,Wl as isSyntaxFailure,Kl as splitDeclaration,Hl as stripTypeScript,Vl as withoutStxReferrer};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Vi,Ui,Wi,qi,np}from"./chunk-trz8z4j4.js";import"./chunk-cbjabv1w.js";import"./chunk-a4p18ybc.js";import"./chunk-aet1pgw7.js";import"./chunk-kdebh22m.js";import"./chunk-rr527jt6.js";import"./chunk-xcsyqwxf.js";import"./chunk-bkkpq8dx.js";import"./chunk-7j1zgrnf.js";import"./chunk-v6peecfp.js";import"./chunk-40tswfe7.js";import"./chunk-twqzn21x.js";import"./chunk-hgry3mjd.js";import"./chunk-4b9s7wgy.js";import"./chunk-srq9fqq8.js";import"./chunk-rym0309c.js";import"./chunk-7adznted.js";import"./chunk-am2w363p.js";import"./chunk-5qtthtg3.js";import"./chunk-4s8zacxg.js";import"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{Vi as buildNative,np as default,Ui as findCraftBinary,qi as getAvailableFormats,Wi as getAvailableTargets};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ti,ni,ri,Cu,si,oi,Eu,ii,ai,xc,Tu}from"./chunk-ck2e3e47.js";export{ti as VideoProcessorCache,xc as analyzeVideo,Cu as clearVideoCache,ai as generateDASHManifest,ii as generateHLSManifest,si as generatePoster,Eu as generateSpriteSheet,oi as generateThumbnails,ni as getCachedVideoResult,Tu as processVideo,ri as setCachedVideoResult};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Sc,kc}from"./chunk-w7t2cfgy.js";import"./chunk-fb7t1nn9.js";import"./chunk-sqn3y9qt.js";import"./chunk-fd49fahd.js";import"./chunk-qz5b8ed4.js";import"./chunk-fbmth6xv.js";import"./chunk-tddnb5bv.js";import"./chunk-vdxg7e1y.js";import{Ci}from"./chunk-bawq4fqy.js";import"./chunk-j6m8xqh3.js";import"./chunk-fw413k9q.js";import"./chunk-z22zy22p.js";import"./chunk-t9kxhe46.js";import"./chunk-4w6baw62.js";import"./chunk-t79jfpv6.js";import"./chunk-asezs2n3.js";import"./chunk-hb3edeq9.js";import"./chunk-yx3dpdwc.js";import"./chunk-w3d98907.js";import"./chunk-5vt48yce.js";import"./chunk-faakv1p6.js";import"./chunk-pg2v1pb5.js";import"./chunk-rdr09efy.js";import"./chunk-pb6erpj3.js";import"./chunk-ham5x7ts.js";import"./chunk-y1pcdeg9.js";import"./chunk-pqqe2b6m.js";import"./chunk-hsmcbh0p.js";import"./chunk-9dtbvjpp.js";import"./chunk-cbjabv1w.js";import"./chunk-a4p18ybc.js";import"./chunk-r7fdw2v5.js";import"./chunk-rv39s5az.js";import"./chunk-hz4x7h0n.js";import"./chunk-md2jn67b.js";import{Te,s}from"./chunk-aet1pgw7.js";import"./chunk-kdebh22m.js";import"./chunk-rr527jt6.js";import"./chunk-xcsyqwxf.js";import"./chunk-bkkpq8dx.js";import"./chunk-7j1zgrnf.js";import"./chunk-v6peecfp.js";import"./chunk-40tswfe7.js";import{he}from"./chunk-twqzn21x.js";import"./chunk-hgry3mjd.js";import{Jn,Yn}from"./chunk-4b9s7wgy.js";import{Gr,N,o}from"./chunk-srq9fqq8.js";import"./chunk-rym0309c.js";import"./chunk-7adznted.js";import"./chunk-am2w363p.js";import"./chunk-5qtthtg3.js";import"./chunk-4s8zacxg.js";import{g,Ne}from"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";import"./chunk-xghcsg3f.js";import"./chunk-ck2e3e47.js";export{Gr as buildWebComponents,Yn as cacheTemplate,Jn as checkCache,Ci as classifyAllScripts,Sc as createMiddleware,kc as createRoute,N as defaultConfig,g as extractVariables,he as injectRouterScript,o as loadStxConfig,Ne as processClientScript,s as processDirectives,Te as readMarkdownFile};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{wo,xo,vt,ce,Qn,Qr,er,es,ts,Il,Ol,Nl,tr,Dl,Ml,Ll,jl,Sa,ka,_a,So,Ca,Bl,wt,xt,St,kt,_t,Ct,Ye,Fl}from"./chunk-4s8zacxg.js";export{er as Router,Ll as abortNavigation,Qr as bracketPathToRegex,wt as clearMiddleware,ka as createClientCookieManager,_t as createMiddlewareContext,kt as createRouteLocation,Sa as createServerCookieManager,_a as createStorageManager,jl as defineMiddleware,Ol as defineRoute,Nl as defineRoutes,es as findErrorPage,ts as formatRoutes,xo as generateRouteManifest,wo as generateRouteTypes,Ca as getMiddleware,xt as getMiddlewareNames,Ye as getRouterScript,Fl as getRouterScriptDev,Bl as hasMiddleware,vt as isFileRequestPath,St as loadMiddlewareFromDirectory,Qn as matchRoute,Ml as navigateTo,ce as patternToRegex,So as registerMiddleware,Dl as resetRoutes,tr as route,Ct as runMiddleware,Il as setAppUrl};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{il}from"./chunk-w3d98907.js";export{il as rewriteImagesWithSiblings};
@@ -1,31 +0,0 @@
1
- // @bun
2
- import{yn}from"./chunk-bsajk82t.js";import{q,Pe,ue,Rt,At,lr,g,Za,Lo,z,_}from"./chunk-f9zyf9n6.js";import{V}from"./chunk-506mv7hb.js";var L=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function H(t,n,e){let r={fullTag:e,content:n,attrs:t};if(/\bserver\b/.test(t))return{...r,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...r,type:"client"};if(L.test(n))return{...r,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...r,type:"client"};return{...r,type:"server"}}var B=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function Ci(t){let n=[],e=[],r=[],i=0;while(i<t.length){let s=t.indexOf("<",i);if(s===-1)break;let a=Pe(t,s);if(a>s){i=a;continue}let o=q(t,s);if(o>s){let c=t.slice(s,o),u=B.exec(c);if(u){let l=H(u[1],u[2],c);switch(l.type){case"signals":n.push(l);break;case"client":e.push(l);break;case"server":r.push(l);break}}i=o;continue}i=s+(t.startsWith("<!--",s)?4:1)}return{signals:n,client:e,server:r}}var G=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function U(t){let n=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=e.exec(t))!==null)n.push({start:r.index,end:r.index+r[0].length});return n}function P(t,n){return n.some((e)=>t>=e.start&&t<e.end)}function W(t){let n=(t||"").trim();if(!n)return null;if(/[\s>+~,:]/.test(n))return null;let e={},r=n,i=r.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),r=r.slice(i[0].length);while(r.length>0){let s=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(s){if(e.attr=s[1],s[3]!==void 0&&s[3]!=="")e.attrValue=s[3];r=r.slice(s[0].length);continue}let a=r.match(/^#([\w-]+)/);if(a){e.id=a[1],r=r.slice(a[0].length);continue}let o=r.match(/^\.([\w-]+)/);if(o){e.className=o[1],r=r.slice(o[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function X(t,n){if(n.attr){if(!(n.attrValue===void 0?new RegExp(`\\b${n.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${n.attr}\\s*=\\s*(["'])\\s*${n.attrValue}\\s*\\1`,"i")).test(t))return!1}if(n.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${n.id}\\s*\\1`,"i").test(t))return!1}if(n.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(n.className))return!1}return!0}function T(t,n="main"){let e=W(n);if(!e)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,i=U(t),s;while((s=r.exec(t))!==null){if(P(s.index,i))continue;let a=s[1].toLowerCase(),o=s[2]||"";if(o.trimEnd().endsWith("/")||G.has(a))continue;if(e.tag&&e.tag!==a)continue;if(!X(o,e))continue;let c=s[0],u=s.index+c.length,l=new RegExp(`<(/?)${a}\\b([^>]*)>`,"gi");l.lastIndex=u;let f=1,m;while((m=l.exec(t))!==null){if(P(m.index,i))continue;let x=m[1]==="/";if(!x&&(m[2]||"").trimEnd().endsWith("/"))continue;if(f+=x?-1:1,f===0)return{openTag:c,openIndex:s.index,start:u,end:m.index,tagName:a}}return null}return null}var ut="private, no-store";function Ei(t){return t.replace(/&#(\d+);/g,(n,e)=>M(Number(e),n)).replace(/&#x([0-9a-f]+);/gi,(n,e)=>M(Number.parseInt(e,16),n)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function M(t,n){if(!Number.isInteger(t)||t<0||t>1114111)return n;try{return String.fromCodePoint(t)}catch{return n}}function Se(t){return t.headers.get("X-STX-Router")==="true"}function J(t,n){if(!t)return n;return t.split(",").some((r)=>r.trim().toLowerCase()===n.toLowerCase())?t:`${t}, ${n}`}function O(t){return{Vary:J(t,"X-STX-Router")}}import A from"path";var K="stx-page-head:",Y=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,C={dev:null,prod:null};function Z(){let t=V()?"dev":"prod",n=C[t];if(n!==null)return n;try{let e=import.meta.require("./chunk-a81y8g40.js"),r=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;C[t]=`<script>${r()}</script>`}catch{C[t]=""}return C[t]}async function Ti(t,n){if(n===!1)return null;if(n&&typeof n==="string"){let r=A.resolve(t,n);if(await Bun.file(r).exists())return r;return null}let e=A.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Bs(t,n){try{let e=await Bun.file(t).text(),r=e,i=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(i)r=i[1].trim();let s=Ci(e),a=[...s.client.map((d)=>d.fullTag),...s.signals.map((d)=>d.fullTag)],o=[],c=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,u;while((u=c.exec(e))!==null)o.push(u[0]);let l=r;for(let d of s.server)l=l.replace(d.fullTag,"");for(let d of s.client)l=l.replace(d.fullTag,"");l=l.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let f="<!--__STX_PAGE_SLOT__-->";if(l=l.replace(/<slot\s*\/>/gi,f).replace(/<slot\s*>\s*<\/slot>/gi,f),!l.includes(f))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:m,extractVariables:x,defaultConfig:y,loadStxConfig:R}=await import("./chunk-a7kt1ts4.js"),S=await R(),p={__filename:t,__dirname:A.dirname(t)};for(let d of a){let w=d.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(w&&!d.includes("client")&&!d.includes('type="module"'))await x(w[1],p,t)}let b=await m(l,p,t,{...y,...S,...n},new Set),h=b.indexOf(f);if(h===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:b.substring(0,h),afterSlot:b.substring(h+f.length),filePath:t,shellScripts:a,shellStyles:o}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function Rr(t,n,e){let r,i="",s=n.match(Y);if(s){n=n.replace(s[0],"");try{let l=Buffer.from(s[1],"base64").toString("utf8"),f=l.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(f)r=f[1].trim();i=l.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let a=e||r||"stx App",o=Z(),c="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
3
- <html lang="en">
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>${a}</title>
8
- ${i?` ${i}
9
- `:""} ${t.shellStyles.join(`
10
- `)}
11
- </head>
12
- <body>
13
- ${t.beforeSlot}
14
- <div data-stx-content>${n}</div>
15
- ${t.afterSlot}
16
- ${t.shellScripts.filter((l)=>!l.includes("server")).join(`
17
- `)}
18
- ${c}
19
- ${o}
20
- </body>
21
- </html>`}function He(t,n={}){let e=t.trim();if(!yn(e))return t;let r=[],i=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(i){let c=i[1],u=/<style\b[^>]*>[\s\S]*?<\/style>/gi,l;while((l=u.exec(c))!==null)r.push(l[0]);let f=c.match(/<script\b[^>]*data-stx-server-data[^>]*>[\s\S]*?<\/script>/i);if(f)r.push(f[0]);let m=c.match(/<script\b[^>]*data-stx-runtime-config[^>]*>[\s\S]*?<\/script>/i);if(m)r.push(m[0])}if(n.preserveHead&&i){let c=[],u=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,l;while((l=u.exec(i[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(l[0]))continue;c.push(l[0])}if(c.length>0)r.unshift(`<!--${K}${Buffer.from(c.join(`
22
- `),"utf8").toString("base64")}-->`)}let s=e.match(/<body\b[^>]*>/i),a=e.lastIndexOf("</body>");if(s&&a!==-1){let c=s.index+s[0].length,u=e.slice(c,a).trim();if(r.length>0)return r.join(`
23
- `)+`
24
- `+u;return u}let o=e;if(o=o.replace(/<!DOCTYPE\b[^>]*>/i,""),o=o.replace(/<html\b[^>]*>/i,""),o=o.replace(/<\/html\s*>/i,""),i)o=o.replace(/<head\b[^>]*>[\s\S]*?<\/head>/i,r.join(`
25
- `));return o=o.replace(/<body\b[^>]*>/i,""),o=o.replace(/<\/body\s*>/i,""),o.trim()}var j=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function N(t,n,e,r){if(!j.test(n))return!1;let i=n.slice(0,n.indexOf(">")+1),s=/\sdata-stx-owner="([^"]+)"/i.exec(i)?.[1];if(!s)return!0;let a=`data-stx-scope="${s}"`;for(let o=t.indexOf(a);o!==-1;o=t.indexOf(a,o+a.length))if(o>=e&&o<r)return!1;return!0}function $i(t){return Se(t)}function Q(t,n){let e=[],r=new Set;for(let i of ue(t,q)){if(i.start>=n.start&&i.start<n.end)continue;let s=i.token.match(/^<script\b((?:"[^"]*"|'[^']*'|[^'">])*)>/i)?.[1]??"",a=new Map;for(let u of s.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g))a.set(u[1].toLowerCase(),u[2]??u[3]??u[4]??"");let o=a.get("src")?.trim(),c=a.get("type")?.trim().toLowerCase();if(!o||a.has("server")||c&&!["module","text/javascript","application/javascript"].includes(c))continue;if(a.has("data-stx-runtime")||a.has("data-stx-router")||/^\/_stx\/(?:runtime|router)(?:\.[a-f0-9]{16})?\.js(?:[?#]|$)/i.test(o))continue;if(N(t,i.token,n.start,n.end)||r.has(i.token))continue;r.add(i.token),e.push(i.token)}return e}function ke(t,n="main"){let e=t.trim(),r=[],i=[],s=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(s){let p=s[1],b=/<style\b[^>]*>[\s\S]*?<\/style>/gi,h;while((h=b.exec(p))!==null)r.push(h[0]);let d=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((h=d.exec(p))!==null){if(j.test(h[0])||h[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(h[0]))continue;i.push(h[0])}}let a=T(e,n);if(!a)return He(t);let o=Q(e,a),c=new Set(o),{tagName:u,start:l,end:f}=a,m=e.slice(l,f).trim(),x=[],y=e.match(/<body\b[^>]*>/i),R=e.lastIndexOf("</body>");if(y&&y.index!==void 0&&R!==-1){let b=[[y.index+y[0].length,a.openIndex],[f+`</${u}>`.length,R]],h=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[d,w]of b){if(d>=w)continue;let F=e.slice(d,w),v;h.lastIndex=0;while((v=h.exec(F))!==null){if(N(e,v[0],l,f))continue;x.push(v[0])}}}let S=[];if(r.length>0)S.push(r.join(`
26
- `));if(o.length>0)S.push(o.join(`
27
- `));if(i.length>0)S.push(i.filter((p)=>!c.has(p)).join(`
28
- `));if(x.length>0)S.push(x.filter((p)=>!c.has(p)).join(`
29
- `));return S.push(m),S.join(`
30
- `)}import E from"fs";import I from"path";function Ri(t,n,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:n,outputDir:e}}function Ai(t,n){let e=I.join(n,"manifest.json");E.writeFileSync(e,JSON.stringify(t,null,2))}function Pi(t){let n=I.join(t,"manifest.json");if(!E.existsSync(n))return null;try{let e=E.readFileSync(n,"utf-8"),r=JSON.parse(e);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function k(t,n,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function tt(t){let n=t.headers.get("content-type")||"",e={},r=(i,s)=>{let a=e[i];if(a===void 0)e[i]=s;else if(Array.isArray(a))a.push(s);else e[i]=[a,s]};if(n.includes("multipart/form-data")){let i=await t.formData();for(let[s,a]of i.entries())if(typeof a==="string")r(s,a);return e}if(n.includes("application/x-www-form-urlencoded")){for(let[i,s]of new URLSearchParams(await t.text()).entries())r(i,s);return e}return e}function Fs(t){if(!t)return!1;let n=t.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function D(t,n={}){let e=n.request,r=n.method??e?.method;if(!e||!Fs(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await tt(e)}catch{}let s=await t.action({request:e,form:i,params:n.params??{},query:t.query??{},cookies:n.cookies??{}});if(s&&typeof s==="object"){let a=s,o=et(a.cookies),c=a.redirect;if(typeof c==="string"&&c)return{redirect:c,ran:!0,...o.length>0?{cookies:o}:{}};let{cookies:u,redirect:l,...f}=a;if(Object.assign(t,f),o.length>0)return{ran:!0,cookies:o}}return{ran:!0}}function et(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let n=[];for(let[e,r]of Object.entries(t)){if(!e)continue;if(typeof r==="string"){n.push(k(e,r));continue}if(r&&typeof r==="object"){let i=r;if(typeof i.value!=="string")continue;n.push(k(e,i.value,i))}}return n}function Ii(t,n=[],e){let r=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of n)r.append("Set-Cookie",i);for(let[i,s]of Object.entries(e??{}))if(i.toLowerCase()!=="location")r.set(i,s);return new Response(null,{status:303,headers:r})}async function kn(t,n={}){let{html:e,context:r,redirect:i,cookies:s}=await nt(t,n),a=Rt(r),o=At(r);if(i)return{html:e,redirect:i,cookies:s,status:a,headers:o};let{extractStreamBoundaries:c}=await import("./chunk-7kznee1g.js"),u=c(r),l=t.streamTemplates;if(l&&Object.keys(l).length>0){let{processDirectives:f}=await import("./chunk-jzjpyyw2.js"),{defaultConfig:m}=await import("./chunk-2881tcqt.js"),x=r.streamBoundaries||{},y={...m,autoShell:!1},R=Object.keys(l).map((p)=>({id:p,render:async()=>{let b=typeof x[p]==="function"?await x[p]():void 0;return f(l[p],{...r,$boundary:b},t.sourceFile,y,new Set)}})),S=new Set(R.map((p)=>p.id));u=[...(u||[]).filter((p)=>!S.has(p.id)),...R]}return{html:e,boundaries:u&&u.length>0?u:void 0,cookies:s,status:a,headers:o}}async function nt(t,n){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...n};if(!t.hasServerScripts&&!Lo(t.html))return{html:t.html,context:e};for(let a of t.serverScriptContent)try{await g(a,e,t.sourceFile)}catch(o){if(n.__stx_strict_hydration)throw o;console.warn(`[stx] Server script error in ${t.sourceFile}:`,o)}let r=await D(e,{request:n.request,method:n.method,params:n.params??{},cookies:n.cookies??{}}),i=(a)=>{let o=a.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),c=lr(e);if(!c)return o;let u=o.indexOf("</head>");return u<0?c+o:o.slice(0,u)+c+o.slice(u)};if(r.redirect)return{html:t.html,context:e,redirect:r.redirect,cookies:r.cookies};if(!Lo(t.html))return{html:i(t.html),context:e,cookies:r.cookies};let s=new Map;for(let[a,o]of Object.entries(t.placeholders))if(o.expression)try{let c=_(o.expression,e);if(o.type==="raw")s.set(a,c!==void 0&&c!==null?String(c):"");else s.set(a,c!==void 0&&c!==null?z(String(c)):"")}catch(c){if(n.__stx_strict_hydration)throw c;s.set(a,"")}return{html:i(Za(t.html,s)),context:e,cookies:r.cookies}}
31
- export{Ci,ut,Ei,Se,O,Ti,Bs,Rr,He,$i,ke,Ri,Ai,Pi,Fs,Ii,kn};