@stacksjs/stx 0.2.919 → 0.2.921

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 (249) hide show
  1. package/dist/chunk-0678sab4.js +2 -0
  2. package/dist/chunk-0bnv0aaz.js +2 -0
  3. package/dist/chunk-0bvfm5h5.js +2 -0
  4. package/dist/chunk-0c3q5h03.js +2 -0
  5. package/dist/chunk-0fh84wr5.js +2 -0
  6. package/dist/chunk-0p9x0m5n.js +2 -0
  7. package/dist/{chunk-m390z8w8.js → chunk-0rq1w0xr.js} +7 -7
  8. package/dist/{chunk-fwxgzktt.js → chunk-1pc2p489.js} +2 -2
  9. package/dist/{chunk-2szhk8mh.js → chunk-29cy41z3.js} +4 -4
  10. package/dist/{chunk-9mack1g8.js → chunk-2d0pemtc.js} +3 -3
  11. package/dist/{chunk-1bf0grbf.js → chunk-2qnpr0ty.js} +3 -3
  12. package/dist/{chunk-fjpt8arw.js → chunk-2r2tayyd.js} +2 -2
  13. package/dist/chunk-2sfxj244.js +2 -0
  14. package/dist/{chunk-wxqay5c2.js → chunk-30d298vs.js} +1 -1
  15. package/dist/{chunk-d69k67bn.js → chunk-36j2drjv.js} +9 -9
  16. package/dist/{chunk-9gr7m3tb.js → chunk-3d0bjcn7.js} +1 -1
  17. package/dist/chunk-3k9d0h11.js +2 -0
  18. package/dist/{chunk-whnzf9hn.js → chunk-3mc9ew9r.js} +6 -6
  19. package/dist/chunk-43r0h76m.js +2 -0
  20. package/dist/{chunk-cbqe84g3.js → chunk-4f8h38xr.js} +2 -2
  21. package/dist/{chunk-858p3hkz.js → chunk-4jg8ddfy.js} +2 -2
  22. package/dist/chunk-4jh5t3rz.js +2 -0
  23. package/dist/{chunk-rk16391e.js → chunk-4nabpd82.js} +5 -5
  24. package/dist/{chunk-p3x7kwb5.js → chunk-4w203ddt.js} +6 -6
  25. package/dist/chunk-4y2k14ec.js +2 -0
  26. package/dist/chunk-57xcb1wn.js +2 -0
  27. package/dist/chunk-5ekbye3p.js +2 -0
  28. package/dist/chunk-5s1q4y2j.js +2 -0
  29. package/dist/chunk-6359fekc.js +2 -0
  30. package/dist/{chunk-wv0wsavj.js → chunk-66cz2ph7.js} +2 -2
  31. package/dist/{chunk-p0xqm2ne.js → chunk-7767n5k6.js} +1 -1
  32. package/dist/{chunk-xpsg91dh.js → chunk-78j6c3sf.js} +5 -5
  33. package/dist/{chunk-qtzfbv7e.js → chunk-7d0h2pa3.js} +5 -5
  34. package/dist/{chunk-jgtn9t5n.js → chunk-7g720sk3.js} +2 -2
  35. package/dist/chunk-7nshr15z.js +2 -0
  36. package/dist/{chunk-14df2jzs.js → chunk-875wejw1.js} +2 -2
  37. package/dist/chunk-8g6cmgn8.js +2 -0
  38. package/dist/chunk-8gfdy17b.js +2 -0
  39. package/dist/{chunk-fn0y9z1t.js → chunk-8vjsmyrk.js} +5 -5
  40. package/dist/chunk-8yx65vb0.js +2 -0
  41. package/dist/{chunk-09xqy448.js → chunk-90ps064x.js} +2 -2
  42. package/dist/chunk-91nwc581.js +2 -0
  43. package/dist/{chunk-yzqb7y45.js → chunk-94001bha.js} +5 -5
  44. package/dist/chunk-94skx5m6.js +2 -0
  45. package/dist/chunk-9aegppj7.js +2 -0
  46. package/dist/{chunk-gjyz5ma7.js → chunk-9ch2qhbw.js} +1 -1
  47. package/dist/{chunk-m6hrb7rm.js → chunk-9sk596tw.js} +25 -25
  48. package/dist/{chunk-3ftrv1f7.js → chunk-a3qb13vr.js} +20 -20
  49. package/dist/chunk-a5vzdhsk.js +2 -0
  50. package/dist/{chunk-jjq7c8s2.js → chunk-a78k8fkg.js} +2 -2
  51. package/dist/{chunk-txk2z7v0.js → chunk-ag07tdhn.js} +4 -4
  52. package/dist/{chunk-0wctbtad.js → chunk-amnfd29h.js} +3 -3
  53. package/dist/chunk-aqh48tyw.js +2 -0
  54. package/dist/{chunk-zaj3nnvv.js → chunk-avtq2p0c.js} +2 -2
  55. package/dist/{chunk-3kpxkjgm.js → chunk-b0kq5mzq.js} +2 -2
  56. package/dist/chunk-b6am4h24.js +2 -0
  57. package/dist/{chunk-qzqqzraq.js → chunk-b9z4nb1v.js} +6 -6
  58. package/dist/{chunk-d4xjwebv.js → chunk-bwnx71s8.js} +5 -5
  59. package/dist/{chunk-mr9pp5cf.js → chunk-c3nmjx26.js} +2 -2
  60. package/dist/chunk-cajg2sz0.js +2 -0
  61. package/dist/{chunk-3efpqm1f.js → chunk-dhx4m7mf.js} +2 -2
  62. package/dist/chunk-dktqmf4t.js +2 -0
  63. package/dist/chunk-dqwxyk1m.js +2 -0
  64. package/dist/chunk-e2kk1d9z.js +2 -0
  65. package/dist/{chunk-zrxvj3zf.js → chunk-e8aqkt1b.js} +6 -6
  66. package/dist/{chunk-mztjpp7m.js → chunk-e8hvbc53.js} +2 -2
  67. package/dist/{chunk-kk9h53xg.js → chunk-edjzm0vj.js} +3 -3
  68. package/dist/chunk-ee4ejnk2.js +2 -0
  69. package/dist/chunk-eezp4a40.js +2 -0
  70. package/dist/chunk-eh2ynja3.js +2 -0
  71. package/dist/chunk-emk29htn.js +2 -0
  72. package/dist/{chunk-xq5s4vc1.js → chunk-eqj8nj5c.js} +1 -1
  73. package/dist/{chunk-ktv65e3n.js → chunk-f8sh6289.js} +7 -7
  74. package/dist/{chunk-6n6kndk0.js → chunk-fb1hyhgf.js} +3 -3
  75. package/dist/chunk-fd0vnz09.js +2 -0
  76. package/dist/chunk-fyhtp2nt.js +2 -0
  77. package/dist/{chunk-xk7hdpq5.js → chunk-g2fxp9zp.js} +3 -3
  78. package/dist/chunk-gbct53j0.js +2 -0
  79. package/dist/{chunk-m9ta0640.js → chunk-gsm3rk4j.js} +2 -2
  80. package/dist/{chunk-x40j67z1.js → chunk-gt9bt8xa.js} +2 -2
  81. package/dist/{chunk-ft34x0h1.js → chunk-gxdy4qjj.js} +4 -4
  82. package/dist/chunk-gxtq25gr.js +2 -0
  83. package/dist/chunk-h1dnjn9g.js +2 -0
  84. package/dist/{chunk-yvaqgdv1.js → chunk-h7z23fpq.js} +1 -1
  85. package/dist/{chunk-sxrcac01.js → chunk-hakevnm1.js} +2 -2
  86. package/dist/chunk-hn7fv830.js +2 -0
  87. package/dist/chunk-hx6tr46s.js +1459 -0
  88. package/dist/chunk-jenk04c8.js +2 -0
  89. package/dist/{chunk-1baxccfq.js → chunk-jfy0r3hx.js} +24 -24
  90. package/dist/{chunk-9zwmfkfg.js → chunk-jh007a8k.js} +5 -5
  91. package/dist/chunk-jh1hdq31.js +3 -0
  92. package/dist/{chunk-tb4be5ct.js → chunk-jk1hzawb.js} +3 -3
  93. package/dist/{chunk-hht7n4zd.js → chunk-jya12bfn.js} +2 -2
  94. package/dist/chunk-k1qbgpfy.js +2 -0
  95. package/dist/chunk-kgmwja6f.js +2 -0
  96. package/dist/{chunk-z6nyyt3n.js → chunk-khf62zkn.js} +5 -5
  97. package/dist/chunk-kppj8rqa.js +2 -0
  98. package/dist/{chunk-514yg4dr.js → chunk-m3ra99h8.js} +6 -6
  99. package/dist/{chunk-qsnw0qyp.js → chunk-m8rzaqm8.js} +2 -2
  100. package/dist/chunk-msvphygp.js +2 -0
  101. package/dist/chunk-mzbejejf.js +2 -0
  102. package/dist/{chunk-v1x96kjr.js → chunk-nkgqhb7s.js} +7 -7
  103. package/dist/{chunk-9707zz6v.js → chunk-p17jeqz0.js} +2 -2
  104. package/dist/{chunk-2f46pcg0.js → chunk-pe5sstex.js} +2 -2
  105. package/dist/{chunk-vtj3dwhh.js → chunk-pqr4gn9b.js} +2 -2
  106. package/dist/{chunk-40j2pmnb.js → chunk-prj38cyp.js} +5 -5
  107. package/dist/{chunk-mn9t5fnv.js → chunk-q8snpht6.js} +2 -2
  108. package/dist/chunk-q99y5115.js +3 -0
  109. package/dist/{chunk-7axtwg1f.js → chunk-qzspvwv6.js} +2 -2
  110. package/dist/chunk-r02asm46.js +2 -0
  111. package/dist/{chunk-vf7tpgqz.js → chunk-r7zvrh58.js} +16 -16
  112. package/dist/{chunk-ex6dne7e.js → chunk-ra35ptjg.js} +2 -2
  113. package/dist/chunk-rc4712qh.js +2 -0
  114. package/dist/chunk-rq7sg012.js +33 -0
  115. package/dist/{chunk-v060015m.js → chunk-rt4gzqs9.js} +1 -1
  116. package/dist/chunk-rx1xw7q2.js +2 -0
  117. package/dist/{chunk-mnpfvxpa.js → chunk-rzmephr2.js} +30 -30
  118. package/dist/{chunk-0xyfs691.js → chunk-s3rhbwgf.js} +4 -4
  119. package/dist/{chunk-xap1f1bw.js → chunk-s6w14v6h.js} +2 -2
  120. package/dist/{chunk-nkbnsbb0.js → chunk-sdvv8zge.js} +2 -2
  121. package/dist/{chunk-3br07y64.js → chunk-sgppgy5e.js} +5 -5
  122. package/dist/{chunk-v1a5h1tc.js → chunk-sk7pptzf.js} +9 -9
  123. package/dist/{chunk-50zzar2c.js → chunk-sk8x8nw8.js} +3 -3
  124. package/dist/chunk-skjm3zdh.js +2 -0
  125. package/dist/{chunk-5fdc8pej.js → chunk-t4exh7c9.js} +7 -7
  126. package/dist/{chunk-3hfv217t.js → chunk-t64mp8x1.js} +6 -6
  127. package/dist/{chunk-neymp1bb.js → chunk-tfpd7aht.js} +3 -3
  128. package/dist/chunk-tsnzhke9.js +2 -0
  129. package/dist/{chunk-yye2pec5.js → chunk-tt6n2mx6.js} +14 -14
  130. package/dist/chunk-txyze88n.js +2 -0
  131. package/dist/chunk-v1t7sees.js +2 -0
  132. package/dist/{chunk-1a2c4pv8.js → chunk-vhp5hqwp.js} +10 -10
  133. package/dist/{chunk-1vsjmwr1.js → chunk-vn3hsx7v.js} +2 -2
  134. package/dist/chunk-vt410s5m.js +2 -0
  135. package/dist/{chunk-3tcy9r6r.js → chunk-w27j0apm.js} +14 -14
  136. package/dist/{chunk-2zb642qr.js → chunk-w5vxzk5j.js} +6 -6
  137. package/dist/chunk-w81a1e14.js +9 -0
  138. package/dist/{chunk-tnbzg7fd.js → chunk-wajvxzt0.js} +2 -2
  139. package/dist/chunk-wrva7jes.js +2 -0
  140. package/dist/{chunk-p4twxjfs.js → chunk-ws25jw6x.js} +3 -3
  141. package/dist/{chunk-m86sjbx7.js → chunk-ww24mxmd.js} +3 -3
  142. package/dist/chunk-xdprx6tx.js +1331 -0
  143. package/dist/chunk-xgv3gy1b.js +2 -0
  144. package/dist/chunk-xjhv5e5f.js +2 -0
  145. package/dist/chunk-xnvh4jk2.js +21 -0
  146. package/dist/chunk-xtakhmnb.js +2 -0
  147. package/dist/{chunk-zb6my502.js → chunk-y97g0kwc.js} +1 -1
  148. package/dist/chunk-y9f9d4zv.js +2 -0
  149. package/dist/{chunk-qda8tmk9.js → chunk-yfe380a4.js} +2 -2
  150. package/dist/{chunk-6x5a2w5a.js → chunk-ygtz9kc7.js} +2 -2
  151. package/dist/chunk-yyypc7s3.js +2 -0
  152. package/dist/chunk-z5j4prza.js +2 -0
  153. package/dist/{chunk-2jm7map2.js → chunk-z68teecy.js} +2 -2
  154. package/dist/cli.js +20 -20
  155. package/dist/composables/use-media-query.js +23 -22
  156. package/dist/craft-entry.js +2 -2
  157. package/dist/craft.js +2 -2
  158. package/dist/native/accessibility.d.ts +1 -1
  159. package/dist/native/accessibility.js +5 -3
  160. package/dist/native/bridge/protocol.d.ts +1 -0
  161. package/dist/native/compiler/html-to-ir.js +14 -1
  162. package/dist/native/compiler/ir.d.ts +7 -0
  163. package/dist/native/components/primitives.d.ts +1 -0
  164. package/dist/native/event-names.js +4 -0
  165. package/dist/native/prop-names.js +3 -1
  166. package/dist/native/runtime/browser-renderer.js +4 -0
  167. package/dist/native/runtime/craft-bridge.js +1 -0
  168. package/dist/native/runtime/craft.d.ts +3 -0
  169. package/dist/native/runtime/jsc-globals.js +1 -1
  170. package/dist/native/runtime/native-media.js +8 -3
  171. package/dist/native/runtime/shared-screen.js +8 -3
  172. package/dist/native/testing.d.ts +2 -1
  173. package/dist/native/testing.js +2 -1
  174. package/dist/process.js +6 -3
  175. package/dist/pwa.js +3 -3
  176. package/dist/signal-processing.d.ts +2 -2
  177. package/dist/signal-processing.js +17 -11
  178. package/dist/ssg.js +9 -9
  179. package/dist/utils.js +2 -1
  180. package/dist/vue-template.d.ts +2 -0
  181. package/dist/vue-template.js +72 -2
  182. package/package.json +6 -6
  183. package/dist/chunk-0ebaf0pr.js +0 -2
  184. package/dist/chunk-0jjq552g.js +0 -2
  185. package/dist/chunk-15rc8t28.js +0 -2
  186. package/dist/chunk-1jrhjn2b.js +0 -2
  187. package/dist/chunk-1svffhzq.js +0 -2
  188. package/dist/chunk-2m4ydym0.js +0 -33
  189. package/dist/chunk-2mv29s6w.js +0 -9
  190. package/dist/chunk-3aayrnbh.js +0 -21
  191. package/dist/chunk-426gq0g5.js +0 -2
  192. package/dist/chunk-4ge80k8j.js +0 -2
  193. package/dist/chunk-4vdfqr64.js +0 -2
  194. package/dist/chunk-4yz33vzb.js +0 -2
  195. package/dist/chunk-4zcswx6x.js +0 -2
  196. package/dist/chunk-5ht628zp.js +0 -2
  197. package/dist/chunk-67zy5p7x.js +0 -2
  198. package/dist/chunk-8153bfpx.js +0 -2
  199. package/dist/chunk-86p0m920.js +0 -2
  200. package/dist/chunk-88texeh4.js +0 -2
  201. package/dist/chunk-8mye65n9.js +0 -2
  202. package/dist/chunk-8ycgk8w6.js +0 -2
  203. package/dist/chunk-9xcsn4pb.js +0 -2
  204. package/dist/chunk-a5tg553d.js +0 -2
  205. package/dist/chunk-agxxqjjt.js +0 -2
  206. package/dist/chunk-b44pvac7.js +0 -2
  207. package/dist/chunk-b4yp16a2.js +0 -2
  208. package/dist/chunk-fb63xppz.js +0 -2
  209. package/dist/chunk-ffqqkeye.js +0 -2
  210. package/dist/chunk-g1v12bjm.js +0 -2
  211. package/dist/chunk-gg0kkn2e.js +0 -2
  212. package/dist/chunk-ggg8b8n1.js +0 -2
  213. package/dist/chunk-ggrcg7k7.js +0 -2
  214. package/dist/chunk-gmn9ba8f.js +0 -3
  215. package/dist/chunk-gqe574d9.js +0 -2
  216. package/dist/chunk-hajamm16.js +0 -2
  217. package/dist/chunk-hg2n2264.js +0 -2
  218. package/dist/chunk-hxabvt31.js +0 -2
  219. package/dist/chunk-j3sat6vn.js +0 -2
  220. package/dist/chunk-j9gbnqxq.js +0 -2
  221. package/dist/chunk-jj2z4nxa.js +0 -2
  222. package/dist/chunk-k289127j.js +0 -2
  223. package/dist/chunk-m1hfh2t4.js +0 -2
  224. package/dist/chunk-m3qwqhxp.js +0 -2
  225. package/dist/chunk-m9smh7fs.js +0 -2
  226. package/dist/chunk-mhnjtc42.js +0 -2
  227. package/dist/chunk-n4bxb2hx.js +0 -2
  228. package/dist/chunk-n958bxm6.js +0 -2
  229. package/dist/chunk-nkr1aa5z.js +0 -2
  230. package/dist/chunk-p3vswt0f.js +0 -2
  231. package/dist/chunk-p8wnp4p1.js +0 -2
  232. package/dist/chunk-q3z252d9.js +0 -2
  233. package/dist/chunk-qfkak3jb.js +0 -2
  234. package/dist/chunk-rt7xy537.js +0 -2
  235. package/dist/chunk-rwjye578.js +0 -2
  236. package/dist/chunk-sbr3wg75.js +0 -1467
  237. package/dist/chunk-sftznswb.js +0 -2
  238. package/dist/chunk-tz5ktd6d.js +0 -2
  239. package/dist/chunk-vb609vbj.js +0 -1323
  240. package/dist/chunk-vtcyber4.js +0 -2
  241. package/dist/chunk-wq2bpt0w.js +0 -2
  242. package/dist/chunk-wv8zt78c.js +0 -2
  243. package/dist/chunk-xakqpa4z.js +0 -3
  244. package/dist/chunk-xy3ex6ht.js +0 -2
  245. package/dist/chunk-y899wtm8.js +0 -2
  246. package/dist/chunk-ye45znz5.js +0 -2
  247. package/dist/chunk-yegp50jb.js +0 -2
  248. package/dist/chunk-yq9aqpk8.js +0 -2
  249. package/dist/chunk-zt45dqfx.js +0 -2
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Vm}from"./chunk-z68teecy.js";import"./chunk-rq7sg012.js";import"./chunk-4w203ddt.js";import"./chunk-h7z23fpq.js";import"./chunk-78j6c3sf.js";import"./chunk-hx6tr46s.js";import"./chunk-0rq1w0xr.js";import"./chunk-vhp5hqwp.js";import"./chunk-avtq2p0c.js";import"./chunk-36j2drjv.js";import"./chunk-jh1hdq31.js";import"./chunk-3mc9ew9r.js";import"./chunk-2r2tayyd.js";import"./chunk-xnvh4jk2.js";import"./chunk-nkgqhb7s.js";import"./chunk-7767n5k6.js";import"./chunk-1pc2p489.js";import"./chunk-w81a1e14.js";import"./chunk-w27j0apm.js";import"./chunk-sk8x8nw8.js";import"./chunk-c3nmjx26.js";import"./chunk-ag07tdhn.js";import"./chunk-f8sh6289.js";import"./chunk-t4exh7c9.js";import"./chunk-xdprx6tx.js";import"./chunk-yfe380a4.js";import"./chunk-875wejw1.js";import"./chunk-r7zvrh58.js";import"./chunk-ayrd026n.js";import"./chunk-ra35ptjg.js";import"./chunk-a78k8fkg.js";import"./chunk-4jg8ddfy.js";export{Vm as buildForProduction};
@@ -10,5 +10,5 @@ catch (e) {
10
10
  }
11
11
  throw e;
12
12
  }
13
- `),r.set(h,l)}return l(...s)}catch{return}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:a,context:t.slice()});return a}clear(){this.pool.length=0,this.fnCache.clear()}}var v=new f;class p{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(e){this.enabled=e}isEnabled(){return this.enabled}setBudget(e,t){this.budgets.set(e,{warnThreshold:0.8,action:"warn",...t})}setBudgets(e){for(let[t,i]of Object.entries(e))this.setBudget(t,i)}removeBudget(e){this.budgets.delete(e)}getBudgets(){let e={};for(let[t,i]of this.budgets.entries())e[t]=i;return e}onViolation(e){this.violationHandlers.push(e)}offViolation(e){let t=this.violationHandlers.indexOf(e);if(t!==-1)this.violationHandlers.splice(t,1)}time(e,t){if(!this.enabled)return t();let i=performance.now(),n=t(),r=performance.now()-i;return this.recordTime(e,r),this.checkBudget(e,r),n}async timeAsync(e,t){if(!this.enabled)return t();let i=performance.now(),n=await t(),r=performance.now()-i;return this.recordTime(e,r),this.checkBudget(e,r),n}checkBudget(e,t){let i=this.budgets.get(e);if(!i)return;let n=t/i.maxTime*100,r=i.warnThreshold!==void 0?t>=i.maxTime*i.warnThreshold&&t<i.maxTime:!1,c=t>=i.maxTime;if(!r&&!c)return;let a={label:e,actualTime:t,budgetTime:i.maxTime,exceedancePercent:n,timestamp:new Date,isWarning:r};this.violations.push(a);while(this.violations.length>this.maxViolations)this.violations.shift();for(let u of this.violationHandlers)try{u(a)}catch{}let s=r?`[Performance Warning] "${e}" took ${t.toFixed(2)}ms (${n.toFixed(1)}% of ${i.maxTime}ms budget)`:`[Performance Budget Exceeded] "${e}" took ${t.toFixed(2)}ms (exceeded ${i.maxTime}ms budget by ${(n-100).toFixed(1)}%)`;switch(i.action){case"log":console.log(s);break;case"warn":console.warn(s);break;case"error":console.error(s);break;case"throw":if(c)throw Error(s);else console.warn(s);break}}recordTime(e,t){let i=this.metrics.get(e);if(i)i.count++,i.totalTime+=t,i.maxTime=Math.max(i.maxTime,t),i.minTime=Math.min(i.minTime,t);else this.metrics.set(e,{count:1,totalTime:t,maxTime:t,minTime:t})}getStats(e){if(e){let i=this.metrics.get(e);if(!i)return{};let n=this.budgets.get(e);return{count:i.count,avgTime:i.totalTime/i.count,totalTime:i.totalTime,maxTime:i.maxTime,minTime:i.minTime,budget:n?.maxTime,budgetUtilization:n?i.totalTime/i.count/n.maxTime*100:void 0}}let t={};for(let[i,n]of this.metrics.entries()){let r=this.budgets.get(i);t[i]={count:n.count,avgTime:n.totalTime/n.count,totalTime:n.totalTime,maxTime:n.maxTime,minTime:n.minTime,budget:r?.maxTime,budgetUtilization:r?n.totalTime/n.count/r.maxTime*100:void 0}}return t}getViolations(e){if(e)return this.violations.filter((t)=>t.label===e);return[...this.violations]}getViolationStats(){let e={},t=0,i=0;for(let n of this.violations)if(e[n.label]=(e[n.label]||0)+1,n.isWarning)t++;else i++;return{total:this.violations.length,byLabel:e,warnings:t,errors:i}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var m=null;function b(){if(!m)m=new p;return m}var ve=new Proxy({},{get(e,t){return b()[t]}});var g=0;async function R(){if(performance.now()-g<16)return;await new Promise((e)=>setTimeout(e,0)),g=performance.now()}
14
- export{T,rn,ve,R};
13
+ `),r.set(h,l)}return l(...s)}catch{return}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:a,context:t.slice()});return a}clear(){this.pool.length=0,this.fnCache.clear()}}var v=new f;class p{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(e){this.enabled=e}isEnabled(){return this.enabled}setBudget(e,t){this.budgets.set(e,{warnThreshold:0.8,action:"warn",...t})}setBudgets(e){for(let[t,i]of Object.entries(e))this.setBudget(t,i)}removeBudget(e){this.budgets.delete(e)}getBudgets(){let e={};for(let[t,i]of this.budgets.entries())e[t]=i;return e}onViolation(e){this.violationHandlers.push(e)}offViolation(e){let t=this.violationHandlers.indexOf(e);if(t!==-1)this.violationHandlers.splice(t,1)}time(e,t){if(!this.enabled)return t();let i=performance.now(),n=t(),r=performance.now()-i;return this.recordTime(e,r),this.checkBudget(e,r),n}async timeAsync(e,t){if(!this.enabled)return t();let i=performance.now(),n=await t(),r=performance.now()-i;return this.recordTime(e,r),this.checkBudget(e,r),n}checkBudget(e,t){let i=this.budgets.get(e);if(!i)return;let n=t/i.maxTime*100,r=i.warnThreshold!==void 0?t>=i.maxTime*i.warnThreshold&&t<i.maxTime:!1,c=t>=i.maxTime;if(!r&&!c)return;let a={label:e,actualTime:t,budgetTime:i.maxTime,exceedancePercent:n,timestamp:new Date,isWarning:r};this.violations.push(a);while(this.violations.length>this.maxViolations)this.violations.shift();for(let u of this.violationHandlers)try{u(a)}catch{}let s=r?`[Performance Warning] "${e}" took ${t.toFixed(2)}ms (${n.toFixed(1)}% of ${i.maxTime}ms budget)`:`[Performance Budget Exceeded] "${e}" took ${t.toFixed(2)}ms (exceeded ${i.maxTime}ms budget by ${(n-100).toFixed(1)}%)`;switch(i.action){case"log":console.log(s);break;case"warn":console.warn(s);break;case"error":console.error(s);break;case"throw":if(c)throw Error(s);else console.warn(s);break}}recordTime(e,t){let i=this.metrics.get(e);if(i)i.count++,i.totalTime+=t,i.maxTime=Math.max(i.maxTime,t),i.minTime=Math.min(i.minTime,t);else this.metrics.set(e,{count:1,totalTime:t,maxTime:t,minTime:t})}getStats(e){if(e){let i=this.metrics.get(e);if(!i)return{};let n=this.budgets.get(e);return{count:i.count,avgTime:i.totalTime/i.count,totalTime:i.totalTime,maxTime:i.maxTime,minTime:i.minTime,budget:n?.maxTime,budgetUtilization:n?i.totalTime/i.count/n.maxTime*100:void 0}}let t={};for(let[i,n]of this.metrics.entries()){let r=this.budgets.get(i);t[i]={count:n.count,avgTime:n.totalTime/n.count,totalTime:n.totalTime,maxTime:n.maxTime,minTime:n.minTime,budget:r?.maxTime,budgetUtilization:r?n.totalTime/n.count/r.maxTime*100:void 0}}return t}getViolations(e){if(e)return this.violations.filter((t)=>t.label===e);return[...this.violations]}getViolationStats(){let e={},t=0,i=0;for(let n of this.violations)if(e[n.label]=(e[n.label]||0)+1,n.isWarning)t++;else i++;return{total:this.violations.length,byLabel:e,warnings:t,errors:i}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var m=null;function b(){if(!m)m=new p;return m}var xe=new Proxy({},{get(e,t){return b()[t]}});var g=0;async function A(){if(performance.now()-g<16)return;await new Promise((e)=>setTimeout(e,0)),g=performance.now()}
14
+ export{T,rn,xe,A};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import c from"fs";import i from"path";import{createHash as k}from"crypto";var j=["pages","components","layouts","partials","composables"],w=new Set;function tl(e){try{return w.has(c.realpathSync(e))}catch{return w.has(i.resolve(e))}}var _=new Set(["extends","root",...j.map((e)=>`${e}Dir`),"publicDir","stateDir","cachePath"]),x=(e)=>e!==null&&typeof e==="object"&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null);function b(e,n,r=""){if(Array.isArray(n))return["middleware","plugins"].includes(r)?[...Array.isArray(e)?e:[],...n]:[...n];if(!x(n))return n;let o={...x(e)?e:{}};for(let[s,a]of Object.entries(n)){if(["__proto__","constructor","prototype"].includes(s))throw Error(`Invalid layer config key: ${s}`);o[s]=b(o[s],a,s)}return o}function v(e){for(let n of["stx.config.ts","stx.config.js","stx.config.mjs",".config/stx.config.ts",".config/stx.ts","ui.config.ts"]){let r=i.join(e,n);if(c.existsSync(r))return c.realpathSync(r)}throw Error(`Application layer has no stx.config.ts: ${e}`)}function E(e,n,r){if(typeof e!=="string"||!e||/^(?:https?:|git[+:])/.test(e))throw Error(`Invalid application layer ${JSON.stringify(e)} in ${n}; use a local path or installed package`);if(e.startsWith(".")||i.isAbsolute(e)){let s=i.resolve(n,e);return c.statSync(s).isDirectory()?v(s):c.realpathSync(s)}let o=n;while(!0){let s=i.join(o,"node_modules",e),a=i.join(s,"package.json");if(c.existsSync(a)){r.add(c.realpathSync(a));let g=JSON.parse(c.readFileSync(a,"utf8"));return g.stx?.layer?c.realpathSync(i.resolve(s,g.stx.layer)):v(s)}let p=i.dirname(o);if(p===o)break;o=p}throw Error(`Cannot resolve application layer ${JSON.stringify(e)} from ${n}`)}async function C(e,n){let r=await Bun.build({entrypoints:[e],target:"bun",format:"esm",splitting:!1,plugins:[{name:"stx-layer-config",setup(a){a.onResolve({filter:/^[^./]/},(p)=>{if(p.path.startsWith("node:"))return{path:p.path,external:!0};return{path:Bun.resolveSync(p.path,p.resolveDir),external:!0}}),a.onLoad({filter:/./},(p)=>{let g=c.realpathSync(p.path);n.add(g),w.add(g);return})}}]});if(!r.success)throw Error(`Cannot load layer ${e}: ${r.logs.join(`
3
- `)}`);let o=r.outputs.find((a)=>a.kind==="entry-point");if(!o||r.outputs.length!==1)throw Error(`Unsupported layer config output: ${e}`);let s=(await import(`data:text/javascript;base64,${Buffer.from(await o.text()).toString("base64")}`)).default;if(!x(s))throw Error(`Layer ${e} must default-export a config object`);return s}async function nl(e,n){let r=new Set,o=[],s=[],a=new Set,p=[];async function g(t,l){if(t=c.realpathSync(t),p.includes(t))throw Error(`Application layer cycle: ${[...p,t].join(" -> ")}`);if(a.has(t))return;a.add(t),p.push(t);let d=await C(t,r);l??=i.basename(i.dirname(t))===".config"?i.dirname(i.dirname(t)):i.dirname(t),l=c.realpathSync(l);let D=i.resolve(l,d.root??"."),L=Object.fromEntries(j.map((y)=>[y,i.resolve(D,d[`${y}Dir`]??(y==="composables"?"functions":y))]));o.push({root:l,configFile:t,resources:L});let u={...d};if(u.plugins)u.plugins=u.plugins.map((y)=>{let h=typeof y==="string"?y:y[0],S=h.startsWith(".")?i.resolve(l,h):i.isAbsolute(h)?h:Bun.resolveSync(h,l);return r.add(c.realpathSync(S)),typeof y==="string"?S:[S,y[1]]});if(typeof u.css==="string")u.css=i.resolve(l,u.css);if(u.serverApi)u.serverApi={...typeof u.serverApi==="object"?u.serverApi:{},dir:i.resolve(l,typeof u.serverApi==="object"?u.serverApi.dir??"server/api":"server/api")};if(s.push(u),d.extends!==void 0&&!Array.isArray(d.extends))throw Error(`extends in ${t} must be an array`);for(let y of d.extends??[])await g(E(y,l,r));p.pop()}await g(v(e),e);for(let t of["package.json","bun.lock","package-lock.json","pnpm-lock.yaml"]){let l=i.join(e,t);if(c.existsSync(l))r.add(c.realpathSync(l))}let f=b({},n);for(let t=s.length-1;t>=0;t--){let l=t===0?s[t]:Object.fromEntries(Object.entries(s[t]).filter(([d])=>!_.has(d)));f=b(f,l)}let m={layers:o,configDependencies:[...r].sort()};return f._layerGraph=m,f._layerPageDirs=o.map((t)=>t.resources.pages),f._layerComponentDirs=o.map((t)=>t.resources.components),f._layerLayoutDirs=o.map((t)=>t.resources.layouts),f._layerPartialDirs=o.map((t)=>t.resources.partials),f._layerComposableDirs=o.map((t)=>t.resources.composables),await _i(m,e),{config:f,graph:m}}async function _i(e,n){let r=new Map,o=[];for(let s of e.layers)for(let[a,p]of Object.entries(s.resources)){if(!c.existsSync(p))continue;let g=new Bun.Glob(a==="composables"?"**/*.ts":"**/*.stx");for(let f of[...g.scanSync({cwd:p})].sort()){let m=`${a}/${f}`,t=i.join(p,f),l=r.get(m);if(l)o.push({resource:m,winner:l,shadowed:t});else r.set(m,t)}}Object.assign(e,{overrides:o}),await Bun.write(i.join(n,".stx/layers.json"),JSON.stringify(e,null,2))}function A(e){let n=new Set(e.configDependencies);function r(o){if(!c.existsSync(o))return;n.add(o);for(let s of c.readdirSync(o,{withFileTypes:!0}).sort((a,p)=>a.name.localeCompare(p.name))){if(s.name.startsWith(".")||s.name==="node_modules")continue;let a=i.join(o,s.name);if(s.isDirectory())r(a);else if(s.isFile())n.add(a)}}for(let o of e.layers)for(let s of Object.values(o.resources))r(s);return[...n].sort()}function Us(e){return O(A(e))}function Vs(e){return O(e.configDependencies)}function O(e){return e.map((n)=>{try{let r=c.statSync(n);return`${n}:${r.mtimeMs}:${r.size}`}catch{return`${n}:missing`}}).join(`
4
- `)}function rl(e){return e.layers.map((n)=>({config:i.relative(n.root,n.configFile),files:A({layers:[n],configDependencies:e.configDependencies.filter((r)=>r.startsWith(`${n.root}${i.sep}`))}).filter((r)=>c.statSync(r).isFile()).map((r)=>({path:i.relative(n.root,r).replaceAll(i.sep,"/"),sha256:k("sha256").update(c.readFileSync(r)).digest("hex")}))}))}
5
- export{tl,nl,_i,Us,Vs,rl};
2
+ import c from"fs";import i from"path";import{createHash as k}from"crypto";var j=["pages","components","layouts","partials","composables"],w=new Set;function rl(e){try{return w.has(c.realpathSync(e))}catch{return w.has(i.resolve(e))}}var _=new Set(["extends","root",...j.map((e)=>`${e}Dir`),"publicDir","stateDir","cachePath"]),x=(e)=>e!==null&&typeof e==="object"&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null);function b(e,n,r=""){if(Array.isArray(n))return["middleware","plugins"].includes(r)?[...Array.isArray(e)?e:[],...n]:[...n];if(!x(n))return n;let o={...x(e)?e:{}};for(let[s,a]of Object.entries(n)){if(["__proto__","constructor","prototype"].includes(s))throw Error(`Invalid layer config key: ${s}`);o[s]=b(o[s],a,s)}return o}function v(e){for(let n of["stx.config.ts","stx.config.js","stx.config.mjs",".config/stx.config.ts",".config/stx.ts","ui.config.ts"]){let r=i.join(e,n);if(c.existsSync(r))return c.realpathSync(r)}throw Error(`Application layer has no stx.config.ts: ${e}`)}function E(e,n,r){if(typeof e!=="string"||!e||/^(?:https?:|git[+:])/.test(e))throw Error(`Invalid application layer ${JSON.stringify(e)} in ${n}; use a local path or installed package`);if(e.startsWith(".")||i.isAbsolute(e)){let s=i.resolve(n,e);return c.statSync(s).isDirectory()?v(s):c.realpathSync(s)}let o=n;while(!0){let s=i.join(o,"node_modules",e),a=i.join(s,"package.json");if(c.existsSync(a)){r.add(c.realpathSync(a));let g=JSON.parse(c.readFileSync(a,"utf8"));return g.stx?.layer?c.realpathSync(i.resolve(s,g.stx.layer)):v(s)}let p=i.dirname(o);if(p===o)break;o=p}throw Error(`Cannot resolve application layer ${JSON.stringify(e)} from ${n}`)}async function C(e,n){let r=await Bun.build({entrypoints:[e],target:"bun",format:"esm",splitting:!1,plugins:[{name:"stx-layer-config",setup(a){a.onResolve({filter:/^[^./]/},(p)=>{if(p.path.startsWith("node:"))return{path:p.path,external:!0};return{path:Bun.resolveSync(p.path,p.resolveDir),external:!0}}),a.onLoad({filter:/./},(p)=>{let g=c.realpathSync(p.path);n.add(g),w.add(g);return})}}]});if(!r.success)throw Error(`Cannot load layer ${e}: ${r.logs.join(`
3
+ `)}`);let o=r.outputs.find((a)=>a.kind==="entry-point");if(!o||r.outputs.length!==1)throw Error(`Unsupported layer config output: ${e}`);let s=(await import(`data:text/javascript;base64,${Buffer.from(await o.text()).toString("base64")}`)).default;if(!x(s))throw Error(`Layer ${e} must default-export a config object`);return s}async function sl(e,n){let r=new Set,o=[],s=[],a=new Set,p=[];async function g(t,l){if(t=c.realpathSync(t),p.includes(t))throw Error(`Application layer cycle: ${[...p,t].join(" -> ")}`);if(a.has(t))return;a.add(t),p.push(t);let d=await C(t,r);l??=i.basename(i.dirname(t))===".config"?i.dirname(i.dirname(t)):i.dirname(t),l=c.realpathSync(l);let D=i.resolve(l,d.root??"."),L=Object.fromEntries(j.map((y)=>[y,i.resolve(D,d[`${y}Dir`]??(y==="composables"?"functions":y))]));o.push({root:l,configFile:t,resources:L});let u={...d};if(u.plugins)u.plugins=u.plugins.map((y)=>{let h=typeof y==="string"?y:y[0],S=h.startsWith(".")?i.resolve(l,h):i.isAbsolute(h)?h:Bun.resolveSync(h,l);return r.add(c.realpathSync(S)),typeof y==="string"?S:[S,y[1]]});if(typeof u.css==="string")u.css=i.resolve(l,u.css);if(u.serverApi)u.serverApi={...typeof u.serverApi==="object"?u.serverApi:{},dir:i.resolve(l,typeof u.serverApi==="object"?u.serverApi.dir??"server/api":"server/api")};if(s.push(u),d.extends!==void 0&&!Array.isArray(d.extends))throw Error(`extends in ${t} must be an array`);for(let y of d.extends??[])await g(E(y,l,r));p.pop()}await g(v(e),e);for(let t of["package.json","bun.lock","package-lock.json","pnpm-lock.yaml"]){let l=i.join(e,t);if(c.existsSync(l))r.add(c.realpathSync(l))}let f=b({},n);for(let t=s.length-1;t>=0;t--){let l=t===0?s[t]:Object.fromEntries(Object.entries(s[t]).filter(([d])=>!_.has(d)));f=b(f,l)}let m={layers:o,configDependencies:[...r].sort()};return f._layerGraph=m,f._layerPageDirs=o.map((t)=>t.resources.pages),f._layerComponentDirs=o.map((t)=>t.resources.components),f._layerLayoutDirs=o.map((t)=>t.resources.layouts),f._layerPartialDirs=o.map((t)=>t.resources.partials),f._layerComposableDirs=o.map((t)=>t.resources.composables),await Ei(m,e),{config:f,graph:m}}async function Ei(e,n){let r=new Map,o=[];for(let s of e.layers)for(let[a,p]of Object.entries(s.resources)){if(!c.existsSync(p))continue;let g=new Bun.Glob(a==="composables"?"**/*.ts":"**/*.stx");for(let f of[...g.scanSync({cwd:p})].sort()){let m=`${a}/${f}`,t=i.join(p,f),l=r.get(m);if(l)o.push({resource:m,winner:l,shadowed:t});else r.set(m,t)}}Object.assign(e,{overrides:o}),await Bun.write(i.join(n,".stx/layers.json"),JSON.stringify(e,null,2))}function A(e){let n=new Set(e.configDependencies);function r(o){if(!c.existsSync(o))return;n.add(o);for(let s of c.readdirSync(o,{withFileTypes:!0}).sort((a,p)=>a.name.localeCompare(p.name))){if(s.name.startsWith(".")||s.name==="node_modules")continue;let a=i.join(o,s.name);if(s.isDirectory())r(a);else if(s.isFile())n.add(a)}}for(let o of e.layers)for(let s of Object.values(o.resources))r(s);return[...n].sort()}function Vs(e){return O(A(e))}function Ws(e){return O(e.configDependencies)}function O(e){return e.map((n)=>{try{let r=c.statSync(n);return`${n}:${r.mtimeMs}:${r.size}`}catch{return`${n}:missing`}}).join(`
4
+ `)}function ol(e){return e.layers.map((n)=>({config:i.relative(n.root,n.configFile),files:A({layers:[n],configDependencies:e.configDependencies.filter((r)=>r.startsWith(`${n.root}${i.sep}`))}).filter((r)=>c.statSync(r).isFile()).map((r)=>({path:i.relative(n.root,r).replaceAll(i.sep,"/"),sha256:k("sha256").update(c.readFileSync(r)).digest("hex")}))}))}
5
+ export{rl,sl,Ei,Vs,Ws,ol};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- function E(e,s){let i=e[s],n=s+1;while(n<e.length){if(e[n]==="\\"){n+=2;continue}if(e[n]===i)return n+1;n++}return e.length}function k(e,s){let i=s+1;while(i<e.length){if(e[i]==="\\"){i+=2;continue}if(e[i]==="`")return i+1;if(e[i]==="$"&&e[i+1]==="{"){if(i=Kl(e,i+2),i<e.length)i++;continue}i++}return e.length}function Kl(e,s){let i=1,n=s,f="{",r="";while(n<e.length){let l=e[n];if(l==="\\"){n+=2;continue}if(l==='"'||l==="'"){n=E(e,n),f=o,r="";continue}if(l==="`"){n=k(e,n),f=o,r="";continue}if(l==="/"&&e[n+1]==="/"){while(n<e.length&&e[n]!==`
2
+ function E(e,s){let i=e[s],n=s+1;while(n<e.length){if(e[n]==="\\"){n+=2;continue}if(e[n]===i)return n+1;n++}return e.length}function k(e,s){let i=s+1;while(i<e.length){if(e[i]==="\\"){i+=2;continue}if(e[i]==="`")return i+1;if(e[i]==="$"&&e[i+1]==="{"){if(i=Jl(e,i+2),i<e.length)i++;continue}i++}return e.length}function Jl(e,s){let i=1,n=s,f="{",r="";while(n<e.length){let l=e[n];if(l==="\\"){n+=2;continue}if(l==='"'||l==="'"){n=E(e,n),f=o,r="";continue}if(l==="`"){n=k(e,n),f=o,r="";continue}if(l==="/"&&e[n+1]==="/"){while(n<e.length&&e[n]!==`
3
3
  `)n++;continue}if(l==="/"&&e[n+1]==="*"){n+=2;while(n<e.length&&e.slice(n,n+2)!=="*/")n++;n+=2;continue}if(l==="/"&&b(f,r)){let h=m(e,n);if(h!==-1){n=h,f=o,r="";continue}}if(l==="{")i++;else if(l==="}"){if(i--,i===0)return n}if(/[\w$]/.test(l))r=/[\w$]/.test(f)?r+l:l,f=l;else if(!/\s/.test(l))f=l,r="";n++}return e.length}var L=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function b(e,s){if(s)return L.has(s);return!(e===")"||e==="]"||e===o)}var o="\x00";function m(e,s){let i=s+1,n=!1;while(i<e.length){let f=e[i];if(f===`
4
4
  `)return-1;if(f==="\\"){i+=2;continue}if(f==="[")n=!0;else if(f==="]")n=!1;else if(f==="/"&&!n){i++;while(i<e.length&&/[a-z]/i.test(e[i]))i++;return i}i++}return-1}function t(e){return p(e,!1)}function Kn(e){return p(e,!0)}function p(e,s){let i="",n=0,f=/[\w$]+|\s+|[^\w$\s]/g,r="",l="";while(n<e.length){f.lastIndex=n;let h=f.exec(e)[0];if(h.length>1||/[\w$\s]/.test(h)){if(i+=h,n+=h.length,!/\s/.test(h[0]))l=/[\w$]/.test(r)?l+h:h,r=h[h.length-1];continue}let a=h;if(a==="/"&&e[n+1]==="/"){let u=e.indexOf(`
5
- `,n),g=u===-1?e.length:u;i+=" ".repeat(g-n),n=g;continue}if(a==="/"&&e[n+1]==="*"){let u=e.indexOf("*/",n),g=u===-1?e.length:u;i+=x(e.slice(n,g)),n=g,i+=" ",n+=2;continue}if(a==='"'||a==="'"){let u=a;i+=" ",n++;let g=u==='"'?/["\\]/g:/['\\]/g;while(n<e.length&&e[n]!==u){if(e[n]==="\\"){i+=" ",n+=2;continue}g.lastIndex=n;let c=g.exec(e)?.index??e.length;i+=x(e.slice(n,c)),n=c}i+=s?"$":" ",n++,r=o,l="";continue}if(a==="/"&&b(r,l)){let u=m(e,n);if(u!==-1){i+=`/${" ".repeat(u-n-2)}/`,n=u,r=o,l="";continue}}if(a==="`"){i+=s?"(":" ",n++;let u=/[\\`$]/g;while(n<e.length&&e[n]!=="`"){if(e[n]==="\\"){i+=" ",n+=2;continue}if(e[n]==="$"&&e[n+1]==="{"){let c=n+2,w=Kl(e,c);if(i+=s?" {":" ",i+=p(e.slice(c,w),s),w<e.length)i+=s?"}":" ";n=w+1;continue}let g=n;n++,u.lastIndex=n,n=u.exec(e)?.index??e.length,i+=x(e.slice(g,n))}i+=s?")":" ",n++,r=o,l="";continue}i+=a,n++,r=a,l=""}return i}function x(e){return e.includes(`
5
+ `,n),g=u===-1?e.length:u;i+=" ".repeat(g-n),n=g;continue}if(a==="/"&&e[n+1]==="*"){let u=e.indexOf("*/",n),g=u===-1?e.length:u;i+=x(e.slice(n,g)),n=g,i+=" ",n+=2;continue}if(a==='"'||a==="'"){let u=a;i+=" ",n++;let g=u==='"'?/["\\]/g:/['\\]/g;while(n<e.length&&e[n]!==u){if(e[n]==="\\"){i+=" ",n+=2;continue}g.lastIndex=n;let c=g.exec(e)?.index??e.length;i+=x(e.slice(n,c)),n=c}i+=s?"$":" ",n++,r=o,l="";continue}if(a==="/"&&b(r,l)){let u=m(e,n);if(u!==-1){i+=`/${" ".repeat(u-n-2)}/`,n=u,r=o,l="";continue}}if(a==="`"){i+=s?"(":" ",n++;let u=/[\\`$]/g;while(n<e.length&&e[n]!=="`"){if(e[n]==="\\"){i+=" ",n+=2;continue}if(e[n]==="$"&&e[n+1]==="{"){let c=n+2,w=Jl(e,c);if(i+=s?" {":" ",i+=p(e.slice(c,w),s),w<e.length)i+=s?"}":" ";n=w+1;continue}let g=n;n++,u.lastIndex=n,n=u.exec(e)?.index??e.length,i+=x(e.slice(g,n))}i+=s?")":" ",n++,r=o,l="";continue}i+=a,n++,r=a,l=""}return i}function x(e){return e.includes(`
6
6
  `)?e.replace(/[^\n]/g," "):" ".repeat(e.length)}function y(e){let s=new Uint16Array(e.length),i=0,n=!0;for(let f=0;f<e.length;f++){let r=e[f];if(r===")"||r==="]"||r==="}")if(i===0)n=!1;else i--;if(s[f]=i,r==="("||r==="["||r==="{")i++}return{depths:s,balanced:n&&i===0}}
7
- export{Kl,t,Kn,y};
7
+ export{Jl,t,Kn,y};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ig,ag,Re,cg,Mc,bn,wn,dy,Dc,vn,vr,lg,ug,dg,Ts,pg,fg,Lc,xn,gg,Sn,jc,py}from"./chunk-sgppgy5e.js";import"./chunk-78j6c3sf.js";import"./chunk-s1x2pc9b.js";import"./chunk-w81a1e14.js";import"./chunk-w27j0apm.js";import"./chunk-sk8x8nw8.js";import"./chunk-c3nmjx26.js";import"./chunk-ag07tdhn.js";import"./chunk-f8sh6289.js";import"./chunk-t4exh7c9.js";import"./chunk-xdprx6tx.js";import"./chunk-yfe380a4.js";import"./chunk-875wejw1.js";import"./chunk-r7zvrh58.js";import"./chunk-ayrd026n.js";import"./chunk-ra35ptjg.js";import"./chunk-a78k8fkg.js";import"./chunk-4jg8ddfy.js";export{vr as MODULE_SPECIFIER_PREFIX,Lc as assertBundleBuildCanSettle,ig as bundleCacheDir,ag as bundleCacheEntryLimit,py as bundleClientEntriesSplit,Sn as bundleClientScript,wn as clearBundleFailures,Re as clientBundleDependencies,bn as getBundleFailures,vn as hasUserImports,fg as isWithinBundlerCallback,xn as moduleSubstitutionKey,ug as normalizeRegistrySpecifiers,gg as queueClientBundleBuild,Mc as recordBundleFailure,lg as registryIdForPath,Dc as resolveBundlerFallback,dg as rewriteRegistryImports,dy as setBundlerFallbackMode,cg as shouldLogBundlerDiagnostics,jc as tempBuildName,Ts as withModuleSubstitutes,pg as withinBundlerCallback};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
2
  var f=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),b=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);function l(i){return i.replace(/[^\n]/g," ")}function w(i){let o=i.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,l).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,l).replace(/<!--[\s\S]*?-->/g,l).replace(/\{\{\{[\s\S]*?\}\}\}/g,l).replace(/\{\{[\s\S]*?\}\}/g,l).replace(/\{!![\s\S]*?!!\}/g,l),s=new Map,r=new Map,p=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,t;while((t=p.exec(o))!==null){let e=t[1]==="/",n=t[2],a=t[3]==="/";if(f.has(n.toLowerCase()))continue;if(a)continue;if(e)r.set(n,(r.get(n)??0)+1);else{let g=s.get(n);if(g)g.count++;else{let d=o.slice(0,t.index).split(`
3
- `).length;s.set(n,{count:1,firstLine:d})}}}let c=[];for(let e of new Set([...s.keys(),...r.keys()])){if(b.has(e.toLowerCase()))continue;let n=s.get(e)?.count??0,a=r.get(e)??0;if(n!==a)c.push({tag:e,opened:n,closed:a,firstOpenLine:s.get(e)?.firstLine??0})}return c}var u=new Set;function ci(i,o){let s;try{s=w(i)}catch{return}if(s.length===0)return;let r=`${o}:${i.length}`;if(u.has(r))return;u.add(r);let p=o?o.split(/[/\\]/).pop()||o:"template";for(let{tag:t,opened:c,closed:e,firstOpenLine:n}of s)if(c>e){let a=n?` (first opened at line ${n})`:"";console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 an unclosed <${t}>${a} may swallow the content that follows it.`)}else console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 ${e-c} stray </${t}>.`)}
4
- export{ci};
3
+ `).length;s.set(n,{count:1,firstLine:d})}}}let c=[];for(let e of new Set([...s.keys(),...r.keys()])){if(b.has(e.toLowerCase()))continue;let n=s.get(e)?.count??0,a=r.get(e)??0;if(n!==a)c.push({tag:e,opened:n,closed:a,firstOpenLine:s.get(e)?.firstLine??0})}return c}var u=new Set;function ui(i,o){let s;try{s=w(i)}catch{return}if(s.length===0)return;let r=`${o}:${i.length}`;if(u.has(r))return;u.add(r);let p=o?o.split(/[/\\]/).pop()||o:"template";for(let{tag:t,opened:c,closed:e,firstOpenLine:n}of s)if(c>e){let a=n?` (first opened at line ${n})`:"";console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 an unclosed <${t}>${a} may swallow the content that follows it.`)}else console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 ${e-c} stray </${t}>.`)}
4
+ export{ui};
@@ -2,5 +2,5 @@
2
2
  import o from"fs";import u from"path";var h={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"};function p(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];r=(r<<5)-r+n,r=r&r}return Math.abs(r).toString(16).padStart(8,"0")}function x(e,r){let t=u.basename(e);for(let n of r)if(n.startsWith("*.")){let i=n.slice(1);if(t.endsWith(i))return!0}else if(n.includes("*")){let i=new RegExp(`^${n.replace(/\*/g,".*")}$`);if(i.test(t)||i.test(e))return!0}else if(t===n||e.includes(n))return!0;return!1}function S(e,r,t){let n=u.extname(e).toLowerCase(),i=h[n],c=(t.maxFileSizeKB||500)*1024;if(r>c)return!1;if(t.exclude&&x(e,t.exclude))return!1;if(t.include&&t.include.length>0){for(let s of t.include)if(s.startsWith("*.")){if(e.endsWith(s.slice(1)))return!0}else if(e.includes(s))return!0}if(i&&t[i]===!0)return!0;if(!i)return!1;return!1}function f(e,r,t,n){let i=o.readdirSync(e,{withFileTypes:!0});for(let c of i){let s=u.join(e,c.name);if(c.isDirectory()){if(["node_modules",".git",".stx"].includes(c.name))continue;f(s,r,t,n)}else if(c.isFile()){let a=o.statSync(s),l=u.relative(r,s);if(S(l,a.size,t)){let d=o.readFileSync(s),g=p(d),m=`/${l.replace(/\\/g,"/")}`;n.push({url:m,revision:g,size:a.size})}}}}function ot(e,r){let t=r.pwa?.precache,n=[];if(!t?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!o.existsSync(e))return{entries:[],totalSize:0,fileCount:0};f(e,e,t,n),n.sort((c,s)=>c.url.localeCompare(s.url));let i=n.reduce((c,s)=>c+s.size,0);return{entries:n,totalSize:i,fileCount:n.length}}function Xn(e){if(e.entries.length===0)return"[]";return`[
3
3
  ${e.entries.map((t)=>` { url: '${t.url}', revision: '${t.revision}' }`).join(`,
4
4
  `)}
5
- ]`}function ua(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;return`${(e/1048576).toFixed(2)} MB`}
6
- export{ot,Xn,ua};
5
+ ]`}function pa(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;return`${(e/1048576).toFixed(2)} MB`}
6
+ export{ot,Xn,pa};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ko,Yh,Zh}from"./chunk-sk7pptzf.js";import"./chunk-sgppgy5e.js";import"./chunk-78j6c3sf.js";import"./chunk-s1x2pc9b.js";import"./chunk-xnvh4jk2.js";import"./chunk-nkgqhb7s.js";import"./chunk-7767n5k6.js";import"./chunk-w81a1e14.js";import"./chunk-w27j0apm.js";import"./chunk-sk8x8nw8.js";import"./chunk-c3nmjx26.js";import"./chunk-ag07tdhn.js";import"./chunk-f8sh6289.js";import"./chunk-t4exh7c9.js";import"./chunk-xdprx6tx.js";import"./chunk-yfe380a4.js";import"./chunk-875wejw1.js";import"./chunk-r7zvrh58.js";import"./chunk-ayrd026n.js";import"./chunk-ra35ptjg.js";import"./chunk-a78k8fkg.js";import"./chunk-4jg8ddfy.js";export{Zh as clearComposableCache,Yh as getComposableScript,Ko as listComposableModules};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{b,w,m}from"./chunk-vb609vbj.js";import{q}from"./chunk-3tcy9r6r.js";import{i}from"./chunk-sbr3wg75.js";import k from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,n;O.lastIndex=0;while((n=O.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let s=n[1],r=n[2];t.push({type:"suspense",name:s,content:r}),o=n.index+n[0].length}if(o<e.length){let s=e.slice(o);if(s.trim())t.push({type:t.length===0?"shell":"content",content:s})}if(t.length===0)t.push({type:"shell",content:e});return t}async function vh(e,t={},o={}){let n={...q,...o,streaming:{...M,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),h=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),p=h?h[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),f={...t,__filename:e,__dirname:k.dirname(e)};if(p.trim())await b(p,f,e);let E=z(c),l=new Set;if(!E.some((y)=>y.type==="suspense")){let y=n.streaming?.strategy||"auto",S=new RegExp(T.source,"g");if(!(y!=="manual"&&S.test(c))){let u=await i(c,f,e,n,l);for(let x=0;x<u.length;x+=s)r.enqueue(u.slice(x,x+s)),await new Promise((g)=>setTimeout(g,0))}else{let u=[],x=new RegExp(T.source,"g"),g;while((g=x.exec(c))!==null)u.push({name:g[1],content:g[2],start:g.index,end:g.index+g[0].length});let v=0;for(let _ of u){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let D=await i(I,f,e,n,l);r.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let C=await i(_.content,f,e,n,l);r.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await i(_,f,e,n,l);r.enqueue(C)}}}}else{let y=new Map;for(let d of E)if(d.type==="shell"||d.type==="content"){let u=await i(d.content,f,e,n,l);r.enqueue(u)}else if(d.type==="suspense"&&d.name){let u=`stx-suspense-${d.name}`;r.enqueue(`<div id="${u}" data-suspense="${d.name}" style="display:contents;">
2
+ import{b,w,m}from"./chunk-xdprx6tx.js";import{K}from"./chunk-w27j0apm.js";import{i}from"./chunk-hx6tr46s.js";import k from"path";var q={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var M=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function H(e){let t=[],o=0,n;M.lastIndex=0;while((n=M.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let s=n[1],r=n[2];t.push({type:"suspense",name:s,content:r}),o=n.index+n[0].length}if(o<e.length){let s=e.slice(o);if(s.trim())t.push({type:t.length===0?"shell":"content",content:s})}if(t.length===0)t.push({type:"shell",content:e});return t}async function Sh(e,t={},o={}){let n={...K,...o,streaming:{...q,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),h=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),p=h?h[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),f={...t,__filename:e,__dirname:k.dirname(e)};if(p.trim())await b(p,f,e);let E=H(c),l=new Set;if(!E.some((y)=>y.type==="suspense")){let y=n.streaming?.strategy||"auto",S=new RegExp(T.source,"g");if(!(y!=="manual"&&S.test(c))){let u=await i(c,f,e,n,l);for(let x=0;x<u.length;x+=s)r.enqueue(u.slice(x,x+s)),await new Promise((g)=>setTimeout(g,0))}else{let u=[],x=new RegExp(T.source,"g"),g;while((g=x.exec(c))!==null)u.push({name:g[1],content:g[2],start:g.index,end:g.index+g[0].length});let v=0;for(let _ of u){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let O=await i(I,f,e,n,l);r.enqueue(O),await new Promise((D)=>setTimeout(D,0))}}let C=await i(_.content,f,e,n,l);r.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await i(_,f,e,n,l);r.enqueue(C)}}}}else{let y=new Map;for(let d of E)if(d.type==="shell"||d.type==="content"){let u=await i(d.content,f,e,n,l);r.enqueue(u)}else if(d.type==="suspense"&&d.name){let u=`stx-suspense-${d.name}`;r.enqueue(`<div id="${u}" data-suspense="${d.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
4
  </div>`),y.set(d.name,i(d.content,f,e,n,l))}r.enqueue(`
5
5
  <script>
@@ -17,13 +17,13 @@ import{b,w,m}from"./chunk-vb609vbj.js";import{q}from"./chunk-3tcy9r6r.js";import
17
17
  }
18
18
  };
19
19
  })();
20
- </script>`);let S=Array.from(y.entries()).map(async([d,u])=>{r.enqueue(await Ga(d,u))});await Promise.all(S)}r.close()}catch(a){r.error(a)}}})}async function Ga(e,t){try{let n=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
20
+ </script>`);let S=Array.from(y.entries()).map(async([d,u])=>{r.enqueue(await Ya(d,u))});await Promise.all(S)}r.close()}catch(a){r.error(a)}}})}async function Ya(e,t){try{let n=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
21
21
  <script>
22
22
  window.__stxSuspense.resolve('${e}', \`${n}\`);
23
23
  </script>`}catch(o){let n=o instanceof Error?o.message:String(o);return`
24
24
  <script>
25
25
  window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading content: ${m(n)}</div>');
26
- </script>`}}var Xu=`
26
+ </script>`}}var Ju=`
27
27
  <script>
28
28
  (function(){
29
29
  window.__stxSuspense = window.__stxSuspense || {
@@ -43,12 +43,12 @@ window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading conte
43
43
  }
44
44
  };
45
45
  })();
46
- </script>`;function A(e,t,o){if(!t||t<=0)return e;let n,s=new Promise((r,a)=>{n=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,s]).finally(()=>clearTimeout(n))}function xh(e,t=[],o={}){let n=o.timeoutMs??0;return new ReadableStream({async start(s){try{if(s.enqueue(e),t.length>0)s.enqueue(Xu),await Promise.all(t.map(async(r)=>{let a=A(r.render(),n,r.id);s.enqueue(await Ga(r.id,a))}));s.close()}catch(r){s.error(r)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function Sh(e,t){return e.replace(B,(o,n,s)=>{let r=n.trim(),a=s.split(/@fallback/i),h=a[0].trim(),p=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[r]=h,`<div data-suspense="${r}">${p}</div>`})}function kh(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,n])=>typeof n==="function");return o.length>0?o.map(([n,s])=>({id:n,render:s})):void 0}async function _h(e,t={},o={}){let n={...q,...o,streaming:{...M,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),h=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),p=h?h[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),f={...t,__filename:e,__dirname:k.dirname(e)};if(p.trim())await b(p,f,e);let E=new Set,l=n.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(l!=="manual"&&R.test(c))){let S=await i(c,f,e,n,E);for(let d=0;d<S.length;d+=s)r.enqueue(S.slice(d,d+s))}else{let S=[],d=new RegExp(T.source,"g"),u;while((u=d.exec(c))!==null)S.push({name:u[1],content:u[2],start:u.index,end:u.index+u[0].length});let x=0;for(let g of S){if(g.start>x){let _=c.slice(x,g.start);if(_.trim()){let C=await i(_,f,e,n,E);r.enqueue(C)}}let v=await i(g.content,f,e,n,E);r.enqueue(v),x=g.end}if(x<c.length){let g=c.slice(x);if(g.trim()){let v=await i(g,f,e,n,E);r.enqueue(v)}}}r.close()}catch(a){r.error(a)}}})}async function Ch(e,t={}){let o={...q,...t,streaming:{...M,...t.streaming}},n=await Bun.file(e).text(),s=n.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),r=s?s[1]:"",a=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),h=a,p={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let l=c[1],R=c[2];p[l]=R}let f=a.replace(T,"");return{renderShell:async(l={})=>{let R={...l,__filename:e,__dirname:k.dirname(e)};return await b(r,R,e),i(f,R,e,o,new Set)},renderSection:async(l,R={})=>{try{if(!p[l])return`<div class="error-message">Section "${m(l)}" not found in template "${m(e)}"</div>`;let y={...R,__filename:e,__dirname:k.dirname(e)};await b(r,y,e);let S=new Set;return await i(p[l],y,e,o,S)}catch(y){let S=y instanceof Error?y.message:String(y);return w("Expression",S,e,p[l]||"",0,p[l]||"")}},getSections:()=>Object.keys(p),getTemplate:()=>h}}var Gu={name:"suspense",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let s=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${s} -->${e}<!-- @endsuspense:${s} -->`}},Ju={name:"island",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let s=t[0].replace(/['"`]/g,""),r=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${s}-${Math.random().toString(36).substring(2,9)}`,h=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),p=h?h[1].trim():"",c=h?e.replace(h[0],""):e;return`<div data-island="${s}" data-island-id="${a}" data-priority="${r}">
46
+ </script>`;function z(e,t,o){if(!t||t<=0)return e;let n,s=new Promise((r,a)=>{n=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,s]).finally(()=>clearTimeout(n))}function kh(e,t=[],o={}){let n=o.timeoutMs??0;return new ReadableStream({async start(s){try{if(s.enqueue(e),t.length>0)s.enqueue(Ju),await Promise.all(t.map(async(r)=>{let a=z(r.render(),n,r.id);s.enqueue(await Ya(r.id,a))}));s.close()}catch(r){s.error(r)}}})}var A=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function _h(e,t){return e.replace(A,(o,n,s)=>{let r=n.trim(),a=s.split(/@fallback/i),h=a[0].trim(),p=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[r]=h,`<div data-suspense="${r}">${p}</div>`})}function Ch(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,n])=>typeof n==="function");return o.length>0?o.map(([n,s])=>({id:n,render:s})):void 0}async function Eh(e,t={},o={}){let n={...K,...o,streaming:{...q,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),h=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),p=h?h[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),f={...t,__filename:e,__dirname:k.dirname(e)};if(p.trim())await b(p,f,e);let E=new Set,l=n.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(l!=="manual"&&R.test(c))){let S=await i(c,f,e,n,E);for(let d=0;d<S.length;d+=s)r.enqueue(S.slice(d,d+s))}else{let S=[],d=new RegExp(T.source,"g"),u;while((u=d.exec(c))!==null)S.push({name:u[1],content:u[2],start:u.index,end:u.index+u[0].length});let x=0;for(let g of S){if(g.start>x){let _=c.slice(x,g.start);if(_.trim()){let C=await i(_,f,e,n,E);r.enqueue(C)}}let v=await i(g.content,f,e,n,E);r.enqueue(v),x=g.end}if(x<c.length){let g=c.slice(x);if(g.trim()){let v=await i(g,f,e,n,E);r.enqueue(v)}}}r.close()}catch(a){r.error(a)}}})}async function Th(e,t={}){let o={...K,...t,streaming:{...q,...t.streaming}},n=await Bun.file(e).text(),s=n.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),r=s?s[1]:"",a=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),h=a,p={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let l=c[1],R=c[2];p[l]=R}let f=a.replace(T,"");return{renderShell:async(l={})=>{let R={...l,__filename:e,__dirname:k.dirname(e)};return await b(r,R,e),i(f,R,e,o,new Set)},renderSection:async(l,R={})=>{try{if(!p[l])return`<div class="error-message">Section "${m(l)}" not found in template "${m(e)}"</div>`;let y={...R,__filename:e,__dirname:k.dirname(e)};await b(r,y,e);let S=new Set;return await i(p[l],y,e,o,S)}catch(y){let S=y instanceof Error?y.message:String(y);return w("Expression",S,e,p[l]||"",0,p[l]||"")}},getSections:()=>Object.keys(p),getTemplate:()=>h}}var Yu={name:"suspense",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let s=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${s} -->${e}<!-- @endsuspense:${s} -->`}},Zu={name:"island",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let s=t[0].replace(/['"`]/g,""),r=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${s}-${Math.random().toString(36).substring(2,9)}`,h=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),p=h?h[1].trim():"",c=h?e.replace(h[0],""):e;return`<div data-island="${s}" data-island-id="${a}" data-priority="${r}">
47
47
  ${c}
48
48
  <script type="application/json" data-island-props="${a}">
49
49
  ${p?`{${p}}`:"{}"}
50
50
  </script>
51
- </div>`}};function Eh(e={}){let t=[];if(e.streaming?.enabled)t.push(Gu);if(e.hydration?.enabled)t.push(Ju);return t}async function Th(e,t,o,n={}){return e}function $h(e,t={}){let o=new TextEncoder,n=e.pipeThrough(new TransformStream({transform(r,a){a.enqueue(o.encode(r))}})),s=new Headers(t.headers);if(!s.has("Content-Type"))s.set("Content-Type","text/html; charset=utf-8");if(!s.has("Transfer-Encoding"))s.set("Transfer-Encoding","chunked");if(!s.has("X-Content-Type-Options"))s.set("X-Content-Type-Options","nosniff");if(!s.has("X-Accel-Buffering"))s.set("X-Accel-Buffering","no");return new Response(n,{...t,headers:s})}function Rh(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:n=!0}=e,s=Object.entries(o).map(([r,a])=>`'${r}': ${n?`() => import('${a}')`:`require('${a}')`}`).join(`,
51
+ </div>`}};function $h(e={}){let t=[];if(e.streaming?.enabled)t.push(Yu);if(e.hydration?.enabled)t.push(Zu);return t}async function Rh(e,t,o,n={}){return e}function Ah(e,t={}){let o=new TextEncoder,n=e.pipeThrough(new TransformStream({transform(r,a){a.enqueue(o.encode(r))}})),s=new Headers(t.headers);if(!s.has("Content-Type"))s.set("Content-Type","text/html; charset=utf-8");if(!s.has("Transfer-Encoding"))s.set("Transfer-Encoding","chunked");if(!s.has("X-Content-Type-Options"))s.set("X-Content-Type-Options","nosniff");if(!s.has("X-Accel-Buffering"))s.set("X-Accel-Buffering","no");return new Response(n,{...t,headers:s})}function Ph(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:n=!0}=e,s=Object.entries(o).map(([r,a])=>`'${r}': ${n?`() => import('${a}')`:`require('${a}')`}`).join(`,
52
52
  `);if(t==="loader")return`
53
53
  (function() {
54
54
  window.__stx = window.__stx || {};
@@ -191,4 +191,4 @@ else {
191
191
  stx.hydrate();
192
192
  }
193
193
  })();`}
194
- export{vh,Ga,Xu,xh,Sh,kh,_h,Ch,Gu,Ju,Eh,Th,$h,Rh};
194
+ export{Sh,Ya,Ju,kh,_h,Ch,Eh,Th,Yu,Zu,$h,Rh,Ah,Ph};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var d=0;function l(){return`keep-alive-${++d}-${Date.now().toString(36)}`}function lh(e,t={},n){let i=/@keepAlive(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@endkeepAlive/gi;return e.replace(i,(a,c,o)=>{let s=l(),r=u(c||"");return p(s,o.trim(),r)})}function u(e){let t={max:10},n=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,i;while((i=n.exec(e))!==null){let a=i[1],c=i[2]||i[3],o=i[4];switch(a){case"max":t.max=o?parseInt(o,10):10;break;case"include":t.include=c;break;case"exclude":t.exclude=c;break;case"id":t.id=c;break}}return t}function p(e,t,n){let{max:i,include:a,exclude:c}=n,o=n.id||e;return`
2
+ var d=0;function l(){return`keep-alive-${++d}-${Date.now().toString(36)}`}function dh(e,t={},n){let i=/@keepAlive(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@endkeepAlive/gi;return e.replace(i,(a,c,o)=>{let s=l(),r=u(c||"");return p(s,o.trim(),r)})}function u(e){let t={max:10},n=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,i;while((i=n.exec(e))!==null){let a=i[1],c=i[2]||i[3],o=i[4];switch(a){case"max":t.max=o?parseInt(o,10):10;break;case"include":t.include=c;break;case"exclude":t.exclude=c;break;case"id":t.id=c;break}}return t}function p(e,t,n){let{max:i,include:a,exclude:c}=n,o=n.id||e;return`
3
3
  <div class="stx-keep-alive" data-keep-alive-id="${e}" data-custom-id="${o}">
4
4
  <div class="stx-keep-alive-content" data-keep-alive-content="${e}">
5
5
  ${t}
@@ -286,7 +286,7 @@ else {
286
286
  });
287
287
  })();
288
288
  </script>
289
- `}function uh(e={}){return{id:e.id||l(),cache:new Map,max:e.max||10,include:e.include?e.include.split(",").map((n)=>n.trim()):null,exclude:e.exclude?e.exclude.split(",").map((n)=>n.trim()):null}}function dh(e,t){if(t.exclude&&t.exclude.includes(e))return!1;if(t.include&&!t.include.includes(e))return!1;return!0}function ph(){return`
289
+ `}function ph(e={}){return{id:e.id||l(),cache:new Map,max:e.max||10,include:e.include?e.include.split(",").map((n)=>n.trim()):null,exclude:e.exclude?e.exclude.split(",").map((n)=>n.trim()):null}}function fh(e,t){if(t.exclude&&t.exclude.includes(e))return!1;if(t.include&&!t.include.includes(e))return!1;return!0}function gh(){return`
290
290
  /* STX Keep-Alive Styles */
291
291
  .stx-keep-alive {
292
292
  position: relative;
@@ -311,7 +311,7 @@ else {
311
311
  .stx-keep-alive-content > [data-activated] {
312
312
  opacity: 1;
313
313
  }
314
- `}function fh(){return`
314
+ `}function mh(){return`
315
315
  // STX Keep-Alive Runtime
316
316
  (function() {
317
317
  if (typeof window === 'undefined') return;
@@ -347,5 +347,5 @@ else {
347
347
 
348
348
  console.log('[stx] Keep-alive runtime initialized');
349
349
  })();
350
- `}function gh(e){if(typeof document<"u")document.addEventListener("stx:activated",(t)=>{e(t.detail)})}function mh(e){if(typeof document<"u")document.addEventListener("stx:deactivated",(t)=>{e(t.detail)})}
351
- export{lh,uh,dh,ph,fh,gh,mh};
350
+ `}function hh(e){if(typeof document<"u")document.addEventListener("stx:activated",(t)=>{e(t.detail)})}function yh(e){if(typeof document<"u")document.addEventListener("stx:deactivated",(t)=>{e(t.detail)})}
351
+ export{dh,ph,fh,gh,mh,hh,yh};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{existsSync as g,statSync as p}from"fs";import e from"path";var w=/[*?[\]{}]/;function $g(o){return w.test(o)}async function ki(o,n={}){let i=n.cwd??process.cwd(),u=n.recursive!==!1,l=n.ignorePaths??[],c=globalThis.Bun.Glob,a=new Set,r=(t)=>{if(t.includes(`${e.sep}node_modules${e.sep}`)||t.includes(`${e.sep}dist${e.sep}`))return;if(l.some((s)=>s&&t.includes(e.normalize(s))))return;a.add(t)},d=async(t)=>{try{for await(let s of new c(t).scan({cwd:i,absolute:!0}))r(s)}catch{}};for(let t of o){if(!t)continue;if($g(t)){await d(t);continue}let s=e.resolve(i,t);if(!g(s))continue;if(p(s).isDirectory()){for await(let f of new c(u?"**/*.stx":"*.stx").scan({cwd:s,absolute:!0}))r(f);continue}r(s)}return[...a].sort()}
3
- export{$g,ki};
2
+ import{existsSync as g,statSync as p}from"fs";import e from"path";var w=/[*?[\]{}]/;function Ag(o){return w.test(o)}async function Ci(o,n={}){let i=n.cwd??process.cwd(),u=n.recursive!==!1,l=n.ignorePaths??[],c=globalThis.Bun.Glob,a=new Set,r=(t)=>{if(t.includes(`${e.sep}node_modules${e.sep}`)||t.includes(`${e.sep}dist${e.sep}`))return;if(l.some((s)=>s&&t.includes(e.normalize(s))))return;a.add(t)},d=async(t)=>{try{for await(let s of new c(t).scan({cwd:i,absolute:!0}))r(s)}catch{}};for(let t of o){if(!t)continue;if(Ag(t)){await d(t);continue}let s=e.resolve(i,t);if(!g(s))continue;if(p(s).isDirectory()){for await(let f of new c(u?"**/*.stx":"*.stx").scan({cwd:s,absolute:!0}))r(f);continue}r(s)}return[...a].sort()}
3
+ export{Ag,Ci};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ou,iu,au,lm,um}from"./chunk-p17jeqz0.js";export{iu as auditBuildOutput,ou as auditConfig,au as calculateAuditResult,um as formatAuditResult,lm as runPwaAudit};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as Ym}from"ts-broadcasting";import{Broadcast as Zm,BroadcastServer as Qm}from"ts-broadcasting";var e=null,u=[];function Um(){return e}async function Vm(n){if(e)return e;let t=n.driver??"bun",r=n.host??"0.0.0.0",c=n.port??6001,l=n.scheme??"ws",a={verbose:n.verbose??!1,driver:t,default:t,connections:{[t]:{driver:t,host:r,port:c,scheme:l}}};return e=new h(a),s.setServer(e),await e.start(),e}async function Wm(){for(let n of u)clearInterval(n);if(u.length=0,!e)return;await e.stop(),e=null}async function qm(n){let t=await import(n),r=t.default??t;if(typeof r!=="function")throw Error(`routes/channels.ts must export a default function, got ${typeof r}`);let c=0;return r({channel(a,o){if(c++,o.authorize&&e)e.channels.channel(a,o.authorize);if(o.interval&&o.data){let d=o.event??`${a}.updated`,p=o.data,v=setInterval(async()=>{try{let g=await p();ku(a,d,g)}catch{}},o.interval);u.push(v)}}}),c}var f=!1;function i(){if(e)return!0;if(!f)f=!0,console.warn("[stx] broadcast() called before server started \u2014 messages will be sent once broadcasting is ready");return!1}function ku(n,t,r){if(!i())return;s.send(n,t,r)}function Km(n,t,r){if(!i())return;s.toUser(n,t,r)}function Xm(n,t,r){if(!i())return;s.toUsers(n,t,r)}function Gm(n,t,r){if(!i())return;s.send(`private-${n}`,t,r)}function Jm(n,t,r){if(!i())return;s.presence(n,t,r)}
3
- export{Um,Vm,Wm,qm,ku,Km,Xm,Gm,Jm,Ym,Zm,Qm};
2
+ import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as Qm}from"ts-broadcasting";import{Broadcast as eh,BroadcastServer as th}from"ts-broadcasting";var e=null,u=[];function Wm(){return e}async function qm(n){if(e)return e;let t=n.driver??"bun",r=n.host??"0.0.0.0",c=n.port??6001,l=n.scheme??"ws",a={verbose:n.verbose??!1,driver:t,default:t,connections:{[t]:{driver:t,host:r,port:c,scheme:l}}};return e=new h(a),s.setServer(e),await e.start(),e}async function Km(){for(let n of u)clearInterval(n);if(u.length=0,!e)return;await e.stop(),e=null}async function Xm(n){let t=await import(n),r=t.default??t;if(typeof r!=="function")throw Error(`routes/channels.ts must export a default function, got ${typeof r}`);let c=0;return r({channel(a,o){if(c++,o.authorize&&e)e.channels.channel(a,o.authorize);if(o.interval&&o.data){let d=o.event??`${a}.updated`,p=o.data,v=setInterval(async()=>{try{let g=await p();Cu(a,d,g)}catch{}},o.interval);u.push(v)}}}),c}var f=!1;function i(){if(e)return!0;if(!f)f=!0,console.warn("[stx] broadcast() called before server started \u2014 messages will be sent once broadcasting is ready");return!1}function Cu(n,t,r){if(!i())return;s.send(n,t,r)}function Gm(n,t,r){if(!i())return;s.toUser(n,t,r)}function Jm(n,t,r){if(!i())return;s.toUsers(n,t,r)}function Ym(n,t,r){if(!i())return;s.send(`private-${n}`,t,r)}function Zm(n,t,r){if(!i())return;s.presence(n,t,r)}
3
+ export{Wm,qm,Km,Xm,Cu,Gm,Jm,Ym,Zm,Qm,eh,th};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Oh,Nh}from"./chunk-edjzm0vj.js";export{Nh as ensureTeleportTargets,Oh as processTeleportDirectives};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{gu,Om}from"./chunk-4f8h38xr.js";export{gu as captureScreenshot,Om as captureScreenshots};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ih}from"./chunk-wajvxzt0.js";export{Ih as processDeferDirectives};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{le,ue,de,tr,Te,ze,Rt,pn,nr,rr,sr,pe,or,ir}from"./chunk-1vsjmwr1.js";import{Dt}from"./chunk-p97h91zx.js";function fu(s,r={}){let{src:e,alt:t,width:n,height:a,sizes:i="100vw",loading:m="lazy",priority:o=!1,quality:u=de,placeholder:l="none",formats:f=ue,widths:y=le,decoding:c="async",fetchpriority:h,objectFit:d,objectPosition:g}=s,{class:p,style:v}=s,{processedImage:w,variants:I,optimize:b=!0,isDev:A=!1}=r;if(I&&I.length>0)return J(s,I,w);if(A||!b)return K(s);return Z(s)}function J(s,r,e){let{src:t,alt:n,width:a,height:i,sizes:m="100vw",loading:o="lazy",priority:u=!1,decoding:l="async",fetchpriority:f,objectFit:y,objectPosition:c,placeholder:h="none"}=s,{class:d,style:g}=s,p=rr(r),v=nr(r),w=typeof m==="object"?pn(m):m,I=e?e.aspectRatio:a&&i?Number(a)/Number(i):void 0,b=[];if(I)b.push(`aspect-ratio: ${I}`);if(y)b.push(`object-fit: ${y}`);if(c)b.push(`object-position: ${c}`);if(g)b.push(g);let A=b.length>0?` style="${b.join("; ")}"`:"",S=d?` class="${d}"`:"",F=u?"":` loading="${o}"`,R=` decoding="${l}"`,C=f?` fetchpriority="${f}"`:u?' fetchpriority="high"':"",E=["avif","webp","jpeg","png"],M=[];for(let k of E){let z=p.get(k);if(z&&z.length>0){let O=Rt(z),Y=pe(k);M.push(` <source type="${Y}" srcset="${O}" sizes="${w}" />`)}}let U="",L="",T;if(h!=="none"&&e?.placeholder){let k=`img-${Math.random().toString(36).slice(2,8)}`;if(U=`<div class="stx-image-wrapper" id="${k}">`,L="</div>",h==="blur")T=`
2
+ import{ue,de,pe,tr,$e,ze,Rt,pn,nr,rr,sr,fe,or,ir}from"./chunk-vn3hsx7v.js";import{Dt}from"./chunk-p97h91zx.js";function mu(s,r={}){let{src:e,alt:t,width:n,height:a,sizes:i="100vw",loading:m="lazy",priority:o=!1,quality:u=pe,placeholder:l="none",formats:f=de,widths:y=ue,decoding:c="async",fetchpriority:h,objectFit:d,objectPosition:g}=s,{class:p,style:v}=s,{processedImage:w,variants:I,optimize:b=!0,isDev:A=!1}=r;if(I&&I.length>0)return J(s,I,w);if(A||!b)return K(s);return Z(s)}function J(s,r,e){let{src:t,alt:n,width:a,height:i,sizes:m="100vw",loading:o="lazy",priority:u=!1,decoding:l="async",fetchpriority:f,objectFit:y,objectPosition:c,placeholder:h="none"}=s,{class:d,style:g}=s,p=rr(r),v=nr(r),w=typeof m==="object"?pn(m):m,I=e?e.aspectRatio:a&&i?Number(a)/Number(i):void 0,b=[];if(I)b.push(`aspect-ratio: ${I}`);if(y)b.push(`object-fit: ${y}`);if(c)b.push(`object-position: ${c}`);if(g)b.push(g);let A=b.length>0?` style="${b.join("; ")}"`:"",S=d?` class="${d}"`:"",F=u?"":` loading="${o}"`,R=` decoding="${l}"`,C=f?` fetchpriority="${f}"`:u?' fetchpriority="high"':"",E=["avif","webp","jpeg","png"],M=[];for(let k of E){let z=p.get(k);if(z&&z.length>0){let O=Rt(z),Y=fe(k);M.push(` <source type="${Y}" srcset="${O}" sizes="${w}" />`)}}let U="",L="",T;if(h!=="none"&&e?.placeholder){let k=`img-${Math.random().toString(36).slice(2,8)}`;if(U=`<div class="stx-image-wrapper" id="${k}">`,L="</div>",h==="blur")T=`
3
3
  #${k} {
4
4
  position: relative;
5
5
  background-image: url('${e.placeholder}');
@@ -23,14 +23,14 @@ ${M.join(`
23
23
  src="${v?.url||t}"
24
24
  alt="${B(n)}"${_}${H}${S}${A}${F}${R}${C}
25
25
  />
26
- </picture>${L}`,V;if(u&&v){let k=p.get("webp"),z=k?.[Math.floor(k.length/2)]||v,O=pe(z.format);V=`<link rel="preload" as="image" href="${z.url}" type="${O}" />`}return{html:Q,preloadLink:V,placeholderCss:T}}function K(s){let{src:r,alt:e,width:t,height:n,loading:a="lazy",decoding:i="async",priority:m=!1,fetchpriority:o,objectFit:u,objectPosition:l}=s,{class:f,style:y}=s,c=[];if(u)c.push(`object-fit: ${u}`);if(l)c.push(`object-position: ${l}`);if(y)c.push(y);let h=c.length>0?` style="${c.join("; ")}"`:"",d=f?` class="${f}"`:"",g=t?` width="${t}"`:"",p=n?` height="${n}"`:"",v=m?"":` loading="${a}"`,w=` decoding="${i}"`,I=o?` fetchpriority="${o}"`:m?' fetchpriority="high"':"";return{html:`<img src="${r}" alt="${B(e)}"${g}${p}${d}${h}${v}${w}${I} />`}}function Z(s){let{src:r,alt:e,width:t,height:n,sizes:a="100vw",loading:i="lazy",priority:m=!1,quality:o=de,formats:u=ue,widths:l=le,decoding:f="async",fetchpriority:y,objectFit:c,objectPosition:h}=s,{class:d,style:g}=s,p=[];if(c)p.push(`object-fit: ${c}`);if(h)p.push(`object-position: ${h}`);if(g)p.push(g);let v=p.length>0?` style="${p.join("; ")}"`:"",w=d?` class="${d}"`:"",I=t?` width="${t}"`:"",b=n?` height="${n}"`:"",A=m?"":` loading="${i}"`,S=` decoding="${f}"`,F=y?` fetchpriority="${y}"`:m?' fetchpriority="high"':"",R=typeof a==="object"?pn(a):a,C=`
26
+ </picture>${L}`,V;if(u&&v){let k=p.get("webp"),z=k?.[Math.floor(k.length/2)]||v,O=fe(z.format);V=`<link rel="preload" as="image" href="${z.url}" type="${O}" />`}return{html:Q,preloadLink:V,placeholderCss:T}}function K(s){let{src:r,alt:e,width:t,height:n,loading:a="lazy",decoding:i="async",priority:m=!1,fetchpriority:o,objectFit:u,objectPosition:l}=s,{class:f,style:y}=s,c=[];if(u)c.push(`object-fit: ${u}`);if(l)c.push(`object-position: ${l}`);if(y)c.push(y);let h=c.length>0?` style="${c.join("; ")}"`:"",d=f?` class="${f}"`:"",g=t?` width="${t}"`:"",p=n?` height="${n}"`:"",v=m?"":` loading="${a}"`,w=` decoding="${i}"`,I=o?` fetchpriority="${o}"`:m?' fetchpriority="high"':"";return{html:`<img src="${r}" alt="${B(e)}"${g}${p}${d}${h}${v}${w}${I} />`}}function Z(s){let{src:r,alt:e,width:t,height:n,sizes:a="100vw",loading:i="lazy",priority:m=!1,quality:o=pe,formats:u=de,widths:l=ue,decoding:f="async",fetchpriority:y,objectFit:c,objectPosition:h}=s,{class:d,style:g}=s,p=[];if(c)p.push(`object-fit: ${c}`);if(h)p.push(`object-position: ${h}`);if(g)p.push(g);let v=p.length>0?` style="${p.join("; ")}"`:"",w=d?` class="${d}"`:"",I=t?` width="${t}"`:"",b=n?` height="${n}"`:"",A=m?"":` loading="${i}"`,S=` decoding="${f}"`,F=y?` fetchpriority="${y}"`:m?' fetchpriority="high"':"",R=typeof a==="object"?pn(a):a,C=`
27
27
  data-stx-image
28
28
  data-src="${r}"
29
29
  data-sizes="${R}"
30
30
  data-quality="${o}"
31
31
  data-formats="${u.join(",")}"
32
32
  data-widths="${l.join(",")}"
33
- `.replace(/\s+/g," ").trim();return{html:`<img src="${r}" alt="${B(e)}"${I}${b}${w}${v}${A}${S}${F} ${C} />`}}function Na(s){let r=s.match(/<Image\s+([^>]*?)\/?>/);if(!r)return null;let e=r[1],t={},n=/(\w+)(?:=(?:"([^"]*)"|'([^']*)'|(\{[^}]+\})))?/g,a;while((a=n.exec(e))!==null){let[,i,m,o,u]=a,l=m??o??u??!0;switch(i){case"src":t.src=String(l);break;case"alt":t.alt=String(l);break;case"width":t.width=Number(l)||l;break;case"height":t.height=Number(l)||l;break;case"sizes":t.sizes=String(l);break;case"loading":t.loading=l;break;case"priority":t.priority=l===!0||l==="true";break;case"quality":t.quality=Number(l);break;case"placeholder":t.placeholder=l;break;case"class":t.class=String(l);break;case"style":t.style=String(l);break;case"decoding":t.decoding=l;break;case"fetchpriority":t.fetchpriority=l;break;case"objectFit":t.objectFit=l;break;case"objectPosition":t.objectPosition=String(l);break}}if(!t.src||!t.alt)return null;return t}async function gu(s,r){let e=/<Image\s+[^>]*?\/?>/g,t=[],n=[],a=s,i,m=[];while((i=e.exec(s))!==null)m.push({match:i[0],index:i.index});for(let o=m.length-1;o>=0;o--){let{match:u}=m[o],l=Na(u);if(l){let f=await r(l);if(a=a.replace(u,f.html),f.preloadLink)t.push(f.preloadLink);if(f.placeholderCss)n.push(f.placeholderCss)}}return{html:a,preloadLinks:t,styles:n}}function B(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}var D=new Map;function mu(){D.clear()}async function G(s,r){let e=`${s}:${JSON.stringify(r)}`;if(D.has(e))return D.get(e);try{let t=await ze(s,r);return D.set(e,t),t}catch{return null}}function Ma(){return Dt({name:"image",hasEndTag:!1,description:"Render an optimized image with responsive variants",transform:async(s,r,e)=>{let{src:t,alt:n,options:a}=X(s,r,e);if(!t)return console.warn("@image directive: missing src argument"),"<!-- @image: missing src -->";let i={widths:a.widths||(a.width?[a.width]:le),formats:a.formats||ue,quality:a.quality||de,placeholder:(a.placeholder==="color"?"dominant-color":a.placeholder)||"none"};if(!await Te())return q(t,n||"",a);let o=await G(t,i);if(!o)return q(t,n||"",a);return te(o,n||"",a)}})}function X(s,r,e){if(r.src)return{src:String(r.src),alt:String(r.alt||""),options:r.options||{}};let n=s.trim();if(n.startsWith("@image(")||n.startsWith("("))n=n.replace(/^@image\(/,"").replace(/^\(/,"").replace(/\)$/,"");let a=ee(n),i=a[0]||"",m=a[1]||"",o={};if(i&&!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")){let u=e[i];if(typeof u==="string")i=u}if(a[2])try{if(typeof a[2]==="string")o=JSON.parse(a[2]);else o=a[2]}catch{}return{src:i,alt:m,options:o}}function ee(s){let r=[],e="",t=!1,n="",a=0,i=0;for(let m=0;m<s.length;m++){let o=s[m],u=m>0?s[m-1]:"";if((o==='"'||o==="'")&&u!=="\\"){if(!t)t=!0,n=o;else if(o===n)t=!1,n="";else e+=o;continue}if(!t){if(o==="{")a++;if(o==="}")a--;if(o==="[")i++;if(o==="]")i--;if(o===","&&a===0&&i===0){r.push(e.trim()),e="";continue}}e+=o}if(e.trim())r.push(e.trim());return r}function q(s,r,e){let t=[`src="${x(s)}"`];if(r)t.push(`alt="${x(r)}"`);if(e.width)t.push(`width="${e.width}"`);if(e.height)t.push(`height="${e.height}"`);if(e.class)t.push(`class="${x(e.class)}"`);if(e.style)t.push(`style="${x(e.style)}"`);if(e.lazy!==!1)t.push('loading="lazy"');return t.push('decoding="async"'),`<img ${t.join(" ")} />`}function te(s,r,e){let{variants:t,placeholder:n,width:a,height:i,aspectRatio:m}=s,o=new Map;for(let g of t){let p=o.get(g.format)||[];p.push(g),o.set(g.format,p)}let u=["avif","webp","jpeg","png"],l=[];for(let g of u){let p=o.get(g);if(p&&p.length>0){let v=Rt(p),w=pe(g),I=e.sizes||"100vw";l.push(` <source type="${w}" srcset="${x(v)}" sizes="${x(I)}" />`)}}let f=o.get("jpeg")||[],y=f.length>0?f[Math.floor(f.length/2)]:t[Math.floor(t.length/2)],c=[`src="${y?.url||s.src}"`,`alt="${x(r)}"`];if(e.width||a)c.push(`width="${e.width||a}"`);if(e.height||i)c.push(`height="${e.height||i}"`);if(e.class)c.push(`class="${x(e.class)}"`);let h=[];if(m)h.push(`aspect-ratio: ${m.toFixed(4)}`);if(e.style)h.push(e.style);if(h.length>0)c.push(`style="${h.join("; ")}"`);if(e.lazy!==!1&&!e.priority)c.push('loading="lazy"');if(c.push('decoding="async"'),e.priority)c.push('fetchpriority="high"');let d=`<picture>
33
+ `.replace(/\s+/g," ").trim();return{html:`<img src="${r}" alt="${B(e)}"${I}${b}${w}${v}${A}${S}${F} ${C} />`}}function Da(s){let r=s.match(/<Image\s+([^>]*?)\/?>/);if(!r)return null;let e=r[1],t={},n=/(\w+)(?:=(?:"([^"]*)"|'([^']*)'|(\{[^}]+\})))?/g,a;while((a=n.exec(e))!==null){let[,i,m,o,u]=a,l=m??o??u??!0;switch(i){case"src":t.src=String(l);break;case"alt":t.alt=String(l);break;case"width":t.width=Number(l)||l;break;case"height":t.height=Number(l)||l;break;case"sizes":t.sizes=String(l);break;case"loading":t.loading=l;break;case"priority":t.priority=l===!0||l==="true";break;case"quality":t.quality=Number(l);break;case"placeholder":t.placeholder=l;break;case"class":t.class=String(l);break;case"style":t.style=String(l);break;case"decoding":t.decoding=l;break;case"fetchpriority":t.fetchpriority=l;break;case"objectFit":t.objectFit=l;break;case"objectPosition":t.objectPosition=String(l);break}}if(!t.src||!t.alt)return null;return t}async function hu(s,r){let e=/<Image\s+[^>]*?\/?>/g,t=[],n=[],a=s,i,m=[];while((i=e.exec(s))!==null)m.push({match:i[0],index:i.index});for(let o=m.length-1;o>=0;o--){let{match:u}=m[o],l=Da(u);if(l){let f=await r(l);if(a=a.replace(u,f.html),f.preloadLink)t.push(f.preloadLink);if(f.placeholderCss)n.push(f.placeholderCss)}}return{html:a,preloadLinks:t,styles:n}}function B(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}var D=new Map;function yu(){D.clear()}async function G(s,r){let e=`${s}:${JSON.stringify(r)}`;if(D.has(e))return D.get(e);try{let t=await ze(s,r);return D.set(e,t),t}catch{return null}}function La(){return Dt({name:"image",hasEndTag:!1,description:"Render an optimized image with responsive variants",transform:async(s,r,e)=>{let{src:t,alt:n,options:a}=X(s,r,e);if(!t)return console.warn("@image directive: missing src argument"),"<!-- @image: missing src -->";let i={widths:a.widths||(a.width?[a.width]:ue),formats:a.formats||de,quality:a.quality||pe,placeholder:(a.placeholder==="color"?"dominant-color":a.placeholder)||"none"};if(!await $e())return q(t,n||"",a);let o=await G(t,i);if(!o)return q(t,n||"",a);return te(o,n||"",a)}})}function X(s,r,e){if(r.src)return{src:String(r.src),alt:String(r.alt||""),options:r.options||{}};let n=s.trim();if(n.startsWith("@image(")||n.startsWith("("))n=n.replace(/^@image\(/,"").replace(/^\(/,"").replace(/\)$/,"");let a=ee(n),i=a[0]||"",m=a[1]||"",o={};if(i&&!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")){let u=e[i];if(typeof u==="string")i=u}if(a[2])try{if(typeof a[2]==="string")o=JSON.parse(a[2]);else o=a[2]}catch{}return{src:i,alt:m,options:o}}function ee(s){let r=[],e="",t=!1,n="",a=0,i=0;for(let m=0;m<s.length;m++){let o=s[m],u=m>0?s[m-1]:"";if((o==='"'||o==="'")&&u!=="\\"){if(!t)t=!0,n=o;else if(o===n)t=!1,n="";else e+=o;continue}if(!t){if(o==="{")a++;if(o==="}")a--;if(o==="[")i++;if(o==="]")i--;if(o===","&&a===0&&i===0){r.push(e.trim()),e="";continue}}e+=o}if(e.trim())r.push(e.trim());return r}function q(s,r,e){let t=[`src="${x(s)}"`];if(r)t.push(`alt="${x(r)}"`);if(e.width)t.push(`width="${e.width}"`);if(e.height)t.push(`height="${e.height}"`);if(e.class)t.push(`class="${x(e.class)}"`);if(e.style)t.push(`style="${x(e.style)}"`);if(e.lazy!==!1)t.push('loading="lazy"');return t.push('decoding="async"'),`<img ${t.join(" ")} />`}function te(s,r,e){let{variants:t,placeholder:n,width:a,height:i,aspectRatio:m}=s,o=new Map;for(let g of t){let p=o.get(g.format)||[];p.push(g),o.set(g.format,p)}let u=["avif","webp","jpeg","png"],l=[];for(let g of u){let p=o.get(g);if(p&&p.length>0){let v=Rt(p),w=fe(g),I=e.sizes||"100vw";l.push(` <source type="${w}" srcset="${x(v)}" sizes="${x(I)}" />`)}}let f=o.get("jpeg")||[],y=f.length>0?f[Math.floor(f.length/2)]:t[Math.floor(t.length/2)],c=[`src="${y?.url||s.src}"`,`alt="${x(r)}"`];if(e.width||a)c.push(`width="${e.width||a}"`);if(e.height||i)c.push(`height="${e.height||i}"`);if(e.class)c.push(`class="${x(e.class)}"`);let h=[];if(m)h.push(`aspect-ratio: ${m.toFixed(4)}`);if(e.style)h.push(e.style);if(h.length>0)c.push(`style="${h.join("; ")}"`);if(e.lazy!==!1&&!e.priority)c.push('loading="lazy"');if(c.push('decoding="async"'),e.priority)c.push('fetchpriority="high"');let d=`<picture>
34
34
  `;if(d+=l.join(`
35
35
  `)+`
36
36
  `,d+=` <img ${c.join(" ")} />
@@ -38,6 +38,6 @@ ${M.join(`
38
38
  ${d}
39
39
  </div>`}else if(e.placeholder==="color"){let p=n.replace(/[^a-zA-Z0-9#(),.\s%-]/g,"");d=`<div id="${g}" class="stx-image-placeholder" style="background-color: ${p};">
40
40
  ${d}
41
- </div>`}}if(e.priority&&y){let g=pe(y.format);d=`<link rel="preload" as="image" href="${x(y.url)}" type="${g}" />
42
- `+d}return d}function x(s){return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var hu=Ma();import P from"fs";import j from"path";function yu(s={}){let{inputDirs:r=["public","src/assets","assets"],outputDir:e="dist/images",baseUrl:t="/images",formats:n=ue,widths:a=le,quality:i=de,placeholder:m="none",concurrency:o=4,cache:u=!0,cacheDir:l=".stx/image-cache",referencedOnly:f=!1,verbose:y=!1}=s,c={imageReferences:new Set,processedImages:new Map,stats:{totalImages:0,optimizedImages:0,savedBytes:0,variants:0}};return{name:"stx-image-optimization",async setup(h){if(!await Te()){console.warn("[stx-images] no image backend available, optimization disabled");return}if(u)await P.promises.mkdir(l,{recursive:!0});if(y){let g=await tr();console.log("[stx-images] Plugin initialized"),console.log(` Backend: ${g?"sharp (native fast path) + ts-images":"ts-images (pure TS)"}`),console.log(` Input dirs: ${r.join(", ")}`),console.log(` Output dir: ${e}`),console.log(` Formats: ${n.join(", ")}`),console.log(` Widths: ${a.join(", ")}`)}},async buildStart(){c.imageReferences.clear(),c.processedImages.clear(),c.stats={totalImages:0,optimizedImages:0,savedBytes:0,variants:0}},async transform(h,d){if(d.endsWith(".html")||d.endsWith(".stx")){let g=se(h);for(let p of g)c.imageReferences.add(p)}if(h.includes("<Image")||h.includes("@image"))return await ae(h,{formats:n,widths:a,quality:i,placeholder:m,outputDir:e,baseUrl:t,processedImages:c.processedImages});return h},async buildEnd(h){if(!await Te())return;await P.promises.mkdir(e,{recursive:!0});let g=[];for(let w of r){if(!P.existsSync(w))continue;let I=await N(w);g.push(...I)}let p=f?g.filter((w)=>re(w,c.imageReferences)):g;if(c.stats.totalImages=p.length,y)console.log(`[stx-images] Processing ${p.length} images...`);let v=W(p,o);for(let w of v)await Promise.all(w.map(async(I)=>{try{let b=await ze(I,{formats:n,widths:a,quality:i,placeholder:m,outputDir:e,baseUrl:t});c.processedImages.set(I,b),c.stats.optimizedImages++,c.stats.variants+=b.variants.length;let A=P.statSync(I).size,S=or(b.variants);if(c.stats.savedBytes+=Math.max(0,A-S/b.variants.length),y)console.log(` \u2713 ${j.basename(I)} \u2192 ${b.variants.length} variants`)}catch(b){console.error(`[stx-images] Error processing ${I}:`,b)}}));if(console.log("[stx-images] Optimization complete:"),console.log(` Images: ${c.stats.optimizedImages}/${c.stats.totalImages}`),console.log(` Variants: ${c.stats.variants}`),c.stats.savedBytes>0)console.log(` Saved: ~${ir(c.stats.savedBytes)}`)}}}function se(s){let r=[],e=/src=["']([^"']+\.(jpg|jpeg|png|webp|avif|gif))["']/gi,t;while((t=e.exec(s))!==null)r.push(t[1]);let n=/<Image[^>]+src=["']([^"']+)["']/gi;while((t=n.exec(s))!==null)r.push(t[1]);let a=/@image\s*\(\s*['"]([^'"]+)['"]/gi;while((t=a.exec(s))!==null)r.push(t[1]);let i=/background(?:-image)?:\s*url\(["']?([^"')]+\.(jpg|jpeg|png|webp|avif|gif))["']?\)/gi;while((t=i.exec(s))!==null)r.push(t[1]);return r}function re(s,r){let e=j.basename(s);for(let t of r)if(t.endsWith(e)||t.includes(e))return!0;return!1}async function ae(s,r){return s}async function N(s){let r=[];async function e(t){let n=await P.promises.readdir(t,{withFileTypes:!0});for(let a of n){let i=j.join(t,a.name);if(a.isDirectory())await e(i);else if(a.isFile()&&sr(i))r.push(i)}}return await e(s),r}function W(s,r){let e=[];for(let t=0;t<s.length;t+=r)e.push(s.slice(t,t+r));return e}async function bu(s,r,e={}){if(!await Te())throw Error("No image backend available \u2014 install sharp or ensure ts-images is bundled");return ze(s,{...e,outputDir:r})}async function wu(s,r,e={}){let{formats:t=ue,widths:n=le,quality:a=de,placeholder:i="none",concurrency:m=4,verbose:o=!1}=e;if(!await Te())throw Error("No image backend available \u2014 install sharp or ensure ts-images is bundled");await P.promises.mkdir(r,{recursive:!0});let l=await N(s),f=[],y={totalImages:l.length,optimizedImages:0,savedBytes:0,variants:0},c=W(l,m);for(let h of c){let d=await Promise.all(h.map(async(g)=>{try{let p=await ze(g,{formats:t,widths:n,quality:a,placeholder:i,outputDir:r,baseUrl:"/"});if(y.optimizedImages++,y.variants+=p.variants.length,o)console.log(` \u2713 ${j.basename(g)}`);return p}catch(p){return console.error(`Error processing ${g}:`,p),null}}));f.push(...d.filter((g)=>g!==null))}return{processed:f,stats:y}}function Da(s){let r={};for(let e of s)r[e.src]={variants:e.variants,placeholder:e.placeholder};return r}async function vu(s,r){let e=Da(s);await Bun.write(r,JSON.stringify(e,null,2))}var Lm={enabled:!0,widths:[320,640,768,1024,1280,1536,1920],formats:["webp","jpeg"],quality:80,devOptimize:!1,cacheDir:".stx/image-cache",placeholder:"none",inputDirs:["public","src/assets","assets"],outputDir:"dist/images",baseUrl:"/images"};
43
- export{fu,Na,gu,mu,Ma,hu,yu,bu,wu,Da,vu,Lm};
41
+ </div>`}}if(e.priority&&y){let g=fe(y.format);d=`<link rel="preload" as="image" href="${x(y.url)}" type="${g}" />
42
+ `+d}return d}function x(s){return s.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var bu=La();import P from"fs";import j from"path";function wu(s={}){let{inputDirs:r=["public","src/assets","assets"],outputDir:e="dist/images",baseUrl:t="/images",formats:n=de,widths:a=ue,quality:i=pe,placeholder:m="none",concurrency:o=4,cache:u=!0,cacheDir:l=".stx/image-cache",referencedOnly:f=!1,verbose:y=!1}=s,c={imageReferences:new Set,processedImages:new Map,stats:{totalImages:0,optimizedImages:0,savedBytes:0,variants:0}};return{name:"stx-image-optimization",async setup(h){if(!await $e()){console.warn("[stx-images] no image backend available, optimization disabled");return}if(u)await P.promises.mkdir(l,{recursive:!0});if(y){let g=await tr();console.log("[stx-images] Plugin initialized"),console.log(` Backend: ${g?"sharp (native fast path) + ts-images":"ts-images (pure TS)"}`),console.log(` Input dirs: ${r.join(", ")}`),console.log(` Output dir: ${e}`),console.log(` Formats: ${n.join(", ")}`),console.log(` Widths: ${a.join(", ")}`)}},async buildStart(){c.imageReferences.clear(),c.processedImages.clear(),c.stats={totalImages:0,optimizedImages:0,savedBytes:0,variants:0}},async transform(h,d){if(d.endsWith(".html")||d.endsWith(".stx")){let g=se(h);for(let p of g)c.imageReferences.add(p)}if(h.includes("<Image")||h.includes("@image"))return await ae(h,{formats:n,widths:a,quality:i,placeholder:m,outputDir:e,baseUrl:t,processedImages:c.processedImages});return h},async buildEnd(h){if(!await $e())return;await P.promises.mkdir(e,{recursive:!0});let g=[];for(let w of r){if(!P.existsSync(w))continue;let I=await N(w);g.push(...I)}let p=f?g.filter((w)=>re(w,c.imageReferences)):g;if(c.stats.totalImages=p.length,y)console.log(`[stx-images] Processing ${p.length} images...`);let v=W(p,o);for(let w of v)await Promise.all(w.map(async(I)=>{try{let b=await ze(I,{formats:n,widths:a,quality:i,placeholder:m,outputDir:e,baseUrl:t});c.processedImages.set(I,b),c.stats.optimizedImages++,c.stats.variants+=b.variants.length;let A=P.statSync(I).size,S=or(b.variants);if(c.stats.savedBytes+=Math.max(0,A-S/b.variants.length),y)console.log(` \u2713 ${j.basename(I)} \u2192 ${b.variants.length} variants`)}catch(b){console.error(`[stx-images] Error processing ${I}:`,b)}}));if(console.log("[stx-images] Optimization complete:"),console.log(` Images: ${c.stats.optimizedImages}/${c.stats.totalImages}`),console.log(` Variants: ${c.stats.variants}`),c.stats.savedBytes>0)console.log(` Saved: ~${ir(c.stats.savedBytes)}`)}}}function se(s){let r=[],e=/src=["']([^"']+\.(jpg|jpeg|png|webp|avif|gif))["']/gi,t;while((t=e.exec(s))!==null)r.push(t[1]);let n=/<Image[^>]+src=["']([^"']+)["']/gi;while((t=n.exec(s))!==null)r.push(t[1]);let a=/@image\s*\(\s*['"]([^'"]+)['"]/gi;while((t=a.exec(s))!==null)r.push(t[1]);let i=/background(?:-image)?:\s*url\(["']?([^"')]+\.(jpg|jpeg|png|webp|avif|gif))["']?\)/gi;while((t=i.exec(s))!==null)r.push(t[1]);return r}function re(s,r){let e=j.basename(s);for(let t of r)if(t.endsWith(e)||t.includes(e))return!0;return!1}async function ae(s,r){return s}async function N(s){let r=[];async function e(t){let n=await P.promises.readdir(t,{withFileTypes:!0});for(let a of n){let i=j.join(t,a.name);if(a.isDirectory())await e(i);else if(a.isFile()&&sr(i))r.push(i)}}return await e(s),r}function W(s,r){let e=[];for(let t=0;t<s.length;t+=r)e.push(s.slice(t,t+r));return e}async function vu(s,r,e={}){if(!await $e())throw Error("No image backend available \u2014 install sharp or ensure ts-images is bundled");return ze(s,{...e,outputDir:r})}async function xu(s,r,e={}){let{formats:t=de,widths:n=ue,quality:a=pe,placeholder:i="none",concurrency:m=4,verbose:o=!1}=e;if(!await $e())throw Error("No image backend available \u2014 install sharp or ensure ts-images is bundled");await P.promises.mkdir(r,{recursive:!0});let l=await N(s),f=[],y={totalImages:l.length,optimizedImages:0,savedBytes:0,variants:0},c=W(l,m);for(let h of c){let d=await Promise.all(h.map(async(g)=>{try{let p=await ze(g,{formats:t,widths:n,quality:a,placeholder:i,outputDir:r,baseUrl:"/"});if(y.optimizedImages++,y.variants+=p.variants.length,o)console.log(` \u2713 ${j.basename(g)}`);return p}catch(p){return console.error(`Error processing ${g}:`,p),null}}));f.push(...d.filter((g)=>g!==null))}return{processed:f,stats:y}}function ja(s){let r={};for(let e of s)r[e.src]={variants:e.variants,placeholder:e.placeholder};return r}async function Su(s,r){let e=ja(s);await Bun.write(r,JSON.stringify(e,null,2))}var Bm={enabled:!0,widths:[320,640,768,1024,1280,1536,1920],formats:["webp","jpeg"],quality:80,devOptimize:!1,cacheDir:".stx/image-cache",placeholder:"none",inputDirs:["public","src/assets","assets"],outputDir:"dist/images",baseUrl:"/images"};
43
+ export{mu,Da,hu,yu,La,bu,wu,vu,xu,ja,Su,Bm};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var d=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],u=/<body\b([^>]*)>/gi;function W(n){let i=0,e,c=d.map(()=>{return});while(i<n.length){if(e===void 0||e!==null&&e.index<i)u.lastIndex=i,e=u.exec(n);if(!e)return null;let a=e.index,r=-1,o=null;for(let l=0;l<d.length;l++){let g=d[l],t=c[l];if(t===void 0||t!==null&&t.index<i)g.open.lastIndex=i,t=g.open.exec(n),c[l]=t;if(!t)continue;if(t.index<a&&(r===-1||t.index<r))r=t.index,o=g.close}if(r===-1||!o)return{index:a,tag:e[0],attrs:e[1]??""};o.lastIndex=r;let s=o.exec(n);if(!s)return null;i=s.index+s[0].length}return null}function dt(n,i){let e=W(n);if(!e)return n;return n.slice(0,e.index)+i(e.tag,e.attrs)+n.slice(e.index+e.tag.length)}
3
- export{W,dt};
2
+ var d=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],u=/<body\b([^>]*)>/gi;function q(n){let i=0,e,c=d.map(()=>{return});while(i<n.length){if(e===void 0||e!==null&&e.index<i)u.lastIndex=i,e=u.exec(n);if(!e)return null;let a=e.index,r=-1,o=null;for(let l=0;l<d.length;l++){let g=d[l],t=c[l];if(t===void 0||t!==null&&t.index<i)g.open.lastIndex=i,t=g.open.exec(n),c[l]=t;if(!t)continue;if(t.index<a&&(r===-1||t.index<r))r=t.index,o=g.close}if(r===-1||!o)return{index:a,tag:e[0],attrs:e[1]??""};o.lastIndex=r;let s=o.exec(n);if(!s)return null;i=s.index+s[0].length}return null}function dt(n,i){let e=q(n);if(!e)return n;return n.slice(0,e.index)+i(e.tag,e.attrs)+n.slice(e.index+e.tag.length)}
3
+ export{q,dt};
@@ -45,12 +45,12 @@ var p=0;function f(){return`stx-teleport-${++p}`}function g(t){let e=t.split(","
45
45
  });
46
46
  })();
47
47
  </script>
48
- `}function Ph(t,e,l){p=0;let o=/@teleport\s*\(([^)]+)\)\s*([\s\S]*?)@endteleport/g;return t.replace(o,(r,s,d)=>{let a=f(),{target:u,disabled:n}=g(s),c=d.trim();if(n)try{let i=!1;if(n==="true")i=!0;else if(n==="false")i=!1;else if(n in e)i=Boolean(e[n]);if(i)return`<div class="stx-teleport-inline" data-teleport-disabled>${c}</div>`}catch{}let m=h(a,u);return`
48
+ `}function Oh(t,e,l){p=0;let o=/@teleport\s*\(([^)]+)\)\s*([\s\S]*?)@endteleport/g;return t.replace(o,(r,s,d)=>{let a=f(),{target:u,disabled:n}=g(s),c=d.trim();if(n)try{let i=!1;if(n==="true")i=!0;else if(n==="false")i=!1;else if(n in e)i=Boolean(e[n]);if(i)return`<div class="stx-teleport-inline" data-teleport-disabled>${c}</div>`}catch{}let m=h(a,u);return`
49
49
  <div id="${a}" class="stx-teleport-source" style="display: none;">
50
50
  <template>${c}</template>
51
51
  </div>
52
52
  ${m}
53
- `})}function Ih(){return`
53
+ `})}function Nh(){return`
54
54
  <script>
55
55
  (function() {
56
56
  // Common teleport targets
@@ -68,4 +68,4 @@ var p=0;function f(){return`stx-teleport-${++p}`}function g(t){let e=t.split(","
68
68
  })();
69
69
  </script>
70
70
  `}
71
- export{Ph,Ih};
71
+ export{Oh,Nh};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ne,Xi,Gi,Kg,Gt,Al,Xg,Pl,jy,Xe,Nn,Ge}from"./chunk-xdprx6tx.js";import"./chunk-yfe380a4.js";import"./chunk-875wejw1.js";import"./chunk-r7zvrh58.js";import"./chunk-ayrd026n.js";import"./chunk-ra35ptjg.js";import{Jl,t}from"./chunk-amnfd29h.js";import"./chunk-a78k8fkg.js";import"./chunk-4jg8ddfy.js";export{Ne as BROWSER_CORE_IMPORTS,Kg as STX_AUTO_IMPORTS,Xi as extractAndStripCssImports,Xe as extractBridgeData,Jl as findInterpolationEnd,Pl as generateAutoImportDestructuring,jy as generateBrowserAutoImportDestructuring,Nn as generateServerDataBridge,Gt as injectBrowserCoreAutoImports,Ge as processClientScript,Xg as referencesName,Gi as renderVendorStyleTags,t as stripCommentsAndLiterals,Al as transformAutoImports};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$o,sn,cu,gm}from"./chunk-s3rhbwgf.js";export{$o as generateServiceWorker,gm as generateServiceWorkerAuto,sn as getServiceWorkerFileName,cu as isWorkboxEnabled};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Qe,Bn,yo,ta,z,Jt}from"./chunk-875wejw1.js";export{Bn as currentRuntimeConfig,Jt as injectRuntimeConfig,z as resolveRuntimeConfig,ta as useRuntimeConfig,yo as useServerRuntimeConfig,Qe as withRuntimeConfig};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Oe,ho,rm,Fy,sm,zy,Dn,m,ee,ce,Ln,Me,om,Zi,im,Hy,I,Qi,am,Uy,M,Vy}from"./chunk-xdprx6tx.js";import"./chunk-yfe380a4.js";import"./chunk-875wejw1.js";import"./chunk-r7zvrh58.js";import"./chunk-ayrd026n.js";import"./chunk-ra35ptjg.js";import"./chunk-a78k8fkg.js";import"./chunk-4jg8ddfy.js";export{am as applyFilters,zy as clearCustomFilters,om as clientLoopScopes,ho as defaultFilters,Ln as escapeAttributeValue,m as escapeHtml,ee as escapeHtmlValue,ce as escapeInterpolatedHtmlValue,M as evaluateExpression,Oe as findMustacheEnd,sm as getAllFilters,im as interpolateScriptAttributes,Zi as interpolateScriptExpressions,Hy as interpolateScriptsInTemplate,I as processExpressions,Qi as processExpressionsChunked,rm as registerFilter,Fy as registerFilters,Dn as replaceInterpolations,Uy as resetRejectedExpressionWarnings,Vy as unescapeHtml,Me as usesSignalsInScript};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{c}from"./chunk-p4twxjfs.js";function r(){return`<script data-stx-scoped data-stx-x-element-runtime data-stx-run="always">
2
+ import{c}from"./chunk-ws25jw6x.js";function r(){return`<script data-stx-scoped data-stx-x-element-runtime data-stx-run="always">
3
3
  (function() {
4
4
  'use strict';
5
5
 
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{n,u,Yt,Zt,Qt,et,wt,H,wo,Yr,rt}from"./chunk-vf7tpgqz.js";var O=/(?<![\w$@])@meta\s*\(/g,I=/(?<![\w$@])@metaTag\s*\(/g,C=/(?<![\w$@])@structuredData\s*\(/g,k=/(?<![\w$@])@seo\s*\(/g;function _(e,t){return(r)=>H(e,r,"the call has no closing parenthesis",t,n.INVALID_DIRECTIVE_SYNTAX)}function N(e){return"property"in e?`<meta property="${c(e.property)}" content="${c(e.content)}">`:`<meta name="${c(e.name)}" content="${c(e.content)}">`}function Ci(e,t,r,g){if(!e.includes("@meta"))return e;let i=Yt(e,O,(a,o)=>{let s=Yr(Zt(a),t);if(s.kind==="tag")return N(s.tag);if(s.kind==="empty")return"";return H("Meta",o,s.message,r,s.code)},_("Meta",r));return i=Yt(i,I,(a,o)=>{let s=Qt(a,t);if(!s.ok)return H("MetaTag",o,s.message,r,s.code);if(s.value===void 0||s.value===null)return"";if(!wt(s.value))return H("MetaTag",o,`expected an object such as { name, content }, got ${et(s.value)}`,r,n.TYPE_ERROR);let l=s.value;if(!l.name&&!l.property&&!l.httpEquiv)return H("MetaTag",o,"the tag needs a name, property or httpEquiv",r,n.INVALID_DIRECTIVE_SYNTAX);if(l.content===void 0||l.content===null||l.content===""||l.content===!1)return"";let p="<meta";if(l.name)p+=` name="${c(l.name)}"`;if(l.property)p+=` property="${c(l.property)}"`;if(l.httpEquiv)p+=` http-equiv="${c(l.httpEquiv)}"`;return p+=` content="${c(l.content)}">`,p},_("MetaTag",r)),i}function b(e){let t=(r)=>r["@context"]?{...r}:{...r,"@context":"https://schema.org"};if(wt(e))return t(e);if(Array.isArray(e)&&e.length>0&&e.every(wt))return e.map(t);return null}function E(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function Ei(e,t,r){if(!e.includes("@structuredData"))return e;return Yt(e,C,(g,i)=>{let a=Qt(g,t);if(!a.ok)return H("StructuredData",i,a.message,r,a.code);if(a.value===void 0||a.value===null)return"";let o=b(a.value);if(!o)return H("StructuredData",i,`expected an object or an array of objects, got ${et(a.value)}`,r,n.TYPE_ERROR);try{return E(o)}catch(s){let l=s instanceof Error?s.message:String(s);return H("StructuredData",i,`the data cannot be written as JSON: ${l}`,r,n.EVALUATION_ERROR)}},_("StructuredData",r))}var j=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),A={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function Ti(e,t,r,g){if(!e.includes("@seo"))return e;return Yt(e,k,(i,a)=>{if(!i.trim())return H("SEO",a,"expected an object: @seo({ title, description }) or @seo(seoVariable)",r,n.INVALID_DIRECTIVE_SYNTAX);let o=Qt(i,t);if(!o.ok)return H("SEO",a,o.message,r,o.code);if(o.value===void 0||o.value===null)return"";if(!wt(o.value))return H("SEO",a,`expected an object such as { title, description }, got ${et(o.value)}`,r,n.TYPE_ERROR);try{return L(o.value,a,r)}catch(s){let l=s instanceof Error?s.message:String(s);return H("SEO",a,`Error processing @seo directive: ${l}`,r,n.EVALUATION_ERROR)}},_("SEO",r))}function R(e,t,r,g){let i=e[t];if(i===void 0||i===null||i===!1)return;if(wt(i))return i;wo(r,`${t} must be an object, got ${et(i)}; its tags were left out`,g);return}function L(e,t,r){let g=Object.keys(e).filter((s)=>!j.has(s));if(g.length>0){let s=g.map((l)=>A[l]?`${l} (use ${A[l]})`:l).join(", ");wo(t,`@seo does not read ${s}; ${g.length===1?"it was":"they were"} ignored`,r)}let i="";if(e.title)i+=`<title>${c(e.title)}</title>
2
+ import{n,u,Yt,Zt,Qt,et,wt,H,xo,Yr,rt}from"./chunk-r7zvrh58.js";var O=/(?<![\w$@])@meta\s*\(/g,I=/(?<![\w$@])@metaTag\s*\(/g,C=/(?<![\w$@])@structuredData\s*\(/g,k=/(?<![\w$@])@seo\s*\(/g;function _(e,t){return(r)=>H(e,r,"the call has no closing parenthesis",t,n.INVALID_DIRECTIVE_SYNTAX)}function N(e){return"property"in e?`<meta property="${c(e.property)}" content="${c(e.content)}">`:`<meta name="${c(e.name)}" content="${c(e.content)}">`}function Ti(e,t,r,g){if(!e.includes("@meta"))return e;let i=Yt(e,O,(a,o)=>{let s=Yr(Zt(a),t);if(s.kind==="tag")return N(s.tag);if(s.kind==="empty")return"";return H("Meta",o,s.message,r,s.code)},_("Meta",r));return i=Yt(i,I,(a,o)=>{let s=Qt(a,t);if(!s.ok)return H("MetaTag",o,s.message,r,s.code);if(s.value===void 0||s.value===null)return"";if(!wt(s.value))return H("MetaTag",o,`expected an object such as { name, content }, got ${et(s.value)}`,r,n.TYPE_ERROR);let l=s.value;if(!l.name&&!l.property&&!l.httpEquiv)return H("MetaTag",o,"the tag needs a name, property or httpEquiv",r,n.INVALID_DIRECTIVE_SYNTAX);if(l.content===void 0||l.content===null||l.content===""||l.content===!1)return"";let p="<meta";if(l.name)p+=` name="${c(l.name)}"`;if(l.property)p+=` property="${c(l.property)}"`;if(l.httpEquiv)p+=` http-equiv="${c(l.httpEquiv)}"`;return p+=` content="${c(l.content)}">`,p},_("MetaTag",r)),i}function b(e){let t=(r)=>r["@context"]?{...r}:{...r,"@context":"https://schema.org"};if(wt(e))return t(e);if(Array.isArray(e)&&e.length>0&&e.every(wt))return e.map(t);return null}function E(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function $i(e,t,r){if(!e.includes("@structuredData"))return e;return Yt(e,C,(g,i)=>{let a=Qt(g,t);if(!a.ok)return H("StructuredData",i,a.message,r,a.code);if(a.value===void 0||a.value===null)return"";let o=b(a.value);if(!o)return H("StructuredData",i,`expected an object or an array of objects, got ${et(a.value)}`,r,n.TYPE_ERROR);try{return E(o)}catch(s){let l=s instanceof Error?s.message:String(s);return H("StructuredData",i,`the data cannot be written as JSON: ${l}`,r,n.EVALUATION_ERROR)}},_("StructuredData",r))}var j=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),A={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function Ri(e,t,r,g){if(!e.includes("@seo"))return e;return Yt(e,k,(i,a)=>{if(!i.trim())return H("SEO",a,"expected an object: @seo({ title, description }) or @seo(seoVariable)",r,n.INVALID_DIRECTIVE_SYNTAX);let o=Qt(i,t);if(!o.ok)return H("SEO",a,o.message,r,o.code);if(o.value===void 0||o.value===null)return"";if(!wt(o.value))return H("SEO",a,`expected an object such as { title, description }, got ${et(o.value)}`,r,n.TYPE_ERROR);try{return L(o.value,a,r)}catch(s){let l=s instanceof Error?s.message:String(s);return H("SEO",a,`Error processing @seo directive: ${l}`,r,n.EVALUATION_ERROR)}},_("SEO",r))}function R(e,t,r,g){let i=e[t];if(i===void 0||i===null||i===!1)return;if(wt(i))return i;xo(r,`${t} must be an object, got ${et(i)}; its tags were left out`,g);return}function L(e,t,r){let g=Object.keys(e).filter((s)=>!j.has(s));if(g.length>0){let s=g.map((l)=>A[l]?`${l} (use ${A[l]})`:l).join(", ");xo(t,`@seo does not read ${s}; ${g.length===1?"it was":"they were"} ignored`,r)}let i="";if(e.title)i+=`<title>${c(e.title)}</title>
3
3
  `,i+=`<meta name="title" content="${c(e.title)}">
4
4
  `;if(e.description)i+=`<meta name="description" content="${c(e.description)}">
5
5
  `;if(e.keywords){let s=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;i+=`<meta name="keywords" content="${c(s)}">
@@ -25,7 +25,7 @@ import{n,u,Yt,Zt,Qt,et,wt,H,wo,Yr,rt}from"./chunk-vf7tpgqz.js";var O=/(?<![\w$@]
25
25
  `}if(o.site)i+=`<meta name="twitter:site" content="${c(o.site)}">
26
26
  `;if(o.creator)i+=`<meta name="twitter:creator" content="${c(o.creator)}">
27
27
  `}if(e.structuredData!==void 0&&e.structuredData!==null){let s=b(e.structuredData);if(s)i+=`${E(s)}
28
- `;else wo(t,`structuredData must be an object or an array of objects, got ${et(e.structuredData)}; it was left out`,r)}return i.trim()}function $i(e,t,r){if(r.seo?.enabled===!1)return e;if(e.includes("<!-- stx SEO Tags -->")||t.__stx_seo_staged===!0||r.skipDefaultSeoTags===!0)return e;let g=t.__stx_runtime_head;if(!!(g?.title||g?.meta?.some((S)=>S.property==="og:title"||S.name==="og:title"||S.name==="twitter:title"||S.name==="description")))return e;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test(e))return e;if(!e.includes("<head>")&&!e.includes("<head "))return e;let a=e.includes("<title>")||e.includes("</title>"),o=q(e),s=M(o),l=G(o),p="";if(t.title)p=t.title;else if(t.meta&&t.meta.title)p=t.meta.title;else if(s)p=s;else if(r.seo?.defaultConfig?.title)p=r.seo.defaultConfig.title;else p=r.defaultTitle||"stx Project";let m="";if(t.description)m=t.description;else if(t.meta&&t.meta.description)m=t.meta.description;else if(l)m=l;else if(r.seo?.defaultConfig?.description)m=r.seo.defaultConfig.description;else m=r.defaultDescription||"A website built with stx templating engine";let d="";if(t.image)d=t.image;else if(t.meta&&t.meta.image)d=t.meta.image;else if(t.openGraph&&t.openGraph.image)d=t.openGraph.image;else if(r.seo?.defaultImage)d=r.seo.defaultImage;else if(r.defaultImage)d=r.defaultImage;let f=a?"":`
28
+ `;else xo(t,`structuredData must be an object or an array of objects, got ${et(e.structuredData)}; it was left out`,r)}return i.trim()}function Ai(e,t,r){if(r.seo?.enabled===!1)return e;if(e.includes("<!-- stx SEO Tags -->")||t.__stx_seo_staged===!0||r.skipDefaultSeoTags===!0)return e;let g=t.__stx_runtime_head;if(!!(g?.title||g?.meta?.some((S)=>S.property==="og:title"||S.name==="og:title"||S.name==="twitter:title"||S.name==="description")))return e;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test(e))return e;if(!e.includes("<head>")&&!e.includes("<head "))return e;let a=e.includes("<title>")||e.includes("</title>"),o=q(e),s=M(o),l=G(o),p="";if(t.title)p=t.title;else if(t.meta&&t.meta.title)p=t.meta.title;else if(s)p=s;else if(r.seo?.defaultConfig?.title)p=r.seo.defaultConfig.title;else p=r.defaultTitle||"stx Project";let m="";if(t.description)m=t.description;else if(t.meta&&t.meta.description)m=t.meta.description;else if(l)m=l;else if(r.seo?.defaultConfig?.description)m=r.seo.defaultConfig.description;else m=r.defaultDescription||"A website built with stx templating engine";let d="";if(t.image)d=t.image;else if(t.meta&&t.meta.image)d=t.meta.image;else if(t.openGraph&&t.openGraph.image)d=t.openGraph.image;else if(r.seo?.defaultImage)d=r.seo.defaultImage;else if(r.defaultImage)d=r.defaultImage;let f=a?"":`
29
29
  <meta name="title" content="${c(p)}">`,D=V(o)?"":`
30
30
  <meta name="description" content="${c(m)}">`,y=`
31
31
  <!-- stx SEO Tags -->${f}${D}
@@ -43,7 +43,7 @@ import{n,u,Yt,Zt,Qt,et,wt,H,wo,Yr,rt}from"./chunk-vf7tpgqz.js";var O=/(?<![\w$@]
43
43
  ${y}
44
44
  `),h;return h.replace(/<head[^>]*>/,`$&
45
45
  ${y}
46
- `)}function q(e){let t=e.search(/<\/head\s*>/i);return t===-1?e:e.slice(0,t)}function v(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0*39;|&apos;/g,"'").replace(/&amp;/g,"&")}function M(e){let t=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return t?v(t[1].trim()):""}function x(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((t)=>/\sname\s*=\s*["']description["']/i.test(t))}function V(e){return x(e).length>0}function G(e){for(let t of x(e)){let r=t.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(r?.[1]??r?.[2]??"").trim();if(g)return v(g)}return""}function c(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var Ws={name:"meta",rawParams:!0,handler:(e,t,r,g)=>{let i=Yr(t,r??{});if(i.kind==="error")return H("Meta",`@meta(${t.join(", ")})`,i.message,g,i.code);if(i.kind==="empty")return"";if(r)r.__stx_runtime_head=rt(r.__stx_runtime_head??{},{meta:[i.tag]});return""},hasEndTag:!1},qs={name:"structuredData",handler:(e,t,r,g)=>{if(e.trim()==="")return u("StructuredData","structuredData directive requires JSON-LD content",n.INVALID_DIRECTIVE_SYNTAX);try{let i=JSON.parse(e);if(!i["@context"])i["@context"]="https://schema.org";if(!i["@type"])return u("StructuredData","structuredData requires @type property",n.INVALID_DIRECTIVE_SYNTAX);return E(i)}catch(i){let a=i instanceof Error?i.message:String(i);return u("StructuredData",a,n.EVALUATION_ERROR)}},hasEndTag:!0};function Py(){return[Ws,qs]}function Iy(e,t){let{baseUrl:r,defaultChangefreq:g="weekly",defaultPriority:i=0.5,includeLastmod:a=!0}=t,o=r.replace(/\/$/,""),s=(m)=>m.startsWith("http")?m:`${o}${m.startsWith("/")?"":"/"}${m}`,l=e.map((m)=>{let d=s(m.loc),f=m.lastmod||(a?new Date().toISOString().split("T")[0]:void 0),D=m.changefreq||g,y=m.priority??i,h=` <url>
46
+ `)}function q(e){let t=e.search(/<\/head\s*>/i);return t===-1?e:e.slice(0,t)}function v(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0*39;|&apos;/g,"'").replace(/&amp;/g,"&")}function M(e){let t=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return t?v(t[1].trim()):""}function x(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((t)=>/\sname\s*=\s*["']description["']/i.test(t))}function V(e){return x(e).length>0}function G(e){for(let t of x(e)){let r=t.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(r?.[1]??r?.[2]??"").trim();if(g)return v(g)}return""}function c(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var qs={name:"meta",rawParams:!0,handler:(e,t,r,g)=>{let i=Yr(t,r??{});if(i.kind==="error")return H("Meta",`@meta(${t.join(", ")})`,i.message,g,i.code);if(i.kind==="empty")return"";if(r)r.__stx_runtime_head=rt(r.__stx_runtime_head??{},{meta:[i.tag]});return""},hasEndTag:!1},Ks={name:"structuredData",handler:(e,t,r,g)=>{if(e.trim()==="")return u("StructuredData","structuredData directive requires JSON-LD content",n.INVALID_DIRECTIVE_SYNTAX);try{let i=JSON.parse(e);if(!i["@context"])i["@context"]="https://schema.org";if(!i["@type"])return u("StructuredData","structuredData requires @type property",n.INVALID_DIRECTIVE_SYNTAX);return E(i)}catch(i){let a=i instanceof Error?i.message:String(i);return u("StructuredData",a,n.EVALUATION_ERROR)}},hasEndTag:!0};function Oy(){return[qs,Ks]}function Ny(e,t){let{baseUrl:r,defaultChangefreq:g="weekly",defaultPriority:i=0.5,includeLastmod:a=!0}=t,o=r.replace(/\/$/,""),s=(m)=>m.startsWith("http")?m:`${o}${m.startsWith("/")?"":"/"}${m}`,l=e.map((m)=>{let d=s(m.loc),f=m.lastmod||(a?new Date().toISOString().split("T")[0]:void 0),D=m.changefreq||g,y=m.priority??i,h=` <url>
47
47
  <loc>${T(d)}</loc>`;for(let w of m.alternates??[])h+=`
48
48
  <xhtml:link rel="alternate" hreflang="${T(w.hreflang)}" href="${T(s(w.href))}"/>`;if(f)h+=`
49
49
  <lastmod>${f}</lastmod>`;return h+=`
@@ -53,13 +53,13 @@ ${y}
53
53
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${e.some((m)=>m.alternates?.length)?' xmlns:xhtml="http://www.w3.org/1999/xhtml"':""}>
54
54
  ${l.join(`
55
55
  `)}
56
- </urlset>`}function Oy(e,t){let r=t.replace(/\/$/,""),g=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
56
+ </urlset>`}function My(e,t){let r=t.replace(/\/$/,""),g=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
57
57
  <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
58
58
  ${e.map((a)=>{let o=a.startsWith("http")?a:`${r}${a.startsWith("/")?"":"/"}${a}`;return` <sitemap>
59
59
  <loc>${T(o)}</loc>
60
60
  <lastmod>${g}</lastmod>
61
61
  </sitemap>`}).join(`
62
62
  `)}
63
- </sitemapindex>`}async function Ny(e,t){let{extensions:r=[".stx",".html",".htm"],ignore:g=["_*",".*","node_modules","components","partials","layouts"]}=t,i=[],a=r.length===1?`*${r[0]}`:`*{${r.join(",")}}`,o=new Bun.Glob(`**/${a}`);for await(let s of o.scan(e)){if(g.some((f)=>{if(f.startsWith("*"))return s.includes(f.slice(1));return s.startsWith(f)||s.includes(`/${f}`)}))continue;let p=s.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!p.startsWith("/"))p=`/${p}`;if(p!=="/"&&p.endsWith("/"))p=p.slice(0,-1);let m=`${e}/${s}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}i.push({loc:p||"/",lastmod:d,priority:p==="/"?1:0.5})}return i.sort((s,l)=>s.loc.localeCompare(l.loc)),i}function Ks(e){let t=[];for(let r of e.rules){if(t.push(`User-agent: ${r.userAgent}`),r.allow)for(let g of r.allow)t.push(`Allow: ${g}`);if(r.disallow)for(let g of r.disallow)t.push(`Disallow: ${g}`);if(r.crawlDelay!==void 0)t.push(`Crawl-delay: ${r.crawlDelay}`);t.push("")}if(e.sitemap){let r=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let g of r)t.push(`Sitemap: ${g}`)}if(e.host)t.push(`Host: ${e.host}`);return t.join(`
64
- `).trim()}function My(e){return Ks({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function T(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}
65
- export{Ci,Ei,Ti,$i,Ws,qs,Py,Iy,Oy,Ny,Ks,My};
63
+ </sitemapindex>`}async function Dy(e,t){let{extensions:r=[".stx",".html",".htm"],ignore:g=["_*",".*","node_modules","components","partials","layouts"]}=t,i=[],a=r.length===1?`*${r[0]}`:`*{${r.join(",")}}`,o=new Bun.Glob(`**/${a}`);for await(let s of o.scan(e)){if(g.some((f)=>{if(f.startsWith("*"))return s.includes(f.slice(1));return s.startsWith(f)||s.includes(`/${f}`)}))continue;let p=s.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!p.startsWith("/"))p=`/${p}`;if(p!=="/"&&p.endsWith("/"))p=p.slice(0,-1);let m=`${e}/${s}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}i.push({loc:p||"/",lastmod:d,priority:p==="/"?1:0.5})}return i.sort((s,l)=>s.loc.localeCompare(l.loc)),i}function Xs(e){let t=[];for(let r of e.rules){if(t.push(`User-agent: ${r.userAgent}`),r.allow)for(let g of r.allow)t.push(`Allow: ${g}`);if(r.disallow)for(let g of r.disallow)t.push(`Disallow: ${g}`);if(r.crawlDelay!==void 0)t.push(`Crawl-delay: ${r.crawlDelay}`);t.push("")}if(e.sitemap){let r=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let g of r)t.push(`Sitemap: ${g}`)}if(e.host)t.push(`Host: ${e.host}`);return t.join(`
64
+ `).trim()}function Ly(e){return Xs({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function T(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}
65
+ export{Ti,$i,Ri,Ai,qs,Ks,Oy,Ny,My,Dy,Xs,Ly};