@stacksjs/stx 0.2.876 → 0.2.881

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 (278) hide show
  1. package/dist/{chunk-h17pfbng.js → chunk-002zrse4.js} +2 -2
  2. package/dist/{chunk-fdjx4vs3.js → chunk-00tq7ghn.js} +2 -2
  3. package/dist/{chunk-nv4c25zj.js → chunk-02qmvcmv.js} +3 -3
  4. package/dist/chunk-08cb7cyw.js +2 -0
  5. package/dist/chunk-0h1dyd38.js +2 -0
  6. package/dist/chunk-1jk46ve0.js +2 -0
  7. package/dist/chunk-1z6rrqvm.js +2 -0
  8. package/dist/{chunk-w8k9fz1w.js → chunk-1zkymrw0.js} +7 -7
  9. package/dist/chunk-2cvwjtjh.js +16 -0
  10. package/dist/{chunk-k0t9ye9j.js → chunk-2gg3vjks.js} +126 -71
  11. package/dist/{chunk-1q5w3xav.js → chunk-2r0nrvqe.js} +2 -2
  12. package/dist/{chunk-3922g6sh.js → chunk-345waetq.js} +9 -9
  13. package/dist/{chunk-eknm4jrm.js → chunk-3sema2js.js} +2 -2
  14. package/dist/{chunk-cvbwxskc.js → chunk-45jpwbzd.js} +5 -5
  15. package/dist/{chunk-qnwd5bz4.js → chunk-463weehv.js} +1 -1
  16. package/dist/{chunk-wm029dh0.js → chunk-4fkcn6z5.js} +18 -12
  17. package/dist/chunk-4frh1qg5.js +2 -0
  18. package/dist/{chunk-976kgb3r.js → chunk-4n45qa0b.js} +9 -9
  19. package/dist/chunk-4pjqj54a.js +2 -0
  20. package/dist/{chunk-ft6em3wm.js → chunk-50cnypys.js} +6 -6
  21. package/dist/chunk-51qyxm0y.js +2 -0
  22. package/dist/chunk-53cc06w7.js +2 -0
  23. package/dist/{chunk-y2e2zm6y.js → chunk-57q4nvs9.js} +3 -3
  24. package/dist/{chunk-3mz9bdf7.js → chunk-59er0fc7.js} +3 -3
  25. package/dist/chunk-5hrx1p6g.js +2 -0
  26. package/dist/chunk-5mwzea5d.js +2 -0
  27. package/dist/chunk-5rd0an89.js +2 -0
  28. package/dist/{chunk-pk714ynv.js → chunk-69ezjc8k.js} +4 -4
  29. package/dist/{chunk-75v0yxeh.js → chunk-6c1vm6bs.js} +2 -2
  30. package/dist/{chunk-d3q0cg47.js → chunk-6df3j3qq.js} +3 -3
  31. package/dist/{chunk-kzc2tqzr.js → chunk-6t04tqvh.js} +2 -2
  32. package/dist/chunk-78zgmqhd.js +2 -0
  33. package/dist/chunk-7kqgp3p7.js +2 -0
  34. package/dist/{chunk-wzvdr4ta.js → chunk-7mcs59pr.js} +2 -2
  35. package/dist/chunk-86nsbxep.js +61 -0
  36. package/dist/{chunk-0g2mg8cw.js → chunk-8e1cv1hh.js} +3 -3
  37. package/dist/chunk-8h5nje66.js +2 -0
  38. package/dist/chunk-8nqyyj1h.js +33 -0
  39. package/dist/chunk-8qr3cmpb.js +2 -0
  40. package/dist/{chunk-ae8q4gze.js → chunk-8va3fs07.js} +5 -5
  41. package/dist/chunk-909tgpxp.js +2 -0
  42. package/dist/{chunk-xmws1gaf.js → chunk-94ctmp0j.js} +2 -2
  43. package/dist/chunk-95j7y1rt.js +2 -0
  44. package/dist/chunk-97kgrevs.js +4 -0
  45. package/dist/{chunk-mce3g2wb.js → chunk-9f31gs4m.js} +2 -2
  46. package/dist/chunk-9fvjr9dd.js +4 -0
  47. package/dist/chunk-9kza7gxd.js +2 -0
  48. package/dist/chunk-9yx7cbhz.js +25 -0
  49. package/dist/{chunk-nn6hvsxp.js → chunk-9zj3xztb.js} +2 -2
  50. package/dist/{chunk-b4d4tjvx.js → chunk-a0q0kb0s.js} +5 -5
  51. package/dist/chunk-a60ztvnp.js +3 -0
  52. package/dist/{chunk-s7fhpkvf.js → chunk-a7ryj8z8.js} +6 -6
  53. package/dist/{chunk-gqtb53s8.js → chunk-aaea157p.js} +2 -2
  54. package/dist/{chunk-wp0qpa50.js → chunk-agd2b928.js} +59 -27
  55. package/dist/chunk-aqxh80vh.js +2 -0
  56. package/dist/chunk-asv4b65m.js +12 -0
  57. package/dist/chunk-axra1yas.js +2 -0
  58. package/dist/chunk-bhc25n2n.js +2 -0
  59. package/dist/chunk-brp8np3t.js +2 -0
  60. package/dist/{chunk-r2bxjna3.js → chunk-c0g30cjs.js} +2 -2
  61. package/dist/{chunk-jt5tzddc.js → chunk-c73c0wf9.js} +2 -2
  62. package/dist/{chunk-bjjfr7qt.js → chunk-care745q.js} +2 -2
  63. package/dist/chunk-cv1vm1w0.js +2 -0
  64. package/dist/{chunk-mw0rb1sf.js → chunk-czcx3nbx.js} +6 -6
  65. package/dist/{chunk-vnkvnenn.js → chunk-czzehcxs.js} +7 -7
  66. package/dist/chunk-d7b30bg6.js +2 -0
  67. package/dist/{chunk-cj44e8mw.js → chunk-d8qt6hjg.js} +5 -5
  68. package/dist/chunk-dfbbkjz6.js +3 -0
  69. package/dist/chunk-dv0cpmat.js +2 -0
  70. package/dist/{chunk-stn7p7f1.js → chunk-dwyhpbpx.js} +2 -2
  71. package/dist/chunk-dze7f9vv.js +2 -0
  72. package/dist/{chunk-y75bds1g.js → chunk-e362e615.js} +30 -30
  73. package/dist/{chunk-ydppkb8y.js → chunk-e41pgmgk.js} +2 -2
  74. package/dist/chunk-ekdhjm8p.js +54 -0
  75. package/dist/chunk-etavf6mr.js +2 -0
  76. package/dist/{chunk-jqxerj6k.js → chunk-ezna4dhj.js} +2 -2
  77. package/dist/chunk-f3j1h3ch.js +2 -0
  78. package/dist/chunk-f6ac0gbe.js +2 -0
  79. package/dist/chunk-fwhr3jda.js +2 -0
  80. package/dist/chunk-fxhgj8tp.js +2 -0
  81. package/dist/chunk-fz4c5e9m.js +2 -0
  82. package/dist/{chunk-esjr9qhe.js → chunk-g2xy0z0e.js} +2 -2
  83. package/dist/chunk-g5q0wgzk.js +2 -0
  84. package/dist/{chunk-j0rqa9bk.js → chunk-gad3ebgr.js} +5 -5
  85. package/dist/{chunk-kywe0f1v.js → chunk-gbncp2gp.js} +2 -2
  86. package/dist/{chunk-df6vjs3p.js → chunk-gmbw1xhm.js} +5 -5
  87. package/dist/chunk-gmp10259.js +2 -0
  88. package/dist/chunk-gs6geqeg.js +2 -0
  89. package/dist/chunk-h26mpqrh.js +2 -0
  90. package/dist/{chunk-0sa9gqmc.js → chunk-h2tq6cbr.js} +11 -11
  91. package/dist/chunk-h3fv0q25.js +2 -0
  92. package/dist/{chunk-r09kz9bf.js → chunk-h63ma36g.js} +2 -2
  93. package/dist/{chunk-g15reb1h.js → chunk-hnxwqamj.js} +8 -8
  94. package/dist/{chunk-3w7gacva.js → chunk-hxhmhw23.js} +3 -3
  95. package/dist/{chunk-6kp4mg3h.js → chunk-jc74097x.js} +2 -2
  96. package/dist/chunk-jghpzx5m.js +2 -0
  97. package/dist/{chunk-fh72k2ks.js → chunk-jqvc2wbz.js} +6 -6
  98. package/dist/chunk-k52126rh.js +2 -0
  99. package/dist/chunk-k7ffxfgp.js +3 -0
  100. package/dist/{chunk-f4vgagjb.js → chunk-kee5a3ce.js} +3 -3
  101. package/dist/chunk-kyh32kma.js +20 -0
  102. package/dist/{chunk-2tcyfrvb.js → chunk-m91jj8nq.js} +2 -2
  103. package/dist/chunk-my3yv4sg.js +2 -0
  104. package/dist/chunk-nb6erf75.js +9 -0
  105. package/dist/chunk-ndqq991c.js +26 -0
  106. package/dist/chunk-ngzyzcrp.js +2 -0
  107. package/dist/chunk-nj1ssjtd.js +2 -0
  108. package/dist/chunk-njza56wn.js +1198 -0
  109. package/dist/{chunk-ttjscvre.js → chunk-nnynrb97.js} +3 -3
  110. package/dist/chunk-p6hcrg3r.js +3 -0
  111. package/dist/chunk-pa2vt2ej.js +2 -0
  112. package/dist/chunk-pa6kgbmw.js +2 -0
  113. package/dist/{chunk-saqzk45g.js → chunk-pdprhg5k.js} +1 -1
  114. package/dist/chunk-pjjrx9pk.js +2 -0
  115. package/dist/{chunk-mkwavsb3.js → chunk-pm27mcfp.js} +3 -3
  116. package/dist/chunk-pstbfz5g.js +2 -0
  117. package/dist/chunk-pt3rp3zg.js +2 -0
  118. package/dist/chunk-pw9qqcw3.js +2 -0
  119. package/dist/chunk-q1jjgg4w.js +2 -0
  120. package/dist/{chunk-4517hny7.js → chunk-q1mb0fbt.js} +2 -2
  121. package/dist/{chunk-k1ew643q.js → chunk-q74affc4.js} +2 -2
  122. package/dist/chunk-qg1kw5yf.js +2 -0
  123. package/dist/chunk-r32ddrvn.js +21 -0
  124. package/dist/{chunk-rzd9hyhv.js → chunk-ram5944w.js} +2 -2
  125. package/dist/{chunk-p5m1z6e1.js → chunk-rcxer2km.js} +4 -4
  126. package/dist/{chunk-x2ftkaz3.js → chunk-rsxxajv6.js} +2 -2
  127. package/dist/chunk-rw5sxr5a.js +2 -0
  128. package/dist/chunk-s29hp1qw.js +14 -0
  129. package/dist/chunk-s7xywsqd.js +3 -0
  130. package/dist/{chunk-d6gqh2wv.js → chunk-satrf398.js} +1 -1
  131. package/dist/{chunk-zn6n075d.js → chunk-shcnt6aa.js} +3 -3
  132. package/dist/{chunk-zgds9nwv.js → chunk-smkerejj.js} +44 -44
  133. package/dist/{chunk-ysfgabpf.js → chunk-sn4ndpd7.js} +3 -3
  134. package/dist/{chunk-7rep2jqh.js → chunk-sq6werer.js} +23 -23
  135. package/dist/{chunk-zc8a2erc.js → chunk-ssg6ne5b.js} +4 -4
  136. package/dist/{chunk-afxfkb60.js → chunk-sv7fdqmc.js} +6 -6
  137. package/dist/chunk-t8r40wgf.js +2 -0
  138. package/dist/{chunk-dbvsa5ya.js → chunk-t94y8g35.js} +2 -2
  139. package/dist/{chunk-xtaq95em.js → chunk-v1s838fe.js} +1 -1
  140. package/dist/chunk-v5cah9pt.js +2 -0
  141. package/dist/chunk-v8ea76j6.js +2 -0
  142. package/dist/chunk-vxw92h3q.js +2 -0
  143. package/dist/{chunk-ctjxcaxq.js → chunk-w53p65hy.js} +66 -66
  144. package/dist/chunk-w5zzwe2f.js +2 -0
  145. package/dist/chunk-wbmx0rge.js +2 -0
  146. package/dist/chunk-wfthd3n5.js +2 -0
  147. package/dist/chunk-wjafpvjv.js +2 -0
  148. package/dist/chunk-ws2h92mm.js +3 -0
  149. package/dist/chunk-xf6snj8e.js +38 -0
  150. package/dist/chunk-xfhxfcvk.js +2 -0
  151. package/dist/chunk-xhr35ctb.js +2 -0
  152. package/dist/chunk-xmmr0916.js +2 -0
  153. package/dist/{chunk-yxdhz4ps.js → chunk-xpbakn6t.js} +2 -2
  154. package/dist/{chunk-v0tdg16k.js → chunk-ybjgnnyf.js} +5 -5
  155. package/dist/{chunk-x4jzhgdm.js → chunk-yffqfgjx.js} +2 -2
  156. package/dist/chunk-yh2hnt3m.js +12 -0
  157. package/dist/{chunk-2mt2zc5y.js → chunk-ym0cdk7m.js} +10 -10
  158. package/dist/{chunk-w6pzkcjp.js → chunk-ymqm898x.js} +2 -2
  159. package/dist/{chunk-2zaatnnh.js → chunk-yp4tn4zn.js} +4 -4
  160. package/dist/{chunk-fwbccyhw.js → chunk-ypsf5y5g.js} +2 -2
  161. package/dist/chunk-z7k1xn6k.js +2 -0
  162. package/dist/{chunk-nnp6rf4c.js → chunk-zch65qrd.js} +1 -1
  163. package/dist/{chunk-pbakxcv8.js → chunk-zek9t5za.js} +2 -2
  164. package/dist/cli.js +23 -23
  165. package/dist/client/signals-dom-ready-runtime.js +6 -0
  166. package/dist/client/signals-mount-runtime.js +1 -1
  167. package/dist/client-module-registry.js +10 -4
  168. package/dist/client-parameter-bindings.d.ts +5 -0
  169. package/dist/client-parameter-bindings.js +47 -6
  170. package/dist/client-script-bundler.js +4 -3
  171. package/dist/component-library.d.ts +1 -0
  172. package/dist/component-library.js +42 -14
  173. package/dist/composable-loader.js +19 -9
  174. package/dist/craft-entry.js +2 -2
  175. package/dist/craft.js +2 -2
  176. package/dist/dev-server/ts-css.js +3 -3
  177. package/dist/html-masking.d.ts +2 -0
  178. package/dist/html-masking.js +10 -0
  179. package/dist/inherited-context.d.ts +1 -1
  180. package/dist/inherited-context.js +43 -14
  181. package/dist/module-syntax.d.ts +2 -0
  182. package/dist/module-syntax.js +21 -0
  183. package/dist/native-component-context.js +42 -16
  184. package/dist/page-module-order.d.ts +10 -0
  185. package/dist/page-module-order.js +139 -0
  186. package/dist/process.js +6 -4
  187. package/dist/pwa.js +3 -3
  188. package/dist/script-attributes.d.ts +4 -0
  189. package/dist/script-attributes.js +10 -0
  190. package/dist/ssg.js +39 -39
  191. package/dist/strip-literals.d.ts +2 -0
  192. package/dist/strip-literals.js +12 -6
  193. package/dist/stx-virtual-ts.d.ts +1 -0
  194. package/dist/stx-virtual-ts.js +21 -27
  195. package/dist/typecheck.js +8 -0
  196. package/package.json +5 -5
  197. package/dist/chunk-027meh1k.js +0 -2
  198. package/dist/chunk-0hs633pt.js +0 -2
  199. package/dist/chunk-0j8zre1m.js +0 -2
  200. package/dist/chunk-0v02qms8.js +0 -2
  201. package/dist/chunk-0z9gttw0.js +0 -2
  202. package/dist/chunk-11dwmcpy.js +0 -3
  203. package/dist/chunk-1a237qky.js +0 -33
  204. package/dist/chunk-1ehjzhnc.js +0 -25
  205. package/dist/chunk-1gfg6qmr.js +0 -2
  206. package/dist/chunk-1kgnk6ds.js +0 -2
  207. package/dist/chunk-1ztp5vkh.js +0 -3
  208. package/dist/chunk-32wvc376.js +0 -2
  209. package/dist/chunk-3k2d2jsn.js +0 -2
  210. package/dist/chunk-3te2y9qf.js +0 -2
  211. package/dist/chunk-40330tm5.js +0 -2
  212. package/dist/chunk-447jc6zc.js +0 -2
  213. package/dist/chunk-4dk6k0ad.js +0 -2
  214. package/dist/chunk-4e48zkq0.js +0 -2
  215. package/dist/chunk-5ep7p8te.js +0 -2
  216. package/dist/chunk-5gx403te.js +0 -1184
  217. package/dist/chunk-6q9a5bph.js +0 -2
  218. package/dist/chunk-7ds9mx4c.js +0 -2
  219. package/dist/chunk-7njy024g.js +0 -2
  220. package/dist/chunk-7tjewwmd.js +0 -2
  221. package/dist/chunk-85xabvtj.js +0 -2
  222. package/dist/chunk-880f8j99.js +0 -2
  223. package/dist/chunk-8f3dbthj.js +0 -2
  224. package/dist/chunk-99e3mxnn.js +0 -20
  225. package/dist/chunk-9gv847nn.js +0 -2
  226. package/dist/chunk-9mz2n39m.js +0 -2
  227. package/dist/chunk-akthsg33.js +0 -54
  228. package/dist/chunk-b1tcym2x.js +0 -2
  229. package/dist/chunk-bdh73gxd.js +0 -4
  230. package/dist/chunk-bspj1rf1.js +0 -2
  231. package/dist/chunk-bx3hpsxn.js +0 -2
  232. package/dist/chunk-byq488g4.js +0 -2
  233. package/dist/chunk-c4s25bm2.js +0 -2
  234. package/dist/chunk-csjqtzwc.js +0 -2
  235. package/dist/chunk-df78j74w.js +0 -4
  236. package/dist/chunk-dgs3d367.js +0 -2
  237. package/dist/chunk-dmf6zcf4.js +0 -2
  238. package/dist/chunk-dv56x3g8.js +0 -16
  239. package/dist/chunk-e2b2f502.js +0 -2
  240. package/dist/chunk-ec6mrad6.js +0 -2
  241. package/dist/chunk-eecctzgp.js +0 -17
  242. package/dist/chunk-fa57bncd.js +0 -2
  243. package/dist/chunk-g4eheg0t.js +0 -24
  244. package/dist/chunk-gfe1jrw9.js +0 -2
  245. package/dist/chunk-gn16yq49.js +0 -2
  246. package/dist/chunk-gvs61tqn.js +0 -2
  247. package/dist/chunk-h2928108.js +0 -2
  248. package/dist/chunk-hat353vx.js +0 -2
  249. package/dist/chunk-jmjgj3nh.js +0 -2
  250. package/dist/chunk-jqtpzzz4.js +0 -12
  251. package/dist/chunk-jvy7z3hz.js +0 -3
  252. package/dist/chunk-k9dne5by.js +0 -12
  253. package/dist/chunk-kq8mffgf.js +0 -2
  254. package/dist/chunk-kx06jzdw.js +0 -2
  255. package/dist/chunk-n5pvdrkb.js +0 -2
  256. package/dist/chunk-ne8q191s.js +0 -2
  257. package/dist/chunk-np8wgbsa.js +0 -3
  258. package/dist/chunk-nthw4dca.js +0 -2
  259. package/dist/chunk-pp99rmjm.js +0 -72
  260. package/dist/chunk-pqmjeea6.js +0 -2
  261. package/dist/chunk-qggwr60r.js +0 -2
  262. package/dist/chunk-qm3v4qb7.js +0 -2
  263. package/dist/chunk-qty0t69x.js +0 -2
  264. package/dist/chunk-rjv6885r.js +0 -2
  265. package/dist/chunk-rm5gbthk.js +0 -2
  266. package/dist/chunk-sgengtap.js +0 -2
  267. package/dist/chunk-snz2cxqv.js +0 -2
  268. package/dist/chunk-szp7ajfm.js +0 -33
  269. package/dist/chunk-ts37jw3s.js +0 -2
  270. package/dist/chunk-v4emesnw.js +0 -2
  271. package/dist/chunk-vnrbjbrw.js +0 -3
  272. package/dist/chunk-vxra53wq.js +0 -2
  273. package/dist/chunk-x76qvq1n.js +0 -2
  274. package/dist/chunk-x85z6dmw.js +0 -2
  275. package/dist/chunk-xkfe03y9.js +0 -2
  276. package/dist/chunk-y4hn1qh0.js +0 -2
  277. package/dist/chunk-yc8ggeh2.js +0 -2
  278. package/dist/chunk-yfed67yc.js +0 -2
@@ -1,8 +1,8 @@
1
1
  // @bun
2
- import d from"fs";import l from"path";function Ml(n){let s=[],e=n.pwa;if(s.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:e?.enabled===!0,message:e?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!e?.enabled)return s;s.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(e.manifest?.name),message:e.manifest?.name?`App name: "${e.manifest.name}"`:"Missing required manifest name"}),s.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(e.manifest?.shortName),message:e.manifest?.shortName?`Short name: "${e.manifest.shortName}"`:"Short name not set (will use full name)"}),s.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(e.manifest?.description),message:e.manifest?.description?"Description is set":"App description not provided"}),s.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(e.manifest?.themeColor),message:e.manifest?.themeColor?`Theme color: ${e.manifest.themeColor}`:"Theme color not set"}),s.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(e.manifest?.backgroundColor),message:e.manifest?.backgroundColor?`Background color: ${e.manifest.backgroundColor}`:"Background color not set"}),s.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(e.manifest?.display||""),message:e.manifest?.display?`Display mode: ${e.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),s.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(e.manifest?.startUrl),message:e.manifest?.startUrl?`Start URL: ${e.manifest.startUrl}`:"Start URL not set"}),s.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(e.icons?.src),message:e.icons?.src?`Icon source: ${e.icons.src}`:"No icon source configured"});let a=e.icons?.sizes||[];s.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:a.includes(192),message:a.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),s.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:a.includes(512),message:a.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),s.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:e.icons?.purpose?.includes("maskable")||!1,message:e.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),s.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(e.serviceWorker),message:e.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),s.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(e.serviceWorker?.cacheVersion),message:e.serviceWorker?.cacheVersion?`Cache version: ${e.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),s.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:e.offline?.enabled===!0,message:e.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let t=e.routes||[];return s.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:t.length>0,message:t.length>0?`${t.length} route caching strategies configured`:"No custom caching strategies defined"}),s.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!e.push?.enabled||Boolean(e.push?.vapidPublicKey),message:e.push?.enabled?e.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),s.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:e.shareTarget?.enabled?`Share target enabled at ${e.shareTarget.action}`:"Share target not enabled"}),s.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:e.autoInject!==!1,message:e.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),s}function Ll(n){let s=[],e=l.join(n,"manifest.json"),a=d.existsSync(e);if(s.push({id:"build-manifest",name:"Manifest File",category:"required",passed:a,message:a?"manifest.json exists":"manifest.json not found in build output"}),a)try{let r=JSON.parse(d.readFileSync(e,"utf-8"));s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),s.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(r.icons)&&r.icons.length>0,message:r.icons?.length?`${r.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let t=l.join(n,"sw.js"),c=d.existsSync(t);s.push({id:"build-sw",name:"Service Worker File",category:"required",passed:c,message:c?"Service worker (sw.js) exists":"Service worker not found in build output"});let o=l.join(n,"offline.html"),u=d.existsSync(o);s.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:u,message:u?"Offline page exists":"No offline.html found"});let i=l.join(n,"pwa-icons");if(d.existsSync(i)){let r=d.readdirSync(i).filter((m)=>m.endsWith(".png")||m.endsWith(".webp"));s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:r.length>0,message:r.length>0?`${r.length} icon files generated`:"No icon files found"})}else s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return s}function jl(n){let s=n.filter((i)=>i.category==="required"),e=n.filter((i)=>i.category==="recommended"),a=s.filter((i)=>i.passed).length,t=e.filter((i)=>i.passed).length,c=s.length>0?a/s.length*70:70,o=e.length>0?t/e.length*30:30;return{score:Math.round(c+o),passed:n.filter((i)=>i.passed).length,failed:n.filter((i)=>!i.passed&&i.category==="required").length,warnings:n.filter((i)=>!i.passed&&i.category!=="required").length,checks:n}}function zg(n,s){let e=Ml(n),a=s&&d.existsSync(s)?Ll(s):[];return jl([...e,...a])}function Hg(n){let s=[];s.push(`
2
+ import d from"fs";import l from"path";function ql(n){let s=[],e=n.pwa;if(s.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:e?.enabled===!0,message:e?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!e?.enabled)return s;s.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(e.manifest?.name),message:e.manifest?.name?`App name: "${e.manifest.name}"`:"Missing required manifest name"}),s.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(e.manifest?.shortName),message:e.manifest?.shortName?`Short name: "${e.manifest.shortName}"`:"Short name not set (will use full name)"}),s.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(e.manifest?.description),message:e.manifest?.description?"Description is set":"App description not provided"}),s.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(e.manifest?.themeColor),message:e.manifest?.themeColor?`Theme color: ${e.manifest.themeColor}`:"Theme color not set"}),s.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(e.manifest?.backgroundColor),message:e.manifest?.backgroundColor?`Background color: ${e.manifest.backgroundColor}`:"Background color not set"}),s.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(e.manifest?.display||""),message:e.manifest?.display?`Display mode: ${e.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),s.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(e.manifest?.startUrl),message:e.manifest?.startUrl?`Start URL: ${e.manifest.startUrl}`:"Start URL not set"}),s.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(e.icons?.src),message:e.icons?.src?`Icon source: ${e.icons.src}`:"No icon source configured"});let a=e.icons?.sizes||[];s.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:a.includes(192),message:a.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),s.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:a.includes(512),message:a.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),s.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:e.icons?.purpose?.includes("maskable")||!1,message:e.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),s.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(e.serviceWorker),message:e.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),s.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(e.serviceWorker?.cacheVersion),message:e.serviceWorker?.cacheVersion?`Cache version: ${e.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),s.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:e.offline?.enabled===!0,message:e.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let t=e.routes||[];return s.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:t.length>0,message:t.length>0?`${t.length} route caching strategies configured`:"No custom caching strategies defined"}),s.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!e.push?.enabled||Boolean(e.push?.vapidPublicKey),message:e.push?.enabled?e.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),s.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:e.shareTarget?.enabled?`Share target enabled at ${e.shareTarget.action}`:"Share target not enabled"}),s.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:e.autoInject!==!1,message:e.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),s}function Kl(n){let s=[],e=l.join(n,"manifest.json"),a=d.existsSync(e);if(s.push({id:"build-manifest",name:"Manifest File",category:"required",passed:a,message:a?"manifest.json exists":"manifest.json not found in build output"}),a)try{let r=JSON.parse(d.readFileSync(e,"utf-8"));s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),s.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(r.icons)&&r.icons.length>0,message:r.icons?.length?`${r.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let t=l.join(n,"sw.js"),c=d.existsSync(t);s.push({id:"build-sw",name:"Service Worker File",category:"required",passed:c,message:c?"Service worker (sw.js) exists":"Service worker not found in build output"});let o=l.join(n,"offline.html"),u=d.existsSync(o);s.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:u,message:u?"Offline page exists":"No offline.html found"});let i=l.join(n,"pwa-icons");if(d.existsSync(i)){let r=d.readdirSync(i).filter((m)=>m.endsWith(".png")||m.endsWith(".webp"));s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:r.length>0,message:r.length>0?`${r.length} icon files generated`:"No icon files found"})}else s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return s}function Gl(n){let s=n.filter((i)=>i.category==="required"),e=n.filter((i)=>i.category==="recommended"),a=s.filter((i)=>i.passed).length,t=e.filter((i)=>i.passed).length,c=s.length>0?a/s.length*70:70,o=e.length>0?t/e.length*30:30;return{score:Math.round(c+o),passed:n.filter((i)=>i.passed).length,failed:n.filter((i)=>!i.passed&&i.category==="required").length,warnings:n.filter((i)=>!i.passed&&i.category!=="required").length,checks:n}}function Jg(n,s){let e=ql(n),a=s&&d.existsSync(s)?Kl(s):[];return Gl([...e,...a])}function Yg(n){let s=[];s.push(`
3
3
  === PWA Audit Report ===
4
4
  `);let e=n.score>=90?"32":n.score>=70?"33":"31";s.push(`Score: \x1B[${e}m${n.score}/100\x1B[0m`),s.push(`Passed: ${n.passed} | Failed: ${n.failed} | Warnings: ${n.warnings}
5
5
  `);let a=["required","recommended","optional"];for(let t of a){let c=n.checks.filter((o)=>o.category===t);if(c.length===0)continue;s.push(`
6
6
  ${t.toUpperCase()}:`);for(let o of c){let u=o.passed?"\x1B[32m\u2713\x1B[0m":"\x1B[31m\u2717\x1B[0m";if(s.push(` ${u} ${o.name}: ${o.message}`),o.details)s.push(` ${o.details}`)}}return s.push(""),s.join(`
7
7
  `)}
8
- export{Ml,Ll,jl,zg,Hg};
8
+ export{ql,Kl,Gl,Jg,Yg};
@@ -0,0 +1,54 @@
1
+ // @bun
2
+ import{d,m,N,p,ee}from"./chunk-86nsbxep.js";import{T}from"./chunk-s29hp1qw.js";import{G,Ws,Ue,j,Ht,Dr,Ge,Xe,s,y,Oe,P}from"./chunk-njza56wn.js";import{wt}from"./chunk-00tq7ghn.js";import{M}from"./chunk-hxhmhw23.js";import{fe}from"./chunk-t94y8g35.js";import{U,ct}from"./chunk-care745q.js";import{I,Ln}from"./chunk-ws2h92mm.js";import A from"path";import{existsSync as ye}from"fs";function ae(c,e){let a=0;for(let r=e;r<c.length;r++){let b=c[r];if(b==="("||b==="["||b==="{")a++;else if(b===")"||b==="]"||b==="}")a--;else if(b===","&&a===0)return r}return-1}function $e(c,e,a){let r=c,b=new RegExp(`${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),n=b.exec(r);while(n){let u=n.index,t=u+n[0].length-1,C=1,W=t+1;while(W<r.length&&C>0){if(r[W]==="(")C++;else if(r[W]===")")C--;W++}if(C!==0)break;let ie=r.substring(t+1,W-1),B=`${a}(${ie})`;r=r.substring(0,u)+B+r.substring(W),b.lastIndex=u+B.length,n=b.exec(r)}return r}function Ee(c){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test(c)}function he(c){let e=c,a=[],r=new Set,b=0,n=0,u=e.length,t=(B)=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]===B){n++;return}n++}},C=()=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]==="`"){n++;return}if(e[n]==="$"&&e[n+1]==="{"){n+=2;let B=1;while(n<u&&B>0)if(e[n]==="{")B++,n++;else if(e[n]==="}")B--,n++;else if(e[n]==="'"||e[n]==='"')t(e[n]);else if(e[n]==="`")C();else n++;continue}n++}},W=()=>{if(e[n]==="/"&&e[n+1]==="/"){while(n<u&&e[n]!==`
3
+ `)n++;return!0}if(e[n]==="/"&&e[n+1]==="*"){n+=2;while(n<u-1&&!(e[n]==="*"&&e[n+1]==="/"))n++;return n+=2,!0}return!1},ie=()=>{if(b!==0)return;let B=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(B){let H=B[2];if(!r.has(H))a.push(H),r.add(H);return}let se=e.slice(n).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(se){let H=se[1];if(!r.has(H))a.push(H),r.add(H);return}let Y=e.slice(n).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Y){let H=Y[1];if(!r.has(H))a.push(H),r.add(H)}};while(n<u){if(W())continue;if(e[n]==="'"||e[n]==='"'){t(e[n]);continue}if(e[n]==="`"){C();continue}if(e[n]==="{"){b++,n++;continue}if(e[n]==="}"){b--,n++;continue}if(b===0&&/[a-z]/i.test(e[n])&&(n===0||/\s|[;{}()]/.test(e[n-1])))ie();n++}return a.join(", ")}function ve(c,e=""){let a=he(c).split(",").map((r)=>r.trim()).filter(Boolean);return`
4
+ (function() {
5
+ ${wt("var",a)}
6
+ var __destroyHooks = [];
7
+ var __origOnDestroy = onDestroy;
8
+ onDestroy = function(fn) { __origOnDestroy(fn); __destroyHooks.push(fn); };
9
+
10
+ ${c}
11
+ ${e}})();
12
+ `}function Re(c,e){let r=he(c).split(",").map((u)=>u.trim()).filter(Boolean),b=new Set(G(c,!0).split(",").map((u)=>u.trim())),n=r.map((u)=>b.has(u)?` try { ${u}; Object.defineProperty(__scopeRegistration, ${JSON.stringify(u)}, ${Ws(u)}); } catch (e) { /* not actually top-level */ }`:` try { __scopeRegistration[${JSON.stringify(u)}] = ${u}; } catch (e) { /* not actually top-level */ }`).join(`
13
+ `);return`
14
+ // Register scope variables for STX runtime
15
+ if (!window.stx._scopes) window.stx._scopes = {};
16
+ var __scopeRegistration = window.stx._scopes['${e}'] || { __destroyCallbacks: __destroyHooks };
17
+ ${n}
18
+ // #1767: when the bundler renamed a component const that collided with an
19
+ // inlined import (foo -> foo2), rebind the ORIGINAL template name to the
20
+ // renamed declaration so it resolves to the component's value, not the
21
+ // shadowing import. __stxScopeRenames is emitted by bundleClientScript.
22
+ try { if (typeof __stxScopeRenames !== 'undefined' && __stxScopeRenames) { for (var __stxRK in __stxScopeRenames) __scopeRegistration[__stxRK] = __stxScopeRenames[__stxRK]; } } catch (e) { /* no renames */ }
23
+ if (typeof __stxLiveBindings !== 'undefined') Object.defineProperties(__scopeRegistration, Object.getOwnPropertyDescriptors(__stxLiveBindings));
24
+ window.stx._scopes['${e}'] = __scopeRegistration;
25
+ `}function ke(c,e){return c.replace(/<script data-stx-scoped data-stx-run="always" data-stx-owner="([^"]*)"/g,(a,r)=>r===e?a:'<script data-stx-scoped data-stx-run="always"')}function ge(c,e){let a=Re(c,e);return Ie(ve(c,a),e)}function Ie(c,e){let a=`
26
+ (function() {
27
+ var __stxScopeEl = (typeof document !== 'undefined') ? document.querySelector('[data-stx-scope="${e}"]') : null;
28
+ var __stxPrevEl = (typeof window !== 'undefined') ? window.__STX_CURRENT_ELEMENT__ : undefined;
29
+ if (__stxScopeEl && typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxScopeEl;
30
+ if (__stxScopeEl && typeof window !== 'undefined' && window.stx) {
31
+ if (!window.stx._scopes) window.stx._scopes = {};
32
+ window.stx._scopes['${e}'] = {};
33
+ }
34
+ var __stxEndEffects = (typeof window !== 'undefined' && window.stx && window.stx._beginEffects) ? window.stx._beginEffects() : null;
35
+ try {`,r=`
36
+ } finally {
37
+ // The body's effects end where its onDestroy callbacks run: with the scope
38
+ // when the partial has a root, with the page when it has none.
39
+ if (__stxEndEffects) {
40
+ var __stxDisposeEffects = __stxEndEffects();
41
+ var __stxRegistered = __stxScopeEl && window.stx._scopes && window.stx._scopes['${e}'];
42
+ if (__stxRegistered) __stxRegistered.__disposeEffects = __stxDisposeEffects;
43
+ else if (window.stx._destroyCallbacks) window.stx._destroyCallbacks.push(__stxDisposeEffects);
44
+ }
45
+ if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
46
+ }
47
+ })();`;return a+c+r}function Me(c,e){if(U(c)){let n=U(c).tag.match(/data-stx-scope="([^"]*)"/);if(n)return{html:c,mergedIntoExisting:n[1],stamped:!0,root:"body"};return{html:ct(c,(u,t)=>`<body${t} data-stx-scope="${e}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let a=Ht(c),r=c.slice(a).match(/^(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(r){let b=r[1]+r[2],n=r[1].slice(1),u=b.match(/data-stx-scope="([^"]*)"/);if(u)return{html:c,mergedIntoExisting:u[1],stamped:!0,root:n};let t=c.slice(0,a),C=r[1],W=r[2];return{html:`${t}${C} data-stx-scope="${e}"${W}${c.slice(a+r[0].length)}`,mergedIntoExisting:null,stamped:!0,root:n}}return{html:c,mergedIntoExisting:null,stamped:!1,root:null}}var Te=0;function ue(c,e){let a=A.basename(c,".stx").replace(/[^a-zA-Z0-9]/g,"_"),r=e.__stx_scope_seq;return r?`stx_scope_${a}_${++r.n}_${r.key}`:`stx_scope_${a}_${++Te}`}var le=new Set,pe=new Set;function sy(){le.clear(),pe.clear()}var Ae=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function ag(c){let e=(t)=>t.replace(/[^\n]/g," "),a=c.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,e).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,e).replace(/<!--[\s\S]*?-->/g,e).replace(/\x00STX_HTML_COMMENT_\d+\x00/g,e).replace(/\{\{[\s\S]*?\}\}/g,e).replace(/\{!![\s\S]*?!!\}/g,e),r=[],b=0,n=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,u;while((u=n.exec(a))!==null){let t=u[1]==="/",C=u[2],W=u[3]==="/"||Ae.has(C.toLowerCase());if(t){b=Math.max(0,b-1);continue}if(b===0)r.push(C);if(!W)b++}return r}function me(c){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(c)}var at=new T(500),Ac=new Set;function oy(){Ac.clear()}function Ce(c){if(c.__onceStore instanceof Set)return c.__onceStore;return Ac}async function xs(c,e,a,r,b,n=new Set){let u=r.partialsDir||A.join(A.dirname(a),"partials");if(u&&!A.isAbsolute(u))u=A.resolve(process.cwd(),u);let t=$e(c,"@partial","@include"),C=Ce(e);t=t.replace(/@once([\s\S]*?)@endonce/g,(f,v,h)=>{let g=v.trim(),i=`${a}:${g}`;if(C.has(i))return"";return C.add(i),v});{let f=/@includeIf\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")")i--;x++}if(i!==0)break;let l=t.substring(g+1,x-1),o=l.match(/^\s*['"]([^'"]+)['"]/);if(!o){f.lastIndex=x;continue}let D=o[1],z=W(D,u,a),E="";if(z&&await Bun.file(z).exists())b.add(z),E=`@include(${l})`;t=t.substring(0,h)+E+t.substring(x),f.lastIndex=0}}for(let[f,v]of[["@includeWhen",!1],["@includeUnless",!0]]){let h=new RegExp(`${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),g;while((g=h.exec(t))!==null){let i=g.index,x=i+g[0].length-1,l=1,o=x+1;while(o<t.length&&l>0){if(t[o]==="(")l++;else if(t[o]===")")l--;o++}if(l!==0)break;let D=t.substring(x+1,o-1),z=ae(D,0);if(z===-1){h.lastIndex=o;continue}let E=D.substring(0,z).trim(),V=D.substring(z+1).trim(),F=V.match(/^\s*['"]([^'"]+)['"]/);if(!F){h.lastIndex=o;continue}let _=F[1],q=V.substring(F[0].length),O,R=ae(q,0);if(R!==-1)O=q.substring(R+1).trim();try{let k=`Boolean(${E})`,L;if(m(k)){let oe=p(k,Object.keys(e));L=Boolean(oe(...Object.values(e)))}else L=Boolean(d(k,e));let te=v?!L:L,re="";if(te){let oe=W(_,u,a);if(oe&&await Bun.file(oe).exists())b.add(oe);re=`@include('${_}'${O?`, ${O}`:""})`}t=t.substring(0,i)+re+t.substring(o),h.lastIndex=0}catch(k){let L=k instanceof Error?k.message:String(k),te=y("Include",`Error evaluating ${f} condition: ${L}`,a,c,i);t=t.substring(0,i)+te+t.substring(o),h.lastIndex=0}}}{let f=/@each\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),D=l.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!D){f.lastIndex=0,t=t.replace(o,"");continue}let[,z,E,V,F]=D;try{let _,q=E.trim();if(m(q))_=p(q,Object.keys(e))(...Object.values(e));else _=d(q,e);let O="";if(Array.isArray(_)&&_.length>0)for(let R of _){let k={...e,[V]:R},L=await se(z,k,c,h);O+=L}else if(F)O=await se(F,{},c,h);t=t.substring(0,h)+O+t.substring(x+1),f.lastIndex=0}catch(_){let q=_ instanceof Error?_.message:String(_);t=t.substring(0,h)+y("Each",`Error in @each: ${q}`,a,c,h)+t.substring(x+1),f.lastIndex=0}}}{let f=/@includeFirst\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),D=l.match(/^\s*(\[[^\]]+\])/);if(!D){f.lastIndex=0,t=t.replace(o,"");continue}let z=D[1],E=l.slice(D[0].length),V,F=E.match(/^\s*,\s*\{/);if(F){E=E.slice(F[0].length-1);let O=1,R=1;while(R<E.length&&O>0){if(E[R]==="{")O++;else if(E[R]==="}"){if(O--,O===0)break}R++}V=E.substring(0,R+1),E=E.slice(R+1)}let _,q=E.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(q)_=q[1];try{let O=JSON.parse(z.replace(/'/g,'"')),R={};if(V)try{R=N(V,e)}catch(L){let te=L instanceof Error?L.message:String(L);if(r.debug){let re=y("Include",`Error parsing includeFirst variables: ${te}`,a,c,h,o);t=t.replace(o,()=>re)}else t=t.replace(o,()=>_||"");continue}let k=!1;for(let L of O){let te=W(L,u,a);if(!te)continue;if(await s(te)){let re=await se(L,R,c,h);t=t.replace(o,()=>re),k=!0;break}}if(!k)if(_!==void 0)t=t.replace(o,()=>_);else if(r.debug){let L=y("Include",`None of the includeFirst paths exist: ${z}`,a,c,h,o);t=t.replace(o,()=>L)}else t=t.replace(o,"")}catch(O){let R=O instanceof Error?O.message:String(O),k=y("Include",`Error processing @includeFirst: ${R}`,a,c,h,o);t=t.replace(o,()=>k)}f.lastIndex=0}}function W(f,v,h){try{let g=f;if(!f.endsWith(".stx"))g=`${f}.stx`;let i=A.resolve(v),x=A.resolve(A.dirname(h)),l;if(!g.startsWith("./")&&!g.startsWith("../")){for(let F of r._layerPartialDirs??[]){let _=A.resolve(F,g);if(_.startsWith(`${A.resolve(F)}${A.sep}`)&&ye(_))return _}l=A.resolve(v,g)}else l=A.resolve(x,g);let o=A.normalize(l),D=o.startsWith(i+A.sep)||o===i,z=o.startsWith(x+A.sep)||o===x,E=!1,V=A.dirname(x);if(o.startsWith(V+A.sep)){if(!A.relative(V,o).split(A.sep).some((O)=>O.startsWith(".")&&O!=="."&&O!==".."))E=!0}if(!D&&!z&&!E)return console.error(`Security: Path traversal attempt blocked for include path: ${f}`),console.error(` Resolved to: ${o}`),console.error(` Allowed dirs: ${i}, ${x}`),null;return o}catch(g){return console.error(`Error resolving path ${f}: ${g}`),null}}let ie=A.resolve(a);n.add(ie);function B(f,v,h,g){return r.onIncludeError?.({includePath:f,templatePath:a,message:v,partialsDir:u}),y("Include",v,a,h,g)}async function se(f,v={},h,g){let i=W(f,u,a);if(!i)return B(f,`Could not resolve path for include: ${f}`,h,g);let x=A.resolve(i);if(n.has(x)){let l=[...n,x].map((o)=>A.basename(o)).join(" -> ");return B(f,`Circular include detected: ${l}`,h,g)}try{b.add(i);let l;if(!l)try{l=await Bun.file(i).text()}catch(S){let K=S instanceof Error?S.message:String(S);return B(f,`Error loading include file ${f}: ${K}`,h,g)}if(l)l=l.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(l&&l.includes("@stream")){let{processStreamDirectives:S}=await import("./chunk-v8ea76j6.js");l=S(l,e)}if(l&&(r.debug||!I()&&!Ln()))try{let{warnUnbalancedTags:S}=await import("./chunk-w5zzwe2f.js");S(l,i)}catch{}try{let{processESImports:S}=await import("./chunk-q1jjgg4w.js");l=await S(l,e,i,r,b)}catch(S){if(r.debug)console.warn(`[stx] partial ES import extraction skipped for ${i}:`,S instanceof Error?S.message:S)}let o=l,D=j(o);if(D)o=D.content.trim();let E=l.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),V="";if(E)V=`<style${E[1]}>${E[2]}</style>`;let F=[];o=o.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(S,K,w)=>{if(!me(K))return"";return F.push({attrs:K,body:w}),`__STX_DATA_BLOCK_${F.length-1}__`}),o=o.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let _={...e};_.__stx_signals_gate=Oe(l,i);for(let[S,K]of Object.entries(v))_[S]=K;let q=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,O=[...l.matchAll(q)].sort((S,K)=>{let w=(S[1]||"").includes("server"),X=(K[1]||"").includes("server");return Number(X)-Number(w)}),R="",k=null,L=!1,te=!1;for(let S of O){let K=S[1]||"",w=S[2]||"";if(me(K))continue;let X=K.includes("server"),be=Ge(K);if(!X&&!/\bsrc\s*=/i.test(K))Ue(w,i,r.strict);if(!X&&w.trim()){let{interpolateScriptExpressions:Z}=await import("./chunk-gs6geqeg.js");w=Z(w,_,f)}let ce="";try{let{extractAndStripCssImports:Z,renderVendorStyleTags:Q}=await import("./chunk-v5cah9pt.js"),ne=Z(w,{filePath:i,projectRoot:process.cwd()});w=ne.code,ce=Q(ne.styles)}catch(Z){if(r.debug)console.warn(`[stx] vendor-css extractor skipped for ${i}:`,Z instanceof Error?Z.message:Z)}if(be&&w.trim())w=Xe(w);if(!X){try{let{injectBrowserCoreAutoImports:Q}=await import("./chunk-v5cah9pt.js");w=Q(w).code;let{hasUserImports:ne,bundleClientScript:Se}=await import("./chunk-95j7y1rt.js");if(ne(w))w=await Se(w,i,{projectRoot:process.cwd()})}catch(Q){if(r.debug)console.warn(`[stx] bundler skipped for ${i}:`,Q instanceof Error?Q.message:Q)}let{stripStxRuntimeImports:Z}=await import("./chunk-my3yv4sg.js");w=Z(w)}let de=Ee(w);if(!X){let{extractBridgeData:Z,generateServerDataBridge:Q}=await import("./chunk-v5cah9pt.js"),ne=Q(w,Z(_));if(ne)w=`${ne}
48
+ ${w}`}if(de&&!X){L=!0,k=ue(i,e);let Z=M(w),Q=ge(Z,k);R+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${k}">${Q}</script>
49
+ `;continue}if(X)try{let{extractVariables:Z}=await import("./chunk-k52126rh.js");await Z(w,_,i)}catch(Z){if(r.debug)console.warn(`Warning: Could not extract variables from server script in ${i}:`,Z)}if(!X&&!de){let Z=K.replace(/\bclient\b/i,"").trim();k=ue(i,e);let Q=M(w),ne=ge(Q,k);if(/__scopeRegistration\["(?!__stx)[^"]+"\]\s*=|Object\.defineProperty\(__scopeRegistration, "(?!__stx)/.test(ne))te=!0;R+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${k}"${Z?` ${Z}`:""}>${ne}</script>
50
+ `}}if(F.length>0){let{interpolateScriptExpressions:S}=await import("./chunk-gs6geqeg.js");o=o.replace(/__STX_DATA_BLOCK_(\d+)__/g,(K,w)=>{let X=F[Number(w)];return`<script${X.attrs}>${S(X.body,_,f)}</script>`})}if(k){let S=Me(o,k);if(o=S.html,S.mergedIntoExisting){let w=k,X=S.mergedIntoExisting;R=R.split(`'${w}'`).join(`'${X}'`).split(`"${w}"`).join(`"${X}"`),k=X}else if(!S.stamped&&L&&!le.has(i))le.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`);if(S.stamped&&S.root!=="body"&&(L||te)&&!pe.has(i)){let w=ag(o);if(w.length>1)pe.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares ${L?"signals":"bindings"} and has ${w.length} top-level elements (${w.map((X)=>`<${X}>`).join(", ")}). Only the first is scoped, so bindings in the others cannot see what this partial's script declares. Wrap the partial's markup in a single root element.`)}let K=S.stamped&&S.root!==null&&Dr(S.root);R=ke(R,K?k:null)}if(o.includes("@include")||o.includes("@partial"))o=await xs(o,_,i,r,b,n);let{processLoops:re,reportDeferredLoopWarnings:oe}=await import("./chunk-nj1ssjtd.js"),J=re(o,_,i,void 0,!0);J=fe(J,_,i),J=oe(J);let{processMetaDirectives:xe,processSeoDirective:_e,processStructuredData:we}=await import("./chunk-78zgmqhd.js");if(J=xe(J,_,i,r),J=we(J,_,i),J=_e(J,_,i,r),J=P(J,_,i),V)J+=`
51
+ `+V;if(R)J+=`
52
+ `+R;return J}catch(l){if(l instanceof ee)throw l;let o=l instanceof Error?l.message:String(l);return B(f,`Error processing include ${f}: ${o}`,h,g)}}let Y=/@include\s*\(/g,H;while((H=Y.exec(t))!==null){let f=H.index,v=f+H[0].length-1,h=1,g=v+1;while(g<t.length&&h>0){if(t[g]==="(")h++;else if(t[g]===")")h--;g++}if(h!==0)break;let i=t.substring(f,g),x=t.substring(v+1,g-1),l=x.match(/^\s*['"]([^'"]+)['"]/);if(!l){Y.lastIndex=g;continue}let o=l[1],D,z=x.substring(l[0].length),E=ae(z,0);if(E!==-1)D=z.substring(E+1).trim();let V={};if(D)try{V=N(D,e)}catch(_){let q=_ instanceof Error?_.message:String(_);t=t.replace(i,y("Include",`Error parsing include variables for ${o}: ${q}`,a,c,f)),Y.lastIndex=0;continue}let F=await se(o,V,c,f);t=t.substring(0,f)+F+t.substring(g),Y.lastIndex=0}return t}function Ss(c,e){let a=c;function r(b,n,u,t){let C=b,W=!0;while(W){W=!1;let ie=new RegExp(`@${n}\\(['"]([^'"]+)['"]\\)`),B=C.match(ie);if(!B||B.index===void 0)break;let se=B.index,Y=B[1],H=se+B[0].length,f=new RegExp(`@${n}\\(`),v=new RegExp(`@${u}(?![a-z])`),h=1,g=H,i=-1;while(h>0&&g<C.length){let l=C.slice(g),o=l.match(f),D=l.match(v),z=o?g+o.index:1/0,E=D?g+D.index:1/0;if(z<E)h++,g=z+(o[0].length||1);else if(E<1/0){if(h--,h===0){i=E;break}g=E+u.length+1}else break}if(i===-1)break;let x=C.slice(H,i);if(!e[Y])e[Y]=[];if(t)e[Y].unshift(x);else e[Y].push(x);C=C.substring(0,se)+C.substring(i+`@${u}`.length),W=!0}return C}return a=r(a,"push","endpush",!1),a=r(a,"prepend","endprepend",!0),a}function ks(c,e){return c.replace(/@stack\(['"]([^'"]+)['"]\)/g,(a,r)=>{if(!e[r]||e[r].length===0)return"";return e[r].join(`
53
+ `)})}
54
+ export{sy,ag,at,Ac,oy,xs,Ss,ks};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{wn,Go,Xo,Jo,ey,Yo}from"./chunk-45jpwbzd.js";import"./chunk-ssg6ne5b.js";import"./chunk-agd2b928.js";import"./chunk-6t04tqvh.js";export{Xo as buildServerApi,ey as createServerApi,wn as discoverServerApi,Go as generateApiTypes,Yo as isServerApiSource,Jo as productionApiDispatcher};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- function Tc(){return`
2
+ function Mc(){return`
3
3
  (function(){
4
4
  var tip=null,hideTimer=null,currentEl=null;
5
5
 
@@ -103,4 +103,4 @@ document.addEventListener("focusout",function(e){
103
103
  });
104
104
  })();
105
105
  `}
106
- export{Tc};
106
+ export{Mc};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{bu}from"./chunk-gbncp2gp.js";export{bu as rewriteImagesWithSiblings};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{gu,Um,mu,hu,Wm,qm}from"./chunk-m91jj8nq.js";import"./chunk-njza56wn.js";import"./chunk-yffqfgjx.js";import"./chunk-6t04tqvh.js";import"./chunk-86nsbxep.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{qm as applySlots,Wm as extractSlotContent,Um as parseSlotElement,gu as parseSlots,hu as processSlots,mu as renderSlot};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Fa,Ou,Qn,ah,Nu,Mu,Du,ch}from"./chunk-pm27mcfp.js";import"./chunk-njza56wn.js";import"./chunk-yffqfgjx.js";import"./chunk-6t04tqvh.js";import"./chunk-86nsbxep.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{Qn as Validator,Ou as defineForm,Nu as processErrorDirective,Mu as processErrorsDirective,ch as processFormValidationDirectives,Du as processHasErrorsDirective,Fa as useForm,ah as v};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ti,ni,ri,iy,_s,ay}from"./chunk-345waetq.js";export{_s as clearImageDeliveryCatalog,iy as deliveredImage,ri as efficientDeliverySources,ti as getImageDelivery,ni as isTransparentImage,ay as prepareImageDelivery};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{vh,xh}from"./chunk-8e1cv1hh.js";export{xh as ensureTeleportTargets,vh as processTeleportDirectives};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function Xt(){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" \uD83D\uDCD6 STX Story ")+c("\u2551")),console.log(c(" \u2551")+m(" Component Showcase & Testing ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function fo(e,t){if(console.log(a(" Server running at:")),console.log(""),console.log(` ${m("\u279C")} ${a("Local:")} ${c(e)}`),t)console.log(` ${m("\u279C")} ${a("Network:")} ${c(t)}`);console.log("")}function Jt(e){let t=e>0?"\u2713":"\u25CB",r=e>0?S:y;console.log(` ${r(t)} Found ${a(String(e))} story ${e===1?"file":"files"}`)}function ia(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function gt(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function aa(e){console.log(` ${O("\u2139")} ${e}`)}function ca(e,t,r){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" Build Complete ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(""),console.log(` ${S("\u2713")} Stories: ${a(String(e))}`),console.log(` ${S("\u2713")} Output: ${a(t)}`),console.log(` ${S("\u2713")} Time: ${a(`${r}ms`)}`),console.log("")}function go(){console.log(""),console.log(a(" Keyboard Shortcuts:")),console.log(""),console.log(` ${c("h")} Show this help`),console.log(` ${c("o")} Open in browser`),console.log(` ${c("r")} Restart server`),console.log(` ${c("c")} Clear console`),console.log(` ${c("q")} Quit`),console.log("")}import h from"fs";import d from"path";async function Yt(e){let{root:t,config:r}=e,o=[],i=await P(t,r.storyMatch,r.storyIgnored);for(let s of i){let n=d.resolve(t,s),l=v(s,n);o.push(l)}return o}async function P(e,t,r){let o=[];async function i(s,n){let l=await h.promises.readdir(s,{withFileTypes:!0});for(let g of l){let f=d.join(s,g.name),u=d.relative(n,f);if(T(u,r))continue;if(g.isDirectory())await i(f,n);else if(g.isFile()){if(F(u,t))o.push(u)}}}return await i(e,e),o}function T(e,t){for(let r of t)if(E(e,r))return!0;return!1}function F(e,t){for(let r of t)if(E(e,r))return!0;return!1}function E(e,t){let r=e.replace(/\\/g,"/"),i=t.replace(/\\/g,"/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"{{GLOBSTAR}}").replace(/\*/g,"[^/]*").replace(/\?/g,".").replace(/\{\{GLOBSTAR\}\}/g,".*");return i=`^${i}$`,new RegExp(i).test(r)}function v(e,t){let r=d.basename(e,".story.stx");return{id:e.toLowerCase().replace(/\.story\.stx$/,"").replace(/[/\\]/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),path:t,relativePath:e,fileName:r,treeFile:{title:r,path:e}}}function la(e,t){let{root:r,config:o}=e,i=[],s=h.watch(r,{recursive:!0},async(n,l)=>{if(!l)return;let g=l.replace(/\\/g,"/");if(!F(g,o.storyMatch))return;if(T(g,o.storyIgnored))return;let f=d.resolve(r,g);try{await h.promises.access(f);let u=v(g,f);t(n==="rename"?"add":"change",u)}catch{let u=v(g,f);t("unlink",u)}});return i.push(s),()=>{for(let n of i)n.close()}}function N(e,t){let r=t.treeFile||{title:t.fileName,path:t.relativePath};if(e.tree.file==="title")return r.title.split("/");if(e.tree.file==="path")return[...t.relativePath.split("/").slice(0,-1),r.title];if(typeof e.tree.file==="function")return e.tree.file(r);return[r.title]}function Zt(e,t){for(let n of t)n.treePath=N(e,n);let r=(e.tree.groups||[]).map((n)=>({groupConfig:{id:n.id||n.title,title:n.title,include:n.include},treeObject:{}})),o={treeObject:{}};r.push(o);for(let n=0;n<t.length;n++){let l=t[n],g=j(l,r,o);k(l.treePath,n,g.treeObject)}let i=e.tree.order==="asc"?(n,l)=>n.localeCompare(l):e.tree.order,s=[];for(let n of r)if(n===o)s.push(...x(n.treeObject,i));else if(n.groupConfig&&Object.keys(n.treeObject).length>0)s.push({group:!0,id:n.groupConfig.id,title:n.groupConfig.title,children:x(n.treeObject,i)});return s}function j(e,t,r){let o=e.treeFile||{title:e.fileName,path:e.relativePath};for(let i of t)if(i.groupConfig?.include&&i.groupConfig.include(o))return i;return r}function k(e,t,r){let o=r;for(let i=0;i<e.length;i++){let s=e[i];if(i===e.length-1)if(o[s]!==void 0){let l=1;while(o[`${s}-${l}`]!==void 0)l++;o[`${s}-${l}`]=t}else o[s]=t;else{if(o[s]===void 0)o[s]={};else if(typeof o[s]==="number"){let l=o[s];o[s]={"":l}}o=o[s]}}}function x(e,t){let r=[];for(let[o,i]of Object.entries(e))if(typeof i==="number")r.push({title:o,index:i});else r.push({title:o,children:x(i,t)});return r.sort((o,i)=>t(o.title,i.title)),r}
3
- export{Xt,fo,Jt,ia,gt,aa,ca,go,Yt,la,Zt};
2
+ var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function tn(){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" \uD83D\uDCD6 STX Story ")+c("\u2551")),console.log(c(" \u2551")+m(" Component Showcase & Testing ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function vo(e,t){if(console.log(a(" Server running at:")),console.log(""),console.log(` ${m("\u279C")} ${a("Local:")} ${c(e)}`),t)console.log(` ${m("\u279C")} ${a("Network:")} ${c(t)}`);console.log("")}function nn(e){let t=e>0?"\u2713":"\u25CB",r=e>0?S:y;console.log(` ${r(t)} Found ${a(String(e))} story ${e===1?"file":"files"}`)}function ga(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function vt(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function ma(e){console.log(` ${O("\u2139")} ${e}`)}function ha(e,t,r){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" Build Complete ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(""),console.log(` ${S("\u2713")} Stories: ${a(String(e))}`),console.log(` ${S("\u2713")} Output: ${a(t)}`),console.log(` ${S("\u2713")} Time: ${a(`${r}ms`)}`),console.log("")}function xo(){console.log(""),console.log(a(" Keyboard Shortcuts:")),console.log(""),console.log(` ${c("h")} Show this help`),console.log(` ${c("o")} Open in browser`),console.log(` ${c("r")} Restart server`),console.log(` ${c("c")} Clear console`),console.log(` ${c("q")} Quit`),console.log("")}import h from"fs";import d from"path";async function rn(e){let{root:t,config:r}=e,o=[],i=await P(t,r.storyMatch,r.storyIgnored);for(let s of i){let n=d.resolve(t,s),l=v(s,n);o.push(l)}return o}async function P(e,t,r){let o=[];async function i(s,n){let l=await h.promises.readdir(s,{withFileTypes:!0});for(let g of l){let f=d.join(s,g.name),u=d.relative(n,f);if(T(u,r))continue;if(g.isDirectory())await i(f,n);else if(g.isFile()){if(F(u,t))o.push(u)}}}return await i(e,e),o}function T(e,t){for(let r of t)if(E(e,r))return!0;return!1}function F(e,t){for(let r of t)if(E(e,r))return!0;return!1}function E(e,t){let r=e.replace(/\\/g,"/"),i=t.replace(/\\/g,"/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"{{GLOBSTAR}}").replace(/\*/g,"[^/]*").replace(/\?/g,".").replace(/\{\{GLOBSTAR\}\}/g,".*");return i=`^${i}$`,new RegExp(i).test(r)}function v(e,t){let r=d.basename(e,".story.stx");return{id:e.toLowerCase().replace(/\.story\.stx$/,"").replace(/[/\\]/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),path:t,relativePath:e,fileName:r,treeFile:{title:r,path:e}}}function ya(e,t){let{root:r,config:o}=e,i=[],s=h.watch(r,{recursive:!0},async(n,l)=>{if(!l)return;let g=l.replace(/\\/g,"/");if(!F(g,o.storyMatch))return;if(T(g,o.storyIgnored))return;let f=d.resolve(r,g);try{await h.promises.access(f);let u=v(g,f);t(n==="rename"?"add":"change",u)}catch{let u=v(g,f);t("unlink",u)}});return i.push(s),()=>{for(let n of i)n.close()}}function N(e,t){let r=t.treeFile||{title:t.fileName,path:t.relativePath};if(e.tree.file==="title")return r.title.split("/");if(e.tree.file==="path")return[...t.relativePath.split("/").slice(0,-1),r.title];if(typeof e.tree.file==="function")return e.tree.file(r);return[r.title]}function sn(e,t){for(let n of t)n.treePath=N(e,n);let r=(e.tree.groups||[]).map((n)=>({groupConfig:{id:n.id||n.title,title:n.title,include:n.include},treeObject:{}})),o={treeObject:{}};r.push(o);for(let n=0;n<t.length;n++){let l=t[n],g=j(l,r,o);k(l.treePath,n,g.treeObject)}let i=e.tree.order==="asc"?(n,l)=>n.localeCompare(l):e.tree.order,s=[];for(let n of r)if(n===o)s.push(...x(n.treeObject,i));else if(n.groupConfig&&Object.keys(n.treeObject).length>0)s.push({group:!0,id:n.groupConfig.id,title:n.groupConfig.title,children:x(n.treeObject,i)});return s}function j(e,t,r){let o=e.treeFile||{title:e.fileName,path:e.relativePath};for(let i of t)if(i.groupConfig?.include&&i.groupConfig.include(o))return i;return r}function k(e,t,r){let o=r;for(let i=0;i<e.length;i++){let s=e[i];if(i===e.length-1)if(o[s]!==void 0){let l=1;while(o[`${s}-${l}`]!==void 0)l++;o[`${s}-${l}`]=t}else o[s]=t;else{if(o[s]===void 0)o[s]={};else if(typeof o[s]==="number"){let l=o[s];o[s]={"":l}}o=o[s]}}}function x(e,t){let r=[];for(let[o,i]of Object.entries(e))if(typeof i==="number")r.push({title:o,index:i});else r.push({title:o,children:x(i,t)});return r.sort((o,i)=>t(o.title,i.title)),r}
3
+ export{tn,vo,nn,ga,vt,ma,ha,xo,rn,ya,sn};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{km}from"./chunk-002zrse4.js";import"./chunk-8nqyyj1h.js";import"./chunk-9zj3xztb.js";import"./chunk-45jpwbzd.js";import"./chunk-k7ffxfgp.js";import"./chunk-1zkymrw0.js";import"./chunk-w53p65hy.js";import"./chunk-nnynrb97.js";import"./chunk-h63ma36g.js";import"./chunk-ssg6ne5b.js";import"./chunk-h2tq6cbr.js";import"./chunk-agd2b928.js";import"./chunk-njza56wn.js";import"./chunk-yffqfgjx.js";import"./chunk-6t04tqvh.js";import"./chunk-86nsbxep.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{km as startProductionServer};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{R}from"./chunk-5gx403te.js";import{i}from"./chunk-k0t9ye9j.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let n=u[t[0]];console.log(`
2
+ import{P}from"./chunk-njza56wn.js";import{i}from"./chunk-2gg3vjks.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let n=u[t[0]];console.log(`
3
3
  ${e.bold}${t[0]}${e.reset} - ${n.description}`),console.log(` Usage: ${e.cyan}${n.usage}${e.reset}
4
4
  `)}else{console.log(`
5
5
  ${e.bold}Available Commands:${e.reset}
@@ -8,7 +8,7 @@ ${e.dim}Type 'help <command>' for more details${e.reset}
8
8
  `)}}},render:{description:"Render a template file",usage:"render <file> [--raw]",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file to render${e.reset}`);return}let n=g.resolve(o.cwd,t[0]);if(!await Bun.file(n).exists()){console.log(`${e.red}Error: File not found: ${n}${e.reset}`);return}try{let r=await Bun.file(n).text(),s=t.includes("--raw");console.log(`
9
9
  ${e.dim}Rendering ${n}...${e.reset}
10
10
  `);let l=await i(r,o.context,n,{},new Set);if(o.lastResult=l,s)console.log(l);else l.split(`
11
- `).forEach((d,c)=>{let f=String(c+1).padStart(3," ");console.log(`${e.dim}${f}${e.reset} ${d}`)});console.log()}catch(r){console.log(`${e.red}Error rendering template:${e.reset}`,r)}}},eval:{description:"Evaluate an expression",usage:"eval <expression>",handler:async(t,o)=>{if(!t.length){console.log(`${e.red}Error: Please provide an expression to evaluate${e.reset}`);return}let n=t.join(" ");try{let r=`{{ ${n} }}`,l=(await R(r,o.context,"eval")).trim();o.lastResult=l,console.log(`${e.green}\u2192${e.reset} ${l}`)}catch(r){console.log(`${e.red}Error:${e.reset}`,r)}}},set:{description:"Set a context variable",usage:"set <key> <value>",handler:async(t,o)=>{if(t.length<2){console.log(`${e.red}Error: Usage: set <key> <value>${e.reset}`);return}let n=t[0],r=t.slice(1).join(" "),s;try{s=JSON.parse(r)}catch{s=r}o.context[n]=s,console.log(`${e.green}\u2713${e.reset} ${n} = ${JSON.stringify(s)}`)}},unset:{description:"Remove a context variable",usage:"unset <key>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a variable to remove${e.reset}`);return}if(t[0]in o.context)delete o.context[t[0]],console.log(`${e.green}\u2713${e.reset} Removed ${t[0]}`);else console.log(`${e.yellow}Variable not found: ${t[0]}${e.reset}`)}},context:{description:"Show current context variables",usage:"context",handler:async(t,o)=>{let n=Object.keys(o.context);if(n.length===0){console.log(`${e.dim}Context is empty${e.reset}`);return}console.log(`
11
+ `).forEach((d,c)=>{let f=String(c+1).padStart(3," ");console.log(`${e.dim}${f}${e.reset} ${d}`)});console.log()}catch(r){console.log(`${e.red}Error rendering template:${e.reset}`,r)}}},eval:{description:"Evaluate an expression",usage:"eval <expression>",handler:async(t,o)=>{if(!t.length){console.log(`${e.red}Error: Please provide an expression to evaluate${e.reset}`);return}let n=t.join(" ");try{let r=`{{ ${n} }}`,l=(await P(r,o.context,"eval")).trim();o.lastResult=l,console.log(`${e.green}\u2192${e.reset} ${l}`)}catch(r){console.log(`${e.red}Error:${e.reset}`,r)}}},set:{description:"Set a context variable",usage:"set <key> <value>",handler:async(t,o)=>{if(t.length<2){console.log(`${e.red}Error: Usage: set <key> <value>${e.reset}`);return}let n=t[0],r=t.slice(1).join(" "),s;try{s=JSON.parse(r)}catch{s=r}o.context[n]=s,console.log(`${e.green}\u2713${e.reset} ${n} = ${JSON.stringify(s)}`)}},unset:{description:"Remove a context variable",usage:"unset <key>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a variable to remove${e.reset}`);return}if(t[0]in o.context)delete o.context[t[0]],console.log(`${e.green}\u2713${e.reset} Removed ${t[0]}`);else console.log(`${e.yellow}Variable not found: ${t[0]}${e.reset}`)}},context:{description:"Show current context variables",usage:"context",handler:async(t,o)=>{let n=Object.keys(o.context);if(n.length===0){console.log(`${e.dim}Context is empty${e.reset}`);return}console.log(`
12
12
  ${e.bold}Context Variables:${e.reset}
13
13
  `);for(let r of n){let s=o.context[r],l=Array.isArray(s)?"array":typeof s,a=JSON.stringify(s).slice(0,50);console.log(` ${e.cyan}${r}${e.reset} ${e.dim}(${l})${e.reset}: ${a}${a.length>=50?"...":""}`)}console.log()}},clear:{description:"Clear context or screen",usage:"clear [context|screen]",handler:async(t,o)=>{if(t[0]==="context"||!t[0])o.context={},console.log(`${e.green}\u2713${e.reset} Context cleared`);if(t[0]==="screen"||!t[0])console.clear()}},cd:{description:"Change working directory",usage:"cd <directory>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.cyan}${o.cwd}${e.reset}`);return}let n=g.resolve(o.cwd,t[0]);if(!p.existsSync(n)){console.log(`${e.red}Error: Directory not found: ${n}${e.reset}`);return}if(!p.statSync(n).isDirectory()){console.log(`${e.red}Error: Not a directory: ${n}${e.reset}`);return}o.cwd=n,console.log(`${e.green}\u2713${e.reset} ${n}`)}},ls:{description:"List files in current directory",usage:"ls [pattern]",handler:async(t,o)=>{let n=t[0]||"*",r=new Bun.Glob(n),s=[];for await(let c of r.scan({cwd:o.cwd,onlyFiles:!1}))s.push(c);if(s.length===0){console.log(`${e.dim}No files found${e.reset}`);return}s.sort();let l=s.filter((c)=>c.endsWith(".stx")),a=s.filter((c)=>c.endsWith(".md")),d=s.filter((c)=>!c.endsWith(".stx")&&!c.endsWith(".md"));if(l.length>0)console.log(`
14
14
  ${e.bold}Templates:${e.reset}`),l.forEach((c)=>console.log(` ${e.green}${c}${e.reset}`));if(a.length>0)console.log(`
@@ -16,9 +16,9 @@ ${e.bold}Markdown:${e.reset}`),a.forEach((c)=>console.log(` ${e.blue}${c}${e.re
16
16
  ${e.bold}Other:${e.reset}`),d.forEach((c)=>console.log(` ${e.dim}${c}${e.reset}`));console.log()}},cat:{description:"Show file contents",usage:"cat <file>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file${e.reset}`);return}let n=g.resolve(o.cwd,t[0]);if(!await Bun.file(n).exists()){console.log(`${e.red}Error: File not found: ${n}${e.reset}`);return}let s=(await Bun.file(n).text()).split(`
17
17
  `);console.log(),s.forEach((l,a)=>{let d=String(a+1).padStart(3," ");console.log(`${e.dim}${d}${e.reset} ${l}`)}),console.log()}},load:{description:"Load context from JSON file",usage:"load <file.json>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a JSON file${e.reset}`);return}let n=g.resolve(o.cwd,t[0]);if(!await Bun.file(n).exists()){console.log(`${e.red}Error: File not found: ${n}${e.reset}`);return}try{let r=await Bun.file(n).text(),s=JSON.parse(r);o.context={...o.context,...s},console.log(`${e.green}\u2713${e.reset} Loaded ${Object.keys(s).length} variables from ${t[0]}`)}catch(r){console.log(`${e.red}Error parsing JSON:${e.reset}`,r)}}},save:{description:"Save context to JSON file",usage:"save <file.json>",handler:async(t,o)=>{if(!t[0]){console.log(`${e.red}Error: Please specify a file name${e.reset}`);return}let n=g.resolve(o.cwd,t[0]);try{await Bun.write(n,JSON.stringify(o.context,null,2)),console.log(`${e.green}\u2713${e.reset} Context saved to ${t[0]}`)}catch(r){console.log(`${e.red}Error saving file:${e.reset}`,r)}}},history:{description:"Show command history",usage:"history [count]",handler:async(t,o)=>{let n=t[0]?Number.parseInt(t[0],10):20,r=o.history.slice(-n);if(r.length===0){console.log(`${e.dim}No history${e.reset}`);return}console.log(),r.forEach((s,l)=>{let a=String(o.history.length-r.length+l+1).padStart(3," ");console.log(`${e.dim}${a}${e.reset} ${s}`)}),console.log()}},exit:{description:"Exit interactive mode",usage:"exit",handler:async(t,o)=>{o.running=!1,console.log(`
18
18
  ${e.dim}Goodbye!${e.reset}
19
- `)}},quit:{description:"Exit interactive mode (alias for exit)",usage:"quit",handler:async(t,o)=>u.exit.handler(t,o)}};function h(t,o){let n=t.split(" "),r=n[0];if(n.length===1)return Object.keys(u).filter((s)=>s.startsWith(r));if(["render","cat","load","cd"].includes(r)){let s=n.slice(1).join(" "),l=g.dirname(s)||".",a=g.basename(s),d=g.resolve(o.cwd,l);if(p.existsSync(d)&&p.statSync(d).isDirectory())try{return p.readdirSync(d).filter((f)=>f.startsWith(a)).map((f)=>`${r} ${l==="."?"":`${l}/`}${f}`)}catch{return[]}}if(["unset","eval","set"].includes(r)){let s=n[1]||"";return Object.keys(o.context).filter((l)=>l.startsWith(s)).map((l)=>`${r} ${l}`)}return[]}async function pm(t={}){let o={context:t.context||{},cwd:t.cwd||process.cwd(),history:[],running:!0,lastResult:null},n=y.createInterface({input:process.stdin,output:process.stdout,completer:(s)=>[h(s,o),s],historySize:t.maxHistory||100});console.log(`
19
+ `)}},quit:{description:"Exit interactive mode (alias for exit)",usage:"quit",handler:async(t,o)=>u.exit.handler(t,o)}};function h(t,o){let n=t.split(" "),r=n[0];if(n.length===1)return Object.keys(u).filter((s)=>s.startsWith(r));if(["render","cat","load","cd"].includes(r)){let s=n.slice(1).join(" "),l=g.dirname(s)||".",a=g.basename(s),d=g.resolve(o.cwd,l);if(p.existsSync(d)&&p.statSync(d).isDirectory())try{return p.readdirSync(d).filter((f)=>f.startsWith(a)).map((f)=>`${r} ${l==="."?"":`${l}/`}${f}`)}catch{return[]}}if(["unset","eval","set"].includes(r)){let s=n[1]||"";return Object.keys(o.context).filter((l)=>l.startsWith(s)).map((l)=>`${r} ${l}`)}return[]}async function xm(t={}){let o={context:t.context||{},cwd:t.cwd||process.cwd(),history:[],running:!0,lastResult:null},n=y.createInterface({input:process.stdin,output:process.stdout,completer:(s)=>[h(s,o),s],historySize:t.maxHistory||100});console.log(`
20
20
  ${e.bold}${e.blue}stx Interactive Mode${e.reset}
21
21
  ${e.dim}Type 'help' for available commands, 'exit' to quit${e.reset}
22
- `);let r=()=>{let s=o.cwd.replace(process.env.HOME||"","~");n.question(`${e.cyan}stx${e.reset} ${e.dim}${s}${e.reset} ${e.green}>${e.reset} `,async(l)=>{let a=l.trim();if(!a){if(o.running)r();return}o.history.push(a);let d=a.match(/(?:[^\s"]|"[^"]*")+/g)||[],c=d[0]?.toLowerCase(),f=d.slice(1).map((m)=>m.replace(/^"|"$/g,""));if(c&&u[c])try{await u[c].handler(f,o)}catch(m){console.log(`${e.red}Error:${e.reset}`,m)}else if(c)if(a.includes("{{")||a.includes("}}"))try{let m=await R(a,o.context,"eval");console.log(`${e.green}\u2192${e.reset} ${m}`)}catch{console.log(`${e.red}Unknown command: ${c}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`)}else console.log(`${e.red}Unknown command: ${c}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`);if(o.running)r();else n.close()})};n.on("SIGINT",()=>{console.log(`
22
+ `);let r=()=>{let s=o.cwd.replace(process.env.HOME||"","~");n.question(`${e.cyan}stx${e.reset} ${e.dim}${s}${e.reset} ${e.green}>${e.reset} `,async(l)=>{let a=l.trim();if(!a){if(o.running)r();return}o.history.push(a);let d=a.match(/(?:[^\s"]|"[^"]*")+/g)||[],c=d[0]?.toLowerCase(),f=d.slice(1).map((m)=>m.replace(/^"|"$/g,""));if(c&&u[c])try{await u[c].handler(f,o)}catch(m){console.log(`${e.red}Error:${e.reset}`,m)}else if(c)if(a.includes("{{")||a.includes("}}"))try{let m=await P(a,o.context,"eval");console.log(`${e.green}\u2192${e.reset} ${m}`)}catch{console.log(`${e.red}Unknown command: ${c}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`)}else console.log(`${e.red}Unknown command: ${c}${e.reset}`),console.log(`${e.dim}Type 'help' for available commands${e.reset}`);if(o.running)r();else n.close()})};n.on("SIGINT",()=>{console.log(`
23
23
  ${e.dim}(Use 'exit' to quit)${e.reset}`),r()}),r()}
24
- export{pm};
24
+ export{xm};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import s from"path";var h=new Set([".jpg",".jpeg",".png",".gif"]),d=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function cu(e,r){let a=r.formats??d;if(!r.publicDir)return e;let i=y(e),o=[],m=/<img\b[^>]*?>/gi,c=[],u;while((u=m.exec(e))!==null){let t=u[0],n=t.match(/\bsrc=["']([^"']+)["']/i);if(!n)continue;if(A(u.index,i))continue;c.push({idx:u.index,length:t.length,src:n[1],raw:t})}if(c.length===0)return e;let f=await Promise.all(c.map(async(t)=>{let n=await S(t.src,r.publicDir,a);return{match:t,sources:n}}));for(let{match:t,sources:n}of f){if(n.length===0)continue;let x=`<picture>${n.map((p)=>`<source type="${p.mime}" srcset="${P(p.url)}">`).join("")}${t.raw}</picture>`;o.push({start:t.idx,end:t.idx+t.length,replacement:x})}if(o.length===0)return e;let l="",g=0;for(let t of o)l+=e.slice(g,t.start),l+=t.replacement,g=t.end;return l+=e.slice(g),l}async function S(e,r,a){if(!w(e))return[];let i=s.extname(e).toLowerCase();if(!h.has(i))return[];if(!e.startsWith("/"))return[];let o=s.join(r,e.slice(1)),m=s.dirname(o),c=s.basename(o,i),u=s.resolve(m),f=s.resolve(r);if(!u.startsWith(f))return[];let l=s.posix.dirname(e),g=a.map(async(n)=>{let b=s.join(m,`${c}${n.ext}`);if(!await Bun.file(b).exists())return null;return{url:s.posix.join(l,`${c}${n.ext}`),mime:n.mime}});return(await Promise.all(g)).filter((n)=>n!==null)}function w(e){if(!e)return!1;if(e.startsWith("http://")||e.startsWith("https://"))return!1;if(e.startsWith("//"))return!1;if(e.startsWith("data:"))return!1;return!0}function y(e){let r=[],a=/<picture\b[^>]*>[\s\S]*?<\/picture>/gi,i;while((i=a.exec(e))!==null)r.push([i.index,i.index+i[0].length]);return r}function A(e,r){for(let[a,i]of r)if(e>=a&&e<i)return!0;return!1}function P(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;")}
3
- export{cu};
2
+ import s from"path";var h=new Set([".jpg",".jpeg",".png",".gif"]),d=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function bu(e,r){let a=r.formats??d;if(!r.publicDir)return e;let i=y(e),o=[],m=/<img\b[^>]*?>/gi,c=[],u;while((u=m.exec(e))!==null){let t=u[0],n=t.match(/\bsrc=["']([^"']+)["']/i);if(!n)continue;if(A(u.index,i))continue;c.push({idx:u.index,length:t.length,src:n[1],raw:t})}if(c.length===0)return e;let f=await Promise.all(c.map(async(t)=>{let n=await S(t.src,r.publicDir,a);return{match:t,sources:n}}));for(let{match:t,sources:n}of f){if(n.length===0)continue;let x=`<picture>${n.map((p)=>`<source type="${p.mime}" srcset="${P(p.url)}">`).join("")}${t.raw}</picture>`;o.push({start:t.idx,end:t.idx+t.length,replacement:x})}if(o.length===0)return e;let l="",g=0;for(let t of o)l+=e.slice(g,t.start),l+=t.replacement,g=t.end;return l+=e.slice(g),l}async function S(e,r,a){if(!w(e))return[];let i=s.extname(e).toLowerCase();if(!h.has(i))return[];if(!e.startsWith("/"))return[];let o=s.join(r,e.slice(1)),m=s.dirname(o),c=s.basename(o,i),u=s.resolve(m),f=s.resolve(r);if(!u.startsWith(f))return[];let l=s.posix.dirname(e),g=a.map(async(n)=>{let b=s.join(m,`${c}${n.ext}`);if(!await Bun.file(b).exists())return null;return{url:s.posix.join(l,`${c}${n.ext}`),mime:n.mime}});return(await Promise.all(g)).filter((n)=>n!==null)}function w(e){if(!e)return!1;if(e.startsWith("http://")||e.startsWith("https://"))return!1;if(e.startsWith("//"))return!1;if(e.startsWith("data:"))return!1;return!0}function y(e){let r=[],a=/<picture\b[^>]*>[\s\S]*?<\/picture>/gi,i;while((i=a.exec(e))!==null)r.push([i.index,i.index+i[0].length]);return r}function A(e,r){for(let[a,i]of r)if(e>=a&&e<i)return!0;return!1}function P(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;")}
3
+ export{bu};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{L,el,Js,Sn,h,He,Ve}from"./chunk-5gx403te.js";import{wr,ot,U}from"./chunk-ctjxcaxq.js";import{lr,i}from"./chunk-k0t9ye9j.js";import{Ee}from"./chunk-w8k9fz1w.js";import{Xi}from"./chunk-yxdhz4ps.js";function y(s){return s.endsWith(".md")||s.endsWith(".markdown")}function C(s){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function m(n,p){let g;while((g=n.exec(s))!==null){let t=g.index,o=t+g[0].length;if(p?.some((l)=>t>=l.start&&o<=l.end))continue;e.push({start:t,end:o})}}if(e.length===0)return s;e.sort((n,p)=>n.start-p.start);let c="",a=0;for(let n of e){if(n.start<a)continue;c+=s.slice(a,n.start),c+=`@raw${s.slice(n.start,n.end)}@endraw`,a=n.end}return c+=s.slice(a),c}async function b(s,e={}){let{data:r,content:m}=wr(s),a=await(e.renderer??((n)=>ot(n)))(m);return{html:C(a),frontmatter:r??{}}}import{dirname as k,resolve as R}from"path";function v(s){let e=s,r=L(s);if(r)e=r.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,c=[],a=[],n=[],p=(o)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(o),g;while((g=m.exec(s))!==null){let o=g[1],l=g[2],d=g[0],u=o.includes("server");if(p(l))n.push(d);else if(u)a.push(l);else c.push(d)}let t=e;{let o=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,d=[];while((l=o.exec(t))!==null){let u=l.index+l[0].length,f=t.indexOf("</script>",u);if(f===-1)continue;d.push({start:l.index,end:f+9}),o.lastIndex=f+9}for(let u=d.length-1;u>=0;u--)t=t.substring(0,d[u].start)+t.substring(d[u].end)}for(let o of c)t=t.replace(o,"");return{templateContent:t,serverScripts:a,clientScripts:c,signalsScripts:n}}function M(s,e){return`<!DOCTYPE html>
2
+ import{j,cl,no,$n,h,qe,Ke}from"./chunk-njza56wn.js";import{_r,ut,W}from"./chunk-w53p65hy.js";import{gr,i}from"./chunk-2gg3vjks.js";import{$e}from"./chunk-1zkymrw0.js";import{ra}from"./chunk-xpbakn6t.js";function y(s){return s.endsWith(".md")||s.endsWith(".markdown")}function C(s){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function m(n,p){let g;while((g=n.exec(s))!==null){let t=g.index,o=t+g[0].length;if(p?.some((l)=>t>=l.start&&o<=l.end))continue;e.push({start:t,end:o})}}if(e.length===0)return s;e.sort((n,p)=>n.start-p.start);let c="",a=0;for(let n of e){if(n.start<a)continue;c+=s.slice(a,n.start),c+=`@raw${s.slice(n.start,n.end)}@endraw`,a=n.end}return c+=s.slice(a),c}async function b(s,e={}){let{data:r,content:m}=_r(s),a=await(e.renderer??((n)=>ut(n)))(m);return{html:C(a),frontmatter:r??{}}}import{dirname as k,resolve as R}from"path";function v(s){let e=s,r=j(s);if(r)e=r.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,c=[],a=[],n=[],p=(o)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(o),g;while((g=m.exec(s))!==null){let o=g[1],l=g[2],d=g[0],u=o.includes("server");if(p(l))n.push(d);else if(u)a.push(l);else c.push(d)}let t=e;{let o=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,d=[];while((l=o.exec(t))!==null){let u=l.index+l[0].length,f=t.indexOf("</script>",u);if(f===-1)continue;d.push({start:l.index,end:f+9}),o.lastIndex=f+9}for(let u=d.length-1;u>=0;u--)t=t.substring(0,d[u].start)+t.substring(d[u].end)}for(let o of c)t=t.replace(o,"");return{templateContent:t,serverScripts:a,clientScripts:c,signalsScripts:n}}function M(s,e){return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -9,8 +9,8 @@ import{L,el,Js,Sn,h,He,Ve}from"./chunk-5gx403te.js";import{wr,ot,U}from"./chunk-
9
9
  <body>
10
10
  ${s}
11
11
  </body>
12
- </html>`}async function uc(s,e={}){let r=R(s),m=Bun.file(r);if(!await m.exists())throw Error(`Template file not found: ${r}`);let c=await m.text(),a=null;if(y(r)){let n=await b(c,{renderer:e.markdownRenderer});c=n.html,a=n.frontmatter}if(a)e={...e,context:{...a,...e.context||{}}};if(e.layout){let n=R(e.layout),p=Bun.file(n);if(!await p.exists())throw Error(`Layout template not found: ${n}`);let{layout:g,injectCSS:t,...o}=e,l={...e.context||{}};Sn(l);let d=await w(c,r,{...o,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),u=await p.text(),f={...l,content:d},x={...o,context:f,injectCSS:t};return w(u,n,x)}return w(c,r,e)}async function w(s,e,r={}){let{templateContent:m,serverScripts:c,clientScripts:a}=v(s),n={...U,...r.options},p={__filename:e,__dirname:k(e),__stx:{},__stx_options:n,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...Js(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let o of c)await h(o,p,e);let g=new Set,t=m;if(t=await i(t,p,e,n,g),el(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),a.length>0)t+=`
12
+ </html>`}async function bc(s,e={}){let r=R(s),m=Bun.file(r);if(!await m.exists())throw Error(`Template file not found: ${r}`);let c=await m.text(),a=null;if(y(r)){let n=await b(c,{renderer:e.markdownRenderer});c=n.html,a=n.frontmatter}if(a)e={...e,context:{...a,...e.context||{}}};if(e.layout){let n=R(e.layout),p=Bun.file(n);if(!await p.exists())throw Error(`Layout template not found: ${n}`);let{layout:g,injectCSS:t,...o}=e,l={...e.context||{}};$n(l);let d=await w(c,r,{...o,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),u=await p.text(),f={...l,content:d},x={...o,context:f,injectCSS:t};return w(u,n,x)}return w(c,r,e)}async function w(s,e,r={}){let{templateContent:m,serverScripts:c,clientScripts:a}=v(s),n={...W,...r.options},p={__filename:e,__dirname:k(e),__stx:{},__stx_options:n,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...no(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let o of c)await h(o,p,e);let g=new Set,t=m;if(t=await i(t,p,e,n,g),cl(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),a.length>0)t+=`
13
13
  ${a.join(`
14
- `)}`}else{if(r.processClientScripts!==!1&&a.length>0){let o=p.__stx_event_bindings||[],l=He(p),d=await Promise.all(a.map(async(x)=>{let _=x.match(/<script\b([^>]*)>/i)?.[1]||"";if(/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(_))return x;let S=x.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!S)return x;return await Ve(S[1],{eventBindings:o,templateContent:t,serverData:l,filePath:e})})),f=[await lr(d,{...n,buildMode:"compile"}),...d].filter(Boolean).join(`
15
- `);t=Xi(t,f)}t=await Ee(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=M(t,r.title)}if(r.injectCSS)try{let{injectCss:o}=await import("./chunk-8f3dbthj.js");t=await o(t)}catch{}return t}
16
- export{uc};
14
+ `)}`}else{if(r.processClientScripts!==!1&&a.length>0){let o=p.__stx_event_bindings||[],l=qe(p),d=await Promise.all(a.map(async(x)=>{let _=x.match(/<script\b([^>]*)>/i)?.[1]||"";if(/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(_))return x;let S=x.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!S)return x;return await Ke(S[1],{eventBindings:o,templateContent:t,serverData:l,filePath:e})})),f=[await gr(d,{...n,buildMode:"compile"}),...d].filter(Boolean).join(`
15
+ `);t=ra(t,f)}t=await $e(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=M(t,r.title)}if(r.injectCSS)try{let{injectCss:o}=await import("./chunk-xfhxfcvk.js");t=await o(t)}catch{}return t}
16
+ export{bc};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$h,Rh,Ah,Ph,Ih}from"./chunk-a0q0kb0s.js";export{Rh as createSSRSuspense,Ph as generateSuspenseCSS,Ih as generateSuspenseRuntime,$h as processSuspenseDirectives,Ah as renderSSRSuspense};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Re,io,Ug,Ty,Wg,$y,Pn,g,Y,ie,In,Oe,qg,zi,Kg,Ry,P,Hi,Gg,Ay,O,Py}from"./chunk-njza56wn.js";import"./chunk-yffqfgjx.js";import"./chunk-6t04tqvh.js";import"./chunk-86nsbxep.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{Gg as applyFilters,$y as clearCustomFilters,qg as clientLoopScopes,io as defaultFilters,In as escapeAttributeValue,g as escapeHtml,Y as escapeHtmlValue,ie as escapeInterpolatedHtmlValue,O as evaluateExpression,Re as findMustacheEnd,Wg as getAllFilters,Kg as interpolateScriptAttributes,zi as interpolateScriptExpressions,Ry as interpolateScriptsInTemplate,P as processExpressions,Hi as processExpressionsChunked,Ug as registerFilter,Ty as registerFilters,Pn as replaceInterpolations,Ay as resetRejectedExpressionWarnings,Py as unescapeHtml,Oe as usesSignalsInScript};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ga,Xa,Ja,Ya,Yh}from"./chunk-sq6werer.js";import"./chunk-e362e615.js";import"./chunk-gmbw1xhm.js";import"./chunk-kee5a3ce.js";import"./chunk-2gg3vjks.js";import"./chunk-2cvwjtjh.js";import"./chunk-ekdhjm8p.js";import"./chunk-c0g30cjs.js";import"./chunk-345waetq.js";import"./chunk-k7ffxfgp.js";import"./chunk-9yx7cbhz.js";import"./chunk-t94y8g35.js";import"./chunk-ym0cdk7m.js";import"./chunk-1zkymrw0.js";import"./chunk-v1s838fe.js";import"./chunk-jc74097x.js";import"./chunk-nb6erf75.js";import"./chunk-w53p65hy.js";import"./chunk-nnynrb97.js";import"./chunk-h63ma36g.js";import"./chunk-ssg6ne5b.js";import"./chunk-h2tq6cbr.js";import"./chunk-agd2b928.js";import"./chunk-njza56wn.js";import"./chunk-yffqfgjx.js";import"./chunk-6t04tqvh.js";import"./chunk-86nsbxep.js";import"./chunk-hxhmhw23.js";import"./chunk-a60ztvnp.js";import"./chunk-s29hp1qw.js";import"./chunk-00tq7ghn.js";export{Ga as buildNative,Yh as default,Xa as findCraftBinary,Ya as getAvailableFormats,Ja as getAvailableTargets};
@@ -1,11 +1,11 @@
1
1
  // @bun
2
- import{t,u,Wt,qt,Kt,Ge,dt,F,oo,Br,Xe}from"./chunk-pp99rmjm.js";var O=/(?<![\w$@])@meta\s*\(/g,I=/(?<![\w$@])@metaTag\s*\(/g,C=/(?<![\w$@])@structuredData\s*\(/g,k=/(?<![\w$@])@seo\s*\(/g;function _(e,r){return(n)=>F(e,n,"the call has no closing parenthesis",r,t.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 ui(e,r,n,g){if(!e.includes("@meta"))return e;let i=Wt(e,O,(a,o)=>{let s=Br(qt(a),r);if(s.kind==="tag")return N(s.tag);if(s.kind==="empty")return"";return F("Meta",o,s.message,n,s.code)},_("Meta",n));return i=Wt(i,I,(a,o)=>{let s=Kt(a,r);if(!s.ok)return F("MetaTag",o,s.message,n,s.code);if(s.value===void 0||s.value===null)return"";if(!dt(s.value))return F("MetaTag",o,`expected an object such as { name, content }, got ${Ge(s.value)}`,n,t.TYPE_ERROR);let l=s.value;if(!l.name&&!l.property&&!l.httpEquiv)return F("MetaTag",o,"the tag needs a name, property or httpEquiv",n,t.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",n)),i}function b(e){let r=(n)=>n["@context"]?{...n}:{...n,"@context":"https://schema.org"};if(dt(e))return r(e);if(Array.isArray(e)&&e.length>0&&e.every(dt))return e.map(r);return null}function E(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function di(e,r,n){if(!e.includes("@structuredData"))return e;return Wt(e,C,(g,i)=>{let a=Kt(g,r);if(!a.ok)return F("StructuredData",i,a.message,n,a.code);if(a.value===void 0||a.value===null)return"";let o=b(a.value);if(!o)return F("StructuredData",i,`expected an object or an array of objects, got ${Ge(a.value)}`,n,t.TYPE_ERROR);try{return E(o)}catch(s){let l=s instanceof Error?s.message:String(s);return F("StructuredData",i,`the data cannot be written as JSON: ${l}`,n,t.EVALUATION_ERROR)}},_("StructuredData",n))}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 pi(e,r,n,g){if(!e.includes("@seo"))return e;return Wt(e,k,(i,a)=>{if(!i.trim())return F("SEO",a,"expected an object: @seo({ title, description }) or @seo(seoVariable)",n,t.INVALID_DIRECTIVE_SYNTAX);let o=Kt(i,r);if(!o.ok)return F("SEO",a,o.message,n,o.code);if(o.value===void 0||o.value===null)return"";if(!dt(o.value))return F("SEO",a,`expected an object such as { title, description }, got ${Ge(o.value)}`,n,t.TYPE_ERROR);try{return L(o.value,a,n)}catch(s){let l=s instanceof Error?s.message:String(s);return F("SEO",a,`Error processing @seo directive: ${l}`,n,t.EVALUATION_ERROR)}},_("SEO",n))}function R(e,r,n,g){let i=e[r];if(i===void 0||i===null||i===!1)return;if(dt(i))return i;oo(n,`${r} must be an object, got ${Ge(i)}; its tags were left out`,g);return}function L(e,r,n){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(", ");oo(r,`@seo does not read ${s}; ${g.length===1?"it was":"they were"} ignored`,n)}let i="";if(e.title)i+=`<title>${c(e.title)}</title>
2
+ import{n,u,Jt,Yt,Zt,Ze,yt,z,po,Ur,Qe}from"./chunk-86nsbxep.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)=>z(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 yi(e,t,r,g){if(!e.includes("@meta"))return e;let i=Jt(e,O,(a,o)=>{let s=Ur(Yt(a),t);if(s.kind==="tag")return N(s.tag);if(s.kind==="empty")return"";return z("Meta",o,s.message,r,s.code)},_("Meta",r));return i=Jt(i,I,(a,o)=>{let s=Zt(a,t);if(!s.ok)return z("MetaTag",o,s.message,r,s.code);if(s.value===void 0||s.value===null)return"";if(!yt(s.value))return z("MetaTag",o,`expected an object such as { name, content }, got ${Ze(s.value)}`,r,n.TYPE_ERROR);let l=s.value;if(!l.name&&!l.property&&!l.httpEquiv)return z("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(yt(e))return t(e);if(Array.isArray(e)&&e.length>0&&e.every(yt))return e.map(t);return null}function E(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function bi(e,t,r){if(!e.includes("@structuredData"))return e;return Jt(e,C,(g,i)=>{let a=Zt(g,t);if(!a.ok)return z("StructuredData",i,a.message,r,a.code);if(a.value===void 0||a.value===null)return"";let o=b(a.value);if(!o)return z("StructuredData",i,`expected an object or an array of objects, got ${Ze(a.value)}`,r,n.TYPE_ERROR);try{return E(o)}catch(s){let l=s instanceof Error?s.message:String(s);return z("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 wi(e,t,r,g){if(!e.includes("@seo"))return e;return Jt(e,k,(i,a)=>{if(!i.trim())return z("SEO",a,"expected an object: @seo({ title, description }) or @seo(seoVariable)",r,n.INVALID_DIRECTIVE_SYNTAX);let o=Zt(i,t);if(!o.ok)return z("SEO",a,o.message,r,o.code);if(o.value===void 0||o.value===null)return"";if(!yt(o.value))return z("SEO",a,`expected an object such as { title, description }, got ${Ze(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 z("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(yt(i))return i;po(r,`${t} must be an object, got ${Ze(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(", ");po(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)}">
6
6
  `}if(e.robots)i+=`<meta name="robots" content="${c(e.robots)}">
7
7
  `;if(e.canonical)i+=`<link rel="canonical" href="${c(e.canonical)}">
8
- `;let a=R(e,"openGraph",r,n);if(a){if(i+=`<meta property="og:type" content="${c(a.type||"website")}">
8
+ `;let a=R(e,"openGraph",t,r);if(a){if(i+=`<meta property="og:type" content="${c(a.type||"website")}">
9
9
  `,a.title||e.title){let s=a.title||e.title||"";i+=`<meta property="og:title" content="${c(s)}">
10
10
  `}if(a.description||e.description){let s=a.description||e.description||"";i+=`<meta property="og:description" content="${c(s)}">
11
11
  `}if(a.url||e.canonical){let s=a.url||e.canonical||"";i+=`<meta property="og:url" content="${c(s)}">
@@ -17,7 +17,7 @@ import{t,u,Wt,qt,Kt,Ge,dt,F,oo,Br,Xe}from"./chunk-pp99rmjm.js";var O=/(?<![\w$@]
17
17
  `}if(a.siteName)i+=`<meta property="og:site_name" content="${c(a.siteName)}">
18
18
  `;if(a.locale)i+=`<meta property="og:locale" content="${c(a.locale)}">
19
19
  `;if(a.profile){let s=[["first_name",a.profile.firstName],["last_name",a.profile.lastName],["username",a.profile.username],["gender",a.profile.gender]];for(let[l,p]of s)if(p)i+=`<meta property="profile:${l}" content="${c(p)}">
20
- `}}let o=R(e,"twitter",r,n);if(o){if(i+=`<meta name="twitter:card" content="${c(o.card||"summary_large_image")}">
20
+ `}}let o=R(e,"twitter",t,r);if(o){if(i+=`<meta name="twitter:card" content="${c(o.card||"summary_large_image")}">
21
21
  `,o.title||e.title){let s=o.title||e.title||"";i+=`<meta name="twitter:title" content="${c(s)}">
22
22
  `}if(o.description||e.description){let s=o.description||e.description||"";i+=`<meta name="twitter:description" content="${c(s)}">
23
23
  `}if(o.image||a&&a.image){let s=o.image||(a?a.image:"")||"";i+=`<meta name="twitter:image" content="${c(s)}">
@@ -25,7 +25,7 @@ import{t,u,Wt,qt,Kt,Ge,dt,F,oo,Br,Xe}from"./chunk-pp99rmjm.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 oo(r,`structuredData must be an object or an array of objects, got ${Ge(e.structuredData)}; it was left out`,n)}return i.trim()}function fi(e,r,n){if(n.seo?.enabled===!1)return e;if(e.includes("<!-- stx SEO Tags -->")||r.__stx_seo_staged===!0||n.skipDefaultSeoTags===!0)return e;let g=r.__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(r.title)p=r.title;else if(r.meta&&r.meta.title)p=r.meta.title;else if(s)p=s;else if(n.seo?.defaultConfig?.title)p=n.seo.defaultConfig.title;else p=n.defaultTitle||"stx Project";let m="";if(r.description)m=r.description;else if(r.meta&&r.meta.description)m=r.meta.description;else if(l)m=l;else if(n.seo?.defaultConfig?.description)m=n.seo.defaultConfig.description;else m=n.defaultDescription||"A website built with stx templating engine";let d="";if(r.image)d=r.image;else if(r.meta&&r.meta.image)d=r.meta.image;else if(r.openGraph&&r.openGraph.image)d=r.openGraph.image;else if(n.seo?.defaultImage)d=n.seo.defaultImage;else if(n.defaultImage)d=n.defaultImage;let f=a?"":`
28
+ `;else po(t,`structuredData must be an object or an array of objects, got ${Ze(e.structuredData)}; it was left out`,r)}return i.trim()}function vi(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}
@@ -39,11 +39,11 @@ import{t,u,Wt,qt,Kt,Ge,dt,F,oo,Br,Xe}from"./chunk-pp99rmjm.js";var O=/(?<![\w$@]
39
39
  <meta property="og:image" content="${c(d)}">
40
40
  <meta name="twitter:image" content="${c(d)}">
41
41
  `;let h=e;if(!a)h=h.replace(/<head[^>]*>/,`$&
42
- <title>${c(p)}</title>`);let w=r.__stx_head_injections;if(w)return r.__stx_seo_staged=!0,w.afterOpen.push(`
42
+ <title>${c(p)}</title>`);let w=t.__stx_head_injections;if(w)return t.__stx_seo_staged=!0,w.afterOpen.push(`
43
43
  ${y}
44
44
  `),h;return h.replace(/<head[^>]*>/,`$&
45
45
  ${y}
46
- `)}function q(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}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 r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?v(r[1].trim()):""}function x(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function V(e){return x(e).length>0}function G(e){for(let r of x(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(n?.[1]??n?.[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 Is={name:"meta",rawParams:!0,handler:(e,r,n,g)=>{let i=Br(r,n??{});if(i.kind==="error")return F("Meta",`@meta(${r.join(", ")})`,i.message,g,i.code);if(i.kind==="empty")return"";if(n)n.__stx_runtime_head=Xe(n.__stx_runtime_head??{},{meta:[i.tag]});return""},hasEndTag:!1},Os={name:"structuredData",handler:(e,r,n,g)=>{if(e.trim()==="")return u("StructuredData","structuredData directive requires JSON-LD content",t.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",t.INVALID_DIRECTIVE_SYNTAX);return E(i)}catch(i){let a=i instanceof Error?i.message:String(i);return u("StructuredData",a,t.EVALUATION_ERROR)}},hasEndTag:!0};function dy(){return[Is,Os]}function py(e,r){let{baseUrl:n,defaultChangefreq:g="weekly",defaultPriority:i=0.5,includeLastmod:a=!0}=r,o=n.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 js={name:"meta",rawParams:!0,handler:(e,t,r,g)=>{let i=Ur(t,r??{});if(i.kind==="error")return z("Meta",`@meta(${t.join(", ")})`,i.message,g,i.code);if(i.kind==="empty")return"";if(r)r.__stx_runtime_head=Qe(r.__stx_runtime_head??{},{meta:[i.tag]});return""},hasEndTag:!1},Bs={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 vy(){return[js,Bs]}function xy(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 fy(e,r){let n=r.replace(/\/$/,""),g=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
56
+ </urlset>`}function Sy(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
- ${e.map((a)=>{let o=a.startsWith("http")?a:`${n}${a.startsWith("/")?"":"/"}${a}`;return` <sitemap>
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 gy(e,r){let{extensions:n=[".stx",".html",".htm"],ignore:g=["_*",".*","node_modules","components","partials","layouts"]}=r,i=[],a=n.length===1?`*${n[0]}`:`*{${n.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 Ns(e){let r=[];for(let n of e.rules){if(r.push(`User-agent: ${n.userAgent}`),n.allow)for(let g of n.allow)r.push(`Allow: ${g}`);if(n.disallow)for(let g of n.disallow)r.push(`Disallow: ${g}`);if(n.crawlDelay!==void 0)r.push(`Crawl-delay: ${n.crawlDelay}`);r.push("")}if(e.sitemap){let n=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let g of n)r.push(`Sitemap: ${g}`)}if(e.host)r.push(`Host: ${e.host}`);return r.join(`
64
- `).trim()}function my(e){return Ns({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{ui,di,pi,fi,Is,Os,dy,py,fy,gy,Ns,my};
63
+ </sitemapindex>`}async function ky(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 Fs(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 _y(e){return Fs({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{yi,bi,wi,vi,js,Bs,vy,xy,Sy,ky,Fs,_y};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Fo,Ha,Va,qh}from"./chunk-57q4nvs9.js";export{Fo as NATIVE_COMPONENTS,Ha as compileToNative,Va as createHotReloadServer,qh as default};
@@ -1,3 +1,3 @@
1
1
  // @bun
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};
2
+ import{existsSync as g,statSync as p}from"fs";import e from"path";var w=/[*?[\]{}]/;function yg(o){return w.test(o)}async function mi(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(yg(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{yg,mi};
@@ -1,18 +1,18 @@
1
1
  // @bun
2
- import{Be,T,ne}from"./chunk-5gx403te.js";import{C}from"./chunk-fdjx4vs3.js";import{N,Nn}from"./chunk-3w7gacva.js";import{a}from"./chunk-ctjxcaxq.js";import{ke,un,dn,pn}from"./chunk-99e3mxnn.js";import{Ct}from"./chunk-2mt2zc5y.js";import{xt,Xn,nn,he}from"./chunk-bdh73gxd.js";import{A,On}from"./chunk-1ztp5vkh.js";import v from"fs";import b from"path";import x from"process";function U(s,o){for(let e of s.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(e[1])o.add(e[1]);for(let e of s.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let t of(e[1]??"").split(",")){let r=((t.includes(":")?t.split(":").pop():t)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(r))o.add(r)}for(let e of s.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let t of(e[1]??"").split(",")){let n=t.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(n))o.add(n)}}var h=new Map;async function O(s,o=A()){let e;if(s)e=b.resolve(s);else{let l=await a();e=b.resolve(l.root||x.cwd(),l.storesDir||"stores")}let t=`${e}\x00${dn()}\x00${o?"shared":"inline"}`,n=new Bun.Glob("*.ts"),r=[];try{for await(let l of n.scan({cwd:e,absolute:!0})){let c=b.basename(l,".ts");if(["index","types"].includes(c))continue;if(l.includes(".d.ts"))continue;r.push(l)}}catch{return he(h,t,"",{chunks:[]}),null}let i=()=>[...new Set([...r,...r.flatMap((l)=>ke(l))])],f=xt(i()),u=nn(h,t,f);if(u!==void 0)return u.chunks.length>0?u:null;if(r.length===0)return he(h,t,f,{chunks:[]}),null;let m=[];for(let l of r){let c=await Bun.file(l).text();m.push({file:l,hasUseStore:/useStore\s*\(/.test(c)})}m.sort((l,c)=>{if(l.hasUseStore===c.hasUseStore)return 0;return l.hasUseStore?1:-1});let p=m.map((l)=>l.file),g=[],d=ne({loader:"ts",target:"browser",define:T()});for(let l of p)try{let c=await Bun.file(l).text(),k=b.basename(l,".ts"),_=new Set;U(c,_);let y=[...c.matchAll(/\bdefineStore\s*(?:<[^>()]*>)?\(\s*(['"`])([^'"`$\\]+)\1/g)].map((I)=>I[2]),E=c.match(/\bdefineStore\s*(?:<[^>()]*>)?\(/g)?.length??0;if(un(c))c=await pn(c,l,{projectRoot:x.cwd(),externalizeUserModules:o});c=Ct(c),c=N(c),c=Nn(c),c=c.replace(/^export\s+(default\s+)?/gm,""),c=d.transformSync(c),g.push({name:k,ids:y.length===E?y:[],declared:_,code:`// Store: ${k}
3
- ${c.trim()}`})}catch(c){console.warn(`[stx] Failed to load store ${l}:`,c)}if(g.length===0)return he(h,t,f,{chunks:[]}),null;f=xt(i());let S={chunks:g};return he(h,t,f,S),S}function R(s){let o=new Set;for(let r of s)for(let i of r.declared)o.add(i);let e=s.map((r)=>r.code).join(`
2
+ import{De}from"./chunk-a60ztvnp.js";import{E}from"./chunk-00tq7ghn.js";import{M,jn}from"./chunk-hxhmhw23.js";import{A,oe}from"./chunk-njza56wn.js";import{a}from"./chunk-w53p65hy.js";import{Ce,hn,yn,bn}from"./chunk-kyh32kma.js";import{Pt}from"./chunk-ym0cdk7m.js";import{Tt,er,ln,be}from"./chunk-97kgrevs.js";import{I,et}from"./chunk-ws2h92mm.js";import C from"fs";import b from"path";import x from"process";function B(s,o){for(let e of s.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(e[1])o.add(e[1]);for(let e of s.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let t of(e[1]??"").split(",")){let r=((t.includes(":")?t.split(":").pop():t)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(r))o.add(r)}for(let e of s.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let t of(e[1]??"").split(",")){let n=t.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(n))o.add(n)}}var h=new Map;async function O(s,o=I()){let e;if(s)e=b.resolve(s);else{let l=await a();e=b.resolve(l.root||x.cwd(),l.storesDir||"stores")}let t=`${e}\x00${yn()}\x00${o?"shared":"inline"}`,n=new Bun.Glob("*.ts"),r=[];try{for await(let l of n.scan({cwd:e,absolute:!0})){let c=b.basename(l,".ts");if(["index","types"].includes(c))continue;if(l.includes(".d.ts"))continue;r.push(l)}}catch{return be(h,t,"",{chunks:[]}),null}let i=()=>[...new Set([...r,...r.flatMap((l)=>Ce(l))])],f=Tt(i()),u=ln(h,t,f);if(u!==void 0)return u.chunks.length>0?u:null;if(r.length===0)return be(h,t,f,{chunks:[]}),null;let m=[];for(let l of r){let c=await Bun.file(l).text();m.push({file:l,hasUseStore:/useStore\s*\(/.test(c)})}m.sort((l,c)=>{if(l.hasUseStore===c.hasUseStore)return 0;return l.hasUseStore?1:-1});let p=m.map((l)=>l.file),g=[],d=oe({loader:"ts",target:"browser",define:A()});for(let l of p)try{let c=await Bun.file(l).text(),k=b.basename(l,".ts"),_=new Set;B(c,_);let y=[...c.matchAll(/\bdefineStore\s*(?:<[^>()]*>)?\(\s*(['"`])([^'"`$\\]+)\1/g)].map((U)=>U[2]),N=c.match(/\bdefineStore\s*(?:<[^>()]*>)?\(/g)?.length??0;if(hn(c))c=await bn(c,l,{projectRoot:x.cwd(),externalizeUserModules:o});c=Pt(c),c=M(c),c=jn(c),c=c.replace(/^export\s+(default\s+)?/gm,""),c=d.transformSync(c),g.push({name:k,ids:y.length===N?y:[],declared:_,code:`// Store: ${k}
3
+ ${c.trim()}`})}catch(c){console.warn(`[stx] Failed to load store ${l}:`,c)}if(g.length===0)return be(h,t,f,{chunks:[]}),null;f=Tt(i());let S={chunks:g};return be(h,t,f,S),S}function R(s){let o=new Set;for(let r of s)for(let i of r.declared)o.add(i);let e=s.map((r)=>r.code).join(`
4
4
 
5
5
  `),n=`;(function(){
6
6
  var __stx = window.stx || {};
7
- ${C.filter((r)=>!o.has(r)&&new RegExp(`\\b${r}\\b`).test(e)).map((r)=>`var ${r} = __stx[${JSON.stringify(r)}];`).join(`
7
+ ${E.filter((r)=>!o.has(r)&&new RegExp(`\\b${r}\\b`).test(e)).map((r)=>`var ${r} = __stx[${JSON.stringify(r)}];`).join(`
8
8
  `)}
9
9
  ${e}
10
- })();`;return A()?On(n):n}function B(s){let o=new Set;for(let e of s.matchAll(/^(?:export\s+)?(?:async\s+)?(?:const|let|var|function\*?|class)\s+([A-Z_a-z$][\w$]*)/gm))o.add(e[1]);for(let e of s.matchAll(/^(?:const|let|var)\s*[{[]([^=]*)[}\]]\s*=/gm))for(let t of(e[1]??"").split(",")){let n=(t.includes(":")?t.split(":").pop():t).replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(n))o.add(n)}return o}function j(s){let o=s.map((e)=>B(e.code));for(let[e,t]of s.entries()){let n=new Set;for(let[i,f]of o.entries()){if(i===e)continue;for(let u of f)if(!o[e].has(u)&&!t.declared.has(u))n.add(u)}if(n.size===0)continue;let r;try{r=Be(t.code,n)}catch{r=new Set([...n].filter((i)=>new RegExp(`(?<![\\w$.])${i.replace(/\$/g,"\\$")}(?![\\w$])`).test(t.code)))}if(r.size>0)return null}return s.map((e,t)=>{let n=new Set([...e.declared,...o[t]]);return`function() {
10
+ })();`;return I()?et(n):n}function T(s){let o=new Set;for(let e of s.matchAll(/^(?:export\s+)?(?:async\s+)?(?:const|let|var|function\*?|class)\s+([A-Z_a-z$][\w$]*)/gm))o.add(e[1]);for(let e of s.matchAll(/^(?:const|let|var)\s*[{[]([^=]*)[}\]]\s*=/gm))for(let t of(e[1]??"").split(",")){let n=(t.includes(":")?t.split(":").pop():t).replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(n))o.add(n)}return o}function j(s){let o=s.map((e)=>T(e.code));for(let[e,t]of s.entries()){let n=new Set;for(let[i,f]of o.entries()){if(i===e)continue;for(let u of f)if(!o[e].has(u)&&!t.declared.has(u))n.add(u)}if(n.size===0)continue;let r;try{r=De(t.code,n)}catch{r=new Set([...n].filter((i)=>new RegExp(`(?<![\\w$.])${i.replace(/\$/g,"\\$")}(?![\\w$])`).test(t.code)))}if(r.size>0)return null}return s.map((e,t)=>{let n=new Set([...e.declared,...o[t]]);return`function() {
11
11
  var __stx = window.stx || {};
12
- ${C.filter((i)=>!n.has(i)&&new RegExp(`\\b${i}\\b`).test(e.code)).map((i)=>`var ${i} = __stx[${JSON.stringify(i)}];`).join(`
12
+ ${E.filter((i)=>!n.has(i)&&new RegExp(`\\b${i}\\b`).test(e.code)).map((i)=>`var ${i} = __stx[${JSON.stringify(i)}];`).join(`
13
13
  `)}
14
14
  ${e.code}
15
- }`})}var M=new WeakMap;async function _h(s){let o=await O(s);if(!o)return null;let e=M.get(o);if(e===void 0)e=R(o.chunks),M.set(o,e);return e}function W(s){if(!/\buseStore\b/.test(s))return!1;if(/\buseStore\s+as\s+[A-Za-z_$]/.test(s))return!0;if(/\{[^{}]*\buseStore\s*:\s*[A-Za-z_$[{][^{}]*\}\s*=(?!=)/.test(s))return!0;if(/\[\s*(['"`])useStore\1\s*\]/.test(s.replace(/\b(?:var|let|const)\s+useStore\s*=\s*[\w$.]*\[\s*(['"`])useStore\1\s*\]/g," ")))return!0;let o=s.replace(/\/\*[\s\S]*?\*\//g," ").replace(/(^|[^:\\'"`])\/\/[^\n]*/g,"$1 ").replace(/\b(?:var|let|const)\s+useStore\s*=\s*[\w$.]*\[\s*(['"`])useStore\1\s*\]/g," ").replace(/\b(?:const|let|var)\s*\{[^{}]*\}\s*=/g," ").replace(/\bimport\s*(?:type\s+)?\{[^{}]*\}\s*from\b/g," ").replace(/\bexport\s*(?:type\s+)?\{[^{}]*\}/g," ").replace(/\btypeof\s+useStore\b/g," ").replace(/(['"`])useStore\1/g," ");for(let e of o.matchAll(/\buseStore\b/g)){let t=o.slice(Math.max(0,e.index-9),e.index);if(/\bfunction\s*$/.test(t))continue;let n=o.slice(e.index+8).trimStart();if(n.startsWith("(")||n.startsWith("<")||n.startsWith("?.("))continue;if(/^=(?![=>])/.test(n))continue;return!0}return!1}function Ro(...s){let o=new Set,e=!1;for(let t of s){if(!t)continue;if(/__STX_STORES__|\b_stores\b/.test(t))e=!0;if(W(t))e=!0;let n=t.match(/\buseStore\s*(?:<[^>()]*>)?\s*(?:\?\.\s*)?\(/g)?.length??0;if(n===0)continue;let r=0;for(let i of t.matchAll(/\buseStore\s*(?:<[^>()]*>)?\s*(?:\?\.\s*)?\(\s*(['"`])([^'"`$\\]+)\1\s*[,)]/g))o.add(i[2]),r++;if(r!==n)e=!0}return{names:o,all:e}}var z=new Map;function Ch(s){let o=new Set,e=!1;for(let t of s){if(/\.(?:css|json|svg|wasm|png|jpe?g|gif|webp|avif|woff2?|ttf|txt|md)$/i.test(t))continue;let n;try{let r=v.statSync(t),i=z.get(t);if(i&&i.mtimeMs===r.mtimeMs&&i.size===r.size)n=i.read;else n=Ro(v.readFileSync(t,"utf8")),z.set(t,{mtimeMs:r.mtimeMs,size:r.size,read:n})}catch{n={names:new Set,all:!0}}if(n.all)e=!0;for(let r of n.names)o.add(r)}return{names:o,all:e}}function Eh(s=x.env){return s.STX_PAGE_STORES==="all"}async function Th(s,o,e={}){let t=await O(s,e.sharedModules);if(!t)return null;let{chunks:n}=t,r=Ro(...o);if(e.reads){if(e.reads.all)r.all=!0;for(let u of e.reads.names)r.names.add(u)}let i=e.runOnce?Z(t):void 0,f;if(e.all||r.all||n.some((u)=>u.ids.length===0)||i===null)f=n;else{let u=new Map;for(let d of n)for(let S of d.ids)u.set(S,d);let m=new Set,p=[...r.names],g=!1;while(p.length>0&&!g){let d=u.get(p.pop());if(!d||m.has(d))continue;m.add(d);let S=Ro(d.code);if(S.all)g=!0;else p.push(...S.names)}f=g?n:n.filter((d)=>m.has(d))}if(f.length===0)return null;if(i){let u=f.map((d)=>i.get(d)),m=f.map((d)=>d.name),p=F.get(t);if(!p)F.set(t,p=new Map);let g=p.get(m.join("\x00"));if(g===void 0)p.set(m.join("\x00"),g=P(m,u));return{code:g,stores:m,functions:u}}return{code:R(f),stores:f.map((u)=>u.name),functions:j(f)}}var F=new WeakMap,w=new WeakMap;function Z(s){if(w.has(s))return w.get(s);let o=j(s.chunks),e=o?new Map(s.chunks.map((t,n)=>[t,o[n]])):null;return w.set(s,e),e}function P(s,o){let t=`;(function(){
15
+ }`})}var v=new WeakMap;async function Oh(s){let o=await O(s);if(!o)return null;let e=v.get(o);if(e===void 0)e=R(o.chunks),v.set(o,e);return e}function W(s){if(!/\buseStore\b/.test(s))return!1;if(/\buseStore\s+as\s+[A-Za-z_$]/.test(s))return!0;if(/\{[^{}]*\buseStore\s*:\s*[A-Za-z_$[{][^{}]*\}\s*=(?!=)/.test(s))return!0;if(/\[\s*(['"`])useStore\1\s*\]/.test(s.replace(/\b(?:var|let|const)\s+useStore\s*=\s*[\w$.]*\[\s*(['"`])useStore\1\s*\]/g," ")))return!0;let o=s.replace(/\/\*[\s\S]*?\*\//g," ").replace(/(^|[^:\\'"`])\/\/[^\n]*/g,"$1 ").replace(/\b(?:var|let|const)\s+useStore\s*=\s*[\w$.]*\[\s*(['"`])useStore\1\s*\]/g," ").replace(/\b(?:const|let|var)\s*\{[^{}]*\}\s*=/g," ").replace(/\bimport\s*(?:type\s+)?\{[^{}]*\}\s*from\b/g," ").replace(/\bexport\s*(?:type\s+)?\{[^{}]*\}/g," ").replace(/\btypeof\s+useStore\b/g," ").replace(/(['"`])useStore\1/g," ");for(let e of o.matchAll(/\buseStore\b/g)){let t=o.slice(Math.max(0,e.index-9),e.index);if(/\bfunction\s*$/.test(t))continue;let n=o.slice(e.index+8).trimStart();if(n.startsWith("(")||n.startsWith("<")||n.startsWith("?.("))continue;if(/^=(?![=>])/.test(n))continue;return!0}return!1}function Do(...s){let o=new Set,e=!1;for(let t of s){if(!t)continue;if(/__STX_STORES__|\b_stores\b/.test(t))e=!0;if(W(t))e=!0;let n=t.match(/\buseStore\s*(?:<[^>()]*>)?\s*(?:\?\.\s*)?\(/g)?.length??0;if(n===0)continue;let r=0;for(let i of t.matchAll(/\buseStore\s*(?:<[^>()]*>)?\s*(?:\?\.\s*)?\(\s*(['"`])([^'"`$\\]+)\1\s*[,)]/g))o.add(i[2]),r++;if(r!==n)e=!0}return{names:o,all:e}}var z=new Map;function Nh(s){let o=new Set,e=!1;for(let t of s){if(/\.(?:css|json|svg|wasm|png|jpe?g|gif|webp|avif|woff2?|ttf|txt|md)$/i.test(t))continue;let n;try{let r=C.statSync(t),i=z.get(t);if(i&&i.mtimeMs===r.mtimeMs&&i.size===r.size)n=i.read;else n=Do(C.readFileSync(t,"utf8")),z.set(t,{mtimeMs:r.mtimeMs,size:r.size,read:n})}catch{n={names:new Set,all:!0}}if(n.all)e=!0;for(let r of n.names)o.add(r)}return{names:o,all:e}}function Mh(s=x.env){return s.STX_PAGE_STORES==="all"}async function Dh(s,o,e={}){let t=await O(s,e.sharedModules);if(!t)return null;let{chunks:n}=t,r=Do(...o);if(e.reads){if(e.reads.all)r.all=!0;for(let u of e.reads.names)r.names.add(u)}let i=e.runOnce?Z(t):void 0,f;if(e.all||r.all||n.some((u)=>u.ids.length===0)||i===null)f=n;else{let u=new Map;for(let d of n)for(let S of d.ids)u.set(S,d);let m=new Set,p=[...r.names],g=!1;while(p.length>0&&!g){let d=u.get(p.pop());if(!d||m.has(d))continue;m.add(d);let S=Do(d.code);if(S.all)g=!0;else p.push(...S.names)}f=g?n:n.filter((d)=>m.has(d))}if(f.length===0)return null;if(i){let u=f.map((d)=>i.get(d)),m=f.map((d)=>d.name),p=F.get(t);if(!p)F.set(t,p=new Map);let g=p.get(m.join("\x00"));if(g===void 0)p.set(m.join("\x00"),g=P(m,u));return{code:g,stores:m,functions:u}}return{code:R(f),stores:f.map((u)=>u.name),functions:j(f)}}var F=new WeakMap,w=new WeakMap;function Z(s){if(w.has(s))return w.get(s);let o=j(s.chunks),e=o?new Map(s.chunks.map((t,n)=>[t,o[n]])):null;return w.set(s,e),e}function P(s,o){let t=`;(function(){
16
16
  var ran = window.__stxStoreFiles || (window.__stxStoreFiles = {});
17
17
  function run(name, define) {
18
18
  if (ran[name]) return;
@@ -22,5 +22,5 @@ function run(name, define) {
22
22
  }
23
23
  ${s.map((n,r)=>`run(${JSON.stringify(n)}, ${o[r]})`).join(`;
24
24
  `)};
25
- })();`;return A()?On(t):t}function $h(){h.clear(),Xn()}
26
- export{_h,Ro,Ch,Eh,Th,$h};
25
+ })();`;return I()?et(t):t}function Lh(){h.clear(),er()}
26
+ export{Oh,Do,Nh,Mh,Dh,Lh};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- function N(s){let o=/import\s*\{([^}]+)\}\s*from\s*['"](@stores|stx\/stores)['"]\s*;?\n?/g;s=s.replace(o,(e,t)=>`const { ${t.split(",").map((r)=>r.trim()).filter(Boolean).join(", ")} } = window.__STX_STORES__
2
+ function M(s){let o=/import\s*\{([^}]+)\}\s*from\s*['"](@stores|stx\/stores)['"]\s*;?\n?/g;s=s.replace(o,(e,t)=>`const { ${t.split(",").map((r)=>r.trim()).filter(Boolean).join(", ")} } = window.__STX_STORES__
3
3
  `);let n=/import\s*\{([^}]+)\}\s*from\s*['"]@composables['"]\s*;?\n?/g;return s=s.replace(n,(e,t)=>`const { ${t.split(",").map((r)=>r.trim()).filter(Boolean).join(", ")} } = window.__composables
4
- `),s}function Nn(s){return s.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}
5
- export{N,Nn};
4
+ `),s}function jn(s){return s.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}
5
+ export{M,jn};