@stacksjs/stx 0.2.874 → 0.2.876

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/dist/chunk-027meh1k.js +2 -0
  2. package/dist/{chunk-gbtbfg7e.js → chunk-0g2mg8cw.js} +3 -3
  3. package/dist/chunk-0hs633pt.js +2 -0
  4. package/dist/chunk-0j8zre1m.js +2 -0
  5. package/dist/{chunk-6mkn81pd.js → chunk-0sa9gqmc.js} +7 -7
  6. package/dist/chunk-0v02qms8.js +2 -0
  7. package/dist/chunk-0z9gttw0.js +2 -0
  8. package/dist/chunk-11dwmcpy.js +3 -0
  9. package/dist/{chunk-vxtx0khv.js → chunk-1a237qky.js} +9 -9
  10. package/dist/{chunk-c3kanj1m.js → chunk-1ehjzhnc.js} +3 -3
  11. package/dist/chunk-1gfg6qmr.js +2 -0
  12. package/dist/chunk-1kgnk6ds.js +2 -0
  13. package/dist/{chunk-6ftee542.js → chunk-1q5w3xav.js} +2 -2
  14. package/dist/chunk-1ztp5vkh.js +3 -0
  15. package/dist/{chunk-p1a1kbhz.js → chunk-2mt2zc5y.js} +8 -8
  16. package/dist/{chunk-kdmwy40c.js → chunk-2tcyfrvb.js} +2 -2
  17. package/dist/{chunk-01mwbg1r.js → chunk-2zaatnnh.js} +4 -4
  18. package/dist/chunk-32wvc376.js +2 -0
  19. package/dist/{chunk-b8z3vepm.js → chunk-3922g6sh.js} +9 -9
  20. package/dist/chunk-3k2d2jsn.js +2 -0
  21. package/dist/{chunk-v4xes880.js → chunk-3mz9bdf7.js} +3 -3
  22. package/dist/chunk-3te2y9qf.js +2 -0
  23. package/dist/{chunk-farh4p7f.js → chunk-3w7gacva.js} +2 -2
  24. package/dist/chunk-40330tm5.js +2 -0
  25. package/dist/chunk-447jc6zc.js +2 -0
  26. package/dist/{chunk-s584xnzx.js → chunk-4517hny7.js} +2 -2
  27. package/dist/chunk-4dk6k0ad.js +2 -0
  28. package/dist/chunk-4e48zkq0.js +2 -0
  29. package/dist/chunk-5ep7p8te.js +2 -0
  30. package/dist/chunk-5gx403te.js +1184 -0
  31. package/dist/{chunk-zt9j94ak.js → chunk-6kp4mg3h.js} +2 -2
  32. package/dist/chunk-6q9a5bph.js +2 -0
  33. package/dist/{chunk-n3jw3xpj.js → chunk-75v0yxeh.js} +2 -2
  34. package/dist/chunk-7ds9mx4c.js +2 -0
  35. package/dist/chunk-7njy024g.js +2 -0
  36. package/dist/{chunk-p219rr27.js → chunk-7rep2jqh.js} +14 -14
  37. package/dist/chunk-7tjewwmd.js +2 -0
  38. package/dist/chunk-85xabvtj.js +2 -0
  39. package/dist/chunk-880f8j99.js +2 -0
  40. package/dist/chunk-8f3dbthj.js +2 -0
  41. package/dist/{chunk-nack2xs5.js → chunk-976kgb3r.js} +5 -5
  42. package/dist/chunk-99e3mxnn.js +20 -0
  43. package/dist/chunk-9gv847nn.js +2 -0
  44. package/dist/chunk-9mz2n39m.js +2 -0
  45. package/dist/{chunk-55zq2ha8.js → chunk-ae8q4gze.js} +5 -5
  46. package/dist/{chunk-hev4t4d5.js → chunk-afxfkb60.js} +6 -6
  47. package/dist/{chunk-fr72bsqd.js → chunk-akthsg33.js} +11 -11
  48. package/dist/chunk-b1tcym2x.js +2 -0
  49. package/dist/{chunk-j1efsjsb.js → chunk-b4d4tjvx.js} +5 -5
  50. package/dist/{chunk-j89p53vx.js → chunk-bdh73gxd.js} +2 -2
  51. package/dist/{chunk-4068rmzv.js → chunk-bjjfr7qt.js} +2 -2
  52. package/dist/chunk-bspj1rf1.js +2 -0
  53. package/dist/chunk-bx3hpsxn.js +2 -0
  54. package/dist/chunk-byq488g4.js +2 -0
  55. package/dist/chunk-c4s25bm2.js +2 -0
  56. package/dist/{chunk-ttm0gvrc.js → chunk-cj44e8mw.js} +5 -5
  57. package/dist/chunk-csjqtzwc.js +2 -0
  58. package/dist/{chunk-2xc457bf.js → chunk-ctjxcaxq.js} +14 -14
  59. package/dist/{chunk-79mmzprp.js → chunk-cvbwxskc.js} +5 -5
  60. package/dist/{chunk-7j0qkye5.js → chunk-d3q0cg47.js} +2 -2
  61. package/dist/{chunk-b666d8m6.js → chunk-d6gqh2wv.js} +1 -1
  62. package/dist/{chunk-vvxcebpn.js → chunk-dbvsa5ya.js} +2 -2
  63. package/dist/{chunk-hr147ys5.js → chunk-df6vjs3p.js} +5 -5
  64. package/dist/chunk-df78j74w.js +4 -0
  65. package/dist/chunk-dgs3d367.js +2 -0
  66. package/dist/chunk-dmf6zcf4.js +2 -0
  67. package/dist/{chunk-a0dsp485.js → chunk-dv56x3g8.js} +10 -10
  68. package/dist/chunk-e2b2f502.js +2 -0
  69. package/dist/chunk-ec6mrad6.js +2 -0
  70. package/dist/{chunk-xdfmrv49.js → chunk-eecctzgp.js} +6 -6
  71. package/dist/{chunk-8hhhmscy.js → chunk-eknm4jrm.js} +2 -2
  72. package/dist/{chunk-4nb7egk0.js → chunk-esjr9qhe.js} +2 -2
  73. package/dist/{chunk-wk2rge05.js → chunk-f4vgagjb.js} +3 -3
  74. package/dist/chunk-fa57bncd.js +2 -0
  75. package/dist/{chunk-qjey0jk6.js → chunk-fdjx4vs3.js} +2 -2
  76. package/dist/{chunk-pqy58ps0.js → chunk-fh72k2ks.js} +6 -6
  77. package/dist/{chunk-zfrzdje6.js → chunk-ft6em3wm.js} +6 -6
  78. package/dist/{chunk-bv9dbf4m.js → chunk-fwbccyhw.js} +2 -2
  79. package/dist/{chunk-3z4p70t5.js → chunk-g15reb1h.js} +6 -6
  80. package/dist/chunk-g4eheg0t.js +24 -0
  81. package/dist/chunk-gfe1jrw9.js +2 -0
  82. package/dist/chunk-gn16yq49.js +2 -0
  83. package/dist/{chunk-qcxrcypb.js → chunk-gqtb53s8.js} +2 -2
  84. package/dist/chunk-gvs61tqn.js +2 -0
  85. package/dist/{chunk-gxan9w4e.js → chunk-h17pfbng.js} +2 -2
  86. package/dist/chunk-h2928108.js +2 -0
  87. package/dist/chunk-hat353vx.js +2 -0
  88. package/dist/{chunk-ykapdv6d.js → chunk-j0rqa9bk.js} +3 -3
  89. package/dist/chunk-jmjgj3nh.js +2 -0
  90. package/dist/chunk-jqtpzzz4.js +12 -0
  91. package/dist/{chunk-hmdkf6c6.js → chunk-jqxerj6k.js} +2 -2
  92. package/dist/{chunk-3z1mmar2.js → chunk-jt5tzddc.js} +2 -2
  93. package/dist/{chunk-n56x7jg8.js → chunk-jvy7z3hz.js} +1 -1
  94. package/dist/{chunk-c8jhskx8.js → chunk-k0t9ye9j.js} +38 -38
  95. package/dist/{chunk-q50x1gfd.js → chunk-k1ew643q.js} +2 -2
  96. package/dist/{chunk-pqgc8k6k.js → chunk-k9dne5by.js} +1 -1
  97. package/dist/chunk-kq8mffgf.js +2 -0
  98. package/dist/chunk-kx06jzdw.js +2 -0
  99. package/dist/{chunk-ysfeg3cn.js → chunk-kywe0f1v.js} +2 -2
  100. package/dist/{chunk-60yppcbb.js → chunk-kzc2tqzr.js} +2 -2
  101. package/dist/{chunk-9zrvh3pz.js → chunk-mce3g2wb.js} +2 -2
  102. package/dist/{chunk-0k11nsv1.js → chunk-mkwavsb3.js} +3 -3
  103. package/dist/{chunk-bbq79tap.js → chunk-mw0rb1sf.js} +4 -4
  104. package/dist/chunk-n5pvdrkb.js +2 -0
  105. package/dist/chunk-ne8q191s.js +2 -0
  106. package/dist/{chunk-tabkp672.js → chunk-nn6hvsxp.js} +1 -1
  107. package/dist/{chunk-e7s109j6.js → chunk-nnp6rf4c.js} +1 -1
  108. package/dist/chunk-np8wgbsa.js +3 -0
  109. package/dist/chunk-nthw4dca.js +2 -0
  110. package/dist/{chunk-tyvm49be.js → chunk-nv4c25zj.js} +3 -3
  111. package/dist/{chunk-dhbpbjt3.js → chunk-p5m1z6e1.js} +6 -6
  112. package/dist/{chunk-18a3vdnq.js → chunk-pk714ynv.js} +4 -4
  113. package/dist/{chunk-csymxc5a.js → chunk-pp99rmjm.js} +15 -15
  114. package/dist/chunk-pqmjeea6.js +2 -0
  115. package/dist/chunk-qggwr60r.js +2 -0
  116. package/dist/chunk-qm3v4qb7.js +2 -0
  117. package/dist/{chunk-40h07m5w.js → chunk-qnwd5bz4.js} +1 -1
  118. package/dist/chunk-qty0t69x.js +2 -0
  119. package/dist/{chunk-tnp2ta5q.js → chunk-r09kz9bf.js} +2 -2
  120. package/dist/{chunk-q1wxgw5s.js → chunk-r2bxjna3.js} +2 -2
  121. package/dist/chunk-rjv6885r.js +2 -0
  122. package/dist/chunk-rm5gbthk.js +2 -0
  123. package/dist/{chunk-6vgr5g6d.js → chunk-rzd9hyhv.js} +2 -2
  124. package/dist/{chunk-8tk8yf91.js → chunk-s7fhpkvf.js} +6 -6
  125. package/dist/{chunk-ew5cey88.js → chunk-saqzk45g.js} +1 -1
  126. package/dist/chunk-sgengtap.js +2 -0
  127. package/dist/{chunk-srgnevws.js → chunk-stn7p7f1.js} +2 -2
  128. package/dist/{chunk-wa3z5c8j.js → chunk-szp7ajfm.js} +4 -4
  129. package/dist/chunk-ts37jw3s.js +2 -0
  130. package/dist/{chunk-xakypz4t.js → chunk-ttjscvre.js} +3 -3
  131. package/dist/{chunk-cqhwzd9y.js → chunk-v0tdg16k.js} +5 -5
  132. package/dist/chunk-v4emesnw.js +2 -0
  133. package/dist/{chunk-bast33qy.js → chunk-vnkvnenn.js} +6 -6
  134. package/dist/{chunk-ymdw4fhd.js → chunk-vnrbjbrw.js} +2 -2
  135. package/dist/chunk-vxra53wq.js +2 -0
  136. package/dist/{chunk-w5nw8e2p.js → chunk-w8k9fz1w.js} +7 -7
  137. package/dist/{chunk-m131znxe.js → chunk-wm029dh0.js} +13 -13
  138. package/dist/{chunk-hhbt8grm.js → chunk-wp0qpa50.js} +4 -4
  139. package/dist/{chunk-01c16zw4.js → chunk-wzvdr4ta.js} +2 -2
  140. package/dist/{chunk-e2t7mk29.js → chunk-x2ftkaz3.js} +2 -2
  141. package/dist/{chunk-atpscb2m.js → chunk-x4jzhgdm.js} +2 -2
  142. package/dist/chunk-x76qvq1n.js +2 -0
  143. package/dist/chunk-x85z6dmw.js +2 -0
  144. package/dist/chunk-xkfe03y9.js +2 -0
  145. package/dist/{chunk-v37zmez0.js → chunk-xmws1gaf.js} +2 -2
  146. package/dist/{chunk-a8164hnf.js → chunk-xtaq95em.js} +1 -1
  147. package/dist/{chunk-5a0d3048.js → chunk-y2e2zm6y.js} +3 -3
  148. package/dist/chunk-y4hn1qh0.js +2 -0
  149. package/dist/{chunk-pywz8q4k.js → chunk-y75bds1g.js} +31 -31
  150. package/dist/chunk-yc8ggeh2.js +2 -0
  151. package/dist/{chunk-r0v2chpn.js → chunk-ydppkb8y.js} +2 -2
  152. package/dist/chunk-yfed67yc.js +2 -0
  153. package/dist/{chunk-7ayvybdy.js → chunk-ysfgabpf.js} +3 -3
  154. package/dist/{chunk-fd1bpv35.js → chunk-yxdhz4ps.js} +2 -2
  155. package/dist/{chunk-rw5492e2.js → chunk-zc8a2erc.js} +4 -4
  156. package/dist/chunk-zgds9nwv.js +1609 -0
  157. package/dist/{chunk-7cvbz4eq.js → chunk-zn6n075d.js} +3 -3
  158. package/dist/cli.js +22 -22
  159. package/dist/component-library.d.ts +31 -1
  160. package/dist/component-library.js +74 -54
  161. package/dist/craft-entry.js +2 -2
  162. package/dist/craft.js +2 -2
  163. package/dist/inherited-context.d.ts +14 -0
  164. package/dist/inherited-context.js +102 -0
  165. package/dist/native-component-context.d.ts +10 -0
  166. package/dist/native-component-context.js +95 -0
  167. package/dist/pwa.js +3 -3
  168. package/dist/ssg.js +12 -12
  169. package/dist/stx-virtual-ts.d.ts +14 -2
  170. package/dist/stx-virtual-ts.js +64 -34
  171. package/dist/typecheck.d.ts +5 -2
  172. package/dist/typecheck.js +29 -19
  173. package/package.json +5 -5
  174. package/dist/chunk-09jz09k9.js +0 -20
  175. package/dist/chunk-10h8v5d4.js +0 -2
  176. package/dist/chunk-19dsn6tp.js +0 -2
  177. package/dist/chunk-26vxgd2w.js +0 -2
  178. package/dist/chunk-277dpq3b.js +0 -2
  179. package/dist/chunk-2asyyky3.js +0 -2
  180. package/dist/chunk-2r9s38f6.js +0 -2
  181. package/dist/chunk-2xhwadvn.js +0 -2
  182. package/dist/chunk-46pxmpeb.js +0 -3
  183. package/dist/chunk-4es07dwb.js +0 -2
  184. package/dist/chunk-4pr29yrx.js +0 -2
  185. package/dist/chunk-4v70bs2q.js +0 -2
  186. package/dist/chunk-4ygesqbx.js +0 -2
  187. package/dist/chunk-54jx5hqh.js +0 -2
  188. package/dist/chunk-5nj2k8zf.js +0 -2
  189. package/dist/chunk-6pczzq5f.js +0 -2
  190. package/dist/chunk-73k579v7.js +0 -2
  191. package/dist/chunk-7c9pzpsw.js +0 -2
  192. package/dist/chunk-7etvn4dx.js +0 -2
  193. package/dist/chunk-7wqevtks.js +0 -2
  194. package/dist/chunk-93538x9s.js +0 -2
  195. package/dist/chunk-9fyw1xkh.js +0 -3
  196. package/dist/chunk-9waxasf6.js +0 -712
  197. package/dist/chunk-a5qxcz86.js +0 -4
  198. package/dist/chunk-asrzmw7w.js +0 -2
  199. package/dist/chunk-awmfyb3t.js +0 -2
  200. package/dist/chunk-ba91r7q9.js +0 -2
  201. package/dist/chunk-cvgbtmxp.js +0 -2
  202. package/dist/chunk-d0h18m2r.js +0 -2
  203. package/dist/chunk-d5zh2663.js +0 -2
  204. package/dist/chunk-djdganvr.js +0 -2
  205. package/dist/chunk-dmcmxf3a.js +0 -2
  206. package/dist/chunk-eczy00w6.js +0 -2
  207. package/dist/chunk-esb34a1r.js +0 -20
  208. package/dist/chunk-f4wezqh4.js +0 -2
  209. package/dist/chunk-f52b9hjv.js +0 -2
  210. package/dist/chunk-f8pp58kw.js +0 -2
  211. package/dist/chunk-g3tfct27.js +0 -2
  212. package/dist/chunk-g9m84nqk.js +0 -2
  213. package/dist/chunk-gc4bgven.js +0 -2
  214. package/dist/chunk-gvh45ddc.js +0 -2
  215. package/dist/chunk-gvz0kqkz.js +0 -2
  216. package/dist/chunk-h2qgqjkn.js +0 -2
  217. package/dist/chunk-hcaedzck.js +0 -2
  218. package/dist/chunk-j4zrq17p.js +0 -2
  219. package/dist/chunk-kz0txvqb.js +0 -2
  220. package/dist/chunk-m9cperj4.js +0 -2
  221. package/dist/chunk-me7cxs0e.js +0 -2
  222. package/dist/chunk-meqsd5bt.js +0 -2
  223. package/dist/chunk-p2kqsb5k.js +0 -2
  224. package/dist/chunk-pvrgv5cx.js +0 -2051
  225. package/dist/chunk-rqa92xm4.js +0 -2
  226. package/dist/chunk-s54e61xt.js +0 -2
  227. package/dist/chunk-s92j8k4z.js +0 -2
  228. package/dist/chunk-sw8ms82g.js +0 -2
  229. package/dist/chunk-swfvh1cz.js +0 -3
  230. package/dist/chunk-tp2ftck2.js +0 -2
  231. package/dist/chunk-vd679g2w.js +0 -2
  232. package/dist/chunk-vk98r75z.js +0 -2
  233. package/dist/chunk-vmq773pb.js +0 -2
  234. package/dist/chunk-vv65gsys.js +0 -2
  235. package/dist/chunk-w6ry02z8.js +0 -2
  236. package/dist/chunk-w8qr5414.js +0 -2
  237. package/dist/chunk-xjxcwrqs.js +0 -2
  238. package/dist/chunk-xye2mkbh.js +0 -2
  239. package/dist/chunk-ytzzth34.js +0 -2
  240. package/dist/chunk-yxpjj003.js +0 -2
  241. package/dist/chunk-z6c4c951.js +0 -2
  242. package/dist/chunk-z9xe3xkg.js +0 -12
  243. package/dist/chunk-zmfqx1b1.js +0 -2
  244. package/dist/chunk-zze8tw0h.js +0 -2
@@ -1,16 +1,16 @@
1
1
  // @bun
2
- import{S,_,Si,wn}from"./chunk-9waxasf6.js";import{ni}from"./chunk-zt9j94ak.js";import{l}from"./chunk-46pxmpeb.js";import{D,f}from"./chunk-fd1bpv35.js";import M from"fs";import d from"path";import{hasLocalConfig as ye}from"bunfig";var _t={fg:{light:"neutral-900",dark:"neutral-100",description:"Primary text"},"fg-strong":{light:"neutral-700",dark:"neutral-300",description:"Labels, secondary headings"},"fg-muted":{light:"neutral-600",dark:"neutral-400",description:"Supporting text"},"fg-soft":{light:"neutral-500",dark:"neutral-400",description:"De-emphasised text"},"fg-subtle":{light:"neutral-400",dark:"neutral-500",description:"Recessive, non-essential text"},surface:{light:"neutral-50",dark:"neutral-800",description:"Page and panel background"},"surface-raised":{light:"neutral-100",dark:"neutral-700",description:"Cards, popovers"},"surface-sunken":{light:"neutral-200",dark:"neutral-700",description:"Wells, track backgrounds"},panel:{light:"white",dark:"neutral-800",description:"Card, menu, dialog surface"},field:{light:"white",dark:"neutral-700",description:"Form control surface"},page:{light:"neutral-50",dark:"neutral-900",description:"Page background, behind panels"},content:{light:"white",dark:"neutral-900",description:"Content area under a chrome header - a table or list body"},"surface-hover":{light:"neutral-100",dark:"neutral-700",description:"Row or item highlight on a page or panel"},"surface-raised-hover":{light:"neutral-200",dark:"neutral-600",description:"Raised surface, hovered"},"surface-sunken-hover":{light:"neutral-300",dark:"neutral-600",description:"Sunken surface, hovered"},"field-hover":{light:"neutral-50",dark:"neutral-600",description:"Form control surface, hovered"},link:{light:"blue-500",dark:"blue-400",description:"Hyperlink"},"link-hover":{light:"blue-600",dark:"blue-300",description:"Hyperlink, hovered"},inverse:{light:"neutral-900",dark:"neutral-700",description:"Tooltip bubble, inverted surface"},"inverse-ink":{light:"white",dark:"white",description:"Text on an inverted surface"},line:{light:"neutral-200",dark:"neutral-700",description:"Default border, divider"},"line-strong":{light:"neutral-300",dark:"neutral-600",description:"Input border, focus ring track"},"line-hover":{light:"neutral-400",dark:"neutral-500",description:"Border of a hovered control"},accent:{light:"blue-600",dark:"blue-400",description:"Primary action, selected state"},info:{light:"cyan-600",dark:"cyan-400",description:"Informational emphasis"},danger:{light:"red-600",dark:"red-400",description:"Errors, destructive actions"},success:{light:"green-600",dark:"green-400",description:"Confirmation"},warning:{light:"yellow-600",dark:"yellow-400",description:"Caution"},"accent-solid":{light:"blue-500",dark:"blue-600",description:"Primary button fill"},"info-solid":{light:"cyan-500",dark:"cyan-600",description:"Informational fill"},"danger-solid":{light:"red-500",dark:"red-600",description:"Destructive button fill"},"success-solid":{light:"green-500",dark:"green-600",description:"Confirmation fill"},"warning-solid":{light:"yellow-500",dark:"yellow-600",description:"Caution fill"},"accent-solid-hover":{light:"blue-600",dark:"blue-700",description:"Primary button fill, hovered"},"info-solid-hover":{light:"cyan-600",dark:"cyan-700",description:"Informational fill, hovered"},"danger-solid-hover":{light:"red-600",dark:"red-700",description:"Destructive fill, hovered"},"success-solid-hover":{light:"green-600",dark:"green-700",description:"Confirmation fill, hovered"},"warning-solid-hover":{light:"yellow-600",dark:"yellow-700",description:"Caution fill, hovered"},"accent-ink":{light:"white",dark:"white",description:"Text on a primary fill"},"info-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on an informational fill"},"danger-ink":{light:"white",dark:"white",description:"Text on a destructive fill"},"success-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on a confirmation fill"},"warning-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on a caution fill"},"accent-soft":{light:"blue-100",dark:"blue-900",description:"Tinted primary fill"},"accent-soft-ink":{light:"blue-800",dark:"blue-200",description:"Text on a tinted primary fill"},"info-soft":{light:"cyan-100",dark:"cyan-900",description:"Tinted informational fill"},"info-soft-ink":{light:"cyan-800",dark:"cyan-200",description:"Text on a tinted informational fill"},"danger-soft":{light:"red-100",dark:"red-900",description:"Tinted destructive fill"},"danger-soft-ink":{light:"red-800",dark:"red-200",description:"Text on a tinted destructive fill"},"success-soft":{light:"green-100",dark:"green-900",description:"Tinted confirmation fill"},"success-soft-ink":{light:"green-800",dark:"green-200",description:"Text on a tinted confirmation fill"},"warning-soft":{light:"yellow-100",dark:"yellow-900",description:"Tinted caution fill"},"warning-soft-ink":{light:"yellow-800",dark:"yellow-200",description:"Text on a tinted caution fill"},secondary:{light:"purple-600",dark:"purple-400",description:"Secondary emphasis"},"secondary-solid":{light:"purple-500",dark:"purple-600",description:"Secondary fill"},"secondary-solid-hover":{light:"purple-600",dark:"purple-700",description:"Secondary fill, hovered"},"secondary-ink":{light:"white",dark:"white",description:"Text on a secondary fill"},"secondary-soft":{light:"purple-100",dark:"purple-900",description:"Tinted secondary fill"},"secondary-soft-ink":{light:"purple-800",dark:"purple-200",description:"Text on a tinted secondary fill"},"danger-fg":{light:"red-900",dark:"red-300",description:"Text in a field with an error"},"danger-fg-subtle":{light:"red-300",dark:"red-500",description:"Recessive text in a field with an error"},"danger-line":{light:"red-300",dark:"red-600",description:"Border of a field with an error"},"danger-focus":{light:"red-500",dark:"red-400",description:"Focus ring of a field with an error"}};function Qe(n){return`--stx-${n}`}function G(n,t){let s=t.lastIndexOf("-");if(s===-1)return typeof n[t]==="string"?n[t]:void 0;let r=n[t.slice(0,s)];if(!r||typeof r!=="object")return;let i=r[t.slice(s+1)];return typeof i==="string"?i:void 0}var $e=/^(?:#[\da-f]{3,8}|(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|var)\(.*\)|white|black|transparent|currentcolor)$/i;function te(n,t){let s=t.trim();return G(n,s)??($e.test(s)?s:void 0)}function ne(n={}){return[...Object.keys(n.roles??{}).filter((t)=>!_t[t]).map((t)=>`roles.${t}`),...Object.keys(n.shapes??{}).filter((t)=>!Se[t]).map((t)=>`shapes.${t}`),...Object.keys(n.density??{}).filter((t)=>!De[t]).map((t)=>`density.${t}`)]}function se(n){let t={};for(let[s,r]of Object.entries(_t)){let i=G(n,r.light);if(i===void 0)continue;t[s]=`var(${Qe(s)}, ${i})`}return t}function re(n,t={}){let s=[],r=[];for(let[i,a]of Object.entries(_t)){let c=t[i],g=typeof c==="string"?c:c?.light,o=typeof c==="string"?c:c?.dark,u=g&&te(n,g)||G(n,a.light),m=o&&te(n,o)||G(n,a.dark);if(u===void 0)continue;if(s.push(` ${Qe(i)}: ${u};`),m!==void 0)r.push(` ${Qe(i)}: ${m};`)}if(s.length===0)return"";return["/* stx role tokens \u2014 override any of these to re-theme by meaning. */",":root {",...s,"}",".dark {",...r,"}",""].join(`
3
- `)}var Se={control:{value:"0.375rem",description:"Buttons, inputs, selects \u2014 rounded-md"},panel:{value:"0.5rem",description:"Cards, dialogs, menus \u2014 rounded-lg"},pill:{value:"9999px",description:"Chips and badges, which are pill-shaped by intent"}};function gn(n){return`--stx-radius-${n}`}function ie(){let n={};for(let[t,s]of Object.entries(Se))n[t]=`var(${gn(t)}, ${s.value})`;return n}function oe(n={}){return["/* stx shape tokens \u2014 a radius by what the thing is. */",":root {",...Object.entries(Se).map(([t,s])=>` ${gn(t)}: ${n[t]??s.value};`),"}",""].join(`
4
- `)}var De={"control-px":{value:"1rem",description:"Inline padding of a md text control \u2014 px-4"},"control-py":{value:"0.5rem",description:"Block padding of a md text control \u2014 py-2"},"control-text":{value:"1rem",description:"Font size of a md text control \u2014 text-base"},"control-leading":{value:"1.5rem",description:"Line height of a md text control \u2014 text-base"},"cell-px":{value:"1.5rem",description:"Inline padding of every table cell, header or body \u2014 px-6"},"cell-py":{value:"1rem",description:"Block padding of a body cell \u2014 py-4"},"cell-text":{value:"0.875rem",description:"Font size of a body cell \u2014 text-sm"},"cell-leading":{value:"1.25rem",description:"Line height of a body cell \u2014 text-sm"},"cell-head-py":{value:"0.75rem",description:"Block padding of a header cell \u2014 py-3"},"cell-head-text":{value:"0.75rem",description:"Font size of a header cell \u2014 text-xs"},"cell-head-leading":{value:"1rem",description:"Line height of a header cell \u2014 text-xs"}},lr={"control-x":"control-px","control-y":"control-py","cell-x":"cell-px","cell-y":"cell-py","cell-head-y":"cell-head-py"},ur={control:{size:"control-text",leading:"control-leading"},cell:{size:"cell-text",leading:"cell-leading"},"cell-head":{size:"cell-head-text",leading:"cell-head-leading"}};function et(n){return`--stx-${n}`}function Q(n){let t=De[n];if(!t)throw Error(`[stx] unknown density token "${n}"`);return`var(${et(n)}, ${t.value})`}function ce(){let n={};for(let[t,s]of Object.entries(lr))n[t]=Q(s);return n}function ae(){let n={};for(let[t,{size:s,leading:r}]of Object.entries(ur))n[t]=[Q(s),{lineHeight:Q(r)}];return n}function le(n={}){return["/* stx density tokens \u2014 how much room a control or a table cell takes. */",":root {",...Object.entries(De).map(([t,s])=>` ${et(t)}: ${n[t]??s.value};`),"}",""].join(`
2
+ import{S,_,Ti,vn}from"./chunk-5gx403te.js";import{ii}from"./chunk-6kp4mg3h.js";import{l}from"./chunk-np8wgbsa.js";import{D,f}from"./chunk-yxdhz4ps.js";import M from"fs";import d from"path";import{hasLocalConfig as ye}from"bunfig";var _t={fg:{light:"neutral-900",dark:"neutral-100",description:"Primary text"},"fg-strong":{light:"neutral-700",dark:"neutral-300",description:"Labels, secondary headings"},"fg-muted":{light:"neutral-600",dark:"neutral-400",description:"Supporting text"},"fg-soft":{light:"neutral-500",dark:"neutral-400",description:"De-emphasised text"},"fg-subtle":{light:"neutral-400",dark:"neutral-500",description:"Recessive, non-essential text"},surface:{light:"neutral-50",dark:"neutral-800",description:"Page and panel background"},"surface-raised":{light:"neutral-100",dark:"neutral-700",description:"Cards, popovers"},"surface-sunken":{light:"neutral-200",dark:"neutral-700",description:"Wells, track backgrounds"},panel:{light:"white",dark:"neutral-800",description:"Card, menu, dialog surface"},field:{light:"white",dark:"neutral-700",description:"Form control surface"},page:{light:"neutral-50",dark:"neutral-900",description:"Page background, behind panels"},content:{light:"white",dark:"neutral-900",description:"Content area under a chrome header - a table or list body"},"surface-hover":{light:"neutral-100",dark:"neutral-700",description:"Row or item highlight on a page or panel"},"surface-raised-hover":{light:"neutral-200",dark:"neutral-600",description:"Raised surface, hovered"},"surface-sunken-hover":{light:"neutral-300",dark:"neutral-600",description:"Sunken surface, hovered"},"field-hover":{light:"neutral-50",dark:"neutral-600",description:"Form control surface, hovered"},link:{light:"blue-500",dark:"blue-400",description:"Hyperlink"},"link-hover":{light:"blue-600",dark:"blue-300",description:"Hyperlink, hovered"},inverse:{light:"neutral-900",dark:"neutral-700",description:"Tooltip bubble, inverted surface"},"inverse-ink":{light:"white",dark:"white",description:"Text on an inverted surface"},line:{light:"neutral-200",dark:"neutral-700",description:"Default border, divider"},"line-strong":{light:"neutral-300",dark:"neutral-600",description:"Input border, focus ring track"},"line-hover":{light:"neutral-400",dark:"neutral-500",description:"Border of a hovered control"},accent:{light:"blue-600",dark:"blue-400",description:"Primary action, selected state"},info:{light:"cyan-600",dark:"cyan-400",description:"Informational emphasis"},danger:{light:"red-600",dark:"red-400",description:"Errors, destructive actions"},success:{light:"green-600",dark:"green-400",description:"Confirmation"},warning:{light:"yellow-600",dark:"yellow-400",description:"Caution"},"accent-solid":{light:"blue-500",dark:"blue-600",description:"Primary button fill"},"info-solid":{light:"cyan-500",dark:"cyan-600",description:"Informational fill"},"danger-solid":{light:"red-500",dark:"red-600",description:"Destructive button fill"},"success-solid":{light:"green-500",dark:"green-600",description:"Confirmation fill"},"warning-solid":{light:"yellow-500",dark:"yellow-600",description:"Caution fill"},"accent-solid-hover":{light:"blue-600",dark:"blue-700",description:"Primary button fill, hovered"},"info-solid-hover":{light:"cyan-600",dark:"cyan-700",description:"Informational fill, hovered"},"danger-solid-hover":{light:"red-600",dark:"red-700",description:"Destructive fill, hovered"},"success-solid-hover":{light:"green-600",dark:"green-700",description:"Confirmation fill, hovered"},"warning-solid-hover":{light:"yellow-600",dark:"yellow-700",description:"Caution fill, hovered"},"accent-ink":{light:"white",dark:"white",description:"Text on a primary fill"},"info-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on an informational fill"},"danger-ink":{light:"white",dark:"white",description:"Text on a destructive fill"},"success-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on a confirmation fill"},"warning-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on a caution fill"},"accent-soft":{light:"blue-100",dark:"blue-900",description:"Tinted primary fill"},"accent-soft-ink":{light:"blue-800",dark:"blue-200",description:"Text on a tinted primary fill"},"info-soft":{light:"cyan-100",dark:"cyan-900",description:"Tinted informational fill"},"info-soft-ink":{light:"cyan-800",dark:"cyan-200",description:"Text on a tinted informational fill"},"danger-soft":{light:"red-100",dark:"red-900",description:"Tinted destructive fill"},"danger-soft-ink":{light:"red-800",dark:"red-200",description:"Text on a tinted destructive fill"},"success-soft":{light:"green-100",dark:"green-900",description:"Tinted confirmation fill"},"success-soft-ink":{light:"green-800",dark:"green-200",description:"Text on a tinted confirmation fill"},"warning-soft":{light:"yellow-100",dark:"yellow-900",description:"Tinted caution fill"},"warning-soft-ink":{light:"yellow-800",dark:"yellow-200",description:"Text on a tinted caution fill"},secondary:{light:"purple-600",dark:"purple-400",description:"Secondary emphasis"},"secondary-solid":{light:"purple-500",dark:"purple-600",description:"Secondary fill"},"secondary-solid-hover":{light:"purple-600",dark:"purple-700",description:"Secondary fill, hovered"},"secondary-ink":{light:"white",dark:"white",description:"Text on a secondary fill"},"secondary-soft":{light:"purple-100",dark:"purple-900",description:"Tinted secondary fill"},"secondary-soft-ink":{light:"purple-800",dark:"purple-200",description:"Text on a tinted secondary fill"},"danger-fg":{light:"red-900",dark:"red-300",description:"Text in a field with an error"},"danger-fg-subtle":{light:"red-300",dark:"red-500",description:"Recessive text in a field with an error"},"danger-line":{light:"red-300",dark:"red-600",description:"Border of a field with an error"},"danger-focus":{light:"red-500",dark:"red-400",description:"Focus ring of a field with an error"}};function et(n){return`--stx-${n}`}function G(n,t){let s=t.lastIndexOf("-");if(s===-1)return typeof n[t]==="string"?n[t]:void 0;let r=n[t.slice(0,s)];if(!r||typeof r!=="object")return;let i=r[t.slice(s+1)];return typeof i==="string"?i:void 0}var ve=/^(?:#[\da-f]{3,8}|(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|var)\(.*\)|white|black|transparent|currentcolor)$/i;function te(n,t){let s=t.trim();return G(n,s)??(ve.test(s)?s:void 0)}function ne(n={}){return[...Object.keys(n.roles??{}).filter((t)=>!_t[t]).map((t)=>`roles.${t}`),...Object.keys(n.shapes??{}).filter((t)=>!_e[t]).map((t)=>`shapes.${t}`),...Object.keys(n.density??{}).filter((t)=>!Le[t]).map((t)=>`density.${t}`)]}function se(n){let t={};for(let[s,r]of Object.entries(_t)){let i=G(n,r.light);if(i===void 0)continue;t[s]=`var(${et(s)}, ${i})`}return t}function re(n,t={}){let s=[],r=[];for(let[i,a]of Object.entries(_t)){let c=t[i],g=typeof c==="string"?c:c?.light,o=typeof c==="string"?c:c?.dark,u=g&&te(n,g)||G(n,a.light),m=o&&te(n,o)||G(n,a.dark);if(u===void 0)continue;if(s.push(` ${et(i)}: ${u};`),m!==void 0)r.push(` ${et(i)}: ${m};`)}if(s.length===0)return"";return["/* stx role tokens \u2014 override any of these to re-theme by meaning. */",":root {",...s,"}",".dark {",...r,"}",""].join(`
3
+ `)}var _e={control:{value:"0.375rem",description:"Buttons, inputs, selects \u2014 rounded-md"},panel:{value:"0.5rem",description:"Cards, dialogs, menus \u2014 rounded-lg"},pill:{value:"9999px",description:"Chips and badges, which are pill-shaped by intent"}};function gn(n){return`--stx-radius-${n}`}function ie(){let n={};for(let[t,s]of Object.entries(_e))n[t]=`var(${gn(t)}, ${s.value})`;return n}function oe(n={}){return["/* stx shape tokens \u2014 a radius by what the thing is. */",":root {",...Object.entries(_e).map(([t,s])=>` ${gn(t)}: ${n[t]??s.value};`),"}",""].join(`
4
+ `)}var Le={"control-px":{value:"1rem",description:"Inline padding of a md text control \u2014 px-4"},"control-py":{value:"0.5rem",description:"Block padding of a md text control \u2014 py-2"},"control-text":{value:"1rem",description:"Font size of a md text control \u2014 text-base"},"control-leading":{value:"1.5rem",description:"Line height of a md text control \u2014 text-base"},"cell-px":{value:"1.5rem",description:"Inline padding of every table cell, header or body \u2014 px-6"},"cell-py":{value:"1rem",description:"Block padding of a body cell \u2014 py-4"},"cell-text":{value:"0.875rem",description:"Font size of a body cell \u2014 text-sm"},"cell-leading":{value:"1.25rem",description:"Line height of a body cell \u2014 text-sm"},"cell-head-py":{value:"0.75rem",description:"Block padding of a header cell \u2014 py-3"},"cell-head-text":{value:"0.75rem",description:"Font size of a header cell \u2014 text-xs"},"cell-head-leading":{value:"1rem",description:"Line height of a header cell \u2014 text-xs"}},ur={"control-x":"control-px","control-y":"control-py","cell-x":"cell-px","cell-y":"cell-py","cell-head-y":"cell-head-py"},dr={control:{size:"control-text",leading:"control-leading"},cell:{size:"cell-text",leading:"cell-leading"},"cell-head":{size:"cell-head-text",leading:"cell-head-leading"}};function tt(n){return`--stx-${n}`}function Q(n){let t=Le[n];if(!t)throw Error(`[stx] unknown density token "${n}"`);return`var(${tt(n)}, ${t.value})`}function ce(){let n={};for(let[t,s]of Object.entries(ur))n[t]=Q(s);return n}function ae(){let n={};for(let[t,{size:s,leading:r}]of Object.entries(dr))n[t]=[Q(s),{lineHeight:Q(r)}];return n}function le(n={}){return["/* stx density tokens \u2014 how much room a control or a table cell takes. */",":root {",...Object.entries(Le).map(([t,s])=>` ${tt(t)}: ${n[t]??s.value};`),"}",""].join(`
5
5
  `)}function de(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}function Y(n,t){let s={...n};for(let[r,i]of Object.entries(t))s[r]=de(i)&&de(s[r])?Y(s[r],i):i;return s}function ge(n,t){if(!t.fonts)return"";let s=new n({...t.config,fonts:t.fonts,cssVariables:!1}).toCSS(!1,t.minify);return s&&!t.minify?`${s}
6
- `:s}function fe(n={},t={}){let s=n.theme||{},r=t.theme||{},{extend:i,...a}=r,{extend:c,...g}=s,o=g.colors||{};g.colors={...o,...se(o)};let u=g.borderRadius||{};g.borderRadius={...u,...ie()};let m=g.spacing||{};g.spacing={...m,...ce()};let V=g.fontSize||{};g.fontSize={...V,...ae()};let R=Y(g,a),y=Y(c||{},i||{});if(Object.keys(y).length>0)R.extend=y;let P=[...n.safelist||[],...t.safelist||[]],z={...n.shortcuts||{},...t.shortcuts||{}},O=[...n.preflights||[],...t.preflights||[]],{fonts:W,...I}=n,{fonts:N,roles:T,shapes:A,density:k,...b}=t,p={roles:T,shapes:A,density:k},j=N??W;return{config:{...I,...b,theme:R,safelist:P,shortcuts:z,...O.length>0?{preflights:O}:{},content:[],output:""},safelist:P,shortcuts:z,includePreflight:t.preflight!==!1,minify:t.minify===!0,tokenCSS:re({...o,...R.colors},T)+oe(A)+le(k),unknownRoles:ne(p),...j?{fonts:j}:{}}}var e={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",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",bgBlack:"\x1B[40m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m",bgWhite:"\x1B[47m",bgGray:"\x1B[100m"};import B from"fs";import Re from"path";var Te=256,C=new Map,ue=(n)=>Bun.hash(n).toString(16).padStart(16,"0").slice(0,16),pe=(n)=>l(process.cwd(),"css-assets",`${n}.css`);function L(n,t){if(C.delete(n),C.set(n,t),C.size>Te)C.delete(C.keys().next().value)}function he(n){let t=ue(n),s=pe(t);if(C.has(s))return L(s,n),t;let r;try{let i;try{i=B.readFileSync(s,"utf8")}catch{}if(i!==n)B.mkdirSync(Re.dirname(s),{recursive:!0}),r=`${s}.${process.pid}.${crypto.randomUUID()}.tmp`,B.writeFileSync(r,n,{flag:"wx"}),B.renameSync(r,s);return L(s,n),t}catch{return}finally{if(r)try{B.unlinkSync(r)}catch{}}}function Vf(n){if(!/^[a-f0-9]{16}$/.test(n))return;let t=pe(n),s=C.get(t);if(s!==void 0)return L(t,s),s;try{let r=B.readFileSync(t,"utf8");if(ue(r)!==n)return;return L(t,r),r}catch{return}}function me(){C.clear()}var h=null,H="";function xe(n){try{let t=n.startsWith("file:")?new URL(n).pathname:n;H=`${t}@${Math.trunc(M.statSync(t).mtimeMs)}`}catch{H=n}}var X=!1,v=null,F="",E=!1,je=256,w=new Map,K=null,be=null,U=new Map,ke=new Set;function q(n){return Bun.hash(n).toString(16).padStart(16,"0").slice(0,16)}function J(n,t){if(w.has(n))w.delete(n);else if(w.size>=je)w.delete(w.keys().next().value);w.set(n,t)}async function Be(n,t=K){if(!t)return null;try{let s=Bun.file(d.join(t,`cw-${q(n)}.css`));if(!await s.exists())return null;return await s.text()}catch{return null}}async function Ee(n,t,s=K){if(!s)return;try{if(!M.existsSync(s))M.mkdirSync(s,{recursive:!0});await Bun.write(d.join(s,`cw-${q(n)}.css`),t)}catch{}}async function Ce(n){try{let t=await import(n);if(t&&t.CSSGenerator)return{CSSGenerator:t.CSSGenerator,config:t.config,build:t.build,defaultConfig:t.defaultConfig,extractClasses:t.extractClasses}}catch{}return null}var Pe=[["@stacksjs","ts-css","dist","engine","index.js"],["@stacksjs","ts-css","src","engine","index.ts"]],Oe=["@stacksjs/ts-css/engine","@stacksjs/ts-css/dist/engine/index.js"];function Ie(){let n=[],t=process.cwd();while(t!==d.dirname(t)){for(let s of["node_modules","pantry"])for(let r of Pe)n.push(d.join(t,s,...r));t=d.dirname(t)}return n}function Ne(){let n=[],t=process.env.HOME||process.env.USERPROFILE||"",s=[t&&d.join(t,"Code","Tools","ts-css"),t&&d.join(t,"Code","Tools","crosswind"),t&&d.join(t,"repos","stacks-org","ts-css"),t&&d.join(t,"repos","stacks-org","crosswind"),d.join(process.cwd(),"..","ts-css"),d.join(process.cwd(),"..","crosswind")].filter(Boolean);for(let r of s)n.push(d.join(r,"packages","toolkit","dist","engine","index.js")),n.push(d.join(r,"packages","toolkit","src","engine","index.ts"));if(t)n.push(d.join(t,"Code","Tools","stx","node_modules","@stacksjs","ts-css","dist","engine","index.js"));return n}async function yc(){if(X)return h;X=!0;try{let n=async(i)=>{for(let a of i){if(!await Bun.file(a).exists())continue;let c=await Ce(a);if(c){if(xe(a),!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} CSS engine loaded from ${d.dirname(d.dirname(a))}`);return c}}return null};if(process.env.CROSSWIND_SRC){let i=d.resolve(process.env.CROSSWIND_SRC),a=await n([i]);if(!a)throw Error(`CROSSWIND_SRC did not resolve to a Css module: ${i}`);return h=a,h}let t=await n(Ie());if(t)return h=t,h;let s=Oe;for(let i of s){let a=await Ce(i);if(a){h=a;try{xe(import.meta.resolve(i))}catch{H=i}if(!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} CSS engine loaded`);return h}}let r=await n(Ne());if(r)return h=r,h;throw Error("Css CSSGenerator not found in any location")}catch{return console.warn(`${e.yellow}[ts-css] CSS engine not available, Tailwind styles will not be generated${e.reset}`),console.warn(`${e.yellow}Run 'bun add @stacksjs/ts-css' to enable CSS generation${e.reset}`),null}}function Vh(){Z.clear(),h=null,X=!1,v=null,F="",w.clear(),me(),be=null,U.clear()}var we=!1;async function bc(n){try{let t=ye({name:"css",cwd:n})?"css":ye({name:"crosswind",cwd:n})?"crosswind":null;if(!t)return null;if(t==="crosswind"&&!process.env.STACKS_DEV_QUIET&&!we)we=!0,console.warn(`${e.yellow}[ts-css]${e.reset} Reading the CSS config from a \`crosswind\` file. Rename it to \`css\` (e.g. config/css.ts) \u2014 the old name is deprecated.`);let{loadConfigWithResult:s}=await import("bunfig"),r=await s({name:t,cwd:n,defaultConfig:{},checkEnv:!1,verbose:!1});if(!r?.path||!r.config||Object.keys(r.config).length===0)return null;let i=d.relative(n,r.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} Loaded config from ${i||r.path}`);return r.config}catch(t){if(t instanceof Error&&t.name==="ConfigNotFoundError")return null;return console.warn(`${e.yellow}[ts-css]${e.reset} Failed to load css config:`,t instanceof Error?t.message:t),null}}async function Uf(n){let t=null;try{let{loadStxConfig:s}=await import("./chunk-tp2ftck2.js"),r=await s(n);if(r.css)if(typeof r.css==="string"){let i=d.isAbsolute(r.css)?r.css:d.resolve(n,r.css);if(await Bun.file(i).exists()){let a=await import(i);t=a.default||a,console.log(`${e.green}[ts-css]${e.reset} Loaded config from stx.config.ts \u2192 ${r.css}`)}}else{if(t={...r.css,content:r.css.content||[],preflight:r.css.preflight??!0,minify:r.css.minify??!1},r.css.config){let i=d.isAbsolute(r.css.config)?r.css.config:d.resolve(n,r.css.config);if(await Bun.file(i).exists()){let a=await import(i);t={...a.default||a,...t}}}console.log(`${e.green}[ts-css]${e.reset} Using inline CSS config from stx.config.ts`)}}catch{}return t||await bc(n)}function Wf(n){try{let t=new WeakSet;return q(JSON.stringify(n??{},(s,r)=>{if(typeof r==="function")return`[fn]${String(r)}`;if(typeof r==="object"&&r!==null){if(t.has(r))return"[circular]";t.add(r)}return r})??"")}catch{return"unhashable"}}async function mn(n){if(E)return F;E=!0;try{let t=await yc();if(!t||!t.build)return E=!1,"";if(!v)v=await bc(n);if(!v)return E=!1,"";let s=t.defaultConfig?.theme||{},r=v.theme||{},i={...t.defaultConfig,...v,theme:{...s,...r,extend:{...s.extend||{},...r.extend||{}}}},a=performance.now(),c=await t.build(i),g=performance.now()-a;if(F=c.css,console.log(`${e.cyan}[ts-css]${e.reset} Built ${c.classes.size} classes in ${g.toFixed(1)}ms`),i.output){let o=d.isAbsolute(i.output)?i.output:d.join(n,i.output),u=d.dirname(o);if(!M.existsSync(u))M.mkdirSync(u,{recursive:!0});await Bun.write(o,c.css)}return E=!1,c.css}catch(t){return console.error(`${e.red}[ts-css]${e.reset} Build error:`,t),E=!1,F}}async function dr(n){v=null,await mn(n)}function Uh(){return F}function qf(n){let t=new Set,s=/class\s*=\s*["']([^"']+)["']/gi,r=s.exec(n);while(r!==null){for(let c of r[1].split(/\s+/))if(c.trim())t.add(c.trim());r=s.exec(n)}let i=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,a=i.exec(n);while(a!==null){let c=a[1].match(/'([^']+)'/g);if(c){for(let g of c)for(let o of g.slice(1,-1).split(/\s+/))if(o.trim())t.add(o.trim())}a=i.exec(n)}return t}var Z=S(64);async function Kf(n,t){let s=()=>U.get(t?d.resolve(t):process.cwd())?.fingerprint??null,r=Z.get(_(n,t,s()));if(r!==void 0)return r;let i=await Ae(n,t);if(i)Z.set(_(n,t,s()),i);return i}function*ve(n){yield n;let t=new Set;for(let s of n.matchAll(/\/_stx\/modules\.([0-9a-f]{16})\.js/g)){let r=s[1];if(t.has(r))continue;t.add(r);let i=ni(r);if(i)yield i}}function Wh(n){return[...ve(n)].join(`
7
- `)}async function Ae(n,t){try{let s=await yc();if(!s)return"";let r=new Set;for(let p of ve(n)){let j=typeof s.extractClasses==="function"?s.extractClasses(p):qf(p);for(let ee of j)r.add(ee)}if(r.size===0)return"";let i=t?d.resolve(t):process.cwd(),a=l(i,"cache");if(!K)K=a;let c=U.get(i);if(!c){let p=await Uf(i);c={config:p,fingerprint:Wf(p)},U.set(i,c),be=c.fingerprint}let g=[...r].sort().join(" "),o=`${H}::${c.fingerprint||"default"}::${g}`,u=w.get(o);if(u!==void 0)return J(o,u),u;let m=await Be(o,a);if(m!==null)return J(o,m),m;let V=s.defaultConfig||s.config,R=c.config||{},y=fe(V,R),{safelist:P,includePreflight:z,minify:O,tokenCSS:W}=y;if(y.unknownRoles.length>0&&!ke.has(i))ke.add(i),console.warn(`${e.yellow}[ts-css]${e.reset} No stx role for ${y.unknownRoles.join(", ")} - these keep the stock value. Role names: semanticTokenNames() in @stacksjs/stx/theme-tokens.`);let I=y.config,N=new s.CSSGenerator(I),T=I.shortcuts||R.shortcuts||{},A=Object.keys(T).filter((p)=>r.has(p)||P.includes(p));for(let p of P)if(!T[p])N.generate(p);for(let p of r)if(!T[p])N.generate(p);let k="";if(A.length>0){let p=new s.CSSGenerator(I);for(let j of A)p.generate(j);if(k=p.toCSS(!1,O),k&&!k.endsWith(`
6
+ `:s}function fe(n={},t={}){let s=n.theme||{},r=t.theme||{},{extend:i,...a}=r,{extend:c,...g}=s,o=g.colors||{};g.colors={...o,...se(o)};let u=g.borderRadius||{};g.borderRadius={...u,...ie()};let m=g.spacing||{};g.spacing={...m,...ce()};let V=g.fontSize||{};g.fontSize={...V,...ae()};let R=Y(g,a),y=Y(c||{},i||{});if(Object.keys(y).length>0)R.extend=y;let P=[...n.safelist||[],...t.safelist||[]],z={...n.shortcuts||{},...t.shortcuts||{}},O=[...n.preflights||[],...t.preflights||[]],{fonts:W,...I}=n,{fonts:N,roles:T,shapes:A,density:k,...b}=t,p={roles:T,shapes:A,density:k},j=N??W;return{config:{...I,...b,theme:R,safelist:P,shortcuts:z,...O.length>0?{preflights:O}:{},content:[],output:""},safelist:P,shortcuts:z,includePreflight:t.preflight!==!1,minify:t.minify===!0,tokenCSS:re({...o,...R.colors},T)+oe(A)+le(k),unknownRoles:ne(p),...j?{fonts:j}:{}}}var e={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",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",bgBlack:"\x1B[40m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m",bgWhite:"\x1B[47m",bgGray:"\x1B[100m"};import B from"fs";import $e from"path";var Re=256,C=new Map,ue=(n)=>Bun.hash(n).toString(16).padStart(16,"0").slice(0,16),pe=(n)=>l(process.cwd(),"css-assets",`${n}.css`);function L(n,t){if(C.delete(n),C.set(n,t),C.size>Re)C.delete(C.keys().next().value)}function he(n){let t=ue(n),s=pe(t);if(C.has(s))return L(s,n),t;let r;try{let i;try{i=B.readFileSync(s,"utf8")}catch{}if(i!==n)B.mkdirSync($e.dirname(s),{recursive:!0}),r=`${s}.${process.pid}.${crypto.randomUUID()}.tmp`,B.writeFileSync(r,n,{flag:"wx"}),B.renameSync(r,s);return L(s,n),t}catch{return}finally{if(r)try{B.unlinkSync(r)}catch{}}}function qf(n){if(!/^[a-f0-9]{16}$/.test(n))return;let t=pe(n),s=C.get(t);if(s!==void 0)return L(t,s),s;try{let r=B.readFileSync(t,"utf8");if(ue(r)!==n)return;return L(t,r),r}catch{return}}function me(){C.clear()}var h=null,H="";function xe(n){try{let t=n.startsWith("file:")?new URL(n).pathname:n;H=`${t}@${Math.trunc(M.statSync(t).mtimeMs)}`}catch{H=n}}var X=!1,v=null,F="",E=!1,Te=256,w=new Map,K=null,we=null,U=new Map,ke=new Set;function q(n){return Bun.hash(n).toString(16).padStart(16,"0").slice(0,16)}function J(n,t){if(w.has(n))w.delete(n);else if(w.size>=Te)w.delete(w.keys().next().value);w.set(n,t)}async function je(n,t=K){if(!t)return null;try{let s=Bun.file(d.join(t,`cw-${q(n)}.css`));if(!await s.exists())return null;return await s.text()}catch{return null}}async function Be(n,t,s=K){if(!s)return;try{if(!M.existsSync(s))M.mkdirSync(s,{recursive:!0});await Bun.write(d.join(s,`cw-${q(n)}.css`),t)}catch{}}async function Ce(n){try{let t=await import(n);if(t&&t.CSSGenerator)return{CSSGenerator:t.CSSGenerator,config:t.config,build:t.build,defaultConfig:t.defaultConfig,extractClasses:t.extractClasses}}catch{}return null}var Ee=[["@stacksjs","ts-css","dist","engine","index.js"],["@stacksjs","ts-css","src","engine","index.ts"]],Pe=["@stacksjs/ts-css/engine","@stacksjs/ts-css/dist/engine/index.js"];function De(){let n=[],t=process.cwd();while(t!==d.dirname(t)){for(let s of["node_modules","pantry"])for(let r of Ee)n.push(d.join(t,s,...r));t=d.dirname(t)}return n}function Oe(){let n=[],t=process.env.HOME||process.env.USERPROFILE||"",s=[t&&d.join(t,"Code","Tools","ts-css"),t&&d.join(t,"Code","Tools","crosswind"),t&&d.join(t,"repos","stacks-org","ts-css"),t&&d.join(t,"repos","stacks-org","crosswind"),d.join(process.cwd(),"..","ts-css"),d.join(process.cwd(),"..","crosswind")].filter(Boolean);for(let r of s)n.push(d.join(r,"packages","toolkit","dist","engine","index.js")),n.push(d.join(r,"packages","toolkit","src","engine","index.ts"));if(t)n.push(d.join(t,"Code","Tools","stx","node_modules","@stacksjs","ts-css","dist","engine","index.js"));return n}async function vc(){if(X)return h;X=!0;try{let n=async(i)=>{for(let a of i){if(!await Bun.file(a).exists())continue;let c=await Ce(a);if(c){if(xe(a),!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} CSS engine loaded from ${d.dirname(d.dirname(a))}`);return c}}return null};if(process.env.CROSSWIND_SRC){let i=d.resolve(process.env.CROSSWIND_SRC),a=await n([i]);if(!a)throw Error(`CROSSWIND_SRC did not resolve to a Css module: ${i}`);return h=a,h}let t=await n(De());if(t)return h=t,h;let s=Pe;for(let i of s){let a=await Ce(i);if(a){h=a;try{xe(import.meta.resolve(i))}catch{H=i}if(!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} CSS engine loaded`);return h}}let r=await n(Oe());if(r)return h=r,h;throw Error("Css CSSGenerator not found in any location")}catch{return console.warn(`${e.yellow}[ts-css] CSS engine not available, Tailwind styles will not be generated${e.reset}`),console.warn(`${e.yellow}Run 'bun add @stacksjs/ts-css' to enable CSS generation${e.reset}`),null}}function qh(){Z.clear(),h=null,X=!1,v=null,F="",w.clear(),me(),we=null,U.clear()}var Se=!1;async function xc(n){try{let t=ye({name:"css",cwd:n})?"css":ye({name:"crosswind",cwd:n})?"crosswind":null;if(!t)return null;if(t==="crosswind"&&!process.env.STACKS_DEV_QUIET&&!Se)Se=!0,console.warn(`${e.yellow}[ts-css]${e.reset} Reading the CSS config from a \`crosswind\` file. Rename it to \`css\` (e.g. config/css.ts) \u2014 the old name is deprecated.`);let{loadConfigWithResult:s}=await import("bunfig"),r=await s({name:t,cwd:n,defaultConfig:{},checkEnv:!1,verbose:!1});if(!r?.path||!r.config||Object.keys(r.config).length===0)return null;let i=d.relative(n,r.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} Loaded config from ${i||r.path}`);return r.config}catch(t){if(t instanceof Error&&t.name==="ConfigNotFoundError")return null;return console.warn(`${e.yellow}[ts-css]${e.reset} Failed to load css config:`,t instanceof Error?t.message:t),null}}async function Kf(n){let t=null;try{let{loadStxConfig:s}=await import("./chunk-1kgnk6ds.js"),r=await s(n);if(r.css)if(typeof r.css==="string"){let i=d.isAbsolute(r.css)?r.css:d.resolve(n,r.css);if(await Bun.file(i).exists()){let a=await import(i);t=a.default||a,console.log(`${e.green}[ts-css]${e.reset} Loaded config from stx.config.ts \u2192 ${r.css}`)}}else{if(t={...r.css,content:r.css.content||[],preflight:r.css.preflight??!0,minify:r.css.minify??!1},r.css.config){let i=d.isAbsolute(r.css.config)?r.css.config:d.resolve(n,r.css.config);if(await Bun.file(i).exists()){let a=await import(i);t={...a.default||a,...t}}}console.log(`${e.green}[ts-css]${e.reset} Using inline CSS config from stx.config.ts`)}}catch{}return t||await xc(n)}function Gf(n){try{let t=new WeakSet;return q(JSON.stringify(n??{},(s,r)=>{if(typeof r==="function")return`[fn]${String(r)}`;if(typeof r==="object"&&r!==null){if(t.has(r))return"[circular]";t.add(r)}return r})??"")}catch{return"unhashable"}}async function mn(n){if(E)return F;E=!0;try{let t=await vc();if(!t||!t.build)return E=!1,"";if(!v)v=await xc(n);if(!v)return E=!1,"";let s=t.defaultConfig?.theme||{},r=v.theme||{},i={...t.defaultConfig,...v,theme:{...s,...r,extend:{...s.extend||{},...r.extend||{}}}},a=performance.now(),c=await t.build(i),g=performance.now()-a;if(F=c.css,console.log(`${e.cyan}[ts-css]${e.reset} Built ${c.classes.size} classes in ${g.toFixed(1)}ms`),i.output){let o=d.isAbsolute(i.output)?i.output:d.join(n,i.output),u=d.dirname(o);if(!M.existsSync(u))M.mkdirSync(u,{recursive:!0});await Bun.write(o,c.css)}return E=!1,c.css}catch(t){return console.error(`${e.red}[ts-css]${e.reset} Build error:`,t),E=!1,F}}async function pr(n){v=null,await mn(n)}function Kh(){return F}function Xf(n){let t=new Set,s=/class\s*=\s*["']([^"']+)["']/gi,r=s.exec(n);while(r!==null){for(let c of r[1].split(/\s+/))if(c.trim())t.add(c.trim());r=s.exec(n)}let i=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,a=i.exec(n);while(a!==null){let c=a[1].match(/'([^']+)'/g);if(c){for(let g of c)for(let o of g.slice(1,-1).split(/\s+/))if(o.trim())t.add(o.trim())}a=i.exec(n)}return t}var Z=S(64);async function Jf(n,t){let s=()=>U.get(t?d.resolve(t):process.cwd())?.fingerprint??null,r=Z.get(_(n,t,s()));if(r!==void 0)return r;let i=await Ie(n,t);if(i)Z.set(_(n,t,s()),i);return i}function*be(n){yield n;let t=new Set;for(let s of n.matchAll(/\/_stx\/modules\.([0-9a-f]{16})\.js/g)){let r=s[1];if(t.has(r))continue;t.add(r);let i=ii(r);if(i)yield i}}function Gh(n){return[...be(n)].join(`
7
+ `)}async function Ie(n,t){try{let s=await vc();if(!s)return"";let r=new Set;for(let p of be(n)){let j=typeof s.extractClasses==="function"?s.extractClasses(p):Xf(p);for(let ee of j)r.add(ee)}if(r.size===0)return"";let i=t?d.resolve(t):process.cwd(),a=l(i,"cache");if(!K)K=a;let c=U.get(i);if(!c){let p=await Kf(i);c={config:p,fingerprint:Gf(p)},U.set(i,c),we=c.fingerprint}let g=[...r].sort().join(" "),o=`${H}::${c.fingerprint||"default"}::${g}`,u=w.get(o);if(u!==void 0)return J(o,u),u;let m=await je(o,a);if(m!==null)return J(o,m),m;let V=s.defaultConfig||s.config,R=c.config||{},y=fe(V,R),{safelist:P,includePreflight:z,minify:O,tokenCSS:W}=y;if(y.unknownRoles.length>0&&!ke.has(i))ke.add(i),console.warn(`${e.yellow}[ts-css]${e.reset} No stx role for ${y.unknownRoles.join(", ")} - these keep the stock value. Role names: semanticTokenNames() in @stacksjs/stx/theme-tokens.`);let I=y.config,N=new s.CSSGenerator(I),T=I.shortcuts||R.shortcuts||{},A=Object.keys(T).filter((p)=>r.has(p)||P.includes(p));for(let p of P)if(!T[p])N.generate(p);for(let p of r)if(!T[p])N.generate(p);let k="";if(A.length>0){let p=new s.CSSGenerator(I);for(let j of A)p.generate(j);if(k=p.toCSS(!1,O),k&&!k.endsWith(`
8
8
  `))k+=`
9
- `}let b=k+N.toCSS(z,O);return b=ge(s.CSSGenerator,y)+W+b,J(o,b),Ee(o,b,a),b}catch(s){return console.warn("Failed to generate Css CSS:",s),""}}async function x(n,t,s=!1,r=!1){let i=await Kf(n,t);if(!i)return r?wn(n):n;let a=s?he(i):void 0,c=a?`<link data-css="generated" rel="stylesheet" href="/_stx/css.${a}.css">`:`<style data-css="generated">
9
+ `}let b=k+N.toCSS(z,O);return b=ge(s.CSSGenerator,y)+W+b,J(o,b),Be(o,b,a),b}catch(s){return console.warn("Failed to generate Css CSS:",s),""}}async function x(n,t,s=!1,r=!1){let i=await Jf(n,t);if(!i)return r?vn(n):n;let a=s?he(i):void 0,c=a?`<link data-css="generated" rel="stylesheet" href="/_stx/css.${a}.css">`:`<style data-css="generated">
10
10
  ${i}
11
- </style>`;if(r)return Fe(n,c);let g=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g;if(g.test(n)){let o=!1;return n.replace(g,()=>{if(o)return"";return o=!0,c})}if(n.includes("</head>"))return f(n,c);if(n.includes("<body"))return n.replace(/<body([^>]*)>/,`<body$1>
12
- ${c}`);return c+n}function Fe(n,t){let s=Si(n).map((o)=>({...o,replacement:""})),r=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g,i=r.exec(n);if(i!==null){let o=!0;while(i!==null)s.push({start:i.index,end:i.index+i[0].length,replacement:o?t:""}),o=!1,i=r.exec(n)}else{let o=D(n);if(o!==-1)s.push({start:o,end:o,replacement:`${t}
11
+ </style>`;if(r)return Ne(n,c);let g=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g;if(g.test(n)){let o=!1;return n.replace(g,()=>{if(o)return"";return o=!0,c})}if(n.includes("</head>"))return f(n,c);if(n.includes("<body"))return n.replace(/<body([^>]*)>/,`<body$1>
12
+ ${c}`);return c+n}function Ne(n,t){let s=Ti(n).map((o)=>({...o,replacement:""})),r=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g,i=r.exec(n);if(i!==null){let o=!0;while(i!==null)s.push({start:i.index,end:i.index+i[0].length,replacement:o?t:""}),o=!1,i=r.exec(n)}else{let o=D(n);if(o!==-1)s.push({start:o,end:o,replacement:`${t}
13
13
  `});else{let u=n.match(/<body([^>]*)>/);if(u?.index!==void 0)s.push({start:u.index,end:u.index+u[0].length,replacement:`${u[0]}
14
- ${t}`});else s.push({start:0,end:0,replacement:t})}}s.sort((o,u)=>o.start-u.start||o.end-u.end);for(let o=1;o<s.length;o++)if(s[o].start<s[o-1].end)return Me(wn(n),t);let a=Array(s.length*2+1),c=0,g=0;for(let o of s)a[g++]=n.slice(c,o.start),a[g++]=o.replacement,c=o.end;return a[g]=n.slice(c),a.join("")}function Me(n,t){let s=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g;if(s.test(n)){let r=!1;return n.replace(s,()=>{if(r)return"";return r=!0,t})}if(n.includes("</head>"))return f(n,t);if(n.includes("<body"))return n.replace(/<body([^>]*)>/,`<body$1>
14
+ ${t}`});else s.push({start:0,end:0,replacement:t})}}s.sort((o,u)=>o.start-u.start||o.end-u.end);for(let o=1;o<s.length;o++)if(s[o].start<s[o-1].end)return Ae(vn(n),t);let a=Array(s.length*2+1),c=0,g=0;for(let o of s)a[g++]=n.slice(c,o.start),a[g++]=o.replacement,c=o.end;return a[g]=n.slice(c),a.join("")}function Ae(n,t){let s=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g;if(s.test(n)){let r=!1;return n.replace(s,()=>{if(r)return"";return r=!0,t})}if(n.includes("</head>"))return f(n,t);if(n.includes("<body"))return n.replace(/<body([^>]*)>/,`<body$1>
15
15
  ${t}`);return t+n}
16
- export{_t,Qe,Se,gn,De,lr,ur,et,e,Vf,yc,Vh,bc,Uf,Wf,mn,dr,Uh,qf,Kf,Wh,x};
16
+ export{_t,et,_e,gn,Le,ur,dr,tt,e,qf,vc,qh,xc,Kf,Gf,mn,pr,Kh,Xf,Jf,Gh,x};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ko}from"./chunk-r2bxjna3.js";export{Ko as warnUnbalancedTags};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Oo,Na,Da,Lh}from"./chunk-y2e2zm6y.js";export{Oo as NATIVE_COMPONENTS,Na as compileToNative,Da as createHotReloadServer,Lh as default};
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- import R from"path";var O=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function Ur(...g){let d=new Set;for(let c of g){if(!c||!c.includes("__stxModules["))continue;for(let s of c.matchAll(O))try{d.add(JSON.parse(`"${s[1]}"`))}catch{}}return[...d].sort()}function po(...g){let d=new Map,c=(s,e)=>{let r=d.get(s);if(r===null)return;if(e===null){d.set(s,null);return}let n=r??new Set;for(let i of e)n.add(i);d.set(s,n)};for(let s of g){if(!s||!s.includes("__stxModules["))continue;let e=[];for(let n of s.matchAll(/([\w$]+)\s*=\s*globalThis\.__stxModules\s*&&\s*globalThis\.__stxModules\["((?:[^"\\]|\\.)*)"\]/g)){let i;try{i=JSON.parse(`"${n[2]}"`)}catch{continue}e.push({variable:n[1],id:i,start:n.index+n[0].length,end:s.length})}let r=s.match(/__stxModules\["(?:[^"\\]|\\.)*"\]/g)?.length??0;if(e.length===0||r!==e.length){for(let n of Ur(s))c(n,null);continue}for(let[n,i]of e.entries()){let p=e.slice(n+1).find((h)=>h.variable===i.variable);i.end=p?p.start:s.length}for(let n of e){let i=new Set,p=!1,h=n.variable.replace(/[$]/g,"\\$&"),o=s.slice(n.start,n.end);for(let l of o.matchAll(new RegExp(`(?<![\\w$.])${h}(?![\\w$])`,"g"))){let f=o.slice(l.index+n.variable.length,l.index+n.variable.length+200),a=/^\s*\[\s*(["'])([A-Za-z_$][\w$]*)\1\s*\]/.exec(f)??/^\s*\.\s*([A-Za-z_$][\w$]*)/.exec(f);if(a){i.add(a[a.length-1]);continue}if(/^\s*[!=]==?\s*(?:undefined|void 0)\b/.test(f))continue;p=!0;break}c(n.id,p?null:i)}}return d}function v(g,d,c){let s=[],e=[];return g.forEach((r,n)=>{let i=r.startsWith("npm:")?r.slice(4):R.resolve(d,r),p=`__stxRegistered${n}`,h=JSON.stringify(r),o=c?.get(r);if(o&&[...o].every((l)=>/^[A-Za-z_$][\w$]*$/.test(l))){let l=[...o].sort(),f=l.map((m,_)=>`${m} as ${p}_${_}`);s.push(l.length>0?`import { ${f.join(", ")} } from ${JSON.stringify(i)};`:`import ${JSON.stringify(i)};`);let a=l.map((m,_)=>`get ${JSON.stringify(m)}() { return ${p}_${_}; }`).join(", ");e.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = { ${a} };`);return}s.push(`import * as ${p} from ${JSON.stringify(i)};`),e.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = ${p};`)}),[...s,"globalThis.__stxModules = globalThis.__stxModules || {};",...e].join(`
3
- `)}async function nm(g,d={}){if(g.length===0)return null;let c=process.cwd(),s=v(g,c,d.names),e;try{let{bundleClientScript:l}=await import("./chunk-awmfyb3t.js"),f=()=>l(s,R.join(c,".stx-module-registry.ts"),{projectRoot:c,minify:d.minify,externalizeUserModules:!1,collectInputs:d.collectInputs,throwOnFailure:!0});try{e=await f()}catch(a){if(!d.names)throw a;s=v(g,c,void 0),e=await f()}}catch(l){let{formatBuildFailure:f}=await import("./chunk-cvgbtmxp.js"),a=f(l);console.warn(`[stx] could not build the page module registry (#1957): ${a}`);let m=`[stx] the page module registry did not build, so ${g.join(", ")} cannot load (#1957): ${a}`;return`;console.error(${JSON.stringify(m)});`}let{transformAutoImports:r,generateAutoImportDestructuring:n}=await import("./chunk-xye2mkbh.js"),i=r(e),p=n(i.stxImports,i.browserImports),{transformStoreImports:h}=await import("./chunk-4pr29yrx.js");e=h(i.code);let o=JSON.stringify(new Bun.CryptoHasher("md5").update(s).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${o}]) return;`,` __stxBundles[${o}] = true;`,p,e,"})();"].join(`
2
+ import R from"path";var O=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function Wr(...g){let d=new Set;for(let c of g){if(!c||!c.includes("__stxModules["))continue;for(let s of c.matchAll(O))try{d.add(JSON.parse(`"${s[1]}"`))}catch{}}return[...d].sort()}function mo(...g){let d=new Map,c=(s,e)=>{let r=d.get(s);if(r===null)return;if(e===null){d.set(s,null);return}let n=r??new Set;for(let i of e)n.add(i);d.set(s,n)};for(let s of g){if(!s||!s.includes("__stxModules["))continue;let e=[];for(let n of s.matchAll(/([\w$]+)\s*=\s*globalThis\.__stxModules\s*&&\s*globalThis\.__stxModules\["((?:[^"\\]|\\.)*)"\]/g)){let i;try{i=JSON.parse(`"${n[2]}"`)}catch{continue}e.push({variable:n[1],id:i,start:n.index+n[0].length,end:s.length})}let r=s.match(/__stxModules\["(?:[^"\\]|\\.)*"\]/g)?.length??0;if(e.length===0||r!==e.length){for(let n of Wr(s))c(n,null);continue}for(let[n,i]of e.entries()){let p=e.slice(n+1).find((h)=>h.variable===i.variable);i.end=p?p.start:s.length}for(let n of e){let i=new Set,p=!1,h=n.variable.replace(/[$]/g,"\\$&"),o=s.slice(n.start,n.end);for(let l of o.matchAll(new RegExp(`(?<![\\w$.])${h}(?![\\w$])`,"g"))){let f=o.slice(l.index+n.variable.length,l.index+n.variable.length+200),a=/^\s*\[\s*(["'])([A-Za-z_$][\w$]*)\1\s*\]/.exec(f)??/^\s*\.\s*([A-Za-z_$][\w$]*)/.exec(f);if(a){i.add(a[a.length-1]);continue}if(/^\s*[!=]==?\s*(?:undefined|void 0)\b/.test(f))continue;p=!0;break}c(n.id,p?null:i)}}return d}function v(g,d,c){let s=[],e=[];return g.forEach((r,n)=>{let i=r.startsWith("npm:")?r.slice(4):R.resolve(d,r),p=`__stxRegistered${n}`,h=JSON.stringify(r),o=c?.get(r);if(o&&[...o].every((l)=>/^[A-Za-z_$][\w$]*$/.test(l))){let l=[...o].sort(),f=l.map((m,_)=>`${m} as ${p}_${_}`);s.push(l.length>0?`import { ${f.join(", ")} } from ${JSON.stringify(i)};`:`import ${JSON.stringify(i)};`);let a=l.map((m,_)=>`get ${JSON.stringify(m)}() { return ${p}_${_}; }`).join(", ");e.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = { ${a} };`);return}s.push(`import * as ${p} from ${JSON.stringify(i)};`),e.push(`if (!globalThis.__stxModules[${h}]) globalThis.__stxModules[${h}] = ${p};`)}),[...s,"globalThis.__stxModules = globalThis.__stxModules || {};",...e].join(`
3
+ `)}async function om(g,d={}){if(g.length===0)return null;let c=process.cwd(),s=v(g,c,d.names),e;try{let{bundleClientScript:l}=await import("./chunk-4e48zkq0.js"),f=()=>l(s,R.join(c,".stx-module-registry.ts"),{projectRoot:c,minify:d.minify,externalizeUserModules:!1,collectInputs:d.collectInputs,throwOnFailure:!0});try{e=await f()}catch(a){if(!d.names)throw a;s=v(g,c,void 0),e=await f()}}catch(l){let{formatBuildFailure:f}=await import("./chunk-kx06jzdw.js"),a=f(l);console.warn(`[stx] could not build the page module registry (#1957): ${a}`);let m=`[stx] the page module registry did not build, so ${g.join(", ")} cannot load (#1957): ${a}`;return`;console.error(${JSON.stringify(m)});`}let{transformAutoImports:r,generateAutoImportDestructuring:n}=await import("./chunk-c4s25bm2.js"),i=r(e),p=n(i.stxImports,i.browserImports),{transformStoreImports:h}=await import("./chunk-jmjgj3nh.js");e=h(i.code);let o=JSON.stringify(new Bun.CryptoHasher("md5").update(s).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${o}]) return;`,` __stxBundles[${o}] = true;`,p,e,"})();"].join(`
4
4
  `)}var P=/^import(?:[ \t]*(\{[^}]*\})[ \t]*from|[ \t]*\*[ \t]*as[ \t]+([\w$]+)[ \t]+from)?[ \t]*["']\.\/(chunk-[\w-]+)\.js["'][ \t]*;?[ \t]*$/gm,j=/^export\s*\{([^}]*)\}\s*;?[ \t]*$/gm,I=new Set(["__preload","__chunks"]),N=/^("[^"]*"|[\w$]+)(?:\s+as\s+("[^"]*"|[\w$]+))?$/;function J(g){let d=[],c=[],s=!0,r=g.replace(/^var __chunkGraphs;[\s\S]*?^var __chunks = [\s\S]*?^\};[ \t]*\n?/m,"").replace(/^__chunks\(import\.meta\.url,[^\n]*\);[ \t]*\n?/gm,"").replace(P,(h,o,l,f)=>{let a=`__stxChunkExports${d.length}`;if(d.push(f),c.push(`var ${a} = __stxChunk(${JSON.stringify(f)});`),l)c.push(`var ${l} = ${a};`);else if(o)for(let m of o.slice(1,-1).split(",")){let _=m.trim();if(!_)continue;let w=N.exec(_);if(!w){s=!1;continue}if(I.has(w[1]))continue;let M=w[1].startsWith('"')?JSON.parse(w[1]):w[1],t=w[2]??w[1];if(t.startsWith('"')){s=!1;continue}c.push(`var ${t} = ${a}[${JSON.stringify(M)}];`)}return""});if(!s)throw Error("an import it does not read");let n=[];r=r.replace(/\(\s*__preload\([^)]*\)\s*,\s*import\(\s*["']\.\/(chunk-[\w-]+)\.js["']\s*\)\s*\)|\bimport\(\s*["']\.\/(chunk-[\w-]+)\.js["']\s*\)/g,(h,o,l)=>{let f=o??l;return n.push(f),`Promise.resolve().then(function () { return __stxChunk(${JSON.stringify(f)}); })`});let i=[];r=r.replace(j,(h,o)=>{for(let l of o.split(",")){let f=l.trim();if(!f)continue;let a=N.exec(f);if(!a||a[1].startsWith('"')){s=!1;continue}if(I.has(a[1]))continue;let m=a[2]??a[1];i.push([a[1],m.startsWith('"')?JSON.parse(m):m])}return""});let p=[/\bimport\.meta\b/,/\b__chunks\b/,/\b__preload\b/,/^\s*export\s+(?:default\b|const\b|let\b|var\b|function\b|class\b|async\b|\*|\{)/m,/\bfrom\s*["']\.\/chunk-/,/^\s*import\s*["']\.\/chunk-/m].find((h)=>h.test(r));if(!s||p)throw Error(`${p?`${p.source} is left in it`:"an export it does not read"}`);return{reads:c.join(`
5
- `),chunks:d,lazy:n,body:r,exports:i}}function Bl(g){if(/\bexport\s+(?:let|var)\b/.test(g))return!0;if(g.length/Math.max(1,g.split(`
6
- `).length)>200)return!1;for(let d of g.matchAll(/\bexport\s*\{([^}]*)\}(?!\s*from\b)/g))for(let c of d[1].split(",")){let s=c.trim().split(/\s+as\s+/)[0].trim();if(!/^[A-Za-z_$][\w$]*$/.test(s))continue;let e=s.replace(/[$]/g,"\\$&");if(!new RegExp(`(?<![\\w$.])(?:let|var)\\s+${e}(?![\\w$])`,"g").test(g))continue;let n=new RegExp(`(?<![\\w$.])${e}\\s*(?:=(?![=>])|[-+*/%&|^]=|\\*\\*=|<<=|>>>?=|&&=|\\|\\|=|\\?\\?=|\\+\\+|--)|(?:\\+\\+|--)\\s*${e}(?![\\w$])`,"g"),i=new RegExp(`(?<![\\w$.])(?:let|var|const)\\s+${e}\\s*=`,"g");if((g.match(n)?.length??0)>(g.match(i)?.length??0))return!0}return!1}async function fo(g,d={}){let c=g.filter((e)=>e.ids.length>0);if(c.length===0)return{chunks:new Map,routes:new Map,reads:new Map};let s=process.cwd();try{let{bundleClientEntriesSplit:e}=await import("./chunk-awmfyb3t.js"),r=[],n=await e(new Map(c.map((t)=>[t.name,v(t.ids,s,t.names)])),{projectRoot:s,filePath:R.join(s,".stx-module-registry.ts"),collectInputs:r});d.collectInputs?.push(...r);let{transformAutoImports:i,generateAutoImportDestructuring:p}=await import("./chunk-xye2mkbh.js"),{transformStoreImports:h}=await import("./chunk-4pr29yrx.js"),o=new Map;for(let[t,u]of[...n.chunks,...n.entries])try{o.set(t,J(u))}catch(b){throw Error(`cannot read ${t}: ${b instanceof Error?b.message:String(b)}`)}for(let[t,u]of[...n.chunks,...n.entries])if(/\b__esm\(/.test(u))throw Error(`${t} initialises a module lazily`);for(let t of r)if(/\.(?:[cm]?[jt]sx?)$/.test(t)&&Bl(await Bun.file(t).text()))throw Error(`${t} exports a binding that changes after it is read`);let l=new Set,f=new Set,a=(t)=>{if(f.has(t))return;if(l.has(t))throw Error(`the chunks import each other (${t})`);l.add(t);for(let u of o.get(t)?.chunks??[]){if(!o.has(u))throw Error(`${t} imports ${u}, which was not built`);a(u)}for(let u of o.get(t)?.lazy??[])if(!o.has(u))throw Error(`${t} imports ${u}, which was not built`);l.delete(t),f.add(t)};for(let t of o.keys())a(t);let m=(t)=>{let u=i(t.body);return{prelude:p(u.stxImports,u.browserImports),body:h(u.code)}},_=new Map;for(let t of n.chunks.keys()){let u=o.get(t),{prelude:b,body:k}=m(u),y=u.exports.map(([S,x])=>`get ${JSON.stringify(x)}() { return ${S}; }`).join(", ");_.set(t,`function (__stxChunk) {
5
+ `),chunks:d,lazy:n,body:r,exports:i}}function Hl(g){if(/\bexport\s+(?:let|var)\b/.test(g))return!0;if(g.length/Math.max(1,g.split(`
6
+ `).length)>200)return!1;for(let d of g.matchAll(/\bexport\s*\{([^}]*)\}(?!\s*from\b)/g))for(let c of d[1].split(",")){let s=c.trim().split(/\s+as\s+/)[0].trim();if(!/^[A-Za-z_$][\w$]*$/.test(s))continue;let e=s.replace(/[$]/g,"\\$&");if(!new RegExp(`(?<![\\w$.])(?:let|var)\\s+${e}(?![\\w$])`,"g").test(g))continue;let n=new RegExp(`(?<![\\w$.])${e}\\s*(?:=(?![=>])|[-+*/%&|^]=|\\*\\*=|<<=|>>>?=|&&=|\\|\\|=|\\?\\?=|\\+\\+|--)|(?:\\+\\+|--)\\s*${e}(?![\\w$])`,"g"),i=new RegExp(`(?<![\\w$.])(?:let|var|const)\\s+${e}\\s*=`,"g");if((g.match(n)?.length??0)>(g.match(i)?.length??0))return!0}return!1}async function ho(g,d={}){let c=g.filter((e)=>e.ids.length>0);if(c.length===0)return{chunks:new Map,routes:new Map,reads:new Map};let s=process.cwd();try{let{bundleClientEntriesSplit:e}=await import("./chunk-4e48zkq0.js"),r=[],n=await e(new Map(c.map((t)=>[t.name,v(t.ids,s,t.names)])),{projectRoot:s,filePath:R.join(s,".stx-module-registry.ts"),collectInputs:r});d.collectInputs?.push(...r);let{transformAutoImports:i,generateAutoImportDestructuring:p}=await import("./chunk-c4s25bm2.js"),{transformStoreImports:h}=await import("./chunk-jmjgj3nh.js"),o=new Map;for(let[t,u]of[...n.chunks,...n.entries])try{o.set(t,J(u))}catch(b){throw Error(`cannot read ${t}: ${b instanceof Error?b.message:String(b)}`)}for(let[t,u]of[...n.chunks,...n.entries])if(/\b__esm\(/.test(u))throw Error(`${t} initialises a module lazily`);for(let t of r)if(/\.(?:[cm]?[jt]sx?)$/.test(t)&&Hl(await Bun.file(t).text()))throw Error(`${t} exports a binding that changes after it is read`);let l=new Set,f=new Set,a=(t)=>{if(f.has(t))return;if(l.has(t))throw Error(`the chunks import each other (${t})`);l.add(t);for(let u of o.get(t)?.chunks??[]){if(!o.has(u))throw Error(`${t} imports ${u}, which was not built`);a(u)}for(let u of o.get(t)?.lazy??[])if(!o.has(u))throw Error(`${t} imports ${u}, which was not built`);l.delete(t),f.add(t)};for(let t of o.keys())a(t);let m=(t)=>{let u=i(t.body);return{prelude:p(u.stxImports,u.browserImports),body:h(u.code)}},_=new Map;for(let t of n.chunks.keys()){let u=o.get(t),{prelude:b,body:k}=m(u),y=u.exports.map(([S,x])=>`get ${JSON.stringify(x)}() { return ${S}; }`).join(", ");_.set(t,`function (__stxChunk) {
7
7
  ${b}
8
8
  ${u.reads}
9
9
  ${k}
@@ -13,5 +13,5 @@ var __stxChunk = function (name) { return globalThis.__stxNativeRuntime.chunk(na
13
13
  ${b}
14
14
  ${u.reads}
15
15
  ${k}
16
- })();`);let y=new Set,S=(x)=>{if(y.has(x))return;y.add(x);let E=o.get(x);for(let A of[...E.chunks,...E.lazy])S(A)};for(let x of[...u.chunks,...u.lazy])S(x);M.set(t,[...y].sort())}return{chunks:_,routes:w,reads:M}}catch(e){let{formatBuildFailure:r}=await import("./chunk-cvgbtmxp.js");return console.warn(`[stx] could not share the native routes' modules, building each route's alone: ${r(e)}`),null}}
17
- export{Ur,po,nm,Bl,fo};
16
+ })();`);let y=new Set,S=(x)=>{if(y.has(x))return;y.add(x);let E=o.get(x);for(let A of[...E.chunks,...E.lazy])S(A)};for(let x of[...u.chunks,...u.lazy])S(x);M.set(t,[...y].sort())}return{chunks:_,routes:w,reads:M}}catch(e){let{formatBuildFailure:r}=await import("./chunk-kx06jzdw.js");return console.warn(`[stx] could not share the native routes' modules, building each route's alone: ${r(e)}`),null}}
17
+ export{Wr,mo,om,Hl,ho};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{qr}from"./chunk-7ayvybdy.js";import{existsSync as m,statSync as x}from"fs";import s from"path";var g=new Map;function M(r){let n=s.extname(r);if(n===".tsx")return"tsx";if(n===".jsx")return"jsx";if(n===".ts"||n===".mts"||n===".cts")return"ts";return"js"}async function j(r,n){let l=Object.entries(n).map(([e,t])=>[s.resolve(r,e),s.resolve(r,t)]),d=l.map(([e,t])=>{try{return`${e}\x00${t}\x00${x(t).mtimeMs}`}catch{return`${e}\x00${t}\x00-`}}).join(`
3
- `),f=`${r}\x00${JSON.stringify(n)}`,o=g.get(f);if(o&&o.signature===d)return o.standIns;let a=new Map;for(let[e,t]of l){let c=s.relative(r,e);if(!m(e))throw Error(`webModules: ${c} does not exist`);if(!m(t))throw Error(`webModules: ${s.relative(r,t)}, the stand-in for ${c}, does not exist`);if(e===t)throw Error(`webModules: ${c} stands in for itself`);let p=await Bun.file(t).text(),u=new Bun.Transpiler({loader:M(t),target:"browser"});if(s.dirname(t)!==s.dirname(e)){let i=u.scanImports(p).find((h)=>/^\.\.?\//.test(h.path));if(i)throw Error(`webModules: ${s.relative(r,t)} imports ${i.path}, which would resolve from ${s.relative(r,s.dirname(e))||"."}; a stand-in imports relatively only from the directory of the module it replaces`)}let w=u.transformSync(p);for(let i of qr(e))a.set(i,w)}return g.set(f,{signature:d,standIns:a}),a}export{j as loadWebModules};
2
+ import{Kr}from"./chunk-ysfgabpf.js";import{existsSync as m,statSync as x}from"fs";import s from"path";var g=new Map;function M(r){let n=s.extname(r);if(n===".tsx")return"tsx";if(n===".jsx")return"jsx";if(n===".ts"||n===".mts"||n===".cts")return"ts";return"js"}async function j(r,n){let l=Object.entries(n).map(([e,t])=>[s.resolve(r,e),s.resolve(r,t)]),d=l.map(([e,t])=>{try{return`${e}\x00${t}\x00${x(t).mtimeMs}`}catch{return`${e}\x00${t}\x00-`}}).join(`
3
+ `),f=`${r}\x00${JSON.stringify(n)}`,o=g.get(f);if(o&&o.signature===d)return o.standIns;let a=new Map;for(let[e,t]of l){let c=s.relative(r,e);if(!m(e))throw Error(`webModules: ${c} does not exist`);if(!m(t))throw Error(`webModules: ${s.relative(r,t)}, the stand-in for ${c}, does not exist`);if(e===t)throw Error(`webModules: ${c} stands in for itself`);let p=await Bun.file(t).text(),u=new Bun.Transpiler({loader:M(t),target:"browser"});if(s.dirname(t)!==s.dirname(e)){let i=u.scanImports(p).find((h)=>/^\.\.?\//.test(h.path));if(i)throw Error(`webModules: ${s.relative(r,t)} imports ${i.path}, which would resolve from ${s.relative(r,s.dirname(e))||"."}; a stand-in imports relatively only from the directory of the module it replaces`)}let w=u.transformSync(p);for(let i of Kr(e))a.set(i,w)}return g.set(f,{signature:d,standIns:a}),a}export{j as loadWebModules};
@@ -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 Gt(){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 lo(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 ta(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 na(e){console.log(` ${O("\u2139")} ${e}`)}function ra(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 uo(){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 sa(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{Gt,lo,Jt,ta,gt,na,ra,uo,Yt,sa,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 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};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{existsSync as A,mkdtempSync as D,readdirSync as M,rmSync as b,statSync as g,writeFileSync as k}from"fs";import{constants as P,tmpdir as x}from"os";import{join as s}from"path";import t from"process";var _=/^stx-(?:.+-)?p(\d+)-\w{6}$/,v=".stx-keep",I=60000,N=["SIGINT","SIGTERM","SIGHUP"],i=new Set,y=new Set,c=!1,S=new Set;function p(e){try{b(e,{recursive:!0,force:!0})}catch{}}function R(){for(let e of i)p(e);i.clear(),f()}function E(){for(let e of i)p(e);i.clear()}function C(e){if(R(),t.listenerCount(e)===0)t.exit(128+(P.signals[e]??1))}var h=new Map(N.map((e)=>[e,()=>C(e)]));function G(){if(c)return;c=!0,t.on("exit",E);for(let[e,n]of h)try{t.on(e,n)}catch{}}function f(){if(!c)return;c=!1,t.off("exit",E);for(let[e,n]of h)t.off(e,n)}function K(e){try{return t.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function O(e={}){let n=e.root??x(),r=e.isAlive??K,w=e.minAgeMs??I,T=e.now??Date.now(),a=[],u;try{u=M(n)}catch{return a}for(let d of u){let l=_.exec(d);if(!l)continue;let m=Number(l[1]);if(m===t.pid||r(m))continue;let o=s(n,d);try{if(!g(o).isDirectory())continue;if(T-g(o).mtimeMs<w)continue;if(A(s(o,v)))continue}catch{continue}p(o),a.push(o)}return a}function L(e){let n=e.replace(/^stx-/,"").replace(/-+$/,"");return n?`stx-${n}-p${t.pid}-`:`stx-p${t.pid}-`}function z(e=t.env){let n=e.STX_KEEP_TEMP?.trim().toLowerCase();return!!n&&n!=="0"&&n!=="false"}function Ze(e="stx",n=x()){if(!S.has(n))S.add(n),O({root:n});let r=D(s(n,L(e)));if(z())return H(r),console.warn(`[stx] STX_KEEP_TEMP: keeping ${r}`),r;return G(),i.add(r),r}function ue(e){if(y.has(e))return;if(p(e),i.delete(e),i.size===0)f()}function H(e){try{k(s(e,v),`kept by pid ${t.pid}
3
- `)}catch{}if(y.add(e),i.delete(e),i.size===0)f()}async function cc(e,n){let r=Ze(e);try{return await n(r)}finally{ue(r)}}
4
- export{Ze,ue,cc};
2
+ import{existsSync as A,mkdtempSync as D,readdirSync as M,rmSync as b,statSync as g,writeFileSync as k}from"fs";import{constants as P,tmpdir as x}from"os";import{join as s}from"path";import t from"process";var _=/^stx-(?:.+-)?p(\d+)-\w{6}$/,v=".stx-keep",I=60000,N=["SIGINT","SIGTERM","SIGHUP"],i=new Set,y=new Set,c=!1,S=new Set;function p(e){try{b(e,{recursive:!0,force:!0})}catch{}}function R(){for(let e of i)p(e);i.clear(),f()}function E(){for(let e of i)p(e);i.clear()}function C(e){if(R(),t.listenerCount(e)===0)t.exit(128+(P.signals[e]??1))}var h=new Map(N.map((e)=>[e,()=>C(e)]));function G(){if(c)return;c=!0,t.on("exit",E);for(let[e,n]of h)try{t.on(e,n)}catch{}}function f(){if(!c)return;c=!1,t.off("exit",E);for(let[e,n]of h)t.off(e,n)}function K(e){try{return t.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function O(e={}){let n=e.root??x(),r=e.isAlive??K,w=e.minAgeMs??I,T=e.now??Date.now(),a=[],u;try{u=M(n)}catch{return a}for(let d of u){let l=_.exec(d);if(!l)continue;let m=Number(l[1]);if(m===t.pid||r(m))continue;let o=s(n,d);try{if(!g(o).isDirectory())continue;if(T-g(o).mtimeMs<w)continue;if(A(s(o,v)))continue}catch{continue}p(o),a.push(o)}return a}function L(e){let n=e.replace(/^stx-/,"").replace(/-+$/,"");return n?`stx-${n}-p${t.pid}-`:`stx-p${t.pid}-`}function z(e=t.env){let n=e.STX_KEEP_TEMP?.trim().toLowerCase();return!!n&&n!=="0"&&n!=="false"}function Qe(e="stx",n=x()){if(!S.has(n))S.add(n),O({root:n});let r=D(s(n,L(e)));if(z())return H(r),console.warn(`[stx] STX_KEEP_TEMP: keeping ${r}`),r;return G(),i.add(r),r}function ue(e){if(y.has(e))return;if(p(e),i.delete(e),i.size===0)f()}function H(e){try{k(s(e,v),`kept by pid ${t.pid}
3
+ `)}catch{}if(y.add(e),i.delete(e),i.size===0)f()}async function dc(e,n){let r=Qe(e);try{return await n(r)}finally{ue(r)}}
4
+ export{Qe,ue,dc};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{dh,ph}from"./chunk-0g2mg8cw.js";export{ph as ensureTeleportTargets,dh as processTeleportDirectives};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import l from"fs";import u from"path";var m=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],x=3;function h(e,t){let r=u.resolve(u.dirname(t),e);for(let o of b){let s=r+o;try{if(l.statSync(s).isFile())return s}catch{}}return null}function Fr(e,t,r=0,o=new Set){if(!t||r>=x)return!1;for(let s of e.matchAll(g)){let n=h(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=l.readFileSync(n,"utf8")}catch{continue}if(m.test(i))return!0;if(Fr(i,n,r+1,o))return!0}return!1}var C=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","memo","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refDebounced","refresh","registerStoresClient","setKeptScope","setRouteParams","sharedRequest","state","untrack","useAsync","useBroadcastStream","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebounceFn","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useNativeDesktop","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useThrottleFn","useTimeout","useTimeoutFn","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],_l=["onMount","onDestroy"];function ft(e="const",t=[],r){let o=t.length?C.filter((s)=>!t.includes(s)):C;if(r!==void 0)o=o.filter((s)=>{let n=s.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${n}(?![\\w$])`).test(r)});return`${e} { ${o.join(", ")} } = window.stx;`}var y=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var S=C.filter((e)=>!y.includes(e));function Fi(e){if(!e)return!1;return S.some((t)=>new RegExp(`\\b${t}\\s*(?:<[^>]*>)?\\s*\\(`).test(e))}var v=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],E=/\s@[a-z][\w.:-]*\s*=/i;function Cl(e,t){if(!e)return!1;let r=f(e);return d(r,t)}function d(e,t){if(v.some((r)=>r.test(e)))return!0;if(Fi(e))return!0;return T(e,t)}function T(e,t){if(!t)return!1;for(let r of e.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(Fr(r[1],t))return!0;return!1}function El(e,t){if(!e)return!1;let r=f(e);return E.test(r)||d(r,t)}var R=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function Tl(e){return R.includes(e.toLowerCase())}var oo=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],_=["x-init","x-transition","x-effect","x-on"],$l=[...oo,..._];function Rl(){return`{${oo.map((e)=>`'${e}':1`).join(",")}}`}var zi=["class","style","text","html","show","model","if","ref"];function Al(){return`{${zi.map((e)=>e==="if"?"'if':1":`${e}:1`).join(",")}}`}var p=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","keydown","keyup","keypress","input","change","submit","focus","blur","scroll","resize","touchstart","touchend","touchmove","contextmenu","wheel","pointerdown","pointerup","pointermove"];function Pl(){return`/^(${p.join("|")})(?:\\.|$)/`}function Il(e){return p.some((t)=>e===t||e.startsWith(`${t}.`))}var w=65536,A=4,c=new Map;function f(e){if(!e)return e;if(!e.includes("<!--")&&!/<(?:pre|code)\b/i.test(e))return e;let t=e.length>=w;if(t){let s=c.get(e);if(s!==void 0)return s}let r=(s)=>s.replace(/(<[^>]*>)|([^<]+)/g,(n,i,a)=>i??" ".repeat(a.length)),o=e.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/<!--[\s\S]*?-->/g,(s)=>" ".repeat(s.length));if(t){while(c.size>=A){let s=c.keys().next();if(s.done)break;c.delete(s.value)}c.set(e,o)}return o}
3
- export{Fr,C,_l,ft,Fi,Cl,El,Tl,oo,$l,Rl,zi,Al,Pl,Il};
2
+ import l from"fs";import u from"path";var m=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],x=3;function h(e,t){let r=u.resolve(u.dirname(t),e);for(let o of b){let s=r+o;try{if(l.statSync(s).isFile())return s}catch{}}return null}function zr(e,t,r=0,o=new Set){if(!t||r>=x)return!1;for(let s of e.matchAll(g)){let n=h(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=l.readFileSync(n,"utf8")}catch{continue}if(m.test(i))return!0;if(zr(i,n,r+1,o))return!0}return!1}var C=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","memo","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refDebounced","refresh","registerStoresClient","setKeptScope","setRouteParams","sharedRequest","state","untrack","useAsync","useBroadcastStream","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebounceFn","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useNativeDesktop","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useThrottleFn","useTimeout","useTimeoutFn","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],Tl=["onMount","onDestroy"];function ft(e="const",t=[],r){let o=t.length?C.filter((s)=>!t.includes(s)):C;if(r!==void 0)o=o.filter((s)=>{let n=s.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${n}(?![\\w$])`).test(r)});return`${e} { ${o.join(", ")} } = window.stx;`}var y=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var S=C.filter((e)=>!y.includes(e));function Wi(e){if(!e)return!1;return S.some((t)=>new RegExp(`\\b${t}\\s*(?:<[^>]*>)?\\s*\\(`).test(e))}var v=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],E=/\s@[a-z][\w.:-]*\s*=/i;function $l(e,t){if(!e)return!1;let r=f(e);return d(r,t)}function d(e,t){if(v.some((r)=>r.test(e)))return!0;if(Wi(e))return!0;return T(e,t)}function T(e,t){if(!t)return!1;for(let r of e.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(zr(r[1],t))return!0;return!1}function Rl(e,t){if(!e)return!1;let r=f(e);return E.test(r)||d(r,t)}var R=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function Al(e){return R.includes(e.toLowerCase())}var co=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],_=["x-init","x-transition","x-effect","x-on"],Pl=[...co,..._];function Il(){return`{${co.map((e)=>`'${e}':1`).join(",")}}`}var qi=["class","style","text","html","show","model","if","ref"];function Ol(){return`{${qi.map((e)=>e==="if"?"'if':1":`${e}:1`).join(",")}}`}var p=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","keydown","keyup","keypress","input","change","submit","focus","blur","scroll","resize","touchstart","touchend","touchmove","contextmenu","wheel","pointerdown","pointerup","pointermove"];function Nl(){return`/^(${p.join("|")})(?:\\.|$)/`}function Dl(e){return p.some((t)=>e===t||e.startsWith(`${t}.`))}var w=65536,A=4,c=new Map;function f(e){if(!e)return e;if(!e.includes("<!--")&&!/<(?:pre|code)\b/i.test(e))return e;let t=e.length>=w;if(t){let s=c.get(e);if(s!==void 0)return s}let r=(s)=>s.replace(/(<[^>]*>)|([^<]+)/g,(n,i,a)=>i??" ".repeat(a.length)),o=e.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/<!--[\s\S]*?-->/g,(s)=>" ".repeat(s.length));if(t){while(c.size>=A){let s=c.keys().next();if(s.done)break;c.delete(s.value)}c.set(e,o)}return o}
3
+ export{zr,C,Tl,ft,Wi,$l,Rl,Al,co,Pl,Il,qi,Ol,Nl,Dl};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{h,y,g}from"./chunk-9waxasf6.js";import{U}from"./chunk-2xc457bf.js";import{i}from"./chunk-c8jhskx8.js";import k from"path";var q={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var M=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function H(e){let t=[],o=0,n;M.lastIndex=0;while((n=M.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let s=n[1],r=n[2];t.push({type:"suspense",name:s,content:r}),o=n.index+n[0].length}if(o<e.length){let s=e.slice(o);if(s.trim())t.push({type:t.length===0?"shell":"content",content:s})}if(t.length===0)t.push({type:"shell",content:e});return t}async function Ym(e,t={},o={}){let n={...U,...o,streaming:{...q,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),p=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),f={...t,__filename:e,__dirname:k.dirname(e)};if(p.trim())await h(p,f,e);let E=H(c),l=new Set;if(!E.some((w)=>w.type==="suspense")){let w=n.streaming?.strategy||"auto",x=new RegExp(T.source,"g");if(!(w!=="manual"&&x.test(c))){let u=await i(c,f,e,n,l);for(let b=0;b<u.length;b+=s)r.enqueue(u.slice(b,b+s)),await new Promise((m)=>setTimeout(m,0))}else{let u=[],b=new RegExp(T.source,"g"),m;while((m=b.exec(c))!==null)u.push({name:m[1],content:m[2],start:m.index,end:m.index+m[0].length});let v=0;for(let _ of u){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let O=await i(I,f,e,n,l);r.enqueue(O),await new Promise((D)=>setTimeout(D,0))}}let C=await i(_.content,f,e,n,l);r.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await i(_,f,e,n,l);r.enqueue(C)}}}}else{let w=new Map;for(let d of E)if(d.type==="shell"||d.type==="content"){let u=await i(d.content,f,e,n,l);r.enqueue(u)}else if(d.type==="suspense"&&d.name){let u=`stx-suspense-${d.name}`;r.enqueue(`<div id="${u}" data-suspense="${d.name}" style="display:contents;">
2
+ import{h,y,g}from"./chunk-5gx403te.js";import{U}from"./chunk-ctjxcaxq.js";import{i}from"./chunk-k0t9ye9j.js";import k from"path";var q={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var M=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function H(e){let t=[],o=0,n;M.lastIndex=0;while((n=M.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let s=n[1],r=n[2];t.push({type:"suspense",name:s,content:r}),o=n.index+n[0].length}if(o<e.length){let s=e.slice(o);if(s.trim())t.push({type:t.length===0?"shell":"content",content:s})}if(t.length===0)t.push({type:"shell",content:e});return t}async function eh(e,t={},o={}){let n={...U,...o,streaming:{...q,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),p=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),f={...t,__filename:e,__dirname:k.dirname(e)};if(p.trim())await h(p,f,e);let E=H(c),l=new Set;if(!E.some((w)=>w.type==="suspense")){let w=n.streaming?.strategy||"auto",x=new RegExp(T.source,"g");if(!(w!=="manual"&&x.test(c))){let u=await i(c,f,e,n,l);for(let b=0;b<u.length;b+=s)r.enqueue(u.slice(b,b+s)),await new Promise((m)=>setTimeout(m,0))}else{let u=[],b=new RegExp(T.source,"g"),m;while((m=b.exec(c))!==null)u.push({name:m[1],content:m[2],start:m.index,end:m.index+m[0].length});let v=0;for(let _ of u){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let O=await i(I,f,e,n,l);r.enqueue(O),await new Promise((D)=>setTimeout(D,0))}}let C=await i(_.content,f,e,n,l);r.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await i(_,f,e,n,l);r.enqueue(C)}}}}else{let w=new Map;for(let d of E)if(d.type==="shell"||d.type==="content"){let u=await i(d.content,f,e,n,l);r.enqueue(u)}else if(d.type==="suspense"&&d.name){let u=`stx-suspense-${d.name}`;r.enqueue(`<div id="${u}" data-suspense="${d.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
4
  </div>`),w.set(d.name,i(d.content,f,e,n,l))}r.enqueue(`
5
5
  <script>
@@ -17,13 +17,13 @@ import{h,y,g}from"./chunk-9waxasf6.js";import{U}from"./chunk-2xc457bf.js";import
17
17
  }
18
18
  };
19
19
  })();
20
- </script>`);let x=Array.from(w.entries()).map(async([d,u])=>{r.enqueue(await Aa(d,u))});await Promise.all(x)}r.close()}catch(a){r.error(a)}}})}async function Aa(e,t){try{let n=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
20
+ </script>`);let x=Array.from(w.entries()).map(async([d,u])=>{r.enqueue(await Oa(d,u))});await Promise.all(x)}r.close()}catch(a){r.error(a)}}})}async function Oa(e,t){try{let n=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
21
21
  <script>
22
22
  window.__stxSuspense.resolve('${e}', \`${n}\`);
23
23
  </script>`}catch(o){let n=o instanceof Error?o.message:String(o);return`
24
24
  <script>
25
25
  window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading content: ${g(n)}</div>');
26
- </script>`}}var _u=`
26
+ </script>`}}var Tu=`
27
27
  <script>
28
28
  (function(){
29
29
  window.__stxSuspense = window.__stxSuspense || {
@@ -43,12 +43,12 @@ window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading conte
43
43
  }
44
44
  };
45
45
  })();
46
- </script>`;function z(e,t,o){if(!t||t<=0)return e;let n,s=new Promise((r,a)=>{n=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,s]).finally(()=>clearTimeout(n))}function Zm(e,t=[],o={}){let n=o.timeoutMs??0;return new ReadableStream({async start(s){try{if(s.enqueue(e),t.length>0)s.enqueue(_u),await Promise.all(t.map(async(r)=>{let a=z(r.render(),n,r.id);s.enqueue(await Aa(r.id,a))}));s.close()}catch(r){s.error(r)}}})}var A=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function Qm(e,t){return e.replace(A,(o,n,s)=>{let r=n.trim(),a=s.split(/@fallback/i),S=a[0].trim(),p=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[r]=S,`<div data-suspense="${r}">${p}</div>`})}function eh(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,n])=>typeof n==="function");return o.length>0?o.map(([n,s])=>({id:n,render:s})):void 0}async function th(e,t={},o={}){let n={...U,...o,streaming:{...q,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),p=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),f={...t,__filename:e,__dirname:k.dirname(e)};if(p.trim())await h(p,f,e);let E=new Set,l=n.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(l!=="manual"&&R.test(c))){let x=await i(c,f,e,n,E);for(let d=0;d<x.length;d+=s)r.enqueue(x.slice(d,d+s))}else{let x=[],d=new RegExp(T.source,"g"),u;while((u=d.exec(c))!==null)x.push({name:u[1],content:u[2],start:u.index,end:u.index+u[0].length});let b=0;for(let m of x){if(m.start>b){let _=c.slice(b,m.start);if(_.trim()){let C=await i(_,f,e,n,E);r.enqueue(C)}}let v=await i(m.content,f,e,n,E);r.enqueue(v),b=m.end}if(b<c.length){let m=c.slice(b);if(m.trim()){let v=await i(m,f,e,n,E);r.enqueue(v)}}}r.close()}catch(a){r.error(a)}}})}async function nh(e,t={}){let o={...U,...t,streaming:{...q,...t.streaming}},n=await Bun.file(e).text(),s=n.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),r=s?s[1]:"",a=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),S=a,p={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let l=c[1],R=c[2];p[l]=R}let f=a.replace(T,"");return{renderShell:async(l={})=>{let R={...l,__filename:e,__dirname:k.dirname(e)};return await h(r,R,e),i(f,R,e,o,new Set)},renderSection:async(l,R={})=>{try{if(!p[l])return`<div class="error-message">Section "${g(l)}" not found in template "${g(e)}"</div>`;let w={...R,__filename:e,__dirname:k.dirname(e)};await h(r,w,e);let x=new Set;return await i(p[l],w,e,o,x)}catch(w){let x=w instanceof Error?w.message:String(w);return y("Expression",x,e,p[l]||"",0,p[l]||"")}},getSections:()=>Object.keys(p),getTemplate:()=>S}}var Cu={name:"suspense",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let s=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${s} -->${e}<!-- @endsuspense:${s} -->`}},Eu={name:"island",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let s=t[0].replace(/['"`]/g,""),r=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${s}-${Math.random().toString(36).substring(2,9)}`,S=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),p=S?S[1].trim():"",c=S?e.replace(S[0],""):e;return`<div data-island="${s}" data-island-id="${a}" data-priority="${r}">
46
+ </script>`;function z(e,t,o){if(!t||t<=0)return e;let n,s=new Promise((r,a)=>{n=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,s]).finally(()=>clearTimeout(n))}function th(e,t=[],o={}){let n=o.timeoutMs??0;return new ReadableStream({async start(s){try{if(s.enqueue(e),t.length>0)s.enqueue(Tu),await Promise.all(t.map(async(r)=>{let a=z(r.render(),n,r.id);s.enqueue(await Oa(r.id,a))}));s.close()}catch(r){s.error(r)}}})}var A=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function nh(e,t){return e.replace(A,(o,n,s)=>{let r=n.trim(),a=s.split(/@fallback/i),S=a[0].trim(),p=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[r]=S,`<div data-suspense="${r}">${p}</div>`})}function rh(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,n])=>typeof n==="function");return o.length>0?o.map(([n,s])=>({id:n,render:s})):void 0}async function sh(e,t={},o={}){let n={...U,...o,streaming:{...q,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),p=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),f={...t,__filename:e,__dirname:k.dirname(e)};if(p.trim())await h(p,f,e);let E=new Set,l=n.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(l!=="manual"&&R.test(c))){let x=await i(c,f,e,n,E);for(let d=0;d<x.length;d+=s)r.enqueue(x.slice(d,d+s))}else{let x=[],d=new RegExp(T.source,"g"),u;while((u=d.exec(c))!==null)x.push({name:u[1],content:u[2],start:u.index,end:u.index+u[0].length});let b=0;for(let m of x){if(m.start>b){let _=c.slice(b,m.start);if(_.trim()){let C=await i(_,f,e,n,E);r.enqueue(C)}}let v=await i(m.content,f,e,n,E);r.enqueue(v),b=m.end}if(b<c.length){let m=c.slice(b);if(m.trim()){let v=await i(m,f,e,n,E);r.enqueue(v)}}}r.close()}catch(a){r.error(a)}}})}async function oh(e,t={}){let o={...U,...t,streaming:{...q,...t.streaming}},n=await Bun.file(e).text(),s=n.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),r=s?s[1]:"",a=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),S=a,p={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let l=c[1],R=c[2];p[l]=R}let f=a.replace(T,"");return{renderShell:async(l={})=>{let R={...l,__filename:e,__dirname:k.dirname(e)};return await h(r,R,e),i(f,R,e,o,new Set)},renderSection:async(l,R={})=>{try{if(!p[l])return`<div class="error-message">Section "${g(l)}" not found in template "${g(e)}"</div>`;let w={...R,__filename:e,__dirname:k.dirname(e)};await h(r,w,e);let x=new Set;return await i(p[l],w,e,o,x)}catch(w){let x=w instanceof Error?w.message:String(w);return y("Expression",x,e,p[l]||"",0,p[l]||"")}},getSections:()=>Object.keys(p),getTemplate:()=>S}}var $u={name:"suspense",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let s=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${s} -->${e}<!-- @endsuspense:${s} -->`}},Ru={name:"island",hasEndTag:!0,handler:(e,t,o,n)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let s=t[0].replace(/['"`]/g,""),r=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${s}-${Math.random().toString(36).substring(2,9)}`,S=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),p=S?S[1].trim():"",c=S?e.replace(S[0],""):e;return`<div data-island="${s}" data-island-id="${a}" data-priority="${r}">
47
47
  ${c}
48
48
  <script type="application/json" data-island-props="${a}">
49
49
  ${p?`{${p}}`:"{}"}
50
50
  </script>
51
- </div>`}};function rh(e={}){let t=[];if(e.streaming?.enabled)t.push(Cu);if(e.hydration?.enabled)t.push(Eu);return t}async function sh(e,t,o,n={}){return e}function oh(e,t={}){let o=new TextEncoder,n=e.pipeThrough(new TransformStream({transform(r,a){a.enqueue(o.encode(r))}})),s=new Headers(t.headers);if(!s.has("Content-Type"))s.set("Content-Type","text/html; charset=utf-8");if(!s.has("Transfer-Encoding"))s.set("Transfer-Encoding","chunked");if(!s.has("X-Content-Type-Options"))s.set("X-Content-Type-Options","nosniff");if(!s.has("X-Accel-Buffering"))s.set("X-Accel-Buffering","no");return new Response(n,{...t,headers:s})}function ih(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:n=!0}=e,s=Object.entries(o).map(([r,a])=>`'${r}': ${n?`() => import('${a}')`:`require('${a}')`}`).join(`,
51
+ </div>`}};function ih(e={}){let t=[];if(e.streaming?.enabled)t.push($u);if(e.hydration?.enabled)t.push(Ru);return t}async function ah(e,t,o,n={}){return e}function ch(e,t={}){let o=new TextEncoder,n=e.pipeThrough(new TransformStream({transform(r,a){a.enqueue(o.encode(r))}})),s=new Headers(t.headers);if(!s.has("Content-Type"))s.set("Content-Type","text/html; charset=utf-8");if(!s.has("Transfer-Encoding"))s.set("Transfer-Encoding","chunked");if(!s.has("X-Content-Type-Options"))s.set("X-Content-Type-Options","nosniff");if(!s.has("X-Accel-Buffering"))s.set("X-Accel-Buffering","no");return new Response(n,{...t,headers:s})}function lh(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:n=!0}=e,s=Object.entries(o).map(([r,a])=>`'${r}': ${n?`() => import('${a}')`:`require('${a}')`}`).join(`,
52
52
  `);if(t==="loader")return`
53
53
  (function() {
54
54
  window.__stx = window.__stx || {};
@@ -191,4 +191,4 @@ else {
191
191
  stx.hydrate();
192
192
  }
193
193
  })();`}
194
- export{Ym,Aa,_u,Zm,Qm,eh,th,nh,Cu,Eu,rh,sh,oh,ih};
194
+ export{eh,Oa,Tu,th,nh,rh,sh,oh,$u,Ru,ih,ah,ch,lh};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Xt}from"./chunk-18a3vdnq.js";import{c,f}from"./chunk-fd1bpv35.js";function io(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=Xt(e),i=`
2
+ import{Gt}from"./chunk-pk714ynv.js";import{c,f}from"./chunk-yxdhz4ps.js";function lo(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=Gt(e),i=`
3
3
  <!-- stx PWA Meta Tags -->
4
4
  <link rel="manifest" href="/manifest.json">
5
5
  <meta name="theme-color" content="${a(r?.themeColor||"#000000")}">
@@ -43,11 +43,11 @@ if ('serviceWorker' in navigator) {
43
43
  });
44
44
  }
45
45
  </script>
46
- <!-- End stx PWA -->`,i}function Hi(e,n){let r=n.pwa;if(!r?.enabled||r.autoInject===!1)return e;if(e.includes("<!-- stx PWA Meta Tags -->"))return e;if(!e.includes("</head>")){let o=c(e);if(o!==-1){let i=io(n);return e.slice(0,o)+i+`
47
- `+e.slice(o)}return e+io(n)}let t=io(n);return f(e,t)}function Fg(e){if(!e.pwa?.enabled)return"";return`<script>
46
+ <!-- End stx PWA -->`,i}function Ki(e,n){let r=n.pwa;if(!r?.enabled||r.autoInject===!1)return e;if(e.includes("<!-- stx PWA Meta Tags -->"))return e;if(!e.includes("</head>")){let o=c(e);if(o!==-1){let i=lo(n);return e.slice(0,o)+i+`
47
+ `+e.slice(o)}return e+lo(n)}let t=lo(n);return f(e,t)}function Vg(e){if(!e.pwa?.enabled)return"";return`<script>
48
48
  if ('serviceWorker' in navigator) {
49
49
  window.addEventListener('load', function() {
50
- navigator.serviceWorker.register('/${Xt(e)}')
50
+ navigator.serviceWorker.register('/${Gt(e)}')
51
51
  .then(function(registration) {
52
52
  console.log('[PWA] Service Worker registered:', registration.scope);
53
53
  })
@@ -56,5 +56,5 @@ if ('serviceWorker' in navigator) {
56
56
  });
57
57
  });
58
58
  }
59
- </script>`}function zg(){return'<link rel="manifest" href="/manifest.json">'}function Hg(e){return`<meta name="theme-color" content="${a(e)}">`}function a(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}
60
- export{io,Hi,Fg,zg,Hg};
59
+ </script>`}function Ug(){return'<link rel="manifest" href="/manifest.json">'}function Wg(e){return`<meta name="theme-color" content="${a(e)}">`}function a(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}
60
+ export{lo,Ki,Vg,Ug,Wg};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{a}from"./chunk-2xc457bf.js";import{_o}from"./chunk-3z1mmar2.js";import p from"path";async function um(t={}){let l=performance.now(),s=t.root||process.cwd(),e=await a(s),o=t.ssr?.routeRules??e.routeRules??{};if(_o(o),!e.ssr&&Object.keys(o).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let u,n;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");u=await i({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:i}=await import("./chunk-zze8tw0h.js");n=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let d=Math.round(performance.now()-l);return{mode:r,ssg:u,ssr:n,duration:d}}
3
- export{um};
2
+ import{a}from"./chunk-ctjxcaxq.js";import{$o}from"./chunk-jt5tzddc.js";import p from"path";async function fm(t={}){let l=performance.now(),s=t.root||process.cwd(),e=await a(s),o=t.ssr?.routeRules??e.routeRules??{};if($o(o),!e.ssr&&Object.keys(o).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let u,n;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");u=await i({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:i}=await import("./chunk-csjqtzwc.js");n=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let d=Math.round(performance.now()-l);return{mode:r,ssg:u,ssr:n,duration:d}}
3
+ export{fm};
@@ -1,18 +1,18 @@
1
1
  // @bun
2
- import{Le,T,re}from"./chunk-9waxasf6.js";import{C}from"./chunk-qjey0jk6.js";import{N,On}from"./chunk-farh4p7f.js";import{a}from"./chunk-2xc457bf.js";import{xe,un,dn,pn}from"./chunk-09jz09k9.js";import{Ct}from"./chunk-p1a1kbhz.js";import{xt,Xn,nn,me}from"./chunk-j89p53vx.js";import{A,In}from"./chunk-9fyw1xkh.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 me(h,t,"",{chunks:[]}),null}let i=()=>[...new Set([...r,...r.flatMap((l)=>xe(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 me(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=re({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=On(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 me(h,t,f,{chunks:[]}),null;f=xt(i());let S={chunks:g};return me(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{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(`
4
4
 
5
5
  `),n=`;(function(){
6
6
  var __stx = window.stx || {};
7
7
  ${C.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()?In(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=Le(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 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() {
11
11
  var __stx = window.stx || {};
12
12
  ${C.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 xh(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 Co(...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 Sh(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=Co(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 kh(s=x.env){return s.STX_PAGE_STORES==="all"}async function _h(s,o,e={}){let t=await O(s,e.sharedModules);if(!t)return null;let{chunks:n}=t,r=Co(...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=Co(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 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(){
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()?In(t):t}function Ch(){h.clear(),Xn()}
26
- export{xh,Co,Sh,kh,_h,Ch};
25
+ })();`;return A()?On(t):t}function $h(){h.clear(),Xn()}
26
+ export{_h,Ro,Ch,Eh,Th,$h};
@@ -0,0 +1,24 @@
1
+ // @bun
2
+ import{$e,Ws,qs,Ks,ve,xi,wn,Xc,Jc,Si,Yc,Zc,Gs,_i,Ci,Qc,Ei,kn}from"./chunk-5gx403te.js";import{C}from"./chunk-fdjx4vs3.js";import{a}from"./chunk-ctjxcaxq.js";import{Ao}from"./chunk-szp7ajfm.js";import{l}from"./chunk-np8wgbsa.js";import{existsSync as G,readFileSync as U}from"fs";import h from"path";var ke=new Set(["module","exports","require","$bool","$num","window","document","console","confirm","alert","fetch"]),oe=kn.filter((e)=>!ke.has(e)).sort(),ce=[...C].sort(),we=[...new Set([...oe,...ce])].sort(),De=new Set(oe),Te=new Set(ce),Ee=new Set(we),se=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function Ce(e,t){if(t==="server")return`'${e}' is not provided by 'stx' in a <script server> block. The engine binds only its own names there (defineProps, state, useHead, ...); any other name becomes \`await import('stx')\`, which does not resolve, so the whole script fails when the page renders. Import it from '@stacksjs/stx' instead.`;return`'${e}' is not provided by 'stx' in a client <script> block. The import is replaced by the window.stx runtime, which has no '${e}', so it is undefined in the browser.`}function ae(e,t){let o=[];for(let d of t){if(d.offset===void 0)continue;let i=d.kind==="server"?De:Te;se.lastIndex=0;for(let c of d.code.matchAll(se)){let m=c.index+c[0].indexOf("{")+1;for(let f of c[1].matchAll(/[^,]+/g)){let k=f[0];if(/^\s*type\s/.test(k))continue;let b=/^\s*([A-Za-z_$][\w$]*)/.exec(k);if(!b)continue;let r=b[1];if(!Ee.has(r)||i.has(r))continue;let u=d.offset+m+f.index+b[0].length-r.length,g=e.slice(0,u),E=g.split(`
3
+ `).length;o.push({line:E,column:u-(g.lastIndexOf(`
4
+ `)+1)+1,offset:u,length:r.length,name:r,kind:d.kind,message:Ce(r,d.kind)})}}}return o}import M from"path";var Ne="@stacksjs/stx-typescript-plugin";function Oe(e,t){let o=M.resolve(e);for(;;){let d=M.join(o,"tsconfig.json");if(t(d))return d;let i=M.dirname(o);if(i===o)return;o=i}}function le(e,t,o){let d=Oe(e,o);if(!d)return;let i=new Set,c=(m)=>{if(i.has(m))return;i.add(m);let f=t(m);if(!f)return;let k=f.compilerOptions?.plugins;if(Array.isArray(k)){let r=k.find((g)=>g?.name===Ne),u=Array.isArray(r?.libs)?r.libs.filter((g)=>typeof g==="string"):[];return r?{configPath:m,libs:u.map((g)=>M.resolve(M.dirname(m),g))}:null}let b=typeof f.extends==="string"?[f.extends]:Array.isArray(f.extends)?f.extends:[];for(let r of[...b].reverse()){if(typeof r!=="string"||!r.startsWith("."))continue;let u=M.resolve(M.dirname(m),r.endsWith(".json")?r:`${r}.json`),g=c(u);if(g!==void 0)return g}return};return c(d)??void 0}function xa(e,t="",o="",d=t,i){let c=e.startLine>1?`
5
+ `.repeat(e.startLine-1):"",m=xi(_i(e)+e.code,d),f=e.kind==="client"&&i?i.project(m.code):void 0,k=wn(f?.code??m.code),b=e.kind==="client"||e.kind==="plain"?Yc(t,e.code):"",r=(c+k).split(`
6
+ `),u=r.length,g=new Map;for(let S of m.declarations)for(let[D,A]of S.text.split(`
7
+ `).entries())if(r.push(A),S.origin)g.set(r.length,{...S.origin,line:e.startLine+S.origin.line-1+D,column:D===0?S.origin.column:1});r.push(...b.split(`
8
+ `),...(i?.declarations??"").split(`
9
+ `),...(e.kind==="server"?qs(e.code):"").split(`
10
+ `)),r.push("export {}","");let E=Gs(r.join(`
11
+ `),o);return{text:E.code,sourceLineCount:u,lineMap:g,scriptColumns:new Map([...m.columns].map(([S,D])=>[S+e.startLine-1,D])),importColumns:E.columns,componentColumns:f?new Map([...f.columns].map(([S,D])=>[S+e.startLine-1,D])):void 0}}function bm(e,t="",o=""){return xa(e,t,o).text}var _e=new Set(["name","status","length","location","history","origin","closed","close","open","focus","blur","print","scroll","scrollTo","scrollBy","stop","top","parent","self","frames","event","external","menubar","toolbar"]);function Me(e){if(e.length===0)return"";let t=["// Generated \u2014 the composables the runtime publishes as bare globals."],o=new Set(C),d=[];for(let{file:i,names:c}of e){let m=JSON.stringify(i.replace(/\\/g,"/").replace(/\.ts$/,""));d.push(` export * from ${m}`);for(let f of c){if(o.has(f)||_e.has(f))continue;o.add(f),t.push(`declare const ${f}: typeof import(${m})[${JSON.stringify(f)}]`)}}return t.push("declare module '@composables' {",...d,"}"),t.join(`
12
+ `)}function Co(e,t,o){return`${e}.__stx_${t}${o}.ts`}function wm(e){return e.replace(/\.__stx_(?:server|client|plain|template)\d+\.ts$/,"")}function eu(){return ue("stx.d.ts")}function tu(){return ue("stx-module.d.ts")}function ue(e){for(let t of[h.resolve(import.meta.dir,"..",e),h.resolve(import.meta.dir,"..","..",e)])if(G(t))return t;return null}var Re=/^(.*?)\((\d+),(\d+)\):\s+(error|warning)\s+TS(\d+):\s+(.*)$/;function pe(e){return e>=1000&&e<2000}function de(e){let t="",o=!1,d=!1;for(let i=0;i<e.length;i++){let c=e[i];if(o){if(t+=c,d)d=!1;else if(c==="\\")d=!0;else if(c==='"')o=!1;continue}if(c==='"'){o=!0,t+=c;continue}if(c==="/"&&e[i+1]==="/"){while(i<e.length&&e[i]!==`
13
+ `)i++;t+=`
14
+ `;continue}if(c==="/"&&e[i+1]==="*"){i+=2;while(i<e.length&&!(e[i]==="*"&&e[i+1]==="/"))i++;i++;continue}t+=c}return t.replace(/,(\s*[}\]])/g,"$1")}function je(e){try{return JSON.parse(de(U(e,"utf8")))}catch{return}}function Pe(e){let t=h.resolve(e),o;for(;;){let r=h.join(t,"tsconfig.json");if(G(r)){o=r;break}let u=h.dirname(t);if(u===t)break;t=u}if(!o)return{};let d=new Set,i=o,c,m,f=o;while(i&&!d.has(i)){d.add(i);let r;try{r=JSON.parse(de(U(i,"utf8")))}catch{break}let u=r?.compilerOptions??{};if(!c&&u.paths&&typeof u.paths==="object")c=u.paths,f=i;if(!m&&typeof u.baseUrl==="string")m=h.resolve(h.dirname(i),u.baseUrl);if(c&&m)break;i=typeof r?.extends==="string"?h.resolve(h.dirname(i),r.extends.endsWith(".json")?r.extends:`${r.extends}.json`):void 0}if(!c)return{};let k=m??h.dirname(f),b={};for(let[r,u]of Object.entries(c)){if(!Array.isArray(u))continue;b[r]=u.map((g)=>typeof g==="string"&&!h.isAbsolute(g)?h.resolve(k,g):g)}return{paths:b}}async function vm(e,t={}){let o=t.client!==!1,d=t.server!==!1,i=t.templates!==!1,c=i?await a():void 0,m=t.componentsDir??c?.componentsDir,f=t.partialsDir??c?.partialsDir,k=t.layoutsDir??c?.layoutsDir,b=new Map(await Promise.all(e.map(async(n)=>[n,await Bun.file(n).text()]))),r=[...b.values()].some((n)=>Ws(ve(n).filter((s)=>s.kind==="server").map((s)=>s.code).join(`
15
+ `))),u=new Map,g=new Map,E=[],S=[],D=0,A=0,O=eu();for(let n of e){let s=b.get(n),x=ve(s).filter((p)=>{if(p.kind==="server")return d;return o}),T=ve(s).filter((p)=>p.kind==="server").map((p)=>p.code).join(`
16
+ `),B=Si(ve(s)),_=Ks(s);for(let p of ae(s,x))E.push({file:n,line:p.line,column:p.column,code:0,message:p.message,category:"error",blockKind:p.kind});if(o&&T){let p=x.filter((v)=>v.kind!=="server"),y=[...new Set(p.flatMap((v)=>Zc(T,v.code)))];if(y.length>0)g.set(n,{names:y,line:p[0].startLine,kind:p[0].kind})}let L=h.dirname(h.resolve(n)),w=i?Ci(s,{runtimeGlobals:!O,originDir:L,filePath:h.resolve(n),componentsDir:m,partialsDir:f,layoutsDir:k,inheritedContractsKnown:r}):null,I=w?[...w.lineMap.values()].filter((p)=>p.expression).length:0;if(x.length===0&&I===0&&!_?.checks.length)continue;if(S.push(n),D+=x.length,A+=I,_&&o&&(x.some((p)=>p.kind!=="server")||!i&&_.checks.length)){let p=Ci(s,{runtimeGlobals:!1,globals:!1,originDir:L,templateExpressions:!1,scriptKinds:["client","plain"],nativeChecks:!i});u.set(Co(n,"client",0),{virtual:p,source:p.text,origin:n,kind:"client"})}if(x.forEach((p,y)=>{if(_&&p.kind!=="server")return;let v=xa(p,T,L,B);u.set(Co(n,p.kind,y),{virtual:v,source:v.text,origin:n,kind:p.kind})}),w&&(I>0||_?.checks.length))u.set(Co(n,"template",0),{source:w.text,origin:n,kind:"template",virtual:w})}if(u.size===0)return{diagnostics:E,checkedFiles:S,blockCount:0,expressionCount:0};let R=(t.extraLibs??[]).map((n)=>h.resolve(n)),fe=le(e.length>0?h.dirname(h.resolve(e[0])):process.cwd(),je,G);for(let n of fe?.libs??[])if(!R.includes(n)&&G(n))R.push(n);if(O)R.push(O);let W=O?tu():null;if(W)R.push(W);let z=`${l()}/typecheck/__stx_globals.d.ts`,me=["// Generated \u2014 the context serve.ts injects into <script server> blocks.",Xc(O?Jc(U(O,"utf8")):void 0),...O?[]:["declare const window: any",...C.map((n)=>`declare const ${n}: any`)],["// Generated \u2014 the names stx auto-imports from @stacksjs/browser.",...$e.map((n)=>`declare const ${n}: any`)].join(`
17
+ `),Me(await Ao())].filter(Boolean).join(`
18
+ `),j=`${l()}/typecheck`;await Bun.$`rm -rf ${j}`.quiet().nothrow(),await Bun.$`mkdir -p ${j}`.quiet().nothrow(),await Bun.write(z,me);let P=new Map,ge=0;for(let[n,s]of u){let x=`${ge++}_${n.replace(/[^\w.-]+/g,"_")}`;await Bun.write(`${j}/${x}`,s.source),P.set(x,s)}let he={target:"ESNext",module:"ESNext",moduleResolution:"bundler",strict:!0,noEmit:!0,skipLibCheck:!0,allowJs:!0,esModuleInterop:!0,resolveJsonModule:!0,lib:["ESNext","DOM","DOM.Iterable"],types:[],...Pe(e.length>0?h.dirname(h.resolve(e[0])):process.cwd()),...t.compilerOptions??{}},q=async(n,s)=>{let x=`${j}/tsconfig${s===1?"":`.${s}`}.json`;await Bun.write(x,JSON.stringify({compilerOptions:he,files:n.map((B)=>`${j}/${B}`).concat(z,...R)},null,2));let T=Bun.spawnSync(["bun","x","tsc","-p",x,"--pretty","false"],{stdout:"pipe",stderr:"pipe"});return{output:new TextDecoder().decode(T.stdout)+new TextDecoder().decode(T.stderr),exitCode:T.exitCode??0}},H=await q([...P.keys()],1),Z=H.output,K=[],Q=H.exitCode,Y=0,xe=new Set(R.map((n)=>n.split("/").pop())),ee=0,F=new Set,te=(n)=>{for(let s of n.replace(/\n[\t ]+([^\n]*)/g," $1").split(`
19
+ `)){let x=s.match(Re);if(!x)continue;if(Y++,xe.has(x[1].split("/").pop()))ee++;let[,T,B,_,L,w,I]=x,p=T.split("/").pop(),y=P.get(p);if(!y)continue;if(pe(Number(w)))F.add(p);let v=Number(B),X=Number(_),re,J=y.kind;if(y.virtual){let N=Ei(y.virtual,v,X)??(y.kind!=="template"&&pe(Number(w))?Ei(y.virtual,y.virtual.sourceLineCount,1):null);if(!N||y.kind==="template"&&!N.expression&&!N.diagnosticOrigin)continue;if(Qc(N,Number(w)))continue;v=N.line,X=N.column,re=N.expression?.code.trim(),J=N.diagnosticOrigin??J}K.push({file:y.origin,line:v,column:X,code:Number(w),message:I,category:L==="error"?"error":"warning",blockKind:J,expression:re})}};te(Z);let ye=Y,be=ee;if(F.size>0&&F.size<P.size){let n=[...P.keys()].filter((s)=>!F.has(s));te((await q(n,2)).output)}if(o)for(let[n,s]of g){if(s.names.length===0)continue;K.push({file:n,line:s.line,column:1,code:0,message:`${s.names.length===1?"1 value reaches":`${s.names.length} values reach`} this block on the implicit bridge and ${s.names.length===1?"is":"are"} untyped: ${s.names.join(", ")}. Declare them with defineClientPayload({ ${s.names.join(", ")} }) in the server block to have them checked.`,category:"warning",blockKind:s.kind})}K.push(...E);let ne=new Set,V=K.filter((n)=>{let s=`${n.file}:${n.line}:${n.column}:${n.code}:${n.message}`;if(ne.has(s))return!1;return ne.add(s),!0});V.sort((n,s)=>n.file.localeCompare(s.file)||n.line-s.line||n.column-s.column);let ie=be>0&&V.length===0,Se=ie||Q!==0&&ye===0?`${ie?"a file passed with --lib has errors of its own, so nothing in your code was checked":`tsc exited ${Q} without reporting any diagnostic, so nothing was checked`}. `+"A syntax error in an ambient declaration file does this \u2014 skipLibCheck suppresses "+`SEMANTIC diagnostics only. tsc said:
20
+ ${Z.trim().split(`
21
+ `).slice(0,12).join(`
22
+ `)||"(no output)"}`:void 0;return{diagnostics:V,checkedFiles:S,blockCount:D,expressionCount:A,failure:Se}}function xm(e){return e.map((t)=>{let o=t.blockKind==="template"?`[template: ${t.expression??""}]`:`[${t.blockKind==="plain"?"<script>":`<script ${t.blockKind}>`}]`;return`${t.file}:${t.line}:${t.column} ${t.category} TS${t.code} ${t.message} ${o}`}).join(`
23
+ `)}
24
+ export{xa,bm,Co,wm,eu,tu,vm,xm};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ty,xs,ti,Ss,gr,ni,ri,tg,ks,_s,Cs,si,_c,ng,Ct}from"./chunk-2mt2zc5y.js";import"./chunk-w8k9fz1w.js";import"./chunk-xtaq95em.js";import"./chunk-ctjxcaxq.js";import"./chunk-ttjscvre.js";import"./chunk-r09kz9bf.js";import"./chunk-zc8a2erc.js";import"./chunk-0sa9gqmc.js";import"./chunk-wp0qpa50.js";import{K}from"./chunk-5gx403te.js";import"./chunk-x4jzhgdm.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{tg as bindLoopInterpolations,ty as clearScriptScanCache,ks as convertServerLoopAttributesToDirectives,ni as convertSignalDirectivesToAttributes,_s as convertSignalLoopsToAttributes,gr as extractClientSignalNames,K as extractExports,_c as findMarkupIndexOutsideScripts,Ss as hasSignalsSyntax,ti as parseLoopExpression,ri as preEvalLiteralReactiveIfs,Cs as processScriptSetup,si as processSignals,ng as rewriteStxImportSpecifiers,xs as scanScriptTags,Ct as stripStxRuntimeImports};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$a,ru}from"./chunk-4517hny7.js";import"./chunk-k1ew643q.js";import"./chunk-f4vgagjb.js";export{ru as createImageHandler,$a as handleImageRequest};